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.
limrhg.F90 in trunk/NEMOGCM/NEMO/LIM_SRC_3 – NEMO

source: trunk/NEMOGCM/NEMO/LIM_SRC_3/limrhg.F90 @ 2665

Last change on this file since 2665 was 2580, checked in by cbricaud, 13 years ago

Corrections for EVP rheology in LIM2: add missing lines in limrhg.F90 and change parameters for ORCA2 in namelist_ice_lim2

  • Property svn:keywords set to Id
File size: 37.0 KB
Line 
1MODULE limrhg
2   !!======================================================================
3   !!                     ***  MODULE  limrhg  ***
4   !!   Ice rheology : sea ice rheology
5   !!======================================================================
6   !! History :   -   !  2007-03  (M.A. Morales Maqueda, S. Bouillon) Original code
7   !!            3.0  !  2008-03  (M. Vancoppenolle) LIM3
8   !!             -   !  2008-11  (M. Vancoppenolle, S. Bouillon, Y. Aksenov) add surface tilt in ice rheolohy
9   !!            3.3  !  2009-05  (G.Garric) addition of the lim2_evp cas
10   !!----------------------------------------------------------------------
11#if defined key_lim3 || (  defined key_lim2 && ! defined key_lim2_vp )
12   !!----------------------------------------------------------------------
13   !!   'key_lim3'               OR                     LIM-3 sea-ice model
14   !!   'key_lim2' AND NOT 'key_lim2_vp'             VP LIM-2 sea-ice model
15   !!----------------------------------------------------------------------
16   !!   lim_rhg   : computes ice velocities
17   !!----------------------------------------------------------------------
18   USE phycst           ! Physical constant
19   USE par_oce          ! Ocean parameters
20   USE dom_oce          ! Ocean domain
21   USE sbc_oce          ! Surface boundary condition: ocean fields
22   USE sbc_ice          ! Surface boundary condition: ice fields
23   USE lbclnk           ! Lateral Boundary Condition / MPP link
24   USE lib_mpp          ! MPP library
25   USE in_out_manager   ! I/O manager
26   USE prtctl           ! Print control
27#if defined key_lim3
28   USE ice              ! LIM-3: ice variables
29   USE dom_ice          ! LIM-3: ice domain
30   USE limitd_me        ! LIM-3:
31#else
32   USE ice_2            ! LIM2: ice variables
33   USE dom_ice_2        ! LIM2: ice domain
34#endif
35
36   IMPLICIT NONE
37   PRIVATE
38
39   PUBLIC   lim_rhg   ! routine called by lim_dyn (or lim_dyn_2)
40
41   REAL(wp) ::   rzero   = 0._wp   ! constant values
42   REAL(wp) ::   rone    = 1._wp   ! constant values
43     
44   !! * Substitutions
45#  include "vectopt_loop_substitute.h90"
46   !!----------------------------------------------------------------------
47   !! NEMO/LIM3 3.3 , UCL - NEMO Consortium (2010)
48   !! $Id$
49   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
50   !!----------------------------------------------------------------------
51CONTAINS
52
53   SUBROUTINE lim_rhg( k_j1, k_jpj )
54      !!-------------------------------------------------------------------
55      !!                 ***  SUBROUTINE lim_rhg  ***
56      !!                          EVP-C-grid
57      !!
58      !! ** purpose : determines sea ice drift from wind stress, ice-ocean
59      !!  stress and sea-surface slope. Ice-ice interaction is described by
60      !!  a non-linear elasto-viscous-plastic (EVP) law including shear
61      !!  strength and a bulk rheology (Hunke and Dukowicz, 2002).   
62      !!
63      !!  The points in the C-grid look like this, dear reader
64      !!
65      !!                              (ji,jj)
66      !!                                 |
67      !!                                 |
68      !!                      (ji-1,jj)  |  (ji,jj)
69      !!                             ---------   
70      !!                            |         |
71      !!                            | (ji,jj) |------(ji,jj)
72      !!                            |         |
73      !!                             ---------   
74      !!                     (ji-1,jj-1)     (ji,jj-1)
75      !!
76      !! ** Inputs  : - wind forcing (stress), oceanic currents
77      !!                ice total volume (vt_i) per unit area
78      !!                snow total volume (vt_s) per unit area
79      !!
80      !! ** Action  : - compute u_ice, v_ice : the components of the
81      !!                sea-ice velocity vector
82      !!              - compute delta_i, shear_i, divu_i, which are inputs
83      !!                of the ice thickness distribution
84      !!
85      !! ** Steps   : 1) Compute ice snow mass, ice strength
86      !!              2) Compute wind, oceanic stresses, mass terms and
87      !!                 coriolis terms of the momentum equation
88      !!              3) Solve the momentum equation (iterative procedure)
89      !!              4) Prevent high velocities if the ice is thin
90      !!              5) Recompute invariants of the strain rate tensor
91      !!                 which are inputs of the ITD, store stress
92      !!                 for the next time step
93      !!              6) Control prints of residual (convergence)
94      !!                 and charge ellipse.
95      !!                 The user should make sure that the parameters
96      !!                 nevp, telast and creepl maintain stress state
97      !!                 on the charge ellipse for plastic flow
98      !!                 e.g. in the Canadian Archipelago
99      !!
100      !! References : Hunke and Dukowicz, JPO97
101      !!              Bouillon et al., Ocean Modelling 2009
102      !!              Vancoppenolle et al., Ocean Modelling 2008
103      !!-------------------------------------------------------------------
104      INTEGER, INTENT(in) ::   k_j1    ! southern j-index for ice computation
105      INTEGER, INTENT(in) ::   k_jpj   ! northern j-index for ice computation
106      !!
107      INTEGER ::   ji, jj   ! dummy loop indices
108      INTEGER ::   jter     ! local integers
109      CHARACTER (len=50) ::   charout
110      REAL(wp) ::   zt11, zt12, zt21, zt22, ztagnx, ztagny, delta                         !
111      REAL(wp) ::   za, zstms, zsang, zmask   ! local scalars
112
113      REAL(wp),DIMENSION(jpi,jpj) :: &
114         zpresh        ,             & !: temporary array for ice strength
115         zpreshc       ,             & !: Ice strength on grid cell corners (zpreshc)
116         zfrld1, zfrld2,             & !: lead fraction on U/V points                                   
117         zmass1, zmass2,             & !: ice/snow mass on U/V points                                   
118         zcorl1, zcorl2,             & !: coriolis parameter on U/V points
119         za1ct, za2ct  ,             & !: temporary arrays
120         zc1           ,             & !: ice mass
121         zusw          ,             & !: temporary weight for the computation
122                                !: of ice strength
123         u_oce1, v_oce1,             & !: ocean u/v component on U points                           
124         u_oce2, v_oce2,             & !: ocean u/v component on V points
125         u_ice2,                     & !: ice u component on V point
126         v_ice1                        !: ice v component on U point
127
128      REAL(wp) :: &
129         dtevp,                      & ! time step for subcycling
130         dtotel,                     & !
131         ecc2,                       & ! square of yield ellipse eccenticity
132         z0,                         & ! temporary scalar
133         zr,                         & ! temporary scalar
134         zcca, zccb,                 & ! temporary scalars
135         zu_ice2,                    & !
136         zv_ice1,                    & !
137         zddc, zdtc,                 & ! temporary array for delta on corners
138         zdst,                       & ! temporary array for delta on centre
139         zdsshx, zdsshy,             & ! term for the gradient of ocean surface
140         sigma1, sigma2                ! internal ice stress
141
142      REAL(wp),DIMENSION(jpi,jpj) ::   zf1, zf2   ! arrays for internal stresses
143
144      REAL(wp),DIMENSION(jpi,jpj) :: &
145         zdd, zdt,                   & ! Divergence and tension at centre of grid cells
146         zds,                        & ! Shear on northeast corner of grid cells
147         deltat,                     & ! Delta at centre of grid cells
148         deltac,                     & ! Delta on corners
149         zs1, zs2,                   & ! Diagonal stress tensor components zs1 and zs2
150         zs12                          ! Non-diagonal stress tensor component zs12
151
152      REAL(wp) :: &
153         zresm            ,          & ! Maximal error on ice velocity
154         zindb            ,          & ! ice (1) or not (0)     
155         zdummy                        ! dummy argument
156
157      REAL(wp),DIMENSION(jpi,jpj) ::   zu_ice, zv_ice, zresr   ! Local error on velocity
158      !!-------------------------------------------------------------------
159#if  defined key_lim2 && ! defined key_lim2_vp
160# if defined key_agrif
161     USE ice_2, vt_s => hsnm
162     USE ice_2, vt_i => hicm
163# else
164     vt_s => hsnm
165     vt_i => hicm
166# endif
167     at_i(:,:) = 1. - frld(:,:)
168#endif
169      !
170      !------------------------------------------------------------------------------!
171      ! 1) Ice-Snow mass (zc1), ice strength (zpresh)                                !
172      !------------------------------------------------------------------------------!
173      !
174      ! Put every vector to 0
175      zpresh (:,:) = 0._wp   ;   zc1   (:,:) = 0._wp
176      zpreshc(:,:) = 0._wp
177      u_ice2 (:,:) = 0._wp   ;   v_ice1(:,:) = 0._wp
178      zdd    (:,:) = 0._wp   ;   zdt   (:,:) = 0._wp   ;   zds(:,:) = 0._wp
179
180#if defined key_lim3
181      CALL lim_itd_me_icestrength( ridge_scheme_swi )      ! LIM-3: Ice strength on T-points
182#endif
183
184!CDIR NOVERRCHK
185      DO jj = k_j1 , k_jpj       ! Ice mass and temp variables
186!CDIR NOVERRCHK
187         DO ji = 1 , jpi
188            zc1(ji,jj)    = tms(ji,jj) * ( rhosn * vt_s(ji,jj) + rhoic * vt_i(ji,jj) )
189#if defined key_lim3
190            zpresh(ji,jj) = tms(ji,jj) *  strength(ji,jj) * 0.5_wp
191#endif
192#if defined key_lim2
193            zpresh(ji,jj) = tms(ji,jj) *  pstar * vt_i(ji,jj) * EXP( -c_rhg * (1. - at_i(ji,jj) ) )
194#endif
195            ! tmi = 1 where there is ice or on land
196            tmi(ji,jj)    = 1._wp - ( 1._wp - MAX( 0._wp , SIGN ( 1._wp , vt_i(ji,jj) - epsd ) ) ) * tms(ji,jj)
197         END DO
198      END DO
199
200      ! Ice strength on grid cell corners (zpreshc)
201      ! needed for calculation of shear stress
202!CDIR NOVERRCHK
203      DO jj = k_j1+1, k_jpj-1
204!CDIR NOVERRCHK
205         DO ji = 2, jpim1 !RB caution no fs_ (ji+1,jj+1)
206            zstms          =  tms(ji+1,jj+1) * wght(ji+1,jj+1,2,2) + &
207               &              tms(ji,jj+1)   * wght(ji+1,jj+1,1,2) + &
208               &              tms(ji+1,jj)   * wght(ji+1,jj+1,2,1) + &
209               &              tms(ji,jj)     * wght(ji+1,jj+1,1,1)
210            zusw(ji,jj)    = 1.0 / MAX( zstms, epsd )
211            zpreshc(ji,jj) = (  zpresh(ji+1,jj+1) * wght(ji+1,jj+1,2,2) + &
212               &                zpresh(ji,jj+1)   * wght(ji+1,jj+1,1,2) + &
213               &                zpresh(ji+1,jj)   * wght(ji+1,jj+1,2,1) + & 
214               &                zpresh(ji,jj)     * wght(ji+1,jj+1,1,1)   &
215               &             ) * zusw(ji,jj)
216         END DO
217      END DO
218
219      CALL lbc_lnk( zpreshc(:,:), 'F', 1. )
220      !
221      !------------------------------------------------------------------------------!
222      ! 2) Wind / ocean stress, mass terms, coriolis terms
223      !------------------------------------------------------------------------------!
224      !
225      !  Wind stress, coriolis and mass terms on the sides of the squares       
226      !  zfrld1: lead fraction on U-points                                     
227      !  zfrld2: lead fraction on V-points                                     
228      !  zmass1: ice/snow mass on U-points                                   
229      !  zmass2: ice/snow mass on V-points                                   
230      !  zcorl1: Coriolis parameter on U-points                             
231      !  zcorl2: Coriolis parameter on V-points                           
232      !  (ztagnx,ztagny): wind stress on U/V points                       
233      !  u_oce1: ocean u component on u points                           
234      !  v_oce1: ocean v component on u points                         
235      !  u_oce2: ocean u component on v points                         
236      !  v_oce2: ocean v component on v points                       
237
238      DO jj = k_j1+1, k_jpj-1
239         DO ji = fs_2, fs_jpim1
240
241            zt11 = tms(ji  ,jj) * e1t(ji  ,jj)
242            zt12 = tms(ji+1,jj) * e1t(ji+1,jj)
243            zt21 = tms(ji,jj  ) * e2t(ji,jj  )
244            zt22 = tms(ji,jj+1) * e2t(ji,jj+1)
245
246            ! Leads area.
247            zfrld1(ji,jj) = ( zt12 * ( 1.0 - at_i(ji,jj) ) + zt11 * ( 1.0 - at_i(ji+1,jj) ) ) / ( zt11 + zt12 + epsd )
248            zfrld2(ji,jj) = ( zt22 * ( 1.0 - at_i(ji,jj) ) + zt21 * ( 1.0 - at_i(ji,jj+1) ) ) / ( zt21 + zt22 + epsd )
249
250            ! Mass, coriolis coeff. and currents
251            zmass1(ji,jj) = ( zt12*zc1(ji,jj) + zt11*zc1(ji+1,jj) ) / (zt11+zt12+epsd)
252            zmass2(ji,jj) = ( zt22*zc1(ji,jj) + zt21*zc1(ji,jj+1) ) / (zt21+zt22+epsd)
253            zcorl1(ji,jj) = zmass1(ji,jj) * ( e1t(ji+1,jj)*fcor(ji,jj) + e1t(ji,jj)*fcor(ji+1,jj) )   &
254               &                          / ( e1t(ji,jj) + e1t(ji+1,jj) + epsd )
255            zcorl2(ji,jj) = zmass2(ji,jj) * ( e2t(ji,jj+1)*fcor(ji,jj) + e2t(ji,jj)*fcor(ji,jj+1) )   &
256               &                          / ( e2t(ji,jj+1) + e2t(ji,jj) + epsd )
257            !
258            u_oce1(ji,jj)  = u_oce(ji,jj)
259            v_oce2(ji,jj)  = v_oce(ji,jj)
260
261            ! Ocean has no slip boundary condition
262            v_oce1(ji,jj)  = 0.5*( (v_oce(ji,jj)+v_oce(ji,jj-1))*e1t(ji,jj)    &
263               &                 +(v_oce(ji+1,jj)+v_oce(ji+1,jj-1))*e1t(ji+1,jj)) &
264               &               /(e1t(ji+1,jj)+e1t(ji,jj)) * tmu(ji,jj) 
265
266            u_oce2(ji,jj)  = 0.5*((u_oce(ji,jj)+u_oce(ji-1,jj))*e2t(ji,jj)     &
267               &                 +(u_oce(ji,jj+1)+u_oce(ji-1,jj+1))*e2t(ji,jj+1)) &
268               &                / (e2t(ji,jj+1)+e2t(ji,jj)) * tmv(ji,jj)
269
270            ! Wind stress at U,V-point
271            ztagnx = ( 1. - zfrld1(ji,jj) ) * utau_ice(ji,jj)
272            ztagny = ( 1. - zfrld2(ji,jj) ) * vtau_ice(ji,jj)
273
274            ! Computation of the velocity field taking into account the ice internal interaction.
275            ! Terms that are independent of the velocity field.
276
277            ! SB On utilise maintenant le gradient de la pente de l'ocean
278            ! include it later
279
280            zdsshx =  ( ssh_m(ji+1,jj) - ssh_m(ji,jj) ) / e1u(ji,jj)
281            zdsshy =  ( ssh_m(ji,jj+1) - ssh_m(ji,jj) ) / e2v(ji,jj)
282
283            za1ct(ji,jj) = ztagnx - zmass1(ji,jj) * grav * zdsshx
284            za2ct(ji,jj) = ztagny - zmass2(ji,jj) * grav * zdsshy
285
286         END DO
287      END DO
288
289      !
290      !------------------------------------------------------------------------------!
291      ! 3) Solution of the momentum equation, iterative procedure
292      !------------------------------------------------------------------------------!
293      !
294      ! Time step for subcycling
295      dtevp  = rdt_ice / nevp
296      dtotel = dtevp / ( 2._wp * telast )
297
298      !-ecc2: square of yield ellipse eccenticrity (reminder: must become a namelist parameter)
299      ecc2 = ecc * ecc
300
301      !-Initialise stress tensor
302      zs1 (:,:) = stress1_i (:,:) 
303      zs2 (:,:) = stress2_i (:,:)
304      zs12(:,:) = stress12_i(:,:)
305
306      !                                               !----------------------!
307      DO jter = 1 , nevp                              !    loop over jter    !
308         !                                            !----------------------!       
309         DO jj = k_j1, k_jpj-1
310            zu_ice(:,jj) = u_ice(:,jj)    ! velocity at previous time step
311            zv_ice(:,jj) = v_ice(:,jj)
312         END DO
313
314         DO jj = k_j1+1, k_jpj-1
315            DO ji = fs_2, jpim1   !RB bug no vect opt due to tmi
316
317               
318               !- Divergence, tension and shear (Section a. Appendix B of Hunke & Dukowicz, 2002)
319               !- zdd(:,:), zdt(:,:): divergence and tension at centre of grid cells
320               !- zds(:,:): shear on northeast corner of grid cells
321               !
322               !- IMPORTANT REMINDER: Dear Gurvan, note that, the way these terms are coded,
323               !                      there are many repeated calculations.
324               !                      Speed could be improved by regrouping terms. For
325               !                      the moment, however, the stress is on clarity of coding to avoid
326               !                      bugs (Martin, for Miguel).
327               !
328               !- ALSO: arrays zdd, zdt, zds and delta could
329               !  be removed in the future to minimise memory demand.
330               !
331               !- MORE NOTES: Note that we are calculating deformation rates and stresses on the corners of
332               !              grid cells, exactly as in the B grid case. For simplicity, the indexation on
333               !              the corners is the same as in the B grid.
334               !
335               !
336               zdd(ji,jj) = ( e2u(ji,jj)*u_ice(ji,jj)                      &
337                  &          -e2u(ji-1,jj)*u_ice(ji-1,jj)                  &
338                  &          +e1v(ji,jj)*v_ice(ji,jj)                      &
339                  &          -e1v(ji,jj-1)*v_ice(ji,jj-1)                  &
340                  &          )                                             &
341                  &         / area(ji,jj)
342
343               zdt(ji,jj) = ( ( u_ice(ji,jj)/e2u(ji,jj)                    &
344                  &            -u_ice(ji-1,jj)/e2u(ji-1,jj)                &
345                  &           )*e2t(ji,jj)*e2t(ji,jj)                      &
346                  &          -( v_ice(ji,jj)/e1v(ji,jj)                    &
347                  &            -v_ice(ji,jj-1)/e1v(ji,jj-1)                &
348                  &           )*e1t(ji,jj)*e1t(ji,jj)                      &
349                  &         )                                              &
350                  &        / area(ji,jj)
351
352               !
353               zds(ji,jj) = ( ( u_ice(ji,jj+1)/e1u(ji,jj+1)                &
354                  &            -u_ice(ji,jj)/e1u(ji,jj)                    &
355                  &           )*e1f(ji,jj)*e1f(ji,jj)                      &
356                  &          +( v_ice(ji+1,jj)/e2v(ji+1,jj)                &
357                  &            -v_ice(ji,jj)/e2v(ji,jj)                    &
358                  &           )*e2f(ji,jj)*e2f(ji,jj)                      &
359                  &         )                                              &
360                  &        / ( e1f(ji,jj) * e2f(ji,jj) ) * ( 2.0 - tmf(ji,jj) ) &
361                  &        * tmi(ji,jj) * tmi(ji,jj+1)                     &
362                  &        * tmi(ji+1,jj) * tmi(ji+1,jj+1)
363
364
365               v_ice1(ji,jj)  = 0.5*( (v_ice(ji,jj)+v_ice(ji,jj-1))*e1t(ji+1,jj)   &
366                  &                 +(v_ice(ji+1,jj)+v_ice(ji+1,jj-1))*e1t(ji,jj)) &
367                  &               /(e1t(ji+1,jj)+e1t(ji,jj)) * tmu(ji,jj) 
368
369               u_ice2(ji,jj)  = 0.5*( (u_ice(ji,jj)+u_ice(ji-1,jj))*e2t(ji,jj+1)   &
370                  &                 +(u_ice(ji,jj+1)+u_ice(ji-1,jj+1))*e2t(ji,jj)) &
371                  &               /(e2t(ji,jj+1)+e2t(ji,jj)) * tmv(ji,jj)
372
373            END DO
374         END DO
375         CALL lbc_lnk( v_ice1, 'U', -1. )   ;   CALL lbc_lnk( u_ice2, 'V', -1. )      ! lateral boundary cond.
376
377!CDIR NOVERRCHK
378         DO jj = k_j1+1, k_jpj-1
379!CDIR NOVERRCHK
380            DO ji = fs_2, fs_jpim1
381
382               !- Calculate Delta at centre of grid cells
383               zdst       = (  e2u(ji  , jj) * v_ice1(ji  ,jj)          &
384                  &          - e2u(ji-1, jj) * v_ice1(ji-1,jj)          &
385                  &          + e1v(ji, jj  ) * u_ice2(ji,jj  )          &
386                  &          - e1v(ji, jj-1) * u_ice2(ji,jj-1)          &
387                  &          )                                          &
388                  &         / area(ji,jj)
389
390               delta = SQRT( zdd(ji,jj)*zdd(ji,jj) + ( zdt(ji,jj)*zdt(ji,jj) + zdst*zdst ) * usecc2 ) 
391               deltat(ji,jj) = MAX( SQRT(zdd(ji,jj)**2 + (zdt(ji,jj)**2 + zdst**2)*usecc2), creepl )
392
393               !-Calculate stress tensor components zs1 and zs2
394               !-at centre of grid cells (see section 3.5 of CICE user's guide).
395               zs1(ji,jj) = ( zs1(ji,jj) &
396                  &          - dtotel*( ( 1.0 - alphaevp) * zs1(ji,jj) +    &
397                  &            ( delta / deltat(ji,jj) - zdd(ji,jj) / deltat(ji,jj) ) &
398                  * zpresh(ji,jj) ) )                          &       
399                  &        / ( 1.0 + alphaevp * dtotel )
400
401               zs2(ji,jj) = ( zs2(ji,jj)   &
402                  &          - dtotel*((1.0-alphaevp)*ecc2*zs2(ji,jj) -  &
403                  zdt(ji,jj)/deltat(ji,jj)*zpresh(ji,jj)) ) &
404                  &        / ( 1.0 + alphaevp*ecc2*dtotel )
405
406            END DO
407         END DO
408
409         CALL lbc_lnk( zs1(:,:), 'T', 1. )
410         CALL lbc_lnk( zs2(:,:), 'T', 1. )
411
412!CDIR NOVERRCHK
413         DO jj = k_j1+1, k_jpj-1
414!CDIR NOVERRCHK
415            DO ji = fs_2, fs_jpim1
416               !- Calculate Delta on corners
417               zddc  =      ( ( v_ice1(ji,jj+1)/e1u(ji,jj+1)                &
418                  &            -v_ice1(ji,jj)/e1u(ji,jj)                    &
419                  &           )*e1f(ji,jj)*e1f(ji,jj)                       &
420                  &          +( u_ice2(ji+1,jj)/e2v(ji+1,jj)                &
421                  &            -u_ice2(ji,jj)/e2v(ji,jj)                    &
422                  &           )*e2f(ji,jj)*e2f(ji,jj)                       &
423                  &         )                                               &
424                  &        / ( e1f(ji,jj) * e2f(ji,jj) )
425
426               zdtc  =      (-( v_ice1(ji,jj+1)/e1u(ji,jj+1)                &
427                  &            -v_ice1(ji,jj)/e1u(ji,jj)                    &
428                  &           )*e1f(ji,jj)*e1f(ji,jj)                       &
429                  &          +( u_ice2(ji+1,jj)/e2v(ji+1,jj)                &
430                  &            -u_ice2(ji,jj)/e2v(ji,jj)                    &
431                  &           )*e2f(ji,jj)*e2f(ji,jj)                       &
432                  &         )                                               &
433                  &        / ( e1f(ji,jj) * e2f(ji,jj) )
434
435               deltac(ji,jj) = SQRT(zddc**2+(zdtc**2+zds(ji,jj)**2)*usecc2) + creepl
436
437               !-Calculate stress tensor component zs12 at corners (see section 3.5 of CICE user's guide).
438               zs12(ji,jj) = ( zs12(ji,jj)      &
439                  &        - dtotel*( (1.0-alphaevp)*ecc2*zs12(ji,jj) - zds(ji,jj) / &
440                  &          ( 2.0*deltac(ji,jj) ) * zpreshc(ji,jj))) &
441                  &         / ( 1.0 + alphaevp*ecc2*dtotel ) 
442
443            END DO ! ji
444         END DO ! jj
445
446         CALL lbc_lnk( zs12(:,:), 'F', 1. )
447
448         ! Ice internal stresses (Appendix C of Hunke and Dukowicz, 2002)
449         DO jj = k_j1+1, k_jpj-1
450            DO ji = fs_2, fs_jpim1
451               !- contribution of zs1, zs2 and zs12 to zf1
452               zf1(ji,jj) = 0.5*( (zs1(ji+1,jj)-zs1(ji,jj))*e2u(ji,jj) &
453                  &              +(zs2(ji+1,jj)*e2t(ji+1,jj)**2-zs2(ji,jj)*e2t(ji,jj)**2)/e2u(ji,jj) &
454                  &              +2.0*(zs12(ji,jj)*e1f(ji,jj)**2-zs12(ji,jj-1)*e1f(ji,jj-1)**2)/e1u(ji,jj) &
455                  &             ) / ( e1u(ji,jj)*e2u(ji,jj) )
456               ! contribution of zs1, zs2 and zs12 to zf2
457               zf2(ji,jj) = 0.5*( (zs1(ji,jj+1)-zs1(ji,jj))*e1v(ji,jj) &
458                  &              -(zs2(ji,jj+1)*e1t(ji,jj+1)**2 - zs2(ji,jj)*e1t(ji,jj)**2)/e1v(ji,jj) &
459                  &              + 2.0*(zs12(ji,jj)*e2f(ji,jj)**2 -    &
460                  zs12(ji-1,jj)*e2f(ji-1,jj)**2)/e2v(ji,jj) &
461                  &             ) / ( e1v(ji,jj)*e2v(ji,jj) )
462            END DO
463         END DO
464         !
465         ! Computation of ice velocity
466         !
467         ! Both the Coriolis term and the ice-ocean drag are solved semi-implicitly.
468         !
469         IF (MOD(jter,2).eq.0) THEN 
470
471!CDIR NOVERRCHK
472            DO jj = k_j1+1, k_jpj-1
473!CDIR NOVERRCHK
474               DO ji = fs_2, fs_jpim1
475                  zmask        = (1.0-MAX(rzero,SIGN(rone,-zmass1(ji,jj))))*tmu(ji,jj)
476                  zsang        = SIGN ( 1.0 , fcor(ji,jj) ) * sangvg
477                  z0           = zmass1(ji,jj)/dtevp
478
479                  ! SB modif because ocean has no slip boundary condition
480                  zv_ice1       = 0.5*( (v_ice(ji,jj)+v_ice(ji,jj-1))*e1t(ji,jj)         &
481                     &                 +(v_ice(ji+1,jj)+v_ice(ji+1,jj-1))*e1t(ji+1,jj))   &
482                     &               /(e1t(ji+1,jj)+e1t(ji,jj)) * tmu(ji,jj)
483                  za           = rhoco*SQRT((u_ice(ji,jj)-u_oce1(ji,jj))**2 + &
484                     (zv_ice1-v_oce1(ji,jj))**2) * (1.0-zfrld1(ji,jj))
485                  zr           = z0*u_ice(ji,jj) + zf1(ji,jj) + za1ct(ji,jj) + &
486                     za*(cangvg*u_oce1(ji,jj)-zsang*v_oce1(ji,jj))
487                  zcca         = z0+za*cangvg
488                  zccb         = zcorl1(ji,jj)+za*zsang
489                  u_ice(ji,jj) = (zr+zccb*zv_ice1)/(zcca+epsd)*zmask 
490
491               END DO
492            END DO
493
494            CALL lbc_lnk( u_ice(:,:), 'U', -1. )
495
496!CDIR NOVERRCHK
497            DO jj = k_j1+1, k_jpj-1
498!CDIR NOVERRCHK
499               DO ji = fs_2, fs_jpim1
500
501                  zmask        = (1.0-MAX(rzero,SIGN(rone,-zmass2(ji,jj))))*tmv(ji,jj)
502                  zsang        = SIGN(1.0,fcor(ji,jj))*sangvg
503                  z0           = zmass2(ji,jj)/dtevp
504                  ! SB modif because ocean has no slip boundary condition
505                  zu_ice2       = 0.5*( (u_ice(ji,jj)+u_ice(ji-1,jj))*e2t(ji,jj)     &
506                     &                 + (u_ice(ji,jj+1)+u_ice(ji-1,jj+1))*e2t(ji,jj+1))   &
507                     &               /(e2t(ji,jj+1)+e2t(ji,jj)) * tmv(ji,jj)
508                  za           = rhoco*SQRT((zu_ice2-u_oce2(ji,jj))**2 + & 
509                     (v_ice(ji,jj)-v_oce2(ji,jj))**2)*(1.0-zfrld2(ji,jj))
510                  zr           = z0*v_ice(ji,jj) + zf2(ji,jj) + &
511                     za2ct(ji,jj) + za*(cangvg*v_oce2(ji,jj)+zsang*u_oce2(ji,jj))
512                  zcca         = z0+za*cangvg
513                  zccb         = zcorl2(ji,jj)+za*zsang
514                  v_ice(ji,jj) = (zr-zccb*zu_ice2)/(zcca+epsd)*zmask
515
516               END DO
517            END DO
518
519            CALL lbc_lnk( v_ice(:,:), 'V', -1. )
520
521         ELSE 
522!CDIR NOVERRCHK
523            DO jj = k_j1+1, k_jpj-1
524!CDIR NOVERRCHK
525               DO ji = fs_2, fs_jpim1
526                  zmask        = (1.0-MAX(rzero,SIGN(rone,-zmass2(ji,jj))))*tmv(ji,jj)
527                  zsang        = SIGN(1.0,fcor(ji,jj))*sangvg
528                  z0           = zmass2(ji,jj)/dtevp
529                  ! SB modif because ocean has no slip boundary condition
530                  zu_ice2       = 0.5*( (u_ice(ji,jj)+u_ice(ji-1,jj))*e2t(ji,jj)      &
531                     &                 +(u_ice(ji,jj+1)+u_ice(ji-1,jj+1))*e2t(ji,jj+1))   &
532                     &               /(e2t(ji,jj+1)+e2t(ji,jj)) * tmv(ji,jj)   
533
534                  za           = rhoco*SQRT((zu_ice2-u_oce2(ji,jj))**2 + &
535                     (v_ice(ji,jj)-v_oce2(ji,jj))**2)*(1.0-zfrld2(ji,jj))
536                  zr           = z0*v_ice(ji,jj) + zf2(ji,jj) + &
537                     za2ct(ji,jj) + za*(cangvg*v_oce2(ji,jj)+zsang*u_oce2(ji,jj))
538                  zcca         = z0+za*cangvg
539                  zccb         = zcorl2(ji,jj)+za*zsang
540                  v_ice(ji,jj) = (zr-zccb*zu_ice2)/(zcca+epsd)*zmask
541
542               END DO
543            END DO
544
545            CALL lbc_lnk( v_ice(:,:), 'V', -1. )
546
547!CDIR NOVERRCHK
548            DO jj = k_j1+1, k_jpj-1
549!CDIR NOVERRCHK
550               DO ji = fs_2, fs_jpim1
551                  zmask        = (1.0-MAX(rzero,SIGN(rone,-zmass1(ji,jj))))*tmu(ji,jj)
552                  zsang        = SIGN(1.0,fcor(ji,jj))*sangvg
553                  z0           = zmass1(ji,jj)/dtevp
554                  ! SB modif because ocean has no slip boundary condition
555                  ! GG Bug
556                  !                   zv_ice1       = 0.5*( (v_ice(ji,jj)+v_ice(ji,jj-1))*e1t(ji+1,jj)      &
557                  !                      &                 +(v_ice(ji+1,jj)+v_ice(ji+1,jj-1))*e1t(ji,jj))   &
558                  !                      &               /(e1t(ji+1,jj)+e1t(ji,jj)) * tmu(ji,jj)
559                  zv_ice1       = 0.5*( (v_ice(ji,jj)+v_ice(ji,jj-1))*e1t(ji,jj)      &
560                     &                 +(v_ice(ji+1,jj)+v_ice(ji+1,jj-1))*e1t(ji+1,jj))   &
561                     &               /(e1t(ji+1,jj)+e1t(ji,jj)) * tmu(ji,jj)
562
563                  za           = rhoco*SQRT((u_ice(ji,jj)-u_oce1(ji,jj))**2 + &
564                     (zv_ice1-v_oce1(ji,jj))**2)*(1.0-zfrld1(ji,jj))
565                  zr           = z0*u_ice(ji,jj) + zf1(ji,jj) + za1ct(ji,jj) + &
566                     za*(cangvg*u_oce1(ji,jj)-zsang*v_oce1(ji,jj))
567                  zcca         = z0+za*cangvg
568                  zccb         = zcorl1(ji,jj)+za*zsang
569                  u_ice(ji,jj) = (zr+zccb*zv_ice1)/(zcca+epsd)*zmask 
570               END DO ! ji
571            END DO ! jj
572
573            CALL lbc_lnk( u_ice(:,:), 'U', -1. )
574
575         ENDIF
576
577         IF(ln_ctl) THEN
578            !---  Convergence test.
579            DO jj = k_j1+1 , k_jpj-1
580               zresr(:,jj) = MAX( ABS( u_ice(:,jj) - zu_ice(:,jj) ) ,           &
581                  ABS( v_ice(:,jj) - zv_ice(:,jj) ) )
582            END DO
583            zresm = MAXVAL( zresr( 1:jpi , k_j1+1:k_jpj-1 ) )
584            IF( lk_mpp )   CALL mpp_max( zresm )   ! max over the global domain
585         ENDIF
586
587         !                                                   ! ==================== !
588      END DO                                              !  end loop over jter  !
589      !                                                   ! ==================== !
590
591      !
592      !------------------------------------------------------------------------------!
593      ! 4) Prevent ice velocities when the ice is thin
594      !------------------------------------------------------------------------------!
595      !
596      ! If the ice thickness is below 1cm then ice velocity should equal the
597      ! ocean velocity,
598      ! This prevents high velocity when ice is thin
599!CDIR NOVERRCHK
600      DO jj = k_j1+1, k_jpj-1
601!CDIR NOVERRCHK
602         DO ji = fs_2, fs_jpim1
603            zindb  = MAX( 0.0, SIGN( 1.0, at_i(ji,jj) - 1.0e-6 ) ) 
604            zdummy = zindb * vt_i(ji,jj) / MAX(at_i(ji,jj) , 1.0e-06 )
605            IF ( zdummy .LE. 5.0e-2 ) THEN
606               u_ice(ji,jj) = u_oce(ji,jj)
607               v_ice(ji,jj) = v_oce(ji,jj)
608            ENDIF ! zdummy
609         END DO
610      END DO
611
612      CALL lbc_lnk( u_ice(:,:), 'U', -1. ) 
613      CALL lbc_lnk( v_ice(:,:), 'V', -1. ) 
614
615      DO jj = k_j1+1, k_jpj-1 
616         DO ji = fs_2, fs_jpim1
617            zindb  = MAX( 0.0, SIGN( 1.0, at_i(ji,jj) - 1.0e-6 ) ) 
618            zdummy = zindb * vt_i(ji,jj) / MAX(at_i(ji,jj) , 1.0e-06 )
619            IF ( zdummy .LE. 5.0e-2 ) THEN
620               v_ice1(ji,jj)  = 0.5*( (v_ice(ji,jj)+v_ice(ji,jj-1))*e1t(ji+1,jj)   &
621                  &                 +(v_ice(ji+1,jj)+v_ice(ji+1,jj-1))*e1t(ji,jj)) &
622                  &               /(e1t(ji+1,jj)+e1t(ji,jj)) * tmu(ji,jj)
623
624               u_ice2(ji,jj)  = 0.5*( (u_ice(ji,jj)+u_ice(ji-1,jj))*e2t(ji,jj+1)   &
625                  &                 +(u_ice(ji,jj+1)+u_ice(ji-1,jj+1))*e2t(ji,jj)) &
626                  &               /(e2t(ji,jj+1)+e2t(ji,jj)) * tmv(ji,jj)
627            ENDIF ! zdummy
628         END DO
629      END DO
630
631      CALL lbc_lnk( u_ice2(:,:), 'V', -1. ) 
632      CALL lbc_lnk( v_ice1(:,:), 'U', -1. )
633
634      ! Recompute delta, shear and div, inputs for mechanical redistribution
635!CDIR NOVERRCHK
636      DO jj = k_j1+1, k_jpj-1
637!CDIR NOVERRCHK
638         DO ji = fs_2, jpim1   !RB bug no vect opt due to tmi
639            !- zdd(:,:), zdt(:,:): divergence and tension at centre
640            !- zds(:,:): shear on northeast corner of grid cells
641            zindb  = MAX( 0.0, SIGN( 1.0, at_i(ji,jj) - 1.0e-6 ) ) 
642            zdummy = zindb * vt_i(ji,jj) / MAX(at_i(ji,jj) , 1.0e-06 )
643
644            IF ( zdummy .LE. 5.0e-2 ) THEN
645
646               zdd(ji,jj) = ( e2u(ji,jj)*u_ice(ji,jj)                      &
647                  &          -e2u(ji-1,jj)*u_ice(ji-1,jj)                  &
648                  &          +e1v(ji,jj)*v_ice(ji,jj)                      &
649                  &          -e1v(ji,jj-1)*v_ice(ji,jj-1)                  &
650                  &         )                                              &
651                  &         / area(ji,jj)
652
653               zdt(ji,jj) = ( ( u_ice(ji,jj)/e2u(ji,jj)                    &
654                  &            -u_ice(ji-1,jj)/e2u(ji-1,jj)                &
655                  &           )*e2t(ji,jj)*e2t(ji,jj)                      &
656                  &          -( v_ice(ji,jj)/e1v(ji,jj)                    &
657                  &            -v_ice(ji,jj-1)/e1v(ji,jj-1)                &
658                  &           )*e1t(ji,jj)*e1t(ji,jj)                      &
659                  &         )                                              &
660                  &        / area(ji,jj)
661               !
662               ! SB modif because ocean has no slip boundary condition
663               zds(ji,jj) = ( ( u_ice(ji,jj+1) / e1u(ji,jj+1)              &
664                  &           - u_ice(ji,jj)   / e1u(ji,jj) )              &
665                  &           * e1f(ji,jj) * e1f(ji,jj)                    &
666                  &          + ( v_ice(ji+1,jj) / e2v(ji+1,jj)             &
667                  &            - v_ice(ji,jj)  / e2v(ji,jj) )              &
668                  &           * e2f(ji,jj) * e2f(ji,jj) )                  &
669                  &        / ( e1f(ji,jj) * e2f(ji,jj) ) * ( 2.0 - tmf(ji,jj) ) &
670                  &        * tmi(ji,jj) * tmi(ji,jj+1)                     &
671                  &        * tmi(ji+1,jj) * tmi(ji+1,jj+1)
672
673               zdst       = (  e2u( ji  , jj   ) * v_ice1(ji,jj)          &
674                  &          - e2u( ji-1, jj   ) * v_ice1(ji-1,jj)         &
675                  &          + e1v( ji  , jj   ) * u_ice2(ji,jj)           &
676                  &          - e1v( ji  , jj-1 ) * u_ice2(ji,jj-1)         & 
677                  &          )                                             &
678                  &         / area(ji,jj)
679
680               deltat(ji,jj) = SQRT( zdd(ji,jj)*zdd(ji,jj) + & 
681                  &                          ( zdt(ji,jj)*zdt(ji,jj) + zdst*zdst ) * usecc2 & 
682                  &                          ) + creepl
683
684            ENDIF ! zdummy
685
686         END DO !jj
687      END DO !ji
688      !
689      !------------------------------------------------------------------------------!
690      ! 5) Store stress tensor and its invariants
691      !------------------------------------------------------------------------------!
692      !
693      ! * Invariants of the stress tensor are required for limitd_me
694      ! accelerates convergence and improves stability
695      DO jj = k_j1+1, k_jpj-1
696         DO ji = fs_2, fs_jpim1
697            divu_i (ji,jj) = zdd   (ji,jj)
698            delta_i(ji,jj) = deltat(ji,jj)
699            shear_i(ji,jj) = zds   (ji,jj)
700         END DO
701      END DO
702
703      ! Lateral boundary condition
704      CALL lbc_lnk( divu_i (:,:), 'T', 1. )
705      CALL lbc_lnk( delta_i(:,:), 'T', 1. )
706      CALL lbc_lnk( shear_i(:,:), 'F', 1. )
707
708      ! * Store the stress tensor for the next time step
709      stress1_i (:,:) = zs1 (:,:)
710      stress2_i (:,:) = zs2 (:,:)
711      stress12_i(:,:) = zs12(:,:)
712
713      !
714      !------------------------------------------------------------------------------!
715      ! 6) Control prints of residual and charge ellipse
716      !------------------------------------------------------------------------------!
717      !
718      ! print the residual for convergence
719      IF(ln_ctl) THEN
720         WRITE(charout,FMT="('lim_rhg  : res =',D23.16, ' iter =',I4)") zresm, jter
721         CALL prt_ctl_info(charout)
722         CALL prt_ctl(tab2d_1=u_ice, clinfo1=' lim_rhg  : u_ice :', tab2d_2=v_ice, clinfo2=' v_ice :')
723      ENDIF
724
725      ! print charge ellipse
726      ! This can be desactivated once the user is sure that the stress state
727      ! lie on the charge ellipse. See Bouillon et al. 08 for more details
728      IF(ln_ctl) THEN
729         CALL prt_ctl_info('lim_rhg  : numit  :',ivar1=numit)
730         CALL prt_ctl_info('lim_rhg  : nwrite :',ivar1=nwrite)
731         CALL prt_ctl_info('lim_rhg  : MOD    :',ivar1=MOD(numit,nwrite))
732         IF( MOD(numit,nwrite) .EQ. 0 ) THEN
733            WRITE(charout,FMT="('lim_rhg  :', I4, I6, I1, I1, A10)") 1000, numit, 0, 0, ' ch. ell. '
734            CALL prt_ctl_info(charout)
735            DO jj = k_j1+1, k_jpj-1
736               DO ji = 2, jpim1
737                  IF (zpresh(ji,jj) .GT. 1.0) THEN
738                     sigma1 = ( zs1(ji,jj) + (zs2(ji,jj)**2 + 4*zs12(ji,jj)**2 )**0.5 ) / ( 2*zpresh(ji,jj) ) 
739                     sigma2 = ( zs1(ji,jj) - (zs2(ji,jj)**2 + 4*zs12(ji,jj)**2 )**0.5 ) / ( 2*zpresh(ji,jj) )
740                     WRITE(charout,FMT="('lim_rhg  :', I4, I4, D23.16, D23.16, D23.16, D23.16, A10)")
741                     CALL prt_ctl_info(charout)
742                  ENDIF
743               END DO
744            END DO
745            WRITE(charout,FMT="('lim_rhg  :', I4, I6, I1, I1, A10)") 2000, numit, 0, 0, ' ch. ell. '
746            CALL prt_ctl_info(charout)
747         ENDIF
748      ENDIF
749
750   END SUBROUTINE lim_rhg
751
752#else
753   !!----------------------------------------------------------------------
754   !!   Default option          Dummy module           NO LIM sea-ice model
755   !!----------------------------------------------------------------------
756CONTAINS
757   SUBROUTINE lim_rhg( k1 , k2 )         ! Dummy routine
758      WRITE(*,*) 'lim_rhg: You should not have seen this print! error?', k1, k2
759   END SUBROUTINE lim_rhg
760#endif
761
762   !!==============================================================================
763END MODULE limrhg
Note: See TracBrowser for help on using the repository browser.