Index: /trunk/NEMO/LIM_SRC_3/limthd_lac.F90
===================================================================
--- /trunk/NEMO/LIM_SRC_3/limthd_lac.F90	(revision 864)
+++ /trunk/NEMO/LIM_SRC_3/limthd_lac.F90	(revision 865)
@@ -227,9 +227,14 @@
 ! 3) Collection thickness of ice formed in leads and polynyas
 !------------------------------------------------------------------------------!    
-      ! hicol is the thickness of new ice.
+      ! hicol is the thickness of new ice formed in open water
+      ! hicol can be either prescribed (frazswi = 0)
+      ! or computed (frazswi = 1)
       ! Frazil ice forms in open water, is transported by wind
       ! accumulates at the edge of the consolidated ice edge
       ! where it forms aggregates of a specific thickness called
       ! collection thickness.
+
+      ! Note : the following algorithm currently breaks vectorization
+      ! 
 
       zvrel(:,:) = 0.0
@@ -253,11 +258,4 @@
           zsqcd   = 1.0 / SQRT( 1.3 * cai ) ! 1/SQRT(airdensity*drag)
           zgamafr = 0.03
-
-          !+++++
-          WRITE(numout,*) ' ztwogp : ', ztwogp
-          WRITE(numout,*) ' rau0   : ', rau0
-          WRITE(numout,*) ' grav   : ', grav
-          WRITE(numout,*) ' rhoic  : ', rhoic
-          !+++++
 
           DO jj = 1, jpj
@@ -275,23 +273,4 @@
             ! Square root of wind stress
             ztenagm       =  SQRT( SQRT( ztaux * ztaux + ztauy * ztauy ) )
-!           !+++++
-            ! tension on B-grid
-!           ztaux         = ( gtaux(ji  ,jj  ) * tmu(ji,jj    ) &
-!                         +   gtaux(ji+1,jj  ) * tmu(ji+1,jj  ) &
-!                         +   gtaux(ji,jj+1  ) * tmu(ji,jj+1  ) &
-!                         +   gtaux(ji+1,jj+1) * tmu(ji+1,jj+1) ) / 4.0
-!           ztauy         = ( gtauy(ji  ,jj  ) * tmu(ji,jj    ) &
-!                         +   gtauy(ji+1,jj  ) * tmu(ji+1,jj  ) &
-!                         +   gtauy(ji,jj+1  ) * tmu(ji,jj+1  ) &
-!                         +   gtauy(ji+1,jj+1) * tmu(ji+1,jj+1) ) / 4.0
-!           !+++++
-!           !+++++
-!           IF ( ( ji.EQ.jiindex ) .AND. ( jj.EQ.jjindex ) ) THEN
-!              WRITE(numout,*)
-!              WRITE(numout,*) ' ztaux : ', ztaux
-!              WRITE(numout,*) ' ztauy : ', ztauy
-!              WRITE(numout,*) ' |tau| : ', ztenagm
-!           ENDIF
-!           !+++++
 
             !---------------------
@@ -320,37 +299,4 @@
             zvrel(ji,jj)  = SQRT(zvrel2)
 
-            !+++++++++
-!           ! ice drift on B-grid
-!           zindb = MAX(0.0, SIGN(1.0, at_i(ji,jj) ))
-!           zvgx  = zindb * (  u_ice(ji,jj    )   * tmu(ji,jj  )     &
-!                           +  u_ice(ji+1,jj  )   * tmu(ji+1,jj)     &
-!                           +  u_ice(ji,jj+1  )   * tmu(ji,jj+1)     &
-!                           +  u_ice(ji+1,jj+1)   * tmu(ji+1,jj+1) ) &
-!                           / 4.0
-!           zvgy  = zindb * (  v_ice(ji,jj    )   * tmu(ji,jj  ) &
-!                           +  v_ice(ji+1,jj  )   * tmu(ji+1,jj) &
-!                           +  v_ice(ji,jj+1  )   * tmu(ji,jj+1) &
-!                           +  v_ice(ji+1,jj+1)   * tmu(ji+1,jj+1) ) &
-!                           / 4.0
-
-!           !+++++
-!           IF ( ( ji.EQ.jiindex ) .AND. ( jj.EQ.jjindex ) ) THEN
-!              WRITE(numout,*)
-!              WRITE(numout,*) ' zvfrx : ', zvfrx
-!              WRITE(numout,*) ' zvfry : ', zvfry
-!              WRITE(numout,*) ' zvgx  : ', zvgx 
-!              WRITE(numout,*) ' zvgy  : ', zvgx 
-!           ENDIF
-!           !+++++
-
-!           !+++++
-!           IF ( ( ji.EQ.jiindex ) .AND. ( jj.EQ.jjindex ) ) THEN
-!              WRITE(numout,*)
-!              WRITE(numout,*) ' zvrel2: ', zvrel2
-!              WRITE(numout,*) ' zvrel : ', zvrel(ji,jj)
-!           ENDIF
-
-!           hicol(ji,jj) = 10.0 ! starting value has to be high!!!
-
             !---------------------
             ! Iterative procedure
@@ -372,44 +318,12 @@
                hicol(ji,jj)   = zhicol_new
 
