Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability for registry to specify input (IC) file variable names for constituents #259

Merged
merged 12 commits into from
Apr 19, 2024

Conversation

nusbaume
Copy link
Collaborator

Add the ability for the registry to specify the possible variable names for constituents on an input or Initial Conditions (IC) file in CAM-SIMA. This should eliminate the need for an IC file to have only standard names for each variable, as long as the variable has the possible names listed in the registry.

Also, the inputnames_to_stdnames.py script and associated stdnames_to_inputnames_dictionary.xml file have now been moved to a new tools directory, as they should no longer be required for running CAM-SIMA (but could still potentially be useful for other situations).

Finally, changes were made to remove the unused config variable from the registry generator, as pylint found that it wasn't actually being used for anything.

Fixes #255

@nusbaume nusbaume added the enhancement New feature or request label Apr 14, 2024
@nusbaume nusbaume self-assigned this Apr 14, 2024
Copy link
Collaborator

@peverwhee peverwhee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one question and a couple of typos

else:
# We need to work with the host model version of this variable
missing = _find_and_add_host_variable(stdname, host_dict,
const_dicts, req_vars)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we still need to pass in const_dicts and include the constituents logic in _find_and_add_host_variable()?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well I tried running all of my tests (including doing snapshot runs) without it and it made no difference, so I am going to go with "no". const_dicsts has now been removed.

outfile.blank_line()
outfile.comment("Check if constituent standard name in registered SIMA standard names list:", 6)
outfile.write("if(any(phys_var_stdnames == ccpp_required_data(req_idx))) then", 6)
outfile.comment("Find array index to extract coorect input names:", 7)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo - "correct" (i think)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you are "correct"! Typo fixed.

outfile.blank_line()
outfile.comment("Check if constituent standard name in registered SIMA standard names list:", 5)
outfile.write("if(any(phys_var_stdnames == ccpp_required_data(req_idx))) then", 5)
outfile.comment("Find array index to extract coorect input names:", 6)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same thrilling typo

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was a harrowing journey, but I believe I have fixed it.

@nusbaume nusbaume requested a review from peverwhee April 18, 2024 23:11
Copy link
Collaborator

@mwaxmonsky mwaxmonsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great @nusbaume!

Was hoping to at least find more spelling errors but it looks like @peverwhee beat me to the punch on them. ☹️

Copy link
Collaborator

@peverwhee peverwhee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks great!

@nusbaume nusbaume merged commit a026181 into ESCOMP:development Apr 19, 2024
6 checks passed
@nusbaume nusbaume deleted the registry_const_ic_names branch April 29, 2024 19:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Tag
Development

Successfully merging this pull request may close these issues.

3 participants