Index: /trunk/NEMOGCM/NEMO/OFF_SRC/dtadyn.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OFF_SRC/dtadyn.F90	(revision 4569)
+++ /trunk/NEMOGCM/NEMO/OFF_SRC/dtadyn.F90	(revision 4570)
@@ -50,7 +50,8 @@
    LOGICAL            ::   ln_dynwzv    !: vertical velocity read in a file (T) or computed from u/v (F)
    LOGICAL            ::   ln_dynbbl    !: bbl coef read in a file (T) or computed (F)
-   LOGICAL            ::   ln_degrad    !: degradation option enabled or not 
-
-   INTEGER  , PARAMETER ::   jpfld = 20     ! maximum number of fields to read
+   LOGICAL            ::   ln_degrad    !: degradation option enabled or not
+   LOGICAL            ::   ln_dynrnf    !: read runoff data in file (T) or set to zero (F)
+
+   INTEGER  , PARAMETER ::   jpfld = 21     ! maximum number of fields to read
    INTEGER  , SAVE      ::   jf_tem         ! index of temperature
    INTEGER  , SAVE      ::   jf_sal         ! index of salinity
@@ -64,4 +65,5 @@
    INTEGER  , SAVE      ::   jf_wnd         ! index of wind speed
    INTEGER  , SAVE      ::   jf_ice         ! index of sea ice cover
+   INTEGER  , SAVE      ::   jf_rnf         ! index of river runoff
    INTEGER  , SAVE      ::   jf_ubl         ! index of u-bbl coef
    INTEGER  , SAVE      ::   jf_vbl         ! index of v-bbl coef
@@ -257,4 +259,6 @@
       fr_i(:,:)        = sf_dyn(jf_ice)%fnow(:,:,1) * tmask(:,:,1)    ! Sea-ice fraction
       qsr (:,:)        = sf_dyn(jf_qsr)%fnow(:,:,1) * tmask(:,:,1)    ! solar radiation
+      IF ( ln_dynrnf ) &
+      rnf (:,:)        = sf_dyn(jf_rnf)%fnow(:,:,1) * tmask(:,:,1)    ! river runoffs 
 
       !                                                      ! bbl diffusive coef
@@ -329,11 +333,11 @@
       CHARACTER(len=100)            ::  cn_dir   !   Root directory for location of core files
       TYPE(FLD_N), DIMENSION(jpfld) ::  slf_d    ! array of namelist informations on the fields to read
-      TYPE(FLD_N) :: sn_tem, sn_sal, sn_mld, sn_emp, sn_ice, sn_qsr, sn_wnd  ! informations about the fields to be read
+      TYPE(FLD_N) :: sn_tem, sn_sal, sn_mld, sn_emp, sn_ice, sn_qsr, sn_wnd, sn_rnf  ! informations about the fields to be read
       TYPE(FLD_N) :: sn_uwd, sn_vwd, sn_wwd, sn_avt, sn_ubl, sn_vbl          !   "                                 "
       TYPE(FLD_N) :: sn_ahu, sn_ahv, sn_ahw, sn_eiu, sn_eiv, sn_eiw, sn_fmf  !   "                                 "
       !!----------------------------------------------------------------------
       !
-      NAMELIST/namdta_dyn/cn_dir, ln_dynwzv, ln_dynbbl, ln_degrad,    &
-         &                sn_tem, sn_sal, sn_mld, sn_emp, sn_ice, sn_qsr, sn_wnd,  &
+      NAMELIST/namdta_dyn/cn_dir, ln_dynwzv, ln_dynbbl, ln_degrad, ln_dynrnf,    &
+         &                sn_tem, sn_sal, sn_mld, sn_emp, sn_ice, sn_qsr, sn_wnd, sn_rnf,  &
          &                sn_uwd, sn_vwd, sn_wwd, sn_avt, sn_ubl, sn_vbl,          &
          &                sn_ahu, sn_ahv, sn_ahw, sn_eiu, sn_eiv, sn_eiw, sn_fmf
