Index: branches/2016/dev_INGV_UKMO_2016/NEMOGCM/CONFIG/SHARED/namelist_ref
===================================================================
--- branches/2016/dev_INGV_UKMO_2016/NEMOGCM/CONFIG/SHARED/namelist_ref	(revision 7421)
+++ branches/2016/dev_INGV_UKMO_2016/NEMOGCM/CONFIG/SHARED/namelist_ref	(revision 7422)
@@ -552,5 +552,5 @@
 /
 !-----------------------------------------------------------------------
-&namsbc_wave   ! External fields from wave model
+&namsbc_wave   ! External fields from wave model                        (ln_wave=T)
 !-----------------------------------------------------------------------
 !              !  file name  ! frequency (hours) ! variable     ! time interp. !  clim   ! 'yearly'/ ! weights  ! rotation ! land/sea mask !
@@ -1046,5 +1046,6 @@
    rn_hsro       =  0.02   !  Minimum surface roughness
    rn_frac_hs    =   1.3   !  Fraction of wave height as roughness (if nn_z0_met=2)
-   nn_z0_met     =     2   !  Method for surface roughness computation (0/1/2)
+   nn_z0_met     =     2   !  Method for surface roughness computation (0/1/2/3)
+   !                             ! =3 requires ln_wave=T
    nn_bc_surf    =     1   !  surface condition (0/1=Dir/Neum)
    nn_bc_bot     =     1   !  bottom condition (0/1=Dir/Neum)
Index: branches/2016/dev_INGV_UKMO_2016/NEMOGCM/CONFIG/cfg.txt
===================================================================
--- branches/2016/dev_INGV_UKMO_2016/NEMOGCM/CONFIG/cfg.txt	(revision 7421)
+++ branches/2016/dev_INGV_UKMO_2016/NEMOGCM/CONFIG/cfg.txt	(revision 7422)
@@ -9,4 +9,4 @@
 ORCA2_LIM OPA_SRC LIM_SRC_2 NST_SRC
 ORCA2_OFF_PISCES OPA_SRC OFF_SRC TOP_SRC
+ORCA2_LIM_PISCES OPA_SRC LIM_SRC_2 NST_SRC TOP_SRC
 GYRE OPA_SRC
-ORCA2_LIM_PISCES OPA_SRC LIM_SRC_2 NST_SRC TOP_SRC
Index: branches/2016/dev_INGV_UKMO_2016/NEMOGCM/NEMO/OPA_SRC/DYN/dynspg_ts.F90
===================================================================
--- branches/2016/dev_INGV_UKMO_2016/NEMOGCM/NEMO/OPA_SRC/DYN/dynspg_ts.F90	(revision 7421)
+++ branches/2016/dev_INGV_UKMO_2016/NEMOGCM/NEMO/OPA_SRC/DYN/dynspg_ts.F90	(revision 7422)
@@ -15,4 +15,5 @@
    !!             3.6  ! 2013-11  (A. Coward) Update for z-tilde compatibility
    !!             3.7  ! 2015-11  (J. Chanut) free surface simplification
+   !!              -   ! 2016-12  (G. Madec, E. Clementi) update for Stoke-Drift divergence
    !!---------------------------------------------------------------------
 
@@ -38,4 +39,5 @@
    USE sbctide         ! tides
    USE updtide         ! tide potential
+   USE sbcwave         ! surface wave
    !
    USE in_out_manager  ! I/O manager
@@ -168,22 +170,23 @@
       CALL wrk_alloc( jpi,jpj,   zsshu_a, zsshv_a                  )
       CALL wrk_alloc( jpi,jpj,   zhf )
-      IF( ln_wd ) CALL wrk_alloc( jpi, jpj, zcpx, zcpy, wduflt1, wdvflt1 )
-      !
-      zmdi=1.e+20                               !  missing data indicator for masking
+      IF( ln_wd )   CALL wrk_alloc( jpi,jpj,   zcpx, zcpy, wduflt1, wdvflt1 )
+      !
       !                                         !* Local constant initialization
-      z1_12 = 1._wp / 12._wp 
+      zmdi = 1.e+20                                   !  missing data indicator for masking
+      !
+      z1_12 = 1._wp / 12._wp                          ! constants
       z1_8  = 0.125_wp                                   
       z1_4  = 0.25_wp
       z1_2  = 0.5_wp     
       zraur = 1._wp / rau0
-      !  	                                       ! reciprocal of baroclinic time step 
+      !  	                                          ! baroclinic time step 
       IF( kt == nit000 .AND. neuler == 0 ) THEN   ;   z2dt_bf =          rdt
       ELSE                                        ;   z2dt_bf = 2.0_wp * rdt
       ENDIF
-      z1_2dt_b = 1.0_wp / z2dt_bf 
-      !
-      ll_init     = ln_bt_av                       ! if no time averaging, then no specific restart 
+      z1_2dt_b = 1.0_wp / z2dt_bf                     ! reciprocal of baroclinic time step 
+      !
+      ll_init     = ln_bt_av                          ! if no time averaging, then no specific restart 
       ll_fw_start = .FALSE.
-      !                              	            ! time offset in steps for bdy data update
+      !                              	               ! time offset in steps for bdy data update
       IF( .NOT.ln_bt_fw ) THEN   ;   noffset = - nn_baro
       ELSE                       ;   noffset =   0 
@@ -255,5 +258,5 @@
             zwz(:,:) = 0._wp
             zhf(:,:) = 0._wp
-            IF ( .not. ln_sco ) THEN
+            IF( .not. ln_sco ) THEN
 
 !!gm  agree the JC comment  : this should be done in a much clear way
@@ -324,4 +327,9 @@
          END DO
       END DO
+      
+!!gm  Question here when removing the Vertically integrated trends, we remove the vertically integrated NL trends on momentum....
+!!gm  Is it correct to do so ?   I think so...
+      
+      
       !                                   !* barotropic Coriolis trends (vorticity scheme dependent)
       !                                   ! --------------------------------------------------------
@@ -373,66 +381,66 @@
       !                                   ! ----------------------------------------------------
       IF( .NOT.ln_linssh ) THEN                 ! Variable volume : remove surface pressure gradient
-        IF( ln_wd ) THEN                        ! Calculating and applying W/D gravity filters
-          wduflt1(:,:) = 1.0_wp
-          wdvflt1(:,:) = 1.0_wp
-          DO jj = 2, jpjm1
-             DO ji = 2, jpim1
-                ll_tmp1 = MIN(sshn(ji,jj), sshn(ji+1,jj)) > MAX(-bathy(ji,jj), -bathy(ji+1,jj))   &
+         IF( ln_wd ) THEN                        ! Calculating and applying W/D gravity filters
+            wduflt1(:,:) = 1.0_wp
+            wdvflt1(:,:) = 1.0_wp
+            DO jj = 2, jpjm1
+               DO ji = 2, jpim1
+                  ll_tmp1 = MIN(sshn(ji,jj), sshn(ji+1,jj)) > MAX(-bathy(ji,jj), -bathy(ji+1,jj))   &
                         & .and. MAX(sshn(ji,jj) + bathy(ji,jj), sshn(ji+1,jj) + bathy(ji+1,jj))   &
                         &  > rn_wdmin1 + rn_wdmin2
-                ll_tmp2 = MAX(sshn(ji,jj), sshn(ji+1,jj)) > MAX(-bathy(ji,jj), -bathy(ji+1,jj))   &
+                  ll_tmp2 = MAX(sshn(ji,jj), sshn(ji+1,jj)) > MAX(-bathy(ji,jj), -bathy(ji+1,jj))   &
                         &                                   + rn_wdmin1 + rn_wdmin2
