/[MITgcm]/MITgcm_contrib/torge/itd/code/seaice_growth.F
ViewVC logotype

Diff of /MITgcm_contrib/torge/itd/code/seaice_growth.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.10 by torge, Mon Oct 22 21:12:47 2012 UTC revision 1.12 by torge, Wed Oct 31 23:04:51 2012 UTC
# Line 134  C     facilitate multi-category snow imp Line 134  C     facilitate multi-category snow imp
134    
135  C     temporary variables available for the various computations  C     temporary variables available for the various computations
136        _RL tmpscal0, tmpscal1, tmpscal2, tmpscal3, tmpscal4        _RL tmpscal0, tmpscal1, tmpscal2, tmpscal3, tmpscal4
137    #ifdef SEAICE_ITD
138          _RL tmpscal1itd(1:sNx,1:sNy), tmpscal2itd(1:sNx,1:sNy)
139          _RL tmpscal3itd(1:sNx,1:sNy)
140    #endif
141    
142  #ifdef ALLOW_SITRACER  #ifdef ALLOW_SITRACER
143        INTEGER iTr        INTEGER iTr
# Line 259  C     The change of mean ice thickness d Line 263  C     The change of mean ice thickness d
263        _RL d_HEFFbyRLX         (1:sNx,1:sNy)        _RL d_HEFFbyRLX         (1:sNx,1:sNy)
264  #endif  #endif
265    
266    #ifdef SEAICE_ITD
267          _RL d_HEFFbySublim_ITD         (1:sNx,1:sNy,1:nITD)
268          _RL d_HSNWbySublim_ITD         (1:sNx,1:sNy,1:nITD)
269          _RL d_HEFFbyOCNonICE_ITD       (1:sNx,1:sNy,1:nITD)
270          _RL d_HSNWbyATMonSNW_ITD       (1:sNx,1:sNy,1:nITD)
271          _RL d_HEFFbyATMonOCN_ITD       (1:sNx,1:sNy,1:nITD)
272          _RL d_HEFFbyATMonOCN_cover_ITD (1:sNx,1:sNy,1:nITD)
273          _RL d_HEFFbyATMonOCN_open_ITD  (1:sNx,1:sNy,1:nITD)
274          _RL d_HSNWbyRAIN_ITD           (1:sNx,1:sNy,1:nITD)
275          _RL d_HSNWbyOCNonSNW_ITD       (1:sNx,1:sNy,1:nITD)
276          _RL d_HEFFbyFLOODING_ITD       (1:sNx,1:sNy,1:nITD)
277    #endif
278    
279  #ifdef ALLOW_DIAGNOSTICS  #ifdef ALLOW_DIAGNOSTICS
280  C ICE/SNOW stocks tendencies associated with the various melt/freeze processes  C ICE/SNOW stocks tendencies associated with the various melt/freeze processes
281        _RL d_AREAbyATM         (1:sNx,1:sNy)        _RL d_AREAbyATM         (1:sNx,1:sNy)
# Line 413  C ===================== Line 430  C =====================
430              latentHeatFluxMaxMult(I,J,IT) = 0.0 _d 0              latentHeatFluxMaxMult(I,J,IT) = 0.0 _d 0
431  #endif  #endif
432  #ifdef SEAICE_ITD  #ifdef SEAICE_ITD
433              r_QbyATMmult_cover (I,J,IT)   = 0.0 _d 0              d_HEFFbySublim_ITD(I,J,IT)         = 0.0 _d 0
434              r_FWbySublimMult(I,J,IT)      = 0.0 _d 0              d_HSNWbySublim_ITD(I,J,IT)         = 0.0 _d 0
435                d_HEFFbyOCNonICE_ITD(I,J,IT)       = 0.0 _d 0
436                d_HSNWbyATMonSNW_ITD(I,J,IT)       = 0.0 _d 0
437                d_HEFFbyATMonOCN_ITD(I,J,IT)       = 0.0 _d 0
438                d_HEFFbyATMonOCN_cover_ITD(I,J,IT) = 0.0 _d 0
439                d_HEFFbyATMonOCN_open_ITD(I,J,IT)  = 0.0 _d 0
440                d_HSNWbyRAIN_ITD(I,J,IT)           = 0.0 _d 0
441                d_HSNWbyOCNonSNW_ITD(I,J,IT)       = 0.0 _d 0
442                d_HEFFbyFLOODING_ITD(I,J,IT)       = 0.0 _d 0
443                r_QbyATMmult_cover(I,J,IT) = 0.0 _d 0
444                r_FWbySublimMult(I,J,IT)   = 0.0 _d 0
445  #endif  #endif
446            ENDDO            ENDDO
447           ENDDO           ENDDO
# Line 506  CADJ STORE heff(:,:,bi,bj)  = comlev1_bi Line 533  CADJ STORE heff(:,:,bi,bj)  = comlev1_bi
533  CADJ STORE hsnow(:,:,bi,bj) = comlev1_bibj, key = iicekey,byte=isbyte  CADJ STORE hsnow(:,:,bi,bj) = comlev1_bibj, key = iicekey,byte=isbyte
534  CADJ STORE area(:,:,bi,bj) = comlev1_bibj, key = iicekey,byte=isbyte  CADJ STORE area(:,:,bi,bj) = comlev1_bibj, key = iicekey,byte=isbyte
535  #endif /* ALLOW_AUTODIFF_TAMC */  #endif /* ALLOW_AUTODIFF_TAMC */
536    #ifdef SEAICE_ITD
537            DO IT=1,nITD
538    #endif
539          DO J=1,sNy          DO J=1,sNy
540           DO I=1,sNx           DO I=1,sNx
541  #ifdef SEAICE_ITD  #ifdef SEAICE_ITD
542            DO IT=1,nITD            tmpscal2=0. _d 0
543             tmpscal2=0. _d 0            tmpscal3=0. _d 0
544             tmpscal3=0. _d 0            tmpscal2=MAX(-HEFFITD(I,J,IT,bi,bj),0. _d 0)
545             tmpscal2=MAX(-HEFFITD(I,J,IT,bi,bj),0. _d 0)            HEFFITD(I,J,IT,bi,bj)=HEFFITD(I,J,IT,bi,bj)+tmpscal2
546             HEFFITD(I,J,IT,bi,bj)=HEFFITD(I,J,IT,bi,bj)+tmpscal2            d_HEFFbyNEG(I,J)=d_HEFFbyNEG(I,J)+tmpscal2
547             d_HEFFbyNEG(I,J)=d_HEFFbyNEG(I,J)+tmpscal2            tmpscal3=MAX(-HSNOWITD(I,J,IT,bi,bj),0. _d 0)
548             tmpscal3=MAX(-HSNOWITD(I,J,IT,bi,bj),0. _d 0)            HSNOWITD(I,J,IT,bi,bj)=HSNOWITD(I,J,IT,bi,bj)+tmpscal3
549             HSNOWITD(I,J,IT,bi,bj)=HSNOWITD(I,J,IT,bi,bj)+tmpscal3            d_HSNWbyNEG(I,J)=d_HSNWbyNEG(I,J)+tmpscal3
550             d_HSNWbyNEG(I,J)=d_HSNWbyNEG(I,J)+tmpscal3            AREAITD(I,J,IT,bi,bj)=MAX(AREAITD(I,J,IT,bi,bj),0. _d 0)
            AREAITD(I,J,IT,bi,bj)=MAX(AREAITD(I,J,IT,bi,bj),0. _d 0)  
           ENDDO  
551  CToM      AREA, HEFF, and HSNOW will be updated at end of PART 1  CToM      AREA, HEFF, and HSNOW will be updated at end of PART 1
552  C         by calling SEAICE_ITD_SUM  C         by calling SEAICE_ITD_SUM
553  #else  #else
# Line 531  C         by calling SEAICE_ITD_SUM Line 559  C         by calling SEAICE_ITD_SUM
559  #endif  #endif
560           ENDDO           ENDDO
561          ENDDO          ENDDO
562    #ifdef SEAICE_ITD
563            ENDDO
564    #endif
565    
566  C 1.25) treat the case of very thin ice:  C 1.25) treat the case of very thin ice:
567    
568  #ifdef ALLOW_AUTODIFF_TAMC  #ifdef ALLOW_AUTODIFF_TAMC
569  CADJ STORE heff(:,:,bi,bj)  = comlev1_bibj, key = iicekey,byte=isbyte  CADJ STORE heff(:,:,bi,bj)  = comlev1_bibj, key = iicekey,byte=isbyte
570  #endif /* ALLOW_AUTODIFF_TAMC */  #endif /* ALLOW_AUTODIFF_TAMC */
         DO J=1,sNy  
          DO I=1,sNx  
571  #ifdef SEAICE_ITD  #ifdef SEAICE_ITD
572            DO IT=1,nITD          DO IT=1,nITD
573  #endif  #endif
574            DO J=1,sNy
575             DO I=1,sNx
576            tmpscal2=0. _d 0            tmpscal2=0. _d 0
577            tmpscal3=0. _d 0            tmpscal3=0. _d 0
578  #ifdef SEAICE_ITD  #ifdef SEAICE_ITD
579             IF (HEFFITD(I,J,IT,bi,bj).LE.siEps) THEN            IF (HEFFITD(I,J,IT,bi,bj).LE.siEps) THEN
580              tmpscal2=-HEFFITD(I,J,IT,bi,bj)             tmpscal2=-HEFFITD(I,J,IT,bi,bj)
581              tmpscal3=-HSNOWITD(I,J,IT,bi,bj)             tmpscal3=-HSNOWITD(I,J,IT,bi,bj)
582              TICES(I,J,IT,bi,bj)=celsius2K             TICES(I,J,IT,bi,bj)=celsius2K
583  CToM        TICE will be updated at end of Part 1 together with AREA and HEFF  CToM       TICE will be updated at end of Part 1 together with AREA and HEFF
584             ENDIF            ENDIF
585             HEFFITD(I,J,IT,bi,bj) =HEFFITD(I,J,IT,bi,bj) +tmpscal2            HEFFITD(I,J,IT,bi,bj) =HEFFITD(I,J,IT,bi,bj) +tmpscal2
586             HSNOWITD(I,J,IT,bi,bj)=HSNOWITD(I,J,IT,bi,bj)+tmpscal3            HSNOWITD(I,J,IT,bi,bj)=HSNOWITD(I,J,IT,bi,bj)+tmpscal3
587  #else  #else
588            IF (HEFF(I,J,bi,bj).LE.siEps) THEN            IF (HEFF(I,J,bi,bj).LE.siEps) THEN
589             tmpscal2=-HEFF(I,J,bi,bj)             tmpscal2=-HEFF(I,J,bi,bj)
# Line 567  CToM        TICE will be updated at end Line 598  CToM        TICE will be updated at end
598  #endif  #endif
599            d_HEFFbyNEG(I,J)=d_HEFFbyNEG(I,J)+tmpscal2            d_HEFFbyNEG(I,J)=d_HEFFbyNEG(I,J)+tmpscal2
600            d_HSNWbyNEG(I,J)=d_HSNWbyNEG(I,J)+tmpscal3            d_HSNWbyNEG(I,J)=d_HSNWbyNEG(I,J)+tmpscal3
 #ifdef SEAICE_ITD  
           ENDDO  
 #endif  
601           ENDDO           ENDDO
602          ENDDO          ENDDO
603    #ifdef SEAICE_ITD
604            ENDDO
605    #endif
606    
607  C 1.5) treat the case of area but no ice/snow:  C 1.5) treat the case of area but no ice/snow:
608    
# Line 579  C 1.5) treat the case of area but no ice Line 610  C 1.5) treat the case of area but no ice
610  CADJ STORE heff(:,:,bi,bj)  = comlev1_bibj, key = iicekey,byte=isbyte  CADJ STORE heff(:,:,bi,bj)  = comlev1_bibj, key = iicekey,byte=isbyte
611  CADJ STORE hsnow(:,:,bi,bj) = comlev1_bibj, key = iicekey,byte=isbyte  CADJ STORE hsnow(:,:,bi,bj) = comlev1_bibj, key = iicekey,byte=isbyte
612  #endif /* ALLOW_AUTODIFF_TAMC */  #endif /* ALLOW_AUTODIFF_TAMC */
613    #ifdef SEAICE_ITD
614            DO IT=1,nITD
615    #endif
616          DO J=1,sNy          DO J=1,sNy
617           DO I=1,sNx           DO I=1,sNx
618  #ifdef SEAICE_ITD  #ifdef SEAICE_ITD
619            DO IT=1,nITD            IF ((HEFFITD(I,J,IT,bi,bj).EQ.0. _d 0).AND.
620             IF ((HEFFITD(I,J,IT,bi,bj).EQ.0. _d 0).AND.       &        (HSNOWITD(I,J,IT,bi,bj).EQ.0. _d 0))
621       &         (HSNOWITD(I,J,IT,bi,bj).EQ.0. _d 0))       &     AREAITD(I,J,IT,bi,bj)=0. _d 0
      &      AREAITD(I,J,IT,bi,bj)=0. _d 0  
           ENDDO  
622  #else  #else
623            IF ((HEFF(i,j,bi,bj).EQ.0. _d 0).AND.            IF ((HEFF(i,j,bi,bj).EQ.0. _d 0).AND.
624       &        (HSNOW(i,j,bi,bj).EQ.0. _d 0)) AREA(I,J,bi,bj)=0. _d 0       &        (HSNOW(i,j,bi,bj).EQ.0. _d 0)) AREA(I,J,bi,bj)=0. _d 0
625  #endif  #endif
626           ENDDO           ENDDO
627          ENDDO          ENDDO
628    #ifdef SEAICE_ITD
629            ENDDO
630    #endif
631    
632  C 2) treat the case of very small area:  C 2) treat the case of very small area:
633    
# Line 600  C 2) treat the case of very small area: Line 635  C 2) treat the case of very small area:
635  #ifdef ALLOW_AUTODIFF_TAMC  #ifdef ALLOW_AUTODIFF_TAMC
636  CADJ STORE area(:,:,bi,bj)  = comlev1_bibj, key = iicekey,byte=isbyte  CADJ STORE area(:,:,bi,bj)  = comlev1_bibj, key = iicekey,byte=isbyte
637  #endif /* ALLOW_AUTODIFF_TAMC */  #endif /* ALLOW_AUTODIFF_TAMC */
638    #ifdef SEAICE_ITD
639            DO IT=1,nITD
640    #endif
641          DO J=1,sNy          DO J=1,sNy
642           DO I=1,sNx           DO I=1,sNx
643  #ifdef SEAICE_ITD  #ifdef SEAICE_ITD
644            DO IT=1,nITD            IF ((HEFFITD(I,J,IT,bi,bj).GT.0).OR.
645             IF ((HEFFITD(I,J,IT,bi,bj).GT.0).OR.       &        (HSNOWITD(I,J,IT,bi,bj).GT.0)) THEN
646       &         (HSNOWITD(I,J,IT,bi,bj).GT.0)) THEN  CToM       SEAICE_area_floor*nITD cannot be allowed to exceed 1
647  CToM        SEAICE_area_floor*nITD cannot be allowed to exceed 1  C          hence use SEAICE_area_floor devided by nITD
648  C           hence use SEAICE_area_floor devided by nITD  C          (or install a warning in e.g. seaice_readparms.F)
649  C           (or install a warning in e.g. seaice_readparms.F)             AREAITD(I,J,IT,bi,bj)=
650              AREAITD(I,J,IT,bi,bj)=       &        MAX(AREAITD(I,J,IT,bi,bj),SEAICE_area_floor/float(nITD))
651       &         MAX(AREAITD(I,J,IT,bi,bj),SEAICE_area_floor/float(nITD))            ENDIF
            ENDIF  
           ENDDO  
