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

Last change on this file since 789 was 789, checked in by rblod, 16 years ago

Suppress jki routines and associated key_mpp_omp

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