Index: /XIOS/dev/dev_trunk_omp/GENERIC_TESTCASE/test_scalar_algo/context_atm.xml
===================================================================
--- /XIOS/dev/dev_trunk_omp/GENERIC_TESTCASE/test_scalar_algo/context_atm.xml	(revision 1697)
+++ /XIOS/dev/dev_trunk_omp/GENERIC_TESTCASE/test_scalar_algo/context_atm.xml	(revision 1697)
@@ -0,0 +1,437 @@
+<!-- -->
+<context id="atm">
+  
+  <calendar type="Gregorian" time_origin="1850-01-01 00:00:00" /> 
+  
+  <domain_definition>
+    <domain id="domain" />
+    <domain id="other_domain" />
+  </domain>
+  
+  <axis_definition>
+    <axis id="axis" />
+    <axis id="axis_dup" />
+    <axis id="domain_X" />
+    <axis id="domain_Y" />
+    <axis id="ensemble" />
+
+    <axis id="other_axis" />
+    <axis id="other_domain_X" />
+    <axis id="other_domain_Y" />
+    <axis id="other_ensemble" />
+  </axis_definition>
+
+  <axis_definition>
+    <axis id="axis_zoom" axis_ref="axis">
+        <zoom_axis begin="0" n="5"/>
+    </axis>
+    <axis id="domain_X_zoom" axis_ref="domain_X">
+        <zoom_axis begin="0" n="1"/>
+    </axis>
+    <axis id="domain_Y_zoom" axis_ref="domain_Y">
+        <zoom_axis begin="3" n="1"/>
+    </axis>
+  </axis_definition>
+
+  <scalar_definition>
+    <scalar id="scalar" /> 
+  </scalar_definition>
+  
+  
+  
+  <grid_definition>
+    
+    <grid id="grid3D">
+      <domain domain_ref="domain" />
+      <axis axis_ref="axis" />
+    </grid>
+    
+    <grid id="grid2D">
+      <domain domain_ref="domain" />
+    </grid>
+
+    <grid id="grid1D">
+      <axis axis_ref="axis" />
+    </grid>
+
+    <grid id="grid_X">
+      <axis axis_ref="domain_X" />
+    </grid>
+
+     <grid id="grid_X_zoom">
+      <axis axis_ref="domain_X_zoom" />
+    </grid>
+
+    <grid id="grid_Y">
+      <axis axis_ref="domain_Y" />
+    </grid>
+
+    <grid id="grid_XY">
+      <axis axis_ref="domain_X" />
+      <axis axis_ref="domain_Y" />
+    </grid>
+
+    <grid id="grid_XYZ">
+      <axis axis_ref="domain_X" />
+      <axis axis_ref="domain_Y" />
+      <axis axis_ref="axis" />
+    </grid>
+
+    <grid id="grid_XZ">
+      <axis axis_ref="domain_X" />
+      <axis axis_ref="axis" />
+    </grid>
+
+    <grid id="grid_YZ">
+      <axis axis_ref="domain_Y" />
+      <axis axis_ref="axis" />
+    </grid>
+
+
+    <grid id="grid3D_W">
+      <domain domain_ref="domain" />
+      <axis axis_ref="axis" />
+      <axis axis_ref="ensemble" />
+    </grid>
+    
+    <grid id="grid2D_W">
+      <domain domain_ref="domain" />
+      <axis axis_ref="ensemble" />
+    </grid>
+
+    <grid id="grid1D_W">
+      <axis axis_ref="axis" />
+      <axis axis_ref="ensemble" />
+    </grid>
+
+    <grid id="grid_XW">
+      <axis axis_ref="domain_X" />
+      <axis axis_ref="ensemble" />
+    </grid>
+
+    <grid id="grid_YW">
+      <axis axis_ref="domain_Y" />
+      <axis axis_ref="ensemble" />
+    </grid>
+
+    <grid id="grid_XYW">
+      <axis axis_ref="domain_X" />
+      <axis axis_ref="domain_Y" />
+      <axis axis_ref="ensemble" />
+    </grid>
+
+    <grid id="grid_XYZW">
+      <axis axis_ref="domain_X" />
+      <axis axis_ref="domain_Y" />
+      <axis axis_ref="axis" />
+      <axis axis_ref="ensemble" />
+    </grid>
+
+    <grid id="grid_XZW">
+      <axis axis_ref="domain_X" />
+      <axis axis_ref="axis" />
+      <axis axis_ref="ensemble" />
+    </grid>
+
+    <grid id="grid_YZW">
+      <axis axis_ref="domain_Y" />
+      <axis axis_ref="axis" />
+      <axis axis_ref="ensemble" />
+    </grid>
+
+
+    <grid id="grid_XY_zoom_Y">
+      <axis axis_ref="domain_X" />
+      <axis axis_ref="domain_Y_zoom" />
+    </grid>
+
+    <grid id="grid_XY_zoom_X">
+      <axis axis_ref="domain_X_zoom" />
+      <axis axis_ref="domain_Y" />
+
+    </grid>
+
+ 
+ 
+ 
+ 
+ 
+    <grid id="other_grid3D">
+      <domain domain_ref="other_domain" />
+      <axis axis_ref="other_axis" />
+    </grid>
+    
+    <grid id="other_grid2D">
+      <domain domain_ref="other_domain" />
+    </grid>
+
+    <grid id="other_grid1D">
+      <axis axis_ref="other_axis" />
+    </grid>
+
+    <grid id="other_grid_X">
+      <axis axis_ref="other_domain_X" />
+    </grid>
+
+    <grid id="other_grid_Y">
+      <axis axis_ref="other_domain_Y" />
+    </grid>
+
+    <grid id="other_grid_XY">
+      <axis axis_ref="other_domain_X" />
+      <axis axis_ref="other_domain_Y" />
+    </grid>
+
+    <grid id="other_grid_XYZ">
+      <axis axis_ref="other_domain_X" />
+      <axis axis_ref="other_domain_Y" />
+      <axis axis_ref="other_axis" />
+    </grid>
+
+    <grid id="other_grid_XZ">
+      <axis axis_ref="other_domain_X" />
+      <axis axis_ref="other_axis" />
+    </grid>
+
+    <grid id="other_grid_YZ">
+      <axis axis_ref="other_domain_Y" />
+      <axis axis_ref="other_axis" />
+    </grid>
+
+
+    <grid id="other_grid3D_W">
+      <domain domain_ref="other_domain" />
+      <axis axis_ref="other_axis" />
+      <axis axis_ref="other_ensemble" />
+    </grid>
+    
+    <grid id="other_grid2D_W">
+      <domain domain_ref="other_domain" />
+      <axis axis_ref="other_ensemble" />
+    </grid>
+
+    <grid id="other_grid1D_W">
+      <axis axis_ref="other_axis" />
+      <axis axis_ref="other_ensemble" />
+    </grid>
+
+    <grid id="other_grid_XW">
+      <axis axis_ref="other_domain_X" />
+      <axis axis_ref="other_ensemble" />
+    </grid>
+
+    <grid id="other_grid_YW">
+      <axis axis_ref="other_domain_Y" />
+      <axis axis_ref="other_ensemble" />
+    </grid>
+
+    <grid id="other_grid_XYW">
+      <axis axis_ref="other_domain_X" />
+      <axis axis_ref="other_domain_Y" />
+      <axis axis_ref="other_ensemble" />
+    </grid>
+
+    <grid id="other_grid_XYZW">
+      <axis axis_ref="other_domain_X" />
+      <axis axis_ref="other_domain_Y" />
+      <axis axis_ref="other_axis" />
+      <axis axis_ref="other_ensemble" />
+    </grid>
+
+    <grid id="other_grid_XZW">
+      <axis axis_ref="other_domain_X" />
+      <axis axis_ref="other_axis" />
+      <axis axis_ref="other_ensemble" />
+    </grid>
+
+    <grid id="other_grid_YZW">
+      <axis axis_ref="other_domain_Y" />
+      <axis axis_ref="other_axis" />
+      <axis axis_ref="other_ensemble" />
+    </grid>
+
+
+
+
+
+
+
+
+
+
+    <grid id="grid_vert_reduce">
+      <domain domain_ref="domain" />
+      <scalar >
+        <reduce_axis operation="sum" />
+      </scalar>
+    </grid>
+
+    <grid id="grid_horiz_reduce">
+      <scalar >
+        <reduce_domain operation="sum" />
+      </scalar>
+      <axis axis_ref="axis" />
+    </grid>
+      
+    <grid id="grid_zoom_vert">
+      <domain domain_ref="domain" />
+      <axis axis_ref="axis_zoom" />
+    </grid>
+
+    <grid id="grid_zoom_vert_sum">
+      <scalar >
+        <reduce_domain operation="sum" />
+      </scalar>
+      <axis axis_ref="axis_zoom" />
+    </grid>
+
+   <grid id="grid_lat">
+       <axis axis_ref="domain_Y">
+         <reduce_domain direction="iDir" operation="sum"/> 
+       </axis>
+       <axis axis_ref="axis" />
+    </grid>
+    
+
+    <grid id="grid3D_invert">
+      <domain domain_ref="domain">
+        <reorder_domain invert_lat="true" />
+      </domain>
+      <axis axis_ref="axis" />
+    </grid>
+    
+    <grid id="grid2D_invert">
+      <domain domain_ref="domain">
+        <reorder_domain invert_lat="true" shift_lon_fraction="0.5" min_lon="0" max_lon="360"/>
+      </domain>
+    </grid>
+
+    
+  </grid_definition>
+  
+  
+  <field_definition level="1" prec="8" operation="instant" freq_op="1ts" enabled=".true." default_value="1.e+20" detect_missing_value="true">
+    <field id="field2D" grid_ref="grid2D" build_workflow_graph="false" />
+    <field id="field3D" grid_ref="grid3D" build_workflow_graph="true"  />
+    <field id="pressure" grid_ref="grid3D"  />
+    <field id="field3D_recv" read_access="true" grid_ref="grid3D"  field_ref="field3D" />
+    <field id="field3D_resend" grid_ref="grid3D" />
+
+    <field id="field_X" grid_ref="grid_X" build_workflow_graph="false" />
+    <field id="field_Y" grid_ref="grid_Y" build_workflow_graph="false" />
+    <field id="field_Z" grid_ref="grid1D" build_workflow_graph="false" />
+    <field id="field_XY" grid_ref="grid_XY" />
+    <field id="field_XYZ" grid_ref="grid_XYZ" />
+    <field id="field_XZ" grid_ref="grid_XZ" />
+    <field id="field_YZ" grid_ref="grid_YZ" />
+
+    <field id="field_zoom_vert" field_ref="field3D" grid_ref="grid_zoom_vert"  />
+    <field id="field_zoom_vert_sum" field_ref="field_zoom_vert" grid_ref="grid_zoom_vert_sum"  />
+
+
+
+    <field id="field2D_W" grid_ref="grid2D_W"/>
+    <field id="field3D_W" grid_ref="grid3D_W"  />
+    <field id="pressure_W" grid_ref="grid3D_W"  />
+    <field id="field3D_recv_W" read_access="true" grid_ref="grid3D_W"  field_ref="field3D_W"/>
+    <field id="field3D_resend_W" grid_ref="grid3D_W" />
+
+    <field id="field_XW" grid_ref="grid_XW" />
+    <field id="field_YW" grid_ref="grid_YW" />
+    <field id="field_ZW" grid_ref="grid1D_W" />
+    <field id="field_XYW" grid_ref="grid_XYW" />
+    <field id="field_XYZW" grid_ref="grid_XYZW" />
+    <field id="field_XZW" grid_ref="grid_XZW" />
+    <field id="field_YZW" grid_ref="grid_YZW" />
+
+
+
+
+    <field id="other_field2D" grid_ref="other_grid2D"/>
+    <field id="other_field3D" grid_ref="other_grid3D"  />
+    <field id="other_pressure" grid_ref="other_grid3D"  />
+    <field id="other_field3D_recv" read_access="true" grid_ref="other_grid3D"  field_ref="other_field3D"/>
+    <field id="other_field3D_resend" grid_ref="other_grid3D" />
+
+    <field id="other_field_X" grid_ref="other_grid_X" />
+    <field id="other_field_Y" grid_ref="other_grid_Y" />
+    <field id="other_field_Z" grid_ref="other_grid1D" />
+    <field id="other_field_XY" grid_ref="other_grid_XY" />
+    <field id="other_field_XYZ" grid_ref="other_grid_XYZ" />
+    <field id="other_field_XZ" grid_ref="other_grid_XZ" />
+    <field id="other_field_YZ" grid_ref="other_grid_YZ" />
+
+    <field id="other_field2D_W" grid_ref="other_grid2D_W"/>
+    <field id="other_field3D_W" grid_ref="other_grid3D_W"  />
+    <field id="other_pressure_W" grid_ref="other_grid3D_W"  />
+    <field id="other_field3D_recv_W" read_access="true" grid_ref="other_grid3D_W"  field_ref="other_field3D_W"/>
+    <field id="other_field3D_resend_W" grid_ref="other_grid3D_W" />
+
+    <field id="other_field_XW" grid_ref="other_grid_XW" />
+    <field id="other_field_YW" grid_ref="other_grid_YW" />
+    <field id="other_field_ZW" grid_ref="other_grid1D_W" />
+    <field id="other_field_XYW" grid_ref="other_grid_XYW" />
+    <field id="other_field_XYZW" grid_ref="other_grid_XYZW" />
+    <field id="other_field_XZW" grid_ref="other_grid_XZW" />
+    <field id="other_field_YZW" grid_ref="other_grid_YZW" />
+
+
+
+
+    
+    
+  </field_definition>
+  
+
+  <file_definition  type="one_file" >
+    
+    <file id="atm_output" output_freq="1ts" type="one_file" enabled="true">
+       <!-- <field id="id_fieldXY" field_ref="field_XY" operation="once" enabled="true"/> -->
+       <field id="id_fieldX" field_ref="field_X" operation="once" enabled="true"/>
+    </file>
+
+     <file id="atm_output_zoom" output_freq="1ts" enabled="true">
+       <field id="fieldX_zoomX" field_ref="field_X" grid_ref="grid_X_zoom" operation="once" enabled="true"/>
+       <!-- <field id="fieldXY_zoomX" field_ref="field_XY" grid_ref="grid_XY_zoom_X" operation="once" enabled="true"/>
+       <field id="fieldXY_zoomY" field_ref="field_XY" grid_ref="grid_XY_zoom_Y" operation="once" enabled="true"/> -->
+    </file>
+
+
+    <file id="atm_output_other" output_freq="1ts"  enabled="false">
+       <field field_ref="other_field3D" enabled="false"/>
+       <field field_ref="other_field2D" enabled="true"/> 
+       <field field_ref="other_field_X" enabled="false"/>
+       <field field_ref="other_field_Y" enabled="false"/>
+       <field field_ref="other_field_XY" enabled="false"/>
+       <field field_ref="other_field_Z" enabled="false"/>
+       <field field_ref="other_field_XYZ" enabled="false"/>
+       <field field_ref="other_field_XZ" enabled="false"/>
+       <field field_ref="other_field_YZ" enabled="false"/>
+    </file>
+
+    <file id="atm_output_W" output_freq="1ts" enabled="false">
+       <field field_ref="field3D_W" enabled="true"/>
+       <field field_ref="field2D_W" enabled="true"/> 
+       <field field_ref="field_XW" enabled="true"/>
+       <field field_ref="field_YW" enabled="true"/>
+       <field field_ref="field_XYW" enabled="true"/>
+       <field field_ref="field_ZW" enabled="true"/>
+       <field field_ref="field_XYZW" enabled="true"/>
+       <field field_ref="field_XZW" enabled="true"/>
+       <field field_ref="field_YZW" enabled="true"/>
+    </file>
+    
+
+    <file id="atm_output_reorder" output_freq="1ts" enabled="false" >
+       <field field_ref="field2D" grid_ref="grid2D_invert" enabled="true"/>
+    </file>
+    
+    <file id="test_grid_lat" output_freq="1ts" enabled="false">
+      <field field_ref="field3D" operation="instant" />
+      <field id="field_reduce_lat" field_ref="field3D" grid_ref="grid_lat" operation="instant" />
+    </file>
+    
+  </file_definition>
+  
+  
+</context>
Index: /XIOS/dev/dev_trunk_omp/GENERIC_TESTCASE/test_scalar_algo/context_grid_dynamico.xml
===================================================================
--- /XIOS/dev/dev_trunk_omp/GENERIC_TESTCASE/test_scalar_algo/context_grid_dynamico.xml	(revision 1697)
+++ /XIOS/dev/dev_trunk_omp/GENERIC_TESTCASE/test_scalar_algo/context_grid_dynamico.xml	(revision 1697)
@@ -0,0 +1,19 @@
+<context id="grid_dynamico">
+  
+  <calendar type="Gregorian" time_origin="1850-01-01 00:00:00" timestep="1s"/> 
+   
+   
+  <file_definition>   
+     <file id="dynamico_grid" name="Ai" mode="read" output_freq="1ts" type="one_file">
+       <field id="Ai" domain_ref="domain_dynamico" operation="instant"/>
+     </file>
+  </file_definition>
+  
+  <domain_definition>
+    <domain id="domain_dynamico" type="unstructured">
+      <generate_rectilinear_domain/>
+    </domain>
+  </domain_definition>
+
+
+</context>
Index: /XIOS/dev/dev_trunk_omp/GENERIC_TESTCASE/test_scalar_algo/iodef.xml
===================================================================
--- /XIOS/dev/dev_trunk_omp/GENERIC_TESTCASE/test_scalar_algo/iodef.xml	(revision 1697)
+++ /XIOS/dev/dev_trunk_omp/GENERIC_TESTCASE/test_scalar_algo/iodef.xml	(revision 1697)
@@ -0,0 +1,66 @@
+<?xml version="1.0"?>
+<simulation>
+
+  <context id="atm">
+    <variable_definition>
+
+      <variable id="timestep"> 1h </variable>
+      <variable id="domain"> lmdz </variable>
+      <variable id="domain_mask"> true </variable>
+      <variable id="axis_mask"> true </variable>
+      <variable id="init_field2D"> rank </variable>
+      <variable id="ni"> 36 </variable>
+      <variable id="nj"> 18 </variable>
+      <variable id="nlev"> 10 </variable>
+      <variable id="pressure_factor"> 0.10 </variable>
+      <variable id="mask3d"> false </variable>
+<!--      <variable id="domain_proc_frac">3</variable>
+      <variable id="axis_proc_frac">2</variable>
+      <variable id="axis_proc_n">2</variable>
+      <variable id="ensemble_proc_n">2</variable> -->
+      
+      <variable id="other_domain"> lmdz </variable>
+      <variable id="other_domain_mask"> false </variable>
+      <variable id="other_axis_mask"> false </variable>
+      <variable id="other_init_field2D"> academic </variable>
+      <variable id="other_ni"> 36 </variable>
+      <variable id="other_nj"> 18 </variable>
+      <variable id="other_nlev"> 10 </variable>
+      <variable id="other_pressure_factor"> 0.10 </variable>
+      <variable id="other_mask3d"> false </variable>
+<!--      <variable id="other_domain_proc_frac">3</variable>
+      <variable id="other_axis_proc_frac">2</variable>
+      <variable id="other_axis_proc_n">2</variable>
+      <variable id="other_ensemble_proc_n">2</variable> -->
+      
+    </variable_definition>
+  </context>
+
+
+
+  <context id="atm" src="./context_atm.xml"/>
+  <context id="grid_dynamico" src="./context_grid_dynamico.xml"/>
+  
+  <context id="xios">
+    <variable_definition>
+      <variable_group id="buffer">
+	<variable id="min_buffer_size" type="int">10000000</variable>
+	<variable id="optimal_buffer_size" type="string">performance</variable>
+	<variable id="buffer_factor_size" type="double">0.8</variable> 
+      </variable_group>
+
+      <variable_group id="parameters" >
+        <variable id="using_server" type="bool">true</variable>
+        <variable id="info_level" type="int">100</variable>
+        <variable id="print_file" type="bool">true</variable>
+        <variable id="using_server2" type="bool">false</variable>
+        <variable id="ratio_server2" type="int">50</variable>
+        <variable id="number_pools_server2" type="int">1</variable>
+        <variable id="pure_one_sided" type="bool">false</variable>
+        <variable id="check_event_sync" type="bool">true</variable>
+      </variable_group>
+      <variable id="activate_non_distributed_transformation" type="bool">true</variable>
+    </variable_definition>
+  </context>
+
+</simulation>
Index: /XIOS/dev/dev_trunk_omp/GENERIC_TESTCASE/test_scalar_algo/job.sh
===================================================================
--- /XIOS/dev/dev_trunk_omp/GENERIC_TESTCASE/test_scalar_algo/job.sh	(revision 1697)
+++ /XIOS/dev/dev_trunk_omp/GENERIC_TESTCASE/test_scalar_algo/job.sh	(revision 1697)
@@ -0,0 +1,45 @@
+# Arbitrary name of the LoadLeveler job
+# @ job_name = Generic_testcase
+# Standard job output file
+# @ output   = $(job_name).out
+# Error job output file
+# @ error    = $(job_name).err
+# Type of job
+# @ job_type = mpich
+# Number of MPI processes requested
+# @ total_tasks = 12
+# Number of OpenMP/pthreads tasks per MPI process
+# @ nb_threads  = 4
+# @ resources = ConsumableCpus($(nb_threads))
+# Permits passing total_tasks to mpirun via NB_TASKS
+# as well as the number of threads/processes
+# @ environment = OMP_NUM_THREADS=$(nb_threads); NB_TASKS=$(total_tasks)
+# Job time hh:mm:ss (1h30mn here)
+# @ wall_clock_limit = 0:30:00
+# @ queue
+
+# Recommendation : Compile and execute your codes under the same Intel environment.  
+# If necessary, therefore, use the module command to load the appropriate environment.
+# For example, if your code is compiled with Intel/2016.2, uncomment the following line:
+#module load intel/2016.2
+
+# To have the command echoes
+set -x
+
+module load intel/2018.2
+module load gcc/6.4.0
+
+# The LOADL_STEP_INITDIR vaiable is automatically set by
+# LoadLeveler at the directory where the llsubmit is typed
+#cp $LOADL_STEP_INITDIR/a.out .
+# The max. STACK memory used (default 4MB) (here 16 MB) per
+# the private variables of each thread.
+export KMP_STACKSIZE=16m
+# It is also possible to use OMP_STACKSIZE
+# export OMP_STACKSIZE=16M
+
+# Execution of a parallel hybrid program (MPI + threads).
+mpirun -np $NB_TASKS ../../build_prod/bin/generic_testcase.exe
+
+
+
Index: /XIOS/dev/dev_trunk_omp/GENERIC_TESTCASE/test_scalar_algo/param.def
===================================================================
--- /XIOS/dev/dev_trunk_omp/GENERIC_TESTCASE/test_scalar_algo/param.def	(revision 1697)
+++ /XIOS/dev/dev_trunk_omp/GENERIC_TESTCASE/test_scalar_algo/param.def	(revision 1697)
@@ -0,0 +1,4 @@
+&params_run
+duration='1d'
+nb_proc_atm=8
+/
