Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JEDI based Marine DA tasks #1134

Merged
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ __pycache__
.DS_Store
.idea/

# Ignore editor generated backup files
#-------------------------------------
*~
# Ignore folders
#-------------------
exec/
Expand Down
10 changes: 10 additions & 0 deletions env/HERA.env
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,16 @@ elif [ $step = "aeroanlrun" ]; then
[[ $NTHREADS_AEROANL -gt $nth_max ]] && export NTHREADS_AEROANL=$nth_max
export APRUN_AEROANL="$launcher -n $npe_aeroanlrun"

elif [ $step = "ocnanalrun" ]; then
Fixed Show fixed Hide fixed

Check notice

Code scanning / shellcheck

Double quote to prevent globbing and word splitting.

Double quote to prevent globbing and word splitting.

export APRUNCFP="${launcher} -n \$ncmd --multi-prog"

nth_max=$((${npe_node_max} / ${npe_node_ocnanalrun}))
Fixed Show fixed Hide fixed
Fixed Show fixed Hide fixed

export NTHREADS_OCNANAL=${nth_ocnanalrun:-${nth_max}}
[[ ${NTHREADS_OCNANAL} -gt ${nth_max} ]] && export NTHREADS_OCNANAL=${nth_max}
export APRUN_OCNANAL="${launcher} -n ${npe_ocnanalrun}"

elif [ $step = "anal" -o $step = "analcalc" ]; then

export MKL_NUM_THREADS=4
Expand Down
10 changes: 10 additions & 0 deletions env/ORION.env
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,16 @@ elif [ $step = "aeroanlrun" ]; then
[[ $NTHREADS_AEROANL -gt $nth_max ]] && export NTHREADS_AEROANL=$nth_max
export APRUN_AEROANL="$launcher -n $npe_aeroanlrun"

elif [ $step = "ocnanalrun" ]; then

Check notice

Code scanning / shellcheck

Prefer putting braces around variable references even when not strictly required.

Prefer putting braces around variable references even when not strictly required.

Check notice

Code scanning / shellcheck

Double quote to prevent globbing and word splitting.

Double quote to prevent globbing and word splitting.

export APRUNCFP="${launcher} -n \$ncmd ${mpmd_opt}"

nth_max=$((${npe_node_max} / ${npe_node_ocnanalrun}))
Fixed Show fixed Hide fixed
Fixed Show fixed Hide fixed

export NTHREADS_OCNANAL=${nth_ocnanalrun:-${nth_max}}
[[ $NTHREADS_OCNANAL -gt ${nth_max} ]] && export NTHREADS_OCNANAL=${nth_max}
Fixed Show fixed Hide fixed
export APRUN_OCNANAL="${launcher} -n ${npe_aeroanlrun}"

elif [ $step = "anal" -o $step = "analcalc" ]; then

export MKL_NUM_THREADS=4
Expand Down
23 changes: 23 additions & 0 deletions jobs/JGDAS_GLOBAL_OCEAN_ANALYSIS_POST
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash
export STRICT="NO"
source "${HOMEgfs}/ush/preamble.sh"

#############################
# Source relevant config files
#############################
export EXPDIR=${EXPDIR:-${HOMEgfs}/parm/config}
configs="base ocnanalpost"
config_path=${EXPDIR:-${PACKAGEROOT}/gfs.${gfs_ver}/parm/config}
for config in ${configs}; do
. "${config_path}"/config."${config}"
status=$?
[[ "${status}" -ne 0 ]] && exit "${status}"
done

##########################################
# Remove the Temporary working directory
##########################################
cd "${DATAROOT}" || exit 1
[[ ${KEEPDATA} = "NO" ]] && rm -rf "${DATA}"
aerorahul marked this conversation as resolved.
Show resolved Hide resolved

exit 0
101 changes: 101 additions & 0 deletions jobs/JGDAS_GLOBAL_OCEAN_ANALYSIS_PREP
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
#!/bin/bash
export STRICT="NO"
source "${HOMEgfs}/ush/preamble.sh"

#############################
# Source relevant config files
#############################
export EXPDIR=${EXPDIR:-${HOMEgfs}/parm/config}
configs="base ocnanal ocnanalprep"
config_path=${EXPDIR:-${PACKAGEROOT}/gfs.${gfs_ver}/parm/config}
for config in ${configs}; do
. "${config_path}"/config."${config}"
status=$?
[[ ${status} -ne 0 ]] && exit "${status}"
done


##########################################
# Source machine runtime environment
##########################################
. "${HOMEgfs}"/env/"${machine}".env ocnanalprep
status=$?
[[ ${status} -ne 0 ]] && exit "${status}"


##############################################
# Obtain unique process id (pid) and make temp directory
##############################################
export pid=${pid:-$$}
export outid=${outid:-"LL${job}"}

export DATA=${DATA:-${DATAROOT}/ocnanal_${CDATE}}
mkdir -p "${DATA}"
cd "${DATA}" || (echo "${DATA} does not exist. ABORT!"; exit 1)


##############################################
# Run setpdy and initialize PDY variables
##############################################
export cycle="t${cyc}z"
setpdy.sh
. ./PDY


