Allow for dimensions set to be used in variables in registry.xml#494
Closed
jimmielin wants to merge 2 commits into
Closed
Allow for dimensions set to be used in variables in registry.xml#494jimmielin wants to merge 2 commits into
jimmielin wants to merge 2 commits into
Conversation
Assisted-by: claude-opus:4.6[1m]
Member
Author
|
I am not sure if this fully resolves #465 but I suspect it does. OK confirmed it does! I can check nacon and rndst dimensioned (ncol, nlev, dst) |
1bd6e3e to
d5fb2dd
Compare
Member
Author
|
It appears that I have independently discovered #462 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Tag name (required for release branches):
Originator(s): @jimmielin
AI tools used (if applicable; please also add the "AI-generated code" label to the PR):
What: claude-opus:4.6[1m]
How: scoped out the work, wrote tests and proposed fix to horizontal_dimensions unassigned in test
Description (include the issue title, and the keyword ['closes', 'fixes', 'resolves'] followed by the issue number):
Background: Variables used in
microp_aerolikenaconandrndstinregistry.xml(to be read from snapshot file) usedust_size_bin_dimensionas a third dimension. That dimension is itself defined as a variablendust(dust_size_bin_dimension) in the same generated module.Problem: The autogen code (
generate_registry_data.py) emits allocate calls using standard names as Fortran identifiers (e.g., allocate(rndst(..., dust_size_bin_dimension))), but only knows how to import dimension variables from external metadata files via use statements. For dimensions defined in the same module, no use statement can be generated (Fortran can't use its own module), so the standard name is undefined at compile time.This fix generates local integer aliases in the allocate subroutine for any dimension that resolves to a variable in the same module:
This only triggers when the dimension is not already provided by an external metadata file (i.e., not in
var_module_dict). The existingnumber_of_ccpp_constituentsspecial case (quoted below) is left untouched:CAM-SIMA/src/data/generate_registry_data.py
Lines 1400 to 1408 in a9a6263
horizontal_dimensionvariable in tests - Claude pointed out that it was unassigned in the test file. In real builds,horizontal_dimensioncomes fromphysics_grid.metavia ausestatement, so no alias is generated for it. It should only be fixed in the test sample file.Describe any changes made to build system:
Describe any changes made to the namelist:
List any changes to the defaults for the input datasets (e.g. boundary datasets):
List all files eliminated and why:
List all files added and what they do:
List all existing files that have been modified, and describe the changes:
(Helpful git command:
git diff --name-status development...<your_branch_name>)If there are new failures (compared to the
test/existing-test-failures.txtfile),have them OK'd by the gatekeeper, note them here, and add them to the file.
If there are baseline differences, include the test and the reason for the
diff. What is the nature of the change? Roundoff?
derecho/intel/aux_sima:
derecho/gnu/aux_sima:
derecho/nvhpc/aux_sima (test is run via Github workflow. Only run the test manually if we need to save new baselines):
If this changes climate describe any run(s) done to evaluate the new
climate in enough detail that it(they) could be reproduced:
CAM-SIMA date used for the baseline comparison tests if different than latest: