Index: trunk/NEMO/OPA_SRC/SBC/sbcmod.F90
===================================================================
--- trunk/NEMO/OPA_SRC/SBC/sbcmod.F90	(revision 1115)
+++ trunk/NEMO/OPA_SRC/SBC/sbcmod.F90	(revision 1116)
@@ -127,6 +127,11 @@
       ENDIF
 
-      IF( .NOT. ln_rnf )   nn_runoff = 0      ! no runoff, or runoff mouths
-      IF( nn_ice == 0  )   fr_i(:,:) = 0.e0   ! no ice in the domain, ice fraction is always zero
+      IF( .NOT. ln_rnf )   THEN                      ! no specific treatment in rivers mouths vicinity
+         ln_rnf_mouth = .false.                      
+         nkrnf = 0
+         rnfmsk(:,:) = 0.e0
+         rnfmsk_z(:) = 0.e0
+      ENDIF
+      IF( nn_ice == 0  )   fr_i(:,:) = 0.e0          ! no ice in the domain, ice fraction is always zero
 
       ! Check consistancy   !!gm mixture of real and integer : coding to be changed....
Index: trunk/NEMO/OPA_SRC/SBC/sbcrnf.F90
===================================================================
--- trunk/NEMO/OPA_SRC/SBC/sbcrnf.F90	(revision 1115)
+++ trunk/NEMO/OPA_SRC/SBC/sbcrnf.F90	(revision 1116)
@@ -11,4 +11,5 @@
    !!----------------------------------------------------------------------
    !!   sbc_rnf      : monthly runoffs read in a NetCDF file
+   !!   sbc_rnf_init : runoffs initialisation
    !!   rnf_mouth    : set river mouth mask
    !!----------------------------------------------------------------------
@@ -28,10 +29,11 @@
 
    !! * namsbc_rnf namelist
-   CHARACTER(len=100), PUBLIC ::   cn_dir     = './'    !: Root directory for location of ssr files
-   INTEGER           , PUBLIC ::   nn_runoff  = 1       !: runoffs flag
-   REAL(wp)          , PUBLIC ::   rn_hrnf    = 0.e0    !: runoffs, depth over which enhanced vertical mixing is used
-   REAL(wp)          , PUBLIC ::   rn_avt_rnf = 0.e0    !: runoffs, value of the additional vertical mixing coef. [m2/s]
-   TYPE(FLD_N)       , PUBLIC ::   sn_rnf               !: information about the runoff file to be read
-   TYPE(FLD_N)       , PUBLIC ::   sn_cnf               !: information about the runoff mouth file to be read
+   CHARACTER(len=100), PUBLIC ::   cn_dir       = './'    !: Root directory for location of ssr files
+   LOGICAL           , PUBLIC ::   ln_rnf_emp   = .false. !: runoffs into a file to be read or already into precipitation
+   TYPE(FLD_N)       , PUBLIC ::   sn_rnf                 !: information about the runoff file to be read
+   TYPE(FLD_N)       , PUBLIC ::   sn_cnf                 !: information about the runoff mouth file to be read
+   LOGICAL           , PUBLIC ::   ln_rnf_mouth = .false. !: specific treatment in mouths vicinity
+   REAL(wp)          , PUBLIC ::   rn_hrnf      = 0.e0    !: runoffs, depth over which enhanced vertical mixing is used
+   REAL(wp)          , PUBLIC ::   rn_avt_rnf   = 0.e0    !: runoffs, value of the additional vertical mixing coef. [m2/s]
 
    INTEGER , PUBLIC                     ::   nkrnf = 0   !: number of levels over which Kz is increased at river mouths
@@ -43,5 +45,5 @@
    !!----------------------------------------------------------------------
    !!   OPA 9.0 , LOCEAN-IPSL (2006) 
-   !! $ Id: $
+   !! $Id: $
    !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
@@ -64,103 +66,10 @@
       !
       INTEGER  ::   ji, jj   ! dummy loop indices
-      INTEGER  ::   ierror   ! temporary integer
-      !!----------------------------------------------------------------------
-      NAMELIST/namsbc_rnf/ cn_dir, nn_runoff, rn_hrnf, rn_avt_rnf, sn_rnf, sn_cnf
-      !                                                   !------------------!
-      IF( kt == nit000 ) THEN                             !  Initialisation  !
-         !                                                !------------------!
-         ! Default values (NB: frequency positive => hours, negative => months)
-         !            !   file    ! frequency !  variable  ! time intep !  clim  ! starting !
-         !            !   name    !  (hours)  !   name     !   (T/F)    !  (0/1) !  record  !
-         sn_rnf = FLD_N( 'runoffs',   -12.    , 'sorunoff' ,  .TRUE.    ,    1   ,     0    )
-         sn_cnf = FLD_N( 'runoffs',     0.    , 'sorunoff' ,  .FALSE.   ,    1   ,     0    )
-
-         !
-         REWIND ( numnam )                   ! Read Namelist namsbc_rnf
-         READ   ( numnam, namsbc_rnf )
-
-         ! Control print
-         IF(lwp) THEN
-            WRITE(numout,*)
-            WRITE(numout,*) 'sbc_rnf : runoff '
-            WRITE(numout,*) '~~~~~~~ '
-            WRITE(numout,*) '   Namelist namsbc_rnf'
-            WRITE(numout,*) '      runoff type (=-1/1/2)                      nn_runoff   = ', nn_runoff
-            WRITE(numout,*) '      river mouth additional Kz                  rn_avt_rnf  = ', rn_avt_rnf
-            WRITE(numout,*) '      depth of river mouth additional mixing     rn_hrnf     = ', rn_hrnf
-         ENDIF
-
-         IF( nn_runoff >= 1 ) THEN      ! set sf_rnf structure
-            !
-            ALLOCATE( sf_rnf(1), STAT=ierror )
-            IF( ierror > 0 ) THEN
-               CALL ctl_stop( 'sbc_rnf: unable to allocate sf_rnf structure' )   ;   RETURN
-            ENDIF
-            ! namelist informations stored in sf_rnf structures
-            WRITE( sf_rnf(1)%clrootname, '(a,a)' )   TRIM( cn_dir ), TRIM( sn_rnf%clname )
-            sf_rnf(1)%freqh   = sn_rnf%freqh
-            sf_rnf(1)%clvar   = sn_rnf%clvar
-            sf_rnf(1)%ln_tint = sn_rnf%ln_tint
-            sf_rnf(1)%nclim   = sn_rnf%nclim
-            sf_rnf(1)%nstrec  = sn_rnf%nstrec
-            IF(lwp) THEN             ! control print
-               WRITE(numout,*) '   Runoffs data read in the following file: '
-               WRITE(numout,*) '               root filename: '  , trim( sf_rnf(1)%clrootname ),   &
-                  &                          ' variable name: '  , trim( sf_rnf(1)%clvar      )
-               WRITE(numout,*) '               frequency: '      ,       sf_rnf(1)%freqh       ,   &
-                  &                          ' time interp: '    ,       sf_rnf(1)%ln_tint     ,   &
-                  &                          ' climatology: '    ,       sf_rnf(1)%nclim       ,   &
-                  &                          ' starting record: ',       sf_rnf(1)%nstrec
-            ENDIF
-         ENDIF
-
-         IF( nn_runoff == 1 ) THEN
-            IF(lwp) WRITE(numout,*)
-            IF(lwp) WRITE(numout,*) '          No specific treatment at river mouths'
-            rnfmsk  (:,:) = 0.e0 
-            rnfmsk_z(:)   = 0.e0
-            nkrnf = 0
-         ELSE
-            !
-            ! Number of level over which Kz increase in vicinity of river mouths
-            IF( rn_hrnf == 0.e0 ) THEN
-               nkrnf = 0
-            ELSE
-               nkrnf = 2
-               DO WHILE( nkrnf == jpkm1 .OR. gdepw_0(nkrnf) > rn_hrnf )
-                  nkrnf = nkrnf + 1
-               END DO
-               IF( ln_sco )   &
-                  CALL ctl_warn( 'sbc_rnf: number of levels over which Kz is increased is computed for zco...' )
-            ENDIF
-            !
-            ! river mouths mask
-            CALL rnf_mouth            ! set river mouth mask
-            !
-         ENDIF
-
-         IF( nn_runoff /= -1 .AND. nn_runoff /= 1 .AND. nn_runoff /= 2 ) THEN
-            WRITE(ctmp1,*) 'sbc_rnf: Error nn_runoff = ', nn_runoff, ' /= -1, 1 or 2'
-            CALL ctl_stop( ctmp1 )
-         ENDIF
-
-         ! Control print
-         IF(lwp) THEN
-            IF( nn_runoff == -1 ) THEN
-               WRITE(numout,*) '          runoff directly provided in the precipitations'
-            ELSE
-               WRITE(numout,*) '          monthly runoff read in NetCDF file '
-            ENDIF
-            IF( nn_runoff ==  1 ) THEN
-               WRITE(numout,*) '          No Kz increase nor upstream advection at river mouths'
-            ELSE
-               IF(lwp) WRITE(numout,*) '          mixed upstream/centered at river mouths (ln_traadv_cen2=T) ' 
-               IF(lwp) WRITE(numout,*) '          Kz is increased by ', rn_avt_rnf,' m2/s  over ', nkrnf, ' w-levels'
-            ENDIF
-         ENDIF
-         !
-      ENDIF
+      !!----------------------------------------------------------------------
+      !                                   
+      IF( kt == nit000 )   CALL sbc_rnf_init
+
       !                                                   !-------------------!
