Index: /trunk/CONFIG/GYRE/EXP00/iodef.xml
===================================================================
--- /trunk/CONFIG/GYRE/EXP00/iodef.xml	(revision 1724)
+++ /trunk/CONFIG/GYRE/EXP00/iodef.xml	(revision 1725)
@@ -5,7 +5,12 @@
   <context id="nemo"> 
     
-    <!-- groups of variables definition -->
+    <!-- 
+============================================================================================================
+=                                  definition of all existing variables                                    =
+=                                            DO NOT CHANGE                                                 =
+============================================================================================================
+    -->
     
-    <field_definition level="1" prec="4" operation="ave(X)" freq_op="7200" enabled=".TRUE.">
+    <field_definition level="1" prec="4" operation="ave(X)" enabled=".TRUE."> <!-- time step automaticaly defined -->
       
       <!-- T grid -->
@@ -37,5 +42,5 @@
       <!-- SBC -->
       
-      <group id="SBC" axis_ref="none" grid_ref="grid_T">
+      <group id="SBC" axis_ref="none" grid_ref="grid_T"> <!-- time step automaticaly defined based on nn_fsbc -->
 	<field id="emp"          description="Net Upward Water Flux"                     unit="kg/m2/s"  />
 	<field id="emps"         description="concentration/dilution water flux"         unit="kg/m2/s"  />
@@ -99,5 +104,11 @@
   </field_definition>
 
-<!-- file definition -->
+    <!-- 
+============================================================================================================
+=                                           output files definition                                        =
+=                                            Define your own files                                         =
+=                                         put the variables you want...                                    =
+============================================================================================================
+    -->
 
   <file_definition output_level="10" enabled=".TRUE.">
@@ -151,4 +162,10 @@
   </file_definition>
 
+    <!-- 
+============================================================================================================
+=                                           grid definition                                                =
+=                                            DO NOT CHANGE                                                 =
+============================================================================================================
+    -->
 
   <axis_definition>  
Index: /trunk/CONFIG/GYRE_LOBSTER/EXP00/iodef.xml
===================================================================
--- /trunk/CONFIG/GYRE_LOBSTER/EXP00/iodef.xml	(revision 1724)
+++ /trunk/CONFIG/GYRE_LOBSTER/EXP00/iodef.xml	(revision 1725)
@@ -5,7 +5,12 @@
   <context id="nemo"> 
     
-    <!-- groups of variables definition -->
+    <!-- 
+============================================================================================================
+=                                  definition of all existing variables                                    =
+=                                            DO NOT CHANGE                                                 =
+============================================================================================================
+    -->
     
-    <field_definition level="1" prec="4" operation="ave(X)" freq_op="7200" enabled=".TRUE.">
+    <field_definition level="1" prec="4" operation="ave(X)" enabled=".TRUE."> <!-- time step automaticaly defined -->
       
       <!-- T grid -->
@@ -37,5 +42,5 @@
       <!-- SBC -->
       
-      <group id="SBC" axis_ref="none" grid_ref="grid_T">
+      <group id="SBC" axis_ref="none" grid_ref="grid_T"> <!-- time step automaticaly defined based on nn_fsbc -->
 	<field id="emp"          description="Net Upward Water Flux"                     unit="kg/m2/s"  />
 	<field id="emps"         description="concentration/dilution water flux"         unit="kg/m2/s"  />
@@ -138,5 +143,11 @@
   </field_definition>
 
-<!-- file definition -->
+    <!-- 
+============================================================================================================
+=                                           output files definition                                        =
+=                                            Define your own files                                         =
+=                                         put the variables you want...                                    =
+============================================================================================================
+    -->
 
   <file_definition output_level="10" enabled=".TRUE.">
@@ -224,4 +235,11 @@
   </file_definition>
 
+    <!-- 
+============================================================================================================
+=                                           grid definition                                                =
+=                                            DO NOT CHANGE                                                 =
+============================================================================================================
+    -->
+
   <axis_definition>  
      <axis id="deptht" description="Vertical T levels" unit="m" positive=".false." />
Index: /trunk/CONFIG/ORCA2_LIM/EXP00/iodef.xml
===================================================================
--- /trunk/CONFIG/ORCA2_LIM/EXP00/iodef.xml	(revision 1724)
+++ /trunk/CONFIG/ORCA2_LIM/EXP00/iodef.xml	(revision 1725)
@@ -5,7 +5,12 @@
   <context id="nemo">
     
-    <!-- groups of variables definition -->
-    
-    <field_definition level="1" prec="4" operation="ave(X)" freq_op="5760" enabled=".TRUE.">
+    <!-- 
+============================================================================================================
+=                                  definition of all existing variables                                    =
+=                                            DO NOT CHANGE                                                 =
+============================================================================================================
+    -->
+    
+    <field_definition level="1" prec="4" operation="ave(X)" enabled=".TRUE."> <!-- time step automaticaly defined -->
 
       <!-- T grid -->
@@ -37,5 +42,5 @@
       <!-- SBC -->
       
-      <group id="SBC" axis_ref="none" grid_ref="grid_T" freq_op="28800">
+      <group id="SBC" axis_ref="none" grid_ref="grid_T" > <!-- time step automaticaly defined based on nn_fsbc -->
 
 	<field id="emp"          description="Net Upward Water Flux"                                        unit="kg/m2/s"  />
@@ -132,78 +137,169 @@
 	<field id="av_tide"     description="tidal vertical diffusivity"               unit="m2/s"                 />
       </group>
-      
-      
+          
     </field_definition>
     
-    <!-- file definition -->
-    
-    <file_definition output_level="10" enabled=".TRUE.">
-      <file id="ORCA2_5d_grid_T" description="ocean T grid variables" output_freq="432000" output_level="5" >
-	<field ref="toce"         name="votemper"  />
-	<field ref="soce"         name="vosaline"  />
-	<field ref="sst"          name="sosstsst"  />
-	<field ref="sss"          name="sosaline"  />
-	<field ref="ssh"          name="sossheig"  />
-	<field ref="emp"          name="sowaflup"  />
-	<field ref="qsr"          name="soshfldo"  />
-	<field ref="emps"         name="sowaflcd"  />
-	<field ref="qns+qsr"      name="sohefldo"  />
-	<field ref="mldr10_1"     name="somxl010"  />
-	<field ref="mldkz5"       name="somixhgt"  />
-	<field ref="ice_cover"    name="soicecov"  />
-	<field ref="wspd"         name="sowindsp"  />
-	<field ref="qrp"          name="sohefldp"  />
-	<field ref="erp"          name="sowafldp"  />
-	<field ref="mldr10_1"     name="sobowlin"  operation="t_max(X)" />
-	<field ref="mlddzt"       name="sothedep"  />
-	<field ref="20d"          name="so20chgt"  />
-	<field ref="28d"          name="so28chgt"  />
-	<field ref="hc300"        name="sohtc300"  />
-	<field ref="ist_ipa"      name="soicetem"  />
-	<field ref="icealb_cea"   name="soicealb"  />   
-      </file>
-      
-      <file id="ORCA2_5d_grid_U" description="ocean U grid variables" output_freq="432000" output_level="5" >
-	<field ref="uoce"         name="vozocrtx"  />
-	<field ref="uoce_eiv"     name="vozoeivu"  />
-	<field ref="utau"         name="sozotaux"  />
-      </file>
-      
-      <file id="ORCA2_5d_grid_V" description="ocean V grid variables" output_freq="432000" output_level="5" >
-	<field ref="voce"         name="vomecrty"  />
-	<field ref="voce_eiv"     name="vomeeivv"  />
-	<field ref="vtau"         name="sometauy"  />
-      </file>
-      
-      <file id="ORCA2_5d_grid_W" description="ocean W grid variables" output_freq="432000" output_level="5" >
-	<field ref="woce"         name="vovecrtz" />
-	<field ref="woce_eiv"     name="voveeivw" />
-	<field ref="avt"          name="votkeavt" />
-	<field ref="avt_evd"      name="votkeevd" />
-	<field ref="avm"          name="votkeavm" />
-	<field ref="avm_evd"      name="votkeevm" />
-	<field ref="avs"          name="voddmavs" />
-	<field ref="aht2d"        name="soleahtw" />
-	<field ref="aht2d_eiv"    name="soleaeiw" />
-      </file>
-      
-      <file id="ORCA2_5d_icemod" description="ice variables" output_freq="432000" output_level="5" >
-	<field ref="ice_pres"                     />
-	<field ref="snowthic_cea" name="isnowthi" />
-	<field ref="icethic_cea"  name="iicethic" />
-	<field ref="iceprod_cea"  name="iiceprod" />
-	<field ref="ist_ipa"      name="iicetemp" />
-	<field ref="ioceflxb"     name="ioceflxb" />
-	<field ref="uice_ipa"     name="iicevelu" />
-	<field ref="vice_ipa"     name="iicevelv" />
-	<field ref="utau_ice"     name="iicestru" />
-	<field ref="vtau_ice"     name="iicestrv" />
-	<field ref="qsr_io_cea"   name="iicesflx" />
-	<field ref="qns_io_cea"   name="iicenflx" />
-	<field ref="snowpre"      name="isnowpre" />
-      </file>
-      
+    <!-- 
+============================================================================================================
+=                                           output files definition                                        =
+=                                            Define your own files                                         =
+=                                         put the variables you want...                                    =
+============================================================================================================
+    -->
+    
+    <file_definition >
+
+      <group id="1h" output_freq="3600"   output_level="10" enabled=".TRUE.">                      <!-- 1h files -->
+      </group>
+      
+      <group id="2h" output_freq="7200"   output_level="10" enabled=".TRUE.">                      <!-- 2h files -->
+      </group>
+      
+      <group id="3h" output_freq="10800"  output_level="10" enabled=".TRUE.">                      <!-- 3h files -->
+      </group>
+      
+      <group id="4h" output_freq="14400"  output_level="10" enabled=".TRUE.">                      <!-- 4h files -->
+      </group>
+      
+      <group id="6h" output_freq="21600"  output_level="10" enabled=".TRUE.">                      <!-- 6h files -->
+      </group>
+      
+      <group id="1d" output_freq="86400"  output_level="10" enabled=".TRUE.">                      <!-- 1d files -->
+
+    <!-- 
+............................................................................................................
+           example of 3 types of 1d files
+............................................................................................................
+    -->
+	<!-- automatic definition of the name based on id="1d_grid_T" 
+	     => this name is used as the radical for all file names of this group
+	     => add a suffix to be sure that all files names of this group are different   -->
+	<group id="1d_grid_T" name="auto" description="ocean T grid variables" >
+	  <!-- mooring: automatic definition of the file name suffix based on id="0n180wT"  -->
+	  <file id="0n180wT" name_suffix="auto" >
+	    <group id="0n180wT" zoom_ref="0n180wT" >    <!-- group of variables sharing the same zoom -->
+	      <field ref="toce" name="votemper"  />
+	      <field ref="uoce" name="vozocrtx"  />     <!-- include a U-grid variable in the list => switch to T-grid -->
+	    </group>
+	  </file>
+	  <!-- Equatorial section: automatic definition of the file name suffix based on id="EqT" -->
+	  <file id="EqT" name_suffix="auto" >
+	    <group id="EqT" zoom_ref="EqT" >
+	      <field ref="toce" name="votemper"  />
+	    </group>
+	  </file>
+	  <!-- global file with different operations on data   -->
+	  <file id="global" >
+	    <field ref="sst"    name="sst_1d_ave"                       />     <!-- mean -->
+	    <field ref="sst"    name="sst_1d_max"  operation="t_max(X)" />     <!-- max -->
+	  </file>
+	</group>
+
+      </group>
+      
+      <group id="3d" output_freq="259200" output_level="10" enabled=".TRUE.">                      <!-- 3d files -->
+      </group>
+      
+      <group id="5d" output_freq="432000" output_level="10" enabled=".TRUE.">                      <!-- 5d files -->
+
+	<file id="5d_grid_T" name="auto" description="ocean T grid variables" >
+	  <field ref="toce"         name="votemper"  />
+	  <field ref="soce"         name="vosaline"  />
+	  <field ref="sst"          name="sosstsst"  />
+	  <field ref="sss"          name="sosaline"  />
+	  <field ref="ssh"          name="sossheig"  />
+	  <field ref="emp"          name="sowaflup"  />
+	  <field ref="qsr"          name="soshfldo"  />
+	  <field ref="emps"         name="sowaflcd"  />
+	  <field ref="qns+qsr"      name="sohefldo"  />
+	  <field ref="mldr10_1"     name="somxl010"  />
+	  <field ref="mldkz5"       name="somixhgt"  />
+	  <field ref="ice_cover"    name="soicecov"  />
+	  <field ref="wspd"         name="sowindsp"  />
+	  <field ref="qrp"          name="sohefldp"  />
+	  <field ref="erp"          name="sowafldp"  />
+	  <field ref="mlddzt"       name="sothedep"  />
+	  <field ref="20d"          name="so20chgt"  />
+	  <field ref="28d"          name="so28chgt"  />
+	  <field ref="hc300"        name="sohtc300"  />
+	  <field ref="ist_ipa"      name="soicetem"  />
+	  <field ref="icealb_cea"   name="soicealb"  />   
+	</file>
+	
+	<file id="5d_grid_U" name="auto" description="ocean U grid variables" >
+	  <field ref="uoce"         name="vozocrtx"  />
+	  <field ref="uoce_eiv"     name="vozoeivu"  />
+	  <field ref="utau"         name="sozotaux"  />
+	</file>
+	
+	<file id="5d_grid_V" name="auto" description="ocean V grid variables" >
+	  <field ref="voce"         name="vomecrty"  />
+	  <field ref="voce_eiv"     name="vomeeivv"  />
+	  <field ref="vtau"         name="sometauy"  />
+	</file>
+	
+	<file id="5d_grid_W" name="auto" description="ocean W grid variables" >
+	  <field ref="woce"         name="vovecrtz" />
+	  <field ref="woce_eiv"     name="voveeivw" />
+	  <field ref="avt"          name="votkeavt" />
+	  <field ref="avt_evd"      name="votkeevd" />
+	  <field ref="avm"          name="votkeavm" />
+	  <field ref="avm_evd"      name="votkeevm" />
+	  <field ref="avs"          name="voddmavs" />
+	  <field ref="aht2d"        name="soleahtw" />
+	  <field ref="aht2d_eiv"    name="soleaeiw" />
+	</file>
+	
+	<file id="5d_icemod" name="auto" description="ice variables" >
+	  <field ref="ice_pres"                     />
+	  <field ref="snowthic_cea" name="isnowthi" />
+	  <field ref="icethic_cea"  name="iicethic" />
+	  <field ref="iceprod_cea"  name="iiceprod" />
+	  <field ref="ist_ipa"      name="iicetemp" />
+	  <field ref="ioceflxb"     name="ioceflxb" />
+	  <field ref="uice_ipa"     name="iicevelu" />
+	  <field ref="vice_ipa"     name="iicevelv" />
+	  <field ref="utau_ice"     name="iicestru" />
+	  <field ref="vtau_ice"     name="iicestrv" />
+	  <field ref="qsr_io_cea"   name="iicesflx" />
+	  <field ref="qns_io_cea"   name="iicenflx" />
+	  <field ref="snowpre"      name="isnowpre" />
+	</file>
+	
+      </group>
+      
+      <group id="1m" output_freq="-1"     output_level="10" enabled=".TRUE.">                      <!-- real monthly files -->
+
+	<file id="1m_grid_T" name="auto" description="ocean T grid variables" >
+	  <field ref="sst"          name="sosstsst"  />
+	</file>   
+
+      </group>
+
+      <group id="1y" output_freq="0000"   output_level="10" enabled=".TRUE.">                      <!-- yearly files -->
+
+	<file id="1y_grid_T" name="auto" description="ocean T grid variables" >
+	  <field ref="mldr10_1"     name="sobowlin"  operation="t_max(X)" />
+	</file>
+
+      </group>
+
+      <group id="2y"  output_freq="0000"   output_level="10" enabled=".TRUE.">                     <!-- 2y files -->
+      </group>
+
+      <group id="5y"  output_freq="0000"   output_level="10" enabled=".TRUE.">                     <!-- 5y files -->
+      </group>
+
+      <group id="10y" output_freq="0000"   output_level="10" enabled=".TRUE.">                     <!-- 10y files -->
+      </group>
+
     </file_definition>
     
