Index: trunk/NEMO/OFF_SRC/DOM/dom_oce.F90
===================================================================
--- trunk/NEMO/OFF_SRC/DOM/dom_oce.F90	(revision 496)
+++ trunk/NEMO/OFF_SRC/DOM/dom_oce.F90	(revision 497)
@@ -83,57 +83,63 @@
       ff                  !: coriolis factor (2.*omega*sin(yphi) ) (s-1)
 
+
    !!----------------------------------------------------------------------
    !! vertical coordinate and scale factors
    !! --------------------------------------
 
-   REAL(wp), PUBLIC ::   & !!: * namelist namdom *
-      e3zps_min = 5.0,   &  !: miminum thickness for partial steps (meters)
-      e3zps_rat = 0.1       !: minimum thickness ration for partial steps
+   LOGICAL, PUBLIC ::           & !!: namzgr : vertical coordinate
+      ln_zco     =  .TRUE.  ,   &  !: z-coordinate - full step
+      ln_zps     =  .FALSE. ,   &  !: z-coordinate - partial step
+      ln_sco     =  .FALSE.        !: s-coordinate or hybrid z-s coordinate
 
-   !! z-coordinate (default option) (also used in the other cases
-   !! -----------------------------  as reference z-coordinate)
+#if defined key_zco
+   LOGICAL, PUBLIC, PARAMETER ::   lk_zco = .TRUE.    !: z-coordinate flag (1D arrays)
+#else
+   LOGICAL, PUBLIC, PARAMETER ::   lk_zco = .FALSE.   !: z-coordinate flag (3D arrays)
+
+   !! All coordinates
+   !! ---------------
+   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) ::   &  !:
+      gdep3w        ,    &  !: depth of T-points (sum of e3w) (m)
+      gdept , gdepw ,    &  !: analytical depth at T-W  points (m)
+      e3v   , e3f   ,    &  !: analytical vertical scale factors at  V--F
+      e3t   , e3u   ,    &  !:                                       T--U  points (m)
+      e3vw          ,    &  !: analytical vertical scale factors at  VW--
+      e3w   , e3uw          !:                                        W--UW  points (m)
+#endif
+   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   &   !:
+      hur, hvr,          &  !: inverse of u and v-points ocean depth (1/m)
+      hu , hv               !: depth at u- and v-points (meters)
+
+   !! z-coordinate with full steps (also used in the other cases as reference z-coordinate)
+   !! =-----------------====------
    REAL(wp), PUBLIC, DIMENSION(jpk) ::   &  !:
-      gdept, gdepw,    &  !: reference depth of t- and w-points (m)
-      e3t, e3w            !: reference vertical scale factors at T- and W-pts (m)
+      gdept_0, gdepw_0,       &  !: reference depth of t- and w-points (m)
+      e3t_0  , e3w_0             !: reference vertical scale factors at T- and W-pts (m)
 
-#if defined key_partial_steps
-   !! Partial steps ('key_partial_steps')
-   !! -----------------------------------
-   LOGICAL, PUBLIC, PARAMETER ::   lk_zps = .TRUE.   !: partial steps flag
-   LOGICAL, PUBLIC, PARAMETER ::   lk_sco = .FALSE.  !: s-coordinate flag
-   LOGICAL, PUBLIC, PARAMETER ::   lk_zco = .FALSE.  !: z-coordinate flag
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) ::   &  !:
-      gdep3w,                 &  !: ???
-      gdept_ps, gdepw_ps,     &  !: depth of t- and w-points (m)
-      e3t_ps, e3u_ps, e3v_ps, &  !: vertical scale factors at t-, u-, w-,
-      e3w_ps, e3f_ps,         &  !: w- and f- points (m)
-      e3uw_ps, e3vw_ps           !: uw- and vw- points (m)
+   !! z-coordinate with partial steps
+   !! =-----------------=======------
+   REAL(wp), PUBLIC ::      & !!: * namelist namdom *
+      e3zps_min = 5.0_wp,   &  !: miminum thickness for partial steps (meters)
+      e3zps_rat = 0.1_wp       !: minimum thickness ration for partial steps
 
    REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   &  !:
       hdept, hdepw, e3tp, e3wp   !: ???
 
-#elif defined key_s_coord
-   !! s-coordinate ('key_s_coord')
-   !! ----------------------------
-   LOGICAL, PUBLIC, PARAMETER ::   lk_zps = .FALSE.   !: partial steps flag
-   LOGICAL, PUBLIC, PARAMETER ::   lk_sco = .TRUE.    !: s-coordinate flag
-   LOGICAL, PUBLIC, PARAMETER ::   lk_zco = .FALSE.   !: z-coordinate flag
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   &   !:
-      hbatt, hbatu,    &  !: ocean depth at the vertical of  t-, u-, v-
-      hbatv               !: and f-point (m)
-
+   !! s-coordinate and hybrid z-s-coordinate
+   !! =----------------======---------------
    REAL(wp), PUBLIC, DIMENSION(jpk) ::   &   !:
-      gsigt, gsigw ,   &  !: model level depth coefficient at t-, w-levels
-      gsi3w,           &  !: model level depth coefficient at w-level
-                          !  defined as the sum of e3w scale factors
+      gsigt, gsigw ,   &  !: model level depth coefficient at t-, w-levels (analytic)
+      gsi3w        ,   &  !: model level depth coefficient at w-level (sum of gsigw)
       esigt, esigw        !: vertical scale factor coef. at t-, w-levels
 
-#else
-   !! z-coordinate (Default option)
-   !! -----------------------------
-   LOGICAL, PUBLIC, PARAMETER ::   lk_zps = .FALSE.   !: partial steps flag
-   LOGICAL, PUBLIC, PARAMETER ::   lk_sco = .FALSE.   !: s-coordinate flag
-   LOGICAL, PUBLIC, PARAMETER ::   lk_zco = .TRUE.    !: s-coordinate flag
-#endif
+   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   &   !:
+      hbatv , hbatf ,   &  !: ocean depth at the vertical of  V--F
+      hbatt , hbatu ,   &  !:                                 T--U  points (m)
+      scosrf, scobot,   &  !:  ocean surface and bottom topographies (if deviating from coordinate surfaces in HYBRID)
+      hifv  , hiff  ,   &  !: interface depth between stretching    at  V--F
+      hift  , hifu         !: and quasi-uniform spacing                 T--U  points (m)
+
+
    !!----------------------------------------------------------------------
    !! masks, bathymetry
@@ -180,4 +186,12 @@
       !                        ! parameterize exchanges through straits
 
+#if defined key_off_degrad
+   !! ------------------------------------------------
+   !! Degradation method
+   !! --------------------------------------------------
+   REAL(wp), PUBLIC, DIMENSION (jpi,jpj,jpk) :: &
+      facvol  !! volume for degraded regions
+#endif
+
    !!----------------------------------------------------------------------
 END MODULE dom_oce
Index: trunk/NEMO/OFF_SRC/DOM/domain.F90
===================================================================
--- trunk/NEMO/OFF_SRC/DOM/domain.F90	(revision 496)
+++ trunk/NEMO/OFF_SRC/DOM/domain.F90	(revision 497)
@@ -29,4 +29,13 @@
    PUBLIC dom_init       ! called by opa.F90
 
+   !! * Module variables
+      REAL(wp) ::          & !!: Namelist nam_zgr_sco
+      sbot_min =  300.  ,  &  !: minimum depth of s-bottom surface (>0) (m)
+      sbot_max = 5250.  ,  &  !: maximum depth of s-bottom surface (= ocean depth) (>0) (m)
+      theta    =    6.0 ,  &  !: surface control parameter (0<=theta<=20)
+      thetb    =    0.75,  &  !: bottom control parameter  (0<=thetb<= 1)
+      r_max    =    0.15      !: maximum cut-off r-value allowed (0<r_max<1)
+
+
    !! * Substitutions
 #  include "domzgr_substitute.h90"
