Skip to content

Commit 7e8f38e

Browse files
committed
hdf5 halo: store in kji order only in 3d
1 parent 60ce20a commit 7e8f38e

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

libmpdata++/output/hdf5.hpp

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -411,11 +411,15 @@ namespace libmpdataxx
411411
space.selectHyperslab(H5S_SELECT_SET, shape_h.data(), offst_h.data());
412412
sspace_mem_h.selectHyperslab(H5S_SELECT_SET, shape_h.data(), offst_mem_h.data());
413413

414-
// convert from kij to kji storage order
415-
typename solver_t::arr_t kji_arr(shape_h);
416-
kji_arr = arr;
417-
418-
aux.write(kji_arr.data(), flttype_solver, sspace_mem_h, space, dxpl_id);
414+
// in 3D convert from kij to kji storage order
415+
if(parent_t::n_dims == 3)
416+
{
417+
typename solver_t::arr_t kji_arr(shape_h);
418+
kji_arr = arr;
419+
aux.write(kji_arr.data(), flttype_solver, sspace_mem_h, space, dxpl_id);
420+
}
421+
else
422+
aux.write(arr.data(), flttype_solver, sspace_mem_h, space, dxpl_id);
419423
}
420424

421425
void record_scalar_hlpr(const std::string &name, const std::string &group_name, typename solver_t::real_t data, H5::H5File hdf)

0 commit comments

Comments
 (0)