OCR error (C:\Conversion\JobRoot\00000AX2\tiff\2000XF7O.tif): Unspecified error

-------
                RESEARCH REPORTING SERIES

Research reports of the Office of Research and Development, U S Environmental
Protection Agency, have been grouped into nine series  These nine broad cate-
gories were established to facilitate further development and application of en-
vironmental technology  Elimination of traditional grouping  was  consciously
planned to foster technology transfer and a maximum interface in related fields
The nine series are

      1   Environmental  Health Effects Research
      2   Environmental  Protection Technology
      3   Ecological Research
      4   Environmental  Monitoring
      5   Socioeconomic Environmental Studies
      6   Scientific and Technical Assessment Reports (STAR)
      7   Interagency Energy-Environment Research and  Development
      8   "Special" Reports
      9   Miscellaneous Reports

This  report has been assigned to the ENVIRONMENTAL MONITORING series
This  series describes research conducted to develop new  or improved methods
and  instrumentation for the identification and quantification of environmental
pollutants at the lowest conceivably significant concentrations  It also includes
studies to determine the ambient concentrations of pollutants m the environment
and/or the variance of pollutants as a function of time or meteorological factors.
This document is available to the public through the National Technical Informa-
tion Service, Springfield, Virginia  22161

-------
                                               EPA-600/4-80-013C
                                               February 1980
       EVALUATION OF THE REAL-TIME
             AIR-QUALITY MODEL
         USING THE  RAPS DATA BASE

         Volume 3.  Program User's Guide
                       by
           Ronald E. Ruff and Hisao Shigeishi
             Atmospheric Science Center
                 SRI International
             Menlo Park, California 94025
                       and
                  Rodney H. Allen
                  Comp-Aid, Inc.
      Research Triangle Park, North Carolina 27711
              Contract No. 68-02-2770
                   Project Officer
                   John S. Irwin
          Meteorology and Assessment Division
       Environmental Sciences Research Laboratory
      Research Triangle Park, North Carolina 27711
ENVIRONMENTAL SCIENCES RESEARCH LABORATORY
     OFFICE OF  RESEARCH AND DEVELOPMENT
    U.S. ENVIRONMENTAL PROTECTION AGENCY
RESEARCH TRIANGLE PARK, NORTH CAROLINA 27711

-------
                                 DISCLAIMER
     This report has been reviewed by the Environmental Sciences Research
Laboratory, U.S. Environmental Protection Agency,  and approved for publica-
tion.  Approval does not signify that the contents necessarily reflect the
views and policies of the U.S. Environmental Protection Agency, nor does men-
tion of trade names or commercial products constitute endorsement or recom-
mendation for use.
                                      ii

-------
                               ABSTRACT

     The theory and programming of statistical tests for evaluating the
Real-Time Air-Quality Model (RAM) using the Regional Air Pollution Study
(RAPS) data base are fully documented in four volumes.  Moreover, the
tests are generally applicable to other model evaluation problems.  Vol-
ume 3 presents the software used in the statistical tests for evaluating
the RAM.  Six statistical tests are described, with attention to the pro-
gramming philosophy behind them.  Also presented is a review of the
auxiliary software that sort,  retrieve, format, and display the data.
This report was submitted in fulfillment of Contract No. 68-02-2770 by
SRI International under the sponsorship of the U.S. Environmental Pro-
tection Agency.  This report covers a period from 1 October 1977 to 1
April 1979, and work was completed as of 1 April 1979.
                                   111

-------
                            CONTENTS
Abstract	iii
Figures	vi
Tables	viii

   1.  Overview	1
           Background 	 1
           Discussion of statistical programs 	 2
           Programming philosophy 	 3
   2.  Data-Base Considerations 	 4
           Content  	 4
           Structure and formats	4
           Display and retrieval software 	  10
           Auxiliary software 	  13
   3.  Statistical Package	16
           Introduction 	  16
           Accuracy score 	  16
           Residual time series	30
           Chi-square goodness-of-fit 	  34
           Bivariate regression and correlation 	  38
           Interstation error correlation 	  43
           Multiple regression of error residuals 	  45

References	50
Appendices

   A.  Listing of test data base	51
   B.  Modified EPA frequency-distribution software 	  54
   C.  Accuracy score listings  	  66
   D.  Residual time series listings  	  93
   E.  Chi-square goodness-of-fit listings  	 105
   F.  Bivariate regression and correlation listing 	 114
   G.  Interstation error correlation listings  	 125

-------
                                FIGURES


Number                                                             Page

   1   SPSSDAT program 	   8

   2   SPSSSORT program  	  11

   3   Examples of SPSS histograms	12

   4   Frequency distribution of observed and predicted
         concentrations on log-probability axes  	  14

   5   Frequency distributions of residuals (percent)
         on log-probability axes	15

   6   Accuracy score equations  	  17

   7   Flow diagram for the accuracy-score program	19

   8   Results of Test 1 displayed on a map of St.  Louis  	  21

   9   First part of the accuracy score session  	  22

  10   Accuracy score session (MODE CODE =1)  	  23

  11   Accuracy score session (MODE CODE = 2)	24

  12   Software structure for the accuracy score program  	  25

  13   Display of the autocorrelation function
         for Station 1 of the test data base	31

  14   Display of the normalized cumulation periodogram
         for Station 1 of the test data base	32

  15   Program structure for the residual time series  ...."..  33

  16   Histogram of concentrations for the test data base  ....  35

  17   Histogram of concentration residuals
         for the test data base	36

  18   Structure of the chi-square goodness-of-fit  program ....  37
                                   vi

-------
Number                                                             Page

  19   Scattergram with least-squares, confidence,
         and probability lines 	  39

  20   Structure of the regression and correlation program ....  40

  21   COREL2 output for test data base	43

  22   Structure of the interstation error
         correlation program 	  44

  23   Example of a regression procedure 	  46

  24   Summary output for regression of RESID
       '  on ASC, WDC, and WSC	47

  25   Summary output for regression of RESID
         on TIME and SITE	47

  26   Example of SPSS SCATTERGRAM output	49
                                  vii

-------
                                TABLES
Number                                                             Page

  1    Definition of User-Entered Values for the
         Accuracy Score Test .	23

  2    Description and Format of Test Data Base	27
                                  viii

-------
                                SECTION 1
                                 OVERVIEW

BACKGROUND
     The programs described in this volume are meant to be general-purpose
tools useful to anyone with a computer supporting the FORTRAN IV program-
ming language and a graphics display.  However, from a practical stand-
point, we had to tune our programming efforts to EPA's National Computer
Center (NCC) in Research Triangle Park, North Carolina.  The mainframe is
a Univac 1110 computer.  (The executive system, Exec 8, 'is described in
                                            i
Volume VII of the NCC User Reference Manual. )  Standard peripherals were
used whenever possible.  For graphics, the Tektronix 4014 terminal is
the only device on which the plotting programs can operate.   (Graphic
output in this text are from the 4014 using a Tektronix 4631 hardcopy
unit.)
     Most of the programs were written in Univac"s FORTRAN V language.
(See Volume III of the NCC User Reference Manual.)  Certainly the pro-
grams as they now exist would require only minimal effort for conversion
to FORTRAN IV.   For graphics, FORTRAN-callable Tektronix subroutines in
the Advanced Graphing II  and the Terminal Control System3 manuals were
used.  A few programs were written in the special Statistical Packages
                                        4
for the Social Sciences (SPSS) language.   Many major computer facilities
have this software package or one that is quite similar.
     From the above description, it should be clear that the software
presented will operate only on the NCC system.  However, with minimal
modification it should be readily adaptable to most other major computer
systems.  For the remainder of this text, we assume that the reader is
familiar with the hardware and basic software used.  We do attempt to
point out code that is usually specific to the NCC computer system.

-------
DISCUSSION OF STATISTICAL PROGRAMS

     The six statistical tests recommended in Volume 2 were programmed,

debugged, and tested.  The tests and program names are given below:

                                                         *
                  Test Name                   Program Name

         Accuracy score                  M21ADO*STAT01.ACSCOR

         Residual time series            M21ADO*STAT02.TIMSER

         Chi-square goodness-of-fit      M21ADO*STAT03.CHIFIT

         Bivariate regression
         and correlation'1'                M21ADO*STAT04.REGANA

         Interstation error
         Correlation                     M21ADO*STAT05.COREL2

         Multiple regression
         of error residuals              M21ADO*STAT06.SPSSRUN
The Pearson's correlation coefficient and linear regression tests were

combined because (1) it was computationally efficient to do so and (2)

results from both tests have historically been presented together when

evaluating air-quality models.  The six programs are fully described in
Section 3 of this volume.  (Note that the O's are zeros in M21ADO and

STAT01 through STAT06 and are the letter 0 elsewhere.)
*
 The program names are given in typical Exec 8 file designation format--
 FILENAME.ELEMENT.  On the NCC computer, one must often qualify the file
 with an account code--ACCOUNT*FILENAME.ELEMENT.   The account qualifier
 for these statistical programs is M21ADO.  All the source, relocatable,
 and absolute elements found in files M21ADO*STATO1 through M21ADO*STAT06
 are backed up in a single file labeled SRI*SRI.   In this file an absolute
 such as M21ADO*STAT01.ACSCOR is also known as SRI*SRI.ACSCOR.  The test
 data base in data element M21ADO*STAT01.COQS2N is also known as
 SR1*SRI.COQS2N.  All other source, data, and relocatable elements follow
 the example for M21ADO*STAT02.CASE2 which is also contained in
 SRI*SRI.CASE2/STAT02.

 Combines the features of two tests:  (1) linear regression with confi-
 dence and prediction bands and (2) Pearson's correlation coefficient.
 See Volume 2 for a complete description.

-------
                                                      *
     Each of the program files (STAT01 through STAT06)  contains all the
subroutines and run streams (control language statements) required to run
the statistical test in question.   In addition, a test data base is con-
tained in M21ADO*STAT01.COQS2N.  All programs except those contained in
STAT06 are written in FORTRAN V.   STAT06 programs are written in the SPSS
language.  In addition to the multiple regression program, SPSS is also
used to plot frequency distributions of any variable, to plot scattergrams,
and to retrieve subsets of the data base.   These auxiliary data-retrieval
and display programs are discussed in Section 2.

PROGRAMMING PHILOSOPHY
     Before discussing the details of the software, we wish to impart
some of the philosophy used during development.  Our approach is a compro-
mise between practical considerations in computing efficiency and the
ideal software from the users' perspective.
     The ideal programs would never need to be modified regardless of the
data base used and the application in question.  Furthermore, they would
work on a large number of computers, given that these computers were
equipped with certain software.
     Having defined our concept of programs ideal to a user community, we
now alert the reader that our programs do not satisfy that definition.
However, we have standardized where practical, and through the documenta-
tion provided in this volume, the user can readily customize the programs
to his application and system, assuming that the system supports FORTRAN
IV, Tektronix graphics, and SPSS.   (As stated earlier, we attempt to
point out sections of the program that are specific to the NCC Univac
system.)
*
 For brevity, the account qualifier--M21ADO--is often omitted.

-------
                              SECTION  2
                       DATA-BASE CONSIDERATIONS

CONTENT
     In their simplest form, the data for most statistical tests consist
of n pairs of observed and predicted concentrations.   These data are
denoted (OC, PC) ,(OC2,PC2),...,(OCn,PCn).   (This data set may include all
the data gathered or only a selected subset thereof.)  The concentrations
might refer to hourly averages,  three-hour averages,  daily averages, etc.,
at a particular monitoring station or from any number of stations.   Except
for the residual time series test, the data pairs need not be sequential
nor time ordered in any particular fashion.
     Since it is desirable to assess model performance under a variety of
meteorological and emission conditions, the data base should be arranged
so that it can be subdivided into many nonexclusive subsets, according
to the following parameters:
     •  Date, D
     •  Time period, T
     •  Location, L
     •  Pasquill-Gifford stability class, G-)
     •  Wind-speed class, 62
     •  Wind-direction class, 63
     •  Mixing-height class, G^
     •  Emission class, Q
     •  Observed concentration,  OC
     •  Predicted concentration, PC.

STRUCTURE AND FORMA1S
General Structure
     The exact structure (or hierarchy) of the data depends on the fea-
tures of the data base to be tested.  Consequently, the format chosen for

-------
our statistical programs was determined by features of our test data base.
The data file (in card image form) is ordered as follows:

           Card/Line Number                   Data
                  1              (D,T,L,GltG2,G3,G4,Q,OC,PC)
                  2              (D,T,L,G1,G2,G3,G4,Q>OC>PC)2


                  n              (D,T,L,G1,G2,G3,G4)Q,OC,PC)n

(We will refer to each record by line number rather than card number,
since normally the records will be stored on disk.)
     The only requirement for this structure is that all the observed and
predicted concentrations--(OC,PC) through (OCn,PCn)--be distinct.   Now,
we must recognize that the data file can include concentrations for a
number of monitoring locations, denoted by L.  Also, for each time period,
T, we may choose to concern ourselves with only one set of meteorological
and emission parameters.  (This would typically be the case when evalu-
ating the RAM.)  Therefore,  if we expand our subscript notation somewhat,
our data file would typically be ordered as follows:

     Card/Line Number                        Data
             1              D1,T1,1,(G1,G2,G3,G4,Q)1,OC1,PC1
             2              D1,T1,2,(G1,G2,G3,G4,Q)1,OC2,PC2
            ns             D1,T1,nSj(G1,G2,G3,G4,Q)1,OCns,PCns
          ns + 1           D2,T2,l,(G1,G2,G3,G4,Q)2,OCns+1,PCns+1
           2*ns            D2 ,T2 ,ns ? (G1 ,G2 ,G3 ,G4 ,Q)2 ,
                             ,Tp ,ns, (GL ,G2 ,63 ,G4 ,Q)p ,OCp,Vng ,PCp*ns

-------
where ns = number of monitoring stations (locations), p = number of time
periods, and ns*p = n = number of observed and predicted concentration
pairs.  Generally speaking, our test data base is structured as above.
     While the structure described above is functional, it is probably
not always computationally efficient.  This is particularly true if we
must apply the programs to a large data base (such as that for the RAPS).
The inefficiency stems from having to store the time, date, meteorolog-
ical, and emissions data once for each monitoring site.  Thus repetition
consumes a moderate amount of storage space.  (In a one-year period, we
are storing over 50,000 words of redundant data.)  Consequently, for
larger data bases, we would recommend storing the data in a more effi-
cient manner.
     For the RAPS data base, we note that meteorological data are col-
lected at each of the monitoring stations.  As discussed in Volume 4,
it may be desirable to store these station-specific meteorological data
for use in our analysis even though these data are not used directly by
the model.  Therefore, depending on the application, we may wish to retain
additional data that will require format changes.  In Volume 4, we dis-
cuss specific recommendations for evaluating the RAM using the RAPS data
base.
     As suggested in the above discussion, the exact structure (and even
content) of the data base may vary according to application, user conve-
nience, and computational efficiency.  It generally requires modification
of only one or two lines in the program code to accommodate a slightly
different data structure.  When we discuss the individual programs (in
Section 3), we point out the sections of code that control the data-
base interface and the exact data requirements.  We stress that the user
should have a flexible attitude concerning the exact format, allowing for
changes that befit the application at hand.
                                   6

-------
 Test Data Base
 Standard (FORTRAN) Format--
     The data base is stored in free-form format in STAT01.COQS2N
(file.element).   Appendix A contains a listing of the data.   In all, there
are 101 line (or card) images.   Each line image contains the following
information, in the order presented:
     •  Date — six digits
     •  Time — four digits
     •  Station—one digit whose value is 1, 2, or 3
     •  Atmosphere stability—one digit whose value varies from 1 to 6
     •  Wind-speed class—one digit whose value varies from 1 to 6
     •  Wind-direction class — two digits whose value varies from 1 to 16
     •  Observed concentration—a number between 0.0 and 1000.0 (one
        significant figure to the right of the decimal point)
     •  Predicted concentration--same format as above.
The mixing-height class and emissions class were not required when the
test data base was acquired.  (Refer to Volume 1 for a description of
the field study during which the test data base was acquired.)

SPSS Format—
     The SPSS system of computer programs is used to perform the multiple
linear regression test, which relates meteorological parameters to
observed and predicted concentration residuals.  The SPSS is also useful
in retrieving and displaying subsets of the data base.  (This is described
on pages 10 and 11.)  Prior to  using any of the SPSS procedures, the input
data must be converted to a special SPSS format.  This can be done within
each program or, alternatively, done once and then stored in the special
SPSS format.  This latter approach is more efficient when an assortment
or SPSS programs is continually applied.  In the next paragraph, we dis-
cuss the program that converts  a standard FORTRAN file into an SPSS file.

-------
     The program to  reformat the data is stored in STAT06.SPSSDAT.   (In

discussing the  SPSS  procedures and codes, the reader should refer to the
           4.
SPSS manual  for a complete description.  Our descriptions will be brief

and will not  ~ver all  the features of the statements involved.)  The pro-

gram stored in  SPSSDAT  appears in Figure 1 below.
    ^DELETE  HSPRNT.
    $ASG,PU  HSPRNT.
    3ASG,A SPSSINPUT.
    3USE  8.,SPSSINPUT.
    $ASG,PU  SPSSFILE.
    3USE  4.,SPSSFILE.
    06RKPT PRINIS/HSPRNI
    espss
    RUN NAME        TEST MODEL
    FILE  NAME       SPSSDATA
    VARIABLE  LIST  DATE , T IMF., SITE , ASC , IvSC , WOC , HC , PC
    INPUT MEOIIJVI   TAPF
    N OF  CASES      UNK'JOht'i
    INPUT FORMAT   FIXED    (12X,2F6.0 , M .0,2F3 . 0 , F4 . 0 , 7X , 2F8 .1 )
    MISSING  VALUES ALL  (BLANKS)
    COMPUTE         RES ID  =  O'C-PC
    VAP LABF.'LS      PLS1D , RES1DOAI
                    ASC, SFABILIIY CLASS
                    WSC, 'AlKD SPEED CLASS
                    WOC, ft:It,D DIFFCTIU^ CLASS
                    OC,  OBSERVED  C0r> CK'-T^ A'l IGM
                    PC,  PREDICTED  CUNCKNTPAT10N
    LIST  CASES      CASES  =  JOOO/
                    VARIABLES = AF.L
    READ  INPUT  DATA
    SAVE  ULE
    FINISH
    P3RKPI PRIMTS
    ?FRfcE HSPRNT.
                 T., ,tD04PH

                         Figure 1. SPSSDAT program.
Note that two files were  assigned and  related to peripheral devices (4

and 8).  The first file SPSSINPUT is simply a copy of the test data base

contained in STAT01.COQS2N.   (SPSS  cannot work directly with data con-

tained in elements.  Therefore,  a system utility was used to copy data

-------
from STAT01.COQS2N to SPSSINPUT.)  The second file, SPSSFILE, is the output
file, which will become the specially formatted SPSS file used in subse-
quent SPSS programs.  The @SPSS control card is the manner in which the
NCC system calls the complete SPSS package.  Subsequent cards will then
be. recognized as SPSS procedure cards.  The remainder of the Exec 8 state-
ment* control the routing of the print file, HSPRNT, to the desired termi-
nal (FD04PR in this case).
     In Figure 1, the statements following @SPSS are the SPSS control
statements.  (These begin in column 1.  The specification of the desired
parameters begins in column 16.)  In our example, the RUN NAME is arbi-
trarily titled TEST MODEL, which thus becomes an identifier/header on the
output listing.  The FILE NAME has been called SPSSDATA, which becomes
the output SPSS file referred to by future SPSS programs.  Through the
VARIABLE LIST statement we choose the desired parameter names to corres-
pond with the data in our input file.  The INPUT MEDIUM, for Exec 8,
recognizes only a CARD or TAPE specification.  TAPE simply identifies
that the input will be read from a mass storage file, always named "8".
(Thus, through the @USE statement, SPSSINPUT is identified to SPSS as the
input file.)   The N OF CASE statement that follows can be set to UNKNOWN
if cards are not used for the input.  By specifying FIXED on the INPUT
FORMAT statement, we are able to use a standard FORTRAN format for the
parameters in the VARIABLE LIST statement.
     The preceding paragraph fully specifies the input file.  Next, we
describe how SPSS is used to manipulate the data and store them on the
output file.  First, by the MISSING VALUES statement, we could assign
values to any parameters when they are missing in the input data.  In our
case, this is not a consideration, so we leave such data blank.  The
COMPUTE statement enables us to compute any desired parameters.  Since we
use concentration residuals in another SPSS program, we compute the RESID
variable as shown.  •
*
 Alternatively, for the NCC only, routing of the output file can also be
 controlled by using the @AB*US.SUSPEND and @AB*US•RESUME statements as
 shown in Figure 2, page 11.

-------
     The VAR LABELS statement is used to assign meaningful names to the
parameters and subsequently cause these parameters to be better documented
in the ouput of the program.  The LIST CASES enables us to produce an
output listing of a user-specified number of cases (e.g., 1000) and the
desired variables (e.g., ALL).
     The READ INPUT DATA statement instructs the program to begin reading
the data.  The SAVE FILE instructs the system to save the processed file.
Using Exec 8, SPSS expects that the file available for writing will be
named "4".  (Thus, the @USE statement causes the file to be called
SPSSFILE.)
     The above SPSS program is by no means the only way to generate an
SPSS file.  Some of the statements are specified in a somewhat arbitrary
fashion.  We leave it to the reader to further familiarize himself with
the SPSS statements involved.

DISPLAY AND RETRIEVAL SOFTWARE
     Prior to selecting, applying, or interpreting a particular test, we
may wish to examine the data base in some detail.  For instance, we may
wish to stratify the data for a given meteorological class and then run
the test on that subset; or we may wish to closely examine the meteoro-
logical conditions associated with concentration comparisons that fall
outside the 90 percent probability bounds in a regression analysis.
     A number of computer languages could be used to satisfy the above
types of requirements.  Standard FORTRAN programs could be written or a
                                                5
data-base management language (e.g., System 2000 ) could be applied.
For our immediate needs, the most attractive choices of procedures are
those available within SPSS.  Two general SPSS data-retrieval and display
programs are discussed in the following paragraphs.
     A program stored in STAT06.SPSSSORT is an example of how SPSS can
be used to selectively sort, retrieve, and display data in an SPSS file.
The program is given in Figure 2 below.
                                 ,10

-------
PASG,A  HGSSOPT.
@bSt  15.,HGSSriHT.
«AB*US.SUSPFMD
PASG,A  SPSSFILK.
      3. ,SPSSF K.L.
P U Fi H A vi t         S U K 1  p i L fr".
GU' FILE         SPSSDAfA
PA* OUTPUT LIMIT Ib
tSfc.Lt.Cr  IF      (ASC  F.I.:  4)
•vPlTL  CASFS     (2F6.0,M.f>,2M.O,M.O,7X,2F8.] )  RATE , II vt , S 1TF. , ASC
                 *SC,wDC,OC,PC
*ShLECT  IF      (ASC  EC  4 A'JN SJIt  t^ 1)
FRtQUE'MCIKS     ItMTtGfc-P  = /DC ( 1 , 1 fc )  «SC(l,b)
OfliONS          3,8
FINISH
               P FD04PH
                         Figure 2. SPSSSORT program.
The input file, SPSSFILE, is named "3".  (Note the @USE control state-
ment.)  Within the SPSS program, the GET FILE statement automatically
looks to Unit 3 for the input.  SPSSDATA is the file name previously
assigned by the SPSSDAT program (see Figure 1).  The RAW OUTPUT UNIT 15
statement, coupled with the @ASG and @USE Exec 8 statements, identifies
HGSSORT as the output file.  (Note that the SPSS output will omit decimal
points.  Hence, the output as written must be divided by 10 in the
FORTRAN program.  Alternatively, we could drop the least significant
figure and use integers.)  The first "SELECT IF statement, followed by
WRITE CASES, causes an output file to be written on HGSSORT in the format
and order specified in the WRITE CASES field.  The resulting file will
contain those cases where the atmospheric stability classes (ASC) were
class 4.  This file can then be read by a FORTRAN program.
     The second -SELECT IF statement, followed by the FREQUENCIES state-
ment, causes the SPSS to generate a histogram on the line printer for the
identified variables—wind direction and speed — for station 1 and an
atmospheric stability class of 4.  The resulting output is shown in
Figure 3.  OPTION 3 causes the output to be left-justified on an 8-1/2
by 11 format;  OPTION 8 causes a histogram to be printed for each variable
specified on the FREQUENCIES statement.
                                   11

-------
Oc  CCT 73
.-' ILL -  SPS5DM* -  CREATED  0<» OC T  78
                          P*GE   2
WDC
    CC3E
        1  **•**»*»»*»«*  (      5)
           I
           I
           I
^
3
]
i
****» ( 2 )
r
[...... ... I.. ...... .1.
1 
-------
     There are a number of variations that can be used with the above
program.  Some of these are considered in Volume IV, in which we describe
techniques for applying the statistical tests.

AUXILIARY SOFTWARE
     As will be discussed thoroughly in Volume 4, simple graphic compari~
sons can provide very useful information during the model-evaluation pro-
cess.  Examples, plotted on a Tektronix 4014 terminal, are shown in Fig-
ures 4 and 5.  The first graph (Figure 4) displays on logarithm-probability
axes the frequency distribution of both observed and predicted concentra-
tions; the second graph (Figure 5) displays the frequency distribution
of the percentage difference (residual) in observed and predicted
concentrations.
     The programs to draw the axes and plot the data were developed by
EPA.  SRI's  subcontractor, Comp-Aid Incorporated, adapted the program to
our test data base and added some annotations.  Options for three differ-
ent graphs can be exercised.  (An example of the third type of graph,
frequency distribution of the absolute value of the concentration residual,
is discussed in Volume 4.)  The listings of the programs are given in
Appendix B.   The mapped (or linked) program is stored in SRI*SRI.FREQ
(account*file.element).  The run stream, stored in SRI*SRI.DATAFREQ,
which shows  its execution with our test data base (contained in
M21ADO--STAT01.COQS2N) is given in Section 1 of Appendix B.
     The figure for SRI*SRI.MAPFREQ, Section 2 of Appendix B, shows how
the program  is "mapped" and serves to identify the subroutines.   The main
program, SRI*SRI.FREQ, is given the name of the executable.  Its listing
is given in  Section 3 of Appendix B.  The subroutine listings are given in
Section 4 of Appendix B.   The principal subroutines are contained in
SRI*SRI. ORDER,  SRI* SRI. GRAPH, and SRI-'-SRI.GRALIN .  The other subroutines,
SRI*SRI.BOX, SRI*SRI.HEADER, and RAPS*UTILITY.COMPOZ, are used to draw the
frame around the plot and annotate the data executed (upper-right-hand
corner in Figures 4 and 5).  These last three subroutines are discussed
further in Section 3.
                                   13

-------
Figure 4.  Frequency distribution of observed and predicted concentrations
          on log-probability axes.

                                   14

-------
or-in

1*5
     z
     a
UJU
o z
cc o
•- u
z
uj a
CJ UJ
a: >
UJ K
a. lu

ir o
o a
u.
   o
ZK
O
  00

  a;

  W

  O
  u
  z
  LLI
  3
  a
  ui
  a;
   a

   a
   •^
   in
   UJ
     u.
     o
      99'L
                                            00'
WO
                                                                                           l
                                                                                           m
                                                                                           i

                                                                                           i
                                                                                           i
                                                                                           •?
                                                                                           s

                                                                                          S

                                                                                          •
                                                                                          > •
                                  •


                                  c
                                                                                                a
                                                                                                UJ
                                                                                                et
                                                                                                u.
OI'O-     If 1-
00'C-
                                                     ft]  1«nOlS38
             Figure 5.  Frequency distributions of residuals  (percent) on log-probability axes.
                                                15

