From 1c5b14bea76609bfff317be1c300562a4fb7762b Mon Sep 17 00:00:00 2001 From: Rahul Mahajan Date: Wed, 13 Nov 2024 21:39:32 -0500 Subject: [PATCH 01/30] allow building multiple ufs_model.x for gfs, gefs and sfs --- parm/config/gefs/config.fcst | 6 +++--- parm/config/gfs/config.fcst | 6 +++--- sorc/build_all.sh | 7 ++++--- sorc/build_ufs.sh | 20 ++++++++++++++------ 4 files changed, 24 insertions(+), 15 deletions(-) diff --git a/parm/config/gefs/config.fcst b/parm/config/gefs/config.fcst index c600c8edbf9..21c666c5209 100644 --- a/parm/config/gefs/config.fcst +++ b/parm/config/gefs/config.fcst @@ -63,7 +63,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="gefs_model.x" ####################################################################### # Model configuration @@ -117,7 +117,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 @@ -145,7 +145,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) diff --git a/parm/config/gfs/config.fcst b/parm/config/gfs/config.fcst index 571e6cafb5f..7fca6ac0cac 100644 --- a/parm/config/gfs/config.fcst +++ b/parm/config/gfs/config.fcst @@ -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 @@ -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 @@ -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) diff --git a/sorc/build_all.sh b/sorc/build_all.sh index e75c853c392..9414846f2a3 100755 --- a/sorc/build_all.sh +++ b/sorc/build_all.sh @@ -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 @@ -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 @@ -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}" diff --git a/sorc/build_ufs.sh b/sorc/build_ufs.sh index 6432962a5aa..478588f92bf 100755 --- a/sorc/build_ufs.sh +++ b/sorc/build_ufs.sh @@ -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}";; @@ -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" ;; @@ -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 From 98f26a876326efe4a907d730400563bf3504b831 Mon Sep 17 00:00:00 2001 From: Rahul Mahajan Date: Wed, 13 Nov 2024 21:41:47 -0500 Subject: [PATCH 02/30] use SFS_POST as a proxy for SFS --- parm/config/gefs/config.fcst | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/parm/config/gefs/config.fcst b/parm/config/gefs/config.fcst index 21c666c5209..2405723be5e 100644 --- a/parm/config/gefs/config.fcst +++ b/parm/config/gefs/config.fcst @@ -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="gefs_model.x" +if [[ "${SFS_POST:-}" == "YES" ]]; then + export FCSTEXEC="sfs_model.x" +else + export FCSTEXEC="gefs_model.x" +fi ####################################################################### # Model configuration From 041e7e1c5381586a032b414d977108ae8122ee40 Mon Sep 17 00:00:00 2001 From: Rahul Mahajan Date: Wed, 13 Nov 2024 22:02:25 -0500 Subject: [PATCH 03/30] link/copy the appropriate model executable --- sorc/link_workflow.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sorc/link_workflow.sh b/sorc/link_workflow.sh index b35b7ff35af..129832b6d37 100755 --- a/sorc/link_workflow.sh +++ b/sorc/link_workflow.sh @@ -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" . From e536a3a5ae95cd7db7837cdfa21b8b4bc369637a Mon Sep 17 00:00:00 2001 From: Rahul Mahajan Date: Wed, 4 Dec 2024 11:05:41 -0500 Subject: [PATCH 04/30] create gfs/gefs versions of ww3 pre/post execs --- sorc/build_ufs.sh | 5 +- sorc/build_ww3prepost.sh | 127 ++++++++----------- sorc/link_workflow.sh | 259 ++++++++++++++++++++------------------- 3 files changed, 187 insertions(+), 204 deletions(-) diff --git a/sorc/build_ufs.sh b/sorc/build_ufs.sh index 478588f92bf..863ca30b65b 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" HYDRO="OFF" -EXEC_NAME="gfs_model.x" +EXEC_NAME="ufs_model.x" while getopts ":da:fj:e:vwy" option; do case "${option}" in @@ -44,10 +44,11 @@ elif [[ "${FASTER:-OFF}" == ON ]] ; then fi case "${EXEC_NAME}" in + "ufs_model.x") COMPILE_ID=0 ;; "gfs_model.x") COMPILE_ID=1 ;; "gefs_model.x") COMPILE_ID=2 ;; "sfs_model.x") COMPILE_ID=3 ;; - *) COMPILE_ID=0 ;; + *) echo "Unsupported executable name: ${EXEC_NAME}"; exit 1 ;; esac CLEAN_BEFORE=YES CLEAN_AFTER=NO diff --git a/sorc/build_ww3prepost.sh b/sorc/build_ww3prepost.sh index 67ee5e1dc27..b6db1321562 100755 --- a/sorc/build_ww3prepost.sh +++ b/sorc/build_ww3prepost.sh @@ -1,131 +1,104 @@ #! /usr/bin/env bash set -x -script_dir=$(dirname "${BASH_SOURCE[0]}") -cd "${script_dir}" || exit 1 +readonly _HOMEgfs=$(cd "$(dirname "$(readlink -f -n "${BASH_SOURCE[0]}")")/.." && pwd -P) +cd "${_HOMEgfs}/sorc" || exit 1 # Default settings -APP="S2SWA" PDLIB="ON" while getopts ":j:a:dvw" option; do case "${option}" in - a) APP="${OPTARG}";; - d) BUILD_TYPE="Debug";; - j) BUILD_JOBS="${OPTARG}";; - v) export BUILD_VERBOSE="YES";; - w) PDLIB="OFF";; - :) - echo "[${BASH_SOURCE[0]}]: ${option} requires an argument" - usage - ;; - *) - echo "[${BASH_SOURCE[0]}]: Unrecognized option: ${option}" - usage - ;; + d) BUILD_TYPE="Debug" ;; + j) BUILD_JOBS="${OPTARG}" ;; + v) export BUILD_VERBOSE="YES" ;; + w) PDLIB="OFF" ;; + :) + echo "[${BASH_SOURCE[0]}]: ${option} requires an argument" + usage + ;; + *) + echo "[${BASH_SOURCE[0]}]: Unrecognized option: ${option}" + usage + ;; esac done -# Determine which switch to use -if [[ "${APP}" == "ATMW" ]]; then - ww3switch="model/esmf/switch" -else - if [[ "${PDLIB}" == "ON" ]]; then - ww3switch="model/bin/switch_meshcap_pdlib" - else - ww3switch="model/bin/switch_meshcap" - fi -fi - -# Check final exec folder exists -if [[ ! -d "../exec" ]]; then - mkdir ../exec -fi - -finalexecdir="$( pwd -P )/../exec" - -#Determine machine and load modules +# Determine machine and load modules set +x -source "${script_dir}/ufs_model.fd/tests/detect_machine.sh" -source "${script_dir}/ufs_model.fd/tests/module-setup.sh" -module use "${script_dir}/ufs_model.fd/modulefiles" +source "${_HOMEgfs}/sorc/ufs_model.fd/tests/detect_machine.sh" +source "${_HOMEgfs}/sorc/ufs_model.fd/tests/module-setup.sh" +module use "${_HOMEgfs}/sorc/ufs_model.fd/modulefiles" module load "ufs_${MACHINE_ID}.intel" set -x #Set WW3 directory, switch, prep and post exes -cd ufs_model.fd/WW3 || exit 1 -WW3_DIR=$( pwd -P ) +cd "${_HOMEgfs}/sorc/ufs_model.fd/WW3" || exit 1 +WW3_DIR=$(pwd -P) export WW3_DIR export SWITCHFILE="${WW3_DIR}/${ww3switch}" -# Build exes for prep jobs and post jobs: -prep_exes="ww3_grid ww3_prep ww3_prnc ww3_grid" -post_exes="ww3_outp ww3_outf ww3_outp ww3_gint ww3_ounf ww3_ounp ww3_grib" +# Determine which switch to use +if [[ "${PDLIB}" == "ON" ]]; then + ww3switch="model/bin/switch_meshcap_pdlib" + path_build="${WW3_DIR}/build_pdlib" + path_install="${WW3_DIR}/install_pdlib" +else + ww3switch="model/bin/switch_meshcap" + path_build="${WW3_DIR}/build" + path_install="install" +fi #create build directory: -path_build="${WW3_DIR}/build_SHRD" [[ -d "${path_build}" ]] && rm -rf "${path_build}" mkdir -p "${path_build}" || exit 1 cd "${path_build}" || exit 1 -echo "Forcing a SHRD build" buildswitch="${path_build}/switch" -cat "${SWITCHFILE}" > "${path_build}/tempswitch" - -sed -e "s/DIST/SHRD/g"\ - -e "s/OMPG / /g"\ - -e "s/OMPH / /g"\ - -e "s/MPIT / /g"\ - -e "s/MPI / /g"\ - -e "s/B4B / /g"\ - -e "s/PDLIB / /g"\ - -e "s/SCOTCH / /g"\ - -e "s/METIS / /g"\ - -e "s/NOGRB/NCEP2/g"\ - "${path_build}/tempswitch" > "${path_build}/switch" +cat "${SWITCHFILE}" >"${path_build}/tempswitch" + +sed -e "s/DIST/SHRD/g" \ + -e "s/OMPG / /g" \ + -e "s/OMPH / /g" \ + -e "s/MPIT / /g" \ + -e "s/MPI / /g" \ + -e "s/B4B / /g" \ + -e "s/PDLIB / /g" \ + -e "s/SCOTCH / /g" \ + -e "s/METIS / /g" \ + -e "s/NOGRB/NCEP2/g" \ + "${path_build}/tempswitch" >"${path_build}/switch" rm "${path_build}/tempswitch" echo "Switch file is ${buildswitch} with switches:" cat "${buildswitch}" #define cmake build options -MAKE_OPT="-DCMAKE_INSTALL_PREFIX=install" +MAKE_OPT="-DCMAKE_INSTALL_PREFIX=${path_install}" [[ ${BUILD_TYPE:-"Release"} = "Debug" ]] && MAKE_OPT+=" -DCMAKE_BUILD_TYPE=Debug" #Build executables: # shellcheck disable=SC2086 cmake "${WW3_DIR}" -DSWITCH="${buildswitch}" ${MAKE_OPT} rc=$? -if (( rc != 0 )); then +if ((rc != 0)); then echo "Fatal error in cmake." exit "${rc}" fi + make -j "${BUILD_JOBS:-8}" rc=$? -if (( rc != 0 )); then +if ((rc != 0)); then echo "Fatal error in make." exit "${rc}" fi + make install -if (( rc != 0 )); then +rc=$? +if ((rc != 0)); then echo "Fatal error in make install." exit "${rc}" fi -# Copy to top-level exe directory -for prog in ${prep_exes} ${post_exes}; do - cp "${path_build}/install/bin/${prog}" "${finalexecdir}/" - rc=$? - if (( rc != 0 )); then - echo "FATAL: Unable to copy ${path_build}/${prog} to ${finalexecdir} (Error code ${rc})" - exit "${rc}" - fi -done - -#clean-up build directory: -echo "executables are in ${finalexecdir}" -echo "cleaning up ${path_build}" -rm -rf "${path_build}" - exit 0 diff --git a/sorc/link_workflow.sh b/sorc/link_workflow.sh index 129832b6d37..4afa924d8ae 100755 --- a/sorc/link_workflow.sh +++ b/sorc/link_workflow.sh @@ -2,11 +2,11 @@ #--make symbolic links for EMC installation and hardcopies for NCO delivery -HOMEgfs="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." >/dev/null 2>&1 && pwd )" +HOMEgfs="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." >/dev/null 2>&1 && pwd)" TRACE=NO source "${HOMEgfs}/ush/preamble.sh" function usage() { - cat << EOF + cat < Date: Thu, 5 Dec 2024 10:48:30 -0500 Subject: [PATCH 05/30] use NET specific executable names --- scripts/exgfs_wave_post_pnt.sh | 10 +++++----- sorc/link_workflow.sh | 5 +++-- ush/wave_grib2_sbs.sh | 19 ++++++++++--------- ush/wave_grid_interp_sbs.sh | 13 +++++++------ ush/wave_grid_moddef.sh | 20 ++++++++++---------- ush/wave_outp_spec.sh | 12 ++++++------ ush/wave_prnc_cur.sh | 10 +++++----- ush/wave_prnc_ice.sh | 20 ++++++++++---------- 8 files changed, 56 insertions(+), 53 deletions(-) diff --git a/scripts/exgfs_wave_post_pnt.sh b/scripts/exgfs_wave_post_pnt.sh index 06769303a10..f2dfdf93992 100755 --- a/scripts/exgfs_wave_post_pnt.sh +++ b/scripts/exgfs_wave_post_pnt.sh @@ -271,18 +271,18 @@ source "${USHgfs}/preamble.sh" rm -f buoy_tmp.loc buoy_log.ww3 ww3_oup.inp ${NLN} ./out_pnt.${waveuoutpGRD} ./out_pnt.ww3 ${NLN} ./mod_def.${waveuoutpGRD} ./mod_def.ww3 - export pgm=ww3_outp;. prep_step - ${EXECgfs}/ww3_outp > buoy_lst.loc 2>&1 - export err=$?;err_chk + export pgm="${NET,,}_ww3_outp.x" + . prep_step + "${EXECgfs}/${pgm}" > buoy_lst.loc 2>&1 + export err=$?;err_chk if [ "$err" != '0' ] && [ ! -f buoy_log.ww3 ] then - pgm=wave_post set +x echo ' ' echo '******************************************** ' - echo '*** FATAL ERROR : ERROR IN ww3_outp *** ' + echo '*** FATAL ERROR : ERROR IN ${pgm} *** ' echo '******************************************** ' echo ' ' cat buoy_tmp.loc diff --git a/sorc/link_workflow.sh b/sorc/link_workflow.sh index 4afa924d8ae..ead835eed8c 100755 --- a/sorc/link_workflow.sh +++ b/sorc/link_workflow.sh @@ -301,11 +301,12 @@ if [[ -f "${HOMEgfs}/sorc/ufs_model.fd/tests/sfs_model.x" ]]; then ${LINK_OR_COP # WW3 pre/post executables declare -a ww3_exes=("ww3_grid" "ww3_prep" "ww3_prnc" "ww3_outp" "ww3_outf" "ww3_gint" "ww3_ounf" "ww3_ounp" "ww3_grib") +# TODO: ww3_prep, ww3_outf, ww3_ounf, ww3_ounp are not used in the workflow # FIXME or remove them from the list if [[ -d "${HOMEgfs}/sorc/ufs_model.fd/WW3/install" ]]; then # installed with PDLIB=OFF (Used in GEFS) for ww3exe in "${ww3_exes[@]}"; do [[ -s "gefs_${ww3exe}" ]] && rm -f "gefs_${HOMEgfs}/exec/${ww3exe}" ${LINK_OR_COPY} "${HOMEgfs}/sorc/ufs_model.fd/WW3/install/bin/${ww3exe}" \ - "${HOMEgfs}/exec/gefs_${ww3exe}" + "${HOMEgfs}/exec/gefs_${ww3exe}.x" done fi @@ -313,7 +314,7 @@ if [[ -d "${HOMEgfs}/sorc/ufs_model.fd/WW3/install_pdlib" ]]; then # installed w for ww3exe in "${ww3_exes[@]}"; do [[ -s "gfs_${ww3exe}" ]] && rm -f "gfs_${ww3exe}" ${LINK_OR_COPY} "${HOMEgfs}/sorc/ufs_model.fd/WW3/install_pdlib/bin/${ww3exe}" \ - "${HOMEgfs}/exec/gfs_${ww3exe}" + "${HOMEgfs}/exec/gfs_${ww3exe}.x" done fi diff --git a/ush/wave_grib2_sbs.sh b/ush/wave_grib2_sbs.sh index 99f89f3f37d..1a7b3179b60 100755 --- a/ush/wave_grib2_sbs.sh +++ b/ush/wave_grib2_sbs.sh @@ -136,27 +136,28 @@ if [[ ! -s "${COMOUT_WAVE_GRID}/${outfile}.idx" ]]; then # 1.b Run GRIB packing program + + export pgm="${NET,,}_ww3_grib.x" + . prep_step + set +x - echo " Run ww3_grib2" - echo " Executing ${EXECgfs}/ww3_grib" + echo " Executing ${EXECgfs}/${pgm}" set_trace - export pgm=ww3_grib;. prep_step - "${EXECgfs}/ww3_grib" > "grib2_${grdnam}_${FH3}.out" 2>&1 + "${EXECgfs}/${pgm}" > "grib2_${grdnam}_${FH3}.out" 2>&1 export err=$?;err_chk - if [ ! -s gribfile ]; then set +x echo ' ' echo '************************************************ ' - echo '*** FATAL ERROR : ERROR IN ww3_grib encoding *** ' + echo '*** FATAL ERROR : ERROR IN ${pgm} encoding *** ' echo '************************************************ ' echo ' ' set_trace exit 3 fi - if (( fhr > 0 )); then + if (( fhr > 0 )); then ${WGRIB2} gribfile -set_date "${PDY}${cyc}" -set_ftime "${fhr} hour fcst" -grib "${COMOUT_WAVE_GRID}/${outfile}" err=$? else @@ -169,7 +170,7 @@ if [[ ! -s "${COMOUT_WAVE_GRID}/${outfile}.idx" ]]; then set +x echo ' ' echo '********************************************* ' - echo '*** FATAL ERROR : ERROR IN ww3_grib2 *** ' + echo '*** FATAL ERROR : ERROR IN ${pgm} *** ' # FIXME: This is not an error in $pgm, but in WGRIB2 echo '********************************************* ' echo ' ' set_trace @@ -197,7 +198,7 @@ if [[ ! -s "${COMOUT_WAVE_GRID}/${outfile}.idx" ]]; then set +x echo ' ' echo '********************************************* ' - echo '*** FATAL ERROR : ERROR IN ww3_grib2 *** ' + echo '*** FATAL ERROR : ERROR IN ${pgm} *** ' echo '********************************************* ' echo ' ' echo " Error in moving grib file ${outfile} to com" diff --git a/ush/wave_grid_interp_sbs.sh b/ush/wave_grid_interp_sbs.sh index 31b7808c168..e848badbe8f 100755 --- a/ush/wave_grid_interp_sbs.sh +++ b/ush/wave_grid_interp_sbs.sh @@ -133,17 +133,18 @@ source "${USHgfs}/preamble.sh" # 1.b Run interpolation code + export pgm="${NET,,}_ww3_gint.x" + . prep_step + set +x - echo " Run ww3_gint - echo " Executing ${EXECgfs}/ww3_gint + echo " Executing ${pgm}" set_trace - export pgm=ww3_gint;. prep_step - ${EXECgfs}/ww3_gint 1> gint.${grdID}.out 2>&1 + "${EXECgfs}/${pgm}" 1> gint.${grdID}.out 2>&1 export err=$?;err_chk # Write interpolation file to main TEMP dir area if not there yet - if [ "wht_OK" = 'no' ] + if [ "wht_OK" = 'no' ] # FIXME: This is never going to evaluate to true, wht_OK is a string and needs to be ${wht_OK} then cp -f ./WHTGRIDINT.bin ${DATA}/ww3_gint.WHTGRIDINT.bin.${grdID} cp -f ./WHTGRIDINT.bin ${FIXgfs}/wave/ww3_gint.WHTGRIDINT.bin.${grdID} @@ -155,7 +156,7 @@ source "${USHgfs}/preamble.sh" set +x echo ' ' echo '*************************************************** ' - echo '*** FATAL ERROR : ERROR IN ww3_gint interpolation * ' + echo '*** FATAL ERROR : ERROR IN ${pgm} interpolation * ' echo '*************************************************** ' echo ' ' set_trace diff --git a/ush/wave_grid_moddef.sh b/ush/wave_grid_moddef.sh index 1e8c44054a7..bd2a9a3debc 100755 --- a/ush/wave_grid_moddef.sh +++ b/ush/wave_grid_moddef.sh @@ -1,5 +1,5 @@ #! /usr/bin/env bash - + ################################################################################ # # UNIX Script Documentation Block @@ -72,27 +72,27 @@ source "${USHgfs}/preamble.sh" fi # --------------------------------------------------------------------------- # -# 2. Create mod_def file +# 2. Create mod_def file set +x echo ' ' echo ' Creating mod_def file ...' - echo " Executing ${EXECgfs}/ww3_grid" + echo " Executing ${EXECgfs}/${NET,,}_ww3_grid.x" echo ' ' set_trace - - rm -f ww3_grid.inp + + rm -f ww3_grid.inp ${NLN} ../ww3_grid.inp.$grdID ww3_grid.inp if [ -f ../${grdID}.msh ] then - rm -f ${grdID}.msh + rm -f ${grdID}.msh ${NLN} ../${grdID}.msh ${grdID}.msh fi - - "${EXECgfs}/ww3_grid" 1> "grid_${grdID}.out" 2>&1 + + "${EXECgfs}/${NET,,}_ww3_grid.x" 1> "grid_${grdID}.out" 2>&1 err=$? if [ "$err" != '0' ] @@ -100,13 +100,13 @@ source "${USHgfs}/preamble.sh" set +x echo ' ' echo '******************************************** ' - echo '*** FATAL ERROR : ERROR IN ww3_grid *** ' + echo '*** FATAL ERROR : ERROR IN ${NET,,}_ww3_grid.x *** ' echo '******************************************** ' echo ' ' set_trace exit 3 fi - + if [[ -f mod_def.ww3 ]] then cp mod_def.ww3 "${COMOUT_WAVE_PREP}/${RUN}wave.mod_def.${grdID}" diff --git a/ush/wave_outp_spec.sh b/ush/wave_outp_spec.sh index 37accbae49c..ae818171ca0 100755 --- a/ush/wave_outp_spec.sh +++ b/ush/wave_outp_spec.sh @@ -161,21 +161,21 @@ source "${USHgfs}/preamble.sh" # 2.b Run the postprocessor + export pgm="${NET,,}_ww3_outp.x" + . prep_step + set +x - echo " Executing ${EXECgfs}/ww3_outp" + echo " Executing ${EXECgfs}/${pgm}" set_trace - export pgm=ww3_outp;. prep_step - ${EXECgfs}/ww3_outp 1> outp_${specdir}_${buoy}.out 2>&1 + "${EXECgfs}/${pgm}" 1> outp_${specdir}_${buoy}.out 2>&1 export err=$?;err_chk - - if [ "$err" != '0' ] then set +x echo ' ' echo '******************************************** ' - echo '*** FATAL ERROR : ERROR IN ww3_outp *** ' + echo '*** FATAL ERROR : ERROR IN ${pgm} *** ' echo '******************************************** ' echo ' ' set_trace diff --git a/ush/wave_prnc_cur.sh b/ush/wave_prnc_cur.sh index 927710c581a..02064427f48 100755 --- a/ush/wave_prnc_cur.sh +++ b/ush/wave_prnc_cur.sh @@ -74,22 +74,22 @@ rm -f cur.nc ${NLN} "cur_glo_uv_${PDY}_${fext}${fh3}_5min.nc" "cur.nc" ${NLN} "${DATA}/mod_def.${WAVECUR_FID}" ./mod_def.ww3 -export pgm=ww3_prnc;. prep_step -${EXECgfs}/ww3_prnc 1> prnc_${WAVECUR_FID}_${ymdh_rtofs}.out 2>&1 +export pgm="${NET,,}_ww3_prnc.x" +. prep_step +"${EXECgfs}/${pgm}" 1> prnc_${WAVECUR_FID}_${ymdh_rtofs}.out 2>&1 export err=$?; err_chk - if [ "$err" != '0' ] then cat prnc_${WAVECUR_FID}_${ymdh_rtofs}.out set $setoff echo ' ' echo '******************************************** ' - echo '*** WARNING: NON-FATAL ERROR IN ww3_prnc *** ' + echo '*** WARNING: NON-FATAL ERROR IN ${pgm} *** ' echo '******************************************** ' echo ' ' set $seton - echo "WARNING: NON-FATAL ERROR IN ww3_prnc." + echo "WARNING: NON-FATAL ERROR IN ${pgm}." exit 4 fi diff --git a/ush/wave_prnc_ice.sh b/ush/wave_prnc_ice.sh index be089c30bd3..890df71973e 100755 --- a/ush/wave_prnc_ice.sh +++ b/ush/wave_prnc_ice.sh @@ -32,7 +32,7 @@ source "${USHgfs}/preamble.sh" # 0.a Basic modes of operation cd $DATA - + rm -rf ice mkdir ice cd ice @@ -57,7 +57,7 @@ source "${USHgfs}/preamble.sh" if [[ -z "${YMDH}" ]] || [[ -z "${cycle}" ]] || \ [[ -z "${COMOUT_WAVE_PREP}" ]] || [[ -z "${FIXgfs}" ]] || [[ -z "${EXECgfs}" ]] || \ [[ -z "${WAV_MOD_TAG}" ]] || [[ -z "${WAVEICE_FID}" ]] || [[ -z "${COMIN_OBS}" ]]; then - + set +x echo ' ' echo '**************************************************' @@ -129,7 +129,7 @@ source "${USHgfs}/preamble.sh" fi rm -f wgrib.out - rm -f ice.grib + rm -f ice.grib rm -f ice.index @@ -142,14 +142,14 @@ source "${USHgfs}/preamble.sh" cp -f ${DATA}/ww3_prnc.ice.$WAVEICE_FID.inp.tmpl ww3_prnc.inp - export pgm=ww3_prnc;. prep_step + export pgm="${NET,,}_ww3_prnc.x" + . prep_step - ${EXECgfs}/ww3_prnc 1> prnc_${WAVEICE_FID}_${cycle}.out 2>&1 + "${EXECgfs}/${pgm}" 1> prnc_${WAVEICE_FID}_${cycle}.out 2>&1 export err=$?; err_chk - if [ "$err" != '0' ] then - cat prnc_${WAVEICE_FID}_${cycle}.out + cat prnc_${WAVEICE_FID}_${cycle}.out set +x echo ' ' echo '******************************************** ' @@ -170,13 +170,13 @@ source "${USHgfs}/preamble.sh" # and only WAV_MOD_ID if WW3ATMIENS=F # if [ "${WW3ATMIENS}" = "T" ] - then + then icefile=${WAV_MOD_TAG}.${WAVEICE_FID}.$cycle.ice elif [ "${WW3ATMIENS}" = "F" ] - then + then icefile=${RUN}wave.${WAVEICE_FID}.$cycle.ice fi - + set +x echo " Saving ice.ww3 as ${COMOUT_WAVE_PREP}/${icefile}" set_trace From f0bf57c445ff4d81971e32b846dae31393ff7ea0 Mon Sep 17 00:00:00 2001 From: Rahul Mahajan Date: Thu, 5 Dec 2024 10:57:54 -0500 Subject: [PATCH 06/30] fix errors detected by shellnorms --- ush/wave_grib2_sbs.sh | 6 +++--- ush/wave_grid_interp_sbs.sh | 2 +- ush/wave_grid_moddef.sh | 5 +++-- ush/wave_prnc_cur.sh | 2 +- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/ush/wave_grib2_sbs.sh b/ush/wave_grib2_sbs.sh index 1a7b3179b60..6db0f50e4b1 100755 --- a/ush/wave_grib2_sbs.sh +++ b/ush/wave_grib2_sbs.sh @@ -170,7 +170,7 @@ if [[ ! -s "${COMOUT_WAVE_GRID}/${outfile}.idx" ]]; then set +x echo ' ' echo '********************************************* ' - echo '*** FATAL ERROR : ERROR IN ${pgm} *** ' # FIXME: This is not an error in $pgm, but in WGRIB2 + echo "*** FATAL ERROR : ERROR IN ${pgm} *** " # FIXME: This is not an error in $pgm, but in WGRIB2 echo '********************************************* ' echo ' ' set_trace @@ -198,7 +198,7 @@ if [[ ! -s "${COMOUT_WAVE_GRID}/${outfile}.idx" ]]; then set +x echo ' ' echo '********************************************* ' - echo '*** FATAL ERROR : ERROR IN ${pgm} *** ' + echo "*** FATAL ERROR : ERROR IN ${pgm} *** " echo '********************************************* ' echo ' ' echo " Error in moving grib file ${outfile} to com" @@ -210,7 +210,7 @@ if [[ ! -s "${COMOUT_WAVE_GRID}/${outfile}.idx" ]]; then set +x echo ' ' echo '*************************************************** ' - echo '*** FATAL ERROR : ERROR IN ww3_grib2 INDEX FILE *** ' + echo "*** FATAL ERROR : ERROR IN ${pgm} INDEX FILE *** " echo '*************************************************** ' echo ' ' echo " Error in moving grib file ${outfile}.idx to com" diff --git a/ush/wave_grid_interp_sbs.sh b/ush/wave_grid_interp_sbs.sh index e848badbe8f..190dff221b5 100755 --- a/ush/wave_grid_interp_sbs.sh +++ b/ush/wave_grid_interp_sbs.sh @@ -156,7 +156,7 @@ source "${USHgfs}/preamble.sh" set +x echo ' ' echo '*************************************************** ' - echo '*** FATAL ERROR : ERROR IN ${pgm} interpolation * ' + echo "*** FATAL ERROR : ERROR IN ${pgm} interpolation * " echo '*************************************************** ' echo ' ' set_trace diff --git a/ush/wave_grid_moddef.sh b/ush/wave_grid_moddef.sh index bd2a9a3debc..dd0ee204f6e 100755 --- a/ush/wave_grid_moddef.sh +++ b/ush/wave_grid_moddef.sh @@ -91,8 +91,9 @@ source "${USHgfs}/preamble.sh" fi + export pgm="${NET,,}_ww3_grid.x" - "${EXECgfs}/${NET,,}_ww3_grid.x" 1> "grid_${grdID}.out" 2>&1 + "${EXECgfs}/${pgm}" 1> "grid_${grdID}.out" 2>&1 err=$? if [ "$err" != '0' ] @@ -100,7 +101,7 @@ source "${USHgfs}/preamble.sh" set +x echo ' ' echo '******************************************** ' - echo '*** FATAL ERROR : ERROR IN ${NET,,}_ww3_grid.x *** ' + echo "*** FATAL ERROR : ERROR IN ${pgm} *** " echo '******************************************** ' echo ' ' set_trace diff --git a/ush/wave_prnc_cur.sh b/ush/wave_prnc_cur.sh index 02064427f48..b084b8dcacc 100755 --- a/ush/wave_prnc_cur.sh +++ b/ush/wave_prnc_cur.sh @@ -85,7 +85,7 @@ then set $setoff echo ' ' echo '******************************************** ' - echo '*** WARNING: NON-FATAL ERROR IN ${pgm} *** ' + echo "*** WARNING: NON-FATAL ERROR IN ${pgm} *** " echo '******************************************** ' echo ' ' set $seton From 3bd366a790f8cc4e3196a6e8912591270c6916bd Mon Sep 17 00:00:00 2001 From: Rahul Mahajan Date: Thu, 5 Dec 2024 11:00:17 -0500 Subject: [PATCH 07/30] one shellnorm error escaped --- ush/wave_grib2_sbs.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ush/wave_grib2_sbs.sh b/ush/wave_grib2_sbs.sh index 6db0f50e4b1..22eb361a0dc 100755 --- a/ush/wave_grib2_sbs.sh +++ b/ush/wave_grib2_sbs.sh @@ -150,7 +150,7 @@ if [[ ! -s "${COMOUT_WAVE_GRID}/${outfile}.idx" ]]; then set +x echo ' ' echo '************************************************ ' - echo '*** FATAL ERROR : ERROR IN ${pgm} encoding *** ' + echo "*** FATAL ERROR : ERROR IN ${pgm} encoding *** " echo '************************************************ ' echo ' ' set_trace From b102c079998db81099086febec62b456bb5cf184 Mon Sep 17 00:00:00 2001 From: Rahul Mahajan Date: Thu, 5 Dec 2024 11:01:44 -0500 Subject: [PATCH 08/30] one shellnorm error escaped --- scripts/exgfs_wave_post_pnt.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/exgfs_wave_post_pnt.sh b/scripts/exgfs_wave_post_pnt.sh index f2dfdf93992..9b408520924 100755 --- a/scripts/exgfs_wave_post_pnt.sh +++ b/scripts/exgfs_wave_post_pnt.sh @@ -282,7 +282,7 @@ source "${USHgfs}/preamble.sh" set +x echo ' ' echo '******************************************** ' - echo '*** FATAL ERROR : ERROR IN ${pgm} *** ' + echo "*** FATAL ERROR : ERROR IN ${pgm} *** " echo '******************************************** ' echo ' ' cat buoy_tmp.loc From 8bee97c07a3f667f38d35faa436cdc6df6282991 Mon Sep 17 00:00:00 2001 From: Rahul Mahajan Date: Thu, 5 Dec 2024 16:03:02 -0500 Subject: [PATCH 09/30] minor fixes for typos and such --- sorc/build_ww3prepost.sh | 12 ++++++------ sorc/link_workflow.sh | 18 ++++++++---------- 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/sorc/build_ww3prepost.sh b/sorc/build_ww3prepost.sh index b6db1321562..71add2bd7bf 100755 --- a/sorc/build_ww3prepost.sh +++ b/sorc/build_ww3prepost.sh @@ -32,22 +32,22 @@ module use "${_HOMEgfs}/sorc/ufs_model.fd/modulefiles" module load "ufs_${MACHINE_ID}.intel" set -x -#Set WW3 directory, switch, prep and post exes +#Set WW3 directory cd "${_HOMEgfs}/sorc/ufs_model.fd/WW3" || exit 1 WW3_DIR=$(pwd -P) export WW3_DIR -export SWITCHFILE="${WW3_DIR}/${ww3switch}" # Determine which switch to use if [[ "${PDLIB}" == "ON" ]]; then ww3switch="model/bin/switch_meshcap_pdlib" - path_build="${WW3_DIR}/build_pdlib" - path_install="${WW3_DIR}/install_pdlib" + path_build="${WW3_DIR}/build/pdlib_ON" + path_install="${WW3_DIR}/install/pdlib_ON" else ww3switch="model/bin/switch_meshcap" - path_build="${WW3_DIR}/build" - path_install="install" + path_build="${WW3_DIR}/build/pdlib_OFF" + path_install="${WW3_DIR}/install/pdlib_OFF" fi +export SWITCHFILE="${WW3_DIR}/${ww3switch}" #create build directory: [[ -d "${path_build}" ]] && rm -rf "${path_build}" diff --git a/sorc/link_workflow.sh b/sorc/link_workflow.sh index ead835eed8c..5740f6d65c5 100755 --- a/sorc/link_workflow.sh +++ b/sorc/link_workflow.sh @@ -293,28 +293,26 @@ for utilexe in fbwndgfs.x gaussian_sfcanl.x gfs_bufr.x supvit.x syndat_getjtbul. done [[ -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 +[[ -s "gefs_model.x" ]] && rm -f gefs_model.x 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 +[[ -s "sfs_model.x" ]] && rm -f sfs_model.x 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 # WW3 pre/post executables declare -a ww3_exes=("ww3_grid" "ww3_prep" "ww3_prnc" "ww3_outp" "ww3_outf" "ww3_gint" "ww3_ounf" "ww3_ounp" "ww3_grib") # TODO: ww3_prep, ww3_outf, ww3_ounf, ww3_ounp are not used in the workflow # FIXME or remove them from the list -if [[ -d "${HOMEgfs}/sorc/ufs_model.fd/WW3/install" ]]; then # installed with PDLIB=OFF (Used in GEFS) +if [[ -d "${HOMEgfs}/sorc/ufs_model.fd/WW3/install/pdlib_OFF" ]]; then # installed with PDLIB=OFF (Used in GEFS) for ww3exe in "${ww3_exes[@]}"; do - [[ -s "gefs_${ww3exe}" ]] && rm -f "gefs_${HOMEgfs}/exec/${ww3exe}" - ${LINK_OR_COPY} "${HOMEgfs}/sorc/ufs_model.fd/WW3/install/bin/${ww3exe}" \ - "${HOMEgfs}/exec/gefs_${ww3exe}.x" + [[ -s "gefs_${ww3exe}.x" ]] && rm -f "gefs_${ww3exe}.x" + ${LINK_OR_COPY} "${HOMEgfs}/sorc/ufs_model.fd/WW3/install/pdlib_OFF/bin/${ww3exe}" "${HOMEgfs}/exec/gefs_${ww3exe}.x" done fi -if [[ -d "${HOMEgfs}/sorc/ufs_model.fd/WW3/install_pdlib" ]]; then # installed with PDLIB=ON (Used in GFS, may be SFS later) +if [[ -d "${HOMEgfs}/sorc/ufs_model.fd/WW3/install/pdlib_ON" ]]; then # installed with PDLIB=ON (Used in GFS, may be SFS later) for ww3exe in "${ww3_exes[@]}"; do - [[ -s "gfs_${ww3exe}" ]] && rm -f "gfs_${ww3exe}" - ${LINK_OR_COPY} "${HOMEgfs}/sorc/ufs_model.fd/WW3/install_pdlib/bin/${ww3exe}" \ - "${HOMEgfs}/exec/gfs_${ww3exe}.x" + [[ -s "gfs_${ww3exe}.x" ]] && rm -f "gfs_${ww3exe}.x" + ${LINK_OR_COPY} "${HOMEgfs}/sorc/ufs_model.fd/WW3/install/pdlib_ON/bin/${ww3exe}" "${HOMEgfs}/exec/gfs_${ww3exe}.x" done fi From 612ef35493de703c1d982d83b1b061404d6779da Mon Sep 17 00:00:00 2001 From: Rahul Mahajan Date: Fri, 6 Dec 2024 13:46:01 -0500 Subject: [PATCH 10/30] update Jenkinsfile to build in a single location and use it --- ci/Jenkinsfile | 59 +++++++++++----------------- ci/cases/yamls/build.yaml | 3 -- ci/scripts/utils/ci_utils_wrapper.sh | 4 +- 3 files changed, 25 insertions(+), 41 deletions(-) delete mode 100644 ci/cases/yamls/build.yaml diff --git a/ci/Jenkinsfile b/ci/Jenkinsfile index b3bd6a917a8..092d5dc5359 100644 --- a/ci/Jenkinsfile +++ b/ci/Jenkinsfile @@ -1,7 +1,8 @@ def Machine = 'none' def machine = 'none' def CUSTOM_WORKSPACE = 'none' -def cases = '' +def HOMEgfs = 'none' +def CI_CASES = '' def GH = 'none' // Location of the custom workspaces for each machine in the CI system. They are persitent for each iteration of the PR. def NodeName = [hera: 'Hera-EMC', orion: 'Orion-EMC', hercules: 'Hercules-EMC', gaea: 'Gaea'] @@ -19,8 +20,8 @@ pipeline { } stages { // This initial stage is used to get the Machine name from the GitHub labels on the PR - // which is used to designate the Nodes in the Jenkins Controler by the agent label - // Each Jenknis Node is connected to said machine via an JAVA agent via an ssh tunnel + // which is used to designate the Nodes in the Jenkins Controller by the agent label + // Each Jenkins Node is connected to said machine via an JAVA agent via an ssh tunnel // no op 2 stage('1. Get Machine') { @@ -95,7 +96,7 @@ pipeline { axes { axis { name 'system' - values 'gfs', 'gefs' + values 'gfs' } } stages { @@ -103,8 +104,7 @@ pipeline { steps { catchError(buildResult: 'UNSTABLE', stageResult: 'FAILURE') { script { - def HOMEgfs = "${CUSTOM_WORKSPACE}/${system}" // local HOMEgfs is used to build the system on per system basis under the custome workspace for each buile system - env.HOME_GFS = HOMEgfs // setting path in HOMEgfs as an environment variable HOME_GFS for some systems that using the path in its .bashrc + HOMEgfs = "${CUSTOM_WORKSPACE}/global-workflow" sh(script: "mkdir -p ${HOMEgfs}") ws(HOMEgfs) { if (fileExists("${HOMEgfs}/sorc/BUILT_semaphor")) { // if the system is already built, skip the build in the case of re-runs @@ -115,7 +115,7 @@ pipeline { } } else { try { - echo "Checking out the code for ${system} on ${Machine} using scm in ${HOMEgfs}" + echo "Checking out the code on ${Machine} using scm in ${HOMEgfs}" checkout scm } catch (Exception e) { if (env.CHANGE_ID) { @@ -127,14 +127,13 @@ pipeline { def gist_url = "" def error_logs = "" def error_logs_message = "" - def builds_file = readYaml file: 'ci/cases/yamls/build.yaml' - def build_args_list = builds_file['builds'] - def build_args = build_args_list[system].join(' ').trim().replaceAll('null', '') dir("${HOMEgfs}/sorc") { try { - sh(script: "${build_args}") + sh(script: './build_all.sh -kgu') // build the global-workflow executables for GFS variant (UFS-wx-model, WW3 pre/post executables) + sh(script: './build_ww3prepost.sh -w') // build the WW3 pre/post processing executables for GEFS variant + sh(script: './build_ufs.sh -w') // build the UFS-wx-model executable for GEFS variant } catch (Exception error_build) { - echo "Failed to build system: ${error_build.getMessage()}" + echo "Failed to build global-workflow: ${error_build.getMessage()}" if ( fileExists("logs/error.logs") ) { def fileContent = readFile 'logs/error.logs' def lines = fileContent.readLines() @@ -157,24 +156,22 @@ pipeline { echo "Failed to comment on PR: ${error_comment.getMessage()}" } STATUS = 'Failed' - error("Failed to build system on ${Machine}") + error("Failed to build global-workflow on ${Machine}") } } sh(script: './link_workflow.sh') - //sh(script: "echo ${HOMEgfs} > BUILT_semaphor") } } - if (env.CHANGE_ID && system == 'gfs') { + if (env.CHANGE_ID) { try { sh(script: """${GH} pr edit ${env.CHANGE_ID} --repo ${repo_url} --add-label "CI-${Machine}-Running" --remove-label "CI-${Machine}-Building" """) } catch (Exception e) { echo "Failed to update label from Buildng to Running: ${e.getMessage()}" } } - if (system == 'gfs') { - cases = sh(script: "${HOMEgfs}/ci/scripts/utils/get_host_case_list.py ${machine}", returnStdout: true).trim().split() - echo "Cases to run: ${cases}" - } + // Get a list of CI cases to run + CI_CASES = sh(script: "${HOMEgfs}/ci/scripts/utils/get_host_case_list.py ${machine}", returnStdout: true).trim().split() + echo "Cases to run: ${CI_CASES}" } } } @@ -191,21 +188,16 @@ pipeline { agent { label NodeName[machine].toLowerCase() } steps { script { - def parallelStages = cases.collectEntries { caseName -> + def parallelStages = CI_CASES.collectEntries { caseName -> ["${caseName}": { stage("Create ${caseName}") { script { - sh(script: "sed -n '/{.*}/!p' ${CUSTOM_WORKSPACE}/gfs/ci/cases/pr/${caseName}.yaml > ${CUSTOM_WORKSPACE}/gfs/ci/cases/pr/${caseName}.yaml.tmp") - def yaml_case = readYaml file: "${CUSTOM_WORKSPACE}/gfs/ci/cases/pr/${caseName}.yaml.tmp" - def build_system = yaml_case.experiment.system - def HOMEgfs = "${CUSTOM_WORKSPACE}/${build_system}" // local HOMEgfs is used to populate the XML on per system basis - env.HOME_GFS = HOMEgfs // setting path in HOMEgfs as an environment variable HOME_GFS for some systems that using the path in its .bashrc env.RUNTESTS = "${CUSTOM_WORKSPACE}/RUNTESTS" try { error_output = sh(script: "${HOMEgfs}/ci/scripts/utils/ci_utils_wrapper.sh create_experiment ${HOMEgfs}/ci/cases/pr/${caseName}.yaml", returnStdout: true).trim() } catch (Exception error_create) { - sh(script: """${GH} pr comment ${env.CHANGE_ID} --repo ${repo_url} --body "${Case} **FAILED** to create experment on ${Machine} in BUILD# ${env.BUILD_NUMBER}\n with the error:\n\\`\\`\\`\n${error_output}\\`\\`\\`" """) - error("Case ${caseName} failed to create experment directory") + sh(script: """${GH} pr comment ${env.CHANGE_ID} --repo ${repo_url} --body "${Case} **FAILED** to create experiment on ${Machine} in BUILD# ${env.BUILD_NUMBER}\n with the error:\n\\`\\`\\`\n${error_output}\\`\\`\\`" """) + error("Case ${caseName} failed to create experiment directory") } } } @@ -213,15 +205,11 @@ pipeline { stage("Running ${caseName}") { catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') { script { - HOMEgfs = "${CUSTOM_WORKSPACE}/gfs" // common HOMEgfs is used to launch the scripts that run the experiments - env.HOME_GFS = HOMEgfs // setting path in HOMEgfs as an environment variable HOME_GFS for some systems that using the path in its .bashrc def pslot = sh(script: "${HOMEgfs}/ci/scripts/utils/ci_utils_wrapper.sh get_pslot ${CUSTOM_WORKSPACE}/RUNTESTS ${caseName}", returnStdout: true).trim() def error_file = "${CUSTOM_WORKSPACE}/RUNTESTS/${pslot}_error.logs" sh(script: " rm -f ${error_file}") - def yaml_case = readYaml file: "${CUSTOM_WORKSPACE}/gfs/ci/cases/pr/${caseName}.yaml.tmp" - def build_system = yaml_case.experiment.system try { - sh(script: "${HOMEgfs}/ci/scripts/run-check_ci.sh ${CUSTOM_WORKSPACE} ${pslot} ${build_system}") + sh(script: "${HOMEgfs}/ci/scripts/run-check_ci.sh ${CUSTOM_WORKSPACE} ${pslot} 'global-workflow'") sh(script: "${HOMEgfs}/ci/scripts/utils/ci_utils_wrapper.sh cleanup_experiment ${CUSTOM_WORKSPACE}/RUNTESTS/EXPDIR/${pslot}") } catch (Exception error_experment) { sh(script: "${HOMEgfs}/ci/scripts/utils/ci_utils_wrapper.sh cancel_batch_jobs ${pslot}") @@ -251,7 +239,7 @@ pipeline { echo "Failed to comment on PR: ${error_comment.getMessage()}" } } else { - echo "No error logs found for failed cases in $CUSTOM_WORKSPACE/RUNTESTS/${pslot}_error.logs" + echo "No error logs found for failed cases in ${CUSTOM_WORKSPACE}/RUNTESTS/${pslot}_error.logs" } STATUS = 'Failed' try { @@ -273,11 +261,10 @@ pipeline { } } - stage( '5. FINALIZE' ) { + stage( '5. Finalize' ) { agent { label NodeName[machine].toLowerCase() } steps { script { - env.HOME_GFS = "${CUSTOM_WORKSPACE}/gfs" // setting path to HOMEgfs as an environment variable HOME_GFS for some systems that using the path in its .bashrc sh(script: """ labels=\$(${GH} pr view ${env.CHANGE_ID} --repo ${repo_url} --json labels --jq '.labels[].name') for label in \$labels; do @@ -298,7 +285,7 @@ pipeline { echo "Failed to remove custom work directory ${CUSTOM_WORKSPACE} on ${Machine}: ${e.getMessage()}" } } else { - echo "Failed to build and run Global-workflow in ${CUSTOM_WORKSPACE} and on ${Machine}" + echo "Failed to build and run global-workflow in ${CUSTOM_WORKSPACE} on ${Machine}" } } } diff --git a/ci/cases/yamls/build.yaml b/ci/cases/yamls/build.yaml deleted file mode 100644 index 2b2938719f1..00000000000 --- a/ci/cases/yamls/build.yaml +++ /dev/null @@ -1,3 +0,0 @@ -builds: - - gefs: './build_all.sh -kw' - - gfs: './build_all.sh -kgu' diff --git a/ci/scripts/utils/ci_utils_wrapper.sh b/ci/scripts/utils/ci_utils_wrapper.sh index 51c392fb992..a4fd1776c83 100755 --- a/ci/scripts/utils/ci_utils_wrapper.sh +++ b/ci/scripts/utils/ci_utils_wrapper.sh @@ -3,7 +3,7 @@ HOMEgfs="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../.." >/dev/null 2>&1 && pwd )" source "${HOMEgfs}/ush/detect_machine.sh" -utitilty_function="${1}" +utility_function="${1}" source "${HOMEgfs}/ci/scripts/utils/ci_utils.sh" -${utitilty_function} "${@:2}" +${utility_function} "${@:2}" From 080186ad12f280a7da189909ecb6441e44141be0 Mon Sep 17 00:00:00 2001 From: Rahul Mahajan Date: Fri, 6 Dec 2024 13:58:58 -0500 Subject: [PATCH 11/30] remove build matrix from Jenkinsfile --- ci/Jenkinsfile | 144 +++++++++++++++++++++++-------------------------- 1 file changed, 66 insertions(+), 78 deletions(-) diff --git a/ci/Jenkinsfile b/ci/Jenkinsfile index 092d5dc5359..c3f2197e060 100644 --- a/ci/Jenkinsfile +++ b/ci/Jenkinsfile @@ -4,7 +4,7 @@ def CUSTOM_WORKSPACE = 'none' def HOMEgfs = 'none' def CI_CASES = '' def GH = 'none' -// Location of the custom workspaces for each machine in the CI system. They are persitent for each iteration of the PR. +// Location of the custom workspaces for each machine in the CI system. They are persistent for each iteration of the PR. def NodeName = [hera: 'Hera-EMC', orion: 'Orion-EMC', hercules: 'Hercules-EMC', gaea: 'Gaea'] def custom_workspace = [hera: '/scratch1/NCEPDEV/global/CI', orion: '/work2/noaa/stmp/CI/ORION', hercules: '/work2/noaa/global/CI/HERCULES', gaea: '/gpfs/f5/epic/proj-shared/global/CI'] def repo_url = 'git@github.com:NOAA-EMC/global-workflow.git' @@ -91,90 +91,78 @@ pipeline { } stage('3. Build System') { - matrix { - agent { label NodeName[machine].toLowerCase() } - axes { - axis { - name 'system' - values 'gfs' - } - } - stages { - stage('Building') { - steps { - catchError(buildResult: 'UNSTABLE', stageResult: 'FAILURE') { - script { - HOMEgfs = "${CUSTOM_WORKSPACE}/global-workflow" - sh(script: "mkdir -p ${HOMEgfs}") - ws(HOMEgfs) { - if (fileExists("${HOMEgfs}/sorc/BUILT_semaphor")) { // if the system is already built, skip the build in the case of re-runs - sh(script: "cat ${HOMEgfs}/sorc/BUILT_semaphor", returnStdout: true).trim() // TODO: and user configurable control to manage build semphore - checkout scm - dir('sorc') { - sh(script: './link_workflow.sh') - } - } else { - try { - echo "Checking out the code on ${Machine} using scm in ${HOMEgfs}" - checkout scm - } catch (Exception e) { - if (env.CHANGE_ID) { - sh(script: """${GH} pr comment ${env.CHANGE_ID} --repo ${repo_url} --body "Checkout **Failed** on ${Machine} in Build# ${env.BUILD_NUMBER}: ${e.getMessage()}" """) - } - STATUS = 'Failed' - error("Failed to checkout: ${e.getMessage()}") - } - def gist_url = "" - def error_logs = "" - def error_logs_message = "" - dir("${HOMEgfs}/sorc") { - try { - sh(script: './build_all.sh -kgu') // build the global-workflow executables for GFS variant (UFS-wx-model, WW3 pre/post executables) - sh(script: './build_ww3prepost.sh -w') // build the WW3 pre/post processing executables for GEFS variant - sh(script: './build_ufs.sh -w') // build the UFS-wx-model executable for GEFS variant - } catch (Exception error_build) { - echo "Failed to build global-workflow: ${error_build.getMessage()}" - if ( fileExists("logs/error.logs") ) { - def fileContent = readFile 'logs/error.logs' - def lines = fileContent.readLines() - for (line in lines) { - echo "archiving: ${line}" - if (fileExists("${line}") && readFile("${line}").length() > 0 ){ - try { - archiveArtifacts artifacts: "${line}", fingerprint: true - error_logs = error_logs + "${HOMEgfs}/sorc/${line} " - error_logs_message = error_logs_message + "${HOMEgfs}/sorc/${line}\n" - } - catch (Exception error_arch) { echo "Failed to archive error log ${line}: ${error_arch.getMessage()}" } - } - } + agent { label NodeName[machine].toLowerCase() } + steps { + catchError(buildResult: 'UNSTABLE', stageResult: 'FAILURE') { + script { + HOMEgfs = "${CUSTOM_WORKSPACE}/global-workflow" + sh(script: "mkdir -p ${HOMEgfs}") + ws(HOMEgfs) { + if (fileExists("${HOMEgfs}/sorc/BUILT_semaphor")) { // if the system is already built, skip the build in the case of re-runs + sh(script: "cat ${HOMEgfs}/sorc/BUILT_semaphor", returnStdout: true).trim() // TODO: and user configurable control to manage build semphore + checkout scm + dir('sorc') { + sh(script: './link_workflow.sh') + } + } else { + try { + echo "Checking out the code on ${Machine} using scm in ${HOMEgfs}" + checkout scm + } catch (Exception e) { + if (env.CHANGE_ID) { + sh(script: """${GH} pr comment ${env.CHANGE_ID} --repo ${repo_url} --body "Checkout **Failed** on ${Machine} in Build# ${env.BUILD_NUMBER}: ${e.getMessage()}" """) + } + STATUS = 'Failed' + error("Failed to checkout: ${e.getMessage()}") + } + def gist_url = "" + def error_logs = "" + def error_logs_message = "" + dir("${HOMEgfs}/sorc") { + try { + sh(script: './build_all.sh -kgu') // build the global-workflow executables for GFS variant (UFS-wx-model, WW3 pre/post executables) + sh(script: './build_ww3prepost.sh -w') // build the WW3 pre/post processing executables for GEFS variant + sh(script: './build_ufs.sh -w') // build the UFS-wx-model executable for GEFS variant + } catch (Exception error_build) { + echo "Failed to build global-workflow: ${error_build.getMessage()}" + if ( fileExists("logs/error.logs") ) { + def fileContent = readFile 'logs/error.logs' + def lines = fileContent.readLines() + for (line in lines) { + echo "archiving: ${line}" + if (fileExists("${line}") && readFile("${line}").length() > 0 ){ try { - sh(script: "${HOMEgfs}/ci/scripts/utils/publish_logs.py --file ${error_logs} --repo PR_BUILD_${env.CHANGE_ID}") - gist_url=sh(script: "${HOMEgfs}/ci/scripts/utils/publish_logs.py --file ${error_logs} --gist PR_BUILD_${env.CHANGE_ID}", returnStdout: true).trim() - sh(script: """${GH} pr comment ${env.CHANGE_ID} --repo ${repo_url} --body "Build **FAILED** on **${Machine}** in Build# ${env.BUILD_NUMBER} with error logs:\n\\`\\`\\`\n${error_logs_message}\\`\\`\\`\n\nFollow link here to view the contents of the above file(s): [(link)](${gist_url})" """) - } catch (Exception error_comment) { - echo "Failed to comment on PR: ${error_comment.getMessage()}" + archiveArtifacts artifacts: "${line}", fingerprint: true + error_logs = error_logs + "${HOMEgfs}/sorc/${line} " + error_logs_message = error_logs_message + "${HOMEgfs}/sorc/${line}\n" } - STATUS = 'Failed' - error("Failed to build global-workflow on ${Machine}") + catch (Exception error_arch) { echo "Failed to archive error log ${line}: ${error_arch.getMessage()}" } } } - sh(script: './link_workflow.sh') - } - } - if (env.CHANGE_ID) { - try { - sh(script: """${GH} pr edit ${env.CHANGE_ID} --repo ${repo_url} --add-label "CI-${Machine}-Running" --remove-label "CI-${Machine}-Building" """) - } catch (Exception e) { - echo "Failed to update label from Buildng to Running: ${e.getMessage()}" + try { + sh(script: "${HOMEgfs}/ci/scripts/utils/publish_logs.py --file ${error_logs} --repo PR_BUILD_${env.CHANGE_ID}") + gist_url=sh(script: "${HOMEgfs}/ci/scripts/utils/publish_logs.py --file ${error_logs} --gist PR_BUILD_${env.CHANGE_ID}", returnStdout: true).trim() + sh(script: """${GH} pr comment ${env.CHANGE_ID} --repo ${repo_url} --body "Build **FAILED** on **${Machine}** in Build# ${env.BUILD_NUMBER} with error logs:\n\\`\\`\\`\n${error_logs_message}\\`\\`\\`\n\nFollow link here to view the contents of the above file(s): [(link)](${gist_url})" """) + } catch (Exception error_comment) { + echo "Failed to comment on PR: ${error_comment.getMessage()}" + } + STATUS = 'Failed' + error("Failed to build global-workflow on ${Machine}") } } - // Get a list of CI cases to run - CI_CASES = sh(script: "${HOMEgfs}/ci/scripts/utils/get_host_case_list.py ${machine}", returnStdout: true).trim().split() - echo "Cases to run: ${CI_CASES}" - } + sh(script: './link_workflow.sh') + } + } + if (env.CHANGE_ID) { + try { + sh(script: """${GH} pr edit ${env.CHANGE_ID} --repo ${repo_url} --add-label "CI-${Machine}-Running" --remove-label "CI-${Machine}-Building" """) + } catch (Exception e) { + echo "Failed to update label from Building to Running: ${e.getMessage()}" + } } - } + // Get a list of CI cases to run + CI_CASES = sh(script: "${HOMEgfs}/ci/scripts/utils/get_host_case_list.py ${machine}", returnStdout: true).trim().split() + echo "Cases to run: ${CI_CASES}" } } } From f8e3d6ada689c809302fe8f4f910cb45a7bb934f Mon Sep 17 00:00:00 2001 From: Rahul Mahajan Date: Fri, 6 Dec 2024 14:10:18 -0500 Subject: [PATCH 12/30] fix shellnorm found issue --- sorc/build_ww3prepost.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sorc/build_ww3prepost.sh b/sorc/build_ww3prepost.sh index 71add2bd7bf..28f32616087 100755 --- a/sorc/build_ww3prepost.sh +++ b/sorc/build_ww3prepost.sh @@ -1,7 +1,7 @@ #! /usr/bin/env bash set -x -readonly _HOMEgfs=$(cd "$(dirname "$(readlink -f -n "${BASH_SOURCE[0]}")")/.." && pwd -P) +_HOMEgfs=$(cd "$(dirname "$(readlink -f -n "${BASH_SOURCE[0]}" )" )/.." && pwd -P) cd "${_HOMEgfs}/sorc" || exit 1 # Default settings From fc41b6d4c94efddd7f89883bcf88d6ef240afed7 Mon Sep 17 00:00:00 2001 From: Rahul Mahajan Date: Fri, 6 Dec 2024 14:14:01 -0500 Subject: [PATCH 13/30] fix shellnorm found issue by disabling it --- sorc/build_ww3prepost.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/sorc/build_ww3prepost.sh b/sorc/build_ww3prepost.sh index 28f32616087..69499d4c580 100755 --- a/sorc/build_ww3prepost.sh +++ b/sorc/build_ww3prepost.sh @@ -1,6 +1,7 @@ #! /usr/bin/env bash set -x +# shellcheck disable=SC2312 _HOMEgfs=$(cd "$(dirname "$(readlink -f -n "${BASH_SOURCE[0]}" )" )/.." && pwd -P) cd "${_HOMEgfs}/sorc" || exit 1 From c61ff88bc68f17370edb289060296735ea538bca Mon Sep 17 00:00:00 2001 From: Rahul Mahajan Date: Fri, 6 Dec 2024 14:17:25 -0500 Subject: [PATCH 14/30] fix not changed shellcheck detected error --- ush/wave_outp_spec.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ush/wave_outp_spec.sh b/ush/wave_outp_spec.sh index ae818171ca0..9561250f962 100755 --- a/ush/wave_outp_spec.sh +++ b/ush/wave_outp_spec.sh @@ -219,7 +219,7 @@ source "${USHgfs}/preamble.sh" set +x echo ' ' echo '***************************************************************** ' - echo '*** FATAL ERROR : OUTPUT DATA FILE FOR BOUY $bouy NOT FOUND *** ' + echo "*** FATAL ERROR : OUTPUT DATA FILE FOR BOUY ${bouy} NOT FOUND *** " echo '***************************************************************** ' echo ' ' set_trace From 200d6bdcdc378773fefa1ac5c13aacde4f7379a8 Mon Sep 17 00:00:00 2001 From: Rahul Mahajan Date: Fri, 6 Dec 2024 15:11:22 -0500 Subject: [PATCH 15/30] add comment back in ww3prepost build script --- sorc/build_ww3prepost.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/sorc/build_ww3prepost.sh b/sorc/build_ww3prepost.sh index 69499d4c580..7b3537db84b 100755 --- a/sorc/build_ww3prepost.sh +++ b/sorc/build_ww3prepost.sh @@ -54,6 +54,7 @@ export SWITCHFILE="${WW3_DIR}/${ww3switch}" [[ -d "${path_build}" ]] && rm -rf "${path_build}" mkdir -p "${path_build}" || exit 1 cd "${path_build}" || exit 1 +echo "Forcing a SHRD build" buildswitch="${path_build}/switch" From 37d1fb943f9206002820814dadb51d83ab1211fa Mon Sep 17 00:00:00 2001 From: Rahul Mahajan Date: Mon, 9 Dec 2024 12:48:31 -0500 Subject: [PATCH 16/30] Update ush/wave_grid_interp_sbs.sh fix for wht_OK --- ush/wave_grid_interp_sbs.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ush/wave_grid_interp_sbs.sh b/ush/wave_grid_interp_sbs.sh index 190dff221b5..25a446385ae 100755 --- a/ush/wave_grid_interp_sbs.sh +++ b/ush/wave_grid_interp_sbs.sh @@ -144,7 +144,7 @@ source "${USHgfs}/preamble.sh" export err=$?;err_chk # Write interpolation file to main TEMP dir area if not there yet - if [ "wht_OK" = 'no' ] # FIXME: This is never going to evaluate to true, wht_OK is a string and needs to be ${wht_OK} + if [ "${wht_OK}" = 'no' ] then cp -f ./WHTGRIDINT.bin ${DATA}/ww3_gint.WHTGRIDINT.bin.${grdID} cp -f ./WHTGRIDINT.bin ${FIXgfs}/wave/ww3_gint.WHTGRIDINT.bin.${grdID} From ab66442f1f9d5f6ec9a70e07e5fb359803728206 Mon Sep 17 00:00:00 2001 From: Rahul Mahajan Date: Tue, 10 Dec 2024 12:41:08 -0500 Subject: [PATCH 17/30] Update sorc/link_workflow.sh Co-authored-by: Walter Kolczynski - NOAA --- sorc/link_workflow.sh | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/sorc/link_workflow.sh b/sorc/link_workflow.sh index 5740f6d65c5..7c894ef298d 100755 --- a/sorc/link_workflow.sh +++ b/sorc/link_workflow.sh @@ -292,12 +292,16 @@ for utilexe in fbwndgfs.x gaussian_sfcanl.x gfs_bufr.x supvit.x syndat_getjtbul. ${LINK_OR_COPY} "${HOMEgfs}/sorc/gfs_utils.fd/install/bin/${utilexe}" . done -[[ -s "gfs_model.x" ]] && rm -f gfs_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 -[[ -s "gefs_model.x" ]] && rm -f gefs_model.x -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 -[[ -s "sfs_model.x" ]] && rm -f sfs_model.x -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 +declare -a model_systems=("gfs" "gefs" "sfs") +for sys in "${model_systems[@]}"; do + model_exe="${sys}_model.x" + if [[ -s "${model_exe}" ]]; then + rm -f "${model_exe}" + fi + if [[ -f "${HOMEgfs}/sorc/ufs_model.fd/tests/${model_exe}" ]]; then + ${LINK_OR_COPY} "${HOMEgfs}/sorc/ufs_model.fd/tests/${model_exe}" "${model_exe}" + fi +done # WW3 pre/post executables declare -a ww3_exes=("ww3_grid" "ww3_prep" "ww3_prnc" "ww3_outp" "ww3_outf" "ww3_gint" "ww3_ounf" "ww3_ounp" "ww3_grib") From dae774ab0fc401b0a9d664e0c907db41b9e3056e Mon Sep 17 00:00:00 2001 From: Rahul Mahajan Date: Tue, 10 Dec 2024 12:41:55 -0500 Subject: [PATCH 18/30] Update ush/wave_grid_interp_sbs.sh Co-authored-by: Walter Kolczynski - NOAA --- ush/wave_grid_interp_sbs.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ush/wave_grid_interp_sbs.sh b/ush/wave_grid_interp_sbs.sh index 25a446385ae..5420d405c8f 100755 --- a/ush/wave_grid_interp_sbs.sh +++ b/ush/wave_grid_interp_sbs.sh @@ -134,7 +134,7 @@ source "${USHgfs}/preamble.sh" # 1.b Run interpolation code export pgm="${NET,,}_ww3_gint.x" - . prep_step + source prep_step set +x echo " Executing ${pgm}" From 1d47c9eb11e7feb70f7805893c6acec5df50527f Mon Sep 17 00:00:00 2001 From: Rahul Mahajan Date: Tue, 10 Dec 2024 12:42:02 -0500 Subject: [PATCH 19/30] Update ush/wave_prnc_cur.sh Co-authored-by: Walter Kolczynski - NOAA --- ush/wave_prnc_cur.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ush/wave_prnc_cur.sh b/ush/wave_prnc_cur.sh index b084b8dcacc..cfd499330f0 100755 --- a/ush/wave_prnc_cur.sh +++ b/ush/wave_prnc_cur.sh @@ -75,7 +75,7 @@ ${NLN} "cur_glo_uv_${PDY}_${fext}${fh3}_5min.nc" "cur.nc" ${NLN} "${DATA}/mod_def.${WAVECUR_FID}" ./mod_def.ww3 export pgm="${NET,,}_ww3_prnc.x" -. prep_step +source prep_step "${EXECgfs}/${pgm}" 1> prnc_${WAVECUR_FID}_${ymdh_rtofs}.out 2>&1 export err=$?; err_chk From b136b8a8c7d1b853581b799823823408ed37aaf5 Mon Sep 17 00:00:00 2001 From: Rahul Mahajan Date: Tue, 10 Dec 2024 12:42:11 -0500 Subject: [PATCH 20/30] Update ush/wave_prnc_ice.sh Co-authored-by: Walter Kolczynski - NOAA --- ush/wave_prnc_ice.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ush/wave_prnc_ice.sh b/ush/wave_prnc_ice.sh index 890df71973e..d812bccd104 100755 --- a/ush/wave_prnc_ice.sh +++ b/ush/wave_prnc_ice.sh @@ -143,7 +143,7 @@ source "${USHgfs}/preamble.sh" cp -f ${DATA}/ww3_prnc.ice.$WAVEICE_FID.inp.tmpl ww3_prnc.inp export pgm="${NET,,}_ww3_prnc.x" - . prep_step + source prep_step "${EXECgfs}/${pgm}" 1> prnc_${WAVEICE_FID}_${cycle}.out 2>&1 export err=$?; err_chk From ebf617653c830afec917fefaaea5a67c0e6c3c8e Mon Sep 17 00:00:00 2001 From: Rahul Mahajan Date: Tue, 10 Dec 2024 12:43:07 -0500 Subject: [PATCH 21/30] Update scripts/exgfs_wave_post_pnt.sh Co-authored-by: Walter Kolczynski - NOAA --- scripts/exgfs_wave_post_pnt.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/exgfs_wave_post_pnt.sh b/scripts/exgfs_wave_post_pnt.sh index 9b408520924..96c60fc96c0 100755 --- a/scripts/exgfs_wave_post_pnt.sh +++ b/scripts/exgfs_wave_post_pnt.sh @@ -273,7 +273,7 @@ source "${USHgfs}/preamble.sh" ${NLN} ./mod_def.${waveuoutpGRD} ./mod_def.ww3 export pgm="${NET,,}_ww3_outp.x" - . prep_step + source prep_step "${EXECgfs}/${pgm}" > buoy_lst.loc 2>&1 export err=$?;err_chk From 93ad4bf93e6dec66ffcf867e40b25fb64e5fbafe Mon Sep 17 00:00:00 2001 From: Rahul Mahajan Date: Tue, 10 Dec 2024 12:43:14 -0500 Subject: [PATCH 22/30] Update ush/wave_outp_spec.sh Co-authored-by: Walter Kolczynski - NOAA --- ush/wave_outp_spec.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ush/wave_outp_spec.sh b/ush/wave_outp_spec.sh index 9561250f962..929979bbf9f 100755 --- a/ush/wave_outp_spec.sh +++ b/ush/wave_outp_spec.sh @@ -162,7 +162,7 @@ source "${USHgfs}/preamble.sh" # 2.b Run the postprocessor export pgm="${NET,,}_ww3_outp.x" - . prep_step + source prep_step set +x echo " Executing ${EXECgfs}/${pgm}" From b5ede8bac175441aaad0bc93897194f08600d277 Mon Sep 17 00:00:00 2001 From: Rahul Mahajan Date: Wed, 11 Dec 2024 09:40:07 -0500 Subject: [PATCH 23/30] capture stdout/stderr from Jenkinsbuild for gefs variants. Also, was missing the name of the GEFS variant model executable that caused the gefs test to fail --- ci/Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ci/Jenkinsfile b/ci/Jenkinsfile index c3f2197e060..a6fd9ed9069 100644 --- a/ci/Jenkinsfile +++ b/ci/Jenkinsfile @@ -121,8 +121,8 @@ pipeline { dir("${HOMEgfs}/sorc") { try { sh(script: './build_all.sh -kgu') // build the global-workflow executables for GFS variant (UFS-wx-model, WW3 pre/post executables) - sh(script: './build_ww3prepost.sh -w') // build the WW3 pre/post processing executables for GEFS variant - sh(script: './build_ufs.sh -w') // build the UFS-wx-model executable for GEFS variant + sh(script: './build_ww3prepost.sh -w > ./logs/build_ww3prepost_gefs.log 2>&1') // build the WW3 pre/post processing executables for GEFS variant + sh(script: './build_ufs.sh -w -e gefs_model.x > ./logs/build_ufs_gefs.log 2>&1') // build the UFS-wx-model executable for GEFS variant } catch (Exception error_build) { echo "Failed to build global-workflow: ${error_build.getMessage()}" if ( fileExists("logs/error.logs") ) { From 4531678e1ec55a11a451482a25cb862e84b206aa Mon Sep 17 00:00:00 2001 From: Rahul Mahajan Date: Wed, 11 Dec 2024 15:10:56 -0500 Subject: [PATCH 24/30] Update sorc/link_workflow.sh Co-authored-by: Walter Kolczynski - NOAA --- sorc/link_workflow.sh | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/sorc/link_workflow.sh b/sorc/link_workflow.sh index 7c894ef298d..fb76d66d303 100755 --- a/sorc/link_workflow.sh +++ b/sorc/link_workflow.sh @@ -306,19 +306,23 @@ done # WW3 pre/post executables declare -a ww3_exes=("ww3_grid" "ww3_prep" "ww3_prnc" "ww3_outp" "ww3_outf" "ww3_gint" "ww3_ounf" "ww3_ounp" "ww3_grib") # TODO: ww3_prep, ww3_outf, ww3_ounf, ww3_ounp are not used in the workflow # FIXME or remove them from the list -if [[ -d "${HOMEgfs}/sorc/ufs_model.fd/WW3/install/pdlib_OFF" ]]; then # installed with PDLIB=OFF (Used in GEFS) - for ww3exe in "${ww3_exes[@]}"; do - [[ -s "gefs_${ww3exe}.x" ]] && rm -f "gefs_${ww3exe}.x" - ${LINK_OR_COPY} "${HOMEgfs}/sorc/ufs_model.fd/WW3/install/pdlib_OFF/bin/${ww3exe}" "${HOMEgfs}/exec/gefs_${ww3exe}.x" - done -fi - -if [[ -d "${HOMEgfs}/sorc/ufs_model.fd/WW3/install/pdlib_ON" ]]; then # installed with PDLIB=ON (Used in GFS, may be SFS later) - for ww3exe in "${ww3_exes[@]}"; do - [[ -s "gfs_${ww3exe}.x" ]] && rm -f "gfs_${ww3exe}.x" - ${LINK_OR_COPY} "${HOMEgfs}/sorc/ufs_model.fd/WW3/install/pdlib_ON/bin/${ww3exe}" "${HOMEgfs}/exec/gfs_${ww3exe}.x" - done -fi +declare -A wave_systems +wave_systems["gfs"]="pdlib_ON" +wave_systems["gefs"]="pdlib_OFF" +wave_systems["sfs"]="pdlib_OFF" + +for sys in ${!wave_systems[@]}; do + build_loc="${wave_systems[${sys}]}" + if [[ -d "${HOMEgfs}/sorc/ufs_model.fd/WW3/install/${build_loc}" ]]; then + for ww3exe in "${ww3_exes[@]}"; do + target_ww3_exe="${sys}_${ww3exe}.x" + if [[ -s "${target_ww3_exe}" ]]; then + rm -f "${target_ww3_exe}" + fi + ${LINK_OR_COPY} "${HOMEgfs}/sorc/ufs_model.fd/WW3/install/${build_loc}/bin/${ww3exe}.x" "${HOMEgfs}/exec/${target_ww3_exe}" + done + fi +done [[ -s "upp.x" ]] && rm -f upp.x ${LINK_OR_COPY} "${HOMEgfs}/sorc/upp.fd/exec/upp.x" . From 842e71777259c269f70305510e7ec878f77eff77 Mon Sep 17 00:00:00 2001 From: Rahul Mahajan Date: Wed, 11 Dec 2024 15:15:27 -0500 Subject: [PATCH 25/30] Update sorc/build_ufs.sh Co-authored-by: David Huber <69919478+DavidHuber-NOAA@users.noreply.github.com> --- 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 863ca30b65b..773c104be30 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" HYDRO="OFF" -EXEC_NAME="ufs_model.x" +EXEC_NAME="gfs_model.x" while getopts ":da:fj:e:vwy" option; do case "${option}" in From c1e01f8c804302b76e322e4f6fd16718533122f4 Mon Sep 17 00:00:00 2001 From: Rahul Mahajan Date: Wed, 11 Dec 2024 15:16:02 -0500 Subject: [PATCH 26/30] Update sorc/link_workflow.sh Co-authored-by: Walter Kolczynski - NOAA --- sorc/link_workflow.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sorc/link_workflow.sh b/sorc/link_workflow.sh index fb76d66d303..234294b23d5 100755 --- a/sorc/link_workflow.sh +++ b/sorc/link_workflow.sh @@ -311,7 +311,7 @@ wave_systems["gfs"]="pdlib_ON" wave_systems["gefs"]="pdlib_OFF" wave_systems["sfs"]="pdlib_OFF" -for sys in ${!wave_systems[@]}; do +for sys in "${!wave_systems[@]}"; do build_loc="${wave_systems[${sys}]}" if [[ -d "${HOMEgfs}/sorc/ufs_model.fd/WW3/install/${build_loc}" ]]; then for ww3exe in "${ww3_exes[@]}"; do From d3e76a6f6f7c5f6dbf0b21050a355c5f28c10177 Mon Sep 17 00:00:00 2001 From: Rahul Mahajan Date: Wed, 11 Dec 2024 16:48:18 -0500 Subject: [PATCH 27/30] Update sorc/link_workflow.sh Co-authored-by: Walter Kolczynski - NOAA --- sorc/link_workflow.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sorc/link_workflow.sh b/sorc/link_workflow.sh index 234294b23d5..8c1c0658e70 100755 --- a/sorc/link_workflow.sh +++ b/sorc/link_workflow.sh @@ -319,7 +319,7 @@ for sys in "${!wave_systems[@]}"; do if [[ -s "${target_ww3_exe}" ]]; then rm -f "${target_ww3_exe}" fi - ${LINK_OR_COPY} "${HOMEgfs}/sorc/ufs_model.fd/WW3/install/${build_loc}/bin/${ww3exe}.x" "${HOMEgfs}/exec/${target_ww3_exe}" + ${LINK_OR_COPY} "${HOMEgfs}/sorc/ufs_model.fd/WW3/install/${build_loc}/bin/${ww3exe}" "${HOMEgfs}/exec/${target_ww3_exe}" done fi done From be0ca2c33b93701e03677d253d1155037940be93 Mon Sep 17 00:00:00 2001 From: Rahul Mahajan Date: Wed, 11 Dec 2024 17:04:57 -0500 Subject: [PATCH 28/30] since using single build location, GEFS wcoss testing can be enabled --- ci/cases/pr/C48_S2SWA_gefs.yaml | 2 +- ci/cases/pr/C96_S2SWA_gefs_replay_ics.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ci/cases/pr/C48_S2SWA_gefs.yaml b/ci/cases/pr/C48_S2SWA_gefs.yaml index f39031f1a1e..856759b46a6 100644 --- a/ci/cases/pr/C48_S2SWA_gefs.yaml +++ b/ci/cases/pr/C48_S2SWA_gefs.yaml @@ -18,4 +18,4 @@ arguments: yaml: {{ HOMEgfs }}/ci/cases/yamls/gefs_defaults_ci.yaml skip_ci_on_hosts: - - wcoss2 + - None diff --git a/ci/cases/pr/C96_S2SWA_gefs_replay_ics.yaml b/ci/cases/pr/C96_S2SWA_gefs_replay_ics.yaml index 7118dde53fc..b5c27424062 100644 --- a/ci/cases/pr/C96_S2SWA_gefs_replay_ics.yaml +++ b/ci/cases/pr/C96_S2SWA_gefs_replay_ics.yaml @@ -19,4 +19,4 @@ arguments: icsdir: {{ 'ICSDIR_ROOT' | getenv }}/C96mx100/20240610 skip_ci_on_hosts: - - wcoss2 + - None From c37409d842a1d6539e2dbe316f362b3de1d99c85 Mon Sep 17 00:00:00 2001 From: Rahul Mahajan Date: Wed, 11 Dec 2024 17:36:26 -0500 Subject: [PATCH 29/30] update Jenkinsfile to try to do scm checkout if it fails the first time; --- ci/Jenkinsfile | 89 +++++++++++++++++++++++++------------------------- 1 file changed, 44 insertions(+), 45 deletions(-) diff --git a/ci/Jenkinsfile b/ci/Jenkinsfile index a6fd9ed9069..9e2381268dc 100644 --- a/ci/Jenkinsfile +++ b/ci/Jenkinsfile @@ -82,7 +82,9 @@ pipeline { properties([parameters([[$class: 'NodeParameterDefinition', allowedSlaves: ['built-in', 'Hercules-EMC', 'Hera-EMC', 'Orion-EMC', 'Gaea'], defaultSlaves: ['built-in'], name: '', nodeEligibility: [$class: 'AllNodeEligibility'], triggerIfResult: 'allCases']])]) GH = sh(script: "which gh || echo '~/bin/gh'", returnStdout: true).trim() CUSTOM_WORKSPACE = "${WORKSPACE}" - sh(script: "mkdir -p ${CUSTOM_WORKSPACE}/RUNTESTS;rm -Rf ${CUSTOM_WORKSPACE}/RUNTESTS/*") + HOMEgfs = "${CUSTOM_WORKSPACE}/global-workflow" + sh(script: "rm -Rf ${CUSTOM_WORKSPACE}/global-workflow; mkdir -p ${CUSTOM_WORKSPACE}/global-workflow") + sh(script: "rm -Rf ${CUSTOM_WORKSPACE}/RUNTESTS; mkdir -p ${CUSTOM_WORKSPACE}/RUNTESTS") sh(script: """${GH} pr edit ${env.CHANGE_ID} --repo ${repo_url} --add-label "CI-${Machine}-Building" --remove-label "CI-${Machine}-Ready" """) } echo "Building and running on ${Machine} in directory ${CUSTOM_WORKSPACE}" @@ -95,63 +97,60 @@ pipeline { steps { catchError(buildResult: 'UNSTABLE', stageResult: 'FAILURE') { script { - HOMEgfs = "${CUSTOM_WORKSPACE}/global-workflow" - sh(script: "mkdir -p ${HOMEgfs}") ws(HOMEgfs) { - if (fileExists("${HOMEgfs}/sorc/BUILT_semaphor")) { // if the system is already built, skip the build in the case of re-runs - sh(script: "cat ${HOMEgfs}/sorc/BUILT_semaphor", returnStdout: true).trim() // TODO: and user configurable control to manage build semphore + echo "Checking out the code on ${Machine} using scm in ${HOMEgfs}" + try { checkout scm - dir('sorc') { - sh(script: './link_workflow.sh') - } - } else { + } catch (Exception e) { + echo "Failed to checkout the code on ${Machine} using scm in ${HOMEgfs}, try again ..." + sleep time: 45, unit: 'SECONDS' try { - echo "Checking out the code on ${Machine} using scm in ${HOMEgfs}" checkout scm - } catch (Exception e) { + } catch (Exception ee) { + echo "Failed to checkout the code on ${Machine} using scm in ${HOMEgfs}: ${ee.getMessage()}" if (env.CHANGE_ID) { - sh(script: """${GH} pr comment ${env.CHANGE_ID} --repo ${repo_url} --body "Checkout **Failed** on ${Machine} in Build# ${env.BUILD_NUMBER}: ${e.getMessage()}" """) + sh(script: """${GH} pr comment ${env.CHANGE_ID} --repo ${repo_url} --body "Checkout **Failed** on ${Machine} in Build# ${env.BUILD_NUMBER}: ${ee.getMessage()}" """) } STATUS = 'Failed' - error("Failed to checkout: ${e.getMessage()}") + error("Failed to checkout: ${ee.getMessage()}") } - def gist_url = "" - def error_logs = "" - def error_logs_message = "" - dir("${HOMEgfs}/sorc") { - try { - sh(script: './build_all.sh -kgu') // build the global-workflow executables for GFS variant (UFS-wx-model, WW3 pre/post executables) - sh(script: './build_ww3prepost.sh -w > ./logs/build_ww3prepost_gefs.log 2>&1') // build the WW3 pre/post processing executables for GEFS variant - sh(script: './build_ufs.sh -w -e gefs_model.x > ./logs/build_ufs_gefs.log 2>&1') // build the UFS-wx-model executable for GEFS variant - } catch (Exception error_build) { - echo "Failed to build global-workflow: ${error_build.getMessage()}" - if ( fileExists("logs/error.logs") ) { - def fileContent = readFile 'logs/error.logs' - def lines = fileContent.readLines() - for (line in lines) { - echo "archiving: ${line}" - if (fileExists("${line}") && readFile("${line}").length() > 0 ){ - try { - archiveArtifacts artifacts: "${line}", fingerprint: true - error_logs = error_logs + "${HOMEgfs}/sorc/${line} " - error_logs_message = error_logs_message + "${HOMEgfs}/sorc/${line}\n" - } - catch (Exception error_arch) { echo "Failed to archive error log ${line}: ${error_arch.getMessage()}" } + } + def gist_url = "" + def error_logs = "" + def error_logs_message = "" + dir("${HOMEgfs}/sorc") { + try { + sh(script: './build_all.sh -kgu') // build the global-workflow executables for GFS variant (UFS-wx-model, WW3 pre/post executables) + sh(script: './build_ww3prepost.sh -w > ./logs/build_ww3prepost_gefs.log 2>&1') // build the WW3 pre/post processing executables for GEFS variant + sh(script: './build_ufs.sh -w -e gefs_model.x > ./logs/build_ufs_gefs.log 2>&1') // build the UFS-wx-model executable for GEFS variant + } catch (Exception error_build) { + echo "Failed to build global-workflow: ${error_build.getMessage()}" + if ( fileExists("logs/error.logs") ) { + def fileContent = readFile 'logs/error.logs' + def lines = fileContent.readLines() + for (line in lines) { + echo "archiving: ${line}" + if (fileExists("${line}") && readFile("${line}").length() > 0 ){ + try { + archiveArtifacts artifacts: "${line}", fingerprint: true + error_logs = error_logs + "${HOMEgfs}/sorc/${line} " + error_logs_message = error_logs_message + "${HOMEgfs}/sorc/${line}\n" } + catch (Exception error_arch) { echo "Failed to archive error log ${line}: ${error_arch.getMessage()}" } } - try { - sh(script: "${HOMEgfs}/ci/scripts/utils/publish_logs.py --file ${error_logs} --repo PR_BUILD_${env.CHANGE_ID}") - gist_url=sh(script: "${HOMEgfs}/ci/scripts/utils/publish_logs.py --file ${error_logs} --gist PR_BUILD_${env.CHANGE_ID}", returnStdout: true).trim() - sh(script: """${GH} pr comment ${env.CHANGE_ID} --repo ${repo_url} --body "Build **FAILED** on **${Machine}** in Build# ${env.BUILD_NUMBER} with error logs:\n\\`\\`\\`\n${error_logs_message}\\`\\`\\`\n\nFollow link here to view the contents of the above file(s): [(link)](${gist_url})" """) - } catch (Exception error_comment) { - echo "Failed to comment on PR: ${error_comment.getMessage()}" - } - STATUS = 'Failed' - error("Failed to build global-workflow on ${Machine}") } + try { + sh(script: "${HOMEgfs}/ci/scripts/utils/publish_logs.py --file ${error_logs} --repo PR_BUILD_${env.CHANGE_ID}") + gist_url=sh(script: "${HOMEgfs}/ci/scripts/utils/publish_logs.py --file ${error_logs} --gist PR_BUILD_${env.CHANGE_ID}", returnStdout: true).trim() + sh(script: """${GH} pr comment ${env.CHANGE_ID} --repo ${repo_url} --body "Build **FAILED** on **${Machine}** in Build# ${env.BUILD_NUMBER} with error logs:\n\\`\\`\\`\n${error_logs_message}\\`\\`\\`\n\nFollow link here to view the contents of the above file(s): [(link)](${gist_url})" """) + } catch (Exception error_comment) { + echo "Failed to comment on PR: ${error_comment.getMessage()}" + } + STATUS = 'Failed' + error("Failed to build global-workflow on ${Machine}") } - sh(script: './link_workflow.sh') } + sh(script: './link_workflow.sh') } if (env.CHANGE_ID) { try { From 50794488eb20d039d4f5c42df006ac4034be9e60 Mon Sep 17 00:00:00 2001 From: Rahul Mahajan Date: Thu, 12 Dec 2024 09:42:07 -0500 Subject: [PATCH 30/30] undo the fix and reintroduce the incorrect logic. Fixing the bug opens another bug that needs evaluation on the purpose of the logic. A FIXME tag has been added --- ush/wave_grid_interp_sbs.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ush/wave_grid_interp_sbs.sh b/ush/wave_grid_interp_sbs.sh index 5420d405c8f..d56c5d07633 100755 --- a/ush/wave_grid_interp_sbs.sh +++ b/ush/wave_grid_interp_sbs.sh @@ -144,7 +144,7 @@ source "${USHgfs}/preamble.sh" export err=$?;err_chk # Write interpolation file to main TEMP dir area if not there yet - if [ "${wht_OK}" = 'no' ] + if [ "wht_OK" = 'no' ] # FIXME: This is never going to evaluate to true, wht_OK is a string and needs to be ${wht_OK}. With ${wht_OK}, the next line is trying to copy into ${FIXgfs} space. This leads to a Permission denied error. The logic here needs to be evaluated and recoded. #TODO then cp -f ./WHTGRIDINT.bin ${DATA}/ww3_gint.WHTGRIDINT.bin.${grdID} cp -f ./WHTGRIDINT.bin ${FIXgfs}/wave/ww3_gint.WHTGRIDINT.bin.${grdID}