@@ -357,4 +361,5 @@
          WRITE(numout,*) '      bbl coef read from file (T) or computed (F)          ln_dynbbl  = ', ln_dynbbl
          WRITE(numout,*) '      degradation option enabled (T) or not (F)            ln_degrad  = ', ln_degrad
+         WRITE(numout,*) '      river runoff option enabled (T) or not (F)           ln_dynrnf  = ', ln_dynrnf
          WRITE(numout,*)
       ENDIF
@@ -370,5 +375,5 @@
 
       jf_tem = 1   ;   jf_sal = 2   ;  jf_mld = 3   ;  jf_emp = 4   ;   jf_fmf  = 5   ;  jf_ice = 6   ;   jf_qsr = 7
-      jf_wnd = 8   ;   jf_uwd = 9   ;  jf_vwd = 10  ;  jf_wwd = 11  ;   jf_avt  = 12  ;  jfld  = 12
+      jf_wnd = 8   ;   jf_uwd = 9   ;  jf_vwd = 10  ;  jf_wwd = 11  ;   jf_avt  = 12  ;  jfld  = jf_avt
       !
       slf_d(jf_tem) = sn_tem   ;   slf_d(jf_sal)  = sn_sal   ;   slf_d(jf_mld) = sn_mld
@@ -376,32 +381,41 @@
       slf_d(jf_qsr) = sn_qsr   ;   slf_d(jf_wnd)  = sn_wnd   ;   slf_d(jf_avt) = sn_avt 
       slf_d(jf_uwd) = sn_uwd   ;   slf_d(jf_vwd)  = sn_vwd   ;   slf_d(jf_wwd) = sn_wwd
+
+      !
+      IF ( ln_dynrnf ) THEN
+                jf_rnf = jfld + 1  ;  jfld  = jf_rnf
+         slf_d(jf_rnf) = sn_rnf
+      ELSE
+         rnf (:,:) = 0._wp
+      ENDIF
+
       !
       IF( .NOT.ln_degrad ) THEN     ! no degrad option
          IF( lk_traldf_eiv .AND. ln_dynbbl ) THEN        ! eiv & bbl
-                 jf_ubl  = 13      ;         jf_vbl  = 14      ;         jf_eiw  = 15   ;   jfld = 15
+                 jf_ubl  = jfld + 1 ;        jf_vbl  = jfld + 2 ;        jf_eiw  = jfld + 3   ;   jfld = jf_eiw
            slf_d(jf_ubl) = sn_ubl  ;   slf_d(jf_vbl) = sn_vbl  ;   slf_d(jf_eiw) = sn_eiw
          ENDIF
          IF( .NOT.lk_traldf_eiv .AND. ln_dynbbl ) THEN   ! no eiv & bbl
-                 jf_ubl  = 13      ;         jf_vbl  = 14      ;   jfld = 14
+                 jf_ubl  = jfld + 1 ;        jf_vbl  = jfld + 2 ;  jfld = jf_vbl
            slf_d(jf_ubl) = sn_ubl  ;   slf_d(jf_vbl) = sn_vbl
          ENDIF
          IF( lk_traldf_eiv .AND. .NOT.ln_dynbbl ) THEN   ! eiv & no bbl
-           jf_eiw = 13   ;   jfld = 13   ;   slf_d(jf_eiw) = sn_eiw
+           jf_eiw = jfld + 1 ; jfld = jf_eiw ; slf_d(jf_eiw) = sn_eiw
          ENDIF
       ELSE
-              jf_ahu  = 13      ;         jf_ahv  = 14      ;         jf_ahw  = 15   ;   jfld = 15
+              jf_ahu  = jfld + 1 ;        jf_ahv  = jfld + 2 ;        jf_ahw  = jfld + 3  ;  jfld = jf_ahw
         slf_d(jf_ahu) = sn_ahu  ;   slf_d(jf_ahv) = sn_ahv  ;   slf_d(jf_ahw) = sn_ahw
         IF( lk_traldf_eiv .AND. ln_dynbbl ) THEN         ! eiv & bbl
