/[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.27 - (show annotations) (download)
Mon Feb 6 19:19:58 2012 UTC (12 years, 3 months ago) by jmc
Branch: MAIN
Changes since 1.26: +4 -21 lines
- remove un-used parameters LAD & MAX_TICE ; add new run-time parameters:
  useMaykutSatVapPoly (default=F), postSolvTempIter (default=2) and
  SEAICE_wetAlbTemp (default=-1e-3).
Temporary: change default (useMaykutSatVapPoly=T, postSolvTempIter=0)
  when SEAICE_SOLVE4TEMP_LEGACY is defined or (SEAICE_wetAlbTemp=0.,
  SEAICE_snowThick=0.) if SOLVE4TEMP_LEGACY is undef.

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

  ViewVC Help
Powered by ViewVC 1.1.22