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 12482 for NEMO/branches/2020/dev_r12377_KERNEL-06_techene_e3/src/OCE/DOM/dommsk.F90 – NEMO

Ignore:
Timestamp:
2020-02-28T11:26:52+01:00 (4 years ago)
Author:
techene
Message:

new reference without ztilde, duplicated modules and routines to be modified from zstar MLF to zstar LF

File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2020/dev_r12377_KERNEL-06_techene_e3/src/OCE/DOM/dommsk.F90

    r12377 r12482  
    22   !!====================================================================== 
    33   !!                       ***  MODULE dommsk   *** 
    4    !! Ocean initialization : domain land/sea mask  
     4   !! Ocean initialization : domain land/sea mask 
    55   !!====================================================================== 
    66   !! History :  OPA  ! 1987-07  (G. Madec)  Original code 
     
    1818   !!            3.6  ! 2015-05  (P. Mathiot) ISF: add wmask,wumask and wvmask 
    1919   !!            4.0  ! 2016-06  (G. Madec, S. Flavoni)  domain configuration / user defined interface 
     20   !!            4.x  ! 2020-02  (G. Madec, S. Techene) introduce ssh to h0 ratio 
    2021   !!---------------------------------------------------------------------- 
    2122 
     
    4041   !                            !!* Namelist namlbc : lateral boundary condition * 
    4142   REAL(wp)        :: rn_shlat   ! type of lateral boundary condition on velocity 
    42    LOGICAL, PUBLIC :: ln_vorlat  !  consistency of vorticity boundary condition  
     43   LOGICAL, PUBLIC :: ln_vorlat  !  consistency of vorticity boundary condition 
    4344   !                                            with analytical eqs. 
    4445 
     
    4748   !!---------------------------------------------------------------------- 
    4849   !! NEMO/OCE 4.0 , NEMO Consortium (2018) 
    49    !! $Id$  
     50   !! $Id$ 
    5051   !! Software governed by the CeCILL license (see ./LICENSE) 
    5152   !!---------------------------------------------------------------------- 
     
    5960      !!      zontal velocity points (u & v), vorticity points (f) points. 
    6061      !! 
    61       !! ** Method  :   The ocean/land mask  at t-point is deduced from ko_top  
    62       !!      and ko_bot, the indices of the fist and last ocean t-levels which  
     62      !! ** Method  :   The ocean/land mask  at t-point is deduced from ko_top 
     63      !!      and ko_bot, the indices of the fist and last ocean t-levels which 
    6364      !!      are either defined in usrdef_zgr or read in zgr_read. 
    64       !!                The velocity masks (umask, vmask, wmask, wumask, wvmask)  
     65      !!                The velocity masks (umask, vmask, wmask, wumask, wvmask) 
    6566      !!      are deduced from a product of the two neighboring tmask. 
    6667      !!                The vorticity mask (fmask) is deduced from tmask taking 
     
    7778      !!                due to cyclic or North Fold boundaries as well as MPP halos. 
    7879      !! 
    79       !! ** Action :   tmask, umask, vmask, wmask, wumask, wvmask : land/ocean mask  
     80      !! ** Action :   tmask, umask, vmask, wmask, wumask, wvmask : land/ocean mask 
    8081      !!                         at t-, u-, v- w, wu-, and wv-points (=0. or 1.) 
    81       !!               fmask   : land/ocean mask at f-point (=0., or =1., or  
     82      !!               fmask   : land/ocean mask at f-point (=0., or =1., or 
    8283      !!                         =rn_shlat along lateral boundaries) 
    83       !!               tmask_i : interior ocean mask  
     84      !!               tmask_i : interior ocean mask 
    8485      !!               tmask_h : halo mask 
    8586      !!               ssmask , ssumask, ssvmask, ssfmask : 2D ocean mask 
     
    108109902   IF( ios >  0 )   CALL ctl_nam ( ios , 'namlbc in configuration namelist' ) 
    109110      IF(lwm) WRITE ( numond, namlbc ) 
    110        
     111 
    111112      IF(lwp) THEN                  ! control print 
    112113         WRITE(numout,*) 
     
    115116         WRITE(numout,*) '   Namelist namlbc' 
    116117         WRITE(numout,*) '      lateral momentum boundary cond.    rn_shlat  = ',rn_shlat 
    117          WRITE(numout,*) '      consistency with analytical form   ln_vorlat = ',ln_vorlat  
     118         WRITE(numout,*) '      consistency with analytical form   ln_vorlat = ',ln_vorlat 
    118119      ENDIF 
    119120      ! 
     
    140141      ! 
    141142      ! the following call is mandatory 
    142       ! it masks boundaries (bathy=0) where needed depending on the configuration (closed, periodic...)   
     143      ! it masks boundaries (bathy=0) where needed depending on the configuration (closed, periodic...) 
    143144      CALL lbc_lnk( 'dommsk', tmask  , 'T', 1._wp )      ! Lateral boundary conditions 
    144145 
     
    157158         END_3D 
    158159      ENDIF 
    159           
     160 
    160161      !  Ocean/land mask at u-, v-, and f-points   (computed from tmask) 
    161162      ! ---------------------------------------- 
     
    174175      END DO 
    175176      CALL lbc_lnk_multi( 'dommsk', umask, 'U', 1., vmask, 'V', 1., fmask, 'F', 1. )      ! Lateral boundary conditions 
    176   
     177 
    177178      ! Ocean/land mask at wu-, wv- and w points    (computed from tmask) 
    178179      !----------------------------------------- 
     
    182183      DO jk = 2, jpk                   ! interior values 
    183184         wmask (:,:,jk) = tmask(:,:,jk) * tmask(:,:,jk-1) 
    184          wumask(:,:,jk) = umask(:,:,jk) * umask(:,:,jk-1)    
     185         wumask(:,:,jk) = umask(:,:,jk) * umask(:,:,jk-1) 
    185186         wvmask(:,:,jk) = vmask(:,:,jk) * vmask(:,:,jk-1) 
    186187      END DO 
     
    192193      ssumask(:,:) = MAXVAL( umask(:,:,:), DIM=3 ) 
    193194      ssvmask(:,:) = MAXVAL( vmask(:,:,:), DIM=3 ) 
     195      ssfmask(:,:) = MAXVAL( fmask(:,:,:), DIM=3 ) 
    194196 
    195197 
     
    201203      ! 
    202204      !                          ! halo mask : 0 on the halo and 1 elsewhere 
    203       tmask_h(:,:) = 1._wp                   
     205      tmask_h(:,:) = 1._wp 
    204206      tmask_h( 1 :iif,   :   ) = 0._wp      ! first columns 
    205207      tmask_h(iil:jpi,   :   ) = 0._wp      ! last  columns (including mpp extra columns) 
     
    208210      ! 
    209211      !                          ! north fold mask 
    210       tpol(1:jpiglo) = 1._wp  
     212      tpol(1:jpiglo) = 1._wp 
    211213      fpol(1:jpiglo) = 1._wp 
    212214      IF( jperio == 3 .OR. jperio == 4 ) THEN      ! T-point pivot 
     
    225227      ENDIF 
    226228      ! 
    227       !                          ! interior mask : 2D ocean mask x halo mask  
     229      !                          ! interior mask : 2D ocean mask x halo mask 
    228230      tmask_i(:,:) = ssmask(:,:) * tmask_h(:,:) 
    229231 
    230232 
    231233      ! Lateral boundary conditions on velocity (modify fmask) 
    232       ! ---------------------------------------   
     234      ! --------------------------------------- 
    233235      IF( rn_shlat /= 0 ) THEN      ! Not free-slip lateral boundary condition 
    234236         ! 
     
    236238         ! 
    237239         DO jk = 1, jpk 
    238             zwf(:,:) = fmask(:,:,jk)          
     240            zwf(:,:) = fmask(:,:,jk) 
    239241            DO_2D_00_00 
    240242               IF( fmask(ji,jj,jk) == 0._wp ) THEN 
     
    250252                  fmask(jpi,jj,jk) = rn_shlat * MIN( 1._wp , MAX( zwf(jpi,jj+1), zwf(jpim1,jj), zwf(jpi,jj-1) ) ) 
    251253               ENDIF 
    252             END DO          
     254            END DO 
    253255            DO ji = 2, jpim1 
    254256               IF( fmask(ji,1,jk) == 0._wp ) THEN 
     
    259261               ENDIF 
    260262            END DO 
    261 #if defined key_agrif  
    262             IF( .NOT. AGRIF_Root() ) THEN  
    263                IF ((nbondi ==  1).OR.(nbondi == 2)) fmask(nlci-1 , :     ,jk) = 0.e0      ! east  
    264                IF ((nbondi == -1).OR.(nbondi == 2)) fmask(1      , :     ,jk) = 0.e0      ! west  
    265                IF ((nbondj ==  1).OR.(nbondj == 2)) fmask(:      ,nlcj-1 ,jk) = 0.e0      ! north  
    266                IF ((nbondj == -1).OR.(nbondj == 2)) fmask(:      ,1      ,jk) = 0.e0      ! south  
    267             ENDIF  
    268 #endif  
     263#if defined key_agrif 
     264            IF( .NOT. AGRIF_Root() ) THEN 
     265               IF ((nbondi ==  1).OR.(nbondi == 2)) fmask(nlci-1 , :     ,jk) = 0.e0      ! east 
     266               IF ((nbondi == -1).OR.(nbondi == 2)) fmask(1      , :     ,jk) = 0.e0      ! west 
     267               IF ((nbondj ==  1).OR.(nbondj == 2)) fmask(:      ,nlcj-1 ,jk) = 0.e0      ! north 
     268               IF ((nbondj == -1).OR.(nbondj == 2)) fmask(:      ,1      ,jk) = 0.e0      ! south 
     269            ENDIF 
     270#endif 
    269271         END DO 
    270272         ! 
     
    276278         ! 
    277279      ENDIF 
    278        
     280 
    279281      ! User defined alteration of fmask (use to reduce ocean transport in specified straits) 
    280       ! --------------------------------  
     282      ! -------------------------------- 
    281283      ! 
    282284      CALL usr_def_fmask( cn_cfg, nn_cfg, fmask ) 
    283285      ! 
    284286   END SUBROUTINE dom_msk 
    285     
     287 
    286288   !!====================================================================== 
    287289END MODULE dommsk 
Note: See TracChangeset for help on using the changeset viewer.