- Timestamp:
- 09/05/08 11:49:42 (16 years ago)
- Branches:
- master
- Children:
- fafe4d6
- Parents:
- 2ebb8b6
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
getmol.f
r2ebb8b6 rbd2278d 1 c**************************2 c**************************************************************3 c 4 cThis file contains the subroutines: getmol,redres5 c 6 cCopyright 2003-2005 Frank Eisenmenger, U.H.E. Hansmann,7 cShura Hayryan, Chin-Ku8 cCopyright 2007 Frank Eisenmenger, U.H.E. Hansmann,9 cJan H. Meinke, Sandipan Mohanty10 c 11 c**************************************************************1 ! ************************** 2 ! ************************************************************** 3 ! 4 ! This file contains the subroutines: getmol,redres 5 ! 6 ! Copyright 2003-2005 Frank Eisenmenger, U.H.E. Hansmann, 7 ! Shura Hayryan, Chin-Ku 8 ! Copyright 2007 Frank Eisenmenger, U.H.E. Hansmann, 9 ! Jan H. Meinke, Sandipan Mohanty 10 ! 11 ! ************************************************************** 12 12 13 13 14 14 subroutine getmol(nml) 15 15 16 c...................................................................17 cPURPOSE: assemble data for molecule 'nml' according to18 cits sequence using residue library 'reslib'19 c 20 c! Molecules must be assembled in sequential order (1 -> ntlml)21 c(or number of atoms & variables must remain the same)22 c 23 cINPUT: irsml1(nml),irsml2(nml),seq(irsml1()...irsml2())24 cnml>1: irsml1(nml-1),iatrs2(irsml2(nml-1))25 civrrs1(irsml2(nml-1)),nvrrs(irsml2(nml-1))26 c 27 cOUTPUT: molecule - ivrml1,nvrml28 cresidues - iatrs1,ixatrs,iatrs2,ivrrs1,nvrrs29 catoms - nmat,ityat,cgat,blat,baat,csbaat,snbaat,30 ctoat,cstoat,sntoat31 cbonds - nbdat,iowat,iyowat,ibdat(1-mxbd,),iybdat(1-mxbd,)32 c! 1st atom of 'nml': iowat indicates 1st bond33 cto a FOLLOWING atom (not previous) !34 cvariables - ityvr,iclvr,iatvr,nmvr35 c36 cCALLS: iopfil,redres,iendst37 c...................................................................16 ! ................................................................... 17 ! PURPOSE: assemble data for molecule 'nml' according to 18 ! its sequence using residue library 'reslib' 19 ! 20 ! ! Molecules must be assembled in sequential order (1 -> ntlml) 21 ! (or number of atoms & variables must remain the same) 22 ! 23 ! INPUT: irsml1(nml),irsml2(nml),seq(irsml1()...irsml2()) 24 ! nml>1: irsml1(nml-1),iatrs2(irsml2(nml-1)) 25 ! ivrrs1(irsml2(nml-1)),nvrrs(irsml2(nml-1)) 26 ! 27 ! OUTPUT: molecule - ivrml1,nvrml 28 ! residues - iatrs1,ixatrs,iatrs2,ivrrs1,nvrrs 29 ! atoms - nmat,ityat,cgat,blat,baat,csbaat,snbaat, 30 ! toat,cstoat,sntoat 31 ! bonds - nbdat,iowat,iyowat,ibdat(1-mxbd,),iybdat(1-mxbd,) 32 ! ! 1st atom of 'nml': iowat indicates 1st bond 33 ! to a FOLLOWING atom (not previous) ! 34 ! variables - ityvr,iclvr,iatvr,nmvr 35 ! 36 ! CALLS: iopfil,redres,iendst 37 ! ................................................................... 38 38 39 39 include 'INCL.H' … … 43 43 if (iopfil(lunlib,reslib,'old','formatted').le.izero) then 44 44 write (*,'(a,/,a,i3,2a)') 45 #' getmol> ERROR opening library of residues:',46 #' LUN=',lunlib,' FILE=',reslib(1:iendst(reslib))45 & ' getmol> ERROR opening library of residues:', 46 & ' LUN=',lunlib,' FILE=',reslib(1:iendst(reslib)) 47 47 stop 48 48 endif … … 68 68 if (res(:3).eq.'nme'.and.nrs.ne.ilars) then 69 69 write (*,'(3a)') ' getmol> residue >',res, 70 #'< allowed at C-terminus only !'70 & '< allowed at C-terminus only !' 71 71 close(lunlib) 72 72 stop 73 73 elseif (res(:3).eq.'ace'.and.nrs.ne.ifirs) then 74 74 write (*,'(3a)') ' getmol> residue >',res, 75 #'< allowed at N-terminus only !'75 & '< allowed at N-terminus only !' 76 76 close(lunlib) 77 77 stop … … 93 93 rewind lunlib 94 94 95 c___________________________________________________________ Atoms95 ! ___________________________________________________________ Atoms 96 96 do i=1,nat 97 97 n=i+ntlat … … 108 108 cstoat(n)=cos(to) 109 109 sntoat(n)=sin(to) 110 c______________________________ bonds to previous & following atoms110 ! ______________________________ bonds to previous & following atoms 111 111 iow=iowath(i) 112 112 if (iow.eq.0) then ! 1st atom of residue … … 129 129 iyowat(n)=1 !!! only single bonds assumed !!! 130 130 131 c___________________________ correct atom to 'next' res.131 ! ___________________________ correct atom to 'next' res. 132 132 nbd=nbdat(nh) 133 133 if (nbd.eq.mxbd) then 134 134 write(*,'(a,i2,a,i4,2a,i4,a)') 135 #' getmol> need ',(mxbd+2),136 #'th bond to connect residues ',137 #nrs-1,seq(nrs-1),' and ',nrs,seq(nrs)135 & ' getmol> need ',(mxbd+2), 136 & 'th bond to connect residues ', 137 & nrs-1,seq(nrs-1),' and ',nrs,seq(nrs) 138 138 close(lunlib) 139 139 stop 140 140 else ! correct atom to 'next' res. 141 c_______________________________!! dihedrals for atoms bound to 'nh'142 care assumed to be phase angles !!141 ! _______________________________!! dihedrals for atoms bound to 'nh' 142 ! are assumed to be phase angles !! 143 143 do j=1,nbd 144 144 … … 148 148 if (t.eq.0.0) then 149 149 write (*,'(3a,/,2a)') 150 #' getmol> DIHEDRAL for atom ',nmat(nj),151 #' should be PHASE angle with respect to atom ',152 #nmat(n),' & therefore must be not 0.0 !!'150 & ' getmol> DIHEDRAL for atom ',nmat(nj), 151 & ' should be PHASE angle with respect to atom ', 152 & nmat(n),' & therefore must be not 0.0 !!' 153 153 close(lunlib) 154 154 stop … … 197 197 enddo ! ... atoms 198 198 199 c________________________________________________________ Variables199 ! ________________________________________________________ Variables 200 200 ivrrs1(nrs)=ntlvr+1 201 201 mvr=0 … … 206 206 207 207 iat=iatvrh(i) 208 c____________________________________ Exclude all variables for 1st atom209 c& torsion for atoms bound to it208 ! ____________________________________ Exclude all variables for 1st atom 209 ! & torsion for atoms bound to it 210 210 if ( iat.eq.1.or. 211 #(iowath(iat).eq.1.and.ityvrh(i).eq.3)) goto 1211 & (iowath(iat).eq.1.and.ityvrh(i).eq.3)) goto 1 212 212 213 213 endif … … 233 233 close(lunlib) 234 234 235 c_______________________________ Variables235 ! _______________________________ Variables 236 236 if (nml.eq.1) then 237 237 nvrml(nml)=ntlvr … … 242 242 return 243 243 end 244 c**************************************244 ! ************************************** 245 245 subroutine redres(res,nat,nxt,nvrr) 246 246 247 c.......................................................248 cPURPOSE: read atom data for residue 'res' from library249 c(file 'lunlib' 'reslib' opened in routine calling250 cthis one)251 c 252 cOUTPUT: nat - number of atoms in residue253 cnxt - atom which may bind to following residue254 cnvrr - number of variables in residue255 cfor atoms - nmath,blath,baath(rad),toath(rad),256 cityath,iyowath,iowath (INSIDE residue,257 c=0 if 1st atom)258 cfor variables - ityvrh (1=bl/2=ba/3=to),iclvrh,iatvrh,nmvrh259 c 260 cLIBRARY: residue-lines:261 c'#', res, nat, nxt; Format: a1,a4,2i4262 catom-lines:263 cnmat,3{"fix" =' ', clvr,nmvr, blat/baat(deg)/toat(deg)},264 ccgat, ityat, iowat,ibdat1,ibdat2,ibdat3;265 cFormat: a4, 3(1x,i2,a1,a3,f9.3), f7.4, i4,4i4266 c 267 CCALLS: iendst,tolost268 c 269 c.......................................................247 ! ....................................................... 248 ! PURPOSE: read atom data for residue 'res' from library 249 ! (file 'lunlib' 'reslib' opened in routine calling 250 ! this one) 251 ! 252 ! OUTPUT: nat - number of atoms in residue 253 ! nxt - atom which may bind to following residue 254 ! nvrr - number of variables in residue 255 ! for atoms - nmath,blath,baath(rad),toath(rad), 256 ! ityath,iyowath,iowath (INSIDE residue, 257 ! =0 if 1st atom) 258 ! for variables - ityvrh (1=bl/2=ba/3=to),iclvrh,iatvrh,nmvrh 259 ! 260 ! LIBRARY: residue-lines: 261 ! '#', res, nat, nxt; Format: a1,a4,2i4 262 ! atom-lines: 263 ! nmat,3{"fix" =' ', clvr,nmvr, blat/baat(deg)/toat(deg)}, 264 ! cgat, ityat, iowat,ibdat1,ibdat2,ibdat3; 265 ! Format: a4, 3(1x,i2,a1,a3,f9.3), f7.4, i4,4i4 266 ! 267 ! CALLS: iendst,tolost 268 ! 269 ! ....................................................... 270 270 271 271 include 'INCL.H' … … 285 285 call tolost(resl) ! ensure lower case for residue name 286 286 287 c________________________________ find residue 'resl'287 ! ________________________________ find residue 'resl' 288 288 1 line=blnk 289 289 nln=nln+1 … … 293 293 294 294 if (lg.ge.13.and.line(1:1).eq.'#'.and.line(2:5).eq.resl) then 295 c_____________________________________________ read atom data for 'resl'295 ! _____________________________________________ read atom data for 'resl' 296 296 read (line(6:13),'(2i4)',err=3) nat,nxt 297 297 … … 308 308 309 309 read (lunlib,'(a4,3(1x,i2,a1,a3,d9.3),d7.4,i4,4i4)', 310 #end=3,err=3)311 #nmath(i),icl(1),fix(1),nm(1),blath(i),icl(2),fix(2),nm(2),ba,312 #icl(3),fix(3),nm(3),to,cgath(i),ity,iow,(ibd(j),j=1,mxbd)310 & end=3,err=3) 311 & nmath(i),icl(1),fix(1),nm(1),blath(i),icl(2),fix(2),nm(2),ba, 312 & icl(3),fix(3),nm(3),to,cgath(i),ity,iow,(ibd(j),j=1,mxbd) 313 313 314 314 if (ity.le.0.or.ity.gt.mxtyat) goto 6 … … 326 326 if (i.eq.jow) then 327 327 write (*,'(5a)') ' redres> atom ',nmath(i),' of ', 328 #resl,' cannot preceed itself '328 & resl,' cannot preceed itself ' 329 329 else 330 330 write (*,'(5a,i4)') ' redres> atom ',nmath(i),' of ', 331 #resl,' should be placed AFTER atom #',jow331 & resl,' should be placed AFTER atom #',jow 332 332 endif 333 333 goto 5 … … 336 336 iowath(i)=jow 337 337 iyowath(i)=sign(1,iow) 338 c____________________________________ check order & find number of bonds339 c(bonds closing ring must be last !)338 ! ____________________________________ check order & find number of bonds 339 ! (bonds closing ring must be last !) 340 340 ib1=abs(ibd(1)) 341 341 ib2=abs(ibd(2)) … … 354 354 else 355 355 if ( ib2.eq.jow.or.ib2.eq.ib1.or. 356 #(ib2.gt.i.and.ib2.lt.ib1) ) goto 4356 & (ib2.gt.i.and.ib2.lt.ib1) ) goto 4 357 357 if (ib3.eq.0) then 358 358 nbdath(i)=2 359 359 else 360 360 if (ib3.eq.jow.or.ib3.eq.ib1.or.ib3.eq.ib2.or. 361 #(ib3.gt.i.and.(ib3.lt.ib1.or.ib3.lt.ib2)) ) goto 4361 & (ib3.gt.i.and.(ib3.lt.ib1.or.ib3.lt.ib2)) ) goto 4 362 362 nbdath(i)=3 363 363 endif … … 373 373 toath(i)=to*cdr 374 374 375 c______________________________ internal degrees of freedom375 ! ______________________________ internal degrees of freedom 376 376 do j=1,3 377 377 if (fix(j).ne.blnk) then … … 380 380 if (nvrr.gt.mxvrh) then 381 381 write (*,'(a,i5)') ' redres> number of variables > ', 382 #mxvrh382 & mxvrh 383 383 close(lunlib) 384 384 stop … … 388 388 389 389 if ( ic.le.0 390 #.or.(j.eq.3.and.ic.gt.mxtyto) ! dihedral391 #.or.(j.eq.2.and.ic.gt.mxtyba) ! bond angle392 #.or.(j.eq.1.and.ic.gt.mxtybl) ) goto 7 ! b. length390 & .or.(j.eq.3.and.ic.gt.mxtyto) ! dihedral 391 & .or.(j.eq.2.and.ic.gt.mxtyba) ! bond angle 392 & .or.(j.eq.1.and.ic.gt.mxtybl) ) goto 7 ! b. length 393 393 394 394 ityvrh(nvrr)=j … … 407 407 goto 1 408 408 409 c____________________________________________________________ ERRORS409 ! ____________________________________________________________ ERRORS 410 410 2 write (*,'(4a)') ' redres> residue >',resl,'< NOT FOUND in ', 411 #reslib(1:iendst(reslib))411 &reslib(1:iendst(reslib)) 412 412 close(lunlib) 413 413 stop 414 414 415 415 3 write (*,'(a,i4,2a)') ' redres> ERROR reading line No. ',nln, 416 #' in ',reslib(1:iendst(reslib))416 &' in ',reslib(1:iendst(reslib)) 417 417 close(lunlib) 418 418 stop 419 419 420 420 4 write (*,'(4a)') ' redres> Incorrect order of bonds for atom ', 421 #nmath(i),' of ',resl421 & nmath(i),' of ',resl 422 422 423 423 5 write (*,'(8x,2a)') '... must correct ', 424 #reslib(1:iendst(reslib))424 & reslib(1:iendst(reslib)) 425 425 close(lunlib) 426 426 stop 427 427 428 428 6 write (*,'(a,i2,4a)') ' redres> unknown type :',ity, 429 #': for atom ',nmath(i),' in residue ',resl429 & ': for atom ',nmath(i),' in residue ',resl 430 430 close(lunlib) 431 431 stop 432 432 433 433 7 write (*,'(a,i2,4a)') ' redres> unknown class :',ic, 434 #': for variable ',nm(j),' in residue ',resl434 & ': for variable ',nm(j),' in residue ',resl 435 435 close(lunlib) 436 436 stop
Note:
See TracChangeset
for help on using the changeset viewer.