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

Update CAM-SIMA to run Kessler and Held-Suarez bit-for-bit with CAM #232

Merged
merged 19 commits into from
Nov 8, 2023

Conversation

nusbaume
Copy link
Collaborator

This PR introduces a large number of standard name and other changes to allow one to run the new Kessler and Held-Suarez physics suites with CAM snapshots, and to ensure that they are bit-for-bit with CAM's results.

This PR also ensures that the SE dycore still runs with both Held-Suarez and Kessler physics suites (but it's values can't be formally checked yet due to the dycore being out-of-sync with CAM).

This PR also performs some code clean-up, and adds the ability for check_field to print the location (as an MPI rank, array column, and vertical level) of the maximum difference for each variable, which should help with debugging.

closes #210

Tests run

Ran single timestep FPHYStest runs with CAM snapshots for Held-Suarez and Kessler with GNU on Derecho with the ne3pg3 grid, and got bit-for-bit results. Also ran FHS94 and FKESSLER compsets with the ne5pg2 grid and the GNU compiler for five timesteps each, and both ran successfully.

@nusbaume nusbaume added enhancement New feature or request externals externals updating issue or PR testing system Related to SIMA testing and/or test scripts code clean-up Made code simpler, better, and/or easier to read. labels Oct 13, 2023
@nusbaume nusbaume self-assigned this Oct 13, 2023
@nusbaume
Copy link
Collaborator Author

The test failures in python 3.12 are due to issues with ParamGen in CIME using a deprecated package. I'll try to get that fixed and the CIME external updated, but if I don't get there in time I'll just remove python 3.12 from the testing options, at least for now.

So feel free to ignore those failures when reviewing. Thanks!

@nusbaume
Copy link
Collaborator Author

All test failures have been fixed now, so this PR should be ready for review. Thanks!

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.

Submitting current comments/requests. I may find a few more, but wanted to send these while you might see them

src/control/cam_comp.F90 Outdated Show resolved Hide resolved
@@ -260,6 +265,9 @@ subroutine air_composition_init()
thermodynamic_active_species_kc(icnst) = kc1
icnst = icnst + 1
dry_species_num = dry_species_num + 1
!Notify constituent object that this species is
!thermodynamically active
call const_set_thermo_active(idx, .true.)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just curious, what is the default if this were not specified?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The default is .false., which is specified in the constituents object itself:

https://github.com/peverwhee/ccpp-framework/blob/add_const_interface/src/ccpp_constituent_prop_mod.F90#L38

src/data/air_composition.F90 Outdated Show resolved Hide resolved
! pref_mid_norm
call mark_as_initialized("reference_pressure_normalized_by_surface_pressure")
call mark_as_initialized("reference_pressure_in_atmosphere_layer_normalized_by_reference_pressure")
Copy link
Collaborator

Choose a reason for hiding this comment

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

I was questioning in in this standard name. I see that this variable does not currently exist. Should it be of instead so it matches the non-normalized name? If so, you'll need to change it everywhere it is used.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

You are definitely correct that there is a standard name bug here, but the error isn't with this standard name, but the one before it, which should be reference_pressure_in_atmosphere_layer instead of reference_pressure_of_atmosphere_layer.

This is because the in_atmosphere_layer version is already in the standard names dictionary and has been accepted by the scientists according to our spreadsheet. I've thus gone ahead and replaced reference_pressure_of_atmosphere_layer with reference_pressure_in_atmosphere_layer in CAM-SIMA.

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.

Just looking for some clarification on a few things but otherwise, looks great @nusbaume!!

cime_config/cam_autogen.py Outdated Show resolved Hide resolved
src/dynamics/se/dp_coupling.F90 Show resolved Hide resolved
src/dynamics/se/dp_coupling.F90 Show resolved Hide resolved
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 good; just a couple questions/comments.

src/control/cam_comp.F90 Outdated Show resolved Hide resolved
src/control/cam_comp.F90 Show resolved Hide resolved
src/dynamics/se/dp_coupling.F90 Outdated Show resolved Hide resolved
src/dynamics/utils/hycoef.F90 Outdated Show resolved Hide resolved
src/physics/utils/physics_data.F90 Outdated Show resolved Hide resolved
src/physics/utils/physics_data.F90 Outdated Show resolved Hide resolved
@nusbaume nusbaume requested review from peverwhee and removed request for mwaxmonsky November 3, 2023 16:05
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.

thanks Jesse!

I also resolved @cacraigucar 's comments that you addressed (but left the comments that Cheryl may want to see the answer to when she returns).

@nusbaume nusbaume dismissed cacraigucar’s stale review November 3, 2023 19:40

@cacraigucar's requested changes have been applied, and reviewed by a different SE. Plus this reviewer is currently on PTO and we don't want to wait until they are back.

@nusbaume
Copy link
Collaborator Author

nusbaume commented Nov 3, 2023

@mwaxmonsky if you get the chance can you approve or re-review this PR? I am trying to avoid breaking too many of my own rules.

@nusbaume
Copy link
Collaborator Author

nusbaume commented Nov 8, 2023

@mwaxmonsky it looks like you resolved your concerns earlier, and since I am hoping to have this repo ready for the presentation in the next 40 minutes I am going to go ahead and break my own rules and get this merged in. Of course feel free to still review the code if you want and let me know if there is anything problematic (as we can always open another PR). Thanks!

@nusbaume nusbaume merged commit 7d299b6 into ESCOMP:development Nov 8, 2023
6 checks passed
@nusbaume nusbaume deleted the updated_standard_names branch November 13, 2023 16:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code clean-up Made code simpler, better, and/or easier to read. enhancement New feature or request externals externals updating issue or PR testing system Related to SIMA testing and/or test scripts
Projects
Status: Tag
Development

Successfully merging this pull request may close these issues.

5 participants