Initial revision
This commit is contained in:
54
difrac/pfind.f
Normal file
54
difrac/pfind.f
Normal file
@@ -0,0 +1,54 @@
|
||||
C-----------------------------------------------------------------------
|
||||
C Get the coarse value of Phi for PCENTR
|
||||
C-----------------------------------------------------------------------
|
||||
SUBROUTINE PFIND (TIM)
|
||||
INCLUDE 'COMDIF'
|
||||
DIMENSION PCOUNT(NSIZE)
|
||||
EQUIVALENCE (ACOUNT(9*NSIZE + 1), PCOUNT(1))
|
||||
C-----------------------------------------------------------------------
|
||||
C If offset by 2.5 deg and do 20 0.25 deg steps then we should find
|
||||
C the maximum.
|
||||
C-----------------------------------------------------------------------
|
||||
STEPM = 0.05
|
||||
PSTEP = 0.25
|
||||
NPTS = 20
|
||||
NATT = 0
|
||||
C-----------------------------------------------------------------------
|
||||
C Offset phi to the start of the scan
|
||||
C-----------------------------------------------------------------------
|
||||
100 POFFS = PSTEP*10.0
|
||||
PHI = PHI - POFFS
|
||||
IF (PHI .LT. 0.0) PHI = PHI + 360.0
|
||||
IF (PHI .GE. 360.0) PHI = PHI - 360.0
|
||||
PHIOFF = PHI
|
||||
CALL ANGSET (THETA,OMEGA,CHI,PHI,NATT,ICOL)
|
||||
C-----------------------------------------------------------------------
|
||||
C Find the max intensity either by step and count or by doing a scan,
|
||||
C depending on the type of diffractometer
|
||||
C-----------------------------------------------------------------------
|
||||
ICOUNT = 0
|
||||
MCOUNT = 0
|
||||
DO 110 I = 1,NPTS
|
||||
CALL CTIME (TIM,PCOUNT(I))
|
||||
IF (PCOUNT(I) .GT. MCOUNT) THEN
|
||||
MCOUNT = PCOUNT(I)
|
||||
ICOUNT = I
|
||||
ENDIF
|
||||
PHI = PHI + PSTEP
|
||||
IF (PHI .LT. 0.0) PHI = PHI + 360.0
|
||||
IF (PHI .GE. 360.0) PHI = PHI - 360.0
|
||||
CALL ANGSET (THETA,OMEGA,CHI,PHI,NATT,ICOL)
|
||||
110 CONTINUE
|
||||
IF (ICOUNT .EQ. 1 .OR. ICOUNT .EQ. NPTS) THEN
|
||||
TIM = 5.0
|
||||
RETURN
|
||||
ENDIF
|
||||
PHI = PHIOFF + (ICOUNT - 1)*PSTEP
|
||||
TIM = 500.0*TIM/PCOUNT(ICOUNT)
|
||||
IF (TIM .LT. 10000.0) THEN
|
||||
IF (TIM .LT. 1000.) TIM = 1000.
|
||||
PSTEP = PSTEP/4
|
||||
IF (PSTEP .GT. STEPM) GO TO 100
|
||||
ENDIF
|
||||
RETURN
|
||||
END
|
||||
Reference in New Issue
Block a user