Changeset b477fe8
- Timestamp:
- 09/05/08 11:49:41 (16 years ago)
- Branches:
- master
- Children:
- 2ebb8b6
- Parents:
- 078aff3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
energy.f
r078aff3 rb477fe8 72 72 esm=esm+enysol(0) 73 73 teysl = teysl+eysl 74 elseif (itysol.lt.0) then 75 esm=esm+esolan(0) 74 else if (itysol.lt.0) then 75 eysl = esolan(0) 76 teysl = teysl + eysl 77 esm = esm + eysl 76 78 else 77 79 eysl=0.d0 … … 143 145 esm=esm+enysol(nml) 144 146 elseif (itysol.lt.0) then 145 esm=esm+esolan(nml)147 esm=esm+esolan(nml) 146 148 else 147 149 eysl=0.d0 -
esolan.f
r078aff3 rb477fe8 1 c**************************************************************2 c 3 cThis file contains the subroutines: esolan4 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: esolan 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 esolan(nmol) 13 13 14 c-----------------------------------------------------------------15 c 16 cCalculates the solvation energy of the protein with17 csolavtion parameters model E=\sum\sigma_iA_i.18 cThe solvent accessible surface area per atom19 cand its gradients with respect to the Cartesian coordinates of20 cthe atoms are calculated using the projection method described in21 c 22 cJ Comp Phys 26, 334-343, 200523 c 24 CUSAGE: eysl=esolan(nmol)-Returns the value of the solvation energy25 c 26 cINPUT: nmol - the order number of the protein chain.27 cThe atomic coordinates, radii and solvation parameters28 care taken from the global arrays of SMMP29 c 30 cOUTPUT: global array gradan(mxat,3) contains the gradients of31 csolvation energy per atom32 clocal array as(mxat) contains accessible surface area per atom33 c 34 cOutput file "solvation.dat' conatains detailed data.35 c 36 cCorrectness of this program was last time rechecked with GETAREA37 c 38 cCALLS: none39 c 40 c----------------------------------------------------------------------41 cTODO Test the solvent energy for multiple molecules14 ! ----------------------------------------------------------------- 15 ! 16 ! Calculates the solvation energy of the protein with 17 ! solavtion parameters model E=\sum\sigma_iA_i. 18 ! The solvent accessible surface area per atom 19 ! and its gradients with respect to the Cartesian coordinates of 20 ! the atoms are calculated using the projection method described in 21 ! 22 ! J Comp Phys 26, 334-343, 2005 23 ! 24 ! USAGE: eysl=esolan(nmol)-Returns the value of the solvation energy 25 ! 26 ! INPUT: nmol - the order number of the protein chain. 27 ! The atomic coordinates, radii and solvation parameters 28 ! are taken from the global arrays of SMMP 29 ! 30 ! OUTPUT: global array gradan(mxat,3) contains the gradients of 31 ! solvation energy per atom 32 ! local array as(mxat) contains accessible surface area per atom 33 ! 34 ! Output file "solvation.dat' conatains detailed data. 35 ! 36 ! Correctness of this program was last time rechecked with GETAREA 37 ! 38 ! CALLS: none 39 ! 40 ! ---------------------------------------------------------------------- 41 ! TODO Test the solvent energy for multiple molecules 42 42 43 43 include 'INCL.H' … … 59 59 60 60 61 copen(3,file='solvation.dat')! Output file with solvation data61 ! open(3,file='solvation.dat')! Output file with solvation data 62 62 63 63 energy=0.0d0 ! Total solvation energy 64 64 sss=0.0d0 ! Total solvent accessible surface area 65 numat=iatrs2(irsml2(nmol))-iatrs1(irsml1(nmol))+1 ! Number of atoms 65 if (nmol.eq.0) then 66 numat=iatrs2(irsml2(ntlml))-iatrs1(irsml1(1))+1 ! Number of atoms 67 else 68 numat=iatrs2(irsml2(nmol))-iatrs1(irsml1(nmol))+1 ! Number of atoms 69 endif 66 70 67 71 do i=1,numat … … 87 91 enddo 88 92 89 c***************************90 cStart the computations *91 c***************************93 !*************************** 94 ! Start the computations * 95 !*************************** 92 96 93 97 do 1 i=1,numat ! Lop over atoms "i" 94 c----------------------------------------------------98 ! ---------------------------------------------------- 95 99 96 100 R=rvdw(i) … … 99 103 if(i.ne.j) then 100 104 ddp=(xold(j)-xold(i))**2+(yold(j)-yold(i))**2 101 #+(zold(j)-zold(i))**2! Distance between atom i and j105 & +(zold(j)-zold(i))**2! Distance between atom i and j 102 106 if(ddp.lt.1e-10) then 103 107 write(*,*)'ERROR in data: centres of two atoms coincide!' 104 108 write(*,*)i,j,xold(i),yold(i),zold(i),rvdw(i), 105 #xold(j),yold(j),zold(j),rvdw(j)109 & xold(j),yold(j),zold(j),rvdw(j) 106 110 stop 'Centres of atoms coincide!' 107 111 endif … … 122 126 if(neib(0).eq.0) goto 1 !Finish the atom i if it doesn't have neighbors 123 127 124 c----128 !---- 125 129 R2=R*R ! R square 126 130 R22=R2+R2 ! 2 * R square … … 140 144 ddat(i,4)=0d0 141 145 ddat(i,1)=R 142 c 143 cVerification of the north point of ith sphere144 c 146 ! 147 ! Verification of the north point of ith sphere 148 ! 145 149 jjj=0 146 c 147 cIf jjj=0 then - no transformation148 celse the transformation is necessary149 c 150 ! 151 ! If jjj=0 then - no transformation 152 ! else the transformation is necessary 153 ! 150 154 k=neib(1) ! The order number of the first neighbour 151 cddp - the square minimal distance of NP from the neighboring surfaces155 ! ddp - the square minimal distance of NP from the neighboring surfaces 152 156 ddp=dabs((ddat(k,2))**2+(ddat(k,3))**2+ 153 #(R-ddat(k,4))**2-pol(k))157 & (R-ddat(k,4))**2-pol(k)) 154 158 155 159 do j=2,neib(0) 156 160 k=neib(j) 157 161 ddp2=dabs((ddat(k,2))**2+(ddat(k,3))**2+ 158 #(R-ddat(k,4))**2-pol(k))162 & (R-ddat(k,4))**2-pol(k)) 159 163 if(ddp2.lt.ddp) ddp=ddp2 160 164 enddo 161 c 162 cCheck whether the NP of ith sphere is too close to the intersection line163 c 165 ! 166 ! Check whether the NP of ith sphere is too close to the intersection line 167 ! 164 168 do while (ddp.lt.1.d-6) 165 169 jjj=jjj+1 166 c 167 cgenerate grndom numbers168 c 170 ! 171 ! generate grndom numbers 172 ! 169 173 uga=grnd() ! Random \gamma angle 170 174 ufi=grnd() ! Random \pi angle … … 182 186 k=neib(1) 183 187 ddp=dabs((xx-ddat(k,2))**2+(yy-ddat(k,3))**2+ 184 #(zz-ddat(k,4))**2-pol(k))188 & (zz-ddat(k,4))**2-pol(k)) 185 189 do j=2,neib(0) 186 190 k=neib(j) 187 191 ddp2=dabs((xx-ddat(k,2))**2+(yy-ddat(k,3))**2+ 188 #(zz-ddat(k,4))**2-pol(k))192 & (zz-ddat(k,4))**2-pol(k)) 189 193 if(ddp2.lt.ddp) ddp=ddp2 190 194 end do 191 195 end do 192 c196 ! 193 197 194 198 if(jjj.ne.0) then ! Rotation is necessary … … 206 210 endif 207 211 208 ciiiiiiiiiii212 ! iiiiiiiiiii 209 213 210 214 pom=8.d0*pol(i) 211 215 212 CIn this loop the parameters a,b,c,d for the equation213 ca*(t^2+s^2)+b*t+c*s+d=0 are calculated (see the reference article)216 ! In this loop the parameters a,b,c,d for the equation 217 ! a*(t^2+s^2)+b*t+c*s+d=0 are calculated (see the reference article) 214 218 do jj=1,neib(0) 215 219 j=neib(jj) 216 220 neibor(j,1)=(ddat(j,2))**2+(ddat(j,3))**2+ 217 #(ddat(j,4)-R)**2-pol(j) ! a221 & (ddat(j,4)-R)**2-pol(j) ! a 218 222 neibor(j,2)=-pom*ddat(j,2) ! b 219 223 neibor(j,3)=-pom*ddat(j,3) ! c 220 224 neibor(j,4)=4d0*pol(i)*((ddat(j,2))**2+ 221 #(ddat(j,3))**2+(R+ddat(j,4))**2-pol(j)) ! d225 & (ddat(j,3))**2+(R+ddat(j,4))**2-pol(j)) ! d 222 226 enddo 223 227 224 cend of the 1st cleaning228 ! end of the 1st cleaning 225 229 226 230 iv=0 … … 230 234 do while(k.gt.1) ! B 231 235 k=k-1 232 CAnalyse mutual disposition of every pair of neighbours236 ! Analyse mutual disposition of every pair of neighbours 233 237 do 13 L=neib(0),k+1,-1 ! A 234 238 … … 242 246 d2=neibor(neib(L),4)/neibor(neib(L),1) 243 247 D=4d0*((b1-b2)*(b2*d1-b1*d2)+(c1-c2)*(c2*d1-c1*d2)- 244 #(d1-d2)**2)+(b1*c2-b2*c1)**2245 Cif D<0 then the circles neib(k) and neib(L) don't intersect248 & (d1-d2)**2)+(b1*c2-b2*c1)**2 249 ! if D<0 then the circles neib(k) and neib(L) don't intersect 246 250 if(D.le.0d0.and.dsqrt((b1-b2)**2+(c1-c2)**2).le. ! a01 01 247 #dsqrt(b2*b2+c2*c2-4d0*d2)-dsqrt(b1*b1+c1*c1-4d0*d1)) then ! 04248 CCircle neib(L) encloses circle neib(k) and the later is discarded251 & dsqrt(b2*b2+c2*c2-4d0*d2)-dsqrt(b1*b1+c1*c1-4d0*d1)) then ! 04 252 ! Circle neib(L) encloses circle neib(k) and the later is discarded 249 253 neib(0)=neib(0)-1 250 254 do j=k,neib(0) … … 253 257 goto 12 254 258 elseif(D.le.0d0.and.dsqrt((b1-b2)**2+(c1-c2)**2).le. ! a01 02 255 #-dsqrt(b2*b2+c2*c2-4d0*d2)+dsqrt(b1*b1+c1*c1-4d0*d1)) then256 CThe circle neib(k) encloses circle neib(L) and the later is discarded259 & -dsqrt(b2*b2+c2*c2-4d0*d2)+dsqrt(b1*b1+c1*c1-4d0*d1)) then 260 ! The circle neib(k) encloses circle neib(L) and the later is discarded 257 261 neib(0)=neib(0)-1 258 262 do j=L,neib(0) … … 260 264 enddo 261 265 elseif(D.gt.0d0) then ! a01 03 262 CThe circles nieb(L) and neib(k) have two intersection points (IP)266 ! The circles nieb(L) and neib(k) have two intersection points (IP) 263 267 am=2d0*((b1-b2)**2+(c1-c2)**2) 264 268 t=-2d0*(b1-b2)*(d1-d2)-(b2*c1-b1*c2)*(c1-c2) … … 280 284 281 285 elseif(neibor(neib(k),1).gt.0d0.and. ! a03 282 #neibor(neib(L),1).lt.0d0) then286 & neibor(neib(L),1).lt.0d0) then 283 287 b1=neibor(neib(k),2)/neibor(neib(k),1) 284 288 c1=neibor(neib(k),3)/neibor(neib(k),1) … … 288 292 d2=neibor(neib(L),4)/neibor(neib(L),1) 289 293 D=4d0*((b1-b2)*(b2*d1-b1*d2)+(c1-c2)*(c2*d1-c1*d2)- 290 #(d1-d2)**2)+(b1*c2-b2*c1)**2291 Cif D<0 then neib(k) and neib(L) don't intersect294 & (d1-d2)**2)+(b1*c2-b2*c1)**2 295 ! if D<0 then neib(k) and neib(L) don't intersect 292 296 if(D.le.0d0.and.dsqrt((b1-b2)**2+(c1-c2)**2).le. ! a03 01 293 #-dsqrt(b2*b2+c2*c2-4d0*d2)+dsqrt(b1*b1+c1*c1-4d0*d1)) then ! 06294 CNeighbours neib(k) and neib(L) cover fully the atom "i" and as(i)=0297 & -dsqrt(b2*b2+c2*c2-4d0*d2)+dsqrt(b1*b1+c1*c1-4d0*d1)) then ! 06 298 ! Neighbours neib(k) and neib(L) cover fully the atom "i" and as(i)=0 295 299 As(i)=0.d0 296 300 goto 11 297 301 elseif(D.le.0d0.and.dsqrt((b1-b2)**2+(c1-c2)**2).ge. ! a03 02 298 #dsqrt(b2*b2+c2*c2-4d0*d2)+dsqrt(b1*b1+c1*c1-4d0*d1)) then299 CDon't exclude neib(k)302 & dsqrt(b2*b2+c2*c2-4d0*d2)+dsqrt(b1*b1+c1*c1-4d0*d1)) then 303 ! Don't exclude neib(k) 300 304 neib(0)=neib(0)-1 301 305 do j=k,neib(0) … … 304 308 goto 12 305 309 elseif(D.gt.0.d0) then ! a03 03 306 CCircles neib(L) and neib(k) have two intersection points.310 ! Circles neib(L) and neib(k) have two intersection points. 307 311 am=2d0*((b1-b2)**2+(c1-c2)**2) 308 312 t=-2d0*(b1-b2)*(d1-d2)-(b2*c1-b1*c2)*(c1-c2) … … 324 328 325 329 elseif(neibor(neib(k),1).lt.0d0.and.neibor(neib(L),1).gt.0d0)! a07 326 #then330 & then 327 331 b1=neibor(neib(k),2)/neibor(neib(k),1) 328 332 c1=neibor(neib(k),3)/neibor(neib(k),1) … … 332 336 d2=neibor(neib(L),4)/neibor(neib(L),1) 333 337 D=4d0*((b1-b2)*(b2*d1-b1*d2)+(c1-c2)*(c2*d1-c1*d2)- 334 #(d1-d2)**2)+(b1*c2-b2*c1)**2335 CIf D<0 then the circles neib(k) and neib(L) don't intersect338 & (d1-d2)**2)+(b1*c2-b2*c1)**2 339 ! If D<0 then the circles neib(k) and neib(L) don't intersect 336 340 if(D.le.0d0.and.dsqrt((b1-b2)**2+(c1-c2)**2).le. ! a07 01 337 #dsqrt(b2*b2+c2*c2-4d0*d2)-dsqrt(b1*b1+c1*c1-4d0*d1)) then ! 10338 Catom "i" is covered fully by neib(k) and neib(L) and as(i)=0.341 & dsqrt(b2*b2+c2*c2-4d0*d2)-dsqrt(b1*b1+c1*c1-4d0*d1)) then ! 10 342 ! atom "i" is covered fully by neib(k) and neib(L) and as(i)=0. 339 343 As(i)=0.d0 340 344 goto 12 341 345 elseif(D.le.0d0.and.dsqrt((b1-b2)**2+(c1-c2)**2).ge. ! a07 02 342 #dsqrt(b2*b2+c2*c2-4d0*d2)+dsqrt(b1*b1+c1*c1-4d0*d1)) then343 Cdiscard the circle neib(L)346 & dsqrt(b2*b2+c2*c2-4d0*d2)+dsqrt(b1*b1+c1*c1-4d0*d1)) then 347 ! discard the circle neib(L) 344 348 neib(0)=neib(0)-1 345 349 do j=L,neib(0) … … 347 351 enddo 348 352 elseif(D.gt.0d0) then ! a07 03 349 CThere are two IP's between neib(k) and neib(L).353 ! There are two IP's between neib(k) and neib(L). 350 354 am=2d0*((b1-b2)**2+(c1-c2)**2) 351 355 t=-2d0*(b1-b2)*(d1-d2)-(b2*c1-b1*c2)*(c1-c2) … … 355 359 p1=(c1-c2)*pom 356 360 p2=(b1-b2)*pom 357 c-- Assign t and s coordinates and the order number of circles361 !-- Assign t and s coordinates and the order number of circles 358 362 vertex(iv,1)=(t+p1)/am 359 363 vertex(iv,2)=(s-p2)/am … … 365 369 vertex(iv,3)=neib(k) 366 370 vertex(iv,4)=neib(L) 367 c--371 !-- 368 372 endif ! 10 369 373 370 374 elseif(neibor(neib(k),1).lt.0d0.and.neibor(neib(L),1).lt.0d0) ! a09 371 #then375 & then 372 376 b1=neibor(neib(k),2)/neibor(neib(k),1) 373 377 c1=neibor(neib(k),3)/neibor(neib(k),1) … … 377 381 d2=neibor(neib(L),4)/neibor(neib(L),1) 378 382 D=4d0*((b1-b2)*(b2*d1-b1*d2)+(c1-c2)*(c2*d1-c1*d2)- 379 #(d1-d2)**2)+(b1*c2-b2*c1)**2380 CD<0 - no intersection poit between neib(k) and neib(L)383 & (d1-d2)**2)+(b1*c2-b2*c1)**2 384 ! D<0 - no intersection poit between neib(k) and neib(L) 381 385 if(D.le.0d0.and.dsqrt((b1-b2)**2+(c1-c2)**2).le. 382 #dsqrt(b2*b2+c2*c2-4d0*d2)-dsqrt(b1*b1+c1*c1-4d0*d1)) then!12 ! a09 01383 Comit the circle neib(L)386 & dsqrt(b2*b2+c2*c2-4d0*d2)-dsqrt(b1*b1+c1*c1-4d0*d1)) then!12 ! a09 01 387 ! omit the circle neib(L) 384 388 neib(0)=neib(0)-1 385 389 do j=L,neib(0) … … 387 391 enddo 388 392 elseif(D.le.0d0.and.dsqrt((b1-b2)**2+(c1-c2)**2).le. ! a09 02 389 #-dsqrt(b2*b2+c2*c2-4d0*d2)+dsqrt(b1*b1+c1*c1-4d0*d1)) then390 COmit the circle neib(k)393 & -dsqrt(b2*b2+c2*c2-4d0*d2)+dsqrt(b1*b1+c1*c1-4d0*d1)) then 394 ! Omit the circle neib(k) 391 395 neib(0)=neib(0)-1 392 396 do j=k,neib(0) … … 395 399 goto 12 396 400 elseif(D.le.0.d0) then ! a09 03 397 CThe whole surface of atom "i" is covered fully, and as(i)=0.401 ! The whole surface of atom "i" is covered fully, and as(i)=0. 398 402 As(i)=0.d0 399 403 goto 11 400 404 else ! a09 04 401 CTwo intersection points405 ! Two intersection points 402 406 am=2.d0*((b1-b2)**2+(c1-c2)**2) 403 407 t=-2.d0*(b1-b2)*(d1-d2)-(b2*c1-b1*c2)*(c1-c2) … … 407 411 p1=(c1-c2)*pom 408 412 p2=(b1-b2)*pom 409 CAssign the t and s coordinates and order numbers of the circles413 ! Assign the t and s coordinates and order numbers of the circles 410 414 vertex(iv,1)=(t+p1)/am 411 415 vertex(iv,2)=(s-p2)/am … … 428 432 do j=1,neib(0) 429 433 if(neibor(neib(j),1).eq.0.d0) then 430 CCollect the lines (after rotation it is empty).434 ! Collect the lines (after rotation it is empty). 431 435 ita2=ita2+1 432 436 ta2(ita2)=j 433 437 endif 434 438 if(neibor(neib(j),1).lt.0.d0) then 435 CCollect the neighbours with inner part439 ! Collect the neighbours with inner part 436 440 ita3=ita3+1 437 441 ta3(ita3)=j … … 439 443 enddo 440 444 441 c*** Consider to remove this part.445 !*** Consider to remove this part. 442 446 if(ita2.gt.0.and.ita3.lt.1) then 443 447 As(i)=R22p … … 472 476 As(i)=0d0 473 477 endif 474 c****** End of could-be-removed part478 !****** End of could-be-removed part 475 479 476 480 neibp(0)=neib(0) … … 481 485 enddo 482 486 do j=1,neib(0) 483 C"iv" is the number of intersection point.487 ! "iv" is the number of intersection point. 484 488 do k=1,iv 485 489 if(neibp(j).eq.vertex(k,3).or.neibp(j).eq.vertex(k,4)) goto 30 486 490 enddo 487 491 ifu=ifu+1 488 CArrays with the ordering numbers of full arcs.492 ! Arrays with the ordering numbers of full arcs. 489 493 fullarc(ifu)=neibp(j) 490 494 al(ifu)=neibp(j) … … 500 504 al(0)=ifu 501 505 502 CLoop over full arcs.506 ! Loop over full arcs. 503 507 do k=1,ifu 504 508 a=neibor(fullarc(k),1) … … 512 516 d=neibor(fullarc(k),4) 513 517 if(a.ne.0d0) then !True if rotation has taken place. 514 CRemove the part of the atomic surface covered cut by this full arc518 ! Remove the part of the atomic surface covered cut by this full arc 515 519 As(i)=As(i)-aia*R22p*(1d0+(-d/a-R42)*dabs(a)/dsqrt((R42*a- 516 #d)**2+R42*(b*b+c*c)))520 & d)**2+R42*(b*b+c*c))) 517 521 dadx(1,1)=2d0*ddat(fullarc(k),2) 518 522 dadx(1,2)=2d0*ddat(fullarc(k),3) … … 533 537 gp(4)=(b*b+c*c-2d0*a*d+(R42+R42)*a*a)*div 534 538 grad(i,fullarc(k),1)=gp(1)*dadx(1,1)+gp(2)*dadx(2,1)+ 535 #gp(3)*dadx(3,1)+gp(4)*dadx(4,1)539 & gp(3)*dadx(3,1)+gp(4)*dadx(4,1) 536 540 grad(i,fullarc(k),2)=gp(1)*dadx(1,2)+gp(2)*dadx(2,2)+ 537 #gp(3)*dadx(3,2)+gp(4)*dadx(4,2)541 & gp(3)*dadx(3,2)+gp(4)*dadx(4,2) 538 542 grad(i,fullarc(k),3)=gp(1)*dadx(1,3)+gp(2)*dadx(2,3)+ 539 #gp(3)*dadx(3,3)+gp(4)*dadx(4,3)543 & gp(3)*dadx(3,3)+gp(4)*dadx(4,3) 540 544 541 545 else … … 544 548 enddo 545 549 546 cLoop over the circles with intersection points.550 ! Loop over the circles with intersection points. 547 551 do k=1,ine 548 552 jk=neib(k) ! The order number of kth neighbour. … … 602 606 yv=(bcd+2d0*R42*ak)/daba*vv1 603 607 zv=wv/a*vv1 604 CMove the (t,s) origo into the centre of this circle.605 CModify t and s coordinates of IP.608 ! Move the (t,s) origo into the centre of this circle. 609 ! Modify t and s coordinates of IP. 606 610 do j=1,nyx 607 611 ayx(j,1)=ayx(j,1)+ba ! t … … 612 616 cs=-ca 613 617 rr=0.5d0*wv/daba 614 CCalculate the polar angle of IP.618 ! Calculate the polar angle of IP. 615 619 do j=1,nyx 616 620 ayx1(j)=datan2(ayx(j,2),ayx(j,1)) 617 621 enddo 618 CSort the angles in ascending order.622 ! Sort the angles in ascending order. 619 623 do j=1,nyx-1 620 624 a1=ayx1(j) … … 650 654 do j=1,nyx 651 655 652 c653 cEscape 'bad' intersections.656 ! 657 ! Escape 'bad' intersections. 654 658 if(dabs(ayx1(j+1)-ayx1(j)).lt.1d-8) goto 40 655 659 … … 657 661 ap1=ct+rr*dcos(prob) ! The middle point of the arc. 658 662 ap2=cs+rr*dsin(prob) 659 CVerify if the middle point belongs to a covered part.660 CIf yes then omit.663 ! Verify if the middle point belongs to a covered part. 664 ! If yes then omit. 661 665 do ij=1,ial 662 666 if(neibor(al(ij),1)*(ap1*ap1+ap2*ap2)+neibor(al(ij),2)*ap1+ 663 #neibor(al(ij),3)*ap2+neibor(al(ij),4).lt.0d0) goto 40667 & neibor(al(ij),3)*ap2+neibor(al(ij),4).lt.0d0) goto 40 664 668 enddo 665 669 alp=ayx1(j) … … 675 679 dcotbma=1.d0/dtan(5d-1*(bet-alp)) 676 680 uv=daba*(bcd+2d0*R42*ak)*dcbetmalp 677 #-a*dsqrt(b2c2-4d0*a*d)*(b*dcbetpalp+c*dsbetpalp)681 & -a*dsqrt(b2c2-4d0*a*d)*(b*dcbetpalp+c*dsbetpalp) 678 682 As(i)=As(i)+R2*(aia*(alp-bet)+(d+R42*a)*vv1*(pi-2d0* 679 #datan(uv/(2d0*ak*vv*dsbetmalp))))683 & datan(uv/(2d0*ak*vv*dsbetmalp)))) 680 684 kk=vrx(j,4) 681 685 LL=vrx(j+1,4) … … 696 700 am2=wv*aia*a2*(ab2*dsbet-ac2*dcbet) 697 701 dalp(1)=(b1*ab1+c1*ac1-2d0*d*a1*a1-a* 698 1(b1*b1+c1*c1-4d0*a1*d1)-2d0*d*aia*a1*(ab1*699 2dcalp+ac1*dsalp)/wv+wv*aia*a1*700 3(b1*dcalp+c1*dsalp))/am1702 & (b1*b1+c1*c1-4d0*a1*d1)-2d0*d*aia*a1*(ab1* 703 & dcalp+ac1*dsalp)/wv+wv*aia*a1* 704 & (b1*dcalp+c1*dsalp))/am1 701 705 dalp(2)=(-a1*ab1+b*a1*a1+b*aia*a1*(ab1* 702 1dcalp+ac1*dsalp)/wv-wv*aia*a1*a1*dcalp)/am1706 & dcalp+ac1*dsalp)/wv-wv*aia*a1*a1*dcalp)/am1 703 707 dalp(3)=(-a1*ac1+c*a1*a1+c*aia*a1*(ab1* 704 #dcalp+ac1*dsalp)/wv-wv*aia*a1*a1*dsalp)/am1708 & dcalp+ac1*dsalp)/wv-wv*aia*a1*a1*dsalp)/am1 705 709 dalp(4)=(-2d0*a*a1*a1-2d0*daba*a1*(ab1* 706 #dcalp+ac1*dsalp)/wv)/am1710 & dcalp+ac1*dsalp)/wv)/am1 707 711 dbet(1)=(b2*ab2+c2*ac2-2d0*d*a2*a2-a* 708 #(b2*b2+c2*c2-4d0*a2*d2)-2d0*d*aia*a2*(ab2*709 #dcbet+ac2*dsbet)/wv+wv*aia*a2*710 #(b2*dcbet+c2*dsbet))/am2712 & (b2*b2+c2*c2-4d0*a2*d2)-2d0*d*aia*a2*(ab2* 713 & dcbet+ac2*dsbet)/wv+wv*aia*a2* 714 & (b2*dcbet+c2*dsbet))/am2 711 715 dbet(2)=(-a2*ab2+b*a2*a2+b*aia*a2*(ab2* 712 #dcbet+ac2*dsbet)/wv-wv*aia*a2*a2*dcbet)/am2716 & dcbet+ac2*dsbet)/wv-wv*aia*a2*a2*dcbet)/am2 713 717 dbet(3)=(-a2*ac2+c*a2*a2+c*aia*a2*(ab2* 714 #dcbet+ac2*dsbet)/wv-wv*aia*a2*a2*dsbet)/am2718 & dcbet+ac2*dsbet)/wv-wv*aia*a2*a2*dsbet)/am2 715 719 dbet(4)=(-2d0*a*a2*a2-2d0*daba*a2*(ab2* 716 #dcbet+ac2*dsbet)/wv)/am2720 & dcbet+ac2*dsbet)/wv)/am2 717 721 daalp(1)=(-b*ab1-c*ac1+wv*wv*a1+2d0*ak*d1+ 718 #wv*aia*((ab1-b*a1)*dcalp+(ac1-c*a1)*dsalp))/am1722 & wv*aia*((ab1-b*a1)*dcalp+(ac1-c*a1)*dsalp))/am1 719 723 daalp(2)=(a*ab1-ak*b1+wv*daba*a1*dcalp)/am1 720 724 daalp(3)=(a*ac1-ak*c1+wv*daba*a1*dsalp)/am1 721 725 daalp(4)=(2d0*ak*a1)/am1 722 726 dabet(1)=(-b*ab2-c*ac2+wv*wv*a2+2d0*ak*d2+ 723 #wv*aia*((ab2-b*a2)*dcbet+(ac2-c*a2)*dsbet))/am2727 & wv*aia*((ab2-b*a2)*dcbet+(ac2-c*a2)*dsbet))/am2 724 728 dabet(2)=(a*ab2-ak*b2+wv*daba*a2*dcbet)/am2 725 729 dabet(3)=(a*ac2-ak*c2+wv*daba*a2*dsbet)/am2 … … 734 738 dx(4)=1d0*vv1-(d+R42*a)*dv(4)*vv2 735 739 dy(1)=(-2d0*d+4d0*R42*a)/daba*vv1-(b*b+c*c-2d0*a*d+2d0* 736 #R42*ak)*(aia*vv+daba*dv(1))/ak*vv2740 & R42*ak)*(aia*vv+daba*dv(1))/ak*vv2 737 741 dy(2)=2d0*b/daba*vv1-(b*b+c*c-2d0*a*d+2d0* 738 #R42*ak)*aia*dv(2)/a*vv2742 & R42*ak)*aia*dv(2)/a*vv2 739 743 dy(3)=2d0*c/daba*vv1-(b*b+c*c-2d0*a*d+2d0* 740 #R42*ak)*aia*dv(3)/a*vv2744 & R42*ak)*aia*dv(3)/a*vv2 741 745 dy(4)=-2.d0*a/daba*vv1-(b*b+c*c-2.d0*a*d+2.d0* 742 #R42*ak)*aia*dv(4)/a*vv2746 & R42*ak)*aia*dv(4)/a*vv2 743 747 dz(1)=-2d0*d/wv/a*vv1-wv*(vv+a*dv(1))/ak*vv2 744 748 dz(2)=b/wv/a*vv1-wv*dv(2)/a*vv2 … … 746 750 dz(4)=-2d0/wv*vv1-wv*dv(4)/a*vv2 747 751 dt(1)=dcotbma*dy(1)-5d-1*yv* 748 1(dbet(1)-dalp(1))/dsbetmalp**2-((b*dcbetpalp+749 2c*dsbetpalp)/dsbetmalp)*dz(1)-750 35d-1*zv*(((-b*dsbetpalp+c*dcbetpalp)*dsbetmalp)*751 4(dalp(1)+dbet(1))-((b*dcbetpalp+c*dsbetpalp)*752 5dcbetmalp)*(dbet(1)-dalp(1)))/dsbetmalp**2752 & (dbet(1)-dalp(1))/dsbetmalp**2-((b*dcbetpalp+ 753 & c*dsbetpalp)/dsbetmalp)*dz(1)- 754 & 5d-1*zv*(((-b*dsbetpalp+c*dcbetpalp)*dsbetmalp)* 755 & (dalp(1)+dbet(1))-((b*dcbetpalp+c*dsbetpalp)* 756 & dcbetmalp)*(dbet(1)-dalp(1)))/dsbetmalp**2 753 757 dt(2)=dcotbma*dy(2)-5d-1*yv* 754 1(dbet(2)-dalp(2))/dsbetmalp**2-(b*dcbetpalp+755 2c*dsbetpalp)/dsbetmalp*dz(2)-756 35d-1*zv*((-b*dsbetpalp+c*dcbetpalp)*dsbetmalp*757 4(dalp(2)+dbet(2))-(b*dcbetpalp+c*dsbetpalp)*758 5dcbetmalp*(dbet(2)-dalp(2))+dcbetpalp759 6*2d0*dsbetmalp)/dsbetmalp**2758 & (dbet(2)-dalp(2))/dsbetmalp**2-(b*dcbetpalp+ 759 & c*dsbetpalp)/dsbetmalp*dz(2)- 760 & 5d-1*zv*((-b*dsbetpalp+c*dcbetpalp)*dsbetmalp* 761 & (dalp(2)+dbet(2))-(b*dcbetpalp+c*dsbetpalp)* 762 & dcbetmalp*(dbet(2)-dalp(2))+dcbetpalp 763 & *2d0*dsbetmalp)/dsbetmalp**2 760 764 dt(3)=dcotbma*dy(3)-5d-1*yv* 761 1(dbet(3)-dalp(3))/dsbetmalp**2-(b*dcbetpalp+762 2c*dsbetpalp)/dsbetmalp*dz(3)-763 35d-1*zv*((-b*dsbetpalp+c*dcbetpalp)*dsbetmalp*764 4(dalp(3)+dbet(3))-(b*dcbetpalp+c*dsbetpalp)*765 5dcbetmalp*(dbet(3)-dalp(3))+dsbetpalp*2d0*766 6dsbetmalp)/dsbetmalp**2765 & (dbet(3)-dalp(3))/dsbetmalp**2-(b*dcbetpalp+ 766 & c*dsbetpalp)/dsbetmalp*dz(3)- 767 & 5d-1*zv*((-b*dsbetpalp+c*dcbetpalp)*dsbetmalp* 768 & (dalp(3)+dbet(3))-(b*dcbetpalp+c*dsbetpalp)* 769 & dcbetmalp*(dbet(3)-dalp(3))+dsbetpalp*2d0* 770 & dsbetmalp)/dsbetmalp**2 767 771 dt(4)=dcotbma*dy(4)-5d-1*yv* 768 1(dbet(4)-dalp(4))/dsbetmalp**2-(b*dcbetpalp+769 2c*dsbetpalp)/dsbetmalp*dz(4)-770 35d-1*zv*((-b*dsbetpalp+c*dcbetpalp)*dsbetmalp*771 4(dalp(4)+dbet(4))-(b*dcbetpalp+c*dsbetpalp)*772 5dcbetmalp*(dbet(4)-dalp(4)))/dsbetmalp**2772 & (dbet(4)-dalp(4))/dsbetmalp**2-(b*dcbetpalp+ 773 & c*dsbetpalp)/dsbetmalp*dz(4)- 774 & 5d-1*zv*((-b*dsbetpalp+c*dcbetpalp)*dsbetmalp* 775 & (dalp(4)+dbet(4))-(b*dcbetpalp+c*dsbetpalp)* 776 & dcbetmalp*(dbet(4)-dalp(4)))/dsbetmalp**2 773 777 di(1)=R2*(aia*(dalp(1)-dbet(1))+(pi-2d0*datan(5d-1*tt))* 774 #dx(1)-4d0*xv*dt(1)/(4d0+tt**2))778 & dx(1)-4d0*xv*dt(1)/(4d0+tt**2)) 775 779 di(2)=R2*(aia*(dalp(2)-dbet(2))+(pi-2d0*datan(5d-1*tt))* 776 #dx(2)-4d0*xv*dt(2)/(4d0+tt**2))780 & dx(2)-4d0*xv*dt(2)/(4d0+tt**2)) 777 781 di(3)=R2*(aia*(dalp(3)-dbet(3))+(pi-2d0*datan(5d-1*tt))* 778 #dx(3)-4d0*xv*dt(3)/(4d0+tt**2))782 & dx(3)-4d0*xv*dt(3)/(4d0+tt**2)) 779 783 di(4)=R2*(aia*(dalp(4)-dbet(4))+(pi-2d0*datan(5d-1*tt))* 780 #dx(4)-4d0*xv*dt(4)/(4d0+tt**2))784 & dx(4)-4d0*xv*dt(4)/(4d0+tt**2)) 781 785 dii(1,1)=2d0*ddat(jk,2) 782 786 dii(1,2)=2d0*ddat(jk,3) … … 794 798 do idi=1,3 795 799 grad(i,jk,idi)=grad(i,jk,idi)+ 796 #di(1)*dii(1,idi)+di(2)*dii(2,idi)+797 #di(3)*dii(3,idi)+di(4)*dii(4,idi)800 & di(1)*dii(1,idi)+di(2)*dii(2,idi)+ 801 & di(3)*dii(3,idi)+di(4)*dii(4,idi) 798 802 799 803 enddo 800 804 do idi=1,4 801 805 dta(idi)=5d-1*daalp(idi)*(((yv-zv*((-b*dsbetpalp 802 1+c*dcbetpalp)*dsbetmalp+803 2(b*dcbetpalp+c*dsbetpalp)*804 3dcbetmalp))/dsbetmalp**2))806 & +c*dcbetpalp)*dsbetmalp+ 807 & (b*dcbetpalp+c*dsbetpalp)* 808 & dcbetmalp))/dsbetmalp**2)) 805 809 dtb(idi)=5d-1*dabet(idi)*(((-yv-zv*((-b*dsbetpalp 806 1+c*dcbetpalp)*dsbetmalp-807 2(b*dcbetpalp+c*dsbetpalp)*808 3dcbetmalp))/dsbetmalp**2))810 & +c*dcbetpalp)*dsbetmalp- 811 & (b*dcbetpalp+c*dsbetpalp)* 812 & dcbetmalp))/dsbetmalp**2)) 809 813 di1(idi)=R2*(aia*daalp(idi)-4d0*xv*dta(idi)/(4d0+tt*tt)) 810 814 di2(idi)=R2*(-aia*dabet(idi)-4d0*xv*dtb(idi)/(4d0+tt*tt)) … … 819 823 do idi=1,3 820 824 grad(i,kk,idi)=grad(i,kk,idi)+ 821 1di1(1)*dii(1,idi)+di1(2)*dii(2,idi)+822 2di1(3)*dii(3,idi)+di1(4)*dii(4,idi)825 & di1(1)*dii(1,idi)+di1(2)*dii(2,idi)+ 826 & di1(3)*dii(3,idi)+di1(4)*dii(4,idi) 823 827 enddo 824 828 … … 831 835 do idi=1,3 832 836 grad(i,LL,idi)=grad(i,LL,idi)+ 833 1di2(1)*dii(1,idi)+di2(2)*dii(2,idi)+834 2di2(3)*dii(3,idi)+di2(4)*dii(4,idi)837 & di2(1)*dii(1,idi)+di2(2)*dii(2,idi)+ 838 & di2(3)*dii(3,idi)+di2(4)*dii(4,idi) 835 839 enddo 836 840 … … 843 847 a1=dsin(ang) 844 848 a2=dcos(ang) 845 cRotate the intersection points by the angle "ang".846 cAfter rotation the position of IP will be defined847 cby its first coordinate "ax(.,1)".849 ! Rotate the intersection points by the angle "ang". 850 ! After rotation the position of IP will be defined 851 ! by its first coordinate "ax(.,1)". 848 852 do j=1,nyx 849 853 ax(j,1)=ayx(j,1)*a2-ayx(j,2)*a1 850 854 ax(j,2)=ayx(j,1)*a1+ayx(j,2)*a2 851 855 enddo 852 CSorting by acsending order.856 ! Sorting by acsending order. 853 857 do j=1,nyx-1 854 858 a1=ax(j,1) … … 899 903 p1=ayx(1,1)+c*probe(1) 900 904 p2=ayx(1,2)-b*probe(1) 901 CVerify if the middle point belongs to a covered part.902 COmit, if yes.905 ! Verify if the middle point belongs to a covered part. 906 ! Omit, if yes. 903 907 do L=1,ial 904 908 if(neibor(al(L),1)*(p1*p1+p2*p2)+neibor(al(L),2)*p1+ 905 #neibor(al(L),3)*p2+neibor(al(L),4).lt.0d0) goto 20909 & neibor(al(L),3)*p2+neibor(al(L),4).lt.0d0) goto 20 906 910 enddo 907 911 arg2=bc*ayx1(1)+caba … … 914 918 do L=1,ial 915 919 if(neibor(al(L),1)*(p1*p1+p2*p2)+neibor(al(L),2)*p1+ 916 #neibor(al(L),3)*p2+neibor(al(L),4).lt.0d0) goto 21920 & neibor(al(L),3)*p2+neibor(al(L),4).lt.0d0) goto 21 917 921 enddo 918 922 arg1=bc*ayx1(j-1)+caba … … 925 929 do L=1,ial 926 930 if(neibor(al(L),1)*(p1*p1+p2*p2)+neibor(al(L),2)*p1+ 927 1neibor(al(L),3)*p2+neibor(al(L),4).lt.0d0) goto 22931 & neibor(al(L),3)*p2+neibor(al(L),4).lt.0d0) goto 22 928 932 enddo 929 933 arg1=bc*ayx1(nyx)+caba … … 934 938 11 continue 935 939 936 c 937 cchanged in 2004940 ! 941 ! changed in 2004 938 942 939 943 do j=1,ine … … 952 956 953 957 if(jjj.ne.0) then 954 CRestore the original configuration if the molecule has been rotated.955 CThis is necessary for calculation of gradients.958 ! Restore the original configuration if the molecule has been rotated. 959 ! This is necessary for calculation of gradients. 956 960 xx=grad(i,i,1) 957 961 yy=grad(i,i,2) … … 988 992 111 continue 989 993 990 cwrite(3,*)' No Area sigma Enrg gradx grady',991 c #' gradz Rad Atom'992 cwrite(3,*)994 ! write(3,*)' No Area sigma Enrg gradx grady', 995 ! & ' gradz Rad Atom' 996 ! write(3,*) 993 997 994 998 … … 1000 1004 if (nmat(i)(1:1).eq.'h') ratom=0.0 1001 1005 1002 cwrite(3,700),i,As(i),sigma(i),1003 c #enr,(gradan(i,k),k=1,3),ratom,nmat(i)1006 ! write(3,700),i,As(i),sigma(i), 1007 ! & enr,(gradan(i,k),k=1,3),ratom,nmat(i) 1004 1008 1005 1009 enddo 1006 1010 1007 cwrite(3,*)'Total Area: ',sss1008 cwrite(3,*)'Total solvation energy: ',energy1011 ! write(3,*)'Total Area: ',sss 1012 ! write(3,*)'Total solvation energy: ',energy 1009 1013 1010 1014 esolan=sss 1011 1015 1012 cclose(3)1016 ! close(3) 1013 1017 return 1014 1018
Note:
See TracChangeset
for help on using the changeset viewer.