EPA-450/3-74-019
December 1973
         COMPUTER PROGRAMS
         FOR THE  CONVERSION
             OF ILLINOIS  STATE
             AIR  QUALITY DATA
     TO THE SAROAD FORMAT
    U.S. ENVIRONMENTAL PROTECTION AGENCY
        Office of Air and Water Programs
    Office of Air Quality Planning and Standards
    Research Triangle Park, North Carolina 27711

-------
                                EPA-450/3-74-019
  COMPUTER PROGRAMS
  FOR THE CONVERSION
     OF  ILLINOIS  STATE
     AIR QUALITY DATA
TO THE SAROAD FORMAT
                  by

         Paul Swartz , Khee M . Chng,
          and Dr. Richard D. Siegel

         Walden Research Corporation
             359 Allston Street
        Cambridge, Massachusetts 02139
         Contract Number 68-02-0049
      EPA Project Officer: Amos Slaymaker
              Prepared for

     ENVIRONMENTAL PROTECTION AGENCY
        Office of Air and Water Programs
    Office of Air Quality Planning and Standards
      Research Triangle Park, N. C.  27711

             December 1973

-------
This report is issued by the Environmental Protection Agency to
report technical data of interest to a limited number of readers.
Copies are available free of charge to Federal employees, current
contractors and grantees, and nonprofit organizations - as supplies
permit - from the Air Pollution Technical Information Center,
Environmental Protection Agency, Research Triangle  Park, North
Carolina 27711, or from the National Technical Information Service,
5285 Port Royal Road, Springfield, Virginia 22151.
This report was furnished to the Environmental Protection Agency
by Walden Research Corporation, Cambridge, Massachusetts, in
fulfillment of Contract No.  68-02-0049.  The contents of this report
are reproduced herein as received from Walden Research Corpora-
tion.  The opinions, findings, and conclusions expressed  are those
of the author and not necessarily those of the Environmental Protec-
tion Agency. Mention of company or product names is not to be con-
sidered as an endorsement by the Environmental Protection Agency.
               Publication No.  EPA-450/3-74-019
                              11

-------
                            ACKNOWLEDGEMENTS

     This work was carried out under the direction of Dr. R.  D.  Siegel
who assumed project responsibility.  The principal programming effort
was done by P. Swartz, with K. M. Chng consulting.

     The Project Officer for this program was Mr. Barry Bolka of the
Surveillance and Analysis Division, Region V Office, U.S. Environmental
Protection Agency.
                                  m

-------
                               TABLE OF CONTENTS
  Section
      I
     II
                        Title
    III
     IV
     VI
APPENDIX A
APPENDIX B
APPENDIX C
APPENDIX D
APPENDIX E
INTRODUCTION 	
PROGRAM FUNCTIONS
             A.   The PREPROCESSOR Program
             B.   The CONVERSION Program ..
INPUT DATA DESCRIPTION
             A.  Detailed Description of Input for PREPROCESSOR ...
             B.  Detailed Description of Input for CONVERSION 	
SAMPLE CASE
             A.  Input/Output Data for PREPROCESSOR
             B.  Input/Output Data for CONVERSION ..
             MISCELLANEOUS OPERATIONAL INFORMATION
             A.   Systems and CPU Times
             B.   Program Messages 	
REFERENCES 	
SOURCE LISTING OF PREPROCESSOR PROGRAM .
SOURCE LISTING OF CONVERSION PROGRAM ...
JCL REQUIREMENTS 	
PROGRAM ADDITIONS AND MODIFICATIONS 	
OPTIONAL OUTPUT FROM CONVERSION PROGRAM
Page
1-1
2-1
2-1
2-1
3-1
3-1
3-1
4-1
4-1
4-1
5-1
5-1
5-1
6-1
A-l
B-l
C-l
D-l
E-l

-------
I.  INTRODUCTION

    This report describes two computer programs that are used to convert
State of Illinois air quality data to the SAROAD format [1, 2].   The first
program (the PREPROCESSOR) preprocesses the Illinois data on tape and writes
out an output tape for the main program (the CONVERSION).  The PREPROCESSOR
is written in ASSEMBLY to facilitate the "unpacking" of some of the data
records which are in packed decimal format.  The CONVERSION is written in
FORTRAN IV and does all the necessary conversion to the SAROAD format.

    The main body of the report is made up of four primary sections as
follows:

    (1)  Program Functions, which describe briefly the scope and struc-
ture of the PREPROCESSOR and the CONVERSION programs.

    (2)  Input Data Description, which contains detailed description
of input data format for the two programs.

    (3)  Sample Case, provided by the Illinois EPA in  the form of air
quality data on tape, was used to demonstrate the execution of these pro-
grams.

    (4)  Operational Information, consisting of software data and pro-
gram messages, are discussed in the last section.

    Additionally, source listings for both programs, the Job Control
Language (JCL) requirements, and the necessary modifications to the CON-
VERSION program to accommodate site or pollutant additions are included in
the Appendices.
                                      1-1

-------
II.  PROGRAM FUNCTIONS

     A.  THE PREPROCESSOR PROGRAM

         The PREPROCESSOR program reads an Illinois tape, sorts the records
by type and writes a tape consisting of four files, one for each record
type.  In processing each record, it changes blanks to nines because a dis-
tinction between blanks and zeros is necessary and FORTRAN (as used in the
CONVERSION) cannot make such a distinction.  Some of the records contain
data in packed decimal format and this is unpacked before writing.  The
output tape is designed for processing by the CONVERSION program.  The
PREPROCESSOR will process one input tape and stop.  No diagnostics are
written.

         The basic elements of the PREPROCESSOR are illustrated in the flow
diagram in Figure 2-1.

     B.  THE CONVERSION PROGRAM

         The CONVERSION program reads the tape output created by the PRE-
PROCESSOR and by a table look-up method obtains the corresponding SAROAD
codes for each record processed.  It then writes a four file output tape
of eighty column card images in the SAROAD format and stops.  The files
correspond to the four record types 3, 2, 1 and 5 in that order.  Physical
record blocking is controlled by appropriate JCL specifications.

         An optional feature allows the program to write the output to the
same device as it writes the diagnostics (initially set to the line
printer).  Each line of printed output will be preceded by the correspond-
ing unconverted Illinois record.

         The CONVERSION program consists of a MAIN routine plus six sub-
routines.  It has two labelled common blocks which are common to the entire
program.

         The MAIN routine initializes the 10 common block which determines
which input/output devices will be utilized by the subroutines.  Then MAIN
in turn calls into execution four subroutines,  each of which  handles  a
file containing a particular record type.
                                   2-1

-------
                 OPEN RECORD TYPE 3
                 AND OUTPUT DATA SET
                  r
BGIN
1
i
OPEN INPUT DATA SET
                       3
                       RECURSE
        D
                GET NEXT INPUT RECORD
                      SET 1=17
                          IS
                          IT
                     RECORD TYPE
                       DESIRED
Figure 2-1.  Flow Diagram for PREPROCESSOR Program.

                         2-2

-------
          o

     s   x
RECORD TYPE
   THREE   •,
          COMP
          J
   IS
BYTE(I)
 BLANK
            No

                         Yes
     UNPACK 3 BYTES
 CHANGE SIGN CODE TO 'F1
    PUT SIGN IN FRONT
        SET 1=1+3
Figure 2-1  (continued)
          2-3
                                    THREE
                                    BLANK
                                     J
                          INSERT TWO 9's
                         IN OUTPUT RECORD
                            SET 1=1+1

-------
     FILL UP OUTPUT  RECORD  WITH 9's
        INSERT RECORD TYPE  ID  IN
            OUTPUT  RECORD
         WRITE 1 RECORD ON TAPE
            C RECURSEJ
No
             MOVE NUMBER TO
              OUTPUT RECORD
                   i
               SET
           Figure 2-1 (continued)
                    2-4
                                            INSERT A 9
                                                 I

-------
     SET RECORD
        ID=3
     WRITE OUT
      1  RECORD
      RECURSE
         is
        THIS
    RECORD TYPE
         5
           No
  Yes
CLOSE INPUT DATA SET
1
                      Yes
       Figure 2-1 (continued)
CLOSE INPUT/
OUTPUT  DATA
    SETS
                     RETURN
                     (EXIT)
               CLOSE OUTPUT DATA SET
                FOR RECORD 3.  OPEN
               DATA SET FOR RECORD 2.
                  SET RECORD  ID=2
                                        f
                                            BGIN
                2-5

-------
           IS
          THIS
       RECORD TYPE
           2
                                     CLOSE OUTPUT DATA
                                     SET FOR RECORD 2.
                                     OPEN OUTPUT DATA
                                     SET FOR RECORD 1.
                                      SET RECORD 10=1
CLOSE OUTPUT DATA SET 1
 OPEN OUTPUT  DATA  SET 5.
    SET RECORD ID=5
