source: PSPA/parmelaPSPA/trunk/pdist.f @ 418

Last change on this file since 418 was 12, checked in by lemeur, 12 years ago

parmela pspa initial

File size: 982 bytes
Line 
1      subroutine pdist(np,x,scale,nbins,y)
2c     calculate distribution function for x, store in y
3c     np is the number of points in x
4c     mx is the memory spacing for the x-array
5c     distribution will be calculated for the range from -scale to + scale
6c     nbins is the number of bins
7c     my is the memory spacing for the y-array
8c--------------------------------------------------------------------------
9c
10      include 'param_sz.h'
11      include 'ucom.h'
12c
13      dimension x(2,imaa),y(2,imaa)
14c--------------------------------------------------------------------------
15c*
16      dx=2.*scale/(nbins-1)
17      rn=1./np
18      do 10 i=1,nbins
19      y(1,i)=0.
20  10  continue
21      do 20 i=1,np
22      j=(x(1,i)+scale)/dx + 1.5
23      if(j.lt.1)j=1
24      if(j.gt.nbins)go to 20
25      y(1,j)=y(1,j)+rn
26  20  continue
27      do 30 i=2,nbins
28      y(1,i)=y(1,i-1)+y(1,i)
29  30  continue
30      return
31      end
32c++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*
Note: See TracBrowser for help on using the repository browser.