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

Ignore:
Timestamp:
2007-02-09T10:15:25+01:00 (17 years ago)
Author:
opalod
Message:

nemo_v2_update_001 : CT : - add non linear free surface (variable volume) with new cpp key key_vvl

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/NEMO/OPA_SRC/DYN/wzvmod.F90

    r455 r592  
    44   !! Ocean diagnostic variable : vertical velocity 
    55   !!============================================================================== 
    6  
     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 
    79   !!---------------------------------------------------------------------- 
    810   !!   wzv        : Compute the vertical velocity 
     
    1416   USE prtctl          ! Print control 
    1517 
     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 
    1623   IMPLICIT NONE 
    1724   PRIVATE 
    1825 
    1926   !! * Routine accessibility 
    20    PUBLIC wzv       ! routine called by step.F90 and inidtr.F90 
     27   PUBLIC wzv          ! routine called by step.F90 and inidtr.F90 
    2128 
    2229   !! * Substitutions 
    2330#  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) 
    2435   !!---------------------------------------------------------------------- 
    2536 
     
    4051      !!     velocity is computed by integrating the horizontal divergence  
    4152      !!     from the bottom to the surface. 
    42       !!       The boundary conditions are w=0 at the bottom (no flux) and, 
    43       !!     in regid-lid case, w=0 at the sea surface. 
     53      !!     The boundary conditions are w=0 at the bottom (no flux) and, 
     54      !!     in rigid-lid case, w=0 at the sea surface. 
    4455      !! 
    4556      !! ** action  :    wn array : the now vertical velocity 
    46       !! 
    47       !! History : 
    48       !!   5.0  !  90-10  (C. Levy, G. Madec)  Original code 
    49       !!   7.0  !  96-01  (G. Madec)  Statement function for e3 
    50       !!   8.5  !  02-07  (G. Madec)  Free form, F90 
    5157      !!---------------------------------------------------------------------- 
    5258      !! * Arguments 
     
    5561      !! * Local declarations 
    5662      INTEGER ::   jj, jk      ! dummy loop indices 
    57       !!---------------------------------------------------------------------- 
    58       !!  OPA 9.0 , LOCEAN-IPSL (2005)  
    59       !! $Header$  
    60       !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt 
    6163      !!---------------------------------------------------------------------- 
    6264 
     
    103105      !! 
    104106      !! ** action  :   wn array : the now vertical velocity 
    105       !! 
    106       !! History : 
    107       !!   9.0  !  02-07  (G. Madec)  Vector optimization 
    108107      !!---------------------------------------------------------------------- 
    109108      !! * Arguments 
     
    111110 
    112111      !! * Local declarations 
    113       INTEGER ::   jk          ! dummy loop indices 
    114       !!---------------------------------------------------------------------- 
    115       !!  OPA 8.5, LODYC-IPSL (2002) 
     112      INTEGER  ::           jk           ! dummy loop indices 
     113      !! Variable volume 
     114      INTEGER  ::   ji, jj               ! dummy loop indices 
     115      REAL(wp) ::   z2dt, zraur          ! temporary scalar 
     116      REAL(wp), DIMENSION (jpi,jpj) ::   zssha, zun, zvn, zhdiv 
    116117      !!---------------------------------------------------------------------- 
    117118 
     
    125126      ENDIF 
    126127 
    127       ! Computation from the bottom 
    128       DO jk = jpkm1, 1, -1 
    129          wn(:,:,jk) = wn(:,:,jk+1) - fse3t(:,:,jk) * hdivn(:,:,jk) 
    130       END DO 
     128      IF( lk_vvl ) THEN                ! Variable volume 
     129         ! 
     130         z2dt = 2. * rdt                                       ! time step: leap-frog 
     131         IF( neuler == 0 .AND. kt == nit000 ) z2dt = rdt       ! time step: Euler if restart from rest 
     132         zraur  = 1. / rauw 
     133 
     134         ! Vertically integrated quantities 
     135         ! -------------------------------- 
     136         zun(:,:) = 0.e0 
     137         zvn(:,:) = 0.e0 
     138         ! 
     139         DO jk = 1, jpkm1             ! Vertically integrated transports (now) 
     140            zun(:,:) = zun(:,:) + fse3u(:,:,jk) * un(:,:,jk) 
     141            zvn(:,:) = zvn(:,:) + fse3v(:,:,jk) * vn(:,:,jk) 
     142         END DO 
     143 
     144         ! Horizontal divergence of barotropic transports 
     145         !-------------------------------------------------- 
     146         DO jj = 2, jpjm1 
     147            DO ji = 2, jpim1   ! vector opt. 
     148               zhdiv(ji,jj) = (  e2u(ji  ,jj  ) * zun(ji  ,jj  )     & 
     149                  &            - e2u(ji-1,jj  ) * zun(ji-1,jj  )     & 
     150                  &            + e1v(ji  ,jj  ) * zvn(ji  ,jj  )     & 
     151                  &            - e1v(ji  ,jj-1) * zvn(ji  ,jj-1) )   & 
     152                  &           / ( e1t(ji,jj) * e2t(ji,jj) ) 
     153            END DO 
     154         END DO 
     155 
     156#if defined key_obc && ( key_dynspg_exp || key_dynspg_ts ) 
     157         ! open boundaries (div must be zero behind the open boundary) 
     158         !  mpp remark: The zeroing of hdiv can probably be extended to 1->jpi/jpj for the correct row/column 
     159         IF( lp_obc_east  )   zhdiv(nie0p1:nie1p1,nje0  :nje1)   = 0.e0    ! east 
     160         IF( lp_obc_west  )   zhdiv(niw0  :niw1  ,njw0  :njw1)   = 0.e0    ! west 
     161         IF( lp_obc_north )   zhdiv(nin0  :nin1  ,njn0p1:njn1p1) = 0.e0    ! north 
     162         IF( lp_obc_south )   zhdiv(nis0  :nis1  ,njs0  :njs1)   = 0.e0    ! south 
     163#endif 
     164 
     165         CALL lbc_lnk( zhdiv, 'T', 1. ) 
     166 
     167         ! Sea surface elevation time stepping 
     168         ! ----------------------------------- 
     169         zssha(:,:) = sshb(:,:) - z2dt * ( zraur * emp(:,:) + zhdiv(:,:) ) * tmask(:,:,1) 
     170 
     171         ! Vertical velocity computed from bottom 
     172         ! -------------------------------------- 
     173         DO jk = jpkm1, 1, -1 
     174            wn(:,:,jk) = wn(:,:,jk+1) - fse3t(:,:,jk) * hdivn(:,:,jk) & 
     175              &        - ( zssha(:,:) - sshb(:,:) ) * fsve3t(:,:,jk) * mut(:,:,jk) / z2dt 
     176         END DO 
     177 
     178      ELSE                             ! Fixed volume  
     179 
     180         ! Vertical velocity computed from bottom 
     181         ! -------------------------------------- 
     182         DO jk = jpkm1, 1, -1 
     183            wn(:,:,jk) = wn(:,:,jk+1) - fse3t(:,:,jk) * hdivn(:,:,jk) 
     184         END DO 
     185       
     186      ENDIF  
    131187 
    132188      IF(ln_ctl)   CALL prt_ctl(tab3d_1=wn, clinfo1=' w**2 -   : ', mask1=wn) 
Note: See TracChangeset for help on using the changeset viewer.