      SUBROUTINE MAGPHA( A, B )
C*****
C THIS SUBROUTINE FORMS THE MAGNITUDE OF (A,B) AND STORES IT IN A...
C THE PHASE OF (X=A, Y=B) IS THEN FORMED AND THE RESULT STORED IN B...
C*****
      COMMON /CONDAS/ CONSTS(5)
C
      EQUIVALENCE ( CONSTS(3) , RADEG  )
C
      VALUE = SQRT( A**2 + B**2 )
      IF( VALUE ) 10,20,10
   10 PHASE = ATAN2( B, A ) * RADEG
      GO TO 30
   20 PHASE = 0.0E0
      GO TO 40
   30 IF( PHASE .LT. (-0.00005E0) ) PHASE = PHASE + 360.0E0
   40 A = VALUE
      B = PHASE
      RETURN
      END
