Index: NEMO/trunk/src/ICE/iceistate.F90
===================================================================
--- NEMO/trunk/src/ICE/iceistate.F90	(revision 14141)
+++ NEMO/trunk/src/ICE/iceistate.F90	(revision 14143)
@@ -22,5 +22,7 @@
    USE eosbn2         ! equation of state
 # if defined key_qco
-   USE domqco         ! Variable volume
+   USE domqco         ! Quasi-Eulerian coord.
+# elif defined key_linssh
+   !                  ! Fix in time coord.
 # else
    USE domvvl         ! Variable volume
@@ -424,5 +426,7 @@
          !
 #if defined key_qco
-         IF( .NOT.ln_linssh )   CALL dom_qco_zgr( Kbb, Kmm )        ! interpolation scale factor, depth and water column
+         IF( .NOT.ln_linssh )   CALL dom_qco_zgr( Kbb, Kmm )        ! upadte of r3=ssh/h0 ratios
+#elif defined key_linssh
+         !                                                          ! fix in time coord. : no update of vertical coord.
 #else
          IF( .NOT.ln_linssh )   CALL dom_vvl_zgr( Kbb, Kmm, Kaa )   ! interpolation scale factor, depth and water column
Index: NEMO/trunk/src/NST/agrif_oce_update.F90
===================================================================
--- NEMO/trunk/src/NST/agrif_oce_update.F90	(revision 14141)
+++ NEMO/trunk/src/NST/agrif_oce_update.F90	(revision 14143)
@@ -192,5 +192,11 @@
       IF (lwp.AND.lk_agrif_debug) Write(*,*) 'Update e3 from grid Number',Agrif_Fixed(), 'Step', Agrif_Nb_Step()
       !
-#if ! defined key_qco
+#if defined key_qco
+      CALL Agrif_ChildGrid_To_ParentGrid()
+      CALL Agrif_Update_qco
+      CALL Agrif_ParentGrid_To_ChildGrid()
+#elif defined key_linssh
+      !
+#else
       Agrif_UseSpecialValueInUpdate = .TRUE.
       Agrif_SpecialValueFineGrid = 0.
@@ -204,8 +210,4 @@
       CALL Agrif_ChildGrid_To_ParentGrid()
       CALL dom_vvl_update_UVF
-      CALL Agrif_ParentGrid_To_ChildGrid()
-#else
-      CALL Agrif_ChildGrid_To_ParentGrid()
-      CALL Agrif_Update_qco
       CALL Agrif_ParentGrid_To_ChildGrid()
 #endif
@@ -232,5 +234,5 @@
 
 
-#if ! defined key_qco
+#if ! defined key_qco   &&   ! defined key_linssh
    SUBROUTINE dom_vvl_update_UVF
       !!---------------------------------------------
@@ -1163,5 +1165,5 @@
    END SUBROUTINE updateAVM
 
-#if ! defined key_qco
+#if ! defined key_qco   &&   ! defined key_linssh
    SUBROUTINE updatee3t(ptab_dum, i1, i2, j1, j2, k1, k2, before )
       !!---------------------------------------------
Index: NEMO/trunk/src/OCE/DIA/diawri.F90
===================================================================
--- NEMO/trunk/src/OCE/DIA/diawri.F90	(revision 14141)
+++ NEMO/trunk/src/OCE/DIA/diawri.F90	(revision 14143)
@@ -215,7 +215,5 @@
       ENDIF
 
-#if ! defined key_qco
       CALL iom_put( "rhop", rhop(:,:,:) )          ! 3D potential density (sigma0)
-#endif
 
       IF ( iom_use("taubot") ) THEN                ! bottom stress
@@ -360,5 +358,5 @@
       ENDIF
       !    
-      IF ( iom_use("sKEf") ) THEN                        ! surface kinetic energy at F point
+      IF ( iom_use("ssKEf") ) THEN                        ! surface kinetic energy at F point
          z2d(:,:) = 0._wp                                ! CAUTION : only valid in SWE, not with bathymetry
          DO_2D( 0, 0, 0, 0 )
@@ -370,5 +368,5 @@
          END_2D
          CALL lbc_lnk( 'diawri', z2d, 'F', 1. )
-         CALL iom_put( "sKEf", z2d )                     
+         CALL iom_put( "ssKEf", z2d )                     
       ENDIF
       !
@@ -473,8 +471,8 @@
       IF (ln_dia25h)   CALL dia_25h( kt, Kmm )        ! 25h averaging
       
-      ! Output of vorticity terms
-      IF ( iom_use("relvor")    .OR. iom_use("plavor")    .OR.   &
-         & iom_use("relpotvor") .OR. iom_use("abspotvor") .OR.   &
-         & iom_use("Ens")                                        ) THEN
+      ! Output of surface vorticity terms
+      IF ( iom_use("ssrelvor")    .OR. iom_use("ssplavor")    .OR.   &
+         & iom_use("ssrelpotvor") .OR. iom_use("ssabspotvor") .OR.   &
+         & iom_use("ssEns")                                        ) THEN
          !
          z2d(:,:) = 0._wp 
@@ -485,7 +483,7 @@
          END_2D
          CALL lbc_lnk( 'diawri', z2d, 'F', 1. )
-         CALL iom_put( "relvor", z2d )                  ! relative vorticity ( zeta ) 
-         !
-         CALL iom_put( "plavor", ff_f )                 ! planetary vorticity ( f )
+         CALL iom_put( "ssrelvor", z2d )                  ! relative vorticity ( zeta ) 
+         !
+         CALL iom_put( "ssplavor", ff_f )                 ! planetary vorticity ( f )
          !
          DO_2D( 1, 0, 1, 0 )  
@@ -498,5 +496,5 @@
          END_2D
          CALL lbc_lnk( 'diawri', z2d, 'F', 1. )
-         CALL iom_put( "relpotvor", z2d )                  ! relative potential vorticity (zeta/h)
+         CALL iom_put( "ssrelpotvor", z2d )                  ! relative potential vorticity (zeta/h)
          !
          DO_2D( 1, 0, 1, 0 )
@@ -509,5 +507,5 @@
          END_2D
          CALL lbc_lnk( 'diawri', z2d, 'F', 1. )
-         CALL iom_put( "abspotvor", z2d )                  ! absolute potential vorticity ( q )
+         CALL iom_put( "ssabspotvor", z2d )                  ! absolute potential vorticity ( q )
          !
          DO_2D( 1, 0, 1, 0 )  
@@ -515,5 +513,5 @@
          END_2D
          CALL lbc_lnk( 'diawri', z2d, 'F', 1. )
-         CALL iom_put( "Ens", z2d )                        ! potential enstrophy ( 1/2*q2 )
+         CALL iom_put( "ssEns", z2d )                        ! potential enstrophy ( 1/2*q2 )
          !
       ENDIF
Index: NEMO/trunk/src/OCE/DOM/dom_oce.F90
===================================================================
--- NEMO/trunk/src/OCE/DOM/dom_oce.F90	(revision 14141)
+++ NEMO/trunk/src/OCE/DOM/dom_oce.F90	(revision 14143)
@@ -136,7 +136,18 @@
    !
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   ff_f  , ff_t                    !: Coriolis factor at f- & t-points  [1/s]
+   
    !!----------------------------------------------------------------------
    !! vertical coordinate and scale factors
    !! ---------------------------------------------------------------------
+#if defined key_qco
+   LOGICAL, PUBLIC, PARAMETER ::   lk_qco    = .TRUE.   !: qco key flag
+#else
+   LOGICAL, PUBLIC, PARAMETER ::   lk_qco    = .FALSE.  !: qco key flag
+#endif
+#if defined key_linssh
+   LOGICAL, PUBLIC, PARAMETER ::   lk_linssh = .TRUE.   !: linssh key flag
+#else
+   LOGICAL, PUBLIC, PARAMETER ::   lk_linssh = .FALSE.  !: linssh key flag
+#endif
    LOGICAL, PUBLIC ::   ln_zco       !: z-coordinate - full step
    LOGICAL, PUBLIC ::   ln_zps       !: z-coordinate - partial step
@@ -151,10 +162,10 @@
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::    e3uw_0   !: uw-vert. scale factor [m]
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::    e3vw_0   !: vw-vert. scale factor [m]
-   !                                                        !  time-dependent scale factors
-#if ! defined key_qco
+
+   !                                                        !  time-dependent scale factors     (domvvl)
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) ::   e3t, e3u, e3v, e3w, e3uw, e3vw  !: vert. scale factor [m]
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::   e3f                             !: F-point vert. scale factor [m]
-#endif
-   !                                                        !  time-dependent ratio ssh / h_0
+
+   !                                                        !  time-dependent ratio ssh / h_0   (domqco)
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::   r3t, r3u, r3v                   !: time-dependent    ratio at t-, u- and v-point [-]
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::   r3f                             !: mid-time-level    ratio at f-point            [-]
@@ -165,5 +176,6 @@
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::   gdepw_0  !: w- depth              [m]
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::   gde3w_0  !: w- depth (sum of e3w) [m]
-   !                                                        !  time-dependent depths of cells
+   
+   !                                                        !  time-dependent depths of cells   (domvvl)
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) ::  gdept, gdepw
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::  gde3w
@@ -174,8 +186,7 @@
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::   hv_0, r1_hv_0   !: v-depth        [m] and [1/m]
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::   hf_0, r1_hf_0   !: f-depth        [m] and [1/m]
-   !                                                        ! time-dependent heights of ocean water column
-#if ! defined key_qco
+   
+   !                                                        ! time-dependent heights of ocean water column   (domvvl)
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::   ht          !: t-points           [m]
-#endif
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::   hu, r1_hu   !: u-depth            [m] and [1/m]
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::   hv, r1_hv   !: v-depth            [m] and [1/m]
@@ -207,7 +218,6 @@
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:), TARGET ::   tmask, umask, vmask, wmask, fmask   !: land/ocean mask at T-, U-, V-, W- and F-pts
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:), TARGET ::   wumask, wvmask                      !: land/ocean mask at WU- and WV-pts
-#if defined key_qco
-   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:), TARGET ::   fe3mask                             !: land/ocean mask at F-pts for qco
-#endif
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:), TARGET ::   fe3mask                             !: land/ocean mask at F-pts (qco only)
+
    !!----------------------------------------------------------------------
    !! calendar variables
@@ -301,29 +311,39 @@
          !
       ii = ii+1
-      ALLOCATE( gdept_0(jpi,jpj,jpk)     , gdepw_0(jpi,jpj,jpk)     , gde3w_0(jpi,jpj,jpk) ,      &
-         &      gdept  (jpi,jpj,jpk,jpt) , gdepw  (jpi,jpj,jpk,jpt) , gde3w  (jpi,jpj,jpk) , STAT=ierr(ii) )
-         !
-      ii = ii+1
-      ALLOCATE(  e3t_0(jpi,jpj,jpk) , e3u_0 (jpi,jpj,jpk) , e3v_0 (jpi,jpj,jpk) , e3f_0(jpi,jpj,jpk) ,      &
-         &       e3w_0(jpi,jpj,jpk) , e3uw_0(jpi,jpj,jpk) , e3vw_0(jpi,jpj,jpk)                      ,  STAT=ierr(ii) )
+      ALLOCATE( gdept_0 (jpi,jpj,jpk) , gdepw_0 (jpi,jpj,jpk) , gde3w_0(jpi,jpj,jpk) ,     &
+         &      gdept_1d(        jpk) , gdepw_1d(        jpk)                        , STAT=ierr(ii) )
+         !
+      ii = ii+1
+      ALLOCATE(  e3t_0 (jpi,jpj,jpk) , e3u_0 (jpi,jpj,jpk) , e3v_0 (jpi,jpj,jpk) , e3f_0(jpi,jpj,jpk) ,     &
+         &       e3w_0 (jpi,jpj,jpk) , e3uw_0(jpi,jpj,jpk) , e3vw_0(jpi,jpj,jpk)                      ,     &
+         &       e3t_1d(        jpk) , e3w_1d(        jpk)                                            , STAT=ierr(ii) )
+         !
+      ii = ii+1
+      ALLOCATE( ht_0(jpi,jpj) ,    hu_0(jpi,jpj)    ,    hv_0(jpi,jpj)     , hf_0(jpi,jpj) ,       &
+         &   r1_ht_0(jpi,jpj) , r1_hu_0(jpi,jpj) ,    r1_hv_0(jpi,jpj),   r1_hf_0(jpi,jpj) ,   STAT=ierr(ii)  )
          !
 #if defined key_qco
-      ii = ii+1
-      ALLOCATE( r3t  (jpi,jpj,jpt)   , r3u  (jpi,jpj,jpt)    , r3v  (jpi,jpj,jpt)    , r3f  (jpi,jpj) ,      &
-         &      r3t_f(jpi,jpj)       , r3u_f(jpi,jpj)        , r3v_f(jpi,jpj)                         ,  STAT=ierr(ii) )
+         ! qco : ssh to h ratio and specific fmask
+      ii = ii+1
+      ALLOCATE( r3t  (jpi,jpj,jpt) , r3u  (jpi,jpj,jpt) , r3v  (jpi,jpj,jpt) , r3f  (jpi,jpj) ,      &
+         &      r3t_f(jpi,jpj)     , r3u_f(jpi,jpj)     , r3v_f(jpi,jpj)                      ,  STAT=ierr(ii) )
+         !
+      ii = ii+1
+      ALLOCATE( fe3mask(jpi,jpj,jpk) , STAT=ierr(ii) )
+         !
+#elif defined key_linssh
+         ! linear ssh no time varying coordinate arrays
 #else
+         ! vvl : time varation for all vertical coordinate variables
+      ii = ii+1
+      ALLOCATE( gdept  (jpi,jpj,jpk,jpt) , gdepw  (jpi,jpj,jpk,jpt) , gde3w  (jpi,jpj,jpk) , STAT=ierr(ii) )
+         !
       ii = ii+1
       ALLOCATE( e3t(jpi,jpj,jpk,jpt) , e3u (jpi,jpj,jpk,jpt) , e3v (jpi,jpj,jpk,jpt) , e3f(jpi,jpj,jpk) ,      &
          &      e3w(jpi,jpj,jpk,jpt) , e3uw(jpi,jpj,jpk,jpt) , e3vw(jpi,jpj,jpk,jpt)                    ,  STAT=ierr(ii) )
-#endif
-         !
-      ii = ii+1
-      ALLOCATE( ht_0(jpi,jpj) ,    hu_0(jpi,jpj)    ,    hv_0(jpi,jpj)     , hf_0(jpi,jpj) ,       &
-         &   r1_ht_0(jpi,jpj) , r1_hu_0(jpi,jpj) ,    r1_hv_0(jpi,jpj),   r1_hf_0(jpi,jpj) ,   STAT=ierr(ii)  )
-         !
-#if ! defined key_qco
-      ii = ii+1
-      ALLOCATE( ht  (jpi,jpj) ,    hu  (jpi,jpj,jpt),    hv  (jpi,jpj,jpt)                 ,       &
-         &                      r1_hu  (jpi,jpj,jpt), r1_hv  (jpi,jpj,jpt)                 ,   STAT=ierr(ii)  )
+         !
+      ii = ii+1
+      ALLOCATE( ht  (jpi,jpj) ,    hu  (jpi,jpj,jpt),    hv  (jpi,jpj,jpt) ,       &
+         &                      r1_hu  (jpi,jpj,jpt), r1_hv  (jpi,jpj,jpt) ,   STAT=ierr(ii)  )
 #endif
          !
@@ -332,10 +352,7 @@
          !
       ii = ii+1
