Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow building of the ufs-weather-model for GFS, GEFS, SFS in the same clone of global-workflow #3098

Draft
wants to merge 3 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions parm/config/gefs/config.fcst
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,11 @@ export esmf_logkind="ESMF_LOGKIND_MULTI_ON_ERROR" #Options: ESMF_LOGKIND_MULTI_O

export FORECASTSH="${SCRgfs}/exglobal_forecast.sh"
#export FORECASTSH="${SCRgfs}/exglobal_forecast.py" # Temp. while this is worked on
export FCSTEXEC="ufs_model.x"
if [[ "${SFS_POST:-}" == "YES" ]]; then
export FCSTEXEC="sfs_model.x"
else
export FCSTEXEC="gefs_model.x"
fi

#######################################################################
# Model configuration
Expand Down Expand Up @@ -117,7 +121,7 @@ if (( gwd_opt == 2 )); then
export do_gsl_drag_ls_bl=".true."
export do_gsl_drag_ss=".false."
export do_gsl_drag_tofd=".true."
export do_gwd_opt_psl=".true."
export do_gwd_opt_psl=".true."
export do_ugwp_v1_orog_only=".false."
launch_level=$(echo "${LEVS}/2.35" |bc)
export launch_level
Expand Down Expand Up @@ -145,7 +149,7 @@ if [[ "${progsigma}" == ".true." ]]; then tbp="_progsigma" ; fi
if [[ "${DO_AERO}" == "YES" ]]; then
export IAER=2011 # spectral band mapping method for aerosol optical properties
else
export IAER=1011
export IAER=1011
fi
export iovr_lw=3 ; #de-correlation length cloud overlap method (Barker, 2008)
export iovr_sw=3 ; #de-correlation length cloud overlap method (Barker, 2008)
Expand Down
6 changes: 3 additions & 3 deletions parm/config/gfs/config.fcst
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export esmf_logkind="ESMF_LOGKIND_MULTI_ON_ERROR" #Options: ESMF_LOGKIND_MULTI_O

export FORECASTSH="${SCRgfs}/exglobal_forecast.sh"
#export FORECASTSH="${SCRgfs}/exglobal_forecast.py" # Temp. while this is worked on
export FCSTEXEC="ufs_model.x"
export FCSTEXEC="gfs_model.x"

#######################################################################
# Model configuration
Expand Down Expand Up @@ -128,7 +128,7 @@ if (( gwd_opt == 2 )); then
export do_gsl_drag_ls_bl=".true."
export do_gsl_drag_ss=".false."
export do_gsl_drag_tofd=".true."
export do_gwd_opt_psl=".true."
export do_gwd_opt_psl=".true."
export do_ugwp_v1_orog_only=".false."
launch_level=$(echo "${LEVS}/2.35" |bc)
export launch_level
Expand Down Expand Up @@ -160,7 +160,7 @@ if [[ "${progsigma}" == ".true." ]]; then tbp="_progsigma" ; fi
if [[ "${DO_AERO}" == "YES" ]]; then
export IAER=2011 # spectral band mapping method for aerosol optical properties
else
export IAER=1011
export IAER=1011
fi
export iovr_lw=3 ; #de-correlation length cloud overlap method (Barker, 2008)
export iovr_sw=3 ; #de-correlation length cloud overlap method (Barker, 2008)
Expand Down
7 changes: 4 additions & 3 deletions sorc/build_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ _wave_opt=""
_hydro_opt=""
_build_job_max=20
_quick_kill="NO"
_ufs_exec="-e gfs_model.x"
# Reset option counter in case this script is sourced
OPTIND=1
while getopts ":a:dfghj:kuvwy" option; do
Expand All @@ -69,8 +70,8 @@ while getopts ":a:dfghj:kuvwy" option; do
k) _quick_kill="YES" ;;
u) _build_ufsda="YES" ;;
v) _verbose_opt="-v";;
w) _wave_opt="-w";;
y) _hydro_opt="-y";;
w) _wave_opt="-w"; _ufs_exec="-e gefs_model.x";;
y) _hydro_opt="-y"; _ufs_exec="-e sfs_model.x";;
:)
echo "[${BASH_SOURCE[0]}]: ${option} requires an argument"
_usage
Expand Down Expand Up @@ -133,7 +134,7 @@ declare -A build_opts
big_jobs=0
build_jobs["ufs"]=8
big_jobs=$((big_jobs+1))
build_opts["ufs"]="${_wave_opt} ${_hydro_opt} ${_verbose_opt} ${_build_ufs_opt} ${_build_debug}"
build_opts["ufs"]="${_wave_opt} ${_hydro_opt} ${_verbose_opt} ${_build_ufs_opt} ${_build_debug} ${_ufs_exec}"

