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

Fix water vapor (Q) register incompatibility with initialize_constituents scheme #342

Closed
wants to merge 1 commit into from

Conversation

jimmielin
Copy link
Member

Tag name (required for release branches):
Originator(s): @jimmielin

Description (include the issue title, and the keyword ['closes', 'fixes', 'resolves'] followed by the issue number):

Add water_species and mixing_ratio_type = 'wet' property for when cam_register_constituents registers water vapor when no other scheme explicitly uses water vapor (but might use all CCPP constituents as a whole)

Describe any changes made to build system: N/A

Describe any changes made to the namelist: N/A

List any changes to the defaults for the input datasets (e.g. boundary datasets): N/A

List all files eliminated and why: N/A

List all files added and what they do: N/A

List all existing files that have been modified, and describe the changes:
(Helpful git command: git diff --name-status development...<your_branch_name>)

Add water_species = .true. and mixing_ratio_type = 'wet' to wv_stdname
M       src/control/cam_comp.F90

If there are new failures (compared to the test/existing-test-failures.txt file),
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:

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:

@jimmielin jimmielin added the bug-fix This PR was created to fix a specific bug. label Dec 18, 2024
@jimmielin jimmielin self-assigned this Dec 18, 2024
@jimmielin
Copy link
Member Author

When testing shallow convection with the initialize_constituents scheme to use all constituent data, I have found that the model fails to initialize with the error

 ERROR:
 cam_register_constituents: ccp_model_const_add_metadata ERROR: Trying to add co
 nstituent water_vapor_mixing_ratio_wrt_moist_air_and_condensed_water but an inc
 ompatible constituent with this name already exists at cam_comp.F90:638

Debugging in the CCPP constituents property module shows that the following logic in cam_register_constituents:

      ! Check if water vapor is already marked as a constituent by the
      ! physics:
      call cam_ccpp_is_scheme_constituent(wv_stdname, is_constituent, errflg, errmsg)
...

      !If not requested by the physics, then add water vapor to the
      !constituents object:
      !-------------------------------------------
      if (.not. is_constituent) then
...

         ! Register the constituents so they can be advected:
         call host_constituents(1)%instantiate( &
              std_name=wv_stdname,              &
              long_name="water vapor mixing ratio w.r.t moist air and condensed_water", &
...

Does not add the water_species property whereas initialize_constituents does for Q, leading to the runtime crash. As water vapor is a water species, these properties are now added which allows the model to proceed.

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.

yes - good call @jimmielin !

@nusbaume nusbaume self-requested a review December 19, 2024 22:11
Copy link
Collaborator

@nusbaume nusbaume left a comment

Choose a reason for hiding this comment

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

Thanks for fixing this @jimmielin!

@jimmielin
Copy link
Member Author

Superseded by ESCOMP/atmospheric_physics#185

@jimmielin jimmielin closed this Dec 26, 2024
peverwhee added a commit to ESCOMP/atmospheric_physics that referenced this pull request Dec 26, 2024
…dles (#185)

Originator(s): peverwhee

Summary (include the keyword ['closes', 'fixes', 'resolves'] and issue
number):
Removes water_species property from instantiate call for water vapor
mixing ratio species (as air_composition will set those). We may run
into this issue again at some point for the water vapor number
concentration variables, but hopefully by then we'll have metadata
properties for setting that!
can supersede ESCOMP/CAM-SIMA#342

Describe any changes made to the namelist: n/a

List all files eliminated and why: n/a

List all files added and what they do: n/a

List all existing files that have been modified, and describe the
changes:
(Helpful git command: `git diff --name-status
development...<your_branch_name>`)
M   test/test_schemes/initialize_constituents.F90
- remove water_species property from instantiate call

List any test failures: all expected tests pass

Is this a science-changing update? New physics package, algorithm
change, tuning changes, etc? no
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-fix This PR was created to fix a specific bug.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants