Ignore:
Timestamp:
Jun 28, 2013 9:05:31 AM (9 years ago)
Author:
vondreele
Message:

update binwin2.7 with new G77 pyd files.
add mcsasubs to fsource directory
some mods to GSASIImath.py to accommodate them

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/fsource/pypowder.for

    r969 r971  
    181181      RETURN
    182182      END
    183 
    184       SUBROUTINE PYMCSASFCALC(INV,NTD,TDATA,MDATA,X,MUL,NFFS,FFS,
    185      1  NUNIQ,U,PHI,ICALC)
     183     
     184      SUBROUTINE PYSETUPSINTAB()
     185      CALL SETUPSINTAB
     186      RETURN
     187      END
     188
     189     
     190      SUBROUTINE PYMDCALC(MDVAL,MDAXIS,NUNIQ,UNIQ,G,MDCORR)
     191Cf2py intent(in) MDVAL
     192Cf2py intent(in) MDAXIS
     193Cf2py intent(in) NUNIQ
     194cf2py depend(NUNIQ) UNIQ
     195Cf2py intent(in) G
     196Cf2py intent(out) MDCORR
     197
     198      INTEGER*4 NUNIQ
     199      REAL*4 MDVAL,MDAXIS(0:2),UNIQ(0:3*NUNIQ-1),G(3,3),MDCORR
     200      REAL*4 SUMMD
     201
     202      SUMMD = FLOAT(NUNIQ)
     203c      IF ( MDVAL .NE. 1.0) THEN
     204c        DO I=0,NUNIQ-1
     205
     206
     207
     208c        sumMD = len(Uniq)
     209c        if MDval != 1.0:
     210c            for H in Uniq:
     211c                cosP,sinP = G2lat.CosSinAngle(H,MDaxis,G)
     212c                A = 1.0/np.sqrt((MDval*cosP)**2+sinP**2/MDval)
     213c                sumMD += A**3
     214c            sumMD = np.sum(1./np.sqrt((MDval*cosP)**2+sinP**2/MDval)**3)
     215c        return sumMD/len(Uniq)
     216      RETURN
     217      END
     218
     219      SUBROUTINE PYMCSASFCALC(INV,NTD,TDATA,MDATA,XDATA,MUL,NFFS,FFS,
     220     1  NUNIQ,UNIQ,PHI,ICALC)
    186221Cf2py intent(in) INV
    187222Cf2py intent(in) NTD
     
    190225Cf2py intent(in) MDATA
    191226cf2py depend(NTD) MDATA
    192 Cf2py intent(in) X
    193 cf2py depend(NTD) X
     227Cf2py intent(in) XDATA
     228cf2py depend(NTD) XDATA
    194229Cf2py intent(in) MUL
    195230Cf2py intent(in) NFFS
     
    197232cf2py depend(NFFS) FFS
    198233Cf2py intent(in) NUNIQ
    199 Cf2py intent(in) U
    200 cf2py depend(NUNIQ) U
     234Cf2py intent(in) UNIQ
     235cf2py depend(NUNIQ) UNIQ
    201236Cf2py intent(in) PHI
    202237cf2py depend(NUNIQ) PHI
     
    204239
    205240      LOGICAL*4 INV
    206       INTEGER*4 NTD,MUL,NFFS,NUNIQ,I,J,K,TDATA(0:NTD-1)
    207       REAL*4 X(0:3*NTD-1),U(0:3*NUNIQ-1)
     241      INTEGER*4 NTD,MUL,NFFS,NUNIQ,TDATA(0:NTD-1)
     242      REAL*4 XDATA(0:3*NTD-1),UNIQ(0:3*NUNIQ-1)
    208243      REAL*4 MDATA(0:NTD-1),FFS(0:NFFS-1)
    209244      REAL*4 ICALC,PHI(0:NUNIQ-1)
    210       REAL*4 PHASE(0:NTD,0:NUNIQ),FF(0:NTD-1),FAS,FBS,TWOPI
    211 
    212       TWOPI = 8.0*ATAN(1.0)
    213       DO I=0,NTD-1
    214         FF(I) = FFS(TDATA(I))*MDATA(I)/NUNIQ
    215         DO J=0,NUNIQ-1
    216           PHASE(I,J) = 0.
    217           DO K=0,2
    218             PHASE(I,J) = PHASE(I,J)+U(3*J+K)*X(3*I+K)
    219           END DO
    220           PHASE(I,J) = PHASE(I,J)+PHI(J)
    221         END DO
    222       END DO
    223       FAS = 0.
    224       FBS = 0.
    225       DO I=0,NTD-1
    226         DO J=0,NUNIQ-1
    227           FAS = FAS+FF(I)*COS(TWOPI*PHASE(I,J))
    228           IF ( .NOT. INV ) FBS = FBS+FF(I)*SIN(TWOPI*PHASE(I,J))
    229         END DO
    230       END DO
    231       ICALC = (FAS**2+FBS**2)*MUL
     245
     246      CALL MCSASFCALC(INV,NTD,TDATA,MDATA,XDATA,MUL,NFFS,FFS,
     247     1  NUNIQ,UNIQ,PHI,ICALC)
    232248      RETURN
    233249      END
Note: See TracChangeset for help on using the changeset viewer.