("
         BGIN
          Figure 2-1  (continued)
                  2-6

-------
         The four subroutines are named mnemonically for the various record
types, REC1, REC2, REC3, REC5, and are Independent of each other.   Their
primary functions are similar:  they read 1n an Illinois record of the cor-
rect type and write out a new record, converted to SAROAD format.   The pro-
cessing is done in the remaining two subroutines, HEADER and PLUTNT.

         The subroutine HEADER searches a table of Illinois geographic and
site codes and if it finds a match, it returns a SAROAD state code, area
code, site code, and agency/project code.  If no match is found, it writes
a diagnostic saying so, sets an error flag, and returns to the calling sub-
routine.

         PLUTNT searches a table of pollutant codes to find a match.  If it
finds one, it goes on to obtain method, units, and decimal place information
from another table at a place which is specific to the site and pollutant
codes and returns to the calling subroutine.  If an error occurs,  it writes
a diagnostic, sets an error flag and returns.

         All of the arguments for the subroutines are passed through the
labelled common HEAD except for I/O device numbers which are contained in
the labelled common 10.

         The sequence of events discussed above are depicted in the flow
diagram shown in Figure 2-2.
                                   2-7

-------
Figure 2-2.  Flow Diagram for CONVERSION Program (Main).
                    ASSIGN I/O DEVICES
                        CALL REC3
                        CALL REC2
                        CALL REC1
                        CALL  REC5
                          2-8

-------
Figure 2-2   (continued) (SUBROUTINE REC3)
             WRITE RECORD
             ON DIAGNOSTIC
                 FILE
                 _r
         GET TABULATED SAROAD
           CODES FOR VALID
             DATA ITEMS
               CALL MUD  I
                  2-9

-------
Figure 2-2 (continued) (SUBROUTINE REC3)
               WRITE OUTPUT
                 ON TAPE
                WRITE EOF
                 2-10

-------
Figure 2-2 (continued) (SUBROUTINE REC2)
               WRITE  RECORD
              ON DIAGNOSTIC
                   FILE
                   r
           WRITE 1ST 12 THEN
            2ND 12  VALUES ON
                 TAPE
                ( RETURN
                                              I
                  2-11

-------
Figure 2-2 (continued) (SUBROUTINE REC1)
           READ A RECORD
            CALL HEADER
-pt
J
            CALL PLUTNT
                         N°
                 Yes
            WRITE RECORD
                ON
           DIAGNOSTIC FILE
                r
          WRITE CARD IMAGE
           ON OUTPUT TAPE
-*O
                                     WRITE EOF
               2-12

-------
Figure 2-2  (continued)  (SUBROUTINE REC5)
               WRITE RECORD
                   ON
              DIAGNOSTIC  FILE
O4-
                 CALL MUD
             SET PARAMETER =
             WIND DIRECTION
                HOUR LOOP
              DO 30  1=1,24
                   2-13

-------
Figure 2-2 (continued)  (SUBROUTINE  REC5)
           WRITE 1ST 12 THEN
            2ND 12  VALUES ON
                 TAPE
        r
SET PARAMETER
   = SPEED
                  2-14

-------
Figure 2-2 (continued) (SUBROUTINE REC5)
                CALL MUD
            WRITE 1ST 12  THEN
            2ND 12 VALUES ON
                  TAPE
           L
WRITE EOF
                 RETURN
                  2-15

-------
Figure 2-2 (continued) (SUBROUTINE HEADER)
    SET KEY«(GEO CODE)*100
          + SITE NO.
          SIND LOOP
     00 10 SIND-1.NSITES
     WRITE DIAGNOSTIC  ON
       DIAG.  FILE,  SET
         ERR-.TRUE.
             0*-
                                        SET  FOLLOWING:
                                     STARSI=LACTABL(2,SIND)
                                     AGPROJ=AGNPRJ(SIND)
                                          ERR=.FALSE.
                 2-16

-------
Figure 2-2 (continued) (SUBROUTINE PLUTNT)
                PRMIND LOOP
            DO 10 PRMIND-1,NPOLS
                     IS
                 POLLUTANT
                CODE-PLTABL
                 (1, PRMIND)
            WRITE DIAGNOSTIC ON
              DIAG. FILE, SET
                ERR=.TRUE.
      Yes
                   2-17

-------
2-2 (continued) (SUBROUTINE PLUTNT)
             ,"•-•,
              1
    ENTRY MUD (DETERMINES
     METHODS, UNITS AND
      DECIMAL LOCATION
             I
  SET PRAM-PLTABL(2,PRMIND)
     METH-M(SIND.PRMIND)
               Yes (method changed)
             IS
        CHNGES(4,PT)
           < DATE
                            No
No
               Yes (method changed again)
             2-18

-------
         Figure 2-2 (continued)  (SUBROUTINE PLUTNT)
WRITE ERROR MESSAGE
   ON OIAG. FILE
    ERR=.TRUE.
                           SET  FOLLOWING:
                         METH-CHNGESH,PT
                         UNIT»CHNGES(2,PT
                         DPLOOCHNGES(3,PT)
        0—
                                                  SET FOLLOWING:
                                                UNIT=U(SIND,PRMIND)
                                                DPLOC=D(SIND,PRMIND)
                            2-19

-------
III.  INPUT DATA DESCRIPTION                           :

      A.  DETAILED DESCRIPTION OF INPUT FOR PREPROCESSOR

          The input to the PREPROCESSOR program consists of one file of card
images of 150 bytes per card.  All of the card images contain a 16-diglt
heading in unpacked decimal format as shown in Tables 3-1 through 3-4.  The
format of the various record types are extracted from Illinois EPA [3].

          The records fall into two categories.  Record type 3 makes up the
first category.  It contains daily data in unpacked decimal, four digits to
a pollutant.  The data starts in column 17.  Leading zeros should be pres-
ent as opposed to leading blanks.  Unused fields should be filled with
blanks.

          Record types 1, 2, and 5 form the other category.  These contain
data from hourly or two hour samples in a packed decimal format with three
bytes to a value.  The records should be padded with blanks to fill out the
record.

      B.  DETAILED DESCRIPTION OF INPUT FOR CONVERSION

          Input to the CONVERSION program is limited only to the output
tape created by the PREPROCESSOR program.

          This preprocessed tape is made up of four files, one correspond-
ing to each record type 3, 2, 1, and 5 in that order.  File 1 (record type
3) has a logical record length of 150 bytes.  Files 2, 3, and 4 (record
types 2, 1, and 5, respectively) all have logical record lengths of 300
bytes.  Physical record blocking is determined by appropriate JCL state-
ments .
                                   3-1

-------
           TABLE 3-1

FORMAT OF RECORD TYPE NO. 3
    24 HOUR SAMPLING TIME
Col
From
1
7
9
11
13
15
17
21
25
29
33
37
41
45
49
150
umns
To
6
8
10
12
14
16
20
24
28
32
36
40
44
48
149

PIC
9(6)
99
99
99
99
99
9(4)
99V99
99V99
9V999
999V9
99V99
99V99
999V9
X(99)
9
Field Description
Geographic Code
Filler
Site No.
Year
Month
Day
Parti cul ate
H2S
COH
so2
Organic
PH
Lead
Fluoride
Filler
REC Type=3
              3-2

-------
                               TABLE 3^-2

                     FORMAT OF RECORD TYPE NO.  1  -
                          2 HOUR SAMPLING TIME
Col umns
From
1
7
9
11
13
15
To
6
8
10
12
14
16
PIC
9(6)
99
99
99
99
99
Description of Field
Geographic Code
Pollutant Code
Site Number
Year
Month
Day
 17     19       S9(5)       Sample Value-Packed Decimal-(Occurs 24 times)
 89    149       X(61)       Filler
150                  9       REC Type=l
                                  3-3

-------
                               TABLE 3-3

                     FORMAT OF RECORD TYPE  NO. 2 -
                          1  HOUR  SAMPLING TIME
Columns
From
1
7
9
11
13
15
To
6
8
10
12
14
16
PIC
9(6)
99
99
99
99
99.
Description of Field
Geographic Code
Pollutant Code
Site Number
Year
Month
Day
 17     19       S9(5)       Sample  Value-Packed Decimal-(Occurs 24 times)
 89    149       X(61)       Filler
ISO                  9       REC Type=2
                                  3-4

-------
                             TABLE 3-4

                   FORMAT OF RECORD TYPE NO. 5 -
                        METEOROLOGICAL DATA
Col
From
1
7
9
11
13
15
17
umns
To
6
8
10
12
14
16
19
PIC
9(6)
99
99
99
99
99
S9(5)
Field
Geographic Code
Filler
Site No.
Year
Month
Day
Wind Direction (
Wind Speed
Description






9(3)1 Packed Decimal
9(2) (Occurs 24 times)
 89    149       X(6.1)       Filler
150                  9       REC Type=5
                                3-5

-------
IV.  SAMPLE CASE

     A sample tape containing 'Illinois state air quality data was used to
demonstrate the conversion of the data to SAROAD format.

     A.  INPUT/OUTPUT DATA FOR PREPROCESSOR

         The input tape has only one file consisting of four types of rec-
ords with formats as presented in Tables 3-1 through 3-4.  The PREPROCESSOR
can accept these records in any random order.  A sample of each of these
record types before processing 1s shown in Table 4-1.  The printed output
is in hexadecimal so that there are two characters for every byte of core.

         The output from the PREPROCESSOR is a four file tape -- one file
for each record type in the order 3, 2, 1, and 5.  File 1 (record type 3)
has a logical record length of 150 bytes. .Files 2, 3, and 4 (for record
types 2, 1, and 5, respectively) all have logical lengths of 300 bytes.
Table 4-2 illustrates the preprocessed records corresponding to the input
from Table 4-1.  The printed output is again in hexadecimal.  Note that
the printed output is not a part of the PREPROCESSOR, but rather it comes
from "tape dumps" of the input and output tapes generated by a Maiden
program.*

     B.  INPUT/OUTPUT DATA FOR CONVERSION

         The only input data to the CONVERSION program 1s the preprocessed
tape written by the PREPROCESSOR.  When the preprocessed data (Table 4-2)
1s read by CONVERSION (1n FORTRAN), the data is interpreted in a manner as
shown in Table 4-3.

         The normal output from CONVERSION is an unlabelled tape consisting
of four files of card images of eighty columns per record.  Each file cor-
responds to each record type.  Additionally, printed output may also be ob-
tained by setting the variable OPTION to a non-integer value (see Appendix
E).  When this option 1s exercised, printed output of the form shown in
 Program LIST.
                                   4-1

-------
                            TABLE 4-1

                 SAMPLE INPUT AIR QUALITY DATA FORMAT
Record Type 3:

                 . FOFOFoFOFtf P4U4QF.CFLf7F3F_OF4F^OF>_F_OFOF_1FJ5 4p_4_q404p4<).

                  *04J4U404040404J4040H P4p4;04d'4p4p4p4p4p4Q404040404Q.._

                  404C40404C^a404p4C404C4p4p4Q4p404Q4J54A404^p.4p4p_4_P_

                  4J4 C4U-»0p4040404p4Q40404p4.040F3
Record Type 2:

             	FOFiF^FOF3POF3F^FOFlF7F3FOF4F3FIOOQIOCD002JCQQ02 OC

                  opo2oc opci gcj:pciucccpipcpppiQCQOpjpcpop_ipcpA^^^

                  01 ocaiugijQC oppi pc pcoi CC.Q.OOI pc pppipcppo2pcppp2ocopp.i._

             	pj:_p0010C.CO01 XQJ01 PC J3Q10C404040404340404040404040

             	 4J40t04Q4Q4Q404C404C40404040404040404040^040404040_

                  *040404040404C404Q4CAOAP4p4pj%P404p4p4p4Q^Pip4p4p£2
Record Type 1:


                  FOFiF6F.QFilF_2FlFaF_JFl_F7F3F 3F4FOF1404Q40404040404040

                  40404040404040^04040^4040404040*040^40^04^

                _ 4o>_qqoo£ttjDpjwocjpoc^c^

              	QC OJQ20C 0002X00020C0002 OC404040404040404040404040

                  404 P4.p4p4p40jvp40_4p404 0^0^0^04040^04^04^40 404p4p_4p 4 0

                  404Q40404040404P404_C4 C4p4^.P^p4_p_4^04^4^^404040 F1
                               4-2

-------
                       TABLE 4-1 (continued)
Record Type 5:    ^_ F0£lJF_6FjOF IF24040FQF2F7F3FOF4FOF1404040404040404040




                  404C4p4p404p_4_0404j04C4Q4.p4p4JK^




                  81 OC i80i X 180I XI8009C180 09C 18009C20310C20310jC.2251




                  4C225i2C,22_5l2C225.l2C^



                  4040404040404040404 04 04 p404p404p4p404p^0!4p4p4q4q4p




                  40404J404040404040404040404040404040404040404040F5
                               4-3

-------
                             TABLE 4-2

                  SAMPLE PREPROCESSED DATA FORMAT -
                        OUTPUT OF PREPROCESSOR
Record Type 3:  POF OF of pF3F 04040F OF IF 7F3F _OF4F :OF4FpFp_ Fl JF_S > F9F9 F9F9 F9

              F9F9F9F9F9F9F9F9F9FSIF9F9F9F9F9F9F9F9F9F9F9F9F9F9F9

              fr.9P9F9F9F9F9F9P9F9F5P<;F9F9F9F9F9F9F9F9F9F9F9F9F9F9

              pyp ^p Vp9p 9P9P 9P9F 9F ^p 9F9F9F9F -9F9F9_F_9F9f 9 F9F9 pg . F9 F9

              F9FSFyF9F9F9F9F9F9FSF9F9F9F9F9F9F9F9F9F9F9F9F9F9F9

              F9F9FVF9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F3


Record Type 2:  FuFiF4F.pF3FpFiF2FpFlF 7F3F_OF^FO_F.1FOFOF.OFOF1FOFOFO FO

              F JF 2F OF ?F JF OF JF2F OF OF Cf OF JF2 FOfOFOFpFO FlfO FO FO FO.FO
                                     /
              F1F OF OF OF OF OF 1 F OF OF CF OF OF 1 F O.FOFOf p_FOF 1 FOfp FO FQ FO F I

              F OF OF OFOFOF IF OFOF OF OF PF1F_OF 0£pFOFOf.l FOFOFOfO FO Fl FO

             _f :^F JI:F OF 1 F OFOF LOF OF OF 1FJ)F FOF0F OF1 f     OO  F2 FO FO
              FOF PFOF2F OF OF OF_QF OFJLF OFjDF QFO£PJ:_LFJ)FO FpFpFOFl FOFO FO..

              FOF OF IF OF OF OF OF_O.F IF Q£9F9F 9F_9F9F9f9F9 F9 FJ9 F9 F9 F9_F9 F9

              F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9P9F9F9F9F9F9F9F9F9F9

              F 9F 9 F *F 9 F 9F 9 F 9F 9F 9F 9F. 9F ^9F 9F i9F_9_F 9 F_9 F 9F 9 F_9 F9 F9 F9 F9.F9
              F9F9F9F9F9F9F9F9F9FSF9F9F9F9F9F9F9F9F9F9F9F9F9F9F9
              F9F9F9F9F9F9F9F9F9FSF9F9F9F9F9F9F9F9F9F9F9F9F9F9F2
                                4-4

-------
                        TABLE 4-2 (continued)
Record Type 1 :  F JFiF6FpF IF2F iFUFpFlF 7F3FpF^FOFlF9F9F9F9F9F9F9F9 F9




              F9f: 9f ?_F ? F 9F_^: ?.f 9F 9F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9 F9



              f gp 9P 9p g p gp 9F 9F 9F_9F 9F 9F 9F 9F 9F9F_9F_9 F9F9 F9_F9F9 F9 F9 F9




              Fy]p9F9fyp9P9P9p9f 9P9PSF_9F9FpFpFOFOF2FOFOFOJ:OFOF2FO




              F UP OF yr 0 F2 F OF JF OFGF OF 2 F_OF_OF OF OF _0 F2 F 0 FOR) FO FO F2 FO FO




              FaFOFJF2FOFOFJFOFJf2J-OFOFJFJFOF2FOFOFOFOFOF2FJFOFp




              FOFUF2FOFCFCFOFOF^FCF 5F9F 9F9F9F9F9F9F9F9F9P9F9F9 F9



              p gp 9P yp 9 p yp gp 9P yp yp cjp gp gp gp gp g_pg pg p 9 F9_F9_F9_F9 F9 F9 F9




              F9F9r^F9F9F9F9F9F9F9F 9F9F9F9F9F9F9F9F9F9F9F9F9F9 F9




                                      F9F9F9p9F9F9_F9F9F9F9F9F9F9 F9




                p yp vP 9F 9F 9F 9F9F 9F 9r 9F9F ?F 9F9F9F9F9F9F9 F9F9 F9F9 F9_




                                     9F9F9F9P9P9F9P9F9F9F_9_F9F9.F9_F1
Record Type 5:




              F9F.9F9F9F9F9F9F9F9F9FqF.9F 9F_9F9F9F9F_9F9F9F?£9 F9F9 F9




             ...F.9? ?f ?JI .y.P.?f .9.F...?f_if 9F: .yFJ?_F 9P9F9F9F9F9F9F9F9F9F9_r9.F9F9



              F 9F 9F 9F 9 F 9F 9F 9F OF I F 5F 3 F 1 F.OF OF. i F 8. FOF JL FO F 0 F_l F8 F_0 F 1 FO




              F JF 1 F dF OF OF 9F OF IF bF OF OF 9F OF.l £8 FOJF_OF9£Of 2 FO £3 F If 0 FO




              F2FOF3FiFOFOF2F2F5FiF^FOF2F2F5FlF2FOF2F2F5FlF2FOF2




              F2F5hiF2FOF2F2FbFiF2F9F9F9F9F9F9F9F9F9F9F9F9F9F9F9




              F 9F 9F 9F 9 F 9F 9F 9F.9F 9F 9F 9F 9F9F9F 9 £9£9 F 9FS |£ 9 F9 F9JF 9 F9 F9




              F iF 9F 9F 9 F 9F 9F_9F9F 9F 9F_9f 9_F_9JF_9F 9*F_9jF9 F_9F 9F9F9F9F9F9 F9




              F9F9ir9F9F9F 9F 9P9F 9F SF 9F9F9F9F9F9F9F9F9F9F9F9F9F9 F9




              F 9FyF9F9F9F9F 9F9F9F9F 9F9F 9F9P9F9JF9_FJF9FJ9F^9 F9F9 F9




              »-9FSF9F9r9F9F9F9F9FSF9F9F9F9F9F9F9F9F9F9F9F9F9F9F5
                                4-5

-------
                            TABLE 4-3

                    PREPROCESSED DATA AS READ BY
                       THE CONVERSION PROGRAM
Record Type 3: 00603U _..Ci 730^t400i5>999999099999999999.95999999999

             S9 y 99 999 S 9 S 9 9 9 999999 999 99 9 9 9 99 9 99 9 9 9 SS 99999999999999 999 9 99_9Jl 99 999 9_1


             0020UOUO 2099^99 999 ySy9_9^99999?999^

             99999999959999999^9^99 9 99 99 99999_9 99 99 9 9999 9 9 9 9 9999


             9 y 99 y y y y s 9 9 99999 99 y y y s 9 ?9_99_999 ^j^^i^^^Ji? 299 99 9991


