2 implicit real*8 (a-h,o-z)
6 character*16 form,nodename
10 include 'COMMON.IOUNITS'
12 include 'COMMON.CONTROL'
13 integer lenpre,lenpot,ilen,lentmp
15 character*3 out1file_text,ucase
18 c print *,"Processor",myrank,"fg_rank",fg_rank," entered openunits"
19 call getenv_loc("PREFIX",prefix)
21 call getenv_loc("POT",pot)
22 call getenv_loc("DIRTMP",tmpdir)
23 call getenv_loc("CURDIR",curdir)
24 call getenv_loc("OUT1FILE",out1file_text)
25 c print *,"Processor",myrank,"fg_rank",fg_rank," did GETENV"
26 out1file_text=ucase(out1file_text)
27 if (out1file_text(1:1).eq."Y") then
37 write (*,'(a,19x,a,19x,a)') "!"," A T T E N T I O N ","!"
39 write (*,*)"All output files will be on node /tmp directory."
41 call MPI_GET_PROCESSOR_NAME( nodename, nodelen, IERROR )
43 write (*,*) "The master node is ",nodename
44 else if (fg_rank.eq.0) then
45 write (*,*) "I am the CG slave node ",nodename
47 write (*,*) "I am the FG slave node ",nodename
50 PREFIX = tmpdir(:lentmp)//'/'//prefix(:lenpre)
51 lenpre = lentmp+lenpre+1
53 entname=prefix(:lenpre)//'_'//pot(:lenpot)//'.entr'
54 C Get the names and open the input files
55 #if defined(WINIFL) || defined(WINPGI)
56 open(1,file=pref_orig(:ilen(pref_orig))//
57 & '.inp',status='old',readonly,shared)
58 open (9,file=prefix(:ilen(prefix))//'.intin',status='unknown')
59 C open (18,file=prefix(:ilen(prefix))//'.entin',status='unknown')
60 C Get parameter filenames and open the parameter files.
61 call getenv_loc('BONDPAR',bondname)
62 open (ibond,file=bondname,status='old',readonly,shared)
63 call getenv_loc('THETPAR',thetname)
64 open (ithep,file=thetname,status='old',readonly,shared)
66 call getenv_loc('THETPARPDB',thetname_pdb)
67 open (ithep_pdb,file=thetname_pdb,status='old',readonly,shared)
69 call getenv_loc('ROTPAR',rotname)
70 open (irotam,file=rotname,status='old',readonly,shared)
72 call getenv_loc('ROTPARPDB',rotname_pdb)
73 open (irotam_pdb,file=rotname_pdb,status='old',readonly,shared)
75 call getenv_loc('TORPAR',torname)
76 open (itorp,file=torname,status='old',readonly,shared)
77 call getenv_loc('TORDPAR',tordname)
78 open (itordp,file=tordname,status='old',readonly,shared)
79 call getenv_loc('FOURIER',fouriername)
80 open (ifourier,file=fouriername,status='old',readonly,shared)
81 call getenv_loc('ELEPAR',elename)
82 open (ielep,file=elename,status='old',readonly,shared)
83 call getenv_loc('SIDEPAR',sidename)
84 open (isidep,file=sidename,status='old',readonly,shared)
85 #elif (defined CRAY) || (defined AIX)
86 open(1,file=pref_orig(:ilen(pref_orig))//'.inp',status='old',
88 c print *,"Processor",myrank," opened file 1"
89 open (9,file=prefix(:ilen(prefix))//'.intin',status='unknown')
90 c print *,"Processor",myrank," opened file 9"
91 C open (18,file=prefix(:ilen(prefix))//'.entin',status='unknown')
92 C Get parameter filenames and open the parameter files.
93 call getenv_loc('BONDPAR',bondname)
94 open (ibond,file=bondname,status='old',action='read')
95 c print *,"Processor",myrank," opened file IBOND"
96 call getenv_loc('THETPAR',thetname)
97 open (ithep,file=thetname,status='old',action='read')
98 c print *,"Processor",myrank," opened file ITHEP"
100 call getenv_loc('THETPARPDB',thetname_pdb)
101 open (ithep_pdb,file=thetname_pdb,status='old',action='read')
103 call getenv_loc('ROTPAR',rotname)
104 open (irotam,file=rotname,status='old',action='read')
105 c print *,"Processor",myrank," opened file IROTAM"
107 call getenv_loc('ROTPARPDB',rotname_pdb)
108 open (irotam_pdb,file=rotname_pdb,status='old',action='read')
110 call getenv_loc('TORPAR',torname)
111 open (itorp,file=torname,status='old',action='read')
112 c print *,"Processor",myrank," opened file ITORP"
113 call getenv_loc('TORDPAR',tordname)
114 open (itordp,file=tordname,status='old',action='read')
115 c print *,"Processor",myrank," opened file ITORDP"
116 call getenv_loc('SCCORPAR',sccorname)
117 open (isccor,file=sccorname,status='old',action='read')
118 c print *,"Processor",myrank," opened file ISCCOR"
119 call getenv_loc('FOURIER',fouriername)
120 open (ifourier,file=fouriername,status='old',action='read')
121 c print *,"Processor",myrank," opened file IFOURIER"
122 call getenv_loc('ELEPAR',elename)
123 open (ielep,file=elename,status='old',action='read')
124 c print *,"Processor",myrank," opened file IELEP"
125 call getenv_loc('SIDEPAR',sidename)
126 open (isidep,file=sidename,status='old',action='read')
127 c print *,"Processor",myrank," opened file ISIDEP"
128 c print *,"Processor",myrank," opened parameter files"
130 open(1,file=pref_orig(:ilen(pref_orig))//'.inp',status='old')
131 open (9,file=prefix(:ilen(prefix))//'.intin',status='unknown')
132 C open (18,file=prefix(:ilen(prefix))//'.entin',status='unknown')
133 C Get parameter filenames and open the parameter files.
134 call getenv_loc('BONDPAR',bondname)
135 open (ibond,file=bondname,status='old')
136 call getenv_loc('THETPAR',thetname)
137 open (ithep,file=thetname,status='old')
139 call getenv_loc('THETPARPDB',thetname_pdb)
140 open (ithep_pdb,file=thetname_pdb,status='old')
142 call getenv_loc('ROTPAR',rotname)
143 open (irotam,file=rotname,status='old')
145 call getenv_loc('ROTPARPDB',rotname_pdb)
146 open (irotam_pdb,file=rotname_pdb,status='old')
148 call getenv_loc('TORPAR',torname)
149 open (itorp,file=torname,status='old')
150 call getenv_loc('TORDPAR',tordname)
151 open (itordp,file=tordname,status='old')
152 call getenv_loc('SCCORPAR',sccorname)
153 open (isccor,file=sccorname,status='old')
154 call getenv_loc('FOURIER',fouriername)
155 open (ifourier,file=fouriername,status='old')
156 call getenv_loc('ELEPAR',elename)
157 open (ielep,file=elename,status='old')
158 call getenv_loc('SIDEPAR',sidename)
159 open (isidep,file=sidename,status='old')
161 open(1,file=pref_orig(:ilen(pref_orig))//'.inp',status='old',
163 open (9,file=prefix(:ilen(prefix))//'.intin',status='unknown')
164 C open (18,file=prefix(:ilen(prefix))//'.entin',status='unknown')
165 C Get parameter filenames and open the parameter files.
166 call getenv_loc('BONDPAR',bondname)
167 open (ibond,file=bondname,status='old',action='read')
168 call getenv_loc('THETPAR',thetname)
169 open (ithep,file=thetname,status='old',action='read')
171 call getenv_loc('THETPARPDB',thetname_pdb)
172 print *,"thetname_pdb ",thetname_pdb
173 open (ithep_pdb,file=thetname_pdb,status='old',action='read')
174 print *,ithep_pdb," opened"
176 call getenv_loc('ROTPAR',rotname)
177 open (irotam,file=rotname,status='old',action='read')
179 call getenv_loc('ROTPARPDB',rotname_pdb)
180 open (irotam_pdb,file=rotname_pdb,status='old',action='read')
182 call getenv_loc('TORPAR',torname)
183 open (itorp,file=torname,status='old',action='read')
184 call getenv_loc('TORDPAR',tordname)
185 open (itordp,file=tordname,status='old',action='read')
186 call getenv_loc('SCCORPAR',sccorname)
187 open (isccor,file=sccorname,status='old',action='read')
188 call getenv_loc('FOURIER',fouriername)
189 open (ifourier,file=fouriername,status='old',action='read')
190 call getenv_loc('ELEPAR',elename)
191 open (ielep,file=elename,status='old',action='read')
192 call getenv_loc('SIDEPAR',sidename)
193 open (isidep,file=sidename,status='old',action='read')
197 C 8/9/01 In the newest version SCp interaction constants are read from a file
198 C Use -DOLDSCP to use hard-coded constants instead.
200 call getenv_loc('SCPPAR',scpname)
201 #if defined(WINIFL) || defined(WINPGI)
202 open (iscpp,file=scpname,status='old',readonly,shared)
203 #elif (defined CRAY) || (defined AIX)
204 open (iscpp,file=scpname,status='old',action='read')
206 open (iscpp,file=scpname,status='old')
208 open (iscpp,file=scpname,status='old',action='read')
211 call getenv_loc('PATTERN',patname)
212 #if defined(WINIFL) || defined(WINPGI)
213 open (icbase,file=patname,status='old',readonly,shared)
214 #elif (defined CRAY) || (defined AIX)
215 open (icbase,file=patname,status='old',action='read')
217 open (icbase,file=patname,status='old')
219 open (icbase,file=patname,status='old',action='read')
222 C Open output file only for CG processes
223 c print *,"Processor",myrank," fg_rank",fg_rank
224 if (fg_rank.eq.0) then
229 npos = dlog10(dfloat(nodes-1))+1
231 if (npos.lt.3) npos=3
232 write (liczba,'(i1)') npos
233 form = '(bz,i'//liczba(:ilen(liczba))//'.'//liczba(:ilen(liczba))
235 write (liczba,form) me
236 outname=prefix(:lenpre)//'.out_'//pot(:lenpot)//
237 & liczba(:ilen(liczba))
238 intname=prefix(:lenpre)//'_'//pot(:lenpot)//liczba(:ilen(liczba))
240 pdbname(1)=prefix(:lenpre)//'_'//pot(:lenpot)//
241 & liczba(:ilen(liczba))
243 mol2name=prefix(:lenpre)//'_'//pot(:lenpot)//
244 & liczba(:ilen(liczba))//'.mol2'
245 statname=prefix(:lenpre)//'_'//pot(:lenpot)//
246 & liczba(:ilen(liczba))//'.stat'
248 & call copy_to_tmp(pref_orig(:ilen(pref_orig))//'_'//pot(:lenpot)
249 & //liczba(:ilen(liczba))//'.stat')
250 rest2name=prefix(:ilen(prefix))//"_"//liczba(:ilen(liczba))
253 qname=prefix(:lenpre)//'_'//pot(:lenpot)//
254 & liczba(:ilen(liczba))//'.const'
259 outname=prefix(:lenpre)//'.out_'//pot(:lenpot)
260 intname=prefix(:lenpre)//'_'//pot(:lenpot)//'.int'
261 pdbname(1)=prefix(:lenpre)//'_'//pot(:lenpot)//'.pdb'
262 mol2name=prefix(:lenpre)//'_'//pot(:lenpot)//'.mol2'
263 statname=prefix(:lenpre)//'_'//pot(:lenpot)//'.stat'
265 & call copy_to_tmp(pref_orig(:ilen(pref_orig))//'_'//pot(:lenpot)
267 rest2name=prefix(:ilen(prefix))//'.rst'
269 #if defined(AIX) || defined(PGI)
270 if (me.eq.king .or. .not. out1file)
271 & open(iout,file=outname,status='unknown')
274 if (fg_rank.gt.0) then
275 write (liczba,'(i3.3)') myrank/nfgtasks
276 write (ll,'(bz,i3.3)') fg_rank
277 open(iout,file="debug"//liczba(:ilen(liczba))//"."//ll,
283 open(igeom,file=intname,status='unknown',position='append')
284 open(ipdb,file=pdbname(1),status='unknown')
285 open(imol2,file=mol2name,status='unknown')
286 open(istat,file=statname,status='unknown',position='append')
288 c1out open(iout,file=outname,status='unknown')
291 if (me.eq.king .or. .not.out1file)
292 & open(iout,file=outname,status='unknown')
295 if (fg_rank.gt.0) then
296 print "Processor",fg_rank," opening output file"
297 write (liczba,'(i3.3)') myrank/nfgtasks
298 write (ll,'(bz,i3.3)') fg_rank
299 open(iout,file="debug"//liczba(:ilen(liczba))//"."//ll,
305 open(igeom,file=intname,status='unknown',access='append')
306 open(ipdb,file=pdbname(1),status='unknown')
307 open(imol2,file=mol2name,status='unknown')
308 open(istat,file=statname,status='unknown',access='append')
310 c1out open(iout,file=outname,status='unknown')
313 csa csa_rbank=prefix(:lenpre)//'.CSA.rbank'
314 csa csa_seed=prefix(:lenpre)//'.CSA.seed'
315 csa csa_history=prefix(:lenpre)//'.CSA.history'
316 csa csa_bank=prefix(:lenpre)//'.CSA.bank'
317 csa csa_bank1=prefix(:lenpre)//'.CSA.bank1'
318 csa csa_alpha=prefix(:lenpre)//'.CSA.alpha'
319 csa csa_alpha1=prefix(:lenpre)//'.CSA.alpha1'
320 csac!bankt csa_bankt=prefix(:lenpre)//'.CSA.bankt'
321 csa csa_int=prefix(:lenpre)//'.int'
322 csa csa_bank_reminimized=prefix(:lenpre)//'.CSA.bank_reminimized'
323 csa csa_native_int=prefix(:lenpre)//'.CSA.native.int'
324 csa csa_in=prefix(:lenpre)//'.CSA.in'
325 c print *,"Processor",myrank,"fg_rank",fg_rank," opened files"
328 write (iout,'(80(1h-))')
329 write (iout,'(30x,a)') "FILE ASSIGNMENT"
330 write (iout,'(80(1h-))')
331 write (iout,*) "Input file : ",
332 & pref_orig(:ilen(pref_orig))//'.inp'
333 write (iout,*) "Output file : ",
334 & outname(:ilen(outname))
336 write (iout,*) "Sidechain potential file : ",
337 & sidename(:ilen(sidename))
339 write (iout,*) "SCp potential file : ",
340 & scpname(:ilen(scpname))
342 write (iout,*) "Electrostatic potential file : ",
343 & elename(:ilen(elename))
344 write (iout,*) "Cumulant coefficient file : ",
345 & fouriername(:ilen(fouriername))
346 write (iout,*) "Torsional parameter file : ",
347 & torname(:ilen(torname))
348 write (iout,*) "Double torsional parameter file : ",
349 & tordname(:ilen(tordname))
350 write (iout,*) "SCCOR parameter file : ",
351 & sccorname(:ilen(sccorname))
352 write (iout,*) "Bond & inertia constant file : ",
353 & bondname(:ilen(bondname))
354 write (iout,*) "Bending parameter file : ",
355 & thetname(:ilen(thetname))
356 write (iout,*) "Rotamer parameter file : ",
357 & rotname(:ilen(rotname))
358 write (iout,*) "Threading database : ",
359 & patname(:ilen(patname))
361 &write (iout,*)" DIRTMP : ",
363 write (iout,'(80(1h-))')