*+
*  Name:
*     ARY_ACB

*  Purpose:
*     Define ARY_ system Access Control Block (ACB).

*  Language:
*     Starlink Fortran 77

*  Type of Module:
*     Global variables include file.

*  Description:
*     This file defines global variables which describe the "virtual"
*     objects used by the ARY_ system to provide user access to actual
*     data objects which are described in the Data Control Block (DCB).
*     Each of the active entries in the ACB refers to an associated DCB
*     entry and several ACB entries may refer to the same DCB entry. A
*     one-to-one correspondence is maintained between active ACB
*     entries and the array identifier values issued to users.

*  Prior Requirements:
*     The SAE_PAR, ARY_PAR and ARY_CONST include files should be
*     included before this file, in order to define constants used
*     here.

*  Authors:
*     RFWS: R.F. Warren-Smith (STARLINK)
*     {enter_new_authors_here}

*  History:
*     22-SEP-1989 (RFWS):
*        Original version.
*     26-SEP-1989 (RFWS):
*        Tidied comments.
*     {enter_further_changes_here}

*-

*  Global Variables:

*  Which slots have been used.
*  ==========================
*  This array is initialised to .FALSE. by the ARY1_INIT block data
*  routine. Its entries are then selectively set to .TRUE. to indicate
*  which slots in the ACB are in use (i.e. have array identifiers
*  issued for them).
      LOGICAL ACB_USED( ARY__MXACB )
      
*  Access control flags.
*  ====================
*  If a slot is in use, then the ACB_ACC entry contains a series of
*  logical access control flags which control the types of access
*  permitted to the virtual object described by the ACB slot. The flag
*  values are identified by symbolic constants defined in the ARY_CONST
*  file. Access is permitted if the ACB_ACC value is .TRUE., otherwise
*  it is denied. Access control flags are propagated to new virtual
*  objects when they are derived from existing ones.
      LOGICAL ACB_ACC( ARY__MXACC, ARY__MXACB )

*  Whether access is to a cut.
*  ==========================
*  If a slot is in use and the ACB_CUT entry is .TRUE., then the object
*  it describes is a "cut", which allows virtual access to a subset or
*  superset of the data. If this entry is .FALSE, then the array is a
*  "base array" which gives direct access to the actual data object.
      LOGICAL ACB_CUT( ARY__MXACB )

*  Index to data object entry in the DCB.
*  =====================================
*  If a slot is in use, then the ACB_IDCB entry contains the index of
*  the entry in the Data Control Block (DCB) which describes the actual
*  data object to which the virtual (ACB) object refers.
      INTEGER ACB_IDCB( ARY__MXACB )

*  Index to mapping entry in MCB.
*  =============================
*  If a slot is in use and the virtual object it describes is mapped for
*  access, then the ACB_IMCB entry contains the index of the entry in
*  the Mapping Control Block (MCB) which controls access to the mapped
*  data. If the object is not mapped, then the ACB_IMCB entry is zero.
      INTEGER ACB_IMCB( ARY__MXACB )

*  Record of identifiers issued.
*  ============================
*  The value of ACB_IDCNT is initialised by the ARY1_INIT block data
*  routine and is incremented each time an array identifier is issued.
*  The next identifier value is generated using the new value of
*  ACB_IDCNT and this ensures that identifier values are not re-used.
*  When an identifier is issued for a slot, its value is stored in the
*  ACB_CHK entry and an identifier is only considered valid if it
*  matches the ACB_CHK entry in the slot to which it refers. This
*  allows identifiers to be rendered invalid either by the user (by
*  assigning the ARY__NOID value to them), or by the ARY_ system (by
*  marking the slot as not used, or by re-using it with a new
*  identifier value).
      INTEGER ACB_CHK( ARY__MXACB )
      INTEGER ACB_IDCNT

*  Dimensionality and bounds information.
*  =====================================
*  If a slot is in use, then the ACB_NDIM entry holds the number of
*  dimensions of the virtual object which it describes and the ACB_LBND
*  and ACB_UBND entries hold the lower and upper pixel index bounds of
*  the object. These entries are padded with 1's to give ARY__MXDIM
*  bounds, regardless of the actual object dimensionality.
      INTEGER ACB_NDIM( ARY__MXACB )
      INTEGER ACB_LBND( ARY__MXDIM, ARY__MXACB )
      INTEGER ACB_UBND( ARY__MXDIM, ARY__MXACB )

*  Data transfor window.
*  ====================
*  If a slot is in use, then the ACB_DTWEX entry indicates whether a
*  "data transfer window" exists for the virtual object it describes.
*  The data transfer window consists of lower and upper bounds on the
*  region of actual data to which the virtual object has access and is
*  used (for instance) to ensure that virtual objects which are derived
*  from other objects cannot gain access to regions of data which were
*  inaccessible to their parent. The data transfer window always has
*  ARY__MXDIM dimensions and is stored using the "reference frame"
*  pixel index system (this is the pixel index system which the actual
*  data object had when it first became known to the ARY_ system). If
*  the ACB_DTWEX entry is .FALSE., then no access to actual data is
*  available, otherwise the ACB_LDTW and ARY_UDTW entries hold the
*  lower and upper bounds of the data transfer window.
      LOGICAL ACB_DTWEX( ARY__MXACB )
      INTEGER ACB_LDTW( ARY__MXDIM, ARY__MXACB )
      INTEGER ACB_UDTW( ARY__MXDIM, ARY__MXACB )

*  Bad pixel flag:
*  ==============
*  If a slot is in use, then the ACB_BAD entry indicates whether there
*  may be accessible "bad" values in that part of the data object which
*  lies within the data transfer window (since access to data is always
*  restricted by the bounds of the actual data object, this flag takes
*  no account of the data transfer window extending beyond the edge of
*  the data object). This value is only significant if a data transfer
*  window exists.
      LOGICAL ACB_BAD( ARY__MXACB )

*  Accumulated pixel index shifts:
*  ==============================
*  If a slot is in use, then the ACB_SFT entry contains an accumulated
*  sum of the pixel index shifts applied to the virtual object. These
*  shifts are initialised using the values associated with the data
*  object entry in the DCB at the time the ACB entry is created. They
*  subsequently accumulate any further shifts applied to the virtual
*  (ACB) object.
      INTEGER ACB_SFT( ARY__MXDIM, ARY__MXACB )

*  Non-character data.
      COMMON /ARY1_ACB1/ ACB_ACC, ACB_BAD, ACB_CHK, ACB_CUT, ACB_DTWEX,
     :                   ACB_IDCB, ACB_IDCNT, ACB_IMCB, ACB_LBND,
     :                   ACB_LDTW, ACB_NDIM, ACB_SFT, ACB_UBND,
     :                   ACB_UDTW, ACB_USED

*.
