Skip to content

Commit

Permalink
Cleanup CCPP cmake build, reduce number of compile jobs, use atparse …
Browse files Browse the repository at this point in the history
…for variable substitution in MOM and CICE input files (#791)

* Use atparse for ice_in instead of edit_inputs
* Switch to atparse for MOM6
* Update rt.sh and tests/rt_utils.sh to guarantee only one WW3 compile job at a time
* Rearrange rt.conf and rt_gnu.conf to reduce the number of compile jobs
* Increase wallclock time for gaea to 120 minutes

Co-authored-by: denise.worthen <[email protected]>
Co-authored-by: Brian Curtis <[email protected]>
  • Loading branch information
3 people authored Sep 15, 2021
1 parent e198256 commit 9007b8b
Show file tree
Hide file tree
Showing 34 changed files with 3,250 additions and 3,478 deletions.
2 changes: 1 addition & 1 deletion FV3
287 changes: 143 additions & 144 deletions tests/RegressionTests_cheyenne.gnu.log

Large diffs are not rendered by default.

809 changes: 402 additions & 407 deletions tests/RegressionTests_cheyenne.intel.log

Large diffs are not rendered by default.

1,125 changes: 505 additions & 620 deletions tests/RegressionTests_gaea.intel.log

Large diffs are not rendered by default.

287 changes: 143 additions & 144 deletions tests/RegressionTests_hera.gnu.log

Large diffs are not rendered by default.

838 changes: 410 additions & 428 deletions tests/RegressionTests_hera.intel.log

Large diffs are not rendered by default.

801 changes: 398 additions & 403 deletions tests/RegressionTests_jet.intel.log

Large diffs are not rendered by default.

815 changes: 405 additions & 410 deletions tests/RegressionTests_orion.intel.log

Large diffs are not rendered by default.

527 changes: 261 additions & 266 deletions tests/RegressionTests_wcoss_cray.log

Large diffs are not rendered by default.

829 changes: 412 additions & 417 deletions tests/RegressionTests_wcoss_dell_p3.log

Large diffs are not rendered by default.

41 changes: 25 additions & 16 deletions tests/default_vars.sh
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ fi
WLCLK_dflt=30
# Longer default walltime on Gaea
if [[ $MACHINE_ID = gaea.* ]]; then
WLCLK_dflt=60
WLCLK_dflt=120
fi

export WLCLK=$WLCLK_dflt
Expand Down Expand Up @@ -667,8 +667,6 @@ export DT_ATMOS=900
export DT_CICE=${DT_ATMOS}
export DT_DYNAM_MOM6=1800
export DT_THERM_MOM6=3600
export CPL_SLOW=${DT_THERM_MOM6}
export CPL_FAST=${DT_ATMOS}

# nems.configure defaults
export NEMS_CONFIGURE=nems.configure.cpld.IN
Expand All @@ -678,8 +676,8 @@ export ocn_model=mom6
export ice_model=cice6
export wav_model=ww3

export coupling_interval_slow_sec=${CPL_SLOW}
export coupling_interval_fast_sec=${CPL_FAST}
export coupling_interval_slow_sec=${DT_THERM_MOM6}
export coupling_interval_fast_sec=${DT_ATMOS}

export RESTART_N=${FHMAX}
export CPLMODE=nems_frac
Expand Down Expand Up @@ -730,7 +728,7 @@ export FRUNOFF=''
export CHLCLIM=seawifs_1998-2006_smoothed_2X.nc
# this must be set False for restart repro
export MOM6_REPRO_LA=False
# since CPL_SLOW is set to DT_THERM, this should be always be false
# since coupling_interval_slow is set to DT_THERM, this should be always be false
export MOM6_THERMO_SPAN=False
# no WW3
export MOM6_USE_WAVES=False
Expand All @@ -741,6 +739,11 @@ export MOM_IAU_HRS=6

# CICE6 defaults; 1 degree
export NPROC_ICE=12
# SlenderX2
export CICE_DECOMP=slenderX2
export np2=`expr $NPROC_ICE / 2`
export BLCKX=`expr $NX_GLB / $np2`
export BLCKY=`expr $NY_GLB / 2`
export MESHOCN_ICE=mesh.mx${OCNRES}.nc
export CICEGRID=grid_cice_NEMS_mx${OCNRES}.nc
export CICEMASK=kmtu_cice_NEMS_mx${OCNRES}.nc
Expand Down Expand Up @@ -815,6 +818,11 @@ export ice_petlist_bounds=$IPB_datm_100
export TASKS=$TASKS_datm_100
export TPN=$TPN_datm_100
export NPROC_ICE=12
# SlenderX2
export CICE_DECOMP=slenderX2
export np2=`expr $NPROC_ICE / 2`
export BLCKX=`expr $NX_GLB / $np2`
export BLCKY=`expr $NY_GLB / 2`

export ENS_NUM=1
export SYEAR=2011
Expand All @@ -828,10 +836,8 @@ export DT_ATMOS=900
export DT_CICE=${DT_ATMOS}
export DT_DYNAM_MOM6=1800
export DT_THERM_MOM6=3600
export CPL_SLOW=${DT_THERM_MOM6}
export CPL_FAST=${DT_ATMOS}
export coupling_interval_slow_sec=${CPL_SLOW}
export coupling_interval_fast_sec=${CPL_FAST}
export coupling_interval_slow_sec=${DT_THERM_MOM6}
export coupling_interval_fast_sec=${DT_ATMOS}

export RESTART_N=${FHMAX}
export CPLMODE=nems_orig_data
Expand Down Expand Up @@ -861,7 +867,7 @@ export MOM_IAU=False
export MOM_IAU_HRS=6
# this must be set False for restart repro
export MOM6_REPRO_LA=False
# since CPL_SLOW is set to DT_THERM, this should be always be false
# since coupling_interval_slow is set to DT_THERM, this should be always be false
export MOM6_THERMO_SPAN=False
# no WW3
export MOM6_USE_WAVES=False
Expand Down Expand Up @@ -926,7 +932,12 @@ export ocn_petlist_bounds=$OPB_cdeps_100
export ice_petlist_bounds=$IPB_cdeps_100
export TASKS=$TASKS_cdeps_100
export TPN=$TPN_cdeps_100
# SlenderX2
export CICE_DECOMP=slenderX2
export NPROC_ICE=12
export np2=`expr $NPROC_ICE / 2`
export BLCKX=`expr $NX_GLB / $np2`
export BLCKY=`expr $NY_GLB / 2`

export ENS_NUM=1
export SYEAR=2011
Expand All @@ -940,10 +951,8 @@ export DT_ATMOS=900
export DT_CICE=${DT_ATMOS}
export DT_DYNAM_MOM6=1800
export DT_THERM_MOM6=3600
export CPL_SLOW=${DT_THERM_MOM6}
export CPL_FAST=${DT_ATMOS}
export coupling_interval_slow_sec=${CPL_SLOW}
export coupling_interval_fast_sec=${CPL_FAST}
export coupling_interval_slow_sec=${DT_THERM_MOM6}
export coupling_interval_fast_sec=${DT_ATMOS}

export RESTART_N=${FHMAX}
export CPLMODE=nems_orig_data
Expand Down Expand Up @@ -981,7 +990,7 @@ export MOM_IAU=False
export MOM_IAU_HRS=6
# this must be set False for restart repro
export MOM6_REPRO_LA=False
# since CPL_SLOW is set to DT_THERM, this should be always be false
# since coupling_interval_slow is set to DT_THERM, this should be always be false
export MOM6_THERMO_SPAN=False
# no WW3
export MOM6_USE_WAVES=False
Expand Down
50 changes: 0 additions & 50 deletions tests/edit_inputs.sh
Original file line number Diff line number Diff line change
@@ -1,56 +1,6 @@
#! /usr/bin/env bash
set -eu

function edit_ice_in {

# assumes processor shape = "slenderX2"
np2=$((NPROC_ICE/2))
BLCKX=$((NX_GLB/$np2))
BLCKY=$((NY_GLB/2))

sed -e "s/YEAR_INIT/$SYEAR/g" \
-e "s/MONTH_INIT/$SMONTH/g" \
-e "s/DAY_INIT/$SDAY/g" \
-e "s/DT_CICE/$DT_CICE/g" \
-e "s/CICEGRID/$CICEGRID/g" \
-e "s/CICEMASK/$CICEMASK/g" \
-e "s/NPROC_ICE/$NPROC_ICE/g" \
-e "s/NX_GLB/$NX_GLB/g" \
-e "s/NY_GLB/$NY_GLB/g" \
-e "s/BLCKX/$BLCKX/g" \
-e "s/BLCKY/$BLCKY/g" \
-e "s/CICERUNTYPE/$CICERUNTYPE/g" \
-e "s/RUNID/$RUNID/g" \
-e "s/CICE_HIST_AVG/$CICE_HIST_AVG/g" \
-e "s/RESTART_EXT/$RESTART_EXT/g" \
-e "s/USE_RESTART_TIME/$USE_RESTART_TIME/g" \
-e "s/DUMPFREQ_N/$DUMPFREQ_N/g" \
-e "s/DUMPFREQ/$DUMPFREQ/g" \
-e "s/FRAZIL_FWSALT/$FRAZIL_FWSALT/g" \
-e "s/TFREEZE_OPTION/$TFREEZE_OPTION/g" \
-e "s/KTHERM/$KTHERM/g"
}

function edit_mom_input {

sed -e "s/DT_THERM_MOM6/$DT_THERM_MOM6/g" \
-e "s/DT_DYNAM_MOM6/$DT_DYNAM_MOM6/g" \
-e "s/MOM6_RIVER_RUNOFF/$MOM6_RIVER_RUNOFF/g" \
-e "s/MOM6_THERMO_SPAN/$MOM6_THERMO_SPAN/g" \
-e "s/MOM6_REPRO_LA/$MOM6_REPRO_LA/g" \
-e "s/MOM6_USE_WAVES/$MOM6_USE_WAVES/g" \
-e "s/MOM6_ALLOW_LANDMASK_CHANGES/$MOM6_ALLOW_LANDMASK_CHANGES/g" \
-e "s/MOM_IAU_HRS/$MOM_IAU_HRS/g" \
-e "s/MOM_IAU/$MOM_IAU/g" \
-e "s/NX_GLB/$NX_GLB/g" \
-e "s/NY_GLB/$NY_GLB/g" \
-e "s/CHLCLIM/$CHLCLIM/g"
}

function edit_data_table {
sed -e "s/FRUNOFF/$FRUNOFF/g"
}

function edit_ww3_input {

SDATEWW3="${SYEAR}${SMONTH}${SDAY} $(printf "%02d" $(( ${SHOUR} )))0000"
Expand Down
46 changes: 23 additions & 23 deletions tests/parm/MOM_input_template_025
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
TRIPOLAR_N = True ! [Boolean] default = False
! Use tripolar connectivity at the northern edge of the domain. With
! TRIPOLAR_N, NIGLOBAL must be even.
NIGLOBAL = NX_GLB !
NIGLOBAL = @[NX_GLB] !
! The total number of thickness grid points in the x-direction in the physical
! domain. With STATIC_MEMORY_ this is set in MOM_memory.h at compile time.
NJGLOBAL = NY_GLB !
NJGLOBAL = @[NY_GLB] !
! The total number of thickness grid points in the y-direction in the physical
! domain. With STATIC_MEMORY_ this is set in MOM_memory.h at compile time.
NIHALO = 4 ! default = 4
Expand All @@ -40,16 +40,16 @@ THICKNESSDIFFUSE = True ! [Boolean] default = False
THICKNESSDIFFUSE_FIRST = True ! [Boolean] default = False
! If true, do thickness diffusion before dynamics. This is only used if
! THICKNESSDIFFUSE is true.
DT = DT_DYNAM_MOM6 ! [s]
DT = @[DT_DYNAM_MOM6] ! [s]
! The (baroclinic) dynamics time step. The time-step that is actually used will
! be an integer fraction of the forcing time-step (DT_FORCING in ocean-only mode
! or the coupling timestep in coupled mode.)
DT_THERM = DT_THERM_MOM6 ! [s] default = 900.0
DT_THERM = @[DT_THERM_MOM6] ! [s] default = 1800.0
! The thermodynamic and tracer advection time step. Ideally DT_THERM should be
! an integer multiple of DT and less than the forcing or coupling time-step,
! unless THERMO_SPANS_COUPLING is true, in which case DT_THERM can be an integer
! multiple of the coupling timestep. By default DT_THERM is set to DT.
THERMO_SPANS_COUPLING = MOM6_THERMO_SPAN ! [Boolean] default = False
THERMO_SPANS_COUPLING = @[MOM6_THERMO_SPAN] ! [Boolean] default = False
! If true, the MOM will take thermodynamic and tracer timesteps that can be
! longer than the coupling timestep. The actual thermodynamic timestep that is
! used in this case is the largest integer multiple of the coupling timestep
Expand All @@ -58,6 +58,7 @@ HFREEZE = 20.0 ! [m] default = -1.0
! If HFREEZE > 0, melt potential will be computed. The actual depth
! over which melt potential is computed will be min(HFREEZE, OBLD)
! where OBLD is the boundary layer depth. If HFREEZE <= 0 (default)
! melt potential will not be computed.
USE_PSURF_IN_EOS = False ! [Boolean] default = False
! If true, always include the surface pressure contributions in equation of
! state calculations.
Expand Down Expand Up @@ -118,6 +119,13 @@ GRID_CONFIG = "mosaic" !
! mercator - use a Mercator spherical grid.
GRID_FILE = "ocean_hgrid.nc" !
! Name of the file from which to read horizontal grid data.
GRID_ROTATION_ANGLE_BUGS = False ! [Boolean] default = True
! If true, use an older algorithm to calculate the sine and
! cosines needed rotate between grid-oriented directions and
! true north and east. Differences arise at the tripolar fold
USE_TRIPOLAR_GEOLONB_BUG = False ! [Boolean] default = True
! If true, use older code that incorrectly sets the longitude in some points
! along the tripolar fold to be off by 360 degrees.
TOPO_CONFIG = "file" !
! This specifies how bathymetry is specified:
! file - read bathymetric information from the file
Expand Down Expand Up @@ -148,7 +156,7 @@ TOPO_FILE = "ocean_topog.nc" ! default = "topog.nc"
! The file from which the bathymetry is read.
TOPO_EDITS_FILE = "All_edits.nc" ! default = ""
! The file from which to read a list of i,j,z topography overrides.
ALLOW_LANDMASK_CHANGES = MOM6_ALLOW_LANDMASK_CHANGES ! default = "False"
ALLOW_LANDMASK_CHANGES = @[MOM6_ALLOW_LANDMASK_CHANGES] ! default = "False"
! If true, allow topography overrides to change ocean points to land
MAXIMUM_DEPTH = 6500.0 ! [m]
! The maximum depth of the ocean.
Expand All @@ -157,13 +165,6 @@ MINIMUM_DEPTH = 9.5 ! [m] default = 0.0
! assumed to be land and all fluxes are masked out. If MASKING_DEPTH is
! specified, then all depths shallower than MINIMUM_DEPTH but deeper than
! MASKING_DEPTH are rounded to MINIMUM_DEPTH.
GRID_ROTATION_ANGLE_BUGS = False ! [Boolean] default = True
! If true, use an older algorithm to calculate the sine and
! cosines needed rotate between grid-oriented directions and
! true north and east. Differences arise at the tripolar fold
USE_TRIPOLAR_GEOLONB_BUG = False ! [Boolean] default = True
! If true, use older code that incorrectly sets the longitude
! in some points along the tripolar fold to be off by 360 degrees

! === module MOM_open_boundary ===
! Controls where open boundaries are located, what kind of boundary condition to impose, and what data to apply,
Expand Down Expand Up @@ -324,6 +325,7 @@ Z_INIT_FILE_PTEMP_VAR = "temp" ! default = "ptemp"
Z_INIT_FILE_SALT_VAR = "salt" ! default = "salt"
! The name of the salinity variable in
! SALT_Z_INIT_FILE.

Z_INIT_ALE_REMAPPING = True ! [Boolean] default = False
! If True, then remap straight to model coordinate from file.
Z_INIT_REMAP_OLD_ALG = True ! [Boolean] default = True
Expand Down Expand Up @@ -670,7 +672,6 @@ MAX_RINO_IT = 25 ! [nondim] default = 50
VERTEX_SHEAR = False ! [Boolean] default = False
! If true, do the calculations of the shear-driven mixing
! at the cell vertices (i.e., the vorticity points).

KAPPA_SHEAR_ITER_BUG = True ! [Boolean] default = True
! If true, use an older, dimensionally inconsistent estimate of the derivative
! of diffusivity with energy in the Newton's method iteration. The bug causes
Expand All @@ -695,7 +696,7 @@ PRESSURE_DEPENDENT_FRAZIL = False ! [Boolean] default = False
VAR_PEN_SW = True ! [Boolean] default = False
! If true, use one of the CHL_A schemes specified by OPACITY_SCHEME to determine
! the e-folding depth of incoming short wave radiation.
CHL_FILE = "seawifs-clim-1997-2010.1440x1080.v20180328.nc" !
CHL_FILE = @[CHLCLIM] !
! CHL_FILE is the file containing chl_a concentrations in the variable CHL_A. It
! is used when VAR_PEN_SW and CHL_FROM_FILE are true.
CHL_VARNAME = "chlor_a" ! default = "CHL_A"
Expand Down Expand Up @@ -740,12 +741,11 @@ MIX_LEN_EXPONENT = 1.0 ! [nondim] default = 2.0
! The exponent applied to the ratio of the distance to the MLD and the MLD depth
! which determines the shape of the mixing length. This is only used if
! USE_MLD_ITERATION is True.
USE_LA_LI2016 = MOM6_REPRO_LA ! [nondim] default = False
USE_LA_LI2016 = @[MOM6_REPRO_LA]! [nondim] default = False
! A logical to use the Li et al. 2016 (submitted) formula to determine the
! Langmuir number.
USE_WAVES = MOM6_USE_WAVES ! [Boolean] default = False
USE_WAVES = @[MOM6_USE_WAVES] ! [Boolean] default = False
! If true, enables surface wave modules.

WAVE_METHOD = "SURFACE_BANDS" ! default = "EMPTY"
! Choice of wave method, valid options include:
! TEST_PROFILE - Prescribed from surface Stokes drift
Expand All @@ -756,19 +756,17 @@ WAVE_METHOD = "SURFACE_BANDS" ! default = "EMPTY"
! wave spectrum with prescribed values.
! LF17 - Infers Stokes drift profile from wind
! speed following Li and Fox-Kemper 2017.

SURFBAND_SOURCE = "COUPLER" ! default = "EMPTY"
! Choice of SURFACE_BANDS data mode, valid options include:
! DATAOVERRIDE - Read from NetCDF using FMS DataOverride.
! COUPLER - Look for variables from coupler pass
! INPUT - Testing with fixed values.

STK_BAND_COUPLER = 3 ! default = 1
! STK_BAND_COUPLER is the number of Stokes drift bands in the coupler. This has
! to be consistent with the number of Stokes drift bands in WW3, or the model
! will fail.

SURFBAND_WAVENUMBERS = 0.04, 0.11, 0.3305 ! [rad/m] default = 0.12566
! Central wavenumbers for surface Stokes drift bands.
EPBL_LANGMUIR_SCHEME = "ADDITIVE" ! default = "NONE"
! EPBL_LANGMUIR_SCHEME selects the method for including Langmuir turbulence.
! Valid values are:
Expand Down Expand Up @@ -826,12 +824,14 @@ ENERGYSAVEDAYS = 1.00 ! [days] default = 1.0
! other globally summed diagnostics.

! === module ocean_model_init ===

! === module MOM_surface_forcing ===
OCEAN_SURFACE_STAGGER = "A" ! default = "C"
! A case-insensitive character string to indicate the
! staggering of the surface velocity field that is
! returned to the coupler. Valid values include
! 'A', 'B', or 'C'.
! === module MOM_surface_forcing ===

MAX_P_SURF = 0.0 ! [Pa] default = -1.0
! The maximum surface pressure that can be exerted by the atmosphere and
! floating sea-ice or ice shelves. This is needed because the FMS coupling
Expand All @@ -855,7 +855,7 @@ USE_RIGID_SEA_ICE = True ! [Boolean] default = False
SEA_ICE_RIGID_MASS = 100.0 ! [kg m-2] default = 1000.0
! The mass of sea-ice per unit area at which the sea-ice starts to exhibit
! rigidity
LIQUID_RUNOFF_FROM_DATA = MOM6_RIVER_RUNOFF ! [Boolean] default = False
LIQUID_RUNOFF_FROM_DATA = @[MOM6_RIVER_RUNOFF] ! [Boolean] default = False
! If true, allows liquid river runoff to be specified via
! the data_table using the component name 'OCN'.
! === module MOM_restart ===
Expand Down
Loading

0 comments on commit 9007b8b

Please sign in to comment.