Changeset bd2278d
- Timestamp:
- 09/05/08 11:49:42 (16 years ago)
- Branches:
- master
- Children:
- fafe4d6
- Parents:
- 2ebb8b6
- Files:
-
- 1 added
- 62 edited
Legend:
- Unmodified
- Added
- Removed
-
EXAMPLES/parallel_tempering_s.f
r2ebb8b6 rbd2278d 20 20 integer switch 21 21 22 c=================================================== Energy setup22 ! =================================================== Energy setup 23 23 24 cDirectory for SMMP libraries25 cChange the following directory path to where you want to put SMMP26 clibraries of residues.24 ! Directory for SMMP libraries 25 ! Change the following directory path to where you want to put SMMP 26 ! libraries of residues. 27 27 libdir='../SMMP/' 28 28 29 cThe switch in the following line is now not used.29 ! The switch in the following line is now not used. 30 30 flex=.false. ! .true. for Flex / .false. for ECEPP 31 31 32 cChoose energy type with the following switch instead ...32 ! Choose energy type with the following switch instead ... 33 33 ientyp = 0 34 c0 => ECEPP2 or ECEPP3 depending on the value of sh235 c1 => FLEX36 c2 => Lund force field37 c3 => ECEPP with Abagyan corrections38 c 34 ! 0 => ECEPP2 or ECEPP3 depending on the value of sh2 35 ! 1 => FLEX 36 ! 2 => Lund force field 37 ! 3 => ECEPP with Abagyan corrections 38 ! 39 39 40 40 sh2=.false. ! .true. for ECEPP/2; .false. for ECEPP3 … … 48 48 call init_energy(libdir) 49 49 50 c================================================= Structure setup50 ! ================================================= Structure setup 51 51 52 52 grpn = 'nh2' ! N-terminal group … … 59 59 ntlml = 0 60 60 write (*,*) 'Solvent: ', itysol 61 cInitialize random number generator.61 ! Initialize random number generator. 62 62 call sgrnd(31433) 63 63 … … 69 69 70 70 call init_molecule(iabin,grpn,grpc,seqfile,varfile) 71 cDecide if and when to use BGS, and initialize Lund data structures71 ! Decide if and when to use BGS, and initialize Lund data structures 72 72 bgsprob=0.75 ! Prob for BGS, given that it is possible 73 cupchswitch= 0 => No BGS 1 => BGS with probability bgsprob74 c2 => temperature dependent choice73 ! upchswitch= 0 => No BGS 1 => BGS with probability bgsprob 74 ! 2 => temperature dependent choice 75 75 upchswitch=1 76 76 rndord=.true. … … 80 80 81 81 82 c======================================== Add your task down here82 ! ======================================== Add your task down here 83 83 num_rep = 5 84 84 nequi = 100 … … 87 87 newsta = .true. 88 88 switch = 1 89 cparallel tempering on a single CPU89 ! parallel tempering on a single CPU 90 90 eol = energy() 91 91 write (*,*) "Energy before randomization:", eol … … 94 94 write (*,*) "Final energy:", eol 95 95 96 c======================================== End of main96 ! ======================================== End of main 97 97 end -
EXAMPLES/partem_p.f
r2ebb8b6 rbd2278d 1 c**************************************************************2 c3 cThis file contains the subroutines: partem_p4 CCompared to the version in the main distribution, this5 Croutine doesn't write the rmsd nor native contacts to the time6 Cseries.7 c8 cCopyright 2003-2005 Frank Eisenmenger, U.H.E. Hansmann,9 cShura Hayryan, Chin-Ku Hu10 cCopyright 2007 Frank Eisenmenger, U.H.E. Hansmann,11 cJan H. Meinke, Sandipan Mohanty12 c13 c**************************************************************1 !************************************************************** 2 ! 3 ! This file contains the subroutines: partem_p 4 ! Compared to the version in the main distribution, this 5 ! routine doesn't write the rmsd nor native contacts to the time 6 ! series. 7 ! 8 ! Copyright 2003-2005 Frank Eisenmenger, U.H.E. Hansmann, 9 ! Shura Hayryan, Chin-Ku Hu 10 ! Copyright 2007 Frank Eisenmenger, U.H.E. Hansmann, 11 ! Jan H. Meinke, Sandipan Mohanty 12 ! 13 ! ************************************************************** 14 14 15 15 subroutine partem_p(num_rep, nequi, nswp, nmes, nsave, newsta, 16 16 & switch, rep_id, partem_comm) 17 C18 CPURPOSE: SIMULATION OF PROTEINS BY PARALLEL TEMPERING ALGORITHM19 CON PARALLEL COMPUTERS USING MPI20 C21 Cswitch: Choses the starting configuration:22 C-1 - stretched configuration23 C0 - don't change anything24 C1 - random start configuration25 C26 cCALLS: addang,contacts,energy,hbond,helix,iendst,metropolis,27 coutvar,(rand),rgyr28 C17 ! 18 ! PURPOSE: SIMULATION OF PROTEINS BY PARALLEL TEMPERING ALGORITHM 19 ! ON PARALLEL COMPUTERS USING MPI 20 ! 21 ! switch: Choses the starting configuration: 22 ! -1 - stretched configuration 23 ! 0 - don't change anything 24 ! 1 - random start configuration 25 ! 26 ! CALLS: addang,contacts,energy,hbond,helix,iendst,metropolis, 27 ! outvar,(rand),rgyr 28 ! 29 29 include '../INCL.H' 30 30 include '../INCP.H' … … 37 37 external can_weight 38 38 39 Cnequi: number of Monte Carlo sweeps for thermalization40 Cnswp: number of Monte Carlo sweeps41 Cnmes: number of Monte Carlo sweeps between measurments42 Cnewsta: .true. for new simulations, .false. for re-start39 ! nequi: number of Monte Carlo sweeps for thermalization 40 ! nswp: number of Monte Carlo sweeps 41 ! nmes: number of Monte Carlo sweeps between measurments 42 ! newsta: .true. for new simulations, .false. for re-start 43 43 44 44 dimension eavm(MAX_PROC),sph(MAX_PROC),intem(MAX_PROC), … … 50 50 double precision e_min, e_minp(MAX_PROC), e_minpt(MAX_PROC) 51 51 integer h_max, h_maxp(MAX_PROC) 52 cOrder of replica exchange52 ! Order of replica exchange 53 53 integer odd 54 54 ! Counter to keep random number generators in sync 55 55 integer randomCount 56 56 57 cCollect partial energies. Only the root writes to disk. We have to58 ccollect the information from the different replicas and provide59 carrays to store them.60 ceyslr storage array for solvent energy61 ceyelp - " - coulomb energy62 ceyvwp - " - van-der-Waals energy63 ceyhbp - " - hydrogen bonding energy64 ceysmi - " - intermolecular interaction energy57 ! Collect partial energies. Only the root writes to disk. We have to 58 ! collect the information from the different replicas and provide 59 ! arrays to store them. 60 ! eyslr storage array for solvent energy 61 ! eyelp - " - coulomb energy 62 ! eyvwp - " - van-der-Waals energy 63 ! eyhbp - " - hydrogen bonding energy 64 ! eysmi - " - intermolecular interaction energy 65 65 double precision eyslr(MAX_PROC) 66 66 double precision eyelp(MAX_PROC),eyvwp(MAX_PROC),eyhbp(MAX_PROC), 67 67 & eyvrp(MAX_PROC),eysmip(MAX_PROC) 68 cCollect information about accessible surface and van-der-Waals volume69 casap storage array for solvent accessible surface70 cvdvolp storage array for van-der-Waals volume68 ! Collect information about accessible surface and van-der-Waals volume 69 ! asap storage array for solvent accessible surface 70 ! vdvolp storage array for van-der-Waals volume 71 71 double precision asap(MAX_PROC), vdvolp(MAX_PROC) 72 72 … … 75 75 integer imhbp(MAX_PROC) 76 76 character*80 filebase, fileNameMP, tbase0,tbase1 77 cframe frame number for writing configurations78 ctrackID configuration that should be tracked and written out79 cdir direction in random walk80 c-1 - visited highest temperature last81 c1 - visited lowest temperature last82 c0 - haven't visited the boundaries yet.83 cdirp storage array for directions.77 ! frame frame number for writing configurations 78 ! trackID configuration that should be tracked and written out 79 ! dir direction in random walk 80 ! -1 - visited highest temperature last 81 ! 1 - visited lowest temperature last 82 ! 0 - haven't visited the boundaries yet. 83 ! dirp storage array for directions. 84 84 integer frame, trackID, dir 85 85 integer dirp(MAX_PROC) … … 92 92 & rep_id, num_rep, partem_comm, myrank 93 93 call flush(6) 94 C95 c96 CFile with temperatures94 ! 95 ! 96 ! File with temperatures 97 97 open(11,file='temperatures_abeta',status='old') 98 98 … … 100 100 open(18,file=fileNameMP(tbase0,5,9,rep_id),status='unknown') 101 101 if (rep_id.eq.0.and.myrank.eq.0) then 102 cFile with time series of simulation102 ! File with time series of simulation 103 103 open(14,file='ts.d',status='unknown') 104 104 endif 105 105 106 CREAD IN TEMPERATURES106 ! READ IN TEMPERATURES 107 107 do i=1,num_rep 108 108 read(11,*) j,temp … … 111 111 close(11) 112 112 113 cnresi: number of residues113 ! nresi: number of residues 114 114 nresi=irsml2(1)-irsml1(1)+1 115 C116 CInitialize variables115 ! 116 ! Initialize variables 117 117 do i=1,num_rep 118 118 acx1(i) = 0.0d0 … … 132 132 dir = dirp(rep_id + 1) 133 133 134 c_________________________________ Initialize Variables134 ! _________________________________ Initialize Variables 135 135 if(newsta) then 136 136 iold=0 … … 139 139 intem(i) = i 140 140 end do 141 c_________________________________ initialize starting configuration141 ! _________________________________ initialize starting configuration 142 142 if (switch.ne.0) then 143 143 do i=1,nvr … … 173 173 CALL MPI_BCAST(INODE,num_rep,MPI_INTEGER,0,MPI_COMM_WORLD,IERR) 174 174 CALL MPI_BCAST(YOL,num_rep,MPI_DOUBLE_PRECISION,0, 175 #MPI_COMM_WORLD,IERR)175 & MPI_COMM_WORLD,IERR) 176 176 CALL MPI_BCAST(E_MINP, num_rep, MPI_DOUBLE_PRECISION, 0, 177 #MPI_COMM_WORLD, IERR)177 & MPI_COMM_WORLD, IERR) 178 178 CALL MPI_BCAST(h_maxp,num_rep,MPI_INTEGER,0,MPI_COMM_WORLD, 179 $IERR)179 & IERR) 180 180 end if 181 181 … … 189 189 write(*,*) rep_id, yol(rep_id + 1), eol 190 190 endif 191 CStart of simulation191 ! Start of simulation 192 192 write (*,*) '[',rep_id, myrank, beta, partem_comm, 193 193 & '] Energy before equilibration:', eol 194 c=====================Equilibration by canonical Metropolis194 ! =====================Equilibration by canonical Metropolis 195 195 do nsw=1,nequi 196 196 call metropolis(eol,acz,can_weight) … … 199 199 write (*,*) '[',rep_id,'] Energy after equilibration:', eol 200 200 call flush(6) 201 C202 C======================Multiple Markov Chains201 ! 202 !======================Multiple Markov Chains 203 203 acz = 0 204 204 do nsw=1,nswp 205 c------------First ordinary Metropolis205 !------------First ordinary Metropolis 206 206 call metropolis(eol,acz,can_weight) 207 207 iold = iold + 1 … … 214 214 endif 215 215 acz0 = acz 216 CMeasure global radius of gyration216 ! Measure global radius of gyration 217 217 call rgyr(0,rgy,ee) 218 218 rgyp = rgy 219 CMeasure Helicity and Sheetness219 ! Measure Helicity and Sheetness 220 220 call helix(nhel,mhel,nbet,mbet) 221 CMeasure Number of hydrogen bonds221 ! Measure Number of hydrogen bonds 222 222 mhb = 0 223 223 do i = 1, ntlml … … 226 226 enddo 227 227 call interhbond(imhb) 228 CMeasure total number of contacts (NCTOT) and number of229 Cnative contacts (NCNAT)228 ! Measure total number of contacts (NCTOT) and number of 229 ! native contacts (NCNAT) 230 230 call contacts(nctot,ncnat,dham) 231 cAdd tracking of lowest energy configuration231 ! Add tracking of lowest energy configuration 232 232 if (eol.lt.e_min) then 233 cWrite out configuration233 ! Write out configuration 234 234 i=rep_id+1 235 235 j=inode(i) … … 248 248 close(15) 249 249 endif 250 cAdd tracking of configuration with larges hydrogen contents.250 ! Add tracking of configuration with larges hydrogen contents. 251 251 if ((mhb + imhb).gt.h_max) then 252 cWrite out configuration252 ! Write out configuration 253 253 i = rep_id + 1 254 254 j = inode(i) … … 268 268 endif 269 269 270 C271 C--------------------Gather measurement data270 ! 271 !--------------------Gather measurement data 272 272 ! I only use the master node of each replica for data collection. The 273 273 ! variable partem_comm provides the appropriate communicator. … … 310 310 & MPI_DOUBLE_PRECISION,0,partem_comm,IERR) 311 311 312 cWrite trajectory312 ! Write trajectory 313 313 write (18,*) '@@@',iold,inode(rep_id+1) 314 314 call outvbs(0,18) 315 315 write (18,*) '###' 316 316 ! call flush(18) 317 cWrite current configuration317 ! Write current configuration 318 318 if ((mod(iold, nsave).eq.0)) then 319 319 filebase = "conf_0000.var" … … 324 324 if(rep_id.eq.0.and.myrank.eq.0) then 325 325 randomCount = 0 326 cUpdate acceptance, temperature wise average of E and E^2 used to calculate327 cspecific heat.326 ! Update acceptance, temperature wise average of E and E^2 used to calculate 327 ! specific heat. 328 328 do i=1,num_rep 329 329 j=intem(i) 330 330 acy(i)=0.0 331 cAbove: contents of acy1 are added to acy(i) a few lines down.332 cacy1(intem(i)) contains information received from the node at temperature333 ci, on how many updates have been accepted in node intem(i). Since acz334 cis not reset to 0 every cycle, acy(i) must be set to 0 here. Else, there335 cwill be serious double counting and the values of acceptance printed336 cwill be simply wrong.331 ! Above: contents of acy1 are added to acy(i) a few lines down. 332 ! acy1(intem(i)) contains information received from the node at temperature 333 ! i, on how many updates have been accepted in node intem(i). Since acz 334 ! is not reset to 0 every cycle, acy(i) must be set to 0 here. Else, there 335 ! will be serious double counting and the values of acceptance printed 336 ! will be simply wrong. 337 337 e_minpt(i)=e_minp(intem(i)) 338 338 end do … … 346 346 347 347 348 CWrite measurements to the time series file ts.d348 ! Write measurements to the time series file ts.d 349 349 do i=1,num_rep 350 350 j=intem(i) … … 354 354 355 355 end do 356 cWrite the current parallel tempering information into par_R.in356 ! Write the current parallel tempering information into par_R.in 357 357 if ((mod(iold, nsave).eq.0)) 358 358 & then … … 363 363 & h_maxp(i) 364 364 end do 365 C-------------------------- Various statistics of current run366 cswp=nswp-nequi365 ! -------------------------- Various statistics of current run 366 ! swp=nswp-nequi 367 367 swp=nsw 368 368 write(13,*) 'Acceptance rate for change of chains:' … … 370 370 temp=1.0d0/pbe(k1)/0.00198773 371 371 write(13,*) temp, acx1(k1)*2.0d0*nmes/swp 372 cAbove: it's the acceptance rate of exchange of replicas. Since a373 creplica exchange is attempted only once every nmes sweeps, the374 crate should be normalized with (nmes/swp).372 ! Above: it's the acceptance rate of exchange of replicas. Since a 373 ! replica exchange is attempted only once every nmes sweeps, the 374 ! rate should be normalized with (nmes/swp). 375 375 end do 376 376 write(13,*) … … 381 381 geavm(k1) = nmes*eavm(k1)/swp 382 382 gsph(k1) = (nmes*sph(k1)/swp-geavm(k1)**2) 383 #*beta*beta/nresi383 & *beta*beta/nresi 384 384 write(13,'(a,2f9.2,i4,f12.3)') 385 385 & 'Temperature, Node,local acceptance rate:', 386 386 & beta,temp,k,acy(k1)/dble(nsw*nvr) 387 cAbove: Changed (nswp-nequi) in the denominator of acceptance as388 cacceptance values are initialized to 0 after equilibration cycles are389 cfinished. Note also that since this is being written in the middle of390 cthe simulation, it is normalized to nsw instead of nswp.387 ! Above: Changed (nswp-nequi) in the denominator of acceptance as 388 ! acceptance values are initialized to 0 after equilibration cycles are 389 ! finished. Note also that since this is being written in the middle of 390 ! the simulation, it is normalized to nsw instead of nswp. 391 391 write(13,'(a,3f12.2)') 392 392 & 'Last Energy, Average Energy, Spec. Heat:', … … 401 401 end if 402 402 403 C--------------------Parallel Tempering update404 cSwap with right neighbor (odd, even)403 !--------------------Parallel Tempering update 404 ! Swap with right neighbor (odd, even) 405 405 if(odd.eq.1) then 406 406 nu=1 407 407 no1 = num_rep-1 408 cSwap with left neighbor (even, odd)408 ! Swap with left neighbor (even, odd) 409 409 else 410 410 nu = 2 … … 413 413 do i=nu,no1,2 414 414 j=i+1 415 cPeriodic bc for swaps415 ! Periodic bc for swaps 416 416 if(i.eq.num_rep) j=1 417 417 iidx=intem(i) … … 429 429 end if 430 430 end do 431 c---------------- End Loop over nodes which creates a new temperature432 cmap for all nodes, at the node with rank 0.433 c431 ! ---------------- End Loop over nodes which creates a new temperature 432 ! map for all nodes, at the node with rank 0. 433 ! 434 434 odd = 1 - odd 435 435 end if 436 cEnd of "if (myrank.eq.0) ...". The block above includes PT update and437 cwriting of observables into the time series file etc.436 ! End of "if (myrank.eq.0) ...". The block above includes PT update and 437 ! writing of observables into the time series file etc. 438 438 439 cBelow: Communicate new temperature-node map to all nodes439 ! Below: Communicate new temperature-node map to all nodes 440 440 CALL MPI_BCAST(INTEM,num_rep,MPI_INTEGER,0,MPI_COMM_WORLD, 441 441 & IERR) … … 446 446 CALL MPI_BCAST(H_MAXP,num_rep,MPI_INTEGER,0,MPI_COMM_WORLD, 447 447 & IERR) 448 cSynchronize random number generators for replica 0448 ! Synchronize random number generators for replica 0 449 449 if (rep_id.eq.0) then 450 450 CALL MPI_BCAST(randomCount,1,MPI_INTEGER,0,my_mpi_comm, … … 467 467 468 468 endif 469 cEnd of "if (mod(iold,nmes).eq.0) ..."469 ! End of "if (mod(iold,nmes).eq.0) ..." 470 470 end do 471 c-----------End Loop over sweeps472 c473 COUTPUT:474 C--------------------For Re-starts:471 !-----------End Loop over sweeps 472 ! 473 ! OUTPUT: 474 !--------------------For Re-starts: 475 475 nu = rep_id + 1 476 476 filebase = "conf_0000.var" … … 484 484 if (partem_comm.ne.MPI_COMM_NULL) then 485 485 CALL MPI_GATHER(EOL0,1,MPI_DOUBLE_PRECISION,YOL,1, 486 #MPI_DOUBLE_PRECISION,0,partem_comm,IERR)486 & MPI_DOUBLE_PRECISION,0,partem_comm,IERR) 487 487 CALL MPI_GATHER(acz0,1,MPI_DOUBLE_PRECISION,acy1,1, 488 #MPI_DOUBLE_PRECISION,0,partem_comm,IERR)488 & MPI_DOUBLE_PRECISION,0,partem_comm,IERR) 489 489 endif 490 490 … … 496 496 write(13,*) i,inode(i),intem(i),yol(i),e_minp(i),h_maxp(i) 497 497 end do 498 C-------------------------- Various statistics of current run498 ! -------------------------- Various statistics of current run 499 499 swp=nswp 500 500 write(13,*) 'Acceptance rate for change of chains:' … … 519 519 end do 520 520 close(13) 521 cclose(16)521 ! close(16) 522 522 end if 523 523 close(18) 524 524 525 c=====================525 ! ===================== 526 526 CALL MPI_BARRIER(MPI_COMM_WORLD,IERR) 527 527 -
INCP.H
r2ebb8b6 rbd2278d 1 c......................2 ccontents of a PDB file3 c......................1 ! ...................... 2 ! contents of a PDB file 3 ! ...................... 4 4 5 5 parameter (MXCHP =100, ! max. no. of polypeptide chains 6 #MXRSP =1000, ! max. no. of residues7 #MXATP =10000) ! max. no. of atoms6 & MXRSP =1000, ! max. no. of residues 7 & MXATP =10000) ! max. no. of atoms 8 8 9 cnchp - no. of polypeptide chains10 cnchrsp() - no. of residues / chain11 cnrsp - total no. of residues12 cirsatp() - index of 1st atom / res.13 cnrsatp() - no. of atoms / res.14 cnatp - total no. of selected atoms15 cnoatp() - atom numbers9 ! nchp - no. of polypeptide chains 10 ! nchrsp() - no. of residues / chain 11 ! nrsp - total no. of residues 12 ! irsatp() - index of 1st atom / res. 13 ! nrsatp() - no. of atoms / res. 14 ! natp - total no. of selected atoms 15 ! noatp() - atom numbers 16 16 17 17 common /pdb_i/ nchp,nchrsp(MXCHP), 18 #nrsp,irsatp(MXRSP),nrsatp(MXRSP),19 #natp,noatp(MXATP)18 & nrsp,irsatp(MXRSP),nrsatp(MXRSP), 19 & natp,noatp(MXATP) 20 20 save /pdb_i/ 21 21 22 cchnp() - chain identifiers23 crsidp() - residue identifiers (number + insertion code)24 crsnmp() - residues (sequence, 3-letter code)25 catnmp() - atom names22 ! chnp() - chain identifiers 23 ! rsidp() - residue identifiers (number + insertion code) 24 ! rsnmp() - residues (sequence, 3-letter code) 25 ! atnmp() - atom names 26 26 27 27 character chnp(MXCHP), 28 #rsidp(MXRSP)*5,rsnmp(MXRSP)*3,29 #atnmp(MXATP)*428 & rsidp(MXRSP)*5,rsnmp(MXRSP)*3, 29 & atnmp(MXATP)*4 30 30 31 31 common /pdb_c/ chnp,rsnmp,rsidp,atnmp 32 32 save /pdb_c/ 33 33 34 cxatp,yatp,zatp - atom coordinates34 ! xatp,yatp,zatp - atom coordinates 35 35 36 36 common /pdb_r/ xatp(MXATP),yatp(MXATP),zatp(MXATP) 37 37 save /pdb_r/ 38 38 39 c------------------- code to list all PDB information40 cir=041 cdo i=1,nchp42 cwrite(*,*) ' ===== chain |',chnp(i),'|'43 cdo j=1,nchrsp(i)44 cir=ir+145 cwrite(*,*) ' ----- ',rsidp(ir),' ',rsnmp(ir),' ',nrsatp(ir)46 ck1=irsatp(ir)47 ck2=k1+nrsatp(ir)-148 cdo k=k1,k249 cwrite(*,*) ' ',noatp(k),' ',atnmp(k),' ',(xyzp(l,k),l=1,3)50 cenddo51 cenddo52 cenddo39 ! ------------------- code to list all PDB information 40 ! ir=0 41 ! do i=1,nchp 42 ! write(*,*) ' ===== chain |',chnp(i),'|' 43 ! do j=1,nchrsp(i) 44 ! ir=ir+1 45 ! write(*,*) ' ----- ',rsidp(ir),' ',rsnmp(ir),' ',nrsatp(ir) 46 ! k1=irsatp(ir) 47 ! k2=k1+nrsatp(ir)-1 48 ! do k=k1,k2 49 ! write(*,*) ' ',noatp(k),' ',atnmp(k),' ',(xyzp(l,k),l=1,3) 50 ! enddo 51 ! enddo 52 ! enddo -
SMMP.kdevelop
r2ebb8b6 rbd2278d 132 132 <filetype>*.h</filetype> 133 133 <filetype>*.H</filetype> 134 <filetype>*. hh</filetype>134 <filetype>*.f90</filetype> 135 135 <filetype>*.hxx</filetype> 136 136 <filetype>*.hpp</filetype> … … 143 143 <filetype>Makefile</filetype> 144 144 <filetype>CMakeLists.txt</filetype> 145 <filetype>*.py</filetype> 146 <filetype>*.f</filetype> 145 147 </filetypes> 146 148 <blacklist/> -
addend.f
r2ebb8b6 rbd2278d 1 c**************************************************************2 c 3 c 4 cThis file contains the subroutines: addend, redchg, rplgrp5 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$Id: addend.f 334 2007-08-07 09:23:59Z meinke $12 c**************************************************************1 ! ************************************************************** 2 ! 3 ! 4 ! This file contains the subroutines: addend, redchg, rplgrp 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 ! $Id: addend.f 334 2007-08-07 09:23:59Z meinke $ 12 ! ************************************************************** 13 13 subroutine addend(nml,grpn,grpc) 14 14 15 c..............................................................16 cPURPOSE: modify terminal residues to complete bonding scheme17 cwith residue 'grpn' at N- and residue 'grpc' at C-terminus18 c! need initial co-ordinates for residues to modify19 c! for N-terminus: may add only simple groups20 c 21 cCALLS: rplgrp,tolost,redchg22 c..............................................................15 ! .............................................................. 16 ! PURPOSE: modify terminal residues to complete bonding scheme 17 ! with residue 'grpn' at N- and residue 'grpc' at C-terminus 18 ! ! need initial co-ordinates for residues to modify 19 ! ! for N-terminus: may add only simple groups 20 ! 21 ! CALLS: rplgrp,tolost,redchg 22 ! .............................................................. 23 23 24 24 include 'INCL.H' … … 35 35 36 36 if (grn(:3).eq.'ace'.or.grc(:3).eq.'ace' 37 #.or.grn(:3).eq.'nme'.or.grc(:3).eq.'nme') then37 &.or.grn(:3).eq.'nme'.or.grc(:3).eq.'nme') then 38 38 39 39 write(*,'(2a)') ' addend> N-Acetyl (ace) or N-Methylamide (nme)' 40 #,' should be put in SEQUENCE file, not added as end groups'40 & ,' should be put in SEQUENCE file, not added as end groups' 41 41 42 42 stop 43 43 endif 44 44 45 c__________________________________________ N-terminus45 ! __________________________________________ N-terminus 46 46 ifirs=irsml1(nml) 47 47 rpat='n ' … … 55 55 else 56 56 write (*,'(2a)') ' addend> ', 57 #' No N-terminal Hyp possible with ECEPP/3 dataset'57 & ' No N-terminal Hyp possible with ECEPP/3 dataset' 58 58 stop 59 59 endif … … 83 83 84 84 write(*,'(2a)') ' addend> Can add only ', 85 *'nh2 or nh3+ to N-terminus'85 & 'nh2 or nh3+ to N-terminus' 86 86 stop 87 87 … … 94 94 95 95 write(*,'(2a)') ' addend> Acetyl group', 96 #' at N-terminus not modified'97 endif 98 99 c__________________________________________ C-terminus96 & ' at N-terminus not modified' 97 endif 98 99 ! __________________________________________ C-terminus 100 100 ilars=irsml2(nml) 101 101 rpat='c ' … … 124 124 125 125 write(*,'(2a)') ' addend> Can add only ', 126 #'cooh or coo- to C-terminus'126 & 'cooh or coo- to C-terminus' 127 127 stop 128 128 … … 135 135 136 136 write(*,'(2a)') ' addend> N-Methylamide', 137 #' at C-terminus not modified'138 139 endif 140 141 c----------------------------- net charge of molecule137 & ' at C-terminus not modified' 138 139 endif 140 141 ! ----------------------------- net charge of molecule 142 142 cg = 0.d0 143 143 do i=iatrs1(irsml1(nml)),iatrs2(irsml2(nml)) … … 145 145 enddo 146 146 if (abs(cg).gt.1.d-5) write(*,'(a,i2,a,f7.3,/)') 147 #' addend> Net charge of molecule #'148 #,nml,': ',cg147 & ' addend> Net charge of molecule #' 148 & ,nml,': ',cg 149 149 150 150 return 151 151 end 152 c****************************************152 ! **************************************** 153 153 subroutine rplgrp(nml,nrs,rpat,sbrs) 154 154 155 c...............................................................156 cPURPOSE: replace atom(s) rooted at atom 'rpat' in residue157 c'nrs' of molecule 'nml' by atom(s) rooted at158 c'rpat' of residue 'sbrs' (same name of root159 catom 'rpat' maintains bonding geometry for160 cpreceeding atoms in 'nrs')161 c 162 cis NOT performed if 'rpat' is within mainchain,163 cexcept it is first/last mainchain atom of 'nml'164 c 165 cCALLS: dihedr,iopfil,iendst,eyring,fndbrn,redres,setsys,valang166 c...............................................................155 ! ............................................................... 156 ! PURPOSE: replace atom(s) rooted at atom 'rpat' in residue 157 ! 'nrs' of molecule 'nml' by atom(s) rooted at 158 ! 'rpat' of residue 'sbrs' (same name of root 159 ! atom 'rpat' maintains bonding geometry for 160 ! preceeding atoms in 'nrs') 161 ! 162 ! is NOT performed if 'rpat' is within mainchain, 163 ! except it is first/last mainchain atom of 'nml' 164 ! 165 ! CALLS: dihedr,iopfil,iendst,eyring,fndbrn,redres,setsys,valang 166 ! ............................................................... 167 167 168 168 include 'INCL.H' … … 180 180 nfi=iatrs1(nrs) 181 181 nla=iatrs2(nrs) 182 c__________________________ indices of atoms to be replaced182 ! __________________________ indices of atoms to be replaced 183 183 do i=nfi,nla 184 184 if (rpat.eq.nmat(i)) then … … 188 188 enddo 189 189 write (*,'(4a,i4,a,i4)') ' rplgrp> cannot find atom >',rpat, 190 #'< to be replaced in residue ',seq(nrs),nrs,' of molecule ',nml190 &'< to be replaced in residue ',seq(nrs),nrs,' of molecule ',nml 191 191 stop 192 192 … … 218 218 if (ibdrg.ne.0) then 219 219 write (*,'(2a,i3)') 220 #' rplgrp> Can handle only simple ring at 1st',221 #' atom of molecule #',nml220 & ' rplgrp> Can handle only simple ring at 1st', 221 & ' atom of molecule #',nml 222 222 stop 223 223 endif … … 245 245 else 246 246 write (*,'(4a,i4,a,i4)') 247 #' rplgrp> Cannot replace BACKBONE atom ',rpat,248 #' of residue ',seq(nrs),nrs,' in molecule #',nml247 & ' rplgrp> Cannot replace BACKBONE atom ',rpat, 248 & ' of residue ',seq(nrs),nrs,' in molecule #',nml 249 249 stop 250 250 endif 251 251 252 252 endif ! N-terminus 253 c_________________________________ previous atoms253 ! _________________________________ previous atoms 254 254 2 if (nfirp.eq.nfi.and.nrs.eq.ifirs) goto 11 255 255 nxtbb1=iowat(nfirp) 256 256 if (nxtbb1.eq.nfi.and.nrs.eq.ifirs) goto 11 257 257 nxtbb2=iowat(nxtbb1) 258 c_______________________________ get data for substituent atoms258 ! _______________________________ get data for substituent atoms 259 259 3 if (iopfil(lunlib,reslib,'old','formatted').le.izero) then 260 260 write (*,'(a,/,a,i3,2a)') 261 #' rplgrp> ERROR opening library of residues:',262 #' LUN=',lunlib,' FILE=',reslib(1:iendst(reslib))261 & ' rplgrp> ERROR opening library of residues:', 262 & ' LUN=',lunlib,' FILE=',reslib(1:iendst(reslib)) 263 263 stop 264 264 endif 265 265 call redres(sbrs,natsb,nxtsb,nvrsb) 266 266 close (lunlib) 267 c__________________________ indices of substituent atoms267 ! __________________________ indices of substituent atoms 268 268 do i=1,natsb 269 269 if (rpat.eq.nmath(i)) then … … 273 273 enddo 274 274 write (*,'(4a)') ' rplgrp> Cannot find atom >',rpat, 275 #'< in substituent residue ',sbrs275 &'< in substituent residue ',sbrs 276 276 stop 277 277 … … 288 288 enddo ! ... branch atoms 289 289 5 enddo ! ... branches 290 c_________________________________________________ local axes at 'nfirp'290 ! _________________________________________________ local axes at 'nfirp' 291 291 call setsys(nxtbb1,nfirp,nxtbb2,x1,x2,x3,y1,y2,y3,z1,z2,z3) 292 292 … … 298 298 zbaat(nfirp)=z3 299 299 300 c_____________________ add virtual atoms300 ! _____________________ add virtual atoms 301 301 if (ntbb) then 302 302 … … 306 306 sa=snbaat(nxtbb1) 307 307 308 c------------------- Eyring308 ! ------------------- Eyring 309 309 h2=-sa*ct 310 310 h3=-sa*st … … 331 331 st=sntoat(nxtbb1) 332 332 333 c-------------------- Eyring with b.angle = 90 deg.333 ! -------------------- Eyring with b.angle = 90 deg. 334 334 xat(-ione)=xat(izero)-ct*(z2*x3-z3*x2)-st*z1 335 335 yat(-ione)=yat(izero)-ct*(z3*x1-z1*x3)-st*z2 … … 337 337 338 338 endif 339 c_____________________________________________ Shift atom data339 ! _____________________________________________ Shift atom data 340 340 nrp=nlarp-nfirp 341 341 nsb=nlasb-nfisb … … 407 407 408 408 enddo 409 c____________________________________________ Shift residue data409 ! ____________________________________________ Shift residue data 410 410 do i=nrs+1,irsml2(ntlml) 411 411 iatrs1(i)=iatrs1(i)+nsh … … 418 418 nsh=0 419 419 endif 420 c_________________________________________ Correct data of 'nfirp'420 ! _________________________________________ Correct data of 'nfirp' 421 421 ish=nfirp-nfisb 422 422 ityat(nfirp)=ityath(nfisb) … … 450 450 if (nb.gt.mxbd) then 451 451 write (*,'(6a,/,2a,3(i4,a))') 452 #' rplgrp> Cannot add atoms following ',rpat,453 #' from group ',sbrs,' to atom ',rpat,454 #' of residue ',seq(nrs),nrs,' in molecule #',nml,455 #' because need >',(mxbd+1),' bonds'452 & ' rplgrp> Cannot add atoms following ',rpat, 453 & ' from group ',sbrs,' to atom ',rpat, 454 & ' of residue ',seq(nrs),nrs,' in molecule #',nml, 455 & ' because need >',(mxbd+1),' bonds' 456 456 stop 457 457 endif … … 474 474 endif 475 475 nbdat(nfirp)=nb 476 c_________________________________________ Add data for substituent476 ! _________________________________________ Add data for substituent 477 477 ii=nfirp 478 478 do i=nfisb+1,nlasb … … 527 527 528 528 enddo ! substituent atoms 529 c___________________________________________________ Take care of Variables530 c(assume variables of replaced group/substituent to be stored CONSECUTIVELY)529 ! ___________________________________________________ Take care of Variables 530 ! (assume variables of replaced group/substituent to be stored CONSECUTIVELY) 531 531 532 532 ilavr=ivrml1(ntlml)+nvrml(ntlml)-1 … … 610 610 611 611 return 612 c__________________________________________ Errors612 ! __________________________________________ Errors 613 613 10 write (*,'(3a,/,2a,i4,a,i4,/,2a)') 614 #' rplgrp> Cannot replace atom(s) following ',rpat,615 #' from INSIDE a ring',' in residue: ',seq(nrs),nrs,616 #' in molecule #',nml,' or in substitute: ',sbrs614 & ' rplgrp> Cannot replace atom(s) following ',rpat, 615 & ' from INSIDE a ring',' in residue: ',seq(nrs),nrs, 616 & ' in molecule #',nml,' or in substitute: ',sbrs 617 617 stop 618 618 11 write (*,'(4a,i4,a,i4,/,a)') 619 #' rplgrp> Cannot replace atom(s) following ',rpat,620 #' of residue ',seq(nrs),nrs,' in molecule #',nml,621 #' since necessary 2 previous atoms are not available'619 & ' rplgrp> Cannot replace atom(s) following ',rpat, 620 & ' of residue ',seq(nrs),nrs,' in molecule #',nml, 621 & ' since necessary 2 previous atoms are not available' 622 622 stop 623 623 624 624 end 625 c****************************************625 ! **************************************** 626 626 subroutine redchg(nml,nrs,rpat,sbrs) 627 627 628 c.........................................................629 cPURPOSE: read and place atomic point charges from residue630 c'sbrs' to residue 'nrs' of molecule 'nml'631 cfrom library 'chglib' with LUN=lunchg, if ilib=1632 c'reslib' with LUN=lunlib, if ilib=2633 c 634 cCALLS: iopfil,iendst,tolost635 c........................................................628 ! ......................................................... 629 ! PURPOSE: read and place atomic point charges from residue 630 ! 'sbrs' to residue 'nrs' of molecule 'nml' 631 ! from library 'chglib' with LUN=lunchg, if ilib=1 632 ! 'reslib' with LUN=lunlib, if ilib=2 633 ! 634 ! CALLS: iopfil,iendst,tolost 635 ! ........................................................ 636 636 637 637 include 'INCL.H' … … 677 677 if (iopfil(lunchg,chgfil,'old','formatted').le.izero) then 678 678 write (*,'(a,/,a,i3,2a)') 679 #' redchg> ERROR opening library of charges:',680 #' LUN=',lunchg,' FILE=',chgfil(1:iendst(chgfil))679 & ' redchg> ERROR opening library of charges:', 680 & ' LUN=',lunchg,' FILE=',chgfil(1:iendst(chgfil)) 681 681 stop 682 682 endif … … 701 701 enddo 702 702 write (*,'(6a)') ' redchg> Cannot find atom: ',atnm, 703 #' for entry: ',cgty,' in library: ',704 #chgfil(1:iendst(chgfil))703 & ' for entry: ',cgty,' in library: ', 704 & chgfil(1:iendst(chgfil)) 705 705 stop 706 706 2 enddo … … 708 708 else 709 709 write (*,'(4a)') 710 #' redchg> must increase MXATH to read data for entry: ',711 #cgty,' in library: ',chgfil(1:iendst(chgfil))710 & ' redchg> must increase MXATH to read data for entry: ', 711 & cgty,' in library: ',chgfil(1:iendst(chgfil)) 712 712 close(lunchg) 713 713 stop … … 716 716 goto 1 717 717 3 write (*,'(4a)') 718 #' redchg> Cannot find entry: ',cgty,' in library: ',719 #chgfil(1:iendst(chgfil))718 & ' redchg> Cannot find entry: ',cgty,' in library: ', 719 & chgfil(1:iendst(chgfil)) 720 720 close(lunchg) 721 721 stop … … 725 725 if (iopfil(lunlib,reslib,'old','formatted').le.izero) then 726 726 write (*,'(a,/,a,i3,2a)') 727 #' redchg> ERROR opening library of residues:',728 #' LUN=',lunlib,' FILE=',reslib(1:iendst(reslib))727 & ' redchg> ERROR opening library of residues:', 728 & ' LUN=',lunlib,' FILE=',reslib(1:iendst(reslib)) 729 729 stop 730 730 endif … … 748 748 enddo 749 749 write (*,'(6a)') ' redchg> Cannot find atom: ',atnm, 750 #' for entry: ',cgty,' in library: ',751 #reslib(1:iendst(reslib))750 & ' for entry: ',cgty,' in library: ', 751 & reslib(1:iendst(reslib)) 752 752 stop 753 753 5 enddo … … 755 755 else 756 756 write (*,'(4a)') 757 #' redchg> must increase MXATH to read data for entry: ',758 #cgty,' in library: ',reslib(1:iendst(reslib))757 & ' redchg> must increase MXATH to read data for entry: ', 758 & cgty,' in library: ',reslib(1:iendst(reslib)) 759 759 close(lunchg) 760 760 stop … … 763 763 goto 4 764 764 6 write (*,'(4a)') 765 #' redchg> Cannot find entry: ',cgty,' in library: ',766 #reslib(1:iendst(reslib))765 & ' redchg> Cannot find entry: ',cgty,' in library: ', 766 & reslib(1:iendst(reslib)) 767 767 close(lunchg) 768 768 stop … … 771 771 772 772 10 write (*,'(4a)') 773 #' redchg> Do not have charges for N/C-terminal residue ',774 #res,' modified with group :',sbrs773 & ' redchg> Do not have charges for N/C-terminal residue ', 774 & res,' modified with group :',sbrs 775 775 stop 776 776 -
anneal.f
r2ebb8b6 rbd2278d 1 c**************************************************************2 c 3 cThis file contains the subroutines: anneal4 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$Id: anneal.f 334 2007-08-07 09:23:59Z meinke $11 c**************************************************************1 ! ************************************************************** 2 ! 3 ! This file contains the subroutines: anneal 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 ! $Id: anneal.f 334 2007-08-07 09:23:59Z meinke $ 11 ! ************************************************************** 12 12 13 13 subroutine anneal(nequi, nswp, nmes, tmax, tmin, lrand) 14 14 15 C--------------------------------------------------------------16 CPURPOSE: SIMULATED ANNEALING SEARCH OF LOWEST-POTENTIAL-ENERGY17 CCONFORMATIONS OF PROTEINS18 C 19 CCALLS: addang,energy,metropolis,outvar,outpdb,rgyr,setvar,zimmer20 C 21 C---------------------------------------------------------------15 ! -------------------------------------------------------------- 16 ! PURPOSE: SIMULATED ANNEALING SEARCH OF LOWEST-POTENTIAL-ENERGY 17 ! CONFORMATIONS OF PROTEINS 18 ! 19 ! CALLS: addang,energy,metropolis,outvar,outpdb,rgyr,setvar,zimmer 20 ! 21 ! --------------------------------------------------------------- 22 22 23 23 include 'INCL.H' 24 24 25 cf2py intent(in) nequi26 cf2py intent(in) nswp27 cf2py intent(in) nmes28 cf2py intent(in) Tmax29 cf2py intent(in) Tmin30 cf2py logical optional, intent(in):: lrand = 125 !f2py intent(in) nequi 26 !f2py intent(in) nswp 27 !f2py intent(in) nmes 28 !f2py intent(in) Tmax 29 !f2py intent(in) Tmin 30 !f2py logical optional, intent(in):: lrand = 1 31 31 32 cexternal rand32 ! external rand 33 33 external can_weight 34 cparameter(lrand=.true.)35 cparameter(nequi=100, nswp=100000,nmes=1000)36 cparameter(tmax=1000.0,tmin=100.0)37 Clrand=.true.: creates random start configuration34 ! parameter(lrand=.true.) 35 ! parameter(nequi=100, nswp=100000,nmes=1000) 36 ! parameter(tmax=1000.0,tmin=100.0) 37 ! lrand=.true.: creates random start configuration 38 38 logical lrand 39 Cnequi: Number of sweeps for equilibrisation of system39 ! nequi: Number of sweeps for equilibrisation of system 40 40 integer nequi 41 Cnswp: Number of sweeps for simulation run41 ! nswp: Number of sweeps for simulation run 42 42 integer nswp 43 cnmes: Number of sweeps between measurments43 ! nmes: Number of sweeps between measurments 44 44 integer nmes 45 Ctmax: Start temperature45 ! tmax: Start temperature 46 46 double precision tmax 47 Ctmin: Final temperature47 ! tmin: Final temperature 48 48 double precision tmin 49 49 50 50 51 51 ! common/bet/beta 52 C 52 ! 53 53 dimension vlvrm(mxvr) 54 54 55 55 56 56 57 cDefine files for output:57 ! Define files for output: 58 58 open(14,file='time.d') 59 59 write(14, *) '# $Id: anneal.f 334 2007-08-07 09:23:59Z meinke $' … … 64 64 db = exp(log(bmax/bmin)/nswp) 65 65 66 cnresi: Number of residues67 cFIXME: Should loop over all proteins66 ! nresi: Number of residues 67 ! FIXME: Should loop over all proteins 68 68 nresi=irsml2(ntlml)-irsml1(1)+1 69 c_________________________________ random start69 ! _________________________________ random start 70 70 if(lrand) then 71 71 do i=1,nvr … … 80 80 write (*,'(a,e12.5,/)') 'energy of start configuration: ',eol 81 81 82 CWrite start configuration in pdb-format into file82 ! Write start configuration in pdb-format into file 83 83 call outpdb(0, "start.pdb") 84 84 85 c=====================Equilibration by Metropolis85 ! =====================Equilibration by Metropolis 86 86 beta = bmin 87 87 do nsw=1,nequi … … 90 90 write(*,*) 'Energy after equilibration:',eol 91 91 92 C======================Simulation by simulated annealing92 !======================Simulation by simulated annealing 93 93 acz = 0.0d0 94 94 ymin = eol … … 96 96 beta = bmin*db**nsw 97 97 call metropolis(eol,acz,can_weight) 98 cStore lowest-energy conformation98 ! Store lowest-energy conformation 99 99 if(eol.lt.ymin) then 100 100 ymin = eol 101 101 nemin = nsw 102 102 call outvar(0,'global.var') 103 COutput of lowest-energy conformation as pdb-file103 ! Output of lowest-energy conformation as pdb-file 104 104 call outpdb(0,"global.pdb") 105 105 do j=1,nvr … … 108 108 end do 109 109 end if 110 c 110 ! 111 111 if(mod(nsw,nmes).eq.0) then 112 CMeasure radius of gyration and end-to-end distance112 ! Measure radius of gyration and end-to-end distance 113 113 call rgyr(1, rgy, ee) 114 CDetermine Zimmerman code of actual conformation114 ! Determine Zimmerman code of actual conformation 115 115 call zimmer(nresi) 116 CWrite down information on actual conformation116 ! Write down information on actual conformation 117 117 temp = 1.0d0/beta/0.00198773 118 118 write(14,'(i6,13f12.3,1x,a)') … … 121 121 & eyhb, eyvw, eyel, eyvr, zimm(1:nresi) 122 122 end if 123 C 123 ! 124 124 end do 125 125 … … 127 127 write(*,*) 'acceptance rate:',acz 128 128 write(*,*) 129 c------------ Output Dihedreals of final configuration129 ! ------------ Output Dihedreals of final configuration 130 130 write(*,*) 'last energy',eol 131 131 call outvar(0,' ') 132 COutput final conformation as pdb-file132 ! Output final conformation as pdb-file 133 133 call outpdb(0,"final.pdb") 134 134 write(*,*) 135 135 136 c------------ Output Dihedreals of conformation with lowest energy136 ! ------------ Output Dihedreals of conformation with lowest energy 137 137 write(*,*) 'lowest energy ever found:',nemin,ymin 138 138 close(14) 139 c=====================139 ! ===================== 140 140 141 141 -
bgs.f
r2ebb8b6 rbd2278d 156 156 bv(nph,3)=xiv(nph,3)-zat(iN(icurraa)) 157 157 ab(nph)=bv(nph,1)*bv(nph,1)+bv(nph,2)*bv(nph,2) 158 #+bv(nph,3)*bv(nph,3)158 & +bv(nph,3)*bv(nph,3) 159 159 iph(nph)=iphi(icurraa) 160 160 endif … … 168 168 bv(nph,3)=xiv(nph,3)-zat(iCa(icurraa)) 169 169 ab(nph)=bv(nph,1)*bv(nph,1)+bv(nph,2)*bv(nph,2) 170 #+bv(nph,3)*bv(nph,3)170 & +bv(nph,3)*bv(nph,3) 171 171 iph(nph)=ipsi(icurraa) 172 172 endif … … 185 185 do j=1,nph 186 186 dv(i,j,1)=(1.0/ab(j))*(bv(j,2)*(rv(i,3)-xiv(j,3))- 187 cbv(j,3)*(rv(i,2)-xiv(j,2)))187 & bv(j,3)*(rv(i,2)-xiv(j,2))) 188 188 dv(i,j,2)=(-1.0/ab(j))*(bv(j,1)*(rv(i,3)-xiv(j,3))- 189 cbv(j,3)*(rv(i,1)-xiv(j,1)))189 & bv(j,3)*(rv(i,1)-xiv(j,1))) 190 190 dv(i,j,3)=(1.0/ab(j))*(bv(j,1)*(rv(i,2)-xiv(j,2))- 191 cbv(j,2)*(rv(i,1)-xiv(j,1)))191 & bv(j,2)*(rv(i,1)-xiv(j,1))) 192 192 enddo 193 193 enddo … … 273 273 bv(nph,3)=xiv(nph,3)-zat(iN(icurraa)) 274 274 ab(nph)=bv(nph,1)*bv(nph,1)+bv(nph,2)*bv(nph,2) 275 #+bv(nph,3)*bv(nph,3)275 & +bv(nph,3)*bv(nph,3) 276 276 iph(nph)=iphi(icurraa) 277 277 endif … … 285 285 bv(nph,3)=xiv(nph,3)-zat(iCa(icurraa)) 286 286 ab(nph)=bv(nph,1)*bv(nph,1)+bv(nph,2)*bv(nph,2) 287 #+bv(nph,3)*bv(nph,3)287 & +bv(nph,3)*bv(nph,3) 288 288 iph(nph)=ipsi(icurraa) 289 289 endif … … 302 302 do j=1,nph 303 303 dv(i,j,1)=(1.0/ab(j))*(bv(j,2)*(rv(i,3)-xiv(j,3))- 304 cbv(j,3)*(rv(i,2)-xiv(j,2)))304 & bv(j,3)*(rv(i,2)-xiv(j,2))) 305 305 dv(i,j,2)=(-1.0/ab(j))*(bv(j,1)*(rv(i,3)-xiv(j,3))- 306 cbv(j,3)*(rv(i,1)-xiv(j,1)))306 & bv(j,3)*(rv(i,1)-xiv(j,1))) 307 307 dv(i,j,3)=(1.0/ab(j))*(bv(j,1)*(rv(i,2)-xiv(j,2))- 308 cbv(j,2)*(rv(i,1)-xiv(j,1)))308 & bv(j,2)*(rv(i,1)-xiv(j,1))) 309 309 enddo 310 310 enddo -
bldmol.f
r2ebb8b6 rbd2278d 1 c**************************************************************2 c 3 cThis file contains the subroutines: bldmol, fnd3ba,eyring,4 csetsys,setgbl5 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 ! This file contains the subroutines: bldmol, fnd3ba,eyring, 4 ! setsys,setgbl 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 subroutine bldmol(nml) 14 14 15 c.................................................16 cPURPOSE: calculate coordinates for molecule 'nml'17 c 18 cOUTPUT: xat,yat,zat,xbaat,ybaat,zbaat,xtoat,ytoat,19 cztoat (via 'eyring')20 c 21 c1st backbone atom of 1st residue of 'nml':22 c 23 c- it's position: from 'gbpr(1-3,nml)'24 c- it's axes: from 'setgbl' according to25 cglobal angles 'gbpr(4-5,nml)'26 c 27 cCALLS: eyring, fnd3ba,setgbl,setsys28 c.................................................15 ! ................................................. 16 ! PURPOSE: calculate coordinates for molecule 'nml' 17 ! 18 ! OUTPUT: xat,yat,zat,xbaat,ybaat,zbaat,xtoat,ytoat, 19 ! ztoat (via 'eyring') 20 ! 21 ! 1st backbone atom of 1st residue of 'nml': 22 ! 23 ! - it's position: from 'gbpr(1-3,nml)' 24 ! - it's axes: from 'setgbl' according to 25 ! global angles 'gbpr(4-5,nml)' 26 ! 27 ! CALLS: eyring, fnd3ba,setgbl,setsys 28 ! ................................................. 29 29 30 30 include 'INCL.H' … … 34 34 35 35 call fnd3ba(nml,i1,i2,i3) 36 c------------------------------ first 3 bb atoms of 'nml'36 ! ------------------------------ first 3 bb atoms of 'nml' 37 37 ixrfpt(1,nml)=i1 38 38 ixrfpt(2,nml)=i2 39 39 ixrfpt(3,nml)=i3 40 40 41 c------------------------------ position of 1st bb atom41 ! ------------------------------ position of 1st bb atom 42 42 xat(i1) = gbpr(1,nml) 43 43 yat(i1) = gbpr(2,nml) … … 86 86 return 87 87 end 88 c***********************************88 ! *********************************** 89 89 subroutine fnd3ba(nml,i1,i2,i3) 90 90 91 c.................................................92 cPURPOSE: return indices 'i1,i2,i3' of93 cfirst 3 backbone atoms in molecule 'nml'94 c 95 cCALLS: fndbrn96 c.................................................91 ! ................................................. 92 ! PURPOSE: return indices 'i1,i2,i3' of 93 ! first 3 backbone atoms in molecule 'nml' 94 ! 95 ! CALLS: fndbrn 96 ! ................................................. 97 97 98 98 include 'INCL.H' … … 104 104 irs=irsml1(nml) 105 105 106 c--------------------------- 1st bb atom106 ! --------------------------- 1st bb atom 107 107 i1=iatrs1(irs) 108 108 109 109 call fndbrn(nml,irs,i1,i,ix,i2,bb) 110 110 111 c--------------------------- 2nd bb atom111 ! --------------------------- 2nd bb atom 112 112 i2=i+1 113 113 114 c------------------------ check for ring114 ! ------------------------ check for ring 115 115 116 116 ibd(1)=iowat(i1) … … 126 126 if (ix.ne.0) then 127 127 write (*,'(2a,i3)') 128 #' fnd3ba> Can handle only simple ring at 1st',129 #' atom of molecule #',nml128 & ' fnd3ba> Can handle only simple ring at 1st', 129 & ' atom of molecule #',nml 130 130 stop 131 131 endif … … 135 135 enddo 136 136 137 c--------------------------- 3rd bb atom137 ! --------------------------- 3rd bb atom 138 138 139 139 ix=ixatrs(irs) … … 158 158 159 159 write (*,'(4a,i4,a,i4)') 160 #' fnd3ba> Cannot find backbone atom following ',nmat(i2),161 #' of residue ',seq(irs),irs,' in molecule #',nml160 & ' fnd3ba> Cannot find backbone atom following ',nmat(i2), 161 & ' of residue ',seq(irs),irs,' in molecule #',nml 162 162 stop 163 163 164 164 end 165 c***************************165 ! *************************** 166 166 subroutine eyring(i,ia) 167 167 168 c.........................................................169 cPURPOSE: calculate cartesian coordinates of atom 'i'170 cusing EYRING's algorithm171 cINPUT: i - index of atom to be constructed172 cfor 'i': blat,csbaat,snbaat,cstoat,sntoat173 cia- index of atom from which 'i' is to be built174 cOUTPUT: for 'i': xat,yat,zat,xbaat,ybaat,zbaat,xtoat,ytoat,ztoat175 c 176 cCALLS: none177 c.........................................................168 ! ......................................................... 169 ! PURPOSE: calculate cartesian coordinates of atom 'i' 170 ! using EYRING's algorithm 171 ! INPUT: i - index of atom to be constructed 172 ! for 'i': blat,csbaat,snbaat,cstoat,sntoat 173 ! ia- index of atom from which 'i' is to be built 174 ! OUTPUT: for 'i': xat,yat,zat,xbaat,ybaat,zbaat,xtoat,ytoat,ztoat 175 ! 176 ! CALLS: none 177 ! ......................................................... 178 178 179 179 include 'INCL.H' … … 228 228 return 229 229 end 230 c***********************************************************230 ! *********************************************************** 231 231 subroutine setsys(i1,i2,i3, x1,x2,x3,y1,y2,y3,z1,z2,z3) 232 232 233 c..........................................................234 cPURPOSE: calculate axes X,Y,Z of right-handed orthogonal235 csystem given by three atom positions R1, R2, R3236 c 237 cX = (R2-R1)/ |( )|238 cZ = {X x (R2-R3)} / |{ }|239 cY = Z x X240 c 241 cINPUT: i1, i2, i3 - indices of three atoms242 cOUTPUT: x1,x2,x3 |243 cy1,y2,y3 | -direction cosines of X,Y,Z244 cz1,z2,z3 |245 c 246 cCALLS: none247 c...................................................233 ! .......................................................... 234 ! PURPOSE: calculate axes X,Y,Z of right-handed orthogonal 235 ! system given by three atom positions R1, R2, R3 236 ! 237 ! X = (R2-R1)/ |( )| 238 ! Z = {X x (R2-R3)} / |{ }| 239 ! Y = Z x X 240 ! 241 ! INPUT: i1, i2, i3 - indices of three atoms 242 ! OUTPUT: x1,x2,x3 | 243 ! y1,y2,y3 | -direction cosines of X,Y,Z 244 ! z1,z2,z3 | 245 ! 246 ! CALLS: none 247 ! ................................................... 248 248 249 249 … … 283 283 end 284 284 285 c*****************************************285 ! ***************************************** 286 286 subroutine setgbl(nml,i1,i2,i3,xg,zg) 287 287 288 c...................................................289 c 290 cPURPOSE: 1. Obtain global axes (J,K,L)291 crelated to x(1 0 0),y(0 1 0),z(0 0 1)292 cby 3 rotations (gbl. parameters #4-#6):293 c 294 c- round z by angle alpha295 c- round x' by a. beta296 c- round y" by a. gamma297 c 298 c2. Return x-axis (xg) & z-axis (zg)299 cfor atom #1 in order to orientate J300 calong the bond from backbone atom #1301 cto bb.a. #2 and L according to the302 ccross product [ bond(#1->#2) x303 cbond(#2->#3) ] when using Eyring's304 calgorithm to get the coordinates305 c 306 cCALLS: none307 c..............................................288 ! ................................................... 289 ! 290 ! PURPOSE: 1. Obtain global axes (J,K,L) 291 ! related to x(1 0 0),y(0 1 0),z(0 0 1) 292 ! by 3 rotations (gbl. parameters #4-#6): 293 ! 294 ! - round z by angle alpha 295 ! - round x' by a. beta 296 ! - round y" by a. gamma 297 ! 298 ! 2. Return x-axis (xg) & z-axis (zg) 299 ! for atom #1 in order to orientate J 300 ! along the bond from backbone atom #1 301 ! to bb.a. #2 and L according to the 302 ! cross product [ bond(#1->#2) x 303 ! bond(#2->#3) ] when using Eyring's 304 ! algorithm to get the coordinates 305 ! 306 ! CALLS: none 307 ! .............................................. 308 308 309 309 include 'INCL.H' … … 319 319 sg = sin(gbpr(6,nml)) 320 320 321 c----------------------------- J321 ! ----------------------------- J 322 322 x1 = ca*cg - sa*sb*sg 323 323 x2 = sa*cg + ca*sb*sg … … 328 328 ag(2,1) = x2/d 329 329 ag(3,1) = x3/d 330 c----------------------------- K330 ! ----------------------------- K 331 331 y1 = -sa*cb 332 332 y2 = ca*cb … … 337 337 ag(2,2) = y2/d 338 338 ag(3,2) = y3/d 339 c----------------------------- L339 ! ----------------------------- L 340 340 z1 = ca*sg + sa*sb*cg 341 341 z2 = sa*sg - ca*sb*cg … … 347 347 ag(3,3) = z3/d 348 348 349 c------------------------------------ X1349 ! ------------------------------------ X1 350 350 ct2 = cstoat(i2) 351 351 st2 = sntoat(i2) … … 360 360 x2 = x2/dx 361 361 x3 = x3/dx 362 c------------------------------------- Z1362 ! ------------------------------------- Z1 363 363 st3 = sntoat(i3) 364 364 ct3 = cstoat(i3) … … 372 372 z2 = z2/dz 373 373 z3 = z3/dz 374 c------------------------------------- Y1374 ! ------------------------------------- Y1 375 375 y1 = z2 * x3 - z3 * x2 376 376 y3 = z1 * x2 - z2 * x1 ! do not need y2 377 377 378 c----------------------------- into global system378 ! ----------------------------- into global system 379 379 380 380 xg(1) = ag(1,1)*x1 + ag(1,2)*y1 + ag(1,3)*z1 -
callbacktest.f
r2ebb8b6 rbd2278d 1 1 subroutine metropolis(eol,enw,dummy) 2 cf2py real*8 intent(in,out) eol3 cf2py real*8 intent(in,out) enw2 !f2py real*8 intent(in,out) eol 3 !f2py real*8 intent(in,out) enw 4 4 external dummy 5 5 delta = dummy(enw) - dummy(eol) -
canon.f
r2ebb8b6 rbd2278d 1 c**************************************************************2 c 3 cThis file contains the subroutines: canon,can_weight4 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: canon,can_weight 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 subroutine canon(nequi, nswp, nmes, temp, lrand) 13 C-----------------------------------------------------------------14 CPURPOSE: CANONICAL SIMULATION OF PROTEINS USING METROPOLIS UPDATES15 C 16 CCALLS: addang,energy,metropolis,hbond,helix,outvar,outpdb,rgyr17 C 18 C-------------------------------------------------------------------13 ! ----------------------------------------------------------------- 14 ! PURPOSE: CANONICAL SIMULATION OF PROTEINS USING METROPOLIS UPDATES 15 ! 16 ! CALLS: addang,energy,metropolis,hbond,helix,outvar,outpdb,rgyr 17 ! 18 !------------------------------------------------------------------- 19 19 include 'INCL.H' 20 20 21 cf2py intent(in) nequi22 cf2py intent(in) nswp23 cf2py intent(in) nmes24 cf2py intent(in) temp25 cf2py logical optional, intent(in):: lrand = 121 !f2py intent(in) nequi 22 !f2py intent(in) nswp 23 !f2py intent(in) nmes 24 !f2py intent(in) temp 25 !f2py logical optional, intent(in):: lrand = 1 26 26 27 cexternal rand27 ! external rand 28 28 external can_weight 29 29 30 30 logical lrand 31 cparameter(lrand=.false.)32 cparameter(nequi=10, nswp=1000,nmes=10)33 cparameter(temp=300.0)34 Clrand=.true.: creates random start configuration35 Cnequi: Number of sweeps for equilibrisation of system31 ! parameter(lrand=.false.) 32 ! parameter(nequi=10, nswp=1000,nmes=10) 33 ! parameter(temp=300.0) 34 ! lrand=.true.: creates random start configuration 35 ! nequi: Number of sweeps for equilibrisation of system 36 36 integer nequi 37 Cnswp: Number of sweeps for simulation run37 ! nswp: Number of sweeps for simulation run 38 38 integer nswp 39 cnmes: Number of sweeps between measurments39 ! nmes: Number of sweeps between measurments 40 40 integer nmes 41 Ctemp: Temperature of simulation41 ! temp: Temperature of simulation 42 42 double precision temp 43 C 43 ! 44 44 ! common/bet/beta 45 45 46 46 character*80 file 47 47 48 cDefine files for output:48 ! Define files for output: 49 49 open(13,file='time.d') 50 50 … … 52 52 beta=1.0/ ( temp * 1.98773d-3 ) 53 53 54 c_________________________________ random start54 ! _________________________________ random start 55 55 if(lrand) then 56 56 do i=1,nvr … … 65 65 write (*,'(a,e12.5,/)') 'energy of start configuration:',eol 66 66 67 CWrite start configuration in pdb-format into file67 ! Write start configuration in pdb-format into file 68 68 call outpdb(0,'start.pdb') 69 69 70 c=====================Equilibration by Metropolis70 ! =====================Equilibration by Metropolis 71 71 acz = 0.0d0 72 72 do nsw=1,nequi … … 75 75 write(*,*) 'Energy after equilibration:',eol 76 76 77 C======================Simulation in canonical ensemble77 !======================Simulation in canonical ensemble 78 78 acz = 0.0d0 79 79 do nsw=0,nswp 80 80 call metropolis(eol,acz,can_weight) 81 c 81 ! 82 82 if(mod(nsw,nmes).eq.0) then 83 CMeasure radius of gyration and end-to-end distance84 Crgy: radius of gyration85 Cee: end-to-end distance83 ! Measure radius of gyration and end-to-end distance 84 ! rgy: radius of gyration 85 ! ee: end-to-end distance 86 86 call rgyr(1,rgy,ee) 87 CMeasure helicity88 Cnhel: number of helical residues89 cmhel: number of helical segments90 cnbet: number of sheet-like residues91 cmbet: number of sheet-like segments87 ! Measure helicity 88 ! nhel: number of helical residues 89 ! mhel: number of helical segments 90 ! nbet: number of sheet-like residues 91 ! mbet: number of sheet-like segments 92 92 call helix(nhel,mhel,nbet,mbet) 93 CMeasure number of hydrogen bonds (mhb)93 ! Measure number of hydrogen bonds (mhb) 94 94 do i=1,ntlml 95 95 call hbond(i,mhb,0) 96 96 end do 97 CWrite down information on actual conformation97 ! Write down information on actual conformation 98 98 write(13,'(i5,2f12.3,5i7)') nsw, eol, rgy, 99 99 & nhel,mhel,nbet,mbet,mhb 100 100 end if 101 C 101 ! 102 102 end do 103 103 … … 105 105 write(*,*) 'acceptance rate:',acz 106 106 write(*,*) 107 c------------ Output Dihedreals of final configuration107 ! ------------ Output Dihedreals of final configuration 108 108 write(*,*) 'last energy',eol 109 109 call outvar(0,'lastconf.var') 110 COutput final conformation as pdb-file110 ! Output final conformation as pdb-file 111 111 call outpdb(0,'final.pdb') 112 112 … … 114 114 close(12) 115 115 close(13) 116 c=====================116 ! ===================== 117 117 118 118 119 119 end 120 120 121 c********************************************************121 ! ******************************************************** 122 122 real*8 function can_weight(x) 123 c 124 cCALLS: none125 c 123 ! 124 ! CALLS: none 125 ! 126 126 127 127 implicit real*8 (a-h,o-z) -
cnteny.f
r2ebb8b6 rbd2278d 1 c**************************************************************2 c 3 cThis file contains the subroutines: cnteny4 c 5 cCopyright 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: cnteny 4 ! 5 ! Copyright 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 subroutine cnteny(nml) 13 13 14 c................................................................................15 cPURPOSE: Calculate atomic contact energy of molecule 'nml' with ECEPP parameters16 c 17 cCALLS: nursat18 c................................................................................14 ! ................................................................................ 15 ! PURPOSE: Calculate atomic contact energy of molecule 'nml' with ECEPP parameters 16 ! 17 ! CALLS: nursat 18 ! ................................................................................ 19 19 20 20 include 'INCL.H' … … 31 31 if (ntlvr.eq.0) then 32 32 write (*,'(a,i4)') 33 #' cnteny> No variables defined in molecule #',nml33 & ' cnteny> No variables defined in molecule #',nml 34 34 return 35 35 endif … … 178 178 ir=nursat(i) 179 179 write(*,'(1x,i4,1x,a4,1x,a4,a2,e11.4)') ir,seq(ir),nmat(i), 180 #': ',ey180 & ': ',ey 181 181 endif 182 182 enddo -
contacts.f
r2ebb8b6 rbd2278d 1 c**************************************************************2 c 3 cThis file contains the subroutines: contacts,c_alfa,c_cont4 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: contacts,c_alfa,c_cont 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 subroutine contacts(ncn,nham2,dham) 13 13 14 c..............................................................15 c 16 cCALCULATES NUMBER OF CONTACTS IN GIVEN CONFORMATION, NUMBER OF17 cCONTACTS WHICH ARE THE SAME IN GIVEN AND REFERENCE ONFORMATION,18 cAND THE HAMMING DISTANCE BETWEEN GIVEN CONFORMATION AND THE19 cREFERENCE CONFORMATIONa20 c 21 cCALLS: c_cont22 c..............................................................14 ! .............................................................. 15 ! 16 ! CALCULATES NUMBER OF CONTACTS IN GIVEN CONFORMATION, NUMBER OF 17 ! CONTACTS WHICH ARE THE SAME IN GIVEN AND REFERENCE ONFORMATION, 18 ! AND THE HAMMING DISTANCE BETWEEN GIVEN CONFORMATION AND THE 19 ! REFERENCE CONFORMATIONa 20 ! 21 ! CALLS: c_cont 22 ! .............................................................. 23 23 24 24 include 'INCL.H' … … 55 55 56 56 57 c*********************************57 ! ********************************* 58 58 subroutine c_alfa(nmol,ncode) 59 59 60 c......................................................61 cCalculates the indices of C-alpha atoms and62 cstores in the array ind_alf(mxrs)63 c64 cUsage: call c_alfa(nmol,ncode)65 c 66 cnmol - index of the molecule67 cncode ---> not in use in the current version68 c 69 cOUTPUT: ind_alf(mxrs)70 c 71 cCALLS: none72 c......................................................60 ! ...................................................... 61 ! Calculates the indices of C-alpha atoms and 62 ! stores in the array ind_alf(mxrs) 63 ! 64 ! Usage: call c_alfa(nmol,ncode) 65 ! 66 ! nmol - index of the molecule 67 ! ncode ---> not in use in the current version 68 ! 69 ! OUTPUT: ind_alf(mxrs) 70 ! 71 ! CALLS: none 72 ! ...................................................... 73 73 74 74 include 'INCL.H' … … 77 77 do ia=iatrs1(n_res),iatrs2(n_res) ! Over the atoms of res. 78 78 79 cCheck for C_alpha atoms79 ! Check for C_alpha atoms 80 80 81 81 if (nmat(ia)(1:2).eq.'ca') then … … 89 89 end 90 90 91 c**********************************91 ! ********************************** 92 92 subroutine c_cont (nmol,ncode) 93 93 94 c..............................................................95 cCalculates the matrix of contacts between aminoacid residues96 cof the molecule "nmol" according to L.Mirny and E.Domany,97 cPROTEINS:Structure, Function, and Genetics 26:391-410 (1996)98 c99 cTwo residues are in contact if their C_alpha atoms are100 ccloser than 8.5 Angstrem101 c 102 cUsage: call c_cont(nmol,ncode)103 c 104 cWhere nmol is the index of the molecule (always 1, in the105 ccurrent version of SMM)106 cncode ---> not in use in the current version107 c 108 cIMPORTANT: Before the first call of this subroutine "c_alfa"109 cmust be called to calculate the inices of C_alpha atoms.110 c(ONLY ONCE)111 c 112 cOUTPUT: The output of this routine is the contact matrix113 cijcont(mxrs,mxrs)114 c 115 cijcont(i,j)=0---> residues i and j are not in contact116 cijcont(i,j)=1---> ---------''----- are in contact117 cijcont(i,j)=2---> residues i and j are adjacent118 c 119 cNOTE: Adjacent residues are always in contact (and therefore not120 ccounted)121 c 122 cHere "mxrs" is the maximum number of residues for SMM123 cObviously, this subroutine calculates only NxN part124 cof that matrix, N -is the number of res. in "nmol"125 c126 cCALLS: none127 c..............................................................94 !.............................................................. 95 ! Calculates the matrix of contacts between aminoacid residues 96 ! of the molecule "nmol" according to L.Mirny and E.Domany, 97 ! PROTEINS:Structure, Function, and Genetics 26:391-410 (1996) 98 ! 99 ! Two residues are in contact if their C_alpha atoms are 100 ! closer than 8.5 Angstrem 101 ! 102 ! Usage: call c_cont(nmol,ncode) 103 ! 104 ! Where nmol is the index of the molecule (always 1, in the 105 ! current version of SMM) 106 ! ncode ---> not in use in the current version 107 ! 108 ! IMPORTANT: Before the first call of this subroutine "c_alfa" 109 ! must be called to calculate the inices of C_alpha atoms. 110 ! (ONLY ONCE) 111 ! 112 ! OUTPUT: The output of this routine is the contact matrix 113 ! ijcont(mxrs,mxrs) 114 ! 115 ! ijcont(i,j)=0---> residues i and j are not in contact 116 ! ijcont(i,j)=1---> ---------''----- are in contact 117 ! ijcont(i,j)=2---> residues i and j are adjacent 118 ! 119 ! NOTE: Adjacent residues are always in contact (and therefore not 120 ! counted) 121 ! 122 ! Here "mxrs" is the maximum number of residues for SMM 123 ! Obviously, this subroutine calculates only NxN part 124 ! of that matrix, N -is the number of res. in "nmol" 125 ! 126 ! CALLS: none 127 !.............................................................. 128 128 129 129 include 'INCL.H' … … 146 146 do nr_j=nr_i+3,irsml2(nmol) ! Over res. j 147 147 148 cwrite(*,'(2i3)'),nr_i,nr_j148 ! write(*,'(2i3)'),nr_i,nr_j 149 149 150 150 ic=0 … … 154 154 155 155 rij2=(xat(ialf)-xat(jalf))**2 156 #+(yat(ialf)-yat(jalf))**2157 #+ (zat(ialf)-zat(jalf))**2156 & +(yat(ialf)-yat(jalf))**2 157 & + (zat(ialf)-zat(jalf))**2 158 158 if(sqrt(rij2).lt.rcut) ic=1 159 159 160 cwrite(*,'(2i3)'),nr_i,nr_j160 ! write(*,'(2i3)'),nr_i,nr_j 161 161 162 162 ijcont(nr_i,nr_j)=ic -
difang.f
r2ebb8b6 rbd2278d 1 c**************************************************************2 c 3 cThis file contains the subroutines: difang,addang4 c 5 cCopyright 2003 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: difang,addang 4 ! 5 ! Copyright 2003 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 real*8 function difang(a1,a2) 13 13 14 c......................................................15 cPURPOSE: difang = a2 - a1 with: -pi < difang <= pi16 c17 cINPUT: a1,a2-two angles [rad.]18 c 19 cCALLS: none20 c 21 c......................................................14 ! ...................................................... 15 ! PURPOSE: difang = a2 - a1 with: -pi < difang <= pi 16 ! 17 ! INPUT: a1,a2-two angles [rad.] 18 ! 19 ! CALLS: none 20 ! 21 ! ...................................................... 22 22 23 23 implicit real*8 (a-h,o-z) 24 24 25 25 parameter (pi=3.141592653589793d0, 26 #pi2=2.d0*pi)26 & pi2=2.d0*pi) 27 27 28 28 d=mod((a2-a1),pi2) … … 35 35 return 36 36 end 37 c*********************************37 ! ********************************* 38 38 real*8 function addang(a1,a2) 39 39 40 c......................................................41 cPURPOSE: addang = a1 + a2 with: -pi < addang <= pi42 c43 cINPUT: a1,a2-two angles [rad.]44 c 45 cCALLS: none46 c 47 c......................................................40 ! ...................................................... 41 ! PURPOSE: addang = a1 + a2 with: -pi < addang <= pi 42 ! 43 ! INPUT: a1,a2-two angles [rad.] 44 ! 45 ! CALLS: none 46 ! 47 ! ...................................................... 48 48 49 49 implicit real*8 (a-h,o-z) 50 50 51 51 parameter (pi=3.141592653589793d0, 52 #pi2=2.d0*pi)52 & pi2=2.d0*pi) 53 53 54 54 d=mod((a1+a2),pi2) -
dihedr.f
r2ebb8b6 rbd2278d 1 c**************************************************************2 c 3 cThis file contains the subroutines: dihedr,valang4 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: dihedr,valang 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 real*8 function dihedr(i1,i2,i3,i4) 13 13 14 c.............................................15 cPURPOSE: return dihedral angle (i1,i2,i3,i4)16 c[in rad.]17 c 18 cINPUT: i1,i2,i3,i4 - indices of four atoms19 c 20 cCALLS: none21 c.............................................14 ! ............................................. 15 ! PURPOSE: return dihedral angle (i1,i2,i3,i4) 16 ! [in rad.] 17 ! 18 ! INPUT: i1,i2,i3,i4 - indices of four atoms 19 ! 20 ! CALLS: none 21 ! ............................................. 22 22 23 23 include 'INCL.H' … … 49 49 dihedr=acos(a) 50 50 if (ux1*(uy2*z2-uz2*y2)+uy1*(uz2*x2-ux2*z2)+ 51 #uz1*(ux2*y2-uy2*x2).lt.zero) dihedr =-dihedr51 & uz1*(ux2*y2-uy2*x2).lt.zero) dihedr =-dihedr 52 52 return 53 53 else 54 54 write (*,'(a,4i5)')' dihedr> Error in coordinates of atoms #: ' 55 #,i1,i2,i3,i455 & ,i1,i2,i3,i4 56 56 57 57 write (*,*) 'stored coordinates are xvals :', 58 #xat(i1),xat(i2),xat(i3),xat(i4)58 & xat(i1),xat(i2),xat(i3),xat(i4) 59 59 write (*,*) 'yvals:', yat(i1),yat(i2),yat(i3),yat(i4) 60 60 write (*,*) 'zvals:', zat(i1),zat(i2),zat(i3),zat(i4) … … 64 64 65 65 end 66 c************************************66 ! ************************************ 67 67 real*8 function valang(i1,i2,i3) 68 68 69 c.........................................70 cPURPOSE: return valence angle (i1,i2,i3)71 c[in rad.] with 'i2' as vertex72 c 73 cINPUT: i1,i2,i3 - indices of 3 atoms74 c 75 cCALLS: none76 c.............................................69 ! ......................................... 70 ! PURPOSE: return valence angle (i1,i2,i3) 71 ! [in rad.] with 'i2' as vertex 72 ! 73 ! INPUT: i1,i2,i3 - indices of 3 atoms 74 ! 75 ! CALLS: none 76 ! ............................................. 77 77 78 78 include 'INCL.H' … … 101 101 else 102 102 write (*,'(a,3i5)')' valang> Error in coordinates of atoms #: ' 103 #,i1,i2,i3103 & ,i1,i2,i3 104 104 write (*,*) 'stored coordinates are xvals :', 105 #xat(i1),xat(i2),xat(i3)105 & xat(i1),xat(i2),xat(i3) 106 106 write (*,*) 'yvals:', yat(i1),yat(i2),yat(i3) 107 107 write (*,*) 'zvals:', zat(i1),zat(i2),zat(i3) -
eninteract.f
r2ebb8b6 rbd2278d 1 c*********************************************************************2 cThis file contains eninteract3 c 4 cCopyright 2007 Frank Eisenmenger, U.H.E. Hansmann,5 cJan H. Meinke, Sandipan Mohanty6 c 7 c 8 cDescription: Calculates the interaction energy between molecules9 cThe function assumes that all molecules are up-to-date. If in doubt10 ccall energy first.11 cThe energy function is based on the ECEPP/3 dataset.12 c 13 cTODO: Intermolecular interaction energy for FLEX and ECEPP/21 ! ********************************************************************* 2 ! This file contains eninteract 3 ! 4 ! Copyright 2007 Frank Eisenmenger, U.H.E. Hansmann, 5 ! Jan H. Meinke, Sandipan Mohanty 6 ! 7 ! 8 ! Description: Calculates the interaction energy between molecules 9 ! The function assumes that all molecules are up-to-date. If in doubt 10 ! call energy first. 11 ! The energy function is based on the ECEPP/3 dataset. 12 ! 13 ! TODO: Intermolecular interaction energy for FLEX and ECEPP/2 14 14 real*8 function eninteract() 15 15 … … 26 26 do jres= irsml1(jml), irsml2(jml) 27 27 do iat = iatrs1(ires), iatrs2(ires) 28 cAtom class of current atom28 ! Atom class of current atom 29 29 ity=ityat(iat) 30 cPoint charge at current atom30 ! Point charge at current atom 31 31 cqi=conv*cgat(iat) 32 cCartesian coordinates of current atom32 ! Cartesian coordinates of current atom 33 33 xi=xat(iat) 34 34 yi=yat(iat) … … 36 36 37 37 do jat = iatrs1(jres), iatrs2(jres) 38 cAtom type of partner38 ! Atom type of partner 39 39 jty=ityat(jat) 40 cDifferences in cartesian coordinates40 ! Differences in cartesian coordinates 41 41 xj=xat(jat) 42 42 yj=yat(jat) … … 46 46 yij=yat(jat)-yi 47 47 zij=zat(jat)-zi 48 cCartesian distance and higher powers48 ! Cartesian distance and higher powers 49 49 rij2=xij*xij+yij*yij+zij*zij 50 50 rij4=rij2*rij2 51 51 rij6=rij4*rij2 52 52 rij=sqrt(rij2) 53 cAre we using a distance dependent dielectric constant?53 ! Are we using a distance dependent dielectric constant? 54 54 if(epsd) then 55 55 sr=slp*rij … … 58 58 ep = 1.0d0 59 59 end if 60 cCoulomb interaction60 ! Coulomb interaction 61 61 eyeli=eyeli+cqi*cgat(jat)/(rij*ep) 62 cIf the two atoms cannot form a hydrogen bond use 6-12 Lennard-Jones potential62 ! If the two atoms cannot form a hydrogen bond use 6-12 Lennard-Jones potential 63 63 if (ihbty(ity,jty).eq.0) then 64 64 eyvwi=eyvwi+aij(ity,jty)/(rij6*rij6) 65 #-cij(ity,jty)/rij665 & -cij(ity,jty)/rij6 66 66 else 67 cFor hydrogen bonding use 10-12 Lennard-Jones potential67 ! For hydrogen bonding use 10-12 Lennard-Jones potential 68 68 eyhbi=eyhbi+ahb(ity,jty)/(rij6*rij6) 69 #-chb(ity,jty)/(rij6*rij4)69 & -chb(ity,jty)/(rij6*rij4) 70 70 endif 71 71 enddo -
enyflx.f
r2ebb8b6 rbd2278d 1 c**************************************************************2 c 3 cThis file contains the subroutines: enyflx4 c 5 cCopyright 2003 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: enyflx 4 ! 5 ! Copyright 2003 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 real*8 function enyflx(nml) 14 14 15 c.......................................................................16 c 17 cPURPOSE: Calculate internal energy of molecule 'nml' with FLEX dataset18 c 19 cCALLS: none20 c 21 c.......................................................................15 ! ....................................................................... 16 ! 17 ! PURPOSE: Calculate internal energy of molecule 'nml' with FLEX dataset 18 ! 19 ! CALLS: none 20 ! 21 ! ....................................................................... 22 22 23 23 include 'INCL.H' … … 26 26 if (ntlvr.eq.0) then 27 27 write (*,'(a,i4)') 28 #' enyflx> No variables defined in molecule #',nml28 & ' enyflx> No variables defined in molecule #',nml 29 29 return 30 30 endif … … 92 92 rij=sqrt(rij2) 93 93 if(epsd) then 94 c--------------------------------- distance dependent dielectric constant94 ! --------------------------------- distance dependent dielectric constant 95 95 sr=slp_f*rij 96 96 ep=plt-(sr*sr+2.0*sr+2.0)*(plt-1.0)*exp(-sr)/2.0 … … 119 119 120 120 cth=(xij*px+yij*py+zij*pz)/(rij* 121 #sqrt(px*px+py*py+pz*pz))121 & sqrt(px*px+py*py+pz*pz)) 122 122 123 123 if (cth.gt.0.0) then 124 124 eyhb=eyhb+ evw + cth*( 125 #(ahb(ity,jty)-aij(ity,jty))/rij12-126 #(chb(ity,jty)-cij(ity,jty))/rij6 )125 & (ahb(ity,jty)-aij(ity,jty))/rij12- 126 & (chb(ity,jty)-cij(ity,jty))/rij6 ) 127 127 else ! No Hydrogen Bond 128 128 eyvw=eyvw + evw … … 153 153 rij=sqrt(rij2) 154 154 if(epsd) then 155 c--------------------------------- distance dependent dielectric constant155 ! --------------------------------- distance dependent dielectric constant 156 156 sr=slp_f*rij 157 157 ep=plt-(sr*sr+2.0*sr+2.0)*(plt-1.)*exp(-sr)/2.0 … … 180 180 181 181 cth=(xij*px+yij*py+zij*pz)/(rij* 182 #sqrt(px*px+py*py+pz*pz))182 & sqrt(px*px+py*py+pz*pz)) 183 183 184 184 if (cth.gt.0.0) then 185 185 eyhb=eyhb+ evw + cth*( 186 #(ahb(ity,jty)-a14(ity,jty))/rij12-187 #(chb(ity,jty)-cij(ity,jty))/rij6 )186 & (ahb(ity,jty)-a14(ity,jty))/rij12- 187 & (chb(ity,jty)-cij(ity,jty))/rij6 ) 188 188 else ! No Hydrogen Bond 189 189 eyvw=eyvw + evw -
enylun.f
r2ebb8b6 rbd2278d 1 c*******************************************************************2 cSMMP version of Anders Irback's force field, to be called the Lund3 cforce field. This file contains the function enylun, which in turn4 ccalls all the terms in the energy function. The terms Bias (ebias),5 cHydrogen bonds (ehbmm and ehbms), Hydrophobicity (ehp) and the6 cExcluded volume (eexvol and eloexv) are also implemented in this7 cfile.8 c 9 cCopyright 2007 Frank Eisenmenger, U.H.E. Hansmann,10 cJan H. Meinke, Sandipan Mohanty11 c 1 ! ******************************************************************* 2 ! SMMP version of Anders Irback's force field, to be called the Lund 3 ! force field. This file contains the function enylun, which in turn 4 ! calls all the terms in the energy function. The terms Bias (ebias), 5 ! Hydrogen bonds (ehbmm and ehbms), Hydrophobicity (ehp) and the 6 ! Excluded volume (eexvol and eloexv) are also implemented in this 7 ! file. 8 ! 9 ! Copyright 2007 Frank Eisenmenger, U.H.E. Hansmann, 10 ! Jan H. Meinke, Sandipan Mohanty 11 ! 12 12 subroutine init_lundff 13 13 include 'INCL.H' … … 17 17 18 18 print *,'initializing Lund forcefield' 19 cSome parameters in the Lund force field.20 cThe correspondence between internal energy scale and kcal/mol19 ! Some parameters in the Lund force field. 20 ! The correspondence between internal energy scale and kcal/mol 21 21 eunit=1.3315 22 cBias22 ! Bias 23 23 kbias=100.0*eunit 24 cprint *,'Bias'25 cHydrogen bonds24 ! print *,'Bias' 25 ! Hydrogen bonds 26 26 epshb1=3.1*eunit 27 27 epshb2=2.0*eunit … … 37 37 cacc=(1.0/1.23)**powb 38 38 csacc=(1.0/1.25)**powb 39 cprint *,'Hydrogen bonds'40 cHydrophobicity41 cprint *,'Hydrophobicity with nhptyp = ',nhptyp39 ! print *,'Hydrogen bonds' 40 ! Hydrophobicity 41 ! print *,'Hydrophobicity with nhptyp = ',nhptyp 42 42 43 43 hpstrg(1)=0.0*eunit … … 61 61 call tolost(mynm) 62 62 if ((mynm.eq.'pro').or.(mynm.eq.'cpro') 63 #.or.(mynm.eq.'cpru').or.(mynm.eq.'prou')64 #.or.(mynm.eq.'pron').or.(mynm.eq.'pro+')) then63 & .or.(mynm.eq.'cpru').or.(mynm.eq.'prou') 64 & .or.(mynm.eq.'pron').or.(mynm.eq.'pro+')) then 65 65 prlvr=.true. ! residue i is a proline variant 66 66 else … … 125 125 endif 126 126 enddo 127 cprint *,'Hydrophobicity'128 129 cExcluded volume and local pair excluded volume terms127 ! print *,'Hydrophobicity' 128 129 ! Excluded volume and local pair excluded volume terms 130 130 exvk=0.1*eunit 131 131 exvcut=4.3 … … 158 158 enddo 159 159 enddo 160 cprint *,'Local pair excluded volume constants'160 ! print *,'Local pair excluded volume constants' 161 161 162 162 exvlam=0.75 … … 171 171 enddo 172 172 enddo 173 cprint *,'General excluded volume constants'174 175 cInitialization of the connections matrix matcon(i,j). The index176 ci runs from -mxconr to +mxconr, and j from 1 to mxat.177 cmatcon(i2-i1,i1) = 0, if the distance between atoms i1 and i2 is fixed178 c= 2, if atoms i1 and i2 are separated by 3 covalent179 cbonds and their distance can change180 c= 1, for all other pairs181 cif abs(i2-i1) > mxconr, the atoms are assumed to be separated by182 cmany bonds, and with no restriction on their distances. On a protein183 cmolecule made of natural amino acids, atoms with indices separated184 cby more than 35 can not be connected by three covalent bonds.173 ! print *,'General excluded volume constants' 174 175 ! Initialization of the connections matrix matcon(i,j). The index 176 ! i runs from -mxconr to +mxconr, and j from 1 to mxat. 177 ! matcon(i2-i1,i1) = 0, if the distance between atoms i1 and i2 is fixed 178 ! = 2, if atoms i1 and i2 are separated by 3 covalent 179 ! bonds and their distance can change 180 ! = 1, for all other pairs 181 ! if abs(i2-i1) > mxconr, the atoms are assumed to be separated by 182 ! many bonds, and with no restriction on their distances. On a protein 183 ! molecule made of natural amino acids, atoms with indices separated 184 ! by more than 35 can not be connected by three covalent bonds. 185 185 186 186 do i=1,mxat … … 190 190 matcon(0,i)=0 191 191 enddo 192 ccontinued...192 ! continued... 193 193 do iml=1,ntlml 194 194 do iat1=iatrs1(irsml1(iml)),iatrs2(irsml2(iml)) … … 224 224 enddo 225 225 226 cprint *,'going to initialize connections for first residue'227 cprint *,'iN,iCa,iC =',iN(irsml1(iml)),228 c# iCa(irsml1(iml)),iC(irsml1(iml))226 ! print *,'going to initialize connections for first residue' 227 ! print *,'iN,iCa,iC =',iN(irsml1(iml)), 228 ! # iCa(irsml1(iml)),iC(irsml1(iml)) 229 229 do iat1=iN(irsml1(iml))+1,iCa(irsml1(iml))-1 230 cprint *,'connections for iat1 = ',iat1230 ! print *,'connections for iat1 = ',iat1 231 231 matcon(iat1-iN(irsml1(iml)),iN(irsml1(iml)))=0 232 232 matcon(iN(irsml1(iml))-iat1,iat1)=0 … … 242 242 enddo 243 243 244 cBelow: for certain residues, some atoms separated by 3 or more bonds245 cdo not change distance. So, the connection matrix term for such pairs246 cshould be zero.244 ! Below: for certain residues, some atoms separated by 3 or more bonds 245 ! do not change distance. So, the connection matrix term for such pairs 246 ! should be zero. 247 247 248 248 do irs=irsml1(iml),irsml2(iml) … … 260 260 call tolost(mynm) 261 261 if ((mynm.eq.'pro').or.(mynm.eq.'cpro') 262 #.or.(mynm.eq.'cpru').or.(mynm.eq.'prou')263 #.or.(mynm.eq.'pron').or.(mynm.eq.'pro+')) then262 & .or.(mynm.eq.'cpru').or.(mynm.eq.'prou') 263 & .or.(mynm.eq.'pron').or.(mynm.eq.'pro+')) then 264 264 prlvr=.true. ! residue i is a proline variant 265 265 else … … 275 275 enddo 276 276 else if ((mynm.eq.'his').or.(mynm.eq.'hise') 277 #.or.(mynm.eq.'hisd').or.(mynm.eq.'his+')) then277 & .or.(mynm.eq.'hisd').or.(mynm.eq.'his+')) then 278 278 do iat1=iatoff+iatrs1(irs)+7,iatrs2(irs)-2-iatmrg 279 279 do iat2=iat1+1,iatrs2(irs)-2-iatmrg … … 306 306 enddo 307 307 else if (prlvr) then 308 cProline. Many more distances are fixed because of the fixed309 cphi angle308 ! Proline. Many more distances are fixed because of the fixed 309 ! phi angle 310 310 do iat1=iatoff+iatrs1(irs),iatrs2(irs)-2-iatmrg 311 311 do iat2=iat1+1,iatrs2(irs)-2-iatmrg … … 314 314 enddo 315 315 enddo 316 cdistances to the C' atom of the previous residue are also fixed316 ! distances to the C' atom of the previous residue are also fixed 317 317 if (irs.ne.irsml1(iml)) then 318 318 iat1=iowat(iatrs1(irs)) … … 325 325 enddo 326 326 enddo 327 cfinished initializing matrix conmat328 cprint *,'Connections matrix'329 330 cLocal pair excluded volume327 ! finished initializing matrix conmat 328 ! print *,'Connections matrix' 329 330 ! Local pair excluded volume 331 331 do i=1,mxml 332 332 ilpst(i)=1 … … 342 342 do iat2=iat1+1,iatrs2(irsml2(iml)) 343 343 if ((iat2-iat1.le.mxconr).and. 344 #matcon(iat2-iat1,iat1).eq.2) then344 & matcon(iat2-iat1,iat1).eq.2) then 345 345 ilp=ilp+1 346 346 lcp1(ilp)=iat1 … … 354 354 ilpst(iml+1)=ilp+1 355 355 endif 356 cprint *,'molecule ',iml,' lc pair range ',ilpst(iml),ilpnd(iml)357 cprint *,'local pair list'356 ! print *,'molecule ',iml,' lc pair range ',ilpst(iml),ilpnd(iml) 357 ! print *,'local pair list' 358 358 do lci=ilpst(iml),ilpnd(iml) 359 359 iat1=lcp1(lci) 360 360 iat2=lcp2(lci) 361 cprint *,lci,iat1,iat2,matcon(iat2-iat1,iat1)361 ! print *,lci,iat1,iat2,matcon(iat2-iat1,iat1) 362 362 enddo 363 363 enddo … … 375 375 ityp=1 376 376 else if ((mynm.eq.'val').or.(mynm.eq.'leu').or.(mynm.eq.'ile') 377 #.or.(mynm.eq.'met').or.(mynm.eq.'pro').or.(mynm.eq.'cpro')378 #.or.(mynm.eq.'cpru').or.(mynm.eq.'prou')379 #.or.(mynm.eq.'pron').or.(mynm.eq.'pro+')) then377 & .or.(mynm.eq.'met').or.(mynm.eq.'pro').or.(mynm.eq.'cpro') 378 & .or.(mynm.eq.'cpru').or.(mynm.eq.'prou') 379 & .or.(mynm.eq.'pron').or.(mynm.eq.'pro+')) then 380 380 ityp=2 381 381 else if ((mynm.eq.'phe').or.(mynm.eq.'tyr').or.(mynm.eq.'trp')) 382 #then382 & then 383 383 ityp=3 384 384 endif … … 408 408 return 409 409 end 410 cEvaluates backbone backbone hydrogen bond strength for residues411 ci and j, taking the donor from residue i and acceptor from residue j410 ! Evaluates backbone backbone hydrogen bond strength for residues 411 ! i and j, taking the donor from residue i and acceptor from residue j 412 412 real*8 function ehbmmrs(i,j) 413 413 include 'INCL.H' … … 424 424 r2=dx*dx+dy*dy+dz*dz 425 425 if (r2.gt.cthb2) then 426 cprint *,'hbmm = 0 ',cthb2,r2,a1,a2,d1,d2427 cprint *,'a1,a2,d1,d2,r2 = ',a1,a2,d1,d2,r2,sighb2,cthb426 ! print *,'hbmm = 0 ',cthb2,r2,a1,a2,d1,d2 427 ! print *,'a1,a2,d1,d2,r2 = ',a1,a2,d1,d2,r2,sighb2,cthb 428 428 ehbmmrs=0 429 429 return … … 432 432 cb=(xat(a2)-xat(a1))*dx+(yat(a2)-yat(a1))*dy+(zat(a2)-zat(a1))*dz 433 433 if (powa.gt.0.and.ca.le.0) then 434 cprint *,'hbmm, returning 0 because of angle a'434 ! print *,'hbmm, returning 0 because of angle a' 435 435 ehbmmrs=0 436 436 return 437 437 endif 438 438 if (powb.gt.0.and.cb.le.0) then 439 cprint *,'hbmm, returning 0 because of angle b'439 ! print *,'hbmm, returning 0 because of angle b' 440 440 ehbmmrs=0 441 441 return … … 446 446 evlu=((ca*ca/r2)**(0.5*powa))*((cb*cb/r2)**(0.5*powb)) 447 447 evlu=evlu*(r6*(5*r6-6*r4)+alhb+blhb*r2) 448 cprint *,'found hbmm contribution ',evlu448 ! print *,'found hbmm contribution ',evlu 449 449 ehbmmrs=epshb1*evlu 450 450 return 451 451 end 452 452 real*8 function enylun(nml) 453 cnml = 1 .. ntlml. No provision exists to handle out of range values454 cfor nml inside this function.453 ! nml = 1 .. ntlml. No provision exists to handle out of range values 454 ! for nml inside this function. 455 455 include 'INCL.H' 456 456 include 'incl_lund.h' … … 462 462 eyvr=0.0 ! Local pair excluded volume, in a sense a variable potential 463 463 eyvw=0.0 ! atom-atom repulsion, excluded volume 464 catom-atom repulsion is calculated on a system wide basis, instead of465 cmolecule by molecule for efficiency. Look into function exvlun.464 ! atom-atom repulsion is calculated on a system wide basis, instead of 465 ! molecule by molecule for efficiency. Look into function exvlun. 466 466 467 467 istres=irsml1(nml) 468 468 indres=irsml2(nml) 469 469 470 cFirst, all terms that can be calculated on a residue by residue basis470 ! First, all terms that can be calculated on a residue by residue basis 471 471 do i=istres,indres 472 472 mynm=seq(i) 473 473 call tolost(mynm) 474 474 if ((mynm.eq.'pro').or.(mynm.eq.'cpro') 475 #.or.(mynm.eq.'cpru').or.(mynm.eq.'prou')476 #.or.(mynm.eq.'pron').or.(mynm.eq.'pro+')) then475 & .or.(mynm.eq.'cpru').or.(mynm.eq.'prou') 476 & .or.(mynm.eq.'pron').or.(mynm.eq.'pro+')) then 477 477 prlvr=.true. ! residue i is a proline variant 478 478 else … … 480 480 endif 481 481 482 cBias, or local electrostatic term. Excluded from the list are483 cresidues at the ends of the chain, glycine and all proline variants482 ! Bias, or local electrostatic term. Excluded from the list are 483 ! residues at the ends of the chain, glycine and all proline variants 484 484 if ((i.ne.istres).and.(i.ne.indres).and. 485 #.not.prlvr.and.mynm.ne.'gly') then485 & .not.prlvr.and.mynm.ne.'gly') then 486 486 eyel=eyel+ebiasrs(i) 487 487 endif 488 cBackbone--backbone hydrogen bonds488 ! Backbone--backbone hydrogen bonds 489 489 shbm1=1.0 490 490 shbm2=1.0 491 491 if ((i.eq.istres).or.(i.eq.indres)) shbm1=0.5 492 cResidue i contributes the donor, and j, the acceptor, so both i and493 cj run over the whole set of amino acids.494 cNo terms for residue i, if it is a proline variant.492 ! Residue i contributes the donor, and j, the acceptor, so both i and 493 ! j run over the whole set of amino acids. 494 ! No terms for residue i, if it is a proline variant. 495 495 if (.not.prlvr) then 496 496 do j=istres,indres … … 500 500 enddo 501 501 endif 502 cHydrophobicity, only if residue i is hydrophobic to start with502 ! Hydrophobicity, only if residue i is hydrophobic to start with 503 503 ihpi=ihptype(i) 504 504 if (ihpi.ge.0) then 505 cUnlike hydrogen bonds, the hydrophobicity potential is symmetric506 cin i and j. So, the loop for j runs from i+1 to the end.505 ! Unlike hydrogen bonds, the hydrophobicity potential is symmetric 506 ! in i and j. So, the loop for j runs from i+1 to the end. 507 507 508 508 do j=i+1,indres … … 518 518 enddo 519 519 520 cTerms that are not calculated residue by residue ...521 522 cLocal pair or third-neighbour excluded volume523 cNumerically this is normally the term with largest positive524 ccontribution to the energy in an equilibrated stystem.520 ! Terms that are not calculated residue by residue ... 521 522 ! Local pair or third-neighbour excluded volume 523 ! Numerically this is normally the term with largest positive 524 ! contribution to the energy in an equilibrated stystem. 525 525 526 526 i1=ilpst(nml) … … 546 546 etmp=etmp+etmp1 547 547 endif 548 cprint *,'pair : ',iat1,iat2,' contribution ',etmp1549 cprint *,exvcut2,r2548 ! print *,'pair : ',iat1,iat2,' contribution ',etmp1 549 ! print *,exvcut2,r2 550 550 enddo 551 551 eyvr=exvk*etmp … … 569 569 b2=20.25 570 570 a2=12.25 571 cihp1=ihptype(i1)572 cihp2=ihptype(i2)571 ! ihp1=ihptype(i1) 572 ! ihp2=ihptype(i2) 573 573 if ((ihp1.le.0).or.(ihp2.le.0)) then 574 574 ehp=0.0 … … 609 609 include 'INCL.H' 610 610 include 'incl_lund.h' 611 cFor multi-chain systems it makes little sense to split the calculation612 cof this term into an 'interaction part' and a contribution from613 cindividual molecules. So, normally this should always be called with614 cargument nml=0. Only for diagnostic reasons, you might want to find615 cthe contribution from one molecule in a multi-chain system assuming616 cthere was no other molecule.611 ! For multi-chain systems it makes little sense to split the calculation 612 ! of this term into an 'interaction part' and a contribution from 613 ! individual molecules. So, normally this should always be called with 614 ! argument nml=0. Only for diagnostic reasons, you might want to find 615 ! the contribution from one molecule in a multi-chain system assuming 616 ! there was no other molecule. 617 617 dimension isort(mxat),ngbr(mxat),locccl(mxat),incell(mxcell) 618 618 dimension icell(mxat) … … 626 626 627 627 eyvw=0.0 628 cThe beginning part of this implementation is very similar to the629 cassignment of cells to the atoms during calculation of solvent630 caccessible surface area. So, much of that part is similar. But631 cunlike the accessible surface calculations, this term is symmetric632 cin any two participating atoms. So, the part after the assignment633 cof cells differs even in the structure of the code.628 ! The beginning part of this implementation is very similar to the 629 ! assignment of cells to the atoms during calculation of solvent 630 ! accessible surface area. So, much of that part is similar. But 631 ! unlike the accessible surface calculations, this term is symmetric 632 ! in any two participating atoms. So, the part after the assignment 633 ! of cells differs even in the structure of the code. 634 634 635 635 do i=1,mxcell 636 636 incell(i)=0 637 637 enddo 638 cprint *,'evaluating general excluded volume :',istat,',',indat639 cFind minimal containing box638 ! print *,'evaluating general excluded volume :',istat,',',indat 639 ! Find minimal containing box 640 640 xmin=xat(istat) 641 641 ymin=yat(istat) … … 666 666 sizey=ymax-ymin 667 667 sizez=zmax-zmin 668 cNumber of cells along each directions that fit into the box.668 ! Number of cells along each directions that fit into the box. 669 669 ndx=int(sizex/exvcutg)+1 670 670 ndy=int(sizey/exvcutg)+1 … … 673 673 nxy=ndx*ndy 674 674 ncell=nxy*ndz 675 cprint *,'Number of cells along x,y,z = ',ndx,',',ndy,',',ndz675 ! print *,'Number of cells along x,y,z = ',ndx,',',ndy,',',ndz 676 676 if (ncell.ge.mxcell) then 677 677 print *,'exvlun> required number of cells',ncell, 678 #' exceeded the limit ',mxcell678 & ' exceeded the limit ',mxcell 679 679 print *,'recompile with a higher mxcell.' 680 680 stop 681 681 endif 682 cExpand box to contain an integral number of cells along each direction682 ! Expand box to contain an integral number of cells along each direction 683 683 shiftx=(dble(ndx)*exvcutg-sizex)/2.0 684 684 shifty=(dble(ndy)*exvcutg-sizey)/2.0 … … 691 691 zmax=zmax+shiftz 692 692 693 cSet occupied cells to zero. Note that the maximum number of occupied694 ccells is the number of atoms in the system.693 ! Set occupied cells to zero. Note that the maximum number of occupied 694 ! cells is the number of atoms in the system. 695 695 nocccl=0 696 696 do i=1,mxat … … 698 698 enddo 699 699 700 cPut atoms in cells700 ! Put atoms in cells 701 701 do j=istat,indat 702 702 mx=min(int(max((xat(j)-xmin)/exvcutg,0.0d0)),ndx-1) … … 710 710 else 711 711 if (incell(icellj).eq.0) then 712 cpreviously unoccupied cell712 ! previously unoccupied cell 713 713 nocccl=nocccl+1 714 714 locccl(nocccl)=icellj … … 717 717 endif 718 718 enddo 719 cprint *,'finished assigning cells. nocccl = ',nocccl720 cCummulative occupancy of i'th cell719 ! print *,'finished assigning cells. nocccl = ',nocccl 720 ! Cummulative occupancy of i'th cell 721 721 do i=1,ncell 722 722 incell(i+1)=incell(i+1)+incell(i) 723 723 enddo 724 cprint *,'finished making cumulative cell sums'725 cSorting atoms by their cell index724 ! print *,'finished making cumulative cell sums' 725 ! Sorting atoms by their cell index 726 726 do i=istat,indat 727 727 j=icell(i) … … 730 730 incell(j)=jj-1 731 731 enddo 732 cprint *,'sorted atoms by cell index'732 ! print *,'sorted atoms by cell index' 733 733 etmp=0.0 734 734 do icl=1,nocccl 735 cloop through occupied cells735 ! loop through occupied cells 736 736 lcell=locccl(icl) 737 737 ix=mod(lcell-1,ndx) 738 738 iy=(mod(lcell-1,nxy)-ix)/ndx 739 739 iz=(lcell-1-ix-ndx*iy)/nxy 740 cprint *,'icl=',icl,'absolute index of cell = ',lcell741 cprint *,'iz,iy,ix = ',iz,iy,ix742 cfind all atoms in current cell and all its forward-going neighbours740 ! print *,'icl=',icl,'absolute index of cell = ',lcell 741 ! print *,'iz,iy,ix = ',iz,iy,ix 742 ! find all atoms in current cell and all its forward-going neighbours 743 743 nex=min(ix+1,ndx-1) 744 744 ney=min(iy+1,ndy-1) … … 751 751 jcl=jx+ndx*jy+nxy*jz+1 752 752 do ii=incell(jcl)+1,incell(jcl+1) 753 ccount the total number of neighbours753 ! count the total number of neighbours 754 754 nngbr=nngbr+1 755 755 if (jx.eq.ix.and.jy.eq.iy.and.jz.eq.iz) then 756 ccount how many neighbours are from the same cell756 ! count how many neighbours are from the same cell 757 757 nsame=nsame+1 758 758 endif … … 762 762 enddo 763 763 enddo 764 cA few more cells need to be searched, so that we cover 13 of the 26765 cneighbouring cells.766 c1764 ! A few more cells need to be searched, so that we cover 13 of the 26 765 ! neighbouring cells. 766 ! 1 767 767 jx=ix+1 768 768 jy=iy … … 773 773 ngbr(nngbr)=isort(ii) 774 774 enddo 775 c2775 ! 2 776 776 jx=ix 777 777 jy=iy-1 … … 782 782 ngbr(nngbr)=isort(ii) 783 783 enddo 784 c3784 ! 3 785 785 jx=ix-1 786 786 jy=iy+1 … … 791 791 ngbr(nngbr)=isort(ii) 792 792 enddo 793 c4793 ! 4 794 794 jx=ix+1 795 795 jy=iy+1 … … 800 800 ngbr(nngbr)=isort(ii) 801 801 enddo 802 c5802 ! 5 803 803 jx=ix+1 804 804 jy=iy-1 … … 809 809 ngbr(nngbr)=isort(ii) 810 810 enddo 811 c6811 ! 6 812 812 jx=ix+1 813 813 jy=iy-1 … … 819 819 enddo 820 820 821 cprint *,'atoms in same cell ',nsame822 cprint *,'atoms in neighbouring cells ',nngbr821 ! print *,'atoms in same cell ',nsame 822 ! print *,'atoms in neighbouring cells ',nngbr 823 823 do i1=1,nsame 824 cOver all atoms from the original cell824 ! Over all atoms from the original cell 825 825 iat1=ngbr(i1) 826 826 do i2=i1,nngbr 827 cOver all atoms in the original+neighbouring cells827 ! Over all atoms in the original+neighbouring cells 828 828 iat2=ngbr(i2) 829 829 xij=xat(iat1)-xat(iat2) … … 834 834 if (r2.le.exvcutg2) then 835 835 if (abs(iat2-iat1).gt.mxconr.or. 836 #matcon(iat2-iat1,iat1).eq.1) then836 & matcon(iat2-iat1,iat1).eq.1) then 837 837 iatt1=ityat(iat1) 838 838 iatt2=ityat(iat2) … … 840 840 r6=r6*r6*r6 841 841 etmp1=r6*r6+asaexv(iatt1,iatt2) 842 #+bsaexv(iatt1,iatt2)*r2842 & +bsaexv(iatt1,iatt2)*r2 843 843 etmp=etmp+etmp1 844 cif (etmp1.ge.2000) then845 cprint *,'contribution ',iat1,iat2,etmp1846 ccall outpdb(1,'EXAMPLES/clash.pdb')847 cstop848 cendif844 ! if (etmp1.ge.2000) then 845 ! print *,'contribution ',iat1,iat2,etmp1 846 ! call outpdb(1,'EXAMPLES/clash.pdb') 847 ! stop 848 ! endif 849 849 endif 850 850 endif … … 852 852 enddo 853 853 enddo 854 cirs=1855 cdo iat=iatrs1(irs),iatrs2(irs)856 cdo j=-mxconr,mxconr857 cprint *,iat,j,':',matcon(j,iat)858 cenddo859 cenddo860 cirs=irsml2(1)861 cdo iat=iatrs1(irs),iatrs2(irs)862 cdo j=-mxconr,mxconr863 cprint *,iat,j,':',matcon(j,iat)864 cenddo865 cenddo854 ! irs=1 855 ! do iat=iatrs1(irs),iatrs2(irs) 856 ! do j=-mxconr,mxconr 857 ! print *,iat,j,':',matcon(j,iat) 858 ! enddo 859 ! enddo 860 ! irs=irsml2(1) 861 ! do iat=iatrs1(irs),iatrs2(irs) 862 ! do j=-mxconr,mxconr 863 ! print *,iat,j,':',matcon(j,iat) 864 ! enddo 865 ! enddo 866 866 867 867 eyvw=exvk*etmp … … 871 871 872 872 real*8 function exvbrfc() 873 cBrute force excluded volume evaluation873 ! Brute force excluded volume evaluation 874 874 include 'INCL.H' 875 875 include 'incl_lund.h' … … 887 887 if (r2.le.exvcutg2) then 888 888 if (abs(iat2-iat1).gt.mxconr.or. 889 #matcon(iat2-iat1,iat1).eq.1) then889 & matcon(iat2-iat1,iat1).eq.1) then 890 890 iatt1=ityat(iat1) 891 891 iatt2=ityat(iat2) … … 893 893 r6=r6*r6*r6 894 894 etmp1=r6*r6+asaexv(iatt1,iatt2) 895 #+bsaexv(iatt1,iatt2)*r2895 & +bsaexv(iatt1,iatt2)*r2 896 896 etmp=etmp+etmp1 897 897 if (iat1.eq.43.and.iat2.eq.785) then … … 903 903 print *,'bsa = ',bsaexv(iatt1,iatt2) 904 904 905 ccall outpdb(1,'EXAMPLES/clash.pdb')906 cstop905 ! call outpdb(1,'EXAMPLES/clash.pdb') 906 ! stop 907 907 endif 908 908 else 909 cprint *,'atoms ', iat1,' and ',iat2,' were close',910 c# 'but matcon is ',matcon(iat2-iat1,iat1)909 ! print *,'atoms ', iat1,' and ',iat2,' were close', 910 ! # 'but matcon is ',matcon(iat2-iat1,iat1) 911 911 endif 912 912 endif -
enyreg.f
r2ebb8b6 rbd2278d 3 3 ! Copyright 2007 Frank Eisenmenger, U.H.E. Hansmann, 4 4 ! Jan H. Meinke, Sandipan Mohanty 5 c*******************************5 ! ******************************* 6 6 real*8 function enyreg(nml) 7 7 8 c----------------------------------------------------9 c 10 cPURPOSE: sum( ( R_i - R^ref_j )**2 )11 c 12 cwith: R_i - atom position i in SMMP structure13 cR^ref_j - corresponding atom j in PDB str.14 c 15 cCALLS: none16 c 17 c----------------------------------------------------8 ! ---------------------------------------------------- 9 ! 10 ! PURPOSE: sum( ( R_i - R^ref_j )**2 ) 11 ! 12 ! with: R_i - atom position i in SMMP structure 13 ! R^ref_j - corresponding atom j in PDB str. 14 ! 15 ! CALLS: none 16 ! 17 ! ---------------------------------------------------- 18 18 19 19 include 'INCL.H' … … 29 29 30 30 eny = eny + (xat(i)-xatp(j))**2+(yat(i)-yatp(j))**2+ 31 #(zat(i)-zatp(j))**231 & (zat(i)-zatp(j))**2 32 32 endif 33 33 enddo ! atoms -
enyshe.f
r2ebb8b6 rbd2278d 1 c**************************************************************2 c 3 cThis file contains the subroutines: enyshe4 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: enyshe 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 real*8 function enyshe(nml) 14 14 15 c............................................................................16 c 17 cPURPOSE: Calculate internal energy of molecule 'nml' with ECEPP parameters18 c 19 cCALLS: none20 c 21 cThe function loops over all moving sets within the molecule. Within22 cthis loop it loops over the van-der-Waals domains of each atom in the23 cmoving set and finally over the atoms that belong to the 1-4 interaction24 cset.25 c............................................................................15 ! ............................................................................ 16 ! 17 ! PURPOSE: Calculate internal energy of molecule 'nml' with ECEPP parameters 18 ! 19 ! CALLS: none 20 ! 21 ! The function loops over all moving sets within the molecule. Within 22 ! this loop it loops over the van-der-Waals domains of each atom in the 23 ! moving set and finally over the atoms that belong to the 1-4 interaction 24 ! set. 25 ! ............................................................................ 26 26 27 27 include 'INCL.H' 28 28 29 cIf nml == 0 calculate the interaction between all pairs.29 ! If nml == 0 calculate the interaction between all pairs. 30 30 if (nml.eq.0) then 31 31 ntlvr = nvr … … 36 36 if (ntlvr.eq.0) then 37 37 write (*,'(a,i4)') 38 #' enyshe> No variables defined in molecule #',nml38 & ' enyshe> No variables defined in molecule #',nml 39 39 return 40 40 endif … … 49 49 i1s = imsml1(ntlml) + nmsml(ntlml) 50 50 else 51 cIndex of first variable in molecule.51 ! Index of first variable in molecule. 52 52 ifivr=ivrml1(nml) 53 cIndex of last moving set in molecule53 ! Index of last moving set in molecule 54 54 i1s=imsml1(nml)+nmsml(nml) 55 55 endif 56 cLoop over moving sets/variables in reverse order56 ! Loop over moving sets/variables in reverse order 57 57 do io=ifivr+ntlvr-1,ifivr,-1 58 cThe array iorvr contains the variables in an "apropriate" order.58 ! The array iorvr contains the variables in an "apropriate" order. 59 59 iv=iorvr(io) 60 cIndex of the primary moving atom for the variable with index iv60 ! Index of the primary moving atom for the variable with index iv 61 61 ia=iatvr(iv) 62 cGet the type of variable iv (valence length, valence angle, dihedral angle)62 ! Get the type of variable iv (valence length, valence angle, dihedral angle) 63 63 it=ityvr(iv) 64 cClass of variable iv's potential (Q: What are they)64 ! Class of variable iv's potential (Q: What are they) 65 65 ic=iclvr(iv) 66 cIf iv is a dihedral angle ...66 ! If iv is a dihedral angle ... 67 67 if (it.eq.3) then 68 cBarrier height * 1/2 of the potential of iv.68 ! Barrier height * 1/2 of the potential of iv. 69 69 e0=e0to(ic) 70 cCalculate the periodic potential term. sgto is the sign of the barrier, rnto is71 cthe periodicity and toat is torsion angle(?) associate with atom ia.70 ! Calculate the periodic potential term. sgto is the sign of the barrier, rnto is 71 ! the periodicity and toat is torsion angle(?) associate with atom ia. 72 72 if (e0.ne.0.) 73 #eyvr=eyvr+e0*(1.0+sgto(ic)*cos(toat(ia)*rnto(ic)))74 celse if iv is a valence angle ...73 & eyvr=eyvr+e0*(1.0+sgto(ic)*cos(toat(ia)*rnto(ic))) 74 ! else if iv is a valence angle ... 75 75 elseif (it.eq.2) then 76 cvr is the valence angle of ia76 ! vr is the valence angle of ia 77 77 vr=baat(ia) 78 celse if iv is a valence length...78 ! else if iv is a valence length... 79 79 elseif (it.eq.1) then 80 cvr is the length of the valence bond80 ! vr is the length of the valence bond 81 81 vr=blat(ia) 82 82 endif 83 83 84 c============================================ Energies & Atomic forces85 cindex of next to last moving set84 ! ============================================ Energies & Atomic forces 85 ! index of next to last moving set 86 86 i2s=i1s-1 87 cindex of first moving set associated with iv87 ! index of first moving set associated with iv 88 88 i1s=imsvr1(iv) 89 cLoop over all moving sets starting from the one associated with vr to the end.89 ! Loop over all moving sets starting from the one associated with vr to the end. 90 90 do ims=i1s,i2s 91 cFirst atom of the current moving set91 ! First atom of the current moving set 92 92 i1=latms1(ims) 93 cLast atom of the current moving set93 ! Last atom of the current moving set 94 94 i2=latms2(ims) 95 cLoop over all atoms of the current moving set.95 ! Loop over all atoms of the current moving set. 96 96 do i=i1,i2 97 cAtom class of current atom97 ! Atom class of current atom 98 98 ity=ityat(i) 99 cPoint charge at current atom99 ! Point charge at current atom 100 100 cqi=conv*cgat(i) 101 cCartesian coordinates of current atom101 ! Cartesian coordinates of current atom 102 102 xi=xat(i) 103 103 yi=yat(i) 104 104 zi=zat(i) 105 cLoop over the atoms of the van der Waals domain belonging to atom i105 ! Loop over the atoms of the van der Waals domain belonging to atom i 106 106 do ivw=ivwat1(i),ivwat2(i) 107 cLoop over the atoms of the van der Waals domain of the atoms of the108 cvan der Waals domain of atom i109 cQ: Which atoms are in these domains?107 ! Loop over the atoms of the van der Waals domain of the atoms of the 108 ! van der Waals domain of atom i 109 ! Q: Which atoms are in these domains? 110 110 do j=lvwat1(ivw),lvwat2(ivw) 111 cAtom type of partner111 ! Atom type of partner 112 112 jty=ityat(j) 113 cDifferences in cartesian coordinates113 ! Differences in cartesian coordinates 114 114 xij=xat(j)-xi 115 115 yij=yat(j)-yi 116 116 zij=zat(j)-zi 117 cCartesian distance and higher powers117 ! Cartesian distance and higher powers 118 118 rij2=xij*xij+yij*yij+zij*zij 119 119 rij4=rij2*rij2 120 120 rij6=rij4*rij2 121 121 rij=sqrt(rij2) 122 cAre we using a distance dependent dielectric constant?122 ! Are we using a distance dependent dielectric constant? 123 123 if(epsd) then 124 124 sr=slp*rij … … 127 127 ep = 1.0d0 128 128 end if 129 cCoulomb interaction129 ! Coulomb interaction 130 130 eyel=eyel+cqi*cgat(j)/(rij*ep) 131 cIf the two atoms cannot form a hydrogen bond use 6-12 Lennard-Jones potential131 ! If the two atoms cannot form a hydrogen bond use 6-12 Lennard-Jones potential 132 132 if (ihbty(ity,jty).eq.0) then 133 133 eyvw=eyvw+aij(ity,jty)/(rij6*rij6) 134 #-cij(ity,jty)/rij6134 & -cij(ity,jty)/rij6 135 135 else 136 cFor hydrogen bonding use 10-12 Lennard-Jones potential136 ! For hydrogen bonding use 10-12 Lennard-Jones potential 137 137 eyhb=eyhb+ahb(ity,jty)/(rij6*rij6) 138 #-chb(ity,jty)/(rij6*rij4)138 & -chb(ity,jty)/(rij6*rij4) 139 139 endif 140 140 … … 142 142 enddo 143 143 144 cLoop over 1-4 interaction partners145 cThe interactions between atoms that are three bonds apart in the protein are146 cdominated by quantum mechanical effects. They are treated separately.144 ! Loop over 1-4 interaction partners 145 ! The interactions between atoms that are three bonds apart in the protein are 146 ! dominated by quantum mechanical effects. They are treated separately. 147 147 do i14=i14at1(i),i14at2(i) 148 148 j=l14at(i14) … … 157 157 rij6=rij4*rij2 158 158 rij = sqrt(rij2) 159 cAre we using a distance dependent dielectric constant?159 ! Are we using a distance dependent dielectric constant? 160 160 if(epsd) then 161 161 sr=slp*rij … … 166 166 167 167 eyel=eyel+cqi*cgat(j)/(rij*ep) 168 cIf hydrogen bonding is not possible use 6-12 Lennard-Jones potential.168 ! If hydrogen bonding is not possible use 6-12 Lennard-Jones potential. 169 169 if (ihbty(ity,jty).eq.0) then 170 170 eyvw=eyvw+a14(ity,jty)/(rij6*rij6) 171 #-cij(ity,jty)/rij6171 & -cij(ity,jty)/rij6 172 172 else 173 cUse 10-12 Lennard-Jones potential for hydrogen bonds.173 ! Use 10-12 Lennard-Jones potential for hydrogen bonds. 174 174 eyhb=eyhb+ahb(ity,jty)/(rij6*rij6) 175 #-chb(ity,jty)/(rij6*rij4)175 & -chb(ity,jty)/(rij6*rij4) 176 176 endif 177 177 -
enyshe_p.f
r2ebb8b6 rbd2278d 1 c**************************************************************2 c 3 cThis file contains the subroutines: enyshe4 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: enyshe 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 real*8 function enyshe(nml) 14 14 15 c............................................................................16 c17 cPURPOSE: Calculate internal energy of molecule 'nml' with ECEPP parameters18 c19 cCALLS: none20 c21 cThe function loops over all moving sets within the molecule. Within22 cthis loop it loops over the van-der-Waals domains of each atom in the23 cmoving set and finally over the atoms that belong to the 1-4 interaction24 cset.25 c............................................................................15 ! ............................................................................ 16 ! 17 ! PURPOSE: Calculate internal energy of molecule 'nml' with ECEPP parameters 18 ! 19 ! CALLS: none 20 ! 21 ! The function loops over all moving sets within the molecule. Within 22 ! this loop it loops over the van-der-Waals domains of each atom in the 23 ! moving set and finally over the atoms that belong to the 1-4 interaction 24 ! set. 25 ! ............................................................................ 26 26 27 27 include 'INCL.H' … … 30 30 31 31 32 cIf nml == 0 calculate the interaction between all pairs.32 ! If nml == 0 calculate the interaction between all pairs. 33 33 if (nml.eq.0) then 34 34 ntlvr = nvr … … 39 39 if (ntlvr.eq.0) then 40 40 write (*,'(a,i4)') 41 #' enyshe> No variables defined in molecule #',nml41 & ' enyshe> No variables defined in molecule #',nml 42 42 return 43 43 endif … … 57 57 i1s = imsml1(ntlml) + nmsml(ntlml) 58 58 else 59 cIndex of first variable in molecule.59 ! Index of first variable in molecule. 60 60 ifivr=ivrml1(nml) 61 cIndex of last moving set in molecule61 ! Index of last moving set in molecule 62 62 i1s=imsml1(nml)+nmsml(nml) 63 63 endif 64 cLoop over variables in reverse order65 cThis is the first loop to parallize. We'll just split the moving sets66 cover the number of available processors and sum the energy up in the end.67 68 cNumber of moving sets per processor64 ! Loop over variables in reverse order 65 ! This is the first loop to parallize. We'll just split the moving sets 66 ! over the number of available processors and sum the energy up in the end. 67 68 ! Number of moving sets per processor 69 69 iend = ifivr 70 70 istart = ifivr + ntlvr - 1 … … 72 72 startwtime = MPI_Wtime() 73 73 loopcounter = 0 74 cdo io=ifivr+ntlvr-1,ifivr,-174 ! do io=ifivr+ntlvr-1,ifivr,-1 75 75 do io = workPerProcessor(nml, myrank) - 1, 76 76 & workPerProcessor(nml, myrank+1), -1 … … 78 78 i1s = imsvr1(iorvr(io + 1)) 79 79 endif 80 cThe array iorvr contains the variables in an "apropriate" order.80 ! The array iorvr contains the variables in an "apropriate" order. 81 81 iv=iorvr(io) 82 cIndex of the primary moving atom for the variable with index iv82 ! Index of the primary moving atom for the variable with index iv 83 83 ia=iatvr(iv) 84 cGet the type of variable iv (valence length, valence angle, dihedral angle)84 ! Get the type of variable iv (valence length, valence angle, dihedral angle) 85 85 it=ityvr(iv) 86 cClass of variable iv's potential (Q: What are they)86 ! Class of variable iv's potential (Q: What are they) 87 87 ic=iclvr(iv) 88 cIf iv is a dihedral angle ...88 ! If iv is a dihedral angle ... 89 89 if (it.eq.3) then 90 cBarrier height * 1/2 of the potential of iv.90 ! Barrier height * 1/2 of the potential of iv. 91 91 e0=e0to(ic) 92 cCalculate the periodic potential term. sgto is the sign of the barrier, rnto is93 cthe periodicity and toat is torsion angle(?) associate with atom ia.92 ! Calculate the periodic potential term. sgto is the sign of the barrier, rnto is 93 ! the periodicity and toat is torsion angle(?) associate with atom ia. 94 94 if (e0.ne.0.) 95 #teyvr=teyvr+e0*(1.0+sgto(ic)*cos(toat(ia)*rnto(ic)))96 celse if iv is a valence angle ...95 & teyvr=teyvr+e0*(1.0+sgto(ic)*cos(toat(ia)*rnto(ic))) 96 ! else if iv is a valence angle ... 97 97 elseif (it.eq.2) then 98 cvr is the valence angle of ia98 ! vr is the valence angle of ia 99 99 vr=baat(ia) 100 celse if iv is a valence length...100 ! else if iv is a valence length... 101 101 elseif (it.eq.1) then 102 cvr is the length of the valence bond102 ! vr is the length of the valence bond 103 103 vr=blat(ia) 104 104 endif 105 105 106 c============================================ Energies & Atomic forces107 cindex of next to last moving set106 ! ============================================ Energies & Atomic forces 107 ! index of next to last moving set 108 108 i2s=i1s-1 109 cindex of first moving set associated with iv109 ! index of first moving set associated with iv 110 110 i1s=imsvr1(iv) 111 cLoop over all moving sets starting from the one associated with vr to the end.111 ! Loop over all moving sets starting from the one associated with vr to the end. 112 112 do ims=i1s,i2s 113 cFirst atom of the current moving set113 ! First atom of the current moving set 114 114 i1=latms1(ims) 115 cLast atom of the current moving set115 ! Last atom of the current moving set 116 116 i2=latms2(ims) 117 cLoop over all atoms of the current moving set.117 ! Loop over all atoms of the current moving set. 118 118 do i=i1,i2 119 cAtom class of current atom119 ! Atom class of current atom 120 120 ity=ityat(i) 121 cPoint charge at current atom121 ! Point charge at current atom 122 122 cqi=conv*cgat(i) 123 cCartesian coordinates of current atom123 ! Cartesian coordinates of current atom 124 124 xi=xat(i) 125 125 yi=yat(i) 126 126 zi=zat(i) 127 cLoop over the atoms of the van der Waals domain belonging to atom i127 ! Loop over the atoms of the van der Waals domain belonging to atom i 128 128 do ivw=ivwat1(i),ivwat2(i) 129 cLoop over the atoms of the van der Waals domain of the atoms of the130 cvan der Waals domain of atom i131 cQ: Which atoms are in these domains?129 ! Loop over the atoms of the van der Waals domain of the atoms of the 130 ! van der Waals domain of atom i 131 ! Q: Which atoms are in these domains? 132 132 do j=lvwat1(ivw),lvwat2(ivw) 133 133 134 134 loopcounter = loopcounter + 1 135 cAtom type of partner135 ! Atom type of partner 136 136 jty=ityat(j) 137 cDifferences in cartesian coordinates137 ! Differences in cartesian coordinates 138 138 xij=xat(j)-xi 139 139 yij=yat(j)-yi 140 140 zij=zat(j)-zi 141 cCartesian distance and higher powers141 ! Cartesian distance and higher powers 142 142 rij2=xij*xij+yij*yij+zij*zij 143 143 rij4=rij2*rij2 144 144 rij6=rij4*rij2 145 145 rij=sqrt(rij2) 146 cAre we using a distance dependent dielectric constant?146 ! Are we using a distance dependent dielectric constant? 147 147 if(epsd) then 148 148 sr=slp*rij … … 151 151 ep = 1.0d0 152 152 end if 153 cCoulomb interaction153 ! Coulomb interaction 154 154 teyel=teyel+cqi*cgat(j)/(rij*ep) 155 cIf the two atoms cannot form a hydrogen bond use 6-12 Lennard-Jones potential155 ! If the two atoms cannot form a hydrogen bond use 6-12 Lennard-Jones potential 156 156 if (ihbty(ity,jty).eq.0) then 157 157 teyvw=teyvw+aij(ity,jty)/(rij6*rij6) 158 #-cij(ity,jty)/rij6158 & -cij(ity,jty)/rij6 159 159 else 160 cFor hydrogen bonding use 10-12 Lennard-Jones potential160 ! For hydrogen bonding use 10-12 Lennard-Jones potential 161 161 teyhb=teyhb+ahb(ity,jty)/(rij6*rij6) 162 #-chb(ity,jty)/(rij6*rij4)162 & -chb(ity,jty)/(rij6*rij4) 163 163 endif 164 164 … … 166 166 enddo 167 167 168 cLoop over 1-4 interaction partners169 cThe interactions between atoms that are three bonds apart in the protein are170 cdominated by quantum mechanical effects. They are treated separately.168 ! Loop over 1-4 interaction partners 169 ! The interactions between atoms that are three bonds apart in the protein are 170 ! dominated by quantum mechanical effects. They are treated separately. 171 171 do i14=i14at1(i),i14at2(i) 172 172 loopcounter = loopcounter + 1 … … 182 182 rij6=rij4*rij2 183 183 rij = sqrt(rij2) 184 cAre we using a distance dependent dielectric constant?184 ! Are we using a distance dependent dielectric constant? 185 185 if(epsd) then 186 186 sr=slp*rij … … 191 191 192 192 teyel=teyel+cqi*cgat(j)/(rij*ep) 193 cIf hydrogen bonding is not possible use 6-12 Lennard-Jones potential.193 ! If hydrogen bonding is not possible use 6-12 Lennard-Jones potential. 194 194 if (ihbty(ity,jty).eq.0) then 195 195 teyvw=teyvw+a14(ity,jty)/(rij6*rij6) 196 #-cij(ity,jty)/rij6196 & -cij(ity,jty)/rij6 197 197 else 198 cUse 10-12 Lennard-Jones potential for hydrogen bonds.198 ! Use 10-12 Lennard-Jones potential for hydrogen bonds. 199 199 teyhb=teyhb+ahb(ity,jty)/(rij6*rij6) 200 #-chb(ity,jty)/(rij6*rij4)200 & -chb(ity,jty)/(rij6*rij4) 201 201 endif 202 202 enddo ! ... 1-4-partners of i … … 209 209 endwtime = MPI_Wtime() 210 210 211 cCollect energies from all nodes and sum them up211 ! Collect energies from all nodes and sum them up 212 212 call MPI_ALLREDUCE(teysm, eysmsum, 1, MPI_DOUBLE_PRECISION, 213 213 & MPI_SUM, my_mpi_comm, ierror) -
enysol.f
r2ebb8b6 rbd2278d 1 c**************************************************************2 c 3 cThis file contains the subroutines: enysol,tessel4 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: enysol,tessel 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 … … 14 14 15 15 include 'INCL.H' 16 c--------------------------------------------------------------17 c 18 cDouble Cubic Lattice algorithm for calculating the19 csolvation energy of proteins using20 csolvent accessible area method.21 c 22 cif nmol == 0 do solvation energy over all residues.23 cCALLS: nursat24 c 25 c-------------------------------------------------------------26 cTODO: Check the solvent energy for multiple molecules16 ! -------------------------------------------------------------- 17 ! 18 ! Double Cubic Lattice algorithm for calculating the 19 ! solvation energy of proteins using 20 ! solvent accessible area method. 21 ! 22 ! if nmol == 0 do solvation energy over all residues. 23 ! CALLS: nursat 24 ! 25 ! ------------------------------------------------------------- 26 ! TODO: Check the solvent energy for multiple molecules 27 27 dimension numbox(mxat),inbox(mxbox+1),indsort(mxat),look(mxat) 28 28 dimension xyz(mxinbox,3),radb(mxinbox),radb2(mxinbox) … … 95 95 diamax=2.d0*rmax 96 96 97 cThe sizes of the big box97 ! The sizes of the big box 98 98 99 99 sizex=xmax-xmin … … 101 101 sizez=zmax-zmin 102 102 103 cHow many maximal diameters in each size ?103 ! How many maximal diameters in each size ? 104 104 105 105 ndx=sizex/diamax + 1 … … 107 107 ndz=sizez/diamax + 1 108 108 109 cWe may need the number of quadratic boxes in (X,Y) plane109 ! We may need the number of quadratic boxes in (X,Y) plane 110 110 111 111 nqxy=ndx*ndy 112 112 113 cThe number of cubic boxes of the size "diamax"113 ! The number of cubic boxes of the size "diamax" 114 114 115 115 ncbox=nqxy*ndz … … 119 119 end if 120 120 121 cLet us shift the borders to home all boxes121 ! Let us shift the borders to home all boxes 122 122 123 123 shiftx=(dble(ndx)*diamax-sizex)/2.d0 … … 131 131 zmax=zmax+shiftz 132 132 133 cFinding the box of each atom133 ! Finding the box of each atom 134 134 135 135 do j=nlow,nup … … 153 153 end do 154 154 155 cSummation over the boxes155 ! Summation over the boxes 156 156 157 157 do i=1,ncbox … … 160 160 161 161 162 cSorting the atoms by the their box numbers162 ! Sorting the atoms by the their box numbers 163 163 164 164 do i=nlow,nup … … 169 169 end do 170 170 171 cGetting started171 ! Getting started 172 172 173 173 do iz=0,ndz-1 ! Over the boxes along Z-axis … … 177 177 ibox=ix+iy*ndx+iz*nqxy + 1 178 178 179 cDoes this box contain atoms ?179 ! Does this box contain atoms ? 180 180 181 181 lbn=inbox(ibox+1)-inbox(ibox) … … 189 189 nez=min(iz+1,ndz-1) 190 190 191 cAtoms in the boxes around191 ! Atoms in the boxes around 192 192 193 193 jcnt=1 … … 221 221 dr=1.0d0+akrad 222 222 dr=dr*dr 223 cc if contact223 !c if contact 224 224 if(dd.le.dr) then 225 225 nnei=nnei+1 … … 232 232 end if 233 233 end do 234 cc234 !c 235 235 do il=1,npnt 236 236 surfc(il)=.false. 237 237 end do 238 238 239 cCheck overlap239 ! Check overlap 240 240 241 241 lst=1 … … 279 279 area = sdr*dble(icount) 280 280 volume = sdr/3.0d0*(trad*dble(icount) 281 #+(xat(jbi)-avr_x)*dx282 #+(yat(jbi)-avr_y)*dy283 #+(zat(jbi)-avr_z)*dz)281 & +(xat(jbi)-avr_x)*dx 282 & +(yat(jbi)-avr_y)*dy 283 & +(zat(jbi)-avr_z)*dz) 284 284 285 285 asa=asa+area 286 286 vdvol=vdvol+volume 287 287 eysl=eysl+area*sigma(jbi) 288 cSeparate hydrophilic (h) and hyrdophobic (p) contributions to eysl288 ! Separate hydrophilic (h) and hyrdophobic (p) contributions to eysl 289 289 if (sigma(jbi).lt.0) then 290 290 eyslp = eyslp + area * sigma(jbi) … … 295 295 asah = asah + area 296 296 endif 297 cMeasure how much a residue is solvent accessible:297 ! Measure how much a residue is solvent accessible: 298 298 jres = nursat(jbi) 299 299 surfres(jres) = surfres(jres) + area … … 305 305 end do 306 306 307 c 307 ! 308 308 if (isolscl) then 309 309 nhx=0 … … 319 319 return 320 320 end 321 c*********************321 ! ********************* 322 322 subroutine tessel 323 323 include 'INCL.H' 324 324 character lin*80 325 325 326 c Skipping comment lines, which begin with '!' 327 326 ! Skipping comment lines, which begin with '!' 328 327 read(20,'(a)') lin 329 328 do while(lin(1:1).eq.'!') … … 331 330 end do 332 331 333 cThe first non-comment line is the number of the surface points332 ! The first non-comment line is the number of the surface points 334 333 335 334 read(lin(1:5),'(i5)') npnt 336 cwrite(*,'(a,i5)') 'the number of points---->',npnt337 338 cRead the surface points335 ! write(*,'(a,i5)') 'the number of points---->',npnt 336 337 ! Read the surface points 339 338 340 339 do i=1,npnt 341 340 read(20,'(3f20.10)') spoint(i,1),spoint(i,2),spoint(i,3) 342 343 c write(31,'(3f20.10)') spoint(i,1),spoint(i,2),spoint(i,3) 341 ! write(31,'(3f20.10)') spoint(i,1),spoint(i,2),spoint(i,3) 344 342 end do 345 343 -
enysol_p.f
r2ebb8b6 rbd2278d 1 c**************************************************************2 c 3 cThis file contains the subroutines: enysol,tessel4 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: enysol,tessel 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 … … 16 16 include 'mpif.h' 17 17 18 c--------------------------------------------------------------19 c 20 cDouble Cubic Lattice algorithm for calculating the21 csolvation energy of proteins using22 csolvent accessible area method.23 c 24 cif nmol == 0 do solvation energy over all residues.25 cCALLS: nursat26 c 27 c-------------------------------------------------------------28 cTODO: Check the solvent energy for multiple molecules18 ! -------------------------------------------------------------- 19 ! 20 ! Double Cubic Lattice algorithm for calculating the 21 ! solvation energy of proteins using 22 ! solvent accessible area method. 23 ! 24 ! if nmol == 0 do solvation energy over all residues. 25 ! CALLS: nursat 26 ! 27 ! ------------------------------------------------------------- 28 ! TODO: Check the solvent energy for multiple molecules 29 29 dimension numbox(mxat),inbox(mxbox+1),indsort(mxat),look(mxat) 30 30 dimension xyz(mxinbox,3),radb(mxinbox),radb2(mxinbox) … … 101 101 diamax=2.d0*rmax 102 102 103 cThe sizes of the big box103 ! The sizes of the big box 104 104 105 105 sizex=xmax-xmin … … 107 107 sizez=zmax-zmin 108 108 109 cHow many maximal diameters in each size ?109 ! How many maximal diameters in each size ? 110 110 111 111 ndx=sizex/diamax + 1 … … 113 113 ndz=sizez/diamax + 1 114 114 115 cWe may need the number of quadratic boxes in (X,Y) plane115 ! We may need the number of quadratic boxes in (X,Y) plane 116 116 117 117 nqxy=ndx*ndy 118 118 119 cThe number of cubic boxes of the size "diamax"119 ! The number of cubic boxes of the size "diamax" 120 120 121 121 ncbox=nqxy*ndz … … 125 125 end if 126 126 127 cLet us shift the borders to home all boxes127 ! Let us shift the borders to home all boxes 128 128 129 129 shiftx=(dble(ndx)*diamax-sizex)/2.d0 … … 137 137 zmax=zmax+shiftz 138 138 139 cFinding the box of each atom139 ! Finding the box of each atom 140 140 141 141 do j=nlow,nup … … 159 159 end do 160 160 161 cSummation over the boxes161 ! Summation over the boxes 162 162 163 163 do i=1,ncbox … … 166 166 167 167 168 cSorting the atoms by the their box numbers168 ! Sorting the atoms by the their box numbers 169 169 170 170 do i=nlow,nup … … 175 175 end do 176 176 177 cGetting started178 cWe have to loop over ncbox boxes and have no processors available177 ! Getting started 178 ! We have to loop over ncbox boxes and have no processors available 179 179 boxpp = 1.0 * ncbox / no 180 180 iboxmin = boxpp * myrank … … 191 191 ! ibox=ix+iy*ndx+iz*nqxy + 1 192 192 193 cDoes this box contain atoms ?193 ! Does this box contain atoms ? 194 194 195 195 lbn=inbox(ibox+1)-inbox(ibox) … … 203 203 nez=min(iz+1,ndz-1) 204 204 205 cAtoms in the boxes around205 ! Atoms in the boxes around 206 206 207 207 jcnt=1 … … 235 235 dr=1.0d0+akrad 236 236 dr=dr*dr 237 cc if contact237 !c if contact 238 238 if(dd.le.dr) then 239 239 nnei=nnei+1 … … 246 246 end if 247 247 end do 248 cc248 !c 249 249 do il=1,npnt 250 250 surfc(il)=.false. 251 251 end do 252 252 253 cCheck overlap253 ! Check overlap 254 254 255 255 lst=1 … … 293 293 area = sdr*dble(icount) 294 294 volume = sdr/3.0d0*(trad*dble(icount) 295 #+(xat(jbi)-avr_x)*dx296 #+(yat(jbi)-avr_y)*dy297 #+(zat(jbi)-avr_z)*dz)295 & +(xat(jbi)-avr_x)*dx 296 & +(yat(jbi)-avr_y)*dy 297 & +(zat(jbi)-avr_z)*dz) 298 298 299 299 asa=asa+area 300 300 vdvol=vdvol+volume 301 301 eysl=eysl+area*sigma(jbi) 302 cSeparate hydrophilic (h) and hyrdophobic (p) contributions to eysl302 ! Separate hydrophilic (h) and hyrdophobic (p) contributions to eysl 303 303 if (sigma(jbi).lt.0) then 304 304 eyslp = eyslp + area * sigma(jbi) … … 309 309 asah = asah + area 310 310 endif 311 cMeasure how much a residue is solvent accessible:311 ! Measure how much a residue is solvent accessible: 312 312 jres = nursat(jbi) 313 313 surfres(jres) = surfres(jres) + area … … 332 332 & endwtime - startwtime, "s" 333 333 endif 334 c 334 ! 335 335 if (isolscl) then 336 336 nhx=0 … … 346 346 return 347 347 end 348 c*********************348 ! ********************* 349 349 subroutine tessel 350 350 include 'INCL.H' 351 351 character lin*80 352 352 353 cSkipping comment lines, which begin with '!'353 ! Skipping comment lines, which begin with '!' 354 354 355 355 read(20,'(a)') lin … … 358 358 end do 359 359 360 cThe first non-comment line is the number of the surface points360 ! The first non-comment line is the number of the surface points 361 361 362 362 read(lin(1:5),'(i5)') npnt 363 cwrite(*,'(a,i5)') 'the number of points---->',npnt364 365 cRead the surface points363 ! write(*,'(a,i5)') 'the number of points---->',npnt 364 365 ! Read the surface points 366 366 367 367 do i=1,npnt 368 368 read(20,'(3f20.10)') spoint(i,1),spoint(i,2),spoint(i,3) 369 369 370 cwrite(31,'(3f20.10)') spoint(i,1),spoint(i,2),spoint(i,3)370 ! write(31,'(3f20.10)') spoint(i,1),spoint(i,2),spoint(i,3) 371 371 end do 372 372 -
esolan.f
r2ebb8b6 rbd2278d 48 48 49 49 dimension neib(0:mxat),vertex(ks0,4),ax(ks0,2), 50 1pol(mxat),neibp(0:mxat),as(mxat),ayx(ks0,2),51 2ayx1(ks0),probe(ks0),dd(mxat),ddat(mxat,4),ivrx(ks0)50 & pol(mxat),neibp(0:mxat),as(mxat),ayx(ks0,2), 51 & ayx1(ks0),probe(ks0),dd(mxat),ddat(mxat,4),ivrx(ks0) 52 52 53 53 dimension grad(mxat,mxat,3),dadx(4,3),gp(4),dalp(4),dbet(4), 54 1daalp(4),dabet(4),vrx(ks0,4),dv(4),dx(4),dy(4),dz(4),dt(4),55 2di(4),dii(4,3),ss(mxat),dta(4),dtb(4),di1(4),di2(4),gs(3)54 & daalp(4),dabet(4),vrx(ks0,4),dv(4),dx(4),dy(4),dz(4),dt(4), 55 & di(4),dii(4,3),ss(mxat),dta(4),dtb(4),di1(4),di2(4),gs(3) 56 56 dimension xold(-1:mxat),yold(-1:mxat),zold(-1:mxat) 57 57 integer ta2(0:mxat),ta3(0:mxat),fullarc(0:mxat),al(0:ks2) -
eyabgn.f
r2ebb8b6 rbd2278d 1 c*********************************************************************2 cThis file contains eyrccr, init_abgn, eyentr, eyabgn3 c 4 cCopyright 2007 Frank Eisenmenger, U.H.E. Hansmann,5 cJan H. Meinke, Sandipan Mohanty6 c 7 cCorrections to ECEPP energy terms due to R. A. Abagyan et al.8 c9 cTwo terms are calculated: eyrccr and eyentr, representing respectively10 cc a term to slightly shift the backbone dihedral angle preferences in11 cthe ECEPP potential slightly away from the helix region, and another12 cterm to estimate the side-chain entropy from a given configuration.13 c 14 c 15 c*********************************************************************1 ! ********************************************************************* 2 ! This file contains eyrccr, init_abgn, eyentr, eyabgn 3 ! 4 ! Copyright 2007 Frank Eisenmenger, U.H.E. Hansmann, 5 ! Jan H. Meinke, Sandipan Mohanty 6 ! 7 ! Corrections to ECEPP energy terms due to R. A. Abagyan et al. 8 ! 9 ! Two terms are calculated: eyrccr and eyentr, representing respectively 10 ! c a term to slightly shift the backbone dihedral angle preferences in 11 ! the ECEPP potential slightly away from the helix region, and another 12 ! term to estimate the side-chain entropy from a given configuration. 13 ! 14 ! 15 ! ********************************************************************* 16 16 real*8 function eyrccr(nml) 17 17 include 'INCL.H' … … 29 29 endif 30 30 et=0.0 31 cprint *,'***********'31 ! print *,'***********' 32 32 do i=istres,indres 33 33 mynm=seq(i) 34 34 call tolost(mynm) 35 35 if ((mynm.eq.'val').or.(mynm.eq.'ile').or. 36 #(mynm.eq.'thr')) then36 & (mynm.eq.'thr')) then 37 37 rsscl=1.0 38 38 else … … 40 40 endif 41 41 et=et+rsscl*(1.0-sin(vlvr(ipsi(i)))) 42 cprint *,' contribution = ',rsscl*(1.0-sin(vlvr(ipsi(i))))43 cprint *,'obtained using scale ',rsscl,' and angle ',44 c# vlvr(ipsi(i))42 ! print *,' contribution = ',rsscl*(1.0-sin(vlvr(ipsi(i)))) 43 ! print *,'obtained using scale ',rsscl,' and angle ', 44 ! # vlvr(ipsi(i)) 45 45 enddo 46 cprint *,'abagyan dihedral term = ',et47 cprint *,'***********'46 ! print *,'abagyan dihedral term = ',et 47 ! print *,'***********' 48 48 eyrccr=et 49 49 return … … 56 56 dimension xarea(nrsty),estrg(nrsty) 57 57 character mynm*4 58 cprint *,'Initialization of Abagyan entropic term'59 cMaximum accessible surface areas for different residue types58 ! print *,'Initialization of Abagyan entropic term' 59 ! Maximum accessible surface areas for different residue types 60 60 data (xarea(i),i=1,nrsty)/ 61 c1 2 3 4 562 #117.417 , 244.686 , 245.582 , 146.467 , 144.485 ,63 c6 7 8 9 1064 #144.192 , 142.805 , 147.568 , 183.103 , 177.094 ,65 c11 12 13 14 1566 #186.293 , 83.782 , 187.864 , 187.864 , 187.864 ,67 c16 17 18 19 2068 #187.864 , 160.887 , 161.741 , 184.644 , 179.334 ,69 c21 22 23 24 2570 #209.276 , 209.276 , 203.148 , 208.902 , 153.124 ,71 c26 27 28 29 3072 #153.973 , 153.037 , 158.695 , 157.504 , 157.504 ,73 c31 32 33 34 3574 #119.786 , 146.488 , 238.641 , 223.299 , 160.283 /75 cEntropic contribution for maximally exposed residue61 ! 1 2 3 4 5 62 & 117.417 , 244.686 , 245.582 , 146.467 , 144.485 , 63 ! 6 7 8 9 10 64 & 144.192 , 142.805 , 147.568 , 183.103 , 177.094 , 65 ! 11 12 13 14 15 66 & 186.293 , 83.782 , 187.864 , 187.864 , 187.864 , 67 ! 16 17 18 19 20 68 & 187.864 , 160.887 , 161.741 , 184.644 , 179.334 , 69 ! 21 22 23 24 25 70 & 209.276 , 209.276 , 203.148 , 208.902 , 153.124 , 71 ! 26 27 28 29 30 72 & 153.973 , 153.037 , 158.695 , 157.504 , 157.504 , 73 ! 31 32 33 34 35 74 & 119.786 , 146.488 , 238.641 , 223.299 , 160.283 / 75 ! Entropic contribution for maximally exposed residue 76 76 data (estrg(i),i=1,nrsty)/ 77 c1ala 2arg 3arg+ 4asn 5asp78 #0.0 , 2.13 , 2.13 , 0.81 , 0.61 ,79 c6asp- 7cys 8cyss 9gln 10glu80 #0.61 , 1.14 , 1.14 , 2.02 , 1.65 ,81 c11glu- 12gly 13his 14hise 15hisd82 #1.65 , 0.0 , 0.99 , 0.99 , 0.99 ,83 c16his+ 17hyp 18hypu 19ile 20leu84 #0.99 , 0.99 , 0.99 , 0.75 , 0.75 ,85 c21lys 22lys+ 23met 24phe 25cpro86 #2.21 , 2.21 , 1.53 , 0.58 , 0.0 ,87 c26pro 27cpru 28prou 29pron 30pro+88 #0.0 , 0.0 , 0.0 , 0.0 , 0.0 ,89 c31ser 32thr 33trp 34tyr 35val90 #1.19 , 1.12 , 0.97 , 0.99 , 0.50 /77 ! 1ala 2arg 3arg+ 4asn 5asp 78 & 0.0 , 2.13 , 2.13 , 0.81 , 0.61 , 79 ! 6asp- 7cys 8cyss 9gln 10glu 80 & 0.61 , 1.14 , 1.14 , 2.02 , 1.65 , 81 ! 11glu- 12gly 13his 14hise 15hisd 82 & 1.65 , 0.0 , 0.99 , 0.99 , 0.99 , 83 ! 16his+ 17hyp 18hypu 19ile 20leu 84 & 0.99 , 0.99 , 0.99 , 0.75 , 0.75 , 85 ! 21lys 22lys+ 23met 24phe 25cpro 86 & 2.21 , 2.21 , 1.53 , 0.58 , 0.0 , 87 ! 26pro 27cpru 28prou 29pron 30pro+ 88 & 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 89 ! 31ser 32thr 33trp 34tyr 35val 90 & 1.19 , 1.12 , 0.97 , 0.99 , 0.50 / 91 91 do i=1,mxrs 92 92 rsstrg(i)=0.0 … … 100 100 do j=1,nrsty 101 101 if (rsnmcd(j).eq.mynm) imytyp=j 102 cprint *,'comparing ',mynm,' with ',rsnmcd(j),imytyp102 ! print *,'comparing ',mynm,' with ',rsnmcd(j),imytyp 103 103 enddo 104 104 if (imytyp.eq.0) then … … 109 109 rsstrg(i)=estrg(imytyp)/xarea(imytyp) 110 110 endif 111 cprint *,'residue ',i,seq(i),' type ',imytyp112 cprint *, 'strength for residue ',i,seq(i),' is ',rsstrg(i)111 ! print *,'residue ',i,seq(i),' type ',imytyp 112 ! print *, 'strength for residue ',i,seq(i),' is ',rsstrg(i) 113 113 enddo 114 114 print *, 'initialized Abagyan corrections to ECEPP force field' … … 129 129 indres=irsml2(nml) 130 130 endif 131 cprint *,'residue range ',istres,indres132 cprint *,'for molecule ',nml131 ! print *,'residue range ',istres,indres 132 ! print *,'for molecule ',nml 133 133 do i=istres, indres 134 134 aars=surfres(i) 135 135 strh=rsstrg(i) 136 cThe maximal burial entropies were estimated at temperature 300k137 cThe values in the array estrg are k_B * T (=300k) * Entropy138 cPresently we need it at temperature 1/beta, so we need to139 cmultiply the strengths in estrg with (1/beta)/(300 kelvin)140 c300 kelvin is approximately 0.59576607 kcal/mol.136 ! The maximal burial entropies were estimated at temperature 300k 137 ! The values in the array estrg are k_B * T (=300k) * Entropy 138 ! Presently we need it at temperature 1/beta, so we need to 139 ! multiply the strengths in estrg with (1/beta)/(300 kelvin) 140 ! 300 kelvin is approximately 0.59576607 kcal/mol. 141 141 eentr=eentr+aars*strh/(0.59576607*beta) 142 cprint *,'contribution = ',aars*strh/(0.59576607*beta)143 cprint *,'residue, exposed area = ',i,aars144 cprint *,'strength = ',strh,' for residue index = ',i145 cprint *,'beta = ',beta142 ! print *,'contribution = ',aars*strh/(0.59576607*beta) 143 ! print *,'residue, exposed area = ',i,aars 144 ! print *,'strength = ',strh,' for residue index = ',i 145 ! print *,'beta = ',beta 146 146 enddo 147 cprint *,'abagyan entropic term = ',eentr147 ! print *,'abagyan entropic term = ',eentr 148 148 eyentr=eentr 149 149 return … … 153 153 include 'INCL.H' 154 154 eyabgn=eyrccr(nml)+eyentr(nml) 155 cprint *,'Abagyan term = ',eyabgn155 ! print *,'Abagyan term = ',eyabgn 156 156 return 157 157 end -
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 -
gradient.f
r2ebb8b6 rbd2278d 1 C**************************************************************2 c 3 cThis file contains the subroutines: gradient4 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: gradient 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 gradient() 14 14 15 c-------------------------------------------16 cPURPOSE: calculate energy & gradients17 c 18 cCALLS: opeflx,opereg,opeshe,opesol,setvar19 c-------------------------------------------15 ! ------------------------------------------- 16 ! PURPOSE: calculate energy & gradients 17 ! 18 ! CALLS: opeflx,opereg,opeshe,opesol,setvar 19 ! ------------------------------------------- 20 20 21 21 include 'INCL.H' -
hbond.f
r2ebb8b6 rbd2278d 1 c**************************************************************2 c 3 cThis file contains the subroutines: hbond,chhb,ishybd,4 cishybdo,nursat,interhbond5 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 ! This file contains the subroutines: hbond,chhb,ishybd, 4 ! ishybdo,nursat,interhbond 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 hbond(nml,mhb,ipr) 15 c.................................................................16 cPURPOSE: find hydrogen bonds in molecule 'nml'17 c 18 cprints HBonds, if ipr > 019 c 20 cOUTPUT: mhb - number of hyd.bds. of type i->i+421 c22 cto INCL.H:23 c 24 cntyhb - number of different types of hyd. bds. found25 cnutyhb - number of hyd.bds. found for each type26 cixtyhb - index for each type of hyd. bd. composed as27 c(atom idx. of H) * 1000 + atm.idx. of acceptor28 c 29 cCALLS: chhb,ishybd (ishybdo),nursat30 C 31 c................................................................32 33 include 'INCL.H' 34 35 cf2py intent(out) mhb15 ! ................................................................. 16 ! PURPOSE: find hydrogen bonds in molecule 'nml' 17 ! 18 ! prints HBonds, if ipr > 0 19 ! 20 ! OUTPUT: mhb - number of hyd.bds. of type i->i+4 21 ! 22 ! to INCL.H: 23 ! 24 ! ntyhb - number of different types of hyd. bds. found 25 ! nutyhb - number of hyd.bds. found for each type 26 ! ixtyhb - index for each type of hyd. bd. composed as 27 ! (atom idx. of H) * 1000 + atm.idx. of acceptor 28 ! 29 ! CALLS: chhb,ishybd (ishybdo),nursat 30 ! 31 !................................................................ 32 33 include 'INCL.H' 34 35 !f2py intent(out) mhb 36 36 parameter (atbase=mxat) 37 37 logical ishb … … 50 50 if (ntlvr.eq.0) then 51 51 write (*,'(a,i4)') 52 #' hbond> No variables defined in molecule #',nml52 & ' hbond> No variables defined in molecule #',nml 53 53 return 54 54 endif 55 55 56 56 ifivr=ivrml1(nml) 57 cIndex of last moving set57 ! Index of last moving set 58 58 i1s=imsml1(nml)+nmsml(nml) 59 59 endif 60 cLoop over all variables60 ! Loop over all variables 61 61 do io=ifivr+ntlvr-1,ifivr,-1 62 cGet index of variable62 ! Get index of variable 63 63 iv=iorvr(io) 64 cIndex of next to last moving set64 ! Index of next to last moving set 65 65 i2s=i1s-1 66 cIndex of moving set belonging to iv66 ! Index of moving set belonging to iv 67 67 i1s=imsvr1(iv) 68 cLoop over all moving sets between the one belonging to iv and the69 cnext to last one68 ! Loop over all moving sets between the one belonging to iv and the 69 ! next to last one 70 70 do ims=i1s,i2s 71 cFirst atom in moving set71 ! First atom in moving set 72 72 i1=latms1(ims) 73 cLast atom in moving set73 ! Last atom in moving set 74 74 i2=latms2(ims) 75 cLoop over all atoms in moving set.75 ! Loop over all atoms in moving set. 76 76 do i=i1,i2 77 cLoop over van der Waals domains of atom i77 ! Loop over van der Waals domains of atom i 78 78 do ivw=ivwat1(i),ivwat2(i) 79 cLoop over atoms in van der Waals domain.79 ! Loop over atoms in van der Waals domain. 80 80 do j=lvwat1(ivw),lvwat2(ivw) 81 81 … … 111 111 112 112 call ishybd(i,j,ishb,ih,ia) ! Thornton criteria 113 ccall ishybdo(i,j,ishb,ih,ia)113 ! call ishybdo(i,j,ishb,ih,ia) 114 114 115 115 if (ishb) then … … 144 144 mhb=0 145 145 146 cdo inhb=1,ntyhb147 cmhb = mhb+nutyhb(inhb)148 cenddo146 ! do inhb=1,ntyhb 147 ! mhb = mhb+nutyhb(inhb) 148 ! enddo 149 149 150 150 if (ipr.gt.0) write(*,'(1x,a,/)') ' hbond> Hydrogen Bonds:' … … 173 173 if (n.gt.0) then 174 174 write(*,'(1x,i3,a2,a4,a3,i3,1x,a4,a7,a4,a3,i3,1x,a4,a9, 175 #i2)')176 #ii,') ',nmat(ia),' ( ',na,seq(na),' ) <-- ',nmat(id),177 #' ( ', nd,seq(nd),' ) = i +',n175 & i2)') 176 & ii,') ',nmat(ia),' ( ',na,seq(na),' ) <-- ',nmat(id), 177 & ' ( ', nd,seq(nd),' ) = i +',n 178 178 else 179 179 write(*,'(1x,i3,a2,a4,a3,i3,1x,a4,a7,a4,a3,i3,1x,a4,a9, 180 #i2)')181 #ii,') ',nmat(ia),' ( ',na,seq(na),' ) <-- ',nmat(id),182 #' ( ', nd,seq(nd),' ) = i -',abs(n)180 & i2)') 181 & ii,') ',nmat(ia),' ( ',na,seq(na),' ) <-- ',nmat(id), 182 & ' ( ', nd,seq(nd),' ) = i -',abs(n) 183 183 endif 184 184 … … 192 192 return 193 193 end 194 c.....................................................................195 cCalculates hydrogen bonds between different chains.196 c197 c@return number of intermolecular hydrogen bonds. Returns 0 if only198 cone molecule is present. The value is returned in the199 cvariable mhb.200 c 201 c@author Jan H. Meinke <j.meinke@fz-juelich.de>202 c203 c.....................................................................194 ! ..................................................................... 195 ! Calculates hydrogen bonds between different chains. 196 ! 197 ! @return number of intermolecular hydrogen bonds. Returns 0 if only 198 ! one molecule is present. The value is returned in the 199 ! variable mhb. 200 ! 201 ! @author Jan H. Meinke <j.meinke@fz-juelich.de> 202 ! 203 ! ..................................................................... 204 204 subroutine interhbond(mhb) 205 205 206 206 include 'INCL.H' 207 207 208 cf2py intent(out) mhb208 !f2py intent(out) mhb 209 209 210 210 logical ishb … … 233 233 234 234 end ! subroutine interhbond 235 c************************235 ! ************************ 236 236 subroutine chhb(i,j) 237 237 … … 249 249 250 250 dah=sqrt((xat(ih)-xat(ia))**2+(yat(ih)-yat(ia))**2+ 251 #(zat(ih)-zat(ia))**2)251 & (zat(ih)-zat(ia))**2) 252 252 253 253 id=iowat(ih) 254 254 255 255 dad=sqrt((xat(id)-xat(ia))**2+(yat(id)-yat(ia))**2+ 256 #(zat(id)-zat(ia))**2)256 & (zat(id)-zat(ia))**2) 257 257 adha=valang(id,ih,ia)*crd 258 258 … … 269 269 return 270 270 end 271 c*************************************271 ! ************************************* 272 272 subroutine ishybd(i,j,ishb,ih,ia) 273 273 274 274 275 c..........................................................276 cPURPOSE: checks for hydrogen bond between atoms 'i' & 'j'277 caccording to geometric criteria278 c279 cOUTPUT: logical 'ishb' - true, if have Hydrogen bond280 cih - index of Hydrogen atom281 cia - index of Acceptor atom282 c 283 c[I.K.McDonald,J.M.Thornton,Satisfying hydrogen bond284 cpotential in proteins.J.Mol.Biol.238(5),777-793 (1994)]285 c 286 cD: hydrogen(=H) donor, A: acceptor, B: atom bound to A287 c 288 cDis_HA <= 2.5 & Dis_DA <= 3.9 & Angle(D-H-A) > 90 &289 cAngle(H-A-B) > 90 & Angle(D-A-B) > 90290 c..........................................................275 ! .......................................................... 276 ! PURPOSE: checks for hydrogen bond between atoms 'i' & 'j' 277 ! according to geometric criteria 278 ! 279 ! OUTPUT: logical 'ishb' - true, if have Hydrogen bond 280 ! ih - index of Hydrogen atom 281 ! ia - index of Acceptor atom 282 ! 283 ! [I.K.McDonald,J.M.Thornton,Satisfying hydrogen bond 284 ! potential in proteins.J.Mol.Biol.238(5),777-793 (1994)] 285 ! 286 ! D: hydrogen(=H) donor, A: acceptor, B: atom bound to A 287 ! 288 ! Dis_HA <= 2.5 & Dis_DA <= 3.9 & Angle(D-H-A) > 90 & 289 ! Angle(H-A-B) > 90 & Angle(D-A-B) > 90 290 ! .......................................................... 291 291 292 292 include 'INCL.H' 293 293 294 294 parameter (cdad=3.9d0, 295 #cdah=2.5d0,296 #cang=110.d0)297 c# cang=90.d0)295 & cdah=2.5d0, 296 & cang=110.d0) 297 ! # cang=90.d0) 298 298 299 299 logical ishb … … 318 318 319 319 if (sqrt((xat(ih)-xat(ia))**2+(yat(ih)-yat(ia))**2+ 320 #(zat(ih)-zat(ia))**2).gt.cdah) return320 & (zat(ih)-zat(ia))**2).gt.cdah) return 321 321 322 322 id=iowat(ih) 323 323 324 324 if (id.le.0.or.sqrt((xat(id)-xat(ia))**2+(yat(id)-yat(ia))**2+ 325 #(zat(id)-zat(ia))**2).gt.cdad326 #.or.valang(id,ih,ia).lt.cahb) return325 & (zat(id)-zat(ia))**2).gt.cdad 326 & .or.valang(id,ih,ia).lt.cahb) return 327 327 328 328 ib=iowat(ia) 329 329 330 330 if (ib.gt.0.and.valang(ih,ia,ib).ge.cahb 331 #.and.valang(id,ia,ib).ge.cahb) ishb=.true.331 & .and.valang(id,ia,ib).ge.cahb) ishb=.true. 332 332 333 333 return 334 334 end 335 c**************************************335 ! ************************************** 336 336 337 337 subroutine ishybdo(i,j,ishb,ih,ia) 338 338 339 c..........................................................340 cPURPOSE: checks for hydrogen bond between atoms 'i' & 'j'341 caccording to geometric criteria342 c343 cOUTPUT: logical 'ishb' - true, if have Hydrogen bond344 cih - index of Hydrogen atom345 cia - index of Acceptor atom346 c 347 cD: hydrogen(=H) donor, A: acceptor348 c 349 cDis_AH <= 2.5 & Angle(D-H-A) >= 160350 c...........................................................339 ! .......................................................... 340 ! PURPOSE: checks for hydrogen bond between atoms 'i' & 'j' 341 ! according to geometric criteria 342 ! 343 ! OUTPUT: logical 'ishb' - true, if have Hydrogen bond 344 ! ih - index of Hydrogen atom 345 ! ia - index of Acceptor atom 346 ! 347 ! D: hydrogen(=H) donor, A: acceptor 348 ! 349 ! Dis_AH <= 2.5 & Angle(D-H-A) >= 160 350 ! ........................................................... 351 351 352 352 include 'INCL.H' 353 353 354 354 parameter (cdah=2.5d0, 355 #cang=140.d0)355 & cang=140.d0) 356 356 357 357 logical ishb … … 377 377 378 378 if (sqrt((xat(ih)-xat(ia))**2+(yat(ih)-yat(ia))**2+ 379 #(zat(ih)-zat(ia))**2).gt.cdah) return379 & (zat(ih)-zat(ia))**2).gt.cdah) return 380 380 381 381 id=iowat(ih) -
helix.f
r2ebb8b6 rbd2278d 1 c**************************************************************2 c 3 cThis file contains the subroutines: helix4 c 5 cCopyright 2003 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: helix 4 ! 5 ! Copyright 2003 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 helix(nhel,mhel,nbet,mbet) 14 c---------------------------------------------------------------15 c 16 cPURPOSE: simple identification of secondary structure content17 c 18 cCALLS: none19 c 20 c---------------------------------------------------------------14 !--------------------------------------------------------------- 15 ! 16 ! PURPOSE: simple identification of secondary structure content 17 ! 18 ! CALLS: none 19 ! 20 ! --------------------------------------------------------------- 21 21 include 'INCL.H' 22 22 23 cf2py intent(out) nhel24 cf2py intent(out) mhel25 cf2py intent(out) nbet26 cf2py intent(out) mbet23 !f2py intent(out) nhel 24 !f2py intent(out) mhel 25 !f2py intent(out) nbet 26 !f2py intent(out) mbet 27 27 28 28 logical lhel,lbet … … 42 42 xphi = vlvr(iv)*crd 43 43 xpsi = vlvr(idvr(i+1))*crd 44 CHelicity44 ! Helicity 45 45 if(abs(xphi-philim).le.hlim) then 46 46 lbet=.false. … … 52 52 lhel = .false. 53 53 end if 54 CSheetness54 ! Sheetness 55 55 else if(abs(xphi-philim2).le.hlim2) then 56 56 lhel = .false. -
incl_lund.h
r2ebb8b6 rbd2278d 8 8 double precision alhb,blhb,sighb2,cdon,cacc,casc 9 9 10 c-----Probability for using BGS when it is possible10 ! -----Probability for using BGS when it is possible 11 11 double precision abgs,bbgs, dph(8) 12 12 integer bgsnvar,bgsvar(mxrs), iph(8) … … 32 32 33 33 common /lundff/kbias, 34 #epshb1,epshb2,powa,powb,sighb,cthb,35 #cthb2,36 #alhb,blhb,sighb2,cdon,cacc,casc,37 #ihpat,nhpat,hpstrg,38 #exvk,exvcut,exvcut2,39 #matcon,40 #sigsa,sig2lcp,asalcp,bsalcp,41 #lcp1,lcp2,ilpst,ilpnd,42 #exvlam,exvcutg,exvcutg2,43 #sig2exv,asaexv,bsaexv34 & epshb1,epshb2,powa,powb,sighb,cthb, 35 & cthb2, 36 & alhb,blhb,sighb2,cdon,cacc,casc, 37 & ihpat,nhpat,hpstrg, 38 & exvk,exvcut,exvcut2, 39 & matcon, 40 & sigsa,sig2lcp,asalcp,bsalcp, 41 & lcp1,lcp2,ilpst,ilpnd, 42 & exvlam,exvcutg,exvcutg2, 43 & sig2exv,asaexv,bsaexv 44 44 save /lundff/ -
init_energy.f
r2ebb8b6 rbd2278d 1 c**************************************************************2 c 3 cThis file contains the subroutines: init_energy,setpar4 CThis file contains a BLOCK DATA statement5 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 ! This file contains the subroutines: init_energy,setpar 4 ! This file contains a BLOCK DATA statement 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 init_energy(libdir) 15 15 16 c----------------------------------------------17 cPURPOSE: initialize energy parameters18 c0 => ECEPP2 or ECEPP3 depending on the value of sh219 c1 => FLEX20 c2 => Lund force field21 c3 => ECEPP with Abagyan corrections22 c 23 c 24 cCALLS: setpar, tessel,iendst25 c 26 ccontains: BLOCK DATA27 c----------------------------------------------16 ! ---------------------------------------------- 17 ! PURPOSE: initialize energy parameters 18 ! 0 => ECEPP2 or ECEPP3 depending on the value of sh2 19 ! 1 => FLEX 20 ! 2 => Lund force field 21 ! 3 => ECEPP with Abagyan corrections 22 ! 23 ! 24 ! CALLS: setpar, tessel,iendst 25 ! 26 ! contains: BLOCK DATA 27 ! ---------------------------------------------- 28 28 29 29 include 'INCL.H' … … 59 59 60 60 61 C----Initialize solvation part if necessary61 !----Initialize solvation part if necessary 62 62 write (*,*) 'init_energy: itysol = ',itysol 63 63 write(*,*) 'init_energy: esol_scaling = ',isolscl … … 69 69 ll=iendst(libdir) 70 70 tesfil = libdir(1:ll)//'tes.dat' 71 72 71 open(unit=20,file=tesfil,status='old',err=10) 73 74 72 call tessel() 75 76 73 close(20) 77 74 … … 85 82 endif 86 83 87 c___________________________ initialise COMMON 'con_r'84 ! ___________________________ initialise COMMON 'con_r' 88 85 idloa=ichar('a') 89 86 idloz=ichar('z') … … 98 95 end 99 96 100 c*********************97 ! ********************* 101 98 subroutine setpar 102 99 103 c__________________________________________________________104 cPURPOSE: initialize parameter set for empirical potentials105 cdepending on variable 'flex'106 c 107 cCALLS: None108 c__________________________________________________________100 ! __________________________________________________________ 101 ! PURPOSE: initialize parameter set for empirical potentials 102 ! depending on variable 'flex' 103 ! 104 ! CALLS: None 105 ! __________________________________________________________ 109 106 110 107 include 'INCL.H' … … 116 113 tesgrd = .false. ! numerical check of analytical gradients 117 114 118 c______________________________________ Lennard-Jones parameters115 ! ______________________________________ Lennard-Jones parameters 119 116 if (flex) then 120 117 … … 166 163 ai=atpl(i) 167 164 aei=sqrt(ai/efel(i)) 168 cc aic=ai/ehm !! ICM169 cc do j=i,mxtyat !! -"-165 !c aic=ai/ehm !! ICM 166 !c do j=i,mxtyat !! -"- 170 167 aic=ai*ehm !! comment for ICM: 171 168 cij(i,i)=aic*ai/(aei+aei) !! -"- … … 175 172 do j=i+1,mxtyat !! 176 173 aj=atpl(j) 177 c_______ Constant for 6-12 attractive term (Slater-Kirkwood formula)174 ! _______ Constant for 6-12 attractive term (Slater-Kirkwood formula) 178 175 c=aic*aj/(aei+sqrt(aj/efel(j))) 179 176 cij(i,j)=c 180 177 cij(j,i)=c 181 c____________________________ repulsive term (form. 3 & 6 of ref 2)178 ! ____________________________ repulsive term (form. 3 & 6 of ref 2) 182 179 rij=.5*(ri+rmin(j)) 183 180 a=.5*c*rij**6 … … 192 189 enddo 193 190 194 c+++++++++++++++++++++++++++++++++191 ! +++++++++++++++++++++++++++++++++ 195 192 cij(1,1)=45.5d0 196 193 aij(1,1)=14090.0d0 … … 229 226 cij(18,18)=370.5d0 230 227 aij(18,18)=909000.0d0 231 c+++++++++++++++++++++++++++++++++228 ! +++++++++++++++++++++++++++++++++ 232 229 do i=1,mxtyat 233 230 a14(i,i)=.5*aij(i,i) 234 231 enddo 235 c+++++++++++++++++++++++++++++++++232 ! +++++++++++++++++++++++++++++++++ 236 233 237 234 do i=1,mxtyat 238 cwrite( *, '(18f14.6)' ) ( a14(i,j), j = 1, mxtyat )235 ! write( *, '(18f14.6)' ) ( a14(i,j), j = 1, mxtyat ) 239 236 enddo 240 237 … … 254 251 255 252 endif 256 c-------------------------------------------- Hydrogen Bond Parameters253 ! -------------------------------------------- Hydrogen Bond Parameters 257 254 do i=1,mxtyat 258 255 do j=1,mxtyat … … 303 300 return 304 301 end 305 c**************302 ! ************** 306 303 BLOCK DATA 307 304 308 305 include 'INCL.H' 309 306 310 cAtom types ------------------------------------------------------------311 cOriginal types -Scheraga: -Flex:312 cH 1 - with aliphatic carbon 1 12313 c2 - with aromatic carbon 3 13314 c3 - with non-sp3 types of nitrogen 2 1315 c4 - with sp3-hybr. nitrogen 2 2316 c5 - with oxygen 4 1317 c6 - with sulfur 3(was 5)1318 cC 7 - sp3-hybr. carbon 6,9 3319 c8 - sp2-carbon (carbonyl,carboxyl,carboxylate) 7,11 4320 c9 - aromatic carbon 8,10 4321 cO 10 - hydroxyl, ester oxygen (inc. water) 18,19 8322 c11 - carbonyl oxygen 17 9323 c12 - carboxylate oxygen 18,19 10324 cN 13 - aliph. nitrogen with 0/1 hydrogen & charged N 13-15 6325 c14 - nitrogen with two hydrogens 13-15 5326 c15 - all other nitrogens (+ sp2-hybrid. in heteroc.) 13-15 7327 cS 16 - any sulfur 20,21 18,19328 cH 17 - H-delta of Pro, Hyp of ECEPP/3 dataset 5(new) -329 cC 18 - C-delta of Pro, Hyp of ECEPP/3 dataset 12(new) -330 331 cClasses for torsional potential ---------------------------------------332 c 333 c1 : 'Omega' = C'(pept.)-N(pept.) [Cpept-Npept]334 c2 : 'Phi' = N(pept.)-C(sp3) [C4-Npept]335 c3 : 'Psi' = C(sp3)-C'(pept.) [C4-Cpept]336 c4 : 'Chi1' = C(sp3)-C(sp3) [C4-C4]337 c5 : C(sp3)-OH (Hydroxyl) [C4-OH]338 c6 : C(sp3)-NH2 [C4-NH2]339 c7 : C(sp3)-NH3+ [C4-NH3+]340 c8 : C(sp3)-NH-(guanidyl) [C4-NHX]341 c9 : C(sp3)-COOH(carboxyl) [C4-COO]342 c10 : C(sp3)-COO-(carboxylate) [C4-COO]343 c11 : C(sp3)-CO(sp2 of amide) [C4-Cpept]344 c12 : C(sp3)-C(aromatic ring) [C4-C3]345 c13 : C(sp3)-S [C4-SC4]346 c14 : C(sp3)-SH [C4-SH]347 c15 : C(aromatic ring)-OH [C3-OH]348 c________________________________________________ "rigid" torsions:349 c16 : C(carboxyl)-OH [C3-OH]350 c17 : -NH-C(sp2 of guanidyl) [C3-NHX]351 c18 : -C(sp3)-NH2 (guanidyl) [not in Flex]352 c19 : -C(sp3)-NH2 (amide) [Cpept-Npept]307 ! Atom types ------------------------------------------------------------ 308 ! Original types -Scheraga: -Flex: 309 ! H 1 - with aliphatic carbon 1 12 310 ! 2 - with aromatic carbon 3 13 311 ! 3 - with non-sp3 types of nitrogen 2 1 312 ! 4 - with sp3-hybr. nitrogen 2 2 313 ! 5 - with oxygen 4 1 314 ! 6 - with sulfur 3(was 5)1 315 ! C 7 - sp3-hybr. carbon 6,9 3 316 ! 8 - sp2-carbon (carbonyl,carboxyl,carboxylate) 7,11 4 317 ! 9 - aromatic carbon 8,10 4 318 ! O 10 - hydroxyl, ester oxygen (inc. water) 18,19 8 319 ! 11 - carbonyl oxygen 17 9 320 ! 12 - carboxylate oxygen 18,19 10 321 ! N 13 - aliph. nitrogen with 0/1 hydrogen & charged N 13-15 6 322 ! 14 - nitrogen with two hydrogens 13-15 5 323 ! 15 - all other nitrogens (+ sp2-hybrid. in heteroc.) 13-15 7 324 ! S 16 - any sulfur 20,21 18,19 325 ! H 17 - H-delta of Pro, Hyp of ECEPP/3 dataset 5(new) - 326 ! C 18 - C-delta of Pro, Hyp of ECEPP/3 dataset 12(new) - 327 328 ! Classes for torsional potential --------------------------------------- 329 ! 330 ! 1 : 'Omega' = C'(pept.)-N(pept.) [Cpept-Npept] 331 ! 2 : 'Phi' = N(pept.)-C(sp3) [C4-Npept] 332 ! 3 : 'Psi' = C(sp3)-C'(pept.) [C4-Cpept] 333 ! 4 : 'Chi1' = C(sp3)-C(sp3) [C4-C4] 334 ! 5 : C(sp3)-OH (Hydroxyl) [C4-OH] 335 ! 6 : C(sp3)-NH2 [C4-NH2] 336 ! 7 : C(sp3)-NH3+ [C4-NH3+] 337 ! 8 : C(sp3)-NH-(guanidyl) [C4-NHX] 338 ! 9 : C(sp3)-COOH(carboxyl) [C4-COO] 339 ! 10 : C(sp3)-COO-(carboxylate) [C4-COO] 340 ! 11 : C(sp3)-CO(sp2 of amide) [C4-Cpept] 341 ! 12 : C(sp3)-C(aromatic ring) [C4-C3] 342 ! 13 : C(sp3)-S [C4-SC4] 343 ! 14 : C(sp3)-SH [C4-SH] 344 ! 15 : C(aromatic ring)-OH [C3-OH] 345 ! ________________________________________________ "rigid" torsions: 346 ! 16 : C(carboxyl)-OH [C3-OH] 347 ! 17 : -NH-C(sp2 of guanidyl) [C3-NHX] 348 ! 18 : -C(sp3)-NH2 (guanidyl) [not in Flex] 349 ! 19 : -C(sp3)-NH2 (amide) [Cpept-Npept] 353 350 354 351 data conv/332.d0/ ! to convert electrost. energy into [kcal/mole] 355 352 356 c------------------------- ECEPP/3 potential --------------------------------357 c1) Momany F.A McGuire R.F Burgess A.W Scheraga H.A J Phys Chem v79 2361-2381358 c1975359 c2) Nemethy G Pottle M.S Scheraga H.A, J Phys Chem v87 1883-1887 1983360 c3) Sippl M.J Nemethy G Scheraga H.A J Phys Chem v88 6231-6233 1984361 c4) Nemethy G Gibson K.D Palmer K.A Yoon C.N Paterlini G Zagari A Rumsey S362 cScheraga H.A J Phys Chem v96 6472-6484 1992363 c----------------------------------------------------------------------------353 ! ------------------------- ECEPP/3 potential -------------------------------- 354 ! 1) Momany F.A McGuire R.F Burgess A.W Scheraga H.A J Phys Chem v79 2361-2381 355 ! 1975 356 ! 2) Nemethy G Pottle M.S Scheraga H.A, J Phys Chem v87 1883-1887 1983 357 ! 3) Sippl M.J Nemethy G Scheraga H.A J Phys Chem v88 6231-6233 1984 358 ! 4) Nemethy G Gibson K.D Palmer K.A Yoon C.N Paterlini G Zagari A Rumsey S 359 ! Scheraga H.A J Phys Chem v96 6472-6484 1992 360 ! ---------------------------------------------------------------------------- 364 361 365 362 data eps_s/2.d0/ ! Distance-INdependent diel. constant 366 cdata eps_s/6.d0/ ! Distance-INdependent diel. constant363 ! data eps_s/6.d0/ ! Distance-INdependent diel. constant 367 364 data plt/78.d0/, slp/0.3d0/ ! Parameters for Epsilon(R) 368 365 369 366 data ehm /362.55d0/ ! Angstrom**2/3 * kcal / mol ! from KONF90 370 ccdata ehm /362.09561409d0/ ! Angstrom**2/3 * kcal / mol371 cFrom:372 c1.5373 c* elementary charge = 4.80325 *e+2 Angstrom**3/2 * g**1/2 * s**(-1)374 c* Planck's constant/2*Pi = 1.0545887 *e-34 Joule * s375 c* Avogadro's number = 6.022045 *e+23 mol**(-1)376 c/ sqrt (mass of electron) = sqrt (9.109534 *e-28 g )377 c/ thermal equivalent = 4.1868 *e+3 Joule * kcal**(-1)378 ccdata ehm /362.36d0/ ! calculated using Tab II in ref. 2379 ccdata 1/ehm /2.757670d-3/ ! 3*sqrt(m)/(2*e*h) taken from ICM380 381 c---------------------- atomic polarizabilties (*100,[Angstrom**3])382 c1 2 3 4 5 6 7 8 9 10 11 12367 ! data ehm /362.09561409d0/ ! Angstrom**2/3 * kcal / mol 368 ! From: 369 ! 1.5 370 ! * elementary charge = 4.80325 *e+2 Angstrom**3/2 * g**1/2 * s**(-1) 371 ! * Planck's constant/2*Pi = 1.0545887 *e-34 Joule * s 372 ! * Avogadro's number = 6.022045 *e+23 mol**(-1) 373 ! / sqrt (mass of electron) = sqrt (9.109534 *e-28 g ) 374 ! / thermal equivalent = 4.1868 *e+3 Joule * kcal**(-1) 375 ! data ehm /362.36d0/ ! calculated using Tab II in ref. 2 376 ! data 1/ehm /2.757670d-3/ ! 3*sqrt(m)/(2*e*h) taken from ICM 377 378 ! ---------------------- atomic polarizabilties (*100,[Angstrom**3]) 379 ! 1 2 3 4 5 6 7 8 9 10 11 12 383 380 data atpl/42.,42.,42.,42.,42.,42.,93.,151.,115.,59.,84.,59., 384 c13 14 15 16 17 18385 #93.,93.,93.,220.,42.,93./386 c---------------------- effective numbers of electrons (*100,ref. 2)387 c1 2 3 4 5 6 7 8 9 10 11 12381 ! 13 14 15 16 17 18 382 & 93.,93.,93.,220.,42.,93./ 383 ! ---------------------- effective numbers of electrons (*100,ref. 2) 384 ! 1 2 3 4 5 6 7 8 9 10 11 12 388 385 data efel/85.,85.,85.,85.,85.,85.,520.,520.,520.,700.,700.,700., 389 c13 14 15 16 17 18390 #610.,610.,610.,1480.,85.,520./391 c------------------------- min. pairwise 6-12 energy (*1000,[kcal/mol])392 c1 2 3 4 5 6 7 8 9 10 11 12386 ! 13 14 15 16 17 18 387 & 610.,610.,610.,1480.,85.,520./ 388 ! ------------------------- min. pairwise 6-12 energy (*1000,[kcal/mol]) 389 ! 1 2 3 4 5 6 7 8 9 10 11 12 393 390 data emin/37.,36.,61.,61.,44.,36.,38.,140.,99.,94.,200.,94., 394 c13 14 15 16 17 18395 #107.,107.,107.,223.,99.,38./396 c---------------------------- opt. pairwise distance (*100,[Angstrom])397 c1 2 3 4 5 6 7 8 9 10 11391 ! 13 14 15 16 17 18 392 & 107.,107.,107.,223.,99.,38./ 393 ! ---------------------------- opt. pairwise distance (*100,[Angstrom]) 394 ! 1 2 3 4 5 6 7 8 9 10 11 398 395 data rmin/292.,293.,268.,268.,283.,293.,412.,374.,370.,324.,312., 399 c12 13 14 15 16 17 18400 #324.,351.,351.,351.,415.,248.,412./401 c---------------------------------------------- Hydrogen-bond donors402 c1 2 3 4 5 6396 ! 12 13 14 15 16 17 18 397 & 324.,351.,351.,351.,415.,248.,412./ 398 ! ---------------------------------------------- Hydrogen-bond donors 399 ! 1 2 3 4 5 6 403 400 data do_s/.false.,.false.,.true.,.true.,.true.,.false., 404 c7 8 9 10 11 12405 #.false.,.false.,.false.,.false.,.false.,.false.,406 c13 14 15 16 17 18407 #.false.,.false.,.false.,.false.,.false.,.false./408 c-------------------------------------------- Hydrogen-bond acceptors409 c1 2 3 4 5 6401 ! 7 8 9 10 11 12 402 & .false.,.false.,.false.,.false.,.false.,.false., 403 ! 13 14 15 16 17 18 404 & .false.,.false.,.false.,.false.,.false.,.false./ 405 ! -------------------------------------------- Hydrogen-bond acceptors 406 ! 1 2 3 4 5 6 410 407 data ac_s/.false.,.false.,.false.,.false.,.false.,.false., 411 c7 8 9 10 11 12412 #.false.,.false.,.false.,.true.,.true.,.true.,413 c13 14 15 16 17 18414 #.true.,.true.,.true.,.false.,.false.,.false./415 cc #.false.,.true.,.true.,.false.,.false.,.false./ !! ICM416 c--------------------------------- HB-parameters (/1000,attraction)408 ! 7 8 9 10 11 12 409 & .false.,.false.,.false.,.true.,.true.,.true., 410 ! 13 14 15 16 17 18 411 & .true.,.true.,.true.,.false.,.false.,.false./ 412 ! & .false.,.true.,.true.,.false.,.false.,.false./ !! ICM 413 ! --------------------------------- HB-parameters (/1000,attraction) 417 414 data chb_s/2624.,2624.,4610.,.0, ! given as: 418 #4014.,4014.,5783.,.0, ! (ac_typ x do_typ)419 #2624.,2624.,4610.,.0, ! to be used:420 #8244.,8244.,8244.,.0, ! (DO_typ x AC_typ)421 #8244.,8244.,8244.,.0, ! i.e.:422 #8244.,8244.,8244.,.0/ ! ( 3-5 x 10-15 )423 c--------------------------------- HB-parameters (/1000,repulsion)415 & 4014.,4014.,5783.,.0, ! (ac_typ x do_typ) 416 & 2624.,2624.,4610.,.0, ! to be used: 417 & 8244.,8244.,8244.,.0, ! (DO_typ x AC_typ) 418 & 8244.,8244.,8244.,.0, ! i.e.: 419 & 8244.,8244.,8244.,.0/ ! ( 3-5 x 10-15 ) 420 ! --------------------------------- HB-parameters (/1000,repulsion) 424 421 data ahb_s/ 5890., 5890.,11220.,.0, 425 #12040.,12040.,16583.,.0, ! 13344 -> 16583 = Ref. 3426 #5890., 5890.,11220.,.0,427 #32897.,32897.,32897.,.0,428 #32897.,32897.,32897.,.0,429 #32897.,32897.,32897.,.0/430 431 c1 2 3 4 5 6 7 8 9 10 11 12 13 14 15422 & 12040.,12040.,16583.,.0, ! 13344 -> 16583 = Ref. 3 423 & 5890., 5890.,11220.,.0, 424 & 32897.,32897.,32897.,.0, 425 & 32897.,32897.,32897.,.0, 426 & 32897.,32897.,32897.,.0/ 427 428 ! 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 432 429 data e0to_s /20.,0.,0.,2.7,.6,1.8,1.8,0.,0.,0.,0.,0.,2.,1.5,3.5 433 c16 17 18 19434 #,8.,18.,20.,15./430 ! 16 17 18 19 431 & ,8.,18.,20.,15./ 435 432 data sgto_s /-1.,0.,0., 1.,1., 1., 1.,0.,0.,0.,0.,0.,1., 1.,-1. 436 #,-1.,-1.,-1.,-1./433 & ,-1.,-1.,-1.,-1./ 437 434 data rnto_s / 2.,0.,0., 3.,3., 3., 3.,0.,0.,0.,0.,0.,3., 3., 2. 438 #,2., 2., 2., 2./439 440 c---------------------------- Flex potential ----------------------------------441 cLavery R Sklenar H Zakrzewska K Pullman B J Biomol Struct Dyn v3 989-1014 1986442 cVdW-parameters from: Zhurkin V.B Poltiev V.I Florent'ev V.L Molekulyarnaya443 cBiologiya v14 116 1980444 c------------------------------------------------------------------------------435 & ,2., 2., 2., 2./ 436 437 ! ---------------------------- Flex potential ---------------------------------- 438 ! Lavery R Sklenar H Zakrzewska K Pullman B J Biomol Struct Dyn v3 989-1014 1986 439 ! VdW-parameters from: Zhurkin V.B Poltiev V.I Florent'ev V.L Molekulyarnaya 440 ! Biologiya v14 116 1980 441 ! ------------------------------------------------------------------------------ 445 442 446 443 data plt_f/78.d0/, slp_f/0.16d0/ ! Parameters for Epsilon(R) 447 444 data cohb_f/6.d0/ ! Cut-off distance betw. H- & acceptor atom for HB 448 445 data c_f/ ! ----------- Lennard-Jones C6-parameters (attraction) 449 #40.,40.,40.,40.,40.,40.,100.,126.,126.,86.,121.,105.,126.,105.,450 #146.,213.1,3*0.,40.,40.,40.,40.,40.,100.,126.,126.,86.,121.,105.,451 #126.,105.,146.,213.1,4*0.,40.,40.,40.,40.,100.,126.,126.,86.,121.,452 #105.,126.,105.,146.,213.1,5*0.,40.,40.,40.,100.,126.,126.,86.,121.453 #,105.,126.,105.,146.,213.1,6*0.,40.,40.,100.,126.,126.,86.,121.,454 #105.,126.,105.,146.,213.1,7*0.,40.,100.,126.,126.,86.,121.,105.,455 #126.,105.,146.,213.1,8*0.,250.,316.,316.,217.,305.,264.,316.,264.,456 #367.,489.,9*0.,400.,400.,274.,385.,334.,400.,334.,464.,537.4,10*0.457 #,400.,274.,385.,334.,400.,334.,464.,537.4,11*0.,200.,283.,245.,458 #278.,233.,330.,424.,12*0.,400.,347.,391.,327.,465.,583.,13*0.,300.459 #,339.,284.,403.,530.,14*0.,400.,334.,467.,556.5,15*0.,280.,391.,460 #484.,16*0.,550.,673.4,17*0.,246.,38*0./446 &40.,40.,40.,40.,40.,40.,100.,126.,126.,86.,121.,105.,126.,105., 447 &146.,213.1,3*0.,40.,40.,40.,40.,40.,100.,126.,126.,86.,121.,105., 448 &126.,105.,146.,213.1,4*0.,40.,40.,40.,40.,100.,126.,126.,86.,121., 449 &105.,126.,105.,146.,213.1,5*0.,40.,40.,40.,100.,126.,126.,86.,121. 450 &,105.,126.,105.,146.,213.1,6*0.,40.,40.,100.,126.,126.,86.,121., 451 &105.,126.,105.,146.,213.1,7*0.,40.,100.,126.,126.,86.,121.,105., 452 &126.,105.,146.,213.1,8*0.,250.,316.,316.,217.,305.,264.,316.,264., 453 &367.,489.,9*0.,400.,400.,274.,385.,334.,400.,334.,464.,537.4,10*0. 454 &,400.,274.,385.,334.,400.,334.,464.,537.4,11*0.,200.,283.,245., 455 &278.,233.,330.,424.,12*0.,400.,347.,391.,327.,465.,583.,13*0.,300. 456 &,339.,284.,403.,530.,14*0.,400.,334.,467.,556.5,15*0.,280.,391., 457 &484.,16*0.,550.,673.4,17*0.,246.,38*0./ 461 458 data a_f/ ! ---- Lennard-Jones A12-parameters (/1000,repulsion) 462 #7.74,7.74,7.74,7.74,7.74,7.74,70.6,81.6,81.6,31.3,42.2,36.6,71.4,463 #62.,78.3,189.3,3*0.,7.74,7.74,7.74,7.74,7.74,70.6,61.7,61.7,31.3,464 #17.8,15.4,53.7,62.,58.7,189.3,4*0.,7.74,7.74,7.74,7.74,70.6,81.6,465 #81.6,31.3,42.2,36.6,71.4,62.,78.3,189.3,5*0.,7.74,7.74,7.74,70.6,466 #61.7,61.7,31.3,17.8,15.4,53.7,62.,58.7,189.3,6*0.,7.74,7.74,70.6,467 #81.6,81.6,31.3,42.2,36.6,71.4,62.,78.3,189.3,7*0.,7.74,70.6,81.6,468 #81.6,31.3,42.2,36.6,71.4,62.,78.3,189.3,8*0.,512.,601.,601.,256.,469 #349.,302.,538.,464.,598.,1196.,9*0.,704.,704.,298.,406.,351.,630.,470 #544.,699.,1203.5,10*0.,704.,298.,406.,351.,630.,544.,699.,1203.5,471 #11*0.,129.,176.,153.,269.,233.,303.,561.8,12*0.,240.,208.,366.,472 #317.,413.,772.5,13*0.,180.,317.,274.,358.,702.3,14*0.,565.,488.,473 #629.,1105.8,15*0.,421.,544.,976.8,16*0.,705.,1259.5,17*0.,503.3,474 #38*0./475 c---------------------------------------------- Hydrogen-bond donors476 c1 2 3 4 5 6459 &7.74,7.74,7.74,7.74,7.74,7.74,70.6,81.6,81.6,31.3,42.2,36.6,71.4, 460 &62.,78.3,189.3,3*0.,7.74,7.74,7.74,7.74,7.74,70.6,61.7,61.7,31.3, 461 &17.8,15.4,53.7,62.,58.7,189.3,4*0.,7.74,7.74,7.74,7.74,70.6,81.6, 462 &81.6,31.3,42.2,36.6,71.4,62.,78.3,189.3,5*0.,7.74,7.74,7.74,70.6, 463 &61.7,61.7,31.3,17.8,15.4,53.7,62.,58.7,189.3,6*0.,7.74,7.74,70.6, 464 &81.6,81.6,31.3,42.2,36.6,71.4,62.,78.3,189.3,7*0.,7.74,70.6,81.6, 465 &81.6,31.3,42.2,36.6,71.4,62.,78.3,189.3,8*0.,512.,601.,601.,256., 466 &349.,302.,538.,464.,598.,1196.,9*0.,704.,704.,298.,406.,351.,630., 467 &544.,699.,1203.5,10*0.,704.,298.,406.,351.,630.,544.,699.,1203.5, 468 &11*0.,129.,176.,153.,269.,233.,303.,561.8,12*0.,240.,208.,366., 469 &317.,413.,772.5,13*0.,180.,317.,274.,358.,702.3,14*0.,565.,488., 470 &629.,1105.8,15*0.,421.,544.,976.8,16*0.,705.,1259.5,17*0.,503.3, 471 &38*0./ 472 ! ---------------------------------------------- Hydrogen-bond donors 473 ! 1 2 3 4 5 6 477 474 data do_f/.false.,.false.,.true.,.true.,.true.,.true., 478 c7 8 9 10 11 12479 #.false.,.false.,.false.,.false.,.false.,.false.,480 c13 14 15 16 17 18481 #.false.,.false.,.false.,.false.,.false.,.false./482 c-------------------------------------------- Hydrogen-bond acceptors483 c1 2 3 4 5 6475 ! 7 8 9 10 11 12 476 & .false.,.false.,.false.,.false.,.false.,.false., 477 ! 13 14 15 16 17 18 478 & .false.,.false.,.false.,.false.,.false.,.false./ 479 ! -------------------------------------------- Hydrogen-bond acceptors 480 ! 1 2 3 4 5 6 484 481 data ac_f/.false.,.false.,.false.,.false.,.false.,.false., 485 c7 8 9 10 11 12486 #.false.,.false.,.false.,.true.,.true.,.true.,487 c13 14 15 16 17 18488 #.false.,.false.,.true.,.true.,.false.,.false./489 c--------------------------------- HB-parameters (/1000,attraction)482 ! 7 8 9 10 11 12 483 & .false.,.false.,.false.,.true.,.true.,.true., 484 ! 13 14 15 16 17 18 485 & .false.,.false.,.true.,.true.,.false.,.false./ 486 ! --------------------------------- HB-parameters (/1000,attraction) 490 487 data chb_f/180.,180.,160. ,226.8, ! given as (ac_typ x do_typ) 491 #175.,175.,150. ,305.8, ! to be used as:492 #100.,100., 85. , 85. , ! (Do_typ x Ac_typ)493 #165.,165.,150. ,305.8, ! i.e.:494 #720.,720.,643.1,845.6, ! ( 3-6 x 10-12,15,16 )495 #0., 0., 0. , 0. /496 c--------------------------------- HB-parameters (/1000,repulsion)488 & 175.,175.,150. ,305.8, ! to be used as: 489 & 100.,100., 85. , 85. , ! (Do_typ x Ac_typ) 490 & 165.,165.,150. ,305.8, ! i.e.: 491 & 720.,720.,643.1,845.6, ! ( 3-6 x 10-12,15,16 ) 492 & 0., 0., 0. , 0. / 493 ! --------------------------------- HB-parameters (/1000,repulsion) 497 494 data ahb_f/ 6600., 6600., 6200., 12855., 498 #6400., 6400., 7100., 29216.,499 #2400., 2400., 2400., 2000.,500 #6200., 6200., 7100., 29216.,501 #185000.,185000.,172301.,308235.,502 #0., 0., 0., 0./503 504 c1 2 3 4 5 6 7 8 9 10 11 12 13 14 15495 & 6400., 6400., 7100., 29216., 496 & 2400., 2400., 2400., 2000., 497 & 6200., 6200., 7100., 29216., 498 & 185000.,185000.,172301.,308235., 499 & 0., 0., 0., 0./ 500 501 ! 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 505 502 data e0to_f /20.,2.,.8,2.6,.6,2.1,1.8,3.2,.5,.5,.8,1.2,1.3,1.,6.2 506 c16 17 18 19507 #,6.2, 8.,0.,20./503 ! 16 17 18 19 504 & ,6.2, 8.,0.,20./ 508 505 data sgto_f /-1.,1.,-1., 1.,1., 1., 1.,1.,1.,1.,-1.,1., 1.,1.,-1. 509 #,-1.,-1.,0.,-1./506 & ,-1.,-1.,0.,-1./ 510 507 data rnto_f / 2.,3., 3., 3.,3., 6., 3.,3.,6.,6., 3.,6., 3.,3., 2. 511 #,2., 2.,0.,2./508 & ,2., 2.,0.,2./ 512 509 513 510 data (rsnmcd(i),i=1,nrsty)/ ! Names for all amino acid residue types 514 #'ala ','arg ','arg+','asn ','asp ','asp-','cys ','cyss','gln ',515 #'glu ','glu-','gly ','his ','hise','hisd','his+','hyp ','hypu',516 #'ile ','leu ','lys ','lys+','met ','phe ','cpro','pro ','cpru',517 #'prou','pron','pro+','ser ','thr ','trp ','tyr ','val ' /511 & 'ala ','arg ','arg+','asn ','asp ','asp-','cys ','cyss','gln ', 512 & 'glu ','glu-','gly ','his ','hise','hisd','his+','hyp ','hypu', 513 & 'ile ','leu ','lys ','lys+','met ','phe ','cpro','pro ','cpru', 514 & 'prou','pron','pro+','ser ','thr ','trp ','tyr ','val ' / 518 515 519 516 data (onltcd(i),i=1,nrsty)/ ! One-letter codes for amino acid types 520 #'A', 'R', 'R', 'N', 'D', 'D', 'C', 'C', 'Q',521 #'E', 'E', 'G', 'H', 'H', 'H', 'H', 'P', 'P',522 #'I', 'L', 'K', 'K', 'M', 'F', 'P', 'P', 'P',523 #'P', 'P', 'P', 'S', 'T', 'W', 'Y', 'V' /524 525 cThe vdW radii (in Angstr.) for the atomic groups and526 ccoefficients for their solvation free energy (kcal/molxA**2)527 528 cMethod:529 530 citysol=1 : OONS --> T.Ooi, et al,531 cProc. Natl. Acad. Sci. USA 8 (1987) 3086-3090.532 Citysol=2 : JRF --> J.Vila, et al,533 cPROTEINS: Struct Funct Genet 10(1991) 199-218.534 Citysol=3 : WE92 --> L.Wesson, D.Eisenberg,535 cProtein Science 1 (1992) 227-235.536 Citysol=4 : SCH1 --> D.Eisenberg, et al,537 cChem Scrip 29A (1989) 217-221.538 Citysol=5 : SCH2 --> A.H.Juffer, et al,539 cProteine Science 4 (1995) 2499-2509.540 Citysol=6 : SCH3 --> L.Wesson, D.Eisenberg,541 cProtein Science 1 (1992) 227-235.542 Citysol=7 : SCH4 --> C.A. Schiffer, et al,543 cMol. Simul. 10(1993) 121-149.544 Citysol=8 : EM86 --> D.Eisenberg, A.D. Mclachlan,545 cNature 319 (1986) 199-203.546 Citysol=9 : BM --> B. Freyberg, et al,547 cJ. Mol. Biol. 233 (1993) 275-292.548 549 cATOM550 cTYPE OONS JRF WE92 SCH1 SCH2 SCH3 SCH4 EM86 BM551 552 c1 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.000 0.000553 c2 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.000 0.000554 c3 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.000 0.000555 c4 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.000 0.000556 c5 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.000 0.000557 c6 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.000 0.000558 c7 0.0080 0.2160 0.0120 0.0180 0.0130 0.0040 0.0325 0.016 1.000559 c8 0.4270 -0.7320 0.0120 0.0180 0.0130 0.0040 0.0325 0.016 1.000560 c9 -0.0080 -0.6780 0.0120 0.0180 0.0130 0.0040 0.0325 0.016 1.000561 c10 -0.1720 -0.9100 -0.1160 -0.0090 -0.0070 -0.1130 -0.0175 -0.006 0.000562 c11 -0.0380 -0.2620 -0.1750 -0.0090 -0.0070 -0.1660 -0.2800 -0.006 0.000563 c12 -0.0380 -0.9100 -0.1750 -0.0370 -0.1120 -0.1660 -0.2800 -0.024 0.000564 c13 -0.1320 -0.3120 -0.1860 -0.0380 -0.0870 -0.1690 -0.2175 -0.05 0.000565 c14 -0.1320 -0.3120 -0.1160 -0.0090 -0.0070 -0.1130 -0.0175 -0.006 0.000566 c15 -0.1320 -0.3120 -0.1160 -0.0090 -0.0070 -0.1130 -0.0175 -0.006 0.000567 c16 -0.0210 -0.2810 -0.0180 0.0050 -0.0036 -0.0170 -0.0090 0.021 0.000568 c17 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.000 0.000569 c18 0.0080 0.2160 0.0120 0.0180 0.0130 0.0040 0.0325 0.016 1.000517 & 'A', 'R', 'R', 'N', 'D', 'D', 'C', 'C', 'Q', 518 & 'E', 'E', 'G', 'H', 'H', 'H', 'H', 'P', 'P', 519 & 'I', 'L', 'K', 'K', 'M', 'F', 'P', 'P', 'P', 520 & 'P', 'P', 'P', 'S', 'T', 'W', 'Y', 'V' / 521 522 ! The vdW radii (in Angstr.) for the atomic groups and 523 ! coefficients for their solvation free energy (kcal/molxA**2) 524 525 ! Method: 526 527 ! itysol=1 : OONS --> T.Ooi, et al, 528 ! Proc. Natl. Acad. Sci. USA 8 (1987) 3086-3090. 529 ! itysol=2 : JRF --> J.Vila, et al, 530 ! PROTEINS: Struct Funct Genet 10(1991) 199-218. 531 ! itysol=3 : WE92 --> L.Wesson, D.Eisenberg, 532 ! Protein Science 1 (1992) 227-235. 533 ! itysol=4 : SCH1 --> D.Eisenberg, et al, 534 ! Chem Scrip 29A (1989) 217-221. 535 ! itysol=5 : SCH2 --> A.H.Juffer, et al, 536 ! Proteine Science 4 (1995) 2499-2509. 537 ! itysol=6 : SCH3 --> L.Wesson, D.Eisenberg, 538 ! Protein Science 1 (1992) 227-235. 539 ! itysol=7 : SCH4 --> C.A. Schiffer, et al, 540 ! Mol. Simul. 10(1993) 121-149. 541 ! itysol=8 : EM86 --> D.Eisenberg, A.D. Mclachlan, 542 ! Nature 319 (1986) 199-203. 543 ! itysol=9 : BM --> B. Freyberg, et al, 544 ! J. Mol. Biol. 233 (1993) 275-292. 545 546 ! ATOM 547 ! TYPE OONS JRF WE92 SCH1 SCH2 SCH3 SCH4 EM86 BM 548 549 ! 1 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.000 0.000 550 ! 2 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.000 0.000 551 ! 3 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.000 0.000 552 ! 4 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.000 0.000 553 ! 5 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.000 0.000 554 ! 6 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.000 0.000 555 ! 7 0.0080 0.2160 0.0120 0.0180 0.0130 0.0040 0.0325 0.016 1.000 556 ! 8 0.4270 -0.7320 0.0120 0.0180 0.0130 0.0040 0.0325 0.016 1.000 557 ! 9 -0.0080 -0.6780 0.0120 0.0180 0.0130 0.0040 0.0325 0.016 1.000 558 !10 -0.1720 -0.9100 -0.1160 -0.0090 -0.0070 -0.1130 -0.0175 -0.006 0.000 559 !11 -0.0380 -0.2620 -0.1750 -0.0090 -0.0070 -0.1660 -0.2800 -0.006 0.000 560 !12 -0.0380 -0.9100 -0.1750 -0.0370 -0.1120 -0.1660 -0.2800 -0.024 0.000 561 !13 -0.1320 -0.3120 -0.1860 -0.0380 -0.0870 -0.1690 -0.2175 -0.05 0.000 562 !14 -0.1320 -0.3120 -0.1160 -0.0090 -0.0070 -0.1130 -0.0175 -0.006 0.000 563 !15 -0.1320 -0.3120 -0.1160 -0.0090 -0.0070 -0.1130 -0.0175 -0.006 0.000 564 !16 -0.0210 -0.2810 -0.0180 0.0050 -0.0036 -0.0170 -0.0090 0.021 0.000 565 !17 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.000 0.000 566 !18 0.0080 0.2160 0.0120 0.0180 0.0130 0.0040 0.0325 0.016 1.000 570 567 571 568 data coef_sl/54*0.0, 572 #0.008, 0.216, 0.012, 0.018, 0.013, 0.004, 0.0325, 0.016,1.000,573 #0.427,-0.732, 0.012, 0.018, 0.013, 0.004, 0.0325, 0.016,1.000,574 #-.008,-0.678, 0.012, 0.018, 0.013, 0.004, 0.0325, 0.016,1.000,575 #-.172,-0.910,-0.116,-0.009,-0.007,-0.113,-0.0175,-0.006,0.000,576 #-.038,-0.262,-0.116,-0.009,-0.007,-0.113,-0.0175,-0.006,0.000,577 #-.038,-0.910,-0.175,-0.037,-0.112,-0.166,-0.2800,-0.024,0.000,578 #-.132,-0.312,-0.186,-0.038,-0.087,-0.169,-0.2175,-0.05, 0.000,579 #-.132,-0.312,-0.116,-0.009,-0.007,-0.113,-0.0175,-0.006,0.000,580 #-.132,-0.312,-0.116,-0.009,-0.007,-0.113,-0.0175,-0.006,0.000,581 #-.021,-0.281,-0.018, 0.005,-.0036,-0.017,-0.0090, 0.021,0.000,582 #9*0.0,583 #0.008, 0.216, 0.012, 0.018, 0.013, 0.004, 0.0325, 0.016,1.000/569 & 0.008, 0.216, 0.012, 0.018, 0.013, 0.004, 0.0325, 0.016,1.000, 570 & 0.427,-0.732, 0.012, 0.018, 0.013, 0.004, 0.0325, 0.016,1.000, 571 & -.008,-0.678, 0.012, 0.018, 0.013, 0.004, 0.0325, 0.016,1.000, 572 & -.172,-0.910,-0.116,-0.009,-0.007,-0.113,-0.0175,-0.006,0.000, 573 & -.038,-0.262,-0.116,-0.009,-0.007,-0.113,-0.0175,-0.006,0.000, 574 & -.038,-0.910,-0.175,-0.037,-0.112,-0.166,-0.2800,-0.024,0.000, 575 & -.132,-0.312,-0.186,-0.038,-0.087,-0.169,-0.2175,-0.05, 0.000, 576 & -.132,-0.312,-0.116,-0.009,-0.007,-0.113,-0.0175,-0.006,0.000, 577 & -.132,-0.312,-0.116,-0.009,-0.007,-0.113,-0.0175,-0.006,0.000, 578 & -.021,-0.281,-0.018, 0.005,-.0036,-0.017,-0.0090, 0.021,0.000, 579 & 9*0.0, 580 & 0.008, 0.216, 0.012, 0.018, 0.013, 0.004, 0.0325, 0.016,1.000/ 584 581 585 582 data rad_vdw/54*0., 586 #2*2.0,6*1.9,2.0,587 #2*1.55,6*1.9,1.5,588 #2*1.75,6*1.9,1.85,589 #9*1.4,590 #9*1.4,591 #9*1.4,592 #2*1.55,6*1.7,1.5,593 #2*1.55,6*1.7,1.5,594 #2*1.55,6*1.7,1.5,595 #2*2.0,6*1.8,1.85,596 #9*0.,597 #2*2.0,6*1.9,2.0/583 & 2*2.0,6*1.9,2.0, 584 & 2*1.55,6*1.9,1.5, 585 & 2*1.75,6*1.9,1.85, 586 & 9*1.4, 587 & 9*1.4, 588 & 9*1.4, 589 & 2*1.55,6*1.7,1.5, 590 & 2*1.55,6*1.7,1.5, 591 & 2*1.55,6*1.7,1.5, 592 & 2*2.0,6*1.8,1.85, 593 & 9*0., 594 & 2*2.0,6*1.9,2.0/ 598 595 599 596 end -
init_molecule.f
r2ebb8b6 rbd2278d 1 c**************************************************************2 c 3 cThis file contains the subroutines: init_molecule4 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**************************************************************11 cFIXME: Data in varfile determines which molecule is changed.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 12 13 13 subroutine init_molecule(iabin,grpn,grpc,seqfile,varfile) 14 14 15 c----------------------------------------------------------16 cPURPOSE: construct starting structure of molecule(s)17 c 18 ciabin = 1 : ab Initio using sequence &19 cvariables given in input files20 ciabin != 1 : sequence, variable information21 cfrom PDB-file22 c 23 cgrpn: N-terminal group24 cgrpc: C-terminal group25 c 26 cCALLS: addend,bldmol,c_alfa,getmol,iendst, mklist, nursvr,27 Cpdbread,pdbvars,redseq,redvar,setmvs28 C 29 c----------------------------------------------------------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 30 31 31 include 'INCL.H' 32 32 include 'INCP.H' 33 33 34 cf2py character*80 optional, intent(in) :: seqfile = ' '35 cf2py character*80 optional, intent(in) :: varfile = ' '34 !f2py character*80 optional, intent(in) :: seqfile = ' ' 35 !f2py character*80 optional, intent(in) :: varfile = ' ' 36 36 37 37 character grpn*4,grpc*4 … … 47 47 if (iabin.eq.1) then 48 48 49 c----------------------------------------- get sequence for molecule(s)49 ! ----------------------------------------- get sequence for molecule(s) 50 50 lunseq=11 51 51 if (ntlml.gt.0) then … … 64 64 write (*,*) 'File with sequence is ', seqfil(1:iendst(seqfil)) 65 65 66 c--------------------------------- read & assemble data from libraries67 cinitial coordinates, interaction lists66 ! --------------------------------- read & assemble data from libraries 67 ! initial coordinates, interaction lists 68 68 69 69 ntl = ntlml … … 85 85 enddo 86 86 87 c--------------------------- Read the initial conformation if necessary87 ! --------------------------- Read the initial conformation if necessary 88 88 if(readFromStdin) then 89 89 write (*,'(a,$)') ' file with VARIABLES:' 90 c90 ! 91 91 varfil=' ' 92 92 read(*,'(a)',end=2,err=2) varfil … … 105 105 2 write(*,*) ' ' 106 106 107 c-------------------- get: nvr,idvr, vlvr, olvlvr107 ! -------------------- get: nvr,idvr, vlvr, olvlvr 108 108 nvr = 0 109 109 do i=1,ivrml1(ntlml)+nvrml(ntlml)-1 … … 149 149 endif 150 150 151 c-------------------------- set var. amplitudes for simulations151 ! -------------------------- set var. amplitudes for simulations 152 152 153 153 do i=1,ivrml1(ntlml)+nvrml(ntlml)-1 … … 162 162 if ( navr(1:2).eq.'om' 163 163 164 #.or.nars(1:3).eq.'arg'.and.(navr(1:2).eq.'x5'165 #.or.navr(1:2).eq.'x6')166 167 #.or.(nars(1:3).eq.'asn'.or.nars(1:3).eq.'asp')168 #.and.navr(1:2).eq.'x3'169 170 #.or.(nars(1:3).eq.'gln'.or.nars(1:3).eq.'glu')171 #.and.navr(1:2).eq.'x4'172 173 #) then174 175 caxvr(i) = pi/9.d0 ! 20 deg.164 & .or.nars(1:3).eq.'arg'.and.(navr(1:2).eq.'x5' 165 & .or.navr(1:2).eq.'x6') 166 167 & .or.(nars(1:3).eq.'asn'.or.nars(1:3).eq.'asp') 168 & .and.navr(1:2).eq.'x3' 169 170 & .or.(nars(1:3).eq.'gln'.or.nars(1:3).eq.'glu') 171 & .and.navr(1:2).eq.'x4' 172 173 & ) then 174 175 ! axvr(i) = pi/9.d0 ! 20 deg. 176 176 axvr(i) = pi2 ! Trying out 360 deg. for these as well 177 177 … … 186 186 enddo ! vars. 187 187 188 c--------------------- initialize solvation pars. if necessary188 ! --------------------- initialize solvation pars. if necessary 189 189 190 190 if (itysol.ne.0) then -
main.f
r2ebb8b6 rbd2278d 1 c**************************************************************2 cThis file contains the: main (SINGLE PROCESSOR JOBS ONLY,3 CFOR PARALLEL JOBS USE pmain)4 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 CCALLS: init_energy,init_molecule11 CCALLS TASK SUBROUTINE: anneal,canon,elp,minim,mulcan_par,12 cmulcan_sim,partem_s, or regul13 CCAN ALSO CALL MEASUREMENT ROUTINES: cnteny,contacts,helix,hbond,14 Coutpdb,outvar,rgyr,15 Crmsinit and rsmdfun,zimmer16 c$Id: main.f 334 2007-08-07 09:23:59Z meinke $17 c**************************************************************1 ! ************************************************************** 2 ! This file contains the: main (SINGLE PROCESSOR JOBS ONLY, 3 ! FOR PARALLEL JOBS USE pmain) 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 ! CALLS: init_energy,init_molecule 11 ! CALLS TASK SUBROUTINE: anneal,canon,elp,minim,mulcan_par, 12 ! mulcan_sim,partem_s, or regul 13 ! CAN ALSO CALL MEASUREMENT ROUTINES: cnteny,contacts,helix,hbond, 14 ! outpdb,outvar,rgyr, 15 ! rmsinit and rsmdfun,zimmer 16 ! $Id: main.f 334 2007-08-07 09:23:59Z meinke $ 17 ! ************************************************************** 18 18 19 19 program main … … 26 26 logical lrand,bgsposs 27 27 28 c=================================================== Energy setup28 ! =================================================== Energy setup 29 29 30 cDirectory for SMMP libraries31 cChange the following directory path to where you want to put SMMP32 clibraries of residues.30 ! Directory for SMMP libraries 31 ! Change the following directory path to where you want to put SMMP 32 ! libraries of residues. 33 33 libdir='./SMMP/' 34 34 35 cThe switch in the following line is now not used.35 ! The switch in the following line is now not used. 36 36 flex=.false. ! .true. for Flex / .false. for ECEPP 37 37 38 cChoose energy type with the following switch instead ...38 ! Choose energy type with the following switch instead ... 39 39 ientyp = 0 40 c0 => ECEPP2 or ECEPP3 depending on the value of sh241 c1 => FLEX42 c2 => Lund force field43 c3 => ECEPP with Abagyan corrections44 c 40 ! 0 => ECEPP2 or ECEPP3 depending on the value of sh2 41 ! 1 => FLEX 42 ! 2 => Lund force field 43 ! 3 => ECEPP with Abagyan corrections 44 ! 45 45 46 46 sh2=.false. ! .true. for ECEPP/2; .false. for ECEPP3 … … 54 54 call init_energy(libdir) 55 55 56 c================================================= Structure setup56 ! ================================================= Structure setup 57 57 58 58 grpn = 'nh2' ! N-terminal group … … 67 67 ntlml = 0 68 68 write (*,*) 'Solvent: ', itysol 69 cInitialize random number generator.69 ! Initialize random number generator. 70 70 call sgrnd(31433) 71 71 … … 78 78 call init_molecule(iabin,grpn,grpc,seqfile,varfile) 79 79 80 cDecide if and when to use BGS, and initialize Lund data structures80 ! Decide if and when to use BGS, and initialize Lund data structures 81 81 bgsprob=0.75 ! Prob for BGS, given that it is possible 82 cupchswitch= 0 => No BGS 1 => BGS with probability bgsprob83 c2 => temperature dependent choice82 ! upchswitch= 0 => No BGS 1 => BGS with probability bgsprob 83 ! 2 => temperature dependent choice 84 84 upchswitch=1 85 85 rndord=.true. … … 89 89 90 90 91 c======================================== Add your task down here91 ! ======================================== Add your task down here 92 92 93 93 imin = 1 ! Quasi-Newton … … 95 95 eps = 1.0d-7 ! requested precision 96 96 call minim(imin, maxit, eps) 97 cTo do a canonical Monte Carlo simulation uncomment the lines below97 ! To do a canonical Monte Carlo simulation uncomment the lines below 98 98 ! nequi = 100 99 99 ! nsweep = 50000 … … 101 101 ! temp = 300.0 102 102 ! lrand = .true. 103 cCanonical Monte Carlo103 ! Canonical Monte Carlo 104 104 ! call canon(nequi, nsweep, nmes, temp, lrand) 105 105 106 cFor simulated annealing uncomment the lines below106 ! For simulated annealing uncomment the lines below 107 107 ! tmin = 200.0 108 108 ! tmax = 500.0 109 109 ! call anneal(nequi, nsweep, nmes, tmax, tmin, lrand); 110 c======================================== End of main110 ! ======================================== End of main 111 111 end -
main_bgl_p.f
r2ebb8b6 rbd2278d 1 c**************************************************************2 c3 cThis file contains the main (PARALLEL TEMPERING JOBS ONLY,4 CFOR SINGULAR PROCESSOR JOBS USE main)5 C6 CThis file contains also the subroutine: p_init_molecule7 c8 cCopyright 2003-2005 Frank Eisenmenger, U.H.E. Hansmann,9 cShura Hayryan, Chin-Ku10 cCopyright 2007 Frank Eisenmenger, U.H.E. Hansmann,11 cJan H. Meinke, Sandipan Mohanty12 c13 CCALLS init_energy,p_init_molecule,partem_p14 C15 c**************************************************************1 ! ************************************************************** 2 ! 3 ! This file contains the main (PARALLEL TEMPERING JOBS ONLY, 4 ! FOR SINGULAR PROCESSOR JOBS USE main) 5 ! 6 ! This file contains also the subroutine: p_init_molecule 7 ! 8 ! Copyright 2003-2005 Frank Eisenmenger, U.H.E. Hansmann, 9 ! Shura Hayryan, Chin-Ku 10 ! Copyright 2007 Frank Eisenmenger, U.H.E. Hansmann, 11 ! Jan H. Meinke, Sandipan Mohanty 12 ! 13 ! CALLS init_energy,p_init_molecule,partem_p 14 ! 15 ! ************************************************************** 16 16 program pmain 17 17 … … 28 28 logical newsta 29 29 30 cc Number of replicas30 !c Number of replicas 31 31 integer num_replica 32 cc Number of processors per replica32 !c Number of processors per replica 33 33 integer num_ppr 34 cc Range of processor for crating communicators34 !c Range of processor for crating communicators 35 35 integer proc_range(3) 36 cc Array of MPI groups36 !c Array of MPI groups 37 37 integer group(MAX_REPLICA), group_partem 38 cc Array of MPI communicators38 !c Array of MPI communicators 39 39 integer comm(MAX_REPLICA), partem_comm 40 cc Array of nodes acting as masters for the energy calculation.40 !c Array of nodes acting as masters for the energy calculation. 41 41 integer ranks(MAX_REPLICA) 42 cc Configuration switch42 !c Configuration switch 43 43 integer switch 44 44 integer rep_id 45 cset number of replicas45 ! set number of replicas 46 46 double precision eols(MAX_REPLICA) 47 47 integer ndims, nldims, log2ppr, color … … 53 53 54 54 55 cMPI stuff, and random number generator initialisation55 ! MPI stuff, and random number generator initialisation 56 56 57 57 call mpi_init(ierr) … … 88 88 call sgrnd(seed) ! Initialize the random number generator 89 89 90 c=================================================== Energy setup90 ! =================================================== Energy setup 91 91 libdir='SMMP/' 92 cDirectory for SMMP libraries93 94 cThe switch in the following line is now not used.92 ! Directory for SMMP libraries 93 94 ! The switch in the following line is now not used. 95 95 flex=.false. ! .true. for Flex / .false. for ECEPP 96 96 97 cChoose energy type with the following switch instead ...97 ! Choose energy type with the following switch instead ... 98 98 ientyp = 0 99 c0 => ECEPP2 or ECEPP3 depending on the value of sh2100 c1 => FLEX101 c2 => Lund force field102 c3 => ECEPP with Abagyan corrections103 c99 ! 0 => ECEPP2 or ECEPP3 depending on the value of sh2 100 ! 1 => FLEX 101 ! 2 => Lund force field 102 ! 3 => ECEPP with Abagyan corrections 103 ! 104 104 105 105 sh2=.false. ! .true. for ECEPP/2; .false. for ECEPP3 … … 114 114 call init_energy(libdir) 115 115 116 ccalculate CPU time using MPI_Wtime()116 ! calculate CPU time using MPI_Wtime() 117 117 startwtime = MPI_Wtime() 118 118 119 119 120 c================================================= Structure setup120 ! ================================================= Structure setup 121 121 grpn = 'nh2' ! N-terminal group 122 122 grpc = 'cooh' ! C-terminal group … … 153 153 ntlml = 0 154 154 155 cDecide if and when to use BGS, and initialize Lund data structures155 ! Decide if and when to use BGS, and initialize Lund data structures 156 156 bgsprob=0.6 ! Prob for BGS, given that it is possible 157 cupchswitch= 0 => No BGS 1 => BGS with probability bgsprob158 c2 => temperature dependent choice157 ! upchswitch= 0 => No BGS 1 => BGS with probability bgsprob 158 ! 2 => temperature dependent choice 159 159 upchswitch=1 160 160 rndord=.true. 161 161 if (ientyp.eq.2) call init_lundff 162 c=================================================================163 cDistribute nodes to parallel tempering tasks164 cI assume that the number of nodes available is an integer165 cmultiple n of the number of replicas. Each replica then gets n166 cprocessors to do its energy calculation.162 ! ================================================================= 163 ! Distribute nodes to parallel tempering tasks 164 ! I assume that the number of nodes available is an integer 165 ! multiple n of the number of replicas. Each replica then gets n 166 ! processors to do its energy calculation. 167 167 num_ppr = num_proc / num_replica 168 168 … … 206 206 ! call mpi_comm_group(mpi_comm_world, group_world, error) 207 207 208 cThe current version doesn't require a separate variable j. I209 ccould just use i * num_ppr but this way it's more flexible.208 ! The current version doesn't require a separate variable j. I 209 ! could just use i * num_ppr but this way it's more flexible. 210 210 ! j = 0 211 211 ! do i = 1, num_replica … … 277 277 nml = 1 278 278 279 cRRRRRRRRRRMMMMMMMMMMMMSSSSSSSSSSDDDDDDDDDDDDD279 ! RRRRRRRRRRMMMMMMMMMMMMSSSSSSSSSSDDDDDDDDDDDDD 280 280 call rmsinit(nml,ref_pdb) 281 cRRRRRRRRRRMMMMMMMMMMMMSSSSSSSSSSDDDDDDDDDDDDD281 ! RRRRRRRRRRMMMMMMMMMMMMSSSSSSSSSSDDDDDDDDDDDDD 282 282 283 283 ! READ REFERENCE CONTACT MAP … … 294 294 end do 295 295 296 c======================================== start of parallel tempering run296 ! ======================================== start of parallel tempering run 297 297 write (*,*) "There are ", no, 298 298 & " processors available for ",rep_id … … 303 303 call partem_p(num_replica, nequi, nswp, nmes, nsave, newsta, 304 304 & switch, rep_id, partem_comm) 305 c======================================== end of parallel tempering run306 ccalculate CPU time using MPI_Wtime()305 ! ======================================== end of parallel tempering run 306 ! calculate CPU time using MPI_Wtime() 307 307 endwtime = MPI_Wtime() 308 308 … … 319 319 enddo 320 320 321 c======================================== End of main321 ! ======================================== End of main 322 322 CALL mpi_finalize(ierr) 323 323 -
main_p.f
r2ebb8b6 rbd2278d 1 c**************************************************************2 c3 cThis file contains the main (PARALLEL TEMPERING JOBS ONLY,4 CFOR SINGULAR PROCESSOR JOBS USE main)5 C6 CThis file contains also the subroutine: p_init_molecule7 c8 cCopyright 2003-2005 Frank Eisenmenger, U.H.E. Hansmann,9 cShura Hayryan, Chin-Ku10 cCopyright 2007 Frank Eisenmenger, U.H.E. Hansmann,11 cJan H. Meinke, Sandipan Mohanty12 c13 CCALLS init_energy,p_init_molecule,partem_p14 C15 c**************************************************************1 ! ************************************************************** 2 ! 3 ! This file contains the main (PARALLEL TEMPERING JOBS ONLY, 4 ! FOR SINGULAR PROCESSOR JOBS USE main) 5 ! 6 ! This file contains also the subroutine: p_init_molecule 7 ! 8 ! Copyright 2003-2005 Frank Eisenmenger, U.H.E. Hansmann, 9 ! Shura Hayryan, Chin-Ku 10 ! Copyright 2007 Frank Eisenmenger, U.H.E. Hansmann, 11 ! Jan H. Meinke, Sandipan Mohanty 12 ! 13 ! CALLS init_energy,p_init_molecule,partem_p 14 ! 15 ! ************************************************************** 16 16 program pmain 17 17 … … 28 28 logical newsta 29 29 30 cc Number of replicas30 !c Number of replicas 31 31 integer num_replica 32 cc Number of processors per replica32 !c Number of processors per replica 33 33 integer num_ppr 34 cc Range of processor for crating communicators34 !c Range of processor for crating communicators 35 35 integer proc_range(3) 36 cc Array of MPI groups36 !c Array of MPI groups 37 37 integer group(MAX_REPLICA), group_partem 38 cc Array of MPI communicators38 !c Array of MPI communicators 39 39 integer comm(MAX_REPLICA), partem_comm 40 cc Array of nodes acting as masters for the energy calculation.40 !c Array of nodes acting as masters for the energy calculation. 41 41 integer ranks(MAX_REPLICA) 42 cc Configuration switch42 !c Configuration switch 43 43 integer switch 44 44 integer rep_id 45 cset number of replicas45 ! set number of replicas 46 46 double precision eols(MAX_REPLICA) 47 47 … … 50 50 51 51 52 cMPI stuff, and random number generator initialisation52 ! MPI stuff, and random number generator initialisation 53 53 54 54 call mpi_init(ierr) … … 61 61 call sgrnd(seed) ! Initialize the random number generator 62 62 63 c=================================================== Energy setup63 ! =================================================== Energy setup 64 64 libdir='SMMP/' 65 cDirectory for SMMP libraries66 67 cThe switch in the following line is now not used.65 ! Directory for SMMP libraries 66 67 ! The switch in the following line is now not used. 68 68 flex=.false. ! .true. for Flex / .false. for ECEPP 69 69 70 cChoose energy type with the following switch instead ...70 ! Choose energy type with the following switch instead ... 71 71 ientyp = 0 72 c0 => ECEPP2 or ECEPP3 depending on the value of sh273 c1 => FLEX74 c2 => Lund force field75 c3 => ECEPP with Abagyan corrections76 c72 ! 0 => ECEPP2 or ECEPP3 depending on the value of sh2 73 ! 1 => FLEX 74 ! 2 => Lund force field 75 ! 3 => ECEPP with Abagyan corrections 76 ! 77 77 78 78 sh2=.false. ! .true. for ECEPP/2; .false. for ECEPP3 … … 87 87 call init_energy(libdir) 88 88 89 ccalculate CPU time using MPI_Wtime()89 ! calculate CPU time using MPI_Wtime() 90 90 startwtime = MPI_Wtime() 91 91 92 92 93 c================================================= Structure setup93 ! ================================================= Structure setup 94 94 grpn = 'nh2' ! N-terminal group 95 95 grpc = 'cooh' ! C-terminal group … … 121 121 ntlml = 0 122 122 123 cDecide if and when to use BGS, and initialize Lund data structures123 ! Decide if and when to use BGS, and initialize Lund data structures 124 124 bgsprob=0.6 ! Prob for BGS, given that it is possible 125 cupchswitch= 0 => No BGS 1 => BGS with probability bgsprob126 c2 => temperature dependent choice125 ! upchswitch= 0 => No BGS 1 => BGS with probability bgsprob 126 ! 2 => temperature dependent choice 127 127 upchswitch=1 128 128 rndord=.true. 129 129 if (ientyp.eq.2) call init_lundff 130 c=================================================================131 cDistribute nodes to parallel tempering tasks132 cI assume that the number of nodes available is an integer133 cmultiple n of the number of replicas. Each replica then gets n134 cprocessors to do its energy calculation.130 ! ================================================================= 131 ! Distribute nodes to parallel tempering tasks 132 ! I assume that the number of nodes available is an integer 133 ! multiple n of the number of replicas. Each replica then gets n 134 ! processors to do its energy calculation. 135 135 num_ppr = num_proc / num_replica 136 136 137 137 call mpi_comm_group(mpi_comm_world, group_world, error) 138 138 139 cThe current version doesn't require a separate variable j. I140 ccould just use i * num_ppr but this way it's more flexible.139 ! The current version doesn't require a separate variable j. I 140 ! could just use i * num_ppr but this way it's more flexible. 141 141 j = 0 142 142 do i = 1, num_replica … … 163 163 enddo 164 164 165 cSetup the communicator used for parallel tempering165 ! Setup the communicator used for parallel tempering 166 166 write (*,*) "PTGroup=", ranks(:num_replica) 167 167 call flush(6) … … 194 194 nml = 1 195 195 196 cRRRRRRRRRRMMMMMMMMMMMMSSSSSSSSSSDDDDDDDDDDDDD196 ! RRRRRRRRRRMMMMMMMMMMMMSSSSSSSSSSDDDDDDDDDDDDD 197 197 call rmsinit(nml,'EXAMPLES/1bdd.pdb') 198 cRRRRRRRRRRMMMMMMMMMMMMSSSSSSSSSSDDDDDDDDDDDDD198 ! RRRRRRRRRRMMMMMMMMMMMMSSSSSSSSSSDDDDDDDDDDDDD 199 199 200 200 ! READ REFERENCE CONTACT MAP … … 211 211 end do 212 212 213 c======================================== start of parallel tempering run213 ! ======================================== start of parallel tempering run 214 214 write (*,*) "There are ", no, 215 215 & " processors available for ",rep_id … … 220 220 call partem_p(num_replica, nequi, nswp, nmes, nsave, newsta, 221 221 & switch, rep_id, partem_comm) 222 c======================================== end of parallel tempering run223 ccalculate CPU time using MPI_Wtime()222 ! ======================================== end of parallel tempering run 223 ! calculate CPU time using MPI_Wtime() 224 224 endwtime = MPI_Wtime() 225 225 … … 236 236 enddo 237 237 238 c======================================== End of main238 ! ======================================== End of main 239 239 CALL mpi_finalize(ierr) 240 240 -
metropolis.f
r2ebb8b6 rbd2278d 1 c**************************************************************2 c 3 cThis file contains the subroutines: metropolis4 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: metropolis 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 metropolis(eol1,acz,dummy) 14 C 15 CSUBROUTINE FOR METROPOLIS UPDATE OF CONFIGURATIONS16 C 17 CCALLS: energy,addang,grnd,dummy (function provided as argument)18 C 14 ! 15 ! SUBROUTINE FOR METROPOLIS UPDATE OF CONFIGURATIONS 16 ! 17 ! CALLS: energy,addang,grnd,dummy (function provided as argument) 18 ! 19 19 include 'INCL.H' 20 20 include 'INCP.H' … … 25 25 integer updtch1, updtch2,bgs 26 26 double precision vrol(mxvr), gbol 27 cf2py intent(in, out) eol28 cf2py intent(in, out) acz27 !f2py intent(in, out) eol 28 !f2py intent(in, out) acz 29 29 eol = energy() 30 cexternal rand30 ! external rand 31 31 do nsw=1,nvr 32 cLoop over dihedrals33 c 32 ! Loop over dihedrals 33 ! 34 34 iupstate=0 35 35 iupt=1 … … 54 54 iupstate=bgs(eol,dummy) 55 55 else 56 cSimple twist of57 cGet Proposal configuration56 ! Simple twist of 57 ! Get Proposal configuration 58 58 vrol=vlvr!(jv) 59 59 dv=axvr(jv)*(grnd()-0.5) 60 60 vlvr(jv)=addang(vrol(jv),dv) 61 c 62 cGet dummy of proposal configuration63 c 61 ! 62 ! Get dummy of proposal configuration 63 ! 64 64 enw = energy() 65 c 65 ! 66 66 delta = dummy(enw) - dummy(eol) 67 c___________________________ check acceptance criteria67 ! ___________________________ check acceptance criteria 68 68 if (delta.le.0.0d0) then 69 69 eol=enw … … 90 90 end do 91 91 92 cUpdates on relative position of different molecules when there are many92 ! Updates on relative position of different molecules when there are many 93 93 if (ntlml.gt.1) then 94 94 do iml=1, ntlml … … 104 104 endif 105 105 endif 106 c107 cGet dummy of proposal configuration108 c106 ! 107 ! Get dummy of proposal configuration 108 ! 109 109 enw = energy() 110 c 110 ! 111 111 delta = dummy(enw) - dummy(eol) 112 c113 c____________________________ check acceptance criteria114 c112 ! 113 ! ____________________________ check acceptance criteria 114 ! 115 115 if (delta.le.0.0d0) then 116 116 eol=enw … … 138 138 gbpr(i, iml) = (grnd()-0.5) * pi2 139 139 endif 140 c141 cGet dummy of proposal configuration142 c140 ! 141 ! Get dummy of proposal configuration 142 ! 143 143 enw = energy() 144 c144 ! 145 145 delta = dummy(enw) - dummy(eol) 146 c147 c____________________________ check acceptance criteria148 c146 ! 147 ! ____________________________ check acceptance criteria 148 ! 149 149 if (delta.le.0.0d0) then 150 150 eol=enw … … 166 166 enddo 167 167 endif 168 c169 cRe-calculate energy170 c168 ! 169 ! Re-calculate energy 170 ! 171 171 enw = energy() 172 172 if(abs(eol-enw).gt.0.000001) then … … 176 176 endif 177 177 endif 178 c178 ! 179 179 eol1 = eol 180 180 return 181 c181 ! 182 182 end 183 183 -
mincjg.f
r2ebb8b6 rbd2278d 1 c**************************************************************2 c 3 cThis file contains the subroutines: mincjg4 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: mincjg 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 subroutine mincjg(n,mxn,x,f,g,acur,d,xa,ga,dt,yt,gt,maxfun,nfun) 12 12 13 c....................................................................14 c 15 cConjugate Gradient Minimizer16 c 17 cINPUT: X,F,G - variables, value of FUNC, gradient at START/18 cACUR - convergence is assumed if ACUR > SUM ( G(I)**2 )19 cMAXFUN - maximum overall number of function calls20 c 21 cOUTPUT: X,F,G - variables, value of FUNC, gradient at MINIMUM22 cNFUN - overall number of function calls used23 c 24 cARRAYS: D,XA,GA,YT,DT,GT - dimension N25 c 26 cCALLS: MOVE - calculate function & its gradients for current X27 c 28 cPARAMETERS: AMF - rough estimate of first reduction in F, used29 cto guess initial step of 1st line search30 cMXFCON - see 'ier=4'31 cMAXLIN -32 c 33 cDIAGNOSTICS (ier)34 c 35 c= 0: minimization completed successfully36 c= 1: number of steps reached MAXFUN37 c= 2: line search was abandoned38 c= 3: search direction is uphill39 c= 4: two consecutive line searches failed to reduce F40 c....................................................................13 ! .................................................................... 14 ! 15 ! Conjugate Gradient Minimizer 16 ! 17 ! INPUT: X,F,G - variables, value of FUNC, gradient at START/ 18 ! ACUR - convergence is assumed if ACUR > SUM ( G(I)**2 ) 19 ! MAXFUN - maximum overall number of function calls 20 ! 21 ! OUTPUT: X,F,G - variables, value of FUNC, gradient at MINIMUM 22 ! NFUN - overall number of function calls used 23 ! 24 ! ARRAYS: D,XA,GA,YT,DT,GT - dimension N 25 ! 26 ! CALLS: MOVE - calculate function & its gradients for current X 27 ! 28 ! PARAMETERS: AMF - rough estimate of first reduction in F, used 29 ! to guess initial step of 1st line search 30 ! MXFCON - see 'ier=4' 31 ! MAXLIN - 32 ! 33 ! DIAGNOSTICS (ier) 34 ! 35 ! = 0: minimization completed successfully 36 ! = 1: number of steps reached MAXFUN 37 ! = 2: line search was abandoned 38 ! = 3: search direction is uphill 39 ! = 4: two consecutive line searches failed to reduce F 40 ! .................................................................... 41 41 42 42 implicit real*8 (a-h,o-z) … … 44 44 45 45 parameter (AMF = 10.d0, 46 #MXFCON = 2,47 #MAXLIN = 5,48 #TOL = 1.d-7, ! controls 'stepch'49 #EPS = .7d0)46 & MXFCON = 2, 47 & MAXLIN = 5, 48 & TOL = 1.d-7, ! controls 'stepch' 49 & EPS = .7d0) 50 50 51 51 dimension x(mxn),g(mxn), 52 #d(mxn),xa(mxn),ga(mxn),dt(mxn),yt(mxn),gt(mxn)52 & d(mxn),xa(mxn),ga(mxn),dt(mxn),yt(mxn),gt(mxn) 53 53 54 54 … … 154 154 155 155 if ( nfun .gt. (nfbeg + 1) .or. 156 #abs(gdmi/gdit) .gt. EPS ) then156 & abs(gdmi/gdit) .gt. EPS ) then 157 157 158 158 ier=2 … … 205 205 206 206 if ( (gdmi * gspln) .lt. 0.d0 ) stepch = stepch * gdmi / 207 #(gdmi - gspln)207 & (gdmi - gspln) 208 208 209 209 goto 2 … … 242 242 243 243 if (iterrs .ne. 0 .and. (iter - iterrs) .lt. (n-1) .and. 244 #abs(sum) .lt. gsq2 ) then244 & abs(sum) .lt. gsq2 ) then 245 245 246 246 gama = 0.d0 -
minim.f
r2ebb8b6 rbd2278d 1 c**************************************************************2 c 3 cThis file contains the subroutines: minim,move4 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: minim,move 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 minim(imin, maxit, eps) 14 14 15 c......................................................................16 cPURPOSE: Use minimizers17 c 18 cimin = 1: use Quasi-Newton19 cimin = 2: use Conjugated Gradients20 c 21 c@param maxit maximum number of iterations22 c@param eps acceptance criterium23 cInstitute24 cCALLS: difang,energy,gradient, mincjg,minqsn, nursvr25 c......................................................................15 ! ...................................................................... 16 ! PURPOSE: Use minimizers 17 ! 18 ! imin = 1: use Quasi-Newton 19 ! imin = 2: use Conjugated Gradients 20 ! 21 ! @param maxit maximum number of iterations 22 ! @param eps acceptance criterium 23 !Institute 24 ! CALLS: difang,energy,gradient, mincjg,minqsn, nursvr 25 ! ...................................................................... 26 26 27 27 include 'INCL.H' 28 cf2py intent(in) imin29 cf2py intent(in) maxit30 cf2py intent(in) eps28 !f2py intent(in) imin 29 !f2py intent(in) maxit 30 !f2py intent(in) eps 31 31 parameter (msvmx=mxvr*(mxvr+5)/(2*(2*mxvr+1)), 32 #msv = 50 )32 & msv = 50 ) 33 33 34 34 dimension w(mxvr*(mxvr+13)/2) … … 36 36 dimension vlvrn(mxvr),vlvro(mxvr),gdvr(mxvr),scl(mxvr) 37 37 38 c--------------------------- new38 ! --------------------------- new 39 39 dimension gbpro(6,mxml) 40 40 … … 47 47 endif 48 48 49 c----------------------- energy & gradient49 ! ----------------------- energy & gradient 50 50 51 51 call gradient() … … 56 56 57 57 write (*,'(a,e12.5,/,3(a,e11.4),/,2(a,e11.4),/)') ' Total: ', 58 #eysm,59 #' Coulomb: ',eyel,' Lennard-Jones: ',eyvw,' HB: ',eyhb,60 #' Variables: ',eyvr,' Solvatation: ',eysl58 & eysm, 59 & ' Coulomb: ',eyel,' Lennard-Jones: ',eyvw,' HB: ',eyhb, 60 & ' Variables: ',eyvr,' Solvatation: ',eysl 61 61 62 62 else … … 64 64 65 65 write (*,'(a,e12.5,/,3(a,e11.4),/,3(a,e11.4),/)') ' Total: ', 66 #wtey*eysm + wtrg*eyrg,67 #' Coulomb: ',eyel,' Lennard-Jones: ',eyvw,' HB: ',eyhb,68 #' Variables: ',eyvr,' Solvatation: ',eysl,69 #' Regularization: ',eyrg66 & wtey*eysm + wtrg*eyrg, 67 & ' Coulomb: ',eyel,' Lennard-Jones: ',eyvw,' HB: ',eyhb, 68 & ' Variables: ',eyvr,' Solvatation: ',eysl, 69 & ' Regularization: ',eyrg 70 70 71 71 endif 72 72 73 c--------------------------------------- variables73 ! --------------------------------------- variables 74 74 75 75 ntlvr=ivrml1(ntlml)+nvrml(ntlml)-1 … … 129 129 enddo 130 130 131 cif (abs(wtrg-1.d0).gt.1.d-4.and.abs(wtey-1.d0).gt.1.d-4) then132 cgdey2 = max(acc,gdey2)133 cgdrg2 = max(acc,gdrg2)134 cwtrg = wtrg * sqrt(gdey2/gdrg2)135 cwrite(*,*) ' --> Wt_energy = ',wtey,' Wt_regul. = ',wtrg136 cwrite(*,*) ' '137 cendif131 ! if (abs(wtrg-1.d0).gt.1.d-4.and.abs(wtey-1.d0).gt.1.d-4) then 132 ! gdey2 = max(acc,gdey2) 133 ! gdrg2 = max(acc,gdrg2) 134 ! wtrg = wtrg * sqrt(gdey2/gdrg2) 135 ! write(*,*) ' --> Wt_energy = ',wtey,' Wt_regul. = ',wtrg 136 ! write(*,*) ' ' 137 ! endif 138 138 139 139 esm=wtey*eysm+wtrg*eyrg … … 152 152 153 153 call minqsn(n,mxvr,vlvrn,esm,gdvr,scl,acc,w,w(n1),w(n2), 154 #w(n3),w(n4),w(n5),w(n6),mxop,nop)154 & w(n3),w(n4),w(n5),w(n6),mxop,nop) 155 155 156 156 elseif (imin.eq.2) then ! Conjugated Gradients … … 163 163 164 164 call mincjg(n,mxvr,vlvrn,esm,gdvr,acc,w,w(n1),w(n2), ! no 'scl' 165 #w(n3),w(n4),w(n5),mxop,nop)165 & w(n3),w(n4),w(n5),mxop,nop) 166 166 167 167 endif … … 176 176 177 177 write (*,'(/,2a,/)') ' Final energies ', 178 #'__________________________________________________'178 & '__________________________________________________' 179 179 180 180 eysm = energy() … … 183 183 184 184 write (*,'(a,e12.5,/,3(a,e11.4),/,2(a,e11.4))') ' Total: ',eysm, 185 #' Coulomb: ',eyel,' Lennard-Jones: ',eyvw,' HB: ',eyhb,186 #' Variables: ',eyvr,' Solvatation: ',eysl185 & ' Coulomb: ',eyel,' Lennard-Jones: ',eyvw,' HB: ',eyhb, 186 & ' Variables: ',eyvr,' Solvatation: ',eysl 187 187 188 188 else 189 189 190 190 write (*,'(a,e12.5,/,3(a,e11.4),/,3(a,e11.4))') ' Total: ', 191 #wtey*eysm + wtrg*eyrg,192 #' Coulomb: ',eyel,' Lennard-Jones: ',eyvw,' HB: ',eyhb,193 #' Variables: ',eyvr,' Solvatation: ',eysl,194 #' Regularization: ',eyrg191 & wtey*eysm + wtrg*eyrg, 192 & ' Coulomb: ',eyel,' Lennard-Jones: ',eyvw,' HB: ',eyhb, 193 & ' Variables: ',eyvr,' Solvatation: ',eysl, 194 & ' Regularization: ',eyrg 195 195 196 196 endif … … 207 207 208 208 write (*,'(1x,a,1x,i4,f8.1,a,f5.1,a)') nmvr(i),nursvr(i), 209 #vr*crd,' (',abs(difang(vr,vlvro(i)))*crd,')'209 & vr*crd,' (',abs(difang(vr,vlvro(i)))*crd,')' 210 210 211 211 vlvr(i) = vr … … 231 231 232 232 write (*,'(/,2a)') ' Gradient ', 233 #'______________________________________________________________'233 & '______________________________________________________________' 234 234 235 235 write (*,'(8(1x,f8.3))') (gdvr(i),i=1,nv) … … 244 244 return 245 245 end 246 c********************************************246 ! ******************************************** 247 247 subroutine move(nop,nvr1,esm,vlvrn,gdvr) 248 c 249 cCALLS: gradient250 c 248 ! 249 ! CALLS: gradient 250 ! 251 251 include 'INCL.H' 252 252 … … 254 254 255 255 256 c------------------------ compile & new variables256 ! ------------------------ compile & new variables 257 257 258 258 ntlvr=ivrml1(ntlml)+nvrml(ntlml)-1 … … 278 278 endif 279 279 280 c-------------------------- new minimz. gradient280 ! -------------------------- new minimz. gradient 281 281 282 282 call gradient() … … 309 309 310 310 write (*,'(a,i5,a,2(e13.6,a))') ' Step ',nop,': energy ',esm 311 #,' (',gdsmey,' )'311 & ,' (',gdsmey,' )' 312 312 313 313 else … … 328 328 329 329 write (*,'(a,i5,a,3(e13.6,a))') ' Step ',nop,': energy ',esm 330 #,' (',gdsmey,',',gdsmrg,' )'330 & ,' (',gdsmey,',',gdsmrg,' )' 331 331 332 332 endif -
minqsn.f
r2ebb8b6 rbd2278d 1 c**************************************************************2 c 3 cThis file contains the subroutines: minqsn,mc11a,mc11e4 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: minqsn,mc11a,mc11e 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 subroutine minqsn(n,mxn,x,f,g,scal,acur,h,d,w,xa,ga,xb,gb,maxfun, 13 #nfun)14 15 c.............................................................16 cPURPOSE: Quasi-Newton minimizer17 c 18 cUnconstrained local minimization of function FUNC19 cvs. N variables by quasi-Newton method using BFGS-20 cformula to update hessian matrix; approximate line21 csearches performed using cubic extra-/interpolation22 c[see Gill P.E., Murray W., Wright M.H., Practical23 cOptimization, Ch. 2.2.5.7, 4.3.2.1 ff.,4.4.2.2.,24 c4.5.2.1]25 c 26 cINPUT: X,F,G - variables, value of FUNC, gradient at START27 cSCAL - factors to reduce(increase) initial step &28 cits lower bound for line searches, diagonal29 celements of initial hessian matrix30 cMXN - maximal overall number of function calls31 c 32 cOUTPUT: X,F,G - variables, value of FUNC, gradient at MINIMUM33 cNFUN - overall number of function calls used34 c35 cARRAYS: H - approximate hessian matrix in symmetric storage36 c(dimension N(N+1)/2)37 cW,D,XA,XB,GA,GB - dimension N38 c 39 cCALLS: MOVE - external to calculate function for current X40 cand its gradients41 cMC11E- solve system H*D=-G for search direction D, where42 cH is given in Cholesky-factorization43 cMC11A- update H using BFGS formula, factorizise new H44 caccording to Cholesky (modified to maintain its45 cpositive definiteness)46 c 47 cPARAMETERS:48 c49 cEPS1 - checks reduction of FUNC during line search50 c( 0.0001 <= EPS1 < 0.5 )51 cEPS2 - controls accuracy of line search (reduce to increase52 caccuracy; EPS1 < EPS2 <= 0.9 )53 cACUR - fractional precision for determination of variables54 c(should not be smaller than sqrt of machine accuracy)55 cTINY - prevent division by zero during cubic extrapolation56 c.............................................................13 & nfun) 14 15 ! ............................................................. 16 ! PURPOSE: Quasi-Newton minimizer 17 ! 18 ! Unconstrained local minimization of function FUNC 19 ! vs. N variables by quasi-Newton method using BFGS- 20 ! formula to update hessian matrix; approximate line 21 ! searches performed using cubic extra-/interpolation 22 ! [see Gill P.E., Murray W., Wright M.H., Practical 23 ! Optimization, Ch. 2.2.5.7, 4.3.2.1 ff.,4.4.2.2., 24 ! 4.5.2.1] 25 ! 26 ! INPUT: X,F,G - variables, value of FUNC, gradient at START 27 ! SCAL - factors to reduce(increase) initial step & 28 ! its lower bound for line searches, diagonal 29 ! elements of initial hessian matrix 30 ! MXN - maximal overall number of function calls 31 ! 32 ! OUTPUT: X,F,G - variables, value of FUNC, gradient at MINIMUM 33 ! NFUN - overall number of function calls used 34 ! 35 ! ARRAYS: H - approximate hessian matrix in symmetric storage 36 ! (dimension N(N+1)/2) 37 ! W,D,XA,XB,GA,GB - dimension N 38 ! 39 ! CALLS: MOVE - external to calculate function for current X 40 ! and its gradients 41 ! MC11E- solve system H*D=-G for search direction D, where 42 ! H is given in Cholesky-factorization 43 ! MC11A- update H using BFGS formula, factorizise new H 44 ! according to Cholesky (modified to maintain its 45 ! positive definiteness) 46 ! 47 ! PARAMETERS: 48 ! 49 ! EPS1 - checks reduction of FUNC during line search 50 ! ( 0.0001 <= EPS1 < 0.5 ) 51 ! EPS2 - controls accuracy of line search (reduce to increase 52 ! accuracy; EPS1 < EPS2 <= 0.9 ) 53 ! ACUR - fractional precision for determination of variables 54 ! (should not be smaller than sqrt of machine accuracy) 55 ! TINY - prevent division by zero during cubic extrapolation 56 ! ............................................................. 57 57 58 58 implicit real*8 (a-h,o-z) … … 60 60 61 61 parameter ( eps1=0.1d0, 62 #eps2=0.7d0,63 #tiny=1.d-32,64 65 #zero=0.d0,66 #izero=0,67 #ione=1 )62 & eps2=0.7d0, 63 & tiny=1.d-32, 64 65 & zero=0.d0, 66 & izero=0, 67 & ione=1 ) 68 68 69 69 dimension x(mxn),g(mxn),scal(mxn),h(mxn*(mxn+1)/2),d(mxn),w(mxn), 70 #xa(mxn),ga(mxn),xb(mxn),gb(mxn)70 & xa(mxn),ga(mxn),xb(mxn),gb(mxn) 71 71 72 72 nfun=0 73 73 itr=0 74 74 dff=0. 75 c_______________ hessian to a diagonal matrix depending on scale75 ! _______________ hessian to a diagonal matrix depending on scale 76 76 c=0. 77 77 do i=1,n … … 102 102 2 itr=itr+1 ! Start New Line-search from A 103 103 104 c______________ search direction of the iteration104 ! ______________ search direction of the iteration 105 105 do i=1,n 106 106 d(i)=-ga(i) … … 126 126 steplb=acur*c ! lower bound on step 127 127 128 c________________________ initial step of the line search128 ! ________________________ initial step of the line search 129 129 if (dff.gt.0.) then 130 130 step=min(1.d0,(dff+dff)/(-dga)) … … 134 134 135 135 3 if (nfun.ge.maxfun) then 136 cc write (*,*) ' minfor> exceeded max. number of function calls'136 !c write (*,*) ' minfor> exceeded max. number of function calls' 137 137 return 138 138 endif … … 159 159 if (gl2.ge.gl1) goto 4 160 160 endif 161 c______________ store function value if it is smallest so far161 ! ______________ store function value if it is smallest so far 162 162 f=fb 163 163 do i=1,n … … 182 182 stepub=stepub-step ! new upper bound on step 183 183 184 c_______________________________ next step by extrapolation184 ! _______________________________ next step by extrapolation 185 185 if (stepub.gt.0.) then 186 186 step=.5*stepub … … 244 244 return 245 245 end 246 c***********************************************246 ! *********************************************** 247 247 subroutine mc11a(a,n,mxn,z,sig,w,ir,mk,eps) 248 c 249 cCALLS: none250 c 248 ! 249 ! CALLS: none 250 ! 251 251 implicit real*8 (a-h,o-z) 252 252 implicit integer*4 (i-n) … … 368 368 return 369 369 end 370 c************************************370 ! ************************************ 371 371 subroutine mc11e(a,n,mxn,z,w,ir) 372 c 373 cCALLS: none374 c 372 ! 373 ! CALLS: none 374 ! 375 375 implicit real*8 (a-h,o-z) 376 376 implicit integer*4 (i-n) -
mklist.f
r2ebb8b6 rbd2278d 1 c**************************************************************2 c 3 cThis file contains the subroutines: mklist,quench4 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: mklist,quench 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 subroutine mklist(nml) 13 13 14 c......................................................................15 cPURPOSE: Compile interaction lists ('1-4' according to Scheraga)16 c 17 cCALLS: quench18 c......................................................................19 cTODO: Calculate van-der-Waals regions over all molecules.14 ! ...................................................................... 15 ! PURPOSE: Compile interaction lists ('1-4' according to Scheraga) 16 ! 17 ! CALLS: quench 18 ! ...................................................................... 19 ! TODO: Calculate van-der-Waals regions over all molecules. 20 20 include 'INCL.H' 21 21 22 22 parameter (mxh=50, ! max. # of atom regions 23 #mx2=50)23 & mx2=50) 24 24 25 25 logical ovlp,quench 26 26 27 27 dimension l1st1(mxh),l1st2(mxh),l2nd1(mxh),l2nd2(mxh) 28 #,l1i(mxbd),l2i(mx2)29 30 c_______________________ indices of 1st vdw-region/14-partner for 'nml'28 & ,l1i(mxbd),l2i(mx2) 29 30 ! _______________________ indices of 1st vdw-region/14-partner for 'nml' 31 31 if (nml.eq.1) then 32 32 ivwml1(1)=1 … … 40 40 if (ntlms.eq.0) then 41 41 write (*,'(a,i4)') 42 #' mklist> No mov. sets defined in molecule #',nml42 & ' mklist> No mov. sets defined in molecule #',nml 43 43 nvwml(nml)=0 44 44 n14ml(nml)=0 … … 48 48 nvw=ivwml1(nml)-1 ! # of vdw-regions we have so far 49 49 n14=i14ml1(nml)-1 ! # of 14-partners -"- 50 cFirst atom in molecule50 ! First atom in molecule 51 51 ifiat=iatrs1(irsml1(nml)) 52 cLast atom in molecule52 ! Last atom in molecule 53 53 ilaat=iatrs2(irsml2(nml)) 54 cFirst variable in molecule54 ! First variable in molecule 55 55 ifivr=ivrml1(nml) 56 cLast variable in molecule56 ! Last variable in molecule 57 57 ilavr=ifivr+nvrml(nml)-1 58 c____________________________ initialize: 1st vdw-region & 14-partner per atom58 ! ____________________________ initialize: 1st vdw-region & 14-partner per atom 59 59 do i=ifiat,ilaat 60 60 ivwat1(i)=0 !!! for some atoms ... … … 74 74 if ((i2s-i1s+1).gt.0) then 75 75 76 c____________ exclude mov.sets of var. 'iv' from 1ST list of interact.partn.76 ! ____________ exclude mov.sets of var. 'iv' from 1ST list of interact.partn. 77 77 do is=i1s,i2s 78 78 ovlp=quench(latms1(is),latms2(is),n1st,mxh,l1st1,l1st2) 79 79 enddo 80 c_______________________________ intitialize 2ND list with current 1ST list80 ! _______________________________ intitialize 2ND list with current 1ST list 81 81 do i=1,n1st 82 82 l2nd1(i)=l1st1(i) … … 84 84 enddo 85 85 n2nd=n1st 86 c_________________________________ exclude 'ib' of var. 'iv' from 2ND list86 ! _________________________________ exclude 'ib' of var. 'iv' from 2ND list 87 87 ib=iowat(iatvr(iv)) 88 88 ovlp=quench(ib,ib,n2nd,mxh,l2nd1,l2nd2) … … 94 94 ovlp=quench(iob,iob,n2nd,mxh,l2nd1,l2nd2) ! & in 2ND list 95 95 96 c_____ atoms branching from 'iob': into GENERAL list of 1-4 partners96 ! _____ atoms branching from 'iob': into GENERAL list of 1-4 partners 97 97 do i=1,nbdat(iob) 98 98 ibd=ibdat(i,iob) 99 99 if (ibd.ne.ib.and.iowat(ibd).eq.iob.and. 100 #quench(ibd,ibd,n2nd,mxh,l2nd1,l2nd2) ) then100 & quench(ibd,ibd,n2nd,mxh,l2nd1,l2nd2) ) then 101 101 n2i=n2i+1 102 102 if (n2i.gt.mx2) then 103 103 write (*,'(a,i3,2a)') ' mklist> Molecule # ',nml, 104 #': too many atoms bound to ',nmat(iob)104 & ': too many atoms bound to ',nmat(iob) 105 105 stop 106 106 endif … … 108 108 endif 109 109 enddo ! ... branches of 'iob' 110 c____________________________ check for further '1-4' partners111 cconnected to branches 'l2i'110 ! ____________________________ check for further '1-4' partners 111 ! connected to branches 'l2i' 112 112 do i=1,n2i 113 113 ia=l2i(i) … … 116 116 do j=latms1(im),latms2(im) 117 117 if (ia.ne.j.and. 118 #quench(j,j,n2nd,mxh,l2nd1,l2nd2) ) then118 & quench(j,j,n2nd,mxh,l2nd1,l2nd2) ) then 119 119 n2i=n2i+1 120 120 if (n2i.gt.mx2) then 121 121 write (*,'(a,i3,a)') ' mklist> Molecule # ' 122 #,nml,': too many atoms in list L2I'122 & ,nml,': too many atoms in list L2I' 123 123 stop 124 124 endif … … 129 129 enddo 130 130 131 c____ If 'iow(iob)' exists and in 2ND list: into GENERAL list of 1-4 partners131 ! ____ If 'iow(iob)' exists and in 2ND list: into GENERAL list of 1-4 partners 132 132 ioiob=iowat(iob) ! existence of iow( iow(base) ) 133 133 if (ioiob.gt.0) then … … 136 136 if (n2i.gt.mx2) then 137 137 write (*,'(a,i3,2a)') ' mklist> Molecule # ' 138 #,nml,': too many atoms bound to ',nmat(iob)138 & ,nml,': too many atoms bound to ',nmat(iob) 139 139 stop 140 140 endif … … 150 150 endif 151 151 152 c______ Atoms bound to 'ib' & in 2ND list(=are NOT in m.s of 'iv'):153 cexclude from 2ND list & put in list 'l1i'152 ! ______ Atoms bound to 'ib' & in 2ND list(=are NOT in m.s of 'iv'): 153 ! exclude from 2ND list & put in list 'l1i' 154 154 n1i=0 155 155 do i=1,nbdat(ib) 156 156 ibd=ibdat(i,ib) 157 157 if (iowat(ibd).eq.ib.and. 158 #quench(ibd,ibd,n2nd,mxh,l2nd1,l2nd2) ) then158 & quench(ibd,ibd,n2nd,mxh,l2nd1,l2nd2) ) then 159 159 n1i=n1i+1 160 160 if (n1i.gt.mxbd) then 161 161 write (*,'(a,i3,2a)') ' mklist> Molecule # ',nml, 162 #': too many atoms bound to ',nmat(ib)162 & ': too many atoms bound to ',nmat(ib) 163 163 stop 164 164 endif 165 165 l1i(n1i)=ibd 166 c_______ add atoms branching from 'l1i'-atoms to GENERAL list 1-4 partners166 ! _______ add atoms branching from 'l1i'-atoms to GENERAL list 1-4 partners 167 167 do j=1,nbdat(ibd) 168 168 jbd=ibdat(j,ibd) 169 169 if (iowat(jbd).eq.ibd.and. 170 #quench(jbd,jbd,n2nd,mxh,l2nd1,l2nd2) ) then170 & quench(jbd,jbd,n2nd,mxh,l2nd1,l2nd2) ) then 171 171 n2i=n2i+1 172 172 if (n2i.gt.mx2) then 173 173 write (*,'(a,i3,2a)') ' mklist> Molecule # ',nml, 174 #': too many atoms bound to branches of ',nmat(ib)174 & ': too many atoms bound to branches of ',nmat(ib) 175 175 stop 176 176 endif … … 180 180 endif 181 181 enddo 182 c_____________________________ check for further '1-4' partners183 cbelonging to moving set of base 'ib'182 ! _____________________________ check for further '1-4' partners 183 ! belonging to moving set of base 'ib' 184 184 im=ixmsat(ib) 185 185 if (im.gt.0) then … … 189 189 if (n2i.gt.mx2) then 190 190 write (*,'(a,i3,a)') ' mklist> Molecule # ',nml, 191 #': too many atoms n list L2I '191 & ': too many atoms n list L2I ' 192 192 stop 193 193 endif … … 199 199 do is=i1s,i2s 200 200 do i=latms1(is),latms2(is) ! ============= atoms in m.s of 'iv' 201 c________________________________________ Current 2ND list -> VdW-interact.201 ! ________________________________________ Current 2ND list -> VdW-interact. 202 202 if ((nvw+n2nd).gt.mxvw) then 203 203 write (*,'(a,i4,a,i5)') ' mklist> Molecule # ',nml, 204 #': Number of vdw-domains > ',mxvw204 & ': Number of vdw-domains > ',mxvw 205 205 stop 206 206 endif … … 213 213 lvwat2(nvw)=l2nd2(j) 214 214 enddo ! ... vdW-domains 215 c_________________________________________ General list of 1-4 partners215 ! _________________________________________ General list of 1-4 partners 216 216 if ((n14+n2i).gt.mx14) goto 1 217 217 i14at1(i)=n14+1 … … 221 221 l14at(n14)=l2i(j) 222 222 enddo 223 c__________________________________ Special cases of 1-4 interactions224 c(list l1i, atoms iob,ib)223 ! __________________________________ Special cases of 1-4 interactions 224 ! (list l1i, atoms iob,ib) 225 225 iow=iowat(i) 226 226 if (iow.ne.ib) then … … 253 253 nvwml(nml)=nvw-ivwml1(nml)+1 254 254 n14ml(nml)=n14-i14ml1(nml)+1 255 c_________________________________ some cleaning up255 ! _________________________________ some cleaning up 256 256 do i=ifiat,ilaat 257 257 if (ivwat1(i).le.0) then … … 265 265 enddo 266 266 267 c____________________________________________ Summary268 cdo i=ifiat,ilaat269 cwrite (*,'(3a,i5,a)') ' ######## atom ',nmat(i),'(',i,')'270 civ1=ivwat1(i)271 civ2=ivwat2(i)272 cif (iv1.le.iv2) then273 cwrite(*,'(a)') ' ---> vdW :'274 cdo j=iv1,iv2275 cwrite (*,'(i5,a,i5)') lvwat1(j),'-',lvwat2(j)276 cenddo277 cendif278 ci41=i14at1(i)279 ci42=i14at2(i)280 cif (i41.le.i42) then281 cwrite(*,'(a)') ' ---> 1-4 :'282 cwrite(*,'(10i5)') (l14at(j),j=i41,i42)283 cendif284 cenddo267 ! ____________________________________________ Summary 268 ! do i=ifiat,ilaat 269 ! write (*,'(3a,i5,a)') ' ######## atom ',nmat(i),'(',i,')' 270 ! iv1=ivwat1(i) 271 ! iv2=ivwat2(i) 272 ! if (iv1.le.iv2) then 273 ! write(*,'(a)') ' ---> vdW :' 274 ! do j=iv1,iv2 275 ! write (*,'(i5,a,i5)') lvwat1(j),'-',lvwat2(j) 276 ! enddo 277 ! endif 278 ! i41=i14at1(i) 279 ! i42=i14at2(i) 280 ! if (i41.le.i42) then 281 ! write(*,'(a)') ' ---> 1-4 :' 282 ! write(*,'(10i5)') (l14at(j),j=i41,i42) 283 ! endif 284 ! enddo 285 285 286 286 return 287 287 288 288 1 write (*,'(a,i4,a,i5)') ' mklist> Molecule # ',nml, 289 #': Number of 1-4 interactions > ',mx14289 & ': Number of 1-4 interactions > ',mx14 290 290 stop 291 291 end 292 c*********************************************292 ! ********************************************* 293 293 logical function quench(i1,i2,n,mx,l1,l2) 294 294 295 c....................................................296 cPURPOSE: Correct size/number (n) of index ranges297 cgiven by lists 'l1' & 'l2' in order to298 cEXCLUDE overlaps with range 'i1-i2'299 c 300 cquench = true, if any overlap was obtained301 c 302 cCALLS: none303 c 304 c....................................................295 ! .................................................... 296 ! PURPOSE: Correct size/number (n) of index ranges 297 ! given by lists 'l1' & 'l2' in order to 298 ! EXCLUDE overlaps with range 'i1-i2' 299 ! 300 ! quench = true, if any overlap was obtained 301 ! 302 ! CALLS: none 303 ! 304 ! .................................................... 305 305 306 306 implicit integer*4 (i-n) -
mulcan_par.f
r2ebb8b6 rbd2278d 5 5 ! Copyright 2003-2005 Frank Eisenmenger, U.H.E. Hansmann, 6 6 ! Shura Hayryan, Chin-Ku 7 cCopyright 2007 Frank Eisenmenger, U.H.E. Hansmann,8 cJan H. Meinke, Sandipan Mohanty7 ! Copyright 2007 Frank Eisenmenger, U.H.E. Hansmann, 8 ! Jan H. Meinke, Sandipan Mohanty 9 9 ! 10 10 ! ************************************************************** -
mulcan_sim.f
r2ebb8b6 rbd2278d 1 c**************************************************************2 c 3 cThis file contains the subroutines: mulcan_sim,muca_weight24 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: mulcan_sim,muca_weight2 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 subroutine mulcan_sim 13 C 14 CPURPOSE: PERFORM A MULTICANONICAL SIMULATION15 CREQUIRES AS INPUT THE MULTICANONICAL PARAMETER AS CALCULATED16 CBY THE SUBROUTINE mulcan_par17 C 18 cCALLS: addang, contacts,energy,metropolis19 c 13 ! 14 ! PURPOSE: PERFORM A MULTICANONICAL SIMULATION 15 ! REQUIRES AS INPUT THE MULTICANONICAL PARAMETER AS CALCULATED 16 ! BY THE SUBROUTINE mulcan_par 17 ! 18 ! CALLS: addang, contacts,energy,metropolis 19 ! 20 20 include 'INCL.H' 21 21 22 cexternal rand22 ! external rand 23 23 external muca_weight2 24 24 … … 29 29 parameter(nsweep=100000,nequi=100) 30 30 Parameter(nsave=1000,nmes=10) 31 C 32 Crestart: .true. = restart of simulation33 C.false. = start of simulation with random configuration34 Ckmin,kmax: Range of multicanonical parameter35 Cebin: bin size for multicanonical parameter36 Cnequi: Number of sweeps for equilibrisation37 Cnsweep: Number of sweeps for simulation run38 Cnsave: Number of sweeps after which actual configuration is saved39 Cfor re-starts40 Cnmes: Number of sweeps between measurments41 C 31 ! 32 ! restart: .true. = restart of simulation 33 ! .false. = start of simulation with random configuration 34 ! kmin,kmax: Range of multicanonical parameter 35 ! ebin: bin size for multicanonical parameter 36 ! nequi: Number of sweeps for equilibrisation 37 ! nsweep: Number of sweeps for simulation run 38 ! nsave: Number of sweeps after which actual configuration is saved 39 ! for re-starts 40 ! nmes: Number of sweeps between measurments 41 ! 42 42 43 43 dimension xhist(kmin:kmax),ihist(kmin:kmax) … … 45 45 46 46 47 CFILE with last conformation (for re-starts)47 ! FILE with last conformation (for re-starts) 48 48 open(8,file='EXAMPLES/start.d') 49 CFile with contact map of reference configuration49 ! File with contact map of reference configuration 50 50 open(9,file='EXAMPLES/enkefa.ref') 51 CFile with multicanonical parameter51 ! File with multicanonical parameter 52 52 open(10,file='EXAMPLES/muca.d') 53 CResult file: Time series of certain quantities53 ! Result file: Time series of certain quantities 54 54 open(11, file='EXAMPLES/time.d') 55 55 … … 60 60 61 61 nresi=irsml2(1)-irsml1(1) + 1 62 cnresi: Number of residues63 64 CREAD REFERENCE CONTACT MAP62 ! nresi: Number of residues 63 64 ! READ REFERENCE CONTACT MAP 65 65 nci = 0 66 66 do i=1,nresi … … 74 74 write(*,*) 'Number of contacts in reference conformation:',nci 75 75 76 CREAD IN FIELDS WITH MULTICANONICAL PARAMETER76 ! READ IN FIELDS WITH MULTICANONICAL PARAMETER 77 77 Do j=kmin,kmax 78 78 read(10,*) i,b(i),alpha(i) 79 79 end do 80 C 80 ! 81 81 82 82 if(restart) then … … 90 90 write(*,*) 'Last iteration, energy:',nswm,eol_old 91 91 else 92 c_________________________________ random start92 ! _________________________________ random start 93 93 do i=1,nvr 94 94 iv=idvr(i) ! provides index of non-fixed variable … … 98 98 enddo 99 99 end if 100 c 100 ! 101 101 eol = energy() 102 102 write (*,'(e12.5,/)') eol … … 109 109 end do 110 110 write(*,*) 111 C 111 ! 112 112 113 113 114 114 if(.not.restart) then 115 c=====================Equilibrization by Metropolis115 ! =====================Equilibrization by Metropolis 116 116 do nsw=1,nequi 117 117 call metropolis(eol,acz,muca_weight2) … … 123 123 end if 124 124 125 C======================Simulation125 !======================Simulation 126 126 acz = 0.0d0 127 CLOOP OVER SWEEPS127 ! LOOP OVER SWEEPS 128 128 do nsw=nswm,nsweep 129 C 130 CMETROPOLIS UPDATE129 ! 130 ! METROPOLIS UPDATE 131 131 call metropolis(eol,acz,muca_weight2) 132 132 muold = min(kmax,max(kmin,int(eol/ebin+sign(0.5d0,eol)))) 133 133 ihist(muold) = ihist(muold) + 1 134 C 135 CSAVE ACTUAL CONFORMATIONS FOR RE-STARTS:134 ! 135 ! SAVE ACTUAL CONFORMATIONS FOR RE-STARTS: 136 136 if(mod(nsw,nsave).eq.0) then 137 137 rewind 8 … … 143 143 end do 144 144 end if 145 CMeasurements after NMES sweeps145 ! Measurements after NMES sweeps 146 146 if(mod(nsw,nmes).eq.0) then 147 CTake a histogram of energy147 ! Take a histogram of energy 148 148 do i=kmin,kmax 149 149 xhist(i) = xhist(i) + ihist(i) 150 150 ihist(i) = 0 151 151 end do 152 cCalculate contacts in actual configuartion and compare with reference153 Cconfiguration154 ccall contacts(nhx,nhy,dham)155 Cnhx : Number of contcats in actual conformation156 Cnhy : Number of contacts which are identical in actual and reference157 Cconfiguration158 Cdham: Hamming distance between actual and reference configuration159 C 152 ! Calculate contacts in actual configuartion and compare with reference 153 ! configuration 154 ! call contacts(nhx,nhy,dham) 155 ! nhx : Number of contcats in actual conformation 156 ! nhy : Number of contacts which are identical in actual and reference 157 ! configuration 158 ! dham: Hamming distance between actual and reference configuration 159 ! 160 160 write(11,'(i7,f12.2,2i8,f12.4)') nsw,eol,nhx,nhy,dham 161 161 end if 162 162 end do 163 CEND OF SIMULATION164 165 CFINAL OUTPUT:163 ! END OF SIMULATION 164 165 ! FINAL OUTPUT: 166 166 acz = acz/dble(nsw*nvr) 167 167 write(*,*) 'last energy',eol 168 168 write(*,*) 'aczeptance rate:',acz 169 169 170 CWRITE DOWN (UN-REWEIGHTED) HISTOGRAM OF MULTICANONICAL SIMULATION170 ! WRITE DOWN (UN-REWEIGHTED) HISTOGRAM OF MULTICANONICAL SIMULATION 171 171 do i=kmin,kmax 172 172 if(xhist(i).gt.0.0d0) then … … 174 174 end if 175 175 end do 176 c=====================176 ! ===================== 177 177 close(8) 178 178 close(9) … … 183 183 end 184 184 185 c************************************************************185 ! ************************************************************ 186 186 real*8 function muca_weight2(x) 187 187 -
nursvr.f
r2ebb8b6 rbd2278d 1 c**************************************************************2 c 3 cThis file contains the subroutines: nursvr, nursat4 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: nursvr, nursat 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 integer*4 function nursvr(ivr) 12 12 13 c...........................................................14 cPURPOSE: defines index of residue for given variable 'ivr'15 c 16 cCALLS: none17 c 18 c...........................................................13 ! ........................................................... 14 ! PURPOSE: defines index of residue for given variable 'ivr' 15 ! 16 ! CALLS: none 17 ! 18 ! ........................................................... 19 19 include 'INCL.H' 20 20 … … 36 36 end 37 37 38 c**********************************38 ! ********************************** 39 39 integer*4 function nursat(iat) 40 40 41 c.......................................................42 cPURPOSE: defines index of residue for given atom 'iat'43 c.......................................................41 ! ....................................................... 42 ! PURPOSE: defines index of residue for given atom 'iat' 43 ! ....................................................... 44 44 45 45 include 'INCL.H' -
opeflx.f
r2ebb8b6 rbd2278d 1 c**************************************************************2 c 3 cThis file contains the subroutines: opeflx,gdtflx4 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: opeflx,gdtflx 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 subroutine opeflx(nml) 13 13 14 c......................................................................15 cPURPOSE: Calculate internal energy for FLEX dataset and its partial16 cderivatives vs. variables using recursive algorithm from:17 cNoguti T, Go N, J Phys Soc (Japan) v52 3685-3690 1984; Abe H,18 cBraun W, Noguti T, Go N, Comp Chem v8 239-247 1984; Mazur A K,19 cAbagyan R A, J Biomol Struct Dyn v6 815-832, which I modified20 cfor atomic forces instead of simple derivatives (see Lavery R,21 cSklenar H, Zakrzewska K, Pullman B, J Biomol Struct Dyn v322 c989-1014 1986)23 c 24 cCALLS: gdtflx25 c......................................................................14 ! ...................................................................... 15 ! PURPOSE: Calculate internal energy for FLEX dataset and its partial 16 ! derivatives vs. variables using recursive algorithm from: 17 ! Noguti T, Go N, J Phys Soc (Japan) v52 3685-3690 1984; Abe H, 18 ! Braun W, Noguti T, Go N, Comp Chem v8 239-247 1984; Mazur A K, 19 ! Abagyan R A, J Biomol Struct Dyn v6 815-832, which I modified 20 ! for atomic forces instead of simple derivatives (see Lavery R, 21 ! Sklenar H, Zakrzewska K, Pullman B, J Biomol Struct Dyn v3 22 ! 989-1014 1986) 23 ! 24 ! CALLS: gdtflx 25 ! ...................................................................... 26 26 27 27 include 'INCL.H' 28 28 29 29 dimension xfat(mxat),yfat(mxat),zfat(mxat), 30 #xtat(mxat),ytat(mxat),ztat(mxat),31 #xfvr(mxvr),yfvr(mxvr),zfvr(mxvr),32 #xfrvr(mxvr),yfrvr(mxvr),zfrvr(mxvr)30 & xtat(mxat),ytat(mxat),ztat(mxat), 31 & xfvr(mxvr),yfvr(mxvr),zfvr(mxvr), 32 & xfrvr(mxvr),yfrvr(mxvr),zfrvr(mxvr) 33 33 34 34 … … 42 42 if (ntlvr.eq.0) then 43 43 write (*,'(a,i4)') 44 #' opeflx> No variables defined in molecule #',nml44 & ' opeflx> No variables defined in molecule #',nml 45 45 return 46 46 endif … … 117 117 endif 118 118 119 c============================================ Energies & Atomic forces119 ! ============================================ Energies & Atomic forces 120 120 121 121 xfiv=0.d0 … … 249 249 yfji=yfji+ dhb*py+ hhb*yij 250 250 zfji=zfji+ dhb*pz+ hhb*zij 251 c__________________________________________________ No Hydrogen Bond251 ! __________________________________________________ No Hydrogen Bond 252 252 else 253 253 eyvw=eyvw+eyrp-eyds … … 365 365 yfji=yfji+ dhb*py+ hhb*yij 366 366 zfji=zfji+ dhb*pz+ hhb*zij 367 c__________________________________________________ No Hydrogen Bond367 ! __________________________________________________ No Hydrogen Bond 368 368 else 369 369 eyvw=eyvw+eyrp-eyds … … 424 424 425 425 gdeyvr(iv)= (ey*zb-ez*yb)*xfiv+(ez*xb-ex*zb)*yfiv+ 426 #(ex*yb-ey*xb)*zfiv427 #+ex*xfriv+ey*yfriv+ez*zfriv -fvr426 & (ex*yb-ey*xb)*zfiv 427 & +ex*xfriv+ey*yfriv+ez*zfriv -fvr 428 428 429 429 elseif (it.eq.1) then ! b.length … … 441 441 return 442 442 end 443 c*****************************443 ! ***************************** 444 444 subroutine gdtflx(nml,iv) 445 445 446 c.....................................................................447 cPURPOSE: calculate partial derivative of internal energy for molecule448 c'nml' vs. variable 'iv' NUMERICALLY and compare with449 cits value obtained analytically450 c 451 cCALLS: setvar, enyflx452 c.....................................................................446 ! ..................................................................... 447 ! PURPOSE: calculate partial derivative of internal energy for molecule 448 ! 'nml' vs. variable 'iv' NUMERICALLY and compare with 449 ! its value obtained analytically 450 ! 451 ! CALLS: setvar, enyflx 452 ! ..................................................................... 453 453 454 454 include 'INCL.H' … … 458 458 dimension vlvrx(mxvr) 459 459 460 c____________________________ get & save values of variables460 ! ____________________________ get & save values of variables 461 461 do i=1,ivrml1(ntlml)+nvrml(ntlml)-1 462 462 it=ityvr(i) ! type … … 481 481 482 482 write (*,'(1x,2a,2(e12.6,a))') nmvr(iv),': ',gda,' (', 483 #abs(gda-gdn),')'484 485 c_________________________ restore483 & abs(gda-gdn),')' 484 485 ! _________________________ restore 486 486 vlvrx(iv)=ovr 487 487 call setvar(nml,vlvrx) -
opereg.f
r2ebb8b6 rbd2278d 1 c**************************************************************2 c 3 cThis file contains the subroutines: opereg,gdtgbl,gdtreg4 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: opereg,gdtgbl,gdtreg 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 subroutine opereg(nml) 13 13 14 c.......................................................................15 cPURPOSE: calculate regul. energy & it's partial derivatives16 cfor molecule 'nml' vs. variables 'iv'17 c 18 cNB: if the unit axis for an internal variable coincides with a19 cglobal axis (i.e. for torsion or bond length variation round20 cor along 'xrfax', respectively, and bd. angle var. round21 c'zrfax'): VdW & 14 interaction partners of moving set atoms22 cshould be used for calculation, instead of the mov. sets,23 cwith opposite sign.24 c 25 cExample: By the the way the molecule-fixed system is set up,26 cchanges in Phi_1 affect atomic positions BEFORE the27 cN-C^alpha bond relatively to the space-fixed system,28 cnot the moving set of Phi_1.29 c 30 cCALLS: gdtgbl, gdtreg31 c......................................................................14 ! ....................................................................... 15 ! PURPOSE: calculate regul. energy & it's partial derivatives 16 ! for molecule 'nml' vs. variables 'iv' 17 ! 18 ! NB: if the unit axis for an internal variable coincides with a 19 ! global axis (i.e. for torsion or bond length variation round 20 ! or along 'xrfax', respectively, and bd. angle var. round 21 ! 'zrfax'): VdW & 14 interaction partners of moving set atoms 22 ! should be used for calculation, instead of the mov. sets, 23 ! with opposite sign. 24 ! 25 ! Example: By the the way the molecule-fixed system is set up, 26 ! changes in Phi_1 affect atomic positions BEFORE the 27 ! N-C^alpha bond relatively to the space-fixed system, 28 ! not the moving set of Phi_1. 29 ! 30 ! CALLS: gdtgbl, gdtreg 31 ! ...................................................................... 32 32 33 33 include 'INCL.H' … … 35 35 36 36 dimension xfat(mxat),yfat(mxat),zfat(mxat), 37 #xfrat(mxat),yfrat(mxat),zfrat(mxat),38 39 #xfvr(mxvr),yfvr(mxvr),zfvr(mxvr),40 #xfrvr(mxvr),yfrvr(mxvr),zfrvr(mxvr)37 & xfrat(mxat),yfrat(mxat),zfrat(mxat), 38 39 & xfvr(mxvr),yfvr(mxvr),zfvr(mxvr), 40 & xfrvr(mxvr),yfrvr(mxvr),zfrvr(mxvr) 41 41 42 42 logical lnb … … 46 46 if (ntlvr.eq.0) then 47 47 write (*,'(a,i4)') 48 #' opereg> No variables defined in molecule #',nml48 & ' opereg> No variables defined in molecule #',nml 49 49 return 50 50 endif … … 55 55 ilavr=ifivr+ntlvr-1 ! last var. of 'nml' 56 56 57 c--------------------------- initializations57 ! --------------------------- initializations 58 58 do i=ifivr,ilavr 59 59 gdeyrg(i)=0.d0 … … 107 107 dz = 2.d0 * zji 108 108 109 c=============================================== global pars.109 ! =============================================== global pars. 110 110 111 111 gdeygb(ii+1) = gdeygb(ii+1) - dx ! d(E_ij) / d(x_i) … … 113 113 gdeygb(ii+3) = gdeygb(ii+3) - dz ! d(E_ij) / d(z_i) 114 114 115 c-------------------------- r = r_i - r_1115 ! -------------------------- r = r_i - r_1 116 116 x = xi - x1 117 117 y = yi - y1 … … 123 123 124 124 gdeygb(ii+6) = gdeygb(ii+6) +dx*(zk*y-yk*z)+dy*(xk*z-zk*x) ! d(E_ij) / d(g) 125 #+dz*(yk*x-xk*y)126 127 c=============================================== for internal vars.125 & +dz*(yk*x-xk*y) 126 127 ! =============================================== for internal vars. 128 128 129 129 xfat(i) = dx … … 164 164 zb=zat(ib) 165 165 166 c---------------------------------------- axis for var.166 ! ---------------------------------------- axis for var. 167 167 168 168 if (it.eq.3) then ! torsion … … 279 279 280 280 gdeyrg(iv)= (ey*zb-ez*yb)*xfiv+(ez*xb-ex*zb)*yfiv+ 281 #(ex*yb-ey*xb)*zfiv282 #+ex*xfriv+ey*yfriv+ez*zfriv281 & (ex*yb-ey*xb)*zfiv 282 & +ex*xfriv+ey*yfriv+ez*zfriv 283 283 284 284 elseif (it.eq.1) then ! b.length … … 294 294 return 295 295 end 296 c**************************296 ! ************************** 297 297 subroutine gdtgbl(nml) 298 C 299 CCALLS: bldmol,enyreg300 c 301 c-------------------------- gradtest for 'gbpr'298 ! 299 ! CALLS: bldmol,enyreg 300 ! 301 ! -------------------------- gradtest for 'gbpr' 302 302 303 303 include 'INCL.H' … … 310 310 do i = 1,6 311 311 312 c----------------------------- modify312 ! ----------------------------- modify 313 313 pro = gbpr(i,nml) 314 314 gbpr(i,nml) = pro+del … … 318 318 319 319 write (*,*) ' Gb. var #',(ii+i),': ',gdeygb(ii+i),gdn, 320 #abs(gdn-gdeygb(ii+i))321 c----------------------------- restore320 & abs(gdn-gdeygb(ii+i)) 321 ! ----------------------------- restore 322 322 gbpr(i,nml) = pro 323 323 call bldmol(nml) … … 327 327 return 328 328 end 329 c*****************************329 ! ***************************** 330 330 subroutine gdtreg(nml,iv) 331 331 332 c.................................................................333 cPURPOSE: calculate partial derivative of reg. energy for molecule334 c'nml' vs. variable 'iv' NUMERICALLY and compare with335 cits value obtained analytically336 c 337 cCALLS: setvar, enyreg338 c.................................................................332 ! ................................................................. 333 ! PURPOSE: calculate partial derivative of reg. energy for molecule 334 ! 'nml' vs. variable 'iv' NUMERICALLY and compare with 335 ! its value obtained analytically 336 ! 337 ! CALLS: setvar, enyreg 338 ! ................................................................. 339 339 340 340 include 'INCL.H' … … 344 344 dimension vlvrx(mxvr) 345 345 346 c____________________________ get & save values of variables346 ! ____________________________ get & save values of variables 347 347 do i=1,ivrml1(ntlml)+nvrml(ntlml)-1 348 348 it=ityvr(i) ! type … … 366 366 367 367 write (*,'(1x,2a,2(e12.6,a))') nmvr(iv),': ',gda,' (', 368 #abs(gda-gdn),')'369 370 c_________________________ restore vars368 & abs(gda-gdn),')' 369 370 ! _________________________ restore vars 371 371 vlvrx(iv)=ovr 372 372 call setvar(nml,vlvrx) -
opeshe.f
r2ebb8b6 rbd2278d 1 c**************************************************************2 c 3 cThis file contains the subroutines: opeshe,gdtshe4 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: opeshe,gdtshe 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 subroutine opeshe(nml) 13 13 14 c......................................................................15 cPURPOSE: Calculate internal energy for ECEPP/3 dataset and its partial16 cderivatives vs. variables using recursive algorithm from:17 cNoguti T, Go N, J Phys Soc (Japan) v52 3685-3690 1984; Abe H,18 cBraun W, Noguti T, Go N, Comp Chem v8 239-247 1984; Mazur A K,19 cAbagyan R A, J Biomol Struct Dyn v6 815-832, which I modified20 cfor atomic forces instead of simple derivatives (see Lavery R,21 cSklenar H, Zakrzewska K, Pullman B, J Biomol Struct Dyn v322 c989-1014 1986)23 c 24 cCALLS: gdtshe25 c......................................................................14 ! ...................................................................... 15 ! PURPOSE: Calculate internal energy for ECEPP/3 dataset and its partial 16 ! derivatives vs. variables using recursive algorithm from: 17 ! Noguti T, Go N, J Phys Soc (Japan) v52 3685-3690 1984; Abe H, 18 ! Braun W, Noguti T, Go N, Comp Chem v8 239-247 1984; Mazur A K, 19 ! Abagyan R A, J Biomol Struct Dyn v6 815-832, which I modified 20 ! for atomic forces instead of simple derivatives (see Lavery R, 21 ! Sklenar H, Zakrzewska K, Pullman B, J Biomol Struct Dyn v3 22 ! 989-1014 1986) 23 ! 24 ! CALLS: gdtshe 25 ! ...................................................................... 26 26 27 27 include 'INCL.H' 28 28 29 29 dimension xfat(mxat),yfat(mxat),zfat(mxat), 30 #xfvr(mxvr),yfvr(mxvr),zfvr(mxvr),31 #xfrvr(mxvr),yfrvr(mxvr),zfrvr(mxvr)30 & xfvr(mxvr),yfvr(mxvr),zfvr(mxvr), 31 & xfrvr(mxvr),yfrvr(mxvr),zfrvr(mxvr) 32 32 33 33 … … 41 41 if (ntlvr.eq.0) then 42 42 write (*,'(a,i4)') 43 #' opeshe> No variables defined in molecule #',nml43 & ' opeshe> No variables defined in molecule #',nml 44 44 return 45 45 endif … … 116 116 endif 117 117 118 c============================================ Energies & Atomic forces118 ! ============================================ Energies & Atomic forces 119 119 120 120 xfiv=0.d0 … … 303 303 304 304 gdeyvr(iv)= (ey*zb-ez*yb)*xfiv+(ez*xb-ex*zb)*yfiv+ 305 #(ex*yb-ey*xb)*zfiv306 #+ex*xfriv+ey*yfriv+ez*zfriv -fvr305 & (ex*yb-ey*xb)*zfiv 306 & +ex*xfriv+ey*yfriv+ez*zfriv -fvr 307 307 308 308 elseif (it.eq.1) then ! b.length … … 320 320 return 321 321 end 322 c*****************************322 ! ***************************** 323 323 subroutine gdtshe(nml,iv) 324 324 325 c.....................................................................326 cPURPOSE: calculate partial derivative of internal energy for molecule327 c'nml' vs. variable 'iv' NUMERICALLY and compare with328 cits value obtained analytically329 c 330 cCALLS: setvar, enyshe331 c.....................................................................325 ! ..................................................................... 326 ! PURPOSE: calculate partial derivative of internal energy for molecule 327 ! 'nml' vs. variable 'iv' NUMERICALLY and compare with 328 ! its value obtained analytically 329 ! 330 ! CALLS: setvar, enyshe 331 ! ..................................................................... 332 332 333 333 include 'INCL.H' … … 337 337 dimension vlvrx(mxvr) 338 338 339 c____________________________ get & save values of variables339 ! ____________________________ get & save values of variables 340 340 do i=1,ivrml1(ntlml)+nvrml(ntlml)-1 341 341 it=ityvr(i) ! type … … 360 360 361 361 write (*,'(1x,2a,2(e12.6,a))') nmvr(iv),': ',gda,' (', 362 #abs(gda-gdn),')'363 364 c_________________________ restore362 & abs(gda-gdn),')' 363 364 ! _________________________ restore 365 365 vlvrx(iv)=ovr 366 366 call setvar(nml,vlvrx) -
opesol.f
r2ebb8b6 rbd2278d 1 c**************************************************************2 c 3 cThis file contains the subroutines: opesol,gdtsol4 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: opesol,gdtsol 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 subroutine opesol(nml) 13 13 14 c......................................................................15 cPURPOSE: derivatives of solvatation energy vs. internal variables for16 cmolecule 'nml'17 c 18 cNB: if the unit axis for an internal variable coincides with a19 cglobal axis (i.e. for torsion or bond length variation round20 cor along 'xrfax', respectively, and bd. angle var. round21 c'zrfax'): VdW & 14 interaction partners of moving set atoms22 cshould be used for calculation, instead of the mov. sets,23 cwith opposite sign.24 c 25 cExample: By the the way the molecule-fixed system is set up,26 cchanges in Phi_1 affect atomic positions BEFORE the27 cN-C^alpha bond relatively to the space-fixed system,28 cnot the moving set of Phi_1.29 c 30 cCALLS: esolan, gdtsol31 c......................................................................14 ! ...................................................................... 15 ! PURPOSE: derivatives of solvatation energy vs. internal variables for 16 ! molecule 'nml' 17 ! 18 ! NB: if the unit axis for an internal variable coincides with a 19 ! global axis (i.e. for torsion or bond length variation round 20 ! or along 'xrfax', respectively, and bd. angle var. round 21 ! 'zrfax'): VdW & 14 interaction partners of moving set atoms 22 ! should be used for calculation, instead of the mov. sets, 23 ! with opposite sign. 24 ! 25 ! Example: By the the way the molecule-fixed system is set up, 26 ! changes in Phi_1 affect atomic positions BEFORE the 27 ! N-C^alpha bond relatively to the space-fixed system, 28 ! not the moving set of Phi_1. 29 ! 30 ! CALLS: esolan, gdtsol 31 ! ...................................................................... 32 32 33 33 include 'INCL.H' 34 34 35 35 dimension xfat(mxat),yfat(mxat),zfat(mxat), 36 #xfrat(mxat),yfrat(mxat),zfrat(mxat),37 38 #xfvr(mxvr),yfvr(mxvr),zfvr(mxvr),39 #xfrvr(mxvr),yfrvr(mxvr),zfrvr(mxvr)36 & xfrat(mxat),yfrat(mxat),zfrat(mxat), 37 38 & xfvr(mxvr),yfvr(mxvr),zfvr(mxvr), 39 & xfrvr(mxvr),yfrvr(mxvr),zfrvr(mxvr) 40 40 41 41 logical lnb … … 45 45 if (ntlvr.eq.0) then 46 46 write (*,'(a,i4)') 47 #' opesol> No variables defined in molecule #',nml47 & ' opesol> No variables defined in molecule #',nml 48 48 return 49 49 endif … … 66 66 eysl = esolan(nml) 67 67 68 c-------------------------------------------------- f & g for atoms68 ! -------------------------------------------------- f & g for atoms 69 69 70 70 do i=iatrs1(irsml1(nml)),iatrs2(irsml2(nml)) … … 217 217 218 218 gdeysl(iv)= (ey*zb-ez*yb)*xfiv+(ez*xb-ex*zb)*yfiv+ 219 #(ex*yb-ey*xb)*zfiv220 #+ex*xfriv+ey*yfriv+ez*zfriv219 & (ex*yb-ey*xb)*zfiv 220 & +ex*xfriv+ey*yfriv+ez*zfriv 221 221 222 222 elseif (it.eq.1) then ! b.length … … 232 232 return 233 233 end 234 c*****************************234 ! ***************************** 235 235 subroutine gdtsol(nml,iv) 236 236 237 c.....................................................................238 cPURPOSE: calculate partial derivative of solvation energy for molecule239 c'nml' vs. variable 'iv' NUMERICALLY and compare with240 cits value obtained analytically241 c 242 cCALLS: setvar, esolan243 c.....................................................................237 ! ..................................................................... 238 ! PURPOSE: calculate partial derivative of solvation energy for molecule 239 ! 'nml' vs. variable 'iv' NUMERICALLY and compare with 240 ! its value obtained analytically 241 ! 242 ! CALLS: setvar, esolan 243 ! ..................................................................... 244 244 245 245 include 'INCL.H' … … 250 250 251 251 252 c____________________________ get & save values of variables252 ! ____________________________ get & save values of variables 253 253 do i=1,ivrml1(ntlml)+nvrml(ntlml)-1 254 254 it=ityvr(i) ! type … … 272 272 273 273 write (*,'(1x,2a,2(e12.6,a))') nmvr(iv),': ',gda,' (', 274 #abs(gda-gdn),')'275 276 c_________________________ restore vars274 & abs(gda-gdn),')' 275 276 ! _________________________ restore vars 277 277 vlvrx(iv)=ovr 278 278 -
outpdb.f
r2ebb8b6 rbd2278d 1 c**************************************************************2 c 3 cThis file contains the subroutines: outpdb4 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: outpdb 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 subroutine outpdb(nml,fileName) 13 13 14 c..............................................15 cPURPOSE: write coordinates of molecule 'nml'16 cin PDB-format (with specialities for hydrogens)17 c 18 cINPUT: nml - number of molecule19 c 20 cnpdb - unit of output-file21 c 22 cCALLS: toupst,iendst23 c..............................................14 ! .............................................. 15 ! PURPOSE: write coordinates of molecule 'nml' 16 ! in PDB-format (with specialities for hydrogens) 17 ! 18 ! INPUT: nml - number of molecule 19 ! 20 ! npdb - unit of output-file 21 ! 22 ! CALLS: toupst,iendst 23 ! .............................................. 24 24 25 25 include 'INCL.H' … … 90 90 j = iendst(atnm) 91 91 if (ichar(atnm(j:j)).ge.i0.and. 92 #ichar(atnm(j:j)).le.i9) then92 & ichar(atnm(j:j)).le.i9) then 93 93 atnm(1:1)=atnm(j:j) 94 94 atnm(j:j)=' ' … … 102 102 linout = ' ' 103 103 write (linout,1) linty,iat,atnm,res(1:3),chid,irs,cdin, 104 #xat(i),yat(i),zat(i),occ,bva104 & xat(i),yat(i),zat(i),occ,bva 105 105 write(iout,'(a80)') linout 106 106 … … 115 115 enddo ! molecules 116 116 117 c______________________________________ connectivity118 c( only bonds i-j with i<j)117 ! ______________________________________ connectivity 118 ! ( only bonds i-j with i<j) 119 119 120 120 do iml = im1,im2 -
outvar.f
r2ebb8b6 rbd2278d 5 5 ! Copyright 2005 Frank Eisenmenger, U.H.E. Hansmann, 6 6 ! Shura Hayryan, Chin-Ku 7 cCopyright 2007 Frank Eisenmenger, U.H.E. Hansmann,8 cJan H. Meinke, Sandipan Mohanty7 ! Copyright 2007 Frank Eisenmenger, U.H.E. Hansmann, 8 ! Jan H. Meinke, Sandipan Mohanty 9 9 ! 10 10 ! ************************************************************** … … 70 70 71 71 if ( gbpr(1,iml).ne.zero 72 #.or.gbpr(2,iml).ne.zero73 #.or.gbpr(3,iml).ne.zero74 #.or.gbpr(4,iml).ne.zero75 #.or.gbpr(5,iml).ne.zero76 #.or.gbpr(6,iml).ne.zero ) then72 & .or.gbpr(2,iml).ne.zero 73 & .or.gbpr(3,iml).ne.zero 74 & .or.gbpr(4,iml).ne.zero 75 & .or.gbpr(5,iml).ne.zero 76 & .or.gbpr(6,iml).ne.zero ) then 77 77 78 78 do i = 1,3 … … 84 84 85 85 write(iout,'(1x,2a,1x,12a)') 86 #'@ ',mlfd,(strg(i)(ibegst(strg(i)):),',',i=1,5),87 #strg(6)(ibegst(strg(6)):)86 & '@ ',mlfd,(strg(i)(ibegst(strg(i)):),',',i=1,5), 87 & strg(6)(ibegst(strg(6)):) 88 88 89 89 endif … … 97 97 98 98 write(iout,'(3x,a,i3,1x,a,1x,a,1x,a,1x,f10.3)') 99 #mlfd,(nursvr(i)-is),':',nmvr(i),':',vlvr(i)*crd99 & mlfd,(nursvr(i)-is),':',nmvr(i),':',vlvr(i)*crd 100 100 else 101 101 … … 105 105 106 106 write(iout,'(3x,a,i3,1x,a,1x,a,1x,a,1x,f10.3,1x,a)') 107 #mlfd,(nursvr(i)-is),':',nmvr(i),':',vlvr(i)*crd108 #,' &'107 & mlfd,(nursvr(i)-is),':',nmvr(i),':',vlvr(i)*crd 108 & ,' &' 109 109 endif 110 110 -
partem_p.f
r2ebb8b6 rbd2278d 1 c**************************************************************2 c3 cThis file contains the subroutines: partem_p4 CUSE WITH main_p, NOT WITH main!!!!!!5 c6 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 c11 c**************************************************************1 !************************************************************** 2 ! 3 ! This file contains the subroutines: partem_p 4 ! USE WITH main_p, NOT WITH main!!!!!! 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 subroutine partem_p(num_rep, nequi, nswp, nmes, nsave, newsta, 14 14 & switch, rep_id, partem_comm) 15 C16 CPURPOSE: SIMULATION OF PROTEINS BY PARALLEL TEMPERING ALGORITHM17 CON PARALLEL COMPUTERS USING MPI18 C19 Cswitch: Choses the starting configuration:20 C-1 - stretched configuration21 C0 - don't change anything22 C1 - random start configuration23 C24 cCALLS: addang,contacts,energy,hbond,helix,iendst,metropolis,25 coutvar,(rand),rgyr26 C15 ! 16 ! PURPOSE: SIMULATION OF PROTEINS BY PARALLEL TEMPERING ALGORITHM 17 ! ON PARALLEL COMPUTERS USING MPI 18 ! 19 ! switch: Choses the starting configuration: 20 ! -1 - stretched configuration 21 ! 0 - don't change anything 22 ! 1 - random start configuration 23 ! 24 ! CALLS: addang,contacts,energy,hbond,helix,iendst,metropolis, 25 ! outvar,(rand),rgyr 26 ! 27 27 include 'INCL.H' 28 28 include 'INCP.H' … … 31 31 logical newsta 32 32 integer switch, partem_comm, rep_id, nsave 33 cexternal rand33 ! external rand 34 34 external can_weight 35 35 36 Cnequi: number of Monte Carlo sweeps for thermalization37 Cnswp: number of Monte Carlo sweeps38 Cnmes: number of Monte Carlo sweeps between measurments39 Cnewsta: .true. for new simulations, .false. for re-start36 ! nequi: number of Monte Carlo sweeps for thermalization 37 ! nswp: number of Monte Carlo sweeps 38 ! nmes: number of Monte Carlo sweeps between measurments 39 ! newsta: .true. for new simulations, .false. for re-start 40 40 41 41 dimension eavm(MAX_PROC),sph(MAX_PROC),intem(MAX_PROC), … … 47 47 double precision e_min, e_minp(MAX_PROC), e_minpt(MAX_PROC) 48 48 integer h_max, h_maxp(MAX_PROC) 49 cOrder of replica exchange49 ! Order of replica exchange 50 50 integer odd 51 51 ! Counter to keep random number generators in sync 52 52 integer randomCount 53 53 54 cCollect partial energies. Only the root writes to disk. We have to55 ccollect the information from the different replicas and provide56 carrays to store them.57 ceyslr storage array for solvent energy58 ceyelp - " - coulomb energy59 ceyvwp - " - van-der-Waals energy60 ceyhbp - " - hydrogen bonding energy61 ceysmi - " - intermolecular interaction energy62 ceyabp - " - Abagyan correction term54 ! Collect partial energies. Only the root writes to disk. We have to 55 ! collect the information from the different replicas and provide 56 ! arrays to store them. 57 ! eyslr storage array for solvent energy 58 ! eyelp - " - coulomb energy 59 ! eyvwp - " - van-der-Waals energy 60 ! eyhbp - " - hydrogen bonding energy 61 ! eysmi - " - intermolecular interaction energy 62 ! eyabp - " - Abagyan correction term 63 63 double precision eyslr(MAX_PROC) 64 64 double precision eyelp(MAX_PROC),eyvwp(MAX_PROC),eyhbp(MAX_PROC), 65 65 & eyvrp(MAX_PROC),eysmip(MAX_PROC), eyabp(MAX_PROC) 66 cCollect information about accessible surface and van-der-Waals volume67 casap storage array for solvent accessible surface68 cvdvolp storage array for van-der-Waals volume66 ! Collect information about accessible surface and van-der-Waals volume 67 ! asap storage array for solvent accessible surface 68 ! vdvolp storage array for van-der-Waals volume 69 69 double precision asap(MAX_PROC), vdvolp(MAX_PROC) 70 70 … … 73 73 integer imhbp(MAX_PROC) 74 74 character*80 filebase, fileNameMP, tbase0,tbase1 75 cframe frame number for writing configurations76 ctrackID configuration that should be tracked and written out77 cdir direction in random walk78 c-1 - visited highest temperature last79 c1 - visited lowest temperature last80 c0 - haven't visited the boundaries yet.81 cdirp storage array for directions.75 ! frame frame number for writing configurations 76 ! trackID configuration that should be tracked and written out 77 ! dir direction in random walk 78 ! -1 - visited highest temperature last 79 ! 1 - visited lowest temperature last 80 ! 0 - haven't visited the boundaries yet. 81 ! dirp storage array for directions. 82 82 integer frame, trackID, dir 83 83 integer dirp(MAX_PROC) … … 90 90 & rep_id, num_rep, partem_comm, myrank 91 91 call flush(6) 92 C93 c94 CFile with temperatures92 ! 93 ! 94 ! File with temperatures 95 95 open(11,file='temperatures',status='old') 96 CFile with reference conformation96 ! File with reference conformation 97 97 tbase0='trj_00000' 98 98 open(18,file=fileNameMP(tbase0,5,9,rep_id),status='unknown') 99 99 if (rep_id.eq.0.and.myrank.eq.0) then 100 cFile with time series of simulation100 ! File with time series of simulation 101 101 open(14,file='ts.d',status='unknown') 102 cTrack weights103 copen(16, file='weights.dat', status='unknown')102 ! Track weights 103 ! open(16, file='weights.dat', status='unknown') 104 104 endif 105 105 106 CREAD IN TEMPERATURES106 ! READ IN TEMPERATURES 107 107 do i=1,num_rep 108 108 read(11,*) j,temp … … 111 111 close(11) 112 112 113 cnresi: number of residues113 ! nresi: number of residues 114 114 nresi=irsml2(1)-irsml1(1)+1 115 C116 CInitialize variables115 ! 116 ! Initialize variables 117 117 do i=1,num_rep 118 118 acx1(i) = 0.0d0 … … 132 132 dir = dirp(rep_id + 1) 133 133 134 c_________________________________ Initialize Variables134 ! _________________________________ Initialize Variables 135 135 if(newsta) then 136 136 iold=0 … … 139 139 intem(i) = i 140 140 end do 141 c_________________________________ initialize starting configuration141 ! _________________________________ initialize starting configuration 142 142 if (switch.ne.0) then 143 143 do i=1,nvr … … 178 178 CALL MPI_BCAST(INODE,num_rep,MPI_INTEGER,0,MPI_COMM_WORLD,IERR) 179 179 CALL MPI_BCAST(YOL,num_rep,MPI_DOUBLE_PRECISION,0, 180 #MPI_COMM_WORLD,IERR)180 & MPI_COMM_WORLD,IERR) 181 181 CALL MPI_BCAST(E_MINP, num_rep, MPI_DOUBLE_PRECISION, 0, 182 #MPI_COMM_WORLD, IERR)182 & MPI_COMM_WORLD, IERR) 183 183 CALL MPI_BCAST(h_maxp,num_rep,MPI_INTEGER,0,MPI_COMM_WORLD, 184 $IERR)184 & IERR) 185 185 end if 186 186 … … 194 194 write(*,*) rep_id, yol(rep_id + 1), eol 195 195 endif 196 CStart of simulation196 ! Start of simulation 197 197 write (*,*) '[',rep_id, myrank, beta, partem_comm, 198 198 & '] Energy before equilibration:', eol 199 c=====================Equilibration by canonical Metropolis199 ! =====================Equilibration by canonical Metropolis 200 200 do nsw=1,nequi 201 201 call metropolis(eol,acz,can_weight) … … 204 204 write (*,*) '[',rep_id,'] Energy after equilibration:', eol 205 205 call flush(6) 206 C207 C======================Multiple Markov Chains206 ! 207 !======================Multiple Markov Chains 208 208 acz = 0 209 209 do nsw=1,nswp 210 c------------First ordinary Metropolis210 !------------First ordinary Metropolis 211 211 call metropolis(eol,acz,can_weight) 212 212 iold = iold + 1 … … 223 223 endif 224 224 acz0 = acz 225 cEvaluate RMSD225 ! Evaluate RMSD 226 226 nml = 1 227 227 rmsv = rmsdfun(nml,irsml1(nml),irsml2(nml),ixatp,xatp,yatp, & 228 228 & zatp,0) 229 cprint *,myrank,'received RMSD,energy ',rmsv,eyab,beta230 CMeasure global radius of gyration229 ! print *,myrank,'received RMSD,energy ',rmsv,eyab,beta 230 ! Measure global radius of gyration 231 231 call rgyr(0,rgy,ee) 232 232 rgyp = rgy 233 CMeasure Helicity and Sheetness233 ! Measure Helicity and Sheetness 234 234 call helix(nhel,mhel,nbet,mbet) 235 CMeasure Number of hydrogen bonds235 ! Measure Number of hydrogen bonds 236 236 mhb = 0 237 237 do i = 1, ntlml … … 240 240 enddo 241 241 call interhbond(imhb) 242 CMeasure total number of contacts (NCTOT) and number of243 Cnative contacts (NCNAT)242 ! Measure total number of contacts (NCTOT) and number of 243 ! native contacts (NCNAT) 244 244 call contacts(nctot,ncnat,dham) 245 cAdd tracking of lowest energy configuration245 ! Add tracking of lowest energy configuration 246 246 if (eol.lt.e_min) then 247 cWrite out configuration247 ! Write out configuration 248 248 i=rep_id+1 249 249 j=inode(i) … … 262 262 close(15) 263 263 endif 264 cAdd tracking of configuration with larges hydrogen contents.264 ! Add tracking of configuration with larges hydrogen contents. 265 265 if ((mhb + imhb).gt.h_max) then 266 cWrite out configuration266 ! Write out configuration 267 267 i = rep_id + 1 268 268 j = inode(i) … … 282 282 endif 283 283 284 C285 C--------------------Gather measurement data284 ! 285 !--------------------Gather measurement data 286 286 ! I only use the master node of each replica for data collection. The 287 287 ! variable partem_comm provides the appropriate communicator. 288 288 if (partem_comm.ne.MPI_COMM_NULL) then 289 289 CALL MPI_GATHER(rmsv,1,MPI_DOUBLE_PRECISION,rmsdp,1, 290 #MPI_DOUBLE_PRECISION, 0,partem_comm,IERR)290 & MPI_DOUBLE_PRECISION, 0,partem_comm,IERR) 291 291 CALL MPI_GATHER(eyab,1,MPI_DOUBLE_PRECISION,eyabp,1, 292 #MPI_DOUBLE_PRECISION, 0,partem_comm,IERR)292 & MPI_DOUBLE_PRECISION, 0,partem_comm,IERR) 293 293 CALL MPI_GATHER(RGYP,1,MPI_DOUBLE_PRECISION,RGYRP,1, 294 #MPI_DOUBLE_PRECISION, 0,partem_comm,IERR)294 & MPI_DOUBLE_PRECISION, 0,partem_comm,IERR) 295 295 CALL MPI_GATHER(NHEL,1,MPI_INTEGER,NHELP,1,MPI_INTEGER, 296 296 & 0,partem_comm,IERR) … … 335 335 ! & 0,MPI_COMM_WORLD, IERR) 336 336 337 cWrite trajectory337 ! Write trajectory 338 338 write (18,*) '@@@',iold,inode(rep_id+1) 339 339 call outvbs(0,18) 340 340 write (18,*) '###' 341 341 ! call flush(18) 342 cWrite current configuration342 ! Write current configuration 343 343 if ((mod(iold, nsave).eq.0)) then 344 344 filebase = "conf_0000.var" … … 349 349 if(rep_id.eq.0.and.myrank.eq.0) then 350 350 randomCount = 0 351 cUpdate acceptance, temperature wise average of E and E^2 used to calculate352 cspecific heat.351 ! Update acceptance, temperature wise average of E and E^2 used to calculate 352 ! specific heat. 353 353 do i=1,num_rep 354 354 j=intem(i) 355 355 acy(i)=0.0 356 cAbove: contents of acy1 are added to acy(i) a few lines down.357 cacy1(intem(i)) contains information received from the node at temperature358 ci, on how many updates have been accepted in node intem(i). Since acz359 cis not reset to 0 every cycle, acy(i) must be set to 0 here. Else, there360 cwill be serious double counting and the values of acceptance printed361 cwill be simply wrong.356 ! Above: contents of acy1 are added to acy(i) a few lines down. 357 ! acy1(intem(i)) contains information received from the node at temperature 358 ! i, on how many updates have been accepted in node intem(i). Since acz 359 ! is not reset to 0 every cycle, acy(i) must be set to 0 here. Else, there 360 ! will be serious double counting and the values of acceptance printed 361 ! will be simply wrong. 362 362 e_minpt(i)=e_minp(intem(i)) 363 363 end do … … 371 371 372 372 373 CWrite measurements to the time series file ts.d373 ! Write measurements to the time series file ts.d 374 374 do i=1,num_rep 375 375 j=intem(i) … … 382 382 ! call flush(14) 383 383 end do 384 cWrite the current parallel tempering information into par_R.in384 ! Write the current parallel tempering information into par_R.in 385 385 ! timeLeft = llwrem(2) ! Time left till hard limit 386 386 ! if ((mod(iold, nsave).eq.0).or.(timeLeft.lt.minTimeLeft) … … 393 393 & h_maxp(i) 394 394 end do 395 C-------------------------- Various statistics of current run396 cswp=nswp-nequi395 ! -------------------------- Various statistics of current run 396 ! swp=nswp-nequi 397 397 swp=nsw 398 398 write(13,*) 'Acceptance rate for change of chains:' … … 400 400 temp=1.0d0/pbe(k1)/0.00198773 401 401 write(13,*) temp, acx1(k1)*2.0d0*nmes/swp 402 cAbove: it's the acceptance rate of exchange of replicas. Since a403 creplica exchange is attempted only once every nmes sweeps, the404 crate should be normalized with (nmes/swp).402 ! Above: it's the acceptance rate of exchange of replicas. Since a 403 ! replica exchange is attempted only once every nmes sweeps, the 404 ! rate should be normalized with (nmes/swp). 405 405 end do 406 406 write(13,*) … … 411 411 geavm(k1) = nmes*eavm(k1)/swp 412 412 gsph(k1) = (nmes*sph(k1)/swp-geavm(k1)**2) 413 #*beta*beta/nresi413 & *beta*beta/nresi 414 414 write(13,'(a,2f9.2,i4,f12.3)') 415 415 & 'Temperature, Node,local acceptance rate:', 416 416 & beta,temp,k,acy(k1)/dble(nsw*nvr) 417 cAbove: Changed (nswp-nequi) in the denominator of acceptance as418 cacceptance values are initialized to 0 after equilibration cycles are419 cfinished. Note also that since this is being written in the middle of420 cthe simulation, it is normalized to nsw instead of nswp.417 ! Above: Changed (nswp-nequi) in the denominator of acceptance as 418 ! acceptance values are initialized to 0 after equilibration cycles are 419 ! finished. Note also that since this is being written in the middle of 420 ! the simulation, it is normalized to nsw instead of nswp. 421 421 write(13,'(a,3f12.2)') 422 422 & 'Last Energy, Average Energy, Spec. Heat:', … … 431 431 end if 432 432 433 C--------------------Parallel Tempering update434 cSwap with right neighbor (odd, even)433 !--------------------Parallel Tempering update 434 ! Swap with right neighbor (odd, even) 435 435 if(odd.eq.1) then 436 436 nu=1 437 437 no1 = num_rep-1 438 cSwap with left neighbor (even, odd)438 ! Swap with left neighbor (even, odd) 439 439 else 440 440 nu = 2 … … 443 443 do i=nu,no1,2 444 444 j=i+1 445 cPeriodic bc for swaps445 ! Periodic bc for swaps 446 446 if(i.eq.num_rep) j=1 447 447 in=intem(i) … … 449 449 wij=exp(-pbe(i)*yol(jn)-pbe(j)*yol(in) 450 450 & +pbe(i)*yol(in)+pbe(j)*yol(jn)) 451 cThe random number generator is getting out of sync here, because452 cthe swap is only done on node 0!451 ! The random number generator is getting out of sync here, because 452 ! the swap is only done on node 0! 453 453 ! Keep track of number of random numbers used. 454 454 rd=grnd() 455 455 randomCount = randomCount + 1 456 cwrite (16,*) '>', iold, i,j457 c& ,pbe(i),yol(in), pbe(j), yol(jn), wij, rd456 ! write (16,*) '>', iold, i,j 457 ! & ,pbe(i),yol(in), pbe(j), yol(jn), wij, rd 458 458 if(wij.ge.rd) then 459 cNext line: Replica exchange only happens after equilibration,460 cwhich takes place outside this loop over nsw. So, I think nsw.gt.nequi461 cis irrelevant for the calculation of acceptance of replica exchanges.462 c/Sandipan463 cif(nsw.gt.nequi)459 ! Next line: Replica exchange only happens after equilibration, 460 ! which takes place outside this loop over nsw. So, I think nsw.gt.nequi 461 ! is irrelevant for the calculation of acceptance of replica exchanges. 462 ! /Sandipan 463 ! if(nsw.gt.nequi) 464 464 acx1(i) = acx1(i)+1 465 465 intem(i) = jn … … 469 469 end if 470 470 end do 471 c---------------- End Loop over nodes which creates a new temperature472 cmap for all nodes, at the node with rank 0.473 c471 ! ---------------- End Loop over nodes which creates a new temperature 472 ! map for all nodes, at the node with rank 0. 473 ! 474 474 odd = 1 - odd 475 475 end if 476 cEnd of "if (myrank.eq.0) ...". The block above includes PT update and477 cwriting of observables into the time series file etc.476 ! End of "if (myrank.eq.0) ...". The block above includes PT update and 477 ! writing of observables into the time series file etc. 478 478 479 cBelow: Communicate new temperature-node map to all nodes479 ! Below: Communicate new temperature-node map to all nodes 480 480 CALL MPI_BCAST(INTEM,num_rep,MPI_INTEGER,0,MPI_COMM_WORLD, 481 481 & IERR) … … 486 486 CALL MPI_BCAST(H_MAXP,num_rep,MPI_INTEGER,0,MPI_COMM_WORLD, 487 487 & IERR) 488 cSynchronize random number generators for replica 0488 ! Synchronize random number generators for replica 0 489 489 if (rep_id.eq.0) then 490 490 CALL MPI_BCAST(randomCount,1,MPI_INTEGER,0,my_mpi_comm, … … 507 507 508 508 endif 509 cEnd of "if (mod(iold,nmes).eq.0) ..."509 ! End of "if (mod(iold,nmes).eq.0) ..." 510 510 end do 511 c-----------End Loop over sweeps512 c513 COUTPUT:514 C--------------------For Re-starts:511 !-----------End Loop over sweeps 512 ! 513 ! OUTPUT: 514 !--------------------For Re-starts: 515 515 nu = rep_id + 1 516 516 filebase = "conf_0000.var" … … 524 524 if (partem_comm.ne.MPI_COMM_NULL) then 525 525 CALL MPI_GATHER(EOL0,1,MPI_DOUBLE_PRECISION,YOL,1, 526 #MPI_DOUBLE_PRECISION,0,partem_comm,IERR)526 & MPI_DOUBLE_PRECISION,0,partem_comm,IERR) 527 527 CALL MPI_GATHER(acz0,1,MPI_DOUBLE_PRECISION,acy1,1, 528 #MPI_DOUBLE_PRECISION,0,partem_comm,IERR)528 & MPI_DOUBLE_PRECISION,0,partem_comm,IERR) 529 529 endif 530 530 … … 536 536 write(13,*) i,inode(i),intem(i),yol(i),e_minp(i),h_maxp(i) 537 537 end do 538 C-------------------------- Various statistics of current run538 ! -------------------------- Various statistics of current run 539 539 swp=nswp 540 540 write(13,*) 'Acceptance rate for change of chains:' … … 559 559 end do 560 560 close(13) 561 cclose(16)561 ! close(16) 562 562 end if 563 563 close(18) 564 564 565 c=====================565 ! ===================== 566 566 CALL MPI_BARRIER(MPI_COMM_WORLD,IERR) 567 567 -
partem_s.f
r2ebb8b6 rbd2278d 5 5 ! Copyright 2003-2005 Frank Eisenmenger, U.H.E. Hansmann, 6 6 ! Shura Hayryan, Chin-Ku 7 cCopyright 2007 Frank Eisenmenger, U.H.E. Hansmann,8 cJan H. Meinke, Sandipan Mohanty7 ! Copyright 2007 Frank Eisenmenger, U.H.E. Hansmann, 8 ! Jan H. Meinke, Sandipan Mohanty 9 9 ! 10 10 ! -
pdbread.f
r2ebb8b6 rbd2278d 1 c**************************************************************2 c 3 cThis file contains the subroutines: pdbread,pdbvars,atixpdb,getpar4 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: pdbread,pdbvars,atixpdb,getpar 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 subroutine pdbread(pdbfil,ier) 13 13 14 c....................................................15 cPURPOSE: read protein atom coordinates from 'pdbfil'16 c(no Hydrogens, only ATOM records)17 c 18 cRETURNS: 0 = no errors / 1 = error19 c 20 cCALLS: iopfil,iendst21 c......................................................14 ! .................................................... 15 ! PURPOSE: read protein atom coordinates from 'pdbfil' 16 ! (no Hydrogens, only ATOM records) 17 ! 18 ! RETURNS: 0 = no errors / 1 = error 19 ! 20 ! CALLS: iopfil,iendst 21 ! ...................................................... 22 22 23 23 implicit real*8 (a-h,o-z) … … 26 26 include 'INCP.H' 27 27 28 c-------------------------- input28 ! -------------------------- input 29 29 character*(*) pdbfil 30 c-------------------------- local30 ! -------------------------- local 31 31 dimension cor(3) 32 32 character atm*4,rsn*3,rsno*3,chn,chno, 33 #rsid*5,rsido*5,line*13233 & rsid*5,rsido*5,line*132 34 34 35 35 natp=0 … … 48 48 else 49 49 write (*,'(a)') 50 #' pdbread> empty file name to read pdb-structure'50 & ' pdbread> empty file name to read pdb-structure' 51 51 52 52 return … … 57 57 if (io.le.0) then 58 58 write (*,'(a,/,a)') 59 #' pdbread> ERROR opening file to read pdb-structure: ',60 #pdbfil(1:iendst(pdbfil))59 & ' pdbread> ERROR opening file to read pdb-structure: ', 60 & pdbfil(1:iendst(pdbfil)) 61 61 62 62 return … … 70 70 if ( line(17:17).ne.' ' ) then 71 71 write (*,'(a,/,a,/,a,/,2a)') 72 #' pdbread> found alternate atom location: ',73 #' !',74 #line(:l),' in file: ',pdbfil(1:iendst(pdbfil))72 & ' pdbread> found alternate atom location: ', 73 & ' !', 74 & line(:l),' in file: ',pdbfil(1:iendst(pdbfil)) 75 75 76 76 close(lunpdb) … … 86 86 if ((natp+1).gt.MXATP) then 87 87 write (*,'(a,i5,a,/,a)') 88 #' pdbread> >MXATP (',MXATP,') ATOM lines in PDB file ',89 #pdbfil(1:iendst(pdbfil))88 & ' pdbread> >MXATP (',MXATP,') ATOM lines in PDB file ', 89 & pdbfil(1:iendst(pdbfil)) 90 90 91 91 close(lunpdb) … … 97 97 if ((nchp+1).gt.MXCHP) then 98 98 write (*,'(a,i3,a,/,a)') 99 #' pdbread> >MXCHP (',MXCHP,') chains in PDB file ',100 #pdbfil(1:iendst(pdbfil))99 & ' pdbread> >MXCHP (',MXCHP,') chains in PDB file ', 100 & pdbfil(1:iendst(pdbfil)) 101 101 102 102 close(lunpdb) … … 106 106 if ((nrsp+1).gt.MXRSP) then 107 107 write (*,'(a,i3,a,/,a)') 108 #' pdbread> >MXRSP (',MXRSP,') residues in PDB file ',109 #pdbfil(1:iendst(pdbfil))108 & ' pdbread> >MXRSP (',MXRSP,') residues in PDB file ', 109 & pdbfil(1:iendst(pdbfil)) 110 110 111 111 close(lunpdb) … … 141 141 if ((nrsp+1).gt.MXRSP) then 142 142 write (*,'(a,i3,a,/,a)') 143 #' pdbread> >MXRSP (',MXRSP,') residues in PDB file ',144 #pdbfil(1:iendst(pdbfil))143 & ' pdbread> >MXRSP (',MXRSP,') residues in PDB file ', 144 & pdbfil(1:iendst(pdbfil)) 145 145 146 146 close(lunpdb) … … 172 172 173 173 2 write (*,'(a,/,a,/,2a)') 174 #' pdbread> ERROR reading ATOM line ',175 #line(:l),176 #' from file ',pdbfil(1:iendst(pdbfil))174 & ' pdbread> ERROR reading ATOM line ', 175 & line(:l), 176 & ' from file ',pdbfil(1:iendst(pdbfil)) 177 177 178 178 close(lunpdb) … … 195 195 196 196 write (*,'(a,/,a)') 197 #' pdbread> NO atom coordinates selected from file ',198 #pdbfil(1:iendst(pdbfil))197 & ' pdbread> NO atom coordinates selected from file ', 198 & pdbfil(1:iendst(pdbfil)) 199 199 200 200 endif … … 205 205 206 206 end 207 c**************************************************************207 ! ************************************************************** 208 208 209 209 subroutine pdbvars() 210 210 211 c--------------------------------------------------------------------212 cPURPOSE: sequence,indices for selected atoms (data in INCP.H)213 c& torsions from PDB to be used to build SMMP structure214 c 215 cixatp(i,)216 c= indices for SMMP atoms pointing to PDB atoms217 c(=0, if atom not selected)218 c 219 c--------------------------------- ref. point & axes220 cixrfpt(3,),rfpt(3,),xrfax(3,),yrfax(3,),zrfax(3,)221 c 222 cCALLS: tolost,getmol,bldmol,addend,atixpdb,setmvs,mklist,223 cdihedr,fnd3ba,setsys,getpar,setvar,rmsdopt224 c--------------------------------------------------------------------211 ! -------------------------------------------------------------------- 212 ! PURPOSE: sequence,indices for selected atoms (data in INCP.H) 213 ! & torsions from PDB to be used to build SMMP structure 214 ! 215 ! ixatp(i,) 216 ! = indices for SMMP atoms pointing to PDB atoms 217 ! (=0, if atom not selected) 218 ! 219 ! --------------------------------- ref. point & axes 220 ! ixrfpt(3,),rfpt(3,),xrfax(3,),yrfax(3,),zrfax(3,) 221 ! 222 ! CALLS: tolost,getmol,bldmol,addend,atixpdb,setmvs,mklist, 223 ! dihedr,fnd3ba,setsys,getpar,setvar,rmsdopt 224 ! -------------------------------------------------------------------- 225 225 226 226 include 'INCL.H' … … 236 236 do nc=1,nchp ! PDB chains 237 237 238 c=============================== SMMP molecule238 ! =============================== SMMP molecule 239 239 nml=nml+1 240 240 if (nml.gt.mxml) then 241 241 write(*,'(a,i4,2a)')' pdbvars> NUMBER of chains > ' 242 #,mxml,' in ',' ?'242 & ,mxml,' in ',' ?' 243 243 stop 244 244 endif 245 245 ntlml=nml 246 c----------------------------- 'nmml' = ChainID246 ! ----------------------------- 'nmml' = ChainID 247 247 nmml(nml)=chnp(nc) 248 248 249 c======================================== get sequence249 ! ======================================== get sequence 250 250 251 251 irb=nrs+1 252 252 ire=nrs+nchrsp(nc) 253 c----------------------------- # of 1st & last residue253 ! ----------------------------- # of 1st & last residue 254 254 irsml1(nml)=irb 255 255 irsml2(nml)=ire … … 261 261 if (nrs.gt.mxrs) then 262 262 write(*,'(a,i4,2a)') ' pdbvars> NUMBER of residues > ' 263 #,mxrs,' in ',' ?'263 & ,mxrs,' in ',' ?' 264 264 stop 265 265 endif … … 271 271 272 272 if (.not.flex.and.irs.eq.irb.and.seq(nrs)(1:3).eq.'pro') 273 #seq(nrs)='pron' ! only ECEPP/3273 & seq(nrs)='pron' ! only ECEPP/3 274 274 275 275 enddo ! residues 276 276 277 c======================== get initial coords. for molecule 'nml'278 cwith library values for deg. of freedom277 ! ======================== get initial coords. for molecule 'nml' 278 ! with library values for deg. of freedom 279 279 280 280 call getmol(nml) ! assemble res. data from libraries … … 289 289 call atixpdb(nml) ! get 'ixatp' 290 290 291 c-------------------------- 'load' SMMP variable information291 ! -------------------------- 'load' SMMP variable information 292 292 call setmvs(nml) ! moving sets 293 293 call mklist(nml) ! interaction lists 294 294 295 c================================= get variables for 'nml'295 ! ================================= get variables for 'nml' 296 296 297 297 ii=ivrml1(nml) … … 356 356 nvr = ivrml1(ntlml)+nvrml(ntlml)-1 357 357 358 c================================= global parameters for 'nml'359 360 c+++++++++++358 ! ================================= global parameters for 'nml' 359 360 ! +++++++++++ 361 361 inew=0 362 362 363 363 if (inew.eq.1) then 364 c++++++++++++++++++++++++364 ! ++++++++++++++++++++++++ 365 365 366 366 call setvar(nml,vlvr) … … 369 369 call rmsdopt(nml,1,nrs,ixatp,xatp,yatp,zatp,0,rm,av1,av2,rmsd) 370 370 371 c---------------------------- retrieve ref. coords.372 c& transform acc. to opt. rmsd371 ! ---------------------------- retrieve ref. coords. 372 ! & transform acc. to opt. rmsd 373 373 do i=1,3 374 374 ii=ixrfpt(i,nml) … … 396 396 call bldmol(nml) ! finally build SMMP molecule 397 397 398 c++++++++++++++++398 ! ++++++++++++++++ 399 399 else ! old 400 c++++++++++++++++400 ! ++++++++++++++++ 401 401 402 402 call fnd3ba(nml,i1,i2,i3) ! three 1st bb atoms in SMMP (e.g. n,ca,c') … … 406 406 ixrfpt(3,nml)=i3 407 407 408 c-------------------------------- retrieve ref. coords.408 ! -------------------------------- retrieve ref. coords. 409 409 do i=1,3 410 410 ii=ixrfpt(i,nml) … … 416 416 else 417 417 write(*,'(3a)') ' pdbvars> missing PDB atom ',nmat(ii), 418 #' is ref. point for SMMP - cannot proceed !'418 & ' is ref. point for SMMP - cannot proceed !' 419 419 endif 420 420 enddo … … 426 426 call rmsdopt(nml,1,nrs,ixatp,xatp,yatp,zatp,0,rm,av1,av2,rmsd) 427 427 428 c++++++++++428 ! ++++++++++ 429 429 endif 430 c++++++++++430 ! ++++++++++ 431 431 432 432 write(*,*) ' ' … … 437 437 return 438 438 end 439 c***************************439 ! *************************** 440 440 subroutine atixpdb(nml) 441 441 442 c--------------------------------------------------------------------443 cPURPOSE: get ixatp - pointer of each SMMP atom to corresponding atom444 cof reference structure loaded in 'INCP.H'445 c(=0 if no corr. atom in ref. str.)446 c 447 cCALLS: toupst448 c--------------------------------------------------------------------442 ! -------------------------------------------------------------------- 443 ! PURPOSE: get ixatp - pointer of each SMMP atom to corresponding atom 444 ! of reference structure loaded in 'INCP.H' 445 ! (=0 if no corr. atom in ref. str.) 446 ! 447 ! CALLS: toupst 448 ! -------------------------------------------------------------------- 449 449 450 450 include 'INCL.H' … … 477 477 enddo 478 478 479 cwrite(*,'(8a)') ' pdbvars> ',atm,' not found in '480 c# ,chnp(nc),' ',rsidp(irs),' ',rsnmp(irs)479 ! write(*,'(8a)') ' pdbvars> ',atm,' not found in ' 480 ! # ,chnp(nc),' ',rsidp(irs),' ',rsnmp(irs) 481 481 482 482 endif … … 489 489 return 490 490 end 491 c**************************491 ! ************************** 492 492 subroutine getpar(nml) 493 493 … … 496 496 parameter (TOL = 1.d-12) 497 497 498 cObtain molecule-fixed system (J,K,L) for 1st 3 bb-atoms,499 c-> determine global parameters: shifts dX,dY,dZ500 c& angles alpha,beta,gamma [rad], put into 'gbpr'501 c502 cCALLS: none503 c 498 ! Obtain molecule-fixed system (J,K,L) for 1st 3 bb-atoms, 499 ! -> determine global parameters: shifts dX,dY,dZ 500 ! & angles alpha,beta,gamma [rad], put into 'gbpr' 501 ! 502 ! CALLS: none 503 ! 504 504 505 505 i1=ixrfpt(1,nml) ! from 'INCL.H' 506 506 i2=ixrfpt(2,nml) 507 507 i3=ixrfpt(3,nml) 508 c-------------------------------------- Shifts508 ! -------------------------------------- Shifts 509 509 gbpr(1,nml) = xat(i1) 510 510 gbpr(2,nml) = yat(i1) … … 514 514 gbpr(i,nml) = 0.d0 515 515 enddo 516 c--------------------------------- J516 ! --------------------------------- J 517 517 h1=xat(i2) 518 518 h2=yat(i2) … … 528 528 x2=x2/d 529 529 x3=x3/d 530 c--------------------------------- L530 ! --------------------------------- L 531 531 h1=xat(i3)-h1 532 532 h2=yat(i3)-h2 … … 543 543 z3=z3/d 544 544 545 c---------------------------------- K545 ! ---------------------------------- K 546 546 y1=z2*x3-z3*x2 547 547 y2=z3*x1-z1*x3 … … 550 550 if ( ( 1.d0 - abs(y3) ) .gt. TOL ) then ! ============ |beta| < PI/2 551 551 552 c----------------------------------------------- Y'552 ! ----------------------------------------------- Y' 553 553 d = sqrt( y1 * y1 + y2 * y2 ) 554 554 yp1= y1 / d -
redseq.f
r2ebb8b6 rbd2278d 1 c**************************************************************2 c 3 cThis file contains the subroutines: redseq4 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: redseq 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 redseq 14 14 15 c............................................................16 cPURPOSE: read 'lunseq' 'seqfil', extract names of molecules,17 csequences18 c 19 cMolecules are separated by lines containing char. '#',20 ca name for the molecule may follow '#' on this line21 cResidue names can be of 1-4 characters to be separated by ' '22 c 23 cReturns: ntlml,nmml,irsml1,irsml2,seq24 c 25 cCALLS: ibegst,iendst,iopfil,tolost26 c............................................................15 ! ............................................................ 16 ! PURPOSE: read 'lunseq' 'seqfil', extract names of molecules, 17 ! sequences 18 ! 19 ! Molecules are separated by lines containing char. '#', 20 ! a name for the molecule may follow '#' on this line 21 ! Residue names can be of 1-4 characters to be separated by ' ' 22 ! 23 ! Returns: ntlml,nmml,irsml1,irsml2,seq 24 ! 25 ! CALLS: ibegst,iendst,iopfil,tolost 26 ! ............................................................ 27 27 28 28 include 'INCL.H' … … 33 33 if (iopfil(lunseq,seqfil,'old','formatted').le.izero) then 34 34 write (*,'(a,/,a,i3,2a)') 35 #' redseq> ERROR opening sequence file:',36 #' LUN=',lunseq,' FILE=',seqfil(1:iendst(seqfil))35 & ' redseq> ERROR opening sequence file:', 36 & ' LUN=',lunseq,' FILE=',seqfil(1:iendst(seqfil)) 37 37 stop 38 38 endif 39 39 40 cntlml=040 ! ntlml=0 41 41 if (ntlml.gt.0) then 42 42 nrs = irsml2(ntlml) … … 56 56 if (ic.gt.0) then ! found '#' 57 57 58 c____________________________________ new molecule58 ! ____________________________________ new molecule 59 59 60 60 if (ntlml.gt.0) then ! check previous molecule … … 64 64 if ((nrs-irsml1(ntlml)+1).eq.0) then 65 65 write(*,'(2a)') ' redseq> IGNORE molecule: ', 66 #nmml(ntlml)(1:iendst(nmml(ntlml)))66 & nmml(ntlml)(1:iendst(nmml(ntlml))) 67 67 ntlml=ntlml-1 68 68 endif … … 71 71 if (ntlml.gt.mxml) then 72 72 write(*,'(a,i4,2a)')' redseq> NUMBER of molecules > ' 73 #,mxml,' in ',seqfil(1:iendst(seqfil))73 & ,mxml,' in ',seqfil(1:iendst(seqfil)) 74 74 close(lunseq) 75 75 stop … … 80 80 81 81 if (ic.le.lg) then 82 c___________________________________ extract name of molecule82 ! ___________________________________ extract name of molecule 83 83 84 84 hlin=blnk … … 99 99 else ! no '#' 100 100 101 c_________________________________________ sequence101 ! _________________________________________ sequence 102 102 103 103 ib=ibegst(line) … … 110 110 111 111 ie=iendst(line) 112 c___________________________________ extract names of residues112 ! ___________________________________ extract names of residues 113 113 2 id=index(line(ib:ie),blnk)-1 ! find next separator 114 114 if (id.gt.0) then … … 121 121 if (id.gt.4) then 122 122 write (*,'(4a)') ' redseq> INVALID residue NAME >', 123 #line(ib:ii),'< in ',124 #seqfil(1:iendst(seqfil))123 & line(ib:ii),'< in ', 124 & seqfil(1:iendst(seqfil)) 125 125 close(lunseq) 126 126 stop … … 130 130 if (nrs.gt.mxrs) then 131 131 write(*,'(a,i4,2a)') ' redseq> NUMBER of residues > ' 132 #,mxrs,' in ',seqfil(1:iendst(seqfil))132 & ,mxrs,' in ',seqfil(1:iendst(seqfil)) 133 133 close(lunseq) 134 134 stop … … 155 155 156 156 3 close(lunseq) 157 c___________________________________ output157 ! ___________________________________ output 158 158 159 159 if (nrs.eq.0) then 160 160 write (*,'(2a)') ' redseq> no residues found in ', 161 #seqfil(1:iendst(seqfil))161 & seqfil(1:iendst(seqfil)) 162 162 stop 163 163 else … … 176 176 if ((nrs-ifirs+1).eq.0) then 177 177 write(*,'(2a)') ' redseq> IGNORE molecule ' 178 #,nmml(ntlml)(1:iendst(nmml(ntlml)))178 & ,nmml(ntlml)(1:iendst(nmml(ntlml))) 179 179 ntlml=ntlml-1 180 180 if (ntlml.eq.0) then 181 181 write (*,'(2a)') ' redseq> no residues found in ', 182 #seqfil(1:iendst(seqfil))182 & seqfil(1:iendst(seqfil)) 183 183 stop 184 184 endif … … 188 188 endif 189 189 190 ccwrite (*,'(/,a,i4,2a)') ' redseq> ',irsml2(i)-irsml1(i)+1,191 cc #' residue(s) in molecule: ',192 cc #nmml(i)(1:iendst(nmml(i)))193 ccwrite (*,'(15(1x,a))') (seq(j),j=irsml1(i),irsml2(i))190 ! write (*,'(/,a,i4,2a)') ' redseq> ',irsml2(i)-irsml1(i)+1, 191 ! & ' residue(s) in molecule: ', 192 ! & nmml(i)(1:iendst(nmml(i))) 193 ! write (*,'(15(1x,a))') (seq(j),j=irsml1(i),irsml2(i)) 194 194 195 195 enddo … … 197 197 endif 198 198 return 199 c_______________________________________________ error199 ! _______________________________________________ error 200 200 201 201 4 write (*,'(a,i4,2a)') ' redseq> ERROR reading line No. ',nln, 202 #' in ',seqfil(1:iendst(seqfil))202 & ' in ',seqfil(1:iendst(seqfil)) 203 203 close(lunseq) 204 204 stop -
redstr.f
r2ebb8b6 rbd2278d 1 c**************************************************************2 c 3 cThis file contains the subroutines: extstr,ibegst,iendst,4 ciredin,iredrl,iopfil,5 ctolost,toupst6 c 7 cCopyright 2003-2005 Frank Eisenmenger, U.H.E. Hansmann,8 cShura Hayryan, Chin-Ku9 cCopyright 2007 Frank Eisenmenger, U.H.E. Hansmann,10 cJan H. Meinke, Sandipan Mohanty11 c 12 c**************************************************************1 !************************************************************** 2 ! 3 ! This file contains the subroutines: extstr,ibegst,iendst, 4 ! iredin,iredrl,iopfil, 5 ! tolost,toupst 6 ! 7 ! Copyright 2003-2005 Frank Eisenmenger, U.H.E. Hansmann, 8 ! Shura Hayryan, Chin-Ku 9 ! Copyright 2007 Frank Eisenmenger, U.H.E. Hansmann, 10 ! Jan H. Meinke, Sandipan Mohanty 11 ! 12 ! ************************************************************** 13 13 14 14 15 15 subroutine extstr(spr,ib,ie,str,strn,l) 16 16 17 c..........................................................18 cPURPOSE: Extract substring preceeding separator 'spr'19 cfrom 'str' searching from position 'ib' up to20 cposition 'ie' and put it into 'strn(1:l)'.21 c'ib' is shifted to position following 'spr' or22 cto 'ie+1', if 'spr' is not found23 c 24 c! 'spr' should not be blank25 c 26 cCALLS: ibegst,iendst27 c..........................................................17 ! .......................................................... 18 ! PURPOSE: Extract substring preceeding separator 'spr' 19 ! from 'str' searching from position 'ib' up to 20 ! position 'ie' and put it into 'strn(1:l)'. 21 ! 'ib' is shifted to position following 'spr' or 22 ! to 'ie+1', if 'spr' is not found 23 ! 24 ! ! 'spr' should not be blank 25 ! 26 ! CALLS: ibegst,iendst 27 ! .......................................................... 28 28 29 29 implicit integer*4 (i-n) … … 64 64 l=0 65 65 strn=blnk 66 c____________________________ make string in 'strn' left justified66 ! ____________________________ make string in 'strn' left justified 67 67 elseif (i.gt.1) then 68 68 j=iendst(strn) … … 75 75 76 76 return 77 c______________________________________________________________ Error77 ! ______________________________________________________________ Error 78 78 1 write (*,'(a)') ' extstr> Substring to be extracted is too long !' 79 79 stop 80 80 81 81 end 82 c**********************************82 ! ********************************** 83 83 integer*4 function ibegst(str) 84 84 85 c.............................................................86 cPURPOSE: returns position of 1st non-blank character in 'str'87 c 88 cCALLS: none89 c 90 c.............................................................85 ! ............................................................. 86 ! PURPOSE: returns position of 1st non-blank character in 'str' 87 ! 88 ! CALLS: none 89 ! 90 ! ............................................................. 91 91 92 92 implicit integer*4 (i-n) … … 106 106 return 107 107 end 108 c**********************************108 ! ********************************** 109 109 integer*4 function iendst(str) 110 110 111 c..............................................................112 cPURPOSE: returns position of last non-blank character in 'str'113 c 114 cCALLS: none115 c 116 c..............................................................111 ! .............................................................. 112 ! PURPOSE: returns position of last non-blank character in 'str' 113 ! 114 ! CALLS: none 115 ! 116 ! .............................................................. 117 117 118 118 implicit integer*4 (i-n) … … 132 132 return 133 133 end 134 c**************************************134 ! ************************************** 135 135 integer*4 function iredin(line,in) 136 136 137 c..........................................138 cPURPOSE: Read integer*4 value 'in' from 'line'139 cwith format 'i9'140 c 141 ciredin=0 : error status142 ciredin=1 : success143 c 144 cCALLS: ibegst,iendst145 c..........................................137 ! .......................................... 138 ! PURPOSE: Read integer*4 value 'in' from 'line' 139 ! with format 'i9' 140 ! 141 ! iredin=0 : error status 142 ! iredin=1 : success 143 ! 144 ! CALLS: ibegst,iendst 145 ! .......................................... 146 146 147 147 implicit integer*4 (i-n) … … 172 172 1 return 173 173 end 174 c*************************************174 ! ************************************* 175 175 integer*4 function iredrl(line,r) 176 176 177 c..........................................178 cPURPOSE: Read real*8 value 'r' from 'line'179 cwith format 'd17.6'180 c 181 ciredrl=0 : error status182 ciredrl=1 : success183 c 184 cCALLS: ibegst,iendst185 c..........................................177 ! .......................................... 178 ! PURPOSE: Read real*8 value 'r' from 'line' 179 ! with format 'd17.6' 180 ! 181 ! iredrl=0 : error status 182 ! iredrl=1 : success 183 ! 184 ! CALLS: ibegst,iendst 185 ! .......................................... 186 186 187 187 implicit integer*4 (i-n) 188 188 189 189 parameter (mxd =17, ! max. # of digits 190 #mxap= 6, ! max. # of digits after period191 #mxip=mxd-mxap)190 & mxap= 6, ! max. # of digits after period 191 & mxip=mxd-mxap) 192 192 193 193 real*8 r … … 222 222 1 return 223 223 end 224 c**************************224 ! ************************** 225 225 subroutine tolost(str) 226 226 227 c..........................................228 cPURPOSE: converts 'string' to lower-case229 cINPUT: str - string to be converted230 cCALLS: ibegst,iendst231 c..........................................227 ! .......................................... 228 ! PURPOSE: converts 'string' to lower-case 229 ! INPUT: str - string to be converted 230 ! CALLS: ibegst,iendst 231 ! .......................................... 232 232 233 233 include 'INCL.H' … … 246 246 return 247 247 end 248 c**************************248 ! ************************** 249 249 subroutine toupst(str) 250 250 251 c..........................................252 cPURPOSE: converts 'string' to upper-case253 cINPUT: str - string to be converted254 cCALLS: ibegst,iendst255 c..........................................251 ! .......................................... 252 ! PURPOSE: converts 'string' to upper-case 253 ! INPUT: str - string to be converted 254 ! CALLS: ibegst,iendst 255 ! .......................................... 256 256 257 257 include 'INCL.H' … … 270 270 return 271 271 end 272 c*****************************************************272 ! ***************************************************** 273 273 integer*4 function iopfil(lun,filnam,stat,format) 274 274 275 c........................................................276 cPURPOSE: open 'lun' with 'filnam' 'stat' 'format'277 c 278 creturns: 1 = file successful opened279 c0 = error during open of existing file280 c-1 = file does not exist281 c 282 cCALLS: ibegst283 c........................................................275 ! ........................................................ 276 ! PURPOSE: open 'lun' with 'filnam' 'stat' 'format' 277 ! 278 ! returns: 1 = file successful opened 279 ! 0 = error during open of existing file 280 ! -1 = file does not exist 281 ! 282 ! CALLS: ibegst 283 ! ........................................................ 284 284 285 285 implicit integer*4 (i-n) … … 299 299 if (j.gt.0.and.k.gt.0) then 300 300 open(lun,file=filnam(i:),status=stat(j:), 301 #form=format(k:),err=1)301 & form=format(k:),err=1) 302 302 iopfil=1 303 303 endif -
redvar.f
r2ebb8b6 rbd2278d 1 c**************************************************************2 c 3 cThis file contains the subroutines: redvar4 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: redvar 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 redvar 14 14 15 c...................................................................16 c 17 cPURPOSE: Read global parameters for molecules from lines18 c 19 c+--------------------------------------------------+20 c|@ molecule no. : six floats separated by commas |21 c+--------------------------------------------------+22 c 23 cNB: 1) if omit field with molecule no. assume: nml=124 c2) last 3 float are angles in deg.25 c 26 cRead and interpret file to SET and FIX internal variables27 cby commands:28 c 29 c+-----------------------------------------+30 c| molecule : residue : variable : value |31 c+-----------------------------------------+32 c 33 c* Lines containing '&' assign FIXED variable(s), they will34 cnot be varied during subsequent minimization etc.35 c 36 c* Empty LINES or lines containing '#' are ignored37 c* Several commands on same line must be separated by ';'38 c* Empty COMMANDS, i.e. ' : : ' are ignored39 c* All spaces are not significant and are therefore ignored40 c 41 c* A command consists of up to 4 (maxfld) fields, separated42 cby ':'43 c 44 c- last field : value for VARIABLE (REAL)45 c! should never be empty46 c- 1st before last: name(s) (CHAR) or index(ices) of VARIABLE(S)47 c- 2nd before last: name(s) or index(ices) of RESIDUE(S)48 c- 3rd before last: name or number(ices) of MOLECULE(S)49 c 50 c* molecules, residues, variables can be identified, either by,51 cINDICES (zones 'n1-n2' possible) or NAMES52 c 53 c* several identifiers in a field can be separated by ','54 c 55 c* INDICES: for residues - refer to numbering within molecule56 c: for variables - refer to numbering within residue57 c* ZONES: '-n2' indicates '1-n2'58 c'n1-' indicates 'n1-(all)'59 c* NAMES or their ends can be indicated by wild-card '*'60 care case-sensitive61 c 62 cExample: phi:-65; psi:-45 >set all phi=-65, all psi=-4563 com*: 180 & >set all omg, omt ... to 180 & fix them64 c5 : x* : -60 >set all xi-angles of residue 5 to 6065 c 66 cCALLS: setvar,extstr,iendst,ibegst,iopfil,iredin,iredrl67 c......................................................................15 ! ................................................................... 16 ! 17 ! PURPOSE: Read global parameters for molecules from lines 18 ! 19 ! +--------------------------------------------------+ 20 ! |@ molecule no. : six floats separated by commas | 21 ! +--------------------------------------------------+ 22 ! 23 ! NB: 1) if omit field with molecule no. assume: nml=1 24 ! 2) last 3 float are angles in deg. 25 ! 26 ! Read and interpret file to SET and FIX internal variables 27 ! by commands: 28 ! 29 ! +-----------------------------------------+ 30 ! | molecule : residue : variable : value | 31 ! +-----------------------------------------+ 32 ! 33 ! * Lines containing '&' assign FIXED variable(s), they will 34 ! not be varied during subsequent minimization etc. 35 ! 36 ! * Empty LINES or lines containing '#' are ignored 37 ! * Several commands on same line must be separated by ';' 38 ! * Empty COMMANDS, i.e. ' : : ' are ignored 39 ! * All spaces are not significant and are therefore ignored 40 ! 41 ! * A command consists of up to 4 (maxfld) fields, separated 42 ! by ':' 43 ! 44 ! - last field : value for VARIABLE (REAL) 45 ! ! should never be empty 46 ! - 1st before last: name(s) (CHAR) or index(ices) of VARIABLE(S) 47 ! - 2nd before last: name(s) or index(ices) of RESIDUE(S) 48 ! - 3rd before last: name or number(ices) of MOLECULE(S) 49 ! 50 ! * molecules, residues, variables can be identified, either by, 51 ! INDICES (zones 'n1-n2' possible) or NAMES 52 ! 53 ! * several identifiers in a field can be separated by ',' 54 ! 55 ! * INDICES: for residues - refer to numbering within molecule 56 ! : for variables - refer to numbering within residue 57 ! * ZONES: '-n2' indicates '1-n2' 58 ! 'n1-' indicates 'n1-(all)' 59 ! * NAMES or their ends can be indicated by wild-card '*' 60 ! are case-sensitive 61 ! 62 ! Example: phi:-65; psi:-45 >set all phi=-65, all psi=-45 63 ! om*: 180 & >set all omg, omt ... to 180 & fix them 64 ! 5 : x* : -60 >set all xi-angles of residue 5 to 60 65 ! 66 ! CALLS: setvar,extstr,iendst,ibegst,iopfil,iredin,iredrl 67 ! ...................................................................... 68 68 69 69 70 70 include 'INCL.H' 71 71 72 cmaxfld: max. # of fields in one command73 cmaxide: max. # of identifiers in a field74 cmaxcmd: max. # of commands to be interpreted75 cilrg: a large integer72 ! maxfld: max. # of fields in one command 73 ! maxide: max. # of identifiers in a field 74 ! maxcmd: max. # of commands to be interpreted 75 ! ilrg: a large integer 76 76 77 77 parameter (maxfld=4, 78 #maxide=30,79 #maxcmd=5000,80 #ilrg=1000000)78 & maxide=30, 79 & maxcmd=5000, 80 & ilrg=1000000) 81 81 82 82 character spcm,spfd,spcc,sphy,cmt,wdc,sfix,blnk, sglp, 83 #line*132,lincmd*132,linfld(maxfld)*132,linide*132,84 #linh*132,strg(6)*1783 & line*132,lincmd*132,linfld(maxfld)*132,linide*132, 84 & linh*132,strg(6)*17 85 85 dimension ifdend(maxfld),vlvrx(mxvr),rn(6) 86 86 logical fix,did,exa,forml(mxml),forrs(mxrs),forvr(mxvr), 87 #stvr(mxvr)87 & stvr(mxvr) 88 88 data spcm/';'/,spfd/':'/,spcc/','/,sphy/'-'/,cmt/'#'/,wdc/'*'/, 89 #sfix/'&'/,blnk/' '/, sglp/'@'/90 91 92 c___________________________________ Checks89 & sfix/'&'/,blnk/' '/, sglp/'@'/ 90 91 92 ! ___________________________________ Checks 93 93 ntlvr=ivrml1(ntlml)+nvrml(ntlml)-1 94 94 if (ntlvr.eq.0) then … … 96 96 return 97 97 endif 98 c___________________________________ Initialize98 ! ___________________________________ Initialize 99 99 100 100 io=iopfil(lunvar,varfil,'old','formatted') 101 101 if (io.eq.0) then 102 102 write (*,'(a,/,a,i3,2a)') 103 #' redvar> ERROR opening file to set variables:',104 #' LUN=',lunvar,' FILE=',varfil(1:iendst(varfil))103 & ' redvar> ERROR opening file to set variables:', 104 & ' LUN=',lunvar,' FILE=',varfil(1:iendst(varfil)) 105 105 stop 106 106 elseif (io.eq.-1) then 107 107 return 108 108 endif 109 c___________________________________ Initialization109 ! ___________________________________ Initialization 110 110 do i=1,ntlml 111 111 forml(i)=.true. … … 138 138 1 read (lunvar,'(a)',end=2) line 139 139 ile=iendst(line) 140 c_________________________________ ! ignore empty and commentary lines140 ! _________________________________ ! ignore empty and commentary lines 141 141 if (ile.gt.0.and.index(line(1:ile),cmt).le.0) then 142 142 143 c_________________________________________ Global variables143 ! _________________________________________ Global variables 144 144 ilb = index(line(1:ile),sglp)+1 145 145 if (ilb.ge.2) then … … 150 150 151 151 if (iredin(lincmd,nml).le.0.or. 152 #nml.le.0.or.nml.gt.ntlml) then152 & nml.le.0.or.nml.gt.ntlml) then 153 153 write (*,*) 'redvar> ','Incorrect molecule number >', 154 #lincmd(1:l),'< Must be in range [1,',155 #ntlml,'] !'154 & lincmd(1:l),'< Must be in range [1,', 155 & ntlml,'] !' 156 156 close(lunvar) 157 157 stop … … 179 179 if (iredrl(linh,rn(6)).le.0) goto 105 180 180 181 c---------------------------------------- check global angles181 ! ---------------------------------------- check global angles 182 182 if ( abs(rn(4)).gt.(1.8d2+1d-6) 183 #.or. abs(rn(5)).gt.(9d1+1d-6)184 #.or. abs(rn(6)).gt.(1.8d2+1d-6)185 #) goto 106183 & .or. abs(rn(5)).gt.(9d1+1d-6) 184 & .or. abs(rn(6)).gt.(1.8d2+1d-6) 185 & ) goto 106 186 186 187 187 do i = 1,3 … … 221 221 endif 222 222 223 c_________________________________________ Extract Command Fields223 ! _________________________________________ Extract Command Fields 224 224 nfld=0 225 225 icb=1 … … 235 235 236 236 enddo 237 c_______________________________ Interpret Command Fields (except last)237 ! _______________________________ Interpret Command Fields (except last) 238 238 do i=1,nfld-1 239 239 ii=i … … 255 255 enddo 256 256 endif 257 c__________________________________ Identifiers in field257 ! __________________________________ Identifiers in field 258 258 nide=0 259 259 ifb=1 … … 299 299 if (ifld.eq.3) then ! Mol. 300 300 301 c################### impossible # (inum) of molecule301 ! ################### impossible # (inum) of molecule 302 302 303 303 if (inum.le.0.or.inum.gt.ntlml) then … … 313 313 k=inum+nfi-1 314 314 315 c################### impossible # of residue (inum) in molecule315 ! ################### impossible # of residue (inum) in molecule 316 316 317 317 if (k.lt.nfi.or.k.gt.irsml2(j)) then … … 331 331 l=inum+nfi-1 332 332 333 c################### impossible # of variable (inum) in residue333 ! ################### impossible # of variable (inum) in residue 334 334 335 335 if (l.lt.nfi.or. 336 #l.gt.nfi+nvrrs(k)-1) then336 & l.gt.nfi+nvrrs(k)-1) then 337 337 write (*,*) ' # 3: ',inum 338 338 goto 104 … … 364 364 linh(1:ieh1)=nmml(j)(ib:ieh) 365 365 if (((exa.and.ieh1.eq.id).or. 366 #(.not.exa.and.ieh1.ge.id)).and.367 #linh(1:id).eq.linide(1:id))368 #forml(j)=.true.366 & (.not.exa.and.ieh1.ge.id)).and. 367 & linh(1:id).eq.linide(1:id)) 368 & forml(j)=.true. 369 369 endif 370 370 enddo … … 380 380 linh(1:ieh1)=seq(k)(ib:ieh) 381 381 if (((exa.and.ieh1.eq.id).or. 382 #(.not.exa.and.ieh1.ge.id))383 #.and.linh(1:id).eq.linide(1:id))384 #forrs(k)=.true.382 & (.not.exa.and.ieh1.ge.id)) 383 & .and.linh(1:id).eq.linide(1:id)) 384 & forrs(k)=.true. 385 385 endif 386 386 enddo … … 401 401 linh(1:ieh1)=nmvr(l)(ib:ieh) 402 402 if (((exa.and.ieh1.eq.id) 403 #.or.(.not.exa.and.ieh1.ge.id))404 #.and.linh(1:id).eq.linide(1:id))405 #forvr(l)=.true.403 & .or.(.not.exa.and.ieh1.ge.id)) 404 & .and.linh(1:id).eq.linide(1:id)) 405 & forvr(l)=.true. 406 406 endif 407 407 enddo … … 416 416 else ! ___ Zone 417 417 418 c################### impossible zone '-' (without integer)418 ! ################### impossible zone '-' (without integer) 419 419 420 420 if (ide.eq.1.and.ihy.eq.ide) then … … 429 429 linh=linide(1:ihy-1) 430 430 431 c################### impossible (to read) integer before '-'431 ! ################### impossible (to read) integer before '-' 432 432 433 433 if (iredin(linh,ibz).le.0.or.ibz.le.0) 434 #then434 & then 435 435 write (*,*) ' # 5 ' 436 436 goto 104 … … 444 444 linh=linide(ihy+1:ide) 445 445 446 c################### impossible (to read) integer after '-'446 ! ################### impossible (to read) integer after '-' 447 447 448 448 if (iredin(linh,iez).le.0.or.iez.le.0.or. 449 #iez.lt.ibz) then449 & iez.lt.ibz) then 450 450 write (*,*) ' # 6 ' 451 451 goto 104 … … 502 502 enddo ! ... Fields (excl. value) 503 503 504 c_____________________________________________________ Execute Command504 ! _____________________________________________________ Execute Command 505 505 506 506 if (iredrl(linfld(nfld),val).gt.izero) then ! Read Value … … 517 517 enddo 518 518 if (.not.did) write (*,'(3a)') 519 #' redvar> No variables affected by command >',520 #lincmd(1:ice),'<'519 & ' redvar> No variables affected by command >', 520 & lincmd(1:ice),'<' 521 521 else 522 522 … … 524 524 ll2=iendst(linfld(nfld)) 525 525 write (*,*) 'll1,ll2, linfld(nfld): ',ll1,ll2, 526 #'>',linfld(nfld)(ll1:ll2),'<'526 & '>',linfld(nfld)(ll1:ll2),'<' 527 527 528 528 goto 102 … … 535 535 536 536 2 close(lunvar) 537 c__________________________ Summary537 ! __________________________ Summary 538 538 iv=0 539 539 do i=1,ntlml … … 552 552 553 553 write (*,'(3a,/,1x,5(a,2x),a)') ' redvar> ',nmml(i)(1:ie), 554 #' with global parameters:',555 #(strg(k)(ibegst(strg(k)):),k=1,6)554 & ' with global parameters:', 555 & (strg(k)(ibegst(strg(k)):),k=1,6) 556 556 call setvar(i,vlvrx) 557 557 goto 3 … … 572 572 if (fxvr(iv)) then 573 573 write (*,'(3a,i4,1x,4a,f10.3,a)') ' redvar> ', 574 #nmml(i)(1:ie),': residue ',j-jb,seq(j),575 #': ',nmvr(iv),' set ',vlvrx(iv),' Fixed'574 & nmml(i)(1:ie),': residue ',j-jb,seq(j), 575 & ': ',nmvr(iv),' set ',vlvrx(iv),' Fixed' 576 576 else 577 577 write (*,'(3a,i4,1x,4a,f10.3)') ' redvar> ', 578 #nmml(i)(1:ie),': residue ',j-jb,seq(j),579 #': ',nmvr(iv),' set ',vlvrx(iv)578 & nmml(i)(1:ie),': residue ',j-jb,seq(j), 579 & ': ',nmvr(iv),' set ',vlvrx(iv) 580 580 endif 581 581 ity=ityvr(iv) 582 582 if (ity.eq.3.or.ity.eq.2) 583 #vlvrx(iv)=vlvrx(iv)*cdr ! angles583 & vlvrx(iv)=vlvrx(iv)*cdr ! angles 584 584 585 585 else … … 590 590 if (did) then 591 591 if (in.gt.0) write (*,'(3a,i5,a)') 592 #' redvar> Molecule ',nmml(i)(1:ie),': ',in,593 #' variable(s) remain unchanged'592 & ' redvar> Molecule ',nmml(i)(1:ie),': ',in, 593 & ' variable(s) remain unchanged' 594 594 call setvar(iml,vlvrx) 595 595 else 596 596 write (*,'(3a)') ' redvar> Molecule ', 597 #nmml(i)(1:ie),': No internal variables changed'597 & nmml(i)(1:ie),': No internal variables changed' 598 598 endif 599 599 endif … … 601 601 602 602 return 603 c____________________________________________________________ Errors603 ! ____________________________________________________________ Errors 604 604 100 write (*,'(3a)') ' redvar> Cannot interpret command >', 605 #lincmd(1:ice),'<'605 & lincmd(1:ice),'<' 606 606 close(lunvar) 607 607 stop … … 610 610 stop 611 611 102 write (*,'(3a)') ' redvar> Cannot read value from >', 612 #lincmd(1:ice),'<'612 & lincmd(1:ice),'<' 613 613 close(lunvar) 614 614 stop 615 615 103 write (*,'(a,i3,3a)') ' redvar> Cannot read >',maxide, 616 #' identifiers from >',linfld(ii)(1:ife),'<'616 & ' identifiers from >',linfld(ii)(1:ife),'<' 617 617 close(lunvar) 618 618 stop 619 619 104 write (*,'(5a)') ' redvar> Error in identifier >', 620 #linide(1:ide),'< of command >',lincmd(1:ice),'<'620 & linide(1:ide),'< of command >',lincmd(1:ice),'<' 621 621 close(lunvar) 622 622 stop 623 623 105 write (*,'(a,/,a,/,2a,/)') ' redvar> line with global paramters:', 624 #line(1:ile),' must contain 6 floating',625 #' point numbers separated by commas !'624 & line(1:ile),' must contain 6 floating', 625 & ' point numbers separated by commas !' 626 626 close(lunvar) 627 627 stop 628 628 629 629 106 write (*,'(a,/,a,/,2a,/)') ' redvar> line with global paramters:', 630 #line(1:ile),' angles must be inside ',631 #'ranges [-180,180], [-90,90], and [-180,180] Deg., respectively !'630 & line(1:ile),' angles must be inside ', 631 &'ranges [-180,180], [-90,90], and [-180,180] Deg., respectively !' 632 632 close(lunvar) 633 633 stop -
regul.f
r2ebb8b6 rbd2278d 1 c**************************************************************2 c 3 cThis file contains the subroutines: regul4 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: regul 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 regul(nml, iter, nsteps, acc) 14 14 15 c----------------------------------------------------------16 cPURPOSE: regularization of PDB-structure into SMMP geometry17 c 18 c@param nml molecule to be regularized19 c@param iter number of iterations during regularization20 c@param nsteps maximum number of steps in minimization21 c@param acc acceptance criterium for minimization22 c 23 cCALLS: minim, cnteny, outvar,rmsdopt24 c----------------------------------------------------------15 ! ---------------------------------------------------------- 16 ! PURPOSE: regularization of PDB-structure into SMMP geometry 17 ! 18 ! @param nml molecule to be regularized 19 ! @param iter number of iterations during regularization 20 ! @param nsteps maximum number of steps in minimization 21 ! @param acc acceptance criterium for minimization 22 ! 23 ! CALLS: minim, cnteny, outvar,rmsdopt 24 ! ---------------------------------------------------------- 25 25 26 26 include 'INCL.H' 27 27 include 'INCP.H' 28 28 29 cf2py intent(in) nml30 cf2py intent(in) iter31 cf2py intent(in) nsteps32 cf2py intent(in) acc29 !f2py intent(in) nml 30 !f2py intent(in) iter 31 !f2py intent(in) nsteps 32 !f2py intent(in) acc 33 33 34 34 dimension rm(3,3),av1(3),av2(3) … … 41 41 42 42 write(*,'(/,a,2(a,f4.2),/)') 43 #' ====================== Regularization only',44 #' Wt(energy) = ',wtey,' Wt(regul.) = ',wtrg43 & ' ====================== Regularization only', 44 & ' Wt(energy) = ',wtey,' Wt(regul.) = ',wtrg 45 45 46 46 call minim(1, nsteps, acc) … … 57 57 write(*,*) ' RMSD = ',rmsd 58 58 59 c--------------------------------------- fix vars. defined in PDB59 ! --------------------------------------- fix vars. defined in PDB 60 60 61 61 … … 67 67 68 68 write(*,'(/,a,2(a,f4.2),/)') 69 #' ====================== Internal Energy for Hydrogens only',70 #' Wt(energy) = ',wtey,' Wt(regul.) = ',wtrg69 & ' ====================== Internal Energy for Hydrogens only', 70 & ' Wt(energy) = ',wtey,' Wt(regul.) = ',wtrg 71 71 72 72 call minim(1, nsteps, acc) … … 95 95 96 96 write(*,'(/,a,i2,2(a,e11.3),/)') 97 #' ================ Minimization #',it,98 #' Wt(energy) = ',wtey,' Wt(regul.) = ',wtrg97 & ' ================ Minimization #',it, 98 & ' Wt(energy) = ',wtey,' Wt(regul.) = ',wtrg 99 99 100 100 call minim(1, nsteps, acc) … … 113 113 call cnteny(nml) 114 114 115 ccall outpdb(nml,12)115 ! call outpdb(nml,12) 116 116 117 cOutput of dihedral angles of the regularized structure117 ! Output of dihedral angles of the regularized structure 118 118 write(*,*) 'Dihedral angles of the regularized structure;' 119 119 call outvar(nml, 'regd.var') -
rgyr.f
r2ebb8b6 rbd2278d 1 c**************************************************************2 c 3 cThis file contains the subroutines: rgyr4 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: rgyr 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 rgyr(nml, rgy, ee) 14 14 15 CCALCULATES THE RADIUS-OF-GYRATION AND THE END-TO-END DISTANCE16 CFOR A GIVEN PROTEIN CONFORMATION17 CIf nml == 0, calculate the radius of gyration for all molecules18 C 19 Crgy = radius-of-gyration20 Cee = end-to-end distance21 C 22 CREQUIREMENTS: c_alfa has to be called BEFORE call of this subroutine23 C 24 CCALLS: NONE25 C 15 ! CALCULATES THE RADIUS-OF-GYRATION AND THE END-TO-END DISTANCE 16 ! FOR A GIVEN PROTEIN CONFORMATION 17 ! If nml == 0, calculate the radius of gyration for all molecules 18 ! 19 ! rgy = radius-of-gyration 20 ! ee = end-to-end distance 21 ! 22 ! REQUIREMENTS: c_alfa has to be called BEFORE call of this subroutine 23 ! 24 ! CALLS: NONE 25 ! 26 26 include 'INCL.H' 27 cf2py intent(in) nml28 cf2py intent(out) rgy29 cf2py intent(out) ee27 !f2py intent(in) nml 28 !f2py intent(out) rgy 29 !f2py intent(out) ee 30 30 integer typ 31 31 if (nml.eq.0) then … … 42 42 if (nat.le.0) then 43 43 write (*,'(a,i4)') 44 #' rgyr> No atoms found for molecule #',nml44 & ' rgyr> No atoms found for molecule #',nml 45 45 return 46 46 endif … … 128 128 129 129 ee = sqrt((xat(i2)-xat(i1))**2+(yat(i2)-yat(i1))**2 130 #+(zat(i2)-zat(i1))**2)130 & +(zat(i2)-zat(i1))**2) 131 131 132 132 return -
rmsdfun.f
r2ebb8b6 rbd2278d 1 c**************************************************************2 c 3 cThis file contains the subroutines: rmsdfun,rmsdopt,fitmol,4 cjacobi,rmsinit5 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 ! This file contains the subroutines: rmsdfun,rmsdopt,fitmol, 4 ! jacobi,rmsinit 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 real*8 function rmsdfun(nml,ir1,ir2,ixat,xrf,yrf,zrf,isl) 14 C 15 C--------------------------------------------------------------16 cWrapping function for calculating rmsd17 c 18 cLIMITATION: requires call of rmsinit BEFORE calling this function19 c 20 cCALLS: rmsdopt21 c 22 c---------------------------------------------------------------23 c 14 ! 15 ! -------------------------------------------------------------- 16 ! Wrapping function for calculating rmsd 17 ! 18 ! LIMITATION: requires call of rmsinit BEFORE calling this function 19 ! 20 ! CALLS: rmsdopt 21 ! 22 ! --------------------------------------------------------------- 23 ! 24 24 include 'INCL.H' 25 25 include 'INCP.H' 26 c 27 cInput26 ! 27 ! Input 28 28 dimension ixat(mxat),xrf(mxatp),yrf(mxatp),zrf(mxatp) 29 cLocal29 ! Local 30 30 dimension rm(3,3),av1(3),av2(3) 31 31 call rmsdopt(nml,ir1,ir2,ixat,xrf,yrf,zrf,isl,rm,av1,av2,rssd) … … 37 37 end 38 38 39 c*******************************************************************39 !******************************************************************* 40 40 subroutine rmsdopt(nml,ir1,ir2,ixat,xrf,yrf,zrf,isl, 41 #rm,av1,av2,rmsd)42 43 c---------------------------------------------------------------44 cPURPOSE: root mean square deviation (rmsd) between current SMMP45 cstructure and reference atom coordinates 'x,y,zrf()'46 cfor range of SMMP residues [ir1,ir2] in molecule 'nml'47 c 48 cixat(i) - points to the atom in ref. coords., which is49 cequivalent to atom i of SMMP structure50 c(=0 if no equivalent in ref. structure exists)51 c 52 cisl = 0 : select all heavy atoms53 cisl = 1 : backbone atoms n,ca,c54 cisl = 2 : only ca atoms55 c 56 cCALLS: fitmol [S.K.Kearsley, Acta Cryst. 1989, A45, 208-210]57 c 58 cNB uncomment last lines in 'fitmol' to return coordinates59 cin 'x2' after fitting the ref. str. onto SMMP structure60 c----------------------------------------------------------------41 & rm,av1,av2,rmsd) 42 43 ! --------------------------------------------------------------- 44 ! PURPOSE: root mean square deviation (rmsd) between current SMMP 45 ! structure and reference atom coordinates 'x,y,zrf()' 46 ! for range of SMMP residues [ir1,ir2] in molecule 'nml' 47 ! 48 ! ixat(i) - points to the atom in ref. coords., which is 49 ! equivalent to atom i of SMMP structure 50 ! (=0 if no equivalent in ref. structure exists) 51 ! 52 ! isl = 0 : select all heavy atoms 53 ! isl = 1 : backbone atoms n,ca,c 54 ! isl = 2 : only ca atoms 55 ! 56 ! CALLS: fitmol [S.K.Kearsley, Acta Cryst. 1989, A45, 208-210] 57 ! 58 ! NB uncomment last lines in 'fitmol' to return coordinates 59 ! in 'x2' after fitting the ref. str. onto SMMP structure 60 ! ---------------------------------------------------------------- 61 61 62 62 include 'INCL.H' 63 63 include 'INCP.H' 64 64 65 c-------------------------------------------------------- input65 !-------------------------------------------------------- input 66 66 dimension ixat(mxat),xrf(mxatp),yrf(mxatp),zrf(mxatp) 67 c-------------------------------------------------------- output67 !-------------------------------------------------------- output 68 68 dimension rm(3,3),av1(3),av2(3) 69 c-------------------------------------------------------- local69 !-------------------------------------------------------- local 70 70 dimension x1(3,mxat),x2(3,mxat) 71 71 character*4 atnm … … 99 99 if ( isl.eq.0 100 100 101 #.or.102 103 #(isl.eq.1.and.(index(atnm,'n ').gt.0 .or.104 #index(atnm,'ca ').gt.0 .or.105 #index(atnm,'c ').gt.0 ))106 #.or.107 108 #(isl.eq.2.and.index(atnm,'ca ').gt.0)109 110 #) then101 & .or. 102 103 & (isl.eq.1.and.(index(atnm,'n ').gt.0 .or. 104 & index(atnm,'ca ').gt.0 .or. 105 & index(atnm,'c ').gt.0 )) 106 & .or. 107 108 & (isl.eq.2.and.index(atnm,'ca ').gt.0) 109 110 & ) then 111 111 112 112 n=n+1 … … 136 136 return 137 137 end 138 c*********************************************138 ! ********************************************* 139 139 subroutine fitmol(n,x1,x2, rm,a1,a2,rmsd) 140 creal*8 function fitmol(n,x1,x2)141 142 c.......................................................143 cPURPOSE: compute RMSD of n positions in x1(3,) & x2(3,)144 c[S.K.Kearsley Acta Cryst. 1989,A45,208-210]145 c 146 cCALLS: jacobi147 c.......................................................148 cf2py intent(out) rmsd140 ! real*8 function fitmol(n,x1,x2) 141 142 ! ....................................................... 143 ! PURPOSE: compute RMSD of n positions in x1(3,) & x2(3,) 144 ! [S.K.Kearsley Acta Cryst. 1989,A45,208-210] 145 ! 146 ! CALLS: jacobi 147 ! ....................................................... 148 !f2py intent(out) rmsd 149 149 150 150 include 'INCL.H' 151 cimplicit real*8 (a-h,o-z)152 cimplicit integer*4 (i-n)151 ! implicit real*8 (a-h,o-z) 152 ! implicit integer*4 (i-n) 153 153 154 c------------------------------------------- input/output154 ! ------------------------------------------- input/output 155 155 dimension x1(3,mxat),x2(3,mxat) 156 c-------------------------------------------------- local156 ! -------------------------------------------------- local 157 157 dimension e(4),q(4,4),v(4,4),dm(3),dp(3),a1(3),a2(3),rm(3,3) 158 158 159 159 dn=dble(n) 160 c------------------- average of coordinates160 ! ------------------- average of coordinates 161 161 do i=1,3 162 162 a1(i) = 0.d0 … … 169 169 a2(i) = a2(i)/dn 170 170 enddo 171 c------------------------- compile quaternion171 ! ------------------------- compile quaternion 172 172 do i=1,4 173 173 do j=1,4 … … 208 208 enddo 209 209 enddo 210 c------------------------------ eigenvalues & -vectors210 ! ------------------------------ eigenvalues & -vectors 211 211 ndim4=4 212 212 call jacobi(q,ndim4,e,v) 213 c--------------------------- lowest eigenvalue213 ! --------------------------- lowest eigenvalue 214 214 im=1 215 215 em=e(1) … … 223 223 rmsd = sqrt(em/dn) 224 224 225 c================= uncomment following lines to fit molecule 2 onto 1226 227 c---------------------------------------------------rotation matrix225 ! ================= uncomment following lines to fit molecule 2 onto 1 226 227 ! ---------------------------------------------------rotation matrix 228 228 rm(1,1) = v(1,im)**2+v(2,im)**2-v(3,im)**2-v(4,im)**2 229 229 rm(1,2) = 2.d0*( v(2,im)*v(3,im)-v(1,im)*v(4,im) ) … … 236 236 rm(3,3) = v(1,im)**2+v(4,im)**2-v(2,im)**2-v(3,im)**2 237 237 238 cdo i=1,n239 cdo j=1,3240 cdm(j) = x2(j,i) - a2(j)241 cenddo242 cdo j=1,3243 cdp(j) = a1(j)244 cdo k=1,3245 cdp(j) = dp(j) + rm(j,k) * dm(k)246 cenddo247 cx2(j,i) = dp(j)248 cenddo249 cenddo250 251 cfitmol=rmsd238 ! do i=1,n 239 ! do j=1,3 240 ! dm(j) = x2(j,i) - a2(j) 241 ! enddo 242 ! do j=1,3 243 ! dp(j) = a1(j) 244 ! do k=1,3 245 ! dp(j) = dp(j) + rm(j,k) * dm(k) 246 ! enddo 247 ! x2(j,i) = dp(j) 248 ! enddo 249 ! enddo 250 251 ! fitmol=rmsd 252 252 253 253 return 254 254 end 255 c******************************255 ! ****************************** 256 256 subroutine jacobi(a,n,d,v) 257 257 258 c......................................................259 cPURPOSE: for given symmetric matrix 'a(n,n)260 ccompute eigenvalues 'd' & eigenvectors 'v(,)'261 c 262 c[W.H.Press,S.A.Teukolsky,W.T.Vetterling,263 cB.P.Flannery, Numerical Recipes in FORTRAN,264 cCambridge Univ. Press, 2nd Ed. 1992, 456-462]265 c 266 cCALLS: none267 c 268 c......................................................269 270 cf2py intent(out) d271 cf2py intent(out) v258 ! ...................................................... 259 ! PURPOSE: for given symmetric matrix 'a(n,n) 260 ! compute eigenvalues 'd' & eigenvectors 'v(,)' 261 ! 262 ! [W.H.Press,S.A.Teukolsky,W.T.Vetterling, 263 ! B.P.Flannery, Numerical Recipes in FORTRAN, 264 ! Cambridge Univ. Press, 2nd Ed. 1992, 456-462] 265 ! 266 ! CALLS: none 267 ! 268 ! ...................................................... 269 270 !f2py intent(out) d 271 !f2py intent(out) v 272 272 parameter (NMAX=500) 273 273 … … 276 276 277 277 real*8 a(n,n),d(n),v(n,n), 278 #c,g,h,s,sm,t,tau,theta,tresh,b(NMAX),z(NMAX),smeps278 & c,g,h,s,sm,t,tau,theta,tresh,b(NMAX),z(NMAX),smeps 279 279 280 280 smeps=1.0d-6 … … 318 318 if((i.gt.4).and.(abs(d(ip))+ 319 319 320 #g.eq.abs(d(ip))).and.(abs(d(iq))+g.eq.abs(d(iq))))then320 &g.eq.abs(d(ip))).and.(abs(d(iq))+g.eq.abs(d(iq))))then 321 321 a(ip,iq)=0.d0 322 322 … … 393 393 end 394 394 395 c***********************************************************395 ! *********************************************************** 396 396 397 397 subroutine rmsinit(nml,string) 398 c 399 c------------------------------------------------------------------------------400 cReads in pdb-file 'string' into INCP.H and initalizes401 cthe files that 'rmdsopt' needs to calculate the rmsd402 cof a configuration with the pdb-configuration403 C 404 cCALLS: pdbread,atixpdb405 c 406 c----------------------------------------------------------------------------407 c 398 ! 399 !------------------------------------------------------------------------------ 400 ! Reads in pdb-file 'string' into INCP.H and initalizes 401 ! the files that 'rmdsopt' needs to calculate the rmsd 402 ! of a configuration with the pdb-configuration 403 ! 404 ! CALLS: pdbread,atixpdb 405 ! 406 ! ---------------------------------------------------------------------------- 407 ! 408 408 include 'INCL.H' 409 409 include 'INCP.H' … … 412 412 413 413 if(string.eq.'smmp') then 414 c 415 cCompare with a smmp-structure416 c 414 ! 415 ! Compare with a smmp-structure 416 ! 417 417 do i=iatrs1(irsml1(nml)),iatrs2(irsml2(nml)) 418 418 if(nmat(i)(1:1).ne.'h') then … … 422 422 end if 423 423 enddo 424 c 424 ! 425 425 else 426 c 427 cReference structure is read in from pdb-file428 c 426 ! 427 ! Reference structure is read in from pdb-file 428 ! 429 429 call pdbread(string,ier) 430 430 if(ier.ne.0) stop 431 431 call atixpdb(nml) 432 c 432 ! 433 433 end if 434 434 print *,'RMSD initialized with ',string -
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' -
setvar.f
r2ebb8b6 rbd2278d 1 c**************************************************************2 c 3 cThis file contains the subroutines: setvar4 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: setvar 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 setvar(nml,vlvrx) 14 14 15 c..............................................................16 cPURPOSE: Reset variables in molecule 'nml' to new values given17 cin 'vlvrx' and rebuild molecule18 c19 c! assure constant PHASE angles for branches from same atom20 c 21 cCALLS: bldmol,difang22 c....................................................15 ! .............................................................. 16 ! PURPOSE: Reset variables in molecule 'nml' to new values given 17 ! in 'vlvrx' and rebuild molecule 18 ! 19 ! ! assure constant PHASE angles for branches from same atom 20 ! 21 ! CALLS: bldmol,difang 22 ! .................................................... 23 23 24 24 include 'INCL.H' -
universe.py
r2ebb8b6 rbd2278d 112 112 """Saves the state of this Universe.""" 113 113 pass 114 115 if __name__ == '__main__': 116 u=Universe() -
utilities.f
r2ebb8b6 rbd2278d 114 114 end subroutine distributeWorkLoad 115 115 116 c-----------------------------------------------------------------------117 cThe function fileNameMP takes a template of a file name in the118 cvariable base. The position of the first and last character that119 cmay be replaced by rank in the string are given in i1 (first) and120 ci2 (last).121 cThe function returns an empty string if the rank would need more122 ccharacters than is allowed by the template.123 cFor example,124 c\code125 crank = 11126 cfileName = fileNameMP('base_0000.dat', 6, 9, rank)127 cwrite (*,*), fileName128 c\endcode129 cwill output base_0011.dat.130 c131 c@param base the base file name, e.g., base_0000.dat.132 c@param i1 index of the first character that may be replaced133 c@param i2 index of the last character that may be replaced134 c@param rank the number that should be inserted into the file name.135 c136 c@return file name for rank137 c-----------------------------------------------------------------------116 !----------------------------------------------------------------------- 117 ! The function fileNameMP takes a template of a file name in the 118 ! variable base. The position of the first and last character that 119 ! may be replaced by rank in the string are given in i1 (first) and 120 ! i2 (last). 121 ! The function returns an empty string if the rank would need more 122 ! characters than is allowed by the template. 123 ! For example, 124 ! \code 125 ! rank = 11 126 ! fileName = fileNameMP('base_0000.dat', 6, 9, rank) 127 ! write (*,*), fileName 128 ! \endcode 129 ! will output base_0011.dat. 130 ! 131 ! @param base the base file name, e.g., base_0000.dat. 132 ! @param i1 index of the first character that may be replaced 133 ! @param i2 index of the last character that may be replaced 134 ! @param rank the number that should be inserted into the file name. 135 ! 136 ! @return file name for rank 137 !----------------------------------------------------------------------- 138 138 character*80 function fileNameMP(base, i1, i2, rank) 139 139 140 140 character*(*) base 141 ci1, i2: Index of first and last character that can be replaced142 crank: rank of node141 ! i1, i2: Index of first and last character that can be replaced 142 ! rank: rank of node 143 143 integer i1, i2, rank 144 144 … … 150 150 endif 151 151 152 cTODO: Allow arbitrary rank152 ! TODO: Allow arbitrary rank 153 153 154 154 if (rank.lt.10) then … … 166 166 endif 167 167 end function fileNameMP 168 cEnd fileNameMP168 ! End fileNameMP 169 169 -
zimmer.f
r2ebb8b6 rbd2278d 1 c**************************************************************2 c 3 cThis file contains the subroutines: zimmer4 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 cCALLS: none11 c 12 c**************************************************************1 !************************************************************** 2 ! 3 ! This file contains the subroutines: zimmer 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 ! CALLS: none 11 ! 12 ! ************************************************************** 13 13 14 14 15 15 subroutine zimmer(nresi) 16 16 17 CCalculates the Zimmerman-code of a configuration (Zimmerman et. al.18 CMacromolecules, vol. 10 (1977) 1-9.)19 C 20 CNote the difference in Notations:21 CSMMP: Zimmerman, et.al.:22 CA A23 CB B24 CC C25 CD D26 CE E27 CF F28 CG G29 CH H30 Ca A*31 Cb B*32 Cc C*33 Cd D*34 Ce E*35 Cf F*36 Cg G*37 Ch H*38 C 17 ! Calculates the Zimmerman-code of a configuration (Zimmerman et. al. 18 ! Macromolecules, vol. 10 (1977) 1-9.) 19 ! 20 ! Note the difference in Notations: 21 ! SMMP: Zimmerman, et.al.: 22 ! A A 23 ! B B 24 ! C C 25 ! D D 26 ! E E 27 ! F F 28 ! G G 29 ! H H 30 ! a A* 31 ! b B* 32 ! c C* 33 ! d D* 34 ! e E* 35 ! f F* 36 ! g G* 37 ! h H* 38 ! 39 39 include 'INCL.H' 40 cf2py intent(in) nresi40 !f2py intent(in) nresi 41 41 character*1 zim 42 42
Note:
See TracChangeset
for help on using the changeset viewer.