Index: branches/DEV_R1821_Rivers/CONFIG/GYRE/EXP00/namelist
===================================================================
--- branches/DEV_R1821_Rivers/CONFIG/GYRE/EXP00/namelist	(revision 1938)
+++ branches/DEV_R1821_Rivers/CONFIG/GYRE/EXP00/namelist	(revision 1998)
@@ -214,8 +214,12 @@
    sn_rnf      = 'runoff_1m_nomask' ,  -1         , 'sorunoff' ,    .true.      , .true.  , 'yearly'  , ''       , ''
    sn_cnf      = 'runoff_1m_nomask' ,   0         , 'socoefr'  ,    .false.     , .true.  , 'yearly'  , ''       , ''
+   sn_sal_rnf  = 'runoffs'          ,  24         , 'rosaline' ,    .true.      , .true.  ,   'yearly', ''       , ''
+   sn_tmp_rnf  = 'runoffs'          ,  24         , 'rotemper' ,    .true.      , .true.  ,   'yearly', ''       , ''
+   sn_dep_rnf  = 'runoffs'          ,   0         , 'rodepth'  ,    .false.     , .true.  ,   'yearly', ''       , ''
  
    cn_dir       = './'      !  root directory for the location of the runoff files
    ln_rnf_emp   =   .false. !  runoffs included into precipitation field (T) or into a file (F)
    ln_rnf_mouth =   .false. !  specific treatment at rivers mouths
+   ln_rnf_att   =   .false. !  apply temperature, salinity and depth attributes to runoff input
    rn_hrnf      =   0.e0    !  depth over which enhanced vertical mixing is used
    rn_avt_rnf   =   1.e-3   !  value of the additional vertical mixing coef. [m2/s]
Index: branches/DEV_R1821_Rivers/CONFIG/GYRE_LOBSTER/EXP00/namelist
===================================================================
--- branches/DEV_R1821_Rivers/CONFIG/GYRE_LOBSTER/EXP00/namelist	(revision 1938)
+++ branches/DEV_R1821_Rivers/CONFIG/GYRE_LOBSTER/EXP00/namelist	(revision 1998)
@@ -214,8 +214,12 @@
    sn_rnf      = 'runoff_1m_nomask' ,  -1         , 'sorunoff' ,    .true.      , .true.  , 'yearly'  , ''       , ''
    sn_cnf      = 'runoff_1m_nomask' ,   0         , 'socoefr'  ,    .false.     , .true.  , 'yearly'  , ''       , ''
+   sn_sal_rnf  = 'runoffs'          ,  24         , 'rosaline' ,    .true.      , .true.  ,   'yearly', ''       , ''
+   sn_tmp_rnf  = 'runoffs'          ,  24         , 'rotemper' ,    .true.      , .true.  ,   'yearly', ''       , ''
+   sn_dep_rnf  = 'runoffs'          ,   0         , 'rodepth'  ,    .false.     , .true.  ,   'yearly', ''       , ''
  
    cn_dir       = './'      !  root directory for the location of the runoff files
    ln_rnf_emp   =   .false. !  runoffs included into precipitation field (T) or into a file (F)
    ln_rnf_mouth =   .false. !  specific treatment at rivers mouths
+   ln_rnf_att   =   .false. !  apply temperature, salinity and depth attributes to runoff input
    rn_hrnf      =   0.e0    !  depth over which enhanced vertical mixing is used
    rn_avt_rnf   =   1.e-3   !  value of the additional vertical mixing coef. [m2/s]
Index: branches/DEV_R1821_Rivers/CONFIG/ORCA2_LIM/EXP00/namelist
===================================================================
--- branches/DEV_R1821_Rivers/CONFIG/ORCA2_LIM/EXP00/namelist	(revision 1938)
+++ branches/DEV_R1821_Rivers/CONFIG/ORCA2_LIM/EXP00/namelist	(revision 1998)
@@ -241,8 +241,13 @@
    sn_rnf      = 'runoff_1m_nomask' ,  -1         , 'sorunoff' ,    .true.      , .true.  , 'yearly'  , ''       , ''
    sn_cnf      = 'runoff_1m_nomask' ,   0         , 'socoefr'  ,    .false.     , .true.  , 'yearly'  , ''       , ''
