forked from TRACMASS/Tracmass_previous
-
Notifications
You must be signed in to change notification settings - Fork 0
/
loop_jarvis_reverse
executable file
·59 lines (47 loc) · 1.34 KB
/
loop_jarvis_reverse
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
#!/bin/bash
# Script to automate multiple tracmass runs
# Based on script by Ashley Van Name
# ===================USER INPUT=====================#
infil=/Users/liz/TOOLS/tracmass/projects/pipa/template.in
tempfil=$infil.tmp
outfil=/Users/liz/TOOLS/tracmass/projects/pipa/pipa.in
yr=2013
nmdays=(31 28 31 30 31 30 31 31 30 31 30 31)
while (($yr >= 1993)); do
echo $yr
if (($yr == 2013)); then
mon=11;
else
mon=12;
fi
ineq=$((yr%4))
if (($ineq == 0)); then
nmdays[1]=29
else
nmdays[1]=28
fi
while (($mon >= 1)); do
day=${nmdays[$mon-1]}
# if (($yr == 2013 && $mon == 12)); then
# nmdays[11]=24
# else
# nmdays[11]=31
# fi
while (($day >= 1)); do
# Edit pipa.in file
cp $infil $infil.tmp
sed -i -n "s/<DAY>/$day/g" $tempfil
sed -i -n "s/<MONTH>/$mon/g" $tempfil
sed -i -n "s/<YEAR>/$yr/g" $tempfil
mv $tempfil $outfil
# Run TRACMASS
./runtrm
echo $day
echo $yr
((day+=-1))
done
((mon+=-1))
done
((yr+=-1))
rm $infil.tmp*
done