Skip to content

Commit

Permalink
LEAFAGE merged with TIMEFEATURE (LAI across tsteps print diagnostics …
Browse files Browse the repository at this point in the history
…tested as well)
  • Loading branch information
quaz115 committed Sep 27, 2023
1 parent d7e4a6c commit 9cfd2d0
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/canopy_app.F90
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ program canopy_app
! Main canopy model calculations.
!-------------------------------------------------------------------------------

call canopy_calcs
call canopy_calcs(nn) !Adding time step for LAI inputs in GAMMA_LEAFAGE

!-------------------------------------------------------------------------------
! Write model output of canopy model calculations.
Expand Down
25 changes: 23 additions & 2 deletions src/canopy_calcs.F90
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

SUBROUTINE canopy_calcs
SUBROUTINE canopy_calcs(nn)

!-------------------------------------------------------------------------------
! Name: Contains main canopy calculations dependent on canopy conditions
Expand All @@ -26,6 +26,8 @@ SUBROUTINE canopy_calcs

IMPLICIT NONE

INTEGER, INTENT( IN ) :: nn ! Input time step

!Local variables
integer i,j,k,loc
! Empirical coeff.'s for Leaf Age factor calculations (see
Expand All @@ -35,10 +37,12 @@ SUBROUTINE canopy_calcs
REAL(rk) :: amat
REAL(rk) :: aold
REAL(rk) :: pastlai !Past LAI [cm2/cm2]
REAL(rk) :: currentlai ! Current LAI [cm2/cm2]
REAL(rk), save :: currentlai ! Current LAI [cm2/cm2] (saved from one timestep to the next)
REAL(rk) :: tsteplai !Number of days between the past and current LAI
!!REAL(rk) :: tabovecanopy ! Above Canopy Temp (assigned = tmp2mref ), done in canopy_bioemi_mod.F90



write(*,*) 'Calculating Canopy Parameters'
write(*,*) '-------------------------------'

Expand Down Expand Up @@ -220,6 +224,23 @@ SUBROUTINE canopy_calcs
end if
end if

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

! Print diagnostics for currentlai and pastlai at each timestep nn
print *, 'Timestep (nn):', nn, 'Current LAI:', currentlai, 'Past LAI:', pastlai

tsteplai = time_intvl/86400.0_rk !Convert timestep into days for biogenic leafage
end if


! ... 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 9cfd2d0

Please sign in to comment.