Reads a header from an LPJmL clm file. CLM is the default format used for LPJmL input files and can also be used for output files.
read_header(filename, force_version = NULL, verbose = TRUE)Filename to read header from.
Manually set clm version. The default value NULL means
that the version is determined automatically from the header. Set only if
the version number in the file header is incorrect.
If TRUE (the default), read_header provides some feedback
when using default values for missing parameters. If FALSE, only errors
are reported.
The function returns a list with 3 components:
name: Header name, e.g. "LPJGRID"; describes the type of data in the file.
header: Vector of header values ('version', 'order', 'firstyear', 'nyear', 'firstcell', 'ncell', 'nbands', 'cellsize_lon', 'scalar', 'cellsize_lat', 'datatype', 'nstep', 'timestep') describing the file structure. If header version is <4, the header is partially filled with default values.
endian: Endianness of file ("little" or "big").
create_header() for a more detailed description of the LPJmL header
format.
write_header() for writing headers to files.
if (FALSE) {
header <- read_header("filename.clm")
}