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

cam6_4_050: Implement CCPPized check_energy_chng and check_energy_fix #1180

Merged
merged 24 commits into from
Dec 31, 2024
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
2772bb4
Port check_energy_chng, check_energy_timestep_init to CCPP-ized subro…
jimmielin Sep 10, 2024
50afaa6
Update physical constants to pass into subroutine
jimmielin Sep 10, 2024
80d5b86
Build updates; now use check_energy_cam_chng
jimmielin Sep 10, 2024
03209f0
Add missing USE in physbc
jimmielin Sep 10, 2024
3cc3c3e
Fix array oob pcols
jimmielin Sep 10, 2024
f7f4139
Update atmos_phys to check_energy version
jimmielin Oct 7, 2024
f6f464b
Fix build errors -- does not include bld/configure atmos_phys path up…
jimmielin Oct 10, 2024
2ffa522
Move back to check_energy.F90 for FV3 external compatibility
jimmielin Oct 14, 2024
4b6de43
Fix subcol test with FV dycore
jimmielin Oct 15, 2024
d924e4e
Update atmos_phys; move energy formula to cam_thermo_formula; write c…
jimmielin Oct 23, 2024
46b8227
Update external to fix bug; ChangeLog draft
jimmielin Oct 28, 2024
df55e13
Merge branch 'cam_development' into hplin/check_energy
jimmielin Nov 15, 2024
7244285
Update build issues; atmos_phys external to head of PR
jimmielin Nov 18, 2024
e3e6a13
Update check_energy_cam_fix interface
jimmielin Nov 18, 2024
a10a955
Update check_energy_cam_fix interface (2)
jimmielin Nov 18, 2024
902c495
Update atmos_phys to atmos_phys0_07_000
jimmielin Nov 19, 2024
bc5428f
Address review comments
jimmielin Nov 21, 2024
e981332
Merge branch 'cam_development' into hplin/check_energy
jimmielin Nov 21, 2024
c0b9d8b
Update comment for tot_energy_phys vc parameter
jimmielin Nov 21, 2024
e56d13f
Merge branch 'cam_development' into hplin/check_energy
jimmielin Dec 30, 2024
bdb3b76
Update to head of atmos_phys with check_energy_fix_run arguments
jimmielin Dec 31, 2024
b98803a
Merge branch 'cam_development' into hplin/check_energy
jimmielin Dec 31, 2024
0881a22
Update to atmos_phys0_07_001
jimmielin Dec 31, 2024
b7b4c3c
Finalize ChangeLog for cam6_4_050.
jimmielin Dec 31, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
[submodule "atmos_phys"]
path = src/atmos_phys
url = https://github.com/ESCOMP/atmospheric_physics
fxtag = atmos_phys0_06_000
fxtag = atmos_phys0_07_000
fxrequired = AlwaysRequired
fxDONOTUSEurl = https://github.com/ESCOMP/atmospheric_physics

Expand Down
1 change: 1 addition & 0 deletions bld/configure
Original file line number Diff line number Diff line change
Expand Up @@ -2341,6 +2341,7 @@ sub write_filepath
print $fh "$camsrcdir/src/atmos_phys/schemes/tropopause_find\n";
print $fh "$camsrcdir/src/atmos_phys/schemes/zhang_mcfarlane\n";
print $fh "$camsrcdir/src/atmos_phys/schemes/dry_adiabatic_adjust\n";
print $fh "$camsrcdir/src/atmos_phys/schemes/check_energy\n";
print $fh "$camsrcdir/src/atmos_phys/schemes/utilities\n";

# Dynamics package and test utilities
Expand Down
66 changes: 66 additions & 0 deletions doc/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,71 @@
===============================================================

Tag name:
Originator(s): jimmielin
Date: 21 Nov 2024
One-line Summary: Implement CCPPized check_energy_chng and check_energy_fix
Github PR URL: https://github.com/ESCOMP/CAM/pull/1180

