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.
limmsh.F90 in branches/UKMO/restart_datestamp/NEMOGCM/NEMO/LIM_SRC_3 – NEMO

source: branches/UKMO/restart_datestamp/NEMOGCM/NEMO/LIM_SRC_3/limmsh.F90 @ 5420

Last change on this file since 5420 was 5420, checked in by davestorkey, 9 years ago

Remove keyword updating from UKMO restart_datestamp branch.

File size: 5.8 KB
RevLine 
[825]1MODULE limmsh
2   !!======================================================================
3   !!                     ***  MODULE  limmsh  ***
4   !! LIM ice model :   definition of the ice mesh parameters
5   !!======================================================================
[1608]6   !! History :  3.2  !  2008-01 (NEMO team)  LIM-3: adaptation from LIM-2
7   !!----------------------------------------------------------------------
[825]8#if defined key_lim3
9   !!----------------------------------------------------------------------
[834]10   !!   'key_lim3'                                      LIM3 sea-ice model
[825]11   !!----------------------------------------------------------------------
[3625]12   !!   lim_msh       : definition of the ice mesh
[825]13   !!----------------------------------------------------------------------
[1608]14   USE phycst         ! physical constants
15   USE dom_oce        ! ocean domain
16   USE dom_ice        ! sea-ice domain
17   USE in_out_manager ! I/O manager
[2715]18   USE lbclnk         ! lateral boundary condition - MPP exchanges
19   USE lib_mpp        ! MPP library
[3625]20   USE lib_fortran    ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined) 
[825]21
22   IMPLICIT NONE
23   PRIVATE
24
[1608]25   PUBLIC   lim_msh   ! routine called by ice_ini.F90
[825]26
27   !!----------------------------------------------------------------------
[4161]28   !! NEMO/LIM3 4.0 , UCL - NEMO Consortium (2011)
[1156]29   !! $Id$
[2715]30   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
[825]31   !!----------------------------------------------------------------------
32CONTAINS
33
34   SUBROUTINE lim_msh
35      !!-------------------------------------------------------------------
36      !!                  ***  ROUTINE lim_msh  ***
37      !!             
38      !! ** Purpose : Definition of the charact. of the numerical grid
39      !!       
40      !! ** Action  : - Initialisation of some variables
41      !!              - Definition of some constants linked with the grid
42      !!              - Definition of the metric coef. for the sea/ice
43      !!              - Initialization of the ice masks (tmsk, umsk)
44      !!
[1608]45      !! Reference  : Deleersnijder et al. Ocean Modelling 100, 7-10
[825]46      !!---------------------------------------------------------------------
[1608]47      INTEGER  ::   ji, jj   ! dummy loop indices
[2715]48      REAL(wp) ::   zusden   ! local scalar
[825]49      !!---------------------------------------------------------------------
50
51      IF(lwp) THEN
52         WRITE(numout,*)
[1608]53         WRITE(numout,*) 'lim_msh : LIM-3 sea-ice model, mesh initialization'
[825]54         WRITE(numout,*) '~~~~~~~'
55      ENDIF
[921]56
[1923]57      IF( jphgr_msh == 2 .OR. jphgr_msh == 3 .OR. jphgr_msh == 5 )   &
[2715]58          &      CALL ctl_stop(' Coriolis parameter in LIM not set for f- or beta-plane')
[1923]59
[1608]60      !                           !==  coriolis factor & Equator position ==!
61      njeq   = INT( jpj / 2 ) 
[825]62      njeqm1 = njeq - 1 
[1608]63      !
64      fcor(:,:) = 2. * omega * SIN( gphit(:,:) * rad )   ! coriolis factor
65      !
[825]66      IF( fcor(1,1) * fcor(1,nlcj) < 0.e0 ) THEN   ! local domain include both hemisphere
67         l_jeq = .TRUE.
68         njeq  = 1
69         DO WHILE ( njeq <= jpj .AND. fcor(1,njeq) < 0.e0 )
70            njeq = njeq + 1
71         END DO
72         IF(lwp ) WRITE(numout,*) '          the equator is inside the domain at about njeq = ', njeq
73      ELSEIF( fcor(1,1) < 0.e0 ) THEN
74         l_jeq = .FALSE.
75         njeq = jpj
76         IF(lwp ) WRITE(numout,*) '          the model domain is entirely in the southern hemisphere: njeq = ', njeq
77      ELSE
78         l_jeq = .FALSE.
79         njeq = 2
80         IF(lwp ) WRITE(numout,*) '          the model domain is entirely in the northern hemisphere: njeq = ', njeq
81      ENDIF
[1608]82      !
[825]83      njeqm1 = njeq - 1
84
85
[1608]86      !                           !==  metric coefficients for sea ice dynamic  ==!
[825]87      wght(:,:,:,:) = 0.e0
[1608]88!!gm  Optimisation :  wght to be defined at F-point, not I-point  and change in limrhg
[825]89      DO jj = 2, jpj
90         DO ji = 2, jpi
[1608]91            zusden = 1.e0 / (  ( e1t(ji,jj) + e1t(ji-1,jj  ) )   &
92               &             * ( e2t(ji,jj) + e2t(ji  ,jj-1) ) )
[825]93            wght(ji,jj,1,1) = zusden * e1t(ji  ,jj) * e2t(ji,jj  )
94            wght(ji,jj,1,2) = zusden * e1t(ji  ,jj) * e2t(ji,jj-1)
95            wght(ji,jj,2,1) = zusden * e1t(ji-1,jj) * e2t(ji,jj  )
96            wght(ji,jj,2,2) = zusden * e1t(ji-1,jj) * e2t(ji,jj-1)
97         END DO
98      END DO
99      CALL lbc_lnk( wght(:,:,1,1), 'I', 1. )      ! CAUTION: even with the lbc_lnk at ice U-V-point
100      CALL lbc_lnk( wght(:,:,1,2), 'I', 1. )      ! the value of wght at jpj is wrong
101      CALL lbc_lnk( wght(:,:,2,1), 'I', 1. )      ! but it is never used
102      CALL lbc_lnk( wght(:,:,2,2), 'I', 1. )
[1608]103!!gm end
[921]104
[1608]105      !                           !==  ice masks  ==!
106      tms(:,:) = tmask(:,:,1)             ! ice T-point  : use surface tmask
107      tmu(:,:) = umask(:,:,1)             ! ice U-point  : use surface umask  (C-grid EVP)
108      tmv(:,:) = vmask(:,:,1)             ! ice V-point  : use surface vmask  (C-grid EVP)
109      DO jj = 1, jpjm1                    ! ice F-point  : recompute fmask (due to nn_shlat)
[1694]110         DO ji = 1 , jpim1   ! NO vector opt.
[1608]111            tmf(ji,jj) =  tms(ji,jj) * tms(ji+1,jj) * tms(ji,jj+1) * tms(ji+1,jj+1)
[825]112         END DO
113      END DO
[1608]114      CALL lbc_lnk( tmf(:,:), 'F', 1. )           ! lateral boundary conditions
[825]115
[1608]116      !                           !==  unmasked and masked area of T-grid cell
[825]117      area(:,:) = e1t(:,:) * e2t(:,:)
[1608]118      !
[825]119   END SUBROUTINE lim_msh
120
121#else
122   !!----------------------------------------------------------------------
123   !!   Default option            Dummy Module         NO LIM sea-ice model
124   !!----------------------------------------------------------------------
125CONTAINS
126   SUBROUTINE lim_msh           ! Dummy routine
127   END SUBROUTINE lim_msh
128#endif
129
130   !!======================================================================
131END MODULE limmsh
Note: See TracBrowser for help on using the repository browser.