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

Review restrictions on temporal and spatial resolutions across components #64

Closed ThibHlln closed 2 years ago

ThibHlln commented 2 years ago

In terms of time, the current implementation constrained the temporal resolutions (TimeDomain) across the three components of the model to be integer multiples of the fatest temporal resolution while covering the same simulation period. The motivation was to have the Clock ticking on one of the components' resolution. However, this has implications on the possible dumping frequency, which had to be the least common multiple across the three resolutions. If resolutions happen to be a bit convoluted, the dumping windows could end up being very scarce across the simulation period. Restartability being critical for complex models like LSMs, it was decided that we should constraint this more:

each component temporal resolution must be an integer multiple of the other components' resolutions (i.e. time steps of a domain must fully include or fully be included in time steps of the other domains)

In terms of space, the current implementation constrained the spatial extents (SpaceDomain) across the three components of the model to span the same geographical region, and by extension to be in the same coordinate system. The motivation was to avoid having to impose boundary conditions on some of the domains. This constraint is also desirable in a coupled configuration with an atmospheric model, where we need the land system to cover the same region as the atmospheric grid, since the land is a necessary boundary condition for the atmospheric processes. But unlike a coupling between the atmosphere and the ocean, which are both fluids (i.e. where a continuity assumption is acceptable), the coupling between the components within the land system is trickier because it is full of discontinuities (e.g. land cover, soil properties) so that the remapping method used should not rely on a continuity assumption (e.g. spline interpolation) because it is not in line with the physics and would result in breaking the conservation equation. This is why we need to introduce a supermesh. However, finding a way to construct the supermesh is not trivial (geometrical processing required). In the meantime, we can achieve what the supermesh achieves (i.e. avoids that a cell in one domain has area fractions in two different cells of another domain, which would require interpolation) by constraining the resolutions such that:

each component spatial resolution must be an integer multiple of the other components' resolutions (i.e. grid cells of a domain must fully include or fully be included in grid cells of the other domains)

This requires implementing checks for these constraints in Clock and Compass, for time and space, respectively. But also to modify the dummy examples for the testing suite, because they currently work on a daily/2daily/3daily and a 0.2deg/0.5deg/1deg, neither of which are compliant with these new constraints.