@@ -98,14 +107,18 @@
       !! * Modules used
       USE ioipsl
-      NAMELIST/namrun/ no    , cexper   , ln_rstart , nrstdt , nit000,          &
+      INTEGER ::   ioptio = 0      ! temporary integer
+
+      NAMELIST/nam_run/ no    , cexper   , ln_rstart , nrstdt , nit000,          &
          &             nitend, ndate0   , nleapy   , ninist , nstock,           &
          &             nprint, nwrite   , nrunoff  , ln_ctl , nictls, nictle,   &
          &             njctls, njctle   , nbench   , isplt  , jsplt
 
-      NAMELIST/namdom/ e3zps_min, e3zps_rat, nmsh  ,   &
+      NAMELIST/nam_zgr/ ln_zco, ln_zps, ln_sco
+
+      NAMELIST/nam_dom/ e3zps_min, e3zps_rat, nmsh  ,   &
          &             nacc  , atfp     , rdt      , rdtmin , rdtmax,   &
          &             rdth 
 
-      NAMELIST/namcla/ n_cla
+      NAMELIST/nam_cla/ n_cla
       !!----------------------------------------------------------------------
 
@@ -118,5 +131,5 @@
       ! Namelist namrun : parameters of the run
       REWIND( numnam )
-      READ  ( numnam, namrun )
+      READ  ( numnam, nam_run )
 
       IF(lwp) THEN
@@ -256,7 +269,38 @@
       ENDIF
 
+      ! Read Namelist nam_zgr : vertical coordinate'
+      ! ---------------------
+      REWIND ( numnam )
+      READ   ( numnam, nam_zgr )
+
+      ! Parameter control and print
+      ! ---------------------------
+      ! Control print
+      IF(lwp) THEN
+         WRITE(numout,*)
+         WRITE(numout,*) 'Namelist namzgr : vertical coordinate'
+         WRITE(numout,*) '~~~~~~~'
+         WRITE(numout,*) '          Namelist nam_zgr : set vertical coordinate'
+         WRITE(numout,*) '             z-coordinate - full steps      ln_zco = ', ln_zco
+         WRITE(numout,*) '             z-coordinate - partial steps   ln_zps = ', ln_zps
+         WRITE(numout,*) '             s- or hybrid z-s-coordinate    ln_sco = ', ln_sco
+      ENDIF
+
+      ! Check Vertical coordinate options
+      ioptio = 0
+      IF( ln_zco ) ioptio = ioptio + 1
+      IF( ln_zps ) ioptio = ioptio + 1
+      IF( ln_sco ) ioptio = ioptio + 1
+      IF ( ioptio /= 1 ) CALL ctl_stop( ' none or several vertical coordinate options used' )
+
+      IF( ln_zco ) THEN
+          IF(lwp) WRITE(numout,*) '          z-coordinate with reduced incore memory requirement'
+          IF( ln_zps .OR. ln_sco ) CALL ctl_stop( ' reduced memory with zps or sco option is impossible' )
+      ENDIF
+
+
       ! Namelist namdom : space/time domain (bathymetry, mesh, timestep)
       REWIND( numnam )
-      READ  ( numnam, namdom )
+      READ  ( numnam, nam_dom )
 
       IF(lwp) THEN
@@ -285,5 +329,5 @@
       ! Namelist cross land advection
       REWIND( numnam )
-      READ  ( numnam, namcla )
+      READ  ( numnam, nam_cla )
       IF(lwp) THEN
          WRITE(numout,*)
Index: trunk/NEMO/OFF_SRC/DOM/domcfg.F90
===================================================================
--- trunk/NEMO/OFF_SRC/DOM/domcfg.F90	(revision 496)
+++ trunk/NEMO/OFF_SRC/DOM/domcfg.F90	(revision 497)
@@ -14,4 +14,5 @@
    USE lib_mpp         ! distributed memory computing library
 
+
    IMPLICIT NONE
    PRIVATE
@@ -20,7 +21,7 @@
    PUBLIC dom_cfg        ! called by opa.F90
    !!----------------------------------------------------------------------
-   !!   OPA 9.0 , LOCEAN-IPSL  (2005)
-   !!   $Header$
-   !!   This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt
+   !!   OPA 9.0 , LOCEAN-IPSL (2005) 
+   !! $Header$ 
+   !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt 
    !!----------------------------------------------------------------------
 
@@ -64,10 +65,5 @@
                                                                   ' north fold with F-point pivot'
       ENDIF
-      IF( jperio <  0 .OR. jperio > 6 ) THEN
-          IF(lwp) WRITE(numout,cform_err)
-          IF(lwp) WRITE(numout,*) 'jperio is out of range'
-          nstop = nstop + 1
-      ENDIF
-
+      IF( jperio <  0 .OR. jperio > 6 ) CALL ctl_stop( 'jperio is out of range' )
 
       ! global domain versus zoom and/or local domain
@@ -144,8 +140,8 @@
          WRITE(numout,25)              (mi1(ji),ji = 1,jpidta)
          WRITE(numout,*)
-         WRITE(numout,*) '          conversion local  ==> data i-index domain'
+         WRITE(numout,*) '          conversion local  ==> data j-index domain'
          WRITE(numout,25)              (mjg(jj),jj = 1,jpj)
          WRITE(numout,*)
-         WRITE(numout,*) '          conversion data  ==> local i-index domain'
+         WRITE(numout,*) '          conversion data  ==> local j-index domain'
          WRITE(numout,*) '             starting index'
          WRITE(numout,25)              (mj0(jj),jj = 1,jpjdta)
@@ -160,9 +156,6 @@
       ! zoom control
       IF( jpiglo + jpizoom - 1  >  jpidta .OR.   &
-          jpjglo + jpjzoom - 1  >  jpjdta      ) THEN
-         IF(lwp)WRITE(numout,cform_err)
-         IF(lwp)WRITE(numout,*)' global or zoom domain exceed the data domain ! '
-         nstop = nstop + 1
-      ENDIF
+          jpjglo + jpjzoom - 1  >  jpjdta      ) &
+          &   CALL ctl_stop( ' global or zoom domain exceed the data domain ! ' )
 
       ! set zoom flag
@@ -184,14 +177,9 @@
          WRITE(numout,*) '             lzoom_n = ', lzoom_n, ' (T = forced closed North boundary)'
       ENDIF
-      IF(  ( lzoom_e .OR. lzoom_w )  .AND.  ( jperio == 1 .OR. jperio == 4 .OR. jperio == 6 )  ) THEN
-         IF(lwp)WRITE(numout,cform_err)
-         IF(lwp)WRITE(numout,*)' Your zoom choice is inconsistent with east-west cyclic boundary condition'
-         nstop = nstop + 1
-      ENDIF
-      IF(  lzoom_n  .AND.  ( 3 <= jperio .AND. jperio <= 6 )  ) THEN
-         IF(lwp)WRITE(numout,cform_err)
-         IF(lwp)WRITE(numout,*)' Your zoom choice is inconsistent with North fold boundary condition'
-         nstop = nstop + 1
-      ENDIF
+      IF(  ( lzoom_e .OR. lzoom_w )  .AND.  ( jperio == 1 .OR. jperio == 4 .OR. jperio == 6 )  )   &
+           &   CALL ctl_stop( ' Your zoom choice is inconsistent with east-west cyclic boundary condition' )
+      IF(  lzoom_n  .AND.  ( 3 <= jperio .AND. jperio <= 6 )  )   &
+           &   CALL ctl_stop( ' Your zoom choice is inconsistent with North fold boundary condition' )
+
 
       ! Pre-defined arctic/antarctic zoom of ORCA configuration flag
Index: trunk/NEMO/OFF_SRC/DOM/domrea_dimg.h90
===================================================================
--- trunk/NEMO/OFF_SRC/DOM/domrea_dimg.h90	(revision 496)
+++ trunk/NEMO/OFF_SRC/DOM/domrea_dimg.h90	(revision 497)
@@ -71,6 +71,6 @@
        irecl8 = jpi*jpj*wp
        ios1 = 0 ; ios2 = 0
