Skip to content

Commit

Permalink
Update py_workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
danielabdi-noaa committed May 3, 2022
1 parent 53bad22 commit e75a580
Show file tree
Hide file tree
Showing 5 changed files with 87 additions and 44 deletions.
40 changes: 26 additions & 14 deletions ush/config_defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -238,19 +238,6 @@ EXEC_SUBDIR: "bin"
# need in order to create initial and boundary condition files for a given
# cycle on the native FV3-LAM grid.
#
# FIXLAM_NCO_BASEDIR:
# The base directory containing pregenerated grid, orography, and surface
# climatology files. For the pregenerated grid specified by PREDEF_GRID_NAME,
# these "fixed" files are located in:
#
# ${FIXLAM_NCO_BASEDIR}/${PREDEF_GRID_NAME}
#
# The workflow scripts will create a symlink in the experiment directory
# that will point to a subdirectory (having the name of the grid being
# used) under this directory. This variable should be set to a null
# string in this file, but it can be specified in the user-specified
# workflow configuration file (EXPT_CONFIG_FN).
#
# envir, NET, model_ver, RUN:
# Standard environment variables defined in the NCEP Central Operations WCOSS
# Implementation Standards document as follows:
Expand Down Expand Up @@ -292,7 +279,6 @@ EXEC_SUBDIR: "bin"
#-----------------------------------------------------------------------
#
COMIN: "/path/of/directory/containing/data/files/for/IC/LBCS"
FIXLAM_NCO_BASEDIR: ""
envir: "para"
NET: "rrfs"
model_ver: "v1.0.0"
Expand Down Expand Up @@ -711,13 +697,21 @@ EXTRN_MDL_SYSBASEDIR_LBCS: ''
# EXTRN_MDL_FILES_LBCS:
# Analogous to EXTRN_MDL_FILES_ICS but for LBCs instead of ICs.
#
# EXTRN_MDL_DATA_STORES:
# A list of data stores where the scripts should look for external model
# data. The list is in priority order. If disk information is provided
# via USE_USER_STAGED_EXTRN_FILES or a known location on the platform,
# the disk location will be highest priority. Options are disk, hpss,
# aws, and nomads.
#
#-----------------------------------------------------------------------
#
USE_USER_STAGED_EXTRN_FILES: "FALSE"
EXTRN_MDL_SOURCE_BASEDIR_ICS: ""
EXTRN_MDL_FILES_ICS: ""
EXTRN_MDL_SOURCE_BASEDIR_LBCS: ""
EXTRN_MDL_FILES_LBCS: ""
EXTRN_MDL_DATA_STORES: ""
#
#-----------------------------------------------------------------------
#
Expand Down Expand Up @@ -1305,6 +1299,22 @@ VX_ENSPOINT_PROB_TN: "run_enspointvx_prob"
# SFC_CLIMO_DIR:
# Same as GRID_DIR but for the MAKE_SFC_CLIMO_TN task.
#
# DOMAIN_PREGEN_BASEDIR:
# The base directory containing pregenerated grid, orography, and surface
# climatology files. This is an alternative for setting GRID_DIR,
# OROG_DIR, and SFC_CLIMO_DIR individually
#
# For the pregenerated grid specified by PREDEF_GRID_NAME,
# these "fixed" files are located in:
#
# ${DOMAIN_PREGEN_BASEDIR}/${PREDEF_GRID_NAME}
#
# The workflow scripts will create a symlink in the experiment directory
# that will point to a subdirectory (having the name of the grid being
# used) under this directory. This variable should be set to a null
# string in this file, but it can be specified in the user-specified
# workflow configuration file (EXPT_CONFIG_FN).
#
# RUN_TASK_GET_EXTRN_ICS:
# Flag that determines whether the GET_EXTRN_ICS_TN task is to be run.
#
Expand Down Expand Up @@ -1351,6 +1361,8 @@ OROG_DIR: "/path/to/pregenerated/orog/files"
RUN_TASK_MAKE_SFC_CLIMO: "TRUE"
SFC_CLIMO_DIR: "/path/to/pregenerated/surface/climo/files"

DOMAIN_PREGEN_BASEDIR: ""

