Suite variable tracker for Capgen. - #785
dustinswales wants to merge 1 commit into
Conversation
climbfuji
left a comment
There was a problem hiding this comment.
Quick first review, didn't try it yet.
A more general question I have is if the variable tracker should be "part" of capgen v1, i.e. live in scripts and utilize available tools to access the datatable (piggy-backing on the datatable query script). It would be a fourth entry point.
Right now, it is more like an external tool with its own datatable parser and its own directory (tools).
I am leaning towards a tigher integration, given that the script comes with the CCPP capgen v1 code.
Thoughts?
We also need CI testing for the script.
|
|
||
| # Same, but you only know the local (Fortran) variable name used | ||
| # somewhere -- it will be resolved to the standard_name(s) that share it | ||
| python3 variable_tracker.py trace <file.xml> gt0 --by local_name --suite MPAS_GFS |
There was a problem hiding this comment.
What happens if two schemes use the same local name for different variables (standard names)?
| import xml.etree.ElementTree as ET | ||
| from collections import defaultdict, namedtuple | ||
|
|
||
| PHASES = ("init", "timestep_init", "run", "final") |
There was a problem hiding this comment.
timestep_final is missing
also: ccpp_register, comes before init - but not sure if we should include it yet
| """ | ||
| Return the calls touching `standard_name`, ordered the way they | ||
| actually execute within `suite_name` (group order, then scheme | ||
| order within the group, then phase order init->run->final). |
There was a problem hiding this comment.
This is incorrect. The outside loop is phase, then group, then schemes in group.
| continue | ||
| for i, (group, c) in enumerate(ordered, 1): | ||
| direction = { | ||
| "in": "reads ", |
There was a problem hiding this comment.
Why is reads lowercase while WRITES and R/W are uppercase? Should we just use R, W, RW ?
I like the idea of this script being an entrypoint. |
Script (from Claude) to parse the Capgen generated datatable (.xml).
The script can provide the following information:
User interface changes? No
Addresses #784
Testing:
test removed:
unit tests:
system tests:
manual testing: