From f516b9c92c9f7c7c0ff40436abdc927e6350c727 Mon Sep 17 00:00:00 2001 From: Rahul Mahajan Date: Wed, 13 Jul 2022 17:54:26 -0400 Subject: [PATCH 1/8] ncdiag is a module. load it. locate ncdiag_cat_serial.x --- .gitignore | 2 -- modulefiles/gsi_monitor.hera.lua | 16 ---------------- modulefiles/gsi_monitor.orion.lua | 16 ---------------- modulefiles/gsi_monitor.wcoss_dell_p3.lua | 16 ---------------- modulefiles/module_base.hera.lua | 1 + modulefiles/module_base.orion.lua | 1 + modulefiles/module_base.wcoss_dell_p3.lua | 0 parm/config/config.analdiag | 1 + scripts/exglobal_diag.sh | 2 +- sorc/build_gsi_monitor.sh | 12 ------------ sorc/checkout.sh | 6 +++--- sorc/link_workflow.sh | 3 +-- 12 files changed, 8 insertions(+), 68 deletions(-) delete mode 100644 modulefiles/gsi_monitor.hera.lua delete mode 100644 modulefiles/gsi_monitor.orion.lua delete mode 100644 modulefiles/gsi_monitor.wcoss_dell_p3.lua mode change 100755 => 100644 modulefiles/module_base.orion.lua mode change 100755 => 100644 modulefiles/module_base.wcoss_dell_p3.lua diff --git a/.gitignore b/.gitignore index 1d1a1125fc..ec3b63bd0c 100644 --- a/.gitignore +++ b/.gitignore @@ -78,8 +78,6 @@ sorc/gfs_post.fd sorc/gfs_wafs.fd sorc/gldas.fd sorc/gsi_enkf.fd -# TODO - remove ncdiag.fd once it is a module on the systems -sorc/ncdiag.fd sorc/gsi.fd sorc/enkf.fd sorc/gsi_utils.fd diff --git a/modulefiles/gsi_monitor.hera.lua b/modulefiles/gsi_monitor.hera.lua deleted file mode 100644 index ebd52c4477..0000000000 --- a/modulefiles/gsi_monitor.hera.lua +++ /dev/null @@ -1,16 +0,0 @@ -help([[ -Build environment for GSI monitor on Hera -]]) - -prepend_path("MODULEPATH", "/scratch2/NCEPDEV/nwprod/hpc-stack/libs/hpc-stack/modulefiles/stack") - -load(pathJoin("hpc", "1.1.0")) -load(pathJoin("hpc-intel", "18.0.5.274")) -load(pathJoin("hpc-impi", "2018.0.4")) - -load(pathJoin("cmake", "3.20.1")) - -load(pathJoin("hdf5", "1.10.6")) -load(pathJoin("netcdf", "4.7.4")) - -load(pathJoin("w3emc", "2.9.1")) diff --git a/modulefiles/gsi_monitor.orion.lua b/modulefiles/gsi_monitor.orion.lua deleted file mode 100644 index a014626132..0000000000 --- a/modulefiles/gsi_monitor.orion.lua +++ /dev/null @@ -1,16 +0,0 @@ -help([[ -Build environment for GSI monitor on Orion -]]) - -prepend_path("MODULEPATH", "/apps/contrib/NCEP/libs/hpc-stack/modulefiles/stack") - -load(pathJoin("hpc", "1.1.0")) -load(pathJoin("hpc-intel", "2018.4")) -load(pathJoin("hpc-impi", "2018.4")) - -load(pathJoin("cmake", "3.22.1")) - -load(pathJoin("hdf5", "1.10.6")) -load(pathJoin("netcdf", "4.7.4")) - -load(pathJoin("w3emc", "2.9.1")) diff --git a/modulefiles/gsi_monitor.wcoss_dell_p3.lua b/modulefiles/gsi_monitor.wcoss_dell_p3.lua deleted file mode 100644 index 7867ea0a06..0000000000 --- a/modulefiles/gsi_monitor.wcoss_dell_p3.lua +++ /dev/null @@ -1,16 +0,0 @@ -help([[ -Build environment for GSI monitor on WCOSS Dell -]]) - -prepend_path("MODULEPATH", "/usrx/local/nceplibs/dev/hpc-stack/libs/hpc-stack/modulefiles/stack") - -load(pathJoin("hpc", "1.1.0")) -load(pathJoin("hpc-ips", "18.0.1.163")) -load(pathJoin("hpc-impi", "18.0.1")) - -load(pathJoin("cmake", "3.20.2")) - -load(pathJoin("hdf5", "1.10.6")) -load(pathJoin("netcdf", "4.7.4")) - -load(pathJoin("w3emc", "2.9.1")) diff --git a/modulefiles/module_base.hera.lua b/modulefiles/module_base.hera.lua index e9fe2088a9..36cb672eb0 100644 --- a/modulefiles/module_base.hera.lua +++ b/modulefiles/module_base.hera.lua @@ -37,6 +37,7 @@ load(pathJoin("nemsio", "2.5.2")) load(pathJoin("sp", "2.3.3")) load(pathJoin("w3emc", "2.7.3")) load(pathJoin("w3nco", "2.4.1")) +load(pathJoin("ncdiag", "1.0.0")) load(pathJoin("wgrib2", "2.0.8")) setenv("WGRIB2","wgrib2") diff --git a/modulefiles/module_base.orion.lua b/modulefiles/module_base.orion.lua old mode 100755 new mode 100644 index 45fa6c07f0..22a4764419 --- a/modulefiles/module_base.orion.lua +++ b/modulefiles/module_base.orion.lua @@ -36,6 +36,7 @@ load(pathJoin("nemsio", "2.5.2")) load(pathJoin("sp", "2.3.3")) load(pathJoin("w3emc", "2.7.3")) load(pathJoin("w3nco", "2.4.1")) +load(pathJoin("ncdiag", "1.0.0")) load(pathJoin("wgrib2", "2.0.8")) setenv("WGRIB2","wgrib2") diff --git a/modulefiles/module_base.wcoss_dell_p3.lua b/modulefiles/module_base.wcoss_dell_p3.lua old mode 100755 new mode 100644 diff --git a/parm/config/config.analdiag b/parm/config/config.analdiag index 285e614d37..7a02ad7cba 100755 --- a/parm/config/config.analdiag +++ b/parm/config/config.analdiag @@ -7,5 +7,6 @@ echo "BEGIN: config.analdiag" # Get task specific resources . $EXPDIR/config.resources analdiag +export CATEXEC=$(which ncdiag_cat_serial.x) echo "END: config.analdiag" diff --git a/scripts/exglobal_diag.sh b/scripts/exglobal_diag.sh index 43832ae388..b0778d2454 100755 --- a/scripts/exglobal_diag.sh +++ b/scripts/exglobal_diag.sh @@ -47,7 +47,7 @@ export NLN=${NLN:-"/bin/ln -sf"} export CHGRP_CMD=${CHGRP_CMD:-"chgrp ${group_name:-rstprod}"} export NEMSIOGET=${NEMSIOGET:-${NWPROD}/exec/nemsio_get} export NCLEN=${NCLEN:-$HOMEgfs/ush/getncdimlen} -export CATEXEC=${CATEXEC:-$HOMEgfs/exec/ncdiag_cat_serial.x} +export CATEXEC=${CATEXEC:-$(which ncdiag_cat_serial.x)} COMPRESS=${COMPRESS:-gzip} UNCOMPRESS=${UNCOMPRESS:-gunzip} APRUNCFP=${APRUNCFP:-""} diff --git a/sorc/build_gsi_monitor.sh b/sorc/build_gsi_monitor.sh index ccc4af80c5..0fa78044d8 100755 --- a/sorc/build_gsi_monitor.sh +++ b/sorc/build_gsi_monitor.sh @@ -21,20 +21,8 @@ while getopts ":dov" option; do done shift $((OPTIND-1)) -GSI_INSTALL_PREFIX="${cwd}/gsi_enkf.fd/install" -if [[ -d "${GSI_INSTALL_PREFIX}" ]]; then - CMAKE_OPTS="-Dncdiag_ROOT=${GSI_INSTALL_PREFIX}" -else - echo << EOF -FATAL: ${GSI_INSTALL_PREFIX} does not exist - Have you built GSI yet? -EOF - exit 2 -fi - BUILD_TYPE=${BUILD_TYPE:-"Release"} \ BUILD_VERBOSE=${BUILD_VERBOSE:-"NO"} \ -CMAKE_OPTS=${CMAKE_OPTS} \ ${cwd}/gsi_monitor.fd/ush/build.sh exit diff --git a/sorc/checkout.sh b/sorc/checkout.sh index 744f484785..9129627f5a 100755 --- a/sorc/checkout.sh +++ b/sorc/checkout.sh @@ -131,9 +131,9 @@ mkdir -p ${logdir} # The checkout version should always be a speciifc commit (hash or tag), not a branch errs=0 checkout "ufs_model.fd" "https://github.com/ufs-community/ufs-weather-model" "${ufs_model_hash:-Prototype-P8c}"; errs=$((errs + $?)) -checkout "gsi_enkf.fd" "https://github.com/NOAA-EMC/GSI.git" "1a3fb13" ; errs=$((errs + $?)) -checkout "gsi_utils.fd" "https://github.com/NOAA-EMC/GSI-Utils.git" "2a15d3b" ; errs=$((errs + $?)) -checkout "gsi_monitor.fd" "https://github.com/NOAA-EMC/GSI-Monitor.git" "e60e56a" ; errs=$((errs + $?)) +checkout "gsi_enkf.fd" "https://github.com/NOAA-EMC/GSI.git" "67f5ab4" ; errs=$((errs + $?)) +checkout "gsi_utils.fd" "https://github.com/NOAA-EMC/GSI-Utils.git" "00c95c4" ; errs=$((errs + $?)) +checkout "gsi_monitor.fd" "https://github.com/NOAA-EMC/GSI-Monitor.git" "acf8870" ; errs=$((errs + $?)) checkout "gldas.fd" "https://github.com/NOAA-EMC/GLDAS.git" "fd8ba62" ; errs=$((errs + $?)) checkout "ufs_utils.fd" "https://github.com/ufs-community/UFS_UTILS.git" "a2b0817" ; errs=$((errs + $?)) checkout "verif-global.fd" "https://github.com/NOAA-EMC/EMC_verif-global.git" "c267780" ; errs=$((errs + $?)) diff --git a/sorc/link_workflow.sh b/sorc/link_workflow.sh index cd3ddb553e..5f1d273226 100755 --- a/sorc/link_workflow.sh +++ b/sorc/link_workflow.sh @@ -229,8 +229,7 @@ for ufs_utilsexe in \ done # GSI -# TODO - remove ncdiag_cat_serial.x when ncdiag becomes a module -for exe in ncdiag_cat_serial.x enkf.x gsi.x; do +for exe in enkf.x gsi.x; do [[ -s $exe ]] && rm -f $exe $LINK ../sorc/gsi_enkf.fd/install/bin/$exe . done From 23829e5c331cc694d9140b4ea2d03f2598e27a23 Mon Sep 17 00:00:00 2001 From: Rahul Mahajan Date: Wed, 13 Jul 2022 21:44:58 -0400 Subject: [PATCH 2/8] NCO might balk at using something from PATH --- parm/config/config.analdiag | 2 +- scripts/exglobal_diag.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/parm/config/config.analdiag b/parm/config/config.analdiag index 7a02ad7cba..e3cf973af4 100755 --- a/parm/config/config.analdiag +++ b/parm/config/config.analdiag @@ -7,6 +7,6 @@ echo "BEGIN: config.analdiag" # Get task specific resources . $EXPDIR/config.resources analdiag -export CATEXEC=$(which ncdiag_cat_serial.x) +export CATEXEC=${ncdiag_ROOT}/bin/ncdiag_cat_serial.x echo "END: config.analdiag" diff --git a/scripts/exglobal_diag.sh b/scripts/exglobal_diag.sh index b0778d2454..89d23a992e 100755 --- a/scripts/exglobal_diag.sh +++ b/scripts/exglobal_diag.sh @@ -47,7 +47,7 @@ export NLN=${NLN:-"/bin/ln -sf"} export CHGRP_CMD=${CHGRP_CMD:-"chgrp ${group_name:-rstprod}"} export NEMSIOGET=${NEMSIOGET:-${NWPROD}/exec/nemsio_get} export NCLEN=${NCLEN:-$HOMEgfs/ush/getncdimlen} -export CATEXEC=${CATEXEC:-$(which ncdiag_cat_serial.x)} +export CATEXEC=${CATEXEC:-$ncdiag_ROOT/bin/ncdiag_cat_serial.x} COMPRESS=${COMPRESS:-gzip} UNCOMPRESS=${UNCOMPRESS:-gunzip} APRUNCFP=${APRUNCFP:-""} From ac7b94ff537ff64d01067c23557878821c085dd0 Mon Sep 17 00:00:00 2001 From: Rahul Mahajan Date: Wed, 13 Jul 2022 21:56:24 -0400 Subject: [PATCH 3/8] no need to change config.analdiag --- parm/config/config.analdiag | 1 - 1 file changed, 1 deletion(-) diff --git a/parm/config/config.analdiag b/parm/config/config.analdiag index e3cf973af4..285e614d37 100755 --- a/parm/config/config.analdiag +++ b/parm/config/config.analdiag @@ -7,6 +7,5 @@ echo "BEGIN: config.analdiag" # Get task specific resources . $EXPDIR/config.resources analdiag -export CATEXEC=${ncdiag_ROOT}/bin/ncdiag_cat_serial.x echo "END: config.analdiag" From 8fd171cac56c9f940d3c1ec249e938e0d76daefd Mon Sep 17 00:00:00 2001 From: Rahul Mahajan Date: Wed, 13 Jul 2022 23:11:58 -0400 Subject: [PATCH 4/8] use the ufs-weather-model build script. The workflow is missing configuration options used in the model --- parm/config/config.fcst | 2 +- sorc/build_ufs.sh | 48 ++++++++++++++++++----------------------- sorc/link_workflow.sh | 4 ++-- ush/forecast_predet.sh | 4 ++-- 4 files changed, 26 insertions(+), 32 deletions(-) diff --git a/parm/config/config.fcst b/parm/config/config.fcst index 2a5b24cd6e..0d2a901656 100755 --- a/parm/config/config.fcst +++ b/parm/config/config.fcst @@ -80,7 +80,7 @@ export use_coldstart=".false." export FORECASTSH="$HOMEgfs/scripts/exglobal_forecast.sh" export FCSTEXECDIR="$HOMEgfs/exec" -export FCSTEXEC="ufs_model" +export FCSTEXEC="ufs_model.x" ####################################################################### # Model configuration diff --git a/sorc/build_ufs.sh b/sorc/build_ufs.sh index c58e09efc8..7e2bea17cd 100755 --- a/sorc/build_ufs.sh +++ b/sorc/build_ufs.sh @@ -1,44 +1,38 @@ #! /usr/bin/env bash set -eux +cwd=$(pwd) + # Default settings APP="S2SWA" CCPP_SUITES="FV3_GFS_v16,FV3_GFS_v16_ugwpv1,FV3_GFS_v17_p8,FV3_GFS_v16_coupled_nsstNoahmpUGWPv1,FV3_GFS_v17_coupled_p8" -while getopts "a:v" option; do +while getopts ":dav" option; do case "${option}" in + d) BUILD_TYPE="Debug";; a) APP="${OPTARG}" ;; v) BUILD_VERBOSE="YES";; - *) - echo "Unrecognized option: ${1}" - exit 1 + \?) + echo "[$BASH_SOURCE]: Unrecognized option: ${option}" + ;; + :) + echo "[$BASH_SOURCE]: ${option} requires an argument" ;; esac done -source ./machine-setup.sh > /dev/null 2>&1 -cwd=$(pwd) - -# Set target platform -case "${target}" in - hera|orion|stampede|jet|cheyenne) - target=${target}.intel - ;; -esac +cd $cwd/ufs_model.fd -MOD_PATH=$cwd/ufs_model.fd/modulefiles +export RT_COMPILER="intel" +source $cwd/ufs_model.fd/tests/detect_machine.sh +MAKE_OPT="-DAPP=${APP} -DCCPP_SUITES=${CCPP_SUITES}" +[[ ${BUILD_TYPE:-"Release"} = "DEBUG" ]] && MAKE_OPT+=" -DDEBUG=ON" +COMPILE_NR=0 +CLEAN_BEFORE=YES +CLEAN_AFTER=NO -cd ufs_model.fd/ -set +x -module purge -module use ${MOD_PATH} -module load ufs_${target} -set -x +./tests/compile.sh $MACHINE_ID "$MAKE_OPT" $COMPILE_NR $CLEAN_BEFORE $CLEAN_AFTER +mv ./tests/fv3_${COMPILE_NR}.exe ./tests/ufs_model.x +mv ./tests/modules.fv3_${COMPILE_NR} ./tests/modules.ufs_model -# Remove previous build directory if it exists -if [ -d build ]; then - rm -R build -fi -mkdir -p build && cd build -cmake -DAPP=${APP} -DCCPP_SUITES=${CCPP_SUITES} .. -OMP_NUM_THREADS=1 make -j ${BUILD_JOBS:-8} VERBOSE=${BUILD_VERBOSE:-} +exit 0 diff --git a/sorc/link_workflow.sh b/sorc/link_workflow.sh index 5f1d273226..a2c0788f32 100755 --- a/sorc/link_workflow.sh +++ b/sorc/link_workflow.sh @@ -206,8 +206,8 @@ for workflowexec in enkf_chgres_recenter.x enkf_chgres_recenter_nc.x fv3nc2nemsi $LINK ../sorc/install/bin/$workflowexec . done -[[ -s ufs_model ]] && rm -f ufs_model -$LINK ../sorc/ufs_model.fd/build/ufs_model . +[[ -s ufs_model.x ]] && rm -f ufs_model.x +$LINK ../sorc/ufs_model.fd/tests/ufs_model.x . [[ -s gfs_ncep_post ]] && rm -f gfs_ncep_post $LINK ../sorc/upp.fd/exec/upp.x gfs_ncep_post diff --git a/ush/forecast_predet.sh b/ush/forecast_predet.sh index 2f9ed863ca..ac536d72de 100755 --- a/ush/forecast_predet.sh +++ b/ush/forecast_predet.sh @@ -110,8 +110,8 @@ FV3_GFS_predet(){ IAU_OFFSET=${IAU_OFFSET:-0} # Model specific stuff - FCSTEXECDIR=${FCSTEXECDIR:-$HOMEgfs/sorc/ufs_model.fd/build} - FCSTEXEC=${FCSTEXEC:-ufs_model} + FCSTEXECDIR=${FCSTEXECDIR:-$HOMEgfs/exec} + FCSTEXEC=${FCSTEXEC:-ufs_model.x} PARM_FV3DIAG=${PARM_FV3DIAG:-$HOMEgfs/parm/parm_fv3diag} PARM_POST=${PARM_POST:-$HOMEgfs/parm/post} From 83c57862d48333d7e05b5169653c6e9307a33b92 Mon Sep 17 00:00:00 2001 From: Rahul Mahajan Date: Thu, 14 Jul 2022 10:32:39 -0400 Subject: [PATCH 5/8] update gsi-utils hash that includes update to ncio version. also fixes a broken link to fix_gsi --- sorc/checkout.sh | 2 +- sorc/link_workflow.sh | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/sorc/checkout.sh b/sorc/checkout.sh index 9129627f5a..2dc34580a6 100755 --- a/sorc/checkout.sh +++ b/sorc/checkout.sh @@ -132,7 +132,7 @@ mkdir -p ${logdir} errs=0 checkout "ufs_model.fd" "https://github.com/ufs-community/ufs-weather-model" "${ufs_model_hash:-Prototype-P8c}"; errs=$((errs + $?)) checkout "gsi_enkf.fd" "https://github.com/NOAA-EMC/GSI.git" "67f5ab4" ; errs=$((errs + $?)) -checkout "gsi_utils.fd" "https://github.com/NOAA-EMC/GSI-Utils.git" "00c95c4" ; errs=$((errs + $?)) +checkout "gsi_utils.fd" "https://github.com/NOAA-EMC/GSI-Utils.git" "e0dc960" ; errs=$((errs + $?)) checkout "gsi_monitor.fd" "https://github.com/NOAA-EMC/GSI-Monitor.git" "acf8870" ; errs=$((errs + $?)) checkout "gldas.fd" "https://github.com/NOAA-EMC/GLDAS.git" "fd8ba62" ; errs=$((errs + $?)) checkout "ufs_utils.fd" "https://github.com/ufs-community/UFS_UTILS.git" "a2b0817" ; errs=$((errs + $?)) diff --git a/sorc/link_workflow.sh b/sorc/link_workflow.sh index a2c0788f32..a34643232a 100755 --- a/sorc/link_workflow.sh +++ b/sorc/link_workflow.sh @@ -138,7 +138,7 @@ fi #------------------------------ cd ${pwd}/../fix ||exit 8 [[ -d fix_gsi ]] && rm -rf fix_gsi - $LINK ../sorc/gsi.fd/fix fix_gsi + $LINK ../sorc/gsi_enkf.fd/fix fix_gsi #------------------------------ @@ -259,10 +259,6 @@ done #------------------------------ cd ${pwd}/../sorc || exit 8 - # TODO - remove once ncdiag is available as a module on the system - [[ -d ncdiag.fd ]] && rm -rf ncdiag.fd - $SLINK gsi_enkf.fd/src/ncdiag ncdiag.fd - [[ -d gsi.fd ]] && rm -rf gsi.fd $SLINK gsi_enkf.fd/src/gsi gsi.fd From 37941657cc61848a27775316e84a0b33772c36a9 Mon Sep 17 00:00:00 2001 From: Rahul Mahajan Date: Thu, 14 Jul 2022 10:45:55 -0400 Subject: [PATCH 6/8] update options for build_ufs.sh per reviewer suggestions --- 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 7e2bea17cd..4225debff9 100755 --- a/sorc/build_ufs.sh +++ b/sorc/build_ufs.sh @@ -7,7 +7,7 @@ cwd=$(pwd) APP="S2SWA" CCPP_SUITES="FV3_GFS_v16,FV3_GFS_v16_ugwpv1,FV3_GFS_v17_p8,FV3_GFS_v16_coupled_nsstNoahmpUGWPv1,FV3_GFS_v17_coupled_p8" -while getopts ":dav" option; do +while getopts ":da:v" option; do case "${option}" in d) BUILD_TYPE="Debug";; a) APP="${OPTARG}" ;; From bf71f1e81943c2fb97a7a7c4bf587f929bf87bfc Mon Sep 17 00:00:00 2001 From: Rahul Mahajan Date: Thu, 14 Jul 2022 19:19:03 -0400 Subject: [PATCH 7/8] split Gaussian surface analysis creation into its own job --- env/HERA.env | 12 +- env/JET.env | 12 +- env/ORION.env | 11 +- jobs/JGLOBAL_ATMOS_SFCANL | 147 ++++++++++++++++++++ jobs/rocoto/sfcanl.sh | 13 ++ parm/config/config.resources | 9 +- parm/config/config.sfcanl | 11 ++ scripts/exglobal_atmos_sfcanl.sh | 227 +++++++++++++++++++++++++++++++ ush/rocoto/setup_workflow.py | 78 +++++------ 9 files changed, 471 insertions(+), 49 deletions(-) create mode 100755 jobs/JGLOBAL_ATMOS_SFCANL create mode 100755 jobs/rocoto/sfcanl.sh create mode 100644 parm/config/config.sfcanl create mode 100755 scripts/exglobal_atmos_sfcanl.sh diff --git a/env/HERA.env b/env/HERA.env index f63b24be65..ef780a8a49 100755 --- a/env/HERA.env +++ b/env/HERA.env @@ -4,7 +4,7 @@ if [ $# -ne 1 ]; then echo "Must specify an input argument to set runtime environment variables!" echo "argument can be any one of the following:" - echo "anal fcst post vrfy metp" + echo "anal sfcanl fcst post vrfy metp" echo "eobs eupd ecen efcs epos" echo "postsnd awips gempak" exit 1 @@ -79,9 +79,13 @@ elif [ $step = "anal" ]; then npe_gausfcanl=${npe_gausfcanl:-1} export APRUN_GAUSFCANL="$launcher -n $npe_gausfcanl" - export NTHREADS_CHGRES=${nth_echgres:-1} - [[ $NTHREADS_CHGRES -gt $npe_node_max ]] && export NTHREADS_CHGRES=$npe_node_max - export APRUN_CHGRES="" +elif [ $step = "sfcanl" ]; then + nth_max=$(($npe_node_max / $npe_node_sfcanl)) + + export NTHREADS_CYCLE=${nth_sfcanl:-14} + [[ $NTHREADS_CYCLE -gt $npe_node_max ]] && export NTHREADS_CYCLE=$npe_node_max + npe_sfcanl=${ntiles:-6} + export APRUN_CYCLE="$launcher -n $npe_sfcanl" elif [ $step = "gldas" ]; then diff --git a/env/JET.env b/env/JET.env index 8306e423c3..8d74aba5ad 100755 --- a/env/JET.env +++ b/env/JET.env @@ -4,7 +4,7 @@ if [ $# -ne 1 ]; then echo "Must specify an input argument to set runtime environment variables!" echo "argument can be any one of the following:" - echo "anal fcst post vrfy metp" + echo "anal sfcanl fcst post vrfy metp" echo "eobs eupd ecen efcs epos" echo "postsnd awips gempak" exit 1 @@ -65,9 +65,13 @@ elif [ $step = "anal" ]; then npe_gausfcanl=${npe_gausfcanl:-1} export APRUN_GAUSFCANL="$launcher $npe_gausfcanl" - export NTHREADS_CHGRES=${nth_echgres:-1} - [[ $NTHREADS_CHGRES -gt $npe_node_max ]] && export NTHREADS_CHGRES=$npe_node_max - export APRUN_CHGRES="" +elif [ $step = "sfcanl" ]; then + nth_max=$(($npe_node_max / $npe_node_sfcanl)) + + export NTHREADS_CYCLE=${nth_sfcanl:-14} + [[ $NTHREADS_CYCLE -gt $npe_node_max ]] && export NTHREADS_CYCLE=$npe_node_max + npe_sfcanl=${ntiles:-6} + export APRUN_CYCLE="$launcher $npe_sfcanl" elif [ $step = "gldas" ]; then diff --git a/env/ORION.env b/env/ORION.env index be89113c14..bef649c43f 100755 --- a/env/ORION.env +++ b/env/ORION.env @@ -4,7 +4,7 @@ if [ $# -ne 1 ]; then echo "Must specify an input argument to set runtime environment variables!" echo "argument can be any one of the following:" - echo "anal fcst post vrfy metp" + echo "anal sfcanl fcst post vrfy metp" echo "eobs eupd ecen efcs epos" echo "postsnd awips gempak" exit 1 @@ -75,9 +75,16 @@ elif [ $step = "anal" ]; then export NTHREADS_GAUSFCANL=1 npe_gausfcanl=${npe_gausfcanl:-1} - export APRUN_GAUSFCANL="$launcher -n $npe_gausfcanl" +elif [ $step = "sfcanl" ]; then + nth_max=$(($npe_node_max / $npe_node_sfcanl)) + + export NTHREADS_CYCLE=${nth_sfcanl:-14} + [[ $NTHREADS_CYCLE -gt $npe_node_max ]] && export NTHREADS_CYCLE=$npe_node_max + npe_sfcanl=${ntiles:-6} + export APRUN_CYCLE="$launcher -n $npe_sfcanl" + elif [ $step = "gldas" ]; then nth_max=$(($npe_node_max / $npe_node_gldas)) diff --git a/jobs/JGLOBAL_ATMOS_SFCANL b/jobs/JGLOBAL_ATMOS_SFCANL new file mode 100755 index 0000000000..5175b46ccd --- /dev/null +++ b/jobs/JGLOBAL_ATMOS_SFCANL @@ -0,0 +1,147 @@ +#!/bin/ksh +set -x + +export RUN_ENVIR=${RUN_ENVIR:-"nco"} +export PS4='$SECONDS + ' +date + + +############################# +# Source relevant config files +############################# +export EXPDIR=${EXPDIR:-$HOMEgfs/parm/config} +configs="base sfcanl" +config_path=${EXPDIR:-$NWROOT/gfs.${gfs_ver}/parm/config} +for config in $configs; do + . $config_path/config.$config + status=$? + [[ $status -ne 0 ]] && exit $status +done + + +########################################## +# Source machine runtime environment +########################################## +. $HOMEgfs/env/${machine}.env sfcanl +status=$? +[[ $status -ne 0 ]] && exit $status + + +############################################## +# Obtain unique process id (pid) and make temp directory +############################################## +export pid=${pid:-$$} +export outid=${outid:-"LL$job"} + +export DATA=${DATA:-${DATAROOT}/${jobid:?}} +mkdir -p $DATA +cd $DATA + + +############################################## +# Run setpdy and initialize PDY variables +############################################## +export cycle="t${cyc}z" +setpdy.sh +. ./PDY + + +############################################## +# Determine Job Output Name on System +############################################## +export pgmout="OUTPUT.${pid}" +export pgmerr=errfile + + +############################################## +# Set variables used in the script +############################################## +export CDATE=${CDATE:-${PDY}${cyc}} +export CDUMP=${CDUMP:-${RUN:-"gfs"}} +export COMPONENT=${COMPONENT:-atmos} +if [ $RUN_ENVIR = "nco" ]; then + export ROTDIR=${COMROOT:?}/$NET/$envir +fi +##export DO_CALC_ANALYSIS=${DO_CALC_ANALYSIS:-"YES"} + + +############################################## +# Begin JOB SPECIFIC work +############################################## + +GDATE=$($NDATE -$assim_freq $CDATE) +gPDY=$(echo $GDATE | cut -c1-8) +gcyc=$(echo $GDATE | cut -c9-10) +GDUMP=${GDUMP:-"gdas"} + +export OPREFIX="${CDUMP}.t${cyc}z." +export GPREFIX="${GDUMP}.t${gcyc}z." +export APREFIX="${CDUMP}.t${cyc}z." +export GSUFFIX=${GSUFFIX:-$SUFFIX} +export ASUFFIX=${ASUFFIX:-$SUFFIX} + + +if [ $RUN_ENVIR = "nco" -o ${ROTDIR_DUMP:-NO} = "YES" ]; then + export COMIN=${COMIN:-$ROTDIR/$RUN.$PDY/$cyc/$COMPONENT} + export COMOUT=${COMOUT:-$ROTDIR/$RUN.$PDY/$cyc/$COMPONENT} + export COMIN_OBS=${COMIN_OBS:-$ROTDIR/$RUN.$PDY/$cyc/$COMPONENT} + export COMIN_GES_OBS=${COMIN_GES_OBS:-$ROTDIR/$GDUMP.$gPDY/$gcyc/$COMPONENT} +else + export COMOUT="$ROTDIR/$CDUMP.$PDY/$cyc/$COMPONENT" + export COMIN_OBS="$DMPDIR/$CDATE/$CDUMP" + export COMIN_GES_OBS="$DMPDIR/$GDATE/$GDUMP" +fi +mkdir -m 775 -p $COMOUT +# COMIN_GES and COMIN_GES_ENS are used in script +export COMIN_GES="$ROTDIR/$GDUMP.$gPDY/$gcyc/$COMPONENT" +export COMIN_GES_ENS="$ROTDIR/enkfgdas.$gPDY/$gcyc/$COMPONENT" + + +export ATMGES="$COMIN_GES/${GPREFIX}atmf006${GSUFFIX}" +if [ ! -f $ATMGES ]; then + echo "FATAL ERROR: FILE MISSING: ATMGES = $ATMGES" + exit 1 +fi + + +# Update surface fields with global_cycle +export DOGCYCLE=${DOGCYCLE:-"YES"} + + +############################################################### +# Run relevant script +env +msg="HAS BEGUN on $(hostname)" +postmsg "$jlogfile" "$msg" +$LOGSCRIPT + + +${SFCANALSH:-$SCRgfs/exglobal_atmos_sfcanl.sh} +status=$? +[[ $status -ne 0 ]] && exit $status + + +############################################## +# End JOB SPECIFIC work +############################################## + +############################################## +# Final processing +############################################## +if [ -e "$pgmout" ] ; then + cat $pgmout +fi + + +msg="ENDED NORMALLY." +postmsg "$jlogfile" "$msg" + + +########################################## +# Remove the Temporary working directory +########################################## +cd $DATAROOT +[[ $KEEPDATA = "NO" ]] && rm -rf $DATA + +date +exit 0 diff --git a/jobs/rocoto/sfcanl.sh b/jobs/rocoto/sfcanl.sh new file mode 100755 index 0000000000..457b205c43 --- /dev/null +++ b/jobs/rocoto/sfcanl.sh @@ -0,0 +1,13 @@ +#!/bin/bash -x + +############################################################### +# Source FV3GFS workflow modules +. $HOMEgfs/ush/load_fv3gfs_modules.sh +status=$? +[[ $status -ne 0 ]] && exit $status + +############################################################### +# Execute the JJOB +$HOMEgfs/jobs/JGLOBAL_ATMOS_SFCANL +status=$? +exit $status diff --git a/parm/config/config.resources b/parm/config/config.resources index 3cd090b588..109309bc4f 100755 --- a/parm/config/config.resources +++ b/parm/config/config.resources @@ -9,7 +9,7 @@ if [ $# -ne 1 ]; then echo "Must specify an input task argument to set resource variables!" echo "argument can be any one of the following:" echo "getic init coupled_ic aerosol_init" - echo "anal analcalc analdiag gldas fcst post vrfy metp arch echgres" + echo "anal sfcanl analcalc analdiag gldas fcst post vrfy metp arch echgres" echo "eobs ediag eomg eupd ecen esfc efcs epos earc" echo "init_chem mom6ic ocnpost" echo "waveinit waveprep wavepostsbs wavepostbndpnt wavepostbndpntbll wavepostpnt" @@ -174,6 +174,13 @@ elif [ $step = "analdiag" ]; then export npe_node_analdiag=$npe_node_max if [[ "$machine" == "WCOSS_C" ]]; then export memory_analdiag="3072M"; fi +elif [ $step = "sfcanl" ]; then + + export wtime_sfcanl="00:10:00" + export npe_sfcanl=6 + export nth_sfcanl=1 + export npe_node_sfcanl=$(echo "$npe_node_max / $nth_sfcanl" | bc) + elif [ $step = "gldas" ]; then export wtime_gldas="00:10:00" diff --git a/parm/config/config.sfcanl b/parm/config/config.sfcanl new file mode 100644 index 0000000000..76da647eef --- /dev/null +++ b/parm/config/config.sfcanl @@ -0,0 +1,11 @@ +#!/bin/bash -x + +########## config.sfcanl ########## +# GFS surface analysis specific + +echo "BEGIN: config.sfcanl" + +# Get task specific resources +. $EXPDIR/config.resources sfcanl + +echo "END: config.sfcanl" diff --git a/scripts/exglobal_atmos_sfcanl.sh b/scripts/exglobal_atmos_sfcanl.sh new file mode 100755 index 0000000000..1d6ac67b0f --- /dev/null +++ b/scripts/exglobal_atmos_sfcanl.sh @@ -0,0 +1,227 @@ +#!/bin/ksh +################################################################################ +#### UNIX Script Documentation Block +# . . +# Script name: exglobal_atmos_sfcanl.sh +# Script description: Makes global model surface analysis files +# +# Author: Russ Treadon Org: NCEP/EMC Date: 2021-12-13 +# +# Abstract: This script makes global model surface analysis filesk +# +# $Id$ +# +# Attributes: +# Language: POSIX shell +# Machine: WCOSS-Dell +# +################################################################################ + +# Set environment. +export VERBOSE=${VERBOSE:-"YES"} +if [ $VERBOSE = "YES" ]; then + echo $(date) EXECUTING $0 $* >&2 + set -x +fi + +# Directories. +pwd=$(pwd) + +# Base variables +CDATE=${CDATE:-"2001010100"} +CDUMP=${CDUMP:-"gdas"} +GDUMP=${GDUMP:-"gdas"} + +# Derived base variables +GDATE=$($NDATE -$assim_freq $CDATE) +BDATE=$($NDATE -3 $CDATE) +PDY=$(echo $CDATE | cut -c1-8) +cyc=$(echo $CDATE | cut -c9-10) +bPDY=$(echo $BDATE | cut -c1-8) +bcyc=$(echo $BDATE | cut -c9-10) + +# Utilities +export NCP=${NCP:-"/bin/cp"} +export NMV=${NMV:-"/bin/mv"} +export NLN=${NLN:-"/bin/ln -sf"} +export CHGRP_CMD=${CHGRP_CMD:-"chgrp ${group_name:-rstprod}"} +export NEMSIOGET=${NEMSIOGET:-${NWPROD}/exec/nemsio_get} +export NCLEN=${NCLEN:-$HOMEgfs/ush/getncdimlen} +COMPRESS=${COMPRESS:-gzip} +UNCOMPRESS=${UNCOMPRESS:-gunzip} +APRUNCFP=${APRUNCFP:-""} + +# IAU +DOIAU=${DOIAU:-"NO"} +export IAUFHRS=${IAUFHRS:-"6"} + +# Surface cycle related parameters +CYCLESH=${CYCLESH:-$HOMEgfs/ush/global_cycle.sh} +export CYCLEXEC=${CYCLEXEC:-$HOMEgfs/exec/global_cycle} +NTHREADS_CYCLE=${NTHREADS_CYCLE:-24} +APRUN_CYCLE=${APRUN_CYCLE:-${APRUN:-""}} +export SNOW_NUDGE_COEFF=${SNOW_NUDGE_COEFF:-'-2.'} +export CYCLVARS=${CYCLVARS:-""} +export FHOUR=${FHOUR:-0} +export DELTSFC=${DELTSFC:-6} +export FIXgsm=${FIXgsm:-$HOMEgfs/fix/fix_am} +export FIXfv3=${FIXfv3:-$HOMEgfs/fix/fix_fv3_gmted2010} + +# FV3 specific info (required for global_cycle) +export CASE=${CASE:-"C384"} +ntiles=${ntiles:-6} + +# IAU +DOIAU=${DOIAU:-"NO"} +export IAUFHRS=${IAUFHRS:-"6"} + +# Dependent Scripts and Executables +export NTHREADS_CALCINC=${NTHREADS_CALCINC:-1} +export APRUN_CALCINC=${APRUN_CALCINC:-${APRUN:-""}} +export APRUN_CALCANL=${APRUN_CALCANL:-${APRUN:-""}} +export APRUN_CHGRES=${APRUN_CALCANL:-${APRUN:-""}} + +export CALCANLEXEC=${CALCANLEXEC:-$HOMEgfs/exec/calc_analysis.x} +export CHGRESNCEXEC=${CHGRESNCEXEC:-$HOMEgfs/exec/enkf_chgres_recenter_nc.x} +export CHGRESINCEXEC=${CHGRESINCEXEC:-$HOMEgfs/exec/interp_inc.x} +export NTHREADS_CHGRES=${NTHREADS_CHGRES:-1} +CALCINCPY=${CALCINCPY:-$HOMEgfs/ush/calcinc_gfs.py} +CALCANLPY=${CALCANLPY:-$HOMEgfs/ush/calcanl_gfs.py} + +export APRUN_CHGRES=${APRUN_CALCANL:-${APRUN:-""}} +CHGRESEXEC=${CHGRESEXEC:-$HOMEgfs/exec/enkf_chgres_recenter.x} + +# OPS flags +RUN=${RUN:-""} +SENDECF=${SENDECF:-"NO"} +SENDDBN=${SENDDBN:-"NO"} +RUN_GETGES=${RUN_GETGES:-"NO"} +GETGESSH=${GETGESSH:-"getges.sh"} +export gesenvir=${gesenvir:-$envir} + +# Observations +OPREFIX=${OPREFIX:-""} +OSUFFIX=${OSUFFIX:-""} + +# Guess files +GPREFIX=${GPREFIX:-""} + +# Analysis files +export APREFIX=${APREFIX:-""} +DTFANL=${DTFANL:-${COMOUT}/${APREFIX}dtfanl.nc} + +# Get dimension information based on CASE +res=$(echo $CASE | cut -c2-) +JCAP_CASE=$((res*2-2)) +LATB_CASE=$((res*2)) +LONB_CASE=$((res*4)) + +################################################################################ +# Preprocessing +mkdata=NO +if [ ! -d $DATA ]; then + mkdata=YES + mkdir -p $DATA +fi + +cd $DATA || exit 99 + +if [ $DONST = "YES" ]; then + export NSSTBF="${COMOUT}/${OPREFIX}nsstbufr" + $NLN $NSSTBF nsstbufr +fi + + +############################################################## +# Required model guess files + + +############################################################## +# Output files +if [ $DONST = "YES" ]; then + $NLN $DTFANL dtfanl +fi + + +############################################################## +# Update surface fields in the FV3 restart's using global_cycle +mkdir -p $COMOUT/RESTART + +# Global cycle requires these files +export FNTSFA=${FNTSFA:-$COMIN_OBS/${OPREFIX}rtgssthr.grb} +export FNACNA=${FNACNA:-$COMIN_OBS/${OPREFIX}seaice.5min.blend.grb} +export FNSNOA=${FNSNOA:-$COMIN_OBS/${OPREFIX}snogrb_t${JCAP_CASE}.${LONB_CASE}.${LATB_CASE}} +[[ ! -f $FNSNOA ]] && export FNSNOA="$COMIN_OBS/${OPREFIX}snogrb_t1534.3072.1536" +FNSNOG=${FNSNOG:-$COMIN_GES_OBS/${GPREFIX}snogrb_t${JCAP_CASE}.${LONB_CASE}.${LATB_CASE}} +[[ ! -f $FNSNOG ]] && FNSNOG="$COMIN_GES_OBS/${GPREFIX}snogrb_t1534.3072.1536" + +# Set CYCLVARS by checking grib date of current snogrb vs that of prev cycle +if [ $RUN_GETGES = "YES" ]; then + snoprv=$($GETGESSH -q -t snogrb_$JCAP_CASE -e $gesenvir -n $GDUMP -v $GDATE) +else + snoprv=${snoprv:-$FNSNOG} +fi + +if [ $($WGRIB -4yr $FNSNOA 2>/dev/null | grep -i snowc | awk -F: '{print $3}' | awk -F= '{print $2}') -le \ + $($WGRIB -4yr $snoprv 2>/dev/null | grep -i snowc | awk -F: '{print $3}' | awk -F= '{print $2}') ] ; then + export FNSNOA=" " + export CYCLVARS="FSNOL=99999.,FSNOS=99999.," +else + export SNOW_NUDGE_COEFF=${SNOW_NUDGE_COEFF:-0.} + export CYCLVARS="FSNOL=${SNOW_NUDGE_COEFF},$CYCLVARS" +fi + +if [ $DONST = "YES" ]; then + export NST_FILE=${GSI_FILE:-$COMOUT/${APREFIX}dtfanl.nc} +else + export NST_FILE="NULL" +fi + +if [ $DOIAU = "YES" ]; then + # update surface restarts at the beginning of the window, if IAU + # For now assume/hold dtfanl.nc valid at beginning of window + for n in $(seq 1 $ntiles); do + $NLN $COMIN_GES/RESTART/$bPDY.${bcyc}0000.sfc_data.tile${n}.nc $DATA/fnbgsi.00$n + $NLN $COMOUT/RESTART/$bPDY.${bcyc}0000.sfcanl_data.tile${n}.nc $DATA/fnbgso.00$n + $NLN $FIXfv3/$CASE/${CASE}_grid.tile${n}.nc $DATA/fngrid.00$n + $NLN $FIXfv3/$CASE/${CASE}_oro_data.tile${n}.nc $DATA/fnorog.00$n + done + + export APRUNCY=$APRUN_CYCLE + export OMP_NUM_THREADS_CY=$NTHREADS_CYCLE + export MAX_TASKS_CY=$ntiles + + $CYCLESH + export err=$?; err_chk +fi + +# Update surface restarts at middle of window +for n in $(seq 1 $ntiles); do + $NLN $COMIN_GES/RESTART/$PDY.${cyc}0000.sfc_data.tile${n}.nc $DATA/fnbgsi.00$n + $NLN $COMOUT/RESTART/$PDY.${cyc}0000.sfcanl_data.tile${n}.nc $DATA/fnbgso.00$n + $NLN $FIXfv3/$CASE/${CASE}_grid.tile${n}.nc $DATA/fngrid.00$n + $NLN $FIXfv3/$CASE/${CASE}_oro_data.tile${n}.nc $DATA/fnorog.00$n +done + +export APRUNCY=$APRUN_CYCLE +export OMP_NUM_THREADS_CY=$NTHREADS_CYCLE +export MAX_TASKS_CY=$ntiles + +$CYCLESH +export err=$?; err_chk + + +################################################################################ +# Postprocessing +cd $pwd +[[ $mkdata = "YES" ]] && rm -rf $DATA + + +################################################################################ +set +x +if [ $VERBOSE = "YES" ]; then + echo $(date) EXITING $0 with return code $err >&2 +fi +exit $err + +################################################################################ diff --git a/ush/rocoto/setup_workflow.py b/ush/rocoto/setup_workflow.py index 3c6d70d81f..1e5c102531 100755 --- a/ush/rocoto/setup_workflow.py +++ b/ush/rocoto/setup_workflow.py @@ -42,7 +42,7 @@ def main(): print(f'input arg: --expdir = {repr(args.expdir)}') sys.exit(1) - gfs_steps = ['prep', 'anal', 'analdiag', 'analcalc', 'gldas', 'fcst', 'postsnd', 'post', 'vrfy', 'arch'] + gfs_steps = ['prep', 'anal', 'sfcanl', 'analdiag', 'analcalc', 'gldas', 'fcst', 'postsnd', 'post', 'vrfy', 'arch'] gfs_steps_gempak = ['gempak'] gfs_steps_awips = ['awips'] gfs_steps_wafs = ['wafs', 'wafsgrib2', 'wafsblending', 'wafsgcip', 'wafsgrib20p25', 'wafsblending0p25'] @@ -244,7 +244,7 @@ def get_gdasgfs_resources(dict_configs, cdump='gdas'): reservation = base.get('RESERVATION', 'NONE').upper() #tasks = ['prep', 'anal', 'fcst', 'post', 'vrfy', 'arch'] - tasks = ['prep', 'anal', 'analcalc'] + tasks = ['prep', 'anal', 'sfcanl', 'analcalc'] if cdump in ['gdas']: tasks += ['analdiag'] @@ -485,19 +485,31 @@ def get_gdasgfs_tasks(dict_configs, cdump='gdas'): dict_tasks[f'{cdump}anal'] = task + # sfcanl + deps = [] + data = f'&ROTDIR;/{cdump}.@Y@m@d/@H/atmos/{cdump}.t@Hz.loginc.txt' + dep_dict = {'type': 'data', 'data': data} + deps.append(rocoto.add_dependency(dep_dict)) + dep_dict = {'type': 'task', 'name': f'{cdump}anal'} + deps.append(rocoto.add_dependency(dep_dict)) + dependencies = rocoto.create_dependency(dep_condition='and', dep=deps) + task = wfu.create_wf_task('sfcanl', cdump=cdump, envar=envars, dependency=dependencies) + + dict_tasks[f'{cdump}sfcanl'] = task + # analcalc - deps1 = [] + deps = [] data = f'&ROTDIR;/{cdump}.@Y@m@d/@H/atmos/{cdump}.t@Hz.loginc.txt' dep_dict = {'type': 'data', 'data': data} - deps1.append(rocoto.add_dependency(dep_dict)) + deps.append(rocoto.add_dependency(dep_dict)) dep_dict = {'type': 'task', 'name': f'{cdump}anal'} deps.append(rocoto.add_dependency(dep_dict)) + dep_dict = {'type': 'task', 'name': f'{cdump}sfcanl'} + deps.append(rocoto.add_dependency(dep_dict)) if dohybvar in ['y', 'Y', 'yes', 'YES'] and cdump == 'gdas': dep_dict = {'type': 'task', 'name': f'{"gdas"}echgres', 'offset': '-06:00:00'} deps.append(rocoto.add_dependency(dep_dict)) - dependencies = rocoto.create_dependency(dep_condition='and', dep=deps) - else: - dependencies = rocoto.create_dependency(dep_condition='and', dep=deps) + dependencies = rocoto.create_dependency(dep_condition='and', dep=deps) task = wfu.create_wf_task('analcalc', cdump=cdump, envar=envars, dependency=dependencies) dict_tasks[f'{cdump}analcalc'] = task @@ -524,51 +536,41 @@ def get_gdasgfs_tasks(dict_configs, cdump='gdas'): # gldas if cdump in ['gdas'] and do_gldas in ['Y', 'YES']: - deps1 = [] - data = f'&ROTDIR;/{cdump}.@Y@m@d/@H/atmos/{cdump}.t@Hz.loginc.txt' - dep_dict = {'type': 'data', 'data': data} - deps1.append(rocoto.add_dependency(dep_dict)) - dep_dict = {'type': 'task', 'name': f'{cdump}anal'} - deps1.append(rocoto.add_dependency(dep_dict)) - dependencies1 = rocoto.create_dependency(dep_condition='or', dep=deps1) - - deps2 = [] - deps2 = dependencies1 + deps = [] + dep_dict = {'type': 'task', 'name': f'{cdump}sfcanl'} + deps.append(rocoto.add_dependency(dep_dict)) dep_dict = {'type': 'cycleexist', 'offset': '-06:00:00'} - deps2.append(rocoto.add_dependency(dep_dict)) - dependencies2 = rocoto.create_dependency(dep_condition='and', dep=deps2) + deps.append(rocoto.add_dependency(dep_dict)) + dependencies = rocoto.create_dependency(dep_condition='and', dep=deps) + + task = wfu.create_wf_task('gldas', cdump=cdump, envar=envars, dependency=dependencies) - task = wfu.create_wf_task('gldas', cdump=cdump, envar=envars, dependency=dependencies2) dict_tasks[f'{cdump}gldas'] = task # fcst - deps1 = [] - #data = f'&ROTDIR;/{cdump}.@Y@m@d/@H/atmos/{cdump}.t@Hz.loginc.txt' - #dep_dict = {'type': 'data', 'data': data} - #deps1.append(rocoto.add_dependency(dep_dict)) + deps = [] if cdump in ['gdas']: dep_dict = {'type': 'cycleexist', 'condition': 'not', 'offset': '-06:00:00'} - deps1.append(rocoto.add_dependency(dep_dict)) + deps.append(rocoto.add_dependency(dep_dict)) if do_gldas in ['Y', 'YES']: dep_dict = {'type': 'task', 'name': f'{cdump}gldas'} - deps1.append(rocoto.add_dependency(dep_dict)) + deps.append(rocoto.add_dependency(dep_dict)) else: - dep_dict = {'type': 'task', 'name': f'{cdump}analcalc'} - deps1.append(rocoto.add_dependency(dep_dict)) + dep_dict = {'type': 'task', 'name': f'{cdump}sfcanl'} + deps.append(rocoto.add_dependency(dep_dict)) + dependencies = rocoto.create_dependency(dep_condition='or', dep=deps) elif cdump in ['gfs']: - dep_dict = {'type': 'task', 'name': f'{cdump}anal'} - deps1.append(rocoto.add_dependency(dep_dict)) - dependencies1 = rocoto.create_dependency(dep_condition='or', dep=deps1) + dep_dict = {'type': 'task', 'name': f'{cdump}sfcanl'} + deps.append(rocoto.add_dependency(dep_dict)) + dependencies = rocoto.create_dependency(dep=deps) if do_wave in ['Y', 'YES'] and cdump in cdumps: - deps2 = [] - deps2 = dependencies1 + deps = dependencies dep_dict = {'type': 'task', 'name': f'{cdump}waveprep'} - deps2.append(rocoto.add_dependency(dep_dict)) - dependencies2 = rocoto.create_dependency(dep_condition='and', dep=deps2) - task = wfu.create_wf_task('fcst', cdump=cdump, envar=envars, dependency=dependencies2) - else: - task = wfu.create_wf_task('fcst', cdump=cdump, envar=envars, dependency=dependencies1) + deps.append(rocoto.add_dependency(dep_dict)) + dependencies = rocoto.create_dependency(dep_condition='and', dep=deps) + + task = wfu.create_wf_task('fcst', cdump=cdump, envar=envars, dependency=dependencies) dict_tasks[f'{cdump}fcst'] = task From 7a22b39fa1fe329ca72b1900c387e9d59acd1ad1 Mon Sep 17 00:00:00 2001 From: Rahul Mahajan Date: Fri, 15 Jul 2022 10:59:00 -0400 Subject: [PATCH 8/8] basic housecleaning --- jobs/JGLOBAL_ATMOS_SFCANL | 8 +------- scripts/exglobal_atmos_sfcanl.sh | 4 ++-- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/jobs/JGLOBAL_ATMOS_SFCANL b/jobs/JGLOBAL_ATMOS_SFCANL index 5175b46ccd..b5c7c7b953 100755 --- a/jobs/JGLOBAL_ATMOS_SFCANL +++ b/jobs/JGLOBAL_ATMOS_SFCANL @@ -1,4 +1,4 @@ -#!/bin/ksh +#!/bin/bash set -x export RUN_ENVIR=${RUN_ENVIR:-"nco"} @@ -62,7 +62,6 @@ export COMPONENT=${COMPONENT:-atmos} if [ $RUN_ENVIR = "nco" ]; then export ROTDIR=${COMROOT:?}/$NET/$envir fi -##export DO_CALC_ANALYSIS=${DO_CALC_ANALYSIS:-"YES"} ############################################## @@ -104,13 +103,8 @@ if [ ! -f $ATMGES ]; then fi -# Update surface fields with global_cycle -export DOGCYCLE=${DOGCYCLE:-"YES"} - - ############################################################### # Run relevant script -env msg="HAS BEGUN on $(hostname)" postmsg "$jlogfile" "$msg" $LOGSCRIPT diff --git a/scripts/exglobal_atmos_sfcanl.sh b/scripts/exglobal_atmos_sfcanl.sh index 1d6ac67b0f..50a6f42d00 100755 --- a/scripts/exglobal_atmos_sfcanl.sh +++ b/scripts/exglobal_atmos_sfcanl.sh @@ -1,4 +1,4 @@ -#!/bin/ksh +#!/bin/bash ################################################################################ #### UNIX Script Documentation Block # . . @@ -7,7 +7,7 @@ # # Author: Russ Treadon Org: NCEP/EMC Date: 2021-12-13 # -# Abstract: This script makes global model surface analysis filesk +# Abstract: This script makes global model surface analysis files # # $Id$ #