      SUBROUTINE PHREAD(Q,TQ,NQ,LIM,SAMTIM,HELJD,NORUN,ITPHAS)    
C     
C     ROUTINE TO READ IN DATA WHERE THE TIMES ARE SPECIFIED IN CYCLES   
C     AND FRACTIONS OF A CYCLE (ORBITAL OR OTHER PERIODIC CYCLE)  
C     
      DIMENSION Q(*),LIM(2,*),SAMTIM(*),DATA(3) 
      DOUBLE PRECISION tq(*),HELJD(*)     
      CHARACTER FNAME*25,RECORD*80  
C     
C     THERE IS ONE DATA CARD WITH THE FILE NAME 
C     
C     READ THE FILE NAME AND ASSIGN THE FILE    
C     
      NORUN=0
      LIM(1,1)=0
      NQ=0
    1 READ 2,FNAME
      IF(FNAME.EQ.'END')RETURN
      CLOSE(11)   
      OPEN(11,FILE=FNAME,status='old')     
      PRINT 3,FNAME     
    3 FORMAT(12X,'READING DATA FROM FILE ',A)   
    2 FORMAT(A)   
      NORUN=NORUN+1     
      HELJD(NORUN)=0.0
      NQ=NQ+1
      LIM(1,NORUN)=NQ  
      IPT=0

    5 READ(11,6,END=10)DATA(1),DATA(2)    
    6 FORMAT(10X,F10.4,9X,1PE12.5)  
      IPT=IPT+1     
      LIM(2,NORUN)=NQ 
      Q(NQ)=DATA(2)     
      TQ(NQ)=DATA(1)-HELJD(1) 
      IF(NQ.EQ.2)SAMTIM(1)=TQ(2)-TQ(1)    
      NQ=NQ+1
      GO TO  5    

   10 PRINT 15,IPT,SAMTIM(1)
   15 FORMAT(12X,'NO OF POINTS READ ',I5/12X,'CALCULATED SAMPLING',     
     *       ' TIME ',F15.7)  
      NQ=NQ-1
      ITPHAS=1    
      GO TO 1
      END   
