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

source: branches/nemo_v3_3_beta/NEMOGCM/NEMO/LIM_SRC_3/limrhg.F90 @ 2357

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

Adaptation for nec compiler in limrhg.F90,part 2

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