Skip to content

Support for patch-level outputs #99

@hol430

Description

@hol430

The DAVE fork of LPJ-GUESS has patch-level outputs, which write one value/row per timestep per patch/stand. The stand/patch are disambiguated by columns patch and stand which contain the patch and stand IDs. Unfortunately, working with these outputs via DGVMTools is a bit tricky because patch and stand aren't treated as first class dimensions in the same way that Lon, Lat, Year, Month and Day are.

I encountered this problem when trying to use copyLayers() to merge two patch-level outputs. This function (and its friend getDimInfo()) has a list of dimensions hardcoded, which of course doesn't include my patch/stand columns. So when I have a file with multiple values per timestep (for a given gridcell), it throws an error.

The simple fix is to just update the list of dimensions in getDimInfo() and copyLayers() to include "stand" and "patch". The only problems that (I think) this could cause would be if someone had data columns called "stand" or "patch". E.g. if someone had a PFT called "patch" they might run into issues. But the same would already be true if you were to create a PFT called "Year" :).

Anyway, let me know if you're happy to have this in DGVMTools; if so, I'm happy to raise a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions