source: init_molecule.f

Last change on this file was 5272e0d, checked in by Jan Meinke <j.meinke@…>, 14 years ago

Added ppybind target to Makefile

Added a new target for creating Python bindings that take advantage so enyshe_p
to the Makefile.
Commented out one call to the log file that broke the compile.

  • Property mode set to 100644
File size: 6.0 KB
Line 
1! **************************************************************
2!
3! This file contains the subroutines: init_molecule
4!
5! Copyright 2003-2005 Frank Eisenmenger, U.H.E. Hansmann,
6! Shura Hayryan, Chin-Ku
7! Copyright 2007 Frank Eisenmenger, U.H.E. Hansmann,
8! Jan H. Meinke, Sandipan Mohanty
9!
10! **************************************************************
11! FIXME: Data in varfile determines which molecule is changed.
12
13 subroutine init_molecule(iabin,grpn,grpc,seqfile,varfile)
14
15! ----------------------------------------------------------
16! PURPOSE: construct starting structure of molecule(s)
17!
18! iabin = 1 : ab Initio using sequence &
19! variables given in input files
20! iabin != 1 : sequence, variable information
21! from PDB-file
22!
23! grpn: N-terminal group
24! grpc: C-terminal group
25!
26! CALLS: addend,bldmol,c_alfa,getmol,iendst, mklist, nursvr,
27! pdbread,pdbvars,redseq,redvar,setmvs
28!
29! ----------------------------------------------------------
30
31 include 'INCL.H'
32 include 'INCP.H'
33
34 integer iabin, iendst, ntl, i, j, l, it, ier, ir, nursvr, i1, i2
35 integer its
36
37Cf2py character*80 optional, intent(in) :: seqfile = ' '
38Cf2py character*80 optional, intent(in) :: varfile = ' '
39
40 character grpn*4,grpc*4
41 character navr*3, nars*4
42 character seqfile*80, varfile*80
43 integer ontlml
44 logical readFromStdin
45
46 ontlml = 1
47 readFromStdin = .false.
48
49 write (logString, *) 'init_molecule: Solvent: ', itysol
50 if (iabin.eq.1) then
51
52! ----------------------------------------- get sequence for molecule(s)
53 lunseq=11
54 if (ntlml.gt.0) then
55 ontlml = ntlml + 1
56 endif
57 if (iendst(seqfile).le.1.or.seqfile.eq.' ') then
58 1 write (logString, '(/,a,$)') ' file with SEQUENCE:'
59 seqfil=' '
60 read (*,'(a)',err=1) seqfil
61 readFromStdin = .true.
62 else
63 seqfil = seqfile
64 endif
65 call redseq
66
67 write (logString, *) 'File with sequence is ',
68 & seqfil(1:iendst(seqfil))
69
70! --------------------------------- read & assemble data from libraries
71! initial coordinates, interaction lists
72
73 ntl = ntlml
74 do i=ontlml, ntl
75
76 call getmol(i) ! assemble data from libraries
77
78 do j=1,6 ! initialize global parameters
79 gbpr(j,i)=0.d0
80 enddo
81
82 call bldmol(i) ! co-ordinates
83
84 ntlml = i
85 call addend(i,grpn,grpc) ! modify ends
86 call setmvs(i) ! determine sets of moving atoms for given variables
87 call mklist(i) ! compile lists of interaction partners
88
89 enddo
90
91! --------------------------- Read the initial conformation if necessary
92 if(readFromStdin) then
93 write (logString, '(a,$)') ' file with VARIABLES:'
94!
95 varfil=' '
96 read(*,'(a)',end=2,err=2) varfil
97 else
98 varfil = varfile
99 endif
100 l=iendst(varfil)
101 if (l.gt.0.and.varfil.ne.' ') then
102! write (logString, '(1x,a,/)') varfil(1:l)
103 lunvar=13
104
105 call redvar ! get vars. and rebuild
106
107 endif
108
109 2 write (logString, *) ' '
110
111! -------------------- get: nvr,idvr, vlvr, olvlvr
112 nvr = 0
113 do i=1,ivrml1(ntlml)+nvrml(ntlml)-1
114
115 if (.not.fxvr(i)) then
116 nvr=nvr+1
117 idvr(nvr)=i ! index of not fixed var.
118 endif
119
120 it=ityvr(i)
121
122 if (it.eq.3) then ! torsion
123 vlvr(i)=toat(iatvr(i))
124 elseif (it.eq.2) then ! b.angle
125 vlvr(i)=baat(iatvr(i))
126 elseif (it.eq.1) then ! b.length
127 vlvr(i)=blat(iatvr(i))
128 endif
129
130 olvlvr(i) = vlvr(i)
131 enddo
132
133 ireg = 0
134
135 else ! =========================== from PDB
136 if (iendst(seqfile).le.1) then
137 3 write (logString, '(/,a,$)') ' PDB-file:'
138 seqfil=' '
139 read (*,'(a)',err=3) seqfil
140 else
141 seqfil = seqfile
142 endif
143 write (logString, *) 'PDB structure ',seqfil(1:iendst(seqfil))
144 print *, 'calling readpdb with ',seqfile
145 call pdbread(seqfil,ier)
146
147 if (ier.ne.0) stop
148
149 call pdbvars()
150
151 ireg = 1
152
153 endif
154
155! -------------------------- set var. amplitudes for simulations
156
157 do i=1,ivrml1(ntlml)+nvrml(ntlml)-1
158
159 if (ityvr(i).eq.3.and..not.fxvr(i)) then ! torsion
160
161 navr = nmvr(i)
162
163 ir = nursvr(i)
164 nars = seq(ir)
165
166 if ( navr(1:2).eq.'om'
167
168 & .or.nars(1:3).eq.'arg'.and.(navr(1:2).eq.'x5'
169 & .or.navr(1:2).eq.'x6')
170
171 & .or.(nars(1:3).eq.'asn'.or.nars(1:3).eq.'asp')
172 & .and.navr(1:2).eq.'x3'
173
174 & .or.(nars(1:3).eq.'gln'.or.nars(1:3).eq.'glu')
175 & .and.navr(1:2).eq.'x4'
176
177 & ) then
178
179! axvr(i) = pi/9.d0 ! 20 deg.
180 axvr(i) = pi2 ! Trying out 360 deg. for these as well
181
182 else
183 axvr(i) = pi2 ! 360 deg.
184 endif
185
186 else
187 axvr(i) = 0.d0
188 endif
189
190 enddo ! vars.
191
192! --------------------- initialize solvation pars. if necessary
193
194 if (itysol.ne.0) then
195
196 i1=iatrs1(irsml1(1)) ! 1st atom of 1st molecule
197 i2=iatrs2(irsml2(ntlml)) ! last atom of last molecule
198
199 its = iabs(itysol)
200
201 do i=i1,i2 ! all atoms
202 it=ityat(i)
203 sigma(i)=coef_sl(its,it)
204 rvdw(i) =rad_vdw(its,it)
205
206 if (nmat(i)(1:1).ne.'h') rvdw(i)=rvdw(i)+rwater
207
208 enddo
209
210 endif
211! Initialize calpha array
212 do i=ontlml, ntlml
213 call c_alfa(i,1)
214 enddo
215
216! Initialize arrays used in the BGS update
217 call init_lund()
218 return
219 end
220
221
Note: See TracBrowser for help on using the repository browser.