Skip to content

Commit

Permalink
better fix
Browse files Browse the repository at this point in the history
  • Loading branch information
OnnoEbbens committed Nov 13, 2023
1 parent 933758d commit e17085a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions nlmod/read/geotop.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import xarray as xr

from .. import NLMOD_DATADIR, cache
from ..dims.layers import insert_layer, remove_layer, fill_top_and_bottom
from ..dims.layers import insert_layer, remove_layer
from ..util import MissingValueError

logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -206,7 +206,6 @@ def to_model_layers(
ds.attrs["geulen"] = geulen

if "kh" in geotop_ds and "kv" in geotop_ds:
ds = fill_top_and_bottom(ds)
aggregate_to_ds(geotop_ds, ds, **kwargs)

# add atributes
Expand Down Expand Up @@ -580,7 +579,10 @@ def aggregate_to_ds(
if "layer" in top.dims:
top = top[0].drop_vars("layer")
else:
top = ds["botm"][ilay - 1].drop_vars("layer")
if "layer" in ds["top"].dims:
top = ds["top"][ilay].drop_vars("layer")
else:
top = ds["botm"][ilay - 1].drop_vars("layer")
bot = ds["botm"][ilay].drop_vars("layer")

gt_top = (gt["z"] + 0.25).broadcast_like(gt[kh_gt])
Expand Down

0 comments on commit e17085a

Please sign in to comment.