| 1 |
dimitri |
1.7 |
C $Header: /u/gcmpack/MITgcm/pkg/icefront/icefront_thermodynamics.F,v 1.6 2010/02/16 21:25:22 dimitri Exp $ |
| 2 |
dimitri |
1.1 |
C $Name: $ |
| 3 |
|
|
|
| 4 |
|
|
#include "ICEFRONT_OPTIONS.h" |
| 5 |
|
|
|
| 6 |
|
|
CBOP |
| 7 |
|
|
C !ROUTINE: ICEFRONT_THERMODYNAMICS |
| 8 |
|
|
C !INTERFACE: |
| 9 |
|
|
SUBROUTINE ICEFRONT_THERMODYNAMICS( |
| 10 |
|
|
I myTime, myIter, myThid ) |
| 11 |
|
|
C !DESCRIPTION: \bv |
| 12 |
|
|
C *=============================================================* |
| 13 |
|
|
C | S/R ICEFRONT_THERMODYNAMICS |
| 14 |
|
|
C | o shelf-ice main routine. |
| 15 |
|
|
C | compute temperature and (virtual) salt flux at the |
| 16 |
|
|
C | shelf-ice ocean interface |
| 17 |
|
|
C | |
| 18 |
|
|
C | stresses at the ice/water interface are computed in separate |
| 19 |
|
|
C | routines that are called from mom_fluxform/mom_vecinv |
| 20 |
|
|
C *=============================================================* |
| 21 |
|
|
|
| 22 |
|
|
C !USES: |
| 23 |
|
|
IMPLICIT NONE |
| 24 |
|
|
|
| 25 |
|
|
C === Global variables === |
| 26 |
|
|
#include "SIZE.h" |
| 27 |
|
|
#include "EEPARAMS.h" |
| 28 |
|
|
#include "PARAMS.h" |
| 29 |
|
|
#include "GRID.h" |
| 30 |
|
|
#include "DYNVARS.h" |
| 31 |
|
|
#include "FFIELDS.h" |
| 32 |
|
|
#include "ICEFRONT.h" |
| 33 |
|
|
|
| 34 |
|
|
C !INPUT/OUTPUT PARAMETERS: |
| 35 |
|
|
C === Routine arguments === |
| 36 |
|
|
C myIter :: iteration counter for this thread |
| 37 |
|
|
C myTime :: time counter for this thread |
| 38 |
|
|
C myThid :: thread number for this instance of the routine. |
| 39 |
|
|
_RL myTime |
| 40 |
|
|
INTEGER myIter |
| 41 |
|
|
INTEGER myThid |
| 42 |
|
|
CEOP |
| 43 |
|
|
|
| 44 |
|
|
#ifdef ALLOW_ICEFRONT |
| 45 |
|
|
C !LOCAL VARIABLES : |
| 46 |
|
|
C === Local variables === |
| 47 |
dimitri |
1.6 |
C I,J,K,bi,bj :: loop counters |
| 48 |
dimitri |
1.1 |
C tLoc, sLoc, pLoc :: local in-situ temperature, salinity, pressure |
| 49 |
dimitri |
1.6 |
C thetaICE :: averaged temperature of glacier interior |
| 50 |
dimitri |
1.1 |
C theta/saltFreeze :: temperature and salinity of water at the |
| 51 |
|
|
C ice-ocean interface (at the freezing point) |
| 52 |
dimitri |
1.7 |
C FreshWaterFlux :: fresh water flux due to freezing or melting of ice |
| 53 |
|
|
C front in kg/m^2/s (positive increases ocean salinity) |
| 54 |
|
|
C HeatFlux :: ice front heat flux in W/m^2 |
| 55 |
|
|
C (positive decreases ocean temperature) |
| 56 |
dimitri |
1.1 |
C auxiliary variables and abbreviations: |
| 57 |
dimitri |
1.6 |
C a0, b, c0 |
| 58 |
dimitri |
1.1 |
C eps1, eps2, eps3, eps4, eps5, eps6, eps7 |
| 59 |
|
|
C aqe, bqe, cqe, discrim, recip_aqe |
| 60 |
dimitri |
1.5 |
INTEGER I,J,K |
| 61 |
dimitri |
1.1 |
INTEGER bi,bj |
| 62 |
dimitri |
1.4 |
_RL tLoc, sLoc, pLoc |
| 63 |
dimitri |
1.6 |
_RL thetaICE |
| 64 |
dimitri |
1.1 |
_RL thetaFreeze, saltFreeze |
| 65 |
dimitri |
1.7 |
_RS FreshWaterFlux( 1:sNx, 1:sNy ) |
| 66 |
|
|
_RS HeatFlux ( 1:sNx, 1:sNy ) |
| 67 |
dimitri |
1.5 |
_RL a0, b, c0 |
| 68 |
dimitri |
1.1 |
_RL eps1, eps2, eps3, eps4, eps5, eps6, eps7 |
| 69 |
|
|
_RL aqe, bqe, cqe, discrim, recip_aqe |
| 70 |
|
|
|
| 71 |
dimitri |
1.5 |
|
| 72 |
dimitri |
1.1 |
_RL SW_TEMP |
| 73 |
|
|
EXTERNAL SW_TEMP |
| 74 |
|
|
|
| 75 |
|
|
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
| 76 |
|
|
|
| 77 |
dimitri |
1.7 |
C Linear dependence of freezing point on salinity. |
| 78 |
dimitri |
1.1 |
a0 = -0.0575 _d 0 |
| 79 |
|
|
c0 = 0.0901 _d 0 |
| 80 |
|
|
b = -7.61 _d -4 |
| 81 |
dimitri |
1.4 |
|
| 82 |
dimitri |
1.7 |
C A few abbreviations. |
| 83 |
dimitri |
1.4 |
eps1 = rUnit2mass*HeatCapacity_Cp*ICEFRONTheatTransCoeff |
| 84 |
|
|
eps2 = rUnit2mass*ICEFRONTlatentHeat*ICEFRONTsaltTransCoeff |
| 85 |
|
|
eps3 = rUnit2mass*ICEFRONTheatCapacity_Cp*ICEFRONTsaltTransCoeff |
| 86 |
dimitri |
1.5 |
eps5 = mass2rUnit/HeatCapacity_Cp |
| 87 |
dimitri |
1.6 |
aqe = a0 *(-eps1+eps3) |
| 88 |
|
|
recip_aqe = 0.5 _d 0/aqe |
| 89 |
dimitri |
1.1 |
|
| 90 |
|
|
DO bj = myByLo(myThid), myByHi(myThid) |
| 91 |
|
|
DO bi = myBxLo(myThid), myBxHi(myThid) |
| 92 |
dimitri |
1.7 |
DO K = 1, Nr |
| 93 |
|
|
DO J = 1, sNy |
| 94 |
|
|
DO I = 1, sNx |
| 95 |
dimitri |
1.6 |
|
| 96 |
dimitri |
1.7 |
IF( ICEFRONTlength(I,J,bi,bj) .GT. 0. _d 0 |
| 97 |
|
|
& .AND. K .LE. K_icefront(I,J,bi,bj) ) THEN |
| 98 |
dimitri |
1.1 |
|
| 99 |
dimitri |
1.7 |
C Make local copies of temperature, salinity and depth (pressure). |
| 100 |
dimitri |
1.4 |
pLoc = ABS(rC(k)) |
| 101 |
|
|
tLoc = theta(I,J,K,bi,bj) |
| 102 |
|
|
sLoc = MAX(salt(I,J,K,bi,bj), 0. _d 0) |
| 103 |
|
|
|
| 104 |
dimitri |
1.7 |
C Turn potential temperature into in-situ temperature. |
| 105 |
dimitri |
1.4 |
tLoc = SW_TEMP(sLoc,tLoc,pLoc,0.D0) |
| 106 |
dimitri |
1.5 |
|
| 107 |
dimitri |
1.7 |
C Get ice temperature. Assume linear ice temperature change from |
| 108 |
|
|
C the surface (ICEFRONTthetaSurface) to the base(0 degree C). |
| 109 |
dimitri |
1.5 |
IF ( K .EQ. K_icefront(I,J,bi,bj)) THEN |
| 110 |
dimitri |
1.7 |
pLoc = 0.5*(ABS(R_icefront(I,J,bi,bj))+ABS(rF(K))) |
| 111 |
dimitri |
1.5 |
ENDIF |
| 112 |
dimitri |
1.4 |
thetaICE = ICEFRONTthetaSurface* |
| 113 |
|
|
& (R_icefront(I,J,bi,bj)-pLoc) |
| 114 |
|
|
& / R_icefront(I,J,bi,bj) |
| 115 |
dimitri |
1.1 |
|
| 116 |
dimitri |
1.7 |
C A few more abbreviations. |
| 117 |
dimitri |
1.4 |
eps4 = b*pLoc + c0 |
| 118 |
|
|
eps6 = eps4 - tLoc |
| 119 |
|
|
eps7 = eps4 - thetaIce |
| 120 |
dimitri |
1.1 |
|
| 121 |
dimitri |
1.7 |
C Solve quadratic equation to get salinity at icefront-ocean interface. |
| 122 |
dimitri |
1.4 |
bqe = - eps1*eps6 -sLoc*a0*eps3 + eps3*eps7 + eps2 |
| 123 |
|
|
cqe = -(eps2+eps3*eps7)*sLoc |
| 124 |
dimitri |
1.1 |
discrim = bqe*bqe - 4. _d 0*aqe*cqe |
| 125 |
|
|
saltFreeze = (- bqe - SQRT(discrim))*recip_aqe |
| 126 |
|
|
IF ( saltFreeze .LT. 0. _d 0 ) |
| 127 |
|
|
& saltFreeze = (- bqe + SQRT(discrim))*recip_aqe |
| 128 |
|
|
thetaFreeze = a0*saltFreeze + eps4 |
| 129 |
dimitri |
1.4 |
|
| 130 |
dimitri |
1.7 |
C-- Calculate the outward (leaving the ocean) heat (W/m^2) |
| 131 |
|
|
C and freshwater (kg/m^2/s). |
| 132 |
|
|
C Sign convention: inward (negative) fresh water flux implies glacier |
| 133 |
|
|
C melting due to outward (positive) heat flux. |
| 134 |
|
|
FreshWaterFlux(I,J) = maskC(I,J,K,bi,bj) * |
| 135 |
|
|
& eps1 * ( thetaFreeze - tLoc ) / |
| 136 |
dimitri |
1.4 |
& (ICEFRONTlatentHeat + ICEFRONTheatCapacity_cp* |
| 137 |
|
|
& (thetaFreeze - thetaIce)) |
| 138 |
dimitri |
1.7 |
HeatFlux(I,J) = maskC(I,J,K,bi,bj) * HeatCapacity_Cp * |
| 139 |
|
|
& ( -rUnit2mass*ICEFRONTheatTransCoeff + |
| 140 |
|
|
& FreshWaterFlux(I,J) ) * ( thetaFreeze - tLoc ) |
| 141 |
|
|
|
| 142 |
|
|
C Compute tendencies. |
| 143 |
|
|
icefront_TendT(i,j,K,bi,bj) = - HeatFlux(I,J)* eps5 |
| 144 |
|
|
icefront_TendS(i,j,K,bi,bj) = FreshWaterFlux(I,J) * |
| 145 |
|
|
& mass2rUnit * sLoc |
| 146 |
dimitri |
1.4 |
|
| 147 |
dimitri |
1.7 |
C Scale by icefrontlength, which is the ratio of the horizontal length |
| 148 |
|
|
C of the ice front in each model grid cell divided by the grid cell area. |
| 149 |
dimitri |
1.4 |
IF (k .LT. k_icefront(i,j,bi,bj)) THEN |
| 150 |
|
|
icefront_TendT(i,j,K,bi,bj) = icefront_TendT(i,j,K,bi,bj) |
| 151 |
|
|
& * ICEFRONTlength(i,j,bi,bj) |
| 152 |
|
|
icefront_TendS(i,j,K,bi,bj) = icefront_TendS(i,j,K,bi,bj) |
| 153 |
|
|
& * ICEFRONTlength(i,j,bi,bj) |
| 154 |
|
|
ELSEIF (k .EQ. k_icefront(i,j,bi,bj)) THEN |
| 155 |
dimitri |
1.7 |
C At the bottom of the ice shelf there is additional scaling due |
| 156 |
|
|
C to the partial depth of the ice front. |
| 157 |
dimitri |
1.4 |
icefront_TendT(i,j,K,bi,bj) = icefront_TendT(i,j,K,bi,bj) |
| 158 |
|
|
& * ICEFRONTlength(i,j,bi,bj) |
| 159 |
|
|
& * (ABS(R_icefront(I,J,bi,bj))-ABS(rF(K))) |
| 160 |
|
|
& * recip_drF(K) |
| 161 |
|
|
icefront_TendS(i,j,K,bi,bj) = icefront_TendS(i,j,K,bi,bj) |
| 162 |
|
|
& * ICEFRONTlength(i,j,bi,bj) |
| 163 |
|
|
& * (ABS(R_icefront(I,J,bi,bj))-ABS(rF(K))) |
| 164 |
|
|
& * recip_drF(K) |
| 165 |
dimitri |
1.6 |
ENDIF |
| 166 |
dimitri |
1.4 |
|
| 167 |
dimitri |
1.7 |
ELSE ! K .LE. K_icefront |
| 168 |
|
|
|
| 169 |
|
|
HeatFlux (I,J) = 0. _d 0 |
| 170 |
|
|
FreshWaterFlux(I,J) = 0. _d 0 |
| 171 |
|
|
|
| 172 |
|
|
ENDIF ! K .LE. K_icefront |
| 173 |
|
|
|
| 174 |
|
|
ENDDO ! I = 1, sNx |
| 175 |
|
|
ENDDO ! J = 1, sNy |
| 176 |
dimitri |
1.1 |
|
| 177 |
|
|
#ifdef ALLOW_DIAGNOSTICS |
| 178 |
dimitri |
1.7 |
IF ( useDiagnostics ) THEN |
| 179 |
|
|
CALL DIAGNOSTICS_FILL_RS(FreshWaterFlux,'ICFfwFlx', |
| 180 |
|
|
& k,1,3,bi,bj,myThid) |
| 181 |
|
|
CALL DIAGNOSTICS_FILL_RS(HeatFlux, 'ICFhtFlx', |
| 182 |
|
|
& k,1,3,bi,bj,myThid) |
| 183 |
|
|
ENDIF |
| 184 |
dimitri |
1.1 |
#endif /* ALLOW_DIAGNOSTICS */ |
| 185 |
|
|
|
| 186 |
dimitri |
1.7 |
ENDDO ! K = 1, Nr |
| 187 |
|
|
ENDDO ! bi = myBxLo, myBxHi |
| 188 |
|
|
ENDDO ! bj = myByLo, myByHi |
| 189 |
dimitri |
1.6 |
|
| 190 |
dimitri |
1.1 |
#endif /* ALLOW_ICEFRONT */ |
| 191 |
|
|
RETURN |
| 192 |
|
|
END |