EPA-R4-73-012, Vol. b
                        CR-2-273/1
USER'S  GUIDE TO DIFFUSION/KINETICS (DIFKINj CODE
                       FINAL REPORT
                  Contract  No. 68-02-0336
                      J.  R. Martinez
                      R. A. Nordsieck
                     M. A. Hirschberg
                      December 1973


                      Prepared for
              Environmental Protection Agency



         GENERAL  n

         RESEARC-II  VP CORPORATION
         P.O. BOX 3587, SANTA BARBARA, CALIFORNIA 93105

-------
          ROUTING AND TRANSMITTAL SLIP
1 TO (Name, office  symbol or location)
       EPA
       Region  III  -  Library
       Curtis  Building
                                                    COORDINATION
                         	
       6th walnut btreets
       Philadelphia, PA   19106
                                                    INFORMATION
                                                    NOTE AND
                                                    RETURN
                                                    PER CON -
                                                    VERSATION
                                                    SIGNATURE
REMARKS
  A revised version  of volume  b  of the final  report on
  contract 68-02-0336 has been received.   The original
  version  was published in October 1972 and was releasec
  through  NTIS (PB 220 243/0).   The new version is  datec
  December 1973 and  replaces the October  1972 version.
       Do NOT use this form as a RECORD of approvals, concurrences,
             disapprovals, clearances, and similar actions,
FROM
         , office symbol or location)
  Jeannette  M.  Gore
  Technical  Publications  Branch
                                                 3/12/74
                                                  537
OPTIONAL FORM 41
AUGUST 1067
GSA FPMR ( 4ICFR)  100-11.206
                                SPO   043—10—8H18-1  419-015
                                                       5041-101

-------
                     CR-2-273/1
USER'S  GUIDE TO  DIFFUSION/KINETICS  (DIFKIN)  CODE
                    FINAL  REPORT
             Contract No. 68-02-0336
                 Jose  R.  Martinez
               Richard A. Nordsieck
               Morton  A.  Hirschberg
                   December 1973
                 Prepared  for
        Environmental Protection Agency
                                              :'',. ?-i.:\-!y.'.:','iti:,} Proisefein Agency
                                              !'.. •';.!! lii. ir; formation Resource
                                              ('-•,:\\:i \^?t';'j2}

                                              Fi.^s^iphia.PA  19107      ..-..

-------
                                ABSTRACT


      This manual is intended for users of General Research Corporation's
Diffusion/Kinetics (DIFKIN) code for simulating photochemical smog.   The
general structure and operational capabilities of the code are described.
Detailed instructions for program use are provided to assist prospective
users in operating the code.

-------
11

-------
                                CONTENTS
SECTION                                                       .     PAGE

1
2


3





4





5






	 — 	 f.
ABSTRACT
INTRODUCTION
INPUTS
2.1 Reading the Data Cards
2.2 Problem-Control Inputs
OUTPUTS
3.1 Trajectory-Generation Outputs
3.2 Source Emissions Output
3.3 Summary of Input Data Used to Compute
Concentrations
3.4 Output of Species Concentrations
3.5 Utility Outputs
TECHNIQUES FOR USING DIFKIN
4.1 Changing the Chemical Model
4.2 Multiple Runs
4.3 Date and Time Subroutines
4.4 Cases with Constant Flux
4.5 Assignment of Peripheral Units
PROGRAM MODIFICATIONS
5.1 Adding New Wind Stations
5.2 Increasing the Number of Wind Stations
5.3 Changing Station Influence Radii
5.4 Increasing the Number of Measurement Dates
5.5 Changing the Station Azimuth Exclusion Sector
5.6 Increasing the Number of Trajectory Nodes
i
1
5
5
6
21
22
24
30
36
39
41
41
42
43
44
45
46
46
47
47
47
48

                  (Wind Vectors)                                     48
                                                                     iii

-------
   CONTENTS  (Cont.)

   SECTION	    PAGE
              5.7   Increasing the Permitted Number of Grid Line
                    Crossings                                          49
              5.8   Increasing the Maximum Number of Flux Change
                    Times                                              49
              5.9   Changing the Source Grid                           49
              5.10  Increasing the Maximum Number of Power Plants
                    and/or Oil Refineries                              50
              5.11  Increasing the Maximum Number of Species in
                    the Chemical Model                                 51
              5.12  Increasing the Maximum Number of Chemical
                    Reactions                                          51
              5.13  Increasing the Maximum Number of Mesh Points       51
     6        BOUNDARY CONDITIONS                                      55
     7        CONTROL OF INTEGRATION STEP SIZE                         56
  APPENDIX A  THE AIR TRAJECTORY  MODULE                                57
  APPENDIX B  THE FLUX GENERATION MODULE                                71
  APPENDIX C  LISTING OF INPUT  DECK PRODUCED BY SUBROUTINE PREDAT      81
  APPENDIX  D  COMMON  BLOCK LOCATIONS                                    97
  APPENDIX  E  LIST OF  SUBROUTINES AND  THEIR USE                       101
  APPENDIX  F  PROGRAM  LISTINGS                                         127
 APPENDIX G  COMPUTATION OF N02 PHOTODISSOCIATION RATE CONSTANT      221
             REFERENCES                                               239
iv

-------
                              ILLUSTRATIONS
NO.	   PAGE
1.1   Schematic of Diffusion Model for Air Pollution Simulation       2
1.2   Schematic Flow of DIFKIN Processing                             3
2.1   Process for Reading Data Used by DIFKIN                         5
3.1   Summary of Data Used for Calculating Trajectory                23
3.2   Description of Computed Trajectory                             25
3.3   Printer Plot of Trajectory                                     26
3.4   Directory of Cell-Boundary Crossings                           27
3.5   Source Emissions Along Air Trajectory                          28
3.6   Source Emissions as Used by Code                               29
3.7   Summary of Input Data                                          31
3.8   DIFKIN Output of Initial Concentrations                        37
A.I   Input Verification Display from Subroutine WINDY               61
A.2   Reverse Trajectory Development                                 66
A.3   Optional Extra Trajectory Output                               67
A. 4   WINDY Flow Chart                                               68
B.I   HC Emissions Adjustment for Morning Cold Starts                76

-------
VI

-------
                                 TABLES
NO.   	   PAGE
2.1   Problem-Control Inputs                                          7
2.2   Guidelines for Printer Plot Scaling                            13
4.1   Summary of First-Case-Only Inputs                              43
4.2   Peripheral Devices Used by DIFKIN                              45
5.1   Dimensions of Source Emissions Data Arrays                     50
5.2   Dimension Changes Required to Add More Species                 52
5.3   Dimension Changes Required to Add More Reactions               53
5.4   Dimension Changes Required to Add More Space Mesh Points       54
A.I   Wind Stations and Their Coordinates                            59
A.2   The Digital Wind Azimuth System                                60
B.I   Vehicular Emissions Data                                       73
B.2   Stationary Source Emissions Data                               74
B.3   Symbol Definitions                                             79
D.I   Common Block Locations for Intermodule Data Transfer           97
D.2   Common Block Locations in the Air Trajectory Module            98
D.3   Common Block Locations in the Flux Generation Module           98
D.4   Common Block Locations in the Chemical Module                  99
G.I   N09 Photodissociation Rate Constant as a Function of Solar
      Zenith Angle for Wavelengths 2900-3850 A                      222
G.2   Problem-Control Inputs for Computing k                        225
G.3   Standard Time Meridians of United States                      227
                                                                     vii

-------
Vlll

-------
1    INTRODUCTION
     This manual contains instructions for using the computer code, DIFKIN,
developed by General Research Corporation to model photochemical smog.
These instructions describe the features of the code which a user must
know in order to successfully utilize the program.  In addition, instruc-
tions are provided regarding certain modifications of the code.

     DIFKIN is written in FORTRAN IV compatible with the IBM 360 system.
The program contains 55 subroutines and operates in single-precision mode
requiring approximately 40,000 words (160,000 bytes) of core storage for
execution.

     Figure 1.1 is a diagram of the concepts used in the model.  An air
parcel moves along a path determined by the local prevailing wind speed
and direction at various times during the day.  The air parcel is divided
into a mesh of equally-spaced points in the vertical direction.  As the
air parcel moves over a region it receives pollutant emissions (fluxes)
from the ground.  The pollutants within the air parcel then undergo
chemical reactions and mixing, with the incident sunlight driving several
of the chemical reactions that occur.  At each mesh point, the concentra-
tions of several species of pollutants are computed; the output of the
program consists of these concentrations as functions of time and height.

     The program performs three major tasks; the three tasks are performed
sequentially and consist of:  calculation of an air trajectory; determina-
tion of source emissions (fluxes) along the trajectory's path; computation
of the concentrations of the various pollutants in the air parcel.

     The air trajectory is computed in subroutine WINDY.  The required
inputs are the starting location or a destination and the corresponding
starting or final time.  Additional inputs required for this task consist
of the wind data collected at the various stations located in the region
of interest.  Having obtained the trajectory, the next task is to calculate

-------
                             SUNLIGHT ISGIVEN AS
                             A FUNCTION OF TIME
                                         TIME-DEPENDENTMIXING
                                         AND REACTION IS COMPUTED
                                         FOR AIR PARCEL UP TO THE
                                         MIXING HEIGHT h
            SPACE/TIME TRACK
           -THROUGH THE SOURCE
            GRID IS DERIVED
            FROM WIND DATA
           -POLLUTANT INFLUXES AT ANY
            ELEVATION (INCLUDING THE
            GROUND) ARE IMPOSED BY THE
            EMISSION SOURCE FUNCTIONS
  Figure 1.1. Schematic of Diffusion Model  for  Air  Pollution Simulation
 the fluxes along the path of the air parcel.  This is done in  subroutine
 EFFLUX.   Three types of flux are computed:  nitric oxide, reactive  hydro-
 carbons,  and carbon monoxide.  Inputs required to obtain the fluxes are
 the spatial and temporal description of the sources present in the  area.
 The fluxes serve as input in performing the final task of computing the
 pollutant concentrations along the path of the trajectory as functions  of
 time  and  height.   These computations are carried out in the main  program.
 In  addition to the fluxes,  inputs required for these calculations are the
 initial concentrations  of the various pollutants, sunlight intensity, and
meteorological data describing the dispersion parameters along the
trajectory.  This  part  of the program thus combines chemical reactions,
emissions,  and atmospheric  mixing in obtaining pollutant concentrations.
The mathematical details  of these computations are discussed in previous
       1 2
reports '    and will  not be  repeated here.

-------
     Figure 1.2 is a simplified flow chart showing DIFKIN input, processing,
and output.  The user provides meteorological and source data, specifies
the trajectory parameters, and provides chemical rate constants and ultra-
violet radiation intensity.  The program computes the concentration of
each of the species at each mesh point at specified time intervals along
the path of the moving mass of air.

     It should be noted at this time that several subroutines used in
DIFKIN are specialized for the chemical model and in general must be
modified if the chemical model is changed.  These subroutines are discussed
in Sec. 4.1.  However, changes in the numerical values of the chemical
rate constants require no program modifications.  Hence the rate constants
can be changed at will simply by changing the appropriate input cards.
                                                                 -SPECIES, ETC.
            Figure 1.2.   Schematic Flow of DIFKIN Processing

-------
     The sections that follow describe the operation of the program.
Appendixes A and B contain more detailed explanations of the contents of
the trajectory-generation and flux-generation modules.  Appendix C
includes a listing of the input data deck generated by the program.
Appendix D contains a table of the location of the COMMON blocks.
Appendix E describes all the subroutines used in the code and Appendix F
contains a listing of the main program and all the subroutines.

     The determination of the parameters which depend on sunlight intensity
requires separate treatment because such a determination must be done out-
side DIFKIN.  The parameter in question is the rate constant of the photo-
dissociation of nitrogen dioxide, and a separate computer program called
ZENITH has been developed for computing its value.   The output of ZENITH
is a deck of cards containing a table of values of  the rate constant.
These cards then become part of the input of DIFKIN.   Appendix G contains
a description of the operation and use of ZENITH together with a listing
of ZENITH and its associated subroutines.

-------
2    INPUTS
     Before  discussing the input parameters, we shall provide  a  descrip-
tion of  the  input process.  This is  necessary because the proper logical
unit numbers must be assigned by the job control cards in order  to run
the program.

2.1  READING THE DATA CARDS
     The process of reading the data cards is illustrated in Fig.  2.1.
The data cards are read by subroutine PREDAT from the card reader, which
PREDAT refers to as unit 3, e.g., READ (3,N) LIST.  PREDAT reads the
data until  it detects an end-of-file mark or a card with the word  "MORE"
punched  in  Cols. 1-4, and then produces  a listing of the data  deck on the
line printer, which is designated as unit 6, e.g., WRITE (6,N) LIST.
Appendix C  shows an example of the output produced by PREDAT.  The sub-
routine  also writes the data on a scratch peripheral memory unit such as
a disk.  This unit is designated by  the  logical unit number 5.   After
writing  the  data on unit 5, the subroutine rewinds unit 5 and  the  data are
then ready  to be read by DIFKIN, which reads from unit 5.
              UNIT 6
            LINE PRINTER
              OUTPUT
        PREDAT PRODUCES A
        LISTING OF IMAGES
        OF DATA CARDS ON
        LINE PRINTER
                                 DATA CARDS
                                CARD READER
                                   UNIT 3
 SUBROUTINE
   PREDAT
SCRATCH DISK
   UNIT 5
DIFKIN READS
 DATA FROM
  UNIT  5
READS FROM CARD READER
TO WHICH IT ASSIGNS
LOGICAL UNIT NUMBER 3
PREDAT WRITES THE
DATA DECK ON UNIT 5.
UNIT 5 IS REWOUND
AFTER WRITING
         Figure 2.1.  Process  for  Reading Data Used by DIFKIN

-------
   2.2   PROBLEM-CONTROL  INPUTS
        The  input  parameters of the program will be discussed in  the  order
   in which  they are read by the code.  The reader should refer to Appendix  C,
   which contains  a copy of the listing produced by PREDAT, in order  to ob-
   tain  a better picture of the actual structure of the data deck.  Table 2.1
   shows a list of the problem-control inputs along with a description of
   the function of each input variable, the name of the variable used in the
   code,  and the format.   The input number refers to the position of  the
   particular input in the data deck,  but the input may consist of more
   than  one card.

       Several modes  of  operating  the code are available to the user.  One
  option is  to use the program simply to generate  wind trajectories without
  computing  the concentrations of  the various  pollutants.   This is accomplished
  by setting inputs 2, 3, 4  in Table  2.1 to NO (as opposed to YES).

      A second option is to input  a  trajectory which has  been computed
  externally.   In  this case  the user  sets  TRAJEX = YES (input number  2)
  and the wind trajectory is then input  as  specified  by inputs  number 18-20
  in  Table 2.1.

      A  third mode of operation allows  the user to input  fluxes  which
 have been determined externally.   Obviously,  there  is no need in these
 circumstances to compute or input wind trajectory data.  To use this
 option, set the variable EXFLUX = YES  (input  number  3, Table 2.1).

 2.2.1   External  Trajectory  Inputs
     If TRAJEX =  YES  (input number 2, Table 2.1), the wind trajectory
 is not  computed by the  program and the user can input any trajectory of
 his  choosing.

      The time (24-hr clock),  wind speed (miles per hour),  and azimuth
 (in  counterclockwise degrees  from east) at the nodes of the  trajectory
are input on the same card  in columns 41-50,  51-60,  61-70, respectively.

-------
      TABLE 2.1
PROBLEM-CONTROL INPUTS
Input
Number
1

2



3


4


5


6







7

8


9


.10


11



12

13

14




15


16


17



Variable Name
Used In Code
TITLE

TRAJEX



EXFLUX


GOAHED,
KPWIND

KPSTAT,
KPWDAT

NWDTE,
HAH,
APT, PT .


XIMPH


CONVRT

KXTRA


IDT,
XLCL

STIME


ID.XS,
YS


TTOTAL

DTSEG

AZ.VEL




ITF


IRF


NC




Variable Function
Label for each page of the
output
Wind trajectory la Input
from cards (YES) or com-
puted Internally (NO) .

Fluxes are Input from
cards (YES) or computed
Internally (NO)..
Species concentrations
computed (GOAHED-YES) or
not (NO). Wind trajec-
tory output in cards
(KPWIND-YES) or not (BO).
stations (KPSTAT-YES)
or not (NO) . Print
wind measurement data
(KPWDAT-YES) or not (NO) .
Date, Station name,, number
of compass points, and 24
digital azimuth readings.
NWDTE-999999 terminates
reading of all wind data.
24 wind speed measure-
ments corresponding to
the. 24 azimuths In PT.
Multiplier needed to con-
vert wind measurements to
miles per hour.
data with names of
measurement stations
used (YES) or not (NO).
Pate and local clock
time at trajectory
initial point.
Local time; either
STANDARD or DAYLIGHT.

Station name, X coordi-
nate and y coordinate
(statute miles) of
. Initial point.
Desired time duration
of trajectory, hours.
Time interval between
wind calculations, hours
Azimuth (degrees CCW
from east to vector
parallel to wind) and
velocity (mph) of
initial wind vector.
Trajectory is to be
generated forward (+1)
or backward (-1) in time.
Wind measurements
weighted as 1/R if (01)
or 1/R2 If (02).
Number of nearby measure-
ment stations desired
for each wind vector
Interpolation.

Format
(20A4)

(40X.A4)



(40X.A4)


(40X,A4,6X,
A4)

(40X.A4,
6X.A4)

(I6,1X,A4,
A2.15X,
F2.0.2X,
24F2.0)

(32X,
24F10.0)

(40X,
F10.0)
(40X.A4)


(40X.I6,
4X.F4.0)

(40X.A4)


(40X.A4,
A2.4X,
2F10.0)

(40X,
F10.0)
(40X,
F10.0)
(40X,
2F10.0)



(40X.I2)


(4QX.I2)


(40X.I2)




Remarks
May contain any comments user wishes to make.
All 80 columns of the card may be used.
This is a Hollerith variable which Is either
YES or NO. In either case the word must start
in column 41 and must contain n_o blanks. See
also Inputs 18-20.
See comment for input number 2 . See also input
number 30.

See comment for input number 2. The words begin
in columns 41 and 51, respectively.

*
will precede the first case output. See com-
ment for input number 2 .

Input in first, case only. See Sec. 2.2.3 for
explanation of use.







value will be replaced by 1.0 internally.

input number 2.

Date is year, month, day. Clock time is in
0-2400 system.

This is a Hollerith variable which is either
STAN or DAYL. See additional comments for
Input number 2.
See Sec. 2.2.4 for explanation of use.



See Appendix A.

Must be an even multiple of the measurement
interval. See Appendix A.
These optional inputs override the initial wind
vector calculation. Blanks or zeros yield
normal operation.


See Appendix A.


See Appendix A.


Acceptable input values are 01, 02, and 03.
See Appendix A for further explanation.



-------
TABLE 2.1 (Cont.)
Input
18
19
20
21
22

23

24
25

27
28
29
30
31
32
33
34
35
36
37
38
Variable Name
Used in Code

STIME
T, V, TH
XL.XR,
HEMP

CEMF

CARFAC,
FYFAC

PPFAC
ORFAC
FXFAC
FLXTIM,
FLXIN
(1,1),
FLXIN
(2,1),
FLXIN
(3,1)
BELT
TSTMAX
TSTMIN
UPLIM
LOWLIM
BELZ
SUNTIM

x, y coordinates of the
in statute miles.
Indicates whether local
time is daylight or standard.
Time, speed, and azimuth at
Left, Right, Bottom, and
plot (statute miles).
Average driving cycle emis-

grams/mile.
Driving cycle emission
from one cold start,
grams /mile.
Overall growth multipliers
source emissions.
Species emissions multipliers
for freeway vehicles.
for surface street vehicles.
NO emissions multiplier for
power plant sources.
Species emissions multipliers
for oil refinery sources.
Species emissions multipliers
Flux times and input fluxes.
Initial value of integration
step size in minuteg.
Step size control parameter.
Upper limit on step size.
Lower limit on step size.
Height of one cell of space
mesh in meters.
Time interval in minutes
for updating N02 photo-
dissociation rate constant,
V
Format
(40X.2F10.2)
(40X.A4)
(40X,3F10.3)
(30X.4F10.0)
(40X.3F10.0)

(40X.3F10.0)

(40X.2F10.0)
(40X.3F10.0)

(40X.F10.0)
(40X,2F10.0)
(40X.2F10.0)
(20X,
4E10.4)
(40X.F10.0)
(40X.F10.0)
(40X.F10.0)
(40X,F10.0)
(40X.F10.0)
(40X.F10.0)
(40X.F10.0)
Remarks
number 2) .
This is a Hollerith variable which is either
DAYLIGHT or STANDARD. The word must begin in
column 41 and must contain no blanks. Only the
See comment for input 18.
See Sec. -i.2.1 and comment for input 18.
See Sec. 2.2.5 for explanation of use.
NO , HC, and CO emissions. See Sec. 2.2.6 for
explanation of use.
NO HC and CO emissions. See Sec. 2.2.6
X*


NO , HC, and CO emissions.

NO only.
NO and HC.
NO and HC.
X
Input Is required only if EXFLUX=YES (input
number 3). See Sec. 2.2.2 .
The value of BELT Is changed by the code during
execution. The initial value should be small
as a general rule, e.g., BELT < 0.01 minutes.
See Sec. 7 for explanation of use.
The step size cannot be greater than UPLIM. A
typical value is 0.5 rain.
The step size cannot be smaller than LOWLIM.
A typical value is 0.002 min.
BELZ = H/(N-1) where H is the mixing depth
and N is the number of vertical mesh points
including the ground and the upper edge, where
N ° NOSTAT (aee input 53).
The updating is done periodically since kj^ is
a function of solar zenith angle. May have any
dummy value if k^ is held constant (see input
44). A typical value is 10 minutes.

-------
TABLE 2.1 (Cont.)
Input
Number
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
Variable Name
Used In Code
FIXSTP
KOUT
TIHOUT
KEVERY
S PUNCH
QRATE
QHTINV
COONLY
NUMSTP
NOREAC
NOSP1
NSTDY
NT RACE
NUMFLX
NOSTAT
SPEC,
WTMOLE
LOCFLX
PPHM
RATKON
REACT
STOYKR,
STOYKP
RATK1 '
HTINV
Variable Function

(YES) or variable (NO).
time steps (YES) or not (NO).
val (see card 7) the number
ut between print intervals,
nd the central processor
ime spent in the calcula-
ion (YES) or not (NO).
Print the concentrations
(YES) or not (NO).
Output concentrations on
punched cards (YES) or not
(NO).
N02 photodissociation rate
constant variable (YES) or
not (NO) .
Inversion height time-
varying (YES) or constant
(NO).
e.g., CO, is input (YES)
or reactive species are
also included (NO).
Maximum number of integra-
tion steps
Number of chemical reactions.
Total number of species.
Including reactive and non-
reactive species.
Number of reactive species
In steady state which are
to he explicitly calculated.
Number of non-reactive
(tracer) species.
• Number of species which
have fluxes.
Number of vertical mesh
points to be used.
Species name and molecular
weight.
Identifies the species
for which emissions are
present.
Initial concentration of
each species at each
mesh point in pphm.
Rate constants for chemical
reactions in units consis-
tent with species concentra-
tion, e.g., pphra~^ioin~^ .
Description of chemical
reactions in the model.
Stolchiometric coefficients
for react ant 3 and products.
Table of rate constants of
N02 photodissociation
reaction, k^ , in minute"!.
Table of diffusion coeffi-
cients as functions of time
and altitude, in meters
squared per minute.
Format
(40X.A4)
(40X,A4)
(40X.A4)
(40X.A4)
(40X.A4)
(40X.A4)
(40X.A4)
(40X.A4)
(40X.I10)
(40X,I10)
(4QX.I10)
(40X.I10)
(40X.I10)
(40X.I10)
(40X,I10)
(40X.A4,
6X,F10.2)
(40X.I10)
(20X.5E10.4)
(40X.F10.0)
(8A4)
(2F10.0)
(20X.E15.5)
(20X,
5E10.4)
Remarks

See comment for input number 2. The list contains
the number of the time step, the time at which
the integration step was performed, and the step
size used. The list is written on logical unit 9,

for an example of the output.
See comment for input number 2 .
See comment for input number 2. The format used
for punching is compatible with the format used
by DIFKIN for reading initial concentrations.
See comment for input number 2 . If QRATE = NO
there is no updating of k^ . See also comment
for input 38.
See comment for input number 2. See Sec. 2.2.14
for explanation.
See comment for input number 2,
Integer variable. Program execution is terminated
if NUMSTP is exceeded. A message is printed to
this effect to advise user.
Integer variable. Cannot exceed 20 with present
array dimensions.
Integer variable. Cannot exceed 20 with present
array dimensions.
Integer variable.
Integer variable. This number is either zero or
one. A zero means no tracer species is input.
Integer variable. NUMFLX ranges from 0 to 3.
See also inputs 30 and 55.
Integer variable. Cannot exceed 10 with present
array dimensions.
Each card contains the name and molecular weight
of one species. Thus the number of cards required
is NOSP1 (see Input 49). See Sec. 2.2.7.
See Sec. 2.2.8. Not needed if NUMFLX - 0
(input 52).
See Sec. 2.2.9.
One card per rftaction makes a total of NOREAC
cards In this group. See Sec. 2.2.10.
See Sec. 2.2.11
See Sec. 2.2.12.
See Sec. 2.2.13. Required only if QRATE - YES
(input 44).
See Sec. 2.2.14. Required only if QHTINV - YES
(input 45).

-------
 The time must be input as standard time on a 24-hr clock.  The wind  speed
 is specified in miles/hour and the azimuth in counterclockwise degrees
 from east.  Inputs 18-20 of Table 2.1 describe the order of the input
 data.

       The maximum number of wind trajectory inputs allowed with present
 array dimensions is 100; a diagnostic is printed and the job aborted if
 these dimensions are exceeded.   The last card in the wind data subdeck
 must contain a dummy negative time to stop the code from reading.

 2.2.2  External Flux Inputs
       This input is optional and is required only if EXFLUX = YES (see
 input number 3, Table 2.1).  The option allows the user to input any
 fluxes desired up to a maximum of three fluxes.

       The flux times are the times when fluxes are updated and must be
 specified in minutes from the start of the trajectory.   The first and
 last flux times are the initial and final times  of the  trajectory,
 respectively.   The flux times are input in columns 21-30 of the data card.
 A diagnostic is printed and the job aborted if the array dimensions are
 exceeded.  See input 30, Table  2.1.

       The fluxes which correspond to a flux time are input in columns
 31-40, 41-50,  51-60 of the same card which contains the flux time.  The
 user may input one, two, or three fluxes.   The number of fluxes input
 and the species to which the fluxes  correspond are specified in inputs
 52 and 55 (Table 2.1),  respectively.

       To stop  the code  from reading,  a card with a dummy negative time
 must be the  last card  of this input.

       See Sec.  4.4 for  a description of  procedures used when fluxes
 are constant.
10

-------
2.2.3  Wind Measurement Data
      Wind measurement data cards are read in pairs,  one pair for each
combination of measurement station and date.  The card formats for DIFKIN,
selected to correspond to those used by the Los Angeles County Air Pollu-
tion Control District (LACAPCD) are shown below.

Y


b9u91 1

2 "» * 5J5|?
" '
OSS? 0
EL MOHTJE IPiW:"
EL MOHTJE 14UD

0"3 'T1'04
OBS8 C-:C S ,80
05
o s i ~ •;
MFJH 4 :-: £ :Tj £ 1 £ ? ^j £
lfc|F'Tl£1314 fcj 710 5 51CJ11
4 fi
7 7i 4 in in
ylOlOirjlliilil
P8 29 33 31 37 33 34 35 3? 37 38 39 40 4M2 43 s4 ll « 47 48 4J 50 51 52 53 54 55 W S7 58 58 60 SI 62 C3 64 65 66 67
''•0
0339 ",
07
o i n i o
10 11 •,'
OBiaCO "d30JJS7aO

j « i 7 0
/ 1
rs 71 o
15
Gill 3
H pi K =, 4
oiLJiuiOio
bb b9 JO /I 72|73 7« 75 /& 77
16
,3 71 .

0,3 *.•
4 C
9ii
78 /9 HO
,,

Columns 1-6 contain the date in computerized form (year, month, day)
which is read into the word NWDTE as an integer.  Columns 8-13 contain
six alphanumeric characters identifying the measurement station.  This
identification is stored in Hollerith form in the two-word array, NAM.
Columns 14-28 of the first card are ignored by DIFKIN.  Columns 29 and 30
contain the value of APT, the number of compass sectors utilized in the
meteorological wind reporting system under which the program will interpret
the azimuth data on the remainder of the card.  Columns 31 and 32 are
skipped.  Table A.2 in Appendix A shows examples of the correspondence
between these digitized wind azimuths and their polar angles.  Twenty-four
digital azimuths are read from columns 33-80 into the array PT.  Moving
to the second card of the pair DIFKIN only reads the corresponding 24
wind speeds from columns 33-80, placing them in the array XIMPH.  In the
LACAPCD data, the wind measurements are hourly averages with the first
entry being the average for the 0000-0100 time period, the next for
0100-0200, etc.  Blanks or negative values in the PT and XIMPH arrays
are assumed to denote missing data.

      Array dimensions currently limit the number of data days to 10 and
the number of measurement stations to 51.
                                                                      11

-------
       Reading  of wind measurement  data  is  terminated when DIFKIN finds
 NWDTE = 999999 (see  card  234,  Appendix  C).

 2.2.4  The Trajectory Start  Point
       The initial  location,  for  either  forward  or  reverse trajectories,
 may be specified by  its x-y  coordinates  in  statute miles  or by station
 name if the trajectory is  actually intended to  originate  (or terminate)
 at that station.   Station  names  are six-character  Hollerith strings and
 are read into  the  2-word  array ID.   If  no x-y coordinates are supplied
 with the station name, DIFKIN  will look up  the  station  coordinates in
 its table of valid station names and locations  (see Table A.I, Appendix A).
 Given an x-y coordinate pair but no station name,  the program will check
 the location against known station coordinates  to  provide a station
 identification, if possible.   (Of  course, it is not necessary to start
 or end at a measurement station.)   If both  a station name and a coordinate
 location are specified, neither  is checked  for  internal consistency;
 the trajectory is  started  at the given  coordinate  point using wind data
 from the named station, if available.

 2.2.5  Printer Plot  Boundaries
       The printer  plot of  the  air  trajectory across the source grid
 provided as part of  the output from the  flux generation module (see
 Appendix B) may focus on  smaller areas  than the complete  grid.   The
 parameters XL, XR, YB, and YT  are  respectively  the x-coordinates of the
 left and right boundaries  of the plotted area,  and the  y-coordinates of
 the bottom and top (north) boundaries of the plotted area.   In the source
 grid currently used, these coordinates are  in statute miles.

       Because  of the quantization  involved  in using a line printer to
 produce a plot (fixed at 51  horizontal lines by 101 characters in this
 case)  certain  rules  of thumb should  be followed in selecting plot bound-
 aries  so as to yield plots with evenly spaced grid lines.   The basic rule
 is that the scale  between  horizontal  grid lines must be evenly divisible
12

-------
by the scale between print lines, and the scale between vertical grid
lines roust be evenly divisible by the scale between character positions.
Table 2.2 translates this rule into acceptable plot dimensions for the
2x2 mile grid squares used in the current model.
TABLE 2.2
GUIDELINES FOR PRINTER PLOT SCALING
Number of
Character
Positions
per
Grid Space
1
2
3
4
5
6
For Ax =
Character
Position
Scale
miles
2
1
.66667
.500
.400
.33333
2 mi
XR-XL
miles
200
100
66.667
50.0
40.0
33.333
Number of
Print Line
Spaces per
Grid Space
1
2
3
4
5
6
For Ay = 2
Print Line
Scale
miles
2
1
.66667
.500
.400
.33333
! mi
YT-YB
miles
100
50
33.333
25.
20.
16.667
      It is important to note that because character spaces are 0.6 as
large as line spaces, most scale combinations selected from Table 2.2
will yield rectangular grids rather than a "square" grid when plotted.
A square grid can only be obtained by maintaining a ratio of 3:5 between
the character position scale and the print line scale.   Thus the largest
area of a 2 x 2 mile grid which can be shown without distortion is 40
miles in x by 33.33 miles in y.

2.2.6  Vehicle Emission Factors
      HEMF and CEMF are each 3-word arrays which accept the average gram
per mile emission factors of NO , HC, and CO to be used for all vehicular
                               X
traffic.  The emissions in HEMF are taken to be emissions from a hot-start
cycle, excluding any cold-start or warm-up effects.  As such, they are
used for all freeway traffic in conjunction with correction factors to
account for average traffic speed.  The average speed associated with
                                                                      13

-------
 both HEMF and CEMF emission factors is that of the 1972 Federal  Driving
 Cycle  (FDC), 19.6 mph.  The CEMF emissions should correspond directly
 to the HEMF emission factors with the only difference being the  substi-
 tution of an initial cold start, replacing the hot-start.  FDC emission
 factors include the effect of a single cold start and hence may  be  used
 directly for CEMF.  Lacking data for the cold-start emissions differential,
 the user may input the same emission factors for both HEMF and CEMF,  thus
 either eliminating all cold-start emissions or spreading the cold-start
 over all vehicle miles traveled (including freeways).   Emissions from
 surface street vehicles are obtained as a weighted combination of HEMF
 and CEMF, depending on time of day, and excluding any corrections for
 average speed variation.  The reader should consult Appendix B for  further
 discussion of average vehicle emission factors.

 2.2.7  Species Name and Molecular Weight
       After input number 53, the name and molecular weight of each  species
 are input.  These are input on the same card using format (40X, A4, 6X,
 F10.2).  The name and molecular weight are stored in arrays SPEC and
 WTMOLE, respectively.  The number of cards input is NOSP1 (see Table  2.1,
 input 49).

       The order in which the species are input is important for program
 execution.  The program must have
        •    All active species first (in any order)
        •    NSTDY steady-state species next (in any order)
        •    The tracer species last (if any declared by NTRACE, input 51)
 The so-called active species are those  whose concentrations are computed
 by integration of the rate equations.   This is  in contrast  to  the steady-
 state species,  which are obtained  algebraically.

       This input  step determines the order  of  appearance of all the
 species in any  subsequent  inputs which  are  tied to the species.
14

-------
2.2.8  Specification of Species with Emissions
      The integer variable LOCFLX is a vector which contains the indexes
of the positions of those species which have emissions.  The order in
which species are entered was previously set in array SPEC.  The index of
the species location in SPEC is entered in LOCFLX if the species has a
flux associated with it.  For example, referring to Appendix C, cards 278-
287, we see that the species are ordered as follows:
            SPEC(l) = NO
            SPEC(2) = HC
            SPEC(3) = N02
            SPEC (4) = OZON
            SPEC(5) = HN02
            SPEC (6) = N03
            SPEC(7) = N205
            SPEC(8) = OH
            SPEC(9) = R02
            SPEC(IO) = CO
We have already specified in NUMFLX  (card 276, Appendix C) that there are
three species with fluxes, i.e., NUMFLX =3.  We also know that the program
computes fluxes for NO, HC, and CO.  NUMFLX = 3 means that all three
fluxes will be used.  Hence LOCFLX is set to
            LOCFLX(1) = 1
            LOCFLX(2) = 2
            LOCFLX(3) = 10
The order of the entries in LOCFLX is arbitrary and we could just as well
have set LOCFLX(l)  = 10, LOCFLX(2) = 1, LOCFLX(3) = 2 or to any other of
the 3! permutations of the three numbers.

            The entries of LOCFLX are entered one to a card using format
(40X,I10).   The number of cards is equal to NUMFLX (Table 2.1, input 52).
                                                                      15

-------
 2.2.9  Initial Concentrations  for Each Species
       The initial concentration of each species at each  mesh point in
 parts per hundred million  (pphm) is input next.  This  is stored in array
 PPHM, and PPHM(i.j) denotes  the concentration of the ith species at the
 jth mesh point.  The  format  used is (20X, 5E10.4) and  the input for each
 species is the concentration at each mesh point from bottom to top, with
 up to five mesh points  to  a  card as indicated by the diagram below.

            CONCENTRATION  AT  MESH POINT 1            CONCENTRATION AT MESH POINT 5
    PPHM           BO.       |13.        |10.       |5.        p.
 l|2 1 4 i|t| 8 S 10 11 12 13 14 15 1« 17 II tl 26 21 22 24 25 Jl 27 38 29 30 31 3! 14 35M 37 » 114041 42  4. 45 46 (7 «919 50 51 53 54 55 SE 5! 58 S9 60 61 63 64 6S 66 67 6«
    , 5 B 7 « j 1011 12 1314 1518 17 IB 19 20 21 22 23 24 25 26 27 !B 19 30 31 J2 33 !< 3536 37 36 :<9 40  £3 64 6i 66 67 as i) ,0 n 1273.4
 The number of cards per  species  is  equal to  [ (NOSTAT -  l)/5]  + 1 , where
 NOSTAT  is the number of space mesh points (see Table 2.1,  input 53),
 and the notation   [ • ]   denotes the integral part of the expression
 within the brackets.  Cards  for  the tracer species must  not be included
 if  NTRACE = 0  (input 51, Table 2.1).

       The initial  concentrations of the steady-state species need not be
 input because the  code automatically computes them.  However,  the user
 must include cards in the input  deck for each steady-state  species.  In
 our sample run, four species  are designated as being in  steady-state:  NO-,
 N2°5' °H ' and  R02 '  Referrin8 to Appendix C,  cards 296-299  show that
 the initial concentrations of these species have not been specified.   The
 initial concentrations of these  species will be computed by the code from
 the given initial concentrations of the five active species,  NO, HC, NO ,
 03 , and  HN02 .  Figure  3.8a in Sec.  3.4 shows the computed initial
 concentrations of the steady-state  species.

 2.2.10  Rate Constants for Chemical Reactions
       These are input one to a card,  i.e.,  one card per  reaction, using
 format (40X,  F10.0).   They are stored  in array RATKON.   There  is a total
16

-------
of NOREAC rate-constant data cards.  The  N0? photodissociation reaction
is the first one in the kinetic model as currently structured.  However,
it may be assigned any position provided that any subsequent inputs are
consistent with the assigned order.

2.2.11  Description of Chemical Reactions in the Model
      This input is for information only and plays no role in the compu-
tation.  The input is in Hollerith form using format (8A4), one reaction
to a card.  The user may make any notations in the allotted space, the
first 32 columns of the card.  Appendix C, cards 317-332, shows an example
of these data cards.  There is a total of NOREAC cards and the symbols
are stored in array REACT.  This input must not be repeated when multiple
runs are made (see Sec. 4.2 for multiple-run procedures).

2.2.12  Specification of the Chemical System (Stoichiometric Coefficients)
      A set of chemical reactions is specified by a set of NOREAC Stoichio-
metric equations of the form:
                        ,    s
                        k
                         i
                  v..M.     >   v! .M.  ,  i  =  1,  2,  ...  , NOREAC
                   ij  J — 2_-/  ij  J
                          J=l
 where        M. = chemical formula of jth species
             v.. = Stoichiometric coefficient of reactant species
              ij
             \>\  . = Stoichiometric coefficient of product species
              k  = rate constant of ith reaction [RATKON(i),  see Sec.
               i                    -
                   2.2.10]
               s = number of chemically active species,  i.e.,
                   s = NOSP1 - NTRACE
       The input of the DIFKIN code consists of the Stoichiometric coef-
 ficients   v..   and  v!. .   These coefficients are input two per card,
 v..   and   v!.  , using format (2F10.0).   The ordering scheme is best ex-
   J          J
 plained by an  example.  Consider the reaction set:
                                                                      17

-------
            hv + N02 -> NO + 0
            NO
 The  stoichiometry input would be as follows:
                                              Input Using  Format (2F10.0)
 Card Number    Species    Reaction Number

      2                           2
      3                           3
      4           NO              1
      5                           2
      6                           3
      7
      8                           2
      9                           3

 And so  on for the other  species.  Thus  it  should be clear  that the stoi-
 chiometric coefficients  are  grouped by  species  and that  for each species
 the stoichiometry must be specified for all  reactions.   Hence, for
 NOREAC   reactions and  (NOSP1 - NTRACE)  species we have
 (NOREAC)  x (NOSP1 -  NTRACE)  cards in the  stoichiometric matrix input.
 We note that the order of the species-reaction  groups  in this input must
 be consistent with  the name  ordering, the  concentration  ordering, and so
 forth.   Also, it can be  seen that this  kind  of  input  is  very general and
 affords great flexibility in specifying various chemical systems.  The
 stoichiometric matrix is input  only once when making  multiple runs (see Sec.
 4.2 for an explanation of multiple-run  procedures).
V
1.
0
0
0
0
1.
0
0
1.
V1
0
0
1.
1.
0
0
0
1.
0
18

-------
2.2.13   Input  for Variable NO   Photodissociation  Rate  Constant
      These data are  read only  if  QRATE = YES  (see Table  2.1,  input  44);
otherwise  they must not be included  in  the deck.

      The  format used for these cards is (20X, E15.5)  and the rate  con-
stants are input one  to a card,  one  card for each  time.  They are stored
in array RATK1 and the maximum  number of cards is  300.  The  time interval
between  updates is that specified  on input 38 of  Table 2.1.  The last  card
of the table must contain a negative number to stop the code from reading.

      If  QRATE = YES , then the first  card on the input table must con-
tain  the value of the rate constant  which corresponds  to the initial time
of the run.  The program updates RATKON(l) (see Sec. 2.2.10) automatically
to reflect this fact.  Hence, the  value of the rate constant input  in
Sec.  2.2.10 need not  be the correct  value inasmuch as  it will be updated
when  RATK1 is  read.   The updating  is done by a call to  the  subroutine
UPRATE.

2.2.14   Table  of Diffusion Coefficients as Functions of Time and Altitude
      These data are  read only  if  QHTINV = YES   (see  Table 2.1, input 45);
otherwise  they must not be included  in  the deck.

      The  format used for these cards is (20X, 5E10.4).  Each card  con-
tains up to five numbers arranged  in columns 21-30, 31-40, 41-50, 51-60,
61-70.   The diffusivities are updated as functions of  time and each entry
of the input table must contain the  following:  the update  time, the
inversion  height, and the diffusivities at the various points in the mesh.
(The  inversion height  is informational  only and is not used in the  com-
putation,  so it really need not  be input.  It has been included for the
sake  of  completeness.)  The number of diffusivities is equal to  NOSTAT + 1
since each diffusivity must be  specified at the midpoint of each cell  as
well  as  at the ground  and at the upper  edge of the space mesh.  The table
is arranged as follows:
                                                                      19

-------
        Card  1—Columns 21-30
               Columns 31-40
Update time in minutes from  start  of
run
Inversion height in meters or blank
               Columns 41-50, 51-60, Diffusivity at ground and  at  the next
                           '          two points in the mesh,  in meters
                                     squared per minute
        Card 2—Columns 21-30, etc.,  Diffusivities at other points  in the
               and thereafter
        Thus, for each update time there must be a set of diffusivities.
  If  the number of mesh points is 5, for example, two cards per update  time
  will be needed.  The last group of cards in the array must contain a
  negative number in the position allocated for the time in order to stop
                       *
  the code from reading.   The maximum number of update times allowed is
  100 and the table is stored in array HTINV.
  Note that this  last group  must have  the  same  number of cards as the pre-
  ceding ones,  even though only the  first  carries  any information.
20

-------
3     OUTPUTS
      DIFKIN produces two kinds of output:  line-printer and punched card.
The latter is optional, being produced at the command of the user
(Table 2.1, inputs 4 and 43).  The printed output is shown in the accom-
panying figures.  The interpretation of the output is discussed below.

      The main line-printer output consists of the following:
      1.    Images of data cards in the input deck (see Appendix C).
      2.    Trajectory calculation data (Fig.  3.1).
      3.    Description of the computed trajectory (Fig. 3.2).
      4.    Printer plot of the trajectory (Fig.  3.3).
      5.    Directory of boundary-crossing times  and location of the
            air parcel (Fig. 3.4).
      6.    Source flux contributions (Fig. 3.5)
      7.    Source emissions in the units used by the code (Fig. 3.6).
      8.    Summary of input data used in computing species concentrations
            (Figs. 3.7a through 3.7e).
      9.    Concentrations of the various species as a function of time
            and height (Figs. 3.8a and 3.8b).
In addition to these three items, several utility outputs are available
for the convenience of the user.  These are described in Sec. 3.5.

      Two kinds of punched-card output are produced:  the wind trajectory
and the species concentrations.  The wind trajectory output is designed so
that it can be input back into the program with a minimum of intervention
by the user.  This output consists of the following items in the order
listed:  a card with the title of the run input by the  user, the  (x,y)
coordinates of the starting location of the trajectory, a card indicating
whether the start time is standard or daylight time, and the trajectory
itself.  The formats of the punched cards are the same  as those specified
                                                                      21

-------
for inputs 18-20, Table 2.1.  The wind trajectory output contains the
time of day  (24-hr clock), wind speed (miles/hr), and azimuth  (in
counterclockwise degrees from east).

      For the species concentrations, the punched-card output  consists
of the concentrations as functions of time and height.  The punched cards
are generated at the same time the species concentrations are  printed.
The format of the cards matches the format used  for input 56 of  Table 2.1.

 3.1   TRAJECTORY-GENERATION OUTPUTS
      Figure 3.1 illustrates the data used in the calculation  of the air
 trajectory.   The data shown are simply a summary of the input  data and
 they have been  cross-referenced to Table 2.1.  The example shown in
 Fig. 3.1 corresponds to a forward trajectory of  a maximum of eight hours
 duration.  The  trajectory starts at the point (17.00, 24.61),  where these
 are the  (x,  y)  coordinates in miles from the origin of the grid.   The
 parenthetical note  (NOT AT A MEASUREMENT STATION) indicates that the
 coordinates  of  the initial point do not coincide with the coordinates
 of any of the monitoring stations used in the calculation.  The  inter-
 polation scheme used in the calculation employs  the three nearest
 neighboring  stations for interpolation and inverse-distance  (1/R)
weighting.

      At the bottom of Fig. 3.1 are shown the reference data for the
 grid used in the calculation.  The coordinates of the center and the
origin of the grid are given in latitude and longitude, where  the
numbers shown denote degrees/minutes/seconds.  The (x, y) coordinates
in statute miles from the origin of the grid are also shown.   The (I, J)
pair contains the indices of the cells in which  the points are located, the
I and J corresponding to x and y, respectively.   Similar information
is provided  for the starting point of the trajectory, which is shown
on the last  line of Fig.  3.1.
22

-------
OIFKIN  SAMl-'LE PUN - COMPUTE TrtAJtCTORY. FLUXES. AND  CONCENTRATIONS
                                                                               CP TIME •=  *8.33  DATE
                                                                                                         01/21/7+   PASE
AIR TRAJECTORY CALCULATION DATA







   START  DATE ANn LOCAL  Tint AT INITIAL POINT




   LOCATION OF INITIAL PO.INT




   PRESCRIBED STARTING AZIMUTH AMD VELOCITY  (OPTIONAL)
17.00
700  HRS  (DAYLIGHT TIME)               (inputs 9 and 10)




24.61    (NOT AT A MEASUREMENT STATION) (input 11)




                                    (input 14)




                                    (input 15)




                                    (input 12)




                                    (input 13)




                                    (inputs 16 and 17)
TION OF TRAJECTORY DEVELOPMENT
!ED TRAJECTORY DURATION
CTORY SEGMENT LENGTH
MEASUREMENT INTERPOLATION SCHEME
'ERENCE DATA
LATITUDE
CENTER 33/b5/*6.o
ORIGIN S3/34/ 2.5
START POINT 33/55/25.7
FORWARD
8.0 HRS
1.0 HRS
3 CLOSEST STATIONS KITH 1/R WEIGHTING

LON8ITUDE XIST MI) YIST Ml) 1 J
118/12/ 9.0 25.000 25.000 13 13
118/38/20.0 0.000 0.000 1 1
119/20/31.7 17.000 2*. 610 9 13
                    Figure 3.1.    Summary  of Data Used for  Calculating  Trajectory

-------
      A listing of the nodes of the calculated trajectory is shown in
Fig. 3.2.  The list contains the symbol used for the node in the printer
plot shown in Fig. 3.3.   In addition, for each node the list also has
the time, grid cell indices, (x, y) position, the wind velocity in
miles per hour, and the wind direction in counterclockwise degrees from
east.  To assist the user, the code also produces a plot of the trajectory,
an example of which is shown in Fig.  3.3.

      The last output related to the air trajectory- is shown in Fig. 3.4.
This output is a list of the grid-boundary crossings of the center of
the air mass.  The information provided is the time when the boundary is
crossed, the (x, y) coordinates of the crossing, and the indices of the
cell which the air parcel enters.  This output is useful if the investigator
wishes to know the length of time the air parcel spends within a given
cell.

3.2   SOURCE EMISSIONS OUTPUT
      Figure 3.5 shows a listing of the emissions which enter the air
parcel as it traverses a region.  The output contains the times when
the fluxes are updated in local time, i.e.,  either standard or daylight
time, as well as the indices of the cell which is the source of the
emissions.  The contributions of vehicular and stationary sources are
also included in the list.  Note that the fluxes are updated sometimes
even though a cell boundary has not been crossed.  Such updating is
related to changes in the temporal distribution of the emissions.  For
example, the fluxes would be updated as traffic levels change with
time as well as spatially.

      The emissions shown in Fig. 3.5 are given in units of kg/hr.
This is useful for comparing emissions used  in the code with published
inventories.   However,  the program internally converts these emissions
to a different set of units for computational purposes.  The fluxes
(vehicular plus stationary) in the internal  units are also output for
the user's convenience  and are shown in Fig.  3.6.  The list contains
the time and  magnitude  of each flux.

-------
 uJf-Kiu SAMPLE  ^UN - c'J'^uTt  T^UJLCTUMY,  pLUXESt AND  CONCENTRATIONS



TRAJECTORY OATfl
KOL
A
H
c
D
E
'
<>
H
1
T (M
0
faO
120
1 RO
?40
3 0 0
'^0
4PO
4hO
TN
.0
. n
.0
.n
) I
U *-)
0 1 2
0 11
0 1 2
.00 14
.0
.0
0 17
0 ?0
.00 ?3
.0
0 ?7
J
1 3
1 3
11
10
10
H
9
10
10
A (MI )
1 '.00
23.23
21.91
23.90
2f.3b
32.60
3 H . 2 H
*4.bO
52.27
Y(MI »
24
24
21
19
18
14
17
IB
IB
.61
.03
.22
.41
.91
.53
.13
,08
.79
V (MPH)
6
3
2
J
6
6
6
7
10
.?b
.10
.70
.49
.83
.24
.39
.70
.00
THE 1 A
3b4
244
317
351
320
24
8
5
a7
.65
t'B
.66
. 78
• 14
.60
.54
.31
.50
               Figure 3.2.  Description of Computed Trajectory
                                                                   25

-------
41 .3313
34.6667
an.oooo
21.3333
         I
         I
         T
         I
I«.b6h7  *I
         I
         I
         T
         I
         I
         I
         I
         T
         I
 n.oooo
       1.0000
                        10.0000
                                         20.0000
                                                          30.0000
                                                                           40.0000
                                                                                             SO.0000
                       Figure  3.3.   Printer Plot of  Trajectory

-------
OIFKJN SAMPLE RUN - COMPUTE TRAJECTORY? FLUXF.St  AND  CONCENTRATIONS



 TC.R]
36.00
38.00
40.00
42.00
44.00
44.09
46.00
48.00
50.00
52.00
24.52
24.33
24.14
24.00
22.00
21.42
21.14
20,00
19.39
19.10
18.37
18.00
lh.70
16.00
15.03
15.17
16.00
16.09
17.00
17.J9
17.69
17.99
18.00
18.21
18.39
1B.5H
18.76
10
11
12
12
12
11
12
12
13
14
15
15
lb
16
17
18
IB
19
20
2.1
22
23
23
24
25
26
27
13
13
13
12
11
11
11
10
10
10
10
9
9
8
8
8
9
9
9
9
9
9
10
10
10
10
10
       Figure 3.4.  Directory of Cell-Boundary Crossings
                                                                  27

-------
                                Yt FLUKES. AND CONCENTRATIONS
                           SOURCt  KLUX CONTRIBUTIONS (KG/HR)
                                                                       CP TIME
                                                                                 58.40
LOCAL
TIM[.
7nO
705
710
710
715
720
729
748
800
801
82o
840
843
855
856
900
903
910
9?0
940
1000
1002
1036
1100
1107
1112
1130
1130
1140
1153-
1200
1215
1234
1236
1257
1300
1316
1330
1335
1354
1355
14UO
14)1
1427

I
9
9
10
1 u
10
10
1 1
12
12
12
12
12
12
12
11
1 1
12
12
12
12
12
13
14
14
15
15
15
16
16
17
17
18
18
19
20
20
21
21
22
23
?3
53
24
25

J
13
13
13
13
13
1 3
13
13
13
1?
1?
12
11
11
11
1 t
1!
11
11
10
10
)0
IP
10
in
9
9
9
P
8
P
8
9
9
1)
9
9
g
9
9
10
1"
10
in
Jl U
VEHICLE
117.99
117.99
84.70
P4.70
B4.7')
P4.7U
200.26
75.49
75.49
73.76
78.76
78.76
35.96
35.96
126.61
101 .23
27.73
27. 7:1
27.73
1H.10
18.10
99.97
66.00
e o . o 4
119.51
151.22
151.22
89.84
164. 3J
99.55
99.55
80 .28
48.08
71 ,98
63.37
63. 3 '
117.19
117.19
62.31
34.19
55. 7(i
59.4ft
62.39
23.75

-------
OIFKJN
              HUM _ COMPUTE T«AJtCTOHY. FLUXES, AND CONCENTRATIONS
    TOTAL FLUXtS IN UNITS USFD t»Y CODE  (M/MIN)
    TIME
     0 .0
     b.O
     9.6
    10.0
    15.0
    20.0
    20.1
    48.2
    60 .0
    60.6
    80 .0
   100.0
   10J.4
   llb.O
   115.8
   120.0
   122.8
   130.0
   140 tO
   160«4
   180 tO
   181.7
   216.5
   2*0.0
   247.4
   252.4
   270.0
   ?70.3
   279.8
   293.1
   300.0
   314.8
   334.0
   335.9
   357.1
   360.0
   376,4
   390.0
   395.3
   414.3
   415.1
   420 .0
   431 .U
NITRIC OXIDE
  1 .9676E-07
  ] .46 f6E-P7
  1 .470 Jt-07
  1.4703E-07
  I .47G3E-07
  1 .4703E-07
  3.0483E-D7
  1.3729F.-07
  1 .4176E-07
  1 .4176E-07
  1 .4176E-07
  8.4738E-08
  8.4738E-08
  2.2135E-07
  1 .8669E-07
  7.3498E-08
  7.3498E-08
  7.3498E-08
  2.2567E-07
  2-2567E-07
  1 .7216E-07
  1 .2434E-07
  1 .4352E-07
  1 .9599E-07
  ?.3787E-07
  2.3787E-07
  1 .5404E-07
  2.5434E-07
  1.5163E-07
  1 .5163F-07
  1.2531E-07
  8.1340E-08
  1.1398E-07
  1.0222E-07
  1.0222E-07
  I .75>72E-07
  1-0077E-07
  6.2362E-08
  9.1829E-08
  9.6879E-H8
REACTIVE HrD«OCAH80NS
       4.1290E-07
       4.1175E-07
       3.2915E-07
       3.?908E-07
       3. 28256-07
       3.2784E-07
       5.0415E-07
       3.3591E-07
       3.3584E-07
       3.4375E-07
       3.4363E-07
       3.4325E-07
       1 .6549E-07
       1.6529E-07
       3.7703E-07
       3.2134E-07
       1.4264E-07
       1.4292E-07
       1.4305E-07
       1.4037E-Q7
       2.6460E-07
       2.3191E-07
       2.6452E-07
       3.5615E-07
       3.6218E-07
       3.6292E-07
       2.4514E-07
       3.5053E-07
       1.8706E-07
       1.8706E-07
       1 .6904E-07
       1.4Q50E-07
       1 .9186E-07
       1.7177E-07
       1.7177E-07
       2.6656E-07
       2.6695E-07
       1 .5495E-07
       1.0309E-07
       1.3207E-07
       1 .3745E-07
       1 .0902E-07
CARBON MONOXIDE
   3.210BE-06
   3.1706E-06
   2.2391E-06
   2.2362E-06
   2.2095E-06
   2.1940E-06
   3.6823E-06
   1.9470E-06
   1.9435E-06
   2.0274E-06
   2.0214E-06
   2.0070E-06
   9.1489E-07
   9.0979E-07
   2.3429E-06
   1.6706E-06
   6.Q290E-07
   6.H21E-07
   6.1551E-07
   4.0186E-Q7
   4.0166E-Q7
   1 .6690E-06
   1 .46SOE-06
   1.7767E-06
   2.6527E-06
   2.6037E-06
   2.6299E-06
   1.5549E-06
   1.4032E-06
   1 .4032E-06
   1.2962E-06
   1.0834E-06
   1.6219E-06
   1.4278E-06
   1.4278E-06
   2.2916E-06
   2.2350E-06
   1 .2087L-06
   7.4735E-07
   9.7548E-07
   1.0193E-06
   8.2613E-07
              Figure 3.6.   Source Emissions as  Used by Code
                                                                          29

-------
 3.3    SUMMARY  OF  INPUT DATA USED TO  COMPUTE  CONCENTRATIONS
       The  line-printer output  shown  in  Fig.  3.7  consists  of  a summary of the
 input data used in the  chemical module.   At  the  top of the page shown in
 Fig.  3.la,  the run label  appears first.   This  appears  on  every page
 of the output  and corresponds  to the data on the first card  of the
 input deck.  Also appearing on the first  line  are the  central processor
 time (CP TIME) in seconds,  the date  of  the run,  and the page number.
 Proceeding down the page,  several input quantities are listed, beginning
 with the initial  time and ending with the lower  limit  fractional change
 used to control the step  size.  On Fig. 3.7a these entries are cross-
 referenced to  Table 2.1.

       The next listing  of inputs consists of the reactant and product
 stoichiometric matrices,  together with  the rate  constant  of  each reaction.
 The stoichiometric matrix listings shown  in  Figs.  3.7a and 3.7b are
 interpreted as follows.   The reactions  correspond to the  rows of the
 matrix and the species  to the  columns.  Thus consider  reaction 2: the
 stoichiometric matrix of  reactants,  Fig.  3.7a, says that  only species
 NO and OZON appear in reaction 2, each  with  unit stoichiometric coeffi-
 cient.  The rate  constant of reaction 2 is given as .267  pphm  min
 The stoichiometric matrix of products,  Fig.  3.7b,  is read in the same
 way as the matrix for reactants.  Thus  for reaction 2  the product is
 one molecule of N02.  The schematic  reaction obtained  from reading the
 stoichiometric matrices is  (1)NO +  (l)OZON -> (1)N02, where the quantities
 in parentheses are the  stoichiometric coefficients.  (Note that this
 schematic reaction does not balance.  The true reaction is NO + 0  ->• NO
 + 02, but 02 is not carried explicitly  in the  computation, hence the
 omission.)

       Figure 3.7c shows a list of all the reactions used  in  this sample
 run.   These reactions correspond to  the schematic reactions  defined by
 the stoichiometric matrices, of course.   Thus  the listing in Fig. 3.7c
 can be used to interpret  the stoichiometric  matrices and  vice versa.
30

-------
 IIFK1H SA"PLt TON . CJ1PUTE  THJJtCIORV, FLUXES, ANP CONCENTRATIONS                CP TIME •  60 • 13  UAIE    01/21/7*   PAGE




INPUT DATA KID VFHMCM- DIFFUSION PHOHLEM WITH PHOTOCHEMISTRY




 INITIAL TTML IS il.         MINJ1ES




 fl.iAL UMF Ib * ,4hM 8c *02 MINUTES
. STEP f.Uf IS l.OOOOF-02 MINUTES (input 31)
ItK OF *hACTInMS IS Ih (input 48)
IEk OF SPtnlFS IS 1(1 (input 49)
IER OF SPtCIFS IV SIEAOY STATE IS 4 (input 50)
Itr. OF IHJrt>-' SkFCItS IS 1 (CANiNOT EXCEEO 11 (input 51)
1 SIZE CONTPULS
LIPOF-4 LIMIT nacIIONAL ChAi\l",L IS 3.00000E-02 (input 32)
LP»FP LIMIT FHACTIO^AL CHANGE IS l.OOOOOE-02 (input 33)
•JU 'iL N02 OZON HNOg N03 N205 OH
REACTION --WEACTANT STOILHIOMEIRY---
1 n.l n.li I.o 0.0 0.0 0.0 0.0 O.u
2 l.d 0.0 0*0 1*0 0*0 0*0 0*0 0*0
0.0
3 n.'j 1.0 0.0 u.O u.O 0.0 0.0 0.0
U.O
4 n.u l.u 0.0 0.0 0.0 0.0 U.O 1.0
u.O
5 1.0 0.0 0.0 u.u 0*0 0.0 0.0 0.0
l.d
6 0.0 O.U 1.0 u.O 0,0 0.0 0.0 0.0
1.0
7 I.O O.u 0.0 0.0 0.0 0.0 0.0 1*0
U.O
8 n.O G.O 1.0 0.0 0.0 0.0 0.0 l.u
U.O
4 0*0 1*0 0*0 l.u 0.0 0.0 0.0 0*0
0.0
10 n.O 0.0 0.0 u.O 1.0 0.0 0.0 0.0
0.0
n n.o o.o i.o i.o o.o o.u o.o o.o
0.0
12 o.O 0.0 1.0 O.u 0*0 1.0 0.0 0.0
0.0
13 n.O 0.0 0.0 0.0 0.0 0.0 1.0 O.u
0.0
14 n.n o.o o.o o.o o.o o.o l«o o.o
0.0
15 l.u u.u 1.0 0.0 O.u 0*0 0.0 0.0
0.0
16 n.O 0.0 l.u 0.0 0.0 0.0 U.U U.O
0.0








RATE CONSTANT
(PPHM/MIN)
1 .OOOOOt-04
.26700

l.OOOOOt-06

100.000

1000.00

£.0000

15.000

30.000

4.00000E-05

J.74532E-07

5.00000E-05

45.000

14,000

60.500

l.OOOOOE-OS

l.OOOOOE-03

                             Figure  3.7a.    Summary  of  Input  Data
                                                                                                     31

-------
fO                        OIFKIN SAMPLE RUN - COMPUTE TRAJECTORY, FLUXES, AND CONCENTRATIONS              CP TIME *   60,31
REACTION
1
2
3
*
5
6
7
8
9
10
11
12
13
14
15
16
1.00
0.00
0.00
0.00
n.OO
8.00
0.00
8.00
0.00
0.00
0.00
0.00
0.00
0.00
n.oo
0.00
0.00
1.00
1.00
0.00
n.oo
0.00
0.00
0.00
n.oo
0.00
n.oo
o.oo
0.00
0.00
n.oo
0.00
0.00
0.00
0.00
o.oo
0.00
0.00
o.oo
0.00
o.oo
0.00
0.00
o.oo
o.oo
0.00
0.00
0.00
---PRO
0.00
1.00
0.00
0.00
1.00
o.oo
0.00
0.00
o.oo
0.00
0.00
0.00
1.00
0.00
0.00
0.00
0 U C T S
1.00
0.00
o.oo
0.00
0.00
0.00
0.00
0.00
0.00
0.00
0.00
0.00
0.00
0.00
0.00
0.00
T 0 I C H I
o.oo
0.00
0.00
0.00
0.00
0.00
1.00
0.00
0.00
0.00
0.00
0.00
0.00
0.00
3.00
0.00
0 M E T R Y
0.00
0.00
0.00
0.00
0,00
0.00
0.00
0.00
0.00
0.00
1.00
0.00
1.00
0,00
0,00
0,00
. . .
0.00
0.00
0.00
0.00
0.00
0.00
0.00
0.00
0.00
0.00
0.00
1.00
0.00
0.00
0.00
0.00

0.00
0.00
0.00
0.00
.13
0.00
0.00
0.00
0.00
1.00
0.00
0.00
0.00
0.00
0.00
0.00
                           Figure 3.7b.   Summary  of  Input Data:   Stoichiometric Matrix of Product
                                           Species

-------
DIFKIN SAMPLE RUM  -  COMPUTE  TRAJECTORY* FLUXES*  AND  CONCENTRATIONS
                  REACTIONS

        i.     PHOTON  +  Nog  = NO  * 03

        2.     NO      *  03   * N02 + 02

        3,     0       *  HC   = 8H02

        4.     OH      *  HC   = 8R02

        5.     R02     *  NO   s N02 + ,125*OH

        6.     R02     +  N02  = PAN

        7,     OH      +  NO   * HN02

        6.     OH      +  N02  s HM03

        9.     03      +  HC   = R02

       lo.     PHOTON  *  HONO= OH * NO

       11.     N02     *  03   » N03 * 02

       12.     N03     *  N02  B N205

       13.     N205          s N03 * N02

       U.     N205    +  H20  = 2HN03

       15.     NO + N02  * H20 =  2HN02

       16.     N02 * PARTICLES * PRODUCTS
  Figure 3.7c.  Summary of Input Data:  Description of Chemical Reactions
              Used in Model
                                                              33

-------
DIFKIN  SAMPLE RUN - COMPUTE TRAJECTORY! FLUXESI  AND CONCENTRATIONS
   SPECIES

NO
HC
N02
OZON
HN02
M03
N205
OH
R02
CO
FLUXES
4.91897E+00
4.12897E+01
0.
0*
0.
0*
0.
0.
0.
3.21082E+02
MOLE WT
3.00100E*01
7.22000E*01
4.6>010QE*01
4.80000E*OI
4.70000E*01
6t20000E*01
1.08000E*02
1.70000E+01
6.81000E*01
2.80000E*01
      Figure 3.7'd.   Summary of Input Data:  Species Name,  Fluxes, and
                   Molecular Weight
 34

-------
OIFKIN SAMPLE RUN - COMPUTE  TRAJECTORY, FLUXES, AND CONCENTRATIONS
         INITIAL DIFFUSION COEFFICIENTS
        VALUES SHOWN ARE  FOR POINTS HALFWAY BETWEEN STATIONS

        STATION           HEIGHT  (METERS)           DIFFUSIVITY
             1                      0*00            30*000000
                                                    30.000000
             2                    115.00
                                                    30.000000
             3                    230*00
                                                    30.000000
             4                    345.00
                                                    30.000000
             5                    460.00            30.000000

      Figure 3.7e.  Summary of Input Data:  Initial Diffusivity Profile
                                                               35

-------
      Figure 3.7d lists the species in the prescribed order, together
with the boundary conditions at the initial time and the molecular weight
of each species.  In the example shown, only  NO, HC , and  CO  have
fluxes at the ground (FLXWAL).

      The last listing of inputs, shown in Fig. 3.7e, is a list of the
initial values of the diffusivities.   These values correspond to the
quantities shown in cards 545 and 546 of Appendix C.

3.4   OUTPUT OF SPECIES CONCENTRATIONS
      Figures 3.8a and 3.8b show the output of the species concentrations
produced by DIFKIN.  Figure 3.8a contains the initial concentrations
which have been input by the user.  These correspond to cards 291-295
and 300 of Appendix C.  Each column of the output corresponds to one
species, and each row corresponds to a given height.  The first row
shows a height of zero meters and is, of course, the ground.  Subsequent
rows correspond to increasing altitudes.  Note that the first column
contains two species, NO and R02; these are read in the order indicated
by the order of the name of the species, i.e., first NO and then R02.
The species are printed folded together in multiples of 8.  Hence, for
17 species the first column would contain 3 species, and so on.

      Figure 3.8b shows the output of the computation after 30 minutes
of real time have elapsed.  Because the print interval, PRNTIN  (input
34 in Table 2.1 and card 258, Appendix C), is equal to 30 minutes the
program will print the species concentrations and the time every 30
minutes.  Some additional information is printed on the page: the value of
the diffusion coefficient at the ground, the value of  k  , and the fluxes
of NO, HC, and CO, the last being the tracer species.  Note that the
value of  ^  shown in Fig. 3.8b matches the quantity shown on  card
479 of Appendix C.  Clearly, the value of  k   is not the value of this
quantity at 0630, which corresponds to 30 minutes.  This is simply
because the printing is done before updating  k   .  After printing,  the
program will update this quantity and proceed  to  the next integration  step.
36

-------
                  DIFKIN SAMPLE RUM - COXPUTE TRAJECTORY FLUXESi  AND CONCENTRATIONS
                                                                                               CP TIME  *   60.59  OATE    01/21/7*   PAGE
                                                                                                                                         12
U>
•vj
                                           INITIAL  PROFILES OF CONCENTRATIONS-PPHM
HEIGHT-M,
0.00
115.00
330.00
3*5.00
46-0.00
NO
R02
7.90000E»00
1.81776E-08
•;.OOOOOE*OO
2.33267E-08
2.20000E»00
4.63604E-08
2.10000E*00
4.80947E-08
2.10000E*00
4.80947E-08
HC
CO
1.99000E*01
1.00000E*03
1.11000E*01
8.00000E»02
5.00000E*00
•S.OOOOOE'02
4.80000E»00
3.00000E»02
4.80000E»00
3.00000E«02
N02
l.bOOOOE'OO
1.30000E*00
e.booOOE-01
B.40000E-01
8.40000E-01
                                                                         OZON          HN02


                                                                       7.59000E-05    *,OOOOOE*00


                                                                       9.74000E-05    *.OOOOOE«00


                                                                       1.4SOOOE-04    4.00000E«00


                                                                       1.50000E.04    ».OOOOOE»00


                                                                       1.50000E-04    *.OOOOOE»00
N03
1.038*8E-10
1.33265E-10
1.98393E-10
2.05234E-10
2.0523»E-10
N205
1.0036*E-10
1.0*6»SE-10
1.01860E-10
1.04132E-10
1.04132E-10
OH
9.01857E-09
1.31350E-08
2.55098E-08
2.63USE-08
2.63MSE.08
                                            Figure 3.8a.   DIFKIN Output  of  Initial  Concentrations

-------
OJ
CXI
                 DIFKIN SAMPLE HUN -  COMPUTE TRAJECTOHY. FLUXES.  AND CONCENTRATIONS
                                                                                          CP TIME *  86.33 DATE   01/21/74   PASE
                                                                                                                                  13
                                         CONCENTRATION PROFILES-PAHTS PER HUNDRED MILLION

                                                      TIME* 3.00000E»01 MINUTES
GROUND DIFFUSIVITY » 30.000000
NO FLUX s 7.6208673
HC FLUX « 50.414963
CO FLUX = 368.23057
HEIGMT-M.
0.00
115.00
230.00
345.00
460.00

NO
RO?
9.35368E*00
5.5049BE-07
4.94128E*00
7.S9500E-07
2.26663E*00
1 .41947E-06
2.00B]8E*00
i.558<>2e-o6
1.99690t"*00
1 .56531E-06
NUMBER
HC
CO
2.58656£»01
1.10458E»03
1.147S2t»ol
7.97625E»02
5.3727*E*00
5.06674E*02
4.81162E*00
3.12962E»02
4.78759E»00
3.00857E»02
OF TIME STEPS
KI
NOZ
1.67502E»00
1.37371E*00
9.56401E-01
9.185HE-01
9.16939E-01
IN CYCLE NO.
• 3.14618000E-03
OZON
2.12637E.03
3.26968E.03
4.95811E.03
5.37301E-03
5.39417E-03
1 IS 151
HN02
*.00769E»00
4.00339E»00
».OOOS4E*00
».00030E*00
4.00029E*00
DIFFERENTIAL
N03
2,90936E*09
4.47367E-09
6.78382E-09
7.35150E-09
7.38045E-09
CP TIME *
N205
2.94357E-09
3.71206E-0?
3.9189SE-09
4.07B65E-09
4.08770E-09
25.75 SEC
OH
2.48773E-07
4.0B826E.07
7.489Q6E.07
8.13526E-07
8.16567E-07

                                          Figure 3.8b.   DIFKIN Output  of Computed Concentrations

-------
      The last line of Fig. 3.8b shows that it took 151 integration steps
to get from 0 to 30 minutes of real time (cycle No. 1), and that this
took 24.515 seconds of central processor time.  This output is optional
and is controlled by TIMOUT (Table 2.1, input 41 and card 265, Appendix C)

3.5   UTILITY OUTPUTS
      Several convenient utility outputs may be produced on an optional
basis.  These are:
      •     A list of all the input wind data and the designations and
            coordinates of the monitoring stations (Table 2.1, input 5).
      •     Description of the calculated trajectory which includes the
            stations used in the interpolation at every node (Table
            2.1, input 8).
      •     A list of all the time steps used in the integration
            (Table 2.1, input 40).  This is written on logical unit 9.
      •     A note of the number of integration steps taken during a
            print interval and the central processor time used (Table
            2.1, input 41; Fig. 3.8b.
      •     A list of the species concentrations (Fig. 3.8b) after
            every integration step rather than at every print interval
            (Table 2.1, input 42)

      In addition to these we use peripheral units such as disks to
print certain messages which assist the user in ascertaining that the
run is proceeding properly.  These messages are:
      •     The update time and updated value of the fluxes, k^ ,
            and diffusivities.  The last are written on logical unit
            number 11, and the other two on logical unit number 10.
      •     The occurrence of negative concentrations.  This is written
            on logical unit 8.
By means of control cards the user can cause these various messages to
output to the line printer after program execution is terminated or, if
desired, suppress the output.

                                                                      39

-------
        The  trajectory-generation module also produces diagnostic  outputs
  which  tell the user about the existence of pathological conditions.   These
  diagnostics are output on the line printer without intervention  by the
  user and are self-explanatory.
40

-------
4     TECHNIQUES FOR USING DIFKIN

4.1   CHANGING THE CHEMICAL MODEL
      DIFKIN provides the user with great flexibility in changing the
chemical model.  The remarks that follow are intended to assist the user
in changing models efficiently.

      Changing the chemical model requires that new stoichiometric matrices
be input (see Sec. 2.2.12).  In this regard, it is important to keep in
mind the need to be consistent in ordering the species and the reactions.
For example, suppose that the reaction  NO + NO  -> 2ND   were to be added
to the reaction set shown in Fig. 3.7c, and let this be reaction number
17.  Note that no new species have been added to the system.  The first
step that must be taken consists of changing the number of reactions from
16 to 17 (card 272, Appendix C).  Then the appropriate rate constant and
reaction description are inserted after cards 316 and 332 in Appendix C.
The next step is to modify the stoichiometric matrices.   This requires
that a card be inserted for each species describing the stoichiometry of
the species in the new reaction.  Thus for  NO  we have to insert a card
after card 348 in appendix C which has a 1 in Column 1 and a zero in
Column 11,  since  NO  is a reactant but not a product.  For hydrocarbon
we have to insert a card after card 364 in Appendix C, containing zeros
since hydrocarbon appears neither as a reactant nor a product in this
reaction.  And so on for the remaining species.

      The procedure for adding a species is described below by means of
an example.  For simplicity, we assume that no new reactions are added.
Thus suppose that in the present chemical model it is desired to compute
explicitly the concentration of  PAN  in reaction 6,  RO  + NO  •+ PAN
(card 322, Appendix C; Fig. 3.7c).  This adds one new species but no extra
reactions.   Suppose further that  PAN  is assigned position number 6 on
the list of species.   The first step is to increase the number of species
in the input deck from 10 to 11 (card 273, Appendix C).  We
                                                                      41

-------
  shall also  assume that  PAN  is  not  in steady state,  hence NSTDY (card 274,
  Appendix C)  does  not  change.   The  name  and molecular weight of PAN must
  then be inserted  after  card 282  of Appendix C,  and  the initial concentra-
  tion must be input after  card  295  of Appendix C.  The next step is to
  describe the stoichiometry  of  PAN.   This  is done  by inserting 16 cards
  (one for each reaction) with the stoichiometric coefficients of PAN after
  card 412 of Appendix  C.   In this example  PAN is a product of reaction 6
  and does not appear in  any  other reaction.   Hence the stoichiometry of
  PAN consists of zeroes  on all  cards except for  reaction 6 which has a
  zero in Column 1  and  a  one  in  Column 11.   Finally,  the subroutines men-
  tioned in the next paragraph must  be modified since a new species has
  been added  and the position of  NO  , NO   ,  OH , and  RO   in the species
  vector has  been altered.

        In addition to  the  changes in the inputs  mentioned above,  certain
  subroutines must  be modified or  changed altogether  when the chemistry
  is changed.   These are:   JACOB,  NUBETA, NURATE, STATE,  and UPRATE.   These
  subroutines must  also be  modified  if the order  of the species or the
  order of the reactions  is changed.   The reader  is referred to Appendix E
  for an explanation of the contents  of these subroutines.

  4.2   MULTIPLE RUNS
        DIFKIN is designed  to allow  the user  to stack several cases using
  different inputs.   It is  presupposed, however,  that the chemical model
  does not change from  case to case,  except  that  the  values of the rate
  constants may be  changed  at will.

        To run multiple cases  it is  required  that a card which has  the word
  "MORE" punched in Columns 1-4  be inserted between data decks.   The pro-
  gram continues to read  cards until  either  the word  "END" or "MORE" is
  detected.   The former causes execution to  terminate;  the latter causes
  the program to recycle  and  begin reading data.
42

-------
      When making multiple (stacked) runs certain portions of the input
data which would be redundant are omitted from all but the first case input
deck.  These inputs, consisting of the wind measurement data, the speci-
fication of the basic chemical model, and selected option flags, are
listed here in Table 4.1 and cross-referenced to Table 2.1 and Appendix C
for user convenience.
   Input
  Number
(Table 2.1)
                                TABLE 4.1

                    SUMMARY OF FIRST-CASE-ONLY INPUTS
Variable
  Name
       Description
Card Numbers
in Appendix C
    58


    59
                  KPSTAT,
                  KPWDAT
                  NWDTE,
                  NAM,
                  APT,PT
                  XIMPH

                  CONVRT
                  KXTRA
REACT
STOYKR,
STOYKP
               Flags for optional
               output of wind sta-
               tions and wind
               measurement data

               Wind measurement
               data cards
Wind speed conver-
sion factor

Flag for optional
extra trajectory
calculation output

Chemical reaction
descriptions

Stoichiometric
coefficients
    6-234



     235

     236


  317-332

  333-476
4.3   DATE AND TIME SUBROUTINES

      The code utilizes system routines for obtaining the date and the

machine clock time.  These system routines are peculiar to the computer

center where the code is to be run and thus will require special handling

at each installation.  We have provided dummy routines which call the

system routines in order to avoid the need to modify the main program.

These dummy routines are MDATE and SECOND and are described in Appendix E.
                                                                      43

-------
 4.4   CASES WITH CONSTANT FLUX
       The following procedures must be used if it is desired to run
 cases with the flux held constant.  Although essentially indistinguishable,
 two cases will be considered: (1) flux held constant at a nonzero value
 and (2) constant flux equal to zero.  It is convenient to treat the  two
 cases separately because some simplification is possible in the second
 case.

       In the case of the nonzero constant flux the steps to be
 followed are:
       1.    Set EXFLUX = YES (input 3, Table 2.1).
       2.    Set NUMFLX to the appropriate nonzero value (input 52,
             Table 2.1).
       3.    Specify the location of the species which have a flux
             (variable LOCFLX, input 55, Table 2.1).
       4.    Input the flux times and the flux for each species in
             accordance with input 30, Table 2.1.  In this case only
             three cards are required.  The first card contains the
             initial time of the run and the desired fluxes.  The
             second card contains the final time of the run and the
             same fluxes as the first card.  The third card contains
             a dummy negative time to stop the code from reading and
             is otherwise blank.

       In the case of the constant flux equal to zero, the process is as
 follows:
       1.    Set EXFLUX = YES.
       2.    Set NUMFLX = 0.
       3.    Do not input LOCFLX.
       4.    Follow step (4) above, with the exception that it is only
             necessary to specify the initial and final times but not
             the fluxes since they will be automatically set to zero by
             virtue of the fact that NUMFLX = 0.
44

-------
4.5   ASSIGNMENT OF PERIPHERAL UNITS
      The DIFKIN code utilizes several peripheral devices for its operation:
a line printer, a card reader, disks, and a card punch.  Table 4.2 describes
the unit numbers assigned to these devices as well as the use of the
peripherals.  This information is required by some operating systems for
preparing the control cards which govern the execution of the program.
 Unit
Number
  3
  5

  6
  7
 8-11
11-20
                                TABLE 4.2
                   PERIPHERAL DEVICES USED BY DIFKIN
Type of Device
Card reader
Disk

Line printer
Disk
Disk
Disk
                Purpose
All input data is temporarily stored
in unit 5 (see Sec. 2.1).
Used by subroutine SETPLT for write,
read, backspace operations in conjunc-1-
tion with printer plot generation.
Contain utility outputs (see Sec. 3.5).
At the user's option, contents may be
output via the printer after program
execution is completed or upon abnormal
exit.
Each unit contains the wind data for one
day (see Sec. 2.2.3).  Unit 11 corresponds
to the first day input, unit 12 to the
second, and so forth.
      It should be noted that units 5, 7, and 8-20 must have the capability
to obey the FORTRAN instructions BACKSPACE and REWIND.  Also, we note that
the program is now set to read a maximum of 10 days of wind data, hence
only 10 units, i.e., units 11-20, are required to store the wind data.
If the program is modified to increase the number of dates (see Sec. 5.4)
then the user must specify additional disk space, adding one extra unit
per date, e.g., unit 21 corresponds to the eleventh day. unit 22 to the
twelfth, and so on.
                                                                      45

-------
 5     PROGRAM MODIFICATIONS
      This  section provides  instructions  for making various  modifications
 to  DIFKIN which  cannot be accomplished through the input variables.   These
 instructions are grouped according to the program module primarily affected
 by  the  change, starting with the air trajectory module  and proceeding
 through the flux generation  module to the chemical module.

 5.1  ADDING NEW WIND STATIONS
      In order to enable the program to recognize a.new wind station
 (one not listed  in Table A.I, Appendix A), the user must enter  a new  six-
 character Hollerith  code name in the DATA statement in  subroutine  SETIN,
 and initialize the station coordinates in a corresponding pair  of  replace-
 ment statements  in the same  subroutine.   The six-character name occupies
 two consecutive  words in the ISS array which must correspond to the two
 consecutive words in the SSTAN array which receive the  x and y  coordinates
 of  the  station.   The new station may replace an existing one in the two
 arrays,  or  it may be added to the list.   If a new station is added without
 any being deleted, it will be necessary to increase certain  storage limits
 as  explained in  the  next section.

      As an example, suppose we wish to use data from a wind station
 located at  the Orange County Airport having x, y coordinates (43.86,  7.43)
 st.  mi.  Choosing the word ORANGE as an identifier we add the two  Hollerith
 words 4HORAN, 4HGE	 to the  end of the DATA statement initializing ISS.
 (Note that  the last  2 characters in the second word must be  blanks.)
 This being  the 52nd  entry in the ISS array, we set up the station  coordi-
 nates by adding  the  statements

            SSTAN(1,52) = 43.86
            SSTAN(2,52) = 7.43

 to  subroutine SETIN.  Since we have now exceeded the program's  original
 51  station  capacity, it will also be necessary to follow the instructions
46

-------
in the next section to increase the number of wind stations to 52.  The
program will then be prepared to accept additional wind data entered as
described in Sec. 2.2.3 with the identifier ORANGE punched in columns 8-13.

5.2   INCREASING THE NUMBER OF WIND STATIONS
      The variable NUMSTA located in COMMON/WDATA/ is the number of
wind stations recognized by the program.  NUMSTA is set in subroutine SETIN.
Storage for the station coordinates and names is provided by the arrays
SSTANS(2,J) and ISTANS(2,J) which are also located in COMMON/WDATA/.
Hence, the dimensions denoted by the J's must be set greater than or equal
to NUMSTA in the DIMENSION statements which accompany /WDATA/.  (See
Table D.2, Appendix D for a list of the subroutines containing /WDATA/,)
In addition, the local array ISS in subroutine SETIN would be dimensioned
(2,NUMSTA).

      In the example of the preceding section, we would set NUMSTA = 52
and the dimensions denoted by  J  to at least 52.

5.3   CHANGING STATION INFLUENCE RADII
      The maximum and minimum radii of influence of the wind stations are
established in subroutine SETIN.  For program convenience, SETIN actually
sets RMAX and RMIN equal to the square of the maximum and minimum influence
radius respectively.  Hence, wind data from stations more than  /RMAX
miles from a trajectory node cannot be used to calculate a wind vector
for that node.  Conversely, if a wind station with valid data lies within
/RMIN  miles of a trajectory node, that station's data alone will be used.

5.4   INCREASING THE NUMBER OF MEASUREMENT DATES
      The variable NFILES located in COMMON/DATES/ is the maximum number
of measurement dates which can be accepted by the program.  NFILES is
set at the beginning of subroutine WINDRD (currently NFILES = 10).  The
arrays IDATE(K) and ICT(K) in COMMON/DATES/ provide storage for the dates
encountered and the number of station entries stored in each corresponding
                                                                      47

-------
 date  file.   Hence,  the  dimensioned  length  of  these arrays,   K ,  must be
 greater  than or  equal to  NFILES.  The  relevant  DIMENSION statements are
 located  in  the subroutines  containing  COMMON/DATES/ (see Table D.2,
 Appendix D).

       As wind measurement data  is read by  subroutine  WINDED,  it  is sorted
 by date  and written onto  separate scratch  files for later reference.
 The temporary files used  are numbered  from 11 to 10 + NFILES.   On computer
 installations which require external  (control card) specification of all
 temporary files,  it will  be necessary  to specify any  additional  files
 implied  by  an increase  in the value of NFILES.

 5.5   CHANGING THE  STATION  AZIMUTH  EXCLUSION  SECTOR
       Currently  data will not be accepted  from  two stations  lying within
 2° azimuth  of each  other  as seen from  the  trajectory  node being  con-
 sidered.  The size  of this  excluded angle  is  determined  by the local
 variable COSTST  set in  a  DATA statement in subroutine ANGTST.  COSTST
 should be set equal to  the  cosine of the desired exclusion angle.   Note
 that  since the exclusion  angle  is applied  on  both sides  of the azimuth
 to a  previously  accepted  station, the  sector  actually excluded is twice
 the specified exclusion angle.

 5.6   INCREASING THE NUMBER OF  TRAJECTORY  NODES  (WIND VECTORS)
       The number of trajectory  nodes  (or wind vectors) which  can be
 handled  by  DIFKIN is currently  limited to  100 by the  dimensions  of the
 arrays  T(K), V(K)  , and  TH(K)  in COMMON/WIND/ and  the arrays   P(2,K)
 and  ID(2,K)  in COMMON/TRAJ/.  (See Table D.I,  Appendix D for a list of
 subroutines containing  /WIND/ and /TRAJ/.)  In  these  array dimensions,
 the value of K   must be  set greater than  or  equal to the maximum expected
 number of nodes.  Note  that the number of  nodes  is one greater than the
 number of segments  determined by the inputs   TTOTAL  and DTSEG   Csee
 Table 2.1).   For  example, the current  dimensions limit a case  to 99 hours
 of simulated  time using 1-hour  trajectory  segments.
48

-------
5.7   INCREASING THE PERMITTED NUMBER OF GRID LINE CROSSINGS
      The local variable  NCMAX  set in a DATA statement in subroutine
EFFLUX is the maximum number of grid line crossing times and locations
which can be recorded by the program.  NCMAX is currently set at 500.
If NCMAX is increased, the dimension  K  of the arrays  TC(K), PC(2,K)  ,
and  IDC(2,K)  located in COMMON/CROSS/ must also be increased to match
NCMAX.  (See Table D.3, Appendix D for the subroutines containing /CROSS/.)

5.8   INCREASING THE MAXIMUM NUMBER OF FLUX CHANGE TIMES
      The maximum number of flux changes which can be recorded is fixed
by the local variable JTMAX set in a DATA statement in subroutine EFFLUX.
JTMAX is currently set at 500.  If JTMAX is increased, the dimension
denoted by  K  in the following arrays must be increased to match:
      SCHED(K),   IDS(2,K)   in  COMMON/SKDULE/,
      FLXIN(3,K), FLXTIM(K)  in  COMMON/FLUXES/,
                  TX(K)      in  subroutine FLXDAT (a local variable) -
The subroutine locations of /SKDULE/ and /FLUXES/ are given in Tables
D.3 and D.I in Appendix D.

5.9   CHANGING THE SOURCE GRID
      The basic information governing the numbers and sizes of the source
grid cells is initialized in BLOCK DATA program number 5, where a DATA
statement fixes the numbers of cells in the  x  and  y  directions,  NX
and  NY , and their dimensions in statute miles,  DELX  and  DELY.  These
variables are contained in COMMON/GRID/.  The geographic location of the
grid is fixed by the latitude and longitude of the center of the grid
rectangle,  CLAT  and  CLON .  CLAT  and  CLON  are each 3-word local
arrays containing angles expressed in degrees, minutes, and seconds.
Their values are initialized in a DATA statement in subroutine SETUP.
                                                                      49

-------
      The source grid currently used in DIFKIN has 25 intervals  in   x
and 25 intervals in  y , (NX = 25, NY = 25).  When  NX  and/or   NY  are
modified, it is necessary to change the dimensions of the arrays con-
taining the source data.  Table 5.1 lists the variables affected, their
locations, and required dimensions.
TABLE 5.1


Array
FFWY
FSRF
FXN02
FXHCR
FSLOW
FFAST
FRATIO
DIMENSIONS OF SOURCE
A
Location
COMMON/DATFL1/
COMMON /DATFL1/
COMMON/DATFL1/
COMMON/DATFL1/
COMMON /DATFL2/
COMMON /D AT FL3/
COMMON/DATFL4/
EMISSIONS DATA ARRAYS

Required Dimensions
(NX, NY)
(NX, NY)
(NX, NY)
(NX, NY)
(NX, NY, 4)
(NX, NY, 4)
(NX, NY, 4)
        *
         Subroutine locations of COMMON blocks are given in
         Appendix D.
5.10  INCREASING THE MAXIMUM NUMBER OF POWER PLANTS AND/OR OIL REFINERIES
      The maximum numbers of grid squares containing power plants and oil
refineries which may be accommodated by the program are fixed by the vari-
ables  NPPL  and  NORF  which are set in a DATA statement in subroutine
FLXDAT.  Currently, both of these limits are set at 30, although only
10 power plants and 13 oil refineries are actually being modeled.  If
additional space is needed for either source type then the appropriate
limit should be altered in FLXDAT, and the corresponding source array in
COMMON/DATFL1/ must be redimensioned accordingly.  The required variable
dimensions for power plant emissions are  FPPN02(NPPL,3) , and for oil
refinery emissions,  FORN02(NORF,3)   and  FORHCR(NORF,3).
50

-------
5.11  INCREASING THE MAXIMUM NUMBER OF SPECIES IN THE CHEMICAL MODEL
      The variable NROW, initialized in a DATA statement in the main
program, sets the upper limit on the number of chemical species which
can be handled in the chemical model.  (It may be recalled that this
limit is currently 20.)  To increase this limit, NROW must be set equal
to the new maximum number of species.  Modifications to array dimensions
which must accompany a change in NROW are listed in Table 5.2.

5.12  INCREASING THE MAXIMUM NUMBER OF CHEMICAL REACTIONS
      The maximum number of chemical reactions handled by DIFKIN is
determined by the variable MAXR set in a DATA statement in the main
program.  Increasing this limit beyond its current value of 20 requires
resetting MAXR and modifying certain array dimensions as outlined in
Table 5.3.

5.13  INCREASING THE MAXIMUM NUMBER OF MESH POINTS
      The variable MAXMSH is the maximum number of points in the vertical
finite difference mesh.  MAXMSH is set in a DATA statement in the main
program.  (Currently MAXMSH =10.)  To permit more mesh points, the user
should set MAXMSH to the new maximum number desired and complete the
dimensional modifications described in Table 5.4.
                                                                      51

-------
                               TABLE  5.2

            DIMENSION CHANGES REQUIRED TO ADD MORE  SPECIES
Array
ISTOYR
RATE
BETA
CONIN
WTMOLE
II
JJ
FLXWAL
FLXDGE
STOYKR
STOYKP
SPEC
CONUP
CONEW
PPHM
WORK
GZERO
AJACOB
Q
LOCFLX
Location
COMMON /CHEM/
COMMON /CHEM/
COMMON/ CHEM/
COMMON /CHEM/
COMMON/ CHEM/
COMMON/ CHEM/
COMMON/ CHEM/
COMMON/TRACER/
COMMON/ TRACER/
Main Program
Main Program
Main Program
Main Program
Main Program
Main Program
Main Program
Main Program
Main Program
Main Program
Main Program
Modification
C =
R =
C =
R =
Length =
Length =
Length =
Length =
Length =
C =
C =
Length =
R =
R =
R =
R =
R =
R = MNS, C
R = MNS, C
Length
Instructions
MNS
MNS
MNS
MNS
MNS
MNS x MNR
MNS + 1
MNS
MNS
MNS
MNS
MNS
MNS
MNS
MNS
MNS
MNS
= MNS x MNP
= MNS x MNP
= MNS
    R = number of rows of a two-dimensional array
    C = number of columns of a two-dimensional array
  MNS = maximum number of species
  MNR = maximum number of reactions
  MNP = maximum number of mesh points
52

-------
                              TABLE 5.3

          DIMENSION CHANGES REQUIRED TO ADD MORE REACTIONS
Array
ISTOYR
BETA
RATEFF
RATKON
II
STOYKR
STOYKP
REACT
Location
COMMON /CHEM/
COMMON /CHEM/
COMMON /CHEM/
COMMON /CHEM/
COMMON/ CHEM/
Main Program
Main Program
Main Program
Modification Instructions
R
R
Length
Length
Length
R
R
R
= MNR
= MNR
= MNR
= MNR
= MNR x MNS
= MNR
= MNR
= MNR
  R = number of rows of a two-dimensional array
  C = number of columns of a two-dimensional array
MNS = maximum number of species
MNR = maximum number of reactions
MNP = maximum number of mesh points
                                                                     53

-------
                                 TABLE  5.4
         DIMENSION  CHANGES  REQUIRED  TO  ADD  MORE  SPACE MESH POINTS
Array
RATE
CONIN
DFINIT
ZEE
TRACIN
SCALDF
CONUP
CONEW
PPHM
WORK
GZERO
AJACOB
Q
SCALE
DSCALE
DCOF
HTINV
TRIDAT
Location
COMMON/ CHEM/
COMMON /CHEM/
COMMON/SKY/
COMMON/SKY/
COMMON/ TRACER/
COMMON/TRACER/
Main Program
Main Program
Main Program
Main Program
Main Program
Main Program
Main Program
Main Program
Main Program
Main Program
Main Program
Subroutine CRANK
Modification Instructions
C = MNP
C = MNP
Length = MNP + 1
Length = MNP
Length = MNP
Length = MNP + 1
C = MNP
C = MNP
C = MNP
C = MNP
C = MNP
C = MNP x MNS
C = MNP x MNS
Length = MNP
Length = MNP
Length = MNP
C = MNP + 3
Length = (4 x MNP) - 2
    R - number of rows of a two-dimensional array
    C = number of columns of a two-dimensional array
  MNS = maximum number of species
  MNR = maximum number of reactions
  MNP = maximum number of mesh points
54

-------
6     BOUNDARY CONDITIONS
      The two boundary conditions used in the code are fluxes.  The first
boundary condition is determined by the ground fluxes, which are the
pollutant emissions from mobile and stationary sources and are computed
by subroutine EFFLUX.  (See Appendix B for a detailed description of the
operation of this subprogram.)  The outputs of EFFLUX are tables of flux
update times and flux values.  Fluxes are computed for nitric oxide,
reactive hydrocarbon, and carbon monoxide.  These tables are internally
input to the part of the program which computes the pollutant concentra-
tions.  The flux update times are stored in array FLXTIM and the fluxes
are stored in array FLXIN.

      The ground fluxes are updated by subroutine UPFLUX, the main program
being designed to call UPFLUX at the appropriate time.  The units of the
flux depend on the units used for the species concentration.  In our case
the program performs the computations in mass-fraction units, and the
fluxes are thus specified as volumetric fluxes with units of meters/minute.
Any scaling that needs to be done on the boundary conditions must be done
by UPFLUX since there is no provision for scaling in the main program.  In
                                                o
our case the fluxes are scaled by a factor of 10  in order to preserve
accuracy in the computation.

      The second boundary condition consists of the flux at the upper edge
of the air parcel.  This flux has been set to zero in the code because no
mass is allowed to penetrate the upper boundary of the air parcel; this
is equivalent to saying that the pollutants are trapped below the inversion
base.
                                                                       55

-------
 7     CONTROL OF INTEGRATION STEP SIZE
       The parameters TSTMAX and TSTMIN control the size of the integra-
 tion step (see Table 2.1, inputs 32 and 33).  The step size is controlled by
 a fractional-change criterion as follows.   Let the concentration of the i^h
 species at the jth mesh point at the nth step be denoted by  c. .  .   The test
 performed uses the fractional change parameter
                   i  n+1    n i ,  n
                 =  c..   -C../C..
                   '           '
 If  a.. > TSTMAX  for any (i,j)  combination,  the step size is halved for
 the next integration cycle.   If   a..  <  TSTMIN  for all  i  and  j ,  the
 step size is doubled for the next integration cycle.   For any particular
 problem some experimentation is  required  to determine the values of  TSTMAX
 and TSTMIN that yield a good combination  of speed and accuracy.   Our exper-
 ience has been that values  of TSTMAX = .03   and  TSTMIN = .01  work very
 well for the current model.
56

-------
                               APPENDIX A
                        THE AIR TRAJECTORY MODULE
      Subroutine WINDY is the main program of the air trajectory generation
module of DIFKIN. WINDY and its 15 supporting subprograms read in wind measure-
ment data, the locations of wind monitoring stations, optional conversion
factors, and case data (initial or final trajectory conditions), and cal-
culate mass point trajectories for air parcels traveling trajectories
which satisfy the case specifications and the interpolated wind data.
The resulting trajectories are passed to the flux generation module in
the form of an initial time and position and a chronological sequence of
times and wind vectors.

      The input wind monitoring stations are each specified by a name and
a pair of  x-y  coordinates in the selected grid system (which, of course,
must be the same reference frame used in the location of pollutant sources),
Wind measurement data collected at these stations is input in the form of
wind speeds and azimuths recorded at some regular time interval.  The
azimuths are recognized in an n-point meteorological system of
discrete directions  (4 <_ n j<_  99).  Wind  speeds, usually in miles per hour
(mph), may be accepted in any consistent units by proper specification of
an optional conversion factor.  The data for a single case includes the
date and local time at the starting point, an alphanumeric station identi-
fier or  x-y  coordinate pair locating the starting point in grid coordi-
nates, a flag indicating either forward or backward trajectory development,
the time duration of the desired trajectory, the time increment to be used
between wind calculations, the number of neighboring measurement stations
to be considered, and a flag specifying either inverse distance or inverse
distance squared to be used in weighting multiple wind measurements.  Other
inputs allow optional specification of the first wind vector used, and user
control over optional program output of the wind measurement station names
                                                                      57

-------
and locations, the wind measurement data, and augmented  trajectory out-
put giving the names of the measurement stations used to calculate each
wind vector.

      Standard output from the module consists of a display  of  the module
inputs with explanatory notes.  Normal output of the trajectory nodes  and
wind vectors is supplied by the flux generation module following  identi-
fication of the grid square indices associated with each node  (see
Appendix B).

      On its initial call WINDY performs certain input and initialization
procedures on a one-time-only basis.  First, subroutine  SETIN is  called
to initialize the names and locations of the wind measurement stations,
and the minimum and maximum radii of influence of the wind station
measurements.  As configured for Los Angeles, SETIN contains the  station
names and x-y coordinates for the 51 wind stations listed in Table A.I.
The names are stored as six-character Hollerith strings.  The x-y coor-
dinates have their origin (0, 0) at 118° 38' 20" west longitude,  33° 34' 2.5"
north latitude with  x  and  y  being measured in statute miles east and
north respectively.  Examples of the correspondence between  16- and
36-point meteorological wind systems typical of measurement  data  and a
standard compass system (azimuth in degrees clockwise from north)  are
shown in Table A. 2.  Upon return from SETIN, WINDY reads two flags indi-
cating whether the user desires printouts of the wind station locations
and/or the wind measurement data.  Wind station names and coordinates
are printed once preceding the first case, if requested.  WINDY then calls
subroutine WINDRD to read, and if desired print, the wind measurements
(there, too, printing is only done once prior to execution of the first
case).

      Wind data consist of two cards per station per day, the first of
which contains date and identification data in columns 1-32  and 24 hourly-
averaged digital wind vector azimuths in columns 33-80.  The second
58

-------
              TABLE A.I




WIND STATIONS AND THEIR COORDINATES




     l 07QO  COMM   PROGSA* TEST





       STATIONS
1CA>
60AZU
69BUH-K
71WEST
721QNB
^. j, LJ t c r\
f H ™ C, •* ' *
7bi.ENX
79PASA
80WHTP
2UQH
•JLAX
<*NTH
5Bl'K
60N;T
7BURK
8PM[)
9WRST
10LAC4
1 I.VE'i
1 2PASA
1 .3COM A
1 4EL.M
) 5WB
16RVA
17MISH
J8LONW
19CPK
?OAZU
21Wf,sn
22WUTT
?3ENG
?4WHTR
?5MAtr
26 KK I
27NFW
2BPOMA
29HOL
30FOX
31PIC
32VPH
33SAU
34RLA
35SM
36BKT
37MOR
38NP
39SP
40MMS
41ZUM
42COMi^
23 .14
4 1 . 03
18.36
11*9*
25. 7^
SO*fU
I5.4«i
29*49
35. -2'S
28, IH
14.46
33.63
1 7 . U
56.8^
19.03
3?» 8?
12.14
25 .01
9.4^
29.3V
23.00
35.3?
14.15
30.93
10.25
26 .23
2«3»
41*42
6.83
45.^5
fi.5«»
35.3?
-3.11
J5.6S
6.53
51 .36
18. IS
t4 .^5
15.77
24.28
4.39
28< 1 ?
8.42
49.71
10.61
42.57
22. 2f,
33.90
-11. U
26.56
32. 9f
39.29
41.98
32.67
17.64
34.72
P5.07
39.3?
24.64
I 7.bO
?6«2Q
] S.h?
43.^6
36.58
<»2»40
73.54
32.98
4 u , 8 0
29.6?
•*9.40
??.54
35.6^
19.24
2
-------
                                TABLE A.2
                     THE DIGITAL WIND AZIMUTH SYSTEM
                             North      East      South      West
Compass Heading
of Wind Vector 0°
Point No.
(16 point
Point No.
(36 point
Q
system)
18
system)
90°
12
27


180°
16
36


270°
4
9

card contains date and identification data in columns 1-32 and wind velo-
cities in columns 33-80 which correspond to the azimuths on the  first
card.  The wind velocities are also hourly averages.  The 24 values of
azimuth and velocity are associated with a 24-hour clock, the zeroth hour
corresponding with the first data entry, the first hour with the second
data entry, etc.  Reading of wind data is terminated upon recognition of
a card containing 9's in columns 1-6.  Provision has been made to read
wind data for up to ten different dates.  Each date is placed on its own
scratch file for later use.  In this way, when a date match is made, only
a comparatively small file of data need be searched to retrieve  any
particular piece of data.

      Next, WINDY reads a conversion factor to be used in converting the
wind speeds reported by the measurement stations to miles per hour  (mph)
for internal use.  (Thus, if the measurements are in knots, then the
conversion factor should be 0.869.)  Should the conversion factor be left
blank, the program will assume a value of 1.0.  This latter option  is
appropriate to the Los Angeles wind station data which is reported  in mph.
60

-------
 To complete its initialization procedure,  WINDY reads a  flag  indicating
 whether or not printing of augmented  trajectory generation  data is desired.
 The main feature of  the extra output  is  identification of the wind measure-
 ment stations used to  calculate each  wind  vector.  This  concludes the
 "first-case-only" input and initialization procedures performed by WINDY.

       Finally, the case data enumerated  earlier are read in to initiate
 calculation of a specific air trajectory.   A detailed description of all
 input parameters and card formats may be found in Sec. 2.2  of this manual.
 Certain internal checks are provided  in  WINDY to back up the  allowed input
 alternatives.  Thus, while starting coordinates must be  provided if the
 station name is left blank, these input  coordinates are  checked against
 the known station coordinates to provide appropriate station  identifica-
 tion if possible.  Similarly, if a station name is input, the starting
 coordinates may be omitted, provided  the wind really originates (or termi-
 nates) at that station.  If coordinates  are omitted, the coordinates asso-
 ciated with the station's name are used.  Given both, station identifica-
 tion and starting coordinates, neither are ever replaced or checked for
 internal consistency;  the trajectory  is  started at the given  coordinate
 point using wind data from the named  station, if available.

       Figure A.I is  a sample of the input  display provided  by WINDY
 following interpretation and checking of the case data.

AIR TRAJECTORY CALCULATION DATA
  STAPT CJATE AND LOCAL TIME  AT INITIAL POINT          f,90t»2('   2000 HRS (DAYLIGHT TIME)
  LOCATION OF INITIAL POINT                        ?*>.5f>    3o.?'»   UJCOMM  MEASUREMENT STATION)
  PRESCRIBED STARTING AZIMUTH CND VELOCITY (OPTIONAL)
  DIRECTION OF TRAJECTORY DEVELOPMENT               FORWARD
  DESIRED TRAJECTORY DURATION                       8.0 HRS
  TRAJECTORY SEGMENT LENGTH                         l.n HRS
  WIND MEASUREMENT INTERPOLATION SCHEME             3  CLOSEST STATIONS WITH  I/R WEIGHTING

      Figure  A.I.   Input Verification Display  from Subroutine  WINDY
                                                                          61

-------
      In its simplest form, the method used by WINDY to obtain a wind
vector at some given point and time consists of constructing a weighted
average of the wind speed and azimuth measurements recorded at up to 3
neighboring wind stations.  However, the application of this method in
practical situations requires introduction of some additional procedures
and rules to avoid various pitfalls.  In particular, procedures are needed
to deal with incomplete measurement records, stations supplying conflict-
ing information from the same relative azimuth, stations screened from
the trajectory node by natural barriers, and stations very near to or
very remote from a node.  To clarify further discussion of forward and
backward trajectory development, we list here the definitions of seven
terms closely related to these supplementary rules and procedures.
(Where appropriate the name of the subroutine performing the function is
also noted.)

1.    DATA INTERPOLATION OR EXTRAPOLATION:  Maximum data gaps which will
            be filled are two adjacent missing points embedded in or on
            the end of a one-day record.  These gaps can only be filled
            (by linear interpolation or extrapolation) if the two adja-
            cent points on one side or the other are non-zero.  (Sub-
            routine EXTRP).
2.    DATA AVAILABILITY:  Data may be unavailable for several reasons;
            because the desired station shows no record on the desired
            date, because the appropriate day and station record con-
            tains gaps which preclude interpolation or extrapolation,
            or because the requested date is not one for which measure-
            ments have been provided.
3.    ANGLE TEST:  Data will not be accepted from two stations lying
            within 2° azimuth of each other as seen from the trajectory
            node being considered.  (Subroutine ANGTST)
4.    BARRIER TEST:  Data will only be accepted from stations which can
            be connected to the trajectory node by a straight line which
            does not intersect any of the input barrier line segments.
            (Subroutine BARIER)
62

-------
5.     VALID DATA:   To be valid,  a wind measurement must be available, and
            satisfy the angle exclusion and barrier tests.  (See rules 2,
            3, 4).
6.     CLOSE STATIONS:  Given a time and location for which a wind vector
            is desired:  If the  nearest station for which valid data are
            available is less than 1 mile away, only its measurement will
            be used.  Only those stations within 15 miles distance and
            having valid data will be considered, in order of increasing
            distance, in the search for the desired number of close
            measurement sites.
7-     EDGE TEST:  An air trajectory may be terminated early if its path
            takes  it beyond the  edge of the coordinate grid.  In the case
            of a reverse trajectory which backs off the edge of the grid,
            the initial point of the trajectory passed to the flux gener-
            ation  module will be the last node calculated to be inside
            the grid.  (Subroutine EDGE)

      Having established this background of terms, we are ready to des-
cribe the calculation sequences  for forward and reverse trajectory develop-
ment.  Forward trajectory development consists of cyclic execution of the
following steps:
      1)    Search the measurement records of the wind stations (using
the appropriate date and the current time) in order of increasing distance
from the trajectory point until  the desired number of close stations hav-
ing valid data are found, or until the maximum radius of influence is
reached.  These operations are accomplished in subroutine GETAZV.  Lacking
any close stations, trajectory calculations will be terminated.

      2)    Combine the  n  speed/angle measurement pairs found into an
average speed and  angle using
                                                                      63

-------
              -z
t fe)
                        1=1
where       i = wind station index
            n = number of  close  stations  to be used
                (1 _<_ n <_ 3,  as specified  by the user)
            k = 1 or 2 as  specified by  the user
           R. = distance from trajectory  point to ith wind station
           S. = speed or angle measurement from ith wind station
            S = weighted average speed  or angle
This calculation is performed in subroutine AZVDIS.

      3)    Integrate the  trajectory  one  time step using Euler's method
(i.e., using the current position and velocity to extrapolate  the trajec-
tory to the next node in a single step).

      4)    Unless the trajectory is  complete, and provided  the barrier
and edge tests permit, start again at step  (1) using the date  and time
for the new node.

      Reverse trajectory development  is somewhat more complicated, but
does utilize many of the calculations needed  in the forward  case.  Reverse
trajectories are calculated in the following  manner:
      1)    Search the measurement records using the current trajectory
point, but the date and time which will be appropriate  at  the  next node
(that being one time step earlier).

      2)    Combine the measurements.
 64

-------
      3)     Extrapolate the trajectory back one time step using the cur-
rent position and the velocity calculated for one time step earlier, to
obtain an estimate of the next earlier node position (see Fig. A.2a).

      4)     Using the estimated node position, search the station records
                                                                        /
with the  same date and time for a new set of close station data.

      5)     Combine the measurements.

      6)     Starting from the reference node, reestimate the position of
the next  earlier node by extrapolating back one time step with the new
wind vector (see Fig. A.2b).

      7)     Repeat steps 4), 5), and 6) as desired (program currently
does 3 iterations; see Fig. A.2c).

      8)     Barrier and edge tests permitting, establish the last estimate
of the next earlier node as the new reference node.

      9)     Record the last calculated wind vector with the time appro-
priate to the new node.

     10)     Return to step 1), unless the desired trajectory has been
completed.

      When a reverse trajectory has been completed,  WINDY reorders the table
of times  and wind vectors, placing them in chronological order and records
the final calculated point as the trajectory start point.

      Figure A. 3 illustrates a sample of the optional extra printout of
trajectory data.  From left to right, the columns contain the local times
and dates at the trajectory nodes and their  x  and  y  coordinates in
statute miles, the local times and dates correponding to the wind data
used, the calculated wind speed in miles per hour, and direction in
degrees counter-clockwise from East, and abbreviated names of the
                                                                      65

-------
                                                A)  INITIAL ESTIMATE
                       20-
                          3—	OREF.
                                                B)  FIRST ITERATION
                                                C)   SECOND ITERATION
               Figure A. 2.  Reverse Trajectory  Development
66

-------
1900
2000
2100
2?00
2300
?»00
100
200
300
690929
69Q939
69fl929
690929
690929
69Q929
690930
690930
690930
26.56
29.39
30.64
30.70
31.79
33.32
29.29
26.69
26.06
.10
33
36
35
34
35
3*
34
33
.29
.12
.49
.24
.11
.39
.8?
.20
.14
1900
2000
2100
2200
2100
2400
100
'00
TOO
690929
690929
690929
690929
690929
690929
690930
690930
690930
4.00
3.60
1.26
1.56
2.00
4.07
2.6R
1.23
2.3S
45.00
69.65
272.94
314,00
39. «5
188.05
193.50
238.9?
199.05
42CO
4?CO
12PA
12PA
14EL
14EL
12PA
1CA
42CO

16RV
14EL
14EL
12PA
12PA
42CO
42CO
1CA

32VE
42CO
42CO
16RV
16RV
14EL
32VF
32VE
              Figure  A.3.   Optional Extra Trajectory Output
measurement stations which contributed data to the calculation of the
wind vectors.   The separate lists of times and dates can prove useful when
examining reverse trajectories where the wind data used are not associated
with the initial node times but rather with the final node times on each
segment.

      Figure A.4 provides a fairly detailed flow chart of the trajectory
calculation portion of subroutine WINDY, showing that many sections of
the code are used for both forward and reverse trajectories.  Readers
interested in program details will find the flow chart a useful guide
to the FORTRAN code.

      Details of subroutine functions and usage may be found in Appendix E
of this manual.
                                                                       67

-------
       READ OPTIONAL
       PRINT FLAGS
   READ WIND  STATION
   NAMES AND  COORDINATES.
   PRINT IF DESIRED
   READ WIND MEASUREMENT
   DATA. PRINT IF DESIRED
     READ WIND SPEED
     CONVERSION FACTOR
      READ ONE  SET  OF
      CASE. DATA
    SUPPLY STATION NAME
    OR COORDINATES AS
    NEEDED
      PRINT  CASE DATA
    SET "OLD"  DATE/TIME
    AND "NEW"  DATE/TIME
    TO START DATE/TIME
     INCREMENT "NEW"
     DATE/TIME TO NEXT
     EARLIER STEP
            WAS
        THE INITIAL
        WIND VECTOR
         SPECIFIED
  RETRIEVE MEASUREMENT
  RECORD(S) FROM CLOSE
  STATION(S)  HAVING  VALID
  DATA FOR NEW DATE/TIME
                                                                            DECREMENT
                                                                            NODE COUNT
                                                                            BY 1
                                                              AZVDIS
COMBINE MEASUREMENTS
ACCORDING TO PRESCRIBED
WEIGHTING RULE  TO
PROVIDE AN ESTIMATED
WIND VECTOR
PRINT DIAGNOSTIC
MESSAGE "THERE ARE
NO CLOSE POINTS"
                                                                 190
                                               NODE COUNT = 1
                                              STORE INITIAL
                                              NODE COORDINATES
                                             TRAJECTORY SEGMENT
                                             COUNT = 0
                                                               REVERSE
                                                                                           STORE FIRST NODE
                                                                                           ("OLD") DATE/TIME
                                              FORWARD
                                              200

\
INCREMENT
TRAJECTORY
SEGMENT
COUNT BY 1
                                                                                               SET NODE
                                                                                               COUNT   2
                                                               FORWARD
                                             SET  "OLD" DATE/TIME
                                             =  "NEW"  DATE/TIME
                                           STORE "OLD"  NODE  TIME,
                                           WIND SPEED,  AND WIND
                                           ANGLE FOR THIS NODE
                                           USE WIND VECTOR AND
                                           TIME INCREMENT TO
                                           COMPUTE TRIAL POSITION
                                           FOR NEXT NODE
      (FIG.  A.4b)
                               Figure A.4a.    WINDY  Flow  Chart
68

-------
INCREMENT NEW DATE/TIME
TO NEXT STEP
            FORWARD
  SET "OLD"  DATE/TIME
    "NEW"  DATE/TIME
RETRIEVE  MEASUREMENTS
RECORD(S)  FROM CLOSE
STATION(S)  HAVING VALID
DATA FOR  "NEW" DATE/TIME
                            180  (FIG. A.4a)
            YES
COMBINE MEASUREMENTS
ACCORDING TO PRESCRIBED
WEIGHTING RULE  TO
PROVIDE AN ESTIMATED
WIND VECTOR
(FIG.  A.4a)
                  Figure A.4b  (Cont.)
                                                                                  69

-------
          REVERSE TRAJECTORY  ITERATIONS

                      [ 250 1
                                                                   CONCLUSION OF SUBROUTINE  WINDY
                                       (FIG.  A.4a)
                ADVANCE ITERATION
                COUNTER BY 1
                                                                          STORE NUMBER OF
                                                                          TRAJECTORY NODES
                                                                                           FORWARD
REVERSE THE ORDER
OF THE TIME, VELOCITY,
AND ANGLE LISTS
             USE WIND VECTOR AND TIME
             INCREMENT TO COMPUTE
             TRIAL POSITION FOR NEXT
             EARLIER NODE
                      WOULD
                 NEW TRAJECTORY
                 SEGMENT CROSS A
                     BARRIER
 STORE COORDINATES  OF
 LAST COMPUTED NODE
 AS TRAJECTORY START
 POINT
                                       (FIG. A.4b)
    C   RETURN    J
             RETRIEVE MEASUREMENT
             RECORD(S) FROM CLOSE
             STATION(S) HAVING VALID
             DATA FOR "NEW" DATE/TIME
                      ARE
                     THERE
                   ANY CLOSE
                    STATIONS
                       i
             COMBINE MEASUREMENTS
             ACCORDING TO PRESCRIBED
             WEIGHTING RULE TO
             PROVIDE AN ESTIMATED
             WIND  VECTOR
                                       Figure  A.4c  (Cont.)
70

-------
                              APPENDIX B
                      THE FLUX GENERATION MODULE

      Subroutine EFFLUX is the main program of the pollutant flux generation
module of DIFKIN.  EFFLUX and its 16 supporting subprograms comprise an
automated form of the emissions model developed by Systems Applications,
          3 4
Inc. (SAI) '   for application to the Los Angeles area.  As developed by
SAI, the model aggregates emissions of nitric oxide (NO), reactive hydro-
carbons (HC), and carbon monoxide (CO) into 2x2 mile squares over a grid
of 625 squares encompassing most of the Los Angeles Basin and environs.
However, as coded, all of the numerical aspects of the model
(grid location, grid cell dimensions, emissions data, etc.) are
easily altered for other regional applications.  Stationary-source
emissions, in kg/hr of each species for each grid square,'are specified
separately for power plants and oil refineries, and are aggregated for
distributed stationary sources  (e.g., gasoline marketing, dry cleaning,
solvent coating, etc.).  Vehicular emissions in each grid square are
functions of surface street and freeway vehicle miles traveled  (VMT),
times of day (with separate time distributions for surface streets and
freeways), and average vehicle speed, itself a function of location and
time.  A correction factor to distribute morning cold-start emissions is
also modeled.  As implemented in the GRC model, all of the SAI baseline
     *
data,  circa 1968, is included in the program with input multipliers
available to scale each species emission source, allowing simulation of
control effects, population growth, etc.

      The output of the source emissions module is a schedule of pollutant
fluxes into the air parcel, prepared by computing the time of entrance
of  the air parcel trajectory into each grid square traversed as it moves
across the region, and summing up the contributions for each species as
a function of  the time and the grid location.
 *
 With the exception of the aircraft emissions data.
                                                                        71

-------
      The initialization data required for the emissions model is rather
voluminous and hence, the most efficient form of data storage and input
would probably make use of some form of permanent data file (e.g., tape,
disc or drum).  However, since the availability and usage of these
peripheral devices varies from one computer installation to another,
the program is configured to be self-contained for ease in site-to-site
transfer.  To avoid the necessity of repeated reading of large input card
decks, most of the emissions data are initialized in standard FORTRAN
BLOCK DATA subprograms using DATA statements to set parameters stored
in labeled COMMON blocks.  Tables B.I and B.2 list the parameters initialized
in this fashion separating them into vehicular emissions data in Table B.I
and stationary source emissions data in Table B.2.  In addition, initiali-
zation of grid location and dimension parameters is also accomplished
via DATA statements in a BLOCK DATA program.

      The trajectory of the air parcel across the source grid is provided
to EFFLUX as a starting time and location (in grid coordinates) and a
chronological sequence of standard times, wind speeds (in miles per hour),
and wind angles (in radians counterclockwise from east).  These data enter
via two labeled COMMON blocks and may be calculated by the Air Trajectory
module (see Appendix A) or read from cards by the main program, DIFKIN.

      The reading and scaling of case data peculiar to the flux generation
module is accomplished in subroutine SETUP.   Wind speeds are converted
to miles per minute and times to minutes from the initial time for
internal calculations.  Using the latitude and longitude of the grid
center and the grid dimensions specified by BLOCK DATA,  SETUP locates the
latitudes and longitudes of the origin of the grid coordinates and of the
trajectory start point, and prints a reference table giving latitude,
longitude, x-y coordinates in statute miles, and grid square indices of
the grid center, the grid origin and the trajectory start point.  SETUP
also initializes the boundaries and grid lines for a printer-plot of the
air trajectory.
 72

-------
                                                   TABLE  B.I

                                      VEHICULAR EMISSIONS  DATA
Parameter
Freeway VMT
Surface Street VMT
Fraction of Total Daily
Freeway VMT
Fraction of Total Daily
Surface Street VMT
Off Peak Average Speed
on Freeways
Peak Traffic Average Speeds
FORTRAN SAI '
Variable Symbol Units
FFWY M kmi
FSRF MS kmi
TFWY f
TSRF ds
VBAR V mph
FSLOW V mph
Resolution
each grid square
each grid square
each hour
each hour
all hours except
6:00-10:00 AM
each grid square,
Los
Data
Ref.
Ref.
Ref.
Ref.
Ref.
Ref.
Angeles
Reference
3, page A-10
3, page A-ll
3, pages A-12
3, pages A-12
4, page 3
4, pages 6-9



,13
,13


on Freeways (Slow Direction)
Peak Traffic Average Speeds
on Freeways (Fast Direction)
Peak Traffic Volume Ratio
on Freeways (Slow/Fast)
Fraction  of Vehicle Starts
which are Cold Starts

Correction Factor to Account
for Emissions following
Cold Starts
Exponent  for Emissions vs
Speed Correlation

Hot-Running Emission Factors
Cold-Start Cycle Emission
Factors
Linear Coefficient
for Emissions vs
Speed Correlation
                                                        mph
grams
mile
grams
mile
each hour between
6:00 AM and  10:00 AM

each grid square,
each hour between
6:00 AM and  10:00 AM

each grid square,
each hour between
6:00 AM and  10:00 AM

in 8 time periods
over 24 hours

each species,  1.0
before 6:00  AM and
after 9:20 AM,  func-
tion in 19 linear
segments between
6:00 and 9:20  AM,
surface streets only

each species,
freeways only

each species
                                                                      each species
              each species,
              freeways  only
                                       Ref.  4,  pages  10-13



                                       Ref.  4,  pages  14-17



                                       Ref.  4,  pages  2, 35


                                       See text and Ref. 4
See text and  Ref. 4,
pages 23-25

Case Input Data  for
appropriate year
(See Ref. 4,  page 1)

Case Input Data  for
appropriate year
(See Ref. 4,  page 1)

Ref. 10, page 3.1.1-8
                                                                                                                 73

-------
                                                TABLE B.2
                                     STATIONARY SOURCE EMISSIONS  DATA
Parameter
Power Plant NO Emissions
X
Oil Refinery NO Emissions
Oil Refinery Reactive HC
Emissions
Distributed Source NO
Emissions
Distributed Source Reactive
HC Emissions
Fraction of Total Daily
Power Plant Emissions
Fraction of Total Daily
Oil Refinery Emissions
Fraction of Total Daily
FORTRAN
Variable Symbol
FPPN02 QP
FORN02 Q°
FORHCR Q°
FXN02 Q!?
FXHCR Qd
2
TPPL dp
TMSC d°
TMSC dd
Units Resolution
kg/hr daily average
each square
kg/hr daily average
each grid square
kg/hr daily average
each grid square
kg/hr each grid square
6:00 AM-6:00 PM average
kg/hr each grid square
6:00 AM-6:00 PM average
	 each hour
	 each hour
	 each hour
Los Angeles
Data Reference
Ref.
Ref .
Ref.
Ref.
Ref.
Ref.
Ref.
Ref.
Ref.
Ref.
Ref.
3, pages A-54 to A-58
5,
3, page A-61
3, page A-62
6 , pages 2-4
3, page A-75
3, page A-78
6 , pages 2—4
5
3
3
Distributed Source Emissions

-------
      SETUP then reads two sets of gram-per-mile vehicle emission factors
for each pollutant species, one set for hot-start emissions, and a second
set which include the effects of a single cold-start.  These vehicle
emission factors must represent the average emissions for the desired
vehicle population as combined from model year test data under some
test driving cycle, or from emission standards.  The weighted average
emission factors used would typically be derived from a distribution of
vehicle population and usage with age, and might also include emissions
from heavy duty vehicles as well.  Emissions measured under the 1972
Federal Driving Cycle  (FDC) include cold-start effects but it is not
always possible to fabricate the corresponding hot-running emission
factors.  Lacking both sets of data, the user may input the available
set for both types, thereby eliminating the effects of temporal and
geographical distribution of cold-start emissions.  The error thus
                                                         Q
committed has been shown to be small on a relative basis.

      The technique used in the SAI model to accomplish the temporal
distribution of morning cold-start emissions is mathematically rather
involved and the reader should consult Ref. 4 for a discussion of the
method used to derive the correction factors for HC and CO emissions.
(As yet, no correction factor has been derived for NO  emissions.)
                                                     X
Once calculated, the curves have the form shown in Fig. B.I.  Unfortunately,
some of the data used in Ref. 4 was numerically incorrect so the actual
correction factors used in the program were calculated by GRC using
corrected data.

      Internally, the program will use hot-start emissions adjusted to
account for average speed to calculate emissions from freeway vehicles.
Hence, SETUP initializes the value of the driving cycle average speed
(VFDC) and three curve fit constants which define the emissions vs
speed relationship.  For the 1972 Federal Cycle, VFDC = 19.6.  The
emissions vs -average speed relationships used for HC and CO emissions
                                     Q
are based on the work of Rose, et al.   The relationship used for NO
                                                                       75

-------
    1.10 r-
                   EC Emissions Adjustment  for Morning Cold Starts
76

-------
has been estimated more recently by EPA in Ref. 10.

      Finally, SETUP reads in a series of adjustment factors which are
included to permit individual and combined scaling of the various portions
of the source emissions data base, allowing simulation of population
growth, projected emissions control regulations, etc.  With these factors,
the user can adjust vehicular emissions as a class and stationary emissions
as a class, and he can adjust individual species emissions from freeway
vehicles, surface street vehicles, power plants, oil refineries, and
distributed stationary sources.

      Following initialization by SETUP, EFFLUX traces the air trajectory
through the grid, tabulating the time and position coordinates of each
grid line crossing, and the indices of the grid square being entered.
EFFLUX also tabulates the coordinates and grid square indices at each
node, and enters each node as a data point on the printer-plot.  The
trajectory nodes are marked on the printer-plot as an alphabetic sequence
of letters.   (Nodes which fall outside the boundaries of the plot are not
shown.)  When the trajectory tracing has been completed, EFFLUX prints
a  table containing the plotted symbols, the node times, the grid square
indices and coordinates of each node, and the wind speed and direction
used to get to the next point.  Next the printer-plot of the trajectory
nodes is output, and then a table of grid line crossing times, coordinates
and grid square indices identifying the square being entered is printed.
Samples of these outputs are shown in Sec. 3 of this manual.

      Having  completed these preliminary calculations which define some
of the times and places at which fluxes or trajectory conditions change,
EFFLUX combines this information with other internally tabulated times
at which changes in temporal distribution factors occur.  These include
the times at which traffic and stationary source time distribution
functions change and time points in the functions which describe the
distribution  of cold starts.  All of these times at which pollutant
                                                                       77

-------
 fluxes may  be  altered  for  one  reason or  another are assembled into a
 single schedule  of  times and locations  for which new fluxes will be
 calculated.

      EFFLUX now calls  subroutine  FLXDAT to calculate the total emissions
 of  NO, HC and  CO for each  time in  the flux change schedule.  For each
 time  in  the schedule,  FLXDAT makes the following calculations (symbol
 definitions may  be  found in Tables B.I,  B.2,  and B.3):
      -  Check  point source tables  for power plant or oil refinery
         emissions in square I,  J
      -  Calculate stationary source emissions  in kg/hr
      STNO   =  F2.24.C4-(F9-dP.qP + F1Q.d°.Q° + F^-d^qJ)

      STHCR =  F..24.(F11.d°.Q?  + F.,.dd.Q!j)
               2.      11     2.     lj      2

       STCO =  0
      -  Calculate vehicular source emissions in kg/hr
      Q±(t)  =  y(t)  • qj +  [1 -  y(t)]  • qj           for   i = 1,2,3   /Sramsl

      E?(t)  =  Q  (t) • ds .  MS(I,J)  •  3.(t)          for   i = 1,2,3
       -L       1      X-              1
             =  df •  Mf(I,J)
          f    1  + x(I,J,t)

          n   =  n   •  x(I,J,t)

                    r-        ibi
          Pi  =  ai '  [vf(I'J»t)J    + c± • Vf(I,J,t)   for   i = 1,2,3

          q.=a.  -  [v8(I,J,t)]bl + Cl - Va(I,J,t)   for   1-1,2,3   (gff)

      vfr + \  -         j.                                              /1— \
       ±( '  ~  nf '  pi + ns  ' qi                     for   i = 1,2,3
                        r
       VHNO  =
                                                                     .
78

-------
                             TABLE B.3

                       SYMBOL DEFINITIONS
                                       2
  A = Ax-Ay  =  area of  a  grid  square  (mi )
    = 2.58999 x  io6
    =    1     kg-min
  2   60pA C  meter-hr
 C0  = 907.185
  3            ton



    = ^0 _ Molecular Wt  of NO

  4    46   Molecular Wt  of NC>2




 C_  = 0.704 =  assumed  fraction  of  exhaust HC which is reactive



  p  = 1.178 kg/m  = air  density at sea  level, 80°F



 F  = vehicular  source emissions scale  factor



 F-  = stationary source  emissions  scale factor



 F  = NO  emissions scale factor for  freeway vehicles
  J      X


 F,  = HC emissions scale factor for freeway vehicles



 F  = CO emissions scale factor for freeway vehicles



 F,  = NO  emissions scale factor for  surface street vehicles
  D      X


 F  = HC emissions scale factor for surface street vehicles



 F_  = CO emissions scale factor for surface street vehicles
  o


 F  = NO  emissions scale factor for  power plants
  y      x


F   = NO  emissions scale factor for  oil refineries
 -LU      X


F   = HC emissions scale factor for oil refineries



F   = NO  emissions scale factor for  area stationary sources



F -  = HC emissions scale factor for area stationary sources



  I  = x-index  of current grid square



  J  = y index  of current grid square



  t  = current  local time



  i  = species  index;  1 = NO  , 2 =  HC, 3 =- CO



 a.  = speed factor constant  initialized in SETUP  for each  species


                          \-b.
        ^   c. •VFDC|'(vFDC)  X
                                                                            79

-------
                                            / kg \

                                            \






= F.  .  (F  •  E*(t) + F  •  E^(t))            (
   ±     o    J       J    J                \
      VHHCR = FI •  C5 .  (Fy •  E^Ct) + F4 •  E2(t))        hr
       VHCO =
      - Calculate total source emissions in square I,J at time t in units



        of meters per minute for use by DIFKIN







      ENO  = C2 • (STNO + VHNO)          (mfn)




                                             (V


                                          -T- )
                                          mm f





      ECO  = C  • (STCO + VHCO)          (








As it calculates the source fluxes,  FLXDAT prints a table of vehicular



and stationary source emissions in kg/hr for each time in the schedule.



An example of this table may be found in Sec. 3 of this manual.  The



final flux schedule delivered to the chemical module is in m/min and is



transmitted via a labeled COMMON block which has a capacity of 500



times.
80

-------
                    APPENDIX C




LISTING OF INPUT DECK PRODUCED BY SUBROUTINE PREDAT
                                                           81

-------
CO
NO
                            I M A fi t ^  i | F  : i f. T .1 - C
                                                                                                          •51
                                                                                                                       61
                                                                                                                                     71
LPH\<
1
?
3
<*
S
6
7
H
4
1 li
C A P. f)
1 )
12
13
1*
15
16
17
18
19
20
CARD
21
2?
23
24
25
26
27
28
29
30
CAPO
31
32
33
30
3S
36
37
38
39
40
riFMN SAMPLE *UN - COMPUTE TP.AJECTOPY, FLUXES. AND CONCENTHAT IONS
IS TrtAJFCTOrJY liMPUl EXTERNALLY NO
3 we. FLUXES 1 MPUT L>.TEPNALLY M)
CO'lPIjTt SPECIE" PUNCH TP.AJFC10PY YtS NO
PKiNT STATION COOR[)S, «IND DATA NO UO
^9 411 1*£LM EL MONTE 14WD 16PT121J14 6 710 5 51011 91010101111111010101010 911
69 911 14EL* EL MONTE 15l»S MPH 432-32122324677 91010 8765442
^9 9u *2COMMCOMME«Ct 14WD 16PT 7 7 910 7344 61 21 1 1 1 1 1 lifl?121 1 12131 313121 J12
«,9 '»11
^9091 1
1
^90911
* 9 n 9 1 ]
1^9091 1
^9n9i i
690911
690911
690911
690911
ft9Q9H
*909H
1
f-90^11
69u9ll
690911
690911
690911
690911
690911
69C911
*90911
6909H
1
6909)1
690911
6909] 1
690911
690911
69091 1
69n M 1
6 1 !J ••) \ 1
f-9091 I
*9,)9l 1
•*2CO"1MCOMMEKrE 15*S MPh 5 4 3 ? 3 2'3 33456889 91010 977753
3LAX LA INT 13W14WO Ib^T 7 4 8 h 8 4 115 9121112111112121212121112101212
11 21 31 41 51 61 71
3LAX LA PMT 13W15WS MHH 265533366 712 912 910 913131412 9776
5BUH HANK i*iwi4*0 16PT 4 4 141* 355346643865544667
5«UW dAMU <»1W151«S MPH 221221363655 612 6767655535
?LGB EACH 21W14WD 16PT 849 212 9497 112 8101113121212141314131512
2LG9 EACH 21W15WS MPh 7515515355 31010 7 712 9 910 89799
4NTB LSALMT 14WO 16PT 5 10 9 91011 9 9101314141414
4NTB LSALMT J5WS MPH 311 1 1111111886289767623
1CAP IJ^TNLA 75W14WD 16PT 644 216 8 8 6101010101010101010121212101210 8
1CAP ONTNLA 75W15*S MPH 3J?333334'i5t87H7Sa666442
36BKT dKCKTT 94W1440 HPT]41212 4 4 12121212121212 4
It ?1 31 41 51 61 71
36HKT iJPCKTT 94W15WS MPH 31412 78764322
30FOX FOXf-LU 98W14WO 1&PT12121312 216 51212 4 9101211 9 8 910101112121213
30FOX FOXFLU 98W15*S MPh 44554 232317 6121416181510 8 6 610 6
29HOL LYWOOU 27W14WD 8PT 88284 41210101210101010101010 810 810 81010
?9HOL I_Y«OOD 27W15WS MPH 111121122222222111111111
3bNP .MWPHTB 14WD HPT]0 12121212121213131313
38IMP 'MwPHTb 15WS MPH 3 3544456545
31PR' PICO 14WQ HPTlO 64^2 2161410 0101012 8101010 810101010 610
31PIC ^ICU 15WS MPH 111111111111121111211111
34RLA RCdOLA 22W14WD 8PT 6 6 6121210 61010141010 8 810101010101010101010
11 21 31 41 51 61 71
3tHLA HCHOLA 22K15WS MPH 1451111111112288 H1010 94861
33SAU S4UGUS 9H«14WIJ 8PT 46660664 41O1212 8888 810101014 666
33SAU S«JGUS 91W15*S MPH 111121111122 214 9863111111
32VFS VERNON 34W14WD 8PT 2228 81010 6 6101012 810 81010101012101010
32Vfc» VERNON 34W15WS MPH 12111112222266 779537574
?2»NTT*LNUT lubW14WO 1 6P f 5 5Ulh 1 9 51111121110 7111110 88778873
2?WNTT«ILNHT 106W15iVS MPH 3222222234464566B6544222
9WFSTLA 102W14WD 16PT i 3 41010 9 91110 9 9 1 0 1 0 1 0 1 Olil 1 1 1 1 1 1 1 1 0 997
9WFSTLA 1C2W15WS MPH 111111111234444343221111
24WHTRITTIF.HU*W14WI) i6PT 6 7i?l5lbl3 71216)612 8 9i 21 1 1 1 1 1 1 11 1 1 313131 313
INPUT NO.  (TABLE  2.1)

           1
           2
           3
           4
           5
           6

-------
                                      T ,1 -(. «.
                                               1 1
                                                           ?1
                                                                        31
                                                                                   41
                                                                                                51
                                                                                                            6]
                                                                                                                        71
                                                                                                                                     INPUT NO.  (TABLE  2.1)
00
C-'iP'1
41
4?
43
44
45
46
47
/• A
4 "
49
S"
C A PO
51
52
53
54
55
56
57
Sri
S9
6"
CAPO
6)
6?
63
64
65
66
67
68
69
1 n
' U
CAPO
71
7?
73
74
75
76
77
78
79
Hi)
h 9 0 9 1 1
'-->J9H
6'-»C9l 1
<-9n9] 1
fr009) 1
690911
^90911
69091 1
69P-M ]
fcUQJ] 1
1
fc9u9i ]
•"91)9] 1
69,l9l 1
6 9 0 9 1 1
6909n
6909U
69o9l)
6909ll
^9r,9l 1
6909U
1
690 4\ 1
f-Ol,)} 1
*-9r? 9ii
690911
690911
69P91 1
690'M 1
690911
6909) )
690^1 1
1
69091 1
fc9Q9l 1
^9D9U
69Q911
690911
f- 9 9 ;j 9
^9 9? 9
A 9 9J9
fr9 J?9
69rr->29
?4<"H i KlTT ItW
)?PASAOE JA
1 ^Pib VJE'JA
1 1 ^ M H.E
1 1 V e 'J ICE
16HVA *
-------
                          IMAI-.ES
                                        '. T u -( Ai?9
691 V9
69o929
690929
690929
690929
6909P9
f- 9 U 9 2 9
690929
1
690929
6909?9
690^29
69(1929
69Q929
69Q929
690929
690929
690929
690929
1
690929
fr9()929
690929
690929
690929
69Q929
690929
690929
690929
69Q929
1
690929
f,q ,)929
690929
690^29
6 9 u 9 2 9
^9o929
1 \
3L Ax
SHU«
SHU-
,JLCit-l
21 m
4NTB
4NTB
60MT
60i\i r
8PMQ
1 1
HPMQ
1CAP
1CAP
368KT
36BKT
30FOX
30FOX
29HOL
29HOL
38NP
11
38NP
31PIC
31PIC
34RLA
34RLA
33SAU
"3 "a C A 1 1
33 b«U
32^EP-
22*NT7
11
22*NTT
9*f"ST

LA JNT
BANK
•JA'MK
EACH
EACH
LSALMT
LSALMT
4k] 0
4WIO
ALE

ALE
ONTNLA
ONT.xlLA
^^iC^T T
BWCKTT
KOXFLU
FOXFLD
LYWOOD
Lrwooo
IMwPklH

i^PrtTB
PICO
PICO
rtCHOLA
KCHOLA
SAUGUS
C A i I/' . 1 1:
3** Ut5Uo
VEkNON
VE^NOI'J
•VLNUT

WI.MUT
LA
9WFSTLA

24*
-------
                                                  1 ]
                                                                                                   bl
                                                                                                                            71
                                                                                                                                          INPUT NO.  (TABLE 2.1)
00
Ui
L » « 1 )
12?
1 ?3
?4
25
?6
27
?8
1 29
130
CAPO
131
) 3?
1 33
1 34
135
136
137
13*
139
1 40
C A P I)
141
142
143
144
145
146
147
148
1 44
150
C A R 1 1

JS2
153
154
155
1 5b
157
1 58
159
1 6'i
690929
ft9()929
F, go 92 9
«• ') ;i ^ 2 9
ft 9 1929
«,9Q JJ>9
ft909?9
ft90929
A Q Ti 9 ? 9
I^VA*

2 1 H f- 3 ; j
1 1jH(-
IbPi1
?7Mt W
?7ME »
*PT
MPH
2 1 1
9 9lo
223
a 8121

1 4 ?
2
4
3
2
3 2
31015
3
3
3
3 5
9 9
3 3
211246654?2
342324
1121013131413141414131312 9l5l414
1 1 1 2 4 6 8]010 9 7
511111
5 7l313l313l3]3131?12l21211 559
22333576665
41616161410 810 8888887
41
2
1141313
335
b
16PT14101214
MPH
16PT
MPH
I 1 1
1

2
11
7
31
1

2 2
113
5 7
1 1
2 1
51 61
2 1 4 61010101210 6 8
333222
888 61316
71
642111
2141313131313U131?13131213141616
3349 911141515171612 77433
9 6 H 6 6 9 714151515141211121412
11111224664
212111
81214141512161613 9 9
2 1 1
1
ft9p929 PBPO'^APO^O'JA 1 Q9^ 1 4 WO \6PTl5l4 510
ft 9 0 9 2 9
ft90??9
1
n9tJ29
ft 9 0 4 ? 9
690929
f-90929
ft9i)929
ft 9 o 9 2 9
ft 9 D9 29
ft 9 930
ft9 930
ft 9 930
J B P O M A
?o*zu
1 \
2 |A/H
A N A H fc J
ANAHtl
OHAN&t
OHAMfat
POMONA
A^USA

^/^Lisa
•i
M
err A
1 0 9 W 1 5 W S
97W14WI)
21
9 7 W 1 5 w S
14WU
15V»S
IH 14WO
cry AIH i5*s
1 A HAhrtfc
LA Hub
1 4 L L I
J 4FLM
^ ^
HL MO>J
!4lVO
1SWS
Tt 14 WO
KL MONTt 15WS
4?COiMCOMM£KCf' 14WD
MPH
16PT
31
MPH
16PT
MPH
16PT
MPh
16PT
MPH
IbPT
MPH
16PT
3 2 2
816 61

1 4 2
21412
1 1 1
41212
2 1 3
2 bio
222
3 5 H
233
5 81?
2
1
1
2
112
41
3
?
1
2
3
9
1
3
2
5

1
31
2
4 1
4 7
2 3
21111234442
111131
5 61112141413141314131314 1 3 213
22224446664
41414 4539 910 9999

4 4
212
2 2
41012
3
21
3
2
2
4
3 1
bl 61
22 t 1577 91011 9
532121
989942
71
522111
4 610121211101012121212 412121212
11122223432
2141412121111111111111
1123556b553
211111
1 910111110
321221
11210 4 91U11101 OlUlOll 1210 « 2 21215
3 2
3 3
2 2
4 4
11234565553
211111
9101011111111111010 101112121113
22488 91212 9 8
664212
6 7 8 7101111121210111110 7 6 6 7

-------
00
                                                7 1
                                                                        31
                                                                                                bl
                                                                                                            6]
                                                                                                                                      INPUT NO. (TABLE 2.1)
C '» N ' >
161
16?
163
1 6**
165
766
767
7b8
169
1 7n
C A HO
171
7 72
173
174
175
176
177
178
1 79
Ifln
f* ft D 11
L- f* K U
ifil
182
783
184
185
1R6
1 87
) 88
189
19n
r* A LI \ i
1^ H H 1 1
191
19?
193
194
195
196
197
1 98
1 99
Pljn
69 910
69(] J30
691931
69 J 930
690930
6 9 u 9 3 0
6^0930
690930
69o930
690930
1
690930
690930
690930
69J930
690930
690930
690930
690930
6 9 11 9 3 n
6 9 0 9 3 0
1
6 9 0 •> 3 r
690930
690930
690930
690930
69Q930
690 *30
690930
690930
690930
1
690930
69093'J
690930
690930
690930
690930
69Q930
690930
691,930
69(.'93il
4/»C'>M->
3LAX
3L*>
Sr* UK
SH,I^>
2LG3
?I-GH
4 NT 8
4^T4
bONT
17
60NT
8PMU
HPM!J
1CAP
1CAP
36RKT
368KT
3 0 F 0 X
3QFOX
29MOL
1 1
2-JHCIL
3HNP
38N"
31PIC
31PIC
•ICOMMtWC
LA INT
LA INT
H A N f^
•Hfl ~i^
t 15WS
1 3 iv 14 WO
13W1SWS
4 1 to 1 4 to D
41W15WS
MPH
16PT
2
b
MPn 3
1 bP T \ b
MPH b
21 323234bbb8l21286
7533
710 112 bll 8 rill 510111111101110 9 8 R
5 S 1 3 5 i 5 e B 3 H 9121313101
4 41313131212 b 4 4 7 7 7 7 b 4
752b22339779 9[4 9 9
fcttCH 21W14WD 16PTlbl4|?1415 564588888 81214
EACH
L s A u M r
LbALMT
AKill)
?
ARIO
ALL
ALE
OAlTiMLA
ON T NLA
8ROTT
dRCKTT
FOXFLD
FOXKLO
LYWOOD
?
LfwOOO
^WPK ru
:MXPR Iri
PICO
PICO
21W15WS
14WD
Ib'VS
b 1 W 1 4 w n
'i
61W15WS
89W14WO
h9W)5WS
75W14WD
75W15MS
94W14WD
94W15WS
MPH
16PF
MPH
IbPT
31
MPH
IbPl
MPH
IbPT
MPH
8PT
MPH
5

1
1

5
9
h
e 5 1 1 3 1 1 3 7 6 912141012 R
689 ID 9999
1111111265 8121313 7
1 7 1 Iblblb 8 912101212 121?
41 bl bl
555 5b3566 91214 1616
2 8 ft 6

-------
00
—I
C A M J
?01
20?
20 3
2(j4
20B
206
207
208
?09
?1U
CARD
211
?1?
^13
214
215
216
P 1 7
c I '
21"
?19
22"
CARD
?21
222
?23
224
225
226
2?7
228
229
230
CAPO
23]
?3?
?33
234
235
?36
?17
1
690930
f-9Q93n
6).-}V3r>
6 9 '1 9 3 o
69Q930
690930
690930
690930
690930
690930
1
690930
690930
690930
691)930
690930
690930
£. O n Q ^ rt
n 7 u ~ J U
690930
690930
690930
1
69o-*30
690930
690930
6-90930
690930
690930
690930
A 9 a 9 3 0
69Q930
690930
1
690930
h 9 0 9 3 0
690930
999 V99
1 1 21
11VFN ICE 14W15WS
16RVA RIVERA aiwi4wo
I^RVA RIVERA Bitoiv*s
,?) RFSrHtStOA) fl7W]4WD
2lwESDRESEDAlo7W15WS
15RH ROONOO 12W14WD
15RH ROONDO 12W15WS
27NFw HALL 115W14WD
27NE« HfluL 115W1"5WS
17MISHHILLS 113W14WO
11 21
17MISHHILLS 113W15WS
25MALCMALISU1J4W14WD
25xULC'vlftLiaUlo4W15WS
18LONBEACH IQl'I^WD
IHLONBEACH loMis^s
10LACANAOA 108W14WD
inl afANAOA IflAUlt^uiC
IDUHUM'lMU'H i'JO"13"'i
?6*
-------
oo
CD
                               S IJF
C ARH
241
242
241
244
24S
246
247
24fl
244
?50
CARD
251
252
253
254
255
256
?57
25B
259
260
CARD

262
263
264
265
266
267
26R
269
270
C A h'fl
271
272
273
274
275
276
277
278
279
280
1 11 21 31
TRAJECTORY SEGMENT LENGTH, hOURb
STARTING AZIMUTH AND VELOCITY (OPTIONAL
riRtcTioi-j FLAG IPOS=FRWRU, NEG=BKWRD)
WEIGHTING FLA'l (01=1/H. 02 = l/Ro
MUMritR OF CLOSE STATIONS TO USE
RRIO BOUNDARIES (ST. MI.) Q.
HOT-START EMISSION FACTORS, GM/MI
COLD-START EMISSION FACTORS, GM/MI
1969/1469 OR'JwTH FACTOKS AUTO, STAT
FRF£,IAY VEHICLE ADJUST. FACTORS
1 11 21 31
SURFACE ST. VEHICLE ADJUST .FACTORS
powcR PLANT ADJUST. FACTORS
OIL RtFIN£»Y ADJUST. FACTORS
AREA STATIONARY ADJUST. FACTORS
INITIAL TIME STEP
UPPER LIMIT FRACTIONAL CHANGE
LOWER LIMIT FRACTIONAL CHANGE
PRINT INTERVAL
UPPER LIMI1 ON DELT
LOWF.R LIMIT ON DELT
1 11 21 31
VERTICAL MESH INTERVAL (METERS)
TIME INTERVAL FOR UPDATING Kl
D'J Wt WANT A FlAtD STEP SIZE
SHALL WE OUTPUT THE TIME STEPS
SHALL WE OUTPUT THE EXECUTION TIMES
SHALL WE OUTPUT EVERY CYCLE
oo WE WANT PUNCHED OUTPUT
IS Kl VARIABLE
is INVERSION HEIGHT VARIABLE
00 WE HAVE ONLY AN INERT SPECIES
1 11 ?1 31
NUMBER OF INTEGRATION STEPS
NUMBER OF REACTIONS
NUMBER OF SPECIES
NUMBER OF SPECIES IN STEADY STATE
NUMBER OF TRACER SPECIES (0 OH 1)
HOW MflNY SPECIES HAVE A FLUX
• jJMRER OF VERTICAL STATIONS
SiJfcClES NAME AND MOLE WEIGHT


41 51
1 .0
)
+ 1
01
03
50. 8.00
7.0 10. 8
7.0 11.7
1.0 1.0
1-0 1.0
41 bl
1.0 1.0
1 .0
1.0 1.0
1.0 1.0
.01
.03
0.01
30.
0.5
0.002
41 51
115.
10.
NO
NO
YES
NO
NO
r-ES
YES
NO
41 51
25000
16
10
4
1
3
5
NO 30.01
HC 72.20
N02 46.01
61 71





41.33333
68.6
91. 0

1 .0
61 71
1 .0









6] 71










61 71










                                                                                                                                        INPUT  NO.  (TABLE 2.1)

                                                                                                                                                  13
                                                                                                                                                  14
                                                                                                                                                  15
                                                                                                                                                  16
                                                                                                                                                  17
                                                                                                                                                  21
                                                                                                                                                  22
                                                                                                                                                  23
                                                                                                                                                  24
                                                                                                                                                  25
                                                                                                                                                  26
                                                                                                                                                  27
                                                                                                                                                  28
                                                                                                                                                 -29
                                                                                                                                                  31
                                                                                                                                                  32
                                                                                                                                                  33
                                                                                                                                                  34
                                                                                                                                                  35
                                                                                                                                                  36
                                                                                                                                                  37
                                                                                                                                                  38
                                                                                                                                                  39
                                                                                                                                                  40
                                                                                                                                                  41
                                                                                                                                                  42
                                                                                                                                                  43
                                                                                                                                                  44
                                                                                                                                                  45
                                                                                                                                                  46
                                                                                                                                                   47
                                                                                                                                                   48
                                                                                                                                                   49
                                                                                                                                                   50
                                                                                                                                                   51
                                                                                                                                                   52
                                                                                                                                                   53
                                                                                                                                                   54

-------
                       IMAM-.S  of '"in T a-r Ann
                                              1 1
                                                                    31
                                                                                41
                                                                                                       61
                                                                                                                  71
                                                                                                                                INPUT NO. (TABLE 2.1)
LflHU
2H2
289
290
CARll

292
293
294
?9S
296
297
29"
244
30 n
O^ON 48.
HN02 47.00
NU3 62.
N£05 108.
OH 17.
RO? 68.1
CO 28.00
POSITION OF FIRSI SPECIES WITH FLUX 1
POSITIH.J' OF SECONU SPECIES nlirH FLUX g
POSITION OF THIRD SPECIES WITH FI ux J0
1 11 21 31 41 51 6] 71
NO
HC
N02
03
HN02
M03
N?0b
I"IM
P02
ro
PPHM
PPHM
PPHM
PPHM
PPHM
PPHM -
PPHM-
PPHM-
PPHI1-
PPHM





COMPUTED
COMPUTED
COMPUTED
COMPUTED

7.9
19.9
1.6
7
4.




lono
5.0 2.2 2.1 2.1
11.1 5.0 4.8 4.8
1O 0.85 0«84 0«84
.59E-5 9.74E-5 1.45E-4 1.50E-4 1.50E-4
4. 4. 4. 4.




800. 500. 300. 300,





BY
BY
BY
BY






CODE
CODE
CODE
CODE

                                                                                                                                        55
                                                                                                                                        56
00
                                              11
                                                         21
                                                                    31
                                                                                41
                                                                                           51
                                                                                                      61
                                                                                                                  71
CARD
301
~*0?
303
304
315
30^
307
308
309
3in
C A RO
31 1
312
3)3
J14
3) 5
31 is
31 7
31M
319
32P

RATf; CONSTANTS - REACTION
REACTION
REACTION
REACTION
REACTION
REACTION
REACTION
REACTION
REACTION
REACTION
1 11 21
REACTION
REACTION
REACTION
REACTION
REACTION
REACTION
PHOTON * >in2 = 'MO + 03
>O * O3 - M(J2 » 02
( + HC = HR02
OH + Hf = RR02

NO.
NO.
NO.
NO.
NO.
NO.
N0«
NO.
NO.
NO.
31
NO.
NO.
NO.
NO.
NO.
NO.





1
^
3
4
5
6
/
8
9
10

11
12
13
14
Ib
16





(Kl) OBTAINED F'ROM -UPHATE-
.267
1 .OOOE-6
100.
1.0E*J
2.0
15-
30.
4.00E-5
OBTAINED FROM -UPRATE-
41 51 61 71
5.0E-5
45.
14.
60.5
l.OE-b
.001




                                                                                                                                        57
                                                                                                                                        58

-------
1 1
            21
                        31
                                                                        71
CAKI1
322
3? 3
324
325
3?*
327
3?B
329
330
r A on
V, M K I.I
331
33?
333
334
335
336
337
33«
339
340
C A D n
U ** K U
341
342
343
344
345
346
347
348
349
350
C A P[)
351
35?
353
354
355
356
357
35"
359
360
PO?
RO?
OH
ON
11 3
PHOTON
MO?
N03
N?0b
M?0i
1
MO * N
M02 *
fi .
1 .
n
n
1 .
0
1 .
0
1
0
n
o.
0.
0.
n.
1 .
P.
P ,
n
1
1 .
1 .
r
n
0
f;
1 .
n
P
0.
+ NO - N02 * . 1 ?5«OH
* NO? = PAN
* »JO = HNO2
«• N02 = HNOj
* HC = r)U2
+ HONO= OH + NO
+ 03 = NU3 + 02
* NO? = N205
= NJU3 * N02
+ H20 = 2HN03
11 21
02 * H?U s 2HNO?.
^ARTICLES = PRI;DUCTS
i .
P
n
n
0
n
0
c
11 21
0
1 .
9.
P.
P .
P.
0.
0 .
P 1
n
11 21
n .
0
n
n
n
f)
0
n
0
p.
i









31 4J 51 61 71


BEGIN NO STOICHIOMtTRIC COEFFICIENTS







31 41 51 61 71







END NO
«t<5IN HYUROCARelON

31 41 51 61 71










                                                                                     INPUT NO. (TABLE 2.1)
                                                                                              58
                                                                                               59

-------
11
            ?1
                       31
                                   41
                                               bl
                                                                      71
cam)
3nl
36R
3b3
364
36S
366
367
368
160
370
CARO
371
37?
373
374
375
376
377
37H
379
3sn
CARD
3B1
38?
383
384
385
386
3fl7
3BR
389
390
CARO
391
392
393
394
395
396
397
39«
399
400
0 .
n .
fi ,
r.
1 .
0
n
p
n
1 .
1
0
1.
n
0
I .
1.
0.
n
1 .
1,
1
0.
1 .
p
0
n
0
0
r
1 .
0
1
1 .
i.
0.
p .
n .
n.
n .
r>
r
r
0.
0.
0.
0. tIMO HYDROCARBON
•1. BERJN NO?
1.
0
0
1 .
0
11 ai 3i 4i si
0
p
p
0
0
0.
1.
n
0.
0. END NOg
11 21 31 41 51
1 • BEGIN OZUNF
0
0
0
0
0
n
0
0
o
11 21 31 41 51
0.
P .
0.
0.
0 .
0. EiXO O^OMt
0« BtGIN HN02
n
0
0










61 71










61 71










61 71










INPUT NO.  (TABLE 2.1)





         59

-------
I M 4 (• E ^  • > F  i) f. T it -1 A '< '"> S
                          1 1
                                                    31
                                                                 41
                                                                              <3\
                                                                                           61
                                                                                                        71
CftkP
40)
40?
403
40 f
*ns
40*
407
408
409
410
C URD
411
412
413
41 4
415
416
417
418
419
420
C A PL)
421
422
423
424
425
426
4?7
4i?P
4?9
430
(' li tj 1^
^ fl K 1 J
4J1
432
433
434
435
436
437
43P
439
440

f
"
r
(i
1 .
P
0 ^
o %
(' .
1
n ,
0 ,
0 i
r
r
0
c
n
f!
r
1
n
n
n
1 •
n.
0.
n.
•
n .
n.
1
f.
".
n.
f.
» .
f'.
n .
0 .
".
i1 .
0
0
1 .
p
n
n
0
o .
o .
•i.
11 21
?.
0.
n .
0
0
n
0
0
0
0
11 21
0
0
1.
n
1 .
p.
n.
n.
p .
n .
11 21
3.
C.
n.
n.
n.
fi .
<).
n.
o.
1 .










31 41 51 61 71

tND HNO?
BEGIN N03







31 41 51 61 71







LND N03
HEfilN N?05

31 41 51 bl 71










                                                                                                                      INPUT NO.  (TABLE  2.1)





                                                                                                                                59

-------
                         IMAGES  OF
                                                11
                                                                        31
                                                                                    41
                                                                                                bl
                                                                                                                        71
U>
L. « K 1 1
44]
44?
443
444
445
44*
447
44ft
444
450
C/VHD
451
452
453
454
455
456
457
'+5H
459
46 U
CAPO
461
4h?
463
4t>4
465
46*
467
4*«
469
470
C API)
47]
47?
*73
474
475
476
477
47H
474
48T
1 .
] .
:• .
r t
r .
n
(
] .
ii ^
-\
]
1 .
1 .
r
n
t
0.
* .
u .
0 .
0.
1

n
P .
P.
1 .
1 .
r
r\
^ •
fi
1

!• ,
n.
r .
r
n t
6 -IP
hlO
6?.n
630
•1 •
0 .
fi .
''• tND N£05
n- HC31N OH
n
n
0
n .lib
0
U 21 31 41
n
n
0
1 .
r,
0 .
P.
0.
n.
P . END OH
11 ?1 31 4]
"• HEGIN R02
r,
H.
p.
0
n
n
p
T
J •
0
11 21 31 41
0
p.
0.
0.
0.
P. tND HO?
Ki 1 .nOOOOE-04
r.9?191t-03
3.14618t-03
5.42339E-0?










51 61 71










il 61 71









51 61 71





tND SToiCHlOMETRy




INPUT NO. (TABLE 2.1)





         59
                                                                                                                                            60

-------
MD
-P-
                                                 I L
                                                                         31
                                                                                                51
                                                                                                                        71
CflRD
48]
4A2
483
<*H4
485
4B»>
487
48d
•+89
490
f* A [_> [ 1
L a K u
<*91
4Q2
4^3
49
433ot-01
1.74362E-01
1.91591E-01
2.08016E-01
2.23639t-0l
2.3B459E-01
21 31 41
2.B2479E-01
2.65703E-01
2.7813bt-01
2.8978aE-01
3.00651E-01
3.10749E-01
3.1934UE.-01
3.?79b2E-01
3.35882E-01
3.43111E-01
21 3l 41
3.49661E-01
3.5S5*3E-01
3.60771E-01
3.65358E-01
3.69320E-01
3.72670E-01
3.75422E-01
3.77S90E-01
3.79163E-01
3.H0211t-01
21 31 41
3.80679E-01
3.80591L-01
3.79946E-01
3.73740L-01
3.7e966E-01
3.74614E-01
3.71674E-01
3.6H131E-U1
3.63971E-01
3.591«1E-01










51 61 71










SI 61 71










51 M 71










INPUT NO. (TABLE 2.1)


         60

-------
11
                                                            61
                                                                        71
LAP.U

52?
5?3
524
5^5
526
527
52"
5?4
530
CAKD
531
532
533
534
535
536
537
539
539
=.i»0
CAW U

5«?
543
5<*4
545
546
547
5*R
541
550
CAPO

55?
553
554
555
55h
557
55S

1320
1330
1 34 f.
1 35'J
14 00
1410
14?U
1 43(1
l<»40
1 4bii
1 1 1
1500
1510
1520
1530
1.540
1550
1600
1610
1620
1630
1 11
1640
1 ij'jt
1 7 J 0
LAST CARD M
niFF, UPOATt

OIFK . UPOATF

DIFt- . UP'IATE

1 1 1
r-IFF . UPDATt"

PIFF. UPuATE

PIFF. UPDATt

1 AST CAPU
?NO _AST CAWI/

3.53746E-01
3.47653E-01
3.408H7E.-01
3.33437t-01
3«2b?92E-0 1
3.17193E-01
3.17610E-01
2.97263E-01
2.66H3E-01
2.74240E-01
21 31
2.61549E-01
2.48064E-01
2.33780E-01
2 1 18694L-01
2.02803E-01
1.86108E-01
1.68608E-01
1 .50304L-01
1 .31198E-01
1.11293E-01
21 31
9.05928E-02
6.91033E-02
4.6a302E-02
-10.
0. 0.
30. 30.
150. 57.5
30. 30.
225. 17?. 5
30. 30.
21 31
JOO. 287.5
600. 30.
375. 40?. 5
000. 6CO.
39Q. 46(1.
600 • 600 «
-10.












41 51 61 71










41 51 6] 71




30. 30. 30.
30.
30. 600. 30.
30.
60 . 600 . 600 .
30,
41 51 6) 71
6l)n . 600. 600 .
30.
600. 600. 600.
30.
600. 600. 600.
600 •


                                                                                     INPUT NO.  (TABLE  2.1)





                                                                                               60
                                                                                              61

-------
96

-------
                               APPENDIX D
                         COMMON BLOCK LOCATIONS

      DIFKIN makes extensive use of labeled COMMON blocks to accomplish
data transfer between the main program and its subprograms,  between
modules,  and between the subprograms within each module.  Tables D.I,
D.2, D.3, and D.4 list the subprograms containing each COMMON block
used for  inter-module data transfer (Table D.I) and within each module,
trajectory generation (Table D.2), flux generation (Table D.3), and
chemistry (Table D.4).
                               TABLE D.I
         COMMON BLOCK LOCATIONS FOR INTERMODULE DATA TRANSFER
      COMMON Block Name
           CNTROL

           FLUXES
           GRID

           TRAJ

           WIND
      Subroutine Locations
DIFKIN, EFFLUX, FLXDAT, SETUP,
        WINDY
DIFKIN, FLXDAT
BLOCK DATA, EDGE, EFFLUX, FLXDAT,
        PLACIT, SETUP
EFFLUX, FLXDAT, PLACIT, SETUP,
        WINDY
EFFLUX, FLXDAT, PLACIT, SETUP,
        WINDY
                                                                       97

-------
                               TABLE D.2




         COMMON BLOCK LOCATIONS IN THE AIR TRAJECTORY MODULE




     COMMON Block Name                  Subroutine Locations
          DATES




          WDATA
GETAZV, WINDRD, WINDY




ANGTST, AZVDIS, GETAZV, SETIN,



    WINDY, WSECLS
                              TABLE D.3




        COMMON BLOCK LOCATIONS IN THE FLUX GENERATION MODULE
     COMMON Block Name




          ADJUST




          COLDST




          CROSS




          DATFL1




          DATFL2




          DATFL3




          DATFL4




          EMIT




          SKDULE




          SPDFCT




          TABLES
      Subroutine Locations




FLXDAT, SETUP




BLOCK DATA, EFFLUX, FLXDAT, SETUP




EFFLUX, FLXDAT




BLOCK DATA, FLXDAT




BLOCK DATA, FLXDAT




BLOCK DATA, FLXDAT




BLOCK DATA, FLXDAT




FLXDAT, SETUP




EFFLUX, FLXDAT




BLOCK DATA, FLXDAT, SETUP




BLOCK DATA, EFFLUX, FLXDAT
98

-------
                          TABLE D.4




       COMMON BLOCK LOCATIONS IN THE CHEMICAL MODULE




COMMON Block Name                   Subroutine Locations




     CHEM                           DIFKIN, SOURCE, STATE




     SKY                            DFFUSE, DIFKIN




     TRACER                         CRANK, DIFKIN, UPFLUX
                                                                  99

-------
100

-------
                              APPENDIX E
                   LIST OF SUBROUTINES AND THEIR USE

PART I:   THE AIR TRAJECTORY MODULE

E.I   SUBROUTINE ANGTST(XS,YS,NGOOD,KUSE,OK)
      Use.   Compares  the azimuth from (XS,YS) to the new station,
against  the corresponding  azimuths for any previously qualified stations.
If any two  azimuths are less than 2 degrees apart, ANGTST returns a
positive flag;  otherwise it returns a negative flag.  ANGTST is called
by GETAZV.

      Arguments.      XS = x-coordinate of current position
                      YS = y-coordinate of current position
                   NGOOD = number of measurement stations qualified thus far
                    KUSE = index of new candidate measurement station
                      OK = output flag.  If positive, angle test is OK
                           (no other station within 2 degrees); if negative
                           test not OK.

E.2   SUBROUTINE AZVDIS(NP,AZV,DDD,AZM,VEL,IRF)
      Use.   Given raw azimuth, velocity, and distance data from up to
3 measurement stations, AZVDIS combines them according to the prescribed
interpolation rule to produce a single azimuth a-nd velocity.  AZVDIS
is called by WINDY.

      Arguments.   NP = number of measurements to combine (up to 3)
                  AZV = array containing raw azimuths and velocities
                  ODD = array with distances from current position to
                        closest stations
                  AZM = calculated distance
                  VEL = calculated velocity
                  IRF = interpolation flag; if 1, inverse distance weighting
                                                                     101

-------
                        is used;  if 2 inverse distance squared weighting
                        is used.

E.3   SUBROUTINE BARIER(X,Y,XS,YS,OK)
      Use.  Checks whether or not two given points are on the same side
of each of a set of (up to 20) finite-length, straight-line barriers.
The barrier line segments are stored internally,  being defined by the
coordinates of their end points.   BARIER is called by GETAZV and WINDY.

      Arguments.   X = x-coordinate of point of interest
                   Y = y-coordinate of point of interest
                  XS = x-coordinate of reference  point
                  YS = y-coordinate of reference  point
                  OK = output flag; if positive,  both points are on the
                       same side  of all barriers, otherwise the points
                       are on opposite sides of at least one barrier.

E.4   SUBROUTINE DATE (IOLD,MOVE,IWAY,NEW)
      Use.  Calculates a new time and date  from an old time and date
and a prescribed time increment.   Time is on a 0-2400 basis and dates
are represented as year, month,  day (e.g. 730901  for Sept.  1, 1973).
DATE is called by WINDY.

      Arguments.  IOLD = 2-word array with  time and date to be changed
                  MOVE = time increment in  minutes
                  IWAY = if positive, time  advances, otherwise time is
                         decremented.
                  NEW  = 2-word output array with new time and date

E.5   FUNCTION DOTTY(A,B)
      Use.  DOTTY computes the dot product  of the vectors A and B.
DOTTY is called by ANGTST.
102

-------
      Arguments.   A = a 3-component vector
                  B = a 3-component vector

E.6   SUBROUTINE EDGE(X,Y,ITF,IEDGE)
      Use.   EDGE checks whether or not the point X,Y is inside or out-
side the boundaries of the grid (as defined in COMMON/GRID/).   EDGE
is called by WINDY.

      Arguments.       X = x-coordinate of point of interest
                      Y = y-coordinate of point of interest
                   ITF  = direction flag; if positive the trajectory is
                          proceeding forward, if negative the  trajectory
                          is proceeding backward.
                  IEDGE = output flag; if zero, the point is inside the
                          grid; if non-zero, the point is outside the
                          grid with the sign of IEDGE indicating the
                          direction of motion (see ITF).

E.7   SUBROUTINE EXTRP(IHOUR,ARY,VAL)
      Use.   This routine seeks a value corresponding to IHOUR  in the 24 word
data array ARY assuming that the values in ARY correspond to clock times
of 0000, 0100, 0200, etc.  If positive or zero, the value found is simply
returned.  If the desired value is missing (indicated by a negative entry),
EXTRP will use linear interpolation to fill the gap, provided  the two
adjacent values  are non-negative.   Failing that, EXTRP will attempt to fill
the gap by extrapolation, provided that the gap is no more than two loca-
tions wide and two consecutive non-negative values exist on one side of
the gap.  A negative value returned indicates that the data gap could not
be filled by either method.  EXTRP is called by GETAZV.

      Arguments.   IHOUR = clock time on a 0-2400 basis
                  ARY   = array of 24 data values one hour apart
                  VAL   = data value selected or calculated to correspond
                          to IHOUR
                                                                     103

-------
E.8   SUBROUTINE FMINF(F,NF,FMIN,NMIN)
      Use.  Finds the minimum value in a linear array and returns both
the minimum value and its array index relative to the first value in
the array.  FMINF is called by WSECLS.

      Arguments.     F = the first location of a sequence of numbers to
                         be checked
                    NF = the number of consecutive locations to be
                         considered (starting with F)
                  FMIN = the minimum value among the NF consecutive
                         members of the F array
                  NMIN = the index of FMIN relative to F, counting F as
                         1.  (If more than one member is equal to FMIN,
                         NMIN will be the lowest index of the set of F
                         members equal to FMIN.)

E.9   SUBROUTINE GETAZV(KOLD,ID,XS,YS,NC,AZV,NGOOD,DDIS)
      Use.  This routine attempts to retrieve measurement records from
the desired number of neighboring wind measurement stations having valid
data  for  the given date and time.  GETAZV is called by WINDY.

      Arguments.   KOLD = 2-word array containing time (on a 0-2400
                          basis) and date (year, month, day)
                     ID = 2-word array containing the station identifi-
                          cation (may be blank)
                     XS = x-coordinate of current position
                     YS = y-coordinate of current position
                     NC = desired number of close stations (up to 3)
                    AZV = array containing an azimuth and velocity for
                          each close station found
                  NGOOD = number of close stations found
                   DDIS = array containing distances from current position
                          to close stations
 104

-------
E.10  SUBROUTINE NEWPAG(TITLE, LSKIP,IDATE)
      NEWPAG is called by WINDY and WINDED.  See E.48 for a description
of its arguments and use.

E.ll  SUBROUTINE SECOND(A)
      SECOND is called by NEWPAG.  See E.53 for a description of its
argument and use.

E.12  SUBROUTINE SETIN
      Use.  This routine initializes the names and coordinates of all
measurement stations.  SETIN also sets the total number of measurement
stations and the minimum and maximum radii associated with the wind
vector interpolation scheme.  SETIN is called by WINDY.

      Arguments.  None

E.13  FUNCTION UNIDOT(A,B)
      Use.  Returns the dot product of a unit vector parallel to A with
a unit vector parallel to B, i.e., the cosine of the acute angle separating
the vectors A and B.  UNIDOT is called by BARIER.

      Arguments.  A = a 3-component vector
                  B = a 3-component vector

E.14  SUBROUTINE UNITY(A,B)
      Use.  Returns B, the unit vector parallel to vector A.  UNITV is
called by ANGTST.

      Arguments.  A = a 3-component vector
                  B = a 3-component unit vector parallel to A
                                                                     105

-------
E.15  SUBROUTINE WINDED  (KPWDAT, TITLE, JDATE)
      Use.  This routine reads the wind measurement data  and  stores  it
on up to  10 scratch  files, one for each new date.  As  it  reads  the data,
WINDRD  replaces blank entries with negative values (-1.)  to signify
missing data.  Optional printing of the data  (unsorted) is also provided.
WINDRD  is  called by  WINDY.

      Arguments.  KPWDAT = a Hollerith flag;  if YES, the  wind data will
                           be printed once at the beginning of  the run,
                           if NO, printing will be omitted.
                   TITLE = a vector of up to  80 Hollerith characters
                           containing a page  label for the top  of  each
                           page of output (see SUBROUTINE NEWPAG,  E.48)
                   JDATE = a 2-word vector containing the date  of  the
                           run (see SUBROUTINE NEWPAG, E.48)

E.16  SUBROUTINE WINDY(TITLE,JDATE)
      Use.  WINDY is the main program of the air trajectory generation
module  of  DIFKIN.  It calculates fprward or reverse air trajectories
from a  prescribed starting point and time, and produces a table of
wind vectors which will reproduce the calculated trajectory in  a forward
chronology.  WINDY is called by DIFKIN.

      Arguments.  TITLE = a vector of up to 80 Hollerith  characters
                          containing a page label for the top of each
                          page of output (see SUBROUTINE  NEWPAG, E.48)
                  JDATE = a 2-word vector containing the  date of the
                          run (see SUBROUTINE NEWPAG, E.48)
106

-------
E.17  SUBROUTINE WSECLS(X,Y,DIS,IDIS)
      Use. This routine calculates squared distances from the point
X,Y to each measurement station in SSTAN, and then orders the stations
by increasing distance out to a maximum value (UMAX).  WSECLS is called
by GETAZV.

      Arguments.    X = x-coordinate of current position
                    Y = y-coordinate of current position
                  DIS = array of squared distances from X,Y to all
                        measurement stations.  Those values of DIS
                        less than RMAX are arranged in increasing order
                        at the top of the table.
                 IDIS = array of station indices corresponding to entries
                        in the DIS array.  (The indices identify the
                        stations in the SSTAN array).
                                                                       107

-------
PART II:  THE FLUX GENERATION MODULE

E.18  FUNCTION CLOCK!(TSTART,DT)
      Use.  Adds an elapsed time in minutes to an initial clock time,
returning the final clock time on a 0 to 2400 basis.  CLOCKT is called
by FLXDAT.

      Arguments.  TSTART = initial time on a 0 to 2400 hour clock
                      DT = elapsed time in minutes

E.19  FUNCTION DECMAL(A)
      Use.  Converts an input angle from degrees, minutes, and seconds
to decimal degrees.  DECMAL is called by SETUP-

      Argument.   A = array containing the degrees, minutes, and seconds
                      in an angle

E.20  SUBROUTINE EFFLUX(TITLE,JDATE)
      Use.  EFFLUX is the main program of the flux generation module
of DIFKIN.  It traces an air trajectory across a source grid and produces
a schedule of flux change times with the associated pollutant fluxes
into the moving air parcel.  EFFLUX is called by DIFKIN.

      Arguments.  TITLE = a vector of up to 80 Hollerith characters
                          containing a page label for the top of each
                          page of output (see SUBROUTINE NEWPAG, E.48)
                  JDATE = a 2-word vector containing the date of the
                          run.  (see SUBROUTINE NEWPAG, E.53)

E.21  SUBROUTINE FLXDAT(TITLE,JDATE)
      Use.  Given a schedule of flux change times and associated grid
square  indices, FLXDAT calculates the corresponding fluxes of NO , HC
                                                                X.
and CO  from vehicular and stationary sources.  FLXDAT is called by
EFFLUX.
108

-------
      Arguments.   TITLE = a vector of up to 80 Hollerith characters
                          containing a page label for the top of each
                          page of output (see SUBROUTINE NEWPAG, E.48)
                  JDATE = a 2-word vector containing the date of the run.
                          (see SUBROUTINE NEWPAG, E.53)

E.22  SUBROUTINE FMINF(F,NF,FMIN,NMIN)
      FMINF is called by EFFLUX.  See E.8 for a description of its
arguments and use.

E.23  SUBROUTINE GRIDS(XL,XR,YB,YT,DX,DY)
      Use.  This routine sets up the boundaries and grid lines for a
printer-plot of an air trajectory.  GRIDS is called by SETUP.

      Arguments.•  XL = x-coordinate of left boundary of  printer-plot
                  XR = x-coordinate of right boundary of printer-plot
                  YB = y-coordinate of bottom boundary of printer-plot
                  YT = y-coordinate of top boundary of printer-plot
                  DX = vertical grid line spacing
                  DY = horizontal grid line spacing

E.24  SUBROUTINE MCHAR(IFC,FROM,ITC,TO,NCHR)
      Use.  MCHAR is a machine language routine which moves a string of
individual characters from one storage location to another.  MCHAR is
called by SETPLT.

      Arguments.  IFC  = position of character to move from.  The left-
                         most character is position 1.
                  FROM = source array
                  ITC  = position of character to move to
                   TO  = destination array
                  NCHR = number of characters to move
                                                                      109

-------
 E.25   SUBROUTINE MINSEC(DECANG,ANG)
       Use.   Converts an angle from decimal degrees  to  degrees, minutes,
 and seconds.  MINSEC is called by SETUP-

       Arguments.  DECANG =  the input angle in decimal  degrees
                     ANG =  a 3-word array containing the  angle in degrees,
                            minutes, and  seconds

 E.26   REAL  FUNCTION MIXER(X)
       Use.   Returns the floating point variable X with an integer name.
 MIXER is  called by  FLXDAT.

       Argument.   X =  a variable with a  floating point name

 E.27   SUBROUTINE NEWPAG(TITLE,LSKIP,IDATE)
       NEWPAG is called by EFFLUX and FLXDAT.  See E.48 for a description
 of  its arguments and use.

 E.28  SUBROUTINE PLACIT(DT,L,VX,VY,POS,NDX)
       Use.   PLACIT  computes the coordinates  and grid square  indices
 of  a  new  trajectory point.   PLACIT  is called by EFFLUX.

       Arguments.  DT = time duration of  this trajectory setment,  minutes
                    L = index of last trajectory point  in trajectory
                        data arrays
                  VX = x-component  of V(L)  (input)
                  VY = y-component  of V(L)  (input)
                 POS = 2-word array containing x and y coordinates of
                        new  position
                 NDX = 2-word array containing grid square indices
                        (I,J) of new point
E.29  SUBROUTINE SECOND(A)
      SECOND is  called  by  NEWPAG.   See  E.53  for a description of  its
arguments  and use.
 110

-------
E.30  SUBROUTINE SETPLT(A,B,C,D)
      Use.  SETPLT is the initialization entry for a general purpose
printer plot routine.  SETPLT is called by GRID.

      Arguments.  A = minimum value on horizontal  (x) axis
                  B = maximum value on x-axis
                  G = minimum value on vertical  (y) axis
                  D = maximum value on y-axis

      ENTRY PLTPNT(A,B,C)
      Use.  PLTPNT enters a new data point on the  stored plot.  PLTPNT
is  called by EFFLUX and SETUP.

      Arguments.  A = x-coordinate of new data point
                  B = y-coordinate of new data point
                  C = 1H  CHARACTER where CHARACTER is the symbol to be
                      plotted at x, y  (there should be no blanks between
                      1H  and CHARACTER)

      ENTRY PLTOUT(IFILE)
      Use.  PLTOUT is the final call in a plotting sequence.  It enters
the completed plot in the output file.  PLTOUT is  called by EFFLUX.

      Argument.  IFILE =  the number designation  of the print file.

E.31 SUBROUTINE SETUP
      Use.  SETUP serves  as the initialization routine for the  flux
generation modules of DIFKIN.  It converts the wind speeds to miles per
minute, initializes the grid, printer plot, and  trajectory calculations,
and reads in the inputs for this module.  SETUP  is called by EFFLUX.

      Arguments.  None
                                                                      111

-------
E.32  FUNCTION SPEEDF(T,TS,FS,NTF,NF,FBASE)
      Use.  SPEEDF uses linear interpolation in the average speed tables
to obtain an average traffic speed at time T.   SPEEDF is called by FLXDAT.

      Arguments.       T = current time,  minutes past midnight local time
                     TS = array of times corresponding to traffic
                          speed entries
                     FS = array of average speeds dimensioned (NF,NTF)
                    NTF = number of average  speed entries
                     NF = number of locations  between average speed
                          entries
                  FBASE = base value of  FS to  be assumed for TS values
                          for which FS tables  are not supplied

E.33  FUNCTION TABF(X,XS,FS,NXF,NF)
      Use.  TABF is a general stairstep  evaluator for tabular functions.
It returns the nearest end value of FS when  X  is outside the range of
XS.  TABF is called by FLXDAT.

      Arguments.     X = current value of independent variable
                   XS = table of abscissa values (dimensional NXF).
                        XS must be monotonic and increasing.
                   FS = table of function values corresponding to abscissa
                        values (dimensional  NF, NXF)
                  NXF = number of abscissa and function value pairs to
                        be used
                   NF = number of words  between values of FS in core

E.34  FUNCTION TIMIN(T)
      Use.  Converts time from 0-2400 basis  to minutes past midnight.
TIMIN is called by EFFLUX, FLXDAT, and SETUP.

      Argument.  T = clock time on a 0-2400  basis.
112

-------
E.35  FUNCTION TRPF(X,XS,FS,NXF,NF)
      Use.  TRPF is a general linear interpolator for tabular functions.
It returns  the nearest end value of FS when X is outside the range of
XS.  TRPF is called by FLXDAT.

      Arguments.    X = current value of independent variable
                  XS = table of abscissa values (dimensional NXF).
                       XS must be monotonic, either increasing or decreasing.
                  FS = table of function values corresponding to abscissa
                       values (dimensioned NF, NXF)
                 NXF = number of abscissa and function value pairs to
                       be used
                  NF = number of words between values of FS in core

E.36  SUBROUTINE XMIT(N,A,B)
      Use.   XMIT transmits N words from A to B.  If N is negative, it
transmits the value A into N consecutive words starting at B.  XMIT
is called by EFFLUX.

      Arguments.   N = number of words to be set
                  A = value or array of values to be transmitted
                  B = array receiving new values
                                                                      113

-------
 PART III:   THE CHEMICAL MODULE

E.37  SUBROUTINE COEQ(N,A,X,FL)
      Use.  Solves a set of simultaneous linear  equations  whose matrix
 is  tridiagonal.  In DIFKIN it  is used  to solve the  equations which yield
 the  concentration of the tracer species.   It  is  called  by  subroutine CRANK.

      Arguments.   N = number  of rows  in the  matrix
                   A = matrix  elements stored in a  linear  vector of
                       4N - 2  elements
                   X = solution vector
                  FL = failure index:  FL  = 1 if matrix is singular, and
                       FL = 0  otherwise

      Remarks.  The nonzero elements of the vector  A   look like
Row 1
    2
    3
A(4)
A(2)
A(5)
A(8)
A(6)
A(9)
        A(3)
        A(7)
    N-2
    N-l
Row N
                     A(10)
                     A(4N-12)
                        A(4N-11)
                        A(4N-8)
                           A(4N-10)
                           A(4N-7)
                           A(4N-4)
        A(4N-9)
A(4N-6) A(4N-5)
A(4N-3) A(4N-2)
 E.38  SUBROUTINE CRANK(N,BELT)
      Use.  Solves the linear diffusion equation   9c/9t  =  3/9z[D(z)3c/3z]  ,
which has a diffusion coefficient which is a function  of  z  .   Uses  the
Crank-Nicolson method of differencing.  Used with  inert  species only.

      Arguments.     N = number of mesh points
                  BELT = integration step size
114

-------
      Remarks.   Calls subroutine COEQ for solving the resulting system
of equations.  The concentrations and other variables are passed through
COMMON/TRACER/.

E.39  SUBROUTINE DFFUSE(NOSTAT, DELZ)
      Use.  Sets initial values of diffusion coefficients when diffusivi-
ties are not time-varying.  The diffusivities are stored in the vector
DFINIT, which is transferred to the subroutine through COMMON/SKY/.

      Arguments.  NOSTAT = number of mesh points
                    DELZ = mesh interval

E.40  SUBROUTINE DIFCOF(SCALDF, NOSTAT, DCOF, SCALE, DSCALE)
      Use.  Generates scaling vectors DCOF, SCALE, DSCALE,  for use in
the integration of the rate equations of the reactive species.

      Arguments.  SCALDF = input vector of scaled diffusivities, defined
                                                                   9
                           in main program by SCALDF(I) = D(I)/DELZ ,
                           where D(I) = ith diffusivity and DELZ = mesh
                           interval.
                  NOSTAT = number of mesh points
                    DCOF = a vector used for scaling the matrix equation
                           which is the result of the finite-difference
                           method.  DCOF(I) = SCALDF(I) + SCALDF(1+1)
                   SCALE = vector of scale factors
                           SCALE(I) = SCALDF(I+1)/SCALDF(I)
                  DSCALE = vector of scale factors
                           DSCALE(I) = 1/SCALDF(I)
                                                                     115

-------
E.41  SUBROUTINE JACOB(A,B,R,N,W,NN,C)
      Use.  Computes the Jacobian matrix of the chemical rate  equations
having the form  dy±/dt = f^y^y^  .  .  .  , yn>  , where  y±   is  the con-
centration of the ith species,  i=l,2, ...  ,N.  Each element  of  the
Jacobian is defined by  A.. = 8f./3y.  , i,j = 1,2,  .  .  . , N.
                          J         J

      Arguments.   A = Jacobian matrix of size  N x N
                   B = vector of species concentrations
                   R = vector of chemical rate constants
                   N = order of the Jacobian matrix, equal to  the number
                       of rate equations to be integrated
                   W = vector of molecular weights of all the  chemical
                       species
                  NN = total number of species in the system,  including
                       species in steady-state but not the tracer species
                   C = work vector

E.42  SUBROUTINE MATADD(A,B,C,NRA,NCA)
      ENTRY      MATSUB(A,B,C,NRA,NCA)
      Use.  MATADD computes the sum of two matrices  C = A + B
            MATSUB computes the difference of two matrices  C  = A - B

      Arguments.  A, B = input matrices
                     C = resultant matrix
                   NRA = number of rows of A, B, C
                   NCA = number of columns of A, B, C

E.43  SUBROUTINE MATINV(A,N,NMAX,B,M,PIVOT,IPIVOT,INDEX,DETERM)
      Use.  Computes the inverse of the matrix  A  or the solution  of  the
matrix equation  Ax = B .  Called by MATNVT.
116

-------
      Arguments.        A = matrix to be inverted of order  N x  N
                       N = order of matrix A
                    NMAX = dimension of  A  as declared in calling program,
                           NMAX >_ N
                       B = right-hand side of matrix equation  Ax = B ,
                           dimensioned  B(NMAX,M)
                       M = number of columns of B;  if  M <_ 0  only the
                           matrix inverse is found, without solving
                           matrix equations
                   PIVOT = work vector of size N
                  IPIVOT = work vector of size N
                   INDEX = work array dimensioned INDEX(N,2)
                  DETERM = determinant of A

E.44  SUBROUTINE MATMUL(A,B,C,NRA,NCARB,NCB)
      Use.   Computes the matrix product  C = A x B.

      Arguments.       A = matrix of order  NRA x NCARB
                      B = matrix of order NCARB x NCB
                      C = A x B
                    NRA = number of rows of A
                  NCARB = number of columns of A and rows of B
                    NCB = number of columns of B

E.45  SUBROUTINE MATNVT(A,N,D)
      Use.   Computes the inverse of matrix A by calling MATINV.

      Arguments.   A = matrix of order  N x N; destroyed in the  inversion
                      process as its inverse is substituted for it
                                                                     117

-------
                  N = order of matrix A, limited to 24
                  D = determinant of A

E.46  SUBROUTINE MATSCL(X,A,NR,NC)
      Use.  Scales the matrix A by factor X.

      Arguments.   X = scaling factor
                   A = matrix to be scaled
                  NR = number of rows of A
                  NC = number of columns of A

E.47  SUBROUTINE MDATE(IDATE)
      Use.  This is a dummy subroutine which calls other system routines
to  obtain the date of the run.  The date is printed on every page of the
output.  User must modify MDATE in order to make it compatible with his
installation.

      Argument.  IDATE = vector which contains the date of the run

E.48  SUBROUTINE NEWPAG(TITLE,LSKIP,IDATE)
      Use.  This is a utility subroutine used for labeling each page of
the output.  The subroutine labels each page with the run label provided
by  the user, the date of the run, the internal machine time, and the page
number.

      Arguments.  TITLE = vector of Hollerith characters which contains
                          the run label which user prescribed in the first
                          card of the input deck (see Table 2.1, card 1)
                  LSKIP = number of lines skipped before printing heading;
                          if LSKIP = 0 the page heading is printed at the
                          top of the page
                  IDATE = vector which contains the date of the run
118

-------
E.49  SUBROUTINE NUBETA(BETA,NR)
      Use.  Used to modify the net stoichiometric matrix when required
by stationarity assumptions.

      Arguments .  BETA = net stoichiometric matrix;
             BETA(i.j) = v^ - v^, i = 1,2,  .  .  . , r, j = 1,2,  .  .  . , s,
                         where r = number of reactions and s = number of
                         species (see Sec. 2.3.5 for definition of
                         v !  . and v . . )
                          iJ      ij
                    NR = number of rows of BETA as declared in DIMENSION
                         statement

E.50  SUBROUTINE NURATE(RATEFF,RATKON,CONUP)
      Use.  This routine computes any pseudo-rate constants which result
from stationarity assumptions.

      Arguments.  RATEFF = vector of effective rate constants which con-
                           tains all the pseudo-rate constants
                  RATKON = vector of basic rate constants which are used
                           to compute the pseudo-rate constants
                   CONUP = vector of species concentrations

E.51  SUBROUTINE PREDAT
      Use.  Reads input data from card reader and produces a listing of
the image of the input deck.  See Sec. 2.1 for a full explanation.

E.52  SUBROUTINE QGEN(A,B,C,N)
      Use.  This subroutine generates the  Q  matrix which enters into
the matrix equation Q(C - C ) = -2G .  The Q matrix is stored in  the
                           o       o
same location as the matrix A and is defined by
            Q. .  = - C x A. ., Q. . = B - A..
             1J           iJ   JJ        JJ
                                                                     119

-------
       Arguments.   A = matrix  of  order  N x  N,  modified by the subroutine
                   B = constant factor  added  to  the  diagonal elements of A
                   C = constant factor  which  scales  all the elements of A
                   N = order of matrix  A

 E.53   SUBROUTINE  SECOND (A)
       Use.   This  is a dummy subroutine which calls  other system routines
 to obtain the internal machine time.   It is  used  by the main program for
 timing the  computation.   It is also  called by NEWPAG.

       Arguments .   A = internal machine time  in  any  desired units

 E.54   SUBROUTINE  SOURCE(CONUP)
       Use.   Computes the  rate function of  the chemical rate equations.

       Arguments.   CONUP = work vector

       Remarks .  Consider  a set of  chemical equations  defined by:
                       Vs

 where        M.  =  chemical  formula of  the jth  species
               J                           —
              k.  =  rate  constant of ith reaction
             v   =  stoichiometric coefficient of jth reactant  in  the  ±th
                   reaction
             v'   =  stoichiometric coefficient of the j_th product  in the
                   ith reaction
               r  =  number of reactions
               s  =  number of species
 The  rate  equations for  such a system are defined by:

             dc^        J^                S    \m

                        i=l               m=l
120

-------
where       c. = concentration of the jth species
            R. = rate function of the jth species
Subroutine SOURCE computes R. as shown above.  The quantities needed by
SOURCE are provided through COMMON/CHEM/.

E.55  SUBROUTINE STATE(CONEW,CONUP,NROW)
      Use.  Computes algebraically the concentrations of those species
assumed to be in steady state.

      Arguments.  CONEW = array of updated species concentrations; CONEW(i,j)
                          is the concentration of the ith species at the jth
                          mesh point
                  CONUP = work vector
                   NROW = number of rows of CONEW as declared in a
                          DIMENSION statement

      Remarks.  Other quantities needed by STATE are provided through
COMMON/CHEM/.  This subroutine must be modified when the chemical model
is changed or the order of the species and reactions is altered.

E.56  SUBROUTINE TIMEX(KSTEP,TITLE,IDATE)
      Use.  This subroutine is used for timing various phases of the
computational process.  It also counts the number of integration steps
during a print interval.

      Arguments.  KSTEP = total number of integration steps taken to date
                  TITLE = Hollerith vector which contains the label of
                          output page
                  IDATE = vector which contains the date of the run

      Remarks.  This subroutine contains an entry called ENDRUN which is
called at the end of the computation to compute and print the net time
                                                                      121

-------
taken by the computation.  Subroutine TIMEX calls subroutines SECOND and
NEWPAG.

E.57  SUBROUTINE TRIVRT(A,D,SCALE,WORK,NRA,NCA,NMAT,NNR,U)
      Use.  Inverts a tridiagonal matrix, A, whose elements also are
matrices.  The lower-diagonal entries are identity matrices.  The upper-
diagonal elements are scaled identity matrices.

      Arguments.      A = doubly-dimensioned array of size NRA x NCA
                      D = array of size NRA x NMAT; right-hand side of matrix
                          equation
                  SCALE = vector of scale factors of the upper-diagonal
                          elements of A
                   WORK = work array of size NRA x NRA
                    NRA = number of rows of A as declared in a DIMENSION
                          statement in the calling program
                    NCA = number of columns of A, NCA = NRA x NMAT
                   NMAT = number of columns of D
                    NNR = actual order of the diagonal elements of A
                      U = solution array of size NRA x NMAT

      Remarks.  Given a matrix equation of the form
                     AU = D
where A is block tridiagonal, this subroutine computes the solution U.
The form of A is
                  all   °
                   I    a
                               o
                         22
                            0
                            0
0
0
                                             Vi1
122

-------
where N = NMAT,  and  the  a^'s correspond to the scale factors stored in
SCALE.  It can be  seen that there is no need to store A in full since only
the diagonal elements, a.., are important.  The zeros can be excluded, of
course, and the  identity matrices are known and need not be stored.  Thus
the matrix A that  is input into TRIVRT contains only the diagonal elements,
a  , of the full matrix.  Each a., is of order NNR, and the first entry
of each a±± is  stored in A    where j = (i-l)NRA + 1, i = 1, .  .  .  ,  NMAT.
Thus the actual  A  looks  like
            A =
                        NMAT x NRA
Similarly, U and D are stored in the form

            u = [uru2, .  •  • ,  UN]JNRA
                        NMAT
                                    NRA
                     NMAT
and each U. and D.  is a vector of NRA components.

E.58  SUBROUTINE UPFLUX(TIME,NTRACE)
      Use.  This subroutine is called by the main program at time TIME
to update the fluxes.

      Arguments.    TIME = time at which fluxes are updated
                  NTRACE = flag which tells the subroutine whether or not
                           a tracer species is present (see Table 2.1,
                           input 51)
                                                                     123

-------
                                                       Q
      Remarks.   The fluxes are scaled by a factor of 10  for the purpose
of improving computational accuracy in the integration process.  Any
required additional scaling of the fluxes must be done by this subroutine.
The subroutine prints a message on logical unit 10 which lets the user
know the update time and the value of the new fluxes.

E.59  SUBROUTINE UPRATE(TIME,RATNEW,RATOLD,RATEFF)
      Use.  This subroutine is used to update the magnitude of rate
constants which are functions of time.

      Arguments.    TIME = update time
                  RATNEW = factor used for updating the rate constant
                  RATOLD = vector of old rate constants to be updated
                  RATEFF = work vector of old rate constants

      Remarks.   In our photochemical smog model there are two reactions
which are directly triggered by sunlight.  They are:

                    kl
            hv  + NO 2-> NO + 0

                     k2
            hv + HN02-> OH + NO

As sunlight intensity changes with time of day both k  and k~ must be
updated.  In our model k2 is a function of k  and thus the variable RATNEW
is actually the new value of k. .  Then \a  is computed from k  and stored
in the appropriate location in both RATOLD and RATEFF.  The new value of
k  is also stored in these two vectors.

E.60  SUBROUTINE WXMIT(NWDS,NCLS,SF,FROM,TO)
      Use.  This subroutine is used to transfer scaled values of array
FROM to vector TO.
124

-------
      Arguments.   NWDS = number of words to be transferred;  if NWDS < 0,
                         then the quantity SF x FROM(1,1)  is transferred
                         to NWDS locations in TO.
                  NCLS = number of rows of FROM
                    SF = scale factor
                  FROM = two-dimensional array
                    TO = vector that receives scaled elements of FROM

E.61  SUBROUTINE XMIT(N,A,B)
      Use.  Transmits N words from A to B.

      Arguments.   N = number of words to be transmitted;  if  N < 0,
                      subroutine transmits A to N locations  in B
                  A = value of vector to be transmitted
                  B = vector receiving new values
                                                                     125

-------
126

-------
                              APPENDIX F

                           PROGRAM LISTINGS
F.I  PROGRAM DIFKIN
                              129
F.4  CHEMICAL MODULE
F.2 AIR TRAJECTORY MODULE
ANGTST
AZVDIS
BARIER
DATE
DOTTY
EDGE
EXTRP
FMINF
GETAZV
SETIN
UNIDOT
UNITY
WINDRD
WINDY
WSECLS
F.3 FLUX GENERATION MODULE
CLOCKT

DECMAL
EFFLUX
FLXDAT
GRIDS
MCHAR
MINSEC
MIXER
PLACIT
SETPLT
SETUP
SPEEDF
TABF
TIMIN
TRPF
XMIT

145
146
148
150
152
152
153
155
156
159
162
162
163
165
171

173

173
174
178
180
181
183
183
183
184
188
190
191
191
192
192
COEQ
CRANK
DFFUSE
DIFCOF
JACOB
MATADD
MATINV
MATMUL
MATNVT
MATSCL
MDATE
NEWPAG
NUBETA
NURATE
PREDAT
QGEN
SECOND
SOURCE
STATE
TIMEX
TRIVRT
UP FLUX
UPRATE
WXMIT
F.5 BLOCK DATA









                                                                    193
                                                                    195
                                                                    196
                                                                    196
                                                                    197
                                                                    198
                                                                    199
                                                                    201
                                                                    202
                                                                    202
                                                                    202
                                                                    203
                                                                    203
                                                                    203
                                                                    204
                                                                    205
                                                                    205
                                                                    205
                                                                    206
                                                                    207
                                                                    208
                                                                    209
                                                                    209
                                                                    209

                                                                    211
                                                                     127

-------
128

-------
F.I  PROGRAM DIFKIN

-------

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
c
c
c
c
c
c
c
c
c
c
c
c
c
c
c
c
c








PROGRAM DIFKIN




J.R.MART INF /

	 NEW VERSION OF ORIGINAL PROGRAM. THE SCALING OE






1)1
DI
DI
DI
DI
DI
n T
U A
DIFFUS1VITIESDI
WITH WIND SPEED AND THE PLOT OPTION HAVE BEF.N TAKEN OUT.
UPDATING DONE AT EPA-R1P HY J.R. MARTINEZ ON FEB. 6,







COt-U CRANK
DFFUSE
MATADD IMATSURI MATINV
MATNVT MATSCL
NEWPAG NUBETA
PREDAT QGFN
SECONO SOURCE
TIMEX (ENURUN) TRIVRT
UPRATE
XMIT





TAPE.8 CONTAINS NEGATIVE VALUES OF
1973.
N DELETED.




DIFCOF
JACOB
MATMUL
MDATE
NURATt

STATE
UPFLUX
WXMIT





SPECIES
TAPF.9 CONTAINS THE TIME STEP HISTORY
TAPElO CONTAINS THE UPDATED FLUX,
Kl
TAPE11 CONTAINS THE UPDATED INVERSION HEIGHT


LOCATION OF COMMON BLOCKS


CHEM - SOURCE, STATE
FLUXES - UPFLUX
SKY - DFFUSE
TRACER - CRANK, UPFLUX
CNTROL - EFFLUX, FLXOAT, SETUP, WINDY
TRAJ - EFFLUX, FLXDAT.PLACIT, SETUP, WINDY
*IND - SAME AS -TRAJ-

COMMON/CHEM/ ISTOY R<2o»20>' RATE(20tlO>»
1 CONIN (20ilO) , RATEFT(20>,
? NK, NOREAC,
3 NOSPEC, WTMOLEI20),
4 JJ(21), NSTDY
COMMON/CNTROL/CARFAC, STAFAC,
1 TSUN
COMMON/FLUXES/FLXIN(3»bCO> » KLXTIM(500)i













BETA(20»20)
RATKON(20) ,
NOSTAT,
II (400) »

KSTOP,

NFLUX
DI
DI
DI
DI
DI
DI
DI
(1 T
U 1
DI
DI
DI
DI
DI
DI
DI
01
DI
DI
DI
DI
DI
DI
DI
DI
DI
DI
DI
DI
DI
DI
DI
DI
DI
01
DI
01
DI
DI
DI
,01
DI
DI
DI
DI
DI
DI
DI
]
?
3
4
S
6
6
9
10
11
12
13
14
15
1 i.
1 O
17
IB
19
20
21
22
23
24
25
26
27
23
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
46
49
50
51
52
53
54
55
129

-------

















c






















c





c

c

mo
c

c
COMMON/SKY/ DFINITU1).
COMMON/TRACER/NOSP1 •
1 TRACIN(IO).
2 FLX«AL(20)
COMMON/TRAJ/ TSTART.
COMMON/WINO/ T (100 ) »
1 NPTS
DIMENSION STOYKR<20»20> »
1 OUTPUT (200 «2) »
2 , PPHM(20.10>»
3 GZEROI20.10) »
4 REACT(20»8),
5 CONST (30) »
6 SCALEUO).
7 IDATE(IO).
INTEGER HISCOR
REAL LOKLIM.INTIM

EQUIVALENCE (CONST ( 1 ) iDELT )
EQUIVALENCE (CONSTf?) .TSTMAX)
EQUIVALENCE (CONST o) .TSTMlNj
EQUIVALENCE (CONST (4 ) .PRNTIN )
EQUIVALENCE (CONST (5> «UPLIM)
EQUIVALENCE (CONST ( 6) .LOwLIM)
EQUIVALENCE (CONST ( 7 ) »DELZ )
EQUIVALENCE (CONST (8 ) .SUNTIM)
EQUIVALENCE (CONST (9) .FIXSTP)
EQUIVALENCE (CONST ( 10 ) «KOUT)
EQUIVALENCE (CONST ( 1 1 ). T IMOUT )
EQUIVALENCE (CONST ( 12 ) .KEVERY)
EQUIVALENCE ( CONST ( 13) t SPUNCH )
EQUIVALENCE (CONST (14) ,QRATE)
EQUIVALENCE (CONST ( 15 ) .OHTJNV )
EQUIVALENCE (CONST tie) ,COONLY)
EQUIVALENCE (GZEKO , RAT E )
EQUIVALENCE (Q.AJACOB)
EQUIVALENCE (WORKiCONUP)
EQUIVALENCE (RNEG.NE6) » (YES.1ES) »
DATA FLUXl »FLUX2»BLANK,K1/4HFLUX»
OAT A YES »NEG .MORE. END /3H YES »2HNO»
IT IS EQUAL TO THE NUMBER
DATA NROW/20/
DATA MAXR/HO/
DATA MAXMSH/10/
DATA DALITE/4HDAYL/
DATA RTO/5S7.295779B1/
ZEE (10)
NOSTM1, TDELZ.
SCALDF(ll). FLXD6E(20).

P(2»100>» 10(2.100)
V (100) . TH (100) »

STOYKP(20»20> « SPEC(20>»
CONUP (20 .10) . CONEW(20»10)
WORK(2o.lO). TITLE(20)»
AJACOB(20.200) • Q(20.200)t
KSTEP(200) .
HTINV<100»13) » RATK1 (300> •
DSCALE(IO). DCOF(10)»
LOCFLXI20)






















(RMOR.MORE)
2HES.4H ,2HK1/
4HMORE.3HEND/
OF ROWS OF AJACOB. CONlN. ETC*
OF REACTIVE SPECIES





NPHT IS THE NUMBER OF HOWS OF ARRAY -HTINV-
PATA NRHT/100/

TERM r END
TALL PREOAT










DI
01
DI
DI
01
01
DI
DI
DI
01
01
DI
DI
01
DI
DI
DI
DI
DI
01
DI
DI
DI
DI
01
DI
DI
DI
DI
DI
DI
DI
01
DI
01
DI
01
DI
DI
DI
DI
DI
01
01
01
01
DI
DI
DI
UI
DI
DI
DI
01
01
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
130

-------
           (5.251 TITLE                                                  DI   111
           (5,
-------
 170
 180
 190
  200
FLXIN(3,1)  = D
CONTINUE
PRINT 4
GO TO 800
NFLUX = 1-1
INTIM = FLXTIM(l)
TSTOP = FLXTIM(NFLUX)
NFLUX e NFLUX-1
FLXNFW = FLXTIM(2>-0«001
IFLXTM « 1

PRINT FLUXES IN  INTERNAL UNITS

CALL NEWPAG(TITLE,0»IDATE)
PRINT 5
DO 210 J = 1,NFLUX
IF (MOD(J,50).GT.O) 60 TO 200
CALL NEWPAG(TITLE,0,IDATE)
PRINT 5
PRINT 6» FLXTIM(J),»I=1«3)
CONTINUE

        CHtCK WHETHER INTEGRATION  IS TO BE  PERFORMED.
         IF GOAHED  = NO, WE EXITi IF GOAHED  *  YES  WE  PROCEED.
                HEAD  INPUTS  FOR  COMPUTING  POLLUTANT CONCENTRATIONS
                    (CONST(I) ,1=1,8)
                    (CONST (I) »I=9»16)
                    NUMSTP
                    NOREAC
                    NOSP1
                    NSTDY
                    NTRACE
                    NUMFLX
                    NOSTAT
                     REMARK  - NOSPI  is THE NUMBER OF SPECIES, NOSPEC is
                         THE NUMBER  OF CHEMICALLY REACTIVE SPECIES.
                         THE TRACER  (NONREACTIVE) SUBSTANCE MUST BE INPUT
                         LAST, I.E.*  AFTER THE REACTIVE SPECIES.  ONLY
                         ONE TRACER  SPECIES IS ALLOWED.
                         NO  TRACER SPECIES IF NTRACE s 0.
                   - NSTDY  IS THE NUMBER OF REACTIVE SPECIES IN
                         STEADY STATE.
                   STEADY  STATt SPECIES IF NSTDY = 0.
C
C
C




IF G'

IF (GOAHED. E'
C
C











READ
READ
READ
READ
READ
READ
READ
READ
READ


(5,30)
(5»29)
(5,31)
(5,31)
(5,31 )
(5,31)
(5,31>
(5,31)
(5,31>
                NO
        NOSPFC = NOSPI
        IF (MTRACE.RT.O)  NOSPEC = NOSP1-1

        READ  (5,12)  (SPEC(I),WTMOLE(I),I=l,NOSPl)
        IF (NUMFLX.GT.0)  READ (5,31)  (LOCFLX (I) ,I = 1,NUMFLX)
        DO ??() I = ) ,NOSPI
        RE.AP  (5,41)  (PPHM ( I ,J) ,J = J ,NOSTAT)
DI
DI
DI
DI
DI
DI
DI
DI
DI
DI
DI
DI
DI
DI
DI
DI
DI
DI
DI
DI
DI
DI
DI
DI
DI
01
DI
DI
DI
DI
DI
DI
DI
DI
DI
DI
DI
DI
DI
DI
DI
DI
DI
DI
DI
DI
DI
DI
DI
DI
DI
DI
DI
DI
DI
166
167
168
169
170
171
172
173
17*
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
206
209
210
211
212
213
214
215
216
217
218
219
220
132

-------
??U   CONTINUE                                                           DI
      IF (COONLY.EO.YES) GO TO 2f>0                                       DI   822
      READ (5.30)  (RATKON (I),1=1,NOREAC>                                 DI   223
      IF  GO  TO iisn                                        DI   22*
      MEAD (5,40)  ( (REACT (I,J),J=l,8),I = 1,NOREAC)                        DI   226
      READ (5tll>  < (STOfKR (I ,J) ,STOY«P (I»J) »I = 1,NOREAC) »J=1»NOSPtC)      DI   22fe
230   CONTINUE                                                           DI   227
C                                                                        DI   228
C                                                                        DI   229
c     	.	 M02 PHOTODISSOCIATION HATE IS CONSTANT  IF GRATE  = NO   DI   230
      IF (QHATE.fcO.RNE6) 60 TO 260                                       DI   231
c     	READ NO? PHOTODISSOCIATION RATE                       DI   232
C             LAST CARD CONTAINS A DUMMY RATE CONSTANT  WHICH NUST        DI   233
C             BE NE6ATIVE,                                               DI   234
      00 ?40 I = 1.301                                                   01   235
      READ (5,10) A                                                      DI   236
      IF (A.LT.O.) GO TO 250                                             DI   237
      RATKl (I) = A                                                       DI   238
240   CONTINUE                                                           DI   239
      PRINT 15                                                           01   240
      60 TO 800                                                          DI   241
25(J   NRATE = 1-1                                                        DI   242
      TMRATE = INTIM+SUNTIM-0.001                                        DI   243
      IKl = 1                                                            DI   244
C     	         THIS CAUL TO UPRATE INITIALIZES THE  VARIABLE RATE CONDI   245
      CALL UPRATE
-------
  390    CONTINUE
                                                                           DI
  C                                                                         OI   277
  c                                                                         01   378
  c              READ  INITIAL FLUXES. -UPFLUX- ALSO PERFORMS ANY            DI   279
  c              SCALING NEEDED TO SCALE FLUXES.                            DI   2eo
        CALL  XMIT (-NROW,0.»FLXMAL)                                          D*   281
        CALL  XMIT (-NROW»o.«FLXDGE>                                          01   282
        CALL  UPFLUX(INTIM«IFLXTM»LOCFLX.NUMFLX)                            DI   283
  c                                                                         DI   264
  c      ------- PRINT INPUTS                                               DI   285
        CALL  SECONDIA)                                                      DI   286
        PRINT 33,  (TITLE, (IDATE(I) ,1=1,2) »A,J«1, 2)                         DI   287
        CALL  NE*PAG(TITLE»0«IDATE>                                          DI   288
        PRINT ife,  INTIM,TSTOP»DELT,DELZ»NOREAC,NOSPI»NSTDY,NTRACE«NOSTAT,TDI   269
       1STMAX.TSTMIN                                                        DI   290
        IF  (COONLY.ECO.YES)  GO TO 320                                       01   291
        PRINT 17,  (SPEC(J) ,J=1»NOSPEC>                                      DI   292
        PRINT 19                                                           DI   293
        DO  300 I = l.NOREAC                                                DI   294
        PRINT 20«  1 »                                           DI   299
        PRINT 22                                                           DI   300
        DO  310 I - 1 ,NOREAC                                                DI   301
        PRINT 23,  I » (STOYKPU.J) »J = 1 ,8)                                    DI   302
        IF  (NOSPEC.LE.8)  GO TO 310                                          DI   303
        PRINT 24,  (STOYKP (I ,J) ,J=9,NOSPEC)                                  DI   304
  310    CONTINUE                                                           DI   305
        CALL  NEWPAG(TITLE»0»IOATE>                                          DI   306
        PRINT 37                                                           DI   307
        PRINT 38,  (I, (REACT (I»J) ,J = 1 ,8) ,1 = 1 iNOREAC)                        DI   308
        GO  TO 330                                                           01   309
  320    PRINT 7                                                            DI   310
  330    CALL  NEWPA<3(TITLE,0«IDATE)                                          01   311
        PP-INT 28                                                           DI   312
        PRINT 27,  (SPEC 
-------
      CALL XMIT(MOSTAT*!?OFINITtSCALDF)                                  Dl   331
C                                                                        DI   332
c     	CREATE SCALING VECTORS                                DI   333
C                                                                        DI   334
      CALL DIFCOF(SCALDF.NOSTATtnCOF,SCALE, USCALE)                       DI   335
C     	         INITIALISE WTMOLt                                     DI   336
C                                                                        DI   337
      DO 3?0 I =  1tNOSPl                                                 DI   336
      WTMOl.EU) = 28.97/WTMOLE(I)                                        DI   339
3^0   CONTINUE                                                           DI   3*0
C                                                                        01   341
c     ..	CONVERT PPHM TO MASS-FRACTION  TIMES  io»»e.            DI   342
C             THE SCALING OF f-LUXF.S HAS ALREADY BEEN  DONE  BY  -UPFLUX-    DI   343
      DO 370 K =  l.NOSTAT                                                DI   344
      TRACIN(K) = PPHM (NOSP1 .M/wTMOLE (NOSP1 )                            Dl   345
      IF  (COONLY.tO.YES) tiO  TO  370                                       DI   346
      DO 360 I =  ItNOSPEC                                                DI   347
      CONIN(I,K)   = PPHM (IiK)/wTMOLE(I)                                   DI   348
360   CONTINUE                                                           DI   349
370   CONTINUE                                                           DI   350
C                                                                        01   351
c     	 ADDITIONAL INITIAL PARAMETERS                              DI   352
      TIME = INTIM                                                       01   353
      TLEFT = PRNTIN                                                     DI   354
      NRC = MAXM5H«NROw                                                  DI   355
      KNTEP =0                                                          DI   35ft
      CALL XMIT(-200.0.KSTEP)                                            01   357
C                                                                        DI   358
      NK = NOSPEC-NSTDY                                                  01   359
      IF  (COONLY.EQ.RNEG) GO TO 380                                      01   360
      NK s l                                                             01   361
      GO TO 410                                                          DI   362
C                                                                        DI   363
C     	         COMPUTE BETAi THE NET STOICHIOMETRIC MATIRX.          DI   364
C                                                                        DI   365
3*0   DO 390 I =  l.NOREAC                                                01   366
      DO 390 J =  liNOSPEC                                                01   367
      BETA(I»J) = STOYKP (IiJ)-STOYKR (Itj)                                DI   368
      ISTOVR(IiJ) = STOYKR(I,J)                                          DI   369
390   CONTINUE                                                           DI   370
C                                                                        DI   371
c     	 MODIFY BETA IF NECESSARY TO ACCOUNT FOR  STATIONARITY      01   372
C                                                                        DI   373
      CALL NUBETA(8ETA,MAXR)                                             DI   374
C                                                                        DI   375
C     	. GENERATE  SUBSCRIPT  ARRAYS FOR  RATE CALCULATION        DI   376
C             INITIALIZE RATEFF                                          DI   377
C                                                                        DI   37B
      CALL XMITlNOREAC.RATKONiRATEFF)                                    DI   379
      N a 0                                                              DI   360
      00 400 J «  1tNK                                                    DI   381
      JJ(J) s N+l                                                        DI   38a
      DO 400 I =  l.NOREAC                                                DI   363
      IF  (BETA(I»J).EO.O.) GO TO 400                                     DI   384
      N s N+l                                                            DI   385
                                                                               135

-------


400
C
410


C








420


C

c








430
440




450
C
C

C

460


C
c
470







1 1 (N ) = I
CONTINUE
JJ (NK + 1 ) s N + l
IPROD = NK«NOSTAT
TOEL7 = 2./DEL7
NOSTM1 * NOSTAT-1
CALL NEWPAG(TITLE,0,IDATE)

PRIMT 14
A = DFLZ»»Z

1 = 1
B = DFINIT (] )»A
PRINT 42, 1 ,ZEE (1 ) »B
DO 4?0 I = 2.NOSTAT
B = DFINIT (I >*A
PRINT 43, B
PRINT 42, I,ZEE(I)
CONTINUE
B = DFINIT (NOSTAT+1 > *A
PRIMT 44, B

IF (COONLY,EO.YES) GO TO 440


IF (NSTDY.EQ.O> GO TO 440
CALL STATE 
N = NK+1
00 430 I = N,NOSPEC
WT = WTMOLt (I )
DO 430 K = l.NOSTAT
PPHM(I.K) = CONIN (1 ,K)»I*T
CONTINUE
CONTINUE
CALL NEWPAG(TITLE»0»IDATE>
PRINT 18, (SPEC (J) » J = l ,NOSPl )
DO 4^0 K = ItNOSTAT
PRINT 32, /IEE (K) , (PPHM(J.K) ,J = i ,NOSPl )
CONTINUE




CALL TlMEX(n,A,B)
IF (TLEFT.faT.DELT) GO TO 470
DELKP = DELT
OELT = TLEM


KNTPR = KNTfcM+1
IF (KNTE«,Lf .200 ) GO TO 4S>0
IF (KOUT .EQ.i^JEG) GO TO 480
KNTFP = ?00
CALL StCOND(A)
WPITF (9,36) TIMf .KSTEP (KNTtf) ,A
WRITE (^
•*c '
426
429
430
431
432
433
434
435
436
437
438
439
440
136

-------
4"!J
4C>(1


C
C

c
c
c
c


c
c
c
c
c


500
c
c
c
c



510




520



C




530
C
C
C
C




C
hMTFP - 1
OUTPUT (NNTtR • 1 ) = TIMfc
OUTPUT (KMER»2> = OELT
KS!fp(KNTE>) - KSTtP (2UU) +KNTER
IF (KSTtP (KNThR) ,GT .IMUM5TP) fiO TO 800

IF (TOONLY.EO.YFS) GO TCI 600



QMC - CZERO) = -?.»faZiRO = -g.*(A»CZERO * RATE)

CALL XMIT 1-NRCtO. »RAtt)
CALL XMIT <-MRC,0, iCONUP)

CA| L SOURCE ICONUP)


DO 5ro I = 1 »fJK
NATEd.l) = RATE (I »1 ) +TOeLZ»Kl.XWAL (I )
PATF (I .NOSTAT) = RATE (I ,NOSTAT)-TDELZ«FLXOGE (I)
CONTINUE






DO 510 I = ItNK
CONUP(I.l) = DCOF (1 )«(-CONIN(l ,1 ) +CONINII ,2) 1
COMIP < I ,NOSTAT) = OCOF (NOSTAT) »< CON IN (I tNOSTAT-1 ) -CONINd »NOSTAT)
CONTINUE
DO 520 J = 2.NOSTM1
DO 520 I = 1 «NK
CONUP (I.J) = SCALDF (J)#CONIN (I ,J-1 ) -OCOF I J ) *CONI N 1 1 1 J ) *SCALDF(J*1
1*CONIN(I ,J*1 )
CONTINUE
CALL MAT ADD (CONUP .RATE »G2ERO,NROW,NOST AT )
CALL MATSCL (-2. tGZERO »NROW , NOSTAT )


DO 530 J = 1, NOSTAT
A = DSCALE (J)
DO 530 I = ItNK
GZERO(IiJ) * 6ZERO(I.J)»A
CONTINUE



RECALL THAT Q IS STORED IN THE SAME LOCATION AS AJACOB

B 3 2. /DELT
DO 540 I = 1 , NOSTAT
J r ( 1-1 ) ttNROW+1
CALL JACOB (AJACOB (1 »J> .CON IN (1,1) tRATKON ,NK , WTMOLE iNOSPEC . CONUP )

01
DI
DI
01
P. *
0 1
01
01
DI
01
MO I
01
01
01
01
DI
t~\ T
U 1
DI
01
01
n T
U I
DI
DI
DI
DI
01
DI
DI
DI
01
DI
) DI
01
DI
DI
) DI
DI
DI
DI
DI
DI
U A
01
DI
DI
DI
DI
DI
DI
DI
DI
DI
DI
DI
01
DI
DI
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
457
458
459
461
462
463
464
465
466
467
468
469
470
471
478
473
474
475
476
477
478
479
4fl n
481
482
483
484
485
486
487
488
469
490
491
492
493
494
495
137

-------
  c      -------  THE  NEXT TWO STATEMENTS GENERATE Q WITH PROPER  SCALING     DI   496
        A  =  R+DCOF (I )                                                       01   497
        CALL  QGENIAJACOB (1 »J> ,A»OSCALE (I ) ,NK)                              01   498
  540    CONTINUE                                                           DI   *9'
  c                                                                         DI   500
  c      -------------  NOW  TO SOLVE THE SYSTEM                              DI   501
  c                                                                         01   502
        CALL  TRIVPT (GI.GZERO, SCALE, WORK, NROW,IPROD,NOSTAT,NK,CONEW>         DI   503
        CALL  MATADD (CONIN, CONEW.CONEW.NROW, NOSTAT)                         DI   504
  c                                                                         DI   505
  C                                                                         DI   506
  c      ------------ .  TEST  RELATIVE CHANGE IN CONCENTRATION                DI   so?
        HISCOR  =0                                                          DI   508
        LOSCOR  =0                                                          DI   509
        DO 570  K =  liNOSTAT                                                 DI   510
        DO 570  J =  ItNK                                                     DI   511
        DIFCON  = CONEW ( J,K) -CONIN (J»K>                                     DI   512
        IF (DIFCON. EQ. 0. )  GO TO 560                                        DI   513
        DIFTST  = A8S(DIFCON)/CONIN ,GT.(). )  GO TO 590                                     01   536
        WRITE (8.39) SPET (I > »J»HME»CONIN(I tj) »DELT                        01   537
        CONIM(I.J)  = l.E-16                                                 DI   538
  59o    CONTINUE                                                           DI   539
        GO TO 640                                                          01   540
  C                                                                         DI   541
  C ---------- IF ONLY  ft  NONRtACUVf SPECIES IS PRESENT, THE CURRENT VALUf  01   54?
  C           IS SflVtD,  THE  NEW  VALUE IS COMPUTED 8Y  A CALL TO CRANK,    "  01   543
  c           ANU THE  RELATIVE  CHANGE is DETERMINED FOR PURPOSES OF        DI   544
  c           STEP-SIZE  CONTROL                                             DI
 c                                                                        DI  546
       C'ALL  XMIT (NOSTAT, fHACIN.WORK )                                      (Jj  5^7
       CALL  CRANK (NOSTAT ,i)ELT)                                            01  548
       HISCOR  =  0                                                         D1  549
       LOSCOR  =  o                                                         pi  550
138

-------
      r..j 630 K = 1 .NOSTAT                                                01  551
      DIf-rOM = THACIN {K)-W()HK (K,l )                                       DI  552
      If- (DIFCON.f.U.o. I CiO  TO  02(1                                        DI  553
      (itFT^T = At*S (OTFCON)/TRACIN (K )                                     01  5b4
      IF (PIFTS7 .6T .TST-^AX)  GO  TO  6)0                                    01  555
      If  =  TRACIH (M»WTMOLt(NOSP1)                            DI  573
      IF (COONLY.EQ.YES) 60  TO  670                                       DI  574
      DO 660 J = liNOSPEC                                                DI  575
      PPHM(J.K) = CONEW (JtK)*v
-------
  c                                                                        01   606
  c     .._.—___.—UPDATE SOURCES                                         01   607
        IF (TIME.LT.FLXNEW) GO TO 730                                      DI   608
        IFLXTM = IFLXTM*!                                                  DI   609
        IF (IFLXTM.(3T.NFLUX) IFLXTM B NFLUX                                DI   610
        FLXNEW * FLXTIM (IFLXTM*l)-o.001                                    DI   611
        CALL UPFLUX (TIME,IFLXTM,LOCFLX.NUMFLX)                             DI   613
  720   CONTINUE                                                           01   613
  C     ,                                                                   DI   614
        IF (COONLY.EQ.YES) GO TO 740                                       DI   615
  C                                                                        DI   616
  C     	UPDATE RATKON(l), N02 PHOTOD1SSOCIAT ION RATE CONSTANTDI   617
  C             RATKON(l) IS CONSTANT IF ORATE  =  2HNO                      DI   618
  C                                                                        DI   619
        IF (ORATE.EQ.RNE6) SO TO 730                                       DI   620
        IF (TIME.LT.TMRATE) GO TO 730                                      DI   621
        IKl r IK1*1                                                        DI   623
        IF (IKl .GT.NRATE) IKl = NRATE                                      DI   623
        TMRATE = INTIM + 1K1<*SUNTIM-0.001                                    DI   624
        CALL UPRATE(TIME,RATK1(IKl),RATKON,RATEFF)                         DI   625
  730   CONTINUE                                                           DI   626
  740   IF (QHTINV.EU.RNEG) GO TO 770                                      01   627
  C                                                                        DI   628
  C     	         UPDATE INVERSION HEISHT                               DI   629
  C                                                                        DI   630
        IF (TIME.LT .HTINV(IHTfl))  GO TO 770                                DI   631
        IF (KHT.GT.NHT)  GO TO 770                                          DI   632
        WRITE (11,46)  TIME,HTINV(IHT,1),HTINV(IHT,2)                       DI   633
        A  = DEL2»<*2                                                        DI   634
        K  = NOSTAT*]                                                        DI   635
        HO 750 I s i,K                                                     DI   636
        DFINIT(I)  = HTINV(IHT,1+2)/A                                       DI   637
  750   CONTINUE                                                           01   638
        b  = DFINIT(1)*A                                                    DI   639
        J  = 1                                                              DI   640
        WRITF (11,4?)  J,^EE(1)«B                                           01   641
        DO 760 J s 2,NOSTAT                                                01   642
        fJ  = DFINIT(J>«A                                                    01   643
        WRITE (11,43)  B                                                    01   644
  760   WRITF (11,4?)  J.ZEE(J)                                              01   645
        H  = PFINIT(NOSTAT*!)*A                                             OJ   646
        WRITE (11,44)  H                                                     Dj   647
        KHT = KHT*1                                                        D1   646
        IHT = IHT+1                                                        01   649
        IF (IHT.&T.NHT)  IHT = NHT                                          DI   65o
        CALL  XMIT (NOSTAT + 1,OFINIT.SCALUF)                                  DI  651
        C4LI,  OIFCOl- (SCALDF,NOSTAT,DCOF,SCALE,DSCALE)                       DI  652
  770   CONTINUE                                                           QJ   653

        IF (TLEFT.NE.PRNT1N)  GO TO 780                                     DI   655
        IF (PFLT.ft/,PRNTIM)  60 TO  780                                      ni  t,*,f,
        GO TO 460                                                           ^}  l£
  7«0   CONTINUE                                                           DI  658
  C                                                                         01  659
        IF  (FMSTP.EO.YES)  G0 TO 460                                        01  660
140

-------
c




790



C
C
800




C




c
c
c
c
c
c
c
c
810



C
c
c
c
1
2

3
4

5


6
7
8
9
10
11

IF-" 
IF (KSTEP(KNTER) .OT.NUMSTP) PRINT 26
IF (KOUT.EO.IES) WRITE (9t35) (KSTEP ( I ) i (OUTPUT ( I tJ > ,J = 1 »2 )« 1 = 1 t
1TER)

THE DATA DECK MUST BE ENDED WITH A CARD WHICH CONTAINS
THE WORD -END- IN COLS 1-3. OTHERWISE PROGRAM EXECUTION
WILL TERMINATE ON AN UNCHECKED END OF FILE.

IF USER WISHES TO STACK JOBS, HE MUST PLACE A CARD
BETWEEN DATA DECKS WHICH HAS THE WORD -MORE- IN COLS 1-4

READ (5,25) TERM
IF (TERM.EO.RMOR) GO TO 100
IF (TERM. NE. END) GO TO 810
CALL EXIT




FORMAT <40X,A4,6X»A4>
FORMAT (1H1 ,10X,45HOIMENSIONS OF ARRAYS T» V, TH IN COMMON/WIND/
133H HAVE BEEN EXCEEDED. JOB ABORTED.)
FORMAT <40X,3F10.3)
FORMAT (1H1 ,10X,37HMORE THAN 500 FLUXES HAVE BEEN INPUT.
113H JOB ABORTED.)
FORMAT <1HO,5X,42HTOTAL FLUXES IN UNITS USED BY CODE (M/MINI//6X
1 4HTIME.10X.12HNITRIC OxIDE ,5X .21HREACT I VE HYDROCARBONS, 5X ,
2 15HCARBON MONOXIDE)
FORMAT (1H ,3X,F6.1»10X,E12.4i5X,E17,4»9X»E13.4)
FORMAT <1HO»5X,42HTHIS RUN TOR ONE NONREACTIVE SPECIES ONLY.)
FORMAT (1H ,5X,A4»6H FLUX s ,2X,G15.8)
FORMAT (1HO»4X,9HHEIGHT-M.,3X,A4,7(11X,A4>/18X,A4«7<11X»A4) )
FORMAT (30X.El5.51
FORMAT (2F10.0)
DI
DI
01
DI
DI
DI
DI
DI
DI
DI
DI
DI
DI
DI
DI
DI
DI
DI
DI
DI
DI
KNDI
DI
DI
DI
DI
DI
DI
DI
DI
DI
DI
DI
DI
DI
DI
n T
U i
DI
DI
DI
DI
DI
DI
DI
DI
DI
, DI
DI
DI
DI
DI
DI
DI
DI
DI
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
AO7
O T f
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
141

-------
12
13


14


15

16









17
18

19

20
21
22

?3
24
25
26

27
•3 Q
2H
29
30
31
3?
33

34

35
36

37
38
39

4n
41
4?
43
FORMAT <40X,A4»6X»F10.2) °I
FORMAT (1HO.////////30X48HCONCENTRATION PROFILES-PAHTS PER HUNDP-EDDI
1 MiLLION//45X.5HTIM£s,E12.5.8H MINUTES//1 OX .20H6ROUND DIFFUSIVITY DI
2=»G15.e«10X»5H Kl =»G15.8) DI
FORMAT (1HO»10X.30HINITIAL DIFFUSION COEFFICIENTS//! OX »52HVALUES SOI
1HOWN ARE FOR POINTS HALFWAY BETWEEN STATIONS///10X»7HSTATION» 1QX » 101
25HHEIGHT (METERS )* 10X i 1 1HDIFFUSI VITY) DI
FORMAT (1H1 »loXi64HN(JMBER OF N02 RATE CONSTANTS EXCEEDED THE OIMENDI
ISIONS OF VECTOR -RATKI-. JOB ABORTED.) DI
FORMAT (1H0.61HINPUT DATA FOR VERTICAL DIFFUSION PROBLEM WITH PHOTDI
10CHEMISTRY//2X.15HINITIAL TIME IS.E12.5»8H MINUTES//2XJ3HFINAL TIMDI
2E IS,E12.5»8H MINUTES//2X17HTIME STEP SIZE IS.E12.5.8H MINUTES//2XOI
326HVfRTICAL MESH INCREMENT ISiE12.5i7H METERS//2X22HNUMBER OF REACDI
4TIONS IS.I3//2X20HNUMBER OF SPECIES IS» I3//2X36HNUMBER OF SPECIES DI
5IN STFADY STATE IS. I4//2X27HNUMBER OF TRACER SPECIES ISi 14 i3Xi 17H (DI
6CANNOT EXCEED 1 ) //2X33HNUMSEH OF VERTICAL MESH POINTS IS, I3t lX,33HDI
7INCLUDIN6 THE GROUND AND THE EDGE//2X18HSTEP SIZE CONTROLS//10X32HDI
8UPPER LIMIT FRACTIONAL CHANGE I S ,E12.5//1 OX32HLOwER LIMIT FRACTlONDI
9AL CHANGE IS.E12.5) DI
FORMAT (1HU.//13X.8 (8X.A4) «6X»13HRATE CONSTANT t /( 13X t6 (8X «A4 ))) DI
FORMAT (1HU.////////30X39HINITIAL PROFILES OF CONCENTRAT I ONS-PPHM/DI
1/////4X9HHEIGHT-M. t5XtA4»7(llXiA4)/(llX»8(llXiA4))) DI
FORMAT (1H0.5X8HREACTION,25X55H- --REACTANT STOIC HOI
1 IOMETRY-- -»24XtlOH(PPHM/MIN) ) DI
FORMAT (1H0.5X,I3,2X,8(8X,F4.1) ilOX,G12.5) DI
FORMAT (10X.8 (8X.F4.1 )/10X«4(8X»F4.1) ) DI
FORMAT (1HO,//6X8HREACTION,26X53H- --PRODUCT STOIC HDI
1IOMETRY---1 DI
FORMAT (lHO«5XI3flOXF5.2»7(7XF5.2) ) DI
FORMAT <18XF5.2*7 < 7XF5.2 > /I 8XF5 .2 i3 (7XF5.2 > ) DI
FORMAT (20A4) DI
FORMAT  DI
FORMAT (HA«) PI
FORMAT <20X,5E10.4) OI
FORMAT (1H0.10X»I5,15X,F10.2»10X.G15.8) DI
FORMAT (1H() t50X»G15.6) 01
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
142

-------
44    FORMAT (1H+.SOX,&15.8)                                             DI   771
4?    FORMAT (1H1tlOXi57MTOO MANY  INVERSION  HEIGHT  ENTRIES  IN  TABLE.   JOOI   772
     1H ABORTtU.)                                                        DI   773
46    FORMAT < 1HO .lOXiSQHINVERSION HEIGHT  AND  DIFFUSIVUY UPDATED  AT  TIMDI   774
     IF .Fio.2.5X,l4HUPDATE TIME = ,F10.2»SX.9HIMV  HT  =  »F10.2)          DI   775
47    FORMAT (23HSTART LOCATION  (COORDS)•17X»2F10
-------
144

-------
F.2  AIR TRAJECTORY MODULE

-------
      SUBROUTINE ANGTST(XStYS .NGOOD .KUSE ,OK)                             ANG   1
C                                                                       ANG   2
C THIS ROUTINE PERFORMS THE ANGLE TEST                                  ANG   3
C WRITTEN RY MA HIRSCHBERG                                              ANG   4
C MARCH 1973                                                            ANG   5
C                                                                       ANG   6
C XS     X-COORDINATE OF  POSITION                                       ANG   7
C YS     Y-COORDINATE OF  POSITION                                       ANG   8
C NGOOD  NUMBER OF POINTS-1                                             ANG   9
C KUSE   INDEX OF CLOSEST STATION                                       ANG  10
C OK     FLAG IF POSITIVE ANGLE TEST IS OK OTHERWISE LOOK FOR NEW POINT ANG  11
C                                                                       ANG  12
      DIMENSION SSTAN(2»51)» ISTANS<2HOO>                              ANG  13
      COMMON /WDATA/ NUMSTA* SSTAN. iSTANSt RMIN» RMAX                  ANG  u
C                                                                       ANG  15
      DIMENSION RVEC(3,3),SVEC(3i3)                                     ANG  16
      DATA COSTST/t99939083/                                            ANG  17
C                                                                       ANG  IB
      OK a .1,                                                          ANG  19
      NUSE B NGOOD*!                                                    ANG  20
      GO TO UOOtlSO,130>,NUSE                                          ANG  21
C                                                                       ANG  22
C STORE FIRST VECTOR                                                    ANG  23
100   CONTINUE                                                          ANG  24
      RVEC(lil) « XS-SSTAN(1»KUSE)                                      ANG  25
      RVEC(2il) * YS-SSTANI2.KUSE)                                      ANG  26
      RVEC(3,1) « 0.0                                                   ANG  27
110   CONTINUE                                                          ANG  28
      OK • 1.0                                                          ANG  29
      RETURN                                                            ANG  30
C                                                                       ANG  31
C STORE SECOND VECTOR AND CHECK ANGLE                                   ANG  32
120   CONTINUE                                                          ANG  33
      RVEC(1»2) * XS-SSTAN(1fKUSE)                                      ANG  34
      RVEC(2,2) = YS-SSTAN(2»KUSE)                                      ANG  35
      RVEC(3t2> * 0.0                                                   ANG  36
      CALL UNITV(RVECUil) iSVEC(lil) )                                   ANG  37
      CALL UNITV(RVEC(1»2) tSVECUiS) )                                   ANG  38
      COSEY « DOTTY(SVEC(ltl),SVEC(l,2))                                ANG  39
C                                                                       ANQ  40
C     PROVIDE A 2 DEGREE  ANGLE CHECK                                    ANG  41
      IF (COSEY.GT.COSTST) RETURN                                       ANG  42
      GO TO 110                                                         ANG  43
C                                                                       ANG  44
C STORE THIRD VECTOR AND  CHECK ANGLE                                    ANG  45
130   CONTINUE                                                          ANG  46
      RVEC<1»3) « XS-SSTAN(1»KUSE)                                      ANG  47
      RVEC(2i3) « YS-SSTAN(2iKUSE)                                      ANG  *8
      RVEC(3f3) « 0.0                                                   ANG  *9
      CALL UNITV(RVEC(li3)«SVEC(1»3))                                   ANG  50
      COSEY » DOTTY(SVEC(1»1) iSVEC(1.3))                                ANG  51
      IF (COSEY.GT.COSTST) RETURN                                       ANG  52
      COSEY « DOTTY(SVEC(li2) iSVECUi3)>                                ANG  53
      IF (COSEY.GT.COSTST) RETURN                                       ANG  54
      GO TO 110                                                         ANQ  55
C                                                                       ANG  56
      END                                                               ANG  57-
                                                                               145

-------
C
c
c
c
c
c
c
c
c
c
c
c
c
c

THIS SUBROUTINE

TAKES THE RAW AZIMUTH AND VELOCITY DATA AND
PRODUCES ONE AZIMUTH AND VELOCITY

NP
AZV(l)
AZV(2)
AZV(3)
AZV(4»
ODD
AZM
VEL
IRF


NUMBER OF RAW DATA POINTS (UP TO THREE)
AZIMUTH IN WIND PT COORDINATES
VELOCITY IN MPH
NUMBER OF POINTS IN DIGITAL WIND SYSTEM
STATION NAME
DISTANCE FROM INPUT PT TO CLOSEST STATIONS
AZIMUTH TO BE CALCULATED
VELOCITY TO BE CALCULATED
INVERSE OR INVERSE SQUARE DISTANCE CALCULATION

       SUBROUTINE  AZVDIS(NP.AZV»DDD»AZMtVEU,IRF)                          AZV   1
                                                                          AZV   2
                                                                          AZV   3
                                                                          AZV   4
                                                                          AZV   5
                                                                          AZV   6
                                                                          AZV   7
                                                                          AZV   6
                                                                          AZV   9
                                                                          AZV  10
                                                                          AZV  11
                                                                          AZV  12
                                                                          AZV  13
                                                                    TO BE AZV  14
                                                                          AZV  15
       DIMENSION AZVI12)»DOD(3)                                           AZV  16
       DIMENSION AZT(3)tW<3)iR(3)fAX(3)iAY<3)                             AZV  17
       DIMENSION SSTAN(2.51)i  ISTANS(2.100)                               AZV  18
       COMMON  /WDATA/ NUMSTAi  SSTAN,  iSTANSi RMJN» RMAX                   AZV  19
       DATA RPD/.01745329/iDPR/57,2957795/                                AZV  20
 C                                                                        AZV  21
       SUM • 0.0                                                          AZV  22
       DO 120  I «  liNP                                                    AZV  23
       L * 1-1                                                            AZV  24
       APT • AZV(4»L*3)                                                   AZV  25
       AZUS •  AZV(4«L*1>                                                  AZV  26
       IF  (AZUS.GT,APT) AZUS • APT                                        AZV  27
 C                                                                        AZV  28
 C     COMPUTE SECTOR SIZE                                                AZV  29
 C                                                                        AZV  30
       SDEO «  360./APT                                                    AZV  31
 C                                                                        AZV  32
 C     CALCULATE WIND AZIMUTH  IN DEGREES CLOCKWISE FROM NORTH             AZV  33
 C                                                                        AZV  34
       AZT(I)  « l8o.*AZUS»SDEO                                           AZV  35
       IF  (AZT(I).6T.360.) AZT(I) »AZT(I)-360.                           AZV  36
       AX B SIN(AZT(I)«RPD)                                            AZV  37
       AY(I) s COS(AZT
-------
C     CALCULATE *(I)  AND THE AZIMUTH AND VELOCITY OF INTEREST           AZV  56
C                                                                       AZV  57
      SUMX * 0.                                                         AZV  58
      SUMY » 0.                                                         AZV  59
      SUMS n o.O                                                        AZV  60
      DO 130 I = liNP                                                   AZV  61
      L * 1-1                                                           AZV  62
      W                                       AZV  66
130   CONTINUE                                                          AZV  67
      AZM a DPR*»ATANa (SUMXtSUMY)                                        AZV  68
      IF  (AZM.LT.O.)  AZM •  AZM*360.                                     AZV  69
      VEL * SUM2                                                        AZV  70
      RETURN                                                            AZV  71
C                                                                       AZV  72
      END                                                               AZV  73-
                                                                                147

-------
C WRITTEN BY
C MARCH 1973
C MODIFIED TO
C MAY 1973
C
C
C BAS» CO)                                         BAR   26
       DATA IFIN/0/                                                       BAR   27
 C                                                                        BAR   28
       DATA NUMBAS/6/                                                     BAR   29
       DATA BAS/                                                          BAR   30
 c  SAN GABRIEL MTS                                                       BAR   31
      1              17.50*    50.59*    22.28*    47.13*                 BAR   32
      2              22.28*    47.13.    36.60*    41.38*                 BAR   33
      3              36.60*    41.38*    50.92*    41.38*                 BAR   34
 C  SANTA MONICA MTS                                                      BAR   35
      4              -1.02*    35.17*     4.90*    37.01*                 BAR   36
      5               4.90*    37.01*    19.41.    39.08.                 BAR   37
 C  PALOS VERDES HILLS                                                    BAR   38
      6              14.16.    15.14.    17.89.    12.15   /              BAR   39
 C                                                                        BAR   40
       OK a 1.0                                                           BAR   41
       IF (NUMBAS.LE.O) GO TO 130                                         BAR   42
       IF (IFIN.GT.O) GO TO 110                                           BAR   *3
 C                                                                        BAR   44
 C SETUP SLOPE INTERCEPT FORM OF A LINE                                   BAR   45
       DO 100 I » l.NUMBAS                                                BAR   46
       DY a BAS(2.I)-BAS(4.I)                                             BAR   47
       DX a BASdiD-BASOiII                                             BAR   49
       SLPIN(l.I) a DY/DX                                                 BAR   49
       SLPIN(2*I) « BAS(2.I)-SLPIN(1.I)«BAS(1,I)                          BAR   50
 100   CONTINUE                                                           BAR   51
       IFIN « 1                                                           BAR   52

 110   CONTINUE                                                           BAR   54
       C<1)  » XS-X                                                        BAR   55
148

-------
      C  »  YS-Y                                                       BAR  56
      A(3)  B  0.                                                          BAR  57
      B(3)  r  o.                                                          BAR  56
      CO)  B  0.                                                          BAR  59
      DO 12Q  I  a ItNUMBAS                                               BAR  60
      01 B  YS-SLPIN(1»I)»XS-SLPIN(2,I )                                   BAR  61
      D2 B  Y-SLPIN(liI)»X-SLPIN(2»I)                                     BAR  62
      IF 
-------
       SUBROUTINE DATE
-------
      IF (K2.LE.30) 60 TO 110                                           DAT  56
      K2 = K2-30                                                        DAT  57
      GO TO 100                                                         OAT  58
140   CONTINUE                                                          DAT  59
      NEW(l)  « 100»K22*K2                                               DAT  60
      RETURN                                                            DAT  61
C                                                                       DAT  62
C     DECREMENT TIME                                                    DAT  63
150   CONTINUE                                                          DAT  64
      K2 « I2-MOVE                                                      DAT  65
      IF (K2.GE.O) GO TO 140                                            DAT  66
      K2 « K2»60                                                        DAT  67
      K22 » 11-1                                                        DAT  68
      IF (K22.GE.O) GO TO 140                                           DAT  69
      K22 • K22+24                                                      DAT  70
      NEW(l)  » 100*K22*K2                                               DAT  71
      K22 » J2                                                          OAT  72
      K2 « J3-1                                                         DAT  73
      IF (K2.GT.O) GO TO 110                                            DAT  74
      K22 « J2-1                                                        DAT  75
      IF (J2.EQ.12) GO TO 170                                           DAT  76
      IF (J2.EQ.10) GO TO 170                                           DAT  77
      IF (J2.EQ.7) GO T° 170                                            OAT  78
      IF (J2.EQ.5) GO TO 170                                            DAT  79
      IF (J2.EQ.3) GO TO 180                                            DAT  80
      K2 • 31                                                           DAT  81
160   CONTINUE                                                          DAT  82
      IF (K22.GTtO) GO TO 110                                           OAT  83
      K22 « 12                                                          DAT  84
      Jl m Jl-l                                                         DAT  85
      GO TO 110                                                         DAT  86
170   CONTINUE                                                          DAT  87
      K2 » 30                                                           DAT  8B
      GO TO 160                                                         DAT  89
180   CONTINUE                                                          DAT  90
      K2 - 28                                                           OAT  91
      GO TO 160                                                         OAT  92
c                                                                       DAT  93
      END                                                               OAT  94-
                                                                                151

-------
        FUNCTION DOTTY(A.B)                                                DOT   1
  C                                                                       DOT   2
  C RETURNS THE DOT PRODUCT  OF VECTOR A AND VECTOR B                      DOT   3
  C                                                                       OOT   *
        DIMENSION A(3),B(3)                                                DOT   5
  c                                                                       DOT   6
        DOTTY - 0.0                                                       DOT   7
        DO 100 1-1.3                                                    DOT   8
        DOTTY « A(I)«B(I)*DOTTY                                           DOT   9
  100   CONTINUE                                                          DOT  1"
        RETURN                                                            DOT  H
        END                                                               DOT  12-
        SUBROUTINE EDGE(X.Y.ITFiIEDSE)                                     ED6   1
  C                                                                       ED6   2
  C         CHECK WHETHER NEW POINT IS OUTSIDE SRID                       EDO   3
  C                                                                       EOG   4
        COMMON /GRID/ XI. X2. Yl, Y2. NX, NY, DELX, DELY, DELT            EDO   5
        DATA IONE/1/                                                      EDS   6
  C                                                                       EDO   7
        IF (X.LT.X1) GO TO 100                                            EDO   8
        IF (X.OT.X2) GO TO 100                                            EDO   9
        IF (Y.LT.Y1) GO TO 100                                            EDO  10
        IF (Y.GT.Y2) GO TO 100                                            EDO  11
  C                                                                       EDO  12
  C         POINT IS OK                                                   EDO  13
  C                                                                       EOG  14
        IEDGE « 0                                                         EDO  15
        GO TO 110                                                         EDO  16
  100   CONTINUE                                                          £DQ  17
  c                                                                       EDG  18
  C         POINT IS OUTSIDE GRID                                         EDO  19
  c                                                                       EDG  20
        IEDGE = ISIGNdONE.ITF)                                            EDfi  21
  110   RETURN                                                            EDG  22
        END                                                               EDG  23-
152

-------
      SUBROUTINE EXTRP(IHOUR»ARYtVAL)                                    EXT   1
C                                                                       EXT   2
C      EXTRP SELECTS A VALUE OUT OF A 24-WORD ARRAY,  IF THE VALUE      EXT   3
C      SOUGHT IS MISSING (INDICATED BY A NEGATIVE ENTRY)• EXTRP         EXT   4
C      "ILL ATTEMPT TO FILL THE GAP BY INTERPOLATION OR EXTRAPOLATION.  EXT   5
C                                                                       EXT   6
C     IHOUR        CLOCK TIME ON A 24 HOUR BASIS                        EXT   7
C     ARY          ARRAY OF 24 VALUES  (WIND OR VELOCITY)               EXT   6
C     VAL          VALUE SELECTED                                       EXT   9
C                                                                       EXT  10
C     MISSING DATA SITUATIONS HANDLED BY EXTRP                          EXT  11
C                                                                       EXT  12
C     CASE  1-3  1-2  1-1   I   1*1  1*2  1*3                           EXT  13
C      0               X
C      1          XX
C      2     X    -    X
C      3     X    X    -
C      4
C      5
C      6
X                                      EXT   14
                                       EXT   15
                                       EXT   16
                                       EXT   17
X    X                                 EXT   18
X    -    X                            EXT   19
-XX                            EXT   20
C                                                                       EXT  21
      DIMENSION ARY(24)                                                 EXT  22
C                                                                       EXT  23
      IPICK * IHOUR/100*!                                               EXT  24
      IF (IPICK.GT.24) IPICK « IPICK-24                                 EXT  25
      VAL = ARY(IPICK)                                                  EXT  26
      IF (VAL.GE.O.) RETURN                                             EXT  27
C                                                                       EXT  28
C ENTRY MISSING. MUST TRY TO GET VALUE BY INTERPOLATION OR EXTRAPOLATIONEXT  29
C IS THERE A VALUE ON BOTH SIDES                                        EXT  30
      VAL B -1.                                                         EXT  31
      IF (IPICK.EO.l) GO TO 100                                         EXT  32
      IF (IPICK.EO.24) GO TO 130                                        EXT  33
      IF (ARY(IPICK-l) .LT.O.) GO TO 160                                 EXT  34
      IF (ARY(IPICK*1).LT.O.) 60 TO 190                                 EXT  35
C                                                                       EXT  36
C CASE 0                                                                EXT  37
C                                                                       EXT  38
      VAL « 0«5*tLT.O.) GO TO llo                                       EXT  44
      IF (ARYO).LT.O.) GO TO 120                                       EXT  45
      VAL • ARY(2)-(ARY(3)"ARY(2))                                      EXT  46
      GO TO 220                                                         EXT  47
110   CONTINUE                                                          EXT  46
      IF (ARY(3).LT.O..OR.ARY(4).LT.Ot) RETURN                          EXT  49
      VAL » ARY(3)-2.»(ARY(4)-ARY(3))                                    EXT  50
      00 TO 220                                                         f*T  |1
120   CONTINUE                                                          EXT  52
      IF (ARY(4).LT.O.) RETURN                                          EXT  53
      ARYI3) » 0.5«(ARY(2)*ARY(4»                                      EXT  54
      GO TO 100                                                         EXT  55
                                                                               153

-------
 c                                                                        EXT  56
 C WE ARE AT THE LAST POINT                                               EXT  57
 130   CONTINUE                                                           EXT  58
       IF  (ARY(23>.LT.O.) SO  TO  140                                       EXT  59
       IF   tLT.O.) GO  TO  150                                       EXT  *<>
       VAL » ARY(23)*ARY(23)-ARY<22)                                      EXT  61
       SO TO 220                                                          EXT  62
 140   CONTINUE                                                           EXT  63
       IF  (ARY<22).LT.O.tOR.ARY(21>.LTtOt)  RETURN                         EXT  64
       VAL • ARY(22)*2.».LT.O.) GO TO  180                                  EXT  72
       IF   60  TO  180                                       EXT  73
       IF  (ARY(IPICK»2).LT.O.) GO TO  170                                  EXT  74
 C                                                                        EXT  75
 C CASE 4                                                                 EXT  76
       VAL » ARY(IPICK*1>- 60  TO  180                                       EXT  80
       IF  .LT.O.) GO TO  180                                  EXT  81
 C                                                                        EXT  82
 C CASE 5                                                                 EXT  83
       VAL » ARY(IPICK*1)-0.5«(ARY(IPICK*3)-ARY(IPICK*1))                 EXT  84
       GO TO 220                                                          EXT  85
 180   CONTINUE                                                           EXT  86
       VAL « VAL-1.                                                       EXT  87
       IF  (VAL.LT.-3.) RETURN                                             EXT  88
       IF  (IPICK-2.LT.1) 60 TO 210                                        EXT  89
       IF  +2.«(ARY(IPICK-2)-ARY                  EXT  95
       GO TO 220                                                          EXT  96
 190   CONTINUE                                                           EXT  97
       IF                       EXT 102
       GO TO 220                                                          EXT 103
 200   CONTINUE                                                           EXT 104
       IF  (IPICK-3.LT.1) GO TO 210                                        EXT 105
       IF  (ARY(IPICK-3),LT.O.) 00 TO  210                                  EXT 106
 C                                                                        EXT 107
 C CASE 2                                                                 EXT 108
       VAL = ARY(IPICK-D*0.5»(ARY(IPICK-l)-ARY(IPICK-3) )                 EXT 109
       GO TO 220                                                          EXT 110
154

-------
210   CONTINUE                                                          EXT 111
      VAL = VAL-1.                                                      EXT 112
      IP (VAL.LT.-3.) RETURN                                            EXT 113
      IF (IPICK*2.GT.24) GO TO 180                                      EXT 114
      IF .LT.O,) GO TO 180                                 EXT 115
      IF (IPICK*3.GT.24) GO TO 180                                      EXT 116
      IF (ARY(IPICK*3>.LT.O.) GO TO 180                                 EXT 117
C                                                                       EXT 118
C CASE 6                                                                EXT 119
      VAL * ARY(IPICK*2>-2.»
-------
       SUBROUTINE GETAZV(KOLD,ID«XS,YS»NC,AZV,NGOOD,DDIS)                GET    1
 C                                                                       GET    2
 C     THIS SUBROUTINE RETRIEVES MEASUREMENT RECORDS FROM                GET    3
 C     CLOSE STATIONS.                                                   GET    4
 C     WRITTEN BY MA HIRSCHBERG                                          GET    5
 C     MARCH 1973                                                        OET    6
 C                                                                       GET    7
 C     KOLD(l)  - TIME - 24 HOUR CLOCK                                   GET    8
 C     KOLD(2)  DATE - YEAR-MONTH-DAY                                    GET    9
 C     ID       STATION ID (IF ANY)                                      GET   10
 C     XS       X COORDINATE OF POSITION                                 GET   11
 C     YS       Y COORDINATE OF POSITION                                 GET   12
 C     NC       NUMBER OF CLOSEST STATIONS TO USE                        GET   13
 C     AZV(l)    AZIMUTH                                                  GET   14
 C     AZV<2)    VELOCITY                                                 GET   15
 C     AZV(3)    NUMBER OF DIGITAL WIND POINTS                            GET   16
 C     AZV(4)    NAME OF CLOSEST POINT                                    GET   17
 C     NGOOD    NUMBER OF POINTS ACTUALLY FOUND TO BE GOOD               GET   18
 C     DDIS     DISTANCE TO POINTS FOUND                                 GET   19
       DIMENSION KOLD<2) IAZVI12)                                         GET   20
       DIMENSION PT(24) ,XIMPH(24)                                        GET   21
       DIMENSION DIS(IOO).IDIS(IOO)                                      GET   22
       DIMENSION DDIS<2>                                                 GET   23
       DIMENSION ID(2)                                                   GET   24
       DIMENSION NAM<2>                                                  GET   25
       DIMENSION NAME(2)                                                 GET   26
       DIMENSION SSTAN(2»51)» ISTANS(2»100>                               GET   27
       DIMENSION IDATE(IO) ,ICT(10)                                       GET   28
       COMMON /WDATA/ NUMSTA, SSTAN, ISTANS, RMIN, RMAX                  GET   29
       COMMON /DATES/ IDATE, ICT, NFILES                                 GET   30
       DATA IBLK /1H /                                                   GET   31
       EQUIVALENCE  (XID.KD)                                              GET   32
 C                                                                       GET   33
 C ZERO OUT AZV ARRAY                                                    GET   34
       DO 100 I » 1,3                                                    GET   35
       L • 1-1                                                           GET   36
       AZV(4»L+1) « 0                                                    GET   37
       AZV(4»L*2) » 0                                                    GET   38
       KD a IBLK                                                         GET   39
       AZV(4»L*3> « XID                                                  GET   40
       AZV(4»L*4> = XID                                                  GET   41
 100   CONTINUE                                                          GET   42
 C                                                                       GET   43
 C     ARE WE AT A STATION                                               GET   44
       IF (ID(I).EQ.IBLK) GO TO 170                                      GET   45
 C                                                                       GET   46
 C     YES GET THE STATION DATA                                          GET   47
       DO HO  I = 1»NFILES                                               GET   48
       IF (KOLDI2).EQ.IDATE(I)) Go TO 130                                GET   49
 110   CONTINUE                                                          GET   50
 130   CONTINUE                                                          GET   51
       WRITE  (6,1)  KOLO(2)                                               GET   52
       NGOOD = 0                                                         GET   53
       RETURN                                                             GET   54
 130   CONTINUE                                                          GET   55
156

-------
      1C a 0                                                            GET  56
      IF a 1*10                                                         GET  57
      REWIND IF                                                         GET  56
140   CONTINUE                                                          GET  59
      1C * IC+1                                                         GET  60
      IF (IC.GT.ICT(IF-IO) )  GO TO 150                                   GET  61
      READ (IF) NWDTE»NAMtAPT»PT,XIMPH                                  GET  62
      IF (10(1).NE.NAM(l)) GO TO HO                                    GET  63
      IF                                             GET  78
      GO TO 170                                                         GET  79
C                                                                       GET  80
C DATA RECORDS HAVE GAPS. TRY NEIGHBORING STATION(S)                    GET  81
160   CONTINUE                                                          GET  82
      WRITE  (6,3)  ID.KOLD                                               GET  83
C                                                                       GET  84
C ORDER THE STATIONS AND CHECK THEIR DATA                               GET  85
170   CONTINUE                                                          GET  86
      CALL WSECLS(XS,YSiDIS»IDIS)                                       GET  87
      KCT « 0                                                           GET  88
      NGOOD * o                                                         6ET  89
180   CONTINUE                                                          GET  90
      IF (NGOOD.EQ.NC) GO TO 240                                        GET  91
      KCT » KCT*1                                                        GET  92
      IF (KCT.GT.NUMSTA) GO TO 240                                      GET  93
      KUSE • IDIS(KCT)                                                  GET  94
      NAME(l) " ISTANSd.KUSE)                                          GET  95
      NAME(2) « ISTANS(2.KUSE)                                          GET  96
      DO 190 I o 1»10                                                   GET  97
      IF (KOLD(2).EQ.IDATE(I)) GO TO 200                                GET  98
190   CONTINUE                                                          GET  99
      GO TO 120                                                         GET 10°
200   CONTINUE                                                          GET 101
      1C » 0                                                            GET I02
      IF - 1*10                                                         GET 103
      REWIND IF                                                         GET 104
210   CONTINUE                                                          GEJ. }°5
      READ (IF) NWDTE»NAM»APT,PT,XIMPH                                  GET 106
      ic » ic*i                                                         GET 107
      IF 
-------
 220   CONTINUE                                                           GET 111
       CALL EXTRP(KOLD»PT»ZAZ)                                            GET 112
       IF  (ZAZ.LT.Ot) 60 TO  180                                           GET 113
       CALL EXTRP(KOLD,XIMPH»VELL)                                        GET 11*
       IF  (VELL.LT.O.) GO  TO  180                                          GET 115
       AZV<4*NGOOD*1> * ZAZ                                               GET 116
       AZV(4#NGOOD+2) « VELL                                              GET 117
       AZV(4»NGOOD*3> a APT                                               GET 118
       KD  « NAM(l)                                                        GET 119
       AZV(4*NGOOD*4> « XIO                                               GET 120
       DDIS(NGOOD*1> • SQRT(OIS(KCT))                                     GET 121
       IF  (DIS(KCT).LE.RMIN)  00 TO 230                                    GET 122
       IF    80 TO 240                                    GET 123
 C                                                                        GET 124
 C PERFORM ANGLE TEST                                                     GET 125
       CALL ANGTST(XS.YStNGOODiKUSEiOK)                                   GET 126
       IF  (OK.LT.O.) GO TO 180                                            GET 127
 C                                                                        GET 128
 C PERFORM THE BARRIER TEST                                               GET 129
       XT  « SSTAN(i,KuSE)                                                 GET 130
       YT  • SSTAN(2,KUSE>                                                 GET 131
       CALL BARIER(XT»YT»XS.YS»OK>                                        GET 132
       IF  (OK.LT.O.) GO TO 180                                            GET 133
       NGOOD • NGOOD»1                                                    GET 134
       GO  TO 180                                                          GET 135
 230   CONTINUE                                                           GET 136
       NGOOD » 1                                                          GET 137
 240   CONTINUE                                                           GET 138
       RETURN                                                             GET 139
 1     FORMAT  (//i33H GETAZV  CANT FIND DATE FILE FOR   ,I6i                GET 140
       1           22H  IN  MIND DATA  TABLES..//)                           GET 141
 2     FORMAT  
-------
      SUBROUTINE SETIN                                                  SET   1
C                                                                       SET   2
C     SETIN INITIALIZES WIND STATION NAMES AND COORDINATES,             SET   3
C     COMPftSS POINT AZIMUTHS, AND DISTANCE CRITERIA                     SET   4
C     WRITTEN BY MA HIRSCHBERG                                          SET   5
C     MARCH 1973                                                        SET   6
C                                                                       SET   7
C     ISTANS IS AN ARRAY CONTAINING THE NAMES OF THE WIND STATIONS      SET   8
C                                                                       SET   9
C     SSTAN IS AN ARRAY CONTAINING THE X-Y COORDINATES OF THE WIND STATISET  10
C                                                                       SET  11
C     NUMSTA IS THE NUMBER OF STATIONS                                  SET  12
C                                                                       SET  13
C     RMIN  MINIMUM SQUARED DISTANCE.  THAT  IS, IF A STATION IS LESS    SET  14
C           THAN  SORT(RMIN)  AWAY FROM A CURRENT NODE, ONLY THAT       SET  15
C           STATION WILL 8E USED,                                       SET  16
C                                                                       SET  17
C     RMAX  MAXIMUM SQUARED DISTANCE,  NO STATION FURTHER               SET  18
C           THAN  SORT(RMAX)  FROM A CURRENT NODE WILL BE USED.         SET  19
C                                                                       SET  20
      DIMENSION ISS(2,100)                                              SET  21
      DIMENSION SSTAN(2»51>i ISTANS (2»lOO)                              SET  22
      COMMON /WDATA/ NUMSTA, SSTAN, ISTANS,  RMIN, RMAX                  SET  23
      DATA ISS/4H 1CA.4HP   ,4H6()AZ,4HU   ,4H69BU,4HRK  ,4H7lWE,4HST  ,4SET  24
     1H72L0.4HNB  ,4H74REi4HSD   ,4H75PO»4HMA  ,4H76LEi4HNX   ,4H79PAi4HSASET  25
     2  ,4H80WH,4HTR   ,4H 2L6«4HB   ,4H 3LA,4HX   ,4H 4NT»4HB   ,4H SBUiSET  26
     34HR   ,4H 60N.4HT   ,4H 7BU.4HRK  ,4H  8PM,4HD   ,4H 9WE.4HST  ,4H1SET  27
     40LA,4HCA  »4HHVE»4HN   »4H12PA»4HSA   ,4H13CO,4HMA  »4H14ELf4HM   SET  2B
     5»4H15RB«4H    «4Hl6RVi4HA   ,4Hl7MI*4HSH  ,4H18LO»4HNB  ,4Hl9CP«4HSET  29
     6K    ,4H20AZ,4Hu   »4H2lRE,4HsD   ,4H22WN,4HTT   ,4H23EN,4HC   ,4H24WSET  30
     7H,4HTR  ,4H25MA,4HLC  ,4H26KF»4HI   ,4H27NE,4HW   »4H28PO,4HMA  ,4SET  31
     8H29H0.4HL   »4H30FO,4HX    ,4H3lPI,4HC   ,4H32VE«4HR    ,4H33SA»4HU SET  32
     9  ,4H34RL,4HA    ,4H35SM,4H    ,4H36BK,4HT   ,4H37MD,4HR   ,4H38NP,SET  33
     A4H    ,4H39SP,4H    ,4H4QMW»4HS   ,4H4lZU,4HM   »4H42CO,4HMM  /   SET  34
C                                                                       SET  35
      SSTAN(ltl) • 23.14                                                SET  36
      SSTAN(2il) a 32.95                                                SET  37
      SSTAN(1»2) » 41.03                                                SET  38
      SSTAN(2i2) • 39.29                                                SET  39
      SSTAN(1,3) •- 18.36                                                SET  40
      SSTAN<2,3) * 41.98                                                SET  *l
      SSTAN(1,4) m 11.98                                                SET  42
      SSTAN(2,4) «= 32.67                                                SET  *3
      SSTAN(1,5) - 25.79                                                SET  44
      SSTAN(2,5) = 17.64                                                SET  45
      SSTANI1.6) B 6.83                                                 SET  46
      SSTAN(2,6) » 43.96                                                SET  47
      SSTAN(1,7) » 50.83                                                SET  *8
      SSTAN(2,7) • 34.72                                                SET  49
      SSTANdiS) « 15.48                                                SET  50
      SSTAN(2»8) » 25.07                                                SET  51
      SSTAN(1,9) « 29.49                                                ||T  52
      SSTAN(2f9) ' 39.32                                                SET  53
      SSTAN(1,10) « 35.25                                               SET  54
      SSTAN(2,10) » 24.64                                               SET  55
                                                                                159

-------
       SSTANd ill )
       SSTAN(2tll>
       SSTANdtl2)
       SSTAN(2»12>
       SSTAN(1»13)
       SSTAN(2il3>
       SSTANd.14)
       SSTAN<2.14>
       SSTAN(1»15)
       SSTAN(2il5>
       SSTAN(1,16)
       SSTAN<2»16)
       SSTAN(1,17)
       SSTAN(2il7)
       SSTANdilS)
       SSTAN(2»16>
       SSTAN(1»19)
       SSTAN<2»19)
       SSTAN(li20)
       SSTAN(2t20>
       SSTANd»21>
       SSTAN(2i21)
       SSTANI1 i22>
       SSTAN(2»22)
       SSTAN(1,23)
       SSTAN(2»23)
       SSTANd»24)
       SSTAN<2»24)
       SSTANd ,25)
       SSTAN(2f25)
       SSTANdi26>
       SSTAN(2»26>
       SSTANd»27>
       SSTAN(2,27)
       SSTANd,28)
       SSTAN(2,28)
       SSTANd,29)
       SSTAN(2i29)
       SSTANd ,30)
       SSTAN(2»30>
       SSTANd,31)
       SSTAN(2.31)
       SSTANd»32)
       SSTAN<2»32>
       SSTANd,33)
       SSTAN(2»33)
       SSTANd,34)
       SSTAN(2»34>
       SSTANd,35)
       SSTAN(2,35)
       SSTAN d,36)
       SSTAN(2,36)
       SSTANd,37)
       SSTAN(2,37)
       SSTANd ,38)
  28.18
  17.50
  14,46
  26.20
  33.63
  15.62
  17.14
  43,96
  56.85
  36.56
  19,03
  42.40
  32. 82
  73.54
  12.14
  32.96
  25.01
  44.60
  9.45
  29.62
  29.63
  39.40
  23.00
  22.54
  35,32
  35.66
  14.15
  19.24
  30.93
  26.36
  10.25
  49.12
  26.23
  16.28
  2.36
  44.68
  41.42
  39.88
  6.83
  43.96
  45.75
  29.98
  6.54
  41.26
  35,32
= 24.94
= -3.11
= 32.56
a 35.66
= 21.52
= 6.53
« 57.28
= 51.36
= 34.96
=> 16.16
SET  56
SET  57
SET  58
SET  59
SET  60
SET  61
SET  62
SET  63
SET  64
SET  65
SET  66
SET  67
SET  68
SET  69
SET  70
SET  71
SET  72
SET  73
SET  74
SET  75
SET  76
SET  77
SET  78
SET  79
SET  60
SET  61
SET  62
SET  63
SET  64
SET  65
SET  66
SET  67
SET  88
SET  69
SET  90
SET  91
SET  92
SET  93
SET  94
SET  95
SET  96
SET  97
SET  98
SET  99
SET 100
SET 101
SET 102
SET 103
SET 10*
SET 105
SET 106
SET 107
SET 108
SET 109
SET HO
160

-------
     SSTAN(2t38) a 36.58                                               S£T 111
     SSTAN(li39) = ?4.95                                               SET H2
     SSTAN<2»39> = B1.22                                               SET 113
     SSTAN(1»40> = 15.77                                               SET
     SSTAN(2»4Q> * 33.41                                               SET
     SSTAN(li41) » 24,28                                               SET
     SSTAN<2»41> • 29,92                                               SET I}7
     SSTANIl.42) = 4.39                                                SET H8
     SSTAN(2»42! o 59.02                                               SET 119
     SSTAN(lt43) » 28.12                                               SET }20
     SSTAN(2i43) = 25.00                                               SET 121
     SSTAN(li44) = 8.42                                                SET 122
     SSTAN(2,44) = 30.94                                               «T 12J
     SSTAN(H45) » 49,71                                               SET 124
     SSTAN(2i45) = 36.40                                               SET 125
     SSTANU.46) 3 10.61                                               |^J J"
     SSTAN(2i46> = 2B.48                                               5ET J|7
     SSTANM1.47) c 42.57                                               SET 128
     SSTAN(2,47> = 3.0T                                                »" 129
     SSTANI1.48) = 22.26                                               btT ^°
     SSTAN(2.48) = 10.00                                               SET 131
     SSTAN(1,49) - 33.98                                               SET 132
     SSTANI2.49) " 45.82                                               =ET 133
     SSTAN(lt50) - -11.16                                              HI \t*
     SSTAN(2,50) m 32.02                                               SET 135
     SSTAN<1,S1> - 26.56                                               «T 136
     SSTAN(2.5l) • 30.29                                               ||T 137
                                                                       at I 1 Jo

     RMIN  -  1.                                                         g? HI
     RMAX  -  225'                                                       SET m
               51                                                        £?
      DO  100  1-1.2                                                    !"  1J*
      DO  100  J * liNUMSTA                                               *"   *=
      ISTANS(I.J)  = ISS1I.J)
100    CONTINUE
      RFTURN                                                            SET
      RETURN                                                            SET 150
                                                                                161

-------
       FUNCTION UNIDOT(A»B)                                              UDT    1
 C                                                                       UDT    2
 C         UNIDOT RETURNS THE DOT PRODUCT OF A UNIT VECTOR PARALLEL      UDT    3
 C         TO  A  WITH A UNIT VECTOR PARALLEL TO  B»  ItE. THE COSINE    UDT    4
 C         OF THE ACUTE ANSLE SEPARATING  A  AND  B.                     UDT    5
 C                                                                       UDT    6
       DIMENSION A(3)t B(3)                                              UDT    7
       OENOM « SQRT«A<1)»*2*A<2)««2*A<3>»«2)«#»2)) UDT    8
       UNIDOT » 0.                                                       UDT    9
       IF  (DENOM.EQtO.) RETURN                                           UDT  10
       DO  100 I • 1.3                                                    UDT  11
       UNIDOT « UNIDOT*A(I)*B(I)                                         UDT  12
       CONTINUE                                                          UDT  13
       UNIDOT « UNIDOT/DENOM                                             UDT  14
       RETURN                                                            UDT  15
       END                                                               UDT  16-
       SUBROUTINE UNITV(A»B)                                              UTV   1
 C                                                                       UTV   2
 C RETURNS B THE UNIT VECTOR  PARALLEL  TO  VECTOR  A                         UTV   3
 C                                                                       UTV   4
       DIMENSION A(3)»B(3)                                                UTV   5
 C                                                                       UTV   6
       X = SQRT«»2*A<2)»*2*A<3>»*2>                                  UTV   7
       DO 100 I  « If3                                                    UTV   8
       B(I)  * A(I)/X                                                      UTV   9
 100    CONTINUE                                                           UTV  10
       RETURN                                                            UTV  11
       END                                                               UTV  12-
162

-------
      SUBROUTINE WINDRD(KPWDAT.TITLE .JDATE)                              WRD   1
C                                                                       WRD   2
C     THIS SUBROUTINE READS WIND DATA AND PUTS IT ONTO AS MANY AS  NFILEWRD   3
C     SEPARATE FILES BY DATE.  THE DATES ARE NOT ORDERED.               WRD   4
C     WRITTEN BY MA HIRSCHBERG                                          WRD   5
C     MARCH 1973                                                        WRD   6
C                                                                       WRD   7
      DIMENSION TITLE<20>, JDATE(2>                                     WRD   8
      DIMENSION PT(24),XIMPH(24),10(3*1 .JQ124)                          WRD   9
      DIMENSION NAM(2)                                                  WRD  10
      DIMENSION IDATE(IO). ICT(IO)                                      WRD  11
      COMMON /DATES/ iDATEf ICT» NFILES                                 WRD  *2
      DATA IBLNK/2H  /,NONO/4HNO  /                                     WRD  13
C                                                                       WRD  14
      NFILES = 10                                                       WRD  15
      ISET e 0                                                          WRD  16
      IOLDD = 0                                                         WRD  17
      IFILE = 10                                                        WRD  18
      ICOLD » 0                                                         WRD  19
      IF  (KPWDAT.EQ.NONO) 60 TO  100                                     WRD  20
      CALL NEWPAG(TITLE.O.JDATE)                                        WRD  21
      WRITE (6.1)                                                       WRO  22
      L = 0                                                             WRD  23
C                                                                       WRD  24
100   CONTINUE                                                          WRD  25
      READ (5i2) NWDTE.NAM.APT.PT                                       WRD  26
      IF  (NWDTE.EO.999999) GO TO 200                                    WRD  27
      BACKSPACE 5                                                       WRD  28
      READ (5»3) IQ                                                     WRD  29
      READ (5,4) XIMPH                                                  WRD  3o
      BACKSPACE 5                                                       WRD  31
      READ (5»3) JQ                                                     WRD  32
      IF  (KPWDAT.EQ.NONO) GO TO  120                                     WRD  33
      L x L*l                                                           WRD  34
      IF  (MODIL.51) .NE.O) GO TO  110                                     WRD  35
      CALL NEWPAG(TITLE»0.JDATE)                                        WRD  36
      WRITE (6,1)                                                       WRD  37
110   CONTINUE                                                          WRD  38
      WRITE (6.5) NWDTE.NAM.APT.PT                                      WRD  39
      WRITE (6.6) XIMPH                                                 WRD  40
120   CONTINUE                                                          WRD  41
C                                                                       WRD  42
C         REPLACE MISSING DATA WITH NEGATIVE INPUTS                     WRD  43
C                                                                       WRD  44
      DO  130 K a 1.24                                                   WRD  45
      IF  (IO(K).EQ.IBLNK) PT(K)  « -1.                                   WRD  46
      IF  (JQ(K).EQ.IBLNK) XIMPH(K) « -1.                                «RD  47
130   CONTINUE                                                          WRD  4e
c                                                                       WRD  49
      IF  (NWDTE.EQ.IOLDD) GO TO  170                                     WRD  50
      IOLDO « NWOTE                                                     WRD  51
      IF  (ICOLD.EQ.O) GO TO 150                                         WR0  52
      DO  140 I « 1,ICOLD                                                WRD  53
      IF  (IDATE(I).EQ.NWDTE) GO  TO 160                                  WRD  54
140   CONTINUE                                                          WRD  55
                                                                                163

-------
 150
 C
 160

 170
IF (ICOLO.EQ.NFILES) GO TO 180
CONTINUE
ICOLD « ICOLD*!
IDATE(ICOLD) « NWDTE
I » ICOLD
ICT(ICOLD) « 0
IFILED » 1*10
REWIND IFILED
GO TO 170

CONTINUE
IFILED » IFILE*!
CONTINUE
 £»»»»*»
 C
 C
  ALL LOS ANGELES DATA IS INTERPRETED ON A  16  POINT SCALEt
 C
 180
 190
APT
             16,
WRITE (IFILED)
ICT(IFILED-IO)
GO TO 100
                            NftM .APTiPT»XIMPH
                        ICT(IFILED-10)*1
CONTINUE
IF (ISETtGT.Q) GO TO
WRITE (6*7)  NFILES
ISET « 1
WRITE <6i5>
WRITE <6«6>
GO TO 100
                            190
            NWDTE. NAM, APT. PT
            XIMPH
C
200




210
C

1
2
3
4
5
6
7

CONTINUE
DO 210 I =
IF * 1*10
END FILE IF
REWIND IF
CONTINUE

RETURN
FORMAT (//I
FORMAT (16,
FORMAT (32X
FORMAT (32X
FORMAT (1H
FORMAT (1H
FORMAT (//I
                  liICOLD
                    .50X.9HWIND DATA.//)
              (I6,1X,A4,A2,15X,F2.0,2X,24F2.0)
                  (»24A2)
                  U24F2.0)
                  ,I6,1X.A4,A2,15X,F3.0»2HPT,24F3.0>
                  ,32X,24F3,0)
              (//11H MORE THAN ,I3,4QH DATES HAVE BEEN FOUND IN THE
      1DATA.»/»45H THE FOLLOWING ENTRIES COULD NOT BE ACCEPTED,.//)
       END
     WRD  56
     WRD  57
     WRD  58
     WRD  59
     WRD  60
     WRD  61
     WRD  62
     WRD  63
     WRD  64
     WRD  65
     WRD  66
     WRD  67
     WRD  68
     WRD  69
     WRD  70
     WRD  71
     WRD  72
     WRD  73
     WRo  7*
     WRD  75
     WRD  76
     WRD  77
     WRD  78
     WRD  79
     WRD  80
     WRD  61
     WRD  82
     WRD  83
     WRD  84
     WRD  85
     WRD  86
     WRD  87
     WRD  88
     WRD  89
     WRD  90
     WRD  91
     WRD  92
     WRD  93
     WRD  94
     WRD  95
     W«D  96
     WRD  97
     WRD  98
     WRD  99
WIND WRD 100
     WRD 101
     WRD 102-
164

-------
      SUBROUTINE WINDY(TITLEtJDATE)                                      WIN   1
C                                                                       WIN   2
C     MAIN SUBPROGRAM FOR AIR TRAJECTORY MODULE                         WIN   3
C                                                                       WIN   4
C     WRITTEN BY MA HIRSCHBERG                                          WIN   5
C     MARCH 1973                                                        WIN   6
C                                                                       WIN   7
      DIMENSION TITLE<20>» JDATEI2)                                      WIN   B
      DIMENSION KOLD(2) ,KNEW<2)                                         WIN   9
      DIMENSION DDD(3)                                                  WIN  10
      DIMENSION AZVI12)                                                 WIN  11
      DIMENSION ID(2)»IDD(2)                                            WIN  12
      DIMENSION SSTAN(2.51)t ISTANS(2i100)                              WIN  13
      DIMENSION IDATE(10)iICT (10)                                       WIN  14
      COMMON /WDATA/ NUMSTAi SSTANf iSTANSt RMJNt RMAX                  WIN  15
      COMMON /DATES/  iDATEi ICT. NFILES                                 WIN  16
      COMMON /WIND/ TUOOli V(100)t TH(100)i NPTS                       WIN  17
      COMMON /TRAJ/ TSTART* P(2»100>» IDXX(3tlOO>                       WIN  18
      COMMON /CNTROL/ CARFAC* STAFAC* KSTOPi TSUN                       WIN  19
C                                                                       WIN  20
      DATA DALITE/4HDAYL/»IBLNK/iH  /,IWAS/0/»NONO/4HNO  /               WIN  21
      DATA KYES/4HYES /                                                 WIN  22
      DATA NIT/3/                                                       WIN  23
C                                                                       WIN  24
      IF  (IWAS.GT.o) GO TO 130                                          WIN  25
C                                                                       WIN  26
C         SET UP BUILT IN WIND STATION DATA                             WIN  27
C                                                                       WIN  26
      CALL SETIN                                                        WIN  29
      READ <5»9) KPSTAT»KPWDAT                                          WIN  30
      IF  (KPSTAT.EO.NONO) GO TO  120                                     WIN  31
      CALL NEWPAG(TlTlEfOiJDATE)                                        WIN  32
      WRITE <6tl>                                                       WIN  33
      DO  no I = l.NUMSTA                                               WIN  34
      IF  (MOD(It52),NE.O) 60 TO  100                                     WIN  35
      CALL NEWPAG(TITLE»0»JDATE)                                        WIN  36
      WRITE (6tl)                                                       WIN  37
100   CONTINUE                                                          WIN  36
      WRITE <6i2> ISTANS(liI)iISTANS(2»I>»SSTAN(1•I>»SSTAN(2«I)         WIN  39
110   CONTINUE                                                          WIN  *0
120   CONTINUE                                                          WIN  41
C                                                                       WIN  42
C     READ WIND DATA                                                    WIN  43
      CALL WINDRD(KPWDAT.TITLEtJDATE)                                   WIN  44
      IWAS » 1                                                          WIN  45
C                                                                       WIN  46
C     READ MISCELLANEOUS DATA                                           WIN  47
C                                                                       WIN  48
      READ (Sill) CONVRT                                                WIN  49
      IF  (CONVRT.LE.O.) CONVRT a 1,0                                    WIN  So
      READ (5t9) KXTRA                                                  WIN  51
130   CONTINUE                                                          WIN  52
C                                                                       WIN  53
C     READ CASE DATA                                                    WIN  54
C                                                                       WIN  55
                                                                               165

-------

















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







140
150
c
C IF







160
170
ICASES B 1
IK B 0
READ (5i8) IDT.XLCL
TSUN « Ot
READ (5.9) STIME
IF (STIME. EQ.DALITE) TSUN - 0100.
ILCL B IFIX(XLCL)
1ST n IFIX(XLCL-TSUN)
READ (5.10) ID.XS.YS
READ (5.11) TTOTAL
READ (5.11) DTSEO
ITN B IFIX(60.*OTSEG)
NN « IFIX«TTOTAL*0.9»DTSEG)/DTSEG)
READ (5.11) AZ.VEL
READ (5.12) ITF
READ (5.12) IRF
READ (5.12) NC

IDT DATE YEAR-MONTH-DAY
ID STATION IDENTIFICATION 
-------
C                                                                       WIN  111
C     PRINT THE INITIAL INPUTS                                          WIN  112
C                                                                       WIN  113
      CALL NEWPAG(TITLE»0»JDATE)                                        WIN  114
      WRITE (6,13) IDT.ILCL                                             WIN  115
      IF (TSUN.EQ.O.) WRITE  (6,14)                                      WIN  H6
      IF (TSUN.EQ.0100,1 WRITE  (6*15)                                   WIN  117
      WRITE (6.16) XS,YS                                                WIN  118
      IF (ID(1).EQ.IBLNK) WRITE  (6,17)                                  WIN  119
      IF (ID(l).NE.IBLNK) WRITE  (6,18) ID                               WIN  120
      WRITE (6,19)                                                      WIN  121
      IF (VEL.6T.O.) WRITE  (6,20) AZ.VEL                                WIN  122
      WRITE (6.21)                                                      WIN  123
      IF (ITF.GE.O) WRITE (6,22)                                        WIN  124
      IF (ITF.LT.O) WRITE (6,23)                                        WIN  J25
      WRITE (6.24) TTOTAL                                               WIN  126
      WRITE (6,25) DTSEG                                                WIN  127
      WRITE (6*26) NC                                                   WIN  126
      IF (IRF.EQ.l) WRITE (6,27)                                        WIN  129
      IF (IRF.EQ.2) WRITE (6*28)                                        WIN  130
C                                                                       WIN  131
      KOLD(l)  = 1ST                                                     WIN  132
      KOLD<2>  * IDT                                                     WIN  133
      KNEW(l)  B 1ST                                                     WIN  134
      KN£W(2)  « IDT                                                     WIN  135
      IDD(l) • 10(1)                                                    WIN  136
      100(2) • ID(2)                                                    WIN  137
      IF (ITF.LT.O) CALL DATE(KQLD,IjNilTF,KNEW)                        WIN  138
      IF (VEL.6T.O.) 60 TO  190                                          WIN  139
      CALL GETAZV(KNEW,lDO.XS,YS,NC.AZViNGD»DDD)                        WIN  140
      IF (NGD.LE.O) 00 TO 180                                           WIN  141
      CALL AZVDIS(NGD»AZV»DDD»AZ,VEL,IRF)                               WIN  142
      60 TO 190                                                         WIN  143
180   CONTINUE                                                          WIN  144
      IK • IK-1                                                         WIN  145
      WRITE (6,3)                                                       WIN  146
      00 TO 280                                                         WIN  147
C                                                                       WIN  146
190   CONTINUE                                                          WIN  149
      IK * 1                                                            WIN  ISO
      P(l.l) * XS                                                       WIN  151
      P(2,l) » YS                                                       WIN  152
      NTM » 0                                                           WIN  153
      XMUL " DTSEG                                                      WIN  154
      IF (ITF.GT.O) GO TO 200                                           WIN  155
      XMUL « -DTSEG                                                     WIN  156
      T(l)  « FLOAT (KOLDUM                                              WIN  157
      IK • 2                                                            WIN  156
      GO TO 250                                                         "IN  159
200   CONTINUE                                                          WIN  16°
      IF (KXTRA.EO.KYES) WRITE  (6.4)  KOLDtXSiYS                         WIN  161
      IF (ITF.GT.O) GO TO 210                                           WIN  162
      KOLD(l)  « KNEW(l)                                                 WIN  163
      KOLD12)  * KNEWI2)                                                 WIN  164
210   CONTINUE                                                          WIN  165
                                                                               167

-------
 C                                                                        WIN 166
 C     APPLY MOVE NOW TO GET NEW POINT                                    WIN 167
       ANG • 90.-AZ                                                       WIN 168
       IF (ANO.LT.O.) ANG « ANG*360.                                      WIN 169
       ANGUSE » ANG/57,89577951                                           WIN 170
       T(IK) * FLOATIKOLDfl)>                                             WIN 171
       V(IK) » VEL»CONVRT                                                 WIN 172
       TH(IK) s ANGUSE                                                    WIN 173
       IF (KXTRA.EQ.KYES) WRITE  (6»5) KOLDfVEL»ANG«(AZVII=4»12t4)      WIN 174
       XNEW « XS*XMUL»COS(ANGUSE)»VEL                                     WIN 175
       YNEW « YS»XMUL«SIN(ANGUSE)*VEL                                     WIN 176
       CALL BARIER(XNEWtYNEW,XS,YS.OK)                                    WIN 177
       IF (OK.LT.O.) GO TO 320                                            WIN 178
       CALL EDGE(XNEWiYNEW.ITFiIEDGE)                                     WIN 179
       IF (IEOGE) 330.230i220                                             WIN 180
 220   CONTINUE                                                           WIN 181
       IF (NTM.GE.NN) GO TO 280                                           WIN 182
       NN • NTM*1                                                         WIN 183
 230   CONTINUE                                                           WIN 184
       XS • XNEW                                                          WIN 185
       YS - YNEW                                                          WIN 186
 C                                                                        WIN 187
 C     LAST MOVE CHECK                                                    WIN 188
       IF (NTM.GE.NN) GO TO 280                                           WIN 189
 C                                                                        WIN 190
       IK • IK»1                                                          WIN 191
 C                                                                        WIN 192
 C     CHANGE DATE                                                        WIN 193
       CALL OAT£(KOLDiITNtITF.KNEW)                                       WIN 194
       IF (ITF.LT.O) GO TO 240                                            WIN 195
       KOLD(l) * KNEW(l)                                                  WIN 196
       KOLOI2) » KNEWI2)                                                  WIN 197
 240   CONTINUE                                                           WIN 198
       IDD(l) » IBLNK                                                     WIN 199
       IDD<2) * IBLNK                                                     WIN 200
       CALL GETAZV(KNEW,IDD»XS.YS,Nc.AZVtNGD»DDD)                         WIN 201
       IF (NGO.LE.O) GO TO 180                                            WIN 202
       CALL AZVDIS(NGOiAZV«DDDtAZ|VEL»IRF)                                WIN 203
 C                                                                        WIN 204
 C     WE JUST GOT A NEW AZIMUTH AND VELOCITY                             WIN 205
 C     IF WE ARE MOVING BACKWARD IN TIME* THERE FOLLOW  NIT   ITERATIONS   WIN 206
 c     TO REFINE THE AZIMUTH AND VELOCITY.                                WIN 207
 C     (NIT  IS SET IN A DATA STATEMENT ABOVE.)                           WIN 208
 C                                                                        WIN 209
       IF (ITF.GT.O) GO TO 270                                            WIN 210
 C                                                                        WIN 211
 250   CONTINUE                                                           WIN 212
       IF (NIT.EQ.O) GO TO 27Q                                            WIN 213
       DO 260 IT » l.NIT                                                  WIN 214
       ANG1  a 90."AZ                                                      WIN 215
       IF (ANG1.LT.O.)  ANG1 » ANG1*360.                                   WIN 216
       ANGYU = ANG1/57.29577951                                           WJN 217
       XNUT  B XS+XMUL»COS(ANGYU)*VEL                                      WIN 218
       YNUT  e YS+XMUL»SIN(ANGYU)«VEL                                      WIN 219
       CALL  BA«IEH(XNUT,YNUT,XS,YS,OK)                                    WIN 220
168

-------
      IF (OK.LT.O) GO TO 310                                            WIN 221
      IDO(l)  * IBLNK                                                    WIN 222
      100(2)  « IBLNK                                                    WIN 223
      CALL  GETAZV(KNEW,IDD»XNUT»YNUT»NC»AZV»NGO»DDD)                    WIN 224
      IF (NGD.LE.O) GO TO 180                                           WIN 225
      CALL  AZVDIS(NGDtAZVtDDDiAZtVELiIRF)                               WIN 226
260   CONTINUE                                                          WIN 227
270   CONTINUE                                                          WIN 228
      NTM B NTM*1                                                       WIN 229
      GO TO 200                                                         WIN 230
C                                                                       WIN 231
280   CONTINUE                                                          WIN 232
      NPTS  = IK                                                         WIN 233
C                                                                       WIN 234
      IF (ITF.GT.O) GO TO 300                                           WIN 235
C                                                                       WIN 236
C     REVERSE THE ORDER OF THE TIME» VELOCITY* ftND ANGLE LISTS          WIN 237
c                                                                       WIN 23e
      NXY = (IK-MOD(IK,2))/2                                            WIN 239
      DO 290 K B  l.NXY                                                  WIN 240
      J = IK-K*1                                                        WIN 241
      TT = T(K)                                                         WIN 242
      T(K)  m T(J)                                                       WIN 243
      T(J)  » TT                                                         WIN 244
      VV « V (K)                                                         WIN 245
      V(K)  « V(J)                                                       WIN 246
      V(J)  • VV                                                         WIN 247
      AA v TH(K)                                                        WIN 248
      TH(K) » TH(J)                                                     WIN 249
      TH(J) > AA                                                        WIN 250
290   CONTINUE                                                          WIN 261
      V(IK) « VUK-1)                                                   WIN 252
      TH(IK) « TH(IK-l)                                                 WIN 253
      P(lil) B XS                                                       WIN 254
      P(2il) • YS                                                       WIN 255
300   CONTINUE                                                          WIN 256
      RETURN                                                            WIN 257
c                                                                       WIN 256
C  PRINT MESSAGE                                                         W*N 2*9
310   CONTINUE                                                          WIN 260
      IK « IK-1                                                         WIN 261
      XNEW « XNUT                                                       WIN f<>2
      YNEW • YNUT                                                       WIN 263
320   CONTINUE                                                          JjJN 264
      WRITE (6,6) XS.YS.XNEW.YNEW                                       WIN 265
      GO TO 280                                                         WIN 266
330   CONTINUE                                                          WIN 267
      IK « IK-1                                                         WIN 266
      WRITE (6,7)                                                       «N |M
      GO TO 280                                                         WIN 27°
c                                                                       WIN 271
1     FORMAT  (//10X.25H STATIONS AND COORDINATES*/)                     WIN 272
2     FORMAT  (1H  10X.2A4.2F10.2)                                        WIN 273
3     FORMAT  (26HOTHERE ARE NO CLOSE POINTS)                            "IN 274
4     FORMAT  (1H  ,I6,4X,I6,4X,2F6.2)                                    WIN 275
                                                                               169

-------
 5
 6
 7
 e
 9
 10
 11
 12
 13

 14
 15
 16
 17
 18
 19

 20
 21
 22
 23
 24
 25
 26
 27
 28
1
1
FORMAT
FORMAT
FORMAT
FORMAT
FORMAT
FORMAT
FORMAT
FORMAT
FORMAT
  47H
FORMAT
FORMAT
FORMAT
FORMAT
FORMAT
FORMAT
  56H
FORMAT
FORMAT
FORMAT
FORMAT
FORMAT
FORMAT
FORMAT
FORMAT
FORMAT
END
        
        (40X.I2)
        (///,33H  AIR TRAJECTORY CALCULATION DATA »///
                                                           WIN
                                                           WIN
                                                           WIN
                                                           WIN
                                                           WIN
                                                           WIN
                                                           WIN
                                                           WIN
                                                           WIN
   START DATE AND LOCAL  TIME AT INITIAL POINT,I3X,16t4X,I*)WIN
<1H*»73X»20H HRS (STANDARD TIME))                           WIN
(1H*»73X,20H HRS (DAYLIGHT TIME))                           WIN
(  /.30H     LOCATION OF  INITIAL POINT,30X,F6.2i4X,F6,2t3X) WIN
(1H*,76X,30H(NOT AT A MEASUREMENT  STATION))                 WIN
(1H*,78X,1H(,A4,A2»22H  MEASUREMENT STATION))              WIN
(/*                                                         WIN
   PRESCRIBED STARTING AZIMUTH  AND VELOCITY  (OPTIONAL)  )   WIN
<1H*,S9X,F6,2»4X,F6.2»4H MPH)                               WIN
(  /.40H     DIRECTION OF TRAJECTORY DEVELOPMENT  )           WIN
(1H»,59X,7HFORWARD )                                        WIN
<1H*,59X,8HBACKWARD )                                       WIN
(  X.32H     DESIRED TRAJECTORY  DURATION,28X,F5,1,4H HRS )   WIN
(  X,30H     TRAJECTORY SEGMENT  LENGTH,30X,F5,1,4H  HRS )     WIN
(  X.42H     WIND MEASUREMENT INTERPOLATION SCHEME,1BX, II)   WIN
(1H*,60X,39H  CLOSEST STATIONS  WITH  1/R   WEIGHTING i//>   WIN
(1H*,60X,42H  CLOSEST STATIONS  WITH  1/R«*2   WEIGHTING  ,//)WIN
                                                           WIN
276
277
276
279
280
281
262
283
264
265
286
287
286
289
290
291
292
293
294
295
296
297
296
299
300
301
302-
170

-------
      SUBROUTINE WSECLS(XiY.DISiIDIS)                                   WSE   1
C                                                                       WSE   2
C         THIS SUBROUTINE CALCULATES SQUARED DISTANCES FROM A GIVEN     WSE   3
C         POINT TO EACH OF A SET OF POINTS ANO THEN ORDERS THE DISTANCESWSE   4
C         OUT TO A MAXIMUM VALUE,                                       WSE   5
C                                                                       WSE   6
C         X         X COORDINATE OF GIVEN POINT                         WSE   7
C         V         Y COORDINATE OF GIVEN POINT                         WSE   8
C         DIS       THE SQUARE OF THE DISTANCE FROM THE GIVEN POINT TO  WSE   9
C                   ALL THE POINTS IN THE POINT SET,  THOSE VALUES OF   WSE  10
C                   DIS LESS THAN RMAX ARE ARRANGED IN INCREASING       WSE  11
C                   ORDER AT THE TOP OF THE TABLE.                      WSE  12
C         IDIS      THE NUMBER OF THE POINT IN THE POINT S£T            WS£  13
C                   CORRESPONDING TO THE DIS ARRAY                      WS£  14
C                                                                       WSE  15
      DIMENSION DIS<2)t IDIStg)                                         WSE  16
      DIMENSION SSTAN(2iSl). ISTANS(2»100)                              WSE  17
      COMMON /WDATA/ NUMSTA, SSTAN,  ISTANS, RMINi RMAX                  WSE  18
C                                                                       WSE  19
      DO loo I » ItNUMSTA                                               WSE  20
      IDIS(I) » I                                                       WSE  21
      DIs(I) «  (SSTAN(1,I)-X) »«2* *»2                    WSE  22
100   CONTINUE                                                          WSE  23
C                                                                       WSE  24
      00 110 N » 1,NUMSTA                                               WSE  25
      M B NUMSTA+1-N                                                    WSE  26
      CALL FMINF(DISlN) ,M,FMIN,NMIN)                                    WSE  27
      NMIN « NMIN*N-1                                                   WSE  28
      IF (FMIN.GT.RMAX) GO TO 120                                       WSE  29
      J = IDIS(N)                                                       WSE  30
      IDIS(N) » IDIS(NMIN)                                              WSE  31
      IDIS(NMIN) « J                                                    WSE  32
      XX B DIS(N)                                                       WSE  33
      DIS(N) • FMIN                                                     WSE  3*
      DIS(NMIN) » XX                                                    WSE  35
 110   CONTINUE                                                          JSE  36

 120   RETURN                                                            WSE  3e
      END                                                               *SE  39-
                                                                               171

-------
172

-------
F.3  FLUX GENERATION MODULE

-------
      FUNCTION CLOCKT(TSTART.DT)                                         CLO   1
C                                                                       CUO   2
C         CLOCK! RETURNS MILITARY CLOCK TIME AT TSTART * DT             CLO   3
c              TSTART * INITIAL CLOCK TIME                              CLO   4
C                  Of * ELAPSED TIME IN MINUTES                         CLO   5
C                                                                       CLO   6
      XMIN • AMOD(TSTARTilOOt)                                           CLO   7
      HRS » TSTART-XMIN                                                 CLO   8
      XMIN * XMIN*DT                                                    CLO   9
      RMIN « AMOD(XMIN.60.)                                              CLO  10
      HRS » HRS*100.»(XMIN-RMIN)/60.                                    CLO  11
      CLOCKT » HRS*RMIN                                                 CLO  12
      IF (CLOCKT.GT.2400.) CLOCKT • AMOD(CLOCKTf2400.)                  CLO  13
      RETURN                                                            CLO  14
      END                                                               CLO  15-
      FUNCTION DECMAL(A)                                                 DEC   1
C                                                                       DEC   2
C         GIVEN THE VECTOR  A  CONTAINING AN ANGLE IN DEGREESf          DEC   3
C         MINUTESi AND SECONDSt  DECMAL  RETURNS THE ANGLE IN           DEC   4
C         DECIMAL DEGREES                                               DEC   5
C                                                                       DEC   6
      DIMENSION A(3)                                                     DEC   7
      DECMAL « A(l>*A<2>/60.*A(3>/3600«                                 DEC   8
      RETURN                                                            DEC   9
      END                                                               DEC  10-
                                                                               173

-------
       SUBROUTINE EFFLUX(TITLEtJDATE)                                     EFF   1
 C                                                                        EFF   2
 C         MAIN SUBPROGRAM FOR FLUX GENERATION MODULE                     EFF   3
 C                                                                        EFF   4
       DIMENSION TITLE<20>, JDATE12),  ICHAR(26)                           EFF   5
       DIMENSION TX<4)» NDX(4)i KSYM(SO)                                  EFF   6
       EQUIVALENCE  i  I0(2«100)                          EFF   9
       COMMON /CROSS/  TC<500)i PC(2,500)i  IDC<2»500)»  NC                  EFF  10
       COMMON /SKDULE/ SCMED1500). IDS(2i500)t KTMAX                      EFF  11
       COMMON /GRID/ Xl»X2»Yl«Y2'NX«NY»DELX»DELY»DELT                     EFF  12
       COMMON /COLDST/ NBETA. TCS(20).  CSF(20»3)                          EFF  13
       COMMON /TABLES/ THOUR124),  TZ(8)i  YFR{6)                           EFF  U
       COMMON /CNTROL/ CARFAC, STAFACi  KSTOPi TSUN                        EFF  15
       DATA    ICHAR/1HA,1HB»1HC»1HD»1HE»1HF»1HG,1HH,1HI»1HJ,1HK»1HL,1HM»EFF  16
      1              1HN»1HO»1HP,IHQ,1HR»1HS»1HT»1HU,1HV»1HW|1HX,1HY»1HZ/EFF  17
       DATA K1MAX/24/, K3MAX/8/                                           EFF  18
       DATA NCMAX/500/» JTMAX/500/                                        EFF  19
       DATA SRD/57.29577951/                                              EFF  20
       DATA NONO/4HNO  /                                                  EFF  21
 C                                                                        EFF  22
       KSTOP » 0                                                          EFF  23
       CALL SETUP                                                         EFF  24
       IF  (NPTS.GE.2)  GO TO 100                                           EFF  25
       KSTOP « 1                                                          EFF  26
       WRITE (6,5)                                                        EFF  27
       RETURN                                                             EFF  28
 100   CONTINUE                                                           EFF  29
 C                                                                        EFF  30
 C         TABULATE ALL TIMES ASSOCIATED  WITH GRID LINE CROSSINGS         EFF  31
 C                                                                        EFF  32
       NC  B 0                                                             EFF  33
       KSYM(l)  * ICHAR(l)                                                 EFF  34
       DO  250 K « 2,NPTS                                                  EFF  35
       L « K-l                                                            EFF  36
       DELT « T(K)-T(L)                                                   EFF  37
       VX  « V(L)»COS(TH(L))                                               EFF  38
       VY  * V(L)»SIN(TH(L>)                                               EFF  39
       CALL PLACIT(DELT,L,VX,VY»P(1,K),ID<1,KM                           EFF  40
       TSAVE =0.                                                         EFF  41
       TXMAX « 9999,                                                      EFF  42
       IF  (VX.NE.O,) TXMAX = ABS(DELX/VX)                                 EFF  43
       TYMAX a 9999.                                                      EFF  44
       IF  (VY.NE.Ot) TYMAX » ABSIDELY/VY)                                 EFF  45
       RX  o P(1,L)-(ID(1.L)-D«DELX                                       EFF  46
       RY  « P(2»L)"(ID(2tL)"l)»&ELY                                       EFF  *7
 110   IF  (VX)  120,130,140                                                EFF  48
 120   TX(D  » -RX/VX                                                     EFF  49
       GO  TO 150                                                          EFF  50
 130   TX(l)  • 9999.                                                      EFF  51
       GO  TO 150                                                          Epp  5?
 140   TX(1)  » 
-------
160   TY = -RY/VY                                                       EFF   56
      GO TO 190                                                         EFF   57
170   TY • 9999.                                                        EFF   58
      GO TO 190                                                         EFF   59
180   TY = »IDC<1»NC>>                      EFF   70
      IF (NC.EQ.NCMAX) GO TO 260                                        EFF   71
      TSAVE » TNXT                                                      EFF   72
      TNXT • TNXT»TSNX                                                  EFF   73
      IF (TNXT-OELT) 210,210,220                                        EFF   74
210   IF (TNXT-TB) 200,200,230                                          EFF   75
220   IF (DELT-TB) 240»230t230                                          EFF   76
230   CONTINUE                                                          EFF   77
      NC « NC*1                                                         EFF   78
      TC(NC)  » TID+T8                                                  EFF  79
      CALL PLACIT(TB,L.VX,VY,PC(1»NC) iIDC(l»NC))                        EFF  BO
      IF (NC.EQ.NCMAX) GO TO 260                                        EFF  81
      TSAVE " TB                                                        EFF  82
      RX « PC(1,NC)--1)«DELY                                  EFF  84
      GO TO 110                                                         EFF  85
2*0   CONTINUE                                                          EFF  86
      KK * K                                                            EFF  87
      IF (K.GT.26) KK « MOD(K,26)                                       EFF  88
      IF (K.EQ.52) KK « 26                                              EFF  89
      KSYM(K) * ICHAR(KK)                                               EFF  90
      CALL PLTPNT(P(1,K),P(2,K) ,KSYM(K))                                 EFF  91
250   CONTINUE                                                          EFF  '2
      GO TO 270                                                         EFF  93
260   KSTOP » 2                                                         EFT  94
      NPTS • K                                                          EPP  95
270   CONTINUE                                                          E?F  9*
      K « NPTS                                                          EFF  97
r                                                                       EFF  98
C         PRINT GRID LOCATIONS AND WIND VECTORS AT TRAJECTORY NODES     EFF  99
c                                                                       EFF 100
      CALL NEWPAG(TITLE,0»JOATE)                                        EFP 101
      WRITE (6,1)                                                        EFF 102
      DO 290 L • 1,K                                                    EFF 103
      IF (MOD(L»25).NE.O) GO TO 280                                     EFF 104
      CALL NEWPAG(TITLE.O,JDATE)                                        EFF 105
      WRITE (6,1)                                                        *££ }°*
280   CONTINUE                                                          EFF 107
      VV . V(L)«60.                                                      EFF 108
      AN6 « TH(L)*SRD                                                   EFF 109
      WRITE (6,2)  KSYM(L),T(L),ID(1,L),ID(2,L),P(1,L),P(2,L),VV,ANG     EFF Ho
                                                                               175

-------
  29o    CONTINUE                                                            EFF  111
  C                                                                         EFF  112
        CALL  PLTOUTI6)                                                      EFF  113
  C                                                                         EFF  114
        CALL  NEWPAG(TITLE.O»JDATE)                                          EFF  115
        WRITE (6.3)                                                         EFF  116
        DO  310  I  *  IfNC                                                     EFF  117
        IF  (MOO(L.25).NE.O)  60 TO 300                                      EFF  118
        CALL  NEWPAG(TITLE»0»JDATE)                                          EFF  119
        WRITE (6i3)                                                         EFF  120
  300    CONTINUE                                                            EFF  121
        WRITE (6,4)  TC(L) iPCU.L) iPC(2.L)iIDC(lfL)»IDC(2»L)                EFF  122
  310    CONTINUE                                                            EFF  123
  C                                                                         EFF  124
        IF  (KSTOP.EQ.2)  WRITE  (6,6)                                         EFF  125
        KSTOP « 0                                                           EFF  126
  C                                                                         EFF  127
  C         ASSEMBLE SCHEDULE  OF  FLUX CHANGE TIMES                         EFF  128
  C                                                                         EFF  129
        K2MAX • NC                                                          EFF  130
        K4MAX « NBETA                                                      EFF  131
        NT  •  4                                                              EFF  132
        STRT  »  TIMIN(TSTART)                    ,                            EFF  133
        SCHED(l)  *  STRT                                                     EFF  134
        TEND  «  STRT»T(K>                                                    EFF  135
        J » 2                                                              EFF  136
        DAYS  »  1.                                                           EFF  137
        CALL  XMIT(-NT»1»NDX)                                                EFF  138
  320    CONTINUE                                                            EFF  139
        TMAX  «  AMINKDAYS«1440.tTEND)                                       EFF  140
        DELM  •  1440.«(DArS-l.)                                              EFF  141
  330    TX(l)  =. THOUR(K1)*DELM                                             EFF  142
        IF  (K1.GT.K1MAX)  TX(l)  =  TMAX                                      EFF  143
        TX(2)  ' STRT*TC(K2)                                                 EFF  144
        IF  (K2.GT.K2MAX)  TX(2)  »  TMAX                                      EFF  145
        TX(3)  m TZ(K3)*OELM                                                 EFF  146
        IF  (K3.GT.K3MAX)  TX(3)  »  TMAX                                      EFF  147
        TX(4)  • TCS(K4)*DELM                                                EFF  148
        IF  (K4.GT.K4MAX)  TX<4)  »  TMAX                                      EFF  149
        CALL  FMINF(TX.NT.TMIN.NMIN)                                         EFF  150
        NDX(NMIN) .  NDX(NMIN)*!                                             EFF  jsj
        IF  (TMIN.LE.STRT)  GO  TO 330                                         EFF  152
        IF  (TMIN.EO.SCHED(J-l)I GO  TO 330                                   EFF  153
        SCHEO(J)  *  TMIN                                                     EFF  154
        IF  (TMIN.GE.TMAX)  GO  TO 340                                         EFF  155
        IF  (J.EQ.JTMAX)  GO TO  350                                          EFF  156
        J • J*!                                                             EFF  157
        GO  TO 330                                                           EFF  15B
  340    IF  (TMAX.EQ.TEND)  GO  TO 360                                         EFF  159
        DAYS  *  DAYS*!.                                                      EFF  HQ

        Kl  =  }                                                              EFF  161
        K4  I                                                                EFF  162
        K*  "  l                                                              EFF  163
        J B J*1                                                             EFF  164
        GO  TO 320                                                           EFF  165
176

-------
C                                                                        EFF  166
c         TABULATE GRID SQUARE INDICES ASSOCIATED WITH FLUX CHANGE TIMESEFF  i&7
C                                                                        EFF  168
350   CONTINUE                                                           EFF  169
      KSTOP a 2                                                          EFF  170
360   CONTINUE                                                           EFF  171
      IF (KSTOP.EQ.2)  WRITE (6t6)                                         EFF  172
      KTMAX - J                                                          EFF  173
      I « IDU.l)                                                         EFF  17*
      J » !D(2.1)                                                         EFF  175
      KT « 1                                                             EFF  176
      L = 0                                                              EFF  177
370   L = L*l                                                            EFF  178
      TIM a STRT*TC(L)                                                    EFF  179
      IF (NO 380t380i390                                                EFF  180
380   TIM « SCHED(KTMAX)*1.0                                             EFF  181
390   DO 400 K " KTiKTMAX                                                EFF  182
      IF (SCHED(K).GEtTIM)  GO TO 410                                     EFF  183
      IDS(ltK) a I                                                       EFF  184
      IDS(2,K) « J                                                       EFF  185
400   CONTINUE                                                           EFF  186
      GO TO 430                                                          EFF  187
410   KT « K                                                             EFF  188
      I » IDCU»L>                                                       EFF  189
      J • IDC(2,L)                                                       EFF  190
      IF (I.GT.NX.OR.J.GT.NY)  GO TO 420                                  EFF  191
      IF (L-NC) 370»380,380                                              EFF  192
420   KTMAX * K-l                                                         EFF  193
430   CONTINUE                                                           EFF  194
C                                                                        EFF  195
      CALL FLXDAT(TITLE.JDATE)                                           EFF  196
C                                                                        EFF  197
      RETURN                                                            EFF  196
C                                                                       EFF  199
C                                                                       EFF 200
1     FORMAT  (IHOilSHTRAJECTORY DATA,/                                  EFF 201
     1  1HO,48H  SYMBOL  T(MIN)     I     J     X(MI)     Y(MI),        EFF 202
     2  5X,15HV(MPH>     THETA )                                         EFF 203
2     FORMAT  (/6X»Al,Fl0.2t2l6,4F10.2>                                  £FF 204
3     FORMAT  
-------
 c
 c
 c
 SUBROUTINE FLXDAT(TITLE,JDATEI

     FLXDAT COMPUTES A SCHEDULE  OF POLLUTANT FLUXES
     ALONG THE TRAJECTORY

 DIMENSION TITLE<20>» JDATEI2)
 DIMENSION TFWY(24), TSRFI24), TS(500), LBL(3)
 DIMENSION TPPL(24)» TMSC<24)« VHTOTO)
 COMMON /DATFL1/ FFWY(25,25), FSRF(25,25), FXN02 (25,25) ,
1                FXHCR(25,25), FPPN02(30,3)» FORN02(30t3),
2                FORHCR(30»3)
        /DATFL2/ FSLOW(25,25,4)
        /DATFL3/ FFAST(25,25,4)
        /DATFL4/ FRATIO(25«25»4)
        /WIND/ T(ioo>, vdooi, THUOO>» NPTS
        /TRAJ/ TSTART, P(2,100),  10(2,100)
        /CROSS/ TCI500), PC(2»500)» IDC(2,500),  NC
        /SKDULE/ SCHEDI500), IDS(2,500), KTMAX
        /GRID/ X1,X2,Y1,Y2,NX,NY,DELX,DELY,DELT
        /EMIT/ HEMFI3), CEMFI3)
        /SPDFCT/ A(3), 6(3), C(3), VBAR
                 NBETA, TCS(20),  CSF(20,3)
                 THOURI24) ,  TY(8) , YFR(8)
                 CARFACi STAFAC,  KSTOP, TSUN
                 FYFACI3),  SSFACO),  PPFAC,  ORFAC(2)»  FXFAC(2)
                 FLXIN(3,500), FLXTIM(SOO),  NFLUX
                  C1/2.58999E06/,  C3/907.185/,  C5/0.704/
                       ,4HCO  /
                              0.0591, 0,0768,  0.0648,  0,0536,
                              3*0.0746, 0,0598,  5«0.0302/
 DATA TSRF/6«0.00677. 0,0293, 2*0.0651, 2*0.0502,  5*0.06088,
                               4*0.03077/
                                  6»0.01666/
                                  6*0.01666/
       COMMON
       COMMON
       COMMON
       COMMON
       COMMON
       COMMON
       COMMON
       COMMON
       COMMON
       COMMON
       COMMON
       COMMON
       COMMON
       COMMON
       COMMON
       DATA
       DATA
       DATA
                                                                  FLX
                                                                  FLX
                                                                  FLX
                                                                  FLX
                                                                  FLX
                                                                  FLX
                                                                  FLX
                                                                  FLX
                                                                  FLX
                                                                  FLX
                                                                  FLX
                                                                  FLX  12
                                                                  FLX  13
                                                                  FLX
                                                                  FLX
      1
       DATA
       DATA
       DATA
       /COLDST/
       /TABLES/
       /CNTROL/
       /ADJUST/
       /FLUXES/
     RHO/1.178/,
     LBL/4HNO  ,4HHC
     TFWY/5»0«00776» 0.0178,
          4*0.04940, 0.0569,
     TSRF/6»0,00677. 0,0293,
          2*0.0820, 2*0.0540,
     TPPL/6»0,01666, 12*0,06667,
     TMSC/6»0.01666, 12*0.06667,
     NPPL/30/» NORF/30/
NXY * NX»NY
STRT • TIMIN(TSTART)
AREA » DELX«DELY
C2 « l./(60.»RHO«AREA*Cl)
C4 • 30./46.
CALL NEWPAG(TITLE»0,JDATE)
WRITE (6,1)

    STEP THROUGH SCHEDULE  OF FLUX CHANGE TIMES

DO 160 U = 1 ,KTMAX
TS(L) = CLOCKT(0.,SCHED(L))
FLxTIM(L)  = SCHED(L)-SCHED(1)
TM = AMOD(SCHED(L>,1440.)
I = IDS11.L)
J = IDS(2,L)
M * 1*MOD(IFIX((TS(L)*0.001>/100.)t24)

    STATIONARY SOURCE  CONTRIBUTIONS IN  SO I,J AT TIME TS (KG/HR)
                                                                               1
                                                                               2
                                                                               3
                                                                               4
                                                                               5
                                                                               6
                                                                               7
                                                                               8
                                                                               9
                                                                              10
                                                                              11
     14
     15
FLX  16
FLX  17
FLX
FLX
     18
     19
FLX  20
FLX  21
FLX  22
FLX  23
FLX  24
FLX  25
FLX  26
FLX  27
FLX  28
FLX  29
FLX  30
FLX  31
FLX  32
FLX  33
FLX  34
FLX  35
FLX  36
FLX  37
FLX  38
FLX  39
FLX  40
FLX  41
FLX  42
FLX  43
FLX  44
FLX  45
FLX  46
FLX  47
FLX  4fl
FLX  49
FLX  50
FLX  51
FLX  52
FLX  53
FLX  54
FLX  55
178

-------
c                                                                       FU  56
      PPN02 « o.                                                        FLX  57
      DO 100 K = liNPPL                                                 FLX  58
      IF ) .NE.I.OR.MIXER(FPPN02(K,2)).NE.J) GO TO 100 FLX  59
      PPNO? » PPFAC»FPPN02(K.3)                                         FLX  60
      60 TO 110                                                         FLX  61
100   CONTINUE                                                          FLX  62
110   CONTINUE                                                          FLX  63
      ORN02 n o.                                                        FLX  64
      DO 120 K * liNORF                                                 FLX  65
      IF (MIXER(FORN02(K,1)) ,NE,I.OR.MIXER(FORN02(K,2)).NE,J) GO TO 120 FLX  66
      ORN02 * ORFAC(1)»FORN02 iFRATIO«4.NXY.VBAR)                FLX  88
      VSLO • SPEEDF(TMtTHOUR(6)tFSLOW(ItJil>*4,NXY»VBAR>                FLX  89
      SRFMI » TSRF(M)»FSRF(I»J)                                         FLX  90
      FWYMI m TFWY(M)»FFWY(I,J)                                         FLX  91
      WTFST « FWYMI/(1.*ROFT)                                           FLX  92
      WTSLO * WTFST»ROFT                                                FLX  93
C                                                                       FLX  94
C         VEHICLE SOURCE CONTRIBUTIONS IN SO IiJ AT TIME TS  (KO/HR)     FLX  95
C                                                                       FLX  96
      DO 160 N « 1.3                                                    FLX  97
      EMF » YOFT»CEMF(N)*(1.-YOFT)*H£MF(N)                              FLX  98
      BOFT « TRPF(TM,TCS,CSF(1,N),NBETA,D                              FLX  99
      VHSRF « EMF«SRFMI»BOFT                                            FLX 100
      EFAST - A(N)«VFST»«B(N)*C(N)»VFST                                 FLX 101
      ESLOW - A(N)«VSLO»*B(N)*C(N)»VSLO                                 FLX 102
      VHFWY * WTFST«EFAST*WTSLO»ESLOW                                   FLX 103
      VHTOT(N) « SSFAC(N)»VHSRF*FYFAC(N)*VHFWY                          FLX 104
160   CONTINUE                                                          FLX 105
      VHNO • C4«CARFAC«VHTOT(1)                                         FLX 106
      VHHCR • C5*CARFAC*VHTOT(2)                                        PLX 107
      VHCO * CARFAC»VHTOT(3)                                            f*-X. 108
      IF (MOD(L.50).NE,0)  GO TO 170                                     F|-X 109
      CALL NEWPAG(TITLE»O.JDATE)                                        FLX 110
                                                                               179

-------
       WRITE (6,1)
 170   CONTINUE                                                           f*-X 112
       WRITE (6,2) TS(L)»I,J,VHNO,STNO,VHHCR,STHCR,VHCO,STCO              FLX 113
 c                                                                        FLX 114
 C         TOTAL FLUXES IN SQUARE  lij  AT TIME   TS   (M/MIN)              FLX 115
 c                                                                        FLX 116
       FLXIN(l.L) •  (VHNO*STNO)»C2                                        PI-X H?
       FLXIN(2,L) »  (VHHCR«STHCR)»C2                                      FLX 118
       FLXIN(3,L) «  (VHCO + STCO)#C2                                        PL.X 119
 C                                                                        FLX 120
 180   CONTINUE                                                           FLX 121
       NFLUX « KTMAX                                                      FLX 122
       RETURN                                                             FLX 123
 C                                                                        FLX 124
 1     FORMAT  2))                         FLX 129
       END                                                                FLX 130-
       SUBROUTINE GRIDS(XL»XR,YB,YT,DX»DY)                                GRI   1
 C                                                                        GRI   2
 C        PRINTER PLOT GRID  INITIALIZATION ROUTINE                        GRI   3
 C                                                                        GRI   4
       CALL SETPLT(XL,XR,Y8,YT)                                           GRI   '5
       IF  (DX.EQ.O.) GO TO 12Q                                            GRI   6
       IF  (DY.EQ.O.) GO TO 120                                            GRI   7
       IMAX »  
-------
TITLE
                   »MCHAR - FORTRAN SUBPROGRAM"
ft

MCHAR
THIS IS A SUBPROGRAM FOR MOVING A STRING OF CHARACTERS FROM
A GIVEN CHARACTER IN ONE ARRAY TO A GIVEN CHARACTER IN
ANOTHER.  THE FORMAT OF THE INVOKING FORTRAN STATEMENT
IS -
WHERE -
          CALL MCHAR  (I .A.J.B.K)
          I = THE STARTING CHARACTER IN ARRAY A
          A * THE SOURCE ARRAY
          J s THE STARTING CHARACTER IN ARRAY B
          B » THE TARGET ARRAY
          K e THE LENGTH 01= STRING  IN CHARACTERS
RESTRICTIONS -
EJECT
START
B
DC
DC
STM
BALR
USING
L
L
C
BH
S
STC
L
L
C
BL
S
A
L
L
C
BL
S
A
LR
AR
LR
AR
CR
          I MUST BE GT 0
          J MUST BE GT 0
          K MUST BE GT 0 AND LT 357
          SOURCE AND TARGET AREAS CANNOT OVERLAP
                   0
                   10(15)
                   X»s«
                   CL5*MCHAR«
                   U, 13. 13(13)
                   2,0
                   3.16 (0»1 >
                   4.0 (0.3)
                   ABENDIT
                   3,0 (Oil)
                   5.0(0.3)
                   5,«F*1*
                   ABENDIT
                   5.4(0.1)
                   3*8(0.1)
                   6.0 (0*3)
                   6,«F*1°
                   ABENDIT
                   7.5
                   7.4
                   8.6
                   6*4
                   6.5
BRANCH AROUND PRELOGUE
PRELOGUE
PRELOGUE
SAVE CALLING PROGRAMS REGS
LOAD BASE REG
ESTABLISH BASE REG
LOAD ADD" OF K
LOAD VALUE OF K
CHECK FOR K GT 256
IF GT 256 GO TO ABENDIT
SUB 1 FROM K FOR MVC LENGTH
STORE LENGTH IN MVC INST
LOAD ADDR OF I
LOAD VALUE OF I
CHECK FOR I LT 1
IF LT 1 GO TO ABENDIT
SUB I FROM I FOR OFFSET
ADO ADDRA FOR START AODR SOURCE
LOAD ADDR OF J
LOAD VALUE OF J
CHECK FOR J LT 1
IF J LT 1 GO TO ABENDIT
SUB 1 FROM J FOR OFFSET
ADO ADORB FOR START AODR TARGET
LOAD ADDR OF SOURCE
ADD K - 1 FOR END ADDR SOURCE
LOAD ADDR OF TARGET
ADD K - 1 FOR END ADDR TARGET
COMP START ADDR SOURCE W/ TARGET
                                                                 181

-------
         BH
         BE
         CR
         BL
         e
T66TSC   CR
         BH
         6
NOOVEHLP MVJ
MOVE
      ABENDIT
      ENDMCHAR  LM
               BR
         MVC
         B
         ABEND
               END
                         TGGTSc
                         ABENOIT
                         8»5
                         NOOVERLP
6»7
NOOVERLP
ABENDIT
12(13) «X»FF*
0 U»6) «0 (5)
ENDMCHAR
1111. DUMP, STEP
jr TARGET GT  SOURCE  GO  TO TGGTSC
OVERLAP OCCURS GO  TO ASENDIT
COMP END ADOR TARGET W/  SOURCE
IF END ADOR TARGET LT SOUHCE  OK
OVERLAP OCCURS GO  TO ABENDIT
COMP END ADOR SOURCE */  TARGET
IF END ADOR SOURCE LT TARGET  OK
OVERLAP OCCURS 90  TO A8ENDIT
INDICATE SUCCESFULL  EXEC
PERFORM MOVE
BRANCH AROUND ABENDIT
ISSUE SYSTEH ABEND
RESTORE CALLING PROSRAMS  RE6S
           NOTE:  This assembler-language subroutine
                 is for IBM 360 only.
182

-------
c
c
c
c
c
SUBROUTINE MINSEC(DECANGtANG)

    CONVERTS INPUT  ANGLE   DECANG  FROM DECIMAL DEGREES
    TO DEGREES* MINUTES,  AND  DECIMAL SECONDS WHICH ARE
    RETURNED IN CELLS  1,  2, AND  3  OF  ANG.

DIMENSION ANGO)
      ANG(i)
      DECMIN
      ANG<2)
      ANGO)
      RETURN
      END
         FLOATdFIX(DECANG))
         60,»(DECANG-ANG(in
         FLOATUFIX(DECMIN))
         60.*
      NDX(l)
      NDXI2)
      RETURN
      END
         P(lfL)»VX*OT
         P(2»D*VY»DT
         1*IFIX((POS(1)*
-------
  c
  c
  c
  c
SUBROUTINE SETPLT(A»B.CiD)

GENERAL-PURPOSE PRINTER-PLOT ROUTINE  ... ARGUMENTS  ARE  DESCRIBED
IBM-360 VERSION BY J.R. MARTINEZ - 9/18/73
  C
  C
COMMON /IMAG/ IMAGE
DIMENSION  IMAGE(26i51)i
EQUIVALENCE   (IC.CI)
EQUIVALENCE   (IARO.ARO)
DATA          MAXX.MAXY.ARO/104i51tlH*/
DATA          IBLNKiIDASH     /4H      t*H«——/

NCHAR IS THE NUMBER Of CHARACTERS PER  WORD
DATA          NCHAR/4/

LOGICAL CONFRM
                                                LABX(5t6)»LABEL<5)
  C
  C
  C-""FOR THIS ENTRY.  CALL SETPLOT
  C
  C
  C
  C
  C
  C
  C
  130
  140
                              (X-LOWt
                              X-HIGHt
                              Y-LOW,
                              Y-HIGH)
    THIS IS THE INITIALIZING CALL - THE ARGUMENTS DEFINE THE
         ENDS OF THE AXES TO BE PLOTTED
ENTRY SETPLOT
CONFRM • .FALSE.
100


110

120

DO 110 J B 1»51
DO 110 I B 1(26
IMAGE(ItJ) B IBLNK
CONTINUE
DO 120 I • 1*26
IMAGE(Id) B IDASH
DO 130 J « l.MAXY
        DY  B
        XORG
        YORG
        IF  (,
                    TO 140
                    * ,6«DY
                    DY • 5,/3,»DX
CALL MCHARIl (IHId (IMAGE (1 (J) d>
CONTINUE
DX » (B-AI/100.
     (D-C)/(MAXY-1)
     • A
     B C
    .NOT.CONFRM) GO
IF (DX.LT..6»DY) OX
IF (DY.LT.5./3.*DX)
KVAL B IBLNK
KGO B 19
DO 160 J • 1»6
VAL B XORG*DX«20»(J-1 I
00 TO 230
            LABEL(l)
            LABEL(2)
            LABELO)
            LABEL(4)
            LABELI5)
150



160

C
LABXd.J) B
LABX(2(J) B
LABXI3.J) *
LABX(4(J) B
LABX(5(J) -
RETURN

 SPL
 SPL
BSPL
 SPL
 SPL
 SPL
 SPL
 SPL
 SPL
 SPL  10
 SPL  11
 SPL  12
 SPL  13
 SPL  14
 SPL  15
 SPL  16
 SPL  17
 SPL  IB
 SPL  19
 SPL  20
 SPL  21
 SPL  22
 SPL  23
 SPL  24
 SPL  25
 SPL  26
 SPL  27
 SPL  28
 SPL  29
 SPL  30
 SPL  31
 SPL  32
 SPL  33
 SPL  34
 SPL  35
 SPL  36
 SPL  37
 SPL  38
 SPL  39
 SPL  40
 SPL  41
 SPL  42
 SPL  43
 SPL  44
 SPL  45
 SPL  46
 SPL  47
 SPL  48
 SPL  49
 SPL  50
 SPL  51
 SPL  52
 SPL  53
 SPL  54
 SPL  55
184

-------
c
c
c
c



c
c
c
c
c
c




c
c
c
c
c
c
c



170







180



C
c

c
c
c
c
c
c




• • « T U T C CKlTOV T C TftcMTT^AI Trt CffTnl ft T • C ¥ /** C" O T TT T C 1 1 1 C" r\ C f\D
""* 1 n 1 3 EN I H T 15 IDENTICAL TO at T PLU 1 f EACtrT i 1 la UotD r UK
PLOTTING X AND Y TO SAME SCALE
(A COMPUTED CIRCLE IS PLOTTED AS A CIRCLE)

ENTRY ISOPLT
CONFRM « .TRUE.
GO TO 100

• •_C*OD TUTQ C*KJTD Y * f A i i fcF Tfi y n v / n v »
^"Un I n 1 9 t ™ 1 W T f (* ML)- wC 1 U AU > V U A t
DY)
USE THIS ENTRY IF YOU NEED TO KNOW THE X- AND Y-INCREMENTS
WHICH HAVE BEEN COMPUTED BY ISOPLOT

ENTRY GTDXDY
A a DX
B = DY
RETURN

• ••PHD TUTC FMTDV* ^Al 1 Dl flTDMT tv~fnf\DT\m
* — r UK JnlJ ti>'IKTi CALL "LUI"NT (X — CwUKUl
Y-COORD*
CHARACTER)
CHARACTER MUST BE THE FIRST ONE IN THE WORDi E.G.i 1HA.
THIS IS THE ENTRY WHICH ENTERS A POINT IN THE PLOT

ENTRY PLTPNT
MGO • 1
CI « C
JX B (A»XORG)/DX«1.5
JY « (B-YORG)/DY*1,5
IF  RETURN
IR • JX/NCHAR*!
JZ • MOD(jXiNCHAR)
IF (JZ.GT.O) GO TO ISO
IR » IR-1
JZ • NCHAR
CONTINUE
IF (MGO.EQ.2) GO TO 190
CALL MCHAR (liCIiJZi IMAGE (IRiJY)il)
RETURN


—FOR THIS ENTRYi CALL GETPNT (X-COORDi
Y-COORD i
CHARACTER) „ „
CHARACTER IS RETURNED IN THE FIRST POSITION OF VARIABLE -C-.
USE THIS ENTRY TO FIND OUT THE CHARACTER
NOW AT (XiY)

ENTRY GETPNT
MGO • 2
C - 0.
80 TO 170
SPL 56
CDI & T
SrL 57
SPL 58
SPL 59
SPL 60
SPL 61
SPL 62
SPL 63
SPL 64
SPL 65
C Dl At
SrL DO
SPL 67
SPL 68
SPL 69
SPL 70
SPL 71
SPL 72
SPL 73
SPL 74
SPL 75
SPL 76
COl T"T
— r L 77
SPL 76
SPL 79
SPL 80
SPL 81
SPL 82
SPL 83
SPL 84
SPL 85
SPL 86
SPL 87
SPL 88
SPL 89
SPL 90
SPL 91
SPL 92
SPL 93
SPL 94
SPL 95
SPL 96
SPL 97
SPL 98
SPL 99
SPL 100
SPL 101
SPL 102
SPL 103
SPL 104
SPL 105
SPL 106
SPL 107
SPL 108
SPL 109
SPL 110
185

-------
 190   CALL MCHAR(JZ,IMAGE(IR,JY),1,C,1)                                  SPL111
       RETURN                                                             SPL 112
 C                                                                        SPL 113
 C                                                                        SPL 114
 c	-FOR THIS ENTRY* CALL PLOTXP1  (CHARACTER)                           SPL 115
 C          CHARACTER MUST BE THE FIRST ONE IN THE WORD, E.G.,  1HA.       SPL 116
 C         USE THIS ENTRY TO ADO A CHARACTER TO THE RIGHT OF              SPL 117
 C              THE LAST MARK ENTERED                                     SPL 118
 C                                                                        SPL 119
       ENTRY PLTPXl                                                       SPL 120
       JX a JX*1                                                          SPL 121
       IF (JX.GT.MAXX) RETURN                                             SPL 122
       CI   A                                                             SPL 123
       IR   JX/NCHAR*!                                                    SPL 12*
       JZ   MOD(JXtNCHAR)                                                 SPL 125
       IF  JZ.GT.O) GO TO 200                                             SPL 126
       IR   IR-l                                                          SPL 127
       JZ   NCHAR                                                         SPL 12S
 200   CONTINUE                                                           SPL 129
       CALL MCHAR<1»CI,JZ,IMAGE(IR»JY) • !>                                 SPL 130
       RETURN                                                             SPL 131
 C                                                                        SPL 132
 C                                                                        SPL 133
 c,	,FOR THIS ENTRY, CALL PLOTYMl  (CHARACTER)                           SPL 134
 C          CHARACTER MUST BE THE FIRST ONE IN THE WORD, E.G..  1HA.       SPL 135
 C         USE THIS ENTRY TO ADD A CHARACTER BELOW                        SPL 136
 C              THE LAST MARK ENTERED                                     SPL 137
 C                                                                        SPL 138
       ENTRY PLTYM1                                                       SPL 139
       JY = JY-1                                                          SPL 1*0
       IF (jv.LE.o) RETURN                                                SPL i4i
       CI =• A                                                             SPL 142
       CALL MCHAR(1»CI,JZ,IMAGE(IR,JY),1)                                 SPL 143
       RETURN                                                             SPL 144
 C                                                                        SPL 145
 C                                                                        SPL 146
 C         YOU MUST CALL PLOTOUT TO GET PLOT PRINTED                      SPL 147
 c	,FOR THIS ENTRY, CALL PLOTOUT  (PRINT-TAPE)                           SPL 148
 C                                                                        SPL 149
       ENTRY PLTOUT                                                       SPL 150
       CI * A                                                             SPL 151
       IF (IC.LE.O.OR.IC.GT.49)  1C « 6                                    SPL 152
       WRITE (IC»1)                                                       SPL 153
       KVAL = IARO                                                        SPL 154
       KGO • 14                                                           SPL 155
       DO 220 JYY = 1,MAXY                                                SPL 156
       jY B MAXY+1-JYY                                                    SPL 157
       VAL * YORG*DY«(JY-1)                                                SPL 158
       LABEL(l) » IBLNK                                                   SPL 159
       LABEL(2) = IBLNK                                                   SPL 160
       LABEL(3) = IBLNK                                                   SPL 161
       LABEL(4) = IBLNK                                                   SPL 162
       LABEL (5) * IBLNK                                                   SPL 163
       IF   GO  TO Z3Q                                    SPL 164
 210   WRITE (IC'2) LABEL'
-------
220   CONTINUE                                                          SPL  166
      WRITE (1C.3)  
-------
       SUBROUTINE SETUP                                                   SET    1
 C                                                                        SET    2
 C         INITIALIZATION SUBROUTINE FOR FLUX GENERATION MODULE           SET    3
 C                                                                        SET    4
       DIMENSION TITLE<20>« JDATE(2>                                      SET    5
       DIMENSION CLAT(3),CLON(3)«OLAT<3)iOLON<3) ,                         SET    6
      1          PLATO,3) iPLON<3,2> .PLATO (2) .PLONO (2) »                   SET    7
      2          ILAT<2»4) .XLATI4)tILON<2i4).XLON<4)«                     SET    8
      3          PP(2f4)»IJ(2«4)                                          SET    9
       COMMON /WIND/ TdOO)» V(lOO). THdOOIt NPTS                        SET  lQ
       COMMON /TRAJ/ TSTARTf P(2.100)i ID(2tlOO)                          SET  11
       COMMON /GRID/ XIiX2»Y1•Y2iNX.NYtDELX.DELY.DELT                     SET  12
       COMMON /EMIT/ HEMF(3), CEMF(3)                                      SET  13
       COMMON /SPDFCT/ A(3)i B(3). C<3)» VBAR                             SET  14
       COMMON /COLDST/ NBETAt TCS120). CSF(20»3)                          SET  15
       COMMON /CNTROL/ CARFAC. STAFACi KSTOPi TSUN                        SET  16
       COMMON /ADJUST/ FYFAC(3>. SSFAC(3)t PPFACi ORFAC(2)t FXFAC(2)      SET  17
       DATA CLAT/33.i55,t46tO/» CLON/l16..12.»9.o/                        SET  18
       DATA SRD/57.29577951/                                              SET  19
       DATA MORE/4HMORE/                                                  SET  20
 C                                                                        SET  21
       SCALE « 6076.1/5280.                                               SET  22
       VFDC a 19.6                                                        SET  23
 C                                                                        SET  24
 C         CONVERT WIND VELOCITIES TO MI/MIN AND TIMES TO                 SET  25
 C         MINUTES FROM START                                             SET  26
 C                                                                        SET  27
       V(l) B V(l)/60.                                                    SET  28
       TSTART = T(1)*TSUN                                                 SET  29
       TSHIFT » TIMIN(Td) )                                               SET  30
       Ttl) « 0.                                                          SET  31
       DO 100 K « 2»NPTS                                                  SET  32
       V(K) » VtK>/60.                                                    SET  33
       T(K) * TIMIN(T(K))-TSHIFT                                          SET  34
       IF  (T(K) ,LT.T(K-1)) T(K) « T(K)*1440.                              SET  35
 100   CONTINUE                                                           SET  36
 C                                                                        SET  37
 C         SET UP GRID AND LOCATE TRAJECTORY START POINT                  SET  38
 C                                                                        SET  39
       WD • NX'DELX                                                       SET  40
       HT » NY»DELY                                                       SET  41
       CLATD * DECMAL(CLAT)                                               SET  42
       CLOND • DECMAL(CLON)                                               SET  43
       CSCLAT » COS(CLATD/SRD)                                             SET  44
       OLATD m CLATD-0.5«HT/(60."SCALE)                                    SET  45
       OLOND « CLOND*0.5«WO/(6Q,«SCALE*CSCLAT>                             SET  46
       PLATD(l) • OLATD*P(2t1)/(60.»SCALE)                                 SET  47
       PLOND(l) B OLOND-P(lil)/(60.»SCALE«CSCLAT)                          SET  48
       ID(lfi) « 1*IFIX (P(l111/DELX)                                      SET  49
       10(2.1) * l*IFIX(P(2il)/OELV)                                      SET  50
 c                                                                        SET  si
 C         INITIALIZE GRID FOR PRINTER-PLOT OF  TRAJECTORY                 SET  52
 C                                                                        SET  53
       READ (5»1) XL.XR.YBiYT                                             SET  54
       CALL GRIDSIXL.XR.YB.YT.DELX.DELY)                                   SET  55
188

-------
      CALL PLTPNT(P(1,1),P(2,1) ,1HA)                                    SET  56
C                                                                       SET  57
C         PRINT LOCATIONS OF TRAJECTORY START POINT, GRID ORIGIN,       SET  58
C         AND GRID CENTER                                               SET  59
C                                                                       SET  60
      CALL MINSEC(OLATD»OLAT<1) )                                         SET  61
      CALL MINSEC(OLONDiOLON(l))                                         SET  62
      CALL MINSEC(PLATD(1),PLAT<1,1»                                   SET  63
      CALL MINSEC(PLONDd) ,PLON(i,D )                                   SET  64
      DO 110 L » 1,2                                                    SET  65
      ILAT(L.l) = CLAT(L)                                               SET  66
110   ILON(L«1> a CLON(L)                                               SET  67
      XLATU) a CLATO)                                                 SET  66
      XLON(l) a CLON(3)                                                 SET  69
      PP(1»1> a WD/2.                                                   SET  70
      PP(2,1) a HT/2.                                                   SET  71
      DO 120 L • 1,2                                                    SET  72
      ILAT(Li2) a OLAT(L)                                               SET  73
      ILON(L»2) a OLON(L)                                               SET  74
120   PP(L,2) » 0.                                                      SET  75
      XLAT<2> « OLATO)                                                 SET  76
      XLON(2) a OLONI3)                                                 SET  77
      DO 130 L e 1,2                                                    SET  78
      ILAT(L»3) a PLAT(LU)                                             SET  79
130   ILON(L.3) a PLON(L.l)                                             SET  60
      XLATI3) a PLATO,1)                                               SET  81
      XLON(3) = PLONOtl)                                               SET  62
      PP(1,3) a P(l,l)                                                  SET  83
      PP(2,3) a P(2»l)                                                  SET  84
      DO 140 K a 1,3                                                    SET  85
      IJ(1,K) a 1*IFIX(PP(1,K)/DELX)                                    SET  66
140   IJ(2,K) a 1»IFIX (PP(2,K)/DELY)                                    SET  67
      WRITE  (6,3) («ILAT(I,J),Ial,2),XLAT(J),(ILON(K,J),K«1,2),XLON(J) ,SET  66
     1(PP(M,J),Mai,2)»(IJ(N,J)iNai,2))»J=1,3)                           SET  69
C                                                                       SET  90
C         READ IN VEHICLE EMISSION FACTORS (GM/MI)                      SET  91
C                                                                       SET  92
      READ  (5,2> (HEMF(I)iI«l»3»,(CEMF(I)iI»lt3)                        SET  93
      DO 150 I a 1,3                                                    SET  94
      All) a (HEMF(I)-C(I)»VFDC)»VFDC»«t-B(I))                           SET  95
150   CONTINUE                                                          SET  96
C                                                                       SET  97
C         READ GROWTH FACTORS FOR VEHICLE POPULATION AND                SET  98
C         STATIONARY EMISSIONS                                          SET  99
C                                                                       SET 100
      READ  <5»2> CARFAC»STAFAC                                          SET 101
C                                                                       SET ^ 0••
C         READ ADJUSTMENT FACTORS FOR INDIVIDUAL SOURCES AND SPECIES    SET 103
C                                                                       SET 104
C              FREEWAY  VEHICLES         NO        HC        CO          SET 105
C              SURFACE  ST. VEHICLES     NO        HC        CO          SET 106
C              POWER PLANT              NO                              SET 107
C              OIL REFINERY             NO        HC                    SET 106
C              AREA STATIONARY          NO        HC                    SET 109
C                                                                       SET 110
                                                                               189

-------
 c
 c
 1
 2
 3
       READ
       READ
       READ
       READ
     (5,2)
     (5i2)
     (5.3)
     (5i2)
            (FYFAC(I).I"1«3). 
            PPFAC
            
            »I«1«2)
       RETURN
FORMAT <30X.4FlOtO)
FORMAT (40X.3F10.0)
       (!HOf////t21H  GRID
        9MLONGITUDE112X »8MX
        10X.13HCENTER
 FORMAT
1
2
3
4
5
6
7
8)
 END
               10X.13HORIGIN

               10X.13HSTART POINT
                                       SET 111
                                       SET 112
                                       SET 113
                                       SET H4
                                       SET 115
                                       SET 116
                                       SET 117
                                       SET 118
                                       SET 119
                                       SET 120
REFERENCE DATA X30X,8HLATITUDE,8X,     SET 121
(ST MI),5X,8HY(ST MI),6X1HI,6X1HJ//    SET 122
 2(6X13,1H/,I2,1H/,F4.1),4X,2(6XF7,3), SET 123
                            6XI2«5XI2//SET 124
 2(6XI3,1H/,I2,1H/,F4,1)»4X.2(6XF7.3), SET 125
                            6XI2.5XI2//SET 126
 2(6XI3,1H/,I2,1H/,F4.1),4X,2(6XF7.3), SET 127
                            6XI2.5XI2//SET 126
                                       SET 129
                                       SET 130-
 100

 110

 120
 130

 HO


 150

 160

 170

 C
 FUNCTION SPEEDF (T.TS.FS.NTF.NF.FBASE)

     LINEAR INTERPOLATION ROUTINE FOR AVERAGE SPEED TABLES

 DIMENSION TS(1). FS(NF.NTF)

 KEND * NTF*2
 DO 100 K » l.KEND
 IF (TS(K)-T) lOOtlOOtllO
 CONTINUE
 K * KEND*1
 KL = K-l
 IF (K-2) 130,140.120
 IF (K.KEND)  150.160.130
 SPEEDF « FBASE
 RETURN
 A = FBASE
 B « FS<1»1>
 GO TO 170
 SPEEDF m FS ( 1 tK-2) * (T-TS
 RETURN
 A « FS(l.NTF)
 B * FBASE
 SPEEDF a A* (T-TS(KL) )»(B-A)/(TS(K)"TS(KL) )
 RETURN

 END
                                 ( 1 ,KL) -F$ ( 1 .K-2) ) / 
-------
      FUNCTION TABFtX.XS.FS.NXFiNF)                                     TAB   1
C                                                                       TAB   2
C         GENERAL STAIRSTEP EVALUATOR FOR TABULAR FUNCTIONS             TAB   3
c         (RETURNS NEAREST END VALUE OF  FS  WHEN  x  is                TAB   4
C         OUTSIDE THE RANSE OF  XS )                                    TAB   5
C                                                                       TAB   6
      DIMENSION XS(NXF). FS(NFiNXF)                                     TAB   7
C                                                                       TAB   8
      DO 100 * = 3»NXF                                                  TAB   9
      IF (XS(K)-X) 100.100.110                                          TAB  10
100   CONTINUE                                                          TAB  11
      TABF « FS(ltNXF)                                                  TAB  IZ
      RETURN                                                            TAB  13
C                                                                       TAB  14
110   TABF n FS(l.K-l)                                                  TAB  15
      RETURN                                                            TAB  16
C                                                                       TAB  17
      END                                                               TAB  18-
      FUNCTION TIMIN(T)                                                 TIM   1
C                                                                       TIM   2
C         TIMIN CONVERTS MILITARY CLOCK TIME TO MINUTES                 TIM   3
C                                                                       TIM   4
      XMIN » AMOO(T»100t)                                               TIM   5
      HRS * (T-XM1N1/100.                                               TIM   6
      TIMIN m 60.*HRS*XMIN                                              TIM   7
      RETURN                                                            TIM   8
      END                                                               TIM   9«
                                                                               191

-------
      FUNCTION TRPF(X.XS.FS.NXF.NF)                                      TRP   1
C                                                                        TRP   2
C         GENERAL  LINEAR  INTERPOLATOR  FOR  TABULAR FUNCTIONS             TRP   3
C          (RETURNS NEAREST  END  VALUE OF  FS  WHEN  X  IS                TRP   4
C         OUTSIDE  THE  RAN8E OF   XS  )                                     TRP   5
C                                                                        TRP   6
      DIMENSION  XS(NXF).  FS(NFiNXF)                                      TRP   7
C                                                                        TRP   8
      IF  (XS(NXF)-XS(l))  100»120tl20                                     TRP   9
100   DO  110  K " 1»NXF                                                  TRP  10
      IF  (X-XS(K))  110.110*140                                           TRP  11
110   CONTINUE                                                           TRP  12
      K « NXF*1                                                          TRP  13
      GO  TO  1*0                                                          TRP  U
120   DO  130  K * l.NXF                                                  TRP  15
      IF  (XS(K)-X)  130.130.140                                           TRP  16
130   CONTINUE                                                           TRP  17
      K » NXF*1                                                          TRP  18
140   KL  »  K-l                                                           TRP  19
      IF  (K-2) 160.170.150                                               TRP  20
150   IF  (K-NXF) 170.170.180                                            TRP  Zl
160   TRPF  •  FS(l.l)                                                     TRP  22
      RETURN                                                             TRP  23
170   TRpr  m  FS<1.KL)*(X-XS(KL))«(FS<1.K)-FS(1»KL))/(XS(K)-XS(KL))       TRP  24
      RETURN                                                             TRP  25
180   TRPF  •  FS(l.NXF)                                                  TRP  26
      RETURN                                                             TRP  27
C                                                                        TRP  28
      END                                                               TRP  29-
       SUBROUTINE XMIT(N.A.B)                                             XMT   1
 c                                                                       XMT   2
 C         IF  N  POSITIVE.  TRANSMITS  N  WORDS FROM  A  TO  B           XMT   3
 C         IF  N  NEGATIVE.  TRANSMITS  A  TO  N  WORDS OF  B             XMT   4
 c                                                                       XMT   5
       DIMENSION A(2)»B<2>                                                XMT   6
 C                                                                       XMT   7
       IF (N) 100«120»120                                                XMT   8
 100   K * lABS(N)                                                       XMT   9
       DO 110 I » l.K                                                    XMT  10
       B(I>  » All)                                                       XMT  11
 110   CONTINUE                                                          XMT  12
       RETURN                                                            XMT  13
 C                                                                       XMT  14
 120   DO 130 I » l.N                                                    XMT  15
       8(1)  = A(I)                                                       XMT  16
 130   CONTINUE                                                          XMT  17
       RETURN                                                            XMT  18
 C                                                                       XMT  19
       END                                                               XMT  20-
192

-------
F.4  CHEMICAL MODULE

-------
      SUBROUTINE COEQfNtAtX.FL)                                         CO    1
C      COEQ    SOLVES CO-DIAGONAL MATRIX OF SIMULTANEOUS LINEAR EQUATIONCO    2
C              FOR IMPLICIT  FINITE DIFFERENCE METHOD                   CO    3
C                                                                       CO    *
C     N * NUMBER OF ROWS IN THE MATRIX                                  CO    5
c     AIM) » MATRIX ELEMENTS IN A LINEAR VECTOR OF 4«N-2 ELEMENTS.      co    6
C            M = I*4«U-1) WHERE J»ROW NUMBER AND I«l»3 FOR FIRST AND LASTCO    7
C            ROWS AND I«l,4 FOR OTHER ROWS.  THE NON-ZERO ELEMENTS LOOK CO    6
C            LIKE                                                       CO    9
C                                                                       CO   10
C            ROW 1       X X                   X      I»li2.3           CO   11
C                2       X X X                 X      I»4f5»6»7         CO   *2
C                3         XXX               X      I=8»9»10.11 ETC   CO   13
C	                        CO   U
C                N-2                   X X X   X                        CO   15
C                N-l                     X X X X                        CO   16
C                N                         XXX                        CO   17
C                                                                       CO   18
C            FIRST ROW CORRESPONDS To LOWER BOUNDARY                    CO   19
C            N-TH ROW CORRESPONDS TO UPPER BOUNDARY                     CO   20
C                                                                       CO   21
C     X(K) « SOLUTION VECTOR (K»1,N)                                    CO   22
c     FL » FAILURE INDEX.  *o USUALLY* -i IF MATRIX is SINGULAR         co   23
c                                                                       co   2*
C     NOTE.  FOR GRADIENT TYPE BOUNDARY CONDITIONS, WRjTE GRADIENT IN   CO   25
C            USUAL FINITE-DIFFERENCE FORM USING A FICTITIOUS POINT      CO   26
C            OUTSIDE THE BOUNDARY.  THEN APPLY THE FINITE-DIFFERENCE    CO   27
C            DIFFERENTIAL EQUATION TO ELIMINATE THIS FICTITIOUS POINT.  CO   28
C                                                                       CO   29
      DIMENSION All) ,X(1)                                               CO   30
      FL » 0.                                                           CO   31
      NMl • N-l                                                         CO   32
C     NORMALIZE FIRST ROW SO 1 IS LEADING ELEMENT                       CO   33
      IF  (A(l).EQ.O.) GO TO 140                                         CO   34
      A(2) » A(2)/A<1)                                                  CO   35
      A(3) • A(3)/A(1)                                                  CO   36
C                                                                       CO   37
C     NORMALIZE ALL BUT LAST ROW AND SUBTRACT THE ROW ABOVE             CO   38
      M . 0                                                             CO   39
      DO 110 JR » 2iNMl                                                 CO   40
      M « M»4                                                           CO   41
      Kl » M+l                                                          CO   42
      K2 » M*2                                                          CO   43
      K3 - M*3                                                          C0   **
C                                                                       CO   45
C     TEST FOR ZERO ELEMENTS                                            CO   46
      IF  (A(M).NE.O.) 60 TO 100                                         CO   47

c     A
-------
       A(K2> a A(K2)/A(K1)                                                CO   56
 110   A(K3) s A(K3)/A(K1)                                                CO   57
 C                                                                        CO   SB
 C     LAST ROW                                                           CO   59
       M • M*4                                                            CO   60
       Kl « M»l                                                           CO   61
       «2 • M*2                                                           CO   62
       IF (AIM).£0.Oil 60 TO  120                                          CO   63
       A(K1) » A(Kl)/A(M)-A(M-3)                                          CO   64
       A                                                 CO   69
       M • M*3                                                            CO   70
       00 130 I n  1,NM1                                                   CO   71
       M • M-4                                                            CO   72
       Kl » N-I                                                           CO   73
 130   X(K1) » A(M)-X(K1*1)*A(M-1)                                        CO   74
       RETURN                                                             CO   75
 C                                                                        CO   76
 C     SINGULAR MATRIX                                                    CO   77
 140   FL • i.                                                            CO   78
       RETURN                                                             CO   79
       END                                                                CO   80-
194

-------
      SUBROUTINE CRANK *SCALDF(2»°TAU
TRIDAT(l) = 1.-TRIDATI2)
CR
ACR
CR
CR
CR
CR
CR
CR
CR
CR
CR
CR
CR
CR
CR
CR
CR
CR
CR
f, U
CK
CR
CR
CR
CR
TRIDAT (3) a DELT«TOELZ»FLXWAL (NOSPl ) » (1 ,*TRIDAT <2> ) »TRACIN (1 ) -TRIDCR
1AT(2)»TRACIN(2)



M * o
DO 100 K a 2.NOSTM1
M « M*4
TRIDAT(M) a -TAU«SCALDF(K)
TRIDAT(M*l> a l,*TAU»(SCALDF(K)*SCALDF(K*l) )
TRIDAT (M»2) » -TAU»SCALDF (K*l )
TRIDAT (M»3) » -TRIDAT (M) «TRACIN (K-l ) * ( 1 .-TAU* (SCALDF (K) »SCALDF (K*
1) ) )»TRACIN(K) -TRIDAT (M*2)«TRACIN(K*1)
CONTINUE



TRIDAT(M*4) " -TAU» (SCALDF (N) *SCALDF (N*l ))
TRIDAT(M*5) « 1 .-TRIDAT (M*4 ) .. ., tl
TRIDAT (M*6) » -TRIDAT (M*4( «TRAClN (N-i ) * (1 ,*TRlDAT (M*4) ) #TRAClN (N)
1TDELZ»DELT*FLXDGE (NOSPl )


CALL COEQ(N»TRIDAT.TRACIN»M)
RETURN
END
CR
CR
CR
v~
CR
CR
CR
CR
CR
CR
CR
1CR
CR
CR
CR
CR
CR
CR
CR
.CR
CR
CR
CR
CR
CR
CR
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
9 1
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
e A
50
51-
                                                                                195

-------
       SUBROUTINE DFFUSE(NOSTATiDELZ)                                     OFF   1
 C                                                                       OFF   2
 c     .........	 COMPUTES INITIAL PROFILE OF DIFFUSION COEFFICIENT    OFF   3
 C                                                                       OFF   4
       COMMON/SKY/   DFINIT(ll),         ZEE(IO)                         OFF   5
       DFINIT(l) » 60»                                                   OFF   6
       CALL XMIT(-NOSTAT»30.iDFINIT<2)>                                   OFF   7
       RETURN                                                            OFF   8
       END                                                               OFF   9-
       SUBROUTINE DIFCOF(SCALDFiNOSTATiDCOFiSCALEtDSCALE)                 DIF   1
       DIMENSION     SCALDFU >•          DCOF11) .            SCALE tl).   DIF   Z
      1              DSCALE(l)                                            DIF   3
       DO 100 I « ItNOSTAT                                               DIF   4
       DCOF(I)  * SCALDF(I)*SCALDF(I+1)                                    OIF   5
       DSCALE(I) • l./SCALOFII)                                          OIF   6
       SCALE1I) » SCALOF(I*1>«DSCALE(I)                                   OIF   7
       IF (I.NE.LAND.I.NE.NOSTAT)  00 TO 100                             DIF   8
       DSCALE(I) » l./DCOFU)                                            DIF   9
       SCALE(I) « DSCALEd)                                              OIF  10
 100   CONTINUE                                                          DIF  11
       RETURN                                                            DIF  12
       END                                                               OIF  13-
196

-------
      SUBROUTINE JACOB ( A »B» R.NtW ,NNiC I
      DIMENSION     A(NtN),  B<1)»  R(l),
                                      wu),  cm
100
c
c—
c
      	—-- THIS LOOP CONVERTS CONCENTRATION FROM MASS
              TO PPHM
      DO 100 I = l.NN
 CONTINUE

•--- COMPUTE JACOBIAN OF
-,-REACTION
      A(lil) = "R(2)»C(4)-R(5)#C(9)-R(7)»C(8)-R(15)«C(3)
      A(1,2) * Ot
      A(1 ,3) « *R(1)-R(15)*C(1)
      A(l,4) * -R(2)»C(1)
      A(l,5) = +R<10>
      A(2.1) s Qt
      A(2,2) « -R(4)»C(8)-R(9)«C(4)-R(1)«R(3)»C(3)
      A(2,3) " -R(1)«R(3)«C(2)
      AI2.4) • -R(9)»C<2)
      AI2.5) = Ot
      A(3,l) * *R(2)«C(4)*R(5)»C(9)-R(15)«C(3)
      A(3.?l s Ot
      A(3,3) « -R(1).R(6)»C(9).R(8)»C(8).R(11)#C(4)-R(12)»C(6)

      A(3,4) • *R(2)»C<1)-R(11)»C<3)
      A(3.5) • Ot
      A(4,l) * -R(2)«C(4)
      A(4,2) * -R(9)*C(4)
      A(4,3) a *R(1)-R<11)«C<4)
      AI4.4) * -R(2)«C (1)-R(9)»C(2)-R(11)*C(3)
      A(4,5) * Ot
      A(5,l) - *R(7)«C(8)»2.00»R(15)»C<3)
      A(5,2) » Ot
      A(5i3> « *2tOO*R(15>*C
      A(S,4) • Ot
      A(5,5) « -R(10)
      RETURN
      END
          JAC   1
          JAC   2
          JAC   3
FRACTION  JAC   4
          JAC   5
          JAC   6
          JAC   7
          JAC   8
          JAC   9
          JAC  10
          JAC  11
          JAC  12
          JAC  13
          JAC  14
          JAC  15
          JAC  16
          JAC  17
          JAC  18
          JAC  19
          JAC  20
          JAC  21
          JAC  22
          JAC  23
-R(15)*C(1JAC  24
          JAC  25
          JAC  26
          JAC  27
          JAC  28
          JAC  29
          JAC  3Q
          JAC  31
          JAC  32
          JAC  33
          JAC  34
          JAC  35
          JAC  36
          JAC  37
          JAC  38
          JAC  39-
                                                                               197

-------
       SUBROUTINE MATAOD(A»B»C»NRAiNCA)
 C                                                                        MAA    2
 C      ENTRY MATADD  C» A * B                                            MAA    3
 C      ENTRY MATSUB  C» A - B                                            MAA    4
 C      NRA • NUMBER OF ROMS                                              MAA    5
 C      NCA • NUMBER OF COLUMNS                                           MAA    6
 C                                                                        MAA    7
       DIMENSION A(NRA.NCA). B  (NRAfNCA>» C(NRAiNCA)                      MAA    8
 C                                                                        MAA    9
       DO 100 I » 1'NRA                                                   MAA   10
       DO 100 J • liNCA                                                   MAA   11
       C(1»J) « A(ItJ)*B(I»J)                                             MAA   12
 100   CONTINUE                                                           MAA   13
       RETURN                                                             MAA   14
 C                                                                        MAA   15
       ENTRY MATSUB                                                       MAA   16
 C                                                                        MAA   17
       DO 110 I » l.NRA                                                   MAA   IB
       DO 110 J B ItNCA                                                   MAA   19
       C(ItJ) > AdtJ)-B(IiJ)                                             MAA   20
 110   CONTINUE                                                           MAA   21
       RETURN                                                             MAA   22
       END                                                                MAA   23-
198

-------
C
C
C
C
C
C
C
C
C
C
C
C
C
100

110
120
 130
 140

 C
 C
 C

 150
 C
160

C
170
SUBROUTINE MATINV(AtN»NMAX.B,M,PIVOT.I PIVOTiINDEX»DETERM)


MEETS X3.9 FORTRAN STANDARD -• JUNEt 1970

SOURCE DATE 70.0630
MATRIX INVERSION WITH ACCOMPANYING SOLUTION OF LINEAR EQUATIONS
                                                                        1
                                                                        2
                                                                        3
                                                                        4
                                                                        5
                                                                        6
                                                                        7
                                                                  MIV   9
                                                                  MIV  10
                                                                  MIV  11
MIV
MIV
MIV
MIV
MIV
MIV
MIV
DIMENSION A(NMAX.NMAX)
DIMENSION B(NMAXtl)
DIMENSION INDEX(Ni2)
DIMENSION IPIVOT(N)
DIMENSION PIVOT(N)

INITIALIZATION

DETERM * 1.0
CALL XMIT(-N.O.IPIVOT)

DO 300 I » 1»N

SEARCH FOR PIVOT ELEMENT

AMAX « 0.0

DO 140 J * 1»N
IF (IPIVOT(J)-D 100»140«100

DO 130 K a 1,N
IF (IPIVOT(K)-l) 110il30»340
IF (ABS(AMAX)-A8S J
ICOLUM • K
AMAX • AfJ.K)
CONTINUE
CONTINUE
IPIVOT(ICOLUM)  « IPIVOT(ICOLUM)*!

INTERCHANGE ROWS TO  PUT  PIVOT ELEMENT ON plASONAL

IF (IROW-ICOLUM) 150il90»150
OETERM • -DETERM

DO 160 L • l.N
SWAP « A(IROWiL)
A(IROWiL) " A(ICOLUMtL)
A(ICOLUMiL) " SWAP
IF (M) 190»190tl70

DO 180 L " l.M
                                                                  MIV  13
                                                                  MIV  14
                                                                  MIV  15
                                                                  MIV  16
                                                                  MIV  17
                                                                  MIV  18
                                                                  MIV  19
                                                                  MIV  20
                                                                  MIV  21
                                                                  MIV  22
                                                                  MIV  23
                                                                  MIV  24
                                                                  MIV  25
                                                                  MIV  26
                                                                  MIV  27
                                                                  MIV  28
                                                                  MIV  29
                                                                  MIV  30
                                                                  MIV  31
                                                                  MIV  32
                                                                  MIV  33
                                                                  MIV  34
                                                                  MIV  35
                                                                  MIV  36
                                                                  MIV  37
                                                                  MIV  38
                                                                  MIV  39
                                                                  MIV  40
                                                                  MIV  41
                                                                  MIV  42
                                                                  MIV  43
                                                                  MIV  44
                                                                  MIV  45
                                                                  MIV  46
                                                                  MIV  47
                                                                  MIV  46
                                                                  MIV  49
                                                                  MIV  50
                                                                  MIV  51
                                                                  MIV  52
                                                                  MIV  53
                                                                  MIV  54
                                                                  MIV  55
                                                                               199

-------
       SWAP • B(IROWiL)                                                   MIV  56
       B(IROWfL) « B(ICOLUMtL)                                            MIV  57
 180   B(ICOLUMiL) » SWAP                                                 MIV  58
 190   INDEX(Iil) « IROW                                                  MIV  59
       INDEXd.2) « ICOLUM                                                MIV  60
       PIVOT(l) • A(ICOLUM.ICOLUM)                                        MIV  61
       OETERM » DETERM«PIVOT(I)                                           MIV  62
 C                                                                        MIV  63
 C     DIVIDE PIVOT ROW BY PIVOT ELEMENT                                  MIV  64
 C                                                                        MIV  65
       A(ICOLUMtlCOLUM) » 1.0                                             MIV  66
 C                                                                        MIV  67
       DO 210 L * 1»N                                                     MIV  68
       IF (PIVOT(I).NE.O.) 60 TO 200                                      MIV  69
       PRINT 1                                                            MIV  70
       CALL EXIT                                                          MIV  71
 200   AdCOLUM.L) * A(ICOLUMfL)/PIVOT(I)                                 MIV  72
 210   CONTINUE                                                           MIV  73
       IF (M) 250.250.220                                                 MIV  74
 C                                                                        MIV  75
 220   DO 240 L « liM                                                     MIV  76
       IF (PIVOT(I).NE.O.) 60 TO 23Q                                      MIV  77
       PRINT 1                                                            Mjy  7e
       CALL EXIT                                                          MIV  79
 230   BdCOLUM.L) " B (ICOLUM f|_) /PIVOT (I)                                 MIV  80
 240   CONTINUE                                                           MIV  81
 C                                                                        MIV  82
 C     REDUCE NON-PIVOT ROWS                                              MIV  83
 C                                                                        MIV  84
 250   DO 300 LI = l.N                                                    MIV  85
       IF (Ll-ICOLUM)  260.300.260                                         MIV  86
 260   T m A(L1.ICOLUM)                                                   MIV  87
       A(Ll.ICOLUM) • 0<0                                                 MIV  88
 C                                                                        MIV  89
       DO 270 L - ItN                                                     MIV  90
       A(Ll.L) » A(Ll.L)-AdCOLUM.L)»T                                    MIV  91
 270   CONTINUE                                                           MIV  92
       IF (M) 300.300.280                                                 MIV  93
 C                                                                        MIV  94
 280   DO 290 L » liM                                                     MIV  95
       8(L1.L) «= B(L1.L)"B(ICOLUM,L)«T                                    MIV  96
 290   CONTINUE                                                           MIV  97
 300   CONTINUE                                                           MIV  98
 C                                                                        MIV  99
 C     INTERCHAN6E COLUMNS                                                MIV 100
 C                                                                        MIV 101
       DO 330 I = 1»N                                                     MIV 10g
       L « N»1-I                                                          MIV 103
       IF (INDEX(L.l)-INDEX(Li2))  3l0.330i310                             MIV 104
 310   JROW  • INDEX(Ltl)                                                   MIV 105
       JCOLUM a INDEX(L»2)                                                MIV 106
 C                                                                        MIV 107
       DO 320 K = ItN                                                      MIV 106
       SWAP  B A(K.JROW)                                                   MIV 109
       AIK.JROW) o A(K,JCOLUM)
200

-------
      A(K,JCOLUM) B SWAP                                                MIV 111
320   CONTINUE                                                          MIV 112
330   CONTINUE                                                          MIV 113
340   RETURN                                                            MIV 114
C                                                                       MIV 115
C                                                                       MIV 116
C                                                                       MIV 117
1     FORMAT  <1H1»20X,38HZERO DIVISION IN -MATINV-, JOB ABORTED)        MIV 118
      END                                                               MIV 119-
      SUBROUTINE MATMUL (A ,B ,C,NRA»NCARB,NCB>                            MM    1
C                                                                       MM    2
C                                                                       MM    3
C     MEETS X3.9 FORTRAN STANDARD -- JUNE. 1970                         MM    4
C                                                                       MM    5
C                                                                       MM    6
C     ««««««#«»««»•«««««*««««««»««»#«»*««»««««««««»«»»««»»«0»«»««««««»ft»MM    7
C                                                                       MM    8
C                                                                       MM    9
C      C • A * B» WHERE A»B»AND C ARE MATRICES                          MM   10
C      NRA « NUMBER OF ROWS IN A (AND C)                                MM   11
c      NCARB « NUMBER OF COLUMNS IN A AND ROWS IN B                     MM   12
C      NCB « NUMBER OF COLUMNS IN B (AND C)                             MM   13
C                                                                       MM   14
C      *** NOTE *** MATRIX C MUST NOT OCCUPY THE SAME STORAGE AS        MM   15
c      MATRICES A OR B IN THE CALLING SEQUENCE.                         MM   16
c                                                                       MM   17
g     e««««»»««»»«»«»«««»«**tt««»»«ft««»«*«ft»»«»««««ft»«ft«ft»tt»«»««««»««»««OMM   18
C                                                                       MM   19
      DIMENSION A(NRA,NCARB)                                            MM   20
      DIMENSION B(NCARB,NCB)                                            MM   21
      DIMENSION C(NRA,NCB)                                              MM   22
C                                                                       MM   23
      DO 110 I » 1,NRA                                                  MM   24
      DO 110 J « 1»NCB                                                  MM   25
      SUM » 0.                                                          MM   26
C                                                                       MM   27
      DO 100 K « 1,NCARB                                                MM   28
      SUM « SUM*A(I»K)»B(K,J)                                           MM   29
100   CONTINUE                                                          MM   30
      C(I.J) • SUM                                                      MM   31
110   CONTINUE                                                          MM   32
      RETURN                                                            MM   33
c                                                                       MM   34
      END                                                               MM   35-
                                                                               201

-------
       SUBROUTINE  MATNVT(A»NiO)                                           MT    *
 C                                                                        MT    2
 C                                                                        MT    3
 C      MEETS X3.9  FORTRAN STANDARD  « JUNE.  1970                          MT    *
 C                                                                        MT    5
 C                                                                        MT    6
 r      ««#«»#»#»»»«»«*#«»«»«*»»#»«»«»#«»«»«#«»»»»*«*«»«***»»***»*****»«»*MT    7
 C                                                                        MT    8
 C      MATINVRT RETURNS A-INVERSE  WHERE  A  IS AN N X N MATRIXi             MT    9
 c                                                                        MT   10
 C      NOTE N IS LIMITED  TO 24.   IF DESIRED  N EXCEEDS THIS LIMIT.        MT   11
 C      SEE MATINV                                                         MT   12
 C                                                                        MT   13
 C      •«*»«»*«»«*»««««ft*«««*««««»«*««»««*«««*«***«»»«*****»»**»*«ft*«**«*MT   14
 c                                                                        MT   15
       DIMENSION A(NiN)                                                   MT   16
       DIMENSION WORK196)                                                 MT   17
 C                                                                        MT   IB
       CALL MATINV(AiN.N»B»OtWORK.WORK<25)tWORK<49)«D)                    MT   19
       RETURN                                                            MT   20
 C                                                                        MT   21
       END                                                               MT   22-
       SUBROUTINE MATSCL(X.A»NR.NC)                                       MS    1
 C                                                                       MS    2
 C         MULTIPLIES MATRIX A (WHICH IS NR ROWS BY NC COLUMNS)  BY X     MS    3
 C                                                                       MS    4
       DIMENSION A(NR.NC)                                .                 MS    5
 C                                                                       MS    6
       DO 100 K - liNC                                                   MS    7
       00 100 L • liNR                                                   MS    6
 100   A(LiK) * X«A(L,K)                                                 MS    9
       RETURN                                                            MS   10
       END                                                               MS   11-
      SUBROUTINE MDATE(IDATE)                                            MO    1
C                                                                       MD    2
C                                                                       MD    3
      DIMENSION     IDATE(l)                                            MD    4
      RETURN                                                            MD    5
      F.NO                                                               MD    6-
202

-------
      SUBROUTINE NEWPAG(TITLEiLSKIP,IOATE)                               NE    1
      DIMENSION     TITLE(20)»          IDATE(l)
      DATA NPAGE/0/                                                     NE    3
      PRINT 1                                                            NE    4
      IF (LSKIP.EO.O)  60 TO 110                                         NE    5
      DO 100 I « liLSKIP                                                NE    6
      PRINT 2                                                            NE    7
100   CONTINUE                                                          NE    8
110   NPAGE =  NPASE*!                                                    NE    9
      CALL SECOND(A)                                                    NE   10
      PRINT 3i TITLEtA.IDATEtNPAGE                                      NE   11
      RETURN                                                            NE   12
C                                                                       NE   13
C                                                                       NE   14
1     FORMAT  <1H1)                                                      NE   15
2     FORMAT  (1H )                                                      NE   16
3     FORMAT  (1H ,IX.20*4,5x»9HCP TIME =,F8.2f2xiSHDATE ,2X.A10«2Xf5HPAGNE   17
C7l   ENGAPH5»X2»4A2»X2» ETADH5iX2»2.8F«« EMIT PCH9»X5«4A02»Xl• HI( TAMROF     3
     IE >I5)                                                            NE   IB
      END                                                               NE   19-
      SUBROUTINE NUBETA(BETAfNR)                                        NB    1
C                                                                       NB    2
C                                                                       NB    3
£„.._ MODIFIES BETA MATRIX ACCORDING TO STATIONARITY ASSUMPTIONS         NB    4
      DIMENSION     BETA(NRtl)                                          NB    5
C                                                                       NB    6
      BETA(3t4) = -!•                                                   NB    7
C                                                                       NB    6
      RETURN                                                            NB    9
r                                                                       NB   10
r                                                                       NB   11
      END                                                               NB   12-
      SUBROUTINE NURATE(RATEFF»RATKONtCONUP)                            NR    1
                                                                        NR    2
                                                     DUE TO             NR    3
                                                                        NR    4
                                                                        NR    5
                                                            CONUP(l)    NR    6
                                                                        NR    7
                                                                        NR    8
                                                                        NR    9
                                                                        NR   10
                                                                        NR   11-
C
c —
c—
c

c

c



THIS ROUTINE
STATIONARITY

DIMENSION

RATEFFO) =

RETURN
END

COMPUTES ANY PSEUDO-RATE CONSTAN
ASSUMPTIONS.

RATEFF(l), RATKON(l),

RATKON f 3) »RATKON ( 1 ) «CONUP (3 )



                                                                                203

-------
c
c
120
C
130

C
C
1
2
3
4
5
6
       SUBROUTINE  PREDAT

       EXPURGATED  VERSION  OF  PREDATA  	 6.6.70
       SUBROUTINE  PREDATA  PRINTS  THE  IMAGES OF DATA-CARDS.
          THE  I/O  BUFFERS  MUST  BE OF  THE  FORM ... (INPUTfTAPE5»...)
          (NOT  TAPE5=INPUT)
          PREDATA  TRANSFERS DATA-CARDS  FROM INPUT TO TAPEBt UNTIL
          FINDING  AN  EOF
       DIMENSION  IMAGE(gO)
       DATA  LDTiLPT»ARO/5.6»lH*/
       DATA  UIN /3/
       DATA           MORE/4HMORE/


C
c
c
c
c
c
100
c

no
c
c
c
REWIND UDT
LYN o o

SSSSrsSSSSSSSSSSSSSSSS

THIS =«SPIN* ROUTINE
LFR. LPT. LOT

CONTINUE

READ (LIN,1) IMAGE
IF (EOF. LIN) 120.110
CONTINUE








USES AS INPUT , . .

NOTE: For use on an IBM machine
lines 28 and 29 should be
deleted and replaced by the
following











READ (LIN ,1,ERR=130,END=120) IMAGE






 IF   .EQ.O)  WRITE  (LPTtS)
 IF  (MOD(LYN.IO).EO.O)  WRITE  (LPT. 3)  (K »K = 1 .80 . 10 ) » ( ARO.K
 LYN = LYN+1
 WRITE  (LPT, 4) LYN, IMAGE
 WRITE  (LDT.l) IMAGE
 IF  (IMAGE(l) .NE.MORE)  GO TO  100


 CONTINUE
 REWIND LOT
 WRITE  (LPT»5)
 RETURN

 PRINT fe
 CALL EXIT
FORMAT  (20A4)
FORMAT  (1H1 ,8X,20HIMAGES OF DATA-CARDS)
FORMAT  (lH010XfiI10/14X6HCARD  A1.B(9H..
FORMAT  (I1B,2X,20A4)
FORMAT  (1H1)
FORMAT  (1H1 ,10X,J4HERROR ON TAPES)
END
                                                                 .8)
PR
PR
PR
PR
PR
PR
PR
PR
PR
PR
PR
PR
PR
PR
PR
PR
PR
PR
PR
PR
PR
PR
PR
PR
PR
PR
PR
PR
PR
PR
PR
PR
PR
PR
PR
PR
PR
PR
PR
PR
PR
PR
PR
PR
PR
PR
PR
PR
PR
PR
PR
PR
PR
PR
PR
PR
PR
1
2
3
4
5
6
7
e
9
10
11
12
13
14
15
16
17
16
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
36
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57-
204

-------
c
c
c
c
100
SUBROUTINE QGEN (A iB.CiN)
DIMENSION     A(NtN)

	         THIS ROUTINE GENERATES THE Q-MATRIX
      DO 100
      A (JiJ)
      DO 100
         = ItN
         B-A(JiJ)
         » liN
CONTINUE
RETURN
END
QG
QG
QG
QG
OG
QG
QG
QG
OG
QG
QG
QG
QG
 1
 Z
 3
 4
 5
 6
 7
 8
 9
10
11
12
13-
100
110

120

130
SUBROUTINE SECOND (A)
RETURN
END
SUBROUTINE SOURCE (CONUP)
COMMON/CHEM/ ISTOY R (20 120 ) t RATE(20tlO)»
1 CONIN(20flO)i RATEFF(20)»
2 NKt NOREAC.
3 NOSPEC. WTMOLE(20)t
4 JJ(21). NSTDY
DIMENSION CONUP(l)

CALCULATION OF RATE

DO 130 K « l.NOSTAT
_ _ _____ rnwuFPT rowrFNTRATlONS TO PPHM
DO 100 J » 1. NOSPEC
CONUP(J) » CONIN(JfK)««TMOLE(J)
CONTINUE
CALL NURATE(RATEFF,RATKON, CONUP)
DO 130 J * ItNK
KA • JJ(J)
KB • JJIJ+D-1
CUE • 0.
DO 120 N • KAiKB
I • II (N)
PROD • 1.
DO 110 L « 1. NOSPEC
PROD • PROD»CONUP(L) *»ISTOYR (I »L>
CONTINUE
CUE « CUE*PROD«fATEFF(I>»BETA(ItJ)
CONTINUE
RATE(J.K) " CUE/WTMOLEU)
CONTINUE
RETURN
END
SE
SE
SE
SE
SE
SO
BETA(20«20) .SO
• RATKONI20) . SO
NOSTAT. SO
11(400). SO
SO
SO
SO
SO
SO
SO
SO
so
so
so
so
so
so
so
so
so
so
so
so
so
so
so
so
so
so
so
so
1
2
3
4
5-
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
26
29
30
31
32-
                                                                               205

-------






c
c
c
c
c
c
c

c


100
c
c
c
SUBROUTINE STATE (CONEW.CONUP tNROW)
DIMENSION CONEW (NROW.l ), CONUP ( 1 )
COMMON/CHEM/ ISTOYR (20 »2fl ) i RATE(2o»10)i BETA(ZO»20)
1 CONIN(20ilO)i RATEFF<20). RATKON(20)t
2 NKt NOREACi NOSTAT.
3 NOSPEC* WTMOLE(20)t 11(400).
4 JJ(21)i NSTOY

.. 	 . 	 „. COMPUTES STEADY STATE CONCENTRATIONS - MARK 17
16-REACTION KINETIC MODEL
FOR SINGLE HYDROCARBON MIXTURE

....._..—.,. FOUR STEADY-STATE SPECIES — N03i N205«OHiR02

DO 110 K • 1, NOSTAT
............ CONVERT FROM MASS FRACTION TO PPHM
DO 100 J » 1»NK
CONUP (J) • CONEW  /RATKON ( U » /RATKONST

C

C
C
C

C

C
C
C


C

C


C


C

c
c
c

c

c
c
1(12)
	 ..... CONVERT BACK TO MASS FRACTION
CONEW(6»K) « CONEW(6.K)/WTMOLE<6)

- 	 N205

CONEW(7iK) * RATKON(11>»CONUP<3>«CONUP(4)/RATKON<14)
	 ,.— . CONVERT BACK TO MASS FRACTION
CONEW(T.K) v CONEW(7.K)/WTMOLE(7)



Al • .(RATKON(4)»CONUP(2)*RATKON(7)»CONUP(D *RATKON (g) »CONUP (3) )
A2 « BETA (5.8)«RATKON(5)*CONUP(1)

A3 » BETA(4.9)»RATKON(4)#CONUP(2)

A* » -

DET B A1»A4-A2»A3


	 ..... OH
83 « (A4»B1-A2»B2)/DET
	 ,. CONVERT BACK TO MASS FRACTION
C°NEW(8.K) a B3/WTMOLE<8)

	 - 	 R02
ST
ST
ST
ST
ST
ST
ST
ST
ST
ST
ST
ST
ST
ST
ST
ST
ST
ST
ST
ST
•ST
ST
ST
ST
ST
ST
ST
ST
ST
ST
ST
ST
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
la
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
206

-------
c     	. CONVERT BACK TO MASS FRACTION                        ST   56
      B4 « (Al«B2-A3»8l)/DET                                            ST   57
C                                                                       ST   58
      CONEW(9iK) « B4/WTMOLE(9)                                         ST   59
C                                                                       ST   60
110   CONTINUE                                                          ST   61
      RETURN                                                            ST   62
      END                                                               ST   63-
      SUBROUTINE TIMEX (KSTEPfTITLEtIDATE)                               TI     1
      DIMENSION     TITLE(l).           IDATE(l)                        TI     2
      IF (KSTEP.GT.l) GO TO 100                                         TI     3
      TIME "0.                                                         TI     4
      NSTEP » 0                                                         TI     5
      IGO r o                                                           TI     6
      ICYCLE * -1                                                       TI     7
100   ICYCLE » ICYCLE*!                                                 TI     8
110   CALL SECOND(CTIME)                                                TI     9
      IF (IGO.EQ.l) GO TO 130                                           TI    10
      IF (ICYCLE.GTtO) GO TO 120                                        TI    11
      TIME * CTIME                                                      TI    12
      TSTART * CTIME                                                    TI    13
      RETURN                                                            TI    14
C                                                                       TI    15
120   I « KSTEP-NSTEP                                                   TI    16
      T " CTIME-TIME                                                    TI    17
      PRINT 1. ICYCLEil.T                                               TI    18
      NSTEP « KSTEP                                                     TI    19
      TIME « CTIME                                                      TI    20
      RETURN                                                            TI    21
C                                                                       TI    22
130   T » CTIME-TSTART                                                  TI    23
      CALL NEWPAG(TITLE»0»IDATE)                                        TI    24
      PRINT 2t T                                                        TI    25
      RETURN                                                            TI    26
C                                                                       TI    27
C                                                                       TI    28
      ENTRY ENDRUN                                                      TI    29
      IGO « 1                                                           TI    30
      GO TO 110                                                         TI    31
C                                                                       TI    32
C                                                                       TI    33
C                                                                       TI    34
1     FORMAT 
-------
       SUBROUTINE TRIVRT(A.D»SCALE»WORK|NRA.NCA»NMAT»NNR.U)               TR    1
       DIMENSION     A(NRAiNCA)i    D(NRA.NMAT)t    U(NRAiNMAT)i           TR    2
      1              WORK(NRA.NRA).      SCALE(NRA)                       TR    3
 C                                                                        TR    *
 C     .....ARRAY - A - MUST BE Of SIZE  (NRA |NRA«NMAT),                   TR    5
 C             I.E.i NCA » NRA»NMAT                                       TR    6
 C                                                                        TR    7
 C         SUBROUTINE TRIVRT INVERTS A TRIDIASONAL  MATRIX  WHOSE  ENTRIES  TR    8
 C              ARE ALSO MATRICES. THE LOWER-DIAGONAL  ENTRIES  ARE         TR    9
 C              IDENTITY MATRICES. THE UPPER-DIAGONAL  ELEMENTS ARE        TR   10
 C              SCALED IDENTITY MATRICES.                                 TR   H
 C                                                                        TR   12
 C         MODIFIED VERSION OF OLD TRIVRT.  CODE DATE  4.22.71             TR   13
 C                                                                        TR   14
       J « 1                                                              TR   15
       CALL MATNVT(AtNNRfDET)                                             TR   16
       IF  (ABS(DET).LT,1.E-06) PRINT lfJ»DET                              TR   17
       CALL MATMUL(AiD.WORK»NNR,NNRtl)                                    TR   18
       CALL XMIT(NNR.WORK»D)                                              TR   19
       J = NMAT-1                                                         TR   20
       DO 100 I * 2.J                                                     TR   21
       IA » (I-1)«NRA*1                                                   TR   22
       IB * IA-NRA                                                        TR   23
       CALL MATSUB(AdilA) tAd»IB)»A<1tIA)iNNR.NNR)                       TR   24
       CALL MATNVT(AdilA) iNNRiDET)                                       TR   25
       IF  (ABS(DET).LT.1.E-06) PRINT l.JiDET                              TR   26
       CALL MATSUBiO
-------















100
1
2





C
C


C




C
1



c




C
100

110


SUBROUTINE UPFLUXITIME.J.LOC.NUM)
COMMON/FLUXES/FLXIN(3»500) . FLXTIM (500 ) i NFLUX
COMMON/TRACER/NOSPl . NOSTM1 , TDELZt
1 TRACIN(IO), SCALOF(ll)i FLXDGE<20>.
2 FLXWALI20)
DIMENSION LOC(l)
IF (NUM.EQ.O) RETURN
WRITE (10.1) TI«E
DO 100 I = l.NUM
K = LOC(I)
FLXWAL (K) * FLXINd .J)
IF (I.EQ.D FLXWAL(K) = FLXWAL (K ) *0 t25
FLxDGE(K) = o.
FLXWAL(K) * FLXWAL(K)<*1,E*8
WRITE (10»2) KiFLXWAL(K)
CONTINUE
FORMAT (1H0.10X.23HFLUXES UPDATED AT TIME iG15.8>
FORMAT (1H0.10X.17HSPECIES NUMBER « .I3.5X.
1 15HSCALED FLUX IS .615.8)
RETURN
END
SUBROUTINE UPR ATE (TIME. RATNEW, RATOLD.RATEFF)
DIMENSION RATOLD(l). HATEFF(l)


RATOLD(l) * RATNEW
RATEFF(l) « RATNEW

RATOLD(IO) » 1.0E-3»RATOLD(l)/.267
RATEFF(IO) e RATOLD(IO)
WRITE (lOtl) TIME.RATOLDU)
RETURN

FORMAT (1H0.10X.19HK1 UPDATED AT TIME »Gl5.8.2X»8H-"- Kl = »Gl5.8)
END
SUBROUTINE WXMIT(NWOS,NCLS,SF.F«OMiTO)
DIMENSION FROM(NCLSil) i TO ( 1 )

IF (NWDS.OT.O) 80 TO 100
A « FROM(lil)»SF
CALL XMIT(NWDS»AiTO>
RETURN

DO lio I * liNWDS
TO (I) • FROM(1.I)»SF
CONTINUE
RETURN
END
UPF
UPF
UPF
UPF
UPF
UPF
UPF
UPF
UPF
UPF
UPF
UPF
UPF
UPF
UPF
UPF
UPF
UPF
UPF
UPF
UPF
UR
UR
UR
1 ID
UK
UR
UR
UR
UR
UR
UR
UR
UR
UR
UR
UR
WX
WX
WX
WX
WX
WX
WX
WX
WX
WX
WX
WX
WX
1
2
3
4
5
6
7
a
9
10
11
12
13
14
15
16
17
18
19
20
21-
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15.
1
2
3
4
5
6
7
8
9
1 A
io
11
12
13-
209

-------
210

-------
F.5  BLOCK DATA

-------
 BLOCKDATA

     BLOCK DATA PROGRAM NUMBER  ONE

     LOAD TRAFFIC AND STATIONARY SOURCE DATA INTO COMMON /DATFIL/
 COMMON /DATFL1/ FFWY(25,25), FSRF (25,35), FXN02(25,25),
1                FXHCR<25*25)* FPPN02(30»3>• FORN02(3oi3)t
2                FORHCR(30,3)
 DIMENSION FFWYAO85), FFWYB1240)* FSRFA(264), FSRFB(163).
1          FSRFC<154)« FSRFD144I* FXN02A(291>. FXN02BU74).
2          FXN02C(160>. FXHCRAI290). FXHCRBU72). FXHCRCU63)
 EQUIVALENCE  (FFwyA(1) ,FFWY(111)I»  (FFWYB(1),FFWY(11,16)),
1             (FSRFAd ) »FSRF (1 tl) ) i  (FSRFB (1) tFSRF (15i 11) ) i
2             >»  (FSRFD(1)iFSRF(7,24)).
3             (FXN02AU) ,FxN02(l,l) ) ,  (FXN02B (1 ) ,FxN02 (17 ,12) ) ,
4             (FXN02C<1> *FXN02<16*19> )i  (FXHCRA (I ) iFXHCR (1 11 ) ) t
5             (FXHCRBU > *FXHCR<16»12) ) ,  (FXHCRC(1)fFXHCR(13t19))
 DIMENSION IPPN08(30)» JPPN02(30)» XPPN02I30),
1          IOpN02(30), JOsN02(30)» XOpN02(30),
           IORHCRI30)* JORHCR<30>* XORHCRI30)
 EQUIVALENCE  UPPN02I1)iFPPN02(lil))i
1             (XPPN02U) iFPPN02(l,3) ) ,
2             (JORN02H) iFORN02(l t2) ) i
3             *FORHCR<1»1» »
4             (XORHCR(1),FORHCR(1,3) )
                                       (JPPN02U) »FPPN02(112» ,
                                       (IORN02(1) ,FORN02(1,1)>,
                                       (XORN02<1)»FORN02(1*3>) I
                                       (JORHCR(l) iFORHCRd »2) I t
DATA FFWYA/
   45» 0«»
    61.00.
    91.00*
   10* 0.*
    1* 0.*
   529.00.
   161.00*
    4« 0.*
   236.00*
   138.00*
    1» 0..
    2* 0.*
   257.00.
   14» 0.,
    3Q.OO*
   444.00*
   283.00.
    21.00*
1
2
3
4
5
6
7
a
9
1
2
3
4
5
6
7
a
9
             18.00*
             59.00*
             11.00*
            257.00*
            349.00*
            11* 0.»
            145.00*
             2* 0.*
            loe.oo*
            241.00*
             15.00*
             1* 0.*
            348,00*
 DATA FFWYB/
    531.00*
     70*00*
    426.00*
    234.00*
     3* 0.*
    311.00*
    159.00*
             33.00*
            332.00*
              3.00*
1
2
3
4
5
6
7
           449.00*
            3» 0.»
           466.00*
           285.00*
           205.00*
           254.00.
            4* 0,»
24« 0"
19* 0..
153.00*
 22.00*
131.00*
213.00*
131.00*
 68.00*
276.00*
207.00*
 1* 0..
 2» 0.*
159.00*
 2* 0..
404.QO*
14* 0.*
 1» 0.*
 5* 0.*

623.00*
 32.00*
795.00*
147.00.
436.QO*
362.00*
356.00*
 So.OO*
115.00*
 78.00.
 5« 0.*
11» 0.*
144.00*
343.00*
 1* 0.*
 1» 0..
 85.00*
 56.00*
 16.00*
131.00*
305.00*
 2* 0»»
295.00*
265.00*
101.00*

576.00*
 15.00*
452.00*
 5« 0. •
620.00*
291.00.
 3* 0. »
  6.QO *
160.00*
 2* 0.,
181.00*
143.00*
 1» 0.,
545.00*
137.00*
 59.00*
 8* 0.,
383.00,
 7* 0..
 1* 0.,
 2» 0.,
366.00*
160.00*
 2* 0.,
295.00*

 2* 0,,
 S* 0.*
565.00*
 16.00*
257.00*
214.00*
215.00*
    0"
163.00*
 67.00.
112.00*
 45.00*
 25.00*
340.00*
11« 0.*
 83.00*
391.00*
102.00*
351.00*
314.00*
302.00*
 2* 0.*
 2« 0.*
 12.00*
511.00*

205.00*
473.00*
518.00*
 4* 0,*
257.00*
203.00*
194.00*
 97.00*
148.00*
169.00*
183.00*
107.00*
398,00*
323.00*
625,00*
330.00*
326.00i
243.00*
 32.00*
289.00*
 1* 0.*
281.00*
391.00.
 59.00.
 51.00*

263.00*
141.00*
224.00*
242.00*
297.00*
170.00*
290.00*
       BL
       BL
       BL
       BL
       BL
       BL
       BL
       BL
       BL
       BL
       BL
       BL
       BL
       BL
       BL
       BL
       BL
       BL
       BL
       BL
       BL
       BL
       BL
       BL
       BL
       BL
       BL
       BL
       BL
 95.QO*BL
 1* O..BL
 77.00.BL
150.00.BL
 2* 0.»BL
156.00.BL
195.00.BL
 1* 0.*BL
25l.00.6L
217.00.BL
253.00.Bl.
 1« 0.*BL
104.00.BL
527,00.81
129.00»BL
 2* O..BL
 42.00.BL.
 2* O./BL
       BL
156.00.BL
333.00'BL
 79.00.BL
137.00.BL
306.00*BL
l73.00*BL
335.00.BL
  0
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 la
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
29
 30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
                                                                          211

-------
a
9
i
2
3
4
5
6

193
423
66
383
51
3*
20*
119

.00.
.00*
,00i
.00*
.00.
o.«
O.t
.00.

109.00*
1» 0.*
65.00*
890.001
17* 0.*
37.00*
155.00*
19* O./

15* O.i
13.00i
43.00i
456, OOi
222.00i
15* O.i
69,00*


352.00*
90
11
426
1«
242
144


.00*
.00*
.00*
0>*
.00*
.00*


2* 0.,
28.00*
2* 0.,
494.00*
126.00*
1« 0.,
18* 0.,


140.00*
2» Ot*
169.00*
178,00.
I7.00i
156.00*
59.00*


275.00*
41.00*
271.00*
395.00.
104.00*
158.00*
3* 0.*


DATA FSRFA/
1
2
3
4
5
6
7
8
9
1
2
3
4
5
6
7
8
9
21*
52
18*
15
135
5
195
30
153
266
254
209
1
282
123
124
305
124
O.t
.00*
o..
.00*
.00.
.00.
.00*
.00.
.00*
.00*
.00.
.00*
.00*
.00.
.00.
.00.
.00.
.00*
5.00*
20* 0.*
36.00*
9* O.I
116.00*
25.00*
116.00i
49,001
175.001
182.00i
I57.00i
220.001
239.001
165.001
109.001
79.00*
242.00*
215.00*
119,00*
34.00*
126.00*
5.00*
74.00.
176.00i
166.00*
28.00*
60.00*
32.00*
413.00*
255.00*
304.00*
155.00*
11.00*
204.00*
323.00*
412.00*
18
104
107
5
80
88
203
142
125
6*
386
149
249
173
6»
288
.00*
.00*
.00*
.00*
.00*
.00*
.00*
.00*
.00*
O.i
.00.
.00*
.00*
.OOi
0.*
.00*
24UOO*
322
.00*
20* 0.,
277.00*
248.00*
5* O.i
11.00*
4* 0.,
190.00*
145.00*
2l2.00i
46.00*
317.00.
168.00*
175.00*
259.00*
9,00i
430.00*
113.00*
210.00*
7.00*
94,00*
215.00*
36.00*
26.00*
33.00*
98.00*
75.00*
200.00*
121.00*
162.00*
163.00*
94.00*
228.00*
360.00*
204.00*
31.00*
121.00*
218.00*
114,00*
100.00*
24.00*
6* O.i
48.00*
19.00*
1» 0..
219.00*
188.00*
75.00.
28.00*
283.00*
304.00.
324.00*
138.00*
6.00*
270.00*
DATA FSRFB/1
1
2
3
4
5
6
7
8
9
1
2
3
4
5
6
7
8
9
301
82
176
114
22
255
103
392
190
5
477
?]
476
324
121
117
579
180
.00*
.00*
.00.
.00.
.00*
.00*
.00*
.00*
.00*
.00*
.00*
.00*
.00*
.00*
.00*
.00*
.00*
.00*
93.00*
48.00'
265.001
62.00i
261.00i
386.00*
21.00*
331.00i
295,00*
4* O.i
364.00*
82,00*
254,00*
293.00*
45,00*
231,00*
290,00*
142.00*
96.00*
30.00*
293.00*
129.00.
296.00*
263.00*
9.00*
393,00.
119.00i
88.00,
292.00*
42.00*
338.00*
264,00*
53,00*
512,00*
199,00,
18.00*
104
6*
257
114
397
229
7
273
42
305
273
90
261
195
27
346
186
48
.00*
o.»
.00*
.00.
,00*
,00*
.00.
.00.
.00*
.00*
.00.
.00*
.00*
.00*
.00*
.00*
.00*
.00*
270,00*
189.00*
298.00*
95,00.
285.00*
234.00*
5* 0.,
322.00*
22.00*
255.00*
299,00,
33.00*
412.00*
127,00*
5,00*
459,00*
75,00,
50.00*
179,00*
255,00*
241.00*
57,00*
314.00*
181.00*
106.00*
305.00*
1.00.
255.00*
198.00*
12.001
413.001
43.00i
47,00*
478,00*
108.00*
73.00*
290.00*
328.00*
230.00*
4.00*
254.00*
24Q.OO*
266.00*
265,00*
37.00*
311.00*
185.00*
4* O.i
512.00*
39,00*
64.00*
468.00*
173.00.
1* 0..
DATA FSRFC/
1
2
3
4
5
6
7
1*
473
114
25
375
IPS
25
o.«
.00*
.00*
.00.
.00*
.00*
.00*
7,00*
226,00*
190.00*
1» 0, ,
259.00*
160.00*
30,00*
98.00,
217.00*
280.00*
2.00*
164.QO*
130.00*
17.00.
283
229
244
30
116
155
12
.00*
.00*
,00*
.00*
.00*
,00*
.00*
403.00.
285.00*
71.00*
70.00,
190.00*
232.00*
59,00.
549.00*
243.00*
10.00*
32,00*
236,00*
143.00*
63.00*
512.00*
250.00*
99.00*
260.00*
227.00*
66.00*
121.00*
1« O..BL
74.00»0l
311.00.BL
190.00.BL
150.00*61
109.00.8U
94.00*81
BL
BL
BL
196.00.BL
10.00.BL
29.00.BL
133.00.BL
4.00.BL
114.00*BL
6* O..BL
126.00*BU
249.00.BL
266.00.BL
116.00.BU
6* O..BL
192.00.BL
169.00»BL
231.00»BL
186.00*61
6* O..BL
312.00/BL
BL
197,00*BL
358.00'BL
135.00.BL
5* O..BL
292.00.BL
156.00.BL
413.00.BL
253.00.BL
l.OO.BL
478.00.8L
69.00.BL
125.00.BL
328.00.Bl
227.00.BL
99.00*BL
642.00*BL
131.00.BL
18.00/BL
BL
572.00.BL
242.00'BL
9,00*BL
478.00.BL
236,00'BL
77.00.BL
155.00.BL
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
212

-------
8
9
1
2
3
4
5
6
7
e
9
116
241
32
2BO
21?
?*
276
21
255
20
2
.00. 25.00.
.00. 218.00i
.00. 139.00*
.00. 247.00*
.00. 156.00*
O.t 239,00*
.00* 212.00.
.00 » 1 .00*
.00* 238.00*
.00.
.00.
27.00t
2» O.t
245.00.
183.00.
118,00.
180. OOt
91 ,00.
25Q.OO t
215.00.
2.00.
238. OOt
157.00i
60.00.
242.00.
77, OOt
107.00.
204.00.
57, OOt
249, OOt
4.00.
3* 0,.
266.00*
50.00.
155.00.
191.00.
126.00.
194.00.
204.00.
l.OOt
250.00.
131.00.
ItOOt
295.00t
4.00,
202. OOt
162.00t
149. OOt
182.00*
21. OOt
6. OOt
264.00.
58.00.
2.00*
251.00*
2» 0, .
223.00.
318. OOt
191.00.
350.00*
173.00.
6.00.
414.00.
91.00*
2» 0.*
233.00*
1.00
252.00
308.00.8L
76. OO.BL
268.00«BU
241.00.BL
2,00,61
328. OO.BL
113.00.BL
137.00.8U
54.00.BL
5«
O.iBL
221.00/BL
DATA FSRFO/
1
2
3
4
5
C
C
152
2
146
4
2«


• 00*
.00*
85.00*
6» O.t
.00* 172.001
.00*
O./


2.00*



66.QO*
2.00.
135,00.
1.00*



84.00*
2* 0..
43.00.
2.00*



73.00*
35. OOt
28. OOt
2.00.



7.00'
12.00.
17.00.
1.00.



2*00
34.00
1.00
3* 0.



2«
BL
O..BL
149.00.BL
2«
O..BL
2.00'Bl



DATA FXN02A/
1
2
3
4
5
6
7
e
9
i
2
3
4
5
6
7
a
9
20*
5
11
10«
11
14
22
11
35
11
29
11
5
23
11
25
11
25
0**
.00.
.00.
O.t
.00.
.00.
.00.
.00*
.00*
.00*
.00*
.00*
.00*
.00.
.00*
.00.
.00.
.00*
ItOO*
11,00»
ll.OOt
4.00*
11.00.
18.00.
13.00.
11.00.
35.00*
ll.OOi
29.001
11.00.
21.00.
23.00*
5.00*
25.00*
11.00*
22.00*
3.00*
11.00*
19« O.t
6.00.
11.00.
21.00.
ll.OOt
7« 0..
28.00.
ll.OOt
30.00.
11.00.
27.00.
19,00.
7« 0.*
24.00.
11.00.
22.00*
22° 0**
11.00.
5.00.
15,00*
11.00.
23.00.
11.00*
10.00*
21.00*
11.00*
30.00*
11.00*
34.00*
11.00*
6.00*
23,00.
11.00.
24.00*
3.00*
20* 0..
ll.OOt
20. OOt
11.00,
25. OOt
ll.OOt
18.00*
21.00.
11.00.
26.00.
11.00.
34.00.
11.00.
21<00.
23.00.
2.00.
24.00.
11«00>
5.00.
11.00.
2.00.
11.00.
37.00.
11.00.
21.00*
ll.OOt
8« 0.*
22.00*
11.00*
25.00*
ll.OOt
27.00*
19,00t
7* O.t
24.00*
11*00*
ll.OOt
ll.OOt
4» O.t
11.00,
37.00i
ll.OOt
23.00*
11.00.
19.00*
22.00*
8.00*
25.00.
ll.OOt
34.00*
19.00*
28.00.
23.00*
21*
BL
BL
BL
BL
O..BL
11. OO.BL
ll.OO.BL
S.OOtBL
8*
30.
11.
23.
11.
24.
18.
7*
24.
11.
34.
11.
29,
23.
DATA FXN02B/
1
2
3
4
5
6
7
8
9
1
2
3
4
5
6
7
27
6
24
5
31
10»
38
9
20
21
ie
19
20
1
10
10
.00*
• 00*
.00.
.00*
.00*
O.t
.00*
• 00*
.00.
.00.
.00*
• 00*
.00*
.00.
.00*
.00*
27.00*
29.00*
23.00*
8« 0,»
31.00»
10.00.
38,00*
2.00*
20.00*
21.00*
9.00*
19.00*
19.00*
1.00*
10.00*
lO.OOt
23.00.
29.QO*
23.00*
13, OOt
26.00*
19. OOt
29,00.
ItOO*
20.00.
9.00.
8.00*
20.00.
19.00.
1.00*
11.00.
13.00*
11.00*
25.00*
27.00*
25,00.
22.00*
21.00.
21.00.
1.00*
19,00*
1.00.
8.00*
20.00*
22.00*
10.00.
12.00.
13.00.
ll.OOt
22.00.
27. OOt
25. OOt
22*00*
21. OOt
21,00.
9* 0.*
19.00*
6. OOt
8.00.
21.00*
22.00.
3* O.t
12. OOt
12. OOt
ll.OOt
22.00*
23.00*
22. OOt
22*00*
20.00*
I9,00t
4.00*
37.00.
15.00*
8.00*
21*00*
21.00*
1.00*
12.00*
11.00*
8.00.
24.00*
11.00.
20.00.
18. 00*
19.00.
S.OOt
9.00t
37.00.
19.00.
9.00.
21*00*
20.00*
6.00.
12.00*
11.00*
7*
O..BL
00, BL
00, BL
00* BL
00, BL
OO.BL
OO.BL
O..BL
OOtBL
00, BL
OO.BL
OO.BL
OO.BL
00/BL
BL
O..BL
24.00»BL
11.
20.
7.
20.
3.
18.
29.
18.
19.
21.
20.
10.
11.
9.
OO.BL
OO.BL
OO.BL
OOtBL
00, BL
OO.BL
OOtBL
OOtBL
OO.BL
OO.BL
OO.BL
OOtBL
OO.BL
OOtBL
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
16Q
161
162
163
164
213

-------
8 9,00*
9 18,00*
1.00*
19,00*
10.00*
19.00*
3* 0.*
19.00*
1.00*
19.00*
3.00*
19.00*
7.00*
18.00*
DATA FXN02C/
1 18.00*
2 9.00*
3 10.00*
4 18.00*
5 8.00*
6 9.00*
T 16.00*
8 8.00*
9 15.00*
1 3,00*
2 15.00*
3 12* 0,*
4 11.00*
5 9.00*

19.00*
9,00*
10.00*
18.00*
8.00*
10.00*
19.00*
8.00*
12.00*
9« 0.*
15.00*
1.00*
9.00*
1.00*

19.00*
4« 0..
9.QO*
14.00*
12.00*
10.00*
16.00*
9.00*
7.00*
8,00*
12.00*
1.00*
7.00.
1 .00*

20.00*
4.00*
9.00*
13.00*
14.00*
9,00*
14.00*
13.00*
4.00*
9,00*
1,00*
1.00*
2.00*
15* O./

20.00*
4.00*
18.00*
9.00*
12.00.
1.00*
13,00*
18.00*
8.00*
9.00*
1.00*
10.00*
17» 0.,


20.00*
4.00*
16.00*
9.00*
8.00*
9.00*
9.00*
15.00*
8.00*
18.00*
8.00*
10.00*
9.00*


17.00*
8.00*
8,00*
7.00*
8.00*
10.00*
9.00*
15.00*
8.00*
17.00*
4,00*
12,00*
9,00*


DATA FXHCRA/
1 21» O.i
2 11.00,
3 12* 0..
4 10* 0. *
5 11.00*
6 25.00*
7 3.00*
8 11.00*
9 33.00*
1 11.00*
2 39.00*
3 32.00*
4 7» 0.*
5 36.00*
6 11.00*
7 61.00*
8 13.00*
9 56.00*
5,00*
11.00*
5.00*
10.00*
11.00*
30.00*
14,00*
11,00*
33.00*
11.00*
47.00*
13.00*
6.00*
36.00*
11.00*
36,00*
11.00*
56.00*
23* 0.*
20* 0.*
6« 0.*
15.00*
11.00*
32.00*
11.00*
7» 0..
33.00*
11.00*
47.00*
11.00*
31,00*
36,00*
5.00*
36.00*
11.00*
56.00*
10.00*
5.00*
5.00*
21.00*
11.00*
33.00*
11.00*
15.00*
33.00*
11.00*
34,00*
11.00*
46.00*
34.00*
7« 0.*
36.00*
11.00*
56.00*
11.00*
11.00*
11.00*
31.00*
11.00*
18.00*
11.00*
30.00*
33.00*
11.00*
34.00*
11.00*
61.00*
15.00*
6.00*
36.00*
11.00*
70,00*
21* 0.*
11.00*
11.00*
11.00*
11.00*
18.00,
11.00*
32,00*
11.00*
7* 0.*
34.00*
11.00*
61.00*
13.00*
31.00*
36.00*
2.00*
70.00*
5,00*
11,00*
11.00*
4» 0.*
11.00*
18,00*
11.00*
33,00*
11.00*
1.00*
34.00*
11.00*
36.00*
11.00*
46.00*
34.00*
7» 0.*
57.00.
DATA FXHCRB/
1 45.00*
2 7» 0.*
3 70.00*
4 11.00,
5 51.00*
6 20.00*
7 47.00*
8 34.00*
9 4» 0.*
1 49.00*
2 22.00*
3 30,00,
4 37.00,
5 62.00*
6 3* 0. •
7 37.00.
8 49.00.
36.00*
10.00*
57,00*
5.00*
90.00*
4.00*
49,00*
19,00*
20.00*
110.00*
39.00*
30.00*
37,00*
49.00,
5,00.
60.00*
36.00*
36.00*
56,00*
45.00*
8* 0..
90.00*
4.00*
49.00*
12.00*
40.00*
110.00*
39.00*
35.00,
60.00*
36.00*
24.00*
60.00*
36.00*
33.00*
56.00*
45.00*
30.00*
69,00*
8* 0>*
110.00*
34.00.
40.00*
82.00*
32.00*
39,00*
60.00*
36.00*
39,00*
53.00*
31.00*
11.00*
56.00.
36.00*
51.00*
50.00*
25.00*
110.00*
9.00*
45.00*
56.00*
32.00*
39.00.
53.00*
1.00*
33.00*
45.00*
31.00*
11.00*
56.00*
36.00*
51.00*
50.00*
40.00*
82.00*
2.00*
45.00*
56,00*
1.00*
33.00*
45.00*
1.00*
33.00*
45.00*
4.00*
11.00*
56.00*
33,00*
51.00*
35.00*
45.00*
56.00*
2.00*
47.00.
34.00*
1» 0.*
33.00*
45.00*
4.00*
35.00*
62.00*
30.00*
9.00.BL
18,00'BL
BL
17.00.BL
9.00.BL
16.00.BL
1« O..BL
8.00.BL
10.00.BL
9.00.BL
17.00.BL
8.00.BL
15.00.BL
l.OOiBL
12.00.BL
9.00.BL
BL
BL
BL
ll.OO.BL
ll.OO.BL
ll.OO.BL
5.00.BL
8« O..BL
18.00.BL
ll.OO.BL
33.00.BL
ll.OO.BL
31.00.BL
34.00.BL
10.00.BL
36.00.BL
ll.OO.BL
61.00.BL
34.00.BL
51.00.BL
45,00/BL
BL
6.00.BL
70.00.BL
ll.OO.BL
51.00.BL
35.00.BL
45.00.BL
56.00.BL
l.OO.BL
49.00.BL
4.00*BL
30.00.BL
35.00.BL
62.00*BL
30.00,BL
37.00.BL
62,00*BL
4« O..BL
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
214

-------
9
DATA
1
2
3
4
5
6
7
fl
9
1
2
3
4
5

DATA
1
2
DATA
1
2
DATA
1
2

DATA
1
2
DATA
1
2
DATA
1
2

DATA
1
2
DATA
1
2
DATA
1
2

END
5.00,
FXHCRC/
48.00*
38.00.
1*0.,
36.00*
41.00,
31.00,
42.00,
39.00,
31.00,
P3.00*
31.00*
13.00,
36.00,
1.00,

IPPN02/
16,
10,
JPPN02/
7,
22,
XPPN02/
2696.,
211.,

IORN02/
12,
9,
JORN02/
9,
10,
XORN02/
573.,
344.,

IORHCR/
12,
9,
JORHCR/
9,
10,
XORHCR/
44.,
26.,


15.00,

44.00,
31.00,
15.00,
36.00*
41.00,
30.00*
36.00*
41.00*
35,00,
31.00*
31.00*
13.00*
42.00,
32.00*


7,
11,

12,
21,

998.,
60.,


15,
17,

12,
13,

69.,
79.,


15,
17,

12,
13,

5.,
6.,


23.00,

40.00,
31.00*
15,00.
35.00*
30.00,
30.00,
6,00,
41.00,
39,00,
31.00,
35,00,
31.QO,
42,00,
32.00*


8*
20»0 /

10*
20*0 /

33.00

40.00
32.00
19.00
35.00
30.00
30.00
35.00
* 36

• 49
• 30
, 34
, 35
, 20
, 34
, 35
30.00, 15
39.00
30.00
39.00
16.00
40.00
31.00


19,


3*


2005., 1225.,
20*0, /


14,
12,

11,
10,

42.,
116.,


14,
12,

11,
10,

3, ,
9.,





11*
12,

9,
8,

34.,
445.,


11,
12,

9,
8,

3.,
34.,


, 53
» 25
» 39
, 5
, 37
» 31


11*


8*


333.,



11*
7*

10*
12,

27.,
556.,


11,
7,

10,
12,

2.,
43.,


.00, 39

•00* 49
.00* 1*
.00, 38
.00* 37
.00* 10
.00, 34
•00* 35
.00, 2*
.00, 53
.00, 15
•00, 53
.00, 14*
.00, 27
>OQ, 1


6,


14,


78,,



17,
17*0 /

12,
17*0 /

135.,
17»0 ./


17,
17*0 /

12,
17*0 /

10.,
l7*0./


.00,

.00*
0.,
.00,
.00*
.00*
.00*
.00,
0.,
.00,
.00*
.00*
0.,
.00*
39

43
1
42
37
30
38
37
30
48
9*
53
3
10
.00* 16*


8*


24*


186.,



14,


14,


7,,



14,


14,


1 . ,



































.00,

.00,
.00,
• 00,
.00*
.00*
.00,
.00,
.00,
.00,
0.,
,00*
.00,
,00, ]
o./


15,


20,


31.,



14,


8,


27.,



14,


8*


2.,



48,00/BL
BL
38.00,81
1.00»Bl
42.00,BL
39.00*BL
31.00.BL
42.00.BL
37.00*BL
31.00,BL
33.00,91-
30.00*BL
48.00*BL
36.00.BL
16« 0,,BL
BL
BL
BL
BL
BL
BL
BL
BL
BL
BL
BL
BL
BL
BL
BL
BL
BL
BL
BL
BL
BL
BL
BL
BL
BL
BL
BL
BL
BL
BL
BL
BL
BL
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
215

-------
BLOCK DATA BL
BL
BLOCK DATA PROGRAM NUMBER TWO BL
BL
BL
COMMON /DATFL2/ FSLOW (25*25*4) BL
DIMENSION FSLOW6I625)* FSLOW7(625 • FSLOW8<625>» FSLOW9(626> BL
EQUIVALENCE (FSLOW6 ( 1 ) iFSLOW ( 1 , 1 , 1 ) ) i (FSLOW7 ( 1 ) i FSLOW ( 1 , 1 ,2) ) , BL
1 00*BL
50.00.BL
BL
BL
BL
50.00.BL
3*60. .BL
40,00*BL
268
269
270
271
272
273
374
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
216

-------
if
5
A
7
8
9
l
35.00 »
25.00.
55.00.
55.00*
45.00.
45.00*
55.00.
30.00 i
35.00<
SO.OOi
11*60. i
45.00i
2«60.i
55.00i
- 35.00*
• 50.00*
i 35.00*
i 40*00*
i 15*60..
> 45.00*
i 2*60.*
                                    35.00i  1*60.»   50.00»  40.00»BL   323
                            40.00* 16*60,
                            50.00*  35.00
                            3*60«*  55.00
                            45.00.  2*60.
                            45.00. 13*60.
                            55.00*114*60,/
END
t 40.00*
i 50.00*
• 55.00*
, 55.00,
« 55.00*
t


35.00*
55,00*
45.00*
55.00,
SO. 00*



3*60.. BU
55,00*BL
45.0Q.BU
1*60, ,BL
55.00*BL
BL
BL
BL
324
325
326
327
328
329
330
331

C
C
C
C




C



C




C






C



C

BLOCK DATA BL
BL
BLOCK DATA PROGRAM NUMBER THREE BL
BL
BL
COMMON /DATFL3/ FFAST (25.25,4) BL
DIMENSION FFAST6<625)» FFAST7<625>« FFAST8<625>* FFAST9<625) BL
EQUIVALENCE (FFAST6 ( 1 ) ,FFAST ( 1 , 1 , 1 )) , (FFAST7 ( 1 ) ,FFAST ( 1 .1 ,2) ) . BL
1 (FFAST8U) ,FFAST(1, 1,3)1 , (FFAST9 < 1 > .FFAST (1 » 1 •»» BL
BL
DATA FFAST6/ BL
1 40<5*60. , 58,00. 55.00, 51*60. • 55.00. 55.00. 24060., 55.00*BL
2 55. 00*135*60. / BL
BL
DATA FFAST7/ BL
1 258*60.* 55.00* 50.00*128*60.. 55.00, 21*60.* 55.00* 55.00'BL
2 22*60.* 55.00* 55.00* 50.00* 23*60.* 55.00* 55.00, 55.00.BL
3 55.00* 21*60.* 55.00* 2*60.* 55.00* 55.00, 135*60. / BL
BL
DATA FFAST8/ BL
1 211*60., 55,00, 23*60., 55.00. 79*60., 50.00, 16*60., 55.00,BL
2 23*60., 50.00* 55.00* 23*60,* 55.00, 3*60.* 55.00* 55.00.BL
3 18»60.» 55.00, 4*60., 55,00, 55,00, 17*60., 55,00, 55.00.BL
4 4*60.* 55.00* 30.00* 24*60** 55.00* 55.00* 55.00* 15*60. *BL
5 55.00* 8*60«» 55.00* 55,00 »139*60 .X BL
BL
DATA FFAST9/ Bl-
1 282*60.. 55.00* 55.00,126*60.* 55.00, 24*60., 50.00, 55.00»BL
2 25*60.. 55.00* 55.00. 24*60.* 55.00. 55.00 , 135*60 ./ BL
BL
END BL
332
333
334
335
336
337
338
339
340
3*1
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
                                                                        217

-------
c
c
c
c
1
c
BUOCK DATA
BLOCK DATA PROGRAM NUMBER FOUR
COMMON /DATFL4/ FRATIO <25t25t4 )
DIMENSION FRAT6 <625)t FRAT7(625»t FRAT8(625)t FRAT9I625)
EQUIVALENCE (FRAT6 (1 ) iFRATlO (1 .1 il ) ) t (FRAT7 (1 ) »FRATIO ( 1 t 1 »2) )
(FRATB(l) ,FRATIO(l,li3)) » (FRAT9 (I J tFRATIO ( 1 » 1 t4) )
DATA FRAT6/
1
2
3
4
5
6
7
8
9
1
2
3
4
5
6
7
8
9
C
190*
1
13*
1
1
2*
1
2*
2
1
3
4
2
3<*
1
5
1
1

l.f
.25.
l.t
.20.
,39.
1..
.14t
1..
.20.
.29.
.79,
.00.
.51,
1.,
.54,
.72,
.70*
.10,

1.2Qi
19* 1.,
3.40i
13* l.t
a* l.t
1.45,
2* l.»
1.07.
1.29.
1.39t
3.50,
1.5Q,
2.37.
1.75,
2* l.t
11* 1,,
1.03t
66* I./

1.10,
1.60,
2.09,
2.70t
1.39,
1* l.t
1.67.
2* l.t
4* l.t
1.50,
11* 1.,
3.00.
2.23i
1.74,
1.79,
1.50,
1.10*


19* 1..
1* 1..
1.35,
2.50t
1.39,
1.50.
1.60.
1.70,
2.00.
2* 1..
1.54,
3.06,
2.09,
1.03,
1.78,
2.00,
23* l.t


1.50,
1.10,
1* l.t
1* l.t
14* 1.,
1.39,
1.53.
1.70.
1.70.
2.5o,
1.54,
3.06,
1.89,
1* l.t
1* l.t
2.48,
l.lOt


1.39,
5* l.t
1.20*
1.28*
3.00,
15* l.t
15* l.t
14* l.t
16* l.t
3.50»
3* l.t
2.92t
1.79.
5.00,
1.03,
2.29,
1.14.


1.39,
1.10,
4* l.t
1* l.t
2* l.t
3.23,
2.50.
1.10.
1.54,
3.79,
1.71,
2.79.
4* l.f
5.50,
2* l.t
1.79,
22* l.f


1
1
1
1
1
2*
2
1
1
3
1
2
1
15*
5
1
1


DATA FRAT7/
1
2
3
4
5
6
7
6
9
1
2
3
4
5
6
7
fl
9
C
190*
1
1
13*
1*
2*
1
2*
?»
1
2
3*
1
1
3
1
1
22*

1.,
.20,
.56.
1.,
1.,
l.f
.35,
1.,
1.,
.21,
.50,
1.,
.79,
.50,
.50,
.25,
.36,
1,,

1.20,
21* 1.,
1* 1.,
1.38,
1.50.
1.54,
2* 1.,
1.28,
1.21,
1.25,
2.59,
1.60,
1.78,
4* 1. ,
4.00*
2* l.t
1.29,
1.29,

1.10,
1.29,
1.39,
1.10,
1.20.
1* l.t
1.57.
2* 1.,
1.20,
1.29,
2.59,
1.60,
1.70,
1.20,
15* 1.,
4.19.
1.39,
1.39,

19* 1.,
2* l.t
2* l.t
1* l.t
1.20,
1.39t
.89,
1.60,
1.70,
1.39,
2.59,
3.00»
1.77,
3* l.t
1.20,
4.25«
1.45,
22* l.t

1.10,
1.29,
1.39,
1.49.
14* 1,,
1.29,
.89.
16* 1.,
1.50,
1.50,
2.50,
1.20,
1.75,
1.52,
2* 1.,
10* l.f
1.45,
1.10,

1.20.
17* l.t
1* l.t
1* l.f
1.63,
15* l.t
15* 1.,
1.20,
3* l.t
1.10,
11* 1.,
1.79,
1.71,
1.56,
1.46,
1.34t
1.39,
1.20,

1.14,
1.03,
1.10,
1.50,
2* l.t
1.86,
1.79.
1.60,
2.00,
1.50,
1.20,
1.81,
1.65,
1.28,
1.47,
1,35,
1.39,
66* I./

1

1
1
1
2*
1
1
12*
1
1
1
1
1
1*
1



DATA FRAT8/
1
2
3
4
190«
19*
1
1
1.,
1.,
.11.
.39,
1.10,
1.20,
2.04,
1* 1.'
20« 1.,
1* 1.,
1* l.t
1.79,
1.29,
1.10,
1.20,
1* l.t
1.10,
2* 1.,
2* I.,
1.29,
1.10,
1.14,
1.20,
1.35,
1.10,
17* 1.,
16* 1.,
1* l.t
1
1
1
1
BL
BL
BL
BL
BL
BL
BL
t BL
BL
BL
BL
.29. BL
.lOtBL
.29, BL
.29, BL
.21, BL
l.tBL
,7o» BL
.50. BL
.29, BL
.79, BL
,7o,BL
,59, BL
.54, BL
l.tBL
»59tBL
.79, BL
.04* BL
BL
BL
BL
.20, BL
.87, BL
.10. BL
.53,BL
.42, BL
l.tBL
.79.BL
,25, BL
l.,BL
.79.BL
.20.BL
.81. BL
.60. BL
.25, BL
1..BL
.35" BL
.29.BL
BL
BL
BL
.14.BL
.29. BL
.46, BL
.20'BL
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
218

-------
5
6
7
8
9
1
2
3
4
5
6
7
8
9

1
I
1
1
1
1
2
3*
1
1
3
1
1
22*

.10. 15» 1 . ,
.25,
.29,
.50,
.09,
.25,
.79.
1..
.70.
.10.
.50,
.50,
.54,
l.t

1.10.
1.20,
1.35,
2.00,
1.29.
2.79.
1.32.
1.60.
4* l.t
3.59.
2*1.,
1.50*
1.29*

1.64,
15* 1 .,
15* 1.,
15* 1.,
1 .45,
1.39,
2.79,
1.32,
1.70,
1.20,
15* 1.,
3.62,
1.45,
1.39,

2* l.t
1.82.
1.60,
1.10,
3* 1..
1.50*
2.70,
3.00,
1.50.
3* 1 .1
1.20,
3.62,
1.39,
22* l.t

1.6Q.
2* l.t
1.79,
1.39,
1.50,
1.10*
2.70,
1.50,
1.39,
1.35,
2* 1.,
10* 1. ,
1.38,
1.29,

2* 1.,
1.39,
2* 1.,
1.25,
2.00,
l.BOt
10* l.t
1.79,
1.29t
1.34,
1.35,
1.39,
1.39,
1.29.

1
2*
1
2*
11*
1
1
1
1
1
1
1
1
66*

.39,
1..
.20,
1.,
1.,
.79,
.20.
.61,
.20,
.53,
.35,
.45,
.39,
I./

DATA FRAT9/
1
2
3
4
5
6
7
8
9
1
2
3


235*
1
1
3*
3*

1
3*
1
1
1*
1

END
1 > <
.60.
.35.
1..
1..
.65.
.20.
1..
.20,
.20,
l.t
.70,


1.20*
1* l.t
4* l.t
1.25t
1.27»
1.29.
1.10,
1.39,
l.lOt
2.59.
1.29.
1.50*


22* l.t
1.39,
1.10,
1.25,
15* l.t
1.29,
1.50,
1.39,
11* 1.,
2.59.
2* 1.,
l.SOt


1.35.
5* l.t
1.10.
15* 1.,
1.20.
16* l.t
1.29,
2.50,
1.25,
15* l.t
2,59,
1.50*


1.15,
1.10,
15* l.t
1.60,
1 .39,
1.25,
1.29,
2.50,
3* 1.,
1.25.
2.60,
2* 1.,


1.53,
15* l.t
1.92,
1.79,
1.10.
1.10.
15* l.i
1.29,
1.50,
2* l.t
12* l.t
1.20.1


21*
1
2*
2*
2*
1
1
1
1
1
1
14*


l.t
.79,
1.,
1..
1..
.10,
.25.
.29,
.45,
.50,
.70.
I./


1* 1..BL
1 .46.BL
2* 1..BL
1.09,BL
1.14.BL
2.7Q.BL
1.20.BL
1.79.BL
1.10.BL
1.5Q.BL
1* 1..BL
1.50.BL
1.29.BL
BL
8L
BL
1.6o» BL
2* 1..BL
1.20.BL
1.04.BL
.85, BL
l.lOtBL
1.25.BL
1.29,BL
1.29,BL
1.50.BL
1.76.BL
BL
BL
BL
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
219

-------
       BLOCK DATA                                                        BL   446
 C                                                                       BL   449
 C         BLOCK DATA PROGRAM NUMBER  FIVE                               BL   450
 C                                                                       BL   451
       COMMON /COLDST/ NBETAt TCS<20)» CSFI60)                            BL   452
       COMMON /GRID/ XI» X2« VIi Y2i NX* NYi DELX* DELY* DELT            BL   453
       COMMON /TABLES/ THOURI24). TZ<8>* YFR(8)                           BL   *54
       COMMON /SPDFCT/ A (3). 8(3), C(3)i VBAR                            BL   455
 C                                                                       BL   456
       DATA NBETA/20'* TCS/360.* 3651. 370** 375.• 38o«» 385.•  39Qti      BL   457
      1  395.i 400. t 410.i 420.» 425., 430.* 435.1 440, t 500.1  520. •      BL   458
      2  535., 550., 560./» CSF/20»1.0* 1.0, 1.057, 1.087*  1,074,  1,054, BL   459
      3  1.03B, 1.029, 1.023, 1.019, 1.014, l.Ollt 1.007t 1,002*  0.998,  BL   460
      4  0.996* 0.994* 0.992* 0.989, 0.998* 1.0*   1.0*    1*186*  1*287*  BL   461
      5  1.243, 1,179* 1.125* 1.094, 1.075* 1.063* 1.047, 1,038*  1.025,  BL   *62
      6  1.007, 0.995, 0.988, 0.979, 0.972, 0.965. 0,993* 1,0 /          BL   463
       DATA Xl*X2»Yl,Y2/0.*50.*0..5o./» NX*NY/25»25/*  DELX»DELY/2.»2»/   BL   464
       DATA THOUR/0.«60.»120.*l80.»240.*300,*360.*420,*4eO.,540.*600.*   BU   465
      1  660.,780,,780.,840.,900.,960.,1020..1080,.1140..1200.t!260.,     BL   466
      2  1320.*1380./                                                    BL   467
       DATA TZ/O.i 360,* 540.* 690.. 810.* 990.* 1110.*  1260./            BL   468
       DATA YFR/0.90* 0.85* 0.25. 0.30. 0.20. 0.50* 0.15* 0.20/          BL   469
       DATA 8/0..-0.40»-0.49/. C/0..0.«0./» VBAR/60./                     BL   470
 C                                                                       BL   471
       END                                                               BL   472
220

-------
                               APPENDIX G
         COMPUTATION OF  NO   PHOTODISSOCIATION RATE CONSTANT
G.I   INTRODUCTION
      In this section we explain the operation and use of a program for
                                                                     kl
the computation of  k  , the rate constant of the reaction  hv + N0~ -»•
NO + 0 .   In this reaction, which is one of the principal reactions in
smog chemistry, photons collide with  NO   causing it to dissociate into
nitric oxide and atomic oxygen.  Sunlight intensity thus determines the
reaction rate, and the rate constant,  k  , is a function of sunlight
                                 9           11
intensity in the region 3000-4000A.  Leighton  provides an extensive
discussion of the many factors which enter into a determination of  k  .

      The value of  k   computed by the program corresponds to sunlight
intensities under clear-sky conditions.  Attenuation of incident sunlight
by aerosols and clouds, for example, will change the value of  k  .
Comparisons of clear-day and actual values of  k   in the Los Angeles
Basin are found in Ref.12, where it is shown that the differences can be
substantial and, as might be expected, that  k   varies from point to
point in the geographical area in question.  The difficulties inherent
in obtaining adequate data for a more realistic evaluation of  k   have
resulted in our use of clear-day values of  k   as an approximation.
                                                                      221

-------
G.2   COMPUTATION OF  k,
      The evaluation of  k   as a function of time of day is based on  the
relationship between  k]_  and the solar zenith angle.  This relationship
was derived by LeightonH and is shown in Table G.I.

                               TABLE G.I
       NO  PHOTODISSOCIATION RATE CONSTANT AS A FUNCTION. OF SOLAR
                ZENITH ANGLE FOR WAVELENGTHS 2900-3850 A

           Solar Zenith Angle (deg)                  (min  )
                      0                            0.438
                     20                            0.420
                     40                            0.366
                     60                            0.252
                     80                            0.072
                     90                              0
       *From Ref.11, p.  59.
 Thus,  to  obtain  k1  we need  to know  the solar zenith angle and  then  com-
 pute   k..  by  interpolation using Table G.I.  Since  the solar  zenith angle
 is a function of time of day, we will obtain a set  of rate constants  as
 a function of time.
      The  solar  zenith angle  is a  function of  the  geographical  location
 of  the  region  in question  and is obtained using  emphemeris  tables  for the
 sun such as  are  contained  in  The American Ephemeris  and Nautical Almanac.
 The zenith angle is  obtained  from  the  equation
             cos  Z =  sinX sin6 + cosX cos6 cosct
222

-------
where
            Z = zenith angle
            A = latitude of observer
            6 = declination angle of the sun
            a = local hour angle of the sun

The declination of the sun is obtained from the emphemeris tables, but the
local hour angle must be computed since it is a function of the observer's
meridian (longitude)-  The local hour angle is given by

            a = s + AT + a - m + 12h

where
              s = local standard time
             AT = longitude of observer minus meridian of the observer's
                  standard time zone
              a = apparent solar time at observer's meridian
              m = mean solar time at observer's meridian
            12  = a factor of twelve hours added or subtracted such that
                  the hour angle is zero when the sun crosses the observer's
                  meridian.

The difference  (a-m)  is obtained from the ephemeris transit data con-
tained in the ephemeris tables.  In using these tables we have made the
approximation that ephemeris time equals universal time since the differ-
ence is only about 30 seconds.  (The reader is referred to any edition
of The American_Ephemeris^ and Nautical Almanac for more elaborate expla-
nations of the terms used.)  The error in computing the zenith angle
using the above procedure is less than one degree.  This ensures that  k
is computed with a maximum absolute error less than 0.01.
                                                                      223

-------
G.3   READING INPUTJDATA
      The program reads the input data from logical unit number 5, e.g.,
READ  (5,N) LIST.  Thus appropriate job control cards must be used  in order
to ensure the equivalence of unit 5 and the card reader of the user's
installation.
224

-------
      G.4   PROBLEM-CONTROL INPUTS

            The inputs required by  the  program are  described  in Table  G.2.   The

      order of their appearance is  the  same  as the  order  in which  the  code  reads
      them.


                                      TABLE G.2

                      PROBLEM-CONTROL INPUTS FOR COMPUTING kn
Input No.    Variable Name    Variable Function    Format
             Used in Code
                                       Remarks
               TITLE
               ALONG
               ALAT
               STDTIM
               TIMIN
               TIMOUT
               DELTAT
Label for output     (20A4)
Observer's longi-
tude in degrees
(40X.F10.0)
Observer's latitude  (40X,F10.0)
in degrees
Meridian of ob-
server's standard
time in degrees
(40X.F10.0)
Initial time of day  (40X.I10)
when  kj_
computed.
                              when  kj_   is  to be
Final time of day
when  k;L  is to be
computed.
                                                    (40X,I10)
The time resolution   (40X,I10)
of  k^, in minutes.
May contain any
comments user wishes
to make.  All 80
columns of the card
may be used.

West longitudes are
negative and east
longitudes are posi-
tive.
See remarks for input
number 2 and Table G.3.

The time must be stand-
ard time specified
using a 24-hour clock,
e.g., 1:00 pm would be
input as 1300.  Note
that this is an inte-
ger variable.

See remarks for input
number 5.
               This is an integer
               variable.  The finest
               resolution that may
               be used is one minute.
                                                                             225

-------
                                TABLE  G.2  (Continued)
Input No.
Variable Name
Used in Code
Variable Function     Format
                                                                       Remarks
               KPUNCH
   10
               MONTH
               IDAY
                 Table of  k/s out-  (40X,A4)
                 put in punched cards
                 (YES) or printed
                 output only (NO)
                 Month for which
                 k^'s are to be
                 computed.
                 Vector of days of
                 month for which k^
                 is to be computed.
                     (40X.I10)
                     (40X.I10)
   11
               DECL.EQTIM
                 Declination angle
                 and ephemeris
                 transit of sun.
                     (A4,26X,
                      2F10.0)
This is a hollerith
variable which is
either YES or NO. In
either case the word
must start in column 41
and must contain no
blanks.

Input consists of the
number of the month,
e.g., June requires
a 6 in column 50.

The maximum number of
days which may be
input is 31.  The last
day of this input
group must be followed
by a card with a nega-
tive number in cols.
41-50 to stop the pro-
gram from reading days.

See section G.4.1
        226

-------
                               TABLE G.3
                STANDARD TIME MERIDIANS OF UNITED STATES

   Standard Time Designation   Meridian (Degrees West of Greenwich)
         Atlantic                              60
         Eastern                               75
         Central                               90
         Mountain                              105
         Pacific                               120
         Yukon                                 135
         Alaska-Hawaii                         150
         Bering                                165
   *
    Longitudes west of Greenwich are negative.
G.4.1  INPUT OF DECLINATION ANGLE AND EPHEMERIS TRANSIT
      These inputs are  taken directly from the ephemeris tables of The
American Ephemeris and  Nautical Almanac.  For convenience, these quanti-
ties are input in compressed form, as is explained below.  The following
is a reproduction of  the  entry for Sept. 1, 1969 of the ephemeris tables;
the ellipses indicate the presence of other quantities which are not
pertinent for our purposes.  Note that the entry for the declination
angle is given in degrees, minutes and seconds, and that for the ephemeris
transit in hours, minutes and seconds.  In order to facilitate input of
these quantities in the code, each of them is read as if it were a single
decimal quantity.  For  example, the declination is input as 82550.5 and
the ephemeris transit as  115959.05.  The declination is keypunched in
columns 41-50 and the ephemeris transit in columns 51-60.  The code is
programmed to unravel these numbers.
                                                                       227

-------
                              SUN,  1969
                       FOR  Oh  EPHEMERIS TIME
   Date
  Apparent
  Declination
Ephemeris
 Transit
                                                                 m
   Sept. 1
+8   25   50.5
                                                            11  59  59.05
   Reproduced from The American Ephemeris and Nautical Almanac for the Year
    1969, U.S. Government Printing Office, Washington, D.C.

       To  compute  solar  zenith  angles  on  any  days  in  a given month,  the
 user must input cards with  the declination and  the ephemeris  transit  for
 all the days  in that month.  This  information is  obtained  directly  from
 the ephemeris tables.   Thus  even  though  we may  wish  to compute  k  ,  and
 hence  the solar zenith  angle,  for  a single day  of a  month,  the  declination
 and ephemeris transit data must be input for the  whole month.   In addi-
 tion,  the declination and ephemeris transit  must  be  input  for the last
 day of the previous month and  the  first  day  of  the following  month.   This
 is necessary  for  purposes of interpolation.  For  example,  if  we wish  to
 compute   k...   for  some day in September,  we must input ephemeris data  for
 August 31,  Sept.  1 through Sept.  30,  and Oct. 1,  always in that order.

       Finally, to stop  the program from  reading the  ephemeris data, a card
 which  contains the word "LAST" in  cols.  1-4  must  be  inserted  after  the
 last data card.
228

-------
G.5   OUTPUT
      The program produces output in printed form and in punched-card
form.  The punched-card output is optional and is controlled by an input
card (see input number 8, Table G.2).

      The printed output consists of a list of the time of day, the solar
zenith angle, and the rate constant  (k ) .  The listing is preceded by a
page heading which contains the page label specified by the user (see
Table G.2, input no. 1) and the date for which the rate constants are
calculated.  The punched-card output is produced using a format compatible
with the DIFKIN code.  Hence, the punched-cards may be input directly into
DIFKIN without further processing.  The cards contain the time of day,
e.g., 1200, the rate constant, and the date for which the rate constant
is computed, in that order.
                                                                        229

-------
G.6   OPERATIONAL TECHNIQUES FOR USING THE CODE TO COMPUTE  k

G.6.1  MULTIPLE CASES
      The user may string together several cases in a single run.  The
code handles two kinds of multiple runs.  The first kind is the case when
it is desired to compute  k   for a single location but for several months,
The second case is when the location is changed.  The procedure is as
follows.

Case I - Computation of  k1  for several months at a single location.
      1.    Insert a card with "MORE" punched in columns 1-4 immediately
            after the ephemeris data for the preceding case.
      2.    Follow the "MORE" card with the input data beginning with
            input number 9 (Table G.2).

Case II - Computation of  k   at a new geographical location.
      1.    Insert a card with "NEW" punched in columns 1-3 immediately
            after ephemeris data for the preceding case.
      2.    Follow the "NEW" card with the complete set of input data
            indicated in Table G.2, beginning with input number 1.

G.6.2  TERMINATING RUNS
      To terminate a run insert a card with "END" punched in columns 1-3
immediately after the data for the last case.
230

-------
G.7   SUBROUTINES FOR PROGRAM ZENITH

1.     Subroutine EFMRIS (XLONG, XLAT, STDTIM, IDAY)
      Use.  Reads ephemeris tables and computes the cosine of the solar
      zenith angle for a given geographical location.
      Arguments. XLONG   =  The longitude of the geographical location
                            in degrees.  Longitudes west and east of
                            Greenwich are negative and positive, re-
                            spectively.
                 XLAT    =  Latitude of geographical location in degrees.
                 STDTIM  =  Meridian (longitude) of standard time in
                            degrees.  Same sign convention as in XLONG
                            is used.
                 IDAY    =  The day of the month for which solar zenith
                            angle is to be computed.  If IDAY = 0, the
                            emphemeris data are read, but no computation
                            takes place.
      Remarks.  Blank COMMON is used to transmit the output of EFMRIS to
      the main program as well as to transmit input data from the main
      program to EFMRIS.

2.     Function ALINT  (X, XI, X2, Yl, Y2)
      Use.  Performs  linear interpolation using formula

                 y =  y^ +  (x-x1)(y2-y1)/(x2-x1)

      Arguments.  See formula above.

3.     Subroutine TIME (IHOUR, IN, IOUT, IDELTA)
      Use.  Produces  a vector  (IHOUR)  containing  time of day  from time  IN
      to  time IOUT at intervals specified by  IDELTA.
                                                                       231

-------
      Arguments. IHOUR   =  Integer vector of times of day.  Time  is
                            specified on a 24-hour clock, e.g., 1:10  PM
                            is represented by 1310.
                 IN      =  Initial time specified on a 24-hour clock,
                            e.g., 0520.
                 IOUT    =  Final time specified on a 24-hour clock,
                            e.g., 1710.
                 IDELTA  =  Time interval in minutes.

4.    Function TRPLAT (X, XS, FS, NXF, NPT, NX, NF)
      Use.  General interpolation-extrapolation subroutine.  Uses poly-
      nomials as interpolating functions.

      Arguments. X       =  The  value of the independent variable  for
                            which interpolation or extrapolation is to
                            be performed.
                 XS      =  Array of known independent variables.
                 FS      =  Array of known dependent variables.
                 NXF     =  Number of columns of XS and FS.
                 NPT     =  Number of points used in interpolation,
                            e.g., NPT =  2 is linear interpolation.
                 NX      =  Number of rows of XS.
                 NF      =  Number of rows of FS.
232

-------
      PROGRAM ZENITH                                                    2EN    j
C                                                                       ZEN    2
c	COMPUTES CLEAR-DAY K! AS A FUNCTION OF TIME OF DAY        ZEN    3
C                                                                       ZEN    4
      COMMON SOL(1441)                                                  ZEN    5
      COMMON TIMIN.TIMOUT,DELTAT                                        ZEN    6
      DIMENSION  IDAYO1> »ITIME<1441> ,ZANGLE<6>                          Z£N    7
      DIMENSION RATKON(6),TITLE(20)                                     ZEN    8
      INTEGER TIMIN.TIMOUT,DELTAT                                       ZEN    9
      DATA RATKON/.438,.420,,366,,252,.072,0./                          ZEN   10
      DATA ZANGLE/0.,20.,40.,60.«80.,90,/                               ZEN   11
      DATA PTD/57.2956/                                                 ZEN   12
      DATA IES.AMOR.PLACE/4HYES ,4HMORE,4HNEW /                         Z£N   13
C                                                                       ZEN   14
100   READ (5»4) TITLE                                                  ZEN   15
      READ <5»i) ALONG                                                  ZEN   16
      READ (5,1) ALAT                                                   ZEN   17
      READ (5.1) STDTIM                                                 ZEN   18
      READ (5,3) TIMIN                                                  ZEN   lg
      READ (5,3) TlMOUT                                                 ZEN   20
      READ (5,3) DELTAT                                                 ZEN   21
      READ <5«2> KPUNCH                                                 ZEN   22
C                                                                       ZEN   23
      CALL TIMEdTIME,TIMIN.TIMOUT,DELTAT)                              ZEN   24
      I B TIMIN/lOO                                                     ZEN   25
      I = I»60+MOD(TIMIN,100>                                           ZEN   26
      J « TIMOUT/100                                                    ZEN   27
      j B J«60+MOD(TIMOUT,100)                                          ZEN   2e
      INT «  (J-D/DELTAT*!                                              ZEN   Zg
110   CONTlN|jE                                                          ZEN   30
      READ (5,3) MONTH                                                  ZEN   31
C                                                                       ZEN   32
c     	 COMPUTE RATE COEFFICIENT FOR SPECIFIED MONTHS                 ZEN   33
c                                                                       ZEN   34
c.—_.	. READ DAYS OF MONTH FOR WHICH RATE CONSTANT  is TO BE COMPUZEN   35
c                                                                       ZEN   36
      DO 120 i  « i»32                                                   ZEN   37
      READ (5,3) J                                                      ZEN   38
      IF  (J.LT.O) GO  TO  130                                             ZEN   39
      IDAY(I) » J                                                       ZEN   *°
120   CONTINUE                                                          ZEN   **
      PRINT 5                                                           ZEN   42
      CALL EXIT                                                        ZEN   43
130   NDATE » 1-1                                                       ZEN   44
c                                                                       ZEN   45
      CALL EFMRISIALONG,ALAT,STDTIM,o)                                  ZEN   46
      DO 150 I  » 1,NDATE                                                ZEN  47
      CALL EFMRIS(ALONG»ALAT,STDTIM,IDAY(D)                            ZEN  48
      PRINT 7,  TITLE,MONTH,IDAY(I)                                      ZEN  49
      PRINT 8                                                           ZEN  50
      DO 140 J  » l.INT                                                  ZEN  51
      ANGLE » ACOS
-------
       IF                                                 ZEN  63
 2     FORMAT  <40X,A4)                                                   ZEN  64
 3     FORMAT  (40X.I10)                                                  ZEN  65
 4     FORMAT  (20A4)                                                     ZEN  66
 5     FORMAT  (!H1.10Xt43HTHE NUMBER OF DAYS EXCEEDS 31. JOB ABORTED.)   ZEN  67
 6     FORMAT  
-------
      SUBROUTINE EFMR1S(XLONG,XLAT|STDTIM,IDAY)                         EFM   1
                                                                        C" C u   O
C     THIS SUBROUTINE READS EPHEMERIS TABLES AND COMPUTES THE SOLAR     EFM   3
C     ZENITH ANGLE  FOR A GIVEN GEOGRAPHICAL LOCATION,                  EFM   4
                                                                        EFM   S
C     ARGUMENTS                                                         EFM   6
C               XLONG   » LONGITUDE OF GEOGRAPHICAL LOCATION IN DEGREES EFM   7
C                         LONGITUDES ARE NEGATIVE WEST OF GREENWICH AND EFM   8
C                         POSITIVE OTHERWISE.                           EFM   9
c               XLAT    m LATITUDE OF GEOGRAPHICAL LOCATION IN DEGREES. EFM  10
c               STDTIM   « MERIDIAN OF STANDARD TIME IN DEGREES.        EFM  11
c                          USE SAME SIGN CONVENTION AS FOR LONGITUDE.   EFM  12
C               IDAY    » THE DAY OF THE MONTH FOR WHICH ZENITH ANGLE   EFM  13
C                         IS TO BE COMPUTED.  IF IDAY « Oi THE DATA     EFM  14
C                         FROM THE EPHEMERIS TABLES ARE READ. BUT NO    EFM  15
C                         COMPUTATION TAKES PLACE.                      EFM  16
c                                                                       EFM  17
      COMMON SOL(1441)                                                  EFM  ie
      COMMON TIMIN.TIMOUT.DELTAT                                        EFM  19
      INTEGER TIMIN.TIMOUTtDELTAT                                       EFM  20
      DIMENSION DECH33) »EQTIM<33)                                      EFM  21
      DATA RTD/57.2956/                                                 EFM  22
      DATA AI-AST/4HLAST/                                                EFM  23
C                                                                       EFM  2*
      IF  (IDAY.NE.O> GO TO 120                                          EFM  25
      ALAT « XLAT/RTD                                                   EFM  26
      COSIN » COS(ALAT)                                                 EFM  27
      SINE a SIN(ALAT)                                                  EFM  26
C                                                                       EFM  29
C     — COMPUTE LOCAL MEAN SOLAR TIME CORRECTION                      EFM  30
C                                                                       EFM  31
      ALONG • (XLONG-STDTIM)#4.                                         EFM  32
C                                                                       EFM  33
c	—	READ DECLINATION ANGLE AND EQUATION OF TIME FOR SPECIFIC MEFM  34
C                                                                       EFM  35
C                                                                       EFM  36
c..__—--„__. FOR PURPOSES OF INTERPOLATION* THE FIRST CARD MUST CONTAINEFM  37
C             THE EPHEMERIS DATA FOR THE LAST DAY OF THE PREVIOUS MONTH EFM  36
C             THE LAST DATA CARD MUST CONTAIN THE DATA FOR THE FIRST DAYEFM  39
c.......—... . A - IS JUST AN INDICATOR WHICH ALLOWS THE PROGRAM TO    EFM  41
C                   STOP READING THE EPHEMERIS TABLES WHEN A « 4HLAST   EFM  42
C                   IN COLS. 1-4.  THUS THE LAST CARD IN THE TABLE IS   EFM  43
C                   A DUMMY DATA CARD WITH -LAST- PUNCHED IN COLS. 1-4. EFM  44
C                                                                       EFM  45
      DO 100 I « 1'34                                                   EFM  46
      READ (5.2) A.BiC                                                  EFM  47
      IF  (A.EQ.ALAST) GO TO 110                                         EFM  48
C                                                                       EFM  49
C     CONVERT FROM DEGREESiMINUTES.SECONDS TO DEGREES AND DECIMALS.     EFM  50
C                                                                       EFM  51
      A « ABS(B)                                                        EFM  52
      Q « A»1.0E-4                                                      EFM  53
      DEG • AINT(Q)                                                     EFM  54
      0 « A»0.01                                                        EFM  55
      Q « AINT(Q)                                                       EFM  56
                                                                                235

-------
      AM1N • AMOD(QilOOt)                                               EFM  57
      SEC « AMOD(AilOO.)/60.                                            EFM  5e
      A » DEG*(AMIN*SEC>/60,                                            EFM  59
      A m SIGN(AtB)                                                     EFM  60
c                                                                       EFM  61
      DECL(I) • A/RTD                                                   EFM  *2
c                                                                       EFM  63
C     CONVERT EPHEMERIS TRANSIT TO EQUATION OF TIME                     EFM  64
c                                                                       EFM  65
      Q « C«l«OE-4                                                      EFM  66
      HOUR • AINT(Q)                                                    E|FM  67
      0 • C«0.01                                                        EFM  6a
      0 « AINT(Q)                                                       EFM  69
      AMIN « AMOD(Q»100,)                                               EFM  70
      SEC " AMOD(CilOO.)/60.                                            EFM  71
      A • 720.-(HOUR»60.*AMlN«SEC)                                      EFM  72
      EQTIM(I) « A                                                      EFM  73
100   CONTINUE                                                          EFM  7*
      PRINT 1                                                           EFM  75
      CALL EXIT                                                         EFM  76
110   NDATA • 1-2                                                       EFM  77
      RETURN                                                            EFM  78
                                                                        EFM  79
                                                                        EFM  80
                                                                        EFM  81
                                                                        EFM  82
                                                                        EFM  83
                                                                        EFM  84
                                                                        EFM  85
                                                                        EFM  86
                                                                        EFM  87
                                                                        EFM  88
                                                                        EFM  89
                                                                        EFM  90
                                                                        EFM  91
                                                                        EFM  92
                                                                        EFM  93
                                                                        EFM  94
                                                                        EFM  95
                                                                        EFM  96
                                                                        EFM  97
                                                                        EFM  98
                                                                        EFM  99
      TRUE • X*ALONG*EQ                                                 EFM 100
      L a L*l                                                           EFM 101
      SOL(U) «  «TRUE-720t>*0.25)'RTD                                   EFM 102
140   CONTINUE                                                          EFM 103
C                                                                       EFM 104
£     _,„ COMPUTE  COS OF  ZENITH AN6LE                                   EFM 105
C                                                                       EFM 106
      XI  « 0.                                                           EFM 107
      X2  « 1440.                                                        EFM 108
      Yl  • OECL(I)                                                      EFM 109
      Y2  « DECL(I*1)                                                    EFM 110
      J B 0                                                             EFM 111
236
C
c
c
120









— - COMPUTE TRUE SOLAR TIME AND HOUR ANOLE IN RADIANS

Kl • TIMIN/100
Kl • Kl»60
K2 « TIMOUT/100
K2 • 60«K2
I • IDAY»1
XI • -720.
X2 « 720.
Yl » EQTIM(I-l)
Y2 • EOTIM(I)
L • 0











00 140 J « KliK2fOELTAT





130
IF (J.LT.720) GO TO
Yl • EQTIM(I)
Y2 » EOTIM(I*D
Xl • 720.
X2 • 2160.
X - J
130





EO « ALINT(X»XltX2tYl»Y2>

-------
150
1
2
DO 150 L a KltK2tDELTAT
J = J*l
X » L
THETA * ALINT
CONTINUE
FORMAT 
RETURN
END
                                                                  EFM  112
                                                                  EFM  113
                                                                  EFM  114
                                                                  EFM  115
                                                                  EFM  116
                                                                  EFM  117
                                                                  EFM  lie
                                                                  EFM  119
                                           JOB ABORTED BY  EFMRIS)  EFM  120
                                                                  EFM  121
                                                                  EFM  1*2
                                                                  EFM  123
      FUNCTION ALINT(XtXliX2iYltY2)
      THIS FUNCTION PERFORMS LINEAR INTERPOLATION
      ALINT « Y1*(X-X1)«(Y2-Y1)/
      RETURN
      END
                                                                  ALI
                                                                  ALI
                                                                  ALI
                                                                  ALI
                                                                  ALI
                                                                        1
                                                                        2
                                                                        3
                                                                        4
                                                                        5-
      SUBROUTINE TIME(IHOURiIN.I OUT*IDELTA)
C
C
C
C
C
C
C
C
C
C
100
... PRODUCES A VECTOR
    TIME "IN* TO TIME
— ARGUMENTS
              IHOUR >
              IN    =
              IOUT  «
              IDELTA'
                       (IHOUR) CONTAINING TIMES OF THE DAY FROM
                       *IOUT* AT INTERVALS SPECIFIED BY *IDELTA*
                      VECTOR OF TIMES TO BE GENERATED
                      INITIAL TIME IN HOURS
                      FINAL TIME IN HOURS
                      TIME INTERVAL IN MINUTES
DIMENSION IHOUR(l)
KIN »  MOO*MOD(J»60)
CONTINUE
RETURN
END
1
2
3
4
5
6
7
e
9
TIM
TIM
TIM
TIM
TIM
TIM
TIM
TIM
TIM
TIM  10
TIM  11
TIM  12
TIM  13
TIM  14
TIM  15
TIM  16
TIM  17
TIM  18
TIM  19
TIM  20
TIM  21-
                                                                                237

-------
      FUNCTION TRPLAT(X»XSiFSiNXF»NPTiNX»NF)                            TRP    1
      DIMENSION XS(NXiNXF)iFS(NFiNXF)                                   TRP    2
      IF (XS(l.l).OT.XS(liNXF)) SO TO 110                               TRP    3
      DO 100 K « 2iNXF                                                  TRP    4
      IF (XS(1.K).6T,X) GO TO 130                                       TRP    5
100   CONTINUE                                                          TRP    6
      K • NXF                                                           TRP    7
      GO TO 130                                                         TRP    8
110   DO 120 K « 2»NXF                                                  TRP    9
      IF (XS(l.K).LT.X) GO TO l3o                                       TRP   10
120   CONTINUE                                                          TRP   11
      K « NXF                                                           TRP   12
130   KHI • K                                                           TRP   13
      KLO » KHI-1                                                       TRP   14
      MOP, • NPT-2                                                       TRP   15
      IF (MORtLCtO) 60 TO 200                                           TRP   16
      PRCSN » l.E-10»ABS(XS(liNXF)"XS(lil))                             TRP   17
      KL « 0                                                            TRP   18
      KH • 0                                                            TRP   19
      DO 190 M a ItMOR                                                  TRP   20
      IF (KL.GT.O) GO TO  UQ                                            TRP   21
      IF (KLO.LE.l) GO TO 140                                           TRP   22
      IF   .LTiPRCSN) GO TO 140                TRP   23
      KL « KLO-1                                                        TRP   24
UO   IF (KH.GT.O) 60 TO  150                                            TRP   25
      IF (KHI.6EtNXF) 60  TO 150                                         TRP   26
      IF (ABS(XS(1.KHI)-XS(1.KHI»1)).LT.PRCSN) 60 TO 150                TRP   27
      KH » KHI*1                                                        TRP   28
150   IF (KL*KH.EQ.O) 60  TO 200                                         TRP   29
      IF (KH»KL.EQ.O) 60  TO 170                                         TRP   30
      IF (ABSU-XSd.KH) > .LT.ABS(X-XS(1»KU » 60 TO 180                 TRP   31
160   KUO • KL                                                          TRP   32
      KL » 0                                                            TRP   33
      60 TO 190                                                         TRP   34
170   IF (KL.6T.O) GO TO  160                                            TRP   35
180   KHI • KH                                                          TRP   36
      KH « 0                                                            TRP   37
190   CONTINUE                                                          TRP   38
200   TRP « Ot                                                          TRP   39
      DO 220 KK « KLOtKHI                                               TRP   40
      PROD « FS(ltKK)                                                   TRP   41
      DO 210 K a KLOiKHI                                                TRP   42
      IF (K.EQ.KK) 60 TO  210                                            TRP   43
      PROD • PROD»(X-XS(1tK)>/(XS(1»KK)-XS(1iK))                        TRP   44
210   CONTINUE                                                          TRP   45
220   TRP m TRP*PROD                                                    TRP   46
      TRPLAT « TRP                                                      TRP   47
      RETURN                                                            TRP   48
      END                                                               TRP   49-
238

-------
                               REFERENCES
!•    A- Q- Eschenroeder and J. R. Martinez, Further Development of the
      Photochemical Smog Model for the Los Angeles Basin, General
      Research Corporation CR-1-191, March 1971.

2.    A. Q. Eschenroeder and J. R. Martinez, "Concepts and Applications
      of Photochemical Smog Models," Advances in Chemistry, Vol. 113,
      1973.

3.    P- J. W. Roberts, P. M. Roth, and C. L. Nelson, Development of
      a Simulation Model for Estimating Ground Level Concentrations
      of Photochemical Pollutants, Appendix A, Systems Applications, Inc.
      Report 71SAI-6, March 1971.

4.    P- J. W. Roberts, M. Liu, and P. M. Roth, A Vehicle Emissions Model
      for the Los Angeles Basin—Extensions and Modifications, Systems
      Applications, Inc. Report R72-8, April 1972.

5.    S. D. Reynolds, T. A. Hecht, P. M. Roth, M. Liu, and P.J.W. Roberts,
      Evaluation of a Simulation Model for Estimating Ground Level Con-
      centrations of Photochemical Pollutants, Systems Applications, Inc.
      Monthly Technical Progress Narrative #8, August 11, 1972.

6.    P- M. Roth, S. D. Reynolds, M. Liu, and T. A. Hecht, Evaluation of
      a Simulation Model for Estimating Ground Level Concentrations of
      Photochemical Pollutants, Systems Applications, Inc. Monthly
      Technical Progress Narrative #10, October 12, 1972.

7.    Federal Register, November 10, 1970, Vol. 35, No. 219, Part II,
      p. 17311.

8.    J. R. Martinez, R. A. Nordsieck, and A. Q. Eschenroeder, Morning
      Vehicle-Start Effects on Photochemical Smog, General Research
      Corporation CR-2-191, June 1971.

9.    A. H. Rose, Jr., R. Smith, W. F. McMichael, and R. E. Kruse,
      Comparison of Auto Exhaust Emissions in Two Major Cities,  Journal
      of the Air Pollution Control Association, Vol.  15, No.  8,  August
      1965.

10.   Compilation of Air Pollutant Emission  Factors  (Second Edition),
      U.S. Environmental Protection Agency,  AP-42.
                                                                       239

-------
11.   P. A. Leighton, Photochemistry of Air Pollution, N.Y. Academic
      Press, 1961.  See Ch. II and pp. 52-60.

12.   A. Q. Eschenroeder, J. R. Martinez, R. A. Nordsieck, Evaluation
      of a Diffusion Model for Photochemical Smog Simulation, General
      Research Corporation CR-1-273, October 1972.
240

-------