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 branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/DYN – NEMO

source: branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/DYN/dynspg_exp.F90 @ 6004

Last change on this file since 6004 was 6004, checked in by gm, 8 years ago

#1613: vvl by default, step III: Merge with the trunk (free surface simplification) (see wiki)

  • Property svn:keywords set to Id
File size: 4.5 KB
RevLine 
[358]1MODULE dynspg_exp
2   !!======================================================================
3   !!                   ***  MODULE  dynspg_exp  ***
[6004]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   !!----------------------------------------------------------------------
[6004]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
[3294]25   USE timing          ! Timing
[358]26
27   IMPLICIT NONE
28   PRIVATE
29
[6004]30   PUBLIC   dyn_spg_exp   ! routine called by dynspg.F90
[358]31
32   !! * Substitutions
33#  include "vectopt_loop_substitute.h90"
34   !!----------------------------------------------------------------------
[2528]35   !! NEMO/OPA 3.3 , NEMO Consortium (2010)
[888]36   !! $Id$
[2715]37   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
[358]38   !!----------------------------------------------------------------------
39CONTAINS
40
41   SUBROUTINE dyn_spg_exp( kt )
42      !!----------------------------------------------------------------------
43      !!                  ***  routine dyn_spg_exp  ***
44      !!
45      !! ** Purpose :   Compute the now trend due to the surface pressure
[1505]46      !!              gradient in case of explicit free surface formulation and
47      !!              add it to the general trend of momentum equation.
[358]48      !!
[1505]49      !! ** Method  :   Explicit free surface formulation. Add to the general
50      !!              momentum trend the surface pressure gradient :
51      !!                      (ua,va) = (ua,va) + (spgu,spgv)
52      !!              where spgu = -1/rau0 d/dx(ps) = -g/e1u di( sshn )
53      !!                    spgv = -1/rau0 d/dy(ps) = -g/e2v dj( sshn )
[358]54      !!
[1505]55      !! ** Action :   (ua,va)   trend of horizontal velocity increased by
56      !!                         the surf. pressure gradient trend
[358]57      !!---------------------------------------------------------------------
[2715]58      INTEGER, INTENT(in)  ::   kt   ! ocean time-step index
[1438]59      !!
[2715]60      INTEGER ::   ji, jj, jk   ! dummy loop indices
[358]61      !!----------------------------------------------------------------------
[3294]62      !
63      IF( nn_timing == 1 )  CALL timing_start('dyn_spg_exp')
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         !
[2715]70         spgu(:,:) = 0._wp   ;   spgv(:,:) = 0._wp
[1505]71         !
[5866]72         IF( .NOT.ln_linssh .AND. lwp ) WRITE(numout,*) '      non linear free surface: spg is included in dynhpg'
[358]73      ENDIF
74
[5866]75      IF( ln_linssh ) THEN          !* linear free surface : add the surface pressure gradient trend
[1505]76         !
77         DO jj = 2, jpjm1                    ! now surface pressure gradient
[358]78            DO ji = fs_2, fs_jpim1   ! vector opt.
[5845]79               spgu(ji,jj) = - grav * ( sshn(ji+1,jj) - sshn(ji,jj) ) * r1_e1u(ji,jj)
80               spgv(ji,jj) = - grav * ( sshn(ji,jj+1) - sshn(ji,jj) ) * r1_e2v(ji,jj)
[1505]81            END DO
[4292]82         END DO
83         !
[1505]84         DO jk = 1, jpkm1                    ! Add it to the general trend
85            DO jj = 2, jpjm1
86               DO ji = fs_2, fs_jpim1   ! vector opt.
87                  ua(ji,jj,jk) = ua(ji,jj,jk) + spgu(ji,jj)
88                  va(ji,jj,jk) = va(ji,jj,jk) + spgv(ji,jj)
89               END DO
[358]90            END DO
91         END DO
[1505]92         !
93      ENDIF
94      !
[3294]95      IF( nn_timing == 1 )  CALL timing_stop('dyn_spg_exp')
96      !
[358]97   END SUBROUTINE dyn_spg_exp
98
99   !!======================================================================
100END MODULE dynspg_exp
Note: See TracBrowser for help on using the repository browser.