-      ALLOCATE( gdept_1d(jpk) , gdepw_1d(jpk) , e3t_1d(jpk) , e3w_1d(jpk) , STAT=ierr(ii) )
-         !
-      ii = ii+1
-      ALLOCATE( tmask_i(jpi,jpj) , tmask_h(jpi,jpj) ,                        &
+      ALLOCATE( tmask_i(jpi,jpj) , tmask_h(jpi,jpj) ,                                           &
          &      ssmask (jpi,jpj) , ssumask(jpi,jpj) , ssvmask(jpi,jpj) , ssfmask(jpi,jpj) ,     &
-         &      mbkt   (jpi,jpj) , mbku   (jpi,jpj) , mbkv   (jpi,jpj) ,                    STAT=ierr(ii) )
+         &      mbkt   (jpi,jpj) , mbku   (jpi,jpj) , mbkv   (jpi,jpj)                    , STAT=ierr(ii) )
          !
       ii = ii+1
@@ -348,9 +365,4 @@
       ii = ii+1
       ALLOCATE( wmask(jpi,jpj,jpk) , wumask(jpi,jpj,jpk), wvmask(jpi,jpj,jpk) , STAT=ierr(ii) )
-#if defined key_qco
-         !
-      ii = ii+1
-      ALLOCATE( fe3mask(jpi,jpj,jpk) , STAT=ierr(ii) )
-#endif
       !
       dom_oce_alloc = MAXVAL(ierr)
Index: NEMO/trunk/src/OCE/DOM/domzgr_substitute.h90
===================================================================
--- NEMO/trunk/src/OCE/DOM/domzgr_substitute.h90	(revision 14141)
+++ NEMO/trunk/src/OCE/DOM/domzgr_substitute.h90	(revision 14143)
@@ -28,7 +28,22 @@
 #   define  gdepw(i,j,k,t) (gdepw_0(i,j,k)*(1._wp+r3t(i,j,t)))
 #   define  gde3w(i,j,k)   (gdept_0(i,j,k)*(1._wp+r3t(i,j,Kmm))-ssh(i,j,Kmm))
+#elif defined key_linssh
+#   define  e3t(i,j,k,t)   e3t_0(i,j,k)
+#   define  e3u(i,j,k,t)   e3u_0(i,j,k)
+#   define  e3v(i,j,k,t)   e3v_0(i,j,k)
+#   define  e3f(i,j,k)     e3f_0(i,j,k)
+#   define  e3f_vor(i,j,k) e3f_0vor(i,j,k)
+#   define  e3w(i,j,k,t)   e3w_0(i,j,k)
+#   define  e3uw(i,j,k,t)  e3uw_0(i,j,k)
+#   define  e3vw(i,j,k,t)  e3vw_0(i,j,k)
+#   define  ht(i,j)        ht_0(i,j)
+#   define  hu(i,j,t)      hu_0(i,j)
+#   define  hv(i,j,t)      hv_0(i,j)
+#   define  r1_hu(i,j,t)   r1_hu_0(i,j)
+#   define  r1_hv(i,j,t)   r1_hv_0(i,j)
+#   define  gdept(i,j,k,t) gdept_0(i,j,k)
+#   define  gdepw(i,j,k,t) gdepw_0(i,j,k)
+#   define  gde3w(i,j,k)   (gdept_0(i,j,k)-ssh(i,j,Kmm))
 #endif
 !!----------------------------------------------------------------------
-!!#   define  e3t_f(i,j,k)   (e3t_0(i,j,k)*(1._wp+r3t_f(i,j)*tmask(i,j,k)))
-!!#   define  e3u_f(i,j,k)   (e3u_0(i,j,k)*(1._wp+r3u_f(i,j)*umask(i,j,k)))
-!!#   define  e3v_f(i,j,k)   (e3v_0(i,j,k)*(1._wp+r3v_f(i,j)*vmask(i,j,k)))
+
Index: NEMO/trunk/src/OCE/DYN/dynatf.F90
===================================================================
--- NEMO/trunk/src/OCE/DYN/dynatf.F90	(revision 14141)
+++ NEMO/trunk/src/OCE/DYN/dynatf.F90	(revision 14143)
@@ -60,11 +60,13 @@
    PUBLIC    dyn_atf   ! routine called by step.F90
 
-#if defined key_qco
+#if defined key_qco   ||   defined key_linssh
    !!----------------------------------------------------------------------
-   !!   'key_qco'      EMPTY ROUTINE     Quasi-Eulerian vertical coordonate
+   !!   'key_qco'                        Quasi-Eulerian vertical coordinate
+   !!       OR         EMPTY MODULE
+   !!   'key_linssh'                        Fix in time vertical coordinate
    !!----------------------------------------------------------------------
 CONTAINS
 
-   SUBROUTINE dyn_atf ( kt, Kbb, Kmm, Kaa, puu, pvv, pe3t, pe3u, pe3v )
+   SUBROUTINE dyn_atf( kt, Kbb, Kmm, Kaa, puu, pvv, pe3t, pe3u, pe3v )
       INTEGER                             , INTENT(in   ) :: kt               ! ocean time-step index
       INTEGER                             , INTENT(in   ) :: Kbb, Kmm, Kaa    ! before and after time level indices
Index: NEMO/trunk/src/OCE/DYN/dynatf_qco.F90
===================================================================
--- NEMO/trunk/src/OCE/DYN/dynatf_qco.F90	(revision 14141)
+++ NEMO/trunk/src/OCE/DYN/dynatf_qco.F90	(revision 14143)
@@ -66,5 +66,5 @@
 CONTAINS
 
-   SUBROUTINE dyn_atf_qco ( kt, Kbb, Kmm, Kaa, puu, pvv )
+   SUBROUTINE dyn_atf_qco( kt, Kbb, Kmm, Kaa, puu, pvv )
       !!----------------------------------------------------------------------
       !!                  ***  ROUTINE dyn_atf_qco  ***
@@ -196,5 +196,21 @@
       ! JC: Would be more clever to swap variables than to make a full vertical
       ! integration
-      ! CAUTION : calculation need to be done in the same way than see GM  
+      ! CAUTION : calculation need to be done in the same way than see GM
+#if defined key_linssh
+      uu_b(:,:,Kaa) = e3u(:,:,1,Kaa) * puu(:,:,1,Kaa) * umask(:,:,1)
+      uu_b(:,:,Kmm) = e3u(:,:,1,Kmm) * puu(:,:,1,Kmm) * umask(:,:,1)
+      vv_b(:,:,Kaa) = e3v(:,:,1,Kaa) * pvv(:,:,1,Kaa) * vmask(:,:,1)
+      vv_b(:,:,Kmm) = e3v(:,:,1,Kmm) * pvv(:,:,1,Kmm) * vmask(:,:,1)
+      DO jk = 2, jpkm1
+         uu_b(:,:,Kaa) = uu_b(:,:,Kaa) + e3u(:,:,jk,Kaa) * puu(:,:,jk,Kaa) * umask(:,:,jk)
+         uu_b(:,:,Kmm) = uu_b(:,:,Kmm) + e3u(:,:,jk,Kmm) * puu(:,:,jk,Kmm) * umask(:,:,jk)
+         vv_b(:,:,Kaa) = vv_b(:,:,Kaa) + e3v(:,:,jk,Kaa) * pvv(:,:,jk,Kaa) * vmask(:,:,jk)
+         vv_b(:,:,Kmm) = vv_b(:,:,Kmm) + e3v(:,:,jk,Kmm) * pvv(:,:,jk,Kmm) * vmask(:,:,jk)
+      END DO
+      uu_b(:,:,Kaa) = uu_b(:,:,Kaa) * r1_hu(:,:,Kaa)
+      vv_b(:,:,Kaa) = vv_b(:,:,Kaa) * r1_hv(:,:,Kaa)
+      uu_b(:,:,Kmm) = uu_b(:,:,Kmm) * r1_hu(:,:,Kmm)
+      vv_b(:,:,Kmm) = vv_b(:,:,Kmm) * r1_hv(:,:,Kmm)
+#else
       uu_b(:,:,Kaa) = e3u(:,:,1,Kaa) * puu(:,:,1,Kaa) * umask(:,:,1)
       uu_b(:,:,Kmm) = (e3u_0(:,:,1) * ( 1._wp + r3u_f(:,:) * umask(:,:,1) )) * puu(:,:,1,Kmm) * umask(:,:,1)
