Index: branches/dev_r2174_DCY/NEMO/OPA_SRC/SBC/sbcmod.F90
===================================================================
--- branches/dev_r2174_DCY/NEMO/OPA_SRC/SBC/sbcmod.F90	(revision 2187)
+++ branches/dev_r2174_DCY/NEMO/OPA_SRC/SBC/sbcmod.F90	(revision 2188)
@@ -4,6 +4,7 @@
    !! Surface module :  provide to the ocean its surface boundary condition
    !!======================================================================
-   !! History :  3.0   !  07-2006  (G. Madec)  Original code
-   !!             -    !  08-2008  (S. Masson, E. .... ) coupled interface
+   !! History :  3.0  !  2006-07  (G. Madec)  Original code
+   !!             -   !  2008-08  (S. Masson, E. .... ) coupled interface
+   !!            3.3  !  2010-10  (S. Masson)  add diurnal cycle
    !!----------------------------------------------------------------------
 
@@ -12,29 +13,28 @@
    !!   sbc            : surface ocean momentum, heat and freshwater boundary conditions
    !!----------------------------------------------------------------------
-   USE oce             ! ocean dynamics and tracers
-   USE dom_oce         ! ocean space and time domain
-   USE phycst          ! physical constants
-
-   USE sbc_oce         ! Surface boundary condition: ocean fields
-   USE sbc_ice         ! Surface boundary condition: ice fields
-   USE sbcssm          ! surface boundary condition: sea-surface mean variables
-   USE sbcana          ! surface boundary condition: analytical formulation
-   USE sbcflx          ! surface boundary condition: flux formulation
-   USE sbcblk_clio     ! surface boundary condition: bulk formulation : CLIO
-   USE sbcblk_core     ! surface boundary condition: bulk formulation : CORE
-   USE sbcice_if       ! surface boundary condition: ice-if sea-ice model
-   USE sbcice_lim      ! surface boundary condition: LIM 3.0 sea-ice model
-   USE sbcice_lim_2    ! surface boundary condition: LIM 2.0 sea-ice model
-   USE sbccpl          ! surface boundary condition: coupled florulation
+   USE oce              ! ocean dynamics and tracers
+   USE dom_oce          ! ocean space and time domain
+   USE phycst           ! physical constants
+   USE sbc_oce          ! Surface boundary condition: ocean fields
+   USE sbc_ice          ! Surface boundary condition: ice fields
+   USE sbcssm           ! surface boundary condition: sea-surface mean variables
+   USE sbcana           ! surface boundary condition: analytical formulation
+   USE sbcflx           ! surface boundary condition: flux formulation
+   USE sbcblk_clio      ! surface boundary condition: bulk formulation : CLIO
+   USE sbcblk_core      ! surface boundary condition: bulk formulation : CORE
+   USE sbcice_if        ! surface boundary condition: ice-if sea-ice model
+   USE sbcice_lim       ! surface boundary condition: LIM 3.0 sea-ice model
+   USE sbcice_lim_2     ! surface boundary condition: LIM 2.0 sea-ice model
+   USE sbccpl           ! surface boundary condition: coupled florulation
    USE cpl_oasis3, ONLY:lk_cpl      ! are we in coupled mode?
-   USE sbcssr          ! surface boundary condition: sea surface restoring
-   USE sbcrnf          ! surface boundary condition: runoffs
-   USE sbcfwb          ! surface boundary condition: freshwater budget
-   USE closea          ! closed sea
-
-   USE prtctl          ! Print control                    (prt_ctl routine)
-   USE restart         ! ocean restart
-   USE iom
-   USE in_out_manager  ! I/O manager
+   USE sbcssr           ! surface boundary condition: sea surface restoring
+   USE sbcrnf           ! surface boundary condition: runoffs
+   USE sbcfwb           ! surface boundary condition: freshwater budget
+   USE closea           ! closed sea
+
+   USE prtctl           ! Print control                    (prt_ctl routine)
+   USE restart          ! ocean restart
+   USE iom              ! IOM library
+   USE in_out_manager   ! I/O manager
 
    IMPLICIT NONE
