Index: trunk/NEMO/OPA_SRC/SBC/sbccpl.F90
===================================================================
--- trunk/NEMO/OPA_SRC/SBC/sbccpl.F90	(revision 1308)
+++ trunk/NEMO/OPA_SRC/SBC/sbccpl.F90	(revision 1463)
@@ -816,8 +816,7 @@
    
 
-   SUBROUTINE sbc_cpl_ice_flx( p_frld, palbi   , psst    , pist,   &
-      &                                pqns_tot, pqns_ice,         &
-      &                                pqsr_tot, pqsr_ice,         &
-      &                                pemp_tot, pemp_ice, pdqns_ice, psprecip )
+   SUBROUTINE sbc_cpl_ice_flx( p_frld  , palbi   , psst     , pist    ,   &
+      &                        pqns_tot, pqns_ice, pqsr_tot , pqsr_ice,   &
+      &                        pemp_tot, pemp_ice, pdqns_ice, psprecip )
       !!----------------------------------------------------------------------
       !!             ***  ROUTINE sbc_cpl_ice_flx_rcv  ***
@@ -863,16 +862,16 @@
       !!                   wndm                10m wind module
       !!----------------------------------------------------------------------
-      REAL(wp), INTENT(in   ), DIMENSION(jpi,jpj) ::   p_frld     ! lead fraction                [0 to 1]
-      REAL(wp), INTENT(in   ), DIMENSION(jpi,jpj) ::   palbi      ! ice albedo
-      REAL(wp), INTENT(in   ), DIMENSION(jpi,jpj) ::   psst       ! sea surface temperature      [Celcius]
-      REAL(wp), INTENT(in   ), DIMENSION(jpi,jpj) ::   pist       ! ice surface temperature      [Kelvin]
-      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   pqns_tot   ! total non solar heat flux    [W/m2]
-      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   pqns_ice   ! ice   non solar heat flux    [W/m2]
-      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   pqsr_tot   ! total     solar heat flux    [W/m2]
-      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   pqsr_ice   ! ice       solar heat flux    [W/m2]
-      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   pemp_tot   ! total     freshwater budget        [Kg/m2/s]
-      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   pemp_ice   ! solid freshwater budget over ice   [Kg/m2/s]
-      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   psprecip   ! Net solid precipitation (=emp_ice) [Kg/m2/s]
-      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   pdqns_ice  ! d(Q non solar)/d(Temperature) over ice
+      REAL(wp), INTENT(in   ), DIMENSION(jpi,jpj,jpl) ::   p_frld     ! lead fraction                [0 to 1]
+      REAL(wp), INTENT(in   ), DIMENSION(jpi,jpj,jpl) ::   palbi      ! ice albedo
+      REAL(wp), INTENT(in   ), DIMENSION(jpi,jpj    ) ::   psst       ! sea surface temperature      [Celcius]
+      REAL(wp), INTENT(in   ), DIMENSION(jpi,jpj,jpl) ::   pist       ! ice surface temperature      [Kelvin]
+      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj    ) ::   pqns_tot   ! total non solar heat flux    [W/m2]
+      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj,jpl) ::   pqns_ice   ! ice   non solar heat flux    [W/m2]
+      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj    ) ::   pqsr_tot   ! total     solar heat flux    [W/m2]
+      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj,jpl) ::   pqsr_ice   ! ice       solar heat flux    [W/m2]
+      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj    ) ::   pemp_tot   ! total     freshwater budget        [Kg/m2/s]
+      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj    ) ::   pemp_ice   ! solid freshwater budget over ice   [Kg/m2/s]
+      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj    ) ::   psprecip   ! Net solid precipitation (=emp_ice) [Kg/m2/s]
+      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj,jpl) ::   pdqns_ice  ! d(Q non solar)/d(Temperature) over ice
      !!
       INTEGER ::   ji, jj           ! dummy loop indices
@@ -895,5 +894,5 @@
          zsnow   (:,:) = frcv(:,:,jpr_snow)
       CASE( 'oce and ice'   )   ! received fields: jpr_sbpr, jpr_semp, jpr_oemp
