Skip to content

Commit d95ed85

Browse files
authored
Use ufs.configure, model_configure, MOM_input, data_table, and ice_in templates from UFS-weather-model (#2051)
This PR: - links `ufs.configure.*.IN`, `model_configure.IN`, `MOM_input_${OCNRES}.in`, `MOM6_data_table.IN`, and `ice_in.IN` from ufs-weather-model into the global-workflow `parm/ufs` directory - prepares local variables for use in the templates in the respective functions for FV3, MOM6, and CICE6 - uses `atparse.bash` to render these templates into fully formed namelists - Work was performed by @DeniseWorthen in the ufs-weather-model to templatize several variables that are hard-wired in the ufs-weather-model for CICE. See ufs-community/ufs-weather-model/#2010
1 parent 44a66dd commit d95ed85

31 files changed

+303
-4908
lines changed

.gitignore

+5
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,11 @@ parm/post/postxconfig-NT-GFS.txt
9191
parm/post/postxconfig-NT-gefs-aerosol.txt
9292
parm/post/postxconfig-NT-gefs-chem.txt
9393
parm/ufs/noahmptable.tbl
94+
parm/ufs/model_configure.IN
95+
parm/ufs/MOM_input_*.IN
96+
parm/ufs/MOM6_data_table.IN
97+
parm/ufs/ice_in.IN
98+
parm/ufs/ufs.configure.*.IN
9499
parm/wafs
95100

96101
# Ignore sorc and logs folders from externals

parm/config/gefs/config.fcst

-14
Original file line numberDiff line numberDiff line change
@@ -231,20 +231,6 @@ export FSICL="0"
231231
export FSICS="0"
232232

233233
#---------------------------------------------------------------------
234-
235-
# ideflate: netcdf zlib lossless compression (0-9): 0 no compression
236-
# nbits: netcdf lossy compression level (0-32): 0 lossless
237-
export ideflate=1
238-
export nbits=14
239-
export ishuffle=0
240-
# compression for RESTART files written by FMS
241-
export shuffle=1
242-
export deflate_level=1
243-
244-
#---------------------------------------------------------------------
245-
# Disable the use of coupler.res; get model start time from model_configure
246-
export USE_COUPLER_RES="NO"
247-
248234
# Write more variables to output
249235
export DIAG_TABLE="${HOMEgfs}/parm/ufs/fv3/diag_table"
250236

parm/config/gefs/config.ufs

+33-20
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,12 @@ case "${machine}" in
7272
"WCOSS2")
7373
npe_node_max=128
7474
;;
75-
"HERA" | "ORION" | "HERCULES" )
75+
"HERA" | "ORION" )
7676
npe_node_max=40
7777
;;
78+
"HERCULES" )
79+
npe_node_max=80
80+
;;
7881
"JET")
7982
case "${PARTITION_BATCH}" in
8083
"xjet")
@@ -193,7 +196,7 @@ case "${fv3_res}" in
193196
export WRITE_GROUP=2
194197
export WRTTASK_PER_GROUP_PER_THREAD_PER_TILE=10
195198
export WRITE_GROUP_GFS=4
196-
export WRTTASK_PER_GROUP_PER_THREAD_PER_TILE_GFS=10
199+
export WRTTASK_PER_GROUP_PER_THREAD_PER_TILE_GFS=20 #Note this should be 10 for WCOSS2
197200
;;
198201
"C1152")
199202
export DELTIM=120
@@ -209,7 +212,7 @@ case "${fv3_res}" in
209212
export WRITE_GROUP=4
210213
export WRTTASK_PER_GROUP_PER_THREAD_PER_TILE=10 # TODO: refine these numbers when a case is available
211214
export WRITE_GROUP_GFS=4
212-
export WRTTASK_PER_GROUP_PER_THREAD_PER_TILE_GFS=10 # TODO: refine these numbers when a case is available
215+
export WRTTASK_PER_GROUP_PER_THREAD_PER_TILE_GFS=20 # TODO: refine these numbers when a case is available
213216
;;
214217
"C3072")
215218
export DELTIM=90
@@ -258,6 +261,10 @@ case ${fv3_res} in
258261
OUTPUT_FILETYPE_ATM="netcdf_parallel"
259262
OUTPUT_FILETYPE_SFC="netcdf_parallel"
260263
;;
264+
*)
265+
echo "FATAL ERROR: Unrecognized FV3 resolution ${fv3_res}"
266+
exit 15
267+
;;
261268
esac
262269
export OUTPUT_FILETYPE_ATM OUTPUT_FILETYPE_SFC
263270

