C....*...1.........2.........3.........4.........5.........6.........7.*.......8
C     AMPHAS   8/21/72
C
C     PURPOSE
C     COMPUTE THE AMPLITUDE AND PHASE SPECTRA FROM THE COSPECTRUM AND
C     QUADRATURE SPECTRUM.
C
C     USAGE
C     CALL AMPHAS(C,Q,AM,PH,NP)
C
C     ARGUMENTS
C     C  - INPUT COSPECTRUM; VECTOR OF LENGTH NP.
C          REAL*8
C     Q  - INPUT QUADRATURE SPECTRUM; VECTOR OF LENGTH NP.
C          REAL*8
C     AM - COMPUTED AMPLITUDE; VECTOR OF LENGTH NP.
C          REAL*8
C     PH - COMPUTED PHASE; VECTOR OF LENGTH NP
C          REAL*8
C     NP - LENGTH OF C, Q, AM, PH.
C          INTEGER
C
C     REMARKS
C     AM(K)=SQRT(C(K)**2+Q(K)**2)
C     PH(K)=ATAN2(Q(K),C(K))
C
      SUBROUTINE AMPHAS(C,Q,AM,PH,NP)
      implicit real*8 (a-h,o-z)
      save
      REAL*8 C(1),Q(1),AM(1),PH(1)
      DO 10 K=1,NP
      CK=C(K)
      QK= Q(K)
      AM(K)=dSQRT(CK*CK+QK*QK)
      PH(K)=0.d0
10    IF(AM(K).NE.0.E0) PH(K)=dATAN2(QK,CK)
      RETURN
      END
