Skip to content

Commit 92cb4e7

Browse files
Clean $DATA and have all steps of ocean anl use same $DATA
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".
1 parent 95a4d9c commit 92cb4e7

File tree

4 files changed

+10
-1
lines changed

4 files changed

+10
-1
lines changed

jobs/JGDAS_GLOBAL_OCEAN_ANALYSIS_POST

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#!/bin/bash
22
export STRICT="NO"
33
source "${HOMEgfs}/ush/preamble.sh"
4+
WIPE_DATA="NO"
5+
DATA="${DATA:-${DATAROOT}/${RUN}ocnanal_${cyc}}"
46
source "${HOMEgfs}/ush/jjob_header.sh" base ocnanalpost
57

68

jobs/JGDAS_GLOBAL_OCEAN_ANALYSIS_PREP

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/bin/bash
22
export STRICT="NO"
33
source "${HOMEgfs}/ush/preamble.sh"
4+
DATA="${DATA:-${DATAROOT}/${RUN}ocnanal_${cyc}}"
45
source "${HOMEgfs}/ush/jjob_header.sh" base ocnanal ocnanalprep
56

67

jobs/JGDAS_GLOBAL_OCEAN_ANALYSIS_RUN

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#!/bin/bash
22
export STRICT="NO"
33
source "${HOMEgfs}/ush/preamble.sh"
4+
WIPE_DATA="NO"
5+
DATA="${DATA:-${DATAROOT}/${RUN}ocnanal_${cyc}}"
46
source "${HOMEgfs}/ush/jjob_header.sh" base ocnanal ocnanalrun
57

68

ush/jjob_header.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
# Universal header for global j-jobs
44
#
55
# Sets up and completes actions common to all j-jobs:
6-
# - Creates and moves to $DATA
6+
# - Creates and moves to $DATA after removing any
7+
# existing one unless $WIPE_DATA is set to "NO"
78
# - Runs `setpdy.sh`
89
# - Sources configs provided as arguments
910
# - Sources machine environment script
@@ -33,6 +34,9 @@ configs=("$@")
3334
# make temp directory
3435
##############################################
3536
export DATA=${DATA:-"${DATAROOT}/${jobid}"}
37+
if [[ ${WIPE_DATA:-YES} == "YES" ]]; then
38+
rm -rf "${DATA}"
39+
fi
3640
mkdir -p "${DATA}"
3741
cd "${DATA}" || ( echo "FATAL: ${DATA} does not exist"; exit 1 )
3842

0 commit comments

Comments
 (0)