Index: /branches/2012/dev_NOC_2012_rev3555/NEMOGCM/CONFIG/GYRE/EXP00/namelist
===================================================================
--- /branches/2012/dev_NOC_2012_rev3555/NEMOGCM/CONFIG/GYRE/EXP00/namelist	(revision 3613)
+++ /branches/2012/dev_NOC_2012_rev3555/NEMOGCM/CONFIG/GYRE/EXP00/namelist	(revision 3614)
@@ -315,4 +315,38 @@
    rn_alphc    =    0.65   !  compute albedo between two extremes values 
    rn_alphdi   =    0.72   !  (Pyane, 1972)
+/
+!-----------------------------------------------------------------------
+&namberg       !   iceberg parameters
+!-----------------------------------------------------------------------
+      ln_icebergs              = .false.
+      ln_bergdia               = .true.               ! Calculate budgets
+      nn_verbose_level         = 1                    ! Turn on more verbose output if level > 0
+      nn_verbose_write         = 15                   ! Timesteps between verbose messages
+      nn_sample_rate           = 1                    ! Timesteps between sampling for trajectory storage
+                                                      ! Initial mass required for an iceberg of each class
+      rn_initial_mass          = 8.8e7, 4.1e8, 3.3e9, 1.8e10, 3.8e10, 7.5e10, 1.2e11, 2.2e11, 3.9e11, 7.4e11
+                                                      ! Proportion of calving mass to apportion to each class
+      rn_distribution          = 0.24, 0.12, 0.15, 0.18, 0.12, 0.07, 0.03, 0.03, 0.03, 0.02
+                                                      ! Ratio between effective and real iceberg mass (non-dim)
+                                                      ! i.e. number of icebergs represented at a point
+      rn_mass_scaling          = 2000, 200, 50, 20, 10, 5, 2, 1, 1, 1
+                                                      ! thickness of newly calved bergs (m)
+      rn_initial_thickness     = 40., 67., 133., 175., 250., 250., 250., 250., 250., 250.
+      rn_rho_bergs             = 850.                 ! Density of icebergs
+      rn_LoW_ratio             = 1.5                  ! Initial ratio L/W for newly calved icebergs
+      ln_operator_splitting    = .true.               ! Use first order operator splitting for thermodynamics
+      rn_bits_erosion_fraction = 0.                   ! Fraction of erosion melt flux to divert to bergy bits
+      rn_sicn_shift            = 0.                   ! Shift of sea-ice concn in erosion flux (0<sicn_shift<1)
+      ln_passive_mode          = .false.              ! iceberg - ocean decoupling
+      nn_test_icebergs         =  10                  ! Create test icebergs of this class (-1 = no)
+                                                      ! Put a test iceberg at each gridpoint in box (lon1,lon2,lat1,lat2)
+      rn_test_box              = 108.0,  116.0, -66.0, -58.0
+      rn_speed_limit           = 0.                   ! CFL speed limit for a berg
+
+               ! filename ! freq (hours) ! variable ! time interp. ! clim  !'yearly' or ! weights  ! rotation !
+               !          ! (<0  months) !   name   !  (logical)   ! (T/F) ! 'monthly'  ! filename ! pairing  !
+      sn_icb =  'calving' ,     -1       , 'calvingmask',  .true.      , .true., 'yearly'   , ' '      , ' '
+
+      cn_dir = './'
 /
 
Index: /branches/2012/dev_NOC_2012_rev3555/NEMOGCM/CONFIG/ORCA2_OFF_PISCES/EXP00/namelist
===================================================================
--- /branches/2012/dev_NOC_2012_rev3555/NEMOGCM/CONFIG/ORCA2_OFF_PISCES/EXP00/namelist	(revision 3613)
+++ /branches/2012/dev_NOC_2012_rev3555/NEMOGCM/CONFIG/ORCA2_OFF_PISCES/EXP00/namelist	(revision 3614)
@@ -314,4 +314,38 @@
    rn_alphc    =    0.65   !  compute albedo between two extremes values 
    rn_alphdi   =    0.72   !  (Pyane, 1972)