-         pemp_tot(:,:) = p_frld(:,:) * frcv(:,:,jpr_oemp) + (1.- p_frld(:,:)) * frcv(:,:,jpr_sbpr) 
+         pemp_tot(:,:) = p_frld(:,:,1) * frcv(:,:,jpr_oemp) + (1.- p_frld(:,:,1)) * frcv(:,:,jpr_sbpr) 
          pemp_ice(:,:) = frcv(:,:,jpr_semp)
          zsnow   (:,:) = - frcv(:,:,jpr_semp) + frcv(:,:,jpr_ievp)
@@ -925,18 +924,19 @@
       !                                                      ! ========================= !
       CASE( 'conservative' )                                      ! the required fields are directly provided
-         pqns_tot(:,:) = frcv(:,:,jpr_qnsmix)
-         pqns_ice(:,:) = frcv(:,:,jpr_qnsice)
+         pqns_tot(:,:  ) = frcv(:,:,jpr_qnsmix)
+         pqns_ice(:,:,1) = frcv(:,:,jpr_qnsice)
       CASE( 'oce and ice' )       ! the total flux is computed from ocean and ice fluxes
-         pqns_tot(:,:) =  p_frld(:,:) * frcv(:,:,jpr_qnsoce) + ( 1.- p_frld(:,:) ) * frcv(:,:,jpr_qnsice)
-         pqns_ice(:,:) =  frcv(:,:,jpr_qnsice)
+         pqns_tot(:,:  ) =  p_frld(:,:,1) * frcv(:,:,jpr_qnsoce) + ( 1.- p_frld(:,:,1) ) * frcv(:,:,jpr_qnsice)
+         pqns_ice(:,:,1) =  frcv(:,:,jpr_qnsice)
       CASE( 'mixed oce-ice' )     ! the ice flux is cumputed from the total flux, the SST and ice informations
-         pqns_tot(:,:) = frcv(:,:,jpr_qnsmix)
-         pqns_ice(:,:) = frcv(:,:,jpr_qnsmix)    &
-            &          + frcv(:,:,jpr_dqnsdt) * ( pist(:,:) - ( (rt0 + psst(:,:))*p_frld(:,:) + pist(:,:)*(1. - p_frld(:,:)) ) )
+         pqns_tot(:,:  ) = frcv(:,:,jpr_qnsmix)
+         pqns_ice(:,:,1) = frcv(:,:,jpr_qnsmix)    &
+            &            + frcv(:,:,jpr_dqnsdt) * ( pist(:,:,1) - ( (rt0 + psst(:,:  ) ) *        p_frld(:,:,1)   &
+            &                                                   +          pist(:,:,1)   * ( 1. - p_frld(:,:,1) ) ) )
       END SELECT
       !                                                           ! snow melting heat flux ....
       !   energy for melting solid precipitation over free ocean
       zcoef = xlsn / rhosn
-      pqns_tot(:,:) = pqns_tot(:,:) - p_frld(:,:) * zsnow(:,:) * zcoef
+      pqns_tot(:,:) = pqns_tot(:,:) - p_frld(:,:,1) * zsnow(:,:) * zcoef
 !!gm
 !!    currently it is taken into account in leads budget but not in the qns_tot, and thus not in 
@@ -951,16 +951,16 @@
       !                                                      ! ========================= !
       CASE( 'conservative' )
-         pqsr_tot(:,:) = frcv(:,:,jpr_qsrmix)
-         pqsr_ice(:,:) = frcv(:,:,jpr_qsrice)
+         pqsr_tot(:,:  ) = frcv(:,:,jpr_qsrmix)
+         pqsr_ice(:,:,1) = frcv(:,:,jpr_qsrice)
       CASE( 'oce and ice' )
-         pqsr_tot(:,:) =  p_frld(:,:) * frcv(:,:,jpr_qsroce) + ( 1.- p_frld(:,:) ) * frcv(:,:,jpr_qsrice)
-         pqsr_ice(:,:) =  frcv(:,:,jpr_qsrice)
+         pqsr_tot(:,:  ) =  p_frld(:,:,1) * frcv(:,:,jpr_qsroce) + ( 1.- p_frld(:,:,1) ) * frcv(:,:,jpr_qsrice)
+         pqsr_ice(:,:,1) =  frcv(:,:,jpr_qsrice)
       CASE( 'mixed oce-ice' )
