Index: /branches/UKMO/AMM15_v3_6_STABLE_package_collate_coupling/NEMOGCM/CONFIG/SHARED/namelist_ref
===================================================================
--- /branches/UKMO/AMM15_v3_6_STABLE_package_collate_coupling/NEMOGCM/CONFIG/SHARED/namelist_ref	(revision 10478)
+++ /branches/UKMO/AMM15_v3_6_STABLE_package_collate_coupling/NEMOGCM/CONFIG/SHARED/namelist_ref	(revision 10479)
@@ -399,4 +399,6 @@
    ln_usecplmask = .false.   !  use a coupling mask file to merge data received from several models
                              !   -> file cplmask.nc with the float variable called cplmask (jpi,jpj,nn_cplmodel)
+   ln_usernfmask = .false.   !  use a runoff mask file to merge data received from several models 
+                             !   -> file rnfmask.nc with the float variable called rnfmask (jpi,jpj,nn_cplmodel)
 /
 !-----------------------------------------------------------------------
Index: /branches/UKMO/AMM15_v3_6_STABLE_package_collate_coupling/NEMOGCM/NEMO/OPA_SRC/SBC/sbc_oce.F90
===================================================================
--- /branches/UKMO/AMM15_v3_6_STABLE_package_collate_coupling/NEMOGCM/NEMO/OPA_SRC/SBC/sbc_oce.F90	(revision 10478)
+++ /branches/UKMO/AMM15_v3_6_STABLE_package_collate_coupling/NEMOGCM/NEMO/OPA_SRC/SBC/sbc_oce.F90	(revision 10479)
@@ -48,4 +48,6 @@
    LOGICAL , PUBLIC ::   ln_ssr         !: Sea Surface restoring on SST and/or SSS      
    LOGICAL , PUBLIC ::   ln_apr_dyn     !: Atmospheric pressure forcing used on dynamics (ocean & ice)
+   LOGICAL, PUBLIC  ::   ln_usernfmask = .false.   !  use a runoff mask file to merge data received from several models 
+                                                   !   -> file rnfmask.nc with the float variable called rnfmask (jpi,jpj,nn_cplmodel)
    INTEGER , PUBLIC ::   nn_ice         !: flag for ice in the surface boundary condition (=0/1/2/3)
    INTEGER , PUBLIC ::   nn_isf         !: flag for isf in the surface boundary condition (=0/1/2/3/4) 
@@ -152,4 +154,5 @@
 #endif
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: xcplmask          !: coupling mask for ln_mixcpl (warning: allocated in sbccpl)
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: xrnfmask          !: coupling mask for ln_usernfmask (warning: allocated in sbcrnf)
 
    !!----------------------------------------------------------------------
Index: /branches/UKMO/AMM15_v3_6_STABLE_package_collate_coupling/NEMOGCM/NEMO/OPA_SRC/SBC/sbccpl.F90
===================================================================
--- /branches/UKMO/AMM15_v3_6_STABLE_package_collate_coupling/NEMOGCM/NEMO/OPA_SRC/SBC/sbccpl.F90	(revision 10478)
+++ /branches/UKMO/AMM15_v3_6_STABLE_package_collate_coupling/NEMOGCM/NEMO/OPA_SRC/SBC/sbccpl.F90	(revision 10479)
@@ -252,5 +252,5 @@
          &                  sn_rcv_wdrag, sn_rcv_qns   , sn_rcv_emp   , sn_rcv_rnf  , sn_rcv_cal ,     & 
          &                  sn_rcv_iceflx, sn_rcv_co2   , sn_rcv_mslp , sn_rcv_tauw ,                  & 
-         &                  nn_cplmodel, ln_usecplmask
+         &                  nn_cplmodel, ln_usecplmask, ln_usernfmask
       !!---------------------------------------------------------------------
       !
@@ -320,4 +320,5 @@
          WRITE(numout,*)'  nn_cplmodel                         = ', nn_cplmodel
          WRITE(numout,*)'  ln_usecplmask                       = ', ln_usecplmask
+         WRITE(numout,*)'  ln_usernfmask                       = ', ln_usernfmask
       ENDIF
 
@@ -458,5 +459,5 @@
       IF( TRIM( sn_rcv_rnf%cldes ) == 'coupled' ) THEN
          srcv(jpr_rnf)%laction = .TRUE.
-         l_rnfcpl              = .TRUE.                      ! -> no need to read runoffs in sbcrnf
+         l_rnfcpl              = .NOT. ln_usernfmask         ! -> no need to read runoffs in sbcrnf
          ln_rnf                = nn_components /= jp_iam_sas ! -> force to go through sbcrnf if not sas
          IF(lwp) WRITE(numout,*)
Index: /branches/UKMO/AMM15_v3_6_STABLE_package_collate_coupling/NEMOGCM/NEMO/OPA_SRC/SBC/sbcrnf.F90
===================================================================
--- /branches/UKMO/AMM15_v3_6_STABLE_package_collate_coupling/NEMOGCM/NEMO/OPA_SRC/SBC/sbcrnf.F90	(revision 10478)
+++ /branches/UKMO/AMM15_v3_6_STABLE_package_collate_coupling/NEMOGCM/NEMO/OPA_SRC/SBC/sbcrnf.F90	(revision 10479)
@@ -82,5 +82,6 @@
       ALLOCATE( rnfmsk(jpi,jpj)         , rnfmsk_z(jpk)          ,     &
          &      h_rnf (jpi,jpj)         , nk_rnf  (jpi,jpj)      ,     &
-         &      rnf_tsc_b(jpi,jpj,jpts) , rnf_tsc (jpi,jpj,jpts) , STAT=sbc_rnf_alloc )
+         &      rnf_tsc_b(jpi,jpj,jpts) , rnf_tsc (jpi,jpj,jpts) ,     & 
+         &      xrnfmask(jpi,jpj,1)     , STAT=sbc_rnf_alloc )
          !
       IF( lk_mpp            )   CALL mpp_sum ( sbc_rnf_alloc )
@@ -128,5 +129,6 @@
       IF( MOD( kt - 1, nn_fsbc ) == 0 ) THEN
          !
-         IF( .NOT. l_rnfcpl )   rnf(:,:) = rn_rfact * ( sf_rnf(1)%fnow(:,:,1) )       ! updated runoff value at time step kt
+         IF( .NOT. l_rnfcpl )   & 
+             rnf(:,:) = rnf(:,:) * (1. - xrnfmask(:,:,1)) + rn_rfact * sf_rnf(1)%fnow(:,:,1) * xrnfmask(:,:,1)  ! updated runoff value at time step kt
          !
          !                                                     ! set temperature & salinity content of runoffs
@@ -442,4 +444,13 @@
       ENDIF
       !
+      xrnfmask(:,:,:) = 1.    ! default value for points using river forcing 
+      IF (ln_usernfmask) THEN 
+         IF(lwp) WRITE(numout,*) 
+         IF(lwp) WRITE(numout,*) '          runoff mask read in a file' 
+         CALL iom_open( 'rnfmask', inum ) 
+         CALL iom_get( inum, jpdom_data, 'rnfmask', xrnfmask(:,:,1), 1) 
+         CALL iom_close( inum ) 
+      ENDIF 
+      !
       rnf(:,:) =  0._wp                         ! runoff initialisation
       rnf_tsc(:,:,:) = 0._wp                    ! runoffs temperature & salinty contents initilisation