##############################################
# Determine Job Output Name on System
##############################################
export pgmout="OUTPUT.${pid}"
export pgmerr=errfile


##############################################
# Set variables used in the script
##############################################
export CDATE=${CDATE:-${PDY}${cyc}}
export CDUMP=${CDUMP:-${RUN:-"gfs"}}
export COMPONENT=${COMPONENT:-ocean}

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

GDATE=$(date +%Y%m%d%H -d "${CDATE:0:8} ${CDATE:8:2} - ${assim_freq} hours")
export GDATE
gPDY=${GDATE:0:8}
export gcyc=${GDATE:8:2}
export GDUMP=${GDUMP:-"gdas"}

export OPREFIX="${CDUMP}.t${cyc}z."
export GPREFIX="${GDUMP}.t${gcyc}z."
export APREFIX="${CDUMP}.t${cyc}z."
export GSUFFIX=${GSUFFIX:-${SUFFIX}}
export ASUFFIX=${ASUFFIX:-${SUFFIX}}

export COMOUT=${COMOUT:-${ROTDIR}/${CDUMP}.${PDY}/${cyc}/${COMPONENT}}

mkdir -p "${COMOUT}"

# COMIN_GES and COMIN_GES_ENS are used in script
export COMIN_GES="${ROTDIR}/${GDUMP}.${gPDY}/${gcyc}/${COMPONENT}"

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

EXSCRIPT=${GDASPREPPY:-${HOMEgfs}/sorc/gdas.cd/scripts/exgdas_global_marine_analysis_prep.py}
${EXSCRIPT}
status=$?
[[ ${status} -ne 0 ]] && exit "${status}"

##############################################
# End JOB SPECIFIC work
##############################################

##############################################
# Final processing
##############################################
if [[ -e "${pgmout}" ]] ; then
cat "${pgmout}"
fi

exit 0
90 changes: 90 additions & 0 deletions jobs/JGDAS_GLOBAL_OCEAN_ANALYSIS_RUN
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
#!/bin/bash
export STRICT="NO"
source "${HOMEgfs}/ush/preamble.sh"

#############################
# Source relevant config files
#############################
export EXPDIR=${EXPDIR:-${HOMEgfs}/parm/config}
configs="base ocnanal ocnanalrun"
config_path=${EXPDIR:-${PACKAGEROOT}/gfs.${gfs_ver}/parm/config}
for config in ${configs}; do
. "${config_path}"/config."${config}"
status=$?
[[ ${status} -ne 0 ]] && exit "${status}"
done


##########################################
# Source machine runtime environment
##########################################
. "${HOMEgfs}"/env/"${machine}".env ocnanalrun
status=$?
[[ ${status} -ne 0 ]] && exit "${status}"


##############################################
# Obtain unique process id (pid) and make temp directory
##############################################
export pid=${pid:-$$}
export outid=${outid:-"LL${job}"}

export DATA=${DATA:-${DATAROOT}/ocnanal_${CDATE}}
mkdir -p "${DATA}"
cd "${DATA}" || (echo "${DATA} does not exist. ABORT!"; exit 1)


##############################################
# Run setpdy and initialize PDY variables
##############################################
export cycle="t${cyc}z"
setpdy.sh
. ./PDY


##############################################
# Determine Job Output Name on System
##############################################
export pgmout="OUTPUT.${pid}"
export pgmerr=errfile


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

export CDUMP=${CDUMP:-${RUN:-"gfs"}}
export COMPONENT=${COMPONENT:-ocean}

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

export COMOUT=${COMOUT:-${ROTDIR}/${CDUMP}.${PDY}/${cyc}/${COMPONENT}}

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

