Index: branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/ICB/icbini.F90
===================================================================
--- branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/ICB/icbini.F90	(revision 9168)
+++ branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/ICB/icbini.F90	(revision 9190)
@@ -361,5 +361,22 @@
       !!----------------------------------------------------------------------
 
-#if !defined key_agrif
+#if defined key_agrif
+      IF(lwp) THEN
+         WRITE(numout,*)
+         WRITE(numout,*) 'icb_nam : AGRIF is not compatible with namelist namberg :  '
+         WRITE(numout,*) '~~~~~~~   definition of rn_initial_mass(nclasses) with nclasses as PARAMETER '
+         WRITE(numout,*)
+         WRITE(numout,*) '   ==>>>   force  NO icebergs used. The namelist namberg is not read'
+      ENDIF
+      ln_icebergs = .false.      
+      RETURN
+#else
+      IF(lwp) THEN
+         WRITE(numout,*)
+         WRITE(numout,*) 'icb_nam : iceberg initialization through namberg namelist read'
+         WRITE(numout,*) '~~~~~~~~ '
+      ENDIF
+#endif   
+      !                             !==  read namelist  ==!
       REWIND( numnam_ref )              ! Namelist namberg in reference namelist : Iceberg parameters
       READ  ( numnam_ref, namberg, IOSTAT = ios, ERR = 901)
@@ -369,27 +386,19 @@
 902   IF( ios >  0 ) CALL ctl_nam ( ios , 'namberg in configuration namelist', lwp )
       IF(lwm) WRITE ( numond, namberg )
-#else
-      IF(lwp) THEN
-         WRITE(numout,*)
-         WRITE(numout,*) 'icbini : AGRIF is not compatible with namelist namberg :  '
-         WRITE(numout,*) '~~~~~~   definition of rn_initial_mass(nclasses) with nclasses as PARAMETER '
-         WRITE(numout,*) '         ==>>>   force  NO icebergs used. The namelist namberg is not read'
-      ENDIF
-      ln_icebergs = .false.      
-#endif   
-      IF( .NOT. ln_icebergs ) THEN   ! no icebergs
-         IF(lwp) THEN
-            WRITE(numout,*)
-            WRITE(numout,*) 'icbini : Namelist namberg ln_icebergs = F , NO icebergs used'
-            WRITE(numout,*) '~~~~~~ '
-         ENDIF
+      !
+      IF(lwp) WRITE(numout,*)
+      IF( ln_icebergs ) THEN
+         IF(lwp) WRITE(numout,*) '   ==>>>   icebergs are used'
+      ELSE
+         IF(lwp) WRITE(numout,*) '   ==>>>   No icebergs used'
          RETURN
       ENDIF
-
-
-!     IF( lk_lim3 .AND. ln_icebergs ) THEN
-!        CALL ctl_stop( 'icb_nam: the use of ICB with LIM3 not allowed. ice thickness missing in ICB' )
-!     ENDIF
-
+      !
+      IF( nn_test_icebergs > nclasses ) THEN
+         IF(lwp) WRITE(numout,*)
+         IF(lwp) WRITE(numout,*) '   ==>>>   Resetting of nn_test_icebergs to ', nclasses
+         nn_test_icebergs = nclasses
+      ENDIF
+      !
       IF(lwp) THEN                  ! control print
          WRITE(numout,*)
@@ -399,18 +408,18 @@
          WRITE(numout,*) '   Period between sampling of position for trajectory storage   nn_sample_rate = ', nn_sample_rate
          WRITE(numout,*) '   Mass thresholds between iceberg classes (kg)                 rn_initial_mass     ='
-         DO jn=1,nclasses
-            WRITE(numout,'(a,f15.2)') '                                                                ',rn_initial_mass(jn)
+         DO jn = 1, nclasses
+            WRITE(numout,'(a,f15.2)') '                                                                ', rn_initial_mass(jn)
          ENDDO
          WRITE(numout,*) '   Fraction of calving to apply to this class (non-dim)         rn_distribution     ='
          DO jn = 1, nclasses
-            WRITE(numout,'(a,f10.4)') '                                                                ',rn_distribution(jn)
+            WRITE(numout,'(a,f10.4)') '                                                                ', rn_distribution(jn)
          END DO
          WRITE(numout,*) '   Ratio between effective and real iceberg mass (non-dim)      rn_mass_scaling     = '
          DO jn = 1, nclasses
-            WRITE(numout,'(a,f10.2)') '                                                                ',rn_mass_scaling(jn)
+            WRITE(numout,'(a,f10.2)') '                                                                ', rn_mass_scaling(jn)
          END DO
          WRITE(numout,*) '   Total thickness of newly calved bergs (m)                    rn_initial_thickness = '
          DO jn = 1, nclasses
-            WRITE(numout,'(a,f10.2)') '                                                                ',rn_initial_thickness(jn)
+            WRITE(numout,'(a,f10.2)') '                                                                ', rn_initial_thickness(jn)
          END DO
          WRITE(numout,*) '   Timesteps between verbose messages                           nn_verbose_write    = ', nn_verbose_write
@@ -435,9 +444,4 @@
       ENDIF
       !
-      IF( nn_test_icebergs > nclasses ) THEN
-         IF(lwp) WRITE(numout,*) '      ==>>>   Resetting of nn_test_icebergs to ', nclasses
-         nn_test_icebergs = nclasses
-      ENDIF
-
       ! ensure that the sum of berg input distribution is equal to one
       zfact = SUM( rn_distribution )
