Changeset 972


Ignore:
Timestamp:
Jun 28, 2013 2:27:59 PM (8 years ago)
Author:
vondreele
Message:

more fixups of MC/SA

Location:
trunk/fsource
Files:
2 added
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/fsource/pypowder.for

    r971 r972  
    187187      END
    188188
    189      
    190189      SUBROUTINE PYMDCALC(MDVAL,MDAXIS,NUNIQ,UNIQ,G,MDCORR)
    191190Cf2py intent(in) MDVAL
     
    198197      INTEGER*4 NUNIQ
    199198      REAL*4 MDVAL,MDAXIS(0:2),UNIQ(0:3*NUNIQ-1),G(3,3),MDCORR
    200       REAL*4 SUMMD
    201 
    202       SUMMD = FLOAT(NUNIQ)
    203 c      IF ( MDVAL .NE. 1.0) THEN
    204 c        DO I=0,NUNIQ-1
    205 
    206 
    207 
    208 c        sumMD = len(Uniq)
    209 c        if MDval != 1.0:
    210 c            for H in Uniq:
    211 c                cosP,sinP = G2lat.CosSinAngle(H,MDaxis,G)
    212 c                A = 1.0/np.sqrt((MDval*cosP)**2+sinP**2/MDval)
    213 c                sumMD += A**3
    214 c            sumMD = np.sum(1./np.sqrt((MDval*cosP)**2+sinP**2/MDval)**3)
    215 c        return sumMD/len(Uniq)
     199
     200      CALL MDCALC(MDVAL,MDAXIS,G,NUNIQ,UNIQ,MDCORR)
    216201      RETURN
    217202      END
     
    249234      END
    250235
     236      SUBROUTINE PYMCSAMDSFCALC(INV,NTD,TDATA,MDATA,XDATA,
     237     1  MDVAL,MDAXIS,G,MUL,NFFS,FFS,NUNIQ,UNIQ,PHI,ICALC)
     238Cf2py intent(in) INV
     239Cf2py intent(in) NTD
     240Cf2py intent(in) TDATA
     241cf2py depend(NTD) TDATA
     242Cf2py intent(in) MDATA
     243cf2py depend(NTD) MDATA
     244Cf2py intent(in) XDATA
     245cf2py depend(NTD) XDATA
     246Cf2py intent(in) MDVAL
     247Cf2py intent(in) MDAXIS
     248Cf2py intent(in) G
     249Cf2py intent(in) MUL
     250Cf2py intent(in) NFFS
     251Cf2py intent(in) FFS
     252cf2py depend(NFFS) FFS
     253Cf2py intent(in) NUNIQ
     254Cf2py intent(in) UNIQ
     255cf2py depend(NUNIQ) UNIQ
     256Cf2py intent(in) PHI
     257cf2py depend(NUNIQ) PHI
     258Cf2py intent(out) ICALC
     259
     260      LOGICAL*4 INV
     261      INTEGER*4 NTD,MUL,NFFS,NUNIQ,TDATA(0:NTD-1)
     262      REAL*4 XDATA(0:3*NTD-1),UNIQ(0:3*NUNIQ-1)
     263      REAL*4 MDATA(0:NTD-1),FFS(0:NFFS-1)
     264      REAL*4 ICALC,PHI(0:NUNIQ-1),MDVAL,MDAXIS(0:2),G(3,3)
     265      REAL*4 MDCORR
     266
     267      CALL MCSASFCALC(INV,NTD,TDATA,MDATA,XDATA,MUL,NFFS,FFS,
     268     1  NUNIQ,UNIQ,PHI,ICALC)
     269      CALL MDCALC(MDVAL,MDAXIS,G,NUNIQ,UNIQ,MDCORR)
     270      ICALC = ICALC*MDCORR
     271      RETURN
     272      END
     273
    251274C Fortran (fast) linear interpolation -- B.H. Toby 9/2011
    252275      SUBROUTINE PYFINTERP(NIN,XIN,YIN,NOUT,XOUT,YOUT)
Note: See TracChangeset for help on using the changeset viewer.