@@ -211,4 +227,5 @@
       uu_b(:,:,Kmm) = uu_b(:,:,Kmm) * (r1_hu_0(:,:)/( 1._wp + r3u_f(:,:) ))
       vv_b(:,:,Kmm) = vv_b(:,:,Kmm) * (r1_hv_0(:,:)/( 1._wp + r3v_f(:,:) ))
+#endif
       !
       IF( .NOT.ln_dynspg_ts ) THEN        ! output the barotropic currents
Index: NEMO/trunk/src/OCE/DYN/dynhpg.F90
===================================================================
--- NEMO/trunk/src/OCE/DYN/dynhpg.F90	(revision 14141)
+++ NEMO/trunk/src/OCE/DYN/dynhpg.F90	(revision 14143)
@@ -186,5 +186,5 @@
          &   CALL ctl_stop( 'dyn_hpg_init : non-linear free surface incompatible with hpg_zco or hpg_zps' )
       !
-      IF( .NOT. (ln_hpg_isf.AND.ln_isfcav) )                  &
+      IF( (.NOT.ln_hpg_isf .AND. ln_isfcav) .OR. (ln_hpg_isf .AND. .NOT.ln_isfcav) )                  &
          &   CALL ctl_stop( 'dyn_hpg_init : ln_hpg_isf=T requires ln_isfcav=T and vice versa' )  
       !
Index: NEMO/trunk/src/OCE/DYN/dynvor.F90
===================================================================
--- NEMO/trunk/src/OCE/DYN/dynvor.F90	(revision 14141)
+++ NEMO/trunk/src/OCE/DYN/dynvor.F90	(revision 14143)
@@ -406,5 +406,5 @@
          END SELECT
          !
-#if defined key_qco
+#if defined key_qco   ||   defined key_linssh
          DO_2D( 1, 0, 1, 0 )                 !==  potential vorticity  ==!   (key_qco)
             zwz(ji,jj) = zwz(ji,jj) / e3f_vor(ji,jj,jk)
@@ -533,5 +533,5 @@
          !
          !
-#if defined key_qco
+#if defined key_qco   ||   defined key_linssh
          DO_2D( 1, 0, 1, 0 )                 !==  potential vorticity  ==!   (key_qco)
             zwz(ji,jj) = zwz(ji,jj) / e3f_vor(ji,jj,jk)
@@ -624,5 +624,5 @@
          !                                             ! ===============
          !
-#if defined key_qco
+#if defined key_qco   ||   defined key_linssh
          DO_2D( 1, 0, 1, 0 )                 ! == reciprocal of e3 at F-point (key_qco)
             z1_e3f(ji,jj) = 1._wp / e3f_vor(ji,jj,jk)
@@ -952,6 +952,6 @@
          !
       END SELECT
-#if defined key_qco
-      SELECT CASE( nvor_scheme )    ! qco case: pre-computed a specific e3f_0 for some vorticity schemes
+#if defined key_qco   ||   defined key_linssh
+      SELECT CASE( nvor_scheme )    ! qco or linssh cases : pre-computed a specific e3f_0 for some vorticity schemes
       CASE( np_ENS , np_ENE , np_EEN , np_MIX )
          !
Index: NEMO/trunk/src/OCE/ISF/isfcpl.F90
===================================================================
--- NEMO/trunk/src/OCE/ISF/isfcpl.F90	(revision 14141)
+++ NEMO/trunk/src/OCE/ISF/isfcpl.F90	(revision 14143)
@@ -15,4 +15,6 @@
 #if defined key_qco
    USE domqco  , ONLY : dom_qco_zgr      ! vertical scale factor interpolation
+#elif defined key_linssh
+   !                                     ! fix in time coordinate
 #else
    USE domvvl  , ONLY : dom_vvl_zgr      ! vertical scale factor interpolation
@@ -117,5 +119,5 @@
       vv   (:,:,:,Kbb)   = vv   (:,:,:,Kmm)
       ssh (:,:,Kbb)     = ssh (:,:,Kmm)
-#if ! defined key_qco
+#if ! defined key_qco   &&   ! defined key_linssh
       e3t(:,:,:,Kbb)   = e3t(:,:,:,Kmm)
 #endif
@@ -217,5 +219,9 @@
       IF(lwp) write(numout,*) 'isfcpl_ssh : recompute scale factor from ssh (new wet cell,Kmm)'
       IF(lwp) write(numout,*) '~~~~~~~~~~~'
-#if ! defined key_qco
+#if defined key_qco
+      CALL dom_qco_zgr(Kbb, Kmm)
+#elif defined key_linssh
+      ! linear ssh : fix in time coord.
+#else
       DO jk = 1, jpk
          e3t(:,:,jk,Kmm) = e3t_0(:,:,jk) * ( 1._wp + (ht_0(:,:) + ssh(:,:,Kmm)) * r1_ht_0(:,:) )
@@ -223,6 +229,4 @@
       e3t(:,:,:,Kbb) = e3t(:,:,:,Kmm)
       CALL dom_vvl_zgr(Kbb, Kmm, Kaa)
-#else
-      CALL dom_qco_zgr(Kbb, Kmm)
 #endif
       !
Index: NEMO/trunk/src/OCE/ISF/isfstp.F90
===================================================================
--- NEMO/trunk/src/OCE/ISF/isfstp.F90	(revision 14141)
+++ NEMO/trunk/src/OCE/ISF/isfstp.F90	(revision 14143)
@@ -87,7 +87,7 @@
             ze3t(:,:,jk) = e3t(:,:,jk,Kmm)
          END DO 
-         CALL isf_tbl_lvl( ht(:,:), ze3t, misfkt_cav, misfkb_cav, rhisf_tbl_cav, rfrac_tbl_cav )
+         CALL isf_tbl_lvl( ht(:,:), ze3t           , misfkt_cav, misfkb_cav, rhisf_tbl_cav, rfrac_tbl_cav )
 #else
-         CALL isf_tbl_lvl( ht(:,:),  e3t, misfkt_cav, misfkb_cav, rhisf_tbl_cav, rfrac_tbl_cav )
+         CALL isf_tbl_lvl( ht(:,:),  e3t(:,:,:,Kmm), misfkt_cav, misfkb_cav, rhisf_tbl_cav, rfrac_tbl_cav )
 #endif
          !
@@ -116,7 +116,7 @@
             ze3t(:,:,jk) = e3t(:,:,jk,Kmm)
          END DO
-         CALL isf_tbl_lvl( ht(:,:), ze3t, misfkt_par, misfkb_par, rhisf_tbl_par, rfrac_tbl_par )
+         CALL isf_tbl_lvl( ht(:,:), ze3t           , misfkt_par, misfkb_par, rhisf_tbl_par, rfrac_tbl_par )
 #else
-         CALL isf_tbl_lvl( ht(:,:),  e3t, misfkt_par, misfkb_par, rhisf_tbl_par, rfrac_tbl_par )
+         CALL isf_tbl_lvl( ht(:,:),  e3t(:,:,:,Kmm), misfkt_par, misfkb_par, rhisf_tbl_par, rfrac_tbl_par )
 #endif
          !
Index: NEMO/trunk/src/OCE/nemogcm.F90
===================================================================
--- NEMO/trunk/src/OCE/nemogcm.F90	(revision 14141)
+++ NEMO/trunk/src/OCE/nemogcm.F90	(revision 14143)
@@ -51,11 +51,4 @@
    USE istate         ! initial state setting          (istate_init routine)
    USE trdini         ! dyn/tra trends initialization     (trd_init routine)