-      IF( nn_runoff == 1 .OR. nn_runoff == 2 ) THEN       !   Update runoff   !
+      IF( .NOT. ln_rnf_emp ) THEN                         !   Update runoff   !
          !                                                !-------------------!
          !
@@ -188,4 +97,115 @@
 
 
+   SUBROUTINE sbc_rnf_init
+      !!----------------------------------------------------------------------
+      !!                  ***  ROUTINE sbc_rnf_init  ***
+      !!
+      !! ** Purpose :   Initialisation of the runoffs if (ln_rnf=T)
+      !!
+      !! ** Method  : - read the runoff namsbc_rnf namelist
+      !!
+      !! ** Action  : - read parameters
+      !!----------------------------------------------------------------------
+      INTEGER  ::   ierror   ! temporary integer
+      !!
+      NAMELIST/namsbc_rnf/ cn_dir, ln_rnf_emp, sn_rnf, sn_cnf, ln_rnf_mouth,   &
+         &                 rn_hrnf, rn_avt_rnf
+      !!----------------------------------------------------------------------
+
+      !                                   ! ============
+      !                                   !   Namelist
+      !                                   ! ============
+      !                                         ! Default values NB: frequency>0 hours, <0 months)
+      !            !   file    ! frequency !  variable  ! time intep !  clim  ! starting !
+      !            !   name    !  (hours)  !   name     !   (T/F)    !  (0/1) !  record  !
+      sn_rnf = FLD_N( 'runoffs',   -12.    , 'sorunoff' ,  .TRUE.    ,    1   ,     0    )
+      sn_cnf = FLD_N( 'runoffs',     0.    , 'sorunoff' ,  .FALSE.   ,    1   ,     0    )
+
+      !
+      REWIND ( numnam )                         ! Read Namelist namsbc_rnf
+      READ   ( numnam, namsbc_rnf )
+
+      !                                         ! Control print
+      IF(lwp) THEN
+         WRITE(numout,*)
+         WRITE(numout,*) 'sbc_rnf : runoff '
+         WRITE(numout,*) '~~~~~~~ '
+         WRITE(numout,*) '   Namelist namsbc_rnf'
+         WRITE(numout,*) '      runoff in a file to be read                ln_rnf_emp   = ', ln_rnf_emp
+         WRITE(numout,*) '      specific river mouths treatment            ln_rnf_mouth = ', ln_rnf_mouth
+         WRITE(numout,*) '      river mouth additional Kz                  rn_avt_rnf   = ', rn_avt_rnf
+         WRITE(numout,*) '      depth of river mouth additional mixing     rn_hrnf      = ', rn_hrnf
+      ENDIF
+
+      !                                   ! ==================
+      !                                   !   Type of runoff
+      !                                   ! ==================
+      !
+      IF( ln_rnf_emp ) THEN                     ! runoffs directly provided in the precipitations
+         IF(lwp) WRITE(numout,*)
+         IF(lwp) WRITE(numout,*) '          runoffs directly provided in the precipitations'
+         !
+      ELSE                                      ! runoffs read in a file : set sf_rnf structure 
+         !
+         ALLOCATE( sf_rnf(1), STAT=ierror )
+         IF( ierror > 0 ) THEN
+            CALL ctl_stop( 'sbc_rnf: unable to allocate sf_rnf structure' )   ;   RETURN
+         ENDIF
+         !                                         ! namelist informations stored in sf_rnf structures
+         WRITE( sf_rnf(1)%clrootname, '(a,a)' )   TRIM( cn_dir ), TRIM( sn_rnf%clname )
+         sf_rnf(1)%freqh   = sn_rnf%freqh
+         sf_rnf(1)%clvar   = sn_rnf%clvar
+         sf_rnf(1)%ln_tint = sn_rnf%ln_tint
+         sf_rnf(1)%nclim   = sn_rnf%nclim
+         sf_rnf(1)%nstrec  = sn_rnf%nstrec
+         IF(lwp) THEN                              ! control print
+            WRITE(numout,*) '   Runoffs data read in the following file: '
+            WRITE(numout,*) '               root filename: '  , trim( sf_rnf(1)%clrootname ),   &
+               &                          ' variable name: '  , trim( sf_rnf(1)%clvar      )
+            WRITE(numout,*) '               frequency: '      ,       sf_rnf(1)%freqh       ,   &
+               &                          ' time interp: '    ,       sf_rnf(1)%ln_tint     ,   &
+               &                          ' climatology: '    ,       sf_rnf(1)%nclim       ,   &
+               &                          ' starting record: ',       sf_rnf(1)%nstrec
+         ENDIF
+         !
+      ENDIF
+
+      !                                   ! ========================
+      !                                   !   River mouth vicinity
+      !                                   ! ========================
+      !
+      IF( ln_rnf_mouth ) THEN                   ! Specific treatment in vicinity of river mouths :
+         !                                      !    - Increase Kz in surface layers ( rn_hrnf > 0 )
+         !                                      !    - set to zero SSS damping (ln_ssr=T)
+         !                                      !    - mixed upstream-centered (ln_traadv_cen2=T)
+         !
+         !                                          ! Number of level over which Kz increase
+         nkrnf = 0
+         IF( rn_hrnf > 0.e0 ) THEN
+            nkrnf = 2
+            DO WHILE( nkrnf == jpkm1 .OR. gdepw_0(nkrnf) > rn_hrnf )   ;   nkrnf = nkrnf + 1   ;   END DO
+            IF( ln_sco )   &
+               CALL ctl_warn( 'sbc_rnf: number of levels over which Kz is increased is computed for zco...' )
+         ENDIF
+         IF(lwp) WRITE(numout,*)
+         IF(lwp) WRITE(numout,*) '          Specific treatment used in vicinity of river mouths :'
+         IF(lwp) WRITE(numout,*) '             - Increase Kz in surface layers (if rn_hrnf > 0 )'
+         IF(lwp) WRITE(numout,*) '               by ', rn_avt_rnf,' m2/s  over ', nkrnf, ' w-levels'
+         IF(lwp) WRITE(numout,*) '             - set to zero SSS damping       (if ln_ssr=T)'
+         IF(lwp) WRITE(numout,*) '             - mixed upstream-centered       (if ln_traadv_cen2=T)'
+         !
+         CALL rnf_mouth                             ! set river mouth mask
+         !
+      ELSE                                      ! No treatment at river mouths
+         IF(lwp) WRITE(numout,*)
+         IF(lwp) WRITE(numout,*) '          No specific treatment at river mouths'
+         rnfmsk  (:,:) = 0.e0 
+         rnfmsk_z(:)   = 0.e0
+         nkrnf = 0
+      ENDIF
+
+   END SUBROUTINE sbc_rnf_init
+
+
    SUBROUTINE rnf_mouth
       !!----------------------------------------------------------------------
