/[MITgcm]/MITgcm/pkg/thsice/thsice_solve4temp.F
ViewVC logotype

Contents of /MITgcm/pkg/thsice/thsice_solve4temp.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.19 - (show annotations) (download)
Tue Mar 16 00:23:59 2010 UTC (14 years, 6 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint62g, checkpoint62f, checkpoint62e, checkpoint62d, checkpoint62k, checkpoint62j, checkpoint62i, checkpoint62h
Changes since 1.18: +4 -4 lines
avoid unbalanced quote (single or double) in commented line

1 C $Header: /u/gcmpack/MITgcm/pkg/thsice/thsice_solve4temp.F,v 1.18 2009/09/14 20:54:33 jmc Exp $
2 C $Name: $
3
4 #include "THSICE_OPTIONS.h"
5
6 CBOP
7 C !ROUTINE: THSICE_SOLVE4TEMP
8 C !INTERFACE:
9 SUBROUTINE THSICE_SOLVE4TEMP(
10 I bi, bj, siLo, siHi, sjLo, sjHi,
11 I iMin,iMax, jMin,jMax, dBugFlag,
12 I useBulkForce, useEXF,
13 I iceMask, hIce, hSnow, tFrz, flxExSW,
14 U flxSW, tSrf, qIc1, qIc2,
15 O tIc1, tIc2, dTsrf,
16 O sHeat, flxCnB, flxAtm, evpAtm,
17 I myTime, myIter, myThid )
18 C !DESCRIPTION: \bv
19 C *==========================================================*
20 C | S/R THSICE_SOLVE4TEMP
21 C *==========================================================*
22 C | Solve (implicitly) for sea-ice and surface temperature
23 C *==========================================================*
24 C \ev
25
26 C ADAPTED FROM:
27 C LANL CICE.v2.0.2
28 C-----------------------------------------------------------------------
29 C.. thermodynamics (vertical physics) based on M. Winton 3-layer model
30 C.. See Bitz, C. M. and W. H. Lipscomb, 1999: An energy-conserving
31 C.. thermodynamic sea ice model for climate study.
32 C.. J. Geophys. Res., 104, 15669 - 15677.
33 C.. Winton, M., 1999: "A reformulated three-layer sea ice model."
34 C.. Submitted to J. Atmos. Ocean. Technol.
35 C.. authors Elizabeth C. Hunke and William Lipscomb
36 C.. Fluid Dynamics Group, Los Alamos National Laboratory
37 C-----------------------------------------------------------------------
38 Cc****subroutine thermo_winton(n,fice,fsnow,dqice,dTsfc)
39 C.. Compute temperature change using Winton model with 2 ice layers, of
40 C.. which only the top layer has a variable heat capacity.
41
42 C !USES:
43 IMPLICIT NONE
44
45 C == Global variables ===
46 #include "EEPARAMS.h"
47 #include "THSICE_SIZE.h"
48 #include "THSICE_PARAMS.h"
49 #ifdef ALLOW_AUTODIFF_TAMC
50 # include "SIZE.h"
51 # include "tamc.h"
52 # include "tamc_keys.h"
53 #endif
54
55 C !INPUT/OUTPUT PARAMETERS:
56 C == Routine Arguments ==
57 C siLo,siHi :: size of input/output array: 1rst dim. lower,higher bounds
58 C sjLo,sjHi :: size of input/output array: 2nd dim. lower,higher bounds
59 C bi,bj :: tile indices
60 C iMin,iMax :: computation domain: 1rst index range
61 C jMin,jMax :: computation domain: 2nd index range
62 C dBugFlag :: allow to print debugging stuff (e.g. on 1 grid point).
63 C useBulkForce:: use surf. fluxes from bulk-forcing external S/R
64 C useEXF :: use surf. fluxes from exf external S/R
65 C--- Input:
66 C iceMask :: sea-ice fractional mask [0-1]
67 C hIce (hi) :: ice height [m]
68 C hSnow (hs) :: snow height [m]
69 C tFrz (Tf) :: sea-water freezing temperature [oC] (function of S)
70 C flxExSW (=) :: surf. heat flux (+=down) except SW, function of surf. temp Ts:
71 C 0: Flx(Ts=0) ; 1: Flx(Ts=Ts^n) ; 2: d.Flx/dTs(Ts=Ts^n)
72 C--- Modified (input&output):
73 C flxSW (netSW) :: net Short-Wave flux (+=down) [W/m2]: input= at surface
74 C (=) :: output= below sea-ice, into the ocean
75 C tSrf (Tsf) :: surface (ice or snow) temperature
76 C qIc1 (qicen) :: ice enthalpy (J/kg), 1rst level
77 C qIc2 (qicen) :: ice enthalpy (J/kg), 2nd level
78 C--- Output
79 C tIc1 (Tice) :: temperature of ice layer 1 [oC]
80 C tIc2 (Tice) :: temperature of ice layer 2 [oC]
81 C dTsrf (dTsf) :: surf. temp adjusment: Ts^n+1 - Ts^n
82 C sHeat(sHeating):: surf heating flux left to melt snow or ice (= Atmos-conduction)
83 C flxCnB (=) :: heat flux conducted through the ice to bottom surface
84 C flxAtm (=) :: net flux of energy from the atmosphere [W/m2] (+=down)
85 C without snow precip. (energy=0 for liquid water at 0.oC)
86 C evpAtm (=) :: evaporation to the atmosphere [kg/m2/s] (>0 if evaporate)
87 C--- Input:
88 C myTime :: current Time of simulation [s]
89 C myIter :: current Iteration number in simulation
90 C myThid :: my Thread Id number
91 INTEGER siLo, siHi, sjLo, sjHi
92 INTEGER bi,bj
93 INTEGER iMin, iMax
94 INTEGER jMin, jMax
95 LOGICAL dBugFlag
96 LOGICAL useBulkForce
97 LOGICAL useEXF
98 _RL iceMask(siLo:siHi,sjLo:sjHi)
99 _RL hIce (siLo:siHi,sjLo:sjHi)
100 _RL hSnow (siLo:siHi,sjLo:sjHi)
101 _RL tFrz (siLo:siHi,sjLo:sjHi)
102 _RL flxExSW(iMin:iMax,jMin:jMax,0:2)
103 _RL flxSW (siLo:siHi,sjLo:sjHi)
104 _RL tSrf (siLo:siHi,sjLo:sjHi)
105 _RL qIc1 (siLo:siHi,sjLo:sjHi)
106 _RL qIc2 (siLo:siHi,sjLo:sjHi)
107 _RL tIc1 (siLo:siHi,sjLo:sjHi)
108 _RL tIc2 (siLo:siHi,sjLo:sjHi)
109 c _RL dTsrf (siLo:siHi,sjLo:sjHi)
110 _RL dTsrf (iMin:iMax,jMin:jMax)
111 _RL sHeat (siLo:siHi,sjLo:sjHi)
112 _RL flxCnB (siLo:siHi,sjLo:sjHi)
113 _RL flxAtm (siLo:siHi,sjLo:sjHi)
114 _RL evpAtm (siLo:siHi,sjLo:sjHi)
115 _RL myTime
116 INTEGER myIter
117 INTEGER myThid
118 CEOP
119
120 #ifdef ALLOW_THSICE
121 C !LOCAL VARIABLES:
122 C--- local copy of input/output argument list variables (see description above)
123 c _RL flxExcSw(0:2)
124 _RL Tf
125 _RL hi
126 _RL hs
127 _RL netSW
128 _RL Tsf
129 _RL qicen(nlyr)
130 _RL Tice (nlyr)
131 c _RL sHeating
132 c _RL flxCnB
133 _RL dTsf
134 c _RL flxAtm
135 c _RL evpAtm
136
137 C == Local Variables ==
138 C frsnow :: fractional snow cover
139 C fswpen :: SW penetrating beneath surface (W m-2)
140 C fswdn :: SW absorbed at surface (W m-2)
141 C fswint :: SW absorbed in ice (W m-2)
142 C fswocn :: SW passed through ice to ocean (W m-2)
143 C flxExceptSw :: net surface heat flux, except short-wave (W/m2)
144 C evap :: evaporation over snow/ice [kg/m2/s] (>0 if evaporate)
145 C dEvdT :: derivative of evap. with respect to Tsf [kg/m2/s/K]
146 C flx0 :: net surf heat flux, from Atmos. to sea-ice (W m-2)
147 C fct :: heat conducted to top surface
148 C df0dT :: deriv of flx0 wrt Tsf (W m-2 deg-1)
149 C k12, k32 :: thermal conductivity terms
150 C a10, b10 :: coefficients in quadratic eqn for T1
151 C a1, b1, c1 :: coefficients in quadratic eqn for T1
152 C Tsf_start :: old value of Tsf
153 C dt :: timestep
154 INTEGER i,j
155 INTEGER k, iterMax
156 _RL frsnow
157 _RL fswpen
158 _RL fswdn
159 _RL fswint
160 _RL fswocn
161 _RL flxExceptSw
162 _RL evap, dEvdT
163 _RL flx0
164 _RL fct
165 _RL df0dT
166 _RL k12, k32
167 _RL a10, b10
168 _RL a1, b1, c1
169 c _RL Tsf_start
170 _RL dt
171 _RL recip_dhSnowLin
172 INTEGER iceornot
173 LOGICAL useBlkFlx
174
175 C- define grid-point location where to print debugging values
176 #include "THSICE_DEBUG.h"
177
178 1010 FORMAT(A,I3,3F11.6)
179 1020 FORMAT(A,1P4E14.6)
180
181 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
182
183 #ifdef ALLOW_AUTODIFF_TAMC
184 act1 = bi - myBxLo(myThid)
185 max1 = myBxHi(myThid) - myBxLo(myThid) + 1
186 act2 = bj - myByLo(myThid)
187 max2 = myByHi(myThid) - myByLo(myThid) + 1
188 act3 = myThid - 1
189 max3 = nTx*nTy
190 act4 = ikey_dynamics - 1
191 #endif /* ALLOW_AUTODIFF_TAMC */
192
193 useBlkFlx = useEXF .OR. useBulkForce
194 IF ( dhSnowLin.GT.0. _d 0 ) THEN
195 recip_dhSnowLin = 1. _d 0 / dhSnowLin
196 ELSE
197 recip_dhSnowLin = 0. _d 0
198 ENDIF
199
200 dt = thSIce_dtTemp
201 DO j = jMin, jMax
202 DO i = iMin, iMax
203 #ifdef ALLOW_AUTODIFF_TAMC
204 ikey_1 = i
205 & + sNx*(j-1)
206 & + sNx*sNy*act1
207 & + sNx*sNy*max1*act2
208 & + sNx*sNy*max1*max2*act3
209 & + sNx*sNy*max1*max2*max3*act4
210 #endif /* ALLOW_AUTODIFF_TAMC */
211 C--
212 #ifdef ALLOW_AUTODIFF_TAMC
213 CADJ STORE devdt = comlev1_thsice_1, key=ikey_1
214 CADJ STORE df0dt = comlev1_thsice_1, key=ikey_1
215 CADJ STORE flxexceptsw = comlev1_thsice_1, key=ikey_1
216 CADJ STORE flxsw(i,j) = comlev1_thsice_1, key=ikey_1
217 CADJ STORE qic1(i,j) = comlev1_thsice_1, key=ikey_1
218 CADJ STORE qic2(i,j) = comlev1_thsice_1, key=ikey_1
219 CADJ STORE tsrf(i,j) = comlev1_thsice_1, key=ikey_1
220 #endif
221 IF ( iceMask(i,j).GT.0. _d 0) THEN
222 hi = hIce(i,j)
223 hs = hSnow(i,j)
224 Tf = tFrz(i,j)
225 netSW = flxSW(i,j)
226 Tsf = tSrf(i,j)
227 qicen(1)= qIc1(i,j)
228 qicen(2)= qIc2(i,j)
229 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
230 #ifdef ALLOW_DBUG_THSICE
231 IF ( dBug(i,j,bi,bj) ) WRITE(6,'(A,2I4,2I2)')
232 & 'ThSI_SOLVE4T: i,j=',i,j,bi,bj
233 #endif
234 IF ( hi.LT.hIceMin ) THEN
235 C If hi < hIceMin, melt the ice.
236 STOP 'THSICE_SOLVE4TEMP: should not enter if hi<hIceMin'
237 ENDIF
238
239 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
240
241 C fractional snow cover
242 C assume a linear distribution of snow thickness, with dhSnowLin slope,
243 C from hs-dhSnowLin to hs+dhSnowLin if full ice & snow cover.
244 C frsnow = fraction of snow over the ice-covered part of the grid cell
245 IF ( hs .GT. iceMask(i,j)*dhSnowLin ) THEN
246 frsnow = 1. _d 0
247 ELSE
248 frsnow = hs*recip_dhSnowLin/iceMask(i,j)
249 IF ( frsnow.GT.0. _d 0 ) frsnow = SQRT(frsnow)
250 ENDIF
251
252 C Compute SW flux absorbed at surface and penetrating to layer 1.
253 fswpen = netSW * (1. _d 0 - frsnow) * i0swFrac
254 fswocn = fswpen * exp(-ksolar*hi)
255 fswint = fswpen - fswocn
256
257 fswdn = netSW - fswpen
258
259 C Compute conductivity terms at layer interfaces.
260
261 k12 = 4. _d 0*kIce*kSnow / (kSnow*hi + 4. _d 0*kIce*hs)
262 k32 = 2. _d 0*kIce / hi
263
264 C compute ice temperatures
265 a1 = cpIce
266 b1 = qicen(1) + (cpWater-cpIce )*Tmlt1 - Lfresh
267 c1 = Lfresh * Tmlt1
268 Tice(1) = 0.5 _d 0 *(-b1 - SQRT(b1*b1-4. _d 0*a1*c1))/a1
269 Tice(2) = (Lfresh-qicen(2)) / cpIce
270
271 IF (Tice(1).GT.0. _d 0 ) THEN
272 WRITE (standardMessageUnit,'(A,I12,1PE14.6)')
273 & ' BBerr: Tice(1) > 0 ; it=', myIter, qicen(1)
274 WRITE (standardMessageUnit,'(A,4I5,2F11.4)')
275 & ' BBerr: i,j,bi,bj,Tice = ',i,j,bi,bj,Tice
276 ENDIF
277 IF ( Tice(2).GT.0. _d 0) THEN
278 WRITE (standardMessageUnit,'(A,I12,1PE14.6)')
279 & ' BBerr: Tice(2) > 0 ; it=', myIter, qicen(2)
280 WRITE (standardMessageUnit,'(A,4I5,2F11.4)')
281 & ' BBerr: i,j,bi,bj,Tice = ',i,j,bi,bj,Tice
282 ENDIF
283 #ifdef ALLOW_DBUG_THSICE
284 IF ( dBug(i,j,bi,bj) ) WRITE(6,1010)
285 & 'ThSI_SOLVE4T: k, Ts, Tice=',0,Tsf,Tice
286 #endif
287
288 C Compute coefficients used in quadratic formula.
289
290 a10 = rhoi*cpIce *hi/(2. _d 0*dt) +
291 & k32 * (4. _d 0*dt*k32 + rhoi*cpIce *hi)
292 & / (6. _d 0*dt*k32 + rhoi*cpIce *hi)
293 b10 = -hi*
294 & (rhoi*cpIce*Tice(1)+rhoi*Lfresh*Tmlt1/Tice(1))
295 & /(2. _d 0*dt)
296 & - k32 * (4. _d 0*dt*k32*Tf+rhoi*cpIce *hi*Tice(2))
297 & / (6. _d 0*dt*k32 + rhoi*cpIce *hi) - fswint
298 c1 = rhoi*Lfresh*hi*Tmlt1 / (2. _d 0*dt)
299
300 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
301 C Compute new surface and internal temperatures; iterate until
302 C Tsfc converges.
303
304 IF ( useBlkFlx ) THEN
305 iterMax = nitMaxTsf
306 ELSE
307 iterMax = 1
308 ENDIF
309 dTsf = Terrmax
310
311 C ----- begin iteration -----
312 DO k = 1,iterMax
313
314 #ifdef ALLOW_AUTODIFF_TAMC
315 ikey_3 = (ikey_1-1)*MaxTsf + k
316 #endif
317
318 #ifdef ALLOW_AUTODIFF_TAMC
319 CADJ STORE tsf = comlev1_thsice_3, key=ikey_3
320 CADJ STORE dtsf = comlev1_thsice_3, key=ikey_3
321 CADJ STORE df0dt = comlev1_thsice_3, key=ikey_3
322 CADJ STORE flxexceptsw = comlev1_thsice_3, key=ikey_3
323 #endif
324 IF ( ABS(dTsf).GE.Terrmax ) THEN
325
326 C Save temperatures at start of iteration.
327 c Tsf_start = Tsf
328
329 IF ( useBlkFlx ) THEN
330 #ifdef ALLOW_AUTODIFF_TAMC
331 CADJ STORE tsf = comlev1_thsice_3, key=ikey_3
332 #endif
333 C Compute top surface flux.
334 IF (hs.GT.3. _d -1) THEN
335 iceornot=2
336 ELSE
337 iceornot=1
338 ENDIF
339 IF ( useBulkForce ) THEN
340 CALL THSICE_GET_BULKF(
341 I iceornot, Tsf,
342 O flxExceptSw, df0dT, evap, dEvdT,
343 I i,j,bi,bj,myThid )
344 ELSEIF ( useEXF ) THEN
345 CALL THSICE_GET_EXF (
346 I iceornot, Tsf,
347 O flxExceptSw, df0dT, evap, dEvdT,
348 I i,j,bi,bj,myThid )
349 ENDIF
350 ELSE
351 flxExceptSw = flxExSW(i,j,1)
352 df0dT = flxExSW(i,j,2)
353 ENDIF
354 flx0 = fswdn + flxExceptSw
355 #ifdef ALLOW_DBUG_THSICE
356 IF ( dBug(i,j,bi,bj) ) WRITE(6,1020)
357 & 'ThSI_SOLVE4T: flx0,df0dT,k12,D=', flx0,df0dT,k12,k12-df0dT
358 #endif
359
360 C Compute new top layer and surface temperatures.
361 C If Tsfc is computed to be > 0 C, fix Tsfc = 0 and recompute T1
362 C with different coefficients.
363
364 #ifdef ALLOW_AUTODIFF_TAMC
365 CADJ STORE tsf = comlev1_thsice_3, key=ikey_3
366 #endif
367 a1 = a10 - k12*df0dT / (k12-df0dT)
368 b1 = b10 - k12*(flx0-df0dT*Tsf) / (k12-df0dT)
369 Tice(1) = -(b1 + SQRT(b1*b1-4. _d 0*a1*c1))/(2. _d 0*a1)
370 dTsf = (flx0 + k12*(Tice(1)-Tsf)) / (k12-df0dT)
371 Tsf = Tsf + dTsf
372 IF (Tsf .GT. 0. _d 0) THEN
373 #ifdef ALLOW_DBUG_THSICE
374 IF ( dBug(i,j,bi,bj) ) WRITE(6,1010)
375 & 'ThSI_SOLVE4T: k,ts,t1,dTs=', k,Tsf,Tice(1),dTsf
376 #endif
377 a1 = a10 + k12
378 C note: b1 = b10 - k12*Tf0
379 b1 = b10
380 Tice(1) = (-b1 - SQRT(b1*b1-4. _d 0*a1*c1))/(2. _d 0*a1)
381 Tsf = 0. _d 0
382 IF ( useBlkFlx ) THEN
383 IF (hs.GT.3. _d -1) THEN
384 iceornot=2
385 ELSE
386 iceornot=1
387 ENDIF
388 IF ( useBulkForce ) THEN
389 CALL THSICE_GET_BULKF(
390 I iceornot, Tsf,
391 O flxExceptSw, df0dT, evap, dEvdT,
392 I i,j,bi,bj,myThid )
393 ELSEIF ( useEXF ) THEN
394 CALL THSICE_GET_EXF (
395 I iceornot, Tsf,
396 O flxExceptSw, df0dT, evap, dEvdT,
397 I i,j,bi,bj,myThid )
398 ENDIF
399 dTsf = 0. _d 0
400 ELSE
401 flxExceptSw = flxExSW(i,j,0)
402 dTsf = 1000.
403 df0dT = 0.
404 ENDIF
405 flx0 = fswdn + flxExceptSw
406 ENDIF
407
408 C Check for convergence. If no convergence, then repeat.
409 C
410 C Convergence test: Make sure Tsfc has converged, within prescribed error.
411 C (Energy conservation is guaranteed within machine roundoff, even
412 C if Tsfc has not converged.)
413 C If no convergence, then repeat.
414
415 #ifdef ALLOW_DBUG_THSICE
416 IF ( dBug(i,j,bi,bj) ) WRITE(6,1010)
417 & 'ThSI_SOLVE4T: k,ts,t1,dTs=', k,Tsf,Tice(1),dTsf
418 #endif
419 IF ( useBlkFlx .AND. k.EQ.nitMaxTsf
420 & .AND. ABS(dTsf).GE.Terrmax ) THEN
421 WRITE (6,'(A,4I4,I12,F15.9)')
422 & ' BB: not converge: i,j,it,hi=',i,j,bi,bj,
423 & myIter,hi
424 WRITE (6,*) 'BB: not converge: Tsf, dTsf=', Tsf,dTsf
425 WRITE (6,*) 'BB: not converge: flx0,dfdT=',flx0,df0dT
426 IF (Tsf.LT.-70. _d 0) STOP
427 ENDIF
428
429 ENDIF
430 ENDDO
431 C ------ end iteration ------------
432
433 C Compute new bottom layer temperature.
434
435 #ifdef ALLOW_AUTODIFF_TAMC
436 CADJ STORE Tice(:) = comlev1_thsice_1, key=ikey_1
437 CADJ STORE df0dt = comlev1_thsice_1, key=ikey_1
438 #endif
439 Tice(2) = (2. _d 0*dt*k32*(Tice(1)+2. _d 0*Tf)
440 & + rhoi*cpIce *hi*Tice(2))
441 & /(6. _d 0*dt*k32 + rhoi*cpIce *hi)
442 #ifdef ALLOW_DBUG_THSICE
443 IF ( dBug(i,j,bi,bj) ) WRITE(6,1010)
444 & 'ThSI_SOLVE4T: k, Ts, Tice=',k,Tsf,Tice
445 #endif
446
447 C Compute final flux values at surfaces.
448
449 fct = k12*(Tsf-Tice(1))
450 flxCnB(i,j) = 4. _d 0*kIce *(Tice(2)-Tf)/hi
451 flx0 = flx0 + df0dT*dTsf
452 IF ( useBlkFlx ) THEN
453 C-- needs to update also Evap (Tsf changes) since Latent heat has been updated
454 evpAtm(i,j) = evap + dEvdT*dTsf
455 ELSE
456 C- WARNING: Evap & +Evap*Lfresh are missing ! (but only affects Diagnostics)
457 evpAtm(i,j) = 0.
458 ENDIF
459 C- energy flux to Atmos: use net short-wave flux at surf. and
460 C use latent heat = Lvap (energy=0 for liq. water at 0.oC)
461 flxAtm(i,j) = netSW + flxExceptSw
462 & + df0dT*dTsf + evpAtm(i,j)*Lfresh
463 C- excess of energy @ surface (used for surface melting):
464 sHeat(i,j) = flx0 - fct
465
466 C- SW flux at sea-ice base left to the ocean
467 flxSW(i,j) = fswocn
468
469 #ifdef ALLOW_DBUG_THSICE
470 IF ( dBug(i,j,bi,bj) ) WRITE(6,1020)
471 & 'ThSI_SOLVE4T: flx0,fct,Dif,flxCnB=',
472 & flx0,fct,flx0-fct,flxCnB(i,j)
473 #endif
474
475 C Compute new enthalpy for each layer.
476
477 qicen(1) = -cpWater*Tmlt1 + cpIce *(Tmlt1-Tice(1))
478 & + Lfresh*(1. _d 0-Tmlt1/Tice(1))
479 qicen(2) = -cpIce *Tice(2) + Lfresh
480
481 C Make sure internal ice temperatures do not exceed Tmlt.
482 C (This should not happen for reasonable values of i0swFrac)
483
484 IF (Tice(1) .GE. Tmlt1) THEN
485 WRITE (6,'(A,2I4,2I3,1P2E14.6)')
486 & ' BBerr - Bug: IceT(1) > Tmlt',i,j,bi,bj,Tice(1),Tmlt1
487 ENDIF
488 IF (Tice(2) .GE. 0. _d 0) THEN
489 WRITE (6,'(A,2I4,2I3,1P2E14.6)')
490 & ' BBerr - Bug: IceT(2) > 0',i,j,bi,bj,Tice(2)
491 ENDIF
492
493 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
494 C-- Update Sea-Ice state :
495 tSrf(i,j) = Tsf
496 tIc1(i,j) = Tice(1)
497 tic2(i,j) = Tice(2)
498 qIc1(i,j) = qicen(1)
499 qIc2(i,j) = qicen(2)
500 c dTsrf(i,j) = dTsf
501 IF ( .NOT.useBlkFlx ) dTsrf(i,j) = dTsf
502 c sHeat(i,j) = sHeating
503 c flxCnB(i,j)= flxCnB
504 c flxAtm(i,j)= flxAtm
505 c evpAtm(i,j)= evpAtm
506 #ifdef ALLOW_DBUG_THSICE
507 IF ( dBug(i,j,bi,bj) ) THEN
508 WRITE(6,1020) 'ThSI_SOLV_4T: Tsf, Tice(1,2), dTsurf=',
509 & Tsf, Tice, dTsf
510 WRITE(6,1020) 'ThSI_SOLV_4T: sHeat, flxCndBt, Qice =',
511 & sHeat(i,j), flxCnB(i,j), qicen
512 WRITE(6,1020) 'ThSI_SOLV_4T: flxA, evpA, fxSW_bf,af=',
513 & flxAtm(i,j), evpAtm(i,j), netSW, flxSW(i,j)
514 ENDIF
515 #endif
516 ELSE
517 IF ( .NOT.useBlkFlx ) dTsrf(i,j) = 0. _d 0
518 ENDIF
519 ENDDO
520 ENDDO
521 #endif /* ALLOW_THSICE */
522
523 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
524
525 RETURN
526 END

  ViewVC Help
Powered by ViewVC 1.1.22