Skip to content

Commit

Permalink
Hotfix for bug with no leafage current/previous/timestep for LAI when…
Browse files Browse the repository at this point in the history
… using .txt inputs.
  • Loading branch information
drnimbusrain committed Nov 15, 2023
1 parent 9d23a33 commit b13ccc1
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/canopy_calcs.F90
Original file line number Diff line number Diff line change
Expand Up @@ -575,6 +575,26 @@ SUBROUTINE canopy_calcs(nn)
end if
end if

!.......user option to calculate in-canopy leafage influence and assigning LAI as per timestep
if (leafage_opt .eq. 0) then
! Initialize pastlai and currentlai based on current timestep
if (nn .eq. 1) then
currentlai = lairef
pastlai = currentlai
else
pastlai = currentlai
currentlai = lairef
end if

!!! Check if the lai_tstep is greater than time_intvl
if (lai_tstep .ge. time_intvl) then
tsteplai = lai_tstep/86400.0_rk
else
WRITE (*, *) "Error: Input LAI time step cannot be less than model time step...exiting!!!"
CALL EXIT(1)
endif
end if !leafage_opt = 0 end

! ... user option to calculate in-canopy biogenic emissions
if (ifcanbio) then
if (cszref .ge. 0.0_rk .and. dswrfref .gt. 0.0_rk &
Expand Down

0 comments on commit b13ccc1

Please sign in to comment.