@@ -309,18 +316,20 @@ if [[ "${skip_mom6}" == "false" ]]; then
309316
NY_GLB=320
310317
DT_DYNAM_MOM6='1800'
311318
DT_THERM_MOM6='3600'
312-
FRUNOFF=""
319+
FRUNOFF="runoff.daitren.clim.1deg.nc"
313320
CHLCLIM="seawifs_1998-2006_smoothed_2X.nc"
314-
MOM6_RESTART_SETTING='n'
321+
MOM6_RESTART_SETTING='r'
315322
MOM6_RIVER_RUNOFF='False'
316323
eps_imesh="2.5e-1"
324+
TOPOEDITS="ufs.topo_edits_011818.nc"
317325
if [[ "${DO_JEDIOCNVAR:-NO}" = "YES" ]]; then
318326
MOM6_DIAG_COORD_DEF_Z_FILE="oceanda_zgrid_75L.nc"
319327
MOM6_DIAG_MISVAL="0.0"
320328
else
321329
MOM6_DIAG_COORD_DEF_Z_FILE="interpolate_zgrid_40L.nc"
322330
MOM6_DIAG_MISVAL="-1e34"
323331
fi
332+
MOM6_ALLOW_LANDMASK_CHANGES='True'
324333
;;
325334
"050")
326335
ntasks_mom6=60
@@ -334,15 +343,15 @@ if [[ "${skip_mom6}" == "false" ]]; then
334343
MOM6_RESTART_SETTING='n'
335344
MOM6_RIVER_RUNOFF='True'
336345
eps_imesh="1.0e-1"
337-
TOPOEDITS="ufs.topo_edits_011818.nc"
338346
if [[ "${DO_JEDIOCNVAR:-NO}" = "YES" ]]; then
339347
MOM6_DIAG_COORD_DEF_Z_FILE="oceanda_zgrid_75L.nc"
340348
MOM6_DIAG_MISVAL="0.0"
341349
else
342350
MOM6_DIAG_COORD_DEF_Z_FILE="interpolate_zgrid_40L.nc"
343351
MOM6_DIAG_MISVAL="-1e34"
344352
fi
345-
MOM6_ALLOW_LANDMASK_CHANGES='True'
353+
MOM6_ALLOW_LANDMASK_CHANGES='False'
354+
TOPOEDITS=""
346355
;;
347356
"025")
348357
ntasks_mom6=220
@@ -356,15 +365,15 @@ if [[ "${skip_mom6}" == "false" ]]; then
356365
MOM6_RIVER_RUNOFF='True'
357366
MOM6_RESTART_SETTING="r"
358367
eps_imesh="1.0e-1"
359-
TOPOEDITS=""
360368
if [[ "${DO_JEDIOCNVAR:-NO}" = "YES" ]]; then
361369
MOM6_DIAG_COORD_DEF_Z_FILE="oceanda_zgrid_75L.nc"
362370
MOM6_DIAG_MISVAL="0.0"
363371
else
364372
MOM6_DIAG_COORD_DEF_Z_FILE="interpolate_zgrid_40L.nc"
365373
MOM6_DIAG_MISVAL="-1e34"
366374
fi
367-
MOM6_ALLOW_LANDMASK_CHANGES='True'
375+
MOM6_ALLOW_LANDMASK_CHANGES='False'
376+
TOPOEDITS=""
368377
;;
369378
*)
370379
echo "FATAL ERROR: Unsupported MOM6 resolution = ${mom6_res}, ABORT!"
@@ -378,10 +387,10 @@ if [[ "${skip_mom6}" == "false" ]]; then
378387
export DT_DYNAM_MOM6 DT_THERM_MOM6
379388
export FRUNOFF
380389
export CHLCLIM
390+
export TOPOEDITS
381391
export MOM6_RIVER_RUNOFF
382392
export MOM6_RESTART_SETTING
383393
export eps_imesh
384-
export TOPOEDITS
385394
export MOM6_DIAG_COORD_DEF_Z_FILE
386395
export MOM6_DIAG_MISVAL
387396
export MOM6_ALLOW_LANDMASK_CHANGES
@@ -397,6 +406,7 @@ if [[ "${skip_cice6}" == "false" ]]; then
397406
echo "FATAL ERROR: CICE6 cannot be configured without MOM6, ABORT!"
398407
exit 1
399408
fi
409+
400410
nthreads_cice6=${nthreads_mom6} # CICE6 needs to run on same threads as MOM6
401411
case "${cice6_res}" in
402412
"500")
@@ -470,39 +480,42 @@ if [[ "${skip_gocart}" == "false" ]]; then
470480
fi
471481