+   sn_sal_rnf  = 'runoffs'          ,  24         , 'rosaline' ,    .true.      , .true.  ,   'yearly', ''       , ''
+   sn_tmp_rnf  = 'runoffs'          ,  24         , 'rotemper' ,    .true.      , .true.  ,   'yearly', ''       , ''
+   sn_dep_rnf  = 'runoffs'          ,   0         , 'rodepth'  ,    .false.     , .true.  ,   'yearly', ''       , ''
+
  
    cn_dir       = './'      !  root directory for the location of the runoff files
    ln_rnf_emp   =   .false. !  runoffs included into precipitation field (T) or into a file (F)
    ln_rnf_mouth =   .false. !  specific treatment at rivers mouths
+   ln_rnf_att   =   .false. !  apply temperature, salinity and depth attributes to runoff input  
    rn_hrnf      =  15.e0    !  depth over which enhanced vertical mixing is used
    rn_avt_rnf   =   1.e-3   !  value of the additional vertical mixing coef. [m2/s]
Index: branches/DEV_R1821_Rivers/CONFIG/ORCA2_LIM_PISCES/EXP00/namelist
===================================================================
--- branches/DEV_R1821_Rivers/CONFIG/ORCA2_LIM_PISCES/EXP00/namelist	(revision 1938)
+++ branches/DEV_R1821_Rivers/CONFIG/ORCA2_LIM_PISCES/EXP00/namelist	(revision 1998)
@@ -241,8 +241,12 @@
    sn_rnf      = 'runoff_1m_nomask' ,  -1         , 'sorunoff' ,    .true.      , .true.  , 'yearly'  , ''       , ''
    sn_cnf      = 'runoff_1m_nomask' ,   0         , 'socoefr'  ,    .false.     , .true.  , 'yearly'  , ''       , ''
+   sn_sal_rnf  = 'runoffs'          ,  24         , 'rosaline' ,    .true.      , .true.  ,   'yearly', ''       , ''
+   sn_tmp_rnf  = 'runoffs'          ,  24         , 'rotemper' ,    .true.      , .true.  ,   'yearly', ''       , ''
+   sn_dep_rnf  = 'runoffs'          ,   0         , 'rodepth'  ,    .false.     , .true.  ,   'yearly', ''       , ''
  
    cn_dir       = './'      !  root directory for the location of the runoff files
    ln_rnf_emp   =   .false. !  runoffs included into precipitation field (T) or into a file (F)
    ln_rnf_mouth =   .false. !  specific treatment at rivers mouths
+   ln_rnf_att   =   .false. !  apply temperature, salinity and depth attributes to runoff input
    rn_hrnf      =  15.e0    !  depth over which enhanced vertical mixing is used
    rn_avt_rnf   =   1.e-3   !  value of the additional vertical mixing coef. [m2/s]
Index: branches/DEV_R1821_Rivers/CONFIG/POMME/EXP00/namelist
===================================================================
--- branches/DEV_R1821_Rivers/CONFIG/POMME/EXP00/namelist	(revision 1938)
+++ branches/DEV_R1821_Rivers/CONFIG/POMME/EXP00/namelist	(revision 1998)
@@ -240,8 +240,12 @@
    sn_rnf      = 'runoff_1m_nomask' ,  -1         , 'sorunoff' ,    .true.      , .true.  , 'yearly'  , ''       , ''
    sn_cnf      = 'runoff_1m_nomask' ,   0         , 'socoefr'  ,    .false.     , .true.  , 'yearly'  , ''       , ''
+   sn_sal_rnf  = 'runoffs'          ,  24         , 'rosaline' ,    .true.      , .true.  ,   'yearly', ''       , ''
+   sn_tmp_rnf  = 'runoffs'          ,  24         , 'rotemper' ,    .true.      , .true.  ,   'yearly', ''       , ''
+   sn_dep_rnf  = 'runoffs'          ,   0         , 'rodepth'  ,    .false.     , .true.  ,   'yearly', ''       , ''
  
    cn_dir       = './'      !  root directory for the location of the runoff files
    ln_rnf_emp   =   .false. !  runoffs included into precipitation field (T) or into a file (F)
    ln_rnf_mouth =   .false. !  specific treatment at rivers mouths
+   ln_rnf_att   =   .false. !  apply temperature, salinity and depth attributes to runoff input
    rn_hrnf      =  0.e0    !  depth over which enhanced vertical mixing is used
    rn_avt_rnf   =   1.e-3   !  value of the additional vertical mixing coef. [m2/s]
Index: branches/DEV_R1821_Rivers/NEMO/OPA_SRC/DOM/closea.F90
===================================================================
--- branches/DEV_R1821_Rivers/NEMO/OPA_SRC/DOM/closea.F90	(revision 1938)
+++ branches/DEV_R1821_Rivers/NEMO/OPA_SRC/DOM/closea.F90	(revision 1998)
@@ -182,6 +182,4 @@
       REAL(wp), DIMENSION (jpncs) ::   zfwf 
  
-      REAL(wp), DIMENSION (jpi,jpj)       ::   fwf              !: fresh water flux,for volume: emp-rnf  
-      REAL(wp), DIMENSION (jpi,jpj)       ::   fwfs             !: fresh water flux, for conc/dilution effect: emps-rnf  
       !!----------------------------------------------------------------------
       !
@@ -283,8 +281,6 @@
       END DO 
       !
-      fwf(:,:)  = emp(:,:)  - rnf(:,:)  
-      fwfs(:,:) = emps(:,:) - rnf(:,:)  
-      CALL lbc_lnk( fwf , 'T', 1. ) 
-      CALL lbc_lnk( fwfs, 'T', 1. ) 
+      CALL lbc_lnk( emp , 'T', 1. )
+      CALL lbc_lnk( emps, 'T', 1. )
       !
    END SUBROUTINE sbc_clo
Index: branches/DEV_R1821_Rivers/NEMO/OPA_SRC/SBC/sbcmod.F90
===================================================================
--- branches/DEV_R1821_Rivers/NEMO/OPA_SRC/SBC/sbcmod.F90	(revision 1938)
+++ branches/DEV_R1821_Rivers/NEMO/OPA_SRC/SBC/sbcmod.F90	(revision 1998)
@@ -185,8 +185,4 @@
       INTEGER, INTENT(in) ::   kt       ! ocean time step
       !!---------------------------------------------------------------------
-
-      emp(:,:)=0.0  
-      emps(:,:)=0.0  
-      rnf(:,:)=0.0 
 
       CALL iom_setkt( kt + nn_fsbc - 1 )         !  in sbc, iom_put is called every nn_fsbc time step
Index: branches/DEV_R1821_Rivers/NEMO/OPA_SRC/SBC/sbcrnf.F90
===================================================================
--- branches/DEV_R1821_Rivers/NEMO/OPA_SRC/SBC/sbcrnf.F90	(revision 1938)
+++ branches/DEV_R1821_Rivers/NEMO/OPA_SRC/SBC/sbcrnf.F90	(revision 1998)
@@ -38,5 +38,5 @@
    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]
-   LOGICAL           , PUBLIC ::   ln_rnf_att   = .false.  !: river runoffs attributes (temp, sal & depth) are specified in a file 
+   LOGICAL           , PUBLIC ::   ln_rnf_att   = .false. !: river runoffs attributes (temp, sal & depth) are specified in a file 
    REAL(wp)          , PUBLIC ::   rn_rfact     = 1.e0    !: multiplicative factor for runoff
 
@@ -45,10 +45,9 @@
    REAL(wp), PUBLIC, DIMENSION(jpk)     ::   rnfmsk_z    !: river mouth mask (vert.)
 
-   TYPE(FLD), ALLOCATABLE, DIMENSION(:) ::   sf_rnf   ! structure of input SST (file information, fields read)
-
-   TYPE(FLD), ALLOCATABLE, DIMENSION(:) ::   sf_sal_rnf    !: structure of input salinity (file information, fields read)  
-   TYPE(FLD), ALLOCATABLE, DIMENSION(:) ::   sf_tmp_rnf    !: structure of input tmeperature (file information, fields read)  
+   TYPE(FLD), ALLOCATABLE, DIMENSION(:) ::   sf_rnf        !: structure of input river runoff (file information, fields read)
+
+   TYPE(FLD), ALLOCATABLE, DIMENSION(:) ::   sf_sal_rnf    !: structure of input river runoff salinity (file information, fields read)  
+   TYPE(FLD), ALLOCATABLE, DIMENSION(:) ::   sf_tmp_rnf    !: structure of input river runoff temperature (file information, fields read)  
  
-!   REAL,    PUBLIC, DIMENSION(jpi,jpj) ::  rnf             !: mass flux of river runoff (in kg/m2/s)  
    REAL,    PUBLIC, DIMENSION(jpi,jpj) ::  rnf_dep         !: depth of runoff in m  
    INTEGER, PUBLIC, DIMENSION(jpi,jpj) ::  rnf_mod_dep     !: depth of runoff in model levels  
@@ -89,27 +88,5 @@
       !                                   
       IF( kt == nit000 ) THEN  
-         IF( .NOT. ln_rnf_emp ) THEN
-            ALLOCATE( sf_rnf(1), STAT=ierror )
-            IF( ierror > 0 ) THEN
-               CALL ctl_stop( 'sbc_rnf: unable to allocate sf_rnf structure' )   ;   RETURN
-            ENDIF
-            ALLOCATE( sf_rnf(1)%fnow(jpi,jpj) )
-            ALLOCATE( sf_rnf(1)%fdta(jpi,jpj,2) )
- 
-            ALLOCATE( sf_sal_rnf(1), STAT=ierror )  
-            IF( ierror > 0 ) THEN  
-               CALL ctl_stop( 'sbc_sal_rnf: unable to allocate sf_sal_rnf structure' )   ;   RETURN  
-            ENDIF  
-            ALLOCATE( sf_sal_rnf(1)%fnow(jpi,jpj) )  
-            ALLOCATE( sf_sal_rnf(1)%fdta(jpi,jpj,2) )  
-   
-            ALLOCATE( sf_tmp_rnf(1), STAT=ierror )  
-            IF( ierror > 0 ) THEN  
-                CALL ctl_stop( 'sbc_tmp_rnf: unable to allocate sf_tmp_rnf structure' )   ;   RETURN  
-            ENDIF  
-            ALLOCATE( sf_tmp_rnf(1)%fnow(jpi,jpj) )  
-            ALLOCATE( sf_tmp_rnf(1)%fdta(jpi,jpj,2) )  
-         ENDIF  
-         CALL sbc_rnf_init( sf_rnf, sf_tmp_rnf, sf_sal_rnf )  
+         CALL sbc_rnf_init                      ! Read namelist and allocate structures
       ENDIF
 
@@ -146,5 +123,5 @@
                rnf_tmp(:,:) = -999  
             ENDIF  
-            CALL iom_put( "runoffs", sf_rnf(1)%fnow )         ! runoffs
+            CALL iom_put( "runoffs", rnf )         ! runoffs
          ENDIF
          !
@@ -154,5 +131,5 @@
 
 
-   SUBROUTINE sbc_rnf_init( sf_rnf, sf_tmp_rnf, sf_sal_rnf )  
+   SUBROUTINE sbc_rnf_init
       !!----------------------------------------------------------------------
       !!                  ***  ROUTINE sbc_rnf_init  ***
@@ -164,5 +141,4 @@
       !! ** Action  : - read parameters
       !!----------------------------------------------------------------------
-      TYPE(FLD), INTENT(inout), DIMENSION(:) :: sf_rnf, sf_tmp_rnf, sf_sal_rnf   ! input data  
       CHARACTER(len=32) ::   rn_dep_file   ! runoff file name  
       !! 
