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

source: tags/nemo_v3_2_2/NEMO/LIM_SRC_3/limrhg.F90 @ 3532

Last change on this file since 3532 was 2477, checked in by cetlod, 13 years ago

v3.2:remove hardcoded value of num_sal in limrst.F90, see ticket #633

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