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.
calc_cellarea(
x,
cellsize_lon = 0.5,
cellsize_lat = cellsize_lon,
earth_radius = 6371000.785,
return_unit = "m2"
)LPJmLData object with $grid attribute, an LPJmLData object of
variable "grid" ("LPJGRID") or a vector of cell-center latitude
coordinates in degrees.
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.
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.
Radius of the sphere (in \(m\)) used to calculate the cell areas.
Character string describing the area unit of the returned
cell areas. Defaults to "m2", further options: "ha" or "km2".
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.