Index: NEMO/branches/2020/dev_r13723_KERNEL-01_Amy_Mike_newHPGschemes/tests/WAD/EXPREF/namelist_cfg
===================================================================
--- NEMO/branches/2020/dev_r13723_KERNEL-01_Amy_Mike_newHPGschemes/tests/WAD/EXPREF/namelist_cfg	(revision 13724)
+++ NEMO/branches/2020/dev_r13723_KERNEL-01_Amy_Mike_newHPGschemes/tests/WAD/EXPREF/namelist_cfg	(revision 14058)
@@ -330,5 +330,4 @@
    ln_dynvor_mix = .false. !  mixed scheme
    ln_dynvor_een = .true.  !  energy & enstrophy scheme
-      nn_een_e3f = 0             !  e3f = masked averaging of e3t divided by 4 (=0) or by the sum of mask (=1)
 /
 !-----------------------------------------------------------------------
Index: NEMO/branches/2020/dev_r13723_KERNEL-01_Amy_Mike_newHPGschemes/tests/WAD/MY_SRC/usrdef_istate.F90
===================================================================
--- NEMO/branches/2020/dev_r13723_KERNEL-01_Amy_Mike_newHPGschemes/tests/WAD/MY_SRC/usrdef_istate.F90	(revision 13724)
+++ NEMO/branches/2020/dev_r13723_KERNEL-01_Amy_Mike_newHPGschemes/tests/WAD/MY_SRC/usrdef_istate.F90	(revision 14058)
@@ -7,5 +7,6 @@
    !! User defined : set the initial state of a user configuration
    !!======================================================================
-   !! History :  4.0 ! 2016-03  (S. Flavoni) Original code
+   !! History :  4.0  ! 2016-03  (S. Flavoni) Original code
+   !!                 ! 2020-11  (S. Techene, G. Madec) separate tsuv from ssh
    !!----------------------------------------------------------------------
 
@@ -24,5 +25,6 @@
    PRIVATE
 
-   PUBLIC   usr_def_istate   ! called in istate.F90
+   PUBLIC   usr_def_istate       ! called in istate.F90
+   PUBLIC   usr_def_istate_ssh   ! called in sshwzv.F90
 
    !! * Substitutions
@@ -34,6 +36,7 @@
    !!----------------------------------------------------------------------
 CONTAINS
-  
-   SUBROUTINE usr_def_istate( pdept, ptmask, pts, pu, pv, pssh )
+
+
+   SUBROUTINE usr_def_istate( pdept, ptmask, pts, pu, pv )
       !!----------------------------------------------------------------------
       !!                   ***  ROUTINE usr_def_istate  ***
@@ -42,5 +45,5 @@
       !!                Here WAD_TEST_CASES configuration 
       !!
-      !! ** Method  : - set temprature field
+q      !! ** Method  : - set temprature field
       !!              - set salinity   field
       !!----------------------------------------------------------------------
@@ -50,5 +53,4 @@
       REAL(wp), DIMENSION(jpi,jpj,jpk)     , INTENT(  out) ::   pu      ! i-component of the velocity  [m/s] 
       REAL(wp), DIMENSION(jpi,jpj,jpk)     , INTENT(  out) ::   pv      ! j-component of the velocity  [m/s] 
-      REAL(wp), DIMENSION(jpi,jpj)         , INTENT(  out) ::   pssh    ! sea-surface height
       INTEGER  ::   ji, jj            ! dummy loop indices
       REAL(wp) ::   zi, zj
@@ -66,6 +68,4 @@
       pu  (:,:,:) = 0._wp        ! ocean at rest
       pv  (:,:,:) = 0._wp
-      pssh(:,:)   = 0._wp
-      !
       !                          ! T & S profiles
       pts(:,:,:,jp_tem) = 10._wp * ptmask(:,:,:)
@@ -83,34 +83,108 @@
          CASE ( 1 )                               ! WAD 1 configuration
             !                                     ! ====================
