3 implicit real*8 (a-h,o-z)
5 parameter (liv=60,lv=(77+maxvar*(maxvar+17)/2))
7 include 'COMMON.IOUNITS'
10 external func,gradient,fdum
12 include 'COMMON.SETUP'
14 include 'COMMON.CHAIN'
15 include 'COMMON.FFIELD'
16 dimension muster(mpi_status_size)
17 dimension var(maxvar),erg(mxch*(mxch+1)/2+1)
18 double precision d(maxvar),v(1:lv+1),garbage(maxvar)
21 dimension idum(1),rdum(1)
22 double precision przes(3),obrot(3,3)
24 data rad /1.745329252d-2/
25 common /przechowalnia/ v
30 call mpi_recv(indx,6,mpi_integer,king,idint,CG_COMM,
32 if (indx(1).eq.0) return
33 c print *, 'worker ',me,' received order ',indx(2)
34 call mpi_recv(var,nvar,mpi_double_precision,
35 * king,idreal,CG_COMM,muster,ierr)
36 call mpi_recv(ene0,1,mpi_double_precision,
37 * king,idreal,CG_COMM,muster,ierr)
38 c print *, 'worker ',me,' var read '
41 call deflt(2,iv,liv,lv,v)
42 * 12 means fresh start, dont call deflt
44 * max num of fun calls
45 if (maxfun.eq.0) maxfun=500
47 * max num of iterations
48 if (maxmin.eq.0) maxmin=1000
55 * 1 means to print out result
57 * 1 means to print out summary stats
59 * 1 means to print initial x and d
61 * min val for v(radfac) default is 0.1
63 * max val for v(radfac) default is 4.0
65 * check false conv if (act fnctn decrease) .lt. v(26)*(exp decrease)
66 * the sumsl default is 0.1
68 * false conv if (act fnctn decrease) .lt. v(34)
69 * the sumsl default is 100*machep
71 * absolute convergence
72 if (tolf.eq.0.0D0) tolf=1.0D-4
74 * relative convergence
75 if (rtolf.eq.0.0D0) rtolf=1.0D-4
77 * controls initial step size
79 * large vals of d correspond to small components of step
88 call func(nvar,var,nf,eee,idum,rdum,fdum)
89 if(eee.gt.1.0d18) then
90 c print *,'MINIM_JLEE: ',me,' CHUJ NASTAPIL'
91 c print *,' energy before SUMSL =',eee
92 c print *,' aborting local minimization'
99 call sumsl(nvar,d,var,func,gradient,iv,liv,lv,v,idum,rdum,fdum)
100 c find which conformation was returned from sumsl
103 c total # of ftn evaluations (for iwf=0, it includes all minimizations).
108 call mpi_send(indx,6,mpi_integer,king,idint,CG_COMM,
110 c print '(a5,i3,15f10.5)', 'ENEX0',indx(1),v(10)
111 c print *,indx(2),indx(5)
112 call mpi_send(var,nvar,mpi_double_precision,
113 * king,idreal,CG_COMM,ierr)
114 call mpi_send(eee,1,mpi_double_precision,king,idreal,
116 call mpi_send(ene0,1,mpi_double_precision,king,idreal,
123 subroutine minim_mcmf
124 implicit real*8 (a-h,o-z)
126 include 'COMMON.IOUNITS'
127 write (iout,*) "Unsupported option for serial version"