Skip to content

Commit

Permalink
Feature to read in FVCOM lake surface conditions into FV3-LAM (#293)
Browse files Browse the repository at this point in the history
* Feature to read in FVCOM lake surface conditions to FV3-LAM

Add feature to allow user to use data generated by FVCOM in FV3-LAM
as initialization of lake surface properties over the Great Lakes.
FVCOM data must be interpolated to FV3-LAM grid for this routine to
work. Following additions were made:

- Generated 3 new variables: USE_FVCOM, FVCOM_DIR, and FVCOM_FILE.
These are user defined variables available in config.sh.
  USE_FVCOM: TRUE/FALSE flag to use FVCOM data
  FVCOM_DIR: Directory path for local FVCOM files
  FVCOM_FILE: Name of file (.nc) that contains FVCOM data

- Added to exregional_make_ics.sh to run the fortran code to replace
lake surface conditions with those in FVCOM_FILE.

- Created sorc/fvcom_to_FV3 which contains fortran code to modify
sfc_data.tile7.halo0.nc with new lake surface conditions.

* Remove Fortran source code and put in UFS_UTILS PR

* Change fvcom_to_FV3 to remove .exe file name extension

Co-authored-by: David Wright <david.m.wright@noaa.gov>
  • Loading branch information
dmwright526 and DavidWright-NOAA authored Oct 12, 2020
1 parent 131bc95 commit 9b7ce5f
Show file tree
Hide file tree
Showing 4 changed files with 100 additions and 0 deletions.
42 changes: 42 additions & 0 deletions scripts/exregional_make_ics.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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.
#
#-----------------------------------------------------------------------
Expand Down
24 changes: 24 additions & 0 deletions ush/config_defaults.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
33 changes: 33 additions & 0 deletions ush/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
#
#-----------------------------------------------------------------------
#
Expand Down Expand Up @@ -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.
#
#-----------------------------------------------------------------------
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 @@ -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")

0 comments on commit 9b7ce5f

Please sign in to comment.