472482
# Set the name of the UFS (previously nems) configure template to use
483+
# Default ufs.configure templates for supported model configurations
473484
case "${model_list}" in
474485
atm)
475-
export ufs_configure_template="${HOMEgfs}/parm/ufs/ufs.configure.atm.IN"
486+
default_template="${HOMEgfs}/parm/ufs/ufs.configure.atm.IN"
476487
;;
477488
atm.aero)
478-
export ufs_configure_template="${HOMEgfs}/parm/ufs/ufs.configure.atm_aero.IN"
489+
default_template="${HOMEgfs}/parm/ufs/ufs.configure.atmaero.IN"
479490
;;
480491
atm.wave)
481-
export ufs_configure_template="${HOMEgfs}/parm/ufs/ufs.configure.leapfrog_atm_wav.IN"
492+
default_template="${HOMEgfs}/parm/ufs/ufs.configure.leapfrog_atm_wav.IN"
482493
;;
483494
atm.ocean.ice)
484-
export ufs_configure_template="${HOMEgfs}/parm/ufs/ufs.configure.cpld.IN"
495+
default_template="${HOMEgfs}/parm/ufs/ufs.configure.s2s_esmf.IN"
485496
;;
486497
atm.ocean.ice.aero)
487-
export ufs_configure_template="${HOMEgfs}/parm/ufs/ufs.configure.cpld_aero.IN"
498+
default_template="${HOMEgfs}/parm/ufs/ufs.configure.s2sa_esmf.IN"
488499
;;
489500
atm.ocean.ice.wave)
490-
export ufs_configure_template="${HOMEgfs}/parm/ufs/ufs.configure.cpld_outerwave.IN"
501+
default_template="${HOMEgfs}/parm/ufs/ufs.configure.s2sw_esmf.IN"
491502
;;
492503
atm.ocean.ice.wave.aero)
493-
export ufs_configure_template="${HOMEgfs}/parm/ufs/ufs.configure.cpld_aero_outerwave.IN"
504+
default_template="${HOMEgfs}/parm/ufs/ufs.configure.s2swa_esmf.IN"
494505
;;
495506
*)
496-
echo "FATAL ERROR: Unable to determine appropriate UFS configure template for ${model_list}"
507+
echo "FATAL ERROR: Unsupported UFSWM configuration for ${model_list}"
497508
exit 16
498509
;;
499510
esac
500511

512+
# Allow user to override the default template
513+
export ufs_configure_template=${ufs_configure_template:-${default_template:-"/dev/null"}}
514+
unset model_list default_template
515+
501516
if [[ ! -r "${ufs_configure_template}" ]]; then
502517
echo "FATAL ERROR: ${ufs_configure_template} either doesn't exist or is not readable."
503518
exit 17
504519
fi
505520

506-
unset model_list
507-
508521
echo "END: config.ufs"

parm/config/gfs/config.fcst

-14
Original file line numberDiff line numberDiff line change
@@ -231,20 +231,6 @@ export FSICL="0"
231231
export FSICS="0"
232232

233233
#---------------------------------------------------------------------
234-
235-
# ideflate: netcdf zlib lossless compression (0-9): 0 no compression
236-
# nbits: netcdf lossy compression level (0-32): 0 lossless
237-
export ideflate=1
238-
export nbits=14
239-
export ishuffle=0
240-
# compression for RESTART files written by FMS
241-
export shuffle=1
242-
export deflate_level=1
243-
244-
#---------------------------------------------------------------------
245-
# Disable the use of coupler.res; get model start time from model_configure
246-
export USE_COUPLER_RES="NO"
247-
248234
if [[ "${CDUMP}" =~ "gdas" ]] ; then # GDAS cycle specific parameters
249235