@@ -207,9 +183,34 @@
          IF(lwp) WRITE(numout,*)
          IF(lwp) WRITE(numout,*) '          runoffs directly provided in the precipitations'
-         IF ( ln_rnf_att ) CALL ctl_warn( 'runoffs already included in precipitations & so runoff attributes not included' ) 
+         IF ( ln_rnf_att ) THEN
+           CALL ctl_warn( 'runoffs already included in precipitations & so runoff attributes will not be used' ) 
+           ln_rnf_att = .FALSE.
+         ENDIF
          !
       ELSE                                      ! runoffs read in a file : set sf_rnf structure 
          !
-         ! sf_rnf already allocated in main routine
+         ! Allocate sf_rnf structure and (if required) sf_sal_rnf and sf_tmp_rnf structures
+         ALLOCATE( sf_rnf(1), STAT=ierror )
+         IF( ierror > 0 ) THEN
+            CALL ctl_stop( 'sbc_rnf: unable to allocate sf_rnf structure' )   ;   RETURN
+         ENDIF
+         ALLOCATE( sf_rnf(1)%fnow(jpi,jpj) )
+         ALLOCATE( sf_rnf(1)%fdta(jpi,jpj,2) )
+
+         IF( ln_rnf_att ) THEN
+            ALLOCATE( sf_sal_rnf(1), STAT=ierror )
+            IF( ierror > 0 ) THEN
+               CALL ctl_stop( 'sbc_sal_rnf: unable to allocate sf_sal_rnf structure' )   ;   RETURN
+            ENDIF
+            ALLOCATE( sf_sal_rnf(1)%fnow(jpi,jpj) )
+            ALLOCATE( sf_sal_rnf(1)%fdta(jpi,jpj,2) )
+
+            ALLOCATE( sf_tmp_rnf(1), STAT=ierror )
+            IF( ierror > 0 ) THEN
+                CALL ctl_stop( 'sbc_tmp_rnf: unable to allocate sf_tmp_rnf structure' )   ;   RETURN
+            ENDIF
+            ALLOCATE( sf_tmp_rnf(1)%fnow(jpi,jpj) )
+            ALLOCATE( sf_tmp_rnf(1)%fdta(jpi,jpj,2) )
+         ENDIF
          ! fill sf_rnf with sn_rnf and control print
          CALL fld_fill( sf_rnf, (/ sn_rnf /), cn_dir, 'sbc_rnf_init', 'read runoffs data', 'namsbc_rnf' )
Index: branches/DEV_R1821_Rivers/NEMO/OPA_SRC/TRA/trasbc.F90
===================================================================
--- branches/DEV_R1821_Rivers/NEMO/OPA_SRC/TRA/trasbc.F90	(revision 1938)
+++ branches/DEV_R1821_Rivers/NEMO/OPA_SRC/TRA/trasbc.F90	(revision 1998)
@@ -107,8 +107,7 @@
       INTEGER  ::   ji, jj, jk           ! dummy loop indices  
       REAL(wp) ::   zta, zsa             ! temporary scalars, adjustment to temperature and salinity  
-      REAL(wp) ::   azta, azsa           ! temporary scalars, calculations of automatic change to temp & sal due to vvl (done elsewhere)  
+      REAL(wp) ::   zata, zasa           ! temporary scalars, calculations of automatic change to temp & sal due to vvl (done elsewhere)  
       REAL(wp) ::   zsrau, zse3t, zdep   ! temporary scalars, 1/density, 1/height of box, 1/height of effected water column  
-      REAL(wp) ::   dheat, dsalt          ! total change of temperature and salinity  
-      REAL(wp) ::   tot_sal1, tot_tmp1  
+      REAL(wp) ::   zdheat, zdsalt       ! total change of temperature and salinity  
       !!----------------------------------------------------------------------
 
@@ -131,5 +130,5 @@
       IF( .NOT.ln_traqsr )   qsr(:,:) = 0.e0   ! no solar radiation penetration
 
