Index: /configs/testing/bash/X64_CURIE.sh
===================================================================
--- /configs/testing/bash/X64_CURIE.sh	(revision 501)
+++ /configs/testing/bash/X64_CURIE.sh	(revision 501)
@@ -0,0 +1,78 @@
+#!/bin/bash
+
+#----------------------------- split_XXX ----------------------------
+
+function split_serial_40() {
+    setvar nbp 41 nsplit_i 2 nsplit_j 2
+}
+function split_mpi_40() {
+    setvar nbp 41 nsplit_i 2 nsplit_j 2
+}
+function split_mpi_80() {
+    setvar nbp 81 nsplit_i 4 nsplit_j 2
+}
+
+#------------------------------ job_XXX -----------------------------
+
+function job_serial() { # EXP_NAME
+    job_X64_CURIE $1 1 "" 
+}
+function job_serial_40() { # EXP_NAME
+    job_serial $1
+}
+
+function job_mpi() { #EXP_NAME NB_MPI
+    job_X64_CURIE $1 $2 ccc_mprun
+}
+function job_mpi_40() { # EXP_NAME
+    job_mpi $1 40
+}
+function job_mpi_80() { # EXP_NAME
+    job_mpi $1 80
+}
+
+function job_X64_CURIE() { # EXP_NAME MPI_TASKS MPIRUN
+    cat <<EOF
+#!/bin/bash
+## Request name
+#MSUB -r $1
+#MSUB -q standard 
+#MSUB -A gen7548
+#MSUB -x
+## Number of tasks (=MPI processes) to use
+#MSUB -n $2
+## Elapsed time limit in seconds
+#MSUB -T 600
+## 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} 
+
+module purge
+module load licsrv/intel
+module load c/intel/14.0.3.174
+module load c++/intel/14.0.3.174
+module load fortran/intel/14.0.3.174
+module load mkl/14.0.3.174
+module load idb/14.0.3.174
+module load intel/14.0.3.174
+module load mpi/bullxmpi/1.2.8.4
+module load netcdf/4.3.3.1_hdf5_parallel
+
+rm -rf gcm.log logs *.nc netcdf
+date > gcm.log
+ulimit -s unlimited
+$3 ./gcm.exe >> gcm.log
+date >> gcm.log
+
+mkdir -p netcdf
+cp gcm.log *.def netcdf
+mv *.nc netcdf
+
+mkdir -p logs
+cp *.xml logs
+mv xios_client_*.err xios_client_*.out gcm.log logs
+
+EOF
+}
Index: /configs/testing/bash/xml.sh
===================================================================
--- /configs/testing/bash/xml.sh	(revision 501)
+++ /configs/testing/bash/xml.sh	(revision 501)
@@ -0,0 +1,294 @@
+function xml_iodef() {
+cat <<EOF
+<?xml version="1.0"?>
+<simulation> 
+	<context  id="xios">
+		<variable_definition>
+                <variable id="print_file" type="bool"> true </variable> 
+       		<variable_group id="buffer">
+         	</variable_group>
+
+        	<variable_group id="parameters" >
+        		<variable id="using_server" type="bool">false</variable>
+        		<variable id="info_level" type="int">1</variable>
+        	</variable_group>
+		</variable_definition>
+	</context>
+        <context id="icosagcm" src="./icosa.xml" /> 
+</simulation>
+EOF
+}
+
+function xml_icosa() {
+cat <<EOF
+<context id="icosagcm" >
+  <calendar type="d360" start_date="2000-01-01 00:00:00" time_origin="2000-01-01 00:00:00"/>
+  
+  <field_definition src="./field_def.xml" />
+
+  <file_definition src="./filedef_dcmip2016.xml" /> 
+
+  <file_definition type="one_file" par_access="collective">
+
+    <file id="output" name="output" enabled=".FALSE."  output_freq="2h" sync_freq="2h" output_level="10" >
+      <field_group group_ref="standard_output"/>
+    </file>
+
+    <file id="restart" name="restart" enabled="true">
+       <field_group id="group_restart" operation="once"> 
+          <field id="it_restart" name="iteration"  grid_ref="scalar" />
+          <field id="q_restart" name="q"  grid_ref="grid_q" />
+          <field_group domain_ref="i"> 
+             <field id="ps_restart" name="ps" />
+             <field id="phis_restart" name="phis" />
+             <field_group axis_ref="lev" >
+                <field id="theta_rhodz_restart" name="theta_rhodz" />
+                <field id="u_restart" name="u" domain_ref="u"/>
+                <field id="ulon_restart" name="ulon" />
+                <field id="ulat_restart" name="ulat" />
+             </field_group>
+          </field_group>
+       </field_group>
+    </file>
+
+    <file id="start" name="start" enabled="false" mode="read">
+       <field_group id="group_start" operation="once"> 
+          <field id="it_start" name="iteration"  grid_ref="scalar" enabled="false"/>
+          <field id="q_start" name="q"  grid_ref="grid_q_read" />
+          <field_group domain_ref="i"> 
+             <field id="ps_start" name="ps" />
+             <field id="phis_start" name="phis" />
+             <field_group axis_ref="lev_read" >
+                <field id="theta_rhodz_start" name="theta_rhodz" />
+                <field id="u_start" name="u" domain_ref="u"/>
+                <field id="ulon_start" name="ulon" />
+                <field id="ulat_start" name="ulat" />
+             </field_group>
+          </field_group>
+       </field_group>
+    </file>
+
+    
+  </file_definition>
+    
+  <axis_definition>
+    <axis id="lev" name="lev" positive="down" standard_name="atmopshere_hybrid_sigma_pressure_coordinate" long_name="hybrid level at midpoints" />
+    <axis id="lev_read" />
+    <axis id="levp1" name="ilev"  unit="level" positive="down" standard_name="atmopshere_hybride_sigma_pressure_coordinate" long_name="hybrid level at interface" />
+    <axis id="lev_pressure" positive="down"  n_glo="2" unit="Pa" value="(0,1)[85000 50000]" >
+      <interpolate_axis order="1" coordinate="p" />
+    </axis>    
+    <axis id="nq" name="nq" n_glo="5" value="(0,4)[1 2 3 4 5]"/>
+  </axis_definition>    
+  
+  <domain_definition>
+    
+     <domain_group id="i"> 
+       <domain id="i" name="mesh"/>     
+     </domain_group> 
+     
+     
+     <domain id="v" />
+     <domain id="u" />
+     
+     <domain id="regular_half_degree" type="rectilinear" ni_glo="720" nj_glo="360" >
+       <generate_rectilinear_domain />
+       <interpolate_domain order="1"/>
+     </domain> 
+     
+     <domain id="regular_one_degree" type="rectilinear" ni_glo="360" nj_glo="180" >
+       <generate_rectilinear_domain />
+       <interpolate_domain order="1"/>
+     </domain> 
+     
+     <domain id="regular_two_degree" type="rectilinear" ni_glo="180" nj_glo="90" >
+       <generate_rectilinear_domain />
+       <interpolate_domain order="1"/>
+     </domain> 
+     
+  </domain_definition>    
+  
+  <grid_definition>    
+    <grid id="scalar">
+      <scalar />
+    </grid>
+    
+    <grid id="grid_q">
+      <domain domain_ref="i" />
+      <axis axis_ref="lev" />
+      <axis axis_ref="nq" />
+    </grid >
+
+    <grid id="grid_q_read">
+      <domain domain_ref="i" />
+      <axis axis_ref="lev_read" />
+      <axis axis_ref="nq" />
+    </grid >
+ 
+  </grid_definition>   
+  
+</context>
+EOF
+}
+
+function xml_field_def() {
+    cat <<EOF
+<field_definition level="1" enabled=".TRUE." operation="instant">
+  
+  <field_group id="standard_output"> 
+    
+    <field id="timestep" grid_ref="scalar" unit="s"/>
+    <field id="preff" grid_ref="scalar"    unit="Pa"/>
+    <field id="ap" axis_ref="levp1"   long_name="hybrid A coefficient at layer interface" />
+    <field id="bp" axis_ref="levp1"  long_name="hybrid B coefficient at layer interface" />
+    <field id="mid_ap" axis_ref="lev"   long_name="hybrid A coefficient at midpoints" />
+    <field id="mid_bp" axis_ref="lev"  long_name="hybrid B coefficient at midpoints" />
+    
+    <field_group domain_ref="i">
+      <field id="ps" />
+      <field id="dps"  />
+      <field id="Ai" />
+      <field id="phis" />
+      <field id="phi" />
+      <field id="precl" />
+      <field id="Q1_col_int" />     
+      <field id="Q2_col_int" />     
+      <field id="ps_init" />
+      
+      <field_group axis_ref="lev"> 
+        <field id="mass" />
+        <field id="p" />
+        <field id="dmass"/>
+        <field id="theta" />
+        <field id="dyn_q" />
+        <field id="pk"/>
+        <field id="ulon"/>
+        <field id="ulat"/>
+        <field id="uz"/>
+        <field id="omega"/>
+        <field id="temp"/>
+        
+        <field id="mass_init" />
+        <field id="p_init" />
+        <field id="theta_init" />
+        <field id="dyn_q_init" />
+        <field id="ulon_init"/>
+        <field id="ulat_init"/>
+        <field id="uz_init"/>
+        <field id="temp_init"/>
+        
+      </field_group>
+      <field id="u850" />
+      <field id="v850" />
+      <field id="w850" />
+      <field id="t850" />
+      <field id="omega850"/>                  
+      <field id="u500" />
+      <field id="v500" />
+      <field id="w500" />
+      <field id="t500" />
+      <field id="omega500"/>                  
+      <field id="SST"/>
+      
+      <field id="ulon_850_500" field_ref="p" axis_ref="lev_pressure" />
+      
+      <field_group axis_ref="levp1"> 
+        <field id="geopot"/>
+        <field id="geopot_init"/>
+      </field_group>
+    </field_group> 
+    <field id="q_init" grid_ref="grid_q" />    
+    <field id="q" grid_ref="grid_q" />    
+    
+    <field_group domain_ref="v" axis_ref="lev">
+      <field id="vort" />
+      <field id="pv" />
+    </field_group>
+    
+  </field_group>
+  
+  
+</field_definition>
+
+EOF
+}
+
+function xml_dcmip() { # EXPNAME OUTPUT_GRID OUTPUT_FREQ
+EXPNAME=$1
+OUTPUT_GRID=$2
+OUTPUT_FREQ=$3
+NBP=80 # FIXME
+LLM=10 # FIXME
+cat <<EOF
+<file_definition > 
+
+  <file id="output_dcmip2016_native" convention="CF" enabled="false" output_freq="$OUTPUT_FREQ" sync_freq="$OUTPUT_FREQ" output_level="10" timeseries="none" description="$EXPNAME" > 
+    
+    <field_group id="dcmip2016_output_field_once" operation="once" freq_offset="0ts" ts_enabled="true">
+      <field field_ref="timestep" name="mdt" />
+      <field field_ref="preff" name="P0" long_name="reference pressure" />
+      <field field_ref="ap" name="hyai"   />
+      <field field_ref="bp" name="hybi"   />
+      <field field_ref="mid_ap" name="hyam"   />
+      <field field_ref="mid_bp" name="hybm"   />
+    </field_group>
+    
+    
+    <field_group id="dcmip2016_output_field" ts_enabled="true">
+      <field field_ref="ps" name="PS"       standard_name="surface_pressure" long_name="Surface pressure"         unit="Pa" />
+      <field field_ref="phis" operation="once" freq_offset="0ts" name="PHIS"   standard_name="surface_geopotential" long_name="Surface geopotential" unit="m2/m2"/>
+      <field field_ref="geopot"  name="PHI"   standard_name="geopotential" long_name="geopotential" unit="m2/s2"/>
+      <field field_ref="ulon" name="U"      standard_name="eastward_wind" long_name="Zonal wind"                  unit="m/s"/>
+      <field field_ref="ulat" name="V"      standard_name="northward_wind" long_name="Meridional wind"            unit="m/s"/>
+      <field field_ref="uz" name="W"        standard_name="upward_air_velocity" long_name="Vertical velocity"     unit="m/s"/>
+      <field field_ref="omega" name="OMEGA"        standard_name="lagrangian_tendency_of_air_pressure" long_name="Vertical pressure velocity"     unit="Pa/s"/>
+      <field field_ref="p"  name="P"        standard_name="air_pressure" long_name="Pressure"     unit="Pa"/>
+      <field field_ref="temp"  name="T"        standard_name="air_temperature" long_name="Temperature"     unit="K"/>
+      <field field_ref="precl"  name="PRECT"     standard_name="rainfall_rate"  long_name="Large Scale precipitation rate"  unit="m/s"/>
+      <field field_ref="Q1_col_int"  name="Q1_col_int"      long_name="Single chlorine column integrated mixing ratio"  unit="kg/m2"/> 
+      <field field_ref="Q2_col_int"  name="Q2_col_int"      long_name="Chlorine gas column integrated mixing ratio"  unit="kg/m2"/> 
+      <field field_ref="u850" name="U850"       long_name="Zonal wind at 850 hPa"      unit="m/s"/>
+      <field field_ref="v850" name="V850"       long_name="Meridional wind at 850 hPa"   unit="m/s"/>
+      <field field_ref="w850" name="W850"       long_name="Vertical velocity at 850 hPa"     unit="m/s"/>
+      <field field_ref="t850" name="T850"       long_name="Temperature at 850 hPa"   unit="K"/>
+      <field field_ref="omega850" name="OMEGA850"   long_name="Vertical pressure velocity at 850 hPa"     unit="Pa/s"/>
+      <field field_ref="u500" name="U500"       long_name="Zonal wind at 500 hPa"      unit="m/s"/>
+      <field field_ref="v500" name="V500"       long_name="Meridional wind at 850 hPa"   unit="m/s"/>
+      <field field_ref="w850" name="W500"       long_name="Vertical velocity at 500 hPa"     unit="m/s"/>
+      <field field_ref="t500" name="T500"       long_name="Temperature at 850 hPa"   unit="K"/>
+      <field field_ref="omega500" name="OMEGA500"   long_name="Vertical pressure velocity at 500 hPa"     unit="Pa/s"/>
+      <field field_ref="SST" name="SST"       long_name="Sea surface temperature"   unit="K"/>
+      
+    </field_group>
+
+    <variable name="model" type="string" > dynamico </variable>
+    <variable name="test_case" type="string" > $EXPNAME </variable>
+    <variable name="horizontal_resolution" type="string" > native (grid points : 80x80x10) </variable>
+    <variable name="levels" type="string" > L10 </variable>
+    <variable name="grid" type="string" > hex </variable>
+    <variable name="equation" type="string" > hydro </variable>
+    <variable name="time_frequency" type="string" > $OUTPUT_FREQ </variable>    
+
+  </file>
+
+
+  <file id="output_dcmip2016_regular" enabled="true" output_freq="$OUTPUT_FREQ" sync_freq="$OUTPUT_FREQ" output_level="10" description="$EXPNAME" timeseries="none" > 
+    
+    <field_group group_ref="dcmip2016_output_field_once"/>
+    
+    <field_group group_ref="dcmip2016_output_field" domain_ref="regular_$OUTPUT_GRID" />
+
+    <variable name="model" type="string" > dynamico </variable>
+    <variable name="test_case" type="string" > $EXPNAME </variable>
+    <variable name="horizontal_resolution" type="string" > $OUTPUT_GRID interpolated (grid points : $NBP x $NBP x $LLM) </variable>
+    <variable name="levels" type="string" > L30 </variable>
+    <variable name="grid" type="string" > hex </variable>
+    <variable name="equation" type="string" > hydro </variable>
+    <variable name="time_frequency" type="string" > $OUTPUT_FREQ </variable>    
+
+  </file>
+
+
+</file_definition>
+EOF
+}
Index: /configs/testing/build.sh
===================================================================
--- /configs/testing/build.sh	(revision 501)
+++ /configs/testing/build.sh	(revision 501)
@@ -0,0 +1,40 @@
+#!/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 "You may now run create_runs.sh"
Index: /configs/testing/create_runs.sh
===================================================================
--- /configs/testing/create_runs.sh	(revision 501)
+++ /configs/testing/create_runs.sh	(revision 501)
@@ -0,0 +1,142 @@
+#!/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
+    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/setup.sh
===================================================================
--- /configs/testing/setup.sh	(revision 501)
+++ /configs/testing/setup.sh	(revision 501)
@@ -0,0 +1,61 @@
+#!/bin/bash
+
+export ROOT=$PWD
+
+full_defined="FALSE"
+arch_defined="FALSE"
+job=1
+
+CPP_KEY="CPP_NONE"
+ICOSA_LIB=""
+
+while (($# > 0))
+  do
+  case $1 in
+      "-h") cat <<EOF
+Usage :
+setup [options] -arch nom_arch
+[-h]                       : help
+ -arch nom_arch            : nom de l\'architecture cible
+EOF
+          exit;;
+
+      "-arch")
+          arch=$2 ; arch_defined="TRUE"; shift ; shift ;;
+      "-job")
+          job=$2 ; shift ; shift;;
+      "-full")
+          full_defined="TRUE" ; shift ;;
+      *)
+	  echo "Unknown argument : $*"
+	  echo "Try $0 -h"
+	  exit 1
+  esac
+done
+
+if [[ "$arch_defined" == "TRUE" ]]
+then
+  cat <<EOF >current_args
+ROOT="$ROOT"
+arch="$arch"
+job="$job"
+EOF
+
+  echo "Setup saved in file current_args :"
+  cat current_args
+  # create separate build dirs sharing the same src/ and tools/ subdirs to save disk and time
+  BUILD=$ROOT/DYNAMICO_serial
+  cp -pr $ROOT/DYNAMICO $BUILD
+  rm -rf $BUILD/src
+  rm -rf $BUILD/tools
+  ln -sf $ROOT/DYNAMICO/src $BUILD/src
+  ln -sf $ROOT/DYNAMICO/tools $BUILD/tools
+  for NAME in mpi mpi_omp ; do
+      cp -pr $BUILD $ROOT/DYNAMICO_$NAME
+  done
+  
+  echo "You may now run ./build.sh"
+else
+  echo "Please define a target architecture"
+  exit 1
+fi