-       IF (lk_zps ) ios1= 1 
-       IF (lk_sco ) ios2= 1
+       IF (ln_zps ) ios1= 1 
+       IF (ln_sco ) ios2= 1
    
        SELECT CASE (nmsh )
@@ -262,117 +262,155 @@
           mbathy=zprt*tmask(:,:,1)+1
 
-#if defined key_s_coord
-         !
-         ! hbat
-         irec = irecv(inum4) + (narea - 1 )
-         READ(inum4,REC=irec) hbatt(:,:)
-         irecv(inum4) = irecv(inum4) + jpnij 
-       
-         irec = irecv(inum4) + (narea - 1 )
-         READ(inum4,REC=irec) hbatu(:,:)
-         irecv(inum4) = irecv(inum4) + jpnij 
-
-         irec = irecv(inum4) + (narea - 1 )
-         READ(inum4,REC=irec) hbatv(:,:)
-         irecv(inum4) = irecv(inum4) + jpnij 
-
-         irec = irecv(inum4) + (narea - 1 )
-         READ(inum4,REC=irec) hbatf(:,:)
-         irecv(inum4) = irecv(inum4) + jpnij 
-         !
-         ! gsig and esig ( as vectors of jpk per record )
-         irec =  irecv(inum4) + (narea - 1 )
-         READ(inum4,REC=irec) gsigt(:)
-         irecv(inum4) = irecv(inum4) + jpnij 
-
-         irec =  irecv(inum4) + (narea - 1 )
-         READ(inum4,REC=irec) gsigw(:)
-         irecv(inum4) = irecv(inum4) + jpnij 
-
-         irec =  irecv(inum4) + (narea - 1 )
-         READ(inum4,REC=irec) gsi3w(:)
-         irecv(inum4) = irecv(inum4) + jpnij 
-
-         irec =  irecv(inum4) + (narea - 1 )
-         READ(inum4,REC=irec) esigt(:)
-         irecv(inum4) = irecv(inum4) + jpnij 
-
-         irec =  irecv(inum4) + (narea - 1 )
-         READ(inum4,REC=irec) esigw(:)
-         irecv(inum4) = irecv(inum4) + jpnij 
-
-# elif defined key_partial_steps
-         !
-         ! hdep
-         irec = irecv(inum4) + (narea - 1 )
-         READ(inum4,REC=irec) hdept(:,:)
-         irecv(inum4) = irecv(inum4) + jpnij 
-       
-         irec = irecv(inum4) + (narea - 1 )
-         READ(inum4,REC=irec) hdepw(:,:)
-         irecv(inum4) = irecv(inum4) + jpnij 
-         !
-         ! e3t_ps (3D)
-         DO jk=1,jpk
-             irec=irecv(inum4) + (jk -1 ) + jpk * (narea - 1 )
-             READ(inum4,REC=irec) e3t_ps(:,:,jk)
-         END DO
-         irecv(inum4) = irecv(inum4) + jpk * jpnij 
-
-         ! e3u_ps e3v_ps e3w_ps (3D)
-         DO jk=1,jpk
-             irec=irecv(inum4) + (jk -1 ) + jpk * (narea - 1 )
-             READ(inum4,REC=irec) e3u_ps(:,:,jk)
-         END DO
-         irecv(inum4) = irecv(inum4) + jpk * jpnij 
-         
-         DO jk=1,jpk
-             irec=irecv(inum4) + (jk -1 ) + jpk * (narea - 1 )
-             READ(inum4,REC=irec) e3v_ps(:,:,jk)
-         END DO
-         irecv(inum4) = irecv(inum4) + jpk * jpnij 
-
-         DO jk=1,jpk
-             irec=irecv(inum4) + (jk -1 ) + jpk * (narea - 1 )
-             READ(inum4,REC=irec) e3w_ps(:,:,jk)
-         END DO
-         irecv(inum4) = irecv(inum4) + jpk * jpnij 
-         ! 
-         ! 
-         ! gdep
-         irec =  irecv(inum4) + (narea - 1 )
-         READ(inum4,REC=irec) gdept(:)
-         irecv(inum4) = irecv(inum4) + jpnij 
-
-         irec =  irecv(inum4) + (narea - 1 )
-         READ(inum4,REC=irec) gdepw(:)
-         irecv(inum4) = irecv(inum4) + jpnij 
-         !
-         ! e3
-         irec =  irecv(inum4) + (narea - 1 )
-         READ(inum4,REC=irec) e3t(:)
-         irecv(inum4) = irecv(inum4) + jpnij 
-
-         irec =  irecv(inum4) + (narea - 1 )
-         READ(inum4,REC=irec) e3w(:)
+#if ! defined key_zco
+          IF( ln_sco ) THEN                                         ! s-coordinate
+             !
+             ! hbat
+             irec = irecv(inum4) + (narea - 1 )
+             READ(inum4,REC=irec) hbatt(:,:)
+             irecv(inum4) = irecv(inum4) + jpnij 
+             
+             irec = irecv(inum4) + (narea - 1 )
+             READ(inum4,REC=irec) hbatu(:,:)
+             irecv(inum4) = irecv(inum4) + jpnij 
+             
+             irec = irecv(inum4) + (narea - 1 )
+             READ(inum4,REC=irec) hbatv(:,:)
+             irecv(inum4) = irecv(inum4) + jpnij 
+             
+             irec = irecv(inum4) + (narea - 1 )
+             READ(inum4,REC=irec) hbatf(:,:)
+             irecv(inum4) = irecv(inum4) + jpnij 
+             !
+             ! gsig and esig ( as vectors of jpk per record )
+             irec =  irecv(inum4) + (narea - 1 )
+             READ(inum4,REC=irec) gsigt(:)
+             irecv(inum4) = irecv(inum4) + jpnij 
+             
+             irec =  irecv(inum4) + (narea - 1 )
+             READ(inum4,REC=irec) gsigw(:)
+             irecv(inum4) = irecv(inum4) + jpnij 
+             
+             irec =  irecv(inum4) + (narea - 1 )
+             READ(inum4,REC=irec) gsi3w(:)
+             irecv(inum4) = irecv(inum4) + jpnij 
+             
+             irec =  irecv(inum4) + (narea - 1 )
+             READ(inum4,REC=irec) esigt(:)
+             irecv(inum4) = irecv(inum4) + jpnij 
+             
+             irec =  irecv(inum4) + (narea - 1 )
+             READ(inum4,REC=irec) esigw(:)
+             irecv(inum4) = irecv(inum4) + jpnij 
+
+             ! e3 (3D)
+             DO jk=1,jpk
+                irec =  irecv(inum4) + (jk -1 ) + jpk * (narea - 1 )
+                READ(inum4,REC=irec) e3t(:,:,jk)
+             ENDIF
+             irecv(inum4) = irecv(inum4) + jpk * jpnij 
+             
+             DO jk=1,jpk
+                irec =  irecv(inum4) + (jk -1 ) + jpk * (narea - 1 )
+                READ(inum4,REC=irec) e3u(:,:,jk)
+             ENDIF
+             irecv(inum4) = irecv(inum4) + jpk * jpnij 
+             
+             DO jk=1,jpk
+                irec =  irecv(inum4) + (jk -1 ) + jpk * (narea - 1 )
+                READ(inum4,REC=irec) e3v(:,:,jk)
+             ENDIF
+             irecv(inum4) = irecv(inum4) + jpk * jpnij 
+             
+             DO jk=1,jpk
+                irec =  irecv(inum4) + (jk -1 ) + jpk * (narea - 1 )
+                READ(inum4,REC=irec) e3w(:,:,jk)
+             ENDIF
+             irecv(inum4) = irecv(inum4) + jpk * jpnij 
+
+             ! gdep
+             irec =  irecv(inum4) + (narea - 1 )
+             READ(inum4,REC=irec) gdept_0(:)
+             irecv(inum4) = irecv(inum4) + jpnij 
+             
+             irec =  irecv(inum4) + (narea - 1 )
+             READ(inum4,REC=irec) gdepw_0(:)
+             irecv(inum4) = irecv(inum4) + jpnij 
+             !
+          ENDIF
+             
+          IF( ln_zps ) THEN
+             !
+             ! hdep
+             irec = irecv(inum4) + (narea - 1 )
+             READ(inum4,REC=irec) hdept(:,:)
+             irecv(inum4) = irecv(inum4) + jpnij 
+             
+             irec = irecv(inum4) + (narea - 1 )
+             READ(inum4,REC=irec) hdepw(:,:)
+             irecv(inum4) = irecv(inum4) + jpnij 
+             !
+             ! e3t_ps (3D)
+             DO jk=1,jpk
+                irec=irecv(inum4) + (jk -1 ) + jpk * (narea - 1 )
+                READ(inum4,REC=irec) e3t(:,:,jk)
+             END DO
+             irecv(inum4) = irecv(inum4) + jpk * jpnij 
+             
+             ! e3u_ps e3v_ps e3w_ps (3D)
+             DO jk=1,jpk
+                irec=irecv(inum4) + (jk -1 ) + jpk * (narea - 1 )
+                READ(inum4,REC=irec) e3u(:,:,jk)
+             END DO
+             irecv(inum4) = irecv(inum4) + jpk * jpnij 
+             
+             DO jk=1,jpk
+                irec=irecv(inum4) + (jk -1 ) + jpk * (narea - 1 )
+                READ(inum4,REC=irec) e3v(:,:,jk)
+             END DO
+             irecv(inum4) = irecv(inum4) + jpk * jpnij 
+             
+             DO jk=1,jpk
+                irec=irecv(inum4) + (jk -1 ) + jpk * (narea - 1 )
+                READ(inum4,REC=irec) e3w(:,:,jk)
+             END DO
+             irecv(inum4) = irecv(inum4) + jpk * jpnij 
+             ! 
+             ! 
+             ! gdep
+             irec =  irecv(inum4) + (narea - 1 )
+             READ(inum4,REC=irec) gdept_0(:)
+             irecv(inum4) = irecv(inum4) + jpnij 
+             
+             irec =  irecv(inum4) + (narea - 1 )
+             READ(inum4,REC=irec) gdepw_0(:)
+             irecv(inum4) = irecv(inum4) + jpnij 
+             !
+             ! e3
+             irec =  irecv(inum4) + (narea - 1 )
+             READ(inum4,REC=irec) e3t_0(:)
+             irecv(inum4) = irecv(inum4) + jpnij 
+             
+             irec =  irecv(inum4) + (narea - 1 )
+             READ(inum4,REC=irec) e3w_0(:)
+          ENDIF
 #else
