CCPP SciDoc v7.0.0  v7.0.0
Common Community Physics Package Developed at DTC
 
Loading...
Searching...
No Matches
sfc_sice.f
1
3
5 module sfc_sice
6
7 contains
8
37 subroutine sfc_sice_run &
38 & ( im, kice, sbc, hvap, tgice, cp, eps, epsm1, rvrdm1, grav, & ! --- inputs:
39 & t0c, rd, ps, t1, q1, delt, &
40 & sfcemis, dlwflx, sfcnsw, sfcdsw, srflag, &
41 & cm, ch, prsl1, prslki, prsik1, prslk1, wind, &
42 & flag_iter, use_lake_model, lprnt, ipr, thsfc_loc, &
43 & hice, fice, tice, weasd, tsfc_wat, tprcp, tiice, ep, & ! --- input/outputs:
44 & snwdph, qss_i, qss_w, snowmt, gflux, cmm, chh, &
45 & evapi, evapw, hflxi, hflxw, islmsk, &
46 & errmsg, errflg
47 & )
48
49! ===================================================================== !
50! description: !
51! !
52! usage: !
53! !
54! call sfc_sice !
55! inputs: !
56! ( im, kice, ps, t1, q1, delt, !
57! sfcemis, dlwflx, sfcnsw, sfcdsw, srflag, !
58! cm, ch, prsl1, prslki, prsik1, prslk1, wind, !
59! flag_iter, !
60! input/outputs: !
61! hice, fice, tice, weasd, tsfc_wat, tprcp, tiice, ep, !
62! outputs: !
63! snwdph, qsurf, snowmt, gflux, cmm, chh, evapi, evapw, !
64! hflxi, hflxw, ) !
65! !
66! subprogram called: ice3lay. !
67! !
84! !
85! !
86! ==================== defination of variables ==================== !
87! !
88! inputs: size !
89! im, kice - integer, horiz dimension and num of ice layers 1 !
90! ps - real, surface pressure im !
91! t1 - real, surface layer mean temperature ( k ) im !
92! q1 - real, surface layer mean specific humidity im !
93! delt - real, time interval (second) 1 !
94! sfcemis - real, sfc lw emissivity ( fraction ) im !
95! dlwflx - real, total sky sfc downward lw flux ( w/m**2 ) im !
96! sfcnsw - real, total sky sfc netsw flx into ground(w/m**2) im !
97! sfcdsw - real, total sky sfc downward sw flux ( w/m**2 ) im !
98! srflag - real, snow/rain fraction for precipitation im !
99! cm - real, surface exchange coeff for momentum (m/s) im !
100! ch - real, surface exchange coeff heat & moisture(m/s) im !
101! prsl1 - real, surface layer mean pressure im !
102! prslki - real, im !
103! prsik1 - real, im !
104! prslk1 - real, im !
105! islimsk - integer, sea/land/ice mask (=0/1/2) im !
106! wind - real, im !
107! flag_iter- logical, im !
108! use_lake_model- logical, true for lakes when when lkm > 0 im !
109! thsfc_loc- logical, reference pressure for potential temp im !
110! !
111! input/outputs: !
112! hice - real, sea-ice thickness im !
113! fice - real, sea-ice concentration im !
114! tice - real, sea-ice surface temperature im !
115! weasd - real, water equivalent accumulated snow depth (mm)im !
116! tskin - real, ground surface skin temperature ( k ) im !
117! tprcp - real, total precipitation im !
118! tiice - real, temperature of ice internal (k) im,kice !
119! ep - real, potential evaporation im !
120! !
121! outputs: !
122! snwdph - real, water equivalent snow depth (mm) im !
123! qsurf - real, specific humidity at sfc im !
124! snowmt - real, snow melt (m) im !
125! gflux - real, soil heat flux (w/m**2) im !
126! cmm - real, surface exchange coeff for momentum (m/s) im !
127! chh - real, surface exchange coeff heat&moisture (m/s) im !
128! evap - real, evaperation from latent heat flux im !
129! hflx - real, sensible heat flux im !
130! !
131! ===================================================================== !
132!
133 use machine, only : kind_phys
134 use funcphys, only : fpvs
135!
136 implicit none
137!
138! - Define constant parameters
139 integer, parameter :: kmi = 2
140 real(kind=kind_phys), parameter :: zero = 0.0_kind_phys, one = 1.0_kind_phys
141 real(kind=kind_phys), parameter :: himax = 8.0_kind_phys
142 real(kind=kind_phys), parameter :: himin = 0.1_kind_phys
143 real(kind=kind_phys), parameter :: hsmax = 2.0_kind_phys
144 real(kind=kind_phys), parameter :: timin = 173.0_kind_phys
145 real(kind=kind_phys), parameter :: albfw = 0.06_kind_phys
146 real(kind=kind_phys), parameter :: dsi = one/0.33_kind_phys
147 real(kind=kind_phys), parameter :: qmin = 1.0e-8_kind_phys
148
149! --- inputs:
150 integer, intent(in) :: im, kice, ipr
151 logical, intent(in) :: lprnt
152 logical, intent(in) :: thsfc_loc
153
154 real (kind=kind_phys), intent(in) :: sbc, hvap, tgice, cp, eps, &
155 & epsm1, grav, rvrdm1, t0c, rd
156
157 real (kind=kind_phys), dimension(:), intent(in) :: ps, &
158 & t1, q1, sfcemis, dlwflx, sfcnsw, sfcdsw, srflag, cm, ch, &
159 & prsl1, prslki, prsik1, prslk1, wind
160
161 integer, dimension(:), intent(in) :: islmsk
162 real (kind=kind_phys), intent(in) :: delt
163
164 logical, dimension(im), intent(in) :: flag_iter
165 integer, dimension(im), intent(in) :: use_lake_model
166
167! --- input/outputs:
168 real (kind=kind_phys), dimension(:), intent(inout) :: hice, &
169 & fice, tice, weasd, tsfc_wat, tprcp, ep
170
171 real (kind=kind_phys), dimension(:,:), intent(inout) :: tiice
172
173! --- outputs:
174 real (kind=kind_phys), dimension(:), intent(inout) :: snwdph, &
175 & snowmt, gflux, cmm, chh, evapi, evapw, hflxi, hflxw, &
176 & qss_i, qss_w
177
178 character(len=*), intent(out) :: errmsg
179 integer, intent(out) :: errflg
180
181! --- locals:
182 real (kind=kind_phys), dimension(im) :: ffw, &
183 & sneti, hfd, hfi, &
184! & hflxi, hflxw, sneti, snetw, qssi, qssw, hfd, hfi, hfw, &
185 & focn, snof, rch, rho, &
186 & snowd, theta1
187
188 real (kind=kind_phys) :: t12, t14, tem, stsice(im,kice)
189 &, q0, qs1, qssi, qssw
190 real (kind=kind_phys) :: cpinv, hvapi, elocp, snetw
191! real (kind=kind_phys) :: cpinv, hvapi, elocp, snetw, cimin
192 logical do_sice
193
194 integer :: i, k
195
196 logical :: flag(im)
197!
198!===> ... begin here
199!
200 cpinv = one/cp
201 hvapi = one/hvap
202 elocp = hvap/cp
203
204 ! Initialize CCPP error handling variables
205 errmsg = ''
206 errflg = 0
207!
209
210 do_sice = .false.
211 do i = 1, im
212 flag(i) = islmsk(i) == 2 .and. flag_iter(i) &
213 & .and. use_lake_model(i) /=1
214 do_sice = do_sice .or. flag(i)
215! if (flag_iter(i) .and. islmsk(i) < 2) then
216! hice(i) = zero
217! fice(i) = zero
218! endif
219 enddo
220 if (.not. do_sice) return
221
222 do i = 1, im
223 if (flag(i)) then
224 if (srflag(i) > zero) then
225 ep(i) = ep(i)*(one-srflag(i))
226 weasd(i) = weasd(i) + 1000.0_kind_phys*tprcp(i)*srflag(i)
227 tprcp(i) = tprcp(i)*(one-srflag(i))
228 endif
229 endif
230 enddo
231! --- ... update sea ice temperature
232
233 do k = 1, kice
234 do i = 1, im
235 if (flag(i)) then
236 stsice(i,k) = tiice(i,k)
237 endif
238 enddo
239 enddo
240
241! --- ... initialize variables. all units are supposedly m.k.s. unless specifie
242! psurf is in pascals, wind is wind speed, theta1 is adiabatic surface
243! temp from level 1, rho is density, qs1 is sat. hum. at level1 and qss
244! is sat. hum. at surface
245! convert slrad to the civilized unit from langley minute-1 k-4
246
247 do i = 1, im
248 if (flag(i)) then
249
250! dlwflx has been given a negative sign for downward longwave
251! sfcnsw is the net shortwave flux (direction: dn-up)
252
253 q0 = max(q1(i), qmin)
254
255 if (thsfc_loc) then ! Use local potential temperature
256 theta1(i) = t1(i) * prslki(i)
257 else ! Use potential temperature referenced to 1000 hPa
258 theta1(i) = t1(i) / prslk1(i) ! potential temperature in middle of lowest atm. layer
259 endif
260
261 rho(i) = prsl1(i) / (rd*t1(i)*(one+rvrdm1*q0))
262 qs1 = fpvs(t1(i))
263 qs1 = max(eps*qs1 / (prsl1(i) + epsm1*qs1), qmin)
264 q0 = min(qs1, q0)
265
266! if (fice(i) < cimin) then
267! print *,'warning: ice fraction is low:', fice(i)
268! fice(i) = cimin
269! tice(i) = tgice
270! tskin(i)= tgice
271! print *,'fix ice fraction: reset it to:', fice(i)
272! endif
273 ffw(i) = one - fice(i)
274
275 qssi = fpvs(tice(i))
276 qssi = eps*qssi / (ps(i) + epsm1*qssi)
277 qssw = fpvs(tgice)
278 qssw = eps*qssw / (ps(i) + epsm1*qssw)
279
281
282 snowd(i) = weasd(i) * 0.001_kind_phys
283! flagsnw(i) = .false.
284
285! --- ... when snow depth is less than 1 mm, a patchy snow is assumed and
286! soil is allowed to interact with the atmosphere.
287! we should eventually move to a linear combination of soil and
288! snow under the condition of patchy snow.
289
290! --- ... rcp = rho cp ch v
291
292 cmm(i) = cm(i) * wind(i)
293 chh(i) = rho(i) * ch(i) * wind(i)
294 rch(i) = chh(i) * cp
295
297
298 evapi(i) = elocp * rch(i) * (qssi - q0)
299 evapw(i) = elocp * rch(i) * (qssw - q0)
300
301 snetw = sfcdsw(i) * (one - albfw)
302 snetw = min(3.0_kind_phys*sfcnsw(i) &
303 & / (one+2.0_kind_phys*ffw(i)), snetw)
305 sneti(i) = (sfcnsw(i) - ffw(i)*snetw) / fice(i)
306
307 t12 = tice(i) * tice(i)
308 t14 = t12 * t12
309
311
312 if(thsfc_loc) then ! Use local potential temperature
313 hfi(i) = -dlwflx(i) + sfcemis(i)*sbc*t14 + evapi(i) &
314 & + rch(i)*(tice(i) - theta1(i))
315 else ! Use potential temperature referenced to 1000 hPa
316 hfi(i) = -dlwflx(i) + sfcemis(i)*sbc*t14 + evapi(i) &
317 & + rch(i)*(tice(i)/prsik1(i) - theta1(i))
318 endif
319
321 hfd(i) = 4.0_kind_phys*sfcemis(i)*sbc*tice(i)*t12 &
322 & + (one + elocp*eps*hvap*qs1/(rd*t12)) * rch(i)
323
324 t12 = tgice * tgice
325 t14 = t12 * t12
326
327! --- ... hfw = net heat flux @ water surface (within ice)
328
329! hfw(i) = -dlwflx(i) + sfcemis(i)*sbc*t14 + evapw(i) &
330! & + rch(i)*(tgice - theta1(i)) - snetw
331
334 focn(i) = 2.0_kind_phys ! heat flux from ocean - should be from ocn model
335 snof(i) = zero ! snowfall rate - snow accumulates in gbphys
336
338 hice(i) = max( min( hice(i), himax ), himin )
339 snowd(i) = min( snowd(i), hsmax )
340
341 if (snowd(i) > (2.0_kind_phys*hice(i))) then
342! print *, 'warning: too much snow :',snowd(i)
343 snowd(i) = hice(i) + hice(i)
344! print *,'fix: decrease snow depth to:',snowd(i)
345 endif
346 endif
347 enddo
348
350 call ice3lay
351! --- inputs: !
352 & ( im, kice, fice, flag, hfi, hfd, sneti, focn, delt, !
353 & lprnt, ipr,
354! --- outputs: !
355 & snowd, hice, stsice, tice, snof, snowmt, gflux ) !
356
357 do i = 1, im
358 if (flag(i)) then
359 if (tice(i) < timin) then
360 print *,'warning: snow/ice temperature is too low:',tice(i)
361 tice(i) = timin
362 print *,'fix snow/ice temperature: reset it to:',tice(i)
363 endif
364
365 if (stsice(i,1) < timin) then
366 print *,'warning: layer 1 ice temp is too low:',stsice(i,1)
367 stsice(i,1) = timin
368 print *,'fix layer 1 ice temp: reset it to:',stsice(i,1)
369 endif
370
371 if (stsice(i,2) < timin) then
372 print *,'warning: layer 2 ice temp is too low:',stsice(i,2)
373 stsice(i,2) = timin
374 print *,'fix layer 2 ice temp: reset it to:',stsice(i,2)
375 endif
376
377 endif
378 enddo
379
380 do k = 1, kice
381 do i = 1, im
382 if (flag(i)) then
383 tiice(i,k) = min(stsice(i,k), t0c)
384 endif
385 enddo
386 enddo
387
388 do i = 1, im
389 if (flag(i)) then
390! --- ... calculate sensible heat flux (& evap over sea ice)
391
392 if(thsfc_loc) then ! Use local potential temperature
393 hflxi(i) = rch(i) * (tice(i) - theta1(i))
394 hflxw(i) = rch(i) * (tgice - theta1(i))
395 else ! Use potential temperature referenced to 1000 hPa
396 tem = one / prsik1(i)
397 hflxi(i) = rch(i) * (tice(i)*tem - theta1(i))
398 hflxw(i) = rch(i) * (tgice*tem - theta1(i))
399 endif
400 tsfc_wat(i) = tgice
401
402! hflx(i) = fice(i)*hflxi + ffw(i)*hflxw
403! evap(i) = fice(i)*evapi(i) + ffw(i)*evapw(i)
404! tskin(i) = fice(i)*tice(i) + ffw(i)*tgice
405!
406! --- ... the rest of the output
407
408 qss_i(i) = q1(i) + evapi(i) / (elocp*rch(i))
409 qss_w(i) = q1(i) + evapw(i) / (elocp*rch(i))
410
411! qsurf(i) = q1(i) + evap(i) / (elocp*rch(i))
412
413! --- ... convert snow depth back to mm of water equivalent
414
415 weasd(i) = snowd(i) * 1000.0_kind_phys
416 snwdph(i) = weasd(i) * dsi ! snow depth in mm
417
418 tem = one / rho(i)
419 hflxi(i) = hflxi(i) * tem * cpinv
420 hflxw(i) = hflxw(i) * tem * cpinv
421 evapi(i) = evapi(i) * tem * hvapi
422 evapw(i) = evapw(i) * tem * hvapi
423
424! hflx(i) = hflx(i) * tem * cpinv
425! evap(i) = evap(i) * tem * hvapi
426 endif
427 enddo
428!
429 return
430!! @}
431
432! =================
433 contains
434! =================
435
436
437!-----------------------------------
441!\param[in] im integer, horizontal dimension
442!\param[in] kmi integer, number of ice layers (2)
443!\param[in] fice real, sea-ice concentration
444!\param[in] flag logical, ice mask flag
445!\param[in] hfi real, net non-solar and heat flux at surface (\f$W/m^2\f$)
446!\param[in] hfd real, heat flux derivative at surface
447!\param[in] sneti real, net solar incoming at top (\f$W/m^2\f$)
448!\param[in] focn real, heat flux from ocean (\f$W/m^2\f$)
449!\param[in] delt real, time step(\f$sec\f$)
450!\param[in,out] snowd real, snow depth
451!\param[in,out] hice real, sea-ice thickness
452!\param[in,out] stsice real, temperature at mid-point of ice levels (\f$^oC\f$)
453!\param[in,out] tice real, surface temperature (\f$^oC\f$)
454!\param[in,out] snof real, snowfall rate (\f$ms^{-1}\f$)
455!\param[out] snowmt real, snow melt during delt (\f$m\f$)
456!\param[out] gflux real, conductive heat flux (\f$W/m^2\f$)
459 subroutine ice3lay
460!...................................
461! --- inputs:
462 & ( im, kmi, fice, flag, hfi, hfd, sneti, focn, delt, &
463 & lprnt, ipr,
464! --- input/outputs:
465 & snowd, hice, stsice, tice, snof, &
466! --- outputs:
467 & snowmt, gflux &
468 & )
469
470!**************************************************************************
471! *
472! three-layer sea ice vertical thermodynamics *
473! *
474! based on: m. winton, "a reformulated three-layer sea ice model", *
475! journal of atmospheric and oceanic technology, 2000 *
476! *
477! *
478! -> +---------+ <- tice - diagnostic surface temperature ( <= 0c )*
479! / | | *
480! snowd | snow | <- 0-heat capacity snow layer *
481! \ | | *
482! => +---------+ *
483! / | | *
484! / | | <- t1 - upper 1/2 ice temperature; this layer has *
485! / | | a variable (t/s dependent) heat capacity *
486! hice |...ice...| *
487! \ | | *
488! \ | | <- t2 - lower 1/2 ice temp. (fixed heat capacity) *
489! \ | | *
490! -> +---------+ <- base of ice fixed at seawater freezing temp. *
491! *
492! ===================== defination of variables ===================== !
493! !
494! inputs: size !
495! im, kmi - integer, horiz dimension and num of ice layers 1 !
496! fice - real, sea-ice concentration im !
497! flag - logical, ice mask flag 1 !
498! hfi - real, net non-solar and heat flux @ surface(w/m^2) im !
499! hfd - real, heat flux derivatice @ sfc (w/m^2/deg-c) im !
500! sneti - real, net solar incoming at top (w/m^2) im !
501! focn - real, heat flux from ocean (w/m^2) im !
502! delt - real, timestep (sec) 1 !
503! !
504! input/outputs: !
505! snowd - real, surface pressure im !
506! hice - real, sea-ice thickness im !
507! stsice - real, temp @ midpt of ice levels (deg c) im,kmi!
508! tice - real, surface temperature (deg c) im !
509! snof - real, snowfall rate (m/sec) im !
510! !
511! outputs: !
512! snowmt - real, snow melt during delt (m) im !
513! gflux - real, conductive heat flux (w/m^2) im !
514! !
515! locals: !
516! hdi - real, ice-water interface (m) !
517! hsni - real, snow-ice (m) !
518! !
519! ======================================================================= !
520!
521
522! --- constant parameters: (properties of ice, snow, and seawater)
523 real (kind=kind_phys), parameter :: ds = 330.0_kind_phys
524 real (kind=kind_phys), parameter :: dw =1000.0_kind_phys
525 real (kind=kind_phys), parameter :: dsdw = ds/dw
526 real (kind=kind_phys), parameter :: dwds = dw/ds
527 real (kind=kind_phys), parameter :: ks = 0.31_kind_phys
528 real (kind=kind_phys), parameter :: i0 = 0.3_kind_phys
529 real (kind=kind_phys), parameter :: ki = 2.03_kind_phys
530 real (kind=kind_phys), parameter :: di = 917.0_kind_phys
531 real (kind=kind_phys), parameter :: didw = di/dw
532 real (kind=kind_phys), parameter :: dsdi = ds/di
533 real (kind=kind_phys), parameter :: ci = 2054.0_kind_phys
534 real (kind=kind_phys), parameter :: li = 3.34e5_kind_phys
535 real (kind=kind_phys), parameter :: si = 1.0_kind_phys
536 real (kind=kind_phys), parameter :: mu = 0.054_kind_phys
537 real (kind=kind_phys), parameter :: tfi = -mu*si
538 real (kind=kind_phys), parameter :: tfw = -1.8_kind_phys
539 real (kind=kind_phys), parameter :: tfi0 = tfi-0.0001_kind_phys
540 real (kind=kind_phys), parameter :: dici = di*ci
541 real (kind=kind_phys), parameter :: dili = di*li
542 real (kind=kind_phys), parameter :: dsli = ds*li
543 real (kind=kind_phys), parameter :: ki4 = ki*4.0_kind_phys
544 real (kind=kind_phys), parameter :: zero = 0.0_kind_phys, one = 1.0_kind_phys
545
546! --- inputs:
547 integer, intent(in) :: im, kmi, ipr
548 logical :: lprnt
549
550 real (kind=kind_phys), dimension(im), intent(in) :: fice, hfi, &
551 & hfd, sneti, focn
552
553 real (kind=kind_phys), intent(in) :: delt
554
555 logical, dimension(im), intent(in) :: flag
556
557! --- input/outputs:
558 real (kind=kind_phys), dimension(im), intent(inout) :: snowd, &
559 & hice, tice, snof
560
561 real (kind=kind_phys), dimension(im,kmi), intent(inout) :: stsice
562
563! --- outputs:
564 real (kind=kind_phys), dimension(im), intent(out) :: snowmt, &
565 & gflux
566
567! --- locals:
568
569 real (kind=kind_phys) :: dt2, dt4, dt6, h1, h2, dh, wrk, wrk1, &
570 & dt2i, hdi, hsni, ai, bi, a1, b1, a10, b10&
571 &, c1, ip, k12, k32, tsf, f1, tmelt, bmelt
572
573 integer :: i
574!
575!===> ... begin here
576!
577 dt2 = delt + delt
578 dt4 = dt2 + dt2
579 dt6 = dt2 + dt4
580 dt2i = one / dt2
581
582 do i = 1, im
583 if (flag(i)) then
584 snowd(i) = snowd(i) * dwds
585 hdi = (dsdw*snowd(i) + didw*hice(i))
586
587 if (hice(i) < hdi) then
588 snowd(i) = snowd(i) + hice(i) - hdi
589 hsni = (hdi - hice(i)) * dsdi
590 hice(i) = hice(i) + hsni
591 endif
592
593 snof(i) = snof(i) * dwds
594 tice(i) = tice(i) - t0c ! convert from K to C
595 stsice(i,1) = min(stsice(i,1)-t0c, tfi0) ! degc
596 stsice(i,2) = min(stsice(i,2)-t0c, tfi0) ! degc
597
598 ip = i0 * sneti(i) ! ip +v (in winton ip=-i0*sneti as sol -v)
599 if (snowd(i) > zero) then
600 tsf = zero
601 ip = zero
602 else
603 tsf = tfi
604 ip = i0 * sneti(i) ! ip +v here (in winton ip=-i0*sneti)
605 endif
606 tice(i) = min(tice(i), tsf)
607
609
610 bi = hfd(i)
611 ai = hfi(i) - sneti(i) + ip - tice(i)*bi ! +v sol input here
615 k12 = ki4*ks / (ks*hice(i) + ki4*snowd(i))
616
619 k32 = (ki+ki) / hice(i)
620
621 wrk = one / (dt6*k32 + dici*hice(i))
622 a10 = dici*hice(i)*dt2i + k32*(dt4*k32 + dici*hice(i))*wrk
623 b10 = -di*hice(i) * (ci*stsice(i,1) + li*tfi/stsice(i,1)) &
624 & * dt2i - ip &
625 & - k32*(dt4*k32*tfw + dici*hice(i)*stsice(i,2)) * wrk
626
627 wrk1 = k12 / (k12 + bi)
628 a1 = a10 + bi * wrk1
629 b1 = b10 + ai * wrk1
630 c1 = dili * tfi * dt2i * hice(i)
631
634 stsice(i,1) = -(sqrt(b1*b1-4.0_kind_phys*a1*c1) + b1)/(a1+a1)
635 tice(i) = (k12*stsice(i,1) - ai) / (k12 + bi)
636
644 if (tice(i) > tsf) then
645 a1 = a10 + k12
646 b1 = b10 - k12*tsf
647 stsice(i,1) = -(sqrt(b1*b1-4.0_kind_phys*a1*c1) + b1) &
648 & / (a1+a1)
649 tice(i) = tsf
650 tmelt = (k12*(stsice(i,1)-tsf) - (ai+bi*tsf)) * delt
651 else
652 tmelt =zero
653 snowd(i) = snowd(i) + snof(i)*delt
654 endif
657 stsice(i,2) = (dt2*k32*(stsice(i,1) + tfw + tfw) &
658 & + dici*hice(i)*stsice(i,2)) * wrk
659
664 bmelt = (focn(i) + ki4*(stsice(i,2) - tfw)/hice(i)) * delt
665
667
668 h1 = 0.5_kind_phys * hice(i)
669 h2 = 0.5_kind_phys * hice(i)
670
672
673 if (tmelt <= snowd(i)*dsli) then
674 snowmt(i) = tmelt / dsli
675 snowd(i) = snowd(i) - snowmt(i)
676 else
677 snowmt(i) = snowd(i)
678 h1 = max(zero, h1 - (tmelt - snowd(i)*dsli) &
679 & / (di * (ci - li/stsice(i,1)) * (tfi - stsice(i,1))))
680 snowd(i) = zero
681 endif
682
683! --- ... and bottom
687 if (bmelt < zero) then
688 dh = -bmelt / (dili + dici*(tfi - tfw))
689 stsice(i,2) = (h2*stsice(i,2) + dh*tfw) / (h2 + dh)
690 h2 = h2 + dh
691 else
692 h2 = h2 - bmelt / (dili + dici*(tfi - stsice(i,2)))
693 endif
694 h2 = max(h2, zero)
695
698
699 hice(i) = h1 + h2
700
701 if (hice(i) > zero) then
702 if (h1 > 0.5_kind_phys*hice(i)) then
703 f1 = one - (h2+h2) / hice(i)
704 stsice(i,2) = f1 * (stsice(i,1) + li*tfi/(ci*stsice(i,1)))&
705 & + (one - f1)*stsice(i,2)
706
707 if (stsice(i,2) > tfi) then
708 hice(i) = hice(i) - h2*ci*(stsice(i,2) - tfi)/ (li*delt)
709 stsice(i,2) = tfi
710 endif
711 else
712 f1 = (h1+h1) / hice(i)
713 stsice(i,1) = f1 * (stsice(i,1) + li*tfi/(ci*stsice(i,1)))&
714 & + (one - f1)*stsice(i,2)
715 stsice(i,1) = (stsice(i,1) - sqrt(stsice(i,1)*stsice(i,1) &
716 & - 4.0_kind_phys*tfi*li/ci)) * 0.5_kind_phys
717 endif
718
719 k12 = ki4*ks / (ks*hice(i) + ki4*snowd(i))
720 gflux(i) = k12 * (stsice(i,1) - tice(i))
721 else
722 snowd(i) = snowd(i) + (h1*(ci*(stsice(i,1) - tfi) &
723 & - li*(one - tfi/stsice(i,1))) &
724 & + h2*(ci*(stsice(i,2) - tfi) - li)) / li
725
726 hice(i) = max(zero, snowd(i)*dsdi)
727 snowd(i) = zero
728 stsice(i,1) = tfw
729 stsice(i,2) = tfw
730 gflux(i) = zero
731 endif ! end if_hice_block
732
733 gflux(i) = fice(i) * gflux(i)
734 snowmt(i) = snowmt(i) * dsdw
735 snowd(i) = snowd(i) * dsdw
736 tice(i) = tice(i) + t0c
737 stsice(i,1) = stsice(i,1) + t0c
738 stsice(i,2) = stsice(i,2) + t0c
739 endif ! end if_flag_block
740 enddo ! end do_i_loop
741
742 return
743!...................................
744 end subroutine ice3lay
746!-----------------------------------
747
748! =========================== !
749! end contain programs !
750! =========================== !
751
752!...................................
753 end subroutine sfc_sice_run
754!-----------------------------------
756 end module sfc_sice
subroutine sfc_sice_run(im, kice, sbc, hvap, tgice, cp, eps, epsm1, rvrdm1, grav, t0c, rd, ps, t1, q1, delt, sfcemis, dlwflx, sfcnsw, sfcdsw, srflag, cm, ch, prsl1, prslki, prsik1, prslk1, wind, flag_iter, use_lake_model, lprnt, ipr, thsfc_loc, hice, fice, tice, weasd, tsfc_wat, tprcp, tiice, ep, snwdph, qss_i, qss_w, snowmt, gflux, cmm, chh, evapi, evapw, hflxi, hflxw, islmsk, errmsg, errflg
Definition sfc_sice.f:47
subroutine ice3lay
This subroutine is the entity of three-layer sea ice vertical thermodynamics based on Winton(2000) wi...
Definition sfc_sice.f:460
This module contains the CCPP-compliant GFS sea ice scheme.
Definition sfc_sice.f:5