;**************************************************************************** ; Author : Josh Grant, COAPS ; ; Description : This subroutine reads one of the gzipped divergence files and ; returns the data, times, and dimensions of the data. ; ; **Warning** : Due to poor planning on my part and lack of time the bulk of ; this program is not commented like it should be. ;**************************************************************************** PRO READFILE, filename, tempFile, data, times, ny, nx, err command = "/usr/sbin/gunzip -c " + filename + " > " + tempFile messages = ' ' SPAWN, command, messages OPENR, input, filename, /GET_LUN, ERROR = err IF ( err EQ 0 ) THEN BEGIN FREE_LUN, input OPENR, input, tempFile, /GET_LUN, ERROR = err print, "Reading " + filename line = FLTARR( 48 ) newLine = ' ' READF, input, ny, nx line = FLTARR( 48 ) singletime = '9999999 ' FOR pass = 0, 2 DO BEGIN FOR rows = 0, ny - 1 DO BEGIN READF, input, FORMAT = '(48F10.3)', line data( pass, *, rows ) = line ENDFOR READF, input, newLine ENDFOR FOR index = 0, ny - 1 DO BEGIN READU, input, singletime times( index ) = LONG(singletime) ENDFOR FREE_LUN, input print, "Done reading " + filename SPAWN, 'rm ' + tempFile ENDIF END