Index: branches/2013/dev_CMCC_2013/NEMOGCM/ARCH/arch-X64_CURIE.fcm
===================================================================
--- branches/2013/dev_CMCC_2013/NEMOGCM/ARCH/arch-X64_CURIE.fcm	(revision 4174)
+++ branches/2013/dev_CMCC_2013/NEMOGCM/ARCH/arch-X64_CURIE.fcm	(revision 4175)
@@ -29,6 +29,6 @@
 #  - fcm variables are starting with a % (and not a $)
 #
-%NCDF_HOME           /usr/local/netcdf-4.2_hdf5
-%HDF5_HOME           /usr/local/hdf5-1.8.8
+%NCDF_HOME           /usr/local/netcdf-4.2_hdf5_parallel
+%HDF5_HOME           /usr/local/hdf5-1.8.9_parallel
 %XIOS_HOME           $WORKDIR/now/models/xios
 %OASIS_HOME          $WORKDIR/now/models/oa3mct
Index: branches/2013/dev_CMCC_2013/NEMOGCM/ARCH/arch-X64_YELLOWSTONE.fcm
===================================================================
--- branches/2013/dev_CMCC_2013/NEMOGCM/ARCH/arch-X64_YELLOWSTONE.fcm	(revision 4175)
+++ branches/2013/dev_CMCC_2013/NEMOGCM/ARCH/arch-X64_YELLOWSTONE.fcm	(revision 4175)
@@ -0,0 +1,53 @@
+# Yellowstone IBM at NCAR, http://www2.cisl.ucar.edu/resources/yellowstone
+#
+# NCDF_HOME   root directory containing lib and include subdirectories for netcdf4
+# HDF5_HOME   root directory containing lib and include subdirectories for HDF5
+# XIOS_HOME   root directory containing lib for XIOS
+# OASIS_HOME  root directory containing lib for OASIS
+#
+# NCDF_INC    netcdf4 include file
+# NCDF_LIB    netcdf4 library
+# XIOS_INC    xios include file    (taken into accound only if key_iomput is activated)
+# XIOS_LIB    xios library         (taken into accound only if key_iomput is activated)
+# OASIS_INC   oasis include file   (taken into accound only if key_oasis3 is activated)
+# OASIS_LIB   oasis library        (taken into accound only if key_oasis3 is activated)
+#
+# FC          Fortran compiler command
+# FCFLAGS     Fortran compiler flags
+# FFLAGS      Fortran 77 compiler flags
+# LD          linker
+# LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries
+# FPPFLAGS    pre-processing flags
+# AR          assembler
+# ARFLAGS     assembler flags
+# MK          make
+# USER_INC    complete list of include files
+# USER_LIB    complete list of libraries to pass to the linker
+#
+# Note that:
+#  - unix variables "$..." are accpeted and will be evaluated before calling fcm.
+#  - fcm variables are starting with a % (and not a $)
+#
+%NCDF_HOME           /glade/apps/opt/netcdf-mpi/4.2/intel/12.1.4
+%HDF5_HOME           /glade/apps/opt/hdf5-mpi/1.8.9/intel/12.1.4
+%XIOS_HOME           /glade/p/work/$( whoami )/now/models/xios
+%OASIS_HOME          /glade/p/work/$( whoami )/now/models/oa3mct
+
+%NCDF_INC            -I%NCDF_HOME/include 
+%NCDF_LIB            -L%NCDF_HOME/lib -lnetcdff -lnetcdf -L%HDF5_HOME/lib -lhdf5_hl -lhdf5 -lhdf5
+%XIOS_INC            -I%XIOS_HOME/inc 
+%XIOS_LIB            -L%XIOS_HOME/lib -lxios
+%OASIS_INC           -I%OASIS_HOME/build/lib/mct -I%OASIS_HOME/build/lib/psmile.MPI1
+%OASIS_LIB           -L%OASIS_HOME/lib -lpsmile.MPI1 -lmct -lmpeu -lscrip
+
+%FC                  mpif90 -c -cpp
+%FCFLAGS            -i4 -r8 -O3 -fp-model precise -xAVX
+%FFLAGS              %FCFLAGS
+%LD                  mpif90
+%LDFLAGS             -lstdc++
+%FPPFLAGS            -P -C -traditional
+%AR                  ar
+%ARFLAGS             rs
+%MK                  gmake
+%USER_INC            %XIOS_INC %OASIS_INC %NCDF_INC
+%USER_LIB            %XIOS_LIB %OASIS_LIB %NCDF_LIB
Index: branches/2013/dev_CMCC_2013/NEMOGCM/CONFIG/AMM12/EXP00/iodef.xml
===================================================================
--- branches/2013/dev_CMCC_2013/NEMOGCM/CONFIG/AMM12/EXP00/iodef.xml	(revision 4174)
+++ branches/2013/dev_CMCC_2013/NEMOGCM/CONFIG/AMM12/EXP00/iodef.xml	(revision 4175)
@@ -62,4 +62,5 @@
       <axis id="depthw" long_name="Vertical W levels" unit="m" positive="down" />
       <axis id="nfloat" long_name="Float number"      unit="-"  />
+      <axis id="icbcla" long_name="Iceberg class"     unit="-"  />
    </axis_definition> 
     
Index: branches/2013/dev_CMCC_2013/NEMOGCM/CONFIG/GYRE/EXP00/iodef.xml
===================================================================
--- branches/2013/dev_CMCC_2013/NEMOGCM/CONFIG/GYRE/EXP00/iodef.xml	(revision 4174)
+++ branches/2013/dev_CMCC_2013/NEMOGCM/CONFIG/GYRE/EXP00/iodef.xml	(revision 4175)
@@ -92,4 +92,5 @@
       <axis id="depthw" long_name="Vertical W levels" unit="m" positive="down" />
       <axis id="nfloat" long_name="Float number"      unit="-"  />
+      <axis id="icbcla" long_name="Iceberg class"     unit="-"  />
    </axis_definition> 
     
Index: branches/2013/dev_CMCC_2013/NEMOGCM/CONFIG/GYRE_BFM/EXP00/iodef.xml
===================================================================
--- branches/2013/dev_CMCC_2013/NEMOGCM/CONFIG/GYRE_BFM/EXP00/iodef.xml	(revision 4174)
+++ branches/2013/dev_CMCC_2013/NEMOGCM/CONFIG/GYRE_BFM/EXP00/iodef.xml	(revision 4175)
@@ -62,4 +62,5 @@
       <axis id="depthw" long_name="Vertical W levels" unit="m" positive="down" />
       <axis id="nfloat" long_name="Float number"      unit="-"  />
+      <axis id="icbcla" long_name="Iceberg class"     unit="-"  />
    </axis_definition> 
     
Index: branches/2013/dev_CMCC_2013/NEMOGCM/CONFIG/GYRE_PISCES/EXP00/iodef.xml
===================================================================
--- branches/2013/dev_CMCC_2013/NEMOGCM/CONFIG/GYRE_PISCES/EXP00/iodef.xml	(revision 4174)
+++ branches/2013/dev_CMCC_2013/NEMOGCM/CONFIG/GYRE_PISCES/EXP00/iodef.xml	(revision 4175)
@@ -128,4 +128,5 @@
       <axis id="depthw" long_name="Vertical W levels" unit="m" positive="down" />
       <axis id="nfloat" long_name="Float number"      unit="-"  />
+      <axis id="icbcla" long_name="Iceberg class"     unit="-"  />
    </axis_definition> 
     
Index: branches/2013/dev_CMCC_2013/NEMOGCM/CONFIG/ORCA2_LIM/EXP00/iodef_ar5.xml
===================================================================
--- branches/2013/dev_CMCC_2013/NEMOGCM/CONFIG/ORCA2_LIM/EXP00/iodef_ar5.xml	(revision 4174)
+++ branches/2013/dev_CMCC_2013/NEMOGCM/CONFIG/ORCA2_LIM/EXP00/iodef_ar5.xml	(revision 4175)
@@ -248,4 +248,5 @@
       <axis id="depthw" long_name="Vertical W levels" unit="m" positive="down" />
       <axis id="nfloat" long_name="Float number"      unit="-"  />
+      <axis id="icbcla" long_name="Iceberg class"     unit="-"  />
    </axis_definition> 
     
Index: branches/2013/dev_CMCC_2013/NEMOGCM/CONFIG/ORCA2_LIM/EXP00/iodef_default.xml
===================================================================
--- branches/2013/dev_CMCC_2013/NEMOGCM/CONFIG/ORCA2_LIM/EXP00/iodef_default.xml	(revision 4174)
+++ branches/2013/dev_CMCC_2013/NEMOGCM/CONFIG/ORCA2_LIM/EXP00/iodef_default.xml	(revision 4175)
@@ -129,4 +129,5 @@
       <axis id="depthw" long_name="Vertical W levels" unit="m" positive="down" />
       <axis id="nfloat" long_name="Float number"      unit="-"  />
+      <axis id="icbcla" long_name="Iceberg class"     unit="-"  />
    </axis_definition> 
     
Index: branches/2013/dev_CMCC_2013/NEMOGCM/CONFIG/ORCA2_LIM/EXP00/iodef_demo.xml
===================================================================
--- branches/2013/dev_CMCC_2013/NEMOGCM/CONFIG/ORCA2_LIM/EXP00/iodef_demo.xml	(revision 4174)
+++ branches/2013/dev_CMCC_2013/NEMOGCM/CONFIG/ORCA2_LIM/EXP00/iodef_demo.xml	(revision 4175)
@@ -44,6 +44,6 @@
 	<!-- mooring: automatic definition of the file name suffix based on id="0n180wT"  -->
 	<!-- include a group of variables. see field_def.xml for mooring variables definition  -->
-	<file id="0n180wT" >
-	  <field_group group_ref="mooring"/>  
+	<file id="0n180wT">
+	  <field_group group_ref="mooring" domain_ref="0n180wT" />  
 	</file>
 	
@@ -53,4 +53,5 @@
 	  <field_group id="EqT" domain_ref="EqT" >
 	    <field field_ref="toce" name="votemper" axis_ref="deptht_myzoom"  />
+	    <field field_ref="sss" />
 	  </field_group>
 	</file>
@@ -85,4 +86,5 @@
       <axis id="depthw" long_name="Vertical W levels" unit="m" positive="down" />
       <axis id="nfloat" long_name="Float number"      unit="-"  />
+      <axis id="icbcla" long_name="Iceberg class"     unit="-"  />
    </axis_definition> 
     
Index: branches/2013/dev_CMCC_2013/NEMOGCM/CONFIG/ORCA2_LIM/EXP00/iodef_oldstyle.xml
===================================================================
--- branches/2013/dev_CMCC_2013/NEMOGCM/CONFIG/ORCA2_LIM/EXP00/iodef_oldstyle.xml	(revision 4174)
+++ branches/2013/dev_CMCC_2013/NEMOGCM/CONFIG/ORCA2_LIM/EXP00/iodef_oldstyle.xml	(revision 4175)
@@ -116,4 +116,5 @@
       <axis id="depthw" long_name="Vertical W levels" unit="m" positive="down" />
       <axis id="nfloat" long_name="Float number"      unit="-"  />
+      <axis id="icbcla" long_name="Iceberg class"     unit="-"  />
    </axis_definition> 
     
Index: branches/2013/dev_CMCC_2013/NEMOGCM/CONFIG/ORCA2_LIM_CFC_C14b/EXP00/iodef.xml
===================================================================
--- branches/2013/dev_CMCC_2013/NEMOGCM/CONFIG/ORCA2_LIM_CFC_C14b/EXP00/iodef.xml	(revision 4174)
+++ branches/2013/dev_CMCC_2013/NEMOGCM/CONFIG/ORCA2_LIM_CFC_C14b/EXP00/iodef.xml	(revision 4175)
@@ -21,5 +21,5 @@
     -->
     
-    <file_definition type="multiple_file" sync_freq="1d" min_digits="4">
+    <file_definition type="multiple_file" name="@expname@_@freq@_@startdate@_@enddate@" sync_freq="1d" min_digits="4">
     
       <file_group id="1h" output_freq="1h"  output_level="10" enabled=".TRUE."/> <!-- 1h files -->
@@ -60,4 +60,5 @@
       <axis id="depthw" long_name="Vertical W levels" unit="m" positive="down" />
       <axis id="nfloat" long_name="Float number"      unit="-"  />
+      <axis id="icbcla" long_name="Iceberg class"     unit="-"  />
    </axis_definition> 
     
Index: branches/2013/dev_CMCC_2013/NEMOGCM/CONFIG/ORCA2_LIM_PISCES/EXP00/iodef.xml
===================================================================
--- branches/2013/dev_CMCC_2013/NEMOGCM/CONFIG/ORCA2_LIM_PISCES/EXP00/iodef.xml	(revision 4174)
+++ branches/2013/dev_CMCC_2013/NEMOGCM/CONFIG/ORCA2_LIM_PISCES/EXP00/iodef.xml	(revision 4175)
@@ -21,5 +21,5 @@
     -->
     
-    <file_definition type="multiple_file" sync_freq="1d" min_digits="4">
+    <file_definition type="multiple_file" name="@expname@_@freq@_@startdate@_@enddate@" sync_freq="10d" min_digits="4">
     
       <file_group id="1h" output_freq="1h"  output_level="10" enabled=".TRUE."/> <!-- 1h files -->
@@ -31,5 +31,5 @@
       <file_group id="1d" output_freq="1d"  output_level="10" enabled=".TRUE."> <!-- 1d files -->
 
-	<file id="1d_grid_T" name="auto" description="ocean T grid variables" >
+	<file id="file1" name_suffix="_grid_T" description="ocean T grid variables" >
 	  <field field_ref="sst"          name="sosstsst"  />
 	  <field field_ref="sss"          name="sosaline"  />
@@ -37,9 +37,9 @@
 	</file>
 
-	<file id="1d_grid_U" name="auto" description="ocean U grid variables" >
+	<file id="file2" name_suffix="_grid_U" description="ocean U grid variables" >
 	  <field field_ref="suoce"         name="vozocrtx"  />
 	</file>
 	
-	<file id="1d_grid_V" name="auto" description="ocean V grid variables" >
+	<file id="file3" name_suffix="_grid_V" description="ocean V grid variables" >
 	  <field field_ref="svoce"         name="vomecrty"  />
 	</file>
@@ -49,5 +49,5 @@
       <file_group id="5d" output_freq="5d"  output_level="10" enabled=".TRUE.">  <!-- 5d files -->   
 
-	<file id="5d_grid_T" name="auto" description="ocean T grid variables" >
+	<file id="file4" name_suffix="_grid_T" description="ocean T grid variables" >
 	  <field field_ref="toce"         name="votemper"  />
 	  <field field_ref="soce"         name="vosaline"  />
@@ -69,5 +69,5 @@
 	</file>
 	
-	<file id="5d_grid_U" name="auto" description="ocean U grid variables" >
+	<file id="file5" name_suffix="_grid_U" description="ocean U grid variables" >
 	  <field field_ref="uoce"         name="vozocrtx"  />
 	  <field field_ref="uoce_eiv"     name="vozoeivu"  />
@@ -75,5 +75,5 @@
 	</file>
 	
-	<file id="5d_grid_V" name="auto" description="ocean V grid variables" >
+	<file id="file6" name_suffix="_grid_V" description="ocean V grid variables" >
 	  <field field_ref="voce"         name="vomecrty"  />
 	  <field field_ref="voce_eiv"     name="vomeeivv"  />
@@ -81,5 +81,5 @@
 	</file>
 	
-	<file id="5d_grid_W" name="auto" description="ocean W grid variables" >
+	<file id="file7" name_suffix="_grid_W" description="ocean W grid variables" >
 	  <field field_ref="woce"         name="vovecrtz" />
 	  <field field_ref="avt"          name="votkeavt" />
@@ -88,5 +88,5 @@
 	</file>
 	
-	<file id="5d_icemod" name="auto" description="ice variables" >
+	<file id="file8" name_suffix="_icemod" description="ice variables" >
 	  <field field_ref="ice_pres"                     />
 	  <field field_ref="snowthic_cea" name="isnowthi" />
@@ -108,5 +108,5 @@
       <file_group id="1m" output_freq="1mo" output_level="10" enabled=".TRUE."> <!-- real monthly files -->
 
-	<file id="1m_ptrc_T" name="auto" description="pisces sms variables" >
+	<file id="file9" name_suffix="_ptrc_T" description="pisces sms variables" >
           <field field_ref="DIC"      />
           <field field_ref="Alkalini" />
@@ -120,5 +120,5 @@
 	</file>
 	
-	<file id="1m_diad_T" name="auto" description="additional pisces diagnostics" >
+	<file id="file10" name_suffix="_diad_T" description="additional pisces diagnostics" >
           <field field_ref="Cflx"     />
           <field field_ref="Dpco2"    />
@@ -133,5 +133,5 @@
       <file_group id="1y"  output_freq="1y" output_level="10" enabled=".TRUE."> <!-- real yearly files -->
 
-	<file id="1y_ptrc_T" name="auto" description="pisces sms variables" >
+	<file id="file11" name_suffix="_ptrc_T" description="pisces sms variables" >
           <field field_ref="DIC"      />
           <field field_ref="Alkalini" />
@@ -160,5 +160,5 @@
 	</file>
 
-	<file id="1y_diad_T" name="auto" description="additional pisces diagnostics" >
+	<file id="file12" name_suffix="_diad_T" description="additional pisces diagnostics" >
           <field field_ref="PH"       />
           <field field_ref="CO3"      />
@@ -230,4 +230,5 @@
       <axis id="depthw" long_name="Vertical W levels" unit="m" positive="down" />
       <axis id="nfloat" long_name="Float number"      unit="-"  />
+      <axis id="icbcla" long_name="Iceberg class"     unit="-"  />
    </axis_definition> 
     
Index: branches/2013/dev_CMCC_2013/NEMOGCM/CONFIG/ORCA2_OFF_PISCES/EXP00/iodef.xml
===================================================================
--- branches/2013/dev_CMCC_2013/NEMOGCM/CONFIG/ORCA2_OFF_PISCES/EXP00/iodef.xml	(revision 4174)
+++ branches/2013/dev_CMCC_2013/NEMOGCM/CONFIG/ORCA2_OFF_PISCES/EXP00/iodef.xml	(revision 4175)
@@ -21,5 +21,5 @@
     -->
     
-    <file_definition type="multiple_file" sync_freq="1d" min_digits="4">
+    <file_definition type="multiple_file" name="@expname@_@freq@_@startdate@_@enddate@" sync_freq="1d" min_digits="4">
     
       <file_group id="1h" output_freq="1h"  output_level="10" enabled=".TRUE."/> <!-- 1h files -->
@@ -35,5 +35,5 @@
       <file_group id="1m" output_freq="1mo" output_level="10" enabled=".TRUE."> <!-- real monthly files -->
 
-	<file id="1m_ptrc_T" name="auto" description="pisces sms variables" >
+	<file id="file1" name_suffix="_ptrc_T" description="pisces sms variables" >
           <field field_ref="DIC"      />
           <field field_ref="Alkalini" />
@@ -47,5 +47,5 @@
 	</file>
 	
-	<file id="1m_diad_T" name="auto" description="additional pisces diagnostics" >
+	<file id="file2" name_suffix="_diad_T" description="additional pisces diagnostics" >
           <field field_ref="Cflx"     />
           <field field_ref="Dpco2"    />
@@ -60,5 +60,5 @@
       <file_group id="1y"  output_freq="1y" output_level="10" enabled=".TRUE."> <!-- real yearly files -->
 
-	<file id="1y_ptrc_T" name="auto" description="pisces sms variables" >
+	<file id="file3" name_suffix="_ptrc_T" description="pisces sms variables" >
           <field field_ref="DIC"      />
           <field field_ref="Alkalini" />
@@ -87,5 +87,5 @@
 	</file>
 
-	<file id="1y_diad_T" name="auto" description="additional pisces diagnostics" >
+	<file id="file4" name_suffix="_diad_T" description="additional pisces diagnostics" >
           <field field_ref="PH"       />
           <field field_ref="CO3"      />
@@ -157,4 +157,5 @@
       <axis id="depthw" long_name="Vertical W levels" unit="m" positive="down" />
       <axis id="nfloat" long_name="Float number"      unit="-"  />
+      <axis id="icbcla" long_name="Iceberg class"     unit="-"  />
    </axis_definition> 
     
Index: branches/2013/dev_CMCC_2013/NEMOGCM/CONFIG/ORCA2_SAS_LIM/EXP00/iodef.xml
===================================================================
--- branches/2013/dev_CMCC_2013/NEMOGCM/CONFIG/ORCA2_SAS_LIM/EXP00/iodef.xml	(revision 4174)
+++ branches/2013/dev_CMCC_2013/NEMOGCM/CONFIG/ORCA2_SAS_LIM/EXP00/iodef.xml	(revision 4175)
@@ -21,5 +21,5 @@
     -->
     
-    <file_definition type="multiple_file" sync_freq="1d" min_digits="4">
+    <file_definition type="multiple_file" name="@expname@_@freq@_@startdate@_@enddate@" sync_freq="1d" min_digits="4">
     
       <file_group id="1h" output_freq="1h"  output_level="10" enabled=".TRUE."/> <!-- 1h files -->
@@ -60,4 +60,5 @@
       <axis id="depthw" long_name="Vertical W levels" unit="m" positive="down" />
       <axis id="nfloat" long_name="Float number"      unit="-"  />
+      <axis id="icbcla" long_name="Iceberg class"     unit="-"  />
    </axis_definition> 
     
Index: branches/2013/dev_CMCC_2013/NEMOGCM/CONFIG/SHARED/field_def.xml
===================================================================
--- branches/2013/dev_CMCC_2013/NEMOGCM/CONFIG/SHARED/field_def.xml	(revision 4174)
+++ branches/2013/dev_CMCC_2013/NEMOGCM/CONFIG/SHARED/field_def.xml	(revision 4175)
@@ -221,4 +221,21 @@
       </field_group>
 
+      <!-- variables available with iceberg trajectories -->
+      <field_group id="icbvar" domain_ref="grid_T"  > 
+        <field id="berg_melt"          long_name="icb melt rate of icebergs"                     unit="kg/m2/s"   />
+        <field id="berg_buoy_melt"     long_name="icb buoyancy component of iceberg melt rate"   unit="kg/m2/s"   />
+        <field id="berg_eros_melt"     long_name="icb erosion component of iceberg melt rate"    unit="kg/m2/s"   />
+        <field id="berg_conv_melt"     long_name="icb convective component of iceberg melt rate" unit="kg/m2/s"   />
+        <field id="berg_virtual_area"  long_name="icb virtual coverage by icebergs"              unit="m2"        />
+        <field id="bits_src"           long_name="icb mass source of bergy bits"                 unit="kg/m2/s"   />
+        <field id="bits_melt"          long_name="icb melt rate of bergy bits"                   unit="kg/m2/s"   />
+        <field id="bits_mass"          long_name="icb bergy bit density field"                   unit="kg/m2"     />
+        <field id="berg_mass"          long_name="icb iceberg density field"                     unit="kg/m2"     />
+        <field id="calving"            long_name="icb calving mass input"                        unit="kg/s"      />
+        <field id="berg_floating_melt" long_name="icb melt rate of icebergs + bits"              unit="kg/m2/s"   />
+        <field id="berg_real_calving"  long_name="icb calving into iceberg class"                unit="kg/s"     axis_ref="icbcla" />
+        <field id="berg_stored_ice"    long_name="icb accumulated ice mass by class"             unit="kg"       axis_ref="icbcla" />
+      </field_group>
+
       <!-- ptrc on T grid -->
 
@@ -249,13 +266,18 @@
        <field id="NH4"      long_name="Ammonium Concentration"                   unit="mmol/m3" />
 
+       <!-- PISCES with Kriest parametisation : variables available with key_kriest -->
+       <field id="Num"      long_name="Number of organic particles"              unit="nbr" />
+
+       <!-- PISCES light : variables available with key_pisces_reduced -->
        <field id="DET"      long_name="Detritus"                                 unit="mmol-N/m3" />
        <field id="DOM"      long_name="Dissolved Organic Matter"                 unit="mmol-N/m3" />
 
+       <!-- CFC11 : variables available with key_cfc -->
        <field id="CFC11"    long_name="CFC-11 Concentration"                     unit="umol/L" />
+       <!-- Bomb C14 : variables available with key_c14b -->
        <field id="C14B"     long_name="Bomb C14 Concentration"                   unit="ration" />
      </field_group>
 
-      <!-- diad on T grid : variables available with key_diatrc -->
-
+      <!-- PISCES additional diagnostics on T grid  -->
      <field_group id="diad_T" grid_ref="grid_T_2D">
        <field id="PH"          long_name="PH"                                      unit="-"          grid_ref="grid_T_3D" />
@@ -311,33 +333,45 @@
        <field id="Heup"        long_name="Euphotic layer depth"                    unit="m"                            />
        <field id="Irondep"     long_name="Iron deposition from dust"               unit="mol/m2/s"                     />
-       <field id="Ironsed"     long_name="Iron deposition from sediment"           unit="mol/m2/s"  grid_ref="grid_T_3D"  />
-
-       <field id="FNO3PHY"  long_name="FNO3PHY"                             unit="-"  grid_ref="grid_T_3D" /> 
-       <field id="FNH4PHY"  long_name="FNH4PHY"                             unit="-"  grid_ref="grid_T_3D" /> 
-       <field id="FNH4NO3"  long_name="FNH4NO3"                             unit="-"  grid_ref="grid_T_3D" /> 
-       <field id="TNO3PHY"  long_name="TNO3PHY"                             unit="-"  /> 
-       <field id="TNH4PHY"  long_name="TNH4PHY"                             unit="-"  /> 
-       <field id="TPHYDOM"  long_name="TPHYDOM"                             unit="-"  /> 
-       <field id="TPHYNH4"  long_name="TPHYNH4"                             unit="-"  /> 
-       <field id="TPHYZOO"  long_name="TPHYZOO"                             unit="-"  /> 
-       <field id="TPHYDET"  long_name="TPHYDET"                             unit="-"  /> 
-       <field id="TDETZOO"  long_name="TDETZOO"                             unit="-"  /> 
-       <field id="TZOODET"  long_name="TZOODET"                             unit="-"  /> 
-       <field id="TZOOBOD"  long_name="TZOOBOD"                             unit="-"  /> 
-       <field id="TZOONH4"  long_name="TZOONH4"                             unit="-"  /> 
-       <field id="TZOODOM"  long_name="TZOODOM"                             unit="-"  /> 
-       <field id="TNH4NO3"  long_name="TNH4NO3"                             unit="-"  /> 
-       <field id="TDOMNH4"  long_name="TDOMNH4"                             unit="-"  /> 
-       <field id="TDETNH4"  long_name="TDETNH4"                             unit="-"  /> 
-       <field id="TPHYTOT"  long_name="TPHYTOT"                             unit="-"  /> 
-       <field id="TZOOTOT"  long_name="TZOOTOT"                             unit="-"  /> 
-       <field id="SEDPOC"   long_name="SEDPOC"                              unit="-"  /> 
-       <field id="TDETSED"  long_name="TDETSED"                             unit="-"  /> 
-
-       <field id="qtrCFC11"     long_name="Air-sea flux of CFC-11"                   unit="mol/m2/s"   />
-       <field id="qintCFC11"    long_name="Cumulative air-sea flux of CFC-11"        unit="mol/m2"     />
-       <field id="qtrC14b"      long_name="Air-sea flux of Bomb C14"                 unit="mol/m2/s"   />
-       <field id="qintC14b"     long_name="Cumulative air-sea flux of Bomb C14"      unit="mol/m2"     />
-       <field id="fdecay"       long_name="Radiactive decay of Bomb C14"             unit="mol/m3"  grid_ref="grid_T_3D"  />
+       <field id="Ironsed"     long_name="Iron deposition from sediment"           unit="mol/m2/s"  grid_ref="grid_T_3D "/>
+
+       <!-- PISCES with Kriest parametisation : variables available with key_kriest -->
+       <field id="POCFlx"      long_name="Particulate organic C flux"              unit="mol/m2/s"   grid_ref="grid_T_3D" />
+       <field id="NumFlx"      long_name="Particle number flux"                    unit="nbr/m2/s"   grid_ref="grid_T_3D" />
+       <field id="SiFlx"       long_name="Biogenic Si flux"                        unit="mol/m2/s"   grid_ref="grid_T_3D" />
+       <field id="CaCO3Flx"    long_name="CaCO3 flux"                              unit="mol/m2/s"   grid_ref="grid_T_3D" />
+       <field id="xnum"        long_name="Number of particles in aggregats"        unit="-"          grid_ref="grid_T_3D" />
+       <field id="W1"          long_name="sinking speed of mass flux"              unit="m2/s"       grid_ref="grid_T_3D" />
+       <field id="W2"          long_name="sinking speed of number flux"            unit="m2/s"       grid_ref="grid_T_3D" />
+
+       <!-- PISCES light : variables available with key_pisces_reduced -->
+       <field id="FNO3PHY"     long_name="FNO3PHY"                                 unit="-"          grid_ref="grid_T_3D" /> 
+       <field id="FNH4PHY"     long_name="FNH4PHY"                                 unit="-"          grid_ref="grid_T_3D" /> 
+       <field id="FNH4NO3"     long_name="FNH4NO3"                                 unit="-"          grid_ref="grid_T_3D" /> 
+       <field id="TNO3PHY"     long_name="TNO3PHY"                                 unit="-"  /> 
+       <field id="TNH4PHY"     long_name="TNH4PHY"                                 unit="-"  /> 
+       <field id="TPHYDOM"     long_name="TPHYDOM"                                 unit="-"  /> 
+       <field id="TPHYNH4"     long_name="TPHYNH4"                                 unit="-"  /> 
+       <field id="TPHYZOO"     long_name="TPHYZOO"                                 unit="-"  /> 
+       <field id="TPHYDET"     long_name="TPHYDET"                                 unit="-"  /> 
+       <field id="TDETZOO"     long_name="TDETZOO"                                 unit="-"  /> 
+       <field id="TZOODET"     long_name="TZOODET"                                 unit="-"  /> 
+       <field id="TZOOBOD"     long_name="TZOOBOD"                                 unit="-"  /> 
+       <field id="TZOONH4"     long_name="TZOONH4"                                 unit="-"  /> 
+       <field id="TZOODOM"     long_name="TZOODOM"                                 unit="-"  /> 
+       <field id="TNH4NO3"     long_name="TNH4NO3"                                 unit="-"  /> 
+       <field id="TDOMNH4"     long_name="TDOMNH4"                                 unit="-"  /> 
+       <field id="TDETNH4"     long_name="TDETNH4"                                 unit="-"  /> 
+       <field id="TPHYTOT"     long_name="TPHYTOT"                                 unit="-"  /> 
+       <field id="TZOOTOT"     long_name="TZOOTOT"                                 unit="-"  /> 
+       <field id="SEDPOC"      long_name="SEDPOC"                                  unit="-"  /> 
+       <field id="TDETSED"     long_name="TDETSED"                                 unit="-"  /> 
+
+       <!-- CFC11 : variables available with key_cfc -->
+       <field id="qtrCFC11"    long_name="Air-sea flux of CFC-11"                   unit="mol/m2/s"   />
+       <field id="qintCFC11"   long_name="Cumulative air-sea flux of CFC-11"        unit="mol/m2"     />
+       <!-- Bomb C14 : variables available with key_c14b -->
+       <field id="qtrC14b"     long_name="Air-sea flux of Bomb C14"                 unit="mol/m2/s"   />
+       <field id="qintC14b"    long_name="Cumulative air-sea flux of Bomb C14"      unit="mol/m2"     />
+       <field id="fdecay"      long_name="Radiactive decay of Bomb C14"             unit="mol/m3"  grid_ref="grid_T_3D"  />
      </field_group>
 
Index: branches/2013/dev_CMCC_2013/NEMOGCM/NEMO/OPA_SRC/BDY/bdydyn.F90
===================================================================
--- branches/2013/dev_CMCC_2013/NEMOGCM/NEMO/OPA_SRC/BDY/bdydyn.F90	(revision 4174)
+++ branches/2013/dev_CMCC_2013/NEMOGCM/NEMO/OPA_SRC/BDY/bdydyn.F90	(revision 4175)
@@ -30,4 +30,5 @@
    USE lbclnk          ! ocean lateral boundary conditions (or mpp link)
    USE in_out_manager  !
+   USE domvvl          ! variable volume
 
    IMPLICIT NONE
@@ -84,13 +85,22 @@
       pu2d(:,:) = 0.e0
       pv2d(:,:) = 0.e0
-      DO jk = 1, jpkm1   !! Vertically integrated momentum trends
-          pu2d(:,:) = pu2d(:,:) + fse3u(:,:,jk) * umask(:,:,jk) * ua(:,:,jk)
-          pv2d(:,:) = pv2d(:,:) + fse3v(:,:,jk) * vmask(:,:,jk) * va(:,:,jk)
-      END DO
-      pu2d(:,:) = pu2d(:,:) * phur(:,:)
-      pv2d(:,:) = pv2d(:,:) * phvr(:,:)
+      IF (lk_vvl) THEN
+         DO jk = 1, jpkm1   !! Vertically integrated momentum trends
+            pu2d(:,:) = pu2d(:,:) + fse3u_a(:,:,jk) * umask(:,:,jk) * ua(:,:,jk)
+            pv2d(:,:) = pv2d(:,:) + fse3v_a(:,:,jk) * vmask(:,:,jk) * va(:,:,jk)
+         END DO
+         pu2d(:,:) = pu2d(:,:) / ( hu_0(:,:) + sshu_a(:,:) + 1._wp - umask(:,:,1) )
+         pv2d(:,:) = pv2d(:,:) / ( hv_0(:,:) + sshv_a(:,:) + 1._wp - vmask(:,:,1) )
+      ELSE
+         DO jk = 1, jpkm1   !! Vertically integrated momentum trends
+            pu2d(:,:) = pu2d(:,:) + fse3u(:,:,jk) * umask(:,:,jk) * ua(:,:,jk)
+            pv2d(:,:) = pv2d(:,:) + fse3v(:,:,jk) * vmask(:,:,jk) * va(:,:,jk)
+         END DO
+         pu2d(:,:) = pu2d(:,:) * phur(:,:)
+         pv2d(:,:) = pv2d(:,:) * phvr(:,:)
+      ENDIF
       DO jk = 1 , jpkm1
-         ua(:,:,jk) = ua(:,:,jk) - pu2d(:,:)
-         va(:,:,jk) = va(:,:,jk) - pv2d(:,:)
+         ua(:,:,jk) = ua(:,:,jk) - pu2d(:,:) * umask(:,:,jk)
+         va(:,:,jk) = va(:,:,jk) - pv2d(:,:) * vmask(:,:,jk)
       END DO
 
Index: branches/2013/dev_CMCC_2013/NEMOGCM/NEMO/OPA_SRC/C1D/step_c1d.F90
===================================================================
--- branches/2013/dev_CMCC_2013/NEMOGCM/NEMO/OPA_SRC/C1D/step_c1d.F90	(revision 4174)
+++ branches/2013/dev_CMCC_2013/NEMOGCM/NEMO/OPA_SRC/C1D/step_c1d.F90	(revision 4175)
@@ -59,6 +59,7 @@
 
                              indic = 0                ! reset to no error condition
+      IF( kstp == nit000 )   CALL iom_init            ! iom_put initialization (must be done after nemo_init for AGRIF+XIOS+OASIS)
       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 iom_setkt( kstp - nit000 + 1 )   ! say to iom that we are at time step kstp
 
       !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
@@ -106,4 +107,6 @@
       !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
                          CALL dia_wri( kstp )       ! ocean model: outputs
+      IF( lk_diahth  )   CALL dia_hth( kstp )       ! Thermocline depth (20°C)
+
 
 #if defined key_top
Index: branches/2013/dev_CMCC_2013/NEMOGCM/NEMO/OPA_SRC/DIA/diadct.F90
===================================================================
--- branches/2013/dev_CMCC_2013/NEMOGCM/NEMO/OPA_SRC/DIA/diadct.F90	(revision 4174)
+++ branches/2013/dev_CMCC_2013/NEMOGCM/NEMO/OPA_SRC/DIA/diadct.F90	(revision 4175)
@@ -42,5 +42,6 @@
 #endif
 #if defined key_lim3
-  USE ice_3
+  USE par_ice
+  USE ice
 #endif
   USE domvvl
@@ -484,4 +485,5 @@
                  ijglo = secs(jsec)%listPoint(jpt)%J + jpjzoom - 1 + njmpp - 1
                  WRITE(numout,*)'         # I J : ',iiglo,ijglo
+                 CALL FLUSH(numout)
               ENDDO
            ENDIF
@@ -606,5 +608,5 @@
     
      !! * Local variables
-     INTEGER             :: jk, jseg, jclass,                    &!loop on level/segment/classes  
+     INTEGER             :: jk, jseg, jclass,jl,                 &!loop on level/segment/classes/ice categories
                             isgnu, isgnv                          ! 
      REAL(wp)            :: zumid, zvmid,                        &!U/V velocity on a cell segment 
@@ -771,5 +773,6 @@
    
               zTnorm=zumid_ice*e2u(k%I,k%J)+zvmid_ice*e1v(k%I,k%J)
-   
+
+#if defined key_lim2   
               transports_2d(1,jsec,jseg) = transports_2d(1,jsec,jseg) + (zTnorm)*   & 
                                    (1.0 - frld(sec%listPoint(jseg)%I,sec%listPoint(jseg)%J))  & 
@@ -778,4 +781,16 @@
               transports_2d(2,jsec,jseg) = transports_2d(2,jsec,jseg) + (zTnorm)*   & 
                                     (1.0 -  frld(sec%listPoint(jseg)%I,sec%listPoint(jseg)%J))
+#endif
+#if defined key_lim3
+              DO jl=1,jpl
+                 transports_2d(1,jsec,jseg) = transports_2d(1,jsec,jseg) + (zTnorm)*     &
+                                   a_i(sec%listPoint(jseg)%I,sec%listPoint(jseg)%J,jl) * &
+                                  ( ht_i(sec%listPoint(jseg)%I,sec%listPoint(jseg)%J,jl) +  &
+                                    ht_s(sec%listPoint(jseg)%I,sec%listPoint(jseg)%J,jl) )
+                                   
+                 transports_2d(2,jsec,jseg) = transports_2d(2,jsec,jseg) + (zTnorm)*   &
+                                   a_i(sec%listPoint(jseg)%I,sec%listPoint(jseg)%J,jl)
+              ENDDO
+#endif
    
            ENDIF !end of ice case
