Skip to content

Commit

Permalink
Add global-workflow infrastructure for ocean analysis recentering task (
Browse files Browse the repository at this point in the history
#2299)

Adds jjob, rocoto script, config file, and basic `config.resources`
entry for ocean analysis recentering task

This PR is a dependency for further work on the associated issue within
global-workflow and GDASApp

Refs NOAA-EMC/GDASApp#912
  • Loading branch information
AndrewEichmann-NOAA committed Mar 7, 2024
1 parent f83d17a commit 4a525be
Show file tree
Hide file tree
Showing 7 changed files with 140 additions and 19 deletions.
8 changes: 8 additions & 0 deletions env/HERA.env
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,14 @@ elif [[ "${step}" = "ocnanalchkpt" ]]; then

export APRUN_OCNANAL="${launcher} -n ${npe_ocnanalchkpt}"

elif [[ "${step}" = "ocnanalecen" ]]; then

nth_max=$((npe_node_max / npe_node_ocnanalecen))

export NTHREADS_OCNANALECEN=${nth_ocnanalecen:-${nth_max}}
[[ ${NTHREADS_OCNANALECEN} -gt ${nth_max} ]] && export NTHREADS_OCNANALECEN=${nth_max}
export APRUN_OCNANALECEN="${launcher} -n ${npe_ocnanalecen} --cpus-per-task=${NTHREADS_OCNANALECEN}"

elif [[ "${step}" = "anal" ]] || [[ "${step}" = "analcalc" ]]; then

export MKL_NUM_THREADS=4
Expand Down
8 changes: 8 additions & 0 deletions env/ORION.env
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,14 @@ elif [[ "${step}" = "ocnanalchkpt" ]]; then
[[ ${NTHREADS_OCNANAL} -gt ${nth_max} ]] && export NTHREADS_OCNANAL=${nth_max}
export APRUN_OCNANAL="${launcher} -n ${npe_ocnanalchkpt} --cpus-per-task=${NTHREADS_OCNANAL}"

elif [[ "${step}" = "ocnanalecen" ]]; then

nth_max=$((npe_node_max / npe_node_ocnanalecen))

export NTHREADS_OCNANALECEN=${nth_ocnanalecen:-${nth_max}}
[[ ${NTHREADS_OCNANALECEN} -gt ${nth_max} ]] && export NTHREADS_OCNANALECEN=${nth_max}
export APRUN_OCNANALECEN="${launcher} -n ${npe_ocnanalecen} --cpus-per-task=${NTHREADS_OCNANALECEN}"

elif [[ "${step}" = "anal" ]] || [[ "${step}" = "analcalc" ]]; then

export MKL_NUM_THREADS=4
Expand Down
38 changes: 38 additions & 0 deletions jobs/JGDAS_GLOBAL_OCEAN_ANALYSIS_ECEN
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/bash
source "${HOMEgfs}/ush/preamble.sh"
source "${HOMEgfs}/ush/jjob_header.sh" -e "ocnanalecen" -c "base ocnanal ocnanalecen"

##############################################
# Set variables used in the script
##############################################

##############################################
# Begin JOB SPECIFIC work
##############################################

###############################################################
# Run relevant script

EXSCRIPT=${GDASOCNCENPY:-${HOMEgfs}/scripts/exgdas_global_marine_analysis_ecen.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
23 changes: 23 additions & 0 deletions jobs/rocoto/ocnanalecen.sh
Original file line number Diff line number Diff line change
@@ -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="ocnanalecen"
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_ECEN
status=$?
exit "${status}"
11 changes: 11 additions & 0 deletions parm/config/gfs/config.ocnanalecen
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

########## config.ocnanalecen ##########
# Ocn Analysis specific

echo "BEGIN: config.ocnanalecen"

# Get task specific resources
. "${EXPDIR}/config.resources" ocnanalecen

echo "END: config.ocnanalecen"
67 changes: 48 additions & 19 deletions parm/config/gfs/config.resources
Original file line number Diff line number Diff line change
Expand Up @@ -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 ocnanalchkpt ocnanalpost ocnanalvrfy"
echo "ocnanalprep prepoceanobs ocnanalbmat ocnanalrun ocnanalecen ocnanalchkpt ocnanalpost ocnanalvrfy"
exit 1

fi
Expand Down Expand Up @@ -356,12 +356,12 @@ case ${step} in

"ocnanalbmat")
npes=16
case ${CASE} in
"C384") npes=480;;
"C96") npes=16;;
"C48") npes=16;;
case ${OCNRES} in
"025") npes=480;;
"050") npes=16;;
"500") npes=16;;
*)
echo "FATAL ERROR: Resources not defined for job ${job} at resolution ${CASE}"
echo "FATAL ERROR: Resources not defined for job ${job} at resolution ${OCNRES}"
exit 4
esac

