function read_grace_msis,inpath,maxrec=maxrec ;this function is in test to read the txt file ;---------------------------------------------------- if n_elements(maxrec) eq 0 then maxrec = 900000L stru = {doy:0.0,alt:0.0,lon:0.0,lat:0.0,stl:0.0,mlon:0.0,mlat:0.0,mlt:0.0,den_grace:0.0,den_msis:0.0,den_msis_470:0.0,den_grace_470:0.0} ;a structure to hold one line of the data file record =replicate(stru,maxrec) ;hold all data openr,lun,inpath,/get_lun ;need a container to hold one line of text trash = 'garbage' ;;let's skip the first 3 lines ;P ;header = 3 ;for jj = 0,header-1 do readf,lun,trash fmt='(12(e16.7))' i=0L while(not eof(lun)) do begin readf,lun,stru;,format=fmt ;put the line we ju st read into our arrays record(i) = stru i=i+1L ;Check to make sure maxrec isn't exceeded if i ge maxrec then message,'WARNING: MAXREC TOO SMALL! Please increase.' endwhile record=record[0:i-1L] free_lun,lun return,record end