Changeset 32289cd for esolan.f


Ignore:
Timestamp:
11/19/09 11:29:41 (14 years ago)
Author:
baerbaer <baerbaer@…>
Branches:
master
Children:
38d77eb
Parents:
6650a56
Message:

Explicitly declare variables.

git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/smmp/trunk@33 26dc1dd8-5c4e-0410-9ffe-d298b4865968

File:
1 edited

Legend:

Unmodified
Added
Removed
  • esolan.f

    r6650a56 r32289cd  
    44!
    55! Copyright 2003-2005  Frank Eisenmenger, U.H.E. Hansmann,
    6 !                      Shura Hayryan, Chin-Ku 
     6!                      Shura Hayryan, Chin-Ku
    77! Copyright 2007       Frank Eisenmenger, U.H.E. Hansmann,
    88!                      Jan H. Meinke, Sandipan Mohanty
     
    1414! -----------------------------------------------------------------
    1515!
    16 ! Calculates the solvation energy of the protein with 
    17 ! solavtion parameters model E=\sum\sigma_iA_i. 
     16! Calculates the solvation energy of the protein with
     17! solavtion parameters model E=\sum\sigma_iA_i.
    1818! The solvent accessible surface area per atom
    19 ! and its gradients with respect to the Cartesian coordinates of 
     19! and its gradients with respect to the Cartesian coordinates of
    2020! the atoms are calculated using the projection method described in
    2121!
     
    2525!
    2626! INPUT: nmol - the order number of the protein chain.
    27 !      The atomic coordinates, radii and solvation parameters 
     27!      The atomic coordinates, radii and solvation parameters
    2828!      are taken from the global arrays of SMMP
    2929!
    30 ! OUTPUT: global array gradan(mxat,3) contains the gradients of 
     30! OUTPUT: global array gradan(mxat,3) contains the gradients of
    3131!         solvation energy per atom
    3232!         local array as(mxat) contains accessible surface area per atom
     
    4242
    4343      include 'INCL.H'
    44      
    45      
     44
     45
    4646      integer nmol, ks0, ks2
    4747Cf2py intent(in) nmol
    48      
     48
    4949      parameter (ks0=mxat*(mxat+1))
    5050      parameter (ks2=mxat+mxat)
     
    5353
    5454      integer neib, neibp, ivrx, iv, ial, i, ij, j, iii, idi,ivr, ifu,
    55      &          ita2, ita3, ine, kk, j2, jkk, jjj, jj, jk, k, l, ll, 
     55     &          ita2, ita3, ine, kk, j2, jkk, jjj, jj, jk, k, l, ll,
    5656     &          nb, numat, nyx
    5757      real*8 vertex, ax, pol, as, ayx, ayx1, probe, dd, ddat, dadx, gp,
    5858     &          dalp,dbet, daalp, dabet, vrx, dv, dx, dy, dz, dt, di,
    59      &          dii, ss, dta, dtb, di1, di2, gs, xold, yold, zold, 
     59     &          dii, ss, dta, dtb, di1, di2, gs, xold, yold, zold,
    6060     &          energy, sss, a1, a, ab1, a2, aa, ac2, ac1, ab2, am2,
    6161     &          am, aia, ak, alp, am1, ap1, amibe, amabe, amaal, amial,
     
    6363     &          ba, bcd, bc, bet, c1, c, c2, cc, sfcg, caba, cg, cfsg,
    6464     &          cfcg, daba, ct, cs, d1, d2, dbe, dal, dcotbma, dcbet,
    65      &          dcalp, dcbetmalp, dcbetpalp, ddp2, div, dsbetmalp, 
    66      &          dsalp, dsbet, yy, dsbetpalp, enr, p1, p2, r42, r22, 
     65     &          dcalp, dcbetmalp, dcbetpalp, ddp2, div, dsbetmalp,
     66     &          dsalp, dsbet, yy, dsbetpalp, enr, p1, p2, r42, r22,
    6767     &          r22p, r2, pom, prob, r, r42p, ratom, rr, s, sfsg, sf,
    68      &          sg, vv1, t, ufi, tt, uga, uv, vv, vv2, wv, xx, xv, yv, 
     68     &          sg, vv1, t, ufi, tt, uga, uv, vv, vv2, wv, xx, xv, yv,
    6969     &          zz, zv
    7070      dimension neib(0:mxat),neibp(0:mxat),ivrx(ks0)
     
    7878      integer ta2(0:mxat),ta3(0:mxat),fullarc(0:mxat),al(0:ks2)
    7979      real*8 neibor(mxat,4)
    80      
     80
    8181      real*8, dimension(:, :, :), allocatable :: grad
    82      
     82
    8383      allocate(grad(mxat, mxat, 3))
    84      
    85      
     84
     85
    8686!     open(3,file='solvation.dat')! Output file with solvation data
    8787
     
    9090      if (nmol.eq.0) then
    9191         numat=iatrs2(irsml2(ntlml))-iatrs1(irsml1(1))+1 ! Number of atoms
    92       else 
     92      else
    9393         numat=iatrs2(irsml2(nmol))-iatrs1(irsml1(nmol))+1 ! Number of atoms
    9494      endif
     
    9696      do i=1,numat
    9797        do j=1,3
    98          gradan(i,j)=0.0d0 
     98         gradan(i,j)=0.0d0
    9999      end do
    100100      end do
     
    102102      do i=1,numat
    103103         xold(i)=xat(i)! Redefine the coordinates just for safety
    104          yold(i)=yat(i)! 
    105          zold(i)=zat(i)! 
    106       pol(i)=rvdw(i)*rvdw(i)!The water radius is already added in 'main' 
     104         yold(i)=yat(i)!
     105         zold(i)=zat(i)!
     106      pol(i)=rvdw(i)*rvdw(i)!The water radius is already added in 'main'
    107107      As(i)=pi4*pol(i)! Initially the whole surface of the atom is accessible.
    108108      end do
    109      
     109
    110110             do iii=1,numat
    111111              do jjj=1,numat
     
    120120!***************************
    121121
    122       do 1 i=1,numat ! Lop over atoms "i"           
     122      do 1 i=1,numat ! Lop over atoms "i"
    123123! ----------------------------------------------------
    124          
    125        R=rvdw(i) 
     124
     125       R=rvdw(i)
    126126       jj=0
    127127        do j=1,numat !Find the neighbours of "i"
     
    132132         write(*,*)'ERROR in data: centres of two atoms coincide!'
    133133         write(*,*)i,j,xold(i),yold(i),zold(i),rvdw(i),
    134      &                   xold(j),yold(j),zold(j),rvdw(j) 
     134     &                   xold(j),yold(j),zold(j),rvdw(j)
    135135         stop 'Centres of atoms coincide!'
    136136       endif
     
    146146         end if
    147147         end do!Neighbours
    148        
     148
    149149       neib(0)=jj   ! The number of neighbors of "i"
    150150
     
    197197!
    198198        uga=grnd() ! Random \gamma angle
    199         ufi=grnd() ! Random \pi angle 
     199        ufi=grnd() ! Random \pi angle
    200200        uga=pi*uga/2
    201201        ufi=pi*ufi/2
     
    219219        end do
    220220      end do
    221 !       
    222      
     221!
     222
    223223       if(jjj.ne.0) then ! Rotation is necessary
    224224         sfsg=sf*sg
     
    243243      do jj=1,neib(0)
    244244      j=neib(jj)
    245        neibor(j,1)=(ddat(j,2))**2+(ddat(j,3))**2+     
     245       neibor(j,1)=(ddat(j,2))**2+(ddat(j,3))**2+
    246246     &            (ddat(j,4)-R)**2-pol(j)           ! a
    247247        neibor(j,2)=-pom*ddat(j,2)                  ! b
     
    259259       do while(k.gt.1)               ! B
    260260        k=k-1
    261 ! Analyse mutual disposition of every pair of neighbours                                                     
     261! Analyse mutual disposition of every pair of neighbours
    262262        do 13 L=neib(0),k+1,-1        ! A
    263263
     
    283283          elseif(D.le.0d0.and.dsqrt((b1-b2)**2+(c1-c2)**2).le.      ! a01 02
    284284     &    -dsqrt(b2*b2+c2*c2-4d0*d2)+dsqrt(b1*b1+c1*c1-4d0*d1)) then
    285 ! The circle neib(k) encloses circle neib(L) and the later is discarded 
     285! The circle neib(k) encloses circle neib(L) and the later is discarded
    286286           neib(0)=neib(0)-1
    287287           do j=L,neib(0)
     
    326326          elseif(D.le.0d0.and.dsqrt((b1-b2)**2+(c1-c2)**2).ge.  ! a03 02
    327327     &      dsqrt(b2*b2+c2*c2-4d0*d2)+dsqrt(b1*b1+c1*c1-4d0*d1)) then
    328 ! Don't exclude neib(k) 
     328! Don't exclude neib(k)
    329329           neib(0)=neib(0)-1
    330330           do j=k,neib(0)
     
    370370          elseif(D.le.0d0.and.dsqrt((b1-b2)**2+(c1-c2)**2).ge.   ! a07 02
    371371     &      dsqrt(b2*b2+c2*c2-4d0*d2)+dsqrt(b1*b1+c1*c1-4d0*d1)) then
    372 ! discard the circle neib(L) 
     372! discard the circle neib(L)
    373373           neib(0)=neib(0)-1
    374374           do j=L,neib(0)
     
    385385           p2=(b1-b2)*pom
    386386!-- Assign t and s coordinates and the order number of circles
    387            vertex(iv,1)=(t+p1)/am 
     387           vertex(iv,1)=(t+p1)/am
    388388           vertex(iv,2)=(s-p2)/am
    389389           vertex(iv,3)=neib(k)
     
    394394           vertex(iv,3)=neib(k)
    395395           vertex(iv,4)=neib(L)
    396 !-- 
     396!--
    397397          endif                                                 ! 10
    398398
     
    491491            dbe=amabe-amibe
    492492            if(dal.lt.pi) then
    493              As(i)=R22*(pi-dal) 
     493             As(i)=R22*(pi-dal)
    494494            elseif(dbe.lt.pi) then
    495495             As(i)=R22*(pi-dbe)
     
    510510       enddo
    511511       do j=1,neib(0)
    512 ! "iv" is the number of intersection point. 
     512! "iv" is the number of intersection point.
    513513        do k=1,iv
    514514       if(neibp(j).eq.vertex(k,3).or.neibp(j).eq.vertex(k,4)) goto 30
     
    532532       do k=1,ifu
    533533         a=neibor(fullarc(k),1)
    534          if(a.lt.0.d0) then 
     534         if(a.lt.0.d0) then
    535535          aia=-1.d0
    536536         else
     
    579579         ak=a*a
    580580         daba=dabs(a)
    581          if(a.lt.0d0) then 
     581         if(a.lt.0d0) then
    582582          aia=-1d0
    583583          else
     
    679679          do j=1,nyx
    680680
    681 ! 
     681!
    682682!  Escape 'bad' intersections.
    683683           if(dabs(ayx1(j+1)-ayx1(j)).lt.1d-8) goto 40
     
    686686           ap1=ct+rr*dcos(prob) ! The middle point of the arc.
    687687           ap2=cs+rr*dsin(prob)
    688 ! Verify if the middle point belongs to a covered part. 
     688! Verify if the middle point belongs to a covered part.
    689689! If yes then omit.
    690690           do ij=1,ial
     
    754754             dabet(3)=(a*ac2-ak*c2+wv*daba*a2*dsbet)/am2
    755755             dabet(4)=(2d0*ak*a2)/am2
    756                dv(2)=R42*b*vv1     
    757                dv(3)=R42*c*vv1     
    758                dv(4)=(d-R42*a)*vv1     
    759                dv(1)=-dv(4)*R42     
    760                dx(1)=R42*vv1-(d+R42*a)*dv(1)*vv2     
    761              dx(2)=-(d+R42*a)*dv(2)*vv2     
    762              dx(3)=-(d+R42*a)*dv(3)*vv2     
    763              dx(4)=1d0*vv1-(d+R42*a)*dv(4)*vv2     
     756               dv(2)=R42*b*vv1
     757               dv(3)=R42*c*vv1
     758               dv(4)=(d-R42*a)*vv1
     759               dv(1)=-dv(4)*R42
     760               dx(1)=R42*vv1-(d+R42*a)*dv(1)*vv2
     761             dx(2)=-(d+R42*a)*dv(2)*vv2
     762             dx(3)=-(d+R42*a)*dv(3)*vv2
     763             dx(4)=1d0*vv1-(d+R42*a)*dv(4)*vv2
    764764             dy(1)=(-2d0*d+4d0*R42*a)/daba*vv1-(b*b+c*c-2d0*a*d+2d0*
    765765     &             R42*ak)*(aia*vv+daba*dv(1))/ak*vv2
     
    769769     &             R42*ak)*aia*dv(3)/a*vv2
    770770               dy(4)=-2.d0*a/daba*vv1-(b*b+c*c-2.d0*a*d+2.d0*
    771      &             R42*ak)*aia*dv(4)/a*vv2     
     771     &             R42*ak)*aia*dv(4)/a*vv2
    772772             dz(1)=-2d0*d/wv/a*vv1-wv*(vv+a*dv(1))/ak*vv2
    773773             dz(2)=b/wv/a*vv1-wv*dv(2)/a*vv2
     
    820820             dii(4,2)=dii(1,2)*R42
    821821             dii(4,3)=2d0*(ddat(jk,4)+R)*R42
    822              
     822
    823823             do idi=1,3
    824824              grad(i,jk,idi)=grad(i,jk,idi)+
     
    826826     &                   di(3)*dii(3,idi)+di(4)*dii(4,idi)
    827827
    828              enddo             
     828             enddo
    829829             do idi=1,4
    830830               dta(idi)=5d-1*daalp(idi)*(((yv-zv*((-b*dsbetpalp
     
    838838             di1(idi)=R2*(aia*daalp(idi)-4d0*xv*dta(idi)/(4d0+tt*tt))
    839839            di2(idi)=R2*(-aia*dabet(idi)-4d0*xv*dtb(idi)/(4d0+tt*tt))
    840              enddo             
     840             enddo
    841841
    842842             dii(1,1)=2d0*ddat(kk,2)
     
    86686640           continue
    867867          enddo
    868          
     868
    869869         else ! analyse the case with lines (not necessary after rotation).
    870870
     
    920920           enddo
    921921           probe(nyx+1)=ayx1(nyx)+1d0
    922            
     922
    923923
    924924           bc=b*b+c*c
     
    96096022           continue
    961961            endif
    962          enddo       
     962         enddo
    96396311      continue
    964964
     
    10171017111   continue
    10181018
    1019 !     write(3,*)'   No   Area    sigma   Enrg    gradx   grady',     
     1019!     write(3,*)'   No   Area    sigma   Enrg    gradx   grady',
    10201020!    & '   gradz   Rad    Atom'
    10211021!     write(3,*)
    10221022
    1023      
     1023
    10241024      do i=1,numat
    10251025        enr=As(i)*sigma(i)
     
    10381038
    10391039      esolan=sss
    1040      
     1040
    10411041      deallocate(grad)
    10421042!     close(3)
     
    10461046200   format(2i4,3f16.6)
    10471047700   format(i5,7f8.3,5x,a4)
    1048          
     1048
    10491049      end
Note: See TracChangeset for help on using the changeset viewer.