Back to home page

MITgcm

 
 

    


File indexing completed on 2022-04-29 05:09:39 UTC

view on githubraw file Latest commit 3bafcf60 on 2022-04-28 17:30:33 UTC
2ec5465710 Dani*0001 #include "SHELFICE_OPTIONS.h"
a0178c5a01 Jean*0002 #ifdef ALLOW_STREAMICE
                0003 # include "STREAMICE_OPTIONS.h"
                0004 #endif
2ec5465710 Dani*0005 
abfe198bce Mart*0006 C--   File shelfice_step_icemass.F:
                0007 C--    Contents:
                0008 C--    o SHELFICE_STEP_ICEMASS
                0009 C--    o SHELFICE_NETMASSFLUX_SURF
                0010 
                0011 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
2ec5465710 Dani*0012 CBOP
148dd84005 jm-c 0013 C !ROUTINE: SHELFICE_STEP_ICEMASS
2ec5465710 Dani*0014 
                0015 C !INTERFACE: ==========================================================
                0016       SUBROUTINE SHELFICE_STEP_ICEMASS(
                0017      I                        myTime, myIter, myThid )
                0018 
                0019 C !DESCRIPTION:
                0020 C Serves as a "stub" for ice dynamics
a0178c5a01 Jean*0021 C will later be used to
2ec5465710 Dani*0022 
                0023 C !USES: ===============================================================
                0024       IMPLICIT NONE
                0025 #include "SIZE.h"
                0026 #include "EEPARAMS.h"
                0027 #include "PARAMS.h"
                0028 #include "GRID.h"
                0029 #include "SHELFICE.h"
a0178c5a01 Jean*0030 #ifdef ALLOW_STREAMICE
                0031 # include "STREAMICE.h"
                0032 #endif
2ec5465710 Dani*0033 
                0034 C     !INPUT/OUTPUT PARAMETERS:
148dd84005 jm-c 0035 C     myTime      :: current time in simulation
                0036 C     myIter      :: current iteration number insimulation
                0037 C     myThid      :: my thread Id number
2ec5465710 Dani*0038       _RL  myTime
                0039       INTEGER myIter
                0040       INTEGER myThid
                0041 CEOP
                0042 
                0043 #ifdef ALLOW_SHELFICE
                0044 C !LOCAL VARIABLES : ====================================================
148dd84005 jm-c 0045 C     i,j, bi,bj  :: loop indices
a0178c5a01 Jean*0046       INTEGER bi,bj,i,j
                0047 
                0048       IF ( SHELFICEMassStepping ) THEN
                0049 
                0050        IF (useStreamIce) THEN
148dd84005 jm-c 0051 
                0052 #ifdef ALLOW_STREAMICE
a0178c5a01 Jean*0053         DO bj = myByLo(myThid), myByHi(myThid)
                0054          DO bi = myBxLo(myThid), myBxHi(myThid)
                0055           DO j=1-OLy,sNy+OLy-1
                0056            DO i=1-OLx+1,sNx+OLx-1
148dd84005 jm-c 0057             IF ( streamice_hmask(i,j,bi,bj).EQ.1 .OR.
                0058      &           streamice_hmask(i,j,bi,bj).EQ.2 ) THEN
a0178c5a01 Jean*0059              shelficeMass(i,j,bi,bj) =
148dd84005 jm-c 0060      &        H_streamice(i,j,bi,bj) * streamice_density
                0061             ENDIF
a0178c5a01 Jean*0062            ENDDO
                0063           ENDDO
                0064          ENDDO
                0065         ENDDO
                0066 #endif /* ALLOW_STREAMICE */
2ec5465710 Dani*0067 
148dd84005 jm-c 0068        ELSE
                0069 
a0178c5a01 Jean*0070         DO bj = myByLo(myThid), myByHi(myThid)
                0071          DO bi = myBxLo(myThid), myBxHi(myThid)
