/[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.37 - (show annotations) (download)
Mon Oct 20 03:20:58 2014 UTC (9 years, 7 months ago) by gforget
Branch: MAIN
CVS Tags: checkpoint66g, checkpoint66f, checkpoint66e, checkpoint66d, checkpoint66c, checkpoint66b, checkpoint66a, checkpoint66o, checkpoint66n, checkpoint66m, checkpoint66l, checkpoint66k, checkpoint66j, checkpoint66i, checkpoint66h, checkpoint65z, checkpoint65x, checkpoint65y, checkpoint65r, checkpoint65s, checkpoint65p, checkpoint65q, checkpoint65v, checkpoint65w, checkpoint65t, checkpoint65u, checkpoint65j, checkpoint65k, checkpoint65h, checkpoint65i, checkpoint65n, checkpoint65o, checkpoint65l, checkpoint65m, checkpoint65g, HEAD
Changes since 1.36: +4 -1 lines
- ECCO_OPTIONS.h is needed when including ecco_cost.h, ecco.h
- AUTODIFF_OPTIONS.h is needed when including tamc.h, tamc_keys.h
- CTRL_OPTIONS.h is needed when including ctrl.h, etc

- pkg/seaice/seaice_cost*.F : clean up CPP brackets
- SEAICE_SIZE.h : replace ALLOW_AUTODIFF_TAMC with ALLOW_AUTODIFF to
  avoid needing AUTODIFF_OPTIONS.h anytime SEAICE_SIZE.h is included
  (it seems that THSICE_SIZE.h, PTRACERS_SIZE.h have the same issue...)

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

  ViewVC Help
Powered by ViewVC 1.1.22