New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
dynspg_exp.F90 in NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DYN – NEMO

source: NEMO/branches/UKMO/NEMO_4.0_mirror_text_diagnostics/src/OCE/DYN/dynspg_exp.F90 @ 10986

Last change on this file since 10986 was 10986, checked in by andmirek, 5 years ago

GMED 462 add flush

File size: 4.4 KB
Line 
1MODULE dynspg_exp
2   !!======================================================================
3   !!                   ***  MODULE  dynspg_exp  ***
4   !! Ocean dynamics:  surface pressure gradient trend, explicit scheme
5   !!======================================================================
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
8   !!----------------------------------------------------------------------
9
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
17   USE sbc_oce         ! surface boundary condition: ocean
18   USE phycst          ! physical constants
19   !
20   USE in_out_manager  ! I/O manager
21   USE lib_mpp         ! distributed memory computing library
22   USE lbclnk          ! ocean lateral boundary conditions (or mpp link)
23   USE prtctl          ! Print control
24   USE iom             ! I/O library
25
26   IMPLICIT NONE
27   PRIVATE
28
29   PUBLIC   dyn_spg_exp   ! called in dynspg.F90
30
31   !! * Substitutions
32#  include "vectopt_loop_substitute.h90"
33   !!----------------------------------------------------------------------
34   !! NEMO/OCE 4.0 , NEMO Consortium (2018)
35   !! $Id$
36   !! Software governed by the CeCILL license (see ./LICENSE)
37   !!----------------------------------------------------------------------
38CONTAINS
39
40   SUBROUTINE dyn_spg_exp( kt )
41      !!----------------------------------------------------------------------
42      !!                  ***  routine dyn_spg_exp  ***
43      !!
44      !! ** Purpose :   Compute the now trend due to the surface pressure
45      !!              gradient in case of explicit free surface formulation and
46      !!              add it to the general trend of momentum equation.
47      !!
48      !! ** Method  :   Explicit free surface formulation. Add to the general
49      !!              momentum trend the surface pressure gradient :
50      !!                      (ua,va) = (ua,va) + (spgu,spgv)
51      !!              where spgu = -1/rau0 d/dx(ps) = -g/e1u di( sshn )
52      !!                    spgv = -1/rau0 d/dy(ps) = -g/e2v dj( sshn )
53      !!
54      !! ** Action :   (ua,va)   trend of horizontal velocity increased by
55      !!                         the surf. pressure gradient trend
56      !!---------------------------------------------------------------------
57      INTEGER, INTENT(in)  ::   kt   ! ocean time-step index
58      !!
59      INTEGER ::   ji, jj, jk   ! dummy loop indices
60      !!----------------------------------------------------------------------
61      !
62      IF( kt == nit000 ) THEN
63         IF(lwp) THEN
64            WRITE(numout,*)
65            WRITE(numout,*) 'dyn_spg_exp : surface pressure gradient trend'
66            WRITE(numout,*) '~~~~~~~~~~~   (explicit free surface)'
67            IF(lflush) CALL FLUSH(numout)
68         ENDIF
69         !
70         spgu(:,:) = 0._wp   ;   spgv(:,:) = 0._wp
71         !
72         IF( .NOT.ln_linssh .AND. lwp ) THEN
73            WRITE(numout,*) '      non linear free surface: spg is included in dynhpg'
74            IF(lflush) CALL FLUSH(numout)
75         ENDIF
76      ENDIF
77
78      IF( ln_linssh ) THEN          !* linear free surface : add the surface pressure gradient trend
79         !
80         DO jj = 2, jpjm1                    ! now surface pressure gradient
81            DO ji = fs_2, fs_jpim1   ! vector opt.
82               spgu(ji,jj) = - grav * ( sshn(ji+1,jj) - sshn(ji,jj) ) * r1_e1u(ji,jj)
83               spgv(ji,jj) = - grav * ( sshn(ji,jj+1) - sshn(ji,jj) ) * r1_e2v(ji,jj)
84            END DO
85         END DO
86         !
87         DO jk = 1, jpkm1                    ! Add it to the general trend
88            DO jj = 2, jpjm1
89               DO ji = fs_2, fs_jpim1   ! vector opt.
90                  ua(ji,jj,jk) = ua(ji,jj,jk) + spgu(ji,jj)
91                  va(ji,jj,jk) = va(ji,jj,jk) + spgv(ji,jj)
92               END DO
93            END DO
94         END DO
95         !
96      ENDIF
97      !
98   END SUBROUTINE dyn_spg_exp
99
100   !!======================================================================
101END MODULE dynspg_exp
Note: See TracBrowser for help on using the repository browser.