Skip to content

Commit

Permalink
bugfix to ensure rad profiles only calculated for PAR band, and also …
Browse files Browse the repository at this point in the history
…at level top
  • Loading branch information
ckoven committed Mar 9, 2018
1 parent 015a7a6 commit bc75808
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 29 deletions.
55 changes: 30 additions & 25 deletions biogeophys/EDSurfaceAlbedoMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,10 @@ subroutine ED_Norman_Radiation (nsites, sites, bc_in, bc_out )
currentPatch%fabi (:) = 0._r8

! zero diagnostic radiation profiles
currentPatch%nrmlzd_radprof_pft_dir_z(:,:,:,:) = 0._r8
currentPatch%nrmlzd_radprof_pft_dif_z(:,:,:,:) = 0._r8
currentPatch%nrmlzd_radprof_dir_z(:,:,:) = 0._r8
currentPatch%nrmlzd_radprof_dif_z(:,:,:) = 0._r8
currentPatch%nrmlzd_parprof_pft_dir_z(:,:,:,:) = 0._r8
currentPatch%nrmlzd_parprof_pft_dif_z(:,:,:,:) = 0._r8
currentPatch%nrmlzd_parprof_dir_z(:,:,:) = 0._r8
currentPatch%nrmlzd_parprof_dif_z(:,:,:) = 0._r8

if(bc_in(s)%filter_vegzen_pa(ifp))then

Expand Down Expand Up @@ -761,19 +761,24 @@ subroutine ED_Norman_Radiation (nsites, sites, bc_in, bc_out )
end if
end if

! pass normalized radiation profiles for use in diagnostic averaging for history fields
do iv = 1, currentPatch%nrad(L,ft)
currentPatch%nrmlzd_radprof_pft_dir_z(radtype,L,ft,iv) = forc_dir(ifp,ib) * tr_dir_z(L,ft,iv)
currentPatch%nrmlzd_radprof_pft_dif_z(radtype,L,ft,iv) = Dif_dn(L,ft,iv) + Dif_up(L,ft,iv+1)
!
currentPatch%nrmlzd_radprof_dir_z(radtype,L,iv) = currentPatch%nrmlzd_radprof_dir_z(radtype,L,iv) + &
(forc_dir(ifp,ib) * tr_dir_z(L,ft,iv)) * &
(ftweight(L,ft,iv) / sum(ftweight(L,1:numpft,iv)))
currentPatch%nrmlzd_radprof_dif_z(radtype,L,iv) = currentPatch%nrmlzd_radprof_dif_z(radtype,L,iv) + &
(Dif_dn(L,ft,iv) + Dif_up(L,ft,iv+1)) * &
(ftweight(L,ft,iv) / sum(ftweight(L,1:numpft,iv)))
end do

! pass normalized PAR profiles for use in diagnostic averaging for history fields
if (ib == 1) then ! only diagnose PAR profiles for the visible band
do iv = 1, currentPatch%nrad(L,ft)
currentPatch%nrmlzd_parprof_pft_dir_z(radtype,L,ft,iv) = &
forc_dir(ifp,ib) * tr_dir_z(L,ft,iv)
currentPatch%nrmlzd_parprof_pft_dif_z(radtype,L,ft,iv) = &
Dif_dn(L,ft,iv) + Dif_up(L,ft,iv)
!
currentPatch%nrmlzd_parprof_dir_z(radtype,L,iv) = &
currentPatch%nrmlzd_parprof_dir_z(radtype,L,iv) + &
(forc_dir(ifp,ib) * tr_dir_z(L,ft,iv)) * &
(ftweight(L,ft,iv) / sum(ftweight(L,1:numpft,iv)))
currentPatch%nrmlzd_parprof_dif_z(radtype,L,iv) = &
currentPatch%nrmlzd_parprof_dif_z(radtype,L,iv) + &
(Dif_dn(L,ft,iv) + Dif_up(L,ft,iv)) * &
(ftweight(L,ft,iv) / sum(ftweight(L,1:numpft,iv)))
end do
end if ! ib = visible
end if ! present
end do !ft
if (radtype == 1)then
Expand Down Expand Up @@ -1082,27 +1087,27 @@ subroutine ED_SunShadeFracs(nsites, sites,bc_in,bc_out)
do FT = 1,numpft
do iv = 1, cpatch%nrad(CL,ft)
cpatch%parprof_pft_dir_z(CL,FT,iv) = (bc_in(s)%solad_parb(ifp,ipar) * &
cpatch%nrmlzd_radprof_pft_dir_z(1,CL,FT,iv)) + &
cpatch%nrmlzd_parprof_pft_dir_z(1,CL,FT,iv)) + &
(bc_in(s)%solai_parb(ifp,ipar) * &
cpatch%nrmlzd_radprof_pft_dir_z(2,CL,FT,iv))
cpatch%nrmlzd_parprof_pft_dir_z(2,CL,FT,iv))
cpatch%parprof_pft_dif_z(CL,FT,iv) = (bc_in(s)%solad_parb(ifp,ipar) * &
cpatch%nrmlzd_radprof_pft_dif_z(1,CL,FT,iv)) + &
cpatch%nrmlzd_parprof_pft_dif_z(1,CL,FT,iv)) + &
(bc_in(s)%solai_parb(ifp,ipar) * &
cpatch%nrmlzd_radprof_pft_dif_z(2,CL,FT,iv))
cpatch%nrmlzd_parprof_pft_dif_z(2,CL,FT,iv))
end do ! iv
end do ! FT
end do ! CL

