Skip to content

Commit

Permalink
Clean $DATA and have all steps of ocean anl use same $DATA
Browse files Browse the repository at this point in the history
The ocean analysis jobs appear to need a persistent $DATA directory,
so the j-jobs have had their previous settings for $DATA restored.

Additionally, the j-job header now wipes any existing $DATA
directory if the variable $WIPE_DATA is set to "YES", which is the
default. To allow the persistent $DATA for the ocean analysis jobs,
the RUN and POST j-jobs set $WIPE_DATA to "NO".
  • Loading branch information
WalterKolczynski-NOAA committed Jan 9, 2023
1 parent 95a4d9c commit 92cb4e7
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
2 changes: 2 additions & 0 deletions jobs/JGDAS_GLOBAL_OCEAN_ANALYSIS_POST
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/bin/bash
export STRICT="NO"
source "${HOMEgfs}/ush/preamble.sh"
WIPE_DATA="NO"
DATA="${DATA:-${DATAROOT}/${RUN}ocnanal_${cyc}}"
source "${HOMEgfs}/ush/jjob_header.sh" base ocnanalpost


Expand Down
1 change: 1 addition & 0 deletions jobs/JGDAS_GLOBAL_OCEAN_ANALYSIS_PREP
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/bash
export STRICT="NO"
source "${HOMEgfs}/ush/preamble.sh"
DATA="${DATA:-${DATAROOT}/${RUN}ocnanal_${cyc}}"
source "${HOMEgfs}/ush/jjob_header.sh" base ocnanal ocnanalprep


Expand Down
2 changes: 2 additions & 0 deletions jobs/JGDAS_GLOBAL_OCEAN_ANALYSIS_RUN
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/bin/bash
export STRICT="NO"
source "${HOMEgfs}/ush/preamble.sh"
WIPE_DATA="NO"
DATA="${DATA:-${DATAROOT}/${RUN}ocnanal_${cyc}}"
source "${HOMEgfs}/ush/jjob_header.sh" base ocnanal ocnanalrun


Expand Down
6 changes: 5 additions & 1 deletion ush/jjob_header.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
# Universal header for global j-jobs
#
# Sets up and completes actions common to all j-jobs:
# - Creates and moves to $DATA
# - Creates and moves to $DATA after removing any
# existing one unless $WIPE_DATA is set to "NO"
# - Runs `setpdy.sh`
# - Sources configs provided as arguments
# - Sources machine environment script
Expand Down Expand Up @@ -33,6 +34,9 @@ configs=("$@")
# make temp directory
##############################################
export DATA=${DATA:-"${DATAROOT}/${jobid}"}
if [[ ${WIPE_DATA:-YES} == "YES" ]]; then
rm -rf "${DATA}"
fi
mkdir -p "${DATA}"
cd "${DATA}" || ( echo "FATAL: ${DATA} does not exist"; exit 1 )

Expand Down

0 comments on commit 92cb4e7

Please sign in to comment.