Skip to content

Commit

Permalink
prevent divide by 0 if all elastic scatters are turned off
Browse files Browse the repository at this point in the history
  • Loading branch information
Sherwood Richers committed Nov 1, 2017
1 parent eb852d9 commit 6e640db
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/scattering.F90
Original file line number Diff line number Diff line change
Expand Up @@ -898,7 +898,11 @@ subroutine total_scattering_opacity(neutrino_species,neutrino_energy,scattering_
else
stop "total_scattering_opacity: How did you get in here??"
endif
average_delta = average_delta / scattering_opacity
if(scattering_opacity.gt.0) then
average_delta = average_delta / scattering_opacity
else
average_delta = 0.0d0
endif

#ifdef DEBUG
! check output
Expand Down

0 comments on commit 6e640db

Please sign in to comment.