;+ ; NAME: ; usno_close ; PURPOSE: ; Closes asteroid ephemeris files and frees heap memory used by ephemeris ; CATEGORY: ; smei/gen/idl/ephem; USNO Asteroid Ephemeris ; CALLING SEQUENCE: PRO usno_close ; INPUTS: ; (none) ; OUTPUTS: ; (none ; SEE ALSO: ; usno_init ; CALLS: ; INCLUDE: @compile_opt.pro ; On error, return to caller ; COMMON BLOCKS: common USNO_INFO, USNO_PNTR ; SIDE EFFECTS: ; Opens an ephemeris file and defines a heap variable. ; RESTRICTIONS: ; usno_close must be called separately to close all open asteroid ; files and free the memory used by the heap variables. ; PROCEDURE: ; > Common block USNO_INFO contains the pointer array USNO_PNTR. ; ; > If a pointer in the array is a valid heap pointer, then the associated asteroid ; has been initialized (file is open; heap variable exists). ; After usno_close is finished all asteroid files should be close ; and all heap memory released. ; MODIFICATION HISTORY: ; SEP-1999, Paul Hick (UCSD/CASS; pphick@ucsd.edu) ; Modified from USNO AE98 C-software ;- FOR i=0, n_elements(USNO_PNTR)-1 DO BEGIN IF ptr_valid(USNO_PNTR[i]) THEN BEGIN free_lun, (*(USNO_PNTR[i])).iU ptr_free, (*(USNO_PNTR[i])).jd, (*(USNO_PNTR[i])).span, (*(USNO_PNTR[i])).order ptr_free, USNO_PNTR[i] ENDIF ENDFOR RETURN & END