+    <!-- 
+============================================================================================================
+=                                           grid definition                                                =
+=                                            DO NOT CHANGE                                                 =
+============================================================================================================
+    -->
     
     <axis_definition>  
@@ -216,8 +312,168 @@
     
     <grid_definition>
-      <grid id="grid_T" description="grid T" />
-      <grid id="grid_U" description="grid U" />
-      <grid id="grid_V" description="grid V" />
-      <grid id="grid_W" description="grid W" />
+      <grid id="grid_T" description="grid T" >
+    <!--   Eq section   -->
+	<zoom id="EqT" ibegin="1" jbegin="0000" ni="0000" nj="1" />
+    <!--   TAO   -->
+      <!--   137e   -->
+	<zoom id="2n137eT" ibegin="0000" jbegin="0000" ni="1" nj="1" />
+	<zoom id="5n137eT" ibegin="0000" jbegin="0000" ni="1" nj="1" />
+	<zoom id="8n137eT" ibegin="0000" jbegin="0000" ni="1" nj="1" />
+      <!--   147e   -->
+	<zoom id="0n147eT" ibegin="0000" jbegin="0000" ni="1" nj="1" />
+	<zoom id="2n147eT" ibegin="0000" jbegin="0000" ni="1" nj="1" />
+	<zoom id="5n147eT" ibegin="0000" jbegin="0000" ni="1" nj="1" />
+      <!--   156e   -->
+	<zoom id="5s156eT" ibegin="0000" jbegin="0000" ni="1" nj="1" />
+	<zoom id="2s156eT" ibegin="0000" jbegin="0000" ni="1" nj="1" />
+	<zoom id="0n156eT" ibegin="0000" jbegin="0000" ni="1" nj="1" />
+	<zoom id="2n156eT" ibegin="0000" jbegin="0000" ni="1" nj="1" />
+	<zoom id="5n156eT" ibegin="0000" jbegin="0000" ni="1" nj="1" />
+	<zoom id="8n156eT" ibegin="0000" jbegin="0000" ni="1" nj="1" />
+      <!--   165e   -->
+	<zoom id="8s165eT" ibegin="0000" jbegin="0000" ni="1" nj="1" />
+	<zoom id="5s165eT" ibegin="0000" jbegin="0000" ni="1" nj="1" />
+	<zoom id="2s165eT" ibegin="0000" jbegin="0000" ni="1" nj="1" />
+	<zoom id="0n165eT" ibegin="0000" jbegin="0000" ni="1" nj="1" />
+	<zoom id="2n165eT" ibegin="0000" jbegin="0000" ni="1" nj="1" />
+	<zoom id="5n165eT" ibegin="0000" jbegin="0000" ni="1" nj="1" />
+	<zoom id="8n165eT" ibegin="0000" jbegin="0000" ni="1" nj="1" />
+      <!--   180w   -->
+	<zoom id="8s180wT" ibegin="0000" jbegin="0000" ni="1" nj="1" />
+	<zoom id="5s180wT" ibegin="0000" jbegin="0000" ni="1" nj="1" />
+	<zoom id="2s180wT" ibegin="0000" jbegin="0000" ni="1" nj="1" />
+	<zoom id="0n180wT" ibegin="0000" jbegin="0000" ni="1" nj="1" />
+	<zoom id="2n180wT" ibegin="0000" jbegin="0000" ni="1" nj="1" />
+	<zoom id="5n180wT" ibegin="0000" jbegin="0000" ni="1" nj="1" />
+	<zoom id="8n180wT" ibegin="0000" jbegin="0000" ni="1" nj="1" />
+      <!--   170w   -->
+	<zoom id="8s170wT" ibegin="0000" jbegin="0000" ni="1" nj="1" />
+	<zoom id="5s170wT" ibegin="0000" jbegin="0000" ni="1" nj="1" />
+	<zoom id="2s170wT" ibegin="0000" jbegin="0000" ni="1" nj="1" />
+	<zoom id="0n170wT" ibegin="0000" jbegin="0000" ni="1" nj="1" />
+	<zoom id="2n170wT" ibegin="0000" jbegin="0000" ni="1" nj="1" />
+	<zoom id="5n170wT" ibegin="0000" jbegin="0000" ni="1" nj="1" />
+	<zoom id="8n170wT" ibegin="0000" jbegin="0000" ni="1" nj="1" />
+      <!--   155w   -->
+	<zoom id="8s155wT" ibegin="0000" jbegin="0000" ni="1" nj="1" />
+	<zoom id="5s155wT" ibegin="0000" jbegin="0000" ni="1" nj="1" />
+	<zoom id="2s155wT" ibegin="0000" jbegin="0000" ni="1" nj="1" />
+	<zoom id="0n155wT" ibegin="0000" jbegin="0000" ni="1" nj="1" />
+	<zoom id="2n155wT" ibegin="0000" jbegin="0000" ni="1" nj="1" />
+	<zoom id="5n155wT" ibegin="0000" jbegin="0000" ni="1" nj="1" />
+	<zoom id="8n155wT" ibegin="0000" jbegin="0000" ni="1" nj="1" />
+      <!--   140w   -->
+	<zoom id="8s140wT" ibegin="0000" jbegin="0000" ni="1" nj="1" />
+	<zoom id="5s140wT" ibegin="0000" jbegin="0000" ni="1" nj="1" />
+	<zoom id="2s140wT" ibegin="0000" jbegin="0000" ni="1" nj="1" />
+	<zoom id="0n140wT" ibegin="0000" jbegin="0000" ni="1" nj="1" />
+	<zoom id="2n140wT" ibegin="0000" jbegin="0000" ni="1" nj="1" />
+	<zoom id="5n140wT" ibegin="0000" jbegin="0000" ni="1" nj="1" />
+	<zoom id="8n140wT" ibegin="0000" jbegin="0000" ni="1" nj="1" />
+      <!--   125w   -->
+	<zoom id="8s125wT" ibegin="0000" jbegin="0000" ni="1" nj="1" />
+	<zoom id="5s125wT" ibegin="0000" jbegin="0000" ni="1" nj="1" />
+	<zoom id="2s125wT" ibegin="0000" jbegin="0000" ni="1" nj="1" />
+	<zoom id="0n125wT" ibegin="0000" jbegin="0000" ni="1" nj="1" />
+	<zoom id="2n125wT" ibegin="0000" jbegin="0000" ni="1" nj="1" />
+	<zoom id="5n125wT" ibegin="0000" jbegin="0000" ni="1" nj="1" />
+	<zoom id="8n125wT" ibegin="0000" jbegin="0000" ni="1" nj="1" />
+      <!--   110w   -->
+	<zoom id="8s110wT" ibegin="0000" jbegin="0000" ni="1" nj="1" />
+	<zoom id="5s110wT" ibegin="0000" jbegin="0000" ni="1" nj="1" />
+	<zoom id="2s110wT" ibegin="0000" jbegin="0000" ni="1" nj="1" />
+	<zoom id="0n110wT" ibegin="0000" jbegin="0000" ni="1" nj="1" />
+	<zoom id="2n110wT" ibegin="0000" jbegin="0000" ni="1" nj="1" />
+	<zoom id="5n110wT" ibegin="0000" jbegin="0000" ni="1" nj="1" />
+	<zoom id="8n110wT" ibegin="0000" jbegin="0000" ni="1" nj="1" />
+      <!--   95w   -->
+	<zoom id="8s95wT" ibegin="0000" jbegin="0000" ni="1" nj="1" />
+	<zoom id="5s95wT" ibegin="0000" jbegin="0000" ni="1" nj="1" />
+	<zoom id="2s95wT" ibegin="0000" jbegin="0000" ni="1" nj="1" />
+	<zoom id="0n95wT" ibegin="0000" jbegin="0000" ni="1" nj="1" />
+	<zoom id="2n95wT" ibegin="0000" jbegin="0000" ni="1" nj="1" />
+	<zoom id="5n95wT" ibegin="0000" jbegin="0000" ni="1" nj="1" />
+	<zoom id="8n95wT" ibegin="0000" jbegin="0000" ni="1" nj="1" />
+    <!--   RAMA   -->
+      <!--   55e   -->
+	<zoom id="16s55eT"    ibegin="0000" jbegin="0000" ni="1" nj="1" />
+	<zoom id="12s55eT"    ibegin="0000" jbegin="0000" ni="1" nj="1" />
+ 	<zoom id="8s55eT"     ibegin="0000" jbegin="0000" ni="1" nj="1" />
+	<zoom id="4s55eT"     ibegin="0000" jbegin="0000" ni="1" nj="1" />
+	<zoom id="1.5s55eT"   ibegin="0000" jbegin="0000" ni="1" nj="1" />
+	<zoom id="0n55eT"     ibegin="0000" jbegin="0000" ni="1" nj="1" />
+	<zoom id="1.5n55eT"   ibegin="0000" jbegin="0000" ni="1" nj="1" />
+	<zoom id="4n55eT"     ibegin="0000" jbegin="0000" ni="1" nj="1" />
+      <!--   65e   -->
+	<zoom id="15n65eT"    ibegin="0000" jbegin="0000" ni="1" nj="1" />
+      <!--   67e   -->
+	<zoom id="16s67eT"    ibegin="0000" jbegin="0000" ni="1" nj="1" />
+	<zoom id="12s67eT"    ibegin="0000" jbegin="0000" ni="1" nj="1" />
+	<zoom id="8s67eT"     ibegin="0000" jbegin="0000" ni="1" nj="1" />
+	<zoom id="4s67eT"     ibegin="0000" jbegin="0000" ni="1" nj="1" />
+	<zoom id="1.5s67eT"   ibegin="0000" jbegin="0000" ni="1" nj="1" />
+	<zoom id="0n67eT"     ibegin="0000" jbegin="0000" ni="1" nj="1" />
+	<zoom id="1.5n67eT"   ibegin="0000" jbegin="0000" ni="1" nj="1" />
+	<zoom id="4n67eT"     ibegin="0000" jbegin="0000" ni="1" nj="1" />
+	<zoom id="8n67eT"     ibegin="0000" jbegin="0000" ni="1" nj="1" />
+      <!--   80.5e   -->
+	<zoom id="16s80.5eT"  ibegin="0000" jbegin="0000" ni="1" nj="1" />
+	<zoom id="12s80.5eT"  ibegin="0000" jbegin="0000" ni="1" nj="1" />
+	<zoom id="8s80.5eT"   ibegin="0000" jbegin="0000" ni="1" nj="1" />
+	<zoom id="4s80.5eT"   ibegin="0000" jbegin="0000" ni="1" nj="1" />
+	<zoom id="1.5s80.5eT" ibegin="0000" jbegin="0000" ni="1" nj="1" />
+	<zoom id="0n80.5eT"   ibegin="0000" jbegin="0000" ni="1" nj="1" />
+	<zoom id="1.5n80.5eT" ibegin="0000" jbegin="0000" ni="1" nj="1" />
+	<zoom id="4n80.5eT"   ibegin="0000" jbegin="0000" ni="1" nj="1" />
+      <!--   90e   -->
+	<zoom id="1.5s90eT"   ibegin="0000" jbegin="0000" ni="1" nj="1" />
+	<zoom id="0n90eT"     ibegin="0000" jbegin="0000" ni="1" nj="1" />
+	<zoom id="1.5n90eT"   ibegin="0000" jbegin="0000" ni="1" nj="1" />
+	<zoom id="4n90eT"     ibegin="0000" jbegin="0000" ni="1" nj="1" />
+	<zoom id="8n90eT"     ibegin="0000" jbegin="0000" ni="1" nj="1" />
+	<zoom id="12n90eT"    ibegin="0000" jbegin="0000" ni="1" nj="1" />
+	<zoom id="15n90eT"    ibegin="0000" jbegin="0000" ni="1" nj="1" />
+      <!--   95e   -->
+	<zoom id="16s95eT"    ibegin="0000" jbegin="0000" ni="1" nj="1" />
+	<zoom id="12s95eT"    ibegin="0000" jbegin="0000" ni="1" nj="1" />
+	<zoom id="8s95eT"     ibegin="0000" jbegin="0000" ni="1" nj="1" />
+	<zoom id="5s95eT"     ibegin="0000" jbegin="0000" ni="1" nj="1" />
+    <!--   PIRATA   -->
+      <!--   38w-30w   -->
+	<zoom id="19s34wT" ibegin="0000" jbegin="0000" ni="1" nj="1" />
+	<zoom id="14s32wT" ibegin="0000" jbegin="0000" ni="1" nj="1" />
+	<zoom id="8s30wT"  ibegin="0000" jbegin="0000" ni="1" nj="1" />
+	<zoom id="0n35wT"  ibegin="0000" jbegin="0000" ni="1" nj="1" />
+	<zoom id="4n38wT"  ibegin="0000" jbegin="0000" ni="1" nj="1" />
+	<zoom id="8n38wT"  ibegin="0000" jbegin="0000" ni="1" nj="1" />
+	<zoom id="12n38wT" ibegin="0000" jbegin="0000" ni="1" nj="1" />
+	<zoom id="15n38wT" ibegin="0000" jbegin="0000" ni="1" nj="1" />
+	<zoom id="20n38wT" ibegin="0000" jbegin="0000" ni="1" nj="1" />
+      <!--   23w   -->
+	<zoom id="0n23wT"  ibegin="0000" jbegin="0000" ni="1" nj="1" />
+	<zoom id="4n23wT"  ibegin="0000" jbegin="0000" ni="1" nj="1" />
+	<zoom id="12n23wT" ibegin="0000" jbegin="0000" ni="1" nj="1" />
+	<zoom id="21n23wT" ibegin="0000" jbegin="0000" ni="1" nj="1" />
+      <!--   10w   -->
+	<zoom id="10s10wT" ibegin="0000" jbegin="0000" ni="1" nj="1" />
+	<zoom id="6s10wT"  ibegin="0000" jbegin="0000" ni="1" nj="1" />
+	<zoom id="0n10wT"  ibegin="0000" jbegin="0000" ni="1" nj="1" />
+      <!--   0e   -->
+	<zoom id="0n0eT"   ibegin="0000" jbegin="0000" ni="1" nj="1" />
+      </grid>
+
+      <grid id="grid_U" description="grid U" >
+    <!--   Eq section   -->
+	<zoom id="EqU" ibegin="1" jbegin="0000" ni="0000" nj="1" />
+      </grid>
+
+      <grid id="grid_V" description="grid V" >
+      </grid>
+
+      <grid id="grid_W" description="grid W" >
+    <!--   Eq section   -->
+	<zoom id="EqW" ibegin="1" jbegin="0000" ni="0000" nj="1" />
+      </grid>
+
     </grid_definition>    
     