@@ -49,9 +49,8 @@
 #  include "domzgr_substitute.h90"
    !!----------------------------------------------------------------------
-   !! NEMO/OPA 3.0 , LOCEAN-IPSL (2008) 
+   !! NEMO/OPA 3.3 , NEMO-consortium (2010) 
    !! $Id$
    !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
-
 CONTAINS
 
@@ -69,6 +68,6 @@
       INTEGER ::   icpt      ! temporary integer
       !!
-      NAMELIST/namsbc/ nn_fsbc, ln_ana, ln_flx, ln_blk_clio, ln_blk_core, ln_cpl,   &
-         &             nn_ice , ln_dm2dc, ln_rnf, ln_ssr, nn_fwb, nn_ico_cpl
+      NAMELIST/namsbc/ nn_fsbc, ln_ana  , ln_flx, ln_blk_clio, ln_blk_core, ln_cpl    ,   &
+         &             nn_ice , ln_dm2dc, ln_rnf, ln_ssr     , nn_fwb     , nn_ico_cpl
       !!----------------------------------------------------------------------
 
@@ -79,23 +78,18 @@
       ENDIF
 
-      REWIND( numnam )                   ! Read Namelist namsbc
+      REWIND( numnam )           ! Read Namelist namsbc
       READ  ( numnam, namsbc )
 
-      ! overwrite namelist parameter using CPP key information
-!!gm here no overwrite, test all option via namelist change: require more incore memory
-!!gm  IF( lk_sbc_cpl       ) THEN   ;   ln_cpl      = .TRUE.   ;   ELSE   ;   ln_cpl      = .FALSE.   ;   ENDIF
-
-      IF ( Agrif_Root() ) THEN
-        IF( lk_lim2 )            nn_ice      = 2
-        IF( lk_lim3 )            nn_ice      = 3
-      ENDIF
-      !
-      IF( cp_cfg == 'gyre' ) THEN
+      !                          ! overwrite namelist parameter using CPP key information
+      IF( Agrif_Root() ) THEN                ! AGRIF zoom
+        IF( lk_lim2 )   nn_ice      = 2
+        IF( lk_lim3 )   nn_ice      = 3
+      ENDIF
+      IF( cp_cfg == 'gyre' ) THEN            ! GYRE configuration
           ln_ana      = .TRUE.   
           nn_ice      =   0
       ENDIF
       
-      ! Control print
-      IF(lwp) THEN
+      IF(lwp) THEN               ! Control print
          WRITE(numout,*) '        Namelist namsbc (partly overwritten with CPP key setting)'
          WRITE(numout,*) '           frequency update of sbc (and ice)             nn_fsbc     = ', nn_fsbc
@@ -116,4 +110,5 @@
       ENDIF
 
+      !                          ! Checks:
       IF( .NOT. ln_rnf ) THEN                      ! no specific treatment in vicinity of river mouths 
          ln_rnf_mouth  = .false.                      
@@ -144,5 +139,5 @@
          &   CALL ctl_warn( 'diurnal cycle for qsr: the sampling of the diurnal cycle is too small...' )
       
-      ! Choice of the Surface Boudary Condition (set nsbc)
+      !                          ! Choice of the Surface Boudary Condition (set nsbc)
       icpt = 0
       IF( ln_ana          ) THEN   ;   nsbc =  1   ; icpt = icpt + 1   ;   ENDIF       ! analytical      formulation
@@ -153,5 +148,5 @@
       IF( cp_cfg == 'gyre') THEN   ;   nsbc =  0                       ;   ENDIF       ! GYRE analytical formulation
       IF( lk_esopa        )            nsbc = -1                                       ! esopa test, ALL formulations
-
+      !
       IF( icpt /= 1 .AND. .NOT.lk_esopa ) THEN
          WRITE(numout,*)