do CL = 1, cpatch%NCL_p
do iv = 1, maxval(cpatch%nrad(CL,:))
cpatch%parprof_dir_z(CL,iv) = (bc_in(s)%solad_parb(ifp,ipar) * &
cpatch%nrmlzd_radprof_dir_z(1,CL,iv)) + &
cpatch%nrmlzd_parprof_dir_z(1,CL,iv)) + &
(bc_in(s)%solai_parb(ifp,ipar) * &
cpatch%nrmlzd_radprof_dir_z(2,CL,iv))
cpatch%nrmlzd_parprof_dir_z(2,CL,iv))
cpatch%parprof_dif_z(CL,iv) = (bc_in(s)%solad_parb(ifp,ipar) * &
cpatch%nrmlzd_radprof_dif_z(1,CL,iv)) + &
cpatch%nrmlzd_parprof_dif_z(1,CL,iv)) + &
(bc_in(s)%solai_parb(ifp,ipar) * &
cpatch%nrmlzd_radprof_dif_z(2,CL,iv))
cpatch%nrmlzd_parprof_dif_z(2,CL,iv))
end do ! iv
end do ! CL

Expand Down
8 changes: 4 additions & 4 deletions main/EDTypesMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -328,13 +328,13 @@ module EDTypesMod
real(r8) :: f_sun(nclmax,maxpft,nlevleaf) ! fraction of leaves in the sun in each canopy layer, pft,

! radiation profiles for comparison against observations
real(r8) :: nrmlzd_radprof_pft_dir_z(2,nclmax,maxpft,nlevleaf) ! normalized direct radiation profiles by
real(r8) :: nrmlzd_parprof_pft_dir_z(2,nclmax,maxpft,nlevleaf) ! normalized direct photosynthetically active radiation profiles by
! incident type (direct/diffuse at top of canopy),leaf,pft,leaf (unitless)
real(r8) :: nrmlzd_radprof_pft_dif_z(2,nclmax,maxpft,nlevleaf) ! normalized diffuse radiation profiles by
real(r8) :: nrmlzd_parprof_pft_dif_z(2,nclmax,maxpft,nlevleaf) ! normalized diffuse photosynthetically active radiation profiles by
! incident type (direct/diffuse at top of canopy),leaf,pft,leaf (unitless)
real(r8) :: nrmlzd_radprof_dir_z(2,nclmax,nlevleaf) ! normalized direct radiation profiles by
real(r8) :: nrmlzd_parprof_dir_z(2,nclmax,nlevleaf) ! normalized direct photosynthetically active radiation profiles by
! incident type (direct/diffuse at top of canopy),leaf,leaf (unitless)
real(r8) :: nrmlzd_radprof_dif_z(2,nclmax,nlevleaf) ! normalized diffuse radiation profiles by
real(r8) :: nrmlzd_parprof_dif_z(2,nclmax,nlevleaf) ! normalized diffuse photosynthetically active radiation profiles by
! incident type (direct/diffuse at top of canopy),leaf,leaf (unitless)
real(r8) :: parprof_pft_dir_z(nclmax,maxpft,nlevleaf) ! direct-beam PAR profile through canopy, by canopy,PFT,leaf level (w/m2)
real(r8) :: parprof_pft_dif_z(nclmax,maxpft,nlevleaf) ! diffuse PAR profile through canopy, by canopy,PFT,leaf level (w/m2)
Expand Down

0 comments on commit bc75808

Please sign in to comment.