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/2014/dev_CNRS0_NOC1_LDF/NEMOGCM/NEMO/OPA_SRC/DYN – NEMO

source: branches/2014/dev_CNRS0_NOC1_LDF/NEMOGCM/NEMO/OPA_SRC/DYN/dynspg_exp.F90 @ 4616

Last change on this file since 4616 was 4616, checked in by gm, 10 years ago

#1260 : see the associated wiki page for explanation

  • Property svn:keywords set to Id
File size: 5.1 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   !!----------------------------------------------------------------------
[575]9#if defined key_dynspg_exp   ||   defined key_esopa
[358]10   !!----------------------------------------------------------------------
[1505]11   !!   'key_dynspg_exp'                              explicit free surface
[358]12   !!----------------------------------------------------------------------
13   !!   dyn_spg_exp  : update the momentum trend with the surface
14   !!                      pressure gradient in the free surface constant 
15   !!                      volume case with vector optimization
16   !!----------------------------------------------------------------------
17   USE oce             ! ocean dynamics and tracers
18   USE dom_oce         ! ocean space and time domain
[888]19   USE sbc_oce         ! surface boundary condition: ocean
[719]20   USE phycst          ! physical constants
[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
28   IMPLICIT NONE
29   PRIVATE
30
[1438]31   PUBLIC   dyn_spg_exp   ! routine called by step.F90
[358]32
33   !! * Substitutions
34#  include "domzgr_substitute.h90"
35#  include "vectopt_loop_substitute.h90"
36   !!----------------------------------------------------------------------
[2528]37   !! NEMO/OPA 3.3 , NEMO Consortium (2010)
[888]38   !! $Id$
[2715]39   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
[358]40   !!----------------------------------------------------------------------
41CONTAINS
42
43   SUBROUTINE dyn_spg_exp( kt )
44      !!----------------------------------------------------------------------
45      !!                  ***  routine dyn_spg_exp  ***
46      !!
47      !! ** Purpose :   Compute the now trend due to the surface pressure
[1505]48      !!              gradient in case of explicit free surface formulation and
49      !!              add it to the general trend of momentum equation.
[358]50      !!
[1505]51      !! ** Method  :   Explicit free surface formulation. Add to the general
52      !!              momentum trend the surface pressure gradient :
53      !!                      (ua,va) = (ua,va) + (spgu,spgv)
54      !!              where spgu = -1/rau0 d/dx(ps) = -g/e1u di( sshn )
55      !!                    spgv = -1/rau0 d/dy(ps) = -g/e2v dj( sshn )
[358]56      !!
[1505]57      !! ** Action :   (ua,va)   trend of horizontal velocity increased by
58      !!                         the surf. pressure gradient trend
[358]59      !!---------------------------------------------------------------------
[2715]60      INTEGER, INTENT(in)  ::   kt   ! ocean time-step index
[1438]61      !!
[2715]62      INTEGER ::   ji, jj, jk   ! dummy loop indices
[358]63      !!----------------------------------------------------------------------
[3294]64      !
65      IF( nn_timing == 1 )  CALL timing_start('dyn_spg_exp')
66      !
[358]67      IF( kt == nit000 ) THEN
68         IF(lwp) WRITE(numout,*)
69         IF(lwp) WRITE(numout,*) 'dyn_spg_exp : surface pressure gradient trend'
70         IF(lwp) WRITE(numout,*) '~~~~~~~~~~~   (explicit free surface)'
[1505]71         !
[2715]72         spgu(:,:) = 0._wp   ;   spgv(:,:) = 0._wp
[1505]73         !
74         IF( lk_vvl .AND. lwp ) WRITE(numout,*) '              lk_vvl=T : spg is included in dynhpg'
[358]75      ENDIF
76
[1505]77      IF( .NOT. lk_vvl ) THEN          !* fixed volume : add the surface pressure gradient trend
78         !
79         DO jj = 2, jpjm1                    ! now surface pressure gradient
[358]80            DO ji = fs_2, fs_jpim1   ! vector opt.
[4616]81               spgu(ji,jj) = - grav * ( sshn(ji+1,jj) - sshn(ji,jj) ) * r1_e1u(ji,jj)
82               spgv(ji,jj) = - grav * ( sshn(ji,jj+1) - sshn(ji,jj) ) * r1_e2v(ji,jj)
[1505]83            END DO
[4292]84         END DO
85         !
[1505]86         DO jk = 1, jpkm1                    ! Add it to the general trend
87            DO jj = 2, jpjm1
88               DO ji = fs_2, fs_jpim1   ! vector opt.
89                  ua(ji,jj,jk) = ua(ji,jj,jk) + spgu(ji,jj)
90                  va(ji,jj,jk) = va(ji,jj,jk) + spgv(ji,jj)
91               END DO
[358]92            END DO
93         END DO
[1505]94         !
95      ENDIF
96      !
[3294]97      IF( nn_timing == 1 )  CALL timing_stop('dyn_spg_exp')
98      !
[358]99   END SUBROUTINE dyn_spg_exp
100
101#else
102   !!----------------------------------------------------------------------
103   !!   Default case :   Empty module   No standart explicit free surface
104   !!----------------------------------------------------------------------
105CONTAINS
106   SUBROUTINE dyn_spg_exp( kt )       ! Empty routine
107      WRITE(*,*) 'dyn_spg_exp: You should not have seen this print! error?', kt
108   END SUBROUTINE dyn_spg_exp
109#endif
[1438]110
[358]111   !!======================================================================
112END MODULE dynspg_exp
Note: See TracBrowser for help on using the repository browser.