-------
                               SECTION  3
                          STATISTICAL PACKAGE

INTRODUCTION
     In this section we discuss the structure  and logic of the programs
and their data requirements.   Each program has been tested using our test
data base stored in M21ADO*STAT01.COQS2N.  The programs can operate on
any other data base in the same way, provided  that the data base is for-
matted in the same way.
     We assume chat the data base has been arranged to include the de-
sired conditions.  As discussed in Section 2,  the data-sorting procedures
within SPSS can be used to stratify the data according to any parameter
(e.g., meteorological class,  emissic •<- ciass).  Because it is often
desirable to conduct the statistical test for  each station, we have
included provisions within some of the programs to sort the data by sta-
tion.  Such provisions are discussed for the specific test in question.
     Also, it is important to realize that in some cases the software may
be somewhat specific to the test data base and the features of the NCC
system.  We feel that these cases are minimal; however, we do point out
these areas in our discussion or by comments in the code itself.

ACCURACY SCORE (STATOl.ACSCOR)
     The accuracy score is the recommended "final evaluation statistic."
It consists of eight separate statistical tests, which are computationally
quite simple.  The tests are fully described in Volume 2.  Their equa-
tions are briefly summarized in Figure 6, which is a reproduction of a
portion of a terminal session.
                                   16

-------
ft SELECT

      1.

      2.

      3.