Purpose of changes (include the issue number and title text for each relevant GitHub issue):
- CCPPize check_energy_chng and check_energy_fix (https://github.com/ESCOMP/CAM/issues/1138)
CAM interfaces have been kept in check_energy.F90 instead of a new module because check_tracers is not yet CCPPized, there are other non-CCPPized routines in module, and for compatibility with FV3 external calls
- Save air_composition cp_or_cv_dycore into state snapshot
- Separate out "energy_formula_physics"/"energy_formula_dycore" definitions used in get_hydrostatic_energy from dyn_tests_utils "vcoord" for an eventual change in SIMA.

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 boundary datasets: N/A

Describe any substantial timing or memory changes: N/A

Code reviewed by: nusbaume, cacraigucar

List all files eliminated: N/A

List all files added and what they do:
- separate out energy formula definitions used in get_hydrostatic_energy from dyn_tests_utils "vcoord"
A src/utils/cam_thermo_formula.F90

List all existing files that have been modified, and describe the changes:

Update atmos_phys external with CCPPized check_energy
M .gitmodules
M bld/configure
M src/atmos_phys

Save cp_or_cv_dycore in state snapshot
M src/control/cam_snapshot_common.F90

New CAM interfaces to CCPPized routines, when avaialble
M src/physics/cam/check_energy.F90

Update calls to CCPPized routines, when available
M src/physics/cam/physpkg.F90
M src/physics/cam/zm_conv_intr.F90
M src/physics/cam7/physpkg.F90
M src/physics/simple/physpkg.F90
M src/physics/spcam/crm_physics.F90
M src/physics/spcam/spcam_drivers.F90

If there were any failures reported from running test_driver.sh on any test
platform, and checkin with these failures has been OK'd by the gatekeeper,
then copy the lines from the td.*.status files for the failed tests to the
appropriate machine below. All failed tests must be justified.

derecho/intel/aux_cam:

derecho/nvhpc/aux_cam:

izumi/nag/aux_cam:

izumi/gnu/aux_cam:

Summarize any changes to answers: B4B

===============================================================

Tag name: cam6_4_047
Originator(s): jedwards4b, fvitt
Date: 19 November 2024
Expand Down
2 changes: 1 addition & 1 deletion src/atmos_phys
Submodule atmos_phys updated 58 files
+72 −0 .github/workflows/unit-tests.yaml
+7 −0 .gitignore
+72 −0 doc/ChangeLog
+202 −87 doc/NamesNotInDictionary.txt
+414 −0 schemes/check_energy/check_energy_chng.F90
+413 −0 schemes/check_energy/check_energy_chng.meta
+19 −0 schemes/check_energy/check_energy_chng_namelist.xml
+42 −0 schemes/check_energy/check_energy_fix.F90
+55 −0 schemes/check_energy/check_energy_fix.meta
+70 −0 schemes/check_energy/check_energy_gmean/check_energy_gmean.F90
+86 −0 schemes/check_energy/check_energy_gmean/check_energy_gmean.meta
+32 −0 schemes/check_energy/check_energy_save_teout.F90
+25 −0 schemes/check_energy/check_energy_save_teout.meta
+42 −0 schemes/check_energy/check_energy_scaling.F90
+43 −0 schemes/check_energy/check_energy_scaling.meta
+34 −0 schemes/check_energy/check_energy_zero_fluxes.F90
+43 −0 schemes/check_energy/check_energy_zero_fluxes.meta
+46 −0 schemes/check_energy/dycore_energy_consistency_adjust.F90
+43 −0 schemes/check_energy/dycore_energy_consistency_adjust.meta
+27 −28 schemes/musica/micm/musica_ccpp_micm.F90
+1 −71 schemes/musica/micm/musica_ccpp_micm_util.F90
+48 −55 schemes/musica/musica_ccpp.F90
+48 −2 schemes/musica/musica_ccpp.meta
+12 −0 schemes/musica/musica_ccpp_namelist.xml
+186 −88 schemes/musica/tuvx/musica_ccpp_tuvx.F90
+76 −0 schemes/musica/tuvx/musica_ccpp_tuvx_surface_albedo.F90
+55 −0 schemes/musica/tuvx/musica_ccpp_tuvx_util.F90
+59 −0 schemes/musica/tuvx/musica_ccpp_tuvx_wavelength_grid.F90
+86 −0 schemes/sima_diagnostics/check_energy_diagnostics.F90
+83 −0 schemes/sima_diagnostics/check_energy_diagnostics.meta
+61 −0 schemes/sima_diagnostics/check_energy_gmean_diagnostics.F90
+59 −0 schemes/sima_diagnostics/check_energy_gmean_diagnostics.meta
+19 −0 schemes/sima_diagnostics/check_energy_gmean_diagnostics_namelist.xml
+30 −0 suites/suite_adiabatic.xml
+29 −2 suites/suite_cam7.xml
+21 −0 suites/suite_kessler.xml
+22 −0 suites/suite_tj2016.xml
+7 −7 test/docker/Dockerfile.musica
+7 −7 test/docker/Dockerfile.musica.no_install
+2 −6 test/musica/CMakeLists.txt
+0 −6 test/musica/micm/configs/chapman/config.json
+0 −97 test/musica/micm/configs/chapman/reactions.json
+0 −39 test/musica/micm/configs/chapman/species.json
+11 −74 test/musica/micm/test_micm_util.F90
+4 −4 test/musica/musica_ccpp_namelist.F90
+408 −31 test/musica/test_musica_api.F90
+58 −1 test/musica/tuvx/CMakeLists.txt
+0 −16 test/musica/tuvx/configs/ts1_tsmlt.json
+39 −41 test/musica/tuvx/test_tuvx_height_grid.F90
+57 −0 test/musica/tuvx/test_tuvx_surface_albedo.F90
+19 −23 test/musica/tuvx/test_tuvx_temperature.F90
+53 −0 test/musica/tuvx/test_tuvx_wavelength_grid.F90
+39 −0 test/unit-test/CMakeLists.txt
+26 −0 test/unit-test/README.md
+11 −0 test/unit-test/include/ccpp_kinds.F90
+2 −0 test/unit-test/tests/CMakeLists.txt
+5 −0 test/unit-test/tests/utilities/CMakeLists.txt
+27 −0 test/unit-test/tests/utilities/test_state_converters.pf
11 changes: 10 additions & 1 deletion src/control/cam_snapshot_common.F90
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ module cam_snapshot_common
integer :: cam_snapshot_before_num, cam_snapshot_after_num

! Note the maximum number of variables for each type
type (snapshot_type) :: state_snapshot(29)
type (snapshot_type) :: state_snapshot(30)
type (snapshot_type) :: cnst_snapshot(pcnst)
type (snapshot_type) :: tend_snapshot(6)
type (snapshot_type) :: cam_in_snapshot(30)
Expand Down Expand Up @@ -283,6 +283,9 @@ subroutine cam_state_snapshot_init(cam_snapshot_before_num_in, cam_snapshot_afte
call snapshot_addfld( nstate_var, state_snapshot, cam_snapshot_before_num, cam_snapshot_after_num, &
'state%te_cur_dyn', 'state_te_cur_dyn', 'unset', horiz_only)

call snapshot_addfld( nstate_var, state_snapshot, cam_snapshot_before_num, cam_snapshot_after_num, &
'air_composition_cp_or_cv_dycore', 'cp_or_cv_dycore', 'J kg-1 K-1', 'lev')

end subroutine cam_state_snapshot_init

subroutine cam_cnst_snapshot_init(cam_snapshot_before_num, cam_snapshot_after_num)
Expand Down Expand Up @@ -741,6 +744,7 @@ end subroutine snapshot_addfld
subroutine state_snapshot_all_outfld(lchnk, file_num, state)

use physics_types, only: phys_te_idx, dyn_te_idx
use air_composition, only: cp_or_cv_dycore

integer, intent(in) :: lchnk
integer, intent(in) :: file_num
Expand Down Expand Up @@ -843,6 +847,11 @@ subroutine state_snapshot_all_outfld(lchnk, file_num, state)
case ('state%te_cur_dyn')
call outfld(state_snapshot(i)%standard_name, state%te_cur(:, dyn_te_idx), pcols, lchnk)

case ('air_composition_cp_or_cv_dycore')
! this field is not part of physics state (it is in air_composition)
! but describes the atmospheric thermodynamic state and thus saved within the snapshot
call outfld(state_snapshot(i)%standard_name, cp_or_cv_dycore(:,:,lchnk), pcols, lchnk)

case default
call endrun('ERROR in state_snapshot_all_outfld: no match found for '//trim(state_snapshot(i)%ddt_string))

Expand Down
Loading