source: anneal.f@ e40e335

Last change on this file since e40e335 was e40e335, checked in by baerbaer <baerbaer@…>, 16 years ago

Initial import to BerliOS corresponding to 3.0.4

git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/smmp/trunk@1 26dc1dd8-5c4e-0410-9ffe-d298b4865968

  • Property mode set to 100644
File size: 4.1 KB
Line 
1c **************************************************************
2c
3c This file contains the subroutines: anneal
4c
5c Copyright 2003-2005 Frank Eisenmenger, U.H.E. Hansmann,
6c Shura Hayryan, Chin-Ku
7c Copyright 2007 Frank Eisenmenger, U.H.E. Hansmann,
8c Jan H. Meinke, Sandipan Mohanty
9c
10c $Id: anneal.f 334 2007-08-07 09:23:59Z meinke $
11c **************************************************************
12
13 subroutine anneal(nequi, nswp, nmes, tmax, tmin, lrand)
14
15C --------------------------------------------------------------
16C PURPOSE: SIMULATED ANNEALING SEARCH OF LOWEST-POTENTIAL-ENERGY
17C CONFORMATIONS OF PROTEINS
18C
19C CALLS: addang,energy,metropolis,outvar,outpdb,rgyr,setvar,zimmer
20C
21C ---------------------------------------------------------------
22
23 include 'INCL.H'
24
25cf2py intent(in) nequi
26cf2py intent(in) nswp
27cf2py intent(in) nmes
28cf2py intent(in) Tmax
29cf2py intent(in) Tmin
30cf2py logical optional, intent(in):: lrand = 1
31
32c external rand
33 external can_weight
34c parameter(lrand=.true.)
35c parameter(nequi=100, nswp=100000,nmes=1000)
36c parameter(tmax=1000.0,tmin=100.0)
37C lrand=.true.: creates random start configuration
38 logical lrand
39C nequi: Number of sweeps for equilibrisation of system
40 integer nequi
41C nswp: Number of sweeps for simulation run
42 integer nswp
43c nmes: Number of sweeps between measurments
44 integer nmes
45C tmax: Start temperature
46 double precision tmax
47C tmin: Final temperature
48 double precision tmin
49
50
51! common/bet/beta
52C
53 dimension vlvrm(mxvr)
54
55
56
57c Define files for output:
58 open(14,file='time.d')
59 write(14, *) '# $Id: anneal.f 334 2007-08-07 09:23:59Z meinke $'
60 write(14, *) '# nsw, temp, eol, eysl, eyslh, eyslp, asa, rgy, ',
61 & '# rgyh, rgyp, eyhb, eyvw, eyel, eyvr, zimm'
62 bmin=1.0/ ( tmax * 1.98773d-3 )
63 bmax=1.0/ ( tmin * 1.98773d-3 )
64 db = exp(log(bmax/bmin)/nswp)
65
66c nresi: Number of residues
67c FIXME: Should loop over all proteins
68 nresi=irsml2(ntlml)-irsml1(1)+1
69c _________________________________ random start
70 if(lrand) then
71 do i=1,nvr
72 iv=idvr(i)
73 dv=axvr(iv)*(grnd()-0.5)
74 vr=addang(pi,dv)
75 vlvr(iv)=vr
76 enddo
77 end if
78
79 eol=energy()
80 write (*,'(a,e12.5,/)') 'energy of start configuration: ',eol
81
82C Write start configuration in pdb-format into file
83 call outpdb(0, "start.pdb")
84
85c =====================Equilibration by Metropolis
86 beta = bmin
87 do nsw=1,nequi
88 call metropolis(eol,acz,can_weight)
89 end do
90 write(*,*) 'Energy after equilibration:',eol
91
92C======================Simulation by simulated annealing
93 acz = 0.0d0
94 ymin = eol
95 do nsw=0,nswp
96 beta = bmin*db**nsw
97 call metropolis(eol,acz,can_weight)
98c Store lowest-energy conformation
99 if(eol.lt.ymin) then
100 ymin = eol
101 nemin = nsw
102 call outvar(0,'global.var')
103C Output of lowest-energy conformation as pdb-file
104 call outpdb(0,"global.pdb")
105 do j=1,nvr
106 iv=idvr(j)
107 vlvrm(j) = vlvr(iv)
108 end do
109 end if
110c
111 if(mod(nsw,nmes).eq.0) then
112C Measure radius of gyration and end-to-end distance
113 call rgyr(1, rgy, ee)
114C Determine Zimmerman code of actual conformation
115 call zimmer(nresi)
116C Write down information on actual conformation
117 temp = 1.0d0/beta/0.00198773
118 write(14,'(i6,13f12.3,1x,a)')
119 & nsw, temp, eol, eysl, eyslh, eyslp, asa,
120 & rgy, rgyh, rgyp,
121 & eyhb, eyvw, eyel, eyvr, zimm(1:nresi)
122 end if
123C
124 end do
125
126 acz = acz/dble(nsw*nvr)
127 write(*,*) 'acceptance rate:',acz
128 write(*,*)
129c ------------ Output Dihedreals of final configuration
130 write(*,*) 'last energy',eol
131 call outvar(0,' ')
132C Output final conformation as pdb-file
133 call outpdb(0,"final.pdb")
134 write(*,*)
135
136c ------------ Output Dihedreals of conformation with lowest energy
137 write(*,*) 'lowest energy ever found:',nemin,ymin
138 close(14)
139c =====================
140
141
142 end
143
144
Note: See TracBrowser for help on using the repository browser.