From 46a7e25bf79bef833a5b960e1f6160e585313bcc Mon Sep 17 00:00:00 2001 From: Cheng Li <69489965+chengcli@users.noreply.github.com> Date: Sun, 13 Oct 2024 13:39:37 -0400 Subject: [PATCH] fix bugs in netcdf and new_blockdt (#181) - fix new_blockdt - fix 3d netcdf output --- patches/21.new_blockdt.patch | 14 +++++++++++--- src/outputs/netcdf.cpp | 2 +- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/patches/21.new_blockdt.patch b/patches/21.new_blockdt.patch index 94a10ae1..f09570d2 100644 --- a/patches/21.new_blockdt.patch +++ b/patches/21.new_blockdt.patch @@ -1,11 +1,11 @@ diff --git a/src/hydro/new_blockdt.cpp b/src/hydro/new_blockdt.cpp -index 0dfe3b29..71e4f7aa 100644 +index c664de5d..9286f0d7 100644 --- a/src/hydro/new_blockdt.cpp +++ b/src/hydro/new_blockdt.cpp @@ -29,6 +29,10 @@ #include "hydro.hpp" #include "hydro_diffusion/hydro_diffusion.hpp" - + +// snap injection +#include +#include @@ -13,7 +13,15 @@ index 0dfe3b29..71e4f7aa 100644 // MPI/OpenMP header #ifdef MPI_PARALLEL #include -@@ -112,9 +116,21 @@ void Hydro::NewBlockTimeStep() { +@@ -82,6 +86,7 @@ void Hydro::NewBlockTimeStep() { + #pragma ivdep + for (int i=is; i<=ie; ++i) { + wi[IDN] = w(IDN,k,j,i); ++ for (int n=1; n 1) { for (int k = out_ks; k <= out_ke + 1; ++k) - data[k - out_ks] = (float)(pmb->pcoord->x1f(k)); + data[k - out_ks] = (float)(pmb->pcoord->x3f(k)); nc_put_var_float(ifile, ivx3f, data); }