Index: /trunk/CONFIG/ORCA2_LIM_PISCES/EXP00/iodef.xml
===================================================================
--- /trunk/CONFIG/ORCA2_LIM_PISCES/EXP00/iodef.xml	(revision 1724)
+++ /trunk/CONFIG/ORCA2_LIM_PISCES/EXP00/iodef.xml	(revision 1725)
@@ -5,7 +5,12 @@
   <context id="nemo">
     
-    <!-- groups of variables definition -->
-    
-    <field_definition level="1" prec="4" operation="ave(X)" freq_op="5760" enabled=".TRUE.">
+    <!-- 
+============================================================================================================
+=                                  definition of all existing variables                                    =
+=                                            DO NOT CHANGE                                                 =
+============================================================================================================
+    -->
+    
+    <field_definition level="1" prec="4" operation="ave(X)" enabled=".TRUE.">   <!-- time step automaticaly defined -->
 
       <!-- T grid -->
@@ -37,5 +42,5 @@
       <!-- SBC -->
       
-      <group id="SBC" axis_ref="none" grid_ref="grid_T" freq_op="28800">
+      <group id="SBC" axis_ref="none" grid_ref="grid_T" > <!-- time step automaticaly defined based on nn_fsbc -->
 
 	<field id="emp"          description="Net Upward Water Flux"                                        unit="kg/m2/s"  />
@@ -197,5 +202,11 @@
     </field_definition>
     
-    <!-- file definition -->
+    <!-- 
+============================================================================================================
+=                                           output files definition                                        =
+=                                            Define your own files                                         =
+=                                         put the variables you want...                                    =
+============================================================================================================
+    -->
     
     <file_definition output_level="10" enabled=".TRUE.">
@@ -326,4 +337,10 @@
     </file_definition>
     
+    <!-- 
+============================================================================================================
+=                                           grid definition                                                =
+=                                            DO NOT CHANGE                                                 =
+============================================================================================================
+    -->
     
     <axis_definition>  
Index: /trunk/CONFIG/ORCA2_OFF_PISCES/EXP00/iodef.xml
===================================================================
--- /trunk/CONFIG/ORCA2_OFF_PISCES/EXP00/iodef.xml	(revision 1724)
+++ /trunk/CONFIG/ORCA2_OFF_PISCES/EXP00/iodef.xml	(revision 1725)
@@ -5,7 +5,12 @@
 <context id="nemo">
 
-<!-- groups of variables definition -->
+    <!-- 
+============================================================================================================
+=                                  definition of all existing variables                                    =
+=                                            DO NOT CHANGE                                                 =
+============================================================================================================
+    -->
 
-  <field_definition level="1" prec="4" operation="ave(X)" freq_op="21600" enabled=".TRUE.">
+  <field_definition level="1" prec="4" operation="ave(X)" enabled=".TRUE."> <!-- time step automaticaly defined -->
  
       <!-- ptrc on T grid -->
@@ -74,5 +79,11 @@
   </field_definition>
 
-<!-- file definition -->
+    <!-- 
+============================================================================================================
+=                                           output files definition                                        =
+=                                            Define your own files                                         =
+=                                         put the variables you want...                                    =
+============================================================================================================
+    -->
 
   <file_definition output_level="10" enabled=".TRUE.">
@@ -138,4 +149,10 @@
   </file_definition>
 
+    <!-- 
+============================================================================================================
+=                                           grid definition                                                =
+=                                            DO NOT CHANGE                                                 =
+============================================================================================================
+    -->
 
   <axis_definition>  
Index: /trunk/CONFIG/POMME/EXP00/iodef.xml
===================================================================
--- /trunk/CONFIG/POMME/EXP00/iodef.xml	(revision 1724)
+++ /trunk/CONFIG/POMME/EXP00/iodef.xml	(revision 1725)
@@ -5,7 +5,12 @@
   <context id="nemo">
     
-    <!-- groups of variables definition -->
+    <!-- 
+============================================================================================================
+=                                  definition of all existing variables                                    =
+=                                            DO NOT CHANGE                                                 =
+============================================================================================================
+    -->
     
-    <field_definition level="1" prec="4" operation="ave(X)" freq_op="1440" enabled=".TRUE.">
+    <field_definition level="1" prec="4" operation="ave(X)" enabled=".TRUE."> <!-- time step automaticaly defined -->
       
       <!-- T grid -->
@@ -37,5 +42,5 @@
       <!-- SBC -->
       
-      <group id="SBC" axis_ref="none" grid_ref="grid_T" freq_op="28800">
+      <group id="SBC" axis_ref="none" grid_ref="grid_T" > <!-- time step automaticaly defined based on nn_fsbc -->
 
 	<field id="emp"          description="Net Upward Water Flux"                                        unit="kg/m2/s"  />
@@ -109,5 +114,11 @@
   </field_definition>
 
-<!-- file definition -->
+    <!-- 
+============================================================================================================
+=                                           output files definition                                        =
+=                                            Define your own files                                         =
+=                                         put the variables you want...                                    =
+============================================================================================================
+    -->
 
   <file_definition output_level="10" enabled=".TRUE.">
@@ -160,4 +171,10 @@
   </file_definition>
 
+    <!-- 
+============================================================================================================
+=                                           grid definition                                                =
+=                                            DO NOT CHANGE                                                 =
+============================================================================================================
+    -->
 
   <axis_definition>  
Index: /trunk/EXTERNAL/XMLIO_SERVER/AA_make
===================================================================
--- /trunk/EXTERNAL/XMLIO_SERVER/AA_make	(revision 1724)
+++ /trunk/EXTERNAL/XMLIO_SERVER/AA_make	(revision 1725)
@@ -69,25 +69,32 @@
 	mod_mpi_buffer_server.o mod_pack.o mod_prec.o mod_wait.o pack_f.o 
 
-MODS2 =	../src/XMLIO/mod_axis.f90 ../src/XMLIO/mod_axis_definition.f90 \
-	../src/XMLIO/mod_axis_group.f90 ../src/XMLIO/mod_context.f90 \
-	../src/XMLIO/mod_dependency.f90 ../src/XMLIO/mod_domain.f90 \
-	../src/XMLIO/mod_error_msg.f90 ../src/XMLIO/mod_field.f90 \
+MODS2 =	../src/XMLIO/mod_attribut.f90 ../src/XMLIO/mod_attribut_list.f90 \
+	../src/XMLIO/mod_axis.f90 ../src/XMLIO/mod_axis_attribut.f90 \
+	../src/XMLIO/mod_axis_definition.f90 ../src/XMLIO/mod_axis_group.f90 \
+	../src/XMLIO/mod_context.f90 ../src/XMLIO/mod_dependency.f90 \
+	../src/XMLIO/mod_domain.f90 ../src/XMLIO/mod_error_msg.f90 \
+	../src/XMLIO/mod_field.f90 ../src/XMLIO/mod_field_attribute.f90 \
 	../src/XMLIO/mod_field_definition.f90 \
 	../src/XMLIO/mod_field_group.f90 ../src/XMLIO/mod_file.f90 \
+	../src/XMLIO/mod_file_attribut.f90 \
 	../src/XMLIO/mod_file_definition.f90 ../src/XMLIO/mod_file_group.f90 \
-	../src/XMLIO/mod_grid.f90 ../src/XMLIO/mod_grid_definition.f90 \
-	../src/XMLIO/mod_grid_group.f90 ../src/XMLIO/mod_parse_xml.f90 \
-	../src/XMLIO/mod_sorted_list.f90 ../src/XMLIO/mod_time_parameters.f90 \
+	../src/XMLIO/mod_grid.f90 ../src/XMLIO/mod_grid_attribut.f90 \
+	../src/XMLIO/mod_grid_definition.f90 ../src/XMLIO/mod_grid_group.f90 \
+	../src/XMLIO/mod_object.f90 ../src/XMLIO/mod_parse_xml.f90 \
+	../src/XMLIO/mod_sorted_list.f90 ../src/XMLIO/mod_stdtype.f90 \
+	../src/XMLIO/mod_time_parameters.f90 \
 	../src/XMLIO/mod_xmlio_parameters.f90 ../src/XMLIO/mod_zoom.f90 \
-	../src/XMLIO/string_function.f90 ../src/XMLIO/test_xmlio.f90 \
-	../src/XMLIO/xmlio.f90
-
-OBJSMODS2 =	mod_axis.o mod_axis_definition.o mod_axis_group.o mod_context.o \
-	mod_dependency.o mod_domain.o mod_error_msg.o mod_field.o \
+	../src/XMLIO/mod_zoom_attribut.f90 ../src/XMLIO/string_function.f90 \
+	../src/XMLIO/test_xmlio.f90 ../src/XMLIO/xmlio.f90
+
+OBJSMODS2 =	mod_attribut.o mod_attribut_list.o mod_axis.o mod_axis_attribut.o \
+	mod_axis_definition.o mod_axis_group.o mod_context.o mod_dependency.o \
+	mod_domain.o mod_error_msg.o mod_field.o mod_field_attribute.o \
 	mod_field_definition.o mod_field_group.o mod_file.o \
-	mod_file_definition.o mod_file_group.o mod_grid.o \
-	mod_grid_definition.o mod_grid_group.o mod_parse_xml.o \
-	mod_sorted_list.o mod_time_parameters.o mod_xmlio_parameters.o \
-	mod_zoom.o string_function.o  xmlio.o
+	mod_file_attribut.o mod_file_definition.o mod_file_group.o mod_grid.o \
+	mod_grid_attribut.o mod_grid_definition.o mod_grid_group.o \
+	mod_object.o mod_parse_xml.o mod_sorted_list.o mod_stdtype.o \
+	mod_time_parameters.o mod_xmlio_parameters.o mod_zoom.o \
+	mod_zoom_attribut.o string_function.o  xmlio.o
 
 .SUFFIXES: .f90 .F90
@@ -171,7 +178,9 @@
 $(MODEL_LIB1)(mod_event_client.o): $(MODEL_LIB1)(mod_event_parameters.o) \
 	$(MODEL_LIB1)(mod_iomanager.o) $(MODEL_LIB1)(mod_ioserver_namelist.o) \
-	$(MODEL_LIB1)(mod_mpi_buffer_client.o) $(MODEL_LIB1)(mod_pack.o)
+	$(MODEL_LIB1)(mod_mpi_buffer_client.o) $(MODEL_LIB1)(mod_pack.o) \
+	$(MODEL_LIB1)(mod_attribut.o)
 $(MODEL_LIB1)(mod_event_server.o): $(MODEL_LIB1)(mod_event_parameters.o) \
-	$(MODEL_LIB1)(mod_iomanager.o) $(MODEL_LIB1)(mod_pack.o)
+	$(MODEL_LIB1)(mod_iomanager.o) $(MODEL_LIB1)(mod_pack.o) \
+	$(MODEL_LIB1)(mod_attribut.o)
 $(MODEL_LIB1)(mod_global_memory.o): $(MODEL_LIB1)(mpi_mod.o)
 $(MODEL_LIB1)(mod_interface_ioipsl.o): $(MODEL_LIB1)(mod_ioserver_para.o) \
@@ -183,5 +192,10 @@
 	$(MODEL_LIB1)(mpi_mod.o)
 $(MODEL_LIB1)(mod_iomanager.o): $(MODEL_LIB1)(mod_field_bufferize.o) \
-	$(MODEL_LIB1)(mod_interface_ioipsl.o) $(MODEL_LIB2)
+	$(MODEL_LIB1)(mod_interface_ioipsl.o) $(MODEL_LIB1)(mod_attribut.o) \
+	$(MODEL_LIB1)(mod_axis.o) $(MODEL_LIB1)(mod_axis_group.o) \
+	$(MODEL_LIB1)(mod_field.o) $(MODEL_LIB1)(mod_field_group.o) \
+	$(MODEL_LIB1)(mod_file.o) $(MODEL_LIB1)(mod_file_group.o) \
+	$(MODEL_LIB1)(mod_grid.o) $(MODEL_LIB1)(mod_grid_group.o) \
+	$(MODEL_LIB1)(mod_object.o) $(MODEL_LIB1)(mod_zoom.o) $(MODEL_LIB2)
 $(MODEL_LIB1)(mod_mpi_buffer_client.o): $(MODEL_LIB1)(mod_global_memory.o) \
 	$(MODEL_LIB1)(mod_ioclient_para.o) \
@@ -195,4 +209,6 @@
 	$(MODEL_LIB1)(mod_wait.o) $(MODEL_LIB1)(mpi_mod.o) \
 	$(MODEL_LIB1)(mpitrace.o)
