Index: /XIOS/dev/dev_ym/XIOS_COUPLING/generic_testcase/context_atm.xml
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/generic_testcase/context_atm.xml	(revision 2032)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/generic_testcase/context_atm.xml	(revision 2032)
@@ -0,0 +1,506 @@
+<!-- -->
+<context id="atm">
+  
+  <calendar type="Gregorian" time_origin="1850-01-01 00:00:00" /> 
+ 
+  <scalar_definition>
+    <scalar id="scalar" /> 
+    <scalar id="other_scalar" /> 
+  </scalar_definition>
+ 
+ 
+  <axis_definition>
+    <axis id="axis" />
+    <axis id="axis_str" n_glo="10" label="(0,9) [toto titi tata turlututu tito tati tuto tato tete tetu ] "/>
+    <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 id="axis_zoom" axis_ref="axis">
+        <zoom_axis begin="0" n="5"/>
+    </axis>
+  </axis_definition>
+
+ 
+  <domain_definition>
+    <domain id="domain" />
+    <domain id="other_domain" />
+  </domain_definition>
+  
+  
+  
+  <grid_definition>
+    
+    <grid id="grid3D">
+      <domain domain_ref="domain" />
+      <axis axis_ref="axis" />
+    </grid>
+    
+    <grid id="grid2D">
+      <domain domain_ref="domain" id="grid2D_dom" />
+    </grid>
+
+    <grid id="grid1D">
+      <axis axis_ref="axis" />
+    </grid>
+
+    <grid id="grid0D">
+      <scalar scalar_ref="scalar" />
+    </grid>
+
+    <grid id="grid_X">
+      <axis axis_ref="domain_X" />
+    </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="grid0D_W">
+      <scalar scalar_ref="scalar" />
+      <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="other_grid3D">
+      <domain domain_ref="other_domain" />
+      <axis axis_ref="other_axis" />
+    </grid>
+    
+    <grid id="other_grid2D">
+      <domain domain_ref="other_domain" id="test_dom" />
+    </grid>
+
+    <grid id="other_grid1D">
+      <axis axis_ref="other_axis" />
+    </grid>
+
+    <grid id="other_grid0D">
+      <scalar scalar_ref="other_scalar" />
+    </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_grid0D_W">
+      <scalar scalar_ref="other_scalar" />
+      <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_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="field0D" grid_ref="grid0D"/>
+    <field id="field2D" grid_ref="grid2D" />
+    <field id="field3D" grid_ref="grid3D"  />
+    <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" />
+    <field id="field_Y" grid_ref="grid_Y" />
+    <field id="field_Z" grid_ref="grid1D" />
+    <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="field0D_W" grid_ref="grid0D_W"/>
+    <field id="field2D_W" grid_ref="grid2D_W"/>
+    <field id="field3D_W" grid_ref="grid3D_W"  />
+    <field id="pressure_W" grid_ref="grid3D_W"  />
+<!-- ym disable for now
+    <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_field0D" grid_ref="other_grid0D"/>
+<!--    <field id="other_field2D" grid_ref="other_grid2D"/> -->
+    <field id="other_field2D" grid_ref="zoom1"/>
+    <field id="other_field3D" grid_ref="other_grid3D"  />
+    <field id="other_pressure" grid_ref="other_grid3D"  />
+<!-- ym disable for now
+    <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_field0D_W" grid_ref="other_grid0D_W"/>
+    <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"  />
+<!-- ym disable for now
+    <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>
+  
+
+<!-- test transform  -->
+
+
+  <axis_definition>
+    <axis id="axis_inverse" axis_ref="axis">
+      <inverse_axis />
+    </axis>
+
+    <axis id="axis_extract" >
+      <extract_axis begin="1" n="5" />
+    </axis>
+
+
+
+  </axis_definition>
+
+  <domain_definition>
+
+    <domain id="domain_extract">
+      <extract_domain ibegin="0" ni="36" jbegin="2" nj="3" />
+    </domain>
+ 
+ 
+    <domain id="domain_reorder" >
+      <reorder_domain invert_lat="true" shift_lon_fraction="0.5"/>
+    </domain>
+  
+    <domain id="domain_expand" >
+      <expand_domain order="1" type="edge"/>
+    </domain>
+  
+    <domain id="domain_interpolate" domain_ref="other_domain" >
+      <interpolate_domain detect_missing_value="false"/>
+    </domain>
+  
+    <domain id="domain_connect" >
+      <compute_connectivity_domain type="edge"/>
+    </domain>
+
+    <domain id="domain_recti" ni_glo="40" nj_glo="20" type="rectilinear" />
+
+  
+    <domain id="domain_expand_extract" >
+      <expand_domain order="1" type="edge"/>
+      <extract_domain ibegin="0" ni="38" jbegin="2" nj="3" />
+    </domain>
+  
+
+
+  </domain_definition>
+  
+  <grid_definition>
+ 
+    <grid id="grid1D_inverse">
+      <axis axis_ref="axis_inverse" />
+    </grid>
+  
+    <grid id="grid1D_extract">
+      <axis axis_ref="axis_extract" />
+    </grid>
+  
+
+    <grid id="grid2D_extract">
+      <domain domain_ref="domain_extract" />
+    </grid>
+  
+    <grid id="grid2D_zoom">
+      <domain domain_ref="domain_zoom" />
+    </grid>
+ 
+
+    <grid id="grid2D_reorder">
+      <domain domain_ref="domain_reorder" />
+    </grid>
+ 
+    <grid id="grid2D_expand">
+      <domain domain_ref="domain_expand" />
+    </grid>
+
+    <grid id="grid2D_interpolate">
+      <domain domain_ref="domain_interpolate" />
+    </grid>
+  
+
+    <grid id="grid2D_connect">
+      <domain domain_ref="domain_connect" />
+    </grid>
+
+
+    <grid id="grid2D_recti">
+      <domain domain_ref="domain_recti" >
+        <generate_rectilinear_domain lat_start="-85" lon_start="-175" />
+        <interpolate_domain detect_missing_value="false"/>
+      </domain>
+    </grid>
+ 
+    <grid id="grid2D_expand_extract">
+      <domain domain_ref="domain_expand_extract" />
+    </grid>
+  
+    <grid id="grid2D_extract_domain">  
+      <axis  n_glo="36">
+        <extract_domain position="2" direction="jDir" />
+      </axis>
+    </grid>
+
+    <grid id="grid3D_axis_interpolate">
+      <domain domain_ref="domain"/>
+      <axis n_glo="2" value="(0,1)[40000 20000]">
+        <interpolate_axis coordinate="pressure" />
+      </axis>
+    </grid> 
+ 
+    <grid id="grid3D_axis_interpolate_bis">
+      <domain domain_ref="domain"/>
+      <axis n_glo="2" value="(0,1)[40000 20000]">
+        <interpolate_axis />
+      </axis>
+    </grid> 
+
+
+  </grid_definition>
+ 
+ 
+  <field_definition>
+    <field_group id="fields_with_domain_transformation" operation="instant" >
+      <field id="field2D_extract"  field_ref="field2D" grid_ref="grid2D_extract"/>
+      <field id="field2D_reorder"  field_ref="field2D" grid_ref="grid2D_reorder"/>
+      <field id="field2D_expand"   field_ref="field2D" grid_ref="grid2D_expand"/>
+      <field id="field2D_connect"  field_ref="field2D" grid_ref="grid2D_connect"/>
+      <field id="field2D_interpo"  field_ref="field2D" grid_ref="grid2D_interpolate"/>
+      <field id="field2D_recti"    field_ref="field2D" grid_ref="grid2D_recti"/>
+      <field id="field2D_exp_ext"  field_ref="field2D" grid_ref="grid2D_expand_extract"/>
+      <field id="field2D_reorder_ext"  field_ref="field2D_reorder" grid_ref="grid2D_extract"/>
+    </field_group>
+
+    <field_group id="fields_with_axis_transformation" operation="instant"  >
+      <field id="fieldZ_inverse"   field_ref="field_Z" grid_ref="grid1D_inverse"/>
+      <field id="fieldZ_extract"   field_ref="field_Z" grid_ref="grid1D_extract"/>
+      <field id="field2D_extract_domain"   field_ref="field2D" grid_ref="grid2D_extract_domain"/>
+      <field id="field3D_interpo"  field_ref="field3D" grid_ref="grid3D_axis_interpolate"/>
+      <field id="field3D_interpo_bis"  field_ref="field3D" grid_ref="grid3D_axis_interpolate_bis"/>
+    </field_group>
+
+  </field_definition>
+
+
+
+  <file_definition>
+    
+  <file id="atm_output_domain" output_freq="1ts" type="one_file" enabled="false">
+      <field field_ref="field2D_extract" />
+      <field field_ref="field2D_reorder" />
+      <field field_ref="field2D_expand" />
+      <field field_ref="field2D_interpo" />
+      <field field_ref="field2D_recti" />
+      <field field_ref="field2D_exp_ext" />
+      <field field_ref="field2D_reorder_ext" />
+      <field id="field2D"  />
+  </file>
+     
+  <file id="atm_output_axis" output_freq="4ts" type="one_file" enabled="true">
+      <field field_ref="fieldZ_inverse" enabled="true"  />
+      <field field_ref="fieldZ_extract"  enabled="false"/>
+      <field field_ref="field2D_extract_domain"  enabled="true"/>
+      <field id="field_Z"  enabled="true"/>
+      <field id="field2D"  enabled="true"/>
+  </file>
+     
+  <file id="atm_output_interpolate" output_freq="1ts" type="one_file" enabled="false">
+      <field field_ref="field3D_interpo" />
+      <field field_ref="field3D_interpo_bis" />
+      <field id="field3D"  />
+  </file>
+    
+
+
+  </file_definition>
+
+
+
+  
+</context>
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/generic_testcase/context_grid_dynamico.xml
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/generic_testcase/context_grid_dynamico.xml	(revision 2032)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/generic_testcase/context_grid_dynamico.xml	(revision 2032)
@@ -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" mode="read" output_freq="1ts" type="one_file">
+       <field id="Ai" domain_ref="domain_dynamico" operation="instant" read_access="true"/>
+     </file>
+  </file_definition>
+  
+  <domain_definition>
+    <domain id="domain_dynamico" type="unstructured">
+      <generate_rectilinear_domain/>
+    </domain>
+  </domain_definition>
+
+
+</context>
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/generic_testcase/context_oce.xml
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/generic_testcase/context_oce.xml	(revision 2032)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/generic_testcase/context_oce.xml	(revision 2032)
@@ -0,0 +1,478 @@
+<!-- -->
+<context id="oce">
+  
+  <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="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_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_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="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"/>
+    <field id="field3D" grid_ref="grid3D"  />
+    <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" />
+    <field id="field_Y" grid_ref="grid_Y" />
+    <field id="field_Z" grid_ref="grid1D" />
+    <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="oce_output" output_freq="1ts" type="one_file" enabled="false">
+<!--      <field field_ref="field3D" />
+      <field field_ref="field2D" /> 
+      <field field_ref="field3D" grid_ref="grid_vert_reduce" name="field_vert_reduced" /> 
+      <field field_ref="field3D" grid_ref="grid_horiz_reduce" name="field_horiz_reduced" />
+      <field field_ref="field_zoom_vert"  /> 
+      <field field_ref="field_zoom_vert_sum"  /> 
+      <field field_ref="pressure"  /> 
+      <field field_ref="field3D_resend" /> -->
+       
+       <field field_ref="field3D" enabled="true"/>
+       <field field_ref="field2D" enabled="true"/> 
+       <field field_ref="field_X" enabled="true"/>
+       <field field_ref="field_Y" enabled="true"/>
+       <field field_ref="field_XY" enabled="true"/>
+       <field field_ref="field_Z" enabled="true"/>
+       <field field_ref="field_XYZ" enabled="true"/>
+       <field field_ref="field_XZ" enabled="true"/>
+       <field field_ref="field_YZ" enabled="true"/>
+    </file>
+
+    <file id="oce_output_other" output_freq="1ts" type="one_file" 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="oce_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="oce_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>
+  
+  
+  
+  <field_definition>
+    <field id="field_coupler" field_ref="field3D" operation="average" freq_op="4ts" freq_offset="2ts"/>
+  </field_definition>
+  
+  
+  <coupler_in_definition>
+     <coupler_in context="atm::atm">  
+        <field id="field3D_oce" operation="instant" grid_ref="grid_coupling" freq_op="4ts" freq_offset="4ts"/>
+     </coupler_in>
+  </coupler_in_definition>
+ 
+ 
+  <coupler_out_definition>
+     <coupler_out context="atm::atm">  
+        <field id="field3D_atm" field_ref="field_coupler" freq_op="4ts">@this</field>
+     </coupler_out>
+  </coupler_out_definition>
+
+
+ <file_definition  type="one_file" >
+   <file id="test_coupling_atm" output_freq="4ts" sync_freq="1ts" enabled="true">
+     <field field_ref="field3D_oce" grid_ref="interp_grid3D" operation="instant" default_value="1.e+20" freq_offset="3ts"/> 
+   </file>
+
+   <file id="test_atm" output_freq="1ts" sync_freq="1ts" enabled="false">
+     <field field_ref="field3D" operation="instant" default_value="1.e+20"/> 
+   </file>
+
+ </file_definition>
+
+  
+  <grid_definition>
+    <grid id="grid_coupling">
+      <domain domain_ref="domain_coupling" />
+      <axis id="axis_coupling" />
+    </grid>
+    
+    <grid id="interp_grid3D">
+       <domain domain_ref="domain"> 
+         <interpolate_domain order="1" />
+       </domain>
+       <axis axis_ref="axis_coupling"/>
+    </grid>
+    
+  </grid_definition>
+  
+  <domain_definition>
+    <domain id="domain_coupling"/>
+  </domain_definition>
+  
+  <axis_definition>
+    <axis id="axis_coupling"/>
+  </axis_definition>  
+  
+  
+</context>
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/generic_testcase/iodef.xml
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/generic_testcase/iodef.xml	(revision 2032)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/generic_testcase/iodef.xml	(revision 2032)
@@ -0,0 +1,109 @@
+<?xml version="1.0"?>
+<simulation>
+
+  <context id="atm">
+    <variable_definition>
+
+      <variable id="timestep"> 1h </variable>
+      <variable id="domain"> lmdz </variable>
+      <variable id="domain_mask"> false </variable>
+      <variable id="domain_mask_type"> cross </variable>
+      <variable id="axis_mask"> false </variable>
+      <variable id="scalar_mask"> false </variable>
+      <variable id="scalar_mask_type"> sparse </variable>
+      <variable id="init_field2D"> academic </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"> 30 </variable>
+      <variable id="other_nj"> 15 </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="oce">
+    <variable_definition>
+
+      <variable id="timestep"> 1h </variable>
+      <variable id="domain"> nemo </variable>
+      <variable id="domain_mask"> false </variable>
+      <variable id="axis_mask"> false </variable>
+      <variable id="init_field2D"> academic </variable>
+      <variable id="ni"> 64 </variable>
+      <variable id="nj"> 32 </variable>
+      <variable id="nlev"> 5 </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="oce" src="./context_oce.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="clients_code_id" type="string">atm,oce</variable> -->
+        <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_ym/XIOS_COUPLING/generic_testcase/param.def
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/generic_testcase/param.def	(revision 2032)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/generic_testcase/param.def	(revision 2032)
@@ -0,0 +1,5 @@
+&params_run
+duration='4ts'
+nb_proc_atm=1
+nb_proc_oce=0
+/
