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

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

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

Last change on this file since 14821 was 14821, checked in by hadcv, 3 years ago

#2600: Add USING_TILING switch to SETTE

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