Index: configs/testing/bash/build.sh
===================================================================
--- configs/testing/bash/build.sh	(revision 506)
+++ configs/testing/bash/build.sh	(revision 506)
@@ -0,0 +1,42 @@
+#!/bin/bash
+
+function build_dynamico()
+{
+    NAME=$1 ; shift
+    BUILD=$ROOT/DYNAMICO_$NAME
+    LOGFILE=$ROOT/logs/dynamico_${NAME}.log
+    cd $ROOT/DYNAMICO_$NAME
+    echo "In $PWD : building DYNAMICO with options $*"
+    echo "Watch logfile $LOGFILE"
+#    ./make_icosa -full -arch $arch -job $job $* > $LOGFILE 2>&1 || ( tail $LOGFILE ; exit 1 )
+    ./make_icosa -arch $arch -job $job $* > $LOGFILE 2>&1 || ( tail $LOGFILE ; exit 1 )
+    cp -pr $BUILD/bin/icosa_gcm.exe  $ROOT/bin/icosa_$NAME.exe
+}
+
+function main()
+{  
+    LOGFILE=$ROOT/logs/build_xios.log
+    cd $ROOT/XIOS
+    echo "In $PWD : Building XIOS"
+    echo "Watch logfile $LOGFILE"
+    ./make_xios --arch $arch --job $job > $LOGFILE 2>&1 || ( tail $LOGFILE ; exit 1 )    
+    cd $ROOT
+    # compile all variants in parallel
+    build_dynamico serial -parallel none $FULL &
+    build_dynamico mpi -parallel mpi -with_xios $FULL &
+    build_dynamico mpi_omp -parallel mpi_omp -with_xios $FULL &
+    wait
+    # check success
+    ls bin/icosa_serial.exe || exit 1
+    ls bin/icosa_mpi.exe || exit 1
+    ls bin/icosa_mpi_omp.exe || exit 1
+}
+
+FULL=$1
+source current_args
+rm -rf bin logs
+mkdir bin logs
+( main ) || ( echo ; echo "***************** Build FAILED ******************" )
+
+echo
+echo "You may now run create_runs.sh"
Index: configs/testing/bash/create_runs.sh
===================================================================
--- configs/testing/bash/create_runs.sh	(revision 506)
+++ configs/testing/bash/create_runs.sh	(revision 506)
@@ -0,0 +1,143 @@
+#!/bin/bash
+
+function create_exp() { # executable expname output_grid output_freq  - $* passed to rundef_$expname 
+    EXEC=$1 ; shift
+    EXP=$1 ; shift
+    OUTPUT_GRID=$1 ; shift
+    OUTPUT_FREQ=$1 ; shift
+    EXPDIR=${EXP}_${EXEC}_$1
+    echo "Creating $EXPDIR"
+    rm -rf $EXPDIR
+    mkdir $EXPDIR
+    cd $EXPDIR
+    ln -sf $ROOT/bin/icosa_${EXEC}.exe gcm.exe
+    ln -sf $ROOT/python/post_${EXP}.py post.py
+    rundef_$EXP $* > tmp.def
+    sort tmp.def | cut -c 7- > run.def
+    rm -f tmp.def
+    xml_iodef > iodef.xml
+    xml_icosa > icosa.xml
+    xml_field_def > field_def.xml
+    xml_dcmip $EXP $OUTPUT_GRID $OUTPUT_FREQ > filedef_dcmip2016.xml
+    job_${EXP} ${EXEC} $* > job.sh
+    cd ..
+}
+
+function rundef_all() {
+    cat <<EOF
+100   #------------- Planet ---------------
+200   #------------- Dynamics  ------------
+300   #-------------- Mesh ----------------
+400   #------------ Numerics --------------
+500   #----------- Dissipation ------------
+600   #-------------- Physics -------------
+700   #---------------- Run ---------------
+EOF
+}
+
+function setvar()
+{
+    while (($# > 1)) ; do
+	ii=${idx[$1]}
+	echo "$ii   $1=$2"
+	shift ; shift
+    done
+}
+function order()
+{
+    ii=$1 ; shift
+    for name in $* ; do
+	((ii+=1))
+       idx[${name}]=$ii
+#       echo $name ${idx[${name}]}
+    done
+}
+
+#----------------------------- pre-defined resolutions ---------------------------
+
+function set_nbp_40() {
+    setvar dt 480 optim_it 500
+    split_${EXEC}_40
+}
+
+function set_nbp_80() {
+    setvar dt 240 optim_it 1000
+    split_${EXEC}_80
+}
+
+#-------------------------------- Williamson (1991) ------------------------------
+
+function rundef_W91() {
+    NBP=$1 ; TAU=$2
+    rundef_all
+    set_nbp_$NBP
+    setvar caldyn_conserv enstrophy caldyn_eta eta_lag boussinesq .TRUE. llm 1 radius 6.37122e6 g 9.80616
+    setvar nitergdiv 2 nitergrot 2 niterdivgrad 2 tau_graddiv $TAU tau_gradrot $TAU tau_divgrad $TAU
+    setvar write_period 86400 run_length 2592000 etat0 williamson91.6
+}
+
+function job_W91() {
+    job_$1_$2 W91_$1
+}
+
+#------------------------------------- DCMIP3.1 ----------------------------------
+
+function rundef_DCMIP(){
+    rundef_all
+    set_nbp_$1
+    setvar radius 6.37122e6 g 9.80616 kappa 0.2857143 cpp 1004.5 preff 1e5
+    setvar nitergdiv 2 nitergrot 2 niterdivgrad 2 tau_graddiv
+}
+
+function rundef_DCMIP31() { # NBP TAU
+    NBP=$1 ; TAU=$2
+    rundef_DCMIP $NBP
+    setvar hydrostatic .FALSE.
+    setvar omega 0. llm 10 disvert ncar ncar_T0 300 ncar_p0 1e5 ncar_disvert_c 1 ncar_dz 1000 
+    setvar tau_graddiv $TAU tau_gradrot $TAU tau_divgrad $TAU 
+    setvar scale_factor 125 write_period 7500 run_length 4.5e5 etat0 dcmip3
+}
+function rundef_DCMIP41() { # NBP TAU
+    NBP=$1 ; TAU=$2
+    rundef_DCMIP $NBP
+#    setvar hydrostatic .FALSE.
+    setvar omega 7.292e-5 llm 30 disvert ncarl30 nqtot 2 itau_adv 3
+    setvar tau_graddiv $TAU tau_gradrot $TAU tau_divgrad $TAU
+    setvar write_period 21600 run_length 2592000 etat0 dcmip4 dcmip4_testcase 1
+}
+
+function job_DCMIP31() { # EXEC NBP
+    job_$1_$2 DCMIP31_$1 # e.g. job_mpi_80 DCMIP31_mpi
+}
+function job_DCMIP41() { # EXEC NBP
+    job_$1_$2 DCMIP41_$1
+}
+
+#----------------------------- END ----------------------------
+
+function main()
+{
+    rm -rf RUNS
+    mkdir RUNS
+    cd RUNS
+# the number associated to each run.def parameter is used to sort the lines and order them in a logical way
+    declare -A idx
+    order 100 radius omega g cpp kappa preff scale_factor
+    order 200 boussinesq hydrostatic
+    order 300 nbp optim_it nsplit_i nsplit_j llm disvert ncar_disvert_c ncar_dz ncar_T0 ncar_p0
+    order 400 caldyn_eta time_scheme caldyn_conserv dt nqtot itau_adv
+    order 500 nitergdiv tau_graddiv nitergrot tau_gradrot niterdivgrad tau_divgrad
+    order 700 run_length write_period etat0 dcmip4_testcase
+# Williamson 1991
+#    create_exp serial W91 40 5000 # nbp tau
+#    create_exp mpi W91 40 5000 # nbp tau
+# DCMIP 2012 
+    create_exp mpi DCMIP31 two_degree 60s 40 90000 # nbp tau 
+    create_exp mpi DCMIP41 two_degree 24h 40 10000 # nbp tau 
+}
+
+source current_args
+source bash/${arch}.sh
+source bash/xml.sh
+ROOT=$PWD
+main
Index: configs/testing/bash/daily.sh
===================================================================
--- configs/testing/bash/daily.sh	(revision 504)
+++ configs/testing/bash/daily.sh	(revision 506)
@@ -30,4 +30,5 @@
 if [[ $XIOS_CUR != $XIOS_HEAD ]]; then
     echo "XIOS needs an update from r$XIOS_CUR to r$XIOS_HEAD"
+    FULL="-full" # trigger full recompilation of DYNAMICO
     UPDATE=y
 fi
@@ -37,6 +38,6 @@
     update XIOS || exit 1
     update DYNAMICO || exit 1
-    ./build.sh || exit 1
-    ./create_runs.sh || exit 1
-    ./submit.sh || exit 1
+    bash/build.sh $FULL || exit 1
+    bash/create_runs.sh || exit 1
+    bash/submit.sh || exit 1
 fi
Index: configs/testing/bash/job.sh
===================================================================
--- configs/testing/bash/job.sh	(revision 504)
+++ 	(revision )
@@ -1,18 +1,0 @@
-#!/bin/bash
-## Request name
-#MSUB -r build_testing
-#MSUB -q standard 
-#MSUB -A gen7548
-#MSUB -x
-## Number of tasks (=MPI processes) to use
-#MSUB -n 1
-## Elapsed time limit in seconds
-#MSUB -T 1200
-## Quality of Service required (long [3 days], normal [1 day], test [30 min])
-#MSUB -Q test
-
-export OMP_NUM_THREADS=1
-cd ${BRIDGE_MSUB_PWD} 
-
-time ./build.sh > logs/build.sh.log
-
Index: configs/testing/bash/junk/job.sh
===================================================================
--- configs/testing/bash/junk/job.sh	(revision 506)
+++ configs/testing/bash/junk/job.sh	(revision 506)
@@ -0,0 +1,18 @@
+#!/bin/bash
+## Request name
+#MSUB -r build_testing
+#MSUB -q standard 
+#MSUB -A gen7548
+#MSUB -x
+## Number of tasks (=MPI processes) to use
+#MSUB -n 1
+## Elapsed time limit in seconds
+#MSUB -T 1200
+## Quality of Service required (long [3 days], normal [1 day], test [30 min])
+#MSUB -Q test
+
+export OMP_NUM_THREADS=1
+cd ${BRIDGE_MSUB_PWD} 
+
+time ./build.sh > logs/build.sh.log
+
Index: configs/testing/bash/junk/testing.sh
===================================================================
--- configs/testing/bash/junk/testing.sh	(revision 506)
+++ configs/testing/bash/junk/testing.sh	(revision 506)
@@ -0,0 +1,319 @@
+#!/bin/bash
+
+#################################### Site-specific functions #######################
+# In order to accomodate various computing environments, testing.sh relies on the following 
+# site-specific functions which must be provided by include_site.sh
+#
+# submit_run_and_post EXP
+#   Submit the run job run.job to the batch scheduler
+#   Submit the post-processing job post.job to the batch scheduler 
+#   so that it starts after successful completion of run.job
+#
+# qstat
+#   Display cluster status : jobs running, waiting, ect.
+#
+# print_run_job()
+#   Print run.job on standard output
+#   Standard output is redirected to run.job by caller
+#
+# print_post_job()
+#   Print beginning of post.job on standard output. The caller will print additional lines depending on the test case.
+#   Standard output is redirected to file post.job by caller
+#   Script post.job must source include_site.sh, include_post.sh 
+#   and either include_post_xios.sh or include_post_noxios.sh .
+#   These two scripts define functions suitable for output produced with/without XIOS
+#   These functions are called at the end of post.job, in the test-case-dependent part appended by the caller
+#   These functions call wrapper functions NCKS and CDO which must also be defined in include_site.sh
+
+################################ Helper functions ##############################
+
+function redef()
+{
+    while (($# > 0)) ; do
+	sed -i "s/$1[ ]*=[ ]*[[:alnum:]\.]*/$1=$2/g" run.def
+	shift; shift;
+    done
+}
+
+function create_exp()
+{
+# EXP_NAME param_dir run grid post_XX
+    mkdir -p $TESTING/$WORK/$1
+    cd $TESTING/$WORK/$1
+    ln -sf $DYNAMICO/bin/icosa_gcm.exe .
+    ln -sf $TESTING/$WORK/$4 mygrid
+    ln -sf $TESTING/include_*.sh .
+    ln -sf $TESTING/iodef.xml $TESTING/lmdz_physics.xml .
+    cp $TESTING/$WORK/param_sets/$2/*.def .
+    cp -f "$3.def" tmp.def
+    mv -f tmp.def run.def
+    redef nsplit_i 2 nsplit_j 2
+    print_run_job > run.job
+    print_post_job > post.job
+    echo $5 >> post.job
+    chmod a+rx *.job
+}
+
+function grid()
+{
+    echo gridtype = lonlat
+    echo xsize    = $1
+    echo xfirst   = $2
+    echo xinc     = $3
+    echo ysize    = $4
+    echo yfirst   = $5
+    echo yinc     = $6
+}
+
+
+########################### Resolution-dependent parameters ####################
+function nbpX() { redef nbp $1 dt $2 tau_graddiv $3 tau_gradrot $3 tau_divgrad $3
+}
+function nbp32() { nbpX 32 600 21600
+}
+function nbp64() { nbpX 64 300 10800
+}
+function nbp128() { nbpX 128 150 5400
+}
+function nbp40() { nbpX 40 480 18000
+}
+function nbp80() { nbpX 80 240 9000
+}
+function nbp160() { nbpX 160 120 4500
+}
+################################### Test cases #################################
+
+# Williamson (1991)
+
+function W91()
+{
+    EXP=W91_6_$1
+    echo "$EXP : nbp=$1 dt=$2 grid=$4"
+    create_exp $EXP shallow_water/williamson91 run6 $4 post_W91
+    ln -sf $TESTING/icosa_SW.xml icosa.xml
+    redef nbp $1 dt $2 tau_graddiv $3 tau_gradrot $3 tau_divgrad $3 
+    redef write_period 86400 run_length 2592000
+    submit_run_and_post $EXP
+}
+
+# Jablonowski & Williamson (2006)
+
+function JW06()
+{
+    EXP=JW06_$1
+    echo "$EXP : nbp=$1 dt=$2 grid=$4"
+    create_exp $EXP dcmip2012 run41 $4 post_JW06
+    ln -sf $TESTING/icosa_JW06.xml icosa.xml
+#    redef nbp $1 dt $2 tau_graddiv $3 tau_gradrot $3 tau_divgrad $3 
+    nbp$1
+    redef write_period 86400 run_length 864000 etat0 jablonowsky06
+    submit_run_and_post $EXP
+}
+
+# DCMIP1.2 Transport by Hadley-like circulation
+
+function DCMIP12()
+{
+    EXP=DCMIP12_$1_$2
+    echo "$EXP : nbp=$1 llm=$2 ncar_dz=$3 dt=$4 grid=$5"
+    create_exp $EXP dcmip2012 run11 $5 post_DCMIP12
+    redef nqtot 1 nbp $1 llm $2 ncar_dz $3 dt $4
+    redef dcmip1_shape hadley dcmip1_wind hadley run_length 86400 write_period 3600 
+    submit_run_and_post $EXP
+}
+
+# DCMIP2.0 Rest over orography (PGF error)
+
+function DCMIP20()
+{
+    EXP=DCMIP20_$1_$2
+    echo "$EXP : nbp=$1 llm=$2 ncar_dz=$3 dt=$4 grid=$5"
+    create_exp $EXP dcmip2012 run20 $5 post_DCMIP20
+#    redef nbp $1 dt $4
+    nbp$1
+    redef nqtot 0 llm $2 ncar_dz $3
+# from make_rundefs.sh : group 'Time' run_length 518400 write_period 21600
+# comment out the following line to conform to DCMIP document
+#    redef run_length 86400 write_period 3600 
+    submit_run_and_post $EXP
+}
+
+# DCMIP2.1 Orographic wave
+
+function DCMIP21()
+{
+    EXP=DCMIP21_$1_$2
+    echo "$EXP : nbp=$1 llm=$2 ncar_dz=$3 dt=$4 grid=$5"
+    create_exp $EXP dcmip2012 run21 $5 post_DCMIP21
+#    redef nbp $1 dt $4
+    nbp$1
+    redef nqtot 0 llm $2 ncar_dz $3 run_length 86400 write_period 3600 
+    submit_run_and_post $EXP
+}
+
+# DCMIP3.1 Non-orographic gravity wave
+
+function DCMIP31()
+{
+    EXP=DCMIP31_$1_$2
+    echo "$EXP : nbp=$1 llm=$2 ncar_dz=$3 dt=$4 grid=$5"
+    create_exp $EXP dcmip2012 run3 $5 post_DCMIP31
+#    redef nbp $1 dt $4
+    nbp$1
+    redef nqtot 0 llm $2 ncar_dz $3 run_length 86400 write_period 3600
+    submit_run_and_post $EXP
+}
+
+# DCMIP4.1 JW06 on a small planet with tracers
+
+function DCMIP41()
+{
+    EXP=DCMIP41_$1
+    echo "$EXP : nbp=$1 dt=$2 tau_dissip=$3 grid=$4"
+    create_exp $EXP dcmip2012 run41 $4 post_DCMIP41
+#    redef nbp $1 dt $2 tau_graddiv $3 tau_gradrot $3 tau_divgrad $3
+    nbp$1
+    redef nqtot 2 write_period 86400 run_length 864000
+    submit_run_and_post $EXP
+}
+
+# DCMIP5 Tropical cyclone
+
+function DCMIP51()
+{
+    EXP=DCMIP51_$1
+    echo "$EXP : nbp=$1 dt=$2 grid=$4"
+    create_exp $EXP dcmip2012 run51 $4 post_DCMIP51
+    nbp$1
+#    redef nbp $1 dt $2 tau_graddiv $3 tau_gradrot $3 tau_divgrad $3 
+    redef itau_physics 6
+    submit_run_and_post $EXP
+}
+
+# Held & Suarez (1994)
+
+function HS94()
+{
+    EXP=HS94_$1_$3
+    echo "$EXP : nbp=$1 dt=$2 grid=$4"
+    create_exp $EXP climate/Held_Suarez run $4 post_HS
+    nbp$1
+#    redef nbp $1 dt $2 tau_graddiv $3 tau_gradrot $3 tau_divgrad $3
+    submit_run_and_post $EXP
+}
+
+# Saturn : start from rest, vertical temperature profile read from file
+
+function Saturn()
+{
+    EXP=SATURN_$1
+    echo "$EXP : nbp=$1 dt=$2 grid=$4"
+    create_exp $EXP planets run_saturn $4
+    for x in saturn_const.def callphys.def gases.def icosa.xml apbp.txt temp_profile.txt DATAGENERIC; do
+    ln -s $TESTING/SATURN/TEST/$x
+    done
+    ln -sf $TESTING/icosa_SW.xml icosa.xml
+    redef nbp $1 dt $2 tau_graddiv $3 tau_gradrot $3 tau_divgrad $3 
+    redef nsplit_i 1 nsplit_j 1 nqtot 0 
+    redef run_length 38052    # 1     Saturn day
+#    redef run_length 3805200  # 100   Saturn days
+#    redef run_length 76104000 # 20000 Saturn day
+#    echo post_SATURN >> post.job
+#    submit_run_and_post $EXP
+}
+
+########################################  Main #######################################
+
+function reset()
+{
+    echo "Testing DYNAMICO revision $revision"
+    set -x
+    rm -rf $TESTING/$WORK
+    mkdir $TESTING/$WORK
+    set +x
+
+    mkdir $TESTING/$WORK/param_sets
+    cd $TESTING/$WORK/param_sets
+    $TESTING/trunk/param_sets/make_rundefs.sh
+
+    cd $TESTING/$WORK
+    grid 720 0.25 0.5 360 -89.75 0.5 > fine_grid
+    grid 360 0.5  1   180 -89.5  1   > medium_grid
+    grid 180 1    2    90 -89    2   > coarse_grid
+}
+
+function debug()
+{
+#    W91 32 600 21600 coarse_grid
+#    HS94 32 600 86400 coarse_grid
+    JW06 32 600 21600 coarse_grid
+#    DCMIP12 40 30 400 600 coarse_grid
+#    DCMIP12 80 60 200 300 medium_grid
+#    DCMIP12 160 120 100 150 medium_grid
+#    DCMIP20 40 30 400 480 coarse_grid
+#    DCMIP21 40 60 500 480 coarse_grid
+#    DCMIP31 40 10 1000 480 coarse_grid
+#    DCMIP41 32 600 21600 coarse_grid
+#    DCMIP51 32 600 21600 coarse_grid
+#    cp -pr $TESTING/trunk/param_sets/planets $TESTING/$WORK/param_sets
+#    Saturn 10 475.65 5000 coarse_grid
+}
+
+function fast()
+{
+    W91 32 600 21600 coarse_grid
+    JW06 32 600 21600 coarse_grid
+    DCMIP12 40 30 400 600 coarse_grid
+    DCMIP20 40 30 400 480 coarse_grid
+    DCMIP21 40 60 500 480 coarse_grid
+    DCMIP31 40 10 1000 480 coarse_grid
+    DCMIP41 32 600 21600 coarse_grid
+    DCMIP51 32 600 43200 coarse_grid
+}
+
+function GMD_2014()
+{
+#    W91 32 600 21600 coarse_grid
+#    JW06 32 600 21600 coarse_grid
+    HS94 32 600 86400 coarse_grid
+}
+
+function extended()
+{
+    W91      64 300 10800 fine_grid
+    W91     128 150 5400  fine_grid
+    JW06     64 300 10800 fine_grid
+    JW06    128 150 5400  fine_grid
+    DCMIP51  64 300 21600 fine_grid
+    DCMIP51 128 150 10800 fine_grid
+    HS94     32 600 86400 fine_grid
+    HS94     32 600 5400  fine_grid
+    HS94     40 480 50000 fine_grid
+    HS94     40 480 21600 fine_grid
+    HS94     64 300 10800 fine_grid
+}
+
+#set -o errexit
+
+# include machine-specific helper/wrapper functions : 
+#     print_run_job print_post_job submit_run_and_post qstat
+
+source include_site.sh
+
+clear
+echo "Usage : testing.sh [reset] [debug|fast|extended]"
+TESTING=$PWD
+DYNAMICO=$TESTING/trunk
+# find out revision number
+cd $DYNAMICO
+svn info --xml | grep revision | head -n 1 > info.xml
+sed -i "s/>//g" info.xml
+. info.xml    
+WORK="r$revision"
+
+for x in $* ; do
+echo $x
+$x
+done
+
+#qstat
Index: configs/testing/bash/report.sh
===================================================================
--- configs/testing/bash/report.sh	(revision 506)
+++ configs/testing/bash/report.sh	(revision 506)
@@ -0,0 +1,7 @@
+#!/bin/bash
+rm -f *.aux *.log
+pdflatex report.tex
+pdflatex report.tex
+
+mailx -s "DYNAMICO report " -a report.pdf dubos@lmd.polytechnique.fr </dev/null
+
Index: configs/testing/bash/submit.sh
===================================================================
--- configs/testing/bash/submit.sh	(revision 506)
+++ configs/testing/bash/submit.sh	(revision 506)
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+source current_args
+source bash/${arch}.sh
+
+ROOT=$PWD
+
+cd RUNS
+for dir in $ROOT/RUNS/* ; do 
+    cd $dir 
+    ID=$(submit_job_$arch job.sh)
+    LIST="$LIST $ID"
+done
+
+mkdir -p $ROOT/tmp
+job_post_$arch $LIST > $ROOT/tmp/job_post.sh
+cd $ROOT/logs
+submit_job_$arch $ROOT/tmp/job_post.sh > /dev/null
Index: configs/testing/bash/testing.sh
===================================================================
--- configs/testing/bash/testing.sh	(revision 504)
+++ 	(revision )
@@ -1,319 +1,0 @@
-#!/bin/bash
-
-#################################### Site-specific functions #######################
-# In order to accomodate various computing environments, testing.sh relies on the following 
-# site-specific functions which must be provided by include_site.sh
-#
-# submit_run_and_post EXP
-#   Submit the run job run.job to the batch scheduler
-#   Submit the post-processing job post.job to the batch scheduler 
-#   so that it starts after successful completion of run.job
-#
-# qstat
-#   Display cluster status : jobs running, waiting, ect.
-#
-# print_run_job()
-#   Print run.job on standard output
-#   Standard output is redirected to run.job by caller
-#
-# print_post_job()
-#   Print beginning of post.job on standard output. The caller will print additional lines depending on the test case.
-#   Standard output is redirected to file post.job by caller
-#   Script post.job must source include_site.sh, include_post.sh 
-#   and either include_post_xios.sh or include_post_noxios.sh .
-#   These two scripts define functions suitable for output produced with/without XIOS
-#   These functions are called at the end of post.job, in the test-case-dependent part appended by the caller
-#   These functions call wrapper functions NCKS and CDO which must also be defined in include_site.sh
-
-################################ Helper functions ##############################
-
-function redef()
-{
-    while (($# > 0)) ; do
-	sed -i "s/$1[ ]*=[ ]*[[:alnum:]\.]*/$1=$2/g" run.def
-	shift; shift;
-    done
-}
-
-function create_exp()
-{
-# EXP_NAME param_dir run grid post_XX
-    mkdir -p $TESTING/$WORK/$1
-    cd $TESTING/$WORK/$1
-    ln -sf $DYNAMICO/bin/icosa_gcm.exe .
-    ln -sf $TESTING/$WORK/$4 mygrid
-    ln -sf $TESTING/include_*.sh .
-    ln -sf $TESTING/iodef.xml $TESTING/lmdz_physics.xml .
-    cp $TESTING/$WORK/param_sets/$2/*.def .
-    cp -f "$3.def" tmp.def
-    mv -f tmp.def run.def
-    redef nsplit_i 2 nsplit_j 2
-    print_run_job > run.job
-    print_post_job > post.job
-    echo $5 >> post.job
-    chmod a+rx *.job
-}
-
-function grid()
-{
-    echo gridtype = lonlat
-    echo xsize    = $1
-    echo xfirst   = $2
-    echo xinc     = $3
-    echo ysize    = $4
-    echo yfirst   = $5
-    echo yinc     = $6
-}
-
-
-########################### Resolution-dependent parameters ####################
-function nbpX() { redef nbp $1 dt $2 tau_graddiv $3 tau_gradrot $3 tau_divgrad $3
-}
-function nbp32() { nbpX 32 600 21600
-}
-function nbp64() { nbpX 64 300 10800
-}
-function nbp128() { nbpX 128 150 5400
-}
-function nbp40() { nbpX 40 480 18000
-}
-function nbp80() { nbpX 80 240 9000
-}
-function nbp160() { nbpX 160 120 4500
-}
-################################### Test cases #################################
-
-# Williamson (1991)
-
-function W91()
-{
-    EXP=W91_6_$1
-    echo "$EXP : nbp=$1 dt=$2 grid=$4"
-    create_exp $EXP shallow_water/williamson91 run6 $4 post_W91
-    ln -sf $TESTING/icosa_SW.xml icosa.xml
-    redef nbp $1 dt $2 tau_graddiv $3 tau_gradrot $3 tau_divgrad $3 
-    redef write_period 86400 run_length 2592000
-    submit_run_and_post $EXP
-}
-
-# Jablonowski & Williamson (2006)
-
-function JW06()
-{
-    EXP=JW06_$1
-    echo "$EXP : nbp=$1 dt=$2 grid=$4"
-    create_exp $EXP dcmip2012 run41 $4 post_JW06
-    ln -sf $TESTING/icosa_JW06.xml icosa.xml
-#    redef nbp $1 dt $2 tau_graddiv $3 tau_gradrot $3 tau_divgrad $3 
-    nbp$1
-    redef write_period 86400 run_length 864000 etat0 jablonowsky06
-    submit_run_and_post $EXP
-}
-
-# DCMIP1.2 Transport by Hadley-like circulation
-
-function DCMIP12()
-{
-    EXP=DCMIP12_$1_$2
-    echo "$EXP : nbp=$1 llm=$2 ncar_dz=$3 dt=$4 grid=$5"
-    create_exp $EXP dcmip2012 run11 $5 post_DCMIP12
-    redef nqtot 1 nbp $1 llm $2 ncar_dz $3 dt $4
-    redef dcmip1_shape hadley dcmip1_wind hadley run_length 86400 write_period 3600 
-    submit_run_and_post $EXP
-}
-
-# DCMIP2.0 Rest over orography (PGF error)
-
-function DCMIP20()
-{
-    EXP=DCMIP20_$1_$2
-    echo "$EXP : nbp=$1 llm=$2 ncar_dz=$3 dt=$4 grid=$5"
-    create_exp $EXP dcmip2012 run20 $5 post_DCMIP20
-#    redef nbp $1 dt $4
-    nbp$1
-    redef nqtot 0 llm $2 ncar_dz $3
-# from make_rundefs.sh : group 'Time' run_length 518400 write_period 21600
-# comment out the following line to conform to DCMIP document
-#    redef run_length 86400 write_period 3600 
-    submit_run_and_post $EXP
-}
-
-# DCMIP2.1 Orographic wave
-
-function DCMIP21()
-{
-    EXP=DCMIP21_$1_$2
-    echo "$EXP : nbp=$1 llm=$2 ncar_dz=$3 dt=$4 grid=$5"
-    create_exp $EXP dcmip2012 run21 $5 post_DCMIP21
-#    redef nbp $1 dt $4
-    nbp$1
-    redef nqtot 0 llm $2 ncar_dz $3 run_length 86400 write_period 3600 
-    submit_run_and_post $EXP
-}
-
-# DCMIP3.1 Non-orographic gravity wave
-
-function DCMIP31()
-{
-    EXP=DCMIP31_$1_$2
-    echo "$EXP : nbp=$1 llm=$2 ncar_dz=$3 dt=$4 grid=$5"
-    create_exp $EXP dcmip2012 run3 $5 post_DCMIP31
-#    redef nbp $1 dt $4
-    nbp$1
-    redef nqtot 0 llm $2 ncar_dz $3 run_length 86400 write_period 3600
-    submit_run_and_post $EXP
-}
-
-# DCMIP4.1 JW06 on a small planet with tracers
-
-function DCMIP41()
-{
-    EXP=DCMIP41_$1
-    echo "$EXP : nbp=$1 dt=$2 tau_dissip=$3 grid=$4"
-    create_exp $EXP dcmip2012 run41 $4 post_DCMIP41
-#    redef nbp $1 dt $2 tau_graddiv $3 tau_gradrot $3 tau_divgrad $3
-    nbp$1
-    redef nqtot 2 write_period 86400 run_length 864000
-    submit_run_and_post $EXP
-}
-
-# DCMIP5 Tropical cyclone
-
-function DCMIP51()
-{
-    EXP=DCMIP51_$1
-    echo "$EXP : nbp=$1 dt=$2 grid=$4"
-    create_exp $EXP dcmip2012 run51 $4 post_DCMIP51
-    nbp$1
-#    redef nbp $1 dt $2 tau_graddiv $3 tau_gradrot $3 tau_divgrad $3 
-    redef itau_physics 6
-    submit_run_and_post $EXP
-}
-
-# Held & Suarez (1994)
-
-function HS94()
-{
-    EXP=HS94_$1_$3
-    echo "$EXP : nbp=$1 dt=$2 grid=$4"
-    create_exp $EXP climate/Held_Suarez run $4 post_HS
-    nbp$1
-#    redef nbp $1 dt $2 tau_graddiv $3 tau_gradrot $3 tau_divgrad $3
-    submit_run_and_post $EXP
-}
-
-# Saturn : start from rest, vertical temperature profile read from file
-
-function Saturn()
-{
-    EXP=SATURN_$1
-    echo "$EXP : nbp=$1 dt=$2 grid=$4"
-    create_exp $EXP planets run_saturn $4
-    for x in saturn_const.def callphys.def gases.def icosa.xml apbp.txt temp_profile.txt DATAGENERIC; do
-    ln -s $TESTING/SATURN/TEST/$x
-    done
-    ln -sf $TESTING/icosa_SW.xml icosa.xml
-    redef nbp $1 dt $2 tau_graddiv $3 tau_gradrot $3 tau_divgrad $3 
-    redef nsplit_i 1 nsplit_j 1 nqtot 0 
-    redef run_length 38052    # 1     Saturn day
-#    redef run_length 3805200  # 100   Saturn days
-#    redef run_length 76104000 # 20000 Saturn day
-#    echo post_SATURN >> post.job
-#    submit_run_and_post $EXP
-}
-
-########################################  Main #######################################
-
-function reset()
-{
-    echo "Testing DYNAMICO revision $revision"
-    set -x
-    rm -rf $TESTING/$WORK
-    mkdir $TESTING/$WORK
-    set +x
-
-    mkdir $TESTING/$WORK/param_sets
-    cd $TESTING/$WORK/param_sets
-    $TESTING/trunk/param_sets/make_rundefs.sh
-
-    cd $TESTING/$WORK
-    grid 720 0.25 0.5 360 -89.75 0.5 > fine_grid
-    grid 360 0.5  1   180 -89.5  1   > medium_grid
-    grid 180 1    2    90 -89    2   > coarse_grid
-}
-
-function debug()
-{
-#    W91 32 600 21600 coarse_grid
-#    HS94 32 600 86400 coarse_grid
-    JW06 32 600 21600 coarse_grid
-#    DCMIP12 40 30 400 600 coarse_grid
-#    DCMIP12 80 60 200 300 medium_grid
-#    DCMIP12 160 120 100 150 medium_grid
-#    DCMIP20 40 30 400 480 coarse_grid
-#    DCMIP21 40 60 500 480 coarse_grid
-#    DCMIP31 40 10 1000 480 coarse_grid
-#    DCMIP41 32 600 21600 coarse_grid
-#    DCMIP51 32 600 21600 coarse_grid
-#    cp -pr $TESTING/trunk/param_sets/planets $TESTING/$WORK/param_sets
-#    Saturn 10 475.65 5000 coarse_grid
-}
-
-function fast()
-{
-    W91 32 600 21600 coarse_grid
-    JW06 32 600 21600 coarse_grid
-    DCMIP12 40 30 400 600 coarse_grid
-    DCMIP20 40 30 400 480 coarse_grid
-    DCMIP21 40 60 500 480 coarse_grid
-    DCMIP31 40 10 1000 480 coarse_grid
-    DCMIP41 32 600 21600 coarse_grid
-    DCMIP51 32 600 43200 coarse_grid
-}
-
-function GMD_2014()
-{
-#    W91 32 600 21600 coarse_grid
-#    JW06 32 600 21600 coarse_grid
-    HS94 32 600 86400 coarse_grid
-}
-
-function extended()
-{
-    W91      64 300 10800 fine_grid
-    W91     128 150 5400  fine_grid
-    JW06     64 300 10800 fine_grid
-    JW06    128 150 5400  fine_grid
-    DCMIP51  64 300 21600 fine_grid
-    DCMIP51 128 150 10800 fine_grid
-    HS94     32 600 86400 fine_grid
-    HS94     32 600 5400  fine_grid
-    HS94     40 480 50000 fine_grid
-    HS94     40 480 21600 fine_grid
-    HS94     64 300 10800 fine_grid
-}
-
-#set -o errexit
-
-# include machine-specific helper/wrapper functions : 
-#     print_run_job print_post_job submit_run_and_post qstat
-
-source include_site.sh
-
-clear
-echo "Usage : testing.sh [reset] [debug|fast|extended]"
-TESTING=$PWD
-DYNAMICO=$TESTING/trunk
-# find out revision number
-cd $DYNAMICO
-svn info --xml | grep revision | head -n 1 > info.xml
-sed -i "s/>//g" info.xml
-. info.xml    
-WORK="r$revision"
-
-for x in $* ; do
-echo $x
-$x
-done
-
-#qstat
Index: configs/testing/build.sh
===================================================================
--- configs/testing/build.sh	(revision 504)
+++ 	(revision )
@@ -1,41 +1,0 @@
-#!/bin/bash
-
-function build_dynamico()
-{
-    NAME=$1 ; shift
-    BUILD=$ROOT/DYNAMICO_$NAME
-    LOGFILE=$ROOT/logs/dynamico_${NAME}.log
-    cd $ROOT/DYNAMICO_$NAME
-    echo "In $PWD : building DYNAMICO with options $*"
-    echo "Watch logfile $LOGFILE"
-#    ./make_icosa -full -arch $arch -job $job $* > $LOGFILE 2>&1 || ( tail $LOGFILE ; exit 1 )
-    ./make_icosa -arch $arch -job $job $* > $LOGFILE 2>&1 || ( tail $LOGFILE ; exit 1 )
-    cp -pr $BUILD/bin/icosa_gcm.exe  $ROOT/bin/icosa_$NAME.exe
-}
-
-function main()
-{  
-    LOGFILE=$ROOT/logs/build_xios.log
-    cd $ROOT/XIOS
-    echo "In $PWD : Building XIOS"
-    echo "Watch logfile $LOGFILE"
-    ./make_xios --arch $arch --job $job > $LOGFILE 2>&1 || ( tail $LOGFILE ; exit 1 )    
-    cd $ROOT
-    # compile all variants in parallel
-    build_dynamico serial -parallel none &
-    build_dynamico mpi -parallel mpi -with_xios &
-    build_dynamico mpi_omp -parallel mpi_omp -with_xios &
-    wait
-    # check success
-    ls bin/icosa_serial.exe || exit 1
-    ls bin/icosa_mpi.exe || exit 1
-    ls bin/icosa_mpi_omp.exe || exit 1
-}
-
-source current_args
-rm -rf bin logs
-mkdir bin logs
-( main ) || ( echo ; echo "***************** Build FAILED ******************" ; exit 1)
-
-echo "***************** Build : SUCCESS ******************"
-echo "You may now run create_runs.sh"
Index: configs/testing/create_runs.sh
===================================================================
--- configs/testing/create_runs.sh	(revision 504)
+++ 	(revision )
@@ -1,143 +1,0 @@
-#!/bin/bash
-
-function create_exp() { # executable expname output_grid output_freq  - $* passed to rundef_$expname 
-    EXEC=$1 ; shift
-    EXP=$1 ; shift
-    OUTPUT_GRID=$1 ; shift
-    OUTPUT_FREQ=$1 ; shift
-    EXPDIR=${EXP}_${EXEC}_$1
-    echo "Creating $EXPDIR"
-    rm -rf $EXPDIR
-    mkdir $EXPDIR
-    cd $EXPDIR
-    ln -sf $ROOT/bin/icosa_${EXEC}.exe gcm.exe
-    ln -sf $ROOT/python/post_${EXP}.py post.py
-    rundef_$EXP $* > tmp.def
-    sort tmp.def | cut -c 7- > run.def
-    rm -f tmp.def
-    xml_iodef > iodef.xml
-    xml_icosa > icosa.xml
-    xml_field_def > field_def.xml
-    xml_dcmip $EXP $OUTPUT_GRID $OUTPUT_FREQ > filedef_dcmip2016.xml
-    job_${EXP} ${EXEC} $* > job.sh
-    cd ..
-}
-
-function rundef_all() {
-    cat <<EOF
-100   #------------- Planet ---------------
-200   #------------- Dynamics  ------------
-300   #-------------- Mesh ----------------
-400   #------------ Numerics --------------
-500   #----------- Dissipation ------------
-600   #-------------- Physics -------------
-700   #---------------- Run ---------------
-EOF
-}
-
-function setvar()
-{
-    while (($# > 1)) ; do
-	ii=${idx[$1]}
-	echo "$ii   $1=$2"
-	shift ; shift
-    done
-}
-function order()
-{
-    ii=$1 ; shift
-    for name in $* ; do
-	((ii+=1))
-       idx[${name}]=$ii
-#       echo $name ${idx[${name}]}
-    done
-}
-
-#----------------------------- pre-defined resolutions ---------------------------
-
-function set_nbp_40() {
-    setvar dt 480 optim_it 500
-    split_${EXEC}_40
-}
-
-function set_nbp_80() {
-    setvar dt 240 optim_it 1000
-    split_${EXEC}_80
-}
-
-#-------------------------------- Williamson (1991) ------------------------------
-
-function rundef_W91() {
-    NBP=$1 ; TAU=$2
-    rundef_all
-    set_nbp_$NBP
-    setvar caldyn_conserv enstrophy caldyn_eta eta_lag boussinesq .TRUE. llm 1 radius 6.37122e6 g 9.80616
-    setvar nitergdiv 2 nitergrot 2 niterdivgrad 2 tau_graddiv $TAU tau_gradrot $TAU tau_divgrad $TAU
-    setvar write_period 86400 run_length 2592000 etat0 williamson91.6
-}
-
-function job_W91() {
-    job_$1_$2 W91_$1
-}
-
-#------------------------------------- DCMIP3.1 ----------------------------------
-
-function rundef_DCMIP(){
-    rundef_all
-    set_nbp_$1
-    setvar radius 6.37122e6 g 9.80616 kappa 0.2857143 cpp 1004.5 preff 1e5
-    setvar nitergdiv 2 nitergrot 2 niterdivgrad 2 tau_graddiv
-}
-
-function rundef_DCMIP31() { # NBP TAU
-    NBP=$1 ; TAU=$2
-    rundef_DCMIP $NBP
-    setvar hydrostatic .FALSE.
-    setvar omega 0. llm 10 disvert ncar ncar_T0 300 ncar_p0 1e5 ncar_disvert_c 1 ncar_dz 1000 
-    setvar tau_graddiv $TAU tau_gradrot $TAU tau_divgrad $TAU 
-    setvar scale_factor 125 write_period 7500 run_length 4.5e5 etat0 dcmip3
-}
-function rundef_DCMIP41() { # NBP TAU
-    NBP=$1 ; TAU=$2
-    rundef_DCMIP $NBP
-#    setvar hydrostatic .FALSE.
-    setvar omega 7.292e-5 llm 30 disvert ncarl30 nqtot 2 itau_adv 3
-    setvar tau_graddiv $TAU tau_gradrot $TAU tau_divgrad $TAU
-    setvar write_period 21600 run_length 2592000 etat0 dcmip4 dcmip4_testcase 1
-}
-
-function job_DCMIP31() { # EXEC NBP
-    job_$1_$2 DCMIP31_$1 # e.g. job_mpi_80 DCMIP31_mpi
-}
-function job_DCMIP41() { # EXEC NBP
-    job_$1_$2 DCMIP41_$1
-}
-
-#----------------------------- END ----------------------------
-
-function main()
-{
-    rm -rf RUNS
-    mkdir RUNS
-    cd RUNS
-# the number associated to each run.def parameter is used to sort the lines and order them in a logical way
-    declare -A idx
-    order 100 radius omega g cpp kappa preff scale_factor
-    order 200 boussinesq hydrostatic
-    order 300 nbp optim_it nsplit_i nsplit_j llm disvert ncar_disvert_c ncar_dz ncar_T0 ncar_p0
-    order 400 caldyn_eta time_scheme caldyn_conserv dt nqtot itau_adv
-    order 500 nitergdiv tau_graddiv nitergrot tau_gradrot niterdivgrad tau_divgrad
-    order 700 run_length write_period etat0 dcmip4_testcase
-# Williamson 1991
-#    create_exp serial W91 40 5000 # nbp tau
-#    create_exp mpi W91 40 5000 # nbp tau
-# DCMIP 2012 
-    create_exp mpi DCMIP31 two_degree 60s 40 90000 # nbp tau 
-    create_exp mpi DCMIP41 two_degree 24h 40 10000 # nbp tau 
-}
-
-source current_args
-source bash/${arch}.sh
-source bash/xml.sh
-ROOT=$PWD
-main
Index: configs/testing/report.sh
===================================================================
--- configs/testing/report.sh	(revision 504)
+++ 	(revision )
@@ -1,7 +1,0 @@
-#!/bin/bash
-rm -f *.aux *.log
-pdflatex report.tex
-pdflatex report.tex
-
-mailx -s "DYNAMICO report " -a report.pdf dubos@lmd.polytechnique.fr </dev/null
-
Index: configs/testing/submit.sh
===================================================================
--- configs/testing/submit.sh	(revision 504)
+++ 	(revision )
@@ -1,18 +1,0 @@
-#!/bin/bash
-
-source current_args
-source bash/${arch}.sh
-
-ROOT=$PWD
-
-cd RUNS
-for dir in $ROOT/RUNS/* ; do 
-    cd $dir 
-    ID=$(submit_job_$arch job.sh)
-    LIST="$LIST $ID"
-done
-
-mkdir -p $ROOT/tmp
-job_post_$arch $LIST > $ROOT/tmp/job_post.sh
-cd $ROOT/logs
-submit_job_$arch $ROOT/tmp/job_post.sh > /dev/null
