src/gray_project.f90: avoid division by zero

This commit is contained in:
Michele Guerini Rocco 2025-03-20 20:03:28 +01:00
parent fadf1ac7c7
commit 65b9d129ea
Signed by: rnhmjoj
GPG Key ID: BFBAF4C975F76450

View File

@ -269,7 +269,7 @@ contains
end if end if
! Signal that J_φ has alternating sign ! Signal that J_φ has alternating sign
if ((I_tot - abs(sum(J_phi*self%dA)))/ I_tot > 0.1) then if (I_tot - abs(sum(J_phi*self%dA)) > 0.1_wp_*I_tot) then
rho_avg_J = -rho_avg_J rho_avg_J = -rho_avg_J
drho_avg_J = -drho_avg_J drho_avg_J = -drho_avg_J
rho_max_J = -rho_max_J rho_max_J = -rho_max_J