Expand All @@ -374,20 +374,21 @@ case ${step} in

"ocnanalrun")
npes=16
case ${CASE} in
"C384")
npes=480
memory_ocnanalrun="128GB"
case ${OCNRES} in
"025")
npes=40
memory_ocnanalrun="96GB"
;;
"C96")
"050")
npes=16
memory_ocnanalrun="96GB"
;;
"C48")
"500")
npes=16
memory_ocnanalrun="64GB"
memory_ocnanalrun="24GB"
;;
*)
echo "FATAL ERROR: Resources not defined for job ${job} at resolution ${CASE}"
echo "FATAL ERROR: Resources not defined for job ${job} at resolution ${OCNRES}"
exit 4
esac

Expand All @@ -399,23 +400,51 @@ case ${step} in
export memory_ocnanalrun
;;

"ocnanalecen")
npes=16
case ${OCNRES} in
"025")
npes=40
memory_ocnanalecen="96GB"
;;
"050")
npes=16
memory_ocnanalecen="96GB"
;;
"500")
npes=16
memory_ocnanalecen="24GB"
;;
*)
echo "FATAL ERROR: Resources not defined for job ${job} at resolution ${OCNRES}"
exit 4
esac

export wtime_ocnanalecen="00:10:00"
export npe_ocnanalecen=${npes}
export nth_ocnanalecen=1
export is_exclusive=True
export npe_node_ocnanalecen=$(( npe_node_max / nth_ocnanalecen ))
export memory_ocnanalecen
;;

"ocnanalchkpt")
export wtime_ocnanalchkpt="00:10:00"
export npe_ocnanalchkpt=1
export nth_ocnanalchkpt=1
export npe_node_ocnanalchkpt=$(( npe_node_max / nth_ocnanalchkpt ))
case ${CASE} in
"C384")
case ${OCNRES} in
"025")
memory_ocnanalchkpt="128GB"
npes=40;;
"C96")
"050")
memory_ocnanalchkpt="32GB"
npes=16;;
"C48")
"500")
memory_ocnanalchkpt="32GB"
npes=8;;
*)
echo "FATAL ERROR: Resources not defined for job ${job} at resolution ${CASE}"
echo "FATAL ERROR: Resources not defined for job ${job} at resolution ${OCNRES}"
exit 4
esac
export npe_ocnanalchkpt=${npes}
Expand Down
4 changes: 4 additions & 0 deletions sorc/link_workflow.sh
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,10 @@ if [[ -d "${HOMEgfs}/sorc/gdas.cd/build" ]]; then
"fv3jedi_enshofx.x" \
"fv3jedi_hofx_nomodel.x" \
"fv3jedi_testdata_downloader.py" \
"gdas_ens_handler.x" \
"gdas_incr_handler.x" \
"gdas_obsprovider2ioda.x" \
"gdas_socahybridweights.x" \
"soca_convertincrement.x" \
"soca_error_covariance_training.x" \
"soca_setcorscales.x" \
Expand Down

0 comments on commit 4a525be

Please sign in to comment.