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/dev_r2586_dynamic_mem/NEMOGCM/NEMO/LIM_SRC_3 – NEMO

source: branches/dev_r2586_dynamic_mem/NEMOGCM/NEMO/LIM_SRC_3/limmsh.F90 @ 2612

Last change on this file since 2612 was 2612, checked in by gm, 13 years ago

dynamic mem: #785 ; LIM-3 case: changes required for compilation (continuation)

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