A
                               POLLUTANT STANDARD INDEX (PSI)

                           MULTI-POLLUTANT RETRIEVAL SOFTWARE
EPA
220/
1977.2

-------
                   Developed by MR. JOHN BENNETT

                  Systems Research and Development

for the Council on Enviornmental Quality and the U.S. Environmental
     Protection Agency
                 EPA Project Director:  JON CLARK
                                        EPA/OAQPS
EPA Project Officer:  DR. WAYNE OTT   CEQ Project Officer:  DR. KAY JONES
                         EPA/ORO                                CEQ

-------
                           TABLE OF CONTENTS
Section                         Description                            Page

1.0.0        Introduction	    1


2.0.0        Air Quality Data Retrieval Computer Programs	    2

             2.1.0   INTRFAC1	    2
             2.1.1   Description	    2
             2.1.2   INTRFAC1 Program Flow Diagram	    3
             2.1.3   INTRFAC1 Operating Instructions	    4
             2.2.0   INTRFAC2	    6
             2.2.1   Description	    6
             2.2.2   INTRFAC2 Program Flow Diagram	    7
             2.2.3   INTRFAC2 Operating Instructions	    8
             2.3.0   INTRFACSUB	   10
             2.3.1   Description	   10
             2.3.2   INTRFACSUB Program Flow Diagram	   11
             2.3.3   INTRFACSUB Operating Instructions	   12
3.0.0


4.0.0
Execution of Interface Programs From Terminal	   13
Listing INTRFAC1 And INTRFAC2 Output	   15

4.1.0   Listing INTRFAC1 And INTRFAC2 Disk Output	   15
4.2.0   Listing INTRFAC1 And INTRFAC2 Tape Output	   15
5.0.0
Permissible Pollutant, Method, Interval, Units
Combinations	
                                                                       17
6.0.0
Program Inputs	   18

6.1.0   Output Option Card Format	   18
6.2.0   Selection Parameter Card Format	   18
7.0.0
Program Outputs	   21

7.1.0   INTRFAC1 Output Record Format	   21
7.2.0   INTRFAC2 Output Record Format	   22

-------
1.0.0   INTRODUCTION

        Under a joint contract involving the Office of Monitoring and Technical
Support, the Office of Air Quality Planning and Standards, and the Council  on
Environmental Quality, Systems Research and Development Corporation (SRD) has
developed specialized software for retrieving raw air quality data from SAROAD
files.
        These computer programs are very flexible and permit the user to specify:
        (1}  One to five different air pollutants (CO, Ozone, N02, S02 and TSP).
        (2)  A specific State or all states.
        (3)  A specific geographical area or all areas.
        (4)  A specific site or all sites.
        (5)  A specific agency or all agencies.
        (6)  A specific project or all projects.
        (7)  A specific year.
        (8)  The specific method, interval and units for the pollutants in (1).
        (9)  Any combination of (2) thru (8).

        Using either of two programs, INTRFAC1 and INTRFAC2, the user can obtain
the raw hourly data values for each hour in the year for each unique 12 character
station code retrieved (INTRFAC1) or the daily maximum of the raw hourly data
values for each day in the year for each unique 12 character station code retrieved
(INTRFAC2).  The output format of the two programs are the same.  The output
consists of 80-character card image records which can be punched onto cards, stored
on a disk punch file, or stored on tape as a EBCDIC, fixed length, fixed block,
card image IBM 370 compatible formatted file.  The output formats are specifically
designed to be used with the PSI air pollution index programs but can be used as
input to any other software as well.

-------
2.0.0   AIR QUALITY DATA RETRIEVAL COMPUTER PROGRAMS

        Three computer programs make up the Air Quality Data Retrieval Software.
