Skip to content

Commit 72c52f2

Browse files
committed
[ci optional] fix diffusion numerical bug
Reported-by Ben Roulston
1 parent 1c0f472 commit 72c52f2

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

star/private/diffusion_procs.f90

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,6 @@ subroutine fixup( &
147147
return
148148
end if
149149

150-
if (dbg) call mesa_error(__FILE__,__LINE__,'fixup')
151-
152150
end subroutine fixup
153151

154152

@@ -361,6 +359,11 @@ subroutine fix_species_conservation( &
361359
ierr = -1
362360
return
363361
end if
362+
363+
! don't try to apply rescaling corrections to anything that
364+
! ended up completely set to zero by fix_negative_masses
365+
if (frac <= 0d0) cycle
366+
364367
do k=nzlo,nzhi
365368
mass(j,k) = mass(j,k)/frac
366369
end do

0 commit comments

Comments
 (0)