Ask Question

Name:
Title:
Your Question:

Answer Question

Name:
Your Answer:
User Submitted Source Code!


Description:
  tomat
Language: FORTRAN
Code:
     do k0a=1,nspecie
        do k0b=1,nspecie
           do k1a=1,ns(k0a)
              do k1b =1,ns(k0b)
                 
                 dx = xx(iconf,k0a,k1a) - xx(iconf,k0b,k1b)
                 dy = yy(iconf,k0a,k1a) - yy(iconf,k0b,k1b)
                 dz = zz(iconf,k0a,k1a) - zz(iconf,k0b,k1b)
                 
                 call MON_PBC(dx,dy,dz,cell)
                 
                 sss = sqrt(dx*dx + dy*dy + dz*dz)
                 ndif = int(sss/dr) + 1
                 
                 if(ndif.ne.1) his(ndif,k0a,k0b) = his(ndif,k0a,k0b) + 1 
                 
              enddo
           enddo
        enddo
     enddo
  enddo
  
  ! the density of the ideal gas and normalization
  rho(1) = dble(natms) / vol
  const(1)=4.d0*pi*rho(1)/3.0

  do i=1,ndrmax
     
     rlower = dble(i-1)*dr
     rupper = rlower + dr
     nideal(1) = const(1) * (rupper**3 - rlower**3)
     do k0a=1,nspecie
        gr(i,k0a,1:nspecie) = dble(his(i,k0a,1:nspecie))/dble(nconf)/(dble(natms))&
             /nideal(1)
     enddo
  enddo
Comments: