1 subroutine maxlik_init(nvarr,xrange,comm)
2 c Optimize the UNRES energy function by minimization of a quartic target
3 c function or by the VMC method.
9 cMS$ATTRIBUTES C :: proc_proc
12 include "DIMENSIONS.ZSCOPT"
15 integer IERROR,ERRCODE,kolor,key,comm
18 include "COMMON.IOUNITS"
19 include "COMMON.OPTIM"
20 include "COMMON.XBOUND"
22 double precision rr,x(max_paropt)
26 double precision xrange(maxvar,2)
27 integer number_of_variables
28 common /patch/ number_of_variables
30 c print *,"Starting..."
33 c print *,"Initializing MPI..."
34 call MPI_Init( IERROR )
35 ALL_COMM = MPI_COMM_WORLD
39 call MPI_Comm_rank( ALL_COMM, me, IERROR )
40 call MPI_Comm_size( ALL_COMM, nprocs, IERROR )
41 c print *,"Finished initializing MPI..."
44 c print *,"Me",me," Master",master," Ierror",ierror
47 write(iout,*) "SEVERE ERROR - Can't initialize MPI."
48 call mpi_finalize(ierror)
64 c print *,"calling openunits"
66 c print *,"openunits called"
67 call read_general_data(*10)
68 write (iout,'(80(1h-)/10x,
69 & "Maximum likelihood optimization of UNRES energy function",
70 & " v. 05/10/16"/80(1h-))')
74 write (iout,*) "Finished READ_GENERAL_DATA"
77 call parmread(iparm,*10)
79 write (iout,*) "Finished parmread"
81 call read_optim_parm(*10)
82 call print_general_data(*10)
83 call read_protein_data(*10)
84 write (iout,*) "Finished READ_PROTEIN_DATA"
86 call read_database(*10)
87 write (iout,*) "Finished READ_DATABASE"
90 c write (iout,*) Me,' calling PROC_GROUPS'
92 c write (iout,*) Me,' calling WORK_PARTITION_MAP'
93 c call work_partition_map(nvarr)
95 call proc_data(nvarr,x,*10)
97 number_of_variables=nvarr
102 write (iout,*) "xrange from MAXLIK_INIT"
104 write (iout,*) i,xrange(i,1),xrange(i,2)
109 10 write (iout,*) "Error termination of the program"
110 call MPI_Finalize( IERROR )
113 c------------------------------------------------------------------------
114 subroutine maxlik_optim(x,fmin)
115 c Optimize the UNRES energy function by minimization of a quartic target
116 c function or by the VMC method.
122 cMS$ATTRIBUTES C :: proc_proc
125 include "DIMENSIONS.ZSCOPT"
128 integer IERROR,ERRCODE,kolor,key
131 include "COMMON.IOUNITS"
132 include "COMMON.OPTIM"
133 integer nvarr,iparm,i
134 double precision rr,x(max_paropt),fmin
136 integer number_of_variables
137 common /patch/ number_of_variables
138 nvarr=number_of_variables
139 write (*,*) "MAXLIK_OPTIM: Variables from PYTHON:",nvarr
140 write (iout,*) "MAXLIK_OPTIM: Variables from PYTHON:",nvarr
142 write (iout,*) i,x(i)
146 if (me.eq.Master) then
148 call maxlikopt(nvarr,x,fmin)
149 write (iout,*) "fmin from MAXLIK_OPTIM:",fmin
151 call jebadelko(nvarr)
153 call jebadelko(nvarr)
156 call MPI_Finalize( IERROR )