diff --git a/scripts/exregional_make_ics.sh b/scripts/exregional_make_ics.sh index 3cd3dfdf7..c89e458fe 100755 --- a/scripts/exregional_make_ics.sh +++ b/scripts/exregional_make_ics.sh @@ -611,6 +611,48 @@ mv_vrfy gfs.bndy.nc ${ics_dir}/gfs_bndy.tile${TILE_RGNL}.000.nc # #----------------------------------------------------------------------- # +# Process FVCOM Data +# +#----------------------------------------------------------------------- +# +if [ "${USE_FVCOM}" = "TRUE" ]; then + + fvcom_exec_fn="fvcom_to_FV3" + fvcom_exec_fp="$EXECDIR/${fvcom_exec_fn}" + if [ ! -f "${fvcom_exec_fp}" ]; then + print_err_msg_exit "\ +The executable (fvcom_exec_fp) for processing FVCOM data onto FV3-LAM +native grid does not exist: + fvcom_exec_fp = \"${fvcom_exec_fp}\" +Please ensure that you've built this executable." + fi + cp_vrfy ${fvcom_exec_fp} ${ics_dir}/. + fvcom_data_fp="${FVCOM_DIR}/${FVCOM_FILE}" + if [ ! -f "${fvcom_data_fp}" ]; then + print_err_msg_exit "\ +The file or path (fvcom_data_fp) does not exist: + fvcom_data_fp = \"${fvcom_data_fp}\" +Please check the following user defined variables: + FVCOM_DIR = \"${FVCOM_DIR}\" + FVCOM_FILE= \"${FVCOM_FILE}\" " + fi + + 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 || \ + 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}\" + ics_dir = \"${ics_dir}\" + fvcom_exe_dir = \"${fvcom_exe_dir}\" + fvcom_exe = \"${fvcom_exe}\"" +fi +# +#----------------------------------------------------------------------- +# # Print message indicating successful completion of script. # #----------------------------------------------------------------------- diff --git a/ush/config_defaults.sh b/ush/config_defaults.sh index 7ce18a4d6..a80bff088 100644 --- a/ush/config_defaults.sh +++ b/ush/config_defaults.sh @@ -1277,3 +1277,27 @@ HALO_BLEND=0 #----------------------------------------------------------------------- # GWD_RRFS_v1beta_BASEDIR="" +# +#----------------------------------------------------------------------- +# +# USE_FVCOM: +# Flag set to update surface conditions in FV3-LAM with fields generated +# from the Finite Volume Community Ocean Model (FVCOM). This will +# replace lake/sea surface temperature, ice surface temperature, and ice +# placement. FVCOM data must already be interpolated to the desired +# 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_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 +# +# FVCOM_FILE: +# Name of file located in FVCOM_DIR that has FVCOM data interpolated to +# FV3-LAM grid. This file will be copied later to a new location and name +# changed to fvcom.nc +#------------------------------------------------------------------------ +# +USE_FVCOM="FALSE" +FVCOM_DIR="/user/defined/dir/to/fvcom/data" +FVCOM_FILE="fvcom.nc" diff --git a/ush/setup.sh b/ush/setup.sh index 20a6f49c4..d55b90d7d 100755 --- a/ush/setup.sh +++ b/ush/setup.sh @@ -310,6 +310,27 @@ if [ "${DO_SPPT}" = "FALSE" ]; then SPPT_MAG=-999.0 fi +# +#----------------------------------------------------------------------- +# +# Make sure that USE_FVCOM is set to a valid value and assign directory +# and file names. +# +#----------------------------------------------------------------------- +# +check_var_valid_value "USE_FVCOM" "valid_vals_USE_FVCOM" +# +# Set USE_FVCOM to either "TRUE" or "FALSE" so we don't have to consider +# other valid values later on. +# +USE_FVCOM=${USE_FVCOM^^} +if [ "$USE_FVCOM" = "TRUE" ] || \ + [ "$USE_FVCOM" = "YES" ]; then + USE_FVCOM="TRUE" +elif [ "$USE_FVCOM" = "FALSE" ] || \ + [ "$USE_FVCOM" = "NO" ]; then + USE_FVCOM="FALSE" +fi # #----------------------------------------------------------------------- # @@ -2813,6 +2834,18 @@ $( printf "\"%s\" \\\\\n" "${ALL_CDATES[@]}" ) # #----------------------------------------------------------------------- # +# If USE_FVCOM is set to TRUE, then FVCOM data (located in FVCOM_DIR +# in FVCOM_FILE) will be used to update lower boundary conditions during +# make_ics. +# +#----------------------------------------------------------------------- +# +USE_FVCOM="${USE_FVCOM}" +FVCOM_DIR="${FVCOM_DIR}" +FVCOM_FILE="${FVCOM_FILE}" +# +#----------------------------------------------------------------------- +# # Computational parameters. # #----------------------------------------------------------------------- diff --git a/ush/valid_param_vals.sh b/ush/valid_param_vals.sh index be3d8c177..f7590e0dd 100644 --- a/ush/valid_param_vals.sh +++ b/ush/valid_param_vals.sh @@ -74,3 +74,4 @@ valid_vals_DO_SHUM=("TRUE" "true" "YES" "yes" "FALSE" "false" "NO" "no") valid_vals_DO_SPPT=("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")