1 |
C $Header: /u/gcmpack/MITgcm/pkg/icefront/icefront_thermodynamics.F,v 1.6 2010/02/16 21:25:22 dimitri Exp $ |
2 |
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 |
C I,J,K,bi,bj :: loop counters |
48 |
C tLoc, sLoc, pLoc :: local in-situ temperature, salinity, pressure |
49 |
C thetaICE :: averaged temperature of glacier interior |
50 |
C theta/saltFreeze :: temperature and salinity of water at the |
51 |
C ice-ocean interface (at the freezing point) |
52 |
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 |
C auxiliary variables and abbreviations: |
57 |
C a0, b, c0 |
58 |
C eps1, eps2, eps3, eps4, eps5, eps6, eps7 |
59 |
C aqe, bqe, cqe, discrim, recip_aqe |
60 |
INTEGER I,J,K |
61 |
INTEGER bi,bj |
62 |
_RL tLoc, sLoc, pLoc |
63 |
_RL thetaICE |
64 |
_RL thetaFreeze, saltFreeze |
65 |
_RS FreshWaterFlux( 1:sNx, 1:sNy ) |
66 |
_RS HeatFlux ( 1:sNx, 1:sNy ) |
67 |
_RL a0, b, c0 |
68 |
_RL eps1, eps2, eps3, eps4, eps5, eps6, eps7 |
69 |
_RL aqe, bqe, cqe, discrim, recip_aqe |
70 |
|
71 |
|
72 |
_RL SW_TEMP |
73 |
EXTERNAL SW_TEMP |
74 |
|
75 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
76 |
|
77 |
C Linear dependence of freezing point on salinity. |
78 |
a0 = -0.0575 _d 0 |
79 |
c0 = 0.0901 _d 0 |
80 |
b = -7.61 _d -4 |
81 |
|
82 |
C A few abbreviations. |
83 |
eps1 = rUnit2mass*HeatCapacity_Cp*ICEFRONTheatTransCoeff |
84 |
eps2 = rUnit2mass*ICEFRONTlatentHeat*ICEFRONTsaltTransCoeff |
85 |
eps3 = rUnit2mass*ICEFRONTheatCapacity_Cp*ICEFRONTsaltTransCoeff |
86 |
eps5 = mass2rUnit/HeatCapacity_Cp |
87 |
aqe = a0 *(-eps1+eps3) |
88 |
recip_aqe = 0.5 _d 0/aqe |
89 |
|
90 |
DO bj = myByLo(myThid), myByHi(myThid) |
91 |
DO bi = myBxLo(myThid), myBxHi(myThid) |
92 |
DO K = 1, Nr |
93 |
DO J = 1, sNy |
94 |
DO I = 1, sNx |
95 |
|
96 |
IF( ICEFRONTlength(I,J,bi,bj) .GT. 0. _d 0 |
97 |
& .AND. K .LE. K_icefront(I,J,bi,bj) ) THEN |
98 |
|
99 |
C Make local copies of temperature, salinity and depth (pressure). |
100 |
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 |
C Turn potential temperature into in-situ temperature. |
105 |
tLoc = SW_TEMP(sLoc,tLoc,pLoc,0.D0) |
106 |
|
107 |
C Get ice temperature. Assume linear ice temperature change from |
108 |
C the surface (ICEFRONTthetaSurface) to the base(0 degree C). |
109 |
IF ( K .EQ. K_icefront(I,J,bi,bj)) THEN |
110 |
pLoc = 0.5*(ABS(R_icefront(I,J,bi,bj))+ABS(rF(K))) |
111 |
ENDIF |
112 |
thetaICE = ICEFRONTthetaSurface* |
113 |
& (R_icefront(I,J,bi,bj)-pLoc) |
114 |
& / R_icefront(I,J,bi,bj) |
115 |
|
116 |
C A few more abbreviations. |
117 |
eps4 = b*pLoc + c0 |
118 |
eps6 = eps4 - tLoc |
119 |
eps7 = eps4 - thetaIce |
120 |
|
121 |
C Solve quadratic equation to get salinity at icefront-ocean interface. |
122 |
bqe = - eps1*eps6 -sLoc*a0*eps3 + eps3*eps7 + eps2 |
123 |
cqe = -(eps2+eps3*eps7)*sLoc |
124 |
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 |
|
130 |
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 |
& (ICEFRONTlatentHeat + ICEFRONTheatCapacity_cp* |
137 |
& (thetaFreeze - thetaIce)) |
138 |
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 |
|
147 |
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 |
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 |
C At the bottom of the ice shelf there is additional scaling due |
156 |
C to the partial depth of the ice front. |
157 |
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 |
ENDIF |
166 |
|
167 |
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 |
|
177 |
#ifdef ALLOW_DIAGNOSTICS |
178 |
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 |
#endif /* ALLOW_DIAGNOSTICS */ |
185 |
|
186 |
ENDDO ! K = 1, Nr |
187 |
ENDDO ! bi = myBxLo, myBxHi |
188 |
ENDDO ! bj = myByLo, myByHi |
189 |
|
190 |
#endif /* ALLOW_ICEFRONT */ |
191 |
RETURN |
192 |
END |