Skip to content

Commit

Permalink
update(Gridgen): added keyword arguments for smoothing_level_vertical…
Browse files Browse the repository at this point in the history
… and smoothing_level_horizontal (#1322)

Close #1317
  • Loading branch information
jlarsen-usgs committed Dec 29, 2021
1 parent c253bab commit e4efe8e
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions flopy/utils/gridgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,15 @@ class Gridgen:
If true, Gridgen's GRID_TO_USGDATA command will connect layers
where intermediate layers are inactive.
(default is False)
**kwargs
verical_smoothing_level : int
maximum level difference between two vertically adjacent cells.
Adjust with caution, as adjustments can cause unexpected results
to simulated flows
horizontal_smoothing_level : int
maximum level difference between two horizontally adjacent cells.
Adjust with caution, as adjustments can cause unexpected results
to simulated flows
Notes
-----
Expand All @@ -201,6 +210,7 @@ def __init__(
exe_name="gridgen",
surface_interpolation="replicate",
vertical_pass_through=False,
**kwargs,
):
self.dis = dis
if isinstance(dis, ModflowGwfdis):
Expand Down Expand Up @@ -241,6 +251,12 @@ def __init__(
if vertical_pass_through:
self.vertical_pass_through = "True"

self.smoothing_level_vertical = kwargs.pop(
"smoothing_level_vertical", 1
)
self.smoothing_level_horizontal = kwargs.pop(
"smoothing_level_horizontal", 1
)
# Set up a blank _active_domain list with None for each layer
self._addict = {}
self._active_domain = []
Expand Down Expand Up @@ -1855,6 +1871,8 @@ def _builder_block(self):
s += "\n"

s += " SMOOTHING = full\n"
s += f" SMOOTHING_LEVEL_VERTICAL = {self.smoothing_level_vertical}\n"
s += f" SMOOTHING_LEVEL_HORIZONTAL = {self.smoothing_level_horizontal}\n"

for k in range(self.nlay):
if self.surface_interpolation[k] == "ASCIIGRID":
Expand Down

0 comments on commit e4efe8e

Please sign in to comment.