Index: branches/2013/dev_CMCC_2013/NEMOGCM/NEMO/OPA_SRC/DOM/domvvl.F90
===================================================================
--- branches/2013/dev_CMCC_2013/NEMOGCM/NEMO/OPA_SRC/DOM/domvvl.F90	(revision 4174)
+++ branches/2013/dev_CMCC_2013/NEMOGCM/NEMO/OPA_SRC/DOM/domvvl.F90	(revision 4175)
@@ -192,5 +192,5 @@
       INTEGER  ::   iku, ikv     ! local integers    
       INTEGER  ::   ii0, ii1, ij0, ij1   ! temporary integers
-      REAL(wp) ::   zvt          ! local scalars
+      REAL(wp) ::   zvt, zvtip1, zvtjp1  ! local scalars
       !!----------------------------------------------------------------------
       !
@@ -202,5 +202,5 @@
          WRITE(numout,*) '~~~~~~~~~ '
          pe3u_b(:,:,jpk) = fse3u_0(:,:,jpk)
-         pe3v_b(:,:,jpk) = fse3u_0(:,:,jpk)
+         pe3v_b(:,:,jpk) = fse3v_0(:,:,jpk)
       ENDIF
       
@@ -208,7 +208,9 @@
          DO jj = 2, jpjm1
             DO ji = fs_2, fs_jpim1
-               zvt = fse3t_b(ji,jj,jk) * e1e2t(ji,jj)
-               pe3u_b(ji,jj,jk) = 0.5_wp * ( zvt + fse3t_b(ji+1,jj,jk) * e1e2t(ji+1,jj) ) / ( e1u(ji,jj) * e2u(ji,jj) )
-               pe3v_b(ji,jj,jk) = 0.5_wp * ( zvt + fse3t_b(ji,jj+1,jk) * e1e2t(ji,jj+1) ) / ( e1v(ji,jj) * e2v(ji,jj) )
+               zvt    = ( fse3t_b(ji  ,jj  ,jk) - fse3t_0(ji  ,jj  ,jk) ) * e1e2t(ji  ,jj  )
+               zvtip1 = ( fse3t_b(ji+1,jj  ,jk) - fse3t_0(ji+1,jj  ,jk) ) * e1e2t(ji+1,jj  )
+               zvtjp1 = ( fse3t_b(ji  ,jj+1,jk) - fse3t_0(ji  ,jj+1,jk) ) * e1e2t(ji  ,jj+1)
+               pe3u_b(ji,jj,jk) = fse3u_0(ji,jj,jk) + 0.5_wp * ( zvt + zvtip1 ) / ( e1u(ji,jj) * e2u(ji,jj) )
+               pe3v_b(ji,jj,jk) = fse3v_0(ji,jj,jk) + 0.5_wp * ( zvt + zvtjp1 ) / ( e1v(ji,jj) * e2v(ji,jj) )
             END DO
          END DO
Index: branches/2013/dev_CMCC_2013/NEMOGCM/NEMO/OPA_SRC/DOM/domzgr.F90
===================================================================
--- branches/2013/dev_CMCC_2013/NEMOGCM/NEMO/OPA_SRC/DOM/domzgr.F90	(revision 4174)
+++ branches/2013/dev_CMCC_2013/NEMOGCM/NEMO/OPA_SRC/DOM/domzgr.F90	(revision 4175)
@@ -1373,4 +1373,26 @@
       where (e3vw  (:,:,:).eq.0.0)  e3vw(:,:,:) = 1.0
 
+#if defined key_agrif
+      ! Ensure meaningful vertical scale factors in ghost lines/columns
+      IF( .NOT. Agrif_Root() ) THEN
+         !  
+         IF((nbondi == -1).OR.(nbondi == 2)) THEN
+            e3u(1,:,:) = e3u(2,:,:)
+         ENDIF
+         !
+         IF((nbondi ==  1).OR.(nbondi == 2)) THEN
+            e3u(nlci-1,:,:) = e3u(nlci-2,:,:)
+         ENDIF
+         !
+         IF((nbondj == -1).OR.(nbondj == 2)) THEN
+            e3v(:,1,:) = e3v(:,2,:)
+         ENDIF
+         !
+         IF((nbondj ==  1).OR.(nbondj == 2)) THEN
+            e3v(:,nlcj-1,:) = e3v(:,nlcj-2,:)
+         ENDIF
+         !
+      ENDIF
+#endif
 
       fsdept(:,:,:) = gdept (:,:,:)
@@ -1421,8 +1443,11 @@
          WRITE(numout,"(10x,i4,4f9.2)") ( jk, fsdept(1,1,jk), fsdepw(1,1,jk),     &
             &                                 fse3t (1,1,jk), fse3w (1,1,jk), jk=1,jpk )
-         DO jj = mj0(20), mj1(20)
-            DO ji = mi0(20), mi1(20)
+         iip1 = MIN(20, jpiglo-1)  ! for config with i smaller than 20 points
+         ijp1 = MIN(20, jpjglo-1)  ! for config with j smaller than 20 points
+         DO jj = mj0(ijp1), mj1(ijp1)
+            DO ji = mi0(iip1), mi1(iip1)
                WRITE(numout,*)
-               WRITE(numout,*) ' domzgr: vertical coordinates : point (20,20,k)   bathy = ', bathy(ji,jj), hbatt(ji,jj)
+               WRITE(numout,*) ' domzgr: vertical coordinates : point (',iip1,',',ijp1,',k)   bathy = ',  &
+                  &                                              bathy(ji,jj), hbatt(ji,jj)
                WRITE(numout,*) ' ~~~~~~  --------------------'
                WRITE(numout,"(9x,' level   gdept    gdepw    gde3w     e3t      e3w  ')")
@@ -1431,8 +1456,11 @@
             END DO
          END DO
-         DO jj = mj0(74), mj1(74)
-            DO ji = mi0(100), mi1(100)
+         iip1 = MIN(  74, jpiglo-1)
+         ijp1 = MIN( 100, jpjglo-1)
+         DO jj = mj0(ijp1), mj1(ijp1)
+            DO ji = mi0(iip1), mi1(iip1)
                WRITE(numout,*)
-               WRITE(numout,*) ' domzgr: vertical coordinates : point (100,74,k)   bathy = ', bathy(ji,jj), hbatt(ji,jj)
+               WRITE(numout,*) ' domzgr: vertical coordinates : point (',iip1,',',ijp1,',k)   bathy = ',  &
+                  &                                              bathy(ji,jj), hbatt(ji,jj)
                WRITE(numout,*) ' ~~~~~~  --------------------'
                WRITE(numout,"(9x,' level   gdept    gdepw    gde3w     e3t      e3w  ')")
Index: branches/2013/dev_CMCC_2013/NEMOGCM/NEMO/OPA_SRC/ICB/icb_oce.F90
===================================================================
--- branches/2013/dev_CMCC_2013/NEMOGCM/NEMO/OPA_SRC/ICB/icb_oce.F90	(revision 4174)
+++ branches/2013/dev_CMCC_2013/NEMOGCM/NEMO/OPA_SRC/ICB/icb_oce.F90	(revision 4175)
@@ -37,5 +37,4 @@
    USE par_oce   ! ocean parameters
    USE lib_mpp   ! MPP library
-   USE fldread   ! read input fields (FLD type)
 
    IMPLICIT NONE
@@ -151,6 +150,4 @@
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   :: griddata                           !: work array for icbrst
 
-   TYPE(FLD), PUBLIC, ALLOCATABLE     , DIMENSION(:)       ::   sf_icb   !: structure: file information, fields read
-
    !!----------------------------------------------------------------------
    !! NEMO/OPA 3.3 , NEMO Consortium (2011)
@@ -168,6 +165,5 @@
       !
       icb_alloc = 0
-      ALLOCATE( berg_grid                      ,                                               &
-         &      berg_grid%calving    (jpi,jpj) , berg_grid%calving_hflx (jpi,jpj)          ,   &
+      ALLOCATE( berg_grid%calving    (jpi,jpj) , berg_grid%calving_hflx (jpi,jpj)          ,   &
          &      berg_grid%stored_heat(jpi,jpj) , berg_grid%floating_melt(jpi,jpj)          ,   &
          &      berg_grid%maxclass   (jpi,jpj) , berg_grid%stored_ice   (jpi,jpj,nclasses) ,   &
Index: branches/2013/dev_CMCC_2013/NEMOGCM/NEMO/OPA_SRC/ICB/icbini.F90
===================================================================
--- branches/2013/dev_CMCC_2013/NEMOGCM/NEMO/OPA_SRC/ICB/icbini.F90	(revision 4174)
+++ branches/2013/dev_CMCC_2013/NEMOGCM/NEMO/OPA_SRC/ICB/icbini.F90	(revision 4175)
@@ -35,6 +35,8 @@
    PUBLIC   icb_init  ! routine called in nemogcm.F90 module
 
-   CHARACTER(len=100) ::   cn_dir = './'   ! Root directory for location of icb files
-   TYPE(FLD_N)        ::   sn_icb          ! information about the calving file to be read
+   CHARACTER(len=100)                                 ::   cn_dir = './'   !: Root directory for location of icb files
+   TYPE(FLD_N)                                        ::   sn_icb          !: information about the calving file to be read
+   TYPE(FLD), PUBLIC, ALLOCATABLE     , DIMENSION(:)  ::   sf_icb          !: structure: file information, fields read
+                                                                           !: used in icbini and icbstp
 
    !!----------------------------------------------------------------------
Index: branches/2013/dev_CMCC_2013/NEMOGCM/NEMO/OPA_SRC/ICB/icbstp.F90
===================================================================
--- branches/2013/dev_CMCC_2013/NEMOGCM/NEMO/OPA_SRC/ICB/icbstp.F90	(revision 4174)
+++ branches/2013/dev_CMCC_2013/NEMOGCM/NEMO/OPA_SRC/ICB/icbstp.F90	(revision 4175)
@@ -24,4 +24,5 @@
    USE lib_mpp
    USE iom
+   USE fldread
    USE timing         ! timing
 
Index: branches/2013/dev_CMCC_2013/NEMOGCM/NEMO/OPA_SRC/IOM/iom.F90
===================================================================
--- branches/2013/dev_CMCC_2013/NEMOGCM/NEMO/OPA_SRC/IOM/iom.F90	(revision 4174)
+++ branches/2013/dev_CMCC_2013/NEMOGCM/NEMO/OPA_SRC/IOM/iom.F90	(revision 4175)
@@ -31,4 +31,5 @@
    USE sbc_oce, ONLY :   nn_fsbc         ! ocean space and time domain
    USE trc_oce, ONLY :   nn_dttrc        !  !: frequency of step on passive tracers
+   USE icb_oce, ONLY :   class_num       !  !: iceberg classes
    USE domngb          ! ocean space and time domain
    USE phycst          ! physical constants
@@ -99,5 +100,9 @@
       clname = "nemo"
       IF( TRIM(Agrif_CFixed()) /= '0' )   clname = TRIM(Agrif_CFixed())//"_"//TRIM(clname)
+# if defined key_mpp_mpi
       CALL xios_context_initialize(TRIM(clname), mpi_comm_opa)
+# else
+      CALL xios_context_initialize(TRIM(clname), 0)
+# endif
       CALL iom_swap
 
@@ -124,6 +129,7 @@
       CALL iom_set_axis_attr( "depthw", gdepw_0 )
 # if defined key_floats
-      CALL iom_set_axis_attr( "nfloat", (ji, ji=1,nfloat) )
+      CALL iom_set_axis_attr( "nfloat", (/ (REAL(ji,wp), ji=1,nfloat) /) )
 # endif
+      CALL iom_set_axis_attr( "icbcla", class_num )
       
       ! automatic definitions of some of the xml attributs
Index: branches/2013/dev_CMCC_2013/NEMOGCM/NEMO/OPA_SRC/LBC/mppini_2.h90
===================================================================
--- branches/2013/dev_CMCC_2013/NEMOGCM/NEMO/OPA_SRC/LBC/mppini_2.h90	(revision 4174)
+++ branches/2013/dev_CMCC_2013/NEMOGCM/NEMO/OPA_SRC/LBC/mppini_2.h90	(revision 4175)
@@ -122,4 +122,12 @@
       irestj = 1 + MOD( jpjglo - nrecj -1 , jpnj )
 
+#if defined key_nemocice_decomp
+      ! Change padding to be consistent with CICE
+      ilci(1:jpni-1      ,:) = jpi
+      ilci(jpni          ,:) = jpiglo - (jpni - 1) * (jpi - nreci)
+
+      ilcj(:,      1:jpnj-1) = jpj
+      ilcj(:,          jpnj) = jpjglo - (jpnj - 1) * (jpj - nrecj)
+#else
       ilci(1:iresti      ,:) = jpi
       ilci(iresti+1:jpni ,:) = jpi-1
@@ -127,4 +135,5 @@
       ilcj(:,      1:irestj) = jpj
       ilcj(:, irestj+1:jpnj) = jpj-1
+#endif
 
       IF(lwp) WRITE(numout,*)
Index: branches/2013/dev_CMCC_2013/NEMOGCM/NEMO/OPA_SRC/SOL/solmat.F90
===================================================================
--- branches/2013/dev_CMCC_2013/NEMOGCM/NEMO/OPA_SRC/SOL/solmat.F90	(revision 4174)
+++ branches/2013/dev_CMCC_2013/NEMOGCM/NEMO/OPA_SRC/SOL/solmat.F90	(revision 4175)
@@ -30,4 +30,5 @@
    USE lbclnk          ! lateral boudary conditions
    USE lib_mpp         ! distributed memory computing
+   USE c1d               ! 1D vertical configuration
    USE in_out_manager  ! I/O manager
    USE timing          ! timing
@@ -271,4 +272,5 @@
       
       ! SOR and PCG solvers
+      IF( lk_c1d ) CALL lbc_lnk( gcdmat, 'T', 1._wp ) ! 1D case bmask =/0  but gcdmat not define everywhere 
       DO jj = 1, jpj
          DO ji = 1, jpi
Index: branches/2013/dev_CMCC_2013/NEMOGCM/NEMO/OPA_SRC/step.F90
===================================================================
--- branches/2013/dev_CMCC_2013/NEMOGCM/NEMO/OPA_SRC/step.F90	(revision 4174)
+++ branches/2013/dev_CMCC_2013/NEMOGCM/NEMO/OPA_SRC/step.F90	(revision 4175)
@@ -271,5 +271,5 @@
       !
 #if defined key_iomput
-      IF( kstp == nitend   )   CALL xios_context_finalize() ! needed for XIOS+AGRIF
+      IF( kstp == nitend .OR. indic < 0 )   CALL xios_context_finalize() ! needed for XIOS+AGRIF
 #endif
       !
Index: branches/2013/dev_CMCC_2013/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zfechem.F90
===================================================================
--- branches/2013/dev_CMCC_2013/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zfechem.F90	(revision 4174)
+++ branches/2013/dev_CMCC_2013/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zfechem.F90	(revision 4175)
@@ -129,5 +129,5 @@
                   zoxy   = trn(ji,jj,jk,jpoxy) * ( rhop(ji,jj,jk) / 1.e3 )
                   ! Fe2+ oxydation rate from Santana-Casiano et al. (2005)
-                  zkox   = 35.407 - 6.7109 * zph + 0.5342 * zph * zph - 5362.6 / ( tsn(ji,jj,1,jp_tem) + 273.15 )  &
+                  zkox   = 35.407 - 6.7109 * zph + 0.5342 * zph * zph - 5362.6 / ( tsn(ji,jj,jk,jp_tem) + 273.15 )  &
                     &    - 0.04406 * SQRT( tsn(ji,jj,jk,jp_sal) ) - 0.002847 * tsn(ji,jj,jk,jp_sal)
                   zkox   = ( 10.** zkox ) * spd
Index: branches/2013/dev_CMCC_2013/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zsms.F90
===================================================================
--- branches/2013/dev_CMCC_2013/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zsms.F90	(revision 4174)
+++ branches/2013/dev_CMCC_2013/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zsms.F90	(revision 4175)
@@ -392,5 +392,5 @@
 #endif
             &                    + trn(:,:,:,jpsfe)                     &
-            &                    + trn(:,:,:,jpzoo)                     &
+            &                    + trn(:,:,:,jpzoo) * ferat3            &
             &                    + trn(:,:,:,jpmes) * ferat3            ) * cvol(:,:,:)  )
 
