From df8f961ba4a448a9a682f9a7758196d2a3a42373 Mon Sep 17 00:00:00 2001 From: Cezary Czaplewski Date: Sun, 19 Apr 2020 08:39:54 +0200 Subject: [PATCH] Adam's changes --- source/cluster/wham/src-HCD/readpdb.F | 8 ++- source/unres/src-HCD-5D/COMMON.INTERACT | 8 +-- source/unres/src-HCD-5D/DIMENSIONS | 5 +- source/unres/src-HCD-5D/MD_A-MTS.F | 17 ++++- .../unres/src-HCD-5D/Makefile_MPICH_ifort-okeanos | 26 +++++-- source/unres/src-HCD-5D/cartprint.f | 4 +- source/unres/src-HCD-5D/contact.f | 8 +-- source/unres/src-HCD-5D/energy_p_new_barrier.F | 7 +- source/unres/src-HCD-5D/gen_rand_conf.F | 73 ++++++++++---------- source/unres/src-HCD-5D/geomout.F | 4 +- source/unres/src-HCD-5D/int_from_cart.F | 4 +- source/unres/src-HCD-5D/make_xx_list.F | 10 +-- source/unres/src-HCD-5D/readpdb-mult.F | 24 ++++--- source/unres/src-HCD-5D/readpdb.F | 4 +- source/unres/src-HCD-5D/readrtns_CSA.F | 25 ++++++- source/unres/src-HCD-5D/stochfric.F | 2 +- source/wham/src-HCD/readpdb.F | 8 ++- 17 files changed, 156 insertions(+), 81 deletions(-) diff --git a/source/cluster/wham/src-HCD/readpdb.F b/source/cluster/wham/src-HCD/readpdb.F index 09e6e4e..a7bb52b 100644 --- a/source/cluster/wham/src-HCD/readpdb.F +++ b/source/cluster/wham/src-HCD/readpdb.F @@ -13,7 +13,7 @@ C geometry. include 'COMMON.NAMES' include 'COMMON.CONTROL' integer i,j,ibeg,ishift1,ires,iii,ires_old,ishift,ity - logical lprn /.false./,fail + logical lprn /.false./,fail,sccalc double precision e1(3),e2(3),e3(3) double precision dcj,efree_temp character*3 seq,res @@ -30,6 +30,7 @@ c write (2,*) "UNRES_PDB",unres_pdb ires=0 ires_old=0 iii=0 + sccalc=.false. lsecondary=.false. nhfrag=0 nbfrag=0 @@ -73,11 +74,13 @@ c write (2,*) "UNRES_PDB",unres_pdb call sccenter(ires,iii,sccor) endif iii=0 + sccalc=.true. endif ! Read free energy if (index(card,"FREE ENERGY").gt.0) read(card(35:),*) efree_temp ! Fish out the ATOM cards. if (index(card(1:4),'ATOM').gt.0) then + sccalc=.false. read (card(12:16),*) atom c write (2,'(a)') card ! write (iout,*) "! ",atom," !",ires @@ -101,6 +104,7 @@ c write (2,'(a)') card call sccenter(ires_old,iii,sccor) endif iii=0 + sccalc=.true. endif ! Start new residue. if (res.eq.'Cl-' .or. res.eq.'Na+') then @@ -221,7 +225,7 @@ C endif !unres_pdb endif !itype.eq.ntyp1 enddo C Calculate the CM of the last side chain. - call sccenter(ires,iii,sccor) + if (.not.sccalc) call sccenter(ires,iii,sccor) nsup=nres nstart_sup=1 if (itype(nres).ne.10) then diff --git a/source/unres/src-HCD-5D/COMMON.INTERACT b/source/unres/src-HCD-5D/COMMON.INTERACT index 6db43d0..8e4e063 100644 --- a/source/unres/src-HCD-5D/COMMON.INTERACT +++ b/source/unres/src-HCD-5D/COMMON.INTERACT @@ -22,10 +22,10 @@ & iatsc_s,iatsc_e,iatel_s,iatel_e,iatel_s_vdw,iatel_e_vdw, & iatscp_s,iatscp_e,ispp,iscp C 3/26/20 Interaction lists - integer newcontlisti(200*maxres),newcontlistj(200*maxres), - & newcontlistppi(200*maxres),newcontlistppj(200*maxres), - & newcontlistpp_vdwi(200*maxres),newcontlistpp_vdwj(200*maxres), - & newcontlistscpi(200*maxres),newcontlistscpj(200*maxres), + integer newcontlisti(2000*maxres),newcontlistj(2000*maxres), + & newcontlistppi(2000*maxres),newcontlistppj(2000*maxres), + & newcontlistpp_vdwi(2000*maxres),newcontlistpp_vdwj(2000*maxres), + & newcontlistscpi(2000*maxres),newcontlistscpj(2000*maxres), & g_listscsc_start,g_listscsc_end,g_listpp_start,g_listpp_end, & g_listpp_vdw_start,g_listpp_vdw_end,g_listscp_start,g_listscp_end common /interact_list/newcontlisti,newcontlistj,g_listscsc_start, diff --git a/source/unres/src-HCD-5D/DIMENSIONS b/source/unres/src-HCD-5D/DIMENSIONS index 113d3d2..75287f5 100644 --- a/source/unres/src-HCD-5D/DIMENSIONS +++ b/source/unres/src-HCD-5D/DIMENSIONS @@ -16,7 +16,7 @@ C Max. number of coarse-grain processors parameter (max_cg_procs=maxprocs) C Max. number of AA residues integer maxres - parameter (maxres=3300) + parameter (maxres=5000) C Max. number of AA residues per chain integer maxres_chain parameter (maxres_chain=1200) @@ -40,7 +40,8 @@ C Max. number of groups of interactions that a given SC is involved in C Max. number of derivatives of virtual-bond and side-chain vectors in theta C or phi. integer maxdim - parameter (maxdim=(maxres_chain-1)*(maxres_chain-2)/2) +c parameter (maxdim=(maxres_chain-1)*(maxres_chain-2)/2) + parameter (maxdim=(maxres-1)*(maxres-2)/2) C Max. number of SC contacts integer maxcont parameter (maxcont=12*maxres) diff --git a/source/unres/src-HCD-5D/MD_A-MTS.F b/source/unres/src-HCD-5D/MD_A-MTS.F index 4498b4a..d82cf17 100644 --- a/source/unres/src-HCD-5D/MD_A-MTS.F +++ b/source/unres/src-HCD-5D/MD_A-MTS.F @@ -1965,12 +1965,12 @@ c 8/22/17 AL Loop to produce a low-energy random conformation cycle endif endif -#ifdef SEARCHSC if (me.eq.king.or..not.out1file) then write (iout,*) "Energies after removing overlaps" call etotal(energia(0)) call enerprint(energia(0)) endif +#ifdef SEARCHSC ! Search for better SC rotamers if requested if (searchsc) then call sc_move(2,nres-1,10,1d10,nft_sc,etot) @@ -1987,6 +1987,21 @@ c 8/22/17 AL Loop to produce a low-energy random conformation iranconf=1 goto 122 endif + else +! Remove SC overlaps if requested + if (overlapsc) then + write (iout,*) 'Calling OVERLAP_SC' + call overlap_sc(fail) + if (fail) then + write (iout,*) + & "Failed to remove overlap" + endif + endif + if (me.eq.king.or..not.out1file) then + write (iout,*) "Energies after removing overlaps" + call etotal(energia(0)) + call enerprint(energia(0)) + endif endif C 8/22/17 AL Minimize initial structure if (dccart) then diff --git a/source/unres/src-HCD-5D/Makefile_MPICH_ifort-okeanos b/source/unres/src-HCD-5D/Makefile_MPICH_ifort-okeanos index db000f4..b851430 100644 --- a/source/unres/src-HCD-5D/Makefile_MPICH_ifort-okeanos +++ b/source/unres/src-HCD-5D/Makefile_MPICH_ifort-okeanos @@ -4,11 +4,11 @@ FC = ftn -#OPT = -O3 -ip -mcmodel=medium -shared-intel -dynamic -OPT = -g -CA -CB -mcmodel=medium -shared-intel -dynamic +OPT = -O3 -ip -mcmodel=medium -shared-intel -dynamic +#OPT = -g -CA -CB -mcmodel=medium -shared-intel -dynamic OPT2 = -g -O0 -mcmodel=medium -shared-intel -dynamic -#OPTE = -c -O3 -ipo -mcmodel=medium -shared-intel -dynamic -OPTE = ${OPT} -c +OPTE = -c -O3 -ipo -mcmodel=medium -shared-intel -dynamic +#OPTE = ${OPT} -c FFLAGS = -c ${OPT} -I$(INSTALL_DIR)/include #FFLAGS1 = -c -g -CA -CB -I$(INSTALL_DIR)/include @@ -94,6 +94,24 @@ E0LL2Y_DFA: ${object} dfa.o xdrf/libxdrf.a ${FC} ${FFLAGS} cinfo.f ${FC} ${OPT} ${object} dfa.o cinfo.o ${LIBS} -o ${BIN} +E0LL2Y5D: CPPFLAGS = -DPROCOR -DLINUX -DPGI -DAMD64 -DUNRES -DISNAN -DMP -DMPI \ + -DSPLITELE -DLANG0 -DFIVEDIAG +E0LL2Y5D: BIN = ~/bin/unres_ifort_MPICH-okeanos_E0LL2Y-HCD5.exe +E0LL2Y5D: ${object} xdrf/libxdrf.a + gcc -o compinfo compinfo.c + ./compinfo | true + ${FC} ${FFLAGS} cinfo.f + ${FC} ${OPT} ${object} cinfo.o ${LIBS} -o ${BIN} + +E0LL2Y5D_DFA: CPPFLAGS = -DPROCOR -DLINUX -DPGI -DAMD64 -DUNRES -DISNAN -DMP -DMPI \ + -DSPLITELE -DLANG0 -DFIVEDIAG -DDFA +E0LL2Y5D_DFA: BIN = ~/bin/unres_ifort_MPICH-okeanos_E0LL2Y-HCD5-DFA.exe +E0LL2Y5D_DFA: ${object} dfa.o xdrf/libxdrf.a + gcc -o compinfo compinfo.c + ./compinfo | true + ${FC} ${FFLAGS} cinfo.f + ${FC} ${OPT} ${object} dfa.o cinfo.o ${LIBS} -o ${BIN} + NEWCORR: CPPFLAGS = -DPROCOR -DLINUX -DPGI -DAMD64 -DUNRES -DISNAN -DMP -DMPI \ -DSPLITELE -DLANG0 -DNEWCORR -DCORRCD #-DFOURBODY #-DMYGAUSS #-DTIMING NEWCORR: BIN = ~/bin/unres_ifort_MPICH-okeanos_SC-HCD.exe diff --git a/source/unres/src-HCD-5D/cartprint.f b/source/unres/src-HCD-5D/cartprint.f index 9f7eacb..339a89d 100644 --- a/source/unres/src-HCD-5D/cartprint.f +++ b/source/unres/src-HCD-5D/cartprint.f @@ -13,8 +13,8 @@ enddo 100 format (//' alpha-carbon coordinates ', & ' centroid coordinates'/ - 1 ' ', 6X,'X',11X,'Y',11X,'Z', + 1 ' ', 7X,'X',11X,'Y',11X,'Z', & 10X,'X',11X,'Y',11X,'Z') - 110 format (a,'(',i3,')',6f12.5) + 110 format (a,'(',i4,')',6f12.5) return end diff --git a/source/unres/src-HCD-5D/contact.f b/source/unres/src-HCD-5D/contact.f index 695446f..f986380 100644 --- a/source/unres/src-HCD-5D/contact.f +++ b/source/unres/src-HCD-5D/contact.f @@ -38,7 +38,7 @@ c print *,'rcomp=',rcomp,' dist=',dist(nres+i,nres+j) i2=icont(2,i) it1=itype(i1) it2=itype(i2) - write (iout,'(i3,2x,a,i4,2x,a,i4)') + write (iout,'(i5,2x,a,i5,2x,a,i4)') & i,restyp(it1),i1,restyp(it2),i2 enddo endif @@ -137,7 +137,7 @@ c print *,'nnt=',nnt,' nct=',nct i2=icont(2,i) it1=itype(i1) it2=itype(i2) - write (iout,'(i3,2x,a,i4,2x,a,i4)') + write (iout,'(i5,2x,a,i5,2x,a,i4)') & i,restyp(it1),i1,restyp(it2),i2 enddo endif @@ -184,8 +184,8 @@ c enddo ii1=iharp(3,i) jj1=iharp(4,i) write (iout,*) - write (iout,'(20(a,i3,1x))') (restyp(itype(k)),k,k=i1,ii1) - write (iout,'(20(a,i3,1x))') (restyp(itype(k)),k,k=j1,jj1,-1) + write (iout,'(20(a,i5,1x))') (restyp(itype(k)),k,k=i1,ii1) + write (iout,'(20(a,i5,1x))') (restyp(itype(k)),k,k=j1,jj1,-1) c do k=jj1,j1,-1 c write (iout,'(a,i3,$)') restyp(itype(k)),k c enddo diff --git a/source/unres/src-HCD-5D/energy_p_new_barrier.F b/source/unres/src-HCD-5D/energy_p_new_barrier.F index ddc2a4d..07cdebb 100644 --- a/source/unres/src-HCD-5D/energy_p_new_barrier.F +++ b/source/unres/src-HCD-5D/energy_p_new_barrier.F @@ -2053,6 +2053,9 @@ C derivatives. sigsq=1.0D0/sigsq sig=sig0ij*dsqrt(sigsq) rij_shift=1.0D0/rij-sig+sig0ij +c if (energy_dec) +c & write (iout,*) "rij",1.0d0/rij," rij_shift",rij_shift, +c & " sig",sig," sig0ij",sig0ij c for diagnostics; uncomment c rij_shift=1.2*sig0ij C I hate to put IF's in the loops, but here don't have another choice!!!! @@ -2061,7 +2064,7 @@ C I hate to put IF's in the loops, but here don't have another choice!!!! cd write (iout,'(2(a3,i3,2x),17(0pf7.3))') cd & restyp(itypi),i,restyp(itypj),j, cd & rij_shift,1.0D0/rij,sig,sig0ij,sigsq,1-dsqrt(sigsq) - return +c return endif sigder=-sig*sigsq c--------------------------------------------------------------- @@ -2093,7 +2096,7 @@ c & " eps3rt",eps3rt," eps1",eps1," e1",e1," e2",e2 & evdwij endif - if (energy_dec) write (iout,'(a,2i5,3f10.5)') + if (energy_dec) write (iout,'(a,2i5,2f10.5,e15.5)') & 'r sss evdw',i,j,1.0d0/rij,sss,evdwij C Calculate gradient components. diff --git a/source/unres/src-HCD-5D/gen_rand_conf.F b/source/unres/src-HCD-5D/gen_rand_conf.F index 557f435..b5e5595 100644 --- a/source/unres/src-HCD-5D/gen_rand_conf.F +++ b/source/unres/src-HCD-5D/gen_rand_conf.F @@ -780,7 +780,7 @@ c overlapping residues left, or false otherwise (success) call overlap_sc_list(ioverlap,ioverlap_last) if (ioverlap_last.gt.0) then write (iout,*) '#OVERLAPing residues ',ioverlap_last - write (iout,'(20i4)') (ioverlap(k),k=1,ioverlap_last) + write (iout,'(18i5)') (ioverlap(k),k=1,ioverlap_last) had_overlaps=.true. endif @@ -845,13 +845,15 @@ c overlapping residues left, or false otherwise (success) integer ioverlap(maxres),ioverlap_last data redfac /0.5D0/ -c write (iout,*) "overlap_sc_list" + write (iout,*) "overlap_sc_list" +c write(iout,*) "iatsc_s",iatsc_s," iatsc_e",iatsc_e + write(iout,*) "nnt",nnt," nct",nct ioverlap_last=0 C Check for SC-SC overlaps and mark residues c print *,'>>overlap_sc nnt=',nnt,' nct=',nct ind=0 -c write(iout,*) "iatsc_s",iatsc_s," iatsc_e",iatsc_e - do i=iatsc_s,iatsc_e +c do i=iatsc_s,iatsc_e + do i=nnt,nct itypi=iabs(itype(i)) itypi1=iabs(itype(i+1)) if (itypi.eq.ntyp1) cycle @@ -863,12 +865,13 @@ c write(iout,*) "iatsc_s",iatsc_s," iatsc_e",iatsc_e dzi=dc_norm(3,nres+i) dsci_inv=dsc_inv(itypi) c - do iint=1,nint_gr(i) - do j=istart(i,iint),iend(i,iint) +c do iint=1,nint_gr(i) +c do j=istart(i,iint),iend(i,iint) + do j=i+1,nct ind=ind+1 itypj=iabs(itype(j)) if (itypj.eq.ntyp1) cycle -c write (iout,*) "i,j",i,j," itypi,itypj",itypi,itypj +c write (iout,*) "i,j",i,j," itypi,itypj",itypi,itypj dscj_inv=dsc_inv(itypj) sig0ij=sigma(itypi,itypj) chi1=chi(itypi,itypj) @@ -880,13 +883,13 @@ c write (iout,*) "i,j",i,j," itypi,itypj",itypi,itypj alf1=alp(itypi) alf2=alp(itypj) alf12=0.5D0*(alf1+alf2) - if (j.gt.i+1) then - rcomp=sigmaii(itypi,itypj) - else - rcomp=sigma(itypi,itypj) - endif -c write (iout,'(2(a3,2i3),a3,2f10.5)'), -c & ' i=',i,iti,' j=',j,itj,' d=',dist(nres+i,nres+j) + if (j.gt.i+1) then + rcomp=sigmaii(itypi,itypj) + else + rcomp=sigma(itypi,itypj) + endif +c write (iout,'(2(a3,2i5),a3,2f10.5)'), +c & ' i=',i,itypi,' j=',j,itypj,' d=',dist(nres+i,nres+j) c & ,rcomp xj=c(1,nres+j)-xi yj=c(2,nres+j)-yi @@ -905,28 +908,28 @@ c write (iout,*) "sigsq",sigsq sigsq=1.0D0/sigsq sig=sig0ij*dsqrt(sigsq) rij_shift=1.0D0/rij-sig+sig0ij -c write (iout,*) "rij_shift",rij_shift -c if ( 1.0/rij .lt. redfac*rcomp .or. -c & rij_shift.le.0.0D0 ) then -c write (iout,'(a,i3,a,i3,a,f10.5,a,3f10.5)') -c & 'overlap SC-SC: i=',i,' j=',j, -c & ' dist=',dist(nres+i,nres+j),' rcomp=', -c & rcomp,1.0/rij,rij_shift - if ( rij_shift.le.0.0D0 ) then -c write (iout,*) "overlap",i,j - ioverlap_last=ioverlap_last+1 - ioverlap(ioverlap_last)=i - do k=1,ioverlap_last-1 - if (ioverlap(k).eq.i) ioverlap_last=ioverlap_last-1 +c write (iout,*) "rij",1.0d0/rij," rij_shift",rij_shift, +c & " sig",sig," sig0ij",sig0ij +c if ( rij_shift.le.0.0D0 ) then + if ( rij_shift/sig0ij.le.0.1D0 ) then +c write (iout,*) "overlap",i,j + write (iout,'(a,i5,a,i5,a,f10.5,a,3f10.5)') + & 'overlap SC-SC: i=',i,' j=',j, + & ' dist=',dist(nres+i,nres+j),' rcomp=', + & rcomp,1.0/rij,rij_shift + ioverlap_last=ioverlap_last+1 + ioverlap(ioverlap_last)=i + do k=1,ioverlap_last-1 + if (ioverlap(k).eq.i) ioverlap_last=ioverlap_last-1 + enddo + ioverlap_last=ioverlap_last+1 + ioverlap(ioverlap_last)=j + do k=1,ioverlap_last-1 + if (ioverlap(k).eq.j) ioverlap_last=ioverlap_last-1 + enddo + endif enddo - ioverlap_last=ioverlap_last+1 - ioverlap(ioverlap_last)=j - do k=1,ioverlap_last-1 - if (ioverlap(k).eq.j) ioverlap_last=ioverlap_last-1 - enddo - endif - enddo - enddo +c enddo enddo return end diff --git a/source/unres/src-HCD-5D/geomout.F b/source/unres/src-HCD-5D/geomout.F index dd45a7d..d1a3a87 100644 --- a/source/unres/src-HCD-5D/geomout.F +++ b/source/unres/src-HCD-5D/geomout.F @@ -224,11 +224,11 @@ c------------------------------------------------------------------------ include 'COMMON.TORSION' integer i,iti write (iout,'(/a)') 'Geometry of the virtual chain.' - write (iout,'(7a)') ' Res ',' d',' Theta', + write (iout,'(7a)') ' Res ',' d',' Theta', & ' Phi',' Dsc',' Alpha',' Omega' do i=1,nres iti=itype(i) - write (iout,'(a3,i4,6f10.3)') restyp(iti),i,vbld(i), + write (iout,'(a3,i5,6f10.3)') restyp(iti),i,vbld(i), & rad2deg*theta(i),rad2deg*phi(i),vbld(nres+i),rad2deg*alph(i), & rad2deg*omeg(i) enddo diff --git a/source/unres/src-HCD-5D/int_from_cart.F b/source/unres/src-HCD-5D/int_from_cart.F index b36fae4..ded15f9 100644 --- a/source/unres/src-HCD-5D/int_from_cart.F +++ b/source/unres/src-HCD-5D/int_from_cart.F @@ -227,8 +227,8 @@ c--------------------------------------------------------------------------- integer i,j,ires,nscat double precision sccor(3,50) double precision sccmj - write (2,*) "sccenter",ires,nscat - call flush(2) +c write (2,*) "sccenter",ires,nscat +c call flush(2) do j=1,3 sccmj=0.0D0 do i=1,nscat diff --git a/source/unres/src-HCD-5D/make_xx_list.F b/source/unres/src-HCD-5D/make_xx_list.F index a83740f..a69ee13 100644 --- a/source/unres/src-HCD-5D/make_xx_list.F +++ b/source/unres/src-HCD-5D/make_xx_list.F @@ -12,7 +12,7 @@ double precision xi,yi,zi,xj,yj,zj,xj_safe,yj_safe,zj_safe, & xj_temp,yj_temp,zj_temp double precision dist_init, dist_temp,r_buff_list - integer contlisti(200*maxres),contlistj(200*maxres) + integer contlisti(2000*maxres),contlistj(2000*maxres) ! integer :: newcontlisti(200*nres),newcontlistj(200*nres) integer i,j,itypi,itypj,subchap,xshift,yshift,zshift,iint, & ilist_sc,g_ilist_sc @@ -164,12 +164,12 @@ c write(iout,*) "before bcast",g_ilist_sc double precision xi,yi,zi,xj,yj,zj,xj_safe,yj_safe,zj_safe, & xj_temp,yj_temp,zj_temp double precision dist_init, dist_temp,r_buff_list - integer contlistscpi(200*maxres),contlistscpj(200*maxres) + integer contlistscpi(2000*maxres),contlistscpj(2000*maxres) ! integer :: newcontlistscpi(200*nres),newcontlistscpj(200*nres) integer i,j,itypi,itypj,subchap,xshift,yshift,zshift,iint, & ilist_scp,g_ilist_scp integer displ(0:max_fg_procs),i_ilist_scp(0:max_fg_procs),ierr - integer contlistscpi_f(200*maxres),contlistscpj_f(200*maxres) + integer contlistscpi_f(2000*maxres),contlistscpj_f(2000*maxres) integer ilist_scp_first,ifirstrun,g_ilist_sc ! print *,"START make_SC" #ifdef DEBUG @@ -349,7 +349,7 @@ c write(iout,*) "before bcast",g_ilist_sc & xmedi,ymedi,zmedi double precision dx_normi,dy_normi,dz_normi,dxj,dyj,dzj, & dx_normj,dy_normj,dz_normj - integer contlistpp_vdwi(200*maxres),contlistpp_vdwj(200*maxres) + integer contlistpp_vdwi(2000*maxres),contlistpp_vdwj(2000*maxres) ! integer :: newcontlistppi(200*nres),newcontlistppj(200*nres) integer i,j,itypi,itypj,subchap,xshift,yshift,zshift,iint, & ilist_pp_vdw,g_ilist_pp_vdw @@ -509,7 +509,7 @@ c write(iout,*) "before bcast",g_ilist_sc & xmedi,ymedi,zmedi double precision dx_normi,dy_normi,dz_normi,dxj,dyj,dzj, & dx_normj,dy_normj,dz_normj - integer contlistppi(200*maxres),contlistppj(200*maxres) + integer contlistppi(2000*maxres),contlistppj(2000*maxres) ! integer :: newcontlistppi(200*nres),newcontlistppj(200*nres) integer i,j,itypi,itypj,subchap,xshift,yshift,zshift,iint, & ilist_pp,g_ilist_pp diff --git a/source/unres/src-HCD-5D/readpdb-mult.F b/source/unres/src-HCD-5D/readpdb-mult.F index cc9aec9..40bf9ac 100644 --- a/source/unres/src-HCD-5D/readpdb-mult.F +++ b/source/unres/src-HCD-5D/readpdb-mult.F @@ -19,7 +19,7 @@ C geometry. double precision sccor(3,50) double precision e1(3),e2(3),e3(3) integer rescode,iterter(maxres),cou - logical fail + logical fail,sccalc integer i,j,iii,ires,ires_old,ishift,ishift1,ibeg double precision dcj,efree_temp bfac=0.0d0 @@ -32,6 +32,7 @@ C geometry. nhfrag=0 nbfrag=0 iii=0 + sccalc=.false. do read (ipdbin,'(a80)',end=10) card c write (iout,'(a)') card @@ -72,11 +73,13 @@ c write (iout,'(a)') card call sccenter(ires,iii,sccor) endif iii=0 + sccalc=.true. endif ! Read free energy if (index(card,"FREE ENERGY").gt.0) read(card(35:),*) efree_temp ! Fish out the ATOM cards. if (index(card(1:4),'ATOM').gt.0) then + sccalc=.false. read (card(12:16),*) atom c write (2,'(a)') card c write (iout,*) "ibeg",ibeg @@ -101,6 +104,7 @@ c write (iout,*) "Calculating sidechain center iii",iii call sccenter(ires_old,iii,sccor) endif iii=0 + sccalc=.true. endif ! Start new residue. if (res.eq.'Cl-' .or. res.eq.'Na+') then @@ -200,6 +204,7 @@ C 2/15/2013 by Adam: corrected insertion of the last dummy residue if (dcj.eq.0) dcj=1.23591524223 c(j,i)=c(j,i-1)+dcj c(j,nres+i)=c(j,i) + dC(j,i)=c(j,i) enddo endif !unres_pdb else !itype(i+1).eq.ntyp1 @@ -220,6 +225,7 @@ C 2/15/2013 by Adam: corrected insertion of the first dummy residue if (dcj.eq.0) dcj=1.23591524223 c(j,i)=c(j,i+1)-dcj c(j,nres+i)=c(j,i) + dC(j,i)=c(j,i) enddo endif !unres_pdb endif !itype(i+1).eq.ntyp1 @@ -227,6 +233,7 @@ C 2/15/2013 by Adam: corrected insertion of the first dummy residue enddo write (iout,*) "After loop in readpbd" C Calculate the CM of the last side chain. + if (.not. sccalc) then if (unres_pdb) then do j=1,3 dc(j,ires)=sccor(j,iii) @@ -235,6 +242,7 @@ C Calculate the CM of the last side chain. c write (iout,*) "Calling sccenter iii",iii call sccenter(ires,iii,sccor) endif + endif nsup=nres nstart_sup=1 if (itype(nres).ne.10) then @@ -296,14 +304,14 @@ C Calculate internal coordinates. write (iout,'(/a)') & "Cartesian coordinates of the reference structure" write (iout,'(a,3(3x,a5),5x,3(3x,a5))') - & "Residue","X(CA)","Y(CA)","Z(CA)","X(SC)","Y(SC)","Z(SC)" + & "Residue ","X(CA)","Y(CA)","Z(CA)","X(SC)","Y(SC)","Z(SC)" do ires=1,nres - write (iout,'(a3,1x,i3,3f8.3,5x,3f8.3)') + write (iout,'(a3,1x,i4,3f8.3,5x,3f8.3)') & restyp(itype(ires)),ires,(c(j,ires),j=1,3), & (c(j,ires+nres),j=1,3) enddo - endif call flush(iout) + endif c write(iout,*)"before int_from_cart nres",nres call int_from_cart(.true.,.false.) do i=1,nres @@ -338,9 +346,9 @@ C Copy the coordinates to reference coordinates enddo 100 format (//' alpha-carbon coordinates ', & ' centroid coordinates'/ - 1 ' ', 6X,'X',11X,'Y',11X,'Z', + 1 ' ', 7X,'X',11X,'Y',11X,'Z', & 10X,'X',11X,'Y',11X,'Z') - 110 format (a,'(',i3,')',6f12.5) + 110 format (a,'(',i4,')',6f12.5) cc enddiag do j=1,nbfrag do i=1,4 @@ -636,9 +644,9 @@ C Calculate internal coordinates. write (iout,'(/a)') & "Cartesian coordinates of the reference structure" write (iout,'(a,3(3x,a5),5x,3(3x,a5))') - & "Residue","X(CA)","Y(CA)","Z(CA)","X(SC)","Y(SC)","Z(SC)" + & "Residue ","X(CA)","Y(CA)","Z(CA)","X(SC)","Y(SC)","Z(SC)" do ires=1,nres - write (iout,'(a3,1x,i3,3f8.3,5x,3f8.3)') + write (iout,'(a3,1x,i4,3f8.3,5x,3f8.3)') & restyp(itype(ires)),ires,(c(j,ires),j=1,3), & (c(j,ires+nres),j=1,3) enddo diff --git a/source/unres/src-HCD-5D/readpdb.F b/source/unres/src-HCD-5D/readpdb.F index 1ffc884..1190bb1 100644 --- a/source/unres/src-HCD-5D/readpdb.F +++ b/source/unres/src-HCD-5D/readpdb.F @@ -585,9 +585,9 @@ C Calculate internal coordinates. write (iout,'(/a)') & "Cartesian coordinates of the reference structure" write (iout,'(a,3(3x,a5),5x,3(3x,a5))') - & "Residue","X(CA)","Y(CA)","Z(CA)","X(SC)","Y(SC)","Z(SC)" + & "Residue ","X(CA)","Y(CA)","Z(CA)","X(SC)","Y(SC)","Z(SC)" do ires=1,nres - write (iout,'(a3,1x,i3,3f8.3,5x,3f8.3)') + write (iout,'(a3,1x,i4,3f8.3,5x,3f8.3)') & restyp(itype(ires)),ires,(c(j,ires),j=1,3), & (c(j,ires+nres),j=1,3) enddo diff --git a/source/unres/src-HCD-5D/readrtns_CSA.F b/source/unres/src-HCD-5D/readrtns_CSA.F index 0320484..c51e45e 100644 --- a/source/unres/src-HCD-5D/readrtns_CSA.F +++ b/source/unres/src-HCD-5D/readrtns_CSA.F @@ -3188,6 +3188,8 @@ c & constr_homology enddo lim_odl=ii endif +c write (iout,*) "Distance restraints set" +c call flush(iout) c c Theta, dihedral and SC retraints c @@ -3228,6 +3230,8 @@ c sigma_dih(k,i)=sigma_dih(k,i)*sigma_dih(k,i) enddo lim_dih=nct-nnt-2 endif +c write (iout,*) "Dihedral angle restraints set" +c call flush(iout) if (waga_theta.gt.0.0d0) then c open (ientin,file=tpl_k_sigma_theta,status='old') @@ -3263,6 +3267,8 @@ c rescore(k,i-2) ! right expression ? c sigma_theta(k,i)=sigma_theta(k,i)*sigma_theta(k,i) enddo endif +c write (iout,*) "Angle restraints set" +c call flush(iout) if (waga_d.gt.0.0d0) then c open (ientin,file=tpl_k_sigma_d,status='old') @@ -3298,16 +3304,23 @@ c read (ientin,*) sigma_d(k,i) ! 1st variant enddo endif enddo +c write (iout,*) "SC restraints set" +c call flush(iout) c c remove distance restraints not used in any model from the list c shift data in all arrays c +c write (iout,*) "waga_dist",waga_dist," nnt",nnt," nct",nct if (waga_dist.ne.0.0d0) then ii=0 liiflag=.true. do i=nnt,nct-2 do j=i+2,nct ii=ii+1 +c if (idomain(k,i).eq.idomain(k,j).and.idomain(k,i).ne.0 +c & .and. distal.le.dist2_cut ) then +c write (iout,*) "i",i," j",j," ii",ii +c call flush(iout) if (ii_in_use(ii).eq.0.and.liiflag) then liiflag=.false. iistart=ii @@ -3332,17 +3345,23 @@ c enddo ii=ii-iishift lim_odl=lim_odl-iishift +c endif endif enddo enddo endif - +c write (iout,*) "Removing distances completed" +c call flush(iout) endif ! .not. klapaucjusz if (constr_homology.gt.0) call homology_partition +c write (iout,*) "After homology_partition" +c call flush(iout) if (constr_homology.gt.0) call init_int_table -c write (iout,*) "ithet_start =",ithet_start,"ithet_end =",ithet_end -c write (iout,*) "loc_start =",loc_start,"loc_end =",loc_end +c write (iout,*) "After init_int_table" +c call flush(iout) +c write (iout,*) "ithet_start =",ithet_start,"ithet_end =",ithet_end +c write (iout,*) "loc_start =",loc_start,"loc_end =",loc_end c c Print restraints c diff --git a/source/unres/src-HCD-5D/stochfric.F b/source/unres/src-HCD-5D/stochfric.F index c8a3a0d..368cf97 100644 --- a/source/unres/src-HCD-5D/stochfric.F +++ b/source/unres/src-HCD-5D/stochfric.F @@ -25,7 +25,7 @@ include 'COMMON.IOUNITS' #ifdef FIVEDIAG integer iposc,ichain,n,innt,inct - double precision v_work(3,maxres2),vvec(maxres2_chain),rs(maxres2) + double precision v_work(3,maxres2),vvec(maxres2),rs(maxres2) #else double precision gamvec(MAXRES6) common /syfek/ gamvec diff --git a/source/wham/src-HCD/readpdb.F b/source/wham/src-HCD/readpdb.F index 855d754..8a85b8c 100644 --- a/source/wham/src-HCD/readpdb.F +++ b/source/wham/src-HCD/readpdb.F @@ -20,12 +20,13 @@ C geometry. integer i,j,iii,ibeg,ishift,ishift1,ity,ires,ires_old double precision dcj integer rescode,kkk,lll,icha,cou,kupa,iprzes - logical lsecondary + logical lsecondary,sccalc integer iterter(maxres) double precision efree_temp iii=0 ibeg=1 ishift1=0 + sccalc=.false. do read (ipdbin,'(a80)',end=10) card ! write (iout,'(a)') card @@ -66,11 +67,13 @@ C geometry. call sccenter(ires,iii,sccor) endif iii=0 + sccalc=.true. endif ! Read free energy if (index(card,"FREE ENERGY").gt.0) read(card(35:),*) efree_temp ! Fish out the ATOM cards. if (index(card(1:4),'ATOM').gt.0) then + sccalc=.false. read (card(12:16),*) atom c write (2,'(a)') card ! write (iout,*) "! ",atom," !",ires @@ -94,6 +97,7 @@ c write (2,'(a)') card call sccenter(ires_old,iii,sccor) endif iii=0 + sccalc=.true. endif ! Start new residue. if (res.eq.'Cl-' .or. res.eq.'Na+') then @@ -214,7 +218,7 @@ C endif !unres_pdb endif !itype.eq.ntyp1 enddo C Calculate the CM of the last side chain. - call sccenter(ires,iii,sccor) + if (.not. sccalc) call sccenter(ires,iii,sccor) nsup=nres nstart_sup=1 if (itype(nres).ne.10) then -- 1.7.9.5