Skip to content

Commit

Permalink
Completed conversion of diameter to height allometries to allow for s…
Browse files Browse the repository at this point in the history
…plitting of sapling and adult allometries.
  • Loading branch information
rgknox committed Sep 30, 2016
1 parent 11d7a27 commit c63afdb
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 28 deletions.
29 changes: 13 additions & 16 deletions EDAllomMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,6 @@ module EDAllomMod
! ============================================================================
! Parameter Checks and Defaults (subroutine)
! ============================================================================





! ============================================================================
Expand Down Expand Up @@ -171,12 +168,12 @@ subroutine h_allom(d,ipft,h,dhdd)
p1 = EDecophyscon%d2h1_sap(ipft)
p2 = EDecophyscon%d2h2_sap(ipft)
p3 = EDecophyscon%d2h3_sap(ipft)
hallom_mode = trim(EDecophyscon%hallom_sap_mode(ipft))
hallom_mode = EDecophyscon%hallom_sap_mode(ipft)
else
p1 = EDecophyscon%d2h1_ad(ipft)
p2 = EDecophyscon%d2h2_ad(ipft)
p3 = EDecophyscon%d2h3_ad(ipft)
hallom_mode = trim(EDecophyscon%hallom_ad_mode(ipft))
hallom_mode = EDecophyscon%hallom_ad_mode(ipft)
end if

select case(hallom_mode)
Expand All @@ -187,7 +184,7 @@ subroutine h_allom(d,ipft,h,dhdd)
case (3) ! "2parameter power function h=a*d^b "
call d2h_2pwr(d,p1,p2,dbh_hmax,h,dhdd)
case (4) ! "obrien"
call d2h_obrien(d,p1,p2,p3,dbh_hmax,h,dhdd)
call d2h_obrien(d,p1,p2,dbh_hmax,h,dhdd)
case (5) ! Martinez-Cano
call d2h_martcano(d,p1,p2,p3,h,dhdd)
case DEFAULT
Expand All @@ -204,17 +201,17 @@ subroutine h_allom(d,ipft,h,dhdd)
p1 = EDecophyscon%d2h1_sap(ipft)
p2 = EDecophyscon%d2h2_sap(ipft)
p3 = EDecophyscon%d2h3_sap(ipft)
hallom_mode = trim(EDecophyscon%hallom_sap_mode(ipft))
hallom_mode = EDecophyscon%hallom_sap_mode(ipft)

select case(hallom_mode)
case (1) !"chave14")
call d2h_chave2014(d_sap,p1,p2,p3,dbh_hmax,h_sap,dhdd_sap)
call d2h_chave2014(d_sap,p1,p2,p3,eclim,dbh_hmax,h_sap,dhdd_sap)
case (2) ! "poorter06")
call d2h_poorter2006(d_sap,p1,p2,p3,h_sap,dhdd_sap)
case (3) ! "2par_pwr")
call d2h_2pwr(d_sap,p1,p2,dbh_hmax,h_sap,dhdd_sap)
case (4) ! "obrien")
call d2h_obrien(d_sap,p1,p2,p3,dbh_hmax,h_sap,dhdd_sap)
call d2h_obrien(d_sap,p1,p2,dbh_hmax,h_sap,dhdd_sap)
case (5) ! Martinez-Cano
call d2h_martcano(d_sap,p1,p2,p3,h_sap,dhdd_sap)
case DEFAULT
Expand All @@ -225,17 +222,17 @@ subroutine h_allom(d,ipft,h,dhdd)
p1 = EDecophyscon%d2h1_ad(ipft)
p2 = EDecophyscon%d2h2_ad(ipft)
p3 = EDecophyscon%d2h3_ad(ipft)
hallom_mode = trim(EDecophyscon%hallom_ad_mode(ipft))
hallom_mode = EDecophyscon%hallom_ad_mode(ipft)

select case(hallom_mode)
case (1) !"chave14")
call d2h_chave2014(d_adult,p1,p2,p3,dbh_hmax,h_ad,dhdd_ad)
call d2h_chave2014(d_adult,p1,p2,p3,eclim,dbh_hmax,h_ad,dhdd_ad)
case (2) ! "poorter06")
call d2h_poorter2006(d_adult,p1,p2,p3,h_ad,dhdd_ad)
case (3) ! "2par_pwr")
call d2h_2pwr(d_adult,p1,p2,dbh_hmax,h_ad,dhdd_ad)
case (4) ! "obrien")
call d2h_obrien(d_adult,p1,p2,p3,dbh_hmax,h_ad,dhdd_ad)
call d2h_obrien(d_adult,p1,p2,dbh_hmax,h_ad,dhdd_ad)
case (5) ! Martinez-Cano
call d2h_martcano(d_adult,p1,p2,p3,h_ad,dhdd_ad)
case DEFAULT
Expand Down Expand Up @@ -786,7 +783,7 @@ end subroutine d2blmax_2pwr_hcap
! Diameter to height (D2H) functions
! =========================================================================

subroutine d2h_chave2014(d,p1,p2,p3,eclim,dbh_hmax,h,dhdd)
subroutine d2h_chave2014(d,p1,p2,p3,eclim,dbh_maxh,h,dhdd)

! "d2h_chave2014"
! "d to height via Chave et al. 2014"
Expand Down Expand Up @@ -825,8 +822,8 @@ subroutine d2h_chave2014(d,p1,p2,p3,eclim,dbh_hmax,h,dhdd)
real(r8),intent(in) :: p2 ! parameter b
real(r8),intent(in) :: p3 ! parameter c
real(r8),intent(in) :: eclim ! climatological parameter "E"
real(r8),intent(in) :: dbh_hmax ! dbh at maximum height [cm]

real(r8),intent(in) :: dbh_maxh ! dbh at maximum height [cm]
real(r8),intent(out) :: h ! plant height [m]
real(r8),intent(out) :: dhdd ! change in height per diameter [m/cm]

Expand Down Expand Up @@ -935,7 +932,7 @@ end subroutine d2h_poorter2006

! ===========================================================================

subroutine d2h_2pwr(d,p1,p2,dbh_hmax,h,dhdd)
subroutine d2h_2pwr(d,p1,p2,dbh_maxh,h,dhdd)

! =========================================================================
! "d2h_2pwr"
Expand Down
6 changes: 3 additions & 3 deletions allom_params.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
<sallom_mode> 1 </sallom_mode>
<latosa_int> 0.75 </latosa_int>
<latosa_slp> 0.0 </latosa_slp>
<d2h1_ad> 55.0 </d2h1_ad>
<d2h2_ad> 0.7 </d2h2_ad>
<d2h3_ad> 21.0 </d2h3_ad>
<d2h1_ad> 56.8 </d2h1_ad>
<d2h2_ad> 0.74 </d2h2_ad>
<d2h3_ad> 21.7 </d2h3_ad>
<d2h1_sap> 55.0 </d2h1_sap>
<d2h2_sap> 0.7 </d2h2_sap>
<d2h3_sap> 21.0 </d2h3_sap>
Expand Down
18 changes: 9 additions & 9 deletions drive_allomtests.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ def wait():

fig1 = plt.figure()
for ipft in range(numpft):
plt.plot(dbh[ipft,:],hi[ipft,:],label="".format(pftparms[ipft]['name']))
plt.plot(dbh[ipft,:],hi[ipft,:],label="{}".format(pftparms[ipft]['name']))
plt.legend(loc='lower right')
#plt.plot(np.transpose(dbh),np.transpose(hi))
plt.xlabel('diameter [cm]')
Expand All @@ -351,7 +351,7 @@ def wait():

