NAME:
    getobloc
 PURPOSE: (one line)
    Fetch location of observatory given its code
 DESCRIPTION:

 CATEGORY:
  Astronomy
 CALLING SEQUENCE:
    getobloc,obscode,obs

 INPUTS:
  obscode - observatory code (integer or string)

 OPTIONAL INPUT PARAMETERS:

 KEYWORD INPUT PARAMETERS:
  OBSFILE - Name of observatory code file to read.  Default=obscode.dat

 OUTPUTS:
  obs - anonymous structure that contains information for the requested
          observatory.  Four tags are defined:
             name - string name of observatory
             lat  - Latitude of observatory (radians)
             lon  - Longitude of observatory (radians)
             alt  - Altitude of observatory (meters), [always zero for now]
             obscode - observatory code (input returned always as string)

 COMMON BLOCKS:
  getobloc_com - used to cache the contents of the observatory coordinate
                   file.  The file is only read the first time it is needed
                   and then the memory copy is use from then on.

 SIDE EFFECTS:
  Note, if the observatory code file is NOT found, '688' (Lowell Observatory)
    is used.

  If the file is okay but the code is not recognized, the observatory
    name is returned as 'unknown' and lat=lon=alt=0.0

  Observatory coordinate file is read each time this procedure is called.
    This really needs to add code to read the file once and store its
    contents in non-volatile memory (anonymous stucture in a common block)
    and then re-read the file only when it's date changes.

 RESTRICTIONS:

 PROCEDURE:

 MODIFICATION HISTORY:
  2002/03/14, Written by David Tucker
  2002/12/09, MWB, converted to separate standalone routine.
  2016/02/05, MWB, forced lat/lon to be double
  2021/09/08, MWB, added cache of file read and added alt to structure
  2024/07/04, MWB, added decoding of altitude, this led to a few hidden bugs (errors
                     that cancelled) and other cleanup and documentation.