+$(MODEL_LIB1)(mod_pack.o): $(MODEL_LIB1)(mod_attribut.o) \
+	$(MODEL_LIB1)(mod_stdtype.o)
 $(MODEL_LIB1)(pack_f.o): $(MODEL_LIB1)(mod_prec.o)
 $(MODEL_LIB1)(server.o): $(MODEL_LIB1)(mod_global_memory.o) \
@@ -207,11 +223,22 @@
 $(MODEL_LIB1)(mpi_mod.o): 
 $(MODEL_LIB1)(mpitrace.o): 
-$(MODEL_LIB2)(mod_axis.o): $(MODEL_LIB2)(mod_error_msg.o) \
+$(MODEL_LIB2)(mod_attribut.o): $(MODEL_LIB2)(mod_attribut_list.o) \
+	$(MODEL_LIB2)(mod_error_msg.o) $(MODEL_LIB2)(mod_object.o) \
+	$(MODEL_LIB2)(mod_stdtype.o) $(MODEL_LIB2)(mod_xmlio_parameters.o) \
+	$(MODEL_LIB2)(string_function.o)
+$(MODEL_LIB2)(mod_attribut_list.o): $(MODEL_LIB2)(mod_axis_attribut.o) \
+	$(MODEL_LIB2)(mod_field_attribute.o) \
+	$(MODEL_LIB2)(mod_file_attribut.o) $(MODEL_LIB2)(mod_grid_attribut.o) \
+	$(MODEL_LIB2)(mod_zoom_attribut.o)
+$(MODEL_LIB2)(mod_axis.o): $(MODEL_LIB2)(mod_attribut.o) \
+	$(MODEL_LIB2)(mod_axis_attribut.o) $(MODEL_LIB2)(mod_error_msg.o) \
 	$(MODEL_LIB2)(mod_sorted_list.o) \
 	$(MODEL_LIB2)(mod_xmlio_parameters.o) \
 	$(MODEL_LIB2)(string_function.o) ../src/XMLIO/vector_axis_def.inc
+$(MODEL_LIB2)(mod_axis_attribut.o): $(MODEL_LIB2)(mod_object.o)
 $(MODEL_LIB2)(mod_axis_definition.o): $(MODEL_LIB2)(mod_axis_group.o)
-$(MODEL_LIB2)(mod_axis_group.o): $(MODEL_LIB2)(mod_axis.o) \
-	$(MODEL_LIB2)(mod_xmlio_parameters.o) \
+$(MODEL_LIB2)(mod_axis_group.o): $(MODEL_LIB2)(mod_attribut.o) \
+	$(MODEL_LIB2)(mod_axis.o) $(MODEL_LIB2)(mod_error_msg.o) \
+	$(MODEL_LIB2)(mod_object.o) $(MODEL_LIB2)(mod_xmlio_parameters.o) \
 	$(MODEL_LIB2)(string_function.o) \
 	../src/XMLIO/vector_axis_group_def.inc
@@ -237,30 +264,39 @@
 	../src/XMLIO/vector_domain_def.inc
 $(MODEL_LIB2)(mod_error_msg.o): $(MODEL_LIB2)(mod_xmlio_parameters.o)
-$(MODEL_LIB2)(mod_field.o): $(MODEL_LIB2)(mod_axis.o) \
-	$(MODEL_LIB2)(mod_error_msg.o) $(MODEL_LIB2)(mod_grid.o) \
+$(MODEL_LIB2)(mod_field.o): $(MODEL_LIB2)(mod_attribut.o) \
+	$(MODEL_LIB2)(mod_axis.o) $(MODEL_LIB2)(mod_error_msg.o) \
+	$(MODEL_LIB2)(mod_field_attribute.o) $(MODEL_LIB2)(mod_grid.o) \
 	$(MODEL_LIB2)(mod_sorted_list.o) \
 	$(MODEL_LIB2)(mod_xmlio_parameters.o) $(MODEL_LIB2)(mod_zoom.o) \
 	$(MODEL_LIB2)(string_function.o) ../src/XMLIO/vector_field_def.inc
+$(MODEL_LIB2)(mod_field_attribute.o): $(MODEL_LIB2)(mod_object.o)
 $(MODEL_LIB2)(mod_field_definition.o): $(MODEL_LIB2)(mod_field_group.o)
-$(MODEL_LIB2)(mod_field_group.o): $(MODEL_LIB2)(mod_field.o) \
-	$(MODEL_LIB2)(mod_xmlio_parameters.o) \
+$(MODEL_LIB2)(mod_field_group.o): $(MODEL_LIB2)(mod_attribut.o) \
+	$(MODEL_LIB2)(mod_error_msg.o) $(MODEL_LIB2)(mod_field.o) \
+	$(MODEL_LIB2)(mod_object.o) $(MODEL_LIB2)(mod_xmlio_parameters.o) \
 	$(MODEL_LIB2)(string_function.o) \
 	../src/XMLIO/vector_field_group_def.inc
-$(MODEL_LIB2)(mod_file.o): $(MODEL_LIB2)(mod_error_msg.o) \
-	$(MODEL_LIB2)(mod_field_group.o) $(MODEL_LIB2)(mod_sorted_list.o) \
+$(MODEL_LIB2)(mod_file.o): $(MODEL_LIB2)(mod_attribut.o) \
+	$(MODEL_LIB2)(mod_error_msg.o) $(MODEL_LIB2)(mod_field_group.o) \
+	$(MODEL_LIB2)(mod_file_attribut.o) $(MODEL_LIB2)(mod_sorted_list.o) \
 	$(MODEL_LIB2)(mod_xmlio_parameters.o) \
 	$(MODEL_LIB2)(string_function.o) ../src/XMLIO/vector_file_def.inc
+$(MODEL_LIB2)(mod_file_attribut.o): $(MODEL_LIB2)(mod_object.o)
 $(MODEL_LIB2)(mod_file_definition.o): $(MODEL_LIB2)(mod_file_group.o)
-$(MODEL_LIB2)(mod_file_group.o): $(MODEL_LIB2)(mod_file.o) \
-	$(MODEL_LIB2)(mod_xmlio_parameters.o) \
+$(MODEL_LIB2)(mod_file_group.o): $(MODEL_LIB2)(mod_attribut.o) \
+	$(MODEL_LIB2)(mod_error_msg.o) $(MODEL_LIB2)(mod_file.o) \
+	$(MODEL_LIB2)(mod_object.o) $(MODEL_LIB2)(mod_xmlio_parameters.o) \
 	$(MODEL_LIB2)(string_function.o) \
 	../src/XMLIO/vector_file_group_def.inc
-$(MODEL_LIB2)(mod_grid.o): $(MODEL_LIB2)(mod_domain.o) \
-	$(MODEL_LIB2)(mod_sorted_list.o) \
+$(MODEL_LIB2)(mod_grid.o): $(MODEL_LIB2)(mod_attribut.o) \
+	$(MODEL_LIB2)(mod_domain.o) $(MODEL_LIB2)(mod_error_msg.o) \
+	$(MODEL_LIB2)(mod_grid_attribut.o) $(MODEL_LIB2)(mod_sorted_list.o) \
 	$(MODEL_LIB2)(mod_xmlio_parameters.o) $(MODEL_LIB2)(mod_zoom.o) \
 	$(MODEL_LIB2)(string_function.o) ../src/XMLIO/vector_grid_def.inc
+$(MODEL_LIB2)(mod_grid_attribut.o): $(MODEL_LIB2)(mod_object.o)
 $(MODEL_LIB2)(mod_grid_definition.o): $(MODEL_LIB2)(mod_grid_group.o)
-$(MODEL_LIB2)(mod_grid_group.o): $(MODEL_LIB2)(mod_grid.o) \
-	$(MODEL_LIB2)(mod_xmlio_parameters.o) \
+$(MODEL_LIB2)(mod_grid_group.o): $(MODEL_LIB2)(mod_attribut.o) \
+	$(MODEL_LIB2)(mod_error_msg.o) $(MODEL_LIB2)(mod_grid.o) \
+	$(MODEL_LIB2)(mod_object.o) $(MODEL_LIB2)(mod_xmlio_parameters.o) \
 	$(MODEL_LIB2)(string_function.o) \
 	../src/XMLIO/vector_grid_group_def.inc
@@ -275,8 +311,12 @@
 	$(MODEL_LIB2)(string_function.o)
 $(MODEL_LIB2)(mod_sorted_list.o): ../src/XMLIO/vector_node_def.inc
-$(MODEL_LIB2)(mod_zoom.o): $(MODEL_LIB2)(mod_sorted_list.o) \
+$(MODEL_LIB2)(mod_zoom.o): $(MODEL_LIB2)(mod_attribut.o) \
+	$(MODEL_LIB2)(mod_error_msg.o) $(MODEL_LIB2)(mod_sorted_list.o) \
 	$(MODEL_LIB2)(mod_xmlio_parameters.o) \
-	$(MODEL_LIB2)(string_function.o) ../src/XMLIO/vector_zoom_def.inc
-$(MODEL_LIB2)(string_function.o): $(MODEL_LIB2)(mod_error_msg.o)
+	$(MODEL_LIB2)(mod_zoom_attribut.o) $(MODEL_LIB2)(string_function.o) \
+	../src/XMLIO/vector_zoom_def.inc
+$(MODEL_LIB2)(mod_zoom_attribut.o): $(MODEL_LIB2)(mod_object.o)
+$(MODEL_LIB2)(string_function.o): $(MODEL_LIB2)(mod_error_msg.o) \
+	$(MODEL_LIB2)(mod_xmlio_parameters.o)
 $(MODEL_LIB2)(test_xmlio.o): $(MODEL_LIB2)(mod_interface_ioipsl.o) \
 	$(MODEL_LIB2)(xmlio.o)
Index: /trunk/NEMO/OPA_SRC/DIA/dianam.F90
===================================================================
--- /trunk/NEMO/OPA_SRC/DIA/dianam.F90	(revision 1724)
+++ /trunk/NEMO/OPA_SRC/DIA/dianam.F90	(revision 1725)
@@ -30,5 +30,5 @@
 CONTAINS
 
-   SUBROUTINE dia_nam( cdfnam, kfreq, cdsuff )
+   SUBROUTINE dia_nam( cdfnam, kfreq, cdsuff, ldfsec )
       !!---------------------------------------------------------------------
       !!                  ***  ROUTINE dia_nam  ***
@@ -42,52 +42,60 @@
       !!
       !!----------------------------------------------------------------------
-      CHARACTER (len=*), INTENT(  out) ::   cdfnam           ! file name
-      CHARACTER (len=*), INTENT(in   ) ::   cdsuff           ! to be added at the end of the file name
-      INTEGER,           INTENT(in   ) ::   kfreq            ! output frequency (in time-step): < 0 for monthly outputs
-      !                                                                                         0 if no frequency
-      CHARACTER (len=20) ::   clfmt, clfmt0                  ! writing format
-      CHARACTER (len=20) ::   clave                          ! name for output frequency
-      CHARACTER (len=20) ::   cldate1                        ! date of the beginning of run
-      CHARACTER (len=20) ::   cldate2                        ! date of the end       of run
-      INTEGER            ::   iyear1, imonth1, iday1         ! year, month, day of the first day of the run
-      INTEGER            ::   iyear2, imonth2, iday2         ! year, month, day of the last  day of the run
-      INTEGER            ::   indg                           ! number of digits needed to write a number     
-      INTEGER            ::   inbsec, inbmn, inbhr, inbday   ! output frequency in seconds, minutes, hours and days
-      INTEGER            ::   iddss, ihhss, immss            ! number of seconds in 1 day, 1 hour and 1 minute
-      REAL(wp)           ::   zsec1, zsec2                   ! not used
-      REAL(wp)           ::   zdrun, zjul                    ! temporary scalars
+      CHARACTER (len=*), INTENT(  out)           ::   cdfnam   ! file name
+      CHARACTER (len=*), INTENT(in   )           ::   cdsuff   ! to be added at the end of the file name
+      INTEGER          , INTENT(in   )           ::   kfreq    ! output frequency. < 0 for monthly outputs; = 0 if no frequency
+      LOGICAL          , INTENT(in   ), OPTIONAL ::   ldfsec   ! kfreq in second(in time-step) if .true.(.false. default)
+      !
+      CHARACTER (len=20) ::   clfmt, clfmt0                    ! writing format
+      CHARACTER (len=20) ::   clave                            ! name for output frequency
+      CHARACTER (len=20) ::   cldate1                          ! date of the beginning of run
+      CHARACTER (len=20) ::   cldate2                          ! date of the end       of run
+      LOGICAL            ::   llfsec                           ! local value of ldfsec
+      INTEGER            ::   iyear1, imonth1, iday1           ! year, month, day of the first day of the run
+      INTEGER            ::   iyear2, imonth2, iday2           ! year, month, day of the last  day of the run
+      INTEGER            ::   indg                             ! number of digits needed to write a number     
+      INTEGER            ::   inbsec, inbmn, inbhr             ! output frequency in seconds, minutes and hours
+      INTEGER            ::   inbday, inbyr                    ! output frequency in days and years
+      INTEGER            ::   iyyss, iddss, ihhss, immss       ! number of seconds in 1 year, 1 day, 1 hour and 1 minute
+      REAL(wp)           ::   zsec1, zsec2                     ! not used
+      REAL(wp)           ::   zdrun, zjul                      ! temporary scalars
       !!----------------------------------------------------------------------
-
-      IF(lwp) WRITE(numout,*)
-      IF(lwp) WRITE(numout,*) ' dia_nam: building output file name'
-      IF(lwp) WRITE(numout,*) ' ~~~~~~~'
-      IF(lwp) WRITE(numout,*)
 
       ! name for output frequency
 
-      inbsec = kfreq * NINT( rdttra(1) )                                    ! output frequency in seconds
-      iddss = NINT( rday          )                                         ! number of seconds in 1 day
-      ihhss = NINT( rmmss * rhhmm )                                         ! number of seconds in 1 hour
-      immss = NINT( rmmss         )                                         ! number of seconds in 1 minute
+      IF( PRESENT(ldfsec) ) THEN   ;   llfsec = ldfsec
+      ELSE                         ;   llfsec = .FALSE.
+      ENDIF
+
+      IF( llfsec ) THEN   ;   inbsec = kfreq                                ! output frequency already in seconds
+      ELSE                ;   inbsec = kfreq * NINT( rdttra(1) )            ! from time-step to seconds
+      ENDIF
+      iddss = NINT( rday          )                                         ! seconds in 1 day
+      ihhss = NINT( rmmss * rhhmm )                                         ! seconds in 1 hour
+      immss = NINT( rmmss         )                                         ! seconds in 1 minute
+      iyyss = iddss * nyear_len(1)                                          ! seconds in 1 year (not good: multi years with leap)
       clfmt0 = "('(a,i',i1,',a)')"                                          ! format '(a,ix,a)' with x to be defined
       ! 
       IF(          inbsec == 0           ) THEN   ;   clave = ''            ! no frequency
       ELSEIF(      inbsec <  0           ) THEN   ;   clave = '_1m'         ! frequency in month
