Index: /branches/2015/dev_r5003_MERCATOR6_CRS/NEMOGCM/CRS_help/README_COARSENING.txt
===================================================================
--- /branches/2015/dev_r5003_MERCATOR6_CRS/NEMOGCM/CRS_help/README_COARSENING.txt	(revision 7345)
+++ /branches/2015/dev_r5003_MERCATOR6_CRS/NEMOGCM/CRS_help/README_COARSENING.txt	(revision 7345)
@@ -0,0 +1,49 @@
+!=======================================
+! Activation of online coarsening
+!=======================================
+- coarsening of physics for output: compile with key_crs
+- coarsening of physics for BCG model:  compile with key_crs and ln_crs_top  = .true.
+
+-Be carefull:
+ All the files read in TOP_SRC ( initial conditions for tracers ) and in BCG model ( river, dust, par,... in PISCES )
+should be on the coarsened grid or read using interpolation-on-the-fly with a weight files toward coarsened grid.
+
+!=======================================
+! namelist parameter
+!=======================================
+
+!-----------------------------------------------------------------------
+&namcrs        !   Grid coarsening for dynamics output and/or
+               !   passive tracer coarsened online simulations
+!-----------------------------------------------------------------------
+   nn_factx    = 3         !  Reduction factor of x-direction
+   nn_facty    = 3         !  Reduction factor of y-direction
+   nn_msh_crs  = 1         !  create (=1) a mesh file or not (=0)
+   nn_crs_kz   = 0         ! 0, MEAN of volume boxes
+                           ! 1, MAX of boxes
+                           ! 2, MIN of boxes
+                           ! 3, 10**(MEAN(LOG()) of volume boxes
+                           ! 4, MEDIANE of boxes
+   ln_crs_wn   = .true.    ! wn coarsened (T) or computed using horizontal divergence ( F )
+   ln_crs_top  = .true.    ! coarsening online for the BCG model ( T) or only for outpout of physics ( F )
+/
+
+
+- only nn_factx=3 and nn_facty=3 are available ( ORCA025 to ORCA075, ORCA12 to ORCA025,...)
+- nn_msh_crs=1 shall be activated to generate coarsened grid meshmask ( rebuild with REBUILD_NEMO )
+- ln_crs_wn : T: vertical velocities are coarsened ; F: vertical velocities computed using horizontal divergence
+- ln_crs_top: T  coarsening online for the BCG model ; F outpout of physics only
+
+!=======================================
+! XML files
+!=======================================
+
+use:
+ - field_def.xml :  CONFIG/SHARED/field_def.xml
+ - domain_def.xml:  CONFIG/SHARED/domain_def.xml for XIOS1 
+                    CONFIG/GYRE_XIOS/EXP00/domain_def.xml for XIOS2
+ - iodef.xml     :  a new context "nemo_crs" might be created after the existing "nemo" context in iodef.xml ( see iodef.xml in XML_EXAMPLE )
+ - file_def.xml  :  the full-resolution files in  "nemo"     context ( see file_def.xml     in in XML_EXAMPLE )
+                    the coarsened       files in  "nemo_crs" context ( see file_crs_def.xml in in XML_EXAMPLE )
+
+ 
Index: /branches/2015/dev_r5003_MERCATOR6_CRS/NEMOGCM/CRS_help/XML_EXAMPLE/file_crs_def.xml
===================================================================
--- /branches/2015/dev_r5003_MERCATOR6_CRS/NEMOGCM/CRS_help/XML_EXAMPLE/file_crs_def.xml	(revision 7345)
+++ /branches/2015/dev_r5003_MERCATOR6_CRS/NEMOGCM/CRS_help/XML_EXAMPLE/file_crs_def.xml	(revision 7345)
@@ -0,0 +1,60 @@
+    <!-- 
+============================================================================================================
+=                                           output files definition                                        =
+=                                            Define your own files                                         =
+=                                         put the variables you want...                                    =
+============================================================================================================
+    -->
+    
+    <file_definition type="multiple_file" name="PATH_OUT/@expname@_@freq@" sync_freq="1d" min_digits="4">
+    
+      <file_group id="1d" output_freq="1d" split_freq="1d" output_level="10" enabled=".TRUE." > <!-- 1d files -->
+ 
+	<file id="file1" name_suffix="_gcrsT" description="ocean T grid variables" >
+	  <field field_ref="toce"         name="votemper"  />
+	  <field field_ref="soce"         name="vosaline"  />
+	  <field field_ref="sst"          name="sosstsst"  />
+	  <field field_ref="sss"          name="sosaline"  />
+	  <field field_ref="ssh"          name="sossheig"  />
+	  <field field_ref="empmr"        name="sowaflup"  />
+	  <field field_ref="qsr"          name="soshfldo"  />
+          <field field_ref="saltflx"      name="sosfldow"  />
+	  <field field_ref="qt"           name="sohefldo"  />
+	  <field field_ref="mldr10_1"     name="somxl010"  />
+	  <field field_ref="mldkz5"       name="somixhgt"  />
+    </file>
+	
+	<file id="file2" name_suffix="_gcrsU" description="ocean U grid variables" >
+          <field field_ref="uoce"         name="vozocrtx"  />
+          <field field_ref="utau"         name="sozotaux"  />
+    </file>
+	
+	<file id="file3" name_suffix="_gcrsV" description="ocean V grid variables" >
+          <field field_ref="voce"         name="vomecrty"  /> 
+          <field field_ref="vtau"         name="sometauy"  /> 
+    </file>
+	
+	<file id="file4" name_suffix="_gcrsW" description="ocean W grid variables" >
+          <field field_ref="woce"         name="vovecrtz" />
+          <field field_ref="avt"          name="votkeavt" />
+          <field field_ref="aht2d"        name="soleahtw" />
+    </file>
+
+        <file id="file5" name_suffix="_gcrsC" description="ocean tracer grid variables" >
+          <field field_ref="Age"         name="Age" />
+    </file>
+
+      </file_group>
+      
+      <file_group id="1m" output_freq="1mo" output_level="10" enabled=".TRUE."/> <!-- real monthly files -->
+      <file_group id="2m" output_freq="2mo" output_level="10" enabled=".TRUE."/> <!-- real 2m files -->
+      <file_group id="3m" output_freq="3mo" output_level="10" enabled=".TRUE."/> <!-- real 3m files -->
+      <file_group id="4m" output_freq="4mo" output_level="10" enabled=".TRUE."/> <!-- real 4m files -->
+      <file_group id="6m" output_freq="6mo" output_level="10" enabled=".TRUE."/> <!-- real 6m files -->
+
+      <file_group id="1y"  output_freq="1y" output_level="10" enabled=".TRUE."/> <!-- real yearly files -->
+      <file_group id="2y"  output_freq="2y" output_level="10" enabled=".TRUE."/> <!-- real 2y files -->
+      <file_group id="5y"  output_freq="5y" output_level="10" enabled=".TRUE."/> <!-- real 5y files -->
+      <file_group id="10y" output_freq="10y" output_level="10" enabled=".TRUE."/> <!-- real 10y files -->
+
+   </file_definition>
Index: /branches/2015/dev_r5003_MERCATOR6_CRS/NEMOGCM/CRS_help/XML_EXAMPLE/file_def.xml
===================================================================
--- /branches/2015/dev_r5003_MERCATOR6_CRS/NEMOGCM/CRS_help/XML_EXAMPLE/file_def.xml	(revision 7345)
+++ /branches/2015/dev_r5003_MERCATOR6_CRS/NEMOGCM/CRS_help/XML_EXAMPLE/file_def.xml	(revision 7345)
@@ -0,0 +1,56 @@
+    <!-- 
+============================================================================================================
+=                                           output files definition                                        =
+=                                            Define your own files                                         =
+=                                         put the variables you want...                                    =
+============================================================================================================
+    -->
+    
+    <file_definition type="multiple_file" name="PATH_OUT/@expname@_@freq@" sync_freq="1d" min_digits="4">
+    
+      <file_group id="1d" output_freq="1d"  split_freq="1d" output_level="10" enabled=".TRUE." > <!-- 1d files -->
+ 
+	<file id="file1" name_suffix="_gridT" description="ocean T grid variables" >
+	  <field field_ref="toce"         name="votemper"  />
+	  <field field_ref="soce"         name="vosaline"  />
+	  <field field_ref="sst"          name="sosstsst"  />
+	  <field field_ref="sss"          name="sosaline"  />
+	  <field field_ref="ssh"          name="sossheig"  />
+	  <field field_ref="empmr"        name="sowaflup"  />
+	  <field field_ref="qsr"          name="soshfldo"  />
+          <field field_ref="saltflx"      name="sosfldow"  />
+	  <field field_ref="qt"           name="sohefldo"  />
+	  <field field_ref="mldr10_1"     name="somxl010"  />
+	  <field field_ref="mldkz5"       name="somixhgt"  />
+    </file>
+	
+	<file id="file2" name_suffix="_gridU" description="ocean U grid variables" >
+          <field field_ref="uoce"         name="vozocrtx"  />
+          <field field_ref="utau"         name="sozotaux"  />
+    </file>
+	
+	<file id="file3" name_suffix="_gridV" description="ocean V grid variables" >
+          <field field_ref="voce"         name="vomecrty"  /> 
+          <field field_ref="vtau"         name="sometauy"  /> 
+    </file>
+	
+	<file id="file4" name_suffix="_gridW" description="ocean W grid variables" >
+          <field field_ref="woce"         name="vovecrtz" />
+          <field field_ref="avt"          name="votkeavt" />
+          <field field_ref="aht2d"        name="soleahtw" />
+    </file>
+
+      </file_group>
+      
+      <file_group id="1m" output_freq="1mo" output_level="10" enabled=".TRUE."/> <!-- real monthly files -->
+      <file_group id="2m" output_freq="2mo" output_level="10" enabled=".TRUE."/> <!-- real 2m files -->
+      <file_group id="3m" output_freq="3mo" output_level="10" enabled=".TRUE."/> <!-- real 3m files -->
+      <file_group id="4m" output_freq="4mo" output_level="10" enabled=".TRUE."/> <!-- real 4m files -->
+      <file_group id="6m" output_freq="6mo" output_level="10" enabled=".TRUE."/> <!-- real 6m files -->
+
+      <file_group id="1y"  output_freq="1y" output_level="10" enabled=".TRUE."/> <!-- real yearly files -->
+      <file_group id="2y"  output_freq="2y" output_level="10" enabled=".TRUE."/> <!-- real 2y files -->
+      <file_group id="5y"  output_freq="5y" output_level="10" enabled=".TRUE."/> <!-- real 5y files -->
+      <file_group id="10y" output_freq="10y" output_level="10" enabled=".TRUE."/> <!-- real 10y files -->
+
+   </file_definition>
Index: /branches/2015/dev_r5003_MERCATOR6_CRS/NEMOGCM/CRS_help/XML_EXAMPLE/iodef.xml
===================================================================
--- /branches/2015/dev_r5003_MERCATOR6_CRS/NEMOGCM/CRS_help/XML_EXAMPLE/iodef.xml	(revision 7345)
+++ /branches/2015/dev_r5003_MERCATOR6_CRS/NEMOGCM/CRS_help/XML_EXAMPLE/iodef.xml	(revision 7345)
@@ -0,0 +1,194 @@
+<?xml version="1.0"?>
+<simulation> 
+
+ <context id="nemo" >
+    
+    <!-- $id$ -->
+    
+    <!-- 
+============================================================================================================
+=                                  definition of all existing variables                                    =
+=                                            DO NOT CHANGE                                                 =
+============================================================================================================
+    -->
+    <field_definition src="./field_def.xml"/>
+    <!-- 
+============================================================================================================
+=                                           output files definition                                        =
+=                                            Define your own files                                         =
+=                                         put the variables you want...                                    =
+============================================================================================================
+       -->
+
+    <file_definition src="./file_def.xml"/>
+
+    <!--
+ 
+============================================================================================================
+= grid definition = = DO NOT CHANGE =
+============================================================================================================
+    -->
+    
+   <axis_definition>  
+      <axis id="deptht"  long_name="Vertical T levels"  unit="m" positive="down" />
+      <axis id="depthu"  long_name="Vertical U levels"  unit="m" positive="down" />
+      <axis id="depthv"  long_name="Vertical V levels"  unit="m" positive="down" />
+      <axis id="depthw"  long_name="Vertical W levels"  unit="m" positive="down" />
+      <axis id="nfloat"  long_name="Float number"       unit="1"                 />
+      <axis id="icbcla"  long_name="Iceberg class"      unit="1"                 />
+      <axis id="ncatice" long_name="Ice category"       unit="1"                 />
+      <axis id="iax_20C" long_name="20 degC isotherm"   unit="degC"              />
+      <axis id="iax_28C" long_name="28 degC isotherm"   unit="degC"              />
+   </axis_definition> 
+    
+   <domain_definition src="./domain_def.xml"/>
+   
+   <grid_definition>    
+     <grid id="grid_T_2D" >
+       <domain id="grid_T" />
+     </grid>
+     <grid id="grid_T_3D" >
+       <domain id="grid_T" />
+       <axis id="deptht" />
+     </grid>
+     <grid id="grid_U_2D" >
+       <domain id="grid_U" />
+     </grid>
+     <grid id="grid_U_3D" >
+       <domain id="grid_U" />
+       <axis id="depthu" />
+     </grid>
+     <grid id="grid_V_2D" >
+       <domain id="grid_V" />
+     </grid>
+     <grid id="grid_V_3D" >
+       <domain id="grid_V" />
+       <axis id="depthv" />
+     </grid>
+     <grid id="grid_W_2D" >
+       <domain id="grid_W" />
+     </grid>
+     <grid id="grid_W_3D" >
+       <domain id="grid_W" />
+       <axis id="depthw" />
+     </grid>
+     <grid id="scalarpoint" />
+
+    </grid_definition> 
+
+  </context>
+  
+    <!-- 
+============================================================================================================
+============================================================================================================
+============================================================================================================
+=                                                    CRS context
+============================================================================================================
+============================================================================================================
+============================================================================================================
+    -->
+
+ <context id="nemo_crs" >
+
+    <!-- $id$ -->
+
+    <!-- 
+============================================================================================================
+=                                  definition of all existing variables                                    =
+=                                            DO NOT CHANGE                                                 =
+============================================================================================================
+    -->
+    <field_definition src="./field_def.xml"/>
+    <!-- 
+============================================================================================================
+=                                           output files definition                                        =
+=                                            Define your own files                                         =
+=                                         put the variables you want...                                    =
+============================================================================================================
+       -->
+
+    <file_definition src="./file_crs_def.xml"/>
+
+    <!--
+ 
+============================================================================================================
+= grid definition = = DO NOT CHANGE =
+============================================================================================================
+    -->
+
+   <axis_definition>
+      <axis id="deptht"  long_name="Vertical T levels"  unit="m" positive="down" />
+      <axis id="depthu"  long_name="Vertical U levels"  unit="m" positive="down" />
+      <axis id="depthv"  long_name="Vertical V levels"  unit="m" positive="down" />
+      <axis id="depthw"  long_name="Vertical W levels"  unit="m" positive="down" />
+      <axis id="nfloat"  long_name="Float number"       unit="1"                 />
+      <axis id="icbcla"  long_name="Iceberg class"      unit="1"                 />
+      <axis id="ncatice" long_name="Ice category"       unit="1"                 />
+      <axis id="iax_20C" long_name="20 degC isotherm"   unit="degC"              />
+      <axis id="iax_28C" long_name="28 degC isotherm"   unit="degC"              />
+   </axis_definition>
+
+   <domain_definition src="./domain_def.xml"/>
+
+   <grid_definition>
+     <grid id="grid_T_2D" >
+       <domain id="grid_T" />
+     </grid>
+     <grid id="grid_T_3D" >
+       <domain id="grid_T" />
+       <axis id="deptht" />
+     </grid>
+     <grid id="grid_U_2D" >
+       <domain id="grid_U" />
+     </grid>
+     <grid id="grid_U_3D" >
+       <domain id="grid_U" />
+       <axis id="depthu" />
+     </grid>
+     <grid id="grid_V_2D" >
+       <domain id="grid_V" />
+     </grid>
+     <grid id="grid_V_3D" >
+       <domain id="grid_V" />
+       <axis id="depthv" />
+     </grid>
+     <grid id="grid_W_2D" >
+       <domain id="grid_W" />
+     </grid>
+     <grid id="grid_W_3D" >
+       <domain id="grid_W" />
+       <axis id="depthw" />
+     </grid>
+     <grid id="scalarpoint" />
+
+    </grid_definition>
+
+  </context>
+
+    <!-- 
+============================================================================================================
+============================================================================================================
+============================================================================================================
+=                                                    XIOS context
+============================================================================================================
+============================================================================================================
+============================================================================================================
+    -->
+
+  <context id="xios">
+
+      <variable_definition>
+	
+     <!-- 
+        We must have buffer_size > jpi*jpj*jpk*8 (with jpi and jpj the subdomain size)
+-->
+	  <variable id="info_level"                type="int">0</variable>
+	  <variable id="using_server"              type="bool">true</variable>
+	  <variable id="using_oasis"               type="bool">false</variable>
+	  <variable id="oasis_codes_id"            type="string" >oceanx</variable>
+	
+      </variable_definition>
+               
+  </context>
+  
+</simulation>
