From 5ecabac4e89173f3fa76e28a9250f76e487080c8 Mon Sep 17 00:00:00 2001 From: John Omotani Date: Thu, 12 Sep 2024 22:24:18 +0100 Subject: [PATCH] Fix output of neutral source terms --- moment_kinetics/src/file_io.jl | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/moment_kinetics/src/file_io.jl b/moment_kinetics/src/file_io.jl index 614caede7..3b02b6b7e 100644 --- a/moment_kinetics/src/file_io.jl +++ b/moment_kinetics/src/file_io.jl @@ -2707,23 +2707,24 @@ function write_neutral_moments_data_to_binary(scratch, moments, n_neutral_specie append_to_dynamic_var(io_moments.thermal_speed_neutral, moments.neutral.vth, t_idx, parallel_io, z, r, n_neutral_species) if io_moments.external_source_neutral_amplitude !== nothing + n_sources = size(moments.neutral.external_source_amplitude)[3] append_to_dynamic_var(io_moments.external_source_neutral_amplitude, moments.neutral.external_source_amplitude, t_idx, - parallel_io, z, r) + parallel_io, z, r, n_sources) if moments.evolve_density append_to_dynamic_var(io_moments.external_source_neutral_density_amplitude, moments.neutral.external_source_density_amplitude, - t_idx, parallel_io, z, r) + t_idx, parallel_io, z, r, n_sources) end if moments.evolve_upar append_to_dynamic_var(io_moments.external_source_neutral_momentum_amplitude, moments.neutral.external_source_momentum_amplitude, - t_idx, parallel_io, z, r) + t_idx, parallel_io, z, r, n_sources) end if moments.evolve_ppar append_to_dynamic_var(io_moments.external_source_neutral_pressure_amplitude, moments.neutral.external_source_pressure_amplitude, - t_idx, parallel_io, z, r) + t_idx, parallel_io, z, r, n_sources) end end if io_moments.external_source_neutral_controller_integral !== nothing