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.
wzvmod.F90 in trunk/NEMO/OPA_SRC/DYN – NEMO

source: trunk/NEMO/OPA_SRC/DYN/wzvmod.F90 @ 1040

Last change on this file since 1040 was 1040, checked in by ctlod, 16 years ago

trunk: avoid warning message at compilation step when not using BDY package and duplicated lines zhdiv(ji,jj)=0.e0, see ticket: #179

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 6.2 KB
Line 
1MODULE wzvmod
2   !!==============================================================================
3   !!                       ***  MODULE  wzvmod  ***
4   !! Ocean diagnostic variable : vertical velocity
5   !!==============================================================================
6   !! History :   5.0  !  90-10  (C. Levy, G. Madec)  Original code
7   !!             7.0  !  96-01  (G. Madec)  Statement function for e3
8   !!             8.5  !  02-07  (G. Madec)  Free form, F90
9   !!              "   !  07-07  (D. Storkey) Zero zhdiv at open boundary (BDY)
10   !!----------------------------------------------------------------------
11   !!   wzv        : Compute the vertical velocity
12   !!----------------------------------------------------------------------
13   !! * Modules used
14   USE oce             ! ocean dynamics and tracers variables
15   USE dom_oce         ! ocean space and time domain variables
16   USE sbc_oce         ! surface boundary condition: ocean
17   USE domvvl          ! Variable volume
18   USE in_out_manager  ! I/O manager
19   USE prtctl          ! Print control
20   USE phycst
21   USE bdy_oce         ! unstructured open boundaries
22   USE lbclnk          ! ocean lateral boundary condition (or mpp link)
23
24   IMPLICIT NONE
25   PRIVATE
26
27   !! * Routine accessibility
28   PUBLIC wzv          ! routine called by step.F90 and inidtr.F90
29
30   !! * Substitutions
31#  include "domzgr_substitute.h90"
32   !!----------------------------------------------------------------------
33   !!  OPA 9.0 , LOCEAN-IPSL (2005)
34   !! $Id$
35   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt)
36   !!----------------------------------------------------------------------
37
38CONTAINS
39
40   SUBROUTINE wzv( kt )
41      !!----------------------------------------------------------------------
42      !!                    ***  ROUTINE wzv  ***
43      !!
44      !! ** Purpose :   Compute the now vertical velocity after the array swap
45      !!
46      !! ** Method  :   Using the incompressibility hypothesis, the vertical
47      !!      velocity is computed by integrating the horizontal divergence
48      !!      from the bottom to the surface.
49      !!        The boundary conditions are w=0 at the bottom (no flux) and,
50      !!      in regid-lid case, w=0 at the sea surface.
51      !!
52      !! ** action  :   wn array : the now vertical velocity
53      !!----------------------------------------------------------------------
54      !! * Arguments
55      INTEGER, INTENT( in ) ::   kt      ! ocean time-step index
56
57      !! * Local declarations
58      INTEGER  ::           jk           ! dummy loop indices
59      !! Variable volume
60      INTEGER  ::   ji, jj               ! dummy loop indices
61      REAL(wp) ::   z2dt, zraur          ! temporary scalar
62      REAL(wp), DIMENSION (jpi,jpj) ::   zssha, zun, zvn, zhdiv
63#if defined key_bdy || defined key_bdy_tides
64      INTEGER  ::     jgrd, jb           ! temporary scalars
65#endif
66      !!----------------------------------------------------------------------
67
68      IF( kt == nit000 ) THEN
69         IF(lwp) WRITE(numout,*)
70         IF(lwp) WRITE(numout,*) 'wzv     : vertical velocity from continuity eq.'
71         IF(lwp) WRITE(numout,*) '~~~~~~~ ' 
72
73         ! bottom boundary condition: w=0 (set once for all)
74         wn(:,:,jpk) = 0.e0
75      ENDIF
76
77      IF( lk_vvl ) THEN                ! Variable volume
78         !
79         z2dt = 2. * rdt                                       ! time step: leap-frog
80         IF( neuler == 0 .AND. kt == nit000 ) z2dt = rdt       ! time step: Euler if restart from rest
81         zraur  = 1. / rauw
82
83         ! Vertically integrated quantities
84         ! --------------------------------
85         zun(:,:) = 0.e0
86         zvn(:,:) = 0.e0
87         !
88         DO jk = 1, jpkm1             ! Vertically integrated transports (now)
89            zun(:,:) = zun(:,:) + fse3u(:,:,jk) * un(:,:,jk)
90            zvn(:,:) = zvn(:,:) + fse3v(:,:,jk) * vn(:,:,jk)
91         END DO
92
93         ! Horizontal divergence of barotropic transports
94         !--------------------------------------------------
95         zhdiv(:,:) = 0.e0
96         DO jj = 2, jpjm1
97            DO ji = 2, jpim1   ! vector opt.
98               zhdiv(ji,jj) = (  e2u(ji  ,jj  ) * zun(ji  ,jj  )     &
99                  &            - e2u(ji-1,jj  ) * zun(ji-1,jj  )     &
100                  &            + e1v(ji  ,jj  ) * zvn(ji  ,jj  )     &
101                  &            - e1v(ji  ,jj-1) * zvn(ji  ,jj-1) )   &
102                  &           / ( e1t(ji,jj) * e2t(ji,jj) )
103            END DO
104         END DO
105
106#if defined key_obc && ( key_dynspg_exp || key_dynspg_ts )
107         ! open boundaries (div must be zero behind the open boundary)
108         !  mpp remark: The zeroing of hdiv can probably be extended to 1->jpi/jpj for the correct row/column
109         IF( lp_obc_east  )   zhdiv(nie0p1:nie1p1,nje0  :nje1)   = 0.e0    ! east
110         IF( lp_obc_west  )   zhdiv(niw0  :niw1  ,njw0  :njw1)   = 0.e0    ! west
111         IF( lp_obc_north )   zhdiv(nin0  :nin1  ,njn0p1:njn1p1) = 0.e0    ! north
112         IF( lp_obc_south )   zhdiv(nis0  :nis1  ,njs0  :njs1)   = 0.e0    ! south
113#endif
114
115#if defined key_bdy || defined key_bdy_tides
116         jgrd=1 !: tracer grid.
117         DO jb = 1, nblenrim(jgrd)
118           ji = nbi(jb,jgrd)
119           jj = nbj(jb,jgrd)
120           zhdiv(ji,jj) = 0.e0
121         END DO
122#endif
123
124         CALL lbc_lnk( zhdiv, 'T', 1. )
125
126         ! Sea surface elevation time stepping
127         ! -----------------------------------
128         zssha(:,:) = sshb(:,:) - z2dt * ( zraur * emp(:,:) + zhdiv(:,:) ) * tmask(:,:,1)
129
130         ! Vertical velocity computed from bottom
131         ! --------------------------------------
132         DO jk = jpkm1, 1, -1
133            wn(:,:,jk) = wn(:,:,jk+1) - fse3t(:,:,jk) * hdivn(:,:,jk) &
134              &        - ( zssha(:,:) - sshb(:,:) ) * fsve3t(:,:,jk) * mut(:,:,jk) / z2dt
135         END DO
136
137      ELSE                             ! Fixed volume
138
139         ! Vertical velocity computed from bottom
140         ! --------------------------------------
141         DO jk = jpkm1, 1, -1
142            wn(:,:,jk) = wn(:,:,jk+1) - fse3t(:,:,jk) * hdivn(:,:,jk)
143         END DO
144     
145      ENDIF
146
147      IF(ln_ctl)   CALL prt_ctl(tab3d_1=wn, clinfo1=' w**2 -   : ', mask1=wn)
148
149   END SUBROUTINE wzv
150
151   !!======================================================================
152END MODULE wzvmod
Note: See TracBrowser for help on using the repository browser.