Index: branches/2012/dev_r3337_NOCS10_ICB/NEMOGCM/NEMO/OPA_SRC/ICB/icb_oce.F90
===================================================================
--- branches/2012/dev_r3337_NOCS10_ICB/NEMOGCM/NEMO/OPA_SRC/ICB/icb_oce.F90	(revision 3370)
+++ branches/2012/dev_r3337_NOCS10_ICB/NEMOGCM/NEMO/OPA_SRC/ICB/icb_oce.F90	(revision 3371)
@@ -35,24 +35,24 @@
    !! 
    !!----------------------------------------------------------------------
-
-   USE par_oce         ! ocean parameters
-   USE fldread
+   USE par_oce   ! ocean parameters
+   USE lib_mpp   ! MPP library
+   USE fldread   ! read input fields (FLD type)
 
    IMPLICIT NONE
    PUBLIC
 
-   ! Global constants
-   INTEGER, PUBLIC, PARAMETER :: nclasses = 10 ! Number of ice bergs classes
-   INTEGER, PUBLIC, PARAMETER :: nkounts  =  3 ! Number of integers combined for unique naming
+   PUBLIC   icb_alloc   ! routine called by icb_init in icbini.F90 module
 
-   !! icebergs_gridded type allows for interaction between the set of icebergs and the model grid
-   TYPE, PUBLIC :: icebergs_gridded
-      REAL(wp), DIMENSION(:,:)  , POINTER :: calving => NULL()     ! Calving mass rate [frozen runoff] (kg/s) (into stored ice)
-      REAL(wp), DIMENSION(:,:)  , POINTER :: calving_hflx=>NULL()  ! Calving heat flux [heat content of calving] (W/m2)
-      REAL(wp), DIMENSION(:,:)  , POINTER :: floating_melt=>NULL() ! Net melting rate to icebergs + bits (kg/s/m^2)
-      INTEGER , DIMENSION(:,:)  , POINTER :: maxclass=>NULL()      ! maximum class number at calving source point
-      REAL(wp), DIMENSION(:,:)  , POINTER :: tmp=>NULL()           ! Temporary work space
-      REAL(wp), DIMENSION(:,:,:), POINTER :: stored_ice=>NULL()    ! Accumulated ice mass flux at calving locations (kg)
-      REAL(wp), DIMENSION(:,:)  , POINTER :: stored_heat=>NULL()   ! Heat content of stored ice (J)
+   INTEGER, PUBLIC, PARAMETER ::   nclasses = 10   !: Number of ice bergs classes
+   INTEGER, PUBLIC, PARAMETER ::   nkounts  =  3   !: Number of integers combined for unique naming
+
+   TYPE, PUBLIC ::   icebergs_gridded   !: various icebergs properties on model grid
+      REAL(wp), DIMENSION(:,:)  , POINTER ::   calving       => NULL()   ! Calving mass rate  (into stored ice)         [kg/s]
+      REAL(wp), DIMENSION(:,:)  , POINTER ::   calving_hflx  => NULL()   ! Calving heat flux [heat content of calving]  [W/m2]
+      REAL(wp), DIMENSION(:,:)  , POINTER ::   floating_melt => NULL()   ! Net melting rate to icebergs + bits      [kg/s/m^2]
+      INTEGER , DIMENSION(:,:)  , POINTER ::   maxclass      => NULL()   ! maximum class number at calving source point
+      REAL(wp), DIMENSION(:,:)  , POINTER ::   tmp           => NULL()   ! Temporary work space
+      REAL(wp), DIMENSION(:,:,:), POINTER ::   stored_ice    => NULL()   ! Accumulated ice mass flux at calving locations [kg]
+      REAL(wp), DIMENSION(:,:)  , POINTER ::   stored_heat   => NULL()   ! Heat content of stored ice                      [J]
    END TYPE icebergs_gridded
 
@@ -153,3 +153,47 @@
    TYPE(FLD), ALLOCATABLE, PUBLIC     , DIMENSION(:)       ::   sf_icb   !: structure: file information, fields read
 
+   !!----------------------------------------------------------------------
+   !! NEMO/OPA 3.3 , NEMO Consortium (2011)
+   !! $Id: sbc_oce.F90 3340 2012-04-02 11:05:35Z sga $
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
+CONTAINS
+   
+   INTEGER FUNCTION icb_alloc()
+      !!----------------------------------------------------------------------
+      !!                ***  ROUTINE icb_alloc  ***
+      !!----------------------------------------------------------------------
+      INTEGER ::   ill
+      !!----------------------------------------------------------------------
+      !
+      icb_alloc = 0
+      ALLOCATE( berg_grid                      ,                                               &
+         &      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) ,   &
+         &      berg_grid%tmp        (jpi,jpj) , STAT=ill)
+      icb_alloc = icb_alloc + ill
+      !
+      ! expanded arrays for bilinear interpolation
+      ALLOCATE( uo_e(0:jpi+1,0:jpj+1) , ua_e(0:jpi+1,0:jpj+1) ,   &
+         &      vo_e(0:jpi+1,0:jpj+1) , va_e(0:jpi+1,0:jpj+1) ,   &
+#if defined key_lim2 || defined key_lim3
+         &      ui_e(0:jpi+1,0:jpj+1) ,                            &
+         &      vi_e(0:jpi+1,0:jpj+1) ,                            &
+#endif
+         &      ff_e(0:jpi+1,0:jpj+1) , ssh_e(0:jpi+1,0:jpj+1) ,   &
+         &      first_width(nclasses) , first_length(nclasses) ,   &
+         &      src_calving (jpi,jpj) ,                            &
+         &      src_calving_hflx(jpi,jpj) , STAT=ill)
+      icb_alloc = icb_alloc + ill
+
+      ALLOCATE( nicbfldpts(jpi) , nicbflddest(jpi) , nicbfldproc(jpni) , STAT=ill)
+      icb_alloc = icb_alloc + ill
+
+      IF( lk_mpp        )   CALL mpp_sum ( icb_alloc )
+      IF( icb_alloc > 0 )   CALL ctl_warn('icb_alloc: allocation of arrays failed')
+      !
+   END FUNCTION icb_alloc
+
+   !!======================================================================
 END MODULE icb_oce
