      SUBROUTINE CYCT2A (KAA,KXX,G1,G2,SCR1,SCR2,SCR3)
      INTEGER G1,G2,SCR1,SCR2,MCB(7),SCR3
      COMMON /SYSTEM/IDUM(54),IPREC
C
      MCB(1)=KAA
      CALL RDTRL(MCB)
      IF(MCB(1).LE.0)GO TO 30
      MCB(1)=KXX
      CALL RDTRL(MCB)
      IF(MCB(1).LE.0)GO TO 30
      ISC2=SCR2
      MCB(1)=G1
      CALL RDTRL (MCB)
      IF (MCB(2).LE.0)ISC2=0
      MCB(1)=G2
      CALL RDTRL(MCB)
      IF(MCB(2).LE.0)GO TO 10
      ISC=SCR2
      IOUT=1
      ISC1=KXX
      GO TO 20
   10 ISC=KXX
      ISC1=SCR2
      IOUT=0
C
C     NO FIRST TERM IF ISC2=0, NO SECOND TERM IF IOUT=0
C
   20 IF (ISC2 .EQ. 0) GO TO 25
C
C     COMPUTE FIRST TERM
C
      CALL SSG2B(KAA,G1,0,SCR1,0,IPREC,1,SCR2)
      CALL SSG2B(G1,SCR1,0,ISC,1,IPREC,1,ISC1)
C
C     COMPUTE SECOND TERM
C
C     COMPUTE SECOND TERM
C
   25 IF(IOUT .EQ. 0) GO TO 29
      CALL SSG2B(KAA,G2,0,SCR1,0,IPREC,1,KXX)
      CALL SSG2B(G2,SCR1,ISC2,KXX,1,IPREC,1,SCR3)
   29 MCB(1) = KXX
   30 RETURN
      END