Record Type 5: 2f>12J^2i> 12 9999 S9 99999 ?99999999^999^99j9999J99999999


             999^9999999999599999999999999999999999999999999999
            2i)12J22!>i2S599S9S9SS999999y999999999999999999999^9

            99999999 999999 999ySS99999999999999999999 9999999999

            yy9yyyyyysyyyyyyy999y 999999999999999999999999999 9 5
                              4-6

-------
Table 4-4 will be produced.  Each pair of lines refer to one record.  The
first line is the Illinois record, and the second is the converted SAROAD
counterpart.
                                   4-7

-------
                                                                 TABLE 4-4
I
00
   .'KD TYr-F  J.
           COJO     i     7jOtO-T
    2l4!)60^2t CH10191
           16000    a     730401
           16006    d     730403
                ol/73UtOj U110i9i
           ItOUo    o     7j040i>
     214154CCC10U1 77J040S C111C191
                           C1110191
           16CC6    0     730410
    214154CC01o0177304iO  01110191
           160oO    d     /J0-fi2
    2141£4CC01G01//3J41^  C111C191
           16006    0     73041b
    i L'-tl f40C01ool 77^041 S  01110191
           K-JOo    o     730417
    -. i /. i e /. n r. i i, , > . ;•/<.-.. i 7  r \ ; , , • i o i


10

10

10

u

10

10

10

10

10

10

10

10

u

10

10

10

10

10

10

10

10

10

1 ' •

15
15
84
84
23
23
106
106
102
102
41
41
32
32
32
32
37
37
60
63
92
92
84
84
13
13
17
17
65
65
43
4342401
62
SAMPLE
9999

9999

9999

9999

9999

9999

9999

9999

9999

9999

9999

9999

9999

9999

9999

9999
91 73
9999
624240191 73
82.
C242401
74
9999
91 73
9999
744240191 73
49
9999
494240191 73
69
6942401
126
12642401
90
on i. f in i
9999
91 73
9999
91 73
9999
01 71
OPTIONAL OUTPUT FROM CONVERSION PROGRAM
9999

9999

9999

9999

9999

9999

9999

9999

9999

9999

9999

9999

9999

9999

9999

9999
2
9999
I
991<*
2
9999
2
9999
2
9999
4
9999
3
9999
I
9999

9999

9999

9999

9999

9999

9999

9999

9999

9999

9999

9999

9999

9999

9999

2

1

2

2

2

4

3

1

9999

9999

9999

9999

9999

9999

9999

9999

9999

9999

9999

9999

9999

9999

9999

9999

9999

9999

9999

9999

9999

9999

9999

9999

9999

9999

9999

9999

9999

9999

9999

9999

9999

9999

9999

9999

9999

9999

9999

9999

9999

9999

9999

9999

9999

9999

9999

9999

9999

9999

9999

9999

9999

9999

9999

9999

9999

9999

9999

9999

9999

9999

9999

9999

9999

9999

<>999

9999

9999

9999

9999

9999

9999

9999

9999

9999

9999

9999

9999

9999

9999

9999

9999

9999

9999

9999

9999

9999

9999

9999

9999

99991-
1

-------
                                                            TABLE 4-4 (continued)
Cl! R 'J
1140e'UG001t:
                            f Jlli
              U_>17.)0-»,J2
         16012
                           73C401
  1141540C02HOU730401 J4240113
  114 I 54CCC2M01 17j040U24<:tOli.>
   H41*40CU2HOU7.>J402 04240113
   H4i::4.oco2noii7.i o4u*i<:42 4 ui 13
         16012   J2     i  730403

   114l54CCO<:Huli7JU403 042tCli->
   1141S40002HOU7J0403U4240113
         16012   32     1  73C40-.

   114 1S40C02H Jll 7.JJ404 04*40113
   1141£4CCO<:Huir73J4041242
         16012   32     1  73040!?

   1 14 154CC02H01173040S 04240113
   1 14 1540002H01.17.JU40 5124*4 Oil j
         16012   32     1  73C406

   1141f40002H011/j0406 04240U3
   1141i40002HOii 7304 Jc 12424 Oil.)
         16012   32     1  73C4C7

   114 1540002H011730407 04240113
   1 14 154CC02M Oil 73 040 71242401 13
         1601*   3*     1  73C40U

   1141 ?4CCU2rt01i /JOfUt 0424C113
   114 154C002H 01 17 3040 £1242401 13
         16012   3*     1  7304C9

   114 l540C02HOil73v;40y 0424C11J
   1 14 1 f. 40002H Oil 7 j040 91242401 13
         16012   J2     i  730410


7j
7i


/ >
li


~ti
7j


73
73


73
7j


73
73


73
73


/3
7J<


73
73


73
73


1i
73


10
10
10 20
10 10
10
10
10 10
10 10
20
10
20 20
10 10
20
20
20 20
20 20
20
10
20 20
10 10
10
20
I 0 10
20 20
20
20
20 20
20 20
80
9999
80 60
5099 30
10
20
10 10
20 20
10
10
10 10
10 10
10
20
10 20
20 20
20
30
20
10
20 20
10 10
10
10
10 10
10 10
20
10
20 20
20 20
20
20
20 20
20 20
20
10
20 20
10 10
10
20
20 20
10 10
20
20
20 40
20 20
60
30
60 40
30 30
10
20
10 10
40 10
10
10
10 10
10 10
20
20
10 10
20 20
20
30
20
10
10 10
10 20
10
10
10 10
10 10
20
20
20 20
20 20
20
20
20 20
20 20
20
10
20 20
20 20
20
10
20 20
10 10
20
.20
40 '+0
20 20
60
30
40 40
30 30
10
40
10 10
10 10
10
10
10 10
10 10
10
20
10 10
20 20
20
30
20
10
10
20
10
10
10
10
20
20
20
20
20
20
20
20
20
10
20
20
20
10
10
10
40
20
20
20
40
30
30
30
* 10
10
10
10
10
10
10
10
10
20
10
20
40
30


10
10


10
10


20
20


30
20


10
20


10
10


20
20


40
20


10
10


10
10


10
20


10
10
10
10
10
10
10
10
20
20
10
30
20
20
30
20
20
20
10
20
20
10
10
10
40
20
20
tO
40
30
30
20
10
10
20
10
10
10
10
10
10
20
10
20
30
30


10
10


10
10


10
20


20
20


10
20


20
10


20
40


20
20


60
10


10
10


10
20


10
20
10
10
10
10
10
10
20
20
10
30
20
20
20
20
20
20
10
10
20
10
20
10
40
20
10
40
40
30
20
20
10
10
40
10
10
10
10
10
10
20
20
20
30
30


10
10


10
10


10
20


20
20


10
10


20
10


10
40


20
20


20
10


10
10


20
20


10
20


10
10


20
20


20
20


20
20


10
10


20
20


30
30


10
10


10
10


10
20


40
40
10
10

c
10
10


20
20


30
20


10
20


10
10


20
20


40
20


10
10


10
10


10
20


40
40
1 3
10


10
10


10
30


33
20


10
20


10
10


20
40


30
20


20
10


10
10


10
20


40
40
10
10


10
10


10
20


20
20


10
20


20
10


20
40


20
20


60
10


10
10


10
20


40
t>0
10
10


10
10


10
30


20
20


10
10


20
10


10
40


20
20


40
10


10
10


20
20


40
40
10
10


10
10


10
20


20
20


10
10


20
10


13
40


20
20


20
10


10
10


20
20


40
40

-------
                                                 TABLE 4-4 (continued)
TYPE 1.
lt>Jl<: 1C
16012 1C
1 14 1540002H 012 73040*:
16012 1C
114154CC02H0127304J3
16012 1C
114154CCC,tHoi273U404
10012 1C
114154CC02H012730405
Io012 .1C
1 14 154C002H 012 730406
Iu012 1C
1141540C02H012730407
10012 10
114154CCU2h01273040£
16012 1C
1141540C02H012730409
16012 1C
1141340C02H0127J041C
16012 1C
1141?4CCC2h(;i2730411
16012 1C
114154000^01273041*
Io012 1C
114154CC02M012730413
16012 1C
H41J4CC02H012730414
16012 1C
1 141 540COJ-HC127J041 5
16012 1C
ii41S40002HOl2730416
16012 1C
114154CC02rtOl27304l7
16012 1C
1141540002H01273041t
lu012 1C
1141540CC2H01273U41S
1601<: 1C
1141540C02H01273042C
16012 1C
1 14 154CCC2H 012 7304^:1
16J12 1C
114154CCC
-------
TABLE 4-4 (continued)
RECORD TYPE 5.
loOl^ L 73 J4 Ji'iSSV 399 c,«i 999999999999999999 99999 9999 999999 999999999999999999999999

1141
1141
1141
1141


1141
1141
1141
1141


1141
1141
1141
11 A 1
IS i

1141
1141
1141
U41


1141
1141
1141
1141


1141
1141
1141
1141


1141
1141
1141
1141


1141
114 I
idOio loCIO
130 9
180 9
180 9
20310
20310
22514
22512
£4CCii»t1t;ii7j04Ul ij6il tie. 11 1 ^t C =9999999999999999999999999999999999999999999
54J01PHJ11 73J4J112oliOkli.l4C 180
£4CCl!>ri01i73040i C611 Cl 1 1 ii! C 99
54CC15ri01173U4UJ.i26ilOlJ.112G 10
1601^ 2 73C402 22ii2 ^512
24&10 24810
S40Ci5hG117.iO<«02 06110211140 225
£400l>HOii7JJ4J^l26110211l4J 248
54CCii»HUil73U4G 8 293 8
3ii> 7 315 7
540Ci5HOii730403 C611U2U14G 293
5 400 15H Oil 730403 1261 102 11 140 315
*40C15h011730403 C611C111120 8
c t* r f\ i *iu n i i 7 ~4.i AM '4 1 5 /. i i /i i 11 i "y i \ ~j
Z ILUA Pn Uii/jUHUJI«COllUil,ll£U r
16012 2 730404 010 010
014 014
540C15HU11730404 C611021114C 0
e40C15HOii730*04l26U0211140 0
;4CC11>HU11730404 C6110111120 10
f 40 Ci Ml Cii 7^04041201 id 11.120 14
160i1201i01JLll20 16
1601/ 2 730*06 22516 22516
22512 22514
54CClbHOii73U406 C6110211140 225
i40Cii>HUil7304G6126ilC211140 225
54CCi5HOii7->0406 06110111120 16
£40C15H 01 1730406 12611 01 11 120 12
16012 2 7^U4U7 203 tt HU117304U7126llC111120 10
1601^ 2 73C4C8 4520 4518
4514 4514 .
540Cif>HGU73040£ C6liC211140 45
S4GC15HOil73C406i26110211140 45
180
99
10
22510
27012
225
248
12
10
293 8
33b 7
293
315
8
010
016
0
0
10
14
338 8
24818
0
270
8
16
22516
22518
225
225
16
14
203 6
2312
203
23
8
10
4518
4516
45
45
180 180
99 99
9 9
22510
27012
225 225
270 270
10 10
12 12
315 8
338 7
293 315
338 338
8 8
010
016
0 0
0 0
10 10
16 16
338 8
24818
338 338
248 248
8 8
18 18
22518
22518
225 225
225 225
16 18
18 18
203 5
2312
203 203
23 23
6 5
12 12
4518
4516
45 45
45 45
180
99
9
22510
27012
225
270
10
12
315 8
338 7
315
338
8
010
016
0
0
10
16
338 8
24820
338
248
8
20
22518
22518
225
225
18
18
203 5
2312
203
23
5
12
4516
4516
45
45
203 203
99 99
10 10
22510
27012
225 248
270 270
10 10
12 10
315 8
0 7
315 315
0 0
8 8
012
016
0 23
0 0
12 12
16 16
338 8
24820
338 338
248 225
8 6
20 18
22517
20316
225 225
203 203
17 17
16 14
183 5
4514
180 180
45 45
5 5
14 14
4516
4514
45 45
<»5 68
225
99
14
24810
27010
248
293
10
10
315 8
0 8
315
0
8
o
2312
016
23
0
12
16
338 6
22518
315
225
6
16
22517
20314
225
203
17
10
180 5
4514
180
45
2
18
4516
6812
45
68
225 225
99 99
12 12
24810
29310
248 225
293 293
8 8
8 8
315 8
0 8
315 315
0 0
8 8
81 n
1U
2312
016
23 23
0 0
12 12
14 12
315 6
22516
315 293
203 203
8 10
14 10
22517
20310
225 225
203 203
14 12
8 8
180 2
4518
45 45
45 45
5 5
20 20
4516
6812
68 68
68 68
225
99
12
248 8
293 8
225
293
7
8
315 8
0 8
315
C
7
i n
1U
2312
014
0
0
12
10
315 8
20314
293
225
14
14
22514
203 8
225
203
12
8
45 5
4520
45
45
8
20
6814
6818
68
68
22512
158
225
10
12
225 8
293 8
225
293
7
8
315 8
010
315
0
7
1 f\
1LJ
2312
012
0
0
12
10
29310
20310
270
225
14
14
22512
203 8
225
203
12
8
45 5
4520
45
45
10
20
6814
6818
68
68
22512



^.
225 7
293 8




315 7
010



012
010




29314
22514




22512
203 8




45 8
4520




6814
6818


15810
22512




225 7
293 8




315 7
010



012
010




27014
22514




22512
203 8




4510
4520




6814
6818



-------
 V.   MISCELLANEOUS OPERATIONAL INFORMATION

     A.  SYSTEMS AND CPU TIMES

         The PREPROCESSOR and the CONVERSION programs  were executed and de-
bugged on an IBM 360/65 machine.   Both programs require two tape drives for
 simultaneous processing of Input and output data.

         For the PREPROCESSOR, the IBM ASSEMBLER used, requires approximately
 100 K and 15 seconds to compile  the program.  The  program then will  sort
 1500 records and output them 1n  5 to 10 seconds while using less than 10 K
 of memory.

         For the CONVERSION program, the compiler requires 100 K and about
 15 seconds  of CPU time.  The compiled program will  run under 50 K bytes of
 core and process 1500 records 1n about 20 seconds.

     B.  PROGRAM MESSAGES

         No  diagnostic messages are written by the  PREPROCESSOR program.

         Specific problems that may be encountered  in  the normal execution
 of the CONVERSION program are signalled by the presence of program messages.
 These diagnostics are briefly discussed below.

         If the CONVERSION program cannot process a record, 1t writes a mes-
 sage identifying the problem followed by a printout of the input Illinois
 record.  The various diagnostics are:  (1) 'SITE NOT  LOCATED.1; (2) 'POLLU-
 TANT XX NOT CODED FOR.', which occurs only in record  type 3 and means that
 although the pollutant had a place reserved for it (because of the nature
 of record type 3), no corresponding information on method, units, and deci-
 mal place was coded; (3) 'POLLUTANT CODE XX NOT FOUND.', meaning that the
 pollutant code xx is not present in the list of pollutants and in subroutine
 PLUTNT; (4) 'METHOD CHANGE ERROR. POINTER EXCEEDS  NO. OF CHANGES.1, which
 means a method change was Incorrectly encoded.  After writing the problem
 record, the program reads a new  record and resumes processing.
                                    5-1

-------
VI.  REFERENCES
1.   Fair, D. H., Morgan, 6. B., and timer, C.  E., SAROAD System Descri p-
     ffpn and Data Coding Manual, U.S. Department of Health,  Education and
     Welfare, National Air Pollution Control Administration (Publication
     No. APTD 68-8), Cincinnati, Ohio (August 1968).

2.   Users Manual: SAROAD (Storage and^Retrieval  of Aerometric Data),  U.S.
     Environmental Protection Agency, Office of Air Programs  (Publication
     No. APTD-0663), Research Triangle Park, N.C. (July 1971).

3.   Personal Communications-, Illinois Environmental Protection Agency,
     Division of A1r Pollution Control, Springfield, Illinois (July 1973).

4.   Fair, D. H., Clements, J. B., and Morgan, G. B., SAROAD  Parameter
     Coding Manual, U.S. Environmental Protection Agency, Office of Air
     Programs (Publication No. APTD-0633), Research Triangle  Park, N.C.
     (July 1971).
                                   6-1

-------
                                         APPENDIX A
                            SOURCE LISTING OF PREPROCESSOR PROGRAM
STMT   SOURCE STATEMENT
 1 CONVERT
 2
 3 +
 4+
 5
 6
 7
 8
 9
10
11 +
12 +
13+
14 +
15+
16
17 BGIN
18 +
19+BGIN
20+
21 +
22 +
23 RECURSE
24+RECURSE
25 +
26+
27+
28
29
30
31
32
33
34
35 *
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55 *  FINI
     COMP
     PLUS
     *
     BLANK
     S150
                                  SAVE  REGISrgft'S
  START
  SAVE  (14,12)
  OS    OH
  STM   14,12,1?U3)
  BALK  5,0
  USING *,5
  ST 13,SAVE13
  LA 13,SAVEAREA
  LA 8,TAIL
  OPEN  (WDCB3,(OUTPUT))
        0,4 ALIGN LIST TO FJLLHORD
        l,*+8 LOAD REG1 W/LIST ADDR.
        ALIU43) OPTION BYTE
        AL3(WDCB3) OCR ADDRESS
        19 ISSUE OPEN SVC
              CNOP
              BAL
              DC
              DC
              SVC
              LA 4.WDCB3
              OPEN (RDCBJ
                    0,4 ALIGN  LIST  TO FJLLUQRO
                    l,*+8  LOAD REGl M/UST AODR.
                    AH (128 I OPTION BYTE
                    AL3(RDCB)  DCS  ADDRESS
                    19  ISSUE OPEN  SVC
                  ROCB,INPUT
                    1,RDCB LOAD PARAMETER REG 1
                    0,INPUT LOAD PARAMETER REG 0
                    15,48(0,1)  LOAD GET  ROUTINE ADD«
                                TO  GET ROUTINE
  CNOP
  BAL
  DC
  DC
  SVC
  GET
  LA
  LA
  L
  BALR  14,15 LINK
  CLC TAIL,REC=
  8NE RECURSE
  MVC   WHEAD,HEAD
  LA 6,HEAD+16
  LA 7.HHEAD+16
  CLI T4IL,X«F3'
  BE THREE
  RECORD TYPE IS  1,2, OR 5.
  CLI 0(R6),X«40«
  BE BLANK
  UNPK  0(6 ,R7),0(3,R6I
  01 5(R7),X«FO«
  MVN SIGN.2CR6)
  CLI SIGN,X'D«
  BNE PLUS
  MVI 0(R7),X'60'
  A R6.B3
  A R7,SIX
  B S150
  BYTE CONTAINS A BLANK.
  MVC 0(2,R7).NINES
  A R6.0NE
  A R7,TWO
  CR 6,8
  BL COMP
  MVC 0(17,R7).NINES
  MVC WTAIL,TAIL
SHED RECORD.  PUT IT  IN OJTPJT
                         F01FEB73    fl/23/73

                                   CNVT
                                   CNVT
                                                                               CNVT
                                                                               CNVT
                                                                               CNVT
                                                                               CNVT.
                                                                               CNVT
                                                                               CNVT
                                             CHANGF SIGN CDDE
                                             MOVE SIGN BITS
                                             CHECK FOR MINUS
                   TO F
  INSERT A
                                                            SIGN
                                                                  CNVT
                                                                  CNVT
                                             FILL ri ITH
BUFFER rflTH
                                                                PUT ROUTINF,
                                   CNVT
CNVT
CNVT
CNVT
CNVT
CNVT
CNVT
CNVT
CNVT
CNVT
CNVT
CNVT
CNVT
CNVT
CNVT
CNVT
CNVT
CNVT
CNVT
CNVT
CNVT
CNVT
CNVT
CNVT
CNVT
CNVT
CNVT
CNVT
CNVT
                                             A-l

-------
STMT   SOURCE STATEMENT
                                          F01FEB73   8/23/73
     THREE
     8LNK3
     T150
     *
     FIN
 56  FILL
 57
 58
 59
 60
 61  *
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77+
 78+
 79+
 80+
 81 +
 82
 83
 84
 85 +
 86+
 87+
 88+
 89+
 90
 91 +
 92 +
 93+
 94+
 95 +
 96
 97
 98
 99  C2
100
101
102 +
103 +
104+
105+
106+
107
108+
109+
110+
F9«
LR 1,4
LA 0,OUTPUT
L 15,48(0,1)
BALR 14,15
B RECURSE
RECORD TYPE«3.
CLI 0(R6),X«40«
BE BLNK3
MVC 0(1,R7),0(R6)
B T150
MVI 0(R7),X'
A R6,ONE
A R7,ONE
CR 6,3
BL THREE
MVI WTAIL
B FILL
END OF TAPE
CLI   REC=,X«F5'
BE    C5
CLOSE (RDCB,REREAD)
CNOP  0,4 ALIGN LIST TO FJLLWORD
BAL   l,*+8 LOAD REG1 W/LIST  ADDR
DC    ALK144) OPTION BYTE
DC    AL3CRCCB) DCB ADDRESS
SVC   20 ISSUE CLOSE SVC
CLI REC=,X«F3«
BNE C2
CLOSE (WOCB3,LEAVE)
CNOP  0,4 ALIGN LIST TO FULLWORD
BAL   l,*+8 LOAD REG1 W/LIST  ADDR
DC    ALK176) OPTION BYTE
DC    AL3(WDCB3) DCB ADDRESS
SVC   20 ISSUE CLOSE SVC
OPEN (WOCB2,(OUTPUT)I
CNOP  0,4 ALIGN LIST TO FJLLWORD
BAL   l,*+8 LOAD REG1 W/LIST  ADDR.
DC    ALK143I OPTION BYTE
DC    AL3(WDCB2) DCB ADDRESS
SVC   19 ISSUE OPEN SVC
LA 4,WOCB2
MVI REC=»X«F2«
B BGIN
CLI REC*,X«F2«
BNE Cl
CLOSE (WDCB2,LEAVE)
CNOP  0,4 ALIGN LIST TO FJLLWORD
BAL   l,*+8 LOAD REG! W/LIST  ADDR
DC    ALK176) OPTION BYTF
DC    AL3(WDCB2) DCB ADDRESS
SVC   20 ISSUE CLOSE SVC
OPEN (WDCB1,(OJTPUT))
CNOP  0,4 ALIGN LIST TO FJLLWORD
BAL   i,*+8 LOAD REG1 W/LIST  AO'DR.
DC    ALH143) OPTION BYTE
                                             INSERT  WDCB  ADDRESS IN Rl
                                             LOAD  OUTPUT  ADDRESS IN RO
                                             LOAD  PUT  PC1JTINE ADDRESS
                                             LINK  TO PUT  ROUTINE
MOVE NUMBER.

INSERT A NISE.
CNVT
CNVT
CNVT
CNVT
CNVT
CNVT
CNVT
CNVT.
CNVT
CNVT
CNVT
CNVT
CNVT
CNVT
CNVT
CNVT
CNVT
CNVT
CNVT
CNVT
CNVT
                                                                              CNVT
                                                                              CNVT
                                                                              CNVT
                                                                              CNVT
                                                                              CNVT
                                                                              CNVT
                                                                              CNVT
                                                                              CNVT
                                                                              CNVT
                                                                              CNVT
                                                                              CNVT
                                        A-2

-------
STMT   SOURCE  STATEMENT
F01FEB73   8/23/73
111+
112+
113
11*
115
116 Cl
117+
118+C1
119+
120+
121 +
122
123+
1 2*+
125+
126+
127+
128
129
130
131 C5
132 +
133+C5
134 +
135 +
136+
137 +
138+
139
140
141 +
142 +
143 +
144 INPUT
145 HEAD
146
147 TAIL
148 OUTPUT
149 WHEAO
150
151 WTAIL3
152
153 WTAIL
154 KEC=
155 SAVE13
156 SAVEAREA
157 ONE
158 TWO
159 83
160 SIX
161 NINES
162 SIGN
163 R6
164 R7
165 ROC8
DC AL3(WDC81) OCB ADDRESS
SVC 19 ISSUE OPEN SVC
LA 4,WDCBi
MVI REC-»X«F1«
B BGIN
CLOSE (WDCB1, LEAVE)
CNOP Ot4 ALIGN LIST TO FJLLWORO
BAL lt*+8 LOAD REG1 W/LIST ADDR
DC ALK176) OPTION 8YTE
DC AL3(WOC81) CCR ADDRESS
SVC 20 ISSUE CLOSE SVC
OPEN (HDCB5, (OUTPUT))
CNOP Ot4 ALIGN LIST TO FULLWflRD
BAL l,*+8 LOAD REG1 W/LIST ADDR.
DC ALU143) OPTION BYTE
DC AL3(WDCB5) OCB ADDRESS
SVC 19 ISSUE OPEN SVC
LA 4,WOCB5
MVI REC=,X'F5«
B BGIN
CLOSE (RDCB,,MDCB5)
CNOP 0,4 ALIGN LIST TO FJLLWORD
BAL 1,*+12 LOAD R?Gl W/LIST ADDR
DC ALKO) OPTION BYTE
DC AL3(RDCB) DCS ADDRESS
DC ALK128J OPTION BYTE
DC AL3(WOCB5) DCB ADDRESS
SVC 20 ISSUE CLOSE SVC
L 13.SAVE13
RETURN (14,12) ,,RC=0
LM 14,12,12(13) RESTORE THE REGISTFRS
LA 15,0(0,3) LOAD RETURN CODE
BR 14 RETURN
OS 00
OS ZL16
OS 133Z
OS Z
OS OD
OS ZL16
DS 133Z
OS Z
DS 149Z
DS Z
DC X«F3«
DS F '
DS 18F
DC XL4«1«
DC XL4«2»
DC XL4»3«
DC XL4»b»
DC 17X'F9«
DC X«0'
ECU 6
EQU 7
DCB DONAME = READ,MACRF=GM,DSORG=PS, EODAO
                                                                            CNVT
                                                                            CNVT
                                                                            CNVT
                                                                            CNVT
                                                                            CNVT
                                                                            CNVT
                                                                            CNVT
                                                                            CNVT
                                                                            CNVT
                                                       FIN
                                                                            CNVT
                                                                            CNVT
          CNVT
          CNVT
          CNVT
          CNVT
          CNVT
          CNVT
          CNVT
          CNVT
          CNVT
          CNVT
          CNVT
          CNVT
          CNVT
          CNVT
          CNVT
          CNVT
          CNVT
          CNVT
          CNVT
          CNVT
          CNVT
          CNVT
                                       A-3

-------
iTMT   SOURCE STATEMENT
                                                      F01FF.B73    8/23/73
 167**
 168**

 169*ROCB

 171**

 173*
 174*

 176**

 178*
 179*
 180*
 181*
 182*

 184**

 186*
 187*
 188*
 189*

 191**

 193*
 194*
 195*
 196*

 198**

 200*
 201*
 202*
 203*
 204*
 205*
 206*
 207*
 208*

 210**

 212*
 213*
 214*
 215*
 216*
 217*
 218*
 219 WDCB1
DC
DC
DC
DC
DC
DC
DC
DC
DC
DC
DC
DC
DC
DC
DC
DC
DC
DC
DC
OC
DC
OC
DC
OC
DC
OC
DC
DC
DC
OC
DC
DC
OCB
         DATA CONTROL  BLOCK


OF'O" ORIGIN ON K OR 0  BOUNDARY

         DIRECT ACCESS  DEVICE

BL16»0» FDAD»DVTBL
AtO) KEYLE,OEVT,TRBAL

         COMMON ACCESS  METHOD  TNTPPFACF
ALKO) BUFNO
AL3U) BUFCB
AL2(0) BUFL
BL2'0100000000000000«
A(l) IQbAO
                       OSORG
         FOUNDATION  EXTENSION

BLi'OOOODOOO' BFTEK, BFLNt HIAKCHY
AL3(FIN) EODAD
BL1« 00000000* RECFM
AL3(0) EXLST

         FOUNDATION  BLOCK

CLa'READ1 ODNAME
BLPOOOOOOIO1 OFLGS
BLl'OOOOOOOO* IFLG
BL2'OIOIOOJOOOOOOOOOI  MACR

         BSAM-BPAM-QSAM  INTERFACE

BL1' 00003000* RERl
AL3U) CHECK, GERR,  PFRR
A(l) SYNAD
H«0» CIND1, CIND2
AL2(0) BLKSIZE
F«0' WCPO, WCPL, OFFSR,  OFFSW
A(l) IOBA
ALKO) NCP
AL3(1) EOBR, EfJBAD

              OSAM INTERFACE

Ad) RECAD
H«0» OSWS
AL2(0) LRECL
BL11 00000000' EROPT
AL311I CNTRL
F«0« PRECL
A(l) EOB
DDNAME=WRITEl,MACRFaPMtDSORG=PStPECFM»Fflfl.ppCL=300
                                                          CNVT
                                        A-4

-------
STMT   SOURCE STATEMENT
                             DATA CONTROL  BLOCK
              DC    OF'O' ORIGIN ON WORD  BOUNDARY
                             DIRECT ACCESS  DEVICE  INTERFACE
                                                                   F01FEB73   8/23/73
221+*
222+*
223+WDC61
225+*

227+
228+

230+*

232 +
233+
234+
235 +
236+

238 + *

240+
241 +
242 +
243 +

245+*

247 +
248+
249+
250+

252 + *

254+
255+
256+
257+
258+
259 +
260+
261 +
262 +

264+*

266 +
267 +
268 +
269+
270+
271 +
272+
273 WDCB2
              DC    BL16«0» FDAD,DVT8L
              DC    A<0) KEYLE,DEVT,TRBAL

                             COMMON ACCESS  METHOD

              DC    ALKO) BUFNO
              DC    AL3(1) BUFCB
              DC    AL2(0) BUFL
              DC    BL2' 01 00000000000000' DSORG
              DC    A(i) ICBAD

                             FOUNDATION  EXTENSION
              DC    BLl'OOOOOOOO' BFTEK, BFl N, HI ARCHY
              DC    AL3(1) FODAO
              DC    BLl'10010000» RECFM
              DC    AL3(0) EXLST

                             FOUNDATION  BLOCK

              DC    CLS'WKITEi' DDNAME
              DC    BL1« 00000010* OFLGS
              DC    BLl'00003000' IFLG
              DC    BL2'OOJ030000iaiOOT3'  MACR

                             aSAM-BPAM-QSAM INTERFACE
              DC    BLl'OOOOOOOO' RER1
              DC    AL3(l) CHECK, GERR,  PERR
              DC    A(l) SYNAD
              DC    H'0« CIND1, CIND2
              DC    AL2(0) BLKSIZE
              DC    F'O' WCPO, WCPL, OFFSR,
              DC    A(l» IOBA
              DC    ALKD) NCP
              DC    AL3(1) E08R, E09AO
                                  USAM  INTERFACE
              DC    Ad) RECAD
              DC    H'O' QSWS
              DC    AL2(300) LRECL
              DC    BLl'OOOOOOOO' EROPT
              DC    AL3U) CNTRL
              DC    F'O' PRECL
              DC    Ad) EQB
              DCS   ODNAME=WRITE2»MACRF=
PM,OSORG=PS, RECFM*FB,LRECL=300
CNVT
                                        A-5

-------
iTMT   SOURCE STATEMENT

                             DATA CONTROL  BLOCK

              DC    OF*0* ORIGIN ON  WORD  BOUNDARY

 279**                       DIRECT  ACCESS DEVICE INTERFACE
                                                                   FOIFE873    8/23/73
275**
276**
277*WPCB2
 281*
 282*

 284**

 286*
 287*
 288*
 289*
 290*

 292**

 294*
 295*
 296*
 297*

 299**

 3C1*
 302*
 303*
 304*

 306**

 3C8*
 309*
 310*
 311*
 312*
 313*
 314*
 315*
 316*

 318**

 320*
 321*
 322*
 323*
 324*
 325*
 326*
 327 WOC63
             DC
             DC
             DC
             DC
             DC
             DC
             DC
             DC
             DC
             DC
             DC
             DC
             DC
             DC
             DC
             DC
             DC
             DC
             DC
             DC
             DC
             DC
             DC
             DC
             DC
             DC
             DC
             DC
             DC
             DC
             DC
             DCB
8L16'0' FOAD.OVTBL
A(0) KEYLE.DEVT,TR8AL
                            COMMON  ACCESS  METHOD
ALKO) BUFNO
AL311) BUFCB
AL2IO) BUFL
BL2'0100000000000000'
All) IOBAD
        DSORG
                            FOUNDATION  EXTENSION
8L1»00000000'
AL3(1) EODAD
BL1«10010000'
       PXLST
BFTEKtBFLN.HIARCHY

RECFM
         FOUNDATION BLOCK

CL8'WRITE2' ODNAME
BLl'00000010' OFLGS
BLl'OOOOOOOO' IFLG
BL2*0000000001010000' MACR

         BSAM-BPAM-QSAM  INTERFACE

BL1'30333330' RER1
AL3U) CHECK, GEKfl, PEKR
A(l) SYNAD
H'O' CINDl, CIND2
AL2(0) BLKSIZE
F'O' WCPO, WCPL, OFFSRf  OFFSrf
A(l) IOBA
ALKOI NCP
AL3(1) EOBRi F.OBAD
              OS AM INTERFACE

AUJ RECAD
H*0* QSWS
AL2(300) LRECL
BL1«00000000' EROPT
AL3(1) CNTRL
F'O' PRECL
Allli ECB
DDNAMF=WRITE3,MACRF= PM,DSORG"
               PS,RECPM-FB,LPECL*150
CNVT
                                        A-6

-------
STMT   SOURCE STATEMENT

                              DATA  C'JNTROt BLOCK

              DC    OF«0« ORIGIN UN WORD BOUNDARY

 333+*                        DIRECT ACCESS DEVICE INTERFACE
                                                                   F01FEB73    8/23/73
329+*
330+*
331+WDCB3
 335+
 336+

 338+*

 340+
 342 +
 343 +
 344 +

 346+*

 348 +
 349+
 350+
 351 +

 353+*

 355 +
 356+
 357+
 358+

 360+*

 362 +
 363+
 364 +
 365 +
 366+
 367 +
 368 +
 369+
 370+

 372+*

 374 +
 375 +
 376+
 377+
 378+
 379+
 380+
 381 WOCB5
             DC
             DC
             DC
             DC
             DC
             DC
             DC
             DC
             DC
             DC
             DC
             DC
             DC
             DC
             DC
             DC
             DC
             DC
             DC
             DC
             DC
             DC
             DC
             DC
             DC
             DC
             DC
             DC
             DC
             DC
             DC
             DCB
BL16*0» FDADtDVTBL
A<0) KEYLEtDEVT,TRBAL
                             COMMON  ACCESS METHOD INTERFACE.
ALi(O) BUFNO
AL3(U BUFC8
AL2(0) BUFL
BL2'0100000000000000*
Ad) I OB AD
                       DSORG
         FOUNDATION  EXTENSION

BLl'OOOOOOOO1 BFTEK, BF|_N,HIARCHY
AL3U) EODAD
BLl'100100001 RECFM
AL3(0) EXLST

         FOUNDATION  BLOCK

CL8»WRITE3» DDNAME
BLPOOOOOOIO1 OFLGS
bLl'00000000' IFLG
BL2«0000000001010000«  MACP.

         3SAM-BPAM-QSAM  INTERFACE
BLl'OOOOOOJO' RER1
AL3(1) CHECK, GERR,  PERR
Ad) SYNAD
H»0« CIND1, CIND2
AL2<0) BLKSIZP  .
F'O' rfCPO, rtCPL, DFFSR, OFFSW
Ad.) IQBA
ALKO) NCP
AL3(1) EOBR, EOBAD

              OS AM  INTERFACE

Ad) RECAD
H*0« QSWS
AL2(150) LRECL
BLl'OOOOOOOO* 6ROPT
AL3d) CNTkL
F*0« PRECL
Ad) EOB
ODNAME*WRITE5,MACRF«PM,DSORG=PSf
                                                          CNVT
                                         A-7

-------
STMT   SOURCE STATEMENT

                             DATA  CONTROL  BLOCK

                    Of«0« ORIGIN ON  WORD  BOUNDARY
                                                                   F01FE873    8/23/73
383**
384**
385*WDCB5

387**

389*
390*

392**

394*
395*
396*
397*
398+

400**

402*
4C3*
404*
405*

407**

409*
410*
411*
412*

414**

416*
417*
418*
419*
420*
421*
422*
423*
424*

426**

428*
429*
430*
431*
432*
433*
434*
435
DC
              DC
              DC
              DC
              DC
              DC
              DC
              DC
              DC
              DC
              DC
              DC
              DC
              DC
              DC
              DC
              DC
              DC
              DC
              DC
              DC
              DC
              DC
              DC
              DC
              DC
              DC
              DC
              DC
              DC'
              DC
              DC
              END
                              DIRECT  ACCESS  DEVICE INTERFACE
      BL16«0I FDAO.DVTBL
      A(0) KEYLEtDEVT,TRBAL
                             COMMON  ACCESS  METHOD INTERFACE
      ALliO) BUFNO
      AL3(lt BUFCB
      AL2(0) BJFL
      BL2«0100000')00300033'
      A(l)  IOBAD
DSnRG
               FOUNDATION  EXTENSION

      tJLl* 00003000' BFTEKiBFLNtHIARCHY
      AL3I1) EODAD
      BL1*10010000' RECFM
      AL3(0) EXLST

               FOUNDATION  BLOCK

      CL8'WRITE5« ODNAMF
      BLl'OOOOOOU' OFLGS
      BLl'OOOOOOOO1 IFLG
      BL2«0000000001010000'  MACR

               BSAM-BPAM-USAM  INTERFACE

      BLl'OOOOOOOO1 RER1
      AL3<1» CHECK, GEHR,  PERR
      A(U SYNAD
      H*0« CINDl, CIND2
      AL2(0) BLKSIZE
      F«0« WCPO, rtCPL, OFFSRt  OFFSW
      A(l) I DBA
      ALl(O) NCP .
      AL3(1) EOBR, EOBAO

                    QSAM  INTERFACE

      Ad) RECAD
      H»0« QSWS
      AL2(300) LRECL       .        .
      BLl'OOOOOOOO1 EROPT
      AL3(1» CNTRL
      F«0« PRECL
      A(i) E08
    CONVERT
                                    CMVT
                                       A-8

-------
                                        APPENDIX  B

                            SOURCE LISTING OF CONVERSION PROGRAM
 LEVEL  21                   MAIN     j          DATE « 73242          18/09/15
 C	ILGE3*  ILLINOIS GEOGRAPHIC CODE. _  _     •	MAIM
"C      ILPLUT= ILLINOI S PHLLGUTANT Cf)DE.    r                        	    MAIM
 c	ILSITE= ILLINOIS SITE  cong.                                          M«TM
~C"5TArJ
 C     b<
       CJMMON/lfJ/ INPuTfnuT,OIAG, OPTION                                     MA T\|
_ C3MMQN/HEAU/ ILG^Otl LPLUT , I LSI TF ,ST ARS I t AGPPOJ , INT , DAT gy           MATM
      I         STKTHK,PPAM",MPTH,UNIT ,bPLnc,SINn,PPMIND, ERR                  A'TM
                  _
       UP TION=i                                                               MA TM
       CALL  REC3                                                             Mfl T\J
       CALL_ (
-------
1 LEVEL
i
! c



c
c
c
c





5
10
20
21
22
23

24
28



29






21 REC3 DATE • 73242
SUBROUTINE REC3 . . '
24 HOUR SAMPLE.
IMPLICIT INTEGER; CA-Z) i
L3GICAL ERR
COMMON/10/ I NPUT, OUT ,DIAG, OPTION
COMMON/HEAD/ I LGEO, I LPLUT, I LSI TE , STARS 1 1 AGPROJ t INT , DAT E»
I STRTHR»PPAM,METH,UNIT|DPLOC,SIND,PRMIND,ERR
DIMENSION LPRMC4) ,LMETH(4)j,LUNIT<4),LDP<4) ,VAL(*I
DIMENSION OATA(fi) ,PLINO(8)
DATA NITEMS/8/
NITEMS MUST. AGREE WITH DIMENSION OF POLUT, DATA, PL INO
DATA. PLIN3/ 1 ,0 ,3,2 ,4*0/
PLIND GIVES THE .INDEX OF THE POLLUTANT IN THE LIST IN
THE MUO SUBROUTINE. ,
P3LLUTANTS IN ORDER ARE PART,H2S »COH,S02,ORG,PH, PB, F
IMT«7 1
ILPLUT=0 !
ASSIGN 23 TO N01
ASSIGN 39 TO N02 ;
ASSIGN 10 TO N03
IF(OPTION.EQ.O) GO TO 10
ASSIGN 21 TO N01
ASSIGN 35 TO NQ2 !
ASSIGN 45 TO NG3
M*1TE(D!AG,5)
FORMAT(» RECORD TYPE 3.»)
CDNTINUE . :
READUNPUT,20,END=50) I LGEO, I LSI TE , DAT E, OAT A
FDRMAT(I6,2X,I2,I6,33I4)
G3 TO NG1,(21,23)
CDNTINUE
W*ITE(C)IAG,22) I L3E 0,1 LSI TE ,DAT-E ,DATA
FDRMAT(10X,I6,I5,<)I10)
CDNTINUE
CALL HEADER
IF (. NOT. ERR) GO TP 28
WUTE(DIAG,24) I LGE 0,1 LPLUT, USI T? , OAT F, OAT A
F3RMATC 3« ,110,215 ,110, 10X,8IIO/(5X, 12110) )
GD TO 10
CDNTINUE
J=0
03 40 1=1, NI TEMS
IF«DATA(I).EQ.99g9) GD TO 40
J=J+1
PSMIND=PLIND(I)
IF (PRMIND.GT.O) GO TO 31
ttt ITE(DIAG,29) I
FDRHATC* POLLUTANT* ,13,* NOT CODED FOR.*)


