c***********************************************************************
c= SMACatool - handle calibrator catalog - CalPolFlux.cat.
c& jhz
c: calibration, flux
c+
      program smacatool
      implicit none
c
c       SMACATOOL reads calibrator catalog - CalPolFlux.cat (SMA) and
c       cals.fluxes or the modified FluxSource.cat (CARMA+BIMA)
c       in Miriad and plot results. Merge SMA and CARMA data
c       into one plot.
c@ in
c       Name of the calibration data file (Default is the file
c       CalPolFlux.cat in the directory MIRCAT).
c@ in2
c       Name of the second calibration data file in the format
c       of either cals.fluxes or FluxSource.cat
c       (Default is the file FluxSource.cat in the directory MIRCAT).
c@ source
c       Name of the calibration source to list (default is all sources).
c       The source name is minimum match format.
c@ freq
c       Frequency that the source was observed at in GHz (default is
c       0.0, which implies all frequencies are valid matches).
c@ delfreq
c       A full width in GHz (default is 5.0) in which to accept
c       deviations from the value of ``freq'' as a match.  If ``freq''
c       is not given or is set to the default value, this input
c       is ignored.
c@ date
c       The cutoff date before or after which no observations are
c       listed (default is date=1.0, which implies all dates are valid
c       matches).  If ``date=0'', then only the most recent data is
c       listed.  If ``date>0,'' then all data more recent than ``date''
c       are listed; ``date<0,'' then all data prior to ``abs(date)''
c       are presented.  The format for ``date'' is the same as the DATE
c       field in the flux calibration file:  either ``yymmmdd.d'' or
c       ``yymmmdd:hh:mm:ss.s'' with no internal spaces (the first 7
c       characters are required).
c@ options
c       This gives extra processing options. Options given below can be
c       used one at a time. No multiple options are allowed. Default
c       is to plot radio lightcurve (flux vs. time) and list the values
c       of flux density giving a source, frequency range and epochs of time
c       from the catalogs given by in and in2.
c         smaft     Means taking CatPolFlux.cat data only to plot flux-time curve
c         smalpt    Means taking CatPolFlux.cat data only to plot linearPol-time curve
c         smapat    Means taking CatPolFlux.cat data only to plot PA-time curve
c         smapaf    Means taking CatPolFlux.cat data only to plot PA-freq curve
c@ device
c       PGPLOT device to plot flux versus time. Default is no plot.
c--
c History:
c  jhz     2012mar15     Start smacalflux.for using part of calflux.for
c  jhz     2012mar20     completed subr SMApolflux
c  jhz     2012mar21     changed the name to smacatool
c  jhz     2012mar22     added options
c  jhz     2012Apr04     documented and made a test release.
c-----------------------------------------------------------------------
c

Test release:
The code has been exported to RTDC system for test.