@@
POPS Save/get files:              SGfuuunn


A. Overview


Function: POPS memory files are used to store copies of the POPS
"environment" (procedure source code, symbol table, procedure
executable code, adverbs values, various pointers).  Save/get files
are "user-owned", rather than the "public" ones described in the ME
portion of this chapter.

Details:  The details of this environment are discussed elsewhere and
will not be described here.  The files are semi-permanent files and
have a size which depends on the size of the LISTF and K arrays in the
version of POPS being used.  The file must be larger than one K plus
one LISTF array.  In Charlottesville,  the files are at least 91
256-word blocks long.  Each user having one or more SG files also has
an SG directory file.  On ordinary computers this file only requires
8 blocks.

Names:  POPS save/get files are named SGfuuujj.uuu , where uuu is the
user logon identification number in hex and jj is the sequence number
in hex of the file in the SG directory.  Sequence number 0 is reserved
for the directory file.  The format revision letter (A, B, ...) is f.


B. File structure


     The SG directory file consists of 256 logical records, numbered
0 through 255.  Each logical record consists of 7 words.  There are
256 / 7 logical records per physical record (36).  The first logical
record (called # 0) is reserved for control information and currently
includes:

    FIELD   TYPE           DESCRIPTION

      1     I*4          Maximum version number now in use (called max)
      2     I*4          Number of vacant entries with version # < max
      3     I*4(2)       Last GET time (packed YY/MM/DD, HH/MM/SS)
      4     I*4(2)       Last SAVE time (packed YY/MM/DD, HH/MM/SS)
      5     I*4          Reserved

Logical records 1 to 255 (correspond to file version numbers 1 - 255)
contain

    FIELD   TYPE           DESCRIPTION

      1     I*4          Number characters in user-supplied name ( <= 0
                         means empty) + 32 * SG format version number
      2     I*4(2)       Last SAVE time (packed YY/MM/DD, HH/MM/SS)
      3     H*16         User supplied name, blank filled

The SG data files are described below:

     The structure of the K and LISTF arrays is discussed elsewhere.
Here we will show only how they are stored on disk.  The files consist
of sequential 256-word records.  Using the sizes of the K and LISTF
arrays in the Charlottesville version of AIPS, the files are laid out
as

    FIELD   TYPE           DESCRIPTION

      1     I*4(256)     Header record (see below)
      2     I*4(18944)   K array
      3     I*4(4096)    LISTF array


The header record at the present contains only 6 useful words:

    FIELD    TYPE           DESCRIPTION

      1      I*4(3)     Date: year since 0, month, day
      2      I*4(3)     Time: hour, min, sec of the last SAVE op




C. User notes


     It should not be necessary for users to read or write these files
under normal circumstances.  Standard POPS subroutines do all the
operations which are required.  They are created at run time by the
user as required.  They may be deleted by the user at run time or by
the AIPS manager using FILINI or other utilities.



D. Routines which read and write POPS memory files


     The subroutine STORES creates, writes, and reads the save/get
files.  The subroutine AU3A reports on disk usage including such
files and can destroy all such files belonging to the logon user.
The variables in the common /POPS/ which aid in this process are

    LPAGE       number of 256-word blocks in LISTF
    MPAGE       number of 256-word blocks in K plus LISTF

The subroutine SGLOCA, called by STORES, performs normal operations on
SG directory files including creation.  The verb SGDESTR performed by
the subroutine AU2A handles destruction of individual SG data files
and will destroy an empty directory.  AU2A also performs the directory
listing function (verb SGINDEX).  Subroutine AU3A will destroy all
the user's SG files at once (verb SAVDEST).
