From bc0f7d3bbccb9bd5c000d11b9c234798cba626d1 Mon Sep 17 00:00:00 2001 From: AndrewEichmann-NOAA Date: Thu, 2 May 2024 18:18:42 +0000 Subject: [PATCH] inital commit of ocn letkf --- env/HERA.env | 8 +++++ env/ORION.env | 8 +++++ jobs/JGDAS_GLOBAL_OCEAN_ANALYSIS_LETKF | 47 ++++++++++++++++++++++++++ jobs/rocoto/ocnanalletkf.sh | 23 +++++++++++++ parm/config/gfs/config.ocnanalletkf | 11 ++++++ parm/config/gfs/config.resources | 31 ++++++++++++++++- sorc/link_workflow.sh | 1 + 7 files changed, 128 insertions(+), 1 deletion(-) create mode 100755 jobs/JGDAS_GLOBAL_OCEAN_ANALYSIS_LETKF create mode 100755 jobs/rocoto/ocnanalletkf.sh create mode 100644 parm/config/gfs/config.ocnanalletkf diff --git a/env/HERA.env b/env/HERA.env index 6ce99f8e90..b010293e8f 100755 --- a/env/HERA.env +++ b/env/HERA.env @@ -126,6 +126,14 @@ elif [[ "${step}" = "ocnanalecen" ]]; then [[ ${NTHREADS_OCNANALECEN} -gt ${nth_max} ]] && export NTHREADS_OCNANALECEN=${nth_max} export APRUN_OCNANALECEN="${launcher} -n ${npe_ocnanalecen} --cpus-per-task=${NTHREADS_OCNANALECEN}" +elif [[ "${step}" = "ocnanalletkf" ]]; then + + nth_max=$((npe_node_max / npe_node_ocnanalletkf)) + + export NTHREADS_OCNANALLETKF=${nth_ocnanalletkf:-${nth_max}} + [[ ${NTHREADS_OCNANALLETKF} -gt ${nth_max} ]] && export NTHREADS_OCNANALLETKF=${nth_max} + export APRUN_OCNANALLETKF="${launcher} -n ${npe_ocnanalletkf} --cpus-per-task=${NTHREADS_OCNANALLETKF}" + elif [[ "${step}" = "anal" ]] || [[ "${step}" = "analcalc" ]]; then export MKL_NUM_THREADS=4 diff --git a/env/ORION.env b/env/ORION.env index 6aac84a169..24cb17bb0d 100755 --- a/env/ORION.env +++ b/env/ORION.env @@ -134,6 +134,14 @@ elif [[ "${step}" = "ocnanalecen" ]]; then [[ ${NTHREADS_OCNANALECEN} -gt ${nth_max} ]] && export NTHREADS_OCNANALECEN=${nth_max} export APRUN_OCNANALECEN="${launcher} -n ${npe_ocnanalecen} --cpus-per-task=${NTHREADS_OCNANALECEN}" +elif [[ "${step}" = "ocnanalletkf" ]]; then + + nth_max=$((npe_node_max / npe_node_ocnanalletkf)) + + export NTHREADS_OCNANALLETKF=${nth_ocnanalletkf:-${nth_max}} + [[ ${NTHREADS_OCNANALLETKF} -gt ${nth_max} ]] && export NTHREADS_OCNANALLETKF=${nth_max} + export APRUN_OCNANALLETKF="${launcher} -n ${npe_ocnanalletkf} --cpus-per-task=${NTHREADS_OCNANALLETKF}" + elif [[ "${step}" = "anal" ]] || [[ "${step}" = "analcalc" ]]; then export MKL_NUM_THREADS=4 diff --git a/jobs/JGDAS_GLOBAL_OCEAN_ANALYSIS_LETKF b/jobs/JGDAS_GLOBAL_OCEAN_ANALYSIS_LETKF new file mode 100755 index 0000000000..0223e98528 --- /dev/null +++ b/jobs/JGDAS_GLOBAL_OCEAN_ANALYSIS_LETKF @@ -0,0 +1,47 @@ +#!/bin/bash +source "${HOMEgfs}/ush/preamble.sh" +source "${HOMEgfs}/ush/jjob_header.sh" -e "ocnanalletkf" -c "base ocnanal ocnanalletkf" + +############################################## +# Set variables used in the script +############################################## +# Ignore possible spelling error (nothing is misspelled) +# shellcheck disable=SC2153 +GDATE=$(date --utc +%Y%m%d%H -d "${PDY} ${cyc} - ${assim_freq} hours") +export gPDY=${GDATE:0:8} +export gcyc=${GDATE:8:2} + +YMD=${gPDY} HH=${gcyc} declare_from_tmpl -rx \ + COM_OCEAN_HISTORY_PREV:COM_OCEAN_HISTORY_TMPL \ + COM_ICE_HISTORY_PREV:COM_ICE_HISTORY_TMPL + +############################################## +# Begin JOB SPECIFIC work +############################################## + +############################################################### +# Run relevant script + +EXSCRIPT=${GDASOCNCENPY:-${HOMEgfs}/scripts/exgdas_global_marine_analysis_letkf.py} +${EXSCRIPT} +status=$? +[[ ${status} -ne 0 ]] && exit "${status}" + +############################################## +# End JOB SPECIFIC work +############################################## + +############################################## +# Final processing +############################################## +if [[ -e "${pgmout}" ]] ; then + cat "${pgmout}" +fi + +########################################## +# Remove the Temporary working directory +########################################## +cd "${DATAROOT}" || exit 1 +[[ "${KEEPDATA}" = "NO" ]] && rm -rf "${DATA}" + +exit 0 diff --git a/jobs/rocoto/ocnanalletkf.sh b/jobs/rocoto/ocnanalletkf.sh new file mode 100755 index 0000000000..cbea8113ee --- /dev/null +++ b/jobs/rocoto/ocnanalletkf.sh @@ -0,0 +1,23 @@ +#! /usr/bin/env bash + +source "${HOMEgfs}/ush/preamble.sh" + +############################################################### +# Source UFSDA workflow modules +. "${HOMEgfs}/ush/load_ufsda_modules.sh" +status=$? +[[ ${status} -ne 0 ]] && exit "${status}" + +export job="ocnanalletkf" +export jobid="${job}.$$" + +############################################################### +# Setup Python path for GDASApp ush +PYTHONPATH="${PYTHONPATH:+${PYTHONPATH}:}${HOMEgfs}/sorc/gdas.cd/ush" +export PYTHONPATH + +############################################################### +# Execute the JJOB +"${HOMEgfs}"/jobs/JGDAS_GLOBAL_OCEAN_ANALYSIS_LETKF +status=$? +exit "${status}" diff --git a/parm/config/gfs/config.ocnanalletkf b/parm/config/gfs/config.ocnanalletkf new file mode 100644 index 0000000000..b67f37152e --- /dev/null +++ b/parm/config/gfs/config.ocnanalletkf @@ -0,0 +1,11 @@ +#!/bin/bash + +########## config.ocnanalletkf ########## +# Ocn Analysis specific + +echo "BEGIN: config.ocnanalletkf" + +# Get task specific resources +. "${EXPDIR}/config.resources" ocnanalletkf + +echo "END: config.ocnanalletkf" diff --git a/parm/config/gfs/config.resources b/parm/config/gfs/config.resources index aafe7b0967..d92f905b7b 100644 --- a/parm/config/gfs/config.resources +++ b/parm/config/gfs/config.resources @@ -23,7 +23,7 @@ if (( $# != 1 )); then echo "waveinit waveprep wavepostsbs wavepostbndpnt wavepostbndpntbll wavepostpnt" echo "wavegempak waveawipsbulls waveawipsgridded" echo "postsnd awips gempak npoess" - echo "ocnanalprep prepoceanobs ocnanalbmat ocnanalrun ocnanalecen ocnanalchkpt ocnanalpost ocnanalvrfy" + echo "ocnanalprep prepoceanobs ocnanalbmat ocnanalrun ocnanalecen ocnanalletkf ocnanalchkpt ocnanalpost ocnanalvrfy" exit 1 fi @@ -442,6 +442,35 @@ case ${step} in export memory_ocnanalecen ;; + "ocnanalletkf") + npes=16 + case ${OCNRES} in + "025") + npes=40 + memory_ocnanalletkf="96GB" + ;; + "050") + npes=16 + memory_ocnanalletkf="96GB" + ;; + "500") + npes=16 + memory_ocnanalletkf="24GB" + ;; + *) + echo "FATAL ERROR: Resources not defined for job ${job} at resolution ${OCNRES}" + exit 4 + esac + + export wtime_ocnanalletkf="00:10:00" + export npe_ocnanalletkf=${npes} + export nth_ocnanalletkf=1 + export is_exclusive=True + export npe_node_ocnanalletkf=$(( npe_node_max / nth_ocnanalletkf )) + export memory_ocnanalletkf + ;; + + "ocnanalchkpt") export wtime_ocnanalchkpt="00:10:00" export npe_ocnanalchkpt=1 diff --git a/sorc/link_workflow.sh b/sorc/link_workflow.sh index 7106d1ed79..60b2a37894 100755 --- a/sorc/link_workflow.sh +++ b/sorc/link_workflow.sh @@ -163,6 +163,7 @@ ${LINK_OR_COPY} "${HOMEgfs}/sorc/ufs_utils.fd/scripts/exemcsfc_global_sfc_prep.s if [[ -d "${HOMEgfs}/sorc/gdas.cd" ]]; then declare -a gdas_scripts=(exglobal_prep_ocean_obs.py \ exgdas_global_marine_analysis_ecen.py \ + exgdas_global_marine_analysis_letkf.py \ ) for gdas_script in "${gdas_scripts[@]}" ; do ${LINK_OR_COPY} "${HOMEgfs}/sorc/gdas.cd/scripts/${gdas_script}" .