652  #else  #else
653            IF ((HEFF(i,j,bi,bj).GT.0).OR.(HSNOW(i,j,bi,bj).GT.0)) THEN            IF ((HEFF(i,j,bi,bj).GT.0).OR.(HSNOW(i,j,bi,bj).GT.0)) THEN
654             AREA(I,J,bi,bj)=MAX(AREA(I,J,bi,bj),SEAICE_area_floor)             AREA(I,J,bi,bj)=MAX(AREA(I,J,bi,bj),SEAICE_area_floor)
# Line 620  C           (or install a warning in e.g Line 656  C           (or install a warning in e.g
656  #endif  #endif
657           ENDDO           ENDDO
658          ENDDO          ENDDO
659    #ifdef SEAICE_ITD
660            ENDDO
661    #endif
662  #endif /* DISABLE_AREA_FLOOR */  #endif /* DISABLE_AREA_FLOOR */
663    
664  C 2.5) treat case of excessive ice cover, e.g., due to ridging:  C 2.5) treat case of excessive ice cover, e.g., due to ridging:
# Line 645  CADJ STORE area(:,:,bi,bj)  = comlev1_bi Line 684  CADJ STORE area(:,:,bi,bj)  = comlev1_bi
684    
685  #ifdef SEAICE_ITD  #ifdef SEAICE_ITD
686  CToM catch up with items 1.25 and 2.5 involving category sums AREA and HEFF  CToM catch up with items 1.25 and 2.5 involving category sums AREA and HEFF
687          DO J=1,sNy          DO IT=1,nITD
688           DO I=1,sNx           DO J=1,sNy
689              DO I=1,sNx
690  C    TICES was changed above (item 1.25), now update TICE as ice volume  C    TICES was changed above (item 1.25), now update TICE as ice volume
691  C     weighted average of TICES  C     weighted average of TICES
692  C    also compute total of AREAITD (needed for finishing item 2.5, see below)  C    also compute total of AREAITD (needed for finishing item 2.5, see below)
693            tmpscal1 = 0. _d 0             IF (IT .eq. 1) THEN
694            tmpscal2 = 0. _d 0              tmpscal1itd(i,j) = 0. _d 0
695            tmpscal3 = 0. _d 0              tmpscal2itd(i,j) = 0. _d 0
696            DO IT=1,nITD              tmpscal3itd(i,j) = 0. _d 0
697             tmpscal1=tmpscal1 + TICES(I,J,IT,bi,bj)*HEFFITD(I,J,IT,bi,bj)             ENDIF
698             tmpscal2=tmpscal2 + HEFFITD(I,J,IT,bi,bj)             tmpscal1itd(i,j)=tmpscal1itd(i,j) + TICES(I,J,IT,bi,bj)
699             tmpscal3=tmpscal3 + AREAITD(I,J,IT,bi,bj)       &                                       * HEFFITD(I,J,IT,bi,bj)
700            ENDDO             tmpscal2itd(i,j)=tmpscal2itd(i,j) + HEFFITD(I,J,IT,bi,bj)
701            TICE(I,J,bi,bj)=tmpscal1/tmpscal2             tmpscal3itd(i,j)=tmpscal3itd(i,j) + AREAITD(I,J,IT,bi,bj)
702               IF (IT .eq. nITD) THEN
703                TICE(I,J,bi,bj)=tmpscal1itd(i,j)/tmpscal2itd(i,j)
704  C    lines of item 2.5 that were omitted:  C    lines of item 2.5 that were omitted:
705  C    in 2.5 these lines are executed before "ridging" is applied to AREA  C    in 2.5 these lines are executed before "ridging" is applied to AREA
706  C    hence we execute them here before SEAICE_ITD_REDIST is called  C    hence we execute them here before SEAICE_ITD_REDIST is called
707  C    although this means that AREA has not been completely regularized  C    although this means that AREA has not been completely regularized
708  #ifdef ALLOW_DIAGNOSTICS  #ifdef ALLOW_DIAGNOSTICS
709            DIAGarrayA(I,J) = tmpscal3              DIAGarrayA(I,J) = tmpscal3itd(i,j)
710  #endif  #endif
711  #ifdef ALLOW_SITRACER  #ifdef ALLOW_SITRACER
712            SItrAREA(I,J,bi,bj,1)=tmpscal3              SItrAREA(I,J,bi,bj,1)=tmpscal3itd(i,j)
713  #endif  #endif
714               ENDIF
715              ENDDO
716           ENDDO           ENDDO
717          ENDDO          ENDDO
718    
# Line 750  C           if there's no ice, potential Line 794  C           if there's no ice, potential
794            ENDDO            ENDDO
795           ENDDO           ENDDO
796          ENDDO          ENDDO
797    #ifdef ALLOW_SITRACER
798  C prepare SItrHEFF to be computed as cumulative sum  C prepare SItrHEFF to be computed as cumulative sum
799          DO iTr=2,5          DO iTr=2,5
800           DO J=1,sNy           DO J=1,sNy
# Line 765  C prepare SItrAREA to be computed as cum Line 810  C prepare SItrAREA to be computed as cum
810           ENDDO           ENDDO
811          ENDDO          ENDDO
812  #endif  #endif
813    #endif /* SEAICE_ITD */
814    
815  C 4) treat sea ice salinity pathological cases  C 4) treat sea ice salinity pathological cases
816  #ifdef SEAICE_VARIABLE_SALINITY  #ifdef SEAICE_VARIABLE_SALINITY
# Line 1029  CADJ &                       key = iicek Line 1075  CADJ &                       key = iicek
1075    
1076  C--   Start loop over multi-categories  C--   Start loop over multi-categories
1077  #ifdef SEAICE_ITD  #ifdef SEAICE_ITD
1078  CToM  SEAICE_multDim = nITD (see SEAICE_SIZE.h and seaice_readparms.F)          DO IT=1,nITD
1079  #endif           DO J=1,sNy
1080              DO I=1,sNx
1081    CToM for SEAICE_ITD heffActualMult and latentHeatFluxMaxMult are calculated above
1082    C    (instead of heffActual and latentHeatFluxMax)
1083               ticeInMult(I,J,IT)=TICES(I,J,IT,bi,bj)
1084               ticeOutMult(I,J,IT)=TICES(I,J,IT,bi,bj)
1085               TICE(I,J,bi,bj) = ZERO
1086               TICES(I,J,IT,bi,bj) = ZERO
1087              ENDDO
1088             ENDDO
1089            ENDDO
1090    #else
1091          DO IT=1,SEAICE_multDim          DO IT=1,SEAICE_multDim
1092  C        homogeneous distribution between 0 and 2 x heffActual  C        homogeneous distribution between 0 and 2 x heffActual
 #ifndef SEAICE_ITD  
1093           pFac = (2.0 _d 0*IT - 1.0 _d 0)*recip_multDim           pFac = (2.0 _d 0*IT - 1.0 _d 0)*recip_multDim
1094           pFacSnow = 1. _d 0           pFacSnow = 1. _d 0
1095           IF ( SEAICE_useMultDimSnow ) pFacSnow=pFac           IF ( SEAICE_useMultDimSnow ) pFacSnow=pFac
 #endif  
1096           DO J=1,sNy           DO J=1,sNy
1097            DO I=1,sNx            DO I=1,sNx
 #ifndef SEAICE_ITD  
 CToM for SEAICE_ITD heffActualMult and latentHeatFluxMaxMult are calculated above  
 C    (instead of heffActual and latentHeatFluxMax)  
1098             heffActualMult(I,J,IT)= heffActual(I,J)*pFac             heffActualMult(I,J,IT)= heffActual(I,J)*pFac
1099             hsnowActualMult(I,J,IT)=hsnowActual(I,J)*pFacSnow             hsnowActualMult(I,J,IT)=hsnowActual(I,J)*pFacSnow
1100  #ifdef SEAICE_CAP_SUBLIM  #ifdef SEAICE_CAP_SUBLIM
1101             latentHeatFluxMaxMult(I,J,IT) = latentHeatFluxMax(I,J)*pFac             latentHeatFluxMaxMult(I,J,IT) = latentHeatFluxMax(I,J)*pFac
1102  #endif  #endif
 #endif  
1103             ticeInMult(I,J,IT)=TICES(I,J,IT,bi,bj)             ticeInMult(I,J,IT)=TICES(I,J,IT,bi,bj)
1104             ticeOutMult(I,J,IT)=TICES(I,J,IT,bi,bj)             ticeOutMult(I,J,IT)=TICES(I,J,IT,bi,bj)
1105             TICE(I,J,bi,bj) = ZERO             TICE(I,J,bi,bj) = ZERO
# Line 1056  C    (instead of heffActual and latentHe Line 1107  C    (instead of heffActual and latentHe
1107            ENDDO            ENDDO
1108           ENDDO           ENDDO
1109          ENDDO          ENDDO
1110    #endif
1111    
1112  #ifdef ALLOW_AUTODIFF_TAMC  #ifdef ALLOW_AUTODIFF_TAMC
1113  CADJ STORE heffActualMult = comlev1_bibj, key = iicekey, byte = isbyte  CADJ STORE heffActualMult = comlev1_bibj, key = iicekey, byte = isbyte
# Line 1334  C     First sublimate/deposite snow Line 1386  C     First sublimate/deposite snow
1386  #ifdef SEAICE_ITD  #ifdef SEAICE_ITD
1387       &     MAX(MIN(r_FWbySublimMult(I,J,IT),HSNOWITD(I,J,IT,bi,bj)       &     MAX(MIN(r_FWbySublimMult(I,J,IT),HSNOWITD(I,J,IT,bi,bj)
1388       &             *SNOW2ICE),ZERO)       &             *SNOW2ICE),ZERO)
1389              d_HSNWbySublim_ITD(I,J,IT) = - tmpscal2 * ICE2SNOW
1390  C         accumulate change over ITD categories  C         accumulate change over ITD categories
1391            d_HSNWbySublim(I,J)     = d_HSNWbySublim(I,J)      - tmpscal2            d_HSNWbySublim(I,J)     = d_HSNWbySublim(I,J)      - tmpscal2
1392       &                                                       *ICE2SNOW       &                                                       *ICE2SNOW
           HSNOWITD(I,J,IT,bi,bj)  = HSNOWITD(I,J,IT,bi,bj)   - tmpscal2  
      &                                                       *ICE2SNOW  
1393            r_FWbySublimMult(I,J,IT)= r_FWbySublimMult(I,J,IT) - tmpscal2            r_FWbySublimMult(I,J,IT)= r_FWbySublimMult(I,J,IT) - tmpscal2
1394  #else  #else
1395       &     MAX(MIN(r_FWbySublim(I,J),HSNOW(I,J,bi,bj)*SNOW2ICE),ZERO)       &     MAX(MIN(r_FWbySublim(I,J),HSNOW(I,J,bi,bj)*SNOW2ICE),ZERO)
# Line 1358  C     If anything is left, sublimate ice Line 1409  C     If anything is left, sublimate ice
1409            tmpscal2 =            tmpscal2 =
1410  #ifdef SEAICE_ITD  #ifdef SEAICE_ITD
1411       &     MAX(MIN(r_FWbySublimMult(I,J,IT),HEFFITD(I,J,IT,bi,bj)),ZERO)       &     MAX(MIN(r_FWbySublimMult(I,J,IT),HEFFITD(I,J,IT,bi,bj)),ZERO)
1412              d_HEFFbySublim_ITD(I,J,IT) = - tmpscal2
1413  C         accumulate change over ITD categories  C         accumulate change over ITD categories
1414            d_HSNWbySublim(I,J)      = d_HSNWbySublim(I,J)      - tmpscal2            d_HEFFbySublim(I,J)      = d_HEFFbySublim(I,J)      - tmpscal2
           HEFFITD(I,J,IT,bi,bj)    = HEFFITD(I,J,IT,bi,bj)    - tmpscal2  
1415            r_FWbySublimMult(I,J,IT) = r_FWbySublimMult(I,J,IT) - tmpscal2            r_FWbySublimMult(I,J,IT) = r_FWbySublimMult(I,J,IT) - tmpscal2
1416  #else  #else
1417       &     MAX(MIN(r_FWbySublim(I,J),HEFF(I,J,bi,bj)),ZERO)       &     MAX(MIN(r_FWbySublim(I,J),HEFF(I,J,bi,bj)),ZERO)
# Line 1393  C       end IT loop Line 1444  C       end IT loop
1444  #ifdef SEAICE_DEBUG  #ifdef SEAICE_DEBUG
1445  c ToM<<< debug seaice_growth  c ToM<<< debug seaice_growth
1446          WRITE(msgBuf,'(A,7F8.4)')          WRITE(msgBuf,'(A,7F8.4)')
1447         &    ' SEAICE_GROWTH: Heff increments 1, d_HSNWySublim = ',
1448  #ifdef SEAICE_ITD  #ifdef SEAICE_ITD
1449       &    ' SEAICE_GROWTH: Heff increments 1, HEFFITD = ',       &     d_HSNWbySublim_ITD(1,1,:)
1450       &     HEFFITD(1,1,:,bi,bj)  #else
1451         &     d_HSNWbySublim(1,1)
1452    #endif
1453          CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,          CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
1454       &    SQUEEZE_RIGHT , myThid)       &    SQUEEZE_RIGHT , myThid)
1455          WRITE(msgBuf,'(A,7F8.4)')          WRITE(msgBuf,'(A,7F8.4)')
1456       &    ' SEAICE_GROWTH: Area increments 1, AREAITD = ',       &    ' SEAICE_GROWTH: Heff increments 1, d_HEFFbySublim = ',
1457       &     AREAITD(1,1,:,bi,bj)  #ifdef SEAICE_ITD
1458         &     d_HEFFbySublim_ITD(1,1,:)
1459  #else  #else
1460       &    ' SEAICE_GROWTH: Heff increments 1, HEFF = ',       &     d_HEFFbySublim(1,1)
      &     HEFF(1,1,bi,bj)  
1461  #endif  #endif
1462          CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,          CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
1463       &    SQUEEZE_RIGHT , myThid)       &    SQUEEZE_RIGHT , myThid)
# Line 1427  C          equally distributed under the Line 1481  C          equally distributed under the
1481  C          fractional area of each thickness category  C          fractional area of each thickness category
1482             tmpscal1=MAX(r_QbyOCN(i,j)*areaFracFactor(I,J,IT),             tmpscal1=MAX(r_QbyOCN(i,j)*areaFracFactor(I,J,IT),
1483       &                               -HEFFITD(I,J,IT,bi,bj))       &                               -HEFFITD(I,J,IT,bi,bj))
1484               d_HEFFbyOCNonICE_ITD(I,J,IT)=tmpscal1
1485             d_HEFFbyOCNonICE(I,J) = d_HEFFbyOCNonICE(I,J) + tmpscal1             d_HEFFbyOCNonICE(I,J) = d_HEFFbyOCNonICE(I,J) + tmpscal1
            HEFFITD(I,J,IT,bi,bj) = HEFFITD(I,J,IT,bi,bj) + tmpscal1  
 #ifdef ALLOW_SITRACER  
            SItrHEFF(I,J,bi,bj,2) = SItrHEFF(I,J,bi,bj,2)  
      &                           + HEFFITD(I,J,IT,bi,bj)  
 #endif  
1486            ENDDO            ENDDO
1487           ENDDO           ENDDO
1488          ENDDO          ENDDO
1489    #ifdef ALLOW_SITRACER
1490            DO J=1,sNy
1491             DO I=1,sNx
1492              SItrHEFF(I,J,bi,bj,2) = HEFFpreTH(I,J)
1493         &                          - d_HEFFbySublim(I,J)
1494         &                          + d_HEFFbyOCNonICE(I,J)
1495             ENDDO
1496            ENDDO
1497    #endif
1498          DO J=1,sNy          DO J=1,sNy
1499           DO I=1,sNx           DO I=1,sNx
1500            r_QbyOCN(I,J)=r_QbyOCN(I,J)-d_HEFFbyOCNonICE(I,J)            r_QbyOCN(I,J)=r_QbyOCN(I,J)-d_HEFFbyOCNonICE(I,J)
# Line 1456  C          fractional area of each thick Line 1515  C          fractional area of each thick
1515  #ifdef SEAICE_DEBUG  #ifdef SEAICE_DEBUG
1516  c ToM<<< debug seaice_growth  c ToM<<< debug seaice_growth
1517          WRITE(msgBuf,'(A,7F8.4)')          WRITE(msgBuf,'(A,7F8.4)')
1518         &    ' SEAICE_GROWTH: Heff increments 2, d_HEFFbyOCNonICE = ',
1519  #ifdef SEAICE_ITD  #ifdef SEAICE_ITD
1520       &    ' SEAICE_GROWTH: Heff increments 2, HEFFITD = ',       &     d_HEFFbyOCNonICE_ITD(1,1,:)
      &     HEFFITD(1,1,:,bi,bj)  
         CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,  
      &    SQUEEZE_RIGHT , myThid)  
         WRITE(msgBuf,'(A,7F8.4)')  
      &    ' SEAICE_GROWTH: Area increments 2, AREAITD = ',  
      &     AREAITD(1,1,:,bi,bj)  