-   USE asminc         ! assimilation increments     
-   USE asmbkg         ! writing out state trajectory
-   USE diadct         ! sections transports           (dia_dct_init routine)
-   USE diaobs         ! Observation diagnostics       (dia_obs_init routine)
-   USE diacfl         ! CFL diagnostics               (dia_cfl_init routine)
-   USE diamlr         ! IOM context management for multiple-linear-regression analysis
-   USE isfstp         ! ice shelf                     (isf_stp_init routine)
    USE icbini         ! handle bergs, initialisation
    USE icbstp  , ONLY : icb_end     ! handle bergs, close iceberg files
@@ -73,5 +66,5 @@
    USE ice_domain_size, only: nx_global, ny_global
 #endif
-#if defined key_qco
+#if defined key_qco   ||   defined key_linssh
    USE stpmlf         ! NEMO time-stepping               (stp_MLF   routine)
 #else
@@ -83,12 +76,5 @@
    USE lbcnfd  , ONLY : isendto, nsndto  ! Setup of north fold exchanges
    USE lib_fortran    ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined)
-#if defined key_iomput
-   USE xios           ! xIOserver
-#endif
-#if defined key_agrif
-   USE agrif_all_update   ! Master Agrif update
-   USE agrif_oce_update
-#endif
-   USE halo_mng
+   USE halo_mng       ! halo manager
 
    IMPLICIT NONE
@@ -175,5 +161,6 @@
       !
       DO WHILE( istp <= nitend .AND. nstop == 0 )
-#  if defined key_qco
+         !
+#  if defined key_qco   ||   defined key_linssh
          CALL stp_MLF
 #  else
@@ -196,8 +183,8 @@
             ENDIF
             !
-#  if defined key_qco
-            CALL stp_MLF      ( istp )
+#  if defined key_qco   ||   defined key_linssh
+            CALL stp_MLF( istp )
 #  else
-            CALL stp        ( istp )
+            CALL stp    ( istp )
 #  endif
             istp = istp + 1
@@ -343,5 +330,5 @@
       IF(lwp) THEN                      ! open listing units
          !
-         IF( .NOT.lwm )   &            ! alreay opened for narea == 1
+         IF( .NOT. lwm )   &            ! alreay opened for narea == 1
             &            CALL ctl_opn( numout, 'ocean.output', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, -1, .FALSE., narea )
          !
Index: NEMO/trunk/src/OCE/step.F90
===================================================================
--- NEMO/trunk/src/OCE/step.F90	(revision 14141)
+++ NEMO/trunk/src/OCE/step.F90	(revision 14143)
@@ -33,7 +33,9 @@
    !!            4.1  !  2019-08  (A. Coward, D. Storkey) rewrite in preparation for new timestepping scheme
    !!----------------------------------------------------------------------
-#if defined key_qco
-   !!----------------------------------------------------------------------
-   !!   'key_qco'      EMPTY MODULE      Quasi-Eulerian vertical coordonate
+#if defined key_qco   ||   defined key_linssh
+   !!----------------------------------------------------------------------
+   !!   'key_qco'      EMPTY MODULE      Quasi-Eulerian vertical coordinate
+   !!                                OR
+   !!   'key_linssh    EMPTY MODULE       Fixed in time vertical coordinate
    !!----------------------------------------------------------------------
 #else
Index: NEMO/trunk/src/OCE/step_oce.F90
===================================================================
--- NEMO/trunk/src/OCE/step_oce.F90	(revision 14141)
+++ NEMO/trunk/src/OCE/step_oce.F90	(revision 14143)
@@ -110,4 +110,5 @@
    USE agrif_oce_sponge ! Momemtum and tracers sponges
    USE agrif_all_update ! Main update driver
+   USE agrif_oce_update
 #endif
 #if defined key_top
Index: NEMO/trunk/src/OCE/stpctl.F90
===================================================================
--- NEMO/trunk/src/OCE/stpctl.F90	(revision 14141)
+++ NEMO/trunk/src/OCE/stpctl.F90	(revision 14143)
@@ -15,4 +15,5 @@
    !!----------------------------------------------------------------------
    !!   stp_ctl      : Control the run
+   !!   stp_ctl_SWE  : Control the run (SWE only)
    !!----------------------------------------------------------------------
    USE oce             ! ocean dynamics and tracers variables
@@ -33,7 +34,9 @@
 
    PUBLIC stp_ctl           ! routine called by step.F90
+   PUBLIC stp_ctl_SWE       ! routine called by stpmlf.F90
 
    INTEGER                ::   nrunid   ! netcdf file id
    INTEGER, DIMENSION(8)  ::   nvarid   ! netcdf variable id
+   INTEGER, DIMENSION(2)  ::   nvarid_SWE   ! netcdf variable id (SWE only)
    !!----------------------------------------------------------------------
    !! NEMO/OCE 4.0 , NEMO Consortium (2018)
