PRO READ_CARR_LONG,Dummy
;+
; NAME:
;	READ_CARR_LONG
;
; PURPOSE:
;	This procedure reads in the carrington number and date information file.
;	It is called from other routines as needed, and thus doesn't need to be
;	called by the user explicitly.
;
; CATEGORY:
;	LASCO Synoptic
;
; CALLING SEQUENCE:
;	READ_CARR_LONG, Date, Cr, Clong
;
; INPUTS:
;	None
;
; OPTIONAL INPUTS:
;	None
;
; OUTPUTS:
;	The only output is the storing of the carrington information into a common block.
;	
; COMMON BLOCKS:
;	carr_long:	Contains the start date of the carrington rotations from
;			the almanac.  Generated by this routine.
;
; EXAMPLE:
;       
;
; MODIFICATION HISTORY:
; 	Written by:	RA Howard, NRL, 3/18/96
;
;	@(#)read_carr_long.pro	1.5 12/14/05 LASCO IDL LIBRARY
;-
;
common carr_long,cday,cnum
sd = GETENV_SLASH('NRL_LIB')+!delimiter+'lasco'+!delimiter+'data'
sd = sd+!delimiter
print,'Reading '+sd+'carr_long.dat'
OPENR,lu,sd+'carr_long.dat',/GET_LUN,/swap_if_little_endian
n = 0
utc = ''
fday = 0.
num=0
WHILE (NOT EOF(lu)) DO BEGIN
      READF,lu,num,utc,fday,format='(i4,4x,a10,4x,f10.0)'
      day = str2utc(utc)
      day.time = LONG(fday*86400000.d)
      day = UTC2TAI(day)
      IF (n eq 0) THEN BEGIN
         cday = [day]
         cnum = [num]
      ENDIF ELSE BEGIN
         cday = [cday,day]
         cnum = [cnum,num]
      ENDELSE
      n = n+1
ENDWHILE
CLOSE,lu
FREE_LUN,lu
RETURN
END
