C==== INITIAL VALUES FOR ENERGIES AND WAVE
C===== FUNCTIONS IN HFD==================
       SUBROUTINE ZEROR(NE5,Z,K,IS,IQ,IL,IN,
     * MU,TETA,R5,R8)

       REAL*8 Z,MU,SUM,
     * TETA(*),R5(*),R8(NE5,*)
       INTEGER NE5,K,
     * IQ(*),IL(*),IN(*)
C=========================
       NE=NE5-15
       SUM=0.
      DO 20 I=1,IS
      IF((I.EQ.1).OR.((I.GT.1)
     * .AND.(IL(I)-IL(I-1)).GE.0 )) THEN
        TETA(I)=((Z-SUM)/IN(I))**2
       ELSE
       TETA(I)=TETA(I-1)
       END IF
       SUM=SUM+IQ(I)
C      TETA(I)=0
 20    CONTINUE
      DO 25 I=1,K-1
 25   TETA(I)=0.
      IF(K.EQ.1)THEN
      IS1=IS+1
      IS2=IS+IS+2
      ELSE
      IS1=IS
      IS2=IS+IS
      END IF
      DO 30 I=K,IS
      DO 10 J=1, NE+2
 10   R5(J)=0.
       CALL COLUMN(NE5,R5,R8(1,I+IS1))
       CALL COLUMN(NE5,R5,R8(1,I+IS2))
       R5(1)=TETA(I)*ABS(MU)
       R5(2)=1.
       CALL COLUMN(NE5,R5,R8(1,I))
       TETA(I)=1.
       WRITE(6,40)I,R5(1),TETA(I)
  40   FORMAT(' INITIAL ENERGY  ',I4,E15.8,' TETA',E15.8)
 30    CONTINUE
      DO 50 I=1,IS
       WRITE(6,60)I,R8(3,I),R8(1,I+IS1),R8(1,I+IS2)
       WRITE(*,60)I,R8(3,I),R8(1,I+IS1),R8(1,I+IS2)
  60   FORMAT(I4,' P(1) ',E15.8,' G(1) ',E15.8,' V1 ',E15.8)
  50   CONTINUE
      RETURN
      END
