Skip to content

Commit

Permalink
Changed loop bounds in history writing to use actual rather than maxi…
Browse files Browse the repository at this point in the history
…mum canopy layers and leaf layers
  • Loading branch information
rgknox committed Jun 24, 2021
1 parent 64c557e commit 8c8da99
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions main/FatesHistoryInterfaceMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -3682,8 +3682,8 @@ subroutine update_history_hifrq(this,nc,nsites,sites,bc_in,dt_tstep)

! summarize radiation profiles through the canopy
do ipft=1,numpft
do ican=1,nclmax ! cpatch%ncl_p ?
do ileaf=1,nlevleaf ! cpatch%ncan(ican,ipft) ?
do ican=1,cpatch%ncl_p
do ileaf=1,cpatch%ncan(ican,ipft)
! calculate where we are on multiplexed dimensions
cnlfpft_indx = ileaf + (ican-1) * nlevleaf + (ipft-1) * nlevleaf * nclmax
cnlf_indx = ileaf + (ican-1) * nlevleaf
Expand Down Expand Up @@ -3756,11 +3756,12 @@ subroutine update_history_hifrq(this,nc,nsites,sites,bc_in,dt_tstep)
cpatch%fabi_sha_z(ican,ipft,1) * cpatch%area * AREA_INV
!
end do
end do
end do

! PFT-mean radiation profiles
do ican=1,nclmax
do ileaf=1,nlevleaf
do ican = 1, cpatch%ncl_p
do ileaf = 1, maxval(cpatch%nrad(ican,:))

! calculate where we are on multiplexed dimensions
cnlf_indx = ileaf + (ican-1) * nlevleaf
!
Expand Down

0 comments on commit 8c8da99

Please sign in to comment.