Function to add a grid to an LPJmLData object. The function acts
as a read_io() wrapper for the grid file and adds it as an
LPJmLData object itself to the $grid attribute of the main object.
add_grid(x, ...)LPJmLData object.
Arguments passed to read_io(). Without any arguments,
add_grid() will search for a file name starting with "grid" in the same
directory that x was loaded from. This supports grid files in "meta"
and "clm" format. If the grid file is in "raw" format or should be
loaded from a different directory, supply all necessary read_io()
parameters.
A copy of x (LPJmLData object) with added $grid attribute.
Important:
if (FALSE) {
# Read in vegetation carbon data with meta file
vegc <- read_io(filename = "./vegc.bin.json")
# Add grid as attribute (via grid file in output directory)
vegc_with_grid <- add_grid(vegc)
}