Skip to content

Commit

Permalink
Allow FVCOM to be used in Warm and Cold Starts (#620)
Browse files Browse the repository at this point in the history
* Change fvcom_to_FV3 use to allow for warm/cold start sfc data and time selection in a FVCOM file

* Update valid values for FVCOM_WCSTART
  • Loading branch information
dmwright526 authored Oct 27, 2021
1 parent 43e8915 commit e471274
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 1 deletion.
6 changes: 5 additions & 1 deletion scripts/exregional_make_ics.sh
Original file line number Diff line number Diff line change
Expand Up @@ -658,8 +658,10 @@ mv_vrfy gfs.bndy.nc ${ics_dir}/gfs_bndy.tile${TILE_RGNL}.000.nc
#
if [ "${USE_FVCOM}" = "TRUE" ]; then

#Format for fvcom_time: YYYY-MM-DDTHH:00:00.000000
fvcom_exec_fn="fvcom_to_FV3"
fvcom_exec_fp="$EXECDIR/${fvcom_exec_fn}"
fvcom_time="${DATE_FIRST_CYCL:0:4}-${DATE_FIRST_CYCL:4:2}-${DATE_FIRST_CYCL:6:2}T${CYCL_HRS[0]}:00:00.000000"
if [ ! -f "${fvcom_exec_fp}" ]; then
print_err_msg_exit "\
The executable (fvcom_exec_fp) for processing FVCOM data onto FV3-LAM
Expand All @@ -680,13 +682,15 @@ Please check the following user defined variables:

cp_vrfy ${fvcom_data_fp} ${ics_dir}/fvcom.nc
cd_vrfy ${ics_dir}
${APRUN} ${fvcom_exec_fn} sfc_data.tile${TILE_RGNL}.halo${NH0}.nc fvcom.nc || \
${APRUN} ${fvcom_exec_fn} sfc_data.tile${TILE_RGNL}.halo${NH0}.nc fvcom.nc ${FVCOM_WCSTART} ${fvcom_time}|| \
print_err_msg_exit "\
Call to executable (fvcom_exe) to modify sfc fields for FV3-LAM failed:
fvcom_exe = \"${fvcom_exe}\"
The following variables were being used:
FVCOM_DIR = \"${FVCOM_DIR}\"
FVCOM_FILE = \"${FVCOM_FILE}\"
fvcom_time = \"${fvcom_time}\"
FVCOM_WCSTART = \"${FVCOM_WCSTART}\"
ics_dir = \"${ics_dir}\"
fvcom_exe_dir = \"${fvcom_exe_dir}\"
fvcom_exe = \"${fvcom_exe}\""
Expand Down
7 changes: 7 additions & 0 deletions ush/config_defaults.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1723,6 +1723,12 @@ HALO_BLEND="10"
# FV3-LAM grid. This flag will be used in make_ics to modify sfc_data.nc
# after chgres_cube is run by running the routine process_FVCOM.exe
#
# FVCOM_WCSTART:
# Define if this is a "warm" start or a "cold" start. Setting this to
# "warm" will read in sfc_data.nc generated in a RESTART directory.
# Setting this to "cold" will read in the sfc_data.nc generated from
# chgres_cube in the make_ics portion of the workflow.
#
# FVCOM_DIR:
# User defined directory where FVCOM data already interpolated to FV3-LAM
# grid is located. File name in this path should be "fvcom.nc" to allow
Expand All @@ -1735,6 +1741,7 @@ HALO_BLEND="10"
#------------------------------------------------------------------------
#
USE_FVCOM="FALSE"
FVCOM_WCSTART="cold"
FVCOM_DIR="/user/defined/dir/to/fvcom/data"
FVCOM_FILE="fvcom.nc"
#
Expand Down
4 changes: 4 additions & 0 deletions ush/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -450,10 +450,13 @@ fi
#
# Make sure that USE_FVCOM is set to a valid value and assign directory
# and file names.
#
# Make sure that FVCOM_WCSTART is set to lowercase "warm" or "cold"
#
#-----------------------------------------------------------------------
#
check_var_valid_value "USE_FVCOM" "valid_vals_USE_FVCOM"
check_var_valid_value "FVCOM_WCSTART" "valid_vals_FVCOM_WCSTART"
#
# Set USE_FVCOM to either "TRUE" or "FALSE" so we don't have to consider
# other valid values later on.
Expand All @@ -466,6 +469,7 @@ elif [ "$USE_FVCOM" = "FALSE" ] || \
[ "$USE_FVCOM" = "NO" ]; then
USE_FVCOM="FALSE"
fi
FVCOM_WCSTART=$(echo_lowercase $FVCOM_WCSTART)
#
#-----------------------------------------------------------------------
#
Expand Down
1 change: 1 addition & 0 deletions ush/valid_param_vals.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ valid_vals_DO_SPP=("TRUE" "true" "YES" "yes" "FALSE" "false" "NO" "no")
valid_vals_DO_SKEB=("TRUE" "true" "YES" "yes" "FALSE" "false" "NO" "no")
valid_vals_USE_ZMTNBLCK=("TRUE" "true" "YES" "yes" "FALSE" "false" "NO" "no")
valid_vals_USE_FVCOM=("TRUE" "true" "YES" "yes" "FALSE" "false" "NO" "no")
valid_vals_FVCOM_WCSTART=("warm" "WARM" "cold" "COLD")
valid_vals_COMPILER=("intel" "gnu")
valid_vals_SUB_HOURLY_POST=("TRUE" "true" "YES" "yes" "FALSE" "false" "NO" "no")
valid_vals_DT_SUBHOURLY_POST_MNTS=("1" "01" "2" "02" "3" "03" "4" "04" "5" "05" "6" "06" "10" "12" "15" "20" "30")

0 comments on commit e471274

Please sign in to comment.