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

read in all possible constituents from file, not just build-time ones #301

Merged
merged 14 commits into from
Dec 2, 2024

Conversation

peverwhee
Copy link
Collaborator

Tag name (required for release branches):
Originator(s): peverwhee

Summary (include the keyword ['closes', 'fixes', 'resolves'] and issue number):

  • Updates to enable reading in data for runtime constituents

Describe any changes made to build system:
M cime_config/cam_autogen.py
M cime_config/cam_build_cache.py
M cime_config/cam_config.py

  • keep track of registry constituents

Describe any changes made to the namelist: None

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

List all files eliminated and why: None

List all files added and what they do: None

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

  • create list of registry constituents to pass to write_init_files
    M src/data/write_init_files.py
  • handle constituents separately from other host variables; read/check ALL constituent variables, not just "required" ones
    M test/unit/test_*.py
  • update calling lists

If there are new failures (compare 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:

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.

Looks good, but did have a few questions!

src/data/write_init_files.py Show resolved Hide resolved
src/data/write_init_files.py Show resolved Hide resolved
src/data/write_init_files.py Outdated Show resolved Hide resolved
src/data/write_init_files.py Show resolved Hide resolved
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.

Since this is mainly python, I have restricted my review to using the actual implementation. I've incorporated this code into my ZM testing, and it fixed the problem that I encountered which led to this PR

@peverwhee
Copy link
Collaborator Author

peverwhee commented Nov 7, 2024

This PR is waiting on a bugfix in the framework and also ESCOMP/atmospheric_physics#149

@peverwhee peverwhee self-assigned this Nov 26, 2024
@peverwhee peverwhee requested a review from nusbaume December 2, 2024 20:02
@peverwhee peverwhee merged commit fd886c1 into ESCOMP:development Dec 2, 2024
8 checks passed
jimmielin added a commit that referenced this pull request Dec 16, 2024
Originator(s): jimmielin

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

All changes are bit-for-bit, except those noted:

Implements `cam_thermo_water_update`:
- updates `cp_or_cv_dycore` (`specific_heat_for_air_used_in_dycore`) in
`air_composition.F90` for SE and MPAS dynamical cores
- read `cp_or_cv_dycore` from CAM snapshot (refer to companion CAM PR)
- energy formula (that has to be matching dycore) is recognized and set
by null-dycore in `dyn_grid.F90` by looking at global attributes of the
initial file; see `find_energy_formula`
- added `is_first_timestep` logical state flag

Ports `cam_thermo` and related updates in `air_composition` and
`dp_coupling` from CAM 6.3.109
(https://github.com/ESCOMP/CAM/pull/761/files)
- update to hydrostatic energy calculation
- changes `get_cp`, `get_R` in `air_composition.F90` to use moist mixing
ratios
- **answer-changing:** update to moist-to-dry (for physics) conversion
in `dp_coupling::derived_phys_dry` to account for all water tracers
instead of just Q
- **answer-changing:** update to not-really-"exner" calculation to use
composition-dependent `cappav` instead of `cappa`

Changes `vcoord` in `dyn_tests_utils` (old CAM) to `energy_formula` now
in `cam_thermo_formula` (separated out into a different file to avoid
dependency issues)
- `vc_moist_pressure` is now `ENERGY_FORMULA_DYCORE_FV`;
`vc_dry_pressure` is `_SE`; `vc_height` is `_MPAS`
- these are just integer flags (0,1,2) and values are kept consistent
with old CAM and their use in dynamics tests

Ports global mean utility module (`gmean_mod.F90`), de-chunkized from
CAM:
- Implements `get_wght` in `physics_grid` for weighted sum calculation

Imports `check_energy_chng` and `check_energy_fix` from
`atmospheric_physics`

Describe any changes made to build system: N/A

Describe any changes made to the namelist: contained within ncar-physics

List any changes to the defaults for the input datasets (e.g. boundary
datasets):
- Added `cp_or_cv_dycore` in CAM snapshots

List all files eliminated and why: N/A

List all files added and what they do:

```
- energy_formula
A       src/data/cam_thermo_formula.F90
A       src/data/cam_thermo_formula.meta

- gmean
A       src/utils/gmean_mod.F90
```

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

```
- ncar-physics update
M       .gitmodules
M       src/physics/ncar_ccpp

- `is_first_timestep`
M       src/control/cam_comp.F90

- cam_thermo_water_update for cp_or_cv_dycore (include in registry; read from ic)
M       src/data/air_composition.F90
M       src/data/cam_thermo.F90
M       src/data/registry.xml
M       tools/stdnames_to_inputnames_dictionary.xml
M       src/dynamics/se/dp_coupling.F90
M       src/dynamics/se/dycore/prim_advance_mod.F90
M       src/dynamics/se/dyn_comp.F90
M       src/dynamics/utils/dyn_thermo.F90

- energy_formula
M       src/physics/utils/phys_comp.F90
M       src/dynamics/mpas/dyn_comp.F90
M       src/dynamics/none/dyn_comp.F90
M       src/dynamics/none/dyn_grid.F90

- gmean
M       src/physics/utils/physics_grid.F90
```

Note: bit-for-bit in check_energy with CAM is tricky to validate without
dycore updates to SE; may need to merge #301 first

---------

Co-authored-by: Kuan-Chih Wang <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants