Index: trunk/NEMOGCM/CONFIG/AMM12/EXP00/iodef.xml
===================================================================
--- trunk/NEMOGCM/CONFIG/AMM12/EXP00/iodef.xml	(revision 3975)
+++ trunk/NEMOGCM/CONFIG/AMM12/EXP00/iodef.xml	(revision 3983)
@@ -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: trunk/NEMOGCM/CONFIG/GYRE/EXP00/iodef.xml
===================================================================
--- trunk/NEMOGCM/CONFIG/GYRE/EXP00/iodef.xml	(revision 3975)
+++ trunk/NEMOGCM/CONFIG/GYRE/EXP00/iodef.xml	(revision 3983)
@@ -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: trunk/NEMOGCM/CONFIG/GYRE_BFM/EXP00/iodef.xml
===================================================================
--- trunk/NEMOGCM/CONFIG/GYRE_BFM/EXP00/iodef.xml	(revision 3975)
+++ trunk/NEMOGCM/CONFIG/GYRE_BFM/EXP00/iodef.xml	(revision 3983)
@@ -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: trunk/NEMOGCM/CONFIG/GYRE_PISCES/EXP00/iodef.xml
===================================================================
--- trunk/NEMOGCM/CONFIG/GYRE_PISCES/EXP00/iodef.xml	(revision 3975)
+++ trunk/NEMOGCM/CONFIG/GYRE_PISCES/EXP00/iodef.xml	(revision 3983)
@@ -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: trunk/NEMOGCM/CONFIG/ORCA2_LIM/EXP00/iodef_ar5.xml
===================================================================
--- trunk/NEMOGCM/CONFIG/ORCA2_LIM/EXP00/iodef_ar5.xml	(revision 3975)
+++ trunk/NEMOGCM/CONFIG/ORCA2_LIM/EXP00/iodef_ar5.xml	(revision 3983)
@@ -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: trunk/NEMOGCM/CONFIG/ORCA2_LIM/EXP00/iodef_default.xml
===================================================================
--- trunk/NEMOGCM/CONFIG/ORCA2_LIM/EXP00/iodef_default.xml	(revision 3975)
+++ trunk/NEMOGCM/CONFIG/ORCA2_LIM/EXP00/iodef_default.xml	(revision 3983)
@@ -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: trunk/NEMOGCM/CONFIG/ORCA2_LIM/EXP00/iodef_demo.xml
===================================================================
--- trunk/NEMOGCM/CONFIG/ORCA2_LIM/EXP00/iodef_demo.xml	(revision 3975)
+++ trunk/NEMOGCM/CONFIG/ORCA2_LIM/EXP00/iodef_demo.xml	(revision 3983)
@@ -86,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: trunk/NEMOGCM/CONFIG/ORCA2_LIM/EXP00/iodef_oldstyle.xml
===================================================================
--- trunk/NEMOGCM/CONFIG/ORCA2_LIM/EXP00/iodef_oldstyle.xml	(revision 3975)
+++ trunk/NEMOGCM/CONFIG/ORCA2_LIM/EXP00/iodef_oldstyle.xml	(revision 3983)
@@ -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: trunk/NEMOGCM/CONFIG/ORCA2_LIM_CFC_C14b/EXP00/iodef.xml
===================================================================
--- trunk/NEMOGCM/CONFIG/ORCA2_LIM_CFC_C14b/EXP00/iodef.xml	(revision 3975)
+++ trunk/NEMOGCM/CONFIG/ORCA2_LIM_CFC_C14b/EXP00/iodef.xml	(revision 3983)
@@ -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: trunk/NEMOGCM/CONFIG/ORCA2_LIM_PISCES/EXP00/iodef.xml
===================================================================
--- trunk/NEMOGCM/CONFIG/ORCA2_LIM_PISCES/EXP00/iodef.xml	(revision 3975)
+++ trunk/NEMOGCM/CONFIG/ORCA2_LIM_PISCES/EXP00/iodef.xml	(revision 3983)
@@ -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: trunk/NEMOGCM/CONFIG/ORCA2_OFF_PISCES/EXP00/iodef.xml
===================================================================
--- trunk/NEMOGCM/CONFIG/ORCA2_OFF_PISCES/EXP00/iodef.xml	(revision 3975)
+++ trunk/NEMOGCM/CONFIG/ORCA2_OFF_PISCES/EXP00/iodef.xml	(revision 3983)
@@ -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: trunk/NEMOGCM/CONFIG/ORCA2_SAS_LIM/EXP00/iodef.xml
===================================================================
--- trunk/NEMOGCM/CONFIG/ORCA2_SAS_LIM/EXP00/iodef.xml	(revision 3975)
+++ trunk/NEMOGCM/CONFIG/ORCA2_SAS_LIM/EXP00/iodef.xml	(revision 3983)
@@ -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: trunk/NEMOGCM/CONFIG/SHARED/field_def.xml
===================================================================
--- trunk/NEMOGCM/CONFIG/SHARED/field_def.xml	(revision 3975)
+++ trunk/NEMOGCM/CONFIG/SHARED/field_def.xml	(revision 3983)
@@ -219,4 +219,21 @@
         <field id="traj_dens"  long_name="floats density"     unit="kg/m3" />
         <field id="traj_group" long_name="floats group"       unit="none"  />
+      </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>
 
Index: trunk/NEMOGCM/NEMO/OPA_SRC/ICB/icb_oce.F90
===================================================================
--- trunk/NEMOGCM/NEMO/OPA_SRC/ICB/icb_oce.F90	(revision 3975)
+++ trunk/NEMOGCM/NEMO/OPA_SRC/ICB/icb_oce.F90	(revision 3983)
@@ -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)
Index: trunk/NEMOGCM/NEMO/OPA_SRC/ICB/icbini.F90
===================================================================
--- trunk/NEMOGCM/NEMO/OPA_SRC/ICB/icbini.F90	(revision 3975)
+++ trunk/NEMOGCM/NEMO/OPA_SRC/ICB/icbini.F90	(revision 3983)
@@ -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: trunk/NEMOGCM/NEMO/OPA_SRC/ICB/icbstp.F90
===================================================================
--- trunk/NEMOGCM/NEMO/OPA_SRC/ICB/icbstp.F90	(revision 3975)
+++ trunk/NEMOGCM/NEMO/OPA_SRC/ICB/icbstp.F90	(revision 3983)
@@ -24,4 +24,5 @@
    USE lib_mpp
    USE iom
+   USE fldread
    USE timing         ! timing
 
Index: trunk/NEMOGCM/NEMO/OPA_SRC/IOM/iom.F90
===================================================================
--- trunk/NEMOGCM/NEMO/OPA_SRC/IOM/iom.F90	(revision 3975)
+++ trunk/NEMOGCM/NEMO/OPA_SRC/IOM/iom.F90	(revision 3983)
@@ -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,9 +100,9 @@
       clname = "nemo"
       IF( TRIM(Agrif_CFixed()) /= '0' )   clname = TRIM(Agrif_CFixed())//"_"//TRIM(clname)
-#if defined key_mpp_mpi
+# if defined key_mpp_mpi
       CALL xios_context_initialize(TRIM(clname), mpi_comm_opa)
-#else
+# else
       CALL xios_context_initialize(TRIM(clname), 0)
-#endif
+# endif
       CALL iom_swap
 
@@ -128,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
