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

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

Last change on this file since 13568 was 13568, checked in by acc, 4 years ago

Added some new controls for SETTE.

SETTE currently carries out several types of tests: restartability, reproducibility, code
corruption (agrif-related) and, in the case of LOCK_EXCHANGE and OVERFLOW, a series of
runs with different physical options. For quick checking, such as is now the default with
a *DEBUG* arch file, a subset of these tests may be appropriate. This commit provides
that possibility by introducing a new command line option to sette.sh. Without arguments
SETTE will carry out all tests labelled as: "RESTART REPRO CORRUPT PHYOPTS". The
explicit equivalent would be:

./sette.sh -x "RESTART REPRO CORRUPT PHYOPTS"

any subset of these is allowed but RESTART is mandatory (since this compiles the code)
and will be prepended if omitted. For example:

./sette.sh

Configurations ORCA2_ICE_PISCES ORCA2_OFF_PISCES AMM12 AGRIF WED025 GYRE_PISCES SAS
ORCA2_ICE_OBS ICE_AGRIF OVERFLOW LOCK_EXCHANGE VORTEX ISOMIP+ will be tested if they
are available

Carrying out the following tests: RESTART REPRO CORRUPT PHYOPTS


Or to test restartability only on one configuration:

./sette.sh -t GYRE_PISCES -x RESTART

Configuration GYRE_PISCES will be tested if it is available

Carrying out the following tests: RESTART


Or trying to test reproducibility on its own will also invoke RESTART:

./sette.sh -t GYRE_PISCES -x REPRO

Configuration GYRE_PISCES will be tested if it is available

Carrying out the following tests: RESTART REPRO


Some subtle changes to the bash scripts have been necessary to achieve
this. Notably, param.cfg is only evaluated by sette.sh and consequently the
sette_reference-configurations.sh and sette_test-cases.sh scripts must now be run within
the same shell as sette.sh. This has been tested but there remains a possibility that
different flavours of bash may behave differently. I will hold off from updating the
svn_external reference for SETTE until this has been confirmed to work elsewhere.

One other change is the addition of an internal setting for USING_EXTRA_HALO which
mimics the USING_ICEBERGS setting within sette_reference-configurations.sh and can be
used to toggle testing with the extra halo.

This commit also introduces a debug arch file for the NOC MOBILIS system. This is an
intel-based system but has a rather dated ifort compiler (17.0.4). The -init=huge
keyword was not introduced until ifort v18. In all other arguments this arch file
matches the set recommened by Seb.

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