Index: configs/testing/bash/build.sh
===================================================================
--- configs/testing/bash/build.sh	(revision 629)
+++ configs/testing/bash/build.sh	(revision 702)
@@ -19,6 +19,7 @@
     cd $ROOT/XIOS
     echo "In $PWD : Building XIOS"
+    echo "./make_xios --arch $arch $other_XIOS --job $job"
     echo "Watch logfile $LOGFILE"
-    ./make_xios --arch $arch --job $job > $LOGFILE 2>&1 || ( tail $LOGFILE ; exit 1 )    
+    ./make_xios --arch $arch $other_XIOS --job $job > $LOGFILE 2>&1 || ( tail $LOGFILE ; exit 1 )    
     cd $ROOT
     # compile all variants in parallel
Index: configs/testing/bash/create_runs.sh
===================================================================
--- configs/testing/bash/create_runs.sh	(revision 629)
+++ configs/testing/bash/create_runs.sh	(revision 702)
@@ -238,6 +238,6 @@
     order 500 nitergdiv tau_graddiv nitergrot tau_gradrot niterdivgrad tau_divgrad rayleigh_friction_type rayleigh_friction_tau
     order 600 physics dcmip_physics itau_physics friction_time
-    order 700 run_length write_period etat0 dcmip4_testcase diagflux
-    order 800 itau_check_conserv check_conservation
+    order 700 run_length write_period etat0 dcmip4_testcase
+    order 800 itau_check_conserv check_conservation diagflux
     basic
 }
Index: configs/testing/bash/xml.sh
===================================================================
--- configs/testing/bash/xml.sh	(revision 629)
+++ configs/testing/bash/xml.sh	(revision 702)
@@ -215,4 +215,7 @@
         <field id="enthalpyflux_lat" long_name="Time-averaged enthalpy flux, meridional"   unit="J/m/s"/>
 
+        <field id="dulon_phys"       long_name="Physics tendency for zonal velocity"   unit="m/s^2"/>
+        <field id="dulat_phys"       long_name="Physics tendency for meridional velocity"   unit="m/s^2"/>
+
       </field_group>
 