+      ELSEIF( MOD( inbsec, iyyss  ) == 0 ) THEN                             ! frequency in years
+         inbyr  = inbsec / iyyss
+         indg   = INT(LOG10(REAL(inbyr ,wp))) + 1                           ! number of digits needed to write years   frequency
+         WRITE(clfmt, clfmt0) indg                ;   WRITE(clave, clfmt) '_', inbyr , 'y'
       ELSEIF( MOD( inbsec, iddss  ) == 0 ) THEN                             ! frequency in days
          inbday = inbsec / iddss
-         indg = INT(LOG10(REAL(inbday,wp))) + 1                             ! number of digits needed to write days    frequency
+         indg   = INT(LOG10(REAL(inbday,wp))) + 1                           ! number of digits needed to write days    frequency
          WRITE(clfmt, clfmt0) indg                ;   WRITE(clave, clfmt) '_', inbday, 'd'
          IF( inbday == nmonth_len(nmonth) )           clave = '_1m'
-         IF( inbday ==  nyear_len(1     ) )           clave = '_1y'
       ELSEIF( MOD( inbsec, ihhss ) == 0 ) THEN                              ! frequency in hours
-         inbhr = inbsec / ihhss
-         indg = INT(LOG10(REAL(inbhr ,wp))) + 1                             ! number of digits needed to write hours   frequency
-         WRITE(clfmt, clfmt0) indg                ;   WRITE(clave, clfmt) '_', inbhr, 'h'
+         inbhr  = inbsec / ihhss
+         indg   = INT(LOG10(REAL(inbhr ,wp))) + 1                           ! number of digits needed to write hours   frequency
+         WRITE(clfmt, clfmt0) indg                ;   WRITE(clave, clfmt) '_', inbhr , 'h'
       ELSEIF( MOD( inbsec, immss ) == 0 ) THEN                              ! frequency in minutes
-         inbmn = inbsec / immss
-         indg = INT(LOG10(REAL(inbmn ,wp))) + 1                             ! number of digits needed to write minutes frequency
-         WRITE(clfmt, clfmt0) indg                ;   WRITE(clave, clfmt) '_', inbmn, 'mn'
+         inbmn  = inbsec / immss
+         indg   = INT(LOG10(REAL(inbmn ,wp))) + 1                           ! number of digits needed to write minutes frequency
+         WRITE(clfmt, clfmt0) indg                ;   WRITE(clave, clfmt) '_', inbmn , 'mn'
       ELSE                                                                  ! frequency in seconds
-         indg = INT(LOG10(REAL(inbsec,wp))) + 1                             ! number of digits needed to write seconds frequency
+         indg   = INT(LOG10(REAL(inbsec,wp))) + 1                           ! number of digits needed to write seconds frequency
          WRITE(clfmt, clfmt0) indg                ;   WRITE(clave, clfmt) '_', inbsec, 's'
       ENDIF
@@ -112,7 +120,4 @@
 #endif    
 
-      IF(lwp) WRITE(numout,*) cdfnam     
-      IF(lwp) WRITE(numout,*)          
-
    END SUBROUTINE dia_nam
 
Index: /trunk/NEMO/OPA_SRC/DOM/daymod.F90
===================================================================
--- /trunk/NEMO/OPA_SRC/DOM/daymod.F90	(revision 1725)
+++ /trunk/NEMO/OPA_SRC/DOM/daymod.F90	(revision 1725)
@@ -0,0 +1,327 @@
+MODULE daymod
+   !!======================================================================
+   !!                       ***  MODULE  daymod  ***
+   !! Ocean        :  calendar 
+   !!=====================================================================
+   !! History :  OPA  ! 1994-09  (M. Pontaud M. Imbard)  Original code
+   !!                 ! 1997-03  (O. Marti)
+   !!                 ! 1997-05  (G. Madec) 
+   !!                 ! 1997-08  (M. Imbard)
+   !!   NEMO     1.0  ! 2003-09  (G. Madec)  F90 + nyear, nmonth, nday
+   !!                 ! 2004-01  (A.M. Treguier) new calculation based on adatrj
+   !!                 ! 2006-08  (G. Madec)  surface module major update
+   !!----------------------------------------------------------------------      
+
+   !!----------------------------------------------------------------------
+   !!   day        : calendar
+   !!  
+   !!           -------------------------------
+   !!           ----------- WARNING -----------
+   !!
+   !!   we suppose that the time step is deviding the number of second of in a day
+   !!             ---> MOD( rday, rdttra(1) ) == 0
+   !!
+   !!           ----------- WARNING -----------
+   !!           -------------------------------
+   !!  
+   !!----------------------------------------------------------------------
+   USE dom_oce         ! ocean space and time domain
+   USE phycst          ! physical constants
+   USE in_out_manager  ! I/O manager
+   USE iom             ! 
+   USE ioipsl, ONLY :   ymds2ju   ! for calendar
+   USE prtctl          ! Print control
+   USE restart         ! 
+
+   IMPLICIT NONE
+   PRIVATE
+
+   PUBLIC   day        ! called by step.F90
+   PUBLIC   day_init   ! called by istate.F90
+
+   !!----------------------------------------------------------------------
+   !! NEMO/OPA 3.2 , LOCEAN-IPSL (2009) 
+   !! $Id$
+   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
+
+CONTAINS
+
+   SUBROUTINE day_init
+      !!----------------------------------------------------------------------
+      !!                   ***  ROUTINE day_init  ***
+      !! 
+      !! ** Purpose :   Initialization of the calendar values to their values 1 time step before nit000 
+      !!                because day will be called at the beginning of step
+      !!
+      !! ** Action  : - nyear        : current year
+      !!              - nmonth       : current month of the year nyear
+      !!              - nday         : current day of the month nmonth
+      !!              - nday_year    : current day of the year nyear
+      !!              - rsec_year    : current time step counted in second since 00h jan 1st of the current year
+      !!              - rsec_month   : current time step counted in second since 00h 1st day of the current month
+      !!              - rsec_day     : current time step counted in second since 00h of the current day
+      !!              - sec1jan000   : second since Jan. 1st 00h of nit000 year and Jan. 1st 00h of the current year
+      !!              - nmonth_len, nyear_len, rmonth_half, rmonth_end through day_mth
+      !!----------------------------------------------------------------------
+
+      ! all calendar staff is based on the fact that MOD( rday, rdttra(1) ) == 0
+      IF( MOD( rday, rdttra(1) ) /= 0 )   CALL ctl_stop( 'the time step must devide the number of second of in a day' )
+
+      CALL day_rst( nit000, 'READ' ) 
+
+      ! set the calandar from ndastp (read in restart file and namelist)
+
+      nyear   =   ndastp / 10000
+      nmonth  = ( ndastp - (nyear * 10000) ) / 100
+      nday    =   ndastp - (nyear * 10000) - ( nmonth * 100 ) 
+
+      CALL ymds2ju( nyear, nmonth, nday, 0.0, fjulday )  ! we assume that we start run at 00:00
+      fjulday = fjulday + 1.                             ! move back to the day at nit000 (and not at nit000 - 1)
+
+      sec1jan000 = 0.e0
+      CALL day_mth
+      
+      IF ( nday == 0 ) THEN     !   for ex if ndastp = ndate0 - 1
+         nmonth = nmonth - 1  
+         nday = nmonth_len(nmonth)
+      ENDIF
+      IF ( nmonth == 0 ) THEN   ! go at the end of previous year
+         nmonth = 12
+         nyear = nyear - 1
+         sec1jan000 = sec1jan000 - rday * REAL( nyear_len(0), wp )
+         IF( nleapy == 1 )   CALL day_mth
+      ENDIF
+      
+      ! day since january 1st
+      nday_year = nday + SUM( nmonth_len(1:nmonth - 1) )
+      
+      ! number of seconds since the beginning of current year/month at the middle of the time-step
+      rsec_year  = REAL( nday_year, wp ) * rday - 0.5 * rdttra(1)   ! 1 time step before the middle of the first time step
+      rsec_month = REAL( nday     , wp ) * rday - 0.5 * rdttra(1)   ! because day will be called at the beginning of step
+      rsec_day   =                         rday - 0.5 * rdttra(1)
+
+      ! control print
+      IF(lwp) WRITE(numout,*)' ==============>> 1/2 time step before the start of the run DATE Y/M/D = ',   &
+           &                   nyear, '/', nmonth, '/', nday, '  rsec_day:', rsec_day
+
+      ! Up to now, calendar parameters are related to the end of previous run (nit000-1)
+      ! call day to set the calendar parameters at the begining of the current simulaton. needed by iom_init
+      CALL day( nit000 )
+
+      
+   END SUBROUTINE day_init
+
+
+   SUBROUTINE day_mth
+      !!----------------------------------------------------------------------
+      !!                   ***  ROUTINE day_init  ***
+      !! 
+      !! ** Purpose :   calendar values related to the months
+      !!
+      !! ** Action  : - nmonth_len    : length in days of the months of the current year
+      !!              - nyear_len     : length in days of the previous/current year
+      !!              - rmonth_half   : second since the beginning of the year and the halft of the months
+      !!              - rmonth_end    : second since the beginning of the year and the end of the months
+      !!----------------------------------------------------------------------
+      INTEGER  ::   jm               ! dummy loop indice
+      !!----------------------------------------------------------------------
+
+      ! length of the month of the current year (from nleapy, read in namelist)
+      IF ( nleapy < 2 ) THEN 
+         nmonth_len(:) = (/ 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31 /)
+         nyear_len(:) = 365
+         IF ( nleapy == 1 ) THEN   ! we are using calandar with leap years
+            IF ( MOD(nyear-1, 4) == 0 .AND. ( MOD(nyear-1, 400) == 0 .OR. MOD(nyear-1, 100) /= 0 ) ) THEN
+               nyear_len(0) = 366
+            ENDIF
+            IF ( MOD(nyear, 4) == 0 .AND. ( MOD(nyear, 400) == 0 .OR. MOD(nyear, 100) /= 0 ) ) THEN
+               nmonth_len(2) = 29
+               nyear_len(1) = 366
+            ENDIF
+         ENDIF
+      ELSE
+         nmonth_len(:) = nleapy   ! all months with nleapy days per year
+         nyear_len(:) = 12 * nleapy
+      ENDIF
+
+      ! half month in second since the begining of the year:
+      ! time since Jan 1st   0     1     2    ...    11    12    13
+      !          ---------*--|--*--|--*--| ... |--*--|--*--|--*--|--------------------------------------
+      !                 <---> <---> <--->  ...  <---> <---> <--->        
+      ! month number      0     1     2    ...    11    12    13
+      !
+      ! rmonth_half(jm) = rday * REAL( 0.5 * nmonth_len(jm) + SUM(nmonth_len(1:jm-1)) )
+      rmonth_half(0) = - 0.5 * rday * REAL( nmonth_len(0), wp )
+      DO jm = 1, 13
+         rmonth_half(jm) = rmonth_half(jm-1) + 0.5 * rday * REAL( nmonth_len(jm-1) + nmonth_len(jm), wp )
+      END DO
+
+      rmonth_end(0) = 0.
+      DO jm = 1, 13
+         rmonth_end(jm) = rmonth_end(jm-1) + rday * REAL( nmonth_len(jm), wp )
+      END DO
+      !           
+   END SUBROUTINE 
+
+
+   SUBROUTINE day( kt )
+      !!----------------------------------------------------------------------
+      !!                      ***  ROUTINE day  ***
+      !! 
+      !! ** Purpose :   Compute the date with a day iteration IF necessary.
+      !!
+      !! ** Method  : - ???
+      !!
+      !! ** Action  : - nyear     : current year
+      !!              - nmonth    : current month of the year nyear
+      !!              - nday      : current day of the month nmonth
+      !!              - nday_year : current day of the year nyear
+      !!              - ndastp    : = nyear*10000 + nmonth*100 + nday
+      !!              - adatrj    : date in days since the beginning of the run
+      !!              - rsec_year : current time of the year (in second since 00h, jan 1st)
+      !!----------------------------------------------------------------------      
+      INTEGER, INTENT(in) ::   kt        ! ocean time-step indices
+      !
+      CHARACTER (len=25) ::   charout
+      !!----------------------------------------------------------------------
+
+      !                                                 ! New time-step
+      rsec_year  = rsec_year  + rdttra(1) 
+      rsec_month = rsec_month + rdttra(1)                 
+      rsec_day   = rsec_day   + rdttra(1)                 
+      adatrj  = adatrj  + rdttra(1) / rday
+      fjulday = fjulday + rdttra(1) / rday
+      
+      IF( rsec_day > rday ) THEN                        ! NEW day
+         !
+         nday      = nday + 1
+         nday_year = nday_year + 1
+         rsec_day  = 0.5 * rdttra(1)                 
+         !
+         IF( nday == nmonth_len(nmonth) + 1 ) THEN      ! NEW month
+            nday   = 1
+            nmonth = nmonth + 1
+            rsec_month = 0.5 * rdttra(1)
+            IF( nmonth == 13 ) THEN                     ! NEW year
+               nyear     = nyear + 1
+               nmonth    = 1
+               nday_year = 1
+               rsec_year = 0.5 * rdttra(1)
+               sec1jan000 = sec1jan000 + rday * REAL( nyear_len(1), wp )
+               IF( nleapy == 1 )   CALL day_mth
+            ENDIF
+         ENDIF
+         !
+         ndastp = nyear * 10000 + nmonth * 100 + nday   ! NEW date
+         !
+         IF(lwp) WRITE(numout,'(a,i8,a,i4.4,a,i2.2,a,i2.2,a,i3.3)') '======>> time-step =', kt,   &
+              &   '      New day, DATE Y/M/D = ', nyear, '/', nmonth, '/', nday, '      nday_year = ', nday_year
+         IF(lwp) WRITE(numout,'(a,F9.0,a,F9.0,a,F9.0)') '         rsec_year = ', rsec_year,   &
+              &   '   rsec_month = ', rsec_month, '   rsec_day = ', rsec_day
+      ENDIF
+      
+      IF(ln_ctl) THEN
+         WRITE(charout,FMT="('kt =', I4,'  d/m/y =',I2,I2,I4)") kt, nday, nmonth, nyear
+         CALL prt_ctl_info(charout)
+      ENDIF
+
+      IF( lrst_oce )   CALL day_rst( kt, 'WRITE' )
+      !
+   END SUBROUTINE day
+
+
+   SUBROUTINE day_rst( kt, cdrw )
+      !!---------------------------------------------------------------------
+      !!                   ***  ROUTINE ts_rst  ***
+      !! 
+      !!  ** Purpose : Read or write calendar in restart file:
+      !! 
+      !!  WRITE(READ) mode:
+      !!       kt        : number of time step since the begining of the experiment at the 
+      !!                   end of the current(previous) run
+      !!       adatrj(0) : number of elapsed days since the begining of the experiment at the 
+      !!                   end of the current(previous) run (REAL -> keep fractions of day)
+      !!       ndastp    : date at the end of the current(previous) run (coded as yyyymmdd integer)
+      !! 
+      !!   According to namelist parameter nrstdt,
+      !!       nrstdt = 0  no control on the date (nit000 is  arbitrary).
+      !!       nrstdt = 1  we verify that nit000 is equal to the last
+      !!                   time step of previous run + 1.
+      !!       In both those options, the  exact duration of the experiment
+      !!       since the beginning (cumulated duration of all previous restart runs)
+      !!       is not stored in the restart and is assumed to be (nit000-1)*rdt.
+      !!       This is valid is the time step has remained constant.
+      !!
+      !!       nrstdt = 2  the duration of the experiment in days (adatrj)
+      !!                    has been stored in the restart file.
+      !!----------------------------------------------------------------------
+      INTEGER         , INTENT(in) ::   kt         ! ocean time-step
+      CHARACTER(len=*), INTENT(in) ::   cdrw       ! "READ"/"WRITE" flag
+      !
+      REAL(wp) ::   zkt, zndastp
+      !!----------------------------------------------------------------------
+      
+      IF( TRIM(cdrw) == 'READ' ) THEN
+
+         IF( iom_varid( numror, 'kt', ldstop = .FALSE. ) > 0 ) THEN
+            ! Get Calendar informations
+            CALL iom_get( numror, 'kt', zkt )   ! last time-step of previous run
+            IF(lwp) THEN
+               WRITE(numout,*) ' *** Info read in restart : '
+               WRITE(numout,*) '   previous time-step                               : ', NINT( zkt )
+               WRITE(numout,*) ' *** restart option'
+               SELECT CASE ( nrstdt )
+               CASE ( 0 )   ;   WRITE(numout,*) ' nrstdt = 0 : no control of nit000'
+               CASE ( 1 )   ;   WRITE(numout,*) ' nrstdt = 1 : no control the date at nit000 (use ndate0 read in the namelist)'
+               CASE ( 2 )   ;   WRITE(numout,*) ' nrstdt = 2 : calendar parameters read in restart'
+               END SELECT
+               WRITE(numout,*)
+            ENDIF
+            ! Control of date 
+            IF( nit000 - NINT( zkt ) /= 1 .AND. nrstdt /= 0 )                                         & 
+                 &   CALL ctl_stop( ' ===>>>> : problem with nit000 for the restart',                 & 
+                 &                  ' verify the restart file or rerun with nrstdt = 0 (namelist)' )
+            ! define ndastp and adatrj
+            IF ( nrstdt == 2 ) THEN 
+               ! read the parameters correspondting to nit000 - 1 (last time step of previous run)
+               CALL iom_get( numror, 'ndastp', zndastp )
+               ndastp = NINT( zndastp )
+               CALL iom_get( numror, 'adatrj', adatrj  )
+            ELSE 
+               ! parameters correspondting to nit000 - 1 (as we start the step loop with a call to day)
+               ndastp = ndate0 - 1     ! ndate0 read in the namelist in dom_nam, we assume that we start run at 00:00
+               adatrj = ( REAL( nit000-1, wp ) * rdttra(1) ) / rday 
+               ! note this is wrong if time step has changed during run 
+            ENDIF
+         ELSE
+            ! parameters correspondting to nit000 - 1 (as we start the step loop with a call to day)
+            ndastp = ndate0 - 1        ! ndate0 read in the namelist in dom_nam, we assume that we start run at 00:00
+            adatrj = ( REAL( nit000-1, wp ) * rdttra(1) ) / rday 
+         ENDIF
+         !
+         IF(lwp) THEN
+            WRITE(numout,*) ' *** Info used values : '
+            WRITE(numout,*) '   date ndastp                                      : ', ndastp
+            WRITE(numout,*) '   number of elapsed days since the begining of run : ', adatrj
+            WRITE(numout,*)
+         ENDIF
+         !
+      ELSEIF( TRIM(cdrw) == 'WRITE' ) THEN
+         !
+         IF( kt == nitrst ) THEN
+            IF(lwp) WRITE(numout,*)
+            IF(lwp) WRITE(numout,*) 'rst_write : write oce restart file  kt =', kt
+            IF(lwp) WRITE(numout,*) '~~~~~~~'         
+         ENDIF
+         ! calendar control
+         CALL iom_rstput( kt, nitrst, numrow, 'kt'     , REAL( kt    , wp) )   ! time-step 
+         CALL iom_rstput( kt, nitrst, numrow, 'ndastp' , REAL( ndastp, wp) )   ! date
+         CALL iom_rstput( kt, nitrst, numrow, 'adatrj' , adatrj            )   ! number of elapsed days since
+         !                                                                     ! the begining of the run [s]
+      ENDIF
+      !
+   END SUBROUTINE day_rst
+
+   !!======================================================================
+END MODULE daymod
Index: /trunk/NEMO/OPA_SRC/DOM/domngb.F90
===================================================================
--- /trunk/NEMO/OPA_SRC/DOM/domngb.F90	(revision 1725)
+++ /trunk/NEMO/OPA_SRC/DOM/domngb.F90	(revision 1725)
@@ -0,0 +1,76 @@
+MODULE domngb
+   !!======================================================================
+   !!                       ***  MODULE  domngb  ***
+   !! Grid search:  find the closest grid point from a given on/lat position
+   !!======================================================================
+   !! History : 3.2  !  2009-11  (S. Masson)  Original code
+   !!----------------------------------------------------------------------
+
+   !!----------------------------------------------------------------------
+   !!   dom_ngb       : find the closest grid point from a given on/lat position
+   !!----------------------------------------------------------------------
+   USE dom_oce         ! ocean space and time domain
+   USE lib_mpp         ! for mppsum
+
+   IMPLICIT NONE
+   PRIVATE
+
+   PUBLIC   dom_ngb    ! routine called in iom.F90 module
+
+   !!----------------------------------------------------------------------
+   !! NEMO/OPA 3.2 , LOCEAN-IPSL (2008) 
+   !! $Id$ 
+   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
+
+CONTAINS
+
+   SUBROUTINE dom_ngb( plon, plat, kii, kjj, cdgrid )
+      !!----------------------------------------------------------------------
+      !!                    ***  ROUTINE dom_ngb  ***
+      !!
+      !! ** Purpose :   find the closest grid point from a given on/lat position
+      !!
+      !! ** Method  :   look for minimum distance in cylindrical projection 
+      !!                -> not good if located at too high latitude...
+      !!
+      !!----------------------------------------------------------------------
+      REAL(wp)        , INTENT(in   ) ::   plon, plat   ! longitude,latitude of the point
+      INTEGER         , INTENT(  out) ::   kii, kjj     ! i-,j-index of the closes grid point
+      CHARACTER(len=1), INTENT(in   ) ::   cdgrid       ! grid name 'T', 'U', 'V', 'W'
+      !!
+      INTEGER , DIMENSION(2)        ::   iloc
+      REAL(wp), DIMENSION(jpi,jpj)  ::   zglam, zgphi, zmask, zdist
+      REAL(wp)                      ::   zlon
+      REAL(wp)                      ::   zmini
+      !!--------------------------------------------------------------------
+      
+      zmask(:,:) = 0.
+      SELECT CASE( cdgrid )
+      CASE( 'U' )  ; zglam(:,:) = glamu(:,:) ; zgphi(:,:) = gphiu(:,:) ; zmask(nldi:nlei,nldj:nlej) = umask(nldi:nlei,nldj:nlej,1)
+      CASE( 'V' )  ; zglam(:,:) = glamv(:,:) ; zgphi(:,:) = gphiv(:,:) ; zmask(nldi:nlei,nldj:nlej) = vmask(nldi:nlei,nldj:nlej,1)
+      CASE( 'F' )  ; zglam(:,:) = glamf(:,:) ; zgphi(:,:) = gphif(:,:) ; zmask(nldi:nlei,nldj:nlej) = fmask(nldi:nlei,nldj:nlej,1)
+      CASE DEFAULT ; zglam(:,:) = glamt(:,:) ; zgphi(:,:) = gphit(:,:) ; zmask(nldi:nlei,nldj:nlej) = tmask(nldi:nlei,nldj:nlej,1)
+      END SELECT
+
+      zlon       = MOD( plon       + 720., 360. )                                     ! plon between    0 and 360
+      zglam(:,:) = MOD( zglam(:,:) + 720., 360. )                                     ! glam between    0 and 360
+      IF( zlon > 270. )   zlon = zlon - 360.                                          ! zlon between  -90 and 270
+      IF( zlon <  90. )   WHERE( zglam(:,:) > 180. ) zglam(:,:) = zglam(:,:) - 360.   ! glam between -180 and 180
+
+      zglam(:,:) = zglam(:,:) - zlon
+      zgphi(:,:) = zgphi(:,:) - plat
+      zdist(:,:) = zglam(:,:) * zglam(:,:) + zgphi(:,:) * zgphi(:,:)
+      
+      IF( lk_mpp ) THEN  
+         CALL mpp_minloc( zdist(:,:), zmask, zmini, kii, kjj)
+      ELSE
+         iloc(:) = MINLOC( zdist(:,:), mask = zmask(:,:) == 1.e0 )
+         kii = iloc(1) + nimpp - 1
+         kjj = iloc(2) + njmpp - 1
+      ENDIF
+
+   END SUBROUTINE dom_ngb
+
+   !!======================================================================
+END MODULE domngb
Index: /trunk/NEMO/OPA_SRC/IOM/iom.F90
===================================================================
--- /trunk/NEMO/OPA_SRC/IOM/iom.F90	(revision 1724)
+++ /trunk/NEMO/OPA_SRC/IOM/iom.F90	(revision 1725)
@@ -27,5 +27,10 @@
 
 #if defined key_iomput
