@@ -60,7 +60,7 @@ subroutine sfc_diff_run (im,rvrdm1,eps,epsm1,grav, & !intent(in)
6060 & sigmaf,vegtype,shdmax,ivegsrc, & !intent(in)
6161 & z0pert,ztpert, & ! mg, sfc-perts !intent(in)
6262 & flag_iter,redrag, & !intent(in)
63- & flag_lakefreeze, & !intent(in)
63+ & flag_lakefreeze,lakefrac,fice, & !intent(in)
6464 & u10m,v10m,sfc_z0_type, & !hafs,z0 type !intent(in)
6565 & u1,v1,usfco,vsfco,icplocn2atm, &
6666 & wet,dry,icy, & !intent(in)
@@ -106,6 +106,8 @@ subroutine sfc_diff_run (im,rvrdm1,eps,epsm1,grav, & !intent(in)
106106 & ps,t1,q1,z1,garea,prsl1,prslki,prsik1,prslk1, &
107107 & wind,sigmaf,shdmax, &
108108 & z0pert,ztpert ! mg, sfc-perts
109+ real(kind=kind_phys), dimension(:), intent(in) :: lakefrac
110+ real(kind=kind_phys), dimension(:), intent(in) :: fice
109111 real(kind=kind_phys), dimension(:), intent(in) :: &
110112 & tskin_wat, tskin_lnd, tskin_ice, &
111113 & tsurf_wat, tsurf_lnd, tsurf_ice
@@ -340,7 +342,7 @@ subroutine sfc_diff_run (im,rvrdm1,eps,epsm1,grav, & !intent(in)
340342! --- outputs:
341343 & rb_ice(i), fm_ice(i), fh_ice(i), fm10_ice(i), fh2_ice(i),
342344 & cm_ice(i), ch_ice(i), stress_ice(i), ustar_ice(i))
343- endif ! Icy points
345+ endif ! Icy points
344346
345347! BWG: Everything from here to end of subroutine was after
346348! the stuff now put into "stability"
@@ -364,20 +366,8 @@ subroutine sfc_diff_run (im,rvrdm1,eps,epsm1,grav, & !intent(in)
364366 windrel=sqrt((u1(i)-usfco(i))**2+(v1(i)-vsfco(i))**2)
365367 endif
366368
367- if (sfc_z0_type == -1) then ! using wave model derived momentum roughness
368- tem1 = 0.11 * vis / ustar_wat(i)
369- z0 = tem1 + 0.01_kp * z0rl_wav(i)
370-
371- if (redrag) then
372- z0max = max(min(z0, z0s_max),1.0e-7_kp)
373- else
374- z0max = max(min(z0,0.1_kp), 1.0e-7_kp)
375- endif
376- z0rl_wat(i) = 100.0_kp * z0max ! cm
377- else
378- z0 = 0.01_kp * z0rl_wat(i)
379- z0max = max(zmin, min(z0,z1(i)))
380- endif
369+ z0 = 0.01_kp * z0rl_wat(i)
370+ z0max = max(zmin, min(z0,z1(i)))
381371!
382372!** test xubin' s new z0
383373
@@ -416,52 +406,51 @@ subroutine sfc_diff_run (im,rvrdm1,eps,epsm1,grav, & !intent(in)
416406!
417407! update z0 over ocean
418408!
419- if (sfc_z0_type >= 0 ) then
420- if (sfc_z0_type == 0 ) then
421- ! z0 = (charnock / grav) * ustar_wat(i) * ustar_wat(i)
422- tem1 = 0.11 * vis / ustar_wat(i)
423- z0 = tem1 + (charnock/ grav)* ustar_wat(i)* ustar_wat(i)
409+ if ((sfc_z0_type == - 1 ) .and.
410+ & (lakefrac(i) == 0.0 .and. fice(i) == 0.0 ) .and.
411+ & (z0rl_wav(i)>1.0e-7_kp .and. z0rl_wav(i)<0.1_kp )) then
412+ ! using wave model derived momentum roughness
413+ tem1 = 0.11 * vis / ustar_wat(i)
414+ z0 = tem1 + 0.01_kp * z0rl_wav(i)
415+
416+ if (redrag) then
417+ z0rl_wat(i) = 100.0_kp * max (min (z0,z0s_max),1.0e-7_kp )
418+ else
419+ z0rl_wat(i) = 100.0_kp * max (min (z0,0.1_kp ), 1.e-7_kp )
420+ endif
421+
422+ elseif ((sfc_z0_type == 0 ) .or.
423+ & ((sfc_z0_type == - 1 ) .and.
424+ & (z0rl_wav(i)<= 1.0e-7_kp .or. z0rl_wav(i)>= 0.1_kp ))) then
425+ ! z0 = (charnock / grav) * ustar_wat(i) * ustar_wat(i)
426+ tem1 = 0.11 * vis / ustar_wat(i)
427+ z0 = tem1 + (charnock/ grav)* ustar_wat(i)* ustar_wat(i)
424428
425429
426430! mbek -- toga- coare flux algorithm
427- ! z0 = (charnock / grav) * ustar(i)* ustar(i) + arnu/ ustar(i)
431+ ! z0 = (charnock / grav) * ustar(i)* ustar(i) + arnu/ ustar(i)
428432! new implementation of z0
429- ! cc = ustar(i) * z0 / rnu
430- ! pp = cc / (1 . + cc)
431- ! ff = grav * arnu / (charnock * ustar(i) ** 3 )
432- ! z0 = arnu / (ustar(i) * ff ** pp)
433-
434- if (redrag) then
435- z0rl_wat(i) = 100.0_kp * max (min (z0, z0s_max), &
436- & 1.0e-7_kp )
437- else
438- z0rl_wat(i) = 100.0_kp * max (min (z0,0.1_kp ), 1.e-7_kp )
439- endif
440-
441- elseif (sfc_z0_type == 6 ) then ! wang
442- call znot_m_v6(wind10m, z0) ! wind, m/ s, z0, m
443- z0rl_wat(i) = 100.0_kp * z0 ! cm
444- elseif (sfc_z0_type == 7 ) then ! wang
445- call znot_m_v7(wind10m, z0) ! wind, m/ s, z0, m
446- z0rl_wat(i) = 100.0_kp * z0 ! cm
433+ ! cc = ustar(i) * z0 / rnu
434+ ! pp = cc / (1 . + cc)
435+ ! ff = grav * arnu / (charnock * ustar(i) ** 3 )
436+ ! z0 = arnu / (ustar(i) * ff ** pp)
437+
438+ if (redrag) then
439+ z0rl_wat(i) = 100.0_kp * max (min (z0,z0s_max),1.0e-7_kp )
447440 else
448- z0rl_wat(i) = 1.0e-4_kp
441+ z0rl_wat(i) = 100.0_kp * max ( min (z0, 0.1_kp ), 1.e-7_kp )
449442 endif
450443
451- elseif (z0rl_wav(i) <= 1.0e-7_kp .or.
452- & z0rl_wav(i) > 1.0_kp ) then
453- ! z0 = (charnock / grav) * ustar_wat(i) * ustar_wat(i)
454- tem1 = 0.11 * vis / ustar_wat(i)
455- z0 = tem1 + (charnock/ grav)* ustar_wat(i)* ustar_wat(i)
456-
457- if (redrag) then
458- z0rl_wat(i) = 100.0_kp * max (min (z0, z0s_max),1.0e-7_kp )
459- else
460- z0rl_wat(i) = 100.0_kp * max (min (z0,0.1_kp ), 1.0e-7_kp )
461- endif
462-
444+ elseif (sfc_z0_type == 6 ) then ! wang
445+ call znot_m_v6(wind10m, z0) ! wind, m/ s, z0, m
446+ z0rl_wat(i) = 100.0_kp * z0 ! cm
447+ elseif (sfc_z0_type == 7 ) then ! wang
448+ call znot_m_v7(wind10m, z0) ! wind, m/ s, z0, m
449+ z0rl_wat(i) = 100.0_kp * z0 ! cm
450+ else
451+ z0rl_wat(i) = 1.0e-4_kp
463452 endif
464-
453+ !
465454 endif ! end of if (open ocean)
466455!
467456 endif ! end of if (flagiter) loop
0 commit comments