1 subroutine read_general_data(*)
4 include "DIMENSIONS.ZSCOPT"
8 integer ierror,kolor,klucz
10 include "COMMON.WEIGHTS"
11 include "COMMON.NAMES"
12 include "COMMON.VMCPAR"
13 include "COMMON.TORSION"
14 include "COMMON.INTERACT"
15 include "COMMON.ENERGIES"
16 include "COMMON.MINPAR"
17 include "COMMON.IOUNITS"
18 include "COMMON.TIME1"
19 include "COMMON.PROTFILES"
20 include "COMMON.CHAIN"
21 include "COMMON.CLASSES"
22 include "COMMON.THERMAL"
23 include "COMMON.FFIELD"
24 include "COMMON.OPTIM"
25 include "COMMON.CONTROL"
26 include "COMMON.SCCOR"
27 include "COMMON.SPLITELE"
28 character*800 controlcard
29 integer i,j,k,l,ii,n_ene_found,ist1,iet1,ist2,iet2,ls,le
30 integer ind,itype1,itype2,itypf,itypsc,itypp,itypt1,itypt2
31 integer ilen,lenpot,lenpre
33 character*4 liczba,liczba1
40 double precision xchuj,weitemp,weitemp_low,weitemp_up
45 c write (iout,*) "Enter read_general_data"
53 C Read first record: seed and number of energy components
54 call card_concat(controlcard,.true.)
55 c write (iout,*) "card1",controlcard
57 call readi(controlcard,"ISEED",iseed,0)
58 if (iseed.eq.0) stop "Seed is zero!"
59 c print *,me," iseed",iseed
60 call readi(controlcard,"NPARMSET",nparmset,1)
61 c print *,me," nparmset",nparmset
63 c Split processor pool if multiple parameter sets are treated
64 if (nparmset.eq.1) then
65 WHAM_COMM = MPI_COMM_WORLD
66 c print *,me," opening ",outname," opened"
67 open(iout,file=outname,status='unknown')
69 c print *,me," outname ",outname," opened"
71 if (nprocs.lt.nparmset) then
73 & "*** Cannot split parameter sets for fewer processors than sets",
75 call MPI_Finalize(ierror)
78 c write (iout,*) "nparmset",nparmset
79 nprocs = nprocs/nparmset
81 klucz = mod(me,nprocs)
82 c write (*,*) "My old rank",me," kolor",kolor," klucz",klucz
83 call MPI_Comm_split(MPI_COMM_WORLD,kolor,klucz,WHAM_COMM,ierror)
84 call MPI_Comm_size(WHAM_COMM,nprocs,ierror)
85 call MPI_Comm_rank(WHAM_COMM,me,ierror)
86 c write (*,*) "My new rank",me," comm size",nprocs
87 c write (*,*) "MPI_COMM_WORLD",MPI_COMM_WORLD,
88 c & " WHAM_COMM",WHAM_COMM
90 c write (*,*) "My parameter set is",myparm
91 write(liczba,'(bz,i4.4)') me
92 write(liczba1,'(bz,i4.4)') myparm
93 outname=prefix(:lenpre)//'.out_par'//liczba1//'_'//
94 & pot(:lenpot)//liczba
95 open(iout,file=outname,status='unknown')
98 c print *,me," checkpoint 1"
99 energy_dec=(index(controlcard,'ENERGY_DEC').gt.0)
100 call readi(controlcard,'TORMODE',tor_mode,0)
101 c print *,me," tor_mode",tor_mode
102 call readi(controlcard,'SHIELD',shield_mode,0)
103 call readi(controlcard,"N_ENE",n_ene,max_ene)
104 c print *,"iseed",iseed," n_ene",n_ene
105 call readi(controlcard,"NPARMSET",nparmset,1)
106 geom_and_wham_weights =
107 & index(controlcard,"GEOM_AND_WHAM_WEIGHTS").gt.0
108 c write (iout,*) "GEOM_AND_WHAM_WEIGHTS",geom_and_wham_weights
109 if (iseed.gt.0) iseed=-iseed
111 out_newe=index(controlcard,"OUT_NEWE").gt.0
112 unres_pdb = index(controlcard,"UNRES_PDB").gt.0
113 c write (iout,*) "UNRES_PDB ",unres_pdb
114 c Energy calculation settings section
115 call readi(controlcard,'TORMODE',tor_mode,0)
116 C if(me.eq.king .or. .not. out1file .and. fg_rank.eq.0) then
117 call reada(controlcard,'BOXX',boxxsize,100.0d0)
118 call reada(controlcard,'BOXY',boxysize,100.0d0)
119 call reada(controlcard,'BOXZ',boxzsize,100.0d0)
120 c print *,me," checkpoint 2"
121 c Cutoff range for interactions
122 call reada(controlcard,"R_CUT",r_cut,15.0d0)
123 call reada(controlcard,"LAMBDA",rlamb,0.3d0)
124 call reada(controlcard,"LIPTHICK",lipthick,0.0d0)
125 call reada(controlcard,"LIPAQBUF",lipbufthick,0.0d0)
126 if (lipthick.gt.0.0d0) then
127 bordliptop=(boxzsize+lipthick)/2.0
128 bordlipbot=bordliptop-lipthick
130 if ((bordliptop.gt.boxzsize).or.(bordlipbot.lt.0.0))
131 & write(iout,*) "WARNING WRONG SIZE OF LIPIDIC PHASE"
132 buflipbot=bordlipbot+lipbufthick
133 bufliptop=bordliptop-lipbufthick
134 if ((lipbufthick*2.0d0).gt.lipthick)
135 &write(iout,*) "WARNING WRONG SIZE OF LIP AQ BUF"
137 c write(iout,*) "bordliptop=",bordliptop
138 c write(iout,*) "bordlipbot=",bordlipbot
139 c write(iout,*) "bufliptop=",bufliptop
140 c write(iout,*) "buflipbot=",buflipbot
141 call readi(controlcard,'SYM',symetr,1)
142 c print *,me," checkpoint 3"
143 c write (iout,*) "n_ene",n_ene
145 c Energy-term-weights section
147 C Read third record: weights
151 c print *,me," checkpoint 4"
152 C Read fourth record: masks
153 call card_concat(controlcard,.true.)
154 c write (iout,*) "card2",controlcard
156 key = "MASK_"//wname(i)(2:ilen(wname(i)))
157 call readi(controlcard,key(:ilen(key)),imask(i),0)
159 c print *,me," checkpoint 5"
160 C Read fifth record: lower limits of weights
161 call card_concat(controlcard,.true.)
162 c write (iout,*) "card3",controlcard
164 key = "WLOW_"//wname(i)(2:ilen(wname(i)))
165 call reada(controlcard,key(:ilen(key)),ww_low(i),ww(i))
167 C Read sixth record: upper limits of weights
168 call card_concat(controlcard,.true.)
169 c write (iout,*) "card4",controlcard
171 key = "WUP_"//wname(i)(2:ilen(wname(i)))
172 call reada(controlcard,key(:ilen(key)),ww_up(i),ww(i))
174 C Read seventh record: VMC parameters
175 call card_concat(controlcard,.true.)
176 c write (iout,*) "card5",controlcard
177 call readi(controlcard,"MODE",mode,3)
178 call readi(controlcard,"NSCANCYCLE",nscancycle,3)
179 call readi(controlcard,"MAXSTEP_SCAN",maxstep_scan,50)
180 call reada(controlcard,"RSTEP_SCAN",step_scan,1.0d-1)
181 call readi(controlcard,"READ_STAT",read_stat,3)
182 call readi(controlcard,"RESCALE_MODE",rescale_mode,2)
183 c init_ene = index(controlcard,"INIT_ENE").gt.0 .and. read_stat.gt.1
185 call readi(controlcard,"NMCM",nmcm,0)
186 call readi(controlcard,"MAXSCAN",maxscan,0)
187 call readi(controlcard,"MAXMIN",maxmin,100)
188 call readi(controlcard,"MAXFUN",maxfun,100)
189 call reada(controlcard,"TOLF",tolf,1.0d-6)
190 call reada(controlcard,"RTOLF",rtolf,1.0d-6)
192 if (index(controlcard,"OUT_MINIM").gt.0) out_minim=iout
194 if (index(controlcard,"PRINT_INI").gt.0) print_ini=1
196 if (index(controlcard,"PRINT_FIN").gt.0) print_fin=1
198 if (index(controlcard,"PRINT_STAT").gt.0) print_stat=1
199 call reada(controlcard,"RSTIME",rstime,9.0d2)
200 call reads(controlcard,"MINIMIZER",minimizer,"SUMSL")
201 call readi(controlcard,"OPT_MODE",opt_mode,0)
202 mod_other_params=index(controlcard,"OPTIMIZE_OTHER").gt.0
203 if (read_stat.eq.0 .and. mod_other_params) then
204 write (iout,*) "Error: only optimization of energy-term",
205 & " weights can be performed with READ_STAT=",read_stat
209 if (index(controlcard,"RESTART").gt.0) then
214 c print *,me," checkpoint 6"
217 c-------------------------------------------------------------------------------------------------
218 subroutine read_pmf_data(*)
221 include "DIMENSIONS.ZSCOPT"
225 integer ierror,kolor,klucz
227 include "COMMON.WEIGHTS"
228 include "COMMON.NAMES"
229 include "COMMON.VMCPAR"
230 include "COMMON.TORSION"
231 include "COMMON.INTERACT"
232 include "COMMON.ENERGIES"
233 include "COMMON.MINPAR"
234 include "COMMON.IOUNITS"
235 include "COMMON.TIME1"
236 include "COMMON.PROTFILES"
237 include "COMMON.CHAIN"
238 include "COMMON.CLASSES"
239 include "COMMON.THERMAL"
240 include "COMMON.FFIELD"
241 include "COMMON.OPTIM"
242 include "COMMON.CONTROL"
243 include "COMMON.SCCOR"
244 include "COMMON.SPLITELE"
245 include "COMMON.PDBSTAT"
246 include "COMMON.PMFDERIV"
247 character*800 controlcard
248 integer i,j,k,l,ii,n_ene_found,ist1,iet1,ist2,iet2,ls,le
249 integer ind,itype1,itype2,itypf,itypsc,itypp,itypt1,itypt2
250 integer ilen,lenpot,lenpre
252 character*4 liczba,liczba1
259 double precision xchuj,weitemp,weitemp_low,weitemp_up
264 c A 2/11/18 Read PMF parameters
265 call card_concat(controlcard,.true.)
266 torsion_pmf=index(controlcard,"TORSION_PMF").gt.0
267 turn_pmf=index(controlcard,"TURN_PMF").gt.0
268 eello_pmf=index(controlcard,"EELLO_PMF").gt.0
269 pdbpmf=index(controlcard,"PDBPMF").gt.0
270 write (iout,*) "TORSION_PMF", TORSION_PMF," TURN_PMF ",TURN_PMF,
271 & " EELLO_PMF",EELLO_PMF
272 call reada(controlcard,"WELLO_PMF",wello_pmf,1.0d0)
273 call reada(controlcard,"WELLO_PMF_LOW",wello_pmf_low,0.0d0)
274 call reada(controlcard,"WELLO_PMF_UP",wello_pmf_up,5.0d0)
275 call reada(controlcard,"WTURN_PMF",wturn_pmf,1.0d0)
276 call reada(controlcard,"WTURN_PMF_LOW",wturn_pmf_low,0.0d0)
277 call reada(controlcard,"WTURN_PMF_UP",wturn_pmf_up,5.0d0)
278 call reada(controlcard,"WPMF",wpmf,1.0d0)
279 call reada(controlcard,"WPDBPMF",wpdbpmf,1.0d0)
280 call reada(controlcard,"BETA_PDB",beta_pdb,0.59d0)
281 call readi(controlcard,"MASK_BETA_PDB",mask_beta_pdb,0)
282 call reada(controlcard,"BETA_PDB_LOW",beta_pdb_low,0.0d0)
283 call reada(controlcard,"BETA_PDB_UP",beta_pdb_up,1.0d0)
284 call readi(controlcard,"INCR_THETA",incr_theta,1)
285 call readi(controlcard,"INCR_GAM",incr_gam,1)
286 write (iout,*) "nloctyp",nloctyp
287 call multreada(controlcard,"E0",e0(0,-nloctyp+1),
288 & (ntyp+1)*(2*nloctyp-1),0.0d0)
289 call multreada(controlcard,"E0_LOW",e0_low(0,-nloctyp+1),
290 & (ntyp+1)*(2*nloctyp-1),
292 call multreada(controlcard,"E0_UP",e0_up(0,-nloctyp+1),
293 & (ntyp+1)*(2*nloctyp-1),
295 write (iout,*) "WTURN_PMF",WTURN_PMF,WTURN_PMF_LOW,WTURN_PMF_UP
296 write (iout,*) "WELLO_PMF",WELLO_PMF,WELLO_PMF_LOW,WELLO_PMF_UP
300 write (iout,"(2i5,3f15.5)") i,j,e0(i,j),e0_low(i,j),e0_up(i,j)
303 angle_PMF=index(controlcard,"ANGLE_PMF").gt.0
304 call reada(controlcard,"WTHET_PMF",wthet_PMF,1.0d0)
308 c-----------------------------------------------------------------------
309 subroutine read_optim_parm(*)
312 include "DIMENSIONS.ZSCOPT"
316 integer ierror,kolor,klucz
318 include "COMMON.WEIGHTS"
319 include "COMMON.NAMES"
320 include "COMMON.VMCPAR"
321 include "COMMON.TORSION"
322 include "COMMON.LOCAL"
323 include "COMMON.INTERACT"
324 include "COMMON.ENERGIES"
325 include "COMMON.MINPAR"
326 include "COMMON.IOUNITS"
327 include "COMMON.TIME1"
328 include "COMMON.PROTFILES"
329 include "COMMON.CHAIN"
330 include "COMMON.CLASSES"
331 include "COMMON.THERMAL"
332 include "COMMON.FFIELD"
333 include "COMMON.OPTIM"
334 include "COMMON.CONTROL"
335 include "COMMON.SCCOR"
336 character*800 controlcard
338 integer i,j,k,l,ii,n_ene_found,ist1,iet1,ist2,iet2,ls,le
339 integer ind,ind1,ind2,itype1,itype2,itypf,itypsc,itypp,
340 & itypt1,itypt2,masktemp,iblock,iaux,itypa
341 integer ilen,lenpot,lenpre
343 double precision aux,vb_low,vb_up,vb_rel
344 character*4 liczba,liczba1
351 double precision xchuj,weitemp,weitemp_low,weitemp_up
353 character*3 typf,typa
356 integer ind_shield /25/
360 write (iout,*) "MOD_OTHER_PARAMS ",mod_other_params
364 mask_tor(0,itypt1,itypt2,iblock)=0
365 weitor(0,itypt1,itypt2,iblock)=1.0d0
366 weitor_low(0,itypt1,itypt2,iblock)=1.0d0
367 weitor_up(0,itypt1,itypt2,iblock)=1.0d0
373 mask_tor(l,itypt1,itypt2,iblock)=0
374 weitor(l,itypt1,itypt2,iblock)=1.0
375 weitor_low(l,itypt1,itypt2,iblock)=1.0
376 weitor_up(l,itypt1,itypt2,iblock)=1.0
382 write (iout,*) "ntyp",ntyp
385 write (iout,*) "itypt1",itypt1," itypt2",itypt2,
386 & "weitor",weitor(0,itypt1,itypt2,1),eitor(0,itypt1,itypt2,2)
390 if (mod_other_params) then
392 c &"Internal parameters of UNRES energy components will be optimized"
393 call card_concat(controlcard,.true.)
394 write (iout,*) "mod_side ",controlcard
396 mod_side = (index(controlcard,"MOD_SIDE").gt.0)
400 call card_concat(controlcard,.true.)
401 do while ( index(controlcard,"END").eq.0 )
402 call split_string(controlcard,item(1),4,nitem)
403 if (nitem.eq.1 .or. item(2)(:1).eq."*") then
404 nsingle_sc=nsingle_sc+1
405 ityp_ssc(nsingle_sc)=rescode(1,item(1),0)
407 epss_low(nsingle_sc)=0.02d0
409 read (item(3),*) epss_low(nsingle_sc)
412 epss_up(nsingle_sc)=0.0d0
414 read (item(4),*) epss_up(nsingle_sc)
418 ityp_psc(1,npair_sc)=rescode(1,item(1),0)
419 ityp_psc(2,npair_sc)=rescode(1,item(2),0)
421 epsp_low(npair_sc)=0.02d0
423 read (item(3),*) epsp_low(npair_sc)
426 epsp_up(npair_sc)=0.0d0
428 read (item(4),*) epsp_up(npair_sc)
431 call card_concat(controlcard,.true.)
433 if (nsingle_sc+npair_sc.eq.0) mod_side=.false.
434 call card_concat(controlcard,.true.)
437 & index(controlcard,"MOD_SIDE_OTHER").gt.0
438 write (iout,*) "mod_side_other ",controlcard,mod_side_other
439 if (mod_side_other) then
440 mod_side_other=.false.
446 call card_concat(controlcard,.true.)
447 c write (iout,*) "mod_side_oter ",controlcard
448 do while ( index(controlcard,"END").eq.0 )
449 call reads(controlcard,"RESKIND",reskind," ")
450 itypsc=rescode(1,reskind,0)
451 if (itypsc.lt.1 .or. itypsc.gt.20) then
452 write (iout,*) "Error in SC optimization data;",
453 & " SC type must not be dummy, type is" ,restyp," ",itypsc
454 write (*,*) "Error in SC optimization data;",
455 & " SC type must not be dummy, type is" ,restyp," ",itypsc
458 call readi(controlcard,"MASK_SIGMA0",mask_sigma(1,itypsc),0)
459 call readi(controlcard,"MASK_SIGMAII",mask_sigma(2,itypsc),0)
460 call readi(controlcard,"MASK_CHIP",mask_sigma(3,itypsc),0)
461 call readi(controlcard,"MASK_ALP",mask_sigma(4,itypsc),0)
462 call reada(controlcard,"SIGMA0_LOW",sigma_low(1,itypsc),0.d0)
463 call reada(controlcard,"SIGMA0_UP",sigma_up(1,itypsc),0.0d0)
464 call reada(controlcard,"SIGMAII_LOW",sigma_low(2,itypsc),
466 call reada(controlcard,"SIGMAII_UP",sigma_up(2,itypsc),0.0d0)
467 call reada(controlcard,"CHIP_LOW",sigma_low(3,itypsc),0.d0)
468 call reada(controlcard,"CHIP_UP",sigma_up(3,itypsc),0.0d0)
469 call reada(controlcard,"ALP_LOW",sigma_low(4,itypsc),0.d0)
470 call reada(controlcard,"ALP_UP",sigma_up(4,itypsc),0.0d0)
472 if (sigma_low(k,itypsc).eq.0.0d0 .and.
473 & sigma_up(k,itypsc).eq.0.0d0) mask_sigma(k,itypsc)=0
476 mod_side_other=mod_side_other.or.mask_sigma(k,itypsc).gt.0
478 write (iout,'(a4,i3,4(i2,2f8.3))') reskind,itypsc,
479 & (mask_sigma(k,itypsc),
480 & sigma_low(k,itypsc),sigma_up(k,itypsc),k=1,4)
481 call card_concat(controlcard,.true.)
482 c write (iout,*) "mod_side_oter ",controlcard
484 write (iout,*) "Optimization flags of one-body SC parameters"
486 write (iout,'(a4,i3,4(i2,2f8.3))') restyp(i),i,
487 & (mask_sigma(k,i),sigma_low(k,i),sigma_up(k,i),k=1,4)
489 call card_concat(controlcard,.true.)
491 c write (iout,*) "mod_side_other ",mod_side_other
492 c write (iout,*) "mod_tor ",controlcard
494 mod_tor = index(controlcard,"MOD_TOR").gt.0
497 do i=-ntortyp,ntortyp
498 do j=-ntortyp,ntortyp
499 mask_tor(0,i,j,iblock)=0
500 weitor(0,i,j,iblock)=1.0d0
501 weitor_low(0,i,j,iblock)=0.0d0
502 weitor_up(0,i,j,iblock)=2.0d0
506 call card_concat(controlcard,.true.)
507 write (iout,*) controlcard
508 do while ( index(controlcard,"END").eq.0 )
509 call split_string(controlcard,item(1),7,nitem)
511 write (*,*) "Error in torsional optimization data;",
512 & " must specify both residues and type"
520 write (iout,*) "item3 ",item(3)," item4 ",item(4),
523 if (nitem.gt.2) read(item(3),*) masktemp
524 if (nitem.gt.3) read(item(4),*) weitemp
525 if (nitem.gt.4) read(item(5),*) weitemp_low
526 if (nitem.gt.5) read(item(6),*) weitemp_up
527 if (nitem.gt.6) read(item(7),*) iblock
528 write (iout,*) controlcard
529 write (iout,*) item(1)," ",item(2),weitemp,
530 & weitemp_low,weitemp_up
531 if (index(item(1),"*").gt.0) then
535 ist1=itortyp(rescode(1,item(1),0))
538 if (index(item(2),"*").gt.0) then
542 ist2=itortyp(rescode(1,item(2),0))
545 c write (iout,*) "ist1",ist1," iet1",iet1," ist2",ist2,
550 c write (iout,*) "itypt1",itypt1," itypt2",itypt2,
551 c & weitemp,weitemp_low,weitemp_up
552 mask_tor(0,itypt1,itypt2,iblock)=masktemp
553 weitor(0,itypt1,itypt2,iblock)=weitemp
554 weitor_low(0,itypt1,itypt2,iblock)=weitemp_low
555 weitor_up(0,itypt1,itypt2,iblock)=weitemp_up
556 c write (iout,*) "itypt1",itypt1," itypt2",itypt2,
557 c & mask_tor(0,itypt1,itypt2,iblock),
558 c & weitor(0,itypt1,itypt2,iblock),
559 c & weitor_low(0,itypt1,itypt2,iblock),
560 c & weitor_up(0,itypt1,itypt2,iblock)
563 call card_concat(controlcard,.true.)
564 write (iout,*) controlcard
567 if (tor_mode.gt.1) then
568 write (iout,*) "TORMODE is",tor_mode,
569 & " torsional constants are computed from energy map expansion."
573 write (iout,*) "Initialized torsional parameters:"
575 do itypt1=-ntortyp,ntortyp
576 do itypt2=-ntortyp,ntortyp
577 write (iout,'(3i5,3f10.5)') itypt1,itypt2,
578 & mask_tor(0,itypt1,itypt2,iblock),
579 & weitor(0,itypt1,itypt2,iblock),
580 & weitor_low(0,itypt1,itypt2,iblock),
581 & weitor_up(0,itypt1,itypt2,iblock)
586 if (tor_mode.eq.1) then
587 c Exchange indices because the residue order in new torsionals is reversed
589 do itypt1=-ntortyp,ntortyp
590 do itypt2=itypt1+1,ntortyp
591 iaux=mask_tor(0,itypt1,itypt2,iblock)
592 mask_tor(0,itypt1,itypt2,iblock)=
593 & mask_tor(0,itypt2,itypt1,iblock)
594 mask_tor(0,itypt2,itypt1,iblock)=iaux
595 aux=weitor(0,itypt1,itypt2,iblock)
596 weitor(0,itypt1,itypt2,iblock)=
597 & weitor(0,itypt2,itypt1,iblock)
598 weitor(0,itypt2,itypt1,iblock)=aux
599 aux=weitor_low(0,itypt1,itypt2,iblock)
600 weitor_low(0,itypt1,itypt2,iblock)=
601 & weitor_low(0,itypt2,itypt1,iblock)
602 weitor_low(0,itypt2,itypt1,iblock)=aux
603 aux=weitor_up(0,itypt1,itypt2,iblock)
604 weitor_up(0,itypt1,itypt2,iblock)=
605 & weitor_up(0,itypt2,itypt1,iblock)
606 weitor_up(0,itypt2,itypt1,iblock)=aux
611 call card_concat(controlcard,.true.)
613 write (iout,*) "mod_sccor ",controlcard
615 mod_sccor = index(controlcard,"MOD_SCCOR").gt.0
617 call card_concat(controlcard,.true.)
620 do i=-nsccortyp,nsccortyp
621 do j=-nsccortyp,nsccortyp
622 mask_tor(l,i,j,iblock)=0
623 weitor(l,i,j,iblock)=1.0d0
624 weitor_low(l,i,j,iblock)=0.0d0
625 weitor_up(l,i,j,iblock)=2.0d0
630 do while ( index(controlcard,"END").eq.0 )
631 call split_string(controlcard,item(1),7,nitem)
633 write (*,*) "Error in torsional optimization data;",
634 & " must specify both residues and type"
640 if (nitem.gt.3) read(item(4),*) masktemp
641 if (nitem.gt.4) read(item(5),*) weitemp
642 if (nitem.gt.5) read(item(6),*) weitemp_low
643 if (nitem.gt.6) read(item(7),*) weitemp_up
644 if (index(item(1),"*").gt.0) then
648 ist1=isccortyp(rescode(1,item(1),0))
651 if (index(item(2),"*").gt.0) then
655 ist2=isccortyp(rescode(1,item(2),0))
658 if (index(item(3),"*").gt.0) then
668 mask_tor(l,itypt1,itypt2,1)=masktemp
669 weitor(l,itypt1,itypt2,1)=weitemp
670 weitor_low(l,itypt1,itypt2,1)=weitemp_low
671 weitor_up(l,itypt1,itypt2,1)=weitemp_up
675 call card_concat(controlcard,.true.)
677 call card_concat(controlcard,.true.)
680 write (iout,*) "Optimizable sidechain-torsional parameters:"
681 do itypt1=-nsccortyp,nsccortyp
682 do itypt2=-nsccortyp,nsccortyp
684 if (mask_tor(l,itypt1,itypt2,1).gt.0)
685 & write (iout,'(4i5,3f10.5)') itypt1,itypt2,l,
686 & mask_tor(l,itypt1,itypt2,1),weitor(l,itypt1,itypt2,1),
687 & weitor_low(l,itypt1,itypt2,1),weitor_up(l,itypt1,itypt2,1)
692 mod_ang=tor_mode.gt.0 .and. index(controlcard,"MOD_ANGLE").gt.0
693 write (iout,*) "mod_angle ",controlcard
694 write (iout,*) "mod_ang",mod_ang
701 call card_concat(controlcard,.true.)
702 do while (index(controlcard,'END').eq.0)
703 write (iout,'(a)') "angle: ",controlcard
704 call reads(controlcard,"TYPE",typa," ")
705 itypa=rescode(1,typa,0)
706 c write (iout,*) "TYPA ",typa," itypa",itypa
707 if (itypa.eq.0 .or. itypa.gt.ntyp) then
708 write (*,*) "Error specifying angle parms"
713 write (iout,*) "bend type",itypa
714 call reada(controlcard,"VB_LOW",vb_low,-1.0d5)
715 call reada(controlcard,"VB_UP",vb_up,1.0d5)
716 call reada(controlcard,"VB_REL",vb_rel,0.0d0)
717 write (iout,*) "VB_LOW",vb_low," VB_UP",vb_up," VB_REL",vb_rel
718 do i=0,nbend_kcc_TB(itypa)
719 if (vb_rel.gt.0) then
720 write (iout,*) "v1bend_chyb=",v1bend_chyb(i,itypa)
721 v1bend_low(i,itypa)=v1bend_chyb(i,itypa)*(1.0d0
722 & -dsign(vb_rel,v1bend_chyb(i,itypa)))
723 v1bend_up(i,itypa)=v1bend_chyb(i,itypa)*(1.0d0
724 & +dsign(vb_rel,v1bend_chyb(i,itypa)))
726 v1bend_low(i,itypa)=vb_low
727 v1bend_up(i,itypa)=vb_up
730 call card_concat(controlcard,.true.)
733 call card_concat(controlcard,.true.)
735 write (iout,*) "Boundaries of angle potential coefficients"
736 write (iout,'(3a)') "Index"," Low bound"," Up bound"
738 if (mask_ang(i).eq.0) cycle
739 write (iout,'(2a)') 'Type ',restyp(iloctyp(i))
740 do j=1,nbend_kcc_TB(i)
741 write (iout,'(i5,2f15.1)') j,v1bend_low(j,i),v1bend_up(j,i)
747 write (iout,*) "mod_fourier ",controlcard
749 mod_fourier(nloctyp)=index(controlcard,"MOD_FOURIER")
751 if (mod_fourier(nloctyp).gt.0) then
752 mod_fourier(nloctyp)=0
766 mask_eenew(ii,j,k,i)=0
774 call card_concat(controlcard,.true.)
775 do while ( index(controlcard,"END").eq.0 )
776 c write(iout,*) controlcard
777 call reads(controlcard,"TYPF",typf," ")
778 itypf=rescode(1,typf,0)
779 c write (iout,*) "TYPF ",typf," itypf",itypf
780 if (itypf.eq.0 .or. itypf.gt.ntyp) then
781 write (*,*) "Error specifying fourier parms"
784 itypf=itype2loc(itypf)
785 write (iout,*) "local type",itypf
787 if (index(controlcard,"B1_LOW").gt.0) then
789 call readi(controlcard,"IND",ind,0)
790 call readi(controlcard,"COEFF",ii,0)
791 if (ind.eq.0 .or. ii.eq.0 .or. ii.gt.3) then
793 & "Error specifying B1, components undefined",ind,ii
796 mask_bnew1(ii,ind,itypf)=1
797 call reada(controlcard,"B1_LOW",bnew1_low(ii,ind,itypf),
799 call reada(controlcard,"B1_UP",bnew1_up(ii,ind,itypf),
801 mod_fourier(itypf)=mod_fourier(itypf)
802 & +mask_bnew1(ii,ind,itypf)
804 else if (index(controlcard,"B2_LOW").gt.0) then
806 mask_bnew2(ii,ind,itypf)=1
807 call readi(controlcard,"IND",ind,0)
808 call readi(controlcard,"COEFF",ii,0)
809 if (ind.eq.0 .or. ii.eq.0 .or. ii.gt.3) then
811 & "Error specifying B2, components undefined",ind,ii
814 call reada(controlcard,"B2_LOW",bnew2_low(ii,ind,itypf),
816 call reada(controlcard,"B2_UP",bnew2_up(ii,ind,itypf),
818 mod_fourier(itypf)=mod_fourier(itypf)
819 & +mask_bnew2(ii,ind,itypf)
821 else if (index(controlcard,"C_LOW").gt.0) then
823 call readi(controlcard,"IND",ind,0)
824 call readi(controlcard,"COEFF",ii,0)
825 if (ind.eq.0 .or. ii.eq.0 .or. ii.gt.3) then
827 & "Error specifying C, components undefined",ind,ii
830 mask_ccnew(ii,ind,itypf)=1
831 call reada(controlcard,"C_LOW",ccnew_low(ii,ind,itypf),.1d0)
832 call reada(controlcard,"C_UP",ccnew_up(ii,ind,itypf),0.0d0)
833 mod_fourier(itypf)=mod_fourier(itypf)
834 & +mask_ccnew(ii,ind,itypf)
836 else if (index(controlcard,"D_LOW").gt.0) then
838 call readi(controlcard,"IND",ind,0)
839 call readi(controlcard,"COEFF",ii,0)
840 if (ind.eq.0 .or. ii.eq.0 .or. ii.gt.3) then
842 & "Error specifying D, components undefined",ind,ii
845 mask_ddnew(ii,ind,itypf)=1
846 call reada(controlcard,"D_LOW",ddnew_low(ii,ind,itypf),
848 call reada(controlcard,"D_UP",ddnew_up(ii,ind,itypf),
850 mod_fourier(itypf)=mod_fourier(itypf)
851 & +mask_ddnew(ii,ind,itypf)
853 else if (index(controlcard,"E0_LOW").gt.0) then
855 call readi(controlcard,"COEFF",ii,0)
856 if (ii.eq.0 .or. ii.gt.3) then
858 & "Error specifying E0, components undefined",ii
861 mask_e0new(ii,itypf)=1
862 call reada(controlcard,"E0_LOW",e0new_low(ii,itypf),
864 call reada(controlcard,"E0_UP",e0new_up(ii,itypf),
866 mod_fourier(itypf)=mod_fourier(itypf)
867 & +mask_e0new(ii,itypf)
869 else if (index(controlcard,"E_LOW").gt.0) then
871 call readi(controlcard,"IND1",ind1,0)
872 call readi(controlcard,"IND2",ind2,0)
873 call readi(controlcard,"COEFF",ii,0)
874 if (ind1.eq.0 .or. ind2.eq.0 .or. ii.eq.0 .or. ii.gt.2) then
876 & "Error specifying E, components undefined",ind1,ind2,ii
879 mask_eenew(ii,ind1,ind2,itypf)=1
880 call reada(controlcard,"E_LOW",
881 & eenew_low(ii,ind1,ind2,itypf),0.1d0)
882 call reada(controlcard,"E_UP",
883 & eenew_up(ii,ind1,ind2,itypf),0.0d0)
884 mod_fourier(itypf)=mod_fourier(itypf)
885 & +mask_eenew(ii,ind1,ind2,itypf)
887 call card_concat(controlcard,.true.)
889 call card_concat(controlcard,.true.)
890 write (iout,*) "mod_fouriertor card ",controlcard
891 mod_fouriertor(nloctyp)=index(controlcard,"MOD_FOURIERTOR")
892 write (iout,*) "mod_fouriertor value",mod_fouriertor(nloctyp)
893 write (2,*) "SPLIT_FOURIERTOR",SPLIT_FOURIERTOR,
894 & " tor_mode",tor_mode
895 IF (SPLIT_FOURIERTOR .and. tor_mode.eq.2
896 & .and. mod_fouriertor(nloctyp).gt.0) THEN
901 mask_bnew1tor(ii,j,i)=0
902 mask_bnew2tor(ii,j,i)=0
903 mask_ccnewtor(ii,j,i)=0
904 mask_ddnewtor(ii,j,i)=0
910 mask_eenewtor(ii,j,k,i)=0
915 mask_e0newtor(ii,i)=0
918 call card_concat(controlcard,.true.)
919 do while ( index(controlcard,"END").eq.0 )
920 c write(iout,*) controlcard
921 call reads(controlcard,"TYPF",typf," ")
922 itypf=rescode(1,typf,0)
923 c write (iout,*) "TYPF ",typf," itypf",itypf
924 if (itypf.eq.0 .or. itypf.gt.ntyp) then
925 write (*,*) "Error specifying fourier parms"
928 itypf=itype2loc(itypf)
929 write (iout,*) "local type",itypf
931 if (index(controlcard,"B1_LOW").gt.0) then
933 call readi(controlcard,"IND",ind,0)
934 call readi(controlcard,"COEFF",ii,0)
935 if (ind.eq.0 .or. ii.eq.0 .or. ii.gt.3) then
937 & "Error specifying B1, components undefined",ind,ii
940 mask_bnew1tor(ii,ind,itypf)=1
941 call reada(controlcard,"B1_LOW",bnew1tor_low(ii,ind,itypf),
943 call reada(controlcard,"B1_UP",bnew1tor_up(ii,ind,itypf),
945 mod_fouriertor(itypf)=mod_fouriertor(itypf)
946 & +mask_bnew1tor(ii,ind,itypf)
948 else if (index(controlcard,"B2_LOW").gt.0) then
950 mask_bnew2tor(ii,ind,itypf)=1
951 call readi(controlcard,"IND",ind,0)
952 call readi(controlcard,"COEFF",ii,0)
953 if (ind.eq.0 .or. ii.eq.0 .or. ii.gt.3) then
955 & "Error specifying B2, components undefined",ind,ii
958 call reada(controlcard,"B2_LOW",bnew2tor_low(ii,ind,itypf),
960 call reada(controlcard,"B2_UP",bnew2tor_up(ii,ind,itypf),
962 mod_fouriertor(itypf)=mod_fouriertor(itypf)
963 & +mask_bnew2tor(ii,ind,itypf)
965 else if (index(controlcard,"C_LOW").gt.0) then
967 call readi(controlcard,"IND",ind,0)
968 call readi(controlcard,"COEFF",ii,0)
969 if (ind.eq.0 .or. ii.eq.0 .or. ii.gt.3) then
971 & "Error specifying C, components undefined",ind,ii
974 mask_ccnewtor(ii,ind,itypf)=1
975 call reada(controlcard,"C_LOW",ccnewtor_low(ii,ind,itypf),
977 call reada(controlcard,"C_UP",ccnewtor_up(ii,ind,itypf),
979 mod_fouriertor(itypf)=mod_fouriertor(itypf)
980 & +mask_ccnewtor(ii,ind,itypf)
982 else if (index(controlcard,"D_LOW").gt.0) then
984 call readi(controlcard,"IND",ind,0)
985 call readi(controlcard,"COEFF",ii,0)
986 if (ind.eq.0 .or. ii.eq.0 .or. ii.gt.3) then
988 & "Error specifying D, components undefined",ind,ii
991 mask_ddnewtor(ii,ind,itypf)=1
992 call reada(controlcard,"D_LOW",ddnewtor_low(ii,ind,itypf),
994 call reada(controlcard,"D_UP",ddnewtor_up(ii,ind,itypf),
996 mod_fouriertor(itypf)=mod_fouriertor(itypf)
997 & +mask_ddnewtor(ii,ind,itypf)
999 else if (index(controlcard,"E0_LOW").gt.0) then
1001 call readi(controlcard,"COEFF",ii,0)
1002 if (ii.eq.0 .or. ii.gt.3) then
1004 & "Error specifying E0, components undefined",ii
1007 mask_e0newtor(ii,itypf)=1
1008 call reada(controlcard,"E0_LOW",e0newtor_low(ii,itypf),
1010 call reada(controlcard,"E0_UP",e0newtor_up(ii,itypf),
1012 mod_fouriertor(itypf)=mod_fouriertor(itypf)
1013 & +mask_e0newtor(ii,itypf)
1015 else if (index(controlcard,"E_LOW").gt.0) then
1017 call readi(controlcard,"IND1",ind1,0)
1018 call readi(controlcard,"IND2",ind2,0)
1019 call readi(controlcard,"COEFF",ii,0)
1020 if (ind1.eq.0 .or. ind2.eq.0 .or. ii.eq.0 .or. ii.gt.2) then
1022 & "Error specifying E, components undefined",ind1,ind2,ii
1025 mask_eenewtor(ii,ind1,ind2,itypf)=1
1026 call reada(controlcard,"E_LOW",
1027 & eenewtor_low(ii,ind1,ind2,itypf),0.1d0)
1028 call reada(controlcard,"E_UP",
1029 & eenewtor_up(ii,ind1,ind2,itypf),0.0d0)
1030 mod_fouriertor(itypf)=mod_fouriertor(itypf)
1031 & +mask_eenewtor(ii,ind1,ind2,itypf)
1033 call card_concat(controlcard,.true.)
1035 call card_concat(controlcard,.true.)
1036 write (2,*) "End read FOURIERTOR ",controlcard
1038 ENDIF ! SPLIT_FOURIERTOR
1041 do itypf=0,nloctyp-1
1042 write (iout,*) "itypf",itypf," mod_fourier",
1043 & mod_fourier(itypf)
1044 mod_fourier(nloctyp)=mod_fourier(nloctyp)
1045 & +mod_fourier(itypf)
1047 write (iout,*) "mod_fourier all",mod_fourier(nloctyp)
1048 do itypf=0,nloctyp-1
1049 write (iout,*) "itypf",itypf," mod_fouriertor",
1050 & mod_fouriertor(itypf)
1051 mod_fouriertor(nloctyp)=mod_fouriertor(nloctyp)
1052 & +mod_fouriertor(itypf)
1054 write (iout,*) "mod_fouriertor all",mod_fouriertor(nloctyp)
1056 if (mod_fourier(nloctyp).gt.0) then
1057 call card_concat(controlcard,.true.)
1058 do while ( index(controlcard,"END").eq.0 )
1059 call readi(controlcard,"TYPF",typf," ")
1060 itypf=rescode(1,typf,0)
1061 if (itypf.eq.0 .or. itypf.gt.ntyp) then
1062 write (*,*) "Error specifying fourier parms"
1065 itypf=itype2loc(itypf)
1066 call readi(controlcard,"IND",ind,0)
1067 call reada(controlcard,"B_LOW",b_low(ind,itypf),0.1d0)
1068 call reada(controlcard,"B_UP",b_up(ind,itypf),0.0d0)
1069 mask_fourier(ind,itypf)=1
1070 mod_fourier(itypf)=mod_fourier(itypf)
1071 & +mask_fourier(ind,itypf)
1072 mod_fourier(nloctyp)=mod_fourier(nloctyp)
1073 & +mask_fourier(ind,itypf)
1074 call card_concat(controlcard,.true.)
1076 call card_concat(controlcard,.true.)
1078 do itypf=0,nloctyp-1
1079 write (iout,*) "itypf",itypf," mod_fourier",mod_fourier(itypf)
1080 mod_fourier(nloctyp)=mod_fourier(nloctyp)+mod_fourier(itypf)
1082 write (iout,*) "mod_fourier all",mod_fourier(nloctyp)
1091 mod_elec=index(controlcard,"MOD_ELEC").gt.0
1094 call card_concat(controlcard,.true.)
1095 do while ( index(controlcard,"END").eq.0 )
1096 c write (iout,*) "controlcard ",controlcard
1097 call readi(controlcard,"TYPE1",itype1,0)
1098 call readi(controlcard,"TYPE2",itype2,0)
1099 c write (iout,*) "itype1",itype1," itype2",itype2
1100 if (itype1.eq.0 .or. itype1.gt.2 .or. itype2.eq.0
1101 & .or. itype2.gt.2) then
1102 write (iout,*) "Error specifying elec parms"
1105 if (index(controlcard,"EPP").gt.0) then
1107 mask_elec(itype1,itype2,1)=1
1108 mask_elec(itype2,itype1,1)=1
1109 call reada(controlcard,"EPP_LOW",epp_low(itype1,itype2),
1111 epp_low(itype2,itype1)=epp_low(itype1,itype2)
1112 call reada(controlcard,"EPP_UP",epp_up(itype1,itype2),
1114 epp_up(itype2,itype1)=epp_up(itype1,itype2)
1116 if (index(controlcard,"RPP").gt.0) then
1118 mask_elec(itype1,itype2,2)=1
1119 mask_elec(itype2,itype1,2)=1
1120 call reada(controlcard,"RPP_LOW",rpp_low(itype1,itype2),
1122 rpp_low(itype2,itype1)=rpp_low(itype1,itype2)
1123 call reada(controlcard,"RPP_UP",rpp_up(itype1,itype2),
1125 rpp_up(itype2,itype1)=rpp_up(itype1,itype2)
1127 if (index(controlcard,"ELPP6").gt.0) then
1129 mask_elec(itype1,itype2,3)=1
1130 mask_elec(itype2,itype1,3)=1
1131 call reada(controlcard,"ELPP6_LOW",
1132 & elpp6_low(itype1,itype2),0.1d0)
1133 elpp6_low(itype2,itype1)=elpp6_low(itype1,itype2)
1134 call reada(controlcard,"ELPP6_UP",
1135 & elpp6_up(itype1,itype2),0.0d0)
1136 elpp6_up(itype2,itype1)=elpp6_up(itype1,itype2)
1138 if (index(controlcard,"ELPP3").gt.0) then
1140 mask_elec(itype1,itype2,4)=1
1141 mask_elec(itype2,itype1,4)=1
1142 call reada(controlcard,"ELPP3_LOW",
1143 & elpp3_low(itype1,itype2),0.1d0)
1144 elpp3_low(itype2,itype1)=elpp3_low(itype1,itype2)
1145 call reada(controlcard,"ELPP3_UP",
1146 & elpp3_up(itype1,itype2),0.0d0)
1147 elpp3_up(itype2,itype1)=elpp3_up(itype1,itype2)
1149 call card_concat(controlcard,.true.)
1151 call card_concat(controlcard,.true.)
1160 mod_scp=index(controlcard,"MOD_SCP").gt.0
1163 call card_concat(controlcard,.true.)
1164 do while (index(controlcard,"END").eq.0)
1165 if (index(controlcard,"EPSCP").gt.0) then
1167 call readi(controlcard,"ITYPSC",itypsc,0)
1168 call readi(controlcard,"ITYPP",itypp,0)
1169 if (itypsc.gt.20 .or. itypp.eq.0 .or. itypp.gt.2) then
1170 write (iout,*) "Error specifying scp parms"
1173 mask_scp(itypsc,itypp,1)=1
1174 call reada(controlcard,"EPSCP_LOW",
1175 & epscp_low(itypsc,itypp),0.1d0)
1176 call reada(controlcard,"EPSCP_UP",
1177 & epscp_up(itypsc,itypp),0.0d0)
1179 if (index(controlcard,"RSCP").gt.0) then
1181 call readi(controlcard,"ITYPSC",itypsc,0)
1182 call readi(controlcard,"ITYPP",itypp,0)
1183 mask_scp(itypsc,itypp,2)=1
1184 call readi(controlcard,"ITYPSC",itypsc,0)
1185 call readi(controlcard,"ITYPP",itypp,0)
1186 if (itypsc.gt.20 .or. itypp.eq.0 .or. itypp.gt.2) then
1187 write (iout,*) "Error specifying scp parms"
1190 call reada(controlcard,"RSCP_LOW",
1191 & rscp_low(itypsc,itypp),0.1d0)
1192 c write(iout,*)itypsc,itypp,rscp_low(itypsc,itypp)
1193 call reada(controlcard,"RSCP_UP",
1194 & rscp_up(itypsc,itypp),0.0d0)
1195 c write(iout,*)itypsc,itypp,rscp_up(itypsc,itypp)
1197 call card_concat(controlcard,.true.)
1200 write (iout,*) "END ",controlcard
1203 & mod_fourier(nloctyp).gt.0 .or. mod_elec .or. mod_scp
1204 & .or. mod_sccor .or. mod_ang .or. imask(ind_shield).eq.1
1205 if (read_stat.lt.2. .and. mod_other_params) then
1206 write (iout,*)"Error - only weights and sidechain parameters",
1207 & " can be optimized with READ_STAT=",read_stat
1211 init_ene = init_ene .or. read_stat.eq.2
1213 write (iout,*) "End read: MOD_OTHER_PARAMS ",mod_other_params
1214 c write (*,*) "MOD_SIDE ",mod_side," MOD_FOURIER",
1215 c & mod_fourier(nloctyp),
1216 c & " MOD_ELEC ",mod_elec," MOD_SCP ",mod_scp
1217 init_ene=init_ene .or. mod_other_params
1218 c write (iout,*) "init_ene",init_ene
1223 c-----------------------------------------------------------------------------
1224 subroutine print_general_data(*)
1226 include "DIMENSIONS"
1227 include "DIMENSIONS.ZSCOPT"
1230 include "COMMON.MPI"
1231 integer ierror,kolor,klucz
1233 include "COMMON.WEIGHTS"
1234 include "COMMON.NAMES"
1235 include "COMMON.VMCPAR"
1236 include "COMMON.TORSION"
1237 include "COMMON.LOCAL"
1238 include "COMMON.INTERACT"
1239 include "COMMON.ENERGIES"
1240 include "COMMON.MINPAR"
1241 include "COMMON.IOUNITS"
1242 include "COMMON.TIME1"
1243 include "COMMON.PROTFILES"
1244 include "COMMON.CHAIN"
1245 include "COMMON.CLASSES"
1246 include "COMMON.THERMAL"
1247 include "COMMON.FFIELD"
1248 include "COMMON.OPTIM"
1249 include "COMMON.CONTROL"
1250 include "COMMON.SCCOR"
1251 character*800 controlcard
1252 integer i,j,k,l,ii,n_ene_found,itypt,jtypt
1253 integer ind,itype1,itype2,itypf,itypsc,itypp
1254 integer ilen,lenpot,lenpre
1256 character*4 liczba,liczba1
1258 write (iout,*) "Single-point target function evaluation"
1259 else if (mode.eq.2) then
1260 write (iout,*) "Grid search of the parameter space"
1261 else if (mode.eq.3) then
1262 write (iout,*) "Minimization of the target function"
1264 write (iout,*) "Wrong MODE",mode,", should be 1, 2, or 3"
1268 write (iout,*) "RESCALE_MODE",rescale_mode
1269 c mod_other_params=index(controlcard,"OPTIMIZE_OTHER").gt.0
1270 c if (read_stat.eq.0 .and. mod_other_params) then
1271 c write (iout,*) "Error: only optimization of energy-term",
1272 c & " weights can be performed with READ_STAT=",read_stat
1277 write (iout,*) "Parameters of the SUMSL procedure:"
1278 write (iout,'(a,t15,i5)') "MAXMIN",maxmin
1279 write (iout,'(a,t15,i5)') "MAXFUN",maxfun
1280 write (iout,'(a,t15,e15.7)') "TOLF",tolf
1281 write (iout,'(a,t15,e15.7)') "RTOLF",rtolf
1283 if (mod_other_params) then
1285 &"Internal parameters of UNRES energy components will be optimized"
1286 c call card_concat(controlcard,.true.)
1287 c mod_side = (index(controlcard,"MOD_SIDE").gt.0)
1289 write (iout,*) "SC epsilons to be optimized:"
1290 write (iout,*) "Single: eps(i,j)=eps(i,j)+(x(i)+x(j))/2"
1292 write (iout,*) restyp(ityp_ssc(i)),epss_low(i),epss_up(i)
1294 write (iout,*) "Pairs: eps(i,j)=eps(i,j)+x(i,j):"
1296 write (iout,*) restyp(ityp_psc(1,i)),
1297 & restyp(ityp_psc(2,i)),epsp_low(i),epsp_up(i)
1301 write (iout,*)"Torsional weights/coefficients to be optimized"
1302 write(iout,'(a)') "TYP1 TYP2 WEIGHT",
1303 & " LOWER BOUND UPPER BOUND"
1304 do itypt=-nsccortyp,nsccortyp
1305 do jtypt=-nsccortyp,nsccortyp
1307 if (mask_tor(l,itypt,jtypt,1).gt.0) then
1308 write(iout,'(3a4,3f10.5)')l,restyp(itypt),restyp(jtypt),
1309 & weitor(l,itypt,jtypt,1),weitor_low(l,itypt,jtypt,1),
1310 & weitor_up(l,itypt,jtypt,1)
1316 c 7/8/17 AL: Optimization of the bending parameters
1318 write (iout,*) "Boundaries of angle potential coefficients"
1319 write (iout,'(3a)') "Index"," Low bound"," Up bound"
1321 if (mask_ang(i).eq.0) cycle
1322 write (iout,'(2a)') 'Type ',restyp(iloctyp(i))
1323 do j=1,nbend_kcc_TB(i)
1324 write (iout,'(i5,2f15.3)') j,v1bend_low(j,i),v1bend_up(j,i)
1328 if (mod_fourier(nloctyp).gt.0) then
1329 write (iout,*) "Fourier coefficients to be optimized"
1330 do itypf=0,nloctyp-1
1331 if (mod_fourier(itypf).gt.0) then
1332 write (iout,'(3a,i2)') "Type ",restyp(iloctyp(itypf)),
1333 & " number of coeffs",mod_fourier(itypf)
1334 write(iout,'(a)') "NAME COEFF LOWER BOUND UPPER BOUND"
1338 if (mask_bnew1(k,j,itypf).gt.0)
1339 & write (iout,'(2hB1,2i2,f10.5)') k,j,bnew1(k,j,itypf),
1340 & bnew1_low(k,j,itypf),bnew1_up(k,j,itypf)
1345 if (mask_bnew2(k,j,itypf).gt.0)
1346 & write (iout,'(2hB2,2i2,3f11.5)') k,j,bnew2(k,j,itypf),
1347 & bnew2_low(k,j,itypf),bnew2_up(k,j,itypf)
1352 if (mask_ccnew(k,j,itypf).gt.0)
1353 & write (iout,'(2hCC,2i2,3f11.5)') k,j,ccnew(k,j,itypf),
1354 & ccnew_low(k,j,itypf),ccnew_up(k,j,itypf)
1359 if (mask_ddnew(k,j,itypf).gt.0)
1360 & write (iout,'(2hDD,2i2,3f11.5)') k,j,ddnew(k,j,itypf),
1361 & ddnew_low(k,j,itypf),ddnew_up(k,j,itypf)
1365 if (mask_e0new(j,itypf).gt.0)
1366 & write (iout,'(2hE0,i2,3f11.5)') j,e0new(j,itypf),
1367 & e0new_low(j,itypf),e0new_up(j,itypf)
1372 if (mask_eenew(l,k,j,itypf).gt.0)
1373 & write (iout,'(2hEE,3i2,3f11.5)')
1374 & l,k,j,eenew(l,k,j,itypf),eenew_low(l,k,j,itypf),
1375 & eenew_up(l,k,j,itypf)
1381 if (mask_fourier(i,itypf).gt.0) then
1382 write (iout,'(1hB,i2,3f11.5)')
1383 & i,b(i,itypf),b_low(i,itypf),b_up(i,itypf)
1392 write (iout,*) "Electrostatic parameters to be optimized"
1395 if (mask_elec(itype1,itype2,1).gt.0)
1396 & write (iout,'(2i3," EPP",f8.3," EPP_LOW",f8.3,
1398 & itype1,itype2,epp(itype1,itype2),epp_low(itype1,itype2),
1399 & epp_up(itype1,itype2)
1400 if (mask_elec(itype1,itype2,2).gt.0)
1401 & write (iout,'(2i3," RPP",f8.3," RPP_LOW",f8.3,
1403 & itype1,itype2,rpp(itype1,itype2),rpp_low(itype1,itype2),
1404 & rpp_up(itype1,itype2)
1405 if (mask_elec(itype1,itype2,3).gt.0)
1406 & write (iout,'(2i3," ELPP6",f8.3," ELPP6_LOW",f8.3,
1407 & " ELPP6_UP",f8.3)')
1408 & itype1,itype2,elpp6(itype1,itype2),
1409 & elpp6_low(itype1,itype2),elpp6_up(itype1,itype2)
1410 if (mask_elec(itype1,itype2,4).gt.0)
1411 & write (iout,'(2i3," ELPP3",f8.3," ELPP3_LOW",f8.3,
1412 & " ELPP3_UP",f8.3)')
1413 & itype1,itype2,elpp3(itype1,itype2),
1414 & elpp3_low(itype1,itype2),elpp3_up(itype1,itype2)
1421 write (iout,*) "SCP parameters to be optimized:"
1422 if (mask_scp(0,1,1)+mask_scp(0,2,1)+mask_scp(0,1,2)+
1423 & mask_scp(0,2,2) .gt. 0) then
1425 & "SCP parameters are assumed to depend on peptide group type only"
1427 if (mask_scp(0,j,1).gt.0)
1428 & write (iout,'(i3," EPSCP",f8.3," EPSCP_LOW",f8.3,
1429 & " EPSCP_UP",f8.3)') j,eps_scp(1,j),epscp_low(0,j),
1431 if (mask_scp(0,j,2).gt.0)
1432 & write (iout,'(i3," RSCP",f8.3," RSCP_LOW",f8.3,
1433 & " RSCP_UP",f8.3)') j,rscp(1,j),rscp_low(0,j),
1439 if (mask_scp(i,j,1).gt.0)
1440 & write (iout,'(2i3," EPSCP",f8.3," EPSCP_LOW",f8.3,
1441 & " EPSCP_UP",f8.3)') i,j,eps_scp(i,j),epscp_low(i,j),
1443 if (mask_scp(i,j,2).gt.0)
1444 & write (iout,'(2i3," RSCP",f8.3," RSCP_LOW",f8.3,
1445 & " RSCP_UP",f8.3)') i,j,rscp(i,j),rscp_low(i,j),
1452 write (iout,*) "MOD_OTHER_PARAMS ",mod_other_params
1453 write (iout,*) "MOD_SIDE ",mod_side," MOD_FOURIER",
1454 & mod_fourier(nloctyp),
1455 & " MOD_ELEC ",mod_elec," MOD_SCP ",mod_scp," mod_ang",mod_ang
1456 init_ene=init_ene .or. mod_other_params
1457 write (iout,*) "init_ene",init_ene
1462 c-----------------------------------------------------------------------------
1463 subroutine read_protein_data(*)
1465 include "DIMENSIONS"
1466 include "DIMENSIONS.ZSCOPT"
1469 integer IERROR,ERRCODE,STATUS(MPI_STATUS_SIZE)
1470 include "COMMON.MPI"
1472 include "COMMON.CONTROL"
1473 include "COMMON.CHAIN"
1474 include "COMMON.CLASSES"
1475 include "COMMON.COMPAR"
1476 include "COMMON.ENERGIES"
1477 include "COMMON.IOUNITS"
1478 include "COMMON.PROTFILES"
1479 include "COMMON.PROTNAME"
1480 include "COMMON.VMCPAR"
1481 include "COMMON.OPTIM"
1482 include "COMMON.WEIGHTS"
1483 include "COMMON.NAMES"
1484 include "COMMON.ALLPROT"
1485 include "COMMON.THERMAL"
1486 include "COMMON.TIME1"
1487 include "COMMON.WEIGHTDER"
1488 character*64 nazwa,key
1489 character*16000 controlcard
1490 character*16000 all_protfiles
1491 integer i,j,k,kk,l,iprot,ii,if,ib,ibatch,nn,nn1,iww,maskcheck,
1492 & il,inat,ilevel,weightread,jfrag,jclass,nfragm,iparm
1493 integer nrec,nlines,iscor
1494 double precision energ,wangnorm(maxT),wq(maxT),wrms(maxT),
1495 & wrgy(maxT),wsign(maxT),wangnat(maxT),wqnat(maxT),wrmsnat(maxT),
1496 & wrgynat(maxT),wcorangnorm(maxT),wcorq(maxT),
1497 & wcorrms(maxT),wcorrgy(maxT),wcorsign(maxT),wcorangnat(maxT),
1498 & wcorqnat(maxT),wcorrmsnat(maxT),wcorrgynat(maxT),
1499 & angnormlow(maxT),qlow(maxT),rmslow(maxT),
1500 & rgylow(maxT),signlow(maxT),angnatlow(maxT),
1501 & qnatlow(maxT),rmsnatlow(maxT),rgynatlow(maxT),
1502 & angcorlow(maxT),qcorlow(maxT),rmscorlow(maxT),rgycorlow(maxT),
1503 & signcorlow(maxT),angcornatlow(maxT),qcornatlow(maxT),
1504 & rmscornatlow(maxT),rgycornatlow(maxT),signcornatlow(maxT),
1505 & angnormup(maxT),qup(maxT),rmsup(maxT),rgyup(maxT),signup(maxT),
1506 & angnatup(maxT),qnatup(maxT),rmsnatup(maxT),rgynatup(maxT),
1507 & angcorup(maxT),qcorup(maxT),rmscorup(maxT),rgycorup(maxT),
1509 & angcornatup(maxT),qcornatup(maxT),rmscornatup(maxT),
1510 & rgycornatup(maxT),signcornatup(MaxT)
1513 double precision ebia(maxprot),rjunk
1515 character*64 zeros /
1516 &'0000000000000000000000000000000000000000000000000000000000000000'
1519 c print *,"Processor",me," calls read_protein_data"
1521 C Read seventh record: general data of proteins used for calibration
1522 call card_concat(controlcard,.true.)
1523 c write(2, *)controlcard
1524 call readi(controlcard,"NPROT",nprot,0)
1525 pdbref=index(controlcard,"PDBREF").gt.0
1526 print_refstr=index(controlcard,"PRINT_REFSTR").gt.0
1527 if (nprot.eq.0) then
1528 write(iout,*) "Error: at least one protein must be specified."
1534 read (inp,'(a)') protname(iprot)
1536 write (iout,*) "Reading data of protein",iprot," named ",
1538 call card_concat(controlcard,.true.)
1539 call reada(controlcard,"ENECUT_MIN",enecut_min(iprot),15.0d0)
1540 call reada(controlcard,"ENECUT_MAX",enecut_max(iprot),100.0d0)
1541 call reada(controlcard,"ENECUT",enecut(iprot),enecut_min(iprot))
1542 if (enecut(iprot).lt.enecut_min(iprot))
1543 & enecut(iprot)=enecut_min(iprot)
1544 if (enecut_max(iprot).le.enecut_min(iprot))
1545 & enecut_max(iprot)=2*enecut_min(iprot)
1546 write (iout,'(3(a,f9.1))') "ENECUT",enecut(iprot)," ENECUT_MIN",
1547 & enecut_min(iprot)," ENECUT_MAX",enecut_max(iprot)
1548 call readi(controlcard,"HEFAC",hefac(iprot),50)
1549 call readi(controlcard,"HTFAC",htfac(iprot),50)
1550 call readi(controlcard,"HELOW",hemax_low(iprot),20)
1551 call readi(controlcard,"HTLOW",htmax_low(iprot),20)
1552 write (iout,*) "iprot",iprot,
1553 & " hefac",hefac(iprot)," helow",hemax_low(iprot),
1554 & " htfac",htfac(iprot)," htlow",htmax_low(iprot)
1555 c 7/27/2013 AL Read maximum likelihood data
1556 call card_concat(controlcard,.true.)
1557 call readi(controlcard,"NBETA_L",nbeta(1,iprot),0)
1558 write (iout,*) "NBETA_L",nbeta(1,iprot)
1559 caonly(iprot)=index(controlcard,"CAONLY").gt.0
1560 sconly(iprot)=index(controlcard,"SCONLY").gt.0
1561 rmscomp(iprot)=index(controlcard,"RMSCOMP").gt.0
1562 anglecomp(iprot)=index(controlcard,"ANGLECOMP").gt.0
1563 sidecomp(iprot)=index(controlcard,"SIDECOMP").gt.0
1564 call reada(controlcard,"SIGMA",sigma2(iprot),4.0d0)
1565 call reada(controlcard,"SIGMAANG",sigmaang2(iprot),4.0d0)
1566 call reada(controlcard,"SIGMASIDE",sigmaside2(iprot),4.0d0)
1567 write (iout,*) "RMSCOMP",rmscomp(iprot)," SIGMA",sigma2(iprot),
1568 & " CAONLY ",caonly(iprot)," SCONLY",sconly(iprot)
1569 write (iout,*) "ANGLECOMP",anglecomp(iprot),
1570 & " SIGMAANG",sigmaang2(iprot)
1571 write (iout,*) "SIDECOMP",sidecomp(iprot),
1572 & " SIGMASIDE",sigmaside2(iprot)
1573 do ib=1,nbeta(1,iprot)
1574 read(inp,*)betaT(ib,1,iprot),weilik(ib,iprot),
1576 write (iout,*) i,betaT(ib,1,iprot),weilik(ib,iprot),
1579 c 7/27/2013 AL Read heat-capacity data
1580 call card_concat(controlcard,.true.)
1581 call readi(controlcard,"NBETA_CV",nbeta(2,iprot),0)
1582 call reada(controlcard,"WCV",wcv(iprot),1.0d0)
1583 call reada(controlcard,"BASE",heatbase(iprot),0.0d0)
1584 write (iout,*) "NBETA_CV",nbeta(2,iprot)," WCV",wcv(iprot)
1585 do ib=1,nbeta(2,iprot)
1586 read(inp,*) betaT(ib,2,iprot),target_cv(ib,iprot),
1588 weiCv(ib,iprot)=weiCv(ib,iprot)*wcv(iprot)
1589 write (iout,*) betaT(ib,2,iprot),target_cv(ib,iprot),
1592 write (iout,*) "Experimental heat capacity curve"
1593 do ib=1,nbeta(2,iprot)
1594 write (iout,'(f6.2,2f10.5)') betaT(ib,2,iprot),
1595 & target_cv(ib,iprot),weiCv(ib,iprot)
1597 write (iout,'(a,f10.5)') "Baseline",heatbase(iprot)
1599 c Conformation-dependent averages
1600 call card_concat(controlcard,.true.)
1601 call readi(controlcard,"NATLIKE",natlike(iprot),0)
1602 do i=1,natlike(iprot)
1603 call card_concat(controlcard,.true.)
1604 call reada(controlcard,"WNAT",wnat(i,iprot),1.0d0)
1605 call readi(controlcard,"NUMNAT",numnat(i,iprot),1)
1606 call readi(controlcard,"NATDIM",natdim(i,iprot),1)
1607 do ib=1,nbeta(i+2,iprot)
1608 read(inp,*)betaT(ib,i+2,iprot),(weinat(k,ib,i,iprot),
1609 & nuexp(k,ib,i,iprot),k=1,natdim(i,iprot))
1612 do i=1,natlike(iprot)+2
1613 do j=1,nbeta(i,iprot)
1614 betaT(j,i,iprot)=1.0d0/(Rgas*betaT(j,i,iprot))
1615 write (2,*) "R i",i," j",j," beta",betaT(j,i,iprot)
1620 C Read names of files with the data for protein IPROT
1621 call card_concat(controlcard,.false.)
1623 if (iparm.eq.myparm) then
1624 call split_string(controlcard,protfiles(1,iprot),
1625 & maxfile_prot,nfile_prot(iprot))
1627 write(iout,*)"iprot",iprot," nfile",nfile_prot(iprot)
1629 & (protfiles(i,iprot),i=1,nfile_prot(iprot))
1635 c Read molecular information of the protein
1636 call molread_zs(iprot)
1637 c 3/31/04 AL Read the reference structures of protein iprot
1638 c print *,"Calling read_ref_structure"
1639 call read_ref_structure(iprot,*11)
1641 write (iout,*) "Protein",iprot," left READ_REF_STRUCTURE"
1647 c-------------------------------------------------------------------------------
1648 subroutine read_database(*)
1650 include "DIMENSIONS"
1651 include "DIMENSIONS.ZSCOPT"
1654 integer IERROR,ERRCODE,STATUS(MPI_STATUS_SIZE)
1655 include "COMMON.MPI"
1657 include "COMMON.CHAIN"
1658 include "COMMON.INTERACT"
1659 include "COMMON.CLASSES"
1660 include "COMMON.ENERGIES"
1661 include "COMMON.IOUNITS"
1662 include "COMMON.PROTFILES"
1663 include "COMMON.PROTNAME"
1664 include "COMMON.VMCPAR"
1665 include "COMMON.NAMES"
1666 include "COMMON.ALLPROT"
1667 include "COMMON.WEIGHTS"
1668 include "COMMON.WEIGHTDER"
1669 include "COMMON.VAR"
1670 include "COMMON.SBRIDGE"
1671 include "COMMON.GEO"
1672 include "COMMON.COMPAR"
1673 include "COMMON.OPTIM"
1675 character*16000 controlcard
1676 character*16000 all_protfiles
1677 character*4 liczba,liczba1
1678 integer i,j,jj,jjj,jj_old,icount,k,kk,l,iprot,ii,if,ib,ibatch,
1680 integer ixdrf,iret,itmp
1681 integer nrec,nlines,iscor
1682 double precision energ,t_acq,tcpu
1685 double precision rjunk
1686 integer ntot_all(0:maxprot,0:maxprocs-1)
1688 double precision energia(0:max_ene),etot
1689 real*4 csingle(3,maxres2),reini,refree,rmsdev,prec
1690 integer Previous,Next
1691 c print *,"Processor",me," calls read_protein_data"
1693 if (me.eq.master) then
1694 Previous=MPI_PROC_NULL
1698 if (me.eq.nprocs-1) then
1704 c Set the scratchfile names
1705 write (liczba,'(bz,i4.4)') me
1706 write (liczba1,'(bz,i4.4)') myparm
1708 c 1/27/05 AL Change stored coordinates to single precision and don't store
1709 c energy components in the binary databases.
1710 lenrec(iprot)=12*(nres_zs(iprot)+nct_zs(iprot)-nnt_zs(iprot)+1)
1711 & +4*(2*nss_zs(1,iprot)+1)+8*natlike(iprot)*maxdimnat+16
1712 c 4/13/04 AL Add space for similarity measure
1713 lenrec_ene(iprot) = (2*nntyp+3*n_ene+2)*8
1714 & +8*natlike(iprot)*maxdimnat
1717 write (iout,*) "Protein i"," lenrec",lenrec(iprot)
1718 write (iout,*) "lenrec_ene",lenrec_ene(iprot)
1721 bprotfiles(iprot) = scratchdir(:ilen(scratchdir))//
1722 & "/"//protname(iprot)(:ilen(protname(iprot)))//
1723 & "_par"//liczba1//"_"//liczba//".xbin"
1724 benefiles(iprot) = scratchdir(:ilen(scratchdir))//
1725 & "/"//protname(iprot)(:ilen(protname(iprot)))//
1726 & "_par"//liczba1//"_"//liczba//".enebin"
1727 c write (iout,*) "scratchfile ",
1728 c & bprotfiles(iprot)(:ilen(bprotfiles(iprot)))
1737 call restore_molinfo(iprot)
1738 open (ientout,file=bprotfiles(iprot),status="unknown",
1739 & form="unformatted",access="direct",recl=lenrec(iprot))
1740 c Change AL 12/30/2017
1741 if (.not.mod_other_params)
1742 & open (istat,file=benefiles(iprot),status="unknown",
1743 & form="unformatted",access="direct",recl=lenrec_ene(iprot))
1744 c Read conformations from binary DA files (one per batch) and write them to
1745 c a binary DA scratchfile.
1748 write (liczba,'(bz,i4.4)') me
1750 IF (ME.EQ.MASTER) THEN
1751 c Only the master reads the database; it'll send it to the other procs
1757 do if=1,nfile_prot(iprot)
1758 nazwa=protfiles(if,iprot)
1759 & (:ilen(protfiles(if,iprot)))//".cx"
1761 write (iout,*) "Opening file ",nazwa(:ilen(nazwa))
1763 #if (defined(AIX) && !defined(JUBL))
1764 call xdrfopen_(ixdrf,nazwa, "r", iret)
1766 call xdrfopen(ixdrf,nazwa, "r", iret)
1768 if (iret.eq.0) goto 1111
1772 #if (defined(AIX) && !defined(JUBL))
1773 call xdrf3dfcoord_(ixdrf, csingle, itmp, prec, iret)
1774 if (iret.eq.0) goto 102
1775 call xdrfint_(ixdrf, nss, iret)
1776 if (iret.eq.0) goto 102
1778 call xdrfint_(ixdrf, ihpb(j), iret)
1779 if (iret.eq.0) goto 102
1780 call xdrfint_(ixdrf, jhpb(j), iret)
1781 if (iret.eq.0) goto 102
1783 call xdrffloat_(ixdrf,reini,iret)
1784 if (iret.eq.0) goto 102
1785 call xdrffloat_(ixdrf,refree,iret)
1786 if (iret.eq.0) goto 102
1787 call xdrfint_(ixdrf,natlik,iret)
1788 if (iret.eq.0) goto 102
1790 call xdrfint(ixdrf,natliktemp(j),iret)
1791 if (iret.eq.0) goto 102
1792 do k=1,natliktemp(j)
1793 call xdrffloat(ixdrf,nutemp(k,j),iret)
1794 if (iret.eq.0) goto 102
1798 c write (0,*) "me",me," iprot",iprot," i",i
1799 call xdrf3dfcoord(ixdrf, csingle, itmp, prec, iret)
1800 if (iret.eq.0) goto 102
1801 call xdrfint(ixdrf, nss, iret)
1802 if (iret.eq.0) goto 102
1804 call xdrfint(ixdrf, ihpb(k), iret)
1805 if (iret.eq.0) goto 102
1806 call xdrfint(ixdrf, jhpb(k), iret)
1807 if (iret.eq.0) goto 102
1809 call xdrffloat(ixdrf,reini,iret)
1810 if (iret.eq.0) goto 102
1811 call xdrffloat(ixdrf,refree,iret)
1812 if (iret.eq.0) goto 102
1814 call xdrfint(ixdrf,natlik,iret)
1815 if (iret.eq.0) goto 102
1817 call xdrfint(ixdrf,natliktemp(j),iret)
1818 if (iret.eq.0) goto 102
1819 do k=1,natliktemp(j)
1820 call xdrffloat(ixdrf,nutemp(k,j),iret)
1821 if (iret.eq.0) goto 102
1826 call xdrffloat(ixdrf,rmsdev,iret)
1827 if (iret.eq.0) goto 102
1828 c write (2,*) "rmsdev",rmsdev
1829 call xdrfint(ixdrf,iscor,iret)
1830 if (iret.eq.0) goto 102
1831 c write (2,*) "iscor",iscor
1834 eini(jj+1,iprot)=reini
1835 entfac(jj+1,iprot)=refree
1843 c(l,nres+k)=csingle(l,nres+k-nnt+1)
1847 write (iout,'(5hREAD ,i5,2f15.4)')
1848 & jj+1,eini(jj+1,iprot),entfac(jj+1,iprot)
1849 write (iout,*) "natlik",natlik
1851 write (iout,*) "natliketemp",natliktemp(l)
1852 write(iout,*) (nutemp(k,l),k=1,natliktemp(l))
1854 write (iout,'(8f10.5)') ((c(l,k),l=1,3),k=1,nres)
1855 write (iout,'(8f10.5)') ((c(l,k+nres),l=1,3),k=nnt,nct)
1858 call add_new_cconf(jjj,jj,jj_old,icount,iprot,
1862 write (iout,*) "Protein ",protname(iprot),
1863 & i-1," conformations read from DA file ",
1864 & nazwa(:ilen(nazwa))
1865 write (iout,*) jj," conformations read so far"
1866 #if (defined(AIX) && !defined(JUBL))
1867 call xdrfclose_(ixdrf,nazwa,iret)
1869 call xdrfclose(ixdrf,nazwa,iret)
1871 c print *,"file ",nazwa(:ilen(nazwa))," closed"
1875 write (iout,*) "jj_old",jj_old," jj",jj
1877 call write_and_send_cconf(icount,jj_old,jj,iprot,Next)
1878 if (icount.gt.0) call MPI_Send(0,1,MPI_INTEGER,Next,570,
1882 call write_and_send_cconf(icount,jj_old,jj,iprot,Next)
1884 t_acq = tcpu() - t_acq
1885 write (iout,*) "Processor",me," protein",iprot,
1886 & " batch",ibatch," time for conformation read/send",t_acq
1889 c A worker gets the confs from the master and sends them to its neighbor
1891 call receive_and_pass_cconf(icount,jj_old,jj,iprot,
1893 t_acq = tcpu() - t_acq
1894 write (iout,*) "Processor",me," protein",iprot,
1896 & " time for conformation receive/send",t_acq
1900 write (iout,*) "Protein",
1901 & protname(iprot)(:ilen(protname(iprot))),", ",ntot(iprot),
1902 & " conformatons read ",ntot(iprot)," conformations written to ",
1903 & bprotfiles(iprot)(:ilen(bprotfiles(iprot)))
1904 ntot(0) = ntot(0)+ntot(iprot)
1909 write(iout,*)"A total of",ntot(0)," conformations read."
1911 c Check if everyone has the same number of conformations
1912 call MPI_Allgather(ntot(0),maxprot+1,MPI_INTEGER,
1913 & ntot_all(0,0),maxprot+1,MPI_INTEGER,MPI_Comm_World,IERROR)
1918 if (ntot(j).ne.ntot_all(j,i)) then
1919 write (iout,*) "Number of conformations at processor",i,
1920 & " for protein",j," differs from that at processor",me,
1921 & ntot(j),ntot_all(j,i)
1928 c----------- Temporary; reading probs from external file
1929 open (88,file='1LE1_wham_last_2.rms',status='old')
1931 read (88,*) ii,weirms(i,1)
1934 write (iout,*) "i",i," weirms",weirms(i,1)
1937 call MPI_Bcast(weirms(1,1), ntot(1), MPI_Double_Precision,
1938 & Master, MPI_COMM_WORLD, IERROR)
1939 c----------- end temportary stuff
1943 write (iout,*) "Number of conformations read by processors"
1944 write (iout,'(10x,7a10)') (protname(i),i=0,nprot)
1947 write (iout,'(8i10)') i,(ntot_all(j,i),j=0,nprot)
1949 write (iout,*) "Calculation terminated."
1955 1111 write(iout,*) "Error opening coordinate file ",nazwa(:ilen(nazwa))
1958 call MPI_Abort(MPI_COMM_WORLD,IERROR,ERRCODE)
1962 c------------------------------------------------------------------------------
1963 subroutine add_new_cconf(jjj,jj,jj_old,icount,iprot,Next)
1965 include "DIMENSIONS"
1966 include "DIMENSIONS.ZSCOPT"
1967 include "COMMON.CHAIN"
1968 include "COMMON.INTERACT"
1969 include "COMMON.LOCAL"
1970 include "COMMON.CLASSES"
1971 include "COMMON.ENERGIES"
1972 include "COMMON.IOUNITS"
1973 include "COMMON.PROTFILES"
1974 include "COMMON.PROTNAME"
1975 include "COMMON.VMCPAR"
1976 include "COMMON.WEIGHTS"
1977 include "COMMON.NAMES"
1978 include "COMMON.ALLPROT"
1979 include "COMMON.WEIGHTDER"
1980 include "COMMON.VAR"
1981 include "COMMON.SBRIDGE"
1982 include "COMMON.GEO"
1983 include "COMMON.COMPAR"
1987 integer i,j,jj,jjj,jj_old,icount,k,kk,l,iprot,ii,ib,ibatch,
1988 & nn,nn1,inan,Next,itj
1989 double precision etot,energia(0:max_ene)
1991 c if (entfac(jj+1,iprot).gt.-10.0d0
1992 c & .or. entfac(jj+1,iprot).lt.-150.0d0) then
1993 c write (iout,*) "Entropy factor out of range for conformation",
1994 c & jjj,entfac(jj+1,iprot),", conformation skipped."
1997 call int_from_cart1(.false.)
1999 if (vbld(j).lt.2.0d0 .or. vbld(j).gt.6.5d0) then
2000 write (iout,*) "nnt",nnt," nct",nct
2001 write (iout,*) "Bad CA-CA bond length",j," ",vbld(j)
2002 write (iout,*) "Bad CA-SC bond length",ii," ",vbld(nres+j)
2003 write (iout,*) "The Cartesian geometry is:"
2004 write (iout,'(8f10.5)') ((c(l,k),l=1,3),k=1,nres)
2005 write (iout,'(8f10.5)') ((c(l,k+nres),l=1,3),k=nnt,nct)
2006 write (iout,*) "The internal geometry is:"
2007 write (iout,'(8f10.4)') (vbld(k),k=nnt+1,nct)
2008 write (iout,'(8f10.4)') (vbld(k),k=nres+nnt,nres+nct)
2009 write (iout,'(8f10.4)') (rad2deg*theta(k),k=3,nres)
2010 write (iout,'(8f10.4)') (rad2deg*phi(k),k=4,nres)
2011 write (iout,'(8f10.4)') (rad2deg*alph(k),k=2,nres-1)
2012 write (iout,'(8f10.4)') (rad2deg*omeg(k),k=2,nres-1)
2014 & "This conformation WILL NOT be added to the database."
2020 if (itype(j).ne.10 .and. (vbld(nres+j)-dsc(itj)).gt.2.0d0) then
2021 write (iout,*) "nnt",nnt," nct",nct
2022 write (iout,*) "Bad CA-SC bond length",ii," ",vbld(nres+j)
2023 write (iout,*) "The Cartesian geometry is:"
2024 write (iout,'(8f10.5)') ((c(l,k),l=1,3),k=1,nres)
2025 write (iout,'(8f10.5)') ((c(l,k+nres),l=1,3),k=nnt,nct)
2026 write (iout,*) "The internal geometry is:"
2027 write (iout,'(8f10.4)') (vbld(k),k=nnt+1,nct)
2028 write (iout,'(8f10.4)') (vbld(k),k=nres+nnt,nres+nct)
2029 write (iout,'(8f10.4)') (rad2deg*theta(k),k=3,nres)
2030 write (iout,'(8f10.4)') (rad2deg*phi(k),k=4,nres)
2031 write (iout,'(8f10.4)') (rad2deg*alph(k),k=2,nres-1)
2032 write (iout,'(8f10.4)') (rad2deg*omeg(k),k=2,nres-1)
2034 & "This conformation WILL NOT be added to the database."
2039 if (theta(j).le.0.0d0) then
2041 & "Zero theta angle(s) in conformation",ii
2042 write (iout,*) "The Cartesian geometry is:"
2043 write (iout,'(8f10.5)') ((c(l,k),l=1,3),k=1,nres)
2044 write (iout,'(8f10.5)') ((c(l,k+nres),l=1,3),k=nnt,nct)
2045 write (iout,*) "The internal geometry is:"
2046 write (iout,'(8f10.4)') (vbld(k),k=nnt+1,nct)
2047 write (iout,'(8f10.4)') (vbld(k),k=nres+nnt,nres+nct)
2048 write (iout,'(8f10.4)') (rad2deg*theta(k),k=3,nres)
2049 write (iout,'(8f10.4)') (rad2deg*phi(k),k=4,nres)
2050 write (iout,'(8f10.4)') (rad2deg*alph(k),k=2,nres-1)
2051 write (iout,'(8f10.4)') (rad2deg*omeg(k),k=2,nres-1)
2053 & "This conformation WILL NOT be added to the database."
2056 if (theta(j).gt.179.97*deg2rad) theta(j)=179.97*deg2rad
2058 if (.not. init_ene) then
2061 etot=etot+ww(j)*enetb(icount+1,j,iprot)
2067 if (isnan(etot).ne.0) inan=1
2069 if (isnan(etot)) inan=1
2073 idumm=proc_proc(etot,inan)
2075 call proc_proc(etot,inan)
2082 write (iout,*) "NaNs detected in some of the energy",
2083 & " components for protein",iprot," batch",ibatch,
2084 & " conformation",jjj
2085 write (iout,*) "etot",etot
2086 write (iout,*) "The Cartesian geometry is:"
2087 write (iout,'(8f10.5)') ((c(j,i),j=1,3),i=1,nres)
2088 write (iout,'(8f10.5)') ((c(j,i+nres),j=1,3),i=nnt,nct)
2089 write (iout,*) "The internal geometry is:"
2090 write (iout,'(8f10.4)') (vbld(k),k=nnt+1,nct)
2091 write (iout,'(8f10.4)') (vbld(k),k=nres+nnt,nres+nct)
2092 write (iout,'(8f10.4)') (rad2deg*theta(k),k=3,nres)
2093 write (iout,'(8f10.4)') (rad2deg*phi(k),k=4,nres)
2094 write (iout,'(8f10.4)') (vbld(k+nres),k=nnt,nct)
2095 write (iout,'(8f10.4)') (rad2deg*alph(k),k=2,nres-1)
2096 write (iout,'(8f10.4)') (rad2deg*omeg(k),k=2,nres-1)
2097 write (iout,*) "The components of the energy are:"
2100 energia(k)=enetb(jj+1,k,iprot)
2102 call enerprint(energia(0))
2104 & "This conformation WILL NOT be added to the database."
2109 write (iout,'(e15.5,16i5)') entfac(icount+1,iprot),
2110 & iscore(icount+1,0,iprot),ibatch
2111 write (iout,'(8f10.5)') ((c(j,i),j=1,3),i=1,nres)
2112 write (iout,'(8f10.5)') ((c(j,i+nres),j=1,3),i=nnt,nct)
2113 write (iout,'(8f10.4)') (vbld(k),k=nnt+1,nct)
2114 write (iout,'(8f10.4)') (vbld(k),k=nres+nnt,nres+nct)
2115 write (iout,'(8f10.4)') (rad2deg*theta(k),k=3,nres)
2116 write (iout,'(8f10.4)') (rad2deg*phi(k),k=4,nres)
2117 write (iout,'(8f10.4)') (vbld(k+nres),k=nnt,nct)
2118 write (iout,'(8f10.4)') (rad2deg*alph(k),k=2,nres-1)
2119 write (iout,'(8f10.4)') (rad2deg*omeg(k),k=2,nres-1)
2120 write (iout,'(16i5)') nss,(ihpb(k),jhpb(k),k=1,nss)
2121 write (iout,'(5e15.5)') (enetb(icount+1,j,iprot),j=1,n_ene)
2122 c write (iout,'(2e15.5)') (eneps(1,j,icount+1,iprot),
2123 c & eneps(2,j,icount+1,iprot),j=1,nntyp)
2125 c write (iout,*) "First nu in readrtms"
2128 list_conf(jj,iprot)=jj
2129 call store_cconf_from_file(jj,icount,iprot)
2130 do j=1,natlike(iprot)
2132 if (k.eq.numnat(j,iprot)) then
2133 do l=1,natdim(j,iprot)
2134 nu(l,k,j,iprot)=nutemp(l,k)
2140 c write (iout,*) "End First nu in readrtms"
2142 if (icount.eq.maxstr_proc) then
2144 write (iout,* ) "jj_old",jj_old," jj",jj
2145 write (iout,*) "Calling write_and_send_cconf"
2148 call write_and_send_cconf(icount,jj_old,jj,iprot,Next)
2151 write (iout,*) "Exited write_and_send_cconf"
2159 c------------------------------------------------------------------------------
2160 subroutine store_cconf_from_file(jj,icount,iprot)
2162 include "DIMENSIONS"
2163 include "DIMENSIONS.ZSCOPT"
2164 include "COMMON.CHAIN"
2165 include "COMMON.SBRIDGE"
2166 include "COMMON.INTERACT"
2167 include "COMMON.IOUNITS"
2168 include "COMMON.CLASSES"
2169 include "COMMON.ALLPROT"
2170 include "COMMON.VAR"
2171 integer i,j,jj,icount,ibatch,iprot
2172 c Store the conformation that has been read in
2175 c_zs(j,i,icount,iprot)=c(j,i)
2178 nss_zs(icount,iprot)=nss
2180 ihpb_zs(i,icount,iprot)=ihpb(i)
2181 jhpb_zs(i,icount,iprot)=jhpb(i)
2185 c------------------------------------------------------------------------------
2186 subroutine write_and_send_cconf(icount,jj_old,jj,iprot,Next)
2188 include "DIMENSIONS"
2189 include "DIMENSIONS.ZSCOPT"
2193 include "COMMON.MPI"
2195 include "COMMON.WEIGHTS"
2196 include "COMMON.CHAIN"
2197 include "COMMON.SBRIDGE"
2198 include "COMMON.INTERACT"
2199 include "COMMON.IOUNITS"
2200 include "COMMON.CLASSES"
2201 include "COMMON.VAR"
2202 include "COMMON.ALLPROT"
2203 include "COMMON.ENERGIES"
2204 include "COMMON.WEIGHTDER"
2205 include "COMMON.OPTIM"
2206 include "COMMON.COMPAR"
2207 integer icount,jj_old,jj,Next,iprot
2208 c Write the structures to a scratch file
2210 c Master sends the portion of conformations that have been read in to the neighbor
2212 write (iout,*) "Processor",me," entered WRITE_AND_SEND_CONF"
2215 call MPI_Send(icount,1,MPI_INTEGER,Next,570,WHAM_COMM,IERROR)
2217 write (iout,*) "Processor",me," Next",next," sent icount=",icount
2218 write (iout,*) "Processor",me," jj_old",jj_old," jj",jj
2221 if (icount.gt.0) then
2222 call MPI_Send(nss_zs(1,iprot),icount,MPI_INTEGER,
2223 & Next,571,WHAM_COMM,IERROR)
2224 call MPI_Send(ihpb_zs(1,1,iprot),icount,MPI_INTEGER,
2225 & Next,572,WHAM_COMM,IERROR)
2226 if (.not. init_ene) call MPI_Send(enetb(jj_old,1,iprot),
2228 & MPI_DOUBLE_PRECISION,Next,576,WHAM_COMM,IERROR)
2229 call MPI_Send(nu(1,1,jj_old,iprot),
2230 & maxdimnat*natlike(iprot)*icount,
2231 & MPI_DOUBLE_PRECISION,
2232 & Next,577,WHAM_COMM,IERROR)
2233 call MPI_Send(eini(jj_old,iprot),icount,
2234 & MPI_DOUBLE_PRECISION,Next,578,WHAM_COMM,IERROR)
2235 call MPI_Send(entfac(jj_old,iprot),icount,MPI_DOUBLE_PRECISION,
2236 & Next,579,WHAM_COMM,IERROR)
2237 call MPI_Send(c_zs(1,1,1,iprot),3*icount*maxres2,
2238 & MPI_REAL,Next,580,WHAM_COMM,IERROR)
2239 if (.not. init_ene) call MPI_Send(eneps(1,1,1,iprot),
2241 & MPI_DOUBLE_PRECISION,Next,582,WHAM_COMM,IERROR)
2245 call dawrite_ccoords(iprot,jj_old,jj,ientout)
2246 c Change AL 20/12/2017
2247 if (.not. mod_other_params)
2248 &call dawrite_ene(iprot,jj_old,jj,istat)
2251 c------------------------------------------------------------------------------
2253 subroutine receive_and_pass_cconf(icount,jj_old,jj,iprot,Previous,
2256 include "DIMENSIONS"
2257 include "DIMENSIONS.ZSCOPT"
2259 integer IERROR,STATUS(MPI_STATUS_SIZE)
2260 include "COMMON.MPI"
2261 include "COMMON.CHAIN"
2262 include "COMMON.SBRIDGE"
2263 include "COMMON.INTERACT"
2264 include "COMMON.IOUNITS"
2265 include "COMMON.CLASSES"
2266 include "COMMON.ALLPROT"
2267 include "COMMON.ENERGIES"
2268 include "COMMON.VAR"
2269 include "COMMON.GEO"
2270 include "COMMON.WEIGHTS"
2271 include "COMMON.WEIGHTDER"
2272 include "COMMON.COMPAR"
2273 include "COMMON.OPTIM"
2274 integer i,j,k,icount,jj_old,jj,iprot,Previous,Next
2277 write (iout,*) "Processor",me," entered RECEIVE_AND_PASS_CONF"
2280 do while (icount.gt.0)
2281 c call MPI_Probe(Previous,570,WHAM_COMM,STATUS,IERROR)
2282 call MPI_Recv(icount,1,MPI_INTEGER,Previous,570,WHAM_COMM,
2285 write (iout,*)"Processor",me," previous",previous," icount",icount
2288 call MPI_Send(icount,1,MPI_INTEGER,Next,570,WHAM_COMM,
2291 write (iout,*) "Processor",me," icount",icount
2294 if (icount.eq.0) return
2295 call MPI_Recv(nss_zs(1,iprot),icount,MPI_INTEGER,
2296 & Previous,571,WHAM_COMM,STATUS,IERROR)
2297 call MPI_Send(nss_zs(1,iprot),icount,MPI_INTEGER,
2298 & Next,571,WHAM_COMM,IERROR)
2299 call MPI_Recv(ihpb_zs(1,1,iprot),icount,MPI_INTEGER,
2300 & Previous,572,WHAM_COMM,STATUS,IERROR)
2301 call MPI_Send(ihpb_zs(1,1,iprot),icount,MPI_INTEGER,
2302 & Next,572,WHAM_COMM,IERROR)
2303 if (.not. init_ene) then
2304 call MPI_Recv(enetb(jj_old,1,iprot),maxstr*n_ene,
2305 & MPI_DOUBLE_PRECISION,Previous,576,WHAM_COMM,STATUS,IERROR)
2306 call MPI_Send(enetb(jj_old,1,iprot),maxstr*n_ene,
2307 & MPI_DOUBLE_PRECISION,Next,576,WHAM_COMM,STATUS,IERROR)
2309 call MPI_Recv(nu(1,1,jj_old,iprot),
2310 & maxdimnat*natlike(iprot)*icount,
2311 & MPI_DOUBLE_PRECISION,
2312 & Previous,577,WHAM_COMM,STATUS,IERROR)
2313 call MPI_Send(nu(1,1,jj_old,iprot),
2314 & maxdimnat*natlike(iprot)*icount,
2315 & MPI_DOUBLE_PRECISION,
2316 & Next,577,WHAM_COMM,IERROR)
2317 call MPI_Recv(eini(jj_old,iprot),icount,
2318 & MPI_DOUBLE_PRECISION,Previous,578,WHAM_COMM,STATUS,IERROR)
2319 call MPI_Send(eini(jj_old,iprot),icount,
2320 & MPI_DOUBLE_PRECISION,Next,578,WHAM_COMM,IERROR)
2321 call MPI_Recv(entfac(jj_old,iprot),icount,MPI_DOUBLE_PRECISION,
2322 & Previous,579,WHAM_COMM,STATUS,IERROR)
2323 call MPI_Send(entfac(jj_old,iprot),icount,MPI_DOUBLE_PRECISION,
2324 & Next,579,WHAM_COMM,IERROR)
2325 call MPI_Recv(c_zs(1,1,1,iprot),3*icount*maxres2,
2326 & MPI_REAL,Previous,580,WHAM_COMM,STATUS,IERROR)
2327 call MPI_Send(c_zs(1,1,1,iprot),3*icount*maxres2,
2328 & MPI_REAL,Next,580,WHAM_COMM,IERROR)
2329 if (.not. init_ene) then
2330 call MPI_Recv(eneps(1,1,1,iprot),2*icount*nntyp,
2331 & MPI_DOUBLE_PRECISION,Previous,582,WHAM_COMM,STATUS,IERROR)
2332 call MPI_Send(eneps(1,1,1,iprot),2*icount*nntyp,
2333 & MPI_DOUBLE_PRECISION,Next,582,WHAM_COMM,IERROR)
2337 list_conf(i,iprot)=i
2339 call dawrite_ccoords(iprot,jj_old,jj,ientout)
2340 c Change AL 12/20/2017
2341 if (.not. mod_other_params)
2342 &call dawrite_ene(iprot,jj_old,jj,istat)
2345 write (iout,*) "Protein",iprot
2346 write (iout,*) "Processor",me," received",icount," conformations"
2348 write (iout,'(8f10.4)') ((c_zs(l,k,i,iprot),l=1,3,k=1,nres)
2349 write (iout,'(8f10.4)')((c_zs(l,k,i+nres,iprot),l=1,3,k=nnt,nct)
2350 write (iout,'(16i5)') nss_zs(i,iprot),(ihpb_zs(k,i,iprot),
2351 & jhpb_zs(k,i,iprot),k=1,nss_zs(i,iprot))
2352 write (iout,'(5e15.5)') (enetb(i,j,iprot),j=1,n_ene)
2353 write (iout,'(2e15.5)') (eneps(1,j,i,iprot),
2354 & eneps(2,j,i,iprot),j=1,nntyp)
2355 write (iout,'(e15.5,16i5)') entfac(i),iscore(i,0,iprot),
2363 c------------------------------------------------------------------------------
2364 subroutine read_thermal
2366 include "DIMENSIONS"
2367 include "DIMENSIONS.ZSCOPT"
2368 include "COMMON.CHAIN"
2369 include "COMMON.SBRIDGE"
2370 include "COMMON.INTERACT"
2371 include "COMMON.IOUNITS"
2372 include "COMMON.CLASSES"
2373 include "COMMON.VAR"
2374 include "COMMON.THERMAL"
2375 character*800 controlcard
2376 call card_concat(controlcard,.true.)
2377 call readi(controlcard,"NGRIDT",NGridT,200)
2378 call reada(controlcard,"DELTAT",deltaT,5.0d0)
2379 call reada(controlcard,"T0",GridT0,2.0d2)
2380 write (iout,*) "Parameters of thermal curves"
2381 write (iout,*) "NGRIDT",NGridT," DELTAT",deltaT," T0",GridT0
2384 c------------------------------------------------------------------------------
2385 subroutine daread_ene(iprot,istart_conf,iend_conf)
2387 include "DIMENSIONS"
2388 include "DIMENSIONS.ZSCOPT"
2391 include "COMMON.MPI"
2393 include "COMMON.CHAIN"
2394 include "COMMON.CLASSES"
2395 include "COMMON.ENERGIES"
2396 include "COMMON.IOUNITS"
2397 include "COMMON.PROTFILES"
2398 include "COMMON.ALLPROT"
2399 include "COMMON.WEIGHTDER"
2400 include "COMMON.COMPAR"
2401 include "COMMON.VMCPAR"
2402 integer iprot,istart_conf,iend_conf
2403 integer i,ii,iii,j,k
2405 write (iout,*) "Calling DAREAD_ENE"
2407 c write (iout,*) "Reading: n_ene",n_ene
2409 c write (iout,*) "DAREAD_ENE",istart_conf,iend_conf
2411 c Read conformations off a DA scratchfile.
2413 do ii=istart_conf,iend_conf
2414 iii=list_conf(ii,iprot)
2415 i = ii - istart_conf + 1
2416 read(ientin,rec=iii) (enetb(i,j,iprot),j=1,n_ene),
2417 & (enetb_orig(i,j,iprot),j=1,n_ene),
2418 & (enetb_oorig(i,j,iprot),j=1,n_ene),
2419 & eini(ii,iprot),entfac(ii,iprot),
2420 & (eneps(1,j,i,iprot),eneps(2,j,i,iprot),j=1,nntyp),
2421 & ((nu(k,j,i,iprot),k=1,maxdimnat),j=1,natlike(iprot))
2423 write (iout,'(3i5,3e15.4,i5,i10)') ii,iii,i,eini(ii,iprot),
2425 write (iout,'(20(1pe12.4)') (enetb(i,j,iprot),j=1,n_ene)
2426 write (iout,'(18(1pe12.4))')
2427 & ((nu(k,j,i,iprot)k=1,maxdimnat),j=1,natlike(iprot))
2434 c------------------------------------------------------------------------------
2435 subroutine dawrite_ene(iprot,istart_conf,iend_conf,unit_out)
2437 include "DIMENSIONS"
2438 include "DIMENSIONS.ZSCOPT"
2441 include "COMMON.MPI"
2443 include "COMMON.CHAIN"
2444 include "COMMON.CLASSES"
2445 include "COMMON.ENERGIES"
2446 include "COMMON.IOUNITS"
2447 include "COMMON.PROTFILES"
2448 include "COMMON.ALLPROT"
2449 include "COMMON.WEIGHTDER"
2450 include "COMMON.VMCPAR"
2451 include "COMMON.COMPAR"
2452 integer iprot,istart_conf,iend_conf,unit_out
2453 integer i,ii,iii,j,k
2454 c write (iout,*) "Writing: n_ene",n_ene
2456 c write (iout,*) "DAWRITE_ENE",istart_conf,iend_conf
2458 c Write conformations to a DA scratchfile.
2460 do ii=istart_conf,iend_conf
2461 iii=list_conf(ii,iprot)
2462 i = ii - istart_conf + 1
2463 write(unit_out,rec=iii) (enetb(i,j,iprot),j=1,n_ene),
2464 & (enetb_orig(i,j,iprot),j=1,n_ene),
2465 & (enetb_oorig(i,j,iprot),j=1,n_ene),
2466 & eini(ii,iprot),entfac(ii,iprot),
2467 & (eneps(1,j,i,iprot),eneps(2,j,i,iprot),j=1,nntyp),
2468 & ((nu(k,j,i,iprot),k=1,maxdimnat),j=1,natlike(iprot))
2470 write (iout,'(3i5,3e15.4,i5,i10)') ii,iii,i,eini(ii,iprot),
2472 write (iout,'(20(1pe12.4)') (enetb(i,j,iprot),j=1,n_ene)
2473 write (iout,'(18(1pe12.4))')
2474 & ((nu(kj,i,iprot),k=1,maxdimnat),j=1,natlike(iprot))
2481 c------------------------------------------------------------------------------
2482 subroutine daread_ccoords(iprot,istart_conf,iend_conf)
2484 include "DIMENSIONS"
2485 include "DIMENSIONS.ZSCOPT"
2488 include "COMMON.MPI"
2490 include "COMMON.CHAIN"
2491 include "COMMON.CLASSES"
2492 include "COMMON.ENERGIES"
2493 include "COMMON.IOUNITS"
2494 include "COMMON.PROTFILES"
2495 include "COMMON.ALLPROT"
2496 include "COMMON.INTERACT"
2497 include "COMMON.VAR"
2498 include "COMMON.SBRIDGE"
2499 include "COMMON.GEO"
2500 include "COMMON.COMPAR"
2501 include "COMMON.VMCPAR"
2502 include "COMMON.WEIGHTDER"
2503 integer iprot,istart_conf,iend_conf
2504 integer i,j,k,ij,ii,iii
2506 real*4 csingle(3,maxres2)
2507 character*16 form,acc
2510 c Read conformations off a DA scratchfile.
2513 write (iout,*) "DAREAD_COORDS"
2514 write (iout,*) "istart_conf",istart_conf," iend_conf",iend_conf
2515 write (iout,*) "lenrec",lenrec(iprot)
2516 inquire(unit=ientin,name=nam,recl=len,form=form,access=acc)
2517 write (iout,*) "len=",len," form=",form," acc=",acc
2518 write (iout,*) "nam=",nam
2521 do ii=istart_conf,iend_conf
2522 iii=list_conf(ii,iprot)
2523 ij = ii - istart_conf + 1
2525 write (iout,*) "Reading binary file, record",iii," ii",ii
2528 read(icbase,rec=iii) ((csingle(j,i),j=1,3),i=1,nres),
2529 & ((csingle(j,i),j=1,3),i=nnt+nres,nct+nres),
2530 & nss,(ihpb(i),jhpb(i),i=1,nss),eini(ii,iprot),
2532 & ((nu(k,i,ij,iprot),k=1,maxdimnat),i=1,natlike(iprot))
2539 write (iout,*) "iprot",iprot," ii",ii
2540 write (iout,'(8f10.5)') ((c(j,i),j=1,3),i=1,nres)
2541 write (iout,'(8f10.4)') ((c(j,i),j=1,3),i=nnt+nres,nct+nres)
2542 write (iout,'(2e15.5)') eini(ii,iprot),entfac(ii,iprot)
2543 write (iout,'(16i5)') nss,(ihpb(i),jhpb(i),i=1,nss)
2546 call store_ccoords(iprot,ii-istart_conf+1)
2550 c------------------------------------------------------------------------------
2551 subroutine dawrite_ccoords(iprot,istart_conf,iend_conf,unit_out)
2553 include "DIMENSIONS"
2554 include "DIMENSIONS.ZSCOPT"
2557 include "COMMON.MPI"
2559 include "COMMON.CHAIN"
2560 include "COMMON.INTERACT"
2561 include "COMMON.CLASSES"
2562 include "COMMON.ENERGIES"
2563 include "COMMON.IOUNITS"
2564 include "COMMON.PROTFILES"
2565 include "COMMON.ALLPROT"
2566 include "COMMON.VAR"
2567 include "COMMON.SBRIDGE"
2568 include "COMMON.GEO"
2569 include "COMMON.COMPAR"
2570 include "COMMON.WEIGHTDER"
2571 include "COMMON.VMCPAR"
2572 real*4 csingle(3,maxres2)
2573 integer iprot,istart_conf,iend_conf
2574 integer i,j,k,ii,ij,iii,unit_out
2576 character*16 form,acc
2579 c Write conformations to a DA scratchfile.
2582 write (iout,*) "DAWRITE_COORDS"
2583 write (iout,*) "istart_conf",istart_conf," iend_conf",iend_conf
2584 write (iout,*) "lenrec",lenrec(iprot)
2585 inquire(unit=unit_out,name=nam,recl=len,form=form,access=acc)
2586 write (iout,*) "len=",len," form=",form," acc=",acc
2587 write (iout,*) "nam=",nam
2590 do ii=istart_conf,iend_conf
2591 iii=list_conf(ii,iprot)
2592 ij = ii - istart_conf + 1
2593 call restore_ccoords(iprot,ii-istart_conf+1)
2595 write (iout,*) "Writing binary file, record",iii," ii",ii
2603 write(unit_out,rec=iii) ((csingle(j,i),j=1,3),i=1,nres),
2604 & ((csingle(j,i),j=1,3),i=nnt+nres,nct+nres),
2605 & nss,(ihpb(i),jhpb(i),i=1,nss),eini(ii,iprot),
2607 & ((nu(k,i,ij,iprot),k=1,maxdimnat),i=1,natlike(iprot))
2609 write (iout,*) "kbatch",kbatch(ii,iprot)," iscore",
2610 & iscore(ii,0,iprot)
2611 write (iout,'(8f10.5)') ((c(j,i),j=1,3),i=1,nres)
2612 write (iout,'(8f10.4)') ((c(j,i),j=1,3),i=nnt+nres,nct+nres)
2613 write (iout,'(2e15.5)') eini(ii,iprot),entfac(ii,iprot)
2614 write (iout,'(16i5)') nss,(ihpb(i),jhpb(i),i=1,nss)
2620 c------------------------------------------------------------------------------
2621 subroutine store_ccoords(iprot,ii)
2623 include "DIMENSIONS"
2624 include "DIMENSIONS.ZSCOPT"
2625 include "COMMON.VAR"
2626 include "COMMON.CHAIN"
2627 include "COMMON.ALLPROT"
2628 include "COMMON.IOUNITS"
2629 include "COMMON.GEO"
2630 include "COMMON.SBRIDGE"
2631 double precision thetnorm
2632 integer iprot,i,j,ii
2633 do i=1,nres_zs(iprot)
2635 c_zs(j,i,ii,iprot)=c(j,i)
2638 do i=nnt_zs(iprot),nct_zs(iprot)
2640 c_zs(j,i+nres,ii,iprot)=c(j,i+nres)
2643 c 5/7/02 AL: store sbridge info
2644 nss_zs(ii,iprot)=nss
2646 ihpb_zs(i,ii,iprot)=ihpb(i)
2647 jhpb_zs(i,ii,iprot)=jhpb(i)
2651 c------------------------------------------------------------------------------
2652 subroutine restore_ccoords(iprot,ii)
2654 include "DIMENSIONS"
2655 include "DIMENSIONS.ZSCOPT"
2656 include "COMMON.INTERACT"
2657 include "COMMON.VAR"
2658 include "COMMON.ALLPROT"
2659 include "COMMON.SBRIDGE"
2660 include "COMMON.CHAIN"
2661 include "COMMON.IOUNITS"
2662 integer iprot,i,j,ii
2663 do i=1,nres_zs(iprot)
2665 c(j,i)=c_zs(j,i,ii,iprot)
2668 do i=nnt_zs(iprot),nct_zs(iprot)
2670 c(j,i+nres)=c_zs(j,i+nres,ii,iprot)
2673 c 5/7/02 AL: restore sbridge info
2674 nss=nss_zs(ii,iprot)
2676 ihpb(i)=ihpb_zs(i,ii,iprot)+nres
2677 jhpb(i)=jhpb_zs(i,ii,iprot)+nres
2682 write (iout,*) "restore_ccoords",ii
2683 write (iout,'(8f10.5)') ((c(j,i),j=1,3),i=1,nres)
2684 write (iout,'(8f10.4)') ((c(j,i),j=1,3),i=nnt+nres,nct+nres)
2685 write (iout,'(16i5)') nss,(ihpb(i),jhpb(i),i=1,nss)
2690 c------------------------------------------------------------------------------
2691 subroutine card_concat(card,to_upper)
2693 include 'DIMENSIONS.ZSCOPT'
2694 include "COMMON.IOUNITS"
2696 character*80 karta,ucase
2700 read (inp,'(a)') karta
2701 if (to_upper) karta=ucase(karta)
2703 do while (karta(80:80).eq.'&')
2704 card=card(:ilen(card)+1)//karta(:79)
2705 read (inp,'(a)') karta
2706 if (to_upper) karta=ucase(karta)
2708 card=card(:ilen(card)+1)//karta
2711 c------------------------------------------------------------------------------
2712 subroutine readi(rekord,lancuch,wartosc,default)
2714 character*(*) rekord,lancuch
2715 integer wartosc,default
2718 iread=index(rekord,lancuch(:ilen(lancuch))//"=")
2719 if (iread.eq.0) then
2723 iread=iread+ilen(lancuch)+1
2724 read (rekord(iread:),*) wartosc
2727 c----------------------------------------------------------------------------
2728 subroutine reada(rekord,lancuch,wartosc,default)
2730 character*(*) rekord,lancuch
2732 double precision wartosc,default
2735 iread=index(rekord,lancuch(:ilen(lancuch))//"=")
2736 if (iread.eq.0) then
2740 iread=iread+ilen(lancuch)+1
2741 read (rekord(iread:),*) wartosc
2744 c----------------------------------------------------------------------------
2745 subroutine multreadi(rekord,lancuch,tablica,dim,default)
2748 integer tablica(dim),default
2749 character*(*) rekord,lancuch
2756 iread=index(rekord,lancuch(:ilen(lancuch))//"=")
2757 if (iread.eq.0) return
2758 iread=iread+ilen(lancuch)+1
2759 read (rekord(iread:),*,end=10,err=10) (tablica(i),i=1,dim)
2762 c----------------------------------------------------------------------------
2763 subroutine multreada(rekord,lancuch,tablica,dim,default)
2766 double precision tablica(dim),default
2767 character*(*) rekord,lancuch
2774 iread=index(rekord,lancuch(:ilen(lancuch))//"=")
2775 if (iread.eq.0) return
2776 iread=iread+ilen(lancuch)+1
2777 read (rekord(iread:),*,end=10,err=10) (tablica(i),i=1,dim)
2780 c----------------------------------------------------------------------------
2781 subroutine reads(rekord,lancuch,wartosc,default)
2783 character*(*) rekord,lancuch,wartosc,default
2785 integer ilen,lenlan,lenrec,iread,ireade
2789 lenlan=ilen(lancuch)
2791 iread=index(rekord,lancuch(:lenlan)//"=")
2792 c print *,"rekord",rekord," lancuch",lancuch
2793 c print *,"iread",iread," lenlan",lenlan," lenrec",lenrec
2794 if (iread.eq.0) then
2798 iread=iread+lenlan+1
2799 c print *,"iread",iread
2800 c print *,"|",rekord(iread:iread),"|",iblnk(rekord(iread:iread))
2801 do while (iread.le.lenrec .and. iblnk(rekord(iread:iread)))
2803 c print *,"|",rekord(iread:iread),"|",iblnk(rekord(iread:iread))
2805 c print *,"iread",iread
2806 if (iread.gt.lenrec) then
2811 c print *,"ireade",ireade
2812 do while (ireade.lt.lenrec .and.
2813 & .not.iblnk(rekord(ireade:ireade)))
2816 wartosc=rekord(iread:ireade)
2819 c----------------------------------------------------------------------------
2820 subroutine multreads(rekord,lancuch,tablica,dim,default)
2823 character*(*) rekord,lancuch,tablica(dim),default
2825 integer ilen,lenlan,lenrec,iread,ireade
2832 lenlan=ilen(lancuch)
2834 iread=index(rekord,lancuch(:lenlan)//"=")
2835 c print *,"rekord",rekord," lancuch",lancuch
2836 c print *,"iread",iread," lenlan",lenlan," lenrec",lenrec
2837 if (iread.eq.0) return
2838 iread=iread+lenlan+1
2840 c print *,"iread",iread
2841 c print *,"|",rekord(iread:iread),"|",iblnk(rekord(iread:iread))
2842 do while (iread.le.lenrec .and. iblnk(rekord(iread:iread)))
2844 c print *,"|",rekord(iread:iread),"|",iblnk(rekord(iread:iread))
2846 c print *,"iread",iread
2847 if (iread.gt.lenrec) return
2849 c print *,"ireade",ireade
2850 do while (ireade.lt.lenrec .and.
2851 & .not.iblnk(rekord(ireade:ireade)))
2854 tablica(i)=rekord(iread:ireade)
2858 c----------------------------------------------------------------------------
2859 subroutine split_string(rekord,tablica,dim,nsub)
2861 integer dim,nsub,i,ii,ll,kk
2862 character*(*) tablica(dim)
2863 character*(*) rekord
2873 C Find the start of term name
2875 do while (ii.le.ll .and. rekord(ii:ii).eq." ")
2878 C Parse the name into TABLICA(i) until blank found
2879 do while (ii.le.ll .and. rekord(ii:ii).ne." ")
2881 tablica(i)(kk:kk)=rekord(ii:ii)
2884 if (kk.gt.0) nsub=nsub+1
2885 if (ii.gt.ll) return
2889 c-------------------------------------------------------------------------------
2890 integer function iroof(n,m)
2892 if (ii*m .lt. n) ii=ii+1