2ec5465710 Dani*0072 
c96d63ff5a Jean*0073            IF ( .NOT.SHELFICEDynMassOnly ) THEN
                0074             DO j=1-OLy,sNy+OLy
                0075              DO i=1-OLx,sNx+OLx
                0076               shelficeMass(i,j,bi,bj) = shelficeMass(i,j,bi,bj)
                0077      &              + shelfIceFreshWaterFlux(i,j,bi,bj)*deltaT
                0078              ENDDO
                0079             ENDDO
                0080            ENDIF
                0081 
                0082            DO j=1-OLy,sNy+OLy
                0083             DO i=1-OLx,sNx+OLx
                0084               shelficeMass(i,j,bi,bj) = shelficeMass(i,j,bi,bj)
                0085      &              + shelfIceMassDynTendency(i,j,bi,bj)*deltaT
                0086             ENDDO
                0087            ENDDO
2ec5465710 Dani*0088 
c96d63ff5a Jean*0089 C--    quick fix to prevent ice-shelf mass to become negative
                0090            DO j=1-OLy,sNy+OLy
                0091             DO i=1-OLx,sNx+OLx
                0092               shelficeMass(i,j,bi,bj) =
                0093      &              MAX( shelficeMass(i,j,bi,bj), zeroRL )
                0094             ENDDO
a0178c5a01 Jean*0095            ENDDO
c96d63ff5a Jean*0096 
2ec5465710 Dani*0097          ENDDO
                0098         ENDDO
a0178c5a01 Jean*0099        ENDIF
2ec5465710 Dani*0100 
4d294a5719 Jean*0101        _EXCH_XY_RL( shelficeMass, myThid )
a0178c5a01 Jean*0102 
3bafcf6020 Timo*0103 #ifndef ALLOW_OPENAD
                0104 C--  Calculate new loading anomaly (in case the ice-shelf mass was updated)
                0105        DO bj = myByLo(myThid), myByHi(myThid)
                0106         DO bi = myBxLo(myThid), myBxHi(myThid)
                0107          DO j = 1-OLy, sNy+OLy
                0108           DO i = 1-OLx, sNx+OLx
                0109            shelficeLoadAnomaly(i,j,bi,bj) = gravity
                0110      &      *( shelficeMass(i,j,bi,bj) + rhoConst*Ro_surf(i,j,bi,bj) )
                0111           ENDDO
                0112          ENDDO
                0113         ENDDO
                0114        ENDDO
                0115 #endif
                0116 
a0178c5a01 Jean*0117       ENDIF
2ec5465710 Dani*0118 
                0119 #ifdef ALLOW_DIAGNOSTICS
                0120       IF (useDiagnostics) THEN
4d294a5719 Jean*0121         CALL DIAGNOSTICS_FILL( shelficeMass, 'SHI_mass',
                0122      I                         0, 1, 0, 1, 1, myThid )
2ec5465710 Dani*0123       ENDIF
                0124 #endif /* ALLOW_DIAGNOSTICS */
                0125 #endif /* ALLOW_SHELFICE */
                0126 
                0127       RETURN
                0128       END