5.
b.
7.
     LIME TEST  JIEAM SOU APE  EHROP  ...
     E  s (1 ,0/'l)*(Slif/'( (DC( ! )/PC( 1 ))**2) )      ivHhPL  1=1
     ABSOLUTE  EHHUP THPESH>Ll<  ...
     E  = ( ) ,0/N)*f SOM(C( I) ) )                   wHEkE  1=1
         /.HKPfc  C([J =  f,         IF  AbS(OC(J)-PC( I ) Kl'E.L
         xWPt.  C(l) =  1         IF
     PERCENTAGE F.RHT^  IHHrShCHO
     •-MERE C(I)  =
     .vHtPt C(J)  =
                                      11-  ABS( (OC(I )-PC( I ))/OCCn
                                      IF  APS((OC( J )-PC(i)
E =  (1 .0/fO*(6'J^(C(l ) ) )
         f. C(I)  = 0
    AHFRE C(i)  = 1
ASYM^EIF 1C HIG'-i-rcu LOSS
E = (1 .0/M)*( Sl".'(C( 1 ) ) )
         E C(I3  = LI
                CU) = I?
                            IF PC (I ) .GT.
                            Af«b flC( I ) .LT
                            IF l-C(I ) .LT.NURM
                            A^o ucu ) .Gr
USEP  SDPt-LIF?  IDSS "ATPI>  ...
E =  (1 ,0/\i) *(J?UM(C( 1 J ) )
           C( I )  = LU,K )
         E PC(1)  = J  Af D  f'C(U  =  K
         CONC*- *" rpAl lOu  Li'CATiLr1  ...
E =  (l.lV'O*(Sjr-'('Hl ) ) )
                                                       /HI: Ft 1 =
                                      1J-  PC(J)  AND bC ( I ) . Lt . u
                                      IF  PC(1)  AM? HC( U .GT.i-.
                                      IF  OTHhhwlSL.
                                                 ivhtHfc  1 = 1
                                                     E4
                                                 v-i'EHF  1 = 1, N
                                                      wriFPE 1 = 1
                                                      i-.HEPF D(I
                                                                  .E.2
                                                                E3
                                                           , N
                                                           )=DISTANCE
                    Figure 6. Accuracy score equations.
                                17

-------
     The program is sufficiently simple that it lends itself to  interac-
tive operation, permitting the user to exercise several options, as
follows:
     •  Modify constants within six of the eight tests.   (The other  two
        tests involve no such constants.)
     •  Perform the test for the combined  data from all monitoring sta-
        tions or from each of the stations, or from any selected station.
     •  Analyze any file in the correct format and order.
     •  Choose tutorial or brief-prompting interactive modes.  (Figure 6
        is an example of the summary printed in the tutorial mode.)
     •  Select any or all the statistical  tests.
     •  Display the accuracy score on a rudimentary map.  (For illustra-
        tive purposes and subsequent application with the RAPS data base,
        a St. Louis map was selected.)
Program Logic
     The logic of the program structure is illustrated in the flow chart
of Figure 7.  The FORTRAN V code is given in Section 1 of Appendix C.   To
simplify relating the flow chart to the source listing, we give the line
of the code next to the logic blocks in Figure 4.
     Summarizing the logic of Figure 7, we note that the first operator
entry is the number of data points and monitoring stations.   Knowledge of
the number of data points enables us to eliminate computer-specific end-
of-file checks or the need for inserting special identifiers indicating
the end of the data.  The number of stations is obviously well known.
The number of data points will be known after prescreening the data.
(The SPSS data-display software will list the size of the data base.)
The next interaction requires the user to select whether the tests will
be conducted on the entire data base, or for all or any one of the moni-
toring stations.  If tests are to be done for each station, the user has
the option of displaying the results on a geographical map, assuming a
Tektronix 4014 terminal is available.
                                   18

-------
                 (000163)
                   ENTER NUMBER OF DATA
                     LINES AND STATIONS
                           SELECT
                        INTERACTIVE
                            MODE
                   SELECT DESIRED TEST(S)
 TEST NUMBER   1   2
                i   !
                            ENTER TEST-SPECIFIC
                        THRESHOLDS AND CONSTANTS
                        .....
                 I—J—i	L__ 4—i	i—
                     (000746)
                                     YES
                               NO
                     (000752)
                            NEW
                            MODE
                              7
YES
                                NO
                     (000756)
                                     YES
                               NO
                            END
Figure 7.  Flow diagram for the accuracy-score program.
                      19

-------
     Prior to opting for a graphical display,  the  user must  enter  the
data base either directly or by attaching a file.   Using FORTRAN V and
Exec 8, the user can attach the test data base during the interactive
session by simply entering

                      @ADD M21ADO*STAT01.COQS2N

Once the data base has been entered, the user  must then choose  between
the tutorial (detailed) or abbreviated modes.   This is followed by a
choice of the desired test(s).   (As discussed  later, there are  options
for changing constants within most tests.)
     The program now proceeds to perform the simple calculations specified
by the user.  After the results have been printed, the program  checks  to
see if the map option was selected and computations were made.   If these
conditions are met, accuracy scores are then plotted on a geographical
background map of St. Louis, on a Textronix 4014 terminal (see  Figure  8).
     After all of the output is presented, the user is given the option
of continuing the session by selecting another test, mode, or data sort.
The user may choose to conduct the same test with  different constants.
In this case he would respond "yes" when asked "Would you like  to try
another mode?"  He would then opt for the same test and have the chance
to choose different constants.   Definitions of constants for each test,
along with typical values for the test data base,  are given in  Table 1.

Sample Session
     The first part of the terminal session is illustrated in Figure 9.
As shown, the user must answer questions on the number of data  points  and
stations, the sort code, and the mode code.  Prior to entering  the mode
code, the user must enter the data base.
     The mode code determines the degree of detail in future interaction.
If mode-code 1 is entered, the most detailed messages are printed.  The
next message, after mode selection, will be a listing of the tests and
                                   20

-------
Figure 8.  Results of Test 1 displayed on a map of St.  Louis.
                            21

-------
         *****  STAIJS1ICAL  'IFChMyibLS FOR  EVALUATING MODELS  *****


 « ENTER  THE N(j. OF DATA  (ND)  AMJ THE NO.  UF  "MjNITOPlMG  STATIUM5 (MS)

>101 3

 it SELECT A  DATA SORTING  CODE  |VO. F PON1  1HE FOLLOWING  ...

     -1,    EXECUTE TESKS)  ON  DAIA FOH  LACH STATION.
      0,    EXECUTE TESI(S)  ON  DATA FOP  ALL STATIONS.
      N,    EXECD1E TESI(S)  ON  DATA FOF  THF NIH STATION  (WHERE f. = l,fv&)

 i sot0

 # F.NTEP  ND  LINES OF THE  FOLLG,MfjU DATA  ...

     1.   DATE  (Yf-MQDA)
     2.   Tli'E  (HP«*N)
     3.   MONITOP1NG SITE  NO.
     4.   OPSFRVED VALUE
     S.   PREDICTED VALUE

>£ADD SrAT01.COOS?fJ

 It SELECT ONE  ^ODt. NO. FROM THF. FOLLOWING  ...

     1.   DETAILED-PUN  (FOP  UN-INITIATED  MSFPS)
     2.   yUlCF-RUN (FOR IMTIATF.D USERS)
 » MODE CODF?

 1

 * SELECT  ONE  TEST NO. FROM  THE  FOLLOWING  ...

                   Figure 9. First part of the accuracy score session.



  equations (See Figure 6).   In Figure 10,  a  sample  of the  remaining part

  of the session is given.  (Test  7  was arbitrarily  selected  for  illustra-

  tive purposes.

       A sample session for  mode-code 2 is  given  in  Figure  11.  Note that

  we have  the ability to specify any group  of tests  (by a series  of 1's and

  O's).  The program then proceeds to conduct the tests, interacting and

  outputting results as shown.
                                    22

-------
          TABLE  1.   DEFINITION OF USER-ENTERED VALUES
                   FOR THE ACCURACY SCORE TEST
Test
3
4
5
6

7
8
Constant
El
E2
E3
(NORM)
E4
(NORM)
LI
L2
CMAX
Description
Error threshold
Percentage error threshold
Concentration cutoff
Concentration cutoff
Overprediction loss
Underprediction loss
Loss matrix
Anticipated maximum concentration
Distance matrix
*
Test Value
50
0.2
400
400
1
2
t
STAT01.ERRLOS
1000
STAT01.DISTAN
^Suggested test values  for  the test data base,  STAT01.COQS2N.
 Test elements in file  STAT01.
NOTE
                     . TESTS  IS  VALID ONLY FOR SORT  CODE -1.
    #  TEST CODE?
      SITE ALL,  TEST1: MEAN ABSOLUTE ERROR IS    .458+02

              95% CONFIDENCE  INTERVAL:   .384+02 TO     .532+02

    /'  WOULD YOU  LIKE TO TRY ANOTHER TEST ... TYPE YES  OR  NO.

  >NO

    WOULD  YOU LIKE TO TRY ANOTHER  MODE  ... TYPE YES OR NO.

  >YES

    f  MODE CODE?

          Figure 10.  Accuracy score session  (MODE CODE = 1).

                  See Figure 9 and then Figure 6 for the first part of the session.
                                 23

-------
 /MODE CODE?

>2

 ^SELECT T¥.S~ NOS. WITH A SERIES OF  1  (YES) AND  0(NO).

    1.  MEAN ABSOLUTE ERROR.
    2.  MEAN SQUARE ERROR.
    3.  ABSOLUTE ERROR THRESHOLD.
    4.  PERCENTAGE ERROR THRESHOLD.
    5.  SYMMETRIC HIGH-LOW LOSS FUNCTION.
    6.  ASYMMETRIC HIGH-LOW LOSS FUNCTION.
    7.  USER SUPPLIED LOSS MATRIX.
    8.  MAXIMUM CONCENTRATION LOCATION.

>1 0101010

   SITE  01, TEST1:  MEAN ABSOLUTE ERROR  IS     .858+02

           85% CONFIDENCE INTERVAL:     .633+02 TO       .109+03

   SITE  02, TEST1:  MEAN ABSOLUTE ERROR  IS     .280+02

           95% CONFIDENCE INTERVAL:     .215+02 TO       .345+02

   SITE  03, TEST1:  MEAN ABSOLUTE ERROR  IS     .232+02

           95% CONFIDENCE INTERVAL:     .191+02 TO       .272+02

 #TEST3, ENTER El:

>25

   SITE  01, TEST3:  \BSOLUTE ERROR  THRESHOLD IS   .765+00

           95% CONFIDENCE INTERVAL:     .695+00 TO       .835+00

   SITE  02, TEST3:  ABSOLUTE ERROR  THRESHOLD IS   .364+00

           95% CONFIDENCE INTERVAL:     .230+00 TO       .497+00

   SITE  03, TEST3:  ABSOLUTE ERROR  THRESHOLD IS   .294+00

           95% CONFIDENCE INTERVAL:     .204+00 TO       .385+00

 /'TEST5, ENTER E3:
              Figure 11. Accuracy score session (MODE CODE = 2).
                                24

-------
Program Structure
     The program (software)  structure is given in Figure 12.   (The  Exec  8
control statements  that  "map"  or link the subroutines are contained in
file STAT01.MAPIT.  A  listing  is given in Section 2 of Appendix  C.) As
shown in Figure 12, the  main program, STAT01.ACSCOR, calls  for statistical
subroutines, STATOl.TESTS  and  STAT01.CONLIM, and, as a user option,
plotting-routine SRI*SRI.RAMMAP.  This plotting routine calls  two FORTRAN
subroutines, SRI*SRI.BOX and SRI*SRI.HEADER, a special RAPS utility,
RAPS*UTILITY.COMPOZ, and the standard Tektronix software, GRAPH*TEKTRONIX.
                              MAIN PROGRAM
                            M21 ADO*STAT01 .ACSCOR
1

DATA ELEMENTS
M21 ADO*STAT01 .COQS2N
M21ADO*STAT01.ERRLOS
M21ADO*STAT01.DISTAN

MAir
                            MAIN PLOTTING ROUTINE
                               SRI'SRI.RAMMAP
I
TINE


STATISTICAL SUBROUTINES
M21ADO*STAT01. TESTS
M21ADO*STAT01.CONLIM
                 SRI*SRI.HEADER   I-*
SRfSRI.BOX
               RAPS'UTILITY.COMPOZ
               Figure 12. Software structure for the accuracy score program.

     The data elements  in STATOl are available as a user option  for
testing the software.   The first,  COQS2N, is the test data base  previ-
ously described.  The second  element, ERRLOS, can be used in Test  7  as
the user-supplied loss  matrix,  while the third, DISTAN, can be used  in
Test 8 as the distance-loss matrix.   These data elements are further
discussed in the next subsection,  Data Entry.
                                    25

-------
     The programs are written in the FORTRAN V language.   The main pro-
gram and statistical subroutines are written for general  application on
any computer.  The plotting programs, however, do use some specialized
software (e.g., RAPS*UTILITY.COMPOZ).  Also, the map is specific to the
St. Louis area and the RAPS monitoring locations.  Therefore, when apply-
ing the accuracy score programs to other geographical areas, one must, of
necessity, write new plotting software for the specific area in question.
     The primary function of the main program, STAT01.ACSCOR,  is to con-
trol the interaction between the user and the computer.  This  interaction
includes the data entry, which in turn controls which of the eight tests
will be conducted, in addition to all the other user-specified  options.
The statistical calculations are performed within the subroutine contained
in STAT01.TESTS.  (The subroutines are listed in Section 3 of Appendix C.)
This subroutine has a separate entry point for each of the eight tests.
Shortly after calling the TESTS routine, the main program calls
STAT01.CONLIM, which performs the key confidence-interval calculations.
     The mapping subroutine, RAMMAP, is called at the user's option.
(Refer back to Figure 8 for an example of the output display.)   Most of
the plotting is controlled in the RAMMAP routine, listed  in Section 3 of
Appendix C.  The program contained in SRI*SRI.HEADER annotates  the plot
by producing the small box and test shown in the upper^right-hand corner
of the plot.  The RAPS*UTILITY.COMPOZ routine retrieves the date and time
information displayed by the HEADER program.  The SRI*SRI.BOX  routine,
called by both RAMMAP and HEADER, is used to draw frames  around the map
and header.  All the above routines are listed in Section 3 of  Appendix  C.

Data Entry
     Some of the information on data entry has just been  described.
As stated, the user, upon interrogation, must enter the number  of data
points and monitoring stations.  The other interrogations also  involve
entry of one or two variables, as described in Table 1.
                                  ,26

-------
     The data base to be tested is requested during the session by the
p romp t:
               # ENTER ND LINES OF THE FOLLOWING DATA...
                    1.  DATE (YRMODA)
                    2.  TIME (HRMN)
                    3.  MONITORING SITE NO.
                    4.  OBSERVED VALUE
                    5.  PREDICTED VALUE
The contents and format of the test data base is given in Table 2.  (See
Appendix A for the listing of the test data base.)  While the ISTC, IWSC,
and IWDC parameters are not used within the program, we must allow for
them when entering our data.  Using the first line of data in Appendix A
as an example, we could format the first line of our data entry at the
terminal as follows (where the three consecutive 2's are arbitrary but
necessary for formatting purposes):
                   741012,0900,1,2,2,2,309.7,322.8
          TABLE 2.  DESCRIPTION AND FORMAT OF TEST DATA BASE
Item
1
2
3
4
5
6
7
8
Name
IDATE
ITIME
ISITE
ISTC
IWSC
IWDC
OCS
PCS
Format
16
14
11
11
11
12
F5.1
F5.1
Description
Calendar date--YRMODA
Time, 0000-2300
Monitoring station number, 1-3
Stability class, 1-6
Wind speed class, 1-6
Wind direction class, 1-16
Observed concentration
Predicted concentration
                                   27

-------
The above format would be repeated for each set of comparisons ("ND"  lines
total).  For data entry, the user has the option of attaching a data  base
in an existing file or entering the data base during the session.   In the
former case, as previously stated, a data base can be attached by entering
a statement such as:

                     @ADD M21ADO*STAT01.COQS2N   ,

which will enter our test data base.  Alternatively, we can enter data
as specified by the "READ" statement (see lines 000185, 000215, and so
forth, of the ACSCOR code):

    READ(INP,3)IDATE(I),ITIME(I),ISITE(I),ISTC,IWSC,IWD,OCS ,PCS !

where the first three parameters (IDATE,ITIME,ISITE) and last two para-
meters (OCS,PCS) are specified, and dummy variables are entered for
ISTC, IWSC, and IWDC.
     After data are entered, each record is examined to ensure that the
observed and predicted concentrations are valid (or missing).  Invalid
data are designated as such by negative numbers.  The ACSCOR program
checks to see if either of the concentrations  is negative (e.g., see
line 000190).  It negative, the data are not used in the calculation.
     The remaining  input data are entered as shown  in the sample inter-
active sessions (see Figure 9).  Usually, each query involves the input
of one or two numbers, but there are two exceptions, Test 7 and Test 8.
     When Test 7 is specified, the program will request a user-supplied
loss matrix.  As the program now stands, this  is a  5 by 5 loss matrix
that can be entered directly during the session or  by attaching a file.
For instance, our test file (see the listing in Section 4 of Appendix C)
can be entered by:

                     @ADD M21ADO*STAT01.ERRLOS
                                   28

-------
Alternatively, we could directly enter five data lines, or rows
(J = 1 to 5), each with five loss indexes (K = 1 to 5).  Each index is
a loss associated with predicting concentrations in class J while observ-
ing them in class K.  (The loss is usually set to zero when J = K).
     As shown in line 000627 of the ACSCOR program, the loss matrix is
read into the AS array.  This corresponds to five evenly divided cate-
gories of predicted and observed concentrations.  The categories J and K
are calculated in lines 000059 and 000061 of the TESTS program.  Note
that 5 and 0.2 (1/5) determine how many categories are entered.  CMAX is
the user-entered expected maximum concentration (see Table 1).  The num-
ber of categories can be respecified by changing lines 000059 through
000062 and the size of the AS array in the ACSCOR and TESTS programs.
     For Test 8, the distance-loss matrix is currently specified as a
3 by 3 array because there are three stations.   When asked for the
distance-loss matrix, the user can attach the existing file (see Section
4 of Appendix C) by entering:

                     @ADD M21ADO*STAT01.DISTAN

Alternatively, the user can enter three rows (J = 1 to 3), each containing
three loss indexes (K = 1 to 3).  The resulting matrix should be symmetric.
Each index in the matrix is a loss associated with predicting the maximum
concentration at one location, J, while observing it at another, K.
(The loss is usually set to zero when J = K.)  This information is read
into the DD array (see line 000703 of the ACSCOR program).  The number
of monitoring stations previously entered determines the required size
of the entered matrix.  The DD array needs to be dimensioned so that the
number of rows and columns equals the maximum number of monitoring sta-
tions.   (Even though a 3 by 3 matrix is sufficient, the DD array is  cur-
rently dimensioned by a 5 by 5 matrix in the COMMON statements labeled
DAT.)  The above changes are all that are required to adapt the program
for inclusion of additional stations.
                                   29

-------
RESIDUAL TIME SERIES (STAT02.TIMSER)
     The residual time series program is an "intermediate evaluation
statistic" used to detect cyclical components in the data.   An unbroken
sequence of observed-predicted concentration pairs is required.   Missing
concentration values are accepted by the program if flagged in sequence
with a negative number.  The output is entirely graphic, so it is assumed
that a Tektronix 4014 terminal will be used.  There are two graphs dis-
played for each station.  The first, shown in Figure 13, is a plot of the
autocorrelation function against time lag (in user units which equal the
concentration averaging time).  The second, shown in Figure 14, is a plot
of the cumulative periodogram.  These plots are generated for each moni-
toring station of interest.
     From a programming standpoint, the logic is quite simple because it
contains few options.  The program structure for the Residual Time Series
Program is shown in Figure 15.  Execution of the program and data entry
are controlled by the Control Element, M21ADO*STAT02.CASEl.  (Parameters
within the Control Element may be varied to specify different options or
data.  Hence, we refer to CASEn in Figure 7 because there are many varia-
tions.  However, the structure remains the same.)  As shown in the listing
for CASE1, Section 1 of Appendix D, the first line specifies the execution
of the program contained in M21ADO*STAT02.TIMSER.  Execution for CASE1
is begun by entering on the Tektronix terminal:

                     @ADD,L M21ADO*STAT02.CASE1

Execution of the TIMSER program will then begin, with the data beginning
in line 000002 being read in under program control.
     The mapping of the subroutines required by the TIMSER program is
shown in Section 2 of Appendix D.  The source listing for the main pro-
gram, TIMSER, is given in Section 3 of Appendix D.  The main program per-
forms all the calculations, most of the plotting, and the data entry.
                                   30

-------
o
Ul



                                                                                                      o
                                                                                                      
                              LD
                                                                       LT)
                                                                                  o



                                                                                   I
            Figure 13.  Display of the autocorrelation function for Station  1  of the test data base.
                                                     31

-------
e»F-<


ov-

-------
             CONTROL ELEMENT
            M21ADO*STAT02.CASE
   MAIN PROGRAM
M21ADO*STAT02.TIMSER
               DATA ELEMENT
           M21 ADO'STATCH .COO.S2N
PLOTTING SUBROUTINES
 M21 ADO*STAT02.SETUP
                                              AUXILIARY PROGRAMS
                                              M21ADO*STAT02.USESET
                                                  SRI'SRI.BOX
                                                 SRI*SRI.HEADER
                                              RAPS*UTILITY.COMPOZ
                 Figure 15. Program structure for the residual time series.

     Referring to the TIMSER  listing,  we  see that comment  statements
(lines 000041  through 000081)  are  used to define the input data  require-
ments and  program options.  The corresponding READ statements  are imme-
diately before and after the  comment statements.  The input  data will be
read line  by  line, starting with  line  000002 of the Control  Element,
Section 1  of Appendix D.  The  data  base  for observed and predicted con-
centration is  specified in line 000011, our COQS2N test data base.  Alter-
natively,  other elements could be  specified or, as discussed earlier on
page 27, the data could be specified directly, starting in line  000011
and continuing for ND lines.
     The format requirements  of the  TIMSER program for  data  input are
identical  to  those of the other programs.  However, the time sequence of
the data is important.  In general,  the data should be  read  in equal,
                                    33

-------
ascending time intervals.   When a data base contains more than one site,
then for each time period one data record per site must be presented.
After the record for the last site, the records for the next time period
should follow, starting with the first site.
     Referring to the TIMBER listing, we see that the data are read on
line 000092.  The next two lines of code check to see if the data fall
within the specified timeframe (see line 000082).  After more time and
data checks, the program computes the parameters of the residual time
series, starting in line 000119.  The calculations for the autocorrela-
tion function begin at line 000121; its values, ACF(K) are computed on
line 000159.  The calculations for the normalized cumulative periodogram
begin on line 000209; its values, CNP(J), are computed on line 000231.
     The principal subroutine, SETUP, controls plotting of the axis and
some of the annotation.  In turn, it calls the HEADER, BOX, and COMPOZ
subroutines (described earlier).  The listing for SETUP is given in Sec-
tion 4 of Appendix D.

CHI-SQUARE GOODNESS-OF-FIT (STAT03.CHIFIT)
     The chi-square goodness-of-fit program can be useful as either an
intermediate or a final evaluation statistic.  As was the case for the
residual time series program, the output is completely graphic.  So a
Tektronix 4014 terminal must be used.  The output consists of two dis-
plays, each containing two plots.  The first output display, Figure 16,
consists of histograms for both the observed and predicted concentration
data sets; the second output display, Figure 17, consists of histograms
of the difference between observed and predicted concentrations, absolute
and percentage.
                                2
     The chi-square statistic, X  , and the number of samples, N, are
printed in the lower-right-hand corner of the second plot.  (The statis-
      2
tic, X  , is simply the summation of the square of the observed and pre-
dicted concentration differences divided by the observed concentration.)
                                   34

-------
r^i»*i
 UIN
 ox ~
 LU
  I
 U.
 O
  I
 V)

 UJ
 z:
 o
 o
 o
UJ
a:



    ot
    I-
    U")
    I-H
    o
     a:
     ui
     CD
     ca
     o

                                       ru
                                             z
                                             o
                                            UJ
                                            o
                                            z
                                            o
                                            o
                                 -    o
                                   
                                                           Z)
                                                           CO
                                                           V)
o
UJ
I-
o
t-t
o
UJ
QC
Q-
                                                                                              D
                                                                                                  
-------
OJ

UJ


«

cu
                                                             Ul
                                                             o

                                                             o
                                                             o
                                        «
                            cu
                             ru
                              i
                   Figure 17.   Histogram of concentration residuals for the test data base.
                                                    36

-------
     The  program structure  for the chi-square  program is shown  in
Figure  18.   The Control Element is used to execute the program  and supply
the requisite input data.   To  initiate the program from the Tektronix
terminal,  the user gives  the Exec 8 command  (see listings  for the Control
Element in Section 1 of Appendix E):

                    @ADD,L M21ADO*STAT03.CASE1

Note that the first line  specifies execution of the program
M21ADO*STAT03.CHIFIT.  Its  elements are shown  in the mapping routine,
listed  in Section 2 of Appendix E,
            CONTROL ELEMENT
           M21 ADO*STAT03.CASE
   MAIN PROGRAM
M21ADO*STAT03.CHIFIT
             DATA ELEMENT
          M21 ADO'STATOI .COQS2N
PLOTTING SUBROUTINE
M21ADO*STAT03.HISTO
                                             AUXILIARY PROGRAMS
                                             M21 ADO*STAT03.SETUP
                                                 SRI*SRI*BOX
             Figure 18.  Structure of the chi-square goodness-of-fit program.
                                    37

-------
                                                                 2
     The main program, CHIFIT,  controls the data flow,  computes  X ,
divides the data into categories,  and computes the frequency  of  occurrence
in each category.   The listing  for CHIFIT is given in Section 3  of Appen-
dix E.  The input data for CASE1 starts in line 2 (Section 1, Appendix E).
Each line corresponds to a READ statement, the first of which appears  as
line 000043 of CHIFIT.  The last READ statement (line 000073) specifies
the entry of the concentration  data base.  (For CASE1,  our test  data base
STAT01.COQS2N is specified.) Each read-in parameter is defined  in  the
listing for CHIFIT (lines 000023 through 000042 and lines 000055 through
000066).
     The four frequency distributions are calculated within CHIFIT,
beginning in lines 000087, 000113, 000132, and 000142.   The X2 sta-
tistic is calculated along with the last distribution (CHI2 in line
000148).  After the second and  fourth distributions are calculated,  the
dual histograms are plotted by  calling subroutine HISTO, whose listing
appears in Section 4 of Appendix E.
     Within the HISTO subroutine,  subroutines SETUP and BOX are  called
(see Section 4 of Appendix E).   Subroutine SETUP performs some of the
standard functions used in all  histograms, such as framing the plots and
partially annotating the graphs.

BIVARIATE REGRESSION AND CORRELATION (STAT04.REGANA)
     The bivariate (linear) regression and correlation program is most
often used as an intermediate evaluation statistic.  The graphic output
consists of a scatterplot with  options to display the least-squares  fit,
probability and confidence limits, and "sensitivity" bounds.   (The  util-
ity of the options is described in Volume 4 of this report.)   As for the
two previous programs, this program must be executed on a Tektronix  4014
terminal.  An example of the program output is given in Figure 19.   Note
that the correlation coefficient,  regression coefficients, and number  of
samples are displayed in the lower-left-hand corner of the plot.
                                   38

-------
OJ
 I
uJ  o



o  ~

 *  «-H



V)  ^

^_l


                                                                            il
                                                                                               i  i
                                                                             ii:
                                                                                     ri
                                                                                    OJ
                                                                         
     U3
O
U)
                                           n
                                                       OJ
                                                                                          •or-w*
            Figure 19.  Scattergram with least-squares, confidence, and probability lines.
                                             39

-------
      The program  structure for the bivariate  regression and  correlation
 program (REGANA)  is  shown in Figure 20.   Execution of the program and
 data entry are controlled by the Control  Element M21ADO*STAT04.CASE6.
 (This particular  CASE  results in the  plotting of confidence  and proba-
bility limits about the regression line, as  shown in Figure  19.)  The
 listing of the CASE6 Control Element  is given in Section  1  of Appendix F.
           CONTROL ELEMENT
          M21 ADO*STAT04.CASEn
   MAIN PROGRAM
M21ADO*STAT04.REGANA
            DATA ELEMENT
         M21 ADO*STAT01 .COQS2N
      STATISTICAL SUBROUTINES
       M21 ADO*STAT04.LINLSQ
        M21ADO*STAT04.STAB
                                   AUXILIARY
                              PLOTTING SUBROUTINES
                                 SRI'SRI. HEADER
                                  SRI*SRI.BOX
               Figure 20. Structure of the regression and correlation program.


 Execution  is  begun by the command:

                      @ADD,L M21ADO*STAT04.CASE6

 This will  cause the REGANA program to be executed, with the data begin-
 ning in  line  000002 being read  in  under program  control.
                                     40

-------
     The mapping of the subroutines required by the REGANA is shown in
Section 2 of Appendix F.  The source listing for the main program is
given in Section 3 of Appendix F.  The main program controls the entering
of data, calling of statistical subroutines, and plotting of scattergrams,
regression lines, and confidence limits.
     Referring to the REGANA listing, we see that comment statements
(lines 000023 through 000045 and lines 000060 and 000071) are used to
define the input data requirements and program options.   The corresponding
READ statements start in line 000046 and culminate in line 000076.  (These
two lines correspond to the data given in lines 000002 and 000017 in the
CASE6 element.)  In line 000103, REGANA calls the LINLSQ subroutine,
which computes all the statistical parameters of interest.  The program
then proceeds to plot the scattergram (line 000138) and limit lines,
depending on the options (the ICODE parameters).
     In plotting the scattergram, the program distinguishes among the
site codes (ISITE) for each of the three stations in the test data base.
They are stored in three separate arrays--(Xl, Yl), (X2, Y2), and
(X3, Y3)—and plotted with different symbols.  The logic starting in line
000081 and ending in line 000096 determines that the array suffix cor-
responds to the monitoring station number.   The actual plotting of the
arrays is programmed in lines 000216, 000224, and 000228.
     The parameter ICODE determines which,  if any, of the regression or
limit lines will be plotted on the scattergram.  The READ statement for
ICODE is in line 000048.  (For our example, the data are contained in
line 000003 of the CASE6 element.  The first parameter, "6", is ICODE
for this case.  The second parameter specifies that the X and Y axes will
be linear.)  The logic starting in line 000232 shows how the ICODE value
controls the six different options available to the user.
     The ICODE options are defined in the comment statements (lines
000027 through 000033).   Specification of ICODEs of 3 through 6 causes
statistical subroutines to be called.  Subroutine LINLSQ, which is called
for all ICODEs, is used somewhat differently when an ICODE of 3 is
                                  41

-------
specified.   Note that after sensitivity bounds  are  calculated  (lines
000116 to 000124), the LINLSQ program is called (line  000134)  for  only
those points falling outside the sensitivity bounds.   (Note  the  sensi-
tivity bound check in line 000129.)   The significance  of this  calculation
is discussed in Volume 4.
     For ICODEs of 4 through 6,  the  FORTRAN function routine,  STAB,  is
called in line 000256.  (See Section 4 of Appendix  F for a listing of
STAB.)  STAB assists in computing the 90 percent confidence intervals
using Student's t-distribution read  into the TAB array.
     The subroutine LINLSQ, called in line 000103,  computes most of  the
statistical parameters of interest.   The listing for LINLSQ is given in
Section 4 of Appendix F.   The label  COMMON LSQ  contains  most of the
parameters of interest, as follows:
     RECNOP - reciprocal of the  number of samples
     A      - constant in the regression-line equation
     B      - X coefficient in the regression-line  equation
     XSD    - standard deviation of  observed concentrations
     YSD    - standard deviation of  predicted concentrations
     CIL    - lower 95 percent confidence limit for the  correlation
              coefficient
     CIU    - upper 95 percent confidence limit for the  correlation
              coefficient
     SXMXB  - square of the accumulated differences between the actual
              and mean observed  concentrations
     RC     - estimate of Pearson's  Correlation Coefficient
     RMSE   - root-mean-square error
     BSD    - estimated standard deviation of predicted  concentrations
              about the regression limit
     XBAR   - average observed concentration.
Not all the above parameters are used in subsequent calculations by  the
main program REGANA.  However, they  are useful  statistical parameters
that can be displayed as an option.

-------
INTERSTATION ERROR CORRELATION (STAT05.COREL2)
     The interstation error correlation (COREL2) test computes the corre-
lation coefficient between the residual concentration (observed minus
predicted concentrations) at different monitoring stations.  The output
consists of two matricies.  The sample output for our test data base,
COQS2N, is shown in Figure 21.  The first matrix is the correlation coef-
ficient between each of the true stations in our data base.  The second
matrix shows the upper and lower 95 percent confidence limits for the
correlation coefficients.
               CORRELATION  MATRIX  ...
               Silt      1      2      3
                 1     1.00    .78    .75
                 2      .78   1.00    .74
                 3      .75    .74   1.00
                                 r.MCK  Ll'-UTS W
               SITE       1      2      3
1

2

3

L
U
L
U
L
U
1 .00
1.00
.bO
.89
.54
.87
.60
.89
J .00
1.00
.5;
. ^ "'
.•34
.47
.5;
.*7
1 .;)">
1 . 0('
                    Figure 21. COREL2 output for test data base.
     Figure 22 displays the structure of the COREL2 program, whose sub-
routines are shown mapped in the listing contained in Section 1 of Appen-
dix G.  The main COREL2 program (listed in Section 2 of Appendix G) con-
trols data input and output and calls the statistical subroutine XYCORR,
which controls the calculation of the correlation coefficient.
                                  43

-------
              MAIN PROGRAM
           M21ADO*STAT05.COREL2
               SUBROUTINE
           M21ADO*STAT05.XYCORR
                                                 DATA ELEMENT
                                             M21 ADO* ST AT01 .COQS2N
               SUBROUTINE
           M21ADO*STAT05.LINLSQ
             Figure 22. Structure of the interstation error correlation program.


     The input  parameters (parameters are  defined in lines 000016  through
000030) are entered  as specified by the READ  statements in lines 000033
and 000046 of  the  main program.  The  first input requires the  number of
data points, the  number of stations,  the option code, and the  first and
second monitoring  station numbers.  For our test data base, if we  want
the comparisons for  all three stations, the following input would  be
entered:

                              101,3,2,1,2    .

The next read  statement requires 101  lines of input data in the  pre-
scribed order.   Using  our test data base,  we  would enter:
                            M21ADO*STAT01.COQS2N
                                    44

-------
Entering our input data in this order will produce the output shown in
Figure 21.
     The subroutine stored in M21ADO*STAT05.XYCORR computes the residual
concentrations for each monitoring station.  As shown in the listing
(Section 3 of Appendix G), XYCORR computes the DC1 and DC2 arrays (lines
000013 and 000014) and then calls the LINLSQ subroutine (line 000019).
The LINLSQ subroutine, listed in Section 4 of Appendix F, is the same
one used in the STAT04.REGANA program.

MULTIPLE REGRESSION OF ERROR RESIDUALS (STAT06.SPSSRUN)
     The multiple regression of error residuals, using the meteorological
and emission classes as the independent variables, is an intermediate
evaluation statistic.   Its purpose is to detect the model input parameter
that contributes most to the difference between observed and predicted
concentrations.  These residuals were computed in the STAT06.SPSSDAT pro-
gram described in Section 2.
     The procedure for conducting a regression analysis on the residuals
in SPSSFILE is given in Figure 23.
     The general format of an SPSS program was described earlier.  The
program simply finds the correct file, SPSSDATA, which is contained in
SPSSFILE.  (Using Exec 8, the program automatically looks to Unit 3 for
the desired file.)  Three specifications are found in the field of the
SPSS REGRESSION statement.  The first, VARIABLES, identifies the parame-
ters required.  If any are missing, a diagnostic will be given.  The
second and third specifications are REGRESSIONS.  Each of the REGRESSION
statements identifies the type of regression to be performed.  The first,
RESID with ASC, WSC, WDC (1), specifies the regression of the concentra-
tion residuals on the three meteorological parameters; the second
                                   45

-------
      •aDELETE  PPINT2.
      OASG,PU  PKINT2.
      «ASG,A SPSSFJLF.
      (aUSE  J.,SPSSFTLF.
      068KPT P*1UT$/PH I'M F2
      BSPSS
      KUiM NA^E       TEST  »
-------
                     UJ O O
                      •  •  •
                      I
                                                                       u?  o
                                                                       U?  M
                                                                       1^  O
                                                                        •  •
CI3
                                       o
                                       CO
                                                                                                             f*.  a *
                                                                                                             (N  ^

                                                                                                             o   » ^
»    n ^ a

5    ^gg
                                       CJ
                                       CO
                                       c
                                       o
                                       CO
                                       UJ
                                       cc
                                                                                                       Z    -> »
                                                                                                       •*    -i a

                                                                                                       5    S§
                                                                                    H
                                                                                     c
                                                                                     o

                                                                                    Q

                                                                                    CO
                                       c
                                       o
                                                                                                                           c
                                                                                                                           o
                                       en
                                       0)
                                                                                                                           01
                                                                                                                           0)
 O

 >
 CD
 E
 E

CO
                                                                                                                           O
                                                                                                                           E
                                                                                                                           E

                                                                                                                          CO
                                                                                                                          CN

                                                                                                                           aj

                                                                                                                           D
                                                                                                                           O)
      2
      LJ
      a
                                                                                            X
                                                                                            UJ
                                                                                            CL
                                                                                            LU
                                                                                            o
                                                                      UJ UJ Z
                                                                      r >- o
                                                                      •-« i-l LI
                                                                      *~ IA —
                                                       47

-------
The output for the SCATTERGRAM procedure is given in Figure 26.  Note,
as specified in the SCATTERGRAM field, that the RESID scale adjusts to
the values between the lowest and highest in the file while the ASC scale
is from 3 to 6.  Again, refer to the SPSS manual for a complete descrip-
tion of the SCATTERGRAM procedure.
                                   48

-------
                                                          a
                                                          •
                                                          •
                                                          a
                                                                                                 0

                                                                                                • Q
 " f
if) I

  I

  ;
  :> T
    i
    i
  ; T
-   I
                                                                                                 r
                                                                                                 I o
                                                                                                 I*
                                                                                                I e  S
                                                                                                    3
                                                                                                          a
                                                                                                          o
                                                                                                          oc
                                                                                                          a
                                                                                                          oc
                                                                                                          in
                                                                                                          i-

                                                                                                          <
                                                                                                          CJ
                                                                                                          Q-
                                                                                                          CO

                                                                                                          H—
                                                                                                          O

                                                                                                          _5

                                                                                                          a

                                                                                                          E
                                                                                                          TO
                                                                                                          X
                                                                                                          UJ
                                                                                                          CC
                                                                                                          CM
                                                                                               !  3
                                                  49

-------
                              REFERENCES
1.    "NCC User Reference Manual,"  EPA Contract No. 68-2378 (9 Volumes)
     Systems Research and  Development Corporation, Research Triangle
     Park, North Carolina  (1977).

2.    "Plot 10 - Advanced Graphing  II, User's Manual," Tektronix, Inc.,
     P.O. Box 500,  Beaverton, Oregon  (1975).

3.    "Plot 10 - Terminal Control System,  User Manual," Tektronix, Inc.,
     P.O. Box 500,  Beaverton, Oregon  (1978).

4.    N. H. Nie et al., Statistical Packages for  the  Social Sciences,
     (2nd Ed.) McGraw-Hill Book Company,  New York, New York, 1975).

5.    "System 2000 Reference Manual," MRI  Systems Corporation, Austin,
     Texas .(1973).
                                  50

-------
                  APPENDIX A




LISTING OF TEST DATA BASE M21ADO*STATOl.COQS2N
                      51

-------
iELT.L S1
.COQS2N

EL12G7 SL73R1 11/01/78 09
OOC001
COCC02
COCC03
CO COO*
COLOC5
COOC06
CQGC07
COGCG8
COCCG9
COGC10
C00011
COG012
COC013
IOC014
COC015.
COCC16
COCD17
COCC18
COG019
COC020
C0u021
COC022
COC023
COGC24
COCC25
C00026
COCC27
COCC28
COCC29
LQCC30
COCJC31
COQG32
COGC33
COC.034
COGC35
COC036
CQOC37
C00038
COOC39
COOOAO
COCC41
COCQ42
COC043
COC044
COCC45
COC046
COG047
COCOAS
COGC49
COGC50
COOC51
COC052
COCC53
COC054
COL055
COO
000
DOU
000
000
000
000
000
000
000
000
ooc
JOO
ooc
000
000
000
000
000
000
000
000
000
000
000
000
000
000
000
000
000
000
000
000
000
ooc
000
000
000
000
OOG
000
000
000
000
000
000
000
000
OOCJ
000
000
000
UOG
000
741012
741012
741012
741012
741012
741012
741012
741012
741012
741012
741012
7*1012
741014
741014
741014
741014
741014
741014
741015
741015
741015
741015
741015
741015
741015
741025
741025
741025
741025
7*1025
741025
741024
741024
74 1024
741025
741025
741025
741025
741025
741025
741025
741025
741025
741025
741025
741025
741025
741025
741025
741031
741031
741031
741031
741031
741031

:3S:12
0900
0900
0900
1000
1000
1000
11 JO
1100
1100
1200
1200
1200
10uO
1000
1000
1100
1130
1100
0900
0900
0900
1000
1000
11CO
1100
0800
0800
0800
0900
0900
0900
1000
1000
1000
1100
1100
1100
1200
1200
1200
1300
1300
1300
1400
1400
1400
1500
1500
1500
1700
1700
1800
1800
1800
1900

tc.
1
2
3
1
2
3
1
2
3
1
2
3
1
2
3
1
2
3
1
2
T
1
3
1
3
1
2
3
1
2
3
1
2
3
1
2
3
1
2
3
1
2
3
1
2
3
1
2
3
1
2
1
2
i
1

)
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
5
5
5
5
5
5
5
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
5
5
5
5
5
4


2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
1
1
1
1
1
1


?
2
2
2
2
2
2
2
2
3
3
3
1
1
1
1
1
1
3
3
7
3
T
3
7
2
2
2
2
2
2
2
2
2
2
2
2
2
2
?
2
2
2
2
2
2
2
2
2
^
£
?
T
T
7
7
309.7
130.4
40. £
230.3
1C7.9
66. fc
216.1
70.2
24.9
221.4
97. C
44.4
106.6
39.8
11.1 '
129.3
38.8
8.4
229.6
4C.3
51.6
262.2
30.0
269. C
62. C
477.3
168.9
69.4
464.6
141.2
36.1
411.3
164.2
31. 6
467.2
147.4
43.7
359. C
156.6
73.3
498.8
186.4
71.6
442. C
195.5
40.8
313.1
140.8
48.9
194.7
40.0
206.8
11fc.2
25.9
119.0
322. fc
12V.1
56.6
24£.5
106.2
50.4
239.1
103.2
49.5
283.7
117.1
53.3
198. B
86.6
45.5
192.2
90.4
53.1
584.4
264.7
117.3
457.3
97.6
553.6
112.6
350. 8
137.5
56. 8
393.8
15U.4
62.2
393.8
150.4
62.2
417.7
157.4
64.1
417.7
157.4
64.1
417.7
157.4
64.1
417.7
157.4
64.1
417.7
157.4
64.1
277.3
130.6
491 .1
224 .5
103.0
145.5
52

-------
C00056
COOC57
coucse
COOQ59
COCC60
COCC61
COCC62
COOC63
COCQ64
COCC65
COGG66
COOC67
COC068
COC069
COGC70
COCQ71
COCC72
COOG73
COC074
COCC75
COCC76
COC077
CO CO 78
COCC79
iocceo
C00061
COCC82
COC083
COOG84
C00085
COCC86
COC087
LOC088
COC089
COQC90
COCC91
COC092
C00093
COGC94
COC095
COCC96
C00097
COCQ98
COOQ99
COC100
COC101
000
000
000
000
000
000
OOu
000
000
000
000
000
000
000
000
000
OOu
000
000
ooc
000
000
000
ooc
000
000
000
000
000
000
000
000
000
000
000
000
ooc
000
000
000
000
000
000
000
000
000
741031
7*1031
741031
741031
741031
741031
741031
741031
7411C4
741114
741114
741114
741114
741114
741114
741114
741114
741114
741114
741114
741114
741114
741114
741114
741114
741114
741114
741114
741114
741114
741114
741114
741114
741114
741114
741114
741114
741114
741120
741120
741120
741120
741120
741120
741120
741120
19oO
1900
20GO
2000
2000
2100
2100
2100
C700
0300
0300
0300
0400
0400
0500
0500
0500
0600
0600
0600
0700
0700
0700
0800
0800
0800
0900
0900
0900
1000
1000
1000
1100
1100
1100
1200
1200
1200
0200
02CO
0200
0300
0300
0300
C400
0400
2
T
1
2
3
1
2
3
3
1
2
3
2
3
1
2
3
1
2
3
1
2
3
1
2
3
1
2
3
1
2
3
1
2
3
i
2
3
1
2
3
1
2
3
1
2
4
4
5
5
5
5
5
5
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
1
1
1
1
1
1
1
1
2
2
2
2
2
2
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
1
1
1
1
1
1
1
1
•t
i
i
3
3
•»
3
7
3
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
1
1
1
1
1
1
1
1
73.1
22.6
201.1
77.4
36.6
137. £
137.1
34.3
16.6
331.3
153.4
58.5
140.3
61.4
597.6
170.4
52.1
434.2
157.3
54.6
467. C
146.4
53.3
470.0
163.6
40.8
519. i
134.2
55.7
462.7
170. C
54. 8
454.0
161.6
57.7
538.6
160. S
54.3
72.8
74.6
28.6
65. C
49.5
12.4
37. C
23.0
73.4
41.3
234.1
111.7
61.3
292.5
137.5
71.0
53.7
291.0
119.4
53.9
141. A
59.9
417.7
157.4
64.1
417.7
157.4
64.1
417.7
157.7
64.1
417.7
157.7
64.1
417.7
157.7
64.1
417.7
157.7
64.1
417.7
157.7
64.1
417.7
157.7
64 .1
73.0
40.8
31.9
69 .5
38.7
30.9
6JS.3
37.9
END ELT.
                                   53

-------
                 APPENDIX B




MODIFIED EPA FREQUENCY DISTRIBUTION SOFTWARE
                      54

-------
B.I  Run Stream Example, SRI--SRI.DATAFREQ
" r. 1^ i , 1 1 .->.-/i
0 U 0 u 0 1
OOnoO />
OoOOO 3
UOO-Ji; t
0 0 0 0 <• S
fioOOOb
0 (' 0 0 () 7
G0.'jt<0:i
0 U 0 * ' 0 ^
GO" 0 1 0
GOOUl t
00001 2
00001 3
OOdOl i
0 0 0 0 1 "5
Ot) ">•"> 1 b
OOOOl 7
OOOijl 6
•0000 I 4
0 0 0 0 2 0
0 u 0 0 2 1
00002/>
* K 1 11
;\ M /
• <• 7
no 7
•-/') 7
• i ! ' /
0 ;/ 7
')') /
Ol> i
" ,) 7
•">{; 4
• ;u ^
0 0 i
f<0 /
uO 3
•M' ^
•JO 7
0 0 <
'H'3
1)0 ?
007
0 0 3
00 3
/"I//- ,1V
'•)!,', 1 - -
1 -it / 1
rAl:.) ci'

-1 , -1
1 ] . S , ) ', •
C
'<•<::!' .^^
1 '1 / 1
?Al>0 l^t-