250236
# Variables used in DA cycling

parm/config/gfs/config.ice

+5
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,9 @@ echo "BEGIN: config.ice"
66
export min_seaice="1.0e-6"
77
export use_cice_alb=".true."
88

9+
export MESH_ICE="mesh.mx${ICERES}.nc"
10+
11+
export CICE_GRID="grid_cice_NEMS_mx${ICERES}.nc"
12+
export CICE_MASK="kmtu_cice_NEMS_mx${ICERES}.nc"
13+
914
echo "END: config.ice"

parm/config/gfs/config.ocn

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22

33
echo "BEGIN: config.ocn"
44

5-
# MOM_input template to use
6-
export MOM_INPUT="MOM_input_template_${OCNRES}"
5+
export MESH_OCN="mesh.mx${OCNRES}.nc"
76

87
export DO_OCN_SPPT="NO" # In MOM_input, this variable is determines OCN_SPPT (OCN_SPPT = True|False)
98
export DO_OCN_PERT_EPBL="NO" # In MOM_input, this variable determines PERT_EPBL (PERT_EPBL = True|False)

parm/config/gfs/config.ufs

+13-10
Original file line numberDiff line numberDiff line change
@@ -480,39 +480,42 @@ if [[ "${skip_gocart}" == "false" ]]; then
480480
fi
481481

482482
# Set the name of the UFS (previously nems) configure template to use
483+
# Default ufs.configure templates for supported model configurations
483484
case "${model_list}" in
484485
atm)
485-
export ufs_configure_template="${HOMEgfs}/parm/ufs/ufs.configure.atm.IN"
486+
default_template="${HOMEgfs}/parm/ufs/ufs.configure.atm.IN"
486487
;;
487488
atm.aero)
488-
export ufs_configure_template="${HOMEgfs}/parm/ufs/ufs.configure.atm_aero.IN"
489+
default_template="${HOMEgfs}/parm/ufs/ufs.configure.atmaero.IN"
489490
;;
490491
atm.wave)
491-
export ufs_configure_template="${HOMEgfs}/parm/ufs/ufs.configure.leapfrog_atm_wav.IN"
492+
default_template="${HOMEgfs}/parm/ufs/ufs.configure.leapfrog_atm_wav.IN"
492493
;;
493494
atm.ocean.ice)
494-
export ufs_configure_template="${HOMEgfs}/parm/ufs/ufs.configure.cpld.IN"
495+
default_template="${HOMEgfs}/parm/ufs/ufs.configure.s2s_esmf.IN"
495496
;;
496497
atm.ocean.ice.aero)
497-
export ufs_configure_template="${HOMEgfs}/parm/ufs/ufs.configure.cpld_aero.IN"
498+
default_template="${HOMEgfs}/parm/ufs/ufs.configure.s2sa_esmf.IN"
498499
;;
499500
atm.ocean.ice.wave)
500-
export ufs_configure_template="${HOMEgfs}/parm/ufs/ufs.configure.cpld_outerwave.IN"
501+
default_template="${HOMEgfs}/parm/ufs/ufs.configure.s2sw_esmf.IN"
501502
;;
502503
atm.ocean.ice.wave.aero)
503-
export ufs_configure_template="${HOMEgfs}/parm/ufs/ufs.configure.cpld_aero_outerwave.IN"
504+
default_template="${HOMEgfs}/parm/ufs/ufs.configure.s2swa_esmf.IN"
504505
;;
505506
*)
506-
echo "FATAL ERROR: Unable to determine appropriate UFS configure template for ${model_list}"
507+
echo "FATAL ERROR: Unsupported UFSWM configuration for ${model_list}"
507508
exit 16
508509
;;
509510
esac
510511

512+
# Allow user to override the default template
513+
export ufs_configure_template=${ufs_configure_template:-${default_template:-"/dev/null"}}
514+
unset model_list default_template
515+
511516
if [[ ! -r "${ufs_configure_template}" ]]; then
512517
echo "FATAL ERROR: ${ufs_configure_template} either doesn't exist or is not readable."
513518
exit 17
514519
fi
515520

516-
unset model_list
517-
518521
echo "END: config.ufs"

parm/ufs/fv3/data_table

-1
This file was deleted.

0 commit comments

Comments
 (0)