calc_cellarea: Calculate the cell area of LPJmL cells
Description
Calculate the cell area of LPJmL cells based on an LPJmLData
object or latitude coordinates and grid resolution.
Uses a spherical representation of the Earth.
A vector or array matching the space dimension(s) of x if x is an
LPJmLData object. A vector of the same length as x if x is a vector of
latitude coordinates. Cell areas are returned in the unit return_unit.
Arguments
x
LPJmLData object with $grid attribute, an LPJmLData object of
variable "grid" ("LPJGRID") or a vector of cell-center latitude
coordinates in degrees.
cellsize_lon
Grid resolution in longitude direction in degrees
(default: 0.5). If x is an LPJmLData object the resolution will be
taken from the meta data included in x if available.
cellsize_lat
Grid resolution in latitude direction in degrees (default:
same as cellsize_lon). If x is an LPJmLData object the resolution will be
taken from the meta data included in x if available.
earth_radius
Radius of the sphere (in \(m\)) used to calculate the
cell areas.
return_unit
Character string describing the area unit of the returned
cell areas. Defaults to "m2", further options: "ha" or "km2".