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_wave – NEMO

source: utils/CI/sette_wave/sette_reference-configurations.sh @ 13989

Last change on this file since 13989 was 13943, checked in by francesca, 4 years ago

Added key_mpi3 and key_loop_fusion in sette to activate/deactivate the use of MPI3 and loop fusion

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