1 |
jmc |
1.12 |
C $Header: /u/gcmpack/MITgcm/pkg/thsice/thsice_calc_thickn.F,v 1.11 2007/05/04 19:15:56 jmc Exp $ |
2 |
jmc |
1.1 |
C $Name: $ |
3 |
|
|
|
4 |
|
|
#include "THSICE_OPTIONS.h" |
5 |
|
|
|
6 |
|
|
CBOP |
7 |
|
|
C !ROUTINE: THSICE_CALC_THICKN |
8 |
|
|
C !INTERFACE: |
9 |
|
|
SUBROUTINE THSICE_CALC_THICKN( |
10 |
jmc |
1.6 |
I bi, bj, siLo, siHi, sjLo, sjHi, |
11 |
|
|
I iMin,iMax, jMin,jMax, dBugFlag, |
12 |
|
|
I iceMask, tFrz, tOce, v2oc, |
13 |
|
|
I snowP, prcAtm, sHeat, flxCnB, |
14 |
|
|
U icFrac, hIce, hSnow, tSrf, qIc1, qIc2, |
15 |
|
|
U frwAtm, fzMlOc, flx2oc, |
16 |
|
|
O frw2oc, fsalt, |
17 |
|
|
I myTime, myIter, myThid ) |
18 |
jmc |
1.1 |
C !DESCRIPTION: \bv |
19 |
|
|
C *==========================================================* |
20 |
|
|
C | S/R THSICE_CALC_THICKN |
21 |
|
|
C | o Calculate ice & snow thickness changes |
22 |
|
|
C *==========================================================* |
23 |
|
|
C \ev |
24 |
jmc |
1.6 |
C ADAPTED FROM: |
25 |
|
|
C LANL CICE.v2.0.2 |
26 |
|
|
C----------------------------------------------------------------------- |
27 |
|
|
C.. thermodynamics (vertical physics) based on M. Winton 3-layer model |
28 |
|
|
C.. See Bitz, C. M. and W. H. Lipscomb, 1999: "An energy-conserving |
29 |
|
|
C.. thermodynamic sea ice model for climate study." J. Geophys. |
30 |
|
|
C.. Res., 104, 15669 - 15677. |
31 |
|
|
C.. Winton, M., 1999: "A reformulated three-layer sea ice model." |
32 |
|
|
C.. Submitted to J. Atmos. Ocean. Technol. |
33 |
|
|
C.. authors Elizabeth C. Hunke and William Lipscomb |
34 |
|
|
C.. Fluid Dynamics Group, Los Alamos National Laboratory |
35 |
|
|
C----------------------------------------------------------------------- |
36 |
|
|
Cc****subroutine thermo_winton(n,fice,fsnow,dqice,dTsfc) |
37 |
|
|
C.. Compute temperature change using Winton model with 2 ice layers, of |
38 |
|
|
C.. which only the top layer has a variable heat capacity. |
39 |
jmc |
1.1 |
|
40 |
jmc |
1.9 |
C--------------------------------- |
41 |
|
|
C parameters that control the partitioning between lateral (ice area) and |
42 |
|
|
C vertical (ice thickness) ice volume changes. |
43 |
|
|
C a) surface melting and bottom melting: |
44 |
|
|
C frace is the fraction of available heat that is used for |
45 |
|
|
C lateral melting (and 1-frace reduces the thickness ) when |
46 |
|
|
C hi < hThinIce : frace=1 (lateral melting only) |
47 |
|
|
C hThinIce < hi < hThickIce: frace=fracEnMelt (runtime parameter) ; |
48 |
|
|
C hi > hThickIce : frace=0 (thinning only) |
49 |
|
|
C b) ocean freezing (and ice forming): |
50 |
|
|
C if hi > hThickIce : use all freezing potential to grow ice laterally (up |
51 |
|
|
C to areaMax), and reserve conductive heat flux to increase thickness. |
52 |
|
|
C if hi < hThickIce : below the sea-ice covered ocean, use the full freezing |
53 |
|
|
C potential (x iceFraction) to grow ice vertically; |
54 |
|
|
C and over open ocean, form new ice (@ the same thickness) |
55 |
|
|
C--------------------------------- |
56 |
jmc |
1.1 |
C !USES: |
57 |
|
|
IMPLICIT NONE |
58 |
|
|
|
59 |
|
|
C == Global variables === |
60 |
jmc |
1.4 |
#include "EEPARAMS.h" |
61 |
jmc |
1.1 |
#include "THSICE_SIZE.h" |
62 |
|
|
#include "THSICE_PARAMS.h" |
63 |
heimbach |
1.7 |
#ifdef ALLOW_AUTODIFF_TAMC |
64 |
|
|
# include "SIZE.h" |
65 |
|
|
# include "tamc.h" |
66 |
|
|
# include "tamc_keys.h" |
67 |
|
|
#endif |
68 |
jmc |
1.1 |
|
69 |
|
|
C !INPUT/OUTPUT PARAMETERS: |
70 |
|
|
C == Routine Arguments == |
71 |
jmc |
1.6 |
C siLo,siHi :: size of input/output array: 1rst dim. lower,higher bounds |
72 |
|
|
C sjLo,sjHi :: size of input/output array: 2nd dim. lower,higher bounds |
73 |
|
|
C bi,bj :: tile indices |
74 |
|
|
C iMin,iMax :: computation domain: 1rst index range |
75 |
|
|
C jMin,jMax :: computation domain: 2nd index range |
76 |
|
|
C dBugFlag :: allow to print debugging stuff (e.g. on 1 grid point). |
77 |
|
|
C--- Input: |
78 |
|
|
C iceMask :: sea-ice fractional mask [0-1] |
79 |
|
|
C tFrz (Tf) :: sea-water freezing temperature [oC] (function of S) |
80 |
|
|
C tOce (oceTs) :: surface level oceanic temperature [oC] |
81 |
|
|
C v2oc (oceV2s) :: square of ocean surface-level velocity [m2/s2] |
82 |
|
|
C snowP (snowPr) :: snow precipitation [kg/m2/s] |
83 |
|
|
C prcAtm (=) :: total precip from the atmosphere [kg/m2/s] |
84 |
|
|
C sHeat(sHeating):: surf heating flux left to melt snow or ice (= Atmos-conduction) |
85 |
|
|
C flxCnB (=) :: heat flux conducted through the ice to bottom surface |
86 |
|
|
C--- Modified (input&output): |
87 |
|
|
C icFrac(iceFrac):: fraction of grid area covered in ice |
88 |
|
|
C hIce (hi) :: ice height [m] |
89 |
|
|
C hSnow (hs) :: snow height [m] |
90 |
|
|
C tSrf (Tsf) :: surface (ice or snow) temperature |
91 |
|
|
C qIc1 (qicen) :: ice enthalpy (J/kg), 1rst level |
92 |
|
|
C qIc2 (qicen) :: ice enthalpy (J/kg), 2nd level |
93 |
|
|
C frwAtm (evpAtm):: evaporation to the atmosphere [kg/m2/s] (>0 if evaporate) |
94 |
|
|
C fzMlOc (frzmlt):: ocean mixed-layer freezing/melting potential [W/m2] |
95 |
|
|
C flx2oc (qleft) :: net heat flux to ocean [W/m2] (> 0 downward) |
96 |
|
|
C--- Output |
97 |
|
|
C frw2oc (fresh) :: Total fresh water flux to ocean [kg/m2/s] (> 0 downward) |
98 |
|
|
C fsalt (=) :: salt flux to ocean [g/m2/s] (> 0 downward) |
99 |
|
|
C--- Input: |
100 |
|
|
C myTime :: current Time of simulation [s] |
101 |
|
|
C myIter :: current Iteration number in simulation |
102 |
|
|
C myThid :: my Thread Id number |
103 |
|
|
INTEGER siLo, siHi, sjLo, sjHi |
104 |
|
|
INTEGER bi,bj |
105 |
|
|
INTEGER iMin, iMax |
106 |
|
|
INTEGER jMin, jMax |
107 |
|
|
LOGICAL dBugFlag |
108 |
|
|
_RL iceMask(siLo:siHi,sjLo:sjHi) |
109 |
|
|
_RL tFrz (siLo:siHi,sjLo:sjHi) |
110 |
|
|
_RL tOce (siLo:siHi,sjLo:sjHi) |
111 |
|
|
_RL v2oc (siLo:siHi,sjLo:sjHi) |
112 |
|
|
_RL snowP (siLo:siHi,sjLo:sjHi) |
113 |
|
|
_RL prcAtm (siLo:siHi,sjLo:sjHi) |
114 |
|
|
_RL sHeat (siLo:siHi,sjLo:sjHi) |
115 |
|
|
_RL flxCnB (siLo:siHi,sjLo:sjHi) |
116 |
|
|
_RL icFrac (siLo:siHi,sjLo:sjHi) |
117 |
|
|
_RL hIce (siLo:siHi,sjLo:sjHi) |
118 |
|
|
_RL hSnow (siLo:siHi,sjLo:sjHi) |
119 |
|
|
_RL tSrf (siLo:siHi,sjLo:sjHi) |
120 |
|
|
_RL qIc1 (siLo:siHi,sjLo:sjHi) |
121 |
|
|
_RL qIc2 (siLo:siHi,sjLo:sjHi) |
122 |
|
|
_RL frwAtm (siLo:siHi,sjLo:sjHi) |
123 |
|
|
_RL fzMlOc (siLo:siHi,sjLo:sjHi) |
124 |
|
|
_RL flx2oc (siLo:siHi,sjLo:sjHi) |
125 |
|
|
_RL frw2oc (siLo:siHi,sjLo:sjHi) |
126 |
|
|
_RL fsalt (siLo:siHi,sjLo:sjHi) |
127 |
|
|
_RL myTime |
128 |
|
|
INTEGER myIter |
129 |
|
|
INTEGER myThid |
130 |
|
|
CEOP |
131 |
|
|
|
132 |
|
|
#ifdef ALLOW_THSICE |
133 |
|
|
|
134 |
|
|
C !LOCAL VARIABLES: |
135 |
|
|
C--- local copy of input/output argument list variables (see description above) |
136 |
jmc |
1.1 |
_RL frzmlt |
137 |
|
|
_RL Tf |
138 |
|
|
_RL oceTs, oceV2s, snowPr |
139 |
|
|
_RL sHeating |
140 |
jmc |
1.6 |
c _RL flxCnB |
141 |
|
|
c _RL evpAtm |
142 |
|
|
_RL iceFrac |
143 |
jmc |
1.1 |
_RL hi |
144 |
|
|
_RL hs |
145 |
|
|
_RL Tsf |
146 |
|
|
_RL qicen(nlyr) |
147 |
|
|
_RL qleft |
148 |
|
|
_RL fresh |
149 |
jmc |
1.6 |
c _RL fsalt |
150 |
jmc |
1.1 |
C == Local Variables == |
151 |
jmc |
1.6 |
INTEGER i,j,k ! loop indices |
152 |
|
|
_RL rec_nlyr ! reciprocal of number of ice layers (real value) |
153 |
|
|
C evap :: evaporation over snow/ice [kg/m2/s] (>0 if evaporate) |
154 |
|
|
C Fbot :: oceanic heat flux used to melt/form ice [W/m2] |
155 |
jmc |
1.1 |
_RL evap |
156 |
jmc |
1.6 |
_RL Fbot |
157 |
jmc |
1.1 |
_RL etop ! energy for top melting (J m-2) |
158 |
|
|
_RL ebot ! energy for bottom melting (J m-2) |
159 |
|
|
_RL etope ! energy (from top) for lateral melting (J m-2) |
160 |
|
|
_RL ebote ! energy (from bottom) for lateral melting (J m-2) |
161 |
|
|
_RL extend ! total energy for lateral melting (J m-2) |
162 |
|
|
_RL hnew(nlyr) ! new ice layer thickness (m) |
163 |
|
|
_RL hlyr ! individual ice layer thickness (m) |
164 |
|
|
_RL dhi ! change in ice thickness |
165 |
|
|
_RL dhs ! change in snow thickness |
166 |
|
|
_RL rq ! rho * q for a layer |
167 |
|
|
_RL rqh ! rho * q * h for a layer |
168 |
jmc |
1.5 |
_RL qbot ! enthalpy for new ice at bottom surf (J/kg) |
169 |
jmc |
1.1 |
_RL dt ! timestep |
170 |
|
|
_RL esurp ! surplus energy from melting (J m-2) |
171 |
|
|
_RL mwater0 ! fresh water mass gained/lost (kg/m^2) |
172 |
|
|
_RL msalt0 ! salt gained/lost (kg/m^2) |
173 |
|
|
_RL freshe ! fresh water gain from extension melting |
174 |
|
|
_RL salte ! salt gained from extension melting |
175 |
|
|
|
176 |
|
|
_RL ustar, cpchr |
177 |
|
|
_RL chi, chs |
178 |
|
|
_RL frace, rs, hq |
179 |
jmc |
1.6 |
|
180 |
|
|
C- define grid-point location where to print debugging values |
181 |
|
|
#include "THSICE_DEBUG.h" |
182 |
jmc |
1.1 |
|
183 |
|
|
1010 FORMAT(A,I3,3F8.3) |
184 |
|
|
1020 FORMAT(A,1P4E11.3) |
185 |
|
|
|
186 |
jmc |
1.6 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
187 |
|
|
|
188 |
heimbach |
1.7 |
#ifdef ALLOW_AUTODIFF_TAMC |
189 |
|
|
act1 = bi - myBxLo(myThid) |
190 |
|
|
max1 = myBxHi(myThid) - myBxLo(myThid) + 1 |
191 |
|
|
act2 = bj - myByLo(myThid) |
192 |
|
|
max2 = myByHi(myThid) - myByLo(myThid) + 1 |
193 |
|
|
act3 = myThid - 1 |
194 |
|
|
max3 = nTx*nTy |
195 |
|
|
act4 = ikey_dynamics - 1 |
196 |
|
|
#endif /* ALLOW_AUTODIFF_TAMC */ |
197 |
|
|
|
198 |
jmc |
1.6 |
rec_nlyr = nlyr |
199 |
|
|
rec_nlyr = 1. _d 0 / rec_nlyr |
200 |
jmc |
1.1 |
dt = thSIce_deltaT |
201 |
|
|
|
202 |
jmc |
1.6 |
DO j = jMin, jMax |
203 |
|
|
DO i = iMin, iMax |
204 |
heimbach |
1.7 |
#ifdef ALLOW_AUTODIFF_TAMC |
205 |
|
|
ikey_1 = i |
206 |
|
|
& + sNx*(j-1) |
207 |
|
|
& + sNx*sNy*act1 |
208 |
|
|
& + sNx*sNy*max1*act2 |
209 |
|
|
& + sNx*sNy*max1*max2*act3 |
210 |
|
|
& + sNx*sNy*max1*max2*max3*act4 |
211 |
|
|
#endif /* ALLOW_AUTODIFF_TAMC */ |
212 |
|
|
C-- |
213 |
|
|
#ifdef ALLOW_AUTODIFF_TAMC |
214 |
|
|
CADJ STORE frwatm(i,j) = comlev1_thsice_1, key=ikey_1 |
215 |
|
|
CADJ STORE fzmloc(i,j) = comlev1_thsice_1, key=ikey_1 |
216 |
|
|
CADJ STORE hice(i,j) = comlev1_thsice_1, key=ikey_1 |
217 |
|
|
CADJ STORE hsnow(i,j) = comlev1_thsice_1, key=ikey_1 |
218 |
|
|
CADJ STORE icfrac(i,j) = comlev1_thsice_1, key=ikey_1 |
219 |
|
|
CADJ STORE qic1(i,j) = comlev1_thsice_1, key=ikey_1 |
220 |
|
|
CADJ STORE qic2(i,j) = comlev1_thsice_1, key=ikey_1 |
221 |
|
|
#endif |
222 |
|
|
|
223 |
jmc |
1.6 |
IF (iceMask(i,j).GT.0. _d 0) THEN |
224 |
|
|
Tf = tFrz(i,j) |
225 |
|
|
oceTs = tOce(i,j) |
226 |
|
|
oceV2s = v2oc(i,j) |
227 |
|
|
snowPr = snowP(i,j) |
228 |
|
|
c prcAtm = prcAtm(i,j) |
229 |
|
|
sHeating= sHeat(i,j) |
230 |
|
|
c flxCnB = flxCnB(i,j) |
231 |
|
|
iceFrac = icFrac(i,j) |
232 |
|
|
hi = hIce(i,j) |
233 |
|
|
hs = hSnow(i,j) |
234 |
|
|
Tsf = tSrf(i,j) |
235 |
|
|
qicen(1)= qIc1(i,j) |
236 |
|
|
qicen(2)= qIc2(i,j) |
237 |
|
|
c evpAtm = frwAtm(i,j) |
238 |
|
|
frzmlt = fzMlOc(i,j) |
239 |
|
|
qleft = flx2oc(i,j) |
240 |
|
|
c fresh = frw2oc(i,j) |
241 |
|
|
c fsalt = fsalt(i,j) |
242 |
|
|
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
243 |
jmc |
1.1 |
C initialize energies |
244 |
|
|
esurp = 0. _d 0 |
245 |
|
|
|
246 |
jmc |
1.6 |
evap = frwAtm(i,j) |
247 |
jmc |
1.1 |
|
248 |
|
|
C...................................................................... |
249 |
|
|
C.. Compute growth and/or melting at the top and bottom surfaces....... |
250 |
|
|
C...................................................................... |
251 |
|
|
|
252 |
jmc |
1.5 |
IF (frzmlt.GE. 0. _d 0) THEN |
253 |
jmc |
1.1 |
C !----------------------------------------------------------------- |
254 |
|
|
C ! freezing conditions |
255 |
|
|
C !----------------------------------------------------------------- |
256 |
jmc |
1.10 |
Fbot = frzmlt |
257 |
|
|
C- jmc: would be logical to test for iceFrac: |
258 |
jmc |
1.11 |
c-new_v: |
259 |
|
|
IF ( iceFrac.LT.iceMaskMax ) THEN |
260 |
|
|
c-old_v IF ( iceFrac.LE.iceMaskMax ) THEN |
261 |
jmc |
1.10 |
IF (hi.GT.hThickIce) THEN |
262 |
jmc |
1.8 |
C if higher than hThickIce, use all frzmlt energy to grow extra ice |
263 |
jmc |
1.10 |
Fbot = 0. _d 0 |
264 |
|
|
ELSEIF (hi.GE.hThinIce) THEN |
265 |
|
|
C between hThinIce & hThickIce, use partition factor fracEnFreez |
266 |
|
|
Fbot = (1. _d 0 - fracEnFreez)*frzmlt |
267 |
|
|
ENDIF |
268 |
jmc |
1.5 |
ENDIF |
269 |
|
|
ELSE |
270 |
jmc |
1.1 |
C !----------------------------------------------------------------- |
271 |
|
|
C ! melting conditions |
272 |
|
|
C !----------------------------------------------------------------- |
273 |
|
|
ustar = 5. _d -2 !for no currents |
274 |
|
|
C frictional velocity between ice and water |
275 |
jmc |
1.5 |
ustar = SQRT(0.00536 _d 0*oceV2s) |
276 |
jmc |
1.1 |
ustar=max(5. _d -3,ustar) |
277 |
jmc |
1.8 |
cpchr =cpWater*rhosw*bMeltCoef |
278 |
jmc |
1.1 |
Fbot = cpchr*(Tf-oceTs)*ustar ! < 0 |
279 |
|
|
Fbot = max(Fbot,frzmlt) ! frzmlt < Fbot < 0 |
280 |
|
|
Fbot = min(Fbot,0. _d 0) |
281 |
jmc |
1.5 |
ENDIF |
282 |
jmc |
1.1 |
|
283 |
|
|
C mass of fresh water and salt initially present in ice |
284 |
|
|
mwater0 = rhos*hs + rhoi*hi |
285 |
jmc |
1.8 |
msalt0 = rhoi*hi*saltIce |
286 |
jmc |
1.1 |
|
287 |
jmc |
1.6 |
#ifdef ALLOW_DBUG_THSICE |
288 |
jmc |
1.9 |
IF (dBug(i,j,bi,bj) ) WRITE(6,1020) |
289 |
jmc |
1.6 |
& 'ThSI_CALC_TH: evpAtm, frzmlt, Fbot =', frwAtm(i,j),frzmlt,Fbot |
290 |
|
|
#endif |
291 |
jmc |
1.1 |
|
292 |
|
|
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
293 |
|
|
|
294 |
|
|
C Compute energy available for melting/growth. |
295 |
|
|
|
296 |
jmc |
1.10 |
IF ( hi.GT.hThickIce .OR. fracEnMelt.EQ.0. _d 0 ) THEN |
297 |
|
|
C above certain height (or when no ice fractionation), only melt from top |
298 |
|
|
frace = 0. _d 0 |
299 |
jmc |
1.11 |
c-new_v: |
300 |
|
|
ELSEIF (hi.LT.hThinIce) THEN |
301 |
jmc |
1.1 |
C below a certain height, all energy goes to changing ice extent |
302 |
jmc |
1.11 |
frace = 1. _d 0 |
303 |
|
|
c-new_v: end |
304 |
jmc |
1.5 |
ELSE |
305 |
jmc |
1.10 |
frace = fracEnMelt |
306 |
jmc |
1.5 |
ENDIF |
307 |
jmc |
1.1 |
|
308 |
jmc |
1.5 |
c IF (Tsf .EQ. 0. _d 0 .AND. sHeating.GT.0. _d 0) THEN |
309 |
|
|
IF ( sHeating.GT.0. _d 0 ) THEN |
310 |
jmc |
1.1 |
etop = (1. _d 0-frace)*sHeating * dt |
311 |
|
|
etope = frace*sHeating * dt |
312 |
jmc |
1.5 |
ELSE |
313 |
jmc |
1.1 |
etop = 0. _d 0 |
314 |
|
|
etope = 0. _d 0 |
315 |
|
|
C jmc: found few cases where Tsf=0 & sHeating < 0 : add this line to conserv energy: |
316 |
|
|
esurp = sHeating * dt |
317 |
jmc |
1.5 |
ENDIF |
318 |
jmc |
1.6 |
C-- flux at the base of sea-ice: |
319 |
jmc |
1.1 |
C conduction H.flx= flxCnB (+ =down); oceanic turbulent H.flx= Fbot (+ =down). |
320 |
|
|
C- ==> energy available(+ => melt)= (flxCnB-Fbot)*dt |
321 |
jmc |
1.5 |
c IF (frzmlt.LT.0. _d 0) THEN |
322 |
jmc |
1.1 |
c ebot = (1. _d 0-frace)*(flxCnB-Fbot) * dt |
323 |
|
|
c ebote = frace*(flxCnB-Fbot) * dt |
324 |
jmc |
1.5 |
c ELSE |
325 |
jmc |
1.1 |
c ebot = (flxCnB-Fbot) * dt |
326 |
|
|
c ebote = 0. _d 0 |
327 |
jmc |
1.5 |
c ENDIF |
328 |
jmc |
1.1 |
C- original formulation(above): Loose energy when flxCnB < Fbot < 0 |
329 |
jmc |
1.6 |
ebot = (flxCnB(i,j)-Fbot) * dt |
330 |
jmc |
1.5 |
IF (ebot.GT.0. _d 0) THEN |
331 |
jmc |
1.1 |
ebote = frace*ebot |
332 |
|
|
ebot = ebot-ebote |
333 |
jmc |
1.5 |
ELSE |
334 |
jmc |
1.1 |
ebote = 0. _d 0 |
335 |
jmc |
1.5 |
ENDIF |
336 |
jmc |
1.6 |
#ifdef ALLOW_DBUG_THSICE |
337 |
jmc |
1.9 |
IF (dBug(i,j,bi,bj) ) WRITE(6,1020) |
338 |
jmc |
1.6 |
& 'ThSI_CALC_TH: etop,etope,ebot,ebote=', etop,etope,ebot,ebote |
339 |
|
|
#endif |
340 |
jmc |
1.1 |
|
341 |
|
|
C Initialize layer thicknesses. |
342 |
|
|
C Make sure internal ice temperatures do not exceed Tmlt. |
343 |
|
|
C If they do, then eliminate the layer. (Dont think this will happen |
344 |
|
|
C for reasonable values of i0.) |
345 |
|
|
|
346 |
jmc |
1.6 |
hlyr = hi * rec_nlyr |
347 |
jmc |
1.5 |
DO k = 1, nlyr |
348 |
jmc |
1.1 |
hnew(k) = hlyr |
349 |
jmc |
1.5 |
ENDDO |
350 |
jmc |
1.1 |
|
351 |
|
|
C Top melt: snow, then ice. |
352 |
|
|
|
353 |
jmc |
1.5 |
IF (etop .GT. 0. _d 0) THEN |
354 |
heimbach |
1.7 |
#ifdef ALLOW_AUTODIFF_TAMC |
355 |
|
|
CADJ STORE etop = comlev1_thsice_1, key=ikey_1 |
356 |
|
|
#endif |
357 |
jmc |
1.5 |
IF (hs. gt. 0. _d 0) THEN |
358 |
jmc |
1.1 |
rq = rhos * qsnow |
359 |
|
|
rqh = rq * hs |
360 |
jmc |
1.5 |
IF (etop .LT. rqh) THEN |
361 |
jmc |
1.1 |
hs = hs - etop/rq |
362 |
|
|
etop = 0. _d 0 |
363 |
jmc |
1.5 |
ELSE |
364 |
jmc |
1.6 |
etop = etop - rqh |
365 |
jmc |
1.1 |
hs = 0. _d 0 |
366 |
jmc |
1.5 |
ENDIF |
367 |
|
|
ENDIF |
368 |
jmc |
1.6 |
|
369 |
jmc |
1.5 |
DO k = 1, nlyr |
370 |
heimbach |
1.7 |
#ifdef ALLOW_AUTODIFF_TAMC |
371 |
|
|
ikey_2 = k |
372 |
|
|
& + nlyr*(i-1) |
373 |
|
|
& + nlyr*sNx*(j-1) |
374 |
|
|
& + nlyr*sNx*sNy*act1 |
375 |
|
|
& + nlyr*sNx*sNy*max1*act2 |
376 |
|
|
& + nlyr*sNx*sNy*max1*max2*act3 |
377 |
|
|
& + nlyr*sNx*sNy*max1*max2*max3*act4 |
378 |
|
|
#endif |
379 |
|
|
C-- |
380 |
|
|
#ifdef ALLOW_AUTODIFF_TAMC |
381 |
|
|
CADJ STORE etop = comlev1_thsice_2, key=ikey_2 |
382 |
|
|
CADJ STORE hnew(k) = comlev1_thsice_2, key=ikey_2 |
383 |
|
|
#endif |
384 |
jmc |
1.5 |
IF (etop .GT. 0. _d 0) THEN |
385 |
jmc |
1.1 |
rq = rhoi * qicen(k) |
386 |
|
|
rqh = rq * hnew(k) |
387 |
jmc |
1.5 |
IF (etop .LT. rqh) THEN |
388 |
jmc |
1.1 |
hnew(k) = hnew(k) - etop / rq |
389 |
|
|
etop = 0. _d 0 |
390 |
jmc |
1.5 |
ELSE |
391 |
jmc |
1.1 |
etop = etop - rqh |
392 |
|
|
hnew(k) = 0. _d 0 |
393 |
jmc |
1.5 |
ENDIF |
394 |
|
|
ENDIF |
395 |
|
|
ENDDO |
396 |
|
|
ELSE |
397 |
jmc |
1.1 |
etop=0. _d 0 |
398 |
jmc |
1.5 |
ENDIF |
399 |
jmc |
1.1 |
C If ice is gone and melting energy remains |
400 |
jmc |
1.5 |
c IF (etop .GT. 0. _d 0) THEN |
401 |
|
|
c WRITE (6,*) 'QQ All ice melts from top ', i,j |
402 |
jmc |
1.1 |
c hi=0. _d 0 |
403 |
|
|
c go to 200 |
404 |
jmc |
1.5 |
c ENDIF |
405 |
jmc |
1.1 |
|
406 |
|
|
|
407 |
jmc |
1.6 |
C Bottom melt/growth. |
408 |
jmc |
1.1 |
|
409 |
jmc |
1.5 |
IF (ebot .LT. 0. _d 0) THEN |
410 |
jmc |
1.1 |
C Compute enthalpy of new ice growing at bottom surface. |
411 |
jmc |
1.8 |
qbot = -cpIce *Tf + Lfresh |
412 |
jmc |
1.1 |
dhi = -ebot / (qbot * rhoi) |
413 |
|
|
ebot = 0. _d 0 |
414 |
heimbach |
1.7 |
cph k = nlyr |
415 |
|
|
#ifdef ALLOW_AUTODIFF_TAMC |
416 |
|
|
CADJ STORE hnew(:) = comlev1_thsice_1, key=ikey_1 |
417 |
|
|
CADJ STORE qicen(:) = comlev1_thsice_1, key=ikey_1 |
418 |
|
|
#endif |
419 |
jmc |
1.9 |
qicen(nlyr) = (hnew(nlyr)*qicen(nlyr)+dhi*qbot) / |
420 |
heimbach |
1.7 |
& (hnew(nlyr)+dhi) |
421 |
|
|
hnew(nlyr) = hnew(nlyr) + dhi |
422 |
jmc |
1.6 |
ELSE |
423 |
jmc |
1.5 |
DO k = nlyr, 1, -1 |
424 |
heimbach |
1.7 |
#ifdef ALLOW_AUTODIFF_TAMC |
425 |
|
|
ikey_2 = (nlyr-k+1) |
426 |
|
|
& + nlyr*(i-1) |
427 |
|
|
& + nlyr*sNx*(j-1) |
428 |
|
|
& + nlyr*sNx*sNy*act1 |
429 |
|
|
& + nlyr*sNx*sNy*max1*act2 |
430 |
|
|
& + nlyr*sNx*sNy*max1*max2*act3 |
431 |
|
|
& + nlyr*sNx*sNy*max1*max2*max3*act4 |
432 |
|
|
#endif |
433 |
|
|
C-- |
434 |
|
|
#ifdef ALLOW_AUTODIFF_TAMC |
435 |
|
|
CADJ STORE ebot = comlev1_thsice_2, key=ikey_2 |
436 |
|
|
CADJ STORE hnew(k) = comlev1_thsice_2, key=ikey_2 |
437 |
|
|
CADJ STORE qicen(k) = comlev1_thsice_2, key=ikey_2 |
438 |
|
|
#endif |
439 |
jmc |
1.5 |
IF (ebot.GT.0. _d 0 .AND. hnew(k).GT.0. _d 0) THEN |
440 |
jmc |
1.1 |
rq = rhoi * qicen(k) |
441 |
|
|
rqh = rq * hnew(k) |
442 |
jmc |
1.5 |
IF (ebot .LT. rqh) THEN |
443 |
jmc |
1.1 |
hnew(k) = hnew(k) - ebot / rq |
444 |
|
|
ebot = 0. _d 0 |
445 |
jmc |
1.5 |
ELSE |
446 |
jmc |
1.1 |
ebot = ebot - rqh |
447 |
|
|
hnew(k) = 0. _d 0 |
448 |
jmc |
1.5 |
ENDIF |
449 |
|
|
ENDIF |
450 |
|
|
ENDDO |
451 |
jmc |
1.1 |
|
452 |
jmc |
1.6 |
C If ice melts completely and snow is left, remove the snow with |
453 |
jmc |
1.1 |
C energy from the mixed layer |
454 |
|
|
|
455 |
jmc |
1.5 |
IF (ebot.GT.0. _d 0 .AND. hs.GT.0. _d 0) THEN |
456 |
jmc |
1.1 |
rq = rhos * qsnow |
457 |
|
|
rqh = rq * hs |
458 |
jmc |
1.5 |
IF (ebot .LT. rqh) THEN |
459 |
jmc |
1.1 |
hs = hs - ebot / rq |
460 |
|
|
ebot = 0. _d 0 |
461 |
jmc |
1.5 |
ELSE |
462 |
jmc |
1.1 |
ebot = ebot - rqh |
463 |
|
|
hs = 0. _d 0 |
464 |
jmc |
1.5 |
ENDIF |
465 |
|
|
ENDIF |
466 |
|
|
c IF (ebot .GT. 0. _d 0) THEN |
467 |
jmc |
1.1 |
c IF (dBug) WRITE(6,*) 'All ice (& snow) melts from bottom' |
468 |
|
|
c hi=0. _d 0 |
469 |
|
|
c go to 200 |
470 |
jmc |
1.5 |
c ENDIF |
471 |
|
|
ENDIF |
472 |
jmc |
1.1 |
|
473 |
|
|
C Compute new total ice thickness. |
474 |
|
|
hi = 0. _d 0 |
475 |
jmc |
1.5 |
DO k = 1, nlyr |
476 |
jmc |
1.1 |
hi = hi + hnew(k) |
477 |
jmc |
1.5 |
ENDDO |
478 |
jmc |
1.6 |
#ifdef ALLOW_DBUG_THSICE |
479 |
jmc |
1.9 |
IF (dBug(i,j,bi,bj) ) WRITE(6,1020) |
480 |
jmc |
1.6 |
& 'ThSI_CALC_TH: etop, ebot, hi, hs =', etop, ebot, hi, hs |
481 |
|
|
#endif |
482 |
jmc |
1.1 |
|
483 |
jmc |
1.8 |
C If hi < hIceMin, melt the ice. |
484 |
|
|
IF ( hi.LT.hIceMin .AND. (hi+hs).GT.0. _d 0 ) THEN |
485 |
jmc |
1.1 |
esurp = esurp - rhos*qsnow*hs |
486 |
jmc |
1.5 |
DO k = 1, nlyr |
487 |
jmc |
1.1 |
esurp = esurp - rhoi*qicen(k)*hnew(k) |
488 |
jmc |
1.5 |
ENDDO |
489 |
jmc |
1.1 |
hi = 0. _d 0 |
490 |
|
|
hs = 0. _d 0 |
491 |
|
|
Tsf=0. _d 0 |
492 |
jmc |
1.6 |
iceFrac = 0. _d 0 |
493 |
jmc |
1.5 |
DO k = 1, nlyr |
494 |
jmc |
1.1 |
qicen(k) = 0. _d 0 |
495 |
jmc |
1.5 |
ENDDO |
496 |
jmc |
1.6 |
#ifdef ALLOW_DBUG_THSICE |
497 |
jmc |
1.9 |
IF (dBug(i,j,bi,bj) ) WRITE(6,1020) |
498 |
jmc |
1.6 |
& 'ThSI_CALC_TH: -1 : esurp=',esurp |
499 |
|
|
#endif |
500 |
jmc |
1.5 |
ENDIF |
501 |
jmc |
1.1 |
|
502 |
|
|
C-- do a mass-budget of sea-ice to compute "fresh" = the fresh-water flux |
503 |
|
|
C that is returned to the ocean ; needs to be done before snow/evap |
504 |
|
|
fresh = (mwater0 - (rhos*hs + rhoi*hi))/dt |
505 |
|
|
|
506 |
jmc |
1.6 |
IF ( hi .LE. 0. _d 0 ) THEN |
507 |
jmc |
1.5 |
C- return snow to the ocean (account for Latent heat of freezing) |
508 |
jmc |
1.1 |
fresh = fresh + snowPr |
509 |
|
|
qleft = qleft - snowPr*Lfresh |
510 |
jmc |
1.5 |
|
511 |
|
|
ELSE |
512 |
|
|
C- else: hi > 0 |
513 |
jmc |
1.1 |
|
514 |
|
|
C Let it snow |
515 |
|
|
|
516 |
|
|
hs = hs + dt*snowPr/rhos |
517 |
|
|
|
518 |
|
|
C If ice evap is used to sublimate surface snow/ice or |
519 |
|
|
C if no ice pass on to ocean |
520 |
heimbach |
1.7 |
#ifdef ALLOW_AUTODIFF_TAMC |
521 |
|
|
CADJ STORE evap = comlev1_thsice_1, key=ikey_1 |
522 |
|
|
CADJ STORE hs = comlev1_thsice_1, key=ikey_1 |
523 |
|
|
#endif |
524 |
jmc |
1.5 |
IF (hs.GT.0. _d 0) THEN |
525 |
|
|
IF (evap/rhos *dt.GT.hs) THEN |
526 |
jmc |
1.1 |
evap=evap-hs*rhos/dt |
527 |
|
|
hs=0. _d 0 |
528 |
jmc |
1.5 |
ELSE |
529 |
jmc |
1.1 |
hs = hs - evap/rhos *dt |
530 |
|
|
evap=0. _d 0 |
531 |
jmc |
1.5 |
ENDIF |
532 |
|
|
ENDIF |
533 |
heimbach |
1.7 |
#ifdef ALLOW_AUTODIFF_TAMC |
534 |
|
|
CADJ STORE evap = comlev1_thsice_1, key=ikey_1 |
535 |
|
|
CADJ STORE hi = comlev1_thsice_1, key=ikey_1 |
536 |
|
|
CADJ STORE hnew(:) = comlev1_thsice_1, key=ikey_1 |
537 |
|
|
CADJ STORE qicen(:) = comlev1_thsice_1, key=ikey_1 |
538 |
|
|
#endif |
539 |
jmc |
1.5 |
IF (hi.GT.0. _d 0.AND.evap.GT.0. _d 0) THEN |
540 |
|
|
DO k = 1, nlyr |
541 |
heimbach |
1.7 |
#ifdef ALLOW_AUTODIFF_TAMC |
542 |
|
|
ikey_2 = k |
543 |
|
|
& + nlyr*(i-1) |
544 |
|
|
& + nlyr*sNx*(j-1) |
545 |
|
|
& + nlyr*sNx*sNy*act1 |
546 |
|
|
& + nlyr*sNx*sNy*max1*act2 |
547 |
|
|
& + nlyr*sNx*sNy*max1*max2*act3 |
548 |
|
|
& + nlyr*sNx*sNy*max1*max2*max3*act4 |
549 |
|
|
#endif |
550 |
|
|
C-- |
551 |
|
|
#ifdef ALLOW_AUTODIFF_TAMC |
552 |
|
|
CADJ STORE evap = comlev1_thsice_2, key=ikey_2 |
553 |
|
|
CADJ STORE hnew(k) = comlev1_thsice_2, key=ikey_2 |
554 |
|
|
CADJ STORE qicen(k) = comlev1_thsice_2, key=ikey_2 |
555 |
|
|
#endif |
556 |
jmc |
1.5 |
IF (evap .GT. 0. _d 0) THEN |
557 |
jmc |
1.1 |
C-- original scheme, does not care about ice temp. |
558 |
|
|
C- this can produce small error (< 1.W/m2) in the Energy budget |
559 |
jmc |
1.5 |
c IF (evap/rhoi *dt.GT.hnew(k)) THEN |
560 |
jmc |
1.1 |
c evap=evap-hnew(k)*rhoi/dt |
561 |
|
|
c hnew(k)=0. _d 0 |
562 |
jmc |
1.5 |
c ELSE |
563 |
jmc |
1.1 |
c hnew(k) = hnew(k) - evap/rhoi *dt |
564 |
|
|
c evap=0. _d 0 |
565 |
jmc |
1.5 |
c ENDIF |
566 |
jmc |
1.1 |
C-- modified scheme. taking into account Ice enthalpy |
567 |
jmc |
1.6 |
dhi = evap/rhoi*dt |
568 |
jmc |
1.5 |
IF (dhi.GE.hnew(k)) THEN |
569 |
jmc |
1.1 |
evap=evap-hnew(k)*rhoi/dt |
570 |
|
|
esurp = esurp - hnew(k)*rhoi*(qicen(k)-Lfresh) |
571 |
|
|
hnew(k)=0. _d 0 |
572 |
jmc |
1.5 |
ELSE |
573 |
heimbach |
1.7 |
#ifdef ALLOW_AUTODIFF_TAMC |
574 |
|
|
CADJ STORE hnew(k) = comlev1_thsice_2, key=ikey_2 |
575 |
|
|
#endif |
576 |
jmc |
1.1 |
hq = hnew(k)*qicen(k)-dhi*Lfresh |
577 |
|
|
hnew(k) = hnew(k) - dhi |
578 |
|
|
qicen(k)=hq/hnew(k) |
579 |
|
|
evap=0. _d 0 |
580 |
jmc |
1.5 |
ENDIF |
581 |
jmc |
1.1 |
C------- |
582 |
jmc |
1.5 |
ENDIF |
583 |
|
|
ENDDO |
584 |
|
|
ENDIF |
585 |
|
|
c IF (evap .GT. 0. _d 0) THEN |
586 |
|
|
c WRITE (6,*) 'BB All ice sublimates', i,j |
587 |
jmc |
1.1 |
c hi=0. _d 0 |
588 |
|
|
c go to 200 |
589 |
jmc |
1.5 |
c ENDIF |
590 |
jmc |
1.1 |
|
591 |
|
|
C Compute new total ice thickness. |
592 |
|
|
|
593 |
jmc |
1.5 |
hi = 0. _d 0 |
594 |
|
|
DO k = 1, nlyr |
595 |
jmc |
1.1 |
hi = hi + hnew(k) |
596 |
jmc |
1.5 |
ENDDO |
597 |
jmc |
1.1 |
|
598 |
jmc |
1.8 |
C If hi < hIceMin, melt the ice. |
599 |
|
|
IF ( hi.GT.0. _d 0 .AND. hi.LT.hIceMin ) THEN |
600 |
jmc |
1.1 |
fresh = fresh + (rhos*hs + rhoi*hi)/dt |
601 |
|
|
esurp = esurp - rhos*qsnow*hs |
602 |
jmc |
1.5 |
DO k = 1, nlyr |
603 |
jmc |
1.1 |
esurp = esurp - rhoi*qicen(k)*hnew(k) |
604 |
jmc |
1.5 |
ENDDO |
605 |
jmc |
1.1 |
hi = 0. _d 0 |
606 |
|
|
hs = 0. _d 0 |
607 |
|
|
Tsf=0. _d 0 |
608 |
jmc |
1.6 |
iceFrac = 0. _d 0 |
609 |
jmc |
1.5 |
DO k = 1, nlyr |
610 |
jmc |
1.1 |
qicen(k) = 0. _d 0 |
611 |
jmc |
1.5 |
ENDDO |
612 |
jmc |
1.6 |
#ifdef ALLOW_DBUG_THSICE |
613 |
jmc |
1.9 |
IF (dBug(i,j,bi,bj) ) WRITE(6,1020) |
614 |
jmc |
1.6 |
& 'ThSI_CALC_TH: -2 : esurp,fresh=', esurp, fresh |
615 |
|
|
#endif |
616 |
jmc |
1.5 |
ENDIF |
617 |
|
|
|
618 |
|
|
C- else hi > 0: end |
619 |
|
|
ENDIF |
620 |
|
|
|
621 |
|
|
IF ( hi .GT. 0. _d 0 ) THEN |
622 |
jmc |
1.1 |
|
623 |
jmc |
1.6 |
C If there is enough snow to lower the ice/snow interface below |
624 |
|
|
C freeboard, convert enough snow to ice to bring the interface back |
625 |
jmc |
1.1 |
C to sea-level. Adjust enthalpy of top ice layer accordingly. |
626 |
|
|
|
627 |
heimbach |
1.7 |
#ifdef ALLOW_AUTODIFF_TAMC |
628 |
|
|
CADJ STORE hi = comlev1_thsice_1, key=ikey_1 |
629 |
|
|
CADJ STORE hs = comlev1_thsice_1, key=ikey_1 |
630 |
|
|
CADJ STORE hnew(:) = comlev1_thsice_1, key=ikey_1 |
631 |
|
|
CADJ STORE qicen(:) = comlev1_thsice_1, key=ikey_1 |
632 |
|
|
#endif |
633 |
jmc |
1.5 |
IF ( hs .GT. hi*rhoiw/rhos ) THEN |
634 |
|
|
cBB WRITE (6,*) 'Freeboard adjusts' |
635 |
jmc |
1.1 |
dhi = (hs * rhos - hi * rhoiw) / rhosw |
636 |
|
|
dhs = dhi * rhoi / rhos |
637 |
heimbach |
1.7 |
#ifdef ALLOW_AUTODIFF_TAMC |
638 |
|
|
CADJ STORE hnew(:) = comlev1_thsice_1, key=ikey_1 |
639 |
|
|
#endif |
640 |
jmc |
1.1 |
rqh = rhoi*qicen(1)*hnew(1) + rhos*qsnow*dhs |
641 |
|
|
hnew(1) = hnew(1) + dhi |
642 |
|
|
qicen(1) = rqh / (rhoi*hnew(1)) |
643 |
|
|
hi = hi + dhi |
644 |
|
|
hs = hs - dhs |
645 |
jmc |
1.5 |
ENDIF |
646 |
jmc |
1.1 |
|
647 |
|
|
|
648 |
|
|
C limit ice height |
649 |
|
|
C- NOTE: this part does not conserve Energy ; |
650 |
|
|
C but surplus of fresh water and salt are taken into account. |
651 |
jmc |
1.5 |
IF (hi.GT.hiMax) THEN |
652 |
jmc |
1.1 |
cBB print*,'BBerr, hi>hiMax',i,j,hi |
653 |
|
|
chi=hi-hiMax |
654 |
jmc |
1.5 |
DO k=1,nlyr |
655 |
jmc |
1.1 |
hnew(k)=hnew(k)-chi/2. _d 0 |
656 |
jmc |
1.5 |
ENDDO |
657 |
jmc |
1.1 |
fresh = fresh + chi*rhoi/dt |
658 |
jmc |
1.5 |
ENDIF |
659 |
|
|
IF (hs.GT.hsMax) THEN |
660 |
jmc |
1.1 |
c print*,'BBerr, hs>hsMax',i,j,hs |
661 |
|
|
chs=hs-hsMax |
662 |
|
|
hs=hsMax |
663 |
|
|
fresh = fresh + chs*rhos/dt |
664 |
jmc |
1.5 |
ENDIF |
665 |
jmc |
1.1 |
|
666 |
|
|
C Compute new total ice thickness. |
667 |
|
|
|
668 |
jmc |
1.5 |
hi = 0. _d 0 |
669 |
|
|
DO k = 1, nlyr |
670 |
jmc |
1.1 |
hi = hi + hnew(k) |
671 |
jmc |
1.5 |
ENDDO |
672 |
jmc |
1.1 |
|
673 |
jmc |
1.6 |
#ifdef ALLOW_DBUG_THSICE |
674 |
jmc |
1.9 |
IF (dBug(i,j,bi,bj) ) WRITE(6,1020) |
675 |
jmc |
1.6 |
& 'ThSI_CALC_TH: b-Winton: hnew, qice =', hnew, qicen |
676 |
|
|
#endif |
677 |
|
|
|
678 |
|
|
hlyr = hi * rec_nlyr |
679 |
jmc |
1.1 |
CALL THSICE_RESHAPE_LAYERS( |
680 |
|
|
U qicen, |
681 |
|
|
I hlyr, hnew, myThid ) |
682 |
|
|
|
683 |
jmc |
1.6 |
#ifdef ALLOW_DBUG_THSICE |
684 |
|
|
IF (dBug(i,j,bi,bj) ) WRITE(6,1020) |
685 |
|
|
& 'ThSI_CALC_TH: iceFrac,hi, qtot, hs =', iceFrac,hi, |
686 |
|
|
& (qicen(1)+qicen(2))*0.5, hs |
687 |
|
|
#endif |
688 |
jmc |
1.1 |
|
689 |
jmc |
1.5 |
C- if hi > 0 : end |
690 |
|
|
ENDIF |
691 |
|
|
200 CONTINUE |
692 |
jmc |
1.1 |
|
693 |
|
|
C- Compute surplus energy left over from melting. |
694 |
|
|
|
695 |
jmc |
1.6 |
IF (hi.LE.0. _d 0) iceFrac=0. _d 0 |
696 |
jmc |
1.1 |
|
697 |
|
|
C.. heat fluxes left over for ocean |
698 |
|
|
qleft = qleft + (Fbot+(esurp+etop+ebot)/dt) |
699 |
jmc |
1.6 |
#ifdef ALLOW_DBUG_THSICE |
700 |
jmc |
1.9 |
IF (dBug(i,j,bi,bj) ) WRITE(6,1020) |
701 |
jmc |
1.6 |
& 'ThSI_CALC_TH: [esurp,etop+ebot]/dt =',esurp/dt,etop/dt,ebot/dt |
702 |
|
|
#endif |
703 |
jmc |
1.1 |
|
704 |
|
|
C-- Evaporation left to the ocean : |
705 |
|
|
fresh = fresh - evap |
706 |
|
|
C- Correct Atmos. fluxes for this different latent heat: |
707 |
|
|
C evap was computed over freezing surf.(Tsf<0), latent heat = Lvap+Lfresh |
708 |
jmc |
1.6 |
C but should be Lvap only for the fraction "evap" that is left to the ocean. |
709 |
jmc |
1.1 |
qleft = qleft + evap*Lfresh |
710 |
|
|
|
711 |
|
|
C fresh and salt fluxes |
712 |
|
|
c fresh = (mwater0 - (rhos*(hs) + rhoi*(hi)))/dt-evap |
713 |
jmc |
1.8 |
c fsalt = (msalt0 - rhoi*hi*saltIce)/35. _d 0/dt ! for same units as fresh |
714 |
jmc |
1.6 |
C note (jmc): fresh is computed from a sea-ice mass budget that already |
715 |
jmc |
1.1 |
C contains, at this point, snow & evaporation (of snow & ice) |
716 |
|
|
C but are not meant to be part of ice/ocean fresh-water flux. |
717 |
|
|
C fix: a) like below or b) by making the budget before snow/evap is added |
718 |
|
|
c fresh = (mwater0 - (rhos*(hs) + rhoi*(hi)))/dt |
719 |
jmc |
1.6 |
c & + snow(i,j,bi,bj)*rhos - frwAtm |
720 |
jmc |
1.8 |
fsalt(i,j) = (msalt0 - rhoi*hi*saltIce)/dt |
721 |
jmc |
1.1 |
|
722 |
jmc |
1.6 |
#ifdef ALLOW_DBUG_THSICE |
723 |
|
|
IF (dBug(i,j,bi,bj) ) THEN |
724 |
|
|
WRITE(6,1020)'ThSI_CALC_TH:dH2O,Ev[kg],fresh,fsalt', |
725 |
|
|
& (mwater0-(rhos*hs+rhoi*hi))/dt,evap,fresh,fsalt(i,j) |
726 |
|
|
WRITE(6,1020)'ThSI_CALC_TH: Qleft,Fbot,extend/dt =', |
727 |
jmc |
1.1 |
& Qleft,Fbot,(etope+ebote)/dt |
728 |
jmc |
1.6 |
ENDIF |
729 |
|
|
#endif |
730 |
jmc |
1.1 |
|
731 |
jmc |
1.6 |
C-- add remaining liquid Precip (rain+RunOff) directly to ocean: |
732 |
|
|
fresh = fresh + (prcAtm(i,j)-snowPr) |
733 |
|
|
|
734 |
|
|
C-- note: at this point, iceFrac has not been changed (unless reset to zero) |
735 |
jmc |
1.1 |
C and it can only be reduced by lateral melting in the following part: |
736 |
|
|
|
737 |
|
|
C calculate extent changes |
738 |
|
|
extend=etope+ebote |
739 |
jmc |
1.6 |
IF (iceFrac.GT.0. _d 0.AND.extend.GT.0. _d 0) THEN |
740 |
jmc |
1.1 |
rq = rhoi * 0.5 _d 0*(qicen(1)+qicen(2)) |
741 |
|
|
rs = rhos * qsnow |
742 |
|
|
rqh = rq * hi + rs * hs |
743 |
|
|
freshe=(rhos*hs+rhoi*hi)/dt |
744 |
jmc |
1.8 |
salte=(rhoi*hi*saltIce)/dt |
745 |
jmc |
1.12 |
IF ( extend.LT.rqh ) THEN |
746 |
jmc |
1.6 |
iceFrac=(1. _d 0-extend/rqh)*iceFrac |
747 |
jmc |
1.12 |
ENDIF |
748 |
|
|
IF ( extend.LT.rqh .AND. iceFrac.GE.iceMaskMin ) THEN |
749 |
jmc |
1.1 |
fresh=fresh+extend/rqh*freshe |
750 |
jmc |
1.6 |
fsalt(i,j)=fsalt(i,j)+extend/rqh*salte |
751 |
jmc |
1.5 |
ELSE |
752 |
jmc |
1.6 |
iceFrac=0. _d 0 |
753 |
|
|
hi=0. _d 0 |
754 |
|
|
hs=0. _d 0 |
755 |
jmc |
1.1 |
qleft=qleft+(extend-rqh)/dt |
756 |
|
|
fresh=fresh+freshe |
757 |
jmc |
1.6 |
fsalt(i,j)=fsalt(i,j)+salte |
758 |
jmc |
1.5 |
ENDIF |
759 |
|
|
ELSEIF (extend.GT.0. _d 0) THEN |
760 |
jmc |
1.1 |
qleft=qleft+extend/dt |
761 |
jmc |
1.5 |
ENDIF |
762 |
jmc |
1.6 |
|
763 |
|
|
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
764 |
|
|
C-- Update output variables : |
765 |
|
|
|
766 |
|
|
C- Diagnostic of Atmos. fresh water flux (E-P) over sea-ice : |
767 |
|
|
C substract precip from Evap (<- stored in frwAtm array) |
768 |
|
|
frwAtm(i,j) = frwAtm(i,j) - prcAtm(i,j) |
769 |
|
|
|
770 |
|
|
C- update Mixed-Layer Freezing potential heat flux by substracting the |
771 |
|
|
C part which has already been accounted for (Fbot): |
772 |
|
|
fzMlOc(i,j) = frzmlt - Fbot*iceMask(i,j) |
773 |
|
|
|
774 |
|
|
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
775 |
|
|
#ifdef ALLOW_DBUG_THSICE |
776 |
jmc |
1.9 |
IF (dBug(i,j,bi,bj) ) WRITE(6,1020) |
777 |
jmc |
1.6 |
& 'ThSI_CALC_TH: iceFrac,flx2oc,fsalt,frw2oc=', |
778 |
|
|
& iceFrac, qleft, fsalt(i,j), fresh |
779 |
|
|
#endif |
780 |
|
|
#ifdef CHECK_ENERGY_CONSERV |
781 |
|
|
CALL THSICE_CHECK_CONSERV( dBugFlag, i, j, bi, bj, 0, |
782 |
|
|
I iceMask(i,j), iceFrac, hi, hs, qicen, |
783 |
|
|
I qleft, fresh, fsalt, |
784 |
|
|
I myTime, myIter, myThid ) |
785 |
|
|
#endif /* CHECK_ENERGY_CONSERV */ |
786 |
|
|
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
787 |
|
|
C-- Update Sea-Ice state output: |
788 |
|
|
icFrac(i,j) = iceFrac |
789 |
|
|
hIce(i,j) = hi |
790 |
|
|
hSnow(i,j ) = hs |
791 |
|
|
tSrf(i,j) = Tsf |
792 |
|
|
qIc1(i,j) = qicen(1) |
793 |
|
|
qIc2(i,j) = qicen(2) |
794 |
|
|
C-- Update oceanic flux output: |
795 |
|
|
flx2oc(i,j) = qleft |
796 |
|
|
frw2oc(i,j) = fresh |
797 |
|
|
c fsalt(i,j) = fsalt |
798 |
|
|
ENDIF |
799 |
|
|
ENDDO |
800 |
|
|
ENDDO |
801 |
jmc |
1.1 |
#endif /* ALLOW_THSICE */ |
802 |
|
|
|
803 |
|
|
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
804 |
|
|
|
805 |
|
|
RETURN |
806 |
|
|
END |