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.
limdyn_2.F90 in branches/dev_1784_EVP/NEMO/LIM_SRC_2 – NEMO

source: branches/dev_1784_EVP/NEMO/LIM_SRC_2/limdyn_2.F90 @ 2119

Last change on this file since 2119 was 2095, checked in by cbricaud, 14 years ago

add correction from reviewer

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 13.2 KB
Line 
1MODULE limdyn_2
2   !!======================================================================
3   !!                     ***  MODULE  limdyn_2  ***
4   !!   Sea-Ice dynamics : 
5   !!======================================================================
6   !! History :   1.0  !  01-04  (LIM)  Original code
7   !!             2.0  !  02-08  (C. Ethe, G. Madec)  F90, mpp
8   !!             2.0  !  03-08  (C. Ethe) add lim_dyn_init
9   !!             2.0  !  06-07  (G. Madec)  Surface module
10   !!             3.3  !  09-05  (G.Garric, C. Bricaud) addition of the lim2_evp case
11   !!---------------------------------------------------------------------
12#if defined key_lim2
13   !!----------------------------------------------------------------------
14   !!   'key_lim2' :                                  LIM 2.0 sea-ice model
15   !!----------------------------------------------------------------------
16   !!    lim_dyn_2      : computes ice velocities
17   !!    lim_dyn_init_2 : initialization and namelist read
18   !!----------------------------------------------------------------------
19   USE dom_oce          ! ocean domain
20   USE sbc_oce          ! surface boundary condition variables
21   USE phycst           ! physical constant
22   USE ice_2            ! LIM2: ice variables
23   USE dom_ice_2        ! LIM2: ice domain
24   USE limistate_2      ! LIM2: ice initial state
25#if defined key_lim2_vp
26   USE limrhg_2         ! LIM2:  VP ice rheology
27#else
28   USE limrhg           ! LIM : EVP ice rheology
29#endif
30   USE lbclnk           ! lateral boundary condition - MPP exchanges
31   USE lib_mpp          ! MPP library
32   USE in_out_manager   ! I/O manager
33   USE prtctl           ! Print control
34
35   IMPLICIT NONE
36   PRIVATE
37
38   PUBLIC   lim_dyn_2   ! routine called by sbc_ice_lim module
39
40   REAL(wp) ::  rone = 1.e0   ! constant value
41
42#  include "vectopt_loop_substitute.h90"
43   !!----------------------------------------------------------------------
44   !! NEMO/LIM2 3.3, UCL-LOCEAN-IPSL (2010)
45   !! $Id$
46   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt)
47   !!----------------------------------------------------------------------
48CONTAINS
49
50   SUBROUTINE lim_dyn_2( kt )
51      !!-------------------------------------------------------------------
52      !!               ***  ROUTINE lim_dyn_2  ***
53      !!               
54      !! ** Purpose :   compute ice velocity and ocean-ice friction velocity
55      !!               
56      !! ** Method  :
57      !!
58      !! ** Action  : - Initialisation
59      !!              - Call of the dynamic routine for each hemisphere
60      !!              - computation of the friction velocity at the sea-ice base
61      !!              - treatment of the case if no ice dynamic
62      !!---------------------------------------------------------------------
63      INTEGER, INTENT(in) ::   kt     ! number of iteration
64      !!
65      INTEGER  ::   ji, jj             ! dummy loop indices
66      INTEGER  ::   i_j1, i_jpj        ! Starting/ending j-indices for rheology
67      REAL(wp) ::   zcoef              ! temporary scalar
68      REAL(wp), DIMENSION(jpj)     ::   zind           ! i-averaged indicator of sea-ice
69      REAL(wp), DIMENSION(jpj)     ::   zmsk           ! i-averaged of tmask
70      REAL(wp), DIMENSION(jpi,jpj) ::   zu_io, zv_io   ! ice-ocean velocity
71      !!---------------------------------------------------------------------
72
73      IF( kt == nit000 )   CALL lim_dyn_init_2   ! Initialization (first time-step only)
74     
75      IF( ln_limdyn ) THEN                     ! Rheology (ice dynamics)
76         !                                     ! ========
77         !         
78         hsnm(:,:)  = ( 1.0 - frld(:,:) ) * hsnif(:,:)   ! Mean ice and snow thicknesses
79         hicm(:,:)  = ( 1.0 - frld(:,:) ) * hicif(:,:)
80         !
81         !                                     ! Define the j-limits where ice rheology is computed
82         
83         IF( lk_mpp .OR. nbit_cmp == 1 ) THEN      !==  mpp: compute over the whole domain  ==!
84            i_j1 = 1   
85            i_jpj = jpj
86            IF(ln_ctl)   CALL prt_ctl_info( 'lim_dyn  :    i_j1 = ', ivar1=i_j1, clinfo2=' ij_jpj = ', ivar2=i_jpj )
87#if defined key_lim2_vp
88            CALL lim_rhg_2( i_j1, i_jpj )             !  VP rheology
89#else
90            CALL lim_rhg  ( i_j1, i_jpj )             ! EVP rheology
91#endif
92         ELSE                                      !==  optimization of the computational area  ==!
93            DO jj = 1, jpj
94               zind(jj) = SUM( frld (:,jj  ) )        ! = FLOAT(jpj) if ocean everywhere on a j-line
95               zmsk(jj) = SUM( tmask(:,jj,1) )        ! = 0          if land  everywhere on a j-line
96            END DO
97            !
98            IF( l_jeq ) THEN                          ! local domain include both hemisphere: rheology is computed
99               !                                      ! in each hemisphere only over the ice cover latitude strip
100               i_j1  = njeq                  ! Northern hemisphere
101               i_jpj = jpj
102               DO WHILE ( i_j1 <= jpj .AND. zind(i_j1) == FLOAT(jpi) .AND. zmsk(i_j1) /=0 )
103                  i_j1 = i_j1 + 1
104               END DO
105#if defined key_lim2_vp
106               i_j1 = MAX( 1, i_j1-1 )
107               IF(ln_ctl)   WRITE(numout,*) 'lim_dyn : NH i_j1 = ', i_j1, ' ij_jpj = ', i_jpj
108               !
109               CALL lim_rhg_2( i_j1, i_jpj )
110#else
111               i_j1 = MAX( 1, i_j1-2 )
112               IF(ln_ctl)   WRITE(numout,*) 'lim_dyn : NH i_j1 = ', i_j1, ' ij_jpj = ', i_jpj
113               CALL lim_rhg( i_j1, i_jpj )
114#endif
115               i_j1  =  1                    ! Southern hemisphere
116               i_jpj = njeq
117               DO WHILE ( i_jpj >= 1 .AND. zind(i_jpj) == FLOAT(jpi) .AND. zmsk(i_jpj) /=0 )
118                  i_jpj = i_jpj - 1
119               END DO
120#if defined key_lim2_vp
121               i_jpj = MIN( jpj, i_jpj+2 )
122               IF(ln_ctl)   WRITE(numout,*) 'lim_dyn : SH i_j1 = ', i_j1, ' ij_jpj = ', i_jpj
123               !
124               CALL lim_rhg_2( i_j1, i_jpj )
125#else
126               i_jpj = MIN( jpj, i_jpj+1 )
127               IF(ln_ctl)   WRITE(numout,*) 'lim_dyn : SH i_j1 = ', i_j1, ' ij_jpj = ', i_jpj
128               CALL lim_rhg( i_j1, i_jpj ) !!!!cbr CALL lim_rhg( i_j1, i_jpj, kt )
129#endif
130               !
131            ELSE                                      ! local domain extends over one hemisphere only: rheology is
132               !                                      ! computed only over the ice cover latitude strip
133               i_j1  = 1
134               DO WHILE ( i_j1 <= jpj .AND. zind(i_j1) == FLOAT(jpi) .AND. zmsk(i_j1) /=0 )
135                  i_j1 = i_j1 + 1
136               END DO
137               i_j1 = MAX( 1, i_j1-1 )
138               i_jpj  = jpj
139               DO WHILE ( i_jpj >= 1  .AND. zind(i_jpj) == FLOAT(jpi) .AND. zmsk(i_jpj) /=0 )
140                  i_jpj = i_jpj - 1
141               END DO
142               IF(ln_ctl)   WRITE(numout,*) 'lim_dyn : one hemisphere: i_j1 = ', i_j1, ' ij_jpj = ', i_jpj
143#if defined key_lim2_vp
144               i_jpj = MIN( jpj, i_jpj+2)
145               CALL lim_rhg_2( i_j1, i_jpj )                !  VP rheology
146#else
147               i_j1 = MAX( 1, i_j1-2 )
148               i_jpj = MIN( jpj, i_jpj+1)
149               CALL lim_rhg  ( i_j1, i_jpj )                ! EVP rheology
150#endif
151               !
152            ENDIF
153            !
154         ENDIF
155         !
156         IF(ln_ctl)   CALL prt_ctl(tab2d_1=u_ice , clinfo1=' lim_dyn  : u_ice :', tab2d_2=v_ice , clinfo2=' v_ice :')
157         !
158         
159         !                                     ! friction velocity
160         !                                     ! =================
161         SELECT CASE( cl_grid )
162         CASE( 'C' )                          ! C-grid ice dynamics (EVP)
163            zu_io(:,:) = u_ice(:,:) - ssu_m(:,:)      ! ice-ocean & ice velocity at ocean velocity points
164            zv_io(:,:) = v_ice(:,:) - ssv_m(:,:)
165            !
166         CASE( 'B' )                          ! B-grid ice dynamics (VP)
167            DO jj = 1, jpjm1                          ! ice velocity at I-point, ice-ocean velocity at ocean points
168               DO ji = 1, jpim1   ! NO vector opt.
169                  zu_io(ji,jj) = 0.5 * ( u_ice(ji+1,jj+1) + u_ice(ji+1,jj  ) ) - ssu_m(ji,jj)
170                  zv_io(ji,jj) = 0.5 * ( v_ice(ji+1,jj+1) + v_ice(ji  ,jj+1) ) - ssv_m(ji,jj)
171               END DO
172            END DO
173         END SELECT
174         !
175         DO jj = 2, jpjm1                     ! frictional velocity at T-point
176            DO ji = 2, jpim1   ! NO vector opt. because of zu_io
177               ust2s(ji,jj) = 0.5 * cw                                                          &
178                  &         * (  zu_io(ji,jj) * zu_io(ji,jj) + zu_io(ji-1,jj) * zu_io(ji-1,jj)   &
179                  &            + zv_io(ji,jj) * zv_io(ji,jj) + zv_io(ji,jj-1) * zv_io(ji,jj-1)   ) * tms(ji,jj)
180            END DO
181         END DO
182         !
183      ELSE                                     ! no ice dynamics : transmit directly the atmospheric stress to the ocean
184         !                                     ! ===============
185         zcoef = SQRT( 0.5 ) / rau0
186         DO jj = 2, jpjm1
187            DO ji = fs_2, fs_jpim1   ! vector opt.
188               ust2s(ji,jj) = zcoef * tms(ji,jj) * SQRT(  utau(ji,jj) * utau(ji,jj) + utau(ji-1,jj) * utau(ji-1,jj)   &
189                  &                                     + vtau(ji,jj) * vtau(ji,jj) + vtau(ji,jj-1) * vtau(ji,jj-1) )
190            END DO
191         END DO
192         !
193      ENDIF
194      !
195      CALL lbc_lnk( ust2s, 'T',  1. )   ! lateral boundary condition
196      !
197      IF(ln_ctl)   CALL prt_ctl(tab2d_1=ust2s , clinfo1=' lim_dyn  : ust2s :')
198      !
199   END SUBROUTINE lim_dyn_2
200
201
202   SUBROUTINE lim_dyn_init_2
203      !!-------------------------------------------------------------------
204      !!                  ***  ROUTINE lim_dyn_init_2  ***
205      !!
206      !! ** Purpose :   initialisation of  the ice dynamics variables
207      !!             
208      !! ** Method  :   Read the namicedyn namelist and check their values
209      !!
210      !! ** input   :   Namelist namicedyn
211      !!-------------------------------------------------------------------
212      NAMELIST/namicedyn/ epsd, alpha, dm, nbiter, nbitdr, om, resl, cw, angvg, pstar,   &
213         &                c_rhg, etamn, creepl, ecc, ahi0, nevp, telast, alphaevp
214      !!-------------------------------------------------------------------
215      !
216      REWIND ( numnam_ice )                       ! Read Namelist namicedyn
217      READ   ( numnam_ice  , namicedyn )
218      !
219      IF(lwp) THEN                                ! Control print
220         WRITE(numout,*)
221         WRITE(numout,*) 'lim_dyn_init_2: ice parameters for ice dynamics '
222         WRITE(numout,*) '~~~~~~~~~~~~~~'
223         WRITE(numout,*) '       tolerance parameter                              epsd   = ', epsd
224         WRITE(numout,*) '       coefficient for semi-implicit coriolis           alpha  = ', alpha
225         WRITE(numout,*) '       diffusion constant for dynamics                  dm     = ', dm
226         WRITE(numout,*) '       number of sub-time steps for relaxation          nbiter = ', nbiter
227         WRITE(numout,*) '       maximum number of iterations for relaxation      nbitdr = ', nbitdr
228         WRITE(numout,*) '       relaxation constant                              om     = ', om
229         WRITE(numout,*) '       maximum value for the residual of relaxation     resl   = ', resl
230         WRITE(numout,*) '       drag coefficient for oceanic stress              cw     = ', cw
231         WRITE(numout,*) '       turning angle for oceanic stress                 angvg  = ', angvg, ' degrees'
232         WRITE(numout,*) '       first bulk-rheology parameter                    pstar  = ', pstar
233         WRITE(numout,*) '       second bulk-rhelogy parameter                    c_rhg  = ', c_rhg
234         WRITE(numout,*) '       minimun value for viscosity                      etamn  = ', etamn
235         WRITE(numout,*) '       creep limit                                      creepl = ', creepl
236         WRITE(numout,*) '       eccentricity of the elliptical yield curve       ecc    = ', ecc
237         WRITE(numout,*) '       horizontal diffusivity coeff. for sea-ice        ahi0   = ', ahi0
238         WRITE(numout,*) '       number of iterations for subcycling              nevp   = ', nevp
239         WRITE(numout,*) '       timescale for elastic waves                      telast = ', telast
240         WRITE(numout,*) '       coefficient for the solution of int. stresses  alphaevp = ', alphaevp
241      ENDIF
242      !
243      !  Initialization
244      usecc2 = 1.0 / ( ecc * ecc )
245      rhoco  = rau0 * cw
246      angvg  = angvg * rad      ! convert angvg from degree to radian
247      sangvg = SIN( angvg )
248      cangvg = COS( angvg )
249      pstarh = pstar / 2.0
250      !
251      ahiu(:,:) = ahi0 * umask(:,:,1)            ! Ice eddy Diffusivity coefficients.
252      ahiv(:,:) = ahi0 * vmask(:,:,1)
253      !
254   END SUBROUTINE lim_dyn_init_2
255
256#else
257   !!----------------------------------------------------------------------
258   !!   Default option          Dummy module       NO LIM 2.0 sea-ice model
259   !!----------------------------------------------------------------------
260CONTAINS
261   SUBROUTINE lim_dyn_2         ! Dummy routine
262   END SUBROUTINE lim_dyn_2
263#endif 
264
265   !!======================================================================
266END MODULE limdyn_2
Note: See TracBrowser for help on using the repository browser.