@@
@;  Copyright (C) 1995
@;  Associated Universities, Inc. Washington DC, USA.
@;
@;  This program is free software; you can redistribute it and/or
@;  modify it under the terms of the GNU General Public License as
@;  published by the Free Software Foundation; either version 2 of
@;  the License, or (at your option) any later version.
@;
@;  This program is distributed in the hope that it will be useful,
@;  but WITHOUT ANY WARRANTY; without even the implied warranty of
@;  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
@;  GNU General Public License for more details.
@;
@;  You should have received a copy of the GNU General Public
@;  License along with this program; if not, write to the Free
@;  Software Foundation, Inc., 675 Massachusetts Ave, Cambridge,
@;  MA 02139, USA.
@;
@;  Correspondence concerning AIPS should be addressed as follows:
@;          Internet email: aipsmail@nrao.edu.
@;          Postal address: AIPS Project Office
@;                          National Radio Astronomy Observatory
@;                          520 Edgemont Road
@;                          Charlottesville, VA 22903-2475 USA
@@








*******************************************************************
*                                                                 *
*                                                                 *
*                                                                 *
*                                                                 *
*                                                                 *
*                        AIPS : A Manual                          *
*                                                                 *
*                                                                 *
*                          Volume II                              *
*                                                                 *
*                                                                 *
*                          Editted by                             *
*                                                                 *
*                                                                 *
*                        Eric W. Greisen                          *
*                                                                 *
*                                                                 *
*                                                                 *
*                                                                 *
*                                                                 *
*                                                                 *
*                                                                 *
*                National Radio Astronomy Observatory             *
*                                                                 *
*                     NRAO Computer Division                      *
*                                                                 *
*                Users' Manual Series, Number 31                  *
*                                                                 *
*                         June 15, 1981                           *
*                                                                 *
*                                                                 *
*                                                                 *
*                                                                 *
*                                                                 *
*                                                                 *
*                                                                 *
*                                                                 *
*******************************************************************
@@

                     Acknowledgements


     This manual and the programs in the AIPS system are the work
of a great many individuals.  Direct contributors to Volume I are
Edward B. Fomalont and myself.  The programmers listed below wrote
the HELP files reproduced in Chapter IV.  Contributors to Volume II
are Walter Jaffe, Gary Fickling, Bill Cotton, and myself.  The
programmers created Volumes III and IV.


     The programming staff at NRAO Charlottesville now includes:

              Edward B. Fomalont, project manager
              Eric W. Greisen, software supervisor and gofer
              Donald C. Wells, System Scientist
              Walter Jaffe, System Scientist
              William Cotton, System Scientist
              Gary Fickling, Programmer
              David Brown, systems programmer
              Fred Schwab, mathematician

All have contributed valuable ideas and software.  Bob Burns, the head
of the Computer Division, has provided much needed moral support and
assistance in the purchasing and maintenance of the hardware.  Bill
Meredith, Bill Wireman, Gene Runion, and Walter Brown have all had a
hand in maintaining the hardware.


     Former NRAO employees have also contributed.  The POPS language
was developed by Jerry Hudson.  It was expanded and applied first to
astronomical problems by Tom Cram.  Tom also participated heavily in
the early discussions about AIPS and in the development of a pre-
liminary version called VPOPS.


     Employees of other institutions have also begun to contribute to
the project.  Stuart Button of the University of Toronto has helped
write a self-calibration program for VLA data.  Frank Ghigo of the
University of Minnesota has offerred numerous, well-documented
suggestions on improving the transportability of AIPS to odd-ball
machines such as CDCs.
@@
Chapter I.  Introduction and Overview


     In Volume II of this manual, we intend to present most of the
information needed by people who wish to install AIPS on their own
computer systems and to write new programs for the AIPS system.
Since we are not experienced in programmer-level documentation, I wish
to apologize in advance for the volume.  There will be heavy documenta-
tion of areas which are, or should be, of little or no interest to most
programmers (since these areas should install easily and do whatever
they need to do).  Undoubtedly, there will also be areas which are
significant and are covered too lightly.  Nevertheless, this volume
cannot, and is not intended to, replace the actual source listings and
listings of source prologue comments.  They are the primary references
and this volume is intended only to be a useful guide to them.

     Volume II will be divided into chapters as

       I. Introduction and Overview
      II. Programming language and style
     III. The I/O system philosophy and structure
      IV. The "Z" routines - machine-dependent code
       V. Writing tasks and verbs
      VI. Standard files and their contents
     VII. The television display system and routines
    VIII. The array processor
      IX. POPS - its structure, commons, and methods
       X. Installation and initialization
      XI. The FITS tape formats
     XII. Available routines in AIPS

     Most of the rest of this volume will be devoted to the "trees"
(or maybe "twigs" and "leaf veins") from which the large and growing
"forest" of AIPS is constructed.  To understand these pieces, the
reader needs to begin with a view of the whole.  The main program in
the system is itself called AIPS.  Its primary job is to receive
input from the interactive user, to interpret it, and to schedule the
operations requested.  It does this with an elementary computer language
call POPS, the facilities of which are described in some detail in
Volume I.  By their nature, some of the requested operations are fast
and/or interactive, do not require large quantities of code, and need
to leave their results in a convenient place for use by other opera-
tions.  These operations, called "verbs", are performed by subroutines
inside the program AIPS.  Other operations may require large
quantities of core or code, large amounts of CPU or real time, and/or
little interaction with the user.  These operations are performed by
separate programs called "tasks".  AIPS's role in the operation of
tasks is solely to obtain the parameters from the user, to activate
the task, and to transmit the parameters to the task.  In this way, we
avoid burdening the program AIPS with vast quantities of application
code and we allow the interactive user to continue his processing while
long-running tasks do their thing.  This design also insulates the task
code from the inevitable changes in the code of AIPS.

     Since modern computers should have sufficient capacity to support
more than one AIPS, we have made provisions for more than one inter-
active version of AIPS and for one or more batch versions of AIPS.
The maximum number of simultaneous interactive and batch versions is
controlled by parameters in a common which is initialized by a machine-
and site-dependent subroutine (ZDCHIN).  The batch versions, called
AIPSB, are identical to AIPS except for their ability to process a
queue of jobs and their lack of support for inherently interactive
verbs and tasks.  In order to tell the various versions of AIPS
apart, we propogate a fundamental number called NPOPS.  If we let NI
be the maximum number of interactive AIPSs and NB be the maximum
number of batch versions, then NPOPS values of 1 through NI are used
by the interactive AIPSs.  NPOPS values of 2*NI+2 through 2*NI+NB+1
may be used by the batch AIPSs.  Any task spawned by a version of
AIPS uses the value of NPOPS of that version.  The other values of
NPOPS are used in the submission of jobs to the batch queues.  NPOPS
equal to NI+i is used by the "checker" version of AIPSB (called
AIPSC) for jobs submitted from the AIPS having NPOPS equal to i.
NPOPS = 2*NI+1 is used by the stand alone batch preparation program
BATER and its version of AIPSC.  All programs have "root" names of five
or fewer characters.  However, when they are executed, they actually
run under names created by appending NPOPS to the root name.  Thus, if
NI = 2, AIPSB actually runs under the names ("aliases") AIPSB6, AIPSB7,
etc..  The interactive AIPS uses names AIPS1, AIPS2, etc.  Using this
convention, most systems will allow the AIPSs and AIPSBs to spawn tasks
without interfering with each other.