+/
+!-----------------------------------------------------------------------
+&namberg       !   iceberg parameters
+!-----------------------------------------------------------------------
+      ln_icebergs              = .false.
+      ln_bergdia               = .true.               ! Calculate budgets
+      nn_verbose_level         = 1                    ! Turn on more verbose output if level > 0
+      nn_verbose_write         = 15                   ! Timesteps between verbose messages
+      nn_sample_rate           = 1                    ! Timesteps between sampling for trajectory storage
+                                                      ! Initial mass required for an iceberg of each class
+      rn_initial_mass          = 8.8e7, 4.1e8, 3.3e9, 1.8e10, 3.8e10, 7.5e10, 1.2e11, 2.2e11, 3.9e11, 7.4e11
+                                                      ! Proportion of calving mass to apportion to each class
+      rn_distribution          = 0.24, 0.12, 0.15, 0.18, 0.12, 0.07, 0.03, 0.03, 0.03, 0.02
+                                                      ! Ratio between effective and real iceberg mass (non-dim)
+                                                      ! i.e. number of icebergs represented at a point
+      rn_mass_scaling          = 2000, 200, 50, 20, 10, 5, 2, 1, 1, 1
+                                                      ! thickness of newly calved bergs (m)
+      rn_initial_thickness     = 40., 67., 133., 175., 250., 250., 250., 250., 250., 250.
+      rn_rho_bergs             = 850.                 ! Density of icebergs
+      rn_LoW_ratio             = 1.5                  ! Initial ratio L/W for newly calved icebergs
+      ln_operator_splitting    = .true.               ! Use first order operator splitting for thermodynamics
+      rn_bits_erosion_fraction = 0.                   ! Fraction of erosion melt flux to divert to bergy bits
+      rn_sicn_shift            = 0.                   ! Shift of sea-ice concn in erosion flux (0<sicn_shift<1)
+      ln_passive_mode          = .false.              ! iceberg - ocean decoupling
+      nn_test_icebergs         =  10                  ! Create test icebergs of this class (-1 = no)
+                                                      ! Put a test iceberg at each gridpoint in box (lon1,lon2,lat1,lat2)
+      rn_test_box              = 108.0,  116.0, -66.0, -58.0
+      rn_speed_limit           = 0.                   ! CFL speed limit for a berg
+
+               ! filename ! freq (hours) ! variable ! time interp. ! clim  !'yearly' or ! weights  ! rotation !
+               !          ! (<0  months) !   name   !  (logical)   ! (T/F) ! 'monthly'  ! filename ! pairing  !
+      sn_icb =  'calving' ,     -1       , 'calvingmask',  .true.      , .true., 'yearly'   , ' '      , ' '
+
+      cn_dir = './'
 /
 
Index: /branches/2012/dev_NOC_2012_rev3555/NEMOGCM/CONFIG/ORCA2_SAS_LIM/EXP00/namelist
===================================================================
--- /branches/2012/dev_NOC_2012_rev3555/NEMOGCM/CONFIG/ORCA2_SAS_LIM/EXP00/namelist	(revision 3613)
+++ /branches/2012/dev_NOC_2012_rev3555/NEMOGCM/CONFIG/ORCA2_SAS_LIM/EXP00/namelist	(revision 3614)
@@ -330,4 +330,38 @@
    rn_alphc    =    0.65   !  compute albedo between two extremes values 
    rn_alphdi   =    0.72   !  (Pyane, 1972)
+/
+!-----------------------------------------------------------------------
+&namberg       !   iceberg parameters
+!-----------------------------------------------------------------------
+      ln_icebergs              = .false.
+      ln_bergdia               = .true.               ! Calculate budgets
+      nn_verbose_level         = 1                    ! Turn on more verbose output if level > 0
+      nn_verbose_write         = 15                   ! Timesteps between verbose messages
+      nn_sample_rate           = 1                    ! Timesteps between sampling for trajectory storage
+                                                      ! Initial mass required for an iceberg of each class
+      rn_initial_mass          = 8.8e7, 4.1e8, 3.3e9, 1.8e10, 3.8e10, 7.5e10, 1.2e11, 2.2e11, 3.9e11, 7.4e11
+                                                      ! Proportion of calving mass to apportion to each class
+      rn_distribution          = 0.24, 0.12, 0.15, 0.18, 0.12, 0.07, 0.03, 0.03, 0.03, 0.02
+                                                      ! Ratio between effective and real iceberg mass (non-dim)
+                                                      ! i.e. number of icebergs represented at a point
+      rn_mass_scaling          = 2000, 200, 50, 20, 10, 5, 2, 1, 1, 1
+                                                      ! thickness of newly calved bergs (m)
+      rn_initial_thickness     = 40., 67., 133., 175., 250., 250., 250., 250., 250., 250.
+      rn_rho_bergs             = 850.                 ! Density of icebergs
+      rn_LoW_ratio             = 1.5                  ! Initial ratio L/W for newly calved icebergs
+      ln_operator_splitting    = .true.               ! Use first order operator splitting for thermodynamics
+      rn_bits_erosion_fraction = 0.                   ! Fraction of erosion melt flux to divert to bergy bits
+      rn_sicn_shift            = 0.                   ! Shift of sea-ice concn in erosion flux (0<sicn_shift<1)
+      ln_passive_mode          = .false.              ! iceberg - ocean decoupling
+      nn_test_icebergs         =  10                  ! Create test icebergs of this class (-1 = no)
+                                                      ! Put a test iceberg at each gridpoint in box (lon1,lon2,lat1,lat2)
+      rn_test_box              = 108.0,  116.0, -66.0, -58.0
+      rn_speed_limit           = 0.                   ! CFL speed limit for a berg
+
+               ! filename ! freq (hours) ! variable ! time interp. ! clim  !'yearly' or ! weights  ! rotation !
+               !          ! (<0  months) !   name   !  (logical)   ! (T/F) ! 'monthly'  ! filename ! pairing  !
+      sn_icb =  'calving' ,     -1       , 'calvingmask',  .true.      , .true., 'yearly'   , ' '      , ' '
+
+      cn_dir = './'
 /
 