1521  #else  #else
1522       &    ' SEAICE_GROWTH: Heff increments 2, HEFF = ',       &     d_HEFFbyOCNonICE(1,1)
      &     HEFF(1,1,bi,bj)  
1523  #endif  #endif
1524          CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,          CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
1525       &    SQUEEZE_RIGHT , myThid)       &    SQUEEZE_RIGHT , myThid)
# Line 1494  C     of snow. This appears to be more r Line 1547  C     of snow. This appears to be more r
1547  Cgf no additional dependency through snow  Cgf no additional dependency through snow
1548             IF ( SEAICEadjMODE.GE.2 ) tmpscal2 = 0. _d 0             IF ( SEAICEadjMODE.GE.2 ) tmpscal2 = 0. _d 0
1549  #endif  #endif
1550               d_HSNWbyATMonSNW_ITD(I,J,IT) = tmpscal2*ICE2SNOW
1551             d_HSNWbyATMonSNW(I,J) = d_HSNWbyATMonSNW(I,J)             d_HSNWbyATMonSNW(I,J) = d_HSNWbyATMonSNW(I,J)
1552       &                           + tmpscal2*ICE2SNOW       &                           + tmpscal2*ICE2SNOW
            HSNOWITD(I,J,IT,bi,bj)= HSNOWITD(I,J,IT,bi,bj)  
      &                           + tmpscal2*ICE2SNOW  
1553             r_QbyATMmult_cover(I,J,IT)=r_QbyATMmult_cover(I,J,IT)             r_QbyATMmult_cover(I,J,IT)=r_QbyATMmult_cover(I,J,IT)
1554       &                           - tmpscal2       &                           - tmpscal2
1555            ENDDO            ENDDO
# Line 1523  Cgf no additional dependency through sno Line 1575  Cgf no additional dependency through sno
1575  #ifdef SEAICE_DEBUG  #ifdef SEAICE_DEBUG
1576  c ToM<<< debug seaice_growth  c ToM<<< debug seaice_growth
1577          WRITE(msgBuf,'(A,7F8.4)')          WRITE(msgBuf,'(A,7F8.4)')
1578         &    ' SEAICE_GROWTH: Heff increments 3, d_HSNWbyATMonSNW = ',
1579  #ifdef SEAICE_ITD  #ifdef SEAICE_ITD
1580       &    ' SEAICE_GROWTH: Heff increments 3, HEFFITD = ',       &    d_HSNWbyATMonSNW_ITD(1,1,:)
      &     HEFFITD(1,1,:,bi,bj)  
         CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,  
      &    SQUEEZE_RIGHT , myThid)  
         WRITE(msgBuf,'(A,7F8.4)')  
      &    ' SEAICE_GROWTH: Area increments 3, AREAITD = ',  
      &     AREAITD(1,1,:,bi,bj)  
1581  #else  #else
1582       &    ' SEAICE_GROWTH: Heff increments 3, HEFF = ',       &    d_HSNWbyATMonSNW(1,1)
      &     HEFF(1,1,bi,bj)  
1583  #endif  #endif
1584          CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,          CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
1585       &    SQUEEZE_RIGHT , myThid)       &    SQUEEZE_RIGHT , myThid)
# Line 1566  Cgf warming conditions, the lab_sea resu Line 1612  Cgf warming conditions, the lab_sea resu
1612  c         Limit ice growth by potential melt by ocean  c         Limit ice growth by potential melt by ocean
1613       &              + AREAITDpreTH(I,J,IT) * r_QbyOCN(I,J))       &              + AREAITDpreTH(I,J,IT) * r_QbyOCN(I,J))
1614  #endif /* SEAICE_GROWTH_LEGACY */  #endif /* SEAICE_GROWTH_LEGACY */
1615               d_HEFFbyATMonOCN_cover_ITD(I,J,IT) = tmpscal2
1616             d_HEFFbyATMonOCN_cover(I,J) = d_HEFFbyATMonOCN_cover(I,J)             d_HEFFbyATMonOCN_cover(I,J) = d_HEFFbyATMonOCN_cover(I,J)
1617       &                                 + tmpscal2       &                                 + tmpscal2
1618               d_HEFFbyATMonOCN_ITD(I,J,IT) = d_HEFFbyATMonOCN_ITD(I,J,IT)
1619         &                                 + tmpscal2
1620             d_HEFFbyATMonOCN(I,J)       = d_HEFFbyATMonOCN(I,J)             d_HEFFbyATMonOCN(I,J)       = d_HEFFbyATMonOCN(I,J)
1621       &                                 + tmpscal2       &                                 + tmpscal2
1622             r_QbyATMmult_cover(I,J,IT)  = r_QbyATMmult_cover(I,J,IT)             r_QbyATMmult_cover(I,J,IT)  = r_QbyATMmult_cover(I,J,IT)
1623       &                                 - tmpscal2       &                                 - tmpscal2
            HEFFITD(I,J,IT,bi,bj) = HEFFITD(I,J,IT,bi,bj) + tmpscal2  
   
 #ifdef ALLOW_SITRACER  
            SItrHEFF(I,J,bi,bj,3) = SItrHEFF(I,J,bi,bj,3)  
      &                           + HEFFITD(I,J,IT,bi,bj)  
 #endif  
1624            ENDDO            ENDDO
1625           ENDDO           ENDDO
1626          ENDDO          ENDDO
1627    #ifdef ALLOW_SITRACER
1628            DO J=1,sNy
1629             DO I=1,sNx
1630              SItrHEFF(I,J,bi,bj,3) = SItrHEFF(I,J,bi,bj,2)
1631         &                          + d_HEFFbyATMonOCN_cover(I,J)
1632             ENDDO
1633            ENDDO
1634    #endif
1635  #else /* SEAICE_ITD */  #else /* SEAICE_ITD */
1636          DO J=1,sNy          DO J=1,sNy
1637           DO I=1,sNx           DO I=1,sNx
# Line 1607  C         Limit ice growth by potential Line 1658  C         Limit ice growth by potential
1658  #ifdef SEAICE_DEBUG  #ifdef SEAICE_DEBUG
1659  c ToM<<< debug seaice_growth  c ToM<<< debug seaice_growth
1660          WRITE(msgBuf,'(A,7F8.4)')          WRITE(msgBuf,'(A,7F8.4)')
1661         &   ' SEAICE_GROWTH: Heff increments 4, d_HEFFbyATMonOCN_cover = ',
1662  #ifdef SEAICE_ITD  #ifdef SEAICE_ITD
1663       &    ' SEAICE_GROWTH: Heff increments 4, HEFFITD = ',       &     d_HEFFbyATMonOCN_cover_ITD(1,1,:)
1664       &     HEFFITD(1,1,:,bi,bj)  #else
1665         &     d_HEFFbyATMonOCN_cover(1,1)
1666    #endif
1667          CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,          CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
1668       &    SQUEEZE_RIGHT , myThid)       &    SQUEEZE_RIGHT , myThid)
1669          WRITE(msgBuf,'(A,7F8.4)')          WRITE(msgBuf,'(A,7F8.4)')
1670       &    ' SEAICE_GROWTH: Area increments 4, AREAITD = ',       &    ' SEAICE_GROWTH: Heff increments 4, d_HEFFbyATMonOCN = ',
1671       &     AREAITD(1,1,:,bi,bj)  #ifdef SEAICE_ITD
1672         &     d_HEFFbyATMonOCN_ITD(1,1,:)
1673  #else  #else
1674       &    ' SEAICE_GROWTH: Heff increments 4, HEFF = ',       &     d_HEFFbyATMonOCN(1,1)
      &     HEFF(1,1,bi,bj)  
