From bc92d868942236f0c45bd603dd91c42606f91bb3 Mon Sep 17 00:00:00 2001 From: Edoardo Paone Date: Mon, 12 Feb 2024 14:18:21 +0100 Subject: [PATCH] Fix for 0d fields (field slice with full indexing) --- .../tests/stencil_tests/test_face_val_ppm_stencil_01.py | 2 +- .../tests/stencil_tests/test_face_val_ppm_stencil_02.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/model/atmosphere/advection/tests/stencil_tests/test_face_val_ppm_stencil_01.py b/model/atmosphere/advection/tests/stencil_tests/test_face_val_ppm_stencil_01.py index b5ceb9b413..222a53e035 100644 --- a/model/atmosphere/advection/tests/stencil_tests/test_face_val_ppm_stencil_01.py +++ b/model/atmosphere/advection/tests/stencil_tests/test_face_val_ppm_stencil_01.py @@ -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) diff --git a/model/atmosphere/advection/tests/stencil_tests/test_face_val_ppm_stencil_02.py b/model/atmosphere/advection/tests/stencil_tests/test_face_val_ppm_stencil_02.py index bfa201e5e3..b9f27fb7fe 100644 --- a/model/atmosphere/advection/tests/stencil_tests/test_face_val_ppm_stencil_02.py +++ b/model/atmosphere/advection/tests/stencil_tests/test_face_val_ppm_stencil_02.py @@ -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(