diff --git a/.cicd/Jenkinsfile b/.cicd/Jenkinsfile index b15e8b1962..75a9e96308 100644 --- a/.cicd/Jenkinsfile +++ b/.cicd/Jenkinsfile @@ -173,7 +173,7 @@ pipeline { post { always { // Archive the test log files - sh 'cd "${SRW_WE2E_EXPERIMENT_BASE_DIR}" && tar --create --gzip --verbose --file "${WORKSPACE}/we2e_test_logs-${SRW_PLATFORM}-${SRW_COMPILER}.tgz" */log.generate_FV3LAM_wflow */log.launch_FV3LAM_wflow */log/*' + sh 'cd "${SRW_WE2E_EXPERIMENT_BASE_DIR}" && tar --create --gzip --verbose --dereference --file "${WORKSPACE}/we2e_test_logs-${SRW_PLATFORM}-${SRW_COMPILER}.tgz" */log.generate_FV3LAM_wflow */log.launch_FV3LAM_wflow */log/*' // Remove the data sets from the experiments directory to conserve disk space sh 'find "${SRW_WE2E_EXPERIMENT_BASE_DIR}" -regextype posix-extended -regex "^.*(orog|[0-9]{10})$" -type d | xargs rm -rf' s3Upload consoleLogLevel: 'INFO', dontSetBuildResultOnFailure: false, dontWaitForConcurrentBuildCompletion: false, entries: [[bucket: 'woc-epic-jenkins-artifacts', excludedFile: '', flatten: false, gzipFiles: false, keepForever: false, managedArtifacts: true, noUploadOnFailure: false, selectedRegion: 'us-east-1', showDirectlyInBrowser: false, sourceFile: 'we2e_test_results-*-*.txt', storageClass: 'STANDARD', uploadFromSlave: false, useServerSideEncryption: false], [bucket: 'woc-epic-jenkins-artifacts', excludedFile: '', flatten: false, gzipFiles: false, keepForever: false, managedArtifacts: true, noUploadOnFailure: false, selectedRegion: 'us-east-1', showDirectlyInBrowser: false, sourceFile: 'we2e_test_logs-*-*.tgz', storageClass: 'STANDARD', uploadFromSlave: false, useServerSideEncryption: false]], pluginFailureResultConstraint: 'FAILURE', profileName: 'main', userMetadata: [] diff --git a/.cicd/scripts/srw_build.sh b/.cicd/scripts/srw_build.sh index c8a4943238..10327366f0 100755 --- a/.cicd/scripts/srw_build.sh +++ b/.cicd/scripts/srw_build.sh @@ -26,7 +26,10 @@ fi # Build and install cd ${workspace}/tests +set +e ./build.sh ${platform} ${SRW_COMPILER} +build_exit=$? +set -e cd - # Create combined log file for upload to s3 @@ -34,3 +37,4 @@ build_dir="${workspace}/build_${SRW_COMPILER}" cat ${build_dir}/log.cmake ${build_dir}/log.make \ >${build_dir}/srw_build-${platform}-${SRW_COMPILER}.log +exit $build_exit diff --git a/devbuild.sh b/devbuild.sh index 218a0eeb81..d31ed0eca7 100755 --- a/devbuild.sh +++ b/devbuild.sh @@ -33,6 +33,8 @@ OPTIONS does a "make clean" --build does a "make" (build only) + --move + move binaries to final location. --build-dir=BUILD_DIR build directory --install-dir=INSTALL_DIR @@ -125,6 +127,7 @@ BUILD_RRFS_UTILS="off" # Make options CLEAN=false BUILD=false +MOVE=false USE_SUB_MODULES=false #change default to true later # process required arguments @@ -155,6 +158,7 @@ while :; do --continue=?*|--continue=) usage_error "$1 argument ignored." ;; --clean) CLEAN=true ;; --build) BUILD=true ;; + --move) MOVE=true ;; --build-dir=?*) BUILD_DIR=${1#*=} ;; --build-dir|--build-dir=) usage_error "$1 requires argument." ;; --install-dir=?*) INSTALL_DIR=${1#*=} ;; @@ -398,18 +402,31 @@ module list mkdir -p ${BUILD_DIR} cd ${BUILD_DIR} -printf "... Generate CMAKE configuration ...\n" -cmake ${SRW_DIR} ${CMAKE_SETTINGS} 2>&1 | tee log.cmake - if [ "${CLEAN}" = true ]; then - printf "... Clean executables ...\n" - make ${MAKE_SETTINGS} clean 2>&1 | tee log.make + if [ -f $PWD/Makefile ]; then + printf "... Clean executables ...\n" + make ${MAKE_SETTINGS} clean 2>&1 | tee log.make + fi elif [ "${BUILD}" = true ]; then + printf "... Generate CMAKE configuration ...\n" + cmake ${SRW_DIR} ${CMAKE_SETTINGS} 2>&1 | tee log.cmake + printf "... Compile executables ...\n" make ${MAKE_SETTINGS} build 2>&1 | tee log.make else + printf "... Generate CMAKE configuration ...\n" + cmake ${SRW_DIR} ${CMAKE_SETTINGS} 2>&1 | tee log.cmake + printf "... Compile and install executables ...\n" make ${MAKE_SETTINGS} install 2>&1 | tee log.make + + if [ "${MOVE}" = true ]; then + if [[ ! ${SRW_DIR} -ef ${INSTALL_DIR} ]]; then + printf "... Moving executables to final locations ...\n" + mkdir -p ${SRW_DIR}/${BIN_DIR} + mv ${INSTALL_DIR}/${BIN_DIR}/* ${SRW_DIR}/${BIN_DIR} + fi + fi fi exit 0 diff --git a/devclean.sh b/devclean.sh index d3c316514e..36fbc36898 100755 --- a/devclean.sh +++ b/devclean.sh @@ -119,9 +119,11 @@ elif [ "${CLEAN}" = true ]; then printf '%s\n' " from the installation directory = ${INSTALL_DIR} " [[ -d "${BUILD_DIR}" ]] && rm -rf ${BUILD_DIR} && printf '%s\n' "rm -rf ${BUILD_DIR}" [[ -d "${INSTALL_DIR}/${BIN_DIR}" ]] && ( rm -rf ${INSTALL_DIR}/${BIN_DIR} && printf '%s\n' "rm -rf ${INSTALL_DIR}/${BIN_DIR}" ) - [[ -d "${INSTALL_DIR}/lib" ]] && ( rm -rf ${INSTALL_DIR}/share && printf '%s\n' "rm -rf ${INSTALL_DIR}/share" ) + [[ -d "${SRW_DIR}/${BIN_DIR}" ]] && ( rm -rf ${SRW_DIR}/${BIN_DIR} && printf '%s\n' "rm -rf ${SRW_DIR}/${BIN_DIR}" ) + [[ -d "${INSTALL_DIR}/share" ]] && ( rm -rf ${INSTALL_DIR}/share && printf '%s\n' "rm -rf ${INSTALL_DIR}/share" ) [[ -d "${INSTALL_DIR}/include" ]] && ( rm -rf ${INSTALL_DIR}/include && printf '%s\n' "rm -rf ${INSTALL_DIR}/include" ) [[ -d "${INSTALL_DIR}/lib" ]] && rm -rf ${INSTALL_DIR}/lib && printf '%s\n' "rm -rf ${INSTALL_DIR}/lib" + [[ -d "${INSTALL_DIR}/lib64" ]] && rm -rf ${INSTALL_DIR}/lib && printf '%s\n' "rm -rf ${INSTALL_DIR}/lib64" [[ -d "${SRW_DIR}/manage_externals/manic" ]] && rm -f ${SRW_DIR}/manage_externals/manic/*.pyc && printf '%s\n' "rm -f ${SRW_DIR}/manage_externals/manic/*.pyc" echo " " fi diff --git a/etc/lmod-setup.csh b/etc/lmod-setup.csh index c8e1fc5ae2..69cffe5e12 100644 --- a/etc/lmod-setup.csh +++ b/etc/lmod-setup.csh @@ -16,8 +16,9 @@ endif source /etc/csh.login if ( "$L_MACHINE" == macos ) then - set ENV="/opt/homebrew/opt/lmod/init/csh" - # setenv ENV "/usr/local/opt/lmod/init/csh" + arch=$(uname -m) + [[ "$arch" = arm64 ]] && export ENV="/opt/homebrew/opt/lmod/init/csh" + [[ "$arch" = x86_64 ]] && export ENV="/usr/local/opt/lmod/init/csh" source $ENV module purge diff --git a/etc/lmod-setup.sh b/etc/lmod-setup.sh index 91e9228a9f..324868afce 100644 --- a/etc/lmod-setup.sh +++ b/etc/lmod-setup.sh @@ -23,8 +23,9 @@ $has_mu && set -u $has_me && set -e if [ "$L_MACHINE" = macos ]; then - export BASH_ENV="/opt/homebrew/opt/lmod/init/bash" - # export BASH_ENV="/usr/local/opt/lmod/init/bash" + arch=$(uname -m) + [[ "$arch" = arm64 ]] && export BASH_ENV="/opt/homebrew/opt/lmod/init/bash" + [[ "$arch" = x86_64 ]] && export BASH_ENV="/usr/local/opt/lmod/init/bash" source $BASH_ENV module purge diff --git a/jobs/JREGIONAL_GET_EXTRN_MDL_FILES b/jobs/JREGIONAL_GET_EXTRN_MDL_FILES index 8975a3e678..c75c709b2a 100755 --- a/jobs/JREGIONAL_GET_EXTRN_MDL_FILES +++ b/jobs/JREGIONAL_GET_EXTRN_MDL_FILES @@ -93,10 +93,11 @@ check_var_valid_value "ICS_OR_LBCS" "valid_vals_ICS_OR_LBCS" if [ "${ICS_OR_LBCS}" = "ICS" ]; then export TIME_OFFSET_HRS=${EXTRN_MDL_ICS_OFFSET_HRS:-0} export EXTRN_MDL_NAME=${EXTRN_MDL_NAME_ICS} - + GFS_FILE_FMT=${FV3GFS_FILE_FMT_ICS} elif [ "${ICS_OR_LBCS}" = "LBCS" ]; then export TIME_OFFSET_HRS=${EXTRN_MDL_LBCS_OFFSET_HRS:-0} export EXTRN_MDL_NAME=${EXTRN_MDL_NAME_LBCS} + GFS_FILE_FMT=${FV3GFS_FILE_FMT_LBCS} fi # @@ -159,10 +160,10 @@ case ${EXTRN_MDL_NAME} in # The transition date from the GSMGFS to the FV3GFS was 2019061212, i.e. # this was the first official forecast with the FV3GFS. So we set the # last CDATE for the GSMGFS to the one 6 hours before this. - cdate_max="2019061206" - if [ "$EXTRN_MDL_CDATE" -gt "$cdate_max" ]; then + CDATE_max="2019061206" + if [ "$EXTRN_MDL_CDATE" -gt "$CDATE_max" ]; then print_err_msg_exit "\ - $(data_unavailable $EXTRN_MDL_NAME $EXTRN_MDL_CDATE $cdate_max max)" + $(data_unavailable $EXTRN_MDL_NAME $EXTRN_MDL_CDATE $CDATE_max max)" fi ;; @@ -171,11 +172,20 @@ case ${EXTRN_MDL_NAME} in # this was the first official forecast with the FV3GFS. However, paral- # lel runs with the FV3GFS go back to 2018121500. So we set the first # EXTRN_MDL_CDATE for the FV3GFS to this date and time. -# CDATE_min="2019061212" CDATE_min="2018121500" + CDATE_min_netcdf="2021032100" + CDATE_max_nemsio="2021032018" if [ "$EXTRN_MDL_CDATE" -lt "$CDATE_min" ]; then print_err_msg_exit "\ - $(data_unavailable $EXTRN_MDL_NAME $EXTRN_MDL_CDATE $cdate_min min)" + $(data_unavailable $EXTRN_MDL_NAME $EXTRN_MDL_CDATE $CDATE_min min)" + elif [ "${GFS_FILE_FMT}" = "netcdf" ] && [ "${EXTRN_MDL_CDATE}" -lt "${CDATE_min_netcdf}" ]; then + print_err_msg_exit "\ + NETCDF is not available for this date:: However, NEMSIO is available:: \ + $(data_unavailable $EXTRN_MDL_NAME $EXTRN_MDL_CDATE $CDATE_min_netcdf min)" + elif [ "${GFS_FILE_FMT}" = "nemsio" ] && [ "${EXTRN_MDL_CDATE}" -gt "${CDATE_max_nemsio}" ]; then + print_err_msg_exit "\ + NEMSIO is not available for this date:: However, NETCDF is available:: \ + $(data_unavailable $EXTRN_MDL_NAME $EXTRN_MDL_CDATE $CDATE_max_nemsio max)" fi ;; @@ -185,7 +195,7 @@ case ${EXTRN_MDL_NAME} in CDATE_min="2015070100" if [ "$EXTRN_MDL_CDATE" -lt "$CDATE_min" ]; then print_err_msg_exit "\ - $(data_unavailable $EXTRN_MDL_NAME $EXTRN_MDL_CDATE $cdate_min min)" + $(data_unavailable $EXTRN_MDL_NAME $EXTRN_MDL_CDATE $CDATE_min min)" fi ;; @@ -196,7 +206,7 @@ case ${EXTRN_MDL_NAME} in CDATE_min="2014103000" if [ "$EXTRN_MDL_CDATE" -lt "$CDATE_min" ]; then print_err_msg_exit "\ - $(data_unavailable $EXTRN_MDL_NAME $EXTRN_MDL_CDATE $cdate_min min)" + $(data_unavailable $EXTRN_MDL_NAME $EXTRN_MDL_CDATE $CDATE_min min)" fi ;; @@ -209,7 +219,7 @@ esac #----------------------------------------------------------------------- # if [ $RUN_ENVIR = "nco" ]; then - export EXTRN_MDL_STAGING_DIR="${COMIN}/for_${ICS_OR_LBCS}" + export EXTRN_MDL_STAGING_DIR="${COMINext}" mkdir_vrfy -p "${EXTRN_MDL_STAGING_DIR}" else export EXTRN_MDL_STAGING_DIR="${COMIN}/${EXTRN_MDL_NAME}/for_${ICS_OR_LBCS}" diff --git a/jobs/JREGIONAL_RUN_FCST b/jobs/JREGIONAL_RUN_FCST index ab56af59a5..58a255757c 100755 --- a/jobs/JREGIONAL_RUN_FCST +++ b/jobs/JREGIONAL_RUN_FCST @@ -19,7 +19,7 @@ # . ${GLOBAL_VAR_DEFNS_FP} . $USHdir/source_util_funcs.sh -. $USHdir/job_preamble.sh +. $USHdir/job_preamble.sh "TRUE" # #----------------------------------------------------------------------- # diff --git a/modulefiles/build_macos_gnu.lua b/modulefiles/build_macos_gnu.lua index e964a26099..d92de9a4da 100644 --- a/modulefiles/build_macos_gnu.lua +++ b/modulefiles/build_macos_gnu.lua @@ -1,8 +1,6 @@ help([[ -This module needs to be customized for the user's Linux environment: +This module needs to be customized for the user's MacOS environment: specify compilers, path for HPC-stack, load the modules, set compiler and linker flags - Option 1: M1/arm64 platform, OS BigSur, Monterey (Darwin 20,21) - Option 2: Intel/x86_64 platform, OS Catalina (Darwin 19) ]]) whatis([===[Loads libraries needed for building the UFS SRW App on macos ]===]) @@ -23,48 +21,21 @@ load("hpc-gnu") load("openmpi") load("hpc-openmpi") -load("jasper/2.0.25") -load("zlib/1.2.11") - -load("hdf5/1.10.6") -load("netcdf/4.7.4") -load("pio/2.5.3") -load("esmf/8.3.0b09") -load("fms/2022.01") - -load("bacio/2.4.1") -load("crtm/2.3.0") -load("g2/3.4.3") -load("g2tmpl/1.10.0") -load("ip/3.3.3") -load("sp/2.3.3") -load("w3nco/2.4.1") -load("upp/10.0.10") - -load("gftl-shared/1.3.3") -load("yafyaml/0.5.1") -load("mapl/2.12.2-esmf-8.3.0b09") -load("gfsio/1.4.1") -load("landsfcutil/2.4.1") -load("nemsio/2.5.4") -load("nemsiogfs/2.5.3") -load("sfcio/1.4.1") -load("sigio/2.3.2") -load("w3emc/2.9.2") -load("wgrib2/2.0.8") - --- Option 1 compiler paths: -setenv("CC", "/opt/homebrew/bin/gcc") -setenv("FC", "/opt/homebrew/bin/gfortran") -setenv("CXX", "/opt/homebrew/bin/g++") - --- Option 2 compiler paths: ---[[ -setenv("CC", "/usr/local/bin/gcc") -setenv("FC", "/usr/local/bin/gfortran") -setenv("CXX", "/usr/local/bin/g++") ---]] --- +load("srw_common") + +-- MacOS with arm64 architecture: `uname -m` expands to arm64 +-- MacOS with Intel architecture: `uname -m` expands to x86_64 +local arch = 'eval $(uname -m)' +if (arch == "arm64") then + setenv("CC", "/opt/homebrew/bin/gcc") + setenv("FC", "/opt/homebrew/bin/gfortran") + setenv("CXX", "/opt/homebrew/bin/g++") +else + setenv("CC", "/usr/local/bin/gcc") + setenv("FC", "/usr/local/bin/gfortran") + setenv("CXX", "/usr/local/bin/g++") +end + -- Set MPI compilers depending on the MPI libraries built: local MPI_CC="mpicc" local MPI_CXX="mpicxx" diff --git a/modulefiles/tasks/wcoss2/get_extrn_ics.local.lua b/modulefiles/tasks/wcoss2/get_extrn_ics.local.lua index 16559474cd..3370fa018b 100644 --- a/modulefiles/tasks/wcoss2/get_extrn_ics.local.lua +++ b/modulefiles/tasks/wcoss2/get_extrn_ics.local.lua @@ -1,2 +1 @@ -load(pathJoin("intel", os.getenv("intel_ver"))) -load(pathJoin("python", os.getenv("python_ver"))) +load("python_regional_workflow") diff --git a/modulefiles/tasks/wcoss2/get_extrn_lbcs.local.lua b/modulefiles/tasks/wcoss2/get_extrn_lbcs.local.lua index 16559474cd..3370fa018b 100644 --- a/modulefiles/tasks/wcoss2/get_extrn_lbcs.local.lua +++ b/modulefiles/tasks/wcoss2/get_extrn_lbcs.local.lua @@ -1,2 +1 @@ -load(pathJoin("intel", os.getenv("intel_ver"))) -load(pathJoin("python", os.getenv("python_ver"))) +load("python_regional_workflow") diff --git a/modulefiles/tasks/wcoss2/get_obs.local.lua b/modulefiles/tasks/wcoss2/get_obs.local.lua index 16559474cd..3370fa018b 100644 --- a/modulefiles/tasks/wcoss2/get_obs.local.lua +++ b/modulefiles/tasks/wcoss2/get_obs.local.lua @@ -1,2 +1 @@ -load(pathJoin("intel", os.getenv("intel_ver"))) -load(pathJoin("python", os.getenv("python_ver"))) +load("python_regional_workflow") diff --git a/modulefiles/tasks/wcoss2/make_grid.local.lua b/modulefiles/tasks/wcoss2/make_grid.local.lua index 16559474cd..3370fa018b 100644 --- a/modulefiles/tasks/wcoss2/make_grid.local.lua +++ b/modulefiles/tasks/wcoss2/make_grid.local.lua @@ -1,2 +1 @@ -load(pathJoin("intel", os.getenv("intel_ver"))) -load(pathJoin("python", os.getenv("python_ver"))) +load("python_regional_workflow") diff --git a/modulefiles/tasks/wcoss2/make_ics.local.lua b/modulefiles/tasks/wcoss2/make_ics.local.lua index 16559474cd..3370fa018b 100644 --- a/modulefiles/tasks/wcoss2/make_ics.local.lua +++ b/modulefiles/tasks/wcoss2/make_ics.local.lua @@ -1,2 +1 @@ -load(pathJoin("intel", os.getenv("intel_ver"))) -load(pathJoin("python", os.getenv("python_ver"))) +load("python_regional_workflow") diff --git a/modulefiles/tasks/wcoss2/make_lbcs.local.lua b/modulefiles/tasks/wcoss2/make_lbcs.local.lua index 16559474cd..3370fa018b 100644 --- a/modulefiles/tasks/wcoss2/make_lbcs.local.lua +++ b/modulefiles/tasks/wcoss2/make_lbcs.local.lua @@ -1,2 +1 @@ -load(pathJoin("intel", os.getenv("intel_ver"))) -load(pathJoin("python", os.getenv("python_ver"))) +load("python_regional_workflow") diff --git a/modulefiles/tasks/wcoss2/make_sfc_climo.local.lua b/modulefiles/tasks/wcoss2/make_sfc_climo.local.lua index 16559474cd..3370fa018b 100644 --- a/modulefiles/tasks/wcoss2/make_sfc_climo.local.lua +++ b/modulefiles/tasks/wcoss2/make_sfc_climo.local.lua @@ -1,2 +1 @@ -load(pathJoin("intel", os.getenv("intel_ver"))) -load(pathJoin("python", os.getenv("python_ver"))) +load("python_regional_workflow") diff --git a/modulefiles/tasks/wcoss2/python_regional_workflow.lua b/modulefiles/tasks/wcoss2/python_regional_workflow.lua new file mode 100644 index 0000000000..519f1cdf4a --- /dev/null +++ b/modulefiles/tasks/wcoss2/python_regional_workflow.lua @@ -0,0 +1,3 @@ +load(pathJoin("intel", os.getenv("intel_ver"))) +load(pathJoin("python", os.getenv("python_ver"))) +load(pathJoin("prod_util", os.getenv("prod_util_ver"))) diff --git a/modulefiles/tasks/wcoss2/run_fcst.local.lua b/modulefiles/tasks/wcoss2/run_fcst.local.lua index 16559474cd..3370fa018b 100644 --- a/modulefiles/tasks/wcoss2/run_fcst.local.lua +++ b/modulefiles/tasks/wcoss2/run_fcst.local.lua @@ -1,2 +1 @@ -load(pathJoin("intel", os.getenv("intel_ver"))) -load(pathJoin("python", os.getenv("python_ver"))) +load("python_regional_workflow") diff --git a/modulefiles/tasks/wcoss2/run_vx.local.lua b/modulefiles/tasks/wcoss2/run_vx.local.lua index 16559474cd..3370fa018b 100644 --- a/modulefiles/tasks/wcoss2/run_vx.local.lua +++ b/modulefiles/tasks/wcoss2/run_vx.local.lua @@ -1,2 +1 @@ -load(pathJoin("intel", os.getenv("intel_ver"))) -load(pathJoin("python", os.getenv("python_ver"))) +load("python_regional_workflow") diff --git a/modulefiles/wflow_macos.lua b/modulefiles/wflow_macos.lua index d1425197ad..769f1bc05e 100644 --- a/modulefiles/wflow_macos.lua +++ b/modulefiles/wflow_macos.lua @@ -1,11 +1,11 @@ help([[ -This module activates python environement for running the UFS SRW App on general macOS +This module set a path needed to activate conda environement for running UFS SRW App on general macOS ]]) -whatis([===[This module activates python environment for running the UFS SRW App on macOS]===]) +whatis([===[This module activates conda environment for running the UFS SRW App on macOS]===]) setenv("CMAKE_Platform", "macos") -setenv("VENV", pathJoin(os.getenv("HOME"), "venv/regional_workflow")) +setenv("VENV", pathJoin(os.getenv("HOME"), "condaenv/envs/regional_workflow")) --[[ local ROCOTOmod="/Users/username/modules" @@ -14,13 +14,8 @@ load(rocoto) --]] if mode() == "load" then - LmodMsgRaw([===[Verify the Python virtual environment path \$VENV shown below is correct, " -set to the correct path otherwise: " -VENV=$env(VENV) " -Please do the following to activate python virtual environment: - > source \$VENV/bin/activate " + LmodMsgRaw([===[Please do the following to activate conda virtual environment: + > conda activate $VENV " ]===]) end -if mode() == "unload" then - execute{cmd="deactivate", modeA={"unload"}} -end + diff --git a/parm/FV3LAM_wflow.xml b/parm/FV3LAM_wflow.xml index e1696ae5a8..97d2f1a700 100644 --- a/parm/FV3LAM_wflow.xml +++ b/parm/FV3LAM_wflow.xml @@ -90,25 +90,26 @@ specifies the number of processes per node being used (the PPN_... entities). - - + + + {%- if run_envir == "nco" %} {%- if do_ensemble %} -{{ run }}.@Y@m@d/{{ net }}.t@Hz.{{ ensmem_indx_name }}#{{ ensmem_indx_name }}#.dyn"> -{{ run }}.@Y@m@d/{{ net }}.t@Hz.{{ ensmem_indx_name }}#{{ ensmem_indx_name }}#.phy"> +@Y@m@d@H/dyn"> +@Y@m@d@H/phy"> {%- else %} -{{ run }}.@Y@m@d/{{ net }}.t@Hz.dyn"> -{{ run }}.@Y@m@d/{{ net }}.t@Hz.phy"> +@Y@m@d@H/dyn"> +@Y@m@d@H/phy"> {%- endif %} {%- else %} -@Y@m@d@H{{ slash_ensmem_subdir }}/dyn"> -@Y@m@d@H{{ slash_ensmem_subdir }}/phy"> +@Y@m@d@H{{ slash_ensmem_subdir }}/dyn"> +@Y@m@d@H{{ slash_ensmem_subdir }}/phy"> {%- endif %} {%- if run_envir == "nco" %} @@ -301,9 +302,14 @@ MODULES_RUN_TASK_FP script. &RSRV_HPSS; &LOAD_MODULES_RUN_TASK_FP; "&GET_EXTRN_ICS_TN;" "&JOBSdir;/JREGIONAL_GET_EXTRN_MDL_FILES" {{ nnodes_get_extrn_ics }}:ppn={{ ppn_get_extrn_ics }} + {%- if machine not in ["GAEA"] %} + {{ mem_get_extrn_ics }} + {%- endif %} {{ wtime_get_extrn_ics }} &NCORES_PER_NODE; + {%- if machine not in ["WCOSS2"] %} &SCHED_NATIVE_CMD; + {%- endif %} &GET_EXTRN_ICS_TN; &LOGDIR;/&GET_EXTRN_ICS_TN;_@Y@m@d@H&LOGEXT; @@ -326,9 +332,14 @@ MODULES_RUN_TASK_FP script. &RSRV_HPSS; &LOAD_MODULES_RUN_TASK_FP; "&GET_EXTRN_LBCS_TN;" "&JOBSdir;/JREGIONAL_GET_EXTRN_MDL_FILES" {{ nnodes_get_extrn_lbcs }}:ppn={{ ppn_get_extrn_lbcs }} + {%- if machine not in ["GAEA"] %} + {{ mem_get_extrn_lbcs }} + {%- endif %} {{ wtime_get_extrn_lbcs }} &NCORES_PER_NODE; + {%- if machine not in ["WCOSS2"] %} &SCHED_NATIVE_CMD; + {%- endif %} &GET_EXTRN_LBCS_TN; &LOGDIR;/&GET_EXTRN_LBCS_TN;_@Y@m@d@H&LOGEXT; @@ -745,6 +756,9 @@ the tag to be identical to the ones above for other output times. &RSRV_HPSS; &LOAD_MODULES_RUN_TASK_FP; "&GET_OBS;" "&JOBSdir;/JREGIONAL_GET_OBS_CCPA" {{ nnodes_get_obs_ccpa }}:ppn={{ ppn_get_obs_ccpa }} + {%- if machine not in ["GAEA"] %} + {{ mem_get_obs_ccpa }} + {%- endif %} {{ wtime_get_obs_ccpa }} &NCORES_PER_NODE; &SCHED_NATIVE_CMD; @@ -773,6 +787,9 @@ the tag to be identical to the ones above for other output times. &RSRV_HPSS; &LOAD_MODULES_RUN_TASK_FP; "&GET_OBS;" "&JOBSdir;/JREGIONAL_GET_OBS_MRMS" {{ nnodes_get_obs_mrms }}:ppn={{ ppn_get_obs_mrms }} + {%- if machine not in ["GAEA"] %} + {{ mem_get_obs_mrms }} + {%- endif %} {{ wtime_get_obs_mrms }} &NCORES_PER_NODE; &SCHED_NATIVE_CMD; @@ -802,6 +819,9 @@ the tag to be identical to the ones above for other output times. &RSRV_HPSS; &LOAD_MODULES_RUN_TASK_FP; "&GET_OBS;" "&JOBSdir;/JREGIONAL_GET_OBS_NDAS" {{ nnodes_get_obs_ndas }}:ppn={{ ppn_get_obs_ndas }} + {%- if machine not in ["GAEA"] %} + {{ mem_get_obs_ndas }} + {%- endif %} {{ wtime_get_obs_ndas }} &NCORES_PER_NODE; &SCHED_NATIVE_CMD; @@ -829,6 +849,9 @@ the tag to be identical to the ones above for other output times. &RSRV_DEFAULT; &LOAD_MODULES_RUN_TASK_FP; "&VX_TN;" "&JOBSdir;/JREGIONAL_RUN_VX_GRIDSTAT" {{ nnodes_vx_gridstat }}:ppn={{ ppn_vx_gridstat }} + {%- if machine not in ["GAEA"] %} + {{ mem_vx_gridstat }} + {%- endif %} {{ wtime_vx_gridstat }} &NCORES_PER_NODE; &SCHED_NATIVE_CMD; @@ -881,6 +904,9 @@ the tag to be identical to the ones above for other output times. &RSRV_DEFAULT; &LOAD_MODULES_RUN_TASK_FP; "&VX_TN;" "&JOBSdir;/JREGIONAL_RUN_VX_GRIDSTAT" {{ nnodes_vx_gridstat }}:ppn={{ ppn_vx_gridstat }} + {%- if machine not in ["GAEA"] %} + {{ mem_vx_gridstat }} + {%- endif %} {{ wtime_vx_gridstat }} &NCORES_PER_NODE; &SCHED_NATIVE_CMD; @@ -932,6 +958,9 @@ the tag to be identical to the ones above for other output times. &RSRV_DEFAULT; &LOAD_MODULES_RUN_TASK_FP; "&VX_TN;" "&JOBSdir;/JREGIONAL_RUN_VX_GRIDSTAT" {{ nnodes_vx_gridstat }}:ppn={{ ppn_vx_gridstat }} + {%- if machine not in ["GAEA"] %} + {{ mem_vx_gridstat }} + {%- endif %} {{ wtime_vx_gridstat }} &NCORES_PER_NODE; &SCHED_NATIVE_CMD; @@ -983,6 +1012,9 @@ the tag to be identical to the ones above for other output times. &RSRV_DEFAULT; &LOAD_MODULES_RUN_TASK_FP; "&VX_TN;" "&JOBSdir;/JREGIONAL_RUN_VX_GRIDSTAT" {{ nnodes_vx_gridstat }}:ppn={{ ppn_vx_gridstat }} + {%- if machine not in ["GAEA"] %} + {{ mem_vx_gridstat }} + {%- endif %} {{ wtime_vx_gridstat }} &NCORES_PER_NODE; &SCHED_NATIVE_CMD; @@ -1020,6 +1052,9 @@ the tag to be identical to the ones above for other output times. &RSRV_DEFAULT; &LOAD_MODULES_RUN_TASK_FP; "&VX_TN;" "&JOBSdir;/JREGIONAL_RUN_VX_GRIDSTAT" {{ nnodes_vx_gridstat }}:ppn={{ ppn_vx_gridstat }} + {%- if machine not in ["GAEA"] %} + {{ mem_vx_gridstat }} + {%- endif %} {{ wtime_vx_gridstat }} &NCORES_PER_NODE; &SCHED_NATIVE_CMD; @@ -1057,6 +1092,9 @@ the tag to be identical to the ones above for other output times. &RSRV_DEFAULT; &LOAD_MODULES_RUN_TASK_FP; "&VX_TN;" "&JOBSdir;/JREGIONAL_RUN_VX_GRIDSTAT" {{ nnodes_vx_gridstat }}:ppn={{ ppn_vx_gridstat }} + {%- if machine not in ["GAEA"] %} + {{ mem_vx_gridstat }} + {%- endif %} {{ wtime_vx_gridstat }} &NCORES_PER_NODE; &SCHED_NATIVE_CMD; @@ -1094,6 +1132,9 @@ the tag to be identical to the ones above for other output times. &LOAD_MODULES_RUN_TASK_FP; "&VX_TN;" "&JOBSdir;/JREGIONAL_RUN_VX_POINTSTAT" {{ nnodes_vx_pointstat }}:ppn={{ ppn_vx_pointstat }} + {%- if machine not in ["GAEA"] %} + {{ mem_vx_pointstat }} + {%- endif %} {{ wtime_vx_pointstat }} &NCORES_PER_NODE; &SCHED_NATIVE_CMD; @@ -1148,6 +1189,9 @@ the tag to be identical to the ones above for other output times. &RSRV_DEFAULT; &LOAD_MODULES_RUN_TASK_FP; "&VX_TN;" "&JOBSdir;/JREGIONAL_RUN_VX_ENSGRID" {{ nnodes_vx_ensgrid }}:ppn={{ ppn_vx_ensgrid }} + {%- if machine not in ["GAEA"] %} + {{ mem_vx_ensgrid }} + {%- endif %} {{ wtime_vx_ensgrid }} &NCORES_PER_NODE; &SCHED_NATIVE_CMD; @@ -1181,6 +1225,9 @@ the tag to be identical to the ones above for other output times. &RSRV_DEFAULT; &LOAD_MODULES_RUN_TASK_FP; "&VX_TN;" "&JOBSdir;/JREGIONAL_RUN_VX_ENSGRID" {{ nnodes_vx_ensgrid }}:ppn={{ ppn_vx_ensgrid }} + {%- if machine not in ["GAEA"] %} + {{ mem_vx_ensgrid }} + {%- endif %} {{ wtime_vx_ensgrid }} &NCORES_PER_NODE; &SCHED_NATIVE_CMD; @@ -1214,6 +1261,9 @@ the tag to be identical to the ones above for other output times. &RSRV_DEFAULT; &LOAD_MODULES_RUN_TASK_FP; "&VX_TN;" "&JOBSdir;/JREGIONAL_RUN_VX_ENSGRID" {{ nnodes_vx_ensgrid }}:ppn={{ ppn_vx_ensgrid }} + {%- if machine not in ["GAEA"] %} + {{ mem_vx_ensgrid }} + {%- endif %} {{ wtime_vx_ensgrid }} &NCORES_PER_NODE; &SCHED_NATIVE_CMD; @@ -1247,6 +1297,9 @@ the tag to be identical to the ones above for other output times. &RSRV_DEFAULT; &LOAD_MODULES_RUN_TASK_FP; "&VX_TN;" "&JOBSdir;/JREGIONAL_RUN_VX_ENSGRID" {{ nnodes_vx_ensgrid }}:ppn={{ ppn_vx_ensgrid }} + {%- if machine not in ["GAEA"] %} + {{ mem_vx_ensgrid }} + {%- endif %} {{ wtime_vx_ensgrid }} &NCORES_PER_NODE; &SCHED_NATIVE_CMD; @@ -1279,6 +1332,9 @@ the tag to be identical to the ones above for other output times. &RSRV_DEFAULT; &LOAD_MODULES_RUN_TASK_FP; "&VX_TN;" "&JOBSdir;/JREGIONAL_RUN_VX_ENSGRID" {{ nnodes_vx_ensgrid }}:ppn={{ ppn_vx_ensgrid }} + {%- if machine not in ["GAEA"] %} + {{ mem_vx_ensgrid }} + {%- endif %} {{ wtime_vx_ensgrid }} &NCORES_PER_NODE; &SCHED_NATIVE_CMD; @@ -1310,6 +1366,9 @@ the tag to be identical to the ones above for other output times. &RSRV_DEFAULT; &LOAD_MODULES_RUN_TASK_FP; "&VX_TN;" "&JOBSdir;/JREGIONAL_RUN_VX_ENSGRID" {{ nnodes_vx_ensgrid }}:ppn={{ ppn_vx_ensgrid }} + {%- if machine not in ["GAEA"] %} + {{ mem_vx_ensgrid }} + {%- endif %} {{ wtime_vx_ensgrid }} &NCORES_PER_NODE; &SCHED_NATIVE_CMD; @@ -1340,6 +1399,9 @@ the tag to be identical to the ones above for other output times. &RSRV_DEFAULT; &LOAD_MODULES_RUN_TASK_FP; "&VX_TN;" "&JOBSdir;/JREGIONAL_RUN_VX_ENSGRID_MEAN" {{ nnodes_vx_ensgrid_mean }}:ppn={{ ppn_vx_ensgrid_mean }} + {%- if machine not in ["GAEA"] %} + {{ mem_vx_ensgrid_mean }} + {%- endif %} {{ wtime_vx_ensgrid_mean }} &NCORES_PER_NODE; &SCHED_NATIVE_CMD; @@ -1372,6 +1434,9 @@ the tag to be identical to the ones above for other output times. &RSRV_DEFAULT; &LOAD_MODULES_RUN_TASK_FP; "&VX_TN;" "&JOBSdir;/JREGIONAL_RUN_VX_ENSGRID_PROB" {{ nnodes_vx_ensgrid_prob }}:ppn={{ ppn_vx_ensgrid_prob }} + {%- if machine not in ["GAEA"] %} + {{ mem_vx_ensgrid_prob }} + {%- endif %} {{ wtime_vx_ensgrid_prob }} &NCORES_PER_NODE; &SCHED_NATIVE_CMD; @@ -1404,6 +1469,9 @@ the tag to be identical to the ones above for other output times. &RSRV_DEFAULT; &LOAD_MODULES_RUN_TASK_FP; "&VX_TN;" "&JOBSdir;/JREGIONAL_RUN_VX_ENSGRID_MEAN" {{ nnodes_vx_ensgrid_mean }}:ppn={{ ppn_vx_ensgrid_mean }} + {%- if machine not in ["GAEA"] %} + {{ mem_vx_ensgrid_mean }} + {%- endif %} {{ wtime_vx_ensgrid_mean }} &NCORES_PER_NODE; &SCHED_NATIVE_CMD; @@ -1436,6 +1504,9 @@ the tag to be identical to the ones above for other output times. &RSRV_DEFAULT; &LOAD_MODULES_RUN_TASK_FP; "&VX_TN;" "&JOBSdir;/JREGIONAL_RUN_VX_ENSGRID_PROB" {{ nnodes_vx_ensgrid_prob }}:ppn={{ ppn_vx_ensgrid_prob }} + {%- if machine not in ["GAEA"] %} + {{ mem_vx_ensgrid_prob }} + {%- endif %} {{ wtime_vx_ensgrid_prob }} &NCORES_PER_NODE; &SCHED_NATIVE_CMD; @@ -1469,6 +1540,9 @@ the tag to be identical to the ones above for other output times. &RSRV_DEFAULT; &LOAD_MODULES_RUN_TASK_FP; "&VX_TN;" "&JOBSdir;/JREGIONAL_RUN_VX_ENSGRID_MEAN" {{ nnodes_vx_ensgrid_mean }}:ppn={{ ppn_vx_ensgrid_mean }} + {%- if machine not in ["GAEA"] %} + {{ mem_vx_ensgrid_mean }} + {%- endif %} {{ wtime_vx_ensgrid_mean }} &NCORES_PER_NODE; &SCHED_NATIVE_CMD; @@ -1501,6 +1575,9 @@ the tag to be identical to the ones above for other output times. &RSRV_DEFAULT; &LOAD_MODULES_RUN_TASK_FP; "&VX_TN;" "&JOBSdir;/JREGIONAL_RUN_VX_ENSGRID_PROB" {{ nnodes_vx_ensgrid_prob }}:ppn={{ ppn_vx_ensgrid_prob }} + {%- if machine not in ["GAEA"] %} + {{ mem_vx_ensgrid_prob }} + {%- endif %} {{ wtime_vx_ensgrid_prob }} &NCORES_PER_NODE; &SCHED_NATIVE_CMD; @@ -1534,6 +1611,9 @@ the tag to be identical to the ones above for other output times. &RSRV_DEFAULT; &LOAD_MODULES_RUN_TASK_FP; "&VX_TN;" "&JOBSdir;/JREGIONAL_RUN_VX_ENSGRID_MEAN" {{ nnodes_vx_ensgrid_mean }}:ppn={{ ppn_vx_ensgrid_mean }} + {%- if machine not in ["GAEA"] %} + {{ mem_vx_ensgrid_mean }} + {%- endif %} {{ wtime_vx_ensgrid_mean }} &NCORES_PER_NODE; &SCHED_NATIVE_CMD; @@ -1566,6 +1646,9 @@ the tag to be identical to the ones above for other output times. &RSRV_DEFAULT; &LOAD_MODULES_RUN_TASK_FP; "&VX_TN;" "&JOBSdir;/JREGIONAL_RUN_VX_ENSGRID_PROB" {{ nnodes_vx_ensgrid_prob }}:ppn={{ ppn_vx_ensgrid_prob }} + {%- if machine not in ["GAEA"] %} + {{ mem_vx_ensgrid_prob }} + {%- endif %} {{ wtime_vx_ensgrid_prob }} &NCORES_PER_NODE; &SCHED_NATIVE_CMD; @@ -1598,6 +1681,9 @@ the tag to be identical to the ones above for other output times. &RSRV_DEFAULT; &LOAD_MODULES_RUN_TASK_FP; "&VX_TN;" "&JOBSdir;/JREGIONAL_RUN_VX_ENSGRID_PROB" {{ nnodes_vx_ensgrid_prob }}:ppn={{ ppn_vx_ensgrid_prob }} + {%- if machine not in ["GAEA"] %} + {{ mem_vx_ensgrid_prob }} + {%- endif %} {{ wtime_vx_ensgrid_prob }} &NCORES_PER_NODE; &SCHED_NATIVE_CMD; @@ -1629,6 +1715,9 @@ the tag to be identical to the ones above for other output times. &RSRV_DEFAULT; &LOAD_MODULES_RUN_TASK_FP; "&VX_TN;" "&JOBSdir;/JREGIONAL_RUN_VX_ENSGRID_PROB" {{ nnodes_vx_ensgrid_prob }}:ppn={{ ppn_vx_ensgrid_prob }} + {%- if machine not in ["GAEA"] %} + {{ mem_vx_ensgrid_prob }} + {%- endif %} {{ wtime_vx_ensgrid_prob }} &NCORES_PER_NODE; &SCHED_NATIVE_CMD; @@ -1661,6 +1750,9 @@ the tag to be identical to the ones above for other output times. &RSRV_DEFAULT; &LOAD_MODULES_RUN_TASK_FP; "&VX_TN;" "&JOBSdir;/JREGIONAL_RUN_VX_ENSPOINT" {{ nnodes_vx_enspoint }}:ppn={{ ppn_vx_enspoint }} + {%- if machine not in ["GAEA"] %} + {{ mem_vx_enspoint }} + {%- endif %} {{ wtime_vx_enspoint }} &NCORES_PER_NODE; &SCHED_NATIVE_CMD; @@ -1690,6 +1782,9 @@ the tag to be identical to the ones above for other output times. &RSRV_DEFAULT; &LOAD_MODULES_RUN_TASK_FP; "&VX_TN;" "&JOBSdir;/JREGIONAL_RUN_VX_ENSPOINT_MEAN" {{ nnodes_vx_enspoint_mean }}:ppn={{ ppn_vx_enspoint_mean }} + {%- if machine not in ["GAEA"] %} + {{ mem_vx_enspoint_mean }} + {%- endif %} {{ wtime_vx_enspoint_mean }} &NCORES_PER_NODE; &SCHED_NATIVE_CMD; @@ -1719,6 +1814,9 @@ the tag to be identical to the ones above for other output times. &RSRV_DEFAULT; &LOAD_MODULES_RUN_TASK_FP; "&VX_TN;" "&JOBSdir;/JREGIONAL_RUN_VX_ENSPOINT_PROB" {{ nnodes_vx_enspoint_prob }}:ppn={{ ppn_vx_enspoint_prob }} + {%- if machine not in ["GAEA"] %} + {{ mem_vx_enspoint_prob }} + {%- endif %} {{ wtime_vx_enspoint_prob }} &NCORES_PER_NODE; &SCHED_NATIVE_CMD; diff --git a/parm/data_locations.yml b/parm/data_locations.yml index 067708f99f..8297ac975a 100644 --- a/parm/data_locations.yml +++ b/parm/data_locations.yml @@ -64,17 +64,20 @@ FV3GFS: - gfs.t{hh}z.sfcanl.nemsio fcst: - gfs.t{hh}z.atmf{fcst_hr:03d}.nemsio + - gfs.t{hh}z.sfcf{fcst_hr:03d}.nemsio netcdf: anl: - gfs.t{hh}z.atmanl.nc - gfs.t{hh}z.sfcanl.nc fcst: - gfs.t{hh}z.atmf{fcst_hr:03d}.nc + - gfs.t{hh}z.sfcf{fcst_hr:03d}.nc hpss: protocol: htar archive_path: - /NCEPPROD/hpssprod/runhistory/rh{yyyy}/{yyyymm}/{yyyymmdd} - /NCEPPROD/hpssprod/runhistory/rh{yyyy}/{yyyymm}/{yyyymmdd} + - /NCEPPROD/hpssprod/runhistory/rh{yyyy}/{yyyymm}/{yyyymmdd} archive_internal_dir: - ./gfs.{yyyymmdd}/{hh} - ./gfs.{yyyymmdd}/{hh}/atmos @@ -83,9 +86,11 @@ FV3GFS: anl: - gpfs_dell1_nco_ops_com_gfs_prod_gfs.{yyyymmdd}_{hh}.gfs_pgrb2.tar - com_gfs_prod_gfs.{yyyymmdd}_{hh}.gfs_pgrb2.tar + - com_gfs_v16.2_gfs.{yyyymmdd}_{hh}.gfs_pgrb2.tar fcst: - gpfs_dell1_nco_ops_com_gfs_prod_gfs.{yyyymmdd}_{hh}.gfs_pgrb2.tar - com_gfs_prod_gfs.{yyyymmdd}_{hh}.gfs_pgrb2.tar + - com_gfs_v16.2_gfs.{yyyymmdd}_{hh}.gfs_pgrb2.tar nemsio: anl: - gpfs_dell1_nco_ops_com_gfs_prod_gfs.{yyyymmdd}_{hh}.gfs_nemsioa.tar @@ -97,9 +102,11 @@ FV3GFS: anl: - gpfs_dell1_nco_ops_com_gfs_prod_gfs.{yyyymmdd}_{hh}.gfs_nca.tar - com_gfs_prod_gfs.{yyyymmdd}_{hh}.gfs_nca.tar + - com_gfs_v16.2_gfs.{yyyymmdd}_{hh}.gfs_nca.tar fcst: - ['gpfs_dell1_nco_ops_com_gfs_prod_gfs.{yyyymmdd}_{hh}.gfs_nca.tar', 'gpfs_dell1_nco_ops_com_gfs_prod_gfs.{yyyymmdd}_{hh}.gfs_ncb.tar'] - ['com_gfs_prod_gfs.{yyyymmdd}_{hh}.gfs_nca.tar', 'com_gfs_prod_gfs.{yyyymmdd}_{hh}.gfs_ncb.tar'] + - ['com_gfs_v16.2_gfs.{yyyymmdd}_{hh}.gfs_nca.tar', 'com_gfs_v16.2_gfs.{yyyymmdd}_{hh}.gfs_ncb.tar'] file_names: <<: *gfs_file_names aws: diff --git a/scripts/exregional_get_extrn_mdl_files.sh b/scripts/exregional_get_extrn_mdl_files.sh index 6032123020..6a7eaa90b2 100755 --- a/scripts/exregional_get_extrn_mdl_files.sh +++ b/scripts/exregional_get_extrn_mdl_files.sh @@ -90,8 +90,19 @@ mm=${yyyymmddhh:4:2} dd=${yyyymmddhh:6:2} hh=${yyyymmddhh:8:2} - +# +#----------------------------------------------------------------------- +# +# if path has space in between it is a command, otherwise +# treat it as a template path +# +#----------------------------------------------------------------------- +# input_file_path=$(eval echo ${input_file_path}) +if [[ $input_file_path = *" "* ]]; then + input_file_path=$(eval ${input_file_path}) +fi + # #----------------------------------------------------------------------- # @@ -118,6 +129,10 @@ if [ -n "${input_file_path:-}" ] ; then --input_file_path ${input_file_path}" fi +if [ $SYMLINK_FIX_FILES = "TRUE" ]; then + additional_flags="$additional_flags \ + --symlink" +fi # #----------------------------------------------------------------------- # @@ -139,6 +154,7 @@ python3 -u ${USHdir}/retrieve_data.py \ --data_stores ${data_stores} \ --external_model ${EXTRN_MDL_NAME} \ --fcst_hrs ${fcst_hrs[@]} \ + --ics_or_lbcs ${ICS_OR_LBCS} \ --output_path ${EXTRN_MDL_STAGING_DIR} \ --summary_file ${EXTRN_DEFNS} \ $additional_flags" diff --git a/scripts/exregional_make_ics.sh b/scripts/exregional_make_ics.sh index 4a242a1183..b1564dcad3 100755 --- a/scripts/exregional_make_ics.sh +++ b/scripts/exregional_make_ics.sh @@ -86,7 +86,7 @@ fi #----------------------------------------------------------------------- # if [ $RUN_ENVIR = "nco" ]; then - extrn_mdl_staging_dir="${COMIN}/for_ICS" + extrn_mdl_staging_dir="${COMINext}" extrn_mdl_var_defns_fp="${extrn_mdl_staging_dir}/${NET}.${cycle}.${EXTRN_MDL_NAME_ICS}.ICS.${EXTRN_MDL_VAR_DEFNS_FN}.sh" else extrn_mdl_staging_dir="${COMIN}/${EXTRN_MDL_NAME_ICS}/for_ICS" @@ -593,16 +593,6 @@ mv_vrfy gfs.bndy.nc ${INPUT_DATA}/${NET}.${cycle}${dot_ensmem}.gfs_bndy.tile${TI # #----------------------------------------------------------------------- # -# Clean up the external model data files in NCO mode -# -#----------------------------------------------------------------------- -# -if [ "${RUN_ENVIR}" = "nco" ]; then - rm_vrfy -rf ${extrn_mdl_staging_dir} -fi -# -#----------------------------------------------------------------------- -# # Process FVCOM Data # #----------------------------------------------------------------------- diff --git a/scripts/exregional_make_lbcs.sh b/scripts/exregional_make_lbcs.sh index 89d0eab094..0fa7a0a246 100755 --- a/scripts/exregional_make_lbcs.sh +++ b/scripts/exregional_make_lbcs.sh @@ -84,7 +84,7 @@ fi #----------------------------------------------------------------------- # if [ $RUN_ENVIR = "nco" ]; then - extrn_mdl_staging_dir="${COMIN}/for_LBCS" + extrn_mdl_staging_dir="${COMINext}" extrn_mdl_var_defns_fp="${extrn_mdl_staging_dir}/${NET}.${cycle}.${EXTRN_MDL_NAME_LBCS}.LBCS.${EXTRN_MDL_VAR_DEFNS_FN}.sh" else extrn_mdl_staging_dir="${COMIN}/${EXTRN_MDL_NAME_LBCS}/for_LBCS" @@ -500,16 +500,6 @@ done # #----------------------------------------------------------------------- # -# Clean up the external model data files in NCO mode -# -#----------------------------------------------------------------------- -# -if [ "${RUN_ENVIR}" = "nco" ]; then - rm_vrfy -rf ${extrn_mdl_staging_dir} -fi -# -#----------------------------------------------------------------------- -# # Print message indicating successful completion of script. # #----------------------------------------------------------------------- diff --git a/scripts/exregional_run_fcst.sh b/scripts/exregional_run_fcst.sh index 2bf946a9f6..67bf7b18c3 100755 --- a/scripts/exregional_run_fcst.sh +++ b/scripts/exregional_run_fcst.sh @@ -471,34 +471,6 @@ Call to function to create a diag table file for the current cycle's # #----------------------------------------------------------------------- # -# Pre-generate symlinks to forecast output in DATA pointing to DATA_SHARED -# -#----------------------------------------------------------------------- -# -if [ "${RUN_ENVIR}" = "nco" ]; then - - # first set suffix for minutes and seconds of forecast time - mnts_secs_str="" - if [ "${SUB_HOURLY_POST}" = "TRUE" ]; then - if [ ${fhr}${fmn} = "00000" ]; then - mnts_secs_str=":"$( $DATE_UTIL --utc --date "${yyyymmdd} ${hh} UTC + ${dt_atmos} seconds" "+%M:%S" ) - else - mnts_secs_str=":${fmn}:00" - fi - fi - - # create the symlinks - for fhr in $(seq -f "%03g" 0 ${FCST_LEN_HRS}); do - ln_vrfy -sf "${DATA_SHARED}/${NET}.${cycle}${dot_ensmem}.dyn.f${fhr}${mnts_secs_str}.nc" "dynf${fhr}${mnts_secs_str}.nc" - ln_vrfy -sf "${DATA_SHARED}/${NET}.${cycle}${dot_ensmem}.phy.f${fhr}${mnts_secs_str}.nc" "phyf${fhr}${mnts_secs_str}.nc" - done - - # create an intermediate symlink to RESTART - ln_vrfy -sf "${DATA}/RESTART" "${COMIN}/RESTART" -fi -# -#----------------------------------------------------------------------- -# # Run the FV3-LAM model. Note that we have to launch the forecast from # the current cycle's directory because the FV3 executable will look for # input files in the current directory. Since those files have been @@ -515,21 +487,6 @@ POST_STEP # #----------------------------------------------------------------------- # -# Move RESTART directory to COMIN and create symlink in DATA only for -# NCO mode and when it is not empty. -# -#----------------------------------------------------------------------- -# -if [ "${RUN_ENVIR}" = "nco" ]; then - rm_vrfy -rf "${COMIN}/RESTART" - if [ "$(ls -A RESTART)" ]; then - mv_vrfy RESTART ${COMIN} - ln_vrfy -sf ${COMIN}/RESTART ${DATA}/RESTART - fi -fi -# -#----------------------------------------------------------------------- -# # If doing inline post, create the directory in which the post-processing # output will be stored (postprd_dir). # diff --git a/scripts/exregional_run_post.sh b/scripts/exregional_run_post.sh index 2c18754c09..2b950a9421 100755 --- a/scripts/exregional_run_post.sh +++ b/scripts/exregional_run_post.sh @@ -166,13 +166,13 @@ fi # # Set the names of the forecast model's write-component output files. # -if [ "${RUN_ENVIR}" != "nco" ]; then - dyn_file="${DATA}/dynf${fhr}${mnts_secs_str}.nc" - phy_file="${DATA}/phyf${fhr}${mnts_secs_str}.nc" +if [ "${RUN_ENVIR}" = "nco" ]; then + DATAFCST=$DATAROOT/run_fcst${dot_ensmem/./_}.${share_pid} else - dyn_file="${DATA_SHARED}/${NET}.${cycle}${dot_ensmem}.dyn.f${fhr}${mnts_secs_str}.nc" - phy_file="${DATA_SHARED}/${NET}.${cycle}${dot_ensmem}.phy.f${fhr}${mnts_secs_str}.nc" + DATAFCST=$DATA fi +dyn_file="${DATAFCST}/dynf${fhr}${mnts_secs_str}.nc" +phy_file="${DATAFCST}/phyf${fhr}${mnts_secs_str}.nc" # # Set parameters that specify the actual time (not forecast time) of the # output. @@ -291,6 +291,12 @@ for fid in "${fids[@]}"; do done rm_vrfy -rf ${DATA_FHR} + +# Delete the forecast directory +fhr_l=$(printf "%03d" $FCST_LEN_HRS) +if [ $RUN_ENVIR = "nco" ] && [ $KEEPDATA = "FALSE" ] && [ $fhr = $fhr_l ]; then + rm -rf $DATAFCST +fi # #----------------------------------------------------------------------- # diff --git a/sorc/CMakeLists.txt b/sorc/CMakeLists.txt index 2ae9b66e83..9cfeb4604e 100644 --- a/sorc/CMakeLists.txt +++ b/sorc/CMakeLists.txt @@ -35,7 +35,7 @@ endif() # Build UFS weather model if (BUILD_UFS) - list(APPEND TARGET_LIST UFS) + list(APPEND TARGET_LIST ufs-weather-model) if(NOT CCPP_SUITES) set(CCPP_SUITES "FV3_GFS_2017_gfdlmp,FV3_GFS_2017_gfdlmp_regional,FV3_GFS_v15p2,FV3_GFS_v16,FV3_RRFS_v1beta,FV3_HRRR,FV3_GFS_v15_thompson_mynn_lam3km,FV3_WoFS_v0") diff --git a/tests/WE2E/machine_suites/fundamental.cheyenne b/tests/WE2E/machine_suites/fundamental.cheyenne new file mode 100644 index 0000000000..9158a03326 --- /dev/null +++ b/tests/WE2E/machine_suites/fundamental.cheyenne @@ -0,0 +1,9 @@ +grid_RRFS_CONUScompact_13km_ics_HRRR_lbcs_RAP_suite_HRRR +grid_RRFS_CONUS_25km_ics_NAM_lbcs_NAM_suite_HRRR +specify_RESTART_INTERVAL +specify_template_filenames +grid_SUBCONUS_Ind_3km_ics_HRRR_lbcs_RAP_suite_HRRR +grid_RRFS_CONUScompact_25km_ics_HRRR_lbcs_RAP_suite_RRFS_v1beta +pregen_grid_orog_sfc_climo +custom_GFDLgrid__GFDLgrid_USE_NUM_CELLS_IN_FILENAMES_eq_FALSE +custom_GFDLgrid__GFDLgrid_USE_NUM_CELLS_IN_FILENAMES_eq_TRUE diff --git a/tests/WE2E/machine_suites/fundamental.cheyenne.gnu b/tests/WE2E/machine_suites/fundamental.cheyenne.gnu new file mode 100644 index 0000000000..5cb49719b6 --- /dev/null +++ b/tests/WE2E/machine_suites/fundamental.cheyenne.gnu @@ -0,0 +1,5 @@ +grid_CONUS_25km_GFDLgrid_ics_FV3GFS_lbcs_FV3GFS_suite_GFS_v16 +grid_RRFS_CONUS_25km_ics_FV3GFS_lbcs_FV3GFS_suite_HRRR +grid_RRFS_CONUS_25km_ics_FV3GFS_lbcs_FV3GFS_suite_RRFS_v1beta +grid_RRFS_CONUScompact_25km_ics_FV3GFS_lbcs_FV3GFS_suite_GFS_v16 +grid_RRFS_NA_13km_ics_FV3GFS_lbcs_FV3GFS_suite_RRFS_v1beta diff --git a/tests/WE2E/machine_suites/fundamental.gaea b/tests/WE2E/machine_suites/fundamental.gaea new file mode 100644 index 0000000000..2c079bb14b --- /dev/null +++ b/tests/WE2E/machine_suites/fundamental.gaea @@ -0,0 +1,9 @@ +grid_RRFS_CONUScompact_13km_ics_HRRR_lbcs_RAP_suite_RRFS_v1beta +grid_RRFS_CONUS_13km_ics_FV3GFS_lbcs_FV3GFS_suite_RRFS_v1beta +grid_RRFS_CONUS_13km_ics_FV3GFS_lbcs_FV3GFS_suite_GFS_v15p2 +grid_RRFS_CONUS_13km_ics_FV3GFS_lbcs_FV3GFS_suite_GFS_v16 +grid_RRFS_CONUS_13km_ics_FV3GFS_lbcs_FV3GFS_suite_HRRR +grid_RRFS_CONUScompact_25km_ics_HRRR_lbcs_HRRR_suite_HRRR +grid_RRFS_CONUScompact_25km_ics_HRRR_lbcs_HRRR_suite_RRFS_v1beta +nco_ensemble +grid_SUBCONUS_Ind_3km_ics_HRRR_lbcs_RAP_suite_RRFS_v1beta diff --git a/tests/WE2E/machine_suites/fundamental.hera.nco b/tests/WE2E/machine_suites/fundamental.hera.nco new file mode 100644 index 0000000000..6493f676ba --- /dev/null +++ b/tests/WE2E/machine_suites/fundamental.hera.nco @@ -0,0 +1,10 @@ +grid_RRFS_CONUS_25km_ics_FV3GFS_lbcs_FV3GFS_suite_GFS_v15p2 +grid_RRFS_CONUS_25km_ics_FV3GFS_lbcs_FV3GFS_suite_GFS_v16 +grid_RRFS_CONUS_25km_ics_FV3GFS_lbcs_RAP_suite_HRRR +grid_RRFS_CONUS_25km_ics_GSMGFS_lbcs_GSMGFS_suite_GFS_v15p2 +grid_RRFS_CONUScompact_25km_ics_HRRR_lbcs_RAP_suite_HRRR +grid_RRFS_CONUScompact_25km_ics_HRRR_lbcs_RAP_suite_RRFS_v1beta +grid_RRFS_CONUS_25km_ics_FV3GFS_lbcs_FV3GFS_suite_GFS_2017_gfdlmp_regional +MET_ensemble_verification +community_ensemble_2mems_stoch +pregen_grid_orog_sfc_climo diff --git a/tests/WE2E/machine_suites/fundamental.jet b/tests/WE2E/machine_suites/fundamental.jet new file mode 100644 index 0000000000..fc81810364 --- /dev/null +++ b/tests/WE2E/machine_suites/fundamental.jet @@ -0,0 +1,10 @@ +grid_RRFS_CONUS_25km_ics_FV3GFS_lbcs_FV3GFS_suite_GFS_v15p2 +grid_RRFS_CONUS_25km_ics_FV3GFS_lbcs_FV3GFS_suite_GFS_v16 +grid_RRFS_CONUS_25km_ics_FV3GFS_lbcs_RAP_suite_HRRR +grid_RRFS_CONUS_25km_ics_GSMGFS_lbcs_GSMGFS_suite_GFS_v15p2 +nco_grid_RRFS_CONUScompact_25km_ics_HRRR_lbcs_RAP_suite_HRRR +custom_GFDLgrid +custom_ESGgrid +specify_DOT_OR_USCORE +specify_DT_ATMOS_LAYOUT_XY_BLOCKSIZE +specify_RESTART_INTERVAL diff --git a/tests/WE2E/machine_suites/fundamental.orion b/tests/WE2E/machine_suites/fundamental.orion new file mode 100644 index 0000000000..5cf7b73c16 --- /dev/null +++ b/tests/WE2E/machine_suites/fundamental.orion @@ -0,0 +1,5 @@ +grid_RRFS_CONUS_25km_ics_NAM_lbcs_NAM_suite_RRFS_v1beta +grid_SUBCONUS_Ind_3km_ics_HRRR_lbcs_RAP_suite_RRFS_v1beta +community_ensemble_008mems +deactivate_tasks +inline_post diff --git a/tests/WE2E/run_WE2E_tests.sh b/tests/WE2E/run_WE2E_tests.sh index 53edf57fde..6c8680b3ec 100755 --- a/tests/WE2E/run_WE2E_tests.sh +++ b/tests/WE2E/run_WE2E_tests.sh @@ -430,10 +430,24 @@ elif [ -n "${tests_file}" ] || [ -n "${test_type}" ] ; then # one managed in the repo if [ -n "${test_type}" ] ; then - # Check for a pre-defined set. It could be machine dependent or not. - user_spec_tests_fp=${scrfunc_dir}/machine_suites/${test_type}.${machine} + # Check for a pre-defined set. It could be machine dependent or has the mode + # (community or nco), or default + user_spec_tests_fp=${scrfunc_dir}/machine_suites/${test_type}.${machine}.nco if [ ! -f ${user_spec_tests_fp} ]; then - user_spec_tests_fp=${scrfunc_dir}/machine_suites/${test_type} + user_spec_tests_fp=${scrfunc_dir}/machine_suites/${test_type}.${machine}.com + if [ ! -f ${user_spec_tests_fp} ]; then + user_spec_tests_fp=${scrfunc_dir}/machine_suites/${test_type}.${machine}.${compiler} + if [ ! -f ${user_spec_tests_fp} ]; then + user_spec_tests_fp=${scrfunc_dir}/machine_suites/${test_type}.${machine} + if [ ! -f ${user_spec_tests_fp} ]; then + user_spec_tests_fp=${scrfunc_dir}/machine_suites/${test_type} + fi + fi + else + run_envir=${run_envir:-"community"} + fi + else + run_envir=${run_envir:-"nco"} fi elif [ -n "${tests_file}" ] ; then user_spec_tests_fp=$( readlink -f "${tests_file}" ) diff --git a/tests/WE2E/setup_WE2E_tests.sh b/tests/WE2E/setup_WE2E_tests.sh index 823829304d..ec94948e51 100755 --- a/tests/WE2E/setup_WE2E_tests.sh +++ b/tests/WE2E/setup_WE2E_tests.sh @@ -1,4 +1,5 @@ -#!/bin/bash -l +#!/usr/bin/env bash +[ -n "$HOME" ] && exec -c "$0" "$@" #---------------------------------------------------------------------- # Wrapper for the automation of UFS Short Range Weather App Workflow diff --git a/tests/WE2E/test_configs/grids_extrn_mdls_suites_nco/config.nco_grid_RRFS_CONUS_25km_ics_FV3GFS_lbcs_FV3GFS_timeoffset_suite_GFS_v16.yaml b/tests/WE2E/test_configs/grids_extrn_mdls_suites_nco/config.nco_grid_RRFS_CONUS_25km_ics_FV3GFS_lbcs_FV3GFS_timeoffset_suite_GFS_v16.yaml new file mode 100644 index 0000000000..bbfb59f8c5 --- /dev/null +++ b/tests/WE2E/test_configs/grids_extrn_mdls_suites_nco/config.nco_grid_RRFS_CONUS_25km_ics_FV3GFS_lbcs_FV3GFS_timeoffset_suite_GFS_v16.yaml @@ -0,0 +1,28 @@ +metadata: + description: |- + This test is to ensure that the workflow running in nco mode completes + successfully on the RRFS_CONUS_25km grid using the FV3_GFS_v16 physics + suite with time-offset ICs/LBCs derived from the FV3GFS. +user: + RUN_ENVIR: nco +workflow: + CCPP_PHYS_SUITE: FV3_GFS_v16 + DATE_FIRST_CYCL: '2022081012' + DATE_LAST_CYCL: '2022081012' + FCST_LEN_HRS: 6 + PREEXISTING_DIR_METHOD: rename +workflow_switches: + RUN_TASK_MAKE_GRID: false + RUN_TASK_MAKE_OROG: false + RUN_TASK_MAKE_SFC_CLIMO: false +task_get_extrn_ics: + EXTRN_MDL_NAME_ICS: FV3GFS + FV3GFS_FILE_FMT_ICS: netcdf + EXTRN_MDL_ICS_OFFSET_HRS: 6 +task_get_extrn_lbcs: + EXTRN_MDL_NAME_LBCS: FV3GFS + FV3GFS_FILE_FMT_LBCS: netcdf + LBC_SPEC_INTVL_HRS: 3 + EXTRN_MDL_LBCS_OFFSET_HRS: 6 +task_run_fcst: + PREDEF_GRID_NAME: RRFS_CONUS_25km diff --git a/tests/build.sh b/tests/build.sh index 461e87067a..01248c80f2 100755 --- a/tests/build.sh +++ b/tests/build.sh @@ -159,3 +159,6 @@ else msg="PASS" fi echo "$msg" >> ${TEST_OUTPUT} +if [[ $n_fail -gt 0 ]]; then + exit 1 +fi diff --git a/ush/calculate_cost.py b/ush/calculate_cost.py index 67b73ea974..1e0b52a204 100755 --- a/ush/calculate_cost.py +++ b/ush/calculate_cost.py @@ -7,7 +7,6 @@ from python_utils import ( set_env_var, import_vars, - export_vars, load_config_file, flatten_dict, ) @@ -21,13 +20,29 @@ def calculate_cost(config_fn): global PREDEF_GRID_NAME, QUILTING, GRID_GEN_METHOD # import all environment variables - import_vars() + IMPORTS = [ + "PREDEF_GRID_NAME", + "QUILTING", + "GRID_GEN_METHOD", + "DT_ATMOS", + "LAYOUT_X", + "LAYOUT_Y", + "BLOCKSIZE", + ] + import_vars(env_vars=IMPORTS) # get grid config parameters (predefined or custom) if PREDEF_GRID_NAME: - set_env_var("QUILTING", False) - set_predef_grid_params() - import_vars() + QUILTING = False + params_dict = set_predef_grid_params( + PREDEF_GRID_NAME, + QUILTING, + DT_ATMOS, + LAYOUT_X, + LAYOUT_Y, + BLOCKSIZE, + ) + import_vars(dictionary=params_dict) else: cfg_u = load_config_file(config_fn) cfg_u = flatten_dict(cfg_u) @@ -45,6 +60,8 @@ def calculate_cost(config_fn): iend_of_t7_on_t6g=GFDLgrid_IEND_OF_RGNL_DOM_ON_T6G, jstart_of_t7_on_t6g=GFDLgrid_JSTART_OF_RGNL_DOM_ON_T6G, jend_of_t7_on_t6g=GFDLgrid_JEND_OF_RGNL_DOM_ON_T6G, + RUN_ENVIR="community", + VERBOSE=False, ) elif GRID_GEN_METHOD == "ESGgrid": @@ -66,9 +83,16 @@ def calculate_cost(config_fn): # reference grid (6-hour forecast on RRFS_CONUS_25km) PREDEF_GRID_NAME = "RRFS_CONUS_25km" - export_vars() - set_predef_grid_params() - import_vars() + params_dict = set_predef_grid_params( + PREDEF_GRID_NAME, + QUILTING, + DT_ATMOS, + LAYOUT_X, + LAYOUT_Y, + BLOCKSIZE, + ) + import_vars(dictionary=params_dict) + cost.extend([DT_ATMOS, ESGgrid_NX * ESGgrid_NY]) return cost @@ -100,9 +124,11 @@ def test_calculate_cost(self): def setUp(self): set_env_var("DEBUG", False) + set_env_var("VERBOSE", False) set_env_var("PREDEF_GRID_NAME", "RRFS_CONUS_3km") set_env_var("DT_ATMOS", 36) set_env_var("LAYOUT_X", 18) set_env_var("LAYOUT_Y", 36) set_env_var("BLOCKSIZE", 28) set_env_var("QUILTING", False) + set_env_var("RUN_ENVIR", "community") diff --git a/ush/config.nco.yaml b/ush/config.nco.yaml index eec2ac1765..e8cb83ad58 100644 --- a/ush/config.nco.yaml +++ b/ush/config.nco.yaml @@ -6,8 +6,6 @@ user: MACHINE: hera ACCOUNT: an_account workflow: - USE_CRON_TO_RELAUNCH: true - CRON_RELAUNCH_INTVL_MNTS: 3 EXPT_SUBDIR: test_nco CCPP_PHYS_SUITE: FV3_GFS_v16 DATE_FIRST_CYCL: '2022040700' diff --git a/ush/config_defaults.yaml b/ush/config_defaults.yaml index 57236e06ed..2751ade05b 100644 --- a/ush/config_defaults.yaml +++ b/ush/config_defaults.yaml @@ -1121,6 +1121,7 @@ task_get_extrn_ics: GET_EXTRN_ICS_TN: "get_extrn_ics" NNODES_GET_EXTRN_ICS: 1 PPN_GET_EXTRN_ICS: 1 + MEM_GET_EXTRN_ICS: 2G WTIME_GET_EXTRN_ICS: 00:45:00 MAXTRIES_GET_EXTRN_ICS: 1 # @@ -1242,6 +1243,7 @@ task_get_extrn_lbcs: GET_EXTRN_LBCS_TN: "get_extrn_lbcs" NNODES_GET_EXTRN_LBCS: 1 PPN_GET_EXTRN_LBCS: 1 + MEM_GET_EXTRN_LBCS: 2G WTIME_GET_EXTRN_LBCS: 00:45:00 MAXTRIES_GET_EXTRN_LBCS: 1 # @@ -1772,6 +1774,7 @@ task_get_obs_ccpa: GET_OBS_CCPA_TN: "get_obs_ccpa" NNODES_GET_OBS_CCPA: 1 PPN_GET_OBS_CCPA: 1 + MEM_GET_OBS_CCPA: 2G WTIME_GET_OBS_CCPA: 00:45:00 MAXTRIES_GET_OBS_CCPA: 1 @@ -1782,6 +1785,7 @@ task_get_obs_mrms: GET_OBS_MRMS_TN: "get_obs_mrms" NNODES_GET_OBS_MRMS: 1 PPN_GET_OBS_MRMS: 1 + MEM_GET_OBS_MRMS: 2G WTIME_GET_OBS_MRMS: 00:45:00 MAXTRIES_GET_OBS_MRMS: 1 @@ -1792,6 +1796,7 @@ task_get_obs_ndas: GET_OBS_NDAS_TN: "get_obs_ndas" NNODES_GET_OBS_NDAS: 1 PPN_GET_OBS_NDAS: 1 + MEM_GET_OBS_NDAS: 2G WTIME_GET_OBS_NDAS: 02:00:00 MAXTRIES_GET_OBS_NDAS: 1 @@ -1802,6 +1807,7 @@ task_run_vx_gridstat: VX_GRIDSTAT_TN: "run_gridstatvx" NNODES_VX_GRIDSTAT: 1 PPN_VX_GRIDSTAT: 1 + MEM_VX_GRIDSTAT: 2G WTIME_VX_GRIDSTAT: 02:00:00 MAXTRIES_VX_GRIDSTAT: 2 @@ -1812,6 +1818,7 @@ task_run_vx_gridstat_refc: VX_GRIDSTAT_REFC_TN: "run_gridstatvx_refc" NNODES_VX_GRIDSTAT: 1 PPN_VX_GRIDSTAT: 1 + MEM_VX_GRIDSTAT: 2G WTIME_VX_GRIDSTAT: 02:00:00 MAXTRIES_VX_GRIDSTAT_REFC: 2 @@ -1822,6 +1829,7 @@ task_run_vx_gridstat_retop: VX_GRIDSTAT_RETOP_TN: "run_gridstatvx_retop" NNODES_VX_GRIDSTAT: 1 PPN_VX_GRIDSTAT: 1 + MEM_VX_GRIDSTAT: 2G WTIME_VX_GRIDSTAT: 02:00:00 MAXTRIES_VX_GRIDSTAT_RETOP: 2 @@ -1832,6 +1840,7 @@ task_run_vx_gridstat_03h: VX_GRIDSTAT_03h_TN: "run_gridstatvx_03h" NNODES_VX_GRIDSTAT: 1 PPN_VX_GRIDSTAT: 1 + MEM_VX_GRIDSTAT: 2G WTIME_VX_GRIDSTAT: 02:00:00 MAXTRIES_VX_GRIDSTAT_03h: 2 @@ -1842,6 +1851,7 @@ task_run_vx_gridstat_06h: VX_GRIDSTAT_06h_TN: "run_gridstatvx_06h" NNODES_VX_GRIDSTAT: 1 PPN_VX_GRIDSTAT: 1 + MEM_VX_GRIDSTAT: 2G WTIME_VX_GRIDSTAT: 02:00:00 MAXTRIES_VX_GRIDSTAT_06h: 2 @@ -1852,6 +1862,7 @@ task_run_vx_gridstat_24h: VX_GRIDSTAT_24h_TN: "run_gridstatvx_24h" NNODES_VX_GRIDSTAT: 1 PPN_VX_GRIDSTAT: 1 + MEM_VX_GRIDSTAT: 2G WTIME_VX_GRIDSTAT: 02:00:00 MAXTRIES_VX_GRIDSTAT_24h: 2 @@ -1862,6 +1873,7 @@ task_run_vx_pointstat: VX_POINTSTAT_TN: "run_pointstatvx" NNODES_VX_POINTSTAT: 1 PPN_VX_POINTSTAT: 1 + MEM_VX_POINTSTAT: 2G WTIME_VX_POINTSTAT: 01:00:00 MAXTRIES_VX_POINTSTAT: 2 @@ -1881,6 +1893,7 @@ task_run_vx_ensgrid: MAXTRIES_VX_ENSGRID_PROB_RETOP: 2 NNODES_VX_ENSGRID: 1 PPN_VX_ENSGRID: 1 + MEM_VX_ENSGRID: 2G WTIME_VX_ENSGRID: 01:00:00 MAXTRIES_VX_ENSGRID: 2 @@ -1892,6 +1905,7 @@ task_run_vx_ensgrid_refc: VX_ENSGRID_REFC_TN: "run_ensgridvx_refc" NNODES_VX_ENSGRID: 1 PPN_VX_ENSGRID: 1 + MEM_VX_ENSGRID: 2G WTIME_VX_ENSGRID: 01:00:00 MAXTRIES_VX_ENSGRID_REFC: 2 @@ -1902,6 +1916,7 @@ task_run_vx_ensgrid_mean: VX_ENSGRID_MEAN_TN: "run_ensgridvx_mean" NNODES_VX_ENSGRID_MEAN: 1 PPN_VX_ENSGRID_MEAN: 1 + MEM_VX_ENSGRID_MEAN: 2G WTIME_VX_ENSGRID_MEAN: 01:00:00 MAXTRIES_VX_ENSGRID_MEAN: 2 @@ -1912,6 +1927,7 @@ task_run_vx_ensgrid_mean_03h: VX_ENSGRID_MEAN_03h_TN: "run_ensgridvx_mean_03h" NNODES_VX_ENSGRID_MEAN: 1 PPN_VX_ENSGRID_MEAN: 1 + MEM_VX_ENSGRID_MEAN: 2G WTIME_VX_ENSGRID_MEAN: 01:00:00 MAXTRIES_VX_ENSGRID_MEAN_03h: 2 @@ -1922,6 +1938,7 @@ task_run_vx_ensgrid_mean_06h: VX_ENSGRID_MEAN_06h_TN: "run_ensgridvx_mean_06h" NNODES_VX_ENSGRID_MEAN: 1 PPN_VX_ENSGRID_MEAN: 1 + MEM_VX_ENSGRID_MEAN: 2G WTIME_VX_ENSGRID_MEAN: 01:00:00 MAXTRIES_VX_ENSGRID_MEAN_06h: 2 @@ -1932,6 +1949,7 @@ task_run_vx_ensgrid_mean_24h: VX_ENSGRID_MEAN_24h_TN: "run_ensgridvx_mean_24h" NNODES_VX_ENSGRID_MEAN: 1 PPN_VX_ENSGRID_MEAN: 1 + MEM_VX_ENSGRID_MEAN: 2G WTIME_VX_ENSGRID_MEAN: 01:00:00 MAXTRIES_VX_ENSGRID_MEAN_24h: 2 @@ -1942,6 +1960,7 @@ task_run_vx_ensgrid_prob: VX_ENSGRID_PROB_TN: "run_ensgridvx_prob" NNODES_VX_ENSGRID_PROB: 1 PPN_VX_ENSGRID_PROB: 1 + MEM_VX_ENSGRID_PROB: 2G WTIME_VX_ENSGRID_PROB: 01:00:00 MAXTRIES_VX_ENSGRID_PROB: 2 @@ -1952,6 +1971,7 @@ task_run_vx_ensgrid_prob_03h: VX_ENSGRID_PROB_03h_TN: "run_ensgridvx_prob_03h" NNODES_VX_ENSGRID_PROB: 1 PPN_VX_ENSGRID_PROB: 1 + MEM_VX_ENSGRID_PROB: 2G WTIME_VX_ENSGRID_PROB: 01:00:00 MAXTRIES_VX_ENSGRID_PROB_03h: 2 @@ -1962,6 +1982,7 @@ task_run_vx_ensgrid_prob_06h: VX_ENSGRID_PROB_06h_TN: "run_ensgridvx_prob_06h" NNODES_VX_ENSGRID_PROB: 1 PPN_VX_ENSGRID_PROB: 1 + MEM_VX_ENSGRID_PROB: 2G WTIME_VX_ENSGRID_PROB: 01:00:00 MAXTRIES_VX_ENSGRID_PROB_06h: 2 @@ -1972,6 +1993,7 @@ task_run_vx_ensgrid_prob_24h: VX_ENSGRID_PROB_24h_TN: "run_ensgridvx_prob_24h" NNODES_VX_ENSGRID_PROB: 1 PPN_VX_ENSGRID_PROB: 1 + MEM_VX_ENSGRID_PROB: 2G WTIME_VX_ENSGRID_PROB: 01:00:00 MAXTRIES_VX_ENSGRID_PROB_24h: 2 @@ -1982,6 +2004,7 @@ task_run_vx_enspoint: VX_ENSPOINT_TN: "run_enspointvx" NNODES_VX_ENSPOINT: 1 PPN_VX_ENSPOINT: 1 + MEM_VX_ENSPOINT: 2G WTIME_VX_ENSPOINT: 01:00:00 MAXTRIES_VX_ENSPOINT: 2 @@ -1992,6 +2015,7 @@ task_run_vx_enspoint_mean: VX_ENSPOINT_MEAN_TN: "run_enspointvx_mean" NNODES_VX_ENSPOINT_MEAN: 1 PPN_VX_ENSPOINT_MEAN: 1 + MEM_VX_ENSPOINT_MEAN: 2G WTIME_VX_ENSPOINT_MEAN: 01:00:00 MAXTRIES_VX_ENSPOINT_MEAN: 2 @@ -2002,6 +2026,7 @@ task_run_vx_enspoint_prob: VX_ENSPOINT_PROB_TN: "run_enspointvx_prob" NNODES_VX_ENSPOINT_PROB: 1 PPN_VX_ENSPOINT_PROB: 1 + MEM_VX_ENSPOINT_PROB: 2G WTIME_VX_ENSPOINT_PROB: 01:00:00 MAXTRIES_VX_ENSPOINT_PROB: 2 diff --git a/ush/generate_FV3LAM_wflow.py b/ush/generate_FV3LAM_wflow.py index 969485fce0..79e779b9b4 100755 --- a/ush/generate_FV3LAM_wflow.py +++ b/ush/generate_FV3LAM_wflow.py @@ -14,6 +14,7 @@ print_err_msg_exit, log_info, import_vars, + export_vars, cp_vrfy, cd_vrfy, rm_vrfy, @@ -29,6 +30,7 @@ find_pattern_in_str, set_env_var, get_env_var, + lowercase, ) from setup import setup @@ -64,15 +66,13 @@ def generate_FV3LAM_wflow(USHdir, logfile: str = "log.generate_FV3LAM_wflow") -> ========================================================================""" ) - # define utilities - define_macos_utilities() - # The setup function reads the user configuration file and fills in # non-user-specified values from config_defaults.yaml - setup() + var_defs_dict = setup() - # import all environment variables - import_vars() + # export/import all environment variables + export_vars(source_dict=var_defs_dict) + import_vars(dictionary=var_defs_dict) # # ----------------------------------------------------------------------- @@ -108,6 +108,13 @@ def generate_FV3LAM_wflow(USHdir, logfile: str = "log.generate_FV3LAM_wflow") -> WFLOW_XML_FP = '{WFLOW_XML_FP}'""" ) + # + # Dictionary of settings to pass to fill_jinja + # + settings = {} + for k, v in var_defs_dict.items(): + settings[lowercase(k)] = v + ensmem_indx_name = "" uscore_ensmem_name = "" slash_ensmem_subdir = "" @@ -116,283 +123,38 @@ def generate_FV3LAM_wflow(USHdir, logfile: str = "log.generate_FV3LAM_wflow") -> uscore_ensmem_name = f"_mem#{ensmem_indx_name}#" slash_ensmem_subdir = f"/mem#{ensmem_indx_name}#" - # get time string d = DATE_FIRST_CYCL + timedelta(seconds=DT_ATMOS) time_str = d.strftime("%M:%S") - # Dictionary of settings - settings = { - # - # Parameters needed by the job scheduler. - # - "account": ACCOUNT, - "sched": SCHED, - "partition_default": PARTITION_DEFAULT, - "queue_default": QUEUE_DEFAULT, - "partition_hpss": PARTITION_HPSS, - "queue_hpss": QUEUE_HPSS, - "partition_fcst": PARTITION_FCST, - "queue_fcst": QUEUE_FCST, - "machine": MACHINE, - "sched_native_cmd": SCHED_NATIVE_CMD, - "workflow_id": WORKFLOW_ID, - # - # Run environment - # - "run_envir": RUN_ENVIR, - "run": RUN, - "net": NET, - # - # Workflow task names. - # - "make_grid_tn": MAKE_GRID_TN, - "make_orog_tn": MAKE_OROG_TN, - "make_sfc_climo_tn": MAKE_SFC_CLIMO_TN, - "get_extrn_ics_tn": GET_EXTRN_ICS_TN, - "get_extrn_lbcs_tn": GET_EXTRN_LBCS_TN, - "make_ics_tn": MAKE_ICS_TN, - "make_lbcs_tn": MAKE_LBCS_TN, - "run_fcst_tn": RUN_FCST_TN, - "run_post_tn": RUN_POST_TN, - "get_obs_ccpa_tn": GET_OBS_CCPA_TN, - "get_obs_ndas_tn": GET_OBS_NDAS_TN, - "get_obs_mrms_tn": GET_OBS_MRMS_TN, - "vx_tn": VX_TN, - "vx_gridstat_tn": VX_GRIDSTAT_TN, - "vx_gridstat_refc_tn": VX_GRIDSTAT_REFC_TN, - "vx_gridstat_retop_tn": VX_GRIDSTAT_RETOP_TN, - "vx_gridstat_03h_tn": VX_GRIDSTAT_03h_TN, - "vx_gridstat_06h_tn": VX_GRIDSTAT_06h_TN, - "vx_gridstat_24h_tn": VX_GRIDSTAT_24h_TN, - "vx_pointstat_tn": VX_POINTSTAT_TN, - "vx_ensgrid_tn": VX_ENSGRID_TN, - "vx_ensgrid_refc_tn": VX_ENSGRID_REFC_TN, - "vx_ensgrid_retop_tn": VX_ENSGRID_RETOP_TN, - "vx_ensgrid_03h_tn": VX_ENSGRID_03h_TN, - "vx_ensgrid_06h_tn": VX_ENSGRID_06h_TN, - "vx_ensgrid_24h_tn": VX_ENSGRID_24h_TN, - "vx_ensgrid_mean_tn": VX_ENSGRID_MEAN_TN, - "vx_ensgrid_prob_tn": VX_ENSGRID_PROB_TN, - "vx_ensgrid_mean_03h_tn": VX_ENSGRID_MEAN_03h_TN, - "vx_ensgrid_prob_03h_tn": VX_ENSGRID_PROB_03h_TN, - "vx_ensgrid_mean_06h_tn": VX_ENSGRID_MEAN_06h_TN, - "vx_ensgrid_prob_06h_tn": VX_ENSGRID_PROB_06h_TN, - "vx_ensgrid_mean_24h_tn": VX_ENSGRID_MEAN_24h_TN, - "vx_ensgrid_prob_24h_tn": VX_ENSGRID_PROB_24h_TN, - "vx_ensgrid_prob_refc_tn": VX_ENSGRID_PROB_REFC_TN, - "vx_ensgrid_prob_retop_tn": VX_ENSGRID_PROB_RETOP_TN, - "vx_enspoint_tn": VX_ENSPOINT_TN, - "vx_enspoint_mean_tn": VX_ENSPOINT_MEAN_TN, - "vx_enspoint_prob_tn": VX_ENSPOINT_PROB_TN, - # - # Entity used to load the module file for each GET_OBS_* task. - # - "get_obs": GET_OBS, - # - # Number of nodes to use for each task. - # - "nnodes_make_grid": NNODES_MAKE_GRID, - "nnodes_make_orog": NNODES_MAKE_OROG, - "nnodes_make_sfc_climo": NNODES_MAKE_SFC_CLIMO, - "nnodes_get_extrn_ics": NNODES_GET_EXTRN_ICS, - "nnodes_get_extrn_lbcs": NNODES_GET_EXTRN_LBCS, - "nnodes_make_ics": NNODES_MAKE_ICS, - "nnodes_make_lbcs": NNODES_MAKE_LBCS, - "nnodes_run_fcst": NNODES_RUN_FCST, - "nnodes_run_post": NNODES_RUN_POST, - "nnodes_get_obs_ccpa": NNODES_GET_OBS_CCPA, - "nnodes_get_obs_mrms": NNODES_GET_OBS_MRMS, - "nnodes_get_obs_ndas": NNODES_GET_OBS_NDAS, - "nnodes_vx_gridstat": NNODES_VX_GRIDSTAT, - "nnodes_vx_pointstat": NNODES_VX_POINTSTAT, - "nnodes_vx_ensgrid": NNODES_VX_ENSGRID, - "nnodes_vx_ensgrid_mean": NNODES_VX_ENSGRID_MEAN, - "nnodes_vx_ensgrid_prob": NNODES_VX_ENSGRID_PROB, - "nnodes_vx_enspoint": NNODES_VX_ENSPOINT, - "nnodes_vx_enspoint_mean": NNODES_VX_ENSPOINT_MEAN, - "nnodes_vx_enspoint_prob": NNODES_VX_ENSPOINT_PROB, - # - # Number of cores used for a task - # - "ncores_run_fcst": PE_MEMBER01, - "native_run_fcst": f"--cpus-per-task {OMP_NUM_THREADS_RUN_FCST} --exclusive", - # - # Number of OpenMP threads for the run_fcst task - # - "omp_num_threads_run_fcst": OMP_NUM_THREADS_RUN_FCST, - # - # Number of logical processes per node for each task. If running without - # threading, this is equal to the number of MPI processes per node. - # - "ppn_make_grid": PPN_MAKE_GRID, - "ppn_make_orog": PPN_MAKE_OROG, - "ppn_make_sfc_climo": PPN_MAKE_SFC_CLIMO, - "ppn_get_extrn_ics": PPN_GET_EXTRN_ICS, - "ppn_get_extrn_lbcs": PPN_GET_EXTRN_LBCS, - "ppn_make_ics": PPN_MAKE_ICS, - "ppn_make_lbcs": PPN_MAKE_LBCS, - "ppn_run_fcst": PPN_RUN_FCST, - "ppn_run_post": PPN_RUN_POST, - "ppn_get_obs_ccpa": PPN_GET_OBS_CCPA, - "ppn_get_obs_mrms": PPN_GET_OBS_MRMS, - "ppn_get_obs_ndas": PPN_GET_OBS_NDAS, - "ppn_vx_gridstat": PPN_VX_GRIDSTAT, - "ppn_vx_pointstat": PPN_VX_POINTSTAT, - "ppn_vx_ensgrid": PPN_VX_ENSGRID, - "ppn_vx_ensgrid_mean": PPN_VX_ENSGRID_MEAN, - "ppn_vx_ensgrid_prob": PPN_VX_ENSGRID_PROB, - "ppn_vx_enspoint": PPN_VX_ENSPOINT, - "ppn_vx_enspoint_mean": PPN_VX_ENSPOINT_MEAN, - "ppn_vx_enspoint_prob": PPN_VX_ENSPOINT_PROB, - # - # Maximum wallclock time for each task. - # - "wtime_make_grid": WTIME_MAKE_GRID, - "wtime_make_orog": WTIME_MAKE_OROG, - "wtime_make_sfc_climo": WTIME_MAKE_SFC_CLIMO, - "wtime_get_extrn_ics": WTIME_GET_EXTRN_ICS, - "wtime_get_extrn_lbcs": WTIME_GET_EXTRN_LBCS, - "wtime_make_ics": WTIME_MAKE_ICS, - "wtime_make_lbcs": WTIME_MAKE_LBCS, - "wtime_run_fcst": WTIME_RUN_FCST, - "wtime_run_post": WTIME_RUN_POST, - "wtime_get_obs_ccpa": WTIME_GET_OBS_CCPA, - "wtime_get_obs_mrms": WTIME_GET_OBS_MRMS, - "wtime_get_obs_ndas": WTIME_GET_OBS_NDAS, - "wtime_vx_gridstat": WTIME_VX_GRIDSTAT, - "wtime_vx_pointstat": WTIME_VX_POINTSTAT, - "wtime_vx_ensgrid": WTIME_VX_ENSGRID, - "wtime_vx_ensgrid_mean": WTIME_VX_ENSGRID_MEAN, - "wtime_vx_ensgrid_prob": WTIME_VX_ENSGRID_PROB, - "wtime_vx_enspoint": WTIME_VX_ENSPOINT, - "wtime_vx_enspoint_mean": WTIME_VX_ENSPOINT_MEAN, - "wtime_vx_enspoint_prob": WTIME_VX_ENSPOINT_PROB, - # - # Maximum number of tries for each task. - # - "maxtries_make_grid": MAXTRIES_MAKE_GRID, - "maxtries_make_orog": MAXTRIES_MAKE_OROG, - "maxtries_make_sfc_climo": MAXTRIES_MAKE_SFC_CLIMO, - "maxtries_get_extrn_ics": MAXTRIES_GET_EXTRN_ICS, - "maxtries_get_extrn_lbcs": MAXTRIES_GET_EXTRN_LBCS, - "maxtries_make_ics": MAXTRIES_MAKE_ICS, - "maxtries_make_lbcs": MAXTRIES_MAKE_LBCS, - "maxtries_run_fcst": MAXTRIES_RUN_FCST, - "maxtries_run_post": MAXTRIES_RUN_POST, - "maxtries_get_obs_ccpa": MAXTRIES_GET_OBS_CCPA, - "maxtries_get_obs_mrms": MAXTRIES_GET_OBS_MRMS, - "maxtries_get_obs_ndas": MAXTRIES_GET_OBS_NDAS, - "maxtries_vx_gridstat": MAXTRIES_VX_GRIDSTAT, - "maxtries_vx_gridstat_refc": MAXTRIES_VX_GRIDSTAT_REFC, - "maxtries_vx_gridstat_retop": MAXTRIES_VX_GRIDSTAT_RETOP, - "maxtries_vx_gridstat_03h": MAXTRIES_VX_GRIDSTAT_03h, - "maxtries_vx_gridstat_06h": MAXTRIES_VX_GRIDSTAT_06h, - "maxtries_vx_gridstat_24h": MAXTRIES_VX_GRIDSTAT_24h, - "maxtries_vx_pointstat": MAXTRIES_VX_POINTSTAT, - "maxtries_vx_ensgrid": MAXTRIES_VX_ENSGRID, - "maxtries_vx_ensgrid_refc": MAXTRIES_VX_ENSGRID_REFC, - "maxtries_vx_ensgrid_retop": MAXTRIES_VX_ENSGRID_RETOP, - "maxtries_vx_ensgrid_03h": MAXTRIES_VX_ENSGRID_03h, - "maxtries_vx_ensgrid_06h": MAXTRIES_VX_ENSGRID_06h, - "maxtries_vx_ensgrid_24h": MAXTRIES_VX_ENSGRID_24h, - "maxtries_vx_ensgrid_mean": MAXTRIES_VX_ENSGRID_MEAN, - "maxtries_vx_ensgrid_prob": MAXTRIES_VX_ENSGRID_PROB, - "maxtries_vx_ensgrid_mean_03h": MAXTRIES_VX_ENSGRID_MEAN_03h, - "maxtries_vx_ensgrid_prob_03h": MAXTRIES_VX_ENSGRID_PROB_03h, - "maxtries_vx_ensgrid_mean_06h": MAXTRIES_VX_ENSGRID_MEAN_06h, - "maxtries_vx_ensgrid_prob_06h": MAXTRIES_VX_ENSGRID_PROB_06h, - "maxtries_vx_ensgrid_mean_24h": MAXTRIES_VX_ENSGRID_MEAN_24h, - "maxtries_vx_ensgrid_prob_24h": MAXTRIES_VX_ENSGRID_PROB_24h, - "maxtries_vx_ensgrid_prob_refc": MAXTRIES_VX_ENSGRID_PROB_REFC, - "maxtries_vx_ensgrid_prob_retop": MAXTRIES_VX_ENSGRID_PROB_RETOP, - "maxtries_vx_enspoint": MAXTRIES_VX_ENSPOINT, - "maxtries_vx_enspoint_mean": MAXTRIES_VX_ENSPOINT_MEAN, - "maxtries_vx_enspoint_prob": MAXTRIES_VX_ENSPOINT_PROB, - # - # Flags that specify whether to run the preprocessing or - # verification-related tasks. - # - "run_task_make_grid": RUN_TASK_MAKE_GRID, - "run_task_make_orog": RUN_TASK_MAKE_OROG, - "run_task_make_sfc_climo": RUN_TASK_MAKE_SFC_CLIMO, - "run_task_get_extrn_ics": RUN_TASK_GET_EXTRN_ICS, - "run_task_get_extrn_lbcs": RUN_TASK_GET_EXTRN_LBCS, - "run_task_make_ics": RUN_TASK_MAKE_ICS, - "run_task_make_lbcs": RUN_TASK_MAKE_LBCS, - "run_task_run_fcst": RUN_TASK_RUN_FCST, - "run_task_run_post": RUN_TASK_RUN_POST, - "run_task_get_obs_ccpa": RUN_TASK_GET_OBS_CCPA, - "run_task_get_obs_mrms": RUN_TASK_GET_OBS_MRMS, - "run_task_get_obs_ndas": RUN_TASK_GET_OBS_NDAS, - "run_task_vx_gridstat": RUN_TASK_VX_GRIDSTAT, - "run_task_vx_pointstat": RUN_TASK_VX_POINTSTAT, - "run_task_vx_ensgrid": RUN_TASK_VX_ENSGRID, - "run_task_vx_enspoint": RUN_TASK_VX_ENSPOINT, - # - # Number of physical cores per node for the current machine. - # - "ncores_per_node": NCORES_PER_NODE, - # - # Directories and files. - # - "exptdir": EXPTDIR, - "jobsdir": JOBSdir, - "logdir": LOGDIR, - "scriptsdir": SCRIPTSdir, - "comin_basedir": COMIN_BASEDIR, - "comout_basedir": COMOUT_BASEDIR, - "global_var_defns_fp": GLOBAL_VAR_DEFNS_FP, - "load_modules_run_task_fp": LOAD_MODULES_RUN_TASK_FP, - # - # External model information for generating ICs and LBCs. - # - "extrn_mdl_name_ics": EXTRN_MDL_NAME_ICS, - "extrn_mdl_name_lbcs": EXTRN_MDL_NAME_LBCS, - # - # Parameters that determine the set of cycles to run. - # - "date_first_cycl": date_to_str(DATE_FIRST_CYCL, format="%Y%m%d%H00"), - "date_last_cycl": date_to_str(DATE_LAST_CYCL, format="%Y%m%d%H00"), - "cdate_first_cycl": DATE_FIRST_CYCL, - "cycl_freq": f"{INCR_CYCL_FREQ:02d}:00:00", - # - # Forecast length (same for all cycles). - # - "fcst_len_hrs": FCST_LEN_HRS, - # - # Inline post - # - "write_dopost": WRITE_DOPOST, - # - # METPlus-specific information - # - "model": MODEL, - "met_install_dir": MET_INSTALL_DIR, - "met_bin_exec": MET_BIN_EXEC, - "metplus_path": METPLUS_PATH, - "vx_config_dir": VX_CONFIG_DIR, - "metplus_conf": METPLUS_CONF, - "met_config": MET_CONFIG, - "ccpa_obs_dir": CCPA_OBS_DIR, - "mrms_obs_dir": MRMS_OBS_DIR, - "ndas_obs_dir": NDAS_OBS_DIR, - # - # Ensemble-related parameters. - # - "do_ensemble": DO_ENSEMBLE, - "num_ens_members": NUM_ENS_MEMBERS, - "ndigits_ensmem_names": f"{NDIGITS_ENSMEM_NAMES}", - "ensmem_indx_name": ensmem_indx_name, - "uscore_ensmem_name": uscore_ensmem_name, - "slash_ensmem_subdir": slash_ensmem_subdir, - # - # Parameters associated with subhourly post-processed output - # - "sub_hourly_post": SUB_HOURLY_POST, - "delta_min": DT_SUBHOURLY_POST_MNTS, - "first_fv3_file_tstr": f"000:{time_str}", - } - # End of "settings" variable. + settings.update( + { + # + # Number of cores used for a task + # + "ncores_run_fcst": PE_MEMBER01, + "native_run_fcst": f"--cpus-per-task {OMP_NUM_THREADS_RUN_FCST} --exclusive", + # + # Parameters that determine the set of cycles to run. + # + "date_first_cycl": date_to_str(DATE_FIRST_CYCL, format="%Y%m%d%H00"), + "date_last_cycl": date_to_str(DATE_LAST_CYCL, format="%Y%m%d%H00"), + "cdate_first_cycl": DATE_FIRST_CYCL, + "cycl_freq": f"{INCR_CYCL_FREQ:02d}:00:00", + # + # Ensemble-related parameters. + # + "ensmem_indx_name": ensmem_indx_name, + "uscore_ensmem_name": uscore_ensmem_name, + "slash_ensmem_subdir": slash_ensmem_subdir, + # + # Parameters associated with subhourly post-processed output + # + "delta_min": DT_SUBHOURLY_POST_MNTS, + "first_fv3_file_tstr": f"000:{time_str}", + } + ) + + # Log "settings" variable. settings_str = cfg_to_yaml_str(settings) log_info( diff --git a/ush/get_crontab_contents.py b/ush/get_crontab_contents.py index a1e7863a43..774d311ac0 100644 --- a/ush/get_crontab_contents.py +++ b/ush/get_crontab_contents.py @@ -48,7 +48,7 @@ def get_crontab_contents(called_from_cron): print_input_args(locals()) # import selected env vars - IMPORTS = ["MACHINE", "USER", "DEBUG"] + IMPORTS = ["MACHINE", "DEBUG"] import_vars(env_vars=IMPORTS) __crontab_cmd__ = "crontab" @@ -93,7 +93,7 @@ def add_crontab_line(): """Add crontab line to cron table""" # import selected env vars - IMPORTS = ["MACHINE", "USER", "CRONTAB_LINE", "VERBOSE", "EXPTDIR"] + IMPORTS = ["MACHINE", "CRONTAB_LINE", "VERBOSE", "EXPTDIR"] import_vars(env_vars=IMPORTS) # @@ -160,7 +160,7 @@ def delete_crontab_line(called_from_cron): print_input_args(locals()) # import selected env vars - IMPORTS = ["MACHINE", "USER", "CRONTAB_LINE", "DEBUG"] + IMPORTS = ["MACHINE", "CRONTAB_LINE", "DEBUG"] import_vars(env_vars=IMPORTS) # diff --git a/ush/job_preamble.sh b/ush/job_preamble.sh index 63ffb1bbeb..438f4f888c 100644 --- a/ush/job_preamble.sh +++ b/ush/job_preamble.sh @@ -1,5 +1,17 @@ #!/bin/bash +# +#----------------------------------------------------------------------- +# +# If requested to share data with next task, override jobid +# +#----------------------------------------------------------------------- +# +export share_pid=${WORKFLOW_ID}_${PDY}${cyc} +if [ $# -ne 0 ]; then + export pid=$share_pid + export jobid=${job}.${pid} +fi # #----------------------------------------------------------------------- # @@ -25,11 +37,9 @@ fi #----------------------------------------------------------------------- # export DATA= -export DATA_SHARED= if [ "${RUN_ENVIR}" = "nco" ]; then export DATA=${DATAROOT}/${jobid} - export DATA_SHARED=${DATAROOT}/${RUN}.${PDY}.${WORKFLOW_ID} - mkdir_vrfy -p $DATA $DATA_SHARED + mkdir_vrfy -p $DATA cd $DATA fi # @@ -41,7 +51,7 @@ fi # if [ "${RUN_ENVIR}" = "nco" ]; then if [ ! -z $(command -v setpdy.sh) ]; then - setpdy.sh + COMROOT=$COMROOT setpdy.sh . ./PDY fi fi @@ -104,9 +114,28 @@ export -f POST_STEP if [ "${RUN_ENVIR}" = "nco" ]; then export COMIN="${COMIN_BASEDIR}/${RUN}.${PDY}/${cyc}" export COMOUT="${COMOUT_BASEDIR}/${RUN}.${PDY}/${cyc}" + export COMINext="${EXTROOT}/${RUN}.${PDY}/${cyc}" else export COMIN="${COMIN_BASEDIR}/${PDY}${cyc}" export COMOUT="${COMOUT_BASEDIR}/${PDY}${cyc}" + export COMINext="${EXTROOT}/${PDY}${cyc}" +fi + +# +#----------------------------------------------------------------------- +# +# Create symlinks to log files in the experiment directory. Makes viewing +# log files easier in NCO mode, as well as make CIs work +# +#----------------------------------------------------------------------- +# +if [ "${RUN_ENVIR}" = "nco" ]; then + __EXPTLOG=${EXPTDIR}/log + mkdir_vrfy -p ${__EXPTLOG} + for i in ${LOGDIR}/*.${WORKFLOW_ID}.log; do + __LOGB=$(basename $i .${WORKFLOW_ID}.log) + ln_vrfy -sf $i ${__EXPTLOG}/${__LOGB}.log + done fi # #----------------------------------------------------------------------- @@ -117,19 +146,10 @@ fi # function job_postamble() { - if [ "${RUN_ENVIR}" = "nco" ]; then - - # Remove temp directory + # Remove temp directory + if [ "${RUN_ENVIR}" = "nco" ] && [ $# -eq 0 ]; then cd ${DATAROOT} - [[ $KEEPDATA = "FALSE" ]] && rm -rf $DATA $DATA_SHARED - - # Create symlinks to log files - local EXPTLOG=${EXPTDIR}/log - mkdir_vrfy -p ${EXPTLOG} - for i in ${LOGDIR}/*.${WORKFLOW_ID}.log; do - local LOGB=$(basename $i .${WORKFLOW_ID}.log) - ln_vrfy -sf $i ${EXPTLOG}/${LOGB}.log - done + [[ $KEEPDATA = "FALSE" ]] && rm -rf $DATA fi # Print exit message diff --git a/ush/link_fix.py b/ush/link_fix.py index 5602d5170f..f18b82e9cd 100755 --- a/ush/link_fix.py +++ b/ush/link_fix.py @@ -8,7 +8,6 @@ from python_utils import ( import_vars, - set_env_var, print_input_args, print_info_msg, print_err_msg_exit, @@ -23,10 +22,10 @@ ) -def link_fix(verbose, file_group): +def link_fix(cfg_d, file_group): """This file defines a function that ... Args: - verbose: True or False + cfg_d: dictionary of settings file_group: could be on of ["grid", "orog", "sfc_climo"] Returns: a string: resolution @@ -38,7 +37,7 @@ def link_fix(verbose, file_group): check_var_valid_value(file_group, valid_vals_file_group) # import all environement variables - import_vars() + import_vars(dictionary=flatten_dict(cfg_d)) # # ----------------------------------------------------------------------- @@ -55,7 +54,7 @@ def link_fix(verbose, file_group): # ----------------------------------------------------------------------- # print_info_msg( - f"Creating links in the FIXlam directory to the grid files...", verbose=verbose + f"Creating links in the FIXlam directory to the grid files...", verbose=VERBOSE ) # # ----------------------------------------------------------------------- @@ -400,32 +399,33 @@ def parse_args(argv): if __name__ == "__main__": args = parse_args(sys.argv[1:]) cfg = load_shell_config(args.path_to_defns) - cfg = flatten_dict(cfg) - import_vars(dictionary=cfg) - link_fix(VERBOSE, args.file_group) + link_fix(cfg, args.file_group) class Testing(unittest.TestCase): def test_link_fix(self): - res = link_fix(verbose=True, file_group="grid") - self.assertTrue(res == "3357") - - def setUp(self): define_macos_utilities() TEST_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), "test_data") FIXlam = os.path.join(TEST_DIR, "expt", "fix_lam") mkdir_vrfy("-p", FIXlam) - set_env_var("FIXlam", FIXlam) - set_env_var("DOT_OR_USCORE", "_") - set_env_var("TILE_RGNL", 7) - set_env_var("NH0", 0) - set_env_var("NHW", 6) - set_env_var("NH4", 4) - set_env_var("NH3", 3) - set_env_var("GRID_DIR", TEST_DIR + os.sep + "RRFS_CONUS_3km") - set_env_var("RUN_TASK_MAKE_GRID", "FALSE") - set_env_var("OROG_DIR", TEST_DIR + os.sep + "RRFS_CONUS_3km") - set_env_var("RUN_TASK_MAKE_OROG", "FALSE") - set_env_var("SFC_CLIMO_DIR", TEST_DIR + os.sep + "RRFS_CONUS_3km") - set_env_var("RUN_TASK_MAKE_SFC_CLIMO", "FALSE") - set_env_var("CCPP_PHYS_SUITE", "FV3_GSD_SAR") + + cfg_d = { + "FIXlam": FIXlam, + "DOT_OR_USCORE": "_", + "TILE_RGNL": 7, + "NH0": 0, + "NHW": 6, + "NH4": 4, + "NH3": 3, + "GRID_DIR": TEST_DIR + os.sep + "RRFS_CONUS_3km", + "RUN_TASK_MAKE_GRID": "FALSE", + "OROG_DIR": TEST_DIR + os.sep + "RRFS_CONUS_3km", + "RUN_TASK_MAKE_OROG": "FALSE", + "SFC_CLIMO_DIR": TEST_DIR + os.sep + "RRFS_CONUS_3km", + "RUN_TASK_MAKE_SFC_CLIMO": "FALSE", + "CCPP_PHYS_SUITE": "FV3_GSD_SAR", + "VERBOSE": False, + } + + res = link_fix(cfg_d, file_group="grid") + self.assertTrue(res == "3357") diff --git a/ush/load_modules_run_task.sh b/ush/load_modules_run_task.sh index 6d5f8cde50..f49e4de0b8 100755 --- a/ush/load_modules_run_task.sh +++ b/ush/load_modules_run_task.sh @@ -81,14 +81,15 @@ jjob_fp="$2" set +u if [ ! -z ${SLURM_JOB_ID} ]; then export job=${SLURM_JOB_NAME} - export jobid=${job}.${SLURM_JOB_ID} + export pid=${pid:-${SLURM_JOB_ID}} elif [ ! -z ${PBS_JOBID} ]; then export job=${PBS_JOBNAME} - export jobid=${job}.${PBS_JOBID} + export pid=${pid:-${PBS_JOBID}} else export job=${task_name} - export jobid=${job}.$$ + export pid=${pid:-$$} fi +export jobid=${job}.${pid} set -u # #----------------------------------------------------------------------- diff --git a/ush/machine/wcoss2.yaml b/ush/machine/wcoss2.yaml index 059dc0776c..4a9bfcab50 100644 --- a/ush/machine/wcoss2.yaml +++ b/ush/machine/wcoss2.yaml @@ -32,3 +32,10 @@ task_run_fcst: FIXaer: /lfs/h2/emc/lam/noscrub/UFS_SRW_App/develop/fix/fix_aer FIXgsm: /lfs/h2/emc/lam/noscrub/UFS_SRW_App/develop/fix/fix_am FIXlut: /lfs/h2/emc/lam/noscrub/UFS_SRW_App/develop/fix/fix_lut +data: + GSMGFS: compath.py ${envir}/gsmgfs/${gsmgfs_ver}/gsmgfs.${PDY} + FV3GFS: compath.py ${envir}/gfs/${gfs_ver}/gfs.${PDY}/${hh}/atmos + RAP: compath.py ${envir}/rap/${rap_ver}/rap.${PDY} + NAM: compath.py ${envir}/nam/${nam_ver}/nam.${PDY} + HRRR: compath.py ${envir}/hrrr/${hrrr_ver}/hrrr.${PDY}/conus + diff --git a/ush/python_utils/test_data/sample.nc b/ush/python_utils/test_data/sample.nc deleted file mode 100644 index 9e31e16a3d..0000000000 Binary files a/ush/python_utils/test_data/sample.nc and /dev/null differ diff --git a/ush/retrieve_data.py b/ush/retrieve_data.py index 2d7bcefa17..e6ad879fbc 100755 --- a/ush/retrieve_data.py +++ b/ush/retrieve_data.py @@ -34,6 +34,7 @@ import sys from textwrap import dedent import time +from copy import deepcopy import yaml @@ -70,7 +71,7 @@ def clean_up_output_dir(expected_subdir, local_archive, output_path, source_path return unavailable -def copy_file(source, destination): +def copy_file(source, destination, copy_cmd): """ Copy a file from a source and place it in the destination location. @@ -85,7 +86,7 @@ def copy_file(source, destination): # Using subprocess here because system copy is much faster than # python copy options. - cmd = f"cp {source} {destination}" + cmd = f"{copy_cmd} {source} {destination}" logging.info(f"Running command: \n {cmd}") try: subprocess.run( @@ -289,6 +290,16 @@ def get_file_templates(cla, known_data_info, data_store, use_cla_tmpl=False): """ file_templates = known_data_info.get(data_store, {}).get("file_names") + file_templates = deepcopy(file_templates) + + # Remove sfc files from fcst in file_names of external models for LBCs + # sfc files needed in fcst when time_offset is not zero. + if cla.ics_or_lbcs == "LBCS": + for format in ['netcdf', 'nemsio']: + for i, tmpl in enumerate(file_templates.get(format, {}).get('fcst', [])): + if "sfc" in tmpl: + del file_templates[format]['fcst'][i] + if use_cla_tmpl: file_templates = cla.file_templates if cla.file_templates else file_templates @@ -381,7 +392,10 @@ def get_requested_files(cla, file_templates, input_locs, method="disk", **kwargs logging.debug(f"Full file path: {input_loc}") if method == "disk": - retrieved = copy_file(input_loc, target_path) + if cla.symlink: + retrieved = copy_file(input_loc, target_path, "ln -sf") + else: + retrieved = copy_file(input_loc, target_path, "cp") if method == "download": retrieved = download_file(input_loc) @@ -943,8 +957,19 @@ def parse_args(argv): required=True, type=os.path.abspath, ) + parser.add_argument( + "--ics_or_lbcs", + choices=("ICS", "LBCS"), + help="Flag for whether ICS or LBCS.", + required=True, + ) # Optional + parser.add_argument( + "--symlink", + action="store_true", + help="Symlink data files when source is disk", + ) parser.add_argument( "--debug", action="store_true", diff --git a/ush/set_gridparams_GFDLgrid.py b/ush/set_gridparams_GFDLgrid.py index 70a309c3fd..6edff861bb 100644 --- a/ush/set_gridparams_GFDLgrid.py +++ b/ush/set_gridparams_GFDLgrid.py @@ -38,6 +38,8 @@ def set_gridparams_GFDLgrid( iend_of_t7_on_t6g, jstart_of_t7_on_t6g, jend_of_t7_on_t6g, + RUN_ENVIR, + VERBOSE, ): """Sets the parameters for a grid that is to be generated using the "GFDLgrid" grid generation method (i.e. GRID_GEN_METHOD set to "ESGgrid"). @@ -59,8 +61,6 @@ def set_gridparams_GFDLgrid( print_input_args(locals()) # get needed environment variables - IMPORTS = ["VERBOSE", "RUN_ENVIR"] - import_vars(env_vars=IMPORTS) IMPORTS = ["NH4"] USHdir = os.path.dirname(os.path.abspath(__file__)) constants_cfg = load_config_file(os.path.join(USHdir, "constants.yaml")) @@ -493,6 +493,8 @@ def test_set_gridparams_GFDLgrid(self): iend_of_t7_on_t6g=84, jstart_of_t7_on_t6g=17, jend_of_t7_on_t6g=80, + RUN_ENVIR="community", + VERBOSE=False, ) self.assertEqual( diff --git a/ush/set_ozone_param.py b/ush/set_ozone_param.py index 28f6e1ef68..5bc29c612f 100644 --- a/ush/set_ozone_param.py +++ b/ush/set_ozone_param.py @@ -6,12 +6,8 @@ from python_utils import ( log_info, - import_vars, - export_vars, - set_env_var, list_to_str, print_input_args, - define_macos_utilities, load_xml_file, has_tag_with_value, find_pattern_in_str, diff --git a/ush/set_predef_grid_params.py b/ush/set_predef_grid_params.py index faf8c75c58..d0ab5a97cb 100644 --- a/ush/set_predef_grid_params.py +++ b/ush/set_predef_grid_params.py @@ -5,36 +5,31 @@ from textwrap import dedent from python_utils import ( - import_vars, - export_vars, - set_env_var, - get_env_var, - print_input_args, - define_macos_utilities, load_config_file, - cfg_to_yaml_str, flatten_dict, ) -def set_predef_grid_params(): +def set_predef_grid_params( + PREDEF_GRID_NAME, + QUILTING, + DT_ATMOS, + LAYOUT_X, + LAYOUT_Y, + BLOCKSIZE, +): """Sets grid parameters for the specified predfined grid Args: - None + PREDEF_GRID_NAME, + QUILTING, + DT_ATMOS, + LAYOUT_X, + LAYOUT_Y, + BLOCKSIZE, Returns: - None + Dictionary of grid parameters """ - # import all environement variables - IMPORTS = [ - "PREDEF_GRID_NAME", - "QUILTING", - "DT_ATMOS", - "LAYOUT_X", - "LAYOUT_Y", - "BLOCKSIZE", - ] - import_vars(env_vars=IMPORTS) USHdir = os.path.dirname(os.path.abspath(__file__)) params_dict = load_config_file(os.path.join(USHdir, "predef_grid_params.yaml")) @@ -55,37 +50,36 @@ def set_predef_grid_params(): params_dict = flatten_dict(params_dict) # take care of special vars - special_vars = ["DT_ATMOS", "LAYOUT_X", "LAYOUT_Y", "BLOCKSIZE"] - for var in special_vars: - if globals()[var] is not None: - params_dict[var] = globals()[var] - - # export variables to environment - export_vars(source_dict=params_dict) + if DT_ATMOS is not None: + params_dict["DT_ATMOS"] = DT_ATMOS + if LAYOUT_X is not None: + params_dict["LAYOUT_X"] = LAYOUT_X + if LAYOUT_Y is not None: + params_dict["LAYOUT_Y"] = LAYOUT_Y + if BLOCKSIZE is not None: + params_dict["BLOCKSIZE"] = BLOCKSIZE return params_dict -if __name__ == "__main__": - params_dict = set_predef_grid_params() - print(cfg_to_shell_str(params_dict), end="") - - class Testing(unittest.TestCase): def test_set_predef_grid_params(self): - set_predef_grid_params() - self.assertEqual(get_env_var("GRID_GEN_METHOD"), "ESGgrid") - self.assertEqual(get_env_var("ESGgrid_LON_CTR"), -97.5) - set_env_var("QUILTING", True) - set_predef_grid_params() - self.assertEqual(get_env_var("WRTCMP_nx"), 1799) - - def setUp(self): - define_macos_utilities() - set_env_var("DEBUG", False) - set_env_var("PREDEF_GRID_NAME", "RRFS_CONUS_3km") - set_env_var("DT_ATMOS", 36) - set_env_var("LAYOUT_X", 18) - set_env_var("LAYOUT_Y", 36) - set_env_var("BLOCKSIZE", 28) - set_env_var("QUILTING", False) + params_dict = set_predef_grid_params( + PREDEF_GRID_NAME="RRFS_CONUS_3km", + QUILTING=False, + DT_ATMOS=36, + LAYOUT_X=18, + LAYOUT_Y=36, + BLOCKSIZE=28, + ) + self.assertEqual(params_dict["GRID_GEN_METHOD"], "ESGgrid") + self.assertEqual(params_dict["ESGgrid_LON_CTR"], -97.5) + params_dict = set_predef_grid_params( + PREDEF_GRID_NAME="RRFS_CONUS_3km", + QUILTING=True, + DT_ATMOS=36, + LAYOUT_X=18, + LAYOUT_Y=36, + BLOCKSIZE=28, + ) + self.assertEqual(params_dict["WRTCMP_nx"], 1799) diff --git a/ush/set_thompson_mp_fix_files.py b/ush/set_thompson_mp_fix_files.py index df69c2b232..6eecd9fa7a 100644 --- a/ush/set_thompson_mp_fix_files.py +++ b/ush/set_thompson_mp_fix_files.py @@ -6,9 +6,6 @@ from python_utils import ( log_info, - import_vars, - export_vars, - set_env_var, list_to_str, print_input_args, define_macos_utilities, @@ -18,6 +15,9 @@ def set_thompson_mp_fix_files( + EXTRN_MDL_NAME_ICS, + EXTRN_MDL_NAME_LBCS, + CCPP_PHYS_SUITE, ccpp_phys_suite_fp, thompson_mp_climo_fn, CYCLEDIR_LINKS_TO_FIXam_FILES_MAPPING, @@ -34,6 +34,9 @@ def set_thompson_mp_fix_files( symlinks to these files are created in the run directories. Args: + EXTRN_MDL_NAME_ICS, + EXTRN_MDL_NAME_LBCS, + CCPP_PHYS_SUITE, ccpp_phys_suite_fp: full path to CCPP physics suite thompson_mp_climo_fn: netcdf file for thompson microphysics CYCLEDIR_LINKS_TO_FIXam_FILES_MAPPING @@ -44,10 +47,6 @@ def set_thompson_mp_fix_files( print_input_args(locals()) - # import some environment variables - IMPORTS = ["EXTRN_MDL_NAME_ICS", "EXTRN_MDL_NAME_LBCS", "CCPP_PHYS_SUITE"] - import_vars(env_vars=IMPORTS) - # # ----------------------------------------------------------------------- # @@ -130,6 +129,9 @@ def test_set_thompson_mp_fix_files(self): self.assertEqual( True, set_thompson_mp_fix_files( + "FV3GFS", + "FV3GFS", + "FV3_GSD_SAR", f"{USHdir}{os.sep}test_data{os.sep}suite_FV3_GSD_SAR.xml", "Thompson_MP_MONTHLY_CLIMO.nc", CYCLEDIR_LINKS_TO_FIXam_FILES_MAPPING, @@ -138,9 +140,6 @@ def test_set_thompson_mp_fix_files(self): ) def setUp(self): - set_env_var("EXTRN_MDL_NAME_ICS", "FV3GFS") - set_env_var("EXTRN_MDL_NAME_LBCS", "FV3GFS") - set_env_var("CCPP_PHYS_SUITE", "FV3_GSD_SAR") global CYCLEDIR_LINKS_TO_FIXam_FILES_MAPPING CYCLEDIR_LINKS_TO_FIXam_FILES_MAPPING = [ diff --git a/ush/setup.py b/ush/setup.py index 1bdf2453a8..1e0c19b266 100644 --- a/ush/setup.py +++ b/ush/setup.py @@ -19,7 +19,6 @@ flatten_dict, update_dict, import_vars, - export_vars, get_env_var, load_config_file, cfg_to_shell_str, @@ -53,7 +52,7 @@ def setup(): Args: None Returns: - None + Dictionary of settings """ logger = getLogger(__name__) @@ -61,9 +60,6 @@ def setup(): USHdir = os.path.dirname(os.path.abspath(__file__)) cd_vrfy(USHdir) - # import all environment variables - import_vars() - # print message log_info( f""" @@ -210,10 +206,12 @@ def get_location(xcs, fmt): os.path.join(USHdir, os.pardir, "parm", "fixed_files_mapping.yaml") ) import_vars(dictionary=flatten_dict(cfg_f)) + cfg_d.update(cfg_f) # Load constants file and save its contents to a variable for later cfg_c = load_config_file(os.path.join(USHdir, CONSTANTS_FN)) import_vars(dictionary=flatten_dict(cfg_c)) + cfg_d.update(cfg_c) # # ----------------------------------------------------------------------- @@ -236,13 +234,17 @@ def get_location(xcs, fmt): # # ----------------------------------------------------------------------- # - # export env vars before calling another module - export_vars() if PREDEF_GRID_NAME: - set_predef_grid_params() - - import_vars() + params_dict = set_predef_grid_params( + PREDEF_GRID_NAME, + QUILTING, + DT_ATMOS, + LAYOUT_X, + LAYOUT_Y, + BLOCKSIZE, + ) + import_vars(dictionary=params_dict) # # ----------------------------------------------------------------------- @@ -847,37 +849,46 @@ def get_location(xcs, fmt): global POST_OUTPUT_DOMAIN_NAME global COMIN_BASEDIR, COMOUT_BASEDIR - global OPSROOT, COMROOT, PACKAGEROOT, DATAROOT, DCOMROOT, DBNROOT + global OPSROOT, COMROOT, PACKAGEROOT, DATAROOT, DCOMROOT, DBNROOT, EXTROOT global SENDECF, SENDDBN, SENDDBN_NTC, SENDCOM, SENDWEB global KEEPDATA, MAILTO, MAILCC + # Stuff to import from parent shell environment + IMPORTS = [ + "OPSROOT", + "COMROOT", + "PACKAGEROOT", + "DATAROOT", + "DCOMROOT", + "DBNROOT", + "SENDECF", + "SENDDBN", + "SENDDBN_NTC", + "SENDCOM", + "SENDWEB", + "KEEPDATA", + "MAILTO", + "MAILCC", + ] + import_vars(env_vars=IMPORTS) + # Main directory locations if RUN_ENVIR == "nco": - try: - OPSROOT = ( - os.path.abspath(f"{EXPT_BASEDIR}{os.sep}..{os.sep}nco_dirs") - if OPSROOT is None - else OPSROOT - ) - except NameError: - OPSROOT = EXPTDIR - try: - COMROOT - except NameError: + OPSROOT = ( + os.path.abspath(f"{EXPT_BASEDIR}{os.sep}..{os.sep}nco_dirs") + if OPSROOT is None + else OPSROOT + ) + if COMROOT is None: COMROOT = os.path.join(OPSROOT, "com") - try: - PACKAGEROOT - except NameError: + if PACKAGEROOT is None: PACKAGEROOT = os.path.join(OPSROOT, "packages") - try: - DATAROOT - except NameError: + if DATAROOT is None: DATAROOT = os.path.join(OPSROOT, "tmp") - try: - DCOMROOT - except NameError: + if DCOMROOT is None: DCOMROOT = os.path.join(OPSROOT, "dcom") + EXTROOT = os.path.join(OPSROOT, "ext") COMIN_BASEDIR = os.path.join(COMROOT, NET, model_ver) COMOUT_BASEDIR = os.path.join(COMROOT, NET, model_ver) @@ -893,45 +904,22 @@ def get_location(xcs, fmt): PACKAGEROOT = EXPTDIR DATAROOT = EXPTDIR DCOMROOT = EXPTDIR + EXTROOT = EXPTDIR LOGDIR = os.path.join(EXPTDIR, "log") - try: - DBNROOT - except NameError: - DBNROOT = None - try: - SENDECF - except NameError: + if SENDECF is None: SENDECF = False - try: - SENDDBN - except NameError: + if SENDDBN is None: SENDDBN = False - try: - SENDDBN_NTC - except NameError: + if SENDDBN_NTC is None: SENDDBN_NTC = False - try: - SENDCOM - except NameError: + if SENDCOM is None: SENDCOM = False - try: - SENDWEB - except NameError: + if SENDWEB is None: SENDWEB = False - try: - KEEPDATA - except NameError: + if KEEPDATA is None: KEEPDATA = True - try: - MAILTO - except NameError: - MAILTO = None - try: - MAILCC - except NameError: - MAILCC = None # create NCO directories if RUN_ENVIR == "nco": @@ -940,6 +928,7 @@ def get_location(xcs, fmt): mkdir_vrfy(f" -p '{PACKAGEROOT}'") mkdir_vrfy(f" -p '{DATAROOT}'") mkdir_vrfy(f" -p '{DCOMROOT}'") + mkdir_vrfy(f" -p '{EXTROOT}'") if DBNROOT is not None: mkdir_vrfy(f" -p '{DBNROOT}'") @@ -1420,6 +1409,8 @@ def get_location(xcs, fmt): iend_of_t7_on_t6g=GFDLgrid_IEND_OF_RGNL_DOM_ON_T6G, jstart_of_t7_on_t6g=GFDLgrid_JSTART_OF_RGNL_DOM_ON_T6G, jend_of_t7_on_t6g=GFDLgrid_JEND_OF_RGNL_DOM_ON_T6G, + RUN_ENVIR=RUN_ENVIR, + VERBOSE=VERBOSE, ) # # ----------------------------------------------------------------------- @@ -1461,6 +1452,9 @@ def get_location(xcs, fmt): grid_params[k] for k in ["LON_CTR", "LAT_CTR", "NX", "NY", "NHW", "STRETCH_FAC"] ) + # grid params + cfg_d["grid_params"] = grid_params + # # ----------------------------------------------------------------------- # @@ -1496,14 +1490,11 @@ def get_location(xcs, fmt): # ----------------------------------------------------------------------- # - # export env vars - export_vars() - # link fix files res_in_grid_fns = "" if not RUN_TASK_MAKE_GRID: - res_in_grid_fns = link_fix(verbose=VERBOSE, file_group="grid") + res_in_grid_fns = link_fix(globals(), file_group="grid") RES_IN_FIXLAM_FILENAMES = res_in_grid_fns # @@ -1518,7 +1509,7 @@ def get_location(xcs, fmt): res_in_orog_fns = "" if not RUN_TASK_MAKE_OROG: - res_in_orog_fns = link_fix(verbose=VERBOSE, file_group="orog") + res_in_orog_fns = link_fix(globals(), file_group="orog") if not RES_IN_FIXLAM_FILENAMES and (res_in_orog_fns != RES_IN_FIXLAM_FILENAMES): raise Exception( @@ -1544,7 +1535,7 @@ def get_location(xcs, fmt): res_in_sfc_climo_fns = "" if not RUN_TASK_MAKE_SFC_CLIMO: - res_in_sfc_climo_fns = link_fix(verbose=VERBOSE, file_group="sfc_climo") + res_in_sfc_climo_fns = link_fix(globals(), file_group="sfc_climo") if RES_IN_FIXLAM_FILENAMES and res_in_sfc_climo_fns != RES_IN_FIXLAM_FILENAMES: raise Exception( @@ -1677,6 +1668,9 @@ def get_location(xcs, fmt): # ----------------------------------------------------------------------- # SDF_USES_THOMPSON_MP = set_thompson_mp_fix_files( + EXTRN_MDL_NAME_ICS, + EXTRN_MDL_NAME_LBCS, + CCPP_PHYS_SUITE, CCPP_PHYS_SUITE_IN_CCPP_FP, THOMPSON_MP_CLIMO_FN, CYCLEDIR_LINKS_TO_FIXam_FILES_MAPPING, @@ -1687,18 +1681,6 @@ def get_location(xcs, fmt): global GLOBAL_VAR_DEFNS_FP GLOBAL_VAR_DEFNS_FP = os.path.join(EXPTDIR, GLOBAL_VAR_DEFNS_FN) - # fixed files section - cfg_d.update(cfg_f) - - # update dictionary with globals() values - update_dict(globals(), cfg_d) - - # constants section - cfg_d.update(cfg_c) - - # grid params - cfg_d["grid_params"] = grid_params - # # ----------------------------------------------------------------------- # @@ -1897,6 +1879,7 @@ def get_location(xcs, fmt): "DATAROOT": DATAROOT, "DCOMROOT": DCOMROOT, "DBNROOT": DBNROOT, + "EXTROOT": EXTROOT, "SENDECF": SENDECF, "SENDDBN": SENDDBN, "SENDDBN_NTC": SENDDBN_NTC, @@ -1916,6 +1899,9 @@ def get_location(xcs, fmt): # ----------------------------------------------------------------------- # + # update dictionary with globals() values + update_dict(globals(), cfg_d) + # print content of var_defns if DEBUG=True all_lines = cfg_to_yaml_str(cfg_d) log_info(all_lines, verbose=DEBUG) @@ -1935,9 +1921,6 @@ def get_location(xcs, fmt): with open(GLOBAL_VAR_DEFNS_FP, "a") as f: f.write(cfg_to_shell_str(cfg_d)) - # export all global variables back to the environment - export_vars() - # # ----------------------------------------------------------------------- # @@ -1961,6 +1944,10 @@ def get_location(xcs, fmt): {k} = {cfg_v[vkey]}""" ) + # add LOGDIR and return flat dict + cfg_d.update({"LOGDIR": LOGDIR}) + return cfg_d + # # ----------------------------------------------------------------------- diff --git a/ush/test_retrieve_data.py b/ush/test_retrieve_data.py index dffa638562..e35eac2dad 100644 --- a/ush/test_retrieve_data.py +++ b/ush/test_retrieve_data.py @@ -48,6 +48,7 @@ def test_fv3gfs_grib2_lbcs_from_hpss(self): '--external_model', 'FV3GFS', '--fcst_hrs', '6', '12', '3', '--output_path', tmp_dir, + '--ics_or_lbcs', 'LBCS', '--debug', '--file_type', 'grib2', ] @@ -80,6 +81,7 @@ def test_fv3gfs_netcdf_lbcs_from_hpss(self): '--external_model', 'FV3GFS', '--fcst_hrs', '24', '48', '24', '--output_path', tmp_dir, + '--ics_or_lbcs', 'LBCS', '--debug', '--file_type', 'netcdf', ] @@ -112,6 +114,7 @@ def test_gdas_ics_from_aws(self): '--external_model', 'GDAS', '--fcst_hrs', '6', '9', '3', '--output_path', out_path_tmpl, + '--ics_or_lbcs', 'LBCS', '--debug', '--file_type', 'netcdf', '--members', '9', '10', @@ -147,6 +150,7 @@ def test_gefs_grib2_ics_from_aws(self): '--external_model', 'GEFS', '--fcst_hrs', '6', '--output_path', out_path_tmpl, + '--ics_or_lbcs', 'ICS', '--debug', '--file_type', 'netcdf', '--members', '1', '2', @@ -180,6 +184,7 @@ def test_hrrr_ics_from_hpss(self): '--external_model', 'HRRR', '--fcst_hrs', '0', '--output_path', tmp_dir, + '--ics_or_lbcs', 'ICS', '--debug', ] # fmt: on @@ -209,6 +214,7 @@ def test_hrrr_lbcs_from_hpss(self): '--external_model', 'HRRR', '--fcst_hrs', '3', '24', '3', '--output_path', tmp_dir, + '--ics_or_lbcs', 'LBCS', '--debug', ] # fmt: on @@ -237,6 +243,7 @@ def test_hrrr_ics_from_aws(self): '--external_model', 'HRRR', '--fcst_hrs', '0', '--output_path', tmp_dir, + '--ics_or_lbcs', 'ICS', '--debug', ] # fmt: on @@ -265,6 +272,7 @@ def test_hrrr_lbcs_from_aws(self): '--external_model', 'HRRR', '--fcst_hrs', '3', '24', '3', '--output_path', tmp_dir, + '--ics_or_lbcs', 'LBCS', '--debug', ] # fmt: on @@ -294,6 +302,7 @@ def test_rap_ics_from_aws(self): '--external_model', 'RAP', '--fcst_hrs', '3', '--output_path', tmp_dir, + '--ics_or_lbcs', 'ICS', '--debug', ] # fmt: on @@ -323,6 +332,7 @@ def test_rap_lbcs_from_aws(self): '--external_model', 'RAP', '--fcst_hrs', '3', '30', '6', '--output_path', tmp_dir, + '--ics_or_lbcs', 'LBCS', '--debug', ] # fmt: on diff --git a/versions/build.ver.wcoss2 b/versions/build.ver.wcoss2 index 9a89f97716..5d9b42c82a 100644 --- a/versions/build.ver.wcoss2 +++ b/versions/build.ver.wcoss2 @@ -1,7 +1,6 @@ #!/bin/bash export module_ver=8.5.2 -export gfs_ver=v16.2 export envvar_ver=1.0 export PrgEnv_intel_ver=8.1.0 diff --git a/versions/run.ver.wcoss2 b/versions/run.ver.wcoss2 index acdfffdf6d..6a06331a85 100644 --- a/versions/run.ver.wcoss2 +++ b/versions/run.ver.wcoss2 @@ -3,3 +3,10 @@ export intel_ver=19.1.3.304 export python_ver=3.8.6 export rocoto_ver=1.3.5 + +export gfs_ver=v16.2 +export nam_ver=v4.2 +export rap_ver=v5.1 +export gsmgfs_ver=v16.2 +export hrrr_ver=v3 +export prod_util_ver=2.0.14