-         !
-         ! gdep
-         irec =  irecv(inum4) + (narea - 1 )
-         READ(inum4,REC=irec) gdept(:)
-         irecv(inum4) = irecv(inum4) + jpnij 
-
-         irec =  irecv(inum4) + (narea - 1 )
-         READ(inum4,REC=irec) gdepw(:)
-         irecv(inum4) = irecv(inum4) + jpnij 
-         !
-         ! e3
-         irec =  irecv(inum4) + (narea - 1 )
-         READ(inum4,REC=irec) e3t(:)
-         irecv(inum4) = irecv(inum4) + jpnij 
-
-         irec =  irecv(inum4) + (narea - 1 )
-         READ(inum4,REC=irec) e3w(:)
-         irecv(inum4) = irecv(inum4) + jpnij 
+          !
+          ! gdep
+          irec =  irecv(inum4) + (narea - 1 )
+          READ(inum4,REC=irec) gdept_0(:)
+          irecv(inum4) = irecv(inum4) + jpnij 
+          
+          irec =  irecv(inum4) + (narea - 1 )
+          READ(inum4,REC=irec) gdepw_0(:)
+          irecv(inum4) = irecv(inum4) + jpnij 
+          !
+          ! e3
+          irec =  irecv(inum4) + (narea - 1 )
+          READ(inum4,REC=irec) e3t_0(:)
+          irecv(inum4) = irecv(inum4) + jpnij 
+          
+          irec =  irecv(inum4) + (narea - 1 )
+          READ(inum4,REC=irec) e3w_0(:)
+          irecv(inum4) = irecv(inum4) + jpnij 
          !
 #endif
Index: trunk/NEMO/OFF_SRC/DOM/domrea_fdir.h90
===================================================================
--- trunk/NEMO/OFF_SRC/DOM/domrea_fdir.h90	(revision 496)
+++ trunk/NEMO/OFF_SRC/DOM/domrea_fdir.h90	(revision 497)
@@ -77,14 +77,16 @@
       ! 4. depth and vertical scale factors
       ! -----------------------------------
-#if defined key_s_coord
-      clfield='HBATT'   ;    READ(inum) clfield, hbatt
-      clfield='HBATU'   ;    READ(inum) clfield, hbatu
-      clfield='HBATV'   ;    READ(inum) clfield, hbatv
-      clfield='HBATF'   ;    READ(inum) clfield, hbatf
-      clfield='GSIGT'   ;    READ(inum) clfield, gsigt
-      clfield='GSIGW'   ;    READ(inum) clfield, gsigw
-      clfield='GSI3W'   ;    READ(inum) clfield, gsi3w
-      clfield='ESIGT'   ;    READ(inum) clfield, esigt
-      clfield='ESIGW'   ;    READ(inum) clfield, esigw
+#if ! defined key_zco
+      IF( ln_sco ) THEN
+         clfield='HBATT'   ;    READ(inum) clfield, hbatt
+         clfield='HBATU'   ;    READ(inum) clfield, hbatu
+         clfield='HBATV'   ;    READ(inum) clfield, hbatv
+         clfield='HBATF'   ;    READ(inum) clfield, hbatf
+         clfield='GSIGT'   ;    READ(inum) clfield, gsigt
+         clfield='GSIGW'   ;    READ(inum) clfield, gsigw
+         clfield='GSI3W'   ;    READ(inum) clfield, gsi3w
+         clfield='ESIGT'   ;    READ(inum) clfield, esigt
+         clfield='ESIGW'   ;    READ(inum) clfield, esigw
+      ENDIF
 #else
       clfield='GDEPT'   ;    READ(inum) clfield, gdept
Index: trunk/NEMO/OFF_SRC/DOM/domstp.F90
===================================================================
--- trunk/NEMO/OFF_SRC/DOM/domstp.F90	(revision 496)
+++ trunk/NEMO/OFF_SRC/DOM/domstp.F90	(revision 497)
@@ -7,4 +7,9 @@
    !!----------------------------------------------------------------------
    !!   dom_stp        : ocean time domain initialization
+   !!----------------------------------------------------------------------
+   !! History :
+   !!        !  90-10  (O. Marti)  Original code
+   !!        !  96-01  (G. Madec)  terrain following coordinates
+   !!   8.5  !  02-08  (G. Madec)  F90: Free form and module
    !!----------------------------------------------------------------------
    !! * Modules used
@@ -22,7 +27,7 @@
 #  include "domzgr_substitute.h90"
    !!----------------------------------------------------------------------
-   !!   OPA 9.0 , LOCEAN-IPSL  (2005)
-   !!   $Header$
-   !!   This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt
+   !!   OPA 9.0 , LOCEAN-IPSL (2005) 
+   !! $Header$ 
+   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
 
@@ -56,11 +61,5 @@
       !! References :
       !!      Bryan, K., 1984, J. Phys. Oceanogr., 14, 666-673.
-      !!
-      !! History :
-      !!        !  90-10  (O. Marti)  Original code
-      !!        !  96-01  (G. Madec)  terrain following coordinates
-      !!   8.5  !  02-08  (G. Madec)  F90: Free form and module
       !!----------------------------------------------------------------------
