Closed mkavulich closed 2 years ago
Thank you for this PR. This is a very helpful new addition to the CCPP. Going forward, we would like to have a visualization capability but having the script is the foundational step. Do we have any mechanism to make sure ccpp_track_variables does not break when new development is submitted?
@ligiabernardet I haven't included any unit or regression tests yet, but I can make that a priority before opening this PR for review. I'll need to familiarize myself with the existing testing framework first
After addressing some initial concerns (still a few to go) and updating for the most recent commits on main
, this PR is ready for a proper review.
There are a few known issues/limitations right now, I think they can be addressed later on but I figured I'd point them out off the bat:
WARNING: Encountered closing statement "end type" without type name
come from the metadata parser, and I believe are due to problems with the metadata itself.@christinaholtNOAA I believe I have resolved or responded to all your comments, please let me know if you have any further comments or questions.
My main comments have been addressed, so I pass the baton to @gold2718 ...
@mkavulich Would you please update this to the latest main in anticipation of merging?
Initial version of script for tracking which variables are modified by which schemes in a given suite.
This script takes in as input the following arguments:
The script output changes based on the input:
This is a brand new script, so it does not change any existing interfaces. It does add a new variable and method to the Suite class: call_tree is a list of schemes in order (including duplicates) for the given Suite. The method make_call_tree is used to populate the call_tree list; it is not called by the write() method so must be called separately if desired.
Please provide feedback on the format and structure of the program!
I started with roughly the ccpp_prebuild script as a guide, but I am not tied to any particular style or philosophy here.
Testing: test removed: None unit tests: None system tests: None manual testing: Ran script with a variety of inputs, gives expected output. Examples below:
Running examples
No new python packages or other prerequisites are needed, so you can run on any platform that CCPP can already run on. It is also not necessary to build any code or run prebuild scripts; all you need is the ccpp-framework and ccpp-physics repositories, a model config file (this requirement can hopefully be removed in the future), and the xmls for the suites you wish to analyze.
Here is an example setup based on the ufs-weather-model on Hera:
From here, you can run the following example commands:
Successful output: prints list of schemes that use the specified variable, along with the variable's intent
Unknown variable: script exits with descriptive error message
Partial match for variable: outputs list of partial matches for each scheme