Closed Aariq closed 1 year ago
Just for the record, I think it's pretty hard to work on this group of functions because read_*_files()
does some conversions and put_*_values()
does additional conversions and adds the units. I think it would be a lot simpler and easier to work on if the "read" and "put" steps were combined, but that would be a much bigger re-write than I'm already doing.
Ok, all tests are passing (not check()
though). I think the only thing left is to name the pft-level variables pulled from the monthly E files something standard and then deal with devtools::check()
issues.
Mainly tackling https://github.com/PecanProject/pecan/issues/2997. Likely fixing other issues and changing some behaviors along the way.
Description
begins
,ends
, andout
args input_E_values()
andput_T_values()
read_E_files()
read_E_files()
changed somewhat significantly: previously, variables were weighted by plant density in each cohort. This weighting has been removed. Instead, any variables in per-plant units are now converted to per area units using plant density.out
argument input_E_values()
pft
argument formodel2netcdf.ED2()
and theread_*_files()
functions to be a named numeric vector instead of the settings$pfts list. Ifsettings
is supplied, new helper functionextract_pfts(settings)
will return a named vector.put_E_values()
andput_T_values()
to unexported.Motivation and Context
Only a small number of variables were being read from monthly E files and put into the .nc files output by
model2netcdf.ED()
and they were not being converted to PEcAn standard. This PR adds more variables to that list and hopefully establishes some generalizable patterns for adding more variables in the future.Closes #2997
Review Time Estimate
Types of changes
Checklist: