Skip to content

Commit

Permalink
remove eulerian options from namelist; start removing control logic
Browse files Browse the repository at this point in the history
  • Loading branch information
brian-eaton committed Dec 27, 2024
1 parent 27a96f2 commit d6e0240
Show file tree
Hide file tree
Showing 12 changed files with 42 additions and 291 deletions.
21 changes: 0 additions & 21 deletions bld/build-namelist
Original file line number Diff line number Diff line change
Expand Up @@ -4059,27 +4059,6 @@ if ( $dyn eq 'fv3') {

}

# EUL dycore
if ($dyn eq 'eul') {
add_default($nl, 'eul_dif2_coef');
add_default($nl, 'eul_hdif_order');
add_default($nl, 'eul_hdif_kmnhdn');
add_default($nl, 'eul_hdif_coef');
add_default($nl, 'eul_divdampn');
add_default($nl, 'eul_tfilt_eps');
add_default($nl, 'eul_kmxhdc');
add_default($nl, 'eul_nsplit');
}

# SLD dycore
if ($dyn eq 'sld') {
add_default($nl, 'sld_dif2_coef');
add_default($nl, 'sld_dif4_coef');
add_default($nl, 'sld_divdampn');
add_default($nl, 'sld_tfilt_eps');
add_default($nl, 'sld_kmxhdc');
}

