Index: NEMO/trunk/src/OCE/SBC/sbcblk_algo_ice_cdn.F90
===================================================================
--- NEMO/trunk/src/OCE/SBC/sbcblk_algo_ice_cdn.F90	(revision 15077)
+++ NEMO/trunk/src/OCE/SBC/sbcblk_algo_ice_cdn.F90	(revision 15079)
@@ -35,5 +35,4 @@
    !!============================================================
    REAL(wp), PARAMETER ::   rce10_i_0 = 3.46e-3_wp ! (Eq.48) MIZ
-
    REAL(wp), PARAMETER ::   ralpha_0  = 0.2_wp     ! (Eq.12) (ECHAM6 value)
 
@@ -61,14 +60,14 @@
       !!
       !!----------------------------------------------------------------------
-      REAL(wp), DIMENSION(jpi,jpj)                       :: CdN10_f_LU12  ! neutral FORM drag coefficient contribution over sea-ice
-      REAL(wp), DIMENSION(jpi,jpj), INTENT(in)           :: pfrice ! ice concentration [fraction]  => at_i_b  ! NOT USED if pSc, phf and pDi all provided...
-      REAL(wp), DIMENSION(jpi,jpj), INTENT(in)           :: pz0w   ! roughness length over water  [m]
-      REAL(wp), DIMENSION(jpi,jpj), INTENT(in), OPTIONAL :: pSc    ! shletering function [0-1] (Sc->1 for large distance between floes, ->0 for small distances)
-      REAL(wp), DIMENSION(jpi,jpj), INTENT(in), OPTIONAL :: phf    ! mean freeboard of floes    [m]
-      REAL(wp), DIMENSION(jpi,jpj), INTENT(in), OPTIONAL :: pDi    ! cross wind dimension of the floe (aka effective edge length for form drag)   [m]
-      !!----------------------------------------------------------------------
-      LOGICAL :: l_known_Sc=.FALSE., l_known_hf=.FALSE., l_known_Di=.FALSE.
-      REAL(wp) :: ztmp, zrlog, zfri, zfrw, zSc, zhf, zDi
-      INTEGER  :: ji, jj
+      REAL(wp), DIMENSION(jpi,jpj)                       ::   CdN10_f_LU12  ! neutral FORM drag coefficient contribution over sea-ice
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in)           ::   pfrice ! ice concentration [fraction]  => at_i_b  ! NOT USED if pSc, phf and pDi all provided...
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in)           ::   pz0w   ! roughness length over water  [m]
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in), OPTIONAL ::   pSc    ! shletering function [0-1] (Sc->1 for large distance between floes, ->0 for small distances)
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in), OPTIONAL ::   phf    ! mean freeboard of floes    [m]
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in), OPTIONAL ::   pDi    ! cross wind dimension of the floe (aka effective edge length for form drag)   [m]
+      !!----------------------------------------------------------------------
+      LOGICAL  ::   l_known_Sc=.FALSE., l_known_hf=.FALSE., l_known_Di=.FALSE.
+      REAL(wp) ::   ztmp, zrlog, zfri, zfrw, zSc, zhf, zDi
+      INTEGER  ::   ji, jj
       !!----------------------------------------------------------------------
       l_known_Sc    = PRESENT(pSc)
@@ -78,34 +77,34 @@
       DO_2D( nn_hls, nn_hls, nn_hls, nn_hls )
             
