1 | #! /bin/bash |
---|
2 | |
---|
3 | ############################### |
---|
4 | # use: - launch_gcm # |
---|
5 | # - echo 22 | launch_gcm # |
---|
6 | ############################### |
---|
7 | |
---|
8 | # Author : A. Spiga - Spring/Winter 2008 |
---|
9 | # added link trick in 2011 |
---|
10 | |
---|
11 | if [[ ! -d startbase ]] |
---|
12 | then |
---|
13 | echo "please create in $PWD a symbolic link: startbase" |
---|
14 | echo "for instance: ln -sf /san/home/spiga/DATAFILE/STARTBASE_64_48_32_t2 $PWD/startbase" |
---|
15 | echo "(and compile the GCM with the correct dimensions)" |
---|
16 | exit |
---|
17 | fi |
---|
18 | ################## |
---|
19 | #startbase='../../STARTS/' |
---|
20 | #startbase='/d2/emlmd/run_LMDZ.MARS.BETA.TASI/tau1/' |
---|
21 | #startbase='/tmp7/aslmd/flush/' |
---|
22 | #startbase='/tmp7/aslmd/flush2/' |
---|
23 | #startbase='/d6/vblmd/MERIDIANI_EXOMARS/starts_en_cours/tau05/' |
---|
24 | startbase='/d5/aslmd/LMD_MM_MARS_DATA/STARTBASE_64_48_25_t2dust_JBM/' |
---|
25 | ################## |
---|
26 | |
---|
27 | # |
---|
28 | # get simulation start day and compute start/startfi required date (simulation day - 1) |
---|
29 | # |
---|
30 | echo '>>>' choose start sol ? ; read daygcm |
---|
31 | #if [[ "$daygcm" == 0 ]] |
---|
32 | #then |
---|
33 | #daygcm=669 |
---|
34 | #fi |
---|
35 | daygcm=$(expr ${daygcm} - 1) |
---|
36 | |
---|
37 | # |
---|
38 | # find the correct start/startfi files among 3-day startbase |
---|
39 | # |
---|
40 | ls ${startbase}/start${daygcm}.nc > /dev/null 2> /dev/null |
---|
41 | if [[ "$?" == 0 ]] |
---|
42 | then |
---|
43 | echo found ! ${daygcm} |
---|
44 | else |
---|
45 | #echo not found ! ${daygcm} |
---|
46 | daygcm=$(expr ${daygcm} - 1) |
---|
47 | ls ${startbase}/start${daygcm}.nc > /dev/null 2> /dev/null |
---|
48 | if [[ "$?" == 0 ]] # probably a 'while' loop would be better if more than 3 |
---|
49 | then |
---|
50 | echo found ! ${daygcm} |
---|
51 | else |
---|
52 | #echo not found ! ${daygcm} |
---|
53 | daygcm=$(expr ${daygcm} - 1) |
---|
54 | ls ${startbase}/start${daygcm}.nc > /dev/null 2> /dev/null |
---|
55 | echo found ! ${daygcm} |
---|
56 | fi |
---|
57 | fi |
---|
58 | |
---|
59 | # |
---|
60 | # link start/startfi files |
---|
61 | # |
---|
62 | ln -sf ${startbase}/start${daygcm}.nc start.nc |
---|
63 | ln -sf ${startbase}/startfi${daygcm}.nc startfi.nc |
---|
64 | |
---|
65 | # |
---|
66 | # clean the place |
---|
67 | # |
---|
68 | rm -rf restart.nc 2> /dev/null |
---|
69 | rm -rf restartfi.nc 2> /dev/null |
---|
70 | rm -rf log_gcm 2> /dev/null |
---|
71 | |
---|
72 | # |
---|
73 | # run ! |
---|
74 | # |
---|
75 | echo running the GCM - check in ${PWD}/log_gcm |
---|
76 | nohup gcm.e > log_gcm |
---|
77 | |
---|
78 | exit |
---|