1 subroutine maxlikopt(nvarr,x)
4 include "DIMENSIONS.ZSCOPT"
10 include "COMMON.WEIGHTS"
11 include "COMMON.VMCPAR"
12 include "COMMON.OPTIM"
13 include "COMMON.CLASSES"
14 include "COMMON.ENERGIES"
15 include "COMMON.IOUNITS"
16 integer i,j,k,iprot,nf,ii,inn,n,nn,indn(max_ene)
17 logical solved,all_satisfied,not_done
18 double precision ran_number,f,f0,x(max_paropt),x0(max_paropt),
20 integer iran_num,nvarr
21 double precision tcpu,t0,t1,t0w,t1w
28 if (me.eq.master) then
29 if (nparmset.gt.0) then
30 write (liczba,'(bz,i4.4)') myparm
31 restartname=prefix(:lenpre)//"_par"//liczba//'.restart'
33 restartname=prefix(:lenpre)//'.restart'
37 restartname=prefix(:lenpre)//'.restart'
39 print *,"Start solving inequalities"
42 c Only evaluate initial energies
47 call minimize_setup(nvarr,x)
50 write (iout,*) "CPU time for setup:",t1-t0," sec."
52 write (iout,*) "Wall clock time for setup:",t1w-t0w," sec."
59 call print_minimize_results(nvarr)
67 call minimize_setup(nvarr,x)
70 write (iout,*) "CPU time for setup:",t1-t0," sec."
72 write (iout,*) "Wall clock time for setup:",t1w-t0w," sec."
76 print *,"Calling minimize"
77 call minimize(nvarr,x,f0)
79 write (iout,*) "CPU time for minimization:",t1-t0," sec."
82 write (iout,*) "Wall clock time for minimization:",t1w-t0w
89 c write (iout,*) "Start MCM procedure"
92 call print_minimize_results(nvarr)
99 print *,"Calling scan"
100 call minimize_setup(nvarr,x)
101 call scan(nvarr,x,f0,.true.)
105 call print_minimize_results(nvarr)
108 60 format(bz,100f10.5)
111 c-----------------------------------------------------------------------------
112 subroutine minimize_setup(nvar,x)
115 include "DIMENSIONS.ZSCOPT"
118 integer IERROR,TAG,STATUS(MPI_STATUS_SIZE)
121 include "COMMON.IOUNITS"
122 include "COMMON.CLASSES"
123 include "COMMON.NAMES"
124 include "COMMON.OPTIM"
125 include "COMMON.TORSION"
126 include "COMMON.WEIGHTS"
127 include "COMMON.WEIGHTDER"
128 include "COMMON.VMCPAR"
129 include "COMMON.ENERGIES"
130 include "COMMON.TIME1"
131 double precision g(nvar)
132 double precision viol
133 integer i,j,k,ii,ib,ibatch,iprot,nvar,nf
134 double precision x(max_paropt)
135 double precision rdif,maxlik_pdb
139 write (iout,*) "Entered MINIMIZE_SETUP"
142 call func1(nvar,3,x_orig)
147 c write (iout,*) "Initial X",(x(i),i=1,nvar)
148 c write (iout,*) "X_orig",(x_orig(i),i=1,nvar)
149 c write (iout,*) "ww_oorig",(ww_oorig(i),i=1,n_ene)
151 if (torsion_pmf.or.turn_pmf.or.eello_pmf.or.angle_PMF.or.pdbpmf)
154 if (torsion_pmf.or.turn_pmf.or.eello_pmf.or.angle_PMF)
155 & fpmf = rdif(nvar,x,g,1)
156 if (pdbpmf) fpdb = maxlik_pdb(nvar,x,g,1)
160 write (iout,*) "x",(x(i),i=1,nvar)
163 write(iout,'(10(1x,a6,1x))')(wname(print_order(i))(:6),i=1,n_ene)
164 write(iout,40)(ww(print_order(i)),i=1,n_ene)
165 write(iout,*)'-----------------------------------'
169 40 format(10(f7.4,1x))
171 c------------------------------------------------------------------------------
172 subroutine print_minimize_results(nvarr)
175 include "DIMENSIONS.ZSCOPT"
178 integer ierror,status(MPI_STATUS_SIZE),tag
181 include "COMMON.CONTROL"
182 include "COMMON.WEIGHTS"
183 include "COMMON.WEIGHTDER"
184 include "COMMON.PROTNAME"
185 include "COMMON.ENERGIES"
186 include "COMMON.CLASSES"
187 include "COMMON.IOUNITS"
188 include "COMMON.VMCPAR"
189 include "COMMON.OPTIM"
190 include "COMMON.TIME1"
191 integer nf,nvarr,i,ib,ic,ii,num_nat_tot,iprot,igather
192 double precision x(max_ene)
193 double precision viol
197 c write (iout,*) "print_minimize_results"
199 write(iout,*) '----------------------'
201 call x2w(nvarr,xm(1))
202 c write (iout,*) "Calling func1"
204 call func1(nvarr,2,xm(1))
205 c write (iout,*) "Calling write_params"
207 call write_params(nvarr,nf,xm(1))
208 c write(iout,*) "After write_params"
212 if (nparmset.eq.1) then
213 call write_prot(ii,'NewE_all')
215 write (liczba,'(bz,i4.4)') myparm
216 call write_prot(ii,'NewE_all'//liczba)
219 c call make_distrib(iclass(ic,ii),ii)
227 c------------------------------------------------------------------------------
228 subroutine write_params(nvar,nf,x)
231 include "DIMENSIONS.ZSCOPT"
232 include "COMMON.CONTROL"
233 include "COMMON.WEIGHTS"
234 include "COMMON.NAMES"
235 include "COMMON.INTERACT"
236 include "COMMON.TORSION"
237 include "COMMON.LOCAL"
238 include "COMMON.SCCOR"
239 include "COMMON.CLASSES"
240 include "COMMON.ENERGIES"
241 include "COMMON.IOUNITS"
242 include "COMMON.FFIELD"
243 include "COMMON.OPTIM"
245 double precision x(max_paropt)
248 integer i,ii,j,l,ll,jj,pj,jstart,jend,it1,it2,k,iblock
249 integer itor2typ(-2:2) /-20,9,10,9,20/
250 character*1 aster(0:1) /" ","*"/,ast11,ast12,ast21,ast22
252 character*1 toronelet(-2:2) /"p","a","G","A","P"/
257 write (iout,*) "Weights (asterisk: optimized)"
258 write(iout,'(1x,15(a8,2x))') (wname(print_order(i))(:8),i=1,n_ene)
259 write(iout,50)(ww(print_order(i)),
260 & aster(mysign(imask(print_order(i)))),i=1,n_ene)
262 C Write weights in UNRES format for the input file
263 if (nparmset.eq.1) then
264 open(88,file="weights_opt."//prefix(:ilen(prefix)),
267 write (liczba,'(bz,i4.4)') myparm
268 open(88,file="weights_opt."//prefix(:ilen(prefix))//"par_"
275 c jend=min0(i+4,n_ene)
280 c write(88,'(bz,2a,f7.5," ",$)')
281 c & wname(pj)(:ilen(wname(pj))),'=',ww(pj)
282 c jj=jj+ilen(wname(pj))+9
283 write(88,'(bz,2a,e11.5," ",$)')
284 & wname(pj)(:ilen(wname(pj))),'=',ww(pj)
285 jj=jj+ilen(wname(pj))+13
287 write (88,'(a,$)') (" ",j=1,79-jj)
290 write (88,'(bz,2(2a,f7.5," "))')
291 & "CUTOFF","=",7.0d0,"WCORR4","=",0.0d0
293 if (mod_side .or. mod_side_other) then
294 if (nparmset.eq.1) then
296 & file="sc_"//POT(:ilen(POT))//"_opt."//prefix(:ilen(prefix)),
300 & file="sc_"//POT(:ilen(POT))//"_opt."//prefix(:ilen(prefix))//
305 write(88,'(2i5)') ipot,expon
306 write(iout,'(/3a,2i3)') 'Potential is ',potname(ipot),
307 & ', exponents are ',expon,2*expon
308 goto (10,20,30,30,40) ipot
309 C----------------------- LJ potential ---------------------------------
310 10 write (88,*)((eps(i,j),j=i,ntyp),i=1,ntyp),(sigma0(i),i=1,ntyp)
312 write (iout,'(/a/)') 'Parameters of the LJ potential:'
313 write (iout,'(a/)') 'The epsilon array:'
314 call printmat(ntyp,ntyp,ntyp,iout,restyp,eps)
315 write (iout,'(/a)') 'One-body parameters:'
316 write (iout,'(a,4x,a)') 'residue','sigma'
317 write (iout,'(a3,6x,f10.5)') (restyp(i),sigma0(i),i=1,ntyp)
320 C----------------------- LJK potential --------------------------------
322 write (88,'(4f20.10)')(eps(i,j),j=i,ntyp)
325 write (88,'(4f20.10)') (sigma0(i),i=1,ntyp)
327 write (88,'(4f20.10)') (rr0(i),i=1,ntyp)
330 write (iout,'(/a/)') 'Parameters of the LJK potential:'
331 write (iout,'(a/)') 'The epsilon array:'
332 call printmat(ntyp,ntyp,ntyp,iout,restyp,eps)
333 write (iout,'(/a)') 'One-body parameters:'
334 write (iout,'(a,4x,2a)') 'residue',' sigma ',' r0 '
335 write (iout,'(a3,6x,2f10.5)') (restyp(i),sigma0(i),rr0(i),
339 C---------------------- GB or BP potential -----------------------------
341 write (88,'(4f20.15)') (eps(i,j),j=i,ntyp)
344 write (88,'(4f20.15)')(sigma0(i),i=1,ntyp)
346 write (88,'(4f20.15)')(sigii(i),i=1,ntyp)
348 write (88,'(4f20.15)')(chip0(i),i=1,ntyp)
350 write (88,'(4f20.15)')(alp(i),i=1,ntyp)
352 C For the GB potential convert sigma'**2 into chi'
355 chip(i)=(chip0(i)-1.0D0)/(chip0(i)+1.0D0)
360 write (iout,'(/a/)') 'Parameters of the BP potential:'
362 write (iout,'(/a/)') 'Parameters of the GB potential:'
364 write (iout,'(a/)') 'The epsilon array:'
365 call printmat(ntyp,ntyp,ntyp,iout,restyp,eps)
366 write (iout,'(/a)') 'One-body parameters (asterisk: optimized):'
367 write (iout,'(a,4x,4a)') 'residue',' sigma ','s||/s_|_^2',
370 write (iout,'(a3,6x,f10.5,1x,a1,3(f8.5,1x,a1))') restyp(i),
371 & sigma0(i),aster(mask_sigma(1,i)),sigii(i),aster(mask_sigma(2,i)),
372 & chip(i),aster(mask_sigma(3,i)),alp(i),aster(mask_sigma(4,i))
376 C--------------------- GBV potential -----------------------------------
377 40 write (88,*)((eps(i,j),j=i,ntyp),i=1,ntyp),
378 & (sigma0(i),i=1,ntyp),(rr0(i),i=1,ntyp),(sigii(i),i=1,ntyp),
379 & (chip(i),i=1,ntyp),(alp(i),i=1,ntyp)
381 write (iout,'(/a/)') 'Parameters of the GBV potential:'
382 write (iout,'(a/)') 'The epsilon array:'
383 call printmat(ntyp,ntyp,ntyp,iout,restyp,eps)
384 write (iout,'(/a)') 'One-body parameters:'
385 write (iout,'(a,4x,5a)') 'residue',' sigma ',' r0 ',
386 & 's||/s_|_^2',' chip ',' alph '
387 write (iout,'(a3,6x,5f10.5)') (restyp(i),sigma0(i),rr0(i),
388 & sigii(i),chip(i),alp(i),i=1,ntyp)
391 C-----------------------------------------------------------------------
395 if (mod_tor .or. tor_mode.eq.2) then
399 write (iout,'(a)') "Optimized weights of the torsional terms."
401 do i=-ntortyp+1,ntortyp-1
402 do j=-ntortyp+1,ntortyp-1
403 if (mask_tor(0,j,i,iblock).gt.0) then
404 write (iout,'(i4,2a4,f10.5)') 0,restyp(iloctyp(i)),
405 & restyp(iloctyp(j)),weitor(0,j,i,iblock)
410 if (nparmset.eq.1) then
412 open(88,file="tor_opt.parm."//prefix(:ilen(prefix)),
414 write (88,'(i1,7h *** ,2a,7h *** )') ntortyp,
415 & "Optimized torsional parameters ",prefix(:ilen(prefix))
416 write (88,'(40i2)') (itortyp(i),i=1,ntyp)
418 if (tor_mode.eq.0) then
420 write (iout,'(/a/)') 'Torsional constants:'
424 write (iout,*) 'ityp',i,' jtyp',j
425 write (iout,*) 'Fourier constants'
426 do k=1,nterm(i,j,iblock)
427 write (iout,'(2(1pe15.5))') v1(k,i,j,iblock),
430 write (iout,*) 'Lorenz constants'
431 do k=1,nlor(i,j,iblock)
432 write (iout,'(3(1pe15.5))')
433 & vlor1(k,i,j),vlor2(k,i,j),vlor3(k,i,j)
441 do j=-ntortyp+1,ntortyp-1
442 write (88,'(2i2,16h ************ ,a1,1h-,a1)')
443 & nterm(i,j,iblock),nlor(i,j,iblock),onelet(iloctyp(i)),
445 do k=1,nterm(i,j,iblock)
446 write (88,'(i6,13x,2(1pe18.5))') k,
447 & v1(k,i,j,iblock)*weitor(0,i,j,iblock),v2(k,i,j,
448 & iblock)*weitor(0,i,j,iblock)
450 do k=1,nlor(i,j,iblock)
451 write (88,'(i6,13x,3(1pe18.5))')
452 & k,vlor1(k,i,j)*weitor(k,i,j,iblock),
453 & vlor2(k,i,j)*weitor(k,i,j,iblock),
454 & vlor3(k,i,j)*weitor(k,i,j,iblock)
461 c Print valence-torsional parameters
463 & "Parameters of the valence-torsional potentials"
464 do i=-ntortyp+1,ntortyp-1
465 do j=-ntortyp+1,ntortyp-1
466 write (iout,'(3a)')"Type ",onelet(iloctyp(i)),onelet(iloctyp(j))
467 write (iout,'(3a5,2a15)') "itor","ival","jval","v_kcc","v2_kcc"
468 do k=1,nterm_kcc(j,i)
469 do l=1,nterm_kcc_Tb(j,i)
470 do ll=1,nterm_kcc_Tb(j,i)
471 write (iout,'(3i5,2f15.4)')
472 & k,l-1,ll-1,v1_kcc(ll,l,k,j,i),v2_kcc(ll,l,k,j,i)
479 do i=-ntortyp+1,ntortyp-1
480 do j=-ntortyp+1,ntortyp-1
481 write (88,'(16h ************ ,a1,1h-,a1)')
482 & onelet(iloctyp(i)),onelet(iloctyp(j))
483 write (88,'(2i5)') nterm_kcc(j,i),nterm_kcc_Tb(j,i)
484 do k=1,nterm_kcc(j,i)
485 do l=1,nterm_kcc_Tb(j,i)
486 do ll=1,nterm_kcc_Tb(j,i)
487 write (88,'(3i5,2(1pe15.5))') k,l-1,ll-1,
488 & v1_kcc(ll,l,k,j,i),v2_kcc(ll,l,k,j,i)
502 write (iout,'(a)') "Optimized weights of the sccor terms."
506 if (mask_tor(l,j,i,iblock).gt.0) then
507 write (iout,'(i4,2a4,f10.5)') l,restyp(isccortyp(j)),
508 & restyp(isccortyp(i)),weitor(l,j,i,1)
514 if (nparmset.eq.1) then
516 open(88,file="sccor_opt.parm."//prefix(:ilen(prefix)),
518 write (88,'(i2,7h *** ,2a,7h *** )') nsccortyp,
519 & "Optimized local correlation parameters ",prefix(:ilen(prefix))
520 write (88,'(20i4)') (isccortyp(i),i=1,ntyp)
524 write (88,'(2i4)') nterm_sccor(i,j),nlor_sccor(i,j)
525 write (88,'(12(1h*),1x,a1,1h-,a1)') onelet(i),onelet(j)
526 do k=1,nterm_sccor(i,j)
527 write (88,'(i6,13x,2(1pe18.5))') k,
528 & v1sccor(k,l,i,j)*weitor(l,i,j,1),
529 & v2sccor(k,l,i,j)*weitor(l,i,j,1)
539 C-----------------------------------------------------------------------
540 c 7/8/17 AL: Optimization of the bending parameters
543 & "Optimized angle potential coefficients (same for D-types)"
545 if (mask_ang(i).eq.0) cycle
546 write (iout,*) "Type: ",onelet(iloctyp(i))
547 do j=1,nbend_kcc_TB(i)
548 write (iout,'(i5,f15.5)') j,v1bend_chyb(j,i)
551 open(88,file="theta_opt.parm."//prefix(:ilen(prefix)),
553 write (88,'(i2)') nthetyp
554 do i=-nthetyp+1,nthetyp-1
555 write (88,'(i2,1x,12(1h*),1x,a1)')
556 & nbend_kcc_TB(i),onelet(iloctyp(i))
557 do j=0,nbend_kcc_TB(i)
558 write (88,'(i5,f20.10)') j,v1bend_chyb(j,i)
563 C-----------------------------------------------------------------------
564 if(mod_fourier(nloctyp).gt.0.or.mod_fouriertor(nloctyp).gt.0)then
567 & "Fourier coefficients of new (angle-dependent) cumulants",
568 & " (asterisk: optimized)"
570 write (iout,*) "Type: ",onelet(iloctyp(i))
571 write (iout,*) "Coefficients of the expansion of B1"
573 write (iout,'(3hB1(,i1,1h),3f10.5)') j,(bnew1(k,j,i),k=1,3)
575 write (iout,*) "Coefficients of the expansion of B2"
577 write (iout,'(3hB2(,i1,1h),3f10.5)') j,(bnew2(k,j,i),k=1,3)
579 write (iout,*) "Coefficients of the expansion of C"
580 write (iout,'(3hC11,3f10.5)') (ccnew(j,1,i),j=1,3)
581 write (iout,'(3hC12,3f10.5)') (ccnew(j,2,i),j=1,3)
582 write (iout,*) "Coefficients of the expansion of D"
583 write (iout,'(3hD11,3f10.5)') (ddnew(j,1,i),j=1,3)
584 write (iout,'(3hD12,3f10.5)') (ddnew(j,2,i),j=1,3)
585 write (iout,*) "Coefficients of the expansion of E"
586 write (iout,'(2hE0,3f10.5)') (e0new(j,i),j=1,3)
589 write (iout,'(1hE,2i1,2f10.5)') j,k,(eenew(l,j,k,i),l=1,2)
594 IF (SPLIT_FOURIERTOR) THEN
597 & "Fourier coefficients of new (angle-dependent) cumulants",
598 & " for torsional potentials (asterisk: optimized)"
600 write (iout,*) "Type: ",onelet(iloctyp(i))
601 write (iout,*) "Coefficients of the expansion of B1"
603 write (iout,'(3hB1(,i1,1h),3f10.5)')
604 & j,(bnew1tor(k,j,i),k=1,3)
606 write (iout,*) "Coefficients of the expansion of B2"
608 write (iout,'(3hB2(,i1,1h),3f10.5)')
609 & j,(bnew2tor(k,j,i),k=1,3)
611 write (iout,*) "Coefficients of the expansion of C"
612 write (iout,'(3hC11,3f10.5)') (ccnewtor(j,1,i),j=1,3)
613 write (iout,'(3hC12,3f10.5)') (ccnewtor(j,2,i),j=1,3)
614 write (iout,*) "Coefficients of the expansion of D"
615 write (iout,'(3hD11,3f10.5)') (ddnewtor(j,1,i),j=1,3)
616 write (iout,'(3hD12,3f10.5)') (ddnewtor(j,2,i),j=1,3)
617 write (iout,*) "Coefficients of the expansion of E"
618 write (iout,'(2hE0,3f10.5)') (e0newtor(j,i),j=1,3)
621 write (iout,'(1hE,2i1,2f10.5)')
622 & j,k,(eenewtor(l,j,k,i),l=1,2)
631 & "Fourier coefficients of old angle-independent cumulants",
632 & " (asterisk: optimized)"
634 write (iout,*) 'Type ',restyp(iloctyp(i))
635 write (iout,'(a,i2,a,f10.5,1x,a)')
636 & ('b(',j,')=',b(j,i),aster(mysign(mask_fourier(j,i))),j=1,13)
639 c Write a file with parameters for UNRES
640 if (nparmset.eq.1) then
641 open(88,file="fourier_opt.parm."//prefix(:ilen(prefix)),
644 open(88,file="fourier_opt.parm."//prefix(:ilen(prefix))//
649 IF (SPLIT_FOURIERTOR) THEN
650 write (88,'(i5,5x,a)') -nloctyp,
651 & "# Number of local interaction types"
653 write (88,'(i5,5x,a)') nloctyp,
654 & "# Number of local interaction types"
656 write (88,'(40i2)') (itype2loc(i),i=1,ntyp)
657 write (88,'(20i4)') (iloctyp(i),i=0,nloctyp)
659 write (88,'(a)') restyp(iloctyp(i))
662 write (88,'(f20.10,4h b1,i1,1h(,i1,1h))')
668 write (88,'(f20.10,4h b2,i1,1h(,i1,1h))')
674 write (88,'(f20.10,4h c1,i1,1h(,i1,1h))')
675 & 2*ccnew(ii,j,i),j,ii
680 write (88,'(f20.10,4h d1,i1,1h(,i1,1h))')
681 & 2*ddnew(ii,j,i),j,ii
687 write (88,'(f20.10,3h e,2i1,1h(,i1,1h))')
688 & eenew(ii,j,k,i),j,k,ii
693 write (88,'(f20.10,5h e0(,i1,1h))')
698 IF (SPLIT_FOURIERTOR) THEN
701 write (88,'(a)') restyp(iloctyp(i))
704 write (88,'(f20.10,4h b1,i1,1h(,i1,1h))')
705 & bnew1tor(ii,j,i),j,ii
710 write (88,'(f20.10,4h b2,i1,1h(,i1,1h))')
711 & bnew2tor(ii,j,i),j,ii
716 write (88,'(f20.10,4h c1,i1,1h(,i1,1h))')
717 & 2*ccnewtor(ii,j,i),j,ii
722 write (88,'(f20.10,4h d1,i1,1h(,i1,1h))')
723 & 2*ddnewtor(ii,j,i),j,ii
729 write (88,'(f20.10,3h e,2i1,1h(,i1,1h))')
730 & eenewtor(ii,j,k,i),j,k,ii
735 write (88,'(f20.10,5h e0(,i1,1h))')
743 write (88,'(i5,5x,a)') nloctyp,
744 & "# Number of local interaction types"
746 write (88,'(a)') restyp(iloctyp(i))
748 write (88,'(f20.15)') b(j,i)
756 & 'Electrostatic interaction constants (asterisk: optimized):'
757 write (iout,'(1x,a,1x,a,7x,a,15x,a,15x,a,13x,a)')
758 & 'IT','JT','EPP','RPP','ELPP6','ELPP3'
761 write(iout,'(2i3,4(1pe15.4,1x,a1,1x))')i,j,
762 & epp(i,j),aster(mask_elec(i,j,1)),
763 & rpp(i,j),aster(mask_elec(i,j,2)),
764 & elpp6(i,j),aster(mask_elec(i,j,3)),
765 & elpp3(i,j),aster(mask_elec(i,j,4))
769 write (iout,'(1x,a,1x,a,10x,a,11x,a,11x,a,11x,a)')
770 & 'IT','JT','APP','BPP','AEL6','AEL3'
773 write(iout,'(2i3,4(1pe15.4))')i,j,app(i,j),bpp(i,j),
774 & ael6(i,j),ael3(i,j)
777 C Write electrostatic interaction parameters to a file
778 if (nparmset.eq.1) then
779 open(88,file="electr_opt.parm."//prefix(:ilen(prefix)),
782 open(88,file="electr_opt.parm."//prefix(:ilen(prefix))//
786 write(88,'(4f15.10,5x,a)')((epp(i,j),j=1,2),i=1,2),"! EPP"
787 write(88,'(4f15.10,5x,a)')((rpp(i,j),j=1,2),i=1,2),"! RPP"
788 write(88,'(4f15.10,5x,a)')((elpp6(i,j),j=1,2),i=1,2),"! ELPP6"
789 write(88,'(4f15.10,5x,a)')((elpp3(i,j),j=1,2),i=1,2),"! ELPP3"
795 & "Parameters of SC-p interactions (star: optimized):"
796 write (iout,'(t14,a,t34,a)') "TYPE 1","TYPE 2"
797 write (iout,'(8a)') "SC TYPE"," EPS_SCP "," R_SCP ",
798 & " EPS_SCP "," R_SCP "
800 ast11 = aster(mask_scp(i,1,1))
801 ast12 = aster(mask_scp(i,1,2))
802 ast21 = aster(mask_scp(i,2,1))
803 ast22 = aster(mask_scp(i,2,2))
804 if (mask_scp(i,1,1).eq.0) ast11 = aster(mask_scp(0,1,1))
805 if (mask_scp(i,1,2).eq.0) ast12 = aster(mask_scp(0,1,2))
806 if (mask_scp(i,2,1).eq.0) ast21 = aster(mask_scp(0,2,1))
807 if (mask_scp(i,2,2).eq.0) ast22 = aster(mask_scp(0,2,2))
808 write (iout,'(2x,A3,2x,4(f8.3,1x,a1))') restyp(i),
809 & eps_scp(i,1),ast11,rscp(i,1),ast12,eps_scp(i,2),ast21,
812 C Write SCp parameters to a file
813 if (nparmset.eq.1) then
814 open(88,file="scp_opt.parm."//prefix(:ilen(prefix)),
817 open(88,file="scp_opt.parm."//prefix(:ilen(prefix))//
822 write(88,'(4f15.10,5x,a)') eps_scp(i,1),rscp(i,1),
823 & eps_scp(i,2),rscp(i,2),restyp(i)
827 50 format(bz,15(f8.5,1x,a1))
828 60 format(bz,100f10.5)
830 c------------------------------------------------------------------------------
831 subroutine write_zscore
834 include "DIMENSIONS.ZSCOPT"
835 include "COMMON.ENERGIES"
836 include "COMMON.CLASSES"
837 include "COMMON.PROTNAME"
838 include "COMMON.VMCPAR"
839 include "COMMON.IOUNITS"
840 include "COMMON.WEIGHTS"
841 include "COMMON.WEIGHTDER"
842 include "COMMON.COMPAR"
843 include "COMMON.OPTIM"
844 include "COMMON.THERMAL"
845 integer i,j,k,iprot,ib
846 character*6 namnat(5) /"angrms","Q","rmsd","rgy","sign"/
852 write (iout,'(a,2x,a)') "Protein",
853 & protname(iprot)(:ilen(protname(iprot)))
856 write (iout,'(a)')"Maximum likelihood."
858 do ib=1,nbeta(1,iprot)
859 write (iout,'(f8.1,f10.5)')
860 & 1.0d0/(Rgas*betaT(ib,1,iprot)),sumlik(ib,iprot)
865 write (iout,'(a)')"Specific heat."
867 write (iout,'(a,f10.5)') "Baseline",heatbase(iprot)
868 do ib=1,nbeta(2,iprot)
869 write (iout,'(f8.1,3f10.5)')
870 & 1.0d0/(Rgas*betaT(ib,2,iprot)),
871 & zvtot(ib,iprot),target_cv(ib,iprot),weiCv(ib,iprot)
874 if (natlike(iprot).gt.0) write (iout,'(a)')"Nativelikeness."
875 do i=1,natlike(iprot)
876 write (iout,*) "Property",i,numnat(i,iprot)
877 if (natdim(i,iprot).eq.1) then
878 do ib=1,nbeta(i+2,iprot)
879 write (iout,'(f7.2,2f10.5)')
880 & 1.0d0/(Rgas*betaT(ib,i+2,iprot)),nuave(1,ib,i,iprot),
881 & nuexp(1,ib,i,iprot),weinat(1,ib,i,iprot)
884 do ib=1,nbeta(i+2,iprot)
885 write (iout,'("Temperature",f7.2," NATDIM",i5)')
886 & 1.0d0/(Rgas*betaT(ib,i+2,iprot)),natdim(i,iprot)
887 do k=1,natdim(i,iprot)
888 write (iout,'(3f10.5)') nuave(k,ib,i,iprot),
889 & nuexp(k,ib,i,iprot),weinat(k,ib,i,iprot)
897 if (torsion_pmf.or.turn_pmf.or.eello_pmf)
898 & write (iout,*) "PMF contribution to the target function",fpmf
899 if (pdbpmf) write (iout,*)
900 & "PDB angle-torsional statistics contribution",fpdb
904 c------------------------------------------------------------------------------
905 subroutine write_prot(ii,przed)
907 include "DIMENSIONS.ZSCOPT"
908 include "COMMON.ENERGIES"
909 include "COMMON.CLASSES"
910 include "COMMON.PROTNAME"
911 include "COMMON.VMCPAR"
912 include "COMMON.IOUNITS"
913 include "COMMON.COMPAR"
919 nazwa=przed(:ilen(przed))//'.'//prefix(:ilen(prefix))
920 & //'.'//protname(ii)
921 open(unit=istat,file=nazwa)
923 write(istat,'(i10,3f15.3,20e15.5)')
924 & i,e_total(i,ii),eini(i,ii),entfac(i,ii),
925 & (Ptab(i,j,ii),j=1,nbeta(1,ii))
930 c------------------------------------------------------------------------------
931 integer function mysign(i)