1675  #endif  #endif
1676          CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,          CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
1677       &    SQUEEZE_RIGHT , myThid)       &    SQUEEZE_RIGHT , myThid)
# Line 1669  C           add precip to the fresh wate Line 1723  C           add precip to the fresh wate
1723          DO IT=1,nITD          DO IT=1,nITD
1724           DO J=1,sNy           DO J=1,sNy
1725            DO I=1,sNx            DO I=1,sNx
1726             HSNOWITD(I,J,IT,bi,bj) = HSNOWITD(I,J,IT,bi,bj)             d_HSNWbyRAIN_ITD(I,J,IT)
1727       &     + d_HSNWbyRAIN(I,J)*areaFracFactor(I,J,IT)       &     = d_HSNWbyRAIN(I,J)*areaFracFactor(I,J,IT)
1728            ENDDO            ENDDO
1729           ENDDO           ENDDO
1730          ENDDO          ENDDO
# Line 1690  C end of IF statement snowPrecipFile: Line 1744  C end of IF statement snowPrecipFile:
1744  #ifdef SEAICE_DEBUG  #ifdef SEAICE_DEBUG
1745  c ToM<<< debug seaice_growth  c ToM<<< debug seaice_growth
1746          WRITE(msgBuf,'(A,7F8.4)')          WRITE(msgBuf,'(A,7F8.4)')
1747         &    ' SEAICE_GROWTH: Hsnow increments 5, d_HSNWbyRAIN = ',
1748  #ifdef SEAICE_ITD  #ifdef SEAICE_ITD
1749       &    ' SEAICE_GROWTH: Heff increments 5, HEFFITD = ',       &     d_HSNWbyRAIN_ITD(1,1,:)
      &     HEFFITD(1,1,:,bi,bj)  
         CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,  
      &    SQUEEZE_RIGHT , myThid)  
         WRITE(msgBuf,'(A,7F8.4)')  
      &    ' SEAICE_GROWTH: Area increments 5, AREAITD = ',  
      &     AREAITD(1,1,:,bi,bj)  
1750  #else  #else
1751       &    ' SEAICE_GROWTH: Heff increments 5, HEFF = ',       &     d_HSNWbyRAIN(1,1)
      &     HEFF(1,1,bi,bj)  
1752  #endif  #endif
1753          CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,          CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
1754       &    SQUEEZE_RIGHT , myThid)       &    SQUEEZE_RIGHT , myThid)
# Line 1722  CADJ STORE r_QbyOCN = comlev1_bibj,key=i Line 1770  CADJ STORE r_QbyOCN = comlev1_bibj,key=i
1770          DO IT=1,nITD          DO IT=1,nITD
1771           DO J=1,sNy           DO J=1,sNy
1772            DO I=1,sNx            DO I=1,sNx
1773               tmpscal4 = HSNWITDpreTH(I,J,IT)
1774         &              - d_HSNWbySublim_ITD(I,J,IT)
1775         &              + d_HSNWbyATMonSNW_ITD(I,J,IT)
1776         &              + d_HSNWbyRAIN_ITD(I,J,IT)
1777             tmpscal1=MAX(r_QbyOCN(i,j)*ICE2SNOW*areaFracFactor(I,J,IT),             tmpscal1=MAX(r_QbyOCN(i,j)*ICE2SNOW*areaFracFactor(I,J,IT),
1778       &                  -HSNOWITD(I,J,IT,bi,bj))       &                  -tmpscal4)
1779             tmpscal2=MIN(tmpscal1,0. _d 0)             tmpscal2=MIN(tmpscal1,0. _d 0)
1780  #ifdef SEAICE_MODIFY_GROWTH_ADJ  #ifdef SEAICE_MODIFY_GROWTH_ADJ
1781  Cgf no additional dependency through snow  Cgf no additional dependency through snow
1782             if ( SEAICEadjMODE.GE.2 ) tmpscal2 = 0. _d 0             if ( SEAICEadjMODE.GE.2 ) tmpscal2 = 0. _d 0
1783  #endif  #endif
1784               d_HSNWbyOCNonSNW_ITD(I,J,IT) = tmpscal2
1785             d_HSNWbyOCNonSNW(I,J) = d_HSNWbyOCNonSNW(I,J) + tmpscal2             d_HSNWbyOCNonSNW(I,J) = d_HSNWbyOCNonSNW(I,J) + tmpscal2
1786             r_QbyOCN(I,J)=r_QbyOCN(I,J) - tmpscal2*SNOW2ICE             r_QbyOCN(I,J)=r_QbyOCN(I,J) - tmpscal2*SNOW2ICE
            HSNOWITD(I,J,IT,bi,bj) = HSNOWITD(I,J,IT,bi,bj) + tmpscal2  
1787            ENDDO            ENDDO
1788           ENDDO           ENDDO
1789          ENDDO          ENDDO
# Line 1757  Cph) Line 1809  Cph)
1809  c ToM<<< debug seaice_growth  c ToM<<< debug seaice_growth
1810          WRITE(msgBuf,'(A,7F8.4)')          WRITE(msgBuf,'(A,7F8.4)')
1811  #ifdef SEAICE_ITD  #ifdef SEAICE_ITD
1812       &    ' SEAICE_GROWTH: Heff increments 6, HEFFITD = ',       &    ' SEAICE_GROWTH: Hsnow increments 6, d_HSNWbyOCNonSNW = ',
1813       &     HEFFITD(1,1,:,bi,bj)       &     d_HSNWbyOCNonSNW_ITD(1,1,:)
         CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,  
      &    SQUEEZE_RIGHT , myThid)  
         WRITE(msgBuf,'(A,7F8.4)')  
      &    ' SEAICE_GROWTH: Area increments 6, AREAITD = ',  
      &     AREAITD(1,1,:,bi,bj)  
1814  #else  #else
1815       &    ' SEAICE_GROWTH: Heff increments 6, HEFF = ',       &     d_HSNWbyOCNonSNW(1,1)
      &     HEFF(1,1,bi,bj)  
1816  #endif  #endif
1817          CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,          CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
1818       &    SQUEEZE_RIGHT , myThid)       &    SQUEEZE_RIGHT , myThid)
# Line 1785  CADJ STORE a_QSWbyATM_open = comlev1_bib Line 1831  CADJ STORE a_QSWbyATM_open = comlev1_bib
1831    
1832          DO J=1,sNy          DO J=1,sNy
1833           DO I=1,sNx           DO I=1,sNx
1834    #ifdef SEAICE_ITD
1835    C         HEFF will be updated at the end of PART 3,
1836    C         hence sum of tendencies so far is needed
1837              tmpscal4 = HEFFpreTH(I,J)
1838         &             - d_HEFFbySublim(I,J)
1839         &             + d_HEFFbyOCNonICE(I,J)
1840         &             + d_HEFFbyATMonOCN(I,J)
1841    #else
1842    C         HEFF is updated step by step throughout seaice_growth
1843              tmpscal4 = HEFF(I,J,bi,bj)
1844    #endif
1845  C           Initial ice growth is triggered by open water  C           Initial ice growth is triggered by open water
1846  C           heat flux overcoming potential melt by ocean  C           heat flux overcoming potential melt by ocean
1847              tmpscal1=r_QbyATM_open(I,J)+r_QbyOCN(i,j) *              tmpscal1=r_QbyATM_open(I,J)+r_QbyOCN(i,j) *
# Line 1795  C           that is therefore not availa Line 1852  C           that is therefore not availa
1852  C           impose -HEFF as the maxmum melting if SEAICE_doOpenWaterMelt  C           impose -HEFF as the maxmum melting if SEAICE_doOpenWaterMelt
1853  C           or 0. otherwise (no melting if not SEAICE_doOpenWaterMelt)  C           or 0. otherwise (no melting if not SEAICE_doOpenWaterMelt)
1854              tmpscal3=facOpenGrow*MAX(tmpscal1-tmpscal2,              tmpscal3=facOpenGrow*MAX(tmpscal1-tmpscal2,
1855       &           -HEFF(I,J,bi,bj)*facOpenMelt)*HEFFM(I,J,bi,bj)       &           -tmpscal4*facOpenMelt)*HEFFM(I,J,bi,bj)
1856    #ifdef SEAICE_ITD
1857    C         ice growth in open water adds to first category
1858              d_HEFFbyATMonOCN_open_ITD(I,J,1)=tmpscal3
1859              d_HEFFbyATMonOCN_ITD(I,J,1)     =d_HEFFbyATMonOCN_ITD(I,J,1)
1860         &                                    +tmpscal3
1861    #endif
1862            d_HEFFbyATMonOCN_open(I,J)=tmpscal3            d_HEFFbyATMonOCN_open(I,J)=tmpscal3
1863            d_HEFFbyATMonOCN(I,J)=d_HEFFbyATMonOCN(I,J)+tmpscal3            d_HEFFbyATMonOCN(I,J)=d_HEFFbyATMonOCN(I,J)+tmpscal3
1864            r_QbyATM_open(I,J)=r_QbyATM_open(I,J)-tmpscal3            r_QbyATM_open(I,J)=r_QbyATM_open(I,J)-tmpscal3
 #ifdef SEAICE_ITD  
 C         open water area fraction  
           tmpscal0 = ONE-AREApreTH(I,J)  
 C         determine thickness of new ice  
 ctomC         considering the entire open water area to refreeze  
 ctom          tmpscal1 = tmpscal3/tmpscal0  
 C         considering a minimum lead ice thickness of 10 cm  
 C         WATCH that leadIceThickMin is smaller that Hlimit(1)!  
           leadIceThickMin = 0.1  
           tmpscal1 = MAX(leadIceThickMin,tmpscal3/tmpscal0)  
 C         adjust ice area fraction covered by new ice  
           tmpscal0 = tmpscal3/tmpscal1  
 C         then add new ice volume to appropriate thickness category  
           DO IT=1,nITD  
            IF (tmpscal1.LT.Hlimit(IT)) THEN  
             HEFFITD(I,J,IT,bi,bj) = HEFFITD(I,J,IT,bi,bj) + tmpscal3  
             tmpscal3=ZERO  
 C not sure if AREAITD should be changed here since AREA is incremented  
 C   in PART 4 below in non-itd code  
 C in this scenario all open water is covered by new ice instantaneously,  
 C   i.e. no delayed lead closing is concidered such as is associated with  
 C   Hibler's h_0 parameter  
             AREAITD(I,J,IT,bi,bj) = AREAITD(I,J,IT,bi,bj)  
      &                           + tmpscal0  
             tmpscal0=ZERO  
            ENDIF  
           ENDDO  
 #else  
