324 |
ENDIF |
ENDIF |
325 |
|
|
326 |
C avoid unnecessary divisions in loops |
C avoid unnecessary divisions in loops |
|
c#ifdef SEAICE_ITD |
|
|
CToM this is now set by MULTDIM = nITD in SEAICE_SIZE.h |
|
|
C (see SEAICE_SIZE.h and seaice_readparms.F) |
|
|
c SEAICE_multDim = nITD |
|
|
c#endif |
|
327 |
recip_multDim = SEAICE_multDim |
recip_multDim = SEAICE_multDim |
328 |
recip_multDim = ONE / recip_multDim |
recip_multDim = ONE / recip_multDim |
329 |
C above/below: double/single precision calculation of recip_multDim |
C above/below: double/single precision calculation of recip_multDim |
541 |
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 |
542 |
d_HSNWbyNEG(I,J)=d_HSNWbyNEG(I,J)+tmpscal3 |
d_HSNWbyNEG(I,J)=d_HSNWbyNEG(I,J)+tmpscal3 |
543 |
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) |
544 |
CToM AREA, HEFF, and HSNOW will be updated at end of PART 1 |
C AREA, HEFF, and HSNOW will be updated at end of PART 1 |
545 |
C by calling SEAICE_ITD_SUM |
C by calling SEAICE_ITD_SUM |
546 |
#else |
#else |
547 |
d_HEFFbyNEG(I,J)=MAX(-HEFF(I,J,bi,bj),0. _d 0) |
d_HEFFbyNEG(I,J)=MAX(-HEFF(I,J,bi,bj),0. _d 0) |
573 |
tmpscal2=-HEFFITD(I,J,IT,bi,bj) |
tmpscal2=-HEFFITD(I,J,IT,bi,bj) |
574 |
tmpscal3=-HSNOWITD(I,J,IT,bi,bj) |
tmpscal3=-HSNOWITD(I,J,IT,bi,bj) |
575 |
TICES(I,J,IT,bi,bj)=celsius2K |
TICES(I,J,IT,bi,bj)=celsius2K |
576 |
CToM TICE will be updated at end of Part 1 together with AREA and HEFF |
C TICE will be updated at end of Part 1 together with AREA and HEFF |
577 |
ENDIF |
ENDIF |
578 |
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 |
579 |
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 |
636 |
#ifdef SEAICE_ITD |
#ifdef SEAICE_ITD |
637 |
IF ((HEFFITD(I,J,IT,bi,bj).GT.0).OR. |
IF ((HEFFITD(I,J,IT,bi,bj).GT.0).OR. |
638 |
& (HSNOWITD(I,J,IT,bi,bj).GT.0)) THEN |
& (HSNOWITD(I,J,IT,bi,bj).GT.0)) THEN |
639 |
CToM SEAICE_area_floor*nITD cannot be allowed to exceed 1 |
C SEAICE_area_floor*nITD cannot be allowed to exceed 1 |
640 |
C hence use SEAICE_area_floor devided by nITD |
C hence use SEAICE_area_floor devided by nITD |
641 |
C (or install a warning in e.g. seaice_readparms.F) |
C (or install a warning in e.g. seaice_readparms.F) |
642 |
AREAITD(I,J,IT,bi,bj)= |
AREAITD(I,J,IT,bi,bj)= |
656 |
|
|
657 |
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: |
658 |
|
|
659 |
CToM for SEAICE_ITD this case is treated in SEAICE_ITD_REDIST, |
C for SEAICE_ITD this case is treated in SEAICE_ITD_REDIST, |
660 |
C which is called at end of PART 1 below |
C which is called at end of PART 1 below |
661 |
#ifndef SEAICE_ITD |
#ifndef SEAICE_ITD |
662 |
#ifdef ALLOW_AUTODIFF_TAMC |
#ifdef ALLOW_AUTODIFF_TAMC |
676 |
#endif /* notSEAICE_ITD */ |
#endif /* notSEAICE_ITD */ |
677 |
|
|
678 |
#ifdef SEAICE_ITD |
#ifdef SEAICE_ITD |
679 |
CToM catch up with items 1.25 and 2.5 involving category sums AREA and HEFF |
C catch up with items 1.25 and 2.5 involving category sums AREA and HEFF |
680 |
DO IT=1,nITD |
DO IT=1,nITD |
681 |
DO J=1,sNy |
DO J=1,sNy |
682 |
DO I=1,sNx |
DO I=1,sNx |
709 |
ENDDO |
ENDDO |
710 |
ENDDO |
ENDDO |
711 |
|
|
712 |
CToM finally make sure that all categories meet their thickness limits |
C finally make sure that all categories meet their thickness limits |
713 |
C which includes ridging as in item 2.5 |
C which includes ridging as in item 2.5 |
714 |
C and update AREA, HEFF, and HSNOW |
C and update AREA, HEFF, and HSNOW |
715 |
CALL SEAICE_ITD_REDIST(bi, bj, myTime, myIter, myThid) |
CALL SEAICE_ITD_REDIST(bi, bj, myTime, myIter, myThid) |
1053 |
DO IT=1,nITD |
DO IT=1,nITD |
1054 |
DO J=1,sNy |
DO J=1,sNy |
1055 |
DO I=1,sNx |
DO I=1,sNx |
1056 |
CToM for SEAICE_ITD heffActualMult and latentHeatFluxMaxMult are calculated above |
C for SEAICE_ITD heffActualMult and latentHeatFluxMaxMult are calculated above |
1057 |
C (instead of heffActual and latentHeatFluxMax) |
C (instead of heffActual and latentHeatFluxMax) |
1058 |
ticeInMult(I,J,IT)=TICES(I,J,IT,bi,bj) |
ticeInMult(I,J,IT)=TICES(I,J,IT,bi,bj) |
1059 |
ticeOutMult(I,J,IT)=TICES(I,J,IT,bi,bj) |
ticeOutMult(I,J,IT)=TICES(I,J,IT,bi,bj) |
1466 |
ENDDO |
ENDDO |
1467 |
#endif |
#endif |
1468 |
#ifdef SEAICE_DEBUG |
#ifdef SEAICE_DEBUG |
1469 |
c ToM<<< debug seaice_growth |
c <<< debug seaice_growth |
1470 |
WRITE(msgBuf,msgBufForm) |
WRITE(msgBuf,msgBufForm) |
1471 |
& ' SEAICE_GROWTH: Hsnow increments 1, d_HSNWySublim = ', |
& ' SEAICE_GROWTH: Hsnow increments 1, d_HSNWySublim = ', |
1472 |
#ifdef SEAICE_ITD |
#ifdef SEAICE_ITD |
1485 |
#endif |
#endif |
1486 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
1487 |
& SQUEEZE_RIGHT , myThid) |
& SQUEEZE_RIGHT , myThid) |
1488 |
c ToM>>> |
c >>> debug seaice_growth |
1489 |
#endif /* SEAICE_DEBUG */ |
#endif /* SEAICE_DEBUG */ |
1490 |
|
|
1491 |
C compute ice thickness tendency due to ice-ocean interaction |
C compute ice thickness tendency due to ice-ocean interaction |
1537 |
ENDDO |
ENDDO |
1538 |
#endif /* SEAICE_ITD */ |
#endif /* SEAICE_ITD */ |
1539 |
#ifdef SEAICE_DEBUG |
#ifdef SEAICE_DEBUG |
1540 |
c ToM<<< debug seaice_growth |
c <<< debug seaice_growth |
1541 |
WRITE(msgBuf,msgBufForm) |
WRITE(msgBuf,msgBufForm) |
1542 |
& ' SEAICE_GROWTH: Heff increments 2, d_HEFFbyOCNonICE = ', |
& ' SEAICE_GROWTH: Heff increments 2, d_HEFFbyOCNonICE = ', |
1543 |
#ifdef SEAICE_ITD |
#ifdef SEAICE_ITD |
1547 |
#endif |
#endif |
1548 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
1549 |
& SQUEEZE_RIGHT , myThid) |
& SQUEEZE_RIGHT , myThid) |
1550 |
c ToM>>> |
c >>> debug seaice_growth |
1551 |
#endif /* SEAICE_DEBUG */ |
#endif /* SEAICE_DEBUG */ |
1552 |
|
|
1553 |
C compute snow melt tendency due to snow-atmosphere interaction |
C compute snow melt tendency due to snow-atmosphere interaction |
1597 |
ENDDO |
ENDDO |
1598 |
#endif /* SEAICE_ITD */ |
#endif /* SEAICE_ITD */ |
1599 |
#ifdef SEAICE_DEBUG |
#ifdef SEAICE_DEBUG |
1600 |
c ToM<<< debug seaice_growth |
c <<< debug seaice_growth |
1601 |
WRITE(msgBuf,msgBufForm) |
WRITE(msgBuf,msgBufForm) |
1602 |
& ' SEAICE_GROWTH: Hsnow increments 3, d_HSNWbyATMonSNW = ', |
& ' SEAICE_GROWTH: Hsnow increments 3, d_HSNWbyATMonSNW = ', |
1603 |
#ifdef SEAICE_ITD |
#ifdef SEAICE_ITD |
1607 |
#endif |
#endif |
1608 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
1609 |
& SQUEEZE_RIGHT , myThid) |
& SQUEEZE_RIGHT , myThid) |
1610 |
c ToM>>> |
c >>> debug seaice_growth |
1611 |
#endif /* SEAICE_DEBUG */ |
#endif /* SEAICE_DEBUG */ |
1612 |
|
|
1613 |
C compute ice thickness tendency due to the atmosphere |
C compute ice thickness tendency due to the atmosphere |
1674 |
ENDDO |
ENDDO |
1675 |
#endif /* SEAICE_ITD */ |
#endif /* SEAICE_ITD */ |
1676 |
#ifdef SEAICE_DEBUG |
#ifdef SEAICE_DEBUG |
1677 |
c ToM<<< debug seaice_growth |
c <<< debug seaice_growth |
1678 |
WRITE(msgBuf,msgBufForm) |
WRITE(msgBuf,msgBufForm) |
1679 |
& ' SEAICE_GROWTH: Heff increments 4, d_HEFFbyATMonOCN_cover = ', |
& ' SEAICE_GROWTH: Heff increments 4, d_HEFFbyATMonOCN_cover = ', |
1680 |
#ifdef SEAICE_ITD |
#ifdef SEAICE_ITD |
1693 |
#endif |
#endif |
1694 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
1695 |
& SQUEEZE_RIGHT , myThid) |
& SQUEEZE_RIGHT , myThid) |
1696 |
c ToM>>> |
c >>> debug seaice_growth |
1697 |
#endif /* SEAICE_DEBUG */ |
#endif /* SEAICE_DEBUG */ |
1698 |
|
|
1699 |
C add snow precipitation to HSNOW. |
C add snow precipitation to HSNOW. |
1760 |
ENDIF |
ENDIF |
1761 |
#endif /* ALLOW_ATM_TEMP */ |
#endif /* ALLOW_ATM_TEMP */ |
1762 |
#ifdef SEAICE_DEBUG |
#ifdef SEAICE_DEBUG |
1763 |
c ToM<<< debug seaice_growth |
c <<< debug seaice_growth |
1764 |
WRITE(msgBuf,msgBufForm) |
WRITE(msgBuf,msgBufForm) |
1765 |
& ' SEAICE_GROWTH: Hsnow increments 5, d_HSNWbyRAIN = ', |
& ' SEAICE_GROWTH: Hsnow increments 5, d_HSNWbyRAIN = ', |
1766 |
#ifdef SEAICE_ITD |
#ifdef SEAICE_ITD |
1770 |
#endif |
#endif |
1771 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
1772 |
& SQUEEZE_RIGHT , myThid) |
& SQUEEZE_RIGHT , myThid) |
1773 |
c ToM>>> |
c >>> debug seaice_growth |
1774 |
#endif /* SEAICE_DEBUG */ |
#endif /* SEAICE_DEBUG */ |
1775 |
|
|
1776 |
C compute snow melt due to heat available from ocean. |
C compute snow melt due to heat available from ocean. |
1824 |
#endif /* SEAICE_EXCLUDE_FOR_EXACT_AD_TESTING */ |
#endif /* SEAICE_EXCLUDE_FOR_EXACT_AD_TESTING */ |
1825 |
Cph) |
Cph) |
1826 |
#ifdef SEAICE_DEBUG |
#ifdef SEAICE_DEBUG |
1827 |
c ToM<<< debug seaice_growth |
c <<< debug seaice_growth |
1828 |
WRITE(msgBuf,msgBufForm) |
WRITE(msgBuf,msgBufForm) |
1829 |
& ' SEAICE_GROWTH: Hsnow increments 6, d_HSNWbyOCNonSNW = ', |
& ' SEAICE_GROWTH: Hsnow increments 6, d_HSNWbyOCNonSNW = ', |
1830 |
#ifdef SEAICE_ITD |
#ifdef SEAICE_ITD |
1834 |
#endif |
#endif |
1835 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
1836 |
& SQUEEZE_RIGHT , myThid) |
& SQUEEZE_RIGHT , myThid) |
1837 |
c ToM>>> |
c >>> debug seaice_growth |
1838 |
#endif /* SEAICE_DEBUG */ |
#endif /* SEAICE_DEBUG */ |
1839 |
|
|
1840 |
C gain of new ice over open water |
C gain of new ice over open water |
1898 |
ENDDO |
ENDDO |
1899 |
#endif /* ALLOW_SITRACER */ |
#endif /* ALLOW_SITRACER */ |
1900 |
#ifdef SEAICE_DEBUG |
#ifdef SEAICE_DEBUG |
1901 |
c ToM<<< debug seaice_growth |
c <<< debug seaice_growth |
1902 |
WRITE(msgBuf,msgBufForm) |
WRITE(msgBuf,msgBufForm) |
1903 |
& ' SEAICE_GROWTH: Heff increments 7, d_HEFFbyATMonOCN_open = ', |
& ' SEAICE_GROWTH: Heff increments 7, d_HEFFbyATMonOCN_open = ', |
1904 |
#ifdef SEAICE_ITD |
#ifdef SEAICE_ITD |
1917 |
#endif |
#endif |
1918 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
1919 |
& SQUEEZE_RIGHT , myThid) |
& SQUEEZE_RIGHT , myThid) |
1920 |
c ToM>>> |
c >>> debug seaice_growth |
1921 |
#endif /* SEAICE_DEBUG */ |
#endif /* SEAICE_DEBUG */ |
1922 |
|
|
1923 |
C convert snow to ice if submerged. |
C convert snow to ice if submerged. |
1966 |
ENDIF |
ENDIF |
1967 |
|
|
1968 |
#ifdef SEAICE_DEBUG |
#ifdef SEAICE_DEBUG |
1969 |
c ToM<<< debug seaice_growth |
c <<< debug seaice_growth |
1970 |
WRITE(msgBuf,msgBufForm) |
WRITE(msgBuf,msgBufForm) |
1971 |
& ' SEAICE_GROWTH: Heff increments 8, d_HEFFbyFLOODING = ', |
& ' SEAICE_GROWTH: Heff increments 8, d_HEFFbyFLOODING = ', |
1972 |
#ifdef SEAICE_ITD |
#ifdef SEAICE_ITD |
1976 |
#endif |
#endif |
1977 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
1978 |
& SQUEEZE_RIGHT , myThid) |
& SQUEEZE_RIGHT , myThid) |
1979 |
c ToM>>> |
c >>> debug seaice_growth |
1980 |
#endif /* SEAICE_DEBUG */ |
#endif /* SEAICE_DEBUG */ |
1981 |
#ifdef SEAICE_ITD |
#ifdef SEAICE_ITD |
1982 |
C apply ice and snow thickness changes |
C apply ice and snow thickness changes |
2001 |
ENDDO |
ENDDO |
2002 |
#endif |
#endif |
2003 |
#ifdef SEAICE_DEBUG |
#ifdef SEAICE_DEBUG |
2004 |
c ToM<<< debug seaice_growth |
c <<< debug seaice_growth |
2005 |
WRITE(msgBuf,msgBufForm) |
WRITE(msgBuf,msgBufForm) |
2006 |
& ' SEAICE_GROWTH: Heff increments 9, HEFF = ', |
& ' SEAICE_GROWTH: Heff increments 9, HEFF = ', |
2007 |
#ifdef SEAICE_ITD |
#ifdef SEAICE_ITD |
2020 |
#endif |
#endif |
2021 |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit, |
2022 |
& SQUEEZE_RIGHT , myThid) |
& SQUEEZE_RIGHT , myThid) |
2023 |
c ToM>>> |
c >>> debug seaice_growth |
2024 |
#endif /* SEAICE_DEBUG */ |
#endif /* SEAICE_DEBUG */ |
2025 |
|
|
2026 |
C =================================================================== |
C =================================================================== |
2311 |
DO IT=1,nITD |
DO IT=1,nITD |
2312 |
DO J=1,sNy |
DO J=1,sNy |
2313 |
DO I=1,sNx |
DO I=1,sNx |
2314 |
cToM if fluxes in W/m^2 then |
C if fluxes in W/m^2 then use: |
2315 |
c a_QbyATM_cover(I,J)=a_QbyATM_cover(I,J) |
c a_QbyATM_cover(I,J)=a_QbyATM_cover(I,J) |
2316 |
c & + a_QbyATMmult_cover(I,J,IT) * areaFracFactor(I,J,IT) |
c & + a_QbyATMmult_cover(I,J,IT) * areaFracFactor(I,J,IT) |
2317 |
c r_QbyATM_cover(I,J)=r_QbyATM_cover(I,J) |
c r_QbyATM_cover(I,J)=r_QbyATM_cover(I,J) |
2320 |
c & + a_QSWbyATMmult_cover(I,J,IT) * areaFracFactor(I,J,IT) |
c & + a_QSWbyATMmult_cover(I,J,IT) * areaFracFactor(I,J,IT) |
2321 |
c r_FWbySublim(I,J)=r_FWbySublim(I,J) |
c r_FWbySublim(I,J)=r_FWbySublim(I,J) |
2322 |
c & + r_FWbySublimMult(I,J,IT) * areaFracFactor(I,J,IT) |
c & + r_FWbySublimMult(I,J,IT) * areaFracFactor(I,J,IT) |
2323 |
cToM if fluxes in effective ice meters, i.e. ice volume per area, then |
C if fluxes in effective ice meters, i.e. ice volume per area, then use: |
2324 |
a_QbyATM_cover(I,J)=a_QbyATM_cover(I,J) |
a_QbyATM_cover(I,J)=a_QbyATM_cover(I,J) |
2325 |
& + a_QbyATMmult_cover(I,J,IT) |
& + a_QbyATMmult_cover(I,J,IT) |
2326 |
r_QbyATM_cover(I,J)=r_QbyATM_cover(I,J) |
r_QbyATM_cover(I,J)=r_QbyATM_cover(I,J) |