-1 ,-1
1 1 . ^ , " 1
r
' X r i S h
IM / 1
?ii;l> Sr-
\
-t ,-1
1 1 . *> , 1 ( •
C
c
                    hLI.
                                                : v.i: v -  i 7, )
                                                I *.-. t  i . r r i ,
                                                 ^  ! f  -  -3  }
                                                i *.1.^ i .r<.' r-/
                                                   1 • •
                                                 * 5 (•• T . (•' ^ !• '
                                                 4  1 • •  «  .1
                                                 *S(- I .C'",'^
                                     55

-------
B.2  Map of Program, SRI*SRI.MAPFREQ
             •ELT.L
             ELT007
             COOOC1
             COGC02
             COGG03
             COQG04
             COOC05
             C00006
             COC007
             C00008
             C00009
             C00010
             COOQ11
             END  ELT.
S.MAPFREO
SL73R1 11/01/78 09:36:48 (4,)
     DOO   8FOR SRI*SRI.FRE6
     000   SHAP ,SRI*SR1.FRE6
     000   IN SRI«SRI.FREQ
     000   IN SRI*SRI.ORDER
     000   IN SRI*SRI.6RALIN
     000   IN SRI*SRI.GRAPH
     000   IN SRI*SRI.PROB
     OOA   IN SRI*SRI.HEADER
     004   IN SRI*SRI.BOX
     004   IN RAPS'imtlTY.CCMPOZ
     000   SADD 6RAPH*TEKTRON1X.PREVIEU/MAPECL
                                      56

-------
B.3   Listing  of the Main Program, SRI*SRI.FREQ
•ELT.L
ELT307
COC001
COCG02
C00003
COC004
COOOOS
C00006
COG007
C00008
COCQ09
COC01D
CQ0011
COCQ12
C00013
C00014
C00015
C00016
000017
C00018
COC019
COL320
COC021
COC022
COG023
000024
C00025
C00026
COCG27
C00028
COC029
C00030
C00031
COC032
C00033
COG034
COQQ35
COC036
COC037
COC038
OOG039
C00040
GOC041
COG042
COG043
C00044
COCOAS
COC046
COOOA7
COCOAS
COCOA9
COC050
COC051
OOG052
C00053
C0005A
C00055
S. FREQ
SL73R1 11/1
OA9
OA9
OA9
OA9
OA9
OA9
049
OA9
OA9
OA9
OA9
OA9
049
049
OA9
049
049
049
049
049
049
049
049
049
049
049
049
049
049
049
049
049
049
049
049
049
049
049
049
049
049
049
049
049
049
049
049
049
049
049
049
049
049
04V
049

01/7
C P
C M
C P
C M
C T
C T
C t>


C 1

800

500
C Ni
C X
C Y
C Yl
C N
C N
C N
C I
C I
C N
C Ci

801


100
C CI



1








15

25






35


               01/78 09:35:38  (53,)
                  PROGRAM  SRI *SR1 .FPECi
                  MODIFIED  FROM  M 21 A D 0*GMHta Y . FR EQ
                  PROGRAM  FROM  BILL  PETERSON
                  MODIFIED  BY  ROD  ALLEN, COHP-AID INC.,  OCTOBER  1978
                  TO COMPILE  AND PAP  SADD SR I*SR I .MAP F RECi
                  TO EXECUTE  AND DATA SADD.L SR I* SR I . D ATA FRE Q
                  DECLARATIONS
                      DIMENSION  OB(999),PR(999),P!«0<999>,PMODO<999),OPMODO(999>,
                     10PMO<999),OOB(999),FREC(999),X<999),Y(999),YY(999),OPR(999)
                  INITIALIZATION
                      URITE(6,8CG)
                      FORMATC  ENTER  LINE OF CONTROL  PARAMETERS')
                      READ(5,500)  N,IOP,IGRAPH,NLOG,XDIM,YDIM,YBASE,NPLT
                      FORMAT(  )
                  NLOG=NUMBER  OF LOG  CYCLES.
                  XOIPI = X DIMENSION IN INCHES OF PLOT.
                  YDIM = Y DIMENSION IN INCHES OF PLOT. FOR  NPLT=3,  YDIM = 10.
                  YBASE = LOWEST  Y VALUE. FOR NPLT = 3 , YB ASE =-3  ONLY.
                  NPLT, NPLT = 1  PLOT  OB S E R VED ,PR ED ICTE D VS.  CUM.  FREQ.
                  NPLT = 2 PLOT  ABS(PR-OB) VS. CUM. FREQ.
                  NPLT=3 PLOT  (PR-OB)/OB VS. CUM. FREQ.
                  IOP =1, PRINTOUT  OF  TABLE. IOP = 2,NO  PRINTOUT.
                  IGRAPH=1, GRAPH DISPLAY. IGRAPH=2,NO GRAPH  DISPLAY.
                  N= NUMBER OF  DATA  POINTS.
                  COMPUTATION
                      URITE(6T801 )
                      FORMAT!*  ENTER  OBSERVED AND PREDICTED  DATA  VALUES')
                      DO 1  1=1, N
                      READ(5,10C)  OBCI),PR(I)
                      FORHATC33X.2F8.C)
                  CHECK OBSERVED AND  PREDICTED VALUES BECAUSE OF  LOGS
                      IF(OB OB(I) = 0.001
                      1F(PR(I).LT.O.C01) PR(I)=C.C01
                      PMO(I)=PR(I )-OB(I )
                      PMODO(I)=PMO(I)/OB(I)
                      J=MOD(N,2>
                      IF(J.Efi.l) GO  TO 25
                      NN=N/2
                      J=N*1
                      DO 15 1=1, NN
                      FREO(I)=100.*((I-0.4)/N)
                      J = J-1
                      FRE8(J)=100.-FREa(I)
                      CONTINUE
                      60 TO 45
                      CONTINUE
                      NN=(N-1)/2
                      DO 35  I=1,NN
                      FREO(I)=100.*((I-0.4)/N)
                      J = J-1
                      FREQ(J)=1CC.-FREQ(I)
                      CONTINUE
                      J=NN+1
                              = 100.*«J-0.4)/N)
                                       57

-------
GOC056      049   AS     CONTINUE
000057      0*5           00  47  1 = 1,N
COC058      349           FREtt
COOG68      049          DO  55 1 = 1,N
C00069      049          WRITE(6,3CO) I,OB ,OPR (I> ,
COOQ70      049         10PMOCI),OPBODO(I> ,FREQ (I)
000071      049   300    FOR«AT(1X ,13,T5,9(F10.3.3X))
C00072      049   55     CONTINUE
OOOC73      049   56      CONTINUE
C00074      049          IFU6RAPH.E0.2) GO TO 4
COG075      049          CALL PLOTS(BUF,1,14)
C00076      049          CALL HEADER
000077      OS1          CALL SYBBOL(2.,-.8,.14,'CUHULATIVE  FREQUENCY <(Z)'VQ.,24>
COCC78      049          CALL BOX(0,C,1023,780)
COG079      049          IF(NPLT.EQ.3) GO TO 95
C00080      049           CALL GRAPH (XD1H,YDI* ,NL06,YBASE.1)
COC081      049          IFCNPLT.EQ.2) GO TO 75
COOQ82      049   C NPLT=1
COC083      051          CALL SYMBOL(-.5,1.5,.14.'CONCENTRATION* ,90. , 13 )
000084      051          YZ=YDIH+.5
COC085      051          CALL SYMBOL<-.5,Y7 ,.14,'FREOUENCY  DISTRIBUTION  FOR  OBSERVED AND P
C00086      049         1REDICTED  CONCENTRATION',0.,63)
C00087      049           DO  65  1 = 1,N
COOQ88      049           A = FREhU)
000089      049           B=OOB(I)
C00090      049           C=OPR(1)
C00091      049           X(I>=PROB(A)
C00092      049           Y(I)=AL061C(B)
000093      049           YV(1)=AL0610(C)
COC094      049   65      CONTINUE
C00095      049           X(N*1)=PROB(C!.001>
C00096      049           X(N+2)=(PROB(0.999)-PROB(0.001))/XDlM
COC097      049           Y(N»1)=ALOG1C(YBASE)
C00098      049           YY(N+1)=Y(N+1)
COCQ99      049           Y
-------
COG113
COC114
C00115
C00116
COC117
COC118
000119
COC120
COC121
C00122
C00123
C00124
000125
C90126
COQ127
COC128
C00129
C00130
COC131
C00132
C00133
C00134
C00135
C00136
C00137
C00138
COC139
COCUO
COOU1
C00142
COOU3
COC144
COOU5
C00146
COG147
CO I) 148
C00149
C00150
C00151
COU152
C00153
C00154
C00155
C00156
100157
COQ158
L00159
COCUO
C00161
COC162
000163
C00164
052
053
053
049
049
049
049
049
049
049
049
049
049
049
049
049
049
052
049
052
052
052
052
052
052
049
049
049
052
052
053
049
053
053
049
049
049
049
04V
049
049
049
049
049
049
049
049
049
049
049
049
049











85














95
C N












105






C T
999

4

    CALL SYMBOL*-.6,Y7 , .14 , 'FREQUENCY  DISTRIBUTION FOR  RESIDUAL (OBSER
   1VED-PREDICTED)  CONCENTRATION',J.,70)
    IN=1
    DO 85  1=1,N
     A=FREO(0.001)
     X(N + 2) = (PRCB(C.999)-PROB(O.Ci01))/XDlM
     Y(N-»1)=ALOG1CUYBASE)
     Y(N+2)=NLO€/YDIM
     CALL  PLOMC., Q.,-3)
     CALL  LINECX,Y,N,1 ,-1,4)
    NIN=N-IK+1
    CALL LINE(X(IN),Y(IN),NIN,1,-1,C)
    CALL SY«BOL(XD1M-2.5,1.,.2,4,0.,-1)
    CALL SYHBOL(XDIM-2.2,1.,.14,'UNDERESTIMATED',0.,14)
    CALL SY«BOL
-------
B.4   Subroutine SRI*SRI.GRALIN
iELT.L
ELT007
GOG001
COCC02
C00003
COGCOA
COL'COS
COGC06
COGC07
COG008
C00009
COOQ10
GOG011
C00012
COGQ13
C0001A
C00015
C00016
C00017
C00018
C00019
COCG20
COCQ21
C00022
C00023
COOC2A
COOC25
000026
COCC27
COC028
COOQ29
GOC030
COOC31
COCC32
COG033
COCC3A
COOC35
C00036
COC037
C00038
COC039
COGOAO
GOGCA1
GOOOA2
COCOA3
COGGAA
GOOCA5
COCCA6
COGQA7
COGOA8
COGOA9
GOGC50
C00051
COC052
COGQ53
COG05A
COGC55
S.GRALIN
SL73R1 1
008
012
008
011
008
008
008
008
008
008
008
012
012
012
008
008
008
008
008
012
012
012
012
008
008
008
008
008
008
OOfc
008
008
038
006
008
008
008
008
OOfa
008
008
008
008
008
008
008
008
008
OCb
OOfc
G08
008
OOfe
008
008

1/01/

C I
c
c
c





c
CR
CR



17
C
C
CR
CR
CR
18
C
C

C



c
c


c
c



c





11
12