-      !! * Local declarations
       INTEGER ::   jk              ! dummy loop indice
       !!----------------------------------------------------------------------
@@ -77,5 +76,4 @@
       atfp1 = 1. - 2. * atfp
 
-
       SELECT CASE ( nacc )
 
@@ -90,39 +88,22 @@
             IF(lwp) WRITE(numout,*)'               accelerating the convergence'
             IF(lwp) WRITE(numout,*)'               dynamics time step = ', rdt/3600., ' hours'
-#if defined key_s_coord
-            IF( rdtmin /= rdtmax ) THEN
-               IF(lwp) WRITE(numout,cform_err)
-               IF(lwp) WRITE(numout,*)' depth dependent acceleration of &
-                                      &convergence not implemented in s-coordinates'
-               nstop = nstop + 1
-            ENDIF
-#endif
-#if defined key_partial_steps
-            IF( rdtmin /= rdtmax ) THEN
-               IF(lwp) WRITE(numout,cform_err)
-               IF(lwp) WRITE(numout,*)' depth dependent acceleration of &
-                                      &convergence not implemented for partial steps case'
-               nstop = nstop + 1
-            ENDIF
-#endif
+            IF( ln_sco .AND. rdtmin /= rdtmax )   &
+                 & CALL ctl_stop ( ' depth dependent acceleration of convergence not implemented in s-coordinates' )
             IF(lwp) WRITE(numout,*)'         tracers   time step :  dt (hours)  level'
 
             DO jk = 1, jpk
-               IF( fsdept(1,1,jk) <= rdth ) rdttra(jk) = rdtmin
-               IF( fsdept(1,1,jk) >  rdth ) THEN
+               IF( gdept_0(jk) <= rdth ) rdttra(jk) = rdtmin
+               IF( gdept_0(jk) >  rdth ) THEN
                   rdttra(jk) = rdtmin + ( rdtmax - rdtmin )   &
-                                      * ( EXP( ( fsdept(1,1,jk ) - rdth ) / rdth ) - 1. )   &
-                                      / ( EXP( ( fsdept(1,1,jpk) - rdth ) / rdth ) - 1. )
+                                      * ( EXP( ( gdept_0(jk ) - rdth ) / rdth ) - 1. )   &
+                                      / ( EXP( ( gdept_0(jpk) - rdth ) / rdth ) - 1. )
                ENDIF
-               IF(lwp) WRITE(numout,9200) rdttra(jk)/3600., jk
+               IF(lwp) WRITE(numout,"(36x,f5.2,5x,i3)") rdttra(jk)/3600., jk
             END DO  
- 9200       FORMAT(36x,f5.2,'     ',i3)
 
          CASE DEFAULT              ! E R R O R 
 
-            IF(lwp) WRITE(numout,cform_err)
-            IF(lwp) WRITE(numout,*) ' nacc value e r r o r, nacc= ',nacc
-            IF(lwp) WRITE(numout,*) ' we stop'
-            nstop = nstop + 1
+            WRITE(ctmp1,*) ' nacc value e r r o r, nacc= ',nacc
+            CALL ctl_stop( ctmp1 )
 
       END SELECT
Index: trunk/NEMO/OFF_SRC/DOM/domzgr_substitute.h90
===================================================================
--- trunk/NEMO/OFF_SRC/DOM/domzgr_substitute.h90	(revision 496)
+++ trunk/NEMO/OFF_SRC/DOM/domzgr_substitute.h90	(revision 497)
@@ -5,57 +5,37 @@
    !!      factors depending on the vertical coord. used, using CPP macro.
    !!----------------------------------------------------------------------
-   !!   OPA 9.0 , LOCEAN-IPSL  (2005)
-   !!   $Header$
-   !!   This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt
    !!----------------------------------------------------------------------
-#if defined key_s_coord
-   !! s-coord:  substitution  fsdep.(,,) ==>  hbat.(,) * gsig.()
-   !!                         fse3.(,,)  ==>  hbat.(,) * esig.()
-#   define  fsdept(i,j,k)   hbatt(i,j)*gsigt(k)
-#   define  fsdepu(i,j,k)   hbatu(i,j)*gsigt(k)
-#   define  fsdepv(i,j,k)   hbatv(i,j)*gsigt(k)
-#   define  fsdepf(i,j,k)   hbatf(i,j)*gsigt(k)
-#   define  fsdepw(i,j,k)   hbatt(i,j)*gsigw(k)
-#   define  fsdepuw(i,j,k)  hbatu(i,j)*gsi3w(k)
-#   define  fsdepvw(i,j,k)  hbatv(i,j)*gsi3w(k)
-#   define  fsde3w(i,j,k)   hbatt(i,j)*gsi3w(k)
-#   define  fse3t(i,j,k)    hbatt(i,j)*esigt(k)
-#   define  fse3u(i,j,k)    hbatu(i,j)*esigt(k)
-#   define  fse3v(i,j,k)    hbatv(i,j)*esigt(k)
-#   define  fse3f(i,j,k)    hbatf(i,j)*esigt(k)
-#   define  fse3w(i,j,k)    hbatt(i,j)*esigw(k)
-#   define  fse3uw(i,j,k)   hbatu(i,j)*esigw(k)
-#   define  fse3vw(i,j,k)   hbatv(i,j)*esigw(k)
-#elif defined key_partial_steps
-   !! z-coord:  substitution  fsdep.(,,) ==>  gdep._ps()
-   !!                         fse3.(,,)  ==>  e3._ps()
-#   define  fsdept(i,j,k)   gdept_ps(i,j,k)
-#   define  fsdepw(i,j,k)   gdepw_ps(i,j,k)
-#   define  fsde3w(i,j,k)   gdep3w(i,j,k)
-#   define  fsdepuw(i,j,k)  gdepw(k)
-#   define  fsdepvw(i,j,k)  gdepw(k)
-#   define  fse3t(i,j,k)    e3t_ps(i,j,k)
-#   define  fse3u(i,j,k)    e3u_ps(i,j,k)
-#   define  fse3v(i,j,k)    e3v_ps(i,j,k)
-#   define  fse3f(i,j,k)    e3f_ps(i,j,k)
-#   define  fse3w(i,j,k)    e3w_ps(i,j,k)
-#   define  fse3uw(i,j,k)   e3uw_ps(i,j,k)
-#   define  fse3vw(i,j,k)   e3vw_ps(i,j,k)
+   !!  OPA 9.0 , LOCEAN-IPSL (2005) 
+   !!
+   !! History :
+   !!   9.0  !  05-10  (A. Beckmann, G. Madec) generalisation to all coord.
+   !!----------------------------------------------------------------------
+#if defined key_zco
+#   define  fsdept(i,j,k)  gdept_0(k)
+
+#   define  fsdepw(i,j,k)  gdepw_0(k)
+#   define  fsde3w(i,j,k)  gdepw_0(k)
+
+#   define  fse3t(i,j,k)   e3t_0(k)
+#   define  fse3u(i,j,k)   e3t_0(k)
+#   define  fse3v(i,j,k)   e3t_0(k)
+#   define  fse3f(i,j,k)   e3t_0(k)
+
+#   define  fse3w(i,j,k)   e3w_0(k)
+#   define  fse3uw(i,j,k)  e3w_0(k)
+#   define  fse3vw(i,j,k)  e3w_0(k)
 #else
