Changeset 349


Ignore:
Timestamp:
Aug 20, 2011 11:16:52 AM (12 years ago)
Author:
vondreele
Message:

restore psVoight fortran powder peak routine - faster than fft python

Location:
trunk/fsource
Files:
2 copied

Legend:

Unmodified
Added
Removed
  • trunk/fsource/pypowder.for

    r232 r349  
    1       SUBROUTINE PYPSVFCJ(YCALC,DTT,TTHETA,SIG,GAM,SPH,SMH,
    2      1  PRFUNC,DPRDT,DPRDY,SIGPART,GAMPART,SPHPART,SMHPART)
     1      SUBROUTINE PYPSVFCJ(NPTS,DTT,TTHETA,SIG,GAM,SPH,PRFUNC)
    32C DTT in degrees
    43C TTHETA in degrees
    54C SPH is S/L + H/L
    6 C SML is S/L - H/L (frequently zero)
    7 Cf2py intent(in) YCALC
     5Cf2py intent(in) NPTS
    86Cf2py intent(in) DTT
     7cf2py depend(NPTS) DTT
    98Cf2py intent(in) TTHETA
    109Cf2py intent(in) SIG
    1110Cf2py intent(in) GAM
    1211Cf2py intent(in) SPH
    13 Cf2py intent(in) SMH
    1412Cf2py intent(out) PRFUNC
    15 Cf2py intent(out) DPRDT
    16 Cf2py intent(out) DPRDY
    17 Cf2py intent(out) SIGPART
    18 Cf2py intent(out) GAMPART
    19 Cf2py intent(out) SPHPART
    20 Cf2py intent(out) SMHPART
    21       SL = (SPH+SMH)/2.0
    22       HL = (SPH-SMH)/2.0
     13Cf2py depend(NPTS) PRFUNC
     14
     15      REAL*4 DTT(0:NPTS-1),PRFUNC(0:NPTS-1)
     16      SL = SPH/2.0
    2317      FW = (2.355*SQRT(SIG)+GAM)/100.0
    2418      FMIN = 10.0*(-FW-SPH*COSD(TTHETA))
    2519      FMAX = 15.0*FW
    26       IF ( DTT .GE. FMIN .AND. DTT .LE. FMAX ) THEN
    27         CALL PSVFCJ(DTT*100.,TTHETA*100.,SL,HL,SIG,GAM,
    28      1    PRFUNC,DPRDT,SLPART,HLPART,SIGPART,GAMPART)
    29         DPRDT = DPRDT*YCALC*100.0
    30         DPRDY = PRFUNC
    31         SIGPART = SIGPART*YCALC
    32         GAMPART = GAMPART*YCALC
    33         SPHPART = 0.5*(SLPART+HLPART)*YCALC
    34         SMHPART = 0.5*(SLPART-HLPART)*YCALC
    35       ELSE
    36         PRFUNC = 0.0
    37         DPRDT = 0.0
    38         DPRDY = 0.0
    39         SIGPART = 0.0
    40         GAMPART = 0.0
    41         SPHPART = 0.0
    42         SMHPART = 0.0
    43       END IF
    44       RETURN
    45       END
    46 
    47       SUBROUTINE BUILDMV(WDELT,W,M,DP,A,V)
    48 Cf2py intent(in) WDELT
    49 Cf2py intent(in) W
    50 Cf2py intent(in) M
    51 Cf2py intent(in) DP
    52 Cf2py depend(M) DP
    53 Cf2py intent(in,out) A
    54 Cf2py depend(M) a
    55 Cf2py intent(in,out) V
    56 Cf2py depend(M) V
    57       REAL*4 DP(M),A(M,M),V(M)
    58       DO I=1,M
    59         V(I) = V(I)+WDELT*DP(I)
    60         DO J=1,M
    61           A(I,J) = A(I,J)+W*DP(I)*DP(J)
    62         END DO
     20      DO I=0,NPTS-1
     21        CALL PSVFCJ(DTT(I)*100.,TTHETA*100.,SL,SL,SIG,GAM,
     22     1    PRFUNC(I),DPRDT,SLPART,HLPART,SIGPART,GAMPART)
    6323      END DO
    6424      RETURN
    6525      END
    66      
Note: See TracChangeset for help on using the changeset viewer.