forked from NOAA-EMC/CFSv2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJCFS_CLEANUP
More file actions
executable file
·80 lines (63 loc) · 2.01 KB
/
JCFS_CLEANUP
File metadata and controls
executable file
·80 lines (63 loc) · 2.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#!/bin/sh
set -xa
####################################
# Specify NET and RUN Name and model
####################################
export NET=cfs
export RUN=cfs
export host=${host:-`hostname | cut -c1`}
export jlogfile=${jlogfile:-/dev/null}
###############################################
# SETUP CDAS POST PROCESSING VARIABLES
###############################################
export PS4='$SECONDS + '
date
##########################################################
# obtain unique process id (pid) and make temp directory
##########################################################
export pid=$$
export DATA=$DATAROOT/$job.$pid
mkdir -p $DATA
cd $DATA
####################################
# Determine Job Output Name on System
####################################
export pgmout="OUTPUT.${pid}"
export pgmerr=errfile
export cycle=t${cyc}z
##############################
# Run setpdy and initialize PDY variables
##############################
sh setpdy.sh
. ./PDY
##########################################################
# define cfs directories/scripts/executables
##########################################################
export EXECcfs=$HOMEcfs/exec
export PARMcfs=$HOMEcfs/parm
export USHcfs=$HOMEcfs/ush
export FIXcfs=$HOMEcfs/fix
##############################################
# Define COM directories
##############################################
export COMROT=$COMROOT/${NET}/${envir}
export COMIN=$COMROOT/${NET}/${envir}/${RUN}.${PDY}
##############################################
# Define GES directories
##############################################
export gespath=${gespath:-${GESROOT}/${envir}}
env
###############################
# Execute the Script
###############################
${CFSCLEANUPSH:-$HOMEcfs/scripts/excfs_cleanup.sh.ecf}
err=$?; err_chk
cat $pgmout
msg="ENDED NORMALLY."
postmsg "$jlogfile" "$msg"
########################################
# Remove the Temporary working directory
########################################
cd $DATAROOT
if [ ${KEEPDATA:-NO} = NO ] ; then rm -rf $DATA ; fi
date