-         pqsr_tot(:,:) = frcv(:,:,jpr_qsrmix)
+         pqsr_tot(:,:  ) = frcv(:,:,jpr_qsrmix)
 !       Create solar heat flux over ice using incoming solar heat flux and albedos
 !       ( see OASIS3 user guide, 5th edition, p39 )
-         pqsr_ice(:,:) = frcv(:,:,jpr_qsrmix) * ( 1.- palbi(:,:) )   &
-            &          / (  1.- ( albedo_oce_mix(:,:) * ( 1.- p_frld(:,:) )   &
-            &                   + palbi         (:,:) *       p_frld(:,:)   )  )
+         pqsr_ice(:,:,1) = frcv(:,:,jpr_qsrmix) * ( 1.- palbi(:,:,1) )   &
+            &            / (  1.- ( albedo_oce_mix(:,:  ) * ( 1.- p_frld(:,:,1) )   &
+            &                     + palbi         (:,:,1) *       p_frld(:,:,1)   )  )
       END SELECT
 
@@ -968,5 +968,5 @@
       SELECT CASE( TRIM( cn_rcv_dqnsdt ) )
       CASE ('coupled')
-          pdqns_ice(:,:) = frcv(:,:,jpr_dqnsdt)
+          pdqns_ice(:,:,1) = frcv(:,:,jpr_dqnsdt)
       END SELECT
 
@@ -1009,6 +1009,6 @@
       CASE( 'oce only'             )   ;   ztmp1(:,:) =   tn(:,:,1) + rt0
       CASE( 'weighted oce and ice' )   ;   ztmp1(:,:) = ( tn(:,:,1) + rt0 ) * zfr_l(:,:)   
-                                           ztmp2(:,:) =   tn_ice(:,:)       *  fr_i(:,:)
-      CASE( 'mixed oce-ice'        )   ;   ztmp1(:,:) = ( tn(:,:,1) + rt0 ) * zfr_l(:,:) + tn_ice(:,:) * fr_i(:,:)
+                                           ztmp2(:,:) =   tn_ice(:,:,1)     *  fr_i(:,:)
+      CASE( 'mixed oce-ice'        )   ;   ztmp1(:,:) = ( tn(:,:,1) + rt0 ) * zfr_l(:,:) + tn_ice(:,:,1) * fr_i(:,:)
       CASE default                     ;   CALL ctl_stop( 'sbc_cpl_snd: wrong definition of cn_snd_temperature' )
       END SELECT
@@ -1021,9 +1021,9 @@
       !                                                      ! ------------------------- !
       IF( ssnd(jps_albice)%laction ) THEN                         ! ice 
-         ztmp1(:,:) = alb_ice(:,:) * fr_i(:,:)
+         ztmp1(:,:) = alb_ice(:,:,1) * fr_i(:,:)
          CALL cpl_prism_snd( jps_albice, isec, ztmp1, info )
       ENDIF
       IF( ssnd(jps_albmix)%laction ) THEN                         ! mixed ice-ocean
-         ztmp1(:,:) = albedo_oce_mix(:,:) * zfr_l(:,:) + alb_ice(:,:) * fr_i(:,:)
+         ztmp1(:,:) = albedo_oce_mix(:,:) * zfr_l(:,:) + alb_ice(:,:,1) * fr_i(:,:)
          CALL cpl_prism_snd( jps_albmix, isec, ztmp1, info )
       ENDIF
@@ -1155,25 +1155,24 @@
    END SUBROUTINE sbc_cpl_ice_tau
    !