-   !! z-coord:  substitution  fsdep.(,,) ==>  gdep()
-   !!                         fse3.(,,)  ==>  e3.()
-#   define  fsdept(i,j,k)   gdept(k)
-#   define  fsdepu(i,j,k)   gdept(k)
-#   define  fsdepv(i,j,k)   gdept(k)
-#   define  fsdepf(i,j,k)   gdept(k)
-#   define  fsdepw(i,j,k)   gdepw(k)
-#   define  fsdepuw(i,j,k)  gdepw(k)
-#   define  fsdepvw(i,j,k)  gdepw(k)
-#   define  fse3t(i,j,k)   e3t(k)
-#   define  fse3u(i,j,k)   e3t(k)
-#   define  fse3v(i,j,k)   e3t(k)
-#   define  fse3f(i,j,k)   e3t(k)
-#   define  fse3w(i,j,k)   e3w(k)
-#   define  fse3uw(i,j,k)  e3w(k)
-#   define  fse3vw(i,j,k)  e3w(k)
+#   define  fsdept(i,j,k)  gdept(i,j,k)
+
+#   define  fsdepw(i,j,k)  gdepw(i,j,k)
+#   define  fsde3w(i,j,k)  gdep3w(i,j,k)
+ 
+#   define  fse3t(i,j,k)   e3t(i,j,k)
+#   define  fse3u(i,j,k)   e3u(i,j,k)
+#   define  fse3v(i,j,k)   e3v(i,j,k)
+#   define  fse3f(i,j,k)   e3f(i,j,k)
+
+#   define  fse3w(i,j,k)   e3w(i,j,k)
+#   define  fse3uw(i,j,k)  e3uw(i,j,k)
+#   define  fse3vw(i,j,k)  e3vw(i,j,k)
 #endif
Index: trunk/NEMO/OFF_SRC/LDF/ldfslp.F90
===================================================================
--- trunk/NEMO/OFF_SRC/LDF/ldfslp.F90	(revision 496)
+++ trunk/NEMO/OFF_SRC/LDF/ldfslp.F90	(revision 497)
@@ -20,4 +20,5 @@
    USE lbclnk          ! ocean lateral boundary conditions (or mpp link)
    USE in_out_manager  ! I/O manager
+   USE prtctl          ! Print control
 
    IMPLICIT NONE
@@ -46,7 +47,5 @@
 #  include "vectopt_loop_substitute.h90"
    !!----------------------------------------------------------------------
-   !!   OPA 9.0 , LOCEAN-IPSL  (2005)
-   !!   $Header$
-   !!   This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt
+   !!   OPA 9.0 , LOCEAN-IPSL (2005) 
    !!----------------------------------------------------------------------
 
@@ -69,9 +68,9 @@
       !!      of 10cm/s)
       !!        A horizontal shapiro filter is applied to the slopes
-      !!        'key_s_coord' defined: add to the previously computed slopes
+      !!        ln_sco=T, s-coordinate, add to the previously computed slopes
       !!      the slope of the model level surface.
       !!        macro-tasked on horizontal slab (jk-loop)  (2, jpk-1)
       !!      [slopes already set to zero at level 1, and to zero or the ocean
-      !!      bottom slope ('key_s_coord' defined) at level jpk in inildf]
+      !!      bottom slope (ln_sco=T) at level jpk in inildf]
       !!
       !! ** Action : - uslp, wslpi, and vslp, wslpj, the i- and  j-slopes 
@@ -83,4 +82,5 @@
       !!   8.1  !  99-10  (A. Jouzeau)  NEW profile
       !!   8.5  !  99-10  (G. Madec)  Free form, F90
+      !!   9.0  !  05-10  (A. Beckmann)  correction for s-coordinates
       !!----------------------------------------------------------------------
       !! * Modules used
@@ -97,14 +97,13 @@
       !! * Local declarations
       INTEGER  ::   ji, jj, jk              ! dummy loop indices
-      INTEGER  ::   ii0, ii1, ij0, ij1      ! temporary integer
-#if defined key_partial_steps
-      INTEGER  ::   iku, ikv  ! temporary integers
-#endif
+      INTEGER  ::   ii0, ii1, ij0, ij1,  &  ! temporary integer
+         &          iku, ikv                !    "          "
       REAL(wp) ::   &
-         zeps, zmg, zm05g, zcoef1, zcoef2,   &  ! temporary scalars
-         zau, zbu, zav, zbv,                 &
-         zai, zbi, zaj, zbj,                &
-         zcofu, zcofv, zcofw,                &
-         z1u, z1v, z1wu, z1wv,               &
+         zeps, zmg, zm05g,               &  ! temporary scalars
+         zcoef1, zcoef2, zcoef3,         &  !
+         zau, zbu, zav, zbv,             &
+         zai, zbi, zaj, zbj,             &
+         zcofu, zcofv, zcofw,            &
+         z1u, z1v, z1wu, z1wv,           &
          zalpha
       REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zww
@@ -138,23 +137,22 @@
       END DO
 
-#if defined key_partial_steps
-      ! partial steps correction at the bottom ocean level (zps_hde routine)
-# if defined key_vectopt_loop   &&   ! defined key_autotasking
-      jj = 1
-      DO ji = 1, jpij-jpi   ! vector opt. (forced unrolling)
+      IF( ln_zps ) THEN      ! partial steps correction at the bottom ocean level (zps_hde routine)
+# if defined key_vectopt_loop   &&   ! defined key_mpp_omp
+         jj = 1
+         DO ji = 1, jpij-jpi   ! vector opt. (forced unrolling)
 # else
-      DO jj = 1, jpjm1
-         DO ji = 1, jpim1
-# endif
-            ! last ocean level
-            iku = MIN ( mbathy(ji,jj), mbathy(ji+1,jj) ) - 1
-            ikv = MIN ( mbathy(ji,jj), mbathy(ji,jj+1) ) - 1
-            zgru(ji,jj,iku) = gru(ji,jj) 
-            zgrv(ji,jj,ikv) = grv(ji,jj)               
-# if ! defined key_vectopt_loop   ||   defined key_autotasking
-         END DO
-# endif
-      END DO
-#endif
+         DO jj = 1, jpjm1
+            DO ji = 1, jpim1
+# endif
+               ! last ocean level
+               iku = MIN ( mbathy(ji,jj), mbathy(ji+1,jj) ) - 1
+               ikv = MIN ( mbathy(ji,jj), mbathy(ji,jj+1) ) - 1
+               zgru(ji,jj,iku) = gru(ji,jj) 
+               zgrv(ji,jj,ikv) = grv(ji,jj)               
+# if ! defined key_vectopt_loop   ||   defined key_mpp_omp
+            END DO
+# endif
+         END DO
+      ENDIF
 
       ! Slopes of isopycnal surfaces just below the mixed layer
@@ -203,30 +201,13 @@
                ! uslp and vslp output in zwz and zww, resp.
                zalpha = MAX( omlmask(ji,jj,jk), omlmask(ji+1,jj,jk) )