Index: /branches/2012/dev_NOC_2012_rev3555/NEMOGCM/NEMO/OPA_SRC/ICB/icb_oce.F90
===================================================================
--- /branches/2012/dev_NOC_2012_rev3555/NEMOGCM/NEMO/OPA_SRC/ICB/icb_oce.F90	(revision 3613)
+++ /branches/2012/dev_NOC_2012_rev3555/NEMOGCM/NEMO/OPA_SRC/ICB/icb_oce.F90	(revision 3614)
@@ -90,7 +90,7 @@
    REAL(wp), PUBLIC, DIMENSION(:,:), ALLOCATABLE ::   ff_e
    REAL(wp), PUBLIC, DIMENSION(:,:), ALLOCATABLE ::   ua_e, va_e
+   REAL(wp), PUBLIC, DIMENSION(:,:), ALLOCATABLE ::   ssh_e
 #if defined key_lim2 || defined key_lim3
    REAL(wp), PUBLIC, DIMENSION(:,:), ALLOCATABLE ::   ui_e, vi_e
-   REAL(wp), PUBLIC, DIMENSION(:,:), ALLOCATABLE ::   ssh_e
 #endif
 
Index: /branches/2012/dev_NOC_2012_rev3555/NEMOGCM/NEMO/OPA_SRC/ICB/icbclv.F90
===================================================================
--- /branches/2012/dev_NOC_2012_rev3555/NEMOGCM/NEMO/OPA_SRC/ICB/icbclv.F90	(revision 3613)
+++ /branches/2012/dev_NOC_2012_rev3555/NEMOGCM/NEMO/OPA_SRC/ICB/icbclv.F90	(revision 3614)
Index: /branches/2012/dev_NOC_2012_rev3555/NEMOGCM/NEMO/OPA_SRC/ICB/icbdia.F90
===================================================================
--- /branches/2012/dev_NOC_2012_rev3555/NEMOGCM/NEMO/OPA_SRC/ICB/icbdia.F90	(revision 3613)
+++ /branches/2012/dev_NOC_2012_rev3555/NEMOGCM/NEMO/OPA_SRC/ICB/icbdia.F90	(revision 3614)
Index: /branches/2012/dev_NOC_2012_rev3555/NEMOGCM/NEMO/OPA_SRC/ICB/icbdyn.F90
===================================================================
--- /branches/2012/dev_NOC_2012_rev3555/NEMOGCM/NEMO/OPA_SRC/ICB/icbdyn.F90	(revision 3613)
+++ /branches/2012/dev_NOC_2012_rev3555/NEMOGCM/NEMO/OPA_SRC/ICB/icbdyn.F90	(revision 3614)
Index: /branches/2012/dev_NOC_2012_rev3555/NEMOGCM/NEMO/OPA_SRC/ICB/icbini.F90
===================================================================
--- /branches/2012/dev_NOC_2012_rev3555/NEMOGCM/NEMO/OPA_SRC/ICB/icbini.F90	(revision 3613)
+++ /branches/2012/dev_NOC_2012_rev3555/NEMOGCM/NEMO/OPA_SRC/ICB/icbini.F90	(revision 3614)
Index: /branches/2012/dev_NOC_2012_rev3555/NEMOGCM/NEMO/OPA_SRC/ICB/icblbc.F90
===================================================================
--- /branches/2012/dev_NOC_2012_rev3555/NEMOGCM/NEMO/OPA_SRC/ICB/icblbc.F90	(revision 3613)
+++ /branches/2012/dev_NOC_2012_rev3555/NEMOGCM/NEMO/OPA_SRC/ICB/icblbc.F90	(revision 3614)
Index: /branches/2012/dev_NOC_2012_rev3555/NEMOGCM/NEMO/OPA_SRC/ICB/icbrst.F90
===================================================================
--- /branches/2012/dev_NOC_2012_rev3555/NEMOGCM/NEMO/OPA_SRC/ICB/icbrst.F90	(revision 3613)
+++ /branches/2012/dev_NOC_2012_rev3555/NEMOGCM/NEMO/OPA_SRC/ICB/icbrst.F90	(revision 3614)
Index: /branches/2012/dev_NOC_2012_rev3555/NEMOGCM/NEMO/OPA_SRC/ICB/icbstp.F90
===================================================================
--- /branches/2012/dev_NOC_2012_rev3555/NEMOGCM/NEMO/OPA_SRC/ICB/icbstp.F90	(revision 3613)
+++ /branches/2012/dev_NOC_2012_rev3555/NEMOGCM/NEMO/OPA_SRC/ICB/icbstp.F90	(revision 3614)
Index: /branches/2012/dev_NOC_2012_rev3555/NEMOGCM/NEMO/OPA_SRC/ICB/icbthm.F90
===================================================================
--- /branches/2012/dev_NOC_2012_rev3555/NEMOGCM/NEMO/OPA_SRC/ICB/icbthm.F90	(revision 3613)
+++ /branches/2012/dev_NOC_2012_rev3555/NEMOGCM/NEMO/OPA_SRC/ICB/icbthm.F90	(revision 3614)
Index: /branches/2012/dev_NOC_2012_rev3555/NEMOGCM/NEMO/OPA_SRC/ICB/icbtrj.F90
===================================================================
--- /branches/2012/dev_NOC_2012_rev3555/NEMOGCM/NEMO/OPA_SRC/ICB/icbtrj.F90	(revision 3613)
+++ /branches/2012/dev_NOC_2012_rev3555/NEMOGCM/NEMO/OPA_SRC/ICB/icbtrj.F90	(revision 3614)
Index: /branches/2012/dev_NOC_2012_rev3555/NEMOGCM/NEMO/OPA_SRC/ICB/icbutl.F90
===================================================================
--- /branches/2012/dev_NOC_2012_rev3555/NEMOGCM/NEMO/OPA_SRC/ICB/icbutl.F90	(revision 3613)
+++ /branches/2012/dev_NOC_2012_rev3555/NEMOGCM/NEMO/OPA_SRC/ICB/icbutl.F90	(revision 3614)
Index: /branches/2012/dev_NOC_2012_rev3555/NEMOGCM/NEMO/OPA_SRC/SBC/sbcssm.F90
===================================================================
--- /branches/2012/dev_NOC_2012_rev3555/NEMOGCM/NEMO/OPA_SRC/SBC/sbcssm.F90	(revision 3613)
+++ /branches/2012/dev_NOC_2012_rev3555/NEMOGCM/NEMO/OPA_SRC/SBC/sbcssm.F90	(revision 3614)
@@ -25,5 +25,6 @@
    PRIVATE
 
-   PUBLIC   sbc_ssm    ! routine called by step.F90
+   PUBLIC   sbc_ssm         ! routine called by step.F90
+   PUBLIC   sbc_ssm_init    ! routine called by sbcmod.F90
    
    LOGICAL, SAVE  ::   l_ssm_mean = .FALSE.       ! keep track of whether means have been read
@@ -71,5 +72,5 @@
       ELSE
          !                                                ! ----------------------------------------------- !
-         IF( kt == nit000 && .NOT. l_ssm_mean ) THEN      !   Initialisation: 1st time-step, no input means !
+         IF( kt == nit000 .AND. .NOT. l_ssm_mean ) THEN   !   Initialisation: 1st time-step, no input means !
             !                                             ! ----------------------------------------------- !
             IF(lwp) WRITE(numout,*)
@@ -145,5 +146,5 @@
       !! ** Action  : - read parameters
       !!----------------------------------------------------------------------
-      REAL(wp) ::   zcoef               ! local scalar
+      REAL(wp) ::   zcoef, zf_sbc       ! local scalar
       !!----------------------------------------------------------------------
 
