source: NEMO/branches/2020/dev_r13333_KERNEL-08_techene_gm_HPG_SPG/src/OCE/DYN/dynspg_exp.F90 @ 13362

Last change on this file since 13362 was 13362, checked in by techene, 3 months ago

horizontal surface pressure gradient is now added systematically (linear and non-linear case) to rhs when explicit time scheme, it is not removed in the non linear case when time splitting

  • Property svn:keywords set to Id
File size: 4.2 KB
RevLine 
[358]1MODULE dynspg_exp
2   !!======================================================================
3   !!                   ***  MODULE  dynspg_exp  ***
[6140]4   !! Ocean dynamics:  surface pressure gradient trend, explicit scheme
[358]5   !!======================================================================
[1505]6   !! History :  2.0  !  2005-11  (V. Garnier, G. Madec, L. Bessieres) Original code
7   !!            3.2  !  2009-06  (G. Madec, M. Leclair, R. Benshila) introduce sshwzv module
[1438]8   !!----------------------------------------------------------------------
[6140]9
[358]10   !!----------------------------------------------------------------------
11   !!   dyn_spg_exp  : update the momentum trend with the surface
12   !!                      pressure gradient in the free surface constant 
13   !!                      volume case with vector optimization
14   !!----------------------------------------------------------------------
15   USE oce             ! ocean dynamics and tracers
16   USE dom_oce         ! ocean space and time domain
[888]17   USE sbc_oce         ! surface boundary condition: ocean
[719]18   USE phycst          ! physical constants
[4990]19   !
[888]20   USE in_out_manager  ! I/O manager
[358]21   USE lib_mpp         ! distributed memory computing library
22   USE lbclnk          ! ocean lateral boundary conditions (or mpp link)
23   USE prtctl          ! Print control
[575]24   USE iom             ! I/O library
[358]25
26   IMPLICIT NONE
27   PRIVATE
28
[9124]29   PUBLIC   dyn_spg_exp   ! called in dynspg.F90
[358]30
31   !! * Substitutions
[12377]32#  include "do_loop_substitute.h90"
[358]33   !!----------------------------------------------------------------------
[9598]34   !! NEMO/OCE 4.0 , NEMO Consortium (2018)
[888]35   !! $Id$
[10068]36   !! Software governed by the CeCILL license (see ./LICENSE)
[358]37   !!----------------------------------------------------------------------
38CONTAINS
39
[12377]40   SUBROUTINE dyn_spg_exp( kt, Kmm, puu, pvv, Krhs )
[358]41      !!----------------------------------------------------------------------
42      !!                  ***  routine dyn_spg_exp  ***
43      !!
44      !! ** Purpose :   Compute the now trend due to the surface pressure
[1505]45      !!              gradient in case of explicit free surface formulation and
46      !!              add it to the general trend of momentum equation.
[358]47      !!
[1505]48      !! ** Method  :   Explicit free surface formulation. Add to the general
49      !!              momentum trend the surface pressure gradient :
[12377]50      !!                      (uu(rhs),vv(rhs)) = (uu(rhs),vv(rhs)) + (spgu,spgv)
[12489]51      !!              where spgu = -1/rho0 d/dx(ps) = -g/e1u di( ssh(now) )
52      !!                    spgv = -1/rho0 d/dy(ps) = -g/e2v dj( ssh(now) )
[358]53      !!
[12377]54      !! ** Action :   (puu(:,:,:,Krhs),pvv(:,:,:,Krhs))   trend of horizontal velocity increased by
[1505]55      !!                         the surf. pressure gradient trend
[358]56      !!---------------------------------------------------------------------
[12377]57      INTEGER                             , INTENT( in )  ::  kt        ! ocean time-step index
58      INTEGER                             , INTENT( in )  ::  Kmm, Krhs ! ocean time level indices
59      REAL(wp), DIMENSION(jpi,jpj,jpk,jpt), INTENT(inout) ::  puu, pvv  ! ocean velocities and RHS of momentum equation
[1438]60      !!
[2715]61      INTEGER ::   ji, jj, jk   ! dummy loop indices
[13362]62      REAL(wp), DIMENSION(jpi,jpj) ::   zpgu, zpgv   ! 2D workspace
[358]63      !!----------------------------------------------------------------------
[3294]64      !
[358]65      IF( kt == nit000 ) THEN
66         IF(lwp) WRITE(numout,*)
67         IF(lwp) WRITE(numout,*) 'dyn_spg_exp : surface pressure gradient trend'
68         IF(lwp) WRITE(numout,*) '~~~~~~~~~~~   (explicit free surface)'
[1505]69         !
[13362]70         zpgu(:,:) = 0._wp   ;   zpgv(:,:) = 0._wp
[1505]71         !
[6140]72         IF( .NOT.ln_linssh .AND. lwp ) WRITE(numout,*) '      non linear free surface: spg is included in dynhpg'
[358]73      ENDIF
[1505]74      !
[13362]75      DO_2D( 0, 0, 0, 0 )
76         zpgu(ji,jj) = - grav * ( ssh(ji+1,jj,Kmm) - ssh(ji,jj,Kmm) ) * r1_e1u(ji,jj)
77         zpgv(ji,jj) = - grav * ( ssh(ji,jj+1,Kmm) - ssh(ji,jj,Kmm) ) * r1_e2v(ji,jj)
78      END_2D
79      !
80      DO_3D( 0, 0, 0, 0, 1, jpkm1 )
81         puu(ji,jj,jk,Krhs) = puu(ji,jj,jk,Krhs) + zpgu(ji,jj)
82         pvv(ji,jj,jk,Krhs) = pvv(ji,jj,jk,Krhs) + zpgv(ji,jj)
83      END_3D
84      !
[358]85   END SUBROUTINE dyn_spg_exp
86
87   !!======================================================================
88END MODULE dynspg_exp
Note: See TracBrowser for help on using the repository browser.