-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgcm_quickplot.csh
executable file
·34 lines (27 loc) · 1.04 KB
/
gcm_quickplot.csh
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
#!/bin/csh -f
set JOBID = $1
set LISTFILE = $2
#######################################################################
# Quickplot Commands
#######################################################################
while( -e $LISTFILE )
if( -e LOCKFILE ) /bin/echo "Waiting for LOCKFILE ... "
if( -e LOCKFILE ) set LOCK = `stat -c %Z LOCKFILE`
while( -e LOCKFILE )
set EPOCH = `date +'%s'`
@ LOCKAGE = $EPOCH - $LOCK
if( $LOCKAGE > 120 ) /bin/rm -f LOCKFILE
end
lockfile -${JOBID} LOCKFILE
if( -e $LISTFILE ) then
set PLOT_COMMAND = `head -1 $LISTFILE`
sed 1,1d -i $LISTFILE
set nlist = `wc -c $LISTFILE | cut -d" " -f 1`
if( $nlist == 0 ) /bin/rm -f $LISTFILE
/bin/rm -f LOCKFILE
echo "JOBID: $JOBID $GEOSUTIL/plots/quickplot $PLOT_COMMAND "
$GEOSUTIL/plots/quickplot $PLOT_COMMAND
else
/bin/rm -f LOCKFILE
endif
end