-            zfri = pfrice(ji,jj)
-            zfrw = (1._wp - zfri)
-
-            IF(l_known_Sc) THEN
-               zSc = pSc(ji,jj)
-            ELSE
-               !! Sc parameterized in terms of A (ice fraction):
-               zSc = zfrw**(1._wp / ( 10._wp * rBeta_0 ))   ! Eq.(31)
-            END IF
-
-            IF(l_known_hf) THEN
-               zhf = phf(ji,jj)
-            ELSE
-               !! hf parameterized in terms of A (ice fraction):
-               zhf = rhmax_0*zfri + rhmin_0*zfrw  ! Eq.(25)
-            END IF
-
-            IF(l_known_Di) THEN
-               zDi = pDi(ji,jj)
-            ELSE
-               !! Di parameterized in terms of A (ice fraction):
-               ztmp = 1._wp / ( 1._wp - (rDmin_0/rDmax_0)**(1._wp/rBeta_0) )   ! A* Eq.(27)
-               zDi =  rDmin_0 * ( ztmp/(ztmp - zfri) )**rBeta_0                !    Eq.(26)
-            END IF
-
-            ztmp  = 1._wp/pz0w(ji,jj)
-            zrlog = LOG(zhf*ztmp) / LOG(10._wp*ztmp)
-
-            CdN10_f_LU12(:,:) = 0.5_wp* 0.3_wp * zrlog*zrlog * zSc*zSc * zhf/zDi * zfri  ! Eq.(22)
-            !!                   1/2      Ce
+         zfri = pfrice(ji,jj)
+         zfrw = (1._wp - zfri)
+         
+         IF(l_known_Sc) THEN
+            zSc = pSc(ji,jj)
+         ELSE
+            !! Sc parameterized in terms of A (ice fraction):
+            zSc = zfrw**(1._wp / ( 10._wp * rBeta_0 ))   ! Eq.(31)
+         END IF
+         
+         IF(l_known_hf) THEN
+            zhf = phf(ji,jj)
+         ELSE
+            !! hf parameterized in terms of A (ice fraction):
+            zhf = rhmax_0*zfri + rhmin_0*zfrw  ! Eq.(25)
+         END IF
+         
+         IF(l_known_Di) THEN
+            zDi = pDi(ji,jj)
+         ELSE
+            !! Di parameterized in terms of A (ice fraction):
+            ztmp = 1._wp / ( 1._wp - (rDmin_0/rDmax_0)**(1._wp/rBeta_0) )   ! A* Eq.(27)
+            zDi =  rDmin_0 * ( ztmp/(ztmp - zfri) )**rBeta_0                !    Eq.(26)
+         END IF
+         
+         ztmp  = 1._wp/pz0w(ji,jj)
+         zrlog = LOG(zhf*ztmp) / LOG(10._wp*ztmp)
+
+         CdN10_f_LU12(ji,jj) = 0.5_wp* 0.3_wp * zrlog*zrlog * zSc*zSc * zhf/zDi * zfri  ! Eq.(22)
+         !!                    1/2      Ce
 
       END_2D
@@ -114,7 +113,8 @@
    
    FUNCTION CdN_f_LU12_eq36( pzu, pfrice )
-      REAL(wp), DIMENSION(jpi,jpj)             :: CdN_f_LU12_eq36 ! neutral FORM drag coefficient contribution over sea-ice
-      REAL(wp),                     INTENT(in) :: pzu    ! reference height                       [m]
-      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: pfrice ! ice concentration [fraction]  => at_i_b  ! NOT USED if pSc, phf and pDi all provided...
+      !!----------------------------------------------------------------------
+      REAL(wp), DIMENSION(jpi,jpj)             ::   CdN_f_LU12_eq36 ! neutral FORM drag coefficient contribution over sea-ice
+      REAL(wp),                     INTENT(in) ::   pzu    ! reference height                       [m]
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) ::   pfrice ! ice concentration [fraction]  => at_i_b  ! NOT USED if pSc, phf and pDi all provided...
       !!----------------------------------------------------------------------
       REAL(wp) :: ztmp, zrlog, zfri, zhf, zDi
@@ -129,13 +129,9 @@
 
       DO_2D( nn_hls, nn_hls, nn_hls, nn_hls )
-
-            zfri = pfrice(ji,jj)
-
-            CdN_f_LU12_eq36(:,:) = 0.5_wp* 0.3_wp * zrlog*zrlog * zhf/zDi  * (1._wp - zfri)**rBeta_0 ! Eq.(35) & (36)
-            !!                        1/2      Ce
+         zfri = pfrice(ji,jj)
+         CdN_f_LU12_eq36(ji,jj) = 0.5_wp* 0.3_wp * zrlog*zrlog * zhf/zDi  * (1._wp - zfri)**rBeta_0 ! Eq.(35) & (36)
+         !!                       1/2      Ce
       END_2D
    END FUNCTION CdN_f_LU12_eq36
-
-
 
 
@@ -172,9 +168,9 @@
       !!
       !!----------------------------------------------------------------------
-      REAL(wp), DIMENSION(jpi,jpj)              :: CdN10_f_LU13  ! neutral FORM drag coefficient contribution over sea-ice
-      REAL(wp), DIMENSION(jpi,jpj), INTENT(in)  :: pfrice           ! ice concentration [fraction]  => at_i_b
-
-      !!----------------------------------------------------------------------
-      REAL(wp)            ::   zcoef
+      REAL(wp), DIMENSION(jpi,jpj)              ::   CdN10_f_LU13  ! neutral FORM drag coefficient contribution over sea-ice
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in)  ::   pfrice           ! ice concentration [fraction]  => at_i_b
+      !!----------------------------------------------------------------------
+      INTEGER  ::   ji, jj
+      REAL(wp) ::   zcoef
       !!----------------------------------------------------------------------
       zcoef = rNu_0 + 1._wp / ( 10._wp * rBeta_0 )
