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

Updated CCPP Standard Names #13

Merged
merged 17 commits into from
Aug 31, 2021
Merged

Updated CCPP Standard Names #13

merged 17 commits into from
Aug 31, 2021

Conversation

bluefinweiwei
Copy link
Contributor

@bluefinweiwei bluefinweiwei commented May 7, 2021

The following two files were changed with the CCPP standard names that are contained under [non-category] section.
modified: standard_names.xml
modified: Metadata-standard-names.md
fixes #12

	modified:   standard_names.xml

	modified:   Metadata-standard-names.md
	modified:   standard_names.xml
@bluefinweiwei bluefinweiwei changed the title modified: Metadata-standard-names.md Updated CCPP Standard Names May 7, 2021
@gold2718 gold2718 added the enhancement New feature or request label May 7, 2021
Copy link
Collaborator

@cacraigucar cacraigucar left a comment

Choose a reason for hiding this comment

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

FIrst set of comments/questions

Metadata-standard-names.md Outdated Show resolved Hide resolved
Metadata-standard-names.md Show resolved Hide resolved
Metadata-standard-names.md Outdated Show resolved Hide resolved
Metadata-standard-names.md Outdated Show resolved Hide resolved
Metadata-standard-names.md Outdated Show resolved Hide resolved
Metadata-standard-names.md Show resolved Hide resolved
Metadata-standard-names.md Outdated Show resolved Hide resolved
Metadata-standard-names.md Outdated Show resolved Hide resolved
Metadata-standard-names.md Show resolved Hide resolved
Metadata-standard-names.md Show resolved Hide resolved
Metadata-standard-names.md Outdated Show resolved Hide resolved
Metadata-standard-names.md Outdated Show resolved Hide resolved
Metadata-standard-names.md Show resolved Hide resolved
Metadata-standard-names.md Outdated Show resolved Hide resolved
Metadata-standard-names.md Show resolved Hide resolved
Metadata-standard-names.md Show resolved Hide resolved
Metadata-standard-names.md Outdated Show resolved Hide resolved
@dudhia
Copy link
Collaborator

dudhia commented May 21, 2021

Not able to open standard_names.xml. Do we need to review this file too?

@ligiabernardet
Copy link
Collaborator

@dudhia It is sufficient to review the .md file since it is created from the .xml file.

@dudhia
Copy link
Collaborator

dudhia commented May 21, 2021 via email

@dudhia
Copy link
Collaborator

dudhia commented May 21, 2021 via email

Metadata-standard-names.md Outdated Show resolved Hide resolved
Metadata-standard-names.md Outdated Show resolved Hide resolved
Metadata-standard-names.md Outdated Show resolved Hide resolved
Metadata-standard-names.md Outdated Show resolved Hide resolved
Metadata-standard-names.md Outdated Show resolved Hide resolved
Metadata-standard-names.md Outdated Show resolved Hide resolved
Metadata-standard-names.md Outdated Show resolved Hide resolved
Metadata-standard-names.md Outdated Show resolved Hide resolved
Metadata-standard-names.md Outdated Show resolved Hide resolved
Metadata-standard-names.md Outdated Show resolved Hide resolved
@grantfirl
Copy link
Collaborator

@dudhia and @cacraigucar We're pushing a commit sans-duplication in a bit. Thanks for IDing the 4X duplication @dudhia. This should make it (slightly) easier to review.

remove duplication in UFS-based XML additions
@dudhia
Copy link
Collaborator

dudhia commented May 24, 2021 via email

@grantfirl
Copy link
Collaborator

Once @bluefinweiwei accepts/merges a PR into her branch, there is a bit more duplication removal and modifications to the XML/md to address several comments. I also added a simple script to report on duplicates (but not remove -- still need to finish that code).

Note that the XML file in this PR does not pass the XML validation due to a bunch of capital letters (if not other things as well). We can fix that if necessary.

@grantfirl
Copy link
Collaborator

@ligiabernardet Thanks for the confirmation. I'm working on updating this PR as discussed yesterday now. There will be a PR into @bluefinweiwei's fork to inspect at some point, whose changes will get transferred to this PR once approved/merged. As far as updating ccpp-physics and hosts with these further changes, do we want to do that right away? Pro: can maintain consistency with the CCPPStandardNames repo; Con: more PRs to have to test and potentially annoy reviewers.

@ligiabernardet
Copy link
Collaborator

My recommendation is to wait until we reach agreement wrt this PR13 and later proceed to updating ccpp-physics and fv3atm. We do need to reduce the number of standard-name related updates to ccpp-physics and fv3atm to reduce the burden on reviewers.

@grantfirl
Copy link
Collaborator

@grantfirl, @cacraigucar,

Since "constituent_mixing_ratio" originally came from you all, and according to the latest rule change regarding "mixing_ratio", should we add ...wrt_dry_air, wrt_moist_air, wrt_total_mass to this standard name?

Since the array can contain a mix of all these plus number concentration fields, how about just constituents_array?
Or, maybe we should take this out entirely since there is no way it will ever be fixed (e.g., different chemistry suite will have different constituents). Given the CCPP principle that two objects with the same standard name represent the same physical quantity, this feels like something that should not be listed.

