      SUBROUTINE  ANGLE(ZETA,CHI,RLTHT,RLPHI,STHT,SPHI,SALPH)           00010000
      IMPLICIT REAL*8(A-H,O-Z)                                          00020000
CCCCC ----TRANSFORMATION OF THE ANGULAR COORDINATES (RLTHT,RLPHI) ------00030000
C         IN THE SPACE TO (STHT,SPHI) FIXED TO SPHEROID                 00040000
C           (ZETA,CHI) -  ORIENTATION OF THE SPHEROID AXIS IN THE SPACE 00050000
C           SALPH      -  ROTATION ANGLE OF THE SCATTERING PLANE        00060000
C           UNIT OF ANGLES   -  RADIANS                                 00070000
C                                PROGRAMED BY S. ASANO IN 1973          00080000
CCCCC -----------------------------------MODIFIED IN 1978---------------00080005
      DATA  PI,EPS/3.141592653589793D0,1.D-10/                          00090000
C                                                                       00100003
      TWOPI=PI+PI                                                       00110003
      BETA=RLPHI-CHI                                                    00120000
      IF((BETA+TWOPI).LT.EPS) BETA=BETA+TWOPI                           00130000
      IF(BETA.GE.TWOPI) BETA=BETA-TWOPI                                 00140000
      IF(ZETA.GE.EPS) GO TO 10                                          00150000
      STHT=RLTHT                                                        00160000
      SPHI=BETA+PI                                                      00170000
      IF(SPHI.GE.TWOPI) SPHI=SPHI-TWOPI                                 00180000
      SALPH=0.D0                                                        00190000
      GO TO 20                                                          00200000
   10 SUM=ZETA+RLTHT                                                    00210000
      DIF=ZETA-RLTHT                                                    00220000
      IF(DABS(BETA).GE.EPS) GO TO 30                                    00230000
      IF(DABS(DIF).GE.EPS)  GO TO 40                                    00240000
      STHT=0.D0                                                         00250000
      SPHI=3.D0*PI/2.D0                                                 00260000
      IF(BETA.LT.0.D0) SPHI=PI/2.D0                                     00270000
      SALPH=3.D0*PI/2.D0                                                00280000
      IF(BETA.LT.0.D0) SALPH=PI/2.D0                                    00290000
      GO TO 20                                                          00300000
   30 IF(DABS(PI-DABS(BETA)).GT.EPS) GO TO 40                           00310000
      IF(DABS(SUM-PI).GE.EPS) GO TO 40                                  00320000
      STHT=PI                                                           00330000
      SPHI=0.D0                                                         00340000
      SALPH=0.D0                                                        00350000
      GO TO 20                                                          00360000
   40 SINT=DSIN(RLTHT)                                                  00370000
      COST=DCOS(RLTHT)                                                  00380000
      SINZ=DSIN(ZETA)                                                   00390000
      COSZ=DCOS(ZETA)                                                   00400000
      SINBP=DSIN(BETA)                                                  00410000
      COSBP=DCOS(BETA)                                                  00420000
      CT=COST*COSZ+SINT*SINZ*COSBP                                      00430000
      IF(CT.GE.1.D0)  CT=1.D0                                           00440000
      IF(CT.LT.-1.D0) CT=-1.D0                                          00450000
      STHT=DARCOS(CT)                                                   00460000
      SINST=DSIN(STHT)                                                  00470000
      SP=-SINBP*SINT/SINST                                              00480000
      CP=(SINZ*COST-COSZ*SINT*COSBP)/SINST                              00490000
      SA=-SINBP*SINZ/SINST                                              00500000
      CA=-CP*COSBP-SP*SINBP*COSZ                                        00510000
      IF(CP.GE.1.D0)  CP=1.D0                                           00520000
      IF(CP.LE.-1.D0) CP=-1.D0                                          00530000
      SPHI=DARCOS(CP)                                                   00540000
      IF(SP.LT.0.D0)  SPHI=TWOPI-SPHI                                   00550000
      IF(CA.GE.1.D0)  CA=1.D0                                           00560000
      IF(CA.LE.-1.D0) CA=-1.D0                                          00570000
      SALPH=DARCOS(CA)                                                  00580000
      IF(SA.LT.0.D0)     SALPH=TWOPI-SALPH                              00590000
      IF(SALPH.GE.TWOPI) SALPH=SALPH-TWOPI                              00600000
      IF(SPHI.GE.TWOPI)  SPHI=SPHI-TWOPI                                00610000
   20 RETURN                                                            00620000
      END                                                               00630000