-      ! Concentration dillution effect on (t,s) due to evapouration, precipitation and qns, but not river runoff  
+      ! Concentration dilution effect on (t,s) due to evapouration, precipitation and qns, but not river runoff  
       DO jj = 2, jpj
          DO ji = fs_2, fs_jpim1   ! vector opt.
@@ -150,5 +149,5 @@
       END DO
 
-      IF ( ln_rnf ) THEN  
+      IF ( ln_rnf .AND. ln_rnf_att ) THEN  
       ! Concentration / dilution effect on (t,s) due to river runoff  
         DO jj=1,jpj  
@@ -167,6 +166,6 @@
                   !!!indirect flux, concentration or dilution effect  
                   !!!force a dilution effect in all levels;  
-                  dheat=0.0  
-                  dsalt=0.0  
+                  zdheat=0.0  
+                  zdsalt=0.0  
                   DO jk=1, rnf_mod_dep(ji,jj)  
                     zta = -tn(ji,jj,jk) * rnf(ji,jj) * zsrau * zdep  
@@ -174,10 +173,10 @@
                     ta(ji,jj,jk)=ta(ji,jj,jk)+zta  
                     sa(ji,jj,jk)=sa(ji,jj,jk)+zsa  
-                    dheat=dheat+zta*fse3t(ji,jj,jk)  
-                    dsalt=dsalt+zsa*fse3t(ji,jj,jk)  
+                    zdheat=zdheat+zta*fse3t(ji,jj,jk)  
+                    zdsalt=zdsalt+zsa*fse3t(ji,jj,jk)  
                   ENDDO  
                   !!!negate this total change in heat and salt content from top level  
-                  zta=-dheat*zse3t  
-                  zsa=-dsalt*zse3t  
+                  zta=-zdheat*zse3t  
+                  zsa=-zdsalt*zse3t  
                   ta(ji,jj,1)=ta(ji,jj,1)+zta  
                   sa(ji,jj,1)=sa(ji,jj,1)+zsa  
@@ -205,9 +204,8 @@
                 IF( lk_vvl) THEN  
                   !calculate automatic adjustment to sal and temp due to dilution/concentraion effect   
-                  azta = -tn(ji,jj,1) * rnf(ji,jj) * zsrau * zse3t  
-                  azsa = -sn(ji,jj,1) * rnf(ji,jj) * zsrau * zse3t  
-                  !!!negate this change in sal and temp   
-                  ta(ji,jj,1)=ta(ji,jj,1)-azta  
-                  sa(ji,jj,1)=sa(ji,jj,1)-azsa  
+                  zata = tn(ji,jj,1) * rnf(ji,jj) * zsrau * zse3t  
+                  zasa = sn(ji,jj,1) * rnf(ji,jj) * zsrau * zse3t  
+                  ta(ji,jj,1)=ta(ji,jj,1) + zata  
+                  sa(ji,jj,1)=sa(ji,jj,1) + zasa  
                 ENDIF  
   
@@ -216,5 +214,25 @@
            ENDDO  
         ENDDO  
-       
+
+      ELSE IF( ln_rnf ) THEN
+
+      ! Concentration dilution effect on (t,s) due to runoff without temperatue, salinity and depth attributes
+        DO jj = 2, jpj
+           DO ji = fs_2, fs_jpim1   ! vector opt.
+#if ! defined key_zco
+              zse3t = 1. / fse3t(ji,jj,1)
+#endif
+              IF( lk_vvl) THEN
+                 zta =  rnf(ji,jj) * zsrau * tn(ji,jj,1) * zse3t       ! & cooling/heating effect of runoff
+                 zsa = 0.e0                                            ! No salinity concent./dilut. effect
+              ELSE
+                 zta =  0.0                                            ! temperature : heat flux 
+                 zsa =  - rnf(ji,jj) * zsrau * sn(ji,jj,1) * zse3t     ! salinity :  concent./dilut. effect
+              ENDIF
+              ta(ji,jj,1) = ta(ji,jj,1) + zta                          ! add the trend to the general tracer trend
+              sa(ji,jj,1) = sa(ji,jj,1) + zsa
+           END DO
+        END DO
+ 
       ENDIF  
 
