Index: trunk/NEMO/OPA_SRC/SBC/albedo.F90
===================================================================
--- trunk/NEMO/OPA_SRC/SBC/albedo.F90	(revision 699)
+++ trunk/NEMO/OPA_SRC/SBC/albedo.F90	(revision 703)
@@ -4,49 +4,46 @@
    !! Ocean forcing:  bulk thermohaline forcing of the ocean (or ice)
    !!=====================================================================
-   !!----------------------------------------------------------------------
-   !!   flx_blk_albedo : albedo for ocean and ice (clear and overcast skies)
-   !!----------------------------------------------------------------------
-   !! * Modules used
+   !! History :  8.0  !  01-04  (LIM 1.0)
+   !!            8.5  !  03-07  (C. Ethe, G. Madec)  Optimization (old name:shine)
+   !!            9.0  !  04-11  (C. Talandier)  add albedo_init
+   !!            9.0  !  06-08  (G. Madec)  cleaning for surface module
+   !!----------------------------------------------------------------------
+
+   !!----------------------------------------------------------------------
+   !!   blk_albedo  : albedo for ocean and ice (clear and overcast skies)
+   !!   albedo_init : initialisation
+   !!----------------------------------------------------------------------
    USE oce             ! ocean dynamics and tracers
-   USE dom_oce         ! ocean space and time domain
-   USE cpl_oce         ! ???
    USE phycst          ! physical constants
-   USE daymod
-   USE blk_oce         ! bulk variables
-   USE flx_oce         ! forcings variables
-   USE ocfzpt          ! ???
    USE in_out_manager
-   USE lbclnk
 
    IMPLICIT NONE
    PRIVATE
 
-   !! * Accessibility
-   PUBLIC flx_blk_albedo ! routine called by limflx.F90 in coupled
-                         ! and in flxblk.F90 in forced
-   !! * Module variables
-   INTEGER  ::             &  !: nameos : ocean physical parameters
-      albd_init = 0           !: control flag for initialization
-
-   REAL(wp)  ::            &  ! constant values
-      zzero   = 0.e0    ,  &
-      zone    = 1.0
-
-   !! * constants for albedo computation (flx_blk_albedo)
+   PUBLIC   blk_albedo   ! routine called by sbcice_lim module
+
+   INTEGER  ::   albd_init = 0    !: control flag for initialization
+
+   REAL(wp) ::   zzero   = 0.e0   ! constant values
+   REAL(wp) ::   zone    = 1.e0   !    "       "
+
+   REAL(wp) ::   c1     = 0.05    ! constants values
+   REAL(wp) ::   c2     = 0.10    !    "        "
+   REAL(wp) ::   cmue   = 0.40    !  cosine of local solar altitude
+
+   !!* namelist namalb
    REAL(wp) ::   &
-      c1     = 0.05  ,     &   ! constants values
-      c2     = 0.10  ,     &
+      cgren  = 0.06  ,     &   !  correction of the snow or ice albedo to take into account
+      !                        !  effects of cloudiness (Grenfell & Perovich, 1984)
       albice = 0.50  ,     &   !  albedo of melting ice in the arctic and antarctic (Shine & Hendersson-Sellers)
-      cgren  = 0.06  ,     &   !  correction of the snow or ice albedo to take into account
-                               !  effects of cloudiness (Grenfell & Perovich, 1984)
       alphd  = 0.80  ,     &   !  coefficients for linear interpolation used to compute
       alphdi = 0.72  ,     &   !  albedo between two extremes values (Pyane, 1972)
-      alphc  = 0.65  ,     &
-      zmue   = 0.40            !  cosine of local solar altitude
-
-   !!----------------------------------------------------------------------
-   !!   OPA 9.0 , LOCEAN-IPSL (2005) 
+      alphc  = 0.65 
+   NAMELIST/namalb/ cgren, albice, alphd, alphdi, alphc
+
+   !!----------------------------------------------------------------------
+   !!   OPA 9.0 , LOCEAN-IPSL (2006) 
    !! $Id$
-   !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt 
+   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
 
@@ -58,37 +55,26 @@
    !!----------------------------------------------------------------------
 
-   SUBROUTINE flx_blk_albedo( palb , palcn , palbp , palcnp )
-      !!----------------------------------------------------------------------
-      !!               ***  ROUTINE flx_blk_albedo  ***
+   SUBROUTINE blk_albedo( palb , palcn , palbp , palcnp )
+      !!----------------------------------------------------------------------
+      !!               ***  ROUTINE blk_albedo  ***
       !!          
       !! ** Purpose :   Computation of the albedo of the snow/ice system 
