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 @ 2528

Last change on this file since 2528 was 2528, checked in by rblod, 13 years ago

Update NEMOGCM from branch nemo_v3_3_beta

  • Property svn:keywords set to Id
File size: 36.9 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            ! tmi = 1 where there is ice or on land
193            tmi(ji,jj)    = 1._wp - ( 1._wp - MAX( 0._wp , SIGN ( 1._wp , vt_i(ji,jj) - epsd ) ) ) * tms(ji,jj)
194         END DO
195      END DO
196
197      ! Ice strength on grid cell corners (zpreshc)
198      ! needed for calculation of shear stress
199!CDIR NOVERRCHK
200      DO jj = k_j1+1, k_jpj-1
201!CDIR NOVERRCHK
202         DO ji = 2, jpim1 !RB caution no fs_ (ji+1,jj+1)
203            zstms          =  tms(ji+1,jj+1) * wght(ji+1,jj+1,2,2) + &
204               &              tms(ji,jj+1)   * wght(ji+1,jj+1,1,2) + &
205               &              tms(ji+1,jj)   * wght(ji+1,jj+1,2,1) + &
206               &              tms(ji,jj)     * wght(ji+1,jj+1,1,1)
207            zusw(ji,jj)    = 1.0 / MAX( zstms, epsd )
208            zpreshc(ji,jj) = (  zpresh(ji+1,jj+1) * wght(ji+1,jj+1,2,2) + &
209               &                zpresh(ji,jj+1)   * wght(ji+1,jj+1,1,2) + &
210               &                zpresh(ji+1,jj)   * wght(ji+1,jj+1,2,1) + & 
211               &                zpresh(ji,jj)     * wght(ji+1,jj+1,1,1)   &
212               &             ) * zusw(ji,jj)
213         END DO
214      END DO
215
216      CALL lbc_lnk( zpreshc(:,:), 'F', 1. )
217      !
218      !------------------------------------------------------------------------------!
219      ! 2) Wind / ocean stress, mass terms, coriolis terms
220      !------------------------------------------------------------------------------!
221      !
222      !  Wind stress, coriolis and mass terms on the sides of the squares       
223      !  zfrld1: lead fraction on U-points                                     
224      !  zfrld2: lead fraction on V-points                                     
225      !  zmass1: ice/snow mass on U-points                                   
226      !  zmass2: ice/snow mass on V-points                                   
227      !  zcorl1: Coriolis parameter on U-points                             
228      !  zcorl2: Coriolis parameter on V-points                           
229      !  (ztagnx,ztagny): wind stress on U/V points                       
230      !  u_oce1: ocean u component on u points                           
231      !  v_oce1: ocean v component on u points                         
232      !  u_oce2: ocean u component on v points                         
233      !  v_oce2: ocean v component on v points                       
234
235      DO jj = k_j1+1, k_jpj-1
236         DO ji = fs_2, fs_jpim1
237
238            zt11 = tms(ji  ,jj) * e1t(ji  ,jj)
239            zt12 = tms(ji+1,jj) * e1t(ji+1,jj)
240            zt21 = tms(ji,jj  ) * e2t(ji,jj  )
241            zt22 = tms(ji,jj+1) * e2t(ji,jj+1)
242
243            ! Leads area.
244            zfrld1(ji,jj) = ( zt12 * ( 1.0 - at_i(ji,jj) ) + zt11 * ( 1.0 - at_i(ji+1,jj) ) ) / ( zt11 + zt12 + epsd )
245            zfrld2(ji,jj) = ( zt22 * ( 1.0 - at_i(ji,jj) ) + zt21 * ( 1.0 - at_i(ji,jj+1) ) ) / ( zt21 + zt22 + epsd )
246
247            ! Mass, coriolis coeff. and currents
248            zmass1(ji,jj) = ( zt12*zc1(ji,jj) + zt11*zc1(ji+1,jj) ) / (zt11+zt12+epsd)
249            zmass2(ji,jj) = ( zt22*zc1(ji,jj) + zt21*zc1(ji,jj+1) ) / (zt21+zt22+epsd)
250            zcorl1(ji,jj) = zmass1(ji,jj) * ( e1t(ji+1,jj)*fcor(ji,jj) + e1t(ji,jj)*fcor(ji+1,jj) )   &
251               &                          / ( e1t(ji,jj) + e1t(ji+1,jj) + epsd )
252            zcorl2(ji,jj) = zmass2(ji,jj) * ( e2t(ji,jj+1)*fcor(ji,jj) + e2t(ji,jj)*fcor(ji,jj+1) )   &
253               &                          / ( e2t(ji,jj+1) + e2t(ji,jj) + epsd )
254            !
255            u_oce1(ji,jj)  = u_oce(ji,jj)
256            v_oce2(ji,jj)  = v_oce(ji,jj)
257
258            ! Ocean has no slip boundary condition
259            v_oce1(ji,jj)  = 0.5*( (v_oce(ji,jj)+v_oce(ji,jj-1))*e1t(ji,jj)    &
260               &                 +(v_oce(ji+1,jj)+v_oce(ji+1,jj-1))*e1t(ji+1,jj)) &
261               &               /(e1t(ji+1,jj)+e1t(ji,jj)) * tmu(ji,jj) 
262
263            u_oce2(ji,jj)  = 0.5*((u_oce(ji,jj)+u_oce(ji-1,jj))*e2t(ji,jj)     &
264               &                 +(u_oce(ji,jj+1)+u_oce(ji-1,jj+1))*e2t(ji,jj+1)) &
265               &                / (e2t(ji,jj+1)+e2t(ji,jj)) * tmv(ji,jj)
266
267            ! Wind stress at U,V-point
268            ztagnx = ( 1. - zfrld1(ji,jj) ) * utau_ice(ji,jj)
269            ztagny = ( 1. - zfrld2(ji,jj) ) * vtau_ice(ji,jj)
270
271            ! Computation of the velocity field taking into account the ice internal interaction.
272            ! Terms that are independent of the velocity field.
273
274            ! SB On utilise maintenant le gradient de la pente de l'ocean
275            ! include it later
276
277            zdsshx =  ( ssh_m(ji+1,jj) - ssh_m(ji,jj) ) / e1u(ji,jj)
278            zdsshy =  ( ssh_m(ji,jj+1) - ssh_m(ji,jj) ) / e2v(ji,jj)
279
280            za1ct(ji,jj) = ztagnx - zmass1(ji,jj) * grav * zdsshx
281            za2ct(ji,jj) = ztagny - zmass2(ji,jj) * grav * zdsshy
282
283         END DO
284      END DO
285
286      !
287      !------------------------------------------------------------------------------!
288      ! 3) Solution of the momentum equation, iterative procedure
289      !------------------------------------------------------------------------------!
290      !
291      ! Time step for subcycling
292      dtevp  = rdt_ice / nevp
293      dtotel = dtevp / ( 2._wp * telast )
294
295      !-ecc2: square of yield ellipse eccenticrity (reminder: must become a namelist parameter)
296      ecc2 = ecc * ecc
297
298      !-Initialise stress tensor
299      zs1 (:,:) = stress1_i (:,:) 
300      zs2 (:,:) = stress2_i (:,:)
301      zs12(:,:) = stress12_i(:,:)
302
303      !                                               !----------------------!
304      DO jter = 1 , nevp                              !    loop over jter    !
305         !                                            !----------------------!       
306         DO jj = k_j1, k_jpj-1
307            zu_ice(:,jj) = u_ice(:,jj)    ! velocity at previous time step
308            zv_ice(:,jj) = v_ice(:,jj)
309         END DO
310
311         DO jj = k_j1+1, k_jpj-1
312            DO ji = fs_2, jpim1   !RB bug no vect opt due to tmi
313
314               
315               !- Divergence, tension and shear (Section a. Appendix B of Hunke & Dukowicz, 2002)
316               !- zdd(:,:), zdt(:,:): divergence and tension at centre of grid cells
317               !- zds(:,:): shear on northeast corner of grid cells
318               !
319               !- IMPORTANT REMINDER: Dear Gurvan, note that, the way these terms are coded,
320               !                      there are many repeated calculations.
321               !                      Speed could be improved by regrouping terms. For
322               !                      the moment, however, the stress is on clarity of coding to avoid
323               !                      bugs (Martin, for Miguel).
324               !
325               !- ALSO: arrays zdd, zdt, zds and delta could
326               !  be removed in the future to minimise memory demand.
327               !
328               !- MORE NOTES: Note that we are calculating deformation rates and stresses on the corners of
329               !              grid cells, exactly as in the B grid case. For simplicity, the indexation on
330               !              the corners is the same as in the B grid.
331               !
332               !
333               zdd(ji,jj) = ( e2u(ji,jj)*u_ice(ji,jj)                      &
334                  &          -e2u(ji-1,jj)*u_ice(ji-1,jj)                  &
335                  &          +e1v(ji,jj)*v_ice(ji,jj)                      &
336                  &          -e1v(ji,jj-1)*v_ice(ji,jj-1)                  &
337                  &          )                                             &
338                  &         / area(ji,jj)
339
340               zdt(ji,jj) = ( ( u_ice(ji,jj)/e2u(ji,jj)                    &
341                  &            -u_ice(ji-1,jj)/e2u(ji-1,jj)                &
342                  &           )*e2t(ji,jj)*e2t(ji,jj)                      &
343                  &          -( v_ice(ji,jj)/e1v(ji,jj)                    &
344                  &            -v_ice(ji,jj-1)/e1v(ji,jj-1)                &
345                  &           )*e1t(ji,jj)*e1t(ji,jj)                      &
346                  &         )                                              &
347                  &        / area(ji,jj)
348
349               !
350               zds(ji,jj) = ( ( u_ice(ji,jj+1)/e1u(ji,jj+1)                &
351                  &            -u_ice(ji,jj)/e1u(ji,jj)                    &
352                  &           )*e1f(ji,jj)*e1f(ji,jj)                      &
353                  &          +( v_ice(ji+1,jj)/e2v(ji+1,jj)                &
354                  &            -v_ice(ji,jj)/e2v(ji,jj)                    &
355                  &           )*e2f(ji,jj)*e2f(ji,jj)                      &
356                  &         )                                              &
357                  &        / ( e1f(ji,jj) * e2f(ji,jj) ) * ( 2.0 - tmf(ji,jj) ) &
358                  &        * tmi(ji,jj) * tmi(ji,jj+1)                     &
359                  &        * tmi(ji+1,jj) * tmi(ji+1,jj+1)
360
361
362               v_ice1(ji,jj)  = 0.5*( (v_ice(ji,jj)+v_ice(ji,jj-1))*e1t(ji+1,jj)   &
363                  &                 +(v_ice(ji+1,jj)+v_ice(ji+1,jj-1))*e1t(ji,jj)) &
364                  &               /(e1t(ji+1,jj)+e1t(ji,jj)) * tmu(ji,jj) 
365
366               u_ice2(ji,jj)  = 0.5*( (u_ice(ji,jj)+u_ice(ji-1,jj))*e2t(ji,jj+1)   &
367                  &                 +(u_ice(ji,jj+1)+u_ice(ji-1,jj+1))*e2t(ji,jj)) &
368                  &               /(e2t(ji,jj+1)+e2t(ji,jj)) * tmv(ji,jj)
369
370            END DO
371         END DO
372         CALL lbc_lnk( v_ice1, 'U', -1. )   ;   CALL lbc_lnk( u_ice2, 'V', -1. )      ! lateral boundary cond.
373
374!CDIR NOVERRCHK
375         DO jj = k_j1+1, k_jpj-1
376!CDIR NOVERRCHK
377            DO ji = fs_2, fs_jpim1
378
379               !- Calculate Delta at centre of grid cells
380               zdst       = (  e2u(ji  , jj) * v_ice1(ji  ,jj)          &
381                  &          - e2u(ji-1, jj) * v_ice1(ji-1,jj)          &
382                  &          + e1v(ji, jj  ) * u_ice2(ji,jj  )          &
383                  &          - e1v(ji, jj-1) * u_ice2(ji,jj-1)          &
384                  &          )                                          &
385                  &         / area(ji,jj)
386
387               delta = SQRT( zdd(ji,jj)*zdd(ji,jj) + ( zdt(ji,jj)*zdt(ji,jj) + zdst*zdst ) * usecc2 ) 
388               deltat(ji,jj) = MAX( SQRT(zdd(ji,jj)**2 + (zdt(ji,jj)**2 + zdst**2)*usecc2), creepl )
389
390               !-Calculate stress tensor components zs1 and zs2
391               !-at centre of grid cells (see section 3.5 of CICE user's guide).
392               zs1(ji,jj) = ( zs1(ji,jj) &
393                  &          - dtotel*( ( 1.0 - alphaevp) * zs1(ji,jj) +    &
394                  &            ( delta / deltat(ji,jj) - zdd(ji,jj) / deltat(ji,jj) ) &
395                  * zpresh(ji,jj) ) )                          &       
396                  &        / ( 1.0 + alphaevp * dtotel )
397
398               zs2(ji,jj) = ( zs2(ji,jj)   &
399                  &          - dtotel*((1.0-alphaevp)*ecc2*zs2(ji,jj) -  &
400                  zdt(ji,jj)/deltat(ji,jj)*zpresh(ji,jj)) ) &
401                  &        / ( 1.0 + alphaevp*ecc2*dtotel )
402
403            END DO
404         END DO
405
406         CALL lbc_lnk( zs1(:,:), 'T', 1. )
407         CALL lbc_lnk( zs2(:,:), 'T', 1. )
408
409!CDIR NOVERRCHK
410         DO jj = k_j1+1, k_jpj-1
411!CDIR NOVERRCHK
412            DO ji = fs_2, fs_jpim1
413               !- Calculate Delta on corners
414               zddc  =      ( ( v_ice1(ji,jj+1)/e1u(ji,jj+1)                &
415                  &            -v_ice1(ji,jj)/e1u(ji,jj)                    &
416                  &           )*e1f(ji,jj)*e1f(ji,jj)                       &
417                  &          +( u_ice2(ji+1,jj)/e2v(ji+1,jj)                &
418                  &            -u_ice2(ji,jj)/e2v(ji,jj)                    &
419                  &           )*e2f(ji,jj)*e2f(ji,jj)                       &
420                  &         )                                               &
421                  &        / ( e1f(ji,jj) * e2f(ji,jj) )
422
423               zdtc  =      (-( v_ice1(ji,jj+1)/e1u(ji,jj+1)                &
424                  &            -v_ice1(ji,jj)/e1u(ji,jj)                    &
425                  &           )*e1f(ji,jj)*e1f(ji,jj)                       &
426                  &          +( u_ice2(ji+1,jj)/e2v(ji+1,jj)                &
427                  &            -u_ice2(ji,jj)/e2v(ji,jj)                    &
428                  &           )*e2f(ji,jj)*e2f(ji,jj)                       &
429                  &         )                                               &
430                  &        / ( e1f(ji,jj) * e2f(ji,jj) )
431
432               deltac(ji,jj) = SQRT(zddc**2+(zdtc**2+zds(ji,jj)**2)*usecc2) + creepl
433
434               !-Calculate stress tensor component zs12 at corners (see section 3.5 of CICE user's guide).
435               zs12(ji,jj) = ( zs12(ji,jj)      &
436                  &        - dtotel*( (1.0-alphaevp)*ecc2*zs12(ji,jj) - zds(ji,jj) / &
437                  &          ( 2.0*deltac(ji,jj) ) * zpreshc(ji,jj))) &
438                  &         / ( 1.0 + alphaevp*ecc2*dtotel ) 
439
440            END DO ! ji
441         END DO ! jj
442
443         CALL lbc_lnk( zs12(:,:), 'F', 1. )
444
445         ! Ice internal stresses (Appendix C of Hunke and Dukowicz, 2002)
446         DO jj = k_j1+1, k_jpj-1
447            DO ji = fs_2, fs_jpim1
448               !- contribution of zs1, zs2 and zs12 to zf1
449               zf1(ji,jj) = 0.5*( (zs1(ji+1,jj)-zs1(ji,jj))*e2u(ji,jj) &
450                  &              +(zs2(ji+1,jj)*e2t(ji+1,jj)**2-zs2(ji,jj)*e2t(ji,jj)**2)/e2u(ji,jj) &
451                  &              +2.0*(zs12(ji,jj)*e1f(ji,jj)**2-zs12(ji,jj-1)*e1f(ji,jj-1)**2)/e1u(ji,jj) &
452                  &             ) / ( e1u(ji,jj)*e2u(ji,jj) )
453               ! contribution of zs1, zs2 and zs12 to zf2
454               zf2(ji,jj) = 0.5*( (zs1(ji,jj+1)-zs1(ji,jj))*e1v(ji,jj) &
455                  &              -(zs2(ji,jj+1)*e1t(ji,jj+1)**2 - zs2(ji,jj)*e1t(ji,jj)**2)/e1v(ji,jj) &
456                  &              + 2.0*(zs12(ji,jj)*e2f(ji,jj)**2 -    &
457                  zs12(ji-1,jj)*e2f(ji-1,jj)**2)/e2v(ji,jj) &
458                  &             ) / ( e1v(ji,jj)*e2v(ji,jj) )
459            END DO
460         END DO
461         !
462         ! Computation of ice velocity
463         !
464         ! Both the Coriolis term and the ice-ocean drag are solved semi-implicitly.
465         !
466         IF (MOD(jter,2).eq.0) THEN 
467
468!CDIR NOVERRCHK
469            DO jj = k_j1+1, k_jpj-1
470!CDIR NOVERRCHK
471               DO ji = fs_2, fs_jpim1
472                  zmask        = (1.0-MAX(rzero,SIGN(rone,-zmass1(ji,jj))))*tmu(ji,jj)
473                  zsang        = SIGN ( 1.0 , fcor(ji,jj) ) * sangvg
474                  z0           = zmass1(ji,jj)/dtevp
475
476                  ! SB modif because ocean has no slip boundary condition
477                  zv_ice1       = 0.5*( (v_ice(ji,jj)+v_ice(ji,jj-1))*e1t(ji,jj)         &
478                     &                 +(v_ice(ji+1,jj)+v_ice(ji+1,jj-1))*e1t(ji+1,jj))   &
479                     &               /(e1t(ji+1,jj)+e1t(ji,jj)) * tmu(ji,jj)
480                  za           = rhoco*SQRT((u_ice(ji,jj)-u_oce1(ji,jj))**2 + &
481                     (zv_ice1-v_oce1(ji,jj))**2) * (1.0-zfrld1(ji,jj))
482                  zr           = z0*u_ice(ji,jj) + zf1(ji,jj) + za1ct(ji,jj) + &
483                     za*(cangvg*u_oce1(ji,jj)-zsang*v_oce1(ji,jj))
484                  zcca         = z0+za*cangvg
485                  zccb         = zcorl1(ji,jj)+za*zsang
486                  u_ice(ji,jj) = (zr+zccb*zv_ice1)/(zcca+epsd)*zmask 
487
488               END DO
489            END DO
490
491            CALL lbc_lnk( u_ice(:,:), 'U', -1. )
492
493!CDIR NOVERRCHK
494            DO jj = k_j1+1, k_jpj-1
495!CDIR NOVERRCHK
496               DO ji = fs_2, fs_jpim1
497
498                  zmask        = (1.0-MAX(rzero,SIGN(rone,-zmass2(ji,jj))))*tmv(ji,jj)
499                  zsang        = SIGN(1.0,fcor(ji,jj))*sangvg
500                  z0           = zmass2(ji,jj)/dtevp
501                  ! SB modif because ocean has no slip boundary condition
502                  zu_ice2       = 0.5*( (u_ice(ji,jj)+u_ice(ji-1,jj))*e2t(ji,jj)     &
503                     &                 + (u_ice(ji,jj+1)+u_ice(ji-1,jj+1))*e2t(ji,jj+1))   &
504                     &               /(e2t(ji,jj+1)+e2t(ji,jj)) * tmv(ji,jj)
505                  za           = rhoco*SQRT((zu_ice2-u_oce2(ji,jj))**2 + & 
506                     (v_ice(ji,jj)-v_oce2(ji,jj))**2)*(1.0-zfrld2(ji,jj))
507                  zr           = z0*v_ice(ji,jj) + zf2(ji,jj) + &
508                     za2ct(ji,jj) + za*(cangvg*v_oce2(ji,jj)+zsang*u_oce2(ji,jj))
509                  zcca         = z0+za*cangvg
510                  zccb         = zcorl2(ji,jj)+za*zsang
511                  v_ice(ji,jj) = (zr-zccb*zu_ice2)/(zcca+epsd)*zmask
512
513               END DO
514            END DO
515
516            CALL lbc_lnk( v_ice(:,:), 'V', -1. )
517
518         ELSE 
519!CDIR NOVERRCHK
520            DO jj = k_j1+1, k_jpj-1
521!CDIR NOVERRCHK
522               DO ji = fs_2, fs_jpim1
523                  zmask        = (1.0-MAX(rzero,SIGN(rone,-zmass2(ji,jj))))*tmv(ji,jj)
524                  zsang        = SIGN(1.0,fcor(ji,jj))*sangvg
525                  z0           = zmass2(ji,jj)/dtevp
526                  ! SB modif because ocean has no slip boundary condition
527                  zu_ice2       = 0.5*( (u_ice(ji,jj)+u_ice(ji-1,jj))*e2t(ji,jj)      &
528                     &                 +(u_ice(ji,jj+1)+u_ice(ji-1,jj+1))*e2t(ji,jj+1))   &
529                     &               /(e2t(ji,jj+1)+e2t(ji,jj)) * tmv(ji,jj)   
530
531                  za           = rhoco*SQRT((zu_ice2-u_oce2(ji,jj))**2 + &
532                     (v_ice(ji,jj)-v_oce2(ji,jj))**2)*(1.0-zfrld2(ji,jj))
533                  zr           = z0*v_ice(ji,jj) + zf2(ji,jj) + &
534                     za2ct(ji,jj) + za*(cangvg*v_oce2(ji,jj)+zsang*u_oce2(ji,jj))
535                  zcca         = z0+za*cangvg
536                  zccb         = zcorl2(ji,jj)+za*zsang
537                  v_ice(ji,jj) = (zr-zccb*zu_ice2)/(zcca+epsd)*zmask
538
539               END DO
540            END DO
541
542            CALL lbc_lnk( v_ice(:,:), 'V', -1. )
543
544!CDIR NOVERRCHK
545            DO jj = k_j1+1, k_jpj-1
546!CDIR NOVERRCHK
547               DO ji = fs_2, fs_jpim1
548                  zmask        = (1.0-MAX(rzero,SIGN(rone,-zmass1(ji,jj))))*tmu(ji,jj)
549                  zsang        = SIGN(1.0,fcor(ji,jj))*sangvg
550                  z0           = zmass1(ji,jj)/dtevp
551                  ! SB modif because ocean has no slip boundary condition
552                  ! GG Bug
553                  !                   zv_ice1       = 0.5*( (v_ice(ji,jj)+v_ice(ji,jj-1))*e1t(ji+1,jj)      &
554                  !                      &                 +(v_ice(ji+1,jj)+v_ice(ji+1,jj-1))*e1t(ji,jj))   &
555                  !                      &               /(e1t(ji+1,jj)+e1t(ji,jj)) * tmu(ji,jj)
556                  zv_ice1       = 0.5*( (v_ice(ji,jj)+v_ice(ji,jj-1))*e1t(ji,jj)      &
557                     &                 +(v_ice(ji+1,jj)+v_ice(ji+1,jj-1))*e1t(ji+1,jj))   &
558                     &               /(e1t(ji+1,jj)+e1t(ji,jj)) * tmu(ji,jj)
559
560                  za           = rhoco*SQRT((u_ice(ji,jj)-u_oce1(ji,jj))**2 + &
561                     (zv_ice1-v_oce1(ji,jj))**2)*(1.0-zfrld1(ji,jj))
562                  zr           = z0*u_ice(ji,jj) + zf1(ji,jj) + za1ct(ji,jj) + &
563                     za*(cangvg*u_oce1(ji,jj)-zsang*v_oce1(ji,jj))
564                  zcca         = z0+za*cangvg
565                  zccb         = zcorl1(ji,jj)+za*zsang
566                  u_ice(ji,jj) = (zr+zccb*zv_ice1)/(zcca+epsd)*zmask 
567               END DO ! ji
568            END DO ! jj
569
570            CALL lbc_lnk( u_ice(:,:), 'U', -1. )
571
572         ENDIF
573
574         IF(ln_ctl) THEN
575            !---  Convergence test.
576            DO jj = k_j1+1 , k_jpj-1
577               zresr(:,jj) = MAX( ABS( u_ice(:,jj) - zu_ice(:,jj) ) ,           &
578                  ABS( v_ice(:,jj) - zv_ice(:,jj) ) )
579            END DO
580            zresm = MAXVAL( zresr( 1:jpi , k_j1+1:k_jpj-1 ) )
581            IF( lk_mpp )   CALL mpp_max( zresm )   ! max over the global domain
582         ENDIF
583
584         !                                                   ! ==================== !
585      END DO                                              !  end loop over jter  !
586      !                                                   ! ==================== !
587
588      !
589      !------------------------------------------------------------------------------!
590      ! 4) Prevent ice velocities when the ice is thin
591      !------------------------------------------------------------------------------!
592      !
593      ! If the ice thickness is below 1cm then ice velocity should equal the
594      ! ocean velocity,
595      ! This prevents high velocity when ice is thin
596!CDIR NOVERRCHK
597      DO jj = k_j1+1, k_jpj-1
598!CDIR NOVERRCHK
599         DO ji = fs_2, fs_jpim1
600            zindb  = MAX( 0.0, SIGN( 1.0, at_i(ji,jj) - 1.0e-6 ) ) 
601            zdummy = zindb * vt_i(ji,jj) / MAX(at_i(ji,jj) , 1.0e-06 )
602            IF ( zdummy .LE. 5.0e-2 ) THEN
603               u_ice(ji,jj) = u_oce(ji,jj)
604               v_ice(ji,jj) = v_oce(ji,jj)
605            ENDIF ! zdummy
606         END DO
607      END DO
608
609      CALL lbc_lnk( u_ice(:,:), 'U', -1. ) 
610      CALL lbc_lnk( v_ice(:,:), 'V', -1. ) 
611
612      DO jj = k_j1+1, k_jpj-1 
613         DO ji = fs_2, fs_jpim1
614            zindb  = MAX( 0.0, SIGN( 1.0, at_i(ji,jj) - 1.0e-6 ) ) 
615            zdummy = zindb * vt_i(ji,jj) / MAX(at_i(ji,jj) , 1.0e-06 )
616            IF ( zdummy .LE. 5.0e-2 ) THEN
617               v_ice1(ji,jj)  = 0.5*( (v_ice(ji,jj)+v_ice(ji,jj-1))*e1t(ji+1,jj)   &
618                  &                 +(v_ice(ji+1,jj)+v_ice(ji+1,jj-1))*e1t(ji,jj)) &
619                  &               /(e1t(ji+1,jj)+e1t(ji,jj)) * tmu(ji,jj)
620
621               u_ice2(ji,jj)  = 0.5*( (u_ice(ji,jj)+u_ice(ji-1,jj))*e2t(ji,jj+1)   &
622                  &                 +(u_ice(ji,jj+1)+u_ice(ji-1,jj+1))*e2t(ji,jj)) &
623                  &               /(e2t(ji,jj+1)+e2t(ji,jj)) * tmv(ji,jj)
624            ENDIF ! zdummy
625         END DO
626      END DO
627
628      CALL lbc_lnk( u_ice2(:,:), 'V', -1. ) 
629      CALL lbc_lnk( v_ice1(:,:), 'U', -1. )
630
631      ! Recompute delta, shear and div, inputs for mechanical redistribution
632!CDIR NOVERRCHK
633      DO jj = k_j1+1, k_jpj-1
634!CDIR NOVERRCHK
635         DO ji = fs_2, jpim1   !RB bug no vect opt due to tmi
636            !- zdd(:,:), zdt(:,:): divergence and tension at centre
637            !- zds(:,:): shear on northeast corner of grid cells
638            zindb  = MAX( 0.0, SIGN( 1.0, at_i(ji,jj) - 1.0e-6 ) ) 
639            zdummy = zindb * vt_i(ji,jj) / MAX(at_i(ji,jj) , 1.0e-06 )
640
641            IF ( zdummy .LE. 5.0e-2 ) THEN
642
643               zdd(ji,jj) = ( e2u(ji,jj)*u_ice(ji,jj)                      &
644                  &          -e2u(ji-1,jj)*u_ice(ji-1,jj)                  &
645                  &          +e1v(ji,jj)*v_ice(ji,jj)                      &
646                  &          -e1v(ji,jj-1)*v_ice(ji,jj-1)                  &
647                  &         )                                              &
648                  &         / area(ji,jj)
649
650               zdt(ji,jj) = ( ( u_ice(ji,jj)/e2u(ji,jj)                    &
651                  &            -u_ice(ji-1,jj)/e2u(ji-1,jj)                &
652                  &           )*e2t(ji,jj)*e2t(ji,jj)                      &
653                  &          -( v_ice(ji,jj)/e1v(ji,jj)                    &
654                  &            -v_ice(ji,jj-1)/e1v(ji,jj-1)                &
655                  &           )*e1t(ji,jj)*e1t(ji,jj)                      &
656                  &         )                                              &
657                  &        / area(ji,jj)
658               !
659               ! SB modif because ocean has no slip boundary condition
660               zds(ji,jj) = ( ( u_ice(ji,jj+1) / e1u(ji,jj+1)              &
661                  &           - u_ice(ji,jj)   / e1u(ji,jj) )              &
662                  &           * e1f(ji,jj) * e1f(ji,jj)                    &
663                  &          + ( v_ice(ji+1,jj) / e2v(ji+1,jj)             &
664                  &            - v_ice(ji,jj)  / e2v(ji,jj) )              &
665                  &           * e2f(ji,jj) * e2f(ji,jj) )                  &
666                  &        / ( e1f(ji,jj) * e2f(ji,jj) ) * ( 2.0 - tmf(ji,jj) ) &
667                  &        * tmi(ji,jj) * tmi(ji,jj+1)                     &
668                  &        * tmi(ji+1,jj) * tmi(ji+1,jj+1)
669
670               zdst       = (  e2u( ji  , jj   ) * v_ice1(ji,jj)          &
671                  &          - e2u( ji-1, jj   ) * v_ice1(ji-1,jj)         &
672                  &          + e1v( ji  , jj   ) * u_ice2(ji,jj)           &
673                  &          - e1v( ji  , jj-1 ) * u_ice2(ji,jj-1)         & 
674                  &          )                                             &
675                  &         / area(ji,jj)
676
677               deltat(ji,jj) = SQRT( zdd(ji,jj)*zdd(ji,jj) + & 
678                  &                          ( zdt(ji,jj)*zdt(ji,jj) + zdst*zdst ) * usecc2 & 
679                  &                          ) + creepl
680
681            ENDIF ! zdummy
682
683         END DO !jj
684      END DO !ji
685      !
686      !------------------------------------------------------------------------------!
687      ! 5) Store stress tensor and its invariants
688      !------------------------------------------------------------------------------!
689      !
690      ! * Invariants of the stress tensor are required for limitd_me
691      ! accelerates convergence and improves stability
692      DO jj = k_j1+1, k_jpj-1
693         DO ji = fs_2, fs_jpim1
694            divu_i (ji,jj) = zdd   (ji,jj)
695            delta_i(ji,jj) = deltat(ji,jj)
696            shear_i(ji,jj) = zds   (ji,jj)
697         END DO
698      END DO
699
700      ! Lateral boundary condition
701      CALL lbc_lnk( divu_i (:,:), 'T', 1. )
702      CALL lbc_lnk( delta_i(:,:), 'T', 1. )
703      CALL lbc_lnk( shear_i(:,:), 'F', 1. )
704
705      ! * Store the stress tensor for the next time step
706      stress1_i (:,:) = zs1 (:,:)
707      stress2_i (:,:) = zs2 (:,:)
708      stress12_i(:,:) = zs12(:,:)
709
710      !
711      !------------------------------------------------------------------------------!
712      ! 6) Control prints of residual and charge ellipse
713      !------------------------------------------------------------------------------!
714      !
715      ! print the residual for convergence
716      IF(ln_ctl) THEN
717         WRITE(charout,FMT="('lim_rhg  : res =',D23.16, ' iter =',I4)") zresm, jter
718         CALL prt_ctl_info(charout)
719         CALL prt_ctl(tab2d_1=u_ice, clinfo1=' lim_rhg  : u_ice :', tab2d_2=v_ice, clinfo2=' v_ice :')
720      ENDIF
721
722      ! print charge ellipse
723      ! This can be desactivated once the user is sure that the stress state
724      ! lie on the charge ellipse. See Bouillon et al. 08 for more details
725      IF(ln_ctl) THEN
726         CALL prt_ctl_info('lim_rhg  : numit  :',ivar1=numit)
727         CALL prt_ctl_info('lim_rhg  : nwrite :',ivar1=nwrite)
728         CALL prt_ctl_info('lim_rhg  : MOD    :',ivar1=MOD(numit,nwrite))
729         IF( MOD(numit,nwrite) .EQ. 0 ) THEN
730            WRITE(charout,FMT="('lim_rhg  :', I4, I6, I1, I1, A10)") 1000, numit, 0, 0, ' ch. ell. '
731            CALL prt_ctl_info(charout)
732            DO jj = k_j1+1, k_jpj-1
733               DO ji = 2, jpim1
734                  IF (zpresh(ji,jj) .GT. 1.0) THEN
735                     sigma1 = ( zs1(ji,jj) + (zs2(ji,jj)**2 + 4*zs12(ji,jj)**2 )**0.5 ) / ( 2*zpresh(ji,jj) ) 
736                     sigma2 = ( zs1(ji,jj) - (zs2(ji,jj)**2 + 4*zs12(ji,jj)**2 )**0.5 ) / ( 2*zpresh(ji,jj) )
737                     WRITE(charout,FMT="('lim_rhg  :', I4, I4, D23.16, D23.16, D23.16, D23.16, A10)")
738                     CALL prt_ctl_info(charout)
739                  ENDIF
740               END DO
741            END DO
742            WRITE(charout,FMT="('lim_rhg  :', I4, I6, I1, I1, A10)") 2000, numit, 0, 0, ' ch. ell. '
743            CALL prt_ctl_info(charout)
744         ENDIF
745      ENDIF
746
747   END SUBROUTINE lim_rhg
748
749#else
750   !!----------------------------------------------------------------------
751   !!   Default option          Dummy module           NO LIM sea-ice model
752   !!----------------------------------------------------------------------
753CONTAINS
754   SUBROUTINE lim_rhg( k1 , k2 )         ! Dummy routine
755      WRITE(*,*) 'lim_rhg: You should not have seen this print! error?', k1, k2
756   END SUBROUTINE lim_rhg
757#endif
758
759   !!==============================================================================
760END MODULE limrhg
Note: See TracBrowser for help on using the repository browser.