Skip to content

Commit f78afeb

Browse files
More marine DA j-jobs (#1270)
Addition of 2 j-jobs: - jobs/JGDAS_GLOBAL_OCEAN_ANALYSIS_BMAT_VRFY This job currently dumps a few files of the impulse response of B. Not meant to ever go in ops. - jobs/JGDAS_GLOBAL_OCEAN_ANALYSIS_VRFY This job will eventually generate relevant figures from the marine DA cycle. It currently points to a script that does not yet exist. I also took this PR opportunity to: - update how we load the modules, following what was done for the atmosphere. - modify ```ush/load_ufsda_modules.sh``` so we could optionally specify what to load (GDAS or EVA), default is GDAS when no argument is present - Use POST to copy what's needed in `COM` Fixes #1273
1 parent fb54bb6 commit f78afeb

9 files changed

+180
-24
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#!/bin/bash
2+
export STRICT="NO"
3+
source "${HOMEgfs}/ush/preamble.sh"
4+
5+
6+
export DATA="${DATAROOT}/${RUN}ocnanal_${cyc}"
7+
source "${HOMEgfs}/ush/jjob_header.sh" -e "ocnanalrun" -c "base ocnanal ocnanalrun"
8+
9+
10+
##############################################
11+
# Set variables used in the script
12+
##############################################
13+
14+
15+
##############################################
16+
# Begin JOB SPECIFIC work
17+
##############################################
18+
19+
export COMOUT=${COMOUT:-${ROTDIR}/${CDUMP}.${PDY}/${cyc}/ocean}
20+
21+
###############################################################
22+
# Run relevant script
23+
24+
EXSCRIPT=${GDASPREPPY:-${HOMEgfs}/sorc/gdas.cd/scripts/exgdas_global_marine_analysis_bmat_vrfy.sh}
25+
${EXSCRIPT}
26+
status=$?
27+
[[ ${status} -ne 0 ]] && exit "${status}"
28+
29+
##############################################
30+
# End JOB SPECIFIC work
31+
##############################################
32+
33+
##############################################
34+
# Final processing
35+
##############################################
36+
if [[ -e "${pgmout}" ]] ; then
37+
cat "${pgmout}"
38+
fi
39+
40+
##########################################
41+
# Do not remove the Temporary working directory (do this in POST)
42+
##########################################
43+
cd "${DATAROOT}" || exit 1
44+
45+
exit 0

jobs/JGDAS_GLOBAL_OCEAN_ANALYSIS_POST

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,49 @@ DATA="${DATAROOT}/${RUN}ocnanal_${cyc}"
66
source "${HOMEgfs}/ush/jjob_header.sh" -e "ocnanalpost" -c "base ocnanalpost"
77

88

9+
##############################################
10+
# Begin JOB SPECIFIC work
11+
##############################################
12+
13+
export COMOUT=${COMOUT:-${ROTDIR}/${CDUMP}.${PDY}/${cyc}/ocean}
14+
export CDATE=${CDATE:-${PDY}${cyc}}
15+
16+
mkdir -p "${COMOUT}"
17+
918
###############################################################
1019
# Run relevant script
1120
###############################################################
1221

22+
# Save some of the DA cycle output to COMOUT
23+
# TODO: Move to a dedicated script
24+
25+
# Make a copy the IAU increment
26+
cp "${DATA}/inc.nc" "${COMOUT}/${CDUMP}.t${cyc}z.ocninc.nc"
27+
28+
# TODO: Dump-splash of the sea-ice restart not done yet
29+
30+
# Copy of the ioda output files, as is for now
31+
cp -r "${DATA}/diags" "${COMOUT}"
32+
33+
# Copy of the diagonal of the background error for the cycle
34+
bdate=$(date -d "${CDATE:0:8} ${CDATE:8:2} - 3 hours" +"%Y-%m-%dT%H:00:00Z")
35+
cp "${DATA}/ocn.bkgerr_stddev.incr.${bdate}.nc" "${COMOUT}/${CDUMP}.t${cyc}z.ocn.bkgerr_stddev.nc"
36+
cp "${DATA}/ice.bkgerr_stddev.incr.${bdate}.nc" "${COMOUT}/${CDUMP}.t${cyc}z.ice.bkgerr_stddev.nc"
37+
38+
# Copy the loacalization and correlation operators
39+
cp -rL "${DATA}/bump" "${COMOUT}/bump"
40+
41+
# Copy the analysis in the middle of the window
42+
cdate=$(date -d "${CDATE:0:8} ${CDATE:8:2}" +"%Y-%m-%dT%H:00:00Z")
43+
cp "${DATA}/Data/ocn.3dvarfgat_pseudo.an.${cdate}.nc" "${COMOUT}/${CDUMP}.t${cyc}z.ocnana.nc"
1344

14-
# TODO (#982)
45+
# Copy DA grid (computed for the start of the window)
46+
bcyc=$(((cyc - 3 + 24) % 24))
47+
cp "${DATA}/soca_gridspec.nc" "${COMOUT}/${CDUMP}.t${bcyc}z.ocngrid.nc"
1548

49+
# Copy logs
50+
mkdir -p "${COMOUT}/logs"
51+
cp "${DATA}/*.out" "${COMOUT}/logs"
1652

1753
##########################################
1854
# Remove the Temporary working directory

jobs/JGDAS_GLOBAL_OCEAN_ANALYSIS_RUN

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,15 @@
22
export STRICT="NO"
33
source "${HOMEgfs}/ush/preamble.sh"
44
WIPE_DATA="NO"
5-
DATA="${DATAROOT}/${RUN}ocnanal_${cyc}"
5+
export DATA="${DATAROOT}/${RUN}ocnanal_${cyc}"
66
source "${HOMEgfs}/ush/jjob_header.sh" -e "ocnanalrun" -c "base ocnanal ocnanalrun"
77

88

9-
##############################################
10-
# Set variables used in the script
11-
##############################################
12-
13-
export CDUMP=${CDUMP:-${RUN:-"gfs"}}
14-
export COMPONENT="ocean"
15-
169
##############################################
1710
# Begin JOB SPECIFIC work
1811
##############################################
1912

20-
export COMOUT=${COMOUT:-${ROTDIR}/${CDUMP}.${PDY}/${cyc}/${COMPONENT}}
13+
export COMOUT=${COMOUT:-${ROTDIR}/${CDUMP}.${PDY}/${cyc}/ocean}
2114

2215
###############################################################
2316
# Run relevant script
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#!/bin/bash
2+
export STRICT="NO"
3+
source "${HOMEgfs}/ush/preamble.sh"
4+
source "${HOMEgfs}/ush/jjob_header.sh" -e "ocnanalprep" -c "base ocnanal ocnanalprep"
5+
6+
7+
##############################################
8+
# Set variables used in the script
9+
##############################################
10+
11+
12+
##############################################
13+
# Begin JOB SPECIFIC work
14+
##############################################
15+
16+
export COMOUT=${COMOUT:-${ROTDIR}/${CDUMP}.${PDY}/${cyc}/ocean}
17+
18+
# Add UFSDA to PYTHONPATH
19+
export PYTHONPATH=${HOMEgfs}/sorc/gdas.cd/ush/:${PYTHONPATH}
20+
21+
###############################################################
22+
# Run relevant script
23+
24+
EXSCRIPT=${GDASPREPPY:-${HOMEgfs}/sorc/gdas.cd/scripts/exgdas_global_marine_analysis_vrfy.py}
25+
${EXSCRIPT}
26+
status=$?
27+
[[ ${status} -ne 0 ]] && exit "${status}"
28+
29+
##############################################
30+
# End JOB SPECIFIC work
31+
##############################################
32+
33+
##############################################
34+
# Final processing
35+
##############################################
36+
if [[ -e "${pgmout}" ]] ; then
37+
cat "${pgmout}"
38+
fi
39+
40+
##########################################
41+
# Do not remove the Temporary working directory (do this in POST)
42+
##########################################
43+
cd "${DATAROOT}" || exit 1
44+
45+
exit 0

jobs/rocoto/ocnanalpost.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
source "${HOMEgfs}/ush/preamble.sh"
44

55
###############################################################
6-
# Source GDASApp modules
7-
module purge
8-
module use "${HOMEgfs}/sorc/gdas.cd/modulefiles"
9-
module load GDAS/"${machine,,}"
6+
# Source UFSDA workflow modules
7+
. "${HOMEgfs}/ush/load_ufsda_modules.sh"
8+
status=$?
9+
[[ ${status} -ne 0 ]] && exit "${status}"
1010

1111
export job="ocnanalpost"
1212
export jobid="${job}.$$"

jobs/rocoto/ocnanalprep.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
#! /usr/bin/env bash
22

3+
export STRICT="NO"
34
source "${HOMEgfs}/ush/preamble.sh"
45

56
###############################################################
6-
# Source GDASApp modules
7-
module purge
8-
module use "${HOMEgfs}/sorc/gdas.cd/modulefiles"
9-
module load "GDAS/${machine,,}"
7+
# Source UFSDA workflow modules
8+
. "${HOMEgfs}/ush/load_ufsda_modules.sh"
9+
status=$?
10+
[[ ${status} -ne 0 ]] && exit "${status}"
1011

1112
export job="ocnanalprep"
1213
export jobid="${job}.$$"

jobs/rocoto/ocnanalrun.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
source "${HOMEgfs}/ush/preamble.sh"
44

55
###############################################################
6-
# Source GDASApp modules
7-
module purge
8-
module use "${HOMEgfs}/sorc/gdas.cd/modulefiles"
9-
module load GDAS/"${machine,,}"
6+
# Source UFSDA workflow modules
7+
. "${HOMEgfs}/ush/load_ufsda_modules.sh"
8+
status=$?
9+
[[ ${status} -ne 0 ]] && exit "${status}"
1010

1111
export job="ocnanalrun"
1212
export jobid="${job}.$$"

jobs/rocoto/ocnanalvrfy.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#! /usr/bin/env bash
2+
3+
export STRICT="NO"
4+
source "${HOMEgfs}/ush/preamble.sh"
5+
6+
###############################################################
7+
# Source UFSDA workflow modules
8+
. "${HOMEgfs}/ush/load_ufsda_modules.sh" --eva
9+
status=$?
10+
[[ ${status} -ne 0 ]] && exit "${status}"
11+
12+
export job="ocnanalvrfy"
13+
export jobid="${job}.$$"
14+
15+
###############################################################
16+
# Execute the JJOB
17+
"${HOMEgfs}/jobs/JGDAS_GLOBAL_OCEAN_ANALYSIS_VRFY"
18+
status=$?
19+
exit "${status}"

ush/load_ufsda_modules.sh

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,23 @@ if [[ "${DEBUG_WORKFLOW:-NO}" == "NO" ]]; then
66
set +x
77
fi
88

9+
# Read optional module argument, default is to use GDAS
10+
MODS="GDAS"
11+
if [[ $# -gt 0 ]]; then
12+
case "$1" in
13+
--eva)
14+
MODS="EVA"
15+
;;
16+
--gdas)
17+
MODS="GDAS"
18+
;;
19+
*)
20+
echo "Invalid option: $1" >&2
21+
exit 1
22+
;;
23+
esac
24+
fi
25+
926
# Setup runtime environment by loading modules
1027
ulimit_s=$( ulimit -S -s )
1128

@@ -23,14 +40,14 @@ elif [[ -d /lfs3 ]] ; then
2340
echo WARNING: UFSDA NOT SUPPORTED ON THIS PLATFORM
2441
elif [[ -d /scratch1 ]] ; then
2542
# We are on NOAA Hera
26-
module load GDAS/hera
43+
module load "${MODS}/hera"
2744
if [[ "${DEBUG_WORKFLOW}" == "YES" ]] ; then
2845
module list
2946
pip list
3047
fi
3148
elif [[ -d /work ]] ; then
3249
# We are on MSU Orion
33-
module load GDAS/orion
50+
module load "${MODS}/orion"
3451
if [[ "${DEBUG_WORKFLOW}" == "YES" ]] ; then
3552
module list
3653
pip list

0 commit comments

Comments
 (0)