/[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.34 - (show annotations) (download)
Mon Mar 5 15:21:45 2012 UTC (12 years, 2 months ago) by gforget
Branch: MAIN
Changes since 1.33: +13 -10 lines
- merging SEAICE_MULTICATEGORY define and undef cases. Now the same code is compiled either
  way, and is tested in all exps (multidim was only tested in lab_sea ad before).
- cosmetic change to prepare for future addition of ITD. no change to results. no defaults change.
- by lack of adequate verification experiments, I further used custom versions of
  global_ocean.cs32x15 to test multicat or not, with pickup or not. All should be correct.

- details :
  - added SEAICE_multDim run time param to be able to switch from single to multi cat.
  - "ifdef SEAICE_MULTICATEGORY" switches are replaced with "IF (SEAICE_multDim.GT.1) THEN".
  - "DO IT=1,MULTDIM" is replaced with "DO IT=1,SEAICE_multDim" in seaice_growth.F. For pickups and
    initializations I kept full loops (did not want to mess with the somewhat funky TICE/TICES pickup logic).
  - homogeneize seaice_growth names (heffActualP->heffActualMult and latentHeatFluxMaxP->latentHeatFluxMaxMult).
  - in growth, add extra MULTDIM dimension in all relevant local fields (needed to simplify logic, and get taf to behave).
  - clean-up growth/solve4temp interface by adding ticeInMult (TSURFin entering solve4etmp)
  and ticeOutMult (TSURFout leaving solve4temp). update seaice_solve4temp accordingly.
  - avoid recomputations (added store directives and clear logic of solve4temp input/output).

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

  ViewVC Help
Powered by ViewVC 1.1.22