These programs are INTRFAC1, INTRFACZ, and INTRFACSUB.  Program INTRFAC1 retrieves
the raw hourly data values for each hour in the year for each unique 12 character
station code for each pollutant-method-interval-units specified.  Program INTRFACZ
retrieves the daily maximum of the raw hourly data values for each day in the year
for each unique 12 character station code for each pollutant-method-interval-units
specified.  Program INTRFACSUB is a utility program designed to update the non-con-
tinuous data files used as input to programs INTRFAC1 and INTRFAC2.  Programs
INTRFAC1 and INTRFAC2 were designed to be run in demand mode as well as batch mode.
The Air Quality Data Retrieval Programs were designed to be run in the demand mode
on the tele-type terminals with a 132-character carriage.  However, it is possible
to run the programs on a CRT terminal.

2,1.0   INTRFAC1

2.1.1   Description
        Program INTRFAC1 selects continuous CO, 02-, and NO? and non-continuous S02
and TSP from SAROAD data files and creates an 80 character card image file on disk
and/or tape.  The disk file created is an SDF punch file which can be saved and
punched.  The tape file is an EBCDIC IBM compatible file which can be processed by
a COBOL or FORTRAN program.  Both files are optional and can be selected by the
user by inputting an option card indicating which type file is to be outputted.
Selection parameter cards are used to specify to the program the selection cri-
teria for the site-id, year and CO, 02-, N02, S02» and TSP pollutants by which
SAROAD records are selectively retrieved.

        The data file{s) generated is composed of 80 character card image records
consisting of the data value readings for each of the pollutants specified for
each hour in the year specified on the parameter card.  In other words, each char-
acter record outputted corresponds to each hour in the year specified and contains
the data value reading for each pollutant (CO, OZ-, N02, S02 and/or TSP) specified
corresponding to each hour.  Each parameter card will generate 8,760 or 8,784 80
character card image records depending upon whether or not the specified year is
a leap year.

-------
  2.1.2    INTRFAC1 Program Flow  Diagram
                   NADB-ND-INDX
  NADB-ND-BULK