# Single column model
if ($cfg->get('scam')) {
add_default($nl, 'iopfile');
Expand Down
144 changes: 0 additions & 144 deletions bld/namelist_files/namelist_defaults_cam.xml

Large diffs are not rendered by default.

101 changes: 0 additions & 101 deletions bld/namelist_files/namelist_definition.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1184,107 +1184,6 @@ If true nudge atmospheric temperature (T) from the meteorology.
Default: true
</entry>

<!-- Dynamics: Eulerian Spectral -->

<entry id="eul_dif2_coef" type="real" category="dyn_eul"
group="dyn_eul_inparm" valid_values="" >
del^2 horizontal diffusion coefficient. This is used above the Nth order
diffusion.
Default: set by build-namelist
</entry>

<entry id="eul_hdif_order" type="integer" category="dyn_eul"
group="dyn_eul_inparm" valid_values="">
Order (N) of horizontal diffusion operator used below the sponge layers.
N must be a positive multiple of 2.
Default: 4
</entry>

<entry id="eul_hdif_kmnhdn" type="integer" category="dyn_eul"
group="dyn_eul_inparm" valid_values="">
The order N horizontal diffusion operator will be used in and below the
layer specified by this variable.
Default: 4
</entry>

<entry id="eul_hdif_coef" type="real" category="dyn_eul"
group="dyn_eul_inparm" valid_values="">
Nth order horizontal diffusion coefficient.
Default: set by build-namelist
</entry>

<entry id="eul_divdampn" type="real" category="dyn_eul"
group="dyn_eul_inparm" valid_values="">
Number of days (from timestep 0) to run divergence damper. Use only if spectral
model becomes dynamicallly unstable during initialization. Suggested value:
2. (Value must be &gt;= 0.) Default: 0.
</entry>

<entry id="eul_tfilt_eps" type="real" category="dyn_eul"
group="dyn_eul_inparm" valid_values="">
Time filter coefficient. Default: 0.06
</entry>

<entry id="eul_kmxhdc" type="integer" category="dyn_eul"
group="dyn_eul_inparm" valid_values="">
Number of levels over which to apply Courant limiter, starting at top of
model.
Default: 5
</entry>

<entry id="eul_nsplit" type="integer" category="dyn_eul"
group="dyn_eul_inparm" valid_values="" >
Number of dynamics timesteps per physics timestep. If zero, a best-estimate
will be automatically calculated.
Default: 1
</entry>

<!-- MPI configuration for global spectral dycores (EUL and SLD) -->

<entry id="dyn_allgather" type="integer" category="dyn_spectral_spmd"
group="spmd_dyn_inparm" valid_values="">
Spectral dynamics gather option.
0: use mpi_allgatherv
1: use point-to-point MPI-1 two-sided implementation
2: use point-to-point MPI-2 one-sided implementation if supported,
otherwise use MPI-1 implementation
3: use Co-Array Fortran implementation if supported,
otherwise use MPI-1 implementation
Default: 0
</entry>

<entry id="dyn_alltoall" type="integer" category="dyn_spectral_spmd"
group="spmd_dyn_inparm" valid_values="">
Spectral dynamics transpose option.
0: use mpi_alltoallv
1: use point-to-point MPI-1 two-sided implementation
2: use point-to-point MPI-2 one-sided implementation if supported,
otherwise use MPI-1 implementation
3: use Co-Array Fortran implementation if supported,
otherwise use MPI-1 implementation
Default: 0
</entry>

<entry id="dyn_equi_by_col" type="logical" category="dyn_spectral_spmd"
group="spmd_dyn_inparm" valid_values="">
Flag indicating whether to assign latitudes to equidistribute columns or
latitudes. This only matters when using a reduced grid.
Default: TRUE
</entry>

<entry id="dyn_npes" type="integer" category="dyn_spectral_spmd"
group="spmd_dyn_inparm" valid_values="">
Number of processes assigned to dynamics (SE, EUL and SLD dycores).
Default: Total number of processes assigned to job.
</entry>

<entry id="dyn_npes_stride" type="integer" category="dyn_spectral_spmd"
group="spmd_dyn_inparm" valid_values="">
Stride for dynamics processes (EUL and SLD dycores).
E.g., if stride=2, assign every second process to the dynamics.
Default: 1
</entry>

<!-- Gravity Wave Drag -->

<entry id="use_gw_oro" type="logical" category="gw_drag"
Expand Down
10 changes: 0 additions & 10 deletions bld/namelist_files/use_cases/held_suarez_1994.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,9 @@

<start_ymd> 10101 </start_ymd>

<!-- Initial condition files -->
<ncdata hgrid="128x256" nlev="30">atm/cam/inic/gaus/HS1994.128x256.L30_c062216.nc</ncdata>
<ncdata hgrid="128x256" nlev="60">atm/cam/inic/gaus/HS1994.128x256.L60_c061516.nc</ncdata>
<ncdata hgrid="64x128" nlev="30">atm/cam/inic/gaus/HS1994.64x128.L30_c061616.nc</ncdata>

<!-- Perturb initial temperature -->
<pertlim> 1.0D-5 </pertlim>

<!-- Modified horizontal diffusion -->
<eul_hdif_order dyn="eul" > 4 </eul_hdif_order>
<eul_hdif_coef hgrid="64x128" > 1.17D16 </eul_hdif_coef>
<eul_hdif_coef hgrid="128x256" > 7.14D14 </eul_hdif_coef>

<!-- history output customization -->
<nhtfrq>0,-6</nhtfrq>
<fincl2>
Expand Down
35 changes: 35 additions & 0 deletions doc/ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ Github PR URL:

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

Resolve issue #1170 - Remove Eulerian dycore from cam_development

Describe any changes made to build system:
. remove option to build 'eul' dycore

Describe any changes made to the namelist:

Expand All @@ -33,6 +36,9 @@ List all files added and what they do:

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

bld/build-namelist
. remove code specific to eul dycore

bld/configure
. remove eul as a valid value for -dyn.
. remove code specific to the eul dycore.
Expand All @@ -46,6 +52,17 @@ bld/config_files/definition.xml
bld/config_files/horiz_grid.xml
. remove eul grid specifications

bld/namelist_files/namelist_definition.xml
. remove variables eul_*
. remove variables in group spmd_dyn_inparm

bld/namelist_files/namelist_defaults_cam.xml
. remove defaults for eul dycore
. remove unused vars: bndtvdms, bndtvoxid, bndtvsox, caer_emis

bld/namelist_files/use_cases/held_suarez_1994.xml
. remove eul specific settings

cime_config/buildcpp
. remove the translations for the Eulerian atm_grid values, e.g., CESM
specified T5 but CAM's configure expected 8x16.
Expand All @@ -65,6 +82,24 @@ cime_config/testdefs/testlist_cam.xml
. remove all tests for FDABIP04. They are all set up for Gaussian grids.
. remove all tests on a Gaussian grid.

src/control/cam_budget.F90
src/control/history_scam.F90
src/control/scamMod.F90
. remove dycore_is('EUL') from conditionals

src/control/cam_history_support.F90
. adjust comment to indicate that the Gauss grid is no longer supported.

src/control/ncdio_atm.F90
. remove comment about eulerian dycore.

src/control/cam_control_mod.F90
. update comment (all dycores are now non-Eulerian).


test/system/TR8.sh
. remove filepaths for eul dycore

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
Expand Down
2 changes: 1 addition & 1 deletion src/control/cam_budget.F90
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ subroutine cam_budget_readnl(nlfile)
! Write out thermo_budget options
if (masterproc) then
if (thermo_budget_history) then
if (dycore_is('EUL').or.dycore_is('FV').or.dycore_is('FV3')) then
if (dycore_is('FV') .or. dycore_is('FV3')) then
call endrun(subname//'ERROR thermodynamic budgets not implemented for this dycore')
else
write(iulog,*)'Thermo budgets will be written to the log file and diagnostics saved to history file:',&
Expand Down
2 changes: 1 addition & 1 deletion src/control/cam_control_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ subroutine cam_ctrl_set_physics_type(phys_package)
if (masterproc) then
if (adiabatic) then
write(iulog,*) 'Run model ADIABATICALLY (i.e. no physics)'
write(iulog,*) ' Global energy fixer is on for non-Eulerian dycores.'
write(iulog,*) ' Global energy fixer is on.'
else if (ideal_phys) then
write(iulog,*) 'Run model with Held-Suarez physics forcing'
else if (kessler_phys) then
Expand Down
2 changes: 1 addition & 1 deletion src/control/cam_history_support.F90
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ module cam_history_support
character(len=28) :: gridname = ''
integer :: grid_id = -1
! gridtype = 1 equally spaced, including poles (FV scalars output grid)
! gridtype = 2 Gauss grid (CAM Eulerian)
! gridtype = 2 Gauss grid (not implemented)
! gridtype = 3 equally spaced, no poles (FV staggered velocity)
integer :: interp_gridtype = interp_gridtype_equal_poles
! interpolate_type = 0: native high order interpolation
Expand Down
6 changes: 1 addition & 5 deletions src/control/history_scam.F90
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ subroutine scm_intht()
else
outgrid = 'physgrid'
end if
else if (dycore_is('EUL')) then
outgrid = 'gauss_grid'
else
outgrid = 'unknown'
end if
Expand Down Expand Up @@ -139,9 +137,7 @@ subroutine initialize_iop_history()

if (dycore_is('SE')) then
outgrid = 'GLL'
else if (dycore_is('EUL')) then
outgrid = 'gauss_grid'
else if (dycore_is('EUL')) then
else
outgrid = 'unknown'
end if

Expand Down
4 changes: 2 additions & 2 deletions src/control/ncdio_atm.F90
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ subroutine infld_real_2d_2d(varname, ncid, dimname1, dimname2, &
cnt = arraydimsize
call shr_scam_getCloseLatLon(ncid,scmlat,scmlon,closelat,closelon,latidx,lonidx)
if (trim(field_dnames(1)) == 'lon') then
strt(1) = lonidx ! First dim always lon for Eulerian dycore
strt(1) = lonidx
else
call endrun(trim(subname)//': lon should be first dimension for '//trim(varname))
end if
Expand Down Expand Up @@ -831,7 +831,7 @@ subroutine infld_real_3d_3d(varname, ncid, dimname1, dimname2, dimname3, &
cnt = arraydimsize
call shr_scam_getCloseLatLon(ncid,scmlat,scmlon,closelat,closelon,latidx,lonidx)
if (trim(field_dnames(1)) == 'lon') then
strt(1) = lonidx ! First dim always lon for Eulerian dycore
strt(1) = lonidx
else
call endrun(trim(subname)//': lon should be first dimension for '//trim(varname))
end if
Expand Down
2 changes: 1 addition & 1 deletion src/control/scamMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ subroutine scam_readnl(nlfile,single_column_in,scmlat_in,scmlon_in)
if( single_column ) then
if( npes>1) call endrun('SCAM_READNL: SCAM doesnt support using more than 1 pe.')

if ( .not. (dycore_is('EUL') .or. dycore_is('SE')) .or. plon /= 1 .or. plat /=1 ) then
if ( .not. dycore_is('SE') .or. plon /= 1 .or. plat /=1 ) then
call endrun('SCAM_SETOPTS: must compile model for SCAM mode when namelist parameter single_column is .true.')
endif

Expand Down
4 changes: 0 additions & 4 deletions test/system/TR8.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,6 @@ ruby $ADDREALKIND_EXE -r r8 -l 1 -d $CAM_ROOT/components/cam/src/dynamics/se
rc=`expr $? + $rc`
ruby $ADDREALKIND_EXE -r r8 -l 1 -d $CAM_ROOT/components/cam/src/dynamics/fv
rc=`expr $? + $rc`
ruby $ADDREALKIND_EXE -r r8 -l 1 -d $CAM_ROOT/components/cam/src/dynamics/eul
rc=`expr $? + $rc`
ruby $ADDREALKIND_EXE -r r8 -l 1 -d $CAM_ROOT/components/cam/src/dynamics/mpas -s dycore
rc=`expr $? + $rc`

Expand All @@ -90,8 +88,6 @@ ruby $ADDREALKIND_EXE -r r8 -l 1 -d $CAM_ROOT/src/dynamics/se
rc=`expr $? + $rc`
ruby $ADDREALKIND_EXE -r r8 -l 1 -d $CAM_ROOT/src/dynamics/fv
rc=`expr $? + $rc`
ruby $ADDREALKIND_EXE -r r8 -l 1 -d $CAM_ROOT/src/dynamics/eul
rc=`expr $? + $rc`
ruby $ADDREALKIND_EXE -r r8 -l 1 -d $CAM_ROOT/src/dynamics/mpas -s dycore
rc=`expr $? + $rc`

Expand Down

0 comments on commit d6e0240

Please sign in to comment.