1 subroutine parmread(iparm,*)
3 C Read the parameters of the probability distributions of the virtual-bond
4 C valence angles and the side chains and energy parameters.
6 implicit real*8 (a-h,o-z)
8 include 'DIMENSIONS.ZSCOPT'
9 include 'DIMENSIONS.FREE'
10 include 'COMMON.IOUNITS'
11 include 'COMMON.CHAIN'
12 include 'COMMON.INTERACT'
14 include 'COMMON.LOCAL'
15 include 'COMMON.TORSION'
16 include 'COMMON.FFIELD'
17 include 'COMMON.NAMES'
18 include 'COMMON.SBRIDGE'
19 include 'COMMON.WEIGHTS'
20 include 'COMMON.ENEPS'
21 include 'COMMON.SCCOR'
22 include 'COMMON.SCROT'
24 include 'COMMON.SHIELD'
25 include 'COMMON.CONTROL'
26 include 'COMMON.LANGEVIN'
28 character*1 onelett(4) /"G","A","P","D"/
29 character*1 toronelet(-2:2) /"p","a","G","A","P"/
31 dimension blower(3,3,maxlob)
32 character*800 controlcard
33 character*256 bondname_t,thetname_t,rotname_t,torname_t,
34 & tordname_t,fouriername_t,elename_t,sidename_t,scpname_t,
41 character*3 lancuch,ucase
42 C write (iout,*) "KURWA"
46 call getenv("PRINT_PARM",lancuch)
47 lprint = (ucase(lancuch).eq."YES" .or. ucase(lancuch).eq."Y")
48 write (iout,*) "lprint ",lprint
49 C Set LPRINT=.TRUE. for debugging
50 dwa16=2.0d0**(1.0d0/6.0d0)
52 C Assign virtual-bond length
56 call card_concat(controlcard,.true.)
59 key = wname(i)(:ilen(wname(i)))
60 call reada(controlcard,key(:ilen(key)),ww(i),1.0d0)
63 write (iout,*) "iparm",iparm," myparm",myparm
64 c If reading not own parameters, skip assignment
65 call reada(controlcard,"D0CM",d0cm,3.78d0)
66 call reada(controlcard,"AKCM",akcm,15.1d0)
67 call reada(controlcard,"AKTH",akth,11.0d0)
68 call reada(controlcard,"AKCT",akct,12.0d0)
69 call reada(controlcard,"V1SS",v1ss,-1.08d0)
70 call reada(controlcard,"V2SS",v2ss,7.61d0)
71 call reada(controlcard,"V3SS",v3ss,13.7d0)
72 call reada(controlcard,"EBR",ebr,-5.50D0)
73 call reada(controlcard,"DTRISS",dtriss,1.0D0)
74 call reada(controlcard,"ATRISS",atriss,0.3D0)
75 call reada(controlcard,"BTRISS",btriss,0.02D0)
76 call reada(controlcard,"CTRISS",ctriss,1.0D0)
77 dyn_ss=(index(controlcard,'DYN_SS').gt.0)
78 write(iout,*) "ATRISS",atriss
79 write(iout,*) "BTRISS",btriss
80 write(iout,*) "CTRISS",ctriss
81 write(iout,*) "DTRISS",dtriss
84 C dyn_ss_mask(i)=.false.
88 c Old arbitrary potential - commented out.
93 c Constants of the disulfide-bond potential determined based on the RHF/6-31G**
94 c energy surface of diethyl disulfide.
95 c A. Liwo and U. Kozlowska, 11/24/03
107 dyn_ssbond_ij(i,j)=1.0d300
110 call reada(controlcard,"HT",Ht,0.0D0)
112 C ss_depth=ebr/wsc-0.25*eps(1,1)
113 C write(iout,*) HT,wsc,eps(1,1),'KURWA'
114 C Ht=Ht/wsc-0.25*eps(1,1)
123 C ss_depth=ebr/whpb-0.25*eps(1,1)*wsc/whpb
126 if (iparm.eq.myparm .or. .not.separate_parset) then
129 c Setup weights for UNRES
153 write (iout,*) "PARMREAD: wsaxs",wsaxs
156 call card_concat(controlcard,.false.)
158 c Return if not own parameters
160 if (iparm.ne.myparm .and. separate_parset) return
162 call reads(controlcard,"BONDPAR",bondname_t,bondname)
163 open (ibond,file=bondname_t,status='old')
165 call reads(controlcard,"THETPAR",thetname_t,thetname)
166 open (ithep,file=thetname_t,status='old')
168 call reads(controlcard,"ROTPAR",rotname_t,rotname)
169 open (irotam,file=rotname_t,status='old')
171 call reads(controlcard,"TORPAR",torname_t,torname)
172 open (itorp,file=torname_t,status='old')
174 call reads(controlcard,"TORDPAR",tordname_t,tordname)
175 write (iout,*) "tor_mode",tor_mode
178 & open (itordp,file=tordname_t,status='old')
180 call reads(controlcard,"SCCORPAR",sccorname_t,sccorname)
181 open (isccor,file=sccorname_t,status='old')
183 call reads(controlcard,"FOURIER",fouriername_t,fouriername)
184 open (ifourier,file=fouriername_t,status='old')
186 call reads(controlcard,"ELEPAR",elename_t,elename)
187 open (ielep,file=elename_t,status='old')
189 call reads(controlcard,"SIDEPAR",sidename_t,sidename)
190 open (isidep,file=sidename_t,status='old')
192 call reads(controlcard,"SCPPAR",scpname_t,scpname)
193 open (iscpp,file=scpname_t,status='old')
195 write (iout,*) "Parameter set:",iparm
196 write (iout,*) "Energy-term weights:"
198 write (iout,'(a16,f10.5)') wname(i),ww(i)
200 write (iout,*) "Sidechain potential file : ",
201 & sidename_t(:ilen(sidename_t))
203 write (iout,*) "SCp potential file : ",
204 & scpname_t(:ilen(scpname_t))
206 write (iout,*) "Electrostatic potential file : ",
207 & elename_t(:ilen(elename_t))
208 write (iout,*) "Cumulant coefficient file : ",
209 & fouriername_t(:ilen(fouriername_t))
210 write (iout,*) "Torsional parameter file : ",
211 & torname_t(:ilen(torname_t))
212 write (iout,*) "Double torsional parameter file : ",
213 & tordname_t(:ilen(tordname_t))
214 write (iout,*) "Backbone-rotamer parameter file : ",
215 & sccorname(:ilen(sccorname))
216 write (iout,*) "Bond & inertia constant file : ",
217 & bondname_t(:ilen(bondname_t))
218 write (iout,*) "Bending parameter file : ",
219 & thetname_t(:ilen(thetname_t))
220 write (iout,*) "Rotamer parameter file : ",
221 & rotname_t(:ilen(rotname_t))
224 c Read the virtual-bond parameters, masses, and moments of inertia
225 c and Stokes' radii of the peptide group and side chains
228 read (ibond,*,end=121,err=121) vbldp0,vbldpdum,akp,mp,ip,pstok
231 read (ibond,*,end=121,err=121) vbldsc0(1,i),aksc(1,i),
232 & msc(i),isc(i),restok(i)
233 dsc(i) = vbldsc0(1,i)
237 dsc_inv(i)=1.0D0/dsc(i)
241 read (ibond,*,end=121,err=121) ijunk,vbldp0,vbldpdum,akp,rjunk,
244 read (ibond,*,end=121,err=121) nbondterm(i),(vbldsc0(j,i),
245 & aksc(j,i),abond0(j,i),j=1,nbondterm(i)),msc(i),isc(i),restok(i)
246 dsc(i) = vbldsc0(1,i)
250 dsc_inv(i)=1.0D0/dsc(i)
255 write(iout,'(/a/)')"Force constants virtual bonds:"
256 write (iout,'(a10,a3,6a10)') 'Type','N','VBL','K',
258 write(iout,'(a10,i3,6f10.5)') "p",1,vbldp0,akp,0.0d0
260 write (iout,'(a10,i3,6f10.5)') restyp(i),nbondterm(i),
261 & vbldsc0(1,i),aksc(1,i),abond0(1,i)
263 write (iout,'(13x,3f10.5)')
264 & vbldsc0(j,i),aksc(j,i),abond0(j,i)
268 write (iout,*) "iliptranpar",iliptranpar
269 write (iout,*) "liptranname ",liptranname
270 read(iliptranpar,*,end=1161,err=1161) pepliptran
271 write (iout,*) "pepliptran",pepliptran
273 read(iliptranpar,*,end=1161,err=1161) liptranene(i)
274 write (iout,*) i,liptranene(i)
279 C Read the parameters of the probability distribution/energy expression
280 C of the virtual-bond valence angles theta
283 read (ithep,*,end=111,err=111) a0thet(i),(athet(j,i,1,1),j=1,2),
284 & (bthet(j,i,1,1),j=1,2)
285 read (ithep,*,end=111,err=111) (polthet(j,i),j=0,3)
286 read (ithep,*,end=111,err=111) (gthet(j,i),j=1,3)
287 read (ithep,*,end=111,err=111) theta0(i),sig0(i),sigc0(i)
291 athet(1,i,1,-1)=athet(1,i,1,1)
292 athet(2,i,1,-1)=athet(2,i,1,1)
293 bthet(1,i,1,-1)=-bthet(1,i,1,1)
294 bthet(2,i,1,-1)=-bthet(2,i,1,1)
295 athet(1,i,-1,1)=-athet(1,i,1,1)
296 athet(2,i,-1,1)=-athet(2,i,1,1)
297 bthet(1,i,-1,1)=bthet(1,i,1,1)
298 bthet(2,i,-1,1)=bthet(2,i,1,1)
302 athet(1,i,-1,-1)=athet(1,-i,1,1)
303 athet(2,i,-1,-1)=-athet(2,-i,1,1)
304 bthet(1,i,-1,-1)=bthet(1,-i,1,1)
305 bthet(2,i,-1,-1)=-bthet(2,-i,1,1)
306 athet(1,i,-1,1)=athet(1,-i,1,1)
307 athet(2,i,-1,1)=-athet(2,-i,1,1)
308 bthet(1,i,-1,1)=-bthet(1,-i,1,1)
309 bthet(2,i,-1,1)=bthet(2,-i,1,1)
310 athet(1,i,1,-1)=-athet(1,-i,1,1)
311 athet(2,i,1,-1)=athet(2,-i,1,1)
312 bthet(1,i,1,-1)=bthet(1,-i,1,1)
313 bthet(2,i,1,-1)=-bthet(2,-i,1,1)
318 polthet(j,i)=polthet(j,-i)
321 gthet(j,i)=gthet(j,-i)
327 c & 'Parameters of the virtual-bond valence angles:'
328 c write (iout,'(/a/9x,5a/79(1h-))') 'Fourier coefficients:',
329 c & ' ATHETA0 ',' A1 ',' A2 ',
332 c write(iout,'(a3,i4,2x,5(1pe14.5))') restyp(i),i,
333 c & a0thet(i),(athet(j,i),j=1,2),(bthet(j,i),j=1,2)
335 c write (iout,'(/a/9x,5a/79(1h-))')
336 c & 'Parameters of the expression for sigma(theta_c):',
337 c & ' ALPH0 ',' ALPH1 ',' ALPH2 ',
338 c & ' ALPH3 ',' SIGMA0C '
340 c write (iout,'(a3,i4,2x,5(1pe14.5))') restyp(i),i,
341 c & (polthet(j,i),j=0,3),sigc0(i)
343 c write (iout,'(/a/9x,5a/79(1h-))')
344 c & 'Parameters of the second gaussian:',
345 c & ' THETA0 ',' SIGMA0 ',' G1 ',
348 c write (iout,'(a3,i4,2x,5(1pe14.5))') restyp(i),i,theta0(i),
349 c & sig0(i),(gthet(j,i),j=1,3)
352 & 'Parameters of the virtual-bond valence angles:'
353 write (iout,'(/a/9x,5a/79(1h-))')
354 & 'Coefficients of expansion',
355 & ' theta0 ',' a1*10^2 ',' a2*10^2 ',
356 & ' b1*10^1 ',' b2*10^1 '
358 write(iout,'(a3,1h&,2x,5(f8.3,1h&))') restyp(i),
359 & a0thet(i),(100*athet(j,i,1,1),j=1,2),
360 & (10*bthet(j,i,1,1),j=1,2)
362 write (iout,'(/a/9x,5a/79(1h-))')
363 & 'Parameters of the expression for sigma(theta_c):',
364 & ' alpha0 ',' alph1 ',' alph2 ',
365 & ' alhp3 ',' sigma0c '
367 write (iout,'(a3,1h&,2x,5(1pe12.3,1h&))') restyp(i),
368 & (polthet(j,i),j=0,3),sigc0(i)
370 write (iout,'(/a/9x,5a/79(1h-))')
371 & 'Parameters of the second gaussian:',
372 & ' theta0 ',' sigma0*10^2 ',' G1*10^-1',
375 write (iout,'(a3,1h&,2x,5(f8.3,1h&))') restyp(i),theta0(i),
376 & 100*sig0(i),gthet(1,i)*0.1D0,gthet(2,i),gthet(3,i)*10.0D0
380 IF (tor_mode.eq.0) THEN
382 C Read the parameters of Utheta determined from ab initio surfaces
383 C Kozlowska et al., J. Phys.: Condens. Matter 19 (2007) 285203
385 read (ithep,*,end=111,err=111) nthetyp,ntheterm,ntheterm2,
386 & ntheterm3,nsingle,ndouble
387 nntheterm=max0(ntheterm,ntheterm2,ntheterm3)
388 read (ithep,*,end=111,err=111) (ithetyp(i),i=1,ntyp1)
390 ithetyp(i)=-ithetyp(-i)
393 do i=-maxthetyp,maxthetyp
394 do j=-maxthetyp,maxthetyp
395 do k=-maxthetyp,maxthetyp
396 aa0thet(i,j,k,iblock)=0.0d0
398 aathet(l,i,j,k,iblock)=0.0d0
402 bbthet(m,l,i,j,k,iblock)=0.0d0
403 ccthet(m,l,i,j,k,iblock)=0.0d0
404 ddthet(m,l,i,j,k,iblock)=0.0d0
405 eethet(m,l,i,j,k,iblock)=0.0d0
411 ffthet(mm,m,l,i,j,k,iblock)=0.0d0
412 ggthet(mm,m,l,i,j,k,iblock)=0.0d0
420 C write (iout,*) "KURWA1"
423 do j=-nthetyp,nthetyp
424 do k=-nthetyp,nthetyp
425 read (ithep,'(6a)',end=111,err=111) res1
426 write(iout,*) res1,i,j,k
427 read (ithep,*,end=111,err=111) aa0thet(i,j,k,iblock)
428 read (ithep,*,end=111,err=111)(aathet(l,i,j,k,iblock),
430 read (ithep,*,end=111,err=111)
431 & ((bbthet(lll,ll,i,j,k,iblock),lll=1,nsingle),
432 & (ccthet(lll,ll,i,j,k,iblock),lll=1,nsingle),
433 & (ddthet(lll,ll,i,j,k,iblock),lll=1,nsingle),
434 & (eethet(lll,ll,i,j,k,iblock),lll=1,nsingle)
436 read (ithep,*,end=111,err=111)
437 & (((ffthet(llll,lll,ll,i,j,k,iblock),
438 & ffthet(lll,llll,ll,i,j,k,iblock),
439 & ggthet(llll,lll,ll,i,j,k,iblock)
440 & ,ggthet(lll,llll,ll,i,j,k,iblock),
441 & llll=1,lll-1),lll=2,ndouble),ll=1,ntheterm3)
445 C write(iout,*) "KURWA1.1"
447 C For dummy ends assign glycine-type coefficients of theta-only terms; the
448 C coefficients of theta-and-gamma-dependent terms are zero.
453 aathet(l,i,j,nthetyp+1,iblock)=0.0d0
454 aathet(l,nthetyp+1,i,j,iblock)=0.0d0
456 aa0thet(i,j,nthetyp+1,iblock)=0.0d0
457 aa0thet(nthetyp+1,i,j,iblock)=0.0d0
460 aathet(l,nthetyp+1,i,nthetyp+1,iblock)=0.0d0
462 aa0thet(nthetyp+1,i,nthetyp+1,iblock)=0.0d0
465 C write(iout,*) "KURWA1.5"
466 C Substitution for D aminoacids from symmetry.
469 do j=-nthetyp,nthetyp
470 do k=-nthetyp,nthetyp
471 aa0thet(i,j,k,iblock)=aa0thet(-i,-j,-k,iblock)
473 aathet(l,i,j,k,iblock)=aathet(l,-i,-j,-k,iblock)
477 bbthet(lll,ll,i,j,k,iblock)=bbthet(lll,ll,-i,-j,-k,iblock)
478 ccthet(lll,ll,i,j,k,iblock)=-ccthet(lll,ll,-i,-j,-k,iblock)
479 ddthet(lll,ll,i,j,k,iblock)=ddthet(lll,ll,-i,-j,-k,iblock)
480 eethet(lll,ll,i,j,k,iblock)=-eethet(lll,ll,-i,-j,-k,iblock)
486 ffthet(llll,lll,ll,i,j,k,iblock)=
487 & ffthet(llll,lll,ll,-i,-j,-k,iblock)
488 ffthet(lll,llll,ll,i,j,k,iblock)=
489 & ffthet(lll,llll,ll,-i,-j,-k,iblock)
490 ggthet(llll,lll,ll,i,j,k,iblock)=
491 & -ggthet(llll,lll,ll,-i,-j,-k,iblock)
492 ggthet(lll,llll,ll,i,j,k,iblock)=
493 & -ggthet(lll,llll,ll,-i,-j,-k,iblock)
503 C Control printout of the coefficients of virtual-bond-angle potentials
506 write (iout,'(//a)') 'Parameter of virtual-bond-angle potential'
511 write (iout,'(//4a)')
512 & 'Type ',onelett(i),onelett(j),onelett(k)
513 write (iout,'(//a,10x,a)') " l","a[l]"
514 write (iout,'(i2,1pe15.5)') 0,aa0thet(i,j,k,iblock)
515 write (iout,'(i2,1pe15.5)')
516 & (l,aathet(l,i,j,k,iblock),l=1,ntheterm)
518 write (iout,'(//2h m,4(9x,a,3h[m,i1,1h]))')
519 & "b",l,"c",l,"d",l,"e",l
521 write (iout,'(i2,4(1pe15.5))') m,
522 & bbthet(m,l,i,j,k,iblock),ccthet(m,l,i,j,k,iblock),
523 & ddthet(m,l,i,j,k,iblock),eethet(m,l,i,j,k,iblock)
527 write (iout,'(//3hm,n,4(6x,a,5h[m,n,i1,1h]))')
528 & "f+",l,"f-",l,"g+",l,"g-",l
531 write (iout,'(i1,1x,i1,4(1pe15.5))') n,m,
532 & ffthet(n,m,l,i,j,k,iblock),
533 & ffthet(m,n,l,i,j,k,iblock),
534 & ggthet(n,m,l,i,j,k,iblock),
535 & ggthet(m,n,l,i,j,k,iblock)
548 C here will be the apropriate recalibrating for D-aminoacid
549 read (ithep,*,end=111,err=111) nthetyp
550 do i=-nthetyp+1,nthetyp-1
551 read (ithep,*,end=111,err=111) nbend_kcc_Tb(i)
552 do j=0,nbend_kcc_Tb(i)
553 read (ithep,*,end=111,err=111) ijunk,v1bend_chyb(j,i)
558 & "Parameters of the valence-only potentials"
559 do i=-nthetyp+1,nthetyp-1
560 write (iout,'(2a)') "Type ",toronelet(i)
561 do k=0,nbend_kcc_Tb(i)
562 write(iout,'(i5,f15.5)') k,v1bend_chyb(k,i)
571 C write(iout,*) 'KURWA2'
574 C Read the parameters of the probability distribution/energy expression
575 C of the side chains.
578 cc write (iout,*) "tu dochodze",i
579 read (irotam,'(3x,i3,f8.3)') nlob(i),dsc(i)
583 dsc_inv(i)=1.0D0/dsc(i)
594 read(irotam,*,end=112,err=112)(censc(k,1,i),k=1,3),
595 & ((blower(k,l,1),l=1,k),k=1,3)
596 censc(1,1,-i)=censc(1,1,i)
597 censc(2,1,-i)=censc(2,1,i)
598 censc(3,1,-i)=-censc(3,1,i)
600 read (irotam,*,end=112,err=112) bsc(j,i)
601 read (irotam,*,end=112,err=112) (censc(k,j,i),k=1,3),
602 & ((blower(k,l,j),l=1,k),k=1,3)
603 censc(1,j,-i)=censc(1,j,i)
604 censc(2,j,-i)=censc(2,j,i)
605 censc(3,j,-i)=-censc(3,j,i)
606 C BSC is amplitude of Gaussian
613 akl=akl+blower(k,m,j)*blower(l,m,j)
617 if (((k.eq.3).and.(l.ne.3))
618 & .or.((l.eq.3).and.(k.ne.3))) then
619 gaussc(k,l,j,-i)=-akl
620 gaussc(l,k,j,-i)=-akl
632 write (iout,'(/a)') 'Parameters of side-chain local geometry'
636 write (iout,'(/3a,i2,a,f8.3)') 'Residue type: ',restyp(i),
637 & ' # of gaussian lobes:',nlobi,' dsc:',dsc(i)
638 c write (iout,'(/a,8x,i1,4(25x,i1))') 'Lobe:',(j,j=1,nlobi)
639 c write (iout,'(a,f10.4,4(16x,f10.4))')
640 c & 'Center ',(bsc(j,i),j=1,nlobi)
641 c write (iout,'(5(2x,3f8.4))') ((censc(k,j,i),k=1,3),j=1,nlobi)
642 write (iout,'(1h&,a,3(2h&&,f8.3,2h&&))')
643 & 'log h',(bsc(j,i),j=1,nlobi)
644 write (iout,'(1h&,a,3(1h&,f8.3,1h&,f8.3,1h&,f8.3,1h&))')
645 & 'x',((censc(k,j,i),k=1,3),j=1,nlobi)
652 c blower(k,l,j)=gaussc(ind,j,i)
657 write (iout,'(2h& ,5(2x,1h&,3(f7.3,1h&)))')
658 & ((gaussc(k,l,j,i),l=1,3),j=1,nlobi)
665 C Read scrot parameters for potentials determined from all-atom AM1 calculations
666 C added by Urszula Kozlowska 07/11/2007
669 read (irotam,*,end=112,err=112)
671 read (irotam,*,end=112,err=112)
674 read(irotam,*,end=112,err=112) sc_parmin(j,i)
681 C 9/18/99 (AL) Read coefficients of the Fourier expansion of the local
682 C interaction energy of the Gly, Ala, and Pro prototypes.
684 read (ifourier,*,end=115,err=115) nloctyp
685 SPLIT_FOURIERTOR = nloctyp.lt.0
686 nloctyp = iabs(nloctyp)
688 read (ifourier,*,end=115,err=115) (itype2loc(i),i=1,ntyp)
689 read (ifourier,*,end=115,err=115) (iloctyp(i),i=0,nloctyp-1)
690 itype2loc(ntyp1)=nloctyp
691 iloctyp(nloctyp)=ntyp1
693 itype2loc(-i)=-itype2loc(i)
702 iloctyp(-i)=-iloctyp(i)
704 c write (iout,*) "itype2loc",(itype2loc(i),i=1,ntyp1)
705 c write (iout,*) "nloctyp",nloctyp,
706 c & " iloctyp",(iloctyp(i),i=0,nloctyp)
709 c write (iout,*) "NEWCORR",i
710 read (ifourier,*,end=115,err=115)
713 read (ifourier,*,end=115,err=115) bnew1(ii,j,i)
716 c write (iout,*) "NEWCORR BNEW1"
717 c write (iout,*) ((bnew1(ii,j,i),ii=1,3),j=1,2)
720 read (ifourier,*,end=115,err=115) bnew2(ii,j,i)
723 c write (iout,*) "NEWCORR BNEW2"
724 c write (iout,*) ((bnew2(ii,j,i),ii=1,3),j=1,2)
726 read (ifourier,*,end=115,err=115) ccnew(kk,1,i)
727 read (ifourier,*,end=115,err=115) ccnew(kk,2,i)
729 c write (iout,*) "NEWCORR CCNEW"
730 c write (iout,*) ((ccnew(ii,j,i),ii=1,3),j=1,2)
732 read (ifourier,*,end=115,err=115) ddnew(kk,1,i)
733 read (ifourier,*,end=115,err=115) ddnew(kk,2,i)
735 c write (iout,*) "NEWCORR DDNEW"
736 c write (iout,*) ((ddnew(ii,j,i),ii=1,3),j=1,2)
740 read (ifourier,*,end=115,err=115) eenew(ii,jj,kk,i)
744 c write (iout,*) "NEWCORR EENEW1"
745 c write(iout,*)(((eenew(ii,jj,kk,i),kk=1,2),jj=1,2),ii=1,2)
747 read (ifourier,*,end=115,err=115) e0new(ii,i)
749 c write (iout,*) (e0new(ii,i),ii=1,3)
751 c write (iout,*) "NEWCORR EENEW"
754 ccnew(ii,1,i)=ccnew(ii,1,i)/2
755 ccnew(ii,2,i)=ccnew(ii,2,i)/2
756 ddnew(ii,1,i)=ddnew(ii,1,i)/2
757 ddnew(ii,2,i)=ddnew(ii,2,i)/2
762 bnew1(ii,1,-i)= bnew1(ii,1,i)
763 bnew1(ii,2,-i)=-bnew1(ii,2,i)
764 bnew2(ii,1,-i)= bnew2(ii,1,i)
765 bnew2(ii,2,-i)=-bnew2(ii,2,i)
768 c ccnew(ii,1,i)=ccnew(ii,1,i)/2
769 c ccnew(ii,2,i)=ccnew(ii,2,i)/2
770 c ddnew(ii,1,i)=ddnew(ii,1,i)/2
771 c ddnew(ii,2,i)=ddnew(ii,2,i)/2
772 ccnew(ii,1,-i)=ccnew(ii,1,i)
773 ccnew(ii,2,-i)=-ccnew(ii,2,i)
774 ddnew(ii,1,-i)=ddnew(ii,1,i)
775 ddnew(ii,2,-i)=-ddnew(ii,2,i)
777 e0new(1,-i)= e0new(1,i)
778 e0new(2,-i)=-e0new(2,i)
779 e0new(3,-i)=-e0new(3,i)
781 eenew(kk,1,1,-i)= eenew(kk,1,1,i)
782 eenew(kk,1,2,-i)=-eenew(kk,1,2,i)
783 eenew(kk,2,1,-i)=-eenew(kk,2,1,i)
784 eenew(kk,2,2,-i)= eenew(kk,2,2,i)
788 write (iout,'(a)') "Coefficients of the multibody terms"
789 do i=-nloctyp+1,nloctyp-1
790 write (iout,*) "Type: ",onelet(iloctyp(i))
791 write (iout,*) "Coefficients of the expansion of B1"
793 write (iout,'(3hB1(,i1,1h),3f10.5)') j,(bnew1(k,j,i),k=1,3)
795 write (iout,*) "Coefficients of the expansion of B2"
797 write (iout,'(3hB2(,i1,1h),3f10.5)') j,(bnew2(k,j,i),k=1,3)
799 write (iout,*) "Coefficients of the expansion of C"
800 write (iout,'(3hC11,3f10.5)') (ccnew(j,1,i),j=1,3)
801 write (iout,'(3hC12,3f10.5)') (ccnew(j,2,i),j=1,3)
802 write (iout,*) "Coefficients of the expansion of D"
803 write (iout,'(3hD11,3f10.5)') (ddnew(j,1,i),j=1,3)
804 write (iout,'(3hD12,3f10.5)') (ddnew(j,2,i),j=1,3)
805 write (iout,*) "Coefficients of the expansion of E"
806 write (iout,'(2hE0,3f10.5)') (e0new(j,i),j=1,3)
809 write (iout,'(1hE,2i1,2f10.5)') j,k,(eenew(l,j,k,i),l=1,2)
814 IF (SPLIT_FOURIERTOR) THEN
816 c write (iout,*) "NEWCORR TOR",i
817 read (ifourier,*,end=115,err=115)
820 read (ifourier,*,end=115,err=115) bnew1tor(ii,j,i)
823 c write (iout,*) "NEWCORR BNEW1 TOR"
824 c write (iout,*) ((bnew1tor(ii,j,i),ii=1,3),j=1,2)
827 read (ifourier,*,end=115,err=115) bnew2tor(ii,j,i)
830 c write (iout,*) "NEWCORR BNEW2 TOR"
831 c write (iout,*) ((bnew2tor(ii,j,i),ii=1,3),j=1,2)
833 read (ifourier,*,end=115,err=115) ccnewtor(kk,1,i)
834 read (ifourier,*,end=115,err=115) ccnewtor(kk,2,i)
836 c write (iout,*) "NEWCORR CCNEW TOR"
837 c write (iout,*) ((ccnew(ii,j,i),ii=1,3),j=1,2)
839 read (ifourier,*,end=115,err=115) ddnewtor(kk,1,i)
840 read (ifourier,*,end=115,err=115) ddnewtor(kk,2,i)
842 c write (iout,*) "NEWCORR DDNEW TOR"
843 c write (iout,*) ((ddnewtor(ii,j,i),ii=1,3),j=1,2)
847 read (ifourier,*,end=115,err=115) eenewtor(ii,jj,kk,i)
851 c write (iout,*) "NEWCORR EENEW1 TOR"
852 c write(iout,*)(((eenewtor(ii,jj,kk,i),kk=1,2),jj=1,2),ii=1,2)
854 read (ifourier,*,end=115,err=115) e0newtor(ii,i)
856 c write (iout,*) (e0newtor(ii,i),ii=1,3)
858 c write (iout,*) "NEWCORR EENEW TOR"
861 ccnewtor(ii,1,i)=ccnewtor(ii,1,i)/2
862 ccnewtor(ii,2,i)=ccnewtor(ii,2,i)/2
863 ddnewtor(ii,1,i)=ddnewtor(ii,1,i)/2
864 ddnewtor(ii,2,i)=ddnewtor(ii,2,i)/2
869 bnew1tor(ii,1,-i)= bnew1tor(ii,1,i)
870 bnew1tor(ii,2,-i)=-bnew1tor(ii,2,i)
871 bnew2tor(ii,1,-i)= bnew2tor(ii,1,i)
872 bnew2tor(ii,2,-i)=-bnew2tor(ii,2,i)
875 ccnewtor(ii,1,-i)=ccnewtor(ii,1,i)
876 ccnewtor(ii,2,-i)=-ccnewtor(ii,2,i)
877 ddnewtor(ii,1,-i)=ddnewtor(ii,1,i)
878 ddnewtor(ii,2,-i)=-ddnewtor(ii,2,i)
880 e0newtor(1,-i)= e0newtor(1,i)
881 e0newtor(2,-i)=-e0newtor(2,i)
882 e0newtor(3,-i)=-e0newtor(3,i)
884 eenewtor(kk,1,1,-i)= eenewtor(kk,1,1,i)
885 eenewtor(kk,1,2,-i)=-eenewtor(kk,1,2,i)
886 eenewtor(kk,2,1,-i)=-eenewtor(kk,2,1,i)
887 eenewtor(kk,2,2,-i)= eenewtor(kk,2,2,i)
892 & "Single-body coefficients of the torsional potentials"
893 do i=-nloctyp+1,nloctyp-1
894 write (iout,*) "Type: ",onelet(iloctyp(i))
895 write (iout,*) "Coefficients of the expansion of B1tor"
897 write (iout,'(3hB1(,i1,1h),3f10.5)')
898 & j,(bnew1tor(k,j,i),k=1,3)
900 write (iout,*) "Coefficients of the expansion of B2tor"
902 write (iout,'(3hB2(,i1,1h),3f10.5)')
903 & j,(bnew2tor(k,j,i),k=1,3)
905 write (iout,*) "Coefficients of the expansion of Ctor"
906 write (iout,'(3hC11,3f10.5)') (ccnewtor(j,1,i),j=1,3)
907 write (iout,'(3hC12,3f10.5)') (ccnewtor(j,2,i),j=1,3)
908 write (iout,*) "Coefficients of the expansion of Dtor"
909 write (iout,'(3hD11,3f10.5)') (ddnewtor(j,1,i),j=1,3)
910 write (iout,'(3hD12,3f10.5)') (ddnewtor(j,2,i),j=1,3)
911 write (iout,*) "Coefficients of the expansion of Etor"
912 write (iout,'(2hE0,3f10.5)') (e0newtor(j,i),j=1,3)
915 write (iout,'(1hE,2i1,2f10.5)')
916 & j,k,(eenewtor(l,j,k,i),l=1,2)
922 do i=-nloctyp+1,nloctyp-1
925 bnew1tor(ii,j,i)=bnew1(ii,j,i)
930 bnew2tor(ii,j,i)=bnew2(ii,j,i)
934 ccnewtor(ii,1,i)=ccnew(ii,1,i)
935 ccnewtor(ii,2,i)=ccnew(ii,2,i)
936 ddnewtor(ii,1,i)=ddnew(ii,1,i)
937 ddnewtor(ii,2,i)=ddnew(ii,2,i)
940 ENDIF !SPLIT_FOURIER_TOR
943 & write (iout,*) "Coefficients of the expansion of Eloc(l1,l2)"
945 read (ifourier,*,end=115,err=115)
946 read (ifourier,*,end=115,err=115) (b(ii,i),ii=1,13)
948 write (iout,*) 'Type ',onelet(iloctyp(i))
949 write (iout,'(a,i2,a,f10.5)') ('b(',ii,')=',b(ii,i),ii=1,13)
963 c B1tilde(1,i) = b(3)
964 c B1tilde(2,i) =-b(5)
965 c B1tilde(1,-i) =-b(3)
966 c B1tilde(2,-i) =b(5)
973 cc B1tilde(1,i) = b(3,i)
974 cc B1tilde(2,i) =-b(5,i)
975 C B1tilde(1,-i) =-b(3,i)
976 C B1tilde(2,-i) =b(5,i)
977 cc b1tilde(1,i)=0.0d0
978 cc b1tilde(2,i)=0.0d0
990 CCold(1,1,-i)= b(7,i)
991 CCold(2,2,-i)=-b(7,i)
992 CCold(2,1,-i)=-b(9,i)
993 CCold(1,2,-i)=-b(9,i)
998 c Ctilde(1,1,i)= CCold(1,1,i)
999 c Ctilde(1,2,i)= CCold(1,2,i)
1000 c Ctilde(2,1,i)=-CCold(2,1,i)
1001 c Ctilde(2,2,i)=-CCold(2,2,i)
1003 c Ctilde(1,1,i)=0.0d0
1004 c Ctilde(1,2,i)=0.0d0
1005 c Ctilde(2,1,i)=0.0d0
1006 c Ctilde(2,2,i)=0.0d0
1007 DDold(1,1,i)= b(6,i)
1008 DDold(2,2,i)=-b(6,i)
1009 DDold(2,1,i)= b(8,i)
1010 DDold(1,2,i)= b(8,i)
1011 DDold(1,1,-i)= b(6,i)
1012 DDold(2,2,-i)=-b(6,i)
1013 DDold(2,1,-i)=-b(8,i)
1014 DDold(1,2,-i)=-b(8,i)
1019 c Dtilde(1,1,i)= DD(1,1,i)
1020 c Dtilde(1,2,i)= DD(1,2,i)
1021 c Dtilde(2,1,i)=-DD(2,1,i)
1022 c Dtilde(2,2,i)=-DD(2,2,i)
1024 c Dtilde(1,1,i)=0.0d0
1025 c Dtilde(1,2,i)=0.0d0
1026 c Dtilde(2,1,i)=0.0d0
1027 c Dtilde(2,2,i)=0.0d0
1028 EEold(1,1,i)= b(10,i)+b(11,i)
1029 EEold(2,2,i)=-b(10,i)+b(11,i)
1030 EEold(2,1,i)= b(12,i)-b(13,i)
1031 EEold(1,2,i)= b(12,i)+b(13,i)
1032 EEold(1,1,-i)= b(10,i)+b(11,i)
1033 EEold(2,2,-i)=-b(10,i)+b(11,i)
1034 EEold(2,1,-i)=-b(12,i)+b(13,i)
1035 EEold(1,2,-i)=-b(12,i)-b(13,i)
1036 write(iout,*) "TU DOCHODZE"
1042 c ee(2,1,i)=ee(1,2,i)
1047 &"Coefficients of the cumulants (independent of valence angles)"
1048 do i=-nloctyp+1,nloctyp-1
1049 write (iout,*) 'Type ',onelet(iloctyp(i))
1051 write(iout,'(2f10.5)') B(3,i),B(5,i)
1053 write(iout,'(2f10.5)') B(2,i),B(4,i)
1056 write (iout,'(2f10.5)') CCold(j,1,i),CCold(j,2,i)
1060 write (iout,'(2f10.5)') DDold(j,1,i),DDold(j,2,i)
1064 write (iout,'(2f10.5)') EEold(j,1,i),EEold(j,2,i)
1069 C write (iout,*) 'KURWAKURWA'
1072 C Read torsional parameters in old format
1074 read (itorp,*,end=113,err=113) ntortyp,nterm_old
1075 write (iout,*) 'ntortyp,nterm',ntortyp,nterm_old
1076 read (itorp,*,end=113,err=113) (itortyp(i),i=1,ntyp)
1079 read (itorp,'(a)',end=113,err=113)
1081 read (itorp,*,end=113,err=113) kk,v1(k,j,i),v2(k,j,i)
1087 write (iout,'(/a/)') 'Torsional constants:'
1090 write (iout,'(2i3,6f10.5)') i,j,(v1(k,i,j),k=1,nterm_old)
1091 write (iout,'(6x,6f10.5)') (v2(k,i,j),k=1,nterm_old)
1097 C Read torsional parameters
1099 IF (TOR_MODE.eq.0) THEN
1101 read (itorp,*,end=113,err=113) ntortyp
1102 read (itorp,*,end=113,err=113) (itortyp(i),i=1,ntyp)
1104 itype2loc(i)=itortyp(i)
1106 write (iout,*) 'ntortyp',ntortyp
1108 itype2loc(-i)=-itype2loc(i)
1110 itortyp(ntyp1)=ntortyp
1113 itortyp(i)=-itortyp(-i)
1115 c write (iout,*) 'ntortyp',ntortyp
1117 do j=-ntortyp+1,ntortyp-1
1118 read (itorp,*,end=113,err=113) nterm(i,j,iblock),
1120 nterm(-i,-j,iblock)=nterm(i,j,iblock)
1121 nlor(-i,-j,iblock)=nlor(i,j,iblock)
1124 do k=1,nterm(i,j,iblock)
1125 read (itorp,*,end=113,err=113) kk,v1(k,i,j,iblock),
1127 v1(k,-i,-j,iblock)=v1(k,i,j,iblock)
1128 v2(k,-i,-j,iblock)=-v2(k,i,j,iblock)
1129 v0ij=v0ij+si*v1(k,i,j,iblock)
1132 do k=1,nlor(i,j,iblock)
1133 read (itorp,*,end=113,err=113) kk,vlor1(k,i,j),
1134 & vlor2(k,i,j),vlor3(k,i,j)
1135 v0ij=v0ij+vlor1(k,i,j)/(1+vlor3(k,i,j)**2)
1138 v0(-i,-j,iblock)=v0ij
1144 write (iout,'(/a/)') 'Torsional constants:'
1147 write (iout,*) 'ityp',i,' jtyp',j
1148 write (iout,*) 'Fourier constants'
1149 do k=1,nterm(i,j,iblock)
1150 write (iout,'(2(1pe15.5))') v1(k,i,j,iblock),
1153 write (iout,*) 'Lorenz constants'
1154 do k=1,nlor(i,j,iblock)
1155 write (iout,'(3(1pe15.5))')
1156 & vlor1(k,i,j),vlor2(k,i,j),vlor3(k,i,j)
1162 C 6/23/01 Read parameters for double torsionals
1166 do j=-ntortyp+1,ntortyp-1
1167 do k=-ntortyp+1,ntortyp-1
1168 read (itordp,'(3a1)',end=114,err=114) t1,t2,t3
1169 c write (iout,*) "OK onelett",
1172 if (t1.ne.toronelet(i) .or. t2.ne.toronelet(j)
1173 & .or. t3.ne.toronelet(k)) then
1174 write (iout,*) "Error in double torsional parameter file",
1177 call MPI_Finalize(Ierror)
1179 stop "Error in double torsional parameter file"
1181 read (itordp,*,end=114,err=114) ntermd_1(i,j,k,iblock),
1182 & ntermd_2(i,j,k,iblock)
1183 ntermd_1(-i,-j,-k,iblock)=ntermd_1(i,j,k,iblock)
1184 ntermd_2(-i,-j,-k,iblock)=ntermd_2(i,j,k,iblock)
1185 read (itordp,*,end=114,err=114) (v1c(1,l,i,j,k,iblock),l=1,
1186 & ntermd_1(i,j,k,iblock))
1187 read (itordp,*,end=114,err=114) (v1s(1,l,i,j,k,iblock),l=1,
1188 & ntermd_1(i,j,k,iblock))
1189 read (itordp,*,end=114,err=114) (v1c(2,l,i,j,k,iblock),l=1,
1190 & ntermd_1(i,j,k,iblock))
1191 read (itordp,*,end=114,err=114) (v1s(2,l,i,j,k,iblock),l=1,
1192 & ntermd_1(i,j,k,iblock))
1193 C Martix of D parameters for one dimesional foureir series
1194 do l=1,ntermd_1(i,j,k,iblock)
1195 v1c(1,l,-i,-j,-k,iblock)=v1c(1,l,i,j,k,iblock)
1196 v1s(1,l,-i,-j,-k,iblock)=-v1s(1,l,i,j,k,iblock)
1197 v1c(2,l,-i,-j,-k,iblock)=v1c(2,l,i,j,k,iblock)
1198 v1s(2,l,-i,-j,-k,iblock)=-v1s(2,l,i,j,k,iblock)
1199 c write(iout,*) "whcodze" ,
1200 c & v1s(2,l,-i,-j,-k,iblock),v1s(2,l,i,j,k,iblock)
1202 read (itordp,*,end=114,err=114) ((v2c(l,m,i,j,k,iblock),
1203 & v2c(m,l,i,j,k,iblock),v2s(l,m,i,j,k,iblock),
1204 & v2s(m,l,i,j,k,iblock),
1205 & m=1,l-1),l=1,ntermd_2(i,j,k,iblock))
1206 C Martix of D parameters for two dimesional fourier series
1207 do l=1,ntermd_2(i,j,k,iblock)
1209 v2c(l,m,-i,-j,-k,iblock)=v2c(l,m,i,j,k,iblock)
1210 v2c(m,l,-i,-j,-k,iblock)=v2c(m,l,i,j,k,iblock)
1211 v2s(l,m,-i,-j,-k,iblock)=-v2s(l,m,i,j,k,iblock)
1212 v2s(m,l,-i,-j,-k,iblock)=-v2s(m,l,i,j,k,iblock)
1221 write (iout,*) 'Constants for double torsionals'
1224 do j=-ntortyp+1,ntortyp-1
1225 do k=-ntortyp+1,ntortyp-1
1226 write (iout,*) 'ityp',i,' jtyp',j,' ktyp',k,
1227 & ' nsingle',ntermd_1(i,j,k,iblock),
1228 & ' ndouble',ntermd_2(i,j,k,iblock)
1230 write (iout,*) 'Single angles:'
1231 do l=1,ntermd_1(i,j,k,iblock)
1232 write (iout,'(i5,2f10.5,5x,2f10.5,5x,2f10.5)') l,
1233 & v1c(1,l,i,j,k,iblock),v1s(1,l,i,j,k,iblock),
1234 & v1c(2,l,i,j,k,iblock),v1s(2,l,i,j,k,iblock),
1235 & v1s(1,l,-i,-j,-k,iblock),v1s(2,l,-i,-j,-k,iblock)
1238 write (iout,*) 'Pairs of angles:'
1239 write (iout,'(3x,20i10)') (l,l=1,ntermd_2(i,j,k,iblock))
1240 do l=1,ntermd_2(i,j,k,iblock)
1241 write (iout,'(i5,20f10.5)')
1242 & l,(v2c(l,m,i,j,k,iblock),m=1,ntermd_2(i,j,k,iblock))
1245 write (iout,'(3x,20i10)') (l,l=1,ntermd_2(i,j,k,iblock))
1246 do l=1,ntermd_2(i,j,k,iblock)
1247 write (iout,'(i5,20f10.5)')
1248 & l,(v2s(l,m,i,j,k,iblock),m=1,ntermd_2(i,j,k,iblock)),
1249 & (v2s(l,m,-i,-j,-k,iblock),m=1,ntermd_2(i,j,k,iblock))
1258 ELSE IF (TOR_MODE.eq.1) THEN
1260 C read valence-torsional parameters
1261 read (itorp,*,end=113,err=113) ntortyp
1263 write (iout,*) "Valence-torsional parameters read in ntortyp",
1265 read (itorp,*,end=113,err=113) (itortyp(i),i=1,ntyp)
1266 write (iout,*) "itortyp_kcc",(itortyp(i),i=1,ntyp)
1268 itortyp(i)=-itortyp(-i)
1270 do i=-ntortyp+1,ntortyp-1
1271 do j=-ntortyp+1,ntortyp-1
1272 C first we read the cos and sin gamma parameters
1273 read (itorp,'(13x,a)',end=113,err=113) string
1274 write (iout,*) i,j,string
1275 read (itorp,*,end=113,err=113)
1276 & nterm_kcc(j,i),nterm_kcc_Tb(j,i)
1277 C read (itorkcc,*,end=121,err=121) nterm_kcc_Tb(j,i)
1278 do k=1,nterm_kcc(j,i)
1279 do l=1,nterm_kcc_Tb(j,i)
1280 do ll=1,nterm_kcc_Tb(j,i)
1281 read (itorp,*,end=113,err=113) ii,jj,kk,
1282 & v1_kcc(ll,l,k,j,i),v2_kcc(ll,l,k,j,i)
1290 c AL 4/8/16: Calculate coefficients from one-body parameters
1293 itortyp(i)=itype2loc(i)
1296 &"Val-tor parameters calculated from cumulant coefficients ntortyp"
1298 do i=-ntortyp+1,ntortyp-1
1299 do j=-ntortyp+1,ntortyp-1
1302 do k=1,nterm_kcc_Tb(j,i)
1303 do l=1,nterm_kcc_Tb(j,i)
1304 v1_kcc(k,l,1,i,j)=bnew1tor(k,1,i)*bnew2tor(l,1,j)
1305 & +bnew1tor(k,2,i)*bnew2tor(l,2,j)
1306 v2_kcc(k,l,1,i,j)=bnew1tor(k,1,i)*bnew2tor(l,2,j)
1307 & +bnew1tor(k,2,i)*bnew2tor(l,1,j)
1310 do k=1,nterm_kcc_Tb(j,i)
1311 do l=1,nterm_kcc_Tb(j,i)
1313 v1_kcc(k,l,2,i,j)=-(ccnewtor(k,1,i)*ddnewtor(l,1,j)
1314 & -ccnewtor(k,2,i)*ddnewtor(l,2,j))
1315 v2_kcc(k,l,2,i,j)=-(ccnewtor(k,2,i)*ddnewtor(l,1,j)
1316 & +ccnewtor(k,1,i)*ddnewtor(l,2,j))
1318 v1_kcc(k,l,2,i,j)=-0.25*(ccnewtor(k,1,i)*ddnewtor(l,1,j)
1319 & -ccnewtor(k,2,i)*ddnewtor(l,2,j))
1320 v2_kcc(k,l,2,i,j)=-0.25*(ccnewtor(k,2,i)*ddnewtor(l,1,j)
1321 & +ccnewtor(k,1,i)*ddnewtor(l,2,j))
1325 cf(theta,gamma)=-(b21(theta)*b11(theta)+b12(theta)*b22(theta))*cos(gamma)-(b22(theta)*b11(theta)+b21(theta)*b12(theta))*sin(gamma)+(c11(theta)*d11(theta)-c12(theta)*d12(theta))*cos(2*gamma)+(c12(theta)*d11(theta)+c11(theta)*d12(theta))*sin(2*gamma)
1331 if (tor_mode.gt.0 .and. lprint) then
1332 c Print valence-torsional parameters
1334 & "Parameters of the valence-torsional potentials"
1335 do i=-ntortyp+1,ntortyp-1
1336 do j=-ntortyp+1,ntortyp-1
1337 write (iout,'(3a)') "Type ",toronelet(i),toronelet(j)
1338 write (iout,'(3a5,2a15)') "itor","ival","jval","v_kcc","v2_kcc"
1339 do k=1,nterm_kcc(j,i)
1340 do l=1,nterm_kcc_Tb(j,i)
1341 do ll=1,nterm_kcc_Tb(j,i)
1342 write (iout,'(3i5,2f15.4)')
1343 & k,l-1,ll-1,v1_kcc(ll,l,k,j,i),v2_kcc(ll,l,k,j,i)
1352 C Read of Side-chain backbone correlation parameters
1353 C Modified 11 May 2012 by Adasko
1356 read (isccor,*,end=119,err=119) nsccortyp
1357 read (isccor,*,end=119,err=119) (isccortyp(i),i=1,ntyp)
1359 isccortyp(i)=-isccortyp(-i)
1361 iscprol=isccortyp(20)
1362 c write (iout,*) 'ntortyp',ntortyp
1364 cc maxinter is maximum interaction sites
1368 read (isccor,*,end=119,err=119)
1369 &nterm_sccor(i,j),nlor_sccor(i,j)
1370 c write (iout,*) nterm_sccor(i,j)
1376 nterm_sccor(-i,j)=nterm_sccor(i,j)
1377 nterm_sccor(-i,-j)=nterm_sccor(i,j)
1378 nterm_sccor(i,-j)=nterm_sccor(i,j)
1379 c write (iout,*) nterm_sccor(i,j),nterm_sccor(-i,j),
1380 c & nterm_sccor(-i,-j),nterm_sccor(i,-j)
1381 do k=1,nterm_sccor(i,j)
1382 read (isccor,*,end=119,err=119) kk,v1sccor(k,l,i,j)
1384 if (j.eq.iscprol) then
1385 if (i.eq.isccortyp(10)) then
1386 v1sccor(k,l,i,-j)=v1sccor(k,l,i,j)
1387 v2sccor(k,l,i,-j)=-v2sccor(k,l,i,j)
1389 v1sccor(k,l,i,-j)=v1sccor(k,l,i,j)*0.5d0
1390 & +v2sccor(k,l,i,j)*dsqrt(0.75d0)
1391 v2sccor(k,l,i,-j)=-v2sccor(k,l,i,j)*0.5d0
1392 & +v1sccor(k,l,i,j)*dsqrt(0.75d0)
1393 v1sccor(k,l,-i,-j)=v1sccor(k,l,i,j)
1394 v2sccor(k,l,-i,-j)=-v2sccor(k,l,i,j)
1395 v1sccor(k,l,-i,j)=v1sccor(k,l,i,-j)
1396 v2sccor(k,l,-i,j)=-v2sccor(k,l,i,-j)
1399 if (i.eq.isccortyp(10)) then
1400 v1sccor(k,l,i,-j)=v1sccor(k,l,i,j)
1401 v2sccor(k,l,i,-j)=-v2sccor(k,l,i,j)
1403 if (j.eq.isccortyp(10)) then
1404 v1sccor(k,l,-i,j)=v1sccor(k,l,i,j)
1405 v2sccor(k,l,-i,j)=-v2sccor(k,l,i,j)
1407 v1sccor(k,l,i,-j)=-v1sccor(k,l,i,j)
1408 v2sccor(k,l,i,-j)=-v2sccor(k,l,i,j)
1409 v1sccor(k,l,-i,-j)=v1sccor(k,l,i,j)
1410 v2sccor(k,l,-i,-j)=-v2sccor(k,l,i,j)
1411 v1sccor(k,l,-i,j)=v1sccor(k,l,i,-j)
1412 v2sccor(k,l,-i,j)=-v2sccor(k,l,i,-j)
1416 v0ijsccor=v0ijsccor+si*v1sccor(k,l,i,j)
1417 v0ijsccor1=v0ijsccor+si*v1sccor(k,l,-i,j)
1418 v0ijsccor2=v0ijsccor+si*v1sccor(k,l,i,-j)
1419 v0ijsccor3=v0ijsccor+si*v1sccor(k,l,-i,-j)
1422 do k=1,nlor_sccor(i,j)
1423 read (isccor,*,end=119,err=119) kk,vlor1sccor(k,i,j),
1424 & vlor2sccor(k,i,j),vlor3sccor(k,i,j)
1425 v0ijsccor=v0ijsccor+vlor1sccor(k,i,j)/
1426 &(1+vlor3sccor(k,i,j)**2)
1428 v0sccor(l,i,j)=v0ijsccor
1429 v0sccor(l,-i,j)=v0ijsccor1
1430 v0sccor(l,i,-j)=v0ijsccor2
1431 v0sccor(l,-i,-j)=v0ijsccor3
1437 write (iout,'(/a/)') 'Torsional constants of SCCORR:'
1441 write (iout,*) 'ityp',i,' jtyp',j
1442 write (iout,*) 'Fourier constants'
1443 do k=1,nterm_sccor(i,j)
1444 write (iout,'(2(1pe15.5))')
1445 & v1sccor(k,l,i,j),v2sccor(k,l,i,j)
1447 write (iout,*) 'Lorenz constants'
1448 do k=1,nlor_sccor(i,j)
1449 write (iout,'(3(1pe15.5))')
1450 & vlor1sccor(k,i,j),vlor2sccor(k,i,j),vlor3sccor(k,i,j)
1457 C Read electrostatic-interaction parameters
1460 write (iout,'(/a)') 'Electrostatic interaction constants:'
1461 write (iout,'(1x,a,1x,a,10x,a,11x,a,11x,a,11x,a)')
1462 & 'IT','JT','APP','BPP','AEL6','AEL3'
1464 read (ielep,*,end=116,err=116) ((epp(i,j),j=1,2),i=1,2)
1465 read (ielep,*,end=116,err=116) ((rpp(i,j),j=1,2),i=1,2)
1466 read (ielep,*,end=116,err=116) ((elpp6(i,j),j=1,2),i=1,2)
1467 read (ielep,*,end=116,err=116) ((elpp3(i,j),j=1,2),i=1,2)
1472 app (i,j)=epp(i,j)*rri*rri
1473 bpp (i,j)=-2.0D0*epp(i,j)*rri
1474 ael6(i,j)=elpp6(i,j)*4.2D0**6
1475 ael3(i,j)=elpp3(i,j)*4.2D0**3
1477 if (lprint) write(iout,'(2i3,4(1pe15.4))')i,j,app(i,j),bpp(i,j),
1478 & ael6(i,j),ael3(i,j)
1483 C Read side-chain interaction parameters.
1485 read (isidep,*,end=117,err=117) ipot,expon
1486 if (ipot.lt.1 .or. ipot.gt.5) then
1487 write (iout,'(2a)') 'Error while reading SC interaction',
1488 & 'potential file - unknown potential type.'
1492 write(iout,'(/3a,2i3)') 'Potential is ',potname(ipot),
1493 & ', exponents are ',expon,2*expon
1494 goto (10,20,30,30,40) ipot
1495 C----------------------- LJ potential ---------------------------------
1496 10 read (isidep,*,end=117,err=117)((eps(i,j),j=i,ntyp),i=1,ntyp),
1497 & (sigma0(i),i=1,ntyp)
1499 write (iout,'(/a/)') 'Parameters of the LJ potential:'
1500 write (iout,'(a/)') 'The epsilon array:'
1501 call printmat(ntyp,ntyp,ntyp,iout,restyp,eps)
1502 write (iout,'(/a)') 'One-body parameters:'
1503 write (iout,'(a,4x,a)') 'residue','sigma'
1504 write (iout,'(a3,6x,f10.5)') (restyp(i),sigma0(i),i=1,ntyp)
1507 C----------------------- LJK potential --------------------------------
1508 20 read (isidep,*,end=117,err=117)((eps(i,j),j=i,ntyp),i=1,ntyp),
1509 & (sigma0(i),i=1,ntyp),(rr0(i),i=1,ntyp)
1511 write (iout,'(/a/)') 'Parameters of the LJK potential:'
1512 write (iout,'(a/)') 'The epsilon array:'
1513 call printmat(ntyp,ntyp,ntyp,iout,restyp,eps)
1514 write (iout,'(/a)') 'One-body parameters:'
1515 write (iout,'(a,4x,2a)') 'residue',' sigma ',' r0 '
1516 write (iout,'(a3,6x,2f10.5)') (restyp(i),sigma0(i),rr0(i),
1520 C---------------------- GB or BP potential -----------------------------
1522 read (isidep,*,end=117,err=117)(eps(i,j),j=i,ntyp)
1524 read (isidep,*,end=117,err=117)(sigma0(i),i=1,ntyp)
1525 read (isidep,*,end=117,err=117)(sigii(i),i=1,ntyp)
1526 read (isidep,*,end=117,err=117)(chip(i),i=1,ntyp)
1527 read (isidep,*,end=117,err=117)(alp(i),i=1,ntyp)
1529 read (isidep,*,end=117,err=117)(epslip(i,j),j=i,ntyp)
1530 C write(iout,*) "WARNING!!",i,ntyp
1531 write(iout,*) "epslip", i, (epslip(i,j),j=i,ntyp)
1533 C epslip(i,j)=epslip(i,j)+0.05d0
1536 C For the GB potential convert sigma'**2 into chi'
1539 chip(i)=(chip(i)-1.0D0)/(chip(i)+1.0D0)
1543 write (iout,'(/a/)') 'Parameters of the BP potential:'
1544 write (iout,'(a/)') 'The epsilon array:'
1545 call printmat(ntyp,ntyp,ntyp,iout,restyp,eps)
1546 write (iout,'(/a)') 'One-body parameters:'
1547 write (iout,'(a,4x,4a)') 'residue',' sigma ','s||/s_|_^2',
1549 write (iout,'(a3,6x,4f10.5)') (restyp(i),sigma0(i),sigii(i),
1550 & chip(i),alp(i),i=1,ntyp)
1553 C--------------------- GBV potential -----------------------------------
1554 40 read (isidep,*,end=117,err=117)((eps(i,j),j=i,ntyp),i=1,ntyp),
1555 & (sigma0(i),i=1,ntyp),(rr0(i),i=1,ntyp),(sigii(i),i=1,ntyp),
1556 & (chip(i),i=1,ntyp),(alp(i),i=1,ntyp)
1558 write (iout,'(/a/)') 'Parameters of the GBV potential:'
1559 write (iout,'(a/)') 'The epsilon array:'
1560 call printmat(ntyp,ntyp,ntyp,iout,restyp,eps)
1561 write (iout,'(/a)') 'One-body parameters:'
1562 write (iout,'(a,4x,5a)') 'residue',' sigma ',' r0 ',
1563 & 's||/s_|_^2',' chip ',' alph '
1564 write (iout,'(a3,6x,5f10.5)') (restyp(i),sigma0(i),rr0(i),
1565 & sigii(i),chip(i),alp(i),i=1,ntyp)
1569 C-----------------------------------------------------------------------
1570 C Calculate the "working" parameters of SC interactions.
1574 epslip(i,j)=epslip(j,i)
1579 sigma(i,j)=dsqrt(sigma0(i)**2+sigma0(j)**2)
1580 sigma(j,i)=sigma(i,j)
1581 rs0(i,j)=dwa16*sigma(i,j)
1585 if (lprint) write (iout,'(/a/10x,7a/72(1h-))')
1586 & 'Working parameters of the SC interactions:',
1587 & ' a ',' b ',' augm ',' sigma ',' r0 ',
1592 epsijlip=epslip(i,j)
1593 if (ipot.eq.1 .or. ipot.eq.3 .or. ipot.eq.4) then
1602 sigeps=dsign(1.0D0,epsij)
1604 aa_aq(i,j)=epsij*rrij*rrij
1605 bb_aq(i,j)=-sigeps*epsij*rrij
1606 aa_aq(j,i)=aa_aq(i,j)
1607 bb_aq(j,i)=bb_aq(i,j)
1608 sigeps=dsign(1.0D0,epsijlip)
1609 epsijlip=dabs(epsijlip)
1610 aa_lip(i,j)=epsijlip*rrij*rrij
1611 bb_lip(i,j)=-sigeps*epsijlip*rrij
1612 aa_lip(j,i)=aa_lip(i,j)
1613 bb_lip(j,i)=bb_lip(i,j)
1615 sigt1sq=sigma0(i)**2
1616 sigt2sq=sigma0(j)**2
1619 ratsig1=sigt2sq/sigt1sq
1620 ratsig2=1.0D0/ratsig1
1621 chi(i,j)=(sigii1-1.0D0)/(sigii1+ratsig1)
1622 if (j.gt.i) chi(j,i)=(sigii2-1.0D0)/(sigii2+ratsig2)
1623 rsum_max=dsqrt(sigii1*sigt1sq+sigii2*sigt2sq)
1627 c if (ipot.eq.1 .or. ipot.eq.3 .or. ipot.eq.4) then
1628 sigmaii(i,j)=rsum_max
1629 sigmaii(j,i)=rsum_max
1631 c sigmaii(i,j)=r0(i,j)
1632 c sigmaii(j,i)=r0(i,j)
1634 cd write (iout,*) i,j,r0(i,j),sigma(i,j),rsum_max
1635 if ((ipot.eq.2 .or. ipot.eq.5) .and. r0(i,j).gt.rsum_max) then
1636 r_augm=sigma(i,j)*(rrij-sigma(i,j))/rrij
1637 augm(i,j)=epsij*r_augm**(2*expon)
1638 c augm(i,j)=0.5D0**(2*expon)*aa(i,j)
1645 write (iout,'(2(a3,2x),3(1pe10.3),5(0pf8.3))')
1646 & restyp(i),restyp(j),aa_aq(i,j),bb_aq(i,j),augm(i,j),
1647 & sigma(i,j),r0(i,j),chi(i,j),chi(j,i)
1652 C Define the SC-p interaction constants
1656 C "Soft" SC-p repulsion (causes helices to be too flat, but facilitates
1658 c aad(i,1)=0.3D0*4.0D0**12
1659 C Following line for constants currently implemented
1660 C "Hard" SC-p repulsion (gives correct turn spacing in helices)
1661 aad(i,1)=1.5D0*4.0D0**12
1662 c aad(i,1)=0.17D0*5.6D0**12
1664 C "Soft" SC-p repulsion
1666 C Following line for constants currently implemented
1667 c aad(i,1)=0.3D0*4.0D0**6
1668 C "Hard" SC-p repulsion
1669 bad(i,1)=3.0D0*4.0D0**6
1670 c bad(i,1)=-2.0D0*0.17D0*5.6D0**6
1679 C 8/9/01 Read the SC-p interaction constants from file
1682 read (iscpp,*,end=118,err=118) (eps_scp(i,j),rscp(i,j),j=1,2)
1685 aad(i,1)=dabs(eps_scp(i,1))*rscp(i,1)**12
1686 aad(i,2)=dabs(eps_scp(i,2))*rscp(i,2)**12
1687 bad(i,1)=-2*eps_scp(i,1)*rscp(i,1)**6
1688 bad(i,2)=-2*eps_scp(i,2)*rscp(i,2)**6
1692 write (iout,*) "Parameters of SC-p interactions:"
1694 write (iout,'(4f8.3,4e12.4)') eps_scp(i,1),rscp(i,1),
1695 & eps_scp(i,2),rscp(i,2),aad(i,1),bad(i,1),aad(i,2),bad(i,2)
1700 C Define the constants of the disulfide bridge
1704 c Old arbitrary potential - commented out.
1709 c Constants of the disulfide-bond potential determined based on the RHF/6-31G**
1710 c energy surface of diethyl disulfide.
1711 c A. Liwo and U. Kozlowska, 11/24/03
1720 write (iout,*) dyn_ss,'dyndyn'
1722 ss_depth=ebr/wsc-0.25*eps(1,1)
1723 C write(iout,*) akcm,whpb,wsc,'KURWA'
1724 Ht=Ht/wsc-0.25*eps(1,1)
1733 ss_depth=ebr/whpb-0.25*eps(1,1)*wsc/whpb
1737 write (iout,'(/a)') "Disulfide bridge parameters:"
1738 write (iout,'(a,f10.2)') 'S-S bridge energy: ',ebr
1739 write (iout,'(2(a,f10.2))') 'd0cm:',d0cm,' akcm:',akcm
1740 write (iout,'(2(a,f10.2))') 'akth:',akth,' akct:',akct
1741 write (iout,'(3(a,f10.2))') 'v1ss:',v1ss,' v2ss:',v2ss,
1744 if (shield_mode.gt.0) then
1746 C VSolvSphere the volume of solving sphere
1748 C rpp(1,1) is the energy r0 for peptide group contact and will be used for it
1749 C there will be no distinction between proline peptide group and normal peptide
1750 C group in case of shielding parameters
1751 VSolvSphere=4.0/3.0*pi*rpp(1,1)**3
1752 VSolvSphere_div=VSolvSphere-4.0/3.0*pi*(rpp(1,1)/2.0)**3
1753 write (iout,*) "VSolvSphere",VSolvSphere," VSolvSphere_div",
1755 C long axis of side chain
1757 long_r_sidechain(i)=vbldsc0(1,i)
1758 short_r_sidechain(i)=sigma0(i)
1763 111 write (iout,*) "Error reading bending energy parameters."
1765 112 write (iout,*) "Error reading rotamer energy parameters."
1767 113 write (iout,*) "Error reading torsional energy parameters."
1769 114 write (iout,*) "Error reading double torsional energy parameters."
1772 & "Error reading cumulant (multibody energy) parameters."
1774 116 write (iout,*) "Error reading electrostatic energy parameters."
1776 1161 write (iout,*) "Error reading lipid parameters."
1778 117 write (iout,*) "Error reading side chain interaction parameters."
1780 118 write (iout,*) "Error reading SCp interaction parameters."
1782 119 write (iout,*) "Error reading SCCOR parameters"
1784 121 write (iout,*) "Error reading bond parameters"
1787 call MPI_Finalize(Ierror)