Skip to content

Commit

Permalink
another partial commit towards splitting adult and sapling allometry
Browse files Browse the repository at this point in the history
  • Loading branch information
rgknox committed Sep 29, 2016
1 parent 5dd2fc2 commit 11d7a27
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
18 changes: 11 additions & 7 deletions EDAllomMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,14 @@ subroutine h_allom(d,ipft,h,dhdd)
real(r8) :: h_ad
real(r8) :: dhdd_sap
real(r8) :: dhdd_ad

associate( d_adult => EDecophyscon%d_adult(ipft), &
d_sap => EDecophyscon%d_sap(ipft), &
dbh_hmax => EDecophyscon%dbh_hmax(ipft), &
real(r8) :: p1
real(r8) :: p2
real(r8) :: p3

associate( &
d_adult => EDecophyscon%d_adult(ipft), &
d_sap => EDecophyscon%d_sap(ipft), &
dbh_hmax => EDecophyscon%max_dbh(ipft), &
eclim => EDecophyscon%eclim(ipft) )

! --------------------------------------------------------------------------
Expand Down Expand Up @@ -190,7 +194,7 @@ subroutine h_allom(d,ipft,h,dhdd)
stop
end select

elseif
else

! ---------------------------------------------------------------------
! Interpolate between the two methods using a spline
Expand Down Expand Up @@ -886,7 +890,7 @@ subroutine d2h_chave2014(d,p1,p2,p3,eclim,dbh_hmax,h,dhdd)
dhdd = dhpdd*(1.0_r8-fl)

return
end associate

end subroutine d2h_chave2014

subroutine d2h_poorter2006(d,p1,p2,p3,h,dhdd)
Expand Down Expand Up @@ -973,7 +977,7 @@ subroutine d2h_2pwr(d,p1,p2,dbh_hmax,h,dhdd)
real(r8),intent(in) :: d ! plant diameter [cm]
real(r8),intent(in) :: p1 ! parameter a
real(r8),intent(in) :: p2 ! parameter b
real(r8),intent(in) :: dbh_hmax ! dbh where max height occurs [cm]
real(r8),intent(in) :: dbh_maxh ! dbh where max height occurs [cm]
real(r8),intent(out) :: h ! plant height [m]
real(r8),intent(out) :: dhdd ! change in height per diameter [m/cm]

Expand Down
4 changes: 2 additions & 2 deletions drive_allomtests.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ def wait():
else:
print('py: Could not find ',iv,' in the XML')
numpft += 1
plist.update({'name':elem.attrib['tag']})
pftparms.append(plist)


# ==============================================================================
# Load the fortran allometry library using python's ctypes library
# ==============================================================================
Expand Down Expand Up @@ -340,7 +340,7 @@ def wait():

fig1 = plt.figure()
for ipft in range(numpft):
plt.plot(dbh[ipft,:],hi[ipft,:],label="pft{}".format(ipft+1))
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 Down

0 comments on commit 11d7a27

Please sign in to comment.