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