Index: branches/2012/dev_r3337_NOCS10_ICB/NEMOGCM/NEMO/OPA_SRC/ICB/icbini.F90
===================================================================
--- branches/2012/dev_r3337_NOCS10_ICB/NEMOGCM/NEMO/OPA_SRC/ICB/icbini.F90	(revision 3370)
+++ branches/2012/dev_r3337_NOCS10_ICB/NEMOGCM/NEMO/OPA_SRC/ICB/icbini.F90	(revision 3371)
@@ -45,72 +45,4 @@
    !!----------------------------------------------------------------------
 CONTAINS
-
-   INTEGER FUNCTION icb_alloc()
-      !!----------------------------------------------------------------------
-      !!                ***  ROUTINE icb_alloc  ***
-      !!----------------------------------------------------------------------
-      !
-      INTEGER                              ::   ill
-
-      icb_alloc = 0
-      ALLOCATE(berg_grid, STAT=ill)
-      icb_alloc = icb_alloc + ill
-      !
-      ALLOCATE( berg_grid%calving      (jpi,jpj)   , STAT=ill)
-      icb_alloc = icb_alloc + ill
-      ALLOCATE( berg_grid%calving_hflx (jpi,jpj)   , STAT=ill)
-      icb_alloc = icb_alloc + ill
-      ALLOCATE( berg_grid%stored_heat  (jpi,jpj)   , STAT=ill)
-      icb_alloc = icb_alloc + ill
-      ALLOCATE( berg_grid%floating_melt(jpi,jpj)   , STAT=ill)
-      icb_alloc = icb_alloc + ill
-      ALLOCATE( berg_grid%maxclass(jpi,jpj)        , STAT=ill)
-      icb_alloc = icb_alloc + ill
-      !
-      ALLOCATE( berg_grid%stored_ice   (jpi,jpj,nclasses) , STAT=ill)
-      icb_alloc = icb_alloc + ill
-      !
-      ALLOCATE( berg_grid%tmp (jpi,jpj) , STAT=ill)
-      icb_alloc = icb_alloc + ill
-      !
-      ! expanded arrays for bilinear interpolation
-      ALLOCATE( uo_e(0:jpi+1,0:jpj+1) , STAT=ill)
-      icb_alloc = icb_alloc + ill
-      ALLOCATE( vo_e(0:jpi+1,0:jpj+1) , STAT=ill)
-      icb_alloc = icb_alloc + ill
-      ALLOCATE( ff_e(0:jpi+1,0:jpj+1) , STAT=ill)
-      icb_alloc = icb_alloc + ill
-      ALLOCATE( ua_e(0:jpi+1,0:jpj+1) , STAT=ill)
-      icb_alloc = icb_alloc + ill
-      ALLOCATE( va_e(0:jpi+1,0:jpj+1) , STAT=ill)
-      icb_alloc = icb_alloc + ill
-#if defined key_lim2 || defined key_lim3
-      ALLOCATE( ui_e(0:jpi+1,0:jpj+1) , STAT=ill)
-      icb_alloc = icb_alloc + ill
-      ALLOCATE( vi_e(0:jpi+1,0:jpj+1) , STAT=ill)
-      icb_alloc = icb_alloc + ill
-#endif
-      ALLOCATE( ssh_e(0:jpi+1,0:jpj+1) , STAT=ill)
-      icb_alloc = icb_alloc + ill
-      ALLOCATE( first_width    (nclasses) , STAT=ill)
-      icb_alloc = icb_alloc + ill
-      ALLOCATE( first_length   (nclasses) , STAT=ill)
-      icb_alloc = icb_alloc + ill
-      ALLOCATE( src_calving(jpi,jpj) , STAT=ill)
-      icb_alloc = icb_alloc + ill
-      ALLOCATE( src_calving_hflx(jpi,jpj) , STAT=ill)
-      icb_alloc = icb_alloc + ill
-
-      ALLOCATE( nicbfldpts(jpi) , STAT=ill)
-      icb_alloc = icb_alloc + ill
-      ALLOCATE( nicbflddest(jpi) , STAT=ill)
-      icb_alloc = icb_alloc + ill
-      ALLOCATE( nicbfldproc(jpni) , STAT=ill)
-      icb_alloc = icb_alloc + ill
-
-      IF( lk_mpp        )   CALL mpp_sum ( icb_alloc )
-      IF( icb_alloc > 0 )   CALL ctl_warn('icb_alloc: allocation of arrays failed')
-
-   END FUNCTION icb_alloc
 
    SUBROUTINE icb_init( pdt, kt )
