Rev | Line | |
---|

[248] | 1 | SUBROUTINE HISTOGRAM2D(N,X,Y,Z,NXBINS,NYBINS,XLIM,YLIM,DX,DY, |
---|

| 2 | 1 NST,HST) |
---|

[232] | 3 | |
---|

[247] | 4 | Cf2py intent(in) n |
---|

| 5 | Cf2py intent(in) x |
---|

| 6 | Cf2py depend(n) x |
---|

| 7 | Cf2py intent(in) y |
---|

| 8 | Cf2py depend(n) y |
---|

| 9 | Cf2py intent(in) z |
---|

| 10 | Cf2py depend(n) z |
---|

| 11 | Cf2py intent(in) nxbins |
---|

| 12 | Cf2py intent(in) nybins |
---|

| 13 | Cf2py intent(in) xlim |
---|

[248] | 14 | Cf2py intent(in) ylim |
---|

| 15 | Cf2py intent(in) dx |
---|

| 16 | Cf2py intent(in) dy |
---|

| 17 | Cf2py intent(in,out) nst |
---|

[247] | 18 | Cf2py depend(nxbins,nybins) nst |
---|

[248] | 19 | Cf2py intent(in,out) hst |
---|

[247] | 20 | Cf2py depend(nxbins,nybins) hst |
---|

[232] | 21 | |
---|

| 22 | IMPLICIT NONE |
---|

| 23 | INTEGER*4 N |
---|

| 24 | REAL*4 X(0:N-1),Y(0:N-1),Z(0:N-1) |
---|

[248] | 25 | INTEGER*8 NXBINS,NYBINS |
---|

[232] | 26 | REAL*8 XLIM(0:1),YLIM(0:1) |
---|

[248] | 27 | REAL*4 NST(0:NXBINS-1,0:NYBINS-1) |
---|

| 28 | REAL*4 HST(0:NXBINS-1,0:NYBINS-1) |
---|

[232] | 29 | |
---|

| 30 | INTEGER*4 I,J,K |
---|

| 31 | REAL*8 DX,DY |
---|

[271] | 32 | DO K=0,N-1 |
---|

[274] | 33 | I = INT((X(K)-XLIM(0))/DX) |
---|

| 34 | J = INT((Y(K)-YLIM(0))/DY) |
---|

| 35 | IF ( (I .GE. 0 .AND. I .LT. NXBINS) .AND. |
---|

| 36 | 1 (J .GE. 0 .AND. J .LT. NYBINS) ) THEN |
---|

| 37 | NST(I,J) = NST(I,J)+1.0 |
---|

| 38 | HST(I,J) = HST(I,J)+Z(K) |
---|

[232] | 39 | END IF |
---|

| 40 | END DO |
---|

| 41 | RETURN |
---|

| 42 | END |
---|

**Note:** See

TracBrowser
for help on using the repository browser.