%N caopen %F $MIR/src/subs/calio.for
%D Open a calibration set
%: calibration, i/o
%P pjt
%B
        SUBROUTINE caopen(tno,dataname,time0,nbl,base,
     -                    version,status)

        INTEGER          tno, base(*), nbl, version
        CHARACTER*(*)    dataname, status
        DOUBLE PRECISION time0

    inputs (always)
       dataname -- the name of the data set to be opened
       status   -- either 'old', 'new' or 'append'
    outputs/inputs (depending on 'new'/'append' or 'old' in status)
       tno      -- the calibration set handle
       time0    -- time offset
       nbl      -- the number of baselines
       base     -- an array of nbl baseline pairs (see findbase)
       version  -- version as read/write from/to disk

    If any items in the data set are read and then written (or the other
    way around) then either the data set must be closed and reopened in
    between, or the data set must be opened twice.  This should be fixed
    someday.

  Rdata is opened iff Rtime is opened, and a few others too.
