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 2379 for branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/DOM/domzgr.F90 – NEMO

Ignore:
Timestamp:
2010-11-12T15:51:18+01:00 (13 years ago)
Author:
acc
Message:

nemo_v3_3beta. First stage of adding ORCA1 support. See ticket #758. Added optional double tanh function for vertical grid

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/DOM/domzgr.F90

    r2287 r2379  
    160160      REAL(wp) ::   zacr, zdzmin, zhmax    ! par_CONFIG_Rxx.h90 
    161161      REAL(wp) ::   zrefdep                ! depth of the reference level (~10m) 
     162      REAL(wp) ::   za2, zkth2, zacr2      ! Values for optional double tanh function set from parameters  
    162163      !!---------------------------------------------------------------------- 
    163164 
     
    166167       zkth = ppkth       ;   zacr = ppacr 
    167168       zdzmin = ppdzmin   ;   zhmax = pphmax 
     169       zkth2 = ppkth2     ;   zacr2 = ppacr2   ! optional (ldbletanh=T) double tanh parameters 
    168170 
    169171      ! If ppa1 and ppa0 and ppsur are et to pp_to_be_computed 
     
    181183      ELSE 
    182184         za1 = ppa1 ;       za0 = ppa0 ;          zsur = ppsur 
     185         za2 = ppa2                            ! optional (ldbletanh=T) double tanh parameter 
    183186      ENDIF 
    184187 
     
    203206            WRITE(numout,*) '                 zkth = ', zkth 
    204207            WRITE(numout,*) '                 zacr = ', zacr 
     208            IF( ldbletanh ) THEN 
     209               WRITE(numout,*) ' (Double tanh    za2  = ', za2 
     210               WRITE(numout,*) '  parameters)    zkth2= ', zkth2 
     211               WRITE(numout,*) '                 zacr2= ', zacr2 
     212            ENDIF 
    205213         ENDIF 
    206214      ENDIF 
     
    220228         END DO 
    221229      ELSE                                ! Madec & Imbard 1996 function 
    222          DO jk = 1, jpk 
    223             zw = FLOAT( jk ) 
    224             zt = FLOAT( jk ) + 0.5 
    225             gdepw_0(jk) = ( zsur + za0 * zw + za1 * zacr * LOG ( COSH( (zw-zkth) / zacr ) )  ) 
    226             gdept_0(jk) = ( zsur + za0 * zt + za1 * zacr * LOG ( COSH( (zt-zkth) / zacr ) )  ) 
    227             e3w_0  (jk) =          za0      + za1        * TANH(       (zw-zkth) / zacr   ) 
    228             e3t_0  (jk) =          za0      + za1        * TANH(       (zt-zkth) / zacr   ) 
    229          END DO 
     230         IF( .NOT. ldbletanh ) THEN 
     231            DO jk = 1, jpk 
     232               zw = FLOAT( jk ) 
     233               zt = FLOAT( jk ) + 0.5 
     234               gdepw_0(jk) = ( zsur + za0 * zw + za1 * zacr * LOG ( COSH( (zw-zkth) / zacr ) )  ) 
     235               gdept_0(jk) = ( zsur + za0 * zt + za1 * zacr * LOG ( COSH( (zt-zkth) / zacr ) )  ) 
     236               e3w_0  (jk) =          za0      + za1        * TANH(       (zw-zkth) / zacr   ) 
     237               e3t_0  (jk) =          za0      + za1        * TANH(       (zt-zkth) / zacr   ) 
     238            END DO 
     239         ELSE 
     240            DO jk = 1, jpk 
     241               zw = FLOAT( jk ) 
     242               zt = FLOAT( jk ) + 0.5 
     243               ! Double tanh function 
     244               gdepw_0(jk) = ( zsur + za0 * zw + za1 * zacr * LOG ( COSH( (zw-zkth) / zacr ) )    & 
     245     &                                         + za2 * zacr2* LOG ( COSH( (zw-zkth2)/zacr2 ) )  ) 
     246               gdept_0(jk) = ( zsur + za0 * zt + za1 * zacr * LOG ( COSH( (zt-zkth) / zacr ) )    & 
     247     &                                         + za2 * zacr2* LOG ( COSH( (zt-zkth2)/zacr2 ) )  ) 
     248               e3w_0  (jk) =          za0      + za1        * TANH(       (zw-zkth) / zacr   )    & 
     249     &                                         + za2        * TANH(       (zw-zkth2)/zacr2   ) 
     250               e3t_0  (jk) =          za0      + za1        * TANH(       (zt-zkth) / zacr   )    & 
     251     &                                         + za2        * TANH(       (zt-zkth2)/zacr2   ) 
     252            END DO 
     253         ENDIF 
    230254         gdepw_0(1) = 0.e0                     ! force first w-level to be exactly at zero 
    231255      ENDIF 
    232256 
    233257!!gm BUG in s-coordinate this does not work! 
    234       ! deepest/shallowest W level Above/Bellow ~10m 
     258      ! deepest/shallowest W level Above/Below ~10m 
    235259      zrefdep = 10. - ( 0.1*MINVAL(e3w_0) )                          ! ref. depth with tolerance (10% of minimum layer thickness) 
    236       nlb10 = MINLOC( gdepw_0, mask = gdepw_0 > zrefdep, dim = 1 )   ! shallowest W level Bellow ~10m 
    237       nla10 = nlb10 - 1                                              ! deepest    W level Above  ~10m 
     260      nlb10 = MINLOC( gdepw_0, mask = gdepw_0 > zrefdep, dim = 1 )   ! shallowest W level Below ~10m 
     261      nla10 = nlb10 - 1                                              ! deepest    W level Above ~10m 
    238262!!gm end bug 
    239263 
     
    746770      INTEGER  ::   ji, jj, jk       ! dummy loop indices 
    747771      INTEGER  ::   ik, it           ! temporary integers 
     772      INTEGER  ::   nlbelow          ! temporary integer 
    748773      LOGICAL  ::   ll_print         ! Allow  control print for debugging 
    749774      REAL(wp) ::   ze3tp , ze3wp    ! Last ocean level thickness at T- and W-points 
     
    751776      REAL(wp) ::   zmax, zmin       ! Maximum and minimum depth 
    752777      REAL(wp) ::   zdiff            ! temporary scalar 
     778      REAL(wp) ::   zrefdep          ! temporary scalar 
    753779      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zprt   ! 3D workspace 
    754780      !!--------------------------------------------------------------------- 
     
    772798      ! =================== 
    773799      zmax = gdepw_0(jpk) + e3t_0(jpk)     ! maximum depth (i.e. the last ocean level thickness <= 2*e3t_0(jpkm1) ) 
    774       zmin = gdepw_0(4)                    ! minimum depth = 3 levels 
     800 
     801      zrefdep = 25. 
     802      nlbelow = MINLOC( gdepw_0, mask = gdepw_0 > zrefdep, dim = 1 )   ! shallowest W level Below zrefdep 
     803      IF(lwp) write(numout,*) 'Minimum depth level selected: ', nlbelow 
     804      zmin = gdepw_0(nlbelow)              ! minimum depth = nlbelow-1 levels 
    775805 
    776806      mbathy(:,:) = jpkm1                  ! initialize mbathy to the maximum ocean level available 
Note: See TracChangeset for help on using the changeset viewer.