i

_ . -
B-2
i
t*9w ' ^9 rI5 •/' '~*.i-
L "' REC3' '
RECS
11 llcl
• wl-
'EC3
REC3
: Ull
i ," , . ,.,
>FC3
»FC3
! JFC? !
JF"
Jcca
: .;^3
"el
'FC3 .
"FC3
2e"
' CC3
^cr3
"c3
'^C3
llcl
1 1 5I?"
i 'EC3
; "»FC3


,




-------
'.'''• ' : ".' ' ' 1
LEVEL 21 REC3 DATE « 73242
GD T3 10
31 CONTINUE
CALL HUD '•
18/09/15
*£C3
R5C3
IF (ERR) GO TO 10 *EC3
VAL(JJ«OATA(I) »F.C3
LPRM(J)*PRAM
LKETHtI9tA3tIitI6fl2t4(!5.f2I2tIlt I4M
REC3
»FC3
REC3
RFC3
RFC 3
GD TO N02,C35,39J < **C3
35 CDNTINUE ^CC3
W* ITE(DIASt37) STARSI ,AGPROJflNT,OATEtSTftTHR,(LPRM(J), P?T3
1 LMETH(J) ,LUNIT(J) ,LOP(J) ,VAL(J),J»1,4) »PC3
37 FDRMAT(5X,«2«,I9,A3,I1 ,16,12,4(15,212,11,14)1
39 CDNTINUE
J=0
40 CDNTINUE
IF(J.GT.O) rtRITE (DUT,33) STARSI , AGPROJ, INT , DAT E,ST RTHR,
1 (LPRM(I) ,LMEH(I ) , LUNIT(I) ,LDP( I) , * ALC I) , 1= 1, J J
GD TO N03,(10,45)
45 CDNTINUE
IFU.GT.O) WRI TE (DIAG,37) STARSI ,AGPROJ , INT , DATE, STRTHR,
1 (LPKM(I ) ,LMETH(I)f LUNIT(I) ,LDP( I ) ,«/ AL( I), 1 = 1, J I
GD TO 10
50 CDNTINUE
EXO FILE OUT
RETURN
»FC3
Mil
"^3
"FC3
5EC3.
'FC3
?FC3
PFC3
REC3
EMD
                                    B-3  -

-------
LEVEL
21
REC2
DAT€
•
73242
' 'IB/109/15
       SUBROUTINE REC2	•    	         REC2
       HOURLY DATA.                                       'RFC2
       IMPLICIT INTEGER (A-Z)	        REC2
       LOGICAL ERR                                               '•  "
       C3MMON/IO/ INPUTtOUT,D!A6,OPTION    	'  ' '>;...	
       COMMON/HEAD/ ILGEO,1LPLUT,I LSITE,STARS I»AGPROJ,INT tOAT E,  "       REC2
      1        STRTHR ,PRAM,METH,UNIT,DPLOCtSINDfPRMlND, ERR	
       DI MEN SUN DATA(24)        •
       DATA HOUR12/12/                                                     RF.C2
       ASSIGN 10 TO N02
       IFUPTION.EQ.O) GO TO 1 0
       ASSIGN 35 TO N02
5
10
20
C

24
28
M*ITE (DIAGtS)
FORMAT( '1RECORD TYPE 2.M
CONTINUE
READ (INPUT, 20, ENO-40) I LGE 0,1 LPLUT , I LS ITE, DATE, DAT A
F3RMAT(I6,2I2,I6,47(2X,I4))
CALL HEADER.
GET SAROAO CODE FOR POLLOUTANT.
CALL PLUTNT
IF (.NOT.ERRj GO TO 28
miTE
-------
LEVEL  21                 REC1              DATF. » 73242         18/09/15
1
j.c .





5
10
C
20
C

24
28
30
35
30

37
40

SUBROUTINE REC1
2 HOUR SAMPLES.
IMPLICIT INTEGER (A-2)
LOGICAL ERR
COMMON/10/ INPUT, OUT ,01 AG, OPTION
C3MrtON/HEAD/ I LGFO ,1 LPLUT, I LSI TE , STARS I , AGP«OJ , INT, DAT E,
1 STRTHR,PRAM,METH,UNmDPLOC,SINn,PR"1IND, ERR
DIMENSION DATAU2)
ASSIGN 10 TO N02
IF(OPTION.EU.O) GO TO 10
ASSIGN 35 TO N02
rt*ITE (&IAG,5)
F3RMAT( «1RECORO TYPE I.1)
C3NTINUE
RfcADl INPUT, 20, tND»40) I LGE 0,1 LPLUT , I LS I TE, DATE, DAT A
PICK UP THE EVEN VALUES OF DATA.
F3ftMATU6,2t2,l6,23(6x,I4M
CALL HEADER
GET SAR3AD CODE POR POLLUTANT.
CALL PLUTNT
IF (.NOT.EKR) GO TO 28
**ITEOIAG,24) I LSE 0, 1 LPLUT, I LSI TE, DATE, DAT A
F3RMATC l« ,110, 215, 110, 10X ,8 I10/(5X, 121101 )
G3 TO 10
CDNTINUc
m ITE(3UJ,30) STARSI ,AGPROJ ,1 NT, DATE ,ST RTHR, PRAM, M ETH,
1 UNI T,DPLCC , DATA
F3RMAT( «1( ,19, A3, 11 ,16,12,15,212,11,1214)
G3 TO NG2,(10,35)
C3NT1NUE
W^ ITE(JIAG,36) IL3P.O, I LPLUT, ILSlTE»DATE"t DATA
F3RMAT(1 OX, I 10,215,1317)
WR ITE(OIAG,37) STARST , AGPROJ,! NT ,OATE,ST RTH«, PRAM, METH,
1 UNI T,DPLOC ,DATA
FJKMAT(5X,«1« fI9.t A 3,11 ,16 , 1 2 ,15 ,2 12 , 11 ,1214 1
G3 TO 10
C3NTINUE
END FILE GUT
RE TURN
E>JD
REC1
«Ef 1
RPC1
3"l
"pr}
'PCI
9 PC I
REC1
RPC1
* EC 1
JFCI
»EC1
'PCI
RFCl
»PCl
Jpri
OPC1
9PC1
?pr{
"Ft. i
'PCI
"PCI
'PCI
'PC!
'PCI
                                      B-5

-------
 LEVEL   21	REC5	   DATE • 73242	18/09/15

       SUBROUTINE  REC5	»EC5'
"C"METEOROLOGICAL DATA.                                                REC5
       IMPLICIT INTEGER (A-ZI                                             RCC5 "
       LOGICAL ERR
       COMMON/10/ INPUT,DUT,DIAG,OPTION	HF.C5
       C3MMON/HEAD/ ILGEO,! LPLUT, I LSI TE ,STARS I, AGPROJ f INT ,"OAT Et
      1        STRTHR,PRAM,METH,UNIT,DPLCC,SINO,l»RMINDf ERR
       DIMENSION DIR(24) ,SPEED(24)
       DATA  HOUR12/12/                                                    RFC5
INT=1 R«=C5
ILPLUT=0 R*C5
ASSIGN 80 TO NQ1 RFC5
ASSIGN 10 TO N02 "»FC5
IF (OPTION. EQ.O) GO TO 10
ASSIGN bO TO N01
PEC 5
       ASSIGN 90 TO N02
         ITE(DIAG,5)                                                      RFC5
5
10
FDRMAT( •
CDNTINUE
1RECORD
TYPE
5.
•)
»FC5
RFC5
       READ(lNPUT,2C,ENn = 100) I LGEO,I LSTTE,DAT F, ( 01 R( I) ,S PEEO( I), I»l, 24)  RFC 5
 20     FDRMAT(I6,2X,I2,I6,24( 14 ,1 2J )
       CALL  HEADER
       IF(.NOT.ERR)  GO TO 28
24
28
C
,

30

40

50
6J

70
80
»rt ITE(DIAG,24) I L3F 0, 1 LPLUT , I LSI TF ,DAT F, (OIR( 1), SPEED! I), 1 = 1, 24)
FDRMAT( • 5« ,110,215 ,110, 10X,1 61 5/(5X, 24 15))
GO TO 10
CDNTINUE
WIND DIRECTION.
P*MIND=5
CALL MUD
DD 30 1=1,24
IF (OIR( I ).Eil.999) DIP(I)=0,
IF (DIRU J.E0.5DD) DIP(T).=9999
CDNTINUE
*\ ITE(OUT,40) STAPSI , AGPROJ , I NT, OATF, STRTHR, PRAM, M ETH,
1 UNIT,DPLOC ,(DIR(I) ,1=1,12) , STARS I , AGPROJ, INT, DAT E, HO JR 12,
2 PRAM,METH,UNIT,DPLOC, (DI P( I) , I* 13, 24)
C"JDMAT/(t|< Jo A^ T1 TA T7 15 212 11 12T4))
GO TO NO 1,1 5 0,80)
CDNTINUE
«\ ITE(OIAti,60) ILSECM LSI TE .DATE , (DI R( I),SPEFD{ I ), 1=1, 241
FDKMAT(10X,I6,2X,I2,TS,12(I4,I2)/28X,12(I4, 12) )
«(RITE(DIAG,70) STAR SI , AGPROJ, I NT , OAT E, STRTHR, PRAM, METH,
1 ONI T, DP LOG ,(DIR( I) ,1 = 1,12) ,STAR<; I , AGPROJ, INT, DATE, HOUR 12,
2 PRAM,METH,UNIT,DPLOC,(DI«( I), I = 13, 24)
CDNTINUE
RFC 5
9FC5
»FC5
RFC 5
RFC5
llcl
PEC 5
RFC5
5cC5
»FC5
RFC5
p p** c
"FC5
PFC5
RFC 5
RPC5
RFC5
RFC5
RFC5
R«=C5
       PROCESS SPEED. PARAMETERS.                                          RFC5
                                        B-6

-------
i  LEVEL   21                 REC5               DATE*  73242          18/09/15
        PR MI NO «4	' .  .  '	        RFC 5
        CALL  MUD                                                           QFC5
        •ft ITE(OUT,40) STARSI ,AGPROJ ,1 NT, DATE,STRTHR, PRAM, METH, UNIT,        RFC5
1 DPLOC,(
2 PRAM, ME
SPEEDd ) ,I«1 ,12) , STARSI
TH,UNIT,DPLOC,(SPEEDU)
, AGPROJ, INT, DATE, HOUR 12,
,1*13,24)
GO TO N02,(10,90)
90 CDNTINUE
« ITE(DIAG,7U)
1 OPLOC,(
2 PRAM, ME
GD TO 10
STARSI ,AGPRDJ,I NT, DATE,
SPFEDd ),! = !, 12) , STARSI
TH,UNIT,DPLOC,(SPEED(I)
STRTHR, PRAM, METH, UN IT,
, AGPROJ, INT, DAT E, HOUR 12,
,1=13,24)
RFC5
»FC5
RFC5
REC5
RFC 5
'lees
  100    CDNTINUE                                                            RFC 5
        END FILE  OUT
        RE TURN                                                             RFC5
        END
                                         B-7

-------
» LEVEL 2
1 . HEADER DATE
» 73242 18/09/15
SUBROUTINE HEADER
IMPLICIT INTEGER (A-Z)
LOGICAL ERR


COMMON/10/ INPUT, nUT,DIAG, OPTION
C3MMON/HEAD/ I LGFfl ,1 LPLUT, I LSI TF .STARS I , AGPROJ , INT , DAT E,
1
01
C LI
E8
STRTHR,PRAM,METH,UNIT,DPLOC,SIND,PRMIND, ERR
MENSION LCTABL (2, 163) ,AGNPRJ( 163) ,L1 (2,5*) ,L2( 2, 54), L3( 2, 2)
, L2, L3 ARE DUMMY ARRAYS USED TO INITIALIZE LCTABL.
UI VALENCE 
-------
r  LEVEL   21
                      HEADER
                                        DATE * 73242
                                     18/09/15
        04TA L2/09904550,143760005, 09032331,142133302*09302333,142100003,HFQ?
       L09006001,146060002, 01001001,141143001,  05702001,140480001*HFOT
       i   00106502,146440002, 09002003,142100003,  00106503,146440001*    HFD*
    ^ M* ^ r «* ^ ^ w TT ^ ^ w v * ~ •/ • W W\* W^ T  V ' W »*•»»• T » • to » w «* ^ w^ T * »» w •• v ^ «» T • ^» fc • «» *r
I   09006001,146060002,  01001001,141143001, 05702001,140480001*
2   00106502,146440002,  09002003,142100003, 00106503,146440003*
3   05801501,141740004,  05801503,141740003, 358*01534, 141740002*
4   06502001,146170001,  08412050,147280003, 01403001*140880001,
5   06001002,140160004,  06002501,14218*0002,'0600400 1,142960006*.
6   06004003,142960005,  06004005,142963007, 36004336,142960008,
 T   060040U7,14^960009,
 8   06004010,14	,_
~9   06042801,141500002,
 1   08204501,142120002,
 2   064.01506,145060004,
 3   01604501,141240001,
06004008
06001501
06700501
08204550
06011561
                                        ,142960010,
                                        ,147763002,
                                        *UT*>Z900£*
                                        ,142120009,
                                        ,148521)007*7
                               00603004,140583    ,
                                                      142960011,
                                                      148520007,
36004009,
36311503,
38231031,
03901501,
06011503,
30603005,140683
                                                       140320001,
                                                       140840001,
                                                       148520007,
HEP*

HF.D*
       
  20    F3RMAT(( SI T£ NOT LOCATED.*)
           = .TKUE.
        Rb
  30    CONTINUE
        !iTARSI=LCTABL(2,SIND>
        AGPROJ=AGNPRJ(SIND)
           =. FALSE.
        RtTURN
        END
                                                                     HFn?
                                          B-d

-------
G LEVEL  21
PLUTNT
DATE » 73242
18/09/15
        SUBROUTINE PLCTNT
                                               PLUT
c
c



c
c
c
c
c
c
c
c
c



c
10
20

30
C

c
4J
C


PLUTNT FINOS THE SAROAD COOP FOR A GIVEN ILPLUT. THEN IN THE
MUD SECTION, IT DETERMINES THE METHOD, UNITS, AND DECIMAL PLACE.
IMPLICIT INTEGER (A-Z)
LOGICAL ERR
COMMON/10/ INPUT,OUT,DIAG, OPTION
CDMMON /HEAD/ I LGEO ,1 LPLUT, I LSI TE , STARS I , AGPROJ , INT , DAT E,
i STRTHR, PRAM, METH ,UNIT ,DPLCC,S I NO, PRMIND, ERR
DIMENSION M( 163, 7) ,U(163 ,7) ,0(163,7) , PLTABL (2, 7)
M •» METHOD, U = UNITS, D * DECIMAL PLACE.
1ST DIMENSION OF M,U, AND D MUST = NO. OF SITES. 2ND DIMENSION
= NO. OF POLLUTANTS.
POLLUTANT ORDER IS PART, S02 ,COH ,WS ,WD, CARBON MONOXIDE, AND TOX .
DIMENSION CHNGES (5, 1)
CHNGES IS AN ARRAY FOR SITES WHICH CHANGE FHFIR dAYS. 2ND
DIMENSION = NO. OP CHANGES 1ST DIMENSION CONTAINS METHOD, UNITS,
DP, DATE, AND A POINTER TO THP NEXT CHANGE FOR THAT SITE AND
POLLUTANT CODE IP THERE IS ONE.
DATA NPOLS, NCHNGS/ 7,0/
NPOLS MUST = DIMENSION OF PLTABL. NCHNGS = DIMENSION DP CHNGES.
DATA M/163*9i, 4*11,91,2*13,12*91,3*13,8*91,3*11,48*91,16*11,
i 5*91,4*13,41*11,4*13,2*11,4*13,6*11,
2 163*81, 489*11 ,163*14/
DATA U/ 163*1, 163*7, 163*9, 163*12, 163*1*, 163*7, 163*7/
DATA D/ 163*0, 163*3, 163*2, 163*0, 1S3*0, 163*2, 163*3/
DATA PLTABL/ 42,11101, 32,42401, 10,11201, 81,61101,
1 82,61102, 50,42101, 53,44101/
FIND SAROAD CUD1: FOR ILPLUT.
D3 10 PRMIND=1,NPOLS
IFULPLUT.EU.PLTABLd ,PRMIND») GO TO 30
CDNTINUE
W* ITE(DIAG,20) ILPLUT
FDRMAT(« POLLUTANT COOE',I3,« NOT FOUND.' »
RETURN
CDNTINUE
IF(bRK) RETURN
NO* COMr S THE DIRTY WORK.
ENTRY MUD'
METH=M( SIND, PRMIND)
CHECK FOR METHOD CHANSF.
IF(METH.GT.O) GO TO 80
PT=-METH
CDNTINUE
IF (DATE.LT.CHNGES(4,PT) ) 50 TQ 70
METHOD HAS CHANGED AGAIN.
PT=€HNGES(5,PT)

PLUT
PLUT ' i
PLUT
PLUT
PLUT
«>l UT
PLUT !
PLUT
PLUT
PLUT
PLUT
PLUT
PLUT
Pt UT
PLUT i
PLUT '
[PLUT ;
PI UT
°LUT j
PLUT ;
PLUT
PLUT
PLUT
P| UT
PLUT
PLUt
PLUT
|PLU'T
iPLUT
PL UT
PLUT
PLUT
PLUT
of UT
PLUT
PLUT
PLUT
PTTJT
PLUT
PL UT
PLUT
PLUT
PLUT
PLUT
PLUT
PLUT

                                        B-10

-------
,G LEVEL   21
PLUTNT
DATE » 73242
18/09/15
         IF(PT.LT.NCHNGS)  30 TO 40
                                              PLUT
W* ITE (OIAGtSO)
50 F3RMAT(« METHOD CHANGF ERROP. POINTER EXCEEOS NO. OF CHANGES,')
E
-------
                                APPENDIX C
                             JCL REQUIREMENTS
      The following JCL statements applied when programs PREPROCESSOR and
CONVERSION were compiled and executed for the test sample case.   Since JCL
1s strongly dependent on both machine and facility, all  necessary changes
should be exercised where appropriate by consultation with the systems
people at any new facility.

C-l.  ASSEMBLE-AND-GO FOR THE PREPROCESSOR PROGRAM

      JCL statements used 1n the test case are given below:

      //          Job Card
      // EXEC ASMFC6
      //ASM.SYSIN DD *
        [Source Deck]
      //G0.READ DD DSN=ILLIN0IS,UNIT=2400,
      //   V0L=SER=PH4875
      //G0.WRITE1 DD DSN=ILLF3,UNIT=2400,
      //   V0L=SER=PH3022,LABEL=(3,SL),
      //   DCB=(BLKSIZE=3000,DEN=2)
      //G0.WRITE2 DD DSN=ILLF2,UNIT=2400,
      //   V0L=REF=*.WRITE1,LABEL=(2,SL),
      //   DCB=(BLKSIZE=3000,DEN=2)
      //G0.WRITES DD DSN=ILLF1,UNIT=2400,
      //   V0L=*EF**.WRITE1,LABEL" (l.SL),
      //   DCB=(BLKSIZE=3000,DEN=2)
      //G0.WRITE4 DD DSN=ILLF4,UNIT=2400,
      //   V0L=REF=*.WRITE1,LABEL=(4,SL),
      //   DCB=(BLKSIZE=3000,DEN=2)
      /*
                                   C-l

-------
C-2.  COMPILE-AND-GO FOR THE CONVERSION PROGRAM

      The following JCL statements are used:

      //          Job Card
      // EXEC F0RTGCG
      //F0RT.SYSIN DD *
        [Source Deck]
      //G0.FT10F001 DD DSN=ILLF1,UNIT=2400,
      //   V0L=SER=PH3022
      //G0.FT10F002 DD DSN=ILLF2,UNIT=2400,
      //   V0L=REF=*.FT10F001,LABEL=(2,SL)
      //G0.FT10F003 DD DSN=ILLF3,UNIT*2400,
      //   V0L=REF=*.FT10F001,LABEL=(3,SL)
      //G0.FT10F004 DD DSN=ILLF4,UNIT=2400,
      //   V0L=REF=*.FT10F001,LABEL=(4,SL)
      //GJ5.FT20F001 DD UNIT=2400,V0L=SER=PH1618,
      //   LABEL=(1 ,NL),DCB=(LRECL=80,DEN=2,BLKSIZE=3200)
      //G0.FT20F002 DD UNIT=2400,V0L=REF=*.FT20F001,
      //   LABEL=(2,NL),DCB=(LRECL=80,DEN=2,BLKSIZE=3200)
      //G0.FT20F003 DD UNIT=2400,V0L=REF=*.FT20F001,
      //   LABEL=(3,NL),DCB=(LRECL=80,DEN=2,BLKSIZE=3200)
      //G0.FT20F004 DD UNIT=2400,V0L=REF=*.FT20F001,
      //   LABEL=(4,NL),DCB=(LRECL=80,DEN=2,BLKSIZE=3200)
      /*
      The program reads the preprocessed tape on unit 10, hence FT10FOOX.
Unit 20 describes the output tape files, hence FT20FOOX.  It is imperative
that consistency in the JCL between the CONVERSION'S FT10FOOX and the PRE-
PROCESSOR'S WRITEX be maintained, since they refer to one and the same set
of files.
                                   C-2

-------
                                APPENDIX D
                   PROGRAM ADDITIONS AND MODIFICATIONS
      In keeping with the need to have the program flexible enough to ac-
commodate minor revisions 1n format and/or additional  data Items, this ap-
pendix describes the changes necessary to effect some  of the anticipated
revisions.  The changes include site addition, pollutant addition, coding
a new pollutant in record type No. 3, and coding a change in method data.

      Generally, only three subroutines in CONVERSION  are affected.  These
are REC3, HEADER and PLUTNT.  The PREPROCESSOR 1s not  affected.

D-l.  SITE ADDITIONS

      There are two arrays in subroutine HEADER that need to be expanded.
The first is LCTABL which is a 2XNSITES array where NSITES is the total
number of sites.  It contains the Illinois geographic  and site codes for
all of the sites and the corresponding SAROAD codes for state, area, and
site.  These values are paired as follows:

      1st value = 100* (Illinois geographic code) + Illinois site
                  code
      2nd value = the corresponding nine digit SAROAD  code for
                  state, area, and site.

      To add sites, change the dimensions of LCTABL so that the second di-
mension agrees with the new number of sites.  In addition, the dimension of
a dummy variable L3, which is equivalent to the last part of the LCTABL
array, must be increased by the number of new sites (see example).  The new
pairs of numbers (Illinois codes and SAROAD codes) should then be placed at
the end of the DATA statement for LCTABL.

      AGNPROJ is an array containing the agency/project information.   Its
dimension must also equal NSITES.  New site information should go on at the
end of the DATA statement for AGNPROJ in the position corresponding to the
site position in LCTABL.
                                   D-l

-------
      The value of NSITES 1n subroutine HEADER must agree with the new num-
ber of sites.                                      i

      For site additions, three variables 1n subroutine PLUTNT are affected.
These are arrays M, U, and D, and stand for method, units, and decimal place,
respectively.  Each of these arrays 1s an NSITESXNPOLS dlmensionsal array
where NSITES is again the number of sites and NPOLS 1s the number of pollu-
tants.

      In each array, all (i.e., the total #) of sites vs the first pollutant
are listed, then all of the sites again vs the second pollutant, and so on,
until all of the pollutants are exhausted.  For example, with four sites
and two pollutants, the data for methods would be listed in the order
M(l,l), M(2,l), M(3,l), M(4,l), M(l,2), M(292), M(3,2), M(4,2), and sim-
ilarly for the arrays U and D.  Adding a site means adding 3*NPOLS pieces
of data, one at the end of each pollutant section in each of the method,
un.its, and decimal point variables.

      To add a site, the first dimension of each array must be changed to
agree with the new number of sites.  Next, since there are NPOLS columns,
data must be added to each column for each new site.  In the DATA statement
for these arrays, each pollutant column is separated by a space from ad-
jacent columns.  The ordering of the pollutant species is as follows:
particulates, S02, COH, WS, WD, CO, TOX.

      As an example, suppose we wish to add a new site with characteristics
as listed in Table D-l.  In HEADER, the relevant changes are listed below:

          Old Card                                  New Card
DIMENSION LCTABL(2,162),              DIMENSION LCTABL(2,163),
AGNPROJ(2,162_), L3(2,T)               AGNPROJ(2,163_), L3(2,F)
DATA NSITES/162/                      DATA NSITES/163/
DATA L3/05801505, 141740005/          DATA L3/05801505, 14740005, 00206507,
                                      146080024/
                                   D-2

-------
                                                         TABLE D-l
                                          SAMPLE CODES OF NEW SITE TO BE INCLUDED
Geo. Code
072065
I EPA
Site
07
Format
Location
Peoria
Pollutant
COH
SO,
Site Code
Prefix 4
6080 024
Agency/
Project
F 01
SAROAD
Paramel
11201
42401
Format
81
11
Units
09
07
Decimal
Point
2
3
co

-------
          Old Card
             New Card
 DATA AGNPROJ/
   continuation cards
   'G01',3*'F017
 DATA AGNPROJ/ 	
l\
\} continuation cards
** i
4^
5  'J05',5*'F01',4*'G01','FOT,'GO!',
   4*'F017
      In the subroutine PLUTNT, the relevant changes are:
            Old Card
DIMENSION M(162,7), U(162.,7),
               New Card

   DIMENSION M(163_,7), U(163_,7),
   D(163_,7)
   DATA M/l63*91,4*11,91,2*13,12*91,
   3*13,8*91,3*11,48*91,16*11,5*91,
   4*13,41*11,4*13,2*11,4*13,6*11,
   163*81,489*11,163*14/
   DATA U/163*l,163*7,163*9,163*12,
   163*14,163*7,163*7/
   DATA 0/163*0,163*3,163*2,163*0,
DATA M/l 62*91 ,4*1 1 ,91 ,2*1 3,1 2*91 ,
3*1 3,8*91 ,3*1 1 ,48*91 ,16*11 ,5*91 ,
4*1 3 ,41 *1 1 ,4*1 3 ,2*1 1 ,4*1 3 ,5*1 1 ,
162*81 ,486*1 1,1 62*1 4/
DATA U/162*l, 162*7, 162*9,162*12,
162*14,16j[*7,16j[*7/  ~~
DATA 0/162*0,162*3,162*2,162*0,
162*0,1 62*2, 162.*~3/
      Notice that although the added site only samples two pollutants, place-
holding codes for the other pollutants must be added so that future data
Hems will be aligned properly.

D-2.  POLLUTANT ADDITIONS

      For pollutant additions, subroutine PLUTNT is affected.  First, the
variable NPOLS, which stands for the number of pollutants, must be changed
to agree with the new number.  The arrays, M, U, and D, which were described
in the previous section, must have their second dimension changed to equal
NPOLS.  Next, a new column of data containing NSITES pieces of information
corresponding to each added pollutant must be added to each of the arrays
M, U, and D.

      PLTABL is an array dimensioned 2XNPOLS, and contains first an Illinois
pollutant code, and then a corresponding SAROAD pollutant code in pairs.
                                   D-4

-------
Its second dimension must equal NPOLS.  The additional pairs (of Illinois
and SAROAD codes) must go to the end of the DATA statement for PLTABL.

      As an example, suppose there currently exist six pollutants, and a
seventh, TOX, is to be incorporated.  The following Information 1s ex-
tracted from the SAROAD manual [4]:

                        Illinois Pollutant Code = 53
      SAROAD parameter code = 44101
      Method code =14
      Units code = 7
      Decimal places for all sites meaning TOX - 3

The necessary changes in PLUTNT are:

              Old Card                                  New Card

DIMENSION M(163,6),U(163,6),0(163,6),     DIMENSION M(163,7),U(163,7),U(163,7),
PLTABL (2,6_)    .""        ~        ~       PLTABL (2,7.)
DATA NPOLS, NCHNGS/6_,0/                    DATA NPOLS,NCHNGS/,7,0/
DATA M/163*91...... ,489*11/                DATA M/163*91	489*11,163*14/
DATA U/163*!,....,163*7/                  DATA U/l63*1	163*7,163*77
DATA 0/163*0......163*2/                  DATA 0/163*0,.....163*2.163*3/
DATA PLTABL/42,11101,32,42401,	       DATA PLTABL/42,11101,32,42401,50,
50,42101/                                 42101.53,44101/

      Even though all sites do not measure TOX, dummy values must be  placed
in the seventh column for proper data alignment.

D-3.  CODING A POLLUTANT IN RECORD TYPE 3

      Subroutines REC3 and PLUTNT are affected.

      Record type 3 can contain several pollutants on a single record.  There
are no pollutant codes given because the location of data  in the record de-
termines which pollutant 1s associated with it.  The subroutine PLUTNT de-
termines the correct SAROAD codes for the pollutant, method, and decimal
place.  However, some of the pollutants possible in record 3 have not been
                                   D-5

-------
coded Into the tables in PLUTNT because there was no Information available
on them and they were not expected to appear on any Input tapes.  Should
one appear without additional coding, the program will  write an error mes-
sage.  To code for this previously unused pollutant, the subroutine PLUTNT
must be changed as described In the last section.  In addition, the array
PLIND 1n SUBROUTINE REC3 must be modified.  PLIND gives the Index of a rec-
ord type 3 pollutant in the 11st 1n PLUTNT.  This eliminates the requirement
of PLUTNT locating the pollutant 1n Its tables.  If one of the pollutants 1n
record 3 is added to the arrays 1n PLUTNT, then the corresponding item in
PLIND should be changed to Identify the pollutant index.

D-4.  CODING A CHANGE IN METHOD

      Subroutine PLUTNT must be modified to accommodate a change in methods
code.

      CHNGES is a 5XNCHNGS array which contains method change information.
NCHNGS equals the second dimension of CHNGES.  The first dimension contains
(1) method, (2) units, (3) decimal point, (4) date of change to new method
(set to 999999 if this is the last change for this site and pollutant), and
(5) a pointer to the next change for the particular site and pollutant if
there is one.  The second dimension initially had a dummy value of one.

      To code a change in method, the dimension of CHNGES must be increased
to accommodate the change.  If this is the first change for this si-te-
pollutant combination, then two columns must be provided for in CHNGES.
The first column will contain five pieces of information:  (1) the first
method, (2) the first units, (3) the first decimal place locater, (4) the
date of change to the new method, and (5) the index of the column in
CHNGES which provides the second method, units, and decimal place informa-
tion.  The fourth element of this second column should be set to 999999 so
that there will be no doubt that this is the final change.  The program
will compare this number with the date of the sample to see if the sample
was taken after this change date.  The second column's fifth element, the
pointer to the further changes, can be set to anything, but to insure
proper correspondence of data values, ought to be set to a finite value.
                                   D-6

-------
      The array M will Indicate that a change 1n method has occurred.   In-
stead of the method code for the site-pollutant 1n question, the negative
of the Index of the column 1n the CHNGES array should be present.

      If this 1s not the first change for this site-pollutant, Increase the
dimension of CHNGES by one.  Put the date of change Into CHNGES(4,I) where
l_ 1s the Index of what previously had been the last change for that site-
pollutant.  In CHNGES(5,1), which 1s the pointer value, put the Index of
CHNGES which pinpoints the final change.  Then at the column of CHNGES
pointed to by this Index (which should equal the dimension of CHNGES unless
more than one site-pollutant combination 1s being changed) place the values
for method, units, and decimal place.  Also, put in 999999 for the date and
anything for the pointer.  To insure proper allocation of data within the
array, all elements in the array should be properly accounted.

      As an example of coding a change in method, suppose that site 01 in
DePue (006030,140680001) changed its method for measuring particulates from
91 to 77 on January 1, 1973 and that this is the first change ever to be
coded.  Then the set of old and new DATA statements will appear as follows:

      Old Statement                               New Statement

DATA NCHNGS/0_                            DATA NCHNGS/2/
DATA M/163*91	                       DATA M/99*91 ,£[,,63*91	
DIMENSION CHNGES(5,1)....                DIMENSION CHNGES(5,2)....
                                         DATA CHNGES/91,1,0,730101,2,77,1,
                                         0.999999.0/

      NCHNGS must now agree with the dimension of CHNGES.  The -1 at the
100th place in the array M 1s the negative of the pointer to the first
method.  It points to the first column of CHNGES.  The DATA statement for
CHNGES gives the methods, units, decimal places, dates, and pointers to ad-
ditional changes for that site and pollutant code.  The value 2 at
CHNGES(5,1) 1s the pointer to the new method, units and decimal place which
goes in the second column of CHNGES.  CHNGES(4,2) gives the date of a fur-
ther change.  Since there 1s no additional change, the date = 999999.  The
second pointer is set to 0_, but is not used.  Later, on March 1, 1973, site
                                   D-7

-------
No. 8 at Argo High School (016006,141540001) change their method for S02
from 91 to 13:
       Old Statement
DATA NCHNGS/2/
DATA M/99*91,-1,63*91,4*11,91,
2*13	                  ~~
DIMENSION CHNGES(5,2_)
DATA CHNGES/91,1,0,730101,2,77,1,
0.999999.0/
         New Statement

DATA NCHNGS/4/
DATA M/99*91,-1,63*91,4*11,^3,
2*13
ff I W $ * • • •
DIMENSION CHNGES(5,4J
DATA CHNGES/91,1,0,730101,2,77,1,
0,999999,0,91,7.3,730301,4,13,7,
3,999999,0/
Again, NCHNGS agrees with the dimension of CHNGES, the second column (the
S02 column) of M_ has a negative number to point to the third column in
CHNGES where the Information is stored.  The third column points to the
fourth column for information following March 1, 1973.  The array CHNGES
1s completely filled even though the last pointer 1s not used.

      Finally, suppose DePue site No. 1 changes Its particulate sampling
method again from 77 to 11 on July 4, 1973.  The coding 1s as follows:
       Old Statement

DATA NCHNGS/4/
DIMENSION CHNGES(5,4_)
DATA CHNGES/91,1,0,730101,2,77,1,
0.999999.0.91.7,3.730301,4,13.7.
3,999999,O/
          New Statement

DATA NCHNGS/5/
DIMENSION CHNGES(5,5_)
DATA CHNGES/91,1,0,730101,2,77,1.
0.730704.5,91,7,3,730301,4,13,7,3,
999999,0,Tl ,1,0,999999,0/
      NCHNGS is now five (5) since only one additional column was needed.
Since this same site-pollutant combination had already changed its method
once, the M, array needed no further change.  CHNGES(4,2) had to be changed
to the correct date (730704) and CHNGES(5,2) now points to the fifth column
where the final data 1s placed.

      Each pollutant-site combination 1s different so if the same site
changes two different pollutant sampling methods, these have to appear
separately and independently 1n CHNGES.
                                   0-8

-------
                                APPENDIX E
                 OPTIONAL OUTPUT FROM CONVERSION PROGRAM
      In addition to the tape output, the CONVERSION program will provide
output showing first an unconverted Illinois record and then the same rec-
ord in SAROAD format.  This 1s written to the diagnostic output file.

      The MAIN routine controls this option through a variable called
OPTION.   If it is set to 0, no record-by-record account 1s placed 1n the
diagnostic file and only unprocessable records appear there.  If OPTION
is set equal to anything but 0, the additional output 1s written.  The
variable DIAG in the MAIN routine specifies the unit number for the de-
vice where the optional output and the other diagnostic messages will be
printed.

      Samples of these printed output for record types 3, 2, 1, and 5 are
illustrated in Table 4-4.
                                   E-l

-------
                                   TECHNICAL REPORT DATA
                            (Please read Instructions on the reverse before completing}
1. REPORT NO.
 EPA-4SO/3-74-019
                                                            3. RECIPIENT'S ACCESSIOI*NO.
4. TITLE AND SUBTITLE
 Computer Programs For The Conversion Of Illinois State
 Air Quality  Data To The Saroad Format
             S. REPORT DATE
              December 1973
             6. PERFORMING ORGANIZATION CODE
7. AUTHOR(S)


 Paul Swartz,  Khee M. Chng,  Dr.  Richard D.  Siegel
                                                            8. PERFORMING ORGANIZATION REPORT NO.
9. PERFORMING ORG MMIZATION NAME AND ADDRESS
 Walden Research Corporation
 359 Allston  Street
 Cambridge, Massachusetts 02139
             10. PROGRAM ELEMENT NO.
               2AE132
             11. CONTRACT/GRANT NO.


              68-02-0049
12. SPONSORING AGENCY NAME AND ADDRESS
 Environmental Protection Agency
 Research Triangle Park, North Carolina 27711
                                                            13. TYPE OF REPORT AND PERIOD COVERED
                                                             Final
             14. SPONSORING AGENCY CODE
15. SUPPLEMENTARY NOTES
16. ABSTRACT
      This  report describes  two computer programs that are used to convert  State of
 Illinois air quality data to the SAROAD format.  The first  program (the PREPROCESSOR)
 preprocesses the Illinois data on tape and writes out an output tape for the main
 program  (the CONVERSION).   The PREPROCESSOR is written in ASSEMBLY to facilitate the
 "unpacking" of some of the  data records which are in packed.decimal format.   The
 CONVERSION is written in FORTRAN IV and does all the necessary conversion  to the
 SAROAD format.                                 »
17.
                                KEY WORDS AND DOCUMENT ANALYSIS
                  DESCRIPTORS
                                               b.lDENTIFIERS/OPEN ENDED TERMS
                           c.  COSATI Field/Group
 Preprocessor
 Conversion
 Program
 JCL
 Assembly
 Routine
18. DISTRIBUTION STATEMENT


 Release Unlimited
19. SECURITY CLASS (ThisReport)
  Unclassified
21. NO. OF PAGES
   39
20. SECURITY CLASS (Thispage)

  Unclassified	
                           22. PRICE
EPA Form .2220-1 (9-73)
                                           E-2

-------
                                                          INSTRUCTIONS

    1.   REPORT NUMBER
         Insert the EPA report number as it appears on the cover of the publication.

    2.   LEAVE BLANK

    3.   RECIPIENTS ACCESSION NUMBER
         Reserved for use by each report recipient.

    4.   TITLE AND SUBTITLE
         Title should indicate clearly and briefly the subject coverage of the report, and be displayed prominently.  Set subtitle, if used, in smaller
         type or otherwise subordinate it to main title. When a report is prepared in more than one volume, repeat the primary title, add volume
         : ..mber „! d include subtitle for the specific title.

    5.   REPORT DATE
         Each report shall carry a date indicating at least month and year.  Indicate the basis on which it was selected (e.g., date of issue, date of
        approvcl, date of preparation, etc.).

    6.   PERFORMING ORGANIZATION CODE
         Leave blank.

    7.   AUTHOR(S)
         Give name(s) in conventional order (John R. Doe, J. Robert Doe,  etc.). List author's affiliation if it differs from the performing organi-
         zation.

    8.   PERFORMING ORGANIZATION REPORT NUMBER
         Insert if performing organization wishes to assign this number.

    9.   PERFORMING ORGANIZATION NAME AND ADDRESS
         Give name,  street, city, state, and ZIP code. List  no more than two levels of an organizational hircarchy.

    10.   PROGRAM ELEMENT NUMBER
         Use the program element number under which the report was prepared. Subordinate numbers may be included in parentheses.

    11.   CONTRACT/GRANT NUMBER
         Insert contract or grant number under which report was prepared.

    12.   SPONSORING AGENCY NAME AND ADDRESS
         Include ZIP code.

    13.   TYPE OF REPORT AND PERIOD COVERED
         Indicate interim final, etc., and if applicable, dates covered.

    14.  SPONSORING AGENCY CODE
         Leave blank.

    15.  SUPPLEMENTARY NpTES
         Enter information not included elsewhere but useful, such as:  Prepared in cooperation with, Translation of, Presented at conference of,
        To be published in, Supersedes, Supplements, etc.

    16.   ABSTRACT
         Include a brief (200 words or less} factual summary of the most significant information contained in the report. If the report contains a
         significant bibliography or literature survey, mention it  here.

    17.   KEY WORDS AND DOCUMENT ANALYSIS
         (a) DESCRIPTORS • Select from the Thesaurus of Engineering and Scientific Terms the proper authorized terms that identify the major
        concept of the research and are sufficiently specific and precise to be used as index entries for cataloging.

        (b) IDENTIFIERS AND OPEN-ENDED TERMS - Use identifiers for project names, code names, equipment designators, etc.  Use open-
        ended terms written in descriptor form for those subjects for which no descriptor exists.

         (c) COSAT1 HELD GROUP - Field and group assignments are to  be taken from the 1965 COSATI Subject Category List. Since the ma-
        jority of documents are multidisciplinary in nature, the Primary Field/Group assignment(s) will  be specific discipline, area of human
        endeavor, or type of physical object. The application(s) will be cross-referenced with secondary Field/Group assignments that will follow
        the primary posting(s).

    18.  DISTRIBUTION STATEMENT
         Denote releasability to the public or limitation for reasons other than security for example "Release Unlimited." Cite any availability to
        the public, with address and price.

    19. &20.  SECURITY CLASSIFICATION
        DO NOT submit classified reports to the National Technical Information service.

    21.  NUMBER OF PAGES
        Insert the total number of pages, including this one and unnumbered pages, but exclude distribution list, if any.

    22.  PRICE
         Insert the price set by the National Technical Information Service or the Government Printing Office, if known.
EPA Form 2220-1  (9-73) (Reverse)

-------