From dadeceea9cc9022dc413d73362fb629897bae2dd Mon Sep 17 00:00:00 2001 From: "guoqing.ge" Date: Mon, 22 Apr 2024 12:29:01 -0600 Subject: [PATCH 1/6] update build scripts to include the nest physics and an -f option to build the UFS model --- parm/config/gfs/config.base | 1 + parm/config/gfs/config.ufs | 2 +- sorc/build_all.sh | 7 +++++-- sorc/build_ufs.sh | 11 ++++++++--- 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/parm/config/gfs/config.base b/parm/config/gfs/config.base index 5a58c75220..f4ecbe9b8a 100644 --- a/parm/config/gfs/config.base +++ b/parm/config/gfs/config.base @@ -184,6 +184,7 @@ export DO_AERO="NO" export WAVE_CDUMP="" # When to include wave suite: gdas, gfs, or both export DOBNDPNT_WAVE="NO" export FRAC_GRID=".true." +export CCPP_SUITE="FV3_GFS_v17_p8_ugwpv1" # Set operational resolution export OPS_RES="C768" # Do not change # TODO: Why is this needed and where is it used? diff --git a/parm/config/gfs/config.ufs b/parm/config/gfs/config.ufs index 0db6f090a5..7cec5a0822 100644 --- a/parm/config/gfs/config.ufs +++ b/parm/config/gfs/config.ufs @@ -241,7 +241,7 @@ export cplice=".false." export cplchm=".false." export cplwav=".false." export cplwav2atm=".false." -export CCPP_SUITE="FV3_GFS_v17_p8_ugwpv1" +export CCPP_SUITE="${CCPP_SUITE:-FV3_GFS_v17_p8_ugwpv1}" model_list="atm" # Mediator specific settings diff --git a/sorc/build_all.sh b/sorc/build_all.sh index 71c877b38d..103c51183d 100755 --- a/sorc/build_all.sh +++ b/sorc/build_all.sh @@ -16,7 +16,7 @@ function _usage() { Builds all of the global-workflow components by calling the individual build scripts in sequence. -Usage: ${BASH_SOURCE[0]} [-a UFS_app][-c build_config][-d][-h][-j n][-v][-w] +Usage: ${BASH_SOURCE[0]} [-a UFS_app][-c build_config][-d][-h][-j n][-v][-w][-f] -a UFS_app: Build a specific UFS app instead of the default -d: @@ -35,6 +35,8 @@ Usage: ${BASH_SOURCE[0]} [-a UFS_app][-c build_config][-d][-h][-j n][-v][-w] Execute all build scripts with -v option to turn on verbose where supported -w: Use structured wave grid + -f: + Build the UFS model using the -DFASTER=ON option EOF exit 1 } @@ -53,9 +55,10 @@ _build_job_max=20 _quick_kill="NO" # Reset option counter in case this script is sourced OPTIND=1 -while getopts ":a:dghj:kuvw" option; do +while getopts ":a:dghj:kuvwf" option; do case "${option}" in a) _build_ufs_opt+="-a ${OPTARG} ";; + f) _build_ufs_opt+="-j ";; d) _build_debug="-d" ;; g) _build_gsi="YES" ;; h) _usage;; diff --git a/sorc/build_ufs.sh b/sorc/build_ufs.sh index ac38d1dcbe..e17a316435 100755 --- a/sorc/build_ufs.sh +++ b/sorc/build_ufs.sh @@ -5,16 +5,17 @@ cwd=$(pwd) # Default settings APP="S2SWA" -CCPP_SUITES="FV3_GFS_v17_p8_ugwpv1,FV3_GFS_v17_coupled_p8_ugwpv1" # TODO: does the g-w need to build with all these CCPP_SUITES? +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" -while getopts ":da:j:vw" option; do +while getopts ":da:j:vwf" option; do case "${option}" in d) BUILD_TYPE="Debug";; a) APP="${OPTARG}";; j) BUILD_JOBS="${OPTARG}";; v) export BUILD_VERBOSE="YES";; w) PDLIB="OFF";; + f) FASTER="ON";; :) echo "[${BASH_SOURCE[0]}]: ${option} requires an argument" ;; @@ -31,7 +32,11 @@ source "./tests/module-setup.sh" MAKE_OPT="-DAPP=${APP} -D32BIT=ON -DCCPP_SUITES=${CCPP_SUITES}" [[ ${PDLIB:-"OFF"} = "ON" ]] && MAKE_OPT+=" -DPDLIB=ON" -[[ ${BUILD_TYPE:-"Release"} = "Debug" ]] && MAKE_OPT+=" -DDEBUG=ON" +if [[ ${BUILD_TYPE:-"Release"} = "DEBUG" ]] ; then + MAKE_OPT+=" -DDEBUG=ON" +elif [[ "${FASTER:-OFF}" == ON ]] ; then + MAKE_OPT+=" -DFASTER=ON" +fi COMPILE_NR=0 CLEAN_BEFORE=YES CLEAN_AFTER=NO From 0be66ff92622b7290fac0e36dd2ce4728ab428f5 Mon Sep 17 00:00:00 2001 From: "guoqing.ge" Date: Mon, 22 Apr 2024 20:45:04 -0600 Subject: [PATCH 2/6] remove the CCPP_SUITE variable from config.base per suggestion --- parm/config/gfs/config.base | 1 - 1 file changed, 1 deletion(-) diff --git a/parm/config/gfs/config.base b/parm/config/gfs/config.base index f4ecbe9b8a..5a58c75220 100644 --- a/parm/config/gfs/config.base +++ b/parm/config/gfs/config.base @@ -184,7 +184,6 @@ export DO_AERO="NO" export WAVE_CDUMP="" # When to include wave suite: gdas, gfs, or both export DOBNDPNT_WAVE="NO" export FRAC_GRID=".true." -export CCPP_SUITE="FV3_GFS_v17_p8_ugwpv1" # Set operational resolution export OPS_RES="C768" # Do not change # TODO: Why is this needed and where is it used? From 9c1a384a2f16bfbc0231cd375023eefb3c5c7dda Mon Sep 17 00:00:00 2001 From: "guoqing.ge" Date: Mon, 22 Apr 2024 21:03:03 -0600 Subject: [PATCH 3/6] maintain alphabetical order for the -f option --- sorc/build_all.sh | 4 ++-- sorc/build_ufs.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sorc/build_all.sh b/sorc/build_all.sh index 103c51183d..8eeb162788 100755 --- a/sorc/build_all.sh +++ b/sorc/build_all.sh @@ -16,7 +16,7 @@ function _usage() { Builds all of the global-workflow components by calling the individual build scripts in sequence. -Usage: ${BASH_SOURCE[0]} [-a UFS_app][-c build_config][-d][-h][-j n][-v][-w][-f] +Usage: ${BASH_SOURCE[0]} [-a UFS_app][-c build_config][-d][-f][-h][-j n][-v][-w] -a UFS_app: Build a specific UFS app instead of the default -d: @@ -55,7 +55,7 @@ _build_job_max=20 _quick_kill="NO" # Reset option counter in case this script is sourced OPTIND=1 -while getopts ":a:dghj:kuvwf" option; do +while getopts ":a:dfghj:kuvw" option; do case "${option}" in a) _build_ufs_opt+="-a ${OPTARG} ";; f) _build_ufs_opt+="-j ";; diff --git a/sorc/build_ufs.sh b/sorc/build_ufs.sh index e17a316435..66eeadd852 100755 --- a/sorc/build_ufs.sh +++ b/sorc/build_ufs.sh @@ -8,7 +8,7 @@ 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" -while getopts ":da:j:vwf" option; do +while getopts ":da:fj:vw" option; do case "${option}" in d) BUILD_TYPE="Debug";; a) APP="${OPTARG}";; From a14547de4e9a8bb15de8e81dc97fa84949c1551f Mon Sep 17 00:00:00 2001 From: "guoqing.ge" Date: Mon, 22 Apr 2024 21:11:28 -0600 Subject: [PATCH 4/6] move up the -f description --- sorc/build_all.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sorc/build_all.sh b/sorc/build_all.sh index 8eeb162788..88b03965bb 100755 --- a/sorc/build_all.sh +++ b/sorc/build_all.sh @@ -21,6 +21,8 @@ Usage: ${BASH_SOURCE[0]} [-a UFS_app][-c build_config][-d][-f][-h][-j n][-v][-w] Build a specific UFS app instead of the default -d: Build in debug mode + -f: + Build the UFS model using the -DFASTER=ON option -g: Build GSI -h: @@ -35,8 +37,6 @@ Usage: ${BASH_SOURCE[0]} [-a UFS_app][-c build_config][-d][-f][-h][-j n][-v][-w] Execute all build scripts with -v option to turn on verbose where supported -w: Use structured wave grid - -f: - Build the UFS model using the -DFASTER=ON option EOF exit 1 } From ed8bdf6255d659104a5e88f92915ed3c3cb56e04 Mon Sep 17 00:00:00 2001 From: Guoqing Ge Date: Mon, 22 Apr 2024 21:30:55 -0600 Subject: [PATCH 5/6] Update sorc/build_all.sh Co-authored-by: Walter Kolczynski - NOAA --- sorc/build_all.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sorc/build_all.sh b/sorc/build_all.sh index 88b03965bb..8b781d167f 100755 --- a/sorc/build_all.sh +++ b/sorc/build_all.sh @@ -58,7 +58,7 @@ OPTIND=1 while getopts ":a:dfghj:kuvw" option; do case "${option}" in a) _build_ufs_opt+="-a ${OPTARG} ";; - f) _build_ufs_opt+="-j ";; + f) _build_ufs_opt+="-f ";; d) _build_debug="-d" ;; g) _build_gsi="YES" ;; h) _usage;; From 3d0c89a36aee25ac9a9f1617ace29a008d20ae7b Mon Sep 17 00:00:00 2001 From: "guoqing.ge" Date: Mon, 22 Apr 2024 21:32:15 -0600 Subject: [PATCH 6/6] move up the f) option --- sorc/build_ufs.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sorc/build_ufs.sh b/sorc/build_ufs.sh index 66eeadd852..7e84eaebc2 100755 --- a/sorc/build_ufs.sh +++ b/sorc/build_ufs.sh @@ -12,10 +12,10 @@ while getopts ":da:fj:vw" option; do case "${option}" in d) BUILD_TYPE="Debug";; a) APP="${OPTARG}";; + f) FASTER="ON";; j) BUILD_JOBS="${OPTARG}";; v) export BUILD_VERBOSE="YES";; w) PDLIB="OFF";; - f) FASTER="ON";; :) echo "[${BASH_SOURCE[0]}]: ${option} requires an argument" ;;