Skip to content

Commit

Permalink
Some updates from @olyson that get more tests to work
Browse files Browse the repository at this point in the history
  • Loading branch information
ekluzek committed Mar 8, 2022
1 parent f0fe877 commit cf0934b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/biogeophys/BiogeophysPreFluxCalcsMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ subroutine SetZ0mDisp(bounds, num_nolakep, filter_nolakep, &
case ('Meier2022')

! Don't set on first few steps of a simulation, since htop isn't set yet, need to wait until after first do_alb time
if ( is_first_step() .or. get_nstep() <= GetBalanceCheckSkipSteps() ) then
if ( is_first_step() .or. get_nstep() <= GetBalanceCheckSkipSteps()-1 ) then
z0m(p) = 0._r8
displa(p) = 0._r8
cycle
Expand All @@ -190,7 +190,7 @@ subroutine SetZ0mDisp(bounds, num_nolakep, filter_nolakep, &
displa(p) = 0._r8

else
! Compute as if elai+esai = LAImax - LAIoff in CanopyFluxes
! Compute as if elai+esai = LAImax in CanopyFluxes
displa(p) = htop(p) * (1._r8 - (1._r8 - exp(-(7.5_r8 * (pftcon%z0v_LAImax(patch%itype(p))))**0.5_r8)) &
/ (7.5_r8*(pftcon%z0v_LAImax(patch%itype(p)) ))**0.5_r8)

Expand Down
14 changes: 12 additions & 2 deletions src/biogeophys/CanopyFluxesMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,12 @@ subroutine CanopyFluxes(bounds, num_exposedvegp, filter_exposedvegp,
soilbeta => soilstate_inst%soilbeta_col , & ! Input: [real(r8) (:) ] soil wetness relative to field capacity

u10_clm => frictionvel_inst%u10_clm_patch , & ! Input: [real(r8) (:) ] 10 m height winds (m/s)
forc_hgt_u_patch => frictionvel_inst%forc_hgt_u_patch , & ! Input: [real(r8) (:) ] observational height of wind at patch level [m]
forc_hgt_t => atm2lnd_inst%forc_hgt_t_grc , & ! Input: [real(r8) (:) ] observational height of temperature [m]
forc_hgt_u => atm2lnd_inst%forc_hgt_u_grc , & ! Input: [real(r8) (:) ] observational height of wind [m]
forc_hgt_q => atm2lnd_inst%forc_hgt_q_grc , & ! Input: [real(r8) (:) ] observational height of specific humidity [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]
forc_hgt_u_patch => frictionvel_inst%forc_hgt_u_patch , & ! Output: [real(r8) (:) ] observational height of wind at patch level [m]
z0mg => frictionvel_inst%z0mg_col , & ! Input: [real(r8) (:) ] roughness length of ground, momentum [m]
zetamax => frictionvel_inst%zetamaxstable , & ! Input: [real(r8) ] max zeta value under stable conditions
ram1 => frictionvel_inst%ram1_patch , & ! Output: [real(r8) (:) ] aerodynamical resistance (s/m)
Expand Down Expand Up @@ -877,7 +882,7 @@ subroutine CanopyFluxes(bounds, num_exposedvegp, filter_exposedvegp,
do f = 1, fn
p = filterp(f)
c = patch%column(p)

g = patch%gridcell(p)

select case (z0param_method)
case ('ZengWang2007')
Expand Down Expand Up @@ -913,6 +918,11 @@ subroutine CanopyFluxes(bounds, num_exposedvegp, filter_exposedvegp,
call endrun(msg = 'unknown z0param_method', additional_msg = errMsg(sourcefile, __LINE__))
end select

! Update the forcing heights
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)

z0hv(p) = z0mv(p)
z0qv(p) = z0mv(p)

Expand Down

0 comments on commit cf0934b

Please sign in to comment.