- Timestamp:
- 09/05/08 11:49:42 (16 years ago)
- Branches:
- master
- Children:
- fafe4d6
- Parents:
- 2ebb8b6
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
setmvs.f
r2ebb8b6 rbd2278d 1 c**************************************************************2 c 3 cThis file contains the subroutines: setmvs,fndbrn4 c 5 cCopyright 2003-2005 Frank Eisenmenger, U.H.E. Hansmann,6 cShura Hayryan, Chin-Ku7 cCopyright 2007 Frank Eisenmenger, U.H.E. Hansmann,8 cJan H. Meinke, Sandipan Mohanty9 c 10 c**************************************************************1 !************************************************************** 2 ! 3 ! This file contains the subroutines: setmvs,fndbrn 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 11 12 12 13 13 subroutine setmvs(nml) 14 14 15 c......................................................................16 cPURPOSE: 1. ORDER variables according to rules:17 cvariables with same base: 1st comes TORSION (can be only18 cone with this base, since PHASE a. assumed to be FIXED),19 cafter this, for atoms branching from this base:20 cfor a b.angle & b.length with common primary moving21 catom=branch atom - b.angle comes 1st22 c 23 ciorvr(i), i=i_fivr_ml,i_lavr_ml -> indices of ordered var.24 c 25 c2. define NON-OVERLAPPING moving sets of atoms in molecule26 c'nml' related to local variables27 c 28 cnmsml(i_ml) - number of moving sets per molecule29 cimsvr1(i_vr),imsvr2() - indices of 1st/last m.s for var. 'i_vr'30 cin 'latms1' & 'latms2'31 clatms1(i_ms),latms2() - range of atoms of i-th m.s32 c 33 c3. define indices of next-following variables for each var.,34 cwhich complete its physical moving set ('added' variables)35 c36 cnadml(i_ml) - number of 'added' var.s per molecule37 ciadvr1(i_vr),iadvr2() - indices of 1st/last 'added' var. for38 cvar. 'i_vr' in 'ladvr'39 cladvr() - indices of 'added' variables40 c 41 c4. define index of corresponding variable for each atom42 c 43 c! routine must be called successively for molecules 1 -> ntlml44 c 45 cCALLS: fndbrn, nursvr46 c......................................................................15 ! ...................................................................... 16 ! PURPOSE: 1. ORDER variables according to rules: 17 ! variables with same base: 1st comes TORSION (can be only 18 ! one with this base, since PHASE a. assumed to be FIXED), 19 ! after this, for atoms branching from this base: 20 ! for a b.angle & b.length with common primary moving 21 ! atom=branch atom - b.angle comes 1st 22 ! 23 ! iorvr(i), i=i_fivr_ml,i_lavr_ml -> indices of ordered var. 24 ! 25 ! 2. define NON-OVERLAPPING moving sets of atoms in molecule 26 ! 'nml' related to local variables 27 ! 28 ! nmsml(i_ml) - number of moving sets per molecule 29 ! imsvr1(i_vr),imsvr2() - indices of 1st/last m.s for var. 'i_vr' 30 ! in 'latms1' & 'latms2' 31 ! latms1(i_ms),latms2() - range of atoms of i-th m.s 32 ! 33 ! 3. define indices of next-following variables for each var., 34 ! which complete its physical moving set ('added' variables) 35 ! 36 ! nadml(i_ml) - number of 'added' var.s per molecule 37 ! iadvr1(i_vr),iadvr2() - indices of 1st/last 'added' var. for 38 ! var. 'i_vr' in 'ladvr' 39 ! ladvr() - indices of 'added' variables 40 ! 41 ! 4. define index of corresponding variable for each atom 42 ! 43 ! ! routine must be called successively for molecules 1 -> ntlml 44 ! 45 ! CALLS: fndbrn, nursvr 46 ! ...................................................................... 47 47 48 48 include 'INCL.H' … … 70 70 if (ntlvr.eq.0) then 71 71 write (*,'(a,i4)') 72 #' setmvs> No variables defined in molecule #',nml72 & ' setmvs> No variables defined in molecule #',nml 73 73 nmsml(nml)=0 74 74 nadml(nml)=0 75 75 return 76 76 endif 77 c_________________ Take index of primary atom for each variable78 c(i.e. index of atom moved by variable) to79 csort variables, handling variables with same base:80 cmodify indices to obtain appropriate order77 ! _________________ Take index of primary atom for each variable 78 ! (i.e. index of atom moved by variable) to 79 ! sort variables, handling variables with same base: 80 ! modify indices to obtain appropriate order 81 81 82 82 ifirs=irsml1(nml) … … 108 108 enddo ! ... Variables 109 109 enddo ! ... Residues 110 c___________________________________ Sort variables in ascending order111 c(i.e. from start of molecule/base of branches)112 carray 'iorvr' gives indices of (1st,2nd, ... ,n-th) variables;113 cas can be found in arrays for variables (example: ityvr(iorvr())110 ! ___________________________________ Sort variables in ascending order 111 ! (i.e. from start of molecule/base of branches) 112 ! array 'iorvr' gives indices of (1st,2nd, ... ,n-th) variables; 113 ! as can be found in arrays for variables (example: ityvr(iorvr()) 114 114 k=ilavr 115 115 l=ifivr+ntlvr/2 … … 143 143 iorvr(i)=io 144 144 goto 1 145 c______________________________ Find non-overlapping ranges of atoms (moving146 csets) for each variable145 ! ______________________________ Find non-overlapping ranges of atoms (moving 146 ! sets) for each variable 147 147 2 nms=imsml1(nml)-1 148 148 … … 152 152 ia=iatvr(iv) ! primary mov. atom 153 153 ib=iowat(ia) ! base 154 c__________________________ First, determine complete mov. set for 'iv'154 ! __________________________ First, determine complete mov. set for 'iv' 155 155 it=ityvr(iv) 156 156 if (it.eq.3) then ! torsion … … 164 164 if (j.gt.(i2+1).or.k.lt.(i1-1)) then 165 165 write (*,'(3a,/,2a,i4,a,i3)') 166 #' setmvs> Cannot combine disjunct ranges of atom',167 #' indices for torsion ',nmvr(iv),' in residue ',168 #seq(ir),ir,' of molecule # ',nml166 & ' setmvs> Cannot combine disjunct ranges of atom', 167 & ' indices for torsion ',nmvr(iv),' in residue ', 168 & seq(ir),ir,' of molecule # ',nml 169 169 stop 170 170 else … … 186 186 if ((nms+1).gt.mxms) then 187 187 write (*,'(a,i4,a,i5)') ' setmvs> Molecule # ',nml, 188 #': Number of moving sets > ',mxms188 & ': Number of moving sets > ',mxms 189 189 stop 190 190 endif … … 193 193 imsvr2(iv)=nms+1 ! & last m.s for var. 'iv' 194 194 195 c______________ Next, exclude overlaps between mov. set for 'iv' and the196 cm.s. for 'previous' variables by reducing/splitting those195 ! ______________ Next, exclude overlaps between mov. set for 'iv' and the 196 ! m.s. for 'previous' variables by reducing/splitting those 197 197 198 198 do jo=ifivr,io-1 ! prev. variables ... … … 219 219 if (nms.gt.mxms) then 220 220 write (*,'(a,i4,a,i5)') ' setmvs> Molecule # ', 221 #nml,': Number of moving sets > ',mxms221 & nml,': Number of moving sets > ',mxms 222 222 stop 223 223 endif … … 259 259 260 260 enddo ! prev. variables 261 c_______________________________ Finally, add moving set for 'iv'261 ! _______________________________ Finally, add moving set for 'iv' 262 262 nms=nms+1 263 263 latms1(nms)=i1 … … 265 265 enddo ! variables 266 266 nmsml(nml)=nms-imsml1(nml)+1 267 c_____________________________ Determine index of moving set for each atom267 ! _____________________________ Determine index of moving set for each atom 268 268 do ia=ifiat,ilaat 269 269 ixmsat(ia)=0 … … 274 274 enddo 275 275 enddo 276 c_____________________________ Determine indices of variables which moving277 cset sets have to be added (=are related) to278 cthose of a given variable276 ! _____________________________ Determine indices of variables which moving 277 ! set sets have to be added (=are related) to 278 ! those of a given variable 279 279 280 280 i=iorvr(ifivr) ! initialize index of CURRENT var. … … 300 300 jb=iowat(ja) ! its base 301 301 302 c_______________ current var. is torsion & shares base with var. 'j'302 ! _______________ current var. is torsion & shares base with var. 'j' 303 303 if (it.eq.3.and.jb.eq.ib) then 304 304 do k=n,nad ! ? has this branch been registered before ? … … 308 308 if (nad.gt.mxvr) then 309 309 write (*,'(a,i4,a,i5)') ' setmvs> Molecule # ',nml, 310 #': Number of added variables > ',mxvr310 & ': Number of added variables > ',mxvr 311 311 stop 312 312 endif … … 323 323 if (nad.gt.mxvr) then 324 324 write (*,'(a,i4,a,i5)') ' setmvs> Molecule # ',nml, 325 #': Number of added variables > ',mxvr325 & ': Number of added variables > ',mxvr 326 326 stop 327 327 endif … … 337 337 if (nad.gt.mxvr) then 338 338 write (*,'(a,i4,a,i5)') ' setmvs> Molecule # ',nml, 339 #': Number of added variables > ',mxvr339 & ': Number of added variables > ',mxvr 340 340 stop 341 341 endif … … 351 351 352 352 nadml(nml)=nad-iadml1(nml)+1 353 c_____________________________________ Summary354 cdo io=ilavr,ifivr,-1355 civ=iorvr(io)356 cib=iowat(iatvr(iv))357 ci1s=imsvr1(iv)358 ci2s=imsvr2(iv)359 cif (i1s.le.i2s) then360 cdo i=i1s,i2s361 ci1=latms1(i)362 ci2=latms2(i)363 cif (i.eq.i1s) then364 cwrite (*,'(a,i3,7a,i4,3a,i4,a)') 'res # ',nursvr(iv),365 c# ' var: ',nmvr(iv),' base:',nmat(ib),' atoms= ',366 c# nmat(i1),'(',i1,') - ',nmat(i2),'(',i2,')'367 celse368 cwrite (*,'(39x,2a,i4,3a,i4,a)')369 c# nmat(i1),'(',i1,') - ',nmat(i2),'(',i2,')'370 cendif371 cenddo372 celse373 cwrite (*,'(a,i3,5a)') 'res # ',nursvr(iv),374 c# ' var: ',nmvr(iv),' base:',nmat(ib),' No atoms'375 cendif376 ci1a=iadvr1(iv)377 ci2a=iadvr2(iv)378 cif (i1a.le.i2a) then379 cwrite (*,'(a,30(1x,a))') ' Depending variables:',380 c# (nmvr(ladvr(i)),i=i1a,i2a)381 celse382 cwrite (*,'(a)') ' No dep. variables'383 cendif384 cenddo385 c_____________________________________ Summary - End353 ! _____________________________________ Summary 354 ! do io=ilavr,ifivr,-1 355 ! iv=iorvr(io) 356 ! ib=iowat(iatvr(iv)) 357 ! i1s=imsvr1(iv) 358 ! i2s=imsvr2(iv) 359 ! if (i1s.le.i2s) then 360 ! do i=i1s,i2s 361 ! i1=latms1(i) 362 ! i2=latms2(i) 363 ! if (i.eq.i1s) then 364 ! write (*,'(a,i3,7a,i4,3a,i4,a)') 'res # ',nursvr(iv), 365 ! # ' var: ',nmvr(iv),' base:',nmat(ib),' atoms= ', 366 ! # nmat(i1),'(',i1,') - ',nmat(i2),'(',i2,')' 367 ! else 368 ! write (*,'(39x,2a,i4,3a,i4,a)') 369 ! # nmat(i1),'(',i1,') - ',nmat(i2),'(',i2,')' 370 ! endif 371 ! enddo 372 ! else 373 ! write (*,'(a,i3,5a)') 'res # ',nursvr(iv), 374 ! # ' var: ',nmvr(iv),' base:',nmat(ib),' No atoms' 375 ! endif 376 ! i1a=iadvr1(iv) 377 ! i2a=iadvr2(iv) 378 ! if (i1a.le.i2a) then 379 ! write (*,'(a,30(1x,a))') ' Depending variables:', 380 ! # (nmvr(ladvr(i)),i=i1a,i2a) 381 ! else 382 ! write (*,'(a)') ' No dep. variables' 383 ! endif 384 ! enddo 385 ! _____________________________________ Summary - End 386 386 387 387 return 388 388 389 389 6 write (*,'(a,i4,/,2(a,i5),a)') 390 #' setmvs> Error in atom numbering of molecule # ',nml,391 #': atom ranges for variables # ',iv,' and # ',jv,392 #' overlap only PARTLY'390 & ' setmvs> Error in atom numbering of molecule # ',nml, 391 & ': atom ranges for variables # ',iv,' and # ',jv, 392 & ' overlap only PARTLY' 393 393 stop 394 394 395 395 end 396 c*******************************************************396 ! ******************************************************* 397 397 subroutine fndbrn(nml,nrs,ifirg,ilarg,irg1,irg2,bb) 398 398 399 c.........................................................400 cPURPOSE: determine range [ifirg,ilarg] of atom indices401 cfor branch starting from atom 'ifirg' of residue402 c'nrs' in molecule 'nml'403 cOUTPUT: BB - .t. if 'ifirg' is a backbone atom404 cIRG1 & IRG2 - atom indices of ring-closing bond,405 cif 'ifirg' is INSIDE a ring, but NOT406 cits 1st atom ( in 'multiple' rings407 conly LAST closing bond is given !)408 c 409 cCALLS: none410 c 411 c.........................................................399 ! ......................................................... 400 ! PURPOSE: determine range [ifirg,ilarg] of atom indices 401 ! for branch starting from atom 'ifirg' of residue 402 ! 'nrs' in molecule 'nml' 403 ! OUTPUT: BB - .t. if 'ifirg' is a backbone atom 404 ! IRG1 & IRG2 - atom indices of ring-closing bond, 405 ! if 'ifirg' is INSIDE a ring, but NOT 406 ! its 1st atom ( in 'multiple' rings 407 ! only LAST closing bond is given !) 408 ! 409 ! CALLS: none 410 ! 411 ! ......................................................... 412 412 413 413 include 'INCL.H'
Note:
See TracChangeset
for help on using the changeset viewer.