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

Last change on this file since 3394 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
RevLine 
[825]1MODULE limrhg
2   !!======================================================================
3   !!                     ***  MODULE  limrhg  ***
[834]4   !!   Ice rheology : sea ice rheology
[825]5   !!======================================================================
[1244]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
[2528]9   !!            3.3  !  2009-05  (G.Garric) addition of the lim2_evp cas
[2715]10   !!            4.0  !  2011-01  (A Porter)  dynamical allocation
[1244]11   !!----------------------------------------------------------------------
[2528]12#if defined key_lim3 || (  defined key_lim2 && ! defined key_lim2_vp )
[825]13   !!----------------------------------------------------------------------
[2528]14   !!   'key_lim3'               OR                     LIM-3 sea-ice model
[2717]15   !!   'key_lim2' AND NOT 'key_lim2_vp'            EVP LIM-2 sea-ice model
[825]16   !!----------------------------------------------------------------------
17   !!   lim_rhg   : computes ice velocities
18   !!----------------------------------------------------------------------
[2528]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
[3294]26   USE wrk_nemo         ! work arrays
[2528]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
[825]37
38   IMPLICIT NONE
39   PRIVATE
40
[2715]41   PUBLIC   lim_rhg        ! routine called by lim_dyn (or lim_dyn_2)
[825]42
[2528]43   REAL(wp) ::   rzero   = 0._wp   ! constant values
44   REAL(wp) ::   rone    = 1._wp   ! constant values
45     
[868]46   !! * Substitutions
47#  include "vectopt_loop_substitute.h90"
[825]48   !!----------------------------------------------------------------------
[2715]49   !! NEMO/LIM3 4.0 , UCL - NEMO Consortium (2011)
[1156]50   !! $Id$
[2528]51   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
[825]52   !!----------------------------------------------------------------------
53CONTAINS
54
55   SUBROUTINE lim_rhg( k_j1, k_jpj )
56      !!-------------------------------------------------------------------
[834]57      !!                 ***  SUBROUTINE lim_rhg  ***
58      !!                          EVP-C-grid
[825]59      !!
[834]60      !! ** purpose : determines sea ice drift from wind stress, ice-ocean
[825]61      !!  stress and sea-surface slope. Ice-ice interaction is described by
[834]62      !!  a non-linear elasto-viscous-plastic (EVP) law including shear
63      !!  strength and a bulk rheology (Hunke and Dukowicz, 2002).   
[825]64      !!
[834]65      !!  The points in the C-grid look like this, dear reader
[825]66      !!
[834]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)
[825]77      !!
[834]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
[825]81      !!
[834]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
[825]86      !!
[834]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      !!
[2528]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
[834]108      !!
[2528]109      INTEGER ::   ji, jj   ! dummy loop indices
110      INTEGER ::   jter     ! local integers
[825]111      CHARACTER (len=50) ::   charout
[2528]112      REAL(wp) ::   zt11, zt12, zt21, zt22, ztagnx, ztagny, delta                         !
113      REAL(wp) ::   za, zstms, zsang, zmask   ! local scalars
[825]114
[2715]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
[825]122
[2715]123      REAL(wp) ::   zresm         ! Maximal error on ice velocity
124      REAL(wp) ::   zindb         ! ice (1) or not (0)     
125      REAL(wp) ::   zdummy        ! dummy argument
[3294]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     
[2528]147      !!-------------------------------------------------------------------
[3294]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
[2528]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
[921]164      !
165      !------------------------------------------------------------------------------!
166      ! 1) Ice-Snow mass (zc1), ice strength (zpresh)                                !
167      !------------------------------------------------------------------------------!
168      !
[825]169      ! Put every vector to 0
[2528]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
[825]174
[2528]175#if defined key_lim3
176      CALL lim_itd_me_icestrength( ridge_scheme_swi )      ! LIM-3: Ice strength on T-points
177#endif
[825]178
[868]179!CDIR NOVERRCHK
[2528]180      DO jj = k_j1 , k_jpj       ! Ice mass and temp variables
[868]181!CDIR NOVERRCHK
[825]182         DO ji = 1 , jpi
183            zc1(ji,jj)    = tms(ji,jj) * ( rhosn * vt_s(ji,jj) + rhoic * vt_i(ji,jj) )
[2528]184#if defined key_lim3
185            zpresh(ji,jj) = tms(ji,jj) *  strength(ji,jj) * 0.5_wp
186#endif
[2580]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
[866]190            ! tmi = 1 where there is ice or on land
[2528]191            tmi(ji,jj)    = 1._wp - ( 1._wp - MAX( 0._wp , SIGN ( 1._wp , vt_i(ji,jj) - epsd ) ) ) * tms(ji,jj)
[825]192         END DO
193      END DO
194
[834]195      ! Ice strength on grid cell corners (zpreshc)
196      ! needed for calculation of shear stress
[868]197!CDIR NOVERRCHK
[825]198      DO jj = k_j1+1, k_jpj-1
[868]199!CDIR NOVERRCHK
200         DO ji = 2, jpim1 !RB caution no fs_ (ji+1,jj+1)
[921]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)
[825]211         END DO
212      END DO
213
214      CALL lbc_lnk( zpreshc(:,:), 'F', 1. )
[921]215      !
216      !------------------------------------------------------------------------------!
217      ! 2) Wind / ocean stress, mass terms, coriolis terms
218      !------------------------------------------------------------------------------!
219      !
[825]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                       
[921]232
[825]233      DO jj = k_j1+1, k_jpj-1
[868]234         DO ji = fs_2, fs_jpim1
[825]235
[2528]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)
[825]240
241            ! Leads area.
[2528]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 )
[825]244
245            ! Mass, coriolis coeff. and currents
[834]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)
[2528]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 )
[825]252            !
[888]253            u_oce1(ji,jj)  = u_oce(ji,jj)
254            v_oce2(ji,jj)  = v_oce(ji,jj)
[825]255
[834]256            ! Ocean has no slip boundary condition
[888]257            v_oce1(ji,jj)  = 0.5*( (v_oce(ji,jj)+v_oce(ji,jj-1))*e1t(ji,jj)    &
[921]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) 
[825]260
[888]261            u_oce2(ji,jj)  = 0.5*((u_oce(ji,jj)+u_oce(ji-1,jj))*e2t(ji,jj)     &
[921]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)
[825]264
[1469]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)
[825]268
[834]269            ! Computation of the velocity field taking into account the ice internal interaction.
[825]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
[834]274
[2528]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)
[825]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
[921]284      !
285      !------------------------------------------------------------------------------!
286      ! 3) Solution of the momentum equation, iterative procedure
287      !------------------------------------------------------------------------------!
288      !
[825]289      ! Time step for subcycling
290      dtevp  = rdt_ice / nevp
[2528]291      dtotel = dtevp / ( 2._wp * telast )
[825]292
293      !-ecc2: square of yield ellipse eccenticrity (reminder: must become a namelist parameter)
[2528]294      ecc2 = ecc * ecc
[825]295
296      !-Initialise stress tensor
[2528]297      zs1 (:,:) = stress1_i (:,:) 
298      zs2 (:,:) = stress2_i (:,:)
[866]299      zs12(:,:) = stress12_i(:,:)
[825]300
[2528]301      !                                               !----------------------!
[868]302      DO jter = 1 , nevp                              !    loop over jter    !
[2528]303         !                                            !----------------------!       
[825]304         DO jj = k_j1, k_jpj-1
[2528]305            zu_ice(:,jj) = u_ice(:,jj)    ! velocity at previous time step
[825]306            zv_ice(:,jj) = v_ice(:,jj)
[921]307         END DO
[825]308
[834]309         DO jj = k_j1+1, k_jpj-1
[988]310            DO ji = fs_2, jpim1   !RB bug no vect opt due to tmi
[825]311
[921]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)
[825]337
[921]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)
[825]346
[921]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)
[825]358
359
[921]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) 
[825]363
[921]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)
[825]367
[921]368            END DO
369         END DO
[2528]370         CALL lbc_lnk( v_ice1, 'U', -1. )   ;   CALL lbc_lnk( u_ice2, 'V', -1. )      ! lateral boundary cond.
[921]371
[868]372!CDIR NOVERRCHK
[921]373         DO jj = k_j1+1, k_jpj-1
[868]374!CDIR NOVERRCHK
[921]375            DO ji = fs_2, fs_jpim1
[825]376
[921]377               !- Calculate Delta at centre of grid cells
[2528]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                  &          )                                          &
[921]383                  &         / area(ji,jj)
[825]384
[2528]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 )
[825]387
[921]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 )
[825]395
[921]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 )
[825]400
[921]401            END DO
402         END DO
[825]403
[921]404         CALL lbc_lnk( zs1(:,:), 'T', 1. )
405         CALL lbc_lnk( zs2(:,:), 'T', 1. )
[825]406
[868]407!CDIR NOVERRCHK
[921]408         DO jj = k_j1+1, k_jpj-1
[868]409!CDIR NOVERRCHK
[921]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) )
[825]420
[921]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) )
[825]429
[921]430               deltac(ji,jj) = SQRT(zddc**2+(zdtc**2+zds(ji,jj)**2)*usecc2) + creepl
[825]431
[921]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 ) 
[825]437
[921]438            END DO ! ji
439         END DO ! jj
[825]440
[921]441         CALL lbc_lnk( zs12(:,:), 'F', 1. )
[825]442
[921]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
[825]459         !
460         ! Computation of ice velocity
461         !
462         ! Both the Coriolis term and the ice-ocean drag are solved semi-implicitly.
463         !
[921]464         IF (MOD(jter,2).eq.0) THEN 
[825]465
[868]466!CDIR NOVERRCHK
[921]467            DO jj = k_j1+1, k_jpj-1
[868]468!CDIR NOVERRCHK
[921]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
[825]473
[921]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 
[825]485
[921]486               END DO
487            END DO
[825]488
[921]489            CALL lbc_lnk( u_ice(:,:), 'U', -1. )
[825]490
[868]491!CDIR NOVERRCHK
[921]492            DO jj = k_j1+1, k_jpj-1
[868]493!CDIR NOVERRCHK
[921]494               DO ji = fs_2, fs_jpim1
[834]495
[921]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
[825]510
[921]511               END DO
512            END DO
[825]513
[921]514            CALL lbc_lnk( v_ice(:,:), 'V', -1. )
[825]515
[834]516         ELSE 
[868]517!CDIR NOVERRCHK
[921]518            DO jj = k_j1+1, k_jpj-1
[868]519!CDIR NOVERRCHK
[921]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)   
[825]528
[921]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
[825]536
[921]537               END DO
538            END DO
[825]539
[921]540            CALL lbc_lnk( v_ice(:,:), 'V', -1. )
[825]541
[868]542!CDIR NOVERRCHK
[921]543            DO jj = k_j1+1, k_jpj-1
[868]544!CDIR NOVERRCHK
[921]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)
[825]557
[921]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
[825]567
[921]568            CALL lbc_lnk( u_ice(:,:), 'U', -1. )
[825]569
[921]570         ENDIF
[825]571
[921]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         !                                                   ! ==================== !
[868]583      END DO                                              !  end loop over jter  !
[825]584      !                                                   ! ==================== !
585
[921]586      !
587      !------------------------------------------------------------------------------!
588      ! 4) Prevent ice velocities when the ice is thin
589      !------------------------------------------------------------------------------!
590      !
[825]591      ! If the ice thickness is below 1cm then ice velocity should equal the
[834]592      ! ocean velocity,
593      ! This prevents high velocity when ice is thin
[868]594!CDIR NOVERRCHK
[825]595      DO jj = k_j1+1, k_jpj-1
[868]596!CDIR NOVERRCHK
597         DO ji = fs_2, fs_jpim1
[825]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
[888]601               u_ice(ji,jj) = u_oce(ji,jj)
602               v_ice(ji,jj) = v_oce(ji,jj)
[825]603            ENDIF ! zdummy
604         END DO
605      END DO
[866]606
[869]607      CALL lbc_lnk( u_ice(:,:), 'U', -1. ) 
608      CALL lbc_lnk( v_ice(:,:), 'V', -1. ) 
609
[868]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
[921]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)
[868]618
[921]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
[868]623         END DO
624      END DO
625
[869]626      CALL lbc_lnk( u_ice2(:,:), 'V', -1. ) 
627      CALL lbc_lnk( v_ice1(:,:), 'U', -1. )
[868]628
[866]629      ! Recompute delta, shear and div, inputs for mechanical redistribution
[868]630!CDIR NOVERRCHK
[825]631      DO jj = k_j1+1, k_jpj-1
[868]632!CDIR NOVERRCHK
[988]633         DO ji = fs_2, jpim1   !RB bug no vect opt due to tmi
[825]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
[921]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)
[825]647
[921]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)
[825]667
[921]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)
[825]674
[921]675               deltat(ji,jj) = SQRT( zdd(ji,jj)*zdd(ji,jj) + & 
676                  &                          ( zdt(ji,jj)*zdt(ji,jj) + zdst*zdst ) * usecc2 & 
677                  &                          ) + creepl
[825]678
[921]679            ENDIF ! zdummy
[825]680
681         END DO !jj
682      END DO !ji
[921]683      !
684      !------------------------------------------------------------------------------!
685      ! 5) Store stress tensor and its invariants
686      !------------------------------------------------------------------------------!
687      !
[866]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
[868]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)
[825]695         END DO
[866]696      END DO
[825]697
[866]698      ! Lateral boundary condition
[868]699      CALL lbc_lnk( divu_i (:,:), 'T', 1. )
[825]700      CALL lbc_lnk( delta_i(:,:), 'T', 1. )
701      CALL lbc_lnk( shear_i(:,:), 'F', 1. )
[866]702
[868]703      ! * Store the stress tensor for the next time step
704      stress1_i (:,:) = zs1 (:,:)
705      stress2_i (:,:) = zs2 (:,:)
706      stress12_i(:,:) = zs12(:,:)
707
[921]708      !
709      !------------------------------------------------------------------------------!
710      ! 6) Control prints of residual and charge ellipse
711      !------------------------------------------------------------------------------!
712      !
[834]713      ! print the residual for convergence
714      IF(ln_ctl) THEN
[868]715         WRITE(charout,FMT="('lim_rhg  : res =',D23.16, ' iter =',I4)") zresm, jter
[834]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
[825]719
[834]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
[825]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
[2715]744      !
[3294]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
[825]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.