RUN_TASK_GET_EXTRN_ICS: "TRUE"
RUN_TASK_GET_EXTRN_LBCS: "TRUE"
RUN_TASK_MAKE_ICS: "TRUE"
Expand Down
43 changes: 43 additions & 0 deletions ush/predef_grid_params.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,49 @@
#
#-----------------------------------------------------------------------
#
# The WoFS domain with ~3km cells.
#
# Note:
# The WoFS domain will generate a 301 x 301 output grid (WRITE COMPONENT) and
# will eventually be movable (ESGgrid_LON_CTR/ESGgrid_LAT_CTR). A python script
# python_utils/fv3write_parms_lambert will be useful to determine
# WRTCMP_lon_lwr_left and WRTCMP_lat_lwr_left locations (only for Lambert map
# projection currently) of the quilting output when the domain location is
# moved. Later, it should be integrated into the workflow.
#
#-----------------------------------------------------------------------
#
"WoFS_3km":
GRID_GEN_METHOD: "ESGgrid"
ESGgrid_LON_CTR: -97.5
ESGgrid_LAT_CTR: 38.5
ESGgrid_DELX: 3000.0
ESGgrid_DELY: 3000.0
ESGgrid_NX: 361
ESGgrid_NY: 361
ESGgrid_PAZI: 0.0
ESGgrid_WIDE_HALO_WIDTH: 6
DT_ATMOS: 20
LAYOUT_X: 18
LAYOUT_Y: 12
BLOCKSIZE: 30
# if QUILTING = True
WRTCMP_write_groups: "1"
WRTCMP_write_tasks_per_group: 12
WRTCMP_output_grid: "lambert_conformal"
WRTCMP_cen_lon: -97.5
WRTCMP_cen_lat: 38.5
WRTCMP_stdlat1: 38.5
WRTCMP_stdlat2: 38.5
WRTCMP_nx: 301
WRTCMP_ny: 301
WRTCMP_lon_lwr_left: -102.3802487
WRTCMP_lat_lwr_left: 34.3407918
WRTCMP_dx: 3000.0
WRTCMP_dy: 3000.0
#
#-----------------------------------------------------------------------
#
# A CONUS domain of GFDLgrid type with ~25km cells.
#
# Note:
Expand Down
20 changes: 2 additions & 18 deletions ush/set_extrn_mdl_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,8 @@ def set_extrn_mdl_params():
#import all env variables
import_vars()

global EXTRN_MDL_SYSBASEDIR_ICS, EXTRN_MDL_SYSBASEDIR_LBCS, EXTRN_MDL_LBCS_OFFSET_HRS
global EXTRN_MDL_LBCS_OFFSET_HRS

#
#-----------------------------------------------------------------------
#
# Use known locations or COMIN as default, depending on RUN_ENVIR
#
#-----------------------------------------------------------------------
#
if RUN_ENVIR == "nco":
EXTRN_MDL_SYSBASEDIR_ICS=EXTRN_MDL_SYSBASEDIR_ICS or COMIN
EXTRN_MDL_SYSBASEDIR_LBCS=EXTRN_MDL_SYSBASEDIR_LBCS or COMIN
else:
ics_dir=EXTRN_MDL_NAME_ICS
lbcs_dir=EXTRN_MDL_NAME_LBCS
EXTRN_MDL_SYSBASEDIR_ICS=EXTRN_MDL_SYSBASEDIR_ICS or ics_dir
EXTRN_MDL_SYSBASEDIR_LBCS=EXTRN_MDL_SYSBASEDIR_LBCS or lbcs_dir

#
#-----------------------------------------------------------------------
#
Expand All @@ -49,7 +33,7 @@ def set_extrn_mdl_params():
EXTRN_MDL_LBCS_OFFSET_HRS=EXTRN_MDL_LBCS_OFFSET_HRS or "0"

# export values we set above
env_vars = ["EXTRN_MDL_SYSBASEDIR_ICS", "EXTRN_MDL_SYSBASEDIR_LBCS", "EXTRN_MDL_LBCS_OFFSET_HRS"]
env_vars = ["EXTRN_MDL_LBCS_OFFSET_HRS"]
export_vars(env_vars=env_vars)
#
#-----------------------------------------------------------------------
Expand Down
25 changes: 14 additions & 11 deletions ush/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ def setup():
#
global MACHINE
global MACHINE_FILE
global FIXgsm, FIXaer, FIXlut, TOPO_DIR, SFC_CLIMO_INPUT_DIR, FIXLAM_NCO_BASEDIR, \
global FIXgsm, FIXaer, FIXlut, TOPO_DIR, SFC_CLIMO_INPUT_DIR, DOMAIN_PREGEN_BASEDIR, \
RELATIVE_LINK_FLAG, WORKFLOW_MANAGER, NCORES_PER_NODE, SCHED, \
QUEUE_DEFAULT, QUEUE_HPSS, QUEUE_FCST, \
PARTITION_DEFAULT, PARTITION_HPSS, PARTITION_FCST
Expand All @@ -362,7 +362,7 @@ def setup():
FIXlut = \"{FIXlut or ""}
TOPO_DIR = \"{TOPO_DIR or ""}
SFC_CLIMO_INPUT_DIR = \"{SFC_CLIMO_INPUT_DIR or ""}
FIXLAM_NCO_BASEDIR = \"{FIXLAM_NCO_BASEDIR or ""}
DOMAIN_PREGEN_BASEDIR = \"{DOMAIN_PREGEN_BASEDIR or ""}
You can specify the missing location(s) in config.sh''')

#
Expand Down Expand Up @@ -1041,13 +1041,16 @@ def setup():
#
if USE_USER_STAGED_EXTRN_FILES:

if not os.path.exists(EXTRN_MDL_SOURCE_BASEDIR_ICS):
# Check for the base directory up to the first templated field.
idx = EXTRN_MDL_SOURCE_BASEDIR_ICS.find("$")
if not os.path.exists(EXTRN_MDL_SOURCE_BASEDIR_ICS[:idx]):
print_err_msg_exit(f'''
The directory (EXTRN_MDL_SOURCE_BASEDIR_ICS) in which the user-staged
external model files for generating ICs should be located does not exist:
EXTRN_MDL_SOURCE_BASEDIR_ICS = \"{EXTRN_MDL_SOURCE_BASEDIR_ICS}\"''')

