-
Notifications
You must be signed in to change notification settings - Fork 240
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
model2netcdf.ED2()
only converts data for first PFT
#2974
Comments
There are already some sample output files in https://github.com/PecanProject/pecan/tree/develop/models/ed/tests/testthat/data, if those don't meet your needs - e.g. doesn't have multiple pfts, consider adding a (small) new one that does. |
I did eventually find those. I'll check tomorrow to see if one has multiple PFTs |
Try setting NL%ATTACH_METADATA to 1 for generating test data; otherwise the outputs and their dimensions are difficult to interpret. |
Looks like the current ED output in testthat/data doesn't work at all unfortunately and all tests are currently skipped. Might need help generating new test output. |
Related to #774? |
Won't fix until #1329 is (partially) dealt with. |
So I won't be able to get the tests working because this function is more broken than I can handle without downgrading my R version (see #2981). Should I go ahead and make a PR with the fix to line 954 anyway? |
Bug Description
I open one of the .h5 files output by ED2 and confirm that there are multiple PFTs listed, then run
model2netcdf.ED2()
wherepfts = settings$pfts
, and the resulting .ncvar file only lists the first PFT. The .nc file also only has data for one PFT. I think I tracked this down to this line, which would only read the first pft name.pecan/models/ed/R/model2netcdf.ED2.R
Line 954 in fbfcd2f
This should be something like
pft_names <-pfts %>% purrr::map(~.x[["name"]])
or whatever the base R equivalent is.To Reproduce
It can be reproduced with just one of the .h5 files output by ED2, but the example I'm using is on a server and I'm not sure how to share it. I put that single h5 file in a dir called "testing" and ran this:
Expected behavior
Should convert data for all PFTs
The text was updated successfully, but these errors were encountered: