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