Skip to content

Commit

Permalink
Fix for 0d fields (field slice with full indexing)
Browse files Browse the repository at this point in the history
  • Loading branch information
edopao committed Feb 12, 2024
1 parent a32640c commit bc92d86
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,6 @@ def input_data(self, grid):
p_cc = random_field(grid, CellDim, KDim, extend={KDim: 1})
p_cellhgt_mc_now = random_field(grid, CellDim, KDim, extend={KDim: 1})
k = as_field((KDim,), np.arange(0, _shape(grid, KDim, extend={KDim: 1})[0], dtype=int32))
elev = k[-2]
elev = k[-2].as_scalar()

return dict(p_cc=p_cc, p_cellhgt_mc_now=p_cellhgt_mc_now, k=k, elev=elev, z_slope=z_slope)
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def input_data(self, grid):
k = as_field((KDim,), np.arange(0, _shape(grid, KDim)[0], dtype=int32))
slev = int32(1)
slevp1 = slev + int32(1)
elev = k[-3]
elev = int32(k[-3].as_scalar())
elevp1 = elev + int32(1)

return dict(
Expand Down

0 comments on commit bc92d86

Please sign in to comment.