1 | #! /bin/bash |
---|
2 | |
---|
3 | # |
---|
4 | # - please link or copy start0.nc and startfi.nc (or start_archive.nc) |
---|
5 | # - please set 3 in the first parameter of run.def |
---|
6 | # - please set 0 in the first line of num_run |
---|
7 | # - please set daylim below (669 for the whole year) |
---|
8 | # |
---|
9 | |
---|
10 | ########## |
---|
11 | daylim=669 |
---|
12 | ########## |
---|
13 | |
---|
14 | rm -rf tmpsave |
---|
15 | mkdir tmpsave |
---|
16 | |
---|
17 | runnum=0 |
---|
18 | runnum_obsolete=0 |
---|
19 | daynum=0 |
---|
20 | |
---|
21 | while [ ${daynum} -lt ${daylim} ] |
---|
22 | do |
---|
23 | # run GCM during three days |
---|
24 | echo run starting at day ${daynum} |
---|
25 | echo '****' |
---|
26 | time run0 |
---|
27 | |
---|
28 | # save generated starting files |
---|
29 | echo saving files |
---|
30 | echo '****' |
---|
31 | runnum=$(expr ${runnum} + 1) |
---|
32 | save=$(expr ${daynum} + 2) |
---|
33 | cp start${runnum}.nc tmpsave/start${save}.nc |
---|
34 | cp startfi${runnum}.nc tmpsave/startfi${save}.nc |
---|
35 | mv lrun${runnum} tmpsave/lrun_for_start${save} |
---|
36 | |
---|
37 | # increment day to day+3 for while loop assessement |
---|
38 | daynum=$(expr ${daynum} + 3) |
---|
39 | |
---|
40 | # get rid of what was generated two steps before |
---|
41 | echo cleaning |
---|
42 | echo '****' |
---|
43 | if [ ${runnum} -gt 1 ] #because we want to keep start0.nc and startfi0.nc |
---|
44 | then |
---|
45 | runnum_obsolete=$(expr ${runnum} - 1) |
---|
46 | rm -rf start${runnum_obsolete}.nc |
---|
47 | rm -rf startfi${runnum_obsolete}.nc |
---|
48 | rm -rf diagfi${runnum_obsolete}.nc |
---|
49 | fi |
---|
50 | done |
---|
51 | |
---|
52 | # clean the last files |
---|
53 | rm -rf start${runnum}.nc |
---|
54 | rm -rf startfi${runnum}.nc |
---|
55 | rm -rf diagfi${runnum}.nc |
---|
56 | |
---|
57 | # end |
---|
58 | echo -- end -- |
---|
59 | echo please check results in file tmpsave |
---|
60 | echo if you want to keep the results, rename this folder |
---|