@@ -270,4 +273,181 @@
 
 
+   SUBROUTINE stp_ctl_SWE( kt, Kmm )
+      !!----------------------------------------------------------------------
+      !!                    ***  ROUTINE stp_ctl_SWE  ***
+      !!                     
+      !! ** Purpose :   Control the run
+      !!
+      !! ** Method  : - Save the time step in numstp
+      !!              - Print it each 50 time steps
+      !!              - Stop the run IF problem encountered by setting nstop > 0
+      !!                Problems checked: e3t0+ssh minimum smaller that 0
+      !!                                  |U|   maximum larger than 10 m/s 
+      !!                                  ( not for SWE : negative sea surface salinity )
+      !!
+      !! ** Actions :   "time.step" file = last ocean time-step
+      !!                "run.stat"  file = run statistics
+      !!                 nstop indicator sheared among all local domain
+      !!----------------------------------------------------------------------
+      INTEGER, INTENT(in   ) ::   kt       ! ocean time-step index
+      INTEGER, INTENT(in   ) ::   Kmm      ! ocean time level index
+      !!
+      INTEGER                         ::   ji                                    ! dummy loop indices
+      INTEGER                         ::   idtime, istatus
+      INTEGER , DIMENSION(3)          ::   iareasum, iareamin, iareamax
+      INTEGER , DIMENSION(3,4)        ::   iloc                                  ! min/max loc indices
+      REAL(wp)                        ::   zzz                                   ! local real 
+      REAL(wp), DIMENSION(3)          ::   zmax, zmaxlocal
+      LOGICAL                         ::   ll_wrtstp, ll_colruns, ll_wrtruns, ll_0oce
+      LOGICAL, DIMENSION(jpi,jpj,jpk) ::   llmsk
+      CHARACTER(len=20)               ::   clname
+      !!----------------------------------------------------------------------
+      !
+      IF( nstop > 0 .AND. ngrdstop > -1 )   RETURN   !   stpctl was already called by a child grid
+      !
+      ll_wrtstp  = ( MOD( kt-nit000, sn_cfctl%ptimincr ) == 0 ) .OR. ( kt == nitend )
+      ll_colruns = ll_wrtstp .AND. sn_cfctl%l_runstat .AND. jpnij > 1 
+      ll_wrtruns = ( ll_colruns .OR. jpnij == 1 ) .AND. lwm
+      !
+      IF( kt == nit000 ) THEN
+         !
+         IF( lwp ) THEN
+            WRITE(numout,*)
+            WRITE(numout,*) 'stp_ctl_SWE : time-stepping control'
+            WRITE(numout,*) '~~~~~~~~~~~'
+         ENDIF
+         !                                ! open time.step    ascii file, done only by 1st subdomain
+         IF( lwm )   CALL ctl_opn( numstp, 'time.step', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp, narea )
+         !
+         IF( ll_wrtruns ) THEN
+            !                             ! open run.stat     ascii file, done only by 1st subdomain
+            CALL ctl_opn( numrun, 'run.stat', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp, narea )
+            !                             ! open run.stat.nc netcdf file, done only by 1st subdomain
+            clname = 'run.stat.nc'
+            IF( .NOT. Agrif_Root() )   clname = TRIM(Agrif_CFixed())//"_"//TRIM(clname)
+            istatus = NF90_CREATE( TRIM(clname), NF90_CLOBBER, nrunid )
+            istatus = NF90_DEF_DIM( nrunid, 'time', NF90_UNLIMITED, idtime )
+            istatus = NF90_DEF_VAR( nrunid, 'abs_ssh_max', NF90_DOUBLE, (/ idtime /), nvarid_SWE(1) )
+            istatus = NF90_DEF_VAR( nrunid,   'abs_u_max', NF90_DOUBLE, (/ idtime /), nvarid_SWE(2) )
+            istatus = NF90_ENDDEF(nrunid)
+         ENDIF
+         !    
+      ENDIF
+      !
+      !                                   !==              write current time step              ==!
+      !                                   !==  done only by 1st subdomain at writting timestep  ==!
+      IF( lwm .AND. ll_wrtstp ) THEN
+         WRITE ( numstp, '(1x, i8)' )   kt
+         REWIND( numstp )
+      ENDIF
+      !                                   !==            test of local extrema           ==!
+      !                                   !==  done by all processes at every time step  ==!
+      !
+      llmsk(   1:Nis1,:,:) = .FALSE.                                              ! exclude halos from the checked region
+      llmsk(Nie1: jpi,:,:) = .FALSE.
+      llmsk(:,   1:Njs1,:) = .FALSE.
+      llmsk(:,Nje1: jpj,:) = .FALSE.
+      !
+      llmsk(Nis0:Nie0,Njs0:Nje0,1) = ssmask(Nis0:Nie0,Njs0:Nje0) == 1._wp         ! define only the inner domain
+      !
+      ll_0oce = .NOT. ANY( llmsk(:,:,1) )                                         ! no ocean point in the inner domain?
+      !
+      zmax(1) = MINVAL( -e3t_0(:,:,1)-ssh(:,:,Kmm)  , mask = llmsk(:,:,1)  )       ! e3t_Kmm min
+      !
+      llmsk(Nis0:Nie0,Njs0:Nje0,:) = umask(Nis0:Nie0,Njs0:Nje0,:) == 1._wp        ! define only the inner domain
+      zmax(2) = MAXVAL(  ABS( uu(:,:,:,Kmm) )      , mask = llmsk(:,:,:) )        ! velocity max (zonal only)
+      zmax(3) = REAL( nstop , wp )                                                ! stop indicator
+
+      !                                   !==               get global extrema             ==!
+      !                                   !==  done by all processes if writting run.stat  ==!
+      IF( ll_colruns ) THEN
+         zmaxlocal(:) = zmax(:)
+         CALL mpp_max( "stpctl", zmax )          ! max over the global domain
+         nstop = NINT( zmax(3) )                 ! update nstop indicator (now sheared among all local domains)
+      ELSE
+         ! if no ocean point: MAXVAL returns -HUGE => we must overwrite this value to avoid error handling bellow.
+         IF( ll_0oce )   zmax(1:4) = (/ 0._wp, 0._wp, -1._wp, 1._wp /)   ! default "valid" values...
+      ENDIF
+      !
+      zmax(1) = -zmax(1)                         ! move back from max(-zz) to min(zz) : easier to manage!
+      !
+      !                                   !==              write "run.stat" files              ==!
+      !                                   !==  done only by 1st subdomain at writting timestep  ==!
+      IF( ll_wrtruns ) THEN
+         WRITE(numrun,9500) kt, zmax(1), zmax(2)
+         istatus = NF90_PUT_VAR( nrunid, nvarid_SWE(1), (/ zmax(1)/), (/kt/), (/1/) )
+         istatus = NF90_PUT_VAR( nrunid, nvarid_SWE(2), (/ zmax(2)/), (/kt/), (/1/) )
+         IF( kt == nitend )   istatus = NF90_CLOSE(nrunid)
+      ENDIF
+      !                                   !==               error handling               ==!
+      !                                   !==  done by all processes at every time step  ==!
+      !
+!!SWE specific : start
+      IF(   zmax(1) <=   0._wp .OR.           &               ! negative e3t_Kmm
+         &  zmax(2) >   10._wp .OR.           &               ! too large velocity ( > 10 m/s)
+         &  ISNAN( zmax(1) + zmax(2) ) .OR.   &               ! NaN encounter in the tests
+         &  ABS(   zmax(1) + zmax(2) ) > HUGE(1._wp) ) THEN   ! Infinity encounter in the tests
+         !
+         iloc(:,:) = 0
+         IF( ll_colruns ) THEN   ! zmax is global, so it is the same on all subdomains -> no dead lock with mpp_maxloc
+            ! first: close the netcdf file, so we can read it
+            IF( lwm .AND. kt /= nitend )   istatus = NF90_CLOSE(nrunid)
+            ! get global loc on the min/max
+            llmsk(Nis0:Nie0,Njs0:Nje0,1) = ssmask(Nis0:Nie0,Njs0:Nje0 ) == 1._wp         ! define only the inner domain
+            CALL mpp_minloc( 'stpctl', e3t_0(:,:,1) + ssh(:,:,Kmm), llmsk(:,:,1), zzz, iloc(1:2,1) )   ! mpp_maxloc ok if mask = F
+            llmsk(Nis0:Nie0,Njs0:Nje0,:) = tmask(Nis0:Nie0,Njs0:Nje0,:) == 1._wp        ! define only the inner domain
+            CALL mpp_maxloc( 'stpctl', ABS( uu(:,:,:,Kmm))        , llmsk(:,:,:), zzz, iloc(1:3,2) )
+            ! find which subdomain has the max.
+            iareamin(:) = jpnij+1   ;   iareamax(:) = 0   ;   iareasum(:) = 0
+            DO ji = 1, 3
+               IF( zmaxlocal(ji) == zmax(ji) ) THEN
+                  iareamin(ji) = narea   ;   iareamax(ji) = narea   ;   iareasum(ji) = 1
+               ENDIF
+            END DO
+            CALL mpp_min( "stpctl", iareamin )         ! min over the global domain
+            CALL mpp_max( "stpctl", iareamax )         ! max over the global domain
+            CALL mpp_sum( "stpctl", iareasum )         ! sum over the global domain
+         ELSE                    ! find local min and max locations:
+            ! if we are here, this means that the subdomain contains some oce points -> no need to test the mask used in maxloc
+            llmsk(Nis0:Nie0,Njs0:Nje0,1) = ssmask(Nis0:Nie0,Njs0:Nje0 ) == 1._wp        ! define only the inner domain
+            iloc(1:2,1) = MINLOC( e3t_0(:,:,1) + ssh(:,:,Kmm), mask = llmsk(:,:,1) )
+            !
+            llmsk(Nis0:Nie0,Njs0:Nje0,:) = umask(Nis0:Nie0,Njs0:Nje0,:) == 1._wp        ! define only the inner domain
+            iloc(1:3,2) = MAXLOC( ABS(  uu(:,:,:,       Kmm)), mask = llmsk(:,:,:) )
+            iareamin(:) = narea   ;   iareamax(:) = narea   ;   iareasum(:) = 1         ! this is local information
+         ENDIF
+         !
+         WRITE(ctmp1,*) ' stp_ctl_SWE:  e3t0+ssh < 0 m  or  |U| > 10 m/s  or  NaN encounter in the tests'
+         CALL wrt_line( ctmp2, kt, 'e3t0+ssh min',  zmax(1), iloc(:,1), iareasum(1), iareamin(1), iareamax(1) )
+         CALL wrt_line( ctmp3, kt, '|U|   max'   ,  zmax(2), iloc(:,2), iareasum(2), iareamin(2), iareamax(2) )
+         IF( Agrif_Root() ) THEN
+            WRITE(ctmp6,*) '      ===> output of last computed fields in output.abort* files'
+         ELSE
+            WRITE(ctmp6,*) '      ===> output of last computed fields in '//TRIM(Agrif_CFixed())//'_output.abort* files'
+         ENDIF
+         !
+         CALL dia_wri_state( Kmm, 'output.abort' )     ! create an output.abort file
+         !
+         IF( ll_colruns .or. jpnij == 1 ) THEN   ! all processes synchronized -> use lwp to print in opened ocean.output files
+            IF(lwp) THEN   ;   CALL ctl_stop( ctmp1, ' ', ctmp2, ctmp3, ' ', ctmp6 )
+            ELSE           ;   nstop = MAX(1, nstop)   ! make sure nstop > 0 (automatically done when calling ctl_stop)
+            ENDIF
+         ELSE                                    ! only mpi subdomains with errors are here -> STOP now
+            CALL ctl_stop( 'STOP', ctmp1, ' ', ctmp2, ctmp3, ' ', ctmp6 )
+         ENDIF
+         !
+      ENDIF
+!!SWE specific : end
+      !
+      IF( nstop > 0 ) THEN                                                  ! an error was detected and we did not abort yet...
+         ngrdstop = Agrif_Fixed()                                           ! store which grid got this error
+         IF( .NOT. ll_colruns .AND. jpnij > 1 )   CALL ctl_stop( 'STOP' )   ! we must abort here to avoid MPI deadlock
+      ENDIF
+      !
+9500  FORMAT(' it :', i8, '      e3t_min: ', D23.16, ' |U|_max: ', D23.16)
+      !
+   END SUBROUTINE stp_ctl_SWE
+
+
    SUBROUTINE wrt_line( cdline, kt, cdprefix, pval, kloc, ksum, kmin, kmax )
       !!----------------------------------------------------------------------
