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 7351 for branches/2016/dev_INGV_UKMO_2016/NEMOGCM/NEMO/OPA_SRC/DOM/dommsk.F90 – NEMO

Ignore:
Timestamp:
2016-11-28T17:04:10+01:00 (7 years ago)
Author:
emanuelaclementi
Message:

ticket #1805 step 3: /2016/dev_INGV_UKMO_2016 aligned to the trunk at revision 7161

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2016/dev_INGV_UKMO_2016/NEMOGCM/NEMO/OPA_SRC/DOM/dommsk.F90

    r5930 r7351  
    77   !!            6.0  ! 1993-03  (M. Guyon)  symetrical conditions (M. Guyon) 
    88   !!            7.0  ! 1996-01  (G. Madec)  suppression of common work arrays 
    9    !!             -   ! 1996-05  (G. Madec)  mask computed from tmask and sup- 
    10    !!                 !                      pression of the double computation of bmask 
     9   !!             -   ! 1996-05  (G. Madec)  mask computed from tmask 
    1110   !!            8.0  ! 1997-02  (G. Madec)  mesh information put in domhgr.F 
    1211   !!            8.1  ! 1997-07  (G. Madec)  modification of mbathy and fmask 
     
    2524   USE oce             ! ocean dynamics and tracers 
    2625   USE dom_oce         ! ocean space and time domain 
     26   ! 
    2727   USE in_out_manager  ! I/O manager 
    2828   USE lbclnk          ! ocean lateral boundary conditions (or mpp link) 
    29    USE lib_mpp 
     29   USE lib_mpp         ! 
    3030   USE wrk_nemo        ! Memory allocation 
    3131   USE timing          ! Timing 
     
    3434   PRIVATE 
    3535 
    36    PUBLIC   dom_msk         ! routine called by inidom.F90 
     36   PUBLIC   dom_msk    ! routine called by inidom.F90 
    3737 
    3838   !                            !!* Namelist namlbc : lateral boundary condition * 
     
    5555      !! 
    5656      !! ** Purpose :   Compute land/ocean mask arrays at tracer points, hori- 
    57       !!      zontal velocity points (u & v), vorticity points (f) and baro- 
    58       !!      tropic stream function  points (b). 
     57      !!      zontal velocity points (u & v), vorticity points (f) points. 
    5958      !! 
    6059      !! ** Method  :   The ocean/land mask is computed from the basin bathy- 
     
    7473      !!                1. IF mbathy( ji ,jj) and mbathy( ji ,jj+1) 
    7574      !!                  and mbathy(ji+1,jj) and mbathy(ji+1,jj+1) >= jk. 
    76       !!      b-point : the same definition as for f-point of the first ocean 
    77       !!                level (surface level) but with 0 along coastlines. 
    7875      !!      tmask_i : interior ocean mask at t-point, i.e. excluding duplicated 
    7976      !!                rows/lines due to cyclic or North Fold boundaries as well 
     
    8986      !! 
    9087      !!      N.B. If nperio not equal to 0, the land/ocean mask arrays 
    91       !!      are defined with the proper value at lateral domain boundaries, 
    92       !!      but bmask. indeed, bmask defined the domain over which the 
    93       !!      barotropic stream function is computed. this domain cannot 
    94       !!      contain identical columns because the matrix associated with 
    95       !!      the barotropic stream function equation is then no more inverti- 
    96       !!      ble. therefore bmask is set to 0 along lateral domain boundaries 
    97       !!      even IF nperio is not zero. 
     88      !!      are defined with the proper value at lateral domain boundaries. 
    9889      !! 
    9990      !!      In case of open boundaries (lk_bdy=T): 
    10091      !!        - tmask is set to 1 on the points to be computed bay the open 
    10192      !!          boundaries routines. 
    102       !!        - bmask is  set to 0 on the open boundaries. 
    10393      !! 
    10494      !! ** Action :   tmask    : land/ocean mask at t-point (=0. or 1.) 
     
    10797      !!               fmask    : land/ocean mask at f-point (=0. or 1.) 
    10898      !!                          =rn_shlat along lateral boundaries 
    109       !!               bmask    : land/ocean mask at barotropic stream 
    110       !!                          function point (=0. or 1.) and set to 0 along lateral boundaries 
    11199      !!               tmask_i  : interior ocean mask 
    112100      !!---------------------------------------------------------------------- 
     
    183171      ! -------------------- 
    184172      tmask_i(:,:) = ssmask(:,:)            ! (ISH) tmask_i = 1 even on the ice shelf 
     173 
     174      tmask_h(:,:) = 1._wp                 ! 0 on the halo and 1 elsewhere 
    185175      iif = jpreci                         ! ??? 
    186176      iil = nlci - jpreci + 1 
     
    188178      ijl = nlcj - jprecj + 1 
    189179 
    190       tmask_i( 1 :iif,   :   ) = 0._wp      ! first columns 
    191       tmask_i(iil:jpi,   :   ) = 0._wp      ! last  columns (including mpp extra columns) 
    192       tmask_i(   :   , 1 :ijf) = 0._wp      ! first rows 
    193       tmask_i(   :   ,ijl:jpj) = 0._wp      ! last  rows (including mpp extra rows) 
     180      tmask_h( 1 :iif,   :   ) = 0._wp      ! first columns 
     181      tmask_h(iil:jpi,   :   ) = 0._wp      ! last  columns (including mpp extra columns) 
     182      tmask_h(   :   , 1 :ijf) = 0._wp      ! first rows 
     183      tmask_h(   :   ,ijl:jpj) = 0._wp      ! last  rows (including mpp extra rows) 
    194184 
    195185      ! north fold mask 
     
    202192         IF( mjg(nlej) == jpjglo ) THEN                  ! only half of the nlcj-1 row 
    203193            DO ji = iif+1, iil-1 
    204                tmask_i(ji,nlej-1) = tmask_i(ji,nlej-1) * tpol(mig(ji)) 
     194               tmask_h(ji,nlej-1) = tmask_h(ji,nlej-1) * tpol(mig(ji)) 
    205195            END DO 
    206196         ENDIF 
    207197      ENDIF 
     198      
     199      tmask_i(:,:) = tmask_i(:,:) * tmask_h(:,:) 
     200 
    208201      IF( jperio == 5 .OR. jperio == 6 ) THEN      ! F-point pivot 
    209202         tpol(     1    :jpiglo) = 0._wp 
     
    225218         END DO 
    226219      END DO 
    227       ! (ISF) MIN(1,SUM(umask)) is here to check if you have effectively at least 1 wet u point 
     220      ! (ISF) MIN(1,SUM(umask)) is here to check if you have effectively at least 1 wet cell at u point 
    228221      DO jj = 1, jpjm1 
    229222         DO ji = 1, fs_jpim1   ! vector loop 
    230             umask_i(ji,jj)  = ssmask(ji,jj) * ssmask(ji+1,jj  )  * MIN(1._wp,SUM(umask(ji,jj,:))) 
    231             vmask_i(ji,jj)  = ssmask(ji,jj) * ssmask(ji  ,jj+1)  * MIN(1._wp,SUM(vmask(ji,jj,:))) 
     223            ssumask(ji,jj)  = ssmask(ji,jj) * ssmask(ji+1,jj  )  * MIN(1._wp,SUM(umask(ji,jj,:))) 
     224            ssvmask(ji,jj)  = ssmask(ji,jj) * ssmask(ji  ,jj+1)  * MIN(1._wp,SUM(vmask(ji,jj,:))) 
    232225         END DO 
    233226         DO ji = 1, jpim1      ! NO vector opt. 
    234             fmask_i(ji,jj) =  ssmask(ji,jj  ) * ssmask(ji+1,jj  )   & 
     227            ssfmask(ji,jj) =  ssmask(ji,jj  ) * ssmask(ji+1,jj  )   & 
    235228               &            * ssmask(ji,jj+1) * ssmask(ji+1,jj+1) * MIN(1._wp,SUM(fmask(ji,jj,:))) 
    236229         END DO 
    237230      END DO 
    238       CALL lbc_lnk( umask, 'U', 1._wp )      ! Lateral boundary conditions 
    239       CALL lbc_lnk( vmask, 'V', 1._wp ) 
    240       CALL lbc_lnk( fmask, 'F', 1._wp ) 
    241       CALL lbc_lnk( umask_i, 'U', 1._wp )      ! Lateral boundary conditions 
    242       CALL lbc_lnk( vmask_i, 'V', 1._wp ) 
    243       CALL lbc_lnk( fmask_i, 'F', 1._wp ) 
     231      CALL lbc_lnk( umask  , 'U', 1._wp )      ! Lateral boundary conditions 
     232      CALL lbc_lnk( vmask  , 'V', 1._wp ) 
     233      CALL lbc_lnk( fmask  , 'F', 1._wp ) 
     234      CALL lbc_lnk( ssumask, 'U', 1._wp )      ! Lateral boundary conditions 
     235      CALL lbc_lnk( ssvmask, 'V', 1._wp ) 
     236      CALL lbc_lnk( ssfmask, 'F', 1._wp ) 
    244237 
    245238      ! 3. Ocean/land mask at wu-, wv- and w points  
     
    253246         wvmask(:,:,jk) = vmask(:,:,jk) * vmask(:,:,jk-1) 
    254247      END DO 
    255  
    256       ! 4. ocean/land mask for the elliptic equation 
    257       ! -------------------------------------------- 
    258       bmask(:,:) = ssmask(:,:)       ! elliptic equation is written at t-point 
    259       ! 
    260       !                               ! Boundary conditions 
    261       !                                    ! cyclic east-west : bmask must be set to 0. on rows 1 and jpi 
    262       IF( nperio == 1 .OR. nperio == 4 .OR. nperio == 6 ) THEN 
    263          bmask( 1 ,:) = 0._wp 
    264          bmask(jpi,:) = 0._wp 
    265       ENDIF 
    266       IF( nperio == 2 ) THEN               ! south symmetric :  bmask must be set to 0. on row 1 
    267          bmask(:, 1 ) = 0._wp 
    268       ENDIF 
    269       !                                    ! north fold :  
    270       IF( nperio == 3 .OR. nperio == 4 ) THEN   ! T-pt pivot : bmask set to 0. on row jpj and on half jpjglo-1 row 
    271          DO ji = 1, jpi                       
    272             ii = ji + nimpp - 1 
    273             bmask(ji,jpj-1) = bmask(ji,jpj-1) * tpol(ii) 
    274             bmask(ji,jpj  ) = 0._wp 
    275          END DO 
    276       ENDIF 
    277       IF( nperio == 5 .OR. nperio == 6 ) THEN   ! F-pt pivot and T-pt elliptic eq. : bmask set to 0. on row jpj 
    278          bmask(:,jpj) = 0._wp 
    279       ENDIF 
    280       ! 
    281       IF( lk_mpp ) THEN                    ! mpp specificities 
    282          !                                      ! bmask is set to zero on the overlap region 
    283          IF( nbondi /= -1 .AND. nbondi /= 2 )   bmask(  1 :jpreci,:) = 0._wp 
    284          IF( nbondi /=  1 .AND. nbondi /= 2 )   bmask(nlci:jpi   ,:) = 0._wp 
    285          IF( nbondj /= -1 .AND. nbondj /= 2 )   bmask(:,  1 :jprecj) = 0._wp 
    286          IF( nbondj /=  1 .AND. nbondj /= 2 )   bmask(:,nlcj:jpj   ) = 0._wp 
    287          ! 
    288          IF( npolj == 3 .OR. npolj == 4 ) THEN  ! north fold : bmask must be set to 0. on rows jpj-1 and jpj 
    289             DO ji = 1, nlci 
    290                ii = ji + nimpp - 1 
    291                bmask(ji,nlcj-1) = bmask(ji,nlcj-1) * tpol(ii) 
    292                bmask(ji,nlcj  ) = 0._wp 
    293             END DO 
    294          ENDIF 
    295          IF( npolj == 5 .OR. npolj == 6 ) THEN  ! F-pt pivot and T-pt elliptic eq. : bmask set to 0. on row jpj 
    296             DO ji = 1, nlci 
    297                bmask(ji,nlcj  ) = 0._wp 
    298             END DO 
    299          ENDIF 
    300       ENDIF 
    301248 
    302249      ! Lateral boundary conditions on velocity (modify fmask) 
     
    399346      ! 
    400347      CALL lbc_lnk( fmask, 'F', 1._wp )      ! Lateral boundary conditions on fmask 
    401  
     348      ! 
    402349      ! CAUTION : The fmask may be further modified in dyn_vor_init ( dynvor.F90 ) 
    403              
    404       IF( nprint == 1 .AND. lwp ) THEN      ! Control print 
    405          imsk(:,:) = INT( tmask_i(:,:) ) 
    406          WRITE(numout,*) ' tmask_i : ' 
    407          CALL prihin( imsk(:,:), jpi, jpj, 1, jpi, 1,   & 
    408                &                           1, jpj, 1, 1, numout) 
    409          WRITE (numout,*) 
    410          WRITE (numout,*) ' dommsk: tmask for each level' 
    411          WRITE (numout,*) ' ----------------------------' 
    412          DO jk = 1, jpk 
    413             imsk(:,:) = INT( tmask(:,:,jk) ) 
    414  
    415             WRITE(numout,*) 
    416             WRITE(numout,*) ' level = ',jk 
    417             CALL prihin( imsk(:,:), jpi, jpj, 1, jpi, 1,   & 
    418                &                              1, jpj, 1, 1, numout) 
    419          END DO 
    420          WRITE(numout,*) 
    421          WRITE(numout,*) ' dom_msk: vmask for each level' 
    422          WRITE(numout,*) ' -----------------------------' 
    423          DO jk = 1, jpk 
    424             imsk(:,:) = INT( vmask(:,:,jk) ) 
    425             WRITE(numout,*) 
    426             WRITE(numout,*) ' level = ',jk 
    427             CALL prihin( imsk(:,:), jpi, jpj, 1, jpi, 1,   & 
    428                &                              1, jpj, 1, 1, numout) 
    429          END DO 
    430          WRITE(numout,*) 
    431          WRITE(numout,*) ' dom_msk: fmask for each level' 
    432          WRITE(numout,*) ' -----------------------------' 
    433          DO jk = 1, jpk 
    434             imsk(:,:) = INT( fmask(:,:,jk) ) 
    435             WRITE(numout,*) 
    436             WRITE(numout,*) ' level = ',jk 
    437             CALL prihin( imsk(:,:), jpi, jpj, 1, jpi, 1,   & 
    438                &                              1, jpj, 1, 1, numout ) 
    439          END DO 
    440          WRITE(numout,*) 
    441          WRITE(numout,*) ' dom_msk: bmask ' 
    442          WRITE(numout,*) ' ---------------' 
    443          WRITE(numout,*) 
    444          imsk(:,:) = INT( bmask(:,:) ) 
    445          CALL prihin( imsk(:,:), jpi, jpj, 1, jpi, 1,   & 
    446             &                              1, jpj, 1, 1, numout ) 
    447       ENDIF 
    448350      ! 
    449351      CALL wrk_dealloc( jpi, jpj, imsk ) 
Note: See TracChangeset for help on using the changeset viewer.