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

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

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

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

Branch: sette_ticket2673. Improved functionality: added -r (no report) option to disable running sette_rpt.sh at the end of sette.sh (allows chaining of sette.sh invocations with different arguments). Allowed SAS and AGRIF to be equivalently requested as ORCA2_SAS_ICE or AGRIF_DEMO (saves having to remember which are abbreviated). Sorted out the logic so that RESTART is no longer a mandatory test (allows REPRO without RESTART but, also, importantly, allows COMPILE as a test which will compile but not attempt to run - should mean fewer excuses for not running SETTE)

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