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

source: trunk/NEMO/LIM_SRC_3/limrhg.F90 @ 1264

Last change on this file since 1264 was 1244, checked in by ctlod, 15 years ago

improve the LIM 3.0 stability in using sea surface height, see ticket: #286

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