From 39f18ecda7b49969cd49cf6bf681c2821fe2b560 Mon Sep 17 00:00:00 2001 From: Merryn Tawhai Date: Fri, 22 Mar 2024 14:10:25 +1300 Subject: [PATCH] corrected a divide by zero error in make_data_grid --- src/lib/geometry.f90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/geometry.f90 b/src/lib/geometry.f90 index 3681d727..7531e827 100644 --- a/src/lib/geometry.f90 +++ b/src/lib/geometry.f90 @@ -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)