-            !
             IF(lwp) WRITE(numout,*)
             IF(lwp) WRITE(numout,*) 'usr_def_istate : WAD Closed box with EW linear bottom slope'
             IF(lwp) WRITE(numout,*) '~~~~~~~~~~'
-            !
-            do ji = 1,jpi
-             pssh(ji,:) = ( -5.5_wp + 7.4_wp*glamt(ji,1)/50._wp)*ptmask(ji,:,1)
-            end do
             !                                     ! ====================
          CASE ( 2, 8 )                            ! WAD 2 configuration
             !                                     ! ====================
-            !
             IF(lwp) WRITE(numout,*)
             IF(lwp) WRITE(numout,*) 'usr_def_istate : WAD Parobolic EW channel, mid-range initial ssh slope'
             IF(lwp) WRITE(numout,*) '~~~~~~~~~~'
-            !
-            do ji = 1,jpi
-             pssh(ji,:) = ( -1.5_wp + 5.0_wp*glamt(ji,1)/50._wp)*ptmask(ji,:,1)
-            end do
             !                                     ! ====================
          CASE ( 3 )                               ! WAD 3 configuration
             !                                     ! ====================
-            !
             IF(lwp) WRITE(numout,*)
             IF(lwp) WRITE(numout,*) 'usr_def_istate : WAD Parobolic EW channel, extreme initial ssh slope' 
             IF(lwp) WRITE(numout,*) '~~~~~~~~~~'
-            !
-            do ji = 1,jpi
-             pssh(ji,:) = ( -4.5_wp + 6.8_wp*glamt(ji,1)/50._wp)*ptmask(ji,:,1)
-            end do
+            !                                     ! ====================
+         CASE ( 4 )                               ! WAD 4 configuration
+            !                                     ! ====================
+            IF(lwp) WRITE(numout,*)
+            IF(lwp) WRITE(numout,*) 'usr_def_istate : WAD Parobolic bowl, mid-range initial ssh slope' 
+            IF(lwp) WRITE(numout,*) '~~~~~~~~~~'
+            !                                    ! ===========================
+         CASE ( 5, 7 )                           ! WAD 5 and 7 configurations
+            !                                    ! ===========================
+            IF(lwp) WRITE(numout,*)
+            IF(lwp) WRITE(numout,*) 'usr_def_istate : WAD Double slope with shelf'
+            IF(lwp) WRITE(numout,*) '~~~~~~~~~~'
+            !                                     ! ====================
+         CASE ( 6 )                               ! WAD 6 configuration
+            !                                     ! ====================
+            IF(lwp) WRITE(numout,*)
+            IF(lwp) WRITE(numout,*) 'usr_def_istate : WAD Parobolic EW channel with gaussian ridge' 
+            IF(lwp) WRITE(numout,*) '~~~~~~~~~~'
+            !
+            DO ji = mi0(jpiglo/2), mi0(jpiglo)
+               pts(ji,:,:,jp_sal) = 30._wp
+            END DO
+            !
+            !
+            !                                    ! ===========================
+         CASE DEFAULT                            ! NONE existing configuration
+            !                                    ! ===========================
+            WRITE(ctmp1,*) 'WAD test with a ', nn_cfg,' option is not coded'
+            !
+            CALL ctl_stop( ctmp1 )
+            !
+      END SELECT
+      !
+   END SUBROUTINE usr_def_istate
+
+     
+   SUBROUTINE usr_def_istate_ssh( ptmask, pssh )
+      !!----------------------------------------------------------------------
+      !!                   ***  ROUTINE usr_def_istate_ssh  ***
+      !! 
+      !! ** Purpose :   Initialization of the dynamics and tracers
+      !!                Here WAD_TEST_CASES configuration 
+      !!
+      !! ** Method  : - set ssh
+      !!----------------------------------------------------------------------
+      REAL(wp), DIMENSION(jpi,jpj,jpk)     , INTENT(in   ) ::   ptmask  ! t-point ocean mask             [m]
+      REAL(wp), DIMENSION(jpi,jpj)         , INTENT(  out) ::   pssh    ! sea-surface height
+      INTEGER  ::   ji, jj            ! dummy loop indices
+      REAL(wp) ::   zi, zj
+      !
+      INTEGER  ::   jk     ! dummy loop indices
+      REAL(wp) ::   zdam   ! location of dam [Km]
+      !!----------------------------------------------------------------------
+      !
+      !
+      SELECT CASE ( nn_cfg ) 
+         !                                        ! ====================
+         CASE ( 1 )                               ! WAD 1 configuration
+            !                                     ! ====================
+            !
+            IF(lwp) WRITE(numout,*)
+            IF(lwp) WRITE(numout,*) 'usr_def_istate : WAD Closed box with EW linear bottom slope'
+            IF(lwp) WRITE(numout,*) '~~~~~~~~~~'
+            !
+            DO ji = 1,jpi
+               pssh(ji,:) = ( -5.5_wp + 7.4_wp*glamt(ji,1)/50._wp)*ptmask(ji,:,1)
+            END DO
+            !                                     ! ====================
+         CASE ( 2, 8 )                            ! WAD 2 configuration
+            !                                     ! ====================
+            !
+            IF(lwp) WRITE(numout,*)
+            IF(lwp) WRITE(numout,*) 'usr_def_istate : WAD Parobolic EW channel, mid-range initial ssh slope'
+            IF(lwp) WRITE(numout,*) '~~~~~~~~~~'
+            !
+            DO ji = 1,jpi
+               pssh(ji,:) = ( -1.5_wp + 5.0_wp*glamt(ji,1)/50._wp)*ptmask(ji,:,1)
+            END DO
+            !                                     ! ====================
+         CASE ( 3 )                               ! WAD 3 configuration
+            !                                     ! ====================
+            !
+            IF(lwp) WRITE(numout,*)
+            IF(lwp) WRITE(numout,*) 'usr_def_istate : WAD Parobolic EW channel, extreme initial ssh slope' 
+            IF(lwp) WRITE(numout,*) '~~~~~~~~~~'
+            !
+            DO ji = 1,jpi
+               pssh(ji,:) = ( -4.5_wp + 6.8_wp*glamt(ji,1)/50._wp)*ptmask(ji,:,1)
+            END DO
 
             !
