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 @ 888

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

merge dev_001_SBC branche with the trunk to include the New Surface Module package, see ticket: #113

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