Index: /trunk/NEMO/LIM_SRC/limsbc.F90
===================================================================
--- /trunk/NEMO/LIM_SRC/limsbc.F90	(revision 702)
+++ /trunk/NEMO/LIM_SRC/limsbc.F90	(revision 702)
@@ -0,0 +1,252 @@
+MODULE limsbc
+   !!======================================================================
+   !!                       ***  MODULE limsbc   ***
+   !!           computation of the flux at the sea ice/ocean interface
+   !!======================================================================
+   !! History : 00-01 (H. Goosse) Original code
+   !!           02-07 (C. Ethe, G. Madec) re-writing F90
+   !!           06-07 (G. Madec) surface module
+   !!----------------------------------------------------------------------
+#if defined key_ice_lim
+   !!----------------------------------------------------------------------
+   !!   'key_ice_lim'                                     LIM sea-ice model
+   !!----------------------------------------------------------------------
+   !!----------------------------------------------------------------------
+   !!   lim_sbc  : flux at the ice / ocean interface
+   !!----------------------------------------------------------------------
+   USE par_oce          ! ocean parameters
+   USE dom_oce          ! ocean domain
+   USE sbc_ice          ! surface boundary condition
+   USE sbc_oce          ! surface boundary condition
+   USE phycst           ! physical constants
+   USE ocfzpt           ! surface ocean freezing point
+   USE ice_oce          ! sea-ice variable
+   USE ice              ! LIM sea-ice variables
+   USE iceini           ! ???
+   USE dynspg_oce       ! choice of the surface pressure gradient scheme 
+
+   USE lbclnk           ! ocean lateral boundary condition
+   USE in_out_manager   ! I/O manager
+   USE albedo           ! albedo parameters
+   USE prtctl           ! Print control
+
+   IMPLICIT NONE
+   PRIVATE
+
+   PUBLIC lim_sbc       ! called by lim_step
+
+   REAL(wp)  ::   epsi16 = 1.e-16  ! constant values
+   REAL(wp)  ::   rzero  = 0.e0    
+   REAL(wp)  ::   rone   = 1.e0
+
+   !! * Substitutions
+#  include "vectopt_loop_substitute.h90"
+   !!----------------------------------------------------------------------
+   !!   LIM 2.0,  UCL-LOCEAN-IPSL (2006) 
+   !! $Header: $
+   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
+
+CONTAINS
+
+   SUBROUTINE lim_sbc( kt )
+      !!-------------------------------------------------------------------
+      !!                ***  ROUTINE lim_sbc ***
+      !!  
+      !! ** Purpose : Update surface ocean boundary condition over areas
+      !!      that are at least partially covered by sea-ice
+      !!         
+      !! ** Action  : - comput. of the momentum, heat and freshwater/salt
+      !!      fluxes at the ice-ocean interface.
+      !!              - Update 
+      !!     
+      !! ** Outputs : - fsolar  : solar heat flux at sea ice/ocean interface
+      !!              - fnsolar : non solar heat flux 
+      !!              - fsalt   : salt flux at sea ice/ocean interface
+      !!              - fmass   : freshwater flux at sea ice/ocean interface
+      !!
+      !! References : Goosse, H. et al. 1996, Bul. Soc. Roy. Sc. Liege, 65, 87-90.
+      !!              Tartinville et al. 2001 Ocean Modelling, 3, 95-108.
+      !!---------------------------------------------------------------------
+      INTEGER ::   kt    ! number of iteration
+      !!
+      INTEGER  ::   ji, jj           ! dummy loop indices
+      INTEGER  ::   ifvt, i1mfr, idfr               ! some switches
+      INTEGER  ::   iflt, ial, iadv, ifral, ifrdv
+      REAL(wp) ::   zqsr  , zqns     ! solar & non solar heat flux
+      REAL(wp) ::   zinda            ! switch for testing the values of ice concentration
+      REAL(wp) ::   zfons            ! salt exchanges at the ice/ocean interface
+      REAL(wp) ::   zemp             ! freshwater exchanges at the ice/ocean interface
+      REAL(wp) ::   zfrldu, zfrldv   ! lead fraction at U- & V-points
+      REAL(wp) ::   zutau , zvtau    ! lead fraction at U- & V-points
+      REAL(wp) ::   zu_io , zv_io    ! 2 components of the ice-ocean velocity
+#if defined key_coupled    
+      REAL(wp), DIMENSION(jpi,jpj) ::   zalb     ! albedo of ice under overcast sky
+      REAL(wp), DIMENSION(jpi,jpj) ::   zalcn    ! albedo of ocean under overcast sky
+      REAL(wp), DIMENSION(jpi,jpj) ::   zalbp    ! albedo of ice under clear sky
+      REAL(wp), DIMENSION(jpi,jpj) ::   zaldum   ! albedo of ocean under clear sky
+#endif
+      REAL(wp) ::   zsang, zmod, zfm
+      REAL(wp), DIMENSION(jpi,jpj) ::   ztio_u, ztio_v   ! ocean stress below sea-ice
+
+      !!---------------------------------------------------------------------
+     
+      IF( kt == nit000 ) THEN
+         IF(lwp) WRITE(numout,*)
+         IF(lwp) WRITE(numout,*) 'lim_sbc : LIM sea-ice - surface boundary condition'
+         IF(lwp) WRITE(numout,*) '~~~~~~~   '
+      ENDIF
+
+      !------------------------------------------!
+      !      heat flux at the ocean surface      !
+      !------------------------------------------!
+
+!!gm
+!!gm CAUTION   
+!!gm re-verifies the non solar expression, especially over open ocen
+!!gm
+      DO jj = 1, jpj
+         DO ji = 1, jpi
+            zinda   = 1.0   - MAX( rzero , SIGN( rone, - ( 1.0 - pfrld(ji,jj) )   ) )
+            ifvt    = zinda * MAX( rzero , SIGN( rone,  - phicif(ji,jj)           ) )
+            i1mfr   = 1.0   - MAX( rzero , SIGN( rone, - ( 1.0 - frld(ji,jj) )    ) )
+            idfr    = 1.0   - MAX( rzero , SIGN( rone, frld(ji,jj) - pfrld(ji,jj) ) )
+            iflt    = zinda  * (1 - i1mfr) * (1 - ifvt )
+            ial     = ifvt   * i1mfr + ( 1 - ifvt ) * idfr
+            iadv    = ( 1  - i1mfr ) * zinda
+            ifral   = ( 1  - i1mfr * ( 1 - ial ) )   
+            ifrdv   = ( 1  - ifral * ( 1 - ial ) ) * iadv 
+            !   computation the solar flux at ocean surface
+            zqsr    = pfrld(ji,jj) * qsr(ji,jj)  + ( 1. - pfrld(ji,jj) ) * fstric(ji,jj)
+            !  computation the non solar heat flux at ocean surface
+            zqns    =  - ( 1. - thcm(ji,jj) ) * zqsr   &   ! part of the solar energy used in leads
+               &       + iflt    * ( fscmbq(ji,jj) + ffltbif(ji,jj) )                            &
+               &       + ifral   * ( ial * qcmif(ji,jj) + (1 - ial) * qldif(ji,jj) ) / rdt_ice   &
+               &       + ifrdv   * ( qfvbq(ji,jj) + qdtcn(ji,jj) ) / rdt_ice
+
+            fsbbq(ji,jj) = ( 1.0 - ( ifvt + iflt ) ) * fscmbq(ji,jj)     ! ???
+            
+            qsr  (ji,jj) = zqsr                                          ! solar heat flux 
+            qns  (ji,jj) = zqns - fdtcn(ji,jj)                           ! non solar heat flux
+         END DO
+      END DO
+  
+      !------------------------------------------!
+      !      mass flux at the ocean surface      !
+      !------------------------------------------!
+
+!!gm
+!!gm CAUTION   
+!!gm re-verifies the emp & emps expression, especially the absence of 1-frld on zfm
+!!gm
+      DO jj = 1, jpj
+         DO ji = 1, jpi
+            
+            !  computing freshwater exchanges at the ice/ocean interface
+            zemp = + emp(ji,jj)     *         frld(ji,jj)      &   !  e-p budget over open ocean fraction 
+               !                                                   !  ice-covered fraction:
+               &   - tprecip(ji,jj) * ( 1. -  frld(ji,jj) )    &   !  liquid precipitation reaches directly the ocean
+               &   + sprecip(ji,jj) * ( 1. - pfrld(ji,jj) )    &   !  taking into account change in ice cover within the time step
+               &   + rdmsnif(ji,jj) / rdt_ice                      !  freshwaterflux due to snow melting 
+
+!!gm old    zemp = + evap(ji,jj) * frld(ji,jj)                 &   !  evaporation over oceanic fraction
+!!gm old       &   - tprecip(ji,jj)                            &   !  total precipitation
+!!gm old       &   + sprecip(ji,jj) * ( 1. - pfrld(ji,jj) )    &   !  remov. snow precip over ice (store over sea-ice)
+!!gm old       &   + rdmsnif(ji,jj) / rdt_ice                      !  freshwaterflux due to snow melting 
+            
+            !  computing salt exchanges at the ice/ocean interface
+            zfons =  ( soce - sice ) * ( rdmicif(ji,jj) / rdt_ice ) 
+            
+            !  converting the salt flux from ice to a freshwater flux from ocean
+!!gm old    zfm  = zfons / ( sss_io(ji,jj) + epsi16 )
+            zfm  = zfons / ( sss_m(ji,jj) + epsi16 )
+            
+            emps(ji,jj) = zemp + zfm      ! surface ocean concentration/dilution effect (use on SSS evolution)
+            emp (ji,jj) = zemp            ! surface ocean volume flux (use on sea-surface height evolution)
+
+         END DO
+      END DO
+
+      IF( lk_dynspg_rl )    emp (:,:) = emps(:,:)      ! rigid-lid formulation : emp = emps
+
+      !------------------------------------------!
+      !    momentum flux at the ocean surface    !
+      !------------------------------------------!
+
+      IF ( ln_limdyn ) THEN                        ! Update the stress over ice-over area (only in ice-dynamic case)
+         !                                         ! otherwise the atmosphere-ocean stress is used everywhere
+
+         ! ... ice stress over ocean with a ice-ocean rotation angle (at I-point)
+!CDIR NOVERRCHK
+         DO jj = 1, jpj
+!CDIR NOVERRCHK
+            DO ji = 1, jpi
+               ! ... change the cosinus angle sign in the south hemisphere
+               zsang  = SIGN(1.e0, gphif(ji-1,jj-1) ) * sangvg 
+               ! ... ice velocity relative to the ocean
+               zu_io  = u_ice(ji,jj) - u_oce(ji,jj)
+               zv_io  = v_ice(ji,jj) - v_oce(ji,jj)
+               zmod   = SQRT( zu_io * zu_io + zv_io * zv_io )
+               ! ... ice stress over ocean with a ice-ocean rotation angle (at I-point)
+               ztio_u(ji,jj) = cw * zmod * ( cangvg * zu_io - zsang * zv_io )
+               ztio_v(ji,jj) = cw * zmod * ( cangvg * zv_io + zsang * zu_io )
+               ! 
+            END DO
+         END DO
+
+         DO jj = 2, jpjm1
+            DO ji = 2, jpim1
+               ! ... ice-cover wheighted ice-ocean stress at U and V-points  (from I-point values)
+               zutau  = 0.5 * ( ztio_u(ji+1,jj) + ztio_u(ji+1,jj+1) )
+               zvtau  = 0.5 * ( ztio_v(ji,jj+1) + ztio_u(ji+1,jj+1) )
+               ! ... open-ocean (lead) fraction at U- & V-points (from T-point values)
+               zfrldu = 0.5 * ( frld (ji,jj) + frld (ji+1,jj  ) )
+               zfrldv = 0.5 * ( frld (ji,jj) + frld (ji  ,jj+1) )
+               ! update surface ocean stress
+               utau(ji,jj) = zfrldu * utau(ji,jj) + ( 1. - zfrldu ) * zutau
+               vtau(ji,jj) = zfrldv * vtau(ji,jj) + ( 1. - zfrldv ) * zvtau
+               !
+            END DO
+         END DO
+
+         ! boundary condition on the stress (utau,vtau)
+         CALL lbc_lnk( utau, 'U', -1. )
+         CALL lbc_lnk( vtau, 'V', -1. )
+
+      ENDIF
+
+#if defined key_coupled            
+      !------------------------------------------------!
+      !    Computation of snow/ice and ocean albedo    !
+      !------------------------------------------------!
+      zalb  (:,:) = 0.e0
+      zalcn (:,:) = 0.e0
+      zalbp (:,:) = 0.e0
+      zaldum(:,:) = 0.e0
+
+      CALL flx_blk_albedo( zalb, zalcn, zalbp, zaldum )
+
+      alb_ice(:,:) =  0.5 * zalbp(:,:) + 0.5 * zalb (:,:)   ! Ice albedo (mean clear and overcast skys)
+#endif
+
+      IF(ln_ctl) THEN
+         CALL prt_ctl(tab2d_1=qsr , clinfo1=' lim_sbc: qsr  : ', tab2d_2=qns , clinfo2=' qns  : ')
+         CALL prt_ctl(tab2d_1=emp , clinfo1=' lim_sbc: emp  : ', tab2d_2=emps, clinfo2=' emps : ')
+         CALL prt_ctl(tab2d_1=utau, clinfo1=' lim_sbc: utau : ', tab2d_2=vtau, clinfo2=' vtau : ')
+!!gm tn_ice ???  what is it now?
+!!gm     CALL prt_ctl(tab2d_1=freeze, clinfo1=' lim_sbc: freeze : ', tab2d_2=tn_ice , clinfo2=' tn_ice  : ')
+      ENDIF 
+   
+    END SUBROUTINE lim_sbc
+
+#else
+   !!----------------------------------------------------------------------
+   !!   Default option :        Dummy module           NO LIM sea-ice model
+   !!----------------------------------------------------------------------
+CONTAINS
+   SUBROUTINE lim_sbc         ! Dummy routine
+   END SUBROUTINE lim_sbc
+#endif 
+
+   !!======================================================================
+END MODULE limsbc
Index: /trunk/NEMO/OPA_SRC/SBC/fldread.F90
===================================================================
--- /trunk/NEMO/OPA_SRC/SBC/fldread.F90	(revision 702)
+++ /trunk/NEMO/OPA_SRC/SBC/fldread.F90	(revision 702)
@@ -0,0 +1,260 @@
+MODULE fldread
+   !!======================================================================
+   !!                       ***  MODULE  fldread  ***
+   !! Ocean forcing:  read input field for surface boundary condition
+   !!=====================================================================
+   !! History :  9.0  !  06-06  (G. Madec) Original code
+   !!----------------------------------------------------------------------
+
+   !!----------------------------------------------------------------------
+   !!   fld_read      : read input fields used for the computation of the
+   !!                   surface boundary condition
+   !!----------------------------------------------------------------------
+   USE oce             ! ocean dynamics and tracers
+   USE dom_oce         ! ocean space and time domain
+   USE phycst          ! ???
+   USE daymod          ! calendar
+   USE in_out_manager  ! I/O manager
+   USE iom             ! I/O manager library
+
+   IMPLICIT NONE
+   PRIVATE   
+
+   TYPE, PUBLIC ::   FLD_N      !: Namelist field informations
+      CHARACTER(len = 34) ::   clname      ! generic name of the NetCDF flux file
+      REAL(wp)            ::   freqh       ! frequency of each flux file
+      CHARACTER(len = 34) ::   clvar       ! generic name of the variable in the NetCDF flux file
+      LOGICAL             ::   ln_tint     ! time interpolation or not (T/F)
+      INTEGER             ::   nclim       ! =0 interannuel, =1 climatology
+      INTEGER             ::   nstrec      ! starting record, used if nclim=1 (=0 last record of previous year) 
+   END TYPE FLD_N
+
+   TYPE, PUBLIC ::   FLD        !: Input field related variables
+      CHARACTER(len = 256)            ::   clrootname   ! generic name of the NetCDF file
+      CHARACTER(len = 256)            ::   clname       ! current name of the NetCDF file
+      REAL(wp)                        ::   freqh        ! frequency of each flux file
+      CHARACTER(len = 34)             ::   clvar        ! generic name of the variable in the NetCDF flux file
+      LOGICAL                         ::   ln_tint      ! time interpolation or not (T/F)
+      INTEGER                         ::   nyear        ! year of the file (=0000 if climatology)
+      INTEGER                         ::   nclim        ! =0 interannuel, =1 climatology
+      INTEGER                         ::   nstrec       ! starting record if nclim=1 (=0 last record of previous year) 
+      INTEGER                         ::   num          ! logical units of the jpfld files to be read
+      REAL(wp) , DIMENSION(2)         ::   rec_b        ! before record info (1: index, 2: second since Jan. 1st 00h)
+      REAL(wp) , DIMENSION(2)         ::   rec_n        ! now    record info (1: index, 2: second since Jan. 1st 00h)
+      REAL(wp) , DIMENSION(2)         ::   rec_a        ! next   record info (1: index, 2: second since Jan. 1st 00h)
+      REAL(wp) , DIMENSION(2)         ::   rec          ! record time in second since jan. 1st for the 2 records read
+      REAL(wp) , DIMENSION(jpi,jpj)   ::   fnow         ! input fields interpolated to now time step
+      REAL(wp) , DIMENSION(jpi,jpj,2) ::   fdta         !  2 consecutive record of input fields
+   END TYPE FLD
+
+   PUBLIC   fld_read    ! called by sbc... modules
+
+   !!----------------------------------------------------------------------
+   !!   OPA 9.0 , LOCEAN-IPSL (2006) 
+   !! $Header: $
+   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
+
+CONTAINS
+
+   SUBROUTINE fld_read( kt, kn_fsbc, sd )
+      !!---------------------------------------------------------------------
+      !!                    ***  ROUTINE fld_read  ***
+      !!                   
+      !! ** Purpose :   provide at each time step the surface ocean fluxes
+      !!                (momentum, heat, freshwater and runoff) 
+      !!
+      !! ** Method  :   READ each input fields in NetCDF files using IOM
+      !!      and intepolate it to the model time-step.
+      !!         Several assumptions are made on the input file:
+      !!      blahblahblah....
+      !!----------------------------------------------------------------------
+      INTEGER  , INTENT(in   )               ::   kt        ! ocean time step
+      INTEGER  , INTENT(in   )               ::   kn_fsbc   ! ocean time step
+      TYPE(FLD), INTENT(inout), DIMENSION(:) ::   sd        ! input field related variables
+      !!
+      INTEGER  ::   jf                     ! dummy indices
+      INTEGER  ::   imf                    ! size of the structure sd
+      REAL(wp) ::   zt                     ! ratio at kt between the 2 records
+      REAL(wp), DIMENSION(2) ::   zrec_kt
+      !!---------------------------------------------------------------------
+
+      imf = SIZE( sd )       ! dummy indices
+
+      !                                         ! ===================== !
+      DO jf = 1, imf                            !    LOOP OVER FIELD    !
+         !                                      ! ===================== !
+         !
+         !                                            ! ====================== !
+         IF( kt == nit000 ) THEN                      !     Initialisation     !
+            !                                         ! ====================== !
+            !
+            !                                             ! set filename for current year 
+            SELECT CASE( sd(jf)%nclim )
+            CASE( 0 )   
+               WRITE(sd(jf)%clname, '(a,"_",i4,".nc")' ) TRIM( sd(jf)%clrootname ), nyear
+               sd(jf)%nyear = nyear
+            CASE( 1 )   
+               WRITE(sd(jf)%clname, '(a,  "_0000.nc")' ) TRIM( sd(jf)%clrootname )
+               sd(jf)%nyear = 0000
+            END SELECT
+            CALL iom_open( sd(jf)%clname, sd(jf)%num )    ! open input files
+            !
+            IF( sd(jf)%ln_tint ) THEN                     ! time interpolation: read previous record in now field
+               !
+               sd(jf)%rec_n = fld_rec( sd(jf)%freqh, sd(jf)%ln_tint, sd(jf)%nclim, -1 )     ! record index and time
+               !
+               !                                                                            ! read record
+               CALL iom_get( sd(jf)%num, jpdom_data, sd(jf)%clvar, sd(jf)%fdta(:,:,2), INT( sd(jf)%rec_n(1) ) )
+               !
+               !                                                                            ! control print
+               IF(lwp) WRITE(numout,*)' fld_read : time-interpolation for ', TRIM( sd(jf)%clvar ),   &
+                  &   ' read previous record =', INT(sd(jf)%rec_n(1)), ' at time = ', sd(jf)%rec_n(2)/rday, ' days'
+               !
+            ENDIF
+            !                                              ! next record to be read
+            sd(jf)%rec_a = fld_rec( sd(jf)%freqh, sd(jf)%ln_tint, sd(jf)%nclim, 0 )
+
+            IF(lwp) WRITE(numout,*)'                                   ',    &
+                  &   ' after record         =', INT(sd(jf)%rec_a(1)), ' at time = ', sd(jf)%rec_a(2)/rday, ' days'
+            !
+         ENDIF
+         !
+         !                                            ! ============================= !
+         IF( sd(jf)%nclim == 0   .AND.   &            !            New Year           !
+             sd(jf)%nyear == nyear - 1 ) THEN         ! ============================= !
+            !
+            CALL iom_close( sd(jf)%num )
+            IF(lwp) WRITE(numout,*) 'fldread : switch to a new year= ', nyear
+            WRITE( sd(jf)%clname, '(a,"_",i4,".nc")' ) TRIM( sd(jf)%clrootname ), nyear
+            sd(jf)%nyear = nyear
+            CALL iom_open( sd(jf)%clname, sd(jf)%num )
+            !
+            IF( sd(jf)%ln_tint ) THEN       ! no record index change, update record time
+               sd(jf)%rec_b(1:2) = fld_rec( sd(jf)%freqh, sd(jf)%ln_tint, sd(jf)%nclim, -1 )
+               sd(jf)%rec_n(1:2) = fld_rec( sd(jf)%freqh, sd(jf)%ln_tint, sd(jf)%nclim,  0 )
+               sd(jf)%rec_a(1:2) = fld_rec( sd(jf)%freqh, sd(jf)%ln_tint, sd(jf)%nclim, +1 )   
+            ELSE                            ! ???
+               sd(jf)%rec_n(1:2) = fld_rec( sd(jf)%freqh, sd(jf)%ln_tint, sd(jf)%nclim, -1 )
+               sd(jf)%rec_a(1:2) = fld_rec( sd(jf)%freqh, sd(jf)%ln_tint, sd(jf)%nclim,  0 )   
+            ENDIF
+            !
+         ENDIF
+         !
+         !                                            ! ============================= !
+         !                                            !   Read / Update input fields  !
+         !                                            ! ============================= !
+         !
+         ! current record index 
+         zrec_kt(1:2) = fld_rec( sd(jf)%freqh, sd(jf)%ln_tint, sd(jf)%nclim, 0 ) 
+         !
+         ! read next record (if required)
+         IF( zrec_kt(1) == sd(jf)%rec_a(1) ) THEN 
+            !
+            IF( sd(jf)%ln_tint ) THEN         ! time interpolation: swap
+               sd(jf)%rec_b = fld_rec( sd(jf)%freqh, sd(jf)%ln_tint, sd(jf)%nclim, -1 )   ! record index & time
+!CDIR COLLAPSE
+               sd(jf)%fdta(:,:,1) = sd(jf)%fdta(:,:,2)                                    ! record field
+            ENDIF
+            !
+            sd(jf)%rec_n(:) = zrec_kt(:)      ! update now record index & time
+            !                                 ! read record
+            CALL iom_get( sd(jf)%num, jpdom_data, sd(jf)%clvar, sd(jf)%fdta(:,:,2), INT( sd(jf)%rec_n(1) ) )
+            !
+            !                                 ! after record index & time
+            sd(jf)%rec_a(1:2) = fld_rec( sd(jf)%freqh, sd(jf)%ln_tint, sd(jf)%nclim, +1 )   
+            !
+            !                                 ! control print
+            IF( sd(jf)%ln_tint ) THEN
+            IF(lwp .AND. nitend - nit000 <= 100 )   WRITE(numout,*)'fld_read: var ', TRIM( sd(jf)%clvar ),   &
+            & ' d/M=', nday,nmonth,' rec bna:', INT(sd(jf)%rec_b(1)), INT(sd(jf)%rec_n(1)),INT(sd(jf)%rec_a(1)), &
+            & ' zrec bna', sd(jf)%rec_b(2)/rday, sd(jf)%rec_n(2)/rday, sd(jf)%rec_a(2)/rday
+            ELSE
+            IF(lwp .AND. nitend - nit000 <= 100 )   WRITE(numout,*)'fld_read: var ', TRIM( sd(jf)%clvar ),   &
+            &   ' D/M=', nday,nmonth, ' record :', INT(sd(jf)%rec_n(1)),     &
+            &   ' at', sd(jf)%rec_n(2)/rday, 'day,  next rec', INT(sd(jf)%rec_a(1))
+            ENDIF
+         ENDIF
+
+         IF( MOD( kt-1, kn_fsbc ) == 0 ) THEN                              !** update field at each kn_fsbc time-step
+            !
+            IF( sd(jf)%ln_tint ) THEN                                       !* linear time interpolated field
+               zt =  ( rsec_year - sd(jf)%rec_b(2) ) / ( sd(jf)%rec_n(2) - sd(jf)%rec_b(2) )
+      !CDIR COLLAPSE
+               sd(jf)%fnow(:,:) = ( 1. - zt ) * sd(jf)%fdta(:,:,1) + zt * sd(jf)%fdta(:,:,2)
+            ELSE
+      !CDIR COLLAPSE
+               sd(jf)%fnow(:,:) = sd(jf)%fdta(:,:,2)                        !* piecewise constant field
+            ENDIF
+            !
+         ENDIF
+         !
+         !                                         ! ======================== !
+         IF( kt == nitend ) THEN                   !  Close the input files   !
+            !                                      ! ======================== !
+            CALL iom_close( sd(jf)%num )
+         ENDIF
+         !                                      ! ===================== !
+      END DO                                    !  END LOOP OVER FIELD  !
+      !                                         ! ===================== !
+   END SUBROUTINE fld_read
+
+
+   FUNCTION fld_rec( pfreq, ld_tint, kclim, kshift )   RESULT( prec_info )
+      !!---------------------------------------------------------------------
+      !!                    ***  ROUTINE fld_rec  ***
+      !!
+      !! ** Purpose :   provide 
+      !!
+      !! ** Method  :   
+      !!----------------------------------------------------------------------
+      REAL(wp), INTENT(in)   ::   pfreq       ! record frequency (>0 in hours, <0 in months)
+      LOGICAL , INTENT(in)   ::   ld_tint     ! time interpolation flag (T/F)
+      INTEGER , INTENT(in)   ::   kclim       ! climatology flag (=0/1)
+      INTEGER , INTENT(in)   ::   kshift      ! record shift 
+      REAL(wp), DIMENSION(2) ::   prec_info   ! 1: file record + kshift 
+      !                                       ! 2: associated time [sec] centered at half the record frequency
+      !!
+      INTEGER  ::   iendh, irec
+      REAL(wp) ::   zrec
+      !!----------------------------------------------------------------------
+      !
+      IF( pfreq == -12. ) THEN      ! monthly data
+         !
+         iendh = 12                        ! 12 records per year
+         IF( ld_tint) THEN                 ! time interpolation, shift by 1/2 record
+            zrec  = REAL( nday     ) / REAL( nmonth_len(nmonth) ) + 0.5
+         ELSE
+            zrec  = REAL( nday - 1 ) / REAL( nmonth_len(nmonth) )
+         ENDIF
+         irec = nmonth + kshift + INT( zrec )   ! record index (from 0 to 13)
+         zrec = rmonth_half(irec)               ! record time (second since 00h, Jan. 1st)
+         !
+      ELSE                          ! high frequency data (pfreq in hours)
+         !
+         iendh = INT( 365 * 24 / pfreq )   ! iendh records per year
+         IF( ld_tint ) THEN                ! time interpolation, shift by 1/2 record
+            zrec = rsec_year / ( pfreq * 3600. ) + 0.5 
+         ELSE                 
+            zrec = rsec_year / ( pfreq * 3600. )      
+         ENDIF      
+         irec = 1      + kshift + INT( zrec )                          ! record index (from 0 to iendh+1)
+         zrec = - 0.5 * 3600. * pfreq + 3600. * pfreq * REAL( irec )   ! record time (second since 00h, Jan. 1st)
+         !
+      ENDIF
+      !
+      !                             ! adjuste the record index (climatology or interannual)
+      IF( kclim /= 1 )   THEN 
+         irec = irec + 1                                          ! interannual: additional first record
+      ELSE                     
+         IF( irec  ==         0 )   irec  =            iendh      ! climatology: record 0 is the last record (iendh)
+         IF( irec  >= iendh + 1 )   irec  = MOD( irec, iendh )    ! climatology: apply a modulo iendh
+      ENDIF
+      !
+      prec_info(1) = REAL( irec, wp )
+      prec_info(2) = zrec
+      !
+   END FUNCTION fld_rec
+
+   !!======================================================================
+END MODULE fldread
Index: /trunk/NEMO/OPA_SRC/SBC/sbc_ice.F90
===================================================================
--- /trunk/NEMO/OPA_SRC/SBC/sbc_ice.F90	(revision 702)
+++ /trunk/NEMO/OPA_SRC/SBC/sbc_ice.F90	(revision 702)
@@ -0,0 +1,49 @@
+MODULE sbc_ice
+   !!======================================================================
+   !!                 ***  MODULE  sbc_ice  ***
+   !!        parameter and  variables defined in memory in forced mode
+   !!======================================================================
+   !! History :  9.0  !  06-08  (G. Modec)  Surface module
+   !!----------------------------------------------------------------------
+#if defined key_ice_lim
+   !!----------------------------------------------------------------------
+   !!   'key_ice_lim' :                                   Lim sea-ice model
+   !!----------------------------------------------------------------------
+   USE par_oce          ! ocean parameters
+
+   IMPLICIT NONE
+   PRIVATE
+
+   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   utaui_ice   !: u-stress over ice (I-point)   [N/m2]
+   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   vtaui_ice   !: v-stress over ice (I-point)   [N/m2]
+   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   qns_ice     !: non solar heat flux over ice  [W/m2]
+   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   qsr_ice     !: solar heat flux over ice      [W/m2]
+   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   dqns_ice    !: non solar heat flux sensibility over ice (LW+SEN+LA) [W/m2/K]
+   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   tn_ice      !: ice surface temperature       [K]
+   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   tprecip     !: total precipitation           [Kg/m2/s]
+   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   sprecip     !: solid precipitation           [Kg/m2/s]
+   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   fr1_i0      !: 1st fraction of sol. rad.  which penetrate inside the ice cover
+   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   fr2_i0      !: 2nd fraction of sol. rad.  which penetrate inside the ice cover
+
+   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   &
+#if ! defined key_coupled
+      qla_ice  ,      &  !: latent flux over ice  
+      dqla_ice           !: latent sensibility over ice
+#else
+      rrunoff  ,      &  !: runoff
+      calving  ,      &  !: calving
+      alb_ice            !: albedo of ice      
+#endif
+
+#else
+   !!----------------------------------------------------------------------
+   !!   Empty module                                   NO LIM sea-ice model
+   !!----------------------------------------------------------------------
+#endif
+
+   !!----------------------------------------------------------------------
+   !!  OPA 9.0 , LOCEAN-IPSL (2005)
+   !! $Header: $
+   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
+END MODULE sbc_ice
Index: /trunk/NEMO/OPA_SRC/SBC/sbc_oce.F90
===================================================================
--- /trunk/NEMO/OPA_SRC/SBC/sbc_oce.F90	(revision 702)
+++ /trunk/NEMO/OPA_SRC/SBC/sbc_oce.F90	(revision 702)
@@ -0,0 +1,37 @@
+MODULE sbc_oce
+   !!======================================================================
+   !!                       ***  MODULE  sbc_oce  ***
+   !! Surface module :   variables defined in core memory 
+   !!======================================================================
+   !! History :  9.0   !  06-06  (G. Madec)  Original code
+   !!----------------------------------------------------------------------
+   USE par_oce          ! ocean parameters
+
+   IMPLICIT NONE
+   PRIVATE
+   
+   !!----------------------------------------------------------------------
+   !!              Ocean Surface Boundary Condition fields
+   !!----------------------------------------------------------------------
+   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   utau      !: sea surface i-stress (ocean referential)     [N/m2]
+   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   vtau      !: sea surface j-stress (ocean referential)     [N/m2]
+   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   qns       !: sea heat flux: non solar                     [W/m2]
+   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   qsr       !: sea heat flux:     solar                     [W/m2]
+   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   emp       !: freshwater budget: volume flux               [Kg/m2/s]
+   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   emps      !: freshwater budget: concentration/dillution   [Kg/m2/s]
+   
+   !!----------------------------------------------------------------------
+   !!                     Sea Surface Mean fields
+   !!----------------------------------------------------------------------
+   INTEGER , PUBLIC                     ::   nn_fsbc   !: frequency of sbc computation (as well as sea-ice model)
+   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   ssu_m     !: mean (nn_fsbc time-step) surface sea i-current (U-point) [m/s]
+   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   ssv_m     !: mean (nn_fsbc time-step) surface sea j-current (V-point) [m/s]
+   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   sst_m     !: mean (nn_fsbc time-step) surface sea temperature     [Celsius]
+   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   sss_m     !: mean (nn_fsbc time-step) surface sea salinity            [psu]
+
+   !!----------------------------------------------------------------------
+   !!   OPA 9.0 , LOCEAN-IPSL (2006) 
+   !! $Header: $
+   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt)
+   !!======================================================================
+END MODULE sbc_oce
Index: /trunk/NEMO/OPA_SRC/SBC/sbcana.F90
===================================================================
--- /trunk/NEMO/OPA_SRC/SBC/sbcana.F90	(revision 702)
+++ /trunk/NEMO/OPA_SRC/SBC/sbcana.F90	(revision 702)
@@ -0,0 +1,330 @@
+MODULE sbcana
+   !!======================================================================
+   !!                       ***  MODULE  sbcana  ***
+   !! Ocean forcing:  analytical momentum, heat and freshwater forcings
+   !!=====================================================================
+   !! History :  9.0   !  06-06  (G. Madec)  Original code
+   !!----------------------------------------------------------------------
+
+   !!----------------------------------------------------------------------
+   !!   sbc_ana  : set an analytical ocean forcing
+   !!   sbc_gyre : set the GYRE configuration analytical forcing
+   !!----------------------------------------------------------------------
+   USE oce             ! ocean dynamics and tracers
+   USE dom_oce         ! ocean space and time domain
+   USE sbc_oce         ! Surface boundary condition: ocean fields
+   USE phycst          ! physical constants
+   USE daymod          ! calendar
+   USE ocfzpt          ! ocean freezing point
+   USE in_out_manager  ! I/O manager
+   USE lib_mpp         ! distribued memory computing library
+   USE lbclnk          ! ocean lateral boundary conditions (or mpp link)
+
+   IMPLICIT NONE
+   PRIVATE
+
+   PUBLIC   sbc_ana    ! routine called in sbcmod module
+   PUBLIC   sbc_gyre   ! routine called in sbcmod module
+
+   !! * Namelist namsbc_ana
+   INTEGER  ::   nn_tau000 = 1      ! nb of time-step during which the surface stress
+      !                             ! increase from 0 to its nominal value 
+   REAL(wp) ::   rn_utau0  = 0.e0   ! constant wind stress value in i-direction
+   REAL(wp) ::   rn_vtau0  = 0.e0   ! constant wind stress value in j-direction
+   REAL(wp) ::   rn_qns0   = 0.e0   ! non solar heat flux
+   REAL(wp) ::   rn_qsr0   = 0.e0   !     solar heat flux
+   REAL(wp) ::   rn_emp0   = 0.e0   ! net freshwater flux
+   NAMELIST/namsbc_ana/ nn_tau000, rn_utau0, rn_vtau0, rn_qns0, rn_qsr0, rn_emp0
+   
+   !! * Substitutions
+#  include "domzgr_substitute.h90"
+   !!----------------------------------------------------------------------
+   !!   OPA 9.0 , LOCEAN-IPSL (2006) 
+   !! $Header: $
+   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
+
+CONTAINS
+
+   SUBROUTINE sbc_ana( kt )
+      !!---------------------------------------------------------------------
+      !!                    ***  ROUTINE sbc_ana ***
+      !!              
+      !! ** Purpose :   provide at each time-step the ocean surface boundary
+      !!      condition, i.e. the momentum, heat and freshwater fluxes.
+      !!
+      !! ** Method  :   Constant and uniform surface forcing specified from
+      !!      namsbc_ana namelist parameters. All the fluxes are time inde-
+      !!      pendant except the stresses which increase from zero during
+      !!      the first nn_tau000 time-step 
+      !!      * C A U T I O N : never mask the surface stress field !
+      !!
+      !! ** Action  : - set the ocean surface boundary condition, i.e.  
+      !!                   utau, vtau, qns, qsr, emp, emps
+      !!----------------------------------------------------------------------
+      INTEGER, INTENT(in) ::   kt       ! ocean time step
+      !
+      REAL(wp)            ::   zfacto   ! local scalar
+      !!---------------------------------------------------------------------
+      !
+      IF( kt == nit000 ) THEN
+         !
+         REWIND ( numnam )                   ! Read Namelist namsbc : surface fluxes
+         READ   ( numnam, namsbc_ana )
+
+         IF(lwp) WRITE(numout,*)' '
+         IF(lwp) WRITE(numout,*)' sbc_ana : Constant surface fluxes read in namsbc_ana namelist'
+         IF(lwp) WRITE(numout,*)' ~~~~~~~ '
+         IF(lwp) WRITE(numout,*)'              spin up of the stress  nn_tau000 = ', nn_tau000, ' time-steps'
+         IF(lwp) WRITE(numout,*)'              constant i-stress      rn_utau0  = ', rn_utau0 , ' N/m2'
+         IF(lwp) WRITE(numout,*)'              constant j-stress      rn_vtau0  = ', rn_vtau0 , ' N/m2'
+         IF(lwp) WRITE(numout,*)'              non solar heat flux    rn_qns0   = ', rn_qns0  , ' W/m2'
+         IF(lwp) WRITE(numout,*)'              solar heat flux        rn_qsr0   = ', rn_qsr0  , ' W/m2'
+         IF(lwp) WRITE(numout,*)'              net heat flux          rn_emp0   = ', rn_emp0  , ' Kg/m2/s'
+
+         nn_tau000 = MAX( nn_tau000, 1 )   ! must be >= 1
+         qns   (:,:) = rn_qns0
+         qsr   (:,:) = rn_qsr0
+         emp   (:,:) = rn_emp0
+         emps  (:,:) = rn_emp0
+         !
+      ENDIF
+   
+      ! Increase the surface stress to its nominal value during the first nn_tau000 time-steps
+         
+      IF( kt <= nn_tau000 ) THEN
+         zfacto = 0.5 * (  1. - COS( rpi * FLOAT( kt ) / FLOAT( nn_tau000 ) )  )
+         utau(:,:) = zfacto * rn_utau0
+         vtau(:,:) = zfacto * rn_vtau0
+      ENDIF
+      !   
+   END SUBROUTINE sbc_ana
+
+
+   SUBROUTINE sbc_gyre( kt )
+      !!---------------------------------------------------------------------
+      !!                    ***  ROUTINE sbc_ana ***
+      !!              
+      !! ** Purpose :   provide at each time-step the ocean surface boundary
+      !!      condition, i.e. the momentum, heat and freshwater fluxes.
+      !!
+      !! ** Method  :   analytical seasonal cycle for GYRE configuration.
+      !!      * C A U T I O N : never mask the surface stress field !
+      !!
+      !! ** Action  : - set the ocean surface boundary condition, i.e.   
+      !!                   utau, vtau, qns, qsr, emp, emps
+      !!
+      !! Reference : Hazeleger, W., and S. Drijfhout, JPO, 30, 677-695, 2000.
+      !!----------------------------------------------------------------------
+      INTEGER, INTENT(in) ::   kt          ! ocean time step
+
+      INTEGER  ::   ji, jj, js             ! dummy loop indices
+      INTEGER  ::   zyear0                 ! initial year 
+      INTEGER  ::   zmonth0                ! initial month
+      INTEGER  ::   zday0                  ! initial day
+      INTEGER  ::   zday_year0             ! initial day since january 1st
+      INTEGER  ::   zdaymax                ! 
+      REAL(wp) ::   ztau     , ztau_sais   ! wind intensity and of the seasonal cycle
+      REAL(wp) ::   ztime                  ! time in hour
+      REAL(wp) ::   ztimemax , ztimemin    ! 21th June, and 21th decem. if date0 = 1st january
+      REAL(wp) ::   ztimemax1, ztimemin1   ! 21th June, and 21th decem. if date0 = 1st january
+      REAL(wp) ::   ztimemax2, ztimemin2   ! 21th June, and 21th decem. if date0 = 1st january
+      REAL(wp) ::   ztaun                  ! intensity
+      REAL(wp) ::   zemp_s, zemp_n, zemp_sais, ztstar
+      REAL(wp) ::   zcos_sais1, zcos_sais2, ztrp, zconv, t_star
+      REAL(wp) ::   zsumemp, zsurf
+      !!---------------------------------------------------------------------
+         
+      ! ---------------------------- !
+      !  heat and freshwater fluxes  !
+      ! ---------------------------- !
+      !same temperature, E-P as in HAZELEGER 2000
+
+      zyear0     =   ndate0 / 10000                             ! initial year
+      zmonth0    = ( ndate0 - zyear0 * 10000 ) / 100            ! initial month
+      zday0      =   ndate0 - zyear0 * 10000 - zmonth0 * 100    ! initial day betwen 1 and 30
+      zday_year0 = ( zmonth0 - 1 ) * 30.+zday0                  ! initial day betwen 1 and 360
+
+      ! current day (in hours) since january the 1st of the current year
+      ztime = REAL( kt ) * rdt / (rmmss * rhhmm)   &       !  total incrementation (in hours)
+         &      - (nyear  - 1) * rjjhh * raajj             !  minus years since beginning of experiment (in hours)
+
+      ztimemax1 = ((5.*30.)+21.)* 24.                      ! 21th june     at 24h in hours
+      ztimemin1 = ztimemax1 + rjjhh * raajj / 2            ! 21th december        in hours
+      ztimemax2 = ((6.*30.)+21.)* 24.                      ! 21th july     at 24h in hours
+      ztimemin2 = ztimemax2 - rjjhh * raajj / 2            ! 21th january         in hours
+      !                                                    ! NB: rjjhh * raajj / 4 = one seasonal cycle in hours
+
+      ! amplitudes
+      zemp_S    = 0.7       ! intensity of COS in the South
+      zemp_N    = 0.8       ! intensity of COS in the North
+      zemp_sais = 0.1
+      zTstar    = 28.3      ! intemsity from 28.3 a -5 deg
+
+      ! 1/2 period between 21th June and 21th December and between 21th July and 21th January
+      zcos_sais1 = COS( (ztime - ztimemax1) / (ztimemin1 - ztimemax1) * rpi ) 
+      zcos_sais2 = COS( (ztime - ztimemax2) / (ztimemax2 - ztimemin2) * rpi )
+
+      ztrp= - 40.          ! retroaction term on heat fluxes (W/m2/K)
+      zconv = 3.16e-5      ! convertion factor: 1 m/yr => 3.16e-5 mm/s
+      DO jj = 1, jpj
+         DO ji = 1, jpi
+            ! domain from 15 deg to 50 deg between 27 and 28  degC at 15N, -3
+            ! and 13 degC at 50N 53.5 + or - 11 = 1/4 period :
+            ! 64.5 in summer, 42.5 in winter
+            t_star = zTstar * ( 1 + 1. / 50. * zcos_sais2 )                &
+               &                    * COS( rpi * (gphit(ji,jj) - 5.)               &
+               &                    / ( 53.5 * ( 1 + 11 / 53.5 * zcos_sais2 ) * 2.) )
+            ! 23.5 deg : tropics
+            qsr (ji,jj) =  230 * COS( 3.1415 * ( gphit(ji,jj) - 23.5 * zcos_sais1 ) / ( 0.9 * 180 ) )
+            qns (ji,jj) = ztrp * ( tb(ji,jj,1) - t_star ) - qsr(ji,jj)
+            IF( gphit(ji,jj) >= 14.845 .AND. 37.2 >= gphit(ji,jj) ) THEN    ! zero at 37.8 deg, max at 24.6 deg
+               emp  (ji,jj) =   zemp_S * zconv   &
+                  &         * SIN( rpi / 2 * (gphit(ji,jj) - 37.2) / (24.6 - 37.2) )  &
+                  &         * ( 1 - zemp_sais / zemp_S * zcos_sais1)
+            ELSE
+               emp (ji,jj) =  - zemp_N * zconv   &
+                  &         * SIN( rpi / 2 * (gphit(ji,jj) - 37.2) / (46.8 - 37.2) )  &
+                  &         * ( 1 - zemp_sais / zemp_N * zcos_sais1 )
+            ENDIF
+         END DO
+      END DO
+      emps(:,:) = emp(:,:)
+
+      ! compute the emp flux such as its integration on the whole domain and at each time be zero
+      zsumemp = 0.e0
+      zsurf = 0.e0
+      DO jj = 1, jpj
+         DO ji = 1, jpi
+            zsumemp = zsumemp + emp(ji,jj) * tmask(ji,jj,1) * tmask_i(ji,jj)
+            zsurf   = zsurf   +              tmask(ji,jj,1) * tmask_i(ji,jj)
+         END DO
+      END DO
+
+      IF( lk_mpp )   CALL mpp_sum( zsumemp  )       ! sum over the global domain
+      IF( lk_mpp )   CALL mpp_sum( zsurf    )       ! sum over the global domain
+
+      IF( nbench /= 0 ) THEN
+         ! Benchmark GYRE configuration (to allow the bit to bit comparison between Mpp/Mono case)
+         zsumemp = 0.e0
+      ELSE
+         ! Default GYRE configuration
+         zsumemp = zsumemp / zsurf
+      ENDIF
+
+      !salinity terms
+      emp (:,:) = emp(:,:) - zsumemp * tmask(:,:,1)
+      emps(:,:) = emp(:,:)
+
+
+      ! ---------------------------- !
+      !       momentum fluxes        !
+      ! ---------------------------- !
+      ! same wind as in Wico
+      !test date0 : ndate0 = 010203
+      zyear0  =   ndate0 / 10000
+      zmonth0 = ( ndate0 - zyear0 * 10000 ) / 100
+      zday0   =   ndate0 - zyear0 * 10000 - zmonth0 * 100
+      !Calculates nday_year, day since january 1st
+      zday_year0 = zday0
+      !accumulates days of previous months of this year
+
+      DO js = 1, zmonth0
+         IF( nleapy > 1 ) THEN
+            zday_year0 = zday_year0 + nleapy
+         ELSE
+            IF( MOD(zyear0, 4 ) == 0 ) THEN
+               zday_year0 = zday_year0 + nbiss(js)
+            ELSE
+               zday_year0 = zday_year0 + nobis(js)
+            ENDIF
+         ENDIF
+      END DO
+
+      ! day (in hours) since january the 1st
+      ztime = FLOAT( kt ) * rdt / (rmmss * rhhmm)  &  ! incrementation in hour
+         &     - (nyear - 1) * rjjhh * raajj       &  !  - nber of hours the precedent years
+         &     + zday_year0 / 24                      ! nber of hours initial date
+      ! day 21th counted since the 1st January
+      zdaymax = 21                                    ! 21th day of the month
+      DO js = 1, 5                                    ! count each day  until end May
+         IF( nleapy > 1 ) THEN
+            zdaymax = zdaymax + nleapy
+         ELSE
+            IF( MOD(zyear0, 4 ) == 0 ) THEN
+                zdaymax = zdaymax + nbiss(js)
+            ELSE
+                zdaymax = zdaymax + nobis(js)
+            ENDIF
+         ENDIF
+      END DO
+      ztimemax = zdaymax * 24                      ! 21th june     in hours
+      ztimemin = ztimemax + rjjhh * raajj / 2      ! 21th december in hours
+      !                                            ! NB: rjjhh * raajj / 4 = 1 seasonal cycle in hours
+
+      ! mean intensity at 0.105 ; srqt(2) because projected with 45deg angle
+      ztau = 0.105 / SQRT( 2. )
+      ! seasonal oscillation intensity
+      ztau_sais = 0.015
+      ztaun = ztau - ztau_sais * COS( (ztime - ztimemax) / (ztimemin - ztimemax) * rpi )
+      DO jj = 1, jpj
+         DO ji = 1, jpi
+           ! domain from 15deg to 50deg and 1/2 period along 14deg
+           ! so 5/4 of half period with seasonal cycle
+           utau(ji,jj) = - ztaun * SIN( rpi * (gphiu(ji,jj) - 15.) / (29.-15.) )
+           vtau(ji,jj) =   ztaun * SIN( rpi * (gphiv(ji,jj) - 15.) / (29.-15.) )
+         END DO
+      END DO
+
+      ! ---------------------------------- !
+      !  control print at first time-step  !
+      ! ---------------------------------- !
+      IF( kt == nit000 .AND. lwp ) THEN 
+         WRITE(numout,*)' sbc_gyre : analytical surface fluxes for GYRE configuration'               
+         WRITE(numout,*)' ~~~~~~~~ ' 
+         WRITE(numout,*)'           nyear      = ', nyear
+         WRITE(numout,*)'           nmonth     = ', nmonth
+         WRITE(numout,*)'           nday       = ', nday
+         WRITE(numout,*)'           nday_year  = ',nday_year
+         WRITE(numout,*)'           ztime      = ', ztime
+         WRITE(numout,*)'           ztimemax1  = ', ztimemax1
+         WRITE(numout,*)'           ztimemin1  = ', ztimemin1
+         WRITE(numout,*)'           ztimemax2  = ', ztimemax2
+         WRITE(numout,*)'           ztimemin2  = ', ztimemin2
+         WRITE(numout,*)'           zyear0     = ', zyear0
+         WRITE(numout,*)'           zmonth0    = ', zmonth0
+         WRITE(numout,*)'           zday0      = ', zday0
+         WRITE(numout,*)'           zday_year0 = ', zday_year0
+         WRITE(numout,*)'           raajj      = ', raajj
+         WRITE(numout,*)'           zemp_S     = ', zemp_S
+         WRITE(numout,*)'           zemp_N     = ', zemp_N
+         WRITE(numout,*)'           zemp_sais  = ', zemp_sais
+         WRITE(numout,*)'           zTstar     = ', zTstar
+         WRITE(numout,*)'           zsumemp    = ', zsumemp
+         WRITE(numout,*)'           zsurf      = ', zsurf
+         WRITE(numout,*)'           ztrp       = ', ztrp
+         WRITE(numout,*)'           zconv      = ', zconv
+
+         WRITE(numout,*)'           ndastp     = ',ndastp
+         WRITE(numout,*)'           adatrj     = ',adatrj
+         WRITE(numout,*)'           ztime      = ',ztime
+         WRITE(numout,*)'           zdaymax    = ',zdaymax
+
+         WRITE(numout,*)'           ztimemax   = ',ztimemax
+         WRITE(numout,*)'           ztimemin   = ',ztimemin
+         WRITE(numout,*)'           zyear0     = ', zyear0
+         WRITE(numout,*)'           zmonth0    = ', zmonth0
+         WRITE(numout,*)'           zday0      = ', zday0
+         WRITE(numout,*)'           zday_year0 = ',zday_year0
+         WRITE(numout,*)'           nobis(2)', nobis(2)
+         WRITE(numout,*)'           nobis(5)', nobis(5)
+         WRITE(numout,*)'           nobis(6)', nobis(6)
+         WRITE(numout,*)'           nobis(1)', nobis(1)
+         WRITE(numout,*)'           nobis(zmonth0 -1)', nobis(zmonth0 - 1)
+         WRITE(numout,*)'           raajj  = ', raajj
+      ENDIF
+
+   END SUBROUTINE sbc_gyre
+
+   !!======================================================================
+END MODULE sbcana
Index: /trunk/NEMO/OPA_SRC/SBC/sbcblk_clio.F90
===================================================================
--- /trunk/NEMO/OPA_SRC/SBC/sbcblk_clio.F90	(revision 702)
+++ /trunk/NEMO/OPA_SRC/SBC/sbcblk_clio.F90	(revision 702)
@@ -0,0 +1,280 @@
+MODULE sbcblk_clio
+   !!======================================================================
+   !!                       ***  MODULE  sbcblk_clio  ***
+   !! Ocean forcing:  momentum, heat and freshwater flux formulation
+   !!=====================================================================
+   !! History :  8.0  !  01-04  (Louvain-La-Neuve)  Original code
+   !!            8.5  !  02-09  (C. Ethe , G. Madec )  F90: Free form and module
+   !!            9.0  !  06-06  (G. Madec)  surface module
+   !!----------------------------------------------------------------------
+   
+   !!----------------------------------------------------------------------
+   !!   sbc_blk_clio  : bulk formulation as ocean surface boundary condition
+   !!                   (forced mode, CORE bulk formulea)
+   !!   blk_oce_clio  : ocean: computes momentum, heat and freshwater fluxes
+   !!   blk_ice_clio  : ice  : computes momentum, heat and freshwater fluxes
+   !!----------------------------------------------------------------------
+   !!   flx_blk_declin : Computation of the solar declination
+   !!----------------------------------------------------------------------
+   USE oce             ! ocean dynamics and tracers
+   USE dom_oce         ! ocean space and time domain
+   USE cpl_oce         ! ???
+   USE phycst          ! physical constants
+   USE daymod
+
+   USE sbc_oce         ! Surface boundary condition: ocean fields
+   USE sbc_ice         ! Surface boundary condition: ocean fields
+
+   USE fldread         ! read input fields
+
+   USE ocfzpt          ! ???
+
+   USE iom
+   USE in_out_manager
+   USE lbclnk
+   USE prtctl          ! Print control
+
+   IMPLICIT NONE
+   PRIVATE
+
+   PUBLIC   sbc_blk_clio   ! routine called in sbcmod
+   PUBLIC   blk_ice_clio   ! routine called in sbcice_lim module
+
+   INTEGER , PARAMETER ::    &
+      jpfld   = 7,     &  ! number of files to read
+      jp_utau = 1,     &  ! index of wind stress (i-component)  (m/s)    at U-point
+      jp_vtau = 2,     &  ! index of wind stress (j-component)  (m/s)    at V-point
+      jp_wspd = 3,     &  ! index of XXm wind module            (m/s)    at T-point
+      jp_tair = 4,     &  ! index of  2m air temperature        (Celcius)
+      jp_humi = 5,     &  ! index of specific humidity          ( % )
+      jp_cldc = 6,     &  ! Cloud cover                       ( % )
+      jp_prec = 7         ! index of total precipitation        (kg/m2/s)
+   TYPE(FLD), ALLOCATABLE, DIMENSION(:) ::   sf   ! structure of input fields (informations on files, fields read) 
+
+   !! * CLIO bulk parameters
+   INTEGER, PARAMETER  ::   jpintsr = 24          ! number of time step between sunrise and sunset
+      !                                           ! uses for heat flux computation
+   LOGICAL             ::   lbulk_init = .TRUE.   ! flag, bulk initialization done or not)
+      
+   REAL(wp), DIMENSION(jpi,jpj) ::   stauc        ! cloud optical depth 
+   REAL(wp), DIMENSION(jpi,jpj) ::   sbudyko      ! ???
+      
+   !! * constants for bulk computation (flx_blk) 
+   REAL(wp), DIMENSION(19)  ::  budyko            ! BUDYKO's coefficient
+   !                                              ! BUDYKO's coefficient (cloudiness effect on LW radiation):
+   DATA budyko / 1.00, 0.98, 0.95, 0.92, 0.89, 0.86, 0.83, 0.80, 0.78, 0.75,  &
+      &          0.72, 0.69, 0.67, 0.64, 0.61, 0.58, 0.56, 0.53, 0.50 /
+   REAL(wp), DIMENSION(20)  ::   tauco            ! cloud optical depth coefficient
+   !                                              ! Cloud optical depth coefficient
+   DATA tauco / 6.6, 6.6, 7.0, 7.2, 7.1, 6.8, 6.5, 6.6, 7.1, 7.6,   &
+      &         6.6, 6.1, 5.6, 5.5, 5.8, 5.8, 5.6, 5.6, 5.6, 5.6 /
+
+   REAL(wp) ::   zeps    = 1.e-20  ,  &  ! constant values
+      &          zeps0   = 1.e-13  ,  &
+      &          zeps1   = 1.e-06  ,  &
+      &          zzero   = 0.e0    ,  &
+      &          zone    = 1.0
+
+   REAL(wp) ::   yearday   ! 
+
+   !!----------------------------------------------------------------------
+   !!   OPA 9.0 , LOCEAN-IPSL (2006)
+   !! $Header: $
+   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
+
+CONTAINS
+
+   SUBROUTINE sbc_blk_clio( kt )
+      !!---------------------------------------------------------------------
+      !!                    ***  ROUTINE sbc_blk_clio  ***
+      !!
+      !! ** Purpose :   provide at each time step the surface ocean fluxes
+      !!      (momentum, heat, freshwater and runoff)
+      !!
+      !! ** Method  :   READ each fluxes in NetCDF files
+      !!      The i-component of the stress                taux   (N/m2)
+      !!      The j-component of the stress                tauy   (N/m2)
+      !!      the net downward heat flux                   qtot   (watt/m2)
+      !!      the net downward radiative flux              qsr    (watt/m2)
+      !!      the net upward water (evapo - precip)        emp    (kg/m2/s)
+      !!                Assumptions made:
+      !!       - each file content an entire year (read record, not the time axis)
+      !!       - first and last record are part of the previous and next year
+      !!         (useful for time interpolation)
+      !!       - the number of records is 2 + 365*24 / freqh(jf)
+      !!         or 366 in leap year case
+      !!
+      !!      C A U T I O N : never mask the surface stress fields
+      !!                      the stress is assumed to be in the mesh referential
+      !!                      i.e. the (i,j) referential
+      !!
+      !! ** Action  :   defined at each time-step at the air-sea interface
+      !!              - utau  &  vtau   : stress components in geographical ref.
+      !!              - qns   &  qsr    : non solar and solar heat fluxes
+      !!              - emp             : evap - precip (volume flux)
+      !!              - emps            : evap - precip (concentration/dillution)
+      !!----------------------------------------------------------------------
+      INTEGER, INTENT( in  ) ::   kt   ! ocean time step
+      !!
+      INTEGER  ::   jf                  ! dummy indices
+      INTEGER  ::   ierror   ! return error code
+      !!
+      CHARACTER(len=100) ::  cn_dir   !   Root directory for location of clio files
+      TYPE(FLD_N), DIMENSION(jpfld) ::   slf_i         ! array of namelist informations on the fields to read
+      TYPE(FLD_N) ::   sn_utau, sn_vtau, sn_wspd, sn_tair,  &  ! informations about the fields to be read
+         &             sn_humi, sn_cldc, sn_prec
+      NAMELIST/namsbc_clio/ cn_dir, sn_utau, sn_vtau, sn_wspd, sn_tair,   &
+         &                          sn_humi, sn_cldc, sn_prec
+      !!---------------------------------------------------------------------
+
+      !                                         ! ====================== !
+      IF( kt == nit000 ) THEN                   !  First call kt=nit000  !
+         !                                      ! ====================== !
+         ! set file information (default values)
+         cn_dir = './'       ! directory in which the model is executed
+         ! (NB: frequency positive => hours, negative => months)
+         !              !  file  ! frequency !  variable  ! time intep !  clim  ! starting !
+         !              !  name  !  (hours)  !   name     !   (T/F)    !  (0/1) !  record  !
+         sn_utau = FLD_N( 'utau' ,    24.    , 'utau'     ,  .FALSE.   ,    0   ,    0     )
+         sn_vtau = FLD_N( 'vtau' ,    24.    , 'vtau'     ,  .FALSE.   ,    0   ,    0     )
+         sn_wspd = FLD_N( 'wspd' ,    24.    , 'wspd'     ,  .FALSE.   ,    0   ,    0     )
+         sn_tair = FLD_N( 'tair' ,    24.    , 'Tair'     ,  .FALSE.   ,    0   ,    0     )
+         sn_humi = FLD_N( 'humi' ,   -12.    , 'humi'     ,  .FALSE.   ,    0   ,    0     )
+         sn_cldc = FLD_N( 'cloud',   -12.    , 'cloud'    ,  .FALSE.   ,    0   ,    0     )
+         sn_prec = FLD_N( 'rain' ,   -12.    , 'precip'   ,  .FALSE.   ,    0   ,    0     )
+
+         REWIND ( numnam )                    ! ... read in namlist namsbc_clio
+         READ   ( numnam, namsbc_clio )
+
+         ! store namelist information in an array
+         slf_i(jp_utau) = sn_utau   ;   slf_i(jp_vtau) = sn_vtau
+         slf_i(jp_wspd) = sn_wspd   ;   slf_i(jp_tair) = sn_tair
+         slf_i(jp_humi) = sn_humi   ;   slf_i(jp_cldc) = sn_cldc
+         slf_i(jp_prec) = sn_prec
+
+         ! set sf structure
+         ALLOCATE( sf(jpfld), STAT=ierror )
+         IF( ierror > 0 ) THEN
+            CALL ctl_stop( 'sbc_blk_clio: unable to allocate sf_sst structure' )   ;   RETURN
+         ENDIF
+
+         DO jf = 1, jpfld
+            WRITE(sf(jf)%clrootname,'(a,a)' )   TRIM( cn_dir ), TRIM( slf_i(jf)%clname )
+            sf(jf)%freqh   = slf_i(jf)%freqh
+            sf(jf)%clvar   = slf_i(jf)%clvar
+            sf(jf)%ln_tint = slf_i(jf)%ln_tint
+            sf(jf)%nclim   = slf_i(jf)%nclim
+            sf(jf)%nstrec  = slf_i(jf)%nstrec
+         END DO
+
+         IF(lwp) THEN      ! control print
+            WRITE(numout,*)
+            WRITE(numout,*) 'sbc_blk_clio : CLIO bulk formulation for ocean surface boundary condition'
+            WRITE(numout,*) '~~~~~~~~~~~~ '
+            WRITE(numout,*) '          namsbc_clio Namelist'
+            WRITE(numout,*) '          list of files and frequency (>0: in hours ; <0 in months)'
+            DO jf = 1, jpfld
+                WRITE(numout,*) '               root filename: '  , trim( sf(jf)%clrootname ),   &
+                   &                          ' variable name: '  , trim( sf(jf)%clvar      )
+                WRITE(numout,*) '               frequency: '      ,       sf(jf)%freqh       ,   &
+                   &                          ' time interp: '    ,       sf(jf)%ln_tint     ,   &
+                   &                          ' climatology: '    ,       sf(jf)%nclim       ,   &
+                   &                          ' starting record: ',       sf(jf)%nstrec
+            END DO
+         ENDIF
+         !
+      ENDIF
+
+      CALL fld_read( kt, nn_fsbc, sf )           ! Read input fields and provides the
+      !                                          ! input fields at the current time-step
+!CDIR COLLAPSE
+      utau(:,:) = sf(jp_utau)%fnow(:,:)          ! set surface ocean stresses directly 
+!CDIR COLLAPSE
+      vtau(:,:) = sf(jp_vtau)%fnow(:,:)          ! from the input values
+
+      CALL blk_oce_clio( )                       ! set the ocean surface heat and freshwater fluxes
+      !                                          ! using CLIO bulk formulea
+
+! temporary staff : set fluxes to zero....
+      qns (:,:)= 0.e0
+      qsr (:,:)= 0.e0
+      emp (:,:)= 0.e0
+      emps(:,:)= 0.e0
+
+      ! control print (if less than 100 time-step asked)
+!!!   IF( nitend-nit000 <= 100 .AND. lwp ) THEN
+      IF( kt == nit000 .AND. lwp ) THEN
+         WRITE(numout,*)
+         WRITE(numout,*) '        CLIO bulk fields at nit000'
+         DO jf = 1, jpfld
+            WRITE(numout,*)
+            WRITE(numout,*) ' day: ', ndastp , TRIM(sf(jf)%clvar)
+            CALL prihre( sf(jf)%fnow, jpi, jpj, 1, jpi, 20, 1, jpj, 10, 1., numout )
+         END DO
+         CALL FLUSH(numout)
+      ENDIF
+
+   END SUBROUTINE sbc_blk_clio
+
+
+   SUBROUTINE blk_oce_clio( )
+   END SUBROUTINE blk_oce_clio
+
+
+   SUBROUTINE blk_ice_clio
+   END SUBROUTINE blk_ice_clio
+
+
+   SUBROUTINE blk_qsr_clio( )
+   END SUBROUTINE blk_qsr_clio
+
+
+   SUBROUTINE flx_blk_declin( ky, kday, pdecl )
+      !!---------------------------------------------------------------------------
+      !!               ***  ROUTINE flx_blk_declin  ***
+      !!          
+      !! ** Purpose :   Computation of the solar declination for the day
+      !!	        kday ( in decimal degrees ).
+      !!       
+      !! ** Method  :
+      !!---------------------------------------------------------------------
+      INTEGER , INTENT(in   ) ::   ky      ! = -1, 0, 1 for odd, normal and leap years resp.
+      INTEGER , INTENT(in   ) ::   kday    ! day of the year ( kday = 1 on january 1)
+      REAL(wp), INTENT(  out) ::   pdecl   ! solar declination
+
+      REAL(wp) ::   zday              ,  &  ! corresponding day of type year (cf. ky)
+         &          zp1, zp2, zp3, zp4      ! temporary scalars
+      REAL(wp) ::   a0  =  0.39507671 ,  &  ! constants used in  solar 
+         &          a1  = 22.85684301 ,  &  ! declinaison computation
+         &          a2  = -0.38637317 ,  &
+         &          a3  =  0.15096535 ,  &
+         &          a4  = -0.00961411 ,  &
+         &          b1  = -4.29692073 ,  &
+         &          b2  =  0.05702074 ,  &
+         &          b3  = -0.09028607 ,  &
+         &          b4  =  0.00592797
+      !!---------------------------------------------------------------------
+      !
+      SELECT CASE ( ky )
+      CASE ( 1 )
+         zday = REAL( kday, wp ) - 0.5
+      CASE ( 3 )
+         zday = REAL( kday, wp ) - 1.0
+      CASE DEFAULT
+         zday = REAL( kday, wp ) 
+      END SELECT
+            
+      zp1 = rpi * ( 2.0 * zday - 367.0 ) / yearday
+      zp2 = 2. * zp1
+      zp3 = 3. * zp1
+      zp4 = 4. * zp1
+      
+      pdecl  = a0                                                                      &
+         &   + a1 * COS( zp1 ) + a2 * COS( zp2 ) + a3 * COS( zp3 ) + a4 * COS( zp4 )   &
+         &   + b1 * SIN( zp1 ) + b2 * SIN( zp2 ) + b3 * SIN( zp3 ) + b4 * SIN( zp4 )
+      !
+   END SUBROUTINE flx_blk_declin
+
+   !!======================================================================
+END MODULE sbcblk_clio
Index: /trunk/NEMO/OPA_SRC/SBC/sbcblk_core.F90
===================================================================
--- /trunk/NEMO/OPA_SRC/SBC/sbcblk_core.F90	(revision 702)
+++ /trunk/NEMO/OPA_SRC/SBC/sbcblk_core.F90	(revision 702)
@@ -0,0 +1,631 @@
+MODULE sbcblk_core
+   !!======================================================================
+   !!                       ***  MODULE  sbcblk_core  ***
+   !! Ocean forcing:  momentum, heat and freshwater flux formulation
+   !!=====================================================================
+   !! History :  9.0   !  04-08  (U. Schweckendiek)  Original code
+   !!                  !  05-04  (L. Brodeau, A.M. Treguier) additions: 
+   !!                            -  new bulk routine for efficiency
+   !!                            -  WINDS ARE NOW ASSUMED TO BE AT T POINTS in input files !!!!
+   !!                            -  file names and file characteristics in namelist 
+   !!                            -  Implement reading of 6-hourly fields   
+   !!                  !  06-06  (G. Madec) sbc rewritting
+   !!----------------------------------------------------------------------
+
+   !!----------------------------------------------------------------------
+   !!   sbc_blk_core  : bulk formulation as ocean surface boundary condition
+   !!                   (forced mode, CORE bulk formulea)
+   !!   blk_oce_core  : ocean: computes momentum, heat and freshwater fluxes
+   !!   blk_ice_core  : ice  : computes momentum, heat and freshwater fluxes
+   !!   turb_core     : computes the CORE turbulent transfer coefficients 
+   !!----------------------------------------------------------------------
+   USE oce             ! ocean dynamics and tracers
+   USE dom_oce         ! ocean space and time domain
+   USE phycst          ! physical constants
+   USE daymod          ! calendar
+   USE ocfzpt          ! ocean freezing point
+   USE fldread         ! read input fields
+   USE sbc_oce         ! Surface boundary condition: ocean fields
+   USE iom             ! I/O manager library
+   USE in_out_manager  ! I/O manager
+   USE lib_mpp         ! distribued memory computing library
+   USE lbclnk          ! ocean lateral boundary conditions (or mpp link)
+
+   IMPLICIT NONE
+   PRIVATE
+
+   PUBLIC   sbc_blk_core       ! routine called in sbcmod module
+   PUBLIC   blk_ice_core       ! routine called in sbc_ice_lim module
+      
+   INTEGER , PARAMETER ::   jpfld   = 8           ! maximum number of files to read 
+   INTEGER , PARAMETER ::   jp_wndi = 1           ! index of 10m wind velocity (i-component) (m/s)    at T-point
+   INTEGER , PARAMETER ::   jp_wndj = 2           ! index of 10m wind velocity (j-component) (m/s)    at T-point
+   INTEGER , PARAMETER ::   jp_humi = 3           ! index of specific humidity               ( % )
+   INTEGER , PARAMETER ::   jp_qsr  = 4           ! index of solar heat                      (W/m2)
+   INTEGER , PARAMETER ::   jp_qlw  = 5           ! index of Long wave                       (W/m2)
+   INTEGER , PARAMETER ::   jp_tair = 6           ! index of 10m air temperature             (Kelvin)
+   INTEGER , PARAMETER ::   jp_prec = 7           ! index of total precipitation (rain+snow) (Kg/m2/s)
+   INTEGER , PARAMETER ::   jp_snow = 8           ! index of snow (solid prcipitation)       (kg/m2/s)
+   TYPE(FLD), ALLOCATABLE, DIMENSION(:) ::   sf   ! structure of input fields (file informations, fields read)
+         
+   !! * CORE bulk parameters
+   REAL(wp), PARAMETER ::   rhoa =    1.22        ! air density
+   REAL(wp), PARAMETER ::   cpa  = 1000.5         ! specific heat of air
+   REAL(wp), PARAMETER ::   Lv   =    2.5e6       ! latent heat of vaporization
+   REAL(wp), PARAMETER ::   Ls   =    2.839e6     ! latent heat of sublimation
+   REAL(wp), PARAMETER ::   Stef =    5.67e-8     ! Stefan Boltzmann constant
+   REAL(wp), PARAMETER ::   Cice =    1.63e-3     ! transfer coefficient over ice
+
+   !! * Substitutions
+#  include "domzgr_substitute.h90"
+#  include "vectopt_loop_substitute.h90"
+   !!----------------------------------------------------------------------
+   !!   OPA 9.0 , LOCEAN-IPSL (2006) 
+   !! $Header: $
+   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
+
+CONTAINS
+
+   SUBROUTINE sbc_blk_core( kt )
+      !!---------------------------------------------------------------------
+      !!                    ***  ROUTINE sbc_blk_core  ***
+      !!                   
+      !! ** Purpose :   provide at each time step the surface ocean fluxes
+      !!      (momentum, heat, freshwater and runoff) 
+      !!
+      !! ** Method  :   READ each fluxes in NetCDF files
+      !!      The i-component of the stress                taux   (N/m2)
+      !!      The j-component of the stress                tauy   (N/m2)
+      !!      the net downward heat flux                   qtot   (watt/m2)
+      !!      the net downward radiative flux              qsr    (watt/m2)
+      !!      the net upward water (evapo - precip)        emp    (kg/m2/s)
+      !!                Assumptions made:
+      !!       - each file content an entire year (read record, not the time axis)
+      !!       - first and last record are part of the previous and next year
+      !!         (useful for time interpolation)
+      !!       - the number of records is 2 + 365*24 / freqh(jf)
+      !!         or 366 in leap year case
+      !!
+      !!      C A U T I O N : never mask the surface stress fields
+      !!                      the stress is assumed to be in the mesh referential
+      !!                      i.e. the (i,j) referential
+      !!
+      !! ** Action  :   defined at each time-step at the air-sea interface
+      !!              - utau  &  vtau   : stress components in geographical ref.
+      !!              - qns   &  qsr    : non solar and solar heat fluxes
+      !!              - emp             : evap - precip (volume flux)
+      !!              - emps            : evap - precip (concentration/dillution)
+      !!----------------------------------------------------------------------
+      INTEGER, INTENT( in  ) ::   kt   ! ocean time step
+      !!
+      INTEGER  ::   jf       ! dummy indices
+      INTEGER  ::   ierror   ! return error code
+      !!
+      CHARACTER(len=100) ::  cn_dir   !   Root directory for location of core files
+      TYPE(FLD_N), DIMENSION(jpfld) ::   slf_i     ! array of namelist informations on the fields to read
+      TYPE(FLD_N) ::   sn_wndi, sn_wndj, sn_humi, sn_qsr       ! informations about the fields to be read
+      TYPE(FLD_N) ::   sn_qlw , sn_tair, sn_prec, sn_snow      !   "                                 "
+      NAMELIST/namsbc_core/ cn_dir, sn_wndi, sn_wndj, sn_humi, sn_qsr,   &
+         &                          sn_qlw , sn_tair, sn_prec, sn_snow
+      !!---------------------------------------------------------------------
+
+      !                                         ! ====================== !
+      IF( kt == nit000 ) THEN                   !  First call kt=nit000  !
+         !                                      ! ====================== !
+         ! set file information (default values)
+         cn_dir = './'       ! directory in which the model is executed
+
+         ! (NB: frequency positive => hours, negative => months)
+         !            !    file     ! frequency !  variable  ! time intep !  clim  ! starting !
+         !            !    name     !  (hours)  !   name     !   (T/F)    !  (0/1) !  record  !
+         sn_wndi = FLD_N( 'uwnd10m' ,    24.    ,  'u_10'    ,  .FALSE.   ,    0   ,     0    ) 
+         sn_wndj = FLD_N( 'vwnd10m' ,    24.    ,  'v_10'    ,  .FALSE.   ,    0   ,     0    ) 
+         sn_qsr  = FLD_N( 'qsw'     ,    24.    ,  'qsw'     ,  .FALSE.   ,    0   ,     0    ) 
+         sn_qlw  = FLD_N( 'qlw'     ,    24.    ,  'qlw'     ,  .FALSE.   ,    0   ,     0    ) 
+         sn_tair = FLD_N( 'tair10m' ,    24.    ,  't_10'    ,  .FALSE.   ,    0   ,     0    ) 
+         sn_humi = FLD_N( 'humi10m' ,    24.    ,  'q_10'    ,  .FALSE.   ,    0   ,     0    ) 
+         sn_prec = FLD_N( 'precip'  ,   -12.    ,  'precip'  ,  .TRUE.    ,    0   ,     0    ) 
+         sn_snow = FLD_N( 'snow'    ,   -12.    ,  'snow'    ,  .TRUE.    ,    0   ,     0    ) 
+
+         REWIND( numnam )                    ! ... read in namlist namsbc_core
+         READ  ( numnam, namsbc_core )
+
+         ! store namelist information in an array
+         slf_i(jp_wndi) = sn_wndi   ;   slf_i(jp_wndj) = sn_wndj
+         slf_i(jp_qsr ) = sn_qsr    ;   slf_i(jp_qlw ) = sn_qlw
+         slf_i(jp_tair) = sn_tair   ;   slf_i(jp_humi) = sn_humi
+         slf_i(jp_prec) = sn_prec   ;   slf_i(jp_snow) = sn_snow
+         
+         ! set sf structure
+         ALLOCATE( sf(jpfld), STAT=ierror )
+         IF( ierror > 0 ) THEN
+            CALL ctl_stop( 'sbc_blk_core: unable to allocate sf structure' )   ;   RETURN
+         ENDIF
+
+         DO jf = 1, jpfld
+            WRITE(sf(jf)%clrootname,'(a,a)' )   TRIM( cn_dir ), TRIM( slf_i(jf)%clname )
+            sf(jf)%freqh   = slf_i(jf)%freqh
+            sf(jf)%clvar   = slf_i(jf)%clvar
+            sf(jf)%ln_tint = slf_i(jf)%ln_tint
+            sf(jf)%nclim   = slf_i(jf)%nclim
+            sf(jf)%nstrec  = slf_i(jf)%nstrec
+         END DO
+
+         IF(lwp) THEN      ! control print
+            WRITE(numout,*)            
+            WRITE(numout,*) 'sbc_blk_core : flux formulattion for ocean surface boundary condition'
+            WRITE(numout,*) '~~~~~~~~~~~~ '
+            WRITE(numout,*) '          namsbc_core Namelist'
+            WRITE(numout,*) '          list of files and frequency (>0: in hours ; <0 in months)'
+            DO jf = 1, jpfld
+                WRITE(numout,*) '               file root name: ' , TRIM( sf(jf)%clrootname ),   &
+                   &                          ' variable name: '  , TRIM( sf(jf)%clvar      )
+                WRITE(numout,*) '               frequency: '      ,       sf(jf)%freqh       ,   &
+                   &                          ' time interp: '    ,       sf(jf)%ln_tint     ,   &
+                   &                          ' climatology: '    ,       sf(jf)%nclim       ,   &
+                   &                          ' starting record: ',       sf(jf)%nstrec
+            END DO
+         ENDIF
+         !
+      ENDIF
+
+      CALL fld_read( kt, nn_fsbc, sf )                ! Read input fields and provides the
+      !                                               ! input fields at the current time-step
+
+!!gm  IF( MOD( kt - 1, nn_fsbc ) == 0 ) THEN
+
+      CALL blk_oce_core( sst_m, ssu_m, ssv_m )        ! set the ocean surface fluxes
+
+!!gm  ENDIF
+      !                                               ! using CORE bulk formulea
+   END SUBROUTINE sbc_blk_core
+   
+   
+   SUBROUTINE blk_oce_core( pst, pu, pv )
+      !!---------------------------------------------------------------------
+      !!                     ***  ROUTINE blk_core  ***
+      !!
+      !! ** Purpose :   provide the momentum, heat and freshwater fluxes at
+      !!      the ocean surface at each time step
+      !!
+      !! ** Method  :   CORE bulk formulea for the ocean using atmospheric
+      !!      fields read in sbc_read
+      !! 
+      !! ** Outputs : - utau    : i-component of the stress at U-point  (N/m2)
+      !!              - vtau    : j-component of the stress at V-point  (N/m2)
+      !!              - qsr_oce : Solar heat flux over the ocean        (W/m2)
+      !!              - qns_oce : Non Solar heat flux over the ocean    (W/m2)
+      !!              - evap    : Evaporation over the ocean            (kg/m2/s)
+      !!              - tprecip : Total precipitation                   (Kg/m2/s)
+      !!              - sprecip : Solid precipitation                   (Kg/m2/s)
+      !!---------------------------------------------------------------------
+      REAL(wp), INTENT(in), DIMENSION(jpi,jpj) ::   pst   ! surface temperature                      [Celcius]
+      REAL(wp), INTENT(in), DIMENSION(jpi,jpj) ::   pu    ! surface current at U-point (i-component) [m/s]
+      REAL(wp), INTENT(in), DIMENSION(jpi,jpj) ::   pv    ! surface current at V-point (j-component) [m/s]
+
+      INTEGER  ::   ji, jj     ! dummy loop indices
+      REAL(wp) ::   zcoef_qsatw
+      REAL(wp), DIMENSION(jpi,jpj) ::   zwnd_i, zwnd_j    ! wind speed components at T-point
+      REAL(wp), DIMENSION(jpi,jpj) ::   zwind_speed_t     ! wind speed module     at T-point ( = | U10m - Uoce | )
+      REAL(wp), DIMENSION(jpi,jpj) ::   zqsatw            ! specific humidity at pst
+      REAL(wp), DIMENSION(jpi,jpj) ::   zqlw, zqsb        ! long wave and sensible heat fluxes
+      REAL(wp), DIMENSION(jpi,jpj) ::   zqla, zevap       ! latent heat fluxes and evaporation
+      REAL(wp), DIMENSION(jpi,jpj) ::   Cd                ! transfer coefficient for momentum      (tau)
+      REAL(wp), DIMENSION(jpi,jpj) ::   Ch                ! transfer coefficient for sensible heat (Q_sens)
+      REAL(wp), DIMENSION(jpi,jpj) ::   Ce                ! tansfert coefficient for evaporation   (Q_lat)
+      REAL(wp), DIMENSION(jpi,jpj) ::   zst               ! surface temperature in Kelvin
+      !!---------------------------------------------------------------------
+
+      ! local scalars ( place there for vector optimisation purposes)
+      zcoef_qsatw = 0.98 * 640380. / rhoa
+      
+      zst(:,:) = pst(:,:) + rt0      ! converte Celcius to Kelvin (and set minimum value far above 0 K)
+
+      ! ----------------------------------------------------------------------------- !
+      !      0   Wind components and module at T-point relative to the moving ocean   !
+      ! ----------------------------------------------------------------------------- !
+      ! ... components ( U10m - U_oce ) at T-point (unmasked)
+      zwnd_i(:,:) = 0.e0  
+      zwnd_j(:,:) = 0.e0
+#if defined key_vectopt_loop
+!CDIR COLLAPSE
+#endif
+      DO jj = 2, jpjm1
+         DO ji = fs_2, fs_jpim1   ! vect. opt.
+            zwnd_i(ji,jj) = (  sf(jp_wndi)%fnow(ji,jj) - 0.5 * ( pu(ji-1,jj  ) + pu(ji,jj) )  )
+            zwnd_j(ji,jj) = (  sf(jp_wndj)%fnow(ji,jj) - 0.5 * ( pv(ji  ,jj-1) + pv(ji,jj) )  )
+         END DO
+      END DO
+      CALL lbc_lnk( zwnd_i(:,:) , 'T', -1. )
+      CALL lbc_lnk( zwnd_j(:,:) , 'T', -1. )
+      ! ... scalar wind ( = | U10m - U_oce | ) at T-point (masked)
+!CDIR NOVERRCHK
+!CDIR COLLAPSE
+      zwind_speed_t(:,:) = SQRT(  zwnd_i(:,:) * zwnd_i(:,:)   &
+         &                      + zwnd_j(:,:) * zwnd_j(:,:)  ) * tmask(:,:,1)
+
+      ! ----------------------------------------------------------------------------- !
+      !      I   Radiative FLUXES                                                     !
+      ! ----------------------------------------------------------------------------- !
+    
+      ! ocean albedo assumed to be 0.066
+!CDIR COLLAPSE
+      qsr (:,:) = ( 1. - 0.066 ) * sf(jp_qsr)%fnow(:,:) * tmask(:,:,1)                                 ! Short Wave
+!CDIR COLLAPSE
+      zqlw(:,:) = (  sf(jp_qlw)%fnow(:,:) - Stef * zst(:,:)*zst(:,:)*zst(:,:)*zst(:,:)  ) * tmask(:,:,1)   ! Long  Wave
+                      
+      ! ----------------------------------------------------------------------------- !
+      !     II    Turbulent FLUXES                                                    !
+      ! ----------------------------------------------------------------------------- !
+
+      ! ... specific humidity at SST and IST
+!CDIR NOVERRCHK
+!CDIR COLLAPSE
+      zqsatw(:,:) = zcoef_qsatw * EXP( -5107.4 / zst(:,:) ) 
+
+      ! ... NCAR Bulk formulae, computation of Cd, Ch, Ce at T-point :
+!!gm bug?  a the compiling phase, add a copy in temporary arrays...  ==> check perf!
+!     CALL TURB_CORE( 10., zst   (:,:), sf(jp_tair)%fnow(:,:),   &
+!        &                 zqsatw(:,:), sf(jp_humi)%fnow(:,:), zwind_speed_t(:,:),   &
+!        &                 Cd(:,:), Ch(:,:), Ce(:,:)                              )
+!!gm end
+      CALL TURB_CORE( 10., zst   , sf(jp_tair)%fnow,   &
+         &                 zqsatw, sf(jp_humi)%fnow, zwind_speed_t,   &
+         &                 Cd, Ch, Ce                              )
+   
+      ! ...  umasked Momentum : utau, vtau at U- and V_points, resp.
+      !      Note the use of 2-tmask in order to umask the stress along coastlines
+      zwnd_i(:,:) = rhoa * zwind_speed_t(:,:) * Cd(:,:) * zwnd_i(:,:)
+      zwnd_j(:,:) = rhoa * zwind_speed_t(:,:) * Cd(:,:) * zwnd_j(:,:)
+      DO jj = 1, jpjm1
+         DO ji = 1, fs_jpim1
+            utau(ji,jj) = 0.5 * ( zwnd_i(ji,jj) + zwnd_i(ji+1,jj  ) ) * ( 2. - tmask(ji,jj,1) )
+            vtau(ji,jj) = 0.5 * ( zwnd_j(ji,jj) + zwnd_j(ji  ,jj+1) ) * ( 2. - tmask(ji,jj,1) )
+         END DO
+      END DO
+      CALL lbc_lnk( utau(:,:), 'U', -1. )
+      CALL lbc_lnk( vtau(:,:), 'V', -1. )
+
+      !  Turbulent fluxes over ocean
+      ! -----------------------------
+!CDIR COLLAPSE
+      zevap(:,:) = rhoa    *Ce(:,:)*( zqsatw(:,:) - sf(jp_humi)%fnow(:,:) ) * zwind_speed_t(:,:)   ! Evaporation
+!CDIR COLLAPSE
+      zqsb (:,:) = rhoa*cpa*Ch(:,:)*( zst   (:,:) - sf(jp_tair)%fnow(:,:) ) * zwind_speed_t(:,:)   ! Sensible Heat
+!CDIR COLLAPSE
+      zqla (:,:) = Lv * zevap(:,:)                                                                 ! Latent Heat
+
+       
+      ! ----------------------------------------------------------------------------- !
+      !     III    Total FLUXES                                                       !
+      ! ----------------------------------------------------------------------------- !
+     
+!CDIR COLLAPSE
+      qns(:,:) = zqlw(:,:) - zqsb(:,:) - zqla(:,:)      ! Downward Non Solar flux
+       
+!CDIR COLLAPSE
+      emp (:,:) = zevap(:,:) - sf(jp_prec)%fnow(:,:) * tmask(:,:,1)
+!CDIR COLLAPSE
+      emps(:,:) = zevap(:,:) - sf(jp_prec)%fnow(:,:) * tmask(:,:,1)
+      !
+   END SUBROUTINE blk_oce_core
+   
+   
+   SUBROUTINE blk_ice_core(  pst   , pui   , pvi   , palb ,   &
+      &                      p_taui, p_tauj, p_qns , p_qsr,   &
+      &                      p_qla , p_dqns, p_dqla,          &
+      &                      p_tpr , p_spr ,                  &
+      &                      p_fr1 , p_fr2  ) 
+      !!---------------------------------------------------------------------
+      !!                     ***  ROUTINE blk_ice_core  ***
+      !!
+      !! ** Purpose :   provide the surface boundary condition over sea-ice
+      !!
+      !! ** Method  :   compute momentum, heat and freshwater exchanged
+      !!                between atmosphere and sea-ice using CORE bulk
+      !!                formulea, ice variables and read atmmospheric fields.
+      !!                NB: ice drag coefficient is assumed to be a constant
+      !! 
+      !! caution : the net upward water flux has with mm/day unit
+      !!---------------------------------------------------------------------
+      REAL(wp), INTENT(in   ), DIMENSION(jpi,jpj) ::   pst      ! ice surface temperature (>0, =rt0 over land)   [Kelvin]
+      REAL(wp), INTENT(in   ), DIMENSION(jpi,jpj) ::   pui      ! ice surface velocity (i-component, I-point)    [m/s]
+      REAL(wp), INTENT(in   ), DIMENSION(jpi,jpj) ::   pvi      ! ice surface velocity (j-component, I-point)    [m/s]
+      REAL(wp), INTENT(in   ), DIMENSION(jpi,jpj) ::   palb     ! ice albedo (clear sky) (alb_ice_cs)            [%]
+      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   p_taui   ! surface ice stress at I-point (i-component)    [N/m2]
+      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   p_tauj   ! surface ice stress at I-point (j-component)    [N/m2]
+      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   p_qns    ! non solar heat flux over ice (T-point)         [W/m2]
+      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   p_qsr    !     solar heat flux over ice (T-point)         [W/m2]
+      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   p_qla    ! latent    heat flux over ice (T-point)         [W/m2]
+      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   p_dqns   ! non solar heat sensistivity  (T-point)         [W/m2]
+      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   p_dqla   ! latent    heat sensistivity  (T-point)         [W/m2]
+      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   p_tpr    ! total precipitation          (T-point)         [Kg/m2/s]
+      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   p_spr    ! solid precipitation          (T-point)         [Kg/m2/s]
+      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   p_fr1    ! 1sr fraction of qsr penetration in ice         [%]
+      REAL(wp), INTENT(  out), DIMENSION(jpi,jpj) ::   p_fr2    ! 2nd fraction of qsr penetration in ice         [%]
+      !!
+      INTEGER  ::   ji, jj                    ! dummy loop indices
+      REAL(wp) ::   zst3
+      REAL(wp) ::   zcoef_wnorm, zcoef_dqlw, zcoef_dqla, zcoef_dqsb, zcoef_fr12
+      REAL(wp) ::   zwnorm_f, zwndi_f , zwndj_f      ! relative wind module and components at F-point
+      REAL(wp) ::             zwndi_t , zwndj_t      ! relative wind components at T-point
+      REAL(wp), DIMENSION(jpi,jpj) ::   z_wnds_t     ! wind speed ( = | U10m - U_ice | ) at T-point
+      REAL(wp), DIMENSION(jpi,jpj) ::   z_qlw        ! long wave heat flux over ice
+      REAL(wp), DIMENSION(jpi,jpj) ::   z_qsb        ! sensible  heat flux over ice
+      REAL(wp), DIMENSION(jpi,jpj) ::   z_dqlw       ! sensible  heat flux over ice
+      REAL(wp), DIMENSION(jpi,jpj) ::   z_dqsb       ! sensible  heat flux over ice
+      !!---------------------------------------------------------------------
+
+      ! local scalars ( place there for vector optimisation purposes)
+      zcoef_wnorm = rhoa * Cice
+      zcoef_dqlw = 4.0 * 0.95 * Stef
+      zcoef_dqla = -Ls * Cice * 0.98 * 11637800. / (rhoa*rhoa) * (-5897.8)
+      zcoef_dqsb = rhoa * cpa * Cice
+      zcoef_fr12 = 1.0  - 0.3       !!!gm ??? ! sf(jp_snow)%fnow(:,:)
+
+!!gm brutal....
+      z_wnds_t(:,:) = 0.e0
+      p_taui  (:,:) = 0.e0
+      p_tauj  (:,:) = 0.e0
+!!gm end
+
+      ! ----------------------------------------------------------------------------- !
+      !    Wind components and module relative to the moving ocean at I and T-point   !
+      ! ----------------------------------------------------------------------------- !
+      ! ... components ( U10m - U_oce ) at I-point (F-point with sea-ice indexation) (unmasked)
+      !     and scalar wind at T-point ( = | U10m - U_ice | ) (masked)
+#if defined key_vectopt_loop
+!CDIR COLLAPSE
+#endif
+!CDIR NOVERRCHK
+      DO jj = 2, jpjm1
+         DO ji = fs_2, fs_jpim1
+            ! ... scalar wind at I-point (fld being at T-point)
+            zwndi_f = 0.25 * (  sf(jp_wndi)%fnow(ji-1,jj  ) + sf(jp_wndi)%fnow(ji  ,jj  )   &
+               &              + sf(jp_wndi)%fnow(ji-1,jj-1) + sf(jp_wndi)%fnow(ji  ,jj-1)  ) - pui(ji,jj)
+            zwndj_f = 0.25 * (  sf(jp_wndj)%fnow(ji-1,jj  ) + sf(jp_wndj)%fnow(ji  ,jj  )   &
+               &              + sf(jp_wndj)%fnow(ji-1,jj-1) + sf(jp_wndj)%fnow(ji  ,jj-1)  ) - pvi(ji,jj)
+            zwnorm_f = zcoef_wnorm * SQRT( zwndi_f * zwndi_f + zwndj_f * zwndj_f )
+            ! ... ice stress at I-point
+            p_taui(ji,jj) = zwnorm_f * zwndi_f
+            p_tauj(ji,jj) = zwnorm_f * zwndj_f
+            ! ... scalar wind at T-point (fld being at T-point)
+            zwndi_t = sf(jp_wndi)%fnow(ji,jj) - 0.25 * (  pui(ji,jj+1) + pui(ji+1,jj+1)   &
+               &                                        + pui(ji,jj  ) + pui(ji+1,jj  )  )
+            zwndj_t = sf(jp_wndj)%fnow(ji,jj) - 0.25 * (  pvi(ji,jj+1) + pvi(ji+1,jj+1)   &
+               &                                        + pvi(ji,jj  ) + pvi(ji+1,jj  )  )
+            z_wnds_t(ji,jj)  = SQRT( zwndi_t * zwndi_t + zwndj_t * zwndj_t ) * tmask(ji,jj,1)
+         END DO
+      END DO
+      CALL lbc_lnk( p_taui  , 'I', -1. )
+      CALL lbc_lnk( p_tauj  , 'I', -1. )
+      CALL lbc_lnk( z_wnds_t, 'T',  1. )
+
+      ! ----------------------------------------------------------------------------- !
+      !      I   Radiative FLUXES                                                     !
+      ! ----------------------------------------------------------------------------- !
+!CDIR COLLAPSE
+      DO jj = 1, jpj
+         DO ji = 1, jpi
+            zst3 = pst(ji,jj) * pst(ji,jj) * pst(ji,jj)
+            p_qsr(ji,jj) = ( 1. - palb(ji,jj) ) * sf(jp_qsr)%fnow(ji,jj) * tmask(ji,jj,1)     ! Short Wave (sw)
+            z_qlw(ji,jj) = 0.95 * (  sf(jp_qlw)%fnow(ji,jj)       &                           ! Long  Wave (lw)
+               &                   - Stef * pst(ji,jj) * zst3  ) * tmask(ji,jj,1)
+            z_dqlw(ji,jj) = zcoef_dqlw * zst3                                                      ! lw sensitivity
+         END DO
+      END DO
+
+      ! ----------------------------------------------------------------------------- !
+      !     II    Turbulent FLUXES                                                    !
+      ! ----------------------------------------------------------------------------- !
+
+      ! ... turbulent heat fluxes
+!CDIR COLLAPSE
+      z_qsb(:,:) = rhoa * cpa * Cice * z_wnds_t(:,:) * ( pst(:,:) - sf(jp_tair)%fnow(:,:) )   ! Sensible Heat
+!CDIR NOVERRCHK
+!CDIR COLLAPSE
+      p_qla(:,:) = rhoa * Ls  * Cice * z_wnds_t(:,:)   &                                    ! Latent Heat
+         &       * (  11637800. * EXP( -5897.8 / pst(:,:) ) / rhoa - sf(jp_humi)%fnow(ji,jj)  )
+      
+      ! Latent heat sensitivity for ice (Dqla/Dt)
+!CDIR NOVERRCHK
+!CDIR COLLAPSE
+      p_dqla(:,:) = zcoef_dqla * z_wnds_t(:,:) / ( pst(:,:) * pst(:,:) ) * EXP( -5897.8 / pst(:,:) )
+       
+      ! Sensible heat sensitivity (Dqsb_ice/Dtn_ice)
+!CDIR COLLAPSE
+      z_dqsb(:,:) = zcoef_dqsb * z_wnds_t(:,:)
+
+      ! ----------------------------------------------------------------------------- !
+      !     III    Total FLUXES                                                       !
+      ! ----------------------------------------------------------------------------- !
+     
+!CDIR COLLAPSE
+      p_qns (:,:) =     z_qlw (:,:) - z_qsb (:,:) - p_qla (:,:)      ! Downward Non Solar flux
+!CDIR COLLAPSE
+      p_dqns(:,:) = - ( z_dqlw(:,:) + z_dqsb(:,:) + p_dqla(:,:) )    ! Total non solar heat flux sensitivity for ice
+       
+       
+      !--------------------------------------------------------------------
+      ! FRACTIONs of net shortwave radiation which is not absorbed in the
+      ! thin surface layer and penetrates inside the ice cover
+      ! ( Maykut and Untersteiner, 1971 ; Elbert and Curry, 1993 )
+    
+!CDIR COLLAPSE
+      p_fr1(:,:) = ( 0.18 * zcoef_fr12 + 0.35 * sf(jp_snow)%fnow(:,:) )
+!CDIR COLLAPSE
+      p_fr2(:,:) = ( 0.82 * zcoef_fr12 + 0.65 * sf(jp_snow)%fnow(:,:) )
+       
+!CDIR COLLAPSE
+      p_tpr(:,:) = sf(jp_prec)%fnow(:,:)      ! total precipitation [kg/m2/s]
+!CDIR COLLAPSE
+      p_spr(:,:) = sf(jp_snow)%fnow(:,:)      ! solid precipitation [kg/m2/s]
+      !
+   END SUBROUTINE blk_ice_core
+  
+  
+   SUBROUTINE turb_core( zzu, T_0, T_a, q_sat, q_a, dU, C_d, C_h, C_e )
+      !!---------------------------------------------------------------------
+      !!       Computes turbulent transfert coefficients of surface fluxes
+      !!             according to Large & Yeager (2004)
+      !!
+      !!    I N E R T I A L   D I S S I P A T I O N   M E T H O D
+      !!
+      !!   Momentum, Latent and sensible heat exchange coefficients
+      !!
+      !!   Caution: this procedure should only be used in cases when air temperature (T_air), 
+      !!   air specific humidity (q_air) and wind (dU) are provided at the same height 'zzu'!
+      !!
+      !!   Laurent Brodeau, LEGI, Grenoble
+      !!   brodeau@hmg.inpg.fr
+      !!---------------------------------------------------------------------
+      REAL(wp), INTENT(in   )                     ::   zzu     ! altitude of wind measurement      [m]
+      REAL(wp), INTENT(in   ), DIMENSION(jpi,jpj) ::   T_0     ! sea surface temperature           [Kelvin]
+      REAL(wp), INTENT(in   ), DIMENSION(jpi,jpj) ::   T_a     ! potential air temperature at zzu  [Kelvin]
+      REAL(wp), INTENT(in   ), DIMENSION(jpi,jpj) ::   q_sat   ! sea surface specific humidity     [kg/kg]
+      REAL(wp), INTENT(in   ), DIMENSION(jpi,jpj) ::   q_a     ! specific air humidity at zzu      [kg/kg]
+      REAL(wp), INTENT(in   ), DIMENSION(jpi,jpj) ::   dU      ! wind module |U(zzu)-U(0)|         [m/s]
+      REAL(wp), INTENT(inout), DIMENSION(jpi,jpj) ::   C_d     ! transfer coefficient for momentum      (tau)
+      REAL(wp), INTENT(inout), DIMENSION(jpi,jpj) ::   C_h     ! transfer coefficient for sensible heat (Q_sens)
+      REAL(wp), INTENT(inout), DIMENSION(jpi,jpj) ::   C_e     ! tansfert coefficient for evaporation   (Q_lat)
+
+      INTEGER             ::   jk                   ! dummy loop indices
+      INTEGER , PARAMETER ::   nit = 3              ! number of iterations
+      INTEGER , DIMENSION(jpi,jpj) ::   stab        ! stability test integer
+      INTEGER , DIMENSION(jpi,jpj) ::   stabit      ! stability within iterative loop
+      REAL(wp), DIMENSION(jpi,jpj) ::   &
+         dU10,        &  ! dU                                   [m/s]
+         dT,          &  ! air/sea temperature differeence      [K]
+         dq,          &  ! air/sea humidity difference          [K]
+         Cd_n10,      &  ! 10m neutral drag coefficient
+         Ce_n10,      &  ! 10m neutral latent coefficient
+         Ch_n10,      &  ! 10m neutral sensible coefficient
+         Cd,          &  ! drag coefficient
+         Ce,          &  ! latent coefficient
+         Ch,          &  ! sensible coefficient
+         sqrt_Cd_n10, &  ! root square of Cd_n10
+         sqrt_Cd,     &  ! root square of Cd
+         T_vpot,      &  ! virtual potential temperature        [K]
+         T_star,      &  ! turbulent scale of tem. fluct.
+         q_star,      &  ! turbulent humidity of temp. fluct.
+         U_star,      &  ! turb. scale of velocity fluct.
+         L,           &  ! Monin-Obukov length                  [m]
+         zeta,        &  ! stability parameter at height zzu
+         X2, X,       &   
+         psi_m,       &
+         psi_h,       &
+         U_n10,       &  ! neutral wind velocity at 10m        [m]   
+         xlogt
+      !!---------------------------------------------------------------------
+
+      !! I. Preliminary stuffs
+      !! --------------------
+
+      ! ... Air/sea differences
+      dU10 = MAX( 0.5, dU )     ! we do not want to fall under 0.5 m/s
+      dT   = T_a - T_0          ! assuming that T_a is allready the potential temp. at zzu
+      dq   = q_a - q_sat
+
+      ! ... Virtual potential temperature
+      T_vpot = T_a * ( 1. + 0.608 * q_a )
+
+      ! ... Computing Neutral Drag Coefficient
+!CDIR NOVERRCHK
+      Cd_n10      = 1E-3 * ( 2.7/dU10 + 0.142 + dU10/13.09 )          !  \\ L & Y eq. (6a)
+      sqrt_Cd_n10 = SQRT( Cd_n10 )
+
+      Ce_n10  = 1E-3 * ( 34.6 * sqrt_Cd_n10 )                         !  \\ L & Y eq. (6b)
+
+      ! ... First guess of stabilitty :
+      stab    = 0.5 + SIGN( 0.5, dT )     ! stable : stab = 1 ; unstable : stab = 0 
+      Ch_n10  = 1E-3 * sqrt_Cd_n10 * ( 18*stab + 32.7*(1-stab) )      !  \\ L & Y eq. (6c), (6d)
+
+      ! ... Initializing transfert coefficients with their first guess neutral equivalents :
+      Cd = Cd_n10   ;   Ce = Ce_n10   ;   Ch = Ch_n10
+
+
+      !! II. Now starting iteration loop (IDM)
+      !! -------------------------------------
+
+      DO jk = 1, nit
+ 
+!CDIR NOVERRCHK
+         sqrt_Cd = SQRT( Cd )
+
+         !! Turbulent scales :
+         !! ------------------
+         U_star  = sqrt_Cd    * dU10             !  \\ L & Y eq. (7a)
+         T_star  = Ch/sqrt_Cd * dT               !  \\ L & Y eq. (7b)
+         q_star  = Ce/sqrt_Cd * dq               !  \\ L & Y eq. (7c)
+
+         !! Estimate the Monin-Obukov length :
+         !! ----------------------------------
+         L  = (U_star*U_star) / ( vkarmn*grav*(T_star/T_vpot + q_star/(q_a + 1./0.608)) )
+
+         !! Stability parameters :
+         !! ----------------------
+         zeta = zzu / L
+         zeta = SIGN( MIN( ABS( zeta ), 10.0 ), zeta )
+
+         !! Psis, L & Y eq. (8c), (8d), (8e) :
+         !! ----------------------------------
+!CDIR NOVERRCHK
+         X2 = SQRT( ABS( 1. - 16.*zeta ) )   ;   X2 = MAX( X2 , 1.0 )   
+!CDIR NOVERRCHK
+         X  = SQRT( X2 )
+
+         stabit    = 0.5 + SIGN( 0.5, zeta )
+
+!CDIR NOVERRCHK
+         psi_m = -5. * zeta * stabit   &                                                   ! Stable
+            &  + (1 - stabit)*(2*LOG((1. + X)/2) + LOG((1. + X2)/2) - 2*atan(X) + rpi/2)   ! Unstable
+
+!CDIR NOVERRCHK
+         psi_h = -5. * zeta * stabit   &                                                   ! Stable
+            &  + (1 - stabit)*(2*LOG( (1. + X2)/2 ))                                       ! Unstable
+
+         !! Shifting the wind speed to 10m and neutral stability :
+         !! ------------------------------------------------------
+!CDIR NOVERRCHK
+         U_n10 = dU10 / (1. + SQRT( Cd_n10 ) / vkarmn * ( LOG(zzu/10.) - psi_m ) )    ! \\ L & Y eq. (9a)
+         
+         !! Updating the neutral 10m transfer coefficients :
+         !! ------------------------------------------------
+         Cd_n10  = 1e-3 * ( 2.7/U_n10 + 0.142 + U_n10/13.09 )              ! \\ L & Y eq. (6a)
+!CDIR NOVERRCHK
+         sqrt_Cd_n10 = SQRT( Cd_n10 )
+         
+         Ce_n10  = 1e-3 * ( 34.6 * sqrt_Cd_n10 )                           ! \\ L & Y eq. (6b)
+        
+         stab    = 0.5 + sign(0.5,zeta)
+         Ch_n10  = 1e-3 * sqrt_Cd_n10 * ( 18.*stab + 32.7*(1-stab) )       ! \\ L & Y eq. (6c), (6d)
+       
+         !! Shifting the neutral  10m transfer coefficients to ( zzu , zeta ) :
+         !! --------------------------------------------------------------------
+         !! Problem here, formulation used within L & Y differs from the one provided 
+         !! in their fortran code (only for Ce and Ch)
+         
+!CDIR NOVERRCHK
+         Cd = Cd_n10/(1. + sqrt_Cd_n10/vkarmn*(LOG(zzu/10) - psi_m))**2     ! \\ L & Y eq. (10a)
+        
+!CDIR NOVERRCHK
+         xlogt = LOG(zzu/10) - psi_h
+!CDIR NOVERRCHK
+         !?      Ch = Ch_n10*SQRT(Cd/Cd_n10)/(1. + Ch_n10/(vkarmn*sqrt_Cd_n10)*xlogt)
+         Ch = Ch_n10/( 1. + Ch_n10*xlogt/vkarmn/sqrt_Cd_n10 )**2             ! \\ L & Y eq. (10b)
+       
+!CDIR NOVERRCHK
+         !?      Ce = Ce_n10*SQRT(Cd/Cd_n10)/(1. + Ce_n10/(vkarmn*sqrt_Cd_n10)*xlogt)
+         Ce = Ce_n10/( 1. + Ce_n10*xlogt/vkarmn/sqrt_Cd_n10 )**2             ! \\ L & Y eq. (10c)
+      
+      END DO
+
+      C_d(:,:) = Cd(:,:)
+      C_h(:,:) = Ch(:,:)
+      C_e(:,:) = Ce(:,:)
+
+   END SUBROUTINE TURB_CORE
+  
+   !!======================================================================
+END MODULE sbcblk_core
Index: /trunk/NEMO/OPA_SRC/SBC/sbccpl.F90
===================================================================
--- /trunk/NEMO/OPA_SRC/SBC/sbccpl.F90	(revision 702)
+++ /trunk/NEMO/OPA_SRC/SBC/sbccpl.F90	(revision 702)
@@ -0,0 +1,383 @@
+MODULE sbccpl
+   !!======================================================================
+   !!                       ***  MODULE  sbccpl  ***
+   !! Ocean forcing:  momentum, heat and freshwater coupled formulation
+   !!=====================================================================
+   !! History :  9.0   !  06-07  (R. Redler, N. Keenlyside, W. Park) 
+   !!                            Original code split into flxmod & taumod
+   !!            9.0   !  06-07  (G. Madec)  surface module
+   !!----------------------------------------------------------------------
+#if defined key_sbc_cpl
+   !!----------------------------------------------------------------------
+   !!   'key_sbc_cpl'                   Coupled Ocean/Atmosphere formulation
+   !!----------------------------------------------------------------------
+   !!----------------------------------------------------------------------
+   !!   namsbc_cpl   : coupled formulation namlist
+   !!   sbc_cpl      : coupled formulation for the ocean surface boundary condition
+   !!----------------------------------------------------------------------
+   USE oce             ! ocean dynamics and tracers
+   USE dom_oce         ! ocean space and time domain
+   USE phycst          ! physical constants
+   USE in_out_manager  ! I/O manager
+   USE lib_mpp         ! distribued memory computing library
+   USE lbclnk          ! ocean lateral boundary conditions (or mpp link)
+   USE daymod          ! calendar
+
+   USE cpl_oasis3      ! OASIS3 coupling (to ECHAM5)
+   USE cpl_oasis4      ! OASIS4 coupling (to ECHAM5)
+   USE geo2ocean, ONLY : repere, repcmo
+   USE ice, only       : frld       ! : leads fraction = 1-a/totalarea
+
+   USE sbc_oce         ! Surface boundary condition: ocean fields
+
+   USE iom             ! NetCDF library
+
+   IMPLICIT NONE
+   PRIVATE
+
+   PUBLIC   sbc_cpl       ! routine called by step.F90
+
+   LOGICAL, PUBLIC ::   lk_sbc_cpl = .TRUE.   !: coupled formulation flag
+
+   INTEGER , PARAMETER                 ::   jpfld   = 5    ! maximum number of files to read 
+   INTEGER , PARAMETER                 ::   jp_taux = 1    ! index of wind stress (i-component) file
+   INTEGER , PARAMETER                 ::   jp_tauy = 2    ! index of wind stress (j-component) file
+   INTEGER , PARAMETER                 ::   jp_qtot = 3    ! index of total (non solar+solar) heat file
+   INTEGER , PARAMETER                 ::   jp_qsr  = 4    ! index of solar heat file
+   INTEGER , PARAMETER                 ::   jp_emp  = 5    ! index of evaporation-precipation file
+   
+!!wonsun         
+   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   &
+      taux, tauy       &  !: surface stress components in (i,j) referential
+
+
+   USE sbc_ice, only : dqns_ice , & ! : derivative of non solar heat flux on sea ice
+                       qsr_ice  , & ! : solar flux over ice
+                       qns_ice  , & ! : total non solar heat flux (Longwave downward radiation) over ice
+                       tn_ice   , & ! : ice surface temperature
+                       alb_ice  , & ! : albedo of ice
+                       sprecip  , & ! : solid (snow) precipitation over water (!) what about ice?
+                       tprecip  , & ! : total precipitation ( or liquid precip minus evaporation in coupled mode)
+                       calving  , & ! : calving
+                       rrunoff  , & ! : monthly runoff (kg/m2/s)
+                       fr1_i0   , & ! : 1st part of the fraction of sol.rad. which penetrate inside the ice cover
+                       fr2_i0       ! : 2nd part of the fraction of sol.rad. which penetrate inside the ice cover
+
+   USE ice, only    : hicif ,     & ! : ice thickness
+                      frld  ,     & ! : leads fraction = 1-a/totalarea
+                      hsnif  ,    & ! : snow thickness
+                      u_ice , v_ice ! : ice velocity
+
+   USE sbc_oce, only : sst_m        ! : sea surface temperature
+
+   REAL(wp), PUBLIC ::            & !!! surface fluxes namelist (namflx)
+      q0    = 0.e0,               &  ! net heat flux
+      qsr0  = 0.e0,               &  ! solar heat flux
+      emp0  = 0.e0,               &  ! net freshwater flux
+      dqdt0 = -40.,               &  ! coefficient for SST damping (W/m2/K)
+      deds0 = 27.7                   ! coefficient for SSS damping (mm/day)
+   
+    REAL(wp), DIMENSION(jpi,jpj) ::   qsr_oce_recv , qsr_ice_recv 
+    REAL(wp), DIMENSION(jpi,jpj) ::   qns_oce_recv, qns_ice_recv
+    REAL(wp), DIMENSION(jpi,jpj) ::   dqns_ice_recv
+    REAL(wp), DIMENSION(jpi,jpj) ::   tprecip_recv , precip_recv
+    REAL(wp), DIMENSION(jpi,jpj) ::   fr1_i0_recv  , fr2_i0_recv     
+    REAL(wp), DIMENSION(jpi,jpj) ::   rrunoff_recv , calving_recv   
+#if defined key_cpl_ocevel
+    REAL(wp), DIMENSION(jpi,jpj) :: un_weighted, vn_weighted
+    REAL(wp), DIMENSION(jpi,jpj) :: un_send    , vn_send 
+#endif
+    REAL(wp), DIMENSION(jpi,jpj) :: zrunriv   ! river discharge into ocean
+    REAL(wp), DIMENSION(jpi,jpj) :: zruncot   ! continental discharge into ocean
+
+    REAL(wp), DIMENSION(jpi,jpj) :: zpew      ! P-E over water
+    REAL(wp), DIMENSION(jpi,jpj) :: zpei      ! P-E over ice
+    REAL(wp), DIMENSION(jpi,jpj) :: zpsol     ! surface downward snow fall
+    REAL(wp), DIMENSION(jpi,jpj) :: zevice    ! surface upward snow flux where sea ice
+!!wonsun         
+
+   !! * Substitutions
+#  include "domzgr_substitute.h90"
+   !!----------------------------------------------------------------------
+   !!   OPA 9.0 , LOCEAN-IPSL (2006) 
+   !! $Header: $
+   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
+
+CONTAINS
+
+   SUBROUTINE sbc_cpl( kt )
+      !!---------------------------------------------------------------------
+      !!                    ***  ROUTINE sbc_cpl  ***
+      !!                   
+      !! ** Purpose :   provide at each time step the surface ocean fluxes
+      !!                (momentum, heat, freshwater and runoff) in coupled mode
+      !!
+      !! ** Method  : - Recieve from a Atmospheric model via OASIS coupler :
+      !!                   i-component of the stress              taux  (N/m2)
+      !!                   j-component of the stress              tauy  (N/m2)
+      !!                   net downward heat flux                 qtot  (watt/m2)
+      !!                   net downward radiative flux            qsr   (watt/m2)
+      !!                   net upward freshwater (evapo - precip) emp   (kg/m2/s)
+      !!              - send to the Atmospheric model via OASIS coupler :
+      !!
+      !! ** Action  :   update at each time-step the two components of the 
+      !!                surface stress in both (i,j) and geographical ref.
+      !!
+      !!
+      !!      CAUTION :  - never mask the surface stress fields
+      !!
+      !! ** Action  :   update at each time-step
+      !!              - taux  & tauy    : stress components in (i,j) referential
+      !!              - qns             : non solar heat flux
+      !!              - qsr             : solar heat flux
+      !!              - emp             : evap - precip (volume flux)
+      !!              - emps            : evap - precip (concentration/dillution)
+      !!
+      !! References : The OASIS User Guide, Version 3.0 and 4.0
+      !!----------------------------------------------------------------------
+      INTEGER, INTENT(in) ::   kt   ! ocean time step
+      !!
+      INTEGER  ::   ji, jj      ! dummy loop indices
+#if defined key_cpl_ocevel
+      INTEGER  ::   ikchoix 
+#endif
+      INTEGER  ::   var_id, info
+      INTEGER  ::   date          !????  !!gm bug  this is a real !!!
+      REAL(wp) ::   zfacflx, zfacwat, zfact
+
+      REAL(wp), DIMENSION(jpi,jpj) ::   ztaueuw, ztauevw   ! eastward  wind stress over water at U and V-points
+      REAL(wp), DIMENSION(jpi,jpj) ::   ztaunuw, ztaunvw   ! northward wind stress over water at U and V-points
+      REAL(wp), DIMENSION(jpi,jpj) ::   ztaueui, ztauevi   ! eastward  wind stress over ice   at U and V-points
+      REAL(wp), DIMENSION(jpi,jpj) ::   ztaunui, ztaunvi   ! northward wind stress over ice   at U and V-points
+      REAL(wp), DIMENSION(jpi,jpj) ::   ztaueu , ztauev    ! eastward wind stress combined
+      REAL(wp), DIMENSION(jpi,jpj) ::   ztaunu , ztaunv    ! northward wind stress combined 
+      !!---------------------------------------------------------------------
+
+      date = ( kt - nit000 ) * rdttra(1)        ! date of exxhanges
+      !                                         ! Conversion factor (ocean units are W/m2 and Kg/m2/s]
+      zfacflx = 1.e0  ! no conversion    [W/m2]         ! W/m2 heat fluxes are send by the Atmosphere 
+      zfacwat = 1.e3  ! convert [m/s] to [kg/m2/s]      ! m/s freshwater fluxes are send by the atmosphere
+
+
+      !                                         ! =========================== !
+      !                                         !     Send Coupling fields    !
+      !                                         ! =========================== !
+      ! 
+!!gm bug ?  here send instantaneous SST, not mean over the coupling period....
+      var_id = send_id(1)   ;   CALL cpl_prism_send( var_id, date, tn(:,:,1)+rt0, info )   ! ocean surface temperature [K]
+      var_id = send_id(2)   ;   CALL cpl_prism_send( var_id, date, 1.0-frld     , info )   ! fraction of ice-cover
+#if defined key_cpl_albedo
+      DO jj = 1, jpj
+         DO ji = 1, jpi
+            IF( ( tn_ice(ji,jj) < 50 .OR. tn_ice(ji,jj) > 400 ) .AND. frld(ji,jj) < 1. ) THEN
+              WRITE(numout,*) ' tn_ice, ERROR ', ji, jj, ' = ', tn_ice(ji,jj),   &
+                 &            ' qns_ice_recv=', qns_ice_recv(ji,jj), ' dqns_ice_recv=', dqns_ice_recv(ji,jj)
+            ENDIF
+         END DO
+      END DO
+      var_id = send_id(3)   ;   CALL cpl_prism_send( var_id, date, tn_ice      , info )    ! ice surface temperature [K]  
+      var_id = send_id(4)   ;   CALL cpl_prism_send( var_id, date, alb_ice     , info )    ! ice albedo [%]
+#else
+      var_id = send_id(3)   ;   CALL cpl_prism_send( var_id, date, hicif       , info )    ! ice  thickness [m]
+      var_id = send_id(4)   ;   CALL cpl_prism_send( var_id, date, hsnif       , info )    ! snow thickness [m]
+#endif
+#if defined key_cpl_ocevel
+!!gm bug???  I have to check the grid point position...
+!!           a priori there is a error here as un, vn are not at the same grid point....
+!!           there should be a averaged to set u and v at T-point.... with caution for sea-ice velocity at I-point....
+      un_weighted = un(:,:,1) * frld + u_ice * ( 1. - frld )
+      vn_weighted = vn(:,:,1) * frld + v_ice * ( 1. - frld )
+      ikchoix = - 1         ! converte from (i,j) to geographic referential
+      CALL repere( un_weighted, vn_weighted, un_send, vn_send, ikchoix )
+!!gm bug : at lbc_lnk is to be added on un_send and vn_send  
+      var_id = send_id(5)   ;   CALL cpl_prism_send( var_id, date, un_send    , info )        ! surface current [m/s]
+      var_id = send_id(6)   ;   CALL cpl_prism_send( var_id, date, vn_send    , info )        ! surface current [m/s]
+#endif
+
+      !                                         ! =========================== !
+      !                                         !   Recieve Momentum fluxes   !
+      !                                         ! =========================== !
+      ! 
+      ! ... Receive wind stress fields in geographic component over water and ice
+      var_id = recv_id(1)   ;   CALL cpl_prism_recv( var_id, date, ztaueuw, info )           ! ???
+      var_id = recv_id(2)   ;   CALL cpl_prism_recv( var_id, date, ztaunuw, info )
+      var_id = recv_id(3)   ;   CALL cpl_prism_recv( var_id, date, ztaueui, info )
+      var_id = recv_id(4)   ;   CALL cpl_prism_recv( var_id, date, ztaunui, info )
+      var_id = recv_id(5)   ;   CALL cpl_prism_recv( var_id, date, ztauevw, info )
+      var_id = recv_id(6)   ;   CALL cpl_prism_recv( var_id, date, ztaunvw, info )
+      var_id = recv_id(7)   ;   CALL cpl_prism_recv( var_id, date, ztauevi, info )
+      var_id = recv_id(8)   ;   CALL cpl_prism_recv( var_id, date, ztaunvi, info )
+      !
+!!gm bug : keep separate ice and ocean stress !
+      ! ... combine water / ice stresses
+      ztaueu(:,:) = ztaueuw(:,:) * frld(:,:) + ztaueui(:,:) * ( 1.0 - frld(:,:) )
+      ztaunu(:,:) = ztaunuw(:,:) * frld(:,:) + ztaunui(:,:) * ( 1.0 - frld(:,:) )
+      ztauev(:,:) = ztauevw(:,:) * frld(:,:) + ztauevi(:,:) * ( 1.0 - frld(:,:) )
+      ztaunv(:,:) = ztaunvw(:,:) * frld(:,:) + ztaunvi(:,:) * ( 1.0 - frld(:,:) )
+      !
+      ! ... rotate vector components from geographic to (i,j) referential
+      CALL repcmo ( ztaueu, ztaunu, ztauev, ztaunv, utau, vtau, kt )
+      !
+!!gm bug??  not sure but put that for security
+      CALL lbc_lnk( utau , 'U', -1. )
+      CALL lbc_lnk( vtau , 'V', -1. )
+!!gm end bug??
+      !
+      !                                         ! =========================== !
+      !                                         !     Recieve heat fluxes     !
+      !                                         ! =========================== !
+      !
+      var_id = recv_id(13)   ;   CALL cpl_prism_recv( var_id, date, qsr_oce_recv , info )   ! ocean surface net downward shortwave flux
+      var_id = recv_id(14)   ;   CALL cpl_prism_recv( var_id, date, qns_oce_recv , info )   ! ocean surface downward non-solar heat flux
+      var_id = recv_id(15)   ;   CALL cpl_prism_recv( var_id, date, qsr_ice_recv , info )   ! ice solar heat flux
+      var_id = recv_id(16)   ;   CALL cpl_prism_recv( var_id, date, qns_ice_recv , info )   ! ice non-solar heat flux
+      var_id = recv_id(17)   ;   CALL cpl_prism_recv( var_id, date, dqns_ice_recv, info )   ! ice non-solar heat flux sensitivity
+
+      qsr_oce_recv (:,:) = qsr_oce_recv (:,:) * tmask(:,:,1) * zfacflx
+      qns_oce_recv (:,:) = qns_oce_recv (:,:) * tmask(:,:,1) * zfacflx
+      qsr_ice_recv (:,:) = qsr_ice_recv (:,:) * tmask(:,:,1) * zfacflx
+      qns_ice_recv (:,:) = qns_ice_recv (:,:) * tmask(:,:,1) * zfacflx
+      dqns_ice_recv(:,:) = dqns_ice_recv(:,:) * tmask(:,:,1) * zfacflx
+
+      IF( kt == nit000 ) THEN                   ! set once for all qsr penetration in sea-ice
+         !                                      ! Since cloud cover catm not transmitted from atmosphere, it is set to 0. 
+         !                                      ! i.e. constant penetration fractions of 0.18 and 0.82
+         !  fraction of net shortwave radiation which is not absorbed in the thin surface layer and penetrates
+         !  inside the ice cover ( Maykut and Untersteiner, 1971 ; Elbert anbd Curry, 1993 )
+         fr1_i0_recv(:,:) = 0.18 
+         fr2_i0_recv(:,:) = 0.82
+      ENDIF
+      !
+      !                                         ! =========================== !
+      !                                         !  Recieve freshwater fluxes  !
+      !                                         ! =========================== !
+      !
+      var_id = recv_id( 9)   ;   CALL cpl_prism_recv( var_id, date, zpew  , info )      ! P-E over water
+      var_id = recv_id(10)   ;   CALL cpl_prism_recv( var_id, date, zpei  , info )      ! P-E over ice
+      var_id = recv_id(11)   ;   CALL cpl_prism_recv( var_id, date, zpsol , info )      ! Snow fall over water and ice
+      var_id = recv_id(12)   ;   CALL cpl_prism_recv( var_id, date, zevice, info )      ! Evaporation over ice (sublimination)
+      !
+      ! ... calculate water flux (P-E over open ocean and ice) and solid precipitation  (positive upward)
+      tprecip_recv(:,:) = ( zpew (:,:) + zpei  (:,:) ) * tmask(:,:,1) * zfacwat
+      sprecip_recv(:,:) = ( zpsol(:,:) + zevice(:,:) ) * tmask(:,:,1) * zfacwat
+      
+      ! ... Control print & check
+      IF(ln_ctl) THEN
+         WRITE(numout,*) ' flx:tprecip_recv    - Minimum value is ', MINVAL( tprecip_recv )
+         WRITE(numout,*) ' flx:tprecip_recv    - Maximum value is ', MAXVAL( tprecip_recv )
+         WRITE(numout,*) ' flx:tprecip_recv    -     Sum value is ', SUM   ( tprecip_recv )
+      ENDIF
+!!gm bug in mpp SUM require a mmp_sum call
+!!gm further more this test is quite expensive ...  only needed at the first time-step???
+      IF( SUM( zpew*e1t*e2t ) /= SUM( zpew*e1t*e2t*tmask(:,:,1) ) ) THEN
+         WRITE(numout,*) ' flx: Forcing values outside Orca mask'
+         WRITE(numout,*) ' flx: Losses in water conservation'
+         WRITE(numout,*) ' flx:   Masked ', SUM(zpew*e1t*e2t*tmask(:,:,1))
+         WRITE(numout,*) ' flx: Unmasked ', SUM(zpew*e1t*e2t)
+         WRITE(numout,*) ' flx: Simulation STOP'
+         CALL FLUSH(numout)
+         STOP
+      END IF
+      !
+#if defined key_cpl_discharge
+      ! Runoffs
+      var_id = recv_id(18)   ;   CALL cpl_prism_recv ( var_id, date, calving_recv, info )   ! ice discharge into ocean
+      var_id = recv_id(19)   ;   CALL cpl_prism_recv ( var_id, date, zrunriv     , info )   ! river discharge into ocean
+      var_id = recv_id(20)   ;   CALL cpl_prism_recv ( var_id, date, zruncot     , info )   ! continental discharge into ocean
+
+      DO jj = 1, jpj
+         DO ji = 1, jpi
+            zfact = zfacwat * tmask(ji,jj,1) 
+            calving_recv(ji,jj) =               calving_recv(ji,jj)   * zfact
+            rrunoff_recv(ji,jj) = ( zrunriv(ji,jj) + zruncot(ji,jj) ) * zfact
+         END DO
+      END DO
+#else
+      calving_recv(:,:) = 0.
+      rrunoff_recv(:,:) = 0.
+#endif
+
+!!gm  bug  :  this is not valid in mpp
+!!gm          and I presum this is not required at all as a lbc_lnk is applied to all the fields at the end of the routine
+      ! Oasis mask shift and update lateral boundary conditions (E. Maisonnave)
+      ! not tested when mpp is used, W. Park
+!WSPTEST
+      qsr_oce_recv (jpi-1,:) = qsr_oce_recv (1,:)
+      qsr_ice_recv (jpi-1,:) = qsr_ice_recv (1,:)
+      qns_oce_recv (jpi-1,:) = qns_oce_recv (1,:)
+      qns_ice_recv (jpi-1,:) = qns_ice_recv (1,:)
+      dqns_ice_recv(jpi-1,:) = dqns_ice_recv(1,:)
+      tprecip_recv (jpi-1,:) = tprecip_recv (1,:)
+      sprecip_recv (jpi-1,:) = sprecip_recv (1,:)
+      fr1_i0_recv  (jpi-1,:) = fr1_i0_recv  (1,:)
+      fr2_i0_recv  (jpi-1,:) = fr2_i0_recv  (1,:)
+      rrunoff_recv (jpi-1,:) = rrunoff_recv (1,:)
+      calving_recv (jpi-1,:) = calving_recv (1,:)
+!!gm end bug
+
+      qsr     (:,:) = qsr_oce_recv (:,:)      ! ocean surface boundary condition
+      qns     (:,:) = qns_oce_recv (:,:)
+      emp     (:,:) = zpew         (:,:)
+      emps    (:,:) = zpew         (:,:)
+      
+      qsr_ice (:,:) = qsr_ice_recv (:,:)      ! ice forcing fields
+      qns_ice (:,:) = qns_ice_recv (:,:)
+      dqns_ice(:,:) = dqns_ice_recv(:,:)
+      tprecip (:,:) = tprecip_recv (:,:)
+      sprecip (:,:) = sprecip_recv (:,:)
+      fr1_i0  (:,:) = fr1_i0_recv  (:,:)
+      fr2_i0  (:,:) = fr2_i0_recv  (:,:)
+      
+!WSP    rrunoff = rrunoff_recv 
+!WSP    calving = calving_recv
+      rrunoff (:,:) = 0.e0   !WSP runoff and calving included in tprecip
+      calving (:,:) = 0.e0   !WSP
+ 
+      IF(ln_ctl) THEN
+         WRITE(numout,*) 'flx:qsr_oce     - Minimum value is ', MINVAL( qsr_oce )
+         WRITE(numout,*) 'flx:qsr_oce     - Maximum value is ', MAXVAL( qsr_oce )
+         WRITE(numout,*) 'flx:qsr_oce     -     Sum value is ', SUM   ( qsr_oce )
+         !
+         WRITE(numout,*) 'flx:tprecip     - Minimum value is ', MINVAL( tprecip )
+         WRITE(numout,*) 'flx:tprecip     - Maximum value is ', MAXVAL( tprecip )
+         WRITE(numout,*) 'flx:tprecip     -     Sum value is ', SUM   ( tprecip )
+      ENDIF
+
+      CALL lbc_lnk( qsr_oce , 'T', 1. )
+      CALL lbc_lnk( qsr_ice , 'T', 1. )
+      CALL lbc_lnk( qns_oce , 'T', 1. )
+      CALL lbc_lnk( qns_ice , 'T', 1. )
+      CALL lbc_lnk( tprecip , 'T', 1. )
+      CALL lbc_lnk( sprecip , 'T', 1. )
+      CALL lbc_lnk( rrunoff , 'T', 1. )
+      CALL lbc_lnk( dqns_ice, 'T', 1. )
+      CALL lbc_lnk( calving , 'T', 1. )
+      CALL lbc_lnk( fr1_i0  , 'T', 1. )
+      CALL lbc_lnk( fr2_i0  , 'T', 1. )
+
+      IF(ln_ctl) THEN
+         WRITE(numout,*) 'flx(af lbc_lnk):qsr_oce     - Minimum value is ', MINVAL( qsr_oce )
+         WRITE(numout,*) 'flx(af lbc_lnk):qsr_oce     - Maximum value is ', MAXVAL( qsr_oce )
+         WRITE(numout,*) 'flx(af lbc_lnk):qsr_oce     -     Sum value is ', SUM   ( qsr_oce )
+         !
+         WRITE(numout,*) 'flx(af lbc_lnk):tprecip     - Minimum value is ', MINVAL( tprecip )
+         WRITE(numout,*) 'flx(af lbc_lnk):tprecip     - Maximum value is ', MAXVAL( tprecip )
+         WRITE(numout,*) 'flx(af lbc_lnk):tprecip     -     Sum value is ', SUM   ( tprecip )
+      ENDIF
+      !
+   END SUBROUTINE sbc_cpl
+
+#else
+   !!----------------------------------------------------------------------
+   !!   Dummy routine                              NO sea surface restoring
+   !!----------------------------------------------------------------------
+   LOGICAL, PUBLIC ::   lk_sbc_cpl = .FALSE.   !: coupled formulation flag
+CONTAINS
+   SUBROUTINE sbc_cpl( kt )         ! Dummy routine
+      WRITE(*,*) 'sbc_cpl: you should not have seen that print! error?', kt
+   END SUBROUTINE sbc_cpl
+#endif
+
+   !!======================================================================
+END MODULE sbccpl
Index: /trunk/NEMO/OPA_SRC/SBC/sbcflx.F90
===================================================================
--- /trunk/NEMO/OPA_SRC/SBC/sbcflx.F90	(revision 702)
+++ /trunk/NEMO/OPA_SRC/SBC/sbcflx.F90	(revision 702)
@@ -0,0 +1,199 @@
+MODULE sbcflx
+   !!======================================================================
+   !!                       ***  MODULE  sbcflx  ***
+   !! Ocean forcing:  momentum, heat and freshwater flux formulation
+   !!=====================================================================
+   !! History :  9.0   !  06-06  (G. Madec)  Original code
+   !!----------------------------------------------------------------------
+
+   !!----------------------------------------------------------------------
+   !!   namflx   : flux formulation namlist
+   !!   sbc_flx  : flux formulation as ocean surface boundary condition
+   !!              (forced mode, fluxes read in NetCDF files)
+   !!----------------------------------------------------------------------
+   !! question diverses
+   !!  *   ajouter un test sur la division entier de freqh et rdttra ???
+   !!  **  ajoute dans namelist: 1 year forcing files
+   !!                         or forcing file starts at the begining of the run
+   !!  *** we assume that the forcing file start and end with the previous
+   !!      year last record and the next year first record (useful for
+   !!      time interpolation, required even if no time interp???)
+   !!  *   ajouter un test sur la division de la frequence en pas de temps
+   !!  ==> daymod ajout de nsec_year = number of second since the begining of the year
+   !!      assumed to be 0 at 0h january the 1st (i.e. 24h december the 31)
+   !!
+   !!  *** regrouper dtatem et dtasal
+   !!----------------------------------------------------------------------
+   USE oce             ! ocean dynamics and tracers
+   USE dom_oce         ! ocean space and time domain
+   USE sbc_oce         ! Surface boundary condition: ocean fields
+   USE phycst          ! physical constants
+   USE daymod          ! calendar
+   USE ocfzpt          ! ocean freezing point
+   USE fldread         ! read input fields
+   USE iom             ! IOM library
+   USE in_out_manager  ! I/O manager
+   USE lib_mpp         ! distribued memory computing library
+   USE lbclnk          ! ocean lateral boundary conditions (or mpp link)
+
+   IMPLICIT NONE
+   PRIVATE
+
+   PUBLIC sbc_flx       ! routine called by step.F90
+
+   INTEGER , PARAMETER ::   jpfld   = 5   ! maximum number of files to read 
+   INTEGER , PARAMETER ::   jp_utau = 1   ! index of wind stress (i-component) file
+   INTEGER , PARAMETER ::   jp_vtau = 2   ! index of wind stress (j-component) file
+   INTEGER , PARAMETER ::   jp_qtot = 3   ! index of total (non solar+solar) heat file
+   INTEGER , PARAMETER ::   jp_qsr  = 4   ! index of solar heat file
+   INTEGER , PARAMETER ::   jp_emp  = 5   ! index of evaporation-precipation file
+   TYPE(FLD), ALLOCATABLE, DIMENSION(:) ::   sf    ! structure of input fields (file informations, fields read)
+
+   !! * Substitutions
+#  include "domzgr_substitute.h90"
+   !!----------------------------------------------------------------------
+   !!   OPA 9.0 , LOCEAN-IPSL (2006) 
+   !! $Header: $
+   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
+
+CONTAINS
+
+   SUBROUTINE sbc_flx( kt )
+      !!---------------------------------------------------------------------
+      !!                    ***  ROUTINE sbc_flx  ***
+      !!                   
+      !! ** Purpose :   provide at each time step the surface ocean fluxes
+      !!                (momentum, heat, freshwater and runoff) 
+      !!
+      !! ** Method  : - READ each fluxes in NetCDF files:
+      !!                   i-component of the stress              utau  (N/m2)
+      !!                   j-component of the stress              vtau  (N/m2)
+      !!                   net downward heat flux                 qtot  (watt/m2)
+      !!                   net downward radiative flux            qsr   (watt/m2)
+      !!                   net upward freshwater (evapo - precip) emp   (kg/m2/s)
+      !!                Assumptions made:
+      !!                 - each file content an entire year (read record, not the time axis)
+      !!                 - first and last record are part of the previous and next year
+      !!                   (useful for time interpolation)
+      !!                 - the number of records is 2 + 365*24 / freqh(jf)
+      !!                   or 366 in leap year case
+      !!
+      !!      CAUTION :  - never mask the surface stress fields
+      !!                 - the stress is assumed to be in the mesh referential
+      !!                   i.e. the (i,j) referential
+      !!
+      !! ** Action  :   update at each time-step
+      !!              - utau  & vtau    : stress components in (i,j) referential
+      !!              - qns             : non solar heat flux
+      !!              - qsr             : solar heat flux
+      !!              - emp             : evap - precip (volume flux)
+      !!              - emps            : evap - precip (concentration/dillution)
+      !!----------------------------------------------------------------------
+      INTEGER, INTENT(in) ::   kt   ! ocean time step
+      !!
+      INTEGER  ::   ji, jj, jf   ! dummy indices
+      INTEGER  ::   ierror       ! return error code
+      REAL(wp) ::   zfact        ! temporary scalar
+      !!
+      CHARACTER(len=100) ::  cn_dir                               ! Root directory for location of flx files
+      TYPE(FLD_N), DIMENSION(jpfld) ::   slf_i                    ! array of namelist information structures
+      TYPE(FLD_N) ::   sn_utau, sn_vtau, sn_qtot, sn_qsr, sn_emp  ! informations about the fields to be read
+      NAMELIST/namsbc_flx/ cn_dir, sn_utau, sn_vtau, sn_qtot, sn_qsr, sn_emp
+      !!---------------------------------------------------------------------
+   INTEGER , PARAMETER ::   jp_utau = 1   ! index of wind stress (i-component) file
+   INTEGER , PARAMETER ::   jp_vtau = 2   ! index of wind stress (j-component) file
+   INTEGER , PARAMETER ::   jp_qtot = 3   ! index of total (non solar+solar) heat file
+   INTEGER , PARAMETER ::   jp_qsr  = 4   ! index of solar heat file
+   INTEGER , PARAMETER ::   jp_emp  = 5   ! index of evaporation-precipation file
+
+
+      !                                         ! ====================== !
+      IF( kt == nit000 ) THEN                   !  First call kt=nit000  !
+         !                                      ! ====================== !
+         ! set file information
+         cn_dir = './'        ! directory in which the model is executed
+         ! ... default values (NB: frequency positive => hours, negative => months)
+         !            !   file    ! frequency !  variable  ! time intep !  clim  ! starting !
+         !            !   name    !  (hours)  !   name     !   (T/F)    !  (0/1) !  record  !
+         sn_utau = FLD_N( 'utau.nc' ,    24.    ,  'utau'    ,  .FALSE.   ,    0   ,     0    )
+         sn_vtau = FLD_N( 'vtau.nc' ,    24.    ,  'vtau'    ,  .FALSE.   ,    0   ,     0    )
+         sn_qtot = FLD_N( 'qtot.nc' ,    24.    ,  'qtot'    ,  .FALSE.   ,    0   ,     0    )
+         sn_qsr  = FLD_N( 'qsr.nc'  ,    24.    ,  'qsr'     ,  .FALSE.   ,    0   ,     0    )
+         sn_emp  = FLD_N( 'emp.nc'  ,    24.    ,  'emp'     ,  .FALSE.   ,    0   ,     0    )
+
+         REWIND ( numnam )               ! ... read in namlist namflx
+         READ   ( numnam, namsbc_flx ) 
+
+         ! store namelist information in an array
+         slf_i(jp_utau) = sn_utau   ;   slf_i(jp_vtau) = sn_vtau
+         slf_i(jp_qtot) = sn_qtot   ;   slf_i(jp_qsr ) = sn_qsr 
+         slf_i(jp_emp ) = sn_emp
+
+         ! set sf structure
+         ALLOCATE( sf(jpfld), STAT=ierror )
+         IF( ierror > 0 ) THEN
+            CALL ctl_stop( 'sbc_flx: unable to allocate sf structure' )   ;   RETURN
+         ENDIF
+
+         DO jf = 1, jpfld
+            WRITE(sf(jf)%clrootname,'(a,a)' )   TRIM( cn_dir ), TRIM( slf_i(jf)%clname )
+            sf(jf)%freqh   = slf_i(jf)%freqh
+            sf(jf)%clvar   = slf_i(jf)%clvar
+            sf(jf)%ln_tint = slf_i(jf)%ln_tint
+            sf(jf)%nclim   = slf_i(jf)%nclim
+            sf(jf)%nstrec  = slf_i(jf)%nstrec
+         END DO
+
+         IF(lwp) THEN      ! control print
+            WRITE(numout,*)
+            WRITE(numout,*) 'sbc_flx : flux formulation for ocean surface boundary condition'
+            WRITE(numout,*) '~~~~~~~ '
+            WRITE(numout,*) '          namsbc_flx Namelist'
+            WRITE(numout,*) '          list of files and frequency (>0: in hours ; <0 in months)'
+            DO jf = 1, jpfld
+                WRITE(numout,*) '               root filename: '  , trim( sf(jf)%clrootname ),   &
+                   &                          ' variable name: '  , trim( sf(jf)%clvar      )
+                WRITE(numout,*) '               frequency: '      ,       sf(jf)%freqh       ,   &
+                   &                          ' time interp: '    ,       sf(jf)%ln_tint     ,   &
+                   &                          ' climatology: '    ,       sf(jf)%nclim       ,   &
+                   &                          ' starting record: ',       sf(jf)%nstrec
+            END DO
+         ENDIF
+         !
+      ENDIF
+
+      CALL fld_read( kt, nn_fsbc, sf )           ! Read input fields and provides the
+      !                                          ! input fields at the current time-step
+
+      ! set the ocean fluxes from read fields
+!CDIR COLLAPSE
+      DO jj = 1, jpj
+         DO ji = 1, jpi
+            utau(ji,jj) = sf(jp_utau)%fnow(ji,jj)
+            vtau(ji,jj) = sf(jp_vtau)%fnow(ji,jj)
+            qns (ji,jj) = sf(jp_qtot)%fnow(ji,jj) - sf(jp_qsr)%fnow(ji,jj)
+            qsr (ji,jj) = sf(jp_qsr )%fnow(ji,jj)
+            emp (ji,jj) = sf(jp_emp )%fnow(ji,jj)
+         END DO
+      END DO
+
+      ! control print (if less than 100 time-step asked)
+      IF( nitend-nit000 <= 100 .AND. lwp ) THEN
+         WRITE(numout,*) 
+         WRITE(numout,*) '        read daily momentum, heat and freshwater fluxes OK'
+         DO jf = 1, jpfld
+            IF( jf == jp_utau .OR. jf == jp_vtau )   zfact =     1.
+            IF( jf == jp_qtot .OR. jf == jp_qsr  )   zfact =     0.1
+            IF( jf == jp_emp                     )   zfact = 86400.
+            WRITE(numout,*) 
+            WRITE(numout,*) ' day: ', ndastp , TRIM(sf(jf)%clvar), ' * ', zfact
+            CALL prihre( sf(jf)%fnow, jpi, jpj, 1, jpi, 20, 1, jpj, 10, 1., numout )
+         END DO
+         CALL FLUSH(numout)
+      ENDIF
+      !
+   END SUBROUTINE sbc_flx
+
+   !!======================================================================
+END MODULE sbcflx
Index: /trunk/NEMO/OPA_SRC/SBC/sbcfwb.F90
===================================================================
--- /trunk/NEMO/OPA_SRC/SBC/sbcfwb.F90	(revision 702)
+++ /trunk/NEMO/OPA_SRC/SBC/sbcfwb.F90	(revision 702)
@@ -0,0 +1,149 @@
+MODULE sbcfwb
+   !!======================================================================
+   !!                       ***  MODULE  sbcfwb  ***
+   !! Ocean fluxes   : domain averaged freshwater budget
+   !!======================================================================
+   !! History :  8.2  !  01-02  (E. Durand)  Original code
+   !!            8.5  !  02-06  (G. Madec)  F90: Free form and module
+   !!            9.0  !  06-08  (G. Madec)  Surface module
+   !!----------------------------------------------------------------------
+
+   !!----------------------------------------------------------------------
+   !!   sbc_fwb      : freshwater budget for global ocean configurations
+   !!                  in free surface and forced mode
+   !!----------------------------------------------------------------------
+   USE oce             ! ocean dynamics and tracers
+   USE dom_oce         ! ocean space and time domain
+   USE sbc_oce         ! surface ocean boundary condition
+   USE cpl_oce         ! coupled atmosphere/ocean
+   USE phycst          ! physical constants
+   USE sbcrnf          ! ocean runoffs
+   USE daymod          ! calendar
+   USE in_out_manager  ! I/O manager
+   USE lib_mpp         ! distribued memory computing library
+
+   IMPLICIT NONE
+   PRIVATE
+
+   PUBLIC   sbc_fwb      ! routine called by step
+
+   REAL(wp) ::   a_fwb_b            ! annual domain averaged freshwater budget
+   REAL(wp) ::   a_fwb              ! for 2 year before (_b) and before year.
+   REAL(wp) ::   empold             ! empold to be suppressed
+   REAL(wp) ::   area               ! global mean ocean surface (interior domain)
+
+   REAL(wp), DIMENSION(jpi,jpj) ::   e1e2_i    ! area of the interior domain (e1t*e2t*tmask_i)
+
+   !! * Substitutions
+#  include "domzgr_substitute.h90"
+#  include "vectopt_loop_substitute.h90"
+   !!----------------------------------------------------------------------
+   !!  OPA 9.0 , LOCEAN-IPSL (2006) 
+   !! $Header: $
+   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
+CONTAINS
+
+   SUBROUTINE sbc_fwb( kt, kn_fsbc, kn_fwb )
+      !!---------------------------------------------------------------------
+      !!                  ***  ROUTINE sbc_fwb  ***
+      !!
+      !! ** Purpose :   Control the mean sea surface drift
+      !!
+      !! ** Method  :   several ways  depending on kn_fwb
+      !!                =0 no control 
+      !!                =1 annual global mean corrected from previous year
+      !!                =2 global mean of emp set to zero at each nn_fsbc time step
+      !!----------------------------------------------------------------------
+      INTEGER, INTENT( in ) ::   kt       ! ocean time-step index
+      INTEGER, INTENT( in ) ::   kn_fsbc  ! 
+      INTEGER, INTENT( in ) ::   kn_fwb   ! ocean time-step index
+      !!
+      INTEGER  ::   inum = 11             ! temporary logical unit
+      INTEGER  ::   ikty, iyear           ! 
+      LOGICAL  ::   llbon
+      CHARACTER (len=32) ::   clname = 'EMPave_old.dat'
+      REAL(wp) ::   z_emp                 ! temporary scalars
+      !!----------------------------------------------------------------------
+      !
+      IF( kt == nit000 ) THEN
+         !
+         IF(lwp) THEN
+            WRITE(numout,*)
+            WRITE(numout,*) 'sbc_fwb : FreshWater Budget correction'
+            WRITE(numout,*) '~~~~~~~'
+            IF( kn_fwb == 1 )   WRITE(numout,*) '          instantaneously set to zero'
+            IF( kn_fwb == 2 )   WRITE(numout,*) '          adjusted from previous year budget'
+         ENDIF
+
+         e1e2_i(:,:) = e1t(:,:) * e2t(:,:) * tmask_i(:,:)
+         area = SUM( e1e2_i(:,:) )
+         IF( lk_mpp )   CALL  mpp_sum( area    )   ! sum over the global domain
+         !
+      ENDIF
+      
+
+      SELECT CASE ( kn_fwb )
+      !
+      CASE ( 1 )      ! global mean emp set to zero
+      IF( MOD( kt-1, kn_fsbc ) == 0 ) THEN
+         z_emp = SUM( e1e2_i(:,:) * emp(:,:) ) / area
+         IF( lk_mpp )   CALL  mpp_sum( z_emp    )   ! sum over the global domain
+         emp (:,:) = emp (:,:) - z_emp
+         emps(:,:) = emps(:,:) - z_emp
+      ENDIF
+      !
+      CASE ( 2 )      ! emp budget adjusted from the previous year
+         ! initialisation
+         IF( kt == nit000 ) THEN
+            ! Read the corrective factor on precipitations (empold)
+            INQUIRE( FILE=clname, EXIST=llbon )
+            IF( llbon ) THEN
+               OPEN ( inum, FILE=clname)
+               READ ( inum, "(24X,I8,2ES24.16)" ) iyear, a_fwb_b, a_fwb
+               CLOSE( inum )
+               empold = a_fwb                  ! current year freshwater budget correction
+               !                               ! estimate from the previous year budget
+               IF(lwp)WRITE(numout,*)
+               IF(lwp)WRITE(numout,*)'sbc_fwb : year = ',iyear  , ' freshwater budget correction = ', empold
+               IF(lwp)WRITE(numout,*)'          year = ',iyear-1, ' freshwater budget read       = ', a_fwb
+               IF(lwp)WRITE(numout,*)'          year = ',iyear-2, ' freshwater budget read       = ', a_fwb_b
+            ELSE
+               WRITE(ctmp1,*)'sbc_fwb : unable to read the file', clname
+               CALL ctl_stop( ctmp1 )
+            ENDIF
+         ENDIF
+  
+         ! Update empold if new year start
+         ikty = 365 * 86400 / rdttra(1)    !!bug  use of 365 days leap year or 360d year !!!!!!!
+         IF( MOD( kt, ikty ) == 0 ) THEN
+            a_fwb_b = a_fwb
+            a_fwb   = SUM( e1e2_i(:,:) * sshn(:,:) )
+            IF( lk_mpp )   CALL  mpp_sum( a_fwb    )   ! sum over the global domain
+            a_fwb   = a_fwb * 1.e+3 / ( area * 86400. * 365. )     ! convert in Kg/m3/s = mm/s
+!!gm        !                                                      !!bug 365d year 
+            empold =  a_fwb                 ! current year freshwater budget correction
+            !                               ! estimate from the previous year budget
+         ENDIF
+   
+         ! correct the freshwater fluxes
+         IF( MOD( kt-1, kn_fsbc ) == 0 ) THEN
+            emp (:,:) = emp (:,:) - empold
+            emps(:,:) = emps(:,:) - empold
+         ENDIF
+
+         ! save empold value in a file
+         IF( kt == nitend ) THEN
+            OPEN( inum, FILE='EMPave.dat' )
+            WRITE(inum, "(24X,I8,2ES24.16)" ) nyear, a_fwb_b, a_fwb
+         ENDIF
+         !
+      CASE DEFAULT    ! you should never be there
+         !!gm  add a print error
+         !
+      END SELECT
+      !
+   END SUBROUTINE sbc_fwb
+
+   !!======================================================================
+END MODULE sbcfwb
Index: /trunk/NEMO/OPA_SRC/SBC/sbcice_if.F90
===================================================================
--- /trunk/NEMO/OPA_SRC/SBC/sbcice_if.F90	(revision 702)
+++ /trunk/NEMO/OPA_SRC/SBC/sbcice_if.F90	(revision 702)
@@ -0,0 +1,159 @@
+MODULE sbcice_if
+   !!======================================================================
+   !!                       ***  MODULE  sbcice  ***
+   !! Surface module :  update surface ocean boundary condition over ice
+   !!                   covered area using ice-if model
+   !!======================================================================
+   !! History :  9.0   !  06-06  (G. Madec)  Original code
+   !!----------------------------------------------------------------------
+
+   !!----------------------------------------------------------------------
+   !!   sbc_ice_if     : update sbc in ice-covered area
+   !!----------------------------------------------------------------------
+   USE oce             ! ocean dynamics and tracers
+   USE dom_oce         ! ocean space and time domain
+   USE phycst          ! physical constants
+   USE ocfzpt          ! ocean freezing point
+   USE sbc_oce         ! Surface boundary condition: ocean fields
+   USE fldread         ! read input field
+   USE iom             ! I/O manager library
+   USE in_out_manager  ! I/O manager
+
+   IMPLICIT NONE
+   PRIVATE
+
+   PUBLIC   sbc_ice_if      ! routine called in sbcmod
+
+   TYPE(FLD), ALLOCATABLE, DIMENSION(:) ::   sf_ice   ! structure of input ice-cover (file informations, fields read)
+   
+   !! * Substitutions
+#  include "domzgr_substitute.h90"
+   !!----------------------------------------------------------------------
+   !!   OPA 9.0 , LOCEAN-IPSL (2006) 
+   !! $Header: $
+   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
+
+CONTAINS
+
+   SUBROUTINE sbc_ice_if( kt )
+      !!---------------------------------------------------------------------
+      !!                     ***  ROUTINE sbc_ice_if  ***
+      !!
+      !! ** Purpose :   handle surface boundary condition over ice cover area
+      !!      when sea-ice model are not used
+      !!
+      !! ** Method  : - read sea-ice cover climatology
+      !!              - blah blah blah, ...
+      !!
+      !! ** Action  :   qns, qsr:  update heat flux below sea-ice
+      !!                emp, emps: update freshwater flux below sea-ice
+      !!---------------------------------------------------------------------
+      INTEGER, INTENT(in)          ::   kt         ! ocean time step
+      !
+      CHARACTER(len=100) ::   cn_dir              ! Root directory for location of ice-if files
+      TYPE(FLD_N)        ::   sn_ice              ! informations about the fields to be read
+      NAMELIST/namsbc_iif/ cn_dir, sn_ice
+      !
+      INTEGER  ::   ji, jj     ! dummy loop indices
+      INTEGER  ::   ierror     ! return error code
+      REAL(wp) ::   ztrp, zsice, zt_fzp, zicover_obs, zicover_opa
+      REAL(wp) ::   zqri, zqrj, zqrp, zqi
+      !!---------------------------------------------------------------------
+      !                                         ! ====================== !
+      IF( kt == nit000 ) THEN                   !  First call kt=nit000  !
+         !                                      ! ====================== !
+         ! set file information
+         cn_dir = './'        ! directory in which the model is executed
+         ! ... default values (NB: frequency positive => hours, negative => months)
+         !            !   file    ! frequency !  variable  ! time intep !  clim  ! starting !
+         !            !   name    !  (hours)  !   name     !   (T/F)    !  (0/1) !  record  !
+         sn_ice = FLD_N('ice_cover',   -12.   ,  'ice_cov'  ,  .TRUE.    ,    1   ,     0    )
+
+         REWIND ( numnam )               ! ... read in namlist namiif
+         READ   ( numnam, namsbc_iif )
+
+         ALLOCATE( sf_ice(1), STAT=ierror )
+         IF( ierror > 0 ) THEN
+            CALL ctl_stop( 'sbc_ice_if: unable to allocate sf_ice structure' )   ;   RETURN
+         ENDIF
+
+         ! store namelist information in sf_ice structure
+         WRITE(sf_ice(1)%clrootname,'(a,a)' )   TRIM( cn_dir ), TRIM( sn_ice%clname )
+         sf_ice(1)%freqh   = sn_ice%freqh
+         sf_ice(1)%clvar   = sn_ice%clvar
+         sf_ice(1)%ln_tint = sn_ice%ln_tint
+         sf_ice(1)%nclim   = sn_ice%nclim
+         sf_ice(1)%nstrec  = sn_ice%nstrec
+
+         IF(lwp) THEN      ! control print
+            WRITE(numout,*)
+            WRITE(numout,*) 'sbc_ice_if : ice-if sea-ice model'
+            WRITE(numout,*) '~~~~~~~~~~ '
+            WRITE(numout,*) '   ice-cover data in the following file: '
+            WRITE(numout,*) '          list of files and frequency (>0: in hours ; <0 in months)'
+            WRITE(numout,*) '               root filename: '  , trim( sf_ice(1)%clrootname ),   &
+               &                          ' variable name: '  , trim( sf_ice(1)%clvar      )
+            WRITE(numout,*) '               frequency: '      ,       sf_ice(1)%freqh       ,   &
+               &                          ' time interp: '    ,       sf_ice(1)%ln_tint     ,   &
+               &                          ' climatology: '    ,       sf_ice(1)%nclim       ,   &
+               &                          ' starting record: ',       sf_ice(1)%nstrec
+         ENDIF
+         !
+      ENDIF
+
+      CALL fld_read( kt, nn_fsbc, sf_ice )           ! Read input fields and provides the
+      !                                              ! input fields at the current time-step
+      
+      IF( MOD( kt-1, nn_fsbc) == 0 ) THEN
+         !
+         ztrp = -40.             ! restoring terme for temperature (w/m2/k)
+         zsice = - 0.04 / 0.8    ! ratio of isohaline compressibility over isotherme compressibility
+                                 ! ( d rho / dt ) / ( d rho / ds )      ( s = 34, t = -1.8 )
+         ! Flux computation
+!CDIR COLLAPSE
+         DO jj = 1, jpj
+            DO ji = 1, jpi
+               ! ... sea surface freezing point temperature [Celcius]
+               zt_fzp = (  ( - 0.0575 + 1.710523e-3 * SQRT( sss_m(ji,jj) )   &
+            &                         - 2.154996e-4 *       sss_m(ji,jj)   ) * sss_m(ji,jj)  ) * tmask(ji,jj,1)
+            
+               ! ... indicators : ice cover (obs, ocean model) & hemisphere (=1 north, =-1 south)
+               zicover_obs = sf_ice(1)%fnow(ji,jj)                                                ! observed 
+               zicover_opa = MAX( 0., SIGN( 1., zt_fzp - sst_m(ji,jj) )  ) * tmask(ji,jj,1)   ! model   
+
+               ! ... avoid over-freezing point temperature
+               tn(ji,jj,1) = MAX( tn(ji,jj,1), zt_fzp )
+
+               ! ... solar heat flux : zero below observed ice cover
+               qsr(ji,jj) = ( 1. - zicover_obs ) * qsr(ji,jj)
+
+               ! ... non solar heat flux : add a damping term 
+               !      - gamma*(t-(tgel-1.))  if observed ice and no opa ice   (zicover_obs=1 zicover_opa=0)
+               !      - gamma*min(0,t-tgel)  if observed ice and opa ice      (zicover_obs=1 zicover_opa=1)
+
+               zqri = ztrp * ( tb(ji,jj,1) - ( zt_fzp - 1.) )
+               zqrj = ztrp * MIN( 0., tb(ji,jj,1) - zt_fzp )
+
+               zqrp =  ( zicover_obs * ( (1. - zicover_opa ) * zqri    &
+                 &                      +      zicover_opa   * zqrj ) ) * tmask(ji,jj,1)
+
+               ! c) net downward heat flux q() = q0 + qrp()
+               ! for q0
+               ! # qns unchanged              if no climatological ice              (zicover_obs=0)
+               ! # qns = zqrp                 if climatological ice and no opa ice  (zicover_obs=1, zicover_opa=0)
+               ! # qns = zqrp -2(-4) watt/m2  if climatological ice and opa ice     (zicover_obs=1, zicover_opa=1)
+               ! (-2=arctic, -4=antarctic)   
+               zqi = -3. + SIGN( 1.e0, ff(ji,jj) )
+               qns(ji,jj) = ( ( 1.- zicover_obs ) * qns(ji,jj)   &
+                  &          +      zicover_obs   * zicover_opa * zqi ) * tmask(ji,jj,1)   &
+                  &       + zqrp
+            END DO
+         END DO
+         !
+      ENDIF
+      !
+   END SUBROUTINE sbc_ice_if
+
+   !!======================================================================
+END MODULE sbcice_if
Index: /trunk/NEMO/OPA_SRC/SBC/sbcice_lim.F90
===================================================================
--- /trunk/NEMO/OPA_SRC/SBC/sbcice_lim.F90	(revision 702)
+++ /trunk/NEMO/OPA_SRC/SBC/sbcice_lim.F90	(revision 702)
@@ -0,0 +1,170 @@
+MODULE sbcice_lim
+   !!======================================================================
+   !!                       ***  MODULE  sbcice  ***
+   !! Surface module :  update surface ocean boundary condition over ice
+   !!                   covered area using LIM sea-ice model
+   !! Sea-Ice model  :  LIM Sea ice model time-stepping
+   !!======================================================================
+   !! History :  9.0   !  06-06  (G. Madec)  from icestp.F90
+   !!----------------------------------------------------------------------
+#if defined key_ice_lim
+   !!----------------------------------------------------------------------
+   !!   'key_ice_lim' :                                   Lim sea-ice model
+   !!----------------------------------------------------------------------
+   !!----------------------------------------------------------------------
+   !!   sbc_ice_lim    : sea-ice model time-stepping and
+   !!                    update ocean sbc over ice-covered area
+   !!----------------------------------------------------------------------
+   USE oce             ! ocean dynamics and tracers
+   USE dom_oce         ! ocean space and time domain
+   USE ice
+   USE iceini
+   USE ice_oce         ! ice variables
+   USE dom_ice
+   USE cpl_oce
+
+   USE sbc_oce         ! Surface boundary condition: ocean fields
+   USE sbc_ice         ! Surface boundary condition: ice   fields
+   USE sbcblk_core     ! Surface boundary condition: CORE bulk
+   USE sbcblk_clio     ! Surface boundary condition: CLIO bulk
+   USE albedo
+
+   USE daymod          ! day calendar
+   USE phycst          ! Define parameters for the routines
+   USE eosbn2          ! equation of state
+   USE limdyn
+   USE limtrp
+   USE limdmp
+   USE limthd
+   USE limsbc          ! sea surface boundary condition
+   USE limdia
+   USE limwri
+   USE limrst
+
+   USE lbclnk
+   USE iom             ! I/O manager library
+   USE in_out_manager  ! I/O manager
+   USE prtctl          ! Print control
+
+   IMPLICIT NONE
+   PRIVATE
+
+   PUBLIC sbc_ice_lim ! routine called by step.F90
+   
+   !! * Substitutions
+#  include "domzgr_substitute.h90"
+#  include "vectopt_loop_substitute.h90"
+   !!----------------------------------------------------------------------
+   !!   OPA 9.0 , LOCEAN-IPSL (2006) 
+   !! $Header: /
+   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
+
+CONTAINS
+
+   SUBROUTINE sbc_ice_lim( kt, kblk )
+      !!---------------------------------------------------------------------
+      !!                  ***  ROUTINE ice_stp  ***
+      !!                   
+      !! ** Purpose :   update the ocean surface boundary condition via the 
+      !!                Louvain la Neuve Sea Ice Model time stepping 
+      !!
+      !! ** Method  :   ice model time stepping
+      !!              - call the ice dynamics routine 
+      !!              - call the ice advection/diffusion routine 
+      !!              - call the ice thermodynamics routine 
+      !!              - call the routine that computes mass and 
+      !!                heat fluxes at the ice/ocean interface
+      !!              - save the outputs 
+      !!              - save the outputs for restart when necessary
+      !!
+      !! ** Action  : - time evolution of the LIM sea-ice model
+      !!              - update all sbc variables below sea-ice:
+      !!                utau, vtau, qns , qsr, emp , emps
+      !!---------------------------------------------------------------------
+      INTEGER, INTENT(in) ::   kt      ! ocean time step
+      INTEGER, INTENT(in) ::   kblk    ! type of bulk (=3 CLIO, =4 CORE)
+      !!
+      INTEGER  ::   ji, jj   ! dummy loop indices
+      REAL(wp), DIMENSION(jpi,jpj) ::   alb_oce_os   ! albedo of the ocean under overcast sky
+      REAL(wp), DIMENSION(jpi,jpj) ::   alb_oce_cs   ! albedo of the ocean under clear sky
+      REAL(wp), DIMENSION(jpi,jpj) ::   alb_ice_os   ! albedo of the ice under overcast sky
+      REAL(wp), DIMENSION(jpi,jpj) ::   alb_ice_cs   ! albedo of ice under clear sky
+      !!----------------------------------------------------------------------
+
+      IF( kt == nit000 ) THEN
+         IF(lwp) WRITE(numout,*)
+         IF(lwp) WRITE(numout,*) 'sbc_ice_lim : update ocean surface boudary condition' 
+         IF(lwp) WRITE(numout,*) '~~~~~~~~~~~   via Louvain la Neuve Ice Model (LIM) time stepping'
+      ENDIF
+
+      IF( MOD( kt-1, nn_fsbc ) == 0 ) THEN
+         !
+         ! ... mean surface ocean current at I-point (F-point with sea-ice indexation)
+         DO jj = 2, jpj
+            DO ji = fs_2, jpi   ! vector opt.
+               u_oce(ji,jj) = 0.5 * ( ssu_m(ji-1,jj  ) + ssu_m(ji-1,jj-1) )
+               v_oce(ji,jj) = 0.5 * ( ssv_m(ji  ,jj-1) + ssv_m(ji-1,jj-1) )
+            END DO
+         END DO
+         CALL lbc_lnk( u_oce, 'I', -1. )   ! I-point (i.e. F-point with ice indices)
+         CALL lbc_lnk( v_oce, 'I', -1. )   ! I-point (i.e. F-point with ice indices)
+
+         ! ... masked sea surface freezing temperature [Kelvin] (set to rt0 over land)
+         tfu(:,:) = tfreez( sss_m ) +  rt0 
+
+         ! ... ice and ocean albedo
+         CALL blk_albedo( alb_ice_os , alb_oce_os , alb_ice_cs , alb_oce_cs )
+
+
+         ! ... surface ice boundary condition (stress at I-point, latente, sensible, etc....
+         !!gm preciser la list exacte
+         SELECT CASE( kblk )
+         CASE( 3 )           ! CLIO bulk formulation
+            CALL blk_ice_clio()
+         CASE( 4 )           ! CORE bulk formulation
+            CALL blk_ice_core( sist     , u_ice    , v_ice    , alb_ice_cs,                      &
+               &                                     utaui_ice, vtaui_ice , qns_ice , qsr_ice,   &
+               &                                     qla_ice  , dqns_ice  , dqla_ice,            &
+               &                                     tprecip  , sprecip   ,                      &
+               &                                     fr1_i0   , fr2_i0  )
+         END SELECT
+
+         IF(ln_ctl) THEN         ! print mean trends (used for debugging)
+            CALL prt_ctl_info( 'Ice Forcings ' )
+            CALL prt_ctl( tab2d_1=tprecip  ,clinfo1=' precip   : ', tab2d_2=sprecip  , clinfo2=' Snow     : ' )
+            CALL prt_ctl( tab2d_1=utaui_ice,clinfo1=' utaui_ice: ', tab2d_2=vtaui_ice, clinfo2=' vtaui_ice: ' )
+            CALL prt_ctl( tab2d_1=hsnif    ,clinfo1=' hsnif  1 : ', tab2d_2=hicif    , clinfo2=' hicif    : ' )
+            CALL prt_ctl( tab2d_1=frld     ,clinfo1=' frld   1 : ', tab2d_2=sist     , clinfo2=' sist     : ' )
+         ENDIF
+
+         ! ---------------- !
+         !  Ice model step  !
+         ! ---------------- !
+         ;                              CALL lim_rst_opn  ( kt )      ! Open Ice restart file
+         ;                              CALL lim_dyn      ( kt )      ! Ice dynamics    ( rheology/dynamics )
+         ;                              CALL lim_trp      ( kt )      ! Ice transport   ( Advection/diffusion )
+         IF( ln_limdmp )                CALL lim_dmp      ( kt )      ! Ice damping 
+         ;                              CALL lim_thd      ( kt )      ! Ice thermodynamics 
+         ;                              CALL lim_sbc      ( kt )      ! Ice/Ocean Mass & Heat fluxes 
+         IF( MOD( kt+nfice-1, ninfo ) == 0 .OR.   &
+            &  ntmoy == 1 )             CALL lim_dia      ( kt )      ! Ice Diagnostics 
+         ;                              CALL lim_wri      ( kt )      ! Ice outputs 
+         IF( lrst_ice )                 CALL lim_rst_write( kt )      ! Ice restart file 
+         !
+      ENDIF
+      !
+   END SUBROUTINE sbc_ice_lim
+
+#else
+   !!----------------------------------------------------------------------
+   !!   Default option           Dummy module          NO LIM sea-ice model
+   !!----------------------------------------------------------------------
+CONTAINS
+   SUBROUTINE sbc_ice_lim ( kt, kblk )     ! Dummy routine
+      WRITE(*,*) 'sbc_ice_lim: You should not have seen this print! error?', kt, kblk
+   END SUBROUTINE sbc_ice_lim
+#endif
+
+   !!======================================================================
+END MODULE sbcice_lim
Index: /trunk/NEMO/OPA_SRC/SBC/sbcmod.F90
===================================================================
--- /trunk/NEMO/OPA_SRC/SBC/sbcmod.F90	(revision 702)
+++ /trunk/NEMO/OPA_SRC/SBC/sbcmod.F90	(revision 702)
@@ -0,0 +1,255 @@
+MODULE sbcmod
+   !!======================================================================
+   !!                       ***  MODULE  sbcmod  ***
+   !! Surface module :  provide to the ocean its surface boundary condition
+   !!======================================================================
+   !! History :  9.0   !  06-07  (G. Madec)  Original code
+   !!----------------------------------------------------------------------
+
+   !!----------------------------------------------------------------------
+   !!   sbc_init       : read namsbc namelist
+   !!   sbc            : surface ocean momentum, heat and freshwater 
+   !!                    boundary conditions
+   !!----------------------------------------------------------------------
+   USE oce             ! ocean dynamics and tracers
+   USE dom_oce         ! ocean space and time domain
+   USE daymod          ! calendar
+   USE phycst          ! physical constants
+   USE ocfzpt          ! ocean freezing point
+
+   USE ice_oce         ! sea-ice model : LIM
+   USE sbc_oce         ! Surface boundary condition: ocean fields
+   USE sbcssm          ! surface boundary condition: sea-surface mean variables
+   USE sbcana          ! surface boundary condition: analytical formulation
+   USE sbcflx          ! surface boundary condition: flux formulation
+   USE sbcblk_clio     ! surface boundary condition: bulk formulation : CLIO
+   USE sbcblk_core     ! surface boundary condition: bulk formulation : CORE
+   USE sbcice_if       ! surface boundary condition: ice-if sea-ice model
+   USE sbcice_lim      ! surface boundary condition: LIM sea-ice model
+   USE sbccpl          ! surface boundary condition: coupled florulation
+   USE sbcssr          ! surface boundary condition: sea surface restoring
+   USE sbcrnf          ! surface boundary condition: runoffs
+   USE sbcfwb          ! surface boundary condition: freshwater budget
+   USE closea          ! closed sea
+
+   USE prtctl          ! Print control                    (prt_ctl routine)
+   USE restart         ! ocean restart
+   USE iom
+   USE in_out_manager  ! I/O manager
+
+   IMPLICIT NONE
+   PRIVATE
+
+   PUBLIC   sbc        ! routine called by step.F90
+   
+   !! * namsbc namelist (public variables)
+!!gm defined in sbc_oce   INTEGER , PUBLIC ::   nn_fsbc                 !: frequency of surface boundary condition computation
+   LOGICAL , PUBLIC ::   ln_ana      = .FALSE.   !: analytical boundary condition flag
+   LOGICAL , PUBLIC ::   ln_flx      = .FALSE.   !: flux      formulation
+   LOGICAL , PUBLIC ::   ln_blk_clio = .FALSE.   !: CLIO bulk formulation
+   LOGICAL , PUBLIC ::   ln_blk_core = .FALSE.   !: CORE bulk formulation
+   LOGICAL , PUBLIC ::   ln_cpl      = .FALSE.   !: coupled   formulation (overwritten by key_sbc_coupled )
+   LOGICAL , PUBLIC ::   ln_dm2dc    = .FALSE.   !: Daily mean to Diurnal Cycle short wave (qsr)
+   LOGICAL , PUBLIC ::   ln_rnf      = .FALSE.   !: runoffs / runoff mouths
+   LOGICAL , PUBLIC ::   ln_ssr      = .FALSE.   !: Sea Surface restoring on SST and/or SSS      
+   INTEGER , PUBLIC ::   nn_ice      = 0         !: flag on ice in the surface boundary condition (=0/1/2)
+   INTEGER , PUBLIC ::   nn_fwb      = 0         !: type of FreshWater Budget control (=0/1/2)
+   NAMELIST/namsbc/ nn_fsbc, ln_ana, ln_flx, ln_blk_clio, ln_blk_core, ln_cpl,   &
+      &             nn_ice , ln_rnf, ln_ssr, nn_fwb
+
+   INTEGER ::   nsbc   ! type of surface boundary condition (deduced from namsbc informations)
+   INTEGER ::   nice   ! type of ice in the surface boundary condition (deduced from namsbc informations)
+      
+   !! * Substitutions
+#  include "domzgr_substitute.h90"
+   !!----------------------------------------------------------------------
+   !!   OPA 9.0 , LOCEAN-IPSL (2006) 
+   !! $Header: $
+   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
+
+CONTAINS
+
+   SUBROUTINE sbc_init
+      !!---------------------------------------------------------------------
+      !!                    ***  ROUTINE sbc_init ***
+      !!
+      !! ** Purpose :   Initialisation of the ocean surface boundary computation
+      !!
+      !! ** Method  :   Read the namsbc namelist and set derived parameters
+      !!
+      !! ** Action  : - read namsbc parameters
+      !!              - nsbc: type of sbc
+      !!----------------------------------------------------------------------
+      INTEGER ::   icpt      ! temporary integer
+      !!----------------------------------------------------------------------
+
+      IF(lwp) THEN
+         WRITE(numout,*)
+         WRITE(numout,*) 'sbc_init : surface boundary condition setting'
+         WRITE(numout,*) '~~~~~~~~ '
+      ENDIF
+
+      REWIND ( numnam )                   ! Read Namelist namsbc
+      READ   ( numnam, namsbc )
+
+      ! overwrite namelist parameter using CPP key information
+!!gmhere no overwrite, test all option via namelist change: require more incore memory
+!!gm  IF( lk_sbc_cpl       ) THEN   ;   ln_cpl      = .TRUE.   ;   ELSE   ;   ln_cpl      = .FALSE.   ;   ENDIF
+      IF( lk_ice_lim       )            nn_ice      = 2
+      IF( cp_cfg == 'gyre' ) THEN
+          ln_ana      = .TRUE.   
+          nn_ice      =   0
+      ENDIF
+      
+      ! Control print
+      IF(lwp) THEN
+         WRITE(numout,*) '        Namelist namsbc (overwritten using CPP key defined)'
+         WRITE(numout,*) '           frequency update of sbc (and ice)             nn_fsbc     = ', nn_fsbc
+         WRITE(numout,*) '           Type of sbc : '
+         WRITE(numout,*) '              analytical formulation                     ln_ana      = ', ln_ana
+         WRITE(numout,*) '              flux       formulation                     ln_flx      = ', ln_flx
+         WRITE(numout,*) '              CLIO bulk  formulation                     ln_blk_clio = ', ln_blk_clio
+         WRITE(numout,*) '              CLIO bulk  formulation                     ln_blk_core = ', ln_blk_core
+         WRITE(numout,*) '              coupled    formulation (T if key_sbc_cpl)  ln_cpl      = ', ln_cpl
+         WRITE(numout,*) '           Misc. options of sbc : '
+         WRITE(numout,*) '              ice management in the sbc (=0/1/2)         nn_ice      = ', nn_ice 
+         WRITE(numout,*) '              daily mean to diurnal cycle qsr            ln_dm2dc    = ', ln_dm2dc 
+         WRITE(numout,*) '              runoff / runoff mouths                     ln_rnf      = ', ln_rnf
+         WRITE(numout,*) '              Sea Surface Restoring on SST and/or SSS    ln_ssr      = ', ln_ssr
+         WRITE(numout,*) '              FreshWater Budget control  (=0/1/2)        nn_fwb      = ', nn_fwb
+         WRITE(numout,*) '              closed sea (=0/1) (set in namdom)          nclosea     = ', nclosea
+      ENDIF
+
+      ! Check consistancy   !!gm mixture of real and integer : coding to be changed....
+
+      IF( .NOT. ln_rnf )   nn_runoff = 0      ! no runoff, or runoff mouths
+
+      IF( MOD( rday, nn_fsbc*rdt ) /= 0 ) THEN 
+         IF(lwp) WRITE(numout,*)
+         IF(lwp) WRITE(numout,*) 'W A R N I N G :  nn_fsbc is NOT a multiple of the number of time steps in a day'
+         IF(lwp) WRITE(numout,*) ' '
+         nwarn = nwarn + 1
+      ENDIF
+
+      IF( nn_ice == 2 .AND. .NOT.( ln_blk_clio .OR. ln_blk_core ) )   &
+         &   CALL ctl_stop( 'sbc_init: sea-ice model requires a bulk formulation' )
+      
+      ! Choice of the Surface Boudary Condition (set nsbc)
+      icpt = 0
+      IF( ln_ana          ) THEN   ;   nsbc =  1   ; icpt = icpt + 1   ;   ENDIF       ! analytical      formulation
+      IF( ln_flx          ) THEN   ;   nsbc =  2   ; icpt = icpt + 1   ;   ENDIF       ! flux            formulation
+      IF( ln_blk_clio     ) THEN   ;   nsbc =  3   ; icpt = icpt + 1   ;   ENDIF       ! CLIO bulk       formulation
+      IF( ln_blk_core     ) THEN   ;   nsbc =  4   ; icpt = icpt + 1   ;   ENDIF       ! CORE bulk       formulation
+      IF( ln_cpl          ) THEN   ;   nsbc =  5   ; icpt = icpt + 1   ;   ENDIF       ! Coupled         formulation
+      IF( cp_cfg == 'gyre') THEN   ;   nsbc =  0                       ;   ENDIF       ! GYRE analytical formulation
+      IF( lk_esopa        )            nsbc = -1                                       ! esopa test, ALL formulations
+
+      IF( icpt /= 1 .AND. .NOT.lk_esopa ) THEN
+         WRITE(numout,*)
+         WRITE(numout,*) '           E R R O R in setting the sbc, one and only one namelist/CPP key option '
+         WRITE(numout,*) '                     must be choosen. You choose ', icpt, ' option(s)'
+         WRITE(numout,*) '                     We stop'
+         nstop = nstop + 1
+      ENDIF
+      IF(lwp) THEN
+         WRITE(numout,*)
+         IF( nsbc == -1 )   WRITE(numout,*) '              ESOPA test All surface boundary conditions'
+         IF( nsbc ==  0 )   WRITE(numout,*) '              GYRE analytical formulation'
+         IF( nsbc ==  1 )   WRITE(numout,*) '              analytical formulation'
+         IF( nsbc ==  2 )   WRITE(numout,*) '              flux formulation'
+         IF( nsbc ==  3 )   WRITE(numout,*) '              CLIO bulk formulation'
+         IF( nsbc ==  4 )   WRITE(numout,*) '              CORE bulk formulation'
+         IF( nsbc ==  5 )   WRITE(numout,*) '              coupled formulation'
+      ENDIF
+      !
+   END SUBROUTINE sbc_init
+
+
+   SUBROUTINE sbc( kt )
+      !!---------------------------------------------------------------------
+      !!                    ***  ROUTINE sbc  ***
+      !!              
+      !! ** Purpose :   provide at each time-step the ocean surface boundary
+      !!                condition (momentum, heat and freshwater fluxes)
+      !!
+      !! ** Method  :   blah blah  to be written ????????? 
+      !!                CAUTION : never mask the surface stress field (tke sbc)
+      !!
+      !! ** Action  : - set the ocean surface boundary condition, i.e.  
+      !!                utau, vtau, qns, qsr, emp, emps, qrp, erp
+      !!----------------------------------------------------------------------
+      INTEGER, INTENT(in) ::   kt       ! ocean time step
+      !!---------------------------------------------------------------------
+
+      IF( kt == nit000 )   CALL sbc_init         ! Read namsbc namelist : surface module
+
+      ! ocean to sbc mean sea surface variables (ss._m)
+      ! ---------------------------------------
+      CALL sbc_ssm( kt )                         ! sea surface mean currents (at U- and V-points), 
+      !                                          ! temperature and salinity (at T-point) over nf_sbc time-step
+      !                                          ! (i.e. sst_m, sss_m, ssu_m, ssv_m)
+
+!!gm  add a flag on nn_fsbc frequency ?????  except the diurnal cycle!
+!!    IF( MOD( kt - 1, nn_fsbc ) == 0 ) THEN
+
+
+      ! sbc formulation
+      ! ---------------
+         
+      SELECT CASE( nsbc )                        ! Compute ocean surface boundary condition
+      !                                          ! (i.e. utau,vtau, qns, qsr, emp, emps)
+      CASE(  0 )   ;   CALL sbc_gyre    ( kt )      ! analytical formulation : GYRE configuration
+      CASE(  1 )   ;   CALL sbc_ana     ( kt )      ! analytical formulation : uniform sbc
+      CASE(  2 )   ;   CALL sbc_flx     ( kt )      ! flux formulation
+      CASE(  3 )   ;   CALL sbc_blk_clio( kt )      ! bulk formulation : CLIO for the ocean
+      CASE(  4 )   ;   CALL sbc_blk_core( kt )      ! bulk formulation : CORE for the ocean
+      CASE(  5 )   ;   CALL sbc_cpl     ( kt )      ! coupled formulation
+      CASE( -1 )                                
+         ;             CALL sbc_ana     ( kt )      ! ESOPA, test ALL the formulations
+         ;             CALL sbc_gyre    ( kt )
+         ;             CALL sbc_flx     ( kt )
+         ;             CALL sbc_blk_clio( kt )
+         ;             CALL sbc_blk_core( kt )
+         ;             CALL sbc_cpl     ( kt )
+      END SELECT
+
+      ! Misc. Options
+      ! -------------
+
+!!gm  IF( ln_dm2dc       )   CALL sbc_dcy( kt )                 ! Daily mean qsr distributed over the Diurnal Cycle
+      
+      SELECT CASE( nn_ice )                                     ! Update sbc over ice-covered areas
+      CASE(  1 )   ;         CALL sbc_ice_if ( kt )                  ! Ice-cover climatology ("Ice-if" model)
+         !                                                           ! (update heat and freshwater fluxes)
+      CASE(  2 )   ;         CALL sbc_ice_lim( kt, nsbc )            ! LIM ice model
+      END SELECT                                                     ! (update all fluxes using bulk + LIM)
+
+      IF( ln_ssr         )   CALL sbc_ssr( kt )                 ! add SST/SSS damping term
+
+      IF( ln_rnf         )   CALL sbc_rnf( kt )                 ! add runoffs to fresh water fluxes
+ 
+      IF( nn_fwb    /= 0 )   CALL sbc_fwb( kt, nn_fwb, nn_fsbc )         ! control the freshwater budget
+
+      IF( nclosea == 1 )   CALL sbc_clo( kt )                   ! treatment of closed sea in the model domain 
+      !                                                         ! (update freshwater fluxes)
+      !
+      IF(ln_ctl) THEN         ! print mean trends (used for debugging)
+         CALL prt_ctl(tab2d_1=emp    , clinfo1=' emp  - : ', mask1=tmask, ovlap=1)
+         CALL prt_ctl(tab2d_1=emps   , clinfo1=' emps - : ', mask1=tmask, ovlap=1)
+         CALL prt_ctl(tab2d_1=qns    , clinfo1=' qns  - : ', mask1=tmask, ovlap=1)
+         CALL prt_ctl(tab2d_1=qsr    , clinfo1=' qsr  - : ', mask1=tmask, ovlap=1)
+         CALL prt_ctl(tab3d_1=tmask  , clinfo1=' tmask  : ', mask1=tmask, ovlap=1, kdim=jpk)
+         CALL prt_ctl(tab3d_1=tn     , clinfo1=' sst  - : ', mask1=tmask, ovlap=1, kdim=1)
+         CALL prt_ctl(tab3d_1=sn     , clinfo1=' sss  - : ', mask1=tmask, ovlap=1, kdim=1)
+         CALL prt_ctl(tab2d_1=utau   , clinfo1=' utau - : ', tab2d_2=vtau, clinfo2=' vtau - : ', ovlap=1)
+      ENDIF
+
+!!gm
+!!    ENDIF
+!!gm
+      !
+   END SUBROUTINE sbc
+
+   !!======================================================================
+END MODULE sbcmod
Index: /trunk/NEMO/OPA_SRC/SBC/sbcrnf.F90
===================================================================
--- /trunk/NEMO/OPA_SRC/SBC/sbcrnf.F90	(revision 702)
+++ /trunk/NEMO/OPA_SRC/SBC/sbcrnf.F90	(revision 702)
@@ -0,0 +1,245 @@
+MODULE sbcrnf
+   !!======================================================================
+   !!                       ***  MODULE  sbcrnf  ***
+   !! Ocean forcing:  river runoff
+   !!=====================================================================
+   !! History :       !  00-11  (R. Hordoir, E. Durand)  NetCDF FORMAT
+   !!            8.5  !  02-09  (G. Madec)  F90: Free form and module
+   !!            9.0  !  06-07  (G. Madec)  Surface module 
+   !!----------------------------------------------------------------------
+
+   !!----------------------------------------------------------------------
+   !!   sbc_rnf      : monthly runoffs read in a NetCDF file
+   !!   rnf_mouth    : set river mouth mask
+   !!----------------------------------------------------------------------
+   USE dom_oce         ! ocean space and time domain
+   USE phycst          ! physical constants
+   USE dom_oce         ! ocean domain variables
+   USE sbc_oce         ! surface boundary condition variables
+   USE fldread         ! ???
+   USE in_out_manager  ! I/O manager
+   USE daymod          ! calendar
+   USE iom             ! I/O module
+
+   IMPLICIT NONE
+   PRIVATE
+
+   PUBLIC sbc_rnf          ! routine call in step module
+
+   !! * namsbc_rnf namelist
+   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]
+   CHARACTER(len=100), PUBLIC ::   cn_dir     = './'    !: Root directory for location of ssr files
+   TYPE(FLD_N)       , PUBLIC ::   sn_rnf               !: informations about the runoff file to be read
+   TYPE(FLD_N)       , PUBLIC ::   sn_cnf               !: informations about the runoff mouth file to be read
+   NAMELIST/namsbc_rnf/ nn_runoff, rn_hrnf, rn_avt_rnf, cn_dir, sn_rnf, sn_cnf
+
+   INTEGER , PUBLIC                     ::   nkrnf = 0   !: number of levels over which Kz is increased at river mouths
+   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   rnfmsk      !: river mouth mask (hori.)
+   REAL(wp), PUBLIC, DIMENSION(jpk)     ::   rnfmsk_z    !: river mouth mask (vert.)
+
+   TYPE(FLD), ALLOCATABLE, DIMENSION(:) ::   sf_rnf   ! structure of input SST (file informations, fields read)
+
+   !!----------------------------------------------------------------------
+   !!   OPA 9.0 , LOCEAN-IPSL (2006) 
+   !! $Header: $
+   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
+
+CONTAINS
+
+   SUBROUTINE sbc_rnf( kt )
+      !!----------------------------------------------------------------------
+      !!                  ***  ROUTINE sbc_rnf  ***
+      !!       
+      !! ** Purpose :   Introduce a climatological run off forcing
+      !!
+      !! ** Method  :   Set each river mouth with a monthly climatology 
+      !!                provided from different data.
+      !!                CAUTION : upward water flux, runoff forced to be < 0
+      !!
+      !! ** Action  :   runoff updated runoff field at time-step kt
+      !!----------------------------------------------------------------------
+      INTEGER, INTENT(in) ::   kt          ! ocean time step
+      !
+      INTEGER  ::   ji, jj   ! dummy loop indices
+      INTEGER  ::   ierror   ! temporary integer
+      !!----------------------------------------------------------------------
+      !                                                   !------------------!
+      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_rnf = 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( nn_runoff == 1 .OR. nn_runoff == 2 ) THEN       !   Update runoff   !
+         !                                                !-------------------!
+         !
+         CALL fld_read( kt, nn_fsbc, sf_rnf )   ! Read Runoffs data and provides it
+         !                                      ! at the current time-step
+
+         ! 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
+            DO jj = 1, jpj
+               DO ji = 1, jpi
+                  IF( gphit(ji,jj) > 40 .AND. gphit(ji,jj) < 65 )   sf_rnf(1)%fnow(ji,jj) = 0.85 * sf_rnf(1)%fnow(ji,jj)
+               END DO
+            END DO
+         ENDIF
+
+         ! C a u t i o n : runoff is negative and in kg/m2/s 
+
+         emp (:,:) = emp (:,:) - ABS( sf_rnf(1)%fnow(:,:) )
+         emps(:,:) = emps(:,:) - ABS( sf_rnf(1)%fnow(:,:) )
+         !
+      ENDIF
+      !
+   END SUBROUTINE sbc_rnf
+
+
+   SUBROUTINE rnf_mouth
+      !!----------------------------------------------------------------------
+      !!                  ***  ROUTINE rnf_mouth  ***
+      !!       
+      !! ** Purpose :   define the river mouths mask
+      !!
+      !! ** Method  :   read the river mouth mask (=0/1) in the river runoff
+      !!                climatological file. Defined a given vertical structure. 
+      !!                CAUTION, the vertical structure is hard coded on the 
+      !!                first 5 levels.
+      !!                This fields can be used to:
+      !!                 - set an upstream advection scheme  
+      !!                   (nn_runoff=2 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)
+      !!                 - set to zero SSS restoring flux at river mouth grid points
+      !!
+      !! ** Action  :   rnfmsk   set to 1 at river runoff input, 0 elsewhere
+      !!                rnfmsk_z vertical structure
+      !!----------------------------------------------------------------------
+      USE closea, ONLY :    nclosea, clo_rnf   ! closed sea flag, rnfmsk update routine
+      !
+      INTEGER           ::   inum        ! temporary integers
+      CHARACTER(len=32) ::   cl_rnfile   ! runoff file name
+      !!----------------------------------------------------------------------
+      ! 
+      IF(lwp) WRITE(numout,*)
+      IF(lwp) WRITE(numout,*) 'rnf_mouth : river mouth mask'
+      IF(lwp) WRITE(numout,*) '~~~~~~~~~ '
+
+      WRITE(cl_rnfile, '(a,a)')   TRIM( cn_dir ), TRIM( sn_cnf%clname )
+      SELECT CASE( sn_cnf%nclim )
+      CASE( 0 )
+         WRITE(cl_rnfile, '(a,a,"_",i4,".nc")' ) TRIM( cn_dir ), TRIM( sn_cnf%clname ), nyear
+      CASE( 1 )
+         WRITE(cl_rnfile, '(a,a,  "_0000.nc")' ) TRIM( cn_dir ), TRIM( sn_cnf%clname )
+      END SELECT
+
+      ! horizontal mask (read in NetCDF file)
+      CALL iom_open ( cl_rnfile, inum )                           ! open file
+      CALL iom_get  ( inum, jpdom_data, sn_cnf%clvar, rnfmsk )    ! read the river mouth array
+      CALL iom_close( inum )                                      ! close file
+      
+      IF( nclosea == 1 )    CALL clo_rnf( rnfmsk )                ! closed sea inflow set as ruver mouth
+
+      rnfmsk_z(:)   = 0.e0                                        ! vertical structure 
+      rnfmsk_z(1)   = 1.0
+      rnfmsk_z(2)   = 1.0                                         ! **********
+      rnfmsk_z(3)   = 0.5                                         ! HARD CODED on the 5 first levels
+      rnfmsk_z(4)   = 0.25                                        ! **********
+      rnfmsk_z(5)   = 0.125
+      !         
+   END SUBROUTINE rnf_mouth
+   
+   !!======================================================================
+END MODULE sbcrnf
Index: /trunk/NEMO/OPA_SRC/SBC/sbcrnf_ORCA_R05.h90
===================================================================
--- /trunk/NEMO/OPA_SRC/SBC/sbcrnf_ORCA_R05.h90	(revision 702)
+++ /trunk/NEMO/OPA_SRC/SBC/sbcrnf_ORCA_R05.h90	(revision 702)
@@ -0,0 +1,1537 @@
+   !!----------------------------------------------------------------------
+   !!                  *** flxrnf_ORCA_R05.h90  ***
+   !!----------------------------------------------------------------------
+   !!   flx_rnf      : update ocean runoffs for ORCA_R05 configuration
+   !!----------------------------------------------------------------------
+   !! * Modules used
+   USE dom_oce         ! ocean space and time domain
+   USE phycst          ! physical constants
+   USE in_out_manager  ! I/O manager
+   USE daymod          ! calendar
+
+   IMPLICIT NONE
+   PRIVATE
+
+   !! * Routine accessibility
+   PUBLIC flx_rnf         ! routine call by step.F90
+
+   !! * Shared module variables
+   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   &  !:
+      runoff,            &  !: monthly runoff (kg/m2/s)
+      upsadv,            &  !: mixed adv scheme in straits vicinity (hori.)
+      upsrnfh               !: mixed adv scheme in runoffs vicinity (hori.)
+   REAL(wp), PUBLIC, DIMENSION(jpk) ::   &  !:
+      upsrnfz               !: mixed adv scheme in runoffs vicinity (vert.)
+   INTEGER , PUBLIC ::   &  !:
+      nrunoff =  0          !: runoff option (namelist)
+
+   !! * Module variable
+   REAL(wp), DIMENSION(jpi,jpj,2) ::   &  !:
+      rnfdta                !: monthly runoff data array (kg/m2/s)
+   INTEGER    ::         &  !:
+      nrnf1, nrnf2          !: first and second record used
+   !!----------------------------------------------------------------------
+   !!   OPA 9.0 , LOCEAN-IPSL (2005) 
+   !! $Header: /home/opalod/NEMOCVSROOT/NEMO/OPA_SRC/SBC/flxrnf_ORCA_R05.h90,v 1.4 2006/05/11 14:53:31 opalod Exp $ 
+   !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt 
+   !!----------------------------------------------------------------------
+
+CONTAINS
+
+   SUBROUTINE flx_rnf( kt )
+      !!----------------------------------------------------------------------
+      !!                  ***  ROUTINE flx_rnf  ***
+      !!       
+      !! ** Purpose :   Introduce a climatological run off forcing
+      !!
+      !! ** Method  :   ORCA R05 configuration
+      !!      Initialze each mouth of river with a monthly climatology 
+      !!      provided from different data.
+      !!     C a u t i o n : upward water flux, runoff is negative
+      !!                     set at the last loop of the routine
+      !!
+      !! ** Action :
+      !!
+      !! References : 
+      !!       J. D. Milliman and R. H. Meade, 1983 : world-wide delivery
+      !!          of river sediment to the oceans, journal of geology vol 91
+      !!          pp 1-21.
+      !!       G. L. Russell and J. R. Miller, 1990 : global river runoff
+      !!          calculated from a global atmospheric general circulation
+      !!          model, journal of hydrology, 117(1990), pp 241-254.
+      !!       F. Van Der Leeden, Troise F. L., Todd D. K. : the water
+      !!          encyclopedia, second edition, lewis publishers.
+      !!       J. W. Weatherly, J. E. Walsh : The effects of precipitation
+      !!          and river runoff in a coupled ice-ocean model of Arctic
+      !!          Climate dynamics 1996 12:785,798
+      !!       Jacobs et al. 1992. J. Glaciol. 38 (130) 375-387.
+      !!
+      !! History :
+      !!        !  94-10  (G.Madec, M. Pontaud, M. Imbard)  Original code
+      !!        !  97-03  (G.Madec)  time dependent version
+      !!        !  98-06  (J.M. Molines)  exact computation of zxy 
+      !!                         for months that are not 30 days
+      !!        !  98-07  (M. Imbard)  ORCA and mpp option
+      !!        !  99-08  (J.P. Boulanger H.L.Ayina)  New rivers and 
+      !!                         values given in m3/s 
+      !!        !  00-04  (G. Madec, K. Roberts) add antarctica ice discharge.
+      !!        !  00-11  (R. Hordoir, E. Durand)  NetCDF FORMAT
+      !!   8.5  !  02-09  (G. Madec)  F90: Free form and module
+      !!----------------------------------------------------------------------
+      !! * Modules used
+
+      !! * arguments
+      INTEGER, INTENT( in  ) ::   kt ! ocean time step
+
+#if defined key_coupled
+      runoff(:,:) = 0.0e0
+#else
+      !!----------------------------------------------------------------------
+      !!  ORCA_R05
+      !!----------------------------------------------------------------------
+      !! * Local declarations
+      INTEGER, PARAMETER ::   &
+         jpmois=12,   &  ! number of month in the year !
+         jpriv=200,   &  ! maximum number of rivers
+         jpcoef=20       ! maximum number of gridpoints for mouth rivers
+
+      INTEGER  ::   ji, jj, jl, jm, jn, jr, jc
+      INTEGER  ::   i15, imois, iman
+      INTEGER  ::   inbp, idbd, idmeom
+      INTEGER  ::   iirnf(jpcoef,jpriv),ijrnf(jpcoef,jpriv)
+      INTEGER  ::   inb(jpriv)
+
+      REAL(wp) ::   zconv, zxy
+      REAL(wp) ::   zrup1,zrup2,zrup3
+      REAL(wp) ::   zrnfm(jpmois, jpriv)
+      REAL(wp) ::   zcoefr(jpi, jpj, 5)
+      !!----------------------------------------------------------------------
+      !!  OPA 8.5, LODYC-IPSL (2002)
+      !!----------------------------------------------------------------------
+      ! ====
+      ! DATA
+      ! ====
+
+      ! I NORTH AMERICA
+      ! ---------------
+
+      ! 1-Saint Lawrence (Canada) 49N30 67W00               R2
+      ! Old=447 km3/year=14165m3/s; CLIPPER=12430m3/s; ratio=1.14
+      ! --> 13975.249m3/s
+      DATA inb(1)/3/
+      DATA (iirnf(jc,1),jc=1,jpcoef)/ 444, 444, 444, 17*0 /
+      DATA (ijrnf(jc,1),jc=1,jpcoef)/ 367, 368, 369, 17*0 /
+      DATA (zrnfm(jm,1),jm=1,jpmois)/   &
+          11718.,  11971.,  12466.,  14980.,  19257.,  16913.,   &
+          14211.,  13119.,  13367.,  13644.,  13463.,  12594./
+      ! 2-Hudson River (USA) 41N00 77W00                    R1
+      ! Old=12 km3/year=380m3/s; UNESCO(64-83,p255)=408m3/s
+      ! --> 407.416687m3/s
+      DATA inb(2)/1/
+      DATA (iirnf(jc,2),jc=1,jpcoef)/ 426, 19*0 /
+      DATA (ijrnf(jc,2),jc=1,jpcoef)/ 336, 19*0 /
+      DATA (zrnfm(jm,2),jm=1,jpmois)/   &
+          364.,    404.,    648.,    873.,    593.,    301.,   &
+          205.,    171.,    205.,    290.,    379.,    456./
+      ! 3-Missisipi and Atchafalaya (USA) 29N 90W           R1 
+      ! Old=580 km3/year=18380m3/s; CLIPPER=17599m3/s
+      ! --> 17599.334m3/s
+      DATA inb(3)/2/
+      DATA (iirnf(jc,3),jc=1,jpcoef)/ 397, 398, 18*0 /
+      DATA (ijrnf(jc,3),jc=1,jpcoef)/ 312, 313, 18*0 /
+      DATA (zrnfm(jm,3),jm=1,jpmois)/   &
+          19260.,  20813.,  23026.,  28160.,  26510.,  19650.,   &
+          14181.,  10676.,   9578.,  10167.,  11699.,  17472./
+      ! 4-Brazos (USA) 29N58 95W53                          R1
+      ! Old=7 km3/year=222m3/s; UNESCO(65-84, p298)=200m3/s
+      ! --> 199.666656m3/s
+      DATA inb(4)/1/
+      DATA (iirnf(jc,4),jc=1,jpcoef)/ 386, 19*0 /
+      DATA (ijrnf(jc,4),jc=1,jpcoef)/ 311, 19*0 /
+      DATA (zrnfm(jm,4),jm=1,jpmois)/   &
+          165.,    224.,    200.,    266.,    457.,    327.,   &
+          143.,     69.,    102.,    132.,    160.,    151./
+      ! 5-Colorado (Mexico) 31N54 114W57                    R5
+      ! Old=20 km3/year=634m3/s
+      ! --> 634.m3/s
+      DATA inb(5)/2/
+      DATA (iirnf(jc,5),jc=1,jpcoef)/ 347, 348, 18*0 /
+      DATA (ijrnf(jc,5),jc=1,jpcoef)/ 316, 316, 18*0 /
+      DATA (zrnfm(jm,5),jm=1,jpmois)/12*634./ 
+      ! 6-Columbia (USA) 45N60 121W17                       R1
+      ! Old=251 km3/year=7954m3/s; UNESCO(65-84, p312)=5368m3/s
+      ! --> 5368.41602m3/s
+      DATA inb(6)/2/
+      DATA (iirnf(jc,6),jc=1,jpcoef)/ 326, 326, 18*0 /
+      DATA (ijrnf(jc,6),jc=1,jpcoef)/ 360, 361, 18*0 /
+      DATA (zrnfm(jm,6),jm=1,jpmois)/   &
+          4752.,    5077.,    5633.,    6075.,    8422.,    9822.,   &
+          6350.,    4112.,    3273.,    3251.,    3548.,    4106./ 
+      ! 7-Fraser (USA)                                      R5
+      ! Old=112 km3/year=3550m3/s;not found in UNESCO
+      ! --> 3549.99976m3/s
+      DATA inb(7)/2/
+      DATA (iirnf(jc,7),jc=1,jpcoef)/ 317, 317, 18*0 /
+      DATA (ijrnf(jc,7),jc=1,jpcoef)/ 378, 379, 18*0 /
+      DATA (zrnfm(jm,7),jm=1,jpmois)/12*3550./ 
+      ! 8-Yukon (USA) 63N00 165W00                          R3
+      ! Old=195 km3/year=6179m3/s; UNESCO(65-77+80-84, p321)=4245; ratio=1.46
+      ! --> 6017.24951m3/s
+      DATA inb(8)/2/
+      DATA (iirnf(jc,8),jc=1,jpcoef)/ 244, 244, 18*0 /
+      DATA (ijrnf(jc,8),jc=1,jpcoef)/ 413, 414, 18*0 /
+      DATA (zrnfm(jm,8),jm=1,jpmois)/   &
+           1459.,    1213.,    1065.,    1100.,    9067.,   17675.,   &
+          10680.,   11271.,    8658.,    5453.,    2649.,    1917./ 
+      ! 9-Copper (USA) 61N47 144W45                         R2
+      ! Old=39 km3/year=1236m3/s; UNESCO(65-84, p317)=1052m3/s; ratio=1.18
+      ! --> 1236.25m3/s
+      DATA inb(9)/1/
+      DATA (iirnf(jc,9),jc=1,jpcoef)/ 274, 19*0 /
+      DATA (ijrnf(jc,9),jc=1,jpcoef)/ 409, 19*0 /
+      DATA (zrnfm(jm,9),jm=1,jpmois)/   &
+           219.,    195.,    181.,    214.,    904.,   2532.,   &
+          4026.,   3627.,   1632.,    697.,    354.,    254./ 
+      ! 10-Susitna (USA)                                    R5
+      ! Old=40 km3/year=1268m3/s
+      ! --> 1268.m3/s
+      DATA inb(10)/2/
+      DATA (iirnf(jc,10),jc=1,jpcoef)/ 263, 264, 18*0 /
+      DATA (ijrnf(jc,10),jc=1,jpcoef)/ 405, 405, 18*0 /
+      DATA (zrnfm(jm,10),jm=1,jpmois)/12*1268./ 
+      ! 11-McKenzie (Canada) 70N00 135W00                   R3
+      ! Old=306 km3/year=9697m3/s; UNESCO(67+72+7479+82-84, p168)=8343m3/s;
+      ! ratio=1.16
+      ! --> 9606.66797m3/s
+      DATA inb(11)/3/
+      DATA (iirnf(jc,11),jc=1,jpcoef)/ 272, 272, 272, 17*0 /
+      DATA (ijrnf(jc,11),jc=1,jpcoef)/ 451, 452, 453, 17*0 /
+      DATA (zrnfm(jm,11),jm=1,jpmois)/   &
+           3644.,    3400.,    3258.,    3546.,   14188.,   21544.,   &
+          18954.,   15487.,   11284.,   10169.,    5901.,    3905./
+      ! 12-Kuksokwim (USA) 60N00 ~162W30                    R4
+      ! UNESCO(65-84, p318)=1112m3/s (61N87 158E10, Crooked Creek, inland)
+      ! --> 1111.99988m3/s
+      DATA inb(12)/2/
+      DATA (iirnf(jc,12),jc=1,jpcoef)/ 244, 244, 18*0 /
+      DATA (ijrnf(jc,12),jc=1,jpcoef)/ 413, 414, 18*0 /
+      DATA (zrnfm(jm,12),jm=1,jpmois)/   &
+          335.,     308.,     295.,     407.,    2415.,    2027.,   &
+          1917.,   2049.,    1585.,    1072.,     545.,     389./     
+
+      DATA inb(13)/0/
+      DATA inb(14)/0/
+      DATA inb(15)/0/
+
+      ! Total run-offs(I)=60974.2539m3/s
+
+      ! II SOUTH AMERICA
+      ! -----------------
+      ! 16-Chira (Peru) 4s54 81w08                          R2
+      ! Old=5 km3/year=158m3/s; UNESCO (65-68, p357)=80.9; ratio=1.95
+      ! --> 158.000015m3/s
+      DATA inb(16)/1/
+      DATA (iirnf(jc,16),jc=1,jpcoef)/ 414, 19*0 /
+      DATA (ijrnf(jc,16),jc=1,jpcoef)/ 244, 19*0 /
+      DATA (zrnfm(jm,16),jm=1,jpmois)/   &
+          70.,     105.,     564.,     582.,     230.,      94.,   &
+          87.,      47.,      35.,      32.,      29.,      21./
+      ! 17-Magdalena (Colombia) 11N06 74W51                 R2
+      ! Old=237 km3/year=7510m3/s; UNESCO(71-73+76-79, p348)=6973m3/s;
+      ! ratio=1.08
+      ! --> 7451.58301m3/s
+      DATA inb(17)/2/
+      DATA (iirnf(jc,17),jc=1,jpcoef)/ 424, 424, 18*0 /
+      DATA (ijrnf(jc,17),jc=1,jpcoef)/ 270, 271, 18*0 /
+      DATA (zrnfm(jm,17),jm=1,jpmois)/   &
+          6598.,    4441.,    4087.,    5445.,    7380.,    8067.,   &
+          8509.,    7428.,    7631.,    9296.,   10588.,    9949./
+      ! 18-Orinoco (Venezuela) 8N37 62W15!                  R1
+      ! Old=1100 km3/year=34857m3/s; UNESCO(73-75, p364)=28736m3/s;
+      ! HLA=26371m3/s
+      ! Data from HLA: 8.1N - 63.3W   1925/89
+      ! --> 26371.416
+      DATA inb(18)/5/
+      DATA (iirnf(jc,18),jc=1,jpcoef)/ 451, 451, 452, 452, 452, 15*0 /
+      DATA (ijrnf(jc,18),jc=1,jpcoef)/ 271, 272, 271, 272, 272, 15*0 /
+      DATA (zrnfm(jm,18),jm=1,jpmois)/   &
+          10670.,    7513.,    6344.,    6887.,   13086.,   26699.,   &
+          43938.,   59957.,   57435.,   39951.,   27410.,   16567./ 
+      ! 19-Amazon (Brazil) 0S05 50W00                       R1
+      ! Old=6300 km3/year=199634m3/s; CLIPPER=166192m3/s~UNESCO;
+      ! HLA=184806m3/s
+      ! UNESCO data are at Obidos which is far inland and therefore does not
+      ! fully represent the actual discharge
+      ! Data from HLA: 1.5N - 55.3W   1970/96
+      ! --> 184845.484m3/s
+      DATA inb(19)/14/
+      DATA (iirnf(jc,19),jc=1,jpcoef)/ 475, 476, 476, 476, 476,  &
+                                       477, 477, 477, 477, 477,  &
+                                       478, 478, 478, 478, 6*0 /
+      DATA (ijrnf(jc,19),jc=1,jpcoef)/ 254, 251, 252, 253, 254,  &
+                                       250, 251, 252, 253, 254,  &
+                                       250, 251, 252, 253, 6*0 /
+      DATA (zrnfm(jm,19),jm=1,jpmois)/   &
+          152233., 176415., 199941., 225565., 244016., 244861.,   &
+          230711., 203128., 164531., 128486., 118214., 130045. /
+      ! 20-Sao Francisco (Brazil) 10S30 36W24               R1
+      ! Old=97 km3/year=3074m3/s; UNESCO(77-79, p338)=2645m3/s
+      ! --> 2645.3335m3/s
+      DATA inb(20)/1/
+      DATA (iirnf(jc,20),jc=1,jpcoef)/ 498, 19*0 /
+      DATA (ijrnf(jc,20),jc=1,jpcoef)/ 223, 19*0 /
+      DATA (zrnfm(jm,20),jm=1,jpmois)/   &
+          3244.,   4116.,   5139.,   4330.,   2323.,   1800.,     &
+          1587.,   1511.,   1593.,   1740.,   2190.,   2171. /
+      ! 21-Parana+Uruguay(Arg./Uru.) 34S12 58W18            R1 
+      ! Old=470 km3/year=14893m3/s; UNESCO(p323/324)=22263m3/s
+      ! --> 22203.168m3/s 
+      DATA inb(21)/5/
+      DATA (iirnf(jc,21),jc=1,jpcoef)/ 462, 462, 462, 462, 463, 15*0 /
+      DATA (ijrnf(jc,21),jc=1,jpcoef)/ 172, 173, 174, 175, 175, 15*0 /
+      DATA (zrnfm(jm,21),jm=1,jpmois)/   &
+          24803.,   26836.,   24585.,   21358.,   20041.,   21689.,   &
+          22647.,   20403.,   19627.,   21400.,   21126.,   21923./
+      ! 22-Negro (Argentina)  41S02  62W47                  R2
+      ! Old=30 km3/year=951m3/s; UNESCO(65-79,p330)=765m3/s; ratio=1.24
+      ! --> 907.666687m3/s
+      DATA inb(22)/2/
+      DATA (iirnf(jc,22),jc=1,jpcoef)/ 446, 447, 18*0 /
+      DATA (ijrnf(jc,22),jc=1,jpcoef)/ 160, 160, 18*0 /
+      DATA (zrnfm(jm,22),jm=1,jpmois)/   &
+          882.,     587.,     519.,     482.,     623.,     984.,   &
+          1120.,   1294.,    1092.,    1166.,    1105.,    1038./
+      ! 23- Tocantins :  ~48W00 ~0.5S                       R4
+      ! UNESCO(76-77+80-81, p335)=12167m3/s (station far inland!)
+      ! --> 12173.082m3/s
+      DATA inb(23)/4/
+      DATA (iirnf(jc,23),jc=1,jpcoef)/ 479, 480, 481, 482, 16*0 /
+      DATA (ijrnf(jc,23),jc=1,jpcoef)/ 249, 249, 249, 249, 16*0 /
+      DATA (zrnfm(jm,23),jm=1,jpmois)/   &
+          15507.,  24855.,  27854.,  24257.,  15860.,   7861.,   &
+          4440.,   3082.,   2728.,   3417.,   5511.,  10705. /
+
+      DATA inb(24)/0/
+      DATA inb(25)/0/
+
+      ! Total run-offs(II)=256755.75
+      ! Total run-offs(I+II)=317730
+
+      ! III EUROPE
+      ! ----------
+      ! 26-Rhone (France) 43N20 4E50                        R1 
+      ! Old=49 km3/year=1553m3/s; UNESCO(65-83, p512)=1229
+      ! --> 1217.16663m3/s
+      DATA inb(26)/1/
+      DATA (iirnf(jc,26),jc=1,jpcoef)/ 584, 19*0 /
+      DATA (ijrnf(jc,26),jc=1,jpcoef)/ 347, 19*0 /
+      DATA (zrnfm(jm,26),jm=1,jpmois)/   &
+          1385.,    1848.,    1568.,    1311.,    1420.,    1191.,   &
+           937.,     796.,     794.,     962.,    1161.,    1233./
+      ! 27-Po (Italy) 11N10 1W09                            R1 
+      ! Old=46 km3/year=1458m3/s; UNESCO(65-84, p527)=1550m3/s
+      ! --> 1550.08337m3/s
+      DATA inb(27)/1/
+      DATA (iirnf(jc,27),jc=1,jpcoef)/ 599, 19*0 /
+      DATA (ijrnf(jc,27),jc=1,jpcoef)/ 355, 19*0 /
+      DATA (zrnfm(jm,27),jm=1,jpmois)/   &
+          1304.,    1605.,    1856.,    1549.,    1958.,    1760.,   &
+          1040.,    1007.,    1615.,    1907.,    1772.,    1228./
+      ! 28-Danube (Roumania) 45N20 29E40                    R1 
+      ! Old=206 km3/year=6527m3/s; UNESCO(65-84, p544)=7011m3/s
+      ! --> 7011.8335m3/s
+      DATA inb(28)/2/
+      DATA (iirnf(jc,28),jc=1,jpcoef)/ 632, 632, 18*0 /
+      DATA (ijrnf(jc,28),jc=1,jpcoef)/ 356, 357, 18*0 /
+      DATA (zrnfm(jm,28),jm=1,jpmois)/   &
+          6625.,    7352.,    7986.,    9279.,    9482.,    8618.,   &
+          7586.,    6001.,    5210.,    4989.,    4921.,    6093./
+
+      DATA inb(29)/0/
+      DATA inb(30)/0/
+
+      ! Total run-offs(III)=9779.08301m3/s
+      ! Total run-offs(I+II+III)=327509.094m3/s
+      
+      ! IV EURASIAN ARCTIC
+      ! ------------------
+      ! 31-Iana (Russia)                                    R1
+      ! Old=29 km3/year=919m3/s; UNESCO(65-72+74+76-84, p463)=936m3/s
+      ! --> 0m3/s
+      DATA inb(31)/0/
+      DATA (iirnf(jc,31),jc=1,jpcoef)/ 20*0 /
+      DATA (ijrnf(jc,31),jc=1,jpcoef)/ 20*0 /
+      DATA (zrnfm(jm,31),jm=1,jpmois)/   &
+             2.,       1.,       0.,       0.,     917.,    3514.,   &
+          2968.,    2329.,    1322.,     178.,      36.,       8./ 
+      ! 32-Ob (Russia) 66N45 69E30                          R1 
+      ! Old=385 km3/year=12200m3/s; UNESCO(65-84, p478)=12862m3/s
+      ! --> 12861.5m3/s
+      DATA inb(32)/8/
+      DATA (iirnf(jc,32),jc=1,jpcoef)/ 635, 635, 636, 636, 636,637, 637,637,12*0 /
+      DATA (ijrnf(jc,32),jc=1,jpcoef)/ 508, 509, 509, 508, 507,509, 508,507,12*0 /
+     DATA (zrnfm(jm,32),jm=1,jpmois)/12*0./
+!CT bug     DATA (zrnfm(jm,32),jm=1,jpmois)/   &
+!CT bug          4977.,    4150.,    3611.,    3590.,   14723.,   33366.,   &
+!CT bug         30773.,   22785.,   14701.,    9705.,    6078.,    5879./
+      ! 33-Yenesei (Russia) 71N50 82E40                     R1 
+      ! Old=560 km3/year=17745m3/s; UNESCO(65-84, p472)=17462m3/s
+      ! --> 17461.666m3/s
+      DATA inb(33)/9/
+      DATA (iirnf(jc,33),jc=1,jpcoef)/ 114,115,115,116, 117,117,117,118,118,11*0 /
+      DATA (ijrnf(jc,33),jc=1,jpcoef)/ 504,504,503,503, 501,502,503,502,501,11*0 /
+      DATA (zrnfm(jm,33),jm=1,jpmois)/   &
+           6659.,    7007.,    6895.,    7089.,   24183.,   74965.,   &
+          25325.,   15940.,   16050.,   12678.,    6741.,    6008./
+      ! 34-Severnaya Dvina(Russia)64N32 40E30               R5 
+      ! Old=106 km3/year=3359m3/s; not in UNESCO data base
+      ! --> 3359.00024m3/s
+      DATA inb(34)/2/
+      DATA (iirnf(jc,34),jc=1,jpcoef)/ 620, 620, 18*0 /
+      DATA (ijrnf(jc,34),jc=1,jpcoef)/ 448, 449, 18*0 /
+      DATA (zrnfm(jm,34),jm=1,jpmois)/12*3359./
+      ! 35-Lena (Russia) 72N25 126E40                       R1 
+      ! --> 16192.333m3/s
+      DATA inb(35)/9/
+      DATA (iirnf(jc,35),jc=1,jpcoef)/ 142,143,148,148,149,149,150,150,150,11*0 /
+      DATA (ijrnf(jc,35),jc=1,jpcoef)/ 458,458,456,448,449,448,451,450,449,11*0 /
+      DATA (zrnfm(jm,35),jm=1,jpmois)/   &
+           2663.,    2095.,    1629.,    1324.,    7203.,   64230.,   &
+          40810.,   28310.,   25995.,   13299.,    3673.,    3077./
+      ! 36-Kolyma (Russia) 69N30 161E00                     R1
+      ! Old=71 km3/year=2250m3/s; UNESCO(65-84)=2138m3/s
+      ! --> 2138.66675m3/s
+      DATA inb(36)/2/
+      DATA (iirnf(jc,36),jc=1,jpcoef)/ 184, 185, 18*0 /
+      DATA (ijrnf(jc,36),jc=1,jpcoef)/ 429, 429, 18*0 /
+      DATA (zrnfm(jm,36),jm=1,jpmois)/   &
+           131.,      92.,      76.,      65.,    2576.,    9143.,   &
+          4670.,    3727.,    3226.,    1119.,     630.,     209./
+      ! 37-Indigirka (russia) 70N48 148E54                  R1 
+      ! Old=55 km3/year=1743m3/s; UNESCO(65-68+70+72-84)=1622.
+      ! --> 1622.00012m3/s
+      DATA inb(37)/1/
+      DATA (iirnf(jc,37),jc=1,jpcoef)/ 172, 19*0 /
+      DATA (ijrnf(jc,37),jc=1,jpcoef)/ 438, 19*0 /
+      DATA (zrnfm(jm,37),jm=1,jpmois)/   &
+            32.,      17.,      11.,       7.,     354.,    5629.,   &
+          5210.,    4617.,    2823.,     559.,     142.,      63./
+
+      DATA inb(38)/0/
+      DATA inb(39)/0/
+      DATA inb(40)/0/
+
+      ! Total run-offs(IV)=40773.6641m3/s
+      ! Total run-offs(I+II+III+IV)=368282.75m3/s
+
+      ! V ASIA
+      ! ------
+      ! 41-Amur (Russia) 52N56 141E10                       R2
+      ! Old=325 km3/year=10299m3/s; UNESCO(65-84, p451)=8792m3/s; ratio=1.17
+      ! --> 10299.332m3/s
+      DATA inb(41)/2/
+      DATA (iirnf(jc,41),jc=1,jpcoef)/ 141, 141, 18*0 /
+      DATA (ijrnf(jc,41),jc=1,jpcoef)/ 381, 382, 18*0 /
+      DATA (zrnfm(jm,41),jm=1,jpmois)/   &
+           2108.,    1543.,    1252.,    4088.,   15464.,   17336.,   &
+          16100.,   20801.,   21548.,   15658.,    5188.,    2506./
+      ! 42-Liaohe (China) 40N40 122E09                      R5
+      ! Old=6 km3/year=190m3/s; not found in UNESCO data base
+      ! --> 189.999985m3/s
+      DATA inb(42)/1/
+      DATA (iirnf(jc,42),jc=1,jpcoef)/ 100, 19*0 /
+      DATA (ijrnf(jc,42),jc=1,jpcoef)/ 342, 19*0 /
+      DATA (zrnfm(jm,42),jm=1,jpmois)/12*190./
+      ! 43-Daling (China) 40N56 121E43                      R5
+      ! Old=1 km3/year=32m3/s; not found in UNESCO data base
+      ! --> 31.9999962m3/s
+      DATA inb(43)/2/
+      DATA (iirnf(jc,43),jc=1,jpcoef)/  99, 100, 18*0 /
+      DATA (ijrnf(jc,43),jc=1,jpcoef)/ 342, 342, 18*0 /
+      DATA (zrnfm(jm,43),jm=1,jpmois)/12*32./
+      ! 44-Haiho (China) 6N17   1E23
+      ! Old=2 km3/year=64m3/s; not found in UNESCO data base
+      ! --> 63.9999924m3/s
+      DATA inb(44)/1/
+      DATA (iirnf(jc,44),jc=1,jpcoef)/ 121, 19*0 /
+      DATA (ijrnf(jc,44),jc=1,jpcoef)/ 348, 19*0 /
+      DATA (zrnfm(jm,44),jm=1,jpmois)/12*64./
+      ! 45-Yellow/Huangho (China) 37N32 118E19              R2 
+      ! Old=49 km3/year=1553m3/s; UNESCO(p371)=1210m3/s; ratio=1.28
+      ! --> 1552.5m3/s
+      DATA inb(45)/3/
+      DATA (iirnf(jc,45),jc=1,jpcoef)/  92,  92,  92, 17*0 /
+      DATA (ijrnf(jc,45),jc=1,jpcoef)/ 336, 337, 338, 17*0 /
+      DATA (zrnfm(jm,45),jm=1,jpmois)/   &
+           697.,     674.,    1282.,    1206.,    1109.,     778.,   &
+          1964.,    3270.,    3668.,    2133.,     978.,     871./
+      ! 46-Yangtze (China) 31N48 121E10=Changjiang          R2
+      ! Old=900 km3/year=28520m3/s; UNESCO(p372)=25032m3/s; ratio=1.14
+      ! --> 28519.584m3/s
+      DATA inb(46)/2/
+      DATA (iirnf(jc,46),jc=1,jpcoef)/ 100, 100, 18*0 /
+      DATA (ijrnf(jc,46),jc=1,jpcoef)/ 316, 317, 18*0 /
+      DATA (zrnfm(jm,46),jm=1,jpmois)/   &
+          10994.,   10548.,   13254.,   24097.,   36972.,   47197.,   &
+          53891.,   42070.,   37627.,   30762.,   22046.,   12777./
+      ! 47-Pearl/Zhujiang (China) 23N36 106E34=Xijiang      R2 
+      ! Old=302 km3/year=9570m3/s; UNESCO(76,82, p373)=6987m3/s; ratio=1.37
+      ! --> 9570.75m3/s
+      DATA inb(47)/2/
+      DATA (iirnf(jc,47),jc=1,jpcoef)/  72,  73, 18*0 /
+      DATA (ijrnf(jc,47),jc=1,jpcoef)/ 294, 294, 18*0 /
+      DATA (zrnfm(jm,47),jm=1,jpmois)/   &
+           2357.,    2415.,    2634.,    6446.,   14246.,   18395.,   &
+          19213.,   17558.,   12312.,    7255.,    5864.,    6154./
+      ! 48-Red/Hungho (Vietnam) 20N17 106E34                R5 
+      ! Old=123 km3/year=3897m3/s; not in UNESCO data base
+      ! --> 3897.m3/s
+      DATA inb(48)/3/
+      DATA (iirnf(jc,48),jc=1,jpcoef)/  68,  68,  68, 17*0 /
+      DATA (ijrnf(jc,48),jc=1,jpcoef)/ 288, 289, 290, 17*0 /
+      DATA (zrnfm(jm,48),jm=1,jpmois)/12*3897./
+      ! 49-Mekong (Vietnam) 10N33 105E24                    R5
+      ! Old=470 km3/year=14893m3/s; not in UNESCO data base
+      ! --> 14893.0029m3/s
+      DATA inb(49)/3/
+      DATA (iirnf(jc,49),jc=1,jpcoef)/  69,  69,  70, 17*0 /
+      DATA (ijrnf(jc,49),jc=1,jpcoef)/ 269, 270, 270, 17*0 /
+      DATA (zrnfm(jm,49),jm=1,jpmois)/12*14893./
+
+      DATA inb(50)/0/
+      DATA inb(51)/0/
+      DATA inb(52)/0/
+
+      ! 53-Damodar (India)                                  R2
+      ! Old=10 km3/year=320m3/s; UNESCO(p386)=173m3/s; ratio=1.85
+      ! --> 432.916656m3/s
+      DATA inb(53)/1/
+      DATA (iirnf(jc,53),jc=1,jpcoef)/  30, 19*0 /
+      DATA (ijrnf(jc,53),jc=1,jpcoef)/ 294, 19*0 /
+      DATA (zrnfm(jm,53),jm=1,jpmois)/   &
+           51.,      37.,      42.,      49.,      85.,     296.,   &
+          896.,    1390.,    1591.,     542.,     172.,      44./   
+
+      DATA inb(54)/0/
+      DATA inb(55)/0/
+      DATA inb(56)/0/
+      DATA inb(57)/0/
+      DATA inb(58)/0/
+      DATA inb(59)/0/
+      DATA inb(60)/0/
+
+      ! Total run-offs (V)=128642.922m3/s
+      ! Total run-offs (I+II+III+IV+V)=496925.688m3/s
+
+      ! VI AFRICA
+      ! ----------
+      ! 61-Nile (Egypt) 30N10  31E06                        R1
+      ! Old=30 km3/year=951m3/s; UNESCO(73-84)=1251m3/s
+      ! --> 1251.33337m3/s
+      DATA inb(61)/3/
+      DATA (iirnf(jc,61),jc=1,jpcoef)/ 636, 636, 637, 17*0 /
+      DATA (ijrnf(jc,61),jc=1,jpcoef)/ 317, 318, 318, 17*0 /
+      DATA (zrnfm(jm,61),jm=1,jpmois)/   &
+          1239.,    1035.,    1126.,    1110.,    1170.,    1542.,   &
+          1742.,    1559.,    1191.,    1103.,    1075.,    1124./   
+      ! 62-Niger (Nigeria) 5N33   6E33                      R1
+      ! Old=192 km3/year=6084m3/s; HLA=5545m3/s;
+      ! Data from HLA: 4.5N -  6  E   1950/87
+      ! --> 5545.08301m3/s
+      DATA inb(62)/3/
+      DATA (iirnf(jc,62),jc=1,jpcoef)/ 591, 592, 593, 17*0 /
+      DATA (ijrnf(jc,62),jc=1,jpcoef)/ 258, 258, 258, 17*0 /
+      DATA (zrnfm(jm,62),jm=1,jpmois)/   &
+          2029.,    1804.,    1573.,    1418.,    1494.,    2561.,   &
+          5272.,    9629.,   14951.,   16227.,    6842.,    2741./   
+      ! 63-Zaire/Congo (Congo) 6S04  12E24                  R1      
+      ! Old=1250 km3/year=39610m3/s; UNESCO(65-83, p149)=41941m3/s; HLA
+      ! =39720m3/s
+      ! Data from HLA: 6S - 12  E   1902/96
+      ! --> 39719.5m3/s
+      DATA inb(63)/4/
+      DATA (iirnf(jc,63),jc=1,jpcoef)/ 599, 599, 600, 600, 16*0 /
+      DATA (ijrnf(jc,63),jc=1,jpcoef)/ 237, 238, 236, 237, 16*0 /
+      DATA (zrnfm(jm,63),jm=1,jpmois)/   &
+          47200.,   37692.,   34374.,   36603.,   37862.,   35588.,   &
+          30966.,   30774.,   35981.,   42825.,   51455.,   55314./  
+      ! 64-Orange (Sth Africa) 28S41 16E28                  R5
+      ! Old=11 km3/year=349m3/s
+      ! --> 349.000031m3/s
+      DATA inb(64)/2/
+      DATA (iirnf(jc,64),jc=1,jpcoef)/ 609, 609, 18*0 /
+      DATA (ijrnf(jc,64),jc=1,jpcoef)/ 188, 189, 18*0 /
+      DATA (zrnfm(jm,64),jm=1,jpmois)/12*349./
+      ! 65-Zambesi (Mozambique) 18S55 36E04                 R5
+      ! Old=223 km3/year=7066m3/s
+      ! --> 7066.00049m3/s
+      DATA inb(65)/3/
+      DATA (iirnf(jc,65),jc=1,jpcoef)/ 646, 646, 646, 17*0 /
+      DATA (ijrnf(jc,65),jc=1,jpcoef)/ 207, 208, 209, 17*0 /
+      DATA (zrnfm(jm,65),jm=1,jpmois)/12*7066./
+      ! 66-Limpopo (mozambique) 25S15 33E30                 R5
+      ! Old=5 km3/year=158m3/s
+      ! --> 158.m3/s
+      DATA inb(66)/2/
+      DATA (iirnf(jc,66),jc=1,jpcoef)/ 642, 642, 18*0 /
+      DATA (ijrnf(jc,66),jc=1,jpcoef)/ 196, 197, 18*0 /
+      DATA (zrnfm(jm,66),jm=1,jpmois)/12*158./
+      ! 67-Rufiji (tanzania) 8S00 39E20                     R5
+      ! Old=9 km3/year=285m3/s
+      ! --> 285.m3/s
+      DATA inb(67)/1/
+      DATA (iirnf(jc,67),jc=1,jpcoef)/ 655, 19*0 /
+      DATA (ijrnf(jc,67),jc=1,jpcoef)/ 235, 19*0 /
+      DATA (zrnfm(jm,67),jm=1,jpmois)/12*285./
+      ! Other rivers from the Gulf of Guinea
+      ! 68-Kouilou (Congo)  4.5S-11.5E (UNESCO=p51)         R1
+      ! Data from HLA:  4S - 11  E   1953/86 = 919m3/s
+      ! --> 924.25m3/s
+      DATA inb(68)/1/
+      DATA (iirnf(jc,68),jc=1,jpcoef)/ 599, 19*0 /
+      DATA (ijrnf(jc,68),jc=1,jpcoef)/ 240, 19*0 /
+      DATA (zrnfm(jm,68),jm=1,jpmois)/   &
+          1115.,    1166.,    1285.,    1462.,    1454.,     725.,   &
+           480.,     378.,     327.,     400.,    1018.,    1281./
+      ! 69-Nyanga (Gabon)  3S-10E (UNESCO=p66)              R1
+      ! Data from HLA: 2.8N - 10  E   1952/82 = 264m3/s
+      ! --> 264.166687m3/s
+      DATA inb(69)/1/
+      DATA (iirnf(jc,69),jc=1,jpcoef)/ 595, 19*0 /
+      DATA (ijrnf(jc,69),jc=1,jpcoef)/ 244, 19*0 /
+      DATA (zrnfm(jm,69),jm=1,jpmois)/   &
+          126.,      99.,     143.,     253.,     316.,     300.,   &
+          156.,      93.,     231.,     557.,     592.,     304./
+      ! 70-Ogoue (Gabon) 1S-9E (UNESCO, p69)                R1
+      ! Data from HLA: .75S -  9  E   1930/90 = 4512m3/s
+      ! --> 4511.83301m3/s
+      DATA inb(70)/2/
+      DATA (iirnf(jc,70),jc=1,jpcoef)/ 593, 593, 18*0 /
+      DATA (ijrnf(jc,70),jc=1,jpcoef)/ 247, 248, 18*0 /
+      DATA (zrnfm(jm,70),jm=1,jpmois)/   &
+          4514.,    3988.,    4622.,    5403.,    5790.,    4145.,   &
+          2616.,    1961.,    2119.,    4304.,    7870.,    6810./
+      ! 71-Sanaga (Cameroun) 3.5N-9.5E (UNESCO, p31)        R1
+      ! Data from HLA: 3.9N -  9.6E   1944/80 = 1983m3/s
+      ! --> 1982.58337m3/s
+      DATA inb(71)/2/
+      DATA (iirnf(jc,71),jc=1,jpcoef)/ 595, 595, 18*0 /
+      DATA (ijrnf(jc,71),jc=1,jpcoef)/ 255, 256, 18*0 /
+      DATA (zrnfm(jm,71),jm=1,jpmois)/   &
+           813.,     578.,     517.,     633.,     909.,    1278.,   &
+          1928.,    2653.,    4361.,    5470.,    3307.,    1344./
+      ! 72-Nyong (Cameroun) 3.1N-9.5E (UNESCO, p36)         R1
+      ! Data from HLA: 3.5N -  9.8E   1951/84 = 432m3/s
+      ! --> 431.166656m3/s      
+      DATA inb(72)/1/
+      DATA (iirnf(jc,72),jc=1,jpcoef)/ 594, 19*0 /
+      DATA (ijrnf(jc,72),jc=1,jpcoef)/ 257, 19*0 /
+      DATA (zrnfm(jm,72),jm=1,jpmois)/   &
+          232.,     128.,     150.,     266.,     402.,     459.,   &
+          353.,     306.,     604.,     930.,     878.,     466./
+      ! 73-Ntem (Cameroun) 2.5N-9.5E (UNESCO, p36)          R1
+      ! Data from HLA: 3N -  9.8E   1951/87 = 330m3/s      
+      ! --> 329.75m3/s
+      DATA inb(73)/1/
+      DATA (iirnf(jc,73),jc=1,jpcoef)/ 594, 19*0 /
+      DATA (ijrnf(jc,73),jc=1,jpcoef)/ 254, 19*0 /
+      DATA (zrnfm(jm,73),jm=1,jpmois)/   &
+          452.,     455.,     492.,     466.,     482.,     251.,   &
+          151.,     108.,      87.,     133.,     395.,     485./
+      ! 74-Wouri (Cameroun) 4N-9.5E (UNESCO, p34)           R1
+      ! Data from HLA: 4N -  9.5E   1951/84  = 307m3/s
+      ! --> 306.583374m3/s
+      DATA inb(74)/1/
+      DATA (iirnf(jc,74),jc=1,jpcoef)/ 594, 19*0 /
+      DATA (ijrnf(jc,74),jc=1,jpcoef)/ 257, 19*0 /
+      DATA (zrnfm(jm,74),jm=1,jpmois)/   &
+           88.,      63.,      68.,      95.,     139.,     222.,   &
+          395.,     633.,     825.,     675.,     328.,     148./
+      ! 75-Oueme (Benin) 6.5N-2.5E (UNESCO, p27)            R1
+      ! Data from HLA:  6.2N -  2.5E   1951/84 =113m3/s
+      ! --> 112.666664m3/s
+      DATA inb(75)/1/
+      DATA (iirnf(jc,75),jc=1,jpcoef)/ 583, 19*0 /
+      DATA (ijrnf(jc,75),jc=1,jpcoef)/ 262, 19*0 /
+      DATA (zrnfm(jm,75),jm=1,jpmois)/   &
+           0.,       0.,       0.,       0.,       1.,      18.,   &
+          96.,     324.,     531.,     319.,      58.,       5./
+      ! 76-Mono(Tepetou,Benin/Togo) 6.25N-1.8E (U, p27)     R1
+      ! Data from HLA: 6.2N -  1  E   1951/85  = 96m3/s       
+      ! --> 96.4999924m3/s
+      DATA inb(76)/2/
+      DATA (iirnf(jc,76),jc=1,jpcoef)/ 578, 579, 18*0 /
+      DATA (ijrnf(jc,76),jc=1,jpcoef)/ 262, 262, 18*0 /
+      DATA (zrnfm(jm,76),jm=1,jpmois)/   &
+            2.,       1.,       1.,       4.,       8.,      44.,   &
+          168.,     274.,     386.,     215.,      47.,       8./
+      ! 77-Comoe (Ivory Coast) 5N-4W (UNESCO, p56)          R1
+      ! Data from HLA: 5.1N -  4  W   1955/86 = 194m3/s       
+      ! --> 194.25m3/s
+      DATA inb(77)/1/
+      DATA (iirnf(jc,77),jc=1,jpcoef)/ 569, 19*0 /
+      DATA (ijrnf(jc,77),jc=1,jpcoef)/ 260, 19*0 /
+      DATA (zrnfm(jm,77),jm=1,jpmois)/   &
+           14.,       7.,       9.,      17.,      29.,      90.,   &
+          145.,     349.,     740.,     688.,     198.,      45./
+      ! 78-Sassandra (Ivory Coast) 5N-6W (UNESCO, p58)      R1
+      ! Data from HLA: 5N -  6  W   1953/86 = 449m3/s
+      ! --> 449.333344m3/s
+      DATA inb(78)/1/
+      DATA (iirnf(jc,78),jc=1,jpcoef)/ 564, 19*0 /
+      DATA (ijrnf(jc,78),jc=1,jpcoef)/ 260, 19*0 /
+      DATA (zrnfm(jm,78),jm=1,jpmois)/   &
+          144.,     116.,     119.,     143.,     156.,     334.,   &
+          419.,     692.,    1277.,    1190.,     553.,     249./
+      
+      DATA inb(79)/0/
+      DATA inb(80)/0/
+      DATA inb(81)/0/
+      DATA inb(82)/0/
+      DATA inb(83)/0/
+      DATA inb(84)/0/
+      DATA inb(85)/0/
+      DATA inb(86)/0/
+      DATA inb(87)/0/
+      DATA inb(88)/0/
+      DATA inb(89)/0/
+      DATA inb(90)/0/
+
+      ! Total run-offs (VI)=63977.m3/s
+      ! Total run-offs (I+II+III+IV+V+VI)=560902.688m3/s
+
+      ! VII OCEANIA
+      ! ------------
+      ! 91-Murray (Austrlia) 35S34 138E54                   R5
+      ! Old=22 km3/year=697m3/s
+      ! --> 696.999939m3/s
+      DATA inb(91)/3/
+      DATA (iirnf(jc,91),jc=1,jpcoef)/ 129, 130, 130, 17*0 /
+      DATA (ijrnf(jc,91),jc=1,jpcoef)/ 177, 176, 177, 17*0 /
+      DATA (zrnfm(jm,91),jm=1,jpmois)/12*697./
+      ! 92-Haast (N. Zeland) 43S50 169E02                   R5
+      ! Old=6 km3/year=190m3/s
+      ! --> 189.999985m3/s
+      DATA inb(92)/1/
+      DATA (iirnf(jc,92),jc=1,jpcoef)/ 194, 19*0 /
+      DATA (ijrnf(jc,92),jc=1,jpcoef)/ 153, 19*0 /
+      DATA (zrnfm(jm,92),jm=1,jpmois)/12*190./
+      ! 93-Fly (N. Guinea) 8S30 143E05                      R5
+      ! Old=77 km3/year=2440m3/s
+      ! --> 2440.m3/s
+      DATA inb(93)/1/
+      DATA (iirnf(jc,93),jc=1,jpcoef)/ 143, 19*0 /
+      DATA (ijrnf(jc,93),jc=1,jpcoef)/ 233, 19*0 /
+      DATA (zrnfm(jm,93),jm=1,jpmois)/12*2440./
+      ! 94-Purari (N. Guinea) 7S25 145E05                   R4
+      ! Old=77 km3/year=2440m3/s; UNESCO(77+83,p595)=2727m3/s
+      ! --> 2727.33325m3/s
+      DATA inb(94)/1/
+      DATA (iirnf(jc,94),jc=1,jpcoef)/ 146, 19*0 /
+      DATA (ijrnf(jc,94),jc=1,jpcoef)/ 234, 19*0 /
+      DATA (zrnfm(jm,94),jm=1,jpmois)/   &
+          1972.,    3067.,    2332.,    2981.,    2693.,    2876.,   &
+          2867.,    3477.,    2195.,    2967.,    2674.,    2627./
+      ! 95-Choshui ch''i (taiwan) 24N03 120E23              R2
+      ! Old=6 km3/year=190m3/s; UNESCO(65-68, p374)=120m3/s; ratio=1.58 
+      ! --> 0.m3/s
+      DATA inb(95)/0/
+      DATA (iirnf(jc,95),jc=1,jpcoef)/  20*0 /
+      DATA (ijrnf(jc,95),jc=1,jpcoef)/  20*0 /
+      DATA (zrnfm(jm,95),jm=1,jpmois)/   &
+           65.,      63.,      83.,     100.,     177.,     535.,   &
+          332.,     313.,     236.,     193.,     101.,      84./
+      ! 96-Kaoping (Taiwan)                                 R5  
+      ! Old=9 km3/year=285m3/s
+      ! --> 0.m3/s
+      DATA inb(96)/0/
+      DATA (iirnf(jc,96),jc=1,jpcoef)/ 20*0 /
+      DATA (ijrnf(jc,96),jc=1,jpcoef)/ 20*0 /
+      DATA (zrnfm(jm,96),jm=1,jpmois)/12*285./
+      ! 97-Tsengwen (Taiwan)                                R5
+      ! Old=2 km3/year=63m3/s
+      ! --> 0.m3/s
+      DATA inb(97)/0/
+      DATA (iirnf(jc,97),jc=1,jpcoef)/ 20*0 /
+      DATA (ijrnf(jc,97),jc=1,jpcoef)/ 20*0 /
+      DATA (zrnfm(jm,97),jm=1,jpmois)/12*63./
+      ! 98-Hualien (Taiwan)                                 R5
+      ! Old=4 km3/year=127m3/s
+      ! --> 0.m3/s
+      DATA inb(98)/0/
+      DATA (iirnf(jc,98),jc=1,jpcoef)/ 20*0 /
+      DATA (ijrnf(jc,98),jc=1,jpcoef)/ 20*0 /
+      DATA (zrnfm(jm,98),jm=1,jpmois)/12*127./
+      ! 99-Peinan (Taiwan) 22N46 121E10                     R5
+      ! Old=4 km3/year=127m3/s
+      ! --> 127.000008m3/s
+      DATA inb(99)/1/
+      DATA (iirnf(jc,99),jc=1,jpcoef)/  98, 19*0 /
+      DATA (ijrnf(jc,99),jc=1,jpcoef)/ 288, 19*0 /
+      DATA (zrnfm(jm,99),jm=1,jpmois)/12*127./
+      ! 100-Hsiukuluan (Taiwan)                             R5
+      ! Old=4 km3/year=127m3/s
+      ! --> 0.m3/s
+      DATA inb(100)/0/
+      DATA (iirnf(jc,100),jc=1,jpcoef)/ 20*0 /
+      DATA (ijrnf(jc,100),jc=1,jpcoef)/ 20*0 /
+      DATA (zrnfm(jm,100),jm=1,jpmois)/12*127./
+
+
+
+
+
+
+
+       ! I ASIA
+       ! ------
+
+       ! 1-Indus (Pakistan)
+       ! --> 3949m3/s
+       DATA inb(101)/4/
+       DATA (iirnf(jc,101),jc=1,jpcoef)/ 711, 711, 712, 713, 16*0 /
+       DATA (ijrnf(jc,101),jc=1,jpcoef)/ 297, 298, 297, 297, 16*0 /
+       DATA (zrnfm(jm,101),jm=1,jpmois)/  &
+     &      1691.,    2121.,    2083.,    2940.,    3738.,    4198.,  &
+     &      5334.,    8247.,    7833.,    4908.,    2681.,    1614./
+       ! 2-Sabarmati+Mahi+Narmada (India)
+       ! --> 3383m3/s
+       DATA inb(102)/1/
+!CT bug point terre       DATA (iirnf(jc,102),jc=1,jpcoef)/ 720, 19*0 /
+!CT bug point terre       DATA (ijrnf(jc,102),jc=1,jpcoef)/ 292, 19*0 /
+       DATA (iirnf(jc,102),jc=1,jpcoef)/ 719, 19*0 /
+       DATA (ijrnf(jc,102),jc=1,jpcoef)/ 291, 19*0 /
+       DATA (zrnfm(jm,102),jm=1,jpmois)/  &
+     &      1343.,     110.,       0.,       0.,      13.,    3051.,  &
+     &      9453.,   11655.,    7619.,    3547.,    2081.,    1727./
+       ! 3-
+       ! --> 182m3/s
+       DATA inb(103)/1/
+!CT bug point terre       DATA (iirnf(jc,103),jc=1,jpcoef)/ 721, 19*0 /
+!CT bug point terre       DATA (ijrnf(jc,103),jc=1,jpcoef)/ 286, 19*0 /
+       DATA (iirnf(jc,103),jc=1,jpcoef)/ 720, 19*0 /
+       DATA (ijrnf(jc,103),jc=1,jpcoef)/ 286, 19*0 /
+       DATA (zrnfm(jm,103),jm=1,jpmois)/  &
+     &      0.,       0.,       0.,       0.,     225.,     669.,  &
+     &      526.,     327.,     187.,     100.,      62.,      92./
+       ! 4-Mandovi + Zuari + Kalinadi
+       ! --> 347m3/s
+       DATA inb(104)/1/
+       DATA (iirnf(jc,104),jc=1,jpcoef)/ 2, 19*0 /
+       DATA (ijrnf(jc,104),jc=1,jpcoef)/ 282, 19*0 /
+       DATA (zrnfm(jm,104),jm=1,jpmois)/  &
+     &      7.,       0.,       0.,       0.,     428.,    1339.,  &
+     &      966.,     601.,     350.,     190.,     117.,     166./
+       ! 5-                    R2
+       ! --> 190m3/s
+       DATA inb(105)/1/
+       DATA (iirnf(jc,105),jc=1,jpcoef)/ 4, 19*0 /
+       DATA (ijrnf(jc,105),jc=1,jpcoef)/ 279, 19*0 /
+       DATA (zrnfm(jm,105),jm=1,jpmois)/  &
+     &      0.,       0.,       0.,       0.,     363.,     710.,   &
+     &      484.,     315.,     172.,      95.,      59.,      87./
+       ! 6-
+       ! --> 1101m3/s
+       DATA inb(106)/1/
+       DATA (iirnf(jc,106),jc=1,jpcoef)/ 4, 19*0 /
+       DATA (ijrnf(jc,106),jc=1,jpcoef)/ 277, 19*0 /
+       DATA (zrnfm(jm,106),jm=1,jpmois)/   &
+     &      79.,       0.,       0.,       0.,    1457.,    3639.,   &
+     &      3084.,    2031.,    1282.,     696.,     414.,     535. /
+       ! 7-
+       ! --> 948m3/s
+       DATA inb(107)/1/
+       DATA (iirnf(jc,107),jc=1,jpcoef)/ 5, 19*0 /
+       DATA (ijrnf(jc,107),jc=1,jpcoef)/ 275, 19*0 /
+       DATA (zrnfm(jm,107),jm=1,jpmois)/  &
+     &      72.,       0.,       0.,       0.,    1151.,    3038.,     & 
+     &      2583.,    1603.,    1216.,     749.,     426.,     539./
+
+       ! 8-
+       ! --> 551m3/s
+       DATA inb(108)/1/
+       DATA (iirnf(jc,108),jc=1,jpcoef)/ 7, 19*0 /
+       DATA (ijrnf(jc,108),jc=1,jpcoef)/ 271, 19*0 /
+       DATA (zrnfm(jm,108),jm=1,jpmois)/  &
+     &      45.,       0.,       2.,       7.,     680.,    1621.,  &
+     &      1234.,     744.,     784.,     696.,     359.,     442. /
+       ! 9-
+       ! --> 103m3/s
+       DATA inb(109)/1/
+       DATA (iirnf(jc,109),jc=1,jpcoef)/ 8, 19*0 /
+       DATA (ijrnf(jc,109),jc=1,jpcoef)/ 269, 19*0 /
+       DATA (zrnfm(jm,109),jm=1,jpmois)/  &
+     &      11.,       0.,       0.,       0.,     160.,     250.,   &
+     &      200.,     145.,     168.,     146.,      74.,      89. /
+       ! 10-
+       ! --> 99m3/s
+       DATA inb(110)/1/
+       DATA (iirnf(jc,110),jc=1,jpcoef)/12, 19*0 /
+       DATA (ijrnf(jc,110),jc=1,jpcoef)/267, 19*0 /
+       DATA (zrnfm(jm,110),jm=1,jpmois)/  &
+     &      50.,       1.,       1.,       0.,      25.,      69.,  &
+     &      51.,      32.,     176.,     329.,     233.,     222./
+       ! 11- Kaveri (India)
+       ! --> 173m3/s
+       DATA inb(111)/1/
+       DATA (iirnf(jc,111),jc=1,jpcoef)/16, 19*0 /
+       DATA (ijrnf(jc,111),jc=1,jpcoef)/271, 19*0 /
+       DATA (zrnfm(jm,111),jm=1,jpmois)/  &
+     &       97.,       2.,       1.,       2.,      19.,      67.,   &
+     &      108.,     134.,     218.,     515.,     498.,     416. /
+       ! 12-
+       ! --> 116m3/s
+       DATA inb(112)/1/
+       DATA (iirnf(jc,112),jc=1,jpcoef)/16, 19*0 /
+       DATA (ijrnf(jc,112),jc=1,jpcoef)/279, 19*0 /
+       DATA (zrnfm(jm,112),jm=1,jpmois)/  &
+     &       43.,       0.,       0.,       0.,       0.,       0.,   &
+     &        0.,       0.,      99.,     568.,     343.,     342. /
+       ! 13- Krishna
+       ! --> 2864m3/s
+       DATA inb(113)/1/
+       DATA (iirnf(jc,113),jc=1,jpcoef)/ 16, 19*0 /
+       DATA (ijrnf(jc,113),jc=1,jpcoef)/ 281, 19*0 /
+       DATA (zrnfm(jm,113),jm=1,jpmois)/   &
+     &       1368.,     174.,       0.,       0.,     166.,    2362.,  &
+     &       9501.,    8639.,    6053.,    3173.,    1763.,    1175. /
+       ! 14- (SriLanka)
+       ! --> 371m3/s
+       DATA inb(114)/1/
+       DATA (iirnf(jc,114),jc=1,jpcoef)/ 16, 19*0 /
+       DATA (ijrnf(jc,114),jc=1,jpcoef)/ 261, 19*0 /
+       DATA (zrnfm(jm,114),jm=1,jpmois)/  &
+     &      171.,     144.,     292.,     469.,     414.,     309.,  &
+     &      269.,     244.,     526.,     560.,     476.,     588.  /
+       ! 15- (SriLanka)
+       ! --> 305m3/s
+       DATA inb(115)/1/
+       DATA (iirnf(jc,115),jc=1,jpcoef)/18, 19*0 /
+       DATA (ijrnf(jc,115),jc=1,jpcoef)/262, 19*0 /
+       DATA (zrnfm(jm,115),jm=1,jpmois)/  &
+     &      116.,     111.,     225.,     379.,     366.,     300.,  &
+     &      256.,     239.,     385.,     437.,     388.,     467. /
+       ! 16- (SriLanka)
+       ! --> 722m3/s
+       DATA inb(116)/1/
+       DATA (iirnf(jc,116),jc=1,jpcoef)/20, 19*0 /
+       DATA (ijrnf(jc,116),jc=1,jpcoef)/265, 19*0 /
+       DATA (zrnfm(jm,116),jm=1,jpmois)/  &
+     &      711.,     347.,     477.,     556.,     430.,     302.,  &
+     &      228.,     200.,     629.,    1156.,    1579.,    2055.   /
+       ! 17- (SriLanka)
+       ! --> 188m3/s
+       DATA inb(117)/1/
+       DATA (iirnf(jc,117),jc=1,jpcoef)/19, 19*0 /
+       DATA (ijrnf(jc,117),jc=1,jpcoef)/267, 19*0 /
+       DATA (zrnfm(jm,117),jm=1,jpmois)/  &
+     &      189.,      50.,      27.,      17.,      10.,       6.,  &
+     &       4.,       2.,       1.,     236.,     829.,     894. /
+       ! 18- Godavari (India) 17N00  81E45
+       ! --> 2709m3/s
+       DATA inb(118)/1/
+       DATA (iirnf(jc,118),jc=1,jpcoef)/ 19, 19*0 /
+       DATA (ijrnf(jc,118),jc=1,jpcoef)/283, 19*0 /
+       DATA (zrnfm(jm,118),jm=1,jpmois)/  &
+     &      1151.,      57.,       0.,       0.,      38.,    1490.,  &
+     &      6714.,    9065.,    7208.,    3294.,    1874.,    1629. /
+       ! 19-
+       ! --> 116m3/s
+       DATA inb(119)/1/
+       DATA (iirnf(jc,119),jc=1,jpcoef)/23, 19*0 /
+       DATA (ijrnf(jc,119),jc=1,jpcoef)/286, 19*0 /
+       DATA (zrnfm(jm,119),jm=1,jpmois)/  &
+     &         17.,       0.,       0.,       0.,       0.,     103.,  &
+     &        259.,     341.,     330.,     155.,      87.,     110. /
+       ! 20- Mahanadi (India)
+       ! --> 2390m3/s
+       DATA inb(120)/1/
+       DATA (iirnf(jc,120),jc=1,jpcoef)/28, 19*0 /
+       DATA (ijrnf(jc,120),jc=1,jpcoef)/290, 19*0 /
+       DATA (zrnfm(jm,120),jm=1,jpmois)/  &
+     &       809.,       5.,       0.,       0.,      60.,    1401.,  &
+     &      6652.,    8828.,    5410.,    2561.,    1503.,    1452. /
+       ! 21-
+       ! --> 247m3/s
+       DATA inb(121)/1/
+       DATA (iirnf(jc,121),jc=1,jpcoef)/30, 19*0 /
+       DATA (ijrnf(jc,121),jc=1,jpcoef)/294, 19*0 /
+       DATA (zrnfm(jm,121),jm=1,jpmois)/  &
+     &         15.,       0.,       0.,       0.,      73.,     367.,   &
+     &        744.,     722.,     491.,     227.,     137.,     188. /
+       ! 22-
+       ! --> 167m3/s
+       DATA inb(122)/1/
+       DATA (iirnf(jc,122),jc=1,jpcoef)/31, 19*0 /
+       DATA (ijrnf(jc,122),jc=1,jpcoef)/294, 19*0 /
+       DATA (zrnfm(jm,122),jm=1,jpmois)/  &
+     &         16.,       0.,       0.,       0.,      95.,     337.,  &
+     &        488.,     453.,     285.,     143.,      84.,     109. /
+       ! 23-
+       ! --> 206m3/s
+       DATA inb(123)/1/
+       DATA (iirnf(jc,123),jc=1,jpcoef)/32, 19*0 /
+       DATA (ijrnf(jc,123),jc=1,jpcoef)/294, 19*0 /
+       DATA (zrnfm(jm,123),jm=1,jpmois)/  &
+     &         12.,       0.,       0.,       0.,      35.,     400.,  &
+     &        652.,     616.,     347.,     172.,     105.,     144. /
+       ! 24- Ganga + Brahmaputra (Bangladesh) 22N00  91E00
+       ! --> 42436m3/s
+       DATA inb(124)/9/
+       DATA (iirnf(jc,124),jc=1,jpcoef)/ 37, 38, 39, 32, 33, 34, 35  &
+     &      , 36, 37, 11*0 /
+       DATA (ijrnf(jc,124),jc=1,jpcoef)/ 295,295,295,294,294,294,294  &
+     &      , 294, 294, 11*0 /
+       DATA (zrnfm(jm,124),jm=1,jpmois)/  &
+     &        14293.,   4223.,   3004.,  11743.,  32210.,  56899.,  &
+     &        82263.,  95069.,  77997.,  44194.,  23724.,  17272. /
+
+       DATA inb(125)/0/
+      DATA inb(126)/0/
+
+       ! 27- Kuladan
+       ! --> 1541m3/s
+       DATA inb(127)/1/
+       DATA (iirnf(jc,127),jc=1,jpcoef)/42, 19*0 /
+       DATA (ijrnf(jc,127),jc=1,jpcoef)/290, 19*0 /
+       DATA (zrnfm(jm,127),jm=1,jpmois)/  &
+     &        140.,       0.,       0.,      27.,    2280.,    4133.,  &
+     &       4306.,    3049.,    1993.,    1115.,     646.,     812. /
+       ! 28-
+       ! --> 618m3/s
+       DATA inb(128)/1/
+       DATA (iirnf(jc,128),jc=1,jpcoef)/44, 19*0 /
+       DATA (ijrnf(jc,128),jc=1,jpcoef)/287, 19*0 /
+       DATA (zrnfm(jm,128),jm=1,jpmois)/  &
+     &        0.,       0.,       0.,      73.,    1139.,    1755.,  &
+     &      1725.,    1139.,     677.,     362.,     221.,     326. /
+       ! 29-
+       ! --> 158m3/s
+       DATA inb(129)/1/
+       DATA (iirnf(jc,129),jc=1,jpcoef)/44, 19*0 /
+       DATA (ijrnf(jc,129),jc=1,jpcoef)/284, 19*0 /
+       DATA (zrnfm(jm,129),jm=1,jpmois)/  &
+     &        0.,       0.,       0.,       0.,     248.,     419.,  &
+     &      445.,     334.,     201.,     103.,      63.,      93. /
+       ! 30-
+       ! --> 136m3/s
+       DATA inb(130)/1/
+       DATA (iirnf(jc,130),jc=1,jpcoef)/32, 19*0 /
+       DATA (ijrnf(jc,130),jc=1,jpcoef)/277, 19*0 /
+       DATA (zrnfm(jm,130),jm=1,jpmois)/  &
+     &         0.,       0.,       0.,       0.,     223.,     261.,  &
+     &       269.,     315.,     223.,     147.,      86.,     116. /
+       ! 31-
+       ! --> 142m3/s
+       DATA inb(131)/1/
+       DATA (iirnf(jc,131),jc=1,jpcoef)/42, 19*0 /
+       DATA (ijrnf(jc,131),jc=1,jpcoef)/275, 19*0 /
+       DATA (zrnfm(jm,131),jm=1,jpmois)/  &
+     &         0.,       0.,       0.,       0.,     241.,     260.,  &
+     &       270.,     325.,     231.,     158.,      96.,     126.  /
+       ! 32- Irrawady (Myanmar) 15N50  95E06
+       ! --> 16751m3/s
+       DATA inb(132)/3/
+       DATA (iirnf(jc,132),jc=1,jpcoef)/  45,  46, 47, 17*0 /
+       DATA (ijrnf(jc,132),jc=1,jpcoef)/ 282, 281, 282, 17*0 /
+       DATA (zrnfm(jm,132),jm=1,jpmois)/  &
+     &       7174.,     2281.,     80.,    687.,    8133.,   23980.,  &
+     &       38452.,   41442.,  34497.,  23150.,   12529.,    8629. /
+
+       DATA inb(133)/0/
+       DATA inb(134)/0/
+       DATA inb(135)/0/
+       DATA inb(136)/0/
+
+       ! 37- Tenasserim (Myanmar)
+       ! --> 1369m3/s
+       DATA inb(137)/1/
+       DATA (iirnf(jc,137),jc=1,jpcoef)/51, 19*0 /
+       DATA (ijrnf(jc,137),jc=1,jpcoef)/279, 19*0 /
+       DATA (zrnfm(jm,137),jm=1,jpmois)/  &
+     &        65.,       0.,       0.,     540.,    2127.,    3260.,  &
+     &      3540.,    2966.,    1747.,     900.,     544.,     741. /
+       ! 38-
+       ! --> 413m3/s
+       DATA inb(138)/1/
+       DATA (iirnf(jc,138),jc=1,jpcoef)/52, 19*0 /
+       DATA (ijrnf(jc,138),jc=1,jpcoef)/277, 19*0 /
+       DATA (zrnfm(jm,138),jm=1,jpmois)/  &
+     &          0.,       0.,       0.,     202.,     773.,    1000.,  &
+     &       1032.,     831.,     492.,     248.,     153.,     226. /
+       ! 39-
+       ! --> 810m3/s
+       DATA inb(139)/1/
+       DATA (iirnf(jc,139),jc=1,jpcoef)/52, 19*0 /
+       DATA (ijrnf(jc,139),jc=1,jpcoef)/275, 19*0 /
+       DATA (zrnfm(jm,139),jm=1,jpmois)/  &
+     &         59.,       0.,       0.,      22.,    1104.,    1857.,  &
+     &       2069.,    1858.,    1252.,     637.,     373.,     493. /
+       ! 40-
+       ! --> 896m3/s
+       DATA inb(140)/1/
+       DATA (iirnf(jc,140),jc=1,jpcoef)/52, 19*0 /
+       DATA (ijrnf(jc,140),jc=1,jpcoef)/273, 19*0 /
+       DATA (zrnfm(jm,140),jm=1,jpmois)/  &
+     &         94.,       0.,       0.,     196.,    1145.,    1716.,  &
+     &       1936.,    1899.,    1519.,    1000.,     562.,     688. /
+       ! 41-
+       ! --> 559m3/s
+       DATA inb(141)/1/
+       DATA (iirnf(jc,141),jc=1,jpcoef)/52, 19*0 /
+       DATA (ijrnf(jc,141),jc=1,jpcoef)/271, 19*0 /
+       DATA (zrnfm(jm,141),jm=1,jpmois)/  &
+     &       38.,       0.,       0.,     227.,     805.,    1051.,  &
+     &      1105.,    1236.,     941.,     575.,     321.,     416. /
+       ! 42-
+       ! --> 1070m3/s
+       DATA inb(142)/1/
+       DATA (iirnf(jc,142),jc=1,jpcoef)/53, 19*0 /
+       DATA (ijrnf(jc,142),jc=1,jpcoef)/265, 19*0 /
+       DATA (zrnfm(jm,142),jm=1,jpmois)/  &
+     &       356.,      18.,      14.,     160.,     745.,    1123.,  &
+     &      1347.,    1732.,    2076.,    2057.,    1574.,    1639. /
+       ! 43-
+       ! --> 513m3/s
+       DATA inb(143)/1/
+       DATA (iirnf(jc,143),jc=1,jpcoef)/54, 19*0 /
+       DATA (ijrnf(jc,143),jc=1,jpcoef)/263, 19*0 /
+       DATA (zrnfm(jm,143),jm=1,jpmois)/  &
+     &       231.,      12.,     121.,     236.,     216.,     239.,  &
+     &       351.,     517.,    1008.,    1324.,     975.,     929.  /
+       ! 44-
+       ! --> 881m3/s
+       DATA inb(144)/1/
+       DATA (iirnf(jc,144),jc=1,jpcoef)/56, 19*0 /
+       DATA (ijrnf(jc,144),jc=1,jpcoef)/259, 19*0 /
+       DATA (zrnfm(jm,144),jm=1,jpmois)/  &
+     &      558.,     632.,     980.,     902.,     575.,     421.,  &
+     &      432.,     731.,    1276.,    1405.,    1188.,    1480. /
+       ! 45-
+       ! --> 905m3/s
+       DATA inb(145)/1/
+       DATA (iirnf(jc,145),jc=1,jpcoef)/52, 19*0 /
+       DATA (ijrnf(jc,145),jc=1,jpcoef)/259, 19*0 /
+       DATA (zrnfm(jm,145),jm=1,jpmois)/  &
+     &      604.,     552.,     781.,     853.,     627.,     488.,  &
+     &      503.,     781.,    1245.,    1356.,    1331.,    1747. /
+       ! 46-
+       ! --> 136m3/s
+       DATA inb(146)/1/
+       DATA (iirnf(jc,146),jc=1,jpcoef)/50, 19*0 /
+       DATA (ijrnf(jc,146),jc=1,jpcoef)/261, 19*0 /
+       DATA (zrnfm(jm,146),jm=1,jpmois)/  &
+     &      103.,     111.,     126.,     112.,      66.,      40.,  &
+     &       35.,      51.,     126.,     227.,     279.,     362.  /
+       ! 47-
+       ! --> 222m3/s
+       DATA inb(147)/1/
+       DATA (iirnf(jc,147),jc=1,jpcoef)/47, 19*0 /
+       DATA (ijrnf(jc,147),jc=1,jpcoef)/258, 19*0 /
+       DATA (zrnfm(jm,147),jm=1,jpmois)/  &
+     &      176.,     160.,     209.,     197.,     130.,      99.,  &
+     &       90.,     151.,     240.,     342.,     373.,     502./
+       ! 48-
+       ! --> 326m3/s
+       DATA inb(148)/1/
+       DATA (iirnf(jc,148),jc=1,jpcoef)/49, 19*0 /
+       DATA (ijrnf(jc,148),jc=1,jpcoef)/257, 19*0 /
+       DATA (zrnfm(jm,148),jm=1,jpmois)/  &
+     &       226.,     278.,     363.,     301.,     181.,     130.,  &
+     &       131.,     194.,     407.,     505.,     519.,     689. /
+       ! 49-
+       ! --> 203m3/s
+       DATA inb(149)/1/
+       DATA (iirnf(jc,149),jc=1,jpcoef)/50, 19*0 /
+       DATA (ijrnf(jc,149),jc=1,jpcoef)/256, 19*0 /
+       DATA (zrnfm(jm,149),jm=1,jpmois)/  &
+     &      120.,     218.,     233.,     189.,     134.,     128.,  &
+     &      115.,     178.,     244.,     272.,     247.,     360. /
+       ! 50-
+       ! --> 153m3/s
+       DATA inb(150)/1/
+       DATA (iirnf(jc,150),jc=1,jpcoef)/50, 19*0 /
+       DATA (ijrnf(jc,150),jc=1,jpcoef)/255, 19*0 /
+       DATA (zrnfm(jm,150),jm=1,jpmois)/  &
+     &         97.,     108.,     191.,     141.,      97.,      82.,  &
+     &        107.,     118.,     188.,     230.,     208.,     278. /
+       ! 51-
+       ! --> 196m3/s
+       DATA inb(151)/1/
+       DATA (iirnf(jc,151),jc=1,jpcoef)/53, 19*0 /
+       DATA (ijrnf(jc,151),jc=1,jpcoef)/253, 19*0 /
+       DATA (zrnfm(jm,151),jm=1,jpmois)/  &
+     &        74.,     125.,     165.,     123.,     117.,     121.,  &
+     &       160.,     196.,     272.,     322.,     296.,     389. /
+       ! 52-
+       ! --> 166m3/s
+       DATA inb(152)/1/
+       DATA (iirnf(jc,152),jc=1,jpcoef)/53, 19*0 /
+       DATA (ijrnf(jc,152),jc=1,jpcoef)/252, 19*0 /
+       DATA (zrnfm(jm,152),jm=1,jpmois)/  &
+     &      136.,     140.,     192.,     169.,     108.,      80.,  &
+     &      75.,     145.,     200.,     219.,     221.,     307. /
+       ! 53-Tigris+Euphrates (Irak) 31N00  47E25
+       ! --> 4762m3/s
+       DATA inb(153)/3/
+       DATA (iirnf(jc,153),jc=1,jpcoef)/ 673, 673, 674, 17*0 /
+       DATA (ijrnf(jc,153),jc=1,jpcoef)/ 312, 313, 313, 17*0 /
+       DATA (zrnfm(jm,153),jm=1,jpmois)/  &
+     &       6056.,    7229.,    8377.,    8505.,    7966.,    6217.,  &
+     &       3396.,    1898.,    1147.,     869.,    1714.,    3779. /
+
+       DATA (inb(jr),jr=154,200)/47*0/
+
+
+      !  Total run-offs(VII)=6181.33301m3/s
+      !  Total run-offs(I+II+III+IV+V+VI+VII)= 567084. m3/s
+      !                                      = 1.588668056E-6 kg/m2/s
+      !                                      = 17883.5586 km3/Year
+      !                                      = 0.567083955 Sverdrup
+
+      !!----------------------------------------------------------------------
+      !!  OPA 8.5, LODYC-IPSL (2002)
+      !!----------------------------------------------------------------------
+
+      IF( kt == nit000 ) THEN
+         IF(lwp) WRITE(numout,*)
+         IF(lwp) WRITE(numout,*) 'flxrnf : runoff + orca05'
+         IF(lwp) WRITE(numout,*) '~~~~~~'
+         IF(lwp) WRITE(numout,*) '   nrunoff = ', nrunoff
+         IF(lwp) WRITE(numout,*)
+      ENDIF
+
+      ! 0. initialization and  indexes  modification for zoom version
+      ! --------------------------------------------------------------
+      
+      
+      ! conversion factor m3/s --> kg/m2/s *e1t*e2t
+
+      zconv = rauw
+
+      IF( kt == nit000 ) THEN 
+         ! Set runoffs and upstream coeff to zero
+         runoff (:,:) = 0.e0                                                                                  
+         upsrnfh(:,:) = 0.e0
+         upsrnfz(:)   = 0.e0
+         upsadv (:,:) = 0.e0
+         zcoefr(:,:,:) = 0.e0
+
+         IF( nrunoff == 0 ) THEN
+            IF(lwp) WRITE(numout,*)
+            IF(lwp) WRITE(numout,*) ' NO RUNOFF in this simulation '
+            IF(lwp) WRITE(numout,*)
+         ENDIF
+      ENDIF
+
+      ! 1. initialization of the runoff array
+      ! -------------------------------------
+
+      IF( nrunoff == 1 .OR. nrunoff == 2) THEN
+
+         iman  = jpmois
+ !!! better but change the results      i15 = INT( 2*FLOAT( nday ) / ( FLOAT( nobis(nmonth) ) + 0.5 ) )
+         i15 = nday / 16
+         imois = nmonth + i15 - 1
+         IF( imois == 0) imois = iman
+         IF( nn_leap_year == 1 .AND. MOD( nyear, 4 ) == 0 ) THEN
+            ! Number of Day Between Data
+            idbd = nbiss(imois)
+         ELSEIF( nn_leap_year > 1 ) THEN
+            idbd = nn_leap_year
+         ELSE
+            idbd = nobis(imois)
+         END IF
+         ! Number of days between imois, 15 and the end of month
+         idmeom = idbd - 15
+         
+         ! 1.1 Calendar computation
+         
+         ! nrnf1 number of the first array record used in the simulation
+         ! nrnf2 number of the last  array record
+         
+         nrnf1 = imois
+         nrnf2 = nrnf1 + 1
+         nrnf1 = MOD( nrnf1, iman )
+         IF( nrnf1 == 0 ) nrnf1 = iman
+         nrnf2 = MOD( nrnf2, iman )
+         IF( nrnf2 == 0 ) nrnf2 = iman
+         
+         IF( kt == nit000 ) THEN
+            IF(lwp) WRITE(numout,*)
+            IF(lwp) WRITE(numout,*) 'flxrnf routine'
+            IF(lwp) WRITE(numout,*) 'first array record used nrnf1 ',nrnf1
+            IF(lwp) WRITE(numout,*) 'last  array record used nrnf2 ',nrnf2
+         ENDIF
+
+         zxy = FLOAT( nday + idmeom - idbd * i15 ) / idbd
+
+         DO jr = 1, jpriv-1
+            inbp = inb(jr)
+            IF( inbp /= 0 ) THEN
+               DO jl = 1, inbp
+                  DO jj = mj0(ijrnf(jl,jr)), mj1(ijrnf(jl,jr))
+                     DO ji = mi0(iirnf(jl,jr)), mi1(iirnf(jl,jr))
+                        runoff(ji,jj) = runoff(ji,jj)   & 
+                           &          + ( (1.-zxy) * zrnfm(nrnf1,jr)   &
+                           &          +       zxy  * zrnfm(nrnf2,jr)  ) / FLOAT(inbp)
+                     END DO
+                  END DO
+               END DO
+            ENDIF
+         END DO
+
+
+         ! 2. conversion in mm/day
+         ! -----------------------
+         !     C a u t i o n : upward water flux, runoff is negative
+
+         runoff(:,:) = -zconv * runoff(:,:) / ( e1t(:,:) * e2t(:,:) )
+         
+
+         ! 3. advectve coefficient
+         ! -----------------------
+
+         !  Creates the array coef that contains the coefficient to affect to
+         !  the upstream scheme. advection scheme will be:
+         !  coefr * upstream + (1- coefr) centered
+         !  coefr must be between 0 and 1.
+         !  3 values are used: maximum = zrup1, between zrup2, small zrup3.
+         ! 
+         IF( nrunoff == 2 .AND. kt == nit000 ) THEN
+
+            zrup1 = 0.5
+            zrup2 = 0.25
+            zrup3 = 0.125
+            DO jr = 1, jpriv-1
+               inbp = inb(jr)
+               IF( inbp /= 0) THEN
+                  DO jl = 1, inbp
+                     ! ji,jj
+                     DO jj = mj0(ijrnf(jl,jr)), mj1(ijrnf(jl,jr))
+                        DO ji = mi0(iirnf(jl,jr)), mi1(iirnf(jl,jr))
+                           DO jn = 1, 3
+                              zcoefr(ji,jj,jn) = zrup1
+                           END DO
+                           zcoefr(ji,jj,4) = zrup2
+                           zcoefr(ji,jj,5) = zrup3
+                        END DO
+                     END DO
+                     ! --> zrup2 (originally = 0.5)
+                     ! ji,jj+1
+                     DO jj = mj0(ijrnf(jl,jr) + 1), mj1(ijrnf(jl,jr) + 1)
+                        DO ji = mi0(iirnf(jl,jr)), mi1(iirnf(jl,jr))
+                           DO jn = 1, 3
+                              zcoefr(ji,jj,jn) = MAX( zrup2, zcoefr(ji,jj,jn) )
+                           END DO
+                           zcoefr(ji,jj,4) = MAX( zrup3, zcoefr(ji,jj,4) )
+                        END DO
+                     END DO
+                     ! ji,jj-1
+                     DO jj = mj0(ijrnf(jl,jr) - 1), mj1(ijrnf(jl,jr) - 1)
+                        DO ji = mi0(iirnf(jl,jr)), mi1(iirnf(jl,jr))
+                           DO jn = 1, 3
+                              zcoefr(ji,jj,jn) = MAX( zrup2, zcoefr(ji,jj,jn) )
+                           END DO
+                           zcoefr(ji,jj,4) = MAX( zrup3, zcoefr(ji,jj,4) )
+                        END DO
+                     END DO
+                     ! ji+1,jj-1
+                     DO jj = mj0(ijrnf(jl,jr) - 1), mj1(ijrnf(jl,jr) - 1)
+                        DO ji = mi0(iirnf(jl,jr) + 1), mi1(iirnf(jl,jr) + 1)
+                           DO jn = 1, 3
+                              zcoefr(ji,jj,jn) = MAX( zrup2, zcoefr(ji,jj,jn) )
+                           END DO
+                           zcoefr(ji,jj,4) = MAX( zrup3, zcoefr(ji,jj,4) )
+                        END DO
+                     END DO
+                     ! ji+1,jj
+                     DO jj = mj0(ijrnf(jl,jr)), mj1(ijrnf(jl,jr))
+                        DO ji = mi0(iirnf(jl,jr) + 1), mi1(iirnf(jl,jr) + 1)
+                           DO jn = 1, 3
+                              zcoefr(ji,jj,jn) = MAX( zrup2, zcoefr(ji,jj,jn) )
+                           END DO
+                           zcoefr(ji,jj,4) = MAX( zrup3, zcoefr(ji,jj,4) )
+                        END DO
+                     END DO
+                     ! ji+1,jj+1
+                     DO jj = mj0(ijrnf(jl,jr) + 1), mj1(ijrnf(jl,jr) + 1)
+                        DO ji = mi0(iirnf(jl,jr) + 1), mi1(iirnf(jl,jr) + 1)
+                           DO jn = 1, 3
+                              zcoefr(ji,jj,jn) = MAX( zrup2, zcoefr(ji,jj,jn) )
+                           END DO
+                           zcoefr(ji,jj,4) = MAX( zrup3, zcoefr(ji,jj,4) )
+                        END DO
+                     END DO
+                     ! ji-1,jj+1
+                     DO jj = mj0(ijrnf(jl,jr) + 1), mj1(ijrnf(jl,jr) + 1)
+                        DO ji = mi0(iirnf(jl,jr) - 1), mi1(iirnf(jl,jr) - 1)
+                           DO jn = 1, 3
+                              zcoefr(ji,jj,jn) = MAX( zrup2, zcoefr(ji,jj,jn) )
+                           END DO
+                           zcoefr(ji,jj,4) = MAX( zrup3, zcoefr(ji,jj,4) )
+                        END DO
+                     END DO
+                     ! ji-1,jj
+                     DO jj = mj0(ijrnf(jl,jr)), mj1(ijrnf(jl,jr))
+                        DO ji = mi0(iirnf(jl,jr) - 1), mi1(iirnf(jl,jr) - 1)
+                           DO jn = 1, 3
+                              zcoefr(ji,jj,jn) = MAX( zrup2, zcoefr(ji,jj,jn) )
+                           END DO
+                           zcoefr(ji,jj,4) = MAX( zrup3, zcoefr(ji,jj,4) )
+                        END DO
+                     END DO
+                     ! ji-1,jj-1
+                     DO jj = mj0(ijrnf(jl,jr) - 1), mj1(ijrnf(jl,jr) - 1)
+                        DO ji = mi0(iirnf(jl,jr) - 1), mi1(iirnf(jl,jr) - 1)
+                           DO jn = 1, 3
+                              zcoefr(ji,jj,jn) = MAX( zrup2, zcoefr(ji,jj,jn) )
+                           END DO
+                           zcoefr(ji,jj,4) = MAX( zrup3, zcoefr(ji,jj,4) )
+                        END DO
+                     END DO
+                     ! --> zrup3 (originally = 0.25)
+                     ! ji-1,jj+2
+                     DO jj = mj0(ijrnf(jl,jr) + 2), mj1(ijrnf(jl,jr) + 2)
+                        DO ji = mi0(iirnf(jl,jr) - 1), mi1(iirnf(jl,jr) - 1)
+                           DO jn = 1, 3
+                              zcoefr(ji,jj,jn) = MAX( zrup3, zcoefr(ji,jj,jn) )
+                           END DO
+                        END DO
+                     END DO
+                     ! ji-1,jj-2
+                     DO jj = mj0(ijrnf(jl,jr) - 2), mj1(ijrnf(jl,jr) - 2)
+                        DO ji = mi0(iirnf(jl,jr) - 1), mi1(iirnf(jl,jr) - 1)
+                           DO jn = 1, 3 
+                              zcoefr(ji,jj,jn) = MAX( zrup3, zcoefr(ji,jj,jn) )
+                           END DO
+                        END DO
+                     END DO
+                     ! ji,jj-2
+                     DO jj = mj0(ijrnf(jl,jr) - 2), mj1(ijrnf(jl,jr) - 2)
+                        DO ji = mi0(iirnf(jl,jr)    ), mi1(iirnf(jl,jr)    )
+                           DO jn = 1, 3 
+                              zcoefr(ji,jj,jn) = MAX( zrup3, zcoefr(ji,jj,jn) )
+                           END DO
+                        END DO
+                     END DO
+                     ! ji,jj+2
+                     DO jj = mj0(ijrnf(jl,jr) + 2), mj1(ijrnf(jl,jr) + 2)
+                        DO ji = mi0(iirnf(jl,jr)    ), mi1(iirnf(jl,jr)    )
+                           DO jn = 1, 3
+                              zcoefr(ji,jj,jn) = MAX( zrup3, zcoefr(ji,jj,jn) )
+                           END DO
+                        END DO
+                     END DO
+                     ! ji+1,jj-2
+                     DO jj = mj0(ijrnf(jl,jr) - 2), mj1(ijrnf(jl,jr) - 2)
+                        DO ji = mi0(iirnf(jl,jr) + 1), mi1(iirnf(jl,jr) + 1)
+                           DO jn = 1, 3 
+                              zcoefr(ji,jj,jn) = MAX( zrup3, zcoefr(ji,jj,jn) )
+                           END DO
+                        END DO
+                     END DO
+                     ! ji+1,jj+2
+                     DO jj = mj0(ijrnf(jl,jr) + 2), mj1(ijrnf(jl,jr) + 2)
+                        DO ji = mi0(iirnf(jl,jr) + 1), mi1(iirnf(jl,jr) + 1)
+                           DO jn = 1, 3 
+                              zcoefr(ji,jj,jn) = MAX( zrup3, zcoefr(ji,jj,jn) )
+                           END DO
+                        END DO
+                     END DO
+                     ! ji+2,jj-2
+                     DO jj = mj0(ijrnf(jl,jr) - 2), mj1(ijrnf(jl,jr) - 2)
+                        DO ji = mi0(iirnf(jl,jr) + 2), mi1(iirnf(jl,jr) + 2)
+                           DO jn = 1, 3 
+                              zcoefr(ji,jj,jn) = MAX( zrup3, zcoefr(ji,jj,jn) )
+                           END DO
+                        END DO
+                     END DO
+                     ! ji+2,jj+2
+                     DO jj = mj0(ijrnf(jl,jr) + 2), mj1(ijrnf(jl,jr) + 2)
+                        DO ji = mi0(iirnf(jl,jr) + 2), mi1(iirnf(jl,jr) + 2)
+                           DO jn = 1, 3  
+                              zcoefr(ji,jj,jn) = MAX( zrup3, zcoefr(ji,jj,jn) )
+                           END DO
+                        END DO
+                     END DO
+                     ! ji+2,jj-1
+                     DO jj = mj0(ijrnf(jl,jr) - 1), mj1(ijrnf(jl,jr) - 1)
+                        DO ji = mi0(iirnf(jl,jr) + 2), mi1(iirnf(jl,jr) + 2)
+                           DO jn = 1, 3
+                              zcoefr(ji,jj,jn) = MAX( zrup3, zcoefr(ji,jj,jn) )
+                           END DO
+                        END DO
+                     END DO
+                     ! ji+2,jj+1
+                     DO jj = mj0(ijrnf(jl,jr) + 1), mj1(ijrnf(jl,jr) + 1)
+                        DO ji = mi0(iirnf(jl,jr) + 2), mi1(iirnf(jl,jr) + 2)
+                           DO jn = 1, 3 
+                              zcoefr(ji,jj,jn) = MAX( zrup3, zcoefr(ji,jj,jn) )
+                           END DO
+                        END DO
+                     END DO
+                     ! ji+2,jj
+                     DO jj = mj0(ijrnf(jl,jr)    ), mj1(ijrnf(jl,jr)    )
+                        DO ji = mi0(iirnf(jl,jr) + 2), mi1(iirnf(jl,jr) + 2)
+                           DO jn = 1, 3
+                              zcoefr(ji,jj,jn) = MAX( zrup3, zcoefr(ji,jj,jn) )
+                           END DO
+                        END DO
+                     END DO
+                     ! ji-2,jj
+                     DO jj = mj0(ijrnf(jl,jr)    ), mj1(ijrnf(jl,jr)    )
+                        DO ji = mi0(iirnf(jl,jr) - 2), mi1(iirnf(jl,jr) - 2)
+                           DO jn = 1, 3        
+                              zcoefr(ji,jj,jn) = MAX( zrup3, zcoefr(ji,jj,jn) )
+                           END DO
+                        END DO
+                     END DO
+                     ! ji-2,jj-2
+                     DO jj = mj0(ijrnf(jl,jr) - 2), mj1(ijrnf(jl,jr) - 2)
+                        DO ji = mi0(iirnf(jl,jr) - 2), mi1(iirnf(jl,jr) - 2)
+                           DO jn = 1, 3 
+                              zcoefr(ji,jj,jn) = MAX( zrup3, zcoefr(ji,jj,jn) )
+                           END DO
+                        END DO
+                     END DO
+                     ! ji-2,jj+2
+                     DO jj = mj0(ijrnf(jl,jr) + 2), mj1(ijrnf(jl,jr) + 2)
+                        DO ji = mi0(iirnf(jl,jr) - 2), mi1(iirnf(jl,jr) - 2)
+                           DO jn = 1, 3
+                              zcoefr(ji,jj,jn) = MAX( zrup3, zcoefr(ji,jj,jn) )
+                           END DO
+                        END DO
+                     END DO
+                     ! ji-2,jj-1
+                     DO jj = mj0(ijrnf(jl,jr) - 1), mj1(ijrnf(jl,jr) - 1)
+                        DO ji = mi0(iirnf(jl,jr) - 2), mi1(iirnf(jl,jr) - 2)
+                           DO jn = 1, 3 
+                              zcoefr(ji,jj,jn) = MAX( zrup3, zcoefr(ji,jj,jn) )
+                           END DO
+                        END DO
+                     END DO
+                     ! ji-2,jj+1
+                     DO jj = mj0(ijrnf(jl,jr) + 1), mj1(ijrnf(jl,jr) + 1)
+                        DO ji = mi0(iirnf(jl,jr) - 2), mi1(iirnf(jl,jr) - 2)
+                           DO jn = 1, 3 
+                              zcoefr(ji,jj,jn) = MAX( zrup3, zcoefr(ji,jj,jn) )
+                           END DO
+                        END DO
+                     END DO
+                  END DO
+               ENDIF
+            END DO
+            upsrnfh(:,:) = zcoefr(:,:,1)
+            upsrnfz(:)   = 0.e0
+            upsrnfz(1)   = zrup1
+            upsrnfz(2)   = zrup1
+            upsrnfz(3)   = zrup1
+            upsrnfz(4)   = zrup2
+            upsrnfz(5)   = zrup3
+         ENDIF
+      ENDIF
+    
+#endif
+
+   END SUBROUTINE flx_rnf
Index: /trunk/NEMO/OPA_SRC/SBC/sbcrnf_ORCA_R2.h90
===================================================================
--- /trunk/NEMO/OPA_SRC/SBC/sbcrnf_ORCA_R2.h90	(revision 702)
+++ /trunk/NEMO/OPA_SRC/SBC/sbcrnf_ORCA_R2.h90	(revision 702)
@@ -0,0 +1,1340 @@
+   !!----------------------------------------------------------------------
+   !!                    ***  flxrnf_ORCA_R2.h90  ***
+   !!----------------------------------------------------------------------
+
+   !!----------------------------------------------------------------------
+   !!                  OLD ORCA R2 runoff specification
+   !!                      kept here for memory
+   !!                         ( 20/04/2000 )
+   !!----------------------------------------------------------------------
+   !! History :         !  94-10  (G.Madec, M. Pontaud, M. Imbard)  Original code
+   !!                   !  97-03  (G.Madec)  time dependent version
+   !!                   !  98-06  (J.M. Molines)  exact computation of zxy 
+   !!                                      for months that are not 30 days
+   !!                   !  98-07  (M. Imbard)  ORCA and mpp option
+   !!                   !  99-08  (J.P. Boulanger H.L.Ayina)  New rivers and 
+   !!                                                   values given in m3/s 
+   !!                   !  00-04  (G. Madec, K. Roberts) add antarctica ice discharge.
+   !!----------------------------------------------------------------------
+   !! References : 
+   !!       J. D. Milliman and R. H. Meade, 1983 : world-wide delivery
+   !!          of river sediment to the oceans, journal of geology vol 91
+   !!          pp 1-21.
+   !!       G. L. Russell and J. R. Miller, 1990 : global river runoff
+   !!          calculated from a global atmospheric general circulation
+   !!          model, journal of hydrology, 117(1990), pp 241-254.
+   !!       F. Van Der Leeden, Troise F. L., Todd D. K. : the water
+   !!          encyclopedia, second edition, lewis publishers.
+   !!       J. W. Weatherly, J. E. Walsh : The effects of precipitation
+   !!          and river runoff in a coupled ice-ocean model of Arctic
+   !!          Climate dynamics 1996 12:785,798
+   !!       Jacobs et al. 1992. J. Glaciol. 38 (130) 375-387.
+   !!----------------------------------------------------------------------
+   !!  OPA 9.0 , LOCEAN-IPSL (2005) 
+   !! $Header: /home/opalod/NEMOCVSROOT/NEMO/OPA_SRC/SBC/flxrnf_ORCA_R2.h90,v 1.2 2005/03/27 18:35:13 opalod Exp $ 
+   !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt 
+   !!----------------------------------------------------------------------
+      !!----------------------------------------------------------------------
+      INTEGER :: kt
+      INTEGER, PARAMETER ::   &
+         jpmois =  12,        &  ! number of months
+         jpriv  = 120,        &  ! maximum number of river
+         jpcoef = 300            ! maximum of river mouth grid-points
+      INTEGER ::   &
+         ji, jj, jl, jm,      &  ! dummy loop indices
+         jn, jr, jc              !    "         "
+      INTEGER ::   &
+         i15, imois, iman,    &  ! temporary integers
+         inbp, idbd, idmeom,  &  !    "          "
+         iipt0, iipt1, ijpt0, &  !    "          "
+         ijpt1, ii, ij           !    "          "
+      INTEGER, DIMENSION(jpriv) ::   &
+         inb                     ! ???
+      INTEGER, DIMENSION(jpcoef,jpriv) ::   &
+         iirnf, ijrnf            ! ???
+
+      REAL(wp) ::   &
+         zconv, zxy,          &  ! temporary scalars
+         zrup1, zrup2, zrup3     !    "         "
+      REAL(wp), DIMENSION(jpmois,jpriv) ::   &
+         zrnfm                   ! ???
+      REAL(wp), DIMENSION(jpi, jpj, 5) ::   &
+         zcoefr                  ! ???
+
+      ! ====
+      ! DATA
+      ! ====
+
+      ! I NORTH AMERICA
+      ! ---------------
+
+      ! 1-Saint Lawrence (Canada) 49N30 67W00               R2
+      ! Old=447 km3/year=14165m3/s; CLIPPER=12430m3/s; ratio=1.14
+      ! --> 13975.249m3/s
+      DATA inb(1)/2/
+      DATA (iirnf(jc,1),jc=1,jpcoef)/ 110, 110, 298*0 /
+      DATA (ijrnf(jc,1),jc=1,jpcoef)/ 110, 111, 298*0 /
+      DATA (zrnfm(jm,1),jm=1,jpmois)/   &
+          11718.,  11971.,  12466.,  14980.,  19257.,  16913.,   &
+          14211.,  13119.,  13367.,  13644.,  13463.,  12594./
+      ! 2-Hudson River (USA) 41N00 77W00                    R1
+      ! Old=12 km3/year=380m3/s; UNESCO(64-83,p255)=408m3/s
+      ! --> 407.416687m3/s
+      DATA inb(2)/1/
+      DATA (iirnf(jc,2),jc=1,jpcoef)/ 106, 299*0 /
+      DATA (ijrnf(jc,2),jc=1,jpcoef)/ 104, 299*0 /
+      DATA (zrnfm(jm,2),jm=1,jpmois)/   &
+          364.,    404.,    648.,    873.,    593.,    301.,   &
+          205.,    171.,    205.,    290.,    379.,    456./
+      ! 3-Missisipi and Atchafalaya (USA) 29N 90W           R1 
+      ! Old=580 km3/year=18380m3/s; CLIPPER=17599m3/s
+      ! --> 17599.334m3/s
+      DATA inb(3)/2/
+      DATA (iirnf(jc,3),jc=1,jpcoef)/  97, 98, 298*0 /
+      DATA (ijrnf(jc,3),jc=1,jpcoef)/  97, 97, 298*0 /
+      DATA (zrnfm(jm,3),jm=1,jpmois)/   &
+          19260.,  20813.,  23026.,  28160.,  26510.,  19650.,   &
+          14181.,  10676.,   9578.,  10167.,  11699.,  17472./
+      ! 4-Brazos (USA) 29N58 95W53                          R1
+      ! Old=7 km3/year=222m3/s; UNESCO(65-84, p298)=200m3/s
+      ! --> 199.666656m3/s
+      DATA inb(4)/1/
+      DATA (iirnf(jc,4),jc=1,jpcoef)/  95, 299*0 /
+      DATA (ijrnf(jc,4),jc=1,jpcoef)/  97, 299*0 /
+      DATA (zrnfm(jm,4),jm=1,jpmois)/   &
+          165.,    224.,    200.,    266.,    457.,    327.,   &
+          143.,     69.,    102.,    132.,    160.,    151./
+      ! 5-Colorado (Mexico) 31N54 114W57                    R5
+      ! Old=20 km3/year=634m3/s
+      ! --> 634.m3/s
+      DATA inb(5)/1/
+      DATA (iirnf(jc,5),jc=1,jpcoef)/  88, 299*0 /
+      DATA (ijrnf(jc,5),jc=1,jpcoef)/  94, 299*0 /
+      DATA (zrnfm(jm,5),jm=1,jpmois)/12*634./ 
+      ! 6-Columbia (USA) 45N60 121W17                       R1
+      ! Old=251 km3/year=7954m3/s; UNESCO(65-84, p312)=5368m3/s
+      ! --> 5368.41602m3/s
+      DATA inb(6)/1/
+      DATA (iirnf(jc,6),jc=1,jpcoef)/  79, 299*0 /
+      DATA (ijrnf(jc,6),jc=1,jpcoef)/ 110, 299*0 /
+      DATA (zrnfm(jm,6),jm=1,jpmois)/   &
+          4752.,    5077.,    5633.,    6075.,    8422.,    9822.,   &
+          6350.,    4112.,    3273.,    3251.,    3548.,    4106./ 
+      ! 7-Fraser (USA)                                      R5
+      ! Old=112 km3/year=3550m3/s;not found in UNESCO
+      ! --> 3549.99976m3/s
+      DATA inb(7)/1/
+      DATA (iirnf(jc,7),jc=1,jpcoef)/  77, 299*0 /
+      DATA (ijrnf(jc,7),jc=1,jpcoef)/ 112, 299*0 /
+      DATA (zrnfm(jm,7),jm=1,jpmois)/12*3550./ 
+      ! 8-Yukon (USA) 63N00 165W00                          R3
+      ! Old=195 km3/year=6179m3/s; UNESCO(65-77+80-84, p321)=4245; ratio=1.46
+      ! --> 6017.24951m3/s
+      DATA inb(8)/1/
+      DATA (iirnf(jc,8),jc=1,jpcoef)/  58, 299*0 /
+      DATA (ijrnf(jc,8),jc=1,jpcoef)/ 122, 299*0 /
+      DATA (zrnfm(jm,8),jm=1,jpmois)/   &
+           1459.,    1213.,    1065.,    1100.,    9067.,   17675.,   &
+          10680.,   11271.,    8658.,    5453.,    2649.,    1917./ 
+     ! 9-Copper (USA) 61N47 144W45                          R2
+     ! Old=39 km3/year=1236m3/s; UNESCO(65-84, p317)=1052m3/s; ratio=1.18
+     ! --> 1236.25m3/s
+      DATA inb(9)/1/
+      DATA (iirnf(jc,9),jc=1,jpcoef)/  67, 299*0 /
+      DATA (ijrnf(jc,9),jc=1,jpcoef)/ 119, 299*0 /
+      DATA (zrnfm(jm,9),jm=1,jpmois)/   &
+           219.,    195.,    181.,    214.,    904.,   2532.,   &
+          4026.,   3627.,   1632.,    697.,    354.,    254./ 
+      ! 10-Susitna (USA)                                    R5
+      ! Old=40 km3/year=1268m3/s
+      ! --> 1268.m3/s
+      DATA inb(10)/1/
+      DATA (iirnf(jc,10),jc=1,jpcoef)/  65, 299*0 /
+      DATA (ijrnf(jc,10),jc=1,jpcoef)/ 118, 299*0 /
+      DATA (zrnfm(jm,10),jm=1,jpmois)/12*1268./ 
+      ! 11-McKenzie (Canada) 70N00 135W00                   R3
+      ! Old=306 km3/year=9697m3/s; UNESCO(67+72+7479+82-84, p168)=8343m3/s;
+      ! ratio=1.16
+      ! --> 9606.66797m3/s
+      DATA inb(11)/1/
+      DATA (iirnf(jc,11),jc=1,jpcoef)/  69, 299*0 /
+      DATA (ijrnf(jc,11),jc=1,jpcoef)/ 131, 299*0 /
+      DATA (zrnfm(jm,11),jm=1,jpmois)/   &
+           3644.,    3400.,    3258.,    3546.,   14188.,   21544.,   &
+          18954.,   15487.,   11284.,   10169.,    5901.,    3905./
+      ! 12-Kuksokwim (USA) 60N00 ~162W30                    R4
+      ! UNESCO(65-84, p318)=1112m3/s (61N87 158E10, Crooked Creek, inland)
+      ! --> 1111.99988m3/s
+      DATA inb(12)/1/
+      DATA (iirnf(jc,12),jc=1,jpcoef)/  60, 299*0 /
+      DATA (ijrnf(jc,12),jc=1,jpcoef)/ 118, 299*0 /
+      DATA (zrnfm(jm,12),jm=1,jpmois)/   &
+          335.,     308.,     295.,     407.,    2415.,    2027.,   &
+          1917.,   2049.,    1585.,    1072.,     545.,     389./     
+
+      DATA inb(13)/0/
+      DATA inb(14)/0/
+      DATA inb(15)/0/
+
+      ! Total run-offs(I)=60974.2539m3/s
+
+      ! II SOUTH AMERICA
+      ! -----------------
+      ! 16-Chira (Peru) 4s54 81w08                          R2
+      ! Old=5 km3/year=158m3/s; UNESCO (65-68, p357)=80.9; ratio=1.95
+      ! --> 158.000015m3/s
+      DATA inb(16)/1/
+      DATA (iirnf(jc,16),jc=1,jpcoef)/ 101, 299*0 /
+      DATA (ijrnf(jc,16),jc=1,jpcoef)/  66, 299*0 /
+      DATA (zrnfm(jm,16),jm=1,jpmois)/   &
+          70.,     105.,     564.,     582.,     230.,      94.,   &
+          87.,      47.,      35.,      32.,      29.,      21./
+      ! 17-Magdalena (Colombia) 11N06 74W51                 R2
+      ! Old=237 km3/year=7510m3/s; UNESCO(71-73+76-79, p348)=6973m3/s;
+      ! ratio=1.08
+      ! --> 7451.58301m3/s
+      DATA inb(17)/1/
+      DATA (iirnf(jc,17),jc=1,jpcoef)/ 104, 299*0 /
+      DATA (ijrnf(jc,17),jc=1,jpcoef)/  86, 299*0 /
+      DATA (zrnfm(jm,17),jm=1,jpmois)/   &
+          6598.,    4441.,    4087.,    5445.,    7380.,    8067.,   &
+          8509.,    7428.,    7631.,    9296.,   10588.,    9949./
+      ! 18-Orinoco (Venezuela) 8N37 62W15!                  R1
+      ! Old=1100 km3/year=34857m3/s; UNESCO(73-75, p364)=28736m3/s;
+      ! HLA=26371m3/s
+      ! Data from HLA: 8.1N - 63.3W   1925/89
+      ! --> 26371.416
+      DATA inb(18)/1/
+      DATA (iirnf(jc,18),jc=1,jpcoef)/ 112, 299*0 /
+      DATA (ijrnf(jc,18),jc=1,jpcoef)/  86, 299*0 /
+      DATA (zrnfm(jm,18),jm=1,jpmois)/   &
+          10670.,    7513.,    6344.,    6887.,   13086.,   26699.,   &
+          43938.,   59957.,   57435.,   39951.,   27410.,   16567./ 
+      ! 19-Amazon (Brazil) 0S05 50W00                       R1
+      ! Old=6300 km3/year=199634m3/s; CLIPPER=166192m3/s~UNESCO;
+      ! HLA=184806m3/s
+      ! UNESCO data are at Obidos which is far inland and therefore does not
+      ! fully represent the actual discharge
+      ! Data from HLA: 1.5N - 55.3W   1970/96
+      ! --> 184845.484m3/s
+      DATA inb(19)/2/
+      DATA (iirnf(jc,19),jc=1,jpcoef)/ 117, 117, 298*0 /
+      DATA (ijrnf(jc,19),jc=1,jpcoef)/  75,  76, 298*0 /
+      DATA (zrnfm(jm,19),jm=1,jpmois)/   &
+          152233., 176415., 199941., 225565., 244016., 244861.,   &
+          230711., 203128., 164531., 128486., 118214., 130045. /
+      ! 20-Sao Francisco (Brazil) 10S30 36W24               R1
+      ! Old=97 km3/year=3074m3/s; UNESCO(77-79, p338)=2645m3/s
+      ! --> 2645.3335m3/s
+      DATA inb(20)/1/
+      DATA (iirnf(jc,20),jc=1,jpcoef)/ 123, 299*0 /
+      DATA (ijrnf(jc,20),jc=1,jpcoef)/  59, 299*0 /
+      DATA (zrnfm(jm,20),jm=1,jpmois)/   &
+          3244.,   4116.,   5139.,   4330.,   2323.,   1800.,   &
+          1587.,   1511.,   1593.,   1740.,   2190.,   2171. /
+      ! 21-Parana+Uruguay(Arg./Uru.) 34S12 58W18            R1 
+      ! Old=470 km3/year=14893m3/s; UNESCO(p323/324)=22263m3/s
+      ! --> 22203.168m3/s 
+      DATA inb(21)/2/
+      DATA (iirnf(jc,21),jc=1,jpcoef)/ 114, 114, 298*0 /
+      DATA (ijrnf(jc,21),jc=1,jpcoef)/  46,  47, 298*0 /
+      DATA (zrnfm(jm,21),jm=1,jpmois)/   &
+          24803.,   26836.,   24585.,   21358.,   20041.,   21689.,   &
+          22647.,   20403.,   19627.,   21400.,   21126.,   21923./
+      ! 22-Negro (Argentina)  41S02  62W47                  R2
+      ! Old=30 km3/year=951m3/s; UNESCO(65-79,p330)=765m3/s; ratio=1.24
+      ! --> 907.666687m3/s
+      DATA inb(22)/1/
+      DATA (iirnf(jc,22),jc=1,jpcoef)/ 110, 299*0 /
+      DATA (ijrnf(jc,22),jc=1,jpcoef)/  43, 299*0 /
+      DATA (zrnfm(jm,22),jm=1,jpmois)/   &
+          882.,     587.,     519.,     482.,     623.,     984.,   &
+          1120.,   1294.,    1092.,    1166.,    1105.,    1038./
+     ! 23- Tocantins :  ~48W00 ~0.5S                        R4
+     ! UNESCO(76-77+80-81, p335)=12167m3/s (station far inland!)
+     ! --> 12173.082m3/s
+      DATA inb(23)/1/
+      DATA (iirnf(jc,23),jc=1,jpcoef)/118, 299*0 /
+      DATA (ijrnf(jc,23),jc=1,jpcoef)/ 73, 299*0 /
+      DATA (zrnfm(jm,23),jm=1,jpmois)/   &
+          15507.,  24855.,  27854.,  24257.,  15860.,   7861.,   &
+          4440.,   3082.,   2728.,   3417.,   5511.,  10705. /
+
+      DATA inb(24)/0/
+      DATA inb(25)/0/
+
+      ! Total run-offs(II)=256755.75
+      ! Total run-offs(I+II)=317730
+
+      ! III EUROPE
+      ! ----------
+      ! 26-Rhone (France) 43N20 4E50                        R1 
+      ! Old=49 km3/year=1553m3/s; UNESCO(65-83, p512)=1229
+      ! --> 1217.16663m3/s
+      DATA inb(26)/1/
+      DATA (iirnf(jc,26),jc=1,jpcoef)/ 150, 299*0 /
+      DATA (ijrnf(jc,26),jc=1,jpcoef)/ 108, 299*0 /
+      DATA (zrnfm(jm,26),jm=1,jpmois)/   &
+          1385.,    1848.,    1568.,    1311.,    1420.,    1191.,   &
+           937.,     796.,     794.,     962.,    1161.,    1233./
+      ! 27-Po (Italy) 11N10 1W09                            R1 
+      ! Old=46 km3/year=1458m3/s; UNESCO(65-84, p527)=1550m3/s
+      ! --> 1550.08337m3/s
+      DATA inb(27)/1/
+      DATA (iirnf(jc,27),jc=1,jpcoef)/ 159, 299*0 /
+      DATA (ijrnf(jc,27),jc=1,jpcoef)/ 110, 299*0 /
+      DATA (zrnfm(jm,27),jm=1,jpmois)/   &
+          1304.,    1605.,    1856.,    1549.,    1958.,    1760.,   &
+          1040.,    1007.,    1615.,    1907.,    1772.,    1228./
+      ! 28-Danube (Roumania) 45N20 29E40                    R1 
+      ! Old=206 km3/year=6527m3/s; UNESCO(65-84, p544)=7011m3/s
+      ! --> 7011.8335m3/s
+      DATA inb(28)/1/
+      DATA (iirnf(jc,28),jc=1,jpcoef)/ 171, 299*0 /
+      DATA (ijrnf(jc,28),jc=1,jpcoef)/ 106, 299*0 /
+      DATA (zrnfm(jm,28),jm=1,jpmois)/   &
+          6625.,    7352.,    7986.,    9279.,    9482.,    8618.,   &
+          7586.,    6001.,    5210.,    4989.,    4921.,    6093./
+
+      DATA inb(29)/0/
+      DATA inb(30)/0/
+
+      ! Total run-offs(III)=9779.08301m3/s
+      ! Total run-offs(I+II+III)=327509.094m3/s
+
+      ! IV EURASIAN ARCTIC
+      ! ------------------
+      ! 31-Iana (Russia)                                    R1
+      ! Old=29 km3/year=919m3/s; UNESCO(65-72+74+76-84, p463)=936m3/s
+      ! --> 0m3/s
+      DATA inb(31)/0/
+      DATA (iirnf(jc,31),jc=1,jpcoef)/ 300*0 /
+      DATA (ijrnf(jc,31),jc=1,jpcoef)/ 300*0 /
+      DATA (zrnfm(jm,31),jm=1,jpmois)/   &
+             2.,       1.,       0.,       0.,     917.,    3514.,   &
+          2968.,    2329.,    1322.,     178.,      36.,       8./ 
+      ! 32-Ob (Russia) 66N45 69E30                          R1 
+      ! Old=385 km3/year=12200m3/s; UNESCO(65-84, p478)=12862m3/s
+      ! --> 12861.5m3/s
+      DATA inb(32)/2/
+      DATA (iirnf(jc,32),jc=1,jpcoef)/ 153, 153, 298*0 /
+      DATA (ijrnf(jc,32),jc=1,jpcoef)/ 146, 147, 298*0 /
+      DATA (zrnfm(jm,32),jm=1,jpmois)/   &
+           4977.,    4150.,    3611.,    3590.,   14723.,   33366.,   &
+          30773.,   22785.,   14701.,    9705.,    6078.,    5879./
+      ! 33-Yenesei (Russia) 71N50 82E40                     R1 
+      ! Old=560 km3/year=17745m3/s; UNESCO(65-84, p472)=17462m3/s
+      ! --> 17461.666m3/s
+      DATA inb(33)/1/
+      DATA (iirnf(jc,33),jc=1,jpcoef)/  32, 299*0 /
+      DATA (ijrnf(jc,33),jc=1,jpcoef)/ 147, 299*0 /
+      DATA (zrnfm(jm,33),jm=1,jpmois)/   &
+           6659.,    7007.,    6895.,    7089.,   24183.,   74965.,   &
+          25325.,   15940.,   16050.,   12678.,    6741.,    6008./
+     ! 34-Severnaya Dvina(Russia)64N32 40E30                R5 
+     ! Old=106 km3/year=3359m3/s; not in UNESCO data base
+     ! --> 3359.00024m3/s
+      DATA inb(34)/1/
+      DATA (iirnf(jc,34),jc=1,jpcoef)/ 153, 299*0 /
+      DATA (ijrnf(jc,34),jc=1,jpcoef)/ 133, 299*0 /
+      DATA (zrnfm(jm,34),jm=1,jpmois)/12*3359./
+      ! 35-Lena (Russia) 72N25 126E40                       R1 
+      ! --> 16192.333m3/s
+      DATA inb(35)/1/
+      DATA (iirnf(jc,35),jc=1,jpcoef)/  36, 299*0 /
+      DATA (ijrnf(jc,35),jc=1,jpcoef)/ 137, 299*0 /
+      DATA (zrnfm(jm,35),jm=1,jpmois)/   &
+           2663.,    2095.,    1629.,    1324.,    7203.,   64230.,   &
+          40810.,   28310.,   25995.,   13299.,    3673.,    3077./
+      ! 36-Kolyma (Russia) 69N30 161E00                     R1
+      ! Old=71 km3/year=2250m3/s; UNESCO(65-84)=2138m3/s
+      ! --> 2138.66675m3/s
+      DATA inb(36)/1/
+      DATA (iirnf(jc,36),jc=1,jpcoef)/  46, 299*0 /
+      DATA (ijrnf(jc,36),jc=1,jpcoef)/ 128, 299*0 /
+      DATA (zrnfm(jm,36),jm=1,jpmois)/   &
+           131.,      92.,      76.,      65.,    2576.,    9143.,   &
+          4670.,    3727.,    3226.,    1119.,     630.,     209./
+     ! 37-Indigirka (russia) 70N48 148E54                   R1 
+     ! Old=55 km3/year=1743m3/s; UNESCO(65-68+70+72-84)=1622.
+     ! --> 1622.00012m3/s
+      DATA inb(37)/1/
+      DATA (iirnf(jc,37),jc=1,jpcoef)/  42, 299*0 /
+      DATA (ijrnf(jc,37),jc=1,jpcoef)/ 131, 299*0 /
+      DATA (zrnfm(jm,37),jm=1,jpmois)/   &
+            32.,      17.,      11.,       7.,     354.,    5629.,   &
+          5210.,    4617.,    2823.,     559.,     142.,      63./
+
+      DATA inb(38)/0/
+      DATA inb(39)/0/
+      DATA inb(40)/0/
+
+      ! Total run-offs(IV)=40773.6641m3/s
+      ! Total run-offs(I+II+III+IV)=368282.75m3/s
+
+      ! V ASIA
+      ! ------
+      ! 41-Amur (Russia) 52N56 141E10                       R2
+      ! Old=325 km3/year=10299m3/s; UNESCO(65-84, p451)=8792m3/s; ratio=1.17
+      ! --> 10299.332m3/s
+      DATA inb(41)/1/
+      DATA (iirnf(jc,41),jc=1,jpcoef)/  33, 299*0 /
+      DATA (ijrnf(jc,41),jc=1,jpcoef)/ 116, 299*0 /
+      DATA (zrnfm(jm,41),jm=1,jpmois)/   &
+           2108.,    1543.,    1252.,    4088.,   15464.,   17336.,   &
+          16100.,   20801.,   21548.,   15658.,    5188.,    2506./
+      ! 42-Liaohe (China) 40N40 122E09                      R5
+      ! Old=6 km3/year=190m3/s; not found in UNESCO data base
+      ! --> 189.999985m3/s
+      DATA inb(42)/1/
+      DATA (iirnf(jc,42),jc=1,jpcoef)/  22, 299*0 /
+      DATA (ijrnf(jc,42),jc=1,jpcoef)/ 104, 299*0 /
+      DATA (zrnfm(jm,42),jm=1,jpmois)/12*190./
+      ! 43-Daling (China) 40N56 121E43                      R5
+      ! Old=1 km3/year=32m3/s; not found in UNESCO data base
+      ! --> 31.9999962m3/s
+      DATA inb(43)/1/
+      DATA (iirnf(jc,43),jc=1,jpcoef)/  24, 299*0 /
+      DATA (ijrnf(jc,43),jc=1,jpcoef)/ 104, 299*0 /
+      DATA (zrnfm(jm,43),jm=1,jpmois)/12*32./
+      ! 44-Haiho (China) 6N17   1E23
+      ! Old=2 km3/year=64m3/s; not found in UNESCO data base
+      ! --> 63.9999924m3/s
+      DATA inb(44)/1/
+      DATA (iirnf(jc,44),jc=1,jpcoef)/  28, 299*0 /
+      DATA (ijrnf(jc,44),jc=1,jpcoef)/ 106, 299*0 /
+      DATA (zrnfm(jm,44),jm=1,jpmois)/12*64./
+      ! 45-Yellow/Huangho (China) 37N32 118E19              R2 
+      ! Old=49 km3/year=1553m3/s; UNESCO(p371)=1210m3/s; ratio=1.28
+      ! --> 1552.5m3/s
+      DATA inb(45)/1/
+      DATA (iirnf(jc,45),jc=1,jpcoef)/  22, 299*0 /
+      DATA (ijrnf(jc,45),jc=1,jpcoef)/ 103, 299*0 /
+      DATA (zrnfm(jm,45),jm=1,jpmois)/   &
+           697.,     674.,    1282.,    1206.,    1109.,     778.,   &
+          1964.,    3270.,    3668.,    2133.,     978.,     871./
+      ! 46-Yangtze (China) 31N48 121E10=Changjiang          R2
+      ! Old=900 km3/year=28520m3/s; UNESCO(p372)=25032m3/s; ratio=1.14
+      ! --> 28519.584m3/s
+      DATA inb(46)/1/
+      DATA (iirnf(jc,46),jc=1,jpcoef)/  23, 299*0 /
+      DATA (ijrnf(jc,46),jc=1,jpcoef)/  98, 299*0 /
+      DATA (zrnfm(jm,46),jm=1,jpmois)/   &
+          10994.,   10548.,   13254.,   24097.,   36972.,   47197.,   &
+          53891.,   42070.,   37627.,   30762.,   22046.,   12777./
+      ! 47-Pearl/Zhujiang (China) 23N36 106E34=Xijiang      R2 
+      ! Old=302 km3/year=9570m3/s; UNESCO(76,82, p373)=6987m3/s; ratio=1.37
+      ! --> 9570.75m3/s
+      DATA inb(47)/1/
+      DATA (iirnf(jc,47),jc=1,jpcoef)/  22, 299*0 /
+      DATA (ijrnf(jc,47),jc=1,jpcoef)/  95, 299*0 /
+      DATA (zrnfm(jm,47),jm=1,jpmois)/   &
+           2357.,    2415.,    2634.,    6446.,   14246.,   18395.,   &
+          19213.,   17558.,   12312.,    7255.,    5864.,    6154./
+      ! 48-Red/Hungho (Vietnam) 20N17 106E34                R5 
+      ! Old=123 km3/year=3897m3/s; not in UNESCO data base
+      ! --> 3897.m3/s
+      DATA inb(48)/1/
+      DATA (iirnf(jc,48),jc=1,jpcoef)/  16, 299*0 /
+      DATA (ijrnf(jc,48),jc=1,jpcoef)/  91, 299*0 /
+      DATA (zrnfm(jm,48),jm=1,jpmois)/12*3897./
+      ! 49-Mekong (Vietnam) 10N33 105E24                    R5
+      ! Old=470 km3/year=14893m3/s; not in UNESCO data base
+      ! --> 14893.0029m3/s
+      DATA inb(49)/2/
+      DATA (iirnf(jc,49),jc=1,jpcoef)/  16,  16, 298*0 /
+      DATA (ijrnf(jc,49),jc=1,jpcoef)/  86,  87, 298*0 /
+      DATA (zrnfm(jm,49),jm=1,jpmois)/12*14893./
+      ! 50-Irrawady (Burma) 15N50  95E06                    R5
+      ! Old=428 km3/year=13563m3/s; not in UNESCO data base
+      ! --> 13563.m3/s
+      DATA inb(50)/1/
+      DATA (iirnf(jc,50),jc=1,jpcoef)/  10, 299*0 /
+      DATA (ijrnf(jc,50),jc=1,jpcoef)/  90, 299*0 /
+      DATA (zrnfm(jm,50),jm=1,jpmois)/12*13563./
+      ! 51-Ganges+Brahmaputra (Beng.) 22N00  91E00          R1
+      ! Old=971 km3/year=30769m3/s; UNESCO(69-70+73-75, p367)=31760m3/s
+      ! --> 32147.498m3/s
+      DATA inb(51)/2/
+      DATA (iirnf(jc,51),jc=1,jpcoef)/   7,  8, 298*0 /
+      DATA (ijrnf(jc,51),jc=1,jpcoef)/  93, 93, 298*0 /
+      DATA (zrnfm(jm,51),jm=1,jpmois)/   &
+           6623.,    6315.,    6432.,    9410.,   17263.,   38302.,   &
+          64688.,   80338.,   84802.,   43387.,   17888.,   10322./
+      ! 52-Mehandi (India)                                  R5
+      ! Old=67 km3/year=2123m3/s; not in UNESCO data base
+      ! --> 0m3/s
+      DATA inb(52)/0/
+      DATA (iirnf(jc,52),jc=1,jpcoef)/ 300*0 /
+      DATA (ijrnf(jc,52),jc=1,jpcoef)/ 300*0 /
+      DATA (zrnfm(jm,52),jm=1,jpmois)/12*2123./
+      ! 53-Damodar (India)                                  R2
+      ! Old=10 km3/year=320m3/s; UNESCO(p386)=173m3/s; ratio=1.85
+      ! --> 432.916656m3/s
+      DATA inb(53)/1/
+      DATA (iirnf(jc,53),jc=1,jpcoef)/   6, 299*0 /
+      DATA (ijrnf(jc,53),jc=1,jpcoef)/  93, 299*0 /
+      DATA (zrnfm(jm,53),jm=1,jpmois)/   &
+           51.,      37.,      42.,      49.,      85.,     296.,   &
+          896.,    1390.,    1591.,     542.,     172.,      44./   
+      ! 54-Godavari (India) 17N00  81E45                    R2
+      ! Old=84 km3/year=2662m3/s; UNESCO(p379)=1916m3/s; ratio=1.39
+      ! --> 3670.5m3/s
+      DATA inb(54)/1/
+      DATA (iirnf(jc,54),jc=1,jpcoef)/   3, 299*0 /
+      DATA (ijrnf(jc,54),jc=1,jpcoef)/  90, 299*0 /
+      DATA (zrnfm(jm,54),jm=1,jpmois)/   &
+           988.,     737.,     280.,     219.,     196.,    1691.,   &
+          8063.,   14571.,   11428.,    3953.,    1221.,     699./   
+     ! 55-Indus (Pakistan) 24N20  67E47                     R2
+     ! Old=238 km3/year=7542m3/s; UNESCO (76-79, p428)=2396m3/s; ratio=3.15
+     ! --> 7562.m3/s
+      DATA inb(55)/2/
+      DATA (iirnf(jc,55),jc=1,jpcoef)/ 176, 176, 298*0 /
+      DATA (ijrnf(jc,55),jc=1,jpcoef)/  93,  94, 298*0 /
+      DATA (zrnfm(jm,55),jm=1,jpmois)/   &
+            988.,     737.,    1904.,    1968.,    3625.,    6143.,   &
+          15969.,    36656.,  17173.,    3215.,    1251.,    1115./   
+      ! 56-Tigris and Euphrates (Iraq) 31N00  47E25         R1
+      ! Old=46 km3/year=1458m3/s; UNESCO(76-79, p428)=2396m3/s
+      ! --> 2248.8335m3/s
+      DATA inb(56)/1/
+      DATA (iirnf(jc,56),jc=1,jpcoef)/ 172, 299*0 /
+      DATA (ijrnf(jc,56),jc=1,jpcoef)/  94, 299*0 /
+      DATA (zrnfm(jm,56),jm=1,jpmois)/   &
+          1872.,    2127.,    2962.,    4944.,    5036.,    3078.,   &
+          1362.,     900.,     786.,     993.,    1184.,    1742./   
+
+      DATA inb(57)/0/
+      DATA inb(58)/0/
+      DATA inb(59)/0/
+      DATA inb(60)/0/
+
+      ! Total run-offs (V)=128642.922m3/s
+      ! Total run-offs (I+II+III+IV+V)=496925.688m3/s
+      
+      ! VI AFRICA
+      ! ----------
+      ! 61-Nile (Egypt) 30N10  31E06                        R1
+      ! Old=30 km3/year=951m3/s; UNESCO(73-84)=1251m3/s
+      ! --> 1251.33337m3/s
+      DATA inb(61)/1/
+      DATA (iirnf(jc,61),jc=1,jpcoef)/ 176, 299*0 /
+      DATA (ijrnf(jc,61),jc=1,jpcoef)/  97, 299*0 /
+      DATA (zrnfm(jm,61),jm=1,jpmois)/   &
+          1239.,    1035.,    1126.,    1110.,    1170.,    1542.,   &
+          1742.,    1559.,    1191.,    1103.,    1075.,    1124./   
+      ! 62-Niger (Nigeria) 5N33   6E33                      R1
+      ! Old=192 km3/year=6084m3/s; HLA=5545m3/s;
+      ! Data from HLA: 4.5N -  6  E   1950/87
+      ! --> 5545.08301m3/s
+      DATA inb(62)/1/
+      DATA (iirnf(jc,62),jc=1,jpcoef)/ 146, 299*0 /
+      DATA (ijrnf(jc,62),jc=1,jpcoef)/  81, 299*0 /
+      DATA (zrnfm(jm,62),jm=1,jpmois)/   &
+          2029.,    1804.,    1573.,    1418.,    1494.,    2561.,   &
+          5272.,    9629.,   14951.,   16227.,    6842.,    2741./   
+      ! 63-Zaire/Congo (Congo) 6S04  12E24                  R1      
+      ! Old=1250 km3/year=39610m3/s; UNESCO(65-83, p149)=41941m3/s; HLA
+      ! =39720m3/s
+      ! Data from HLA: 6S - 12  E   1902/96
+      ! --> 39719.5m3/s
+      DATA inb(63)/2/
+      DATA (iirnf(jc,63),jc=1,jpcoef)/ 148, 148, 298*0 /
+      DATA (ijrnf(jc,63),jc=1,jpcoef)/  63,  64, 298*0 /
+      DATA (zrnfm(jm,63),jm=1,jpmois)/   &
+          47200.,   37692.,   34374.,   36603.,   37862.,   35588.,   &
+          30966.,   30774.,   35981.,   42825.,   51455.,   55314./  
+      ! 64-Orange (Sth Africa) 28S41 16E28                  R5
+      ! Old=11 km3/year=349m3/s
+      ! --> 349.000031m3/s
+      DATA inb(64)/1/
+      DATA (iirnf(jc,64),jc=1,jpcoef)/ 150, 299*0 /
+      DATA (ijrnf(jc,64),jc=1,jpcoef)/  51, 299*0 /
+      DATA (zrnfm(jm,64),jm=1,jpmois)/12*349./
+      ! 65-Zambesi (Mozambique) 18S55 36E04                 R5
+      ! Old=223 km3/year=7066m3/s
+      ! --> 7066.00049m3/s
+      DATA inb(65)/1/
+      DATA (iirnf(jc,65),jc=1,jpcoef)/ 160, 299*0 /
+      DATA (ijrnf(jc,65),jc=1,jpcoef)/  56, 299*0 /
+      DATA (zrnfm(jm,65),jm=1,jpmois)/12*7066./
+      ! 66-Limpopo (mozambique) 25S15 33E30                 R5
+      ! Old=5 km3/year=158m3/s
+      ! --> 158.m3/s
+      DATA inb(66)/1/
+      DATA (iirnf(jc,66),jc=1,jpcoef)/ 159, 299*0 /
+      DATA (ijrnf(jc,66),jc=1,jpcoef)/  52, 299*0 /
+      DATA (zrnfm(jm,66),jm=1,jpmois)/12*158./
+      ! 67-Rufiji (tanzania) 8S00 39E20                     R5
+      ! Old=9 km3/year=285m3/s
+      ! --> 285.m3/s
+      DATA inb(67)/1/
+      DATA (iirnf(jc,67),jc=1,jpcoef)/ 162, 299*0 /
+      DATA (ijrnf(jc,67),jc=1,jpcoef)/  62, 299*0 /
+      DATA (zrnfm(jm,67),jm=1,jpmois)/12*285./
+      ! Other rivers from the Gulf of Guinea
+      ! 68-Kouilou (Congo)  4.5S-11.5E (UNESCO=p51)         R1
+      ! Data from HLA:  4S - 11  E   1953/86 = 919m3/s
+      ! --> 924.25m3/s
+      DATA inb(68)/1/
+      DATA (iirnf(jc,68),jc=1,jpcoef)/ 147, 299*0 /
+      DATA (ijrnf(jc,68),jc=1,jpcoef)/  67, 299*0 /
+      DATA (zrnfm(jm,68),jm=1,jpmois)/   &
+          1115.,    1166.,    1285.,    1462.,    1454.,     725.,   &
+           480.,     378.,     327.,     400.,    1018.,    1281./
+      ! 69-Nyanga (Gabon)  3S-10E (UNESCO=p66)              R1
+      ! Data from HLA: 2.8N - 10  E   1952/82 = 264m3/s
+      ! --> 264.166687m3/s
+      DATA inb(69)/1/
+      DATA (iirnf(jc,69),jc=1,jpcoef)/ 147, 299*0 /
+      DATA (ijrnf(jc,69),jc=1,jpcoef)/  68, 299*0 /
+      DATA (zrnfm(jm,69),jm=1,jpmois)/   &
+          126.,      99.,     143.,     253.,     316.,     300.,   &
+          156.,      93.,     231.,     557.,     592.,     304./
+      ! 70-Ogoue (Gabon) 1S-9E (UNESCO, p69)                R1
+      ! Data from HLA: .75S -  9  E   1930/90 = 4512m3/s
+      ! --> 4511.83301m3/s
+      DATA inb(70)/1/
+      DATA (iirnf(jc,70),jc=1,jpcoef)/ 146, 299*0 /
+      DATA (ijrnf(jc,70),jc=1,jpcoef)/  72, 299*0 /
+      DATA (zrnfm(jm,70),jm=1,jpmois)/   &
+          4514.,    3988.,    4622.,    5403.,    5790.,    4145.,   &
+          2616.,    1961.,    2119.,    4304.,    7870.,    6810./
+      ! 71-Sanaga (Cameroun) 3.5N-9.5E (UNESCO, p31)        R1
+      ! Data from HLA: 3.9N -  9.6E   1944/80 = 1983m3/s
+      ! --> 1982.58337m3/s
+      DATA inb(71)/1/
+      DATA (iirnf(jc,71),jc=1,jpcoef)/ 146, 299*0 /
+      DATA (ijrnf(jc,71),jc=1,jpcoef)/  81, 299*0 /
+      DATA (zrnfm(jm,71),jm=1,jpmois)/   &
+           813.,     578.,     517.,     633.,     909.,    1278.,   &
+          1928.,    2653.,    4361.,    5470.,    3307.,    1344./
+      ! 72-Nyong (Cameroun) 3.1N-9.5E (UNESCO, p36)         R1
+      ! Data from HLA: 3.5N -  9.8E   1951/84 = 432m3/s
+      ! --> 431.166656m3/s      
+      DATA inb(72)/1/
+      DATA (iirnf(jc,72),jc=1,jpcoef)/ 146, 299*0 /
+      DATA (ijrnf(jc,72),jc=1,jpcoef)/  80, 299*0 /
+      DATA (zrnfm(jm,72),jm=1,jpmois)/   &
+          232.,     128.,     150.,     266.,     402.,     459.,   &
+          353.,     306.,     604.,     930.,     878.,     466./
+      ! 73-Ntem (Cameroun) 2.5N-9.5E (UNESCO, p36)          R1
+      ! Data from HLA: 3N -  9.8E   1951/87 = 330m3/s      
+      ! --> 329.75m3/s
+      DATA inb(73)/1/
+      DATA (iirnf(jc,73),jc=1,jpcoef)/ 146, 299*0 /
+      DATA (ijrnf(jc,73),jc=1,jpcoef)/  79, 299*0 /
+      DATA (zrnfm(jm,73),jm=1,jpmois)/   &
+          452.,     455.,     492.,     466.,     482.,     251.,   &
+          151.,     108.,      87.,     133.,     395.,     485./
+      ! 74-Wouri (Cameroun) 4N-9.5E (UNESCO, p34)           R1
+      ! Data from HLA: 4N -  9.5E   1951/84  = 307m3/s
+      ! --> 306.583374m3/s
+      DATA inb(74)/1/
+      DATA (iirnf(jc,74),jc=1,jpcoef)/ 145, 299*0 /
+      DATA (ijrnf(jc,74),jc=1,jpcoef)/  81, 299*0 /
+      DATA (zrnfm(jm,74),jm=1,jpmois)/   &
+           88.,      63.,      68.,      95.,     139.,     222.,   &
+          395.,     633.,     825.,     675.,     328.,     148./
+      ! 75-Oueme (Benin) 6.5N-2.5E (UNESCO, p27)            R1
+      ! Data from HLA:  6.2N -  2.5E   1951/84 =113m3/s
+      ! --> 112.666664m3/s
+      DATA inb(75)/1/
+      DATA (iirnf(jc,75),jc=1,jpcoef)/ 144, 299*0 /
+      DATA (ijrnf(jc,75),jc=1,jpcoef)/  83, 299*0 /
+      DATA (zrnfm(jm,75),jm=1,jpmois)/   &
+           0.,       0.,       0.,       0.,       1.,      18.,   &
+          96.,     324.,     531.,     319.,      58.,       5./
+      ! 76-Mono(Tepetou,Benin/Togo) 6.25N-1.8E (U, p27)     R1
+      ! Data from HLA: 6.2N -  1  E   1951/85  = 96m3/s       
+      ! --> 96.4999924m3/s
+      DATA inb(76)/1/
+      DATA (iirnf(jc,76),jc=1,jpcoef)/ 143, 299*0 /
+      DATA (ijrnf(jc,76),jc=1,jpcoef)/  83, 299*0 /
+      DATA (zrnfm(jm,76),jm=1,jpmois)/   &
+            2.,       1.,       1.,       4.,       8.,      44.,   &
+          168.,     274.,     386.,     215.,      47.,       8./
+      ! 77-Comoe (Ivory Coast) 5N-4W (UNESCO, p56)          R1
+      ! Data from HLA: 5.1N -  4  W   1955/86 = 194m3/s       
+      ! --> 194.25m3/s
+      DATA inb(77)/1/
+      DATA (iirnf(jc,77),jc=1,jpcoef)/ 140, 299*0 /
+      DATA (ijrnf(jc,77),jc=1,jpcoef)/  82, 299*0 /
+      DATA (zrnfm(jm,77),jm=1,jpmois)/   &
+           14.,       7.,       9.,      17.,      29.,      90.,   &
+          145.,     349.,     740.,     688.,     198.,      45./
+      ! 78-Sassandra (Ivory Coast) 5N-6W (UNESCO, p58)      R1
+      ! Data from HLA: 5N -  6  W   1953/86 = 449m3/s
+      ! --> 449.333344m3/s
+      DATA inb(78)/1/
+      DATA (iirnf(jc,78),jc=1,jpcoef)/ 139, 299*0 /
+      DATA (ijrnf(jc,78),jc=1,jpcoef)/  82, 299*0 /
+      DATA (zrnfm(jm,78),jm=1,jpmois)/   &
+          144.,     116.,     119.,     143.,     156.,     334.,   &
+          419.,     692.,    1277.,    1190.,     553.,     249./
+
+      DATA inb(79)/0/
+      DATA inb(80)/0/
+      DATA inb(82)/0/
+      DATA inb(83)/0/
+      DATA inb(84)/0/
+      DATA inb(85)/0/
+      DATA inb(86)/0/
+      DATA inb(87)/0/
+      DATA inb(88)/0/
+      DATA inb(89)/0/
+      DATA inb(90)/0/
+
+      ! Total run-offs (VI)=63977.m3/s
+      ! Total run-offs (I+II+III+IV+V+VI)=560902.688m3/s
+      
+      ! VII OCEANIA
+      ! ------------
+      ! 91-Murray (Austrlia) 35S34 138E54                   R5
+      ! Old=22 km3/year=697m3/s
+      ! --> 696.999939m3/s
+      DATA inb(91)/1/
+      DATA (iirnf(jc,91),jc=1,jpcoef)/  30, 299*0 /
+      DATA (ijrnf(jc,91),jc=1,jpcoef)/  47, 299*0 /
+      DATA (zrnfm(jm,91),jm=1,jpmois)/12*697./
+      ! 92-Haast (N. Zeland) 43S50 169E02                   R5
+      ! Old=6 km3/year=190m3/s
+      ! --> 189.999985m3/s
+      DATA inb(92)/1/
+      DATA (iirnf(jc,92),jc=1,jpcoef)/  48, 299*0 /
+      DATA (ijrnf(jc,92),jc=1,jpcoef)/  41, 299*0 /
+      DATA (zrnfm(jm,92),jm=1,jpmois)/12*190./
+      ! 93-Fly (N. Guinea) 8S30 143E05                      R5
+      ! Old=77 km3/year=2440m3/s
+      ! --> 2440.m3/s
+      DATA inb(93)/1/
+      DATA (iirnf(jc,93),jc=1,jpcoef)/  34, 299*0 /
+      DATA (ijrnf(jc,93),jc=1,jpcoef)/  62, 299*0 /
+      DATA (zrnfm(jm,93),jm=1,jpmois)/12*2440./
+      ! 94-Purari (N. Guinea) 7S25 145E05                   R4
+      ! Old=77 km3/year=2440m3/s; UNESCO(77+83,p595)=2727m3/s
+      ! --> 2727.33325m3/s
+      DATA inb(94)/1/
+      DATA (iirnf(jc,94),jc=1,jpcoef)/  36, 299*0 /
+      DATA (ijrnf(jc,94),jc=1,jpcoef)/  64, 299*0 /
+      DATA (zrnfm(jm,94),jm=1,jpmois)/   &
+          1972.,    3067.,    2332.,    2981.,    2693.,    2876.,   &
+          2867.,    3477.,    2195.,    2967.,    2674.,    2627./
+      ! 95-Choshui ch''i (taiwan) 24N03 120E23              R2
+      ! Old=6 km3/year=190m3/s; UNESCO(65-68, p374)=120m3/s; ratio=1.58 
+      ! --> 0.m3/s
+      DATA inb(95)/0/
+      DATA (iirnf(jc,95),jc=1,jpcoef)/  22, 299*0 /
+      DATA (ijrnf(jc,95),jc=1,jpcoef)/  94, 299*0 /
+      DATA (zrnfm(jm,95),jm=1,jpmois)/   &
+           65.,      63.,      83.,     100.,     177.,     535.,   &
+          332.,     313.,     236.,     193.,     101.,      84./
+      ! 96-Kaoping (Taiwan)                                 R5  
+      ! Old=9 km3/year=285m3/s
+      ! --> 0.m3/s
+      DATA inb(96)/0/
+      DATA (iirnf(jc,96),jc=1,jpcoef)/ 300*0 /
+      DATA (ijrnf(jc,96),jc=1,jpcoef)/ 300*0 /
+      DATA (zrnfm(jm,96),jm=1,jpmois)/12*285./
+      ! 97-Tsengwen (Taiwan)                                R5
+      ! Old=2 km3/year=63m3/s
+      ! --> 0.m3/s
+      DATA inb(97)/0/
+      DATA (iirnf(jc,97),jc=1,jpcoef)/ 300*0 /
+      DATA (ijrnf(jc,97),jc=1,jpcoef)/ 300*0 /
+      DATA (zrnfm(jm,97),jm=1,jpmois)/12*63./
+      ! 98-Hualien (Taiwan)                                 R5
+      ! Old=4 km3/year=127m3/s
+      ! --> 0.m3/s
+      DATA inb(98)/0/
+      DATA (iirnf(jc,98),jc=1,jpcoef)/ 300*0 /
+      DATA (ijrnf(jc,98),jc=1,jpcoef)/ 300*0 /
+      DATA (zrnfm(jm,98),jm=1,jpmois)/12*127./
+      ! 99-Peinan (Taiwan) 22N46 121E10                     R5
+      ! Old=4 km3/year=127m3/s
+      ! --> 127.000008m3/s
+      DATA inb(99)/1/
+      DATA (iirnf(jc,99),jc=1,jpcoef)/  23, 299*0 /
+      DATA (ijrnf(jc,99),jc=1,jpcoef)/  94, 299*0 /
+      DATA (zrnfm(jm,99),jm=1,jpmois)/12*127./
+      ! 100-Hsiukuluan (Taiwan)                             R5
+      ! Old=4 km3/year=127m3/s
+      ! --> 0.m3/s
+      DATA inb(100)/0/
+      DATA (iirnf(jc,100),jc=1,jpcoef)/ 300*0 /
+      DATA (ijrnf(jc,100),jc=1,jpcoef)/ 300*0 /
+      DATA (zrnfm(jm,100),jm=1,jpmois)/12*127./
+
+      DATA inb(101)/0/
+      DATA inb(102)/0/
+
+      !  Total run-offs(VII)=6181.33301m3/s
+      !  Total run-offs(I+II+III+IV+V+VI+VII)= 567084. m3/s
+      !                                      = 1.588668056E-6 kg/m2/s
+      !                                      = 17883.5586 km3/Year
+      !                                      = 0.567083955 Sverdrup
+
+      ! VIII ANTARCTICA
+      ! ---------------
+      ! 103 -Antarcti! ice discharge (2 613 Gt/year) (jacobs et al 1992)
+      ! Data from Jacobs et al 92: =2613 km3/year=82857.686454 m3/s
+      ! --> 82858 m3/s
+      DATA inb(103)/295/
+      DATA (iirnf(jc,103),jc=1,jpcoef)/   &
+            1,    2,    3,    3,    4,    4,    5,    6,    7,    8,   &
+            9,    9,   10,   11,   12,   13,   14,   14,   15,   16,   &
+           17,   18,   19,   20,   21,   22,   23,   24,   25,   26,   &
+           27,   28,   29,   30,   31,   32,   32,   33,   34,   35,   &
+           35,   36,   36,   37,   38,   39,   40,   40,   41,   42,   &
+           42,   43,   43,   44,   44,   44,   44,   44,   44,   44,   &
+           45,   45,   45,   45,   46,   46,   46,   46,   46,   47,   &
+           47,   47,   47,   47,   48,   48,   48,   48,   48,   49,   &
+           50,   51,   51,   52,   53,   54,   55,   56,   57,   58,   &
+           59,   60,   61,   62,   62,   63,   63,   64,   65,   66,   &
+           66,   67,   67,   68,   69,   69,   70,   71,   71,   72,   &
+           73,   73,   74,   75,   76,   76,   77,   78,   78,   79,   &
+           80,   81,   82,   83,   83,   84,   85,   86,   87,   88,   &
+           88,   89,   89,   90,   91,   92,   93,   94,   95,   96,   &
+           97,   98,   99,  100,  101,  102,  102,  103,  104,  104,   &
+          104,  104,  104,  105,  105,  106,  106,  107,  107,  107,   &
+          108,  108,  109,  109,  110,  110,  111,  111,  112,  112,   &
+          112,  112,  112,  112,  112,  112,  112,  112,  112,  112,   &
+          112,  112,  112,  112,  112,  113,  113,  113,  113,  113,   &
+          114,  114,  114,  114,  115,  115,  115,  115,  115,  116,   &
+          116,  117,  117,  118,  118,  119,  119,  120,  121,  122,   &
+          123,  124,  124,  125,  125,  126,  126,  127,  128,  128,   &
+          129,  130,  130,  131,  132,  132,  133,  133,  133,  133,   &
+          133,  134,  135,  135,  136,  136,  136,  137,  137,  138,   &
+          139,  140,  141,  142,  142,  143,  144,  145,  146,  147,   &
+          148,  149,  150,  151,  152,  153,  154,  155,  156,  156,   &
+          157,  158,  159,  160,  161,  161,  162,  163,  163,  164,   &
+          165,  165,  166,  166,  167,  168,  169,  170,  171,  171,   &
+          172,  173,  173,  174,  175,  176,  177,  177,  178,  178,   &
+          179,  180,  180,  181,  181,    0,    0,    0,    0,    0    &
+                                      /
+      DATA (ijrnf(jc,103),jc=1,jpcoef)/   &
+           19,   20,   20,   21,   21,   22,   22,   22,   22,   22,   &
+           22,   23,   23,   23,   23,   23,   22,   23,   22,   22,   &
+           22,   22,   22,   22,   22,   22,   22,   22,   22,   22,   &
+           22,   22,   22,   22,   22,   21,   22,   21,   21,   20,   &
+           21,   19,   20,   19,   19,   19,   18,   19,   18,   17,   &
+           18,   16,   17,    3,    4,    5,    6,    7,    8,   16,   &
+            3,    8,    9,   16,    3,    9,   10,   15,   16,    3,   &
+           10,   11,   14,   15,    3,   11,   12,   13,   14,    3,   &
+            3,    2,    3,    2,    2,    2,    2,    2,    2,    2,   &
+            2,    2,    2,    2,    3,    3,    4,    4,    4,    4,   &
+            5,    5,    6,    6,    6,    7,    7,    7,    8,    8,   &
+            8,    9,    9,    9,    9,   10,   10,   10,   11,   11,   &
+           11,   11,   11,   10,   11,   10,   10,   10,   10,   10,   &
+           11,   11,   12,   12,   12,   12,   12,   12,   12,   12,   &
+           12,   12,   12,   12,   12,   12,   13,   13,   13,   14,   &
+           15,   16,   17,   17,   18,   18,   19,   19,   20,   21,   &
+           21,   22,   22,   23,   23,   24,   24,   25,    8,    9,   &
+           10,   11,   12,   13,   14,   15,   16,   17,   18,   19,   &
+           20,   21,   22,   25,   26,    7,    8,   22,   23,   26,   &
+            7,   23,   24,   26,    6,    7,   24,   25,   26,    5,   &
+            6,    4,    5,    3,    4,    2,    3,    2,    2,    2,   &
+            2,    2,    3,    3,    4,    4,    5,    5,    5,    6,   &
+            6,    6,    7,    7,    7,    8,    8,    9,   10,   11,   &
+           12,   12,   12,   13,   13,   14,   15,   15,   16,   16,   &
+           16,   16,   16,   16,   17,   17,   17,   17,   17,   17,   &
+           17,   17,   17,   17,   17,   17,   17,   17,   17,   18,   &
+           18,   18,   18,   18,   18,   19,   19,   19,   20,   20,   &
+           20,   21,   21,   22,   22,   22,   22,   22,   21,   22,   &
+           21,   20,   21,   20,   20,   20,   19,   20,   18,   19,   &
+           18,   18,   19,   19,   20,    0,    0,    0,    0,    0    &
+                                      /
+      DATA (zrnfm(jm,103),jm=1,jpmois)/12*82858./
+
+      !  Total run-offs(VIII)=82858 m3/s
+      !  Total run-offs(I+II+III+IV+V+VI+VII+VIII)= 649941. m3/s
+      !                                           = 0.649940955 Sverdrup
+
+
+      DATA (inb(jr),jr=104,jpriv)/17*0/
+
+      !!----------------------------------------------------------------------
+      !!  OPA 8.5, LODYC-IPSL (2002)
+      !!----------------------------------------------------------------------
+
+      IF( kt == nit000 ) THEN
+         IF(lwp) WRITE(numout,*)
+         IF(lwp) WRITE(numout,*) 'flxrnf : runoff + orca2'
+         IF(lwp) WRITE(numout,*) '~~~~~~'
+         IF(lwp) WRITE(numout,*) '   nrunoff = ', nrunoff
+         IF(lwp) WRITE(numout,*)
+      ENDIF
+
+      ! 0. initialization and  indexes  modification for zoom version
+      ! --------------------------------------------------------------
+      
+      
+      ! conversion factor m3/s --> kg/m2/s *e1t*e2t
+
+      zconv = rauw
+
+      IF( kt == nit000 ) THEN 
+         ! Set runoffs and upstream coeff to zero
+         runoff (:,:) = 0.e0                                                                                  
+         upsrnfh(:,:) = 0.e0
+         upsrnfz(:)   = 0.e0
+         upsadv (:,:) = 0.e0
+         zcoefr(:,:,:) = 0.e0
+
+         IF( nrunoff == 0 ) THEN
+            IF(lwp) WRITE(numout,*)
+            IF(lwp) WRITE(numout,*) ' NO RUNOFF in this simulation '
+            IF(lwp) WRITE(numout,*)
+         ENDIF
+      ENDIF
+
+      ! 1. initialization of the runoff array
+      ! -------------------------------------
+
+      IF( nrunoff == 1 .OR. nrunoff == 2) THEN
+
+         iman  = jpmois
+         
+         i15 = nday / 16
+         
+         imois = nmonth + i15 - 1
+         IF( imois == 0) imois = iman
+         IF( nn_leap_year == 1 .AND. MOD( nyear, 4 ) == 0 ) THEN
+            ! Number of Day Between Data
+            idbd = nbiss(imois)
+         ELSEIF( nn_leap_year > 1 ) THEN
+            idbd = nn_leap_year
+         ELSE
+            idbd = nobis(imois)
+         ENDIF
+         ! Number of days between imois, 15 and the end of month
+         idmeom = idbd - 15
+         
+         ! 1.1 Calendar computation
+         
+         ! nrnf1 number of the first array record used in the simulation
+         ! nrnf2 number of the last  array record
+         
+         nrnf1 = imois
+         nrnf2 = nrnf1 + 1
+         nrnf1 = MOD( nrnf1, iman )
+         IF( nrnf1 == 0 ) nrnf1 = iman
+         nrnf2 = MOD( nrnf2, iman )
+         IF( nrnf2 == 0 ) nrnf2 = iman
+         
+         IF( kt == nit000 ) THEN
+            IF(lwp) WRITE(numout,*)
+            IF(lwp) WRITE(numout,*) 'flxrnf routine'
+            IF(lwp) WRITE(numout,*) 'first array record used nrnf1 ',nrnf1
+            IF(lwp) WRITE(numout,*) 'last  array record used nrnf2 ',nrnf2
+         ENDIF
+
+         zxy = FLOAT( nday + idmeom - idbd * i15 ) / idbd
+
+         DO jr = 1, jpriv-1
+            inbp = inb(jr)
+            IF( inbp /= 0 ) THEN
+               DO jl = 1, inbp
+                  ii = iirnf(jl,jr) - nimpp + 1 - jpizoom + 1
+                  ij = ijrnf(jl,jr) - njmpp + 1 - jpjzoom + 1
+                  iipt0 = MAX( 1, MIN( ii, jpi   ) )
+                  iipt1 = MAX( 0, MIN( ii, jpi-1 ) )
+                  ijpt0 = MAX( 1, MIN( ij, jpj   ) )
+                  ijpt1 = MAX( 0, MIN( ij, jpj-1 ) )
+                  DO jj = ijpt0, ijpt1
+                     DO ji = iipt0, iipt1
+                        runoff(ji,jj) = runoff(ji,jj)   & 
+                                      + ( (1.-zxy) * zrnfm(nrnf1,jr)   &
+                                      +       zxy  * zrnfm(nrnf2,jr)  ) / FLOAT(inbp)
+                     END DO
+                  END DO
+               END DO
+            ENDIF
+         END DO
+
+
+         ! 2. conversion in mm/day
+         ! -----------------------
+         !     C a u t i o n : upward water flux, runoff is negative
+
+         runoff(:,:) = -zconv * runoff(:,:) / ( e1t(:,:) * e2t(:,:) )
+         
+
+         ! 3. advectve coefficient
+         ! -----------------------
+
+         !  Creates the array coef that contains the coefficient to affect to
+         !  the upstream scheme. advection scheme will be:
+         !  coefr * upstream + (1- coefr) centered
+         !  coefr must be between 0 and 1.
+         !  3 values are used: maximum = zrup1, between zrup2, small zrup3.
+         ! 
+         IF( nrunoff == 2 .AND. kt == nit000 ) THEN
+
+            zrup1 = 0.5
+            zrup2 = 0.25
+            zrup3 = 0.125
+            DO jr = 1, jpriv-1
+               inbp = inb(jr)
+               IF( inbp /= 0) THEN
+                  DO jl = 1, inbp
+                     ! --> zrup1 (originally, = 1 = all upstream).
+                     ! ji,jj
+                     ii = iirnf(jl,jr) - nimpp + 1 - jpizoom - 1
+                     ij = ijrnf(jl,jr) - njmpp + 1 - jpjzoom - 1
+                     iipt0 = MAX( 1, MIN( ii,jpi  ) )
+                     iipt1 = MAX( 0, MIN( ii,jpi-1) )
+                     ijpt0 = MAX( 1, MIN( ij,jpj  ) )
+                     ijpt1 = MAX( 0, MIN( ij,jpj-1) )
+                     DO jj = ijpt0, ijpt1
+                        DO ji = iipt0, iipt1
+                           DO jn = 1, 3
+                              zcoefr(ji,jj,jn) = zrup1
+                           END DO
+                           zcoefr(ji,jj,4) = zrup2
+                           zcoefr(ji,jj,5) = zrup3
+                        END DO
+                     END DO
+                     ! --> zrup2 (originally = 0.5)
+                     ! ji,jj+1
+                     ijpt0 = MAX( 1, MIN( ij+1, jpj  ) )
+                     ijpt1 = MAX( 0, MIN( ij+1, jpj-1) )
+                     DO jj = ijpt0, ijpt1
+                        DO ji = iipt0, iipt1
+                           DO jn = 1, 3
+                              zcoefr(ji,jj,jn) = MAX( zrup2, zcoefr(ji,jj,jn) )
+                           END DO
+                           zcoefr(ji,jj,4) = MAX( zrup3, zcoefr(ji,jj,4) )
+                        END DO
+                     END DO
+                     ! ji,jj-1
+                     ijpt0 = MAX( 1, MIN( ij-1, jpj  ) )
+                     ijpt1 = MAX( 0, MIN( ij-1, jpj-1) )
+                     DO jj = ijpt0, ijpt1
+                        DO ji = iipt0, iipt1
+                           DO jn = 1, 3
+                              zcoefr(ji,jj,jn) = MAX( zrup2, zcoefr(ji,jj,jn) )
+                           END DO
+                           zcoefr(ji,jj,4) = MAX( zrup3, zcoefr(ji,jj,4) )
+                        END DO
+                     END DO
+                     ! ji+1,jj-1
+                     iipt0 = MAX( 1, MIN( ii+1, jpi  ) )
+                     iipt1 = MAX( 0, MIN( ii+1, jpi-1) )
+                     DO jj = ijpt0, ijpt1
+                        DO ji = iipt0, iipt1
+                           DO jn = 1, 3
+                              zcoefr(ji,jj,jn) = MAX( zrup2, zcoefr(ji,jj,jn) )
+                           END DO
+                           zcoefr(ji,jj,4) = MAX( zrup3, zcoefr(ji,jj,4) )
+                        END DO
+                     END DO
+                     ! ji+1,jj
+                     ijpt0 = MAX( 1, MIN( ij, jpj  ) )
+                     ijpt1 = MAX( 0, MIN( ij, jpj-1) )
+                     DO jj = ijpt0, ijpt1
+                        DO ji = iipt0, iipt1
+                           DO jn = 1, 3
+                              zcoefr(ji,jj,jn) = MAX( zrup2, zcoefr(ji,jj,jn) )
+                           END DO
+                           zcoefr(ji,jj,4) = MAX( zrup3, zcoefr(ji,jj,4) )
+                        END DO
+                     END DO
+                     ! ji+1,jj+1
+                     ijpt0 = MAX( 1, MIN( ij+1,jpj  ) )
+                     ijpt1 = MAX( 0, MIN( ij+1,jpj-1) )
+                     DO jj = ijpt0, ijpt1
+                        DO ji = iipt0, iipt1
+                           DO jn = 1, 3
+                              zcoefr(ji,jj,jn) = MAX( zrup2, zcoefr(ji,jj,jn) )
+                           END DO
+                           zcoefr(ji,jj,4) = MAX( zrup3, zcoefr(ji,jj,4) )
+                        END DO
+                     END DO
+                     ! ji-1,jj+1
+                     iipt0 = MAX( 1, MIN( ii-1,jpi  ) )
+                     iipt1 = MAX( 0, MIN( ii-1,jpi-1) )
+                     DO jj = ijpt0, ijpt1
+                        DO ji = iipt0, iipt1
+                           DO jn = 1, 3
+                              zcoefr(ji,jj,jn) = MAX( zrup2, zcoefr(ji,jj,jn) )
+                           END DO
+                           zcoefr(ji,jj,4) = MAX( zrup3, zcoefr(ji,jj,4) )
+                        END DO
+                     END DO
+                     ! ji-1,jj
+                     ijpt0 = MAX( 1, MIN( ij,jpj  ) )
+                     ijpt1 = MAX( 0, MIN( ij,jpj-1) )
+                     DO jj = ijpt0, ijpt1
+                        DO ji = iipt0, iipt1
+                           DO jn = 1, 3
+                              zcoefr(ji,jj,jn) = MAX( zrup2, zcoefr(ji,jj,jn) )
+                           END DO
+                           zcoefr(ji,jj,4) = MAX( zrup3, zcoefr(ji,jj,4) )
+                        END DO
+                     END DO
+                     ! ji-1,jj-1
+                     ijpt0 = MAX( 1, MIN( ij-1,jpj  ) )
+                     ijpt1 = MAX( 0, MIN( ij-1,jpj-1) )
+                     DO jj = ijpt0, ijpt1
+                        DO ji = iipt0, iipt1
+                           DO jn = 1, 3
+                              zcoefr(ji,jj,jn) = MAX( zrup2, zcoefr(ji,jj,jn) )
+                           END DO
+                           zcoefr(ji,jj,4) = MAX( zrup3, zcoefr(ji,jj,4) )
+                        END DO
+                     END DO
+                     ! --> zrup3 (originally = 0.25)
+                     ! ji-1,jj+2
+                     ijpt0 = MAX( 1, MIN( ij+2,jpj  ) )
+                     ijpt1 = MAX( 0, MIN( ij+2,jpj-1) )
+                     DO jj = ijpt0, ijpt1
+                        DO ji = iipt0, iipt1
+                           DO jn = 1, 3
+                              zcoefr(ji,jj,jn) = MAX( zrup3, zcoefr(ji,jj,jn) )
+                           END DO
+                        END DO
+                     END DO
+                     ! ji-1,jj-2
+                     ijpt0 = MAX( 1, MIN( ij-2,jpj  ) )
+                     ijpt1 = MAX( 0, MIN( ij-2,jpj-1) )
+                     DO jj = ijpt0, ijpt1
+                        DO ji = iipt0, iipt1
+                           DO jn = 1, 3 
+                              zcoefr(ji,jj,jn) = MAX( zrup3, zcoefr(ji,jj,jn) )
+                           END DO
+                        END DO
+                     END DO
+                     ! ji,jj-2
+                     iipt0 = MAX( 1, MIN( ii,jpi  ) )
+                     iipt1 = MAX( 0, MIN( ii,jpi-1) )
+                     DO jj = ijpt0, ijpt1
+                        DO ji = iipt0, iipt1
+                           DO jn = 1, 3 
+                              zcoefr(ji,jj,jn) = MAX( zrup3, zcoefr(ji,jj,jn) )
+                           END DO
+                        END DO
+                     END DO
+                     ! ji,jj+2
+                     ijpt0 = MAX( 1, MIN( ij+2,jpj  ) )
+                     ijpt1 = MAX( 0, MIN( ij+2,jpj-1) )
+                     DO jj = ijpt0, ijpt1
+                        DO ji = iipt0, iipt1
+                           DO jn = 1, 3
+                              zcoefr(ji,jj,jn) = MAX( zrup3, zcoefr(ji,jj,jn) )
+                           END DO
+                        END DO
+                     END DO
+                     ! ji+1,jj-2
+                     iipt0 = MAX( 1, MIN( ii+1,jpi  ) )
+                     iipt1 = MAX( 0, MIN( ii+1,jpi-1) )
+                     DO jj = ijpt0, ijpt1
+                        DO ji = iipt0, iipt1
+                           DO jn = 1, 3 
+                              zcoefr(ji,jj,jn) = MAX( zrup3, zcoefr(ji,jj,jn) )
+                           END DO
+                        END DO
+                     END DO
+                     ! ji+1,jj+2
+                     ijpt0 = MAX( 1, MIN( ij+2,jpj  ) )
+                     ijpt1 = MAX( 0, MIN( ij+2,jpj-1) )
+                     DO jj = ijpt0, ijpt1
+                        DO ji = iipt0, iipt1
+                           DO jn = 1, 3 
+                              zcoefr(ji,jj,jn) = MAX( zrup3, zcoefr(ji,jj,jn) )
+                           END DO
+                        END DO
+                     END DO
+                     ! ji+2,jj-2
+                     iipt0 = MAX( 1, MIN( ii+2,jpi  ) )
+                     iipt1 = MAX( 0, MIN( ii+2,jpi-1) )
+                     DO jj = ijpt0, ijpt1
+                        DO ji = iipt0, iipt1
+                           DO jn = 1, 3 
+                              zcoefr(ji,jj,jn) = MAX( zrup3, zcoefr(ji,jj,jn) )
+                           END DO
+                        END DO
+                     END DO
+                     ! ji+2,jj+2
+                     ijpt0 = MAX( 1, MIN( ij+2,jpj  ) )
+                     ijpt1 = MAX( 0, MIN( ij+2,jpj-1) )
+                     DO jj = ijpt0, ijpt1
+                        DO ji = iipt0, iipt1
+                           DO jn = 1, 3  
+                              zcoefr(ji,jj,jn) = MAX( zrup3, zcoefr(ji,jj,jn) )
+                           END DO
+                        END DO
+                     END DO
+                     ! ji+2,jj-1
+                     ijpt0 = MAX( 1, MIN( ij-1,jpj  ) )
+                     ijpt1 = MAX( 0, MIN( ij-1,jpj-1) )
+                     DO jj = ijpt0, ijpt1
+                        DO ji = iipt0, iipt1
+                           DO jn = 1, 3
+                              zcoefr(ji,jj,jn) = MAX( zrup3, zcoefr(ji,jj,jn) )
+                           END DO
+                        END DO
+                     END DO
+                     ! ji+2,jj+1
+                     ijpt0 = MAX( 1, MIN( ij+1,jpj  ) )
+                     ijpt1 = MAX( 0, MIN( ij+1,jpj-1) )
+                     DO jj = ijpt0, ijpt1
+                        DO ji = iipt0, iipt1
+                           DO jn = 1, 3 
+                              zcoefr(ji,jj,jn) = MAX( zrup3, zcoefr(ji,jj,jn) )
+                           END DO
+                        END DO
+                     END DO
+                     ! ji+2,jj
+                     ijpt0 = MAX( 1, MIN( ij,jpj  ) )
+                     ijpt1 = MAX( 0, MIN( ij,jpj-1) )
+                     DO jj = ijpt0, ijpt1
+                        DO ji = iipt0, iipt1
+                           DO jn = 1, 3
+                              zcoefr(ji,jj,jn) = MAX( zrup3, zcoefr(ji,jj,jn) )
+                           END DO
+                        END DO
+                     END DO
+                     ! ji-2,jj
+                     iipt0 = MAX( 1, MIN( ii-2,jpi  ) )
+                     iipt1 = MAX( 0, MIN( ii-2,jpi-1) )
+                     DO jj = ijpt0, ijpt1
+                        DO ji = iipt0, iipt1
+                           DO jn = 1, 3        
+                              zcoefr(ji,jj,jn) = MAX( zrup3, zcoefr(ji,jj,jn) )
+                           END DO
+                        END DO
+                     END DO
+                     ! ji-2,jj-2
+                     ijpt0 = MAX( 1, MIN( ij-2,jpj  ) )
+                     ijpt1 = MAX( 0, MIN( ij-2,jpj-1) )
+                     DO jj = ijpt0, ijpt1
+                        DO ji = iipt0, iipt1
+                           DO jn = 1, 3 
+                              zcoefr(ji,jj,jn) = MAX( zrup3, zcoefr(ji,jj,jn) )
+                           END DO
+                        END DO
+                     END DO
+                     ! ji-2,jj+2
+                     ijpt0 = MAX( 1, MIN( ij+2,jpj  ) )
+                     ijpt1 = MAX( 0, MIN( ij+2,jpj-1) )
+                     DO jj = ijpt0, ijpt1
+                        DO ji = iipt0, iipt1
+                           DO jn = 1, 3
+                              zcoefr(ji,jj,jn) = MAX( zrup3, zcoefr(ji,jj,jn) )
+                           END DO
+                        END DO
+                     END DO
+                     ! ji-2,jj-1
+                     ijpt0 = MAX( 1, MIN( ij-1,jpj  ) )
+                     ijpt1 = MAX( 0, MIN( ij-1,jpj-1) )
+                     DO jj = ijpt0, ijpt1
+                        DO ji = iipt0, iipt1
+                           DO jn = 1, 3 
+                              zcoefr(ji,jj,jn) = MAX( zrup3, zcoefr(ji,jj,jn) )
+                           END DO
+                        END DO
+                     END DO
+                     ! ji-2,jj+1
+                     ijpt0 = MAX( 1, MIN( ij+1,jpj  ) )
+                     ijpt1 = MAX( 0, MIN( ij+1,jpj-1) )
+                     DO jj = ijpt0, ijpt1
+                        DO ji = iipt0, iipt1
+                           DO jn = 1, 3 
+                              zcoefr(ji,jj,jn) = MAX( zrup3, zcoefr(ji,jj,jn) )
+                           END DO
+                        END DO
+                     END DO
+                  END DO
+               ENDIF
+            END DO
+            upsrnfh(:,:) = zcoefr(:,:,1)
+            upsrnfz(:)   = 0.e0
+            upsrnfz(1)   = 1.0
+            upsrnfz(2)   = 1.0
+            upsrnfz(3)   = zrup1
+            upsrnfz(4)   = zrup2
+            upsrnfz(5)   = zrup3
+
+            ! Reduces the sea surface restoring term to Levitus98
+            ! in the Sound Strait
+            DO jj = mj0(116), mj1(116)
+               DO ji = mi0(144), mi1(144)
+                  upsrnfh(ji,jj) = 0.25
+               END DO
+               DO ji = mi0(145), mi1(147)
+                  upsrnfh(ji,jj) = 0.5
+               END DO
+               DO ji = mi0(148), mi1(148)
+                  upsrnfh(ji,jj) = 0.25
+               END DO
+            END DO
+         ENDIF
+      ENDIF
+      
+      ! Upstream and centered scheme in the vicinity of some straits
+
+      IF( kt == nit000 ) THEN
+
+         ! ORCA_R2 configuration :
+         ! Gibraltar Strait
+         DO jj = mj0(102), mj1(102)
+            DO ji = mi0(138), mi1(138)
+               upsadv(ji,jj) = 0.2
+            END DO
+         END DO
+         DO jj = mj0(102), mj1(102)
+            DO ji = mi0(139), mi1(139)
+               upsadv(ji,jj) = 0.4
+            END DO
+         END DO
+         DO jj = mj0(102), mj1(102)
+            DO ji = mi0(140), mi1(140)
+               upsadv(ji,jj) = 0.5
+            END DO
+         END DO
+         DO jj = mj0(101), mj1(102)
+            DO ji = mi0(141), mi1(141)
+               upsadv(ji,jj) = 0.5
+            END DO
+         END DO
+         ! Bab el Mandeb Strait
+         DO jj = mj0(87), mj1(88)
+            DO ji = mi0(164), mi1(164)
+               upsadv(ji,jj) = 0.1
+            END DO
+         END DO
+         DO jj = mj0(88), mj1(88)
+            DO ji = mi0(163), mi1(163)
+               upsadv(ji,jj) = 0.25
+            END DO
+         END DO
+         DO jj = mj0(88), mj1(88)
+            DO ji = mi0(162), mi1(162)
+               upsadv(ji,jj) = 0.4
+            END DO
+         END DO
+         DO jj = mj0(88), mj1(88)
+            DO ji = mi0(160), mi1(161)
+               upsadv(ji,jj) = 0.5
+            END DO
+         END DO
+         DO jj = mj0(89), mj1(89)
+            DO ji = mi0(158), mi1(160)
+               upsadv(ji,jj) = 0.25
+            END DO
+         END DO
+         DO jj = mj0(90), mj1(90)
+            DO ji = mi0(160), mi1(160)
+               upsadv(ji,jj) = 0.25
+            END DO
+         END DO
+         ! Sound Strait
+         DO jj = mj0(116), mj1(116)
+            DO ji = mi0(145), mi1(147)
+               upsadv(ji,jj) = 0.5
+            END DO
+         END DO
+
+      ENDIF
Index: /trunk/NEMO/OPA_SRC/SBC/sbcrnf_ORCA_R4.h90
===================================================================
--- /trunk/NEMO/OPA_SRC/SBC/sbcrnf_ORCA_R4.h90	(revision 702)
+++ /trunk/NEMO/OPA_SRC/SBC/sbcrnf_ORCA_R4.h90	(revision 702)
@@ -0,0 +1,1339 @@
+   !!----------------------------------------------------------------------
+   !!                    ***  flxrnf_ORCA_R4.h90  ***
+   !!----------------------------------------------------------------------
+
+   !!----------------------------------------------------------------------
+   !!                  OLD ORCA R4 runoff specification
+   !!                      kept here for memory
+   !!                         ( 20/04/2000 )
+   !!----------------------------------------------------------------------
+   !!----------------------------------------------------------------------
+   !!  OPA 9.0 , LOCEAN-IPSL (2005) 
+   !! $Header: /home/opalod/NEMOCVSROOT/NEMO/OPA_SRC/SBC/flxrnf_ORCA_R4.h90,v 1.2 2005/03/27 18:35:14 opalod Exp $ 
+   !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt 
+   !!----------------------------------------------------------------------
+      !!----------------------------------------------------------------------
+      !! * Local declarations
+      INTEGER  :: kt
+      INTEGER  :: jpmois
+      INTEGER  ::   &
+         jpriv,    & ! jpriv : maximum river number
+         jpcoef      ! jpcoef: maximum point number
+      INTEGER, PARAMETER ::   jpmois=12, jpriv=120, jpcoef=150
+
+      INTEGER  ::   ji, jj, jl, jm, jn, jr, jc
+      INTEGER  ::   i15, imois, iman
+      INTEGER  ::   inbp, idbd, idmeom
+      INTEGER  ::   iipt0, iipt1, ijpt0, ijpt1, ii, ij
+      INTEGER  ::   iirnf(jpcoef,jpriv),ijrnf(jpcoef,jpriv)
+      INTEGER  ::   inb(jpriv)
+
+      REAL(wp) ::   zconv, zxy
+      REAL(wp) ::   zrup1,zrup2,zrup3
+      REAL(wp) ::   zrnfm(jpmois, jpriv)
+      REAL(wp) ::   zcoefr(jpi, jpj, 5)
+      CHARACTER (len=20) ::   criver(jpriv)
+
+      REAL(wp) ::   zbilan , zero
+
+      COMMON/zzzrnf/ zrnfm, iirnf, ijrnf, inb
+
+      ! ====
+      ! DATA
+      ! ====
+
+      zero = 0.0e0
+      IF( kt == nit000 ) THEN 
+          criver = "                    "
+          inb = 0
+          iirnf = 0
+          ijrnf = 0
+          zrnfm  = zero
+          runoff = zero
+         
+          ! I NORTH AMERICA
+          ! ---------------
+          
+          ! 1-Saint Lawrence (Canada) 49N30 67W00           R2
+          ! Old=447 km3/year=14165m3/s; CLIPPER=12430m3/s; ratio=1.14
+          ! --> 13975.249m3/s
+          criver(1) = "Saint Lawrence      "
+          inb(1) = 1
+          iirnf(1:1,1) = 57
+          ijrnf(1:1,1) = 55
+          zrnfm(1:jpmois,1) = (/   &
+              11718.,  11971.,  12466.,  14980.,  19257.,  16913.,   &
+              14211.,  13119.,  13367.,  13644.,  13463.,  12594./)
+          ! 2-Hudson River (USA) 41N00 77W00                R1
+          ! Old=12 km3/year=380m3/s; UNESCO(64-83,p255)=408m3/s
+          ! --> 407.416687m3/s
+          criver(2) = "Hudson River        "
+          inb(2) = 1
+          iirnf(1:1,2) = 54
+          ijrnf(1:1,2) = 53
+          zrnfm(1:jpmois,2) = (/   &
+              364.,    404.,    648.,    873.,    593.,    301.,   &
+              205.,    171.,    205.,    290.,    379.,    456./)
+          ! 3-Missisipi and Atchafalaya (USA) 29N 90W       R1 
+          ! Old=580 km3/year=18380m3/s; CLIPPER=17599m3/s
+          ! --> 17599.334m3/s
+          criver(3) = "Missisipi           "
+          inb(3) = 1
+          iirnf(1:1,3) = 50
+          ijrnf(1:1,3) = 49
+          zrnfm(1:jpmois,3) = (/   &
+              19260.,  20813.,  23026.,  28160.,  26510.,  19650.,   &
+              14181.,  10676.,   9578.,  10167.,  11699.,  17472./)
+          ! 4-Brazos (USA) 29N58 95W53                      R1
+          ! Old=7 km3/year=222m3/s; UNESCO(65-84, p298)=200m3/s
+          ! --> 199.666656m3/s
+          criver(4) = "Brazos              "
+          inb(4) = 1
+          iirnf(1:1,4) = 48
+          ijrnf(1:1,4) = 49
+          zrnfm(1:jpmois,4) = (/   &
+              165.,    224.,    200.,    266.,    457.,    327.,   &
+              143.,     69.,    102.,    132.,    160.,    151. /)
+          ! 5-Colorado (Mexico) 31N54 114W57                R5
+          ! Old=20 km3/year=634m3/s
+          ! --> 634.m3/s
+          criver(5) = "Colorado            "
+          inb(5) = 1
+          iirnf(1:1,5) = 43
+          ijrnf(1:1,5) = 50
+          zrnfm(1:jpmois,5) = 634. 
+          ! 6-Columbia (USA) 45N60 121W17                   R1
+          ! Old=251 km3/year=7954m3/s; UNESCO(65-84, p312)=5368m3/s
+          ! --> 5368.41602m3/s
+          criver(6) = "Columbia            "
+          inb(6) = 1
+          iirnf(1:1,6) = 40
+          ijrnf(1:1,6) = 56
+          zrnfm(1:jpmois,6) = (/   &
+              4752.,    5077.,    5633.,    6075.,    8422.,    9822.,   &
+              6350.,    4112.,    3273.,    3251.,    3548.,    4106. /)
+          ! 7-Fraser (USA) 47N 124W                         R5
+          ! Old=112 km3/year=3550m3/s;not found in UNESCO
+          ! --> 3549.99976m3/s
+          criver(7) = "Fraser              "
+          inb(7) = 1
+          iirnf(1:1,7) = 40
+          ijrnf(1:1,7) = 57
+          zrnfm(1:jpmois,7) = 3550. 
+          ! 8-Yukon (USA) 63N00 165W00                      R3
+          ! Old=195 km3/year=6179m3/s; UNESCO(65-77+80-84, p321)=4245; ratio=1.46
+          ! --> 6017.24951m3/s
+          criver(8) = "Yukon               "
+          inb(8) = 1
+          iirnf(1:1,8) = 30
+          ijrnf(1:1,8) = 62
+          zrnfm(1:jpmois,8) = (/   &
+              1459.,    1213.,    1065.,    1100.,    9067.,   17675.,   &
+              10680.,   11271.,    8658.,    5453.,    2649.,    1917./)
+          ! 9-Copper (USA) 61N47 144W45                     R2
+          ! Old=39 km3/year=1236m3/s; UNESCO(65-84, p317)=1052m3/s; ratio=1.18
+          ! --> 1236.25m3/s
+          criver(9) = "Copper              "
+          inb(9) = 1
+          iirnf(1:1,9) = 35
+          ijrnf(1:1,9) = 60
+          zrnfm(1:jpmois,9) = (/   &
+              219.,    195.,    181.,    214.,    904.,   2532.,   &
+              4026.,   3627.,   1632.,    697.,    354.,    254. /) 
+          ! 10-Susitna (USA)   62N 150E                     R5
+          ! Old=40 km3/year=1268m3/s
+          ! --> 1268.m3/s
+          criver(10) = "Susitna             "
+          inb(10) = 1
+          iirnf(1:1,10) = 34
+          ijrnf(1:1,10) = 60
+          zrnfm(1:jpmois,10) = 1268. 
+          ! 11-McKenzie (Canada) 70N00 135W00               R3
+          ! Old=306 km3/year=9697m3/s; UNESCO(67+72+7479+82-84, p168)=8343m3/s;
+          ! ratio=1.16
+          ! --> 9606.66797m3/s
+          criver(11) = "McKenzie            "
+          inb(11) = 1
+          iirnf(1:1,11) = 35
+          ijrnf(1:1,11) = 66
+          zrnfm(1:jpmois,11) = (/   &
+              3644.,    3400.,    3258.,    3546.,   14188.,   21544.,   &
+              18954.,   15487.,   11284.,   10169.,    5901.,    3905./)
+          ! 12-Kuksokwim (USA) 60N00 ~162W30                R4
+          ! UNESCO(65-84, p318)=1112m3/s (61N87 158E10, Crooked Creek, inland)
+          ! --> 1111.99988m3/s
+          criver(12) = "Kuksokwim           "
+          inb(12) = 1
+          iirnf(1:1,12) = 30
+          ijrnf(1:1,12) = 60
+          zrnfm(1:jpmois,12) = (/   &
+              335.,     308.,     295.,     407.,    2415.,    2027.,   &
+              1917.,   2049.,    1585.,    1072.,     545.,     389./)
+          ! 13-Nelson
+          criver(13) = "Nelson              "
+          inb(13) = 1
+          iirnf(1:1,13) = 51
+          ijrnf(1:1,13) = 65
+          zrnfm(1:jpmois,13) = 0.
+
+          ! Total run-offs(I)=60974.2539m3/s
+
+          ! II SOUTH AMERICA
+          ! -----------------
+          ! 16-Chira (Peru) 4s54 81w08                      R2
+          ! Old=5 km3/year=158m3/s; UNESCO (65-68, p357)=80.9; ratio=1.95
+          ! --> 158.000015m3/s
+          criver(16) = "Chira               "
+          inb(16) = 1
+          iirnf(1:1,16) = 51
+          ijrnf(1:1,16) = 34
+          zrnfm(1:jpmois,16) = (/   &
+              70.,     105.,     564.,     582.,     230.,      94.,   &
+              87.,      47.,      35.,      32.,      29.,      21./)
+          ! 17-Magdalena (Colombia) 11N06 74W51             R2
+          ! Old=237 km3/year=7510m3/s; UNESCO(71-73+76-79, p348)=6973m3/s;
+          ! ratio=1.08
+          ! --> 7451.58301m3/s
+          criver(17) = "Magdelena           "
+          inb(17) = 1
+          iirnf(1:1,17) = 53
+          ijrnf(1:1,17) = 45
+          zrnfm(1:jpmois,17) = (/   &
+              6598.,    4441.,    4087.,    5445.,    7380.,    8067.,   &
+              8509.,    7428.,    7631.,    9296.,   10588.,    9949./)
+          ! 18-Orinoco (Venezuela) 8N37 62W15!              R1
+          ! Old=1100 km3/year=34857m3/s; UNESCO(73-75, p364)=28736m3/s;
+          ! HLA=26371m3/s
+          ! Data from HLA: 8.1N - 63.3W   1925/89
+          ! --> 26371.416
+          criver(18) = "Orinico             "
+          inb(18) = 1
+          iirnf(1:1,18) = 57
+          ijrnf(1:1,18) = 44
+          zrnfm(1:jpmois,18) = (/   &
+              10670.,    7513.,    6344.,    6887.,   13086.,   26699.,   &
+              43938.,   59957.,   57435.,   39951.,   27410.,   16567./)
+          ! 19-Amazon (Brazil) 0S05 50W00                   R1
+          ! Old=6300 km3/year=199634m3/s; CLIPPER=166192m3/s~UNESCO;
+          ! HLA=184806m3/s
+          ! UNESCO data are at Obidos which is far inland and therefore does not
+          ! fully represent the actual discharge
+          ! Data from HLA: 1.5N - 55.3W   1970/96
+          ! --> 184845.484m3/s
+          criver(19) = "Amazon              "
+          inb(19) = 3
+          iirnf(1:3,19) = (/ 60, 60, 60 /)
+          ijrnf(1:3,19) = (/ 39, 40, 41 /)
+          zrnfm(1:jpmois,19) = (/   &
+              152233., 176415., 199941., 225565., 244016., 244861.,   &
+              230711., 203128., 164531., 128486., 118214., 130045. /)
+          ! 20-Sao Francisco (Brazil) 10S30 36W24           R1
+          ! Old=97 km3/year=3074m3/s; UNESCO(77-79, p338)=2645m3/s
+          ! --> 2645.3335m3/s
+          criver(20) = "San Fransisco       "
+          inb(20) = 1
+          iirnf(1:1,20) = 63
+          ijrnf(1:1,20) = 31
+          zrnfm(1:jpmois,20) = (/   &
+              3244.,   4116.,   5139.,   4330.,   2323.,   1800.,     &
+              1587.,   1511.,   1593.,   1740.,   2190.,   2171. /)
+          ! 21-Parana+Uruguay(Arg./Uru.) 34S12 58W18        R1 
+          ! Old=470 km3/year=14893m3/s; UNESCO(p323/324)=22263m3/s
+          ! --> 22203.168m3/s 
+          criver(21) = "Parana              "
+          inb(21) = 1
+          iirnf(1:1,21) = 58
+          ijrnf(1:1,21) = 24
+          zrnfm(1:jpmois,21) = (/   &
+              24803.,   26836.,   24585.,   21358.,   20041.,   21689.,   &
+              22647.,   20403.,   19627.,   21400.,   21126.,   21923./)
+          ! 22-Negro (Argentina)  41S02  62W47              R2
+          ! Old=30 km3/year=951m3/s; UNESCO(65-79,p330)=765m3/s; ratio=1.24
+          ! --> 907.666687m3/s
+          criver(22) = "Rio Negro           "
+          inb(22) = 1
+          iirnf(1:1,22) = 56
+          ijrnf(1:1,22) = 22
+          zrnfm(1:jpmois,22) = (/   &
+              882.,     587.,     519.,     482.,     623.,     984.,   &
+              1120.,   1294.,    1092.,    1166.,    1105.,    1038./)
+          ! 23- Tocantins :  ~48W00 ~0.5S                   R4
+          ! UNESCO(76-77+80-81, p335)=12167m3/s (station far inland!)
+          ! --> 12173.082m3/s
+          criver(23) = "Tocantins           "
+          inb(23) = 1
+          iirnf(1:1,23) = 60
+          ijrnf(1:1,23) = 38
+          zrnfm(1:jpmois,23) = (/   &
+              15507.,  24855.,  27854.,  24257.,  15860.,   7861.,   &
+              4440.,   3082.,   2728.,   3417.,   5511.,  10705. /)
+
+          ! Total run-offs(II)=256755.75
+          ! Total run-offs(I+II)=317730
+
+          ! III EUROPE
+          ! ----------
+          ! 26-Rhone (France) 43N20 4E50                    R1 
+          ! Old=49 km3/year=1553m3/s; UNESCO(65-83, p512)=1229
+          ! --> 1217.16663m3/s
+          criver(26) = "Rhone               "
+          inb(26) = 1
+          iirnf(1:1,26) = 76
+          ijrnf(1:1,26) = 55
+          zrnfm(1:jpmois,26) = (/   &
+              1385.,    1848.,    1568.,    1311.,    1420.,    1191.,   &
+              937.,     796.,     794.,     962.,    1161.,    1233./)
+          ! 27-Po (Italy) 41N10 11E09                       R1 
+          ! Old=46 km3/year=1458m3/s; UNESCO(65-84, p527)=1550m3/s
+          ! --> 1550.08337m3/s
+          criver(27) = "Po                  "
+          inb(27) = 1
+          iirnf(1:1,27) = 79
+          ijrnf(1:1,27) = 54
+          zrnfm(1:jpmois,27) = (/   &
+              1304.,    1605.,    1856.,    1549.,    1958.,    1760.,   &
+              1040.,    1007.,    1615.,    1907.,    1772.,    1228./)
+          ! 28-Danube (Roumania) 45N20 29E40                R1 
+          ! Old=206 km3/year=6527m3/s; UNESCO(65-84, p544)=7011m3/s
+          ! --> 7011.8335m3/s
+          criver(28) = "Danube              "
+          inb(28) = 1
+          iirnf(1:1,28) = 87
+          ijrnf(1:1,28) = 53
+          zrnfm(1:jpmois,28) = (/   &
+              6625.,    7352.,    7986.,    9279.,    9482.,    8618.,   &
+              7586.,    6001.,    5210.,    4989.,    4921.,    6093./)
+
+          ! 29-Volga
+          criver(29) = "Volga               "
+          inb(29) = 1
+          iirnf(1:1,29) = 4
+          ijrnf(1:1,29) = 56
+          zrnfm(1:jpmois,29) = 0.
+          ! 30-Dniepr
+          criver(30) = "Dniepr+Don          "
+          inb(30)= 2
+          iirnf(1:2,30) = (/ 89, 90 /)
+          ijrnf(1:2,30) = (/ 56, 56 /)
+
+          ! Total run-offs(III)=9779.08301m3/s
+          ! Total run-offs(I+II+III)=327509.094m3/s
+
+          ! IV EURASIAN ARCTIC
+          ! ------------------
+          ! 31-Iana (Russia)      126E40 72N25              R1
+          ! Old=29 km3/year=919m3/s; UNESCO(65-72+74+76-84, p463)=936m3/s
+          ! --> 0m3/s
+          criver(31) = "Iana                "
+          inb(31) = 1
+          iirnf(1:1,31) = 20
+          ijrnf(1:1,31) = 68
+          zrnfm(1:jpmois,31) = (/   &
+              2.,       1.,       0.,       0.,     917.,    3514.,   &
+              2968.,    2329.,    1322.,   178.,      36.,       8./)
+          ! 32-Ob (Russia) 66N45 69E30                      R1 
+          ! Old=385 km3/year=12200m3/s; UNESCO(65-84, p478)=12862m3/s
+          ! --> 12861.5m3/s
+          criver(32) = "Ob                  "
+          inb(32) = 1
+          iirnf(1:1,32) = 78
+          ijrnf(1:1,32) = 72
+          zrnfm(1:jpmois,32) = (/   &
+              4977.,    4150.,    3611.,    3590.,   14723.,   33366.,   &
+              30773.,   22785.,   14701.,    9705.,    6078.,    5879./)
+          ! 33-Yenesei (Russia) 71N50 82E40                 R1 
+          ! Old=560 km3/year=17745m3/s; UNESCO(65-84, p472)=17462m3/s
+          ! --> 17461.666m3/s
+          criver(33) = "Yenesei             "
+          inb(33) = 1
+          iirnf(1:1,33) = 77
+          ijrnf(1:1,33) = 75
+          zrnfm(1:jpmois,33) = (/   &
+              6659.,    7007.,    6895.,    7089.,   24183.,   74965.,   &
+              25325.,   15940.,   16050.,   12678.,    6741.,    6008./)
+          ! 34-Severnaya Dvina(Russia)64N32 40E30           R5 
+          ! Old=106 km3/year=3359m3/s; not in UNESCO data base
+          ! --> 3359.00024m3/s
+          criver(34) = "Severnaya Dvina     "
+          inb(34) = 1
+          iirnf(1:1,34) = 78
+          ijrnf(1:1,34) = 68
+          zrnfm(1:jpmois,34) = 3359.
+          ! 35-Lena (Russia) 72N25 126E40                   R1 
+          ! --> 16192.333m3/s
+          criver(35) = "Lena                "
+          inb(35) = 1
+          iirnf(1:1,35) = 20
+          ijrnf(1:1,35) = 68
+          zrnfm(1:jpmois,35) = (/   &
+              2663.,    2095.,    1629.,    1324.,    7203.,   64230.,   &
+              40810.,   28310.,   25995.,   13299.,    3673.,    3077./)
+          ! 36-Kolyma (Russia) 69N30 161E00                 R1
+          ! Old=71 km3/year=2250m3/s; UNESCO(65-84)=2138m3/s
+          ! --> 2138.66675m3/s
+          criver(36) = "Kolyma              "
+          inb(36) = 1
+          iirnf(1:1,36) = 24
+          ijrnf(1:1,36) = 65
+          zrnfm(1:jpmois,36) = (/   &
+              131.,      92.,      76.,      65.,    2576.,    9143.,   &
+              4670.,    3727.,    3226.,    1119.,     630.,     209./)
+          ! 37-Indigirka (russia) 70N48 148E54              R1 
+          ! Old=55 km3/year=1743m3/s; UNESCO(65-68+70+72-84)=1622.
+          ! --> 1622.00012m3/s
+          criver(37) = "Indigirka           "
+          inb(37) = 1
+          iirnf(1:1,37) = 23
+          ijrnf(1:1,37) = 66
+          zrnfm(1:jpmois,37) = (/   &
+              32.,      17.,      11.,       7.,     354.,    5629.,   &
+              5210.,    4617.,    2823.,     559.,     142.,      63./)
+          ! 38-Khatanga
+          criver(38) = "Khatanga             "
+          inb(38) = 1
+          iirnf(1:1,38) = 20
+          ijrnf(1:1,38) = 72
+          zrnfm(1:jpmois,38) = 0.
+
+          ! Total run-offs(IV)=40773.6641m3/s
+          ! Total run-offs(I+II+III+IV)=368282.75m3/s
+
+          ! V ASIA
+          ! ------
+          ! 41-Amur (Russia) 52N56 141E10                   R2
+          ! Old=325 km3/year=10299m3/s; UNESCO(65-84, p451)=8792m3/s; ratio=1.17
+          ! --> 10299.332m3/s
+          criver(41) = "Amur                "
+          inb(41) = 1
+          iirnf(1:1,41) = 18
+          ijrnf(1:1,41) = 59
+          zrnfm(1:jpmois,41) = (/   &
+              2108.,    1543.,    1252.,    4088.,   15464.,   17336.,   &
+              16100.,   20801.,   21548.,   15658.,    5188.,    2506./)
+          ! 42-Liaohe (China) 40N40 122E09                  R5
+          ! Old=6 km3/year=190m3/s; not found in UNESCO data base
+          ! --> 189.999985m3/s
+          criver(42) = "Liaohe              "
+          inb(42) = 1
+          iirnf(1:1,42) = 15
+          ijrnf(1:1,42) = 54
+          zrnfm(1:jpmois,42) = 190.
+          ! 43-Daling (China) 40N56 121E43                  R5
+          ! Old=1 km3/year=32m3/s; not found in UNESCO data base
+          ! --> 31.9999962m3/s
+          criver(43) = "Daling              "
+          inb(43) = 1
+          iirnf(1:1,43) = 15
+          ijrnf(1:1,43) = 54
+          zrnfm(1:jpmois,43) = 32.
+          ! 44-Haiho (China) 6N17   1E23
+          ! Old=2 km3/year=64m3/s; not found in UNESCO data base
+          ! --> 63.9999924m3/s
+          criver(44) = "Haiho               "
+          inb(44) = 0
+          iirnf(1:1,44) = 0
+          ijrnf(1:1,44) = 0
+          zrnfm(1:jpmois,44) = 64.
+          ! 45-Yellow/Huangho (China) 37N32 118E19          R2 
+          ! Old=49 km3/year=1553m3/s; UNESCO(p371)=1210m3/s; ratio=1.28
+          ! --> 1552.5m3/s
+          criver(45) = "Yellow/Huangho      "
+          inb(45) = 1
+          iirnf(1:1,45) = 13
+          ijrnf(1:1,45) = 51
+          zrnfm(1:jpmois,45) = (/   &
+              697.,     674.,    1282.,    1206.,    1109.,     778.,   &
+              1964.,    3270.,    3668.,    2133.,     978.,     871./)
+          ! 46-Yangtze (China) 31N48 121E10=Changjiang      R2
+          ! Old=900 km3/year=28520m3/s; UNESCO(p372)=25032m3/s; ratio=1.14
+          ! --> 28519.584m3/s
+          criver(46) = "Yangtze             "
+          inb(46) = 1
+          iirnf(1:1,46) = 13
+          ijrnf(1:1,46) = 50
+          zrnfm(1:jpmois,46) = (/   &
+              10994.,   10548.,   13254.,   24097.,   36972.,   47197.,   &
+              53891.,   42070.,   37627.,   30762.,   22046.,   12777./)
+          ! 47-Pearl/Zhujiang (China) 23N36 106E34=Xijiang  R2 
+          ! Old=302 km3/year=9570m3/s; UNESCO(76,82, p373)=6987m3/s; ratio=1.37
+          ! --> 9570.75m3/s
+          criver(47) = "Pearl Zhujiang       "
+          inb(47) = 1
+          iirnf(1:1,47) = 12
+          ijrnf(1:1,47) = 48
+          zrnfm(1:jpmois,47) = (/   &
+              2357.,    2415.,    2634.,    6446.,   14246.,   18395.,   &
+              19213.,   17558.,   12312.,    7255.,    5864.,    6154./)
+          ! 48-Red/Hungho (Vietnam) 20N17 106E34            R5 
+          ! Old=123 km3/year=3897m3/s; not in UNESCO data base
+          ! --> 3897.m3/s
+          criver(48) = "Red Hungho          "
+          inb(48) = 1
+          iirnf(1:1,48) = 10
+          ijrnf(1:1,48) = 47
+          zrnfm(1:jpmois,48) = 3897.
+          ! 49-Mekong (Vietnam) 10N33 105E24                R5
+          ! Old=470 km3/year=14893m3/s; not in UNESCO data base
+          ! --> 14893.0029m3/s
+          criver(49) = "Mekong              "
+          inb(49) = 1
+          iirnf(1:1,49) =  8
+          ijrnf(1:1,49) = 44
+          zrnfm(1:jpmois,49) = 14893.
+          ! 50-Irrawady (Burma) 15N50  95E06                R5
+          ! Old=428 km3/year=13563m3/s; not in UNESCO data base
+          ! --> 13563.m3/s
+          criver(50) = "Irrawady            "
+          inb(50) = 1
+          iirnf(1:1,50) =  6
+          ijrnf(1:1,50) = 46
+          zrnfm(1:jpmois,50) = 13563.
+          ! 51-Ganges+Brahmaputra (Beng.) 22N00  91E00      R1
+          ! Old=971 km3/year=30769m3/s; UNESCO(69-70+73-75, p367)=31760m3/s
+          ! --> 32147.498m3/s
+          criver(51) = "Ganges              "
+          inb(51) = 2
+          iirnf(1:2,51) = (/  4,  5 /)
+          ijrnf(1:2,51) = (/ 47, 47 /)
+          zrnfm(1:jpmois,51) = (/   &
+              6623.,    6315.,    6432.,    9410.,   17263.,   38302.,   &
+              64688.,   80338.,   84802.,   43387.,   17888.,   10322./)
+          ! 52-Mehandi (India)                              R5
+          ! Old=67 km3/year=2123m3/s; not in UNESCO data base
+          ! --> 0m3/s
+          criver(52) = "Mehandi             "
+          inb(52) = 0
+          iirnf(1:1,52) = 0
+          ijrnf(1:1,52) = 0
+          zrnfm(1:jpmois,52) = 2123.
+          ! 53-Damodar (India)                              R2
+          ! Old=10 km3/year=320m3/s; UNESCO(p386)=173m3/s; ratio=1.85
+          ! --> 432.916656m3/s
+          criver(53) = "Damodar             "
+          inb(53) = 0
+          iirnf(1:1,53) = 0
+          ijrnf(1:1,53) = 0
+          zrnfm(1:jpmois,53) = (/   &
+              51.,      37.,      42.,      49.,      85.,     296.,   &
+              896.,    1390.,    1591.,     542.,     172.,      44./)  
+          ! 54-Godavari (India) 17N00  81E45                R2
+          ! Old=84 km3/year=2662m3/s; UNESCO(p379)=1916m3/s; ratio=1.39
+          ! --> 3670.5m3/s
+          criver(54) = "Godaravi            "
+          inb(54) = 1
+          iirnf(1:1,54) =  3
+          ijrnf(1:1,54) = 46
+          zrnfm(1:jpmois,54) = (/   &
+              988.,     737.,     280.,     219.,     196.,    1691.,   &
+              8063.,   14571.,   11428.,    3953.,    1221.,     699./)
+          ! 55-Indus (Pakistan) 24N20  67E47                R2
+          ! Old=238 km3/year=7542m3/s; UNESCO (76-79, p428)=2396m3/s; ratio=3.15
+          ! --> 7562.m3/s
+          criver(55) = "Indus               "
+          inb(55) = 1
+          iirnf(1:1,55) = 89
+          ijrnf(1:1,55) = 47
+          zrnfm(1:jpmois,55) = (/   &
+              988.,     737.,    1904.,    1968.,    3625.,    6143.,   &
+              15969.,    36656.,  17173.,    3215.,    1251.,    1115./)
+          ! 56-Tigris and Euphrates (Iraq) 31N00  47E25     R1
+          ! Old=46 km3/year=1458m3/s; UNESCO(76-79, p428)=2396m3/s
+          ! --> 2248.8335m3/s
+          criver(56) = "Tigris              "
+          inb(56) = 1
+          iirnf(1:1,56) = 88
+          ijrnf(1:1,56) = 47
+          zrnfm(1:jpmois,56) = (/   &
+              1872.,    2127.,    2962.,    4944.,    5036.,    3078.,   &
+              1362.,     900.,     786.,     993.,    1184.,    1742./)
+
+          ! Total run-offs (V)=128642.922m3/s
+          ! Total run-offs (I+II+III+IV+V)=496925.688m3/s
+
+          ! VI AFRICA
+          ! ----------
+          ! 61-Nile (Egypt) 30N10  31E06                    R1
+          ! Old=30 km3/year=951m3/s; UNESCO(73-84)=1251m3/s
+          ! --> 1251.33337m3/s
+          criver(61) = "Nile                "
+          inb(61) = 1
+          iirnf(1:1,61) = 90
+          ijrnf(1:1,61) = 50
+          zrnfm(1:jpmois,61) = (/   &
+              1239.,    1035.,    1126.,    1110.,    1170.,    1542.,   &
+              1742.,    1559.,    1191.,    1103.,    1075.,    1124./)
+          ! 62-Niger (Nigeria) 5N33   6E33                  R1
+          ! Old=192 km3/year=6084m3/s; HLA=5545m3/s;
+          ! Data from HLA: 4.5N -  6  E   1950/87
+          ! --> 5545.08301m3/s
+          criver(62) = "Niger               "
+          inb(62) = 1
+          iirnf(1:1,62) = 74
+          ijrnf(1:1,62) = 41
+          zrnfm(1:jpmois,62) = (/   &
+              2029.,    1804.,    1573.,    1418.,    1494.,    2561.,   &
+              5272.,    9629.,   14951.,   16227.,    6842.,    2741./)
+          ! 63-Zaire/Congo (Congo) 6S04  12E24              R1      
+          ! Old=1250 km3/year=39610m3/s; UNESCO(65-83, p149)=41941m3/s; HLA
+          ! =39720m3/s
+          ! Data from HLA: 6S - 12  E   1902/96
+          ! --> 39719.5m3/s
+          criver(63) = "Zaire Congo         "
+          inb(63) = 1
+          iirnf(1:1,63) = 75
+          ijrnf(1:1,63) = 33
+          zrnfm(1:jpmois,63) = (/   &
+              47200.,   37692.,   34374.,   36603.,   37862.,   35588.,   &
+              30966.,   30774.,   35981.,   42825.,   51455.,   55314./)
+          ! 64-Orange (Sth Africa) 28S41 16E28              R5
+          ! Old=11 km3/year=349m3/s
+          ! --> 349.000031m3/s
+          criver(64) = "Orange              "
+          inb(64) = 1
+          iirnf(1:1,64) = 76
+          ijrnf(1:1,64) = 26
+          zrnfm(1:jpmois,64) = 349.
+          ! 65-Zambesi (Mozambique) 18S55 36E04             R5
+          ! Old=223 km3/year=7066m3/s
+          ! --> 7066.00049m3/s
+          criver(65) = "Zambesi             "
+          inb(65) = 1
+          iirnf(1:1,65) = 81
+          ijrnf(1:1,65) = 29
+          zrnfm(1:jpmois,65) = 7066.
+          ! 66-Limpopo (mozambique) 25S15 33E30             R5
+          ! Old=5 km3/year=158m3/s
+          ! --> 158.m3/s
+          criver(66) = "Limpopo             "
+          inb(66) = 1
+          iirnf(1:1,66) = 81
+          ijrnf(1:1,66) = 28
+          zrnfm(1:jpmois,66) = 158.
+          ! 67-Rufiji (tanzania) 8S00 39E20                 R5
+          ! Old=9 km3/year=285m3/s
+          ! --> 285.m3/s
+          criver(67) = "Rufiji             "
+          inb(67) = 1
+          iirnf(1:1,67) = 82
+          ijrnf(1:1,67) = 33
+          zrnfm(1:jpmois,67) = 285.
+          ! Other rivers from the Gulf of Guinea
+          ! 68-Kouilou (Congo)  4.5S-11.5E (UNESCO=p51)     R1
+          ! Data from HLA:  4S - 11  E   1953/86 = 919m3/s
+          ! --> 924.25m3/s
+          criver(68) = "Kouilou            "
+          inb(68) = 1
+          iirnf(1:1,68) = 75
+          ijrnf(1:1,68) = 33
+          zrnfm(1:jpmois,68) = (/   &
+              1115.,    1166.,    1285.,    1462.,    1454.,     725.,   &
+              480.,     378.,     327.,     400.,    1018.,    1281./)
+          ! 69-Nyanga (Gabon)  3S-10E (UNESCO=p66)          R1
+          ! Data from HLA: 2.8N - 10  E   1952/82 = 264m3/s
+          ! --> 264.166687m3/s
+          criver(69) = "Nyanga              "
+          inb(69) = 1
+          iirnf(1:1,69) = 74
+          ijrnf(1:1,69) = 36
+          zrnfm(1:jpmois,69) = (/   &
+              126.,      99.,     143.,     253.,     316.,     300.,   &
+              156.,      93.,     231.,     557.,     592.,     304./)
+          ! 70-Ogoue (Gabon) 1S-9E (UNESCO, p69)            R1
+          ! Data from HLA: .75S -  9  E   1930/90 = 4512m3/s
+          ! --> 4511.83301m3/s
+          criver(70) = "Ogoue               "
+          inb(70) = 1
+          iirnf(1:1,70) = 74
+          ijrnf(1:1,70) = 37
+          zrnfm(1:jpmois,70) = (/   &
+              4514.,    3988.,    4622.,    5403.,    5790.,    4145.,   &
+              2616.,    1961.,    2119.,    4304.,    7870.,    6810./)
+          ! 71-Sanaga (Cameroun) 3.5N-9.5E (UNESCO, p31)    R1
+          ! Data from HLA: 3.9N -  9.6E   1944/80 = 1983m3/s
+          ! --> 1982.58337m3/s
+          criver(71) = "Sanaga              "
+          inb(71) = 1
+          iirnf(1:1,71) = 74
+          ijrnf(1:1,71) = 41
+          zrnfm(1:jpmois,71) = (/   &
+              813.,     578.,     517.,     633.,     909.,    1278.,   &
+              1928.,    2653.,    4361.,    5470.,    3307.,    1344./)
+          ! 72-Nyong (Cameroun) 3.1N-9.5E (UNESCO, p36)     R1
+          ! Data from HLA: 3.5N -  9.8E   1951/84 = 432m3/s
+          ! --> 431.166656m3/s      
+          criver(72) = "Nyong               "
+          inb(72) = 1
+          iirnf(1:1,72) = 74
+          ijrnf(1:1,72) = 41
+          zrnfm(1:jpmois,72) = (/   &
+              232.,     128.,     150.,     266.,     402.,     459.,   &
+              353.,     306.,     604.,     930.,     878.,     466./)
+          ! 73-Ntem (Cameroun) 2.5N-9.5E (UNESCO, p36)      R1
+          ! Data from HLA: 3N -  9.8E   1951/87 = 330m3/s      
+          ! --> 329.75m3/s
+          criver(73) = "Ntem                "
+          inb(73) = 1
+          iirnf(1:1,73) = 74
+          ijrnf(1:1,73) = 41
+          zrnfm(1:jpmois,73) = (/   &
+              452.,     455.,     492.,     466.,     482.,     251.,   &
+              151.,     108.,      87.,     133.,     395.,     485./)
+          ! 74-Wouri (Cameroun) 4N-9.5E (UNESCO, p34)       R1
+          ! Data from HLA: 4N -  9.5E   1951/84  = 307m3/s
+          ! --> 306.583374m3/s
+          criver(74) = "Wouri               "
+          inb(74) = 1
+          iirnf(1:1,74) = 74
+          ijrnf(1:1,74) = 41
+          zrnfm(1:jpmois,74) = (/   &
+              88.,      63.,      68.,      95.,     139.,     222.,   &
+              395.,     633.,     825.,     675.,     328.,     148./)
+          ! 75-Oueme (Benin) 6.5N-2.5E (UNESCO, p27)        R1
+          ! Data from HLA:  6.2N -  2.5E   1951/84 =113m3/s
+          ! --> 112.666664m3/s
+          criver(75) = "Oueme               "
+          inb(75) = 1
+          iirnf(1:1,75) = 73
+          ijrnf(1:1,75) = 42
+          zrnfm(1:jpmois,75) = (/   &
+              0.,       0.,       0.,       0.,       1.,      18.,   &
+              96.,     324.,     531.,     319.,      58.,       5./)
+          ! 76-Mono(Tepetou,Benin/Togo) 6.25N-1.8E (U, p27) R1
+          ! Data from HLA: 6.2N -  1  E   1951/85  = 96m3/s       
+          ! --> 96.4999924m3/s
+          criver(76) = "Mono                "
+          inb(76) = 1
+          iirnf(1:1,76) = 72
+          ijrnf(1:1,76) = 42
+          zrnfm(1:jpmois,76) = (/   &
+              2.,       1.,       1.,       4.,       8.,      44.,   &
+              168.,     274.,     386.,     215.,      47.,       8./)
+          ! 77-Comoe (Ivory Coast) 5N-4W (UNESCO, p56)      R1
+          ! Data from HLA: 5.1N -  4  W   1955/86 = 194m3/s       
+          ! --> 194.25m3/s
+          criver(77) = "Comoe               "
+          inb(77) = 1
+          iirnf(1:1,77) = 71
+          ijrnf(1:1,77) = 41
+          zrnfm(1:jpmois,77) = (/   &
+              14.,       7.,       9.,      17.,      29.,      90.,   &
+              145.,     349.,     740.,     688.,     198.,      45./)
+          ! 78-Sassandra (Ivory Coast) 5N-6W (UNESCO, p58)  R1
+          ! Data from HLA: 5N -  6  W   1953/86 = 449m3/s
+          ! --> 449.333344m3/s
+          criver(78) = "Sassandra           "
+          inb(78) = 1
+          iirnf(1:1,78) = 71
+          ijrnf(1:1,78) = 41
+          zrnfm(1:jpmois,78) = (/   &
+              144.,     116.,     119.,     143.,     156.,     334.,   &
+              419.,     692.,    1277.,    1190.,     553.,     249./)
+          ! 79-Jubba (Somali Coast)
+          criver(79) = "Jubba               "
+          inb(79) = 1
+          iirnf(1:1,79) = 84
+          ijrnf(1:1,79) = 39
+          zrnfm(1:jpmois,79) = 0.
+          ! 80-Senaga
+          criver(80) = "Senegal             "
+          inb(79) = 1
+          iirnf(1:1,80) = 66
+          ijrnf(1:1,80) = 47
+          zrnfm(1:jpmois,79) = 0.
+      
+          ! Total run-offs (VI)=63977.m3/s
+          ! Total run-offs (I+II+III+IV+V+VI)=560902.688m3/s
+          
+          ! VII OCEANIA
+          ! ------------
+          ! 91-Murray (Australia) 35S34 138E54              R5
+          ! Old=22 km3/year=697m3/s
+          ! --> 696.999939m3/s
+          criver(91) = "Murray              "
+          inb(91) = 1
+          iirnf(1:1,91) = 16
+          ijrnf(1:1,91) = 24
+          zrnfm(1:jpmois,91) = 697.
+          ! 92-Haast (N. Zeland) 43S50 169E02               R5
+          ! Old=6 km3/year=190m3/s
+          ! --> 189.999985m3/s
+          criver(92) = "Haast               "
+          inb(92) = 1
+          iirnf(1:1,92) = 24
+          ijrnf(1:1,92) = 22
+          zrnfm(1:jpmois,92) = 190.
+          ! 93-Fly (N. Guinea) 8S30 143E05                  R5
+          ! Old=77 km3/year=2440m3/s
+          ! --> 2440.m3/s
+          criver(93) = "Fly                 "
+          inb(93) = 1
+          iirnf(1:1,93) = 19
+          ijrnf(1:1,93) = 31
+          zrnfm(1:jpmois,93) = 2440.
+          ! 94-Purari (N. Guinea) 7S25 145E05               R4
+          ! Old=77 km3/year=2440m3/s; UNESCO(77+83,p595)=2727m3/s
+          ! --> 2727.33325m3/s
+          criver(94) = "Purari              "
+          inb(94) = 1
+          iirnf(1:1,94) = 19
+          ijrnf(1:1,94) = 33
+          zrnfm(1:jpmois,94) = (/   &
+              1972.,    3067.,    2332.,    2981.,    2693.,    2876.,   &
+              2867.,    3477.,    2195.,    2967.,    2674.,    2627./)
+          ! 95-Choshui ch''i (taiwan) 24N03 120E23          R2
+          ! Old=6 km3/year=190m3/s; UNESCO(65-68, p374)=120m3/s; ratio=1.58 
+          ! --> 0.m3/s
+          criver(95) = "Choshui             "
+          inb(95) = 1
+          iirnf(1:1,95) = 12
+          ijrnf(1:1,95) = 48
+          zrnfm(1:jpmois,95) = (/   &
+              65.,      63.,      83.,     100.,     177.,     535.,   &
+              332.,     313.,     236.,     193.,     101.,      84./)
+          ! 96-Kaoping (Taiwan)                             R5  
+          ! Old=9 km3/year=285m3/s
+          ! --> 0.m3/s
+          criver(96) = "Kaoping             "
+          inb(96) = 0
+          iirnf(1:1,96) = 0
+          ijrnf(1:1,96) = 0
+          zrnfm(1:jpmois,96) = 285.
+          ! 97-Tsengwen (Taiwan)                            R5
+          ! Old=2 km3/year=63m3/s
+          ! --> 0.m3/s
+          criver(97) = "Tsengwen            "
+          inb(97) = 0
+          iirnf(1:1,97) = 0
+          ijrnf(1:1,97) = 0
+          zrnfm(1:jpmois,97) = 63.
+          ! 98-Hualien (Taiwan)                             R5
+          ! Old=4 km3/year=127m3/s
+          ! --> 0.m3/s
+          criver(98) = "Hualien             "
+          inb(98) = 0
+          iirnf(1:1,98) = 0
+          ijrnf(1:1,98) = 0
+          zrnfm(1:jpmois,98) = 127.
+          ! 99-Peinan (Taiwan) 22N46 121E10                 R5
+          ! Old=4 km3/year=127m3/s
+          ! --> 127.000008m3/s
+          criver(99) = "Peinan              "
+          inb(99) = 1
+          iirnf(1:1,99) = 12
+          ijrnf(1:1,99) = 48
+          zrnfm(1:jpmois,99) = 127.
+          ! 100-Hsiukuluan (Taiwan)                         R5
+          ! Old=4 km3/year=127m3/s
+          ! --> 0.m3/s
+          criver(100) = "Hsiukuluan          "
+          inb(100) = 0
+          iirnf(1:1,100) = 0
+          ijrnf(1:1,100) = 0
+          zrnfm(1:jpmois,100) = 127.
+
+          !  Total run-offs(VII)=6181.33301m3/s
+          
+
+          ! VIII ANTARCTICA
+          ! ---------------
+          ! 103 -Antarctic ice discharge (2 613 Gt/year) (jacobs et al 1992)
+          ! Data from Jacobs et al 92: =2613 km3/year=82857.686454 m3/s
+          ! --> 82858 m3/s
+          criver(103) = "Antarctica         "
+          inb(103) = 108
+          iirnf(1:108,103) = (/   &
+               2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15,16,17,18,19,20,   &
+              21,22,23,24,25,25,24,24,24,25,26,27,28,29,30,31,32,33,34,   &
+              35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,51,53,   &
+              53,53,53,54,54,54,56,57,57,57,57,57,57,57,57,57,57,58,59,   &
+              60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,   &
+              79,80,81,82,83,84,85,86,87,88,89,90,91 /)
+          ijrnf(1:108,103) = (/   &
+              12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,11,11,   &
+              10,10, 9, 9, 8, 7, 6, 5, 3, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3,   &
+               3, 4, 5, 6, 6, 6, 7, 7, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7,   &
+               8, 9,10,10,11,12,13,12,11,10, 9, 8, 7, 6, 5, 4, 3, 2, 2,   &
+               2, 2, 2, 2, 3, 4, 4, 5, 7, 8, 9, 9, 9, 9, 9, 9,10,10,10,   &
+              10,10,10,10,11,12,12,12,12,11,11,10,10 /)
+          zrnfm(1:jpmois,100) = 82858.0
+                   
+
+          !  Total run-offs(I+II+III+IV+V+VI+VII)= 567084. m3/s
+          !                                      = 1.588668056E-6 kg/m2/s
+          !                                      = 17883.5586 km3/Year
+          !                                      = 0.567083955 Sverdrup
+      ENDIF
+
+      !!----------------------------------------------------------------------
+      !!  OPA 8.5, LODYC-IPSL (2002)
+      !!----------------------------------------------------------------------
+
+      IF( kt == nit000 ) THEN
+         IF(lwp) WRITE(numout,*)
+         IF(lwp) WRITE(numout,*) 'flxrnf : runoff + orca4'
+         IF(lwp) WRITE(numout,*) '~~~~~~'
+         IF(lwp) WRITE(numout,*) '   nrunoff = ', nrunoff
+         IF(lwp) WRITE(numout,*)
+      ENDIF
+
+      ! 0. initialization and  indexes  modification for zoom version
+      ! --------------------------------------------------------------
+      
+      
+      ! conversion factor m3/s --> kg/m2/s *e1t*e2t
+
+      zconv = rauw
+
+      IF( kt == nit000 ) THEN 
+         ! Set runoffs and upstream coeff to zero
+         runoff (:,:) = 0.e0                                                                                  
+         upsrnfh(:,:) = 0.e0
+         upsrnfz(:)   = 0.e0
+         upsadv (:,:) = 0.e0
+         zcoefr(:,:,:) = 0.e0
+
+         IF( nrunoff == 0 ) THEN
+            IF(lwp) WRITE(numout,*)
+            IF(lwp) WRITE(numout,*) ' NO RUNOFF in this simulation '
+            IF(lwp) WRITE(numout,*)
+         ENDIF
+      ENDIF
+
+      IF( kt == nit000 ) THEN
+         IF( nrunoff >= 1 ) THEN 
+            zbilan = 0.0 
+!OCL SCALAR
+            DO jr = 1, jpriv-1
+               inbp = inb(jr)
+               IF( inbp /= 0 ) THEN
+                  ii = mj0(iirnf(1,jr))
+                  ij = mi0(ijrnf(1,jr))
+                  ii = MAX( 2, MIN( ii, jpi-1 ) )
+                  ij = MAX( 2, MIN( ij, jpj-1 ) )
+!OCL SCALAR
+                  IF( tmask(ii,ij,1) <= 0.5 ) THEN 
+                     IF(lwp) WRITE(numout,*) 'Erreur riviere masquee   ', ii, ij, jr, criver(jr)
+                  ENDIF
+                  IF( tmask(ii-1,ij,1)*tmask(ii+1,ij,1)   &
+                     *tmask(ii,ij-1,1)*tmask(ii,ij+1,1) /= 0. )THEN 
+                     IF(lwp) WRITE(numout,*) 'Erreur riviere non cotiere ',ii, ij, jr, criver(jr)
+                  ENDIF
+                  DO nrnf1 = 1, jpmois
+                     zbilan = zbilan + zrnfm(nrnf1,jr) * tmask(ii,ij,1)
+                  END DO
+               ENDIF
+            END DO
+            IF(lwp) WRITE(numout,*) 'zrnfm (runoff) ', zero, zconv, rauw, SUM(zrnfm)
+            IF(lwp) THEN 
+               WRITE(numout,'("Total runoff : ",1E30.15)' ) zbilan
+               WRITE(numout,*) 'Run-off : POSITION and value '
+               WRITE(numout,*) 'ji jj glamt gphit annual mask 12-month '
+!OCL SCALAR
+               DO jr = 1, jpriv-1
+                  inbp = inb(jr)
+                  IF(inbp /= 0) THEN
+!OCL SCALAR
+                     DO jl = 1, inbp
+                        ii = mj0(iirnf(jl,jr))
+                        ij = mi0(ijrnf(jl,jr))
+                        WRITE(numout,'(2I3,1X,1A20,2X,2I4,2F7.1,1I3,1PE10.1,1I2,12E9.1)')   &
+                           jr, jl, criver(jr),   &
+                           ii, ij, glamt(ii,ij), gphit(ii,ij), inbp,   &
+                           SUM(zrnfm(1:jpmois,jr))/float(inbp),   &
+                           NINT(tmask(ii,ij,1)),   &
+                           zrnfm(1:jpmois,jr)/float(inbp)
+                     END DO
+                  ENDIF
+               END DO
+            ENDIF
+            IF(lwp) WRITE(numout,*) ' zrnfm (runoff) ', zero, zconv, rauw, SUM(zrnfm)
+         ENDIF
+      ENDIF
+
+      ! 1. initialization of the runoff array
+      ! -------------------------------------
+
+      IF( nrunoff == 1 .OR. nrunoff == 2) THEN
+
+         iman  = jpmois
+         
+         i15 = nday/16
+         
+         imois = nmonth + i15 - 1
+         IF( imois == 0) imois = iman
+         IF( nn_leap_year == 1 .AND. MOD( nyear, 4 ) == 0 ) THEN
+            ! Number of Day Between Data
+            idbd = nbiss(imois)
+         ELSEIF( nn_leap_year > 1 ) THEN
+            idbd = nn_leap_year
+         ELSE
+            idbd = nobis(imois)
+         ENDIF
+         ! Number of days between imois, 15 and the end of month
+         idmeom = idbd - 15
+         
+         ! 1.1 Calendar computation
+         
+         ! nrnf1 number of the first array record used in the simulation
+         ! nrnf2 number of the last  array record
+         
+         nrnf1 = imois
+         nrnf2 = nrnf1 + 1
+         nrnf1 = MOD( nrnf1, iman )
+         IF( nrnf1 == 0 ) nrnf1 = iman
+         nrnf2 = MOD( nrnf2, iman )
+         IF( nrnf2 == 0 ) nrnf2 = iman
+         
+         IF( kt == nit000 ) THEN
+            IF(lwp) WRITE(numout,*)
+            IF(lwp) WRITE(numout,*) 'flxrnf routine'
+            IF(lwp) WRITE(numout,*) 'first array record used nrnf1 ',nrnf1
+            IF(lwp) WRITE(numout,*) 'last  array record used nrnf2 ',nrnf2
+            IF(lwp) WRITE(numout,*) 'total zrnfm ', SUM(zrnfm)
+            IF(lwp) WRITE(numout,*) 'total surface ', SUM(e1t*e2t*tmask(:,:,1))
+         ENDIF
+
+         zxy = FLOAT( nday + idmeom - idbd * i15 ) / idbd
+
+!OCL SCALAR
+         DO jr = 1, jpriv-1
+            inbp = inb(jr)
+!OCL SCALAR
+            IF( inbp /= 0 ) THEN
+               DO jl = 1, inbp
+                  ii = iirnf(jl,jr) - nimpp + 1 - jpizoom + 1
+                  ij = ijrnf(jl,jr) - njmpp + 1 - jpjzoom + 1
+                  iipt0 = MAX( 1, MIN( ii, jpi   ) )
+                  iipt1 = MAX( 0, MIN( ii, jpi-1 ) )
+                  ijpt0 = MAX( 1, MIN( ij, jpj   ) )
+                  ijpt1 = MAX( 0, MIN( ij, jpj-1 ) )
+                  DO jj = ijpt0, ijpt1
+                     DO ji = iipt0, iipt1
+                        runoff(ji,jj) = runoff(ji,jj)   & 
+                                      + ( (1.-zxy) * zrnfm(nrnf1,jr)   &
+                                      +       zxy  * zrnfm(nrnf2,jr)  ) / FLOAT(inbp)      
+                     END DO
+                  END DO
+               END DO
+            ENDIF
+         END DO
+
+
+         ! 2. conversion in mm/day
+         ! -----------------------
+         !     C a u t i o n : upward water flux, runoff is negative
+
+         runoff(:,:) = -zconv * runoff(:,:) / ( e1t(:,:) * e2t(:,:) )
+         
+
+         ! 3. advectve coefficient
+         ! -----------------------
+
+         !  Creates the array coef that contains the coefficient to affect to
+         !  the upstream scheme. advection scheme will be:
+         !  coefr * upstream + (1- coefr) centered
+         !  coefr must be between 0 and 1.
+         !  3 values are used: maximum = zrup1, between zrup2, small zrup3.
+         ! 
+         IF( nrunoff == 2 .AND. kt == nit000 ) THEN
+
+            zrup1 = 0.5
+            zrup2 = 0.25
+            zrup3 = 0.125
+            DO jr = 1, jpriv-1
+               inbp = inb(jr)
+               IF( inbp /= 0) THEN
+                  DO jl = 1, inbp
+                     ! --> zrup1 (originally, = 1 = all upstream).
+                     ! ji,jj
+                     ii = iirnf(jl,jr) - nimpp + 1 - jpizoom - 1
+                     ij = ijrnf(jl,jr) - njmpp + 1 - jpjzoom - 1
+                     iipt0 = MAX( 1, MIN( ii,jpi  ) )
+                     iipt1 = MAX( 0, MIN( ii,jpi-1) )
+                     ijpt0 = MAX( 1, MIN( ij,jpj  ) )
+                     ijpt1 = MAX( 0, MIN( ij,jpj-1) )
+                     DO jj = ijpt0, ijpt1
+                        DO ji = iipt0, iipt1
+                           DO jn = 1, 3
+                              zcoefr(ji,jj,jn) = zrup1
+                           END DO
+                           zcoefr(ji,jj,4) = zrup2
+                           zcoefr(ji,jj,5) = zrup3
+                        END DO
+                     END DO
+                     ! --> zrup2 (originally = 0.5)
+                     ! ji,jj+1
+                     ijpt0 = MAX( 1, MIN( ij+1, jpj  ) )
+                     ijpt1 = MAX( 0, MIN( ij+1, jpj-1) )
+                     DO jj = ijpt0, ijpt1
+                        DO ji = iipt0, iipt1
+                           DO jn = 1, 3
+                              zcoefr(ji,jj,jn) = MAX( zrup2, zcoefr(ji,jj,jn) )
+                           END DO
+                           zcoefr(ji,jj,4) = MAX( zrup3, zcoefr(ji,jj,4) )
+                        END DO
+                     END DO
+                     ! ji,jj-1
+                     ijpt0 = MAX( 1, MIN( ij-1, jpj  ) )
+                     ijpt1 = MAX( 0, MIN( ij-1, jpj-1) )
+                     DO jj = ijpt0, ijpt1
+                        DO ji = iipt0, iipt1
+                           DO jn = 1, 3
+                              zcoefr(ji,jj,jn) = MAX( zrup2, zcoefr(ji,jj,jn) )
+                           END DO
+                           zcoefr(ji,jj,4) = MAX( zrup3, zcoefr(ji,jj,4) )
+                        END DO
+                     END DO
+                     ! ji+1,jj-1
+                     iipt0 = MAX( 1, MIN( ii+1, jpi  ) )
+                     iipt1 = MAX( 0, MIN( ii+1, jpi-1) )
+                     DO jj = ijpt0, ijpt1
+                        DO ji = iipt0, iipt1
+                           DO jn = 1, 3
+                              zcoefr(ji,jj,jn) = MAX( zrup2, zcoefr(ji,jj,jn) )
+                           END DO
+                           zcoefr(ji,jj,4) = MAX( zrup3, zcoefr(ji,jj,4) )
+                        END DO
+                     END DO
+                     ! ji+1,jj
+                     ijpt0 = MAX( 1, MIN( ij, jpj  ) )
+                     ijpt1 = MAX( 0, MIN( ij, jpj-1) )
+                     DO jj = ijpt0, ijpt1
+                        DO ji = iipt0, iipt1
+                           DO jn = 1, 3
+                              zcoefr(ji,jj,jn) = MAX( zrup2, zcoefr(ji,jj,jn) )
+                           END DO
+                           zcoefr(ji,jj,4) = MAX( zrup3, zcoefr(ji,jj,4) )
+                        END DO
+                     END DO
+                     ! ji+1,jj+1
+                     ijpt0 = MAX( 1, MIN( ij+1,jpj  ) )
+                     ijpt1 = MAX( 0, MIN( ij+1,jpj-1) )
+                     DO jj = ijpt0, ijpt1
+                        DO ji = iipt0, iipt1
+                           DO jn = 1, 3
+                              zcoefr(ji,jj,jn) = MAX( zrup2, zcoefr(ji,jj,jn) )
+                           END DO
+                           zcoefr(ji,jj,4) = MAX( zrup3, zcoefr(ji,jj,4) )
+                        END DO
+                     END DO
+                     ! ji-1,jj+1
+                     iipt0 = MAX( 1, MIN( ii-1,jpi  ) )
+                     iipt1 = MAX( 0, MIN( ii-1,jpi-1) )
+                     DO jj = ijpt0, ijpt1
+                        DO ji = iipt0, iipt1
+                           DO jn = 1, 3
+                              zcoefr(ji,jj,jn) = MAX( zrup2, zcoefr(ji,jj,jn) )
+                           END DO
+                           zcoefr(ji,jj,4) = MAX( zrup3, zcoefr(ji,jj,4) )
+                        END DO
+                     END DO
+                     ! ji-1,jj
+                     ijpt0 = MAX( 1, MIN( ij,jpj  ) )
+                     ijpt1 = MAX( 0, MIN( ij,jpj-1) )
+                     DO jj = ijpt0, ijpt1
+                        DO ji = iipt0, iipt1
+                           DO jn = 1, 3
+                              zcoefr(ji,jj,jn) = MAX( zrup2, zcoefr(ji,jj,jn) )
+                           END DO
+                           zcoefr(ji,jj,4) = MAX( zrup3, zcoefr(ji,jj,4) )
+                        END DO
+                     END DO
+                     ! ji-1,jj-1
+                     ijpt0 = MAX( 1, MIN( ij-1,jpj  ) )
+                     ijpt1 = MAX( 0, MIN( ij-1,jpj-1) )
+                     DO jj = ijpt0, ijpt1
+                        DO ji = iipt0, iipt1
+                           DO jn = 1, 3
+                              zcoefr(ji,jj,jn) = MAX( zrup2, zcoefr(ji,jj,jn) )
+                           END DO
+                           zcoefr(ji,jj,4) = MAX( zrup3, zcoefr(ji,jj,4) )
+                        END DO
+                     END DO
+                     ! --> zrup3 (originally = 0.25)
+                     ! ji-1,jj+2
+                     ijpt0 = MAX( 1, MIN( ij+2,jpj  ) )
+                     ijpt1 = MAX( 0, MIN( ij+2,jpj-1) )
+                     DO jj = ijpt0, ijpt1
+                        DO ji = iipt0, iipt1
+                           DO jn = 1, 3
+                              zcoefr(ji,jj,jn) = MAX( zrup3, zcoefr(ji,jj,jn) )
+                           END DO
+                        END DO
+                     END DO
+                     ! ji-1,jj-2
+                     ijpt0 = MAX( 1, MIN( ij-2,jpj  ) )
+                     ijpt1 = MAX( 0, MIN( ij-2,jpj-1) )
+                     DO jj = ijpt0, ijpt1
+                        DO ji = iipt0, iipt1
+                           DO jn = 1, 3 
+                              zcoefr(ji,jj,jn) = MAX( zrup3, zcoefr(ji,jj,jn) )
+                           END DO
+                        END DO
+                     END DO
+                     ! ji,jj-2
+                     iipt0 = MAX( 1, MIN( ii,jpi  ) )
+                     iipt1 = MAX( 0, MIN( ii,jpi-1) )
+                     DO jj = ijpt0, ijpt1
+                        DO ji = iipt0, iipt1
+                           DO jn = 1, 3 
+                              zcoefr(ji,jj,jn) = MAX( zrup3, zcoefr(ji,jj,jn) )
+                           END DO
+                        END DO
+                     END DO
+                     ! ji,jj+2
+                     ijpt0 = MAX( 1, MIN( ij+2,jpj  ) )
+                     ijpt1 = MAX( 0, MIN( ij+2,jpj-1) )
+                     DO jj = ijpt0, ijpt1
+                        DO ji = iipt0, iipt1
+                           DO jn = 1, 3
+                              zcoefr(ji,jj,jn) = MAX( zrup3, zcoefr(ji,jj,jn) )
+                           END DO
+                        END DO
+                     END DO
+                     ! ji+1,jj-2
+                     iipt0 = MAX( 1, MIN( ii+1,jpi  ) )
+                     iipt1 = MAX( 0, MIN( ii+1,jpi-1) )
+                     DO jj = ijpt0, ijpt1
+                        DO ji = iipt0, iipt1
+                           DO jn = 1, 3 
+                              zcoefr(ji,jj,jn) = MAX( zrup3, zcoefr(ji,jj,jn) )
+                           END DO
+                        END DO
+                     END DO
+                     ! ji+1,jj+2
+                     ijpt0 = MAX( 1, MIN( ij+2,jpj  ) )
+                     ijpt1 = MAX( 0, MIN( ij+2,jpj-1) )
+                     DO jj = ijpt0, ijpt1
+                        DO ji = iipt0, iipt1
+                           DO jn = 1, 3 
+                              zcoefr(ji,jj,jn) = MAX( zrup3, zcoefr(ji,jj,jn) )
+                           END DO
+                        END DO
+                     END DO
+                     ! ji+2,jj-2
+                     iipt0 = MAX( 1, MIN( ii+2,jpi  ) )
+                     iipt1 = MAX( 0, MIN( ii+2,jpi-1) )
+                     DO jj = ijpt0, ijpt1
+                        DO ji = iipt0, iipt1
+                           DO jn = 1, 3 
+                              zcoefr(ji,jj,jn) = MAX( zrup3, zcoefr(ji,jj,jn) )
+                           END DO
+                        END DO
+                     END DO
+                     ! ji+2,jj+2
+                     ijpt0 = MAX( 1, MIN( ij+2,jpj  ) )
+                     ijpt1 = MAX( 0, MIN( ij+2,jpj-1) )
+                     DO jj = ijpt0, ijpt1
+                        DO ji = iipt0, iipt1
+                           DO jn = 1, 3  
+                              zcoefr(ji,jj,jn) = MAX( zrup3, zcoefr(ji,jj,jn) )
+                           END DO
+                        END DO
+                     END DO
+                     ! ji+2,jj-1
+                     ijpt0 = MAX( 1, MIN( ij-1,jpj  ) )
+                     ijpt1 = MAX( 0, MIN( ij-1,jpj-1) )
+                     DO jj = ijpt0, ijpt1
+                        DO ji = iipt0, iipt1
+                           DO jn = 1, 3
+                              zcoefr(ji,jj,jn) = MAX( zrup3, zcoefr(ji,jj,jn) )
+                           END DO
+                        END DO
+                     END DO
+                     ! ji+2,jj+1
+                     ijpt0 = MAX( 1, MIN( ij+1,jpj  ) )
+                     ijpt1 = MAX( 0, MIN( ij+1,jpj-1) )
+                     DO jj = ijpt0, ijpt1
+                        DO ji = iipt0, iipt1
+                           DO jn = 1, 3 
+                              zcoefr(ji,jj,jn) = MAX( zrup3, zcoefr(ji,jj,jn) )
+                           END DO
+                        END DO
+                     END DO
+                     ! ji+2,jj
+                     ijpt0 = MAX( 1, MIN( ij,jpj  ) )
+                     ijpt1 = MAX( 0, MIN( ij,jpj-1) )
+                     DO jj = ijpt0, ijpt1
+                        DO ji = iipt0, iipt1
+                           DO jn = 1, 3
+                              zcoefr(ji,jj,jn) = MAX( zrup3, zcoefr(ji,jj,jn) )
+                           END DO
+                        END DO
+                     END DO
+                     ! ji-2,jj
+                     iipt0 = MAX( 1, MIN( ii-2,jpi  ) )
+                     iipt1 = MAX( 0, MIN( ii-2,jpi-1) )
+                     DO jj = ijpt0, ijpt1
+                        DO ji = iipt0, iipt1
+                           DO jn = 1, 3        
+                              zcoefr(ji,jj,jn) = MAX( zrup3, zcoefr(ji,jj,jn) )
+                           END DO
+                        END DO
+                     END DO
+                     ! ji-2,jj-2
+                     ijpt0 = MAX( 1, MIN( ij-2,jpj  ) )
+                     ijpt1 = MAX( 0, MIN( ij-2,jpj-1) )
+                     DO jj = ijpt0, ijpt1
+                        DO ji = iipt0, iipt1
+                           DO jn = 1, 3 
+                              zcoefr(ji,jj,jn) = MAX( zrup3, zcoefr(ji,jj,jn) )
+                           END DO
+                        END DO
+                     END DO
+                     ! ji-2,jj+2
+                     ijpt0 = MAX( 1, MIN( ij+2,jpj  ) )
+                     ijpt1 = MAX( 0, MIN( ij+2,jpj-1) )
+                     DO jj = ijpt0, ijpt1
+                        DO ji = iipt0, iipt1
+                           DO jn = 1, 3
+                              zcoefr(ji,jj,jn) = MAX( zrup3, zcoefr(ji,jj,jn) )
+                           END DO
+                        END DO
+                     END DO
+                     ! ji-2,jj-1
+                     ijpt0 = MAX( 1, MIN( ij-1,jpj  ) )
+                     ijpt1 = MAX( 0, MIN( ij-1,jpj-1) )
+                     DO jj = ijpt0, ijpt1
+                        DO ji = iipt0, iipt1
+                           DO jn = 1, 3 
+                              zcoefr(ji,jj,jn) = MAX( zrup3, zcoefr(ji,jj,jn) )
+                           END DO
+                        END DO
+                     END DO
+                     ! ji-2,jj+1
+                     ijpt0 = MAX( 1, MIN( ij+1,jpj  ) )
+                     ijpt1 = MAX( 0, MIN( ij+1,jpj-1) )
+                     DO jj = ijpt0, ijpt1
+                        DO ji = iipt0, iipt1
+                           DO jn = 1, 3 
+                              zcoefr(ji,jj,jn) = MAX( zrup3, zcoefr(ji,jj,jn) )
+                           END DO
+                        END DO
+                     END DO
+                  END DO
+               ENDIF
+            END DO
+            upsrnfh(:,:) = zcoefr(:,:,1)
+            upsrnfz(:)   = 0.e0
+            upsrnfz(1)   = 1.0
+            upsrnfz(2)   = 1.0
+            upsrnfz(3)   = zrup1
+            upsrnfz(4)   = zrup2
+            upsrnfz(5)   = zrup3
+         ENDIF
+      ENDIF
+      
+      ! Upstream and centered scheme in the vicinity of some straits
+      
+      IF( kt == nit000 ) THEN
+
+         ! ORCA_R4 configuration :
+         ! Gibraltar Strait
+         DO jj = mj0(52), mj1(53)
+            DO ji = mi0(70), mi1(71)
+               upsadv(ji,jj) = 0.5
+            END DO
+         END DO
+
+      ENDIF
Index: /trunk/NEMO/OPA_SRC/SBC/sbcssm.F90
===================================================================
--- /trunk/NEMO/OPA_SRC/SBC/sbcssm.F90	(revision 702)
+++ /trunk/NEMO/OPA_SRC/SBC/sbcssm.F90	(revision 702)
@@ -0,0 +1,147 @@
+MODULE sbcssm
+   !!======================================================================
+   !!                       ***  MODULE  sbcssm  ***
+   !! Surface module :  provide time-mean ocean surface variables
+   !!======================================================================
+   !! History :  9.0   !  06-07  (G. Madec)  Original code
+   !!----------------------------------------------------------------------
+
+   !!----------------------------------------------------------------------
+   !!   sbc_ssm        : calculate sea surface mean currents, temperature,  
+   !!                    and salinity over nn_fsbc time-step
+   !!----------------------------------------------------------------------
+   USE oce             ! ocean dynamics and tracers
+   USE dom_oce         ! ocean space and time domain
+   USE daymod          ! calendar
+   USE sbc_oce         ! Surface boundary condition: ocean fields
+   USE prtctl          ! Print control                    (prt_ctl routine)
+   USE restart         ! ocean restart
+   USE iom
+   USE in_out_manager  ! I/O manager
+
+   IMPLICIT NONE
+   PRIVATE
+
+   PUBLIC   sbc_ssm    ! routine called by step.F90
+   
+   !! * Substitutions
+#  include "domzgr_substitute.h90"
+   !!----------------------------------------------------------------------
+   !!   OPA 9.0 , LOCEAN-IPSL (2006) 
+   !! $Header: $
+   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
+
+CONTAINS
+
+   SUBROUTINE sbc_ssm( kt )
+      !!---------------------------------------------------------------------
+      !!                     ***  ROUTINE sbc_oce  ***
+      !!                     
+      !! ** Purpose :   provide ocean surface variable to sea-surface boundary
+      !!                condition computation 
+      !!                
+      !! ** Method  :   compute mean surface velocity (2 components at U and 
+      !!      V-points) [m/s], temperature [Celcius] and salinity [psu] over
+      !!      the periode (kt - nn_fsbc) to kt
+      !!---------------------------------------------------------------------
+      INTEGER, INTENT(in) ::   kt        ! ocean time step
+      !
+      REAL(wp) ::   zcoef       ! temporary scalar
+      REAL(wp) ::   zf_sbc      ! read sbc frequency 
+      !!---------------------------------------------------------------------
+      !                                                   ! ---------------------------------------- !
+      IF( nn_fsbc == 1 ) THEN                             !      Instantaneous surface fields        !
+         !                                                ! ---------------------------------------- !
+         IF( kt == nit000 ) THEN
+            IF(lwp) WRITE(numout,*)
+            IF(lwp) WRITE(numout,*) 'sbc_ssm : sea surface mean fields, nn_fsbc=1 : instantaneous values'
+            IF(lwp) WRITE(numout,*) '~~~~~~~ '
+         ENDIF
+         !
+         ssu_m(:,:) = un(:,:,1)
+         ssv_m(:,:) = vn(:,:,1)
+         sst_m(:,:) = tn(:,:,1)
+         sss_m(:,:) = sn(:,:,1)
+         !
+      ELSE
+         !                                                ! ---------------------------------------- !
+         IF( kt == nit000) THEN                           !       Initialisation: 1st time-step      !
+            !                                             ! ---------------------------------------- !
+            IF(lwp) WRITE(numout,*)
+            IF(lwp) WRITE(numout,*) 'sbc_ssm : sea surface mean fields'
+            !
+            IF( ln_rstart .AND. iom_varid( numror, 'nn_fsbc' ) > 0 ) THEN 
+               CALL iom_get( numror             , 'nn_fsbc', zf_sbc )   ! sbc frequency of previous run
+               CALL iom_get( numror, jpdom_local, 'ssu_m'  , ssu_m  )   ! sea surface mean velocity    (T-point)
+               CALL iom_get( numror, jpdom_local, 'ssv_m'  , ssv_m  )   !   "         "    velocity    (V-point)
+               CALL iom_get( numror, jpdom_local, 'sst_m'  , sst_m  )   !   "         "    temperature (T-point)
+               CALL iom_get( numror, jpdom_local, 'sss_m'  , sss_m  )   !   "         "    salinity    (T-point)
+               !
+               IF( zf_sbc /= REAL( nn_fsbc, wp ) ) THEN      ! nn_fsbc has changed between 2 runs
+                  IF(lwp) WRITE(numout,*) '~~~~~~~   restart with a change in the frequency of mean ',   &
+                     &                    'from ', zf_sbc, ' to ', nn_fsbc
+                  zcoef = REAL( nn_fsbc - 1, wp ) / zf_sbc
+                  ssu_m(:,:) = zcoef * ssu_m(:,:)
+                  ssv_m(:,:) = zcoef * ssv_m(:,:)
+                  sst_m(:,:) = zcoef * sst_m(:,:)
+                  sss_m(:,:) = zcoef * sss_m(:,:)
+               ELSE
+                  IF(lwp) WRITE(numout,*) '~~~~~~~   mean fields read in the ocean restart file'
+               ENDIF
+            ELSE
+               IF(lwp) WRITE(numout,*) '~~~~~~~   mean fields initialised to instantaneous values'
+               zcoef = REAL( nn_fsbc - 1, wp )
+               ssu_m(:,:) = zcoef * un(:,:,1)
+               ssv_m(:,:) = zcoef * vn(:,:,1)
+               sst_m(:,:) = zcoef * tn(:,:,1)
+               sss_m(:,:) = zcoef * sn(:,:,1)
+            ENDIF
+            !                                             ! ---------------------------------------- !
+         ELSEIF( MOD( kt, nn_fsbc ) == 0 ) THEN           !   Initialisation: New mean computation   !
+            !                                             ! ---------------------------------------- !
+            ssu_m(:,:) = 0.e0      ! reset to zero ocean mean sbc fields
+            ssv_m(:,:) = 0.e0
+            sst_m(:,:) = 0.e0
+            sss_m(:,:) = 0.e0
+         ENDIF
+         !                                                ! ---------------------------------------- !
+         !                                                !        Cumulate at each time step        !
+         !                                                ! ---------------------------------------- !
+         ssu_m(:,:) = ssu_m(:,:) + un(:,:,1)
+         ssv_m(:,:) = ssv_m(:,:) + vn(:,:,1)
+         sst_m(:,:) = sst_m(:,:) + tn(:,:,1)
+         sss_m(:,:) = sss_m(:,:) + sn(:,:,1)
+
+         !                                                ! ---------------------------------------- !
+         IF( MOD( kt - 1 , nn_fsbc ) == 0 ) THEN          !   Mean value at each nn_fsbc time-step   !
+            !                                             ! ---------------------------------------- !
+            zcoef = 1. / REAL( nn_fsbc, wp )
+            sst_m(:,:) = sst_m(:,:) * zcoef           ! mean SST             [Celcius]
+            sss_m(:,:) = sss_m(:,:) * zcoef           ! mean SSS             [psu]
+            ssu_m(:,:) = ssu_m(:,:) * zcoef           ! mean suface current  [m/s]
+            ssv_m(:,:) = ssv_m(:,:) * zcoef           !
+            !
+         ENDIF
+         !                                                ! ---------------------------------------- !
+         IF( lrst_oce ) THEN                              !      Write in the ocean restart file     !
+            !                                             ! ---------------------------------------- !
+            IF(lwp) WRITE(numout,*)
+            IF(lwp) WRITE(numout,*) 'sbc_ssm : sea surface mean fields written in ocean restart file ',   &
+               &                    'at it= ', kt,' date= ', ndastp
+            IF(lwp) WRITE(numout,*) '~~~~~~~'
+            zf_sbc = REAL( nn_fsbc, wp )
+            CALL iom_rstput( kt, nitrst, numrow, 'nn_fsbc', zf_sbc )    ! sbc frequency
+            CALL iom_rstput( kt, nitrst, numrow, 'ssu_m'  , ssu_m  )    ! sea surface mean fields
+            CALL iom_rstput( kt, nitrst, numrow, 'ssv_m'  , ssv_m  )
+            CALL iom_rstput( kt, nitrst, numrow, 'sst_m'  , sst_m  )
+            CALL iom_rstput( kt, nitrst, numrow, 'sss_m'  , sss_m  )
+            !
+         ENDIF
+         !
+      ENDIF
+      !
+   END SUBROUTINE sbc_ssm
+
+   !!======================================================================
+END MODULE sbcssm
Index: /trunk/NEMO/OPA_SRC/SBC/sbcssr.F90
===================================================================
--- /trunk/NEMO/OPA_SRC/SBC/sbcssr.F90	(revision 702)
+++ /trunk/NEMO/OPA_SRC/SBC/sbcssr.F90	(revision 702)
@@ -0,0 +1,202 @@
+MODULE sbcssr
+   !!======================================================================
+   !!                       ***  MODULE  sbcssr  ***
+   !! Surface module :  add to heat and fresh water fluxes a restoring term
+   !!                   toward observed SST/SSS
+   !!======================================================================
+   !! History :  9.0   !  06-06  (G. Madec)  Original code
+   !!----------------------------------------------------------------------
+
+   !!----------------------------------------------------------------------
+   !!   sbc_ssr        : add to sbc a restoring term toward SST/SSS climatology
+   !!----------------------------------------------------------------------
+   USE oce             ! ocean dynamics and tracers
+   USE dom_oce         ! ocean space and time domain
+   USE sbc_oce         ! surface boundary condition
+   USE phycst          ! physical constants
+   USE daymod          ! calendar
+   USE ocfzpt          ! ocean freezing point
+   USE sbcrnf          ! surface boundary condition : runoffs
+   USE fldread         ! read input fields
+   USE iom             ! I/O manager
+   USE in_out_manager  ! I/O manager
+   USE lib_mpp         ! distribued memory computing library
+   USE lbclnk          ! ocean lateral boundary conditions (or mpp link)
+
+   IMPLICIT NONE
+   PRIVATE
+
+   PUBLIC   sbc_ssr    ! routine called in sbcmod
+   
+   REAL(wp), ALLOCATABLE, DIMENSION(:)   ::   buffer   ! Temporary buffer for exchange
+
+   TYPE(FLD), ALLOCATABLE, DIMENSION(:) ::   sf_sst   ! structure of input SST (file informations, fields read)
+   TYPE(FLD), ALLOCATABLE, DIMENSION(:) ::   sf_sss   ! structure of input SSS (file informations, fields read)
+
+   !! * Namelist namsbc_ssr
+   INTEGER ::   nn_sst, nn_sss   ! SST/SSS indicator
+   REAL(wp) ::  dqdt  , deds     ! restoring term factor
+
+   !! * Substitutions
+#  include "domzgr_substitute.h90"
+   !!----------------------------------------------------------------------
+   !!   OPA 9.0 , LOCEAN-IPSL (2006) 
+   !! $Header: $
+   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
+
+CONTAINS
+
+   SUBROUTINE sbc_ssr( kt )
+      !!---------------------------------------------------------------------
+      !!                     ***  ROUTINE sbc_ssr  ***
+      !!
+      !! ** Purpose :   Add to heat and/or freshwater fluxes a damping term
+      !!                toward observed SST and/or SSS.
+      !!
+      !! ** Method  : - Read namelist namsbc_ssr
+      !!              - Read observed SST and/or SSS
+      !!              - at each nscb time step
+      !!                   add a retroaction term on qns    (nn_sst = 1)
+      !!                   add a damping term on emps       (nn_sss = 1)
+      !!                   add a damping term on emp & emps (nn_sss = 2)
+      !!---------------------------------------------------------------------
+      INTEGER, INTENT(in   ) ::   kt   ! ocean time step
+      !!
+      INTEGER  ::   ji, jj   ! dummy loop indices
+      REAL(wp) ::   zerp     ! local scalar
+      INTEGER  ::   ierror   ! return error code
+      !!
+      CHARACTER(len=100) ::  cn_dir          ! Root directory for location of ssr files
+      TYPE(FLD_N) ::   sn_sst, sn_sss        ! informations about the fields to be read
+      NAMELIST/namsbc_ssr/ cn_dir, nn_sst, nn_sss, dqdt, deds, sn_sst, sn_sss
+      !!----------------------------------------------------------------------
+      !                                               ! -------------------- !
+      IF( kt == nit000 ) THEN                         ! First call kt=nit000 !
+         !                                            ! -------------------- !
+         !                         ! set file information
+         nn_sst = 0
+         nn_sss = 0
+         dqdt = -40.e0
+         deds = -40.e0
+         cn_dir = './'       ! directory in which the model is executed
+         ! ... default values (NB: frequency positive => hours, negative => months)
+         !            !   file    ! frequency !  variable  ! time intep !  clim  ! starting !
+         !            !   name    !  (hours)  !   name     !   (T/F)    !  (0/1) !  record  !
+         sn_sst = FLD_N( 'sst'     ,    24.    ,  'sst'     ,  .FALSE.   ,    0   ,     0    )
+         sn_sss = FLD_N( 'sss'     ,   -12.    ,  'sss'     ,  .TRUE.    ,    0   ,     0    )
+
+         REWIND ( numnam )         ! ... read in namlist namflx
+         READ( numnam, namsbc_ssr ) 
+
+         IF(lwp) THEN              ! control print
+            WRITE(numout,*)
+            WRITE(numout,*) 'sbc_ssr : SST and/or SSS damping term '
+            WRITE(numout,*) '~~~~~~~ '
+            WRITE(numout,*) '          SST restoring term (Yes=1)             nn_sst = ', nn_sst
+            WRITE(numout,*) '          SSS damping term (Yes=1, salt flux)    nn_sss = ', nn_sss
+            WRITE(numout,*) '                           (Yes=2, volume flux) '
+            WRITE(numout,*) '          dQ/dT (restoring magnitude on SST)     dqdt     = ', dqdt, ' W/m2/K'
+            WRITE(numout,*) '          dE/dS (restoring magnitude on SST)     deds     = ', deds, ' ???'
+         ENDIF
+
+         IF( nn_sst == 1 ) THEN      ! set sf_sst structure
+            !
+            ALLOCATE( sf_sst(1), STAT=ierror )
+            IF( ierror > 0 ) THEN
+               CALL ctl_stop( 'sbc_ssr: unable to allocate sf_sst structure' )   ;   RETURN
+            ENDIF
+            ! namelist informations stored in sf_sst structures
+            WRITE( sf_sst(1)%clrootname, '(a,a)' )   TRIM( cn_dir ), TRIM( sn_sst%clname )
+            sf_sst(1)%freqh   = sn_sst%freqh
+            sf_sst(1)%clvar   = sn_sst%clvar 
+            sf_sst(1)%ln_tint = sn_sst%ln_tint
+            sf_sst(1)%nclim   = sn_sst%nclim  
+            sf_sst(1)%nstrec  = sn_sst%nstrec  
+            IF(lwp) THEN             ! control print
+               WRITE(numout,*) '   SST restoring term toward SST data in the following file: '
+               WRITE(numout,*) '               root filename: '  , trim( sf_sst(1)%clrootname ),   &
+                  &                          ' variable name: '  , trim( sf_sst(1)%clvar      )
+               WRITE(numout,*) '               frequency: '      ,       sf_sst(1)%freqh       ,   &
+                  &                          ' time interp: '    ,       sf_sst(1)%ln_tint     ,   &
+                  &                          ' climatology: '    ,       sf_sst(1)%nclim       ,   &
+                  &                          ' starting record: ',       sf_sst(1)%nstrec
+            ENDIF
+         ENDIF
+         !
+         IF( nn_sss == 1 ) THEN      ! set sf_sss structure
+            !
+            ALLOCATE( sf_sss(1), STAT=ierror )
+            IF( ierror > 0 ) THEN
+               CALL ctl_stop( 'sbc_ssr: unable to allocate sf_sss structure' )   ;   RETURN
+            ENDIF
+            ! namelist informations stored in sf_sss structures
+            WRITE( sf_sss(1)%clrootname, '(a,a)' )   TRIM( cn_dir ), TRIM( sn_sss%clname )
+            sf_sss(1)%freqh   = sn_sss%freqh
+            sf_sss(1)%clvar   = sn_sss%clvar
+            sf_sss(1)%ln_tint = sn_sss%ln_tint
+            sf_sss(1)%nclim   = sn_sss%nclim
+            sf_sss(1)%nstrec  = sn_sss%nstrec
+            IF(lwp) THEN             ! control print
+               WRITE(numout,*) '   SSS dampming  term toward SSS data in the following file: ' 
+               WRITE(numout,*) '               root filename: '  , trim( sf_sss(1)%clrootname ),   &
+                  &                          ' variable name: '  , trim( sf_sss(1)%clvar      )
+               WRITE(numout,*) '               frequency: '      ,       sf_sss(1)%freqh       ,   &
+                  &                          ' time interp: '    ,       sf_sss(1)%ln_tint     ,   &
+                  &                          ' climatology: '    ,       sf_sss(1)%nclim       ,   &
+                  &                          ' starting record: ',       sf_sss(1)%nstrec
+            ENDIF
+         ENDIF
+         !
+      ENDIF
+
+      IF( nn_sst + nn_sss /= 0 ) THEN
+
+         IF( nn_sst == 1)   CALL fld_read( kt, nn_fsbc, sf_sst )   ! Read SST data and provides it
+         !                                                         ! at the current time-step
+         IF( nn_sss == 1)   CALL fld_read( kt, nn_fsbc, sf_sss )   ! Read SSS data and provides it
+         !                                                         ! at the current time-step
+ 
+         !                                         ! ========================= !
+         IF( MOD( kt-1, nn_fsbc ) == 0 ) THEN      !    Add restoring term     !
+            !                                      ! ========================= !
+            !
+            IF( nn_sst == 1 ) THEN                   ! Temperature restoring term
+!CDIR COLLAPSE
+               qns(:,:) = qns(:,:) + dqdt * ( sst_m(:,:) - sf_sst(1)%fnow(:,:) )
+            ENDIF
+            !
+            IF( nn_sss == 1 ) THEN                   ! Salinity damping term (salt   flux, emps only)
+!CDIR COLLAPSE
+               DO jj = 1, jpj
+                  DO ji = 1, jpi
+                     zerp = deds * ( 1. - 2.*rnfmsk(ji,jj) )   &      ! No damping in vivinity of river mouths
+                        &        * ( sss_m(ji,jj) - sf_sss(1)%fnow(ji,jj) )   &
+                        &        / ( sss_m(ji,jj) + 1.e-20   )
+                     emps(ji,jj) = emps(ji,jj) + zerp
+                  END DO
+               END DO
+            ELSEIF( nn_sss == 2 ) THEN               ! Salinity damping term (volume flux, emp and emps)
+!CDIR COLLAPSE
+               DO jj = 1, jpj
+                  DO ji = 1, jpi                            
+                     zerp = deds * ( 1. - 2.*rnfmsk(ji,jj) )   &      ! No damping in vivinity of river mouths
+                        &        * ( sss_m(ji,jj) - sf_sss(1)%fnow(ji,jj) )   &
+                        &        / ( sss_m(ji,jj) + 1.e-20   )
+                     emp (ji,jj) = emp (ji,jj) + zerp
+                     emps(ji,jj) = emps(ji,jj) + zerp
+                  END DO
+               END DO
+            ENDIF
+            !
+         ENDIF
+         !
+      ENDIF
+
+      !!gm ... to be written                     ! Output sbc fields (using IOM)
+      ! prevoir comment obtenir l info sst sss ssr
+      !
+   END SUBROUTINE sbc_ssr
+      
+   !!======================================================================
+END MODULE sbcssr