-#if defined key_s_coord 
                zwz (ji,jj,jk) = ( zau / ( zbu - zeps ) * ( 1. - zalpha)   &
-                  &        + zalpha * uslpml(ji,jj)   &
-                  &        * ( fsdepu(ji,jj,jk) - .5*fse3u(ji,jj,1) )   &
-                  &        / MAX( hmlpt(ji,jj), hmlpt(ji+1,jj), 5. ) )   &
-                  &        * umask(ji,jj,jk)
+                  &           + zalpha * uslpml(ji,jj)                    &
+                  &                    * 0.5 * ( fsdept(ji+1,jj,jk)+fsdept(ji,jj,jk)-fse3u(ji,jj,1) )   &
+                  &                          / MAX( hmlpt(ji,jj), hmlpt(ji+1,jj), 5. ) ) * umask(ji,jj,jk)
                zalpha = MAX( omlmask(ji,jj,jk), omlmask(ji,jj+1,jk) )
                zww (ji,jj,jk) = ( zav / ( zbv - zeps ) * ( 1. - zalpha)   &
-                  &        + zalpha * vslpml(ji,jj)   &
-                  &        * ( fsdepv(ji,jj,jk) - .5*fse3v(ji,jj,1) )   &
-                  &         / MAX( hmlpt(ji,jj), hmlpt(ji,jj+1), 5. ) )   &
-                  &        * vmask(ji,jj,jk)
-#else
-               ! z-coord and partial steps slope computed in the same way
-               zwz (ji,jj,jk) = ( zau / ( zbu - zeps ) * ( 1. - zalpha)    &
-                  &        + zalpha * uslpml(ji,jj)    &
-                  &        * ( fsdept(ji,jj,jk) - .5*fse3u(ji,jj,1))    &
-                  &        / MAX (hmlpt(ji,jj),hmlpt(ji+1,jj),5.) )    &
-                  &        * umask (ji,jj,jk)
-               zalpha = MAX(omlmask(ji,jj,jk),omlmask(ji,jj+1,jk))
-               zww (ji,jj,jk) = ( zav / ( zbv - zeps ) * ( 1. - zalpha)    &
-                  &        + zalpha * vslpml(ji,jj)    &
-                  &        * ( fsdept(ji,jj,jk) - .5*fse3v(ji,jj,1))    &
-                  &        / MAX(hmlpt(ji,jj),hmlpt(ji,jj+1),5.) )    &
-                  &        * vmask (ji,jj,jk)
-#endif
+                  &           + zalpha * vslpml(ji,jj)                    &
+                  &                    * 0.5 * ( fsdept(ji,jj+1,jk)+fsdept(ji,jj,jk)-fse3v(ji,jj,1) )   &
+                  &                          / MAX( hmlpt(ji,jj), hmlpt(ji,jj+1), 5. ) ) * vmask(ji,jj,jk)
             END DO
          END DO
@@ -292,24 +273,4 @@
             END DO
          END DO
-
-
-         IF( lk_sco ) THEN
-            ! Add the slope of level surfaces
-            ! -----------------------------------
-            ! 'key_s_coord' defined but not 'key_traldfiso' the computation is done
-            ! in inildf, ldfslp never called
-            ! 'key_s_coord' and 'key_traldfiso' defined, the slope of level surfaces
-            ! is added to the slope of isopycnal surfaces.
-            ! c a u t i o n : minus sign as fsdep has positive value 
-         
-            DO jj = 2, jpjm1
-               DO ji = fs_2, fs_jpim1   ! vector opt.
-                  uslp(ji,jj,jk) = uslp(ji,jj,jk) - 1. / e1u(ji,jj)   &
-                     &           * ( fsdept(ji+1,jj,jk) - fsdept(ji,jj,jk) )
-                  vslp(ji,jj,jk) = vslp(ji,jj,jk) - 1. / e2v(ji,jj)   &
-                     &           * ( fsdept(ji,jj+1,jk) - fsdept(ji,jj,jk) )
-               END DO
-            END DO
-         ENDIF
 
 
@@ -354,13 +315,10 @@
                zbj = MIN( zwy (ji,jj,jk), -100.*ABS(zaj), -7.e+3/fse3w(ji,jj,jk)*ABS(zaj) )
                ! wslpi and wslpj output in zwz and zww, resp.
-               zalpha = MAX(omlmask(ji,jj,jk),omlmask(ji,jj,jk-1))
-               zwz(ji,jj,jk) = ( zai / ( zbi - zeps) * ( 1. - zalpha )   &
-                  &            + zalpha * wslpiml(ji,jj)   &
-                  &            * fsdepw(ji,jj,jk) / MAX( hmlp(ji,jj),10. ) )   &
-                  &            * tmask (ji,jj,jk)
-               zww(ji,jj,jk) = ( zaj / ( zbj - zeps) * ( 1. - zalpha )   &
-                  &            + zalpha * wslpjml(ji,jj)   &
-                  &            * fsdepw(ji,jj,jk) / MAX( hmlp(ji,jj),10. ) )   &
-                  &            * tmask (ji,jj,jk)
+               zalpha = MAX( omlmask(ji,jj,jk), omlmask(ji,jj,jk-1) )
+               zcoef3 = fsdepw(ji,jj,jk) / MAX( hmlp(ji,jj), 10. )
+               zwz(ji,jj,jk) = (     zai / ( zbi - zeps)  * ( 1. - zalpha )   &
+                  &             + zcoef3 * wslpiml(ji,jj) *        zalpha   ) * tmask (ji,jj,jk)
+               zww(ji,jj,jk) = (     zaj / ( zbj - zeps)  * ( 1. - zalpha )   &
+                  &             + zcoef3 * wslpjml(ji,jj) *        zalpha   ) * tmask (ji,jj,jk)
             END DO
          END DO
@@ -424,22 +382,4 @@
          END DO
          
-         IF( lk_sco ) THEN
-         
-            ! Slope of level surfaces
-            ! -----------------------
-            ! 'key_s_coord' defined but not 'key_traldfiso' the computation is done
-            ! in inildf, ldfslp never called
-            ! 'key_s_coord' and 'key_traldfiso' defined, the slope of level surfaces
-            ! is added to the slope of isopycnal surfaces.
-         
-            DO jj = 2, jpjm1
-               DO ji = fs_2, fs_jpim1   ! vector opt.
-                  wslpi(ji,jj,jk) = wslpi(ji,jj,jk) - 1. / e1t(ji,jj)   &
-                     &                                   * ( fsdepuw(ji+1,jj,jk) - fsdepuw(ji,jj,jk) )
-                  wslpj(ji,jj,jk) = wslpj(ji,jj,jk) - 1. / e2t(ji,jj)   &
-                     &                                   * ( fsdepvw(ji,jj+1,jk) - fsdepvw(ji,jj,jk) )
-               END DO
-            END DO
-         ENDIF
          
          ! III. Specific grid points
@@ -474,8 +414,11 @@
       ! III Lateral boundary conditions on all slopes (uslp , vslp, 
       ! -------------------------------                wslpi, wslpj )
-      CALL lbc_lnk( uslp , 'U', -1. )
-      CALL lbc_lnk( vslp , 'V', -1. )
-      CALL lbc_lnk( wslpi, 'W', -1. )
-      CALL lbc_lnk( wslpj, 'W', -1. )
+      CALL lbc_lnk( uslp , 'U', -1. )      ;      CALL lbc_lnk( vslp , 'V', -1. )
+      CALL lbc_lnk( wslpi, 'W', -1. )      ;      CALL lbc_lnk( wslpj, 'W', -1. )
+
+      IF(ln_ctl) THEN
+         CALL prt_ctl(tab3d_1=uslp , clinfo1=' slp  - u : ', tab3d_2=vslp,  clinfo2=' v : ', kdim=jpk)
+         CALL prt_ctl(tab3d_1=wslpi, clinfo1=' slp  - wi: ', tab3d_2=wslpj, clinfo2=' wj: ', kdim=jpk)
+      ENDIF
 
    END SUBROUTINE ldf_slp
@@ -546,5 +489,5 @@
       ! mask for mixed layer
       DO jk = 1, jpk
-# if defined key_vectopt_loop   &&   ! defined key_autotasking
+# if defined key_vectopt_loop   &&   ! defined key_mpp_omp
          jj = 1
          DO ji = 1, jpij   ! vector opt. (forced unrolling)
@@ -560,5 +503,5 @@
                   omlmask(ji,jj,jk) = 0.e0
                ENDIF
-# if ! defined key_vectopt_loop   ||   defined key_autotasking
+# if ! defined key_vectopt_loop   ||   defined key_mpp_omp
             END DO
 # endif
@@ -578,5 +521,5 @@
       zwy(:,jpj) = 0.e0
       zwy(jpi,:) = 0.e0
-# if defined key_vectopt_loop   &&   ! defined key_autotasking
+# if defined key_vectopt_loop   &&   ! defined key_mpp_omp
       jj = 1
       DO ji = 1, jpij-jpi   ! vector opt. (forced unrolling)
@@ -591,5 +534,5 @@
                &             * ( pn2(ji,jj,ik) + pn2(ji,jj,ik+1) )   &
                &             / MAX( tmask(ji,jj,ik) + tmask (ji,jj,ik+1), 1. )
-# if ! defined key_vectopt_loop   ||   defined key_autotasking
+# if ! defined key_vectopt_loop   ||   defined key_mpp_omp
          END DO
 # endif
@@ -599,5 +542,5 @@
 
       ! Slope at u points
-# if defined key_vectopt_loop   &&   ! defined key_autotasking
+# if defined key_vectopt_loop   &&   ! defined key_mpp_omp
       jj = 1
       DO ji = jpi+2, jpij-jpi-1   ! vector opt. (forced unrolling)
@@ -616,5 +559,5 @@
             ! uslpml
             uslpml (ji,jj) = zau / ( zbu - zeps ) * umask (ji,jj,ik)
-# if ! defined key_vectopt_loop   ||   defined key_autotasking
+# if ! defined key_vectopt_loop   ||   defined key_mpp_omp
          END DO
 # endif
@@ -628,5 +571,5 @@
       zwy ( :, jpj) = 0.e0
       zwy ( jpi, :) = 0.e0
-# if defined key_vectopt_loop   &&   ! defined key_autotasking
+# if defined key_vectopt_loop   &&   ! defined key_mpp_omp
       jj = 1
       DO ji = 1, jpij-jpi   ! vector opt. (forced unrolling)
@@ -640,5 +583,5 @@
                &             * ( pn2(ji,jj,ik) + pn2(ji,jj,ik+1) )   &
                &             / MAX( tmask(ji,jj,ik) + tmask (ji,jj,ik+1), 1. )
-# if ! defined key_vectopt_loop   ||   defined key_autotasking
+# if ! defined key_vectopt_loop   ||   defined key_mpp_omp
          END DO
 # endif
@@ -649,5 +592,5 @@
 
       ! Slope at v points
-# if defined key_vectopt_loop   &&   ! defined key_autotasking
+# if defined key_vectopt_loop   &&   ! defined key_mpp_omp
       jj = 1
       DO ji = jpi+2, jpij-jpi-1   ! vector opt. (forced unrolling)
@@ -666,5 +609,5 @@
             ! vslpml
             vslpml (ji,jj) = zav / ( zbv - zeps ) * vmask (ji,jj,ik)
-# if ! defined key_vectopt_loop   ||   defined key_autotasking
+# if ! defined key_vectopt_loop   ||   defined key_mpp_omp
          END DO
 # endif
@@ -680,5 +623,5 @@
       ! Local vertical density gradient evaluated from N^2
       ! zwy = d/dz(prd)= - mk ( prd ) / grav * pn2 -- at w point
-# if defined key_vectopt_loop   &&   ! defined key_autotasking
+# if defined key_vectopt_loop   &&   ! defined key_mpp_omp
       jj = 1
       DO ji = 1, jpij   ! vector opt. (forced unrolling)
@@ -692,5 +635,5 @@
             zwy (ji,jj) = zm05g * pn2 (ji,jj,ik) *     &
                &             ( prd (ji,jj,ik) + prd (ji,jj,ikm1) + 2. )
-# if ! defined key_vectopt_loop   ||   defined key_autotasking
+# if ! defined key_vectopt_loop   ||   defined key_mpp_omp
          END DO
 # endif
@@ -698,5 +641,5 @@
 
       ! Slope at w point
-# if defined key_vectopt_loop   &&   ! defined key_autotasking
+# if defined key_vectopt_loop   &&   ! defined key_mpp_omp
       jj = 1
       DO ji = jpi+2, jpij-jpi-1   ! vector opt. (forced unrolling)
@@ -728,5 +671,5 @@
             wslpiml (ji,jj) = zai / ( zbi - zeps) * tmask (ji,jj,ik)
             wslpjml (ji,jj) = zaj / ( zbj - zeps) * tmask (ji,jj,ik)
-# if ! defined key_vectopt_loop   ||   defined key_autotasking
+# if ! defined key_vectopt_loop   ||   defined key_mpp_omp
          END DO
 # endif
@@ -780,4 +723,7 @@
 
       IF( ln_traldf_hor ) THEN
+         IF(lwp) THEN
+            WRITE(numout,*) '          Horizontal mixing in s-coordinate: slope = slope of s-surfaces'
+         ENDIF
 
          ! geopotential diffusion in s-coordinates on tracers and/or momentum
@@ -790,12 +736,8 @@
             DO jj = 2, jpjm1
                DO ji = fs_2, fs_jpim1   ! vector opt.
-                  uslp (ji,jj,jk) = -1. / e1u(ji,jj) * umask(ji,jj,jk)   &
-                     &                               * ( fsdept(ji+1,jj,jk) - fsdept(ji,jj,jk) )
-                  vslp (ji,jj,jk) = -1. / e2v(ji,jj) * vmask(ji,jj,jk)   &
-                     &                               * ( fsdept(ji,jj+1,jk) - fsdept(ji,jj,jk) )
-                  wslpi(ji,jj,jk) = -1. / e1t(ji,jj) * tmask(ji,jj,jk)   &
-                     &                               * ( fsdepuw(ji+1,jj,jk) - fsdepuw(ji,jj,jk) )
-                  wslpj(ji,jj,jk) = -1. / e2t(ji,jj) * tmask(ji,jj,jk)   &
-                     &                               * ( fsdepvw(ji,jj+1,jk) - fsdepvw(ji,jj,jk) )
+                  uslp (ji,jj,jk) = -1./e1u(ji,jj) * ( fsdept(ji+1,jj,jk) - fsdept(ji ,jj ,jk) ) * umask(ji,jj,jk)
+                  vslp (ji,jj,jk) = -1./e2v(ji,jj) * ( fsdept(ji,jj+1,jk) - fsdept(ji ,jj ,jk) ) * vmask(ji,jj,jk)
+                  wslpi(ji,jj,jk) = -1./e1t(ji,jj) * ( fsdepw(ji+1,jj,jk) - fsdepw(ji-1,jj,jk) ) * tmask(ji,jj,jk) * 0.5
+                  wslpj(ji,jj,jk) = -1./e2t(ji,jj) * ( fsdepw(ji,jj+1,jk) - fsdepw(ji,jj-1,jk) ) * tmask(ji,jj,jk) * 0.5
                END DO
             END DO
@@ -803,8 +745,6 @@
 
          ! Lateral boundary conditions on the slopes
-         CALL lbc_lnk( uslp , 'U', -1. )
-         CALL lbc_lnk( vslp , 'V', -1. )
-         CALL lbc_lnk( wslpi, 'W', -1. )
-         CALL lbc_lnk( wslpj, 'W', -1. )
+         CALL lbc_lnk( uslp , 'U', -1. )      ;      CALL lbc_lnk( vslp , 'V', -1. )
+         CALL lbc_lnk( wslpi, 'W', -1. )      ;      CALL lbc_lnk( wslpj, 'W', -1. )
       ENDIF
 
Index: trunk/NEMO/OFF_SRC/LDF/ldftra_oce.F90
===================================================================
--- trunk/NEMO/OFF_SRC/LDF/ldftra_oce.F90	(revision 496)
+++ trunk/NEMO/OFF_SRC/LDF/ldftra_oce.F90	(revision 497)
@@ -45,5 +45,5 @@
       l_traldf_iso_zps                 !: iso-neutral laplacian (partial steps)
 
-#if defined key_traldf_c3d
+#if defined key_traldf_c3d || defined key_off_degrad
    REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) ::   &  !: ** 3D coefficients **
 #elif defined key_traldf_c2d
@@ -63,5 +63,5 @@
    LOGICAL, PUBLIC, PARAMETER ::   lk_traldf_eiv   = .TRUE.   !: eddy induced velocity flag
       
-# if defined key_traldf_c3d
+# if defined key_traldf_c3d || defined key_off_degrad
    REAL(wp), PUBLIC, DIMENSION(jpi,jpj,jpk) ::   &  !: ** 3D coefficients **
 # elif defined key_traldf_c2d
