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

source: utils/CI/sette_ticket2496/sette_reference-configurations.sh @ 13658

Last change on this file since 13658 was 13639, checked in by mocavero, 4 years ago

Added key_mpi3 in sette to activate/deactivate the use of MPI3 neighborhood collectives lbc routines - ticket #2496

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