1 | #!/bin/bash |
---|
2 | # script pour lancer une deglaciation Euras-20 |
---|
3 | |
---|
4 | # name of the run: |
---|
5 | #IPSL |
---|
6 | namerun="DGL-EURAS-IPSL" |
---|
7 | #namerun="DGL-IPSL-atm1-pdd2" #Tsai |
---|
8 | #namerun="DGL-IPSL-atm1-pdd2-Schoof" # Schoof |
---|
9 | #namerun="DGL-IPSL-atm1-pdd2-rap0.07-lap7" #rappact 0.07 |
---|
10 | #namerun="DGL-IPSL-atm1-pdd2-rap0.07-lap7-50k" # restart -50k |
---|
11 | #namerun="DGL-IPSL-atm0-pdd2-rap0.11-lap7-psolid-sigma5.5" # psolid=0 et sigma=5.5 |
---|
12 | #namerun="DGL-IPSL-atm0.75-pdd2-rap0.11-lap7-psolid-sigma5.5-calv0" |
---|
13 | #namerun="DGL-IPSL-atm0.25-pdd2-rap0.11-lap7-psolid-sigma5.5-lake50" # -lake-1000 50 |
---|
14 | #namerun="DGL-IPSL-atm0.25-pdd2-rap0.11-lap7-psolid-sigma5.5-sedim0.5-lake-1000" # sediment + rapides |
---|
15 | #namerun="DGL-IPSL-atm0.55-pdd2-rap0.11-lap7-psolid-sigma5.5-sedim0.5" |
---|
16 | #FGOALS |
---|
17 | #namerun="DGL-FGOA-atm0-pdd2" #Tsai |
---|
18 | #namerun="DGL-FGOA-atm1-pdd2-Schoof" # Schoof |
---|
19 | #namerun="DGL-FGOA-atm1-pdd2-rap0.07" #rappact 0.07 |
---|
20 | #namerun="DGL-FGOA-atm1-pdd2-rap0.07-lap7-50k" # restart -50k |
---|
21 | #namerun="DGL-FGOA-atm0-pdd2-rap0.11-lap7-psolid-sigma5.5" # psolid=0 |
---|
22 | #namerun="DGL-FGOA-atm0.25-pdd2-rap0.11-lap7-psolid-sigma5.5-lake-1000" # bmelt0.1 0.2 1 - calv0 50 150 - lake-1000 200 |
---|
23 | #namerun="DGL-FGOA-atm0.25-pdd2-rap0.11-lap7-psolid-sigma5.5-sedim0.5" # sediment + rapides |
---|
24 | #namerun="DGL-FGOA-atm0.55-pdd2-rap0.11-lap7-psolid-sigma5.5-sedim0.5" |
---|
25 | #MPI |
---|
26 | #namerun="DGL-MPI--atm1-pdd2" #Tsai |
---|
27 | #namerun="DGL-MPI--atm0-pdd2-Schoof" # Schoof |
---|
28 | #namerun="DGL-MPI--atm1-pdd2-rap0.07-lap7" #rappact 0.07 |
---|
29 | #namerun="DGL-MPI--atm1-pdd2-rap0.07-lap7-50k" # restart -50k |
---|
30 | #namerun="DGL-MPI--atm0-pdd2-rap0.11-lap7-psolid-sigma5.5" #psolid=0 sigma=5.5 |
---|
31 | #namerun="DGL-MPI--atm0.25-pdd2-rap0.11-lap7-psolid-sigma5.5-lake50" # bmelt0.1 0.2 1 - calv0 50 150 - lake-1000 200 |
---|
32 | #namerun="DGL-MPI--atm0.25-pdd2-rap0.11-lap7-psolid-sigma5.5-sedim0.5-lake-1000" # sediment + rapides |
---|
33 | #namerun="DGL-MPI--atm0.55-pdd2-rap0.11-lap7-psolid-sigma5.5-sedim0.5" |
---|
34 | #namerun="DGL-MPI--atm0.25-pdd2-rap0.11-lap7-psolid-sigma5.5-sedim0.5-calv0" |
---|
35 | #MRI |
---|
36 | #namerun="DGL-MRI--atm0-pdd1" #Tsai |
---|
37 | #namerun="DGL-MRI--atm0-pdd1-Schoof" # Schoof |
---|
38 | #MIROC |
---|
39 | #namerun="DGL-MIROC-atm0-pdd2" #Tsai |
---|
40 | #namerun="DGL-MIROC-atm1-pdd2-Schoof" # Schoof |
---|
41 | #namerun="DGL-MIROC-atm1-pdd2-rap0.07-lap7" #rappact 0.07 |
---|
42 | #namerun="DGL-MIROC-atm1-pdd2-rap0.07-lap7-50k" #restart -50k |
---|
43 | #namerun="DGL-MIROC-atm0-pdd2-rap0.11-lap7-psolid-sigma5.5" # psolid=0 sigma=5.5 |
---|
44 | #namerun="DGL-MIROC-atm0.25-pdd2-rap0.11-lap7-psolid-sigma5.5-lake-1000" # bmelt0.1 0.2 1 - calv0 50 150 - lake-1000 200 |
---|
45 | #namerun="DGL-MIROC-atm0.25-pdd2-rap0.11-lap7-psolid-sigma5.5-sedim0.5" # sediment + rapides |
---|
46 | #namerun="DGL-MIROC-atm0.55-pdd2-rap0.11-lap7-psolid-sigma5.5-sedim0.5" |
---|
47 | #GISS |
---|
48 | #namerun="DGL-GISS-atm1-pdd2-rap0.11-lap7-psolid-sigma5.5" # psolid=0 sigma=5.5 |
---|
49 | #namerun="DGL-GISS-atm0.25-pdd2-rap0.11-lap7-psolid-sigma5.5-lake50" # bmelt0.1 0.2 1 - calv0 50 150 - lake-1000 200 |
---|
50 | #namerun="DGL-GISS-atm0.25-pdd2-rap0.11-lap7-psolid-sigma5.5-sedim0.5-lake-1000-out" # sediment + rapides |
---|
51 | #namerun="DGL-GISS-atm0.55-pdd2-rap0.11-lap7-psolid-sigma5.5-sedim0.5" |
---|
52 | |
---|
53 | |
---|
54 | tmodelend="0." |
---|
55 | tmodelbegin="-26000." |
---|
56 | #tmodelbegin="-50000." |
---|
57 | tmodellength="26000." |
---|
58 | #tmodellength="50000." |
---|
59 | runatmvar="0.25" |
---|
60 | runpdd="2" |
---|
61 | |
---|
62 | parallel="yes" # "yes or no?" |
---|
63 | |
---|
64 | #Revision number : |
---|
65 | rev=`svn info | grep "Révision : " | awk '{print $2}'` |
---|
66 | echo "Code revision svn "$rev |
---|
67 | |
---|
68 | echo "-------------------------------------" |
---|
69 | echo " Now launching run: " $namerun |
---|
70 | echo " ------------------------- " |
---|
71 | |
---|
72 | #-------------------------------------------------- |
---|
73 | # Check if times are ok: |
---|
74 | #-------------------------------------------------- |
---|
75 | |
---|
76 | tcheck=`echo "$tmodelbegin + $tmodellength" | bc -l` |
---|
77 | tcheckbis=`echo "$tmodelend + 0" | bc -l` |
---|
78 | if [ $tcheck != $tcheckbis ]; then |
---|
79 | echo "The times provided are wrong!" |
---|
80 | echo $tcheck $tcheckbis |
---|
81 | echo "Tbegin:" $tmodelbegin ", Tend:" $tmodelend ", length:" $tmodellength |
---|
82 | exit 0 |
---|
83 | else |
---|
84 | echo "The times provided are correct." |
---|
85 | fi |
---|
86 | |
---|
87 | #-------------------------------------------------- |
---|
88 | # The different directories: |
---|
89 | #-------------------------------------------------- |
---|
90 | LAUCHING_DIR=`pwd` |
---|
91 | GRISLI_DIR=${LAUCHING_DIR%%/lauching_area} |
---|
92 | RUNDIR=${GRISLI_DIR}"/RUNS/"${namerun} |
---|
93 | MODELMASTER=${GRISLI_DIR}"/SOURCES" |
---|
94 | MODEL=${RUNDIR}"/SOURCES" |
---|
95 | |
---|
96 | if [ -d $RUNDIR ]; then |
---|
97 | echo "This run exists, do you really want to overwrite?" |
---|
98 | echo "You have 3 sec. to do a ctr+c..." |
---|
99 | sleep 3 |
---|
100 | echo "Ok, your choice." |
---|
101 | else |
---|
102 | mkdir $RUNDIR |
---|
103 | echo " Run will be in:" |
---|
104 | echo " " $RUNDIR |
---|
105 | fi |
---|
106 | |
---|
107 | if [ -d $MODEL ]; then |
---|
108 | echo "model dir already created, cleaning up before copying files" |
---|
109 | rm -rf $MODEL"/"* |
---|
110 | else |
---|
111 | mkdir $MODEL |
---|
112 | fi |
---|
113 | |
---|
114 | cp -R $MODELMASTER"/"* $MODEL"/." |
---|
115 | svn status $MODELMASTER > $MODEL"/svn.status.txt" |
---|
116 | svn diff $MODELMASTER > $MODEL"/svn.diff.txt" |
---|
117 | |
---|
118 | if [ -d $RUNDIR"/bin" ]; then |
---|
119 | echo "exe in bin/" |
---|
120 | else |
---|
121 | mkdir $RUNDIR"/bin" |
---|
122 | fi |
---|
123 | |
---|
124 | if [ -d $RUNDIR"/RESULTATS" ]; then |
---|
125 | echo "exe in RESULTATS/" |
---|
126 | else |
---|
127 | mkdir $RUNDIR"/RESULTATS" |
---|
128 | fi |
---|
129 | |
---|
130 | if [ -d $RUNDIR"/INPUT" ]; then |
---|
131 | echo "inputs are linked to model master" |
---|
132 | else |
---|
133 | echo "inputs will be linked to model master" |
---|
134 | mkdir $RUNDIR"/INPUT" |
---|
135 | fi |
---|
136 | |
---|
137 | |
---|
138 | |
---|
139 | echo "Now copying master files to the working directory:" |
---|
140 | echo $RUNDIR |
---|
141 | echo "And to the model directory:" |
---|
142 | echo $MODEL |
---|
143 | |
---|
144 | cp "Master-files/euras_TEMPS-NETCDF-degla.dat" $MODEL"/Fichiers-parametres/euras20_TEMPS-NETCDF.dat" |
---|
145 | cp "degla_PMIP_euras20_param_list.dat" $RUNDIR"/bin/euras20_param_list.dat" |
---|
146 | |
---|
147 | if [ $parallel = "yes" ]; then |
---|
148 | cp "Master-files/grisli.run.openmp_euras20" $RUNDIR"/bin/grisli.run" |
---|
149 | else |
---|
150 | cp "Master-files/grisli.run_euras20" $RUNDIR"/bin/grisli.run" |
---|
151 | fi |
---|
152 | |
---|
153 | cd $RUNDIR"/INPUT" |
---|
154 | ln -sf ${GRISLI_DIR}"/INPUT/EURASIE20" . |
---|
155 | ln -sf ${GRISLI_DIR}"/INPUT/Forcage" . |
---|
156 | ln -sf ${GRISLI_DIR}"/INPUT/tracer.dat" . |
---|
157 | |
---|
158 | #-------------------------------------------------- |
---|
159 | # Replacing key words: |
---|
160 | #-------------------------------------------------- |
---|
161 | |
---|
162 | # run spec.: |
---|
163 | sed -i "s/RUNNAME/$namerun/" $RUNDIR"/bin/euras20_param_list.dat" |
---|
164 | sed -i "s/RUNTBEGIN/$tmodelbegin/" $RUNDIR"/bin/euras20_param_list.dat" |
---|
165 | sed -i "s/RUNTEND/$tmodelend/" $RUNDIR"/bin/euras20_param_list.dat" |
---|
166 | sed -i "s/RUNRATMVAR/$runatmvar/" $RUNDIR"/bin/euras20_param_list.dat" |
---|
167 | sed -i "s/RUNPDDTYPE/$runpdd/" $RUNDIR"/bin/euras20_param_list.dat" |
---|
168 | |
---|
169 | # submission script: |
---|
170 | sed -i "s|SOURCESREP|$MODEL|" $RUNDIR"/bin/grisli.run" |
---|
171 | sed -i "s|EXEREP|$RUNDIR\/bin|" $RUNDIR"/bin/grisli.run" |
---|
172 | sed -i "s/RUNNAME/$namerun/" $RUNDIR"/bin/grisli.run" |
---|
173 | |
---|
174 | # Makefile: |
---|
175 | if [ $parallel = "yes" ]; then |
---|
176 | sed -i "s/Makefile.tof-lsce3130.inc/Makefile.tof-asterix-parallel.inc/" $RUNDIR"/SOURCES/Makefile" |
---|
177 | else |
---|
178 | sed -i "s/Makefile.tof-lsce3130.inc/Makefile.tof-asterix-sequential.inc/" $RUNDIR"/SOURCES/Makefile" |
---|
179 | fi |
---|
180 | |
---|
181 | # param values: |
---|
182 | #sed -i "s/PARAMENHFACT/$enh_fact/" $RUNDIR"/bin/anteis1_param_list.dat" |
---|
183 | #sed -i "s/PARAMCF/$cf_fact/" $RUNDIR"/bin/anteis1_param_list.dat" |
---|
184 | #sed -i "s/PARAMSEUILNEFF/$seuilneff_fact/" $RUNDIR"/bin/anteis1_param_list.dat" |
---|
185 | #sed -i "s/PARAMINFILTR/$infiltr_fact/" $RUNDIR"/bin/anteis1_param_list.dat" |
---|
186 | #sed -i "s/PARAMKOND0/$kond0_fact/" $RUNDIR"/bin/anteis1_param_list.dat" |
---|
187 | #sed -i "s/BETAMAX/$betamax_fact/" $RUNDIR"/bin/anteis1_param_list.dat" |
---|
188 | #sed -i "s/TOSTICK/$tostick_fact/" $RUNDIR"/bin/anteis1_param_list.dat" |
---|
189 | #sed -i "s/EXPOSLOPE/$exposlope_fact/" $RUNDIR"/bin/anteis1_param_list.dat" |
---|
190 | #sed -i "s/PARAMBSLOPE/$bslope_fact/" $RUNDIR"/bin/anteis1_param_list.dat" |
---|
191 | #sed -i "s/PARAMBEXPO/$bexpo_fact/" $RUNDIR"/bin/anteis1_param_list.dat" |
---|
192 | #sed -i "s/PARAMBMELTCOEF/$bmelt_fact/" $RUNDIR"/bin/anteis1_param_list.dat" |
---|
193 | #sed -i "s/PARAMSF/$sf_fact/" $RUNDIR"/bin/anteis1_param_list.dat" |
---|
194 | |
---|
195 | |
---|
196 | #-------------------------------------------------- |
---|
197 | # Submitting the job: |
---|
198 | #-------------------------------------------------- |
---|
199 | |
---|
200 | echo "submitting the job" |
---|
201 | qsub $RUNDIR"/bin/grisli.run" |
---|
202 | echo "-------------------------------------" |
---|