Skip to content

Commit

Permalink
Merge pull request #758 from rgknox/reduce-radloop-hifreq
Browse files Browse the repository at this point in the history
reduce loop bounds on hi-frequency radiation history updates
  • Loading branch information
rgknox authored Oct 11, 2021
2 parents 2edc895 + 8c8da99 commit 23705ed
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 @@ -3676,8 +3676,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 @@ -3750,11 +3750,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 23705ed

Please sign in to comment.