-                IF(ll_tmp1) THEN
-                  zcpx(ji,jj)    = 1.0_wp
-                ELSEIF(ll_tmp2) THEN
-                   ! no worries about sshn(ji+1,jj)-sshn(ji,jj) = 0, it won't happen here
-                  zcpx(ji,jj) = ABS((sshn(ji+1,jj) + bathy(ji+1,jj) - sshn(ji,jj) - bathy(ji,jj)) &
+                  IF(ll_tmp1) THEN
+                     zcpx(ji,jj)    = 1.0_wp
+                  ELSEIF(ll_tmp2) THEN
+                     ! no worries about sshn(ji+1,jj)-sshn(ji,jj) = 0, it won't happen here
+                     zcpx(ji,jj) = ABS((sshn(ji+1,jj) + bathy(ji+1,jj) - sshn(ji,jj) - bathy(ji,jj)) &
                         &          /(sshn(ji+1,jj) - sshn(ji,jj)))
-                ELSE
-                  zcpx(ji,jj)    = 0._wp
-                  wduflt1(ji,jj) = 0.0_wp
-                END IF
-
-                ll_tmp1 = MIN(sshn(ji,jj), sshn(ji,jj+1)) > MAX(-bathy(ji,jj), -bathy(ji,jj+1))   &
+                  ELSE
+                     zcpx(ji,jj)    = 0._wp
+                     wduflt1(ji,jj) = 0.0_wp
+                  END IF
+
+                  ll_tmp1 = MIN(sshn(ji,jj), sshn(ji,jj+1)) > MAX(-bathy(ji,jj), -bathy(ji,jj+1))   &
                         & .and. MAX(sshn(ji,jj) + bathy(ji,jj), sshn(ji,jj+1) + bathy(ji,jj+1))   &
                         &  > rn_wdmin1 + rn_wdmin2
-                ll_tmp2 = MAX(sshn(ji,jj), sshn(ji,jj+1)) > MAX(-bathy(ji,jj), -bathy(ji,jj+1))   &
+                  ll_tmp2 = MAX(sshn(ji,jj), sshn(ji,jj+1)) > MAX(-bathy(ji,jj), -bathy(ji,jj+1))   &
                         &                                   + rn_wdmin1 + rn_wdmin2
-                IF(ll_tmp1) THEN
-                   zcpy(ji,jj)    = 1.0_wp
-                ELSEIF(ll_tmp2) THEN
-                   ! no worries about sshn(ji,jj+1)-sshn(ji,jj) = 0, it won't happen here
-                  zcpy(ji,jj) = ABS((sshn(ji,jj+1) + bathy(ji,jj+1) - sshn(ji,jj) - bathy(ji,jj)) &
+                  IF(ll_tmp1) THEN
+                     zcpy(ji,jj)    = 1.0_wp
+                  ELSEIF(ll_tmp2) THEN
+                     ! no worries about sshn(ji,jj+1)-sshn(ji,jj) = 0, it won't happen here
+                     zcpy(ji,jj) = ABS((sshn(ji,jj+1) + bathy(ji,jj+1) - sshn(ji,jj) - bathy(ji,jj)) &
                         &          /(sshn(ji,jj+1) - sshn(ji,jj)))
-                ELSE
-                  zcpy(ji,jj)    = 0._wp
-                  wdvflt1(ji,jj) = 0.0_wp
-                ENDIF
-
-             END DO
-           END DO
-
-           CALL lbc_lnk( zcpx, 'U', 1._wp )    ;   CALL lbc_lnk( zcpy, 'V', 1._wp )
-
-           DO jj = 2, jpjm1
-              DO ji = 2, jpim1
-                 zu_trd(ji,jj) = ( zu_trd(ji,jj) - grav * ( sshn(ji+1,jj  ) - sshn(ji  ,jj ) )   &
-                        &                        * r1_e1u(ji,jj) ) * zcpx(ji,jj) * wduflt1(ji,jj)
-                 zv_trd(ji,jj) = ( zv_trd(ji,jj) - grav * ( sshn(ji  ,jj+1) - sshn(ji  ,jj ) )   &
-                        &                        * r1_e2v(ji,jj) ) * zcpy(ji,jj) * wdvflt1(ji,jj)
-              END DO
-           END DO
-
-         ELSE
-
-           DO jj = 2, jpjm1
-              DO ji = fs_2, fs_jpim1   ! vector opt.
-                 zu_trd(ji,jj) = zu_trd(ji,jj) - grav * (  sshn(ji+1,jj  ) - sshn(ji  ,jj  )  ) * r1_e1u(ji,jj)
-                 zv_trd(ji,jj) = zv_trd(ji,jj) - grav * (  sshn(ji  ,jj+1) - sshn(ji  ,jj  )  ) * r1_e2v(ji,jj) 
-              END DO
-           END DO
-        ENDIF
-
-      ENDIF
+                  ELSE
+                     zcpy(ji,jj)    = 0._wp
+                     wdvflt1(ji,jj) = 0.0_wp
+                  ENDIF
+
+               END DO
+            END DO
+            !
+            CALL lbc_lnk( zcpx, 'U', 1._wp )    ;   CALL lbc_lnk( zcpy, 'V', 1._wp )
+            !
+            DO jj = 2, jpjm1
+               DO ji = 2, jpim1
+                  zu_trd(ji,jj) = ( zu_trd(ji,jj) - grav * ( sshn(ji+1,jj  ) - sshn(ji  ,jj ) )   &
+                         &                        * r1_e1u(ji,jj) ) * zcpx(ji,jj) * wduflt1(ji,jj)
+                  zv_trd(ji,jj) = ( zv_trd(ji,jj) - grav * ( sshn(ji  ,jj+1) - sshn(ji  ,jj ) )   &
+                         &                        * r1_e2v(ji,jj) ) * zcpy(ji,jj) * wdvflt1(ji,jj)
+               END DO
+            END DO
+            !
+         ELSE        ! no Wet & Drying
+            !
+            DO jj = 2, jpjm1
+               DO ji = fs_2, fs_jpim1   ! vector opt.
+                  zu_trd(ji,jj) = zu_trd(ji,jj) - grav * (  sshn(ji+1,jj  ) - sshn(ji  ,jj  )  ) * r1_e1u(ji,jj)
+                  zv_trd(ji,jj) = zv_trd(ji,jj) - grav * (  sshn(ji  ,jj+1) - sshn(ji  ,jj  )  ) * r1_e2v(ji,jj) 
+               END DO
+            END DO
+         ENDIF
+         !
+      ENDIF          ! end non linear free surface case
 
       DO jj = 2, jpjm1                          ! Remove coriolis term (and possibly spg) from barotropic trend
@@ -473,6 +481,7 @@
       END IF
       !
+!!gm   TOP stress only !!!   this should be with a test on ISF use or not
       !                                         ! Add top stress contribution from baroclinic velocities:      
-      IF (ln_bt_fw) THEN
+      IF( ln_bt_fw ) THEN
          DO jj = 2, jpjm1
             DO ji = fs_2, fs_jpim1   ! vector opt.
@@ -538,4 +547,9 @@
                 &                        + fwfisf(:,:) + fwfisf_b(:,:)                     )
       ENDIF
+      !
+      IF( ln_sdw ) THEN                         ! Stokes drift divergence added if necessary
+         zssh_frc(:,:) = zssh_frc(:,:) + div_sd(:,:)
+      ENDIF
+      !
 #if defined key_asminc
       !                                         ! Include the IAU weighted SSH increment
Index: branches/2016/dev_INGV_UKMO_2016/NEMOGCM/NEMO/OPA_SRC/DYN/dynstcor.F90
===================================================================
--- branches/2016/dev_INGV_UKMO_2016/NEMOGCM/NEMO/OPA_SRC/DYN/dynstcor.F90	(revision 7421)
+++ 	(revision )
@@ -1,82 +1,0 @@
-MODULE dynstcor
-   !!======================================================================
-   !!                       ***  MODULE  dynstcor  ***
-   !! Ocean dynamics: Stokes-Coriolis effect.
-   !!
-   !!======================================================================
-   !! History :  0.1  !  2012-10  (Oyvind Breivik)
-   !!----------------------------------------------------------------------
-   !! dyn_stcor        : Add the Stokes-Coriolis forcing to the momentum equation
-   !!----------------------------------------------------------------------
-   USE oce              ! ocean dynamics and tracers
-   USE dom_oce          ! ocean space and time domain
-   USE in_out_manager   ! I/O manager
-   USE lib_mpp          ! distributed memory computing
-   USE prtctl           ! Print control
-   USE phycst
-   USE lbclnk
-   USE wrk_nemo         ! Memory Allocation
-   USE sbcmod           ! Access to ln_stcor (sbc_oce) and wave parameters (sbc_wave)
-   USE sbcwave          ! Wave module
-   USE timing          ! Timing
-
-   IMPLICIT NONE
-   PRIVATE
-
-   !! * Routine accessibility
-   PUBLIC dyn_stcor      ! routine called by step.F90
-
-   !! * Substitutions
-#  include "vectopt_loop_substitute.h90"
-   !!----------------------------------------------------------------------
-   !! NEMO/OPA 3.6 , NEMO Consortium (2010)
-   !! $Id:$
-   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
-   !!----------------------------------------------------------------------
- CONTAINS
-
-   SUBROUTINE dyn_stcor( kt )
-      !!----------------------------------------------------------------------
-      !!                  ***  ROUTINE dyn_stcor ***
-      !!
-      !! ** Purpose:  Add Stokes-Coriolis forcing to horizontal momentum equation.
-      !!
-      !! ** History:  3.4  !   2012-10  (O. Breivik)   Initial version
-      !!              3.6  !   2014-10  (R. Benshila) 
-      !!----------------------------------------------------------------------
-      INTEGER, INTENT( in ) ::   kt  ! ocean time-step index
-      !!
-      INTEGER  ::  ji, jj, jk        ! dummy loop indices
-      REAL(wp) :: zx1, zx2, zy1, zy2
-      !!----------------------------------------------------------------------
-      !
-      IF( nn_timing == 1 )  CALL timing_start('dyn_stcor')
-      !
-      IF( kt == nit000 ) THEN
-         IF(lwp) WRITE(numout,*)
-         IF(lwp) WRITE(numout,*) 'dyn_stcor : time stepping'
-         IF(lwp) WRITE(numout,*) '~~~~~~~'
-      ENDIF
-
-      !
-      ! Update velocity tendencies ua, va by adding the Stokes-Coriolis velocities 
-      !
-      DO jk = 1, jpkm1
-         DO jj = 2, jpjm1
-            DO ji = 2, jpim1
-               zy1 = ff(ji  ,jj-1) * ( vsd3d(ji  ,jj-1,jk) + vsd3d(ji+1,jj-1,jk) )
-               zy2 = ff(ji  ,jj  ) * ( vsd3d(ji  ,jj  ,jk) + vsd3d(ji+1,jj  ,jk) )
-               zx1 = ff(ji-1,jj  ) * ( usd3d(ji-1,jj  ,jk) + usd3d(ji-1,jj+1,jk) )
-               zx2 = ff(ji  ,jj  ) * ( usd3d(ji  ,jj  ,jk) + usd3d(ji  ,jj+1,jk) )
-
-               ua(ji,jj,jk) = ua(ji,jj,jk) + 0.25 * ( zy1 + zy2 ) *umask(ji,jj,jk)
-               va(ji,jj,jk) = va(ji,jj,jk) - 0.25 * ( zx1 + zx2 ) *vmask(ji,jj,jk)
-            ENDDO
-         ENDDO
-      ENDDO
-      !
-      IF( nn_timing == 1 )  CALL timing_stop('dyn_stcor')
-      !
-   END SUBROUTINE dyn_stcor
-
-END MODULE dynstcor
Index: branches/2016/dev_INGV_UKMO_2016/NEMOGCM/NEMO/OPA_SRC/DYN/dynvor.F90
===================================================================
--- branches/2016/dev_INGV_UKMO_2016/NEMOGCM/NEMO/OPA_SRC/DYN/dynvor.F90	(revision 7421)
+++ branches/2016/dev_INGV_UKMO_2016/NEMOGCM/NEMO/OPA_SRC/DYN/dynvor.F90	(revision 7422)
@@ -17,4 +17,5 @@
    !!            3.7  ! 2014-04  (G. Madec) trend simplification: suppress jpdyn_trd_dat vorticity 
    !!             -   ! 2014-06  (G. Madec) suppression of velocity curl from in-core memory
+   !!             -   ! 2016-12  (G. Madec, E. Clementi) add Stokes-Coriolis trends (ln_stcor=T)
    !!----------------------------------------------------------------------
 
@@ -32,4 +33,6 @@
    USE trd_oce        ! trends: ocean variables
    USE trddyn         ! trend manager: dynamics
+   USE sbcwave        ! Surface Waves (add Stokes-Coriolis force)
+   USE sbc_oce , ONLY : ln_stcor    ! use Stoke-Coriolis force
    !
    USE lbclnk         ! ocean lateral boundary conditions (or mpp link)
@@ -77,5 +80,5 @@
 #  include "vectopt_loop_substitute.h90"
    !!----------------------------------------------------------------------
-   !! NEMO/OPA 3.7 , NEMO Consortium (2014)
+   !! NEMO/OPA 3.7 , NEMO Consortium (2016)
    !! $Id$
    !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
@@ -108,5 +111,5 @@
             ztrdu(:,:,:) = ua(:,:,:)
             ztrdv(:,:,:) = va(:,:,:)
-            CALL vor_ene( kt, nrvm, ua, va )                      ! relative vorticity or metric trend
+            CALL vor_ene( kt, nrvm, un , vn , ua, va )                    ! relative vorticity or metric trend
             ztrdu(:,:,:) = ua(:,:,:) - ztrdu(:,:,:)
             ztrdv(:,:,:) = va(:,:,:) - ztrdv(:,:,:)
@@ -114,10 +117,11 @@
             ztrdu(:,:,:) = ua(:,:,:)
             ztrdv(:,:,:) = va(:,:,:)
-            CALL vor_ene( kt, ncor, ua, va )                      ! planetary vorticity trend
+            CALL vor_ene( kt, ncor, un , vn , ua, va )                    ! planetary vorticity trend
             ztrdu(:,:,:) = ua(:,:,:) - ztrdu(:,:,:)
             ztrdv(:,:,:) = va(:,:,:) - ztrdv(:,:,:)
             CALL trd_dyn( ztrdu, ztrdv, jpdyn_pvo, kt )
-         ELSE
-            CALL vor_ene( kt, ntot, ua, va )                ! total vorticity trend
+         ELSE                                               ! total vorticity trend
+                             CALL vor_ene( kt, ntot, un , vn , ua, va )   ! total vorticity trend
+            IF( ln_stcor )   CALL vor_ene( kt, ncor, usd, vsd, ua, va )   ! add the Stokes-Coriolis trend
          ENDIF
          !
@@ -126,5 +130,5 @@
             ztrdu(:,:,:) = ua(:,:,:)
             ztrdv(:,:,:) = va(:,:,:)
-            CALL vor_ens( kt, nrvm, ua, va )                      ! relative vorticity or metric trend
+            CALL vor_ens( kt, nrvm, un , vn , ua, va )            ! relative vorticity or metric trend
             ztrdu(:,:,:) = ua(:,:,:) - ztrdu(:,:,:)
             ztrdv(:,:,:) = va(:,:,:) - ztrdv(:,:,:)
@@ -132,10 +136,11 @@
             ztrdu(:,:,:) = ua(:,:,:)
             ztrdv(:,:,:) = va(:,:,:)
-            CALL vor_ens( kt, ncor, ua, va )                      ! planetary vorticity trend
+            CALL vor_ens( kt, ncor, un , vn , ua, va )            ! planetary vorticity trend
             ztrdu(:,:,:) = ua(:,:,:) - ztrdu(:,:,:)
             ztrdv(:,:,:) = va(:,:,:) - ztrdv(:,:,:)
             CALL trd_dyn( ztrdu, ztrdv, jpdyn_pvo, kt )
-         ELSE
-            CALL vor_ens( kt, ntot, ua, va )                ! total vorticity trend
+         ELSE                                               ! total vorticity trend
+                             CALL vor_ens( kt, ntot, un , vn , ua, va )  ! total vorticity trend
+            IF( ln_stcor )   CALL vor_ens( kt, ncor, usd, vsd, ua, va )  ! add the Stokes-Coriolis trend
          ENDIF
          !
@@ -144,5 +149,5 @@
             ztrdu(:,:,:) = ua(:,:,:)
             ztrdv(:,:,:) = va(:,:,:)
-            CALL vor_ens( kt, nrvm, ua, va )                      ! relative vorticity or metric trend (ens)
+            CALL vor_ens( kt, nrvm, un , vn , ua, va )            ! relative vorticity or metric trend (ens)
             ztrdu(:,:,:) = ua(:,:,:) - ztrdu(:,:,:)
             ztrdv(:,:,:) = va(:,:,:) - ztrdv(:,:,:)
@@ -150,11 +155,12 @@
             ztrdu(:,:,:) = ua(:,:,:)
             ztrdv(:,:,:) = va(:,:,:)
-            CALL vor_ene( kt, ncor, ua, va )                      ! planetary vorticity trend (ene)
+            CALL vor_ene( kt, ncor, un , vn , ua, va )            ! planetary vorticity trend (ene)
             ztrdu(:,:,:) = ua(:,:,:) - ztrdu(:,:,:)
             ztrdv(:,:,:) = va(:,:,:) - ztrdv(:,:,:)
             CALL trd_dyn( ztrdu, ztrdv, jpdyn_pvo, kt )
-         ELSE
-            CALL vor_ens( kt, nrvm, ua, va )                ! relative vorticity or metric trend (ens)
-            CALL vor_ene( kt, ncor, ua, va )                ! planetary vorticity trend (ene)
+         ELSE                                               ! total vorticity trend
+                             CALL vor_ens( kt, nrvm, un , vn , ua, va )   ! relative vorticity or metric trend (ens)
+                             CALL vor_ene( kt, ncor, un , vn , ua, va )   ! planetary vorticity trend (ene)
+            IF( ln_stcor )   CALL vor_ene( kt, ncor, usd, vsd, ua, va )   ! add the Stokes-Coriolis trend
         ENDIF
          !
@@ -163,5 +169,5 @@
             ztrdu(:,:,:) = ua(:,:,:)
             ztrdv(:,:,:) = va(:,:,:)
-            CALL vor_een( kt, nrvm, ua, va )                      ! relative vorticity or metric trend
+            CALL vor_een( kt, nrvm, un , vn , ua, va )            ! relative vorticity or metric trend
             ztrdu(:,:,:) = ua(:,:,:) - ztrdu(:,:,:)
             ztrdv(:,:,:) = va(:,:,:) - ztrdv(:,:,:)
@@ -169,10 +175,11 @@
             ztrdu(:,:,:) = ua(:,:,:)
             ztrdv(:,:,:) = va(:,:,:)
-            CALL vor_een( kt, ncor, ua, va )                      ! planetary vorticity trend
+            CALL vor_een( kt, ncor, un , vn , ua, va )            ! planetary vorticity trend
             ztrdu(:,:,:) = ua(:,:,:) - ztrdu(:,:,:)
             ztrdv(:,:,:) = va(:,:,:) - ztrdv(:,:,:)
             CALL trd_dyn( ztrdu, ztrdv, jpdyn_pvo, kt )
-         ELSE
-            CALL vor_een( kt, ntot, ua, va )                ! total vorticity trend
+         ELSE                                               ! total vorticity trend
+                             CALL vor_een( kt, ntot, un , vn , ua, va )   ! total vorticity trend
+            IF( ln_stcor )   CALL vor_ene( kt, ncor, usd, vsd, ua, va )   ! add the Stokes-Coriolis trend
          ENDIF
          !
@@ -190,5 +197,5 @@
 
 
-   SUBROUTINE vor_ene( kt, kvor, pua, pva )
+   SUBROUTINE vor_ene( kt, kvor, pun, pvn, pua, pva )
       !!----------------------------------------------------------------------
       !!                  ***  ROUTINE vor_ene  ***
@@ -210,9 +217,9 @@
       !! References : Sadourny, r., 1975, j. atmos. sciences, 32, 680-689.
       !!----------------------------------------------------------------------
-      INTEGER , INTENT(in   )                         ::   kt     ! ocean time-step index
-      INTEGER , INTENT(in   )                         ::   kvor   ! =ncor (planetary) ; =ntot (total) ;
-      !                                                           ! =nrvm (relative vorticity or metric)
-      REAL(wp), INTENT(inout), DIMENSION(jpi,jpj,jpk) ::   pua    ! total u-trend
-      REAL(wp), INTENT(inout), DIMENSION(jpi,jpj,jpk) ::   pva    ! total v-trend
+      INTEGER , INTENT(in   )                         ::   kt          ! ocean time-step index
+      INTEGER , INTENT(in   )                         ::   kvor        ! =ncor (planetary) ; =ntot (total) ;
+      !                                                                ! =nrvm (relative vorticity or metric)
+      REAL(wp), INTENT(inout), DIMENSION(jpi,jpj,jpk) ::   pun, pvn    ! now velocities
+      REAL(wp), INTENT(inout), DIMENSION(jpi,jpj,jpk) ::   pua, pva    ! total v-trend
       !
       INTEGER  ::   ji, jj, jk           ! dummy loop indices
@@ -223,5 +230,5 @@
       IF( nn_timing == 1 )  CALL timing_start('vor_ene')
       !
-      CALL wrk_alloc( jpi, jpj, zwx, zwy, zwz ) 
+      CALL wrk_alloc( jpi,jpj,   zwx, zwy, zwz ) 
       !
       IF( kt == nit000 ) THEN
@@ -241,6 +248,6 @@
             DO jj = 1, jpjm1
                DO ji = 1, fs_jpim1   ! vector opt.
-                  zwz(ji,jj) = (  e2v(ji+1,jj  ) * vn(ji+1,jj  ,jk) - e2v(ji,jj) * vn(ji,jj,jk)    &
-                     &          - e1u(ji  ,jj+1) * un(ji  ,jj+1,jk) + e1u(ji,jj) * un(ji,jj,jk)  ) * r1_e1e2f(ji,jj)
+                  zwz(ji,jj) = (  e2v(ji+1,jj  ) * pvn(ji+1,jj  ,jk) - e2v(ji,jj) * pvn(ji,jj,jk)    &
+                     &          - e1u(ji  ,jj+1) * pun(ji  ,jj+1,jk) + e1u(ji,jj) * pun(ji,jj,jk)  ) * r1_e1e2f(ji,jj)
                END DO
             END DO
@@ -248,6 +255,6 @@
             DO jj = 1, jpjm1
                DO ji = 1, fs_jpim1   ! vector opt.
-                  zwz(ji,jj) = (   ( vn(ji+1,jj  ,jk) + vn (ji,jj,jk) ) * ( e2v(ji+1,jj  ) - e2v(ji,jj) )       &
-                       &         - ( un(ji  ,jj+1,jk) + un (ji,jj,jk) ) * ( e1u(ji  ,jj+1) - e1u(ji,jj) )   )   &
+                  zwz(ji,jj) = (   ( pvn(ji+1,jj  ,jk) + pvn (ji,jj,jk) ) * ( e2v(ji+1,jj  ) - e2v(ji,jj) )       &
+                       &         - ( pun(ji  ,jj+1,jk) + pun (ji,jj,jk) ) * ( e1u(ji  ,jj+1) - e1u(ji,jj) )   )   &
                        &     * 0.5 * r1_e1e2f(ji,jj)
                END DO
@@ -256,6 +263,6 @@
             DO jj = 1, jpjm1
                DO ji = 1, fs_jpim1   ! vector opt.
-                  zwz(ji,jj) = ff(ji,jj) + (  e2v(ji+1,jj  ) * vn(ji+1,jj  ,jk) - e2v(ji,jj) * vn(ji,jj,jk)    &
-                     &                      - e1u(ji  ,jj+1) * un(ji  ,jj+1,jk) + e1u(ji,jj) * un(ji,jj,jk)  ) &
+                  zwz(ji,jj) = ff(ji,jj) + (  e2v(ji+1,jj  ) * pvn(ji+1,jj  ,jk) - e2v(ji,jj) * pvn(ji,jj,jk)    &
+                     &                      - e1u(ji  ,jj+1) * pun(ji  ,jj+1,jk) + e1u(ji,jj) * pun(ji,jj,jk)  ) &
                      &                   * r1_e1e2f(ji,jj)
                END DO
@@ -265,6 +272,6 @@
                DO ji = 1, fs_jpim1   ! vector opt.
                   zwz(ji,jj) = ff(ji,jj)                                                                        &
-                       &     + (   ( vn(ji+1,jj  ,jk) + vn (ji,jj,jk) ) * ( e2v(ji+1,jj  ) - e2v(ji,jj) )       &
-                       &         - ( un(ji  ,jj+1,jk) + un (ji,jj,jk) ) * ( e1u(ji  ,jj+1) - e1u(ji,jj) )   )   &
+                       &     + (   ( pvn(ji+1,jj  ,jk) + pvn (ji,jj,jk) ) * ( e2v(ji+1,jj  ) - e2v(ji,jj) )       &
+                       &         - ( pun(ji  ,jj+1,jk) + pun (ji,jj,jk) ) * ( e1u(ji  ,jj+1) - e1u(ji,jj) )   )   &
                        &     * 0.5 * r1_e1e2f(ji,jj)
                END DO
@@ -282,12 +289,8 @@
          ENDIF
 
-         IF( ln_sco ) THEN
-            zwz(:,:) = zwz(:,:) / e3f_n(:,:,jk)
-            zwx(:,:) = e2u(:,:) * e3u_n(:,:,jk) * un(:,:,jk)
-            zwy(:,:) = e1v(:,:) * e3v_n(:,:,jk) * vn(:,:,jk)
-         ELSE
-            zwx(:,:) = e2u(:,:) * un(:,:,jk)
-            zwy(:,:) = e1v(:,:) * vn(:,:,jk)
-         ENDIF
+         zwz(:,:) = zwz(:,:) / e3f_n(:,:,jk)
+         zwx(:,:) = e2u(:,:) * e3u_n(:,:,jk) * pun(:,:,jk)
+         zwy(:,:) = e1v(:,:) * e3v_n(:,:,jk) * pvn(:,:,jk)
+
          !                                   !==  compute and add the vorticity term trend  =!
          DO jj = 2, jpjm1
@@ -304,5 +307,5 @@
       END DO                                           !   End of slab
       !                                                ! ===============
-      CALL wrk_dealloc( jpi, jpj, zwx, zwy, zwz ) 
+      CALL wrk_dealloc( jpi,jpj,   zwx, zwy, zwz ) 
       !
       IF( nn_timing == 1 )  CALL timing_stop('vor_ene')
@@ -311,5 +314,5 @@
 
 
-   SUBROUTINE vor_ens( kt, kvor, pua, pva )
+   SUBROUTINE vor_ens( kt, kvor, pun, pvn, pua, pva )
       !!----------------------------------------------------------------------
       !!                ***  ROUTINE vor_ens  ***
@@ -331,9 +334,9 @@
       !! References : Sadourny, r., 1975, j. atmos. sciences, 32, 680-689.
       !!----------------------------------------------------------------------
-      INTEGER , INTENT(in   )                         ::   kt     ! ocean time-step index
-      INTEGER , INTENT(in   )                         ::   kvor   ! =ncor (planetary) ; =ntot (total) ;
-         !                                                        ! =nrvm (relative vorticity or metric)
-      REAL(wp), INTENT(inout), DIMENSION(jpi,jpj,jpk) ::   pua    ! total u-trend
-      REAL(wp), INTENT(inout), DIMENSION(jpi,jpj,jpk) ::   pva    ! total v-trend
+      INTEGER , INTENT(in   )                         ::   kt          ! ocean time-step index
+      INTEGER , INTENT(in   )                         ::   kvor        ! =ncor (planetary) ; =ntot (total) ;
+         !                                                             ! =nrvm (relative vorticity or metric)
+      REAL(wp), INTENT(inout), DIMENSION(jpi,jpj,jpk) ::   pun, pvn    ! now velocities
+      REAL(wp), INTENT(inout), DIMENSION(jpi,jpj,jpk) ::   pua, pva    ! total v-trend
       !
       INTEGER  ::   ji, jj, jk   ! dummy loop indices
@@ -344,5 +347,5 @@
       IF( nn_timing == 1 )  CALL timing_start('vor_ens')
       !
-      CALL wrk_alloc( jpi, jpj, zwx, zwy, zwz ) 
+      CALL wrk_alloc( jpi,jpj,   zwx, zwy, zwz ) 
       !
       IF( kt == nit000 ) THEN
@@ -361,6 +364,6 @@
             DO jj = 1, jpjm1
                DO ji = 1, fs_jpim1   ! vector opt.
-                  zwz(ji,jj) = (  e2v(ji+1,jj  ) * vn(ji+1,jj  ,jk) - e2v(ji,jj) * vn(ji,jj,jk)    &
-                     &          - e1u(ji  ,jj+1) * un(ji  ,jj+1,jk) + e1u(ji,jj) * un(ji,jj,jk)  ) * r1_e1e2f(ji,jj)
+                  zwz(ji,jj) = (  e2v(ji+1,jj  ) * pvn(ji+1,jj  ,jk) - e2v(ji,jj) * pvn(ji,jj,jk)    &
+                     &          - e1u(ji  ,jj+1) * pun(ji  ,jj+1,jk) + e1u(ji,jj) * pun(ji,jj,jk)  ) * r1_e1e2f(ji,jj)
                END DO
             END DO
@@ -368,6 +371,6 @@
             DO jj = 1, jpjm1
                DO ji = 1, fs_jpim1   ! vector opt.
-                  zwz(ji,jj) = (   ( vn(ji+1,jj  ,jk) + vn (ji,jj,jk) ) * ( e2v(ji+1,jj  ) - e2v(ji,jj) )       &
-                       &         - ( un(ji  ,jj+1,jk) + un (ji,jj,jk) ) * ( e1u(ji  ,jj+1) - e1u(ji,jj) )   )   &
+                  zwz(ji,jj) = (   ( pvn(ji+1,jj  ,jk) + pvn (ji,jj,jk) ) * ( e2v(ji+1,jj  ) - e2v(ji,jj) )       &
+                       &         - ( pun(ji  ,jj+1,jk) + pun (ji,jj,jk) ) * ( e1u(ji  ,jj+1) - e1u(ji,jj) )   )   &
                        &     * 0.5 * r1_e1e2f(ji,jj)
                END DO
@@ -376,6 +379,6 @@
             DO jj = 1, jpjm1
                DO ji = 1, fs_jpim1   ! vector opt.
-                  zwz(ji,jj) = ff(ji,jj) + (  e2v(ji+1,jj  ) * vn(ji+1,jj  ,jk) - e2v(ji,jj) * vn(ji,jj,jk)    &
-                     &                      - e1u(ji  ,jj+1) * un(ji  ,jj+1,jk) + e1u(ji,jj) * un(ji,jj,jk)  ) &
+                  zwz(ji,jj) = ff(ji,jj) + (  e2v(ji+1,jj  ) * pvn(ji+1,jj  ,jk) - e2v(ji,jj) * pvn(ji,jj,jk)    &
+                     &                      - e1u(ji  ,jj+1) * pun(ji  ,jj+1,jk) + e1u(ji,jj) * pun(ji,jj,jk)  ) &
                      &                   * r1_e1e2f(ji,jj)
                END DO
@@ -385,6 +388,6 @@
                DO ji = 1, fs_jpim1   ! vector opt.
                   zwz(ji,jj) = ff(ji,jj)                                                                       &
-                       &     + (   ( vn(ji+1,jj  ,jk) + vn (ji,jj,jk) ) * ( e2v(ji+1,jj  ) - e2v(ji,jj) )       &
-                       &         - ( un(ji  ,jj+1,jk) + un (ji,jj,jk) ) * ( e1u(ji  ,jj+1) - e1u(ji,jj) )   )   &
+                       &     + (   ( pvn(ji+1,jj  ,jk) + pvn (ji,jj,jk) ) * ( e2v(ji+1,jj  ) - e2v(ji,jj) )       &
+                       &         - ( pun(ji  ,jj+1,jk) + pun (ji,jj,jk) ) * ( e1u(ji  ,jj+1) - e1u(ji,jj) )   )   &
                        &     * 0.5 * r1_e1e2f(ji,jj)
                END DO
@@ -402,12 +405,9 @@
          ENDIF
          !
-         IF( ln_sco ) THEN                   !==  horizontal fluxes  ==!
-            zwz(:,:) = zwz(:,:) / e3f_n(:,:,jk)
-            zwx(:,:) = e2u(:,:) * e3u_n(:,:,jk) * un(:,:,jk)
-            zwy(:,:) = e1v(:,:) * e3v_n(:,:,jk) * vn(:,:,jk)
-         ELSE
-            zwx(:,:) = e2u(:,:) * un(:,:,jk)
-            zwy(:,:) = e1v(:,:) * vn(:,:,jk)
-         ENDIF
+         !                                 !==  horizontal fluxes  ==!
+         zwz(:,:) = zwz(:,:) / e3f_n(:,:,jk)
+         zwx(:,:) = e2u(:,:) * e3u_n(:,:,jk) * pun(:,:,jk)
+         zwy(:,:) = e1v(:,:) * e3v_n(:,:,jk) * pvn(:,:,jk)
+         !
          !                                   !==  compute and add the vorticity term trend  =!
          DO jj = 2, jpjm1
@@ -424,5 +424,5 @@
       END DO                                           !   End of slab
       !                                                ! ===============
-      CALL wrk_dealloc( jpi, jpj, zwx, zwy, zwz ) 
+      CALL wrk_dealloc( jpi,jpj,   zwx, zwy, zwz ) 
       !
       IF( nn_timing == 1 )  CALL timing_stop('vor_ens')
@@ -431,5 +431,5 @@
 
 
-   SUBROUTINE vor_een( kt, kvor, pua, pva )
+   SUBROUTINE vor_een( kt, kvor, pun, pvn, pua, pva )
       !!----------------------------------------------------------------------
       !!                ***  ROUTINE vor_een  ***
@@ -448,8 +448,9 @@
       !! References : Arakawa and Lamb 1980, Mon. Wea. Rev., 109, 18-36
       !!----------------------------------------------------------------------
-      INTEGER , INTENT(in   )                         ::   kt     ! ocean time-step index
-      INTEGER , INTENT(in   )                         ::   kvor   ! =ncor (planetary) ; =ntot (total) ; =nrvm (relative or metric)
-      REAL(wp), INTENT(inout), DIMENSION(jpi,jpj,jpk) ::   pua    ! total u-trend
-      REAL(wp), INTENT(inout), DIMENSION(jpi,jpj,jpk) ::   pva    ! total v-trend
+      INTEGER , INTENT(in   )                         ::   kt          ! ocean time-step index
+      INTEGER , INTENT(in   )                         ::   kvor        ! =ncor (planetary) ; =ntot (total) ;
+         !                                                             ! =nrvm (relative vorticity or metric)
+      REAL(wp), INTENT(inout), DIMENSION(jpi,jpj,jpk) ::   pun, pvn    ! now velocities
+      REAL(wp), INTENT(inout), DIMENSION(jpi,jpj,jpk) ::   pua, pva    ! total v-trend
       !
       INTEGER  ::   ji, jj, jk   ! dummy loop indices
@@ -512,6 +513,6 @@
             DO jj = 1, jpjm1
                DO ji = 1, fs_jpim1   ! vector opt.
-                  zwz(ji,jj) = (  e2v(ji+1,jj  ) * vn(ji+1,jj  ,jk) - e2v(ji,jj) * vn(ji,jj,jk)    &
-                     &          - e1u(ji  ,jj+1) * un(ji  ,jj+1,jk) + e1u(ji,jj) * un(ji,jj,jk)  ) &
+                  zwz(ji,jj) = (  e2v(ji+1,jj  ) * pvn(ji+1,jj  ,jk) - e2v(ji,jj) * pvn(ji,jj,jk)    &
+                     &          - e1u(ji  ,jj+1) * pun(ji  ,jj+1,jk) + e1u(ji,jj) * pun(ji,jj,jk)  ) &
                      &       * r1_e1e2f(ji,jj) * z1_e3f(ji,jj)
                END DO
@@ -520,6 +521,6 @@
             DO jj = 1, jpjm1
                DO ji = 1, fs_jpim1   ! vector opt.
-                  zwz(ji,jj) = (   ( vn(ji+1,jj  ,jk) + vn (ji,jj,jk) ) * ( e2v(ji+1,jj  ) - e2v(ji,jj) )       &
-                       &         - ( un(ji  ,jj+1,jk) + un (ji,jj,jk) ) * ( e1u(ji  ,jj+1) - e1u(ji,jj) )   )   &
+                  zwz(ji,jj) = (   ( pvn(ji+1,jj  ,jk) + pvn (ji,jj,jk) ) * ( e2v(ji+1,jj  ) - e2v(ji,jj) )       &
+                       &         - ( pun(ji  ,jj+1,jk) + pun (ji,jj,jk) ) * ( e1u(ji  ,jj+1) - e1u(ji,jj) )   )   &
                        &     * 0.5 * r1_e1e2f(ji,jj) * z1_e3f(ji,jj)
                END DO
@@ -528,6 +529,6 @@
             DO jj = 1, jpjm1
                DO ji = 1, fs_jpim1   ! vector opt.
-                  zwz(ji,jj) = (  ff(ji,jj) + (  e2v(ji+1,jj  ) * vn(ji+1,jj  ,jk) - e2v(ji,jj) * vn(ji,jj,jk)    &
-                     &                         - e1u(ji  ,jj+1) * un(ji  ,jj+1,jk) + e1u(ji,jj) * un(ji,jj,jk)  ) &
+                  zwz(ji,jj) = (  ff(ji,jj) + (  e2v(ji+1,jj  ) * pvn(ji+1,jj  ,jk) - e2v(ji,jj) * pvn(ji,jj,jk)    &
+                     &                         - e1u(ji  ,jj+1) * pun(ji  ,jj+1,jk) + e1u(ji,jj) * pun(ji,jj,jk)  ) &
                      &                      * r1_e1e2f(ji,jj)    ) * z1_e3f(ji,jj)
                END DO
@@ -537,6 +538,6 @@
                DO ji = 1, fs_jpim1   ! vector opt.
                   zwz(ji,jj) = (  ff(ji,jj)                                                                        &
-                       &        + (   ( vn(ji+1,jj  ,jk) + vn (ji,jj,jk) ) * ( e2v(ji+1,jj  ) - e2v(ji,jj) )       &
-                       &            - ( un(ji  ,jj+1,jk) + un (ji,jj,jk) ) * ( e1u(ji  ,jj+1) - e1u(ji,jj) )   )   &
+                       &        + (   ( pvn(ji+1,jj  ,jk) + pvn (ji,jj,jk) ) * ( e2v(ji+1,jj  ) - e2v(ji,jj) )       &
+                       &            - ( pun(ji  ,jj+1,jk) + pun (ji,jj,jk) ) * ( e1u(ji  ,jj+1) - e1u(ji,jj) )   )   &
                        &        * 0.5 * r1_e1e2f(ji,jj)   ) * z1_e3f(ji,jj)
                END DO
@@ -557,6 +558,6 @@
          !
          !                                   !==  horizontal fluxes  ==!
-         zwx(:,:) = e2u(:,:) * e3u_n(:,:,jk) * un(:,:,jk)
-         zwy(:,:) = e1v(:,:) * e3v_n(:,:,jk) * vn(:,:,jk)
+         zwx(:,:) = e2u(:,:) * e3u_n(:,:,jk) * pun(:,:,jk)
+         zwy(:,:) = e1v(:,:) * e3v_n(:,:,jk) * pvn(:,:,jk)
 
          !                                   !==  compute and add the vorticity term trend  =!
Index: branches/2016/dev_INGV_UKMO_2016/NEMOGCM/NEMO/OPA_SRC/SBC/sbccpl.F90
===================================================================
--- branches/2016/dev_INGV_UKMO_2016/NEMOGCM/NEMO/OPA_SRC/SBC/sbccpl.F90	(revision 7421)
+++ branches/2016/dev_INGV_UKMO_2016/NEMOGCM/NEMO/OPA_SRC/SBC/sbccpl.F90	(revision 7422)
@@ -1130,10 +1130,10 @@
       !                                                      !       Stokes drift u      !
       !                                                      ! ========================= ! 
-         IF( srcv(jpr_sdrftx)%laction ) zusd2dt(:,:) = frcv(jpr_sdrftx)%z3(:,:,1)
+         IF( srcv(jpr_sdrftx)%laction ) ut0sd(:,:) = frcv(jpr_sdrftx)%z3(:,:,1)
       !
       !                                                      ! ========================= ! 
       !                                                      !       Stokes drift v      !
       !                                                      ! ========================= ! 
-         IF( srcv(jpr_sdrfty)%laction ) zvsd2dt(:,:) = frcv(jpr_sdrfty)%z3(:,:,1)
+         IF( srcv(jpr_sdrfty)%laction ) vt0sd(:,:) = frcv(jpr_sdrfty)%z3(:,:,1)
       !
       !                                                      ! ========================= ! 
@@ -1145,5 +1145,5 @@
       !                                                      !  Significant wave height  !
       !                                                      ! ========================= ! 
-         IF( srcv(jpr_hsig)%laction ) swh(:,:) = frcv(jpr_hsig)%z3(:,:,1)
+         IF( srcv(jpr_hsig)%laction ) hsw(:,:) = frcv(jpr_hsig)%z3(:,:,1)
       !
       !                                                      ! ========================= ! 
@@ -1156,7 +1156,5 @@
                                                                     .OR. srcv(jpr_hsig)%laction ) THEN
             CALL sbc_stokes()
-            IF( ln_zdfqiao .AND. .NOT. srcv(jpr_wnum)%laction ) CALL sbc_qiao()
-         ENDIF
-         IF( ln_zdfqiao .AND. srcv(jpr_wnum)%laction ) CALL sbc_qiao()
+         ENDIF
       ENDIF
       !                                                      ! ========================= ! 
Index: branches/2016/dev_INGV_UKMO_2016/NEMOGCM/NEMO/OPA_SRC/SBC/sbcmod.F90
===================================================================
--- branches/2016/dev_INGV_UKMO_2016/NEMOGCM/NEMO/OPA_SRC/SBC/sbcmod.F90	(revision 7421)
+++ branches/2016/dev_INGV_UKMO_2016/NEMOGCM/NEMO/OPA_SRC/SBC/sbcmod.F90	(revision 7422)
@@ -313,4 +313,6 @@
       IF( nn_ice == 4 )   CALL cice_sbc_init( nsbc )      ! CICE initialisation
       !
+      IF( ln_wave     )   CALL sbc_wave_init              ! surface wave initialisation
+      !
    END SUBROUTINE sbc_init
 
Index: branches/2016/dev_INGV_UKMO_2016/NEMOGCM/NEMO/OPA_SRC/SBC/sbcwave.F90
===================================================================
--- branches/2016/dev_INGV_UKMO_2016/NEMOGCM/NEMO/OPA_SRC/SBC/sbcwave.F90	(revision 7421)
+++ branches/2016/dev_INGV_UKMO_2016/NEMOGCM/NEMO/OPA_SRC/SBC/sbcwave.F90	(revision 7422)
@@ -4,56 +4,63 @@
    !! Wave module 
    !!======================================================================
-   !! History :  3.3  !   2011-09  (M. Adani)  Original code: Drag Coefficient 
-   !!         :  3.4  !   2012-10  (M. Adani)  Stokes Drift 
-   !!            3.6  !   2014-09  (E. Clementi,P. Oddo) New Stokes Drift Computation
-   !!----------------------------------------------------------------------
-
-   !!----------------------------------------------------------------------
+   !! History :  3.3  !  2011-09  (M. Adani)  Original code: Drag Coefficient 
+   !!         :  3.4  !  2012-10  (M. Adani)  Stokes Drift 
+   !!            3.6  !  2014-09  (E. Clementi,P. Oddo) New Stokes Drift Computation
+   !!             -   !  2016-12  (G. Madec, E. Clementi) update Stoke drift computation
+   !!                                                    + add sbc_wave_ini routine
+   !!----------------------------------------------------------------------
+
+   !!----------------------------------------------------------------------
+   !!   sbc_stokes    : calculate 3D Stokes-drift velocities
    !!   sbc_wave      : wave data from wave model in netcdf files 
-   !!----------------------------------------------------------------------
-   USE oce            ! 
-   USE sbc_oce	      ! Surface boundary condition: ocean fields
-   USE bdy_oce        !
-   USE domvvl         !
+   !!   sbc_wave_init : initialisation fo surface waves 
+   !!----------------------------------------------------------------------
+   USE phycst         ! physical constants 
+   USE oce            ! ocean variables
+   USE sbc_oce	       ! Surface boundary condition: ocean fields
+   USE zdf_oce,  ONLY : ln_zdfqiao
+   USE bdy_oce        ! open boundary condition variables
+   USE domvvl         ! domain: variable volume layers
+   !
    USE iom            ! I/O manager library
    USE in_out_manager ! I/O manager
    USE lib_mpp        ! distribued memory computing library
-   USE fldread	      ! read input fields
+   USE fldread	       ! read input fields
    USE wrk_nemo       !
-   USE phycst         ! physical constants 
 
    IMPLICIT NONE
    PRIVATE
 
-   PUBLIC   sbc_stokes, sbc_qiao  ! routines called in sbccpl
-   PUBLIC   sbc_wave    ! routine called in sbcmod
+   PUBLIC   sbc_stokes      ! routine called in sbccpl
+   PUBLIC   sbc_wave        ! routine called in sbcmod
+   PUBLIC   sbc_wave_init   ! routine called in sbcmod
    
    ! Variables checking if the wave parameters are coupled (if not, they are read from file)
-   LOGICAL, PUBLIC     ::   cpl_hsig=.FALSE.
-   LOGICAL, PUBLIC     ::   cpl_phioc=.FALSE.
-   LOGICAL, PUBLIC     ::   cpl_sdrftx=.FALSE.
-   LOGICAL, PUBLIC     ::   cpl_sdrfty=.FALSE.
-   LOGICAL, PUBLIC     ::   cpl_wper=.FALSE.
-   LOGICAL, PUBLIC     ::   cpl_wnum=.FALSE.
-   LOGICAL, PUBLIC     ::   cpl_wstrf=.FALSE.
-   LOGICAL, PUBLIC     ::   cpl_wdrag=.FALSE.
-
-   INTEGER ::   jpfld                ! number of files to read for stokes drift
-   INTEGER ::   jp_usd               ! index of stokes drift  (i-component) (m/s)    at T-point
-   INTEGER ::   jp_vsd               ! index of stokes drift  (j-component) (m/s)    at T-point
-   INTEGER ::   jp_swh               ! index of significant wave hight      (m)      at T-point
-   INTEGER ::   jp_wmp               ! index of mean wave period            (s)      at T-point
-
-   TYPE(FLD), ALLOCATABLE, DIMENSION(:)  :: sf_cd    ! structure of input fields (file informations, fields read) Drag Coefficient
-   TYPE(FLD), ALLOCATABLE, DIMENSION(:)  :: sf_sd    ! structure of input fields (file informations, fields read) Stokes Drift
-   TYPE(FLD), ALLOCATABLE, DIMENSION(:)  :: sf_wn    ! structure of input fields (file informations, fields read) wave number for Qiao
-   TYPE(FLD), ALLOCATABLE, DIMENSION(:)  :: sf_tauoc ! structure of input fields (file informations, fields read) normalized wave stress into the ocean
-   REAL(wp), PUBLIC, ALLOCATABLE, DIMENSION(:,:)       :: cdn_wave 
-   REAL(wp), PUBLIC, ALLOCATABLE, DIMENSION(:,:)       :: swh,wmp, wnum
-   REAL(wp), PUBLIC, ALLOCATABLE, DIMENSION(:,:)       :: tauoc_wave
-   REAL(wp), PUBLIC, ALLOCATABLE, DIMENSION(:,:)       :: tsd2d
-   REAL(wp), PUBLIC, ALLOCATABLE, DIMENSION(:,:)       :: zusd2dt, zvsd2dt
-   REAL(wp), PUBLIC, ALLOCATABLE, DIMENSION(:,:,:)     :: usd3d, vsd3d, wsd3d 
-   REAL(wp), PUBLIC, ALLOCATABLE, DIMENSION(:,:,:)     :: usd3dt, vsd3dt
+   LOGICAL, PUBLIC ::   cpl_hsig   = .FALSE.
+   LOGICAL, PUBLIC ::   cpl_phioc  = .FALSE.
+   LOGICAL, PUBLIC ::   cpl_sdrftx = .FALSE.
+   LOGICAL, PUBLIC ::   cpl_sdrfty = .FALSE.
+   LOGICAL, PUBLIC ::   cpl_wper   = .FALSE.
+   LOGICAL, PUBLIC ::   cpl_wnum   = .FALSE.
+   LOGICAL, PUBLIC ::   cpl_wstrf  = .FALSE.
+   LOGICAL, PUBLIC ::   cpl_wdrag  = .FALSE.
+
+   INTEGER ::   jpfld    ! number of files to read for stokes drift
+   INTEGER ::   jp_usd   ! index of stokes drift  (i-component) (m/s)    at T-point
+   INTEGER ::   jp_vsd   ! index of stokes drift  (j-component) (m/s)    at T-point
+   INTEGER ::   jp_hsw   ! index of significant wave hight      (m)      at T-point
+   INTEGER ::   jp_wmp   ! index of mean wave period            (s)      at T-point
+
+   TYPE(FLD), ALLOCATABLE, DIMENSION(:) ::   sf_cd      ! structure of input fields (file informations, fields read) Drag Coefficient
+   TYPE(FLD), ALLOCATABLE, DIMENSION(:) ::   sf_sd      ! structure of input fields (file informations, fields read) Stokes Drift
+   TYPE(FLD), ALLOCATABLE, DIMENSION(:) ::   sf_wn      ! structure of input fields (file informations, fields read) wave number for Qiao
+   TYPE(FLD), ALLOCATABLE, DIMENSION(:) ::   sf_tauoc   ! structure of input fields (file informations, fields read) normalized wave stress into the ocean
+   REAL(wp), PUBLIC, ALLOCATABLE, DIMENSION(:,:)   ::   cdn_wave            !:
+   REAL(wp), PUBLIC, ALLOCATABLE, DIMENSION(:,:)   ::   hsw, wmp, wnum      !: 
+   REAL(wp), PUBLIC, ALLOCATABLE, DIMENSION(:,:)   ::   tauoc_wave          !:  
+   REAL(wp), PUBLIC, ALLOCATABLE, DIMENSION(:,:)   ::   tsd2d               !: 
+   REAL(wp), PUBLIC, ALLOCATABLE, DIMENSION(:,:)   ::   div_sd              !: barotropic stokes drift divergence
+   REAL(wp), PUBLIC, ALLOCATABLE, DIMENSION(:,:)   ::   ut0sd, vt0sd        !: surface Stokes drift velocities at t-point
+   REAL(wp), PUBLIC, ALLOCATABLE, DIMENSION(:,:,:) ::   usd  , vsd  , wsd   !: Stokes drift velocities at u-, v- & w-points, resp.
 
    !! * Substitutions
@@ -78,51 +85,67 @@
       !! ** action  
       !!---------------------------------------------------------------------
-      INTEGER                ::   jj,ji,jk 
-      REAL(wp)                       ::  ztransp, zfac, zsp0, zk, zus, zvs
-      REAL(wp), DIMENSION(:,:,:), POINTER :: ze3hdiv   ! 3D workspace
-      !!---------------------------------------------------------------------
-      !
-
-      CALL wrk_alloc( jpi,jpj,jpk, ze3hdiv )
-      DO jk = 1, jpk
-         DO jj = 1, jpj
-            DO ji = 1, jpi
-               ! On T grid
-               ! Stokes transport speed estimated from Hs and Tmean
-               ztransp = 2.0_wp*rpi*swh(ji,jj)**2.0_wp/(16.0_wp*MAX(wmp(ji,jj),0.0000001_wp))
+      INTEGER  ::   jj, ji, jk   ! dummy loop argument
+      INTEGER  ::   ik           ! local integer 
+      REAL(wp) ::  ztransp, zfac, ztemp, zsp0
+      REAL(wp) ::  zdep_u, zdep_v, zkh_u, zkh_v, zda_u, zda_v
+      REAL(wp), DIMENSION(:,:)  , POINTER ::   zk_t, zk_u, zk_v, zu0_sd, zv0_sd   ! 2D workspace
+      REAL(wp), DIMENSION(:,:,:), POINTER ::   ze3divh                            ! 3D workspace
+      !!---------------------------------------------------------------------
+      !
+      CALL wrk_alloc( jpi,jpj,jpk,   ze3divh )
+      CALL wrk_alloc( jpi,jpj,       zk_t, zk_u, zk_v, zu0_sd, zv0_sd )
+      !
+      !
+      zfac =  2.0_wp * rpi / 16.0_wp
+      DO jj = 1, jpj                ! exp. wave number at t-point    (Eq. (19) in Breivick et al. (2014) )
+         DO ji = 1, jpi
+               ! Stokes drift velocity estimated from Hs and Tmean
+               ztransp = zfac * hsw(ji,jj)*hsw(ji,jj) / MAX( wmp(ji,jj) , 0.0000001_wp )
                ! Stokes surface speed
-               zsp0 = SQRT( zusd2dt(ji,jj)**2 + zvsd2dt(ji,jj)**2)
+               zsp0 = SQRT( ut0sd(ji,jj)*ut0sd(ji,jj) + vt0sd(ji,jj)*vt0sd(ji,jj) )
+               tsd2d(ji,jj) = zsp0
                ! Wavenumber scale
-               zk = ABS(zsp0)/MAX(ABS(5.97_wp*ztransp),0.0000001_wp)
-               ! Depth attenuation
-               zfac = EXP(-2.0_wp*zk*gdept_n(ji,jj,jk))/(1.0_wp+8.0_wp*zk*gdept_n(ji,jj,jk))
+               zk_t(ji,jj) = ABS( zsp0 ) / MAX( ABS( 5.97_wp*ztransp ) , 0.0000001_wp )
+         END DO
+      END DO      
+      DO jj = 1, jpjm1              ! exp. wave number & Stokes drift velocity at u- & v-points
+         DO ji = 1, jpim1
+            zk_u(ji,jj) = 0.5_wp * ( zk_t(ji,jj) + zk_t(ji+1,jj) )
+            zk_v(ji,jj) = 0.5_wp * ( zk_t(ji,jj) + zk_t(ji,jj+1) )
+            !
+            zu0_sd(ji,jj) = 0.5_wp * ( ut0sd(ji,jj) + ut0sd(ji+1,jj) )
+            zv0_sd(ji,jj) = 0.5_wp * ( vt0sd(ji,jj) + vt0sd(ji,jj+1) )
+         END DO
+      END DO
+      !
+      !                       !==  horizontal Stokes Drift 3D velocity  ==!
+      DO jk = 1, jpkm1
+         DO jj = 2, jpjm1
+            DO ji = 2, jpim1
+               zdep_u = 0.5_wp * ( gdept_n(ji,jj,jk) + gdept_n(ji+1,jj,jk) )
+               zdep_v = 0.5_wp * ( gdept_n(ji,jj,jk) + gdept_n(ji,jj+1,jk) )
+               !                          
+               zkh_u = zk_u(ji,jj) * zdep_u     ! k * depth
+               zkh_v = zk_v(ji,jj) * zdep_v
+               !                                ! Depth attenuation
+               zda_u = EXP( -2.0_wp*zkh_u ) / ( 1.0_wp + 8.0_wp*zkh_u )
+               zda_v = EXP( -2.0_wp*zkh_v ) / ( 1.0_wp + 8.0_wp*zkh_v )
                !
-               usd3dt(ji,jj,jk) = zfac * zusd2dt(ji,jj) * tmask(ji,jj,jk)
-               vsd3dt(ji,jj,jk) = zfac * zvsd2dt(ji,jj) * tmask(ji,jj,jk)
+               usd(ji,jj,jk) = zda_u * zk_u(ji,jj) * umask(ji,jj,jk)
+               vsd(ji,jj,jk) = zda_v * zk_v(ji,jj) * vmask(ji,jj,jk)
             END DO
          END DO
-      END DO 
-      ! Into the U and V Grid
-      DO jk = 1, jpkm1
-         DO jj = 1, jpjm1
-            DO ji = 1, fs_jpim1
-               usd3d(ji,jj,jk) = 0.5 *  umask(ji,jj,jk) *   &
-                               &  ( usd3dt(ji,jj,jk) + usd3dt(ji+1,jj,jk) )
-               vsd3d(ji,jj,jk) = 0.5 *  vmask(ji,jj,jk) *   &
-                               &  ( vsd3dt(ji,jj,jk) + vsd3dt(ji,jj+1,jk) )
-            END DO
-         END DO
-      END DO
-      !
-      CALL lbc_lnk( usd3d(:,:,:), 'U', -1. )
-      CALL lbc_lnk( vsd3d(:,:,:), 'V', -1. )
-      !
-      DO jk = 1, jpkm1               ! Horizontal divergence
+      END DO   
+      CALL lbc_lnk( usd(:,:,:), 'U', vsd(:,:,:), 'V', -1. )
+      !
+      !                       !==  vertical Stokes Drift 3D velocity  ==!
+      !
+      DO jk = 1, jpkm1               ! Horizontal e3*divergence
          DO jj = 2, jpj
             DO ji = fs_2, jpi
-               ze3hdiv(ji,jj,jk) = (  e2u(ji  ,jj) * usd3d(ji  ,jj,jk)     &
-                  &                 - e2u(ji-1,jj) * usd3d(ji-1,jj,jk)     &
-                  &                 + e1v(ji,jj  ) * vsd3d(ji,jj  ,jk)     &
-                  &                 - e1v(ji,jj-1) * vsd3d(ji,jj-1,jk)   ) * r1_e1e2t(ji,jj)
+               ze3divh(ji,jj,jk) = (  e2u(ji  ,jj) * e3u_n(ji  ,jj,jk) * usd(ji  ,jj,jk)    &
+                  &                 - e2u(ji-1,jj) * e3u_n(ji-1,jj,jk) * usd(ji-1,jj,jk)    &
+                  &                 + e1v(ji,jj  ) * e3v_n(ji,jj  ,jk) * vsd(ji,jj  ,jk)    &
+                  &                 - e1v(ji,jj-1) * e3v_n(ji,jj-1,jk) * vsd(ji,jj-1,jk)  ) * r1_e1e2t(ji,jj)
             END DO
          END DO
@@ -130,47 +153,36 @@
       !
       IF( .NOT. AGRIF_Root() ) THEN
-         IF( nbondi ==  1 .OR. nbondi == 2 )   ze3hdiv(nlci-1,   :  ,:) = 0._wp      ! east
-         IF( nbondi == -1 .OR. nbondi == 2 )   ze3hdiv(  2   ,   :  ,:) = 0._wp      ! west
-         IF( nbondj ==  1 .OR. nbondj == 2 )   ze3hdiv(  :   ,nlcj-1,:) = 0._wp      ! north
-         IF( nbondj == -1 .OR. nbondj == 2 )   ze3hdiv(  :   ,  2   ,:) = 0._wp      ! south
-      ENDIF
-      !
-      CALL lbc_lnk( ze3hdiv, 'T', 1. )
-      !
-      DO jk = jpkm1, 1, -1                   ! integrate from the bottom the e3t * hor. divergence
-         wsd3d(:,:,jk) = wsd3d(:,:,jk+1) - e3t_n(:,:,jk) * ze3hdiv(:,:,jk)
+         IF( nbondi ==  1 .OR. nbondi == 2 )   ze3divh(nlci-1,   :  ,:) = 0._wp      ! east
+         IF( nbondi == -1 .OR. nbondi == 2 )   ze3divh(  2   ,   :  ,:) = 0._wp      ! west
+         IF( nbondj ==  1 .OR. nbondj == 2 )   ze3divh(  :   ,nlcj-1,:) = 0._wp      ! north
+         IF( nbondj == -1 .OR. nbondj == 2 )   ze3divh(  :   ,  2   ,:) = 0._wp      ! south
+      ENDIF
+      !
+      CALL lbc_lnk( ze3divh, 'T', 1. )
+      !
+      IF( ln_linssh ) THEN   ;   ik = 1   ! none zero velocity through the sea surface
+      ELSE                   ;   ik = 2   ! w=0 at the surface (set one for all in sbc_wave_init)
+      ENDIF
+      DO jk = jpkm1, ik, -1          ! integrate from the bottom the e3t * hor. divergence (NB: at k=jpk w is always zero)
+         wsd(:,:,jk) = wsd(:,:,jk+1) - ze3divh(:,:,jk)
       END DO
 #if defined key_bdy
       IF( lk_bdy ) THEN
          DO jk = 1, jpkm1
-            wsd3d(:,:,jk) = wsd3d(:,:,jk) * bdytmask(:,:)
+            wsd(:,:,jk) = wsd(:,:,jk) * bdytmask(:,:)
          END DO
       ENDIF
 #endif
-      CALL wrk_dealloc( jpi,jpj,jpk, ze3hdiv )
+      !                       !==  Horizontal divergence of barotropic Stokes transport  ==!
+      div_sd(:,:) = 0._wp
+      DO jk = 1, jpkm1                                 ! 
+        div_sd(:,:) = div_sd(:,:) + ze3divh(:,:,jk)
+      END DO
+      !
+      CALL wrk_dealloc( jpi,jpj,jpk,   ze3divh )
+      CALL wrk_dealloc( jpi,jpj,       zk_t, zk_u, zk_v, zu0_sd, zv0_sd )
       !
    END SUBROUTINE sbc_stokes
 
-   SUBROUTINE sbc_qiao
-      !!---------------------------------------------------------------------
-      !!                     ***  ROUTINE sbc_qiao  ***
-      !!
-      !! ** Purpose :   Qiao formulation for wave enhanced turbulence
-      !!                2010 (DOI: 10.1007/s10236-010-0326) 
-      !!
-      !! ** Method  : - 
-      !! ** action  
-      !!---------------------------------------------------------------------
-      INTEGER :: jj, ji
-
-      ! Calculate the module of the stokes drift on T grid
-      !-------------------------------------------------
-      DO jj = 1, jpj
-         DO ji = 1, jpi
-            tsd2d(ji,jj) = SQRT( zusd2dt(ji,jj) * zusd2dt(ji,jj) + zvsd2dt(ji,jj) * zvsd2dt(ji,jj) )
-         END DO
-      END DO
-      !
-   END SUBROUTINE sbc_qiao
 
    SUBROUTINE sbc_wave( kt )
@@ -188,155 +200,160 @@
       !! ** action  
       !!---------------------------------------------------------------------
-      USE zdf_oce,  ONLY : ln_zdfqiao
-
-      INTEGER, INTENT( in  ) :: kt       ! ocean time step
-      !
-      INTEGER                ::   ierror   ! return error code
-      INTEGER                ::   ifpr
-      INTEGER                ::   ios      ! Local integer output status for namelist read
-      !
+      INTEGER, INTENT(in   ) ::   kt   ! ocean time step
+      !!---------------------------------------------------------------------
+      !
+      IF( ln_cdgw .AND. .NOT. cpl_wdrag ) THEN     !==  Neutral drag coefficient  ==!
+         CALL fld_read( kt, nn_fsbc, sf_cd )             ! read from external forcing
+         cdn_wave(:,:) = sf_cd(1)%fnow(:,:,1)
+      ENDIF
+
+      IF( ln_tauoc .AND. .NOT. cpl_wstrf ) THEN    !==  Wave induced stress  ==!
+         CALL fld_read( kt, nn_fsbc, sf_tauoc )          ! read wave norm stress from external forcing
+         tauoc_wave(:,:) = sf_tauoc(1)%fnow(:,:,1)
+      ENDIF
+
+      IF( ln_sdw )  THEN                           !==  Computation of the 3d Stokes Drift  ==! 
+         !
+         IF( jpfld > 0 ) THEN                            ! Read from file only if the field is not coupled
+            CALL fld_read( kt, nn_fsbc, sf_sd )          ! read wave parameters from external forcing
+            IF( jp_hsw > 0 )   hsw  (:,:) = sf_sd(jp_hsw)%fnow(:,:,1)   ! significant wave height
+            IF( jp_wmp > 0 )   wmp  (:,:) = sf_sd(jp_wmp)%fnow(:,:,1)   ! wave mean period
+            IF( jp_usd > 0 )   ut0sd(:,:) = sf_sd(jp_usd)%fnow(:,:,1)   ! 2D zonal Stokes Drift at T point
+            IF( jp_vsd > 0 )   vt0sd(:,:) = sf_sd(jp_vsd)%fnow(:,:,1)   ! 2D meridional Stokes Drift at T point
+         ENDIF
+         !
+         ! Read also wave number if needed, so that it is available in coupling routines
+         IF( ln_zdfqiao .AND. .NOT.cpl_wnum ) THEN
+            CALL fld_read( kt, nn_fsbc, sf_wn )          ! read wave parameters from external forcing
+            wnum(:,:) = sf_wn(1)%fnow(:,:,1)
+         ENDIF
+           
+         !                                         !==  Computation of the 3d Stokes Drift  ==! 
+         !
+         IF( jpfld == 4 )   CALL sbc_stokes()            ! Calculate only if required fields are read
+         !                                               ! In coupled wave model-NEMO case the call is done after coupling
+         !
+      ENDIF
+      !
+   END SUBROUTINE sbc_wave
+
+
+   SUBROUTINE sbc_wave_init
+      !!---------------------------------------------------------------------
+      !!                     ***  ROUTINE sbc_wave_init  ***
+      !!
+      !! ** Purpose :   read wave parameters from wave model  in netcdf files.
+      !!
+      !! ** Method  : - Read namelist namsbc_wave
+      !!              - Read Cd_n10 fields in netcdf files 
+      !!              - Read stokes drift 2d in netcdf files 
+      !!              - Read wave number in netcdf files 
+      !!              - Compute 3d stokes drift using Breivik et al.,2014
+      !!                formulation
+      !! ** action  
+      !!---------------------------------------------------------------------
+      INTEGER ::   ierror, ios   ! local integer
+      INTEGER ::   ifpr
+      !!
       CHARACTER(len=100)     ::  cn_dir                          ! Root directory for location of drag coefficient files
       TYPE(FLD_N), ALLOCATABLE, DIMENSION(:) ::   slf_i     ! array of namelist informations on the fields to read
       TYPE(FLD_N)            ::  sn_cdg, sn_usd, sn_vsd,  &
-                             &   sn_swh, sn_wmp, sn_wnum, sn_tauoc      ! informations about the fields to be read
-      !!
-      NAMELIST/namsbc_wave/  sn_cdg, cn_dir, sn_usd, sn_vsd, sn_swh, sn_wmp, sn_wnum, sn_tauoc
-      !!---------------------------------------------------------------------
-      !
-      !                                         ! -------------------- !
-      IF( kt == nit000 ) THEN                   ! First call kt=nit000 !
-         !                                      ! -------------------- !
-         REWIND( numnam_ref )              ! Namelist namsbc_wave in reference namelist : File for drag coeff. from wave model
-         READ  ( numnam_ref, namsbc_wave, IOSTAT = ios, ERR = 901)
-901      IF( ios /= 0 ) CALL ctl_nam ( ios , 'namsbc_wave in reference namelist', lwp )
+                             &   sn_hsw, sn_wmp, sn_wnum, sn_tauoc      ! informations about the fields to be read
+      !
+      NAMELIST/namsbc_wave/  sn_cdg, cn_dir, sn_usd, sn_vsd, sn_hsw, sn_wmp, sn_wnum, sn_tauoc
+      !!---------------------------------------------------------------------
+      !
+      REWIND( numnam_ref )              ! Namelist namsbc_wave in reference namelist : File for drag coeff. from wave model
+      READ  ( numnam_ref, namsbc_wave, IOSTAT = ios, ERR = 901)
+901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namsbc_wave in reference namelist', lwp )
          
-         REWIND( numnam_cfg )              ! Namelist namsbc_wave in configuration namelist : File for drag coeff. from wave model
-         READ  ( numnam_cfg, namsbc_wave, IOSTAT = ios, ERR = 902 )
-902      IF( ios /= 0 ) CALL ctl_nam ( ios , 'namsbc_wave in configuration namelist', lwp )
-         IF(lwm) WRITE ( numond, namsbc_wave )
-         !
-         IF( ln_cdgw ) THEN
-            IF( .NOT. cpl_wdrag ) THEN
-               ALLOCATE( sf_cd(1), STAT=ierror )           !* allocate and fill sf_wave with sn_cdg
-               IF( ierror > 0 )   CALL ctl_stop( 'STOP', 'sbc_wave: unable to allocate sf_wave structure' )
-               !
-                                      ALLOCATE( sf_cd(1)%fnow(jpi,jpj,1)   )
-               IF( sn_cdg%ln_tint )   ALLOCATE( sf_cd(1)%fdta(jpi,jpj,1,2) )
-               CALL fld_fill( sf_cd, (/ sn_cdg /), cn_dir, 'sbc_wave', 'Wave module ', 'namsbc_wave' )
+      REWIND( numnam_cfg )              ! Namelist namsbc_wave in configuration namelist : File for drag coeff. from wave model
+      READ  ( numnam_cfg, namsbc_wave, IOSTAT = ios, ERR = 902 )
+902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namsbc_wave in configuration namelist', lwp )
+      IF(lwm) WRITE ( numond, namsbc_wave )
+      !
+      IF( ln_cdgw ) THEN
+         IF( .NOT. cpl_wdrag ) THEN
+            ALLOCATE( sf_cd(1), STAT=ierror )           !* allocate and fill sf_wave with sn_cdg
+            IF( ierror > 0 )   CALL ctl_stop( 'STOP', 'sbc_wave: unable to allocate sf_wave structure' )
+            !
+                                   ALLOCATE( sf_cd(1)%fnow(jpi,jpj,1)   )
+            IF( sn_cdg%ln_tint )   ALLOCATE( sf_cd(1)%fdta(jpi,jpj,1,2) )
+            CALL fld_fill( sf_cd, (/ sn_cdg /), cn_dir, 'sbc_wave', 'Wave module ', 'namsbc_wave' )
+         ENDIF
+         ALLOCATE( cdn_wave(jpi,jpj) )
+      ENDIF
+
+      IF( ln_tauoc ) THEN
+         IF( .NOT. cpl_wstrf ) THEN
+            ALLOCATE( sf_tauoc(1), STAT=ierror )           !* allocate and fill sf_wave with sn_tauoc
+            IF( ierror > 0 )   CALL ctl_stop( 'STOP', 'sbc_wave: unable to allocate sf_wave structure' )
+            !
+                                    ALLOCATE( sf_tauoc(1)%fnow(jpi,jpj,1)   )
+            IF( sn_tauoc%ln_tint )  ALLOCATE( sf_tauoc(1)%fdta(jpi,jpj,1,2) )
+            CALL fld_fill( sf_tauoc, (/ sn_tauoc /), cn_dir, 'sbc_wave', 'Wave module', 'namsbc_wave' )
+         ENDIF
+         ALLOCATE( tauoc_wave(jpi,jpj) )
+      ENDIF
+
+      IF( ln_sdw ) THEN   ! Find out how many fields have to be read from file if not coupled
+         jpfld=0
+         jp_usd=0   ;   jp_vsd=0   ;   jp_hsw=0   ;   jp_wmp=0
+         IF( .NOT. cpl_sdrftx ) THEN
+            jpfld  = jpfld + 1
+            jp_usd = jpfld
+         ENDIF
+         IF( .NOT. cpl_sdrfty ) THEN
+            jpfld  = jpfld + 1
+            jp_vsd = jpfld
+         ENDIF
+         IF( .NOT. cpl_hsig ) THEN
+            jpfld  = jpfld + 1
+            jp_hsw = jpfld
+         ENDIF
+         IF( .NOT. cpl_wper ) THEN
+            jpfld  = jpfld + 1
+            jp_wmp = jpfld
+         ENDIF
+
+         ! Read from file only the non-coupled fields 
+         IF( jpfld > 0 ) THEN
+            ALLOCATE( slf_i(jpfld) )
+            IF( jp_usd > 0 )   slf_i(jp_usd) = sn_usd
+            IF( jp_vsd > 0 )   slf_i(jp_vsd) = sn_vsd
+            IF( jp_hsw > 0 )   slf_i(jp_hsw) = sn_hsw
+            IF( jp_wmp > 0 )   slf_i(jp_wmp) = sn_wmp
+            ALLOCATE( sf_sd(jpfld), STAT=ierror )   !* allocate and fill sf_sd with stokes drift
+            IF( ierror > 0 )   CALL ctl_stop( 'STOP', 'sbc_wave: unable to allocate sf_wave structure' )
+            !
+            DO ifpr= 1, jpfld
+               ALLOCATE( sf_sd(ifpr)%fnow(jpi,jpj,1) )
+               IF( slf_i(ifpr)%ln_tint )   ALLOCATE( sf_sd(ifpr)%fdta(jpi,jpj,1,2) )
+            END DO
+            !
+            CALL fld_fill( sf_sd, slf_i, cn_dir, 'sbc_wave', 'Wave module ', 'namsbc_wave' )
+         ENDIF
+         ALLOCATE( usd  (jpi,jpj,jpk), vsd  (jpi,jpj,jpk), wsd(jpi,jpj,jpk) )
+         ALLOCATE( usd  (jpi,jpj,jpk), vsd  (jpi,jpj,jpk) )
+         ALLOCATE( hsw  (jpi,jpj)    , wmp  (jpi,jpj)     )
+         ALLOCATE( ut0sd(jpi,jpj)    , vt0sd(jpi,jpj)     )
+         ALLOCATE( div_sd(jpi,jpj) )
+         usd(:,:,:) = 0._wp
+         vsd(:,:,:) = 0._wp
+         wsd(:,:,:) = 0._wp
+         IF( ln_zdfqiao ) THEN     !==  Vertical mixing enhancement using Qiao,2010  ==!
+            IF( .NOT. cpl_wnum ) THEN
+               ALLOCATE( sf_wn(1), STAT=ierror )           !* allocate and fill sf_wave with sn_wnum
+               IF( ierror > 0 )   CALL ctl_stop( 'STOP', 'sbc_wave: unable toallocate sf_wave structure' )
+                                      ALLOCATE( sf_wn(1)%fnow(jpi,jpj,1)   )
+               IF( sn_wnum%ln_tint )  ALLOCATE( sf_wn(1)%fdta(jpi,jpj,1,2) )
+               CALL fld_fill( sf_wn, (/ sn_wnum /), cn_dir, 'sbc_wave', 'Wave module', 'namsbc_wave' )
             ENDIF
-            ALLOCATE( cdn_wave(jpi,jpj) )
-         ENDIF
-
-         IF( ln_tauoc ) THEN
-            IF( .NOT. cpl_wstrf ) THEN
-               ALLOCATE( sf_tauoc(1), STAT=ierror )           !* allocate and fill sf_wave with sn_tauoc
-               IF( ierror > 0 )   CALL ctl_stop( 'STOP', 'sbc_wave: unable to allocate sf_wave structure' )
-               !
-                                       ALLOCATE( sf_tauoc(1)%fnow(jpi,jpj,1)   )
-               IF( sn_tauoc%ln_tint )  ALLOCATE( sf_tauoc(1)%fdta(jpi,jpj,1,2) )
-               CALL fld_fill( sf_tauoc, (/ sn_tauoc /), cn_dir, 'sbc_wave', 'Wave module', 'namsbc_wave' )
-            ENDIF
-            ALLOCATE( tauoc_wave(jpi,jpj) )
-         ENDIF
-
-         IF( ln_sdw ) THEN
-            ! Find out how many fields have to be read from file if not coupled
-            jpfld=0
-            jp_usd=0; jp_vsd=0; jp_swh=0; jp_wmp=0
-            IF( .NOT. cpl_sdrftx ) THEN
-               jpfld=jpfld+1
-               jp_usd=jpfld
-            ENDIF
-            IF( .NOT. cpl_sdrfty ) THEN
-               jpfld=jpfld+1
-               jp_vsd=jpfld
-            ENDIF
-            IF( .NOT. cpl_hsig ) THEN
-               jpfld=jpfld+1
-               jp_swh=jpfld
-            ENDIF
-            IF( .NOT. cpl_wper ) THEN
-               jpfld=jpfld+1
-               jp_wmp=jpfld
-            ENDIF
-
-            ! Read from file only the non-coupled fields 
-            IF( jpfld > 0 ) THEN
-               ALLOCATE( slf_i(jpfld) )
-               IF( jp_usd > 0 ) slf_i(jp_usd) = sn_usd
-               IF( jp_vsd > 0 ) slf_i(jp_vsd) = sn_vsd
-               IF( jp_swh > 0 ) slf_i(jp_swh) = sn_swh
-               IF( jp_wmp > 0 ) slf_i(jp_wmp) = sn_wmp
-               ALLOCATE( sf_sd(jpfld), STAT=ierror )           !* allocate and fill sf_sd with stokes drift
-               IF( ierror > 0 )   CALL ctl_stop( 'STOP', 'sbc_wave: unable to allocate sf_wave structure' )
-               !
-               DO ifpr= 1, jpfld
-                  ALLOCATE( sf_sd(ifpr)%fnow(jpi,jpj,1) )
-                  IF( slf_i(ifpr)%ln_tint )   ALLOCATE( sf_sd(ifpr)%fdta(jpi,jpj,1,2) )
-               END DO
-
-               CALL fld_fill( sf_sd, slf_i, cn_dir, 'sbc_wave', 'Wave module ', 'namsbc_wave' )
-            ENDIF
-            ALLOCATE( usd3d(jpi,jpj,jpk),vsd3d(jpi,jpj,jpk),wsd3d(jpi,jpj,jpk) )
-            ALLOCATE( usd3dt(jpi,jpj,jpk),vsd3dt(jpi,jpj,jpk) )
-            ALLOCATE( swh(jpi,jpj), wmp(jpi,jpj) )
-            ALLOCATE( zusd2dt(jpi,jpj), zvsd2dt(jpi,jpj) )
-            usd3d(:,:,:) = 0._wp
-            vsd3d(:,:,:) = 0._wp
-            wsd3d(:,:,:) = 0._wp
-            IF( ln_zdfqiao ) THEN     !==  Vertical mixing enhancement using Qiao,2010  ==!
-               IF( .NOT. cpl_wnum ) THEN
-                  ALLOCATE( sf_wn(1), STAT=ierror )           !* allocate and fill sf_wave with sn_wnum
-                  IF( ierror > 0 )   CALL ctl_stop( 'STOP', 'sbc_wave: unable toallocate sf_wave structure' )
-                                         ALLOCATE( sf_wn(1)%fnow(jpi,jpj,1)   )
-                  IF( sn_wnum%ln_tint )  ALLOCATE( sf_wn(1)%fdta(jpi,jpj,1,2) )
-                  CALL fld_fill( sf_wn, (/ sn_wnum /), cn_dir, 'sbc_wave', 'Wave module', 'namsbc_wave' )
-               ENDIF
-               ALLOCATE( wnum(jpi,jpj),tsd2d(jpi,jpj) )
-            ENDIF
-         ENDIF
-      ENDIF
-      !
-      IF( ln_cdgw .AND. .NOT. cpl_wdrag ) THEN              !==  Neutral drag coefficient  ==!
-         CALL fld_read( kt, nn_fsbc, sf_cd )      ! read from external forcing
-         cdn_wave(:,:) = sf_cd(1)%fnow(:,:,1)
-      ENDIF
-
-      IF( ln_tauoc .AND. .NOT. cpl_wstrf ) THEN             !==  Wave induced stress  ==!
-         CALL fld_read( kt, nn_fsbc, sf_tauoc )      !* read wave norm stress from external forcing
-         tauoc_wave(:,:) = sf_tauoc(1)%fnow(:,:,1)
-      ENDIF
-
-      IF( ln_sdw )  THEN                         !==  Computation of the 3d Stokes Drift  ==! 
-         !
-         ! Read from file only if the field is not coupled
-         IF( jpfld > 0 ) THEN
-            CALL fld_read( kt, nn_fsbc, sf_sd )      !* read wave parameters from external forcing
-            IF( jp_swh > 0 ) swh(:,:)     = sf_sd(jp_swh)%fnow(:,:,1)   ! significant wave height
-            IF( jp_wmp > 0 ) wmp(:,:)     = sf_sd(jp_wmp)%fnow(:,:,1)   ! wave mean period
-            IF( jp_usd > 0 ) zusd2dt(:,:) = sf_sd(jp_usd)%fnow(:,:,1)   ! 2D zonal Stokes Drift at T point
-            IF( jp_vsd > 0 ) zvsd2dt(:,:) = sf_sd(jp_vsd)%fnow(:,:,1)   ! 2D meridional Stokes Drift at T point
-         ENDIF
-         !
-         ! Read also wave number if needed, so that it is available in coupling routines
-         IF( ln_zdfqiao .AND. .NOT. cpl_wnum ) THEN
-            CALL fld_read( kt, nn_fsbc, sf_wn )      !* read wave parameters from external forcing
-            wnum(:,:) = sf_wn(1)%fnow(:,:,1)
-         ENDIF
-           
-         !==  Computation of the 3d Stokes Drift according to Breivik et al.,2014
-         !(DOI: 10.1175/JPO-D-14-0020.1)==! 
-         !
-         ! Calculate only if no necessary fields are coupled, if not calculate later after coupling
-         IF( jpfld == 4 ) THEN
-            CALL sbc_stokes()
-            IF( ln_zdfqiao .AND. .NOT. cpl_wnum ) THEN
-               CALL sbc_qiao()
-            ENDIF
-         ENDIF
-      ENDIF
-      !
-   END SUBROUTINE sbc_wave
-      
+            ALLOCATE( wnum(jpi,jpj),tsd2d(jpi,jpj) )
+         ENDIF
+      ENDIF
+      !
+   END SUBROUTINE sbc_wave_init
+
    !!======================================================================
 END MODULE sbcwave
Index: branches/2016/dev_INGV_UKMO_2016/NEMOGCM/NEMO/OPA_SRC/TRA/traadv.F90
===================================================================
--- branches/2016/dev_INGV_UKMO_2016/NEMOGCM/NEMO/OPA_SRC/TRA/traadv.F90	(revision 7421)
+++ branches/2016/dev_INGV_UKMO_2016/NEMOGCM/NEMO/OPA_SRC/TRA/traadv.F90	(revision 7422)
@@ -107,11 +107,8 @@
       !                                         !==  effective transport  ==!
       IF( ln_wave .AND. ln_sdw )  THEN
-         DO jk = 1, jpkm1
-            zun(:,:,jk) = e2u(:,:) * e3u_n(:,:,jk) *      &
-                        &  ( un(:,:,jk) + usd3d(:,:,jk) )                       ! eulerian transport + Stokes Drift
-            zvn(:,:,jk) = e1v(:,:) * e3v_n(:,:,jk) *      &
-                        &  ( vn(:,:,jk) + vsd3d(:,:,jk) )
-            zwn(:,:,jk) = e1e2t(:,:) *                    &
-                        &  ( wn(:,:,jk) + wsd3d(:,:,jk) )
+         DO jk = 1, jpkm1                                                       ! eulerian transport + Stokes Drift
+            zun(:,:,jk) = e2u  (:,:) * e3u_n(:,:,jk) * ( un(:,:,jk) + usd(:,:,jk) )
+            zvn(:,:,jk) = e1v  (:,:) * e3v_n(:,:,jk) * ( vn(:,:,jk) + vsd(:,:,jk) )
+            zwn(:,:,jk) = e1e2t(:,:)                 * ( wn(:,:,jk) + wsd(:,:,jk) )
          END DO
       ELSE
Index: branches/2016/dev_INGV_UKMO_2016/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfgls.F90
===================================================================
--- branches/2016/dev_INGV_UKMO_2016/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfgls.F90	(revision 7421)
+++ branches/2016/dev_INGV_UKMO_2016/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfgls.F90	(revision 7422)
@@ -24,4 +24,6 @@
    USE phycst         ! physical constants
    USE zdfmxl         ! mixed layer
+   USE sbcwave ,  ONLY: hsw   ! significant wave height
+   !
    USE lbclnk         ! ocean lateral boundary conditions (or mpp link)
    USE lib_mpp        ! MPP manager
@@ -194,5 +196,6 @@
          zdep(:,:)  = 30.*TANH(2.*0.3/(28.*SQRT(MAX(ustars2(:,:),rsmall))))             ! Wave age (eq. 10)
          zhsro(:,:) = MAX(rsbc_zs2 * ustars2(:,:) * zdep(:,:)**1.5, rn_hsro) ! zhsro = rn_frac_hs * Hsw (eq. 11)
-      !
+      CASE ( 3 )             ! Roughness given by the wave model (coupled or read in file)
+         zhsro(:,:) = hsw(:,:)
       END SELECT
 
@@ -896,9 +899,10 @@
 
       !                                !* Check of some namelist values
-      IF( nn_bc_surf < 0 .OR. nn_bc_surf > 1 ) CALL ctl_stop( 'bad flag: nn_bc_surf is 0 or 1' )
-      IF( nn_bc_surf < 0 .OR. nn_bc_surf > 1 ) CALL ctl_stop( 'bad flag: nn_bc_surf is 0 or 1' )
-      IF( nn_z0_met < 0 .OR. nn_z0_met > 2 ) CALL ctl_stop( 'bad flag: nn_z0_met is 0, 1 or 2' )
-      IF( nn_stab_func  < 0 .OR. nn_stab_func  > 3 ) CALL ctl_stop( 'bad flag: nn_stab_func is 0, 1, 2 and 3' )
-      IF( nn_clos       < 0 .OR. nn_clos       > 3 ) CALL ctl_stop( 'bad flag: nn_clos is 0, 1, 2 or 3' )
+      IF( nn_bc_surf < 0 .OR. nn_bc_surf > 1 ) CALL ctl_stop( 'zdf_gls_init: bad flag: nn_bc_surf is 0 or 1' )
+      IF( nn_bc_surf < 0 .OR. nn_bc_surf > 1 ) CALL ctl_stop( 'zdf_gls_init: bad flag: nn_bc_surf is 0 or 1' )
+      IF( nn_z0_met < 0 .OR. nn_z0_met > 3 ) CALL ctl_stop( 'zdf_gls_init: bad flag: nn_z0_met is 0, 1, 2 or 3' )
+      IF( nn_z0_met == 3 .AND. .NOT.ln_wave ) CALL ctl_stop( 'zdf_gls_init: nn_z0_met=3 requires ln_wave=T' )
+      IF( nn_stab_func  < 0 .OR. nn_stab_func  > 3 ) CALL ctl_stop( 'zdf_gls_init: bad flag: nn_stab_func is 0, 1, 2 and 3' )
+      IF( nn_clos       < 0 .OR. nn_clos       > 3 ) CALL ctl_stop( 'zdf_gls_init: bad flag: nn_clos is 0, 1, 2 or 3' )
 
       SELECT CASE ( nn_clos )          !* set the parameters for the chosen closure
Index: branches/2016/dev_INGV_UKMO_2016/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfqiao.F90
===================================================================
--- branches/2016/dev_INGV_UKMO_2016/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfqiao.F90	(revision 7421)
+++ branches/2016/dev_INGV_UKMO_2016/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfqiao.F90	(revision 7422)
@@ -70,5 +70,5 @@
          DO jj = 1, jpjm1
             DO ji = 1, fs_jpim1
-               qbv(ji,jj,jk) = 1.0 * 0.353553 * swh(ji,jj) * tsd2d(ji,jj) *             &
+               qbv(ji,jj,jk) = 1.0 * 0.353553 * hsw(ji,jj) * tsd2d(ji,jj) *             &
             &                  EXP(3.0 * wnum(ji,jj) *                                  &                     
             &                  (-MIN( gdepw_n(ji  ,jj  ,jk), gdepw_n(ji+1,jj  ,jk),     &
Index: branches/2016/dev_INGV_UKMO_2016/NEMOGCM/NEMO/OPA_SRC/step.F90
===================================================================
--- branches/2016/dev_INGV_UKMO_2016/NEMOGCM/NEMO/OPA_SRC/step.F90	(revision 7421)
+++ branches/2016/dev_INGV_UKMO_2016/NEMOGCM/NEMO/OPA_SRC/step.F90	(revision 7422)
@@ -210,6 +210,4 @@
                          CALL dyn_adv       ( kstp )  ! advection (vector or flux form)
                          CALL dyn_vor       ( kstp )  ! vorticity term including Coriolis
-      IF( ln_wave .AND. ln_sdw .AND. ln_stcor)           &
-               &         CALL dyn_stcor     ( kstp )  ! Stokes-Coriolis forcing
                          CALL dyn_ldf       ( kstp )  ! lateral mixing
                          CALL dyn_hpg       ( kstp )  ! horizontal gradient of Hydrostatic pressure
Index: branches/2016/dev_INGV_UKMO_2016/NEMOGCM/NEMO/OPA_SRC/step_oce.F90
===================================================================
--- branches/2016/dev_INGV_UKMO_2016/NEMOGCM/NEMO/OPA_SRC/step_oce.F90	(revision 7421)
+++ branches/2016/dev_INGV_UKMO_2016/NEMOGCM/NEMO/OPA_SRC/step_oce.F90	(revision 7422)
@@ -42,5 +42,4 @@
    USE dynzdf           ! vertical diffusion               (dyn_zdf routine)
    USE dynspg           ! surface pressure gradient        (dyn_spg routine)
-   USE dynstcor         ! simp. form of Stokes-Coriolis
 
    USE dynnxt           ! time-stepping                    (dyn_nxt routine)
