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.
dommsk.F90 in branches/UKMO/dev_r5107_restart_func_and_date/NEMOGCM/NEMO/OFF_SRC – NEMO

source: branches/UKMO/dev_r5107_restart_func_and_date/NEMOGCM/NEMO/OFF_SRC/dommsk.F90 @ 5500

Last change on this file since 5500 was 5500, checked in by dancopsey, 9 years ago

Removed SVN keywords.

File size: 5.7 KB
RevLine 
[2053]1MODULE dommsk
[2444]2   !!======================================================================
[2053]3   !!                       ***  MODULE dommsk   ***
[2444]4   !! Ocean initialization : domain land/sea masks, off-line case
5   !!======================================================================
6   !! History :  3.3  ! 2010-10  (C. Ethe)  adapted from OPA_SRC/DOM/dommsk
7   !!----------------------------------------------------------------------
[2053]8
9   !!----------------------------------------------------------------------
10   !!   dom_msk        : compute land/ocean mask
11   !!----------------------------------------------------------------------
12   USE oce             ! ocean dynamics and tracers
13   USE dom_oce         ! ocean space and time domain
[2715]14   USE lib_mpp         ! MPP library
[2053]15   USE in_out_manager  ! I/O manager
[3294]16   USE wrk_nemo 
[5313]17   USE lbclnk 
[2053]18
19   IMPLICIT NONE
20   PRIVATE
21
[2444]22   PUBLIC   dom_msk    ! routine called by inidom.F90
[2053]23
[3294]24   REAL(wp)        :: rn_shlat   = 2.   ! type of lateral boundary condition on velocity
25   LOGICAL, PUBLIC :: ln_vorlat  = .false.   !  consistency of vorticity boundary condition
[2444]26
[2053]27   !! * Substitutions
28#  include "vectopt_loop_substitute.h90"
29   !!----------------------------------------------------------------------
[2287]30   !! NEMO/OFF 3.3 , NEMO Consortium (2010)
[5235]31   !! $Id$
[2444]32   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
[2053]33   !!----------------------------------------------------------------------
34CONTAINS
[2715]35
[2053]36   SUBROUTINE dom_msk
37      !!---------------------------------------------------------------------
38      !!                 ***  ROUTINE dom_msk  ***
39      !!
[2444]40      !! ** Purpose :   Off-line case: defines the interior domain T-mask.
[2053]41      !!
[2444]42      !! ** Method  :   The interior ocean/land mask is computed from tmask
43      !!              setting to zero the duplicated row and lines due to
44      !!              MPP exchange halos, est-west cyclic and north fold
45      !!              boundary conditions.
[2053]46      !!
[2444]47      !! ** Action :   tmask_i  : interiorland/ocean mask at t-point
48      !!               tpol     : ???
[2053]49      !!----------------------------------------------------------------------
[2715]50      !
[5313]51      INTEGER  ::   ji, jj, jk                   ! dummy loop indices
[2444]52      INTEGER  ::   iif, iil, ijf, ijl       ! local integers
[3294]53      INTEGER, POINTER, DIMENSION(:,:) ::  imsk 
54      !
[2053]55      !!---------------------------------------------------------------------
[3294]56     
57      CALL wrk_alloc( jpi, jpj, imsk )
[2444]58      !
[2053]59      ! Interior domain mask (used for global sum)
60      ! --------------------
[5208]61      ssmask(:,:)  = tmask(:,:,1)
[2053]62      tmask_i(:,:) = tmask(:,:,1)
[2444]63      iif = jpreci                        ! thickness of exchange halos in i-axis
[2053]64      iil = nlci - jpreci + 1
[2444]65      ijf = jprecj                        ! thickness of exchange halos in j-axis
[2053]66      ijl = nlcj - jprecj + 1
[2444]67      !
68      tmask_i( 1 :iif,   :   ) = 0._wp    ! first columns
69      tmask_i(iil:jpi,   :   ) = 0._wp    ! last  columns (including mpp extra columns)
70      tmask_i(   :   , 1 :ijf) = 0._wp    ! first rows
71      tmask_i(   :   ,ijl:jpj) = 0._wp    ! last  rows (including mpp extra rows)
72      !
73      !                                   ! north fold mask
74      tpol(1:jpiglo) = 1._wp
75      !                               
76      IF( jperio == 3 .OR. jperio == 4 )   tpol(jpiglo/2+1:jpiglo) = 0._wp    ! T-point pivot
77      IF( jperio == 5 .OR. jperio == 6 )   tpol(     1    :jpiglo) = 0._wp    ! F-point pivot
[2053]78      IF( jperio == 3 .OR. jperio == 4 ) THEN      ! T-point pivot: only half of the nlcj-1 row
[2444]79         IF( mjg(ijl-1) == jpjglo-1 ) THEN
80            DO ji = iif+1, iil-1
81               tmask_i(ji,ijl-1) = tmask_i(ji,ijl-1) * tpol(mig(ji))
82            END DO
83         ENDIF
[2053]84      ENDIF 
[2444]85      !
[5313]86      ! (ISF) MIN(1,SUM(umask)) is here to check if you have effectively at
87      ! least 1 wet u point
88      DO jj = 1, jpjm1
89         DO ji = 1, fs_jpim1   ! vector loop
90            umask_i(ji,jj)  = ssmask(ji,jj) * ssmask(ji+1,jj  )  * MIN(1._wp,SUM(umask(ji,jj,:)))
91            vmask_i(ji,jj)  = ssmask(ji,jj) * ssmask(ji  ,jj+1)  * MIN(1._wp,SUM(vmask(ji,jj,:)))
92         END DO
93         DO ji = 1, jpim1      ! NO vector opt.
94            fmask_i(ji,jj) =  ssmask(ji,jj  ) * ssmask(ji+1,jj  )   &
95               &            * ssmask(ji,jj+1) * ssmask(ji+1,jj+1) * MIN(1._wp,SUM(fmask(ji,jj,:)))
96         END DO
97      END DO
98      CALL lbc_lnk( umask_i, 'U', 1._wp )      ! Lateral boundary conditions
99      CALL lbc_lnk( vmask_i, 'V', 1._wp )
100      CALL lbc_lnk( fmask_i, 'F', 1._wp )
101
102      ! 3. Ocean/land mask at wu-, wv- and w points
103      !----------------------------------------------
104      wmask (:,:,1) = tmask(:,:,1) ! ????????
105      wumask(:,:,1) = umask(:,:,1) ! ????????
106      wvmask(:,:,1) = vmask(:,:,1) ! ????????
107      DO jk=2,jpk
108         wmask (:,:,jk)=tmask(:,:,jk) * tmask(:,:,jk-1)
109         wumask(:,:,jk)=umask(:,:,jk) * umask(:,:,jk-1)   
110         wvmask(:,:,jk)=vmask(:,:,jk) * vmask(:,:,jk-1)
111      END DO
112      !
[2444]113      IF( nprint == 1 .AND. lwp ) THEN    ! Control print
[2053]114         imsk(:,:) = INT( tmask_i(:,:) )
115         WRITE(numout,*) ' tmask_i : '
[2444]116         CALL prihin( imsk(:,:), jpi, jpj, 1, jpi, 1, 1, jpj, 1, 1, numout)
[2053]117         WRITE (numout,*)
118         WRITE (numout,*) ' dommsk: tmask for each level'
119         WRITE (numout,*) ' ----------------------------'
120         DO jk = 1, jpk
121            imsk(:,:) = INT( tmask(:,:,jk) )
122            WRITE(numout,*)
123            WRITE(numout,*) ' level = ',jk
[2444]124            CALL prihin( imsk(:,:), jpi, jpj, 1, jpi, 1, 1, jpj, 1, 1, numout)
[2053]125         END DO
126      ENDIF
[2444]127      !
[3294]128      CALL wrk_dealloc( jpi, jpj, imsk )
[2715]129      !
[2053]130   END SUBROUTINE dom_msk
[2444]131   !!======================================================================
[2053]132END MODULE dommsk
Note: See TracBrowser for help on using the repository browser.