13

    SUBROUTINE CRALIN(XDIM,YDII"l,NLOG,Y6ASE,NPLOT)
MODIFIED BY ROD ALLEN,  COMP-AID  INC., OCTOBER 1978
       GRAPH DRAWS  THE  BASE  CHART WITH PROBABILITY SCALE  ON  THE
       ABSCISSA AND LINEAR  SCALE  ON THE ORDINATE. THIS  ROUTINE  WAS
       DEVELOPED BY DALE  COVENTRY.
    DIMENSION XfcAL(21)
    DATA XVAL/C.1.C.2.O.5,1.0,2.0,5.0', 1C.0,20.0,30.0,AO.0,50.0,60.0,
   U 70.0,80.C,90.C,95.f,98.0,99.0,99.5,99.8,99.9/
     DATA DUMT/* '/
    IF iNPLOT.GT .1)60  TO  17
       SET TO BASE  PLOTTER  POSITION AT BOTTOM OF PAGE.
    CALL PLOTO2.0,-36.0,3)
    CALL PLOT((xDin/2.),-33.0,-3)
    CALL PLOTt(XDIM/2.),0.,-3)
    FCTR = ABS«XDIM/2.)/PROB(O.G01))
    60 TO 18
    ICHECK=HOD(NPLOT,3)
       GO TO CORRECT  POSITION  r-R MODULUS
       (THREE PLOTS ARE  MADE  ACROSS WIDTH
    IFUCHECK.EQ.OCALL  PLOT (5.,11.,-3)
    IFUCHECK.EC.1KALL  PLOT(17.,-22.,-3)
    IF(ICHECK.E0.2)CALL  PLOT (5.,11.,-3)

       INDICATE ON  PRINTER  THAT  PLOT IS BEING ATTEMPTED.
       POSITION AT  CENTER  OF  PLOT
    CALL SYMBOL(( -X DIM/2.), 0.0, 0.1,13, 0.0,-1)
       DRAW CENTER  LINE
    CALL PLOTU-XDIM/2.), 0.0,3)
    CALL PLOT((-XDIM/2.),YDIM,2)
    CALL SYMBOL((-XDIM/2.)tYDIM,0.1,13,0.0,-1)
       LOOP TO  DRAW LINES  AND  PLOT TOP AND BOTTOM NUMBERS
       PROBABILITY  PART  OF  GRAPH.
       2 1=2,21
                                                     3 OF PLOT NUMBER
                                                     OF PAPER.)
                                                                     FOR
              DO
 GRAPH01G

GRAPH020
   6RAPHC3G
GRAPHOAC
GRAPHC5C
GRAPH060
GRAPH070

GRAPH110
GRAPH120
GRAPH130
GRAPHUC

GRAPH150
GRAPH160
6RAPH170
6RAPH180
GRAPH190
6RAPH200
GRAPH210
GRAPH220
6RAPH230
6RAPH2AO
6RAPH260
(•RAPH270
GRAPH280
GRAPH290
GRAPH300
6RAPH310
GRAPH32C
GRAPH330
&RAPH3AO
                 M IS
                                                                        GRAPH3SO
            A  'FLIP-FLOP'  SWITCH TO 60 FROM TOP TO  BOTTOM,  THEN BOTTOMGRAPH360
                 TO TOP, ETC.
              ANUM=XVAL(I)
              BNUM=100.0-XVAL(I)
              CNUM=XVAL(I )*0.01
                 DETERMINE LINE POSITION
              XP=PROB(CNUB)*FCTR
              IF(M.LT.Q)GO TO 1
              IF(ANUM.LT.10.)60 TO 11
              CALL NUMBER((XP-0.17),-0.15,0.07,ANU«,G.0,1)
              GO TO M
              CALL NUMBER ((XP-Q.07),-0.15,0.37,ANUH.C.u.D
              CALL SYMBOL (XP.O.C.C.1,13,O.Ct-D
              CALL PLOT (XF,?.0,3)
              CALL PLOT(XF,YDIM,2)
              CALL SYMBOL(XP,YDIN,0.1,13,3.0,-1)
              IF(BNUM.LT.10.)60 TO 13
              CALL NH-BER((XP-C.17),0 TO c
              CALL NUKt3ER((XP-O.C7),(YDII'i*G.05),G.07tPNUM,j.C,1)
              GO TO c
                                                                        6RAPH370
                                                                        6RAPH380
                                                                        GRAPH390
                                                                        GRAPHAOO
                                                                        GRAPH410
                                                                        6RAPHA20
                                                                        GRAPHA3C
                                                                        6RAPH4AC
                                                                        GRAPHA5C
                                                                        GRAPHA60
                                                                        GRAPHA70
                                                                        6RAPHA80
                                                                        GRAPH490
                                                                        GRAPH500
                                                                        GPAPH510
                                                                        GRAPH52C
                                                                        GRAPH53C
                                                                        bRAPHSAO
                                                                        &RAPH550
                                                                        GR*PH560
                                       60

-------
OOUC56
CCOQ57
C00058
COCC59
COCC60
COOC61
C00062
COC063
COOC64
COCC65
COGC66
CCOC67
COC068
COG069
COOC70
COCC71
C00072
COCC73
C0007A
C00075
COOQ76
C00077
COCC78
COOC79
OOb
006
006
008
OOfi
008
008
008
008
OOo
008
00£
006
OOfc
00£
OOb
008
008
010
010
006
008
008
008
1


1A
15






16
2
C






50
31


                         IF (BNUM .LT. 1Q.)GO  TC  1 
                         CALL S»*BOL
                         1F(ANUn.LT. 1C. )60  TO  16
                         CALL NUMBER ((XP-0.17),-0.15,0.07,ANUH,0.0,1)
                         60 TO 2
                         CALL NUHBER((XP-C. 07) ,-0.15,0.07,AMUM, 0.0,1)
                         CONTINUE
                            WRITE ORDINATE  LEGEND.(TEXT AND NUMBERS)
                         XCOR=XDl«/<-2.)
                         CALL AXIS(XCOR,0.0,DUHTt1,VDin,90.,YBASE,(1Q./YDin))
                          CALL PLOT(XCOR,0.0,3)
                          00 50 1=1,11
                          CALL PLOT( (XCOR + XDIH) ,(1-1 .) ,2)
                          CALL PLOT
-------
B.4  Subroutine SRI*SRI.GRAPH
iELT.L S.
GRAPH



ELTC07 SL73R1 11/01/78 09:36:11 (6.)
COQ001
C00002
COC003
C00004
coooos
COCC06
COOC07
C00008
COC009
COC010
COC011
COCQ1Z
COC013
COCQU
C00015
COC016
COOC17
COC018
C00019
COC020
IOCQ21
COC022
COC0.23
COC024
COC025
OOCC26
C00027
C00028
000029
COC030
C00031
C00032
C00033
COC034
COOC35
COOQ36
C00037
COC038
COOQ39
COCC40
COOOO
000042
GOC043
C00044
COC045
00 C 046
EOOG47
COCC48
COOQ49
COG050
000051
COCC52
C00053
COG054
000055
002
006
002
002
OC2
003
002
002
005
002
002
006
006
006
002
002
002
002
002
006
006
006
002
002
002
002
002
002
002
002
002
002
002
002
002
002
002
002
002
002
002
002
002
002
002
002
002
002
002
002
002
002
002
002
002

c
c
c
c





c
CR
CR



17
C
C
CR
CR
CR
18
C
C

C



C
C


c
c



c





11
12






13

SUBROUTINE 6RAPH(XDII",YD1«,NLOG,YBASE,NPLOT)
MODIFIED BY ROD ALLEN, COUP-AID INC., OCTOBER 1978
GRAPH DRAWS THE BASE CHART WITH PROBABILITY SCALE ON
ABSCISSA AND LOG SCALE ON THE ORDINATE. THIS ROUTINE
DEVELOPED BY DALE COVENTRY.
DIMENSION XVAL(21)
DATA XVAL/C. 1,0. 2, 0.5, 1.0, 2. 0,5.0, 1C. 0,20. 0,30. 0,40. 0,5
U 70. 0, 80. G, 90.0, 95. C, 98. 0,99. 0,99. 5, 99. 8, 99. 9 /
DATA DUHT/- '/
IMNPLOT.6T.1J60 TO 17
SET TO BASE PLOTTER POSITION AT BOTTOM OF PA6E.
CALL PLOT(12.0,-36.C,3)
CALL PLOTUXDIM/2.),-33.G,-3)
CALL PLOT ((XDIM/2.) ,0. ,-3)
f CTR=ABS«XOIB/2.)/PROe
BNUM=10C.O-XVAL(I )
CNUM=XVAL (I)*0.01
DETERMINE LINE POSITION
XP=PROB(CNUM)*FCTR
IF(H.LT.O)60 TO 1
IF(ANUM.LT.10.)GO TO 11
CALL NUMBER((XP-0.17>,-0.15,0.07,AHU«,G.G,1>
60 TO 12
CALL NUKB ER « XP-0. 07), -0.15,0. 07, ASUM, 0.0,1)
CALL SYMBOL (XP.0.0 ,0.1 ,13,0. 0,-1)
CALL PLOT (XP, 0.0, 3)
CALL F>LOTCXP,YDIM,2>
CALL SYMBOL 
IF(BNUM.LT.10.)60 TO 13
CALL NUMBER <(XP-0.17),< YDIM-tQ. 05), O.C7,BNUM, 0.0,1)
60 TO 2
CALL NUMBER «XP-u.Q7>,(YDIM + 0.05)*O.G7,BNUM,G.C,1)
GO TO 2
GRAPH010

THE bRAPHC2C
WAS GRAPH03G
GRAPMC40
GRAPH050
0.0,60.0, GRAPH060
GRAPH070

6RAPH110
GRAPH120
GRAPH13C
GRAPHUO

GRAPH150
6RAPH160
GRAPH170
6RAPH180
GRAPH190
6RAPH200
6RAPH210
6RAPH220
GRAPH230
GRAPH24C
6RAPH260
6RAPH270
GRAPH28Q
GRAPH290
GRAPH3QO
6RAPH310
OR 6RAPH320
GRAPH33C
6RAPH340
6RAPH350
THEN BOTTOMGRAPH360
6RAPH370
GRAPH380
GRAPH390
GRAPH400
GRAPH41C
6RAPH42C
GRAPH43C
&RAPH440
6RAPH450
GRAPH46C
6RAPH47C
GRAPH480
GRAPH490
GRAPH50Q
GRAPH510
6RAPH52C
GRAPH53C
GRAPH540
GRAPHS'50
6RAPH56C
                                  62

-------
C00056
C00057
C00058
C00059
C01060
COC061
C00062
COOC63
COCC64
COCC65
C00066
C00067
C00068
C00069
C00070
C00071
COOC72
C00073
COC074
COCC75
COCC76
COCQ77
COC078
COC079
cocoeo
C00081
C00082
COC083
COOOE4
C00085
C30086
COCC87
COCC88
C00089
C00090
C00091
COCC92
C00093
COGQ94
COCQ95
COOQ96
COC097
002
002
002
002
002
002
002
002
002
002
002
002
002
002
005
002
002
002
002
002
002
002
002
002
002
002
002
002
002
002
002
002
002
002
002
002
002
002
002
002
002
002
1


14
15






16
2
C




C



C






3

4
C




30

31


                         1 F (BNUh .LT. 10.)GO  TO  14                                             t,R/>PH57
                         CALL NUMBER UXP-0.17) , (YDIM + 3.05),:.i.7,PNUh,'j.C,1)                 CRAPH58
                         GO  TO 15                                                             C.RAPH59
                         CALL NUMBER ((XP-O.J7) , (YDIM+0.05),O.C7.RNUM,C.C,1)                 GRAPH60
                         CALL SYMBOL&C TO 30                                                   GRA.PH9
                         CALL PLOT(XPLOT,YDIM,3)                                             6RAPH9
                         CALL PLOKZPLOT,YDIM,2)                                             6RAPH9
                         60  TO 31                                                             GRAPH9
                         CALL PLCKZPLOT,YDIP,3>                                             GRAPHS
                         CALL PLOT(XPLOT,YDIM,2)                                             GRAPH?
                         CALL PLOKZFLOT,O.C,-3 )                                             GRAPH^
                         RETURN                                                               GRAPH'
                         END                                                                   GRAPH'
END ELT.
                                                63

-------
B.4   Subroutine  SRI*SRI.ORDER
            •ELT.L S.ORDER
            ELTC07 SL73R1 11/01/78 09:37:01  <2,)
            COG001
            COC002
            COGC03
            C00004
            COOC05
            COC006
            COOC07
            C00008
            COCC09
            CC0010
            C00011
            C00012
            C00013
            COOOU
            000015
            COC016
            C00017

            END ELT.
000
001
001
002
000
000
000
000
300
000
000
000
000
000
000
000
000
      SUBROUTINE ORDER(A,E,N)
C SUBROUTINE ORDER FROM BILL PETERSON
C USED BY PROGRAM fREG
      DIMENSION A(1),B(1>
      DO 10 1=1,N
1Q    B(I ) = A(I)
      NN=N-1
      DO 20 K=1,NN
      DO 30 J=1,NN
      IF(B(J>-B(J«1)> 30,25,25
25    X=B(J)
      B(J)=B(J+1)
      B(J+1)=X
30    CONTINUE
20    CONTINUE
      RETURN
      END
                                      64

-------
           B.4  Subroutine  SRI*SRI.PROB
iELT.L
EL T 007
COGOC1
COGG02
COOC03
COCQ04
COOC05
COQC06
COOC07
COC008
COOC09
COC010
CO C0 11
COC012
COG013
COQOH
C00015
C00016
COGG17
C00018
C00019
COOC20
C00021
COOC22
COCC23
COG02A
COC025
COC026
C00027
COC028
COCC29
S.PROB
SL73R1 1
oco
000
000
000
000
000
000
000
000
000
000
003
002
000
000
000
000
000
000
000
000
000
000
000
000
000
000
000
000

1/01/7

c*«
c**
c**
c«*
c**
c**
c**



c
9CO

1
2
3

A
5

6

7

8
9
10

                        FUNCTION PRCB(Z)
                  C*«*TH£ FUNCTION  PROB(Z)  TAKES  THE  INPUT  Z  IN FREQUENCY
                        DM 0 TO 1.0 AND  DETERMINES  THE  PLUS OR MINUS
                  C***STANDARD DEVIATIONS (PROB) ON  THE  NORMAL CURVE OF
                  C***FREQUENCY THUS GIVING  A  PLOTTING  POSITION FOR GRAPHING
                  C***ON THE PROBABILITY  SCALE.
                  C***THIS SUBROUTINE WAS  DEVELOPED BY  JOE  SANTNER AND OBTAINED
                  C***FROM RALPH LARSEN.
                        y(A)=S6RT(AL06<1./(A*A)>)
                        X(A>=W(A)-(t2.515517+0.802853*W.E8.Q) 60  TO  15C
IF (ICODE.LT.O)  60  TO 1*4
     COMPUTE  FOR  ONE/ALL SITES.
CALL TEST1  (N,OC,PC,E>
WRITE (OUT, 11) NOS(ISN),E
IF (LN.LT.NCRIT)  60 TO 142
    DETERMINE  THE ERROR AND CONFIDENCE  LIMITS (C.L.).
SUM2=0.0
DO 141 1=1, f
CALL TEST1  
IF (NN.6T.O  60  TO 145
ERR(IS)=-1.C
60 TO  148
CALL TEST1  (NN , SOCC (1 , IS ) , S PCC ( 1 , IS ) , E )
ERR(1S)=E
WRITE (OUT, 11)  NOS(IS),E
IF (LM(IS).LT.NCRIT) 60 TO 147
   DETERMINE  THE ERROR AND C.L.
SUM2=0.0
DO 146 1=1, f
CALL TEST1  (NODSd.IS) ,SOC A (1 , I , IS ) ,SPC A ( 1 , I,IS),A(I»
t: £=A<1)-E
CONTINUE
CALL CONLIM  (E , FM ,ROOTM ,SUM2)
IF (MOD(1S,5) .E8.C.AND .IMAP.EQ.3HYES)  CALL HCOPV
60 TO 148
PRINT 32
IF  = -1 .C,
CALL RAMHAP  ( 1 , E R R , END RM>
IF (MODE.E6.2)  60 TO 150
GO TO 290

     2.  COMPUTE THE MEAN SQUARED  ERROR.

IF (MODE ,EO .2 .AND .NOT( Z) .FC .0) GO  TO  161
IF (ICODE.LT.C)  60  TO 154
     COMPUTE  FOR ONE/ALL SITES.
CALL TEST2  
               72

-------
COC341
C00342
C00343
COC344
COC345
COU346
OOC347
C00348
C00349
C00350
C00351
COC352
COC353
COC354
C00355
000356
COL357
000358
C00359
C00360
COC361
C00362
C00363
COC364
C00365
000366
COC367
C00368
COC369
COC370
COC371
C00372
C00373
COC374
00&375
C00376
C00377
C00378
COG379
COG380
000361
C00382
000383
COC384
COC365
C00386
C00387
C00388
COC389
COG390
L00391
COC392
COU393
COC394
C00395
C00396
C00397
024
024
024
024
024
024
024
024
024
024
024
024
024
024
024
024
024
024
024
024
024
024
024
024
024
024
024
024
024
024
024
024
024
024
024
024
025
024
024
024
025
024
025
024
024
024
024
024
024
024
024
024
024
025
024
024
U24



C





151



152


C
154




155




C





156




157


158




159

C
C
C
160
161




F=SQRT(E)
WRITE (OUT, 13) NOS(ISN),E
IF (LN.LT.NCRIT) 60 TO 152
DETERMINE THE ERROR AND C.L.
SUf"2 = O.G
DO 151 1 = 1, P
CALL TtST2 (NODS ( I , IS ) ,CC A ( 1 , I ) ,PC A ( 1 , 1 ) , A ( I ) )
AME=A(I)-E
SUM2=SUM2+AKE*AME
CONTINUE
CALL CONLIM (E , FM ,kOOTM , SUM2)
PRINT 37, F
60 TO 159
PRINT 32
PRINT 37, F
60 TO 159
COMPUTE FOR EACH SITE.
DO 158 IS=1 ,NS
NN=KK(IS)
IF (NN.6T.C) 60 TO 155
ERR
-------
1 fl 0 * V H
cooivv
100400
(00401
L0u402
COG403
1.01404
100405
(.00406
100407
COL.40R
000409
L00410
COC411
CDG412
C00413
000414
C00415
L0041A
COG417
IOC418
L00419
COG420
C00421
COG422
COG423
LOC424
COC425
100426
C00427
100428
COC429
000430
COG431
C00432
COCI433
COC434
COG435
000436
C00437
COC43B
COC439
COC440
C00441
100442
COG443
C00444
COL445
C00446
C00447
C0044H
COG449
CC0450
C00451
COG452
G00453
G00454
024
024
024
024
024
024
024
024
024
024
024
024
024
024
024
024
024
024
024
024
024
024
024
024
024
024
024
024
024
024
024
024
024
025
025
024
025
024
025
024
024
024
024
024
024
024
024
024
024
024
024
025
024
024
024
J24
024
(.



t





16?


163

C
164




165



C





166



167

168



169




C
C
C
170
171




C

      COUP lit I  fO(< ONI/All  ', I n r. .
1*1 I  If ST 1  (b ,G( ,('( .t >
WRIlt  (OUT, 16)  NOS(I!>N),(
II (IN.lI.MfKII) f,C  10  1C. '
     UFllHMINt  IHI  tkROK AND  I. I.
sn«?- n.O
00 162  1=1, f
C«IL  TIST3  =-1.C
fcO  TO 168
CALL  TEST3  (UN , SOC C ( 1 , I S ) , 5 PC C ( 1 , IS ) , f )
ERR(IS)*E
WRITE (OUT, 16)  NOS(IS),f
IF  (LM(IS).LT .NCR IT )  GO TO  167
      DETERMINE  THF  FRROR  AND  C.L.
SU»2*O.C
DO  166 1=1,*
CALL  TEST3  (NODS ( I , I S ) , SOC A ( 1 , I , I S ) , S PC A ( 1 , I , I S ) , A ( I ) )
AHE=A( I )-E
SUM2 = SUCI2«AI'E *A«fc
CONTINUE
CALL  CONLIH  (E ,F B , WOOTM, SUM ?)
IF  (HOD (IS , r ) .ttl . C. AND . IflAP .10. ',HY£ S )  CALL  HCOPY
GO  TO 168
PRINT 32
IF  (HOD (I S, 5) .LG .O.AND . IHAP .EO. 3HYE S >  CALL  HCOPY
CONTINUE
IF  (HOD(NS,5) .NE .O.AND.IHAP.E0.3HY t S)  CALL  HCOPY
IF  (IHAP.EO .3HNO )  GO  TO  169
CALL  RAHMAP  ( 3 , E H R , FNO MM )
IF  (HODF.EQ.2)  GO TO  171
WRITE (OUT, 17)
READ  (INP.18)  IYON
IF  (1 YON.E8 .3HY(t S)  GO  TO  16C
GO  TO 290

      4.   COMPUTE THF  PTRCFNTAGt tRKOR  THKLiHOLD.
WRITE  (OUT,19)
IF  (MODE .EC .
-------
COL455
COG456
COG457
CQC458
COG459
COGA60
COOA61
COC462
COC463
CQG46A
COG465
COCA66
COCA67
COCA68
OOGA69
COCA70
COGA71
COQA72
COC473
COC47A
C00475
COOA76
COCA77
COGA78
COCA79
COGA80
COGA81
COCA82
COGA83
COCA84
000485
C00486
COC487
COCA88
COOA89
C00490
000491
COGA92
COG493
COGA94
COC495
COOA96
COOA97
COGA98
COC499
C00500
COG501
C00502
COC503
C00504
COG505
C00506
COG507
COG508
COC509
COC510
£00511
024
024
024
024
024
024
024
024
024
024
024
024
024
024
024
024
024
024
024
024
024
024
024
024
024
024
024
024
024
024
024
025
024
024
025
024
025
024
024
024
024
024
024
024
024
024
024
024
024
025
024
024
024
024
024
024
024


C





172


173

C
174




175



C





176



177

178



179




C
C
C
180
181




C



WRITE (OUT, 20)  NOS(1SN),E
IF (LN.LT.NCRIT)  60 TO 173
     DETERMINE  THE  ERROR AND C.L.
SUM2=O.C
DO 172 1=1, r
CALL TESTA  (NODS ( I , IS ) ,OC A { 1 , I ) , PC A ( 1 , 1 ) , A < I ) )
AME=A
-------
.it, M/
IMMA1 *.
(OHM4
I (HIM*.
l.dl'MC,
UK. Mr
( 0 1 M K
OOdMV
cm'. /n
KM. './I
COk.V,'
cnu'KM
ooi, ">/4
in ()'./'>
LOU'./'.
COO'..V
COU'-/H
(0(I'./V
(Oil'. M)
UHl'.M
((!(]•. V
( n n '. ^
LOO', U
UHr, V>
COd'. V,
r.nu'i w
i n4H
IOU'.4V
uur-Mi
(Ol.'.M
IIMI1,',/
( fid'.', ^
( 0(,V>4
IOC'.1.1.
i,lli:',V,
iioc1,', ;
I III.'-1..1!
cm v-v
I 01 '.Ml
IDliV 1
( Oil'././
( (III1, C, ^
I0il'.< 4
KH.'.f '•
I Oi '.<• C.
1 (M.'-f, '
I III '.f.M
1 1 .' '.
il,''.
0 / '.
(1/4
0/4
11/4
'1/4
0/4
0/4
0/4
0/4
0/4
0/4
0/4
0/4
0/4
0/4
0/4
0/4
0/4
0/4
0/4
0 / 4
0/4
0/4
0/4
0/4
0/4
0/4
0 / '•
0/4
0/4
0,">
0/4
0 / ',
0/4
0/4
0 / 4
0/4
0/4
11/4
0/4
(1/4
0/4
0/4
0 / 4
0/4
0 / ',
0/4
0/4
0/4
0/4
0/4
0 / '.
,).' ,
1 1 / '.
0 .' •.
1 III 1 1 KM 1 t 1 Mil 1 1. HDL AM. ( . 1 .
•,»M/-(I -I'
|) 0 I H / 1 - 1 , ~
(AM 1 I ', 1 ". «NOI>'. ( I , I1, ) ,0( A ( 1 , I ) ,IT A ( 1 , 1 ) , A ( 1 ) )
AMI -A ( 1 > -1
MIM/-MIH/ • AMI * AMI
I)'-/ ( ON M Mill
(AII CONIIM o ,i n ,w no i M ,MIM ' )
(.0 10 1HV
1 HI ('MINI ', /
1,0 10 1HV
( roni'ii ii ( OH i ATH ',111.
1 H 4 IX) 1 1> H 1 S - 1 , N •>
N N - r K < I '. )
If 
i R H < i r, ) - - i . f
(.0 10 UH
1H'> (AM 1IMS ( ( ( 1 , IS) ,M't f < 1, 1 ', ) ,1 )
1 H H ( 1 r. ) - 1
WHIM (0111 , ,'/ ) NO'. < 1!. ) ,1
II 0 1H(S 1^1, *
(All II MS (N 0 1) !, 1 | , 1 '., ) , S 0 ( A ( 1 , 1 , 1 1 ) . I, I1 ( A ( 1 , 1 , I ', ) , A ( 1 ) )
AMI -A< 1 ) -1
MIM/-MIN/ « AMI 'AMI
1fU. ( ONI INIII
(All fOKIlIM ( 1 .1 M ,HOO 1M ,!. DM /)
II ( M 0 II ( 1 S , ' ) . 1 U . T . A N D . 1 M A )' . | U . Ul Y 1 ', ) (AM HCOI'Y
«, O 1O 1 I' fi
1H7 I'M INI V
11 (MOI)( 1 ',,'.). 1 L .(!. ANn . 1MAT .1 U . 'HY 1 '.) (All IHOI'Y
U'.fl ( ONT INIII
II (MOU (N '. , ' ) .Nl . 1 . AND . 1 MAI' .1 U . MlY 1 ', ) 1 Al I 1KOIY
I . « 1 MAI' .1 b . \ UNO ) (.0 10 1 H '1
(All R A MM AC ( '• .1 U M , 1 Ndl.M >
1 H V || ( M 0 II 1 . 1 U . / ) (, O 10 1 V 1
WN 1 11 ((Ml 1 , 1 M
K 1 A I) (INI'.IH) IYON
II ( 1 VON.I U . MIVI S ) (,O 10 I.1'1'
1,0 10 /V()
1
( C. IIIMIMIII IHI A'.YMMI IKM III(.I!-|(1U 1 ()',', lUNCTlON
I
1 Vf) UIJ 1 1 1 ( Oil I , ," )
1'J' II (MOI> 1 . 1 U ., ./\N|i .NO 1 ( M . 1 U .(I ) (.0 10 />M
WR 1 1 1 t (ill 1,44)
N 1 A 1) ( 1 NT , \ ) 1 4 , III 1 ,111 '
1 NOHM ( 1 )- I 4
1 NOHM ( .' ) - III 1
1 NO UM ( ' > - HI ,'
ii ( i ( iini .1 i . n ) (,o 10 lv.
( ( uf I'll 1 1 1 HI' ONI / A 1 1 ', 1 1 1 '. .
1 AM 1 1 '. 1 f:  Nil '. ( 1 ', N ) , 1
II < 1 N . 1 1 .N I l< 1 1 ) (.() 10 1V'

-------
COC569
COC570
COG571
COC572
C00573
COC574
C00575
COC/576
C00577
COC578
COC579
COC580
000561
COC582
COC5S3
COC584
COC565
COG586
C00587
COL588
COC569
C00590
C00591
COC592
C00593
C00594
COOS95
COC596
000597
C00598
COC599
CQC600
C00601
C00602
000603
100604
COC605
C00606
C00607
COC608
C00609
COOdIO
C00611
COC612
C00613
COU614
000615
COC616
C00617
COC618
COC619
COC620
LOC621
COC«22
COC623
C00624
COC625
024
024
024
024
024
024
024
024
024
024
024
024
024
024
024
024
024
024
024
024
024
024
024
02*
024
024
024
024
024
025
024
024
025
024
025
024
024
024
02*
024
024
024
024
024
024
024
324
024
024
024
025
024
024
024
024
025
025
C










C









C




















C
C
C
C



C







          DETERMINE
      SUK2=O.C
      DO  192  1 = 1,
                    THE EfcROK  AND  C .L
                ,
     CALL  TEST6 (NODS ( I , IS > ,OC A ( 1 , I ) ,PC A ( 1 , I ) , A ( 1 ) )
     AME=A(I)-E
192  CONTINUE
     CALL  CONLIM (E , FM , R COTM , SUK 2)
     GO  TO  199
193  PRINT  32
     60  TO  199
           COMPUTE FOR EACH  SITE.
194  00  198  IS=1,NS
     NN=KK (IS)
     IF  (NN.6T.U) 60 TO 195
     ERRCIS)=-1.C
     60  TO  198
195  CALL  TEST6 (NN , SO CC (1 , I S } , S PCC ( 1 , I S ) , E )
     ERR(IS)=E
     yRITE  (OUT, 24) NOS(IS) ,E
     IF  (Ifl(lS).LT.KCRIT)  60  TO  197
           DETERMINE THE ERROR  AND  C.L.
     SUM2=0.0
     DO  196  1 = 1, B
     CALL  TEST6 (NODS ( 1 , IS ) , SOC A ( 1 , 1 , 1 S ) , S PC A ( 1 , I , I S ) , A ( I ) )
     AME=A(I)-E
     SUM2=SUM2+APE*AWE
196  CONTINUE
     CALL  CONLIM ( E , FM , R OOTM , SUM ?)
     IF  
-------
COC626      025          GO  TO  216
COG627      024     210   READ  (1KP.3) ( (AS (I, J ) , J = 1 t 5) .1 =1 , 5 )
C00628      02*          WRITE  (OUT,33) ((AS(I,J),J = 1,5) ,1 = 1 , 5>
COC629      024          WRITE  (OUT,34)
C00630      024          READ  (INP,1£> IVON
C00631      024          IF  (ITON.EO.3HNO > 60  TO 20C
C00632      025     215   WRITE  (OUT,25)
C00633      024     216   READ  (INP,3>  CKAX
C00634      024          ENORM(1)=CNAX
COC635      024          IF  (ICODE.LT.O) 60 TO  219
C00636      024    C         COMPUTE FOR ONE/ALL SITES.
C00637      024          CALL  TEST? (N,OC,PC,E)
C00638      024          WRITE  (OUT,26) NOS(ISN),E
C00639      024          IF  (LN .LT.NCRIT) 60 TO 218
COC640      024    C         DETERMINE THE ERROR AND  C.L.
COC641      024          SUH2=O.C
COC642      024          DO  217 1=1,f
COC647      024          CALL  TEST? (NODS (I , IS) ,OCA(1,I),PCA(1,I),A(I))
COG644      024          AME=A(I)-E
COC645      024          SUM2 = SUM2*A!>E*AME
COC646      024     217   CONTINUE
OOC647      024          CALL  CONLIM (E ,FM ,RCOTM,SUM2)
C00648      024          60  TO  224
C00649      024     218   PRINT  32
C00650      024          60  TO  224
C006S1      024    C           COMPUTE FOR EACH  SITE.
000652      024     219   DO  223 IS=1,NS
COG653      024          NN=KK(1S)
COL654      024          IF  (NN.6T.G) 60 TO ?20
COC655      024          ERR(IS)=-1.C
COC656      024          GO  TO  223
C00657      024     220   CALL  TEST? (NN ,SOCC<1,IS),SPCC(1 , IS) , E)
COC658      024          ERR(IS)=E
C00659      024          WRITE  (OUT,26) NOS(IS),E
COG660      024          IF  (LM(IS).LT.NCRIT) 60 TO  222
COC661      024    C           DETERMINE THE ERROR AND  C.L.
C00662      024          SUK2=0.0
COG663      024          DO  221 1=1,f
C00664      024          CALL TEST? (NODS(I , IS) ,SOCA(1,1,IS),SPCA(1,I,IS),A(I))
C00665      024          AME=A(I)-E
CQ0666      024          SUM2=SUM2*AP£*AME
COC667      024     221   CONTINUE
000668      024          CALL CONLIM (E ,FM ,ROOTM,SUM2)
C00669      025          IF  (MOD(IS, 5).EC .C. AND .IMAP.EQ.3HYES)  CALL  HCOPY
C00670      024          60  TO  223
C00671      024     222   PRINT  32
C00672      025          IF  (MOD(IS,5).EG .0.AND .IMAP.EQ.3HYES)  CALL  HCOPY
C00673      024     223   CONTINUE
C00674      025          IF  (MOO(NS,5).NE .C.AKD .IMAP.EQ.3HYES)  CALL  HCOPY
C00675      024          IF  (IMAP.EG .3HNO ) 60  TO 224
CQC676      024          CALL  RAPIHAP ( 7 ,ERR , ENORH)
COC677      025     224   IF  (MODE.EC.2) 60 TO 225
COC678      024          WRITE  (OUT, 29)
COC679      024          READ  (INP,1P) IYON
C00660      024          IF  (1 YON.Eft .3«YES ) GO  TO 215
C00681      024          WRITE  (OUT,31)
COC682      024          READ  (INP,1P) IYON
                                       78

-------
COC663
COC684
C00685
C00686
COC687
LOC688
COC689
COC690
C00691
C00692
COC693
COC694
C00695
C00696
C00697
COC698
COC699
000700
COC701
C00702
COC703
C00704
COC705
COC706
COC707
C00708
COC709
COC710
COC711
C00712
C00713
COC714
COG715
COC716
C00717
COC718
£00719
C00720
C00721
C00722
C00723
COC72«
COC725
C00726
C00727
100728
C00729
COC730
COC731
C00732
COC733
C00734
C00735
COC736
C00737
C00738
C00739
C2A
024
024
024
025
025
025
025
025
025
024
025
025
025
025
024
025
325
025
024
025
024
024
024
024
024
024
024
024
024
024
024
024
024
024
024
024
024
024
024
024
024
024
024
024
024
024
024
C24
024
024
024
024
024
024
024
U25

C
C
C
225



226



C
227


228



229




230
C



C





235


240

C
250





C





255


IF  (IYON.EU .3HYtS >  GO  TO  200

      8.   DETERMINE  THE  LOCATION «HtFt  THE  MAX CONCENTRATION OCCURS

If  (ICOOE .£C.-1.AND.NOT(6).EQ.1 ) GO  TO  226
IF  (NOT(8). EQ .C) GO TO  2£ 0
WRITE  (GUT, 46)
GO  TO  280
IF  (HODE.EC.2) GO TO 227
WRITE  (OUT, 27)
READ  (ISP.U) IYON
IF  (irON. EG .3HYES)  60  TO  229
      QUICK-RUN USES PROGRAM DISTANCE MATRIX.
DO  228  1 = 1, NS
DO  228  J=1,NS
DD , J = 1 ,N S)
WRITE  (OUT, 34)
READ  (INP,1f>  IYON
 IF (IYON.EC.3HNO ) GO  TO  225
IF  (ICODE.LT.O) GO  TO  250
    COMPUTE FOR ONE/ALL SITES.
CALL  TESTS  (N,OC,PC,E)
WRITE  (OUT, 28) NOS(ISN),E
IF  (LN.LT.NCRIT) GO TO  2*0
    DETERMINE THE ERROR AND C.L.
SUM2=0.0
DO  235  1 = 1, M
CALL  TESTS  (NODSd.IS) ,OCA< 1,I>,p{A(1,I),A( I»
AME=A(I)-E
CONTINUE
CALL CONLIM  ( E , FM ,ROOTM ,SUM 2)
60 TO 280
PRINT 32
GO TO 280
     COMPUTF FOR EACH  SITE.
00 265  IS=1,NS
NN=KK(IS>
IF (NN.EQ.O) 60 TO 265
CALL TESTS  ,E)
WRITE (OUT,2b) NOS(IS),E
IF (LM(IS) .LT .NCRIT) 60 TO  260
     DETERMINE THE ERROR  AND  C.L.
SUM2=0.0
DO 255  I=1,P
CALL TESTS  (NOD S ( I , IS ) ,SCC A (1 , I , I S ) , S PC A ( 1 , I , I S ) , A ( I ) )
AME=A(1 )-E
SUM2=SUM2*AfE*AME
CONTINUE
CALL CONLIM  ( E , F M , R OOTM , SUX, 2 )
IF (MOD (IS,5) .tG.C.AND .IMAP.EQ.3HYES)  CALL  HCOf-Y
                     79

-------
C00740
COC741
C3C742
COC743
00074/,
C00745
COC746
COC747
COC7A8
COC7A9
COC750
C00751
COC752
C00753
C0ii75*
COC755
I.00756
C00757
C00758
C00759
COC760
000761
024
024
025
024
325
024
024
024
024
024
024
024
024
025
024
024
024
025
024
025
024
024
      60 70 265
 260   PRINT li
      IF (MOD( IS, 5) .EG .C.AND.IHAP .EG .3HYES) CALL HCOPY
 265   CONTINUE                     *
      IF (nOD(NS,5) .ME .O.AND .IKAP.EQ .3HYES) CALL HCOPY
 260   IF (MODE.E0.2) 60 TO  3CO
;           TRY ANOTHER TEST?
 290   WRITE 
      READ (INP.18) IYON
      IF (IYON.EO .3HYES)  60  TO
:           TRY ANOTHER NODE?
 300   WRITE (OUT, 36)
      READ (INP,18) IYON
      IF (IYON.EU.3HYES)  GO  TO
:           TRY ANOTHER SORT?
      WRITE (OUT, 38)
                                      (0,2C)
                                                   13C
                                                  99
                         READ  (INP,1fr) IYON
                         IF  (IYON.EQ.3HYES) 60 TO  54
                         WRITE  (OUT, 86)
                         IF  (INAP.Ea.3HVES) CALL FINITT
                         STOP
                         END
END ELT.
                                    80

-------
C.2  Program Map, M21ADO*STAT01.MAPIT
SELT,L
ELTC07
COCC01
COGC02
COC003
cocoo*
cocoes
COOC06
CO&G07
coocoe
:OCCD9
C00010
COOC11
S1 .MAPIT
SL73R1 1
003
001
001
001
001
001
001
001
301
001
003

1/01/7P
SWAP
IN M
IN «
IN M
IN S
IN S
IN S
IN R
LIB
END
iXST
                                        09:38:21  («,)
                                        ,M21ADO*STATC1.ACSCOR
                                      M21ADO*STAT01.ACSCOR
                                      «2lADCi*STATQ1.CONLIH
                                      M21ADO«STAT01.TESTS
                                      SRI*SRI.RAMMAP
                                      SRI*SRI.BOX
                                      SRI*SRI.HEADER
                                      RAPS*UTILITY.CCMPOZ
                                       eRAPH*TEKTRONIX.

                                        «21ADC*STAT01.ACSCOR
                 END ELT.
                                      81

-------
  C.3   Subroutine M21ADO*STAT01.TESTS
5ELT,L St. TESTS
ELTC07 SL73R1 11/01/7?
LOGC01      000
COGC02      000
COCC03      000
C00004      000
COOC05      000
000006      300
COOC07      000
COCC08      000
C00009      000
COC010      000     100
COOC11      000
C00012      000
COGC1J      000
COG01A      000
COC015      000
COOC16      000
COOC17      000
COOG18      000     110
C00019      000
COOC20      000
C00021      000
COCC22      000
COOG23      000
COCC24      000
COGG25      000     120
CCG026      000
C00027      000
COOG28      000
C00029      000
COCC30      000
C00031      000
C00032      000
C00033      000
COOC3A      000
COC035      000     125
COOC36      000     130
000037      000
COCC38      000
COQ039      000
000040      000
COCG41      000
£00042      000
COGOA3      000
COCOA4      000
C00045      000     UO
COOOA6      000
COOOA7      000
00 03 AS      000
COOOA9      000
COC050      000
CQG351      000
100052      000
COOG53      000     150
COGC5A      000
COCG55      000
09:38:22 (1,)
 SUBROUTINE TESTS  
 DIMENSION OC(N),PC(N)
 COMMON /DAT/El,E2,E2tE4,PChIN,hLl,HL2,Cf»AX,DDtAS(5,5)
 COMMON /VAR/IDATE(123>,ITIME(123),1SITE<123)
 RETURN
 ENTRY TEST1 (N,OC,PC,E)
 sun=o.o
 00 100 1=1, N
 SUn=SUM*ABS(OC (I)-PC(I ))
 CONTINUE
 E=SUM/N
 RETURN
 ENTRY TEST2 (N,OC,PC,E)
 DO 110 1=1, N
 OCHPC=OCCI)-PC(I)
 SU«=SU«*OC«PC*OCMPC
 CONTINUE
 E-SUM/N
 RETURN
 ENTRY TEST3 (N,OC,PC,E)
 SUM=0.0
 DO 120 1=1, N
 IF (ABS(OC( I)-PC(I)).6T.E1)
 CONTINUE
 E=SUH/N
 RETURN
 ENTRY TESTA (N,OC,PC,E)
 SUM=0.0
 DO 130 1=1, N
 IF 
 SUH=0.0
 DO 1AO 1=1, N
 IF (OC(I).LE.E3.AND.PC(I) .LE.E3) GO TO 1AO
 IF (OC( I) .6T.E3.ANO.PC (D.GT.E3) GO TO 140
 SUM=SUM+1 .u
 CONTINUE
 E=SUH/N
 RETURN
 ENTRY TEST6 (N.OC.PC.E)
 SUM=0.0
 DO 150 1=1, N
 IF (OC(I) .LT.EA . AND. PC (I) .GT.E4) SUM = SUM-»HL1
 IF (OC(I).GT.EA.AND.PC (I) .LT.EA) SUM = SUW+HL2
 CONTINUE
 E=SUh/N
 RETURN
                                         82

-------
C00056
COOG57
COGD58
COCC59
LOUC60
COCC61
COCC62
COCC63
COOCtA
COGC65
COLC66
0 COO 67
COC068
CCGC69
COuC70
COCC71
COCC72
COOC73
LOOC74
C00075
COC076
COQC77
COCG78
COC079
COG080
coooei
COC062
C00083
COC084
COOC85
COG066
C00087
000068
COC089
COC090
C00091
COOC92
COOC93
COGC94
COC095
COC096
COCC97
000098
OCG
ooc
000
000
000
000
ooc
000
000
000
000
300
000
000
000
UOO
000
000
000
000
000
000
ooc
000
000
000
000
000
000
000
000
000
000
000
000
ooc
000
000
000
000
000
000
000
cND ELT.
iHDG.N
                   170
                   175
                   160
                        ENTRY  TEST? (N,OC ,PC,E )
                        S U M = j . 0
                        DO  un  1 = 1,N
                        J = 5.0*( +t.2*CI'iAX)/£MAX>
                        IF  U.fcT.5) K=5
                        SUM = SUI"l + AS ( J, K)
                   1tO   CONTINUE
1&5
                        RETURN
                        ENTRY TESTfc  (N,OC,PC,E)
                        sur,=o.u
                        NT = 0
   X = -1 .CE1 C
PMAX=-1 .QE1 C
IDATEO=IOATE(1)
ITIMED=ITIME<1)
00 185  1=1, N
IF (1DATE (I ).NE.IDATED )
IF (ITIME(I).NE.lTirED)
                              60
                              GO
                                                     TO
                                                     TO
                                                        18C
    IF  (OC(I).LT.OHAX) 60  TO  175
    OHAX=OC(I)
    «OC=ISITE (I)
    IF  (PC11) .LT.PMAX) GO  TO  185
    PHAX=PCtI)
    «PC=IS1TE (I )
    60  TO 185
    NT=NT+1
        = SUM+OD(MOC ,MPC)
                        MPC = 1
                        OMAX=-1 .CE1 C
                        PI«AX = -1 .OE1 C
                        IOATEO=IDATEtI)
                         60  TO 170
                         CONTINUE
                         E=SUM/NT
                         RETURN
                         END
                             83

-------
  C.3  Subroutine M21ADO*STATO1.CONLIM
«ELT,L S1.CONLIf
EL1GG7 SL73R1 11/31/78
UOCC01      DOO
CO&OC2      OCO
COGC03      000
COGOO«      000
COG005      000
COC006      000
COCQ07      000
COCC08      000
COC009      000     40
COCC10      000
COQ011      OOU

END ELT.
09:33:08 (2,)
 SUBROUTINE CONLIM  (E,Ff,ROOTM,SUM2 )
 S=SQRT(SU«2/(FM-1.3))
 CLU=1.96«S/ROOTM
 CLL=-CLU
 CL1=E+CLU
 CL2=E+CLL
 IF (CL2.LT.C) CL2=0.0
 PRINT *C,CL2,CL1
  FORMAT (/12X24HV5X CONFIDENCE  INTER VAL :E10 .3 , AH TO E10.3)
 RETURN
 END
                                         84

-------
C.3   Subroutine  M21ADO*STATO1.RAMMAP
•ELT.L
ELTG07
COOC01
COC002
C00003
COG004
000005
C00006
COOC07
COGC08
COCC09
COOC10
COGC11
COC012
000013
COGOU
C00015
COCC16
COCC17
COGG18
COOG19
COGG20
COCC21
COGQ22
COG323
COC024
COCC25
COCQ26
C00027
C00028
COG029
COG030
C00031
C00032
COOC33
COCQ3A
COG035
C00036
COQQ37
COQC38
COOC39
COCC40
COG041
C00042
COOG43
COCC44
COG045
COCG46
COC047
COCOAS
C00049
COG050
n0051
COGG52
COGG53
C00054
COGC55
S. RAMMAP
SL73R1 1
026
026
02c
026
026
026
326
026
026
026
026
026
026
026
026
026
026
026
026
026
026
026
026
026
026
026
026
026
026
026
026
026
026
026
026
026
026
026
026
026
028
028
028
028
026
026
026
026
026
026
026
026
026
026
026

1/01/

C
C
C
C
C
C
C



C



























C

75

76


C







C
       1/01/78  G9:37:1j  (30.)
                SUBROUTINE  RAMMAP(NTEST,VALUES,PARM)
            ROD  ALLEN,  COMP-A1D  INC.,  OCTOBER 1978
            PLOT  VALUES  ON  RAMS  STATION HAP OF ST. LOUIS FOR RAM MODEL TESTS
            FOR  RON  RUFF  OF  SRI
            ASSUMES  TEKTRONIX  4G14
            3 E1  THRESHOLD,  4  E2 THRESHOLD, 5 E3 NORM, 6 E4 NORM, L1 LOSS  1, L2  LOSS  2,
            7 LOSS MATRIX SUPPLIED  BT  USER, NOT LISTED HERE
            DECLARATIONS
                DIMENSION TEST<6,7),ZERO(4),VALUES<25),LOC<25>,PARM<3),AOUT(5>
                DIMENSION RAMSX(25),RAMSY(25),XLAB<4),YLAB<4),NUMBER<25)
                DIMENSION MOX(5),MOY(5),MSX<14),HSY(14),MSLX(6>,MSLY<6)
            INITIALIZATION  OF  DATA
                DATA MMS/14/.MMO/5/,MSL/6/
                DATA MOX/696,710,720,732,750/,MOY/4276,4284,4297,4306,4:»On/
                DATA MSLX/ 7 39, 735,733. 734, 7 38,7 46 / .MSLYM263,4270, 4275, 4282,4288,
               1  4294/
                DAT A MSX/73C,732,739,744,746,744,744,746,75C,750,735,723,714,708/
                DATA MSY/4235,4251,4268,4273,4230,4286,4290,4294,4300,4306,4310,
               1  4314,4314,433C/
                DATA RAMSX/744.2,742.5,747.6,747.3,743.7,
               1  738.7,740.2,748.4,755.8,747.2, 738.8,733.9,737.7,744.3,757.1,
               2  762.8,760.6,743.1,729.8,723.1, 732 .4 ,741 .6 ,777.3,749.3 ,697,4/
                DATA RAHSY/426C.,4286.,4282.,4277.,4276.,
               1  4278.,4283.,4291.,428C.,4273., 4272 . ,4281. ,4290.,4297.,4298.,
               2  4290.,4273 .,4263.,4271.,4286., 4302. ,4329. ,4286.,4237 . ,4282./
                DATA XLAB/'700",'720','740','760'/
                DATA NUMeER/'01',"02','03','04','05",*06','37','08*,'09','10',
               1  '11',*12','13",'14',"15','16','17','18','19','20','21','22',
               2  '23','24','25'/
                DATA LOCM, 1,1,1,3,3,3,1,1,1,4,3,3, 3,1,1,1,1,3,3,1,4,3, 2, 1/
                DATA ZERO/*C.',' 0.','   0.',' Q.'/
                DATA YLAB/'425G','4275','43CO','4325'/
                DATA TEST/'MEAN  ABSOLUTE ERROR
                          'MEAN  SQUARE  ERROR
                          'ABSOLUTE  ERROR  THRESHOLD
                          'PERCENTAGE  ERROR  THRESHOLD
                          "SYMMETRIC HI6H-LOU LOSS FUNCTION '
                          'ASYMMETRIC  HIGH-LOW LOSS FUNCTION'
                          'USER  SUPPLIED  LOSS MATRIX
           INITIALIZATION
               WRITE(6,75)
               FOR«AT*64
               CALL ftOUTST(1,N)
               CALL MOVABS(20,680>
               CALL AOUTST(33,TEST(1 ,NTEST))
           PRINT PARAMETERS
                                     85

-------
                             NOT LISTED HERE*)
COC056      026         IF(NTEST.LE .2)  60 TO 8C
COOCS7      026         CALL MOVABS(20,660)
C00058      026         If(NTEST.LE .6)  60 TO 81
C00059      026         CALL AOUTST(45,'LOSS MATRIX SUPPLIED BY USER,
COC060      029         CALL MOVABS(20,640)
COQC61      026   81    ENCODE(30,82,AOUT) PARK
COCC62      026   82    FORMATdPGS .2 , 4X , 1 P268 .2 , 2X )
COOC63      026         IF(NTEST.EC.3>  CALL AOUTST(12,'E1 THRESHOLD')
C00064      026         IFtNTEST.EO.4)  CALL AOUTST(12,'E2 THRESHOLD')
COC065      026         IF (NTEST.Efl .5)  CALL AOUTST(7,'E3 NORM')
COC066      026         IF(NTEST.EG.6>  CALL AOUTSTC25,'E4 NORM, L1 LOSS,  L2  LOSS')
COOC67      025         IF(NTEST.E8.7>  CALL AOUTST(26,'CMAX CONCENTRATION MAXIMUM')
COCC68      026         CALL AOUTST(6,AOUT)
COGC69      026         IF(NTEST.EQ .6)  CALL AOUTST<16,AOUT(3))
COCO70      026   80    CALL CHRSIZ (3)
COOC71      026   C USES  THE NEXT  TC SMALLEST OF 4 CHARACTER SIZES
C00072      026   C WRITE  SUBTITLES  AND LE6END
C00073      026         CALL MOVABS (20,2CO
COOC74      026         CALL AOUTST(29,'VALUES 6IVEN NEXT TO STATIONS')
COG075      026         CALL HOVABS(22,184)
COCC76      026         CALL AOUTST(15,'SN RAMS STATION')
COC077      026         CALL BOX(20,182,38,196)
C00078      026         CALL NOVABS(20,168)
COCC79      026         CALL AOUTST(34,'WHERE SN+10C IS THE STATION NUMBER')
COCC80      026         CALL MOVABS(20,152)
C00081      026         CALL AOUTST(37,'VALUE EXAMPLES 12-3 = .012 AND 12 + 3 = 120')
COOC82      026         CALL MOVABS(2C,136)
C00083      026         CALL AOUTST(26,'AXES UNITS UTM COORDINATES')
C00084      026   C DRAW  FRAME
C00085      026         CALL BOX(0,C,1023,78C)
000086      026   C DRAW  TIC MARKS
000087      026         DO  1 1=1,4
COC088      026         IX = 1024*(68C.+ 20*1-696.3)7(778.4-696.3)
COC089      026         IY=781*(4225.+25*1-4235.7)7(4330.3-4235.7)
C00090      026         CALL MOVABS(G,IY>
COCC91      026         CALL ORNABSU.IV)
C00092      026         CALL MOVABS (1023, IV)
C00093      026         CALL DRWABS(1019,I V)
COC094      026         CALL MOVABSUX.O)
000095      026         CALL DRHABS(IX,4)
COCC96      026         CALL MOVABS (IX,776)
C00097      026         CALL DRUABS(IX,780)
COCO 98      026         CALL MOVABSUX-6,5)
COC099      026         CALL AOUTST<3,XLAB(I))
C00100      026         CALL MOVABS<5,IY-6)
C00101      026   1     CALL AOUTST (4,YLAB(I))
C00102      026   C PRINT  TIME  AND DATE HEADER
C00103      026         CALL HEADER
CO0104      026   C DRAW  STATION  BOXES  AND WRITE STATION NUMBERS
C00105      026         DO  2 1=1,25
C00106      026         IX = 1024*(RAMSX(I)-696.3)7(778.4-696.3)
C00107      026         IY=781*(RAMSY(I)-4235.7)7(4330.3-4235.7)
C00108      026         CALL BOX(IX-9,IY-7,IX+9,IY+7)
C00109      026         CALL HOVABS(IX-7.IY-5)
C00110      026         CALL AOUTST (2,NUKBERd ))
C00111      026   C WRITE  VALUES  NEAR  STATIONS
C00112      026         IF
-------
C00113
COG114
COC115
CC0116
C00117
COG118
C00119
COC120
COC121
C00122
COG123
COC124
COC125
COC126
C00127
C00128
COG129
COC130
C00131
000132
C00133
COC134
000135
COC136
COG137
COC138
C00139
COOHO
000141
000142
COOU3
C00144
C00145
C00146
COG147
COCU8
C00149
C00150
COC151
C00152
C00153
COC154
CC0155
C00156
C00157
C00158
COQ159
C00160
COC161
C00162
C00163
COC164
COG165
COC166
COC167
C00168
COOT69
026
026
026
026
027
027
027
026
026
026
026
026
026
026
026
026
026
026
026
026
026
026
026
026
026
026
026
026
026
026
026
026
026
026
026
026
026
026
026
026
026
026
026
026
026
026
026
026
026
026
026
026
026
030
030
030
026



C
C

6


C
C
3

IF(LOCd) .EG.2) CALL N CV A P S < I X - 1 5 , I Y-» 1 1 )
IF(LOCd) .EG.3) CALL M CVA E- S ( I X -43 , 1 Y-5 )
1 F(LOC (I) .E0.4) CALL MOV AF S ( I X- 1 5 , I Y -2 0 )
ENCODE OUTPUT OF VALUES(I)
IF VALUES(I) < f LEAVE BLANK
IF(VALUESU)) 2,6,3
L=LOC(I)
CALL AOUTSTU ,?ERO(L))
60 TO 2
IF VALUES(I) > S9 + C9 OR <= 99-K USE X + XX FORCAT
IF VALUESd) <= 99 + 09 AND > 99-10 USE X X •• X FORKAT
IF(VALUES 
-------
C00170
COG171
COCJ172
000173
COC174
COC175
COG176
C00177
000178

END ELT,
027
027
027
027
027
027
030
026
026
CALL flOVABS (10,50)
CALL AOUTSK24,'PRESS  RETURN TO CONTINUE')
CALL BELL
CALL TSEND
CALL TINPUT(I)
CALL ERASE
CALL F1MTT(0,7£G)
RETURN
END
                                  88

-------
 C.3  Subroutine M21ADO*STAT01.HEADER
oELT.L
ELTC07
COCC01
C00002
C00003
C00004
C00005
COCC06
COC007
COCC08
C00009
C00010
C00011
COC012
COC313
000014
COC015
COC016
COC017
D00018
Q00019
S. HEADER
SL73R1 11/
016
014
016
016
017
018
014
014
014
OU
014
014
014
014
014
014
014
016
016
                 01/78 C9:36:20 (18.)
                        SUBROUTINE HEADER
                  C ROD ALLEN, COUP-AID  INC.,  OCTOBER  1978
                  C PRINT TIME AND DATE  HEADER  IN  UPPER  RIGHT  CORNER  AND BOX IT
                  C ASSUMES TEKTRONIX 4CU
                        DIMENSION DATE(2>, TIME (2)
                        CALL CHKSIZC3)
                             BOX(953,736,1023,780)
                             COMP02(0»IL .DATE >
                             COMPOZ(18)
                             COMP02 <0,1L,T1J"E>
                             COBPOZ(17)
                             MOVABS(956,767)
                             AOUTST(7,'PLOTTED')
                             MOVABS(956,754)
                             AOUTST(8,6ATE)
                             MOVABS(956,741)
                             AOUTST(8,TI«E)
CALL
CALL
CALL
CALL
CALL
CALL
CALL
CALL
CALL
CALL
CALL
RETURN
END
END ELT.
                                      89

-------
C.3   Subroutine M21ADO*STAT01.BOX
iELT.L
ELTCG7
OOCC01
COCC02
COCC03
COC004
COC005
COCC06
COOC07
C00008
C00009
COCC10
COC011
S.BOX

SL73R1 11/01/78
000
000
000
000
000
000
000
000
000
000
000

C RO
C DR
C CO







                       09:35:19 
-------
C.4  Data  Element M21ADO*STATOl.DISTAN
                     iELT,L  S1.01STAN
                     ELTGC7  SL73R1 11/01/78 09:38:16 (C.)
                     COCC01      000     C.O 0.45 1.15
                     COC002      000    0.45  C.O 0.70
                     COCC03      000    1.15 0.70  0.0

                     tND  ELT.
                                     91

-------
C.4  Data  Element M21ADO*STAT01.ERRLOS
                 SELT,L  S1.ERRLOS
                 dLTCOr  SL73R1 11/01/78 u9:38:18 (C,)
                 COC001       000     O.C  1.0  2.0  3.C  4.0
                 C00002       000     1.0  0.0  1.0  2.0  3.D
                 COLC03       OOC     2.0  1.0  0.0  1.C  2.0
                 COGQOA       300     3.0  2.0  1.0  C.O  1.0
                 COC30S       000     4.0  3.0  2.0  1.C  0.0

                 END  ELT.
                                    92

-------
         APPENDIX D




RESIDUAL TIME SERIES LISTINGS
             93

-------
D.I   Control Element Example,  M21ADO*STAT02.CASE1
       •ELT.L S2.CASE1
       ELTCC7 SL73R1 11/01/78 09:39:0fc U.)
       COCCC1      001
       COCCG2      001
       CO&C03      003
       COC004      002
       CCCC05      002
       000006      002
       C00007      00*
       LOC008      002
       COC009      002
       C00010      000
       COCQ11      001

       END ELT.
SXCT M21ADO*STATJ2.T1MSER
(CHIKU/G)
 1 0011
01
OP TIME LAG
15 AUTOCORRELATION
01
13 FREQUENCY (F)
42 VALUE OF NORMALIZED CUMULATIVE PERIOOOGRAM
   101     3  741C12  0900  74112C  J400
&ADD M21ADO*STAT01.COGS2N
                                     94

-------
D.2  Program Map,  M21ADO*STAT02.MAPIT
                  «ELT,L  S2.MAPIT
                  ELTC07  SL73R1  11/
                              'J02
                              302
                  COG003       001
                  COCQOA       001
                  COC005       003
                  C00006       003
                  C00007       003
                  COCC08       000
                  C00009       000

                  END  EL7.
01/78 09:29:33 (3,)
 IK H21ADOSTATQ2.11PSER
 IN M21 ADU*STATQ2. SETUP
 IN n21ADO*STATQ2.tSESET
 IN SRI*SRI.BOX
 IN SRI*SRI. HEADER
 IN RAPS*UTIL1TY .CCMPOZ
 LIB 6RAPH*TEKTRONIX
 END
                                      95

-------
D.3  Listing of the Main Program, M21ADO*STAT02.TIMBER
•ELT.L
ELTC07
OOOC01
COCOOZ
COGG03
COQ004
000005
CO D 006
C00007
COC008
COC009
000010
COC011
COCC12
C00013
n riftft i L
U UUU 1 *f
C00015
C00016
C00017
COOC18
COCQ19
C00020
COC021
C00022
COC023
C0002A
C00025
C00026
C00027
LOCC28
C00029
C00030
C00031
COCC32
COC033
OOOC34
COOC35
C00036
COCC37
C00038
COCC39
COCC40
COCC41
COCOA2
C00043
COOCAA
COC045
C00046
COGG47
COCOAS
OOC049
COC050
COC051
COC052
COC053
COG054
COC055
S2.TIMSER
SL73R1 1
011
011
011
011
011
011
011
011
011
311
011
011
011
AI 1
U 1 1
011
008
011
006
008
008
009
OOti
008
006
008
008
008
008
008
008
008
ooe
008
008
008
008
008
008
008
008
008
008
008
008
008
008
006
008
008
006
008
OOb
008
OOt
006
1/01
c
c
c
c
c
c
c
c
c
c
c
c
c
c
c
c















/78 09:39:35 (12,)
*******************************************************************

THIS PROGRAM COMPUTES THE AUTOCORRELATION AND NORMALIZED CUM-
ULATIVE PERIOD06RAM FOR THE RESIDUAL TIME StRlfS.

REFERENCES:

1. BOX, 6.E. AND 6.M. JENKINS, 1976: TIKE SERIES ANALYSIS
FORECASTING AND CONTROL, HOLDEN-DAY, SAN FRANCISCO, CALIF.

2. JENKINS, 6.M. AND D.G. WATTS, 12966: SPECTRAL ANALYSIS AND ITS
APPLICATIONS, HOLDEN-DAY, SAN FRANCISCO, CALIF.


MODIFIED BY ROD ALLEN, COUP-AID INC., OCTOBER 1978

D I PENSION OC(123,3>,PC(123,3),IDATE(123),ITI«£(123),RTS(123),ACF
1(15),CNP(123),FI<123),XX(2),YY(2),IDEN(5),TIT1(10),TIT2(10),XARR1
2(10),XARR2(10),YARR1(1C),YARR2(10)
COMMON /DAT/ XMIN , XMAX , YMIN , YM AX , I T YPE , 1C OD E , I S
DATA PI.ITYPE /3 . U16 , 001 1 /
1 FORMAT 
5 FORMAT 
6 FORMAT (/6H S ITE : , 13,5 X .5HRBAR : ,F1 0.2 ,5X,6HSUMR2 : , F10.2 /)
7 FORMAT 
-------
C00056
COC057
COC058
OOC059
cocoto
COOC61
COOC62
C00063
COOC64
C00065
COG066
COC067
COC068
COC069
COOC70
COOC71
COOC72
LOC073
C0007*
COOC75
COOC76
COC077
COOC78
COOC79
COOC80
COCC81
000082
C00083
COC08A
COOC85
COC'066
COC087
COC088
COOC89
COCC90
C00091
COCC92
COC093
COOC94
COOC95
COOC96
C00097
C00098
C00099
C00100
COC101
000102
100103
C0010*
C00105
COC106
COC107
C00108
C00109
COC110
COC111
C00112
008
008
006
008
008
008
008
008
008
008
008
008
008
008
008
008
008
008
008
008
008
008
006
008
008
008
008
008
008
008
008
008
008
OOfc
008
008
008
008
008
008
008
008
008
008
008
008
008
OOfc
008
008
006
003
OOfc
008
008
006
006
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C
C

CR




100
110








115




120

125

130

135
CR





INPUT FROM PARAMETER FILE ...

IDEN = DATA IDENTIFIER
ICODE = 1, AUTOCORRELATION ANALYSIS.
= 2, NORMALIZED CUMULATIVE PERIOD06RAM
= 3, DO CODES 1 AND 2.
ITYPE = CC01 , X-AXIS IS LINEAR.
= 0010, Y-AXIS IS LINEAR.
= 0100, X-AXIS IS LOGARITHMIC.
= 1COO, Y-AXIS IS LOGARITHMIC.
NTC1 = NO. OF ASCII CHARACTERS IN TIT1.
TIT1 = UPPER TITLE FOR GRAPH 1.
NXC1 = NO. OF ASCII CHARACTERS IN XARR1.
XARR1 = X-AXIS LABEL FOR GRAPH 1.
NVC1 = NO. OF ASCII CHARACTERS IN YARR1.
YARR1 = Y-AXIS LABEL FOR GRAPH 1.
NTC2 = NO. OF ASCII CHARACTERS IN TIT2.
TIT2 = UPPER TITLE FOR GRAPH 2.
NXC2 = NO. OF ASCII CHARACTERS IN XARR2.
XARR2 = X-AXIS LABEL FOR GRAPH 2.
NYC2 = NO. OF ASCII CHARACTERS IN YARR2.
YARR2 = Y-AXIS LABEL FOR GRAPH 2.

READ 3,ND,NS,IDATEB,ITIMEB,IDATEE,ITIMEE
PRINT4,ND,NS,IDATEB,ITIHEB,IDATEE,1TIMEE
DO 110 1 = 1, NS
DO 100 J=1,ND
OC=-99.9
CONTINUE
CONTINUE
NT = 1
DO 135 1=1, NC
READ 3,10ATES,1TIMES,I$ITE,ISTC,IWSC,IWDC,OCS,PCS
IF (10ATES.EO.IDATEB.AND.ITIMES.LT.ITIMEB) GO TO 135
IF (IDATES.EC .IDATEE.AND.ITIHES .GT.ITIMEE ) GO TO 135
IF (I.6T.1) GO TO 115
IDATED=IDATES
ITIMED=IT1MES
IF (IDATES.E8 .IDATED) GO TO 120
IDATED=1DATES
NT=NT+1
IDATE (NT)=IDATED
GO TO 125
IF (IT1MES.EQ .ITIMED) GO TO 130
NT=NT+1
ITIMED=ITIMES
ITIME (NT)=ITIK£D
OC(NT,ISITE ) = OCS
PC (NT.ISITE ) = PCS
CONTINUE
PRINT 5, NT
PI2=2.0*PI
RNT=NT
97

-------
COC/113
C001U
COG115
C00116
C00117
C00118
COG119
C00120
COC121
C00122
COt 123
C00124
C00125
C00126
C00127
C00128
C00129
COC130
C00131
CCC132
C00133
COG134
C00135
C00136
C00137
000138
COC139
000140
COOU1
COC142
COC143
COG144
COOU5
C00146
000147
C00148
COC149
C00150
C00151
C00152
COC153
C00154
OOC155
C00156
C00157
C00158
C00159
C00160
C00161
COG162
000163
C00164
COC/165
C00166
C00167
C00168
C00169
006
008
008
012
006
012
008
008
008
ooe
OOfe
008
008
008
008
008
012
012
008
008
011
011
011
011
011
011
011
008
008
008
008
008
006
012
008
008
008
006
008
008
008
008
012
008
008
008
008
008
008
008
012
012
012
012
012
006
006




CR
C10

c








c
139
140

C
C









145
CR

150









155
CR

160
CR
C
C
C
C
C
C


ROOTN=S6RT(RNT>
JN=NT/2
RJN=JN
PRINT 10,RNT,ROOTN,THON,PI2
FORMAT (/1H .10F12.4)
DO 300 IS = 1fNS
     DETERMINE THE  RESIDUAL  TIME  SERIES.
SUMR=0.0
DO 140 1=1, NT
OCS=OC(1, IS)
PCS=PC
IF (OCS.LT.C.O.OR.PCS.LT.G.C)  €0  TO 139
RTSCI>=OCS-PCS
SUMR=SUMR+RTS(I>
60 TO 140
       WHENEVER OC  OR  PC  IS  INVALID SET RTS = -99999.9
RTSU>=-99999.9
CONTINUE
RBAR=SUMR/NT
     DETERMINE THE  AUTOCORRELATION FUNCTION (ACF) OF THE R.T.S
      RTS = RESIDUALS
      RBAR = MEAN OF THE  RESIDUALS
      SUNR2 = VARIANCE OF  THE  RESIDUALS
      MTMK = TIME LAG
      NT = NO. OF POINTS

SUMR2-0.0
DO 145 1=1, NT
RMR=RTSCI)-RBAR
CONTINUE
PRINT 6,IS,RBAR,SUMR2
IF (ICODE-2)  15C,19C,150
XMIN=O.O
X«AX=16.0
YMIN=-1.0
TMAX= 1.0
DO 160 K=1,JN
SUM=0.0
NTMK=NT-K
DO 155 L=1,NTMK
IF CRTStL >.LE.-99999.9.0R.RTS(L*K).LE.-99999.9) 60 TO 155
SU«=SUM+ < RT S (L)-R BAR)* (RTS (L*K) -RBAR)
CONTINUE
ACFCK)=SUH/SUMR2
ACFCK)=(SUM/SUHR2)/(NTHK/RNT)
CONTINUE
PRINT 7,(ACF(K),K=1 ,JN)
     PLOT THE  AUTOCORRELATION  FUNCTION AND CONFIDENCE BANDS.

       IN THE  FOLLOWING  DO-LOOP THE UPPER LIMIT OF K DETERMINES
 THE MAXIMUM  TIME  LAG.   AS  A DEFAULT IT CAN BE SET TO HALF THE
 NUMBER OF SAMPLES (JN)  IN  THE TIME SERIES.

AUL=1.96/ROCTN
ALL=-AUL
                    98

-------
COC170
C00171
£00172
COC173
£00174
£00175
C00176
COC177
£00178
C00179
C00180
000181
£00182
COG183
£0om
COC185
£00186
C00187
C00188
C00189
C00190
COC191
C00192
COC193
£00194
COC195
£00196
£00197
C00198
COC199
OOQ200
C00201
COC202
C00203
C00204
C00205
C00206
C00207
COC208
000209
£00210
COC211
C00212
C00213
C00214
C00215
C00216
C00217
COQ218
C00219
C00220
C00221
C00222
C00223
C00224
COC225
£00226
OOfc
008
OOfc
006
006
008
006
009
009
008
008
008
008
006
008
006
008
008
008
008
008
008
008
008
006
008
008
008
008
008
008
008
008
006
006
011
011
011
011
012
008
008
008
008
008
008
008
006
008
012
008
008
008
008
008
008
008

c













c







c

C RHA




165



C
C
C
C
C
190
200












210


220
CALL  SETUP  (NTC1 ,TIT1 ,NXC1,XARR1,NYC1,YARR1)
      DRAU  THE  PLUS AND KINUS  95  PERCENT CONFIDENCE LIMIT?
XX<1)=0.0
YY(1)=AUL
XX (2)=XMAX
YV(2)=AUL
CALL  LIKE  (12)
CALL  XNEAT(C)
CALL  XTICS(?)
CALL  NPTS  (2)
CALL  CHECK  (XX,YY)
CALL  DSPLAY 
CALL  ORAWA  (XC.YC)
CONTINUE
CALL  FRAME
CALL  HDCOPY
IF (1CODE.E0.1)  60 TO 3CQ
      DETERMINE  THE NORMALIZED CUMRliLATIVE PERIODOGRAM.
      CNP =  PARTIAL SUH OF KFD/SUN  OF  KFI)
      FI =  FREQUENCY
      TWON  = 2.0/NT

J=0
J=J + 1
FI(J)=J/RNT
IF (J.6T.JN) GO  TO 230
SUM=0.0
DO 220 1=1,J
FIPI2=FI(I)*PI2
SUHC-0.0
SOMS=0.0
CO 210 L=1,NT
IF (RTS(L).LE .-99999.9) 60 TO 210
FIPL=FIPI2*L
SUMC = SUHC-»RTS(L)*COS(FIPL)
SUMS=SUMS+RTS(L)*SIN(FIPL)
CONTINUE
FIF=TWON*(SUMC*SUWC«SUMS*SU"S)
SUM=SUM+FIF
CONTINUE
               99

-------
C0t227
C00228
C00229
C00230
COG231
C00232
000233
COG234
C00235
C00236
COC237
C00238
C00239
C00240
C00241
C00242
C00243
000244
COC245
COC246
COC247
COC248
C.00249
C00250
C00251
C00252
C00253
C00254
C00255
C00256
C00257
CQC258
000259
C00260
COC261
COC262
C00263
COC264
000265
L00266
COC267
(.00268
COC269
C00270
COC271
C00272
C00273
C00274
COQ275
COC276
C00277
COC278
C00i79
COQ2&0
C00261
COC282
C002fc3
006
008
008
008
006
008
008
008
DOS
008
008
008
006
008
008
008
008
008
008
009
010
006
008
008
OOfe
008
009
008
009
009
009
009
009
008
008
008
008
008
008
008
008
009
008
006
004)
006
006
038
00&
OCb
00V
ooe
008
009
009
009
009


c
230

240









CR
C


CR








C





C
c
c
c
c







c





c
CR
CR
CR
CR
CNP(.
GO T'

DO 2'
CNPf
CONT
XIKIN
YHIN
XHAX
THAX
DLINI
SLOPI
ANGLI
COSA
B = OL
PRIN

CALL
CALL
CALL
CALL
CALL
CALL
CALL
CALL
CALL
CALL
CALL

XX(1
YY(1
XX(2
YY(2
CALL


BED


XX(1
YY(1
XX(2
YY(2
CALL
CALL
CALL

XX(1
YY<1
XX (2
YY(2
CALL

CALL
CALL
CALL
CALL
      2CO
     DETERMINE  THE  STRAIGHT LINE PARAMETERS.
   240 J=1,JN
CNP(J)=CNP(J)/CNP(JN)
      UE
      .0
      .0
      .5
      .0
      1.96/ROOTN
      YMAX/XHAX
ANGLE=ATAN(SLOPE)
     COS(ANGLE)
  OLINE/COSA
PRINT 10,DLINE,SLOPE,ANGLE,COSA,B
     PLOT THE NORMALIZED CUMULATIVE PERIODOGRAM VS. F8E8UENCY.
CALL SETUP  (NTC2,T1T2,NXC2,XARR2,NYC2,YARR2)
       EPSd)
       ZES  (0.5)
       
-------
COG264      00?    CR     CALL  CHECK (XX,TV)
000285      009    CR     CALL  OSPLAt (XX,YY)
C00286      008          CALL  FRAME
COC287      006          CALL  HDCOPY
C00288      008    300   CONTINUE
COC289      008          CALL  FINITT (0,700)
COC290      008          END

END ELT.
                    101

-------
D.4   Subroutine M21ADO*STAT02.SETUP
•ELT.L
ELTC07
COCC01
COCQ02
COCOC3
COOCOA
C00005
QOC006
COC307
COC008
COCG09
COOC10
COCQ11
COC012
C00013
COGC14
COCQ15
COCC16
C00017
COOQ18
COCQ19
COCC20
COCQ21
C00022
C00023
COC024
COOC2S
COOC26
COC027
COOC28
C00029
COOC30
C00031
COOQ32
C00033
COC034
C00035
OOOC36
COC037
C.OCC38
COCQ39
C00040
COC041
COC042
COCC43
COGG44
000045
C00046
CO€C47
COCC48
C00049
C00050
COOC51
COCC52
COC053
COOC54
COUu55
S2. SETUP
SL73R1 11/
004
004
004
004
004
004
006
004
004
004
004
004
004
004
006
006
006
007
006
007
006
006
004
004
004
004
004
004
004
004
004
004
004
004
004
004
004
004
004
004
004
004
004
004
004
004
004
004
004
004
004
008
008
004
004

01/78

C HOI
C
C
C
C




C AS!









98


C





C




C
















CR
CR
C
100
                   j9:39:31  (8,)
                    SUbROUTINE SETUP (NTC i TIT,NXC,XARR,NYC,YARR)
                   [FIED  BY  ROD ALLEN, COMP-AID INC.,  OCTOBER  1978

                         THIS ROUTINE SETS UP THE TEKTRONIX  tRAPHICS  PACKAGE, SETS
                    INITIAL  LIMITS FOR THE GRAPH AND DRAWS  THE  FKAME  AND LABELS.

                    COMMON  /DAT/ XK1N ,XPAX ,YMIN ,YMA X,ITYPE,1C CDE,IS
                    DIMENSION XARR(1>,1ARH<1>,TIT(1)
                    CALL  INITT (12O
                    CALL  TERM(2,1024)
                ASSUMES TEKTRONIX 4014
                    CALL  HEADER
                    CALL  CHRSIZ<2>
                    CALL  BOX(C,C,1C23,7?0>
                    CALL  MOVABS(10,760)
                    CALL  AOUTSH17,'TIME SERIES, CASE')
                    ENCODED,98 .CASE) ICODE
                    CALL  AOUTST(2.CASE)
                    CALL  AOUTSTdO,', STATION ')
                    ENCODEC2.98.CASE) IS
                    FORMAT(I2)
                    CALL  AOtTST (2.CASE)
                    CALL  BIMTT
                         SET THE SCREEN LIMITS FOR X AND  Y.
                    CALL  PLACE (3HSTD)
                    CALL  XFRM (3)
                    CALL  YFRM (3)
                    CALL  XMFRM (3)
                    CALL  YMFRM (3)
                         PLOT THE HAJOR-HIHOR TIC MARKS  ON  THE  AXES.
                    CALL  DLIHX (XMIN.XMAX)
                    CALL  DLIMV (YMIN.VHAX)
                    CALL  XNEAT (1)
                    CALL  YNEAT (1)
                         DETERMINE THE  CALL YTYPE(2)
                    ITYPE=1TYPE-1000
                    IF  (ITrPE.GT.1C) CALL XTYPEC2)
                    ITYPE=ITYPE-10C
                    IF  (ITYPE.6T.1) CALL YTYPEd)
                    ITYPE=ITYPE-10
                    IF  (ITYPE.GT.O) CALL XTYPEd)
                    CALL  MOVABS(300,50)
                    CALL  AOUTST(NXC.XARR)
                    CALL  QUOTE(SO. ,1SO.,.1S,YARR,90.,NYC)
                    CALL  MOVABS(300,30)
                    CALL  AOUTST(NTC.TIT)
                    IF  (ICODE.LE.1) GO TO 100
                    CALL  HOVABS(30C.630)
                    CALL  AOUTST(34,'DASHED LINES 951 CONFIDENCE  LIMITS')
                    IF  (XMAX.6T.1.C) GO TO 10C
                    CALL  MOVABS (30C.760)
                    CALL  AOUTSTO2, 'PERIOD (1/F)')
                         DRAW A STANDARD FRAME.
                    CALL  FRAME
THE
                                       102

-------
LOGC56      GC<.          RETURN
COCC57      OOA          END

END ELT.
              103

-------
D.4   Subroutine  M21ADO*STAT02.USESET
     •ELT,L S2.USESET
     ELTC.G7 SL73R1 11/01/78 09:39:55 11.)
     UOOC01      OCO         SUBROUTINE USESET  (FNUK,IbIDTH,NBASE , LAGEL 1 )
     C.OCC'02      001   C MODIFIED BY ROD ALLEN,  COHP-AID  INC.,  OCTOBER  1978
     COCC03      001         DIMENSION LA6ELH1)
     COOC04      001         FNUnB=1.0/FNU«
     COGC05      001         CALL FfORM (FNUMB , 1W1DTH,1 ,LABELI ,32 )
     COCG06      000         RETURN
     COCGC7      000         END

     END ELT.
                                     104

-------
             APPENDIX  E




CHI-SQUARE GOODNESS-OF-FIT LISTINGS
                105

-------
E.I  Control Element  Example, M21ADO*STAT03.CASE1
SELT.L
ILTC07
COCC01
IOCC02
COCC03
COC004
000005
COC006
COCC07
COC008
000009
C00010
C00011
COC012
COCC13
S3.CASE1
SL73R1 1
001
000
004
003
003
003
003
003
003
003
003
000
001
                                1/01/78 Q9:4Q:46  (4.)
                                   SXOT *21AP.O*STAT03.CHIFIT
                                   (CHI)
-------
E.2  Program Map,  M21ADO-STAT03.MAPIT
                  •ELT.L
                  ELT007
                  C00001
                  COGC02
                  COCD03
                  COOC04
                  COOC05
                  COC006
                  C00007
                  cocooe
                  C00009
                  COG010
                 £ND ELT.
S3 .MAPIT
SL73R1  11/01/78 09:41:36 (2.)
     001   i*AP ,M21ADO*STATC3.CHIFIT
     001   IN M21ADC/*STATOI.CHIFIT
     001   IN «21ADO*STATQ3.HISTO
     001   IN M21 AD J*STATQ3. SETUP
     001   IN M21ADG*STAT03.ILINE
     OOi   IN SRI*SRI.BOX
     002   IN SRI*SRI. HEADER
     002   IK RAPS*UTUITY.CCHPOZ
     000   LIB 6RAPH*TEKTROMX
     000   END
                                      107

-------
E.3  Listing of the Main Program, M21ADO*STAT03.CHIFIT
iELT.L
ELT007
COC001
COC002
C00003
COCOOA
C00005
COCC06
000007
CQCOOB
COOC09
COC010
C00011
C00012
COGQ13
coocu
COOC15
C00016
COG017
C00018
C00019
COC020
COC021
COOC22
C00023
C0002A
COOC25
C00026
C00027
C00028
C00029
COCQ30
C00031
COCQ32
COOQ33
GOG03A
C00035
C00036
COC037
COGG3?
COC039
COCOAO
COOOA1
COCOA?
COCCA3
COOCAA
LOGCA5
COGCA6
COGOA7
COOCA8
COCCA9
COCC50
COC051
COC052
C00053
COCC5A
COCC55
S3.CHIFIT
SL73R1 1
OOA
OOA
OOA
ooe
006
008
006
OOA
OOA
OOA
OOA
OOA
OOA
OOA
OOA
OOA
OOA
OOA
OOA
OOA
OOA
OOA
OOA
OOA
OOA
OOA
OOA
OOA
OOA
OOA
OOA
OOA
OOA
OOA
OOA
OOA
OOA
OOA
OOA
OOA
OOA
OOA
OOA
OOA
OOA
OOA
OOA
OOA
OOA
OOA
GOA
OOA
OCA
OOA
UOA
1/01
c
c
c
c
c
c
c
c













c
c
c
c
c
c
c
c
c
c
c
c
c
c
c
c
c
c
c
c
c

/78 u9:A1:17 (8,)

CHI-S8UARE GOODNESS-OF-FIT TEST.

THIS PROGRAM COMPUTES THE CHI-SQUARE STATISTIC AND PLOTS
FREQUENCY DISTRIBUTION FOR PREDICTED AND OBSERVED CONCENTRATIONS!
THE DIFFERENCES AND PERCENTAGES.

MODIFIED BY ROD ALLEN, COUP-AID INC., OCTOBER 1978
COMMON /DAT/ XMIN.XMAX ,YMIN ,YHAX,NCLAS,XC LA S(21),ICLAS(21>, ITYPE
COMMON /HNM/ XMIN1 , XMI N2 , XM AX1 , XMAX2 , YMIN 1 , YMI N2 , YMAX 1 , YM AX?
DIMENSION IDATE(123),ITIME(123>,ISITE<123>,OC(123>,PC(123),IDEN(5>
1,OBSD<21>,PRED<21),PMOD<21>,TITinC),TIT2<10>,TIT3(10>,TITA<10>,
2YARRK10>,YARR2(10>,YARR3<10>,YARRA<10>,PMOP(21>
DATA NCLAS.KCLAS1 /10.11/
1 FORMAT (//37H CHI SQUARE 600DNESS-0 F-FIT TEST FOR ,5A6/>
2 FORMAT C10A6)
3 FORMAT ()
A FORMAT 
-------
100056
IOGC57
COCC58
COGQ59
(.00060
COCOM
C00062
COGC63
C00064
COG065
C00066
COC067
COOC68
COCC69
COG070
COOC71
COOQ72
COC073
COG074
C00075
COOC76
COOC77
COGC78
C00079
cocoeo
COGC61
COC082
COOC83
COOC84
COCC85
COCJC86
C00087
COQQ88
C00089
COCCVO
COUC91
COCC92
COC093
COCQ94
COCC95
COG096
COLC97
COCC98
COCC99
COC100
C00101
C00102
C0010?
C00104
C00105
100106
COC107
cocioe
COC109
C00110
COC111
C00112
^064
00*
004
004
004
004
004
004
004
004
004
004
004
004
004
004
004
004
006
005
004
004
004
004
004
004
004
004
006
004
004
004
004
004
004
004
004
004
004
004
004
004
OG4
004
004
004
004
004
004
004
004
004
004
004
004
004
004
C »!
c
C
c
c
c
c
c
c
c
c

CR





CR
99







50
CR
60
C
c
c










100




110



c


115
C
      FROK'CATA EASE  FILE  ...()             II

     ND = ->NC. OF  DATA.
     NS = NC. OF  STATIONS.
     1DATE = DATE  OF  OBSERVATION
     ISITE = STATION  NO.
     ITIHE = TIME  OF  OBSERVATION
     ISTC,H.SC,IWDC  ARE NOT USED.
     OC = OBSERVED CONCENTRATION
     PC = PREDICTED  CONCENTRATION

READ 3,ND,NS
PRINT  4,ND,NS

XMIN1=*1.CE10
X«AX1=-1.0E10
DO 60  1 = 1,ND
READ 3,lDATE(I),ITIfE
XMAX1=AHAX1(XKAX1,PC(I),OC(D)
XMIN1=AMIN1
-------
COG113
OOG114
£00115
C00116
C00117
COG118
C00119
C00120
COC121
C00122
C00123
000124
C00125
C00126
COC127
C00128
C00129
CDC130
COC131
COC132
COG133
COC134
COC135
COC136
COG137
COC138
C00139
COOUO
C00141
COC142
COGU3
CQ014*
COC145
COOU6
COOU7
C00148
COOH9
C00150
COC151
C00152
C00153
C00154
C00155
C00156
000157
004
004
304
004
004
004
004
004
004
004
004
004
OG4
007
004
004
007
004
004
004
004
004
004
004
004
004
004
004
004
004
004
004
004
004
007
007
004
004
004
004
004
007
004
004
004
c
c
















c
c
c







c
c
c














120
125
130
135
140
145
150
                             DtTERHINE  THE  NURc-ER OF PC IN EACH OF  10  CLASSES.

                        DO 120  1 = 1, N
                        INO=PC(I)/OELTX+1.C
                        If UNO .6T.NCLAS)  IND=NCLAS
                        PRED(IND)=PREDUND)+1.C
                        CONTINUE
                        PRED(NCLAS1>=PRED(NCLAS>
                        00 125  1 = 1 ,NCLAS
                        YMAX1=AMAX1 (YHAXl.PPEDU))
                        CONTINUE
                        CHI2=0.
                        IF CItODE-2)  130,135,130
                        CALL HISTO  (MCLAS 1 , OBS D ,PRE O.NTC1 ,NTC2 , TITl ,TI T2 , N YC1 ,N YC ? , YARR1 ,
                       1YARR2,ICODE,CHI2«N)
                        IF (ICODE.E0.1)  60  TO 150

                             DETERMINE THE  NUMBER OF PC-OC IN EACH  OF  10  CLASSES.

                        YBAX1=-1.CE10
                        Y«IN1=+1.0E10
                        DO 140  I=1,NCLAS1
                        PflOD=PREt(I>-OBSD(I>
                        YMAX1=AHAX1 (YPAX 1 .PHOD (I ) )
                        YHIN1=A«INUYHIN1,PMOO(I))
                        CONTINUE

                             DETERMINE THE  PERCENTAGES OF (PC-OO/OC IN  EACH  OF  10 CLASSES,

                        T*AX2=-1.CE10
                        DO 145  I=1,NCLAS1
                        IF(OBSDtI).LE.1.)  06SD(I)=1.
                        CHI2-CHI2«PHOD(I)*PMOD(I)/OBSD(I)
                        PMOP(I )=100.0*PHOD( J)/OBSO(I)
                        YMAX2=AMAX1 (YHAX2,PfOP(I))
                        YMIN2-AHIN1 (VMIN2 tP^OPd))
                        CONTINUE
                        CALL HISTO  (NCLAS1,PMOD,PNOP,NTC3,NTC4,TIT3,TIT4INYC3,NVC4,VARR3,
                       1YARR4.ICODE ,CHI2,N)
                        CALL FINITT  (0,700)
                        STOP
                        END
END ELI.
                                              110

-------
E.4   Subroutine M21ADO*STAT03.HISTO
SELT,L
ELTG07
COCC01
C3C-C02
COC003
COC004
C00005
COLC06
COQC07
COLC08
C00009
COCC10
COC011
COG012
COOG13
cocou
i.00015
COC016
OOC017
100018
COLC19
COCG20
C00021
COC022
COCC23
C0002*
COC025
C00026
C00027
COG028
C00029
COC030
COC031
C00032
COC033
COCC34
COCC35
COCC36
CQOC37
COC038
COUC39
COG040
C00041
COOC42
COG043
COC044
COC045
CCOC46
tOuC47
COOOA8
IOCC49
COOC50
C00051
C00052
COCC53
COIC54
COC055
S3.HISTO
SL73R1 11/
009
012
009
009
009
013
U09
009
009
009
009
009
009
009
009
009
009
009
009
009
009
009
009
009
009
009
009
009
009
009
009
009
009
010
010
009
009
009
009
009
009
009
009
009
009
009
009
010
009
009
009
009
009
00V
009

01/78


C MOD





CR 1
CR 2
CR
CR

CR
CR
1CO
CR
CR

CR
CR
110
C RHA

C RHA







C
CR OR




C







C




C



                   39:41:30 (13.)
                    SUb ROUTINE  HISTO  (NCl,YlfY2,NTCl»NTC2tTITl,TITC,NYClfNrC2,¥ARR1,
                   1YARR2.ICODE ,CH12 ,N)
                   IFIED BY ROD ALLEN,  COMP-AID INC.,  OCTOBER  1978
                    COMMON /OAT/ XMIN,X"AX,YMIN,YMAX,NCLAS,XCLAS(?1),ICLAS(21),ITYPE
                    DIMENSION Y1(NC1),TIT1(1),YARR1(1),Y2(NC1),TIT2(1)f
                   1YARR2(1),YY(21),AOUT(6)
                    COMMON /MNM/XMINl,XMIN2,XI«AXl,XMAX2,YMlM,YriN2.YMAXltYMAX2
                    DATA YY /21*C.C/
                    FORMAT 
-------
COC056
C00057
CD0058
COCC59
COOG60
C00061
COC062
COGC63
COGC64
000065
COOC66
COCC67
COGG68
C00069
C00070
C00071
COC072
COC073
C00074
C00075
C00076
COC077

END ELT.
011         CALL MOVABS  (10,760)
009         CALL AOUTST(33,'CHI-SQUARE GOODNESS-OF-FJT, CASE
009         ENCODEd ,101, CASE)  ICOOE
009   1C1   FORHATU1)
009         CALL AOUTSTd .CASE)
009   C RHA BOX AROUND  PLOT
009         CALL BOXiO.C,1C23,7?0)
009         CALL BOX(0,C,1023,390)
012   C PRINT CH12 AND  N  IN  BOX
012         IF(CHI2.LE.C.)  GO  TO  80
012         CALL BOX<849,0,1023,33)
013         ENCODE (36,81, ACJUT)  CHI2.N
012   81    FORHATCCHI-SOUARE  =' , 1P68 . 2 , AX ,'N =',I6,3X)
012         CALL NOVABS(853.A)
012         CALL CHRSIZC3)
013         CALL AOUTST(9,AOUT(5))
012         CALL MOVABSC&53.18)
012         CALL AOUTSK2C.AOUT)
012         CALL CHRSIZ(2)
012   £0    CALL HDCOPT
009         RETURN
012         END
                                     112

-------
      E.4  Subroutine M21ADO*STAT03.SETUP
•ELT.L
ELTC07
COCQ01
100002
COCC03
00000*
LOk.C05
OOC006
COCC07
COCG08
C00009
COCC10
COCC11
100012
COOC13
coccn
COCC15
C00016
C00017
COC018
C00019
C00020
COOC21
COCC22
00 CO 23
COCC24
COCC25
COC026
COG027
COC028
COCQ29
C00030
IOCC31
COU032
UOU033
COOC34
C.OOQ35
000036
COCC37
000038
COC039
S3. SETUP
SL73R1 11/
302
002
OC2
302
002
002
002
002
002
006
002
002
002
002
002
002
002
002
002
002
002
002
002
002
002
002
002
C02
002
003
002
002
004
004
005
002
002
002
002

01/78 C9:41:45 (6,)
SUBROUTINE SETUP (NTC ,TIT ,N YC , Y ARR , I PLOT , LAc-X Y ,L AP Y Y ,LAl-T Y )
C MODIFIED BY ROD ALLEN, COUP-AID INC., OCTOBER 157?
C
C THIS ROUTINE SETS UP THE TEKTRONIX GRAPHICS PACKAGE, SETS THE
C INITIAL LIMITS FOR THE GRAPH AMD DPA»S THE FtfAME AND LAPELS.
C
DIMENSION T 1T(1>, YARR ( 1)
CCCIMON /DAT/ XMN,XKAX,YMIN,YMAX,NCLAS,XCLAS<21),ICLAS<21),ITYPF
CALL B1NITT
CALL CHftSI2(2>
C SET THE SCREEN LIMITS FOR X AND Y.
CALL PLACE (IPLOT)
CALL XFRM (3)
CALL YFRM (T)
CALL XKFRM (3)
CALL YMFRM (3)
C PLOT THE KAJOW-fllNOR TIC MARKS ON THE AXES.
CALL DLIMX (XPUN , XM AX )
CALL DLIHY (YMIN.YMAX)
CALL XNEAT (1)
CALL YNEAT (1)
C DETERMINE THE (X,Y) AXES TYPE.
IF (ITYPE .67.100) CALL YTYPE<2)
ITYPE=ITYPE-1000
IF (ITYPE .GT. 10) CALL XTYPE<2>
ITYPE=ITYPE-10C
IF CITYPE.6T.1) CALL YTYPE(1)
ITYPE=ITYPE-1D
IF (ITYPE. 6T.O) CALL XTYPE<1)
CALL HOVABS <300,LA8XY)
CALL AOOTST(19, 'CONCENTRATION CLASS')
C RHA 6UOTE IS EPA NCC CALCOMP SYfBOL ROUTINE FOR TEKTRONIX
YPAGE=LABYY
CALL QUOTE(50.,YPA6E,.15,YARR,VC.,NYt)
CALL TSEND
CALL MOVABS <3TG,LABTY)
CALL AOUTST (NTC.TIT)
RETURN
END
fcND  ELT.
                                        113

-------
                 APPENDIX F




BIVARIATE REGRESSION AND CORRELATION LISTING
                      114

-------
         F.I   Control  Element  Example, M21ADO*STAT04.CASE6
«ELT,L SA .CASCC
ELTC07 SL73R1 11/01/78 C9:<.3:4<:
LOGOG1      o01
COCC02      000
C00003      OCA
COOC04      000
C00005      000
COC006      000
COCC07      003
COCCOf      U03
COG309      003
C0001C      003
COC011      003
COC012      003
LOOC13      303
C0001A      003
COC015      003
COC016      002
COOQ17      001
                  O.X8T
                  (CHI ) (U)/ ((-)
                   6 0011
                  6.31 2.92 2.35 2.13 2.02 1.9*. 1
                                 1.72 1.72 1.7J 1,
V l.f-6 1.53 1.M 1.3C 1.7» 1.77  1.76  1.?5  1.75
71 1.71 1.71 1.71 1.7J 1.70 1.70  1.70  1.6?  1.67
1.7* 1.73 1.73
1.66 1.645
36 (CHI)(U/0) -- I'MTS  (ir**-6)«<**»-?)
22 ObSERVEO CONCtNTRAT ION
23 PREDICTED CONCFNTHAI ION
11 SCATTER&RAM
23 REGRESSION LINE (SOLID LINE)
3C SENSITIVITY PAKDS  (SMALL  DASH)
33 90* CONHOENCE BANDS (SMALL  DASH)
3C PROBABILITY BANDS  (LARfE  DASH)
58 90X CONFIDENCE (SMALL DASH)  PROBAttlLITY  (LARGE  BASH)  oANDS
 101 3
SADD M21ADO*STATCJ1.COQS2N
END ELT.
                                              115

-------
F.2  Program Map,  M21ADO*STAT04.MAPIT
                       .  S4.MAPIT
                  ELTC07  SL73R1  11/01/78  C9:44:00  (2,)
                  OOOC01      001   iMAP  ,M21ADO*STATU.REGANA
                  COC002      001   IN W21ADC*STATQ4.REGANA
                  COCC03      001   IN «21AOO*STAT04.STAB
                  COOC04      001   IN K21ADG*STAT04.LINLS6
                  COCQOS      002   IN SDI*SRI.BOX
                  COCC06      002   IN SRI*SRI.HEADER
                  COCC07      002   IN RAPS*UTILITY.COHPOZ
                  COC008      000   LIB 6RAPH*TEKTRONIX
                  100009      000   END

                  ENC ELT.
                                      116

-------
F.3  Listing of the Main Program,  M21ADO*STAT04.REGANA
»ELT,L
ELTCC7
OOGG01
COCC02
COCG03
COG004
COL005
C00006
COOC07
C00008
C00009
COC010
C00011
COUG12
COG013
L00014
C.00015
C00016
£00017
COC018
COC019
COC020
COOQ21
COC022
COGG23
OOC02A
COOC25
COOQ26
COCC27
COOC28
C00029
COCC30
GOCQ31
COGC32
COCD33
COC034
C00035
COOC36
COCC37
LOCC38
COCC39
COOOAO
CCGC41
COCC42
COCC43
C00044
COCOAS
COG046
CO CCA 7
£00048
COQC49
COC050
COOC51
C00052
COCQ53
COOC54
COOC55
SA .REGANA



SL73R1 11/01/7? 09:44:08 C15,)
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
012
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
c
c


REGRESSION ANALYSIS PROGRAM
MODIFIED BY ROD ALLEN, COUP-AID INC., OCTOBER 1978
COMMON /LSC/ RECNOP ,A ,B,XSD ,YSO ,C I L ,C IU ,S XKX6 , RC , RMSE ,ESD
DIMENSION X1(39),X2<39),X3(39),Y1(39),Y2(3V),Y3<39),YRL(1


,XPAR
23),IDATE
U123), niME<123),ISlTE<123),OCU23),PC(123), ID EN(5), TAB (34), XARR
2<10),YARR<1C),TIT<1C),XX(123),YY<123),ZARR(10>,7AR<10>,AOUT<8)



1
2
3
U
5

6
7



8
9
C
C
C
C
C
C
C
C
C
C
C
C
c
c
c
c
c
c
c
c
c
c
c

CR





CR


DIMENSION Y CLP (123) ,YC LK ( 1 23) ,Y PLP ( 1 23 ) , Y PLM ( 1 23) ,XS(123)
DATA XM1N,YHN,XMAX,YMAX / 1 0. ,1 Q. , -1 .OE1 0 ,- 1 .OE1 O/
DATA N1 ,N2,N3,NE6,YOIG /0,0 ,0, 0 ,-1 . CE1 O/
,YS(123)


FORMAT 
FORMAT 

INPUT FROM PARAMETER FILE ...

IDEN = DATA IDENTIFIER.
ICODE = 0, NO GRAPHICAL OUTPUT.
= 1, PLOT SCATTER GRAPH.
= 2, ADD THE REGRESSION LINE TO CODc 1.
= 3, ADD THE SENSITIVITY BOUNDS TO CODES 1-2.
= A, ADD THE CONFIDENCE BOUNDS TO CODES 1-2.
= 5, ADD THE PROBABILITY BOUNDS TO CODES 1-2.
- *, ADD THE CONFIDENCE AND PROBABILITY BOUNDS
ITYPE = 0001, X-AXIS IS LINEAR.
= 001C, Y-AXIS IS LINEAR
= 0100, X-AXIS IS LOGARITHMIC.
= 1CCO, Y-AXIS IS LOGARITHMIC.
NTC = NO. OF ASCII CHARACTERS IN THE TITLE.
NXC = NO. OF ASCII CHARACTERS IN THE X-AXIS LABEL.
NYC = NO. OF ASCII CHARACTERS IN THE Y-AXIS LABEL.
ZARR = GRAPH LOWER TITLE.
XARR = X-AXIS LABEL.
YARR = Y-AXIS LABEL.
TAB = STUDENT-T TABLE FOR 90 PERCENT C.L. AND N-2

READ 2, IDEN
PRINT 1.1DEN
READ 3, ICODE, ITYPE
READ 3, (TAB (L),L = 1 ,34)
READ 9, NTC, TIT
RLAD 9, NXC, XARR
READ 9, NYC, YARR
PRINTS, ICODE, ITYPE, NTC, NXC, NYC
DO 60 1 = 1 ,6
IF (l.Nt.ICCDF) GO TO 50



3X4HNYC:


4X4H R =

E10.3//
.3/>












TO CODES










D.O.F .











                                                                           1-2.
                                 117

-------
COOC56
000057
COOC58
COC059
C00060
C00061
COOC62
C00063
CQGC64
COC065
COC066
C00067
C00068
C00069
C00070
C00071
C00072
COOC73
COOG74
C00075
C00076
C00077
COCC78
C00079
COCG60
COOC81
C00082
COC083
COOC8A
COOQ85
C00086
COOC87
COG088
COC089
COGC90
100091
COOC92
COC093
COGC94
COC095
COOC96
C00097
COOC98
COCC99
COC100
COC101
C00102
COC103
C00104
C00105
COC106
COC107
C00108
C00109
COC110
COC111
C00112
011
011
011
011
011
011
011 •
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
READ 9.NZC, 7ARR
GO TO 6«,
50 READ 9.NZ.2AK
60 CONTINUE
C
C INPUT FROM DATA BASE FILE ...
C
C ND * NO. OF DATA.
C NS = NC. Of STATIONS.
C IDATE = DATE OF OBSERVATION
C ISITE = STATION NO.
C ITIHE = TIME OF OBSERVATION
C ISTC ,IbSC ,IbDC ARE NOT USED.
C OC = OBSERVED CONCENTRATION
C PC = PREDICTED CONCENTRATION
C
1CO READ 3,ND,NS
CR PRINT 4,ND,NS
N = 0
DO 120 1=1, ND
READ 3,lDATE(I),ITIWE.LT.O.O.OR.PCU).LT.O.O> GO TO 115
N = N*1
OC(V )=OC( I)
PC(N)=PC(I)
YRAX=AHAX1(YKAX,OC(N> , PC(N) )
IF (ISITE(I).GT.I) GO TO 105
N1=N1+1
X1 (N1)=OC GO TO 11C
N2=N2*1
X2(N2)=OCU )
Y2(N2)=PCCI)
JF (Y2(N2).GT.YBIG) YBIG=Y2(N2)
60 TO 120
110 N3=N3+1
X3(N3)= OCU )
Y3
-------
(.30113
COC1U
COC115
000116
COC117
C00118
C00119
COC120
C00121
C00122
C00123
£00124
C00125
C00126
COL127
COC128
C00129
COC130
C00131
COC132
C00133
C00134
C00135
COC136
C00137
000138
C00139
C00140
coom
C00142
000143
000144
COOU5
C00146
COG147
C00148
COG149
COG150
COG151
030152
C00153
000154
C00155
C00156
C00157
COC158
COC159
C00160
COC161
C00162
C00163
COU164
C00165
COC166
C00167
COC168
COC169
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
Q11
011
011
011
011
012
011
011
011
011
011
011
011
011
011
011
011
011
011
IF CICODE.EU.'") £0 TO ',3d
IF (ICODE.NE.3) GO TO 145
c
C PLOT THE SENSITIVITY BOUNDS ( '_ . 1 * Y"A X >
C
13C CONTINUE
CR PRINT 6
YFACT=J.1*YB1G
00 135 1=1, NN
YPLP(I)=YY
CALL AOUTST (33, 'LINEAR REGRESSION ANALYSIS,
ENCODE(1,99,CASE) ICODt
99 FOR«AT(I1)
CALL AOUTSTd .CASE)
C PRINT LEGENDS
CALL CHRSIZO)
AN = N
IFdCODE.EQ .3) AN=n
ENCODE (48 ,95, AOUT) B,A,RC,AN
95 FORHAT(4( 1PG8.2.4X))
CALL nOVABS(4,4)
CALL AOUTST(3,*N =*)
CALL AOUTST(8,AOUT(7))
CALL MOVABS(4,18>
CALL AODTST(3,'R =')
CALL AOUTST (8 ,AOUT(5) )
CALL MO*ABS<4 ,32)
CALL AOUTST(3,'B =')
CALL AOUTST 
-------
 C0u170
 C00171
 100172
 COC173
 COC174
 C00175
 COC176
 £00177
 C00178
 COC179
 C00180
 COC181
 COC182
 COC183
 C00184
 C00185
 C00186
 COC187
 COC.188
000189
 C00190
000191
 COC192
 COC193
 C00194
 COC195
 C00196
 COC197
000198
 C00199
 COC200
 COC201
 COC202
 C00203
 C00204
 COC205
 COC206
 COC207
 CO 0208
000209
 COC210
 COC211
 COC212
 C00213
 C00214
 IOC215
 C00216
 COC217
 COC218
 COC219
 C00220
 COI221
 C00222
 C00223
 COG224
 COC225
 COC226
011
011
011
011
011
011
C11
ou
014
011
011
011
011
011
014
015
011
011
013
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011















E5


8C

c










c

c




c







c







c


9CX CONFIDENCE  BOUNDS'
IDEAL LINE")
SENSITIVITY  POUNDS')
 IF(ICODE.Eft .1.OR.ICODE .E8.5) 60  TO  8C
 CAi_L HOVA6S (72C,4)
 CALL AOUTST (31t'SOLID LINE  - LEAST  SQUARES LINt')
 CALL MOVABS (720,18)
 IF(ICODE.E6 .4)  CALL AOUTST ( 33,'DASH  LINE
 IF(ICODE.EO .2)  CALL AOUTST(22 ,'DASH  LINE
 IFUCODE.E6 .3)  CALL AOuTST(30,'DASH  LINE
 IFdCODE.NE.6)  CALL B OX (716 ,0 ,1 023 , 3 '(. )
 IF
-------
CGC227
CCU22P
(.00229
COC230
COG231
CCG232
CDC233
OOJ234
COG235
COL236
COD237
COG238
COG239
C00240
COG241
£00242
CQC243
000244
COG245
COC246
COC247
COG248
COG249
COC250
C00251
COC252
000253
C3C254
GOC255
C00256
C00257
COC258
C00259
COC260
C0u261
CCl'262
COC263
COC264
COC265
COC266
C00267
£06268
OOC269
COG270
OOG271
COC272
COQ273
C00274
OOG275
C00276
COC277
C.OG278
CQ1279
CCG2SO
COG2S1
COG202
COC2S3
011
011
011
011
01 1
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
Oil
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
011
C11
011
011
011
011
011
011
011
011
011
011
011
C11
011

c




c
c
c

CK 0





c
c
c








150



c
t
c







160





c
t
c
165






   CALL  CPLOT  (X2,Y<:>
         3KD STATION  (SI.UARCS).
   CALL  SYMBL  (4)
   CALL  NPTS (S3)
   CALL  CPLOT  (X7.Y3)
   IF  (ICODE.Et.D  GO  TO 18C

         PLOT THE REGRESSION LINE  (SOLID)
   CALL  STtPL  (1)
ORIGINAL  AGII  FANUAL
   CALL  LINE (C)
   CALL  NPTS (NN)
   CALL  SYMBL  (0)
   CALL  CPLOT  (XX,YY)
   IF  (ICODE.GT.2)  GO
USED C  FOR  SOLID LINE
 TO  150
         PLOT THE PERFECT LINE  (DASH).

   XX (1)=XMIN
   YY(1)=XMN
   XX (2)=XMAX
   YY(2)=XMAX
   CALL  LINE (12)
   CALL  NPTS (2)
   CALL  CPLOT (XX,YY)
   GO TO  180
   IF (ICODE.EQ.3)  60  TO 175
   RECNP1=RECNOP+1
   FACT1=STAB(N,TAB)*ESD
   IF (ICODE.EC.5)  GO  TO 165

         PLOT THE 90  PERCENT CONFIDENCE BOUNDS.

   DO 160  1=1,NN
   XBXB = XX (I)-XBAR
   DIV I = XMXB*XWXB/SXMXP
   FACT2=SCRT(fiECNOF+DIVI)
   FACT3=FACT1*fACT2
   YCLPd ) = YY( D + FACT3
   YCLM I )=YY( I) -FACT3
   CONTINUE
   CALL  LINE(12)
   CALL  NPTS(NN)
   CALL  CPLOT (XX,YCLP)
   CALL  CPLOT (XX.YCLPl)
   IF (ICODE.EQ.4)  GO  TO 160

         PLOT THE PROBAPILITY BOUNDS.

   DO 170  1=1,KN
   XMX9 = XX (I )-XBAR
   D I V I = X M X b * X f" X B / S X f X P
   FACT6 = SGRT(RECNP1+DIVI )
   FACT7=FACT1*FACT6
   YPLPd )=YY( D + FACT7
   YPLWd )=YY(I)-fACTi>
          121

-------
            011     170   CONTINUE
jOD2£5      011     175   CALL LINE <3O
100286      011          CALL NPTS (NM)
000287      011          CALL CPLOT (XX.YPLP)
COC288      011          CALL CPLOT (XX.TPLM)
COQ289      011     180   CONTINUE
COC290      011          CALL HOCOPV
C00291      011          CALL F1N1TT (0,700)
C00292      011    C           END OF PLOT.
C00293      011          END

END ELT.
                      122

-------
F.4   Subroutine M21ADO*STAT04.LINLSQ
iELT.L
ELTCC7
COG001
COGCG2
COCG03
C3CC04
COLCC5
iOCGG6
COGCG7
CObOOS
CQ0309
COCC10
LOGC11
COGJ12
COCC13
COCCU
>.OLC15
LOC016
CQC017
COCCU
COUC19
COCC20
LOIC21
COCC22
COLJ23
COLG24
000325
COC026
L3CC27
COG02?
COOC29
COGC30
COC031
COG032
COCC33
COIC34
COGC35
COCC36
COG037
COGQ38
LOGC39
COGC40
COGC41
COCCA2
COCGA3
COGQ44
COGOA5
COOC46
OOGOA7
COCC48
COCOA9
COCC50
COOG51
COOC52
COOC53
LOCD5A
SA .LINLSG
SL73R1 11/
30C
000
000
OOG
000
oco
ceo
OOG
000
000
000
oco
000
GOu
000
300
OOG
000
000
000
000
000
000
000
000
000
000
000
000
000
000
coo
000
000
000
000
000
000
000
000
000
000
000
000
000
000
000
000
DOC
ooc
OGC
000
000
OOU

01 17".

t
C
C


















50
100





















105








                   J9 :43;5t  (C, )
                    SUBROUTINE  LINLSu ( X , Y ,NO D , YR L )

                          YEAR  =  A •> fc'XTAR
                            /LSu/ PtCNOP,A,bfXSD,YSC,CILiCIUrSXi^Xr,nC,RMSt,tSD.
                    DIMENSION  X (NOD),Y(NOD),YKL(NOD)
                    SUMX=O.C
                    SUMY=O.C
                    SUMXt=D.O
                                                                                  xr-AR
                    SUMY2=0.0
                    SWX«Y2=C.C
                    NBAO=0
                    DO 100  1=1, NOD
                    IF 
-------
       F.4  Subroutine M21ADO*STAT04.STAB
sELT.L S4.STAB
ELT007 SL73R1 11/01/78
COCC01      000
COC002      000   C
COOG03      OOC   C
COOOOA      000   C
COOG05      000   C
COOQ06      000
COC007      000
C00008      000
C00009      000
C00010      000    1
C00011      000
C00012      000    100
COOC13      000
000014      000
COOQ15      000    110
C00016      000
C00017      000
000018      000    120
C00019      000
COOC20      000
COOC21      COO    130
C00022      000
C00023      000
COC024      000    140
C00025      000
000026      000

END ELT.
09:44:14 (C,)
 FUNCTION STAB UNO,TAB)

      ESTIMATION Of POPULATION MEAN  USING  THE  STUDENT-T DISTRIBUTION
 yiTH 90 PERCENT CONFIDENCE  INTERVAL  AND 2  DEGREES  OF  FREEDOM.

 DIMENSION TAB(34)
 NU=IND-2
 IF (NU.6T.O) GO TO 100
 PRINT 1,NU
 FORMAT  60 TO 13C
 STAB=TAB(32>
 RETURN
 IF (NU.GT.120) GO TO 140
 STAB=TAB<33>
 RETURN
 STAB=TAB(34)
 RETURN
 END
                                             124

-------
              APPENDIX G




INTERSTATION ERROR CORRELATION LISTINGS
                   125

-------
G.I  Program Map, M21ADO*STAT05.MAPIT
                     •FLT.L  S5.MAP1T
                     EL-U07  SL73R1  11/01/78 09:46:01 (0.)
                     COOC01      000    IN STATG5.COKEL2
                     COC002      OOG    IN STATG5 .LINLSC
                     COLCO?      000    IN STAT05.XYCORR
                     COLG04      000    END

                     END  ELT.
                                     126

-------
G.2  Listing of the Main Program, M21ADO*STAT05.CORHL2
iELT.L
ELTC.07
LOCL01
COuC02
COC303
COCCCK
COLC05
COL306
COCC07
C00008
COCC09
IOC010
COCC11
CQCC12
LOCG13
COCCU
COC'C15
C00016
COC017
COCC18
COCQ19
C0t020
coorzi
COOC22
COC023
COGC24
COCC25
COLC26
COGC27
COCG28
COOC29
C00030
LOG031
COC032
COG033
COG034
IOCG35
COGC36
COCG37
LOGu38
COGC39
COCC40
CPG041
COGC42
COCC43
COuC<,«
IOCC45
COCC46
LOOCA7
C.OUC48
COCC49
COCQ50
COGC51
COC052
IOG053
000054
IOUC55
S5 .COREL r
SL73R1 11/
000
001
C01
001
001
001
001
001
000
001
001
001
001
001
001
000
000
000
001
001
001
001
001
001
OC1
001
001
000
001
001
300
OOG
000
coo
001
001
001
u01
oco
OOu
000
oco
ooc
001
001
000
001
001
001
001
001
001
001
000
001

01 /7,fi



1
?

T
t,

5
6
7

8
9
c
t
c
c
t
c
c
c
c
c
c
c
c
c
c
c







1CO
110
c
c
c






115




uo

:<9:45:5u (1.)
COMMON /LSC,/ Rt Cr,OP ,A ,t ,X SD ,Y SD ,C I L ,t I U , i, Xf At , KC , f * ? t ,L '. D
DIMENSION PC(123,3),OC(12:',3),IOATE(123),niKCl12''),COI
-------
CXC56
IOCC57
COGC58
COCC59
CQG060
COC061
CQCC62
COG063
COGS64
000365
COCC66
G00067
LOCC68
COC069
COCC70
C.OCC71
C00072
COC073
COCC74
COOC75
IDOC76
COCC77
CCGC78
C00079
COOObO
C00081
COCC62
COOG83
COOCbA
C00085
COG086
COL.387
CCCCbB
OOU089
COGC90
COC091
COGC92
COOC93
CD0094
COG095
COGC96
LOCC97
C0tu98
C00099
C00100
COC101
COU102
J01
U01
001
001
001
001
UOL
OC1
000
000
GOO
001
000
000
000
000
000
001
001
001
001
001
001
001
000
001
001
001
000
oco
000
000
000
001
001
001
000
000
OOG
000
001
001
001
001
000
000
OOG

125

130


135

c
c
c



c
c
c
2CO







210


220
230
C
c
c



240
C
C
C




250


                         ITIMtD=lTIMcS
                         ITIKE  (NT)=ITIKED
                         IF  (OCS.LT.C.C.OR.PCS.LT.r.C) GO TO 135
                         PCCNT, ISITt ) = PCS
                         OC(NT,ISITE ) = OCS
                         CONTINUE
                         IF  (IOPT.GT .1) 60  TO  210

                              OPTION 1: DETERMINE THE CORRELATION  6ETUEEN AIvY TkO  SITES.

                         CALL XYCORR (NT,OC<1,IS1),PC<1,IS1) ,OC (1,IS2)tPC(1, I S2 ) )
                         PRINT  A ,NT,RC ,CIL,CIU
                         STOP1

                              OPTION 2: DETERMINE THE CORRELATION  AND  CONFIDENCE LIMITS  MATRIX,

                         DO  230 1 = 1, NS
                         DO  220 4 = 1,NS
                         IF  (I.Ett.J) GO TO  210
                         CALL XYCORR (NT.OC(1,1), PC(1,1),OC(1,J), PC (1 ,J>>
                         COR»(I,J)=RC
                         CONL(I,J)=CIL
                         CONUd, J)=CIU
                         60  TO  220
                         coRnd ,J) = 1.0
                         CONL(I,J) = 1 .0
                         CONUd, J)=1 .0
                         CONTINUE
                         CONTINUE

                              PRINT CUT THE  CORRELATION MATRIX.

                         PRINT  5,d,I = 1,NS)
                         DO  240 1=1,NS
                         PRINT  6 ,1 , SCORP (I ,J),J=1,NS)
                         CONTINUE

                              PRINT OUT THE  LOWER AND UPPER  CONFIDENCE LIMITS.

                         PRINT  7,(I,I=1,NS)
                         DO  250 1=1,NS
                         PRINT  9,1 ,(CONL(I ,J),J = 1,NS)
                         PRINT  8,(CONU(I,J),J = 1 ,NS)
                         CONTINUE
                         STOP;;
                         END
ENt. ELT.
                                              128

-------
      G.3   Subroutine  M21ADO*STAT05.XYCORR
«ELT,L
ELTC07
OOOC01
COCQ02
COC003
COC004
COCG05
COC006
C00007
COC008
LOC009
COC310
COG011
£00012
COCC13
COCQU
COU015
COC016
COCC17
COCC18
COGG19
C00020
COOC21
S5 .XYCORR
SL7iR1 11/
001
000
001
001
000
001
OOu
001
001
001
001
001
001
001
jOO
000
000
000
001
ooc
000

01/76




C
C
C







100
C
C
C



                       09:^6 -.03  C1,)
                        SUEROUT1NF  XKCORR  (NT , C,C1 ,P C 1 , OC2 , FC2 )
                        COMMON /LSU/  RECNOP.A, B.XSO , Y S D , C I L , C I U , S XM Xb , R C .RflSE ,t SD
                        DIMENSION OC1,PCl(NT>tOC2(NT),PC^,DC2(12?>,YRl(12
                       13)

                             COhPUTf  (OC-PC)  FOR  FIRST SITE.
                        00 100 J = 1|M
                        IF (OC1(J).LT.C.C.OR.PCl(J).LT.O.O.OK.OC2(J).LT.:.u.OR.PC?(J).LT
                       10.0) 60 TO  100
                        NN=NN+1
                        DC1(NN)=OC1 (J)-PCK J)
                        DC2(NN)=OC2 (J)-PC2( J)
                        CONTINUE

                             COMPUTE THE  LINEArt  CORRELATION BETWEEN TUO SITES.

                        CALL LINLSQ  ( DC 1 , D C 2 ,N N , Y RL )
                        RETURN
                        END
END ELT.
                                            129

-------
                                           TECHNICAL REPORT DATA
                                  (Please read instructions on the reverse before completing)
1 REPORT NO
   EPA-600/4-80-013C
                                                                         3. RECIPIENT'S ACCESSIOf»NO.
4. TITLE AND SUBTITLE
  EVALUATION OF THE REAL-TIME AIR-QUALITY MODEL USING
  THE RAPS DATA BASE
  Volume 3.  Program User's Guide
                                                                         5. REPORT DATE
                                                                            February  1980
                                                                         6. PERFORMING ORGANIZATION CODE
7 AUTHORIS)
                                                                         8. PERFORMING ORGANIZATION REPORT NO.
  R.E.  Ruff, H. Shigeishi, and  R.H. Allen (Comp-Aid, Inc.)
                                                                          Final Report
                                                                          SRI Project 6868
9 PERFORMING ORGANIZATION NAME AND ADDRESS

  SRI International
  333 Ravenswood Avenue
  Menlo Park, California 94025
                                                                         10. PROGRAM ELEMENT NO.

                                                                          I AA603  AA-26 (FY-77)
                                                                         11. CONTRACT/GRANT NO.

                                                                          68-02-2770
12. SPONSORING AGENCY NAME AND ADDRESS
  Environmental Sciences Research Laboratory -
  Office of Research and Development
  U.S. Environmental Protection Agency
  Research Triangle Park. North Carolina 27711
                                                                          13. TYPE OF REPORT AND PERIOD COVERED
                                              RTP, NC
                                                                           FINAL 8/77-4/79
                                                                          14. SPONSORING AGENCY CODE
                                                                           EPA/600/09
15 SUPPLEMENTARY NOTES
16. ABSTRACT
  The theory and programming of statistical tests for evaluating the Real-Time Air-Quality Model (RAM) using the
  Regional Air Pollution Study (RAPS) data base are fully documented in four volumes.  Moreover, the tests are
  generally applicable to other model evaluation problems.  Volume 3 presents the software used in the statistical
  tests for evaluating the RAM.  Six statistical tests are described, with attention to the programming philosophy
  behind them.  Also presented is a review of the auxiliary  software that sort, retrieve, format, and display  the data.
17.
                                       KEY WORDS AND DOCUMENT ANALYSIS
                      DESCRIPTORS
  *  Air pollution
  *  Mathematical models
  *  Evaluation
  *  Tests
  *  Computer systems programs
  *  Statistical tests
                                                         b.IDENTIFIERS/OPEN ENDED TERMS   c.  COSATI Field/Group
                                                           Real-Time Air-Quality Model
                                                           Regional Air Pollution Study
                                                              Data Base
         13B
         12A
         14B
         09 B
13. DISTRIBUTION STATEMENT


  RELEASE TO PUBLIC
                                                         19. SECURITY CLASS (This Report I
                                                           UNCLASSIFIED
21. NO. OF PAGES
         138
                                                         20. SECURITY CLASS (This page)
                                                           UNCLASSIFIED
                                                                                           22. PRICE
EPA Form 2220-1 (9-73)
                                                       130

-------
<*          .'

-------