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 6914 for branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/CONFIG/OVERFLOW/MY_SRC/usrdef_zgr.F90 – NEMO

Ignore:
Timestamp:
2016-09-06T13:27:38+02:00 (8 years ago)
Author:
gm
Message:

#1692 - branch SIMPLIF_2_usrdef: final adjustment of OVERFLOW and LOCK-ECHANGE configuration

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/CONFIG/OVERFLOW/MY_SRC/usrdef_zgr.F90

    r6906 r6914  
    22   !!============================================================================== 
    33   !!                       ***  MODULE usrdef_zgr  *** 
     4   !! 
     5   !!                     ===      OVERFLOW case      === 
     6   !! 
    47   !! Ocean domain : user defined vertical coordinate system  
    5    !! 
    6    !!                       ===      OVERFLOW case      === 
    7    !! 
    88   !!============================================================================== 
    9    !! History :  4.0  ! 2016-08  (G. Madec)  Original code 
    10    !!---------------------------------------------------------------------- 
    11  
    12    !!---------------------------------------------------------------------- 
    13    !!   usr_def_zgr      : user defined vertical coordinate system (required) 
    14    !!       zgr_z1d      : reference 1D z-coordinate  
    15    !!       zgr_zps      : 3D vertical coordinate in z-partial cell coordinate 
     9   !! History :  4.0  ! 2016-08  (G. Madec, S. Flavoni)  Original code 
     10   !!---------------------------------------------------------------------- 
     11 
     12   !!---------------------------------------------------------------------- 
     13   !!   usr_def_zgr   : user defined vertical coordinate system (required) 
     14   !!       zgr_z1d   : reference 1D z-coordinate  
    1615   !!--------------------------------------------------------------------- 
    17    USE oce               ! ocean variables 
    18    USE dom_oce  ,  ONLY: ln_zco, ln_zps, ln_sco   ! ocean space and time domain 
    19    USE dom_oce  ,  ONLY: nimpp, njmpp             ! ocean space and time domain 
    20    USE dom_oce  ,  ONLY: glamt                    ! ocean space and time domain 
    21    USE usrdef_nam        ! User defined : namelist variables 
     16   USE oce            ! ocean variables 
     17   USE dom_oce ,  ONLY: ln_zco, ln_zps, ln_sco   ! ocean space and time domain 
     18   USE dom_oce ,  ONLY: mi0, mi1, nimpp, njmpp   ! ocean space and time domain 
     19   USE dom_oce ,  ONLY: glamt                    ! ocean space and time domain 
     20   USE usrdef_nam     ! User defined : namelist variables 
    2221   ! 
    23    USE in_out_manager    ! I/O manager 
    24    USE lbclnk            ! ocean lateral boundary conditions (or mpp link) 
    25    USE lib_mpp           ! distributed memory computing library 
    26    USE wrk_nemo          ! Memory allocation 
    27    USE timing            ! Timing 
     22   USE in_out_manager ! I/O manager 
     23   USE lbclnk         ! ocean lateral boundary conditions (or mpp link) 
     24   USE lib_mpp        ! distributed memory computing library 
     25   USE wrk_nemo       ! Memory allocation 
     26   USE timing         ! Timing 
    2827 
    2928   IMPLICIT NONE 
     
    7069      ! 
    7170      IF(lwp) WRITE(numout,*) 
    72       IF(lwp) WRITE(numout,*) 'usr_def_zgr : OVERFLOW configuration (z-coordinate closed box ocean without cavities)' 
     71      IF(lwp) WRITE(numout,*) 'usr_def_zgr : OVERFLOW configuration (z(ps)- or s-coordinate closed box ocean without cavities)' 
    7372      IF(lwp) WRITE(numout,*) '~~~~~~~~~~~' 
    7473      ! 
     
    8685      ! 
    8786      ! western continental shelf (500m deep) and eastern deep ocean (2000m deep) 
     87      ! (set through the jpk and jpi (see userdef_nam.F90)) 
    8888      ! with a hyperbolic tangent transition centered at 40km 
    8989      ! NB: here glamt is in kilometers 
     
    9191      zht(:,:) = + (  500. + 0.5 * 1500. * ( 1.0 + tanh( (glamt(:,:) - 40.) / 7. ) )  ) 
    9292      ! 
    93       ! at u-point: recompute from glamu (see usrdef_hgr.F90) to avoid the masking when using lbc_lnk 
    94       zfact = rn_dx * 1.e-3         ! conversion in km 
    95       DO ji = 1, jpi 
    96          zhu(ji,:) = + (  500. + 0.5 * 1500. * ( 1.0 + tanh( ( zfact * REAL( ji-1 + nimpp-1 , wp ) - 40.) / 7. ) )  ) 
    97       END DO 
    98       ! 
     93      ! at u-point: averaging zht 
     94      DO ji = 1, jpim1 
     95         zhu(ji,:) = 0.5_wp * ( zht(ji,:) + zht(ji+1,:) ) 
     96      END DO 
     97      CALL lbc_lnk( zhu, 'U', 1. )     ! boundary condition: this mask the surrouding grid-points 
     98      !                                ! ==>>>  set by hand non-zero value on first/last columns & rows  
     99      DO ji = mi0(1), mi1(1)              ! first row of global domain only 
     100         zhu(ji,2) = zht(1,2) 
     101      END DO 
     102       DO ji = mi0(jpi), mi1(jpi)         ! last  row of global domain only 
     103         zhu(ji,2) = zht(jpi,2) 
     104      END DO 
     105      zhu(:,1) = zhu(:,2) 
     106      zhu(:,3) = zhu(:,2) 
     107      !      
    99108      CALL zgr_z1d( pdept_1d, pdepw_1d, pe3t_1d , pe3w_1d )   ! Reference z-coordinate system 
    100109      ! 
     
    105114      ! the ocean basin surrounded by land (1 grid-point) set through lbc_lnk call as jperio=0  
    106115      z2d(:,:) = 1._wp                    ! surface ocean is the 1st level 
    107       CALL lbc_lnk( z2d, 'T', 1. )        ! closed basin  
    108       k_top(:,:) = z2d(:,:) 
     116      CALL lbc_lnk( z2d, 'T', 1. )        ! closed basin since jperio = 0 (see userdef_nam.F90) 
     117      k_top(:,:) = NINT( z2d(:,:) ) 
    109118      ! 
    110119      !                               
     
    162171         k_bot(:,:) = jpkm1 
    163172         DO jk = jpkm1, 1, -1 
    164             WHERE( zht(:,:) <= pdepw_1d(jk) + ze3min )   k_bot(:,:) = jk-1 
     173            WHERE( zht(:,:) < pdepw_1d(jk) + ze3min )   k_bot(:,:) = jk-1 
    165174         END DO 
    166175         ! 
     
    180189            DO ji = 1, jpi 
    181190               ik = k_bot(ji,jj) 
    182                IF( ik /= jpkm1 ) THEN                 ! last level ==> ref 1d z-coordinate 
    183191                  pdepw(ji,jj,ik+1) = MIN( zht(ji,jj) , pdepw_1d(ik+1) ) 
    184192                  pe3t (ji,jj,ik  ) = pdepw(ji,jj,ik+1) - pdepw(ji,jj,ik) 
    185                   pe3t (ji,jj,ik+1) = pe3t (ji,jj,ik)  
     193                  pe3t (ji,jj,ik+1) = pe3t (ji,jj,ik  )  
    186194                  ! 
    187                   pdept(ji,jj,ik  ) = pdept(ji,jj,ik-1) + pe3t(ji,jj,ik) * 0.5_wp 
    188                   pe3w (ji,jj,ik+1) = pdepw(ji,jj,ik+1) - pdepw(ji,jj,ik) 
    189                ENDIF 
     195                  pdept(ji,jj,ik  ) = pdepw(ji,jj,ik  ) + pe3t (ji,jj,ik  ) * 0.5_wp 
     196                  pdept(ji,jj,ik+1) = pdepw(ji,jj,ik+1) + pe3t (ji,jj,ik+1) * 0.5_wp 
     197                  pe3w (ji,jj,ik+1) = pdept(ji,jj,ik+1) - pdept(ji,jj,ik)              ! = pe3t (ji,jj,ik  ) 
    190198            END DO 
    191199         END DO          
     
    194202         pe3u (:,:,:) = pe3t(:,:,:)          ! HERE OVERFLOW configuration :  
    195203         pe3v (:,:,:) = pe3t(:,:,:)          !    e3 increases with i-index and identical with j-index 
    196          pe3f (:,:,:) = pe3t(:,:,:)          !    so e3 minimum of (i,i+1) points is (i) point (idem in j-direction) 
    197          pe3uw(:,:,:) = pe3w(:,:,:)          !     
     204         pe3f (:,:,:) = pe3t(:,:,:)          !    so e3 minimum of (i,i+1) points is (i) point 
     205         pe3uw(:,:,:) = pe3w(:,:,:)          !    in j-direction e3v=e3t and e3f=e3v 
    198206         pe3vw(:,:,:) = pe3w(:,:,:)          !    ==>>  no need of lbc_lnk calls 
    199207         !       
Note: See TracChangeset for help on using the changeset viewer.