build_jobs["upp"]=1
build_opts["upp"]="${_build_debug}"
Expand Down
20 changes: 14 additions & 6 deletions sorc/build_ufs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ APP="S2SWA"
CCPP_SUITES="FV3_GFS_v17_p8_ugwpv1,FV3_GFS_v17_coupled_p8_ugwpv1,FV3_global_nest_v1" # TODO: does the g-w need to build with all these CCPP_SUITES?
PDLIB="ON"
HYDRO="OFF"
EXEC_NAME="gfs_model.x"

while getopts ":da:fj:vwy" option; do
while getopts ":da:fj:e:vwy" option; do
case "${option}" in
d) BUILD_TYPE="Debug";;
a) APP="${OPTARG}";;
Expand All @@ -18,6 +19,7 @@ while getopts ":da:fj:vwy" option; do
v) export BUILD_VERBOSE="YES";;
w) PDLIB="OFF";;
y) HYDRO="ON";;
e) EXEC_NAME="${OPTARG}";;
:)
echo "[${BASH_SOURCE[0]}]: ${option} requires an argument"
;;
Expand All @@ -40,13 +42,19 @@ if [[ ${BUILD_TYPE:-"Release"} = "DEBUG" ]] ; then
elif [[ "${FASTER:-OFF}" == ON ]] ; then
MAKE_OPT+=" -DFASTER=ON"
fi
COMPILE_NR=0

case "${EXEC_NAME}" in
"gfs_model.x") COMPILE_ID=1 ;;
"gefs_model.x") COMPILE_ID=2 ;;
"sfs_model.x") COMPILE_ID=3 ;;
*) COMPILE_ID=0 ;;
esac
CLEAN_BEFORE=YES
CLEAN_AFTER=NO

BUILD_JOBS=${BUILD_JOBS:-8} ./tests/compile.sh "${MACHINE_ID}" "${MAKE_OPT}" "${COMPILE_NR}" "intel" "${CLEAN_BEFORE}" "${CLEAN_AFTER}"
mv "./tests/fv3_${COMPILE_NR}.exe" ./tests/ufs_model.x
mv "./tests/modules.fv3_${COMPILE_NR}.lua" ./tests/modules.ufs_model.lua
cp "./modulefiles/ufs_common.lua" ./tests/ufs_common.lua
BUILD_JOBS=${BUILD_JOBS:-8} ./tests/compile.sh "${MACHINE_ID}" "${MAKE_OPT}" "${COMPILE_ID}" "intel" "${CLEAN_BEFORE}" "${CLEAN_AFTER}"
mv "./tests/fv3_${COMPILE_ID}.exe" "./tests/${EXEC_NAME}"
if [[ ! -f "./tests/modules.ufs_model.lua" ]]; then mv "./tests/modules.fv3_${COMPILE_ID}.lua" "./tests/modules.ufs_model.lua"; fi
if [[ ! -f "./tests/ufs_common.lua" ]]; then cp "./modulefiles/ufs_common.lua" ./tests/ufs_common.lua; fi

exit 0
8 changes: 6 additions & 2 deletions sorc/link_workflow.sh
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,12 @@ do
${LINK_OR_COPY} "${HOMEgfs}/sorc/gfs_utils.fd/install/bin/${utilexe}" .
done

[[ -s "ufs_model.x" ]] && rm -f ufs_model.x
${LINK_OR_COPY} "${HOMEgfs}/sorc/ufs_model.fd/tests/ufs_model.x" .
[[ -s "gfs_model.x" ]] && rm -f gfs_model.x
[[ -s "gefs_model.x" ]] && rm -f gefs_model.x
[[ -s "sfs_model.x" ]] && rm -f sfs_model.x
if [[ -f "${HOMEgfs}/sorc/ufs_model.fd/tests/gfs_model.x" ]]; then ${LINK_OR_COPY} "${HOMEgfs}/sorc/ufs_model.fd/tests/gfs_model.x" .; fi
if [[ -f "${HOMEgfs}/sorc/ufs_model.fd/tests/gefs_model.x" ]]; then ${LINK_OR_COPY} "${HOMEgfs}/sorc/ufs_model.fd/tests/gefs_model.x" .; fi
if [[ -f "${HOMEgfs}/sorc/ufs_model.fd/tests/sfs_model.x" ]]; then ${LINK_OR_COPY} "${HOMEgfs}/sorc/ufs_model.fd/tests/sfs_model.x" .; fi

[[ -s "upp.x" ]] && rm -f upp.x
${LINK_OR_COPY} "${HOMEgfs}/sorc/upp.fd/exec/upp.x" .
Expand Down
Loading