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/UKMO/r5936_CO6_CO5_shelfdiagnostic/NEMOGCM/NEMO/OPA_SRC/DYN – NEMO

source: branches/UKMO/r5936_CO6_CO5_shelfdiagnostic/NEMOGCM/NEMO/OPA_SRC/DYN/dynspg_exp.F90 @ 7113

Last change on this file since 7113 was 7113, checked in by jcastill, 8 years ago

Remove again the svn keywords, as it did not work before

File size: 4.6 KB
RevLine 
[358]1MODULE dynspg_exp
2   !!======================================================================
3   !!                   ***  MODULE  dynspg_exp  ***
4   !! Ocean dynamics:  surface pressure gradient trend
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   !!----------------------------------------------------------------------
[358]9   !!----------------------------------------------------------------------
[5930]10   !!                     explicit free surface
[358]11   !!----------------------------------------------------------------------
12   !!   dyn_spg_exp  : update the momentum trend with the surface
13   !!                      pressure gradient in the free surface constant 
14   !!                      volume case with vector optimization
15   !!----------------------------------------------------------------------
16   USE oce             ! ocean dynamics and tracers
17   USE dom_oce         ! ocean space and time domain
[888]18   USE sbc_oce         ! surface boundary condition: ocean
[719]19   USE phycst          ! physical constants
[4990]20   !
[888]21   USE in_out_manager  ! I/O manager
[358]22   USE lib_mpp         ! distributed memory computing library
23   USE lbclnk          ! ocean lateral boundary conditions (or mpp link)
24   USE prtctl          ! Print control
[575]25   USE iom             ! I/O library
[3294]26   USE timing          ! Timing
[358]27
[3294]28
[358]29   IMPLICIT NONE
30   PRIVATE
31
[5930]32   PUBLIC   dyn_spg_exp   ! routine called by dyn_spg
[358]33
34   !! * Substitutions
35#  include "domzgr_substitute.h90"
36#  include "vectopt_loop_substitute.h90"
37   !!----------------------------------------------------------------------
[2528]38   !! NEMO/OPA 3.3 , NEMO Consortium (2010)
[888]39   !! $Id$
[2715]40   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
[358]41   !!----------------------------------------------------------------------
42CONTAINS
43
44   SUBROUTINE dyn_spg_exp( kt )
45      !!----------------------------------------------------------------------
46      !!                  ***  routine dyn_spg_exp  ***
47      !!
48      !! ** Purpose :   Compute the now trend due to the surface pressure
[1505]49      !!              gradient in case of explicit free surface formulation and
50      !!              add it to the general trend of momentum equation.
[358]51      !!
[1505]52      !! ** Method  :   Explicit free surface formulation. Add to the general
53      !!              momentum trend the surface pressure gradient :
54      !!                      (ua,va) = (ua,va) + (spgu,spgv)
55      !!              where spgu = -1/rau0 d/dx(ps) = -g/e1u di( sshn )
56      !!                    spgv = -1/rau0 d/dy(ps) = -g/e2v dj( sshn )
[358]57      !!
[1505]58      !! ** Action :   (ua,va)   trend of horizontal velocity increased by
59      !!                         the surf. pressure gradient trend
[358]60      !!---------------------------------------------------------------------
[2715]61      INTEGER, INTENT(in)  ::   kt   ! ocean time-step index
[1438]62      !!
[2715]63      INTEGER ::   ji, jj, jk   ! dummy loop indices
[358]64      !!----------------------------------------------------------------------
[3294]65      !
66      IF( nn_timing == 1 )  CALL timing_start('dyn_spg_exp')
67      !
[358]68      IF( kt == nit000 ) THEN
69         IF(lwp) WRITE(numout,*)
70         IF(lwp) WRITE(numout,*) 'dyn_spg_exp : surface pressure gradient trend'
71         IF(lwp) WRITE(numout,*) '~~~~~~~~~~~   (explicit free surface)'
[1505]72         !
[2715]73         spgu(:,:) = 0._wp   ;   spgv(:,:) = 0._wp
[1505]74         !
75         IF( lk_vvl .AND. lwp ) WRITE(numout,*) '              lk_vvl=T : spg is included in dynhpg'
[358]76      ENDIF
77
[1505]78      IF( .NOT. lk_vvl ) THEN          !* fixed volume : add the surface pressure gradient trend
79         !
80         DO jj = 2, jpjm1                    ! now surface pressure gradient
[358]81            DO ji = fs_2, fs_jpim1   ! vector opt.
[1505]82               spgu(ji,jj) = - grav * ( sshn(ji+1,jj) - sshn(ji,jj) ) / e1u(ji,jj)
83               spgv(ji,jj) = - grav * ( sshn(ji,jj+1) - sshn(ji,jj) ) / e2v(ji,jj)
84            END DO
[4292]85         END DO
86         !
[1505]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
[358]93            END DO
94         END DO
[1505]95         !
96      ENDIF
97      !
[3294]98      IF( nn_timing == 1 )  CALL timing_stop('dyn_spg_exp')
99      !
[358]100   END SUBROUTINE dyn_spg_exp
101
102   !!======================================================================
103END MODULE dynspg_exp
Note: See TracBrowser for help on using the repository browser.