Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

logic around test on hlm_pft_map test plus a couple other things #798

Merged
merged 1 commit into from
Oct 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions biogeochem/FatesAllometryMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1330,16 +1330,15 @@ subroutine d2blmax_2pwr(d,p1,p2,c2b,blmax,dblmaxdd)

! ======================================================================
! This is a power function for leaf biomass from plant diameter.
!
! log(bl) = a2 + b2*log(h)
! bl = exp(a2) * h**b2
! ======================================================================

! p1 and p2 represent the parameters that govern total beaf dry biomass,
! and the output argument blmax is the leaf carbon only

real(r8),intent(in) :: d ! plant diameter [cm]
real(r8),intent(in) :: p1 ! parameter 1 (slope)
real(r8),intent(in) :: p2 ! parameter 2 (curvature, exponent)
real(r8),intent(in) :: c2b ! carbon to biomass multiplier
real(r8),intent(in) :: c2b ! carbon to biomass multiplier (~2)

real(r8),intent(out) :: blmax ! plant leaf biomass [kgC]
real(r8),intent(out),optional :: dblmaxdd ! change leaf bio per diameter [kgC/cm]
Expand Down Expand Up @@ -1674,7 +1673,7 @@ subroutine dh2bagw_chave2014(d,h,dhdd,p1,p2,wood_density,c2b,bagw,dbagwdd)
real(r8),intent(in) :: p2 ! allometry parameter 2
real(r8),intent(in) :: wood_density
real(r8),intent(in) :: c2b
real(r8),intent(out) :: bagw ! plant height [m]
real(r8),intent(out) :: bagw ! plant aboveground biomass [kgC]
real(r8),intent(out),optional :: dbagwdd ! change in agb per diameter [kgC/cm]

real(r8) :: dbagwdd1,dbagwdd2,dbagwdd3
Expand Down Expand Up @@ -1730,10 +1729,10 @@ subroutine d2bagw_2pwr(d,p1,p2,c2b,bagw,dbagwdd)


real(r8),intent(in) :: d ! plant diameter [cm]
real(r8),intent(in) :: p1 ! allometry parameter 1
real(r8),intent(in) :: p2 ! allometry parameter 2
real(r8),intent(in) :: p1 ! allometry parameter 1
real(r8),intent(in) :: p2 ! allometry parameter 2
real(r8),intent(in) :: c2b ! carbon to biomass multiplier ~2
real(r8),intent(out) :: bagw ! plant height [m]
real(r8),intent(out) :: bagw ! plant aboveground biomass [kg C]
real(r8),intent(out),optional :: dbagwdd ! change in agb per diameter [kgC/cm]

bagw = (p1 * d**p2)/c2b
Expand Down
32 changes: 17 additions & 15 deletions main/EDPftvarcon.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1749,21 +1749,23 @@ subroutine FatesCheckParams(is_master)

end if

! check that the host-fates PFT map adds to one along HLM dimension so that all the HLM area
! goes to a FATES PFT. Each FATES PFT can get < or > 1 of an HLM PFT.
do hlm_pft = 1,size( EDPftvarcon_inst%hlm_pft_map,2)
sumarea = sum(EDPftvarcon_inst%hlm_pft_map(1:npft,hlm_pft))
if(abs(sumarea-1.0_r8).gt.nearzero)then
write(fates_log(),*) 'The distribution of this host land model PFT :',hlm_pft
write(fates_log(),*) 'into FATES PFTs, does not add up to 1.0.'
write(fates_log(),*) 'Error is:',sumarea-1.0_r8
write(fates_log(),*) 'and the hlm_pft_map is:', EDPftvarcon_inst%hlm_pft_map(1:npft,hlm_pft)
write(fates_log(),*) 'Aborting'
call endrun(msg=errMsg(sourcefile, __LINE__))
end if
end do !hlm_pft
end do !ipft

if( hlm_use_fixed_biogeog .eq. itrue ) then
! check that the host-fates PFT map adds to one along HLM dimension so that all the HLM area
! goes to a FATES PFT. Each FATES PFT can get < or > 1 of an HLM PFT.
do hlm_pft = 1,size( EDPftvarcon_inst%hlm_pft_map,2)
sumarea = sum(EDPftvarcon_inst%hlm_pft_map(1:npft,hlm_pft))
if(abs(sumarea-1.0_r8).gt.nearzero)then
write(fates_log(),*) 'The distribution of this host land model PFT :',hlm_pft
write(fates_log(),*) 'into FATES PFTs, does not add up to 1.0.'
write(fates_log(),*) 'Error is:',sumarea-1.0_r8
write(fates_log(),*) 'and the hlm_pft_map is:', EDPftvarcon_inst%hlm_pft_map(1:npft,hlm_pft)
write(fates_log(),*) 'Aborting'
call endrun(msg=errMsg(sourcefile, __LINE__))
end if
end do !hlm_pft
end if

end do !ipft

!! ! Checks for HYDRO
!! if( hlm_use_planthydro == itrue ) then
Expand Down
2 changes: 0 additions & 2 deletions main/EDTypesMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -529,8 +529,6 @@ module EDTypesMod

real(r8),allocatable :: fragmentation_scaler(:) ! Scale rate of litter fragmentation based on soil layer. 0 to 1.

real(r8) :: repro(maxpft) ! allocation to reproduction per PFT : KgC/m2

!FUEL CHARECTERISTICS
real(r8) :: sum_fuel ! total ground fuel related to ros (omits 1000hr fuels): KgC/m2
real(r8) :: fuel_frac(nfsc) ! fraction of each litter class in the ros_fuel:-.
Expand Down