Index: NEMO/trunk/src/OCE/stpmlf.F90
===================================================================
--- NEMO/trunk/src/OCE/stpmlf.F90	(revision 14141)
+++ NEMO/trunk/src/OCE/stpmlf.F90	(revision 14143)
@@ -36,11 +36,13 @@
    !!----------------------------------------------------------------------
 
-#if defined key_qco
-   !!----------------------------------------------------------------------
-   !!   'key_qco'       Quasi-Eulerian vertical coordonate
-   !!----------------------------------------------------------------------
-   
-   !!----------------------------------------------------------------------
-   !!   stp_MLF       : NEMO modified Leap Frog time-stepping with qco
+#if defined key_qco   ||   defined key_linssh
+   !!----------------------------------------------------------------------
+   !!   'key_qco'                        Quasi-Eulerian vertical coordinate
+   !!                          OR
+   !!   'key_linssh                       Fixed in time vertical coordinate
+   !!----------------------------------------------------------------------
+
+   !!----------------------------------------------------------------------
+   !!   stp_MLF       : NEMO modified Leap Frog time-stepping with qco or linssh
    !!----------------------------------------------------------------------
    USE step_oce       ! time stepping definition modules
@@ -196,5 +198,5 @@
       END DO
                             CALL ssh_nxt    ( kstp, Nbb, Nnn, ssh,  Naa )   ! after ssh (includes call to div_hor)
-      IF( .NOT.ln_linssh )  THEN
+      IF( .NOT.lk_linssh )  THEN
                              CALL dom_qco_r3c( ssh(:,:,Naa), r3t(:,:,Naa), r3u(:,:,Naa), r3v(:,:,Naa)           )   ! "after" ssh/h_0 ratio at t,u,v pts
          IF( ln_dynspg_exp ) CALL dom_qco_r3c( ssh(:,:,Nnn), r3t(:,:,Nnn), r3u(:,:,Nnn), r3v(:,:,Nnn), r3f(:,:) )   ! spg_exp : needed only for "now" ssh/h_0 ratio at f point
@@ -225,5 +227,5 @@
       IF( ln_dynspg_ts ) THEN                         ! vertical scale factors and vertical velocity need to be updated
                             CALL div_hor    ( kstp, Nbb, Nnn )                ! Horizontal divergence  (2nd call in time-split case)
-         IF(.NOT.ln_linssh) CALL dom_qco_r3c ( ssh(:,:,Naa), r3t(:,:,Naa), r3u(:,:,Naa), r3v(:,:,Naa), r3f(:,:) )   ! update ssh/h_0 ratio at t,u,v,f pts 
+         IF(.NOT.lk_linssh) CALL dom_qco_r3c ( ssh(:,:,Naa), r3t(:,:,Naa), r3u(:,:,Naa), r3v(:,:,Naa), r3f(:,:) )   ! update ssh/h_0 ratio at t,u,v,f pts 
       ENDIF
                             CALL dyn_zdf    ( kstp, Nbb, Nnn, Nrhs, uu, vv, Naa  )  ! vertical diffusion
@@ -257,5 +259,5 @@
       !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
                          CALL ssh_atf    ( kstp, Nbb, Nnn, Naa, ssh )            ! time filtering of "now" sea surface height
-                         CALL dom_qco_r3c( ssh(:,:,Nnn), r3t_f, r3u_f, r3v_f )   ! "now" ssh/h_0 ratio from filtrered ssh
+      IF(.NOT.lk_linssh) CALL dom_qco_r3c( ssh(:,:,Nnn), r3t_f, r3u_f, r3v_f )   ! "now" ssh/h_0 ratio from filtrered ssh
 #if defined key_top
       !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
@@ -311,8 +313,10 @@
                          CALL finalize_lbc  ( kstp, Nbb     , Naa, uu, vv, ts )   ! boundary conditions
                          CALL tra_atf_qco   ( kstp, Nbb, Nnn, Naa        , ts )   ! time filtering of "now" tracer arrays
-                         CALL dyn_atf_qco   ( kstp, Nbb, Nnn, Naa, uu, vv     )   ! time filtering of "now" velocities 
+                         CALL dyn_atf_qco   ( kstp, Nbb, Nnn, Naa, uu, vv     )   ! time filtering of "now" velocities
+      IF(.NOT.lk_linssh) THEN
                          r3t(:,:,Nnn) = r3t_f(:,:)                                ! update now ssh/h_0 with time filtered values
                          r3u(:,:,Nnn) = r3u_f(:,:)
                          r3v(:,:,Nnn) = r3v_f(:,:)
+      ENDIF
 
       !
Index: NEMO/trunk/src/SWE/stprk3.F90
===================================================================
--- NEMO/trunk/src/SWE/stprk3.F90	(revision 14141)
+++ NEMO/trunk/src/SWE/stprk3.F90	(revision 14143)
@@ -347,6 +347,6 @@
       !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
       
-      IF( ln_diacfl  )   CALL dia_cfl   ( kstp,      Nnn )      ! Courant number diagnostics
-                         CALL dia_wri   ( kstp,      Nnn )      ! ocean model: outputs
+      IF( ln_diacfl  )   CALL dia_cfl      ( kstp,      Nnn )      ! Courant number diagnostics
+                         CALL dia_wri      ( kstp,      Nnn )      ! ocean model: outputs
       !
       IF( lrst_oce   )   CALL rst_write    ( kstp, Nbb, Nnn )   ! write output ocean restart file
@@ -355,5 +355,5 @@
       ! Control
       !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-                         CALL stp_ctl_SWE  ( kstp, Nnn )
+                         CALL stp_ctl_SWE  ( kstp     , Nnn )
 
       IF( kstp == nit000 ) THEN                          ! 1st time step only
Index: NEMO/trunk/src/TOP/TRP/trcatf.F90
===================================================================
--- NEMO/trunk/src/TOP/TRP/trcatf.F90	(revision 14141)
+++ NEMO/trunk/src/TOP/TRP/trcatf.F90	(revision 14143)
@@ -25,24 +25,24 @@
    !!   'key_top'                                                TOP models
    !!----------------------------------------------------------------------
-   !!   trc_atf     : time stepping on passive tracers
+   !!   trc_atf       : time stepping on passive tracers
    !!----------------------------------------------------------------------
    USE par_trc        ! need jptra, number of passive tracers
-   USE oce_trc         ! ocean dynamics and tracers variables
-   USE trc             ! ocean passive tracers variables
+   USE oce_trc        ! ocean dynamics and tracers variables
+   USE trc            ! ocean passive tracers variables
    USE trd_oce
    USE trdtra