1865            HEFF(I,J,bi,bj) = HEFF(I,J,bi,bj) + tmpscal3            HEFF(I,J,bi,bj) = HEFF(I,J,bi,bj) + tmpscal3
 #endif  
1866           ENDDO           ENDDO
1867          ENDDO          ENDDO
1868    
1869  #ifdef ALLOW_SITRACER  #ifdef ALLOW_SITRACER
 #ifdef SEAICE_ITD  
         DO IT=1,nITD  
          DO J=1,sNy  
           DO I=1,sNx  
 c needs to be here to allow use also with LEGACY branch  
            SItrHEFF(I,J,bi,bj,4) = SItrHEFF(I,J,bi,bj,4)  
      &                           + HEFFITD(I,J,IT,bi,bj)  
           ENDDO  
          ENDDO  
         ENDDO  
 #else  
1870          DO J=1,sNy          DO J=1,sNy
1871           DO I=1,sNx           DO I=1,sNx
1872  C needs to be here to allow use also with LEGACY branch  C needs to be here to allow use also with LEGACY branch
1873    #ifdef SEAICE_ITD
1874              SItrHEFF(I,J,bi,bj,4)=SItrHEFF(I,J,bi,bj,3)
1875         &                         +d_HEFFbyATMonOCN_open(I,J)
1876    #else
1877            SItrHEFF(I,J,bi,bj,4)=HEFF(I,J,bi,bj)            SItrHEFF(I,J,bi,bj,4)=HEFF(I,J,bi,bj)
1878    #endif
1879           ENDDO           ENDDO
1880          ENDDO          ENDDO
 #endif  
1881  #endif /* ALLOW_SITRACER */  #endif /* ALLOW_SITRACER */
1882  #ifdef SEAICE_DEBUG  #ifdef SEAICE_DEBUG
1883  c ToM<<< debug seaice_growth  c ToM<<< debug seaice_growth
1884          WRITE(msgBuf,'(A,7F8.4)')          WRITE(msgBuf,'(A,7F8.4)')
1885         &    ' SEAICE_GROWTH: Heff increments 7, d_HEFFbyATMonOCN_open = ',
1886  #ifdef SEAICE_ITD  #ifdef SEAICE_ITD
1887       &    ' SEAICE_GROWTH: Heff increments 7, HEFFITD = ',       &     d_HEFFbyATMonOCN_open_ITD(1,1,:)
      &     HEFFITD(1,1,:,bi,bj)  
         CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,  
      &    SQUEEZE_RIGHT , myThid)  
         WRITE(msgBuf,'(A,7F8.4)')  
      &    ' SEAICE_GROWTH: Area increments 7, AREAITD = ',  
      &     AREAITD(1,1,:,bi,bj)  
1888  #else  #else
1889       &    ' SEAICE_GROWTH: Heff increments 7, HEFF = ',       &     d_HEFFbyATMonOCN_open(1,1)
1890       &     HEFF(1,1,bi,bj)  #endif
1891          CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,          CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
1892       &    SQUEEZE_RIGHT , myThid)       &    SQUEEZE_RIGHT , myThid)
1893          WRITE(msgBuf,'(A,7F8.4)')          WRITE(msgBuf,'(A,7F8.4)')
1894       &    ' SEAICE_GROWTH: Area increments 7, AREA = ',       &    ' SEAICE_GROWTH: Heff increments 7, d_HEFFbyATMonOCN = ',
1895       &     AREA(1,1,bi,bj)  #ifdef SEAICE_ITD
1896         &     d_HEFFbyATMonOCN_ITD(1,1,:)
1897    #else
1898         &     d_HEFFbyATMonOCN(1,1)
1899  #endif  #endif
1900          CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,          CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
1901       &    SQUEEZE_RIGHT , myThid)       &    SQUEEZE_RIGHT , myThid)
# Line 1891  CADJ STORE hsnow(:,:,bi,bj) = comlev1_bi Line 1916  CADJ STORE hsnow(:,:,bi,bj) = comlev1_bi
1916           DO IT=1,nITD           DO IT=1,nITD
1917            DO J=1,sNy            DO J=1,sNy
1918             DO I=1,sNx             DO I=1,sNx
1919              tmpscal0 = (HSNOWITD(I,J,IT,bi,bj)*SEAICE_rhoSnow              tmpscal3 = HEFFITDpreTH(I,J,IT)
1920       &               +  HEFFITD(I,J,IT,bi,bj) *SEAICE_rhoIce)       &               - d_HEFFbySublim_ITD(I,J,IT)
1921       &                                        *recip_rhoConst       &               + d_HEFFbyOCNonICE_ITD(I,J,IT)
1922              tmpscal1 = MAX( 0. _d 0, tmpscal0 - HEFFITD(I,J,IT,bi,bj))       &               + d_HEFFbyATMonOCN_ITD(I,J,IT)
1923                tmpscal4 = HSNWITDpreTH(I,J,IT)
1924         &               - d_HSNWbySublim_ITD(I,J,IT)
1925         &               + d_HSNWbyATMonSNW_ITD(I,J,IT)
1926         &               + d_HSNWbyRAIN_ITD(I,J,IT)
1927                tmpscal0 = (tmpscal4*SEAICE_rhoSnow
1928         &               +  tmpscal3*SEAICE_rhoIce)
1929         &               * recip_rhoConst
1930                tmpscal1 = MAX( 0. _d 0, tmpscal0 - tmpscal3)
1931                d_HEFFbyFLOODING_ITD(I,J,IT) = tmpscal1
1932              d_HEFFbyFLOODING(I,J) = d_HEFFbyFLOODING(I,J)  + tmpscal1              d_HEFFbyFLOODING(I,J) = d_HEFFbyFLOODING(I,J)  + tmpscal1
             HEFFITD(I,J,IT,bi,bj) = HEFFITD(I,J,IT,bi,bj)  + tmpscal1  
             HSNOWITD(I,J,IT,bi,bj)= HSNOWITD(I,J,IT,bi,bj) - tmpscal1  
      &                            * ICE2SNOW  
1933             ENDDO             ENDDO
1934            ENDDO            ENDDO
1935           ENDDO           ENDDO
# Line 1920  CADJ STORE hsnow(:,:,bi,bj) = comlev1_bi Line 1951  CADJ STORE hsnow(:,:,bi,bj) = comlev1_bi
1951  #ifdef SEAICE_DEBUG  #ifdef SEAICE_DEBUG
1952  c ToM<<< debug seaice_growth  c ToM<<< debug seaice_growth
1953          WRITE(msgBuf,'(A,7F8.4)')          WRITE(msgBuf,'(A,7F8.4)')
1954         &    ' SEAICE_GROWTH: Heff increments 8, d_HEFFbyFLOODING = ',
1955  #ifdef SEAICE_ITD  #ifdef SEAICE_ITD
1956       &    ' SEAICE_GROWTH: Heff increments 8, HEFFITD = ',       &     d_HEFFbyFLOODING_ITD(1,1,:)
1957       &     HEFFITD(1,1,:,bi,bj)  #else
1958         &     d_HEFFbyFLOODING(1,1)
1959    #endif
1960          CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,          CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
1961       &    SQUEEZE_RIGHT , myThid)       &    SQUEEZE_RIGHT , myThid)
1962    c ToM>>>
1963    #endif
1964    #ifdef SEAICE_ITD
1965    C apply ice and snow thickness changes
1966    C =================================================================
1967             DO IT=1,nITD
1968              DO J=1,sNy
1969               DO I=1,sNx
1970                HEFFITD(I,J,IT,bi,bj) = HEFFITD(I,J,IT,bi,bj)
1971         &                            - d_HEFFbySublim_ITD(I,J,IT)
1972         &                            + d_HEFFbyOCNonICE_ITD(I,J,IT)
1973         &                            + d_HEFFbyATMonOCN_ITD(I,J,IT)
1974         &                            + d_HEFFbyFLOODING_ITD(I,J,IT)
1975                HSNOWITD(I,J,IT,bi,bj) = HSNOWITD(I,J,IT,bi,bj)
1976         &                            - d_HSNWbySublim_ITD(I,J,IT)
1977         &                            + d_HSNWbyATMonSNW_ITD(I,J,IT)
1978         &                            + d_HSNWbyRAIN_ITD(I,J,IT)
1979         &                            + d_HSNWbyOCNonSNW_ITD(I,J,IT)
1980         &                            - d_HEFFbyFLOODING_ITD(I,J,IT)
1981         &                            * ICE2SNOW
1982               ENDDO
1983              ENDDO
1984             ENDDO
1985    #endif
1986    c ToM<<< debug seaice_growth
1987          WRITE(msgBuf,'(A,7F8.4)')          WRITE(msgBuf,'(A,7F8.4)')
1988       &    ' SEAICE_GROWTH: Area increments 8, AREAITD = ',       &    ' SEAICE_GROWTH: Heff increments 9, HEFF = ',
1989       &     AREAITD(1,1,:,bi,bj)  #ifdef SEAICE_ITD
1990         &     HEFFITD(1,1,:,bi,bj)
1991  #else  #else
      &    ' SEAICE_GROWTH: Heff increments 8, HEFF = ',  
1992       &     HEFF(1,1,bi,bj)       &     HEFF(1,1,bi,bj)
1993    #endif
1994          CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,          CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
1995       &    SQUEEZE_RIGHT , myThid)       &    SQUEEZE_RIGHT , myThid)
1996          WRITE(msgBuf,'(A,7F8.4)')          WRITE(msgBuf,'(A,7F8.4)')
1997       &    ' SEAICE_GROWTH: Area increments 8, AREA = ',       &    ' SEAICE_GROWTH: Heff increments 9, AREA = ',
1998    #ifdef SEAICE_ITD
1999         &     AREAITD(1,1,:,bi,bj)
2000    #else
2001       &     AREA(1,1,bi,bj)       &     AREA(1,1,bi,bj)
2002  #endif  #endif
2003          CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,          CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
2004       &    SQUEEZE_RIGHT , myThid)       &    SQUEEZE_RIGHT , myThid)
2005  c ToM>>>  c ToM>>>
 #endif  
2006    
2007  C ===================================================================  C ===================================================================
2008  C ==========PART 4: determine ice cover fraction increments=========-  C ==========PART 4: determine ice cover fraction increments=========-
# Line 1967  CADJ STORE AREA(:,:,bi,bj) = comlev1_bib Line 2029  CADJ STORE AREA(:,:,bi,bj) = comlev1_bib
2029  #endif /* ALLOW_AUTODIFF_TAMC */  #endif /* ALLOW_AUTODIFF_TAMC */
2030    
2031  #ifdef SEAICE_ITD  #ifdef SEAICE_ITD
2032  C       replaces Hibler '79 scheme and lead closing parameter  C--     account for lateral ice growth and melt only in thinnest category
2033  C       because ITD accounts explicitly for lead openings and  C--     use HEFF, ARE, HSNOW, etc. temporarily for 1st category
2034  C       different melt rates due to varying ice thickness  C       (this way we can use same code for ITD and non-ITD case)
2035  C          DO J=1,sNy
 C       only consider ice area loss due to total ice thickness loss;  
 C       ice area gain due to freezing of open water is handled above  
 C       under "gain of new ice over open water"  
 C  
 C       does not account for lateral melt of ice floes  
 C  
 C        AREAITD is incremented in section "gain of new ice over open water" above  
 C  
         DO IT=1,nITD  
          DO J=1,sNy  
2036           DO I=1,sNx           DO I=1,sNx
2037             IF (HEFFITD(I,J,IT,bi,bj).LE.ZERO) THEN            HEFF(I,J,bi,bj)=HEFFITD(I,J,1,bi,bj)
2038              AREAITD(I,J,IT,bi,bj)=ZERO            AREA(I,J,bi,bj)=AREAITD(I,J,1,bi,bj)
2039             ENDIF            HSNOW(I,J,bi,bj)=HSNOWITD(I,J,1,bi,bj)
2040  #ifdef ALLOW_SITRACER            HEFFpreTH(I,J)=HEFFITDpreTH(I,J,1)
2041             SItrAREA(I,J,bi,bj,3) = SItrAREA(I,J,bi,bj,3)            AREApreTH(I,J)=AREAITDpreTH(I,J,1)
2042       &                           + AREAITD(I,J,IT,bi,bj)            recip_heffActual(I,J)=recip_heffActualMult(I,J,1)
 #endif /* ALLOW_SITRACER */  
           ENDDO  
2043           ENDDO           ENDDO
2044          ENDDO          ENDDO
2045  #else /* SEAICE_ITD */  C       all other categories only experience basal growth or melt,
2046    C       i.e. change sin AREA only occur when all ice in a category is melted
2047            IF (nITD .gt. 1) THEN
2048             DO IT=2,nITD
2049              DO J=1,sNy
2050               DO I=1,sNx
2051                IF (HEFFITD(I,J,IT,bi,bj).LE.ZERO) THEN
2052                 AREAITD(I,J,IT,bi,bj)=ZERO
2053                ENDIF
2054               ENDDO
2055              ENDDO
2056             ENDDO
2057            ENDIF
2058    #endif
2059          DO J=1,sNy          DO J=1,sNy
2060           DO I=1,sNx           DO I=1,sNx
2061    
# Line 2062  C apply tendency Line 2125  C apply tendency
2125  #endif /* ALLOW_DIAGNOSTICS */  #endif /* ALLOW_DIAGNOSTICS */
2126           ENDDO           ENDDO
2127          ENDDO          ENDDO
2128  #endif /* SEAICE_ITD */  #ifdef SEAICE_ITD
2129    C       transfer 1st category values back into ITD variables
2130            DO J=1,sNy
2131             DO I=1,sNx
2132              HEFFITD(I,J,1,bi,bj)=HEFF(I,J,bi,bj)
2133              AREAITD(I,J,1,bi,bj)=AREA(I,J,bi,bj)
2134              HSNOWITD(I,J,1,bi,bj)=HSNOW(I,J,bi,bj)
2135             ENDDO
2136            ENDDO
2137    #endif
2138    
2139  #if (defined ALLOW_AUTODIFF_TAMC && defined SEAICE_MODIFY_GROWTH_ADJ)  #if (defined ALLOW_AUTODIFF_TAMC && defined SEAICE_MODIFY_GROWTH_ADJ)
2140  Cgf 'bulk' linearization of area=f(HEFF)  Cgf 'bulk' linearization of area=f(HEFF)

Legend:
Removed from v.1.10  
changed lines
  Added in v.1.12

  ViewVC Help
Powered by ViewVC 1.1.22