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 @ 14112

Last change on this file since 14112 was 13990, checked in by emanuelaclementi, 4 years ago

sette updates to test wave forcing in ORCA2_ICE_PISCES - ticket #2155 #2339

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