New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
sette_reference-configurations.sh in utils/CI/r12931_sette_ticket2462 – NEMO

source: utils/CI/r12931_sette_ticket2462/sette_reference-configurations.sh

Last change on this file was 13755, checked in by andmirek, 3 years ago

Ticket #2462: Sette to test restarts read/write with XIOS

  • Property svn:executable set to *
File size: 63.3 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_XIOS_RRW} == "yes" ]
198       then
199       set_namelist namelist_cfg nn_wxios 1
200    fi
201    if [ ${USING_MPMD} == "yes" ] ; then
202       set_xio_using_server iodef.xml true
203    else
204       set_xio_using_server iodef.xml false
205    fi
206    cd ${SETTE_DIR}
207    . ./prepare_job.sh input_GYRE.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
208
209    cd ${SETTE_DIR}
210    export TEST_NAME="SHORT"
211    . ./prepare_exe_dir.sh
212    set_valid_dir
213    clean_valid_dir
214    cd ${EXE_DIR}
215    set_namelist namelist_cfg cn_exp \"GYREPIS_SHORT\"
216    set_namelist namelist_cfg nn_it000 $(( ${ITEND} / 2 + 1 ))
217    set_namelist namelist_cfg nn_itend ${ITEND}
218    set_namelist namelist_cfg nn_stock $(( ${ITEND} / 2 ))
219    set_namelist namelist_cfg ln_rstart .true.
220    set_namelist namelist_cfg nn_rstctl 2
221    set_namelist namelist_cfg ln_linssh .true.
222    set_namelist namelist_cfg jpni 2
223    set_namelist namelist_cfg jpnj 4
224    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
225    set_namelist namelist_cfg sn_cfctl%l_trcstat .true.
226    set_namelist namelist_top_cfg ln_rsttr .true.
227    set_namelist namelist_top_cfg nn_rsttr 2
228    set_namelist namelist_cfg cn_ocerst_in \"GYREPIS_LONG_${ITRST}_restart\"
229    set_namelist namelist_top_cfg cn_trcrst_in \"GYREPIS_LONG_${ITRST}_restart_trc\"
230    if [ ${USING_XIOS_RRW} == "yes" ]
231       then
232       set_namelist namelist_cfg nn_wxios 1
233       set_namelist namelist_cfg ln_xios_read .true.
234    fi
235    if [ ${USING_MPMD} == "yes" ] ; then
236       set_xio_using_server iodef.xml true
237    else
238       set_xio_using_server iodef.xml false
239    fi
240
241    if [ ${USING_XIOS_RRW} == "yes" ]
242       then
243        ln -sf ../LONG/GYREPIS_LONG_${ITRST}_restart.nc .
244        ln -sf ../LONG/GYREPIS_LONG_${ITRST}_restart_trc.nc .
245    else
246        for (( i=1; i<=$NPROC; i++)) ; do
247            L_NPROC=$(( $i - 1 ))
248            L_NPROC=`printf "%04d\n" ${L_NPROC}`
249            ln -sf ../LONG/GYREPIS_LONG_${ITRST}_restart_${L_NPROC}.nc .
250            ln -sf ../LONG/GYREPIS_LONG_${ITRST}_restart_trc_${L_NPROC}.nc .
251        done
252    fi
253    cd ${SETTE_DIR}
254    . ./prepare_job.sh input_GYRE.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
255    cd ${SETTE_DIR}
256    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
257
258## Reproducibility tests for GYRE_PISCES
259    export TEST_NAME="REPRO_2_4"
260    cd ${MAIN_DIR}
261    cd ${SETTE_DIR}
262    . ./param.cfg
263    . ./all_functions.sh
264    . ./prepare_exe_dir.sh
265    set_valid_dir
266    clean_valid_dir
267    JOB_FILE=${EXE_DIR}/run_job.sh
268    NPROC=8
269    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
270    cd ${EXE_DIR}
271    set_namelist namelist_cfg cn_exp \"GYREPIS_48\"
272    set_namelist namelist_cfg nn_it000 1
273    set_namelist namelist_cfg nn_itend ${ITEND}
274    set_namelist namelist_cfg ln_linssh .true.
275    set_namelist namelist_cfg jpni 2
276    set_namelist namelist_cfg jpnj 4
277    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
278    set_namelist namelist_cfg sn_cfctl%l_trcstat .true.
279    if [ ${USING_XIOS_RRW} == "yes" ]
280       then
281       set_namelist namelist_cfg nn_wxios 1
282    fi
283    if [ ${USING_MPMD} == "yes" ] ; then
284       set_xio_using_server iodef.xml true
285    else
286       set_xio_using_server iodef.xml false
287    fi
288    cd ${SETTE_DIR}
289    . ./prepare_job.sh input_GYRE.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
290    cd ${SETTE_DIR}
291    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
292
293    cd ${SETTE_DIR}
294    export TEST_NAME="REPRO_4_2"
295    . ./prepare_exe_dir.sh
296    set_valid_dir
297    clean_valid_dir
298    JOB_FILE=${EXE_DIR}/run_job.sh
299    NPROC=8
300    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
301    cd ${EXE_DIR}
302    set_namelist namelist_cfg cn_exp \"GYREPIS_84\"
303    set_namelist namelist_cfg nn_it000 1
304    set_namelist namelist_cfg nn_itend ${ITEND}
305    set_namelist namelist_cfg ln_linssh .true.
306    set_namelist namelist_cfg jpni 4
307    set_namelist namelist_cfg jpnj 2
308    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
309    set_namelist namelist_cfg sn_cfctl%l_trcstat .true.
310    if [ ${USING_MPMD} == "yes" ] ; then
311       set_xio_using_server iodef.xml true
312    else
313       set_xio_using_server iodef.xml false
314    fi
315    cd ${SETTE_DIR}
316    . ./prepare_job.sh input_GYRE.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
317    cd ${SETTE_DIR}
318    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
319
320fi
321
322# -----------------
323# ORCA2_ICE_PISCES
324# -----------------
325if [ ${config} == "ORCA2_ICE_PISCES" ] ;  then
326## Restartability tests for ORCA2_ICE_PISCES
327    if [ $( echo ${CMP_NAM} | grep -ic debug ) -eq 1 ]
328    then
329   ITEND=16   # 1 day
330    else
331   ITEND=992  # 62 days
332    fi
333    ITRST=$( printf "%08d" $(( ${ITEND} / 2 )) )
334    export TEST_NAME="LONG"
335    cd ${MAIN_DIR}
336    #
337    # syncronisation if target directory/file exist (not done by makenemo)
338    . ${SETTE_DIR}/all_functions.sh
339    sync_config  ORCA2_ICE_PISCES ORCA2_ICE_PISCES_ST 'cfgs'
340    clean_config ORCA2_ICE_PISCES ORCA2_ICE_PISCES_ST 'cfgs'
341    #
342    . ./makenemo -m ${CMP_NAM} -n ORCA2_ICE_PISCES_ST -r ORCA2_ICE_PISCES -j 8 add_key "${ADD_KEYS}" del_key "${DEL_KEYS}"
343    cd ${SETTE_DIR}
344    . ./param.cfg
345    . ./all_functions.sh
346    . ./prepare_exe_dir.sh
347    set_valid_dir
348    clean_valid_dir
349    JOB_FILE=${EXE_DIR}/run_job.sh
350    NPROC=32
351    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
352    cd ${EXE_DIR}
353    if [ ${USING_XIOS_RRW} == "yes" ]
354       then
355       set_namelist namelist_cfg nn_wxios 1
356    fi
357    set_namelist namelist_cfg cn_exp \"O2L3P_LONG\"
358    set_namelist namelist_cfg nn_it000 1
359    set_namelist namelist_cfg nn_itend ${ITEND}
360    set_namelist namelist_cfg nn_stock $(( ${ITEND} / 2 ))
361    set_namelist namelist_cfg jpni 4
362    set_namelist namelist_cfg jpnj 8
363    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
364    set_namelist namelist_cfg sn_cfctl%l_trcstat .true.
365    set_namelist namelist_cfg ln_use_calving .true.
366    set_namelist namelist_cfg ln_wave .true.
367    set_namelist namelist_cfg ln_cdgw .true.
368    set_namelist namelist_cfg ln_sdw  .true.
369    set_namelist namelist_cfg nn_sdrift 1
370    set_namelist namelist_cfg ln_stcor .true.
371    set_namelist namelist_cfg ln_tauwoc .true.
372    #
373    if [ ${USING_ICEBERGS} == "no" ] ; then set_namelist namelist_cfg ln_icebergs .false. ; fi
374    # for debugging purposes set_namelist namelist_cfg rn_test_box -180.0, 180.0, -90.0, -55.0
375    #
376    set_namelist namelist_ice_cfg ln_icediachk .true.
377    set_namelist namelist_top_cfg ln_trcdta .false.
378    set_namelist namelist_top_cfg ln_trcbc  .false.
379    # put ln_ironsed, ln_hydrofe to false
380    # if not you need input files, and for tests is not necessary
381    set_namelist namelist_pisces_cfg ln_varpar .false.
382    set_namelist namelist_pisces_cfg ln_ironsed .false.
383    set_namelist namelist_pisces_cfg ln_ironice .false.
384    set_namelist namelist_pisces_cfg ln_hydrofe .false.
385    # put ln_pisdmp to false : no restoring to global mean value
386    set_namelist namelist_pisces_cfg ln_pisdmp .false.
387    if [ ${USING_MPMD} == "yes" ] ; then
388       set_xio_using_server iodef.xml true
389    else
390       set_xio_using_server iodef.xml false
391    fi
392    cd ${SETTE_DIR}
393    . ./prepare_job.sh input_ORCA2_ICE_PISCES.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
394   
395    cd ${SETTE_DIR}
396    export TEST_NAME="SHORT"
397    . ./prepare_exe_dir.sh
398    set_valid_dir
399    clean_valid_dir
400    cd ${EXE_DIR}
401    set_namelist namelist_cfg cn_exp \"O2L3P_SHORT\"
402    set_namelist namelist_cfg nn_it000 $(( ${ITEND} / 2 + 1 ))
403    set_namelist namelist_cfg nn_itend ${ITEND}
404    set_namelist namelist_cfg nn_stock $(( ${ITEND} / 2 ))
405    set_namelist namelist_cfg ln_rstart .true.
406    set_namelist namelist_cfg nn_rstctl 2
407    set_namelist namelist_cfg jpni 4
408    set_namelist namelist_cfg jpnj 8
409    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
410    set_namelist namelist_cfg sn_cfctl%l_trcstat .true.
411    set_namelist namelist_cfg nn_test_icebergs -1
412    set_namelist namelist_cfg ln_wave .true.
413    set_namelist namelist_cfg ln_cdgw .true.
414    set_namelist namelist_cfg ln_sdw  .true.
415    set_namelist namelist_cfg nn_sdrift 1
416    set_namelist namelist_cfg ln_stcor .true.
417    set_namelist namelist_cfg ln_tauwoc .true.
418    if [ ${USING_XIOS_RRW} == "yes" ]
419       then
420       set_namelist namelist_cfg nn_wxios 1
421       set_namelist namelist_cfg ln_xios_read .true.
422    fi
423    #
424    if [ ${USING_ICEBERGS} == "no" ] ; then set_namelist namelist_cfg ln_icebergs .false. ; fi
425    # for debugging purposes set_namelist namelist_cfg rn_test_box -180.0, 180.0, -90.0, -55.0
426    #
427    set_namelist namelist_ice_cfg ln_icediachk .true.
428    set_namelist namelist_top_cfg ln_rsttr .true.
429    set_namelist namelist_top_cfg nn_rsttr 2
430    set_namelist namelist_cfg cn_ocerst_in \"O2L3P_LONG_${ITRST}_restart\"
431    set_namelist namelist_cfg cn_icbrst_in \"O2L3P_LONG_${ITRST}_restart_icb\"
432    set_namelist namelist_top_cfg cn_trcrst_in \"O2L3P_LONG_${ITRST}_restart_trc\"
433    set_namelist namelist_ice_cfg cn_icerst_in \"O2L3P_LONG_${ITRST}_restart_ice\"
434    set_namelist namelist_top_cfg ln_trcbc  .false.
435    # put ln_ironsed, ln_hydrofe to false
436    # if not you need input files, and for tests is not necessary
437    set_namelist namelist_pisces_cfg ln_varpar .false.
438    set_namelist namelist_pisces_cfg ln_ironsed .false.
439    set_namelist namelist_pisces_cfg ln_ironice .false.
440    set_namelist namelist_pisces_cfg ln_hydrofe .false.
441    # put ln_pisdmp to false : no restoring to global mean value
442    set_namelist namelist_pisces_cfg ln_pisdmp .false.
443    if [ ${USING_XIOS_RRW} == "yes" ]
444       then
445           ln -sf ../LONG/O2L3P_LONG_${ITRST}_restart.nc .
446           ln -sf ../LONG/O2L3P_LONG_${ITRST}_restart_trc.nc .
447           ln -sf ../LONG/O2L3P_LONG_${ITRST}_restart_ice.nc .
448           if [ ${USING_ICEBERGS} == "yes" ]
449                  then
450                   for (( i=1; i<=$NPROC; i++)) ; do
451                      L_NPROC=$(( $i - 1 ))
452                      L_NPROC=`printf "%04d\n" ${L_NPROC}`
453                      ln -sf ../LONG/O2L3P_LONG_${ITRST}_restart_icb_${L_NPROC}.nc O2L3P_LONG_${ITRST}_restart_icb_${L_NPROC}.nc
454                   done
455           fi
456    else
457        for (( i=1; i<=$NPROC; i++)) ; do
458           L_NPROC=$(( $i - 1 ))
459           L_NPROC=`printf "%04d\n" ${L_NPROC}`
460           ln -sf ../LONG/O2L3P_LONG_${ITRST}_restart_${L_NPROC}.nc .
461           ln -sf ../LONG/O2L3P_LONG_${ITRST}_restart_trc_${L_NPROC}.nc .
462           ln -sf ../LONG/O2L3P_LONG_${ITRST}_restart_ice_${L_NPROC}.nc .
463           if [ ${USING_ICEBERGS} == "yes" ]
464               then
465                ln -sf ../LONG/O2L3P_LONG_${ITRST}_restart_icb_${L_NPROC}.nc O2L3P_LONG_${ITRST}_restart_icb_${L_NPROC}.nc
466           fi
467       done
468    fi
469    if [ ${USING_MPMD} == "yes" ] ; then
470       set_xio_using_server iodef.xml true
471    else
472       set_xio_using_server iodef.xml false
473    fi
474    cd ${SETTE_DIR}
475    . ./prepare_job.sh input_ORCA2_ICE_PISCES.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
476    cd ${SETTE_DIR}
477    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
478
479## Reproducibility tests for ORCA2_ICE_PISCES
480    export TEST_NAME="REPRO_4_8"
481    cd ${MAIN_DIR}
482    cd ${SETTE_DIR}
483    . ./param.cfg
484    . ./all_functions.sh
485    . ./prepare_exe_dir.sh
486    set_valid_dir
487    clean_valid_dir
488    JOB_FILE=${EXE_DIR}/run_job.sh
489    NPROC=32
490    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
491    cd ${EXE_DIR}
492    set_namelist namelist_cfg cn_exp \"O2L3P_48\"
493    set_namelist namelist_cfg nn_it000 1
494    set_namelist namelist_cfg nn_itend ${ITEND}
495    set_namelist namelist_cfg jpni 4
496    set_namelist namelist_cfg jpnj 8
497    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
498    set_namelist namelist_cfg sn_cfctl%l_trcstat .true.
499    set_namelist namelist_cfg ln_wave .true.
500    set_namelist namelist_cfg ln_cdgw .true.
501    set_namelist namelist_cfg ln_sdw  .true.
502    set_namelist namelist_cfg nn_sdrift 1
503    set_namelist namelist_cfg ln_stcor .true.
504    set_namelist namelist_cfg ln_tauwoc .true.
505
506    if [ ${USING_ICEBERGS} == "no" ] ; then set_namelist namelist_cfg ln_icebergs .false. ; fi
507    # for debugging purposes set_namelist namelist_cfg rn_test_box -180.0, 180.0, -90.0, -55.0
508
509    set_namelist namelist_top_cfg ln_trcdta .false.
510    set_namelist namelist_top_cfg ln_trcbc  .false.
511    # put ln_ironsed, ln_hydrofe to false
512    # if not you need input files, and for tests is not necessary
513    set_namelist namelist_pisces_cfg ln_varpar .false.
514    set_namelist namelist_pisces_cfg ln_ironsed .false.
515    set_namelist namelist_pisces_cfg ln_ironice .false.
516    set_namelist namelist_pisces_cfg ln_hydrofe .false.
517    # put ln_pisdmp to false : no restoring to global mean value
518    set_namelist namelist_pisces_cfg ln_pisdmp .false.
519    if [ ${USING_MPMD} == "yes" ] ; then
520       set_xio_using_server iodef.xml true
521    else
522       set_xio_using_server iodef.xml false
523    fi
524    cd ${SETTE_DIR}
525    . ./prepare_job.sh input_ORCA2_ICE_PISCES.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
526    cd ${SETTE_DIR}
527    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
528
529    cd ${SETTE_DIR}
530    export TEST_NAME="REPRO_8_4"
531    . ./prepare_exe_dir.sh
532    set_valid_dir
533    clean_valid_dir
534    JOB_FILE=${EXE_DIR}/run_job.sh
535    NPROC=32
536    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
537    cd ${EXE_DIR}
538    set_namelist namelist_cfg cn_exp \"O2L3P_84\"
539    set_namelist namelist_cfg nn_it000 1
540    set_namelist namelist_cfg nn_itend ${ITEND}
541    set_namelist namelist_cfg jpni 8
542    set_namelist namelist_cfg jpnj 4
543    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
544    set_namelist namelist_cfg sn_cfctl%l_trcstat .true.
545    set_namelist namelist_cfg ln_wave .true.
546    set_namelist namelist_cfg ln_cdgw .true.
547    set_namelist namelist_cfg ln_sdw  .true.
548    set_namelist namelist_cfg nn_sdrift 1
549    set_namelist namelist_cfg ln_stcor .true.
550    set_namelist namelist_cfg ln_tauwoc .true.
551
552    if [ ${USING_ICEBERGS} == "no" ] ; then set_namelist namelist_cfg ln_icebergs .false. ; fi
553    # for debugging purposes set_namelist namelist_cfg rn_test_box -180.0, 180.0, -90.0, -55.0
554
555    set_namelist namelist_top_cfg ln_trcdta .false.
556    set_namelist namelist_top_cfg ln_trcbc  .false.
557    # put ln_ironsed, ln_hydrofe to false
558    # if not you need input files, and for tests is not necessary
559    set_namelist namelist_pisces_cfg ln_varpar .false.
560    set_namelist namelist_pisces_cfg ln_ironsed .false.
561    set_namelist namelist_pisces_cfg ln_ironice .false.
562    set_namelist namelist_pisces_cfg ln_hydrofe .false.
563    if [ ${USING_XIOS_RRW} == "yes" ]
564       then
565       set_namelist namelist_cfg nn_wxios 1
566    fi
567    # put ln_pisdmp to false : no restoring to global mean value
568    set_namelist namelist_pisces_cfg ln_pisdmp .false.
569    if [ ${USING_MPMD} == "yes" ] ; then
570       set_xio_using_server iodef.xml true
571    else
572       set_xio_using_server iodef.xml false
573    fi
574    cd ${SETTE_DIR}
575    . ./prepare_job.sh input_ORCA2_ICE_PISCES.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
576    cd ${SETTE_DIR}
577    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
578fi
579
580# ----------------
581# ORCA2_OFF_PISCES
582# ----------------
583if [ ${config} == "ORCA2_OFF_PISCES" ] ;  then
584## Restartability tests for ORCA2_OFF_PISCES
585    if [ $( echo ${CMP_NAM} | grep -ic debug ) -eq 1 ]
586    then
587   ITEND=16   # 4 days
588    else
589   ITEND=380  # 95 days
590    fi
591    ITRST=$( printf "%08d" $(( ${ITEND} / 2 )) )
592    export TEST_NAME="LONG"
593    cd ${MAIN_DIR}
594    #
595    # syncronisation if target directory/file exist (not done by makenemo)
596    . ${SETTE_DIR}/all_functions.sh
597    sync_config  ORCA2_OFF_PISCES ORCA2_OFF_PISCES_ST 'cfgs'
598    clean_config ORCA2_OFF_PISCES ORCA2_OFF_PISCES_ST 'cfgs'
599    #
600    . ./makenemo -m ${CMP_NAM} -n ORCA2_OFF_PISCES_ST -r ORCA2_OFF_PISCES -j 8 add_key "${ADD_KEYS}" del_key "${DEL_KEYS}"
601    cd ${SETTE_DIR}
602    . ./param.cfg
603    . ./all_functions.sh
604    . ./prepare_exe_dir.sh
605    set_valid_dir
606    clean_valid_dir
607    JOB_FILE=${EXE_DIR}/run_job.sh
608    NPROC=32
609    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
610    cd ${EXE_DIR}
611    set_namelist namelist_cfg cn_exp \"OFFP_LONG\"
612    set_namelist namelist_cfg nn_it000 1
613    set_namelist namelist_cfg nn_itend ${ITEND}
614    set_namelist namelist_cfg nn_stock $(( ${ITEND} / 2 ))
615    set_namelist namelist_cfg jpni 4
616    set_namelist namelist_cfg jpnj 8
617    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
618    set_namelist namelist_cfg sn_cfctl%l_trcstat .true.
619    set_namelist namelist_cfg ln_qsr_rgb .true.
620    set_namelist namelist_top_cfg ln_trcdta .false.
621    set_namelist namelist_top_cfg ln_trcbc  .false.
622    # put ln_ironsed, ln_hydrofe to false
623    # if not you need input files, and for tests is not necessary
624    set_namelist namelist_pisces_cfg ln_varpar .false.
625    set_namelist namelist_pisces_cfg ln_ironsed .false.
626    set_namelist namelist_pisces_cfg ln_ironice .false.
627    set_namelist namelist_pisces_cfg ln_hydrofe .false.
628    # put ln_pisdmp to false : no restoring to global mean value
629    set_namelist namelist_pisces_cfg ln_pisdmp .false.
630    if [ ${USING_XIOS_RRW} == "yes" ]
631       then
632       set_namelist namelist_cfg nn_wxios 1
633    fi
634    if [ ${USING_MPMD} == "yes" ] ; then
635       set_xio_using_server iodef.xml true
636    else
637       set_xio_using_server iodef.xml false
638    fi
639    cd ${SETTE_DIR}
640    . ./prepare_job.sh input_ORCA2_OFF_PISCES.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
641   
642    cd ${SETTE_DIR}
643    export TEST_NAME="SHORT"
644    . ./prepare_exe_dir.sh
645    set_valid_dir
646    clean_valid_dir
647    cd ${EXE_DIR}
648    set_namelist namelist_cfg cn_exp \"OFFP_SHORT\"
649    set_namelist namelist_cfg nn_it000 $(( ${ITEND} / 2 + 1 ))
650    set_namelist namelist_cfg nn_itend ${ITEND}
651    set_namelist namelist_cfg nn_stock $(( ${ITEND} / 2 ))
652    set_namelist namelist_cfg jpni 4
653    set_namelist namelist_cfg jpnj 8
654    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
655    set_namelist namelist_cfg sn_cfctl%l_trcstat .true.
656    set_namelist namelist_cfg ln_qsr_rgb .true.
657    set_namelist namelist_top_cfg ln_rsttr .true.
658    set_namelist namelist_top_cfg nn_rsttr 2
659    set_namelist namelist_top_cfg cn_trcrst_in \"OFFP_LONG_${ITRST}_restart_trc\"
660    if [ ${USING_XIOS_RRW} == "yes" ]
661       then
662       set_namelist namelist_cfg nn_wxios 1
663       set_namelist namelist_cfg ln_xios_read .true.
664    fi
665    if [ ${USING_XIOS_RRW} == "yes" ]
666       then
667        ln -sf ../LONG/OFFP_LONG_${ITRST}_restart_trc.nc .
668    else
669        for (( i=1; i<=$NPROC; i++)) ; do
670            L_NPROC=$(( $i - 1 ))
671            L_NPROC=`printf "%04d\n" ${L_NPROC}`
672            ln -sf ../LONG/OFFP_LONG_${ITRST}_restart_trc_${L_NPROC}.nc .
673        done
674    fi
675    set_namelist namelist_top_cfg ln_trcbc  .false.
676    # put ln_ironsed, ln_hydrofe to false
677    # if not you need input files, and for tests is not necessary
678    set_namelist namelist_pisces_cfg ln_varpar .false.
679    set_namelist namelist_pisces_cfg ln_ironsed .false.
680    set_namelist namelist_pisces_cfg ln_ironice .false.
681    set_namelist namelist_pisces_cfg ln_hydrofe .false.
682    # put ln_pisdmp to false : no restoring to global mean value
683    set_namelist namelist_pisces_cfg ln_pisdmp .false.
684    if [ ${USING_MPMD} == "yes" ] ; then
685       set_xio_using_server iodef.xml true
686    else
687       set_xio_using_server iodef.xml false
688    fi
689    cd ${SETTE_DIR}
690    . ./prepare_job.sh input_ORCA2_OFF_PISCES.cfg $NPROC ${TEST_NAME}  ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
691    cd ${SETTE_DIR}
692    . ./fcm_job.sh $NPROC  ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
693
694## Reproducibility tests for ORCA2_OFF_PISCES
695    export TEST_NAME="REPRO_4_8"
696    cd ${MAIN_DIR}
697    cd ${SETTE_DIR}
698    . ./param.cfg
699    . ./all_functions.sh
700    . ./prepare_exe_dir.sh
701    set_valid_dir
702    clean_valid_dir
703    JOB_FILE=${EXE_DIR}/run_job.sh
704    NPROC=32
705    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
706    cd ${EXE_DIR}
707    set_namelist namelist_cfg cn_exp \"OFFP_48\"
708    set_namelist namelist_cfg nn_it000 1
709    set_namelist namelist_cfg nn_itend ${ITEND}
710    set_namelist namelist_cfg jpni 4
711    set_namelist namelist_cfg jpnj 8
712    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
713    set_namelist namelist_cfg sn_cfctl%l_trcstat .true.
714    set_namelist namelist_cfg ln_qsr_rgb .true.
715    set_namelist namelist_top_cfg ln_trcdta .false.
716    set_namelist namelist_top_cfg ln_trcbc  .false.
717    # put ln_ironsed, ln_hydrofe to false
718    # if not you need input files, and for tests is not necessary
719    set_namelist namelist_pisces_cfg ln_varpar .false.
720    set_namelist namelist_pisces_cfg ln_ironsed .false.
721    set_namelist namelist_pisces_cfg ln_ironice .false.
722    set_namelist namelist_pisces_cfg ln_hydrofe .false.
723    # put ln_pisdmp to false : no restoring to global mean value
724    set_namelist namelist_pisces_cfg ln_pisdmp .false.
725    if [ ${USING_XIOS_RRW} == "yes" ]
726       then
727       set_namelist namelist_cfg nn_wxios 1
728    fi
729    if [ ${USING_MPMD} == "yes" ] ; then
730       set_xio_using_server iodef.xml true
731    else
732       set_xio_using_server iodef.xml false
733    fi
734    cd ${SETTE_DIR}
735    . ./prepare_job.sh input_ORCA2_OFF_PISCES.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
736    cd ${SETTE_DIR}
737    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
738
739    cd ${SETTE_DIR}
740    export TEST_NAME="REPRO_8_4"
741    . ./prepare_exe_dir.sh
742    set_valid_dir
743    clean_valid_dir
744    JOB_FILE=${EXE_DIR}/run_job.sh
745    NPROC=32
746    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
747    cd ${EXE_DIR}
748    set_namelist namelist_cfg cn_exp \"OFFP_84\"
749    set_namelist namelist_cfg nn_it000 1
750    set_namelist namelist_cfg nn_itend ${ITEND}
751    set_namelist namelist_cfg jpni 8
752    set_namelist namelist_cfg jpnj 4
753    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
754    set_namelist namelist_cfg sn_cfctl%l_trcstat .true.
755    set_namelist namelist_cfg ln_qsr_rgb .true.
756    set_namelist namelist_top_cfg ln_trcdta .false.
757    set_namelist namelist_top_cfg ln_trcbc  .false.
758    # put ln_ironsed, ln_hydrofe to false
759    # if not you need input files, and for tests is not necessary
760    set_namelist namelist_pisces_cfg ln_varpar .false.
761    set_namelist namelist_pisces_cfg ln_ironsed .false.
762    set_namelist namelist_pisces_cfg ln_ironice .false.
763    set_namelist namelist_pisces_cfg ln_hydrofe .false.
764    # put ln_pisdmp to false : no restoring to global mean value
765    set_namelist namelist_pisces_cfg ln_pisdmp .false.
766    if [ ${USING_MPMD} == "yes" ] ; then
767       set_xio_using_server iodef.xml true
768    else
769       set_xio_using_server iodef.xml false
770    fi
771    cd ${SETTE_DIR}
772    . ./prepare_job.sh input_ORCA2_OFF_PISCES.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
773    cd ${SETTE_DIR}
774    . ./fcm_job.sh $NPROC  ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
775fi
776
777# -----
778# AMM12
779# -----
780if [ ${config} == "AMM12" ] ;  then
781    ## Restartability tests for AMM12
782    if [ $( echo ${CMP_NAM} | grep -ic debug ) -eq 1 ]
783    then
784   ITEND=12   # 3 h
785    else
786   ITEND=576  # 4 days
787    fi
788    ITRST=$( printf "%08d" $(( ${ITEND} / 2 )) )
789    export TEST_NAME="LONG"
790    cd ${MAIN_DIR}
791    #
792    # syncronisation if target directory/file exist (not done by makenemo)
793    . ${SETTE_DIR}/all_functions.sh
794    sync_config  AMM12 AMM12_ST 'cfgs'
795    clean_config AMM12 AMM12_ST 'cfgs'
796    #
797    . ./makenemo -m ${CMP_NAM} -n AMM12_ST -r AMM12 -j 8 add_key "${ADD_KEYS}" del_key "${DEL_KEYS}"
798    cd ${SETTE_DIR}
799    . ./param.cfg
800    . ./all_functions.sh
801    . ./prepare_exe_dir.sh
802    set_valid_dir
803    clean_valid_dir
804    JOB_FILE=${EXE_DIR}/run_job.sh
805    NPROC=32
806    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
807    cd ${EXE_DIR}
808    set_namelist namelist_cfg cn_exp \"AMM12_LONG\"
809    set_namelist namelist_cfg nn_it000 1
810    set_namelist namelist_cfg nn_itend ${ITEND}
811    set_namelist namelist_cfg nn_stock $(( ${ITEND} / 2 ))
812    set_namelist namelist_cfg jpni 4
813    set_namelist namelist_cfg jpnj 8
814    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
815    if [ ${USING_XIOS_RRW} == "yes" ]
816       then
817       set_namelist namelist_cfg nn_wxios 1
818    fi
819    if [ ${USING_MPMD} == "yes" ] ; then
820       set_xio_using_server iodef.xml true
821    else
822       set_xio_using_server iodef.xml false
823    fi
824    cd ${SETTE_DIR}
825    . ./prepare_job.sh input_AMM12.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
826
827    cd ${SETTE_DIR}
828    export TEST_NAME="SHORT"
829    . ./prepare_exe_dir.sh
830    set_valid_dir
831    clean_valid_dir
832    cd ${EXE_DIR}
833    set_namelist namelist_cfg cn_exp \"AMM12_SHORT\"
834    set_namelist namelist_cfg nn_it000 $(( ${ITEND} / 2 + 1 ))
835    set_namelist namelist_cfg nn_itend ${ITEND}
836    set_namelist namelist_cfg nn_stock $(( ${ITEND} / 2 ))
837    set_namelist namelist_cfg jpni 4
838    set_namelist namelist_cfg jpnj 8
839    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
840    set_namelist namelist_cfg ln_rstart .true.
841    set_namelist namelist_cfg nn_rstctl 2
842    set_namelist namelist_cfg cn_ocerst_in \"AMM12_LONG_${ITRST}_restart\"
843    set_namelist namelist_cfg nn_date0 20120102
844    if [ ${USING_XIOS_RRW} == "yes" ]
845       then
846       set_namelist namelist_cfg nn_wxios 1
847       set_namelist namelist_cfg ln_xios_read .true.
848    fi
849    if [ ${USING_XIOS_RRW} == "yes" ]
850       then
851        ln -sf ../LONG/AMM12_LONG_${ITRST}_restart.nc .
852    else
853        for (( i=1; i<=$NPROC; i++)) ; do
854            L_NPROC=$(( $i - 1 ))
855            L_NPROC=`printf "%04d\n" ${L_NPROC}`
856            ln -sf ../LONG/AMM12_LONG_${ITRST}_restart_${L_NPROC}.nc .
857        done
858    fi
859    if [ ${USING_MPMD} == "yes" ] ; then
860       set_xio_using_server iodef.xml true
861    else
862       set_xio_using_server iodef.xml false
863    fi
864    cd ${SETTE_DIR}
865    . ./prepare_job.sh input_AMM12.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
866    cd ${SETTE_DIR}
867    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
868
869## Reproducibility tests for AMM12
870    export TEST_NAME="REPRO_8_4"
871    cd ${MAIN_DIR}
872    cd ${SETTE_DIR}
873    . ./param.cfg
874    . ./all_functions.sh
875    . ./prepare_exe_dir.sh
876    set_valid_dir
877    clean_valid_dir
878    JOB_FILE=${EXE_DIR}/run_job.sh
879    NPROC=32
880    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
881    cd ${EXE_DIR}
882    set_namelist namelist_cfg cn_exp \"AMM12_84\"
883    set_namelist namelist_cfg nn_it000 1
884    set_namelist namelist_cfg nn_itend ${ITEND}
885    set_namelist namelist_cfg jpni 8
886    set_namelist namelist_cfg jpnj 4
887    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
888    if [ ${USING_XIOS_RRW} == "yes" ]
889       then
890       set_namelist namelist_cfg nn_wxios 1
891    fi
892    if [ ${USING_MPMD} == "yes" ] ; then
893       set_xio_using_server iodef.xml true
894    else
895       set_xio_using_server iodef.xml false
896    fi
897    cd ${SETTE_DIR}
898    . ./prepare_job.sh input_AMM12.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
899    cd ${SETTE_DIR}
900    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
901
902    cd ${SETTE_DIR}
903    export TEST_NAME="REPRO_4_8"
904    . ./prepare_exe_dir.sh
905    set_valid_dir
906    clean_valid_dir
907    JOB_FILE=${EXE_DIR}/run_job.sh
908    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
909    cd ${EXE_DIR}
910    set_namelist namelist_cfg cn_exp \"AMM12_48\"
911    set_namelist namelist_cfg nn_it000 1
912    set_namelist namelist_cfg nn_itend ${ITEND}
913    set_namelist namelist_cfg jpni 4
914    set_namelist namelist_cfg jpnj 8
915    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
916    if [ ${USING_MPMD} == "yes" ] ; then
917       set_xio_using_server iodef.xml true
918    else
919       set_xio_using_server iodef.xml false
920    fi
921    cd ${SETTE_DIR}
922    . ./prepare_job.sh input_AMM12.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
923    cd ${SETTE_DIR}
924    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
925fi
926
927
928# ---------
929# ORCA2_SAS
930# ---------
931if [ ${config} == "SAS" ] ;  then
932## Restartability tests
933    if [ $( echo ${CMP_NAM} | grep -ic debug ) -eq 1 ]
934    then
935   ITEND=16   # 1 day
936    else
937   ITEND=256  # 16 days
938    fi
939    ITRST=$( printf "%08d" $(( ${ITEND} / 2 )) )
940    export TEST_NAME="LONG"
941    cd ${MAIN_DIR}
942    #
943    # syncronisation if target directory/file exist (not done by makenemo)
944    . ${SETTE_DIR}/all_functions.sh
945    sync_config  ORCA2_SAS_ICE ORCA2_SAS_ICE_ST 'cfgs'
946    clean_config ORCA2_SAS_ICE ORCA2_SAS_ICE_ST 'cfgs'
947    #
948    . ./makenemo -m ${CMP_NAM} -n ORCA2_SAS_ICE_ST -r ORCA2_SAS_ICE -j 8 add_key "${ADD_KEYS}" del_key "${DEL_KEYS}"
949    cd ${SETTE_DIR}
950    . ./param.cfg
951    . ./all_functions.sh
952    . ./prepare_exe_dir.sh
953    set_valid_dir
954    clean_valid_dir
955    JOB_FILE=${EXE_DIR}/run_job.sh
956    NPROC=32
957    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
958    cd ${EXE_DIR}
959    set_namelist namelist_cfg cn_exp \"SAS\"
960    set_namelist namelist_cfg nn_it000 1
961    set_namelist namelist_cfg nn_itend ${ITEND}
962    set_namelist namelist_cfg nn_stock $(( ${ITEND} / 2 ))
963    set_namelist namelist_cfg jpni 4
964    set_namelist namelist_cfg jpnj 8
965    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
966    set_namelist namelist_ice_cfg ln_icediachk .true.
967    if [ ${USING_XIOS_RRW} == "yes" ]
968       then
969       set_namelist namelist_cfg nn_wxios 1
970    fi
971    if [ ${USING_MPMD} == "yes" ] ; then
972       set_xio_using_server iodef.xml true
973    else
974       set_xio_using_server iodef.xml false
975    fi
976    cd ${SETTE_DIR}
977    . ./prepare_job.sh input_SAS.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
978
979    cd ${SETTE_DIR}
980    export TEST_NAME="SHORT"
981    . ./prepare_exe_dir.sh
982    set_valid_dir
983    clean_valid_dir
984    cd ${EXE_DIR}
985    set_namelist namelist_cfg cn_exp \"SAS\"
986    set_namelist namelist_cfg nn_it000 $(( ${ITEND} / 2 + 1 ))
987    set_namelist namelist_cfg nn_itend ${ITEND}
988    set_namelist namelist_cfg nn_stock $(( ${ITEND} / 2 ))
989    set_namelist namelist_cfg jpni 4
990    set_namelist namelist_cfg jpnj 8
991    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
992    set_namelist namelist_cfg ln_rstart .true.
993    set_namelist namelist_cfg nn_rstctl 2
994    set_namelist namelist_cfg nn_date0 010109
995    set_namelist namelist_cfg cn_ocerst_in \"SAS_${ITRST}_restart\"
996    set_namelist namelist_ice_cfg cn_icerst_in \"SAS_${ITRST}_restart_ice\"
997    if [ ${USING_MPMD} == "yes" ] ; then
998       set_xio_using_server iodef.xml true
999    else
1000       set_xio_using_server iodef.xml false
1001    fi
1002    if [ ${USING_XIOS_RRW} == "yes" ]
1003       then
1004       set_namelist namelist_cfg nn_wxios 1
1005       set_namelist namelist_cfg ln_xios_read .true.
1006    fi
1007    if [ ${USING_XIOS_RRW} == "yes" ]
1008       then
1009        ln -sf ../LONG/SAS_${ITRST}_restart.nc .
1010        ln -sf ../LONG/SAS_${ITRST}_restart_ice.nc .
1011    else
1012        for (( i=1; i<=$NPROC; i++)) ; do
1013            L_NPROC=$(( $i - 1 ))
1014            L_NPROC=`printf "%04d\n" ${L_NPROC}`
1015            ln -sf ../LONG/SAS_${ITRST}_restart_${L_NPROC}.nc .
1016            ln -sf ../LONG/SAS_${ITRST}_restart_ice_${L_NPROC}.nc .
1017        done
1018    fi
1019    cd ${SETTE_DIR}
1020    . ./prepare_job.sh input_SAS.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
1021    cd ${SETTE_DIR}
1022    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
1023
1024## Reproducibility tests
1025    if [ $( echo ${CMP_NAM} | grep -ic debug ) -eq 1 ]
1026    then
1027   ITEND=16  # 1 day
1028    else
1029   ITEND=80  # 5 days
1030    fi
1031    export TEST_NAME="REPRO_4_8"
1032    cd ${MAIN_DIR}
1033    cd ${SETTE_DIR}
1034    . ./param.cfg
1035    . ./all_functions.sh
1036    . ./prepare_exe_dir.sh
1037    set_valid_dir
1038    clean_valid_dir
1039    JOB_FILE=${EXE_DIR}/run_job.sh
1040    NPROC=32
1041    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
1042    cd ${EXE_DIR}
1043    set_namelist namelist_cfg cn_exp \"SAS_48\"
1044    set_namelist namelist_cfg nn_it000 1
1045    set_namelist namelist_cfg nn_itend ${ITEND}
1046    set_namelist namelist_cfg jpni 4
1047    set_namelist namelist_cfg jpnj 8
1048    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
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_SAS.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 \"SAS_84\"
1069    set_namelist namelist_cfg nn_it000 1
1070    set_namelist namelist_cfg nn_itend ${ITEND}
1071    set_namelist namelist_cfg jpni 8
1072    set_namelist namelist_cfg jpnj 4
1073    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
1074    if [ ${USING_XIOS_RRW} == "yes" ]
1075       then
1076       set_namelist namelist_cfg nn_wxios 1
1077    fi
1078    if [ ${USING_MPMD} == "yes" ] ; then
1079       set_xio_using_server iodef.xml true
1080    else
1081       set_xio_using_server iodef.xml false
1082    fi
1083    cd ${SETTE_DIR}
1084    . ./prepare_job.sh input_SAS.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
1085    cd ${SETTE_DIR}
1086    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
1087
1088fi
1089
1090
1091# --------------
1092# ORCA2_ICE_OBS
1093# --------------
1094## Test assimilation interface code, OBS and ASM for reproducibility
1095## Restartability not tested (ASM code not restartable while increments are being applied)
1096if [ ${config} == "ORCA2_ICE_OBS" ] ; then
1097## Reproducibility tests
1098    if [ $( echo ${CMP_NAM} | grep -ic debug ) -eq 1 ]
1099    then
1100   ITEND=16  # 1 day
1101    else
1102   ITEND=80  # 5 days
1103    fi
1104    export TEST_NAME="REPRO_4_8"
1105    cd ${MAIN_DIR}
1106    #
1107    # syncronisation if target directory/file exist (not done by makenemo)
1108    . ${SETTE_DIR}/all_functions.sh
1109    sync_config  ORCA2_ICE_PISCES ORCA2_ICE_OBS_ST 'cfgs'
1110    clean_config ORCA2_ICE_PISCES ORCA2_ICE_OBS_ST 'cfgs'
1111    #
1112    . ./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}"
1113    cd ${SETTE_DIR}
1114    . ./param.cfg
1115    . ./all_functions.sh
1116    . ./prepare_exe_dir.sh
1117    set_valid_dir
1118    clean_valid_dir
1119    JOB_FILE=${EXE_DIR}/run_job.sh
1120    NPROC=32
1121    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
1122    cd ${EXE_DIR}
1123    set_namelist namelist_cfg cn_exp \"O2L3OBS_48\"
1124    set_namelist namelist_cfg nn_it000 1
1125    set_namelist namelist_cfg nn_itend ${ITEND}
1126    set_namelist namelist_cfg ln_read_cfg .true.
1127    set_namelist namelist_cfg jpni 4
1128    set_namelist namelist_cfg jpnj 8
1129    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
1130    set_namelist namelist_cfg sn_cfctl%l_trcstat .true.
1131    set_namelist namelist_cfg ln_diaobs .true.
1132    set_namelist namelist_cfg ln_t3d .true.
1133    set_namelist namelist_cfg ln_s3d .true.
1134    set_namelist namelist_cfg ln_sst .true.
1135    set_namelist namelist_cfg ln_sla .true.
1136    set_namelist namelist_cfg ln_sic .true.
1137    set_namelist namelist_cfg ln_vel3d .true.
1138    set_namelist namelist_cfg ln_bkgwri .true.
1139    set_namelist namelist_cfg ln_trainc .true.
1140    set_namelist namelist_cfg ln_dyninc .true.
1141    set_namelist namelist_cfg ln_sshinc .true.
1142    set_namelist namelist_cfg ln_asmiau .true.
1143    #remove all useless options for pisces (due to ORCA2_ICE_PISCES reference configuration)
1144    set_namelist namelist_top_cfg ln_trcdta .false.
1145    set_namelist namelist_top_cfg ln_trcbc  .false.
1146    # put ln_ironsed, ln_river, ln_ndepo, ln_dust to false
1147    # if not you need input files, and for tests is not necessary
1148    set_namelist namelist_pisces_cfg ln_varpar .false.
1149    set_namelist namelist_pisces_cfg ln_ironsed .false.
1150    set_namelist namelist_pisces_cfg ln_ironice .false.
1151    set_namelist namelist_pisces_cfg ln_hydrofe .false.
1152    if [ ${USING_MPMD} == "yes" ] ; then
1153       set_xio_using_server iodef.xml true
1154    else
1155       set_xio_using_server iodef.xml false
1156    fi
1157    cd ${SETTE_DIR}
1158    . ./prepare_job.sh input_ORCA2_ICE_OBS.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
1159    cd ${SETTE_DIR}
1160    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
1161
1162   cd ${SETTE_DIR}
1163    export TEST_NAME="REPRO_8_4"
1164    . ./prepare_exe_dir.sh
1165    set_valid_dir
1166    clean_valid_dir
1167    JOB_FILE=${EXE_DIR}/run_job.sh
1168    NPROC=32
1169    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
1170    cd ${EXE_DIR}
1171    set_namelist namelist_cfg cn_exp \"O2L3OBS_84\"
1172    set_namelist namelist_cfg nn_it000 1
1173    set_namelist namelist_cfg nn_itend ${ITEND}
1174    set_namelist namelist_cfg ln_read_cfg .true.
1175    set_namelist namelist_cfg jpni 8
1176    set_namelist namelist_cfg jpnj 4
1177    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
1178    set_namelist namelist_cfg sn_cfctl%l_trcstat .true.
1179    set_namelist namelist_cfg ln_diaobs .true.
1180    set_namelist namelist_cfg ln_t3d .true.
1181    set_namelist namelist_cfg ln_s3d .true.
1182    set_namelist namelist_cfg ln_sst .true.
1183    set_namelist namelist_cfg ln_sla .true.
1184    set_namelist namelist_cfg ln_sic .true.
1185    set_namelist namelist_cfg ln_vel3d .true.
1186    set_namelist namelist_cfg ln_bkgwri .true.
1187    set_namelist namelist_cfg ln_trainc .true.
1188    set_namelist namelist_cfg ln_dyninc .true.
1189    set_namelist namelist_cfg ln_sshinc .true.
1190    set_namelist namelist_cfg ln_asmiau .true.
1191    #remove all useless options for pisces (due to ORCA2_ICE_PISCES reference configuration)
1192    set_namelist namelist_top_cfg ln_trcdta .false.
1193    set_namelist namelist_top_cfg ln_trcbc  .false.
1194    # put ln_ironsed, ln_river, ln_ndepo, ln_dust to false
1195    # if not you need input files, and for tests is not necessary
1196    set_namelist namelist_pisces_cfg ln_varpar .false.
1197    set_namelist namelist_pisces_cfg ln_ironsed .false.
1198    set_namelist namelist_pisces_cfg ln_ironice .false.
1199    set_namelist namelist_pisces_cfg ln_hydrofe .false.
1200    if [ ${USING_XIOS_RRW} == "yes" ]
1201       then
1202       set_namelist namelist_cfg nn_wxios 1
1203    fi
1204    if [ ${USING_MPMD} == "yes" ] ; then
1205       set_xio_using_server iodef.xml true
1206    else
1207       set_xio_using_server iodef.xml false
1208    fi
1209    cd ${SETTE_DIR}
1210    . ./prepare_job.sh input_ORCA2_ICE_OBS.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
1211    cd ${SETTE_DIR}
1212    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
1213fi
1214
1215# ------------
1216# AGRIF ICE
1217# -----------
1218if [ ${config} == "AGRIF" ] ;  then
1219## Restartability tests
1220    if [ $( echo ${CMP_NAM} | grep -ic debug ) -eq 1 ]
1221    then
1222   ITEND=4   # 6h
1223    else
1224   ITEND=20  # 1d and 6h
1225    fi
1226    ITRST=$(   printf "%08d" $(( ${ITEND} / 2 )) )
1227    ITRST_1=$( printf "%08d" $(( ${ITEND} / 2 )) )
1228    ITRST_2=$( printf "%08d" $(( ${ITEND} * 4 / 2 )) )
1229    ITRST_3=$( printf "%08d" $(( ${ITEND} * 4 * 3 / 2 )) )
1230    export TEST_NAME="LONG"
1231    cd ${MAIN_DIR}
1232    #
1233    # syncronisation if target directory/file exist (not done by makenemo)
1234    . ${SETTE_DIR}/all_functions.sh
1235    sync_config  AGRIF_DEMO AGRIF_DEMO_ST 'cfgs'
1236    clean_config AGRIF_DEMO AGRIF_DEMO_ST 'cfgs'
1237    #
1238    . ./makenemo -m ${CMP_NAM} -n AGRIF_DEMO_ST -r AGRIF_DEMO -j 8 add_key "${ADD_KEYS}" del_key "${DEL_KEYS}"
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_LONG\"
1250    set_namelist namelist_cfg nn_it000 1
1251    set_namelist namelist_cfg nn_itend ${ITEND}
1252    set_namelist namelist_cfg nn_stock $(( ${ITEND} / 2 ))
1253    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
1254    set_namelist 1_namelist_cfg cn_exp \"AGRIF_LONG\"
1255    set_namelist 1_namelist_cfg nn_it000 1
1256    set_namelist 1_namelist_cfg nn_itend ${ITEND}
1257    set_namelist 1_namelist_cfg nn_stock $(( ${ITEND} / 2 ))
1258    set_namelist 1_namelist_cfg sn_cfctl%l_runstat .true.
1259    set_namelist 2_namelist_cfg cn_exp \"AGRIF_LONG\"
1260    set_namelist 2_namelist_cfg nn_it000 1
1261    set_namelist 2_namelist_cfg nn_itend $(( ${ITEND} * 4 ))
1262    set_namelist 2_namelist_cfg nn_stock $(( ${ITEND} * 4 / 2 ))
1263    set_namelist 2_namelist_cfg sn_cfctl%l_runstat .true.
1264    set_namelist 3_namelist_cfg cn_exp \"AGRIF_LONG\"
1265    set_namelist 3_namelist_cfg nn_it000 1
1266    set_namelist 3_namelist_cfg nn_itend $(( ${ITEND} * 4 * 3 ))
1267    set_namelist 3_namelist_cfg nn_stock $(( ${ITEND} * 4 * 3 / 2 ))
1268    set_namelist 3_namelist_cfg sn_cfctl%l_runstat .true.
1269    if [ ${USING_XIOS_RRW} == "yes" ]
1270       then
1271       set_namelist namelist_cfg nn_wxios 1
1272    fi
1273    if [ ${USING_MPMD} == "yes" ] ; then
1274       set_xio_using_server iodef.xml true
1275    else
1276       set_xio_using_server iodef.xml false
1277    fi
1278    cd ${SETTE_DIR}
1279    . ./prepare_job.sh input_AGRIF.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
1280   
1281    cd ${SETTE_DIR}
1282    export TEST_NAME="SHORT"
1283    . ./prepare_exe_dir.sh
1284    set_valid_dir
1285    clean_valid_dir
1286    cd ${EXE_DIR}
1287    set_namelist namelist_cfg cn_exp \"AGRIF_SHORT\"
1288    set_namelist namelist_cfg nn_it000 $(( ${ITEND} / 2 + 1 ))
1289    set_namelist namelist_cfg nn_itend ${ITEND}
1290    set_namelist namelist_cfg nn_stock $(( ${ITEND} / 2 ))
1291    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
1292    set_namelist namelist_cfg ln_rstart .true.
1293    set_namelist namelist_cfg nn_rstctl 2
1294    set_namelist 1_namelist_cfg cn_exp \"AGRIF_SHORT\"
1295    set_namelist 1_namelist_cfg nn_it000 $(( ${ITEND} / 2 + 1 ))
1296    set_namelist 1_namelist_cfg nn_itend ${ITEND}
1297    set_namelist 1_namelist_cfg nn_stock $(( ${ITEND} / 2 ))
1298    set_namelist 1_namelist_cfg sn_cfctl%l_runstat .true.
1299    set_namelist 1_namelist_cfg ln_rstart .true.
1300    set_namelist 1_namelist_cfg nn_rstctl 2
1301    set_namelist 2_namelist_cfg cn_exp \"AGRIF_SHORT\"
1302    set_namelist 2_namelist_cfg nn_it000 $(( ${ITEND} * 4 / 2 + 1 ))
1303    set_namelist 2_namelist_cfg nn_itend $(( ${ITEND} * 4 ))
1304    set_namelist 2_namelist_cfg nn_stock $(( ${ITEND} * 4 / 2 ))
1305    set_namelist 2_namelist_cfg sn_cfctl%l_runstat .true.
1306    set_namelist 2_namelist_cfg ln_rstart .true.
1307    set_namelist 2_namelist_cfg nn_rstctl 2
1308    set_namelist 3_namelist_cfg cn_exp \"AGRIF_SHORT\"
1309    set_namelist 3_namelist_cfg nn_it000 $(( ${ITEND} * 4 * 3 / 2 + 1 ))
1310    set_namelist 3_namelist_cfg nn_itend $(( ${ITEND} * 4 * 3 ))
1311    set_namelist 3_namelist_cfg nn_stock $(( ${ITEND} * 4 * 3 / 2 ))
1312    set_namelist 3_namelist_cfg sn_cfctl%l_runstat .true.
1313    set_namelist 3_namelist_cfg ln_rstart .true.
1314    set_namelist 3_namelist_cfg nn_rstctl 2
1315    set_namelist namelist_cfg cn_ocerst_in \"AGRIF_LONG_${ITRST}_restart\"
1316    set_namelist namelist_ice_cfg cn_icerst_in \"AGRIF_LONG_${ITRST}_restart_ice\"
1317    set_namelist 1_namelist_cfg cn_ocerst_in \"AGRIF_LONG_${ITRST_1}_restart\"
1318    set_namelist 1_namelist_ice_cfg cn_icerst_in \"AGRIF_LONG_${ITRST_1}_restart_ice\"
1319    set_namelist 2_namelist_cfg cn_ocerst_in \"AGRIF_LONG_${ITRST_2}_restart\"
1320    set_namelist 2_namelist_ice_cfg cn_icerst_in \"AGRIF_LONG_${ITRST_2}_restart_ice\"
1321    set_namelist 3_namelist_cfg cn_ocerst_in \"AGRIF_LONG_${ITRST_3}_restart\"
1322    set_namelist 3_namelist_ice_cfg cn_icerst_in \"AGRIF_LONG_${ITRST_3}_restart_ice\"
1323    if [ ${USING_XIOS_RRW} == "yes" ]
1324       then
1325       set_namelist namelist_cfg nn_wxios 1
1326       set_namelist namelist_cfg ln_xios_read .true.
1327    fi
1328
1329    if [ ${USING_XIOS_RRW} == "yes" ]
1330       then
1331            ln -sf ../LONG/AGRIF_LONG_${ITRST}_restart.nc .
1332            ln -sf ../LONG/AGRIF_LONG_${ITRST}_restart_ice.nc .
1333            ln -sf ../LONG/1_AGRIF_LONG_${ITRST_1}_restart.nc .
1334            ln -sf ../LONG/1_AGRIF_LONG_${ITRST_1}_restart_ice.nc .
1335            ln -sf ../LONG/2_AGRIF_LONG_${ITRST_2}_restart.nc .
1336            ln -sf ../LONG/2_AGRIF_LONG_${ITRST_2}_restart_ice.nc .
1337            ln -sf ../LONG/3_AGRIF_LONG_${ITRST_3}_restart.nc .
1338            ln -sf ../LONG/3_AGRIF_LONG_${ITRST_3}_restart_ice.nc .
1339    else
1340        for (( i=1; i<=$NPROC; i++)) ; do
1341            L_NPROC=$(( $i - 1 ))
1342            L_NPROC=`printf "%04d\n" ${L_NPROC}`
1343            ln -sf ../LONG/AGRIF_LONG_${ITRST}_restart_${L_NPROC}.nc .
1344            ln -sf ../LONG/AGRIF_LONG_${ITRST}_restart_ice_${L_NPROC}.nc .
1345            ln -sf ../LONG/1_AGRIF_LONG_${ITRST_1}_restart_${L_NPROC}.nc .
1346            ln -sf ../LONG/1_AGRIF_LONG_${ITRST_1}_restart_ice_${L_NPROC}.nc .
1347            ln -sf ../LONG/2_AGRIF_LONG_${ITRST_2}_restart_${L_NPROC}.nc .
1348            ln -sf ../LONG/2_AGRIF_LONG_${ITRST_2}_restart_ice_${L_NPROC}.nc .
1349            ln -sf ../LONG/3_AGRIF_LONG_${ITRST_3}_restart_${L_NPROC}.nc .
1350            ln -sf ../LONG/3_AGRIF_LONG_${ITRST_3}_restart_ice_${L_NPROC}.nc .
1351        done
1352    fi
1353    if [ ${USING_MPMD} == "yes" ] ; then
1354       set_xio_using_server iodef.xml true
1355    else
1356       set_xio_using_server iodef.xml false
1357    fi
1358    cd ${SETTE_DIR}
1359    . ./prepare_job.sh input_AGRIF.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
1360    cd ${SETTE_DIR}
1361    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
1362
1363## Reproducibility tests
1364    export TEST_NAME="REPRO_2_8"
1365    cd ${MAIN_DIR}
1366    cd ${SETTE_DIR}
1367    . ./param.cfg
1368    . ./all_functions.sh
1369    . ./prepare_exe_dir.sh
1370    set_valid_dir
1371    clean_valid_dir
1372    JOB_FILE=${EXE_DIR}/run_job.sh
1373    NPROC=16
1374    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
1375    cd ${EXE_DIR}
1376    set_namelist namelist_cfg cn_exp \"AGRIF_28\"
1377    set_namelist namelist_cfg nn_it000 1
1378    set_namelist namelist_cfg nn_itend ${ITEND}
1379    set_namelist namelist_cfg jpni 2
1380    set_namelist namelist_cfg jpnj 8
1381    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
1382    set_namelist 1_namelist_cfg cn_exp \"AGRIF_28\"
1383    set_namelist 1_namelist_cfg nn_it000 1
1384    set_namelist 1_namelist_cfg nn_itend ${ITEND}
1385    set_namelist 1_namelist_cfg jpni 2
1386    set_namelist 1_namelist_cfg jpnj 8
1387    set_namelist 1_namelist_cfg sn_cfctl%l_runstat .true.
1388    set_namelist 2_namelist_cfg cn_exp \"AGRIF_28\"
1389    set_namelist 2_namelist_cfg nn_it000 1
1390    set_namelist 2_namelist_cfg nn_itend $(( ${ITEND} * 4 ))
1391    set_namelist 2_namelist_cfg jpni 2
1392    set_namelist 2_namelist_cfg jpnj 8
1393    set_namelist 2_namelist_cfg sn_cfctl%l_runstat .true.
1394    set_namelist 3_namelist_cfg cn_exp \"AGRIF_28\"
1395    set_namelist 3_namelist_cfg nn_it000 1
1396    set_namelist 3_namelist_cfg nn_itend $(( ${ITEND} * 4 * 3 ))
1397    set_namelist 3_namelist_cfg jpni 2
1398    set_namelist 3_namelist_cfg jpnj 8
1399    set_namelist 3_namelist_cfg sn_cfctl%l_runstat .true.
1400
1401    if [ ${USING_XIOS_RRW} == "yes" ]
1402       then
1403       set_namelist namelist_cfg nn_wxios 1
1404    fi
1405
1406    if [ ${USING_MPMD} == "yes" ] ; then
1407       set_xio_using_server iodef.xml true
1408    else
1409       set_xio_using_server iodef.xml false
1410    fi
1411    cd ${SETTE_DIR}
1412    . ./prepare_job.sh input_AGRIF.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
1413    cd ${SETTE_DIR}
1414    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
1415
1416    cd ${SETTE_DIR}
1417    export TEST_NAME="REPRO_4_4"
1418    . ./prepare_exe_dir.sh
1419    set_valid_dir
1420    clean_valid_dir
1421    JOB_FILE=${EXE_DIR}/run_job.sh
1422    NPROC=16
1423    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
1424    cd ${EXE_DIR}
1425    set_namelist namelist_cfg cn_exp \"AGRIF_44\"
1426    set_namelist namelist_cfg nn_it000 1
1427    set_namelist namelist_cfg nn_itend ${ITEND}
1428    set_namelist namelist_cfg jpni 4
1429    set_namelist namelist_cfg jpnj 4
1430    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
1431    set_namelist 1_namelist_cfg cn_exp \"AGRIF_44\"
1432    set_namelist 1_namelist_cfg nn_it000 1
1433    set_namelist 1_namelist_cfg nn_itend ${ITEND}
1434    set_namelist 1_namelist_cfg jpni 4
1435    set_namelist 1_namelist_cfg jpnj 4
1436    set_namelist 1_namelist_cfg sn_cfctl%l_runstat .true.
1437    set_namelist 2_namelist_cfg cn_exp \"AGRIF_44\"
1438    set_namelist 2_namelist_cfg nn_it000 1
1439    set_namelist 2_namelist_cfg nn_itend $(( ${ITEND} * 4 ))
1440    set_namelist 2_namelist_cfg jpni 4
1441    set_namelist 2_namelist_cfg jpnj 4
1442    set_namelist 2_namelist_cfg sn_cfctl%l_runstat .true.
1443    set_namelist 3_namelist_cfg cn_exp \"AGRIF_44\"
1444    set_namelist 3_namelist_cfg nn_it000 1
1445    set_namelist 3_namelist_cfg nn_itend $(( ${ITEND} * 4 * 3 ))
1446    set_namelist 3_namelist_cfg jpni 4
1447    set_namelist 3_namelist_cfg jpnj 4
1448    set_namelist 3_namelist_cfg sn_cfctl%l_runstat .true.
1449    if [ ${USING_MPMD} == "yes" ] ; then
1450       set_xio_using_server iodef.xml true
1451    else
1452       set_xio_using_server iodef.xml false
1453    fi
1454    cd ${SETTE_DIR}
1455    . ./prepare_job.sh input_AGRIF.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
1456    cd ${SETTE_DIR}
1457    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
1458
1459## test code corruption with AGRIF (phase 1) ==> Compile with key_agrif but run with no zoom
1460    if [ $( echo ${CMP_NAM} | grep -ic debug ) -eq 1 ]
1461    then
1462   ITEND=16   # 1d
1463    else
1464   ITEND=150  # 5d and 9h
1465    fi
1466    export TEST_NAME="ORCA2"
1467    cd ${MAIN_DIR}
1468    cd ${SETTE_DIR}
1469    . ./param.cfg
1470    . ./all_functions.sh
1471    . ./prepare_exe_dir.sh
1472    set_valid_dir
1473    clean_valid_dir
1474    JOB_FILE=${EXE_DIR}/run_job.sh
1475    NPROC=32
1476    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
1477    cd ${EXE_DIR}
1478    set_namelist namelist_cfg cn_exp \"ORCA2\"
1479    set_namelist namelist_cfg nn_it000 1
1480    set_namelist namelist_cfg nn_itend ${ITEND}
1481    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
1482
1483#   Set the number of fine grids to zero:   
1484    sed -i "1s/.*/0/" ${EXE_DIR}/AGRIF_FixedGrids.in
1485
1486    if [ ${USING_MPMD} == "yes" ] ; then
1487       set_xio_using_server iodef.xml true
1488    else
1489       set_xio_using_server iodef.xml false
1490    fi
1491    cd ${SETTE_DIR}
1492    . ./prepare_job.sh input_AGRIF.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
1493    cd ${SETTE_DIR}
1494    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
1495
1496fi
1497
1498
1499## test code corruption with AGRIF (phase 2) ==> Compile without key_agrif (to be compared with AGRIF_DEMO_ST/ORCA2)
1500if [ ${config} == "AGRIF" ] ;  then
1501    export TEST_NAME="ORCA2"
1502    cd ${MAIN_DIR}
1503    #
1504    # syncronisation if target directory/file exist (not done by makenemo)
1505    . ${SETTE_DIR}/all_functions.sh
1506    sync_config  AGRIF_DEMO AGRIF_DEMO_NOAGRIF_ST 'cfgs'
1507    clean_config AGRIF_DEMO AGRIF_DEMO_NOAGRIF_ST 'cfgs'
1508    #
1509    . ./makenemo -m ${CMP_NAM} -n AGRIF_DEMO_NOAGRIF_ST -r AGRIF_DEMO -j 8 add_key "${ADD_KEYS}" del_key "key_agrif ${DEL_KEYS}"
1510    cd ${SETTE_DIR}
1511    . ./param.cfg
1512    . ./all_functions.sh
1513    . ./prepare_exe_dir.sh
1514    set_valid_dir
1515    clean_valid_dir
1516    JOB_FILE=${EXE_DIR}/run_job.sh
1517    NPROC=32
1518    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
1519    cd ${EXE_DIR}
1520    set_namelist namelist_cfg cn_exp \"ORCA2\"
1521    set_namelist namelist_cfg nn_it000 1
1522    set_namelist namelist_cfg nn_itend ${ITEND}
1523    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
1524#
1525    if [ ${USING_MPMD} == "yes" ] ; then
1526       set_xio_using_server iodef.xml true
1527    else
1528       set_xio_using_server iodef.xml false
1529    fi
1530    cd ${SETTE_DIR}
1531    . ./prepare_job.sh input_AGRIF.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
1532    cd ${SETTE_DIR}
1533    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
1534
1535fi
1536
1537# -------
1538# WED025
1539# -------
1540if [ ${config} == "WED025" ] ;  then
1541## Restartability tests
1542    if [ $( echo ${CMP_NAM} | grep -ic debug ) -eq 1 ]
1543    then
1544   ITEND=12   # 4h
1545    else
1546   ITEND=720  # 10 days
1547    fi
1548    ITRST=$( printf "%08d" $(( ${ITEND} / 2 )) )
1549    export TEST_NAME="LONG"
1550    cd ${MAIN_DIR}
1551    #
1552    # syncronisation if target directory/file exist (not done by makenemo)
1553    . ${SETTE_DIR}/all_functions.sh
1554    sync_config  WED025 WED025_ST 'cfgs'
1555    clean_config WED025 WED025_ST 'cfgs'
1556    #
1557    . ./makenemo -m ${CMP_NAM} -n WED025_ST -r WED025 -j 8 add_key "${ADD_KEYS}" del_key "${DEL_KEYS}"
1558    cd ${SETTE_DIR}
1559    . ./param.cfg
1560    . ./all_functions.sh
1561    . ./prepare_exe_dir.sh
1562    set_valid_dir
1563    clean_valid_dir
1564    JOB_FILE=${EXE_DIR}/run_job.sh
1565    NPROC=32
1566    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
1567    cd ${EXE_DIR}
1568    set_namelist namelist_cfg cn_exp \"WED025_LONG\"
1569    set_namelist namelist_cfg nn_it000 1
1570    set_namelist namelist_cfg nn_itend ${ITEND}
1571    set_namelist namelist_cfg nn_stock $(( ${ITEND} / 2 ))
1572    set_namelist namelist_cfg nn_date0 20000115
1573    set_namelist namelist_cfg jpni 4
1574    set_namelist namelist_cfg jpnj 8
1575    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
1576    #set_namelist namelist_ice_cfg ln_icediachk .true.
1577    if [ ${USING_XIOS_RRW} == "yes" ]
1578       then
1579       set_namelist namelist_cfg nn_wxios 1
1580    fi
1581    if [ ${USING_MPMD} == "yes" ] ; then
1582       set_xio_using_server iodef.xml true
1583    else
1584       set_xio_using_server iodef.xml false
1585    fi
1586    cd ${SETTE_DIR}
1587    . ./prepare_job.sh input_WED025.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
1588   
1589    cd ${SETTE_DIR}
1590    export TEST_NAME="SHORT"
1591    . ./prepare_exe_dir.sh
1592    set_valid_dir
1593    clean_valid_dir
1594    cd ${EXE_DIR}
1595    set_namelist namelist_cfg cn_exp \"WED025_SHORT\"
1596    set_namelist namelist_cfg nn_it000 $(( ${ITEND} / 2 + 1 ))
1597    set_namelist namelist_cfg nn_itend ${ITEND}
1598    set_namelist namelist_cfg nn_stock $(( ${ITEND} / 2 ))
1599    set_namelist namelist_cfg ln_rstart .true.
1600    set_namelist namelist_cfg nn_rstctl 2
1601    set_namelist namelist_cfg jpni 4
1602    set_namelist namelist_cfg jpnj 8
1603    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
1604    set_namelist namelist_cfg cn_ocerst_in \"WED025_LONG_${ITRST}_restart\"
1605    set_namelist namelist_ice_cfg cn_icerst_in \"WED025_LONG_${ITRST}_restart_ice\"
1606    if [ ${USING_XIOS_RRW} == "yes" ]
1607       then
1608       set_namelist namelist_cfg nn_wxios 1
1609       set_namelist namelist_cfg ln_xios_read .true.
1610    fi
1611    if [ ${USING_XIOS_RRW} == "yes" ]
1612       then
1613            ln -sf ../LONG/WED025_LONG_${ITRST}_restart.nc .
1614            ln -sf ../LONG/WED025_LONG_${ITRST}_restart_ice.nc .
1615    else
1616        for (( i=1; i<=$NPROC; i++)) ; do
1617            L_NPROC=$(( $i - 1 ))
1618            L_NPROC=`printf "%04d\n" ${L_NPROC}`
1619            ln -sf ../LONG/WED025_LONG_${ITRST}_restart_${L_NPROC}.nc .
1620            ln -sf ../LONG/WED025_LONG_${ITRST}_restart_ice_${L_NPROC}.nc .
1621        done
1622    fi
1623    if [ ${USING_MPMD} == "yes" ] ; then
1624       set_xio_using_server iodef.xml true
1625    else
1626       set_xio_using_server iodef.xml false
1627    fi
1628    cd ${SETTE_DIR}
1629    . ./prepare_job.sh input_WED025.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
1630    cd ${SETTE_DIR}
1631    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
1632
1633## Reproducibility tests
1634    export TEST_NAME="REPRO_5_6"
1635    cd ${MAIN_DIR}
1636    cd ${SETTE_DIR}
1637    . ./param.cfg
1638    . ./all_functions.sh
1639    . ./prepare_exe_dir.sh
1640    set_valid_dir
1641    clean_valid_dir
1642    JOB_FILE=${EXE_DIR}/run_job.sh
1643    NPROC=32
1644    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
1645    cd ${EXE_DIR}
1646    set_namelist namelist_cfg cn_exp \"WED025_56\"
1647    set_namelist namelist_cfg nn_it000 1
1648    set_namelist namelist_cfg nn_itend ${ITEND}
1649    set_namelist namelist_cfg nn_date0 20000115
1650    set_namelist namelist_cfg jpni 6
1651    set_namelist namelist_cfg jpnj 7
1652    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
1653    if [ ${USING_MPMD} == "yes" ] ; then
1654       set_xio_using_server iodef.xml true
1655    else
1656       set_xio_using_server iodef.xml false
1657    fi
1658    cd ${SETTE_DIR}
1659    . ./prepare_job.sh input_WED025.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
1660    cd ${SETTE_DIR}
1661    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
1662
1663    cd ${SETTE_DIR}
1664    export TEST_NAME="REPRO_8_4"
1665    . ./prepare_exe_dir.sh
1666    set_valid_dir
1667    clean_valid_dir
1668    JOB_FILE=${EXE_DIR}/run_job.sh
1669    NPROC=32
1670    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
1671    cd ${EXE_DIR}
1672    set_namelist namelist_cfg cn_exp \"WED025_84\"
1673    set_namelist namelist_cfg nn_it000 1
1674    set_namelist namelist_cfg nn_itend ${ITEND}
1675    set_namelist namelist_cfg nn_date0 20000115
1676    set_namelist namelist_cfg jpni 8
1677    set_namelist namelist_cfg jpnj 4
1678    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
1679    if [ ${USING_XIOS_RRW} == "yes" ]
1680       then
1681       set_namelist namelist_cfg nn_wxios 1
1682    fi
1683    if [ ${USING_MPMD} == "yes" ] ; then
1684       set_xio_using_server iodef.xml true
1685    else
1686       set_xio_using_server iodef.xml false
1687    fi
1688    cd ${SETTE_DIR}
1689    . ./prepare_job.sh input_WED025.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
1690    cd ${SETTE_DIR}
1691    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
1692fi
1693
1694
1695done
Note: See TracBrowser for help on using the repository browser.