Since we do need something to transport arrays of these items around, maybe we should have constituent_array with all the usual rules for mixing ratios. I feel this would work because chemistry suites normally keep all of their constituents in the same form (e.g., volume_mixing_ratio_wrt_total_mass) so the only thing that would vary is the number (and type) of species.

Another wrinkle is that NOAA models have "tracer_concentration" to refer to the same array as the current "constituent_mixing_ratio". These should probably be combined for better portability between hosts. CF doesn't mention "constituent" but does "tracer".

As you mentioned, I don't think that we can just get rid of the array since hosts/physics will want to use something like this. "Array" in "constituent_array" is redundant since dimensions are included in the metadata.

I see a couple of options:

  1. Use an umbrella term like "constituent_concentration" or "tracer_concentration" as a catch-all for whatever the host/physics is using.
  2. Have several different standard names/variables for different denominators, e.g. "tracer_concentration_wrt_moist_air" + "tracer_concentration_wrt_dry_air" + "tracer_concentration_wrt_total_mass".

1 is probably simpler in terms of coding, but makes the code function more ambiguous IMO (actual denominators in the variables are effectively hidden unless documented elsewhere). 2 is probably more work but is more explicit. It also has the benefit of making it obvious when a physics scheme expects one denominator and the host is providing something else.

@gold2718
Copy link
Collaborator

gold2718 commented Aug 6, 2021

Use an umbrella term like "constituent_concentration" or "tracer_concentration" as a catch-all for whatever the host/physics is using.
Have several different standard names/variables for different denominators, e.g. "tracer_concentration_wrt_moist_air" + "tracer_concentration_wrt_dry_air" + "tracer_concentration_wrt_total_mass".

I have a strong preference for 2 as that is the only way we will ever be able to provide checking and (possibly automated) translation. We have had errors in simulations traced to a misunderstanding of whether a particular field was 'wet' or 'dry'.

@dudhia
Copy link
Collaborator

dudhia commented Aug 6, 2021 via email

@grantfirl
Copy link
Collaborator

I also agree with the connotations of tracer vs. constituent. The problem on the NOAA side is that one array is used for both what we would consider atmospheric constituents (which can be described as proper concentrations with common denominators) and passive tracers that are either advected or not by the dycore depending on flags (e.g. cloud fraction, TKE). One could argue about whether the non-constituent components belong in this array, but we cannot necessarily dictate this by considering what would make our CCPP standard names more self-consistent. I believe that for the "tracer_concentration" variable that NOAA models are using, the only "true" relationship amongst the components is that they are potentially advected by the dycore.

@goldy For the constituent_mixing_ratio, I'm guessing that this isn't necessarily the case (and that advected variables are handled differently)? That is, we could not both agree to use something like "potentially_advected_species"?

It still seems like there should be space to combine these into one for better portability, especially since >90% of the variables in NOAA's "tracer_concentration" array are likely actual atmospheric constituents.

I don't know that we would be any worse off (in terms of code understandability) if we did the following:

  1. Create 3 constituent variables/standard names to represent arrays with common denominators: constituent_mixing_ratio becomes one of constituent_mixing_ratio_wrt_moist_air/constituent_mixing_ratio_wrt_dry_air/constituent_mixing_ratio_wrt_total mass
  2. Change NOAA's "tracer_concentration" variable to use the new constituent_mixing_ratio_wrt_moist_air, but it will just have stuff like TKE and cloud_fraction still tacked on to the end?

Any better ideas? I can't finish updating this PR with respect to mixing ratios until this is decided.

@ligiabernardet @dudhia @gold2718

@ligiabernardet
Copy link
Collaborator

@grantfirl I appreciate the challenge here. I have not come up with a reasonable suggestion yet. This topic require discussion in person, perhaps on Tuesday's CCPP Framework meeting.It would be good to get an opinion from @climbfuji when he is back.

The tracer concentration is already problematic as is, since it has units of kg kg-1 but some of the contents of the array are cloud fraction and TKE. However, calling it mixing_ratio_of and keeping the TKE and cloud fraction in it is hard to justify.

… ratios to be specific about denominators, constituent_mixing_ratio names
@cacraigucar
Copy link
Collaborator

Why units of none instead of index like the other control variables?

As I said in #20, I am fine with this not being units=index since the values are floating point numbers. I think index should just be for integers.

Does that mean that the few standard names with have "_real" attached to them should also have their units changed? See soil_type_classification_real for an example of one of these variables.

@dudhia
Copy link
Collaborator

dudhia commented Aug 20, 2021 via email

@gold2718
Copy link
Collaborator

Index should be used only for integers that can be an index in an array.

I like this statement, it should be in the rules (do we need a separate document for rules on units?).

@climbfuji
Copy link
Collaborator

Index should be used only for integers that can be an index in an array.

I like this statement, it should be in the rules (do we need a separate document for rules on units?).

@gold2718 how about this: #21

Copy link
Collaborator

@ligiabernardet ligiabernardet left a comment

