Skip to content

Commit

Permalink
Update forcing heights and restrict zeta to less than 20 for now
Browse files Browse the repository at this point in the history
  • Loading branch information
olyson committed Mar 21, 2022
1 parent e7579c9 commit 902f1cb
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 13 deletions.
11 changes: 10 additions & 1 deletion src/biogeophys/BareGroundFluxesMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,9 @@ subroutine BareGroundFluxes(bounds, num_noexposedvegp, filter_noexposedvegp, &
rh_ref2m_r => waterdiagnosticbulk_inst%rh_ref2m_r_patch , & ! Output: [real(r8) (:) ] Rural 2 m height surface relative humidity (%)
rh_ref2m => waterdiagnosticbulk_inst%rh_ref2m_patch , & ! Output: [real(r8) (:) ] 2 m height surface relative humidity (%)

forc_hgt_u_patch => frictionvel_inst%forc_hgt_u_patch , & ! Input:
forc_hgt_u_patch => frictionvel_inst%forc_hgt_u_patch , & ! Output: [real(r8) (:) ] observational height of wind at patch level [m]
forc_hgt_t_patch => frictionvel_inst%forc_hgt_t_patch , & ! Output: [real(r8) (:) ] observational height of temperature at patch level [m]
forc_hgt_q_patch => frictionvel_inst%forc_hgt_q_patch , & ! Output: [real(r8) (:) ] observational height of specific humidity at patch level [m]
u10_clm => frictionvel_inst%u10_clm_patch , & ! Input: [real(r8) (:) ] 10 m height winds (m/s)
zetamax => frictionvel_inst%zetamaxstable , & ! Input: [real(r8) ] max zeta value under stable conditions
z0mg_col => frictionvel_inst%z0mg_col , & ! Output: [real(r8) (:) ] roughness length, momentum [m]
Expand Down Expand Up @@ -359,6 +361,13 @@ subroutine BareGroundFluxes(bounds, num_noexposedvegp, filter_noexposedvegp, &
end select

z0qg_patch(p) = z0hg_patch(p)
! Update the forcing heights for new roughness lengths
! TODO(KWO, 2022-03-15) Only for Meier2022 for now to maintain bfb with ZengWang2007
if (z0param_method == 'Meier2022') then
forc_hgt_u_patch(p) = forc_hgt_u_patch(g) + z0mg_patch(p) + displa(p)
forc_hgt_t_patch(p) = forc_hgt_t_patch(g) + z0hg_patch(p) + displa(p)
forc_hgt_q_patch(p) = forc_hgt_q_patch(g) + z0qg_patch(p) + displa(p)
end if
thvstar = tstar*(1._r8+0.61_r8*forc_q(c)) + 0.61_r8*forc_th(c)*qstar
zeta = zldis(p)*vkc*grav*thvstar/(ustar(p)**2*thv(c))

Expand Down
7 changes: 6 additions & 1 deletion src/biogeophys/CanopyFluxesMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1393,7 +1393,12 @@ subroutine CanopyFluxes(bounds, num_exposedvegp, filter_exposedvegp,
if (zeta(p) >= 0._r8) then !stable
! remove stability cap when biomass heat storage is active
if(use_biomass_heat_storage) then
zeta(p) = min(100._r8,max(zeta(p),0.01_r8))
! TODO(KWO, 2022-03-15) Only for Meier2022 for now to maintain bfb with ZengWang2007
if (z0param_method == 'Meier2022') then
zeta(p) = min(20._r8,max(zeta(p),0.01_r8))
else
zeta(p) = min(100._r8,max(zeta(p),0.01_r8))
end if
else
zeta(p) = min(zetamax,max(zeta(p),0.01_r8))
endif
Expand Down
44 changes: 36 additions & 8 deletions src/biogeophys/FrictionVelocityMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -703,17 +703,17 @@ subroutine SetRoughnessLengthsAndForcHeightsNonLake(this, bounds, &
if (lun%itype(l) == istsoil .or. lun%itype(l) == istcrop) then
if (frac_veg_nosno(p) == 0) then
forc_hgt_u_patch(p) = forc_hgt_u(g) + z0mg(c) + displa(p)
forc_hgt_t_patch(p) = forc_hgt_t(g) + z0mg(c) + displa(p)
forc_hgt_q_patch(p) = forc_hgt_q(g) + z0mg(c) + displa(p)
forc_hgt_t_patch(p) = forc_hgt_t(g) + z0hg(c) + displa(p)
forc_hgt_q_patch(p) = forc_hgt_q(g) + z0qg(c) + displa(p)
else
forc_hgt_u_patch(p) = forc_hgt_u(g) + z0m(p) + displa(p)
forc_hgt_t_patch(p) = forc_hgt_t(g) + z0m(p) + displa(p)
forc_hgt_q_patch(p) = forc_hgt_q(g) + z0m(p) + displa(p)
forc_hgt_u_patch(p) = forc_hgt_u(g) + z0mv(p) + displa(p)
forc_hgt_t_patch(p) = forc_hgt_t(g) + z0hv(p) + displa(p)
forc_hgt_q_patch(p) = forc_hgt_q(g) + z0qv(p) + displa(p)
end if
else if (lun%itype(l) == istwet .or. lun%itype(l) == istice) then
forc_hgt_u_patch(p) = forc_hgt_u(g) + z0mg(c)
forc_hgt_t_patch(p) = forc_hgt_t(g) + z0mg(c)
forc_hgt_q_patch(p) = forc_hgt_q(g) + z0mg(c)
forc_hgt_u_patch(p) = forc_hgt_u(g) + z0mg(c) + displa(p)
forc_hgt_t_patch(p) = forc_hgt_t(g) + z0hg(c) + displa(p)
forc_hgt_q_patch(p) = forc_hgt_q(g) + z0qg(c) + displa(p)
else if (urbpoi(l)) then
forc_hgt_u_patch(p) = forc_hgt_u(g) + z_0_town(l) + z_d_town(l)
forc_hgt_t_patch(p) = forc_hgt_t(g) + z_0_town(l) + z_d_town(l)
Expand Down Expand Up @@ -893,6 +893,10 @@ subroutine FrictionVelocity(this, lbn, ubn, fn, filtern, &
zldis(n) = forc_hgt_u_patch(n)-displa(n)
end if
zeta(n) = zldis(n)/obu(n)
! TODO(KWO, 2022-03-15) Only for Meier2022 for now to maintain bfb with ZengWang2007
if (z0param_method == 'Meier2022') then
zeta(n) = min(20._r8,zldis(n)/obu(n))
end if
if (zeta(n) < -zetam) then
ustar(n) = vkc*um(n)/(log(-zetam*obu(n)/z0m(n))&
- this%StabilityFunc1(-zetam) &
Expand Down Expand Up @@ -992,6 +996,10 @@ subroutine FrictionVelocity(this, lbn, ubn, fn, filtern, &
zldis(n) = forc_hgt_t_patch(n)-displa(n)
end if
zeta(n) = zldis(n)/obu(n)
! TODO(KWO, 2022-03-15) Only for Meier2022 for now to maintain bfb with ZengWang2007
if (z0param_method == 'Meier2022') then
zeta(n) = min(20._r8,zldis(n)/obu(n))
end if
if (zeta(n) < -zetat) then
temp1(n) = vkc/(log(-zetat*obu(n)/z0h(n))&
- this%StabilityFunc2(-zetat) &
Expand All @@ -1016,6 +1024,10 @@ subroutine FrictionVelocity(this, lbn, ubn, fn, filtern, &
else
zldis(n) = forc_hgt_q_patch(pfti(n))-displa(n)
zeta(n) = zldis(n)/obu(n)
! TODO(KWO, 2022-03-15) Only for Meier2022 for now to maintain bfb with ZengWang2007
if (z0param_method == 'Meier2022') then
zeta(n) = min(20._r8,zldis(n)/obu(n))
end if
if (zeta(n) < -zetat) then
temp2(n) = vkc/(log(-zetat*obu(n)/z0q(n)) &
- this%StabilityFunc2(-zetat) &
Expand All @@ -1038,6 +1050,10 @@ subroutine FrictionVelocity(this, lbn, ubn, fn, filtern, &
else
zldis(n) = forc_hgt_q_patch(n)-displa(n)
zeta(n) = zldis(n)/obu(n)
! TODO(KWO, 2022-03-15) Only for Meier2022 for now to maintain bfb with ZengWang2007
if (z0param_method == 'Meier2022') then
zeta(n) = min(20._r8,zldis(n)/obu(n))
end if
if (zeta(n) < -zetat) then
temp2(n) = vkc/(log(-zetat*obu(n)/z0q(n)) &
- this%StabilityFunc2(-zetat) &
Expand All @@ -1060,6 +1076,10 @@ subroutine FrictionVelocity(this, lbn, ubn, fn, filtern, &

zldis(n) = 2.0_r8 + z0h(n)
zeta(n) = zldis(n)/obu(n)
! TODO(KWO, 2022-03-15) Only for Meier2022 for now to maintain bfb with ZengWang2007
if (z0param_method == 'Meier2022') then
zeta(n) = min(20._r8,zldis(n)/obu(n))
end if
if (zeta(n) < -zetat) then
temp12m(n) = vkc/(log(-zetat*obu(n)/z0h(n))&
- this%StabilityFunc2(-zetat) &
Expand All @@ -1083,6 +1103,10 @@ subroutine FrictionVelocity(this, lbn, ubn, fn, filtern, &
else
zldis(n) = 2.0_r8 + z0q(n)
zeta(n) = zldis(n)/obu(n)
! TODO(KWO, 2022-03-15) Only for Meier2022 for now to maintain bfb with ZengWang2007
if (z0param_method == 'Meier2022') then
zeta(n) = min(20._r8,zldis(n)/obu(n))
end if
if (zeta(n) < -zetat) then
temp22m(n) = vkc/(log(-zetat*obu(n)/z0q(n)) - &
this%StabilityFunc2(-zetat) + this%StabilityFunc2(z0q(n)/obu(n)) &
Expand Down Expand Up @@ -1111,6 +1135,10 @@ subroutine FrictionVelocity(this, lbn, ubn, fn, filtern, &
zldis(n) = forc_hgt_u_patch(n)-displa(n)
end if
zeta(n) = zldis(n)/obu(n)
! TODO(KWO, 2022-03-15) Only for Meier2022 for now to maintain bfb with ZengWang2007
if (z0param_method == 'Meier2022') then
zeta(n) = min(20._r8,zldis(n)/obu(n))
end if
if (min(zeta(n), 1._r8) < 0._r8) then
tmp1 = (1._r8 - 16._r8*min(zeta(n),1._r8))**0.25_r8
tmp2 = log((1._r8+tmp1*tmp1)/2._r8)
Expand Down
22 changes: 19 additions & 3 deletions src/biogeophys/LakeFluxesMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -380,9 +380,17 @@ subroutine LakeFluxes(bounds, num_lakec, filter_lakec, num_lakep, filter_lakep,

! Surface temperature and fluxes

forc_hgt_u_patch(p) = forc_hgt_u(g) + z0mg(p)
forc_hgt_t_patch(p) = forc_hgt_t(g) + z0mg(p)
forc_hgt_q_patch(p) = forc_hgt_q(g) + z0mg(p)
! Update forcing heights for updated roughness lengths
! TODO(KWO, 2022-03-15) Only for Meier2022 for now to maintain bfb with ZengWang2007
if (z0param_method == 'Meier2022') then
forc_hgt_u_patch(p) = forc_hgt_u(g) + z0mg(p)
forc_hgt_t_patch(p) = forc_hgt_t(g) + z0hg(p)
forc_hgt_q_patch(p) = forc_hgt_q(g) + z0qg(p)
else
forc_hgt_u_patch(p) = forc_hgt_u(g) + z0mg(p)
forc_hgt_t_patch(p) = forc_hgt_t(g) + z0mg(p)
forc_hgt_q_patch(p) = forc_hgt_q(g) + z0mg(p)
end if

! Find top layer
jtop(c) = snl(c) + 1
Expand Down Expand Up @@ -622,6 +630,14 @@ subroutine LakeFluxes(bounds, num_lakec, filter_lakec, num_lakep, filter_lakep,
z0qg(p) = z0hg(p)
end if

! Update forcing heights for updated roughness lengths
! TODO(KWO, 2022-03-15) Only for Meier2022 for now to maintain bfb with ZengWang2007
if (z0param_method == 'Meier2022') then
forc_hgt_u_patch(p) = forc_hgt_u(g) + z0mg(p)
forc_hgt_t_patch(p) = forc_hgt_t(g) + z0hg(p)
forc_hgt_q_patch(p) = forc_hgt_q(g) + z0qg(p)
end if

end do ! end of filtered pft loop

iter = iter + 1
Expand Down

0 comments on commit 902f1cb

Please sign in to comment.