-               !++++++++++++++++++++
-!              IF ( ABS(-zf/zfp) .LT. 1.0d-9 ) THEN
-!                 iterate_frazil = .false. 
-!              ENDIF
-
-!              IF ( (ji.eq.jiindex).AND.(jj.eq.jjindex) ) THEN
-!                      WRITE(numout,*) ' ------- iter = ', iter, &
-!                      '----------------'
-!                      WRITE(numout,*) ' iterate_frazil ', iterate_frazil
-!                      WRITE(numout,*) ' zf, zfp : ', zf, zfp
-!                      WRITE(numout,*) ' dhicol  : ', -zf/zfp
-!                      WRITE(numout,*) ' hicol   : ', hicol(ji,jj)
-               !++++++++++++++++++++
-!              ENDIF
-
                iter = iter + 1
 
             END DO ! do while
-!         hicol(ji,jj) = MAX( hicol(ji,jj) , 0.03)
-!         WRITE(numout,*) ' zvrel2 : ', zvrel2, ' zvrel : ', SQRT(zvrel2), ' hicol : ',hicol(ji,jj)
 
           ENDIF ! end of selection of pixels where ice forms
-
-          !+++++++++++
-          IF ( hicol(ji,jj) .GT. 2.00 .OR. hicol(ji,jj) .LT. 0.0 ) THEN
-                  WRITE(numout,*) ' ALERTE 125 : hicol too bad '
-                  WRITE(numout,*) ' ji,jj : ', ji, jj
-                  WRITE(numout,*) ' lat   : ', gphit(ji,jj)
-                  WRITE(numout,*) ' lon   : ', glamt(ji,jj)
-                  WRITE(numout,*) ' hicol : ', hicol(ji,jj)
-          ENDIF
-          !+++++++++++
 
       END DO ! loop on ji ends
       END DO ! loop on jj ends
-
-      WRITE(numout,*) ' '
-      WRITE(numout,*) ' Apres calcul : '
-      WRITE(numout,*) ' hicol      :   ', hicol(jiindex,jjindex)
-      WRITE(numout,*) ' at_i       :   ', at_i(jiindex,jjindex)
 
       ENDIF ! End of computation of frazil ice collection thickness
@@ -489,14 +403,4 @@
         END DO
         IF ( fraz_swi .EQ. 1.0 ) zh_newice(:) = hicol_b(:)
-
-        !+++++++++++++
-        DO ji = 1, nbpac
-           IF (zh_newice(ji) .LE. 0.0) THEN
-              zji                  = MOD( npac(ji) - 1, jpi ) + 1
-              zjj                  = ( npac(ji) - 1 ) / jpi + 1
-              WRITE(numout,*) ' collection thickness  <= 0 ', zh_newice(ji), ji, zji, zjj
-           ENDIF
-        END DO
-        !+++++++++++++
 
         !----------------------
@@ -563,4 +467,25 @@
            zv_newice(ji) = ( 1.0 - zfrazb ) * zv_newice(ji)
         END DO
+
+        !---------------------------------
+        ! Salt flux due to new ice growth
+        !---------------------------------
+        IF ( ( num_sal .EQ. 4 ) ) THEN 
+           DO ji = 1, nbpac
+              zji            = MOD( npac(ji) - 1, jpi ) + 1
+              zjj            = ( npac(ji) - 1 ) / jpi + 1
+              fseqv_1d(ji)   = fseqv_1d(ji) +                                     &
+                               ( sss_io(zji,zjj) - bulk_sal      ) * rhoic *      &
+                               zv_newice(ji) / rdt_ice
+           END DO
+        ELSE
+           DO ji = 1, nbpac
+              zji            = MOD( npac(ji) - 1, jpi ) + 1
+              zjj            = ( npac(ji) - 1 ) / jpi + 1
+              fseqv_1d(ji)   = fseqv_1d(ji) +                                     &
+                               ( sss_io(zji,zjj) - zs_newice(ji) ) * rhoic *      &
+                               zv_newice(ji) / rdt_ice
+           END DO ! ji
+        ENDIF
 
         !------------------------------------
@@ -804,24 +729,4 @@
         ENDIF ! num_sal
   
-        !---------------------------------
-        ! Salt flux due to new ice growth
-        !---------------------------------
-        IF ( ( num_sal .EQ. 4 ) ) THEN 
-           DO ji = 1, nbpac
-              zji            = MOD( npac(ji) - 1, jpi ) + 1
-              zjj            = ( npac(ji) - 1 ) / jpi + 1
-              fseqv_1d(ji)   = fseqv_1d(ji) +                                     &
-                               ( sss_io(zji,zjj) - bulk_sal      ) * rhoic *      &
-                               zv_newice(ji) / rdt_ice
-           END DO
-        ELSE
-           DO ji = 1, nbpac
-              zji            = MOD( npac(ji) - 1, jpi ) + 1
-              zjj            = ( npac(ji) - 1 ) / jpi + 1
-              fseqv_1d(ji)   = fseqv_1d(ji) +                                     &
-                               ( sss_io(zji,zjj) - zs_newice(ji) ) * rhoic *      &
-                               zv_newice(ji) / rdt_ice
-           END DO ! ji
-        ENDIF
 
 !------------------------------------------------------------------------------!
