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 trunk/NEMO/OPA_SRC/DYN – NEMO

source: trunk/NEMO/OPA_SRC/DYN/dynspg_exp.F90 @ 1495

Last change on this file since 1495 was 1438, checked in by rblod, 15 years ago

Merge VVL branch with the trunk (act II), see ticket #429

  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Id
File size: 5.0 KB
Line 
1MODULE dynspg_exp
2   !!======================================================================
3   !!                   ***  MODULE  dynspg_exp  ***
4   !! Ocean dynamics:  surface pressure gradient trend
5   !!======================================================================
6   !! History :  9.0  !  2005-11  (V. Garnier, G. Madec, L. Bessieres) Original code
7   !!----------------------------------------------------------------------
8#if defined key_dynspg_exp   ||   defined key_esopa
9   !!----------------------------------------------------------------------
10   !!   'key_dynspg_exp'           free sfce cst vol. without filter nor ts
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
18   USE sbc_oce         ! surface boundary condition: ocean
19   USE obc_oce         ! Lateral open boundary condition
20   USE phycst          ! physical constants
21   USE obc_par         ! open boundary condition parameters
22   USE obcdta          ! open boundary condition data     (obc_dta_bt routine)
23   USE in_out_manager  ! I/O manager
24   USE lib_mpp         ! distributed memory computing library
25   USE lbclnk          ! ocean lateral boundary conditions (or mpp link)
26   USE prtctl          ! Print control
27   USE iom             ! I/O library
28   USE restart         ! only for lrst_oce
29
30   IMPLICIT NONE
31   PRIVATE
32
33   PUBLIC   dyn_spg_exp   ! routine called by step.F90
34
35   !! * Substitutions
36#  include "domzgr_substitute.h90"
37#  include "vectopt_loop_substitute.h90"
38   !!----------------------------------------------------------------------
39   !! NEMO/OPA 3.2 , LOCEAN-IPSL (2009)
40   !! $Id$
41   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt)
42   !!----------------------------------------------------------------------
43
44CONTAINS
45
46   SUBROUTINE dyn_spg_exp( kt )
47      !!----------------------------------------------------------------------
48      !!                  ***  routine dyn_spg_exp  ***
49      !!
50      !! ** Purpose :   Compute the now trend due to the surface pressure
51      !!      gradient in case of explicit free surface formulation and
52      !!      add it to the general trend of momentum equation. Compute
53      !!      the free surface.
54      !!
55      !! ** Method  :   Explicit free surface formulation. The surface pressure
56      !!      gradient is given by:
57      !!         spgu = 1/rau0 d/dx(ps) =  g/e1u di( sshn )
58      !!         spgv = 1/rau0 d/dy(ps) =  g/e2v dj( sshn )
59      !!      -1- Compute the now surface pressure gradient
60      !!      -2- Add it to the general trend
61      !!
62      !! ** Action : - Update (ua,va) with the surf. pressure gradient trend
63      !!---------------------------------------------------------------------
64      INTEGER, INTENT( in )  ::   kt         ! ocean time-step index
65      !!
66      INTEGER  ::   ji, jj, jk               ! dummy loop indices
67      !!----------------------------------------------------------------------
68
69      IF( kt == nit000 ) THEN
70         IF(lwp) WRITE(numout,*)
71         IF(lwp) WRITE(numout,*) 'dyn_spg_exp : surface pressure gradient trend'
72         IF(lwp) WRITE(numout,*) '~~~~~~~~~~~   (explicit free surface)'
73
74         ! set to zero free surface specific arrays
75         spgu(:,:) = 0.e0                     ! surface pressure gradient (i-direction)
76         spgv(:,:) = 0.e0                     ! surface pressure gradient (j-direction)
77      ENDIF
78
79      ! read or estimate sea surface height and vertically integrated velocities
80      IF( lk_obc )   CALL obc_dta_bt( kt, 0 )
81
82      ! Surface pressure gradient (now)
83      DO jj = 2, jpjm1
84         DO ji = fs_2, fs_jpim1   ! vector opt.
85            spgu(ji,jj) = - grav * ( sshn(ji+1,jj) - sshn(ji,jj) ) / e1u(ji,jj)
86            spgv(ji,jj) = - grav * ( sshn(ji,jj+1) - sshn(ji,jj) ) / e2v(ji,jj)
87         END DO
88      END DO
89
90      ! Add the surface pressure trend to the general trend
91      DO jk = 1, jpkm1
92         DO jj = 2, jpjm1
93            DO ji = fs_2, fs_jpim1   ! vector opt.
94               ua(ji,jj,jk) = ua(ji,jj,jk) + spgu(ji,jj)
95               va(ji,jj,jk) = va(ji,jj,jk) + spgv(ji,jj)
96            END DO
97         END DO
98      END DO
99
100   END SUBROUTINE dyn_spg_exp
101
102#else
103   !!----------------------------------------------------------------------
104   !!   Default case :   Empty module   No standart explicit free surface
105   !!----------------------------------------------------------------------
106CONTAINS
107   SUBROUTINE dyn_spg_exp( kt )       ! Empty routine
108      WRITE(*,*) 'dyn_spg_exp: You should not have seen this print! error?', kt
109   END SUBROUTINE dyn_spg_exp
110#endif
111
112   !!======================================================================
113END MODULE dynspg_exp
Note: See TracBrowser for help on using the repository browser.