From 02191e769c8e3de2205aa57dd7a26f10680991ac Mon Sep 17 00:00:00 2001 From: QuanSheng Wu Date: Sun, 22 Jul 2018 12:43:32 +0200 Subject: [PATCH] improves the findnodes.f90 --- soc/proteus.f90 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/soc/proteus.f90 b/soc/proteus.f90 index accba060..6837c26b 100644 --- a/soc/proteus.f90 +++ b/soc/proteus.f90 @@ -3,7 +3,7 @@ subroutine Proteus(ndim, k,gap,ptol,func_gap,iter) ! parameters space ! Ref: Nelder, J.A., and Mead, R. 1965, Computer Journal, vol. 7, pp. 308–313. [1] - use para, only : dp, cpuid, stdout + use para, only : dp, cpuid, stdout, eps9 implicit none integer, intent(in) :: ndim ! number of parameters @@ -25,7 +25,7 @@ function func_gap(n, x) end function func_gap end interface - integer, parameter :: itmax=1000 ! maximum iterations + integer, parameter :: itmax=500 ! maximum iterations real(dp), parameter :: tiny=1.0e-10 integer :: iworst real(dp), dimension(size(k,2)) :: ksum @@ -59,7 +59,7 @@ subroutine Proteus_0 ! satisfactory. ! If returning, put best point and value in slot 1. rtol=2.0_dp*abs(gap(iworst)-gap(ibest))/(abs(gap(iworst))+abs(gap(ibest))+tiny) - if (rtol < ptol) then + if (rtol < ptol.or.gap(ibest)