+   USE sbc_oce, ONLY :   nn_fsbc         ! ocean space and time domain
+   USE domngb          ! ocean space and time domain
+   USE phycst          ! physical constants
+   USE dianam          ! build name of file
    USE mod_event_client
+   USE mod_attribut
 # endif
 
@@ -34,5 +39,5 @@
    
 #if defined key_iomput
-   LOGICAL, PUBLIC, PARAMETER ::   lk_iomput = .TRUE.       !: iom_put flag
+   LOGICAL, PUBLIC, PARAMETER ::   lk_iomput = .TRUE.        !: iom_put flag
 #else
    LOGICAL, PUBLIC, PARAMETER ::   lk_iomput = .FALSE.       !: iom_put flag
@@ -70,5 +75,5 @@
 CONTAINS
 
-   SUBROUTINE iom_init( pjulian )
+   SUBROUTINE iom_init
       !!----------------------------------------------------------------------
       !!                     ***  ROUTINE   ***
@@ -77,5 +82,4 @@
       !!
       !!----------------------------------------------------------------------
-      REAL(wp), INTENT(in) ::  pjulian   !: julian day at nit000 = 0
 #if defined key_iomput
       !!----------------------------------------------------------------------
@@ -84,5 +88,10 @@
 
       ! calendar parameters
-      CALL event__set_time_parameters( nit000 - 1, pjulian, rdt )
+      SELECT CASE ( nleapy )        ! Choose calendar for IOIPSL
+      CASE ( 1)   ;   CALL event__set_calendar('gregorian')
+      CASE ( 0)   ;   CALL event__set_calendar('noleap'   )
+      CASE (30)   ;   CALL event__set_calendar('360d'     )
+      END SELECT
+      CALL event__set_time_parameters( nit000 - 1, fjulday - adatrj, rdt )
 
       ! horizontal grid definition
@@ -97,4 +106,7 @@
       CALL event__set_vert_axis( "depthv", gdept_0 )
       CALL event__set_vert_axis( "depthw", gdepw_0 )
+      
+      ! automatic definitions of some of the xml attributs
+      CALL set_xmlatt
 
       ! end file definition
@@ -925,5 +937,5 @@
       !!                     ***  ROUTINE   ***
       !!
-      !! ** Purpose :   
+      !! ** Purpose :   define horizontal grids
       !!
       !!----------------------------------------------------------------------
@@ -939,4 +951,165 @@
    END SUBROUTINE set_grid
 
