1 subroutine scan(nvar,x,f0,lprn)
4 include "DIMENSIONS.ZSCOPT"
5 include "COMMON.WEIGHTS"
7 include "COMMON.VMCPAR"
8 include "COMMON.IOUNITS"
9 include "COMMON.CLASSES"
10 include "COMMON.OPTIM"
11 include "COMMON.ENERGIES"
12 include "COMMON.TIME1"
13 integer i,ii,ibatch,j,iww,nweight,iter,nf,nvar
16 double precision x(max_paropt)
17 double precision viol,f0,f,tcpu
22 c Systematically scan the weights one by one
24 write (iout,*) "Enter the SCAN procedure"
25 write (iout,*) "Initial weights"
26 write(iout,'(9x,15(2x,a6))')(wname(i),i=1,n_ene)
27 write(iout,40)(ww(i),i=1,n_ene)
28 write(iout,*)'-----------------------------------'
30 call targetfun(nvar,x,nf,f0,uiparm)
31 write (iout,*) "Initial function value:",f0
35 if (imask(i).eq.1) then
44 if (imask(iww).eq.0) goto 1222
46 nazwa='scan.'//wname(iww)(:ilen(wname(iww)))
47 open(istat,file=nazwa)
52 print *,"maxstep_scan",maxstep_scan," step_scan",step_scan
53 do iter=1,maxstep_scan
54 ww(iww)=iter*step_scan
55 if (ww(iww).lt.ww_low(iww).or.ww(iww).gt.ww_up(iww)) goto 1221
58 if (imask(i).eq.1) then
63 c write (*,*) iww,iter,ww(iww)
64 call targetfun(nvar,x,nf,f,uiparm)
66 write (iout,'(2a,f10.5,2(1pe15.5))')
67 & "Lower function value found:",wname(iww),ww(iww),f,f0
74 write (istat,'(f8.3,5x,$)') ww(iww)
75 write (istat,'(1pe15.5)') f
85 if (imask(i).eq.1) then
90 write (iout,*) "Best function value:",f0
92 if (lprn) call write_params(nvar,nf,x)
94 30 format(a2,i5,1x,14(f5.3,1x),a3,100f7.3)
95 40 format(13(f7.4,1x))