Line | |
---|
1 | subroutine pdist(np,x,scale,nbins,y) |
---|
2 | c calculate distribution function for x, store in y |
---|
3 | c np is the number of points in x |
---|
4 | c mx is the memory spacing for the x-array |
---|
5 | c distribution will be calculated for the range from -scale to + scale |
---|
6 | c nbins is the number of bins |
---|
7 | c my is the memory spacing for the y-array |
---|
8 | c-------------------------------------------------------------------------- |
---|
9 | c |
---|
10 | include 'param_sz.h' |
---|
11 | include 'ucom.h' |
---|
12 | c |
---|
13 | dimension x(2,imaa),y(2,imaa) |
---|
14 | c-------------------------------------------------------------------------- |
---|
15 | c* |
---|
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 |
---|
32 | c++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++* |
---|
Note: See
TracBrowser
for help on using the repository browser.