@@ -140,7 +214,7 @@
             IF(lwp) WRITE(numout,*) '~~~~~~~~~~'
             !
-            do ji = 1,jpi
-             pssh(ji,:) = ( -2.5_wp + 5.5_wp*glamt(ji,1)/50._wp)*ptmask(ji,:,1)
-            end do
+            DO ji = 1,jpi
+               pssh(ji,:) = ( -2.5_wp + 5.5_wp*glamt(ji,1)/50._wp)*ptmask(ji,:,1)
+            END DO
 
             !
@@ -153,12 +227,11 @@
             IF(lwp) WRITE(numout,*) '~~~~~~~~~~'
             !
-            do ji = 1,jpi
-             pssh(ji,:) = ( -2.5_wp + 5.5_wp*(50._wp-glamt(ji,1))/50._wp)*ptmask(ji,:,1)
-            end do
-            !
-            do ji = mi0(jpiglo/2), mi0(jpiglo)
-             pts(ji,:,:,jp_sal) = 30._wp
-             pssh(ji,:) = -0.1*ptmask(ji,:,1)
-            end do
+            DO ji = 1,jpi
+               pssh(ji,:) = ( -2.5_wp + 5.5_wp*(50._wp-glamt(ji,1))/50._wp)*ptmask(ji,:,1)
+            END DO
+            !
+            DO ji = mi0(jpiglo/2), mi0(jpiglo)
+               pssh(ji,:) = -0.1*ptmask(ji,:,1)
+            END DO
             !
             !
@@ -182,5 +255,5 @@
       END_2D
       !
-   END SUBROUTINE usr_def_istate
+   END SUBROUTINE usr_def_istate_ssh
 
    !!======================================================================