Choose a reason for hiding this comment

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

Thank you @grantfirl for addressing several of the previous comments and concerns including:

  • Come up with a better name (potentially_advected_quantities) for tracer_concentration since a) it contains cloud fraction and TKE and b) it can contain non-advected quantities.
  • Improve flag names because "flag_for_PBL" is not descriptive enough.
  • Change mixing ratios to say wrt what.
  • Change volume mix ratio to units of mol mol-1.
  • Change xyz_number_concentration to number_concentration_of_xyz.

@dudhia
Copy link
Collaborator

dudhia commented Aug 24, 2021 via email

Copy link
Collaborator

@dudhia dudhia left a comment

Choose a reason for hiding this comment

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

reminder we want to change this from index to something else like category
Removed from dictionary - resolved

@climbfuji
Copy link
Collaborator

It looks like we are very close to merging this PR. @grantfirl @gold2718 can you please re-review and approve if satisfied?

<standard_name name="ccpp_error_flag"
long_name="Error flag for error handling in CCPP">
<type kind="" units="flag">integer</type>
<standard_name name="ccpp_error_code"
Copy link
Collaborator

Choose a reason for hiding this comment

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

@climbfuji In order to use "flag" consistently in the standard names, I changed this from ccpp_error_flag to ccpp_error_code. I also changed the units of this standard name to 1 and the units of ccpp_error_message to none in accordance with PR #21 . If this is not acceptable, or will otherwise be a pain to have to implement, I can revert it and just add an issue to do this later.

Copy link
Collaborator

Choose a reason for hiding this comment

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

BTW, if this change is OK, I don't think the other changes in a18b0e6 should be controversial, and I will approve the PR for merging. Otherwise, I'll wait to approve until after reverting the ccpp_error* entries.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Changing the standard name for ccpp_error_flag or its units requires a ton of changes in ccpp-physics, fv3atm, scm, and all CCPP documentation. This variable is per requirement used by every scheme and in the host model to catch errors in the physics. Your change makes sense, but I am not sure when there is a good time to change this in the model and ccpp-physics, if at all.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Changing the standard name for ccpp_error_flag or its units requires a ton of changes in ccpp-physics, fv3atm, scm, and all CCPP documentation. This variable is per requirement used by every scheme and in the host model to catch errors in the physics. Your change makes sense, but I am not sure when there is a good time to change this in the model and ccpp-physics, if at all.

It will also require updates to ccpp_prebuild.py and the metadata parser of capgen.py, since these variables are hardcoded in several places.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ya, that's what I thought, and why I pointed it out. If we're being consistent, these changes reflect how they should be, but it's probably best to live with the inconsistency until it is more convenient to change this. I'll go ahead and revert this and then add an issue to reference if/when there is time to address it.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think a good time would be when we update the error handling in the framework and move from the error flag/code and error message to something more sophisticated.

@gold2718
Copy link
Collaborator

In order to use "flag" consistently in the standard names, I changed this from ccpp_error_flag to ccpp_error_code. I also changed the units of this standard name to 1 and the units of ccpp_error_message to none in accordance with PR #21 .

I am a fan of fixing this now. I do not see a good reason to document incorrect usage just because it was done wrong in the past. This just marks a place where the framework needs to catch up to best practice in standard name usage (i.e., open issues in the relevant repositories).

@climbfuji
Copy link
Collaborator

In order to use "flag" consistently in the standard names, I changed this from ccpp_error_flag to ccpp_error_code. I also changed the units of this standard name to 1 and the units of ccpp_error_message to none in accordance with PR #21 .

I am a fan of fixing this now. I do not see a good reason to document incorrect usage just because it was done wrong in the past. This just marks a place where the framework needs to catch up to best practice in standard name usage (i.e., open issues in the relevant repositories).

If you mean fixing it in ESCOMP and then create an issue to at some point later fix it in the actual code, then that is ok of course.

@grantfirl
Copy link
Collaborator

In order to use "flag" consistently in the standard names, I changed this from ccpp_error_flag to ccpp_error_code. I also changed the units of this standard name to 1 and the units of ccpp_error_message to none in accordance with PR #21 .

I am a fan of fixing this now. I do not see a good reason to document incorrect usage just because it was done wrong in the past. This just marks a place where the framework needs to catch up to best practice in standard name usage (i.e., open issues in the relevant repositories).

If you mean fixing it in ESCOMP and then create an issue to at some point later fix it in the actual code, then that is ok of course.

As far as I see it, either we have the inconsistency with the stated rules in N places or N+1 places. Keeping the change in ESCOMP reduces the inconsistency to N places. Progress! I will start an issue in ccpp-framework. IMO, it can be fixed later there (and in hosts + physics) when there is a good opportunity.

Copy link
Collaborator

@gold2718 gold2718 left a comment

Choose a reason for hiding this comment

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

Ok, let's do this!

@climbfuji climbfuji merged commit c3a2677 into ESCOMP:main Aug 31, 2021
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
None yet
Development

Successfully merging this pull request may close these issues.

Dictionary need to be expanded to include names currently used in ccpp-physics
7 participants