@@ -183,6 +179,7 @@
       !!  => so we keep only the last rhs terms of Eq.(1) of Lupkes et al, 2013 that we divide by "A":
       !! (we multiply Cd_i_s and Cd_i_f by A later, when applying ocean-ice partitioning...
-
-      CdN10_f_LU13(:,:) = rCe_0 * pfrice(:,:)**(rMu_0 - 1._wp) * (1._wp - pfrice(:,:))**zcoef
+      DO_2D( nn_hls, nn_hls, nn_hls, nn_hls )
+         CdN10_f_LU13(ji,jj) = rCe_0 * pfrice(ji,jj)**(rMu_0 - 1._wp) * (1._wp - pfrice(ji,jj))**zcoef
+      END_2D
       !! => seems okay for winter 100% sea-ice as second rhs term vanishes as pfrice == 1....
 
@@ -207,15 +204,15 @@
       !!
       !!----------------------------------------------------------------------
-      REAL(wp), DIMENSION(jpi,jpj)                       :: CdN_f_LG15  ! neutral FORM drag coefficient contribution over sea-ice
-      REAL(wp),                     INTENT(in )          :: pzu    ! reference height                       [m]
-      REAL(wp), DIMENSION(jpi,jpj), INTENT(in)           :: pfrice ! ice concentration [fraction]  => at_i_b  ! NOT USED if pSc, phf and pDi all provided...
-      REAL(wp), DIMENSION(jpi,jpj), INTENT(in)           :: pz0i   ! roughness length over ICE  [m] (in LU12, it's over water ???)
-      REAL(wp), DIMENSION(jpi,jpj), INTENT(in), OPTIONAL :: pSc    ! shletering function [0-1] (Sc->1 for large distance between floes, ->0 for small distances)
-      REAL(wp), DIMENSION(jpi,jpj), INTENT(in), OPTIONAL :: phf    ! mean freeboard of floes    [m]
-      REAL(wp), DIMENSION(jpi,jpj), INTENT(in), OPTIONAL :: pDi    ! cross wind dimension of the floe (aka effective edge length for form drag)   [m]
-      !!----------------------------------------------------------------------
-      LOGICAL :: l_known_Sc=.FALSE., l_known_hf=.FALSE., l_known_Di=.FALSE.
-      REAL(wp) :: ztmp, zrlog, zfri, zfrw, zSc, zhf, zDi
-      INTEGER  :: ji, jj
+      REAL(wp), DIMENSION(jpi,jpj)                       ::   CdN_f_LG15  ! neutral FORM drag coefficient contribution over sea-ice
+      REAL(wp),                     INTENT(in )          ::   pzu    ! reference height                       [m]
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in)           ::   pfrice ! ice concentration [fraction]  => at_i_b  ! NOT USED if pSc, phf and pDi all provided...
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in)           ::   pz0i   ! roughness length over ICE  [m] (in LU12, it's over water ???)
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in), OPTIONAL ::   pSc    ! shletering function [0-1] (Sc->1 for large distance between floes, ->0 for small distances)
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in), OPTIONAL ::   phf    ! mean freeboard of floes    [m]
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in), OPTIONAL ::   pDi    ! cross wind dimension of the floe (aka effective edge length for form drag)   [m]
+      !!----------------------------------------------------------------------
+      LOGICAL  ::   l_known_Sc=.FALSE., l_known_hf=.FALSE., l_known_Di=.FALSE.
+      REAL(wp) ::   ztmp, zrlog, zfri, zfrw, zSc, zhf, zDi
+      INTEGER  ::   ji, jj
       !!----------------------------------------------------------------------
       l_known_Sc    = PRESENT(pSc)
@@ -225,40 +222,39 @@
       DO_2D( nn_hls, nn_hls, nn_hls, nn_hls )
 
