New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
limrhg.F90 in trunk/NEMOGCM/NEMO/LIM_SRC_3 – NEMO

source: trunk/NEMOGCM/NEMO/LIM_SRC_3/limrhg.F90 @ 3294

Last change on this file since 3294 was 3294, checked in by rblod, 12 years ago

Merge of 3.4beta into the trunk

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