@@ -200,5 +220,5 @@
       !!                This fields can be used to:
       !!                 - set an upstream advection scheme  
-      !!                   (nn_runoff=2 and ln_traadv_cen2=T)
+      !!                   (ln_rnf_mouth=T and ln_traadv_cen2=T)
       !!                 - increase vertical on the top nn_krnf vertical levels 
       !!                   at river runoff input grid point (nn_krnf>=2, see step.F90)
Index: trunk/NEMO/OPA_SRC/TRA/traadv_cen2.F90
===================================================================
--- trunk/NEMO/OPA_SRC/TRA/traadv_cen2.F90	(revision 1115)
+++ trunk/NEMO/OPA_SRC/TRA/traadv_cen2.F90	(revision 1116)
@@ -150,7 +150,4 @@
          !
          upsmsk(:,:) = 0.e0                              ! not upstream by default
-         IF( .NOT. ln_rnf ) THEN                         ! no runoff 
-            rnfmsk(:,:) = 0.e0 ; rnfmsk_z(:) = 0.e0
-         ENDIF
          ! 
          IF( cp_cfg == "orca" )   CALL ups_orca_set      ! set mixed Upstream/centered scheme near some straits
Index: trunk/NEMO/OPA_SRC/step.F90
===================================================================
--- trunk/NEMO/OPA_SRC/step.F90	(revision 1115)
+++ trunk/NEMO/OPA_SRC/step.F90	(revision 1116)
@@ -222,6 +222,6 @@
       ENDIF
 
-      IF( ln_rnf ) THEN                                     ! increase diffusivity at rivers mouths
-         DO jk = 2, nkrnf   ;   avt(:,:,jk) = avt(:,:,jk) + rn_avt_rnf * rnfmsk(:,:)   ;   END DO
+      IF( ln_rnf_mouth ) THEN                                ! increase diffusivity at rivers mouths
+         DO jk = 2, nkrnf   ;   avt(:,:,jk) = avt(:,:,jk) + 2.e0 * rn_avt_rnf * rnfmsk(:,:)   ;   END DO
       ENDIF
 