if not os.path.exists(EXTRN_MDL_SOURCE_BASEDIR_LBCS):
idx = EXTRN_MDL_SOURCE_BASEDIR_LBCS.find("$")
if not os.path.exists(EXTRN_MDL_SOURCE_BASEDIR_LBCS[:idx]):
print_err_msg_exit(f'''
The directory (EXTRN_MDL_SOURCE_BASEDIR_LBCS) in which the user-staged
external model files for generating LBCs should be located does not exist:
Expand Down Expand Up @@ -1153,7 +1156,7 @@ def setup():

if RUN_ENVIR == "nco":

nco_fix_dir = os.path.join(FIXLAM_NCO_BASEDIR, PREDEF_GRID_NAME)
nco_fix_dir = os.path.join(DOMAIN_PREGEN_BASEDIR, PREDEF_GRID_NAME)
if not os.path.exists(nco_fix_dir):
print_err_msg_exit(f'''
The directory (nco_fix_dir) that should contain the pregenerated grid,
Expand All @@ -1168,11 +1171,11 @@ def setup():
When RUN_ENVIR is set to \"nco\", the workflow assumes that pregenerated
grid files already exist in the directory
{FIXLAM_NCO_BASEDIR}/{PREDEF_GRID_NAME}
{DOMAIN_PREGEN_BASEDIR}/{PREDEF_GRID_NAME}
where
FIXLAM_NCO_BASEDIR = \"{FIXLAM_NCO_BASEDIR}\"
DOMAIN_PREGEN_BASEDIR = \"{DOMAIN_PREGEN_BASEDIR}\"
PREDEF_GRID_NAME = \"{PREDEF_GRID_NAME}\"
Thus, the MAKE_GRID_TN task must not be run (i.e. RUN_TASK_MAKE_GRID must
Expand Down Expand Up @@ -1205,11 +1208,11 @@ def setup():
msg=f'''
When RUN_ENVIR is set to \"nco\", the workflow assumes that pregenerated
orography files already exist in the directory
{FIXLAM_NCO_BASEDIR}/{PREDEF_GRID_NAME}
{DOMAIN_PREGEN_BASEDIR}/{PREDEF_GRID_NAME}
where
FIXLAM_NCO_BASEDIR = \"{FIXLAM_NCO_BASEDIR}\"
DOMAIN_PREGEN_BASEDIR = \"{DOMAIN_PREGEN_BASEDIR}\"
PREDEF_GRID_NAME = \"{PREDEF_GRID_NAME}\"
Thus, the MAKE_OROG_TN task must not be run (i.e. RUN_TASK_MAKE_OROG must
Expand Down Expand Up @@ -1243,11 +1246,11 @@ def setup():
When RUN_ENVIR is set to \"nco\", the workflow assumes that pregenerated
surface climatology files already exist in the directory
{FIXLAM_NCO_BASEDIR}/{PREDEF_GRID_NAME}
{DOMAIN_PREGEN_BASEDIR}/{PREDEF_GRID_NAME}
where
FIXLAM_NCO_BASEDIR = \"{FIXLAM_NCO_BASEDIR}\"
DOMAIN_PREGEN_BASEDIR = \"{DOMAIN_PREGEN_BASEDIR}\"
PREDEF_GRID_NAME = \"{PREDEF_GRID_NAME}\"
Thus, the MAKE_SFC_CLIMO_TN task must not be run (i.e. RUN_TASK_MAKE_SFC_CLIMO
Expand Down
3 changes: 2 additions & 1 deletion ush/valid_param_vals.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ valid_vals_PREDEF_GRID_NAME: [
"GSD_HRRR_AK_50km",
"RRFS_NA_13km",
"RRFS_NA_3km",
"SUBCONUS_Ind_3km"
"SUBCONUS_Ind_3km",
"WoFS_3km"
]
valid_vals_CCPP_PHYS_SUITE: [
"FV3_GFS_2017_gfdlmp",
Expand Down

0 comments on commit e75a580

Please sign in to comment.