Index: NEMO/branches/2020/dev_r13333_KERNEL-08_techene_gm_HPG_SPG/tests/VORTEX/MY_SRC/usrdef_istate.F90
===================================================================
--- NEMO/branches/2020/dev_r13333_KERNEL-08_techene_gm_HPG_SPG/tests/VORTEX/MY_SRC/usrdef_istate.F90	(revision 13360)
+++ NEMO/branches/2020/dev_r13333_KERNEL-08_techene_gm_HPG_SPG/tests/VORTEX/MY_SRC/usrdef_istate.F90	(revision 14062)
@@ -8,4 +8,5 @@
    !!======================================================================
    !! History :  NEMO ! 2017-11  (J. Chanut) Original code
+   !!                 ! 2020-11  (S. Techene, G. Madec) separate tsuv from ssh
    !!----------------------------------------------------------------------
 
@@ -26,5 +27,6 @@
    PRIVATE
 
-   PUBLIC   usr_def_istate   ! called by istate.F90
+   PUBLIC   usr_def_istate       ! called by istate.F90
+   PUBLIC   usr_def_istate_ssh   ! called by domqco.F90
 
    !! * Substitutions
@@ -37,5 +39,5 @@
 CONTAINS
   
-   SUBROUTINE usr_def_istate( pdept, ptmask, pts, pu, pv, pssh )
+   SUBROUTINE usr_def_istate( pdept, ptmask, pts, pu, pv )
       !!----------------------------------------------------------------------
       !!                   ***  ROUTINE usr_def_istate  ***
@@ -52,5 +54,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, jk  ! dummy loop indices
@@ -67,18 +68,9 @@
       zf0   = 2._wp * omega * SIN( rad * rn_ppgphi0 )
       zumax = 1._wp * SIGN(1._wp, zf0) ! Here Anticyclonic: set zumax=-1 for cyclonic
-      zlambda = SQRT(2._wp)*60.e3      ! Horizontal scale in meters 
+      zlambda = SQRT(2._wp)*60.e3      ! Horizontal scale in meters
       zn2 = 3.e-3**2
       zH = 0.5_wp * 5000._wp
       !
       zP0 = rho0 * zf0 * zumax * zlambda * SQRT(EXP(1._wp)/2._wp)
-      !
-      ! Sea level:
-      za = -zP0 * (1._wp-EXP(-zH)) / (grav*(zH-1._wp + EXP(-zH)))
-      DO_2D( 1, 1, 1, 1 )
-         zx = glamt(ji,jj) * 1.e3
-         zy = gphit(ji,jj) * 1.e3
-         zrho1 = rho0 + za * EXP(-(zx**2+zy**2)/zlambda**2)
-         pssh(ji,jj) = zP0 * EXP(-(zx**2+zy**2)/zlambda**2)/(zrho1*grav) * ptmask(ji,jj,1)
-      END_2D
       !
       ! temperature:         
@@ -134,4 +126,46 @@
    END SUBROUTINE usr_def_istate
 
+
+   SUBROUTINE usr_def_istate_ssh( ptmask, pssh )
+      !!----------------------------------------------------------------------
+      !!                   ***  ROUTINE usr_def_istate  ***
+      !! 
+      !! ** Purpose :   Initialization of ssh
+      !!                Here VORTEX configuration 
+      !!
+      !! ** Method  :   Set ssh according to a gaussian anomaly of pressure and associated
+      !!                geostrophic velocities
+      !!----------------------------------------------------------------------
+      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   [m]
+      !
+      INTEGER  :: ji, jj ! dummy loop indices
+      REAL(wp) :: zx, zy, zP0, zumax, zlambda, zf0, zH, zrho1, za
+      !!----------------------------------------------------------------------
+      !
+      IF(lwp) WRITE(numout,*)
+      IF(lwp) WRITE(numout,*) 'usr_def_istate_ssh : VORTEX configuration, analytical definition of initial state'
+      IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~~~   '
+      !
+      !
+      !
+      zf0   = 2._wp * omega * SIN( rad * rn_ppgphi0 )
+      zumax = 1._wp * SIGN(1._wp, zf0) ! Here Anticyclonic: set zumax=-1 for cyclonic
+      zlambda = SQRT(2._wp)*60.e3      ! Horizontal scale in meters 
+      zH = 0.5_wp * 5000._wp
+      !
+      zP0 = rho0 * zf0 * zumax * zlambda * SQRT(EXP(1._wp)/2._wp)
+      !
+      ! Sea level:
+      za = -zP0 * (1._wp-EXP(-zH)) / (grav*(zH-1._wp + EXP(-zH)))
+      DO_2D( 1, 1, 1, 1 )
+         zx = glamt(ji,jj) * 1.e3
+         zy = gphit(ji,jj) * 1.e3
+         zrho1 = rho0 + za * EXP(-(zx**2+zy**2)/zlambda**2)
+         pssh(ji,jj) = zP0 * EXP(-(zx**2+zy**2)/zlambda**2)/(zrho1*grav) * ptmask(ji,jj,1)
+      END_2D
+      
+   END SUBROUTINE usr_def_istate_ssh
+
    !!======================================================================
 END MODULE usrdef_istate
