X-Git-Url: http://mmka.chem.univ.gda.pl/gitweb/?a=blobdiff_plain;f=source%2Funres%2FMD.f90;h=82ecbe8399e5f50744bd41424b9365b5e26e6eaa;hb=2650964d21aca13b28a8aae5666998afb2540cbd;hp=c378ece42815f7cfb496d30e53769a760bf39e23;hpb=bd02e13419b372715884200b98a58b48e1407f62;p=unres4.git diff --git a/source/unres/MD.f90 b/source/unres/MD.f90 index c378ece..82ecbe8 100644 --- a/source/unres/MD.f90 +++ b/source/unres/MD.f90 @@ -98,33 +98,33 @@ !el integer maxamino,maxnuc,maxbnd !el integer maxang,maxtors,maxpi !el integer maxpib,maxpit - integer :: maxatm !=2*nres !maxres2 maxres2=2*maxres - integer,parameter :: maxval=8 - integer,parameter :: maxgrp=1000 - integer,parameter :: maxtyp=3000 - integer,parameter :: maxclass=500 - integer,parameter :: maxkey=10000 - integer,parameter :: maxrot=1000 - integer,parameter :: maxopt=1000 - integer,parameter :: maxhess=1000000 - integer :: maxlight !=8*maxatm - integer,parameter :: maxvib=1000 - integer,parameter :: maxgeo=1000 - integer,parameter :: maxcell=10000 - integer,parameter :: maxring=10000 - integer,parameter :: maxfix=10000 - integer,parameter :: maxbio=10000 - integer,parameter :: maxamino=31 - integer,parameter :: maxnuc=12 - integer :: maxbnd !=2*maxatm - integer :: maxang !=3*maxatm - integer :: maxtors !=4*maxatm - integer,parameter :: maxpi=100 - integer,parameter :: maxpib=2*maxpi - integer,parameter :: maxpit=4*maxpi +! integer :: maxatm !=2*nres !maxres2 maxres2=2*maxres +! integer,parameter :: maxval=8 +! integer,parameter :: maxgrp=1000 +! integer,parameter :: maxtyp=3000 +! integer,parameter :: maxclass=500 +! integer,parameter :: maxkey=10000 +! integer,parameter :: maxrot=1000 +! integer,parameter :: maxopt=1000 +! integer,parameter :: maxhess=1000000 +! integer :: maxlight !=8*maxatm +! integer,parameter :: maxvib=1000 +! integer,parameter :: maxgeo=1000 +! integer,parameter :: maxcell=10000 +! integer,parameter :: maxring=10000 +! integer,parameter :: maxfix=10000 +! integer,parameter :: maxbio=10000 +! integer,parameter :: maxamino=31 +! integer,parameter :: maxnuc=12 +! integer :: maxbnd !=2*maxatm +! integer :: maxang !=3*maxatm +! integer :: maxtors !=4*maxatm +! integer,parameter :: maxpi=100 +! integer,parameter :: maxpib=2*maxpi +! integer,parameter :: maxpit=4*maxpi !----------------------------------------------------------------------------- ! Maximum number of seed - integer,parameter :: max_seed=1 +! integer,parameter :: max_seed=1 !----------------------------------------------------------------------------- real(kind=8),dimension(:),allocatable :: stochforcvec !(MAXRES6) maxres6=6*maxres ! common /stochcalc/ stochforcvec @@ -207,7 +207,7 @@ nbond=nct-nnt do i=nnt,nct - if (itype(i).ne.10) nbond=nbond+1 + if (itype(i,1).ne.10) nbond=nbond+1 enddo ! if (lprn1) then @@ -229,7 +229,7 @@ ind=ind+3 enddo do i=nnt,nct - if (itype(i).ne.10) then + if (itype(i,1).ne.10) then ind1=ind1+1 do j=1,3 Bmat(ind+j,ind1)=dC_norm(j,i+nres) @@ -306,9 +306,9 @@ Td(i)=Td(i)+vbl*Tmat(i,ind) enddo do k=nnt,nct - if (itype(k).ne.10) then + if (itype(k,1).ne.10) then ind=ind+1 - Td(i)=Td(i)+vbldsc0(1,itype(k))*Tmat(i,ind) + Td(i)=Td(i)+vbldsc0(1,itype(k,1))*Tmat(i,ind) endif enddo enddo @@ -339,7 +339,7 @@ enddo enddo do i=nnt,nct - if (itype(i).ne.10) then + if (itype(i,1).ne.10) then do j=1,3 ind=ind+1 zapas(ind)=-gxcart(j,i)+stochforcvec(ind) @@ -410,9 +410,9 @@ i,(dC(j,i),j=1,3),xx enddo do i=nnt,nct - if (itype(i).ne.10) then + if (itype(i,1).ne.10) then ind=ind+1 - xx=vbld(i+nres)-vbldsc0(1,itype(i)) + xx=vbld(i+nres)-vbldsc0(1,itype(i,1)) write (iout,'(i5,3f10.5,5x,f10.5,e15.5)') & i,(dC(j,i+nres),j=1,3),xx endif @@ -438,11 +438,11 @@ endif enddo do i=nnt,nct - if (itype(i).ne.10) then + if (itype(i,1).ne.10) then ind=ind+1 blen2 = scalar(dc(1,i+nres),dc(1,i+nres)) - ppvec(ind)=2*vbldsc0(1,itype(i))**2-blen2 - diffbond=dabs(vbldsc0(1,itype(i))-dsqrt(blen2)) + ppvec(ind)=2*vbldsc0(1,itype(i,1))**2-blen2 + diffbond=dabs(vbldsc0(1,itype(i,1))-dsqrt(blen2)) if (diffbond.gt.diffmax) diffmax=diffbond if (ppvec(ind).gt.0.0d0) then ppvec(ind)=dsqrt(ppvec(ind)) @@ -481,7 +481,7 @@ ind=ind+3 enddo do i=nnt,nct - if (itype(i).ne.10) then + if (itype(i,1).ne.10) then do j=1,3 dc(j,i+nres)=zapas(ind+j) dc_work(ind+j)=zapas(ind+j) @@ -525,9 +525,9 @@ i,(dC(j,i),j=1,3),xx enddo do i=nnt,nct - if (itype(i).ne.10) then + if (itype(i,1).ne.10) then ind=ind+1 - xx=vbld(i+nres)-vbldsc0(1,itype(i)) + xx=vbld(i+nres)-vbldsc0(1,itype(i,1)) write (iout,'(i5,3f10.5,5x,f10.5,e15.5)') & i,(dC(j,i+nres),j=1,3),xx endif @@ -548,6 +548,7 @@ potE=potEcomp(0)-potEcomp(20) call cartgrad totT=totT+d_time + totTafm=totT ! Calculate the kinetic and total energy and the kinetic temperature call kinetic(EK) #ifdef MPI @@ -653,7 +654,7 @@ ! include 'COMMON.IOUNITS' real(kind=8) :: KE_total - integer :: i,j,k,iti + integer :: i,j,k,iti,mnum real(kind=8) :: KEt_p,KEt_sc,KEr_p,KEr_sc,incr(3),& mag1,mag2,v(3) #ifdef DEBUG @@ -665,18 +666,19 @@ #endif KEt_p=0.0d0 KEt_sc=0.0d0 -! write (iout,*) "ISC",(isc(itype(i)),i=1,nres) +! write (iout,*) "ISC",(isc(itype(i,1)),i=1,nres) ! The translational part for peptide virtual bonds do j=1,3 incr(j)=d_t(j,0) enddo do i=nnt,nct-1 + mnum=molnum(i) ! write (iout,*) "Kinetic trp:",i,(incr(j),j=1,3) do j=1,3 v(j)=incr(j)+0.5d0*d_t(j,i) enddo vtot(i)=v(1)*v(1)+v(2)*v(2)+v(3)*v(3) - KEt_p=KEt_p+(v(1)*v(1)+v(2)*v(2)+v(3)*v(3)) + KEt_p=KEt_p+mp(mnum)*(v(1)*v(1)+v(2)*v(2)+v(3)*v(3)) do j=1,3 incr(j)=incr(j)+d_t(j,i) enddo @@ -689,8 +691,11 @@ incr(j)=d_t(j,0) enddo do i=nnt,nct - iti=iabs(itype(i)) - if (itype(i).eq.10) then + mnum=molnum(i) + iti=iabs(itype(i,mnum)) +! if (itype(i,1).ne.10 .and. itype(i,1).ne.ntyp1) then + if (itype(i,1).eq.10 .or. itype(i,mnum).eq.ntyp1_molec(mnum)& + .or.(mnum.eq.5)) then do j=1,3 v(j)=incr(j) enddo @@ -701,7 +706,7 @@ endif ! write (iout,*) "Kinetic trsc:",i,(incr(j),j=1,3) ! write (iout,*) "i",i," msc",msc(iti)," v",(v(j),j=1,3) - KEt_sc=KEt_sc+msc(iti)*(v(1)*v(1)+v(2)*v(2)+v(3)*v(3)) + KEt_sc=KEt_sc+msc(iti,mnum)*(v(1)*v(1)+v(2)*v(2)+v(3)*v(3)) vtot(i+nres)=v(1)*v(1)+v(2)*v(2)+v(3)*v(3) do j=1,3 incr(j)=incr(j)+d_t(j,i) @@ -712,13 +717,14 @@ ! The part due to stretching and rotation of the peptide groups KEr_p=0.0D0 do i=nnt,nct-1 + mnum=molnum(i) ! write (iout,*) "i",i ! write (iout,*) "i",i," mag1",mag1," mag2",mag2 do j=1,3 incr(j)=d_t(j,i) enddo ! write (iout,*) "Kinetic rotp:",i,(incr(j),j=1,3) - KEr_p=KEr_p+(incr(1)*incr(1)+incr(2)*incr(2) & + KEr_p=KEr_p+Ip(mnum)*(incr(1)*incr(1)+incr(2)*incr(2) & +incr(3)*incr(3)) enddo ! goto 111 @@ -726,20 +732,23 @@ ! The rotational part of the side chain virtual bond KEr_sc=0.0D0 do i=nnt,nct - iti=iabs(itype(i)) - if (itype(i).ne.10) then + mnum=molnum(i) + iti=iabs(itype(i,mnum)) +! if (itype(i,1).ne.10 .and. itype(i,1).ne.ntyp1) then + if (itype(i,1).ne.10 .and. itype(i,mnum).ne.ntyp1_molec(mnum)& + .and.(mnum.ne.5)) then do j=1,3 incr(j)=d_t(j,nres+i) enddo ! write (iout,*) "Kinetic rotsc:",i,(incr(j),j=1,3) - KEr_sc=KEr_sc+Isc(iti)*(incr(1)*incr(1)+incr(2)*incr(2)+ & + KEr_sc=KEr_sc+Isc(iti,mnum)*(incr(1)*incr(1)+incr(2)*incr(2)+ & incr(3)*incr(3)) endif enddo ! The total kinetic energy 111 continue ! write(iout,*) 'KEr_sc', KEr_sc - KE_total=0.5d0*(mp*KEt_p+KEt_sc+0.25d0*Ip*KEr_p+KEr_sc) + KE_total=0.5d0*(KEt_p+KEt_sc+0.25d0*KEr_p+KEr_sc) ! write (iout,*) "KE_total",KE_total return end subroutine kinetic @@ -968,7 +977,7 @@ enddo enddo do i=nnt,nct - if (itype(i).ne.10 .and. itype(i).ne.ntyp1) then + if (itype(i,1).ne.10 .and. itype(i,1).ne.ntyp1) then do j=1,3 ind=ind+1 v_work(ind)=d_t(j,i+nres) @@ -1001,6 +1010,7 @@ if (rstcount.eq.1000.or.itime.eq.n_timestep) then open(irest2,file=rest2name,status='unknown') write(irest2,*) totT,EK,potE,totE,t_bath + totTafm=totT ! AL 4/17/17: Now writing d_t(0,:) too do i=0,2*nres write (irest2,'(3e15.5)') (d_t(j,i),j=1,3) @@ -1287,6 +1297,7 @@ endif if (rattle) call rattle2 totT=totT+d_time + totTafm=totT if (d_time.ne.d_time0) then d_time=d_time0 #ifndef LANG0 @@ -1726,6 +1737,7 @@ potE=potEcomp(0)-potEcomp(20) ! potE=energia_short(0)+energia_long(0) totT=totT+d_time + totTafm=totT ! Calculate the kinetic and the total energy and the kinetic temperature call kinetic(EK) totE=EK+potE @@ -1763,7 +1775,7 @@ ! include 'COMMON.INTERACT' ! include 'COMMON.IOUNITS' ! include 'COMMON.NAMES' - integer :: i,j,inres + integer :: i,j,inres,mnum do j=1,3 d_t(j,0)=d_t(j,0)+0.5d0*d_a(j,0)*d_time @@ -1774,7 +1786,10 @@ enddo enddo do i=nnt,nct - if (itype(i).ne.10 .and. itype(i).ne.ntyp1) then + mnum=molnum(i) +! if (itype(i,1).ne.10 .and. itype(i,1).ne.ntyp1) then + if (itype(i,1).ne.10 .and. itype(i,mnum).ne.ntyp1_molec(mnum)& + .and.(mnum.ne.5)) then inres=i+nres do j=1,3 d_t(j,inres)=d_t(j,inres)+0.5d0*d_a(j,inres)*d_time @@ -1800,7 +1815,7 @@ ! include 'COMMON.IOUNITS' ! include 'COMMON.NAMES' real(kind=8) :: adt,adt2 - integer :: i,j,inres + integer :: i,j,inres,mnum #ifdef DEBUG write (iout,*) "VELVERLET1 START: DC" @@ -1826,7 +1841,10 @@ enddo enddo do i=nnt,nct - if (itype(i).ne.10 .and. itype(i).ne.ntyp1) then + mnum=molnum(i) +! if (itype(i,1).ne.10 .and. itype(i,1).ne.ntyp1) then + if (itype(i,1).ne.10 .and. itype(i,mnum).ne.ntyp1_molec(mnum)& + .and.(mnum.ne.5)) then inres=i+nres do j=1,3 adt=d_a_old(j,inres)*d_time @@ -1862,7 +1880,7 @@ ! include 'COMMON.INTERACT' ! include 'COMMON.IOUNITS' ! include 'COMMON.NAMES' - integer :: i,j,inres + integer :: i,j,inres,mnum do j=1,3 d_t(j,0)=d_t_new(j,0)+0.5d0*d_a(j,0)*d_time @@ -1873,7 +1891,11 @@ enddo enddo do i=nnt,nct - if (itype(i).ne.10 .and. itype(i).ne.ntyp1) then + mnum=molnum(i) +! iti=iabs(itype(i,mnum)) +! if (itype(i,1).ne.10 .and. itype(i,1).ne.ntyp1) then + if (itype(i,1).ne.10 .and. itype(i,mnum).ne.ntyp1_molec(mnum)& + .and.(mnum.ne.5)) then inres=i+nres do j=1,3 d_t(j,inres)=d_t_new(j,inres)+0.5d0*d_a(j,inres)*d_time @@ -1956,7 +1978,7 @@ ! position and velocity increments included. real(kind=8) :: sqrt13 = 0.57735026918962576451d0 ! 1/sqrt(3) real(kind=8) :: adt,adt2 - integer :: i,j,ind,inres + integer :: i,j,ind,inres,mnum ! ! Add the contribution from BOTH friction and stochastic force to the ! coordinates, but ONLY the contribution from the friction forces to velocities @@ -1980,7 +2002,11 @@ ind=ind+3 enddo do i=nnt,nct - if (itype(i).ne.10 .and. itype(i).ne.ntyp1) then + mnum=molnum(i) +! iti=iabs(itype(i,mnum)) +! if (itype(i,1).ne.10 .and. itype(i,1).ne.ntyp1) then + if (itype(i,1).ne.10 .and. itype(i,mnum).ne.ntyp1_molec(mnum)& + .and.(mnum.ne.5)) then inres=i+nres do j=1,3 adt=(d_a_old(j,inres)+d_af_work(ind+j))*d_time @@ -2018,7 +2044,7 @@ ! include 'COMMON.NAMES' real(kind=8),dimension(6*nres) :: stochforcvec,d_as_work1 !(MAXRES6) maxres6=6*maxres real(kind=8) :: cos60 = 0.5d0, sin60 = 0.86602540378443864676d0 - integer :: i,j,ind,inres + integer :: i,j,ind,inres,mnum ! Revised 3/31/05 AL: correlation between random contributions to ! position and velocity increments included. ! The correlation coefficients are calculated at low-friction limit. @@ -2048,7 +2074,11 @@ ind=ind+3 enddo do i=nnt,nct - if (itype(i).ne.10 .and. itype(i).ne.ntyp1) then + mnum=molnum(i) +! iti=iabs(itype(i,mnum)) +! if (itype(i,1).ne.10 .and. itype(i,1).ne.ntyp1) then + if (itype(i,1).ne.10 .and. itype(i,mnum).ne.ntyp1_molec(mnum)& + .and.(mnum.ne.5)) then inres=i+nres do j=1,3 d_t(j,inres)=d_t_new(j,inres)+(0.5d0*(d_a(j,inres) & @@ -2080,7 +2110,7 @@ ! include 'COMMON.IOUNITS' real(kind=8),dimension(3) :: aux,accel,accel_old real(kind=8) :: dacc - integer :: i,j + integer :: i,j,mnum do j=1,3 ! aux(j)=d_a(j,0)-d_a_old(j,0) @@ -2118,7 +2148,11 @@ enddo endif do i=nnt,nct - if (itype(i).ne.10 .and. itype(i).ne.ntyp1) then + mnum=molnum(i) +! iti=iabs(itype(i,mnum)) +! if (itype(i,1).ne.10 .and. itype(i,1).ne.ntyp1) then + if (itype(i,1).ne.10 .and. itype(i,mnum).ne.ntyp1_molec(mnum)& + .and.(mnum.ne.5)) then do j=1,3 ! accel(j)=accel(j)+d_a(j,i+nres)-d_a_old(j,i+nres) accel_old(j)=accel_old(j)+d_a_old(j,i+nres) @@ -2175,7 +2209,7 @@ enddo endif ! Side chains - if (itype(i).ne.10 .and. itype(i).ne.ntyp1) then + if (itype(i,1).ne.10 .and. itype(i,1).ne.ntyp1) then do j=1,3 epdriftij= & dabs((d_a(j,i+nres)-d_a_old(j,i+nres))*gxcart(j,i)) @@ -2208,7 +2242,7 @@ ! include 'COMMON.IOUNITS' ! include 'COMMON.NAMES' real(kind=8) :: T_half,fact - integer :: i,j,inres + integer :: i,j,inres,mnum ! T_half=2.0d0/(dimen3*Rb)*EK fact=dsqrt(1.0d0+(d_time/tau_bath)*(t_bath/T_half-1.0d0)) @@ -2224,7 +2258,11 @@ enddo enddo do i=nnt,nct - if (itype(i).ne.10 .and. itype(i).ne.ntyp1) then + mnum=molnum(i) +! iti=iabs(itype(i,mnum)) +! if (itype(i,1).ne.10 .and. itype(i,1).ne.ntyp1) then + if (itype(i,1).ne.10 .and. itype(i,mnum).ne.ntyp1_molec(mnum)& + .and.(mnum.ne.5)) then inres=i+nres do j=1,3 d_t(j,inres)=fact*d_t(j,inres) @@ -2279,7 +2317,7 @@ character(len=50) :: tytul logical :: file_exist !el common /gucio/ cm - integer :: i,j,ipos,iq,iw,nft_sc,iretcode,nfun,itime,ierr + integer :: i,j,ipos,iq,iw,nft_sc,iretcode,nfun,itime,ierr,mnum real(kind=8) :: etot,tt0 logical :: fail @@ -2289,11 +2327,13 @@ ! if the friction coefficients do not depend on surface area if (lang.gt.0 .and. .not.surfarea) then do i=nnt,nct-1 - stdforcp(i)=stdfp*dsqrt(gamp) + mnum=molnum(i) + stdforcp(i)=stdfp(mnum)*dsqrt(gamp(mnum)) enddo do i=nnt,nct - stdforcsc(i)=stdfsc(iabs(itype(i))) & - *dsqrt(gamsc(iabs(itype(i)))) + mnum=molnum(i) + stdforcsc(i)=stdfsc(iabs(itype(i,mnum)),mnum) & + *dsqrt(gamsc(iabs(itype(i,mnum)),mnum)) enddo endif ! Open the pdb file for snapshotshots @@ -2403,6 +2443,7 @@ endif call random_vel totT=0.0d0 + totTafm=totT endif else ! Generate initial velocities @@ -2410,6 +2451,7 @@ write(iout,*) "Initial velocities randomly generated" call random_vel totT=0.0d0 + totTafm=totT endif ! rest2name = prefix(:ilen(prefix))//'.rst' if(me.eq.king.or..not.out1file)then @@ -2435,7 +2477,7 @@ write (iout,*) "vcm right after adjustment:" write (iout,*) (vcm(j),j=1,3) endif - if (.not.rest) then + if ((.not.rest).and.(indpdb.eq.0)) then call chainbuild if(iranconf.ne.0) then if (overlapsc) then @@ -2643,7 +2685,7 @@ real (kind=8),allocatable,dimension(:,:) :: matold #endif #endif - integer :: i,j,ii,k,ind,mark,imark + integer :: i,j,ii,k,ind,mark,imark,mnum ! Generate random velocities from Gaussian distribution of mean 0 and std of KT/m ! First generate velocities in the eigenspace of the G matrix ! write (iout,*) "Calling random_vel dimen dimen3",dimen,dimen3 @@ -2867,7 +2909,12 @@ Ek1=0.0d0 ii=0 do i=nnt,nct - if (itype(i).eq.10) then +! if (itype(i,1).eq.10) then + mnum=molnum(i) + iti=iabs(itype(i,mnum)) +! if (itype(i,1).ne.10 .and. itype(i,1).ne.ntyp1) then + if (itype(i,1).eq.10 .or. itype(i,mnum).eq.ntyp1_molec(mnum)& + .or.(mnum.eq.5)) then j=ii+3 else j=ii+6 @@ -2875,18 +2922,21 @@ if (i.lt.nct) then do k=1,3 ! write (iout,*) "k",k," ii+k",ii+k," ii+j+k",ii+j+k,"EK1",Ek1 - Ek1=Ek1+0.5d0*mp*((d_t_work(ii+j+k)+d_t_work_new(ii+k))/2)**2+& - 0.5d0*0.25d0*IP*(d_t_work(ii+j+k)-d_t_work_new(ii+k))**2 + Ek1=Ek1+0.5d0*mp(mnum)*((d_t_work(ii+j+k)+d_t_work_new(ii+k))/2)**2+& + 0.5d0*0.25d0*IP(mnum)*(d_t_work(ii+j+k)-d_t_work_new(ii+k))**2 enddo endif - if (itype(i).ne.10) ii=ii+3 - write (iout,*) "i",i," itype",itype(i)," mass",msc(itype(i)) + if (itype(i,1).ne.10 .and. itype(i,mnum).ne.ntyp1_molec(mnum)& + .and.(mnum.ne.5)) ii=ii+3 + write (iout,*) "i",i," itype",itype(i,mnum)," mass",msc(itype(i,mnum),mnum) write (iout,*) "ii",ii do k=1,3 ii=ii+1 write (iout,*) "k",k," ii",ii,"EK1",EK1 - if (iabs(itype(i)).ne.10) Ek1=Ek1+0.5d0*Isc(iabs(itype(i)))*(d_t_work(ii)-d_t_work(ii-3))**2 - Ek1=Ek1+0.5d0*msc(iabs(itype(i)))*d_t_work(ii)**2 + if (itype(i,1).ne.10 .and. itype(i,mnum).ne.ntyp1_molec(mnum)& + .and.(mnum.ne.5))& + Ek1=Ek1+0.5d0*Isc(iabs(itype(i,mnum),mnum))*(d_t_work(ii)-d_t_work(ii-3))**2 + Ek1=Ek1+0.5d0*msc(iabs(itype(i,mnum)),mnum)*d_t_work(ii)**2 enddo write (iout,*) "i",i," ii",ii enddo @@ -2910,7 +2960,9 @@ d_t(k,j)=d_t_work(ind) ind=ind+1 enddo - if (itype(j).ne.10 .and. itype(j).ne.ntyp1) then + mnum=molnum(i) + if (itype(i,1).ne.10 .and. itype(i,mnum).ne.ntyp1_molec(mnum)& + .and.(mnum.ne.5)) do k=1,3 d_t(k,j+nres)=d_t_work(ind) ind=ind+1 @@ -2930,7 +2982,10 @@ d_t(j,0)=d_t(j,nnt) enddo do i=nnt,nct - if (itype(i).eq.10) then +! if (itype(i,1).eq.10) then + mnum=molnum(i) + if (itype(i,1).eq.10 .or. itype(i,mnum).eq.ntyp1_molec(mnum)& + .or.(mnum.eq.5)) do j=1,3 d_t(j,i)=d_t(j,i+1)-d_t(j,i) enddo @@ -2978,7 +3033,10 @@ enddo enddo do i=nnt,nct - if (itype(i).ne.10 .and. itype(i).ne.ntyp1) then + mnum=molnum(i) +! if (itype(i,1).ne.10 .and. itype(i,1).ne.ntyp1) then + if (itype(i,1).ne.10 .and. itype(i,mnum).ne.ntyp1_molec(mnum)& + .and.(mnum.ne.5)) then do j=1,3 ind=ind+1 d_t(j,i+nres)=d_t_work(ind) @@ -3219,7 +3277,10 @@ ind=ind+3 enddo do i=nnt,nct - if (itype(i).ne.10 .and. itype(i).ne.ntyp1) then + mnum=molnum(i) +! if (itype(i,1).ne.10 .and. itype(i,1).ne.ntyp1) then + if (itype(i,1).ne.10 .and. itype(i,mnum).ne.ntyp1_molec(mnum)& + .and.(mnum.ne.5)) then do j=1,3 dc_work(ind+j)=dc_old(j,i+nres) d_t_work(ind+j)=d_t_old(j,i+nres) @@ -3267,7 +3328,10 @@ ind=ind+3 enddo do i=nnt,nct - if (itype(i).ne.10) then + mnum=molnum(i) +! if (itype(i,1).ne.10 .and. itype(i,1).ne.ntyp1) then + if (itype(i,1).ne.10 .and. itype(i,mnum).ne.ntyp1_molec(mnum)& + .and.(mnum.ne.5)) then inres=i+nres do j=1,3 dc(j,inres)=dc_work(ind+j) @@ -3333,7 +3397,10 @@ ind=ind+3 enddo do i=nnt,nct - if (itype(i).ne.10 .and. itype(i).ne.ntyp1) then + mnum=molnum(i) +! if (itype(i,1).ne.10 .and. itype(i,1).ne.ntyp1) then + if (itype(i,1).ne.10 .and. itype(i,mnum).ne.ntyp1_molec(mnum)& + .and.(mnum.ne.5)) then inres=i+nres do j=1,3 d_t(j,inres)=d_t_work(ind+j) @@ -3497,7 +3564,7 @@ ind=ind+3 enddo do i=nnt,nct - if (itype(i).ne.10 .and. itype(i).ne.ntyp1) then + if (itype(i,1).ne.10 .and. itype(i,1).ne.ntyp1) then do j=1,3 dc_work(ind+j)=dc_old(j,i+nres) d_t_work(ind+j)=d_t_old(j,i+nres) @@ -3546,7 +3613,10 @@ ind=ind+3 enddo do i=nnt,nct - if (itype(i).ne.10 .and. itype(i).ne.ntyp1) then + mnum=molnum(i) +! if (itype(i,1).ne.10 .and. itype(i,1).ne.ntyp1) then + if (itype(i,1).ne.10 .and. itype(i,mnum).ne.ntyp1_molec(mnum)& + .and.(mnum.ne.5)) then inres=i+nres do j=1,3 dc(j,inres)=dc_work(ind+j) @@ -3612,7 +3682,10 @@ ind=ind+3 enddo do i=nnt,nct - if (itype(i).ne.10 .and. itype(i).ne.ntyp1) then + mnum=molnum(i) + if (itype(i,1).ne.10 .and. itype(i,mnum).ne.ntyp1_molec(mnum)& + .and.(mnum.ne.5)) +! if (itype(i,1).ne.10 .and. itype(i,1).ne.ntyp1) then inres=i+nres do j=1,3 d_t(j,inres)=d_t_work(ind+j) @@ -3648,13 +3721,13 @@ real(kind=8),dimension(3,3) :: Im,Imcp,eigvec,Id real(kind=8),dimension(3) :: pr,eigval,L,vp,vrot - real(kind=8) :: M_SC,mag,mag2 + real(kind=8) :: M_SC,mag,mag2,M_PEP real(kind=8),dimension(3,0:nres) :: vpp !(3,0:MAXRES) real(kind=8),dimension(3) :: vs_p,pp,incr,v real(kind=8),dimension(3,3) :: pr1,pr2 !el common /gucio/ cm - integer :: iti,inres,i,j,k + integer :: iti,inres,i,j,k,mnum do i=1,3 do j=1,3 Im(i,j)=0.0d0 @@ -3666,84 +3739,95 @@ vrot(i)=0.0d0 enddo ! calculating the center of the mass of the protein + M_PEP=0.0d0 do i=nnt,nct-1 + mnum=molnum(i) + if (itype(i,mnum).eq.ntyp1_molec(mnum)) cycle + M_PEP=M_PEP+mp(mnum) do j=1,3 - cm(j)=cm(j)+c(j,i)+0.5d0*dc(j,i) + cm(j)=cm(j)+(c(j,i)+0.5d0*dc(j,i))*mp(mnum) enddo enddo - do j=1,3 - cm(j)=mp*cm(j) - enddo +! do j=1,3 +! cm(j)=mp(1)*cm(j) +! enddo M_SC=0.0d0 do i=nnt,nct - iti=iabs(itype(i)) - M_SC=M_SC+msc(iabs(iti)) + mnum=molnum(i) + iti=iabs(itype(i,mnum)) + M_SC=M_SC+msc(iabs(iti),mnum) inres=i+nres do j=1,3 - cm(j)=cm(j)+msc(iabs(iti))*c(j,inres) + cm(j)=cm(j)+msc(iabs(iti),mnum)*c(j,inres) enddo enddo do j=1,3 - cm(j)=cm(j)/(M_SC+(nct-nnt)*mp) + cm(j)=cm(j)/(M_SC+M_PEP) enddo do i=nnt,nct-1 + mnum=molnum(i) do j=1,3 pr(j)=c(j,i)+0.5d0*dc(j,i)-cm(j) enddo - Im(1,1)=Im(1,1)+mp*(pr(2)*pr(2)+pr(3)*pr(3)) - Im(1,2)=Im(1,2)-mp*pr(1)*pr(2) - Im(1,3)=Im(1,3)-mp*pr(1)*pr(3) - Im(2,3)=Im(2,3)-mp*pr(2)*pr(3) - Im(2,2)=Im(2,2)+mp*(pr(3)*pr(3)+pr(1)*pr(1)) - Im(3,3)=Im(3,3)+mp*(pr(1)*pr(1)+pr(2)*pr(2)) + Im(1,1)=Im(1,1)+mp(mnum)*(pr(2)*pr(2)+pr(3)*pr(3)) + Im(1,2)=Im(1,2)-mp(mnum)*pr(1)*pr(2) + Im(1,3)=Im(1,3)-mp(mnum)*pr(1)*pr(3) + Im(2,3)=Im(2,3)-mp(mnum)*pr(2)*pr(3) + Im(2,2)=Im(2,2)+mp(mnum)*(pr(3)*pr(3)+pr(1)*pr(1)) + Im(3,3)=Im(3,3)+mp(mnum)*(pr(1)*pr(1)+pr(2)*pr(2)) enddo do i=nnt,nct - iti=iabs(itype(i)) + mnum=molnum(i) + iti=iabs(itype(i,mnum)) inres=i+nres do j=1,3 pr(j)=c(j,inres)-cm(j) enddo - Im(1,1)=Im(1,1)+msc(iabs(iti))*(pr(2)*pr(2)+pr(3)*pr(3)) - Im(1,2)=Im(1,2)-msc(iabs(iti))*pr(1)*pr(2) - Im(1,3)=Im(1,3)-msc(iabs(iti))*pr(1)*pr(3) - Im(2,3)=Im(2,3)-msc(iabs(iti))*pr(2)*pr(3) - Im(2,2)=Im(2,2)+msc(iabs(iti))*(pr(3)*pr(3)+pr(1)*pr(1)) - Im(3,3)=Im(3,3)+msc(iabs(iti))*(pr(1)*pr(1)+pr(2)*pr(2)) + Im(1,1)=Im(1,1)+msc(iabs(iti),mnum)*(pr(2)*pr(2)+pr(3)*pr(3)) + Im(1,2)=Im(1,2)-msc(iabs(iti),mnum)*pr(1)*pr(2) + Im(1,3)=Im(1,3)-msc(iabs(iti),mnum)*pr(1)*pr(3) + Im(2,3)=Im(2,3)-msc(iabs(iti),mnum)*pr(2)*pr(3) + Im(2,2)=Im(2,2)+msc(iabs(iti),mnum)*(pr(3)*pr(3)+pr(1)*pr(1)) + Im(3,3)=Im(3,3)+msc(iabs(iti),mnum)*(pr(1)*pr(1)+pr(2)*pr(2)) enddo do i=nnt,nct-1 - Im(1,1)=Im(1,1)+Ip*(1-dc_norm(1,i)*dc_norm(1,i))* & + mnum=molnum(i) + Im(1,1)=Im(1,1)+Ip(mnum)*(1-dc_norm(1,i)*dc_norm(1,i))* & vbld(i+1)*vbld(i+1)*0.25d0 - Im(1,2)=Im(1,2)+Ip*(-dc_norm(1,i)*dc_norm(2,i))* & + Im(1,2)=Im(1,2)+Ip(mnum)*(-dc_norm(1,i)*dc_norm(2,i))* & vbld(i+1)*vbld(i+1)*0.25d0 - Im(1,3)=Im(1,3)+Ip*(-dc_norm(1,i)*dc_norm(3,i))* & + Im(1,3)=Im(1,3)+Ip(mnum)*(-dc_norm(1,i)*dc_norm(3,i))* & vbld(i+1)*vbld(i+1)*0.25d0 - Im(2,3)=Im(2,3)+Ip*(-dc_norm(2,i)*dc_norm(3,i))* & + Im(2,3)=Im(2,3)+Ip(mnum)*(-dc_norm(2,i)*dc_norm(3,i))* & vbld(i+1)*vbld(i+1)*0.25d0 - Im(2,2)=Im(2,2)+Ip*(1-dc_norm(2,i)*dc_norm(2,i))* & + Im(2,2)=Im(2,2)+Ip(mnum)*(1-dc_norm(2,i)*dc_norm(2,i))* & vbld(i+1)*vbld(i+1)*0.25d0 - Im(3,3)=Im(3,3)+Ip*(1-dc_norm(3,i)*dc_norm(3,i))* & + Im(3,3)=Im(3,3)+Ip(mnum)*(1-dc_norm(3,i)*dc_norm(3,i))* & vbld(i+1)*vbld(i+1)*0.25d0 enddo do i=nnt,nct - if (itype(i).ne.10 .and. itype(i).ne.ntyp1) then - iti=iabs(itype(i)) + mnum=molnum(i) +! if (itype(i,1).ne.10 .and. itype(i,mnum).ne.ntyp1_molec(mnum)) then + if (itype(i,1).ne.10 .and. itype(i,mnum).ne.ntyp1_molec(mnum)& + .and.(mnum.ne.5)) then + iti=iabs(itype(i,mnum)) inres=i+nres - Im(1,1)=Im(1,1)+Isc(iti)*(1-dc_norm(1,inres)* & + Im(1,1)=Im(1,1)+Isc(iti,mnum)*(1-dc_norm(1,inres)* & dc_norm(1,inres))*vbld(inres)*vbld(inres) - Im(1,2)=Im(1,2)-Isc(iti)*(dc_norm(1,inres)* & + Im(1,2)=Im(1,2)-Isc(iti,mnum)*(dc_norm(1,inres)* & dc_norm(2,inres))*vbld(inres)*vbld(inres) - Im(1,3)=Im(1,3)-Isc(iti)*(dc_norm(1,inres)* & + Im(1,3)=Im(1,3)-Isc(iti,mnum)*(dc_norm(1,inres)* & dc_norm(3,inres))*vbld(inres)*vbld(inres) - Im(2,3)=Im(2,3)-Isc(iti)*(dc_norm(2,inres)* & + Im(2,3)=Im(2,3)-Isc(iti,mnum)*(dc_norm(2,inres)* & dc_norm(3,inres))*vbld(inres)*vbld(inres) - Im(2,2)=Im(2,2)+Isc(iti)*(1-dc_norm(2,inres)* & + Im(2,2)=Im(2,2)+Isc(iti,mnum)*(1-dc_norm(2,inres)* & dc_norm(2,inres))*vbld(inres)*vbld(inres) - Im(3,3)=Im(3,3)+Isc(iti)*(1-dc_norm(3,inres)* & + Im(3,3)=Im(3,3)+Isc(iti,mnum)*(1-dc_norm(3,inres)* & dc_norm(3,inres))*vbld(inres)*vbld(inres) endif enddo @@ -3813,7 +3897,11 @@ enddo enddo do i=nnt,nct - if(itype(i).ne.10 .and. itype(i).ne.ntyp1) then + mnum=molnum(i) + if (itype(i,1).ne.10 .and. itype(i,mnum).ne.ntyp1_molec(mnum)& + .and.(mnum.ne.5)) then +! if (itype(i,1).ne.10 .and. itype(i,mnum).ne.ntyp1_molec(mnum)) then +! if(itype(i,1).ne.10 .and. itype(i,1).ne.ntyp1) then inres=i+nres call vecpr(vrot(1),dc(1,inres),vp) do j=1,3 @@ -3845,7 +3933,7 @@ ! include 'COMMON.NAMES' real(kind=8),dimension(3) :: L,cm,pr,vp,vrot,incr,v,pp - integer :: iti,inres,i,j + integer :: iti,inres,i,j,mnum ! Calculate the angular momentum do j=1,3 L(j)=0.0d0 @@ -3854,6 +3942,7 @@ incr(j)=d_t(j,0) enddo do i=nnt,nct-1 + mnum=molnum(i) do j=1,3 pr(j)=c(j,i)+0.5d0*dc(j,i)-cm(j) enddo @@ -3865,7 +3954,7 @@ enddo call vecpr(pr(1),v(1),vp) do j=1,3 - L(j)=L(j)+mp*vp(j) + L(j)=L(j)+mp(mnum)*vp(j) enddo do j=1,3 pr(j)=0.5d0*dc(j,i) @@ -3873,19 +3962,21 @@ enddo call vecpr(pr(1),pp(1),vp) do j=1,3 - L(j)=L(j)+Ip*vp(j) + L(j)=L(j)+Ip(mnum)*vp(j) enddo enddo do j=1,3 incr(j)=d_t(j,0) enddo do i=nnt,nct - iti=iabs(itype(i)) + mnum=molnum(i) + iti=iabs(itype(i,mnum)) inres=i+nres do j=1,3 pr(j)=c(j,inres)-cm(j) enddo - if (itype(i).ne.10 .and. itype(i).ne.ntyp1) then + if (itype(i,1).ne.10 .and. itype(i,mnum).ne.ntyp1_molec(mnum)& + .and.(mnum.ne.5)) then do j=1,3 v(j)=incr(j)+d_t(j,inres) enddo @@ -3898,16 +3989,17 @@ ! write (iout,*) "i",i," iti",iti," pr",(pr(j),j=1,3), ! & " v",(v(j),j=1,3)," vp",(vp(j),j=1,3) do j=1,3 - L(j)=L(j)+msc(iabs(iti))*vp(j) + L(j)=L(j)+msc(iabs(iti),mnum)*vp(j) enddo ! write (iout,*) "L",(l(j),j=1,3) - if (itype(i).ne.10 .and. itype(i).ne.ntyp1) then + if (itype(i,mnum).ne.10 .and. itype(i,mnum).ne.ntyp1_molec(mnum)& + .and.(mnum.ne.5)) then do j=1,3 v(j)=incr(j)+d_t(j,inres) enddo call vecpr(dc(1,inres),d_t(1,inres),vp) do j=1,3 - L(j)=L(j)+Isc(iti)*vp(j) + L(j)=L(j)+Isc(iti,mnum)*vp(j) enddo endif do j=1,3 @@ -3932,7 +4024,7 @@ ! include 'COMMON.IOUNITS' real(kind=8),dimension(3) :: vcm,vv real(kind=8) :: summas,amas - integer :: i,j + integer :: i,j,mnum do j=1,3 vcm(j)=0.0d0 @@ -3940,15 +4032,17 @@ enddo summas=0.0d0 do i=nnt,nct + mnum=molnum(i) if (i.lt.nct) then - summas=summas+mp + summas=summas+mp(mnum) do j=1,3 - vcm(j)=vcm(j)+mp*(vv(j)+0.5d0*d_t(j,i)) + vcm(j)=vcm(j)+mp(mnum)*(vv(j)+0.5d0*d_t(j,i)) enddo endif - amas=msc(iabs(itype(i))) + amas=msc(iabs(itype(i,mnum)),mnum) summas=summas+amas - if (itype(i).ne.10 .and. itype(i).ne.ntyp1) then + if (itype(i,mnum).ne.10 .and. itype(i,mnum).ne.ntyp1_molec(mnum)& + .and.(mnum.ne.5)) then do j=1,3 vcm(j)=vcm(j)+amas*(vv(j)+d_t(j,i+nres)) enddo @@ -4017,7 +4111,9 @@ if (lprn) write (iout,*) "RATTLE1" nbond=nct-nnt do i=nnt,nct - if (itype(i).ne.10) nbond=nbond+1 + mnum=molnum(i) + if (itype(i,1).ne.10 .and. itype(i,mnum).ne.ntyp1_molec(mnum)& + .and.(mnum.ne.5)) nbond=nbond+1 enddo ! Make a folded form of the Ginv-matrix ind=0 @@ -4036,7 +4132,9 @@ enddo enddo do k=nnt,nct - if (itype(k).ne.10) then + mnum=molnum(k) + if (itype(k,1).ne.10 .and. itype(k,mnum).ne.ntyp1_molec(mnum)& + .and.(mnum.ne.5)) then jj=jj+1 do l=1,3 ind1=ind1+1 @@ -4047,7 +4145,9 @@ enddo enddo do i=nnt,nct - if (itype(i).ne.10) then + mnum=molnum(i) + if (itype(i,1).ne.10 .and. itype(i,mnum).ne.ntyp1_molec(mnum)& + .and.(mnum.ne.5)) ii=ii+1 do j=1,3 ind=ind+1 @@ -4061,7 +4161,7 @@ enddo enddo do k=nnt,nct - if (itype(k).ne.10) then + if (itype(k,1).ne.10) then jj=jj+1 do l=1,3 ind1=ind1+1 @@ -4093,7 +4193,7 @@ enddo enddo do i=nnt,nct - if (itype(i).ne.10) then + if (itype(i,1).ne.10) then ind1=ind1+1 do j=1,3 dC_uncor(j,ind1)=dC(j,i+nres) @@ -4109,7 +4209,7 @@ enddo enddo do k=nnt,nct - if (itype(k).ne.10) then + if (itype(k,1).ne.10) then ind=ind+1 do j=1,3 gdc(j,i,ind)=GGinv(i,ind)*dC_old(j,k+nres) @@ -4124,9 +4224,9 @@ x(ind)=vbld(i+1)**2-vbl**2 enddo do i=nnt,nct - if (itype(i).ne.10) then + if (itype(i,1).ne.10) then ind=ind+1 - x(ind)=vbld(i+nres)**2-vbldsc0(1,itype(i))**2 + x(ind)=vbld(i+nres)**2-vbldsc0(1,itype(i,1))**2 endif enddo if (lprn) then @@ -4143,7 +4243,10 @@ i,ind,(d_t_new(j,i),j=1,3),scalar(d_t_new(1,i),dC_old(1,i)) enddo do i=nnt,nct - if (itype(i).ne.10) then + mnum=molnum(i) + if (itype(i,1).ne.10 .and. itype(i,mnum).ne.ntyp1_molec(mnum)& + .and.(mnum.ne.5)) then + ind=ind+1 write (iout,'(2i5,3f10.5,5x,e15.5)') & i+nres,ind,(d_t_new(j,i+nres),j=1,3),& @@ -4197,7 +4300,7 @@ enddo enddo do i=nnt,nct - if (itype(i).ne.10) then + if (itype(i,1).ne.10) then ind=ind+1 do j=1,3 xx=0.0d0 @@ -4223,9 +4326,11 @@ i,(dC(j,i),j=1,3),x(ind),xx enddo do i=nnt,nct - if (itype(i).ne.10) then + mnum=molnum(i) + if (itype(i,1).ne.10 .and. itype(i,mnum).ne.ntyp1_molec(mnum)& + .and.(mnum.ne.5)) ind=ind+1 - xx=vbld(i+nres)**2-vbldsc0(1,itype(i))**2 + xx=vbld(i+nres)**2-vbldsc0(1,itype(i,1))**2 write (iout,'(i5,3f10.5,5x,f10.5,e15.5)') & i,(dC(j,i+nres),j=1,3),x(ind),xx endif @@ -4238,7 +4343,7 @@ i,ind,(d_t_new(j,i),j=1,3),scalar(d_t_new(1,i),dC_old(1,i)) enddo do i=nnt,nct - if (itype(i).ne.10) then + if (itype(i,1).ne.10) then ind=ind+1 write (iout,'(2i5,3f10.5,5x,e15.5)') & i+nres,ind,(d_t_new(j,i+nres),j=1,3),& @@ -4313,7 +4418,9 @@ enddo enddo do k=nnt,nct - if (itype(k).ne.10) then + mnum=molnum(i) + if (itype(i,1).ne.10 .and. itype(i,mnum).ne.ntyp1_molec(mnum)& + .and.(mnum.ne.5)) then ind=ind+1 do j=1,3 gdc(j,i,ind)=GGinv(i,ind)*dC(j,k+nres) @@ -4342,7 +4449,9 @@ enddo enddo do i=nnt,nct - if (itype(i).ne.10) then + mnum=molnum(i) + if (itype(i,1).ne.10 .and. itype(i,mnum).ne.ntyp1_molec(mnum)& + .and.(mnum.ne.5)) then ind=ind+1 do j=1,nbond Cmat(ind,j)=0.0d0 @@ -4359,7 +4468,9 @@ x(ind)=scalar(d_t(1,i),dC(1,i)) enddo do i=nnt,nct - if (itype(i).ne.10) then + mnum=molnum(i) + if (itype(i,1).ne.10 .and. itype(i,mnum).ne.ntyp1_molec(mnum)& + .and.(mnum.ne.5)) then ind=ind+1 x(ind)=scalar(d_t(1,i+nres),dC(1,i+nres)) endif @@ -4373,7 +4484,9 @@ i,ind,(d_t(j,i),j=1,3),x(ind) enddo do i=nnt,nct - if (itype(i).ne.10) then + mnum=molnum(i) + if (itype(i,1).ne.10 .and. itype(i,mnum).ne.ntyp1_molec(mnum)& + .and.(mnum.ne.5)) then ind=ind+1 write (iout,'(2i5,3f10.5,5x,e15.5)') & i+nres,ind,(d_t(j,i+nres),j=1,3),x(ind) @@ -4408,7 +4521,9 @@ enddo enddo do i=nnt,nct - if (itype(i).ne.10) then + mnum=molnum(i) + if (itype(i,1).ne.10 .and. itype(i,mnum).ne.ntyp1_molec(mnum)& + .and.(mnum.ne.5)) then ind=ind+1 do j=1,3 xx=0.0d0 @@ -4429,7 +4544,9 @@ i,ind,(d_t(j,i),j=1,3),x(ind),scalar(d_t(1,i),dC(1,i)) enddo do i=nnt,nct - if (itype(i).ne.10) then + mnum=molnum(i) + if (itype(i,1).ne.10 .and. itype(i,mnum).ne.ntyp1_molec(mnum)& + .and.(mnum.ne.5)) ind=ind+1 write (iout,'(2i5,3f10.5,5x,2e15.5)') & i+nres,ind,(d_t(j,i+nres),j=1,3),x(ind),& @@ -4481,7 +4598,7 @@ !el common /przechowalnia/ GGinv,gdc,Cmat,nbond !el common /przechowalnia/ nbond integer :: max_rattle = 5 - logical :: lprn = .true., lprn1 = .true., not_done + logical :: lprn = .false., lprn1 = .false., not_done real(kind=8) :: tol_rattle = 1.0d-5 integer :: nres2 nres2=2*nres @@ -4495,7 +4612,7 @@ if (lprn) write (iout,*) "RATTLE_BROWN" nbond=nct-nnt do i=nnt,nct - if (itype(i).ne.10) nbond=nbond+1 + if (itype(i,1).ne.10) nbond=nbond+1 enddo ! Make a folded form of the Ginv-matrix ind=0 @@ -4514,7 +4631,7 @@ enddo enddo do k=nnt,nct - if (itype(k).ne.10) then + if (itype(k,1).ne.10) then jj=jj+1 do l=1,3 ind1=ind1+1 @@ -4525,7 +4642,7 @@ enddo enddo do i=nnt,nct - if (itype(i).ne.10) then + if (itype(i,1).ne.10) then ii=ii+1 do j=1,3 ind=ind+1 @@ -4539,7 +4656,7 @@ enddo enddo do k=nnt,nct - if (itype(k).ne.10) then + if (itype(k,1).ne.10) then jj=jj+1 do l=1,3 ind1=ind1+1 @@ -4571,7 +4688,7 @@ enddo enddo do i=nnt,nct - if (itype(i).ne.10) then + if (itype(i,1).ne.10) then ind1=ind1+1 do j=1,3 dC_uncor(j,ind1)=dC(j,i+nres) @@ -4587,7 +4704,7 @@ enddo enddo do k=nnt,nct - if (itype(k).ne.10) then + if (itype(k,1).ne.10) then ind=ind+1 do j=1,3 gdc(j,i,ind)=GGinv(i,ind)*dC_old(j,k+nres) @@ -4602,9 +4719,9 @@ x(ind)=vbld(i+1)**2-vbl**2 enddo do i=nnt,nct - if (itype(i).ne.10) then + if (itype(i,1).ne.10) then ind=ind+1 - x(ind)=vbld(i+nres)**2-vbldsc0(1,itype(i))**2 + x(ind)=vbld(i+nres)**2-vbldsc0(1,itype(i,1))**2 endif enddo if (lprn) then @@ -4621,7 +4738,7 @@ i,ind,(d_t(j,i),j=1,3),scalar(d_t(1,i),dC_old(1,i)) enddo do i=nnt,nct - if (itype(i).ne.10) then + if (itype(i,1).ne.10) then ind=ind+1 write (iout,'(2i5,3f10.5,5x,e15.5)') & i+nres,ind,(d_t(j,i+nres),j=1,3),& @@ -4675,7 +4792,7 @@ enddo enddo do i=nnt,nct - if (itype(i).ne.10) then + if (itype(i,1).ne.10) then ind=ind+1 do j=1,3 xx=0.0d0 @@ -4701,9 +4818,9 @@ i,(dC(j,i),j=1,3),x(ind),xx enddo do i=nnt,nct - if (itype(i).ne.10) then + if (itype(i,1).ne.10) then ind=ind+1 - xx=vbld(i+nres)**2-vbldsc0(1,itype(i))**2 + xx=vbld(i+nres)**2-vbldsc0(1,itype(i,1))**2 write (iout,'(i5,3f10.5,5x,f10.5,e15.5)') & i,(dC(j,i+nres),j=1,3),x(ind),xx endif @@ -4716,7 +4833,7 @@ i,ind,(d_t_new(j,i),j=1,3),scalar(d_t_new(1,i),dC_old(1,i)) enddo do i=nnt,nct - if (itype(i).ne.10) then + if (itype(i,1).ne.10) then ind=ind+1 write (iout,'(2i5,3f10.5,5x,e15.5)') & i+nres,ind,(d_t_new(j,i+nres),j=1,3),& @@ -4766,7 +4883,7 @@ !el common /przechowalnia/ ginvfric logical :: lprn = .false., checkmode = .false. - integer :: i,j,ind,k,nres2,nres6 + integer :: i,j,ind,k,nres2,nres6,mnum nres2=2*nres nres6=6*nres @@ -4789,7 +4906,9 @@ ind=ind+3 enddo do i=nnt,nct - if ((itype(i).ne.10).and.(itype(i).ne.ntyp1)) then + mnum=molnum(i) + if ((itype(i,1).ne.10).and.(itype(i,mnum).ne.ntyp1_molec(mnum))& + .and.(mnum.ne.5)) then do j=1,3 d_t_work(ind+j)=d_t(j,i+nres) enddo @@ -4818,7 +4937,10 @@ ind=ind+3 enddo do i=nnt,nct - if ((itype(i).ne.10).and.(itype(i).ne.ntyp1)) then + mnum=molnum(i) + if ((itype(i,1).ne.10).and.(itype(i,mnum).ne.ntyp1_molec(mnum))& + .and.(mnum.ne.5)) then +! if ((itype(i,1).ne.10).and.(itype(i,1).ne.ntyp1)) then do j=1,3 friction(j,i+nres)=fric_work(ind+j) enddo @@ -4945,7 +5067,7 @@ real(kind=8) :: work(8*2*nres) integer :: iwork(2*nres) !el common /przechowalnia/ ginvfric,Ghalf,fcopy - integer :: ii,iti,k,l,nzero,nres2,nres6,ierr + integer :: ii,iti,k,l,nzero,nres2,nres6,ierr,mnum #ifdef MPI if (fg_rank.ne.king) goto 10 #endif @@ -4968,18 +5090,22 @@ ! Load the friction coefficients corresponding to peptide groups ind1=0 do i=nnt,nct-1 + mnum=molnum(i) ind1=ind1+1 - gamvec(ind1)=gamp + gamvec(ind1)=gamp(mnum) enddo ! Load the friction coefficients corresponding to side chains m=nct-nnt ind=0 - gamsc(ntyp1)=1.0d0 + do j=1,2 + gamsc(ntyp1_molec(j),j)=1.0d0 + enddo do i=nnt,nct + mnum=molnum(i) ind=ind+1 ii = ind+m - iti=itype(i) - gamvec(ii)=gamsc(iabs(iti)) + iti=itype(i,mnum) + gamvec(ii)=gamsc(iabs(iti),mnum) enddo if (surfarea) call sdarea(gamvec) ! if (lprn) then @@ -5174,7 +5300,7 @@ real(kind=8) :: highb2,sig2,forcvec(6*nres),stochforcvec(6*nres) real(kind=8) :: time00 logical :: lprn = .false. - integer :: i,j,ind + integer :: i,j,ind,mnum do i=0,2*nres do j=1,3 @@ -5221,7 +5347,9 @@ do j=1,3 ff(j)=ff(j)+force(j,i) enddo - if (itype(i+1).ne.ntyp1) then +! if (itype(i+1,1).ne.ntyp1) then + mnum=molnum(i) + if (itype(i+1,mnum).ne.ntyp1_molec(mnum)) then do j=1,3 stochforc(j,i)=stochforc(j,i)+force(j,i+nres+1) ff(j)=ff(j)+force(j,i+nres+1) @@ -5232,7 +5360,10 @@ stochforc(j,0)=ff(j)+force(j,nnt+nres) enddo do i=nnt,nct - if ((itype(i).ne.10).and.(itype(i).ne.ntyp1)) then + mnum=molnum(i) + if ((itype(i,1).ne.10).and.(itype(i,mnum).ne.ntyp1_molec(mnum))& + .and.(mnum.ne.5)) then +! if ((itype(i,1).ne.10).and.(itype(i,1).ne.ntyp1)) then do j=1,3 stochforc(j,i+nres)=force(j,i+nres) enddo @@ -5250,7 +5381,10 @@ ind=ind+3 enddo do i=nnt,nct - if ((itype(i).ne.10).and.(itype(i).ne.ntyp1)) then + mnum=molnum(i) + if ((itype(i,1).ne.10).and.(itype(i,mnum).ne.ntyp1_molec(mnum))& + .and.(mnum.ne.5)) then +! if ((itype(i,1).ne.10).and.(itype(i,1).ne.ntyp1)) then do j=1,3 stochforcvec(ind+j)=stochforc(j,i+nres) enddo @@ -5341,7 +5475,7 @@ real(kind=8),parameter :: twosix = 1.122462048309372981d0 logical :: lprn = .false. real(kind=8) :: probe,area,ratio - integer :: i,j,ind,iti + integer :: i,j,ind,iti,mnum ! ! determine new friction coefficients every few SD steps ! @@ -5355,12 +5489,14 @@ enddo ! Load peptide group radii do i=nnt,nct-1 - radius(i)=pstok + mnum=molnum(i) + radius(i)=pstok(mnum) enddo ! Load side chain radii do i=nnt,nct - iti=itype(i) - radius(i+nres)=restok(iti) + mnum=molnum(i) + iti=itype(i,mnum) + radius(i+nres)=restok(iti,mnum) enddo ! do i=1,2*nres ! write (iout,*) "i",i," radius",radius(i) @@ -5386,7 +5522,8 @@ ind=ind+1 gamvec(ind) = ratio * gamvec(ind) enddo - stdforcp(i)=stdfp*dsqrt(gamvec(ind)) + mnum=molnum(i) + stdforcp(i)=stdfp(mnum)*dsqrt(gamvec(ind)) if (lprn) write (iout,'(2f10.5)') gamvec(ind),stdforcp(i) endif enddo @@ -5400,7 +5537,8 @@ ind=ind+1 gamvec(ind) = ratio * gamvec(ind) enddo - stdforcsc(i)=stdfsc(itype(i))*dsqrt(gamvec(ind)) + mnum=molnum(i) + stdforcsc(i)=stdfsc(itype(i,mnum),mnum)*dsqrt(gamvec(ind)) if (lprn) write (iout,'(2f10.5)') gamvec(ind),stdforcsc(i) endif enddo @@ -5505,11 +5643,11 @@ logical :: omit(maxarc) ! ! include 'sizes.i' - maxatm = 2*nres !maxres2 maxres2=2*maxres - maxlight = 8*maxatm - maxbnd = 2*maxatm - maxang = 3*maxatm - maxtors = 4*maxatm +! maxatm = 2*nres !maxres2 maxres2=2*maxres +! maxlight = 8*maxatm +! maxbnd = 2*maxatm +! maxang = 3*maxatm +! maxtors = 4*maxatm ! ! zero out the surface area for the sphere of interest !