1 | #!/bin/bash |
---|
2 | ############################################################# |
---|
3 | # Author : Simona Flavoni for NEMO |
---|
4 | # Contact : sflod@locean-ipsl.upmc.fr |
---|
5 | # |
---|
6 | # sette.sh : principal script of SET TEsts for NEMO (SETTE) |
---|
7 | # ---------------------------------------------------------------------- |
---|
8 | # NEMO/SETTE , NEMO Consortium (2010) |
---|
9 | # Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) |
---|
10 | # ---------------------------------------------------------------------- |
---|
11 | # |
---|
12 | ############################################################# |
---|
13 | #set -x |
---|
14 | set -o posix |
---|
15 | #set -u |
---|
16 | #set -e |
---|
17 | #+ |
---|
18 | # |
---|
19 | # ================ |
---|
20 | # sette.sh |
---|
21 | # ================ |
---|
22 | # |
---|
23 | # ---------------------------------------------- |
---|
24 | # Set of tests for NEMO |
---|
25 | # ---------------------------------------------- |
---|
26 | # |
---|
27 | # SYNOPSIS |
---|
28 | # ======== |
---|
29 | # |
---|
30 | # :: |
---|
31 | # |
---|
32 | # $ ./sette.sh |
---|
33 | # |
---|
34 | # DESCRIPTION |
---|
35 | # =========== |
---|
36 | # |
---|
37 | # principal script is sette.sh, that calls |
---|
38 | # |
---|
39 | # makenemo |
---|
40 | # |
---|
41 | # creates the exectuable in ${CONFIG_NAME}/BLD/bin/nemo.exe |
---|
42 | # |
---|
43 | # (and its link opa in ${CONFIG_NAME}/EXP00) |
---|
44 | # |
---|
45 | # param.cfg : sets and loads following directories |
---|
46 | # |
---|
47 | # Executing directory (EXE_DIR) |
---|
48 | # |
---|
49 | |
---|
50 | # |
---|
51 | # Input files storing (INPUT_DIR) |
---|
52 | # |
---|
53 | # Temporary directory (if needed) (TMPDIR) |
---|
54 | # |
---|
55 | # Validation directory (NEMO_VALIDATION_DIR) |
---|
56 | # |
---|
57 | # (note: this file is the same for all configrations to be tested with sette) |
---|
58 | # |
---|
59 | # all_functions.sh : loads functions used by sette (note: new functions can be added here) |
---|
60 | # |
---|
61 | # set_namelist : function declared in all_functions that set namelist parameters for tests |
---|
62 | # |
---|
63 | # fcm_job.sh |
---|
64 | # |
---|
65 | # runs job and saves output files (grid_files, restarts, ice_evolu, ftrace.out) |
---|
66 | # |
---|
67 | # and it creates tree of VALIDATION, in which there are restart files, solver.stat and ocean.output |
---|
68 | # |
---|
69 | # Tree of VALIDATION is: |
---|
70 | # |
---|
71 | # NEMO_VALIDATION_DIR/WCONFIG_NAME/WCOMPILER_NAME/TEST_NAME/REVISION_NUMBER(or DATE) |
---|
72 | # |
---|
73 | # (note this job needs to have an input_CONFIG.cfg in which can be found input tar file) |
---|
74 | # |
---|
75 | # (note other files can be saved adding at the end of fcm_job list of saved files) |
---|
76 | # |
---|
77 | # NOTE: if job is not launched for some problems you have executable ready in ${CONFIG_NAME}/EXP00 directory |
---|
78 | # |
---|
79 | # NOTE: the changed namelists are leaved in ${CONFIG_NAME}/EXP00 directory |
---|
80 | # |
---|
81 | # in ${SETTE_DIR} is created output.sette with the echo of commands run |
---|
82 | # |
---|
83 | # if sette.sh is stopped in output.sette there is written the last command executed by sette.sh |
---|
84 | # |
---|
85 | # if you run: ./sette.sh 2>&1 | tee out.sette |
---|
86 | # |
---|
87 | # in ${SETTE_DIR} out.sette is redirected standard error & standard output |
---|
88 | # |
---|
89 | # |
---|
90 | # EXAMPLES |
---|
91 | # ======== |
---|
92 | # |
---|
93 | # :: |
---|
94 | # |
---|
95 | # $ ./sette.sh |
---|
96 | # |
---|
97 | # |
---|
98 | # TODO |
---|
99 | # ==== |
---|
100 | # |
---|
101 | # option debug |
---|
102 | # |
---|
103 | # EVOLUTIONS |
---|
104 | # ========== |
---|
105 | # |
---|
106 | # $Id$ |
---|
107 | # |
---|
108 | # * creation |
---|
109 | # |
---|
110 | #- |
---|
111 | # |
---|
112 | #- |
---|
113 | # Compiler among those in NEMOGCM/ARCH |
---|
114 | CMP_NAM=$1 |
---|
115 | |
---|
116 | # Directory to run the tests |
---|
117 | SETTE_DIR=$(cd $(dirname "$0"); pwd) |
---|
118 | MAIN_DIR=${SETTE_DIR%/SETTE} |
---|
119 | CONFIG_DIR=${MAIN_DIR}/CONFIG |
---|
120 | TOOLS_DIR=${MAIN_DIR}/TOOLS |
---|
121 | COMPIL_DIR=${TOOLS_DIR}/COMPILE |
---|
122 | # Check if a compiler has already been defined |
---|
123 | . ${COMPIL_DIR}/Fcheck_archfile.sh arch_nemo.fcm ${CMP_NAM} || exit |
---|
124 | |
---|
125 | ## NBTEST=6 |
---|
126 | ## echo "TOTAL NUMBER OF TEST" ${NBTEST} |
---|
127 | ## for (( config=2; config<=${NBTEST}; config++ )) |
---|
128 | |
---|
129 | for config in 1 2 3 4 5 6 |
---|
130 | do |
---|
131 | |
---|
132 | if [ ${config} -eq 1 ] ; then |
---|
133 | # Restartability tests for GYRE_LOBSTER |
---|
134 | cd ${SETTE_DIR} |
---|
135 | . ../CONFIG/makenemo -m ${CMP_NAM} -n GYRELOB_LONG -r GYRE_LOBSTER del_key "key_diatrc" |
---|
136 | cd ${SETTE_DIR} |
---|
137 | . param.cfg |
---|
138 | . all_functions.sh |
---|
139 | set_namelist namelist cn_exp \"GYRELOB_LONG\" |
---|
140 | set_namelist namelist nn_it000 1 |
---|
141 | set_namelist namelist nn_itend 120 |
---|
142 | set_namelist namelist nn_stock 60 |
---|
143 | set_namelist namelist ln_clobber .true. |
---|
144 | set_namelist namelist_top ln_trcrad .false. |
---|
145 | cd ${SETTE_DIR} |
---|
146 | . ./fcm_job.sh input_GYRE.cfg 1 LONG |
---|
147 | |
---|
148 | set_namelist namelist cn_exp \"GYRELOB_SHORT\" |
---|
149 | set_namelist namelist nn_it000 61 |
---|
150 | set_namelist namelist nn_itend 120 |
---|
151 | set_namelist namelist nn_stock 60 |
---|
152 | set_namelist namelist ln_rstart .true. |
---|
153 | set_namelist namelist nn_rstctl 2 |
---|
154 | set_namelist namelist ln_clobber .true. |
---|
155 | set_namelist namelist cn_ocerst_in \"GYRELOB_LONG_00000060_restart.nc\" |
---|
156 | set_namelist namelist_top ln_trcrad .false. |
---|
157 | set_namelist namelist_top ln_rsttr .true. |
---|
158 | set_namelist namelist_top nn_rsttr 2 |
---|
159 | set_namelist namelist_top cn_trcrst_in \"GYRELOB_LONG_00000060_restart_trc\" |
---|
160 | cd ${SETTE_DIR} |
---|
161 | . ./fcm_job.sh input_GYRE.cfg 1 SHORT |
---|
162 | fi |
---|
163 | |
---|
164 | if [ ${config} -eq 2 ] ; then |
---|
165 | # Restartability tests for ORCA2_LIM_PISCES |
---|
166 | cd ${SETTE_DIR} |
---|
167 | . ../CONFIG/makenemo -m ${CMP_NAM} -n ORCA2LIMPIS_LONG -r ORCA2_LIM_PISCES del_key "key_dtatrc key_diatrc" |
---|
168 | cd ${SETTE_DIR} |
---|
169 | . param.cfg |
---|
170 | . all_functions.sh |
---|
171 | set_namelist namelist cn_exp \"O2LP_LONG\" |
---|
172 | set_namelist namelist nn_it000 1 |
---|
173 | set_namelist namelist nn_itend 150 |
---|
174 | set_namelist namelist nn_stock 75 |
---|
175 | set_namelist namelist ln_clobber .true. |
---|
176 | set_namelist namelist_top ln_trcrad .false. |
---|
177 | # put ln_pisdmp, ln_dustfer, ln_river, ln_ndepo, ln_sedinput to false |
---|
178 | # if not you need input files, and for tests is not necessary |
---|
179 | set_namelist namelist_pisces ln_pisdmp .false. |
---|
180 | set_namelist namelist_pisces ln_dustfer .false. |
---|
181 | set_namelist namelist_pisces ln_river .false. |
---|
182 | set_namelist namelist_pisces ln_ndepo .false. |
---|
183 | set_namelist namelist_pisces ln_sedinput .false. |
---|
184 | cd ${SETTE_DIR} |
---|
185 | . ./fcm_job.sh input_ORCA2_LIM_PISCES.cfg 1 LONG |
---|
186 | |
---|
187 | cd ${SETTE_DIR} |
---|
188 | . ../CONFIG/makenemo -n ORCA2LIMPIS_SHORT -r ORCA2_LIM_PISCES del_key "key_dtatrc key_diatrc" |
---|
189 | cd ${SETTE_DIR} |
---|
190 | . param.cfg |
---|
191 | . all_functions.sh |
---|
192 | set_namelist namelist cn_exp \"O2LP_SHORT\" |
---|
193 | set_namelist namelist nn_it000 76 |
---|
194 | set_namelist namelist nn_itend 150 |
---|
195 | set_namelist namelist nn_stock 75 |
---|
196 | set_namelist namelist ln_rstart .true. |
---|
197 | set_namelist namelist nn_rstctl 2 |
---|
198 | set_namelist namelist ln_clobber .true. |
---|
199 | set_namelist namelist cn_ocerst_in \"O2LP_LONG_00000075_restart.nc\" |
---|
200 | set_namelist namelist_ice cn_ocerst_in \"O2LP_LONG_00000075_restart_ice.nc\" |
---|
201 | set_namelist namelist_top ln_trcrad .false. |
---|
202 | set_namelist namelist_top ln_rsttr .true. |
---|
203 | set_namelist namelist_top nn_rsttr 2 |
---|
204 | set_namelist namelist_top cn_trcrst_in \"O2LP_LONG_00000075_restart_trc\" |
---|
205 | # put ln_pisdmp, ln_dustfer, ln_river, ln_ndepo, ln_sedinput |
---|
206 | # if not you need input files, and for tests is not necessary |
---|
207 | set_namelist namelist_pisces ln_pisdmp .false. |
---|
208 | set_namelist namelist_pisces ln_dustfer .false. |
---|
209 | set_namelist namelist_pisces ln_river .false. |
---|
210 | set_namelist namelist_pisces ln_ndepo .false. |
---|
211 | set_namelist namelist_pisces ln_sedinput .false. |
---|
212 | cd ${SETTE_DIR} |
---|
213 | . ./fcm_job.sh input_ORCA2_LIM_PISCES.cfg 1 SHORT |
---|
214 | fi |
---|
215 | |
---|
216 | if [ ${config} -eq 3 ] ; then |
---|
217 | ## Restartability tests for POMME |
---|
218 | cd ${SETTE_DIR} |
---|
219 | . ../CONFIG/makenemo -m gfortran_linux -n POMME_LONG -r POMME |
---|
220 | cd ${SETTE_DIR} |
---|
221 | . param.cfg |
---|
222 | . all_functions.sh |
---|
223 | set_namelist namelist cn_exp \"POMME_LONG\" |
---|
224 | set_namelist namelist nn_it000 1 |
---|
225 | set_namelist namelist nn_itend 600 |
---|
226 | set_namelist namelist ln_clobber .true. |
---|
227 | cd ${SETTE_DIR} |
---|
228 | . ./fcm_job.sh input_POMME.cfg 1 LONG |
---|
229 | |
---|
230 | cd ${SETTE_DIR} |
---|
231 | set_namelist namelist cn_exp \"POMME_SHORT\" |
---|
232 | set_namelist namelist nn_it000 301 |
---|
233 | set_namelist namelist nn_itend 600 |
---|
234 | set_namelist namelist nn_stock 300 |
---|
235 | set_namelist namelist ln_rstart .true. |
---|
236 | set_namelist namelist nn_rstctl 2 |
---|
237 | set_namelist namelist ln_clobber .true. |
---|
238 | set_namelist namelist cn_ocerst_in \"POMME_LONG_00000075_restart.nc\" |
---|
239 | mv ${OUTPUT_DIR}/restart.obc.output ${OUTPUT_DIR}/restart.obc |
---|
240 | cd ${SETTE_DIR} |
---|
241 | . ./fcm_job.sh input_POMME.cfg 1 SHORT |
---|
242 | fi |
---|
243 | |
---|
244 | if [ ${config} -eq 4 ] ; then |
---|
245 | ## Reproducilibity tests for GYRE_LOBSTER |
---|
246 | cd ${SETTE_DIR} |
---|
247 | . ../CONFIG/makenemo -m ${CMP_NAM} -n GYRELOB_1_4 -r GYRE_LOBSTER add_key "key_mpp_mpi key_mpp_rep" del_key "key_vectopt_loop key_diatrc" |
---|
248 | cd ${SETTE_DIR} |
---|
249 | . param.cfg |
---|
250 | . all_functions.sh |
---|
251 | set_namelist namelist nn_it000 1 |
---|
252 | set_namelist namelist nn_itend 75 |
---|
253 | set_namelist namelist nn_fwb 0 |
---|
254 | set_namelist namelist nn_bench 0 |
---|
255 | set_namelist namelist ln_ctl .false. |
---|
256 | set_namelist namelist ln_clobber .true. |
---|
257 | set_namelist namelist jpni 1 |
---|
258 | set_namelist namelist jpnj 4 |
---|
259 | set_namelist namelist jpnij 4 |
---|
260 | cd ${SETTE_DIR} |
---|
261 | . ./fcm_job.sh input_GYRE.cfg 4 SHORT |
---|
262 | |
---|
263 | cd ${SETTE_DIR} |
---|
264 | . ../CONFIG/makenemo -m ${CMP_NAM} -n GYRELOB_2_2 -r GYRE_LOBSTER add_key "key_mpp_rep key_mpp_mpi" del_key "key_vectopt_loop key_diatrc" |
---|
265 | cd ${SETTE_DIR} |
---|
266 | . param.cfg |
---|
267 | . all_functions.sh |
---|
268 | set_namelist namelist nn_it000 1 |
---|
269 | set_namelist namelist nn_itend 75 |
---|
270 | set_namelist namelist nn_fwb 0 |
---|
271 | set_namelist namelist ln_ctl .false. |
---|
272 | set_namelist namelist ln_clobber .true. |
---|
273 | set_namelist namelist jpni 2 |
---|
274 | set_namelist namelist jpnj 2 |
---|
275 | set_namelist namelist jpnij 4 |
---|
276 | cd ${SETTE_DIR} |
---|
277 | . ./fcm_job.sh input_GYRE.cfg 4 SHORT |
---|
278 | fi |
---|
279 | |
---|
280 | if [ ${config} -eq 5 ] ; then |
---|
281 | ## Repropducilibity tests for ORCA2_LIM_PISCES |
---|
282 | cd ${SETTE_DIR} |
---|
283 | . ../CONFIG/makenemo -m ${CMP_NAM} -n ORCA2LO2LPO2LP_4_4 -r ORCA2_LIM_PISCES add_key "key_mpp_mpi key_mpp_rep" del_key "key_vectopt_loop key_dtatrc key_diatrc" |
---|
284 | cd ${SETTE_DIR} |
---|
285 | . param.cfg |
---|
286 | . all_functions.sh |
---|
287 | set_namelist namelist nn_it000 1 |
---|
288 | set_namelist namelist nn_itend 75 |
---|
289 | set_namelist namelist nn_fwb 0 |
---|
290 | set_namelist namelist ln_ctl .false. |
---|
291 | set_namelist namelist ln_clobber .true. |
---|
292 | set_namelist namelist jpni 4 |
---|
293 | set_namelist namelist jpnj 4 |
---|
294 | set_namelist namelist jpnij 16 |
---|
295 | # put ln_pisdmp, ln_dustfer, ln_river, ln_ndepo, ln_sedinput to false |
---|
296 | # if not you need input files, and for tests is not necessary |
---|
297 | set_namelist namelist_pisces ln_pisdmp .false. |
---|
298 | set_namelist namelist_pisces ln_dustfer .false. |
---|
299 | set_namelist namelist_pisces ln_river .false. |
---|
300 | set_namelist namelist_pisces ln_ndepo .false. |
---|
301 | set_namelist namelist_pisces ln_sedinput .false. |
---|
302 | cd ${SETTE_DIR} |
---|
303 | . ./fcm_job.sh input_ORCA2_LIM_PISCES.cfg 16 SHORT |
---|
304 | |
---|
305 | cd ${SETTE_DIR} |
---|
306 | . ../CONFIG/makenemo -n ORCA2LIMPIS_2_8 -r ORCA2_LIM_PISCES add_key "key_mpp_rep key_mpp_mpi" del_key "key_vectopt_loop key_dtatrc key_diatrc" |
---|
307 | cd ${SETTE_DIR} |
---|
308 | . param.cfg |
---|
309 | . all_functions.sh |
---|
310 | set_namelist namelist nn_it000 1 |
---|
311 | set_namelist namelist nn_itend 75 |
---|
312 | set_namelist namelist nn_fwb 0 |
---|
313 | set_namelist namelist ln_ctl .false. |
---|
314 | set_namelist namelist ln_clobber .true. |
---|
315 | set_namelist namelist jpni 2 |
---|
316 | set_namelist namelist jpnj 8 |
---|
317 | set_namelist namelist jpnij 16 |
---|
318 | # put ln_pisdmp, ln_dustfer, ln_river, ln_ndepo, ln_sedinput to false |
---|
319 | # if not you need input files, and for tests is not necessary |
---|
320 | set_namelist namelist_pisces ln_pisdmp .false. |
---|
321 | set_namelist namelist_pisces ln_dustfer .false. |
---|
322 | set_namelist namelist_pisces ln_river .false. |
---|
323 | set_namelist namelist_pisces ln_ndepo .false. |
---|
324 | set_namelist namelist_pisces ln_sedinput .false. |
---|
325 | cd ${SETTE_DIR} |
---|
326 | . ./fcm_job.sh input_ORCA2_LIM_PISCES.cfg 16 SHORT |
---|
327 | fi |
---|
328 | |
---|
329 | if [ ${config} -eq 6 ] ; then |
---|
330 | ## Reproductibility tests for POMME |
---|
331 | cd ${SETTE_DIR} |
---|
332 | . ../CONFIG/makenemo -m gfortran_linux -n POMME_1_4 -r POMME add_key "key_mpp_mpi key_mpp_rep" |
---|
333 | cd ${SETTE_DIR} |
---|
334 | . param.cfg |
---|
335 | . all_functions.sh |
---|
336 | set_namelist namelist nn_it000 1 |
---|
337 | set_namelist namelist nn_itend 300 |
---|
338 | set_namelist namelist nn_fwb 0 |
---|
339 | set_namelist namelist ln_ctl .false. |
---|
340 | set_namelist namelist ln_clobber .true. |
---|
341 | set_namelist namelist jpni 1 |
---|
342 | set_namelist namelist jpnj 4 |
---|
343 | set_namelist namelist jpnij 4 |
---|
344 | cd ${SETTE_DIR} |
---|
345 | . ./fcm_job.sh input_POMME.cfg 4 SHORT |
---|
346 | |
---|
347 | cd ${SETTE_DIR} |
---|
348 | . ../CONFIG/makenemo -m gfortran_linux -n POMME_2_2 -r POMME add_key "key_mpp_mpi key_mpp_rep" |
---|
349 | cd ${SETTE_DIR} |
---|
350 | . param.cfg |
---|
351 | . all_functions.sh |
---|
352 | set_namelist namelist nn_it000 1 |
---|
353 | set_namelist namelist nn_itend 300 |
---|
354 | set_namelist namelist nn_fwb 0 |
---|
355 | set_namelist namelist ln_ctl .false. |
---|
356 | set_namelist namelist ln_clobber .true. |
---|
357 | set_namelist namelist jpni 2 |
---|
358 | set_namelist namelist jpnj 2 |
---|
359 | set_namelist namelist jpnij 4 |
---|
360 | cd ${SETTE_DIR} |
---|
361 | . ./fcm_job.sh input_POMME.cfg 4 SHORT |
---|
362 | fi |
---|
363 | |
---|
364 | done |
---|