imod.prepare.allocate_rch_cells#

imod.prepare.allocate_rch_cells(allocation_option: ALLOCATION_OPTION, active: DataArray | UgridDataArray, rate: DataArray | UgridDataArray, drop_empty_layers: bool = True) → DataArray | UgridDataArray[source]#

Allocate recharge cells from a planar grid across the vertical dimension. Multiple options are available, which can be selected in ALLOCATION_OPTION.

Parameters:
  • allocation_option (ALLOCATION_OPTION) – Chosen allocation option, can be selected using the ALLOCATION_OPTION enumerator.

  • active (DataArray | UgridDataArray) – Boolean array containing active model cells. For Modflow 6, this is the equivalent of idomain > 0.

  • rate (DataArray | UgridDataArray) – Array with recharge rates. This will only be used to infer where recharge cells are defined.

  • drop_empty_layers (bool, default True) – If True, drop layers that contain no allocated cells anywhere in the domain (or at any time), so the returned grids only span the layers that are actually used. Reduces memory use and speeds up later operations such as regridding, clipping and splitting. If no cells are allocated in any layer, nothing is dropped and the full layer range is returned, as a layer dimension of size 0 is not valid. Note that allocation and conductance distribution are always computed over the full layer range first, so dropping layers does not change the computed values.

Returns:

Allocated recharge cells

Return type:

DataArray | UgridDataArray

Examples

>>> from imod.prepare.topsystem import ALLOCATION_OPTION, allocate_rch_cells
>>> setting = ALLOCATION_OPTION.at_first_active
>>> allocated = allocate_rch_cells(setting, active, rate)