-   SUBROUTINE sbc_cpl_ice_flx( p_frld, palbi   , psst    , pist,   &
-      &                                pqns_tot, pqns_ice,         &
-      &                                pqsr_tot, pqsr_ice,         &
-      &                                pemp_tot, pemp_ice, pdqns_ice, psprecip )
-      REAL(wp), INTENT(in   ), DIMENSION(:,:) ::   p_frld     ! lead fraction                [0 to 1]
-      REAL(wp), INTENT(in   ), DIMENSION(:,:) ::   palbi      ! ice albedo
-      REAL(wp), INTENT(in   ), DIMENSION(:,:) ::   psst       ! sea surface temperature      [Celcius]
-      REAL(wp), INTENT(in   ), DIMENSION(:,:) ::   pist       ! ice surface temperature      [Celcius]
-      REAL(wp), INTENT(  out), DIMENSION(:,:) ::   pqns_tot   ! total non solar heat flux    [W/m2]
-      REAL(wp), INTENT(  out), DIMENSION(:,:) ::   pqns_ice   ! ice   non solar heat flux    [W/m2]
-      REAL(wp), INTENT(  out), DIMENSION(:,:) ::   pqsr_tot   ! total     solar heat flux    [W/m2]
-      REAL(wp), INTENT(  out), DIMENSION(:,:) ::   pqsr_ice   ! ice       solar heat flux    [W/m2]
-      REAL(wp), INTENT(  out), DIMENSION(:,:) ::   pemp_tot   ! total     freshwater budget  [Kg/m2/s]
-      REAL(wp), INTENT(  out), DIMENSION(:,:) ::   pemp_ice   ! ice solid freshwater budget  [Kg/m2/s]
-      REAL(wp), INTENT(  out), DIMENSION(:,:) ::   pdqns_ice  ! d(Q non solar)/d(Temperature) over ice
-      REAL(wp), INTENT(  out), DIMENSION(:,:) ::   psprecip   ! solid precipitation          [Kg/m2/s]
-      WRITE(*,*) 'sbc_cpl_snd: You should not have seen this print! error?', p_frld(1,1), palbi(1,1), psst(1,1), pist(1,1)
+   SUBROUTINE sbc_cpl_ice_flx( p_frld  , palbi   , psst     , pist    ,   &
+      &                        pqns_tot, pqns_ice, pqsr_tot , pqsr_ice,   &
+      &                        pemp_tot, pemp_ice, pdqns_ice, psprecip )
+      REAL(wp), INTENT(in   ), DIMENSION(:,:,:) ::   p_frld     ! lead fraction                [0 to 1]
+      REAL(wp), INTENT(in   ), DIMENSION(:,:,:) ::   palbi      ! ice albedo
+      REAL(wp), INTENT(in   ), DIMENSION(:,:  ) ::   psst       ! sea surface temperature      [Celcius]
+      REAL(wp), INTENT(in   ), DIMENSION(:,:,:) ::   pist       ! ice surface temperature      [Kelvin]
+      REAL(wp), INTENT(  out), DIMENSION(:,:  ) ::   pqns_tot   ! total non solar heat flux    [W/m2]
+      REAL(wp), INTENT(  out), DIMENSION(:,:,:) ::   pqns_ice   ! ice   non solar heat flux    [W/m2]
+      REAL(wp), INTENT(  out), DIMENSION(:,:  ) ::   pqsr_tot   ! total     solar heat flux    [W/m2]
+      REAL(wp), INTENT(  out), DIMENSION(:,:,:) ::   pqsr_ice   ! ice       solar heat flux    [W/m2]
+      REAL(wp), INTENT(  out), DIMENSION(:,:  ) ::   pemp_tot   ! total     freshwater budget  [Kg/m2/s]
+      REAL(wp), INTENT(  out), DIMENSION(:,:  ) ::   pemp_ice   ! ice solid freshwater budget  [Kg/m2/s]
+      REAL(wp), INTENT(  out), DIMENSION(:,:,:) ::   pdqns_ice  ! d(Q non solar)/d(Temperature) over ice
+      REAL(wp), INTENT(  out), DIMENSION(:,:  ) ::   psprecip   ! solid precipitation          [Kg/m2/s]
+      WRITE(*,*) 'sbc_cpl_snd: You should not have seen this print! error?', p_frld(1,1,1), palbi(1,1,1), psst(1,1), pist(1,1,1)
       ! stupid definition to avoid warning message when compiling...
-      pqns_tot(:,:) = 0. ; pqns_ice(:,:) = 0. ; pdqns_ice(:,:) = 0.
-      pqsr_tot(:,:) = 0. ; pqsr_ice(:,:) = 0. 
-      pemp_tot(:,:) = 0. ; pemp_ice(:,:) = 0. ; psprecip(:,:) = 0.
+      pqns_tot(:,:) = 0. ; pqns_ice(:,:,:) = 0. ; pdqns_ice(:,:,:) = 0.
+      pqsr_tot(:,:) = 0. ; pqsr_ice(:,:,:) = 0. 
+      pemp_tot(:,:) = 0. ; pemp_ice(:,:)   = 0. ; psprecip(:,:) = 0.
    END SUBROUTINE sbc_cpl_ice_flx
    