NADB-GT-INDX
NADB-GT-BULK
PARM-CARD-FILE
/ PARAMETER/
( dARbii
' OUTPUT
OPTION
CARD
i^mu
/
y
OPTIONAL
  PSI-HOUR-DATA-FILE-DISK
       (SDF PUNCH FILE)
PSI-HOUR-DATA-FILE-TAPE
    (EBCDIC)
          RUN TOTALS

-------
                                                                                         1
2.1.3   INTRFAC1 Operating Instructions

Procedure Listing {ECL)
        2.   @ASG,T PARMCAROFILE.
        3.   (<>DATA,Il PARMCARDFILE.
               'OUTPUT OPTION CARD1

               'PARAMETER CARDS'
        4.   @END
       *5.   0USE PSI-HOUR-DSK.,' USER-FILE-NAME.1
       *6.   @ASG,A PSI-HOUR-DSK.
       *7.   GASGJJ/W PSI-HOUR-TPE..16N//////Q, 'TAPE-REEL-NUMBER1
        8.   G>ASG,A NADB*NADB-ND-INDX.
        9.   G»ASG,A NADB*NADB-ND-BULK
       10.   @ASG,A TRRP*NADB-GT-INDX.
       11.   
-------
ECL statements 13 and 14 should be Included only when cards are desired  to be
punched.  If ECL statements 13 and 14 are included, then statements 5 and 6
must also be included.  'CARD-PUNCH-ID1 on ECL statement 14 is the card-punch
to which cards are to be routed and punched.  The user must supply this infor-
mation.

-------
2.2.0   INTRFAC2

2.2.1   Description

        Program INTRFAC2 selects continuous CO, OZ-, and N02 and non-continuous
S02 and TSP from SAROAD data files and creates an 80 character card image file
on disk and/or tape as does program INTRFAC1.   The disk file created is an SDF
punch file which can be saved and punched.  The tape file is an EBCDIC IBM com-
patible file which can be processed by a COBOL or FORTRAN program.  Both files
are optional and can be selected by the user by inputting an option card indi-
cating which type file is to be outputted.  Selection parameter cards are used
to specify to the program the selection criteria for the site-id, year and CO,
OZ-, N02, S02, and TSP pollutants by which SAROAD records are selectively re-
trieved.
        The data file(s) generated is composed of 80 character card image rec-
ords consisting of the daily maximum hourly data value reading for each of the
pollutants specified for each day in the year specified on the parameter card.
In other words, each 80 character record outputted corresponds to each day in
the year specified and contains the daily maximum hourly data value reading for
each pollutant (CO, 02-, N02» S02, and/or TSP) specified corresponding to each
day.  Each parameter card will generate 365 or 366 80 character card image rec-
ords depending upon whether or not the specified year is a leap year.

-------
 2.2,2     INTRFAC2  Program Flow Diagram
                  NADB-ND-INDX     NADB-ND-BULK      NADB-GT-INDX      NADB-GT-BULK
PARM-CARD-FILE
/ PARAMETER
f CARDS
OUTPUT
OTON

/
/
PSI-MAXX-DATA-FILE-DISK
     (SDF PUNCH FILE)
PSI-MAXX-DATA-FILE-TAPE        RUN TOTALS

-------
2.2.3   INTRFAC2 Operating Instructions

Procedure Listing (ECL)
        1.   @RUN
        2.   @ASG,T PARMCARDFILE.
        3.   @DATA,IL PARMCARDFILE.
               'OUTPUT OPTION CARD1

               'PARAMETER CARDS'
        4.   (3END
       *5.   @USE PSI-MAXX-DSK.,'USER-FILE-NAME.'
       *6.   @ASG,A PSI-MAXX-DSK.
       *7.   GASGJJ/W PSI-MAXX-TPE..16N//////Q, 'TAPE-REEL-NUMBER1
        8.   @ASG,A NADB*NADB-ND-INDX.
        9.   (3ASG.A NADB*NADB-ND-BULK.
       10.   @ASG,A TRRP*NADB-GT-INDX.
       11.   <3ASG,A TRRP*NADB-GT-BULK.
       12.   @XQT TRRP*BENNETTFILE.INTRFAC2
      *13.   @FREE PSI-MAXX-DSK.
       14.   @SYM PSI-MAXX-DSK.,,'CARD-PUNCH-ID1
       15.   @FIN
*NOTE
The  inclusion of ECL  statements  5 and  6 and/or  7  is dependent upon the  contents
of the 'OUTPUT OPTION CARD1  in  PARMCARDFILE  as  follows:

        A.   If output option  is 'DISK',  the user need only  include  ECL state-
             ments 5  and  6.  On  ECL  statement 5,  the  user must supply  'USER-
             FILE-NAME.'  where  'USER-FILE-NAME.1  is the  name of  a catalogued  file
             where output records are  to  be  punched and  saved.

        B.   If output option  is 'TAPE',  the user need only  include  ECL state-
             ment  7.   On  ECL statement 7, the user must  supply  'TAPE-REEL-NUMBER'
             where  'TAPE-REEL-NUMBER1  is  the reel number of  the  tape where  output
             records  are  to  be  written.

        C.   If output option  is 'BOTH',  the user must include  all three ECL  state-
             ments  {5, 6  and 7)  and  supply the  necessary information as illustra-
             ted in A and B  above.
                                        8

-------
ECL statements 13 and 14 should be included only when cards are desired to be
punched.  If ECL statements 13 and 14 are included, then statements 5 and 6
must also be included.  'CARD-PUNCH-ID1 on ECL statement 14 is the card-punch
to which cards are to be routed and punched.  The user must supply this infor-
mation.

-------
2.3.0   INTRFACSUB

2.3.1   Description

        Program INTRFACSUB is a utility program which is used to update the
non-continuous data files used as input to programs INTRFAC1 and INTRFAC2.
This program selects all S02 and TSP site records from the SAROAD old for-
matted files for years from 73 to present and generates the non-continuous
data files used in retrieving data.  INTRFACSUB generates non-continuous data
files containing only S02 and TSP pollutant data in a format to facilitate
retrieval by programs INTRFAC1 and INTRFAC2.
                                      10

-------
2.3.2   INTUFACSUB Program Flow Diagram
                                   NADB-GT-DISK
                 NADB-GT-INDX       NADB-GT-BULK          RUN  TOTALS
                                         11

-------
2.3.3   INTRFACSUB Operating Instructions

Procedure Listing (ECL)
        1.    (8RUN
        2.    @ASG,A NADB*NADB-GT-DISK.
        3.    @ASG,A TRRP*NADB-GT-INDX.
        4.    @ASG,A TRRP*NADB-GT-BULK.
        5.    @XQT TRRP*BENNETTFILE.INTRFACSUB
        6.    OFIN.
                                     12

-------
3.0.0   EXECUTION OF INTERFACE PROGRAMS FROM TERMINAL

Required ECL:
        1.   (3ADD.L TRRP*BENNETTFILE.ADD-SSG
        2.   @EOF
        3.   (PEOF
        4.   @END
        5.   @ADD,L BRKFILE.
Control Cards:
REQUIRED     1.
OPTIONAL     2.
OPTIONAL     3.
OPTIONAL     4.
EXECUTE "PROGRAM"
DISK FILE NAME IS "FILENAME"
TAPE FILE REEL NUMBER IS "REEL-NUM"
PUNCH CARDS AT PUNCH "CARD-PUNCH"
Explanation of Control Cards:
        1.   Control card #1
             This card is required and its purpose is to tell the system which
             "PROGRAM" (INTRFAC1 or INTRFAC2) to execute.
        2.   Control card #2
             This card is optional and when specified indicates to the system a
             disk file where the user wishes his cards to be punched and saved.
             If not specified, the system punch file is deleted, deleting all
             punched output.
        3.   Control card #3
             This card is optional and when specified indicates to the system the
             reel number of the tape to which the 80 character cards are to be
             written.
        4.   Control card #4
             This card is optional and indicates to the system where the cards
             generated are to be punched.  This card should only be used when
             neither control card #2 and #3 are specified or when control card #2
             only is specified.  This is because punch cards can only be punched
             from the user specified disk file or the system default disk file.
             System disk file default occurs when neither control card #2 and #3
             are specified.
                                      13

-------
                                 Execution

Step 1.   Enter the following ECL statement:
             0ADD.L TRRP*BENNETTFILE.ADD-SSG

Step 2.   When the terminal returns with a ready state enter the following
         required control card #1.
             EXECUTE INTRFAC2 (or INTRFAC1)

         If the user wishes to specify any of the optional control cards, he
         should enter them following the EXECUTE control card.

         When all control cards have been entered, type in two @EOF ECL state-
         ments.

         At this point, the control cards entered will be checked for format
         validity.  If errors are detected in the control cards, error messages
         describing the particular error will be printed.  If errors are detected
         and the user wishes to start again, he should type in
             ADD,L TRRP*BENNETTFILE.ADD-SSG
         which will start at Step 1 again.

Step 3.   At this point, if no errors are detected in the control cards, an @DATA
         ECL statement should have been generated automatically which will allow
         the user to now enter his parameter cards when the terminal is in a
         ready state.
                                           i

Step 4.   When all parameter cards have been entered, the user must then enter the
         two following ECL statements:
             @END
             (3ADD.L 8RKFILE.
         After Step 4, the system will then proceed to execute the program speci-
         fied in the control cards.
                                       14

-------
4.0.0    LISTING INTRFAC1 AND INTRFAC2 OUTPUT

         Utility software is available to list the disk and tape files generated
by programs INTRFAC1 and INTRFAC2.  The listing produced by the utility software
identifies each record on the file with a sequence number and prints a column
scale to aid in determining record column positions.  Execution of the list util-
ity software is described in 4.1 and 4.2.

4.1.0    Listing INTRFAC1 and INTRFAC2 Disk Output

         The following ECL statements list the disk file created by programs
INTRFAC1 and INTRFAC2:
         1.  (<>RUN
         2.  @ASG,T PARMCARD.
         3.  @DATA,IL PARMCARO.
         4.  000800000100001
         5.  @END
        *6.  @ASG,A 'USER-FILE-NAME.1
        *7.  @USE LIST-FILE.,'USER-FILE-NAME.'
         8.  @XQT TRRP*BENNETTFILE.LIST-DISK
         9.  @FIN

*NOTE
ECL statements 6 and 7 require  the user to substitute  'USER-FILE-NAME.1 with the
filename of the disk file created by  INTRFAC1 or  INTRFAC2.
                                        t

4.2.0    Listing INTRFAC1 and INTRFAC2 Tape Output

         The following ECL statements list'the tape file created by programs
INTRFAC1 and INTRFAC2:
         1.  (3RUN
         2.  @ASG,T PARMCARD.
         3.  @DATA,IL PARMCARD.
         4.  000800000100001
         5.  ?END
        *6.  @ASG,TJ/R PSI-HOUR-TPE..16N//////Q,'TAPE-REEL-NUMBER'
         7.  G>XQT TRRP*BENNETTFILE.LIST-TAPE
         8.  SPIN
                                      15

-------
*NOTE
ECL statement 6 requires the user to substitute 'TAPE-REEL-NUMBER1 with the
reel number of the tape file created by INTRFAC1 or INTRFAC2.
                                        16

-------
5.0.0   PERMISSIBLE POLLUTANT, METHOD, INTERVAL, UNITS COMBINATIONS
POLLUTANT
CO
OZONE
N02
S02
TSP
POLLUTANT
CODE
42101
44101
44201
42602
42401
42401
11101
POLLUTANT
METHOD
11,21
13,14,15
11,13
11,12,13,14
11,13,14,
15,16,31,
33
91
91
POLLUTANT
INTERVAL
£
1
1
1
X
7
7
POLLUTANT
UNITS
05
01,07
01,07
01,07
01,07
01,07
01,07
                                       17

-------
6.0.0  PROGRAM INPUTS

       Programs INTRFAC1 and INTRFAC2 both use the same type of user-supplied
input data.  Both require an option card followed by selection parameter cards.
The option card indicates to both programs what type of output file to generate
(i.e., disk file, tape file, or both disk and tape files).  The selection para-
meter cards provides the selection criteria by which both programs will select
and retrieve SAROAD data records.  The format of the option card and selection
parameter cards is the same for both programs.
6.1.0  Output Option Card Format
Card Column              ItemDescription
  1                      Output option card indicator
  2                      Not used
  3-6                    Type file to output
                                                       Permissible Value
                                                       Must be '!'.
                                                       Blank.
                                                       'DISK', disk output only.
                                                       'TAPE', tape output only.
                                                       'BOTH', both disk and tape
                                                       output.
6.2,0  Selection Parameter Card Format
Card Column              Item Description
                         State
1-2

3-6

7-9

10

11-12

13
14-15
16
17-21

22
                         Area

                         Site
                         Agency

                         Project
                         Not used
                         Year
                         Not Used
                         CO pollutant code

                         Not used
         PermissIble Va 1 ue
'01' thru '55' for a specific State
or '$$' for all States.
     I' thru '9999' for a specific
Area or '$$$$' for all Areas.
    I' thru '999' for a specific Site
or '$$$' for all Sites.
'A1 thru 'Z'  for a specific Agency
or '$' for all Agengies.
'01' thru '99' for a specific Project
or '$$' for all Projects.
Blank.
'73' thru '99'.
Blank.
'42101' or '$$$$$' if no CO records
are to be selected.
Blank.
                                       18

-------
Card Column
  23-24

  25

  26-27

  28
  29-33

  34
  35-36
  37

  38-39

  40
  41-45

  46
  47-48

  49

  50-51

  52
  53-57

  58
  59-60
I tern Descri pti on
CO method code

CO interval code

CO units code

Not used
Ozone pollutant code.

Not used
Ozone method code
Ozone interval code

Ozone units code

Not used
NOp pollutant code

Not used
N02 method code

N02 interval code

N02 units code
Not used
S02 pollutant code
Not used
$02 method code
          PermissibleValue
'11', '21', or '$$' if no CO records
are to be selected.
'£' or '$' if no CO records are to
be selected.
'05' or '$$' if no CO records are
to be selected.
Blank.
'44101', 44201' or '$$$$$' if no
Ozone records are to be selected.
Blank.
44101:  '13' thru '15'.
44201:  '11', '13'.
'$$' if no Ozone records are to be
selected.
'!' or '$' if no Ozone records are
to be selected.
'01', '07', or '$$' if no Ozone
records are to be selected.
Blank.
'42602' or '$$$$$'  if no N02 records
are to be selected.
Blank.
'11' thru '14' or '$$' if no NOg
records are to be selected.
'!' or '$' if no N02 records are to
be selected.
'01', '07', or '$$' if no N02 records
are to be selected.
Blank.
'42401' or '$$$$$'  if no S02 records
are to be selected
Blank.
'11', '13' thru '16', '31', '33',
'91', or  '$$' if no S02 records are
to be selected.
                                      19

-------
Card Column

  61
ItemDescription

S02 interval code
  62-63


  64

  65-69


  70

  71-72


  73


  74-75


  76-80
S02 units code


Not used

TSP pollutant code


Not used

TSP method code


TSP interval code


TSP units code


Not used
        Permissible Value

'X1  for methods '11', '13'  thru '16',
'31', '33'.
'7'  for method '91'.
'$'  if no S02 records are to be
selected.

'01', '07'  or '$$'  if no SC>2 records
are to be selected.

Blank.

'11101'  or '$$$$$'  if no TSP records
are to be selected.

Blank.

'91' or  '$$'  if no TSP records are
to be selected.

'7'  or '$'  if no TSP records are to
be selected.

'01', '07'  or '$$'  if no TSP records
are to be selected.

Blank.
                                       20

-------
7.0.0   PROGRAM OUTPUTS
        Programs INTRFAC1 and INTRFAC2 generate output files consisting of 80-char-
acter card image records.  The output record format used in both programs are the
same with a one field value being the exception.  All pollutant value fields con-
tain the value 99999.99 to indicate a missing value.

7.1.0   INTRFAC1 Output Record Format
Card Column
1-2
3-14

15
16-21
22
23-29
30
31-37
38
39-45
46
47-53
54
55-61
62
63-64
65
66-67
68
69-70
71
Item Description/Content
Not used, blank.
12 character station code consisting of STATE-AREA-
SITE-AGENCY-PROJECT.
Not used, blank.
Date in YYMMDD format.
Not used, blank.
CO hourly value in F7.2 format.
Not used, blank.
Ozone hourly value in F7.2 format.
Not used, blank.
N02 hourly value in F7.2 format.
Not used, blank.
S02 hourly value in F7.2 format.
Not used, blank.
TSP hourly value in F7.2 format
Not used, blank.
Hour of the day (i.e. 1,2,3,	,23,or 24)
Not used, blank.
CO method code.
CO units code (units digit).
Ozone method code.
Ozone units code (units digit).
                                        21

-------
Card Column                     Item Description/Content
72-73                           NO? method code.
74                              N02 units code  (units digit).
75-76                           S02 method code.
77                              SOp units code  (units digit).
78-79                           TSP method code.
80                              TSP units code  (units digit).

7.2.0   INTRFAC2 Output  Record  Format
Card Column                     Item Description/Content
1-2                             Not used, blank.
3-14                            12 character station  code  constisting of STATE-AREA-
                                SITE-AGENCY-PROJECT.
15                              Not used, blank.
16-21                           Date in  YYMMDD  format.
22                              Not used, blank.
23-29                           CO daily maximum value  in  F7.2 format.
30                              Not used, blank.
31-37                           Ozone  daily  maximum value  in F7.2 format.
38                              Not used, blank.
39-45                           N02 daily maximum value in F7.2 format.
46                              Not used, blank.
47-53                           S02 daily maximum value in F7.2 format.
54                              Not used, blank.
55-61                           TSP daily maximum value in F7.2 format.
62                               Not  used, blank.
63-64                           Always zero.
65                              Not  used, blank.
66-67                            CO method code.
68                               CO units code (units digit).

                                         22

-------
Card Column
69-70
71
72-73
74
75-76
77
78-79
Item Description/Content
Ozone method code.
Ozone units code  (units digit),
N02 method code.
    units code (units digit).
S02 method code.
S0£ units code {units digit).
TSP method code.
TSP units code (units digit).
                                       23

-------

'" ~1

-------