11 COMMON /lminui/ xkin(4),ukin(4),wkin(4),ain(4),
bin(4),
12 &maxfin,relup,relerr,reler2,fcnmax
13 REAL xkin,ukin,wkin,ain,
bin,relerr,relup,reler2,fcnmax
22 1/lmmine/ erp(30) ,ern(30)
23 2/lmpari/
x(15) ,xt(15) ,dirin(15) ,maxint ,npar
24 3/lmpare/ u(30) ,werr(30) ,maxext ,nu
25 4/lmlimi/ alim(30) ,blim(30) ,lcode(30) ,lcorsp(30) ,limset
27 7/lmfix / ipfix(15),xs(15) ,xts(15) ,dirins(15) ,npfix
28 7/lmfix2/ grds(15) ,g2s(15) ,gsteps(15),aberfs(15)
29 c/lmcasc/
y(16) ,jh ,jl
30 f/lmderi/ gin(30) ,grd(15) ,g2(15) ,gstep(15) ,aberf(15)
31 g/lmsimv/
p(15,16) ,pstar(15),pstst(15) ,pbar(15) ,prho(15)
34 6/lmunit/ isysrd ,isyswr ,isyspu
35 8/lmtitl/
title(13),date(2) ,isw(7) ,nblock
36 9/lmconv/ epsi ,apsi ,vtest ,nstepq ,nfcn ,nfcnmx
37 a/lmcard/ cword ,cword2 ,cword3 ,word7(7)
38 b/lmmini/ amin ,up ,newmin ,itaur ,sigma,epsmac
45 INTEGER lcode,lcorsp,limset
50 REAL grds,g2s,gsteps,aberfs
53 REAL gin,grd,g2,gstep,aberf
54 REAL p,pstar,pstst,pbar,prho
57 INTEGER isysrd ,isyswr ,isyspu
60 REAL epsi ,apsi ,vtest
61 INTEGER nstepq ,nfcn ,nfcnmx
62 REAL cword ,cword2 ,cword3 ,word7
63 REAL amin ,up ,sigma,epsmac
65 INTEGER i,iflag,nparp1,npfn,kg,ns,nf,
k,ncycl,j,jhold
66 REAL alpha,beta,
gamma,rhomin,rhomax,rho1,rho2,wg,ynpp1,absmin,
67 + aming,bestx,f,sig2,pb,ystar,ystst,y1,y2,rho,yrho,ypbar
69 DATA alpha,beta,
gamma,rhomin,rhomax / 1.0, 0.5, 2.0, 4.0, 8.0/
70 IF (npar .LE. 0)
RETURN
74 rho2 = rho1 + alpha*
gamma
77 IF(lst3.GE.5)
WRITE(isyswr,100) epsi
79 IF (isw(2) .GE. 1) dirin(i) = sqrt(
v(i,i)*up)
80 IF (abs(dirin(i)) .LT. 1.0e-10*abs(
x(i))) dirin(i)=1.0e-8*
x(i)
81 IF(itaur.LT. 1)
v(i,i) = dirin(i)**2/up
83 IF (itaur .LT. 1) isw(2) = 1
97 4
x(i) = bestx + dirin(i)
99 CALL
lsigmx(npar,gin, f, u, 4)
101 IF (f .LE. aming) go
to 6
103 IF (kg .EQ. 1) go
to 8
106 dirin(i) = dirin(i) * (-0.4)
107 IF (nf .LT. 3) go
to 4
111 dirin(i) = dirin(i) * 3.0
115 IF (ns .LT. 6) go
to 4
118 IF (aming .LT. absmin) jl = i
119 IF (aming .LT. absmin) absmin = aming
131 30
IF(abs(dirin(i)).LE.abs(epsmac*
x(i))) dirin(i)=4.*epsmac*
x(i)
132 IF (isw(5) .GE. 1) CALL
lmprin(0,amin)
141 IF (sig2 .LT. epsi .AND. sigma.LT.epsi) go
to 76
143 IF ((nfcn-npfn) .GT. nfcnmx) go
to 78
148 59 pb = pb + wg *
p(i,j)
149 pbar(i) = pb - wg *
p(i,jh)
150 60 pstar(i)=(1.+alpha)*pbar(i)-alpha*
p(i,jh)
152 CALL
lsigmx(npar,gin,ystar,u,4)
154 IF(ystar.GE.amin) go
to 70
159 CALL
lsigmx(npar,gin,ystst,u,4)
162 y1 = (ystar-
y(jh)) * rho2
163 y2 = (ystst-
y(jh)) * rho1
164 rho = 0.5 * (rho2*y1 -rho1*y2) / (y1 -y2)
165 IF (rho .LT. rhomin) go
to 66
166 IF (rho .GT. rhomax) rho = rhomax
168 64 prho(i) = rho*pbar(i) + (1.0-rho)*
p(i,jh)
170 CALL
lsigmx(npar,gin,yrho, u,4)
172 IF (yrho .LT.
y(jl) .AND. yrho .LT. ystst) go
to 65
173 IF (ystst .LT.
y(jl)) go
to 67
174 IF (yrho .GT.
y(jl)) go
to 66
178 66
IF (ystst .LT.
y(jl)) go
to 67
181 67 CALL
lmrazz(ystst,pstst)
183 IF (isw(5) .LT. 2) go
to 50
184 IF (isw(5) .GE. 3 .OR. mod(ncycl, 10) .EQ. 0) CALL
lmprin(0,amin)
187 70
IF (ystar .GE.
y(jh)) go
to 73
190 IF (jhold .NE. jh) go
to 50
193 74 pstst(i)=beta*
p(i,jh)+(1.-beta)*pbar(i)
195 CALL
lsigmx(npar,gin,ystst,u,4)
197 IF(ystst.GT.
y(jh)) go
to 1
199 IF (ystst .LT. amin) go
to 67
203 76
IF(lst3.GE.5)
WRITE(isyswr,120)
205 78
IF(lst3.GE.5)
WRITE(isyswr,130)
210 81 pb = pb + wg *
p(i,j)
211 82 pbar(i) = pb - wg *
p(i,jh)
213 CALL
lsigmx(npar,gin,ypbar,u,iflag)
215 IF (ypbar .LT. amin) CALL
lmrazz(ypbar,pbar)
217 IF (nfcnmx+npfn-nfcn .LT. 3*npar) go
to 90
218 IF (sigma .GT. 2.0*epsi) go
to 1
219 90 CALL
lmprin(1-itaur, amin)
221 100
FORMAT(
' START SIMPLEX MINIMIZATION ',8
x ,
'CON',
222 +.LT.
'VERGENCE CRITERION -- ESTIMATED DISTANCE TO MINIMUM (EDM) ',
224 120
FORMAT(1h ,
'SIMPLEX MINIMIZATION HAS CONVERGED')
225 130
FORMAT(1h ,
'SIMPLEX TERMINATES WITHOUT CONVERGENCE')