source: trunk/fsource/mcsasubs/mcsasfcalc.for @ 971

Last change on this file since 971 was 971, checked in by vondreele, 9 years ago

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

File size: 832 bytes
Line 
1      SUBROUTINE MCSASFCALC(INV,NTD,TDATA,MDATA,XDATA,MUL,NFFS,FFS,
2     1  NUNIQ,UNIQ,PHI,ICALC)
3     
4      LOGICAL*4 INV
5      INTEGER*4 NTD,MUL,NFFS,NUNIQ,I,J,K,TDATA(0:NTD-1)
6      REAL*4 XDATA(0:3*NTD-1),UNIQ(0:3*NUNIQ-1)
7      REAL*4 MDATA(0:NTD-1),FFS(0:NFFS-1)
8      REAL*4 ICALC,PHI(0:NUNIQ-1)
9      REAL*4 PHASE,FF,FAS,FBS,TWOPI
10
11      TWOPI = 8.0*ATAN(1.0)
12      FAS = 0.
13      FBS = 0.
14      DO I=0,NTD-1
15        FF = FFS(TDATA(I))*MDATA(I)/NUNIQ
16        DO J=0,NUNIQ-1
17          PHASE = 0.
18          DO K=0,2
19            PHASE = PHASE+UNIQ(3*J+K)*XDATA(3*I+K)
20          END DO
21          PHASE = PHASE+PHI(J)
22          FAS = FAS+FF*COS(TWOPI*PHASE)
23          IF ( .NOT. INV ) FBS = FBS+FF*SIN(TWOPI*PHASE)
24        END DO
25      END DO
26      ICALC = (FAS**2+FBS**2)*MUL
27      RETURN
28      END
Note: See TracBrowser for help on using the repository browser.