unifhy-org / unifhy

A Unified Framework for Hydrology
https://unifhy-org.github.io/unifhy
BSD 3-Clause "New" or "Revised" License
11 stars 5 forks source link

Calculate grid element areas and provide them to contributors #61

Closed ThibHlln closed 2 years ago

ThibHlln commented 2 years ago

The user can decide whether to use a spherical or a cartesian coordinate system. Depending on the type of coordinate system, a component contributor would not calculate the surface area of the grid elements in the same way, and they should not have to deal with this. The framework needs to offer to the contributor the grid element areas if they need them.

It will be trivial to calculate for a cartesian coordinate system, it will also be relatively simple to calculate for a spherical coordinate system (using ESMF). For more complicated geometries (e.g. unstructured grids, catchment polygons, etc.), a field could be provided in the same way as land_sea_mask and flow_direction are currently being provided by the user.