abfe198bce Mart*0129 
                0130 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
                0131 CBOP
                0132 C !ROUTINE: SHELFICE_NETMASSFLUX_SURF
                0133 
                0134 C !INTERFACE: ==========================================================
                0135       SUBROUTINE SHELFICE_NETMASSFLUX_SURF(
                0136      O                        shelfIceNetMassFlux,
                0137      I                        myTime, myIter, myThid )
                0138 
                0139 C !DESCRIPTION:
                0140 C compute the net mass flux implied by S/R SHELFICE_STEP_MASS
                0141 
                0142 C !USES: ===============================================================
                0143       IMPLICIT NONE
                0144 #include "SIZE.h"
                0145 #include "EEPARAMS.h"
                0146 #include "PARAMS.h"
                0147 #include "GRID.h"
                0148 #include "SHELFICE.h"
                0149 #ifdef ALLOW_STREAMICE
                0150 # include "STREAMICE.h"
                0151 #endif
                0152 #include "DYNVARS.h"
                0153 
                0154 C     !INPUT/OUTPUT PARAMETERS:
                0155 C     myTime      :: current time in simulation
                0156 C     myIter      :: current iteration number insimulation
                0157 C     myThid      :: my thread Id number
                0158       _RL  myTime
                0159       INTEGER myIter
                0160       INTEGER myThid
                0161 C     net mass flux in m^3/s
                0162       _RL shelfIceNetMassFlux
                0163 CEOP
                0164 
                0165 #ifdef ALLOW_SHELFICE
                0166 C !LOCAL VARIABLES : ====================================================
                0167 C     i,j, bi,bj  :: loop indices
                0168       INTEGER bi,bj,i,j
                0169       _RL shelfIceNetMassFluxTile(nSx,nSy)
                0170 
                0171       shelfIceNetMassFlux = 0. _d 0
                0172 
                0173       IF ( SHELFICEMassStepping ) THEN
                0174 
                0175        IF (useStreamIce) THEN
                0176 
                0177 #ifdef ALLOW_STREAMICE
                0178         DO bj = myByLo(myThid), myByHi(myThid)
                0179          DO bi = myBxLo(myThid), myBxHi(myThid)
                0180           shelfIceNetMassFluxTile(bi,bj) = 0. _d 0
                0181           DO j=1,sNy
                0182            DO i=1,sNx
                0183             IF ( streamice_hmask(i,j,bi,bj).EQ.1 .OR.
                0184      &           streamice_hmask(i,j,bi,bj).EQ.2 ) THEN
                0185 C--   this assumes that the change in H_streamice include the melting flux
                0186 CML             shelfIceNetMassFluxTile(bi,bj) =
                0187 CML     &              shelfIceNetMassFluxTile(bi,bj)
                0188 CML     &            +(H_streamice(i,j,bi,bj)-H_streamice_prev(i,j,bi,bj))
                0189 CML     &            /deltaT * streamice_density * mass2rUnit
                0190 CML     &            * _rA(i,j,bi,bj) * maskInC(i,j,bi,bj)
                0191             ENDIF
                0192            ENDDO
                0193           ENDDO
                0194          ENDDO
                0195         ENDDO
                0196 #endif /* ALLOW_STREAMICE */
                0197 
                0198        ELSE
                0199 
                0200         DO bj = myByLo(myThid), myByHi(myThid)
                0201          DO bi = myBxLo(myThid), myBxHi(myThid)
                0202           shelfIceNetMassFluxTile(bi,bj) = 0. _d 0
                0203           DO j=1,sNy
                0204            DO i=1,sNx
                0205 C--   Flux of new ice will raise the sea level
                0206             shelfIceNetMassFluxTile(bi,bj) =
                0207      &             shelfIceNetMassFluxTile(bi,bj)
                0208      &           + shelfIceMassDynTendency(i,j,bi,bj)
                0209      &           * _rA(i,j,bi,bj) * maskInC(i,j,bi,bj)
                0210             IF ( .NOT.SHELFICEDynMassOnly ) THEN
                0211 C--   Freshwater flux by thermodynamic processes. In the case of
                0212 C     melting this will be negative (positive upward) so it will reduce
                0213 C     the amount of added ice mass. The same freshwater flux is added
                0214 C     to the ocean in EmPmR and will raise the sea level, so that this
                0215 C     contribution is canceled.
                0216              shelfIceNetMassFluxTile(bi,bj) =
                0217      &              shelfIceNetMassFluxTile(bi,bj)
                0218      &            + shelfIceFreshWaterFlux(i,j,bi,bj)
                0219      &            * _rA(i,j,bi,bj) * maskInC(i,j,bi,bj)
                0220             ENDIF
                0221            ENDDO
                0222           ENDDO
                0223          ENDDO
                0224         ENDDO
                0225 
                0226        ENDIF
                0227 
                0228        CALL GLOBAL_SUM_TILE_RL( shelficeNetMassFluxTile,
                0229      &      shelficeNetMassFlux, myThid )
                0230 
                0231       ENDIF
                0232 
                0233 #endif /* ALLOW_SHELFICE */
                0234 
                0235       RETURN
                0236       END