EXSCRIPT=${GDASPREPPY:-${HOMEgfs}/sorc/gdas.cd/scripts/exgdas_global_marine_analysis_run.sh}
${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}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't want this one either I don't think unless you have nothing to archive/save from this job back to the ROTDIR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@CoryMartin-NOAA , unless I messed up (very likely), the analysis and increment are dumped in COMOUT (==ROTDIR?) ... And as I write this, I realize I forgot to do the same for diag. Is it OK to have symlinks to directories in COMOUT/ROTDIR in which we directly write what we want to keep?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for now it is, but 'eventually' it is not. NCO wants no symlinks, and it makes sense from a solid state drive for run / spinning disk for storage perspective. What my plan is/was for the aerosol tasks (see PR#1106) is to copy everything I want to save from $DATA to $COMOUT as part of the finalize job after the run job.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good @CoryMartin-NOAA , I'll do this in a subsequent PR if that's OK with you (I'm just being polite and respectful in exchange for a green check). My next step is to reconcile my cycling branch with the changes here and make it work again, which I'm pretty sure will require some adjustment/bug fixes in the GDASApp and the g-w. Looking forward to it!


exit 0
16 changes: 16 additions & 0 deletions jobs/rocoto/ocnanalpost.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#! /usr/bin/env bash

source "${HOMEgfs}"/ush/preamble.sh
WalterKolczynski-NOAA marked this conversation as resolved.
Show resolved Hide resolved

###############################################################
# Source GDASApp modules
declare -l hpc=${machine}
WalterKolczynski-NOAA marked this conversation as resolved.
Show resolved Hide resolved
module purge
module use "${HOMEgfs}"/sorc/gdas.cd/modulefiles
module load GDAS/"${hpc}"

###############################################################
# Execute the JJOB
"${HOMEgfs}"/jobs/JGDAS_GLOBAL_OCEAN_ANALYSIS_POST
status=$?
exit "${status}"
16 changes: 16 additions & 0 deletions jobs/rocoto/ocnanalprep.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#! /usr/bin/env bash
WalterKolczynski-NOAA marked this conversation as resolved.
Show resolved Hide resolved

source "${HOMEgfs}"/ush/preamble.sh

###############################################################
# Source GDASApp modules
declare -l hpc=${machine}
module purge
module use "${HOMEgfs}"/sorc/gdas.cd/modulefiles
module load GDAS/"${hpc}"

###############################################################
# Execute the JJOB
"${HOMEgfs}"/jobs/JGDAS_GLOBAL_OCEAN_ANALYSIS_PREP
status=$?
exit "${status}"
16 changes: 16 additions & 0 deletions jobs/rocoto/ocnanalrun.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#! /usr/bin/env bash
WalterKolczynski-NOAA marked this conversation as resolved.
Show resolved Hide resolved

source "${HOMEgfs}"/ush/preamble.sh

###############################################################
# Source GDASApp modules
declare -l hpc=${machine}
module purge
module use "${HOMEgfs}"/sorc/gdas.cd/modulefiles
module load GDAS/"${hpc}"

###############################################################
# Execute the JJOB
"${HOMEgfs}"/jobs/JGDAS_GLOBAL_OCEAN_ANALYSIS_RUN
status=$?
exit "${status}"
1 change: 1 addition & 0 deletions parm/config/config.base.emc.dyn
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,7 @@ export imp_physics=@IMP_PHYSICS@
# DA engine
export DO_JEDIVAR="NO"
export DO_JEDIENS="NO"
export DO_JEDIOCNVAR="NO"

# Hybrid related
export DOHYBVAR="YES"
Expand Down
25 changes: 25 additions & 0 deletions parm/config/config.ocnanal
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash

########## config.ocnanal ##########
# configuration common to all atm analysis tasks

echo "BEGIN: config.ocnanal"

export OBS_YAML_DIR=${HOMEgfs}/sorc/gdas.cd/parm/soca/obs/config
export OBS_YAML=${HOMEgfs}/sorc/gdas.cd/parm/soca/obs/obs_list.yaml
export OBS_LIST=${OBS_YAML_DIR}/obs_list.yaml
export FV3JEDI_STAGE_YAML=${HOMEgfs}/sorc/gdas.cd/test/soca/testinput/dumy.yaml
export SOCA_INPUT_FIX_DIR=/scratch2/NCEPDEV/ocean/Guillaume.Vernieres/data/static/72x35x25/soca # TODO: Should be moved somewhere else
export SOCA_VARS=tocn,socn,ssh
export SOCA_NINNER=50
export CASE_ANL="C48"
export DOMAIN_STACK_SIZE=2000000
export JEDI_BIN=${HOMEgfs}/sorc/gdas.cd/build/bin

# TODO: Move the R2D2 configuration to a common space
export R2D2_OBS_DB=shared
export R2D2_OBS_DUMP=s2s_v1
export R2D2_OBS_SRC=gdas_marine
export R2D2_OBS_WINDOW=24 # TODO: Check if the R2D2 sampling DB window is still needed
export COMIN_OBS=/scratch2/NCEPDEV/marineda/r2d2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps add a TODO here to remind us to move this to a common space.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aerorahul : A common space for R2D2 stuff or for the entirety of config.ocnanal?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for R2D2

echo "END: config.ocnanal"
10 changes: 10 additions & 0 deletions parm/config/config.ocnanalpost
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash -x
WalterKolczynski-NOAA marked this conversation as resolved.
Show resolved Hide resolved

########## config.ocnanalpost ##########
# Post Ocn Analysis specific

echo "BEGIN: config.ocnanalpost"

# Get task specific resources
. "${EXPDIR}"/config.resources ocnanalpost
echo "END: config.ocnanalpost"
10 changes: 10 additions & 0 deletions parm/config/config.ocnanalprep
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash -x
WalterKolczynski-NOAA marked this conversation as resolved.
Show resolved Hide resolved

########## config.ocnanalprep ##########
# Pre Ocn Analysis specific

echo "BEGIN: config.ocnanalprep"

# Get task specific resources
. "${EXPDIR}"/config.resources ocnanalprep
echo "END: config.ocnanalprep"
11 changes: 11 additions & 0 deletions parm/config/config.ocnanalrun
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash -x
WalterKolczynski-NOAA marked this conversation as resolved.
Show resolved Hide resolved

########## config.ocnanalrun ##########
# Ocn Analysis specific

echo "BEGIN: config.ocnanalrun"

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

echo "END: config.ocnanalrun"
Loading