Index: configs/testing/benchmark/benchmark.sh
===================================================================
--- configs/testing/benchmark/benchmark.sh	(revision 702)
+++ configs/testing/benchmark/benchmark.sh	(revision 702)
@@ -0,0 +1,207 @@
+#!/bin/bash
+
+function replace() # KEY VALUE FILE
+{
+  # strip leading zeros that confuse ccc_msub
+  VALUE=$(echo $2 | sed 's/^0*//')
+  sed -i -e "s/$1/$VALUE/g" $3
+  echo "$1=$VALUE" >> params.sh
+}
+
+function create_run() # NBP TIME_STEP NSPLIT OMP_LEVEL_SIZE NB_MPI NB_OMP
+{
+  NBP=$1
+  TIME_STEP=$2
+  shift; shift
+
+  NAME="run_$1_$2_$3_$4"
+  mkdir $NAME
+  cp run.def job.sh mpmd.conf gcm.sh *.xml $NAME
+  cd $NAME
+  touch params.sh
+
+  replace NBP $NBP run.def
+  replace TIME_STEP $TIME_STEP run.def
+  replace NSPLIT $1 run.def
+  replace OMP_LEVEL_SIZE $2 run.def
+  replace NUM_MPI $3 mpmd.conf
+  replace NUM_MPI $3 job.sh
+  replace NUM_OMP $4 job.sh
+  cd ..
+}
+
+function cmd_create_220km()
+{
+  rm -rf run_*
+  create_run 41 600 4 6 040 24
+  create_run 41 600 4 6 080 12
+  create_run 41 600 4 6 160 06
+  create_run 41 600 4 4 160 04
+  create_run 41 600 4 4 080 08
+  create_run 41 600 4 2 040 08
+  create_run 41 600 4 1 020 08
+  create_run 41 600 4 1 040 04
+  create_run 41 600 4 1 080 02
+  create_run 41 600 4 1 160 01
+  create_run 41 600 2 1 040 01
+  ls -d run_*
+}
+
+function cmd_create_110km()
+{
+  rm -rf run_*
+  create_run 81 300 4 1 160 01
+  create_run 81 300 6 1 360 01
+  create_run 81 300 8 1 160 04
+  create_run 81 300 8 1 640 01
+  ls -d run_*
+}
+
+function cmd_create_70km()
+{
+  rm -rf run_*
+  create_run 129 200 8 1 640 01
+  create_run 129 200 10 1 1000 01
+  create_run 129 200 12 1 1440 01
+  create_run 129 200 16 1 2560 01
+  ls -d run_*
+}
+
+function cmd_create_35km()
+{
+  rm -rf run_*
+  create_run 257 100 12 1 1440 1
+  create_run 257 100 12 1 0720 2
+  create_run 257 100 12 1 0360 4
+  create_run 257 100 12 1 0120 12
+  create_run 257 100 12 1 0060 24
+  create_run 257 100 12 2 1440 2
+  create_run 257 100 12 4 1440 4
+  create_run 257 100 12 6 1440 6
+  create_run 257 100 12 8 1440 8
+  create_run 257 100 16 1 2560 1
+  create_run 257 100 16 1 1280 2
+  create_run 257 100 16 1 0640 4
+  create_run 257 100 16 1 0320 8
+  create_run 257 100 16 4 2560 4
+  create_run 257 100 16 6 2560 6
+  create_run 257 100 16 8 2560 8
+  create_run 257 100 24 4 5760 4
+  ls -d run_*
+}
+
+function cmd_create_8km()
+{
+  rm -rf run_*
+  create_run 1025 20 32 1 2560 4
+  ls -d run_*
+}
+
+function cmd_submit()
+{
+  for RUN in run_* ; do
+      cd $RUN
+      if [ -f already_done ]; then
+	  echo "$RUN has run already."
+      else
+	  ccc_msub job.sh
+      fi
+      cd ..
+  done
+}
+
+#------------------------------------- Reporting --------------------------------------
+
+function get_troughput()
+{
+    grep Throughput logs/gcm.log | tail -n 5 | awk '{print $12}' | sort -r | head -n 1
+}
+
+function get_ms_step()
+{
+    grep 'ms/step' logs/gcm.log | tail -n 5 | awk '{print $8}' | sort -r | head -n 1
+}
+
+function get_frac()
+{
+    grep $1 logs/gcm.log | grep -v DEFAULT | grep -v caldyn | grep -v nqdyn | tail -n 4 | head -n 1 | awk '{print $3}'
+}
+function cmd_stats()
+{
+    echo RUN frac_dyn_adv frac_MPI Throughput ms/step 
+    for RUN in run_* ; do
+	cd $RUN
+#	pwd
+#	ls logs/gcm.log
+	frac_adv=$(get_frac adv)
+	frac_dyn=$(get_frac dyn)
+	frac_adv_MPI=$(get_frac adv_MPI)
+	frac_dyn_MPI=$(get_frac dyn_MPI)
+#	echo $frac_adv $frac_dyn $frac_adv_MPI $frac_dyn_MPI
+	echo $RUN $(( frac_adv+frac_dyn )) $((frac_adv_MPI+frac_dyn_MPI)) $(get_troughput) $(get_ms_step)
+        cd ..
+    done
+}
+
+function MPI()
+{
+    run=$1
+    cmd=$2
+    nprocs=$(echo $run | tr "_" ' ' | awk '{print $4'} )
+    nprocs=$(compute $nprocs)
+    stats=$(grep MPI_$cmd $run/logs/gcm.log | tail -n 1)
+    time=$(echo $stats | awk '{print $3}')
+    count=$(echo $stats | awk '{print $4}')
+    wall=$(echo $stats | awk '{print $5}')
+#    echo $stats
+#    echo $nprocs $time $count $wall >&2
+#    echo $run $cmd
+    echo $run $cmd $(compute "$time/$nprocs") $((count/nprocs)) $wall
+}
+
+function compute()
+{
+    bc <<< "scale=2 ; $1"
+}
+function cmd_MPI()
+{
+# MPI_Waitall MPI_Alltoall MPI_Allreduce MPI_Bcast MPI_Barrier MPI_Isend MPI_Comm_size MPI_Reduce MPI_Irecv MPI_Comm_rank MPI_Init MPI_Finalize
+    echo '# [run] [func] [time] [count] <%wall>'
+    for cmd in Alltoall Allreduce Bcast Waitall Barrier ; do
+	for run in run_* ; do 
+#	    echo $run $(grep MPI_$cmd $run/logs/gcm.log)
+	    MPI $run $cmd
+	done 
+    done
+}
+function  elapsed()
+{
+    cd $1
+    useful=$(grep elapsed logs/gcm.log | awk '{print $4}')
+    echo $useful
+    hhmmss=$(grep icosa_gcm.exe DYN_bench*.o | awk '{print $7}')
+    minutes=$(date +'%M' -d $hhmmss)
+    seconds=$(date +'%S' -d $hhmmss)    
+    echo $(compute "$seconds+60*$minutes-$useful")
+    cd ..
+}
+
+function cmd_elapsed()
+{
+    for x in run_* ; do
+	echo $x $(elapsed $x)
+    done
+}
+
+#---------------------------------------------------------------------------------------
+
+function cmd_clean()
+{
+    rm -f $(find . -name restart.nc)
+}
+
+echo "Usage : benchmark.sh COMMAND"
+echo "Available commands : create_220km create_35km submit clean stats"
+echo "Your command : $1"
+
+cmd_$1
Index: configs/testing/benchmark/job.sh
===================================================================
--- configs/testing/benchmark/job.sh	(revision 702)
+++ configs/testing/benchmark/job.sh	(revision 702)
@@ -0,0 +1,65 @@
+#!/bin/bash
+## Request name
+#MSUB -r DYN_bench
+#MSUB -E '--exclude=irene[1325-1346]'
+## Number of tasks (=MPI processes) to use
+#MSUB -n NUM_MPI
+## Number of OpenMP threads
+#MSUB -c NUM_OMP
+## Elapsed time limit in seconds
+#MSUB -T 1800
+# account, partition (Xeon/KNL)
+#MSUB -A gch0316
+#MSUB -q skylake
+# Mount  on compute node
+#MSUB -m work
+
+function run_standard()
+{
+    date > gcm.log
+    ccc_mprun /ccc/work/cont003/gen7548/dubosth/IRENE/testing/build_mpi_omp/bin/icosa_gcm.exe >> gcm.log
+    date >> gcm.log
+}
+
+function run_mpmd()
+{
+    ln -s dynamico.0000.out gcm.log
+    ccc_mprun -f mpmd.conf
+}
+
+function run_hmpmd()
+{
+    module load feature/bridge/heterogenous_mpmd
+    ln -s dynamico.0000.out gcm.log
+    ccc_mprun -f hmpmd.conf
+}
+
+cd ${BRIDGE_MSUB_PWD} 
+
+source  /ccc/work/cont003/gen7548/dubosth/IRENE/testing/build_mpi_omp/arch.env
+module load ipm
+export IPM_REPORT=full
+export OMP_NUM_THREADS=$BRIDGE_MSUB_NCORE
+export OMP_STACKSIZE=128M
+
+rm -rf dynamico.* gcm.log logs *.nc netcdf
+ulimit -s unlimited
+
+#run_standard
+run_mpmd
+#run_hmpmd
+
+grep MAIN gcm.log
+tail -n 50 gcm.log
+
+mkdir -p netcdf
+cp gcm.log *.def netcdf
+mv *.nc netcdf
+
+mkdir -p logs
+cp *.xml logs
+cp -pr /ccc/work/cont003/gen7548/dubosth/IRENE/testing/build_mpi_omp/bin/icosa_gcm.exe logs
+cp -pr /ccc/work/cont003/gen7548/dubosth/IRENE/testing/DYNAMICO_trunk/src logs
+mv gcm.log xios_client_*.err xios_client_*.out dynamico.* logs
+
+touch already_done
Index: configs/testing/benchmark/run.def
===================================================================
--- configs/testing/benchmark/run.def	(revision 702)
+++ configs/testing/benchmark/run.def	(revision 702)
@@ -0,0 +1,38 @@
+#------------- Planet ---------------
+radius=6.37122e6
+g=9.80616
+cpp=1004.5
+kappa=0.2857143
+preff=1e5
+#------------- Dynamics  ------------
+#-------------- Mesh ----------------
+nbp=NBP
+optim_it=0
+nsplit_i=NSPLIT
+nsplit_j=NSPLIT
+llm=79
+omp_level_size=OMP_LEVEL_SIZE
+disvert=std
+#------------ Numerics --------------
+time_scheme=RK2.5
+dt=TIME_STEP
+#----------- Dissipation ------------
+nitergdiv=2
+tau_graddiv=10000
+nitergrot=2
+tau_gradrot=10000
+niterdivgrad=2
+tau_divgrad=10000
+#-------------- Physics -------------
+physics=held_suarez
+itau_physics=6
+nqtot=4
+itau_adv=2
+#---------------- Run ---------------
+#run_length=86400
+itaumax=1000
+#itaumax=1
+write_period=86400
+etat0=held_suarez
+#------------ Diagnostics -----------
+itau_check_conserv=144
Index: configs/testing/setup.sh
===================================================================
--- configs/testing/setup.sh	(revision 629)
+++ configs/testing/setup.sh	(revision 702)
@@ -44,4 +44,5 @@
 arch="$arch"
 job="$job"
+other_XIOS="$pther_XIOS"
 other="$other"
 EOF
