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_070: Pertlim fix for MPAS #1114

Merged
merged 5 commits into from
Feb 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
9 changes: 9 additions & 0 deletions cime_config/testdefs/testlist_cam.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1404,6 +1404,15 @@
</options>
</test>

<test compset="F2000climo" grid="mpasa480_mpasa480" name="ERS_D_Ln9" testmods="cam/outfrq9s_mpasa480_pertlim">
<machines>
<machine name="derecho" compiler="intel" category="aux_cam"/>
</machines>
<options>
<option name="wallclock">00:45:00</option>
</options>
</test>

<test compset="FHS94" grid="mpasa480z32_mpasa480" name="ERC_D_Ln9" testmods="cam/outfrq3s_usecase">
<machines>
<machine name="derecho" compiler="intel" category="prealpha"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
./xmlchange ROF_NCPL=\$ATM_NCPL
./xmlchange GLC_NCPL=\$ATM_NCPL
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
mfilt=1,1,1,1,1,1
ndens=1,1,1,1,1,1
nhtfrq=9,9,9,9,9,9
inithist='ENDOFRUN'
mpas_cam_coef=1.0D0
mpas_cam_damping_levels=3
pertlim = 1.e-14
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
hist_nhtfrq = 9
hist_mfilt = 1
hist_ndens = 1
75 changes: 72 additions & 3 deletions doc/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,74 @@
===============================================================

Tag name: cam6_4_070
Originator(s): patcal, nusbaume
Date: 22 February 2025
One-line Summary: Pertlim fix for MPAS
Github PR URL: https://github.com/ESCOMP/CAM/pull/1114

Purpose of changes (include the issue number and title text for each relevant GitHub issue):

Closes #1109 - MPAS-A Pertlim usage is only implemented for ideal initial states

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: jtruesdal

List all files eliminated: N/A

List all files added and what they do:

A cime_config/testdefs/testmods_dirs/cam/outfrq9s_mpasa480_pertlim/shell_commands
A cime_config/testdefs/testmods_dirs/cam/outfrq9s_mpasa480_pertlim/user_nl_cam
A cime_config/testdefs/testmods_dirs/cam/outfrq9s_mpasa480_pertlim/user_nl_clm
- Add new MPAS pertlim regression test files.

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

M src/dynamics/mpas/dyn_comp.F90
- Allow initial state perturbations with MPAS when reading from the ncdata file.

M cime_config/testdefs/testlist_cam.xml
- Add new MPAS pertlim regression test files.

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:

ERP_Ln9.f09_f09_mg17.FCSD_HCO.derecho_intel.cam-outfrq9s (Overall: FAIL)
SMS_Ld1.f09_f09_mg17.FCHIST_GC.derecho_intel.cam-outfrq1d (Overall: DIFF)
- pre-existing failures due to HEMCO not having reproducible results (issues #1018 and #856)

ERS_D_Ln9.mpasa480_mpasa480.F2000climo.derecho_intel.cam-outfrq9s_mpasa480_pertlim (Overall: DIFF)
- New test (so no baselines yet)

SMS_D_Ln9.f19_f19_mg17.FXHIST.derecho_intel.cam-outfrq9s_amie (Overall: FAIL)
SMS_D_Ln9_P1280x1.ne0CONUSne30x8_ne0CONUSne30x8_mt12.FCHIST.derecho_intel.cam-outfrq9s (Overall: FAIL)
- pre-existing failures due to build-namelist error requiring CLM/CTSM external update

derecho/nvhpc/aux_cam: ALL PASS

izumi/nag/aux_cam: ALL PASS

izumi/gnu/aux_cam: ALL PASS

CAM tag used for the baseline comparison tests if different than previous
tag:

Summarize any changes to answers: b4b

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

Tag name: cam6_4_069
Originator(s): peverwhee
Date: 20 February 2025
Expand Down Expand Up @@ -29,7 +98,7 @@ List all files added and what they do: none
List all existing files that have been modified, and describe the changes:

.github/workflows/fleximod_test.yaml
- update fleximod workflow to include check that the checked out externals
- update fleximod workflow to include check that the checked out externals
match what is expected

.gitmodules
Expand Down Expand Up @@ -218,7 +287,7 @@ cime_config/config_compsets.xml
all FSCAM* compsets
. remove FDABIP04 (_CAM%DABIP04_)
. In the future new tests will be added for FSCAM* compsets using SE
dycore.
dycore.

cime_config/config_component.xml
. remove eul as valid value for CAM_DYCORE
Expand Down Expand Up @@ -338,7 +407,7 @@ Resolve #1171 - Remove SP-CAM from cam_development
Describe any changes made to build system:
. remove spcam build options

Describe any changes made to the namelist:
Describe any changes made to the namelist:
. remove spcam namelist options

List any changes to the defaults for the boundary datasets: none
Expand Down
30 changes: 29 additions & 1 deletion src/dynamics/mpas/dyn_comp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module dyn_comp
use const_init, only: cnst_init_default

use cam_control_mod, only: initial_run
use cam_initfiles, only: initial_file_get_id, topo_file_get_id
use cam_initfiles, only: initial_file_get_id, topo_file_get_id, pertlim

use cam_grid_support, only: cam_grid_id, &
cam_grid_get_latvals, cam_grid_get_lonvals
Expand Down Expand Up @@ -813,6 +813,11 @@ subroutine read_inidat(dyn_in)

logical :: readvar

integer :: rndm_seed_sz
integer, allocatable :: rndm_seed(:)
real(r8) :: pertval
integer :: nc

character(len=shr_kind_cx) :: str

type(mpas_pool_type), pointer :: mesh_pool
Expand Down Expand Up @@ -1083,6 +1088,29 @@ subroutine read_inidat(dyn_in)
call endrun(subname//': failed to read theta from initial file')
end if

! optionally introduce random perturbations to theta values
if (pertlim.ne.0.0_r8) then
if (masterproc) then
write(iulog,*) trim(subname), ': Adding random perturbation bounded', &
'by +/- ', pertlim, ' to initial theta field'
end if

call random_seed(size=rndm_seed_sz)
allocate(rndm_seed(rndm_seed_sz))

do nc = 1,nCellsSolve
rndm_seed = glob_ind(nc)
call random_seed(put=rndm_seed)
do kk = 1,plev
call random_number(pertval)
pertval = 2.0_r8*pertlim*(0.5_r8 - pertval)
theta(kk,nc) = theta(kk,nc)*(1.0_r8 + pertval)
end do
end do

deallocate(rndm_seed)
end if

! read rho
call infld('rho', fh_ini, 'lev', 'nCells', 1, plev, 1, nCellsSolve, 1, 1, &
mpas3d, readvar, gridname='mpas_cell')
Expand Down