-                 jf_ubl  = 16      ;         jf_vbl  = 17      
-           slf_d(jf_ubl) = sn_ubl  ;   slf_d(jf_vbl) = sn_vbl  
-                 jf_eiu  = 18      ;         jf_eiv  = 19      ;          jf_eiw  = 20   ;   jfld = 20
+                 jf_ubl  = jfld + 1 ;        jf_vbl  = jfld + 2 ;
+           slf_d(jf_ubl) = sn_ubl  ;   slf_d(jf_vbl) = sn_vbl
+                 jf_eiu  = jfld + 3 ;        jf_eiv  = jfld + 4 ;    jf_eiw  = jfld + 5   ;  jfld = jf_eiw 
            slf_d(jf_eiu) = sn_eiu  ;   slf_d(jf_eiv) = sn_eiv  ;    slf_d(jf_eiw) = sn_eiw
         ENDIF
         IF( .NOT.lk_traldf_eiv .AND. ln_dynbbl ) THEN    ! no eiv & bbl
-                 jf_ubl  = 16      ;         jf_vbl  = 17      ;   jfld = 17
+                 jf_ubl  = jfld + 1 ;        jf_vbl  = jfld + 2 ;  jfld = jf_vbl
            slf_d(jf_ubl) = sn_ubl  ;   slf_d(jf_vbl) = sn_vbl
         ENDIF
         IF( lk_traldf_eiv .AND. .NOT.ln_dynbbl ) THEN    ! eiv & no bbl
-                 jf_eiu  = 16      ;         jf_eiv  = 17      ;         jf_eiw  = 18   ;   jfld = 18
+                 jf_eiu  = jfld + 1 ;         jf_eiv  = jfld + 2 ;    jf_eiw  = jfld + 3   ; jfld = jf_eiw 
            slf_d(jf_eiu) = sn_eiu  ;   slf_d(jf_eiv) = sn_eiv  ;   slf_d(jf_eiw) = sn_eiw
         ENDIF
Index: /trunk/NEMOGCM/NEMO/OPA_SRC/DIA/diawri.F90
===================================================================
--- /trunk/NEMOGCM/NEMO/OPA_SRC/DIA/diawri.F90	(revision 4569)
+++ /trunk/NEMOGCM/NEMO/OPA_SRC/DIA/diawri.F90	(revision 4570)
@@ -152,5 +152,5 @@
          z3d(:,:,1) = tsn(:,:,1,jp_tem) * z3d(:,:,1)
          CALL iom_put( "sst2" , z3d(:,:,1)                 )   ! sea surface content of squared temperature
-         z3d(:,:,:) = tsn(:,:,:,jp_sal) * fse3t_n(:,:,:)
+         z3d(:,:,:) = tsn(:,:,:,jp_sal) * fse3t_n(:,:,:)            
          CALL iom_put( "soce" , z3d                        )   ! salinity content
          CALL iom_put( "sss"  , z3d(:,:,1)                 )   ! sea surface salinity content
@@ -431,4 +431,6 @@
          CALL histdef( nid_T, "sowaflup", "Net Upward Water Flux"              , "Kg/m2/s",   &  ! (emp-rnf)
             &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout )
+         CALL histdef( nid_T, "sorunoff", "River runoffs"                      , "Kg/m2/s",   &  ! runoffs
+            &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout )
          CALL histdef( nid_T, "sosfldow", "downward salt flux"                 , "PSU/m2/s",  &  ! sfx
             &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout )
@@ -642,4 +644,5 @@
       CALL histwrite( nid_T, "sossheig", it, sshn          , ndim_hT, ndex_hT )   ! sea surface height
       CALL histwrite( nid_T, "sowaflup", it, ( emp-rnf )   , ndim_hT, ndex_hT )   ! upward water flux
+      CALL histwrite( nid_T, "sorunoff", it, rnf           , ndim_hT, ndex_hT )   ! river runoffs
       CALL histwrite( nid_T, "sosfldow", it, sfx           , ndim_hT, ndex_hT )   ! downward salt flux 
                                                                                   ! (includes virtual salt flux beneath ice 