+
+   SUBROUTINE set_xmlatt
+      !!----------------------------------------------------------------------
+      !!                     ***  ROUTINE   ***
+      !!
+      !! ** Purpose :   automatic definitions of some of the xml attributs...
+      !!
+      !!----------------------------------------------------------------------
+      CHARACTER(len=6),DIMENSION( 5) ::   clsuff                   ! suffix name
+      CHARACTER(len=1),DIMENSION( 3) ::   clgrd                    ! suffix name
+      CHARACTER(len=50)              ::   clname                   ! file name
+      CHARACTER(len=1)               ::   cl1                      ! 1 character
+      CHARACTER(len=2)               ::   cl2                      ! 1 character
+      INTEGER                        ::   idt                      ! time-step in seconds
+      INTEGER                        ::   iddss, ihhss, iyyss      ! number of seconds in 1 day, 1 hour and 1 year
+      INTEGER                        ::   ji, jj, jg, jh, jd, jy   ! loop counters
+      INTEGER                        ::   ix, iy                   ! i-,j- index
+      REAL(wp)        ,DIMENSION(11) ::   zlontao                  ! longitudes of tao    moorings
+      REAL(wp)        ,DIMENSION( 7) ::   zlattao                  ! latitudes  of tao    moorings
+      REAL(wp)        ,DIMENSION( 4) ::   zlonrama                 ! longitudes of rama   moorings
+      REAL(wp)        ,DIMENSION(11) ::   zlatrama                 ! latitudes  of rama   moorings
+      REAL(wp)        ,DIMENSION( 3) ::   zlonpira                 ! longitudes of pirata moorings
+      REAL(wp)        ,DIMENSION( 9) ::   zlatpira                 ! latitudes  of pirata moorings
+      !!----------------------------------------------------------------------
+      ! 
+      idt   = NINT( rdttra(1)     )
+      iddss = NINT( rday          )                                         ! number of seconds in 1 day
+      ihhss = NINT( rmmss * rhhmm )                                         ! number of seconds in 1 hour
+      iyyss = nyear_len(1) * iddss                                          ! number of seconds in 1 year
+
+      ! frequency of the call of iom_put (attribut: freq_op)
+      CALL event__set_attribut( 'field_definition', attr( field__freq_op, idt           ) )    ! model time-step
+      CALL event__set_attribut( 'SBC'             , attr( field__freq_op, idt * nn_fsbc ) )    ! SBC time-step
+      ! average frequency: directly specified in the xml file except for yearly mean (attribut: output_freq)
+      ! note that average frequency of -1 correspond to exact monthly mean (-> according to the calendar) 
+      DO jy = 1, 10                                                                         ! 1, 2, 5, 10 years  
+         IF( MOD(10,jy) == 0 ) THEN 
+            WRITE(cl2,'(i1)') jy 
+            CALL event__set_attribut( TRIM(ADJUSTL(cl2))//'y', attr( file__output_freq, jy * iyyss ) )
+         ENDIF
+      END DO
+      
+      ! output file names (attribut: name)
+      clsuff(:) = (/ 'grid_T', 'grid_U', 'grid_V', 'grid_W', 'icemod' /)      
+      DO jg = 1, SIZE(clsuff)                                                                  ! grid type
+         DO jh = 1, 12                                                                         ! 1, 2, 3, 4, 6, 12 hours
+            IF( MOD(12,jh) == 0 ) THEN 
+               WRITE(cl2,'(i2)') jh 
+               CALL dia_nam( clname, jh * ihhss, clsuff(jg), ldfsec = .TRUE. )
+               CALL event__set_attribut( TRIM(ADJUSTL(cl2))//'h_'//clsuff(jg), attr( file__name, TRIM(clname) ) )
+            ENDIF
+         END DO
+         DO jd = 1, 5, 2                                                                       ! 1, 3, 5 days
+            WRITE(cl1,'(i1)') jd 
+            CALL dia_nam( clname, jd * iddss, clsuff(jg), ldfsec = .TRUE. )
+            CALL event__set_attribut( cl1//'d_'//clsuff(jg), attr( file__name, TRIM(clname) ) )
+         END DO
+         CALL dia_nam( clname, -1, clsuff(jg) )                                                ! 1 month
+         CALL event__set_attribut( '1m_'//clsuff(jg), attr( file__name, TRIM(clname) ) )
+         DO jy = 1, 10                                                                         ! 1, 2, 5, 10 years  
+            IF( MOD(10,jy) == 0 ) THEN 
+               WRITE(cl2,'(i2)') jy 
+               CALL dia_nam( clname, jy * iyyss, clsuff(jg), ldfsec = .TRUE. )
+               CALL event__set_attribut( TRIM(ADJUSTL(cl2))//'y_'//clsuff(jg), attr( file__name, TRIM(clname) ) )
+            ENDIF
+         END DO
+      END DO
+
+      ! Zooms...
+      clgrd = (/ 'T', 'U', 'W' /) 
+      DO jg = 1, SIZE(clgrd)                                                                   ! grid type
+         cl1 = clgrd(jg)
+         ! Equatorial section (attributs: jbegin, ni, name_suffix)
+         CALL dom_ngb( 0., 0., ix, iy, cl1 )
+         CALL event__set_attribut( 'Eq'//cl1, attr( zoom__jbegin     , iy     ) )
+         CALL event__set_attribut( 'Eq'//cl1, attr( zoom__ni         , jpiglo ) )
+         CALL event__set_attribut( 'Eq'//cl1, attr( file__name_suffix, '_Eq'  ) )
+      END DO
+      ! TAO moorings (attributs: ibegin, jbegin, name_suffix)
+      zlontao = (/ 137.0, 147.0, 156.0, 165.0, -180.0, -170.0, -155.0, -140.0, -125.0, -110.0, -95.0 /)
+      zlattao = (/  -8.0,  -5.0,  -2.0,   0.0,    2.0,    5.0,    8.0 /)
+      CALL set_mooring( zlontao, zlattao )
+      ! RAMA moorings (attributs: ibegin, jbegin, name_suffix)
+      zlonrama = (/  55.0,  67.0, 80.5, 90.0 /)
+      zlatrama = (/ -16.0, -12.0, -8.0, -4.0, -1.5, 0.0, 1.5, 4.0, 8.0, 12.0, 15.0 /)
+      CALL set_mooring( zlonrama, zlatrama )
+      ! PIRATA moorings (attributs: ibegin, jbegin, name_suffix)
+      zlonpira = (/ -38.0, -23.0, -10.0 /)
+      zlatpira = (/ -19.0, -14.0,  -8.0, 0.0, 4.0, 8.0, 12.0, 15.0, 20.0 /)
+      CALL set_mooring( zlonpira, zlatpira )
+      
+   END SUBROUTINE set_xmlatt
+
+
+   SUBROUTINE set_mooring( plon, plat)
+      !!----------------------------------------------------------------------
+      !!                     ***  ROUTINE   ***
+      !!
+      !! ** Purpose :   automatic definitions of moorings xml attributs...
+      !!
+      !!----------------------------------------------------------------------
+      REAL(wp), DIMENSION(:), INTENT(in) ::  plon, plat           ! longitudes/latitudes oft the mooring
+      !
+!!$      CHARACTER(len=1),DIMENSION(4) ::   clgrd = (/ 'T', 'U', 'V', 'W' /)   ! suffix name
+      CHARACTER(len=1),DIMENSION(1) ::   clgrd = (/ 'T' /)        ! suffix name
+      CHARACTER(len=50)             ::   clname                   ! file name
+      CHARACTER(len=1)              ::   cl1                      ! 1 character
+      CHARACTER(len=6)              ::   clon,clat                ! name of longitude, latitude
+      INTEGER                       ::   ji, jj, jg               ! loop counters
+      INTEGER                       ::   ix, iy                   ! i-,j- index
+      REAL(wp)                      ::   zlon, zlat
+      !!----------------------------------------------------------------------
+      DO jg = 1, SIZE(clgrd)
+         cl1 = clgrd(jg)
+         DO ji = 1, SIZE(plon)
+            DO jj = 1, SIZE(plat)
+               zlon = plon(ji)
+               zlat = plat(jj)
+               ! modifications for RAMA moorings
+               IF( zlon ==  67. .AND. zlat ==  15. )   zlon =  65.
+               IF( zlon ==  90. .AND. zlat <=  -4. )   zlon =  95.
+               IF( zlon ==  95. .AND. zlat ==  -4. )   zlat =  -5.
+               ! modifications for PIRATA moorings
+               IF( zlon == -38. .AND. zlat == -19. )   zlon = -34.
+               IF( zlon == -38. .AND. zlat == -14. )   zlon = -32.
+               IF( zlon == -38. .AND. zlat ==  -8. )   zlon = -30.
+               IF( zlon == -38. .AND. zlat ==   0. )   zlon = -35.
+               IF( zlon == -23. .AND. zlat ==  20. )   zlat =  21.
+               IF( zlon == -10. .AND. zlat == -14. )   zlat = -10.
+               IF( zlon == -10. .AND. zlat ==  -8. )   zlat =  -6.
+               IF( zlon == -10. .AND. zlat ==   4. ) THEN   ;   zlon = 0.   ;   zlat = 0.   ;   ENDIF
+               CALL dom_ngb( zlon, zlat, ix, iy, cl1 )
+               IF( zlon >= 0. ) THEN  
+                  IF( zlon == REAL(NINT(zlon), wp) ) THEN   ;   WRITE(clon, '(i3,  a)') NINT( zlon), 'e'
+                  ELSE                                      ;   WRITE(clon, '(f5.1,a)')       zlon , 'e'
+                  ENDIF
+               ELSE             
+                  IF( zlon == REAL(NINT(zlon), wp) ) THEN   ;   WRITE(clon, '(i3,  a)') NINT(-zlon), 'w'
+                  ELSE                                      ;   WRITE(clon, '(f5.1,a)')      -zlon , 'w'
+                  ENDIF
+               ENDIF
+               IF( zlat >= 0. ) THEN  
+                  IF( zlat == REAL(NINT(zlat), wp) ) THEN   ;   WRITE(clat, '(i2,  a)') NINT( zlat), 'n'
+                  ELSE                                      ;   WRITE(clat, '(f4.1,a)')       zlat , 'n'
+                  ENDIF
+               ELSE             
+                  IF( zlat == REAL(NINT(zlat), wp) ) THEN   ;   WRITE(clat, '(i2,  a)') NINT(-zlat), 's'
+                  ELSE                                      ;   WRITE(clat, '(f4.1,a)')      -zlat , 's'
+                  ENDIF
+               ENDIF
+               clname = TRIM(ADJUSTL(clat))//TRIM(ADJUSTL(clon))
+               IF( lwp ) WRITE(numout,*) 'sebseb : ', '_'//TRIM(clname)//'_'
+               CALL event__set_attribut( TRIM(clname)//cl1, attr( zoom__ibegin     , ix                ) )
+               CALL event__set_attribut( TRIM(clname)//cl1, attr( zoom__jbegin     , iy                ) )
+               CALL event__set_attribut( TRIM(clname)//cl1, attr( file__name_suffix, '_'//TRIM(clname) ) )      
+            END DO
+         END DO
+      END DO
+      
+   END SUBROUTINE set_mooring
+
 #else
 
Index: /trunk/NEMO/OPA_SRC/SBC/sbcmod.F90
===================================================================
--- /trunk/NEMO/OPA_SRC/SBC/sbcmod.F90	(revision 1724)
+++ /trunk/NEMO/OPA_SRC/SBC/sbcmod.F90	(revision 1725)
@@ -42,4 +42,5 @@
 
    PUBLIC   sbc        ! routine called by step.F90
+   PUBLIC   sbc_init   ! routine called by opa.F90
    
    INTEGER ::   nsbc   ! type of surface boundary condition (deduced from namsbc informations)
@@ -187,6 +188,4 @@
       !!---------------------------------------------------------------------
 
-      IF( kt == nit000 )   CALL sbc_init         ! Read namsbc namelist : surface module
-      !
       CALL iom_setkt( kt + nn_fsbc - 1 )         !  in sbc, iom_put is called every nn_fsbc time step
       !
Index: unk/NEMO/OPA_SRC/daymod.F90
===================================================================
--- /trunk/NEMO/OPA_SRC/daymod.F90	(revision 1724)
+++ 	(revision )
@@ -1,322 +1,0 @@
-MODULE daymod
-   !!======================================================================
-   !!                       ***  MODULE  daymod  ***
-   !! Ocean        :  calendar 
-   !!=====================================================================
-   !! History :  OPA  ! 1994-09  (M. Pontaud M. Imbard)  Original code
-   !!                 ! 1997-03  (O. Marti)
-   !!                 ! 1997-05  (G. Madec) 
-   !!                 ! 1997-08  (M. Imbard)
-   !!   NEMO     1.0  ! 2003-09  (G. Madec)  F90 + nyear, nmonth, nday
-   !!                 ! 2004-01  (A.M. Treguier) new calculation based on adatrj
-   !!                 ! 2006-08  (G. Madec)  surface module major update
-   !!----------------------------------------------------------------------      
-
-   !!----------------------------------------------------------------------
-   !!   day        : calendar
-   !!  
-   !!           -------------------------------
-   !!           ----------- WARNING -----------
-   !!
-   !!   we suppose that the time step is deviding the number of second of in a day
-   !!             ---> MOD( rday, rdttra(1) ) == 0
-   !!
-   !!           ----------- WARNING -----------
-   !!           -------------------------------
-   !!  
-   !!----------------------------------------------------------------------
-   USE dom_oce         ! ocean space and time domain
-   USE phycst          ! physical constants
-   USE in_out_manager  ! I/O manager
-   USE iom             ! 
-   USE ioipsl, ONLY :   ymds2ju   ! for calendar
-   USE prtctl          ! Print control
-   USE restart         ! 
-
-   IMPLICIT NONE
-   PRIVATE
-
-   PUBLIC   day        ! called by step.F90
-   PUBLIC   day_init   ! called by istate.F90
-
-   !!----------------------------------------------------------------------
-   !! NEMO/OPA 3.2 , LOCEAN-IPSL (2009) 
-   !! $Id$
-   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt)
-   !!----------------------------------------------------------------------
-
-CONTAINS
-
-   SUBROUTINE day_init
-      !!----------------------------------------------------------------------
-      !!                   ***  ROUTINE day_init  ***
-      !! 
-      !! ** Purpose :   Initialization of the calendar values to their values 1 time step before nit000 
-      !!                because day will be called at the beginning of step
-      !!
-      !! ** Action  : - nyear        : current year
-      !!              - nmonth       : current month of the year nyear
-      !!              - nday         : current day of the month nmonth
-      !!              - nday_year    : current day of the year nyear
-      !!              - rsec_year    : current time step counted in second since 00h jan 1st of the current year
-      !!              - rsec_month   : current time step counted in second since 00h 1st day of the current month
-      !!              - rsec_day     : current time step counted in second since 00h of the current day
-      !!              - sec1jan000   : second since Jan. 1st 00h of nit000 year and Jan. 1st 00h of the current year
-      !!              - nmonth_len, nyear_len, rmonth_half, rmonth_end through day_mth
-      !!----------------------------------------------------------------------
-
-      ! all calendar staff is based on the fact that MOD( rday, rdttra(1) ) == 0
-      IF( MOD( rday, rdttra(1) ) /= 0 )   CALL ctl_stop( 'the time step must devide the number of second of in a day' )
-
-      CALL day_rst( nit000, 'READ' ) 
-
-      ! set the calandar from ndastp (read in restart file and namelist)
-
-      nyear   =   ndastp / 10000
-      nmonth  = ( ndastp - (nyear * 10000) ) / 100
-      nday    =   ndastp - (nyear * 10000) - ( nmonth * 100 ) 
-
-      CALL ymds2ju( nyear, nmonth, nday, 0.0, fjulday )  ! we assume that we start run at 00:00
-      fjulday = fjulday + 1.                             ! move back to the day at nit000 (and not at nit000 - 1)
-
-      sec1jan000 = 0.e0
-      CALL day_mth
-      
-      IF ( nday == 0 ) THEN     !   for ex if ndastp = ndate0 - 1
-         nmonth = nmonth - 1  
-         nday = nmonth_len(nmonth)
-      ENDIF
-      IF ( nmonth == 0 ) THEN   ! go at the end of previous year
-         nmonth = 12
-         nyear = nyear - 1
-         sec1jan000 = sec1jan000 - rday * REAL( nyear_len(0), wp )
-         IF( nleapy == 1 )   CALL day_mth
-      ENDIF
-      
-      ! day since january 1st
-      nday_year = nday + SUM( nmonth_len(1:nmonth - 1) )
-      
-      ! number of seconds since the beginning of current year/month at the middle of the time-step
-      rsec_year  = REAL( nday_year, wp ) * rday - 0.5 * rdttra(1)   ! 1 time step before the middle of the first time step
-      rsec_month = REAL( nday     , wp ) * rday - 0.5 * rdttra(1)   ! because day will be called at the beginning of step
-      rsec_day   =                         rday - 0.5 * rdttra(1)
-
-      ! control print
-      IF(lwp) WRITE(numout,*)' ==============>> 1/2 time step before the start of the run DATE Y/M/D = ',   &
-           &                   nyear, '/', nmonth, '/', nday, '  rsec_day:', rsec_day
-      
-   END SUBROUTINE day_init
-
-
-   SUBROUTINE day_mth
-      !!----------------------------------------------------------------------
-      !!                   ***  ROUTINE day_init  ***
-      !! 
-      !! ** Purpose :   calendar values related to the months
-      !!
-      !! ** Action  : - nmonth_len    : length in days of the months of the current year
-      !!              - nyear_len     : length in days of the previous/current year
-      !!              - rmonth_half   : second since the beginning of the year and the halft of the months
-      !!              - rmonth_end    : second since the beginning of the year and the end of the months
-      !!----------------------------------------------------------------------
-      INTEGER  ::   jm               ! dummy loop indice
-      !!----------------------------------------------------------------------
-
-      ! length of the month of the current year (from nleapy, read in namelist)
-      IF ( nleapy < 2 ) THEN 
-         nmonth_len(:) = (/ 31, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31 /)
-         nyear_len(:) = 365
-         IF ( nleapy == 1 ) THEN   ! we are using calandar with leap years
-            IF ( MOD(nyear-1, 4) == 0 .AND. ( MOD(nyear-1, 400) == 0 .OR. MOD(nyear-1, 100) /= 0 ) ) THEN
-               nyear_len(0) = 366
-            ENDIF
-            IF ( MOD(nyear, 4) == 0 .AND. ( MOD(nyear, 400) == 0 .OR. MOD(nyear, 100) /= 0 ) ) THEN
-               nmonth_len(2) = 29
-               nyear_len(1) = 366
-            ENDIF
-         ENDIF
-      ELSE
-         nmonth_len(:) = nleapy   ! all months with nleapy days per year
-         nyear_len(:) = 12 * nleapy
-      ENDIF
-
-      ! half month in second since the begining of the year:
-      ! time since Jan 1st   0     1     2    ...    11    12    13
-      !          ---------*--|--*--|--*--| ... |--*--|--*--|--*--|--------------------------------------
-      !                 <---> <---> <--->  ...  <---> <---> <--->        
-      ! month number      0     1     2    ...    11    12    13
-      !
-      ! rmonth_half(jm) = rday * REAL( 0.5 * nmonth_len(jm) + SUM(nmonth_len(1:jm-1)) )
-      rmonth_half(0) = - 0.5 * rday * REAL( nmonth_len(0), wp )
-      DO jm = 1, 13
-         rmonth_half(jm) = rmonth_half(jm-1) + 0.5 * rday * REAL( nmonth_len(jm-1) + nmonth_len(jm), wp )
-      END DO
-
-      rmonth_end(0) = 0.
-      DO jm = 1, 13
-         rmonth_end(jm) = rmonth_end(jm-1) + rday * REAL( nmonth_len(jm), wp )
-      END DO
-      !           
-   END SUBROUTINE 
-
-
-   SUBROUTINE day( kt )
-      !!----------------------------------------------------------------------
-      !!                      ***  ROUTINE day  ***
-      !! 
-      !! ** Purpose :   Compute the date with a day iteration IF necessary.
-      !!
-      !! ** Method  : - ???
-      !!
-      !! ** Action  : - nyear     : current year
-      !!              - nmonth    : current month of the year nyear
-      !!              - nday      : current day of the month nmonth
-      !!              - nday_year : current day of the year nyear
-      !!              - ndastp    : = nyear*10000 + nmonth*100 + nday
-      !!              - adatrj    : date in days since the beginning of the run
-      !!              - rsec_year : current time of the year (in second since 00h, jan 1st)
-      !!----------------------------------------------------------------------      
-      INTEGER, INTENT(in) ::   kt        ! ocean time-step indices
-      !
-      CHARACTER (len=25) ::   charout
-      !!----------------------------------------------------------------------
-
-      !                                                 ! New time-step
-      rsec_year  = rsec_year  + rdttra(1) 
-      rsec_month = rsec_month + rdttra(1)                 
-      rsec_day   = rsec_day   + rdttra(1)                 
-      adatrj  = adatrj  + rdttra(1) / rday
-      fjulday = fjulday + rdttra(1) / rday
-      
-      IF( rsec_day > rday ) THEN                        ! NEW day
-         !
-         nday      = nday + 1
-         nday_year = nday_year + 1
-         rsec_day  = 0.5 * rdttra(1)                 
-         !
-         IF( nday == nmonth_len(nmonth) + 1 ) THEN      ! NEW month
-            nday   = 1
-            nmonth = nmonth + 1
-            rsec_month = 0.5 * rdttra(1)
-            IF( nmonth == 13 ) THEN                     ! NEW year
-               nyear     = nyear + 1
-               nmonth    = 1
-               nday_year = 1
-               rsec_year = 0.5 * rdttra(1)
-               sec1jan000 = sec1jan000 + rday * REAL( nyear_len(1), wp )
-               IF( nleapy == 1 )   CALL day_mth
-            ENDIF
-         ENDIF
-         !
-         ndastp = nyear * 10000 + nmonth * 100 + nday   ! NEW date
-         !
-         IF(lwp) WRITE(numout,'(a,i8,a,i4.4,a,i2.2,a,i2.2,a,i3.3)') '======>> time-step =', kt,   &
-              &   '      New day, DATE Y/M/D = ', nyear, '/', nmonth, '/', nday, '      nday_year = ', nday_year
-         IF(lwp) WRITE(numout,'(a,F9.0,a,F9.0,a,F9.0)') '         rsec_year = ', rsec_year,   &
-              &   '   rsec_month = ', rsec_month, '   rsec_day = ', rsec_day
-      ENDIF
-      
-      IF(ln_ctl) THEN
-         WRITE(charout,FMT="('kt =', I4,'  d/m/y =',I2,I2,I4)") kt, nday, nmonth, nyear
-         CALL prt_ctl_info(charout)
-      ENDIF
-
-      IF( lrst_oce )   CALL day_rst( kt, 'WRITE' )
-      !
-   END SUBROUTINE day
-
-
-   SUBROUTINE day_rst( kt, cdrw )
-      !!---------------------------------------------------------------------
-      !!                   ***  ROUTINE ts_rst  ***
-      !! 
-      !!  ** Purpose : Read or write calendar in restart file:
-      !! 
-      !!  WRITE(READ) mode:
-      !!       kt        : number of time step since the begining of the experiment at the 
-      !!                   end of the current(previous) run
-      !!       adatrj(0) : number of elapsed days since the begining of the experiment at the 
-      !!                   end of the current(previous) run (REAL -> keep fractions of day)
-      !!       ndastp    : date at the end of the current(previous) run (coded as yyyymmdd integer)
-      !! 
-      !!   According to namelist parameter nrstdt,
-      !!       nrstdt = 0  no control on the date (nit000 is  arbitrary).
-      !!       nrstdt = 1  we verify that nit000 is equal to the last
-      !!                   time step of previous run + 1.
-      !!       In both those options, the  exact duration of the experiment
-      !!       since the beginning (cumulated duration of all previous restart runs)
-      !!       is not stored in the restart and is assumed to be (nit000-1)*rdt.
-      !!       This is valid is the time step has remained constant.
-      !!
-      !!       nrstdt = 2  the duration of the experiment in days (adatrj)
-      !!                    has been stored in the restart file.
-      !!----------------------------------------------------------------------
-      INTEGER         , INTENT(in) ::   kt         ! ocean time-step
-      CHARACTER(len=*), INTENT(in) ::   cdrw       ! "READ"/"WRITE" flag
-      !
-      REAL(wp) ::   zkt, zndastp
-      !!----------------------------------------------------------------------
-      
-      IF( TRIM(cdrw) == 'READ' ) THEN
-
-         IF( iom_varid( numror, 'kt', ldstop = .FALSE. ) > 0 ) THEN
-            ! Get Calendar informations
-            CALL iom_get( numror, 'kt', zkt )   ! last time-step of previous run
-            IF(lwp) THEN
-               WRITE(numout,*) ' *** Info read in restart : '
-               WRITE(numout,*) '   previous time-step                               : ', NINT( zkt )
-               WRITE(numout,*) ' *** restart option'
-               SELECT CASE ( nrstdt )
-               CASE ( 0 )   ;   WRITE(numout,*) ' nrstdt = 0 : no control of nit000'
-               CASE ( 1 )   ;   WRITE(numout,*) ' nrstdt = 1 : no control the date at nit000 (use ndate0 read in the namelist)'
-               CASE ( 2 )   ;   WRITE(numout,*) ' nrstdt = 2 : calendar parameters read in restart'
-               END SELECT
-               WRITE(numout,*)
-            ENDIF
-            ! Control of date 
-            IF( nit000 - NINT( zkt ) /= 1 .AND. nrstdt /= 0 )                                         & 
-                 &   CALL ctl_stop( ' ===>>>> : problem with nit000 for the restart',                 & 
-                 &                  ' verify the restart file or rerun with nrstdt = 0 (namelist)' )
-            ! define ndastp and adatrj
-            IF ( nrstdt == 2 ) THEN 
-               ! read the parameters correspondting to nit000 - 1 (last time step of previous run)
-               CALL iom_get( numror, 'ndastp', zndastp )
-               ndastp = NINT( zndastp )
-               CALL iom_get( numror, 'adatrj', adatrj  )
-            ELSE 
-               ! parameters correspondting to nit000 - 1 (as we start the step loop with a call to day)
-               ndastp = ndate0 - 1     ! ndate0 read in the namelist in dom_nam, we assume that we start run at 00:00
-               adatrj = ( REAL( nit000-1, wp ) * rdttra(1) ) / rday 
-               ! note this is wrong if time step has changed during run 
-            ENDIF
-         ELSE
-            ! parameters correspondting to nit000 - 1 (as we start the step loop with a call to day)
-            ndastp = ndate0 - 1        ! ndate0 read in the namelist in dom_nam, we assume that we start run at 00:00
-            adatrj = ( REAL( nit000-1, wp ) * rdttra(1) ) / rday 
-         ENDIF
-         !
-         IF(lwp) THEN
-            WRITE(numout,*) ' *** Info used values : '
-            WRITE(numout,*) '   date ndastp                                      : ', ndastp
-            WRITE(numout,*) '   number of elapsed days since the begining of run : ', adatrj
-            WRITE(numout,*)
-         ENDIF
-         !
-      ELSEIF( TRIM(cdrw) == 'WRITE' ) THEN
-         !
-         IF( kt == nitrst ) THEN
-            IF(lwp) WRITE(numout,*)
-            IF(lwp) WRITE(numout,*) 'rst_write : write oce restart file  kt =', kt
-            IF(lwp) WRITE(numout,*) '~~~~~~~'         
-         ENDIF
-         ! calendar control
-         CALL iom_rstput( kt, nitrst, numrow, 'kt'     , REAL( kt    , wp) )   ! time-step 
-         CALL iom_rstput( kt, nitrst, numrow, 'ndastp' , REAL( ndastp, wp) )   ! date
-         CALL iom_rstput( kt, nitrst, numrow, 'adatrj' , adatrj            )   ! number of elapsed days since
-         !                                                                     ! the begining of the run [s]
-      ENDIF
-      !
-   END SUBROUTINE day_rst
-
-   !!======================================================================
-END MODULE daymod
Index: /trunk/NEMO/OPA_SRC/opa.F90
===================================================================
--- /trunk/NEMO/OPA_SRC/opa.F90	(revision 1724)
+++ /trunk/NEMO/OPA_SRC/opa.F90	(revision 1725)
@@ -45,4 +45,5 @@
    USE bdyini          ! unstructured open boundary cond. initialization (bdy_init routine)
    USE istate          ! initial state setting          (istate_init routine)
+   USE sbcmod          ! surface boundary condition 
    USE eosbn2          ! equation of state                 (eos_init routine)
    USE dynhpg          ! hydrostatic pressure gradient
@@ -257,4 +258,5 @@
 
       !                                     ! Ocean physics
+      CALL sbc_init                             ! Read namsbc namelist : surface module (needed for iom_init)
       CALL ldf_tra_init                         ! Lateral ocean tracer physics
       CALL ldf_dyn_init                         ! Lateral ocean momentum physics
@@ -266,5 +268,5 @@
 
       !                                     ! diagnostics
-      CALL iom_init( fjulday - adatrj )         ! iom_put initialization
+      CALL iom_init                             ! iom_put initialization
       CALL dia_ptr_init                         ! Poleward TRansports initialization
       CALL trd_mod_init                         ! Mixed-layer/Vorticity/Integral constraints trends
Index: /trunk/NEMO/OPA_SRC/step.F90
===================================================================
--- /trunk/NEMO/OPA_SRC/step.F90	(revision 1724)
+++ /trunk/NEMO/OPA_SRC/step.F90	(revision 1725)
@@ -168,11 +168,11 @@
 !      IF (lwp) Write(*,*) 'Grid Number',Agrif_Fixed(),' time step ',kstp
 #endif   
-      indic = 1                    ! reset to no error condition
-
-      CALL day( kstp )             ! Calendar
-
-      CALL iom_setkt( kstp )       ! say to iom that we are at time step kstp
+      indic = 1                                       ! reset to no error condition
+
+      IF( kstp /= nit000 )   CALL day( kstp )         ! Calendar (day was already called at nit000 in day_init)
+
+      CALL iom_setkt( kstp )                          ! say to iom that we are at time step kstp
       
-      CALL rst_opn( kstp )         ! Open the restart file
+      CALL rst_opn( kstp )                            ! Open the restart file
 
       !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
