If architecture as described in #961 is agreed on, we can create a converter for the DIS package.
For the Structured Discretization, the target grid is the smallest grid in the package.
Therefore the method from_imod5_package needs to be overloaded:
class StructuredDiscretization:
...
@classmethod
def from_imod5_package(cls, **data):
# Find smallest grid in data to regrid to
target = find_smallest_grid(data)
# Regrid to one consistent dataset
dataset = cls._regrid_like(target, **data)
# Add logic to prepare the dataset in the following way here:
# IBOUND -1 -> IDOMAIN = 1
# IBOUND -1 cells will be converted to CHD cells
dataset["idomain"] = dataset["idomain"].where(dataset["idomain"] > 0, 0)
# Thickness <= 0 -> IDOMAIN = -1
thickness = dataset["top"] - dataset["bottom"]
dataset["idomain"] = dataset["idomain"].where(thickness > 0, -1)
# TOP 3D -> TOP 2D
dataset["top"] = dataset["top"].sel(layer=1, drop=True)
return cls(**dataset)
If architecture as described in #961 is agreed on, we can create a converter for the DIS package. For the Structured Discretization, the target grid is the smallest grid in the package. Therefore the method
from_imod5_package
needs to be overloaded: