Index: branches/2015/dev_r5218_CNRS17_coupling/NEMOGCM/NEMO/OPA_SRC/SBC/sbcrnf.F90
===================================================================
--- branches/2015/dev_r5218_CNRS17_coupling/NEMOGCM/NEMO/OPA_SRC/SBC/sbcrnf.F90	(revision 5219)
+++ branches/2015/dev_r5218_CNRS17_coupling/NEMOGCM/NEMO/OPA_SRC/SBC/sbcrnf.F90	(revision 5381)
@@ -51,4 +51,6 @@
    REAL(wp)          , PUBLIC ::   rn_rfact        !: multiplicative factor for runoff
 
+   LOGICAL           , PUBLIC ::   l_rnfcpl = .false.       ! runoffs recieved from oasis
+
    INTEGER , PUBLIC  ::   nkrnf = 0         !: nb of levels over which Kz is increased at river mouths
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   rnfmsk              !: river mouth mask (hori.)
@@ -120,11 +122,11 @@
          !                                                !-------------------!
          !
-                             CALL fld_read ( kt, nn_fsbc, sf_rnf   )    ! Read Runoffs data and provide it at kt
-         IF( ln_rnf_tem  )   CALL fld_read ( kt, nn_fsbc, sf_t_rnf )    ! idem for runoffs temperature if required
-         IF( ln_rnf_sal  )   CALL fld_read ( kt, nn_fsbc, sf_s_rnf )    ! idem for runoffs salinity    if required
+         IF( .NOT. l_rnfcpl )   CALL fld_read ( kt, nn_fsbc, sf_rnf   )    ! Read Runoffs data and provide it at kt
+         IF(   ln_rnf_tem   )   CALL fld_read ( kt, nn_fsbc, sf_t_rnf )    ! idem for runoffs temperature if required
+         IF(   ln_rnf_sal   )   CALL fld_read ( kt, nn_fsbc, sf_s_rnf )    ! idem for runoffs salinity    if required
          !
          ! Runoff reduction only associated to the ORCA2_LIM configuration
          ! when reading the NetCDF file runoff_1m_nomask.nc
-         IF( cp_cfg == 'orca' .AND. jp_cfg == 2 )   THEN
+         IF( cp_cfg == 'orca' .AND. jp_cfg == 2 .AND. .NOT. l_rnfcpl )   THEN
             WHERE( 40._wp < gphit(:,:) .AND. gphit(:,:) < 65._wp )
                sf_rnf(1)%fnow(:,:,1) = 0.85 * sf_rnf(1)%fnow(:,:,1)
@@ -134,5 +136,5 @@
          IF( MOD( kt - 1, nn_fsbc ) == 0 ) THEN
             !
-            rnf(:,:) = rn_rfact * ( sf_rnf(1)%fnow(:,:,1) )       ! updated runoff value at time step kt
+            IF( .NOT. l_rnfcpl )   rnf(:,:) = rn_rfact * ( sf_rnf(1)%fnow(:,:,1) )       ! updated runoff value at time step kt
             !
             !                                                     ! set temperature & salinity content of runoffs
@@ -152,8 +154,4 @@
             IF( ln_rnf_sal )   rnf_tsc(:,:,jp_sal) = ( sf_s_rnf(1)%fnow(:,:,1) ) * rnf(:,:) * r1_rau0
             !                                                           ! else use S=0 for runoffs (done one for all in the init)
-            IF ( ANY( rnf(:,:) < 0._wp ) ) z_err=1
-            IF(lk_mpp) CALL mpp_sum(z_err)
-            IF( z_err > 0 ) CALL ctl_stop( 'sbc_rnf : negative runnoff values exist' )
-            !
             CALL iom_put( "runoffs", rnf )         ! output runoffs arrays
          ENDIF
@@ -161,4 +159,5 @@
       ENDIF
       !
+      !                                                ! ---------------------------------------- !
       IF( kt == nit000 ) THEN                          !   set the forcing field at nit000 - 1    !
          !                                             ! ---------------------------------------- !
@@ -290,4 +289,7 @@
       ENDIF
       !
+      IF( ln_rnf_emp .AND. nn_components == jp_iam_opa ) THEN
+         CALL ctl_stop( 'sbc_rnf_init: ln_rnf_emp must be false in case of SAS-OPA coupling' )   ;   RETURN
+      ENDIF
       !                                   ! ==================
       !                                   !   Type of runoff
@@ -306,14 +308,15 @@
       ELSE                                      !==  runoffs read in a file : set sf_rnf structure  ==!
          !
-         ALLOCATE( sf_rnf(1), STAT=ierror )         ! Create sf_rnf structure (runoff inflow)
-         IF(lwp) WRITE(numout,*)
-         IF(lwp) WRITE(numout,*) '          runoffs inflow read in a file'
-         IF( ierror > 0 ) THEN
-            CALL ctl_stop( 'sbc_rnf: unable to allocate sf_rnf structure' )   ;   RETURN
-         ENDIF
-         ALLOCATE( sf_rnf(1)%fnow(jpi,jpj,1)   )
-         IF( sn_rnf%ln_tint ) ALLOCATE( sf_rnf(1)%fdta(jpi,jpj,1,2) )
-         !                                          ! fill sf_rnf with the namelist (sn_rnf) and control print
-         CALL fld_fill( sf_rnf, (/ sn_rnf /), cn_dir, 'sbc_rnf_init', 'read runoffs data', 'namsbc_rnf' )
+         IF( .NOT. l_rnfcpl ) THEN                    
+            ALLOCATE( sf_rnf(1), STAT=ierror )      ! Create (if required) sf_rnf structure (runoff inflow)
+            IF(lwp) WRITE(numout,*)
+            IF(lwp) WRITE(numout,*) '          runoffs inflow read in a file'
+            IF( ierror > 0 ) THEN
+               CALL ctl_stop( 'sbc_rnf: unable to allocate sf_rnf structure' )   ;   RETURN
+            ENDIF
+            ALLOCATE( sf_rnf(1)%fnow(jpi,jpj,1)   )
+            IF( sn_rnf%ln_tint ) ALLOCATE( sf_rnf(1)%fdta(jpi,jpj,1,2) )
+            CALL fld_fill( sf_rnf, (/ sn_rnf /), cn_dir, 'sbc_rnf_init', 'read runoffs data', 'namsbc_rnf' )
+         ENDIF
          !
          IF( ln_rnf_tem ) THEN                      ! Create (if required) sf_t_rnf structure