-      !!      as well as the ocean one
+      !!                as well as the ocean one
       !!       
       !! ** Method  : - Computation of the albedo of snow or ice (choose the 
-      !!      rignt one by a large number of tests
+      !!                rignt one by a large number of tests
       !!              - Computation of the albedo of the ocean
       !!
-      !! References :
-      !!      Shine and Hendersson-Sellers 1985, JGR, 90(D1), 2243-2250.
-      !!
-      !! History :
-      !!  8.0   !  01-04  (LIM 1.0)
-      !!  8.5   !  03-07  (C. Ethe, G. Madec)  Optimization (old name:shine)
-      !!----------------------------------------------------------------------
-      !! * Modules used
-      USE ice                   ! ???
-
-      !! * Arguments
-      REAL(wp), DIMENSION(jpi,jpj), INTENT(out) ::  &
-         palb         ,     &    !  albedo of ice under overcast sky
-         palcn        ,     &    !  albedo of ocean under overcast sky
-         palbp        ,     &    !  albedo of ice under clear sky 
-         palcnp                  !  albedo of ocean under clear sky
-
-      !! * Local variables
-      INTEGER ::    &
-         ji, jj                   ! dummy loop indices
-      REAL(wp) ::   & 
-         zmue14         ,     &   !  zmue**1.4
+      !! References :   Shine and Hendersson-Sellers 1985, JGR, 90(D1), 2243-2250.
+      !!----------------------------------------------------------------------
+      USE ice             ! ???
+      !!
+      REAL(wp), INTENT(out), DIMENSION(jpi,jpj) ::   palb     ! albedo of ice under overcast sky
+      REAL(wp), INTENT(out), DIMENSION(jpi,jpj) ::   palcn    ! albedo of ocean under overcast sky
+      REAL(wp), INTENT(out), DIMENSION(jpi,jpj) ::   palbp    ! albedo of ice under clear sky 
+      REAL(wp), INTENT(out), DIMENSION(jpi,jpj) ::   palcnp   ! albedo of ocean under clear sky
+      !!
+      INTEGER  ::   ji, jj                   ! dummy loop indices
+      REAL(wp) ::   zcoef,    &   ! temporary scalar
          zalbpsnm       ,     &   !  albedo of ice under clear sky when snow is melting
          zalbpsnf       ,     &   !  albedo of ice under clear sky when snow is freezing
@@ -99,17 +85,14 @@
          zihsc1         ,     &   !  = 1 hsn <= c1 ; = 0 hsn > c1
          zihsc2                   !  = 1 hsn >= c2 ; = 0 hsn < c2
-      REAL(wp), DIMENSION(jpi,jpj) ::  &
-         zalbfz         ,     &   !  ( = alphdi for freezing ice ; = albice for melting ice )
-         zficeth                  !  function of ice thickness
-      LOGICAL , DIMENSION(jpi,jpj) ::  &
-         llmask
+      LOGICAL , DIMENSION(jpi,jpj) ::   llmask    ! 
+      REAL(wp), DIMENSION(jpi,jpj) ::   zalbfz    ! ( = alphdi for freezing ice ; = albice for melting ice )
+      REAL(wp), DIMENSION(jpi,jpj) ::   zficeth   ! function of ice thickness
       !!---------------------------------------------------------------------
       
-      ! initialization 
-      IF( albd_init == 0 )   CALL albedo_init
-
-      !-------------------------                                                             
+      IF( albd_init == 0 )   CALL albedo_init      ! initialization 
+
+      !---------------------------
       !  Computation of  zficeth
-      !-------------------------- 
+      !---------------------------
       
       llmask = (hsnif == 0.e0) .AND. ( sist >= rt0_ice )
@@ -175,12 +158,9 @@
       !-------------------------- -----------------                                                          
       
-      !  Parameterization of Briegled and Ramanathan, 1982 
-      zmue14      = zmue**1.4                                       
-      palcnp(:,:) = 0.05 / ( 1.1 * zmue14 + 0.15 )                
-      
-      !  Parameterization of Kondratyev, 1969 and Payne, 1972
-      palcn(:,:)  = 0.06                                                 
-      
-   END SUBROUTINE flx_blk_albedo
+      zcoef = 0.05 / ( 1.1 * cmue**1.4 + 0.15 )        ! Parameterization of Briegled and Ramanathan, 1982 
+      palcnp(:,:) = zcoef
+      palcn(:,:)  = 0.06                               ! Parameterization of Kondratyev, 1969 and Payne, 1972
+      !
+   END SUBROUTINE blk_albedo
 
 # else
@@ -189,45 +169,29 @@
    !!----------------------------------------------------------------------
 
-   SUBROUTINE flx_blk_albedo( palb , palcn , palbp , palcnp )
-      !!----------------------------------------------------------------------
-      !!               ***  ROUTINE flx_blk_albedo  ***
+   SUBROUTINE blk_albedo( palb , palcn , palbp , palcnp )
+      !!----------------------------------------------------------------------
+      !!               ***  ROUTINE blk_albedo  ***
       !! 
-      !! ** Purpose :   Computation of the albedo of the snow/ice system
-      !!      as well as the ocean one
-      !!
-      !! ** Method  :   Computation of the albedo of snow or ice (choose the
-      !!      wright one by a large number of tests Computation of the albedo
-      !!      of the ocean
-      !!
-      !! History :
-      !!  8.0   !  01-04  (LIM 1.0)
-      !!  8.5   !  03-07  (C. Ethe, G. Madec)  Optimization (old name:shine)
-      !!----------------------------------------------------------------------
-      !! * Arguments
-      REAL(wp), DIMENSION(jpi,jpj), INTENT(out) ::  &
-         palb         ,     &    !  albedo of ice under overcast sky
-         palcn        ,     &    !  albedo of ocean under overcast sky
-         palbp        ,     &    !  albedo of ice under clear sky
-         palcnp                  !  albedo of ocean under clear sky
-
-      REAL(wp) ::   &
-         zmue14                 !  zmue**1.4
-      !!----------------------------------------------------------------------
-
-      !--------------------------------------------
-      !    Computation of the albedo of the ocean
-      !-------------------------- -----------------
-
-      !  Parameterization of Briegled and Ramanathan, 1982
-      zmue14      = zmue**1.4
-      palcnp(:,:) = 0.05 / ( 1.1 * zmue14 + 0.15 )
-
-      !  Parameterization of Kondratyev, 1969 and Payne, 1972
-      palcn(:,:)  = 0.06
-
-      palb (:,:)  = palcn(:,:)
-      palbp(:,:)  = palcnp(:,:)
-
-   END SUBROUTINE flx_blk_albedo
+      !! ** Purpose :   Computation of the albedo of the ocean
+      !!
+      !! ** Method  :   ....
+      !!----------------------------------------------------------------------
+      REAL(wp), INTENT(out), DIMENSION(jpi,jpj) ::   palb     ! albedo of ice under overcast sky
+      REAL(wp), INTENT(out), DIMENSION(jpi,jpj) ::   palcn    ! albedo of ocean under overcast sky
+      REAL(wp), INTENT(out), DIMENSION(jpi,jpj) ::   palbp    ! albedo of ice under clear sky
+      REAL(wp), INTENT(out), DIMENSION(jpi,jpj) ::   palcnp   ! albedo of ocean under clear sky
+      !!
+      REAL(wp) ::   zcoef    ! temporary scalar
+      !!----------------------------------------------------------------------
+      !
+      zcoef = 0.05 / ( 1.1 * cmue**1.4 + 0.15 )
+
+      palcnp(:,:) = zcoef           ! Parameterization of Briegled and Ramanathan, 1982
+      palcn(:,:)  = 0.06            ! Parameterization of Kondratyev, 1969 and Payne, 1972
+
+      palb (:,:)  = zcoef           ! ice overcast  albedo set to oceanvalue
+      palbp(:,:)  = 0.06            ! ice clear sky albedo set to oceanvalue
+      !
+   END SUBROUTINE blk_albedo
 
 #endif
@@ -240,39 +204,24 @@
       !!
       !! ** Method  :   Read the namelist namalb
-      !!
-      !! ** Action  :  
-      !!
-      !!
-      !! History :
-      !!   9.0  !  04-11  (C. Talandier)  Original code
-      !!----------------------------------------------------------------------
-      NAMELIST/namalb/ cgren, albice, alphd, alphdi, alphc
-      !!----------------------------------------------------------------------
-      !!  OPA 9.0, LODYC-IPSL (2004)
-      !!----------------------------------------------------------------------
-
-      ! set the initialization flag to 1
-      albd_init = 1           ! indicate that the initialization has been done
-
-      ! Read Namelist namalb : albedo parameters
-      REWIND( numnam )
+      !!----------------------------------------------------------------------
+      !
+      albd_init = 1              ! set the initialization flag to 1 (done)
+
+      REWIND( numnam )           ! Read Namelist namalb : albedo parameters
       READ  ( numnam, namalb )
 
-      ! Control print
-      IF(lwp) THEN
+      IF(lwp) THEN               ! Control print
          WRITE(numout,*)
-         WRITE(numout,*) 'albedo_init : albedo '
+         WRITE(numout,*) 'albedo_init : set albedo parameters from namelist namalb'
          WRITE(numout,*) '~~~~~~~~~~~'
-         WRITE(numout,*) '          Namelist namalb : set albedo parameters'
-         WRITE(numout,*)
-         WRITE(numout,*) '             correction of the snow or ice albedo to take into account cgren = ', cgren
-         WRITE(numout,*) '             albedo of melting ice in the arctic and antarctic        albice = ', albice
-         WRITE(numout,*) '             coefficients for linear                                   alphd = ', alphd
-         WRITE(numout,*) '             interpolation used to compute albedo                     alphdi = ', alphdi
-         WRITE(numout,*) '             between two extremes values (Pyane, 1972)                 alphc = ', alphc
-         WRITE(numout,*)
+         WRITE(numout,*) '             correction for snow and ice albedo                    cgren  = ', cgren
+         WRITE(numout,*) '             albedo of melting ice in the arctic and antarctic     albice = ', albice
+         WRITE(numout,*) '             coefficients for linear                               alphd  = ', alphd
+         WRITE(numout,*) '             interpolation used to compute albedo                  alphdi = ', alphdi
+         WRITE(numout,*) '             between two extremes values (Pyane, 1972)             alphc  = ', alphc
       ENDIF
-
+      !
    END SUBROUTINE albedo_init
+
    !!======================================================================
 END MODULE albedo
