/[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.33 - (show annotations) (download)
Fri Mar 2 18:56:06 2012 UTC (12 years, 2 months ago) by heimbach
Branch: MAIN
Changes since 1.32: +9 -1 lines
Prepare adjoint of SITRACER

1 C $Header: /u/gcmpack/MITgcm/pkg/seaice/seaice_solve4temp.F,v 1.32 2012/02/15 00:47:33 jmc 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 = 0. _d 0
204 IF ( HCUT.GT.0. _d 0 ) recip_HCUT = 1. _d 0 / HCUT
205
206 C PENETRATION SHORTWAVE RADIATION FACTOR
207 XIO=SEAICE_shortwave
208
209 C Temperature Threshold for wet-albedo:
210 SurfMeltTemp = TMELT + SEAICE_wetAlbTemp
211 C old SOLVE4TEMP_LEGACY setting, consistent with former celsius2K value:
212 c TMELT = 273.16 _d +00
213 c SurfMeltTemp = 273.159 _d +00
214
215 C Initialize variables
216 DO J=1,sNy
217 DO I=1,sNx
218 C HICE_ACTUAL is modified in this routine, but at the same time
219 C used to decided where there is ice, therefore we save this information
220 C here in a separate array
221 iceOrNot (I,J) = HICE_ACTUAL(I,J) .GT. 0. _d 0
222 IcePenetSW(I,J) = 0. _d 0
223 absorbedSW(I,J) = 0. _d 0
224 qhice (I,J) = 0. _d 0
225 dqh_dTs (I,J) = 0. _d 0
226 F_ia (I,J) = 0. _d 0
227 F_lh (I,J) = 0. _d 0
228 F_lwu (I,J) = 0. _d 0
229 F_sens (I,J) = 0. _d 0
230 C Make a local copy of LW, surface & atmospheric temperatures
231 tsurfLoc (I,J) = TSURF(I,J,bi,bj)
232 c tsurfLoc (I,J) = MIN( celsius2K+MAX_TICE, TSURF(I,J,bi,bj) )
233 lwdownLoc(I,J) = MAX( MIN_LWDOWN, LWDOWN(I,J,bi,bj) )
234 atempLoc (I,J) = MAX( celsius2K+MIN_ATEMP, ATEMP(I,J,bi,bj) )
235
236 c FREEZING TEMP. OF SEA WATER (K)
237 tempFrz(I,J) = SEAICE_dTempFrz_dS *salt(I,J,kSurface,bi,bj)
238 & + SEAICE_tempFrz0 + celsius2K
239
240 C Now determine fixed (relative to tsurf) forcing term in heat budget
241
242 IF(HSNOW_ACTUAL(I,J).GT.0.0) THEN
243 C Stefan-Boltzmann constant times emissivity
244 D3(I,J)=SEAICE_snow_emiss*SEAICE_boltzmann
245 #ifdef EXF_LWDOWN_WITH_EMISSIVITY
246 C This is now [(1-emiss)*lwdown - lwdown]
247 lwdownLoc(I,J) = SEAICE_snow_emiss*lwdownLoc(I,J)
248 #else /* use the old hard wired inconsistent value */
249 lwdownLoc(I,J) = 0.97 _d 0*lwdownLoc(I,J)
250 #endif /* EXF_LWDOWN_WITH_EMISSIVITY */
251 ELSE
252 C Stefan-Boltzmann constant times emissivity
253 D3(I,J)=SEAICE_ice_emiss*SEAICE_boltzmann
254 #ifdef EXF_LWDOWN_WITH_EMISSIVITY
255 C This is now [(1-emiss)*lwdown - lwdown]
256 lwdownLoc(I,J) = SEAICE_ice_emiss*lwdownLoc(I,J)
257 #else /* use the old hard wired inconsistent value */
258 lwdownLoc(I,J) = 0.97 _d 0*lwdownLoc(I,J)
259 #endif /* EXF_LWDOWN_WITH_EMISSIVITY */
260 ENDIF
261 ENDDO
262 ENDDO
263
264 DO J=1,sNy
265 DO I=1,sNx
266
267 C DECIDE ON ALBEDO
268 IF ( iceOrNot(I,J) ) THEN
269
270 IF ( YC(I,J,bi,bj) .LT. 0.0 _d 0 ) THEN
271 IF (tsurfLoc(I,J) .GE. SurfMeltTemp) THEN
272 ALB_ICE (I,J) = SEAICE_wetIceAlb_south
273 ALB_SNOW(I,J) = SEAICE_wetSnowAlb_south
274 ELSE ! no surface melting
275 ALB_ICE (I,J) = SEAICE_dryIceAlb_south
276 ALB_SNOW(I,J) = SEAICE_drySnowAlb_south
277 ENDIF
278 ELSE !/ Northern Hemisphere
279 IF (tsurfLoc(I,J) .GE. SurfMeltTemp) THEN
280 ALB_ICE (I,J) = SEAICE_wetIceAlb
281 ALB_SNOW(I,J) = SEAICE_wetSnowAlb
282 ELSE ! no surface melting
283 ALB_ICE (I,J) = SEAICE_dryIceAlb
284 ALB_SNOW(I,J) = SEAICE_drySnowAlb
285 ENDIF
286 ENDIF !/ Albedo for snow and ice
287
288 C If actual snow thickness exceeds the cutoff thickness, use snow albedo
289 IF (HSNOW_ACTUAL(I,J) .GT. HCUT) THEN
290 ALB(I,J) = ALB_SNOW(I,J)
291 ELSEIF ( HCUT.LE.ZERO ) THEN
292 ALB(I,J) = ALB_ICE(I,J)
293 ELSE
294 C otherwise, use linear transition between ice and snow albedo
295 ALB(I,J) = MIN( ALB_ICE(I,J) + HSNOW_ACTUAL(I,J)*recip_HCUT
296 & *(ALB_SNOW(I,J) -ALB_ICE(I,J))
297 & , ALB_SNOW(I,J) )
298 ENDIF
299
300 C Determine the fraction of shortwave radiative flux remaining
301 C at ocean interface after scattering through the snow and ice.
302 C If snow is present, no radiation penetrates through snow+ice
303 IF (HSNOW_ACTUAL(I,J) .GT. 0.0 _d 0) THEN
304 penetSWFrac = 0.0 _d 0
305 ELSE
306 penetSWFrac = XIO*EXP(-1.5 _d 0 * HICE_ACTUAL(I,J))
307 ENDIF
308 C The shortwave radiative flux leaving ocean beneath ice (+=up).
309 IcePenetSW(I,J) = -(1.0 _d 0 - ALB(I,J))
310 & *penetSWFrac * SWDOWN(I,J,bi,bj)
311 C The shortwave radiative flux convergence in the seaice.
312 absorbedSW(I,J) = (1.0 _d 0 - ALB(I,J))
313 & *(1.0 _d 0 - penetSWFrac)* SWDOWN(I,J,bi,bj)
314
315 C The effective conductivity of the two-layer snow/ice system.
316 C Set a minimum sea ice thickness of 5 cm to bound
317 C the magnitude of conductive heat fluxes.
318 Cif * now taken care of by SEAICE_hice_reg in seaice_growth
319 c hice_tmp = max(HICE_ACTUAL(I,J),5. _d -2)
320 effConduct(I,J) = XKI * XKS /
321 & (XKS * HICE_ACTUAL(I,J) + XKI * HSNOW_ACTUAL(I,J))
322
323 #ifdef SEAICE_DEBUG
324 IF ( (I .EQ. SEAICE_debugPointI) .AND.
325 & (J .EQ. SEAICE_debugPointJ) ) THEN
326 print '(A,i6)','-----------------------------------'
327 print '(A,i6)','ibi merged initialization ', myIter
328 print '(A,i6,4(1x,D24.15))',
329 & 'ibi iter, TSL, TS ',myIter,
330 & tsurfLoc(I,J), TSURF(I,J,bi,bj)
331 print '(A,i6,4(1x,D24.15))',
332 & 'ibi iter, TMELT ',myIter,TMELT
333 print '(A,i6,4(1x,D24.15))',
334 & 'ibi iter, HIA, EFKCON ',myIter,
335 & HICE_ACTUAL(I,J), effConduct(I,J)
336 print '(A,i6,4(1x,D24.15))',
337 & 'ibi iter, HSNOW ',myIter,
338 & HSNOW_ACTUAL(I,J), ALB(I,J)
339 print '(A,i6)','-----------------------------------'
340 print '(A,i6)','ibi energy balance iterat ', myIter
341 ENDIF
342 #endif /* SEAICE_DEBUG */
343
344 ENDIF !/* iceOrNot */
345 ENDDO !/* i */
346 ENDDO !/* j */
347
348 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
349 DO ITER=1,IMAX_TICE
350 DO J=1,sNy
351 DO I=1,sNx
352 #ifdef ALLOW_AUTODIFF_TAMC
353 iicekey = I + sNx*(J-1) + (ITER-1)*sNx*sNy
354 CADJ STORE tsurfLoc(i,j) = comlev1_solve4temp,
355 CADJ & key = iicekey, byte = isbyte
356 #endif /* ALLOW_AUTODIFF_TAMC */
357
358 C- save tsurf from previous iter
359 tsurfPrev(I,J) = tsurfLoc(I,J)
360 IF ( iceOrNot(I,J) ) THEN
361
362 t1 = tsurfLoc(I,J)
363 t2 = t1*t1
364 t3 = t2*t1
365 t4 = t2*t2
366
367 C-- Calculate the specific humidity in the BL above the snow/ice
368 IF ( useMaykutSatVapPoly ) THEN
369 C- Use the Maykut polynomial
370 qhice(I,J)=QS1*(C1*t4+C2*t3 +C3*t2+C4*t1+C5)
371 dqh_dTs(I,J) = 0. _d 0
372 ELSE
373 C- Use exponential relation approx., more accurate at low temperatures
374 C log 10 of the sat vap pressure
375 mm_log10pi = -aa1 / t1 + aa2
376 C The saturation vapor pressure (SVP) in the surface
377 C boundary layer (BL) above the snow/ice.
378 c mm_pi = TEN **(mm_log10pi)
379 C The following form does the same, but is faster
380 mm_pi = EXP(mm_log10pi*lnTEN)
381 qhice(I,J) = bb1*mm_pi/( Ppascals -(1.0 _d 0 - bb1)*mm_pi )
382 C A constant for SVP derivative w.r.t TICE
383 c cc3t = TEN **(aa1 / t1)
384 C The following form does the same, but is faster
385 cc3t = EXP(aa1 / t1 * lnTEN)
386 C d(qh)/d(TICE)
387 dqh_dTs(I,J) = cc1*cc3t/((cc2-cc3t*Ppascals)**2 *t2)
388 ENDIF
389
390 #ifdef ALLOW_AUTODIFF_TAMC
391 CADJ STORE tsurfLoc(i,j) = comlev1_solve4temp,
392 CADJ & key = iicekey, byte = isbyte
393 #endif /* ALLOW_AUTODIFF_TAMC */
394 C Calculate the flux terms based on the updated tsurfLoc
395 F_c(I,J) = effConduct(I,J)*(tempFrz(I,J)-tsurfLoc(I,J))
396 F_lh(I,J) = D1I*UG(I,J)*(qhice(I,J)-AQH(I,J,bi,bj))
397 #ifdef SEAICE_CAP_SUBLIM
398 C if the latent heat flux implied by tsurfLoc exceeds
399 C F_lh_max, cap F_lh and decouple the flux magnitude from TICE
400 IF (F_lh(I,J) .GT. F_lh_max(I,J)) THEN
401 F_lh(I,J) = F_lh_max(I,J)
402 dqh_dTs(I,J) = ZERO
403 ENDIF
404 #endif /* SEAICE_CAP_SUBLIM */
405
406 F_lwu(I,J) = t4 * D3(I,J)
407 F_sens(I,J)= D1 * UG(I,J) * (t1 - atempLoc(I,J))
408 F_ia(I,J) = -lwdownLoc(I,J) -absorbedSW(I,J) + F_lwu(I,J)
409 & + F_sens(I,J) + F_lh(I,J)
410 C d(F_ia)/d(Tsurf)
411 dFia_dTs(I,J) = 4.0 _d 0*D3(I,J)*t3 + D1*UG(I,J)
412 & + D1I*UG(I,J)*dqh_dTs(I,J)
413
414 #ifdef SEAICE_DEBUG
415 IF ( (I .EQ. SEAICE_debugPointI) .AND.
416 & (J .EQ. SEAICE_debugPointJ) ) THEN
417 print '(A,i6,4(1x,D24.15))',
418 & 'ice-iter qhICE, ', ITER,qhIce(I,J)
419 print '(A,i6,4(1x,D24.15))',
420 & 'ice-iter dFiDTs1 F_ia ', ITER,
421 & dFia_dTs(I,J)+effConduct(I,J), F_ia(I,J)-F_c(I,J)
422 ENDIF
423 #endif /* SEAICE_DEBUG */
424
425 C- Update tsurf as solution of : Fc = Fia + d/dT(Fia - Fc) *delta.tsurf
426 tsurfLoc(I,J) = tsurfLoc(I,J)
427 & + ( F_c(I,J)-F_ia(I,J) ) / ( effConduct(I,J)+dFia_dTs(I,J) )
428
429 #ifdef ALLOW_AUTODIFF_TAMC
430 CADJ STORE tsurfLoc(i,j) = comlev1_solve4temp,
431 CADJ & key = iicekey, byte = isbyte
432 #endif /* ALLOW_AUTODIFF_TAMC */
433 IF ( useMaykutSatVapPoly ) THEN
434 tsurfLoc(I,J) = MAX( celsius2K+MIN_TICE, tsurfLoc(I,J) )
435 ENDIF
436 C If the search leads to tsurfLoc < 50 Kelvin, restart the search
437 C at tsurfLoc = TMELT. Note that one solution to the energy balance problem
438 C is an extremely low temperature - a temperature far below realistic values.
439 c IF (tsurfLoc(I,J) .LT. 50.0 _d 0 ) tsurfLoc(I,J) = TMELT
440 C Comments & code above not relevant anymore (from older version, when
441 C trying Maykut-Polynomial & dqh_dTs > 0 ?): commented out
442 tsurfLoc(I,J) = MIN( tsurfLoc(I,J), TMELT )
443
444 #ifdef SEAICE_DEBUG
445 IF ( (I .EQ. SEAICE_debugPointI) .AND.
446 & (J .EQ. SEAICE_debugPointJ) ) THEN
447 print '(A,i6,4(1x,D24.15))',
448 & 'ice-iter tsurfLc,|dif|', ITER,
449 & tsurfLoc(I,J),
450 & LOG10(ABS(tsurfLoc(I,J) - t1))
451 ENDIF
452 #endif /* SEAICE_DEBUG */
453
454 ENDIF !/* iceOrNot */
455 ENDDO !/* i */
456 ENDDO !/* j */
457 ENDDO !/* Iterations */
458 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
459
460 DO J=1,sNy
461 DO I=1,sNx
462 IF ( iceOrNot(I,J) ) THEN
463
464 C Save updated tsurf and finalize the flux terms
465 TSURF(I,J,bi,bj) = tsurfLoc(I,J)
466
467 #ifdef SEAICE_MODIFY_GROWTH_ADJ
468 Cgf no additional dependency through solver, snow, etc.
469 IF ( SEAICEadjMODE.GE.2 ) THEN
470 CALL ZERO_ADJ_1D( 1, TSURF(I,J,bi,bj), myThid)
471 absorbedSW(I,J) = 0.3 _d 0 *SWDOWN(I,J,bi,bj)
472 IcePenetSW(I,J)= 0. _d 0
473 ENDIF
474 IF ( postSolvTempIter.EQ.2 .OR. SEAICEadjMODE.GE.2 ) THEN
475 t1 = TSURF(I,J,bi,bj)
476 #else /* SEAICE_MODIFY_GROWTH_ADJ */
477
478 IF ( postSolvTempIter.EQ.2 ) THEN
479 C Recalculate the fluxes based on the (possibly) adjusted TSURF
480 t1 = tsurfLoc(I,J)
481 #endif /* SEAICE_MODIFY_GROWTH_ADJ */
482 t2 = t1*t1
483 t3 = t2*t1
484 t4 = t2*t2
485
486 IF ( useMaykutSatVapPoly ) THEN
487 qhice(I,J)=QS1*(C1*t4+C2*t3 +C3*t2+C4*t1+C5)
488 ELSE
489 C log 10 of the sat vap pressure
490 mm_log10pi = -aa1 / t1 + aa2
491 C saturation vapor pressure
492 c mm_pi = TEN **(mm_log10pi)
493 C The following form does the same, but is faster
494 mm_pi = EXP(mm_log10pi*lnTEN)
495 C over ice specific humidity
496 qhice(I,J) = bb1*mm_pi/( Ppascals -(1.0 _d 0 - bb1)*mm_pi )
497 ENDIF
498 F_c(I,J) = effConduct(I,J) * (tempFrz(I,J) - t1)
499 F_lh(I,J) = D1I * UG(I,J)*(qhice(I,J)-AQH(I,J,bi,bj))
500 #ifdef SEAICE_CAP_SUBLIM
501 IF (F_lh(I,J) .GT. F_lh_max(I,J)) THEN
502 F_lh(I,J) = F_lh_max(I,J)
503 ENDIF
504 #endif /* SEAICE_CAP_SUBLIM */
505 F_lwu(I,J) = t4 * D3(I,J)
506 F_sens(I,J) = D1 * UG(I,J) * (t1 - atempLoc(I,J))
507 C The flux between the ice/snow surface and the atmosphere.
508 F_ia(I,J) = -lwdownLoc(I,J) -absorbedSW(I,J) + F_lwu(I,J)
509 & + F_sens(I,J) + F_lh(I,J)
510
511 ELSEIF ( postSolvTempIter.EQ.1 ) THEN
512 C Update fluxes (consistent with the linearized formulation)
513 delTsurf = tsurfLoc(I,J)-tsurfPrev(I,J)
514 F_c(I,J) = effConduct(I,J)*(tempFrz(I,J)-tsurfLoc(I,J))
515 F_ia(I,J) = F_ia(I,J) + dFia_dTs(I,J)*delTsurf
516 F_lh(I,J) = F_lh(I,J)
517 & + D1I*UG(I,J)*dqh_dTs(I,J)*delTsurf
518
519 c ELSEIF ( postSolvTempIter.EQ.0 ) THEN
520 C Take fluxes from last iteration
521
522 ENDIF
523
524 C Fresh water flux (kg/m^2/s) from latent heat of sublimation.
525 C F_lh is positive upward (sea ice looses heat) and FWsublim
526 C is also positive upward (atmosphere gains freshwater)
527 FWsublim(I,J) = F_lh(I,J)/lhSublim
528
529 #ifdef SEAICE_DEBUG
530 C Calculate the net ice-ocean and ice-atmosphere fluxes
531 IF (F_c(I,J) .GT. 0.0 _d 0) THEN
532 F_io_net = F_c(I,J)
533 F_ia_net = 0.0 _d 0
534 ELSE
535 F_io_net = 0.0 _d 0
536 F_ia_net = F_ia(I,J)
537 ENDIF !/* conductive fluxes up or down */
538
539 IF ( (I .EQ. SEAICE_debugPointI) .AND.
540 & (J .EQ. SEAICE_debugPointJ) ) THEN
541 print '(A)','----------------------------------------'
542 print '(A,i6)','ibi complete ', myIter
543 print '(A,4(1x,D24.15))',
544 & 'ibi T(SURF, surfLoc,atmos) ',
545 & TSURF(I,J,bi,bj), tsurfLoc(I,J),atempLoc(I,J)
546 print '(A,4(1x,D24.15))',
547 & 'ibi LWL ', lwdownLoc(I,J)
548 print '(A,4(1x,D24.15))',
549 & 'ibi QSW(Total, Penetrating)',
550 & SWDOWN(I,J,bi,bj), IcePenetSW(I,J)
551 print '(A,4(1x,D24.15))',
552 & 'ibi qh(ATM ICE) ',
553 & AQH(I,J,bi,bj),qhice(I,J)
554 print '(A,4(1x,D24.15))',
555 & 'ibi F(lwd,swi,lwu) ',
556 & -lwdownLoc(I,J), -absorbedSW(I,J), F_lwu(I,J)
557 print '(A,4(1x,D24.15))',
558 & 'ibi F(c,lh,sens) ',
559 & F_c(I,J), F_lh(I,J), F_sens(I,J)
560 #ifdef SEAICE_CAP_SUBLIM
561 IF (F_lh_max(I,J) .GT. ZERO) THEN
562 print '(A,4(1x,D24.15))',
563 & 'ibi F_lh_max, F_lh/lhmax) ',
564 & F_lh_max(I,J), F_lh(I,J)/ F_lh_max(I,J)
565 ELSE
566 print '(A,4(1x,D24.15))',
567 & 'ibi F_lh_max = ZERO! '
568 ENDIF
569 print '(A,4(1x,D24.15))',
570 & 'ibi FWsub, FWsubm*dT/rhoI ',
571 & FWsublim(I,J),
572 & FWsublim(I,J)*SEAICE_deltaTtherm/SEAICE_rhoICE
573 #endif /* SEAICE_CAP_SUBLIM */
574 print '(A,4(1x,D24.15))',
575 & 'ibi F_ia, F_ia_net, F_c ',
576 & F_ia(I,J), F_ia_net, F_c(I,J)
577 print '(A)','----------------------------------------'
578 ENDIF
579 #endif /* SEAICE_DEBUG */
580
581 ENDIF !/* iceOrNot */
582 ENDDO !/* i */
583 ENDDO !/* j */
584
585 #endif /* ALLOW_ATM_TEMP && ALLOW_DOWNWARD_RADIATION */
586 RETURN
587 END

  ViewVC Help
Powered by ViewVC 1.1.22