From 04e500c1e6fb2a1882e2871304b3b0721a14c02c Mon Sep 17 00:00:00 2001 From: Cezary Czaplewski Date: Tue, 3 Mar 2015 12:55:08 +0100 Subject: [PATCH] REMD with HOMOL_NSET>1 and single weight for all homology restraints some output cleaning --- source/unres/src_MD/COMMON.CONTROL | 9 +++-- source/unres/src_MD/MREMD.F | 2 +- source/unres/src_MD/cinfo.f | 8 ++--- source/unres/src_MD/energy_p_new_barrier.F | 26 ++++---------- source/unres/src_MD/initialize_p.F | 6 ++-- source/unres/src_MD/parmread.F | 4 +-- source/unres/src_MD/readpdb.F | 7 ++-- source/unres/src_MD/readrtns.F | 54 ++++++++++++++-------------- 8 files changed, 53 insertions(+), 63 deletions(-) diff --git a/source/unres/src_MD/COMMON.CONTROL b/source/unres/src_MD/COMMON.CONTROL index 438efaf..2185e7e 100644 --- a/source/unres/src_MD/COMMON.CONTROL +++ b/source/unres/src_MD/COMMON.CONTROL @@ -1,6 +1,6 @@ integer modecalc,iscode,indpdb,indback,indphi,iranconf,icheckgrad, - & inprint,i2ndstr,mucadyn,constr_dist,constr_homology,homol_nset - real*8 waga_dist1,waga_angle1 + & iprint,i2ndstr,mucadyn,constr_dist,constr_homology,homol_nset + real*8 waga_homology real*8 waga_dist, waga_angle, waga_theta, waga_d, dist_cut logical minim,refstr,pdbref,outpdb,outmol2,overlapsc,energy_dec, & sideadd,lsecondary,read_cart,unres_pdb, @@ -11,8 +11,7 @@ & overlapsc,energy_dec,sideadd,lsecondary,read_cart,unres_pdb & ,vdisulf,searchsc,lmuca,dccart,mucadyn,extconf,out1file, & constr_dist,gnorm_check,gradout,split_ene,constr_homology, - & waga_dist, waga_angle, waga_theta, waga_d, dist_cut, - & homol_nset - common /homol/ waga_dist1(maxprocs/20), waga_angle1(maxprocs/20) + & waga_dist, waga_angle, waga_theta, waga_d, dist_cut + common /homol/ waga_homology(maxprocs/20),homol_nset C... minim = .true. means DO minimization. C... energy_dec = .true. means print energy decomposition matrix diff --git a/source/unres/src_MD/MREMD.F b/source/unres/src_MD/MREMD.F index 7ae6430..ed655a8 100644 --- a/source/unres/src_MD/MREMD.F +++ b/source/unres/src_MD/MREMD.F @@ -59,7 +59,7 @@ cdeb imin_itime_old=0 endif mremd_rst_name=prefix(:ilen(prefix))//"_mremd.rst" -cd print *,'MREMD',nodes +cd print *,'MREMD',nodes,homol_nset cd print *,'mmm',me,remd_mlist,(remd_m(i),i=1,nrep) cde write (iout,*) "Start MREMD: me",me," t_bath",t_bath diff --git a/source/unres/src_MD/cinfo.f b/source/unres/src_MD/cinfo.f index e00e4af..0a46337 100644 --- a/source/unres/src_MD/cinfo.f +++ b/source/unres/src_MD/cinfo.f @@ -1,11 +1,11 @@ C DO NOT EDIT THIS FILE - IT HAS BEEN GENERATED BY COMPINFO.C -C 0 40376 2 +C 0 40376 14 subroutine cinfo include 'COMMON.IOUNITS' write(iout,*)'++++ Compile info ++++' - write(iout,*)'Version 0.40376 build 2' - write(iout,*)'compiled Wed Feb 25 14:06:14 2015' - write(iout,*)'compiled by felipe@piasek4' + write(iout,*)'Version 0.40376 build 14' + write(iout,*)'compiled Tue Mar 3 11:11:23 2015' + write(iout,*)'compiled by czarek@piasek4' write(iout,*)'OS name: Linux ' write(iout,*)'OS release: 3.2.0-70-generic ' write(iout,*)'OS version:', diff --git a/source/unres/src_MD/energy_p_new_barrier.F b/source/unres/src_MD/energy_p_new_barrier.F index cb97c0a..15dfccd 100644 --- a/source/unres/src_MD/energy_p_new_barrier.F +++ b/source/unres/src_MD/energy_p_new_barrier.F @@ -6073,11 +6073,8 @@ c write(iout,*) "constr_homology=",constr_homology c write(iout,*) i, j, k, "TEST K" enddo - if (homol_nset.gt.1)then - grad_odl3=waga_dist1(iset)*sum_sgodl/(sum_godl*dij) - else - grad_odl3=waga_dist*sum_sgodl/(sum_godl*dij) - endif + grad_odl3=waga_homology(iset)*waga_dist + & *sum_sgodl/(sum_godl*dij) c grad_odl3=sum_sgodl/(sum_godl*dij) @@ -6175,11 +6172,7 @@ c sgdih=-gdih(k)*dih_diff(k)*sigma_dih(k,i)*waga_angle sum_sgdih=sum_sgdih+sgdih enddo c grad_dih3=sum_sgdih/sum_gdih - if (homol_nset.gt.1)then - grad_dih3=waga_angle1(iset)*sum_sgdih/sum_gdih - else - grad_dih3=waga_angle*sum_sgdih/sum_gdih - endif + grad_dih3=waga_homology(iset)*waga_angle*sum_sgdih/sum_gdih c write(iout,*)i,k,gdih,sgdih,beta(i+1,i+2,i+3,i+4),grad_dih3 ccc write(iout,747) "GRAD_KAT_1", i, nphi, icg, grad_dih3, @@ -6277,6 +6270,7 @@ c grad_theta3=sum_sgtheta/sum_gtheta c c Final value of gradient using same var as in Econstr_back dutheta(i-2)=sum_sgtheta/sum_gtheta*waga_theta + & *waga_homology(iset) c dutheta(i)=sum_sgtheta/sum_gtheta c c Uconst_back=Uconst_back+waga_theta*utheta(i) ! waga_theta added as weight @@ -6365,7 +6359,7 @@ c sum_sguscdiff=sum_sguscdiff+sum_guscdiff c c c New implementation - sum_guscdiff = waga_d*sum_guscdiff + sum_guscdiff = waga_homology(iset)*waga_d*sum_guscdiff do jik=1,3 duscdiff(jik,i-1)=duscdiff(jik,i-1)+ & sum_guscdiff*(dXX_C1tab(jik,i)*dxx+ @@ -6453,14 +6447,8 @@ c c Addition of energy of theta angle and SC local geom over constr_homologs ref strs c c ehomology_constr=odleg+kat - if (homol_nset.gt.1)then - ehomology_constr=waga_dist1(iset)*odleg+waga_angle1(iset)*kat - & +waga_theta*Eval - & +waga_d*Erot - else - ehomology_constr=waga_dist*odleg+waga_angle*kat+waga_theta*Eval - & +waga_d*Erot - endif + ehomology_constr=(waga_dist*odleg+waga_angle*kat+waga_theta*Eval + & +waga_d*Erot)*waga_homology(iset) c write (iout,*) "odleg",odleg," kat",kat," Uconst_back",Uconst_back c write (iout,*) "ehomology_constr",ehomology_constr c ehomology_constr=odleg+kat+Uconst_back diff --git a/source/unres/src_MD/initialize_p.F b/source/unres/src_MD/initialize_p.F index ea446f7..2d08087 100644 --- a/source/unres/src_MD/initialize_p.F +++ b/source/unres/src_MD/initialize_p.F @@ -1409,10 +1409,10 @@ c------------------------------------------------------------------------------ include 'COMMON.CONTROL' include 'COMMON.MD' include 'COMMON.INTERACT' - write(iout,*)"homology_partition: lim_odl=",lim_odl, - & " lim_dih",lim_dih +cd write(iout,*)"homology_partition: lim_odl=",lim_odl, +cd & " lim_dih",lim_dih #ifdef MPI - write (iout,*) "MPI" + if (me.eq.king .or. .not. out1file) write (iout,*) "MPI" call int_bounds(lim_odl,link_start_homo,link_end_homo) call int_bounds(lim_dih-nnt+1,idihconstr_start_homo, & idihconstr_end_homo) diff --git a/source/unres/src_MD/parmread.F b/source/unres/src_MD/parmread.F index 030d64e..4efc165 100644 --- a/source/unres/src_MD/parmread.F +++ b/source/unres/src_MD/parmread.F @@ -276,7 +276,7 @@ C enddo call flush(iout) endif - write (2,*) "Start reading THETA_PDB" +cd write (2,*) "Start reading THETA_PDB" do i=1,ntyp read (ithep_pdb,*,err=111,end=111) a0thet(i),(athet(j,i),j=1,2), & (bthet(j,i),j=1,2) @@ -285,7 +285,7 @@ C read (ithep_pdb,*,err=111,end=111) theta0(i),sig0(i),sigc0(i) sigc0(i)=sigc0(i)**2 enddo - write (2,*) "End reading THETA_PDB" +cd write (2,*) "End reading THETA_PDB" close (ithep_pdb) #endif close(ithep) diff --git a/source/unres/src_MD/readpdb.F b/source/unres/src_MD/readpdb.F index 3ce8334..eaf41c8 100644 --- a/source/unres/src_MD/readpdb.F +++ b/source/unres/src_MD/readpdb.F @@ -15,7 +15,7 @@ C geometry. include 'COMMON.SETUP' integer i,j,ibeg,ishift1,ires,iii,ires_old,ishift,ity, & ishift_pdb - logical lprn /.true./,fail + logical lprn /.false./,fail double precision e1(3),e2(3),e3(3) double precision dcj,efree_temp character*3 seq,res @@ -144,7 +144,10 @@ c write (iout,*) "sidechain ",atom endif endif enddo - 10 write (iout,'(a,i5)') ' Number of residues found: ',ires + 10 continue +#ifdef DEBUG + write (iout,'(a,i5)') ' Number of residues found: ',ires +#endif if (ires.eq.0) return C Calculate the CM of the last side chain. if (iii.gt.0) then diff --git a/source/unres/src_MD/readrtns.F b/source/unres/src_MD/readrtns.F index 8c3938e..c182359 100644 --- a/source/unres/src_MD/readrtns.F +++ b/source/unres/src_MD/readrtns.F @@ -2686,22 +2686,21 @@ c Alternative: reading from input call readi(controlcard,"HOMOL_NSET",homol_nset,1) if (homol_nset.gt.1)then call card_concat(controlcard) - read(controlcard,*) (waga_dist1(i),i=1,homol_nset) - call card_concat(controlcard) - read(controlcard,*) (waga_angle1(i),i=1,homol_nset) - write(iout,*) "iset distance_weight angle_weight" - do i=1,homol_nset - write(iout,*) i,waga_dist1(i),waga_angle1(i) - enddo + read(controlcard,*) (waga_homology(i),i=1,homol_nset) + if(me.eq.king .or. .not. out1file .and. fg_rank.eq.0) then + write(iout,*) "iset homology_weight " + do i=1,homol_nset + write(iout,*) i,waga_homology(i) + enddo + endif iset=mod(kolor,homol_nset)+1 else iset=1 -c call reada(controlcard,"HOMOL_DIST",waga_dist(1),1.0d0) -c call reada(controlcard,"HOMOL_ANGLE",waga_angle(1),1.0d0) + waga_homology(1)=1.0 endif - write (iout,*) "nnt",nnt," nct",nct - call flush(iout) +cd write (iout,*) "nnt",nnt," nct",nct +cd call flush(iout) lim_odl=0 @@ -2956,37 +2955,38 @@ c read (ientin,*) sigma_d(k,i) ! 1st variant if (waga_dist.gt.0.0d0) lim_odl=ii if (constr_homology.gt.0) call homology_partition if (constr_homology.gt.0) call init_int_table - write (iout,*) "homology_partition: lim_theta= ",lim_theta, - & "lim_xx=",lim_xx +cd write (iout,*) "homology_partition: lim_theta= ",lim_theta, +cd & "lim_xx=",lim_xx 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 if (.not.lprn) return - write(iout,*) "waga_theta",waga_theta,"waga_d",waga_d - write (iout,*) "Distance restraints from templates" - do ii=1,lim_odl +cd write(iout,*) "waga_theta",waga_theta,"waga_d",waga_d + if(me.eq.king .or. .not. out1file .and. fg_rank.eq.0) then + write (iout,*) "Distance restraints from templates" + do ii=1,lim_odl write(iout,'(3i5,10(2f16.2,4x))') ii,ires_homo(ii),jres_homo(ii), & (odl(ki,ii),1.0d0/dsqrt(sigma_odl(ki,ii)),ki=1,constr_homology) - enddo - write (iout,*) "Dihedral angle restraints from templates" - do i=nnt+3,lim_dih + enddo + write (iout,*) "Dihedral angle restraints from templates" + do i=nnt+3,lim_dih write (iout,'(i5,10(2f8.2,4x))') i,(rad2deg*dih(ki,i), & rad2deg/dsqrt(sigma_dih(ki,i)),ki=1,constr_homology) - enddo - write (iout,*) "Virtual-bond angle restraints from templates" - do i=nnt+2,lim_theta + enddo + write (iout,*) "Virtual-bond angle restraints from templates" + do i=nnt+2,lim_theta write (iout,'(i5,10(2f8.2,4x))') i,(rad2deg*thetatpl(ki,i), & rad2deg/dsqrt(sigma_theta(ki,i)),ki=1,constr_homology) - enddo - write (iout,*) "SC restraints from templates" - do i=nnt,lim_xx + enddo + write (iout,*) "SC restraints from templates" + do i=nnt,lim_xx write(iout,'(i5,10(4f8.2,4x))') i, & (xxtpl(ki,i),yytpl(ki,i),zztpl(ki,i), & 1.0d0/dsqrt(sigma_d(ki,i)),ki=1,constr_homology) - enddo - + enddo + endif c ----------------------------------------------------------------- return end -- 1.7.9.5