-# if defined key_qco
-   USE traatf_qco
+# if defined key_qco   ||   defined key_linssh
+   USE traatf_qco     ! tracer : Asselin filter (qco)
 # else
-   USE traatf
+   USE traatf         ! tracer : Asselin filter (vvl)
 # endif
    USE bdy_oce   , ONLY: ln_bdy
-   USE trcbdy          ! BDY open boundaries
+   USE trcbdy         ! BDY open boundaries
 # if defined key_agrif
    USE agrif_top_interp
 # endif
    !
-   USE lbclnk          ! ocean lateral boundary conditions (or mpp link)
-   USE prtctl          ! Print control for debbuging
+   USE lbclnk         ! ocean lateral boundary conditions (or mpp link)
+   USE prtctl         ! Print control for debbuging
 
    IMPLICIT NONE
@@ -157,10 +157,10 @@
       ELSE     
          IF( .NOT. l_offline ) THEN ! Leap-Frog + Asselin filter time stepping
-# if defined key_qco
+# if defined key_qco   ||   defined key_linssh
             IF( ln_linssh ) THEN   ;   CALL tra_atf_fix_lf( kt, Kbb, Kmm, Kaa, nittrc000,        'TRC', ptr, jptra )                     !     linear ssh
             ELSE                   ;   CALL tra_atf_qco_lf( kt, Kbb, Kmm, Kaa, nittrc000, rn_Dt, 'TRC', ptr, sbc_trc, sbc_trc_b, jptra ) ! non-linear ssh
 # else
-            IF( ln_linssh ) THEN   ;   CALL tra_atf_fix( kt, Kbb, Kmm, Kaa, nittrc000,         'TRC', ptr, jptra )                     !     linear ssh
-            ELSE                   ;   CALL tra_atf_vvl( kt, Kbb, Kmm, Kaa, nittrc000, rn_Dt, 'TRC', ptr, sbc_trc, sbc_trc_b, jptra ) ! non-linear ssh
+            IF( ln_linssh ) THEN   ;   CALL tra_atf_fix( kt, Kbb, Kmm, Kaa, nittrc000,         'TRC', ptr, jptra )                       !     linear ssh
+            ELSE                   ;   CALL tra_atf_vvl( kt, Kbb, Kmm, Kaa, nittrc000, rn_Dt, 'TRC', ptr, sbc_trc, sbc_trc_b, jptra )    ! non-linear ssh
 # endif
             ENDIF
@@ -193,5 +193,5 @@
    END SUBROUTINE trc_atf
 
-# if ! defined key_qco
+# if defined key_qco   ||   defined key_linssh
    SUBROUTINE trc_atf_off( kt, Kbb, Kmm, Kaa, ptr )
       !!----------------------------------------------------------------------
@@ -225,5 +225,5 @@
       INTEGER  ::   ji, jj, jk, jn              ! dummy loop indices
       REAL(wp) ::   ztc_a , ztc_n , ztc_b , ztc_f , ztc_d    ! local scalar
-      REAL(wp) ::   ze3t_b, ze3t_n, ze3t_a, ze3t_f, ze3t_d   !   -      -
+      REAL(wp) ::   ze3t_b, ze3t_n, ze3t_a, ze3t_f           !   -      -
       !!----------------------------------------------------------------------
       !
@@ -241,20 +241,18 @@
       DO jn = 1, jptra      
          DO_3D( 1, 1, 1, 1, 1, jpkm1 )
-            ze3t_b = e3t(ji,jj,jk,Kbb)
-            ze3t_n = e3t(ji,jj,jk,Kmm)
-            ze3t_a = e3t(ji,jj,jk,Kaa)
+            ze3t_b = 1._wp + r3t(ji,jj,Kbb) * tmask(ji,jj,jk)
+            ze3t_n = 1._wp + r3t(ji,jj,Kmm) * tmask(ji,jj,jk)
+            ze3t_a = 1._wp + r3t(ji,jj,Kaa) * tmask(ji,jj,jk)
             !                                         ! tracer content at Before, now and after
-            ztc_b  = ptr(ji,jj,jk,jn,Kbb)  * ze3t_b
-            ztc_n  = ptr(ji,jj,jk,jn,Kmm)  * ze3t_n
+            ztc_b  = ptr(ji,jj,jk,jn,Kbb) * ze3t_b
+            ztc_n  = ptr(ji,jj,jk,jn,Kmm) * ze3t_n
             ztc_a  = ptr(ji,jj,jk,jn,Kaa) * ze3t_a
             !
-            ze3t_d = ze3t_a - 2. * ze3t_n + ze3t_b
             ztc_d  = ztc_a  - 2. * ztc_n  + ztc_b
             !
-            ze3t_f = ze3t_n + rn_atfp * ze3t_d
+            ze3t_f = 1._wp + r3t_f(ji,jj)*tmask(ji,jj,jk)
             ztc_f  = ztc_n  + rn_atfp * ztc_d
             !
             IF( .NOT. ln_linssh .AND. jk == mikt(ji,jj) ) THEN           ! first level 
-               ze3t_f = ze3t_f - rfact2 * ( emp_b(ji,jj)      - emp(ji,jj)   ) 
                ztc_f  = ztc_f  - rfact1 * ( sbc_trc(ji,jj,jn) - sbc_trc_b(ji,jj,jn) )
             ENDIF
@@ -300,5 +298,5 @@
       INTEGER  ::   ji, jj, jk, jn              ! dummy loop indices
       REAL(wp) ::   ztc_a , ztc_n , ztc_b , ztc_f , ztc_d    ! local scalar
-      REAL(wp) ::   ze3t_b, ze3t_n, ze3t_a, ze3t_f           !   -      -
+      REAL(wp) ::   ze3t_b, ze3t_n, ze3t_a, ze3t_f, ze3t_d   !   -      -
       !!----------------------------------------------------------------------
       !
@@ -316,18 +314,20 @@
       DO jn = 1, jptra      
          DO_3D( 1, 1, 1, 1, 1, jpkm1 )
-            ze3t_b = 1._wp + r3t(ji,jj,Kbb) * tmask(ji,jj,jk)
-            ze3t_n = 1._wp + r3t(ji,jj,Kmm) * tmask(ji,jj,jk)
-            ze3t_a = 1._wp + r3t(ji,jj,Kaa) * tmask(ji,jj,jk)
+            ze3t_b = e3t(ji,jj,jk,Kbb)
+            ze3t_n = e3t(ji,jj,jk,Kmm)
+            ze3t_a = e3t(ji,jj,jk,Kaa)
             !                                         ! tracer content at Before, now and after
-            ztc_b  = ptr(ji,jj,jk,jn,Kbb) * ze3t_b
-            ztc_n  = ptr(ji,jj,jk,jn,Kmm) * ze3t_n
+            ztc_b  = ptr(ji,jj,jk,jn,Kbb)  * ze3t_b
+            ztc_n  = ptr(ji,jj,jk,jn,Kmm)  * ze3t_n
             ztc_a  = ptr(ji,jj,jk,jn,Kaa) * ze3t_a
             !
+            ze3t_d = ze3t_a - 2. * ze3t_n + ze3t_b
             ztc_d  = ztc_a  - 2. * ztc_n  + ztc_b
             !
-            ze3t_f = 1._wp + r3t_f(ji,jj)*tmask(ji,jj,jk)
+            ze3t_f = ze3t_n + rn_atfp * ze3t_d
             ztc_f  = ztc_n  + rn_atfp * ztc_d
             !
             IF( .NOT. ln_linssh .AND. jk == mikt(ji,jj) ) THEN           ! first level 
+               ze3t_f = ze3t_f - rfact2 * ( emp_b(ji,jj)      - emp(ji,jj)   ) 
                ztc_f  = ztc_f  - rfact1 * ( sbc_trc(ji,jj,jn) - sbc_trc_b(ji,jj,jn) )
             ENDIF
