/[MITgcm]/MITgcm/pkg/seaice/seaice_solve4temp.F
ViewVC logotype

Contents of /MITgcm/pkg/seaice/seaice_solve4temp.F

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


Revision 1.31 - (show annotations) (download)
Tue Feb 14 14:52:08 2012 UTC (12 years, 3 months ago) by mlosch
Branch: MAIN
Changes since 1.30: +4 -3 lines
remove one divisions by HCUT within a loop, without changing the results

1 C $Header: /u/gcmpack/MITgcm/pkg/seaice/seaice_solve4temp.F,v 1.30 2012/02/11 03:35:01 gforget Exp $
2 C $Name: $
3
4 #include "SEAICE_OPTIONS.h"
5 #ifdef ALLOW_EXF
6 # include "EXF_OPTIONS.h"
7 #endif
8
9 CBOP
10 C !ROUTINE: SEAICE_SOLVE4TEMP
11 C !INTERFACE:
12 SUBROUTINE SEAICE_SOLVE4TEMP(
13 I UG, HICE_ACTUAL, HSNOW_ACTUAL,
14 #ifdef SEAICE_CAP_SUBLIM
15 I F_lh_max,
16 #endif
17 U TSURF,
18 O F_ia, IcePenetSW,
19 O FWsublim,
20 I bi, bj, myTime, myIter, myThid )
21
22 C !DESCRIPTION: \bv
23 C *==========================================================*
24 C | SUBROUTINE SOLVE4TEMP
25 C | o Calculate ice growth rate, surface fluxes and
26 C | temperature of ice surface.
27 C | see Hibler, MWR, 108, 1943-1973, 1980
28 C *==========================================================*
29 C \ev
30
31 C !USES:
32 IMPLICIT NONE
33 C === Global variables ===
34 #include "SIZE.h"
35 #include "GRID.h"
36 #include "EEPARAMS.h"
37 #include "PARAMS.h"
38 #include "FFIELDS.h"
39 #include "SEAICE_SIZE.h"
40 #include "SEAICE_PARAMS.h"
41 #include "SEAICE.h"
42 #include "DYNVARS.h"
43 #ifdef ALLOW_EXF
44 # include "EXF_FIELDS.h"
45 #endif
46 #ifdef ALLOW_AUTODIFF_TAMC
47 # include "tamc.h"
48 #endif
49
50 C !INPUT PARAMETERS:
51 C UG :: atmospheric wind speed (m/s)
52 C HICE_ACTUAL :: actual ice thickness
53 C HSNOW_ACTUAL :: actual snow thickness
54 C TSURF :: surface temperature of ice/snow in Kelvin
55 C bi,bj :: tile indices
56 C myTime :: current time in simulation
57 C myIter :: iteration number in simulation
58 C myThid :: my Thread Id number
59 C !OUTPUT PARAMETERS:
60 C TSURF :: updated surface temperature of ice/snow in Kelvin
61 C F_ia :: upward seaice/snow surface heat flux to atmosphere (W/m^2)
62 C IcePenetSW :: short wave heat flux transmitted through ice (+=upward)
63 C FWsublim :: fresh water (mass) flux due to sublimation (+=up)(kg/m^2/s)
64 C---- Notes:
65 C 1) should add IcePenetSW to F_ia to get the net surface heat flux
66 C from the atmosphere (IcePenetSW not currently included in F_ia)
67 C 2) since zero ice/snow heat capacity is assumed, all the absorbed Short
68 C -Wave is used to warm the ice/snow surface (heating profile ignored).
69 C----------
70 _RL UG (1:sNx,1:sNy)
71 _RL HICE_ACTUAL (1:sNx,1:sNy)
72 _RL HSNOW_ACTUAL(1:sNx,1:sNy)
73 #ifdef SEAICE_CAP_SUBLIM
74 _RL F_lh_max (1:sNx,1:sNy)
75 #endif
76 _RL TSURF (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
77 _RL F_ia (1:sNx,1:sNy)
78 _RL IcePenetSW (1:sNx,1:sNy)
79 _RL FWsublim (1:sNx,1:sNy)
80 INTEGER bi, bj
81 _RL myTime
82 INTEGER myIter, myThid
83 CEOP
84
85 #if defined(ALLOW_ATM_TEMP) && defined(ALLOW_DOWNWARD_RADIATION)
86 C !LOCAL VARIABLES:
87 C === Local variables ===
88 C i, j :: Loop counters
89 C kSurface :: vertical index of surface layer
90 INTEGER i, j
91 INTEGER kSurface
92 INTEGER ITER
93 C tempFrz :: ocean temperature in contact with ice (=seawater freezing point) (K)
94 _RL tempFrz (1:sNx,1:sNy)
95 _RL D1, D1I
96 _RL D3(1:sNx,1:sNy)
97 _RL TMELT, XKI, XKS, HCUT, recip_HCUT, XIO
98 C SurfMeltTemp :: Temp (K) above which wet-albedo values are used
99 _RL SurfMeltTemp
100 C effConduct :: effective conductivity of combined ice and snow
101 _RL effConduct(1:sNx,1:sNy)
102 C lhSublim :: latent heat of sublimation (SEAICE_lhEvap + SEAICE_lhFusion)
103 _RL lhSublim
104 C t1,t2,t3,t4 :: powers of temperature
105 _RL t1, t2, t3, t4
106
107 C- Constants to calculate Saturation Vapor Pressure
108 C Maykut Polynomial Coeff. for Sat. Vapor Press
109 _RL C1, C2, C3, C4, C5, QS1
110 C Extended temp-range expon. relation Coeff. for Sat. Vapor Press
111 _RL lnTEN
112 _RL aa1,aa2,bb1,bb2,Ppascals,cc0,cc1,cc2,cc3t
113 C specific humidity at ice surface variables
114 _RL mm_pi,mm_log10pi
115
116 C F_c :: conductive heat flux through seaice+snow (+=upward)
117 C F_lwu :: upward long-wave surface heat flux (+=upward)
118 C F_sens :: sensible surface heat flux (+=upward)
119 C F_lh :: latent heat flux (sublimation) (+=upward)
120 C qhice :: saturation vapor pressure of snow/ice surface
121 C dqh_dTs :: derivative of qhice w.r.t snow/ice surf. temp
122 C dFia_dTs :: derivative of surf heat flux (F_ia) w.r.t surf. temp
123 _RL F_c (1:sNx,1:sNy)
124 _RL F_lwu (1:sNx,1:sNy)
125 _RL F_sens (1:sNx,1:sNy)
126 _RL F_lh (1:sNx,1:sNy)
127 _RL qhice (1:sNx,1:sNy)
128 _RL dqh_dTs (1:sNx,1:sNy)
129 _RL dFia_dTs (1:sNx,1:sNy)
130 _RL absorbedSW (1:sNx,1:sNy)
131 _RL penetSWFrac
132 _RL delTsurf
133
134 C local copies of global variables
135 _RL tsurfLoc (1:sNx,1:sNy)
136 _RL tsurfPrev (1:sNx,1:sNy)
137 _RL atempLoc (1:sNx,1:sNy)
138 _RL lwdownLoc (1:sNx,1:sNy)
139 _RL ALB (1:sNx,1:sNy)
140 _RL ALB_ICE (1:sNx,1:sNy)
141 _RL ALB_SNOW (1:sNx,1:sNy)
142 C iceOrNot :: this is HICE_ACTUAL.GT.0.
143 LOGICAL iceOrNot(1:sNx,1:sNy)
144 #ifdef SEAICE_DEBUG
145 C F_io_net :: upward conductive heat flux through seaice+snow
146 C F_ia_net :: net heat flux divergence at the sea ice/snow surface:
147 C includes ice conductive fluxes and atmospheric fluxes (W/m^2)
148 _RL F_io_net
149 _RL F_ia_net
150 #endif /* SEAICE_DEBUG */
151
152 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
153
154 #ifdef ALLOW_AUTODIFF_TAMC
155 CADJ INIT comlev1_solve4temp = COMMON, sNx*sNy*NMAX_TICE
156 #endif /* ALLOW_AUTODIFF_TAMC */
157
158 C- MAYKUT CONSTANTS FOR SAT. VAP. PRESSURE TEMP. POLYNOMIAL
159 C1= 2.7798202 _d -06
160 C2= -2.6913393 _d -03
161 C3= 0.97920849 _d +00
162 C4= -158.63779 _d +00
163 C5= 9653.1925 _d +00
164 QS1=0.622 _d +00/1013.0 _d +00
165 C- Extended temp-range expon. relation Coeff. for Sat. Vapor Press
166 lnTEN = LOG(10.0 _d 0)
167 aa1 = 2663.5 _d 0
168 aa2 = 12.537 _d 0
169 bb1 = 0.622 _d 0
170 bb2 = 1.0 _d 0 - bb1
171 Ppascals = 100000. _d 0
172 C cc0 = TEN ** aa2
173 cc0 = EXP(aa2*lnTEN)
174 cc1 = cc0*aa1*bb1*Ppascals*lnTEN
175 cc2 = cc0*bb2
176
177 IF ( buoyancyRelation .EQ. 'OCEANICP' ) THEN
178 kSurface = Nr
179 ELSE
180 kSurface = 1
181 ENDIF
182
183 C SENSIBLE HEAT CONSTANT
184 D1=SEAICE_dalton*SEAICE_cpAir*SEAICE_rhoAir
185
186 C ICE LATENT HEAT CONSTANT
187 lhSublim = SEAICE_lhEvap + SEAICE_lhFusion
188 D1I=SEAICE_dalton*lhSublim*SEAICE_rhoAir
189
190 C MELTING TEMPERATURE OF ICE
191 TMELT = celsius2K
192
193 C ICE CONDUCTIVITY
194 XKI=SEAICE_iceConduct
195
196 C SNOW CONDUCTIVITY
197 XKS=SEAICE_snowConduct
198
199 C CUTOFF SNOW THICKNESS
200 C Snow-Thickness above HCUT: SW optically thick snow (=> snow-albedo).
201 C Snow-Thickness below HCUT: linear transition to ice-albedo
202 HCUT = SEAICE_snowThick
203 recip_HCUT = 1./HCUT
204
205 C PENETRATION SHORTWAVE RADIATION FACTOR
206 XIO=SEAICE_shortwave
207
208 C Temperature Threshold for wet-albedo:
209 SurfMeltTemp = TMELT + SEAICE_wetAlbTemp
210 C old SOLVE4TEMP_LEGACY setting, consistent with former celsius2K value:
211 c TMELT = 273.16 _d +00
212 c SurfMeltTemp = 273.159 _d +00
213
214 C Initialize variables
215 DO J=1,sNy
216 DO I=1,sNx
217 C HICE_ACTUAL is modified in this routine, but at the same time
218 C used to decided where there is ice, therefore we save this information
219 C here in a separate array
220 iceOrNot (I,J) = HICE_ACTUAL(I,J) .GT. 0. _d 0
221 IcePenetSW(I,J) = 0. _d 0
222 absorbedSW(I,J) = 0. _d 0
223 qhice (I,J) = 0. _d 0
224 dqh_dTs (I,J) = 0. _d 0
225 F_ia (I,J) = 0. _d 0
226 F_lh (I,J) = 0. _d 0
227 F_lwu (I,J) = 0. _d 0
228 F_sens (I,J) = 0. _d 0
229 C Make a local copy of LW, surface & atmospheric temperatures
230 tsurfLoc (I,J) = TSURF(I,J,bi,bj)
231 c tsurfLoc (I,J) = MIN( celsius2K+MAX_TICE, TSURF(I,J,bi,bj) )
232 lwdownLoc(I,J) = MAX( MIN_LWDOWN, LWDOWN(I,J,bi,bj) )
233 atempLoc (I,J) = MAX( celsius2K+MIN_ATEMP, ATEMP(I,J,bi,bj) )
234
235 c FREEZING TEMP. OF SEA WATER (K)
236 tempFrz(I,J) = SEAICE_dTempFrz_dS *salt(I,J,kSurface,bi,bj)
237 & + SEAICE_tempFrz0 + celsius2K
238
239 C Now determine fixed (relative to tsurf) forcing term in heat budget
240
241 IF(HSNOW_ACTUAL(I,J).GT.0.0) THEN
242 C Stefan-Boltzmann constant times emissivity
243 D3(I,J)=SEAICE_snow_emiss*SEAICE_boltzmann
244 #ifdef EXF_LWDOWN_WITH_EMISSIVITY
245 C This is now [(1-emiss)*lwdown - lwdown]
246 lwdownLoc(I,J) = SEAICE_snow_emiss*lwdownLoc(I,J)
247 #else /* use the old hard wired inconsistent value */
248 lwdownLoc(I,J) = 0.97 _d 0*lwdownLoc(I,J)
249 #endif /* EXF_LWDOWN_WITH_EMISSIVITY */
250 ELSE
251 C Stefan-Boltzmann constant times emissivity
252 D3(I,J)=SEAICE_ice_emiss*SEAICE_boltzmann
253 #ifdef EXF_LWDOWN_WITH_EMISSIVITY
254 C This is now [(1-emiss)*lwdown - lwdown]
255 lwdownLoc(I,J) = SEAICE_ice_emiss*lwdownLoc(I,J)
256 #else /* use the old hard wired inconsistent value */
257 lwdownLoc(I,J) = 0.97 _d 0*lwdownLoc(I,J)
258 #endif /* EXF_LWDOWN_WITH_EMISSIVITY */
259 ENDIF
260 ENDDO
261 ENDDO
262
263 DO J=1,sNy
264 DO I=1,sNx
265
266 C DECIDE ON ALBEDO
267 IF ( iceOrNot(I,J) ) THEN
268
269 IF ( YC(I,J,bi,bj) .LT. 0.0 _d 0 ) THEN
270 IF (tsurfLoc(I,J) .GE. SurfMeltTemp) THEN
271 ALB_ICE (I,J) = SEAICE_wetIceAlb_south
272 ALB_SNOW(I,J) = SEAICE_wetSnowAlb_south
273 ELSE ! no surface melting
274 ALB_ICE (I,J) = SEAICE_dryIceAlb_south
275 ALB_SNOW(I,J) = SEAICE_drySnowAlb_south
276 ENDIF
277 ELSE !/ Northern Hemisphere
278 IF (tsurfLoc(I,J) .GE. SurfMeltTemp) THEN
279 ALB_ICE (I,J) = SEAICE_wetIceAlb
280 ALB_SNOW(I,J) = SEAICE_wetSnowAlb
281 ELSE ! no surface melting
282 ALB_ICE (I,J) = SEAICE_dryIceAlb
283 ALB_SNOW(I,J) = SEAICE_drySnowAlb
284 ENDIF
285 ENDIF !/ Albedo for snow and ice
286
287 C If actual snow thickness exceeds the cutoff thickness, use snow albedo
288 IF (HSNOW_ACTUAL(I,J) .GT. HCUT) THEN
289 ALB(I,J) = ALB_SNOW(I,J)
290 ELSEIF ( HCUT.LE.ZERO ) THEN
291 ALB(I,J) = ALB_ICE(I,J)
292 ELSE
293 C otherwise, use linear transition between ice and snow albedo
294 ALB(I,J) = MIN( ALB_ICE(I,J) + HSNOW_ACTUAL(I,J)*recip_HCUT
295 & *(ALB_SNOW(I,J) -ALB_ICE(I,J))
296 & , ALB_SNOW(I,J) )
297 ENDIF
298
299 C Determine the fraction of shortwave radiative flux remaining
300 C at ocean interface after scattering through the snow and ice.
301 C If snow is present, no radiation penetrates through snow+ice
302 IF (HSNOW_ACTUAL(I,J) .GT. 0.0 _d 0) THEN
303 penetSWFrac = 0.0 _d 0
304 ELSE
305 penetSWFrac = XIO*EXP(-1.5 _d 0 * HICE_ACTUAL(I,J))
306 ENDIF
307 C The shortwave radiative flux leaving ocean beneath ice (+=up).
308 IcePenetSW(I,J) = -(1.0 _d 0 - ALB(I,J))
309 & *penetSWFrac * SWDOWN(I,J,bi,bj)
310 C The shortwave radiative flux convergence in the seaice.
311 absorbedSW(I,J) = (1.0 _d 0 - ALB(I,J))
312 & *(1.0 _d 0 - penetSWFrac)* SWDOWN(I,J,bi,bj)
313
314 C The effective conductivity of the two-layer snow/ice system.
315 C Set a minimum sea ice thickness of 5 cm to bound
316 C the magnitude of conductive heat fluxes.
317 Cif * now taken care of by SEAICE_hice_reg in seaice_growth
318 c hice_tmp = max(HICE_ACTUAL(I,J),5. _d -2)
319 effConduct(I,J) = XKI * XKS /
320 & (XKS * HICE_ACTUAL(I,J) + XKI * HSNOW_ACTUAL(I,J))
321
322 #ifdef SEAICE_DEBUG
323 IF ( (I .EQ. SEAICE_debugPointI) .AND.
324 & (J .EQ. SEAICE_debugPointJ) ) THEN
325 print '(A,i6)','-----------------------------------'
326 print '(A,i6)','ibi merged initialization ', myIter
327 print '(A,i6,4(1x,D24.15))',
328 & 'ibi iter, TSL, TS ',myIter,
329 & tsurfLoc(I,J), TSURF(I,J,bi,bj)
330 print '(A,i6,4(1x,D24.15))',
331 & 'ibi iter, TMELT ',myIter,TMELT
332 print '(A,i6,4(1x,D24.15))',
333 & 'ibi iter, HIA, EFKCON ',myIter,
334 & HICE_ACTUAL(I,J), effConduct(I,J)
335 print '(A,i6,4(1x,D24.15))',
336 & 'ibi iter, HSNOW ',myIter,
337 & HSNOW_ACTUAL(I,J), ALB(I,J)
338 print '(A,i6)','-----------------------------------'
339 print '(A,i6)','ibi energy balance iterat ', myIter
340 ENDIF
341 #endif /* SEAICE_DEBUG */
342
343 ENDIF !/* iceOrNot */
344 ENDDO !/* i */
345 ENDDO !/* j */
346
347 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
348 DO ITER=1,IMAX_TICE
349 DO J=1,sNy
350 DO I=1,sNx
351 #ifdef ALLOW_AUTODIFF_TAMC
352 iicekey = I + sNx*(J-1) + (ITER-1)*sNx*sNy
353 CADJ STORE tsurfLoc(i,j) = comlev1_solve4temp,
354 CADJ & key = iicekey, byte = isbyte
355 #endif /* ALLOW_AUTODIFF_TAMC */
356
357 C- save tsurf from previous iter
358 tsurfPrev(I,J) = tsurfLoc(I,J)
359 IF ( iceOrNot(I,J) ) THEN
360
361 t1 = tsurfLoc(I,J)
362 t2 = t1*t1
363 t3 = t2*t1
364 t4 = t2*t2
365
366 C-- Calculate the specific humidity in the BL above the snow/ice
367 IF ( useMaykutSatVapPoly ) THEN
368 C- Use the Maykut polynomial
369 qhice(I,J)=QS1*(C1*t4+C2*t3 +C3*t2+C4*t1+C5)
370 dqh_dTs(I,J) = 0. _d 0
371 ELSE
372 C- Use exponential relation approx., more accurate at low temperatures
373 C log 10 of the sat vap pressure
374 mm_log10pi = -aa1 / t1 + aa2
375 C The saturation vapor pressure (SVP) in the surface
376 C boundary layer (BL) above the snow/ice.
377 c mm_pi = TEN **(mm_log10pi)
378 C The following form does the same, but is faster
379 mm_pi = EXP(mm_log10pi*lnTEN)
380 qhice(I,J) = bb1*mm_pi/( Ppascals -(1.0 _d 0 - bb1)*mm_pi )
381 C A constant for SVP derivative w.r.t TICE
382 c cc3t = TEN **(aa1 / t1)
383 C The following form does the same, but is faster
384 cc3t = EXP(aa1 / t1 * lnTEN)
385 C d(qh)/d(TICE)
386 dqh_dTs(I,J) = cc1*cc3t/((cc2-cc3t*Ppascals)**2 *t2)
387 ENDIF
388
389 C Calculate the flux terms based on the updated tsurfLoc
390 F_c(I,J) = effConduct(I,J)*(tempFrz(I,J)-tsurfLoc(I,J))
391 F_lh(I,J) = D1I*UG(I,J)*(qhice(I,J)-AQH(I,J,bi,bj))
392 #ifdef SEAICE_CAP_SUBLIM
393 C if the latent heat flux implied by tsurfLoc exceeds
394 C F_lh_max, cap F_lh and decouple the flux magnitude from TICE
395 IF (F_lh(I,J) .GT. F_lh_max(I,J)) THEN
396 F_lh(I,J) = F_lh_max(I,J)
397 dqh_dTs(I,J) = ZERO
398 ENDIF
399 #endif /* SEAICE_CAP_SUBLIM */
400
401 F_lwu(I,J) = t4 * D3(I,J)
402 F_sens(I,J)= D1 * UG(I,J) * (t1 - atempLoc(I,J))
403 F_ia(I,J) = -lwdownLoc(I,J) -absorbedSW(I,J) + F_lwu(I,J)
404 & + F_sens(I,J) + F_lh(I,J)
405 C d(F_ia)/d(Tsurf)
406 dFia_dTs(I,J) = 4.0 _d 0*D3(I,J)*t3 + D1*UG(I,J)
407 & + D1I*UG(I,J)*dqh_dTs(I,J)
408
409 #ifdef SEAICE_DEBUG
410 IF ( (I .EQ. SEAICE_debugPointI) .AND.
411 & (J .EQ. SEAICE_debugPointJ) ) THEN
412 print '(A,i6,4(1x,D24.15))',
413 & 'ice-iter qhICE, ', ITER,qhIce(I,J)
414 print '(A,i6,4(1x,D24.15))',
415 & 'ice-iter dFiDTs1 F_ia ', ITER,
416 & dFia_dTs(I,J)+effConduct(I,J), F_ia(I,J)-F_c(I,J)
417 ENDIF
418 #endif /* SEAICE_DEBUG */
419
420 C- Update tsurf as solution of : Fc = Fia + d/dT(Fia - Fc) *delta.tsurf
421 tsurfLoc(I,J) = tsurfLoc(I,J)
422 & + ( F_c(I,J)-F_ia(I,J) ) / ( effConduct(I,J)+dFia_dTs(I,J) )
423
424 IF ( useMaykutSatVapPoly ) THEN
425 tsurfLoc(I,J) = MAX( celsius2K+MIN_TICE, tsurfLoc(I,J) )
426 ENDIF
427 C If the search leads to tsurfLoc < 50 Kelvin, restart the search
428 C at tsurfLoc = TMELT. Note that one solution to the energy balance problem
429 C is an extremely low temperature - a temperature far below realistic values.
430 c IF (tsurfLoc(I,J) .LT. 50.0 _d 0 ) tsurfLoc(I,J) = TMELT
431 C Comments & code above not relevant anymore (from older version, when
432 C trying Maykut-Polynomial & dqh_dTs > 0 ?): commented out
433 tsurfLoc(I,J) = MIN( tsurfLoc(I,J), TMELT )
434
435 #ifdef SEAICE_DEBUG
436 IF ( (I .EQ. SEAICE_debugPointI) .AND.
437 & (J .EQ. SEAICE_debugPointJ) ) THEN
438 print '(A,i6,4(1x,D24.15))',
439 & 'ice-iter tsurfLc,|dif|', ITER,
440 & tsurfLoc(I,J),
441 & LOG10(ABS(tsurfLoc(I,J) - t1))
442 ENDIF
443 #endif /* SEAICE_DEBUG */
444
445 ENDIF !/* iceOrNot */
446 ENDDO !/* i */
447 ENDDO !/* j */
448 ENDDO !/* Iterations */
449 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
450
451 DO J=1,sNy
452 DO I=1,sNx
453 IF ( iceOrNot(I,J) ) THEN
454
455 C Save updated tsurf and finalize the flux terms
456 TSURF(I,J,bi,bj) = tsurfLoc(I,J)
457
458 #ifdef SEAICE_MODIFY_GROWTH_ADJ
459 Cgf no additional dependency through solver, snow, etc.
460 IF ( SEAICEadjMODE.GE.2 ) THEN
461 CALL ZERO_ADJ_1D( 1, TSURF(I,J,bi,bj), myThid)
462 absorbedSW(I,J) = 0.3 _d 0 *SWDOWN(I,J,bi,bj)
463 IcePenetSW(I,J)= 0. _d 0
464 ENDIF
465 IF ( postSolvTempIter.EQ.2 .OR. SEAICEadjMODE.GE.2 ) THEN
466 t1 = TSURF(I,J,bi,bj)
467 #else /* SEAICE_MODIFY_GROWTH_ADJ */
468
469 IF ( postSolvTempIter.EQ.2 ) THEN
470 C Recalculate the fluxes based on the (possibly) adjusted TSURF
471 t1 = tsurfLoc(I,J)
472 #endif /* SEAICE_MODIFY_GROWTH_ADJ */
473 t2 = t1*t1
474 t3 = t2*t1
475 t4 = t2*t2
476
477 IF ( useMaykutSatVapPoly ) THEN
478 qhice(I,J)=QS1*(C1*t4+C2*t3 +C3*t2+C4*t1+C5)
479 ELSE
480 C log 10 of the sat vap pressure
481 mm_log10pi = -aa1 / t1 + aa2
482 C saturation vapor pressure
483 c mm_pi = TEN **(mm_log10pi)
484 C The following form does the same, but is faster
485 mm_pi = EXP(mm_log10pi*lnTEN)
486 C over ice specific humidity
487 qhice(I,J) = bb1*mm_pi/( Ppascals -(1.0 _d 0 - bb1)*mm_pi )
488 ENDIF
489 F_c(I,J) = effConduct(I,J) * (tempFrz(I,J) - t1)
490 F_lh(I,J) = D1I * UG(I,J)*(qhice(I,J)-AQH(I,J,bi,bj))
491 #ifdef SEAICE_CAP_SUBLIM
492 IF (F_lh(I,J) .GT. F_lh_max(I,J)) THEN
493 F_lh(I,J) = F_lh_max(I,J)
494 ENDIF
495 #endif /* SEAICE_CAP_SUBLIM */
496 F_lwu(I,J) = t4 * D3(I,J)
497 F_sens(I,J) = D1 * UG(I,J) * (t1 - atempLoc(I,J))
498 C The flux between the ice/snow surface and the atmosphere.
499 F_ia(I,J) = -lwdownLoc(I,J) -absorbedSW(I,J) + F_lwu(I,J)
500 & + F_sens(I,J) + F_lh(I,J)
501
502 ELSEIF ( postSolvTempIter.EQ.1 ) THEN
503 C Update fluxes (consistent with the linearized formulation)
504 delTsurf = tsurfLoc(I,J)-tsurfPrev(I,J)
505 F_c(I,J) = effConduct(I,J)*(tempFrz(I,J)-tsurfLoc(I,J))
506 F_ia(I,J) = F_ia(I,J) + dFia_dTs(I,J)*delTsurf
507 F_lh(I,J) = F_lh(I,J)
508 & + D1I*UG(I,J)*dqh_dTs(I,J)*delTsurf
509
510 c ELSEIF ( postSolvTempIter.EQ.0 ) THEN
511 C Take fluxes from last iteration
512
513 ENDIF
514
515 C Fresh water flux (kg/m^2/s) from latent heat of sublimation.
516 C F_lh is positive upward (sea ice looses heat) and FWsublim
517 C is also positive upward (atmosphere gains freshwater)
518 FWsublim(I,J) = F_lh(I,J)/lhSublim
519
520 #ifdef SEAICE_DEBUG
521 C Calculate the net ice-ocean and ice-atmosphere fluxes
522 IF (F_c(I,J) .GT. 0.0 _d 0) THEN
523 F_io_net = F_c(I,J)
524 F_ia_net = 0.0 _d 0
525 ELSE
526 F_io_net = 0.0 _d 0
527 F_ia_net = F_ia(I,J)
528 ENDIF !/* conductive fluxes up or down */
529
530 IF ( (I .EQ. SEAICE_debugPointI) .AND.
531 & (J .EQ. SEAICE_debugPointJ) ) THEN
532 print '(A)','----------------------------------------'
533 print '(A,i6)','ibi complete ', myIter
534 print '(A,4(1x,D24.15))',
535 & 'ibi T(SURF, surfLoc,atmos) ',
536 & TSURF(I,J,bi,bj), tsurfLoc(I,J),atempLoc(I,J)
537 print '(A,4(1x,D24.15))',
538 & 'ibi LWL ', lwdownLoc(I,J)
539 print '(A,4(1x,D24.15))',
540 & 'ibi QSW(Total, Penetrating)',
541 & SWDOWN(I,J,bi,bj), IcePenetSW(I,J)
542 print '(A,4(1x,D24.15))',
543 & 'ibi qh(ATM ICE) ',
544 & AQH(I,J,bi,bj),qhice(I,J)
545 print '(A,4(1x,D24.15))',
546 & 'ibi F(lwd,swi,lwu) ',
547 & -lwdownLoc(I,J), -absorbedSW(I,J), F_lwu(I,J)
548 print '(A,4(1x,D24.15))',
549 & 'ibi F(c,lh,sens) ',
550 & F_c(I,J), F_lh(I,J), F_sens(I,J)
551 #ifdef SEAICE_CAP_SUBLIM
552 IF (F_lh_max(I,J) .GT. ZERO) THEN
553 print '(A,4(1x,D24.15))',
554 & 'ibi F_lh_max, F_lh/lhmax) ',
555 & F_lh_max(I,J), F_lh(I,J)/ F_lh_max(I,J)
556 ELSE
557 print '(A,4(1x,D24.15))',
558 & 'ibi F_lh_max = ZERO! '
559 ENDIF
560 print '(A,4(1x,D24.15))',
561 & 'ibi FWsub, FWsubm*dT/rhoI ',
562 & FWsublim(I,J),
563 & FWsublim(I,J)*SEAICE_deltaTtherm/SEAICE_rhoICE
564 #endif /* SEAICE_CAP_SUBLIM */
565 print '(A,4(1x,D24.15))',
566 & 'ibi F_ia, F_ia_net, F_c ',
567 & F_ia(I,J), F_ia_net, F_c(I,J)
568 print '(A)','----------------------------------------'
569 ENDIF
570 #endif /* SEAICE_DEBUG */
571
572 ENDIF !/* iceOrNot */
573 ENDDO !/* i */
574 ENDDO !/* j */
575
576 #endif /* ALLOW_ATM_TEMP && ALLOW_DOWNWARD_RADIATION */
577 RETURN
578 END

  ViewVC Help
Powered by ViewVC 1.1.22