Index: branches/2013/dev_CMCC_2013/NEMOGCM/SETTE/iodef_sette.xml
===================================================================
--- branches/2013/dev_CMCC_2013/NEMOGCM/SETTE/iodef_sette.xml	(revision 4174)
+++ branches/2013/dev_CMCC_2013/NEMOGCM/SETTE/iodef_sette.xml	(revision 4175)
@@ -21,5 +21,5 @@
     -->
     
-    <file_definition type="multiple_file" sync_freq="1d" min_digits="4">
+    <file_definition type="multiple_file" name="@expname@_@freq@_@startdate@_@enddate@" sync_freq="1d" min_digits="4">
     
       <file_group id="1h" output_freq="1h"  output_level="10" enabled=".FALSE."/> <!-- 1h files -->
@@ -54,9 +54,10 @@
     
    <axis_definition>  
-      <axis id="deptht" long_name="Vertical T levels" unit="m"  /><!-- positive=".FALSE." -->
-      <axis id="depthu" long_name="Vertical U levels" unit="m"  /><!-- positive=".FALSE." -->
-      <axis id="depthv" long_name="Vertical V levels" unit="m"  /><!-- positive=".FALSE." -->
-      <axis id="depthw" long_name="Vertical W levels" unit="m"  /><!-- positive=".FALSE." -->
+      <axis id="deptht" long_name="Vertical T levels" unit="m" positive="down" />
+      <axis id="depthu" long_name="Vertical U levels" unit="m" positive="down" />
+      <axis id="depthv" long_name="Vertical V levels" unit="m" positive="down" />
+      <axis id="depthw" long_name="Vertical W levels" unit="m" positive="down" />
       <axis id="nfloat" long_name="Float number"      unit="-"  />
+      <axis id="icbcla" long_name="Iceberg class"     unit="-"  />
    </axis_definition> 
     
Index: branches/2013/dev_CMCC_2013/NEMOGCM/TOOLS/MISCELLANEOUS/chk_iomput.sh
===================================================================
--- branches/2013/dev_CMCC_2013/NEMOGCM/TOOLS/MISCELLANEOUS/chk_iomput.sh	(revision 4174)
+++ branches/2013/dev_CMCC_2013/NEMOGCM/TOOLS/MISCELLANEOUS/chk_iomput.sh	(revision 4175)
@@ -35,7 +35,7 @@
 	    echo ' --insrc              only print all variable definitions found in the source code'
 	    echo 'Examples'
-	    echo '      chk_iomput.sh'
-	    echo '      chk_iomput.sh --help'
-	    echo '      chk_iomput.sh ../../CONFIG/ORCA2_LIM/EXP00/iodef.xml "../../NEMO/OPA_SRC/ ../../NEMO/LIM_SRC_2/"'
+	    echo '      ./chk_iomput.sh'
+	    echo '      ./chk_iomput.sh --help'
+	    echo '      ./chk_iomput.sh ../../CONFIG/ORCA2_LIM/EXP00/iodef.xml "../../NEMO/OPA_SRC/ ../../NEMO/LIM_SRC_2/"'
 	    echo
 	    exit ;;
@@ -59,5 +59,13 @@
 #------------------------------------------------
 #
-[ $inxml -eq 1 ] && grep "< *field * id *=" $xmlfile
+external=$( grep -c "<field_definition.* src=" $xmlfile )
+if [ $external -eq 1 ]
+then
+    xmlfield_def=$( grep "<field_definition.* src=" $xmlfile | sed -e 's/.*src="\([^"]*\)".*/\1/' )
+    xmlfield_def=$( dirname $xmlfile )/$xmlfield_def   
+else
+    xmlfield_def=$xmlfile
+fi
+[ $inxml -eq 1 ] && grep "< *field * id *=" $xmlfield_def
 [ $insrc -eq 1 ] && find $srcdir -name "*.[Ffh]90" -exec grep -iH "^[^\!]*call  *iom_put *(" {} \;
 [ $(( $insrc + $inxml )) -ge 1 ] && exit
@@ -71,17 +79,25 @@
 # list of variables used in "CALL iom_put"
 #
-varlistsrc=$( find $srcdir -name "*.[Ffh]90" -exec grep -i  "^[^\!]*call  *iom_put *(" {} \; | sed -e "s/.*iom_put *( *[\"\']\([^\"\']*\)[\"\'] *,.*/\1/" | sort -d )
+badvarsrc=$( find $srcdir -name "*.[Ffh]90" -exec grep -i  "^[^\!]*call  *iom_put *(" {} \; | sed -e "s/.*iom_put *( *[\"\']\([^\"\']*\)[\"\'] *,.*/\1/" | grep -ic iom_put )
+if [ $badvarsrc -ne 0 ]
+then
+    echo "The following call to iom_put cannot be checked"
+    echo
+    find $srcdir -name "*.[Ffh]90" -exec grep -i  "^[^\!]*call  *iom_put *(" {} \; | sed -e "s/.*iom_put *( *[\"\']\([^\"\']*\)[\"\'] *,.*/\1/" | grep -i iom_put | sort -d 
+    echo
+fi
+varlistsrc=$( find $srcdir -name "*.[Ffh]90" -exec grep -i  "^[^\!]*call  *iom_put *(" {} \; | sed -e "s/.*iom_put *( *[\"\']\([^\"\']*\)[\"\'] *,.*/\1/" | grep -vi iom_put | sort -d )
 #
 # list of variables defined in the xml file
 #
-varlistxml=$( grep "< *field * id *=" $xmlfile  | sed -e "s/^.*< *field * id *= *[\"\']\([^\"\']*\)[\"\'].*/\1/" | sort -d )
+varlistxml=$( grep "< *field.* id *=" $xmlfield_def  | sed -e "s/^.*< *field.* id *= *[\"\']\([^\"\']*\)[\"\'].*/\1/" | sort -d )
 #
 # list of variables to be outputed in the xml file
 #
-varlistout=$( grep "< *field * ref *=" $xmlfile  | sed -e "s/^.*< *field * ref *= *[\"\']\([^\"\']*\)[\"\'].*/\1/" | sort -d )
+varlistout=$( grep "< *field.* field_ref *=" $xmlfile  | sed -e "s/^.*< *field.* field_ref *= *[\"\']\([^\"\']*\)[\"\'].*/\1/" | sort -d )
 #
 echo "--------------------------------------------------"
 echo  check if all iom_put found in $srcdir
-echo  have a corresponding variable definition in $xmlfile
+echo  have a corresponding variable definition in $xmlfield_def
 echo "--------------------------------------------------"
 for var in $varlistsrc
@@ -90,5 +106,5 @@
     if [ $tst -ne 1 ] 
     then
-	echo "problem with $var: $tst lines corresponding to its definition in $xmlfile, but defined in the code in"
+	echo "problem with $var: $tst lines corresponding to its definition in $xmlfield_def, but defined in the code in"
 	for f in $srclist
 	do
