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

Last change on this file since 14981 was 14981, checked in by acc, 6 months ago

#2673 . Reintegrate sette developments back onto main sette branch. This action closes #2673

  • Property svn:executable set to *
File size: 62.9 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    SETTE_CONFIG="GYRE_PISCES"${SETTE_STG}
138    if [ $( echo ${CMP_NAM} | grep -ic debug ) -eq 1 ]
139    then
140   ITEND=12    # 1 day
141    else
142   ITEND=1080  # 90 days
143    fi
144    ITRST=$( printf "%08d" $(( ${ITEND} / 2 )) )
145    cd ${MAIN_DIR}
146    #
147    # syncronisation if target directory/file exist (not done by makenemo)
148    sync_config  GYRE_PISCES ${SETTE_CONFIG} 'cfgs'
149    clean_config GYRE_PISCES ${SETTE_CONFIG} 'cfgs'
150    #
151    # GYRE uses linssh so remove key_qco if added by default
152    . ./makenemo -m ${CMP_NAM} -n ${SETTE_CONFIG} -r GYRE_PISCES -j ${CMPL_CORES} add_key "${ADD_KEYS/key_qco/}" del_key "${DEL_KEYS}"
153fi
154if [ ${config} == "GYRE_PISCES" ] && [ ${DO_RESTART} == "1" ] ;  then
155## Restartability tests for GYRE_PISCES
156    export TEST_NAME="LONG"
157    cd ${SETTE_DIR}
158    . ./prepare_exe_dir.sh
159    set_valid_dir
160    clean_valid_dir
161    JOB_FILE=${EXE_DIR}/run_job.sh
162    NPROC=8
163    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
164    cd ${EXE_DIR} 
165    set_namelist namelist_cfg cn_exp \"GYREPIS_LONG\"
166    set_namelist namelist_cfg nn_it000 1
167    set_namelist namelist_cfg nn_itend ${ITEND}
168    set_namelist namelist_cfg nn_stock $(( ${ITEND} / 2 ))
169    set_namelist namelist_cfg ln_linssh .true.
170    set_namelist namelist_cfg jpni 2
171    set_namelist namelist_cfg jpnj 4
172    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
173    set_namelist namelist_cfg sn_cfctl%l_trcstat .true.
174    set_namelist_opt namelist_cfg ln_timing ${USING_TIMING} .true. .false.
175    set_namelist_opt namelist_cfg nn_hls ${USING_EXTRA_HALO} 2 1
176    set_namelist_opt namelist_cfg nn_comm ${USING_COLLECTIVES} 2 1
177    set_namelist_opt namelist_cfg ln_tile ${USING_TILING} .true. .false.
178    set_xio_using_server iodef.xml ${USING_MPMD}
179    cd ${SETTE_DIR}
180    . ./prepare_job.sh input_GYRE.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
181
182    cd ${SETTE_DIR}
183    export TEST_NAME="SHORT"
184    . ./prepare_exe_dir.sh
185    set_valid_dir
186    clean_valid_dir
187    cd ${EXE_DIR}
188    set_namelist namelist_cfg cn_exp \"GYREPIS_SHORT\"
189    set_namelist namelist_cfg nn_it000 $(( ${ITEND} / 2 + 1 ))
190    set_namelist namelist_cfg nn_itend ${ITEND}
191    set_namelist namelist_cfg nn_stock $(( ${ITEND} / 2 ))
192    set_namelist namelist_cfg ln_rstart .true.
193    set_namelist namelist_cfg nn_rstctl 2
194    set_namelist namelist_cfg ln_linssh .true.
195    set_namelist namelist_cfg jpni 2
196    set_namelist namelist_cfg jpnj 4
197    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
198    set_namelist namelist_cfg sn_cfctl%l_trcstat .true.
199    set_namelist namelist_top_cfg ln_rsttr .true.
200    set_namelist namelist_top_cfg nn_rsttr 2
201    set_namelist namelist_cfg cn_ocerst_in \"GYREPIS_LONG_${ITRST}_restart\"
202    set_namelist namelist_top_cfg cn_trcrst_in \"GYREPIS_LONG_${ITRST}_restart_trc\"
203    set_namelist_opt namelist_cfg ln_timing ${USING_TIMING} .true. .false.
204    set_namelist_opt namelist_cfg nn_hls ${USING_EXTRA_HALO} 2 1
205    set_namelist_opt namelist_cfg nn_comm ${USING_COLLECTIVES} 2 1
206    set_namelist_opt namelist_cfg ln_tile ${USING_TILING} .true. .false.
207    set_xio_using_server iodef.xml ${USING_MPMD}
208    for (( i=1; i<=$NPROC; i++)) ; do
209        L_NPROC=$(( $i - 1 ))
210        L_NPROC=`printf "%04d\n" ${L_NPROC}`
211        ln -sf ../LONG/GYREPIS_LONG_${ITRST}_restart_${L_NPROC}.nc .
212        ln -sf ../LONG/GYREPIS_LONG_${ITRST}_restart_trc_${L_NPROC}.nc .
213    done
214    cd ${SETTE_DIR}
215    . ./prepare_job.sh input_GYRE.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
216    cd ${SETTE_DIR}
217    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
218
219fi
220
221if [ ${config} == "GYRE_PISCES" ] && [ ${DO_REPRO} == "1" ] ;  then
222## Reproducibility tests for GYRE_PISCES
223    export TEST_NAME="REPRO_2_4"
224    cd ${MAIN_DIR}
225    cd ${SETTE_DIR}
226    . ./prepare_exe_dir.sh
227    set_valid_dir
228    clean_valid_dir
229    JOB_FILE=${EXE_DIR}/run_job.sh
230    NPROC=8
231    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
232    cd ${EXE_DIR}
233    set_namelist namelist_cfg cn_exp \"GYREPIS_48\"
234    set_namelist namelist_cfg nn_it000 1
235    set_namelist namelist_cfg nn_itend ${ITEND}
236    set_namelist namelist_cfg ln_linssh .true.
237    set_namelist namelist_cfg jpni 2
238    set_namelist namelist_cfg jpnj 4
239    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
240    set_namelist namelist_cfg sn_cfctl%l_trcstat .true.
241    set_namelist_opt namelist_cfg ln_timing ${USING_TIMING} .true. .false.
242    set_namelist_opt namelist_cfg nn_hls ${USING_EXTRA_HALO} 2 1
243    set_namelist_opt namelist_cfg nn_comm ${USING_COLLECTIVES} 2 1
244    set_namelist_opt namelist_cfg ln_tile ${USING_TILING} .true. .false.
245    set_xio_using_server iodef.xml ${USING_MPMD}
246    cd ${SETTE_DIR}
247    . ./prepare_job.sh input_GYRE.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
248    cd ${SETTE_DIR}
249    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
250
251    cd ${SETTE_DIR}
252    export TEST_NAME="REPRO_4_2"
253    . ./prepare_exe_dir.sh
254    set_valid_dir
255    clean_valid_dir
256    JOB_FILE=${EXE_DIR}/run_job.sh
257    NPROC=8
258    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
259    cd ${EXE_DIR}
260    set_namelist namelist_cfg cn_exp \"GYREPIS_84\"
261    set_namelist namelist_cfg nn_it000 1
262    set_namelist namelist_cfg nn_itend ${ITEND}
263    set_namelist namelist_cfg ln_linssh .true.
264    set_namelist namelist_cfg jpni 4
265    set_namelist namelist_cfg jpnj 2
266    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
267    set_namelist namelist_cfg sn_cfctl%l_trcstat .true.
268    set_namelist_opt namelist_cfg ln_timing ${USING_TIMING} .true. .false.
269    set_namelist_opt namelist_cfg nn_hls ${USING_EXTRA_HALO} 2 1
270    set_namelist_opt namelist_cfg nn_comm ${USING_COLLECTIVES} 2 1
271    set_namelist_opt namelist_cfg ln_tile ${USING_TILING} .true. .false.
272    set_xio_using_server iodef.xml ${USING_MPMD}
273    cd ${SETTE_DIR}
274    . ./prepare_job.sh input_GYRE.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
275    cd ${SETTE_DIR}
276    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
277
278fi
279
280# -----------------
281# ORCA2_ICE_PISCES
282# -----------------
283if [ ${config} == "ORCA2_ICE_PISCES" ] ;  then
284    SETTE_CONFIG="ORCA2_ICE_PISCES"${SETTE_STG}
285    if [ $( echo ${CMP_NAM} | grep -ic debug ) -eq 1 ]
286    then
287   ITEND=16   # 1 day
288    else
289   ITEND=992  # 62 days
290    fi
291    ITRST=$( printf "%08d" $(( ${ITEND} / 2 )) )
292    cd ${MAIN_DIR}
293    #
294    # syncronisation if target directory/file exist (not done by makenemo)
295    sync_config  ORCA2_ICE_PISCES ${SETTE_CONFIG} 'cfgs'
296    clean_config ORCA2_ICE_PISCES ${SETTE_CONFIG} 'cfgs'
297    #
298    . ./makenemo -m ${CMP_NAM} -n ${SETTE_CONFIG} -r ORCA2_ICE_PISCES -j ${CMPL_CORES} add_key "${ADD_KEYS}" del_key "${DEL_KEYS}"
299fi
300if [ ${config} == "ORCA2_ICE_PISCES" ] && [ ${DO_RESTART} == "1" ] ;  then
301## Restartability tests for ORCA2_ICE_PISCES
302    export TEST_NAME="LONG"
303    cd ${SETTE_DIR}
304    . ./prepare_exe_dir.sh
305    set_valid_dir
306    clean_valid_dir
307    JOB_FILE=${EXE_DIR}/run_job.sh
308    NPROC=32
309    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
310    cd ${EXE_DIR}
311    set_namelist namelist_cfg cn_exp \"O2L3P_LONG\"
312    set_namelist namelist_cfg nn_it000 1
313    set_namelist namelist_cfg nn_itend ${ITEND}
314    set_namelist namelist_cfg nn_stock $(( ${ITEND} / 2 ))
315    set_namelist namelist_cfg jpni 4
316    set_namelist namelist_cfg jpnj 8
317    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
318    set_namelist namelist_cfg sn_cfctl%l_trcstat .true.
319    set_namelist namelist_cfg ln_use_calving .true.
320    set_namelist namelist_cfg ln_wave .true.
321    set_namelist namelist_cfg ln_cdgw .false.
322    set_namelist namelist_cfg ln_sdw  .true.
323    set_namelist namelist_cfg ln_stcor .true.
324    #
325    set_namelist_opt namelist_cfg ln_icebergs ${USING_ICEBERGS} .true. .false.
326    set_namelist_opt namelist_cfg nn_hls ${USING_EXTRA_HALO} 2 1
327    set_namelist_opt namelist_cfg nn_comm ${USING_COLLECTIVES} 2 1
328    set_namelist_opt namelist_cfg ln_tile ${USING_TILING} .true. .false.
329    # for debugging purposes set_namelist namelist_cfg rn_test_box -180.0, 180.0, -90.0, -55.0
330    #
331    set_namelist namelist_ice_cfg ln_icediachk .true.
332    set_namelist namelist_top_cfg ln_trcdta .false.
333    set_namelist namelist_top_cfg ln_trcbc  .false.
334    # put ln_ironsed, ln_hydrofe to false
335    # if not you need input files, and for tests is not necessary
336    set_namelist namelist_pisces_cfg ln_varpar .false.
337    set_namelist namelist_pisces_cfg ln_ironsed .false.
338    set_namelist namelist_pisces_cfg ln_ironice .false.
339    set_namelist namelist_pisces_cfg ln_hydrofe .false.
340    # put ln_pisdmp to false : no restoring to global mean value
341    set_namelist namelist_pisces_cfg ln_pisdmp .false.
342    set_namelist_opt namelist_cfg ln_timing ${USING_TIMING} .true. .false.
343    set_xio_using_server iodef.xml ${USING_MPMD}
344    cd ${SETTE_DIR}
345    . ./prepare_job.sh input_ORCA2_ICE_PISCES.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
346   
347    cd ${SETTE_DIR}
348    export TEST_NAME="SHORT"
349    . ./prepare_exe_dir.sh
350    set_valid_dir
351    clean_valid_dir
352    cd ${EXE_DIR}
353    set_namelist namelist_cfg cn_exp \"O2L3P_SHORT\"
354    set_namelist namelist_cfg nn_it000 $(( ${ITEND} / 2 + 1 ))
355    set_namelist namelist_cfg nn_itend ${ITEND}
356    set_namelist namelist_cfg nn_stock $(( ${ITEND} / 2 ))
357    set_namelist namelist_cfg ln_rstart .true.
358    set_namelist namelist_cfg nn_rstctl 2
359    set_namelist namelist_cfg jpni 4
360    set_namelist namelist_cfg jpnj 8
361    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
362    set_namelist namelist_cfg sn_cfctl%l_trcstat .true.
363    set_namelist namelist_cfg nn_test_icebergs -1
364    set_namelist namelist_cfg ln_wave .true.
365    set_namelist namelist_cfg ln_cdgw .false.
366    set_namelist namelist_cfg ln_sdw  .true.
367    set_namelist namelist_cfg ln_stcor .true.
368    #
369    set_namelist_opt namelist_cfg ln_icebergs ${USING_ICEBERGS} .true. .false.
370    set_namelist_opt namelist_cfg nn_hls ${USING_EXTRA_HALO} 2 1
371    set_namelist_opt namelist_cfg nn_comm ${USING_COLLECTIVES} 2 1
372    set_namelist_opt namelist_cfg ln_tile ${USING_TILING} .true. .false.
373    # for debugging purposes set_namelist namelist_cfg rn_test_box -180.0, 180.0, -90.0, -55.0
374    #
375    set_namelist namelist_ice_cfg ln_icediachk .true.
376    set_namelist namelist_top_cfg ln_rsttr .true.
377    set_namelist namelist_top_cfg nn_rsttr 2
378    set_namelist namelist_cfg cn_ocerst_in \"O2L3P_LONG_${ITRST}_restart\"
379    set_namelist namelist_cfg cn_icbrst_in \"O2L3P_LONG_${ITRST}_restart_icb\"
380    set_namelist namelist_top_cfg cn_trcrst_in \"O2L3P_LONG_${ITRST}_restart_trc\"
381    set_namelist namelist_ice_cfg cn_icerst_in \"O2L3P_LONG_${ITRST}_restart_ice\"
382    set_namelist namelist_top_cfg ln_trcbc  .false.
383    # put ln_ironsed, ln_hydrofe to false
384    # if not you need input files, and for tests is not necessary
385    set_namelist namelist_pisces_cfg ln_varpar .false.
386    set_namelist namelist_pisces_cfg ln_ironsed .false.
387    set_namelist namelist_pisces_cfg ln_ironice .false.
388    set_namelist namelist_pisces_cfg ln_hydrofe .false.
389    # put ln_pisdmp to false : no restoring to global mean value
390    set_namelist namelist_pisces_cfg ln_pisdmp .false.
391    for (( i=1; i<=$NPROC; i++)) ; do
392        L_NPROC=$(( $i - 1 ))
393        L_NPROC=`printf "%04d\n" ${L_NPROC}`
394        ln -sf ../LONG/O2L3P_LONG_${ITRST}_restart_${L_NPROC}.nc .
395        ln -sf ../LONG/O2L3P_LONG_${ITRST}_restart_trc_${L_NPROC}.nc .
396        ln -sf ../LONG/O2L3P_LONG_${ITRST}_restart_ice_${L_NPROC}.nc .
397        if [ ${USING_ICEBERGS} == "yes" ]
398            then
399             ln -sf ../LONG/O2L3P_LONG_${ITRST}_restart_icb_${L_NPROC}.nc O2L3P_LONG_${ITRST}_restart_icb_${L_NPROC}.nc
400        fi
401    done
402    set_namelist_opt namelist_cfg ln_timing ${USING_TIMING} .true. .false.
403    set_xio_using_server iodef.xml ${USING_MPMD}
404    cd ${SETTE_DIR}
405    . ./prepare_job.sh input_ORCA2_ICE_PISCES.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
406    cd ${SETTE_DIR}
407    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
408
409fi
410
411if [ ${config} == "ORCA2_ICE_PISCES" ] && [ ${DO_REPRO} == "1" ] ;  then
412## Reproducibility tests for ORCA2_ICE_PISCES
413    export TEST_NAME="REPRO_4_8"
414    cd ${MAIN_DIR}
415    cd ${SETTE_DIR}
416    . ./prepare_exe_dir.sh
417    set_valid_dir
418    clean_valid_dir
419    JOB_FILE=${EXE_DIR}/run_job.sh
420    NPROC=32
421    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
422    cd ${EXE_DIR}
423    set_namelist namelist_cfg cn_exp \"O2L3P_48\"
424    set_namelist namelist_cfg nn_it000 1
425    set_namelist namelist_cfg nn_itend ${ITEND}
426    set_namelist namelist_cfg jpni 4
427    set_namelist namelist_cfg jpnj 8
428    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
429    set_namelist namelist_cfg sn_cfctl%l_trcstat .true.
430    set_namelist namelist_cfg ln_wave .true.
431    set_namelist namelist_cfg ln_cdgw .false.
432    set_namelist namelist_cfg ln_sdw  .true.
433    set_namelist namelist_cfg ln_stcor .true.
434
435    set_namelist_opt namelist_cfg ln_icebergs ${USING_ICEBERGS} .true. .false.
436    set_namelist_opt namelist_cfg nn_hls ${USING_EXTRA_HALO} 2 1
437    set_namelist_opt namelist_cfg nn_comm ${USING_COLLECTIVES} 2 1
438    set_namelist_opt namelist_cfg ln_tile ${USING_TILING} .true. .false.
439    # for debugging purposes set_namelist namelist_cfg rn_test_box -180.0, 180.0, -90.0, -55.0
440
441    set_namelist namelist_top_cfg ln_trcdta .false.
442    set_namelist namelist_top_cfg ln_trcbc  .false.
443    # put ln_ironsed, ln_hydrofe to false
444    # if not you need input files, and for tests is not necessary
445    set_namelist namelist_pisces_cfg ln_varpar .false.
446    set_namelist namelist_pisces_cfg ln_ironsed .false.
447    set_namelist namelist_pisces_cfg ln_ironice .false.
448    set_namelist namelist_pisces_cfg ln_hydrofe .false.
449    # put ln_pisdmp to false : no restoring to global mean value
450    set_namelist namelist_pisces_cfg ln_pisdmp .false.
451    set_namelist_opt namelist_cfg ln_timing ${USING_TIMING} .true. .false.
452    set_xio_using_server iodef.xml ${USING_MPMD}
453    cd ${SETTE_DIR}
454    . ./prepare_job.sh input_ORCA2_ICE_PISCES.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
455    cd ${SETTE_DIR}
456    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
457
458    cd ${SETTE_DIR}
459    export TEST_NAME="REPRO_8_4"
460    . ./prepare_exe_dir.sh
461    set_valid_dir
462    clean_valid_dir
463    JOB_FILE=${EXE_DIR}/run_job.sh
464    NPROC=32
465    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
466    cd ${EXE_DIR}
467    set_namelist namelist_cfg cn_exp \"O2L3P_84\"
468    set_namelist namelist_cfg nn_it000 1
469    set_namelist namelist_cfg nn_itend ${ITEND}
470    set_namelist namelist_cfg jpni 8
471    set_namelist namelist_cfg jpnj 4
472    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
473    set_namelist namelist_cfg sn_cfctl%l_trcstat .true.
474    set_namelist namelist_cfg ln_wave .true.
475    set_namelist namelist_cfg ln_cdgw .false.
476    set_namelist namelist_cfg ln_sdw  .true.
477    set_namelist namelist_cfg ln_stcor .true.
478
479    set_namelist_opt namelist_cfg ln_icebergs ${USING_ICEBERGS} .true. .false.
480    set_namelist_opt namelist_cfg nn_hls ${USING_EXTRA_HALO} 2 1
481    set_namelist_opt namelist_cfg nn_comm ${USING_COLLECTIVES} 2 1
482    set_namelist_opt namelist_cfg ln_tile ${USING_TILING} .true. .false.
483    # for debugging purposes set_namelist namelist_cfg rn_test_box -180.0, 180.0, -90.0, -55.0
484
485    set_namelist namelist_top_cfg ln_trcdta .false.
486    set_namelist namelist_top_cfg ln_trcbc  .false.
487    # put ln_ironsed, ln_hydrofe to false
488    # if not you need input files, and for tests is not necessary
489    set_namelist namelist_pisces_cfg ln_varpar .false.
490    set_namelist namelist_pisces_cfg ln_ironsed .false.
491    set_namelist namelist_pisces_cfg ln_ironice .false.
492    set_namelist namelist_pisces_cfg ln_hydrofe .false.
493    # put ln_pisdmp to false : no restoring to global mean value
494    set_namelist namelist_pisces_cfg ln_pisdmp .false.
495    set_namelist_opt namelist_cfg ln_timing ${USING_TIMING} .true. .false.
496    set_xio_using_server iodef.xml ${USING_MPMD}
497    cd ${SETTE_DIR}
498    . ./prepare_job.sh input_ORCA2_ICE_PISCES.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
499    cd ${SETTE_DIR}
500    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
501fi
502
503# ----------------
504# ORCA2_OFF_PISCES
505# ----------------
506if [ ${config} == "ORCA2_OFF_PISCES" ] ;  then
507    SETTE_CONFIG="ORCA2_OFF_PISCES"${SETTE_STG}
508    if [ $( echo ${CMP_NAM} | grep -ic debug ) -eq 1 ]
509    then
510   ITEND=16   # 4 days
511    else
512   ITEND=380  # 95 days
513    fi
514    ITRST=$( printf "%08d" $(( ${ITEND} / 2 )) )
515    cd ${MAIN_DIR}
516    #
517    # syncronisation if target directory/file exist (not done by makenemo)
518    sync_config  ${SETTE_CONFIG} ORCA2_OFF_PISCES_ST 'cfgs'
519    clean_config ${SETTE_CONFIG} ORCA2_OFF_PISCES_ST 'cfgs'
520    #
521    # ORCA2_OFF_PISCES uses linssh so remove key_qco if added by default
522    . ./makenemo -m ${CMP_NAM} -n ${SETTE_CONFIG} -r ORCA2_OFF_PISCES -j ${CMPL_CORES} add_key "${ADD_KEYS/key_qco/}" del_key "${DEL_KEYS}"
523fi
524if [ ${config} == "ORCA2_OFF_PISCES" ] && [ ${DO_RESTART} == "1" ] ;  then
525## Restartability tests for ORCA2_OFF_PISCES
526    export TEST_NAME="LONG"
527    cd ${SETTE_DIR}
528    . ./prepare_exe_dir.sh
529    set_valid_dir
530    clean_valid_dir
531    JOB_FILE=${EXE_DIR}/run_job.sh
532    NPROC=32
533    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
534    cd ${EXE_DIR}
535    set_namelist namelist_cfg cn_exp \"OFFP_LONG\"
536    set_namelist namelist_cfg nn_it000 1
537    set_namelist namelist_cfg nn_itend ${ITEND}
538    set_namelist namelist_cfg nn_stock $(( ${ITEND} / 2 ))
539    set_namelist namelist_cfg jpni 4
540    set_namelist namelist_cfg jpnj 8
541    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
542    set_namelist namelist_cfg sn_cfctl%l_trcstat .true.
543    set_namelist namelist_cfg ln_qsr_rgb .true.
544    set_namelist namelist_top_cfg ln_trcdta .false.
545    set_namelist namelist_top_cfg ln_trcbc  .false.
546    # put ln_ironsed, ln_hydrofe to false
547    # if not you need input files, and for tests is not necessary
548    set_namelist namelist_pisces_cfg ln_varpar .false.
549    set_namelist namelist_pisces_cfg ln_ironsed .false.
550    set_namelist namelist_pisces_cfg ln_ironice .false.
551    set_namelist namelist_pisces_cfg ln_hydrofe .false.
552    # put ln_pisdmp to false : no restoring to global mean value
553    set_namelist namelist_pisces_cfg ln_pisdmp .false.
554    set_namelist_opt namelist_cfg ln_timing ${USING_TIMING} .true. .false.
555    set_namelist_opt namelist_cfg nn_hls ${USING_EXTRA_HALO} 2 1
556    set_namelist_opt namelist_cfg nn_comm ${USING_COLLECTIVES} 2 1
557    set_xio_using_server iodef.xml ${USING_MPMD}
558    cd ${SETTE_DIR}
559    . ./prepare_job.sh input_ORCA2_OFF_PISCES.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
560   
561    cd ${SETTE_DIR}
562    export TEST_NAME="SHORT"
563    . ./prepare_exe_dir.sh
564    set_valid_dir
565    clean_valid_dir
566    cd ${EXE_DIR}
567    set_namelist namelist_cfg cn_exp \"OFFP_SHORT\"
568    set_namelist namelist_cfg nn_it000 $(( ${ITEND} / 2 + 1 ))
569    set_namelist namelist_cfg nn_itend ${ITEND}
570    set_namelist namelist_cfg nn_stock $(( ${ITEND} / 2 ))
571    set_namelist namelist_cfg jpni 4
572    set_namelist namelist_cfg jpnj 8
573    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
574    set_namelist namelist_cfg sn_cfctl%l_trcstat .true.
575    set_namelist namelist_cfg ln_qsr_rgb .true.
576    set_namelist namelist_top_cfg ln_rsttr .true.
577    set_namelist namelist_top_cfg nn_rsttr 2
578    set_namelist namelist_top_cfg cn_trcrst_in \"OFFP_LONG_${ITRST}_restart_trc\"
579    for (( i=1; i<=$NPROC; i++)) ; do
580        L_NPROC=$(( $i - 1 ))
581        L_NPROC=`printf "%04d\n" ${L_NPROC}`
582        ln -sf ../LONG/OFFP_LONG_${ITRST}_restart_trc_${L_NPROC}.nc .
583    done
584    set_namelist namelist_top_cfg ln_trcbc  .false.
585    # put ln_ironsed, ln_hydrofe to false
586    # if not you need input files, and for tests is not necessary
587    set_namelist namelist_pisces_cfg ln_varpar .false.
588    set_namelist namelist_pisces_cfg ln_ironsed .false.
589    set_namelist namelist_pisces_cfg ln_ironice .false.
590    set_namelist namelist_pisces_cfg ln_hydrofe .false.
591    # put ln_pisdmp to false : no restoring to global mean value
592    set_namelist namelist_pisces_cfg ln_pisdmp .false.
593    set_namelist_opt namelist_cfg ln_timing ${USING_TIMING} .true. .false.
594    set_namelist_opt namelist_cfg nn_hls ${USING_EXTRA_HALO} 2 1
595    set_namelist_opt namelist_cfg nn_comm ${USING_COLLECTIVES} 2 1
596    set_xio_using_server iodef.xml ${USING_MPMD}
597    cd ${SETTE_DIR}
598    . ./prepare_job.sh input_ORCA2_OFF_PISCES.cfg $NPROC ${TEST_NAME}  ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
599    cd ${SETTE_DIR}
600    . ./fcm_job.sh $NPROC  ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
601
602fi
603
604if [ ${config} == "ORCA2_OFF_PISCES" ] && [ ${DO_REPRO} == "1" ] ;  then
605## Reproducibility tests for ORCA2_OFF_PISCES
606    export TEST_NAME="REPRO_4_8"
607    cd ${MAIN_DIR}
608    cd ${SETTE_DIR}
609    . ./prepare_exe_dir.sh
610    set_valid_dir
611    clean_valid_dir
612    JOB_FILE=${EXE_DIR}/run_job.sh
613    NPROC=32
614    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
615    cd ${EXE_DIR}
616    set_namelist namelist_cfg cn_exp \"OFFP_48\"
617    set_namelist namelist_cfg nn_it000 1
618    set_namelist namelist_cfg nn_itend ${ITEND}
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_trcdta .false.
625    set_namelist namelist_top_cfg ln_trcbc  .false.
626    # put ln_ironsed, ln_hydrofe to false
627    # if not you need input files, and for tests is not necessary
628    set_namelist namelist_pisces_cfg ln_varpar .false.
629    set_namelist namelist_pisces_cfg ln_ironsed .false.
630    set_namelist namelist_pisces_cfg ln_ironice .false.
631    set_namelist namelist_pisces_cfg ln_hydrofe .false.
632    # put ln_pisdmp to false : no restoring to global mean value
633    set_namelist namelist_pisces_cfg ln_pisdmp .false.
634    set_namelist_opt namelist_cfg ln_timing ${USING_TIMING} .true. .false.
635    set_namelist_opt namelist_cfg nn_hls ${USING_EXTRA_HALO} 2 1
636    set_namelist_opt namelist_cfg nn_comm ${USING_COLLECTIVES} 2 1
637    set_xio_using_server iodef.xml ${USING_MPMD}
638    cd ${SETTE_DIR}
639    . ./prepare_job.sh input_ORCA2_OFF_PISCES.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
640    cd ${SETTE_DIR}
641    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
642
643    cd ${SETTE_DIR}
644    export TEST_NAME="REPRO_8_4"
645    . ./prepare_exe_dir.sh
646    set_valid_dir
647    clean_valid_dir
648    JOB_FILE=${EXE_DIR}/run_job.sh
649    NPROC=32
650    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
651    cd ${EXE_DIR}
652    set_namelist namelist_cfg cn_exp \"OFFP_84\"
653    set_namelist namelist_cfg nn_it000 1
654    set_namelist namelist_cfg nn_itend ${ITEND}
655    set_namelist namelist_cfg jpni 8
656    set_namelist namelist_cfg jpnj 4
657    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
658    set_namelist namelist_cfg sn_cfctl%l_trcstat .true.
659    set_namelist namelist_cfg ln_qsr_rgb .true.
660    set_namelist namelist_top_cfg ln_trcdta .false.
661    set_namelist namelist_top_cfg ln_trcbc  .false.
662    # put ln_ironsed, ln_hydrofe to false
663    # if not you need input files, and for tests is not necessary
664    set_namelist namelist_pisces_cfg ln_varpar .false.
665    set_namelist namelist_pisces_cfg ln_ironsed .false.
666    set_namelist namelist_pisces_cfg ln_ironice .false.
667    set_namelist namelist_pisces_cfg ln_hydrofe .false.
668    # put ln_pisdmp to false : no restoring to global mean value
669    set_namelist namelist_pisces_cfg ln_pisdmp .false.
670    set_namelist_opt namelist_cfg ln_timing ${USING_TIMING} .true. .false.
671    set_namelist_opt namelist_cfg nn_hls ${USING_EXTRA_HALO} 2 1
672    set_namelist_opt namelist_cfg nn_comm ${USING_COLLECTIVES} 2 1
673    set_xio_using_server iodef.xml ${USING_MPMD}
674    cd ${SETTE_DIR}
675    . ./prepare_job.sh input_ORCA2_OFF_PISCES.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
676    cd ${SETTE_DIR}
677    . ./fcm_job.sh $NPROC  ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
678fi
679
680# -----
681# AMM12
682# -----
683if [ ${config} == "AMM12" ] ;  then
684    SETTE_CONFIG="AMM12"${SETTE_STG}
685    if [ $( echo ${CMP_NAM} | grep -ic debug ) -eq 1 ]
686    then
687   ITEND=12   # 3 h
688    else
689   ITEND=576  # 4 days
690    fi
691    ITRST=$( printf "%08d" $(( ${ITEND} / 2 )) )
692    cd ${MAIN_DIR}
693    #
694    # syncronisation if target directory/file exist (not done by makenemo)
695    sync_config  AMM12 ${SETTE_CONFIG} 'cfgs'
696    clean_config AMM12 ${SETTE_CONFIG} 'cfgs'
697    #
698    . ./makenemo -m ${CMP_NAM} -n ${SETTE_CONFIG} -r AMM12 -j ${CMPL_CORES} add_key "${ADD_KEYS}" del_key "${DEL_KEYS}"
699fi
700if [ ${config} == "AMM12" ] && [ ${DO_RESTART} == "1" ] ;  then
701    ## Restartability tests for AMM12
702    export TEST_NAME="LONG"
703    cd ${SETTE_DIR}
704    . ./prepare_exe_dir.sh
705    set_valid_dir
706    clean_valid_dir
707    JOB_FILE=${EXE_DIR}/run_job.sh
708    NPROC=32
709    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
710    cd ${EXE_DIR}
711    set_namelist namelist_cfg cn_exp \"AMM12_LONG\"
712    set_namelist namelist_cfg nn_it000 1
713    set_namelist namelist_cfg nn_itend ${ITEND}
714    set_namelist namelist_cfg nn_stock $(( ${ITEND} / 2 ))
715    set_namelist namelist_cfg jpni 4
716    set_namelist namelist_cfg jpnj 8
717    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
718    set_namelist_opt namelist_cfg ln_timing ${USING_TIMING} .true. .false.
719    set_namelist_opt namelist_cfg nn_hls ${USING_EXTRA_HALO} 2 1
720    set_namelist_opt namelist_cfg nn_comm ${USING_COLLECTIVES} 2 1
721    set_namelist_opt namelist_cfg ln_tile ${USING_TILING} .true. .false.
722    set_xio_using_server iodef.xml ${USING_MPMD}
723    cd ${SETTE_DIR}
724    . ./prepare_job.sh input_AMM12.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
725
726    cd ${SETTE_DIR}
727    export TEST_NAME="SHORT"
728    . ./prepare_exe_dir.sh
729    set_valid_dir
730    clean_valid_dir
731    cd ${EXE_DIR}
732    set_namelist namelist_cfg cn_exp \"AMM12_SHORT\"
733    set_namelist namelist_cfg nn_it000 $(( ${ITEND} / 2 + 1 ))
734    set_namelist namelist_cfg nn_itend ${ITEND}
735    set_namelist namelist_cfg nn_stock $(( ${ITEND} / 2 ))
736    set_namelist namelist_cfg jpni 4
737    set_namelist namelist_cfg jpnj 8
738    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
739    set_namelist namelist_cfg ln_rstart .true.
740    set_namelist namelist_cfg nn_rstctl 2
741    set_namelist namelist_cfg cn_ocerst_in \"AMM12_LONG_${ITRST}_restart\"
742    set_namelist namelist_cfg nn_date0 20120102
743    for (( i=1; i<=$NPROC; i++)) ; do
744        L_NPROC=$(( $i - 1 ))
745        L_NPROC=`printf "%04d\n" ${L_NPROC}`
746        ln -sf ../LONG/AMM12_LONG_${ITRST}_restart_${L_NPROC}.nc .
747    done
748    set_namelist_opt namelist_cfg ln_timing ${USING_TIMING} .true. .false.
749    set_namelist_opt namelist_cfg nn_hls ${USING_EXTRA_HALO} 2 1
750    set_namelist_opt namelist_cfg nn_comm ${USING_COLLECTIVES} 2 1
751    set_namelist_opt namelist_cfg ln_tile ${USING_TILING} .true. .false.
752    set_xio_using_server iodef.xml ${USING_MPMD}
753    cd ${SETTE_DIR}
754    . ./prepare_job.sh input_AMM12.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
755    cd ${SETTE_DIR}
756    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
757
758fi
759
760if [ ${config} == "AMM12" ] && [ ${DO_REPRO} == "1" ] ;  then
761## Reproducibility tests for AMM12
762    export TEST_NAME="REPRO_8_4"
763    cd ${MAIN_DIR}
764    cd ${SETTE_DIR}
765    . ./prepare_exe_dir.sh
766    set_valid_dir
767    clean_valid_dir
768    JOB_FILE=${EXE_DIR}/run_job.sh
769    NPROC=32
770    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
771    cd ${EXE_DIR}
772    set_namelist namelist_cfg cn_exp \"AMM12_84\"
773    set_namelist namelist_cfg nn_it000 1
774    set_namelist namelist_cfg nn_itend ${ITEND}
775    set_namelist namelist_cfg jpni 8
776    set_namelist namelist_cfg jpnj 4
777    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
778    set_namelist_opt namelist_cfg ln_timing ${USING_TIMING} .true. .false.
779    set_namelist_opt namelist_cfg nn_hls ${USING_EXTRA_HALO} 2 1
780    set_namelist_opt namelist_cfg nn_comm ${USING_COLLECTIVES} 2 1
781    set_namelist_opt namelist_cfg ln_tile ${USING_TILING} .true. .false.
782    set_xio_using_server iodef.xml ${USING_MPMD}
783    cd ${SETTE_DIR}
784    . ./prepare_job.sh input_AMM12.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
785    cd ${SETTE_DIR}
786    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
787
788    cd ${SETTE_DIR}
789    export TEST_NAME="REPRO_4_8"
790    . ./prepare_exe_dir.sh
791    set_valid_dir
792    clean_valid_dir
793    JOB_FILE=${EXE_DIR}/run_job.sh
794    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
795    cd ${EXE_DIR}
796    set_namelist namelist_cfg cn_exp \"AMM12_48\"
797    set_namelist namelist_cfg nn_it000 1
798    set_namelist namelist_cfg nn_itend ${ITEND}
799    set_namelist namelist_cfg jpni 4
800    set_namelist namelist_cfg jpnj 8
801    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
802    set_namelist_opt namelist_cfg ln_timing ${USING_TIMING} .true. .false.
803    set_namelist_opt namelist_cfg nn_hls ${USING_EXTRA_HALO} 2 1
804    set_namelist_opt namelist_cfg nn_comm ${USING_COLLECTIVES} 2 1
805    set_namelist_opt namelist_cfg ln_tile ${USING_TILING} .true. .false.
806    set_xio_using_server iodef.xml ${USING_MPMD}
807    cd ${SETTE_DIR}
808    . ./prepare_job.sh input_AMM12.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
809    cd ${SETTE_DIR}
810    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
811fi
812
813
814# ---------
815# ORCA2_SAS_ICE
816# ---------
817if [ ${config} == "SAS" ] ;  then
818    SETTE_CONFIG="ORCA2_SAS_ICE"${SETTE_STG}
819    if [ $( echo ${CMP_NAM} | grep -ic debug ) -eq 1 ]
820    then
821   ITEND=16   # 1 day
822    else
823   ITEND=256  # 16 days
824    fi
825    ITRST=$( printf "%08d" $(( ${ITEND} / 2 )) )
826    cd ${MAIN_DIR}
827    #
828    # syncronisation if target directory/file exist (not done by makenemo)
829    sync_config  ORCA2_SAS_ICE ${SETTE_CONFIG} 'cfgs'
830    clean_config ORCA2_SAS_ICE ${SETTE_CONFIG} 'cfgs'
831    #
832    # ORCA2_SAS_ICE uses linssh so remove key_qco if added by default
833    . ./makenemo -m ${CMP_NAM} -n ${SETTE_CONFIG} -r ORCA2_SAS_ICE -j ${CMPL_CORES} add_key "${ADD_KEYS/key_qco/}" del_key "${DEL_KEYS}"
834fi
835if [ ${config} == "SAS" ] && [ ${DO_RESTART} == "1" ] ;  then
836## Restartability tests
837    export TEST_NAME="LONG"
838    cd ${SETTE_DIR}
839    . ./prepare_exe_dir.sh
840    set_valid_dir
841    clean_valid_dir
842    JOB_FILE=${EXE_DIR}/run_job.sh
843    NPROC=32
844    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
845    cd ${EXE_DIR}
846    set_namelist namelist_cfg cn_exp \"SAS\"
847    set_namelist namelist_cfg nn_it000 1
848    set_namelist namelist_cfg nn_itend ${ITEND}
849    set_namelist namelist_cfg nn_stock $(( ${ITEND} / 2 ))
850    set_namelist namelist_cfg jpni 4
851    set_namelist namelist_cfg jpnj 8
852    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
853    set_namelist namelist_ice_cfg ln_icediachk .true.
854    set_namelist_opt namelist_cfg ln_timing ${USING_TIMING} .true. .false.
855    set_namelist_opt namelist_cfg nn_hls ${USING_EXTRA_HALO} 2 1
856    set_namelist_opt namelist_cfg nn_comm ${USING_COLLECTIVES} 2 1
857    set_namelist_opt namelist_cfg ln_tile ${USING_TILING} .true. .false.
858    set_xio_using_server iodef.xml ${USING_MPMD}
859    cd ${SETTE_DIR}
860    . ./prepare_job.sh input_SAS.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
861
862    cd ${SETTE_DIR}
863    export TEST_NAME="SHORT"
864    . ./prepare_exe_dir.sh
865    set_valid_dir
866    clean_valid_dir
867    cd ${EXE_DIR}
868    set_namelist namelist_cfg cn_exp \"SAS\"
869    set_namelist namelist_cfg nn_it000 $(( ${ITEND} / 2 + 1 ))
870    set_namelist namelist_cfg nn_itend ${ITEND}
871    set_namelist namelist_cfg nn_stock $(( ${ITEND} / 2 ))
872    set_namelist namelist_cfg jpni 4
873    set_namelist namelist_cfg jpnj 8
874    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
875    set_namelist namelist_cfg ln_rstart .true.
876    set_namelist namelist_cfg nn_rstctl 2
877    set_namelist namelist_cfg nn_date0 010109
878    set_namelist namelist_cfg cn_ocerst_in \"SAS_${ITRST}_restart\"
879    set_namelist namelist_ice_cfg cn_icerst_in \"SAS_${ITRST}_restart_ice\"
880    set_namelist_opt namelist_cfg ln_timing ${USING_TIMING} .true. .false.
881    set_namelist_opt namelist_cfg nn_hls ${USING_EXTRA_HALO} 2 1
882    set_namelist_opt namelist_cfg nn_comm ${USING_COLLECTIVES} 2 1
883    set_namelist_opt namelist_cfg ln_tile ${USING_TILING} .true. .false.
884    set_xio_using_server iodef.xml ${USING_MPMD}
885    for (( i=1; i<=$NPROC; i++)) ; do
886        L_NPROC=$(( $i - 1 ))
887        L_NPROC=`printf "%04d\n" ${L_NPROC}`
888        ln -sf ../LONG/SAS_${ITRST}_restart_${L_NPROC}.nc .
889        ln -sf ../LONG/SAS_${ITRST}_restart_ice_${L_NPROC}.nc .
890    done
891    cd ${SETTE_DIR}
892    . ./prepare_job.sh input_SAS.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
893    cd ${SETTE_DIR}
894    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
895
896fi
897
898if [ ${config} == "SAS" ] && [ ${DO_REPRO} == "1" ] ;  then
899## Reproducibility tests
900    if [ $( echo ${CMP_NAM} | grep -ic debug ) -eq 1 ]
901    then
902   ITEND=16  # 1 day
903    else
904   ITEND=80  # 5 days
905    fi
906    export TEST_NAME="REPRO_4_8"
907    cd ${MAIN_DIR}
908    cd ${SETTE_DIR}
909    . ./prepare_exe_dir.sh
910    set_valid_dir
911    clean_valid_dir
912    JOB_FILE=${EXE_DIR}/run_job.sh
913    NPROC=32
914    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
915    cd ${EXE_DIR}
916    set_namelist namelist_cfg cn_exp \"SAS_48\"
917    set_namelist namelist_cfg nn_it000 1
918    set_namelist namelist_cfg nn_itend ${ITEND}
919    set_namelist namelist_cfg jpni 4
920    set_namelist namelist_cfg jpnj 8
921    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
922    set_namelist_opt namelist_cfg ln_timing ${USING_TIMING} .true. .false.
923    set_namelist_opt namelist_cfg nn_hls ${USING_EXTRA_HALO} 2 1
924    set_namelist_opt namelist_cfg nn_comm ${USING_COLLECTIVES} 2 1
925    set_namelist_opt namelist_cfg ln_tile ${USING_TILING} .true. .false.
926    set_xio_using_server iodef.xml ${USING_MPMD}
927    cd ${SETTE_DIR}
928    . ./prepare_job.sh input_SAS.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
929    cd ${SETTE_DIR}
930    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
931
932    cd ${SETTE_DIR}
933    export TEST_NAME="REPRO_8_4"
934    . ./prepare_exe_dir.sh
935    set_valid_dir
936    clean_valid_dir
937    JOB_FILE=${EXE_DIR}/run_job.sh
938    NPROC=32
939    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
940    cd ${EXE_DIR}
941    set_namelist namelist_cfg cn_exp \"SAS_84\"
942    set_namelist namelist_cfg nn_it000 1
943    set_namelist namelist_cfg nn_itend ${ITEND}
944    set_namelist namelist_cfg jpni 8
945    set_namelist namelist_cfg jpnj 4
946    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
947    set_namelist_opt namelist_cfg ln_timing ${USING_TIMING} .true. .false.
948    set_namelist_opt namelist_cfg nn_hls ${USING_EXTRA_HALO} 2 1
949    set_namelist_opt namelist_cfg nn_comm ${USING_COLLECTIVES} 2 1
950    set_namelist_opt namelist_cfg ln_tile ${USING_TILING} .true. .false.
951    set_xio_using_server iodef.xml ${USING_MPMD}
952    cd ${SETTE_DIR}
953    . ./prepare_job.sh input_SAS.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
954    cd ${SETTE_DIR}
955    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
956
957fi
958
959
960# --------------
961# ORCA2_ICE_OBS
962# --------------
963## Test assimilation interface code, OBS and ASM for reproducibility
964## Restartability not tested (ASM code not restartable while increments are being applied)
965if [ ${config} == "ORCA2_ICE_OBS" ] ;  then
966    SETTE_CONFIG="ORCA2_ICE_OBS"${SETTE_STG}
967## Reproducibility tests
968    if [ $( echo ${CMP_NAM} | grep -ic debug ) -eq 1 ]
969    then
970   ITEND=16  # 1 day
971    else
972   ITEND=80  # 5 days
973    fi
974    cd ${MAIN_DIR}
975    #
976    # syncronisation if target directory/file exist (not done by makenemo)
977    sync_config  ORCA2_ICE_PISCES ${SETTE_CONFIG} 'cfgs'
978    clean_config ORCA2_ICE_PISCES ${SETTE_CONFIG} 'cfgs'
979    #
980    . ./makenemo -m ${CMP_NAM} -n ${SETTE_CONFIG} -r ORCA2_ICE_PISCES -d "OCE ICE"  -j ${CMPL_CORES} add_key "key_asminc ${ADD_KEYS}" del_key "key_top ${DEL_KEYS}"
981fi
982if [ ${config} == "ORCA2_ICE_OBS" ] && [ ${DO_RESTART} == "1" ] ;  then
983## Reproducibility tests
984    export TEST_NAME="REPRO_4_8"
985    cd ${SETTE_DIR}
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_48\"
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 4
998    set_namelist namelist_cfg jpnj 8
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_namelist_opt namelist_cfg nn_hls ${USING_EXTRA_HALO} 2 1
1024    set_namelist_opt namelist_cfg nn_comm ${USING_COLLECTIVES} 2 1
1025    set_namelist_opt namelist_cfg ln_tile ${USING_TILING} .true. .false.
1026    set_xio_using_server iodef.xml ${USING_MPMD}
1027    cd ${SETTE_DIR}
1028    . ./prepare_job.sh input_ORCA2_ICE_OBS.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
1029    cd ${SETTE_DIR}
1030    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
1031
1032   cd ${SETTE_DIR}
1033    export TEST_NAME="REPRO_8_4"
1034    . ./prepare_exe_dir.sh
1035    set_valid_dir
1036    clean_valid_dir
1037    JOB_FILE=${EXE_DIR}/run_job.sh
1038    NPROC=32
1039    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
1040    cd ${EXE_DIR}
1041    set_namelist namelist_cfg cn_exp \"O2L3OBS_84\"
1042    set_namelist namelist_cfg nn_it000 1
1043    set_namelist namelist_cfg nn_itend ${ITEND}
1044    set_namelist namelist_cfg ln_read_cfg .true.
1045    set_namelist namelist_cfg jpni 8
1046    set_namelist namelist_cfg jpnj 4
1047    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
1048    set_namelist namelist_cfg sn_cfctl%l_trcstat .true.
1049    set_namelist namelist_cfg ln_diaobs .true.
1050    set_namelist namelist_cfg ln_t3d .true.
1051    set_namelist namelist_cfg ln_s3d .true.
1052    set_namelist namelist_cfg ln_sst .true.
1053    set_namelist namelist_cfg ln_sla .true.
1054    set_namelist namelist_cfg ln_sic .true.
1055    set_namelist namelist_cfg ln_vel3d .true.
1056    set_namelist namelist_cfg ln_bkgwri .true.
1057    set_namelist namelist_cfg ln_trainc .true.
1058    set_namelist namelist_cfg ln_dyninc .true.
1059    set_namelist namelist_cfg ln_sshinc .true.
1060    set_namelist namelist_cfg ln_asmiau .true.
1061    #remove all useless options for pisces (due to ORCA2_ICE_PISCES reference configuration)
1062    set_namelist namelist_top_cfg ln_trcdta .false.
1063    set_namelist namelist_top_cfg ln_trcbc  .false.
1064    # put ln_ironsed, ln_river, ln_ndepo, ln_dust to false
1065    # if not you need input files, and for tests is not necessary
1066    set_namelist namelist_pisces_cfg ln_varpar .false.
1067    set_namelist namelist_pisces_cfg ln_ironsed .false.
1068    set_namelist namelist_pisces_cfg ln_ironice .false.
1069    set_namelist namelist_pisces_cfg ln_hydrofe .false.
1070    set_namelist_opt namelist_cfg ln_timing ${USING_TIMING} .true. .false.
1071    set_namelist_opt namelist_cfg nn_hls ${USING_EXTRA_HALO} 2 1
1072    set_namelist_opt namelist_cfg nn_comm ${USING_COLLECTIVES} 2 1
1073    set_namelist_opt namelist_cfg ln_tile ${USING_TILING} .true. .false.
1074    set_xio_using_server iodef.xml ${USING_MPMD}
1075    cd ${SETTE_DIR}
1076    . ./prepare_job.sh input_ORCA2_ICE_OBS.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
1077    cd ${SETTE_DIR}
1078    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
1079fi
1080
1081# ------------
1082# AGRIF ICE
1083# -----------
1084if [ ${config} == "AGRIF" ] ;  then
1085    SETTE_CONFIG="AGRIF_DEMO"${SETTE_STG}
1086    if [ $( echo ${CMP_NAM} | grep -ic debug ) -eq 1 ]
1087    then
1088   ITEND=4   # 6h
1089    else
1090   ITEND=20  # 1d and 6h
1091    fi
1092    ITRST=$(   printf "%08d" $(( ${ITEND} / 2 )) )
1093    ITRST_1=$( printf "%08d" $(( ${ITEND} / 2 )) )
1094    ITRST_2=$( printf "%08d" $(( ${ITEND} * 4 / 2 )) )
1095    ITRST_3=$( printf "%08d" $(( ${ITEND} * 4 * 3 / 2 )) )
1096    cd ${MAIN_DIR}
1097    #
1098    # syncronisation if target directory/file exist (not done by makenemo)
1099    sync_config  AGRIF_DEMO ${SETTE_CONFIG} 'cfgs'
1100    clean_config AGRIF_DEMO ${SETTE_CONFIG} 'cfgs'
1101    #
1102    # AGRIF_DEMO does not yet support nn_hls=2 => key_loop_fusion can not be used
1103    . ./makenemo -m ${CMP_NAM} -n ${SETTE_CONFIG} -r AGRIF_DEMO -j ${CMPL_CORES} add_key "${ADD_KEYS/key_loop_fusion}" del_key "${DEL_KEYS}"
1104fi
1105if [ ${config} == "AGRIF" ] && [ ${DO_RESTART} == "1" ] ;  then
1106## Restartability tests
1107    export TEST_NAME="LONG"
1108    cd ${SETTE_DIR}
1109    . ./prepare_exe_dir.sh
1110    set_valid_dir
1111    clean_valid_dir
1112    JOB_FILE=${EXE_DIR}/run_job.sh
1113    NPROC=16
1114    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
1115    cd ${EXE_DIR}
1116    set_namelist namelist_cfg cn_exp \"AGRIF_LONG\"
1117    set_namelist namelist_cfg nn_it000 1
1118    set_namelist namelist_cfg nn_itend ${ITEND}
1119    set_namelist namelist_cfg nn_stock $(( ${ITEND} / 2 ))
1120    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
1121    #set_namelist_opt namelist_cfg ln_timing ${USING_TIMING} .true. .false.
1122    set_namelist 1_namelist_cfg cn_exp \"AGRIF_LONG\"
1123    set_namelist 1_namelist_cfg nn_it000 1
1124    set_namelist 1_namelist_cfg nn_itend ${ITEND}
1125    set_namelist 1_namelist_cfg nn_stock $(( ${ITEND} / 2 ))
1126    set_namelist 1_namelist_cfg sn_cfctl%l_runstat .true.
1127    set_namelist 2_namelist_cfg cn_exp \"AGRIF_LONG\"
1128    set_namelist 2_namelist_cfg nn_it000 1
1129    set_namelist 2_namelist_cfg nn_itend $(( ${ITEND} * 4 ))
1130    set_namelist 2_namelist_cfg nn_stock $(( ${ITEND} * 4 / 2 ))
1131    set_namelist 2_namelist_cfg sn_cfctl%l_runstat .true.
1132    set_namelist 3_namelist_cfg cn_exp \"AGRIF_LONG\"
1133    set_namelist 3_namelist_cfg nn_it000 1
1134    set_namelist 3_namelist_cfg nn_itend $(( ${ITEND} * 4 * 3 ))
1135    set_namelist 3_namelist_cfg nn_stock $(( ${ITEND} * 4 * 3 / 2 ))
1136    set_namelist 3_namelist_cfg sn_cfctl%l_runstat .true.
1137
1138    set_xio_using_server iodef.xml ${USING_MPMD}
1139    cd ${SETTE_DIR}
1140    . ./prepare_job.sh input_AGRIF.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
1141   
1142    cd ${SETTE_DIR}
1143    export TEST_NAME="SHORT"
1144    . ./prepare_exe_dir.sh
1145    set_valid_dir
1146    clean_valid_dir
1147    cd ${EXE_DIR}
1148    set_namelist namelist_cfg cn_exp \"AGRIF_SHORT\"
1149    set_namelist namelist_cfg nn_it000 $(( ${ITEND} / 2 + 1 ))
1150    set_namelist namelist_cfg nn_itend ${ITEND}
1151    set_namelist namelist_cfg nn_stock $(( ${ITEND} / 2 ))
1152    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
1153    set_namelist namelist_cfg ln_rstart .true.
1154    set_namelist namelist_cfg nn_rstctl 2
1155    #set_namelist_opt namelist_cfg ln_timing ${USING_TIMING} .true. .false.
1156    set_namelist 1_namelist_cfg cn_exp \"AGRIF_SHORT\"
1157    set_namelist 1_namelist_cfg nn_it000 $(( ${ITEND} / 2 + 1 ))
1158    set_namelist 1_namelist_cfg nn_itend ${ITEND}
1159    set_namelist 1_namelist_cfg nn_stock $(( ${ITEND} / 2 ))
1160    set_namelist 1_namelist_cfg sn_cfctl%l_runstat .true.
1161    set_namelist 1_namelist_cfg ln_rstart .true.
1162    set_namelist 1_namelist_cfg nn_rstctl 2
1163    set_namelist 2_namelist_cfg cn_exp \"AGRIF_SHORT\"
1164    set_namelist 2_namelist_cfg nn_it000 $(( ${ITEND} * 4 / 2 + 1 ))
1165    set_namelist 2_namelist_cfg nn_itend $(( ${ITEND} * 4 ))
1166    set_namelist 2_namelist_cfg nn_stock $(( ${ITEND} * 4 / 2 ))
1167    set_namelist 2_namelist_cfg sn_cfctl%l_runstat .true.
1168    set_namelist 2_namelist_cfg ln_rstart .true.
1169    set_namelist 2_namelist_cfg nn_rstctl 2
1170    set_namelist 3_namelist_cfg cn_exp \"AGRIF_SHORT\"
1171    set_namelist 3_namelist_cfg nn_it000 $(( ${ITEND} * 4 * 3 / 2 + 1 ))
1172    set_namelist 3_namelist_cfg nn_itend $(( ${ITEND} * 4 * 3 ))
1173    set_namelist 3_namelist_cfg nn_stock $(( ${ITEND} * 4 * 3 / 2 ))
1174    set_namelist 3_namelist_cfg sn_cfctl%l_runstat .true.
1175    set_namelist 3_namelist_cfg ln_rstart .true.
1176    set_namelist 3_namelist_cfg nn_rstctl 2
1177    set_namelist namelist_cfg cn_ocerst_in \"AGRIF_LONG_${ITRST}_restart\"
1178    set_namelist namelist_ice_cfg cn_icerst_in \"AGRIF_LONG_${ITRST}_restart_ice\"
1179    set_namelist 1_namelist_cfg cn_ocerst_in \"AGRIF_LONG_${ITRST_1}_restart\"
1180    set_namelist 1_namelist_ice_cfg cn_icerst_in \"AGRIF_LONG_${ITRST_1}_restart_ice\"
1181    set_namelist 2_namelist_cfg cn_ocerst_in \"AGRIF_LONG_${ITRST_2}_restart\"
1182    set_namelist 2_namelist_ice_cfg cn_icerst_in \"AGRIF_LONG_${ITRST_2}_restart_ice\"
1183    set_namelist 3_namelist_cfg cn_ocerst_in \"AGRIF_LONG_${ITRST_3}_restart\"
1184    set_namelist 3_namelist_ice_cfg cn_icerst_in \"AGRIF_LONG_${ITRST_3}_restart_ice\"
1185
1186    for (( i=1; i<=$NPROC; i++)) ; do
1187        L_NPROC=$(( $i - 1 ))
1188        L_NPROC=`printf "%04d\n" ${L_NPROC}`
1189        ln -sf ../LONG/AGRIF_LONG_${ITRST}_restart_${L_NPROC}.nc .
1190        ln -sf ../LONG/AGRIF_LONG_${ITRST}_restart_ice_${L_NPROC}.nc .
1191        ln -sf ../LONG/1_AGRIF_LONG_${ITRST_1}_restart_${L_NPROC}.nc .
1192        ln -sf ../LONG/1_AGRIF_LONG_${ITRST_1}_restart_ice_${L_NPROC}.nc .
1193        ln -sf ../LONG/2_AGRIF_LONG_${ITRST_2}_restart_${L_NPROC}.nc .
1194        ln -sf ../LONG/2_AGRIF_LONG_${ITRST_2}_restart_ice_${L_NPROC}.nc .
1195        ln -sf ../LONG/3_AGRIF_LONG_${ITRST_3}_restart_${L_NPROC}.nc .
1196        ln -sf ../LONG/3_AGRIF_LONG_${ITRST_3}_restart_ice_${L_NPROC}.nc .
1197    done
1198    set_xio_using_server iodef.xml ${USING_MPMD}
1199    cd ${SETTE_DIR}
1200    . ./prepare_job.sh input_AGRIF.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
1201    cd ${SETTE_DIR}
1202    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
1203
1204fi
1205
1206if [ ${config} == "AGRIF" ] && [ ${DO_REPRO} == "1" ] ;  then
1207## Reproducibility tests
1208    export TEST_NAME="REPRO_2_8"
1209    cd ${MAIN_DIR}
1210    cd ${SETTE_DIR}
1211    . ./prepare_exe_dir.sh
1212    set_valid_dir
1213    clean_valid_dir
1214    JOB_FILE=${EXE_DIR}/run_job.sh
1215    NPROC=16
1216    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
1217    cd ${EXE_DIR}
1218    set_namelist namelist_cfg cn_exp \"AGRIF_28\"
1219    set_namelist namelist_cfg nn_it000 1
1220    set_namelist namelist_cfg nn_itend ${ITEND}
1221    set_namelist namelist_cfg jpni 2
1222    set_namelist namelist_cfg jpnj 8
1223    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
1224    #set_namelist_opt namelist_cfg ln_timing ${USING_TIMING} .true. .false.
1225    set_namelist 1_namelist_cfg cn_exp \"AGRIF_28\"
1226    set_namelist 1_namelist_cfg nn_it000 1
1227    set_namelist 1_namelist_cfg nn_itend ${ITEND}
1228    set_namelist 1_namelist_cfg jpni 2
1229    set_namelist 1_namelist_cfg jpnj 8
1230    set_namelist 1_namelist_cfg sn_cfctl%l_runstat .true.
1231    set_namelist 2_namelist_cfg cn_exp \"AGRIF_28\"
1232    set_namelist 2_namelist_cfg nn_it000 1
1233    set_namelist 2_namelist_cfg nn_itend $(( ${ITEND} * 4 ))
1234    set_namelist 2_namelist_cfg jpni 2
1235    set_namelist 2_namelist_cfg jpnj 8
1236    set_namelist 2_namelist_cfg sn_cfctl%l_runstat .true.
1237    set_namelist 3_namelist_cfg cn_exp \"AGRIF_28\"
1238    set_namelist 3_namelist_cfg nn_it000 1
1239    set_namelist 3_namelist_cfg nn_itend $(( ${ITEND} * 4 * 3 ))
1240    set_namelist 3_namelist_cfg jpni 2
1241    set_namelist 3_namelist_cfg jpnj 8
1242    set_namelist 3_namelist_cfg sn_cfctl%l_runstat .true.
1243
1244    set_xio_using_server iodef.xml ${USING_MPMD}
1245    cd ${SETTE_DIR}
1246    . ./prepare_job.sh input_AGRIF.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
1247    cd ${SETTE_DIR}
1248    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
1249
1250    cd ${SETTE_DIR}
1251    export TEST_NAME="REPRO_4_4"
1252    . ./prepare_exe_dir.sh
1253    set_valid_dir
1254    clean_valid_dir
1255    JOB_FILE=${EXE_DIR}/run_job.sh
1256    NPROC=16
1257    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
1258    cd ${EXE_DIR}
1259    set_namelist namelist_cfg cn_exp \"AGRIF_44\"
1260    set_namelist namelist_cfg nn_it000 1
1261    set_namelist namelist_cfg nn_itend ${ITEND}
1262    set_namelist namelist_cfg jpni 4
1263    set_namelist namelist_cfg jpnj 4
1264    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
1265    #set_namelist_opt namelist_cfg ln_timing ${USING_TIMING} .true. .false.
1266    set_xio_using_server iodef.xml ${USING_MPMD}
1267    set_namelist 1_namelist_cfg cn_exp \"AGRIF_44\"
1268    set_namelist 1_namelist_cfg nn_it000 1
1269    set_namelist 1_namelist_cfg nn_itend ${ITEND}
1270    set_namelist 1_namelist_cfg jpni 4
1271    set_namelist 1_namelist_cfg jpnj 4
1272    set_namelist 1_namelist_cfg sn_cfctl%l_runstat .true.
1273    set_namelist 2_namelist_cfg cn_exp \"AGRIF_44\"
1274    set_namelist 2_namelist_cfg nn_it000 1
1275    set_namelist 2_namelist_cfg nn_itend $(( ${ITEND} * 4 ))
1276    set_namelist 2_namelist_cfg jpni 4
1277    set_namelist 2_namelist_cfg jpnj 4
1278    set_namelist 2_namelist_cfg sn_cfctl%l_runstat .true.
1279    set_namelist 3_namelist_cfg cn_exp \"AGRIF_44\"
1280    set_namelist 3_namelist_cfg nn_it000 1
1281    set_namelist 3_namelist_cfg nn_itend $(( ${ITEND} * 4 * 3 ))
1282    set_namelist 3_namelist_cfg jpni 4
1283    set_namelist 3_namelist_cfg jpnj 4
1284    set_namelist 3_namelist_cfg sn_cfctl%l_runstat .true.
1285
1286    cd ${SETTE_DIR}
1287    . ./prepare_job.sh input_AGRIF.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
1288    cd ${SETTE_DIR}
1289    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
1290
1291fi
1292
1293if [ ${config} == "AGRIF" ] && [ ${DO_CORRUPT} == "1" ] ;  then
1294## test code corruption with AGRIF (phase 1) ==> Compile with key_agrif but run with no zoom
1295    if [ $( echo ${CMP_NAM} | grep -ic debug ) -eq 1 ]
1296    then
1297   ITEND=16   # 1d
1298    else
1299   ITEND=150  # 5d and 9h
1300    fi
1301    export TEST_NAME="ORCA2"
1302    cd ${MAIN_DIR}
1303    cd ${SETTE_DIR}
1304    . ./prepare_exe_dir.sh
1305    set_valid_dir
1306    clean_valid_dir
1307    JOB_FILE=${EXE_DIR}/run_job.sh
1308    NPROC=32
1309    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
1310    cd ${EXE_DIR}
1311    set_namelist namelist_cfg cn_exp \"ORCA2\"
1312    set_namelist namelist_cfg nn_it000 1
1313    set_namelist namelist_cfg nn_itend ${ITEND}
1314    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
1315    #set_namelist_opt namelist_cfg ln_timing ${USING_TIMING} .true. .false.
1316
1317#   Set the number of fine grids to zero:   
1318    sed -i "1s/.*/0/" ${EXE_DIR}/AGRIF_FixedGrids.in
1319
1320    set_xio_using_server iodef.xml ${USING_MPMD}
1321    cd ${SETTE_DIR}
1322    . ./prepare_job.sh input_AGRIF.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
1323    cd ${SETTE_DIR}
1324    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
1325
1326fi
1327
1328
1329## test code corruption with AGRIF (phase 2) ==> Compile without key_agrif (to be compared with AGRIF_DEMO_ST/ORCA2)
1330if [ ${config} == "AGRIF" ] && [ ${DO_CORRUPT} == "1" ] ;  then
1331    SETTE_CONFIG="AGRIF_DEMO_NOAGRIF"${SETTE_STG}
1332    export TEST_NAME="ORCA2"
1333    cd ${MAIN_DIR}
1334    #
1335    # syncronisation if target directory/file exist (not done by makenemo)
1336    sync_config  AGRIF_DEMO ${SETTE_CONFIG} 'cfgs'
1337    clean_config AGRIF_DEMO ${SETTE_CONFIG} 'cfgs'
1338    #
1339    # AGRIF_DEMO does not yet support nn_hls=2 => key_loop_fusion can not be used
1340    . ./makenemo -m ${CMP_NAM} -n ${SETTE_CONFIG} -r AGRIF_DEMO -j ${CMPL_CORES} add_key "${ADD_KEYS/key_loop_fusion}" del_key "key_agrif ${DEL_KEYS}"
1341    cd ${SETTE_DIR}
1342    . ./prepare_exe_dir.sh
1343    set_valid_dir
1344    clean_valid_dir
1345    JOB_FILE=${EXE_DIR}/run_job.sh
1346    NPROC=32
1347    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
1348    cd ${EXE_DIR}
1349    set_namelist namelist_cfg cn_exp \"ORCA2\"
1350    set_namelist namelist_cfg nn_it000 1
1351    set_namelist namelist_cfg nn_itend ${ITEND}
1352    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
1353    #set_namelist_opt namelist_cfg ln_timing ${USING_TIMING} .true. .false.
1354#
1355    set_xio_using_server iodef.xml ${USING_MPMD}
1356    cd ${SETTE_DIR}
1357    . ./prepare_job.sh input_AGRIF.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
1358    cd ${SETTE_DIR}
1359    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
1360
1361fi
1362
1363# -------
1364# WED025
1365# -------
1366if [ ${config} == "WED025" ] ;  then
1367    SETTE_CONFIG="WED025"${SETTE_STG}
1368    if [ $( echo ${CMP_NAM} | grep -ic debug ) -eq 1 ]
1369    then
1370   ITEND=12   # 4h
1371    else
1372   ITEND=720  # 10 days
1373    fi
1374    ITRST=$( printf "%08d" $(( ${ITEND} / 2 )) )
1375    cd ${MAIN_DIR}
1376    #
1377    # syncronisation if target directory/file exist (not done by makenemo)
1378    sync_config  WED025 ${SETTE_CONFIG} 'cfgs'
1379    clean_config WED025 ${SETTE_CONFIG} 'cfgs'
1380    #
1381    # WED025 uses ln_hpg_isf so remove key_qco if added by default
1382    . ./makenemo -m ${CMP_NAM} -n ${SETTE_CONFIG} -r WED025 -j ${CMPL_CORES} add_key "${ADD_KEYS/key_qco/}" del_key "${DEL_KEYS}"
1383fi
1384if [ ${config} == "WED025" ] && [ ${DO_RESTART} == "1" ] ;  then
1385## Restartability tests
1386    export TEST_NAME="LONG"
1387    cd ${SETTE_DIR}
1388    . ./prepare_exe_dir.sh
1389    set_valid_dir
1390    clean_valid_dir
1391    JOB_FILE=${EXE_DIR}/run_job.sh
1392    NPROC=32
1393    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
1394    cd ${EXE_DIR}
1395    set_namelist namelist_cfg cn_exp \"WED025_LONG\"
1396    set_namelist namelist_cfg nn_it000 1
1397    set_namelist namelist_cfg nn_itend ${ITEND}
1398    set_namelist namelist_cfg nn_stock $(( ${ITEND} / 2 ))
1399    set_namelist namelist_cfg nn_date0 20000115
1400    set_namelist namelist_cfg jpni 4
1401    set_namelist namelist_cfg jpnj 8
1402    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
1403    #set_namelist namelist_ice_cfg ln_icediachk .true.
1404    set_namelist_opt namelist_cfg ln_timing ${USING_TIMING} .true. .false.
1405    set_namelist_opt namelist_cfg nn_hls ${USING_EXTRA_HALO} 2 1
1406    set_namelist_opt namelist_cfg nn_comm ${USING_COLLECTIVES} 2 1
1407    set_namelist_opt namelist_cfg ln_tile ${USING_TILING} .true. .false.
1408    set_xio_using_server iodef.xml ${USING_MPMD}
1409    cd ${SETTE_DIR}
1410    . ./prepare_job.sh input_WED025.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
1411   
1412    cd ${SETTE_DIR}
1413    export TEST_NAME="SHORT"
1414    . ./prepare_exe_dir.sh
1415    set_valid_dir
1416    clean_valid_dir
1417    cd ${EXE_DIR}
1418    set_namelist namelist_cfg cn_exp \"WED025_SHORT\"
1419    set_namelist namelist_cfg nn_it000 $(( ${ITEND} / 2 + 1 ))
1420    set_namelist namelist_cfg nn_itend ${ITEND}
1421    set_namelist namelist_cfg nn_stock $(( ${ITEND} / 2 ))
1422    set_namelist namelist_cfg ln_rstart .true.
1423    set_namelist namelist_cfg nn_rstctl 2
1424    set_namelist namelist_cfg jpni 4
1425    set_namelist namelist_cfg jpnj 8
1426    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
1427    set_namelist namelist_cfg cn_ocerst_in \"WED025_LONG_${ITRST}_restart\"
1428    set_namelist namelist_ice_cfg cn_icerst_in \"WED025_LONG_${ITRST}_restart_ice\"
1429    for (( i=1; i<=$NPROC; i++)) ; do
1430        L_NPROC=$(( $i - 1 ))
1431        L_NPROC=`printf "%04d\n" ${L_NPROC}`
1432        ln -sf ../LONG/WED025_LONG_${ITRST}_restart_${L_NPROC}.nc .
1433        ln -sf ../LONG/WED025_LONG_${ITRST}_restart_ice_${L_NPROC}.nc .
1434    done
1435    set_namelist_opt namelist_cfg ln_timing ${USING_TIMING} .true. .false.
1436    set_namelist_opt namelist_cfg nn_hls ${USING_EXTRA_HALO} 2 1
1437    set_namelist_opt namelist_cfg nn_comm ${USING_COLLECTIVES} 2 1
1438    set_namelist_opt namelist_cfg ln_tile ${USING_TILING} .true. .false.
1439    set_xio_using_server iodef.xml ${USING_MPMD}
1440    cd ${SETTE_DIR}
1441    . ./prepare_job.sh input_WED025.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
1442    cd ${SETTE_DIR}
1443    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
1444
1445fi
1446
1447if [ ${config} == "WED025" ] && [ ${DO_REPRO} == "1" ] ;  then
1448## Reproducibility tests
1449    export TEST_NAME="REPRO_5_6"
1450    cd ${MAIN_DIR}
1451    cd ${SETTE_DIR}
1452    . ./prepare_exe_dir.sh
1453    set_valid_dir
1454    clean_valid_dir
1455    JOB_FILE=${EXE_DIR}/run_job.sh
1456    NPROC=32
1457    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
1458    cd ${EXE_DIR}
1459    set_namelist namelist_cfg cn_exp \"WED025_56\"
1460    set_namelist namelist_cfg nn_it000 1
1461    set_namelist namelist_cfg nn_itend ${ITEND}
1462    set_namelist namelist_cfg nn_date0 20000115
1463    set_namelist namelist_cfg jpni 6
1464    set_namelist namelist_cfg jpnj 7
1465    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
1466    set_namelist_opt namelist_cfg ln_timing ${USING_TIMING} .true. .false.
1467    set_namelist_opt namelist_cfg nn_hls ${USING_EXTRA_HALO} 2 1
1468    set_namelist_opt namelist_cfg nn_comm ${USING_COLLECTIVES} 2 1
1469    set_namelist_opt namelist_cfg ln_tile ${USING_TILING} .true. .false.
1470    set_xio_using_server iodef.xml ${USING_MPMD}
1471    cd ${SETTE_DIR}
1472    . ./prepare_job.sh input_WED025.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
1473    cd ${SETTE_DIR}
1474    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
1475
1476    cd ${SETTE_DIR}
1477    export TEST_NAME="REPRO_8_4"
1478    . ./prepare_exe_dir.sh
1479    set_valid_dir
1480    clean_valid_dir
1481    JOB_FILE=${EXE_DIR}/run_job.sh
1482    NPROC=32
1483    if [ -f ${JOB_FILE} ] ; then \rm ${JOB_FILE} ; fi
1484    cd ${EXE_DIR}
1485    set_namelist namelist_cfg cn_exp \"WED025_84\"
1486    set_namelist namelist_cfg nn_it000 1
1487    set_namelist namelist_cfg nn_itend ${ITEND}
1488    set_namelist namelist_cfg nn_date0 20000115
1489    set_namelist namelist_cfg jpni 8
1490    set_namelist namelist_cfg jpnj 4
1491    set_namelist namelist_cfg sn_cfctl%l_runstat .true.
1492    set_namelist_opt namelist_cfg ln_timing ${USING_TIMING} .true. .false.
1493    set_namelist_opt namelist_cfg nn_hls ${USING_EXTRA_HALO} 2 1
1494    set_namelist_opt namelist_cfg nn_comm ${USING_COLLECTIVES} 2 1
1495    set_namelist_opt namelist_cfg ln_tile ${USING_TILING} .true. .false.
1496    set_xio_using_server iodef.xml ${USING_MPMD}
1497    cd ${SETTE_DIR}
1498    . ./prepare_job.sh input_WED025.cfg $NPROC ${TEST_NAME} ${MPIRUN_FLAG} ${JOB_FILE} ${NUM_XIOSERVERS} ${NEMO_VALID}
1499    cd ${SETTE_DIR}
1500    . ./fcm_job.sh $NPROC ${JOB_FILE} ${INTERACT_FLAG} ${MPIRUN_FLAG}
1501fi
1502
1503
1504done
1505#
1506# Return to SETTE_DIR (last fcm_job.sh will have moved to EXE_DIR)
1507cd ${SETTE_DIR}
Note: See TracBrowser for help on using the repository browser.