Skip to content

Commit

Permalink
corrected a divide by zero error in make_data_grid
Browse files Browse the repository at this point in the history
  • Loading branch information
Merryn Tawhai authored and Merryn Tawhai committed Mar 22, 2024
1 parent 78d8306 commit 39f18ec
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/geometry.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1475,10 +1475,10 @@ subroutine make_data_grid(surface_elems, num_target, offset, spacing0)
(boxrange(1)*boxrange(2)*boxrange(3)))

num_data = 0
data_err = (num_target-num_data)/num_target
ncount = 0

if(num_target.gt.0)then ! only iterate through when a target is set
data_err = (num_target-num_data)/num_target
do while(abs(data_err).gt.0.005_dp.and.ncount.lt.20) ! allowing 1% error
call make_grid(num_data,num_data_estimate,max_bound,min_bound,spacing)
data_err = real(num_target-num_data)/real(num_target)
Expand Down

0 comments on commit 39f18ec

Please sign in to comment.