& ene_i_iex,xxx,tmp,econstr_temp_iex,econstr_temp_i
integer iran_num
double precision ran_number
+ integer i_econstr/20/
cdeb imin_itime_old=0
ntwx_cache=0
do i=nnt,nct
if (itype(i).ne.ntyp1) stdforcsc(i)=stdfsc(iabs(itype(i)))
& *dsqrt(gamsc(iabs(itype(i))))
- enddo
+ enddo
endif
+
endif
if(me.eq.king) then
write (iout,'(a6,i4,a1,100i4)') "ndowna",il,":",
& (ndowna(i,il),i=1,ndowna(0,il))
enddo
+
stdfp=dsqrt(2*Rb*t_bath/d_time)
do i=1,ntyp
stdfsc(i)=dsqrt(2*Rb*t_bath/d_time)
enddo
if (lang.gt.0 .and. .not.surfarea) then
- do i=nnt,nct-1
- stdforcp(i)=stdfp*dsqrt(gamp)
- enddo
+ do i=nnt,nct-1
+ stdforcp(i)=stdfp*dsqrt(gamp)
+ enddo
do i=nnt,nct
if (itype(i).ne.ntyp1) stdforcsc(i)=stdfsc(iabs(itype(i)))
& *dsqrt(gamsc(iabs(itype(i))))
- enddo
- endif
-
+ enddo
+ endif
ELSE IF (.not.(rest.and.file_exist)) THEN
do il=1,remd_m(1)
ifirst(il)=il
iset=i2set(me)
if(me.eq.king.or..not.out1file)
& write(iout,*) me,"iset=",iset,"t_bath=",t_bath
- call flush(iout)
+c call flush(iout)
endif
c
stdfp=dsqrt(2*Rb*t_bath/d_time)
write(iout,*) "MIN ii_write=",ii_write
endif
endif
- call flush(iout)
+c call flush(iout)
endif
if (synflag) then
c Update the time safety limiy
time05=MPI_WTIME()
if (me.eq.king .or. .not. out1file) then
write(iout,*) 'REMD writing traj time=',time05-time04
- call flush(iout)
+c call flush(iout)
endif
iex=i_index(i_temp1,i_mult1,i_iset1,i_mset1)
c 9/1/17 AL: Correction; otherwise the restraint energies are mis-assigned
c on failed replica exchange attempt
- econstr_temp_i=remd_ene(20,i)
- econstr_temp_iex=remd_ene(20,iex)
+ econstr_temp_i=remd_ene(i_econstr,i)
+ econstr_temp_iex=remd_ene(i_econstr,iex)
c 9/11/17 AL: Adaptive sampling (temperature dependent restraints potentials)
if (adaptive) then
- remd_ene(20,i)=remd_ene(n_ene+5,i)
- remd_ene(20,iex)=remd_ene(n_ene+6,iex)
+ remd_ene(i_econstr,i)=remd_ene(n_ene+5,i)
+ remd_ene(i_econstr,iex)=remd_ene(n_ene+6,iex)
endif
elseif(i_dir.eq.2 .and. mset(i_iset+1).gt.0)then
i_iset1=i_iset+1
i_mset1=iran_num(1,mset(i_iset1))
iex=i_index(i_temp1,i_mult1,i_iset1,i_mset1)
- econstr_temp_i=remd_ene(20,i)
- econstr_temp_iex=remd_ene(20,iex)
- remd_ene(20,i)=remd_ene(n_ene+3,i)
- remd_ene(20,iex)=remd_ene(n_ene+4,iex)
+ econstr_temp_i=remd_ene(i_econstr,i)
+ econstr_temp_iex=remd_ene(i_econstr,iex)
+ remd_ene(i_econstr,i)=remd_ene(n_ene+3,i)
+ remd_ene(i_econstr,iex)=remd_ene(n_ene+4,iex)
elseif(remd_m(i_temp+1).gt.0.and.mset(i_iset+1).gt.0)then
i_iset1=i_iset+1
i_mset1=iran_num(1,mset(i_iset1))
iex=i_index(i_temp1,i_mult1,i_iset1,i_mset1)
- econstr_temp_i=remd_ene(20,i)
- econstr_temp_iex=remd_ene(20,iex)
+ econstr_temp_i=remd_ene(i_econstr,i)
+ econstr_temp_iex=remd_ene(i_econstr,iex)
if (adaptive) then
- remd_ene(20,i)=remd_ene(n_ene+7,i)
- remd_ene(20,iex)=remd_ene(n_ene+8,iex)
+ remd_ene(i_econstr,i)=remd_ene(n_ene+7,i)
+ remd_ene(i_econstr,iex)=remd_ene(n_ene+8,iex)
else
- remd_ene(20,i)=remd_ene(n_ene+3,i)
- remd_ene(20,iex)=remd_ene(n_ene+4,iex)
+ remd_ene(i_econstr,i)=remd_ene(n_ene+3,i)
+ remd_ene(i_econstr,iex)=remd_ene(n_ene+4,iex)
endif
else
goto 444
else
remd_ene(0,iex)=ene_iex_iex
remd_ene(0,i)=ene_i_i
- remd_ene(20,iex)=econstr_temp_iex
- remd_ene(20,i)=econstr_temp_i
+ remd_ene(i_econstr,iex)=econstr_temp_iex
+ remd_ene(i_econstr,i)=econstr_temp_i
endif
cd do il=1,nset
enddo
endif
- call flush(iout)
+c call flush(iout)
cd write (iout,'(a6,100i4)') "ifirst",
cd & (ifirst(i),i=1,remd_m(1))
do i=1,ntyp
stdfsc(i)=dsqrt(2*Rb*t_bath/d_time)
enddo
-
c Compute the standard deviations of stochastic forces for Langevin dynamics
c if the friction coefficients do not depend on surface area
if (lang.gt.0 .and. .not.surfarea) then
& *dsqrt(gamsc(iabs(itype(i))))
enddo
endif
-cde write(iout,*) 'REMD after',me,t_bath
+cde write(iout,*) 'REMD after',me,t_bath
time08=MPI_WTIME()
if (me.eq.king .or. .not. out1file) then
write(iout,*) 'REMD exchange time=',time08-time00
- call flush(iout)
+c call flush(iout)
endif
endif
enddo
character*24 model_ki_dist, model_ki_angle
character*500 controlcard
integer ki,i,ii,j,k,l,ii_in_use(maxdim),i_tmp,idomain_tmp,irec,
- & ik,iistart,iishift
+ & ik,iistart
integer ilen
external ilen
- logical liiflag
+ logical liiflag,lfirst
+ integer i01,i10
c
c FP - Nov. 2014 Temporary specifications for new vars
c
if (waga_dist.ne.0.0d0) then
ii=0
liiflag=.true.
+ lfirst=.true.
do i=nnt,nct-2
do j=i+2,nct
ii=ii+1
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
+ if (ii_in_use(ii).eq.0.and.liiflag.or.
+ & ii_in_use(ii).eq.1.and.liiflag.and.ii.eq.lim_odl) then
liiflag=.false.
- iistart=ii
+ i10=ii
+ if (lfirst) then
+ lfirst=.false.
+ iistart=ii
+ else
+ if(i10.eq.lim_odl) i10=i10+1
+ do ki=0,i10-i01-1
+ ires_homo(iistart+ki)=ires_homo(ki+i01)
+ jres_homo(iistart+ki)=jres_homo(ki+i01)
+ ii_in_use(iistart+ki)=ii_in_use(ki+i01)
+ do k=1,constr_homology
+ odl(k,iistart+ki)=odl(k,ki+i01)
+ sigma_odl(k,iistart+ki)=sigma_odl(k,ki+i01)
+ l_homo(k,iistart+ki)=l_homo(k,ki+i01)
+ enddo
+ enddo
+ iistart=iistart+i10-i01
+ endif
endif
- if (ii_in_use(ii).ne.0.and..not.liiflag.or.
- & .not.liiflag.and.ii.eq.lim_odl) then
- if (ii.eq.lim_odl) then
- iishift=ii-iistart+1
- else
- iishift=ii-iistart
- endif
+ if (ii_in_use(ii).ne.0.and..not.liiflag) then
+ i01=ii
liiflag=.true.
- do ki=iistart,lim_odl-iishift
- ires_homo(ki)=ires_homo(ki+iishift)
- jres_homo(ki)=jres_homo(ki+iishift)
- ii_in_use(ki)=ii_in_use(ki+iishift)
- do k=1,constr_homology
- odl(k,ki)=odl(k,ki+iishift)
- sigma_odl(k,ki)=sigma_odl(k,ki+iishift)
- l_homo(k,ki)=l_homo(k,ki+iishift)
- enddo
- enddo
- ii=ii-iishift
- lim_odl=lim_odl-iishift
-c endif
endif
enddo
enddo
+ lim_odl=iistart-1
endif
c write (iout,*) "Removing distances completed"
c call flush(iout)
ibeg=1
ishift1=0
sccalc=.false.
- ires=0
do
read (ipdbin,'(a80)',end=10) card
-c write (iout,'(a)') card
+! write (iout,'(a)') card
if (card(:5).eq.'HELIX') then
nhfrag=nhfrag+1
lsecondary=.true.
iterter(ires_old)=1
ishift1=ishift1+1
ibeg=2
- write (iout,*) "Chain ended",ires,ishift,ires_old
+! write (iout,*) "Chain ended",ires,ishift,ires_old
if (unres_pdb) then
do j=1,3
dc(j,ires)=sccor(j,iii)
! Start a new chain
ishift=-ires_old+ires-1 !!!!!
ishift1=ishift1-1 !!!!!
- write (iout,*) "New chain started",ires,ishift,ishift1,"!"
+! write (iout,*) "New chain started",ires,ishift,ishift1,"!"
ires=ires-ishift+ishift1
ires_old=ires
ibeg=0
if (itype(i-1).ne.ntyp1 .and. itype(i).ne.ntyp1 .and.
& (dist(i,i-1).lt.1.0D0 .or. dist(i,i-1).gt.6.0D0)) then
write (iout,'(a,i4)') 'Bad Cartesians for residue',i
- stop
+c stop
endif
vbld(i)=dist(i-1,i)
vbld_inv(i)=1.0d0/vbld(i)