fig1_1 = plt.figure()
for ipft in range(numpft):
plt.plot(hd[ipft,:],hi[ipft,:],label="pft{}".format(ipft+1))
plt.plot(hd[ipft,:],hi[ipft,:],label="{}".format(pftparms[ipft]['name']))
plt.legend(loc='lower right')
#plt.plot(np.transpose(dbh),np.transpose(hi))
plt.xlabel('height (diagnosed) [m]')
Expand All @@ -362,7 +362,7 @@ def wait():

fig1_2 = plt.figure()
for ipft in range(numpft):
plt.plot(dbh[ipft,:],dbhe[ipft,:],label="pft{}".format(ipft+1))
plt.plot(dbh[ipft,:],dbhe[ipft,:],label="{}".format(pftparms[ipft]['name']))
plt.legend(loc='lower right')
#plt.plot(np.transpose(dbh),np.transpose(hi))
plt.xlabel('diameter (specified) [cm]')
Expand All @@ -373,7 +373,7 @@ def wait():

fig2=plt.figure()
for ipft in range(numpft):
plt.plot(blmaxd[ipft,:],blmaxi[ipft,:],label="pft{}".format(ipft+1))
plt.plot(blmaxd[ipft,:],blmaxi[ipft,:],label="{}".format(pftparms[ipft]['name']))
plt.legend(loc='lower right')
#plt.plot(np.transpose(dbh),np.transpose(hi))
plt.xlabel('diagnosed [kgC]')
Expand All @@ -384,7 +384,7 @@ def wait():

fig3=plt.figure()
for ipft in range(numpft):
plt.plot(dbh[ipft,:],blmaxi[ipft,:],label="pft{}".format(ipft+1))
plt.plot(dbh[ipft,:],blmaxi[ipft,:],label="{}".format(pftparms[ipft]['name']))
plt.legend(loc='upper left')
#plt.plot(np.transpose(dbh),np.transpose(hi))
plt.xlabel('diameter [cm]')
Expand All @@ -399,8 +399,8 @@ def wait():
ax2 = fig4.add_subplot(1,2,2)
ax2.set_yscale('log')
for ipft in range(numpft):
ax1.plot(dbh[ipft,:],bagi[ipft,:],label="pft{}".format(ipft+1))
ax2.plot(dbh[ipft,:],bagi[ipft,:],label="pft{}".format(ipft+1))
ax1.plot(dbh[ipft,:],bagi[ipft,:],label="{}".format(pftparms[ipft]['name']))
ax2.plot(dbh[ipft,:],bagi[ipft,:],label="{}".format(pftparms[ipft]['name']))
plt.legend(loc='upper left')
plt.xlabel('diameter [cm]')
plt.ylabel('mass [kgC]')
Expand All @@ -412,7 +412,7 @@ def wait():
fig5=plt.figure()
for ipft in range(numpft):
gpmask = np.isfinite(blmax_o_dbagdh[ipft,:])
plt.plot(dbh[ipft,gpmask],blmax_o_dbagdh[ipft,gpmask],label="pft{}".format(ipft+1))
plt.plot(dbh[ipft,gpmask],blmax_o_dbagdh[ipft,gpmask],label="{}".format(pftparms[ipft]['name']))
plt.legend(loc='upper left')
plt.xlabel('diameter [cm]')
plt.ylabel('growth potential: bl/(dAGB/dh) [m]')
Expand All @@ -422,7 +422,7 @@ def wait():

fig6=plt.figure()
for ipft in range(numpft):
plt.plot(dbh[ipft,:],blmax_o_dbagdd[ipft,:],label="pft{}".format(ipft+1))
plt.plot(dbh[ipft,:],blmax_o_dbagdd[ipft,:],label="{}".format(pftparms[ipft]['name']))
plt.legend(loc='upper left')
plt.xlabel('diameter [cm]')
plt.ylabel('growth potential: bl/(dAGB/dd) [cm]')
Expand Down

0 comments on commit c63afdb

Please sign in to comment.