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

Last change on this file since 2382 was 2370, checked in by gm, 13 years ago

v3.3beta: ice-ocean stress at kt with VP & EVP (LIM-2 and -3)

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