source: utils/CI/sette/sette_reference-configurations.sh @ 13559

Last change on this file since 13559 was 13559, checked in by smasson, 5 months ago

sette: update sette for DEBUG mode, see #2535

  • Property svn:executable set to *
File size: 58.6 KB
Line 
1#!/bin/bash
2############################################################
3# Author : Simona Flavoni for NEMO
4# Contact: sflod@locean-ipsl.upmc.fr
5# 2013   : A.C. Coward added options for testing with XIOS in dettached mode
6#
7# sette.sh   : principal script of SET TEsts for NEMO (SETTE)
8# ----------------------------------------------------------------------
9# NEMO/SETTE , NEMO Consortium (2010)
10# Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
11# ----------------------------------------------------------------------
12#
13#############################################################
14#set -vx
15set -o posix
16#set -u
17#set -e
18# ===========
19# DESCRIPTION
20# ===========
21#
22# Variables to be checked by user:
23#
24# COMPILER          : name of compiler as defined in NEMOGCM/ARCH directory
25# BATCH_COMMAND_PAR :  name of the command for submitting parallel batch jobs
26# BATCH_COMMAND_SEQ :  name of the command for submitting sequential batch jobs 
27# INTERACT_FLAG     : flag to run in interactive mode "yes"
28#                           to run in batch mode "no"
29# MPIRUN_FLAG       : flag to run in parallel (MPI) "yes"
30#                           to run in sequential mode (NB_PROC = 1) "no"
31# USING_XIOS        : flag to control the activation of key_iomput
32#                      "yes" to compile using key_iomput and link to the external XIOS library
33#                      "no"  to compile without key_iomput and link to the old IOIPSL library
34# USING_MPMD        : flag to control the use of stand-alone IO servers
35#                     requires USING_XIOS="yes"
36#                      "yes" to run in MPMD (detached) mode with stand-alone IO servers
37#                      "no"  to run in SPMD (attached) mode without separate IO servers
38# NUM_XIOSERVERS    : number of stand-alone IO servers to employ
39#                     set to zero if USING_MPMD="no"
40#
41# Principal script is sette.sh, that calls
42#
43#  makenemo  : to create successive exectuables in ${CONFIG_NAME}/BLD/bin/nemo.exe
44#              and links to nemo in ${CONFIG_NAME}/EXP00)
45#
46#  param.cfg : sets and loads following directories:
47#
48#   FORCING_DIR         : is the directory for forcing files (tarfile)
49#   INPUT_DIR           : is the directory for input files storing
50#   TMPDIR              : is the temporary directory (if needed)
51#   NEMO_VALIDATION_DIR : is the validation directory
52#
53#   (NOTE: this file is the same for all configrations to be tested with sette)
54#
55#   all_functions.sh : loads functions used by sette (note: new functions can be added here)
56#   set_namelist     : function declared in all_functions that sets namelist parameters
57#   post_test_tidyup : creates validation storage directory and copies required output files
58#                      (run.stat and ocean.output) in it after execution of test.
59#
60#  VALIDATION tree is:
61#
62#   NEMO_VALIDATION_DIR/WCONFIG_NAME/WCOMPILER_NAME/TEST_NAME/REVISION_NUMBER(or DATE)
63#
64#  prepare_exe_dir.sh : defines and creates directory where the test is executed
65#                       execution directory takes name of TEST_NAME defined for every test
66#                       in sette.sh. (each test in executed in its own directory)
67#
68#  set_valid_dir       : rename ocean.output/run.stat and tracer.stat to avoid checking them in the report
69#
70#  clean_valid_dir    : rename ocean.output/run.stat and tracer.stat to avoid checking them in the report
71#                       ( not doing it could lead to false positive )
72#
73#  prepare_job.sh     : to generate the script run_job.sh
74#
75#  fcm_job.sh         : run in batch (INTERACT_FLAG="no") or interactive (INTERACT_FLAG="yes")
76#                        see sette.sh and BATCH_TEMPLATE directory
77#
78#  NOTE: jobs requiring initial or forcing data need to have an input_CONFIG.cfg in which
79#        can be found paths to the input tar file)
80#  NOTE: if job is not launched for any reason you have the executable ready in ${EXE_DIR}
81#        directory
82#  NOTE: the changed namelists are left in ${EXE_DIR} directory whereas original namelists
83#        remain in ${NEW_CONF}/EXP00
84#
85#  NOTE: a log file, output.sette, is created in ${SETTE_DIR} with the echoes of
86#        executed commands
87#
88#  NOTE: if sette.sh is stopped in output.sette there is written the last command
89#        executed by sette.sh
90#
91# example use: ./sette.sh
92#########################################################################################
93#
94# LOAD param value
95SETTE_DIR=$(cd $(dirname "$0"); pwd)
96MAIN_DIR=$(dirname $SETTE_DIR)
97. ./param.cfg
98
99export BATCH_COMMAND_PAR=${BATCH_CMD}
100export BATCH_COMMAND_SEQ=${BATCH_CMD}
101export INTERACT_FLAG="no"
102export MPIRUN_FLAG="yes"
103export USING_ICEBERGS="yes"
104#
105export DEL_KEYS="key_iomput"
106if [ ${USING_XIOS} == "yes" ] 
107 then
108   export DEL_KEYS=""
109fi
110#
111export ADD_KEYS=""
112if [ ${ADD_NOSIGNEDZERO} == "yes" ]
113 then
114   export ADD_KEYS="key_nosignedzero"
115fi
116#
117# Settings which control the use of stand alone servers (only relevant if using xios)
118#
119export NUM_XIOSERVERS=4
120export JOB_PREFIX=${JOB_PREFIX_MPMD}
121#
122if [ ${USING_MPMD} == "no" ] 
123 then
124   export NUM_XIOSERVERS=0
125   export JOB_PREFIX=${JOB_PREFIX_NOMPMD}
126fi
127#
128#
129if [ ${USING_MPMD} == "yes" ] && [ ${USING_XIOS} == "no" ]
130 then
131   echo "Incompatible choices. MPMD mode requires the XIOS server"
132   exit
133fi
134
135# Directory to run the tests
136CONFIG_DIR0=${MAIN_DIR}/cfgs
137TOOLS_DIR=${MAIN_DIR}/tools
138
139CMP_NAM=${1:-$COMPILER}
140# Copy job_batch_COMPILER file for specific compiler into job_batch_template
141cd ${SETTE_DIR}
142cp BATCH_TEMPLATE/${JOB_PREFIX}-${COMPILER} job_batch_template || exit
143# Description of available configurations:
144# GYRE_PISCES       :
145# ORCA2_ICE_PISCES  :
146# ORCA2_OFF_PISCES  :
147# AMM12             :
148# SAS               :
149# ORCA2_ICE_OBS     :
150# AGRIF             : test AGRIF in a double zoom configuration in the nordic seas + 1 zoom in the eq. Pacific (AGRIF_DEMO)
151#                       and check that key_agrif without zoom = no key_agrif
152# WED025           : regional configuration including sea-ice and tides (Spitzbergen)
153
154for config in ${TEST_CONFIGS}
155do
156
157# -----------
158# GYRE_PISCES
159# -----------
160if [ ${config} == "GYRE_PISCES" ] ;  then
161## Restartability tests for GYRE_PISCES
162    if [ $( echo ${CMP_NAM} | grep -ic debug ) -eq 1 ]
163    then
164   ITEND=12    # 1 day
165    else
166   ITEND=1080  # 90 days
167    fi
168    ITRST=$( printf "%08d" $(( ${ITEND} / 2 )) )
169    export TEST_NAME="LONG"
170    cd ${MAIN_DIR}
171    #
172    # syncronisation if target directory/file exist (not done by makenemo)
173    . ${SETTE_DIR}/all_functions.sh
174    sync_config  GYRE_PISCES GYRE_PISCES_ST 'cfgs'
175    clean_config GYRE_PISCES GYRE_PISCES_ST 'cfgs'
176    #
177    . ./makenemo -m ${CMP_NAM} -n GYRE_PISCES_ST -r GYRE_PISCES -j 8 add_key "${ADD_KEYS}" del_key "${DEL_KEYS}"
178    cd ${SETTE_DIR}
179    . ./param.cfg
180    . ./all_functions.sh
181    . ./prepare_exe_dir.sh
182    set_valid_dir
183    clean_valid_dir
184    JOB_FILE=${EXE_DIR}/run_job.sh
185    NPROC=8
186    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
187    cd ${EXE_DIR} 
188    set_namelist namelist_cfg cn_exp \"GYREPIS_LONG\"
189    set_namelist namelist_cfg nn_it000 1
190    set_namelist namelist_cfg nn_itend ${ITEND}
191    set_namelist namelist_cfg nn_stock $(( ${ITEND} / 2 ))
192    set_namelist namelist_cfg ln_linssh .true.
193    set_namelist namelist_cfg jpni 2
194    set_namelist namelist_cfg jpnj 4
195    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
196    set_namelist namelist_cfg sn_cfctl%l_trcstat .true.
197    if [ ${USING_MPMD} == "yes" ] ; then
198       set_xio_using_server iodef.xml true
199    else
200       set_xio_using_server iodef.xml false
201    fi
202    cd ${SETTE_DIR}
203    . ./prepare_job.sh input_GYRE.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
204
205    cd ${SETTE_DIR}
206    export TEST_NAME="SHORT"
207    . ./prepare_exe_dir.sh
208    set_valid_dir
209    clean_valid_dir
210    cd ${EXE_DIR}
211    set_namelist namelist_cfg cn_exp \"GYREPIS_SHORT\"
212    set_namelist namelist_cfg nn_it000 $(( ${ITEND} / 2 + 1 ))
213    set_namelist namelist_cfg nn_itend ${ITEND}
214    set_namelist namelist_cfg nn_stock $(( ${ITEND} / 2 ))
215    set_namelist namelist_cfg ln_rstart .true.
216    set_namelist namelist_cfg nn_rstctl 2
217    set_namelist namelist_cfg ln_linssh .true.
218    set_namelist namelist_cfg jpni 2
219    set_namelist namelist_cfg jpnj 4
220    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
221    set_namelist namelist_cfg sn_cfctl%l_trcstat .true.
222    set_namelist namelist_top_cfg ln_rsttr .true.
223    set_namelist namelist_top_cfg nn_rsttr 2
224    set_namelist namelist_cfg cn_ocerst_in \"GYREPIS_LONG_${ITRST}_restart\"
225    set_namelist namelist_top_cfg cn_trcrst_in \"GYREPIS_LONG_${ITRST}_restart_trc\"
226    if [ ${USING_MPMD} == "yes" ] ; then
227       set_xio_using_server iodef.xml true
228    else
229       set_xio_using_server iodef.xml false
230    fi
231    for (( i=1; i<=$NPROC; i++)) ; do
232        L_NPROC=$(( $i - 1 ))
233        L_NPROC=`printf "%04d\n" ${L_NPROC}`
234        ln -sf ../LONG/GYREPIS_LONG_${ITRST}_restart_${L_NPROC}.nc .
235        ln -sf ../LONG/GYREPIS_LONG_${ITRST}_restart_trc_${L_NPROC}.nc .
236    done
237    cd ${SETTE_DIR}
238    . ./prepare_job.sh input_GYRE.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
239    cd ${SETTE_DIR}
240    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
241
242## Reproducibility tests for GYRE_PISCES
243    export TEST_NAME="REPRO_2_4"
244    cd ${MAIN_DIR}
245    cd ${SETTE_DIR}
246    . ./param.cfg
247    . ./all_functions.sh
248    . ./prepare_exe_dir.sh
249    set_valid_dir
250    clean_valid_dir
251    JOB_FILE=${EXE_DIR}/run_job.sh
252    NPROC=8
253    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
254    cd ${EXE_DIR}
255    set_namelist namelist_cfg cn_exp \"GYREPIS_48\"
256    set_namelist namelist_cfg nn_it000 1
257    set_namelist namelist_cfg nn_itend ${ITEND}
258    set_namelist namelist_cfg ln_linssh .true.
259    set_namelist namelist_cfg jpni 2
260    set_namelist namelist_cfg jpnj 4
261    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
262    set_namelist namelist_cfg sn_cfctl%l_trcstat .true.
263    if [ ${USING_MPMD} == "yes" ] ; then
264       set_xio_using_server iodef.xml true
265    else
266       set_xio_using_server iodef.xml false
267    fi
268    cd ${SETTE_DIR}
269    . ./prepare_job.sh input_GYRE.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
270    cd ${SETTE_DIR}
271    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
272
273    cd ${SETTE_DIR}
274    export TEST_NAME="REPRO_4_2"
275    . ./prepare_exe_dir.sh
276    set_valid_dir
277    clean_valid_dir
278    JOB_FILE=${EXE_DIR}/run_job.sh
279    NPROC=8
280    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
281    cd ${EXE_DIR}
282    set_namelist namelist_cfg cn_exp \"GYREPIS_84\"
283    set_namelist namelist_cfg nn_it000 1
284    set_namelist namelist_cfg nn_itend ${ITEND}
285    set_namelist namelist_cfg ln_linssh .true.
286    set_namelist namelist_cfg jpni 4
287    set_namelist namelist_cfg jpnj 2
288    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
289    set_namelist namelist_cfg sn_cfctl%l_trcstat .true.
290    if [ ${USING_MPMD} == "yes" ] ; then
291       set_xio_using_server iodef.xml true
292    else
293       set_xio_using_server iodef.xml false
294    fi
295    cd ${SETTE_DIR}
296    . ./prepare_job.sh input_GYRE.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
297    cd ${SETTE_DIR}
298    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
299
300fi
301
302# -----------------
303# ORCA2_ICE_PISCES
304# -----------------
305if [ ${config} == "ORCA2_ICE_PISCES" ] ;  then
306## Restartability tests for ORCA2_ICE_PISCES
307    if [ $( echo ${CMP_NAM} | grep -ic debug ) -eq 1 ]
308    then
309   ITEND=16   # 1 day
310    else
311   ITEND=992  # 62 days
312    fi
313    ITRST=$( printf "%08d" $(( ${ITEND} / 2 )) )
314    export TEST_NAME="LONG"
315    cd ${MAIN_DIR}
316    #
317    # syncronisation if target directory/file exist (not done by makenemo)
318    . ${SETTE_DIR}/all_functions.sh
319    sync_config  ORCA2_ICE_PISCES ORCA2_ICE_PISCES_ST 'cfgs'
320    clean_config ORCA2_ICE_PISCES ORCA2_ICE_PISCES_ST 'cfgs'
321    #
322    . ./makenemo -m ${CMP_NAM} -n ORCA2_ICE_PISCES_ST -r ORCA2_ICE_PISCES -j 8 add_key "${ADD_KEYS}" del_key "${DEL_KEYS}"
323    cd ${SETTE_DIR}
324    . ./param.cfg
325    . ./all_functions.sh
326    . ./prepare_exe_dir.sh
327    set_valid_dir
328    clean_valid_dir
329    JOB_FILE=${EXE_DIR}/run_job.sh
330    NPROC=32
331    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
332    cd ${EXE_DIR}
333    set_namelist namelist_cfg cn_exp \"O2L3P_LONG\"
334    set_namelist namelist_cfg nn_it000 1
335    set_namelist namelist_cfg nn_itend ${ITEND}
336    set_namelist namelist_cfg nn_stock $(( ${ITEND} / 2 ))
337    set_namelist namelist_cfg jpni 4
338    set_namelist namelist_cfg jpnj 8
339    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
340    set_namelist namelist_cfg sn_cfctl%l_trcstat .true.
341    set_namelist namelist_cfg ln_use_calving .true.
342    set_namelist namelist_cfg ln_wave .true.
343    set_namelist namelist_cfg ln_cdgw .true.
344    set_namelist namelist_cfg ln_sdw  .true.
345    set_namelist namelist_cfg nn_sdrift 1
346    set_namelist namelist_cfg ln_stcor .true.
347    set_namelist namelist_cfg ln_tauwoc .true.
348    #
349    if [ ${USING_ICEBERGS} == "no" ] ; then set_namelist namelist_cfg ln_icebergs .false. ; fi
350    # for debugging purposes set_namelist namelist_cfg rn_test_box -180.0, 180.0, -90.0, -55.0
351    #
352    set_namelist namelist_ice_cfg ln_icediachk .true.
353    set_namelist namelist_top_cfg ln_trcdta .false.
354    set_namelist namelist_top_cfg ln_trcbc  .false.
355    # put ln_ironsed, ln_hydrofe to false
356    # if not you need input files, and for tests is not necessary
357    set_namelist namelist_pisces_cfg ln_varpar .false.
358    set_namelist namelist_pisces_cfg ln_ironsed .false.
359    set_namelist namelist_pisces_cfg ln_ironice .false.
360    set_namelist namelist_pisces_cfg ln_hydrofe .false.
361    # put ln_pisdmp to false : no restoring to global mean value
362    set_namelist namelist_pisces_cfg ln_pisdmp .false.
363    if [ ${USING_MPMD} == "yes" ] ; then
364       set_xio_using_server iodef.xml true
365    else
366       set_xio_using_server iodef.xml false
367    fi
368    cd ${SETTE_DIR}
369    . ./prepare_job.sh input_ORCA2_ICE_PISCES.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
370   
371    cd ${SETTE_DIR}
372    export TEST_NAME="SHORT"
373    . ./prepare_exe_dir.sh
374    set_valid_dir
375    clean_valid_dir
376    cd ${EXE_DIR}
377    set_namelist namelist_cfg cn_exp \"O2L3P_SHORT\"
378    set_namelist namelist_cfg nn_it000 $(( ${ITEND} / 2 + 1 ))
379    set_namelist namelist_cfg nn_itend ${ITEND}
380    set_namelist namelist_cfg nn_stock $(( ${ITEND} / 2 ))
381    set_namelist namelist_cfg ln_rstart .true.
382    set_namelist namelist_cfg nn_rstctl 2
383    set_namelist namelist_cfg jpni 4
384    set_namelist namelist_cfg jpnj 8
385    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
386    set_namelist namelist_cfg sn_cfctl%l_trcstat .true.
387    set_namelist namelist_cfg nn_test_icebergs -1
388    set_namelist namelist_cfg ln_wave .true.
389    set_namelist namelist_cfg ln_cdgw .true.
390    set_namelist namelist_cfg ln_sdw  .true.
391    set_namelist namelist_cfg nn_sdrift 1
392    set_namelist namelist_cfg ln_stcor .true.
393    set_namelist namelist_cfg ln_tauwoc .true.
394    #
395    if [ ${USING_ICEBERGS} == "no" ] ; then set_namelist namelist_cfg ln_icebergs .false. ; fi
396    # for debugging purposes set_namelist namelist_cfg rn_test_box -180.0, 180.0, -90.0, -55.0
397    #
398    set_namelist namelist_ice_cfg ln_icediachk .true.
399    set_namelist namelist_top_cfg ln_rsttr .true.
400    set_namelist namelist_top_cfg nn_rsttr 2
401    set_namelist namelist_cfg cn_ocerst_in \"O2L3P_LONG_${ITRST}_restart\"
402    set_namelist namelist_cfg cn_icbrst_in \"O2L3P_LONG_${ITRST}_restart_icb\"
403    set_namelist namelist_top_cfg cn_trcrst_in \"O2L3P_LONG_${ITRST}_restart_trc\"
404    set_namelist namelist_ice_cfg cn_icerst_in \"O2L3P_LONG_${ITRST}_restart_ice\"
405    set_namelist namelist_top_cfg ln_trcbc  .false.
406    # put ln_ironsed, ln_hydrofe to false
407    # if not you need input files, and for tests is not necessary
408    set_namelist namelist_pisces_cfg ln_varpar .false.
409    set_namelist namelist_pisces_cfg ln_ironsed .false.
410    set_namelist namelist_pisces_cfg ln_ironice .false.
411    set_namelist namelist_pisces_cfg ln_hydrofe .false.
412    # put ln_pisdmp to false : no restoring to global mean value
413    set_namelist namelist_pisces_cfg ln_pisdmp .false.
414    for (( i=1; i<=$NPROC; i++)) ; do
415        L_NPROC=$(( $i - 1 ))
416        L_NPROC=`printf "%04d\n" ${L_NPROC}`
417        ln -sf ../LONG/O2L3P_LONG_${ITRST}_restart_${L_NPROC}.nc .
418        ln -sf ../LONG/O2L3P_LONG_${ITRST}_restart_trc_${L_NPROC}.nc .
419        ln -sf ../LONG/O2L3P_LONG_${ITRST}_restart_ice_${L_NPROC}.nc .
420        if [ ${USING_ICEBERGS} == "yes" ]
421            then
422             ln -sf ../LONG/O2L3P_LONG_${ITRST}_restart_icb_${L_NPROC}.nc O2L3P_LONG_${ITRST}_restart_icb_${L_NPROC}.nc
423        fi
424    done
425    if [ ${USING_MPMD} == "yes" ] ; then
426       set_xio_using_server iodef.xml true
427    else
428       set_xio_using_server iodef.xml false
429    fi
430    cd ${SETTE_DIR}
431    . ./prepare_job.sh input_ORCA2_ICE_PISCES.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
432    cd ${SETTE_DIR}
433    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
434
435## Reproducibility tests for ORCA2_ICE_PISCES
436    export TEST_NAME="REPRO_4_8"
437    cd ${MAIN_DIR}
438    cd ${SETTE_DIR}
439    . ./param.cfg
440    . ./all_functions.sh
441    . ./prepare_exe_dir.sh
442    set_valid_dir
443    clean_valid_dir
444    JOB_FILE=${EXE_DIR}/run_job.sh
445    NPROC=32
446    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
447    cd ${EXE_DIR}
448    set_namelist namelist_cfg cn_exp \"O2L3P_48\"
449    set_namelist namelist_cfg nn_it000 1
450    set_namelist namelist_cfg nn_itend ${ITEND}
451    set_namelist namelist_cfg jpni 4
452    set_namelist namelist_cfg jpnj 8
453    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
454    set_namelist namelist_cfg sn_cfctl%l_trcstat .true.
455    set_namelist namelist_cfg ln_wave .true.
456    set_namelist namelist_cfg ln_cdgw .true.
457    set_namelist namelist_cfg ln_sdw  .true.
458    set_namelist namelist_cfg nn_sdrift 1
459    set_namelist namelist_cfg ln_stcor .true.
460    set_namelist namelist_cfg ln_tauwoc .true.
461
462    if [ ${USING_ICEBERGS} == "no" ] ; then set_namelist namelist_cfg ln_icebergs .false. ; fi
463    # for debugging purposes set_namelist namelist_cfg rn_test_box -180.0, 180.0, -90.0, -55.0
464
465    set_namelist namelist_top_cfg ln_trcdta .false.
466    set_namelist namelist_top_cfg ln_trcbc  .false.
467    # put ln_ironsed, ln_hydrofe to false
468    # if not you need input files, and for tests is not necessary
469    set_namelist namelist_pisces_cfg ln_varpar .false.
470    set_namelist namelist_pisces_cfg ln_ironsed .false.
471    set_namelist namelist_pisces_cfg ln_ironice .false.
472    set_namelist namelist_pisces_cfg ln_hydrofe .false.
473    # put ln_pisdmp to false : no restoring to global mean value
474    set_namelist namelist_pisces_cfg ln_pisdmp .false.
475    if [ ${USING_MPMD} == "yes" ] ; then
476       set_xio_using_server iodef.xml true
477    else
478       set_xio_using_server iodef.xml false
479    fi
480    cd ${SETTE_DIR}
481    . ./prepare_job.sh input_ORCA2_ICE_PISCES.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
482    cd ${SETTE_DIR}
483    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
484
485    cd ${SETTE_DIR}
486    export TEST_NAME="REPRO_8_4"
487    . ./prepare_exe_dir.sh
488    set_valid_dir
489    clean_valid_dir
490    JOB_FILE=${EXE_DIR}/run_job.sh
491    NPROC=32
492    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
493    cd ${EXE_DIR}
494    set_namelist namelist_cfg cn_exp \"O2L3P_84\"
495    set_namelist namelist_cfg nn_it000 1
496    set_namelist namelist_cfg nn_itend ${ITEND}
497    set_namelist namelist_cfg jpni 8
498    set_namelist namelist_cfg jpnj 4
499    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
500    set_namelist namelist_cfg sn_cfctl%l_trcstat .true.
501    set_namelist namelist_cfg ln_wave .true.
502    set_namelist namelist_cfg ln_cdgw .true.
503    set_namelist namelist_cfg ln_sdw  .true.
504    set_namelist namelist_cfg nn_sdrift 1
505    set_namelist namelist_cfg ln_stcor .true.
506    set_namelist namelist_cfg ln_tauwoc .true.
507
508    if [ ${USING_ICEBERGS} == "no" ] ; then set_namelist namelist_cfg ln_icebergs .false. ; fi
509    # for debugging purposes set_namelist namelist_cfg rn_test_box -180.0, 180.0, -90.0, -55.0
510
511    set_namelist namelist_top_cfg ln_trcdta .false.
512    set_namelist namelist_top_cfg ln_trcbc  .false.
513    # put ln_ironsed, ln_hydrofe to false
514    # if not you need input files, and for tests is not necessary
515    set_namelist namelist_pisces_cfg ln_varpar .false.
516    set_namelist namelist_pisces_cfg ln_ironsed .false.
517    set_namelist namelist_pisces_cfg ln_ironice .false.
518    set_namelist namelist_pisces_cfg ln_hydrofe .false.
519    # put ln_pisdmp to false : no restoring to global mean value
520    set_namelist namelist_pisces_cfg ln_pisdmp .false.
521    if [ ${USING_MPMD} == "yes" ] ; then
522       set_xio_using_server iodef.xml true
523    else
524       set_xio_using_server iodef.xml false
525    fi
526    cd ${SETTE_DIR}
527    . ./prepare_job.sh input_ORCA2_ICE_PISCES.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
528    cd ${SETTE_DIR}
529    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
530fi
531
532# ----------------
533# ORCA2_OFF_PISCES
534# ----------------
535if [ ${config} == "ORCA2_OFF_PISCES" ] ;  then
536## Restartability tests for ORCA2_OFF_PISCES
537    if [ $( echo ${CMP_NAM} | grep -ic debug ) -eq 1 ]
538    then
539   ITEND=16   # 4 days
540    else
541   ITEND=380  # 95 days
542    fi
543    ITRST=$( printf "%08d" $(( ${ITEND} / 2 )) )
544    export TEST_NAME="LONG"
545    cd ${MAIN_DIR}
546    #
547    # syncronisation if target directory/file exist (not done by makenemo)
548    . ${SETTE_DIR}/all_functions.sh
549    sync_config  ORCA2_OFF_PISCES ORCA2_OFF_PISCES_ST 'cfgs'
550    clean_config ORCA2_OFF_PISCES ORCA2_OFF_PISCES_ST 'cfgs'
551    #
552    . ./makenemo -m ${CMP_NAM} -n ORCA2_OFF_PISCES_ST -r ORCA2_OFF_PISCES -j 8 add_key "${ADD_KEYS}" del_key "${DEL_KEYS}"
553    cd ${SETTE_DIR}
554    . ./param.cfg
555    . ./all_functions.sh
556    . ./prepare_exe_dir.sh
557    set_valid_dir
558    clean_valid_dir
559    JOB_FILE=${EXE_DIR}/run_job.sh
560    NPROC=32
561    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
562    cd ${EXE_DIR}
563    set_namelist namelist_cfg cn_exp \"OFFP_LONG\"
564    set_namelist namelist_cfg nn_it000 1
565    set_namelist namelist_cfg nn_itend ${ITEND}
566    set_namelist namelist_cfg nn_stock $(( ${ITEND} / 2 ))
567    set_namelist namelist_cfg jpni 4
568    set_namelist namelist_cfg jpnj 8
569    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
570    set_namelist namelist_cfg sn_cfctl%l_trcstat .true.
571    set_namelist namelist_cfg ln_qsr_rgb .true.
572    set_namelist namelist_top_cfg ln_trcdta .false.
573    set_namelist namelist_top_cfg ln_trcbc  .false.
574    # put ln_ironsed, ln_hydrofe to false
575    # if not you need input files, and for tests is not necessary
576    set_namelist namelist_pisces_cfg ln_varpar .false.
577    set_namelist namelist_pisces_cfg ln_ironsed .false.
578    set_namelist namelist_pisces_cfg ln_ironice .false.
579    set_namelist namelist_pisces_cfg ln_hydrofe .false.
580    # put ln_pisdmp to false : no restoring to global mean value
581    set_namelist namelist_pisces_cfg ln_pisdmp .false.
582    if [ ${USING_MPMD} == "yes" ] ; then
583       set_xio_using_server iodef.xml true
584    else
585       set_xio_using_server iodef.xml false
586    fi
587    cd ${SETTE_DIR}
588    . ./prepare_job.sh input_ORCA2_OFF_PISCES.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
589   
590    cd ${SETTE_DIR}
591    export TEST_NAME="SHORT"
592    . ./prepare_exe_dir.sh
593    set_valid_dir
594    clean_valid_dir
595    cd ${EXE_DIR}
596    set_namelist namelist_cfg cn_exp \"OFFP_SHORT\"
597    set_namelist namelist_cfg nn_it000 $(( ${ITEND} / 2 + 1 ))
598    set_namelist namelist_cfg nn_itend ${ITEND}
599    set_namelist namelist_cfg nn_stock $(( ${ITEND} / 2 ))
600    set_namelist namelist_cfg jpni 4
601    set_namelist namelist_cfg jpnj 8
602    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
603    set_namelist namelist_cfg sn_cfctl%l_trcstat .true.
604    set_namelist namelist_cfg ln_qsr_rgb .true.
605    set_namelist namelist_top_cfg ln_rsttr .true.
606    set_namelist namelist_top_cfg nn_rsttr 2
607    set_namelist namelist_top_cfg cn_trcrst_in \"OFFP_LONG_${ITRST}_restart_trc\"
608    for (( i=1; i<=$NPROC; i++)) ; do
609        L_NPROC=$(( $i - 1 ))
610        L_NPROC=`printf "%04d\n" ${L_NPROC}`
611        ln -sf ../LONG/OFFP_LONG_${ITRST}_restart_trc_${L_NPROC}.nc .
612    done
613    set_namelist namelist_top_cfg ln_trcbc  .false.
614    # put ln_ironsed, ln_hydrofe to false
615    # if not you need input files, and for tests is not necessary
616    set_namelist namelist_pisces_cfg ln_varpar .false.
617    set_namelist namelist_pisces_cfg ln_ironsed .false.
618    set_namelist namelist_pisces_cfg ln_ironice .false.
619    set_namelist namelist_pisces_cfg ln_hydrofe .false.
620    # put ln_pisdmp to false : no restoring to global mean value
621    set_namelist namelist_pisces_cfg ln_pisdmp .false.
622    if [ ${USING_MPMD} == "yes" ] ; then
623       set_xio_using_server iodef.xml true
624    else
625       set_xio_using_server iodef.xml false
626    fi
627    cd ${SETTE_DIR}
628    . ./prepare_job.sh input_ORCA2_OFF_PISCES.cfg $NPROC ${TEST_NAME}  ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
629    cd ${SETTE_DIR}
630    . ./fcm_job.sh $NPROC  ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
631
632## Reproducibility tests for ORCA2_OFF_PISCES
633    export TEST_NAME="REPRO_4_8"
634    cd ${MAIN_DIR}
635    cd ${SETTE_DIR}
636    . ./param.cfg
637    . ./all_functions.sh
638    . ./prepare_exe_dir.sh
639    set_valid_dir
640    clean_valid_dir
641    JOB_FILE=${EXE_DIR}/run_job.sh
642    NPROC=32
643    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
644    cd ${EXE_DIR}
645    set_namelist namelist_cfg cn_exp \"OFFP_48\"
646    set_namelist namelist_cfg nn_it000 1
647    set_namelist namelist_cfg nn_itend ${ITEND}
648    set_namelist namelist_cfg jpni 4
649    set_namelist namelist_cfg jpnj 8
650    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
651    set_namelist namelist_cfg sn_cfctl%l_trcstat .true.
652    set_namelist namelist_cfg ln_qsr_rgb .true.
653    set_namelist namelist_top_cfg ln_trcdta .false.
654    set_namelist namelist_top_cfg ln_trcbc  .false.
655    # put ln_ironsed, ln_hydrofe to false
656    # if not you need input files, and for tests is not necessary
657    set_namelist namelist_pisces_cfg ln_varpar .false.
658    set_namelist namelist_pisces_cfg ln_ironsed .false.
659    set_namelist namelist_pisces_cfg ln_ironice .false.
660    set_namelist namelist_pisces_cfg ln_hydrofe .false.
661    # put ln_pisdmp to false : no restoring to global mean value
662    set_namelist namelist_pisces_cfg ln_pisdmp .false.
663    if [ ${USING_MPMD} == "yes" ] ; then
664       set_xio_using_server iodef.xml true
665    else
666       set_xio_using_server iodef.xml false
667    fi
668    cd ${SETTE_DIR}
669    . ./prepare_job.sh input_ORCA2_OFF_PISCES.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
670    cd ${SETTE_DIR}
671    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
672
673    cd ${SETTE_DIR}
674    export TEST_NAME="REPRO_8_4"
675    . ./prepare_exe_dir.sh
676    set_valid_dir
677    clean_valid_dir
678    JOB_FILE=${EXE_DIR}/run_job.sh
679    NPROC=32
680    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
681    cd ${EXE_DIR}
682    set_namelist namelist_cfg cn_exp \"OFFP_84\"
683    set_namelist namelist_cfg nn_it000 1
684    set_namelist namelist_cfg nn_itend ${ITEND}
685    set_namelist namelist_cfg jpni 8
686    set_namelist namelist_cfg jpnj 4
687    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
688    set_namelist namelist_cfg sn_cfctl%l_trcstat .true.
689    set_namelist namelist_cfg ln_qsr_rgb .true.
690    set_namelist namelist_top_cfg ln_trcdta .false.
691    set_namelist namelist_top_cfg ln_trcbc  .false.
692    # put ln_ironsed, ln_hydrofe to false
693    # if not you need input files, and for tests is not necessary
694    set_namelist namelist_pisces_cfg ln_varpar .false.
695    set_namelist namelist_pisces_cfg ln_ironsed .false.
696    set_namelist namelist_pisces_cfg ln_ironice .false.
697    set_namelist namelist_pisces_cfg ln_hydrofe .false.
698    # put ln_pisdmp to false : no restoring to global mean value
699    set_namelist namelist_pisces_cfg ln_pisdmp .false.
700    if [ ${USING_MPMD} == "yes" ] ; then
701       set_xio_using_server iodef.xml true
702    else
703       set_xio_using_server iodef.xml false
704    fi
705    cd ${SETTE_DIR}
706    . ./prepare_job.sh input_ORCA2_OFF_PISCES.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
707    cd ${SETTE_DIR}
708    . ./fcm_job.sh $NPROC  ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
709fi
710
711# -----
712# AMM12
713# -----
714if [ ${config} == "AMM12" ] ;  then
715    ## Restartability tests for AMM12
716    if [ $( echo ${CMP_NAM} | grep -ic debug ) -eq 1 ]
717    then
718   ITEND=12   # 3 h
719    else
720   ITEND=576  # 4 days
721    fi
722    ITRST=$( printf "%08d" $(( ${ITEND} / 2 )) )
723    export TEST_NAME="LONG"
724    cd ${MAIN_DIR}
725    #
726    # syncronisation if target directory/file exist (not done by makenemo)
727    . ${SETTE_DIR}/all_functions.sh
728    sync_config  AMM12 AMM12_ST 'cfgs'
729    clean_config AMM12 AMM12_ST 'cfgs'
730    #
731    . ./makenemo -m ${CMP_NAM} -n AMM12_ST -r AMM12 -j 8 add_key "${ADD_KEYS}" del_key "${DEL_KEYS}"
732    cd ${SETTE_DIR}
733    . ./param.cfg
734    . ./all_functions.sh
735    . ./prepare_exe_dir.sh
736    set_valid_dir
737    clean_valid_dir
738    JOB_FILE=${EXE_DIR}/run_job.sh
739    NPROC=32
740    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
741    cd ${EXE_DIR}
742    set_namelist namelist_cfg cn_exp \"AMM12_LONG\"
743    set_namelist namelist_cfg nn_it000 1
744    set_namelist namelist_cfg nn_itend ${ITEND}
745    set_namelist namelist_cfg nn_stock $(( ${ITEND} / 2 ))
746    set_namelist namelist_cfg jpni 4
747    set_namelist namelist_cfg jpnj 8
748    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
749    if [ ${USING_MPMD} == "yes" ] ; then
750       set_xio_using_server iodef.xml true
751    else
752       set_xio_using_server iodef.xml false
753    fi
754    cd ${SETTE_DIR}
755    . ./prepare_job.sh input_AMM12.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
756
757    cd ${SETTE_DIR}
758    export TEST_NAME="SHORT"
759    . ./prepare_exe_dir.sh
760    set_valid_dir
761    clean_valid_dir
762    cd ${EXE_DIR}
763    set_namelist namelist_cfg cn_exp \"AMM12_SHORT\"
764    set_namelist namelist_cfg nn_it000 $(( ${ITEND} / 2 + 1 ))
765    set_namelist namelist_cfg nn_itend ${ITEND}
766    set_namelist namelist_cfg nn_stock $(( ${ITEND} / 2 ))
767    set_namelist namelist_cfg jpni 4
768    set_namelist namelist_cfg jpnj 8
769    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
770    set_namelist namelist_cfg ln_rstart .true.
771    set_namelist namelist_cfg nn_rstctl 2
772    set_namelist namelist_cfg cn_ocerst_in \"AMM12_LONG_${ITRST}_restart\"
773    set_namelist namelist_cfg nn_date0 20120102
774    for (( i=1; i<=$NPROC; i++)) ; do
775        L_NPROC=$(( $i - 1 ))
776        L_NPROC=`printf "%04d\n" ${L_NPROC}`
777        ln -sf ../LONG/AMM12_LONG_${ITRST}_restart_${L_NPROC}.nc .
778    done
779    if [ ${USING_MPMD} == "yes" ] ; then
780       set_xio_using_server iodef.xml true
781    else
782       set_xio_using_server iodef.xml false
783    fi
784    cd ${SETTE_DIR}
785    . ./prepare_job.sh input_AMM12.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
786    cd ${SETTE_DIR}
787    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
788
789## Reproducibility tests for AMM12
790    export TEST_NAME="REPRO_8_4"
791    cd ${MAIN_DIR}
792    cd ${SETTE_DIR}
793    . ./param.cfg
794    . ./all_functions.sh
795    . ./prepare_exe_dir.sh
796    set_valid_dir
797    clean_valid_dir
798    JOB_FILE=${EXE_DIR}/run_job.sh
799    NPROC=32
800    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
801    cd ${EXE_DIR}
802    set_namelist namelist_cfg cn_exp \"AMM12_84\"
803    set_namelist namelist_cfg nn_it000 1
804    set_namelist namelist_cfg nn_itend ${ITEND}
805    set_namelist namelist_cfg jpni 8
806    set_namelist namelist_cfg jpnj 4
807    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
808    if [ ${USING_MPMD} == "yes" ] ; then
809       set_xio_using_server iodef.xml true
810    else
811       set_xio_using_server iodef.xml false
812    fi
813    cd ${SETTE_DIR}
814    . ./prepare_job.sh input_AMM12.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
815    cd ${SETTE_DIR}
816    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
817
818    cd ${SETTE_DIR}
819    export TEST_NAME="REPRO_4_8"
820    . ./prepare_exe_dir.sh
821    set_valid_dir
822    clean_valid_dir
823    JOB_FILE=${EXE_DIR}/run_job.sh
824    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
825    cd ${EXE_DIR}
826    set_namelist namelist_cfg cn_exp \"AMM12_48\"
827    set_namelist namelist_cfg nn_it000 1
828    set_namelist namelist_cfg nn_itend ${ITEND}
829    set_namelist namelist_cfg jpni 4
830    set_namelist namelist_cfg jpnj 8
831    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
832    if [ ${USING_MPMD} == "yes" ] ; then
833       set_xio_using_server iodef.xml true
834    else
835       set_xio_using_server iodef.xml false
836    fi
837    cd ${SETTE_DIR}
838    . ./prepare_job.sh input_AMM12.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
839    cd ${SETTE_DIR}
840    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
841fi
842
843
844# ---------
845# ORCA2_SAS
846# ---------
847if [ ${config} == "SAS" ] ;  then
848## Restartability tests
849    if [ $( echo ${CMP_NAM} | grep -ic debug ) -eq 1 ]
850    then
851   ITEND=16   # 1 day
852    else
853   ITEND=256  # 16 days
854    fi
855    ITRST=$( printf "%08d" $(( ${ITEND} / 2 )) )
856    export TEST_NAME="LONG"
857    cd ${MAIN_DIR}
858    #
859    # syncronisation if target directory/file exist (not done by makenemo)
860    . ${SETTE_DIR}/all_functions.sh
861    sync_config  ORCA2_SAS_ICE ORCA2_SAS_ICE_ST 'cfgs'
862    clean_config ORCA2_SAS_ICE ORCA2_SAS_ICE_ST 'cfgs'
863    #
864    . ./makenemo -m ${CMP_NAM} -n ORCA2_SAS_ICE_ST -r ORCA2_SAS_ICE -j 8 add_key "${ADD_KEYS}" del_key "${DEL_KEYS}"
865    cd ${SETTE_DIR}
866    . ./param.cfg
867    . ./all_functions.sh
868    . ./prepare_exe_dir.sh
869    set_valid_dir
870    clean_valid_dir
871    JOB_FILE=${EXE_DIR}/run_job.sh
872    NPROC=32
873    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
874    cd ${EXE_DIR}
875    set_namelist namelist_cfg cn_exp \"SAS\"
876    set_namelist namelist_cfg nn_it000 1
877    set_namelist namelist_cfg nn_itend ${ITEND}
878    set_namelist namelist_cfg nn_stock $(( ${ITEND} / 2 ))
879    set_namelist namelist_cfg jpni 4
880    set_namelist namelist_cfg jpnj 8
881    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
882    set_namelist namelist_ice_cfg ln_icediachk .true.
883    if [ ${USING_MPMD} == "yes" ] ; then
884       set_xio_using_server iodef.xml true
885    else
886       set_xio_using_server iodef.xml false
887    fi
888    cd ${SETTE_DIR}
889    . ./prepare_job.sh input_SAS.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
890
891    cd ${SETTE_DIR}
892    export TEST_NAME="SHORT"
893    . ./prepare_exe_dir.sh
894    set_valid_dir
895    clean_valid_dir
896    cd ${EXE_DIR}
897    set_namelist namelist_cfg cn_exp \"SAS\"
898    set_namelist namelist_cfg nn_it000 $(( ${ITEND} / 2 + 1 ))
899    set_namelist namelist_cfg nn_itend ${ITEND}
900    set_namelist namelist_cfg nn_stock $(( ${ITEND} / 2 ))
901    set_namelist namelist_cfg jpni 4
902    set_namelist namelist_cfg jpnj 8
903    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
904    set_namelist namelist_cfg ln_rstart .true.
905    set_namelist namelist_cfg nn_rstctl 2
906    set_namelist namelist_cfg nn_date0 010109
907    set_namelist namelist_cfg cn_ocerst_in \"SAS_${ITRST}_restart\"
908    set_namelist namelist_ice_cfg cn_icerst_in \"SAS_${ITRST}_restart_ice\"
909    if [ ${USING_MPMD} == "yes" ] ; then
910       set_xio_using_server iodef.xml true
911    else
912       set_xio_using_server iodef.xml false
913    fi
914    for (( i=1; i<=$NPROC; i++)) ; do
915        L_NPROC=$(( $i - 1 ))
916        L_NPROC=`printf "%04d\n" ${L_NPROC}`
917        ln -sf ../LONG/SAS_${ITRST}_restart_${L_NPROC}.nc .
918        ln -sf ../LONG/SAS_${ITRST}_restart_ice_${L_NPROC}.nc .
919    done
920    cd ${SETTE_DIR}
921    . ./prepare_job.sh input_SAS.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
922    cd ${SETTE_DIR}
923    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
924
925## Reproducibility tests
926    if [ $( echo ${CMP_NAM} | grep -ic debug ) -eq 1 ]
927    then
928   ITEND=16  # 1 day
929    else
930   ITEND=80  # 5 days
931    fi
932    export TEST_NAME="REPRO_4_8"
933    cd ${MAIN_DIR}
934    cd ${SETTE_DIR}
935    . ./param.cfg
936    . ./all_functions.sh
937    . ./prepare_exe_dir.sh
938    set_valid_dir
939    clean_valid_dir
940    JOB_FILE=${EXE_DIR}/run_job.sh
941    NPROC=32
942    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
943    cd ${EXE_DIR}
944    set_namelist namelist_cfg cn_exp \"SAS_48\"
945    set_namelist namelist_cfg nn_it000 1
946    set_namelist namelist_cfg nn_itend ${ITEND}
947    set_namelist namelist_cfg jpni 4
948    set_namelist namelist_cfg jpnj 8
949    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
950    if [ ${USING_MPMD} == "yes" ] ; then
951       set_xio_using_server iodef.xml true
952    else
953       set_xio_using_server iodef.xml false
954    fi
955    cd ${SETTE_DIR}
956    . ./prepare_job.sh input_SAS.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
957    cd ${SETTE_DIR}
958    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
959
960    cd ${SETTE_DIR}
961    export TEST_NAME="REPRO_8_4"
962    . ./prepare_exe_dir.sh
963    set_valid_dir
964    clean_valid_dir
965    JOB_FILE=${EXE_DIR}/run_job.sh
966    NPROC=32
967    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
968    cd ${EXE_DIR}
969    set_namelist namelist_cfg cn_exp \"SAS_84\"
970    set_namelist namelist_cfg nn_it000 1
971    set_namelist namelist_cfg nn_itend ${ITEND}
972    set_namelist namelist_cfg jpni 8
973    set_namelist namelist_cfg jpnj 4
974    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
975    if [ ${USING_MPMD} == "yes" ] ; then
976       set_xio_using_server iodef.xml true
977    else
978       set_xio_using_server iodef.xml false
979    fi
980    cd ${SETTE_DIR}
981    . ./prepare_job.sh input_SAS.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
982    cd ${SETTE_DIR}
983    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
984
985fi
986
987
988# --------------
989# ORCA2_ICE_OBS
990# --------------
991## Test assimilation interface code, OBS and ASM for reproducibility
992## Restartability not tested (ASM code not restartable while increments are being applied)
993if [ ${config} == "ORCA2_ICE_OBS" ] ; then
994## Reproducibility tests
995    if [ $( echo ${CMP_NAM} | grep -ic debug ) -eq 1 ]
996    then
997   ITEND=16  # 1 day
998    else
999   ITEND=80  # 5 days
1000    fi
1001    export TEST_NAME="REPRO_4_8"
1002    cd ${MAIN_DIR}
1003    #
1004    # syncronisation if target directory/file exist (not done by makenemo)
1005    . ${SETTE_DIR}/all_functions.sh
1006    sync_config  ORCA2_ICE_PISCES ORCA2_ICE_OBS_ST 'cfgs'
1007    clean_config ORCA2_ICE_PISCES ORCA2_ICE_OBS_ST 'cfgs'
1008    #
1009    . ./makenemo -m ${CMP_NAM} -n ORCA2_ICE_OBS_ST -r ORCA2_ICE_PISCES -d "OCE ICE"  -j 8 add_key "key_asminc ${ADD_KEYS}" del_key "key_top ${DEL_KEYS}"
1010    cd ${SETTE_DIR}
1011    . ./param.cfg
1012    . ./all_functions.sh
1013    . ./prepare_exe_dir.sh
1014    set_valid_dir
1015    clean_valid_dir
1016    JOB_FILE=${EXE_DIR}/run_job.sh
1017    NPROC=32
1018    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
1019    cd ${EXE_DIR}
1020    set_namelist namelist_cfg cn_exp \"O2L3OBS_48\"
1021    set_namelist namelist_cfg nn_it000 1
1022    set_namelist namelist_cfg nn_itend ${ITEND}
1023    set_namelist namelist_cfg ln_read_cfg .true.
1024    set_namelist namelist_cfg jpni 4
1025    set_namelist namelist_cfg jpnj 8
1026    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
1027    set_namelist namelist_cfg sn_cfctl%l_trcstat .true.
1028    set_namelist namelist_cfg ln_diaobs .true.
1029    set_namelist namelist_cfg ln_t3d .true.
1030    set_namelist namelist_cfg ln_s3d .true.
1031    set_namelist namelist_cfg ln_sst .true.
1032    set_namelist namelist_cfg ln_sla .true.
1033    set_namelist namelist_cfg ln_sic .true.
1034    set_namelist namelist_cfg ln_vel3d .true.
1035    set_namelist namelist_cfg ln_bkgwri .true.
1036    set_namelist namelist_cfg ln_trainc .true.
1037    set_namelist namelist_cfg ln_dyninc .true.
1038    set_namelist namelist_cfg ln_sshinc .true.
1039    set_namelist namelist_cfg ln_asmiau .true.
1040    #remove all useless options for pisces (due to ORCA2_ICE_PISCES reference configuration)
1041    set_namelist namelist_top_cfg ln_trcdta .false.
1042    set_namelist namelist_top_cfg ln_trcbc  .false.
1043    # put ln_ironsed, ln_river, ln_ndepo, ln_dust to false
1044    # if not you need input files, and for tests is not necessary
1045    set_namelist namelist_pisces_cfg ln_varpar .false.
1046    set_namelist namelist_pisces_cfg ln_ironsed .false.
1047    set_namelist namelist_pisces_cfg ln_ironice .false.
1048    set_namelist namelist_pisces_cfg ln_hydrofe .false.
1049    if [ ${USING_MPMD} == "yes" ] ; then
1050       set_xio_using_server iodef.xml true
1051    else
1052       set_xio_using_server iodef.xml false
1053    fi
1054    cd ${SETTE_DIR}
1055    . ./prepare_job.sh input_ORCA2_ICE_OBS.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
1056    cd ${SETTE_DIR}
1057    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
1058
1059   cd ${SETTE_DIR}
1060    export TEST_NAME="REPRO_8_4"
1061    . ./prepare_exe_dir.sh
1062    set_valid_dir
1063    clean_valid_dir
1064    JOB_FILE=${EXE_DIR}/run_job.sh
1065    NPROC=32
1066    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
1067    cd ${EXE_DIR}
1068    set_namelist namelist_cfg cn_exp \"O2L3OBS_84\"
1069    set_namelist namelist_cfg nn_it000 1
1070    set_namelist namelist_cfg nn_itend ${ITEND}
1071    set_namelist namelist_cfg ln_read_cfg .true.
1072    set_namelist namelist_cfg jpni 8
1073    set_namelist namelist_cfg jpnj 4
1074    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
1075    set_namelist namelist_cfg sn_cfctl%l_trcstat .true.
1076    set_namelist namelist_cfg ln_diaobs .true.
1077    set_namelist namelist_cfg ln_t3d .true.
1078    set_namelist namelist_cfg ln_s3d .true.
1079    set_namelist namelist_cfg ln_sst .true.
1080    set_namelist namelist_cfg ln_sla .true.
1081    set_namelist namelist_cfg ln_sic .true.
1082    set_namelist namelist_cfg ln_vel3d .true.
1083    set_namelist namelist_cfg ln_bkgwri .true.
1084    set_namelist namelist_cfg ln_trainc .true.
1085    set_namelist namelist_cfg ln_dyninc .true.
1086    set_namelist namelist_cfg ln_sshinc .true.
1087    set_namelist namelist_cfg ln_asmiau .true.
1088    #remove all useless options for pisces (due to ORCA2_ICE_PISCES reference configuration)
1089    set_namelist namelist_top_cfg ln_trcdta .false.
1090    set_namelist namelist_top_cfg ln_trcbc  .false.
1091    # put ln_ironsed, ln_river, ln_ndepo, ln_dust to false
1092    # if not you need input files, and for tests is not necessary
1093    set_namelist namelist_pisces_cfg ln_varpar .false.
1094    set_namelist namelist_pisces_cfg ln_ironsed .false.
1095    set_namelist namelist_pisces_cfg ln_ironice .false.
1096    set_namelist namelist_pisces_cfg ln_hydrofe .false.
1097    if [ ${USING_MPMD} == "yes" ] ; then
1098       set_xio_using_server iodef.xml true
1099    else
1100       set_xio_using_server iodef.xml false
1101    fi
1102    cd ${SETTE_DIR}
1103    . ./prepare_job.sh input_ORCA2_ICE_OBS.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
1104    cd ${SETTE_DIR}
1105    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
1106fi
1107
1108# ------------
1109# AGRIF ICE
1110# -----------
1111if [ ${config} == "AGRIF" ] ;  then
1112## Restartability tests
1113    if [ $( echo ${CMP_NAM} | grep -ic debug ) -eq 1 ]
1114    then
1115   ITEND=4   # 6h
1116    else
1117   ITEND=20  # 1d and 6h
1118    fi
1119    ITRST=$(   printf "%08d" $(( ${ITEND} / 2 )) )
1120    ITRST_1=$( printf "%08d" $(( ${ITEND} / 2 )) )
1121    ITRST_2=$( printf "%08d" $(( ${ITEND} * 4 / 2 )) )
1122    ITRST_3=$( printf "%08d" $(( ${ITEND} * 4 * 3 / 2 )) )
1123    export TEST_NAME="LONG"
1124    cd ${MAIN_DIR}
1125    #
1126    # syncronisation if target directory/file exist (not done by makenemo)
1127    . ${SETTE_DIR}/all_functions.sh
1128    sync_config  AGRIF_DEMO AGRIF_DEMO_ST 'cfgs'
1129    clean_config AGRIF_DEMO AGRIF_DEMO_ST 'cfgs'
1130    #
1131    . ./makenemo -m ${CMP_NAM} -n AGRIF_DEMO_ST -r AGRIF_DEMO -j 8 add_key "${ADD_KEYS}" del_key "${DEL_KEYS}"
1132    cd ${SETTE_DIR}
1133    . ./param.cfg
1134    . ./all_functions.sh
1135    . ./prepare_exe_dir.sh
1136    set_valid_dir
1137    clean_valid_dir
1138    JOB_FILE=${EXE_DIR}/run_job.sh
1139    NPROC=16
1140    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
1141    cd ${EXE_DIR}
1142    set_namelist namelist_cfg cn_exp \"AGRIF_LONG\"
1143    set_namelist namelist_cfg nn_it000 1
1144    set_namelist namelist_cfg nn_itend ${ITEND}
1145    set_namelist namelist_cfg nn_stock $(( ${ITEND} / 2 ))
1146    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
1147    set_namelist 1_namelist_cfg cn_exp \"AGRIF_LONG\"
1148    set_namelist 1_namelist_cfg nn_it000 1
1149    set_namelist 1_namelist_cfg nn_itend ${ITEND}
1150    set_namelist 1_namelist_cfg nn_stock $(( ${ITEND} / 2 ))
1151    set_namelist 1_namelist_cfg sn_cfctl%l_runstat .true.
1152    set_namelist 2_namelist_cfg cn_exp \"AGRIF_LONG\"
1153    set_namelist 2_namelist_cfg nn_it000 1
1154    set_namelist 2_namelist_cfg nn_itend $(( ${ITEND} * 4 ))
1155    set_namelist 2_namelist_cfg nn_stock $(( ${ITEND} * 4 / 2 ))
1156    set_namelist 2_namelist_cfg sn_cfctl%l_runstat .true.
1157    set_namelist 3_namelist_cfg cn_exp \"AGRIF_LONG\"
1158    set_namelist 3_namelist_cfg nn_it000 1
1159    set_namelist 3_namelist_cfg nn_itend $(( ${ITEND} * 4 * 3 ))
1160    set_namelist 3_namelist_cfg nn_stock $(( ${ITEND} * 4 * 3 / 2 ))
1161    set_namelist 3_namelist_cfg sn_cfctl%l_runstat .true.
1162
1163    if [ ${USING_MPMD} == "yes" ] ; then
1164       set_xio_using_server iodef.xml true
1165    else
1166       set_xio_using_server iodef.xml false
1167    fi
1168    cd ${SETTE_DIR}
1169    . ./prepare_job.sh input_AGRIF.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
1170   
1171    cd ${SETTE_DIR}
1172    export TEST_NAME="SHORT"
1173    . ./prepare_exe_dir.sh
1174    set_valid_dir
1175    clean_valid_dir
1176    cd ${EXE_DIR}
1177    set_namelist namelist_cfg cn_exp \"AGRIF_SHORT\"
1178    set_namelist namelist_cfg nn_it000 $(( ${ITEND} / 2 + 1 ))
1179    set_namelist namelist_cfg nn_itend ${ITEND}
1180    set_namelist namelist_cfg nn_stock $(( ${ITEND} / 2 ))
1181    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
1182    set_namelist namelist_cfg ln_rstart .true.
1183    set_namelist namelist_cfg nn_rstctl 2
1184    set_namelist 1_namelist_cfg cn_exp \"AGRIF_SHORT\"
1185    set_namelist 1_namelist_cfg nn_it000 $(( ${ITEND} / 2 + 1 ))
1186    set_namelist 1_namelist_cfg nn_itend ${ITEND}
1187    set_namelist 1_namelist_cfg nn_stock $(( ${ITEND} / 2 ))
1188    set_namelist 1_namelist_cfg sn_cfctl%l_runstat .true.
1189    set_namelist 1_namelist_cfg ln_rstart .true.
1190    set_namelist 1_namelist_cfg nn_rstctl 2
1191    set_namelist 2_namelist_cfg cn_exp \"AGRIF_SHORT\"
1192    set_namelist 2_namelist_cfg nn_it000 $(( ${ITEND} * 4 / 2 + 1 ))
1193    set_namelist 2_namelist_cfg nn_itend $(( ${ITEND} * 4 ))
1194    set_namelist 2_namelist_cfg nn_stock $(( ${ITEND} * 4 / 2 ))
1195    set_namelist 2_namelist_cfg sn_cfctl%l_runstat .true.
1196    set_namelist 2_namelist_cfg ln_rstart .true.
1197    set_namelist 2_namelist_cfg nn_rstctl 2
1198    set_namelist 3_namelist_cfg cn_exp \"AGRIF_SHORT\"
1199    set_namelist 3_namelist_cfg nn_it000 $(( ${ITEND} * 4 * 3 / 2 + 1 ))
1200    set_namelist 3_namelist_cfg nn_itend $(( ${ITEND} * 4 * 3 ))
1201    set_namelist 3_namelist_cfg nn_stock $(( ${ITEND} * 4 * 3 / 2 ))
1202    set_namelist 3_namelist_cfg sn_cfctl%l_runstat .true.
1203    set_namelist 3_namelist_cfg ln_rstart .true.
1204    set_namelist 3_namelist_cfg nn_rstctl 2
1205    set_namelist namelist_cfg cn_ocerst_in \"AGRIF_LONG_${ITRST}_restart\"
1206    set_namelist namelist_ice_cfg cn_icerst_in \"AGRIF_LONG_${ITRST}_restart_ice\"
1207    set_namelist 1_namelist_cfg cn_ocerst_in \"AGRIF_LONG_${ITRST_1}_restart\"
1208    set_namelist 1_namelist_ice_cfg cn_icerst_in \"AGRIF_LONG_${ITRST_1}_restart_ice\"
1209    set_namelist 2_namelist_cfg cn_ocerst_in \"AGRIF_LONG_${ITRST_2}_restart\"
1210    set_namelist 2_namelist_ice_cfg cn_icerst_in \"AGRIF_LONG_${ITRST_2}_restart_ice\"
1211    set_namelist 3_namelist_cfg cn_ocerst_in \"AGRIF_LONG_${ITRST_3}_restart\"
1212    set_namelist 3_namelist_ice_cfg cn_icerst_in \"AGRIF_LONG_${ITRST_3}_restart_ice\"
1213
1214    for (( i=1; i<=$NPROC; i++)) ; do
1215        L_NPROC=$(( $i - 1 ))
1216        L_NPROC=`printf "%04d\n" ${L_NPROC}`
1217        ln -sf ../LONG/AGRIF_LONG_${ITRST}_restart_${L_NPROC}.nc .
1218        ln -sf ../LONG/AGRIF_LONG_${ITRST}_restart_ice_${L_NPROC}.nc .
1219        ln -sf ../LONG/1_AGRIF_LONG_${ITRST_1}_restart_${L_NPROC}.nc .
1220        ln -sf ../LONG/1_AGRIF_LONG_${ITRST_1}_restart_ice_${L_NPROC}.nc .
1221        ln -sf ../LONG/2_AGRIF_LONG_${ITRST_2}_restart_${L_NPROC}.nc .
1222        ln -sf ../LONG/2_AGRIF_LONG_${ITRST_2}_restart_ice_${L_NPROC}.nc .
1223        ln -sf ../LONG/3_AGRIF_LONG_${ITRST_3}_restart_${L_NPROC}.nc .
1224        ln -sf ../LONG/3_AGRIF_LONG_${ITRST_3}_restart_ice_${L_NPROC}.nc .
1225    done
1226    if [ ${USING_MPMD} == "yes" ] ; then
1227       set_xio_using_server iodef.xml true
1228    else
1229       set_xio_using_server iodef.xml false
1230    fi
1231    cd ${SETTE_DIR}
1232    . ./prepare_job.sh input_AGRIF.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
1233    cd ${SETTE_DIR}
1234    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
1235
1236## Reproducibility tests
1237    export TEST_NAME="REPRO_2_8"
1238    cd ${MAIN_DIR}
1239    cd ${SETTE_DIR}
1240    . ./param.cfg
1241    . ./all_functions.sh
1242    . ./prepare_exe_dir.sh
1243    set_valid_dir
1244    clean_valid_dir
1245    JOB_FILE=${EXE_DIR}/run_job.sh
1246    NPROC=16
1247    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
1248    cd ${EXE_DIR}
1249    set_namelist namelist_cfg cn_exp \"AGRIF_28\"
1250    set_namelist namelist_cfg nn_it000 1
1251    set_namelist namelist_cfg nn_itend ${ITEND}
1252    set_namelist namelist_cfg jpni 2
1253    set_namelist namelist_cfg jpnj 8
1254    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
1255    set_namelist 1_namelist_cfg cn_exp \"AGRIF_28\"
1256    set_namelist 1_namelist_cfg nn_it000 1
1257    set_namelist 1_namelist_cfg nn_itend ${ITEND}
1258    set_namelist 1_namelist_cfg jpni 2
1259    set_namelist 1_namelist_cfg jpnj 8
1260    set_namelist 1_namelist_cfg sn_cfctl%l_runstat .true.
1261    set_namelist 2_namelist_cfg cn_exp \"AGRIF_28\"
1262    set_namelist 2_namelist_cfg nn_it000 1
1263    set_namelist 2_namelist_cfg nn_itend $(( ${ITEND} * 4 ))
1264    set_namelist 2_namelist_cfg jpni 2
1265    set_namelist 2_namelist_cfg jpnj 8
1266    set_namelist 2_namelist_cfg sn_cfctl%l_runstat .true.
1267    set_namelist 3_namelist_cfg cn_exp \"AGRIF_28\"
1268    set_namelist 3_namelist_cfg nn_it000 1
1269    set_namelist 3_namelist_cfg nn_itend $(( ${ITEND} * 4 * 3 ))
1270    set_namelist 3_namelist_cfg jpni 2
1271    set_namelist 3_namelist_cfg jpnj 8
1272    set_namelist 3_namelist_cfg sn_cfctl%l_runstat .true.
1273
1274    if [ ${USING_MPMD} == "yes" ] ; then
1275       set_xio_using_server iodef.xml true
1276    else
1277       set_xio_using_server iodef.xml false
1278    fi
1279    cd ${SETTE_DIR}
1280    . ./prepare_job.sh input_AGRIF.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
1281    cd ${SETTE_DIR}
1282    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
1283
1284    cd ${SETTE_DIR}
1285    export TEST_NAME="REPRO_4_4"
1286    . ./prepare_exe_dir.sh
1287    set_valid_dir
1288    clean_valid_dir
1289    JOB_FILE=${EXE_DIR}/run_job.sh
1290    NPROC=16
1291    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
1292    cd ${EXE_DIR}
1293    set_namelist namelist_cfg cn_exp \"AGRIF_44\"
1294    set_namelist namelist_cfg nn_it000 1
1295    set_namelist namelist_cfg nn_itend ${ITEND}
1296    set_namelist namelist_cfg jpni 4
1297    set_namelist namelist_cfg jpnj 4
1298    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
1299    set_namelist 1_namelist_cfg cn_exp \"AGRIF_44\"
1300    set_namelist 1_namelist_cfg nn_it000 1
1301    set_namelist 1_namelist_cfg nn_itend ${ITEND}
1302    set_namelist 1_namelist_cfg jpni 4
1303    set_namelist 1_namelist_cfg jpnj 4
1304    set_namelist 1_namelist_cfg sn_cfctl%l_runstat .true.
1305    set_namelist 2_namelist_cfg cn_exp \"AGRIF_44\"
1306    set_namelist 2_namelist_cfg nn_it000 1
1307    set_namelist 2_namelist_cfg nn_itend $(( ${ITEND} * 4 ))
1308    set_namelist 2_namelist_cfg jpni 4
1309    set_namelist 2_namelist_cfg jpnj 4
1310    set_namelist 2_namelist_cfg sn_cfctl%l_runstat .true.
1311    set_namelist 3_namelist_cfg cn_exp \"AGRIF_44\"
1312    set_namelist 3_namelist_cfg nn_it000 1
1313    set_namelist 3_namelist_cfg nn_itend $(( ${ITEND} * 4 * 3 ))
1314    set_namelist 3_namelist_cfg jpni 4
1315    set_namelist 3_namelist_cfg jpnj 4
1316    set_namelist 3_namelist_cfg sn_cfctl%l_runstat .true.
1317
1318    if [ ${USING_MPMD} == "yes" ] ; then
1319       set_xio_using_server iodef.xml true
1320    else
1321       set_xio_using_server iodef.xml false
1322    fi
1323    cd ${SETTE_DIR}
1324    . ./prepare_job.sh input_AGRIF.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
1325    cd ${SETTE_DIR}
1326    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
1327
1328## test code corruption with AGRIF (phase 1) ==> Compile with key_agrif but run with no zoom
1329    if [ $( echo ${CMP_NAM} | grep -ic debug ) -eq 1 ]
1330    then
1331   ITEND=16   # 1d
1332    else
1333   ITEND=150  # 5d and 9h
1334    fi
1335    export TEST_NAME="ORCA2"
1336    cd ${MAIN_DIR}
1337    cd ${SETTE_DIR}
1338    . ./param.cfg
1339    . ./all_functions.sh
1340    . ./prepare_exe_dir.sh
1341    set_valid_dir
1342    clean_valid_dir
1343    JOB_FILE=${EXE_DIR}/run_job.sh
1344    NPROC=32
1345    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
1346    cd ${EXE_DIR}
1347    set_namelist namelist_cfg cn_exp \"ORCA2\"
1348    set_namelist namelist_cfg nn_it000 1
1349    set_namelist namelist_cfg nn_itend ${ITEND}
1350    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
1351
1352#   Set the number of fine grids to zero:   
1353    sed -i "1s/.*/0/" ${EXE_DIR}/AGRIF_FixedGrids.in
1354
1355    if [ ${USING_MPMD} == "yes" ] ; then
1356       set_xio_using_server iodef.xml true
1357    else
1358       set_xio_using_server iodef.xml false
1359    fi
1360    cd ${SETTE_DIR}
1361    . ./prepare_job.sh input_AGRIF.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
1362    cd ${SETTE_DIR}
1363    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
1364
1365fi
1366
1367
1368## test code corruption with AGRIF (phase 2) ==> Compile without key_agrif (to be compared with AGRIF_DEMO_ST/ORCA2)
1369if [ ${config} == "AGRIF" ] ;  then
1370    export TEST_NAME="ORCA2"
1371    cd ${MAIN_DIR}
1372    #
1373    # syncronisation if target directory/file exist (not done by makenemo)
1374    . ${SETTE_DIR}/all_functions.sh
1375    sync_config  AGRIF_DEMO AGRIF_DEMO_NOAGRIF_ST 'cfgs'
1376    clean_config AGRIF_DEMO AGRIF_DEMO_NOAGRIF_ST 'cfgs'
1377    #
1378    . ./makenemo -m ${CMP_NAM} -n AGRIF_DEMO_NOAGRIF_ST -r AGRIF_DEMO -j 8 add_key "${ADD_KEYS}" del_key "key_agrif ${DEL_KEYS}"
1379    cd ${SETTE_DIR}
1380    . ./param.cfg
1381    . ./all_functions.sh
1382    . ./prepare_exe_dir.sh
1383    set_valid_dir
1384    clean_valid_dir
1385    JOB_FILE=${EXE_DIR}/run_job.sh
1386    NPROC=32
1387    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
1388    cd ${EXE_DIR}
1389    set_namelist namelist_cfg cn_exp \"ORCA2\"
1390    set_namelist namelist_cfg nn_it000 1
1391    set_namelist namelist_cfg nn_itend ${ITEND}
1392    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
1393#
1394    if [ ${USING_MPMD} == "yes" ] ; then
1395       set_xio_using_server iodef.xml true
1396    else
1397       set_xio_using_server iodef.xml false
1398    fi
1399    cd ${SETTE_DIR}
1400    . ./prepare_job.sh input_AGRIF.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
1401    cd ${SETTE_DIR}
1402    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
1403
1404fi
1405
1406# -------
1407# WED025
1408# -------
1409if [ ${config} == "WED025" ] ;  then
1410## Restartability tests
1411    if [ $( echo ${CMP_NAM} | grep -ic debug ) -eq 1 ]
1412    then
1413   ITEND=12   # 4h
1414    else
1415   ITEND=720  # 10 days
1416    fi
1417    ITRST=$( printf "%08d" $(( ${ITEND} / 2 )) )
1418    export TEST_NAME="LONG"
1419    cd ${MAIN_DIR}
1420    #
1421    # syncronisation if target directory/file exist (not done by makenemo)
1422    . ${SETTE_DIR}/all_functions.sh
1423    sync_config  WED025 WED025_ST 'cfgs'
1424    clean_config WED025 WED025_ST 'cfgs'
1425    #
1426    . ./makenemo -m ${CMP_NAM} -n WED025_ST -r WED025 -j 8 add_key "${ADD_KEYS}" del_key "${DEL_KEYS}"
1427    cd ${SETTE_DIR}
1428    . ./param.cfg
1429    . ./all_functions.sh
1430    . ./prepare_exe_dir.sh
1431    set_valid_dir
1432    clean_valid_dir
1433    JOB_FILE=${EXE_DIR}/run_job.sh
1434    NPROC=32
1435    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
1436    cd ${EXE_DIR}
1437    set_namelist namelist_cfg cn_exp \"WED025_LONG\"
1438    set_namelist namelist_cfg nn_it000 1
1439    set_namelist namelist_cfg nn_itend ${ITEND}
1440    set_namelist namelist_cfg nn_stock $(( ${ITEND} / 2 ))
1441    set_namelist namelist_cfg nn_date0 20000115
1442    set_namelist namelist_cfg jpni 4
1443    set_namelist namelist_cfg jpnj 8
1444    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
1445    #set_namelist namelist_ice_cfg ln_icediachk .true.
1446    if [ ${USING_MPMD} == "yes" ] ; then
1447       set_xio_using_server iodef.xml true
1448    else
1449       set_xio_using_server iodef.xml false
1450    fi
1451    cd ${SETTE_DIR}
1452    . ./prepare_job.sh input_WED025.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
1453   
1454    cd ${SETTE_DIR}
1455    export TEST_NAME="SHORT"
1456    . ./prepare_exe_dir.sh
1457    set_valid_dir
1458    clean_valid_dir
1459    cd ${EXE_DIR}
1460    set_namelist namelist_cfg cn_exp \"WED025_SHORT\"
1461    set_namelist namelist_cfg nn_it000 $(( ${ITEND} / 2 + 1 ))
1462    set_namelist namelist_cfg nn_itend ${ITEND}
1463    set_namelist namelist_cfg nn_stock $(( ${ITEND} / 2 ))
1464    set_namelist namelist_cfg ln_rstart .true.
1465    set_namelist namelist_cfg nn_rstctl 2
1466    set_namelist namelist_cfg jpni 4
1467    set_namelist namelist_cfg jpnj 8
1468    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
1469    set_namelist namelist_cfg cn_ocerst_in \"WED025_LONG_${ITRST}_restart\"
1470    set_namelist namelist_ice_cfg cn_icerst_in \"WED025_LONG_${ITRST}_restart_ice\"
1471    for (( i=1; i<=$NPROC; i++)) ; do
1472        L_NPROC=$(( $i - 1 ))
1473        L_NPROC=`printf "%04d\n" ${L_NPROC}`
1474        ln -sf ../LONG/WED025_LONG_${ITRST}_restart_${L_NPROC}.nc .
1475        ln -sf ../LONG/WED025_LONG_${ITRST}_restart_ice_${L_NPROC}.nc .
1476    done
1477    if [ ${USING_MPMD} == "yes" ] ; then
1478       set_xio_using_server iodef.xml true
1479    else
1480       set_xio_using_server iodef.xml false
1481    fi
1482    cd ${SETTE_DIR}
1483    . ./prepare_job.sh input_WED025.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
1484    cd ${SETTE_DIR}
1485    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
1486
1487## Reproducibility tests
1488    export TEST_NAME="REPRO_5_6"
1489    cd ${MAIN_DIR}
1490    cd ${SETTE_DIR}
1491    . ./param.cfg
1492    . ./all_functions.sh
1493    . ./prepare_exe_dir.sh
1494    set_valid_dir
1495    clean_valid_dir
1496    JOB_FILE=${EXE_DIR}/run_job.sh
1497    NPROC=32
1498    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
1499    cd ${EXE_DIR}
1500    set_namelist namelist_cfg cn_exp \"WED025_56\"
1501    set_namelist namelist_cfg nn_it000 1
1502    set_namelist namelist_cfg nn_itend ${ITEND}
1503    set_namelist namelist_cfg nn_date0 20000115
1504    set_namelist namelist_cfg jpni 6
1505    set_namelist namelist_cfg jpnj 7
1506    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
1507    if [ ${USING_MPMD} == "yes" ] ; then
1508       set_xio_using_server iodef.xml true
1509    else
1510       set_xio_using_server iodef.xml false
1511    fi
1512    cd ${SETTE_DIR}
1513    . ./prepare_job.sh input_WED025.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
1514    cd ${SETTE_DIR}
1515    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
1516
1517    cd ${SETTE_DIR}
1518    export TEST_NAME="REPRO_8_4"
1519    . ./prepare_exe_dir.sh
1520    set_valid_dir
1521    clean_valid_dir
1522    JOB_FILE=${EXE_DIR}/run_job.sh
1523    NPROC=32
1524    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
1525    cd ${EXE_DIR}
1526    set_namelist namelist_cfg cn_exp \"WED025_84\"
1527    set_namelist namelist_cfg nn_it000 1
1528    set_namelist namelist_cfg nn_itend ${ITEND}
1529    set_namelist namelist_cfg nn_date0 20000115
1530    set_namelist namelist_cfg jpni 8
1531    set_namelist namelist_cfg jpnj 4
1532    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
1533    if [ ${USING_MPMD} == "yes" ] ; then
1534       set_xio_using_server iodef.xml true
1535    else
1536       set_xio_using_server iodef.xml false
1537    fi
1538    cd ${SETTE_DIR}
1539    . ./prepare_job.sh input_WED025.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
1540    cd ${SETTE_DIR}
1541    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
1542fi
1543
1544
1545done
Note: See TracBrowser for help on using the repository browser.