From f3157256a2f914402e95a5925d6833404d81937c Mon Sep 17 00:00:00 2001 From: Loren Matilsky Date: Tue, 11 Jun 2024 14:00:06 -0700 Subject: [PATCH] Update Diagnostics_Thermal_Equation.F90 There was a bug in the heat flux (1433) calculation because tmp1d was allocated, but never initialized to zero. Often it would be zero and so the code would run fine, but occasionally NaNs were output in 1433. The initialization should fix this issue. --- src/Diagnostics/Diagnostics_Thermal_Equation.F90 | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Diagnostics/Diagnostics_Thermal_Equation.F90 b/src/Diagnostics/Diagnostics_Thermal_Equation.F90 index 015f07ba..0577b889 100644 --- a/src/Diagnostics/Diagnostics_Thermal_Equation.F90 +++ b/src/Diagnostics/Diagnostics_Thermal_Equation.F90 @@ -917,6 +917,7 @@ Subroutine Compute_Thermal_HeatSource(buffer) !The "Flux" associated with the volume heating If (compute_quantity(vol_heat_flux)) Then ! Note that radial_integral_weights give int{f r^2}/int(r^2} + tmp1d(N_R) = 0.0d0 ! Initialize heat flux to zero at lower boundary Do r = N_R-1, 1,-1 mean_rho = half*(ref%density(r) + ref%density(r+1) ) mean_t = half*(ref%temperature(r) + ref%temperature(r+1))