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/sette_ticket2673 – NEMO

source: utils/CI/sette_ticket2673/sette_reference-configurations.sh @ 14860

Last change on this file since 14860 was 14830, checked in by acc, 3 years ago

Oops; remove unintended deletion of key_qco when not USING_RK3

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