diff --git a/src/canopy_app.F90 b/src/canopy_app.F90 index 07e0c7db..10a57864 100644 --- a/src/canopy_app.F90 +++ b/src/canopy_app.F90 @@ -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. diff --git a/src/canopy_calcs.F90 b/src/canopy_calcs.F90 index 226c689e..62748f03 100644 --- a/src/canopy_calcs.F90 +++ b/src/canopy_calcs.F90 @@ -1,5 +1,5 @@ -SUBROUTINE canopy_calcs +SUBROUTINE canopy_calcs(nn) !------------------------------------------------------------------------------- ! Name: Contains main canopy calculations dependent on canopy conditions @@ -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 @@ -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(*,*) '-------------------------------' @@ -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 &