12 !-----------------------------------------------------------------------------
15 !-----------------------------------------------------------------------------
17 !-----------------------------------------------------------------------------
19 !-----------------------------------------------------------------------------
25 ! implicit real*8 (a-h,o-z)
26 ! include 'DIMENSIONS'
27 ! include 'DIMENSIONS.ZSCOPT'
31 ! include 'COMMON.MPI'
33 character(len=3) :: liczba
35 ! include 'COMMON.IOUNITS'
36 integer :: lenpre,lenpot !,ilen
42 call mygetenv('PREFIX',prefix)
43 call mygetenv('SCRATCHDIR',scratchdir)
44 call mygetenv('POT',pot)
47 call mygetenv('POT',pot)
48 entname=prefix(:lenpre)//'_'//pot(:lenpot)//'.entr'
49 ! Get the names and open the input files
50 open (1,file=prefix(:ilen(prefix))//'.inp',status='old')
51 ! Get parameter filenames and open the parameter files.
52 call mygetenv('BONDPAR',bondname)
53 open (ibond,file=bondname,status='old')
54 call mygetenv('BONDPAR_NUCL',bondname_nucl)
55 open (ibond_nucl,file=bondname_nucl,status='old')
56 call mygetenv('THETPAR',thetname)
57 open (ithep,file=thetname,status='old')
58 call mygetenv('ROTPAR',rotname)
59 open (irotam,file=rotname,status='old')
60 call mygetenv('TORPAR',torname)
61 open (itorp,file=torname,status='old')
62 call mygetenv('TORDPAR',tordname)
63 open (itordp,file=tordname,status='old')
64 call mygetenv('FOURIER',fouriername)
65 open (ifourier,file=fouriername,status='old')
66 call mygetenv('SCCORPAR',sccorname)
67 open (isccor,file=sccorname,status='old')
68 call mygetenv('ELEPAR',elename)
69 open (ielep,file=elename,status='old')
70 call mygetenv('SIDEPAR',sidename)
71 open (isidep,file=sidename,status='old')
72 call mygetenv('SIDEP',sidepname)
73 open (isidep1,file=sidepname,status="old")
74 call mygetenv('THETPAR_NUCL',thetname_nucl)
75 open (ithep_nucl,file=thetname_nucl,status='old')
76 call mygetenv('ROTPAR_NUCL',rotname_nucl)
77 open (irotam_nucl,file=rotname_nucl,status='old')
78 call mygetenv('TORPAR_NUCL',torname_nucl)
79 open (itorp_nucl,file=torname_nucl,status='old')
80 call mygetenv('TORDPAR_NUCL',tordname_nucl)
81 open (itordp_nucl,file=tordname_nucl,status='old')
82 call mygetenv('SIDEPAR_NUCL',sidename_nucl)
83 open (isidep_nucl,file=sidename_nucl,status='old')
84 call mygetenv('SIDEPAR_SCBASE',sidename_scbase)
85 open (isidep_scbase,file=sidename_scbase,status='old')
86 call mygetenv('PEPPAR_PEPBASE',pepname_pepbase)
87 open (isidep_pepbase,file=pepname_pepbase,status='old')
88 call mygetenv('SCPAR_PHOSPH',pepname_scpho)
89 open (isidep_scpho,file=pepname_scpho,status='old')
90 call mygetenv('PEPPAR_PHOSPH',pepname_peppho)
91 open (isidep_peppho,file=pepname_peppho,status='old')
92 call mygetenv('LIPTRANPAR',liptranname)
93 open (iliptranpar,file=liptranname,status='old',action='read')
94 call mygetenv('TUBEPAR',tubename)
95 open (itube,file=tubename,status='old',action='read')
96 call mygetenv('IONPAR',ionname)
97 open (iion,file=ionname,status='old',action='read')
99 call mygetenv('SCPPAR_NUCL',scpname_nucl)
100 open (iscpp_nucl,file=scpname_nucl,status='old')
105 ! 8/9/01 In the newest version SCp interaction constants are read from a file
106 ! Use -DOLDSCP to use hard-coded constants instead.
108 call mygetenv('SCPPAR',scpname)
109 open (iscpp,file=scpname,status='old')
112 if (MyID.eq.BossID) then
113 MyRank = MyID/fgProcs
116 print *,'OpenUnits: processor',MyRank
117 call numstr(MyRank,liczba)
118 outname=prefix(:lenpre)//'.out_'//pot(:lenpot)//liczba
120 outname=prefix(:lenpre)//'.out_'//pot(:lenpot)
122 open(iout,file=outname,status='unknown')
123 write (iout,'(80(1h-))')
124 write (iout,'(30x,a)') "FILE ASSIGNMENT"
125 write (iout,'(80(1h-))')
126 write (iout,*) "Input file : ",&
127 prefix(:ilen(prefix))//'.inp'
128 write (iout,*) "Output file : ",&
129 outname(:ilen(outname))
131 write (iout,*) "Sidechain potential file : ",&
132 sidename(:ilen(sidename))
134 write (iout,*) "SCp potential file : ",&
135 scpname(:ilen(scpname))
137 write (iout,*) "Electrostatic potential file : ",&
138 elename(:ilen(elename))
139 write (iout,*) "Cumulant coefficient file : ",&
140 fouriername(:ilen(fouriername))
141 write (iout,*) "Torsional parameter file : ",&
142 torname(:ilen(torname))
143 write (iout,*) "Double torsional parameter file : ",&
144 tordname(:ilen(tordname))
145 write (iout,*) "Backbone-rotamer parameter file : ",&
146 sccorname(:ilen(sccorname))
147 write (iout,*) "Bond & inertia constant file : ",&
148 bondname(:ilen(bondname))
149 write (iout,*) "Bending parameter file : ",&
150 thetname(:ilen(thetname))
151 write (iout,*) "Rotamer parameter file : ",&
152 rotname(:ilen(rotname))
153 write (iout,'(80(1h-))')
156 end subroutine openunits
157 !-----------------------------------------------------------------------------
159 !-----------------------------------------------------------------------------
160 subroutine molread(*)
162 ! Read molecular data.
165 use geometry_data, only:nres,deg2rad,c,dc,nres_molec
166 use control_data, only:iscode
167 use io_base, only:rescode
168 use control, only:setup_var,init_int_table
169 use geometry, only:alloc_geo_arrays
170 use energy, only:alloc_ener_arrays
171 ! implicit real*8 (a-h,o-z)
172 ! include 'DIMENSIONS'
173 ! include 'DIMENSIONS.ZSCOPT'
174 ! include 'COMMON.IOUNITS'
175 ! include 'COMMON.GEO'
176 ! include 'COMMON.VAR'
177 ! include 'COMMON.INTERACT'
178 ! include 'COMMON.LOCAL'
179 ! include 'COMMON.NAMES'
180 ! include 'COMMON.CHAIN'
181 ! include 'COMMON.FFIELD'
182 ! include 'COMMON.SBRIDGE'
183 ! include 'COMMON.TORCNSTR'
184 ! include 'COMMON.CONTROL'
185 character(len=4),dimension(:),allocatable :: sequence !(nres)
186 !el integer :: rescode
187 !el real(kind=8) :: x(maxvar)
188 character(len=320) :: controlcard !,ucase
189 integer,dimension(nres,5) :: itype_pdb !(maxres)
190 integer :: i,j,i1,i2,it1,it2,mnum
191 real(kind=8) :: scalscp
192 !el logical :: seq_comp
193 write(iout,*) "START MOLREAD"
197 print *,"nres_molec, initial",nres_molec(i)
200 call card_concat(controlcard,.true.)
201 call reada(controlcard,'SCAL14',scal14,0.4d0)
202 call reada(controlcard,'SCALSCP',scalscp,1.0d0)
203 call reada(controlcard,'CUTOFF',cutoff_corr,7.0d0)
204 call reada(controlcard,'TEMP0',temp0,300.0d0) !el
205 call reada(controlcard,'DELT_CORR',delt_corr,0.5d0)
206 r0_corr=cutoff_corr-delt_corr
207 call readi(controlcard,"NRES",nres_molec(1),0)
208 call readi(controlcard,"NRES_NUCL",nres_molec(2),0)
209 call readi(controlcard,"NRES_CAT",nres_molec(5),0)
212 nres=nres_molec(i)+nres
214 ! allocate(sequence(nres+1))
215 !el znamy juz ilosc reszt wiec mozna zaalokowac tablice do liczenia enerii
216 call alloc_geo_arrays
217 call alloc_ener_arrays
218 ! alokacja dodatkowych tablic, ktore w unresie byly alokowanie w locie
219 !----------------------------
220 allocate(c(3,2*nres+2))
221 allocate(dc(3,0:2*nres+2))
222 allocate(itype(nres+2,5))
223 allocate(itel(nres+2))
224 if (.not. allocated(molnum)) allocate(molnum(nres+2))
240 !--------------------------
242 allocate(sequence(nres+1))
243 iscode=index(controlcard,"ONE_LETTER")
245 write (iout,*) "Error: no residues in molecule"
248 if (nres.gt.maxres) then
249 write (iout,*) "Error: too many residues",nres,maxres
251 write(iout,*) 'nres=',nres
253 ! Read sequence of the protein
254 if (iscode.gt.0) then
255 read (inp,'(80a1)') (sequence(i)(1:1),i=1,nres)
257 read (inp,'(20(1x,a3))') (sequence(i),i=1,nres)
259 ! Convert sequence to numeric code
263 itype(i,mnum)=rescode(i,sequence(i),iscode,mnum)
265 do i=nres_molec(1)+1,nres_molec(1)+nres_molec(2)
268 itype(i,mnum)=rescode(i,sequence(i),iscode,mnum)
270 do i=nres_molec(1)+nres_molec(2)+1,nres_molec(1)+nres_molec(2)+nres_molec(5)
273 itype(i,mnum)=rescode(i,sequence(i),iscode,mnum)
276 write (iout,*) "Numeric code:"
277 write (iout,'(20i4)') (itype(i,molnum(i)),i=1,nres)
281 if (itype(i,mnum).eq.ntyp1_molec(mnum) .or. itype(i+1,mnum).eq.ntyp1_molec(mnum)) then
283 if (itype(i,mnum).eq.ntyp1_molec(mnum)) then
287 else if (iabs(itype(i+1,mnum)).ne.20) then
289 else if (iabs(itype(i,mnum)).ne.20) then
296 write (iout,*) "ITEL"
299 write (iout,*) i,itype(i,mnum),itel(i)
304 if (with_dihed_constr) then
306 read (inp,*) ndih_constr
307 if (ndih_constr.gt.0) then
309 write (iout,*) 'FTORS',ftors
310 read (inp,*) (idih_constr(i),phi0(i),drange(i),i=1,ndih_constr)
312 'There are',ndih_constr,' constraints on phi angles.'
314 write (iout,'(i5,2f8.3)') idih_constr(i),phi0(i),drange(i)
317 phi0(i)=deg2rad*phi0(i)
318 drange(i)=deg2rad*drange(i)
326 if (itype(1,molnum(1)).eq.ntyp1_molec(molnum(1))) nnt=2
327 if (itype(nres,molnum(nres)).eq.ntyp1_molec(molnum(nres))) nct=nct-1
328 write(iout,*) 'NNT=',NNT,' NCT=',NCT
332 write (iout,'(/a,i3,a)') 'The chain contains',ns,&
333 ' disulfide-bridging cysteines.'
334 write (iout,'(20i4)') (iss(i),i=1,ns)
335 write (iout,'(/a/)') 'Pre-formed links are:'
342 write (iout,'(2a,i3,3a,i3,a,3f10.3)') &
343 restyp(it1,molnum(i1)),'(',i1,') -- ',restyp(it2,molnum(i2)),'(',i2,')',&
344 dhpb(i),ebr,forcon(i)
349 end subroutine molread
350 !-----------------------------------------------------------------------------
352 !-----------------------------------------------------------------------------
353 subroutine parmread(iparm,*)
358 ! Read the parameters of the probability distributions of the virtual-bond
359 ! valence angles and the side chains and energy parameters.
365 use control_data, only: maxterm,maxlor,maxterm_sccor,& !maxtor
366 maxtermd_1,maxtermd_2,tor_mode,scelemode !,maxthetyp,maxthetyp1
370 use io_config, only: printmat
371 use control, only: getenv_loc
378 ! implicit real*8 (a-h,o-z)
379 ! include 'DIMENSIONS'
380 ! include 'DIMENSIONS.ZSCOPT'
381 ! include 'DIMENSIONS.FREE'
382 ! include 'COMMON.IOUNITS'
383 ! include 'COMMON.CHAIN'
384 ! include 'COMMON.INTERACT'
385 ! include 'COMMON.GEO'
386 ! include 'COMMON.LOCAL'
387 ! include 'COMMON.TORSION'
388 ! include 'COMMON.FFIELD'
389 ! include 'COMMON.NAMES'
390 ! include 'COMMON.SBRIDGE'
391 ! include 'COMMON.WEIGHTS'
392 ! include 'COMMON.ENEPS'
393 ! include 'COMMON.SCCOR'
394 ! include 'COMMON.SCROT'
395 ! include 'COMMON.FREE'
396 character(len=1) :: t1,t2,t3
397 character(len=1) :: onelett(4) = (/"G","A","P","D"/)
398 character(len=1) :: toronelet(-2:2) = (/"p","a","G","A","P"/)
399 logical :: lprint,SPLIT_FOURIERTOR
400 real(kind=8),dimension(3,3,maxlob) :: blower !(3,3,maxlob)
401 character(len=800) :: controlcard
402 character(len=256) :: bondname_t,thetname_t,rotname_t,torname_t,&
403 tordname_t,fouriername_t,elename_t,sidename_t,scpname_t,&
407 character(len=16) :: key
408 integer :: iparm,nkcctyp
409 !el real(kind=8) :: ip,mp
410 real(kind=8) :: dwa16,akl,si,rri,epsij,rrij,sigeps,sigt1sq,epsijlip,&
411 sigt2sq,sigii1,sigii2,ratsig1,ratsig2,rsum_max,r_augm, &
412 epspeptube,epssctube,sigmapeptube, &
415 real(kind=8) :: v0ij,v0ijsccor,v0ijsccor1,v0ijsccor2,v0ijsccor3,rjunk,&
417 integer :: i,j,ichir1,ichir2,k,l,m,kk,ii,mm,junk,lll,ll,llll,n,jj
418 integer :: nlobi,iblock,maxinter,iscprol,ncatprotparm
424 ! Set LPRINT=.TRUE. for debugging
425 dwa16=2.0d0**(1.0d0/6.0d0)
428 ! Assign virtual-bond length
431 vblinv2=vblinv*vblinv
433 call card_concat(controlcard,.true.)
436 allocate(ww(max_eneW))
438 key = wname(i)(:ilen(wname(i)))
439 call reada(controlcard,key(:ilen(key)),ww(i),1.0d0)
442 write (iout,*) "iparm",iparm," myparm",myparm
443 ! If reading not own parameters, skip assignment
445 if (iparm.eq.myparm .or. .not.separate_parset) then
448 ! Setup weights for UNRES
487 ! print *,"KURWA",ww(48)
488 ! "WSCBASE ","WPEPBASE ","WSCPHO ","WPEPPHO "
489 ! "WVDWPP ","WELPP ","WVDWPSB ","WELPSB ","WVDWSB ",&
490 ! "WELSB ","WBOND ","WANG ","WSBLOC ","WTOR ",&
491 ! "WTORD ","WCORR ","WCORR3 ","WNULL ","WNULL ",&
492 ! "WCATPROT ","WCATCAT
493 ! +wbond_nucl*estr_nucl+wang_nucl*ebe_nucl&
494 ! +wvdwpp_nucl*evdwpp+welpp*eespp+wvdwpsb*evdwpsb+welpsb*eelpsb&
495 ! +wvdwsb*evdwsb+welsb*eelsb+wsbloc*esbloc+wtor_nucl*etors_nucl&
496 ! +wtor_d_nucl*etors_d_nucl+wcorr_nucl*ecorr_nucl+wcorr3_nucl*ecorr3_nucl&
501 allocate(weights(n_ene))
516 weights(15)=wstrain !0
519 weights(18)=0 !scal14 !
523 weights(26)= wvdwpp_nucl
530 weights(32) =wbond_nucl
531 weights(33) =wang_nucl
533 weights(35) =wtor_nucl
534 weights(36) =wtor_d_nucl
535 weights(37) =wcorr_nucl
536 weights(38) =wcorr3_nucl
538 weights(42) =wcatprot
540 weights(47)= wpepbase
544 call card_concat(controlcard,.false.)
546 ! Return if not own parameters
548 if (iparm.ne.myparm .and. separate_parset) return
550 call reads(controlcard,"BONDPAR",bondname_t,bondname)
551 open (ibond,file=bondname_t,status='old')
553 call reads(controlcard,"THETPAR",thetname_t,thetname)
554 open (ithep,file=thetname_t,status='old')
556 call reads(controlcard,"ROTPAR",rotname_t,rotname)
557 open (irotam,file=rotname_t,status='old')
559 call reads(controlcard,"TORPAR",torname_t,torname)
560 open (itorp,file=torname_t,status='old')
562 call reads(controlcard,"TORDPAR",tordname_t,tordname)
563 open (itordp,file=tordname_t,status='old')
565 call reads(controlcard,"SCCORPAR",sccorname_t,sccorname)
566 open (isccor,file=sccorname_t,status='old')
568 call reads(controlcard,"FOURIER",fouriername_t,fouriername)
569 open (ifourier,file=fouriername_t,status='old')
571 call reads(controlcard,"ELEPAR",elename_t,elename)
572 open (ielep,file=elename_t,status='old')
574 call reads(controlcard,"SIDEPAR",sidename_t,sidename)
575 open (isidep,file=sidename_t,status='old')
577 call reads(controlcard,"SCPPAR",scpname_t,scpname)
578 open (iscpp,file=scpname_t,status='old')
580 call getenv_loc('IONPAR',ionname)
581 open (iion,file=ionname,status='old')
583 write (iout,*) "Parameter set:",iparm
584 write (iout,*) "Energy-term weights:"
586 write (iout,'(a16,f10.5)') wname(i),ww(i)
588 write (iout,*) "Sidechain potential file : ",&
589 sidename_t(:ilen(sidename_t))
591 write (iout,*) "SCp potential file : ",&
592 scpname_t(:ilen(scpname_t))
594 write (iout,*) "Electrostatic potential file : ",&
595 elename_t(:ilen(elename_t))
596 write (iout,*) "Cumulant coefficient file : ",&
597 fouriername_t(:ilen(fouriername_t))
598 write (iout,*) "Torsional parameter file : ",&
599 torname_t(:ilen(torname_t))
600 write (iout,*) "Double torsional parameter file : ",&
601 tordname_t(:ilen(tordname_t))
602 write (iout,*) "Backbone-rotamer parameter file : ",&
603 sccorname(:ilen(sccorname))
604 write (iout,*) "Bond & inertia constant file : ",&
605 bondname_t(:ilen(bondname_t))
606 write (iout,*) "Bending parameter file : ",&
607 thetname_t(:ilen(thetname_t))
608 write (iout,*) "Rotamer parameter file : ",&
609 rotname_t(:ilen(rotname_t))
612 ! Read the virtual-bond parameters, masses, and moments of inertia
613 ! and Stokes' radii of the peptide group and side chains
615 allocate(dsc(ntyp1)) !(ntyp1)
616 allocate(dsc_inv(ntyp1)) !(ntyp1)
617 allocate(nbondterm(ntyp)) !(ntyp)
618 allocate(vbldsc0(maxbondterm,ntyp)) !(maxbondterm,ntyp)
619 allocate(aksc(maxbondterm,ntyp)) !(maxbondterm,ntyp)
620 allocate(nbondterm_nucl(ntyp_molec(2))) !(ntyp)
621 allocate(vbldsc0_nucl(maxbondterm,ntyp_molec(2))) !(maxbondterm,ntyp)
622 allocate(aksc_nucl(maxbondterm,ntyp_molec(2))) !(maxbondterm,ntyp)
624 !el allocate(msc(ntyp+1)) !(ntyp+1)
625 !el allocate(isc(ntyp+1)) !(ntyp+1)
626 !el allocate(restok(ntyp+1)) !(ntyp+1)
627 allocate(abond0(maxbondterm,ntyp)) !(maxbondterm,ntyp)
630 read (ibond,*) vbldp0,akp
633 read (ibond,*) vbldsc0(1,i),aksc(1,i)
634 dsc(i) = vbldsc0(1,i)
638 dsc_inv(i)=1.0D0/dsc(i)
642 read (ibond,*) ijunk,vbldp0,vbldpDUM,akp,rjunk
644 read (ibond,*) nbondterm(i),(vbldsc0(j,i),aksc(j,i),abond0(j,i),&
646 dsc(i) = vbldsc0(1,i)
650 dsc_inv(i)=1.0D0/dsc(i)
655 write(iout,'(/a/)')"Force constants virtual bonds:"
656 write (iout,'(a10,a3,6a10)') 'Type','N','VBL','K',&
658 write(iout,'(a10,i3,6f10.5)') "p",1,vbldp0,akp,0.0d0
660 write (iout,'(a10,i3,6f10.5)') restyp(i,molnum(i)),nbondterm(i),&
661 vbldsc0(1,i),aksc(1,i),abond0(1,i)
663 write (iout,'(13x,3f10.5)') &
664 vbldsc0(j,i),aksc(j,i),abond0(j,i)
668 if (.not. allocated(msc)) allocate(msc(ntyp1,5))
669 if (.not. allocated(restok)) allocate(restok(ntyp1,5))
672 read(iion,*) msc(i,5),restok(i,5)
673 print *,msc(i,5),restok(i,5)
677 read (iion,*) ncatprotparm
678 allocate(catprm(ncatprotparm,4))
680 read (iion,*) (catprm(i,k),i=1,ncatprotparm)
683 read (ibond_nucl,*) vbldp0_nucl,akp_nucl,mp(2),ip(2),pstok(2)
686 read (ibond_nucl,*) vbldsc0_nucl(1,i),aksc_nucl(1,i),msc(i,2),rjunk,restok(i,2)
687 ! dsc(i) = vbldsc0_nucl(1,i)
691 ! dsc_inv(i)=1.0D0/dsc(i)
696 !----------------------------------------------------
697 allocate(a0thet(-ntyp:ntyp),theta0(-ntyp:ntyp))
698 allocate(sig0(-ntyp:ntyp),sigc0(-ntyp:ntyp)) !(-ntyp:ntyp)
699 allocate(athet(2,-ntyp:ntyp,-1:1,-1:1))
700 allocate(bthet(2,-ntyp:ntyp,-1:1,-1:1)) !(2,-ntyp:ntyp,-1:1,-1:1)
701 allocate(polthet(0:3,-ntyp:ntyp)) !(0:3,-ntyp:ntyp)
702 allocate(gthet(3,-ntyp:ntyp)) !(3,-ntyp:ntyp)
708 athet(j,i,ichir1,ichir2)=0.0D0
709 bthet(j,i,ichir1,ichir2)=0.0D0
723 !elwrite(iout,*) "parmread kontrol"
727 ! Read the parameters of the probability distribution/energy expression
728 ! of the virtual-bond valence angles theta
731 read (ithep,*) a0thet(i),(athet(j,i,1,1),j=1,2),&
732 (bthet(j,i,1,1),j=1,2)
733 read (ithep,*) (polthet(j,i),j=0,3)
734 !elwrite(iout,*) "parmread kontrol in cryst_theta"
735 read (ithep,*) (gthet(j,i),j=1,3)
736 !elwrite(iout,*) "parmread kontrol in cryst_theta"
737 read (ithep,*) theta0(i),sig0(i),sigc0(i)
739 !elwrite(iout,*) "parmread kontrol in cryst_theta"
741 !elwrite(iout,*) "parmread kontrol in cryst_theta"
743 athet(1,i,1,-1)=athet(1,i,1,1)
744 athet(2,i,1,-1)=athet(2,i,1,1)
745 bthet(1,i,1,-1)=-bthet(1,i,1,1)
746 bthet(2,i,1,-1)=-bthet(2,i,1,1)
747 athet(1,i,-1,1)=-athet(1,i,1,1)
748 athet(2,i,-1,1)=-athet(2,i,1,1)
749 bthet(1,i,-1,1)=bthet(1,i,1,1)
750 bthet(2,i,-1,1)=bthet(2,i,1,1)
752 !elwrite(iout,*) "parmread kontrol in cryst_theta"
755 athet(1,i,-1,-1)=athet(1,-i,1,1)
756 athet(2,i,-1,-1)=-athet(2,-i,1,1)
757 bthet(1,i,-1,-1)=bthet(1,-i,1,1)
758 bthet(2,i,-1,-1)=-bthet(2,-i,1,1)
759 athet(1,i,-1,1)=athet(1,-i,1,1)
760 athet(2,i,-1,1)=-athet(2,-i,1,1)
761 bthet(1,i,-1,1)=-bthet(1,-i,1,1)
762 bthet(2,i,-1,1)=bthet(2,-i,1,1)
763 athet(1,i,1,-1)=-athet(1,-i,1,1)
764 athet(2,i,1,-1)=athet(2,-i,1,1)
765 bthet(1,i,1,-1)=bthet(1,-i,1,1)
766 bthet(2,i,1,-1)=-bthet(2,-i,1,1)
771 polthet(j,i)=polthet(j,-i)
774 gthet(j,i)=gthet(j,-i)
777 !elwrite(iout,*) "parmread kontrol in cryst_theta"
779 !elwrite(iout,*) "parmread kontrol in cryst_theta"
782 ! & 'Parameters of the virtual-bond valence angles:'
783 ! write (iout,'(/a/9x,5a/79(1h-))') 'Fourier coefficients:',
784 ! & ' ATHETA0 ',' A1 ',' A2 ',
787 ! write(iout,'(a3,i4,2x,5(1pe14.5))') restyp(i),i,
788 ! & a0thet(i),(athet(j,i),j=1,2),(bthet(j,i),j=1,2)
790 ! write (iout,'(/a/9x,5a/79(1h-))')
791 ! & 'Parameters of the expression for sigma(theta_c):',
792 ! & ' ALPH0 ',' ALPH1 ',' ALPH2 ',
793 ! & ' ALPH3 ',' SIGMA0C '
795 ! write (iout,'(a3,i4,2x,5(1pe14.5))') restyp(i),i,
796 ! & (polthet(j,i),j=0,3),sigc0(i)
798 ! write (iout,'(/a/9x,5a/79(1h-))')
799 ! & 'Parameters of the second gaussian:',
800 ! & ' THETA0 ',' SIGMA0 ',' G1 ',
803 ! write (iout,'(a3,i4,2x,5(1pe14.5))') restyp(i),i,theta0(i),
804 ! & sig0(i),(gthet(j,i),j=1,3)
807 'Parameters of the virtual-bond valence angles:'
808 write (iout,'(/a/9x,5a/79(1h-))') &
809 'Coefficients of expansion',&
810 ' theta0 ',' a1*10^2 ',' a2*10^2 ',&
811 ' b1*10^1 ',' b2*10^1 '
813 write(iout,'(a3,1h&,2x,5(f8.3,1h&))') restyp(i),&
814 a0thet(i),(100*athet(j,i,1,1),j=1,2),&
815 (10*bthet(j,i,1,1),j=1,2)
817 write (iout,'(/a/9x,5a/79(1h-))') &
818 'Parameters of the expression for sigma(theta_c):',&
819 ' alpha0 ',' alph1 ',' alph2 ',&
820 ' alhp3 ',' sigma0c '
822 write (iout,'(a3,1h&,2x,5(1pe12.3,1h&))') restyp(i),&
823 (polthet(j,i),j=0,3),sigc0(i)
825 write (iout,'(/a/9x,5a/79(1h-))') &
826 'Parameters of the second gaussian:',&
827 ' theta0 ',' sigma0*10^2 ',' G1*10^-1',&
830 write (iout,'(a3,1h&,2x,5(f8.3,1h&))') restyp(i),theta0(i),&
831 100*sig0(i),gthet(1,i)*0.1D0,gthet(2,i),gthet(3,i)*10.0D0
836 ! Read the parameters of Utheta determined from ab initio surfaces
837 ! Kozlowska et al., J. Phys.: Condens. Matter 19 (2007) 285203
839 allocate(ithetyp(-ntyp1:ntyp1)) !(-ntyp1:ntyp1)
840 ! write (iout,*) "tu dochodze"
841 IF (tor_mode.eq.0) THEN
842 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
843 read (ithep,*) nthetyp,ntheterm,ntheterm2,&
844 ntheterm3,nsingle,ndouble
845 nntheterm=max0(ntheterm,ntheterm2,ntheterm3)
847 !----------------------------------------------------
848 ! allocate(ithetyp(-ntyp1:ntyp1)) !(-ntyp1:ntyp1)
849 allocate(aa0thet(-nthetyp-1:nthetyp+1,&
850 -nthetyp-1:nthetyp+1,-nthetyp-1:nthetyp+1,2))
851 !(-maxthetyp1:maxthetyp1,-maxthetyp1:maxthetyp1,-maxthetyp1:maxthetyp1,2)
852 allocate(aathet(ntheterm,-nthetyp-1:nthetyp+1,&
853 -nthetyp-1:nthetyp+1,-nthetyp-1:nthetyp+1,2))
854 !(maxtheterm,-maxthetyp1:maxthetyp1,&
855 ! -maxthetyp1:maxthetyp1,-maxthetyp1:maxthetyp1,2)
856 allocate(bbthet(nsingle,ntheterm2,-nthetyp-1:nthetyp+1,&
857 -nthetyp-1:nthetyp+1,-nthetyp-1:nthetyp+1,2))
858 allocate(ccthet(nsingle,ntheterm2,-nthetyp-1:nthetyp+1,&
859 -nthetyp-1:nthetyp+1,-nthetyp-1:nthetyp+1,2))
860 allocate(ddthet(nsingle,ntheterm2,-nthetyp-1:nthetyp+1,&
861 -nthetyp-1:nthetyp+1,-nthetyp-1:nthetyp+1,2))
862 allocate(eethet(nsingle,ntheterm2,-nthetyp-1:nthetyp+1,&
863 -nthetyp-1:nthetyp+1,-nthetyp-1:nthetyp+1,2))
864 !(maxsingle,maxtheterm2,-maxthetyp1:maxthetyp1,&
865 ! -maxthetyp1:maxthetyp1,-maxthetyp1:maxthetyp1,2)
866 allocate(ffthet(ndouble,ndouble,ntheterm3,-nthetyp-1:nthetyp+1,&
867 -nthetyp-1:nthetyp+1,-nthetyp-1:nthetyp+1,2))
868 allocate(ggthet(ndouble,ndouble,ntheterm3,-nthetyp-1:nthetyp+1,&
869 -nthetyp-1:nthetyp+1,-nthetyp-1:nthetyp+1,2))
870 !(maxdouble,maxdouble,maxtheterm3,-maxthetyp1:maxthetyp1,&
871 ! -maxthetyp1:maxthetyp1,-maxthetyp1:maxthetyp1,2))
874 read (ithep,*) (ithetyp(i),i=1,ntyp1)
876 ithetyp(i)=-ithetyp(-i)
878 ! write (iout,*) "tu dochodze"
879 aa0thet(:,:,:,:)=0.0d0
880 aathet(:,:,:,:,:)=0.0d0
881 bbthet(:,:,:,:,:,:)=0.0d0
882 ccthet(:,:,:,:,:,:)=0.0d0
883 ddthet(:,:,:,:,:,:)=0.0d0
884 eethet(:,:,:,:,:,:)=0.0d0
885 ffthet(:,:,:,:,:,:,:)=0.0d0
886 ggthet(:,:,:,:,:,:,:)=0.0d0
890 do j=-nthetyp,nthetyp
891 do k=-nthetyp,nthetyp
892 read (ithep,'(6a)') res1
893 read (ithep,*) aa0thet(i,j,k,iblock)
894 read (ithep,*)(aathet(l,i,j,k,iblock),l=1,ntheterm)
896 ((bbthet(lll,ll,i,j,k,iblock),lll=1,nsingle),&
897 (ccthet(lll,ll,i,j,k,iblock),lll=1,nsingle),&
898 (ddthet(lll,ll,i,j,k,iblock),lll=1,nsingle),&
899 (eethet(lll,ll,i,j,k,iblock),lll=1,nsingle),&
902 (((ffthet(llll,lll,ll,i,j,k,iblock),&
903 ffthet(lll,llll,ll,i,j,k,iblock),&
904 ggthet(llll,lll,ll,i,j,k,iblock),&
905 ggthet(lll,llll,ll,i,j,k,iblock),&
906 llll=1,lll-1),lll=2,ndouble),ll=1,ntheterm3)
911 ! For dummy ends assign glycine-type coefficients of theta-only terms; the
912 ! coefficients of theta-and-gamma-dependent terms are zero.
917 aathet(l,i,j,nthetyp+1,iblock)=0.0d0
918 aathet(l,nthetyp+1,i,j,iblock)=0.0d0
920 aa0thet(i,j,nthetyp+1,iblock)=0.0d0
921 aa0thet(nthetyp+1,i,j,iblock)=0.0d0
924 aathet(l,nthetyp+1,i,nthetyp+1,iblock)=0.0d0
926 aa0thet(nthetyp+1,i,nthetyp+1,iblock)=0.0d0
929 ! Substitution for D aminoacids from symmetry.
932 do j=-nthetyp,nthetyp
933 do k=-nthetyp,nthetyp
934 aa0thet(i,j,k,iblock)=aa0thet(-i,-j,-k,iblock)
936 aathet(l,i,j,k,iblock)=aathet(l,-i,-j,-k,iblock)
940 bbthet(lll,ll,i,j,k,iblock)=bbthet(lll,ll,-i,-j,-k,iblock)
941 ccthet(lll,ll,i,j,k,iblock)=-ccthet(lll,ll,-i,-j,-k,iblock)
942 ddthet(lll,ll,i,j,k,iblock)=ddthet(lll,ll,-i,-j,-k,iblock)
943 eethet(lll,ll,i,j,k,iblock)=-eethet(lll,ll,-i,-j,-k,iblock)
949 ffthet(llll,lll,ll,i,j,k,iblock)= &
950 ffthet(llll,lll,ll,-i,-j,-k,iblock)
951 ffthet(lll,llll,ll,i,j,k,iblock)= &
952 ffthet(lll,llll,ll,-i,-j,-k,iblock)
953 ggthet(llll,lll,ll,i,j,k,iblock)= &
954 -ggthet(llll,lll,ll,-i,-j,-k,iblock)
955 ggthet(lll,llll,ll,i,j,k,iblock)= &
956 -ggthet(lll,llll,ll,-i,-j,-k,iblock)
966 ! Control printout of the coefficients of virtual-bond-angle potentials
970 write (iout,'(//a)') 'Parameter of virtual-bond-angle potential'
974 write (iout,'(//4a)') &
975 'Type ',onelett(i),onelett(j),onelett(k)
976 write (iout,'(//a,10x,a)') " l","a[l]"
977 write (iout,'(i2,1pe15.5)') 0,aa0thet(i,j,k,iblock)
978 write (iout,'(i2,1pe15.5)') &
979 (l,aathet(l,i,j,k,iblock),l=1,ntheterm)
981 write (iout,'(//2h m,4(9x,a,3h[m,i1,1h]))') &
982 "b",l,"c",l,"d",l,"e",l
984 write (iout,'(i2,4(1pe15.5))') m,&
985 bbthet(m,l,i,j,k,iblock),ccthet(m,l,i,j,k,iblock),&
986 ddthet(m,l,i,j,k,iblock),eethet(m,l,i,j,k,iblock)
990 write (iout,'(//3hm,n,4(6x,a,5h[m,n,i1,1h]))') &
991 "f+",l,"f-",l,"g+",l,"g-",l
994 write (iout,'(i1,1x,i1,4(1pe15.5))') n,m,&
995 ffthet(n,m,l,i,j,k,iblock),&
996 ffthet(m,n,l,i,j,k,iblock),&
997 ggthet(n,m,l,i,j,k,iblock),&
998 ggthet(m,n,l,i,j,k,iblock)
1009 !C here will be the apropriate recalibrating for D-aminoacid
1010 read (ithep,*) nthetyp
1011 allocate(nbend_kcc_Tb(-nthetyp:nthetyp))
1012 allocate(v1bend_chyb(0:36,-nthetyp:nthetyp))
1013 do i=-nthetyp+1,nthetyp-1
1014 read (ithep,*) nbend_kcc_Tb(i)
1015 do j=0,nbend_kcc_Tb(i)
1016 read (ithep,*) ijunk,v1bend_chyb(j,i)
1020 write (iout,'(a)') &
1021 "Parameters of the valence-only potentials"
1022 do i=-nthetyp+1,nthetyp-1
1023 write (iout,'(2a)') "Type ",toronelet(i)
1024 do k=0,nbend_kcc_Tb(i)
1025 write(iout,'(i5,f15.5)') k,v1bend_chyb(k,i)
1032 !--------------- Reading theta parameters for nucleic acid-------
1033 read (ithep_nucl,*) nthetyp_nucl,ntheterm_nucl,&
1034 ntheterm2_nucl,ntheterm3_nucl,nsingle_nucl,ndouble_nucl
1035 nntheterm_nucl=max0(ntheterm_nucl,ntheterm2_nucl,ntheterm3_nucl)
1036 allocate(ithetyp_nucl(ntyp1_molec(2))) !(-ntyp1:ntyp1)
1037 allocate(aa0thet_nucl(nthetyp_nucl+1,&
1038 nthetyp_nucl+1,nthetyp_nucl+1))
1039 !(-maxthetyp1:maxthetyp1,-maxthetyp1:maxthetyp1,-maxthetyp1:maxthetyp1,2)
1040 allocate(aathet_nucl(ntheterm_nucl+1,nthetyp_nucl+1,&
1041 nthetyp_nucl+1,nthetyp_nucl+1))
1042 !(maxtheterm,-maxthetyp1:maxthetyp1,&
1043 ! -maxthetyp1:maxthetyp1,-maxthetyp1:maxthetyp1,2)
1044 allocate(bbthet_nucl(nsingle_nucl+1,ntheterm2_nucl+1,nthetyp_nucl+1,&
1045 nthetyp_nucl+1,nthetyp_nucl+1))
1046 allocate(ccthet_nucl(nsingle_nucl+1,ntheterm2_nucl+1,nthetyp_nucl+1,&
1047 nthetyp_nucl+1,nthetyp_nucl+1))
1048 allocate(ddthet_nucl(nsingle_nucl+1,ntheterm2_nucl+1,nthetyp_nucl+1,&
1049 nthetyp_nucl+1,nthetyp_nucl+1))
1050 allocate(eethet_nucl(nsingle_nucl+1,ntheterm2_nucl+1,nthetyp_nucl+1,&
1051 nthetyp_nucl+1,nthetyp_nucl+1))
1052 !(maxsingle,maxtheterm2,-maxthetyp1:maxthetyp1,&
1053 ! -maxthetyp1:maxthetyp1,-maxthetyp1:maxthetyp1,2)
1054 allocate(ffthet_nucl(ndouble_nucl+1,ndouble_nucl+1,ntheterm3_nucl+1,&
1055 nthetyp_nucl+1,nthetyp_nucl+1,nthetyp_nucl+1))
1056 allocate(ggthet_nucl(ndouble_nucl+1,ndouble_nucl+1,ntheterm3_nucl+1,&
1057 nthetyp_nucl+1,nthetyp_nucl+1,nthetyp_nucl+1))
1059 !(maxdouble,maxdouble,maxtheterm3,-maxthetyp1:maxthetyp1,&
1060 ! -maxthetyp1:maxthetyp1,-maxthetyp1:maxthetyp1,2))
1062 read (ithep_nucl,*) (ithetyp_nucl(i),i=1,ntyp1_molec(2))
1064 aa0thet_nucl(:,:,:)=0.0d0
1065 aathet_nucl(:,:,:,:)=0.0d0
1066 bbthet_nucl(:,:,:,:,:)=0.0d0
1067 ccthet_nucl(:,:,:,:,:)=0.0d0
1068 ddthet_nucl(:,:,:,:,:)=0.0d0
1069 eethet_nucl(:,:,:,:,:)=0.0d0
1070 ffthet_nucl(:,:,:,:,:,:)=0.0d0
1071 ggthet_nucl(:,:,:,:,:,:)=0.0d0
1076 read (ithep_nucl,'(3a)') t1,t2,t3
1077 read (ithep_nucl,*) aa0thet_nucl(i,j,k)
1078 read (ithep_nucl,*)(aathet_nucl(l,i,j,k),l=1,ntheterm_nucl)
1079 read (ithep_nucl,*) &
1080 (((bbthet_nucl(lll,ll,i,j,k),lll=1,nsingle_nucl), &
1081 (ccthet_nucl(lll,ll,i,j,k),lll=1,nsingle_nucl), &
1082 (ddthet_nucl(lll,ll,i,j,k),lll=1,nsingle_nucl), &
1083 (eethet_nucl(lll,ll,i,j,k),lll=1,nsingle_nucl)),ll=1,ntheterm2_nucl)
1084 read (ithep_nucl,*) &
1085 (((ffthet_nucl(llll,lll,ll,i,j,k),ffthet_nucl(lll,llll,ll,i,j,k), &
1086 ggthet_nucl(llll,lll,ll,i,j,k),ggthet_nucl(lll,llll,ll,i,j,k), &
1087 llll=1,lll-1),lll=2,ndouble_nucl),ll=1,ntheterm3_nucl)
1093 !-------------------------------------------
1094 allocate(nlob(ntyp1)) !(ntyp1)
1095 allocate(bsc(maxlob,ntyp)) !(maxlob,ntyp)
1096 allocate(censc(3,maxlob,-ntyp:ntyp)) !(3,maxlob,-ntyp:ntyp)
1097 allocate(gaussc(3,3,maxlob,-ntyp:ntyp)) !(3,3,maxlob,-ntyp:ntyp)
1115 gaussc(l,k,j,i)=0.0D0
1123 ! Read the parameters of the probability distribution/energy expression
1124 ! of the side chains.
1127 !c write (iout,*) "tu dochodze",i
1128 read (irotam,'(3x,i3,f8.3)') nlob(i),dsc(i)
1132 dsc_inv(i)=1.0D0/dsc(i)
1143 read(irotam,*)(censc(k,1,i),k=1,3),((blower(k,l,1),l=1,k),k=1,3)
1144 censc(1,1,-i)=censc(1,1,i)
1145 censc(2,1,-i)=censc(2,1,i)
1146 censc(3,1,-i)=-censc(3,1,i)
1148 read (irotam,*) bsc(j,i)
1149 read (irotam,*) (censc(k,j,i),k=1,3),&
1150 ((blower(k,l,j),l=1,k),k=1,3)
1151 censc(1,j,-i)=censc(1,j,i)
1152 censc(2,j,-i)=censc(2,j,i)
1153 censc(3,j,-i)=-censc(3,j,i)
1154 ! BSC is amplitude of Gaussian
1161 akl=akl+blower(k,m,j)*blower(l,m,j)
1165 if (((k.eq.3).and.(l.ne.3)) &
1166 .or.((l.eq.3).and.(k.ne.3))) then
1167 gaussc(k,l,j,-i)=-akl
1168 gaussc(l,k,j,-i)=-akl
1170 gaussc(k,l,j,-i)=akl
1171 gaussc(l,k,j,-i)=akl
1180 write (iout,'(/a)') 'Parameters of side-chain local geometry'
1183 if (nlobi.gt.0) then
1184 write (iout,'(/3a,i2,a,f8.3)') 'Residue type: ',restyp(i),&
1185 ' # of gaussian lobes:',nlobi,' dsc:',dsc(i)
1186 ! write (iout,'(/a,8x,i1,4(25x,i1))') 'Lobe:',(j,j=1,nlobi)
1187 ! write (iout,'(a,f10.4,4(16x,f10.4))')
1188 ! & 'Center ',(bsc(j,i),j=1,nlobi)
1189 ! write (iout,'(5(2x,3f8.4))') ((censc(k,j,i),k=1,3),j=1,nlobi)
1190 write (iout,'(1h&,a,3(2h&&,f8.3,2h&&))') &
1191 'log h',(bsc(j,i),j=1,nlobi)
1192 write (iout,'(1h&,a,3(1h&,f8.3,1h&,f8.3,1h&,f8.3,1h&))') &
1193 'x',((censc(k,j,i),k=1,3),j=1,nlobi)
1194 ! write (iout,'(a)')
1200 ! blower(k,l,j)=gaussc(ind,j,i)
1205 write (iout,'(2h& ,5(2x,1h&,3(f7.3,1h&)))') &
1206 ((gaussc(k,l,j,i),l=1,3),j=1,nlobi)
1213 ! Read scrot parameters for potentials determined from all-atom AM1 calculations
1214 ! added by Urszula Kozlowska 07/11/2007
1216 allocate(sc_parmin(65,ntyp)) !(maxsccoef,ntyp)
1224 read(irotam,*) sc_parmin(j,i)
1230 !---------reading nucleic acid parameters for rotamers-------------------
1231 allocate(sc_parmin_nucl(9,ntyp_molec(2))) !(maxsccoef,ntyp)
1232 do i=1,ntyp_molec(2)
1233 read (irotam_nucl,*)
1235 read(irotam_nucl,*) sc_parmin_nucl(j,i)
1241 write (iout,*) "Base rotamer parameters"
1242 do i=1,ntyp_molec(2)
1243 write (iout,'(a)') restyp(i,2)
1244 write (iout,'(i5,f10.5)') (i,sc_parmin_nucl(j,i),j=1,9)
1249 read (ifourier,*) nloctyp
1250 !el write(iout,*)"nloctyp",nloctyp
1251 SPLIT_FOURIERTOR = nloctyp.lt.0
1252 nloctyp = iabs(nloctyp)
1254 if (.not.allocated(itype2loc)) allocate(itype2loc(-ntyp1:ntyp1))
1255 print *,"shape",shape(itype2loc)
1256 allocate(iloctyp(-nloctyp:nloctyp))
1257 allocate(bnew1(3,2,-nloctyp:nloctyp))
1258 allocate(bnew2(3,2,-nloctyp:nloctyp))
1259 allocate(ccnew(3,2,-nloctyp:nloctyp))
1260 allocate(ddnew(3,2,-nloctyp:nloctyp))
1261 allocate(e0new(3,-nloctyp:nloctyp))
1262 allocate(eenew(2,2,2,-nloctyp:nloctyp))
1263 allocate(bnew1tor(3,2,-nloctyp:nloctyp))
1264 allocate(bnew2tor(3,2,-nloctyp:nloctyp))
1265 allocate(ccnewtor(3,2,-nloctyp:nloctyp))
1266 allocate(ddnewtor(3,2,-nloctyp:nloctyp))
1267 allocate(e0newtor(3,-nloctyp:nloctyp))
1268 allocate(eenewtor(2,2,2,-nloctyp:nloctyp))
1270 read (ifourier,*) (itype2loc(i),i=1,ntyp)
1271 read (ifourier,*) (iloctyp(i),i=0,nloctyp-1)
1272 itype2loc(ntyp1)=nloctyp
1273 iloctyp(nloctyp)=ntyp1
1275 itype2loc(-i)=-itype2loc(i)
1278 allocate(iloctyp(-nloctyp:nloctyp))
1279 allocate(itype2loc(-ntyp1:ntyp1))
1286 iloctyp(-i)=-iloctyp(i)
1288 !c write (iout,*) "itype2loc",(itype2loc(i),i=1,ntyp1)
1289 !c write (iout,*) "nloctyp",nloctyp,
1290 !c & " iloctyp",(iloctyp(i),i=0,nloctyp)
1291 !c write (iout,*) "itype2loc",(itype2loc(i),i=1,ntyp1)
1292 !c write (iout,*) "nloctyp",nloctyp,
1293 !c & " iloctyp",(iloctyp(i),i=0,nloctyp)
1296 !c write (iout,*) "NEWCORR",i
1300 read (ifourier,*) bnew1(ii,j,i)
1303 !c write (iout,*) "NEWCORR BNEW1"
1304 !c write (iout,*) ((bnew1(ii,j,i),ii=1,3),j=1,2)
1307 read (ifourier,*) bnew2(ii,j,i)
1310 !c write (iout,*) "NEWCORR BNEW2"
1311 !c write (iout,*) ((bnew2(ii,j,i),ii=1,3),j=1,2)
1313 read (ifourier,*) ccnew(kk,1,i)
1314 read (ifourier,*) ccnew(kk,2,i)
1316 !c write (iout,*) "NEWCORR CCNEW"
1317 !c write (iout,*) ((ccnew(ii,j,i),ii=1,3),j=1,2)
1319 read (ifourier,*) ddnew(kk,1,i)
1320 read (ifourier,*) ddnew(kk,2,i)
1322 !c write (iout,*) "NEWCORR DDNEW"
1323 !c write (iout,*) ((ddnew(ii,j,i),ii=1,3),j=1,2)
1327 read (ifourier,*) eenew(ii,jj,kk,i)
1331 !c write (iout,*) "NEWCORR EENEW1"
1332 !c write(iout,*)(((eenew(ii,jj,kk,i),kk=1,2),jj=1,2),ii=1,2)
1334 read (ifourier,*) e0new(ii,i)
1336 !c write (iout,*) (e0new(ii,i),ii=1,3)
1338 !c write (iout,*) "NEWCORR EENEW"
1341 ccnew(ii,1,i)=ccnew(ii,1,i)/2
1342 ccnew(ii,2,i)=ccnew(ii,2,i)/2
1343 ddnew(ii,1,i)=ddnew(ii,1,i)/2
1344 ddnew(ii,2,i)=ddnew(ii,2,i)/2
1349 bnew1(ii,1,-i)= bnew1(ii,1,i)
1350 bnew1(ii,2,-i)=-bnew1(ii,2,i)
1351 bnew2(ii,1,-i)= bnew2(ii,1,i)
1352 bnew2(ii,2,-i)=-bnew2(ii,2,i)
1355 !c ccnew(ii,1,i)=ccnew(ii,1,i)/2
1356 !c ccnew(ii,2,i)=ccnew(ii,2,i)/2
1357 !c ddnew(ii,1,i)=ddnew(ii,1,i)/2
1358 !c ddnew(ii,2,i)=ddnew(ii,2,i)/2
1359 ccnew(ii,1,-i)=ccnew(ii,1,i)
1360 ccnew(ii,2,-i)=-ccnew(ii,2,i)
1361 ddnew(ii,1,-i)=ddnew(ii,1,i)
1362 ddnew(ii,2,-i)=-ddnew(ii,2,i)
1364 e0new(1,-i)= e0new(1,i)
1365 e0new(2,-i)=-e0new(2,i)
1366 e0new(3,-i)=-e0new(3,i)
1368 eenew(kk,1,1,-i)= eenew(kk,1,1,i)
1369 eenew(kk,1,2,-i)=-eenew(kk,1,2,i)
1370 eenew(kk,2,1,-i)=-eenew(kk,2,1,i)
1371 eenew(kk,2,2,-i)= eenew(kk,2,2,i)
1375 write (iout,'(a)') "Coefficients of the multibody terms"
1376 do i=-nloctyp+1,nloctyp-1
1377 write (iout,*) "Type: ",onelet(iloctyp(i))
1378 write (iout,*) "Coefficients of the expansion of B1"
1380 write (iout,'(3hB1(,i1,1h),3f10.5)') j,(bnew1(k,j,i),k=1,3)
1382 write (iout,*) "Coefficients of the expansion of B2"
1384 write (iout,'(3hB2(,i1,1h),3f10.5)') j,(bnew2(k,j,i),k=1,3)
1386 write (iout,*) "Coefficients of the expansion of C"
1387 write (iout,'(3hC11,3f10.5)') (ccnew(j,1,i),j=1,3)
1388 write (iout,'(3hC12,3f10.5)') (ccnew(j,2,i),j=1,3)
1389 write (iout,*) "Coefficients of the expansion of D"
1390 write (iout,'(3hD11,3f10.5)') (ddnew(j,1,i),j=1,3)
1391 write (iout,'(3hD12,3f10.5)') (ddnew(j,2,i),j=1,3)
1392 write (iout,*) "Coefficients of the expansion of E"
1393 write (iout,'(2hE0,3f10.5)') (e0new(j,i),j=1,3)
1396 write (iout,'(1hE,2i1,2f10.5)') j,k,(eenew(l,j,k,i),l=1,2)
1401 IF (SPLIT_FOURIERTOR) THEN
1403 !c write (iout,*) "NEWCORR TOR",i
1407 read (ifourier,*) bnew1tor(ii,j,i)
1410 !c write (iout,*) "NEWCORR BNEW1 TOR"
1411 !c write (iout,*) ((bnew1tor(ii,j,i),ii=1,3),j=1,2)
1414 read (ifourier,*) bnew2tor(ii,j,i)
1417 !c write (iout,*) "NEWCORR BNEW2 TOR"
1418 !c write (iout,*) ((bnew2tor(ii,j,i),ii=1,3),j=1,2)
1420 read (ifourier,*) ccnewtor(kk,1,i)
1421 read (ifourier,*) ccnewtor(kk,2,i)
1423 !c write (iout,*) "NEWCORR CCNEW TOR"
1424 !c write (iout,*) ((ccnew(ii,j,i),ii=1,3),j=1,2)
1426 read (ifourier,*) ddnewtor(kk,1,i)
1427 read (ifourier,*) ddnewtor(kk,2,i)
1429 !c write (iout,*) "NEWCORR DDNEW TOR"
1430 !c write (iout,*) ((ddnewtor(ii,j,i),ii=1,3),j=1,2)
1434 read (ifourier,*) eenewtor(ii,jj,kk,i)
1438 !c write (iout,*) "NEWCORR EENEW1 TOR"
1439 !c write(iout,*)(((eenewtor(ii,jj,kk,i),kk=1,2),jj=1,2),ii=1,2)
1441 read (ifourier,*) e0newtor(ii,i)
1443 !c write (iout,*) (e0newtor(ii,i),ii=1,3)
1445 !c write (iout,*) "NEWCORR EENEW TOR"
1448 ccnewtor(ii,1,i)=ccnewtor(ii,1,i)/2
1449 ccnewtor(ii,2,i)=ccnewtor(ii,2,i)/2
1450 ddnewtor(ii,1,i)=ddnewtor(ii,1,i)/2
1451 ddnewtor(ii,2,i)=ddnewtor(ii,2,i)/2
1456 bnew1tor(ii,1,-i)= bnew1tor(ii,1,i)
1457 bnew1tor(ii,2,-i)=-bnew1tor(ii,2,i)
1458 bnew2tor(ii,1,-i)= bnew2tor(ii,1,i)
1459 bnew2tor(ii,2,-i)=-bnew2tor(ii,2,i)
1462 ccnewtor(ii,1,-i)=ccnewtor(ii,1,i)
1463 ccnewtor(ii,2,-i)=-ccnewtor(ii,2,i)
1464 ddnewtor(ii,1,-i)=ddnewtor(ii,1,i)
1465 ddnewtor(ii,2,-i)=-ddnewtor(ii,2,i)
1467 e0newtor(1,-i)= e0newtor(1,i)
1468 e0newtor(2,-i)=-e0newtor(2,i)
1469 e0newtor(3,-i)=-e0newtor(3,i)
1471 eenewtor(kk,1,1,-i)= eenewtor(kk,1,1,i)
1472 eenewtor(kk,1,2,-i)=-eenewtor(kk,1,2,i)
1473 eenewtor(kk,2,1,-i)=-eenewtor(kk,2,1,i)
1474 eenewtor(kk,2,2,-i)= eenewtor(kk,2,2,i)
1478 write (iout,'(a)') &
1479 "Single-body coefficients of the torsional potentials"
1480 do i=-nloctyp+1,nloctyp-1
1481 write (iout,*) "Type: ",onelet(iloctyp(i))
1482 write (iout,*) "Coefficients of the expansion of B1tor"
1484 write (iout,'(3hB1(,i1,1h),3f10.5)') &
1485 j,(bnew1tor(k,j,i),k=1,3)
1487 write (iout,*) "Coefficients of the expansion of B2tor"
1489 write (iout,'(3hB2(,i1,1h),3f10.5)') &
1490 j,(bnew2tor(k,j,i),k=1,3)
1492 write (iout,*) "Coefficients of the expansion of Ctor"
1493 write (iout,'(3hC11,3f10.5)') (ccnewtor(j,1,i),j=1,3)
1494 write (iout,'(3hC12,3f10.5)') (ccnewtor(j,2,i),j=1,3)
1495 write (iout,*) "Coefficients of the expansion of Dtor"
1496 write (iout,'(3hD11,3f10.5)') (ddnewtor(j,1,i),j=1,3)
1497 write (iout,'(3hD12,3f10.5)') (ddnewtor(j,2,i),j=1,3)
1498 write (iout,*) "Coefficients of the expansion of Etor"
1499 write (iout,'(2hE0,3f10.5)') (e0newtor(j,i),j=1,3)
1502 write (iout,'(1hE,2i1,2f10.5)') &
1503 j,k,(eenewtor(l,j,k,i),l=1,2)
1509 do i=-nloctyp+1,nloctyp-1
1512 bnew1tor(ii,j,i)=bnew1(ii,j,i)
1517 bnew2tor(ii,j,i)=bnew2(ii,j,i)
1521 ccnewtor(ii,1,i)=ccnew(ii,1,i)
1522 ccnewtor(ii,2,i)=ccnew(ii,2,i)
1523 ddnewtor(ii,1,i)=ddnew(ii,1,i)
1524 ddnewtor(ii,2,i)=ddnew(ii,2,i)
1527 ENDIF !SPLIT_FOURIER_TOR
1529 allocate(ccold(2,2,-nloctyp-1:nloctyp+1))
1530 allocate(ddold(2,2,-nloctyp-1:nloctyp+1))
1531 allocate(eeold(2,2,-nloctyp-1:nloctyp+1))
1532 allocate(b(13,-nloctyp-1:nloctyp+1))
1534 write (iout,*) "Coefficients of the expansion of Eloc(l1,l2)"
1537 read (ifourier,*) (b(ii,i),ii=1,13)
1539 write (iout,*) 'Type ',onelet(iloctyp(i))
1540 write (iout,'(a,i2,a,f10.5)') ('b(',ii,')=',b(ii,i),ii=1,13)
1548 CCold(1,1,i)= b(7,i)
1549 CCold(2,2,i)=-b(7,i)
1550 CCold(2,1,i)= b(9,i)
1551 CCold(1,2,i)= b(9,i)
1552 CCold(1,1,-i)= b(7,i)
1553 CCold(2,2,-i)=-b(7,i)
1554 CCold(2,1,-i)=-b(9,i)
1555 CCold(1,2,-i)=-b(9,i)
1556 DDold(1,1,i)= b(6,i)
1557 DDold(2,2,i)=-b(6,i)
1558 DDold(2,1,i)= b(8,i)
1559 DDold(1,2,i)= b(8,i)
1560 DDold(1,1,-i)= b(6,i)
1561 DDold(2,2,-i)=-b(6,i)
1562 DDold(2,1,-i)=-b(8,i)
1563 DDold(1,2,-i)=-b(8,i)
1564 EEold(1,1,i)= b(10,i)+b(11,i)
1565 EEold(2,2,i)=-b(10,i)+b(11,i)
1566 EEold(2,1,i)= b(12,i)-b(13,i)
1567 EEold(1,2,i)= b(12,i)+b(13,i)
1568 EEold(1,1,-i)= b(10,i)+b(11,i)
1569 EEold(2,2,-i)=-b(10,i)+b(11,i)
1570 EEold(2,1,-i)=-b(12,i)+b(13,i)
1571 EEold(1,2,-i)=-b(12,i)-b(13,i)
1572 write(iout,*) "TU DOCHODZE"
1578 "Coefficients of the cumulants (independent of valence angles)"
1579 do i=-nloctyp+1,nloctyp-1
1580 write (iout,*) 'Type ',onelet(iloctyp(i))
1582 write(iout,'(2f10.5)') B(3,i),B(5,i)
1584 write(iout,'(2f10.5)') B(2,i),B(4,i)
1587 write (iout,'(2f10.5)') CCold(j,1,i),CCold(j,2,i)
1591 write (iout,'(2f10.5)') DDold(j,1,i),DDold(j,2,i)
1595 write (iout,'(2f10.5)') EEold(j,1,i),EEold(j,2,i)
1602 ! Read torsional parameters in old format
1604 allocate(itortyp(ntyp1)) !(-ntyp1:ntyp1)
1606 read (itorp,*) ntortyp,nterm_old
1607 write (iout,*) 'ntortyp,nterm',ntortyp,nterm_old
1608 read (itorp,*) (itortyp(i),i=1,ntyp)
1610 !el from energy module--------
1611 allocate(v1(nterm_old,ntortyp,ntortyp))
1612 allocate(v2(nterm_old,ntortyp,ntortyp)) !(maxterm,-maxtor:maxtor,-maxtor:maxtor)
1613 !el---------------------------
1619 read (itorp,*) kk,v1(k,j,i),v2(k,j,i)
1625 write (iout,'(/a/)') 'Torsional constants:'
1628 write (iout,'(2i3,6f10.5)') i,j,(v1(k,i,j),k=1,nterm_old)
1629 write (iout,'(6x,6f10.5)') (v2(k,i,j),k=1,nterm_old)
1637 ! Read torsional parameters
1639 IF (TOR_MODE.eq.0) THEN
1641 allocate(itortyp(-ntyp1:ntyp1)) !(-ntyp1:ntyp1)
1643 read (itorp,*) ntortyp
1644 read (itorp,*) (itortyp(i),i=1,ntyp)
1645 write (iout,*) 'ntortyp',ntortyp
1647 !el from energy module---------
1648 allocate(nterm(-ntortyp:ntortyp,-ntortyp:ntortyp,2)) !(-maxtor:maxtor,-maxtor:maxtor,2)
1649 allocate(nlor(-ntortyp:ntortyp,-ntortyp:ntortyp,2)) !(-maxtor:maxtor,-maxtor:maxtor,2)
1651 allocate(vlor1(maxlor,-ntortyp:ntortyp,-ntortyp:ntortyp)) !(maxlor,-maxtor:maxtor,-maxtor:maxtor)
1652 allocate(vlor2(maxlor,ntortyp,ntortyp))
1653 allocate(vlor3(maxlor,ntortyp,ntortyp)) !(maxlor,maxtor,maxtor)
1654 allocate(v0(-ntortyp:ntortyp,-ntortyp:ntortyp,2)) !(-maxtor:maxtor,-maxtor:maxtor,2)
1656 allocate(v1(maxterm,-ntortyp:ntortyp,-ntortyp:ntortyp,2))
1657 allocate(v2(maxterm,-ntortyp:ntortyp,-ntortyp:ntortyp,2)) !(maxterm,-maxtor:maxtor,-maxtor:maxtor,2)
1658 !el---------------------------
1660 do i=-ntortyp,ntortyp
1661 do j=-ntortyp,ntortyp
1667 !el---------------------------
1671 itortyp(i)=-itortyp(-i)
1673 ! write (iout,*) 'ntortyp',ntortyp
1675 do j=-ntortyp+1,ntortyp-1
1676 read (itorp,*) nterm(i,j,iblock),&
1678 nterm(-i,-j,iblock)=nterm(i,j,iblock)
1679 nlor(-i,-j,iblock)=nlor(i,j,iblock)
1682 do k=1,nterm(i,j,iblock)
1683 read (itorp,*) kk,v1(k,i,j,iblock),&
1685 v1(k,-i,-j,iblock)=v1(k,i,j,iblock)
1686 v2(k,-i,-j,iblock)=-v2(k,i,j,iblock)
1687 v0ij=v0ij+si*v1(k,i,j,iblock)
1690 do k=1,nlor(i,j,iblock)
1691 read (itorp,*) kk,vlor1(k,i,j),&
1692 vlor2(k,i,j),vlor3(k,i,j)
1693 v0ij=v0ij+vlor1(k,i,j)/(1+vlor3(k,i,j)**2)
1696 v0(-i,-j,iblock)=v0ij
1703 write (iout,'(/a/)') 'Torsional constants:'
1706 write (iout,*) 'ityp',i,' jtyp',j
1707 write (iout,*) 'Fourier constants'
1708 do k=1,nterm(i,j,iblock)
1709 write (iout,'(2(1pe15.5))') v1(k,i,j,iblock),&
1712 write (iout,*) 'Lorenz constants'
1713 do k=1,nlor(i,j,iblock)
1714 write (iout,'(3(1pe15.5))') &
1715 vlor1(k,i,j),vlor2(k,i,j),vlor3(k,i,j)
1722 ! 6/23/01 Read parameters for double torsionals
1724 !el from energy module------------
1725 allocate(v1c(2,maxtermd_1,-ntortyp+1:ntortyp-1,-ntortyp+1:ntortyp-1,-ntortyp+1:ntortyp-1,2))
1726 allocate(v1s(2,maxtermd_1,-ntortyp+1:ntortyp-1,-ntortyp+1:ntortyp-1,-ntortyp+1:ntortyp-1,2))
1727 !(2,maxtermd_1,-maxtor:maxtor,-maxtor:maxtor,-maxtor:maxtor,2)
1728 allocate(v2c(maxtermd_2,maxtermd_2,-ntortyp+1:ntortyp-1,-ntortyp+1:ntortyp-1,-ntortyp+1:ntortyp-1,2))
1729 allocate(v2s(maxtermd_2,maxtermd_2,-ntortyp+1:ntortyp-1,-ntortyp+1:ntortyp-1,-ntortyp+1:ntortyp-1,2))
1730 !(maxtermd_2,maxtermd_2,-maxtor:maxtor,-maxtor:maxtor,-maxtor:maxtor,2)
1731 allocate(ntermd_1(-ntortyp+1:ntortyp-1,-ntortyp+1:ntortyp-1,-ntortyp+1:ntortyp-1,2))
1732 allocate(ntermd_2(-ntortyp+1:ntortyp-1,-ntortyp+1:ntortyp-1,-ntortyp+1:ntortyp-1,2))
1733 !(-maxtor:maxtor,-maxtor:maxtor,-maxtor:maxtor,2)
1734 !---------------------------------
1738 do j=-ntortyp+1,ntortyp-1
1739 do k=-ntortyp+1,ntortyp-1
1740 read (itordp,'(3a1)') t1,t2,t3
1741 ! write (iout,*) "OK onelett",
1744 if (t1.ne.toronelet(i) .or. t2.ne.toronelet(j) &
1745 .or. t3.ne.toronelet(k)) then
1746 write (iout,*) "Error in double torsional parameter file",&
1749 call MPI_Finalize(Ierror)
1751 stop "Error in double torsional parameter file"
1753 read (itordp,*) ntermd_1(i,j,k,iblock),&
1754 ntermd_2(i,j,k,iblock)
1755 ntermd_1(-i,-j,-k,iblock)=ntermd_1(i,j,k,iblock)
1756 ntermd_2(-i,-j,-k,iblock)=ntermd_2(i,j,k,iblock)
1757 read (itordp,*) (v1c(1,l,i,j,k,iblock),l=1,&
1758 ntermd_1(i,j,k,iblock))
1759 read (itordp,*) (v1s(1,l,i,j,k,iblock),l=1,&
1760 ntermd_1(i,j,k,iblock))
1761 read (itordp,*) (v1c(2,l,i,j,k,iblock),l=1,&
1762 ntermd_1(i,j,k,iblock))
1763 read (itordp,*) (v1s(2,l,i,j,k,iblock),l=1,&
1764 ntermd_1(i,j,k,iblock))
1765 ! Martix of D parameters for one dimesional foureir series
1766 do l=1,ntermd_1(i,j,k,iblock)
1767 v1c(1,l,-i,-j,-k,iblock)=v1c(1,l,i,j,k,iblock)
1768 v1s(1,l,-i,-j,-k,iblock)=-v1s(1,l,i,j,k,iblock)
1769 v1c(2,l,-i,-j,-k,iblock)=v1c(2,l,i,j,k,iblock)
1770 v1s(2,l,-i,-j,-k,iblock)=-v1s(2,l,i,j,k,iblock)
1771 ! write(iout,*) "whcodze" ,
1772 ! & v1s(2,l,-i,-j,-k,iblock),v1s(2,l,i,j,k,iblock)
1774 read (itordp,*) ((v2c(l,m,i,j,k,iblock),&
1775 v2c(m,l,i,j,k,iblock),v2s(l,m,i,j,k,iblock),&
1776 v2s(m,l,i,j,k,iblock),&
1777 m=1,l-1),l=1,ntermd_2(i,j,k,iblock))
1778 ! Martix of D parameters for two dimesional fourier series
1779 do l=1,ntermd_2(i,j,k,iblock)
1781 v2c(l,m,-i,-j,-k,iblock)=v2c(l,m,i,j,k,iblock)
1782 v2c(m,l,-i,-j,-k,iblock)=v2c(m,l,i,j,k,iblock)
1783 v2s(l,m,-i,-j,-k,iblock)=-v2s(l,m,i,j,k,iblock)
1784 v2s(m,l,-i,-j,-k,iblock)=-v2s(m,l,i,j,k,iblock)
1793 write (iout,*) 'Constants for double torsionals'
1796 do j=-ntortyp+1,ntortyp-1
1797 do k=-ntortyp+1,ntortyp-1
1798 write (iout,*) 'ityp',i,' jtyp',j,' ktyp',k,&
1799 ' nsingle',ntermd_1(i,j,k,iblock),&
1800 ' ndouble',ntermd_2(i,j,k,iblock)
1802 write (iout,*) 'Single angles:'
1803 do l=1,ntermd_1(i,j,k,iblock)
1804 write (iout,'(i5,2f10.5,5x,2f10.5,5x,2f10.5)') l,&
1805 v1c(1,l,i,j,k,iblock),v1s(1,l,i,j,k,iblock),&
1806 v1c(2,l,i,j,k,iblock),v1s(2,l,i,j,k,iblock),&
1807 v1s(1,l,-i,-j,-k,iblock),v1s(2,l,-i,-j,-k,iblock)
1810 write (iout,*) 'Pairs of angles:'
1811 write (iout,'(3x,20i10)') (l,l=1,ntermd_2(i,j,k,iblock))
1812 do l=1,ntermd_2(i,j,k,iblock)
1813 write (iout,'(i5,20f10.5)') &
1814 l,(v2c(l,m,i,j,k,iblock),m=1,ntermd_2(i,j,k,iblock))
1817 write (iout,'(3x,20i10)') (l,l=1,ntermd_2(i,j,k,iblock))
1818 do l=1,ntermd_2(i,j,k,iblock)
1819 write (iout,'(i5,20f10.5)') &
1820 l,(v2s(l,m,i,j,k,iblock),m=1,ntermd_2(i,j,k,iblock)),&
1821 (v2s(l,m,-i,-j,-k,iblock),m=1,ntermd_2(i,j,k,iblock))
1831 itype2loc(i)=itortyp(i)
1834 ELSE IF (TOR_MODE.eq.1) THEN
1836 !C read valence-torsional parameters
1837 read (itorp,*) ntortyp
1839 write (iout,*) "Valence-torsional parameters read in ntortyp",&
1841 read (itorp,*) (itortyp(i),i=1,ntyp)
1842 write (iout,*) "itortyp_kcc",(itortyp(i),i=1,ntyp)
1845 itype2loc(i)=itortyp(i)
1849 itortyp(i)=-itortyp(-i)
1851 do i=-ntortyp+1,ntortyp-1
1852 do j=-ntortyp+1,ntortyp-1
1853 !C first we read the cos and sin gamma parameters
1854 read (itorp,'(13x,a)') string
1855 write (iout,*) i,j,string
1857 nterm_kcc(j,i),nterm_kcc_Tb(j,i)
1858 !C read (itorkcc,*,end=121,err=121) nterm_kcc_Tb(j,i)
1859 do k=1,nterm_kcc(j,i)
1860 do l=1,nterm_kcc_Tb(j,i)
1861 do ll=1,nterm_kcc_Tb(j,i)
1862 read (itorp,*) ii,jj,kk, &
1863 v1_kcc(ll,l,k,j,i),v2_kcc(ll,l,k,j,i)
1871 !c AL 4/8/16: Calculate coefficients from one-body parameters
1873 allocate(itortyp(-ntyp1:ntyp1)) !(-ntyp1:ntyp1)
1874 allocate(nterm_kcc(-ntyp1:ntyp1,-ntyp1:ntyp1))
1875 allocate(nterm_kcc_Tb(-ntyp1:ntyp1,-ntyp1:ntyp1))
1876 allocate(v1_kcc(6,6,6,-ntyp1:ntyp1,-ntyp1:ntyp1))
1877 allocate(v2_kcc(6,6,6,-ntyp1:ntyp1,-ntyp1:ntyp1))
1880 print *,i,itortyp(i)
1881 itortyp(i)=itype2loc(i)
1884 "Val-tor parameters calculated from cumulant coefficients ntortyp"&
1886 do i=-ntortyp+1,ntortyp-1
1887 do j=-ntortyp+1,ntortyp-1
1890 do k=1,nterm_kcc_Tb(j,i)
1891 do l=1,nterm_kcc_Tb(j,i)
1892 v1_kcc(k,l,1,i,j)=bnew1tor(k,1,i)*bnew2tor(l,1,j)&
1893 +bnew1tor(k,2,i)*bnew2tor(l,2,j)
1894 v2_kcc(k,l,1,i,j)=bnew1tor(k,1,i)*bnew2tor(l,2,j)&
1895 +bnew1tor(k,2,i)*bnew2tor(l,1,j)
1898 do k=1,nterm_kcc_Tb(j,i)
1899 do l=1,nterm_kcc_Tb(j,i)
1901 v1_kcc(k,l,2,i,j)=-(ccnewtor(k,1,i)*ddnewtor(l,1,j) &
1902 -ccnewtor(k,2,i)*ddnewtor(l,2,j))
1903 v2_kcc(k,l,2,i,j)=-(ccnewtor(k,2,i)*ddnewtor(l,1,j) &
1904 +ccnewtor(k,1,i)*ddnewtor(l,2,j))
1906 v1_kcc(k,l,2,i,j)=-0.25*(ccnewtor(k,1,i)*ddnewtor(l,1,j) &
1907 -ccnewtor(k,2,i)*ddnewtor(l,2,j))
1908 v2_kcc(k,l,2,i,j)=-0.25*(ccnewtor(k,2,i)*ddnewtor(l,1,j) &
1909 +ccnewtor(k,1,i)*ddnewtor(l,2,j))
1913 !c f(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)
1917 write (iout,*) "TOR_MODE>1 only with NEWCORR"
1921 if (tor_mode.gt.0 .and. lprint) then
1922 !c Print valence-torsional parameters
1923 write (iout,'(a)') &
1924 "Parameters of the valence-torsional potentials"
1925 do i=-ntortyp+1,ntortyp-1
1926 do j=-ntortyp+1,ntortyp-1
1927 write (iout,'(3a)') "Type ",toronelet(i),toronelet(j)
1928 write (iout,'(3a5,2a15)') "itor","ival","jval","v_kcc","v2_kcc"
1929 do k=1,nterm_kcc(j,i)
1930 do l=1,nterm_kcc_Tb(j,i)
1931 do ll=1,nterm_kcc_Tb(j,i)
1932 write (iout,'(3i5,2f15.4)')&
1933 k,l-1,ll-1,v1_kcc(ll,l,k,j,i),v2_kcc(ll,l,k,j,i)
1942 !elwrite(iout,*) "parmread kontrol sc-bb"
1943 ! Read of Side-chain backbone correlation parameters
1944 ! Modified 11 May 2012 by Adasko
1947 read (isccor,*) nsccortyp
1950 !c maxinter is maximum interaction sites
1951 !write(iout,*)"maxterm_sccor",maxterm_sccor
1952 !el from module energy-------------
1953 allocate(nlor_sccor(nsccortyp,nsccortyp)) !(-ntyp:ntyp,-ntyp:ntyp)
1954 allocate(vlor1sccor(maxterm_sccor,nsccortyp,nsccortyp))
1955 allocate(vlor2sccor(maxterm_sccor,nsccortyp,nsccortyp))
1956 allocate(vlor3sccor(maxterm_sccor,nsccortyp,nsccortyp)) !(maxterm_sccor,20,20)
1957 !-----------------------------------
1958 allocate(isccortyp(-ntyp:ntyp)) !(-ntyp:ntyp)
1959 !-----------------------------------
1960 allocate(nterm_sccor(-nsccortyp:nsccortyp,-nsccortyp:nsccortyp)) !(-ntyp:ntyp,-ntyp:ntyp)
1961 allocate(v1sccor(maxterm_sccor,maxinter,-nsccortyp:nsccortyp,&
1962 -nsccortyp:nsccortyp))
1963 allocate(v2sccor(maxterm_sccor,maxinter,-nsccortyp:nsccortyp,&
1964 -nsccortyp:nsccortyp)) !(maxterm_sccor,3,-ntyp:ntyp,-ntyp:ntyp)
1965 allocate(v0sccor(maxinter,-nsccortyp:nsccortyp,&
1966 -nsccortyp:nsccortyp)) !(maxterm_sccor,-ntyp:ntyp,-ntyp:ntyp)
1967 !-----------------------------------
1968 do i=-nsccortyp,nsccortyp
1969 do j=-nsccortyp,nsccortyp
1973 !-----------------------------------
1975 read (isccor,*) (isccortyp(i),i=1,ntyp)
1977 isccortyp(i)=-isccortyp(-i)
1979 iscprol=isccortyp(20)
1980 ! write (iout,*) 'ntortyp',ntortyp
1982 !c maxinter is maximum interaction sites
1987 nterm_sccor(i,j),nlor_sccor(i,j)
1993 nterm_sccor(-i,j)=nterm_sccor(i,j)
1994 nterm_sccor(-i,-j)=nterm_sccor(i,j)
1995 nterm_sccor(i,-j)=nterm_sccor(i,j)
1996 do k=1,nterm_sccor(i,j)
1997 read (isccor,*) kk,v1sccor(k,l,i,j),&
1999 if (j.eq.iscprol) then
2000 if (i.eq.isccortyp(10)) then
2001 v1sccor(k,l,i,-j)=v1sccor(k,l,i,j)
2002 v2sccor(k,l,i,-j)=-v2sccor(k,l,i,j)
2004 v1sccor(k,l,i,-j)=v1sccor(k,l,i,j)*0.5d0 &
2005 +v2sccor(k,l,i,j)*dsqrt(0.75d0)
2006 v2sccor(k,l,i,-j)=-v2sccor(k,l,i,j)*0.5d0 &
2007 +v1sccor(k,l,i,j)*dsqrt(0.75d0)
2008 v1sccor(k,l,-i,-j)=v1sccor(k,l,i,j)
2009 v2sccor(k,l,-i,-j)=-v2sccor(k,l,i,j)
2010 v1sccor(k,l,-i,j)=v1sccor(k,l,i,-j)
2011 v2sccor(k,l,-i,j)=-v2sccor(k,l,i,-j)
2014 if (i.eq.isccortyp(10)) then
2015 v1sccor(k,l,i,-j)=v1sccor(k,l,i,j)
2016 v2sccor(k,l,i,-j)=-v2sccor(k,l,i,j)
2018 if (j.eq.isccortyp(10)) then
2019 v1sccor(k,l,-i,j)=v1sccor(k,l,i,j)
2020 v2sccor(k,l,-i,j)=-v2sccor(k,l,i,j)
2022 v1sccor(k,l,i,-j)=-v1sccor(k,l,i,j)
2023 v2sccor(k,l,i,-j)=-v2sccor(k,l,i,j)
2024 v1sccor(k,l,-i,-j)=v1sccor(k,l,i,j)
2025 v2sccor(k,l,-i,-j)=-v2sccor(k,l,i,j)
2026 v1sccor(k,l,-i,j)=v1sccor(k,l,i,-j)
2027 v2sccor(k,l,-i,j)=-v2sccor(k,l,i,-j)
2031 v0ijsccor=v0ijsccor+si*v1sccor(k,l,i,j)
2032 v0ijsccor1=v0ijsccor+si*v1sccor(k,l,-i,j)
2033 v0ijsccor2=v0ijsccor+si*v1sccor(k,l,i,-j)
2034 v0ijsccor3=v0ijsccor+si*v1sccor(k,l,-i,-j)
2037 do k=1,nlor_sccor(i,j)
2038 read (isccor,*) kk,vlor1sccor(k,i,j),&
2039 vlor2sccor(k,i,j),vlor3sccor(k,i,j)
2040 v0ijsccor=v0ijsccor+vlor1sccor(k,i,j)/ &
2041 (1+vlor3sccor(k,i,j)**2)
2043 v0sccor(l,i,j)=v0ijsccor
2044 v0sccor(l,-i,j)=v0ijsccor1
2045 v0sccor(l,i,-j)=v0ijsccor2
2046 v0sccor(l,-i,-j)=v0ijsccor3
2052 write (iout,'(/a/)') 'Torsional constants of SCCORR:'
2055 write (iout,*) 'ityp',i,' jtyp',j
2056 write (iout,*) 'Fourier constants'
2057 do k=1,nterm_sccor(i,j)
2058 write (iout,'(2(1pe15.5))') &
2059 (v1sccor(k,l,i,j),v2sccor(k,l,i,j),l=1,maxinter)
2061 write (iout,*) 'Lorenz constants'
2062 do k=1,nlor_sccor(i,j)
2063 write (iout,'(3(1pe15.5))') &
2064 vlor1sccor(k,i,j),vlor2sccor(k,i,j),vlor3sccor(k,i,j)
2071 ! Read electrostatic-interaction parameters
2074 write (iout,'(/a)') 'Electrostatic interaction constants:'
2075 write (iout,'(1x,a,1x,a,10x,a,11x,a,11x,a,11x,a)') &
2076 'IT','JT','APP','BPP','AEL6','AEL3'
2078 read (ielep,*) ((epp(i,j),j=1,2),i=1,2)
2079 read (ielep,*) ((rpp(i,j),j=1,2),i=1,2)
2080 read (ielep,*) ((elpp6(i,j),j=1,2),i=1,2)
2081 read (ielep,*) ((elpp3(i,j),j=1,2),i=1,2)
2086 app (i,j)=epp(i,j)*rri*rri
2087 bpp (i,j)=-2.0D0*epp(i,j)*rri
2088 ael6(i,j)=elpp6(i,j)*4.2D0**6
2089 ael3(i,j)=elpp3(i,j)*4.2D0**3
2090 if (lprint) write(iout,'(2i3,4(1pe15.4))')i,j,app(i,j),bpp(i,j),&
2095 ! Read side-chain interaction parameters.
2097 !el from module energy - COMMON.INTERACT-------
2098 allocate(eps(ntyp,ntyp),sigmaii(ntyp,ntyp),rs0(ntyp,ntyp)) !(ntyp,ntyp)
2099 allocate(augm(ntyp,ntyp)) !(ntyp,ntyp)
2100 allocate(eps_scp(ntyp,2),rscp(ntyp,2)) !(ntyp,2)
2101 allocate(sigma0(ntyp),rr0(ntyp),sigii(ntyp)) !(ntyp)
2102 allocate(chip(ntyp1),alp(ntyp1)) !(ntyp)
2103 allocate(epslip(ntyp,ntyp))
2114 !--------------------------------
2116 read (isidep,*) ipot,expon
2117 !el if (ipot.lt.1 .or. ipot.gt.5) then
2118 ! write (iout,'(2a)') 'Error while reading SC interaction',&
2119 ! 'potential file - unknown potential type.'
2123 write(iout,'(/3a,2i3)') 'Potential is ',potname(ipot),&
2124 ', exponents are ',expon,2*expon
2125 ! goto (10,20,30,30,40) ipot
2127 !----------------------- LJ potential ---------------------------------
2129 ! 10 read (isidep,*)((eps(i,j),j=i,ntyp),i=1,ntyp),(sigma0(i),i=1,ntyp)
2130 read (isidep,*)((eps(i,j),j=i,ntyp),i=1,ntyp),(sigma0(i),i=1,ntyp)
2132 write (iout,'(/a/)') 'Parameters of the LJ potential:'
2133 write (iout,'(a/)') 'The epsilon array:'
2134 call printmat(ntyp,ntyp,ntyp,iout,restyp,eps)
2135 write (iout,'(/a)') 'One-body parameters:'
2136 write (iout,'(a,4x,a)') 'residue','sigma'
2137 write (iout,'(a3,6x,f10.5)') (restyp(i,molnum(i)),sigma0(i),i=1,ntyp)
2140 !----------------------- LJK potential --------------------------------
2142 ! 20 read (isidep,*)((eps(i,j),j=i,ntyp),i=1,ntyp),&
2143 read (isidep,*)((eps(i,j),j=i,ntyp),i=1,ntyp),&
2144 (sigma0(i),i=1,ntyp),(rr0(i),i=1,ntyp)
2146 write (iout,'(/a/)') 'Parameters of the LJK potential:'
2147 write (iout,'(a/)') 'The epsilon array:'
2148 call printmat(ntyp,ntyp,ntyp,iout,restyp,eps)
2149 write (iout,'(/a)') 'One-body parameters:'
2150 write (iout,'(a,4x,2a)') 'residue',' sigma ',' r0 '
2151 write (iout,'(a3,6x,2f10.5)') (restyp(i,molnum(i)),sigma0(i),rr0(i),&
2155 !---------------------- GB or BP potential -----------------------------
2158 if (scelemode.eq.0) then
2160 read (isidep,*)(eps(i,j),j=i,ntyp)
2162 read (isidep,*)(sigma0(i),i=1,ntyp)
2163 read (isidep,*)(sigii(i),i=1,ntyp)
2164 read (isidep,*)(chip(i),i=1,ntyp)
2165 read (isidep,*)(alp(i),i=1,ntyp)
2167 read (isidep,*)(epslip(i,j),j=i,ntyp)
2169 ! For the GB potential convert sigma'**2 into chi'
2172 chip(i)=(chip(i)-1.0D0)/(chip(i)+1.0D0)
2176 write (iout,'(/a/)') 'Parameters of the BP potential:'
2177 write (iout,'(a/)') 'The epsilon array:'
2178 call printmat(ntyp,ntyp,ntyp,iout,restyp,eps)
2179 write (iout,'(/a)') 'One-body parameters:'
2180 write (iout,'(a,4x,4a)') 'residue',' sigma ','s||/s_|_^2',&
2182 write (iout,'(a3,6x,4f10.5)') (restyp(i,molnum(i)),sigma0(i),sigii(i),&
2183 chip(i),alp(i),i=1,ntyp)
2186 allocate(icharge(ntyp1))
2187 ! print *,ntyp,icharge(i)
2189 read (isidep,*) (icharge(i),i=1,ntyp)
2190 print *,ntyp,icharge(i)
2191 ! if(.not.allocated(eps)) allocate(eps(-ntyp
2192 write (2,*) "icharge",(icharge(i),i=1,ntyp)
2193 allocate(alphapol(ntyp,ntyp),epshead(ntyp,ntyp),sig0head(ntyp,ntyp))
2194 allocate(sigiso1(ntyp,ntyp),rborn(ntyp,ntyp),sigmap1(ntyp,ntyp))
2195 allocate(sigmap2(ntyp,ntyp),sigiso2(ntyp,ntyp))
2196 allocate(chis(ntyp,ntyp),wquad(ntyp,ntyp),chipp(ntyp,ntyp))
2197 allocate(epsintab(ntyp,ntyp))
2198 allocate(dtail(2,ntyp,ntyp))
2199 print *,"control line 1"
2200 allocate(alphasur(4,ntyp,ntyp),alphiso(4,ntyp,ntyp))
2201 allocate(wqdip(2,ntyp,ntyp))
2202 allocate(wstate(4,ntyp,ntyp))
2203 allocate(dhead(2,2,ntyp,ntyp))
2204 allocate(nstate(ntyp,ntyp))
2205 allocate(debaykap(ntyp,ntyp))
2206 print *,"control line 2"
2207 if (.not.allocated(sigma)) allocate(sigma(0:ntyp1,0:ntyp1))
2208 if (.not.allocated(chi)) allocate(chi(ntyp1,ntyp1)) !(ntyp,ntyp)
2212 ! write (*,*) "Im in ALAB", i, " ", j
2214 eps(i,j),sigma(i,j),chi(i,j),chi(j,i),chipp(i,j),chipp(j,i), &
2215 (alphasur(k,i,j),k=1,4),sigmap1(i,j),sigmap2(i,j), &
2216 chis(i,j),chis(j,i), &
2217 nstate(i,j),(wstate(k,i,j),k=1,4), &
2218 dhead(1,1,i,j),dhead(1,2,i,j),dhead(2,1,i,j),dhead(2,2,i,j),&
2219 dtail(1,i,j),dtail(2,i,j), &
2220 epshead(i,j),sig0head(i,j), &
2221 rborn(i,j),rborn(j,i),(wqdip(k,i,j),k=1,2),wquad(i,j), &
2222 alphapol(i,j),alphapol(j,i), &
2223 (alphiso(k,i,j),k=1,4),sigiso1(i,j),sigiso2(i,j),epsintab(i,j),debaykap(i,j)
2224 ! print *,eps(i,j),sigma(i,j),"SIGMAP",i,j,sigmap1(i,j),sigmap2(j,i)
2230 sigma(i,j) = sigma(j,i)
2231 sigmap1(i,j)=sigmap1(j,i)
2232 sigmap2(i,j)=sigmap2(j,i)
2233 sigiso1(i,j)=sigiso1(j,i)
2234 sigiso2(i,j)=sigiso2(j,i)
2235 ! print *,"ATU",sigma(j,i),sigma(i,j),i,j
2236 nstate(i,j) = nstate(j,i)
2237 dtail(1,i,j) = dtail(1,j,i)
2238 dtail(2,i,j) = dtail(2,j,i)
2240 alphasur(k,i,j) = alphasur(k,j,i)
2241 wstate(k,i,j) = wstate(k,j,i)
2242 alphiso(k,i,j) = alphiso(k,j,i)
2245 dhead(2,1,i,j) = dhead(1,1,j,i)
2246 dhead(2,2,i,j) = dhead(1,2,j,i)
2247 dhead(1,1,i,j) = dhead(2,1,j,i)
2248 dhead(1,2,i,j) = dhead(2,2,j,i)
2250 epshead(i,j) = epshead(j,i)
2251 sig0head(i,j) = sig0head(j,i)
2254 wqdip(k,i,j) = wqdip(k,j,i)
2257 wquad(i,j) = wquad(j,i)
2258 epsintab(i,j) = epsintab(j,i)
2259 debaykap(i,j)=debaykap(j,i)
2260 ! if (epsintab(i,j).ne.1.0) print *,"WHAT?",i,j,epsintab(i,j)
2266 !--------------------- GBV potential -----------------------------------
2268 ! 40 read (isidep,*)((eps(i,j),j=i,ntyp),i=1,ntyp),&
2269 read (isidep,*)((eps(i,j),j=i,ntyp),i=1,ntyp),&
2270 (sigma0(i),i=1,ntyp),(rr0(i),i=1,ntyp),(sigii(i),i=1,ntyp),&
2271 (chip(i),i=1,ntyp),(alp(i),i=1,ntyp)
2273 write (iout,'(/a/)') 'Parameters of the GBV potential:'
2274 write (iout,'(a/)') 'The epsilon array:'
2275 call printmat(ntyp,ntyp,ntyp,iout,restyp,eps)
2276 write (iout,'(/a)') 'One-body parameters:'
2277 write (iout,'(a,4x,5a)') 'residue',' sigma ',' r0 ',&
2278 's||/s_|_^2',' chip ',' alph '
2279 write (iout,'(a3,6x,5f10.5)') (restyp(i,molnum(i)),sigma0(i),rr0(i),&
2280 sigii(i),chip(i),alp(i),i=1,ntyp)
2283 write (iout,'(2a)') 'Error while reading SC interaction',&
2284 'potential file - unknown potential type.'
2290 !-----------------------------------------------------------------------
2291 ! Calculate the "working" parameters of SC interactions.
2293 !el from module energy - COMMON.INTERACT-------
2294 ! allocate(aa(ntyp1,ntyp1),bb(ntyp1,ntyp1),chi(ntyp1,ntyp1)) !(ntyp,ntyp)
2295 if (.not.allocated(chi)) allocate(chi(ntyp1,ntyp1))
2296 allocate(aa_aq(ntyp1,ntyp1),bb_aq(ntyp1,ntyp1)) !(ntyp,ntyp)
2297 allocate(aa_lip(ntyp1,ntyp1),bb_lip(ntyp1,ntyp1)) !(ntyp,ntyp)
2298 if (.not.allocated(sigma)) allocate(sigma(0:ntyp1,0:ntyp1))
2299 allocate(r0(ntyp1,ntyp1)) !(0:ntyp1,0:ntyp1)
2300 allocate(acavtub(ntyp1),bcavtub(ntyp1),ccavtub(ntyp1),&
2302 allocate(sc_aa_tube_par(ntyp1),sc_bb_tube_par(ntyp1),&
2310 if (scelemode.eq.0) then
2317 !--------------------------------
2322 epslip(i,j)=epslip(j,i)
2325 if (scelemode.eq.0) then
2328 sigma(i,j)=dsqrt(sigma0(i)**2+sigma0(j)**2)
2329 sigma(j,i)=sigma(i,j)
2330 rs0(i,j)=dwa16*sigma(i,j)
2335 if (lprint) write (iout,'(/a/10x,7a/72(1h-))') &
2336 'Working parameters of the SC interactions:',&
2337 ' a ',' b ',' augm ',' sigma ',' r0 ',&
2342 if (ipot.eq.1 .or. ipot.eq.3 .or. ipot.eq.4) then
2352 sigeps=dsign(1.0D0,epsij)
2354 aa_aq(i,j)=epsij*rrij*rrij
2355 bb_aq(i,j)=-sigeps*epsij*rrij
2356 aa_aq(j,i)=aa_aq(i,j)
2357 bb_aq(j,i)=bb_aq(i,j)
2358 epsijlip=epslip(i,j)
2359 sigeps=dsign(1.0D0,epsijlip)
2360 epsijlip=dabs(epsijlip)
2361 aa_lip(i,j)=epsijlip*rrij*rrij
2362 bb_lip(i,j)=-sigeps*epsijlip*rrij
2363 aa_lip(j,i)=aa_lip(i,j)
2364 bb_lip(j,i)=bb_lip(i,j)
2365 if ((ipot.gt.2).and. (scelemode.eq.0))then
2366 sigt1sq=sigma0(i)**2
2367 sigt2sq=sigma0(j)**2
2370 ratsig1=sigt2sq/sigt1sq
2371 ratsig2=1.0D0/ratsig1
2372 chi(i,j)=(sigii1-1.0D0)/(sigii1+ratsig1)
2373 if (j.gt.i) chi(j,i)=(sigii2-1.0D0)/(sigii2+ratsig2)
2374 rsum_max=dsqrt(sigii1*sigt1sq+sigii2*sigt2sq)
2378 ! if (ipot.eq.1 .or. ipot.eq.3 .or. ipot.eq.4) then
2379 sigmaii(i,j)=rsum_max
2380 sigmaii(j,i)=rsum_max
2382 ! sigmaii(i,j)=r0(i,j)
2383 ! sigmaii(j,i)=r0(i,j)
2385 !d write (iout,*) i,j,r0(i,j),sigma(i,j),rsum_max
2386 if ((ipot.eq.2 .or. ipot.eq.5) .and. r0(i,j).gt.rsum_max) then
2387 r_augm=sigma(i,j)*(rrij-sigma(i,j))/rrij
2388 augm(i,j)=epsij*r_augm**(2*expon)
2389 ! augm(i,j)=0.5D0**(2*expon)*aa(i,j)
2396 write (iout,'(2(a3,2x),3(1pe10.3),5(0pf8.3))') &
2397 restyp(i,molnum(i)),restyp(j,molnum(i)),aa_aq(i,j),bb_aq(i,j),augm(i,j),&
2398 sigma(i,j),r0(i,j),chi(i,j),chi(j,i)
2402 allocate(eps_nucl(ntyp_molec(2),ntyp_molec(2)))
2403 allocate(sigma_nucl(ntyp_molec(2),ntyp_molec(2))) !(ntyp_molec(2),ntyp_molec(2))
2404 allocate(elpp6_nucl(ntyp_molec(2),ntyp_molec(2))) !(ntyp_molec(2),ntyp_molec(2))
2405 allocate(elpp3_nucl(ntyp_molec(2),ntyp_molec(2))) !(ntyp,2)
2406 allocate(elpp63_nucl(ntyp_molec(2),ntyp_molec(2))) !(ntyp_molec(2),ntyp_molec(2))
2407 allocate(elpp32_nucl(ntyp_molec(2),ntyp_molec(2))) !(ntyp,2)
2408 allocate(chi_nucl(ntyp_molec(2),ntyp_molec(2)),chip_nucl(ntyp_molec(2),ntyp_molec(2))) !(ntyp_molec(2),ntyp_molec(2))
2409 allocate(ael3_nucl(ntyp_molec(2),ntyp_molec(2))) !(ntyp,2)
2410 allocate(ael6_nucl(ntyp_molec(2),ntyp_molec(2))) !(ntyp,2)
2411 allocate(ael32_nucl(ntyp_molec(2),ntyp_molec(2))) !(ntyp,2)
2412 allocate(ael63_nucl(ntyp_molec(2),ntyp_molec(2))) !(ntyp,2)
2413 allocate(aa_nucl(ntyp_molec(2),ntyp_molec(2))) !(ntyp,2)
2414 allocate(bb_nucl(ntyp_molec(2),ntyp_molec(2))) !(ntyp,2)
2415 allocate(r0_nucl(ntyp_molec(2),ntyp_molec(2))) !(ntyp,2)
2416 allocate(sigmaii_nucl(ntyp_molec(2),ntyp_molec(2))) !(ntyp_molec(2),ntyp_molec(2))
2417 allocate(eps_scp_nucl(ntyp_molec(2)),rscp_nucl(ntyp_molec(2))) !(ntyp,2)
2426 read (isidep_nucl,*) ipot_nucl
2427 ! print *,"TU?!",ipot_nucl
2428 if (ipot_nucl.eq.1) then
2429 do i=1,ntyp_molec(2)
2430 do j=i,ntyp_molec(2)
2431 read (isidep_nucl,*) eps_nucl(i,j),sigma_nucl(i,j),elpp6_nucl(i,j),&
2432 elpp3_nucl(i,j), elpp63_nucl(i,j),elpp32_nucl(i,j)
2436 do i=1,ntyp_molec(2)
2437 do j=i,ntyp_molec(2)
2438 read (isidep_nucl,*) eps_nucl(i,j),sigma_nucl(i,j),chi_nucl(i,j),&
2439 chi_nucl(j,i),chip_nucl(i,j),chip_nucl(j,i),&
2440 elpp6_nucl(i,j),elpp3_nucl(i,j),elpp63_nucl(i,j),elpp32_nucl(i,j)
2444 ! rpp(1,1)=2**(1.0/6.0)*5.16158
2445 do i=1,ntyp_molec(2)
2446 do j=i,ntyp_molec(2)
2447 rrij=sigma_nucl(i,j)
2451 epsij=4*eps_nucl(i,j)
2452 sigeps=dsign(1.0D0,epsij)
2454 aa_nucl(i,j)=epsij*rrij*rrij
2455 bb_nucl(i,j)=-sigeps*epsij*rrij
2456 ael3_nucl(i,j)=elpp3_nucl(i,j)*dsqrt(rrij)
2457 ael6_nucl(i,j)=elpp6_nucl(i,j)*rrij
2458 ael63_nucl(i,j)=elpp63_nucl(i,j)*rrij
2459 ael32_nucl(i,j)=elpp32_nucl(i,j)*rrij
2460 sigmaii_nucl(i,j)=sigma_nucl(i,j)/sqrt(1-(chi_nucl(i,j)+chi_nucl(j,i)- &
2461 2*chi_nucl(i,j)*chi_nucl(j,i))/(1-chi_nucl(i,j)*chi_nucl(j,i)))
2464 aa_nucl(i,j)=aa_nucl(j,i)
2465 bb_nucl(i,j)=bb_nucl(j,i)
2466 ael3_nucl(i,j)=ael3_nucl(j,i)
2467 ael6_nucl(i,j)=ael6_nucl(j,i)
2468 ael63_nucl(i,j)=ael63_nucl(j,i)
2469 ael32_nucl(i,j)=ael32_nucl(j,i)
2470 elpp3_nucl(i,j)=elpp3_nucl(j,i)
2471 elpp6_nucl(i,j)=elpp6_nucl(j,i)
2472 elpp63_nucl(i,j)=elpp63_nucl(j,i)
2473 elpp32_nucl(i,j)=elpp32_nucl(j,i)
2474 eps_nucl(i,j)=eps_nucl(j,i)
2475 sigma_nucl(i,j)=sigma_nucl(j,i)
2476 sigmaii_nucl(i,j)=sigmaii_nucl(j,i)
2480 write(iout,*) "tube param"
2481 read(itube,*) epspeptube,sigmapeptube,acavtubpep,bcavtubpep, &
2482 ccavtubpep,dcavtubpep,tubetranenepep
2483 sigmapeptube=sigmapeptube**6
2484 sigeps=dsign(1.0D0,epspeptube)
2485 epspeptube=dabs(epspeptube)
2486 pep_aa_tube=4.0d0*epspeptube*sigmapeptube**2
2487 pep_bb_tube=-sigeps*4.0d0*epspeptube*sigmapeptube
2488 write(iout,*) pep_aa_tube,pep_bb_tube,tubetranenepep
2490 read(itube,*) epssctube,sigmasctube,acavtub(i),bcavtub(i), &
2491 ccavtub(i),dcavtub(i),tubetranene(i)
2492 sigmasctube=sigmasctube**6
2493 sigeps=dsign(1.0D0,epssctube)
2494 epssctube=dabs(epssctube)
2495 sc_aa_tube_par(i)=4.0d0*epssctube*sigmasctube**2
2496 sc_bb_tube_par(i)=-sigeps*4.0d0*epssctube*sigmasctube
2497 write(iout,*) sc_aa_tube_par(i), sc_bb_tube_par(i),tubetranene(i)
2499 !-----------------READING SC BASE POTENTIALS-----------------------------
2500 allocate(eps_scbase(ntyp_molec(1),ntyp_molec(2)))
2501 allocate(sigma_scbase(ntyp_molec(1),ntyp_molec(2)))
2502 allocate(chi_scbase(ntyp_molec(1),ntyp_molec(2),2))
2503 allocate(chipp_scbase(ntyp_molec(1),ntyp_molec(2),2))
2504 allocate(alphasur_scbase(4,ntyp_molec(1),ntyp_molec(2)))
2505 allocate(sigmap1_scbase(ntyp_molec(1),ntyp_molec(2)))
2506 allocate(sigmap2_scbase(ntyp_molec(1),ntyp_molec(2)))
2507 allocate(chis_scbase(ntyp_molec(1),ntyp_molec(2),2))
2508 allocate(dhead_scbasei(ntyp_molec(1),ntyp_molec(2)))
2509 allocate(dhead_scbasej(ntyp_molec(1),ntyp_molec(2)))
2510 allocate(rborn_scbasei(ntyp_molec(1),ntyp_molec(2)))
2511 allocate(rborn_scbasej(ntyp_molec(1),ntyp_molec(2)))
2512 allocate(wdipdip_scbase(3,ntyp_molec(1),ntyp_molec(2)))
2513 allocate(wqdip_scbase(2,ntyp_molec(1),ntyp_molec(2)))
2514 allocate(alphapol_scbase(ntyp_molec(1),ntyp_molec(2)))
2515 allocate(epsintab_scbase(ntyp_molec(1),ntyp_molec(2)))
2518 do i=1,ntyp_molec(1)
2519 do j=1,ntyp_molec(2)-1 ! without U then we will take T for U
2520 write (*,*) "Im in ", i, " ", j
2521 read(isidep_scbase,*) &
2522 eps_scbase(i,j),sigma_scbase(i,j),chi_scbase(i,j,1),&
2523 chi_scbase(i,j,2),chipp_scbase(i,j,1),chipp_scbase(i,j,2)
2524 write(*,*) "eps",eps_scbase(i,j)
2525 read(isidep_scbase,*) &
2526 (alphasur_scbase(k,i,j),k=1,4),sigmap1_scbase(i,j),sigmap2_scbase(i,j), &
2527 chis_scbase(i,j,1),chis_scbase(i,j,2)
2528 read(isidep_scbase,*) &
2529 dhead_scbasei(i,j), &
2530 dhead_scbasej(i,j), &
2531 rborn_scbasei(i,j),rborn_scbasej(i,j)
2532 read(isidep_scbase,*) &
2533 (wdipdip_scbase(k,i,j),k=1,3), &
2534 (wqdip_scbase(k,i,j),k=1,2)
2535 read(isidep_scbase,*) &
2536 alphapol_scbase(i,j), &
2537 epsintab_scbase(i,j)
2540 allocate(aa_scbase(ntyp_molec(1),ntyp_molec(2)))
2541 allocate(bb_scbase(ntyp_molec(1),ntyp_molec(2)))
2543 do i=1,ntyp_molec(1)
2544 do j=1,ntyp_molec(2)-1
2545 epsij=eps_scbase(i,j)
2546 rrij=sigma_scbase(i,j)
2551 sigeps=dsign(1.0D0,epsij)
2553 aa_scbase(i,j)=epsij*rrij*rrij
2554 bb_scbase(i,j)=-sigeps*epsij*rrij
2557 !-----------------READING PEP BASE POTENTIALS-------------------
2558 allocate(eps_pepbase(ntyp_molec(2)))
2559 allocate(sigma_pepbase(ntyp_molec(2)))
2560 allocate(chi_pepbase(ntyp_molec(2),2))
2561 allocate(chipp_pepbase(ntyp_molec(2),2))
2562 allocate(alphasur_pepbase(4,ntyp_molec(2)))
2563 allocate(sigmap1_pepbase(ntyp_molec(2)))
2564 allocate(sigmap2_pepbase(ntyp_molec(2)))
2565 allocate(chis_pepbase(ntyp_molec(2),2))
2566 allocate(wdipdip_pepbase(3,ntyp_molec(2)))
2569 do j=1,ntyp_molec(2)-1 ! without U then we will take T for U
2570 write (*,*) "Im in ", i, " ", j
2571 read(isidep_pepbase,*) &
2572 eps_pepbase(j),sigma_pepbase(j),chi_pepbase(j,1),&
2573 chi_pepbase(j,2),chipp_pepbase(j,1),chipp_pepbase(j,2)
2574 write(*,*) "eps",eps_pepbase(j)
2575 read(isidep_pepbase,*) &
2576 (alphasur_pepbase(k,j),k=1,4),sigmap1_pepbase(j),sigmap2_pepbase(j), &
2577 chis_pepbase(j,1),chis_pepbase(j,2)
2578 read(isidep_pepbase,*) &
2579 (wdipdip_pepbase(k,j),k=1,3)
2581 allocate(aa_pepbase(ntyp_molec(2)))
2582 allocate(bb_pepbase(ntyp_molec(2)))
2584 do j=1,ntyp_molec(2)-1
2585 epsij=eps_pepbase(j)
2586 rrij=sigma_pepbase(j)
2591 sigeps=dsign(1.0D0,epsij)
2593 aa_pepbase(j)=epsij*rrij*rrij
2594 bb_pepbase(j)=-sigeps*epsij*rrij
2596 !--------------READING SC PHOSPHATE-------------------------------------
2597 !--------------READING SC PHOSPHATE-------------------------------------
2598 allocate(eps_scpho(ntyp_molec(1)))
2599 allocate(sigma_scpho(ntyp_molec(1)))
2600 allocate(chi_scpho(ntyp_molec(1),2))
2601 allocate(chipp_scpho(ntyp_molec(1),2))
2602 allocate(alphasur_scpho(4,ntyp_molec(1)))
2603 allocate(sigmap1_scpho(ntyp_molec(1)))
2604 allocate(sigmap2_scpho(ntyp_molec(1)))
2605 allocate(chis_scpho(ntyp_molec(1),2))
2606 allocate(wqq_scpho(ntyp_molec(1)))
2607 allocate(wqdip_scpho(2,ntyp_molec(1)))
2608 allocate(alphapol_scpho(ntyp_molec(1)))
2609 allocate(epsintab_scpho(ntyp_molec(1)))
2610 allocate(dhead_scphoi(ntyp_molec(1)))
2611 allocate(rborn_scphoi(ntyp_molec(1)))
2612 allocate(rborn_scphoj(ntyp_molec(1)))
2613 allocate(alphi_scpho(ntyp_molec(1)))
2617 do j=1,ntyp_molec(1) ! without U then we will take T for U
2618 write (*,*) "Im in scpho ", i, " ", j
2619 read(isidep_scpho,*) &
2620 eps_scpho(j),sigma_scpho(j),chi_scpho(j,1),&
2621 chi_scpho(j,2),chipp_scpho(j,1),chipp_scpho(j,2)
2622 write(*,*) "eps",eps_scpho(j)
2623 read(isidep_scpho,*) &
2624 (alphasur_scpho(k,j),k=1,4),sigmap1_scpho(j),sigmap2_scpho(j), &
2625 chis_scpho(j,1),chis_scpho(j,2)
2626 read(isidep_scpho,*) &
2627 (wqdip_scpho(k,j),k=1,2),wqq_scpho(j),dhead_scphoi(j)
2628 read(isidep_scpho,*) &
2629 epsintab_scpho(j),alphapol_scpho(j),rborn_scphoi(j),rborn_scphoj(j), &
2633 allocate(aa_scpho(ntyp_molec(1)))
2634 allocate(bb_scpho(ntyp_molec(1)))
2635 do j=1,ntyp_molec(1)
2642 sigeps=dsign(1.0D0,epsij)
2644 aa_scpho(j)=epsij*rrij*rrij
2645 bb_scpho(j)=-sigeps*epsij*rrij
2649 read(isidep_peppho,*) &
2650 eps_peppho,sigma_peppho
2651 read(isidep_peppho,*) &
2652 (alphasur_peppho(k),k=1,4),sigmap1_peppho,sigmap2_peppho
2653 read(isidep_peppho,*) &
2654 (wqdip_peppho(k),k=1,2)
2662 sigeps=dsign(1.0D0,epsij)
2664 aa_peppho=epsij*rrij*rrij
2665 bb_peppho=-sigeps*epsij*rrij
2668 allocate(aad(ntyp,2),bad(ntyp,2)) !(ntyp,2)
2676 ! Define the SC-p interaction constants
2685 allocate(itortyp_nucl(ntyp1_molec(2))) !(-ntyp1:ntyp1)
2686 read (itorp_nucl,*) ntortyp_nucl
2687 ! print *,"ntortyp_nucl",ntortyp_nucl,ntyp_molec(2)
2688 !el from energy module---------
2689 allocate(nterm_nucl(ntortyp_nucl,ntortyp_nucl)) !(-maxtor:maxtor,-maxtor:maxtor,2)
2690 allocate(nlor_nucl(ntortyp_nucl,ntortyp_nucl)) !(-maxtor:maxtor,-maxtor:maxtor,2)
2692 allocate(vlor1_nucl(maxlor,ntortyp_nucl,ntortyp_nucl)) !(maxlor,-maxtor:maxtor,-maxtor:maxtor)
2693 allocate(vlor2_nucl(maxlor,ntortyp_nucl,ntortyp_nucl))
2694 allocate(vlor3_nucl(maxlor,ntortyp_nucl,ntortyp_nucl)) !(maxlor,maxtor,maxtor)
2695 allocate(v0_nucl(ntortyp_nucl,ntortyp_nucl)) !(-maxtor:maxtor,-maxtor:maxtor,2)
2697 allocate(v1_nucl(maxterm,ntortyp_nucl,ntortyp_nucl))
2698 allocate(v2_nucl(maxterm,ntortyp_nucl,ntortyp_nucl)) !(maxterm,-maxtor:maxtor,-maxtor:maxtor,2)
2699 !el---------------------------
2702 !el--------------------
2703 read (itorp_nucl,*) &
2704 (itortyp_nucl(i),i=1,ntyp_molec(2))
2705 ! print *,itortyp_nucl(:)
2706 !c write (iout,*) 'ntortyp',ntortyp
2709 read (itorp_nucl,*) nterm_nucl(i,j),nlor_nucl(i,j)
2710 ! print *,nterm_nucl(i,j),nlor_nucl(i,j)
2713 do k=1,nterm_nucl(i,j)
2714 read (itorp_nucl,*) kk,v1_nucl(k,i,j),v2_nucl(k,i,j)
2715 v0ij=v0ij+si*v1_nucl(k,i,j)
2718 do k=1,nlor_nucl(i,j)
2719 read (itorp_nucl,*) kk,vlor1_nucl(k,i,j),&
2720 vlor2_nucl(k,i,j),vlor3_nucl(k,i,j)
2721 v0ij=v0ij+vlor1_nucl(k,i,j)/(1+vlor3_nucl(k,i,j)**2)
2728 !elwrite(iout,*) "parmread kontrol before oldscp"
2730 ! Define the SC-p interaction constants
2734 ! "Soft" SC-p repulsion (causes helices to be too flat, but facilitates
2736 ! aad(i,1)=0.3D0*4.0D0**12
2737 ! Following line for constants currently implemented
2738 ! "Hard" SC-p repulsion (gives correct turn spacing in helices)
2739 aad(i,1)=1.5D0*4.0D0**12
2740 ! aad(i,1)=0.17D0*5.6D0**12
2742 ! "Soft" SC-p repulsion
2744 ! Following line for constants currently implemented
2745 ! aad(i,1)=0.3D0*4.0D0**6
2746 ! "Hard" SC-p repulsion
2747 bad(i,1)=3.0D0*4.0D0**6
2748 ! bad(i,1)=-2.0D0*0.17D0*5.6D0**6
2757 ! 8/9/01 Read the SC-p interaction constants from file
2760 read (iscpp,*) (eps_scp(i,j),rscp(i,j),j=1,2)
2763 aad(i,1)=dabs(eps_scp(i,1))*rscp(i,1)**12
2764 aad(i,2)=dabs(eps_scp(i,2))*rscp(i,2)**12
2765 bad(i,1)=-2*eps_scp(i,1)*rscp(i,1)**6
2766 bad(i,2)=-2*eps_scp(i,2)*rscp(i,2)**6
2770 write (iout,*) "Parameters of SC-p interactions:"
2772 write (iout,'(4f8.3,4e12.4)') eps_scp(i,1),rscp(i,1),&
2773 eps_scp(i,2),rscp(i,2),aad(i,1),bad(i,1),aad(i,2),bad(i,2)
2777 allocate(aad_nucl(ntyp_molec(2)),bad_nucl(ntyp_molec(2))) !(ntyp,2)
2779 do i=1,ntyp_molec(2)
2780 read (iscpp_nucl,*) eps_scp_nucl(i),rscp_nucl(i)
2782 do i=1,ntyp_molec(2)
2783 aad_nucl(i)=dabs(eps_scp_nucl(i))*rscp_nucl(i)**12
2784 bad_nucl(i)=-2*eps_scp_nucl(i)*rscp_nucl(i)**6
2786 r0pp=1.12246204830937298142*5.16158
2792 ! Define the constants of the disulfide bridge
2796 ! Old arbitrary potential - commented out.
2801 ! Constants of the disulfide-bond potential determined based on the RHF/6-31G**
2802 ! energy surface of diethyl disulfide.
2803 ! A. Liwo and U. Kozlowska, 11/24/03
2814 write (iout,'(/a)') "Disulfide bridge parameters:"
2815 write (iout,'(a,f10.2)') 'S-S bridge energy: ',ebr
2816 write (iout,'(2(a,f10.2))') 'd0cm:',d0cm,' akcm:',akcm
2817 write (iout,'(2(a,f10.2))') 'akth:',akth,' akct:',akct
2818 write (iout,'(3(a,f10.2))') 'v1ss:',v1ss,' v2ss:',v2ss,&
2822 end subroutine parmread
2824 !-----------------------------------------------------------------------------
2826 !-----------------------------------------------------------------------------
2827 subroutine mygetenv(string,var)
2831 ! This subroutine passes the environmental variables to FORTRAN program.
2832 ! If the flags -DMYGETENV and -DMPI are not for compilation, it calls the
2833 ! standard FORTRAN GETENV subroutine. If both flags are set, the subroutine
2834 ! reads the environmental variables from $HOME/.env
2836 ! Usage: As for the standard FORTRAN GETENV subroutine.
2838 ! Purpose: some versions/installations of MPI do not transfer the environmental
2839 ! variables to slave processors, if these variables are set in the shell script
2840 ! from which mpirun is called.
2849 character*(*) :: string,var
2850 #if defined(MYGETENV) && defined(MPI)
2851 ! include "DIMENSIONS.ZSCOPT"
2853 ! include "COMMON.MPI"
2854 !el character*360 ucase
2856 character(len=360) :: string1(360),karta
2857 character(len=240) :: home
2860 call getenv("HOME",home)
2861 open(99,file=home(:ilen(home))//"/.env",status="OLD",err=112)
2863 read (99,end=111,err=111,'(a)') karta
2867 call split_string(karta,string1,80,n)
2868 if (ucase(string1(1)(:ilen(string1(1)))).eq."SETENV" .and. &
2869 string1(2)(:ilen(string1(2))).eq.string(:ilen(string)) ) then
2871 print *,"Processor",me,": ",var(:ilen(var)),&
2872 " assigned to ",string(:ilen(string))
2877 111 print *,"Environment variable ",string(:ilen(string))," not set."
2880 112 print *,"Error opening environment file!"
2882 call getenv(string,var)
2885 end subroutine mygetenv
2886 !-----------------------------------------------------------------------------
2888 !-----------------------------------------------------------------------------
2889 subroutine read_general_data(*)
2891 use control_data, only:indpdb,symetr,r_cut_ele,rlamb_ele,ions,&
2892 scelemode,TUBEmode,tor_mode
2894 use energy_data, only:distchainmax,tubeR0,tubecenter
2895 use geometry_data, only:boxxsize,boxysize,boxzsize,bordtubetop,&
2896 bordtubebot,tubebufthick,buftubebot,buftubetop
2898 ! include "DIMENSIONS"
2899 ! include "DIMENSIONS.ZSCOPT"
2900 ! include "DIMENSIONS.FREE"
2901 ! include "COMMON.TORSION"
2902 ! include "COMMON.INTERACT"
2903 ! include "COMMON.IOUNITS"
2904 ! include "COMMON.TIME1"
2905 ! include "COMMON.PROT"
2906 ! include "COMMON.PROTFILES"
2907 ! include "COMMON.CHAIN"
2908 ! include "COMMON.NAMES"
2909 ! include "COMMON.FFIELD"
2910 ! include "COMMON.ENEPS"
2911 ! include "COMMON.WEIGHTS"
2912 ! include "COMMON.FREE"
2913 ! include "COMMON.CONTROL"
2914 ! include "COMMON.ENERGIES"
2915 character(len=800) :: controlcard
2916 integer :: i,j,k,ii,n_ene_found
2917 integer :: ind,itype1,itype2,itypf,itypsc,itypp
2920 !el character*16 ucase
2921 character(len=16) :: key
2923 call card_concat(controlcard,.true.)
2924 call readi(controlcard,"N_ENE",n_eneW,max_eneW)
2925 if (n_eneW.gt.max_eneW) then
2926 write (iout,*) "Error: parameter out of range: N_ENE",n_eneW,&
2930 call readi(controlcard,"NPARMSET",nparmset,1)
2931 !elwrite(iout,*)"in read_gen data"
2932 separate_parset = index(controlcard,"SEPARATE_PARSET").gt.0
2933 call readi(controlcard,"IPARMPRINT",iparmprint,1)
2934 write (iout,*) "PARMPRINT",iparmprint
2935 if (nparmset.gt.max_parm) then
2936 write (iout,*) "Error: parameter out of range: NPARMSET",&
2940 !elwrite(iout,*)"in read_gen data"
2941 call readi(controlcard,"MAXIT",maxit,5000)
2942 call reada(controlcard,"FIMIN",fimin,1.0d-3)
2943 call readi(controlcard,"ENSEMBLES",ensembles,0)
2944 hamil_rep=index(controlcard,"HAMIL_REP").gt.0
2945 write (iout,*) "Number of energy parameter sets",nparmset
2946 allocate(isampl(nparmset))
2947 call multreadi(controlcard,"ISAMPL",isampl,nparmset,1)
2948 write (iout,*) "MaxSlice",MaxSlice
2949 call readi(controlcard,"NSLICE",nslice,1)
2950 !elwrite(iout,*)"in read_gen data"
2952 if (nslice.gt.MaxSlice) then
2953 write (iout,*) "Error: parameter out of range: NSLICE",nslice,&
2957 write (iout,*) "Frequency of storing conformations",&
2958 (isampl(i),i=1,nparmset)
2959 write (iout,*) "Maxit",maxit," Fimin",fimin
2960 call readi(controlcard,"NQ",nQ,1)
2961 if (nQ.gt.MaxQ) then
2962 write (iout,*) "Error: parameter out of range: NQ",nq,&
2967 if (index(controlcard,"CLASSIFY").gt.0) indpdb=1
2968 call reada(controlcard,"DELTA",delta,1.0d-2)
2969 call readi(controlcard,"EINICHECK",einicheck,2)
2970 call reada(controlcard,"DELTRMS",deltrms,5.0d-2)
2971 call reada(controlcard,"DELTRGY",deltrgy,5.0d-2)
2972 call readi(controlcard,"RESCALE",rescale_modeW,1)
2973 call reada(controlcard,'BOXX',boxxsize,100.0d0)
2974 call reada(controlcard,'BOXY',boxysize,100.0d0)
2975 call reada(controlcard,'BOXZ',boxzsize,100.0d0)
2976 call readi(controlcard,"SCELEMODE",scelemode,0)
2977 print *,"SCELE",scelemode
2978 call readi(controlcard,'TORMODE',tor_mode,0)
2979 !C if(me.eq.king .or. .not. out1file .and. fg_rank.eq.0) then
2980 write(iout,*) "torsional and valence angle mode",tor_mode
2982 call readi(controlcard,'TUBEMOD',tubemode,0)
2984 if (TUBEmode.gt.0) then
2985 call reada(controlcard,"XTUBE",tubecenter(1),0.0d0)
2986 call reada(controlcard,"YTUBE",tubecenter(2),0.0d0)
2987 call reada(controlcard,"ZTUBE",tubecenter(3),0.0d0)
2988 call reada(controlcard,"RTUBE",tubeR0,0.0d0)
2989 call reada(controlcard,"TUBETOP",bordtubetop,boxzsize)
2990 call reada(controlcard,"TUBEBOT",bordtubebot,0.0d0)
2991 call reada(controlcard,"TUBEBUF",tubebufthick,1.0d0)
2992 buftubebot=bordtubebot+tubebufthick
2993 buftubetop=bordtubetop-tubebufthick
2995 ions=index(controlcard,"IONS").gt.0
2996 call reada(controlcard,"R_CUT_ELE",r_cut_ele,15.0d0)
2997 call reada(controlcard,"LAMBDA_ELE",rlamb_ele,0.3d0)
2998 write(iout,*) "R_CUT_ELE=",r_cut_ele
2999 check_conf=index(controlcard,"NO_CHECK_CONF").eq.0
3000 call reada(controlcard,'DISTCHAINMAX',distchainmax,50.0d0)
3001 call readi(controlcard,'SYM',symetr,1)
3002 write (iout,*) "DISTCHAINMAX",distchainmax
3003 write (iout,*) "delta",delta
3004 write (iout,*) "einicheck",einicheck
3005 write (iout,*) "rescale_mode",rescale_modeW
3007 bxfile=index(controlcard,"BXFILE").gt.0
3008 cxfile=index(controlcard,"CXFILE").gt.0
3009 if (nslice .eq. 1 .and. .not.bxfile .and. .not.cxfile) &
3011 histfile=index(controlcard,"HISTFILE").gt.0
3012 histout=index(controlcard,"HISTOUT").gt.0
3013 entfile=index(controlcard,"ENTFILE").gt.0
3014 zscfile=index(controlcard,"ZSCFILE").gt.0
3015 with_dihed_constr = index(controlcard,"WITH_DIHED_CONSTR").gt.0
3016 write (iout,*) "with_dihed_constr ",with_dihed_constr
3017 call readi(controlcard,'CONSTR_DIST',constr_dist,0)
3019 end subroutine read_general_data
3020 !------------------------------------------------------------------------------
3021 subroutine read_efree(*)
3023 ! Read molecular data
3026 ! include 'DIMENSIONS'
3027 ! include 'DIMENSIONS.ZSCOPT'
3028 ! include 'DIMENSIONS.COMPAR'
3029 ! include 'DIMENSIONS.FREE'
3030 ! include 'COMMON.IOUNITS'
3031 ! include 'COMMON.TIME1'
3032 ! include 'COMMON.SBRIDGE'
3033 ! include 'COMMON.CONTROL'
3034 ! include 'COMMON.CHAIN'
3035 ! include 'COMMON.HEADER'
3036 ! include 'COMMON.GEO'
3037 ! include 'COMMON.FREE'
3038 character(len=320) :: controlcard !,ucase
3039 integer :: iparm,ib,i,j,npars
3049 ! call alloc_wham_arrays
3050 ! allocate(nT_h(nParmSet))
3051 ! allocate(replica(nParmSet))
3052 ! allocate(umbrella(nParmSet))
3053 ! allocate(read_iset(nParmSet))
3054 ! allocate(nT_h(nParmSet))
3058 call card_concat(controlcard,.true.)
3059 call readi(controlcard,'NT',nT_h(iparm),1)
3060 write (iout,*) "iparm",iparm," nt",nT_h(iparm)
3062 if (nT_h(iparm).gt.MaxT_h) then
3063 write (iout,*) "Error: parameter out of range: NT",nT_h(iparm),&
3067 replica(iparm)=index(controlcard,"REPLICA").gt.0
3068 umbrella(iparm)=index(controlcard,"UMBRELLA").gt.0
3069 read_iset(iparm)=index(controlcard,"READ_ISET").gt.0
3070 write (iout,*) "nQ",nQ," nT",nT_h(iparm)," replica ",&
3071 replica(iparm)," umbrella ",umbrella(iparm),&
3072 " read_iset",read_iset(iparm)
3075 call card_concat(controlcard,.true.)
3076 call readi(controlcard,'NR',nR(ib,iparm),1)
3077 if (umbrella(iparm)) then
3080 nRR(ib,iparm)=nR(ib,iparm)
3082 if (nR(ib,iparm).gt.MaxR) then
3083 write (iout,*) "Error: parameter out of range: NR",&
3087 call reada(controlcard,'TEMP',beta_h(ib,iparm),298.0d0)
3088 beta_h(ib,iparm)=1.0d0/(beta_h(ib,iparm)*1.987D-3)
3089 call multreada(controlcard,'FI',f(1,ib,iparm),nR(ib,iparm),&
3092 call card_concat(controlcard,.true.)
3093 call multreada(controlcard,'KH',KH(1,i,ib,iparm),nQ,&
3095 call multreada(controlcard,'Q0',Q0(1,i,ib,iparm),nQ,&
3100 write (iout,*) "ib",ib," beta_h",&
3101 1.0d0/(0.001987*beta_h(ib,iparm))
3102 write (iout,*) "nR",nR(ib,iparm)
3103 write (iout,*) "fi",(f(i,ib,iparm),i=1,nR(ib,iparm))
3105 write (iout,*) "i",i," Kh",(Kh(j,i,ib,iparm),j=1,nQ),&
3106 "q0",(q0(j,i,ib,iparm),j=1,nQ)
3118 nR(ib,iparm)=nR(ib,1)
3119 if (umbrella(iparm)) then
3122 nRR(ib,iparm)=nR(ib,1)
3124 beta_h(ib,iparm)=beta_h(ib,1)
3126 f(i,ib,iparm)=f(i,ib,1)
3128 KH(j,i,ib,iparm)=KH(j,i,ib,1)
3129 Q0(j,i,ib,iparm)=Q0(j,i,ib,1)
3132 replica(iparm)=replica(1)
3133 umbrella(iparm)=umbrella(1)
3134 read_iset(iparm)=read_iset(1)
3141 end subroutine read_efree
3142 !-----------------------------------------------------------------------------
3143 subroutine read_protein_data(*)
3145 ! include "DIMENSIONS"
3146 ! include "DIMENSIONS.ZSCOPT"
3147 ! include "DIMENSIONS.FREE"
3151 integer :: IERROR,ERRCODE!,STATUS(MPI_STATUS_SIZE)
3152 ! include "COMMON.MPI"
3154 ! include "COMMON.CHAIN"
3155 ! include "COMMON.IOUNITS"
3156 ! include "COMMON.PROT"
3157 ! include "COMMON.PROTFILES"
3158 ! include "COMMON.NAMES"
3159 ! include "COMMON.FREE"
3160 ! include "COMMON.OBCINKA"
3161 character(len=64) :: nazwa
3162 character(len=16000) :: controlcard
3163 integer :: i,ii,ib,iR,iparm,nthr,npars !,ilen,iroof
3164 !el external ilen,iroof
3173 ! Read names of files with conformation data.
3174 if (replica(iparm)) then
3180 do ii=1,nRR(ib,iparm)
3181 write (iout,*) "Parameter set",iparm," temperature",ib,&
3184 call card_concat(controlcard,.true.)
3185 write (iout,*) controlcard(:ilen(controlcard))
3186 call readi(controlcard,"NFILE_BIN",nfile_bin(ii,ib,iparm),0)
3187 call readi(controlcard,"NFILE_ASC",nfile_asc(ii,ib,iparm),0)
3188 call readi(controlcard,"NFILE_CX",nfile_cx(ii,ib,iparm),0)
3189 call readi(controlcard,"REC_START",rec_start(ii,ib,iparm),1)
3190 call readi(controlcard,"REC_END",rec_end(ii,ib,iparm),&
3191 maxstr*isampl(iparm)+rec_start(ii,ib,iparm)-1)
3192 call reada(controlcard,"TIME_START",&
3193 time_start_collect(ii,ib,iparm),0.0d0)
3194 call reada(controlcard,"TIME_END",time_end_collect(ii,ib,iparm),&
3196 write (iout,*) "rec_start",rec_start(ii,ib,iparm),&
3197 " rec_end",rec_end(ii,ib,iparm)
3198 write (iout,*) "time_start",time_start_collect(ii,ib,iparm),&
3199 " time_end",time_end_collect(ii,ib,iparm)
3201 if (replica(iparm)) then
3202 call readi(controlcard,"TOTRAJ",totraj(ii,iparm),1)
3203 write (iout,*) "Number of trajectories",totraj(ii,iparm)
3206 if (nfile_bin(ii,ib,iparm).lt.2 &
3207 .and. nfile_asc(ii,ib,iparm).eq.0 &
3208 .and. nfile_cx(ii,ib,iparm).eq.0) then
3209 write (iout,*) "Error - no action specified!"
3212 if (nfile_bin(ii,ib,iparm).gt.0) then
3213 call card_concat(controlcard,.false.)
3214 call split_string(controlcard,protfiles(1,1,ii,ib,iparm),&
3215 maxfile_prot,nfile_bin(ii,ib,iparm))
3217 write(iout,*)"nfile_bin",nfile_bin(ii,ib,iparm)
3218 write(iout,*) (protfiles(i,1,ii,ib,iparm),&
3219 i=1,nfile_bin(ii,ib,iparm))
3222 if (nfile_asc(ii,ib,iparm).gt.0) then
3223 call card_concat(controlcard,.false.)
3224 call split_string(controlcard,protfiles(1,2,ii,ib,iparm),&
3225 maxfile_prot,nfile_asc(ii,ib,iparm))
3227 write(iout,*) "nfile_asc(ii,ib,iparm)",nfile_asc(ii,ib,iparm)
3228 write(iout,*) (protfiles(i,2,ii,ib,iparm),&
3229 i=1,nfile_asc(ii,ib,iparm))
3231 else if (nfile_cx(ii,ib,iparm).gt.0) then
3232 call card_concat(controlcard,.false.)
3233 call split_string(controlcard,protfiles(1,2,ii,ib,iparm),&
3234 maxfile_prot,nfile_cx(ii,ib,iparm))
3236 write(iout,*) "nfile_cx(ii,ib,iparm)",nfile_cx(ii,ib,iparm)
3237 write(iout,*) (protfiles(i,2,ii,ib,iparm),&
3238 i=1,nfile_cx(ii,ib,iparm))
3247 end subroutine read_protein_data
3248 !-------------------------------------------------------------------------------
3249 subroutine readsss(rekord,lancuch,wartosc,default)
3251 character*(*) :: rekord,lancuch,wartosc,default
3252 character(len=80) :: aux
3253 integer :: lenlan,lenrec,iread,ireade
3257 lenlan=ilen(lancuch)
3259 iread=index(rekord,lancuch(:lenlan)//"=")
3260 ! print *,"rekord",rekord," lancuch",lancuch
3261 ! print *,"iread",iread," lenlan",lenlan," lenrec",lenrec
3262 if (iread.eq.0) then
3266 iread=iread+lenlan+1
3267 ! print *,"iread",iread
3268 ! print *,"|",rekord(iread:iread),"|",iblnk(rekord(iread:iread))
3269 do while (iread.le.lenrec .and. iblnk(rekord(iread:iread)))
3271 ! print *,"|",rekord(iread:iread),"|",iblnk(rekord(iread:iread))
3273 ! print *,"iread",iread
3274 if (iread.gt.lenrec) then
3279 ! print *,"ireade",ireade
3280 do while (ireade.lt.lenrec .and. &
3281 .not.iblnk(rekord(ireade:ireade)))
3284 wartosc=rekord(iread:ireade)
3286 end subroutine readsss
3287 !----------------------------------------------------------------------------
3288 subroutine multreads(rekord,lancuch,tablica,dim,default)
3291 character*(*) rekord,lancuch,tablica(dim),default
3292 character(len=80) :: aux
3293 integer :: lenlan,lenrec,iread,ireade
3300 lenlan=ilen(lancuch)
3302 iread=index(rekord,lancuch(:lenlan)//"=")
3303 ! print *,"rekord",rekord," lancuch",lancuch
3304 ! print *,"iread",iread," lenlan",lenlan," lenrec",lenrec
3305 if (iread.eq.0) return
3306 iread=iread+lenlan+1
3308 ! print *,"iread",iread
3309 ! print *,"|",rekord(iread:iread),"|",iblnk(rekord(iread:iread))
3310 do while (iread.le.lenrec .and. iblnk(rekord(iread:iread)))
3312 ! print *,"|",rekord(iread:iread),"|",iblnk(rekord(iread:iread))
3314 ! print *,"iread",iread
3315 if (iread.gt.lenrec) return
3317 ! print *,"ireade",ireade
3318 do while (ireade.lt.lenrec .and. &
3319 .not.iblnk(rekord(ireade:ireade)))
3322 tablica(i)=rekord(iread:ireade)
3325 end subroutine multreads
3326 !----------------------------------------------------------------------------
3327 subroutine split_string(rekord,tablica,dim,nsub)
3329 integer :: dim,nsub,i,ii,ll,kk
3330 character*(*) tablica(dim)
3331 character*(*) rekord
3341 ! Find the start of term name
3343 do while (ii.le.ll .and. rekord(ii:ii).eq." ")
3346 ! Parse the name into TABLICA(i) until blank found
3347 do while (ii.le.ll .and. rekord(ii:ii).ne." ")
3349 tablica(i)(kk:kk)=rekord(ii:ii)
3352 if (kk.gt.0) nsub=nsub+1
3353 if (ii.gt.ll) return
3356 end subroutine split_string
3357 !--------------------------------------------------------------------------------
3359 !--------------------------------------------------------------------------------
3360 subroutine read_compar
3362 ! Read molecular data
3364 use conform_compar, only:alloc_compar_arrays
3365 use control_data, only:pdbref
3366 use geometry_data, only:deg2rad,rad2deg
3368 ! include 'DIMENSIONS'
3369 ! include 'DIMENSIONS.ZSCOPT'
3370 ! include 'DIMENSIONS.COMPAR'
3371 ! include 'DIMENSIONS.FREE'
3372 ! include 'COMMON.IOUNITS'
3373 ! include 'COMMON.TIME1'
3374 ! include 'COMMON.SBRIDGE'
3375 ! include 'COMMON.CONTROL'
3376 ! include 'COMMON.COMPAR'
3377 ! include 'COMMON.CHAIN'
3378 ! include 'COMMON.HEADER'
3379 ! include 'COMMON.GEO'
3380 ! include 'COMMON.FREE'
3381 character(len=320) :: controlcard !,ucase
3382 character(len=64) :: wfile
3386 !elwrite(iout,*)"jestesmy w read_compar"
3387 call card_concat(controlcard,.true.)
3388 pdbref=(index(controlcard,'PDBREF').gt.0)
3389 call reada(controlcard,'CUTOFF_UP',rmscut_base_up,4.0d0)
3390 call reada(controlcard,'CUTOFF_LOW',rmscut_base_low,3.0d0)
3391 call reada(controlcard,'RMSUP_LIM',rmsup_lim,4.0d0)
3392 call reada(controlcard,'RMSUPUP_LIM',rmsupup_lim,7.5d0)
3393 verbose = index(controlcard,"VERBOSE").gt.0
3394 lgrp=index(controlcard,"STATIN").gt.0
3395 lgrp_out=index(controlcard,"STATOUT").gt.0
3396 merge_helices=index(controlcard,"DONT_MERGE_HELICES").eq.0
3397 binary = index(controlcard,"BINARY").gt.0
3398 rmscut_base_up=rmscut_base_up/50
3399 rmscut_base_low=rmscut_base_low/50
3400 call reada(controlcard,"FRAC_SEC",frac_sec,0.66666666d0)
3401 call readi(controlcard,'NLEVEL',nlevel,1)
3402 if (nlevel.lt.0) then
3404 call alloc_compar_arrays(maxfrag,1)
3407 allocate(nfrag(nlevel))
3409 ! Read the data pertaining to elementary fragments (level 1)
3410 call readi(controlcard,'NFRAG',nfrag(1),0)
3411 write(iout,*)"nfrag(1)",nfrag(1)
3412 call alloc_compar_arrays(nfrag(1),nlevel)
3414 call card_concat(controlcard,.true.)
3415 write (iout,*) controlcard(:ilen(controlcard))
3416 call readi(controlcard,'NPIECE',npiece(j,1),0)
3417 call readi(controlcard,'N_SHIFT1',n_shift(1,j,1),0)
3418 call readi(controlcard,'N_SHIFT2',n_shift(2,j,1),0)
3419 call reada(controlcard,'ANGCUT',ang_cut(j),50.0d0)
3420 call reada(controlcard,'MAXANG',ang_cut1(j),360.0d0)
3421 call reada(controlcard,'FRAC_MIN',frac_min(j),0.666666d0)
3422 call reada(controlcard,'NC_FRAC',nc_fragm(j,1),0.5d0)
3423 call readi(controlcard,'NC_REQ',nc_req_setf(j,1),0)
3424 call readi(controlcard,'RMS',irms(j,1),0)
3425 call readi(controlcard,'LOCAL',iloc(j),1)
3426 call readi(controlcard,'ELCONT',ielecont(j,1),1)
3427 if (ielecont(j,1).eq.0) then
3428 call readi(controlcard,'SCCONT',isccont(j,1),1)
3430 ang_cut(j)=ang_cut(j)*deg2rad
3431 ang_cut1(j)=ang_cut1(j)*deg2rad
3433 call card_concat(controlcard,.true.)
3434 call readi(controlcard,'IFRAG1',ifrag(1,k,j),0)
3435 call readi(controlcard,'IFRAG2',ifrag(2,k,j),0)
3437 write(iout,*)"j",j," npiece",npiece(j,1)," ifrag",&
3438 (ifrag(1,k,j),ifrag(2,k,j),&
3439 k=1,npiece(j,1))," ang_cut",ang_cut(j)*rad2deg,&
3440 " ang_cut1",ang_cut1(j)*rad2deg
3441 write(iout,*)"n_shift",n_shift(1,j,1),n_shift(2,j,1)
3442 write(iout,*)"nc_frac",nc_fragm(j,1)," nc_req",nc_req_setf(j,1)
3443 write(iout,*)"irms",irms(j,1)," ielecont",ielecont(j,1),&
3444 " ilocal",iloc(j)," isccont",isccont(j,1)
3446 ! Read data pertaning to higher levels
3448 call card_concat(controlcard,.true.)
3449 call readi(controlcard,'NFRAG',NFRAG(i),0)
3450 write (iout,*) "i",i," nfrag",nfrag(i)
3452 call card_concat(controlcard,.true.)
3454 call readi(controlcard,'ELCONT',ielecont(j,i),0)
3455 if (ielecont(j,i).eq.0) then
3456 call readi(controlcard,'SCCONT',isccont(j,i),1)
3458 call readi(controlcard,'RMS',irms(j,i),0)
3464 call readi(controlcard,'NPIECE',npiece(j,i),0)
3465 call readi(controlcard,'N_SHIFT1',n_shift(1,j,i),0)
3466 call readi(controlcard,'N_SHIFT2',n_shift(2,j,i),0)
3467 call multreadi(controlcard,'IPIECE',ipiece(1,j,i),&
3469 call reada(controlcard,'NC_FRAC',nc_fragm(j,i),0.5d0)
3470 call readi(controlcard,'NC_REQ',nc_req_setf(j,i),0)
3471 write(iout,*) "j",j," npiece",npiece(j,i)," n_shift",&
3472 n_shift(1,j,i),n_shift(2,j,i)," ielecont",ielecont(j,i),&
3473 " isccont",isccont(j,i)," irms",irms(j,i)
3474 write(iout,*) "ipiece",(ipiece(k,j,i),k=1,npiece(j,i))
3475 write(iout,*)"n_shift",n_shift(1,j,i),n_shift(2,j,i)
3476 write(iout,*)"nc_frac",nc_fragm(j,i),&
3477 " nc_req",nc_req_setf(j,i)
3480 if (binary) write (iout,*) "Classes written in binary format."
3483 call reada(controlcard,'ANGCUT_HEL',angcut_hel,50.0d0)
3484 call reada(controlcard,'MAXANG_HEL',angcut1_hel,60.0d0)
3485 call reada(controlcard,'ANGCUT_BET',angcut_bet,90.0d0)
3486 call reada(controlcard,'MAXANG_BET',angcut1_bet,360.0d0)
3487 call reada(controlcard,'ANGCUT_STRAND',angcut_strand,90.0d0)
3488 call reada(controlcard,'MAXANG_STRAND',angcut1_strand,60.0d0)
3489 call reada(controlcard,'FRAC_MIN',frac_min_set,0.666666d0)
3490 call reada(controlcard,'NC_FRAC_HEL',ncfrac_hel,0.5d0)
3491 call readi(controlcard,'NC_REQ_HEL',ncreq_hel,0)
3492 call reada(controlcard,'NC_FRAC_BET',ncfrac_bet,0.5d0)
3493 call reada(controlcard,'NC_FRAC_PAIR',ncfrac_pair,0.3d0)
3494 call readi(controlcard,'NC_REQ_BET',ncreq_bet,0)
3495 call readi(controlcard,'NC_REQ_PAIR',ncreq_pair,0)
3496 call readi(controlcard,'NSHIFT_HEL',nshift_hel,3)
3497 call readi(controlcard,'NSHIFT_BET',nshift_bet,3)
3498 call readi(controlcard,'NSHIFT_STRAND',nshift_strand,3)
3499 call readi(controlcard,'NSHIFT_PAIR',nshift_pair,3)
3500 call readi(controlcard,'RMS_SINGLE',irms_single,0)
3501 call readi(controlcard,'CONT_SINGLE',icont_single,1)
3502 call readi(controlcard,'LOCAL_SINGLE',iloc_single,1)
3503 call readi(controlcard,'RMS_PAIR',irms_pair,0)
3504 call readi(controlcard,'CONT_PAIR',icont_pair,1)
3505 call readi(controlcard,'SPLIT_BET',isplit_bet,0)
3506 angcut_hel=angcut_hel*deg2rad
3507 angcut1_hel=angcut1_hel*deg2rad
3508 angcut_bet=angcut_bet*deg2rad
3509 angcut1_bet=angcut1_bet*deg2rad
3510 angcut_strand=angcut_strand*deg2rad
3511 angcut1_strand=angcut1_strand*deg2rad
3512 write (iout,*) "Automatic detection of structural elements"
3513 write (iout,*) 'NC_FRAC_HEL',ncfrac_hel,' NC_REQ_HEL',ncreq_hel,&
3514 ' NC_FRAC_BET',ncfrac_bet,' NC_REQ_BET',ncreq_bet,&
3515 ' RMS_SINGLE',irms_single,' CONT_SINGLE',icont_single,&
3516 ' NC_FRAC_PAIR',ncfrac_pair,' NC_REQ_PAIR',ncreq_pair,&
3517 ' RMS_PAIR',irms_pair,' CONT_PAIR',icont_pair,&
3518 ' SPLIT_BET',isplit_bet
3519 write (iout,*) 'NSHIFT_HEL',nshift_hel,' NSHIFT_BET',nshift_bet,&
3520 ' NSHIFT_STRAND',nshift_strand,' NSHIFT_PAIR',nshift_pair
3521 write (iout,*) 'ANGCUT_HEL',angcut_hel*rad2deg,&
3522 ' MAXANG_HEL',angcut1_hel*rad2deg
3523 write (iout,*) 'ANGCUT_BET',angcut_bet*rad2deg,&
3524 ' MAXANG_BET',angcut1_bet*rad2deg
3525 write (iout,*) 'ANGCUT_STRAND',angcut_strand*rad2deg,&
3526 ' MAXANG_STRAND',angcut1_strand*rad2deg
3527 write (iout,*) 'FRAC_MIN',frac_min_set
3529 end subroutine read_compar
3530 !--------------------------------------------------------------------------------
3532 !--------------------------------------------------------------------------------
3533 subroutine read_ref_structure(*)
3535 ! Read the reference structure from the PDB file or from a PDB file or in the form of the dihedral
3538 use control_data, only:pdbref
3539 use geometry_data, only:nres,cref,c,dc,nsup,dc_norm,nend_sup,&
3540 nstart_sup,nstart_seq,nperm,nres0
3541 use energy_data, only:nct,nnt,icont_ref,ncont_ref,itype,molnum
3542 use compare, only:seq_comp !,contact,elecont
3543 use geometry, only:chainbuild,dist
3544 use io_config, only:readpdb
3546 use conform_compar, only:contact,elecont
3548 ! include 'DIMENSIONS'
3549 ! include 'DIMENSIONS.ZSCOPT'
3550 ! include 'DIMENSIONS.COMPAR'
3551 ! include 'COMMON.IOUNITS'
3552 ! include 'COMMON.GEO'
3553 ! include 'COMMON.VAR'
3554 ! include 'COMMON.INTERACT'
3555 ! include 'COMMON.LOCAL'
3556 ! include 'COMMON.NAMES'
3557 ! include 'COMMON.CHAIN'
3558 ! include 'COMMON.FFIELD'
3559 ! include 'COMMON.SBRIDGE'
3560 ! include 'COMMON.HEADER'
3561 ! include 'COMMON.CONTROL'
3562 ! include 'COMMON.CONTACTS1'
3563 ! include 'COMMON.PEPTCONT'
3564 ! include 'COMMON.TIME1'
3565 ! include 'COMMON.COMPAR'
3566 character(len=4) :: sequence(nres)
3568 !el real(kind=8) :: x(maxvar)
3569 integer :: itype_pdb(nres,5)
3570 !el logical seq_comp
3571 integer :: i,j,k,nres_pdb,iaux,mnum
3572 real(kind=8) :: ddsc !el,dist
3573 integer :: kkk !,ilen
3577 write (iout,*) "pdbref",pdbref
3579 read(inp,'(a)') pdbfile
3580 write (iout,'(2a,1h.)') 'PDB data will be read from file ',&
3581 pdbfile(:ilen(pdbfile))
3582 open(ipdbin,file=pdbfile,status='old',err=33)
3584 33 write (iout,'(a)') 'Error opening PDB file.'
3589 itype_pdb(i,mnum)=itype(i,mnum)
3595 iaux=itype_pdb(i,mnum)
3596 itype_pdb(i,mnum)=itype(i,mnum)
3604 if (nsup.le.(nct-nnt+1)) then
3605 do i=0,nct-nnt+1-nsup
3606 if (seq_comp(itype(nnt+i,molnum(nnt+i)),itype_pdb(nstart_sup,molnum(nstart_sup)),&
3608 do j=nnt+nsup-1,nnt,-1
3610 cref(k,nres+j+i,kkk)=cref(k,nres_pdb+j,kkk)
3613 do j=nnt+nsup-1,nnt,-1
3615 cref(k,j+i,kkk)=cref(k,j,kkk)
3617 write(iout,*) "J",j,"J+I",j+i
3618 phi_ref(j+i)=phi_ref(j)
3619 theta_ref(j+i)=theta_ref(j)
3620 alph_ref(j+i)=alph_ref(j)
3621 omeg_ref(j+i)=omeg_ref(j)
3625 write (iout,'(i5,3f10.5,5x,3f10.5)') &
3626 j,(cref(k,j,kkk),k=1,3),(cref(k,j+nres,kkk),k=1,3)
3634 write (iout,'(a)') &
3635 'Error - sequences to be superposed do not match.'
3638 do i=0,nsup-(nct-nnt+1)
3639 if (seq_comp(itype(nnt,molnum(nnt)),itype_pdb(nstart_sup+i,molnum(nstart_sup+i)),&
3642 nstart_sup=nstart_sup+i
3647 write (iout,'(a)') &
3648 'Error - sequences to be superposed do not match.'
3652 write (iout,'(a,i5)') &
3653 'Experimental structure begins at residue',nstart_seq
3655 call read_angles(inp,*38)
3657 38 write (iout,'(a)') 'Error reading reference structure.'
3666 cref(j,i,kkk)=c(j,i)
3670 nend_sup=nstart_sup+nsup-1
3673 c(j,i)=cref(j,i,kkk)
3679 dc(j,nres+i)=cref(j,nres+i,kkk)-cref(j,i,kkk)
3681 if (itype(i,mnum).ne.10) then
3682 ddsc = dist(i,nres+i)
3684 dc_norm(j,nres+i)=dc(j,nres+i)/ddsc
3688 dc_norm(j,nres+i)=0.0d0
3691 ! write (iout,*) "i",i," dc_norm",(dc_norm(k,nres+i),k=1,3),
3692 ! " norm",dc_norm(1,nres+i)**2+dc_norm(2,nres+i)**2+
3693 ! dc_norm(3,nres+i)**2
3695 dc(j,i)=c(j,i+1)-c(j,i)
3699 dc_norm(j,i)=dc(j,i)/ddsc
3702 ! print *,"Calling contact"
3703 call contact(.true.,ncont_ref,icont_ref(1,1),&
3704 nstart_sup,nend_sup)
3705 ! print *,"Calling elecont"
3706 call elecont(.true.,ncont_pept_ref,&
3707 icont_pept_ref(1,1),&
3708 nstart_sup,nend_sup)
3709 write (iout,'(a,i3,a,i3,a,i3,a)') &
3710 'Number of residues to be superposed:',nsup,&
3711 ' (from residue',nstart_sup,' to residue',&
3714 end subroutine read_ref_structure
3715 !--------------------------------------------------------------------------------
3717 !--------------------------------------------------------------------------------
3718 subroutine pdboutW(ii,temp,efree,etot,entropy,rmsdev)
3720 use geometry_data, only:nres,c
3721 use energy_data, only:nss,nnt,nct,ihpb,jhpb,itype,molnum
3722 ! implicit real*8 (a-h,o-z)
3723 ! include 'DIMENSIONS'
3724 ! include 'DIMENSIONS.ZSCOPT'
3725 ! include 'COMMON.CHAIN'
3726 ! include 'COMMON.INTERACT'
3727 ! include 'COMMON.NAMES'
3728 ! include 'COMMON.IOUNITS'
3729 ! include 'COMMON.HEADER'
3730 ! include 'COMMON.SBRIDGE'
3731 character(len=50) :: tytul
3732 character(len=1),dimension(24) :: chainid=reshape((/'A','B','C',&
3733 'D','E','F','G','H','I','J','K','L','M','N','O',&
3734 'P','Q','R','S','V','W','X','Y','Z'/),shape(chainid))
3735 integer,dimension(nres) :: ica !(maxres)
3736 real(kind=8) :: temp,efree,etot,entropy,rmsdev
3737 integer :: ii,i,j,iti,ires,iatom,ichain,mnum
3738 write(ipdb,'("REMARK CONF",i8," TEMPERATURE",f7.1," RMS",0pf7.2)')&
3740 write (ipdb,'("REMARK DIMENSIONLESS FREE ENERGY",1pe15.5)') &
3742 write (ipdb,'("REMARK ENERGY",1pe15.5," ENTROPY",1pe15.5)') &
3750 if (iti.eq.ntyp1) then
3751 if (itype(i-1,molnum(i-1)).eq.ntyp1) then
3754 write (ipdb,'(a)') 'TER'
3760 write (ipdb,10) iatom,restyp(iti,mnum),chainid(ichain),&
3764 write (ipdb,20) iatom,restyp(iti,mnum),chainid(ichain),&
3765 ires,(c(j,nres+i),j=1,3)
3769 write (ipdb,'(a)') 'TER'
3772 if (itype(i,mnum).eq.ntyp1) cycle
3773 if (itype(i,mnum).eq.10 .and. itype(i+1,mnum).ne.ntyp1_molec(mnum)) then
3774 write (ipdb,30) ica(i),ica(i+1)
3775 else if (itype(i,mnum).ne.10 .and. itype(i+1,mnum).ne.ntyp1_molec(mnum)) then
3776 write (ipdb,30) ica(i),ica(i+1),ica(i)+1
3777 else if (itype(i,mnum).ne.10 .and. itype(i+1,mnum).eq.ntyp1_molec(mnum)) then
3778 write (ipdb,30) ica(i),ica(i)+1
3781 if (itype(nct,molnum(nct)).ne.10) then
3782 write (ipdb,30) ica(nct),ica(nct)+1
3785 write (ipdb,30) ica(ihpb(i)-nres)+1,ica(jhpb(i)-nres)+1
3787 write (ipdb,'(a6)') 'ENDMDL'
3788 10 FORMAT ('ATOM',I7,' CA ',A3,1X,A1,I4,4X,3F8.3,f15.3)
3789 20 FORMAT ('ATOM',I7,' CB ',A3,1X,A1,I4,4X,3F8.3,f15.3)
3790 30 FORMAT ('CONECT',8I5)
3792 end subroutine pdboutW
3794 !------------------------------------------------------------------------------
3796 !-----------------------------------------------------------------------------
3797 !-----------------------------------------------------------------------------