Back to home page

MITgcm

 
 

    


File indexing completed on 2021-06-27 05:11:49 UTC

view on githubraw file Latest commit 4e4ad91a on 2021-06-26 16:30:07 UTC
1cf549c217 Mart*0001 #include "SEAICE_OPTIONS.h"
                0002 
                0003 CBOP
                0004 C !ROUTINE: SEAICE_DO_RIDGING
                0005 C !INTERFACE: ==========================================================
                0006       SUBROUTINE SEAICE_DO_RIDGING(
                0007      I     bi, bj, myTime, myIter, myThid )
                0008 
                0009 C !DESCRIPTION: \bv
                0010 C     *===========================================================*
                0011 C     | SUBROUTINE SEAICE_DO_RIDGING
                0012 C     | o compute mechanical redistribution of thin (undeformed) into
                0013 C     |   thick (deformed, i.e. ridged) ice categories
                0014 C     |   according to Thorndyke et al (1975) and Hibler (1980)
                0015 C     |   or Bitz et al (2001) and Lipscomb et al (2007)
                0016 C     |
                0017 C     | Martin Losch, Apr. 2014, Martin.Losch@awi.de
                0018 C     *===========================================================*
                0019 C \ev
                0020 
                0021 C !USES: ===============================================================
                0022       IMPLICIT NONE
                0023 
                0024 #include "SIZE.h"
                0025 #include "EEPARAMS.h"
                0026 #include "PARAMS.h"
                0027 #include "GRID.h"
                0028 #include "SEAICE_SIZE.h"
                0029 #include "SEAICE_PARAMS.h"
                0030 #include "SEAICE.h"
                0031 
                0032 C !INPUT PARAMETERS: ===================================================
                0033 C     === Routine arguments ===
                0034 C     bi, bj    :: outer loop counters
                0035 C     myTime    :: current time
                0036 C     myIter    :: iteration number
                0037 C     myThid    :: Thread no. that called this routine.
                0038       _RL myTime
                0039       INTEGER bi,bj
                0040       INTEGER myIter
                0041       INTEGER myThid
                0042 CEndOfInterface
                0043 
                0044 C !LOCAL VARIABLES: ====================================================
                0045 C     === Local variables ===
                0046 C     i,j,k       :: inner loop counters
                0047 C     openWater   :: open water area fraction
                0048 C
                0049       INTEGER i, j
                0050       INTEGER iMin, iMax, jMin, jMax
                0051 #ifdef SEAICE_ITD
                0052       INTEGER k, l, n
                0053       _RL ridgingModeNorm (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
                0054       _RL partFunc        (1-OLx:sNx+OLx,1-OLy:sNy+OLy,0:nITD)
                0055 C     ridgeRatio :: mean ridge thickness/ thickness of ridging ice
                0056 C     hrMin      :: min ridge thickness
                0057 C     hrMax      :: max ridge thickness   (SEAICEredistFunc = 0)
                0058 C     hrExp      :: ridge e-folding scale (SEAICEredistFunc = 1)
                0059       _RL hrMin           (1-OLx:sNx+OLx,1-OLy:sNy+OLy,1:nITD)
                0060       _RL hrMax           (1-OLx:sNx+OLx,1-OLy:sNy+OLy,1:nITD)
                0061       _RL hrExp           (1-OLx:sNx+OLx,1-OLy:sNy+OLy,1:nITD)
                0062       _RL ridgeRatio      (1-OLx:sNx+OLx,1-OLy:sNy+OLy,1:nITD)
353a8877c7 Mart*0063 C     computed and returned by S/R seaice_prepare_ridging, but not needed here
37d4930619 Jean*0064       _RL hActual         (1-OLx:sNx+OLx,1-OLy:sNy+OLy,1:nITD)
1cf549c217 Mart*0065 C
                0066       _RL openWater       (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
                0067       _RL netArea         (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
                0068 C     variables related to ridging schemes
                0069       _RL openingRate     (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
                0070       _RL closingRate     (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
                0071       _RL grossClosing    (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
                0072 C     amount of ice that participates in ridging (according to partFunc)
                0073       _RL ridgingArea     (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
                0074       _RL ridgingHeff     (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
                0075       _RL ridgingHsnw     (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
                0076 C     fractions of deformed/ridged ice
                0077       _RL areaFraction    (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
                0078       _RL volFraction     (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
                0079 C     absolute area/concentration of deformed/ridged ice
                0080       _RL ridgedArea      (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
                0081       LOGICAL doRidging   (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
                0082       LOGICAL doRidgeAgain, areaTooLarge
                0083 C
                0084       _RL recip_deltaT, convergence, divergence, shear, divAdv
                0085       _RL tmp, tmpFac, hL, hR, expL, expR
37d4930619 Jean*0086       _RL areaPR          (1-OLx:sNx+OLx,1-OLy:sNy+OLy,1:nITD)
                0087       _RL heffPR          (1-OLx:sNx+OLx,1-OLy:sNy+OLy,1:nITD)
                0088       _RL hsnwPR          (1-OLx:sNx+OLx,1-OLy:sNy+OLy,1:nITD)
                0089 C
badaa21155 Mart*0090       CHARACTER*(MAX_LEN_MBUF) msgBuf
1cf549c217 Mart*0091 #endif /* SEAICE_ITD */
                0092 CEOP
                0093 
                0094 C---+-|--1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
                0095 
                0096       iMin=1
                0097       iMax=sNx
                0098       jMin=1
                0099       jMax=sNy
37d4930619 Jean*0100 #ifndef SEAICE_ITD
1cf549c217 Mart*0101 C     Hiblers "ridging function" for single category ice
                0102       DO j=jMin,jMax
                0103        DO i=iMin,iMax
4e4ad91a39 Jean*0104         AREA(i,j,bi,bj) = MIN(AREA(i,j,bi,bj),SEAICE_area_max)
1cf549c217 Mart*0105        ENDDO
                0106       ENDDO
                0107 #else
                0108 C     calculate area of open water
                0109       DO j=jMin,jMax
                0110        DO i=iMin,iMax
                0111         openWater(i,j) = ONE
                0112        ENDDO
                0113       ENDDO
                0114       DO k=1,nITD
                0115        DO j=jMin,jMax
                0116         DO i=iMin,iMax
                0117          openWater(i,j) = openWater(i,j) - AREAITD(i,j,k,bi,bj)
                0118         ENDDO
                0119        ENDDO
                0120       ENDDO
                0121       IF ( SEAICEsimpleRidging ) THEN
                0122 C--   Hibler-type "ridging", i.e. cut back excessive ice area fraction ---
                0123 C     in case ice concentration exceeds 100% assume that
                0124 C     convergence of floe field has eliminated all open water
37d4930619 Jean*0125 C     and eventual rafting occured in thinnest category:
1cf549c217 Mart*0126        DO j=jMin,jMax
                0127         DO i=iMin,iMax
                0128          IF (openWater(i,j) .lt. 0.0)
                0129      &        AREAITD(i,j,1,bi,bj) = openWater(i,j)+AREAITD(i,j,1,bi,bj)
                0130         ENDDO
                0131        ENDDO
                0132 C---+-|--1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
                0133       ELSE
353a8877c7 Mart*0134 C     initialisation
                0135       DO j=jMin,jMax
                0136        DO i=iMin,iMax
                0137         ridgingArea(i,j)       = 0. _d 0
                0138         ridgingHeff(i,j)       = 0. _d 0
                0139         ridgingHsnw(i,j)       = 0. _d 0
                0140         areaFraction(i,j)      = 0. _d 0
                0141         volFraction(i,j)       = 0. _d 0
                0142         fw2ObyRidge(i,j,bi,bj) = 0. _d 0
06c98f766d Mart*0143         ridgedArea(i,j)        = 0. _d 0
353a8877c7 Mart*0144        ENDDO
                0145       ENDDO
                0146       CALL SEAICE_PREPARE_RIDGING(
                0147      O     hActual,
                0148      O     hrMin, hrMax, hrExp, ridgeRatio, ridgingModeNorm, partFunc,
                0149      I     iMin, iMax, jMin, jMax, bi, bj, myTime, myIter, myThid )
1cf549c217 Mart*0150 C     Compute the first strain rate invariant epsilonI (divergence)
                0151 C     energy dissipation by convergence = -min (divergence, 0)
                0152 C     energy dissipation by shearing    = (1/2) * (Delta - abs(divergence))
                0153       DO j=jMin,jMax
                0154        DO i=iMin,iMax
                0155         divergence  = e11(i,j,bi,bj) + e22(i,j,bi,bj)
                0156         shear       = 0.5 _d 0 * ( deltaC(i,j,bi,bj) - ABS(divergence) )
                0157         convergence = - MIN(divergence, 0.D0)
                0158         closingRate(i,j) = SEAICEshearParm*shear + convergence
                0159        ENDDO
                0160       ENDDO
37d4930619 Jean*0161 C     we need a new estimate of the total AREA (including the open water
1cf549c217 Mart*0162 C     fraction, but for computational reason it is not included here)
                0163       DO j=jMin,jMax
                0164        DO i=iMin,iMax
                0165         netArea(i,j) = 0. _d 0
                0166        ENDDO
                0167       ENDDO
                0168       DO k=1,nITD
                0169        DO j=jMin,jMax
                0170         DO i=iMin,iMax
                0171          netArea(i,j) = netArea(i,j) + AREAITD(i,j,k,bi,bj)
                0172         ENDDO
                0173        ENDDO
                0174       ENDDO
                0175       recip_DeltaT = 1. _d 0/SEAICE_deltaTtherm
                0176       DO j=jMin,jMax
                0177        DO i=iMin,iMax
37d4930619 Jean*0178 C     divergence rate due to advection; this term need not be zero due
                0179 C     to numerical effects
1cf549c217 Mart*0180 C     (this is copied from CICE but I am not sure about that)
                0181         divAdv = (1. _d 0-netArea(i,j)-opnWtrFrac(i,j,bi,bj))
                0182      &       *recip_deltaT
37d4930619 Jean*0183         IF (divAdv .LT. 0. _d 0)
1cf549c217 Mart*0184      &       closingRate(i,j) = MAX(closingRate(i,j), -divAdv)
badaa21155 Mart*0185 C     finally compute a non-negative opening rate that will lead to
                0186 C     a net area of 1
1cf549c217 Mart*0187         openingRate(i,j) = closingRate(i,j) + divAdv
                0188        ENDDO
                0189       ENDDO
                0190 C
                0191 C     start of the ridging loop
                0192 C
                0193       doRidgeAgain = .TRUE.
                0194       n = 1
                0195       DO WHILE (doRidgeAgain)
                0196 C     save pre-ridging ice concentration and ridged ice volume
                0197       DO k=1,nITD
                0198        DO j=jMin,jMax
                0199         DO i=iMin,iMax
                0200          areaPR(i,j,k) = AREAITD(i,j,k,bi,bj)
badaa21155 Mart*0201          heffPR(i,j,k) = HEFFITD(i,j,k,bi,bj)
                0202          hsnwPR(i,j,k) = HSNOWITD(i,j,k,bi,bj)
37d4930619 Jean*0203 C        ridgeFrac(i,j,k) = 0. _d 0
1cf549c217 Mart*0204 C        IF (HEFFITD(i,j,k,bi,bj) .GT. 0. _d 0 )
                0205 C   &     ridgeFrac(i,j,k) = ridgedHeff/HEFF
                0206         ENDDO
                0207        ENDDO
                0208       ENDDO
37d4930619 Jean*0209 C
1cf549c217 Mart*0210       DO j=jMin,jMax
                0211        DO i=iMin,iMax
                0212 C     Based on the ITD of ridging and ridged ice, convert the net
                0213 C     closing rate to a gross closing rate times deltaT.
                0214 C     NOTE: 0 < ridgingModeNorm <= 1
                0215         grossClosing(i,j) = closingRate(i,j)*SEAICE_deltaTtherm
                0216      &       /ridgingModeNorm(i,j)
                0217 C     reduce rates in case more than 100% of open water would be removed
                0218         IF ( partFunc(i,j,0) .GT. 0. _d 0 ) THEN
                0219          tmp = partFunc(i,j,0)*grossClosing(i,j)
                0220          IF ( tmp .GT. opnWtrFrac(i,j,bi,bj) ) THEN
                0221           tmpFac = opnWtrFrac(i,j,bi,bj)/tmp
                0222           grossClosing(i,j) = grossClosing(i,j) * tmpFac
                0223           openingRate(i,j)  =  openingRate(i,j) * tmpFac
                0224          ENDIF
                0225         ENDIF
                0226        ENDDO
                0227       ENDDO
                0228       DO k=1,nITD
                0229        DO j=jMin,jMax
                0230         DO i=iMin,iMax
                0231 C     reduce rates in case more than 100% of any ice categroy would be removed
37d4930619 Jean*0232          IF ( areaPR(i,j,k) .GT. SEAICE_area_reg
1cf549c217 Mart*0233      &        .AND. partFunc(i,j,k) .GT. 0. _d 0 ) THEN
                0234           tmp = partFunc(i,j,k)*grossClosing(i,j)
                0235           IF ( tmp .GT. AREAITD(i,j,k,bi,bj) ) THEN
                0236            tmpFac = AREAITD(i,j,k,bi,bj)/tmp
                0237            grossClosing(i,j) = grossClosing(i,j) * tmpFac
                0238            openingRate(i,j)  =  openingRate(i,j) * tmpFac
                0239           ENDIF
                0240          ENDIF
                0241         ENDDO
                0242        ENDDO
                0243       ENDDO
                0244 C
                0245 C     start redistribution
37d4930619 Jean*0246 C
1cf549c217 Mart*0247       DO j=jMin,jMax
                0248        DO i=iMin,iMax
                0249 C     open water first
37d4930619 Jean*0250         opnWtrFrac(i,j,bi,bj) = opnWtrFrac(i,j,bi,bj)
1cf549c217 Mart*0251      &       - partFunc(i,j,0)*grossClosing(i,j)
                0252      &       + openingRate(i,j)*SEAICE_deltaTtherm
badaa21155 Mart*0253 C     need to catch openWater << 0 properly
                0254 C     negative open water it not allowed
                0255         opnWtrFrac(i,j,bi,bj) = MAX( 0. _d 0, opnWtrFrac(i,j,bi,bj) )
1cf549c217 Mart*0256        ENDDO
                0257       ENDDO
37d4930619 Jean*0258 C
1cf549c217 Mart*0259       DO k=1,nITD
                0260 C     need to catch partFunc*grossClosing > AREAITD (or areaPR)
                0261        DO j=jMin,jMax
                0262         DO i=iMin,iMax
                0263          doRidging(i,j) = areaPR(i,j,k) .GT. SEAICE_area_reg
37d4930619 Jean*0264      &        .AND. partFunc(i,j,k) .GT. 0. _d 0
1cf549c217 Mart*0265      &        .AND. grossClosing(i,j) .GT. 0. _d 0
                0266      &        .AND. HEFFM(i,j,bi,bj) .GT. 0. _d 0
                0267 C     this would be safety catch only
                0268 C     &        .AND. netArea(i,j) .GT. 1. _d 0
                0269          IF ( doRidging(i,j) ) THEN
                0270 CML          ridgingArea(i,j) = MIN(partFunc(i,j,k)*grossClosing(i,j),
                0271 CML     &         areaPR(i,j,k))
                0272           ridgingArea(i,j) = partFunc(i,j,k)*grossClosing(i,j)
37d4930619 Jean*0273           IF ( ridgingArea(i,j) .GT. areaPR(i,j,k) ) THEN
1cf549c217 Mart*0274            ridgingArea(i,j) = areaPR(i,j,k)
                0275           ENDIF
                0276           areaFraction(i,j) = ridgingArea(i,j)/areaPR(i,j,k)
                0277           ridgedArea(i,j)   = ridgingArea(i,j)/ridgeRatio(i,j,k)
                0278 C     compute ice volume (HEFF) and snow volume to be removed from this
                0279 C     ridging category
badaa21155 Mart*0280           ridgingHEFF(i,j) = heffPR(i,j,k) * areaFraction(i,j)
                0281           ridgingHsnw(i,j) = hsnwPR(i,j,k) * areaFraction(i,j)
1cf549c217 Mart*0282 C     part of the snow mass is pushed into the ocean during ridging;
37d4930619 Jean*0283 C     this freshwater flux will be added to the net feshwater flux into
1cf549c217 Mart*0284 C     the ocean in seaice_growth
37d4930619 Jean*0285           fw2ObyRidge(i,j,bi,bj) = fw2ObyRidge(i,j,bi,bj)
1cf549c217 Mart*0286      &         + SEAICE_rhoSnow*ridgingHsnw(i,j)
                0287      &         *(1. _d 0 - SEAICEsnowFracRidge)
                0288 C     reduce the snow volume that is left for redistribution
                0289           ridgingHsnw(i,j) = ridgingHsnw(i,j) * SEAICEsnowFracRidge
                0290 C     remove ice concentration, volume (HEFF), and snow volume from
                0291 C     this ridging category
                0292           AREAITD(i,j,k,bi,bj) = AREAITD(i,j,k,bi,bj) - ridgingArea(i,j)
                0293           HEFFITD(i,j,k,bi,bj) = HEFFITD(i,j,k,bi,bj) - ridgingHeff(i,j)
                0294           HSNOWITD(i,j,k,bi,bj)=HSNOWITD(i,j,k,bi,bj) - ridgingHsnw(i,j)
                0295          ENDIF
                0296         ENDDO
                0297        ENDDO
37d4930619 Jean*0298 C     inner loop over categories: distribute what has been removed from the
1cf549c217 Mart*0299 C     kth category to all categories according to area/volFraction
                0300        DO l=1,nITD
06c98f766d Mart*0301 C     initialising these is essential, because here the ridging-mask doRidging
                0302 C     to area/volFraction, and applied via these fields
1cf549c217 Mart*0303         DO j=jMin,jMax
                0304          DO i=iMin,iMax
                0305           areaFraction(i,j) = 0. _d 0
                0306           volFraction (i,j) = 0. _d 0
                0307          ENDDO
                0308         ENDDO
                0309         IF ( SEAICEredistFunc .EQ. 0 ) THEN
                0310 C     Assume ridged ice is uniformly distributed between hrmin and hrmax
                0311 C     (Hibler, 1980), see also s/r seaice_prepare_ridging.
                0312          DO j=jMin,jMax
                0313           DO i=iMin,iMax
                0314            IF ( doRidging(i,j) ) THEN
                0315             IF ( hrMin(i,j,k) .GE. hLimit(l) .OR.
                0316      &           hrMax(i,j,k) .LE. hLimit(l-1) ) THEN
                0317 CML             hL = 0. _d 0
                0318 CML             hR = 0. _d 0
                0319              areaFraction(i,j) = 0. _d 0
                0320              volFraction (i,j) = 0. _d 0
                0321             ELSE
                0322              hL = MAX(hrMin(i,j,k), hLimit(l-1))
                0323              hR = MIN(hrMax(i,j,k), hLimit(l))
37d4930619 Jean*0324              areaFraction(i,j) = ( hR - hL )
1cf549c217 Mart*0325      &            / ( hrMax(i,j,k) - hrMin(i,j,k) )
37d4930619 Jean*0326 CML             volFraction (i,j) = ( hR*hR - hL*hL )
1cf549c217 Mart*0327 CML     &            / ( hrMax(i,j,k)**2 - hrMin(i,j,k)**2 )
37d4930619 Jean*0328              volFraction (i,j) = areaFraction(i,j)*( hR + hL )
1cf549c217 Mart*0329      &            / ( hrMax(i,j,k) + hrMin(i,j,k) )
                0330             ENDIF
                0331            ENDIF
                0332           ENDDO
                0333          ENDDO
                0334         ELSEIF ( SEAICEredistFunc .EQ. 1 ) THEN
                0335 C     Follow Lipscomb et al. (2007) and model ridge ITD as an exponentially
                0336 C     decaying function, see also s/r seaice_prepare_ridging.
                0337          IF ( l.LT.nITD ) THEN
                0338           DO j=jMin,jMax
                0339            DO i=iMin,iMax
37d4930619 Jean*0340             IF ( doRidging(i,j)
                0341      &           .AND. hrMin(i,j,k) .LT. hLimit(l)
1cf549c217 Mart*0342      &           .AND. hrExp(i,j,k) .NE. 0. _d 0 ) THEN
                0343              hL   = MAX( hrMin(i,j,k), hLimit(l-1) )
                0344              hR   = hLimit(l)
                0345              expL = EXP(-( hL - hrMin(i,j,k) )/hrExp(i,j,k) )
                0346              expR = EXP(-( hR - hrMin(i,j,k) )/hrExp(i,j,k) )
                0347              areaFraction(i,j) = expL - expR
                0348              volFraction (i,j) =
                0349      &            ( ( hL + hrExp(i,j,k) ) * expL
                0350      &            - ( hR + hrExp(i,j,k) ) * expR )
                0351      &            / ( hrMin(i,j,k) + hrExp(i,j,k) )
                0352             ENDIF
                0353            ENDDO
                0354           ENDDO
                0355          ELSE
                0356           DO j=jMin,jMax
                0357            DO i=iMin,iMax
                0358             IF ( doRidging(i,j) .AND. hrExp(i,j,k) .NE. 0. _d 0 ) THEN
                0359               hL   = MAX( hrMin(i,j,k), hLimit(l-1) )
                0360               expL = EXP(-( hL - hrMin(i,j,k) )/hrExp(i,j,k) )
                0361               areaFraction(i,j) = expL
                0362               volFraction (i,j) = ( hL + hrExp(i,j,k) ) * expL
                0363      &             / ( hrMin(i,j,k) + hrExp(i,j,k) )
                0364              ENDIF
                0365            ENDDO
                0366           ENDDO
                0367          ENDIF
37d4930619 Jean*0368         ENDIF
                0369 C     after computing the fraction ridged ice for this category, apply it
1cf549c217 Mart*0370         DO j=jMin,jMax
                0371          DO i=iMin,iMax
                0372           AREAITD(i,j,l,bi,bj) = AREAITD(i,j,l,bi,bj)
badaa21155 Mart*0373      &         +areaFraction(i,j)*ridgedArea(i,j)
1cf549c217 Mart*0374           HEFFITD(i,j,l,bi,bj) = HEFFITD(i,j,l,bi,bj)
                0375      &         +volFraction(i,j)*ridgingHeff(i,j)
                0376           HSNOWITD(i,j,l,bi,bj) = HSNOWITD(i,j,l,bi,bj)
badaa21155 Mart*0377      &         +volFraction(i,j)*ridgingHsnw(i,j)*SEAICEsnowFracRidge
1cf549c217 Mart*0378          ENDDO
                0379         ENDDO
                0380 C     category l-loop
                0381        ENDDO
                0382 C     category k-loop
                0383       ENDDO
                0384 C     determine if the ridging process needs to be repeated
                0385 C     we need a new estimate of the total AREA
                0386       DO j=jMin,jMax
                0387        DO i=iMin,iMax
                0388         netArea(i,j) = 0. _d 0
                0389        ENDDO
                0390       ENDDO
                0391       DO k=1,nITD
                0392        DO j=jMin,jMax
                0393         DO i=iMin,iMax
                0394          netArea(i,j) = netArea(i,j) + AREAITD(i,j,k,bi,bj)
                0395         ENDDO
                0396        ENDDO
                0397       ENDDO
                0398       doRidgeAgain   = .FALSE.
                0399       DO j=jMin,jMax
                0400        DO i=iMin,iMax
                0401         tmp = netArea(i,j)+opnWtrFrac(i,j,bi,bj)
                0402         areaTooLarge = tmp - 1. _d 0 .GT. 1. _d -11
                0403         IF ( HEFFM(i,j,bi,bj) .GT. 0. _d 0 .AND. areaTooLarge ) THEN
                0404          doRidging(i,j) = .TRUE.
                0405          doRidgeAgain   = .TRUE.
                0406          divAdv = (1. _d 0-tmp)*recip_deltaT
badaa21155 Mart*0407          closingRate(i,j) = MAX( 0. _d 0, -divAdv)
                0408          openingRate(i,j) = MAX( 0. _d 0,  divAdv)
                0409         ELSE
                0410 C     set to zero avoid going through this grid point again
                0411          closingRate(i,j) = 0. _d 0
                0412          openingRate(i,j) = 0. _d 0
44114fe2bb Mart*0413          doRidging(i,j)   = .FALSE.
1cf549c217 Mart*0414         ENDIF
                0415        ENDDO
                0416       ENDDO
badaa21155 Mart*0417       IF ( doRidgeAgain .AND. n.GE.SEAICEridgingIterMax ) THEN
                0418 C     some debugging information
                0419        WRITE(msgBuf,'(A)') 'SEAICE_DO_RIDGING: *** WARNING ***'
                0420        CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
                0421      &      SQUEEZE_RIGHT, myThid )
                0422        WRITE(msgBuf,'(A,I2,A)') 'SEAICE_DO_RIDGING: '//
37d4930619 Jean*0423      &      'did not converge in SEAICEridgingIterMax = ',
badaa21155 Mart*0424      &      SEAICEridgingIterMax, ' iterations.'
                0425        CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
                0426      &      SQUEEZE_RIGHT, myThid )
                0427 CML       CALL PRINT_ERROR( msgBuf, myThid )
                0428       ENDIF
1cf549c217 Mart*0429       doRidgeAgain = doRidgeAgain .AND. n.LT.SEAICEridgingIterMax
badaa21155 Mart*0430       IF ( doRidgeAgain .AND. debugLevel .GE. debLevA ) THEN
                0431 C     some debugging information
37d4930619 Jean*0432        WRITE(msgBuf,'(A,I2,A,I10)')
badaa21155 Mart*0433      &      'SEAICE_DO_RIDGING: Repeat ridging after iteration ',
                0434      &      n, ' in timestep ', myIter
                0435        CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
                0436      &      SQUEEZE_RIGHT, myThid )
                0437       ENDIF
1cf549c217 Mart*0438       IF ( doRidgeAgain ) CALL SEAICE_PREPARE_RIDGING(
353a8877c7 Mart*0439      O     hActual,
1cf549c217 Mart*0440      O     hrMin, hrMax, hrExp, ridgeRatio, ridgingModeNorm, partFunc,
                0441      I     iMin, iMax, jMin, jMax, bi, bj, myTime, myIter, myThid )
                0442       n = n + 1
                0443 C     ridging iteration
                0444       ENDDO
                0445 C     .not. SEAICEsimpleRidging
                0446       ENDIF
                0447 #endif /* SEAICE_ITD */
                0448 
37d4930619 Jean*0449 C     after ridging is complete, the critical variables need to be
                0450 C     regularized and checked for consistency. This is done in a separate
1cf549c217 Mart*0451 C     routine
                0452 CML      CALL SEAICE_REGULARIZE( bi, bj, myTime, myIter, myThid )
                0453 
                0454       RETURN
                0455       END