Files
sics/difrac/sysang.f
2000-02-07 10:38:55 +00:00

74 lines
3.0 KiB
Fortran
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
C-----------------------------------------------------------------------
C Decide on the crystal system based on the cell edges and angles
C-----------------------------------------------------------------------
SUBROUTINE ANGSYS (ABC,SANG,CANG,ISYS)
DIMENSION ABC(3),SANG(3),CANG(3),ANG(3)
EQUIVALENCE (ABC(1),A), (ABC(2),B), (ABC(3),C),
$ (ANG(1),AL),(ANG(2),BE),(ANG(3),GA)
DATA RA/57.2958/,TAN/0.1/,TED/0.01/
C-----------------------------------------------------------------------
C Make the angles from their sines and cosines
C-----------------------------------------------------------------------
DO 100 I = 1,3
ANG(I) = RA*ATAN2(SANG(I),CANG(I))
100 CONTINUE
ISYS = 0
IF (AMOD(AL - BE) .GT. TAN) THEN
C-----------------------------------------------------------------------
C Monoclinic or triclinic ?
C-----------------------------------------------------------------------
IF (AMOD(AL - GA) .GT. TAN) THEN
C-----------------------------------------------------------------------
C Triclinic
C-----------------------------------------------------------------------
ISYS = 1
ELSE
C-----------------------------------------------------------------------
C Monoclinic
C-----------------------------------------------------------------------
ISYS = 2
ENDIF
ELSE
C-----------------------------------------------------------------------
C Cubic, rhombohedral, hexagonal, tetragonal, or orthorhombic
C-----------------------------------------------------------------------
IF (AMOD(AL - GA) .GT. TAN) THEN
C-----------------------------------------------------------------------
C Hexagonal
C-----------------------------------------------------------------------
ISYS = 5
ELSE
IF(AMOD(AL - 90.0) .GT. TAN) THEN
C-----------------------------------------------------------------------
C Rhombohedral
C-----------------------------------------------------------------------
ISYS = 6
ELSE
IF (AMOD(A - B) .GT. TED) THEN
C-----------------------------------------------------------------------
C Orthorhombic
C-----------------------------------------------------------------------
ISYS = 3
ELSE
IF (AMOD(B - C) .GT. TED) THEN
C-----------------------------------------------------------------------
C Tetragonal
C-----------------------------------------------------------------------
ISYS = 4
C-----------------------------------------------------------------------
C Cubic
C-----------------------------------------------------------------------
ELSE
ISYS = 7
ENDIF
ENDIF
ENDIF
ENDIF
ENDIF
C-----------------------------------------------------------------------
C Just in case !!
C-----------------------------------------------------------------------
IF (ISYS .EQ. 0) ISYS = 1
RETURN
END