-            zfri = pfrice(ji,jj)
-            zfrw = (1._wp - zfri)
-
-            IF(l_known_Sc) THEN
-               zSc = pSc(ji,jj)
-            ELSE
-               !! Sc parameterized in terms of A (ice fraction):
-               zSc = zfrw**(1._wp / ( 10._wp * rBeta_0 ))   ! Eq.(31)
-            END IF
-
-            IF(l_known_hf) THEN
-               zhf = phf(ji,jj)
-            ELSE
-               !! hf parameterized in terms of A (ice fraction):
-               zhf = rhmax_0*zfri + rhmin_0*zfrw  ! Eq.(25)
-            END IF
-
-            IF(l_known_Di) THEN
-               zDi = pDi(ji,jj)
-            ELSE
-               !! Di parameterized in terms of A (ice fraction):
-               ztmp = 1._wp / ( 1._wp - (rDmin_0/rDmax_0)**(1._wp/rBeta_0) )   ! A* Eq.(27)
-               zDi =  rDmin_0 * ( ztmp/(ztmp - zfri) )**rBeta_0                !    Eq.(26)
-            END IF
-
-            ztmp  = 1._wp/pz0i(ji,jj)
-            zrlog = LOG(zhf*ztmp/2.718_wp) / LOG(pzu*ztmp)  !LOLO: adding number "e" !!!
-
-            CdN_f_LG15(:,:) = 0.5_wp* 0.4_wp * zrlog*zrlog * zSc*zSc * zhf/zDi * zfri  ! Eq.(21) Lukes & Gryanik (2015)
-            !!                   1/2      Ce
-
+         zfri = pfrice(ji,jj)
+         zfrw = (1._wp - zfri)
+         
+         IF(l_known_Sc) THEN
+            zSc = pSc(ji,jj)
+         ELSE
+            !! Sc parameterized in terms of A (ice fraction):
+            zSc = zfrw**(1._wp / ( 10._wp * rBeta_0 ))   ! Eq.(31)
+         END IF
+         
+         IF(l_known_hf) THEN
+            zhf = phf(ji,jj)
+         ELSE
+            !! hf parameterized in terms of A (ice fraction):
+            zhf = rhmax_0*zfri + rhmin_0*zfrw  ! Eq.(25)
+         END IF
+         
+         IF(l_known_Di) THEN
+            zDi = pDi(ji,jj)
+         ELSE
+            !! Di parameterized in terms of A (ice fraction):
+            ztmp = 1._wp / ( 1._wp - (rDmin_0/rDmax_0)**(1._wp/rBeta_0) )   ! A* Eq.(27)
+            zDi =  rDmin_0 * ( ztmp/(ztmp - zfri) )**rBeta_0                !    Eq.(26)
+         END IF
+         
+         ztmp  = 1._wp/pz0i(ji,jj)
+         zrlog = LOG(zhf*ztmp/2.718_wp) / LOG(pzu*ztmp)  !LOLO: adding number "e" !!!
+         
+         CdN_f_LG15(ji,jj) = 0.5_wp* 0.4_wp * zrlog*zrlog * zSc*zSc * zhf/zDi * zfri  ! Eq.(21) Lukes & Gryanik (2015)
+         !!                   1/2      Ce
+         
       END_2D
    END FUNCTION CdN_f_LG15
 
 
-
    FUNCTION CdN_f_LG15_light( pzu, pfrice, pz0w )
       !!----------------------------------------------------------------------
@@ -275,24 +271,23 @@
       !!
       !!----------------------------------------------------------------------
-      REAL(wp), DIMENSION(jpi,jpj)             :: CdN_f_LG15_light  ! neutral FORM drag coefficient contribution over sea-ice
-      REAL(wp),                     INTENT(in) :: pzu    ! reference height [m]
-      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: pfrice ! ice concentration [fraction]  => at_i_b
-      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) :: pz0w   ! roughness length over water  [m]
-      !!----------------------------------------------------------------------
-      REAL(wp) :: ztmp, zrlog, zfri
-      INTEGER  :: ji, jj
-      !!----------------------------------------------------------------------
-      DO_2D( nn_hls, nn_hls, nn_hls, nn_hls )
-
-            zfri = pfrice(ji,jj)
-
-            ztmp = 1._wp / pz0w(ji,jj)
-            zrlog = LOG( 10._wp * ztmp ) / LOG( pzu * ztmp ) ! part of (Eq.46)
-
-            CdN_f_LG15_light(:,:) = rce10_i_0 *zrlog*zrlog * zfri * (1._wp - zfri)**rbeta_0  ! (Eq.46)  [ index 1 is for ice, 2 for water ]
+      REAL(wp), DIMENSION(jpi,jpj)             ::   CdN_f_LG15_light  ! neutral FORM drag coefficient contribution over sea-ice
+      REAL(wp),                     INTENT(in) ::   pzu    ! reference height [m]
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) ::   pfrice ! ice concentration [fraction]  => at_i_b
+      REAL(wp), DIMENSION(jpi,jpj), INTENT(in) ::   pz0w   ! roughness length over water  [m]
+      !!----------------------------------------------------------------------
+      REAL(wp) ::   ztmp, zrlog, zfri
+      INTEGER  ::   ji, jj
+      !!----------------------------------------------------------------------
+      DO_2D( nn_hls, nn_hls, nn_hls, nn_hls )
+
+         zfri = pfrice(ji,jj)
+         
+         ztmp = 1._wp / pz0w(ji,jj)
+         zrlog = LOG( 10._wp * ztmp ) / LOG( pzu * ztmp ) ! part of (Eq.46)
+         
+         CdN_f_LG15_light(ji,jj) = rce10_i_0 *zrlog*zrlog * zfri * (1._wp - zfri)**rbeta_0  ! (Eq.46)  [ index 1 is for ice, 2 for water ]
 
       END_2D
    END FUNCTION CdN_f_LG15_light
-
 
 
