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

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

source: tags/nemo_v3_2/nemo_v3_2/NEMO/LIM_SRC_3/limrhg.F90 @ 1878

Last change on this file since 1878 was 1878, checked in by flavoni, 14 years ago

initial test for nemogcm

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