EPA-450/4-89-019
          USER'S GUIDE
     FORTHEDEGADIS2.1
DENSE GAS DISPERSION MODEL
                  By

                Tom Spicer
                Jerry Havens
        Office Of Air Quality Planning And Standards
            Office Of Air And Radiation
         U. S. Environmental Protection Agency
           Research Triangle Park, NC 27711

               November 1989

-------
This report has been reviewed by the Office Of Air Quality Planning And Standards, U. S. Environmental
Protection Agency, and has been approved for publication as received from the contractor. Approval does
not signify that the contents necessarily reflect the views and policies of the Agency, neither does mention
of trade names or commercial products constitute endorsement or recommendation for use.
                                      EPA-450/4-89-019

-------
                                 Acknowledgements
      This report was prepared by Jerry Havens, Department Of Chemical Engineering,
University Of Arkansas, Fayetteville, AR 72701, under subcontract to PEI Associates, Cincinnati,
OH 45246, in partial fulfillment of PEI's efforts under EPA Contract No. 68-02-4351. The EPA
Project Officer for this report was Dave Guinnup, U. S. EPA (MD 14), Research Triangle Park,
NC 27711.  The report and computer code are being made available through the National
Technical Information Service (NTIS), 5285 Port Royal Road, Springfield, VA 22161.
                                         ui

-------
                                PREFACE
     Version 2.1 of the elevated dense gas dispersion model, DEGADIS,
has been developed by Dr. Jerry Havens and Dr. Tom Spicer of the
University of Arkansas with the support of funding from the United
States Environmental Protection Agency (EPA).  While this model has not
been extensively tested against field data and is subject to specific
limitations and uncertainties, the EPA is making it publicly available
through the National Technical Information Service (NTIS) as a research
tool pending further model evaluation and development.

     As developed, the DEGADIS 2.1 model is intended to completely
replace the previous version of the model, DEGADIS 2.0.  Version 2.1
incorporates a newly developed jet-plume model which will result in a
plume which disperses in a fashion consistent with current Gaussian
plume models if the plume becomes neutrally buoyant before it is
predicted to fall to the ground.  This represents a substantial
improvement over the previous version and extends the applicability of
the model into the not-denser-than-air regime.  Specifically, the new
jet-plume model provides for:

(a)  automatic adjustment of integration step size using the Runge-
     Kutta-Gill method;
(b)  elliptical plume cross-section with air entrainment specified
     consistent with the Pasquill-Gifford plume dispersion coefficient
     representation of atmospheric turbulent entrainment;
(c)  user specification of averaging time;
(d)  ground reflection of the plume when its lower boundary reaches
     ground level; and
(e)  application to scenarios where the plume remains aloft.

A technical description of the new jet-plume model is found in Section
III of this User's Guide.

     Source code for the model is provided in archived form with a
dearchiving program.  The code may be dearchived on an IBM-compatible PC
using the instructions listed in the file named "README.NOW".  The
dearchived source code files should then be transferred to a VAX
computer.  At this point several files must then be renamed prior to
compilation and execution.  Specific information on the renaming process
is contained in the file AAREADME.TXT.  Print this file and the
compilation batch file, BUILD.COM, prior to attempting compilation.

     It  is the concern of the EPA that this model be applied only within
the  framework of  its intended use.  To this end the user  is referred  to
the  specific recommendations  in Section VI  for model application.   In
addition the EPA  is in the process of preparing a general guidance
document to assist the typical regulatory user in the execution of
denser-than-air cloud dispersion models.
                            David  E.  Guinnup
                            Office of Air  Quality Planning and Standards
                            U.S. Environmental  Protection Agency

-------
                          TABLE OF CONTENTS


Chapter                                                            Page

List of Tables                                                       ix

List of Figures                                                      xi

List of Symbols                                                    xiii

    I.   Introduction                                                  1

   II.   Characterizing Gas Density Effects on Dispersion              2

  III.   Description of the Jet/Plume Model                            5

   IV.   Evaluation of the Jet/Plume Model                            17

    V.   Description of the DEGADIS Model                             22

   VI.   Conclusions and Recommendations                              49

References                                                           51

Appendices
     A.  Model Application on VAX/VMS Computers                     A-l
     B.  Example Model Input and Output                             B-l
     C.  Jet/Plume Model Source Code (JETPLU_IN and JETPLU_MAIN)    C-l
     D.  DEGADIS Model Source Code                                  D-l
     E.  JETPLU-DEGADIS Interface Source Code (DEGBRIDGE)           E-l
     F.  Partial Listing of Program Variables                       F-l
     G.  DEGADIS Diagnostic Messages                                G-l
                                  vn

-------
                            LIST OF TABLES
Table                                                              Page

 II.1.  Criteria for Determining Dominance of Jet Effects for
        Ground-Level Releases                                         4

III.l.  Equations for ae and be                                       6

III.2.  Constants for Determination of az from Seinfeld (1986)
        after Turner (1969)                                          12

 IV.1.  Specification of Gas Release Rates for Modeling              17

 IV.2.  Comparison of Jet/Plume Model Prediction with
        Hoot et al.'s Wind Tunnel Data Correlation                   19

 IV.3.  Sensitivity of Jet/Plume Model Prediction to Variation
        of Entrainment Coefficients ai and 0*2                        21

  V.I.  Typical Atmospheric Boundary Layer Stability and
        Wind Profile Correlations                                    40

  V.2.  Values of ta>i for Use in Equation (V.101)                   46

  B.I.  MIC Example Simulation Release Conditions                   B-l

  B.2.  Ammonia Example Simulation Release Conditions               B-9

  B.3.  Burro 9 Test Conditions                                    B-20
                                   ix

-------
                           LIST OF FIGURES


Figure                                                             Page

III.l.  Sketch of a Jet in a Developing Cross Flow                    8

  V.I.  Schematic Diagram of DEGADIS Dense Gas Dispersion Model      23

  V.2.  Schematic Diagram of a Radially Spreading Cloud              25

  V.3.  The Unsteady Gravity Current (van Ulden, 1983)               26

  V.4.  The Head of a Steady Gravity Current (Simpson and
        Britter, 1979; van Ulden,  1983)                              28

  A.I.  Example DEGADIS Command Procedure on VAX/VMS for a
        Steady-State Simulation Named TEST_S                        A-4

  A.2.  Example DEGADIS Command Procedure on VAX/VMS for a
        Steady-State Simulation Named TEST                          A-5

  A.3.  RUN_NAME.IN Structure Required by JETPLU_IN                 A-7

  A.4.  DEGADISIN Flowchart                                        A-10

  A.5.  Structure for Free-Formatted RUN_NAME.INP File             A-ll

  A.6.  DEGADIS1 Flowchart                                         A-12

  A.7.  SYS$DEGADIS:EXAMPLE.ER1 Listing                            A-15

  A.8.  DEGADIS2 Flowchart                                         A-18

  A.9.  SYS$DEGADIS:EXAMPLE.ER2 Listing                            A-20

 A.10.  DEGADIS3 Flowchart                                         A-22

 A.11.  SYS$DEGADIS:EXAMPLE.ER3 Listing                            A-24

 A.12.  DEGADIS4 Flowchart                                         A-26

 A.13.  Structure of  Input for DEGADIS4                            A-27

 A.14.  SDEGADIS2 Flowchart                                        A-29

  B.I.  Listing of EX1.IN                                           B-2

  B.2.  Example Command File Used to Simulate the EX1 Simulation    B-2
                                  XI

-------
                     LIST OF FIGURES  (continued)






Figure                                                             Page




  B.3.  LIS File from the Output Files of JETPLU and DEGADIS        B-4




  B.4.  Listing of EX2.IN                                          B-10




  B.5.  Ammonia Aerosol/Air Adiabatic Mixture Density              B-ll




  B.6.  Ground-Level Isocontours--Oklahoma Ammonia Pipeline Break  B-ll




  B.7.  LIS File from Output Files of JETPLU and DEGADIS           B-12




  B.8.  BURR09S.INP Listing                                        B-29




  B.9.  BURR09.INP Listing                                         B-29
                                    XII

-------
                            LIST OF SYMBOLS
a       empirical coefficient in Equation (III.2)

a       empirical constant (1.3) in Equations (V.6) and (V.27)

B___    effective width of gas plume (m)
 Err

B'      local half width of source seen by observer i (m)

b       half width of horizontally homogeneous central section
          of gas plume (m)

b       empirical power in Equation (III.2)

b.      characteristic jet width (m)

b       empirical constant (1.2) in Equations (V.8) and (V.28)

C_      constant (1.15) in density intrusion (spreading) relation
 Ci

C       heat capacity (J/kg K)

C       heat capacity of air (JAg K)
 "a
C       heat capacity of contaminant (J/kg K)
 ^c
C       heat capacity of water (liquid phase) (J/kg K)

 PW                              3
c       local concentration (kg/m )
                                      3
c       centerline concentration (kg/m )

c       vertically averaged layer concentration (kg/m )
 c, L,

c_      friction coefficient

c'      centerline, ground-level concentration corrected for
          x-direction dispersion (kg/m )

D       source diameter (m)

D,       added enthalpy (J/kg)
                      2
D'      diffusivity (m /s)

d^      empirical constant (0.64) in Equations (V.4) and (V.12)

E       plume strength (kg/s)

                                 xiii

-------
E(t)    contaminant primary source rate (kg contaminant/s)



EI      air entrainment associated with a free turbulent jet  (kg/ms)



E.      air entrainment associated with a bending plume (kg/ms)



E,      jet/plume air entrainment associated with passive atmo-

          spheric dispersion (kg/ms)



E_      air entrainment associated with passive atmospheric disper-

  '        sion (kg/ms)



e       empirical constant (20.) in Equations (V.5) and (V.15)


                                               2
F       overall mass transfer coefficient (kg/m  s)



F,.      mass transfer coefficient due to forced convection

          (kg/i/ s)



F       mass transfer coefficient due to natural convection
 n        .,  . z  .
          (kg/m  s)


                          2
Fr      Froude number, p u /(g(p  - p )D)
                        cl 3.     6    Si

                                                       1/2
Fr,      "horizontal" Froude number, u /[gD(p  - p )/p  ]
  II                                  A      6    di   3L

                                                    1/2
Fr      "release" Froude number, V/[gD(p   - p )/p  ]
  £                                      6    a   cL


Gr      Grashoff number


                                    2
g       acceleration of gravity (m/s )



H       characteristic release depth or depth of density intrusion

          or cloud  (m)



H       ambient absolute humidity (kg water/kg dry  air)
 cl


H___    effective cloud depth  (m)
 Cif r


H,      height of head in density-driven flow (m)



H_      total layer depth (m)



H       maximum plume rise above stack  (m)



H       stack (exit) height  (m)



H       height of  tail in densicy-driven flow (m)



H-      average depth of gravity current head (m)



H,      depth of inward internal flow in a  gravity  current head (m)


                                 xiv

-------
h       enthalpy of source blanket (JAg)

h       enthalpy of ambient humid air

h_      enthalpy associated with primary source mass rate  (JAg)

hf      heat transfer coefficient due to forced convection
          (J/m  s K)

h,      enthalpy of vertically averaged layer (JAg)

h       heat transfer coefficient due to natural convection
 n        (J/m  s K)
                                              2
h0      overall heat transfer coefficient (J/m  s K)

h       enthalpy of primary source (JAg)

h       enthalpy associated with mass flux of water from surface
 w        (JAg)

J       release momentum ratio
                                      ^l
KQ      constant in Equation (V.96) (m    )
                                           2
K       horizontal turbulent diffusivity (m /s)
                                         2
K       vertical turbulent diffusivity (m /s)
 z
k       von Karman's constant, 0.35

k-- kc  constants defined by Equations (III.14)-(III.19)
 1   D
L       source length (m)

L_      buoyancy length scale (m)

M       total cloud mass (kg)

M       total mass of air in the cloud (kg)
 cl
M       total mass of contaminant in the cloud (kg)

M.      initial cloud mass (kg)

MW      molecular weight
•
M       mass rate of air entrainment into the cloud (kg/s)
•
M       mass rate of water transfer to the cloud from the water
  '       surface under the source (kg/s)
                                  xv

-------
N       number of observers



Nu      Nusselt number



F       cloud momentum (kg m/s)



P       perimeter of R' (m)



P,       momentum of head in density-driven flow  (kg m/s)



P       momentum of tail in density-driven flow  (kg m/s)



P       virtual momentum due to acceleration reaction  (kg m/s)



Pr      Prandtl number



p       atmospheric pressure (atm)



p       partial pressure of water in the cloud (atm)
 w, c


p       vapor pressure of water at the surface temperature (atm)
 w, s


Q       volumetric release rate (m /s)


                              2
Q_      source mass flux (kg/m  s)
 Ci


Q       volumetric entrainment flux (m/s)



Q..      flux of ambient fluid into front of gravity current

          head (m/s)
•

Q       rate of heat transfer from the surface (J/s)


                                     2
Q^      atmospheric takeup flux (kg/m  s)



Q.      maximum potential atmospheric takeup flux of contaminant

          (kg/m2 s)


                              2
q       surface heat flux (J/m  s)



R       gas source radius (m)



R,      inner radius of head in density-driven flow  (m)


                           2
R       value of R when  (TTR Q^) is a maximum (m)



R       maximum radius of the cloud (m)
 max                                x


R       primary source radius (m)



R'      jet/plume region perpendicular to  the axis
                                   xvi

-------
Ri      release Richardson number
  c
Ri_     Richardson number associated with the front velocity,
          Equation (V.ll)

Ri      Richardson number associated with temperature differences,
          Equation (V.88)

Ri^     Richardson number associated with density differences
          corrected for convective scale velocity

Ri^     Richardson number associated with density differences,
           Equation (V.78)

r       radial distance to jet/plume axis (m)

S       length of zone of flow establishment (m)

Sc      Schmidt number

Sh      Sherwood number

StH     Stanton number for heat transfer

St      Stanton number for mass transfer

S       horizontal concentration scaling parameter (m)

S       vertical concentration scaling parameter (m)
 z

S -     S  at the downwind edge of the source (x - L/2) (m)
                             2
S Q     value of S Q when (wR Q^) is a maximum (m)
   m
s       distance along plume axis (m)

T       temperature associated with source blanket enthalpy (K)

T  .    temperature associated with layer-averaged enthalpy (K)

T       surface temperature (K)

t       time (s)

t       averaging time (s)
 cl

t& .^    "instantaneous" averaging time associated with puff dispersion
  '       coefficients

t       averaging time associated with peak measured concentrations (s)
                                 xvii

-------
t       specified time (s)



t,      time when observer i encounters downwind edge  (s)



t       time when observer i encounters upwind edge  (s)



u       ambient (wind) velocity (m/s)
u       ambient average velocity (m/s)



u       jet/plume excess velocity at axis  (m)



u       horizontal or frontal entrainment velocity  (m/s)



Up--    effective cloud advection velocity  (m/s)



u_      cloud front velocity (m/s)



u.      velocity of observer i (m/s)



u,      average transport velocity associated with  R,  (m/s)
 Li                                                  L*


u       wind velocity, along x-direction (m/s)



u0      wind velocity measured at z - ZQ (m/s)



u_      internal flow out of gravity current head (m/s)



u,      internal flow into gravity current  head  (m/s)



u^      friction velocity (m/s)



u       characteristic average velocity (m/s)



V       jet velocity (m/s)



V       heat transfer velocity (0.0125 m/s) in Equation  (V.38)  (m/s)
 n


w       mass fraction of air
 a


w       mass fraction of contaminant
 c


w       mass fraction of contaminant in primary  source
 c,p                                    v     y


w       vertical entrainment velocity associated with  R..  (m/s)



w^      convective scale velocity  (m/s)



w'      entrainment velocity associated with H.,,,- (m/s)
 e                                            art


x       downwind distance to centerline ground contact (m)





                                 xviii

-------
x.(t)   x position of observer i at time t (m)



x .     position of puff center due to observer i (m)



x       downwind distance where gravity spreading terminates  (m)



x       virtual point source distance (m)



x,      x position of downwind edge of source for observer i
   i
x       x position of upwind edge of source for observer i



x       downwind distance to maximum rise (m)



x,y,z   Cartesian coordinates (m)



XQ      downwind edge of the gas source (m)



y'      local lateral dimension (m)



z.      elevation of jet/plume centerline (m)



zn      surface roughness (m)
 K


ZQ      reference height in wind velocity profile specification (m)



z'      local vertical dimension perpendicular to the jet/plume axis (m)





a       constant in power law wind profile



a..      jet entrainment coefficient



a.      line thermal entrainment coefficient



ft       constant in a  correlation in Equation (V.97)



8       power in a  correlation
 z      *         z


F       gamma function



7       ratio of (p - p )/c



7..      constant in Equation (V.96)



7       constant in a  correlation
 z                   z


A       ratio of {p - p )//?
                       cL


AT      temperature driving force (K) (T  - T  T) or (T  - T)
                                        S    C i .LJ       S
                                  xix

-------
A'      ratio of (p - Pa~)/Pa



S       empirical constant (2.15)



S.      empirical constant (2.15) in Equation (V.53)
 Lt


S       constant (0.20) in Equation (V.25)



S       constant in a  correlation in Equation (V.97)



S       constant in a  correlation
 z                   z


e       frontal entrainment coefficient (0.59) in Equation  (V.33)



?       collection of terms defined by Equation (V.62)  (m"



\       Monin-Obukhov length  (m)



H       viscosity (kg/m s)



p       density of gas-air mixture (kg/m  )



p       air density (kg/m )



p       jet/plume excess density at axis  (kg/m )


                                     3
p       density of released gas (kg/m )


                                               3
p.      vertically averaged layer density (kg/m )
 .LI

                                                            3
PQ      density of contaminant's saturated vapor at TQ  (kg/m  )



9       angle between plume axis and horizontal (radians)


 2
A       turbulent Schmidt number, 1.42



a       concentration profile parameter for an axisymmetrical jet/

          plume (m)



a       Pasquill-Gifford x-direction (ambient) dispersion coefficient (m)
 x, a


a       Pasquill-Gifford y-direction (ambient) dispersion coefficient (m)
 y >a


a  ,     concentration profile parameter in the y' direction (m)



a       Pasquill-Gifford z-direction (ambient) dispersion coefficient (m)
 z, a


a  ,     concentration profile parameter in the z' direction (m)


  2                                    2
CTI      variance associated with EI (m )


  2                                    2
a9      variance associated with E_ (m )


                                  xx

-------
<£       function describing influence of stable density
          stratification on vertical diffusion, Equation (V.76)
A
<£       integrated source entrainment function

*       logarithmic velocity profile correction function

X       jet centerline concentration at centerline touchdown
                                  xxi

-------
                            I.  INTRODUCTION
    Episodic releases of hazardous chemical gases from chemical process
pressure relief operations can pose significant hazards to public
health.  Conventional air pollutant dispersion models may not be appli-
cable for assessing the consequences of such releases, particularly when
the gases released are denser than air.  The DEGADIS model (Havens and
Spicer, 1985) was designed to model the atmospheric dispersion of
ground-level, area-source dense gas (or aerosol) clouds released with
zero (initial) momentum into an atmospheric boundary layer over flat,
level terrain.  DEGADIS describes the dispersion processes which accom-
pany the ensuing gravity-driven flow and entrainment of the gas into the
atmospheric boundary layer, and it has been verified by comparison with
a wide range of laboratory and field-scale heavy gas release/dispersion
data.  However, DEGADIS made no provision for processes which occur in
high velocity releases, as from pressure relief valves.

    Ooms, Mahieu, and Zelis (1974) reported a mathematical model for
estimating the trajectory and dilution of dense gas jet plumes.  The
model comprised simplified balance equations for mass, momentum, and
energy, with Gaussian similarity profiles for velocity, density, and
concentration in the jet.  Havens (1988) interfaced Ooms' jet-plume
model with DEGADIS to provide for prediction of the trajectory and
dilution of an elevated dense gas jet to ground contact, with (DEGADIS)
prediction of the ensuing ground-level plume dispersion.

    The purpose of this work was to improve the jet-plume/DEGADIS model
as follows:

    •  The jet-plume part of the model was modified to provide
       for elliptical plume shape (cross-section) with air
       entrainment specified to be consistent with the Pasquill-
       Gifford plume dispersion coefficient representation of
       atmospheric turbulent entrainment.  This modification
       allows application of the model to scenarios where the
       plume remains aloft.

    •  The jet-plume part of the model was modified to incor-
       porate ground reflection when the plume (lower) boundary
       reaches ground level.

    •  The jet-plume part of the model was modified to provide
       for automatic adjustment of integration step-size (using
       the Runge-Kutta-Gill method as in DEGADIS).   This modifi-
       cation improves the computational efficiency of the
       model.

-------
   II.   CHARACTERIZING  GAS  DENSITY  EFFECTS  ON ATMOSPHERIC  DISPERSION
     Atmospheric dispersion of gas releases may involve the following
fluid flow regimes:

   let  •  buoyancy- dominated •  stably- stratified • passive  dispersion

All four regimes, which may be present in different degrees depending on
the rate and (characteristic) dimensions of the release, gas density,
and characteristics of the atmospheric flow, should be accounted for in
a general application dispersion model.  The dispersion (and trajectory)
of vertical jets (perpendicular to the wind flow) can be modeled with
the jet-plume model described here, and the buoyancy-dominated, stably-
stratified, and passive dispersion regimes (on level, unobstructed
terrain) can be modeled with DEGADIS (Havens and Spicer, 1985).

     The jet-plume model currently does not provide for simulation of
horizontal jets (such as might occur from ruptured gas transfer lines) .
Consequently, we consider here other methods for estimating the relative
importance of the four dispersion regimes for ground level releases with
horizontal momentum.  In rapid releases of large quantities of dense gas
(with low initial momentum) a cloud having similar vertical and horizon-
tal dimensions may form.  In this "buoyancy- dominated regime", (gravity-
induced) slumping and lateral spreading motion ensues until the kinetic
energy of the buoyancy- driven flow is dissipated.  The gravity -induced
flow, which may effect mixing (primarily at the advancing vapor cloud
front) , can be an important determinant of the shape and extent of the
gas cloud.  After the kinetic energy of the buoyancy -driven flow is
dissipated, the dispersion process following can be described as a
"stably stratified" plume (or cloud) embedded in the mean wind flow.
The density stratification present in this regime,  which can be much
stronger than that occurring naturally in the atmospheric boundary
layer, tends to damp turbulence and reduce vertical mixing.  As the
dispersion proceeds, the stable stratification due to the dense gas
decreases until the dispersion process can be represented as a neutrally
buoyant plume (or cloud) in the mean wind flow.  This (final) dispersion
regime can be predicted with passive contaminant dispersion theory.

     Havens and Spicer (1985) suggested criteria (based on water tunnel
experiments reported by Britter (1980)) for determining the importance
of each of the low-momentum flow regimes described above.  In Britter 's
experiments brine was released (at floor level) into a water tunnel
flow, and the lateral and upwind extent of the brine/water plume was
measured as a function of the buoyancy length scale
where Q was the volumetric (brine) emission rate and u was the water-
tunnel flow velocity.  Britter' s data indicated releases were passive

-------
from the source when Lg/D < 0.005 and were dominated by the negative
buoyancy dispersion regime when Ljj/D > 0.1.  The following Release
Richardson number criteria, based on these observations, were suggested:

     If Ric > 30                   negative buoyancy- dominated

     If 1 < Ric < 30               stably stratified shear flow

     If Ric < 1                    passive dispersion             (II. 1)
where Ric - g(pe ' Pa)H/(/>au*) •  Th® reported values reflect the ratio
(u/u*) - 16 for Britter's water- tunnel flow, and the length scale
corresponding to the depth of the layer was approximated by H - Q/uD.

     High (initial) momentum releases require additional consideration
if jet entrainment dominates other air entrainment mechanisms.  In the
negative buoyancy -dominated regime, the ambient flow does not strongly
affect the rate of air entrainment.  Consequently, the relative impor-
tance of buoyancy -driven and (horizontal, near -ground- level) jet flow
effects can be evaluated using the criterion based on Britter's data
(with the release velocity V used in place of the ambient velocity in
the buoyancy length scale) .   Jet entrainment dominates the negative
buoyancy regime entrainment when
     V   2
     u*
           > 10 Ric                                               (II.2)
This criterion suggests that dominance of jet effects decreases with
increased jet density (since buoyancy -driven flow frontal air entrain-
ment increases) .

     The air entrainment into a turbulent free jet can be estimated as
(Wheatley, 1986):

    ^a   f 0.159 1 [2-Rlv,                                   (II.3)
    dx    (   2   J (  2  }    a

The rate of (vertical) air entrainment (per unit width) for the stably-
stratified shear flow and passive dispersion regimes predicted by
DEGADIS is

    d             "a5!*11^1 + a)
              ) -  S L   -                                  (II. 4)
    dx

where <£(Ri*) - 0.88 + 0.099 Ri*.  Using an effective width of 2jrR, a
typical value of a - 0.2, SL - 2.1, k - 0.35, and (u/u*) - 30 (typical
of atmospheric boundary layers) , the above equations can be combined to
show that jet entrainment dominates the stably- stratified flow regime
entrainment when

-------
    Y. > 16/(19 + Ri )                                             (II.5)
    u

This criterion suggests that dominance of jet effects increases with
increased jet density (since stably-stratified flow entrainment
decreases).  Further, when Ric < 1 the criterion suggests that jet
effects dominate the passive dispersion regime when (V/u) > 0.8, which
is consistent with the criterion suggested by Cude (1974) and Wheatley
(1986).

     Summarizing, the following procedure can be used to determine the
(starting) dominant dispersion regime:


     (1) Calculate Ric - g(pe - pJH/^p^.

     (2) Determine the dominant (nonjet) dispersion regime using
         Equation (II.l).

     (3) Determine if horizontal jet effects dominate the regime
         determined in (2),  using the relationships summarized in
         Table II.l.
    Table II.l.  Criteria for Determining Dominance of Jet Effects
                 for Ground-Level Releases
Ground-level let effects dominate:

                                                      2
•  negative buoyancy-dominated regimes when
                                                  V
                                                  u*
> 10 Ri ,
                                                               c'
•  stably stratified shear flow regimes when    V/u > 16/(19 + Ri ), and

•  passive dispersion regimes when              V/u > 0.8

-------
               III.  DESCRIPTION OF THE JET-FLUME MODEL
     Gas (or aerosol) jet releases, such as might occur in chemical
process pressure relief operations, are modeled as vertically directed
releases of pure material into the atmospheric flow field.  The jet is
assumed to be discharged from a circular vent with a (constant) uniform
velocity profile.  At some distance downwind of the release, the
velocity and concentration profiles are assumed Gaussian.

                      Zone of Flow Establishment

     The region before Gaussian similarity velocity and concentration
profiles are established is the so-called zone of flow establishment.
Pratte and Baines (1967) reported that the length of the potential core
(S0) of a jet released from a tube perpendicular to a cross flow
approaches the potential core length for a turbulent free jet with no
cross flow as the ratio of the jet velocity to the cross-flow velocity
(V/ua) becomes large.  Although So is also a function of the Reynolds
number (in the tube), Reynolds number dependence is less important for
large release momentum.  Pratte and Baines' (largest Reynolds number)
data were correlated here as

    (SQ/D) - 6.4 (1 - exp( -0.48(V/ua)))                         (III-l)

where D is the diameter of the release.  The form of Equation (III-l)
was chosen so that (SO/D) approaches 0 as (V/ua) approaches 0 and (SO/D)
approaches 6.4 as (V/ua) becomes large.  Chassaing et al. (1974) point
out that similarity profiles are not established until some distance
after the potential core has vanished.  Consequently, the length of the
zone of flow establishment (S) is modeled as


     (S/D) - 7.7 \ 1 -  exp  -0.48 ^2	   I                     (III.2)
                 I         I       "a ua J J
where (V/ua) has been replaced with (pe^/^aua) to allow extended appli-
cation for non-ambient-density gases.

     Kamotani and Greber (1972) parameterized the trajectory of the jet-
plume velocity profile in the zone of flow establishment as

     x/D - ae (z/D)be                                            (III.3)

where ae and be are empirical constants determined as a function of the
momentum ratio of the release (J - pev2/(/>aua2)) •  Astleford et al.
(1983) determined equations for ae and be as functions of J from
Kamotani and Greber's data.  Morrow (1985) revised the equations to
extend the range for smaller values of J and to include the effect of a
release Froude number (Fr - />aua2/(g(/>e-Pa)D))'. these equations are
shown in Table III.l.  Correlations were also determined here for ae and

-------
be for 50 < J < 600 from Kamotani and Greber's original work, based on a
least squares fit; these equations are also assumed to apply for
J > 600.
                   Table III.l.  Equations for ae and be.
Momentum


Ratio Froude Number (Fr)
(J) Range
JS0.036
0.0361.688
or FrsO exp[ 0.405465+0. 24386 In J] 0.4
0
-------
     c(r,s) - cc(s) exp
                                                                 (III.4)
where cc represents the centerline concentration and A^ is a turbulent
Schmidt number which represents the square of the ratio of the charac-
teristic length of the concentration profile to the characteristic
length of the velocity profile (bj).  By contrast, the Pasquill-Gifford
representation of atmospheric turbulent dispersion assumes the following
Gaussian profile:
     c(x,y,z) -
'
1
2
b
* *
y
ff (x)
I y J
2
1
2

1
z
» (x)
, ^
2 '


j
exp •  - _
     For a symmetric plume,  <7y - az (-
r-1
J 2
A z'
L »2,(s) J
2
                                                                 (III.8)
      p(s.y'.z')  -
                              exp
            l-i
                                            y'
                                           y'
i
2
                                                            z'
                                                            ,(s) J
                                                                 (III. 9)
Note that the turbulent Schmidt number now appears in the velocity pro-
file.  t7y» and az> should approach cry>a and Oz,a. ^or passive atmospheric

-------
dispersion as the density and momentum of the jet/plume approach  ambient
values.
         Figure III.l.  Sketch of a Developing Jet in a Cross Flow.
     The fundamental balance equations are:

Contaminant Mass Balance

           cu dR' - 0
     -I
     ds
Total Mass Balance
     —   I pu. dR' - EI + E- + E_
     dS
         R'
X-Direction Momentum Balance

    -f.  I pu (u cos*) dR' - u (E. + E- + E.) +
    ds  J                    a
        R'


Z-Direction Momentum Balance

    	    pu (u sin^) dR' —
    ds  J                   J
                                    - /?) dR'
(III.10)
                                                                 (III.11)
                                                              |/2
                                                                 (III.12)
                              - sign(0) c,P p u2sin2&  cosff/2      (III.13)
                                        u 6 3. d

The jet/plume boundary is assumed located where  the concentration is
one-tenth of the centerline value and encloses the region  R'.   (R'  is  an

-------
ellipse or circle with major axes Say' and Saz> where S is a constant
equal to 2.15; Pe is the perimeter of R'.)  The term (E]_ + £2 + £3)
represents air entrainment into the jet plume by the three (independent)
mechanisms discussed below.  A drag force term assumed to act at right
angles to the jet-plume trajectory is included on the right hand sides
of Equations (III.12) and (III.13).  The value used for c and Jn6az' .)
The constants in Ooms' original formulation were compared to constants
determined by approximating the circular cross section as square; the
difference was less than 22.

     With the approximations stated above, six constants appear in the
resulting equations:
      1-7VJ
           y' z'  R'
exp •
1

2
                  j
                         z'
                         z'
                                   dR'
(III.14)

-------
                                   10
k..
          VV  R'
                    exp -
                           d+A
                                                        (III.15)
'TV  I
                     dR' - it 6'
                                                           (III.16)
k4-
             R'
                                    y '
                                                                OH.»>
                  R'
                                                                (III.18)
 c6 - _1_  J exp 1
     ay'"z'  R'
                            (1+2A)
Air Entralnment
                               JL
                               *r *
                                                                (III.19)
     The balance equations for mass and x-direction momentum require
specification of the air entrainment rate (Ei, £2, and £3 in Equations
(III.11) and (III.13)).

     EI represents the (near-field) air entrainment associated with
jetting of the release.  Although a cross flow is present, the momentum
of the release dominates the ambient momentum when jetting is important,
and the region near the jet release can be modeled as a free turbulent
jet:
    En - a.p P u
     1    la e c
                                                           (III.20)
where Pe is the perimeter of R' and ax is the entrainment coefficient
associated with this area.  Note that EI is taken to be zero if uc < 0.
A value of o^ - 0.028 i's based on a summary of free turbulent jet
experiments reported by List (1982);  although this value of ai is
different from the value used by Ooms (1972) (since different length
scales were used), its use in Equation (III.20) provides rates of air
entrainment consistent with Ooms' predictions.

     £2 represents the air entrainment associated with a cross-flow
velocity component perpendicular to the jet-plume centerline.  In the
absence of jetting, large scale vortices (which entrain air) will form

-------
                                   11
in a plume due to the cross flow.  Richards (1963) measured the air
entrainment rate into line thermals released in a calm environment.
Based on Richards ' experiments , £2 is modeled as follows :
    E2 " a2PaPeUa'sin*l COS*                                    (III. 21)

where ua|sin0| is the velocity component perpendicular to the jet-plume
centerline and 02 - 0.37 is based on Richards' data.  Ooms (1972) added
the cosfl term so that this contribution is present only in the far
field.  Again, although this value of 02 is different from the value
used by Ooms (1972), its use in Equation (III. 21) provides rates of air
entrainment consistent with Ooms' predictions.

     £3 represents the atmospheric air entrainment for a passive plume.
For a passive plume, the atmospheric air entrainment rate (E3|a) is
given by
          -_£  |pu  dR'-pu  _£  fdR'-pu  jM k_a   a    \
       ''a   *,  J  a a        a a ^  J        a a HV  I  3 y-a 2-a J
dx  R, " "        - - dx   ,        " - dx
                                                                (111-22)
where <7y>a and az>a denote the ambient lateral and vertical Pasquill-
Gifford dispersion coefficients, respectively.  Since k3 is constant,
Equation (III.22) becomes


     E3 a " VaUa f az a —*•* + % a ^Z'a ]                  (III.23)
      j.a    J a a j.  z,a ^       y,a ^    j

where the derivatives can be calculated from accepted correlations for
oy>a and ffz>a> such as

     a    - S -x?y                                               (III. 24)
      y,a    y

     a    - 5 x^z exp(7 (ln(x))2)                               (III.25)
      Z y d    2         2

(Seinfeld, 1986).  Typical values for Sz, f)z, and 7Z are given in Table
III.2.

     Methods recommended in Section V for determining the effect of
averaging time are applied for the jet-plume model, and values for Sy
and £y as a function of stability and averaging time are given in
Equation (V.101).  For the jet plume, £3 is modeled as


     E3 " VaUa [ ffz a —y'a + ffz a ~y'a 1 COS*               (III. 26)
      j    J a a ^  z.a ^       z'a dx    J

where the cos0 term is included because £3 is required as a function
of s.

-------
                                   12
          Table III.2.  Constants for Determination of az
                        from Seinfeld (1986) after Turner
                        (1970)
Stability
Class 6 0 j
A
B
C
D
E
F
107.7
0.1355
0.09623
0.04134
0.02275
0.01122
-1.7172
0.8752
0.9477
1.1737
1.3010
1.4024
0.2770
0.0136
-0.0020
-0.0316
-0.0450
-0.0540
                               z               2
          for use in a  - 5  x   exp (7 (ln(x)) ) where
          a  and x are in meters.
Gravitational Force

     The gravitational force term in Equation (III.13) is given by

     J g(pa - /,) dR' - g7 J e dR' - klg7Ccay,<72,                (III.27)
     R'                   R'

As discussed earlier, 7 is assumed constant in the equation development
but is updated with distance in the model implementation.  Note that
Equation (III.27) applies for p < pa as well as p > pa.

Additional Constraints

     Along with an equation of state (such as the ideal gas law or  an
adiabatic mixing relationship between concentration and density),
balance Equations (III.10) - (III.13) provide five constraints on the
six unknowns cc, pc (or 7), UG, 8, Oy> , and az> .  Therefore, an
additional constraint is required to solve the equations.  The momentum
balances provide the information needed to determine 9 and uc.  The
contaminant mass balance provides the information to determine cc.  The
total mass balance provides the information to determine the product
ay'CTz'» but the balance equations provide no guidance for the individual
values of a-y> and az'•  (No additional constraint was needed in Corns'
model since a single length scale was used.)  The last constraint is to

-------
                                   13
be specified so that the values of Oy> and az> are consistent with
atmospheric processes.

     The model treats three (assumed) independent mechanisms for  air
entrainment.  For independent processes, the variances are  additive:
      2     2^2^   2
     o , — a, + a- + a
      y'    1    2    y,a
      2222
     az> " °\ + °2 + az,a
                                                                 (III.28)
                                                                 (III.29)
where a\?- and  .  In the  far  field,  
and az' will approach ffy>a an<^ a2,a> respectively.
                                Closure
     Initial conditions for the zone of established flow are  determined
from the zone of flow establishment; initial values of ay> and az>  are
determined from the contaminant mass balance and the  (known)  release
rate.  With A2 - 1.42 (List, 1982), the assumed profiles, balance
equations, and assumptions are combined to give a system of ordinary
differential equations as follows :
               S.2  A13  A14        -—
         A21  A22  A23  A24
         A    A    A    A
         A31   32   33  A34
         A41  A42  A43  A44









dc
c
ds
d
dd
ds
du
c
ds
where

    (Contaminant Mass Balance)
         An - (k,u cosfl + k-u ) a.o.
          11
                  IV*
                   a
2Wh / U - V .
 c   y'  z'

-------
                               14
     A12 " 1     la                2 a c


                2
           + k,u  sintf) 70-  .a .
              6 c       ' y' z'


                 2    2
     A_0 - p (k_u  cos 8 sin0 + 2k. u u  costf  sintf
      j^    a  3 a                4 a c   .
                 2    2
           + (k.u  cos 9 sintf + 2k_u u  cosfl
               la                2 a c


                   2
              + k,u  sinO) jc
                 6 c         c

-------
                                    15
         A33 " Pa^~2k3ua Cos*  sin2*  + k3Ua COS


                               2                2
                  -2k.u u  sin 6 + 2k.u u  cos 9
                     4 a c       •     4 a c


                       2
                  + k5uc cos*) 
and

-------
                                  16
kx - 2ir
              erf I £ I I 12
k2-
            1 + A
                      erf
                       s
                       2
                                    + A)
              erf
                            1 ,
     k  -
          erf
            1 +  2A
                       erf
                        5
                        2
                                       2A2)
                                             1 ,
     After cc  is  determined from the system of equations above, the
contribution from the reflected image is approximated by
cc exp
       f-N2]
       I   2 I  
-------
                                   17
                IV.  EVALUATION OF THE JET-FLUME MODEL
     A series of simulations were made with the jet-plume model to:
     •    compare the model predictions with wind tunnel dense gas jet
          trajectory and dilution data
     •    characterize the sensitivity of the model to the specification
          of entrainment coefficients a^ and 02.
Table IV.1 shows the "typical" jet releases simulated.
          Table IV.1.  Specification of Gas Release Rates for
                       Modeling.
          Jet Diameter       Jet Velocity    Gas Release Rate
                m                 m/s              kg/s
          0.05 (-2 in)    30.6 (-100 ft/s)        0.24

          0.2  (-8 in)    91.7 (-300 ft/s)       11.52

          0.5  (-20 in)  213.9 (-700 ft/s)      168.0



                 Comparison with Wind Tunnel  Test Data

     Hoot, Meroney, and Peterka (1973)  reported plume rise, downwind
distance to plume centerline touchdown, and dilution at touchdown for
wind tunnel jet releases of Freon-12/air mixtures.   The ranges of
experimental variables studied were:

          gas specific gravity (air - 1)          1.1-4.6
          gas exit diameter,  cm                   0.32 and 0.64
          gas exit height, cm                     7.6 and 15.2
          gas exit velocity/wind velocity ratio   2.5 - 25
          wind (tunnel) velocity,  m/s             0.23 and 0.46

     Correlations (of the wind tunnel data) were presented for plume
rise, distance to plume touchdown, and plume centerline concentration at
(centerline) ground contact,  in a laminar crosswind:

Plume Rise

    H  - 1.32 D [ (V/u ) (p Jp ) ] 1/3Fr*/3                           (IV. 1)
     L               ci   6  a       L

Downwind Distance to Maximum Rise

    X - (D u /V)  Fr^                                              (IV.2)
            3.      i

-------
                                   18
Downwind Distance to Centerllne Ground Contact

                       3            3          1/2      —
    X  - 0.56 D {(H /D) [(2 + H /H )  - l]u /V}v Fr.  + X          (IV.3)
     C             IT           S  IT        Si        tl

Centerline Concentration at Ground Contact
         u (2H  + H )2
          a   r    s


where 0   - initial jet diameter (m)
                                                       1/2
      Fr  - "release" Froude number, V/[g D (p -p )/p ] '
                                              e  a   p     - -2
      Fr.  - "horizontal" Froude number, u/[gD (p -p )/p ] '

      H   - maximum height of plume rise above stack (m)

      H   - exit height (m)

      Q   - steady-state jet rate (kg/s)

      u   — wind velocity (m/s)

      V   - initial jet velocity (m/s)

      X   - downwind distance to ground contact (centerline) (m)

      X  -  downwind distance to maximum rise (m)

      p   - ambient air density (kg/m3)

      p&  - initial jet density (kg/m3)

      X   "jet centerline concentration at centerline touchdown (kg/m3)

Note that Equation (IV.4) is based on analysis by Briggs presented in
Guinnup (1989).

     Table IV.2 compares the jet-plume model predictions for plume rise,
downwind distance to ground contact, and concentration at ground contact
with the results of Hoot et al.'s wind-tunnel data correlations for the
"low diameter/low velocity", "typical diameter/typical velocity", and
"high diameter/high velocity" cases (Table IV.1) in 3 and 6 m/s winds.
Based on a scaled release height of 10 m, a surface roughness of 2.2 mm
was assumed with the 3 and 6 m/s velocities because the jet-plume model
implementation assumes a logarithmic velocity profile.  This assumption
causes overprediction of the wind tunnel velocities by greater than 20%
for scaled heights greater than -40 m.  Since the wind tunnel
correlations were for jets in a laminar crosswind, the simulations shown
in Table IV.2 were made with the entrainment due to atmospheric
turbulence (£3) set to zero.

-------
                                   19
    Table IV.2.  Comparison of Jet-Plume Model Prediction with Hoot
                 et al.'s Vind Tunnel Data Correlation
   Gas Jet Density:  4.0 kg/m3
               Gas Jet Elevation:  10 m
           (Hoot et al. correlation / Jet-Plume model prediction)
       Maximum
       Rise, m
      (3, 6 m/s)
Distance to
  Ground
Contact, m
(3, 6 m/s)
   Centerline
  Concentration
at Ground Contact
   kg/m3 x 103
   (3, 6 m/s)
           Low Diameter (0.05 m) - Low Velocity (30.6 m/s)

    3.0/2.6   2.4/1.7     150/160  375/370      1.9/4.2   1.1/2.6

        Typical Diameter (0.2 m) - Typical Velocity (91.7 m/s)

   22.6/20.9 17.9/15.2    165/170  350/320     7.6/17.4 • 5.4/14.3

          High Diameter (0.5 m) - High Velocity (213.9 m/s)

   97.0/87.4 76.9/66.5    320/380  650/680     8.1/18.3   6.3/15.5
     The model predictions of maximum rise and distance to centerline
ground contact are in good agreement with the wind tunnel correlations.
The agreement between model predictions of distance to centerline ground
contact and the wind tunnel correlations tends to degrade as the maximum
rise increases because the logarithmic velocity profile assumed in the
model overpredicts the (laminar) wind tunnel velocity.  The model
prediction of the maximum concentration at centerline ground contact
differs by a factor of about two from the observed concentration.  Note
that if interaction with the ground were not included in the
calculations, the predicted model concentrations would be reduced by
exactly a factor of 2.  Therefore, the agreement between model
predictions of the maximum concentration at centerline ground contact
and the wind tunnel correlations is considered good.

         Sensitivity to Entrainment Coefficient Specification

     The model sensitivity to the coefficients ai and ai was determined
by systematic variation around the values given above.  All simulations
were of denser-than-air gas jets (initial density 4.0 kg/m3) exiting
vertically upward at 10 meters elevation.  The predictions assumed a

-------
                                   20
logarithmic velocity profile with 3 and 6 m/s velocities at 10 m
elevation, a surface roughness of 2.2 mm, and D stability.  Table IV.3
shows the effect of individually varying the entrainment coeffi-
cients a\ and 02 by factors of two below and above the values given
above, for the "low diameter/low velocity", "typical diameter/typical
velocity", and "high diameter/high velocity" cases (Table IV.1) in 3 and
6 m/s winds.

     The predictions of maximum rise and distance to centerline ground
contact are relatively insensitive to factor-of-four variations in a\
and ct2 over the range of release conditions in Table IV.1.  The predic-
tions of maximum concentration at centerline ground contact are more
sensitive to variations in a^ and 02; factor-of-four variations in 01
and a.1 resulted in concentration changes of less than a factor of -2
when concentrations were compared at the same distances.

-------
                               21
Table IV.3.
Sensitivity of Jet-Plume Model Prediction to
Variation of Entrainment Coefficients <*i and 02
Gas Jet Density:  4.0 kg/m^
                           Gas Jet Elevation:  10 m


Entrainment
Coefficients
al a2


Maximum
Rise, m
(3, 6 m/s)

Distance to
Ground
Contact, m
(3, 6 m/s)
Centerline
Concentration
at Ground Contact
kg/m3 x 103
(3, 6 m/s)
       Low Diameter (0.05 m) - Low Velocity (30.6 m/s)
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
.014
.028
.056
0.
0.
0.
.028 0.
.028 0.
.028 0.
Typical
.014
.028
.056
0.
0.
0.
.028 0.
.028 0.
.028 0.
Hi2h
.014
.028
.056
.028
.028
.028
0.
0.
0.
0.
0.
0.
37
37
37
185
37
74
Diameter
37
37
37
185
37
74
Diameter
37
37
37
185
37
74
2.9
2.5
2.1
2.9
2.5
2.1
(0.2
25.7
20.6
16.4
1.6
1.5
1.4
1.7
1.5
1.2
m) -
16.9
14.4
12.2
740*
750*
750*
750*
750*
740*
Tvpical
300
240
210
420*
420*
420*
420*
420*
420*
Velocitv
1770
1440
1190
23.0 16.4 220 1530
20.6 14.4 240 1440
17.3 11.9 280 1400
(0.5 m) - Hieh Velocitv C213
112
86.6
66.9
95.0
86.6
74.7
79.4
64.7
52.6
73.4
64.7
53.7
510
420
350
380
420
480
1280
1030
860
1010
1030
1100
.
-
.
-
(91. 7 m/s)
4
6
7
9
6
3
9 m/s)
10
13
15
21
13
6
.7
.2
.7
.1
.2
.6
.2
.1
.4
.4
.1
.8
0
0
0
0
0
0
3
4
5
5
4
3
.22
.31
.42
.30
.31
.30
.2
.4
.7
.6
.4
.0
*The plume remained aloft.  The reported distance is the
 estimated distance to 10 ppm.

-------
                                   22
                        V.  DESCRIPTION OF THE
                  DEGADIS DENSE GAS DISPERSION MODEL
     DEGADIS (DEnse GAs Dispersion) model development was sponsored by
the U.S. Coast Guard and the Gas Research Institute (Havens and Spicer,
1985).  DEGADIS is an adaptation of the Shell HEGADAS model (Colen-
brander, 1980 and Colenbrander and Puttock, 1983) and incorporates some
techniques proposed by van Ulden (1983).   It is designed to model the
atmospheric dispersion of ground-level, area-source dense gas (or aero-
sol) clouds released with zero (initial)  momentum into an atmospheric
boundary layer flow over flat, level terrain.

     If a gas release rate does not exceed the potential atmospheric
takeup rate, the gas is taken up directly by the atmospheric flow and
dispersed downwind.  If a gas release rate exceeds the potential atmo-
spheric takeup rate, a denser-than-air "secondary source" blanket is
formed over the primary source, and this near-field, buoyancy-dominated
regime is modeled using a lumped parameter model (spatially averaged
properties) which incorporates air entrainment at the gravity-spreading
front using a frontal entrainment velocity (Figure V.I).  Downwind
dispersion is modeled with a power law concentration distribution in the
vertical direction and a modified Gaussian profile in the horizontal
direction with a power law specification for the wind profile.  The
downwind dispersion models the ensemble average of the gas concentra-
tions .

                  Secondary Source Blanket Formation

     A denser-than-air gas "secondary  source" cloud or blanket may be
formed over an evaporating liquid pool (or otherwise specified ground-
level emission source) or by the instantaneous release of a volume of
gas.  A lumped parameter model of such a blanket is illustrated in
Figure V.I.  The blanket is represented as a cylindrical gas volume
which spreads laterally as a density-driven flow with entrainment from
the  top of the source blanket by wind  shear and air entrainment into the
advancing front edge.  The blanket spreads laterally until the atmos-
pheric  takeup rate from the top is matched by the air entrainment rate
from the side and, if applicable, by the rate of gas addition from under
the  blanket.  The blanket center is assumed stationary over the source.

Secondary Source Blanket Extent for Ground-Level Emission Sources

      The downwind emission rate from the blanket is equal to the poten-
tial atmospheric takeup rate, Q*max-   For E(t)/«-Rfj(t) > Q*max. a blanket
is  formed over the primary source.  The blanket frontal  (spreading)
velocity is modeled as

-------
             Ambient
             wind
             (can be
             zero)
          u.
                        H
                                     23
              Input  to
              downwind  dispersion
              model
                                   n
T(t), C(t), p(t)
 -4444444^44
                          RU)

      Secondary  Source  Formation
                                 Frontal
                                 entrainment
                                 velocity u
                                                             u.
                       C(x,y,z)«Cc(x) exp
            f|y|-b(x)\2  (   z   \
            \ S(x)  /   \S(x)/
                                                     Sz(x)
                                   C(x,y,z)» Cc(x) exp
                                                                  >b
                                                           / z  \a
                                                      "x -0(13)
                        s*\*,w
                           \
       	ISO CONCENTRATION \
                  CONTOURS  \      /
                               \    /
           FOR C = CU
                                  \
Figure V.I.  Schematic Diagram of DEGADIS Dense Gas Dispersion Model

-------
                                   24
    Uf'CE
           g
                   P • P.
                        H
                            1/2
(V.I)
where p is the average density of the blanket for (p > pa).  Cg - 1.15,
based on laboratory measurements of cloud spreading velocity (Havens and
Spicer, 1985).

     The blanket radius R is determined by integrating dR/dt - uf.  When
the total mass of the blanket is decreasing with time (i.e., the atmo-
spheric takeup exceeds the input rate from the primary source plus  the
air entrainment rate), the radius is modeled as (dR/dt)/R - (dH/dt)/H,
with the radius of the blanket constrained to be greater than or equal
to the primary source radius Rp.

Secondary Source Blanket Extent for Instantaneous Gas Releases

     The gravity intrusion model (Equation (V.I)) overpredicts initial
velocities for instantaneous, above-ground releases of a denser-than-air
gas since the initial acceleration phase is not modeled.   Consequently,
the following procedure adapted from van Ulden (1983) is incorporated in
DEGADIS.

     For instantaneous gas releases, the radially symmetric cloud is
considered to be composed of a tail section with height Ht and radius Rft
and a head section with height H^, (Figure V.2).  A momentum balance is
used to account for the acceleration of the cloud from rest; the effect
of ambient (wind) momentum is ignored.  Although the following equations
are derived assuming the absence of a primary source, the  resulting
equations are assumed to model the secondary source cloud  development
when the primary source rate is nonzero.  When the frontal velocity from
the momentum balance is the same as Equation (V.I), the momentum balance
is no longer applied and the frontal velocity is given by  Equation
(V.I).

     There are three main forces acting on the cloud:  a static pressure
force  (Fp), a dynamic drag force (F^), and a force which accounts for
the acceleration reaction of the ambient fluid, represented as a rate of
virtual momentum change with respect to time (-dPv/dt).  Denoting the
momentum of the head and tail as Pfr and P£, respectively,  the momentum
balance is
£ - L (P.  H- P )
dt   dt   h    e
                       -  F
(V.2)
                                   dt
 or
        (P
     dt
                    F  + F
                     P
(V.3)

-------
                                    25

t - 0


T

I
M

E





\
Hh *'



0

ir


i
_L
U
"l
t

t




R





'




1
f
T
H:
i
j
H,.
t
1 !
| 	 	 1
Rh

R

it-r~^=^ 	 *~v *

/ Ht
t j 	 Rh^ 	 R 	 j t
1
1



R - |
H
                                                             Hh>Ht
                                                             Gravity
                                                       H     Slumping
      Figure V.2.   Schematic Diagram of a Radially Spreading Cloud.
     The terms in the momentum balance are evaluated differently for the
time periods before a gravity current head has developed (% < Ht) and
after the head has developed but the cloud is still accelerating (Figure
V.2).  Model equations describing the time period after the gravity
current head forms (Hfc > Ht) are derived first.  The model equations
describing the earlier time period (Hfc < Ht) use simplifications of the
equations applicable for Hfc > H£.

Unsteady Gravity Current (H^ < Ht)

     When Hh > Ht (Figures V.2, V.3), the frontal velocity is determined
from the momentum balance (Equation (V.2)) as follows.

     The static pressure force, obtained by integrating the static
pressure over the boundary of the current, is
       - f I gApHt 1 f 2*RHt 1
(V.4)

-------
                 
-------
                                   27
Using Equations (V.4), (V.5), and (V.8), the momentum balance  (Equation
(V.2)) becomes

    dP         2              2         d(RH2uf)
    	 — irgApRlT  - a d irp RH, u_ - e irp  	
    ,_    ^K  t    v v *a  li f    v *a     ..
    dt                                     dt
                                                                    (V.9)
     Following van Ulden (1979, 1983), it is assumed that the potential
energy decrease due to slumping of the cloud is offset by the production
of kinetic energy, which through the action of shear is partly  trans-
formed to turbulent kinetic energy.  Part of the turbulent kinetic
energy is transformed back into potential energy due to entrainment  of
air by the cloud.  This "buoyant destruction" of kinetic energy is
assumed to be proportional to the rate of production of turbulent
kinetic energy, and following Simpson and Britter (1979) it is  assumed
that the turbulent kinetic energy production rate scales as irpaHRu|.
Then,
    1 gApH fZ - eirp
    2      dt

which can be written
                                                                   (V.10)
    dV

    dt
         «(2irRH)u_   «(27rRH)u,
                                                                   (V.ll)
gApH

/) 11^
                        Ri
where e is an empirical coefficient.
air entrainment rate,
    M
    _f - e(27rRH)uf
    Pa
                          gApH
                                      Noting that dV/dt  represents  the
                                                                   (V.12)
where M  represents the air entrainment mass rate.

    The volume integral


              h(r,t)rdr
           r
           Jo
                                                       (V.13)
where h(r,t) is to be expressed in terms of H, and H  , and  the

momentum integral
           f
           J0
    P - 2*  |  pu(r,t)h(r,t)rdr -
                                                       (V.14)

-------
                                    28
are then approximated with separate analyses of the head and tail of  the
current.

     In the tail of the current, the shallow layer approximation is
applied.  It is assumed that the shape of the current is quasi-
stationary in time, and the layer-averaged density difference is assumed
horizontally uniform.  It follows that the volume and momentum of the
tail are given by
         212         1   3  f
    P  - ± p   ± H  + H.    rf£ _£                                  (V.16)
     C   5   13  C    *J   *R
     A momentum balance for the head region, Figure V.4, assuming  quasi-
steady state, indicates that the static and dynamic pressure forces on
the head should be balanced by the net flux of momentum due to flow into
and out of the head.  The static pressure and drag are, respectively
and
    FD * ' dv
Near the surface, the inward flow (114 in Figure V.4) carries momentum
into the head, while the return flow (u3 in Figure V.4) carries momen-
tum out of the head.  Assuming U3 =• u/,., H4 - 1/2 Hfc, and 104 - $vufi
momentum flux into the head is approximately
          Figure V.4.   The Head of a Steady Gravity Current
                       (Simpson and Britter, 1979; van Ulden,
                       1983).

-------
                                   29
Upon rearranging, the momentum balance on the head gives


                              -c                                 (V.20)
when Sv - 0.2 and dv - 0.64; Equation (V.20) then specifies the head
velocity boundary condition.  The volume of the head is determined by
assuming that the head length scales with HI.   It follows that

    R-^-b^                                                 (V.21)


where tn/ is an empirical constant, and the volume of the head becomes

    V,. - »a_2b__ (R + Rh) Hjj                                        (V.22)
           v v
If the layer -averaged velocity is assumed to increase linearly with r,
it follows that
              "h
%-"f .r
                                                                  (V.23)
and


    Pi. - — pa.  _L± I  R" - RT I                                   (V.24)
     h   3    v  R   [      ^ J

     Along with the definition of uf,

    —-V                                                       H£.

     The constants av,  bv, dv, ev, and e are assigned values 1.3,  1.2,
0.64, 20., and 0.59, respectively, based on analysis of the  still-air
denser-than-air gas release experiments of Havens and Spicer (1985).

Initial Gravity Current Development (H^ < Ht)

     In order to model the initial cloud shape, the tail and head height
are considered constant with respect to radius.  The momentum balance on
the cloud is then given by


    ^ [ Ph + Pt ] - *«*' [ *h Ht + avbv


                                  2   dP
                     -  *avd,^RHX; -  —                        (V.26)

-------
                                   30
where the first term on the right-hand side represents the  static  pres-
sure force on the head and the second term represents the drag  force  on
the bottom surface of the cloud.  The third force is the acceleration
reaction by the ambient fluid, represented by Equation (V.8).
     The dimensions of the head are again given by

    R.  - R - a b H.
     n        v v  n
                                                                   (V.27)
and
                                                                   (V.28)
When the height of the tail Ht  is assumed uniform with  respect to
radius, it follows that
           M
              - *a b   (R + R, ) HT
           —     v v        n  n
                                                                   (V.29)
where M is the total mass of the cloud.  The momentum of the head
and tail Pt are then


    P    2     "Hi (R' '
    Ph ' T ™v 	—
                                                                   (V.30)
and
                                                                   (V.31)
 Equations  (V.26)  through (V.31)  determine the momentum of the blanket as
 a  function of time,  and thus  the frontal  velocity uf.   The cloud accele-
 rates  from rest because Hft -  0 initially.

 Material and Energy  Balances

     The balance  on  the total mass of gas in the source blanket
 (M - *R2Hp) is
     dM _ d_ I"
     At-   /-it- L
     dt   dt
                         E(C)

                        "c,p(t)
+ M  + M
   a    w,s
                                                                   (V.32)
 where E(t)  is the contaminant evolution rate from the primary (liquid)
 source and wC)p(t) is the contaminant mass fraction in the primary
 source.  For spills onto water,  the water entrainment term (Mw>s) is
 included in the source blanket description and is calculated from

-------
                                   31
Equation (V.46), and the (humid) air entrainment rate (Equation
(V.12)) is
                                                                   (V.33)
    The balance on the mass of contaminant in the source blanket

               is
 1  - w
  c    c
    dM
      c _ d
    dt    dt
and the mass balance on the air in the source blanket
(M  - w wR Hp) is
  Si    d
    dt    dt L
E(t)
Wc,p(t)
1 - w (t)
c.P
1 + H
a
, *a f^axl w

1 + Ha I wc J 3
                                                                   (V.34)
                                                                   (V.35)
where the ambient humidity is Ha and the mass fraction of contaminant
and air are wc - Mc/M and wa - Ma/M, respectively.  Note that any dilu-
tion of the primary source with air is assumed to be at ambient
humidity.

     The energy balance on the source blanket (hn-R^Hp) gives
        r        i   h  E(t)
    _   hwR Hp   - _E	 4- h M  + h M
    dt  L        -I   w    (t)    a a    W W'S
                    - h
                             tax
                            w
                                                                   (V.36)
where hp is the enthalpy of the primary source gas, ha is the enthalpy
of the ambient humid air, and hw is the enthalpy of any water vapor
entrained by the blanket (if on water).  There are three alternate sub-
models included for heat transfer  (Qs) from the surface to  the  cloud.
     The simplest method for calculating the heat transfer  between the
substrate and the gas cloud is to  specify a constant heat transfer
coefficient for the heat transfer  relation
    Q  -
     s
                                                                   (V.37)

-------
                                   32
where Qs is the rate of heat transfer to the cloud, qs is the heat flux,
and AT is the temperature difference between the cloud and the surface.
For the calculation of heat transfer over the source, the temperature
difference is based on the average temperature of the blanket.

    In the evaluation of the Burro and Coyote series of experiments,
Koopman et al. (1981) proposed the following empirical heat transfer
coefficient relationship for heat transfer between a cold LNG vapor
cloud and the ground
    hO * VCp

where the value of Vy was estimated to be 0.0125 m/s.
can be specified in this model.)
                                                                  (V.38)
                                                       (The constant
     From the heat transfer coefficient descriptions for heat transfer
from a flat plate, the following relationships can be applied.  For
natural convection, the heat transfer coefficient is estimated using
the Nusselt (Nu), Grashoff (Gr), and Schmidt  (Sc) numbers  (McAdams,
1954) from
                     ,1/3
    Nu - 0.14  (Gr Sc)'
or
h  - 0.14
 n
                       .T
                T Pr
                           1/3
                                                                  (V.39)
                                                                  (V.40)
where h   is the natural convection heat transfer coefficient and Pr  is
       n
the Prandtl number.
parameter group
                     In order to simplify the calculations, the
                              1/3
                                                                   (V.41)
 is estimated  to be  60  in mks units  (actual values are 47.25, 58.5,  and
 73.4  for  air, methane,  and propane, respectively).  Equation (V.40)
 becomes
    h  - 18
     n
            1_    AT
                          1/3
                                                                   (V.42)
where  the  density p, molecular weight MW, and  temperature  difference  AT
are  based  on the  average  composition of  the  gas blanket.

     For forced convection,  the  Colburn  analogy  (Treybal,  1980)  is
applied to a flat plate using the  Stanton number  for heat  transfer
and  the Prandtl number as

-------
                                   33
 StH
                 c,

                 2
or
     hf - (u>Cp) Pr
                   -2/3
                                                                  (V.43)
                                                              (V.44)


hf-
2 r o i
u* f 2zo
1.22 _ _
uo I H J
™
<*

where hf Is the forced convection heat transfer coefficient.  If the
velocity is evaluated at z - H/2 and Pr is specified 0.741,
                              PC                                  (V.45)
If H/2 < ZR, then the velocity is evaluated at z - ZR.

     The overall heat transfer coefficient is then the maximum of the
forced and natural convection coefficients, i.e. ho *• max(hf,hn).  The
heat flux and transfer rate are then estimated by Equation (V.37).

     If the gas blanket is formed over water, water may be transferred
from the water surface to the blanket.  The rate of mass transfer of
water is modeled as
ft    - !M P*   - p    i r , r R2 . R2 i i
 W.S   p  [ rW,S   rW,C J L   I       P J J
                                                                  (V.46)
where FQ is an overall mass transfer coefficient.  The partial pressure
driving force is the difference of the vapor pressure of water at the
surface temperature p£iS and the partial pressure of water in the cloud,
Pw,c-  (Th® water partial pressure in the cloud is the minimum of:  (a)
the water mole fraction times the ambient pressure; or (b) the water
vapor pressure at the cloud temperature (Pv,c)-)  T*16 natural convection
coefficient is based on the heat transfer coefficient and the analogy
between the Sherwood number (Sh) and the Nusselt number (Nu) suggested
by Bird et al. (1960)
    Sh - Nu - 0.14 (Gr Sc)
                          1/3
                                F L f
                              -— f
                                 n.  I
                                      —
                                      T
                                                              (V.47)
If the Schmidt number is taken as 0.6,  and



                                 1/3
           .9
be 2.2 x 10   in mks units,
                                         T MW
                                                    is estimated to
    F  - 9.9 x 10
     n
                 -3
                      [-]'
                    L IM» J
AT
                                                              (V.48)

-------
                                   34
For forced convection, Treybal (1980) suggests that the Stanton number
for mass transfer Stft and the Stanton number for heat transfer Sty are
related by
    StM'StH
or,
Pr
Sc
         20.7 hr
    Ff
         MW C
                    2/3
                        - 1.15
StH
(V.49)
                                                  (V.50)
The overall mass transfer coefficient FQ is the larger of the natural
and forced convection coefficients.

     For the case when the primary (liquid) source emission rate E(t)  is
larger than the atmospheric takeup rate Q*max'rR > Equations (V.32),
(V.34), (V.35), and (V.36) are integrated for t8e mass, concentration,
and enthalpy of the gas blanket along with an appropriate equation of
state (i.e. relationship between enthalpy and temperature and between
temperature and density).

     When the emission rate is not sufficient to form a gas blanket, the
flux of contaminant is not determined by the. maximum atmospheric takeup
rate.  Consider the boundary layer formed by the emission of gas into
the atmosphere above the primary source.  If the source is modeled to
have a uniform width 2b and entrain no air along the sides of the layer,
the balance on the total material (PLULHL) ^n a di-fferential. slice of
the layer is
    =
    dx
    p w  +
     a e
                                                                   (V.51)
where we is the vertical rate of of air entrainment  into  the  layer
given by Equation  (V.83), PL *-s tne average density  of  the  slice, and
(Q*/wc)p is the total flux of gas from the primary source.  The balance
on the mass flow rate of contaminant (WCPLULHL) at
                                           " x
                                                             up
                                                                )
                        up
          )
                                                                   (V.52)
With an equation of  state  to relate CC)L and PL, Equation  (V.51)  is
integrated  from the  upwind edge of the source  (x - xup)  to the  downwind
edge (x - L + xup).

     In order to generate  the  initial conditions for  the downwind dis-
persion calculations,  the  maximum concentration cc and the vertical
dispersion  parameter Sz  are needed.  Since  Equations  (V.51) and (V.52)
are written for a  vertically averaged layer, consider the  vertical
average of  the power law distribution.  The height of the  layer HL is
the height  to some concentration level, say 10% of the maximum.
Although strictly  a  function of a, this value  is modeled as

-------
                                   35
            H
             EFF
                                                                   (V.53)
where HEFF is the effective height defined by Equation  (V.79)  and
$L - 2.15.  The vertically averaged concentration CC>L  *-s  defined by
      '.A " Jn
                cdz
                                                          (V.54)
Similarly, the effective transport velocity u, is defined by


    Cc,I?L*L '
         cu dz
           X
                                                                   (V.55)
With Equation (V.53) and defining relations for HEFF  an<* UEFF (Equations
(V.79) and (V.93), respectively), it follows that
                                                                   (V.56)
    c  - S.c.  T
     c    L c,L
- «,
                U020

                1 + a
                              1-fa
                                                                   (V.57)
and
    STw'
     L e
           w
                                                          (V.58)
where w' is given by Equation  (V.83).

Maxim"™ Atmospheric Takeup Rate

     The maximum atmospheric takeup rate  is determined  as  the  largest
takeup rate which satisfies Equations  (V.51)  and  (V.52), and the  maxi-
mum concentration of contaminant at the downwind  edge of the source is
the source contaminant concentration  (cc)s.   Combining  Equations  (V.51)
and (V.52) and assuming adiabatic mixing  of ideal gases with equal molal
heat capacities (i.e. (p  - pa)/cc - 7  - constant),  the  maximum takeup
flux is modeled as
                           a)
                               I  «L  -
                                                                   (V.59)
where
     i
     ~.
     9
         i
         L
       dx
                                                          (V.60)
and
           is defined  (for p > p ) by Equation  (V.76)
                                3.

-------
                                   36
     An upper bound for the atmospheric takeup flux can be associated
with the condition where the source begins to spread as a gravity
intrusion against the approach flow.  In water flume experiments,
Britter (1980) measured the upstream and lateral extent of a steady-
state plume from a circular source as a function of Ri*.  A significant
upstream spread was obtained for Ri* > 32, and lateral spreading at the
center of the source was insignificant for Ri* < 8.  The presence of any
significant lateral spreading represents a lower bound on the conditions
of the maximum takeup flux.

     The integral of Equation (V.60) is evaluated using a local Richard-
son number
    R1.00 -
                        1
                       .1+a
                                             (V.61)
where
              - '
      - g
              „
uj  1+a
                                                                   1

                                                                 1+a
                                                                   (V.62)
and   is 3.1  (corresponding to Ri^ - 20(8 < Ri# < 32)).  Equation
(V.60) then becomes
         i
         L
  dx
              0.88 -I- 0.099 £1-04x
                                             (V.63)
 Equation  (V.63)  can be  solved analytically  (Gradshteyn and Ryzhik,
 1980).  With <£ determined, Q*inax can be determined with Equation  (V.59).

 Simulation  of Transient Gas Releases
      For simulating steady-state  releases,  the  transient  source  calcula-
 tion is  carried out until  the  source  characteristics no longer change
 (significantly)  with time.   The maximum  centerline  concentration cc, the
 horizontal  and vertical  dispersion parameters Sy  and S2>  the half width
 b,  and if necessary,  the enthalpy h are  used as initial conditions for
 the downwind calculation specified in a  transient spill.

      Transient releases  are  modeled as a series of  pseudo-steady-state
 releases.  Consider a series of observers traveling with  the wind over

-------
                                   37
the transient gas source described above; each observer originates from
the point which corresponds with the maximum upwind extent of the gas
blanket (x - -Rmax)•  The observer velocity is UEFF (Equation (V.93)),
the average transport velocity of the gas.  Since, in general, the value
of UEFF may differ from observer to observer, observer separation is not
guaranteed.  For a neutrally buoyant cloud, ugpF *s a function of down-
wind distance alone, and observer separation is guaranteed.  Following
Colenbrander (1980), the observer velocity is modeled as:
u,
              1 + 0
                         0m
                         o
                                   x + R
                                        max
                                R  +R
                             2   m    max
                                                                   (V.64)
where S    is the value of S   when the averaged source rate
   2   Z0m                  Z0
(irR Q*) is a maximum, and the subscript i denotes observer i.  Noting
that U£(x) - dxj/dt, observer position and velocity are determined.

    A pseudo- steady- state approximation of the transient source is
determined as each observer passes over the source.  If t    and t,
                            r
denote the times when observer i encounters the upwind and downwind
edges of the source respectively, then the source fetch seen by
observer i is:
L. - x    - x.
 i    upj^    dn£
                                                                   (V.65)
The width of the source 2B.(t) is defined by
           - R2(t) - x2(t)
Then the gas source area seen by observer i is

               C
                                                              (V.66)
          f dni
2Libi-2Jt     Biui
                                                                   (V.67)
where 2bi is the average width.

    The takeup rate of contaminant 2(Q^Lb). is calculated as
               'dn.


               'UP,-
                                                                   (V.68)
The total mass flux rate from the source is

-------
                                   38
    2<>L"LHLb>l '
                      UP4
                       p w' +
                        a e
                                     W
(V.69)
    The average composition of the layer can now be determined at
each x - xup over the source.  The enthalpy of the layer is given
by
                      rdni    f Q* 1
                  -2 r     h   -
                        t       I *ff* I
                                                              (V.70)
(due to the choice of the reference temperature as the ambient tempera-
ture) .  With a suitable equation of state relating enthalpy, tempera-
ture, and density, the source can be averaged for each observer.  After
the average composition of the layer is determined at the downwind edge,
an adiabatic mixing calculation is performed for gas of the layer
average concentration and the ambient air.  This calculation determines
the function between density and concentration relationship for the
remainder of the simulation if the calculation is adiabatic; it repre-
sents the adiabatic mixing condition if heat transfer is included in
the downwind simulation.

     For each of several observers released successively from
x " ~Rmax> tne observed dimensions L and b, the downwind edge of the
source x b

-------
                                   39
               c (x) exp
                c
                               S2(x) J
                                      1+a
A power law wind velocity profile is assumed
for |y| < b
                                                                   (V.71)
    u  — u_
     x    0
            (V.72)
where the value of a is determined by a weighted least-squares fit
of the logarithmic profile
         u.
    u  -
     x
         k
                   z + z
              In
                        R
            (V.73)
Functional forms for * and typical values of a are given in Table V.I
for different Pasquill stability categories.  With these profiles, the
parameters of Equation (V.71) are constrained by ordinary differential
equations.

-------
                                   40
                                 TABLE V.I
               TYPICAL ATMOSPHERIC BOUNDARY LAYER STABILITY
                      AND WIND PROFILE CORRELATIONS
           Monin-Obukhov
           Length (A) as
            a Function
Pasquill    of Surface
Stability   Roughness
Category      zn(m)^
                 Typical
                  Power
                   Law
                Exponents
                   a in
               Eqn. (V.72)
                       Corrections to
                   Logarithmic Profiles as
             Given by Businger et al. (1971)
                   * in Eqn. (V.73)
   B
            -11.4
-26.0 zg-17
       Jx
            -123
                  0.108
0.112
                  0.120
              t - 2 In
In
                                                - 2 tan" (a) + x/2 with
                                                a - (1 - 15(z/A))
                                                                  1/4
                              0.142
                                            * - 0
            123 zg.30
                 K.
            26.0 zg.17
                  0.203
                  0.253
                                                    * -  -4.7  (z/A)
1-Curve fit of data from Pasquill  (1974)
Vertical Dispersion
The vertical dispersion parameter Sz is determined by requiring  that  it
satisfy the diffusion equation
    u
                                                      (V.74)
       3x   dz    dz
with  the vertical turbulent diffusivity given by
    K  -
     z
          ku z
                                                       (V.75)

-------
                                   41
     The function ^(Ri*) is a curve fit of laboratory data for vertical
mixing in stably density-stratified fluid flows (Ri* > 0) reported by
Kantha et al. (1977), Lofquist (1960), and McQuaid (1976).  For Ri* < 0,
the function ^(Ri*) was taken from Colenbrander and Futtock (1983) and
modified so the passive limit of the two functions agree as follows:
        ^) - 0.88 + 0.099 Ri^'04

           - 0.88/(1 + 0.65 |Ri |°-6)
                                                                   (V.76)
                                                        Ri*<°
     The friction velocity is calculated using Equation (V.73) from a
known velocity UQ at a specific height ZQ.  Combining the assumed
similarity forms for concentration and velocity, Equations  (V,71),
(V.72), (V.74), and (V.75) give
    d
    dx
                         1+a
                                       + a)
                                                                  (V.77)
where the Richardson number Ri. is computed as
    Ri* - &
                ' "a ] HEFF
                Pa.
                        4
                                                                  (V.78)
and the effective cloud depth is defined as
    H
     EFF
l_

CG
cdz - T
                                                                  (V.79)
    Equation (V.77) can be viewed as a volumetric balance on a dif-
ferential slice downwind of the source.  A mass balance over the
same slice gives,
    ^ ( 'WL ) - "awe
                                                                  (V.80)
which is Equation (V.51) without the source term.
(V.57) and (V.58), this becomes
                                                   With Equations
    1  ( PLUEFFHEFF ] - p^
                                                                  (V.81)

-------
                                  42
    Assuming adiabatic mixing of ideal gases with equal constant molal
heat capacities (i.e.  (p -  pa)/cc ~ constant) and using the contaminant
mass balance, the mass balance becomes
     d
    dx
which leads to

         w
    w' - _1 -
     e
                                                                 (V.82)
              ku(1 + o)
                                                                 (V.83)
Equations (V.81) and (V.83)  are combined to  give


    j- I "L^F^EFF J "
                        p ku(1 + a)
                         a  ™
                                                                 (V.84)
    dx
Generalizing, Equation (V.84)  is assumed to  apply  when  (pa - pc)/c
is not constant.
     When heat transfer from the surface is  present, vertical mixing
will be enhanced by the convection turbulence  due  to heat transfer.
Zeman and Tennekes (1977) model the resulting  vertical turbulent
velocity as
    w
    u.
                          1/2
                                                                  (V.85)
where w  is the convective scale velocity described as
      w*  '2
      u.
                    (Ts - TC,L)
                u*u
                        c.L
                                 2/3
                                                                  (V.86)
 If u  is  is evaluated at H
                         EFF'
    --(
    11     *•
1 + I Ri2/3 11/2
    4   T
                                                                  (V.87)
where
        -  s
   T  - T  .
    s    c,L

     TC.L    J
                          H
                           EFF
                                  _
                                  HEFF .
                                                                  (V.88)

-------
                                   43
and Tc L *-s the temperature obtained from the energy balance of  Equa-

tions (V.103) and (V.104).  Equation (V.84) is modified to account  for

this enhanced mixing by
d  f
—   PL1
dx ^  L
                        Pakw(l + a)
                                                                   (V.89)
where Ri^ - Ri^ | 	
     Although derived for two-dimensional dispersion, Equation  (V.89)  is

extended for application to a denser-than-air gas plume which spreads

laterally as a density intrusion:
d  f                1   Pfp**-1 + °)

—   PLUEFFHEFFBEFF   " -
dx l  U   *  *f "* J     ^(Ri)
                                        B
                                         EFF
where the plume effective half width is defined by




    BEFF - b + ~2 Sy


and determined using the gravity intrusion relation
^EFF _
dt E
f ' * Pa

-------
                                   44
                         1 ]
                       11+oJ
                          o)
                              1/2
                                   P '  P
                                                     e-j
                                                                  (V.94)
Horizontal Dispersion

     The crosswind similarity parameter Sy(x)  is also determined by
requiring that it satisfy the diffusion equation
     x ax   ay L  y ay
with the horizontal turbulent diffusivity given by
                                                                  (V.95)
    Ky * VxBEFF
                                                                  (V.96)
For a passive plume (b - 0),  Sy - ./2~ay,a where 0y,a *-s t^ie similarity
parameter correlated by Pasquill (1974) in the form <7y>a ~ 5yX^y where
Sy and 0y are functions of the Pasquill stability category and the
averaging time.  Furthermore, Equations (V.95) and (V.96) require that
     y,a
                  0 BEFF
                                                                  (V.97)
                             2/3
where 7;L - 2 - 1//3  and KQ - __Z (SyJZ/2)
                                                Then,
dS 4/9
S y -
y dx
y B2
~ EFF
yV*/
BEFF

                                                                  (V.98)
where Equation (V.98) is also assumed applicable for determining Sy
when b is not zero.

     At the downwind distance xt where b - 0, the crosswind concentra-
tion profile is assumed Gaussian with Sy given by
    S  - J2 S (x + x )'
     y         y    v
                                                                  (V.99)
where x   is a virtual source distance determined as
       v
                                                                 (V.100)
 The  gravity  spreading calculation is terminated for x >

-------
                                   45
Averaging Time
     The observed dispersion of a gas plume is a function* of the
observation (averaging) time.  Herein we have assumed:
          The most important influence of averaging time on observed
          plume properties is associated with plume meander.
          For ground- level releases, vertical plume meander is much
          smaller than horizontal plume meander.
Gifford (1960) showed that the ratio of maximum measured concentrations
based on different averaging times (ta and tp) was given by
    c (t )
     c  P  _
    c (t )
     c  a
P J
   0.2
for ta/tp up to about 200, when source and receptor were at the same
level.  Spicer and Havens (1988) proposed that
         (t )
           a'
     y,a
         0.2
where ta>i was suggested to be an "instantaneous" averaging time
representing the smallest time scale associated with plume meander.
(Practically, ta ^ represents a nonzero averaging time associated with
the puff coefficient ory,a(ta,i) •)  Based on correlations from Gifford
(1976) and Slade (1968)] Spicer and Havens (1988) presented the
following dispersion coefficient correlations for stabilities A through
F:
    a   (x;t ) - 0.423
     y,av   a'
               - 0.313
            a) • °'210
            a
               " °'136
    o   (x;t ) - 0.102
     y , a.    a
/• * •»
t
a
600 s ^
0.2 0.9
x

, * .
f t
a
I 600 s ^
0.2 0.9
x

.r *
f t 10.2 0.9
_a_ x
L 600 s J
/• * •*
r t
a
t 600 s ,
0.2 0.9
x

, * .
f c 1
a
L 600 s
0.2 0.9
x

                                 B
                                                (V.lOla)
(V.lOlb)
                                                (V.lOlc)
                                                (V.lOld)
                                                (V.lOle)

-------
                                   46
                           t    ]0.2  0.9
        a    a           [ 600 t

where ta - max(ta, ta>i) and ta is the desired averaging time.  Values
of ta>i are shown in fable V.2.

                   Table V.2.  Values of ta i for
                               Use in Eq. (V.101)
                   Pasquill Stability      ta>I.(s)
                            A               18.4
                            B               18.4
                            C               18.4
                            D               18.3
                            E               11.4
                            F                4.6
Values for Sy and fry are then determined by Equation (V.101).   (For
example, for an averaging time of 60 s for F stability, ta - 60 s,
Sy - 0.0425, and 0y - 0.9.)

(Thermal) Energy Balance

     For some simulations of cryogenic gas releases, heat transfer to
the plume in the downwind dispersion calculation may be important,
particularly in low wind conditions .  The source calculation determines
a gas/air mixture initial condition for the downwind dispersion
problem.  Air entrained into the plume is assumed to mix adiabatically.
Heat transfer to the plume downwind of the source adds additional heat.
This added heat per unit mass Oft is determined by an energy balance on
a uniform cross -section as
[ VLWEFF ]  -
                              L                                     0.   Since  the average density of the layer /JL cannot be
determined until the temperature  (i.e. D^)  is known, a trial and  error
procedure is  required.

-------
                                   47
Closure

     For a steady plume, the centerline concentration cc is determined
from the material balance
E -
           I   cu dydz - 2c
           J-o  x
                                        —     "EFF
                                                                 (V.104)
where E is the plume source strength.

     Equations (V.76), (V.78), (V.79), (V.85)-(V.91), (V.93), (V.94),
(V.98)-(V.100), and (V.102)-(V.104) are combined with an equation of
state relating cloud density to gas concentration and temperature and
are solved simultaneously to predict Sz, Sy, cc, and b as functions of
downwind distance beginning at the downwind edge of the gas source.

                 Correction for Along-Wind Dispersion
     Following Colenbrander (1980), an adjustment to cc is applied to
account for dispersion parallel to the wind direction.  The calcu-
lated centerline concentration cc(x) is considered to have resulted from
the release of successive planar puffs of gas (cc(x^Ax) without any
dispersion in the x-direction.  If it is assumed that each puff diffuses
in the x-direction as the puff moves downwind independently of any other
puff and that the dispersion is one-dimensional and Gaussian, the
x-direction concentration dependence is given by
                       )Ax.
                       '
    c'
     c
1
2
x - x
pi
a
x
2 "
                                                                  (V.105)
where x   denotes the position of the puff center due to observer i.
     After Beals  (1971) , the x-direction dispersion coefficient CTX a is
assumed to be a function of distance from the downwind edge of the gas
source (X - x - XQ) and atmospheric stability given by
     x,a
        (X) - 0.02 X
            - 0.04 X
            - 0.17 X1
                1.22
                1.14

                0.97
unstable, x > 130 m
neutral,  x > 100 m
stable,   x >  50 m
                                                                  (V.106)
where  (X - x - XQ) and ax a are in meters.  The concentration at x is
then determined by superposition, i.e., the contribution to cc at a
given  x from neighboring puffs is added to give an x-direction
                        For N observers,
corrected value of c'
                    c
c;oo -
N
2
c (x )
C Pi
	 eyn
y2?r <7
x,a
1
2
x - x
Pi
a
x,a
2 "
                                                     Ax.
                                                                 (V.107)

-------
                                   48
and for large N,
                        cc«)
                                 exp
1
2
                                                                 (V.108)
     The corrected centerline concentration cc is used in the assumed
profiles in place of cc, along with the distribution parameters Sy,
Sz, and b.

-------
                                   49
                 VI.  CONCLUSIONS AND RECOMMENDATIONS
     DEGADIS was designed to model the atmospheric dispersion of ground-
level, area-source dense gas (or aerosol) clouds released with zero
(initial) momentum into an atmospheric boundary layer over flat, level
terrain.  DEGADIS describes the dispersion processes which accompany the
ensuing gravity-driven flow and entrainment of the gas into the atmos-
pheric boundary layer.

     A jet-plume model has been interfaced with DEGADIS to provide for
prediction of the trajectory and dilution of vertically oriented gas or
aerosol jets.  When the jet plume returns to ground level, DEGADIS
predicts the ensuing ground-level plume dispersion.  The jet-plume model
provides for

    •  automatic adjustment of integration step-size (using the
       Runge-Kutta-Gill method as in DEGADIS),

    •  elliptical plume shape (cross-section),  with air
       entrainment specified consistent with the Pasquill-
       Gifford plume dispersion coefficient representation of
       atmospheric turbulent entrainment,

    •  application to scenarios where the plume returns to
       ground level or remains aloft, and

       ground reflection when the plume (lower) boundary reaches
       ground level.

    It is recommended that the following limitations and cautions be
observed when using the jet-plume and DEGADIS models.

    •  The jet-plume model presently provides only for vertically
       oriented releases.

    •  Both models assume an unobstructed atmospheric flow field.
       The jet-plume model assumes a logarithmic wind profile,
       and the DEGADIS model assumes a power law wind profile
       which is consistent with the logarithmic wind profile.
       Application of the models should be limited to releases
       where the depth of the dispersing layer is much greater
       than the height of the surface roughness elements.

       Averaging time can be user-specified.  There are three
       important time scales for the typical dispersion
       application:  the averaging time input to the model (tav),
       the time scale assumed for specification of the
       concentration/hazard relation (t^az), and the time
       required for the contaminant material to be taken up by

-------
                            50
the atmosphere (tre]_).   The averaging time tav influences
the rate of lateral spread (dispersion) due to atmospheric
turbulence (5y).   For an elevated release which does not
return to the ground, trei is the duration of the release.
For a transient ground-level release or for an elevated
release which returns to the ground, trei is the duration
of the secondary source blanket in DEGADIS.  For a steady-
state release (large trei), tav should be set to t^az.
(For example, if thaz is based on toxicological data for
one hour exposure,  then tfcaz - tav - 3600 s.)  For a
transient release,  tav should be set to the minimum of
thaz or trel.  If thaz < trel, tav - thaz.  If trei <
thaz» tav - trei, and the concentration time history at a
given position should be averaged over tfcaz to determine
the hazard.

-------
                                   51
                              REFERENCES
Albertson M. L.,  Y. B. Dai, R. A. Jenson, and H. Rouse, "Diffusion of
    Submerged Jets," Transactions of American Society of Civil
    Engineers, 115. (1950).

Astleford, W. J., T. B. Morrow, and J. C. Buckingham, "Hazardous
    Chemical Vapor Handbook for Marine Tank Vessels," Final Report to
    U.S. Coast Guard, CG-D-12-83, USCG HQ, Washington, DC, April, 1983.

Atwood, J. D., "Ammonia Pipeline Failure Near Enid, Oklahoma," Paper No.
    45f, 82nd American Institute of Chemical Engineers, Atlantic City,
    New Jersey, August 30-September 1, 1976.

Batchelor, G. K., An Introduction to Fluid Dynamics.  Cambridge
    University Press, Cambridge, UK, 1967.

Seals, G. A., "A Guide to Local Dispersion of Air Pollutants," Air
    Weather Service Technical Report 214, April, 1971.

Bird, R. B., W. E. Stewart, and E. N. Lightfoot, Transport Phenomena.
    John Wiley and Sons, New York, 1960.

Briggs, G. A., "Plume Rise," AEG Critical Review Series, USAEC Division
    of Technical Information Extension, Oak Ridge, Tennessee, 1969.

Britter, R. E.,  "The Ground Level Extent of a Negatively Buoyant Plume
    in a Turbulent Boundary Layer," Atmospheric Environment.  14, 1980.

Britter, R. E., unpublished monograph, 1980.

Businger, J. A., J. C. Wyngaard, Y. Izumi, and  E. F. Bradley, "Flux-
    Profile Relationships  in  the Atmospheric Surface Layer,"  Journal  of
    the Atmospheric Sciences.  28. March,  1971.

Carnahan, B., H. A. Luther, and J. 0. Wilkes, Applied Numerical Methods.
    John Wiley and Sons, 1969.

Chassaing,  P., J.  George,  A.  Claria,  and  F. Sananes,  "Physical
    Characteristics of Subsonic Jets  in a Cross -Stream," Journal of
    Fluid Mechanics.  62, 41,  1974.

Chiang, Hsu-Cherny and B.  L.  Sill,  "Entrainment Models  and  their
    Application  to Jets  in a  Turbulent Cross Flow," Atmospheric
    Environment. 19,  9,  1425-1438,  1985.

Colenbrander, G. W.,  "A  Mathematical Model for  the Transient  Behavior of
    Dense Vapor  Clouds," 3rd  International Symposium on Loss  Prevention
    and Safety Promotion in the Process Industries, Basel,  Switzerland,
    1980.

-------
                                   52
Colenbrander, G. W. and J. S. Puttock, "Dense Gas Dispersion Behavior:
    Experimental Observations and Model Developments," International
    Symposium on Loss Prevention and Safety Promotion in the Process
    Industries, Harrogate, England, September, 1983.

Cude, I. L., "Dispersion of Gases Vented to Atmosphere from Relief
    Valves," The Chemical Engineer. October, 1974.

Davidson, G. A., "A Discussion of Schatzmann's Integral Plume Model from
    a Control Volume Viewpoint," Journal of Climate and Applied
    Meteorology. 25, 858-867, 1986.

Emerson, M. C., "A New  'Unbounded' Jet Dispersion Model," Fifth
    International Symposium on Loss Prevention and Safety Promotion in
    the Process Industries, Cannes, France, September, 1987.

Gifford, F., "Peak to Average Concentration Ratios According to a
    Fluctuating Plume Dispersion Model," International Journal of Air
    Pollution. 1(4), 253-260, 1960.

Gifford, F., "Turbulent Diffusion-Typing Schemes: A Review."Nuclear
    Safety.  17(1), 68-86, 1976.

Gradshteyn,  I.  S.  and I. M. Ryzhik, Table of  Integrals. Series. and
    Products.  corrected and enlarged  edition, Academic Press, New York,
    1980.

Guinnup, D. W., personal communication with reference to EPA Relief
    Valve Discharge  (RVD) model, January, 1989.

Havens, Jerry,  "A  Dispersion Model for Elevated Dense Gas Jet Chemical
    Releases," Volumes  I and II, EPA-450/4-88-006, U.S. Environmental
    Protection Agency,  April, 1988.

Havens, J. A.  and  T. 0. Spicer, "Development  of an Atmospheric
    Dispersion Model for Heavier-than-Air Gas Mixtures," Final Report to
    U.S. Coast Guard, CG-D-23-85, USCG HQ, Washington, DC,  May, 1985.

Hoot, T. G., R. N. Meroney,  and J. A. Peterka, "Wind Tunnel Tests of
    Negatively Buoyant  Plumes," Report CER73-74TGH-RNM-JAP-13, Fluid
    Dynamics and Diffusion Laboratory, Colorado State University,
    October, 1973.

Kaimal, J.  C.,  J.  C. Wyngaard, D. A.  Haugen,  0. R.  Cote, and Y. Izumi,
     "Turbulence Structure  in the Convective Boundary Layer," J. Atmos.
     Sci.,  33,  1976.

Kamotani,  Yasuhiro and  Isaac Greber,  "Experiments on a Turbulent Jet  in
     a Cross  Flow," AIAA Journal, Vol.  10, No.  11, November, 1972.

-------
                                   53
Kantha, H. L.,  0. M. Phillips, and R. S. Azad, "On Turbulent Entrainment
    at a Stable Density Interface," Journal of Fluid Mechanics.  79.
    1977, pp. 753-768.

Keffer, J. F. and W. D. Baines, "The Round Turbulent Jet in a Cross -
    Wind," Journal of Fluid Mechanics. 15_, 4, 481-496, 1963.

Koopman, R. P.  et al., "Description and Analysis of Burro Series
    40-m3 LNG Spill Experiments," Lawrence Livermore National
    Laboratories Report UCRL-53186, August 14, 1981.

List, E. J., "Mechanics of Turbulent Buoyant Jets and Plumes," in W.
    Rodi, Turbulent Buoyant Jets and Plumes. Pergamon Press, Oxford,
    1982.

Lofquist, Karl,  "Flow and Stress Near an Interface Between Stratified
    Liquids," Phvsics of Fluids. 3, No. 2, March-April, 1960.

McAdams, W. H.,  Heat Transmission. McGraw-Hill, New York, 1954.

McQuaid, James,  "Some Experiments on the Structure of Stably Stratified
    Shear Flows," Technical Paper P21,  Safety in Mines Research
    Establishment,  Sheffield, UK, 1976.

Moller,  J.  S., H. Schroeder,  and I. S.  Hansen, "An Integral Model of the
    Buoyant Surface Jet and Plume in a  Cross Current and Wind,"
    presented at the  Third International Symposium on Stratified Flows,
    California Institute of Technology, Pasadena, California, February,
    1987.

Morrow,  T.  B., "Analytical and Experimental Study to Improve Computer
    Models  for Mixing and Dilution of Soluble Hazardous Chemicals,"
    Final Report, Contract DOT-CG-920622-A with Southwest Research
    Institute, U.S. Coast Guard, August, 1982.

Morrow,  T.  B., "Investigation of the Hazards Posed by Chemical Vapors
    Released in  Marine Operations--Phase II," Southwest Research
    Institute Project Report  05-5686, July, 1985.

Ooms,  G.,  "A New Method for the Calculation of the Plume Path of Gases
    Emitted by a Stack," Atmospheric Environment. 6, 899-909, 1972.

Ooms,  G., A. P.  Mahieu, and F. Zelis, "The Plume Path of Vent Gases
    Heavier than Air," First  International Symposium on Loss Prevention
    and  Safety Promotion in the Process Industries, (C. H. Buschman,
    Editor), Elsevier Press,  1974.

Pasquill, F., Atmospheric Diffusion. 2nd edition, Halstead Press, New
    York, 1974.

Pratte,  B.  D. and W.  D. Baines, "Profiles of the Round Turbulent Jet in
    a  Cross Flow," ASCE--Journal of the Hydraulics Division. 92. HY6,
    5556, 1967.

-------
                                   54
Richards, J. M. ,  "Experiments on the Motion of an Isolated Cylindrical
    Thermal Through Unstratified Surroundings," International Journal of
    Air and Water Pollution, 1, 1963.

Schatzmann, M., "The Integral Equations for Round Buoyant Jets in
    Stratified Flows," ZAMP. £9, 608-630, 1978.

Schatzmann, M. and A. P. Policastro, "An Advanced Integral Model for
    Cooling Tower Plume Dispersion," Atmospheric Environment. 18.  4,
    663-674, 1984.

Seinfeld, J. H.,  Atmospheric Chemistry and Physics of Air Pollution.
    John Wiley and Sons, New York, 1986.

Simpson, J. E. and R. E. Britter, "The Dynamics of the Head of a Gravity
    Current Advancing over a Horizontal Surface," Journal of Fluid
    Mechanics. 94, Part 3, 1979.

Slade, D. H.,  "Meteorology and Atomic Energy - 1968," U.S. Atomic Energy
    Commission, NTIS #TID-24190, 1968.

Spicer, T. 0.  and J. A. Havens, "Development of Vapor Dispersion Models
    for Non-Neutrally Buoyant Gas Mixtures--Analysis of USAF/N204 Test
    Data," USAF Engineering and Services Laboratory, ESL-TR-86-24,
    Final Report, September, 1986.

Spicer, T. 0.  and J. A. Havens, "Modeling HF and NH3 Spill Test Data
    using DEGADIS,"  Paper No. 87b,  1988 Summer National Meeting of
    American  Institute  of Chemical  Engineers, August, 1988.

Spicer, T. 0.  and J. A. Havens, "Development of Vapor Dispersion Models
    for Nonneutrally Buoyant Gas Mixtures--Analysis of TFI/NH3 Test
    Data," UASF Engineering and Services Laboratory, Final Report,
    October,  1988.

Treybal, R. E., Mass Transfer Operations. 3rd  edition, McGraw-Hill, New
    York,  1980.

Turner,  D.  B., "Workbook  of Atmospheric Dispersion  Estimates," USEPA
    999-AP-26, U.S.  Environmental Protection Agency, Washington DC,
    1970.

van Ulden,  A.  P.,  "The  Unsteady Gravity Spread of a Dense  Cloud in  a
    Calm Environment,"  10th International Technical Meeting  on Air
    Pollution Modeling  and  its Applications, NATO-CCMS, Rome, Italy,
    October,  1979.

van Ulden,  A.  P.,  "A New  Bulk  Model for Dense  Gas Dispersion: Two-
    Dimensional  Spread  in Still Air,"  I.U.T.A.M. Symposium on
    Atmospheric  Dispersion  of  Heavy Gases and  Small Particles, Delft
    University of Technology,  The Netherlands, August 29-September  2,
    1983.

-------
                                   55
Wheatley, C. J., "Discharge of Ammonia to Moist Atmospheres--Survey of
    Experimental Data and Model for Estimating Initial Conditions for
    Dispersion Calculations," UK Atomic Energy Authority Report 3RD
    R410, 1986.

Zeman, 0. and H. Tennekes, "Parameterization of the Turbulent Energy
    Budget at the Top of the Daytime Atmospheric Boundary Layer,"
    Journal of the Atmospheric Sciences. January, 1977.

-------
                                  A-l
                              APPENDIX A

                     MODEL APPLICATION ON VAX/VMS
     DEGADIS Version 2.1 (including the jet/plume front-end model) was
developed under VAX/VMS V3.5 and VAX-11 Fortran V3.5; there should be no
installation difficulty for VAX/VMS V4.0 or later.

                             Installation

     The directory which contains the Fortran source code for DEGADIS
must be equivalenced with the logical name SYS$DEGADIS:.  If the full
directory specification is DQAO:[DEGADIS_V21],  issue the VAX/VMS
command:
     $ ASSIGN DQAO:[DEGADIS_V21] SYS$DEGADIS:
with either the /PROCESS, /GROUP, or /SYSTEM qualifier  (/SYSTEM is
recommended).  Once this assignment is made, the files must be compiled
and linked to form DEGADISIN, DEGADIS1, DEGADIS2, DEGADIS3, DEGADIS4,
and SDEGADIS2; the VMS command procedure BUILD.COM performs these tasks.
The process which compiles and links DEGADIS must have READ, WRITE, and
EXECUTE access privileges to SYS$DEGADIS while only READ and EXECUTE
access privileges are needed to execute the existing models.
Considerations for Installation other than VAX/VMS

     There are two types of problems which may occur when attempting  to
install DEGADIS on a different computer or operating system.  The  first
is due to the use of non-standard ANSI Fortran 77 language elements.
The second is due to the use of external VAX/VMS routines in DEGADIS.

     The following VAX-11 Fortran extensions have been used in DEGADIS:

     (*)  In-line comments--An exclamation mark  (!) is used to include
          comments at the end of a valid statement.

     (*)  Special characters--The underscore (_) is used in variable
          names.

     (*)  DO loops--DO loops are used with the structure:

              DO v - el,e2[,e3]
              END DO
          where v is a variable name and el, e2, and e3 are numeric
          expressions.  The numeric expressions have the standard
          Fortran 77 meaning.

-------
                                  A-2
     (*)   INCLUDE statements--INCLUDE statements simply allow other
          source files to be inserted in the routine being compiled at
          this point in the source.   The system table '($SSDEF)'  is used
          to check the status or returning system routines.

     (*)   OPEN keyword NAME--The OPEN keyword NAME specifies the file
          name to be opened.

     (*)   Fortran descriptors--The Q descriptor obtains the integer
          number of characters remaining in the input record during a
          READ operation.  The dollar sign ($) descriptor suppresses the
          carriage return at the end of a line on output.

     (*)   Continuation lines--Continuation lines have been expressed by
          using either a nonblank character in column 6 or by beginning
          the line with a tab and a number in the next column.

     (*)   Concatenation of character strings--Character strings are
          concatenated using two slashes (//).

The following VAX/VMS subroutines have been used in DEGADIS:

     (*)   SECNDS
          TIME - SECNDS(TIMED)
          SECNDS returns to TIME the difference between the number of
          seconds after midnight on the system clock and the value of
          TIMEO.
     (*)   LIB$DATE_TIME
          ISTAT - LIB$DATE_TIME (STRING)
          LIB$DATE_TIME returns a 24-character ASCII string with the
          system date and time.  ISTAT is an integer variable which
          accepts the return status.
     (*)  LIB$DO_COMMAND
          ISTAT - LIB$DO_COMMAND (STRING)
          LIB$DO_COMMAND issues the command STRING  (a character string)
          to VAX/VMS.  If the command is not issued, ISTAT contains the
          failure code.  If the command is issued,  the calling process
          is  terminated.

                         Model Implementation

     The  (combined) jet/plume  (JETPLU) and DEGADIS  models  consist  of
nine separate  programs:

          JETPLU_IN   is  the  file-based input module which defines the
                       simulation.

          JETPLU      describes  the  trajectory  and  dilution of  the
                       vertically  oriented jet release.

      •    DEGBRIDGE   is  an interface program which takes  the output
                       from JETPLU  (if where  the jet/plume  returns  to
                       ground level)  and provides appropriate input to
                       DEGADIS.

-------
                                  A-3
     •     DEGADISIN   is the interactive input module which defines
                      DEGADIS-only simulation.

     •     DEGADIS1    determines a and describes the gas source for
                      transient and steady-state releases.

     •     DEGADIS2    describes the pseudosteady-state downwind
                      dispersion of the released gas.

          DEGADIS3    sorts the results of DEGADIS2 for a transient
                      release at given times.

          DEGADIS4    sorts the results of DEGADIS2 for a transient
                      release at given positions.

     •     SDEGADIS2   describes the steady-state downwind dispersion of
                      the released gas.

Steady-state releases are simulated by executing JETPLU, DEGBRIDGE,
DEGADIS1, and SDEGADIS2; time-limited (transient) releases are simulated
by executing JETPLU, DEGBRIDGE, DEGADIS1, DEGADIS2, and DEGADIS3.

     The JETPLU DEGADIS model uses three types of input information
     •     VAX/VMS command procedure for execution
     •     simulation definition
     •     numerical parameters.
The VAX/VMS command procedure used to execute JETPLU DEGADIS is gene-
rated by JETPLU_IN which also reads the simulation definition.  DEGADIS
can be run without JETPLU (for ground-level, zero momentum releases).
Input to DEGADIS is made to run interactively using DEGADISIN.  Example
input sessions are included in Appendix B.  The numerical parameters
(convergence criteria,  initial increments, etc.) are supplied to DEGADIS
through a series of input files.  Although these numerical parameters
are easily changed, the user should need to change these only rarely
(with the exception of  the time-sort parameters which are explained
later in this appendix).

VAX/VMS Command Procedures

     The VAX/VMS command procedure generated by JETPLU_IN controls the
execution of programs for the  simulation.  Program execution follows one
of two paths:  (a) a transient  (time-limited) release or (b) a steady-
state release.  JETPLU_IN, which automatically generates the appropriate
command procedure, requires a  simulation name be specified.  The
simulation name must be a valid VAX/VMS file name without a file
extension and is designated RUN_NAME.  JETPLU and DEGADIS will use this
file name with standard extensions for input, interprocess
communication, and output.  Figures A.I and A.2 show example VAX/VMS
command procedures created by JETPLU_IN for the run names TEST_S and
TEST for steady-state and transient releases, respectively.  The
directory which contains the executable images has been assigned the
system logical name SYS$DEGADIS.  The COPY/LOG command copies a file

-------
                                  A-4
from the first argument to the second argument, and the RUN command
executes the specified image.  These steps may also be carried out by
issuing the commands at a terminal.
$ assign test_s.ino forOOl
$ assign test_s.out forOOS
$ assign test_s.ind for002
$ run sys$degadis:jetplu
$ deassign forOOl
$ deassign for002
$ deassign for003
$ run sys$degadis:degbridge
test_s
$ copy/log SYS$DEGADIS:example.erl test_s.erl
$ copy/log SYS$DEGADIS:example.er2 test_s.er2
$ run SYS$DEGADIS:DEGADIS1
test_s
$ run SYS$DEGADIS:SDEGADIS2
test_s
$ copy/log test_s.out + test_s.scl + test_s.sr3 -
  test s.lis
          Figure A.I.  Example DEGADIS Command Procedure on
                       VAX/VMS for a Steady-State Simulation
                       Named TEST S.

-------
                                  A-5
$ assign test.ino forOOl
$ assign test.out for003
$ assign test.ind for002
$ run sys$degadis:jetplu
$ deassign forOOl
$ deassign for002
$ deassign for003
$ run sys$degadis:degbridge
test
$ copy/log SYS$DEGADIS:example.erl test.erl
$ copy/log SYS$DEGADIS:example.er2 test.er2
$ copy/log SYS$DEGADIS:example.er3 test.erS
$ run SYS$DEGADIS:DEGADIS1
test
$ run SYS$DEGADIS:DEGADIS2
test
$ run SYS$DEGADIS:DEGADIS3
TEST
$ copy/log test.out +  test.scl + test.sr3 -
  test.lis
          Figure A.2.  Example DEGADIS Command Procedure on
                       VAX/VMS for a Transient Simulation Named
                       Test.
 Simulation Definition

     JETPLU_IN  specifies  information about  the  ambient wind field,  the
 properties of the  released material, and details  of  the  release.

     The  input  uses  free-formatted files; a value for each parameter
 must be specified  in the  input  file even if it  has no meaning for the
 simulation at hand.  This form  of  input allows  the user  to ignore
 spacing in the  input file.  Numbers on a particular  line can be
 separated by commas, spaces,  or tabs.  Comments may  also be included at
 the end of any  line  in the input file as long as  all required values are
 given before any comments are included.  Lines  which are only comments
 are allowed only after all required values  have been specified.   (Sample
 input files are included  in Appendix B.)

     The  ambient wind  field is  characterized by a known  velocity  UQ at a
 given height ZQ, a surface roughness ZR, and the  Pasquill stability
 class or  Monin-Obukhov length.   The Pasquill stability class is required
 to estimate values of  the lateral,  vertical, and  along-wind similarity
 coefficients.   If  specified,  the Monin-Obukhov  length A  is required to
 calculate the friction velocity u*.  In addition  to  these specifica-
 tions, the ambient temperature,  pressure, and humidity must be speci-
 fied.

-------
                                  A-6
     The contaminant properties are used by the model to fix the mixture
density from the contaminant concentration.  In the model, there are
three possible ways to simulate the mixture density:
     Case 1:
Treat the contaminant as an ideal gas and allow for
condensation of ambient humidity.  This is
accomplished by setting -0.  In DEGADIS,
ground-to-cloud heat transfer can either by included
(-1) or precluded (-0).  The
contaminant heat capacity is determined by  and
 using
                         (T) - (MW )
                                  c
                                    -1
                      3.33 x W  +
                                                            T - T,
                                                                    (A.I)

                   where  is denoted by qi and  is denoted by
                   PI.  If a constant heat capacity is desired, set
                    to 0. and  to the desired heat capacity
                   (in JAg K).
     Case 2:       Treat the contaminant as an ideal gas and do not
                   allow for condensation of ambient humidity.  In this
                   case, ground-to-cloud heat transfer  in DEGADIS is  not
                   allowed, and  (p  - pa)/c is assumed constant.  This is
                   accomplished  by  setting --1.   Values  input for
                   , ,  and  are  ignored.

     Case 3:       Estimate the  contaminant/air mixture density as a
                   function of contaminant concentration based on a
                   user-supplied estimate.  Ordered  triples of the
                   contaminant mole fraction, the contaminant
                   concentration (kg/m^) , and the contaminant/air
                   mixture density  (kg/m^) are input to the model.  This
                   is  accomplished  by setting  equal to  the number
                   of  triples.   In  the  input file, the  ordered triples
                    (starting with pure  air) are  input on  the next NDEN
                   lines  immediately following the line for .
                   Values  input  for , ,  , and 
                   are ignored.

     The user must choose  to  simulate the release as time-limited
 (transient)  or steady- state  (by  the specification of ) ,  and  the
 jet elevation and diameter must  be  specified.

     Figure  A. 3 summarizes the structure of the  input file RUN_NAME.IN
 required by  JETPLU_IN.  The  description following is written  for each of
 the variables in Figure A. 3.  After each line of input, an explanation
 is included.   All units are  SI  (meters, kilograms, second) except  as
 specified.

-------
                                  A-7
                             
                             
                             
                             
                                
                             
                               
                               
                             
                             
                             
                             
                             
                               
                               
                             
                             
                              
                             
                             
             Figure A.3.
RUN_NAME.IN Structure Required by
JETPLU IN




          , , , and  are four lines of
              up to 80 characters each of a title for this simulation.
 

           (m/s) is the ambient wind velocity at  (m).
           is the surface roughness (m).
  
           is an indicator which determines the method of
              calculation for the ambient velocity profile in the
              jet/plume model as follows:

            For -1, the Pasquill-Gifford stability category  (in
               using 1 for A, 2 for B, etc.) is used along with

-------
                                  A-8
               to determine the Monin-Obukhov length ; the log
              velocity profile is then determined using .

            For -2, the Monin-Obukhov length  is supplied
              by the user; the log velocity profile is then determined
              using .  Note that  must still be specified.

  
          , , and  are the ambient temperature  (K),
              the ambient pressure (atm or N/m2), and the relative
              humidity (%), respectively.


           is the surface temperature (K); if  < 250  K,
               is set to .


           is a three-letter designation for the contaminant
              name.  Any character string of three letters or  less  is
              valid; this  is for user run identification and does not
              access property data.


           is the contaminant molecular weight  (kg/kmole).


           is the  averaging time (s).  This parameter  is used  to
              estimate the value of .


           is the  temperature of the released  contaminant  (K).

  
           and  are  the concentrations to be used  for
              estimating contours  for an upper and lower concentration
              level  in DECADIS.  The calculations are  made for the
              elevation .  Note that the JETPLU/DEGADIS
              computations will be carried out to /2.

  
           is used to  include heat transfer in  the DEGADIS
              computations.  Heat  transfer is not included for
              -0.   For -1, heat transfer is included, and
              the heat transfer  coefficient  is calculated by  DEGADIS.
                and  are  used  to calculate the heat  capacity  as
              a function  of  temperature according to  the correlation
              included in DEGADIS.  If  a constant heat capacity  is
              desired, set  to 0.  and   to the desired  heat
              capacity  (J/kg  K).

-------


                                  A-9
           is used to specify the contaminant density profile.
              There are three cases for :

             - -1; The simulation treats the contaminant as if it
              were an ideal gas with a molal heat capacity equal to that
              of air.  Water condensation effects are ignored
              (equivalent to an ^isothermal" release in DEGADIS).

             - 0; The simulation treats the contaminant as if it
              were an ideal gas with the heat capacity indicated by
               and .  Water condensation effects are taken
              into account as appropriate (equivalent to a nonisothermal
              release in DEGADIS).

             > 0;  specifies the number of triples which
              follow in the next  lines.  The triples are used to
              specify the contaminant concentration as a function of
              density based on adiabatic mixing with ambient air.  The
              ordered triples represent (in order):
                (1) the contaminant mole fraction
                (2) the contaminant concentration  (kg contam/m^ mix)
                (3) the mixture density (kg mixture/m^ mixture).
              The ordered triples must go from pure air to pure
              contaminant (equivalent to an "isothermal" release in
              DEGADIS).
            is  the mass  evolution  (release) rate  (kg/s).
 
           is  the  initial jet  elevation  (m),  and  is  the
               initial  jet  diameter  (m).
 
 
             is  the  duration of  the primary  release  (s).   For
               steady-state  releases,  set   to  0.; to  run the
               jet/plume  model  only,  set  to a negative  number.
            is  the maximum distance between output  points  in the
               JETPLU output  (m).
 DEGBRIDGE  takes  the  output  from the jet/plume model  and creates  the  file
 necessary  for  DEGADIS  to  complete  the  simulation.

 Input  Module--DEGADISIN
      DEGADISIN  is  the  optional  interactive  input module which  defines  a
 DEGADIS  simulation;  DEGADISIN is  composed of  two subroutines  (Figure
 A.4):

-------
     (*)
                                  A-10
DEGADISIN contains the program overhead and generates the
          command file RUN_NAME.COM which can be used to
          control simulation execution (D-38).
     (*)  IOT
          contains the interactive question-and-answer
          sequence which defines the simulation; IOT also
          creates the file RUN_NAME.INP (D-76).
An example of a DEGADISIN query sequence is included in Appendix B.  As
this information is gathered, it is written to the file RUN_NAME.INP
(Figure A.5).  Once DEGADISIN is completed, RUN_NAME.INP may be edited
to correct minor input mistakes.  If major revisions are necessary, the
recommended practice is to execute DEGADISIN again.

     Once the information required by DEGADISIN has been entered
properly, DEGADIS may be executed using the command procedure generated
by DEGADISIN under the file name RUN_NAME.COM.  If DEGADIS is not to be
run using this command file, the user must enter the simulation name
(RUN_NAME) after each of the programs are begun.  (In this case, the
user must also provide copies of the numerical parameter files.)
                   DEGADISIN

                        D-38
                                    IOT
                                       D-76
                   Figure A.4.   DEGADISIN Flowchart.

-------
                                 A-ll
If 
-------
DEGADIS1
      D-13
  AFGEN
      D-3
  GAMMA - -
      D-59
 RIPHIF
     D-110
  RKGST
     D-114
 SURFACE
      D-180
  TPROP
     D-185
 TRAP
     D-207
AFGEN2
      D-4
ZBRENT
     D-224
                           A-12
       10
          D-74
     ESTRT1
          D-50
      ALPH
           D-5
       SZF
          D-182
       SRC1
          D-139
       NOBL
           D-94
       CRFG
           D-8
      HEAD
          D-64
      TRANS1
         D-199
PSIF
  D-100
Figure A.6.  DEGADIS1 Flowchart.
 LIMIT
      D-93

-------
                                  A-13
(*)  AFGEN2


(*)  ALPH




(*)  CRFG



(*)  DEGADIS1
(*) ESTRT1


(*) GAMMA


(*) HEAD


(*) 10


(*) LIMIT

(*) NOBL


(*) PSIF


(*) RIPHIF


(*) RKGST



(*) SCR1
linearly interpolates between a pair of points based
on a list of supplied values (D-4) .

estimates the ambient wind profile power a by
minimizing the integral of the difference between an
ambient logarithmic velocity profile and the assumed
power law velocity profile (D-5) .

creates a table of calculated values which will
describe the secondary gas source for the downwind
dispersion calculations (D-8).

contains the program overhead and sequentially calls
the routines required to estimate the ambient wind
profile power a and to characterize the primary gas
source (D-14) .

recovers the numerical parameters contained in the
file RUN_NAME.ER1  (D-50).

calculates the gamma function of the argument  (I.e.
F(x))  (D-59).

writes a formatted output heading to the file
RUN_NAME.SCL (D-64).

recovers the simulation definition contained in
RUN_NAME.INP (D-74).

establishes the limit for ZBRENT  (D-93) .

estimates gas source behavior when no gas blanket  is
present  (D-94) .

calculates the ^ function in  the logarithmic velocity
profile  (D-100).

calculates the Richardson number and the values of
       and J(Ri*)  (D-110).
 performs numerical  integration  of  a  specified system
 of equations using  a variable- step,  modified  fourth-
 order Runge-Kutta method  (D-114) .

 contains the ordinary differential equations  which
 describe the gas blanket  formed as a result of the
 primary gas source  (D-139) .

-------
                                  A-14
(*)  SURFACE        estimates heat and water transfer rates across the
                   bottom surface of the gas layer (D-180).

(*)  SZF            estimates the value of Sz if the primary source can
                   just form a gas blanket over the source (D-182).

(*)  TPROP          is a series of utility routines which estimate the
                   thermodynamic properties of a given gas mixture
                   (D-185).

(*)  TRANS1         writes the information to continue the next
                   simulation step to the file RUN_NAME.TR2 (D-199).

(*)  TRAP           is a utility included for program diagnostics
                   (D-207).

(*)  ZBRENT         finds the bracketed root of an equation using Brent's
                   method  (D-224).
As input, DEGADIS1 requires two files:

(*) RUN_NAME.ER1   contains various numerical parameters.  For most
                   simulations, a copy of the SYS$DEGADIS:EXAMPLE.ER1
                   file will be adequate.  A copy of
                   SYS$DEGADIS:EXAMPLE.ER1 is included in Figure A.7.

(*) RUN_NAME.INP   contains the simulation definition as discussed in
                   Appendix B  (Figure A.5).
As output, DEGADIS1  generates  the  following  files:

(*) RUN_NAME.SCD   contains  the  calculated values which  describe  the
                   secondary gas source.  It is  generated by SRC1 and
                   NOBL and  is then  read by  CRFG; it  is  a temporary
                   file.

(*) RUN_NAME.SCL   is  the  listed output which describes  the  input
                   information for the simulation and the calculated
                   secondary gas source.  It is  written  by HEAD and
                   CRFG.

(*) RUN_NAME.TR2   contains  the  information  to continue  the  next
                   simulation  step.

-------
                                  A-15
!This is an example of how to set up and use the run parameter
  input files.   Comment lines start with an exclamation mark(!)
  in the first column.   The only restrictions for data input are
  as follows:
        1) The data must be entered in the same order
           all of the time.
        2) Only the number must be between columns 10 and 20.
        3) Always include the decimal point in the number
  Column layout:
!23456789012345678901234567890
!	1	2	3
!         I         I
STPIN
ERBND
STPMX
WTRG
WTTM
WTYA
WTYC
WTEB
WTmB
WTuh
XLI
XRI
EPS
ZLOW
0.01
0.0025
5.12
1.
1.
1.
1.
1.
1.
1.
0.05
0.50
0.001
0.01
MAIN -
MAIN -
MAIN -
MAIN -
MAIN -
MAIN -
MAIN -
MAIN -
MAIN -
MAIN -
ALPH -
ALPH -
ALPH -
ALPHI
RKGST
RKGST
RKGST
RKGST
RKGST
RKGST
RKGST
RKGST
RKGST
RKGST
LOWER
UPPER
ERROR
- maxii
      - INITIAL STEP SIZE
      - ERROR BOUND
      - MAXIMUM STEP SIZE
      - WEIGHT FOR RG
      - WEIGHT FOR Total Mass
      - WEIGHT FOR ya
      - WEIGHT FOR yc
      - WEIGHT FOR Energy Balance
      - WEIGHT FOR Momentum Balance
      - WEIGHT FOR Ueff*Heff
      LIMIT OF SEARCH FOR ALPHA
UPPER LIMIT OF SEARCH FOR ALPHA
        UNO USED BY "RTMI"
 maximum BOTTOM HEIGHT FOR FIT OF ALPHA
STPINZ
ERBNDZ
i
STPMXZ
-0.02
0.005

-2.00
                     ALPHI - INITIAL RKGST STEP <0.

                     ALPHI - ERROR BOUND FOR RKGST

                     ALPHI - MAXIMUM STEP FOR RKGST <0.

!  Note that comment lines can be mixed with the numbers.

SRCOER     0.007     SRC10 - OUTPUT Error criterion
SRCSS       5.2      SRC10 - min time for Steady; STPMX
SRCcut     .00001    SRC10 - min height for blanket
htcut      .0        SRC1 - min height for blanket heat transfer
ERNOBL     1.0005    NOBL - CONVERGENCE ratio
NOBLPT     100.      NOBL - NUMBER OF POINTS
!                       USED ON THE LAST PORTION OF THE SOURCE
i
crfger     0.008     error criterion in building GEN3 vectors
     Figure A.7.  SYS$DEGADIS:EXAMPLE.ER1 Listing.

-------
                                  A-16
epsilon    0.59
  /SPRD_CON/
t
ce
delrhomin
!
i
! /SZFC/
i
szstpO
szerr
szstpmx
szszO
           1.15
           0.0
           0.01
           0.001
           5.0
           0.01
                    epsilon USED IN AIR ENTRAINMENT  SPECIFICATION
constant in gravity slumping equation
stop cloud spread if delrho
-------
                                  A-17
Pseudosteadv-State Module--DEGADIS2

     DEGADIS2 performs the downwind dispersion portion of the
calculation for each of several observers released successively over the
transient source described by DEGADIS1.  (Note that the routines
INCGAMMA, GAMMA, and SERIES are linked in DEGADIS2 but never are called
in DEGADIS2.)  DECADIS2 is composed of the following subroutines (Figure
A.8):
(*) AFGEN


(*) AFGEN2


(*) DEGADIS2
 (*) ESTRT2



 (*) LIMIT

 (*) OB


 (*) PSS



 (*) PSSOUT


 (*) RIPHIF


 (*) RKGST



 (*) SSG



 (*) SSGOUT
linearly interpolates between a pair of points based
on a list of supplied values (D-3).

linearly interpolates between a pair of points based
on a list of supplied values (D-4).

contains the program overhead and sequentially calls
the routines to recover the information generated in
DEGADIS1, recover the numerical parameter file
RUN_NAME.ER2,  and perform the simulation (D-23).

recovers the numerical parameters contained in the
file RUN_NAME.ER2,  particularly the number of
observers NOBS (D-54).

establishes the limit for ZBRENT  (D-93).

contains the ordinary differential equations which
average  the gas source for each observer (D-97).

contains the ordinary differential equations which
describe the portion of the downwind dispersion
calculation when b > 0 (D-100).

governs  the output of calculated points to the file
RUN_NAME.PSD when PSS is active (D-104).

is a series of utilities which calculates the
Richardson number and the value of ^(Ri) (D-110).

performs numerical integration of a specified system
of equations using a modified fourth-order Runge-
Kutta method (D-114).

contains the ordinary differential equations which
describe the portion of the downwind dispersion
calculation when b - 0 (D-152).

governs  the output of calculated points to the file
RUN_NAME.PSD when SSG is active (D-155) .

-------
DEGADIS2
      D-22
  AFGEN
       D-3
 AFGEN2
       D-4
  RIPHIF
     D-110
   RKGST
      D-114
  SURFACE
      D-180
   TPROP
      D-185
   TRAP
      D-207
    TS
      D-216
    UIT
      D-222
         A-18

        STRT2
            D-172
       ESTRT2
             D-54
        SSSUP
            D-163
                                   TUPF
                                      D-217
                                    OB
                                        D-97
                                    PSS
                                       D-101
                                    SSG
                                       D-152
        TRANS2
            D-202
ZBRENT
   D-224
LIMIT
   D-93
                                   PSSOUT
                                        D-104
                                    SSGOUT
                                        D-155
                    Figure A.8.   BEGADIS2 Flowchart.

-------
                                  A-19
(*)  SSSUP
(*)  STRT2


(*)  SURFACE


(*)  TPROP



(*)  TRANS2


(*)  TRAP


(*)  TS


(*)  TUPF



(*)  UIT


(*)  ZBRENT
is a supervisor routine which controls the averaging
of the source for each observer, the portion of the
downwind dispersion calculation when b > 0, and the
portion of the downwind dispersion calculation when
b - 0 (D-163).

recovers the information generated in DEGADIS1
contained in the file RUN_NAME.TR2 (D-172).

estimates heat and water transfer rates across the
bottom surface of the gas layer (D-180).

is a series of utility routines which estimates the
thermodynamic properties of a given gas mixture
(D-185).

writes the information necessary for DEGADIS3 to the
file (RUN_NAME.TR3) (D-202).

is a utility included for program diagnostics
(D-207).

calculates the time when a given observer will be at
a given downwind distance (D-216).

contains the routines which determine the
intersection of the upwind/downwind edge of the
secondary gas source with a given observer (D-217).

is a series of routines to calculate observer
position and velocity as a function of time (D-222).

finds the bracketed root of an equation using Brent's
method  (D-224).
     As input, DEGADIS2 requires two files:
(*) RUN NAME.ER2
 (*) RUN NAME.TR2
 contains  the various numerical parameters,
 particularly the  number  of  observers  NOBS.   For most
 simulations, a  copy of the  SYS$DEGADIS:EXAMPLE.ER2
 file will be adequate.   A copy of
 SYS$DEGADIS:EXAMPLE.ER2  is  included in  Figure  A. 9.

 contains  the basic simulation definition as  well as
 calculated  secondary source parameters.
     DEGADIS2 generates the following output files:
 (*) RUN_NAME.OBS   contains a summary of the source parameters for each
                   observer.

-------
                                  A-20
!  This is an example for an "ER2" run parameter file.
!  The same rules apply as for the "ERl" files.

 23456789012345678901234567890
 	1	2	3
  These values are in common area /ERROR/
SYOER
ERRO
SZOER
WTAIO
WTQOO
WTSZO
ERRP
SMXP
WTSZP
WTSYP
WTBEP
WTDH
ERRG
SMXG
ERTDNF
ERTUPF
WTRUH
WTDHG
!  These values are in common area /STP/
i
STPO        0.05
STPP        0.05
ODLP        0.06
ODLLP       80.
OUTPUTS(m)
STPG        0.05
ODLG        0.045
ODLLG       80.
OUTPUTS(m)
0.0
0.005
0.01
1.0
1.0
1.0
0.003
10.
1.0
1.0
1.0
1.0
0.003
10.
0.0005
0.0005
1.0
1.0
SSSUP
SSSUP
SSSUP
SSSUP
SSSUP
SSSUP
SSSUP
SSSUP
SSSUP
SSSUP
SSSUP
SSSUP
SSSUP
SSSUP
TDNF -
TUPF -
SSSUP
SSSUP
- RKGST - INITIAL SY
- RKGST (OBS)
- RKGST (OBS)
- RKGST (OBS)
- RKGST (OBS)
- RKGST (OBS)
- RKGST(PSS)
- RKGST (PSS)
- RKGST(PSS)
- RKGST (PSS)
- RKGST(PSS)
- RKGST(PSS)
- RKGST (SSG)
- RKGST(SSG)
CONVERGENCE
CONVERGENCE
- RKGST(SSG)
- RKGST(SSG)
- ERROR BOUND
- INITIAL SZ
- WEIGHT FOR AI
- WEIGHT FOR Q
- WEIGHT FOR SZ
- ERROR BOUND
- MAXIMUM STEP
- WEIGHT FOR SZ
- WEIGHT FOR SY
- WEIGHT FOR BEFF
- WEIGHT FOR DH
- ERROR BOUND
- MAXIMUM STEP SIZE
CRITERION
CRITERION
- WEIGHT FOR RUH
- WEIGHT FOR DH
                     SSSUP - RKGST(OBS)
                     SSSUP - RKGST(PSS)
                     SSSUP - RKGST(PSS)
INITIAL STEP
INITIAL STEP
RELATIVE OUTPUT DELTA
                     SSSUP-RKGST(PSS)-MAXIMUM DISTANCE BETWEEN

                     SSSUP  - RKGST(SSG) - INITIAL STEP
                     SSSUP  - RKGST(SSG) - RELATIVE OUTPUT DELTA
                     SSSUP-RKGST(SSG)-MAXIMUM DISTANCE BETWEEN
  The  last variable NOBS  is  in /CNOBS/

  Note:  it is  read in as  a real value even  though  it  is  integer  type
       in the program.
 NOBS
            30.
   End-of-File
      Figure A.9.   SYS$DEGADIS:EXAMPLE.ER2 Listing.

-------
                                  A-21
(*) RUN_NAME.PSD
(*) RUN_NAME.TR3
contains the calculated downwind dispersion
parameters for each observer.  DEGADIS3 and DEGADIS4
sort this information to determine the downwind
concentration profiles as a function of position and
time.

contains the simulation definition and the number of
each record type written to RUN_NAME.PSD.
Time Sort Modules--DEGADIS3 and DEGADIS4

     DEGADIS3 sorts the downwind dispersion calculation for each of
several observers for concentration information at several given times;
the along-wind dispersion correction is then applied as desired.
DEGADIS3 uses the following subroutines (Figure A.10).
(*) DEGADIS3
 (*) ESTRT3



 (*) GAMMA


 (*) GETTIM


 (*) INCGAMMA


 (*) LIMIT

 (*) SERIES


 (*) SORTS



 (*) SORTS1


 (*) SRTOUT


 (*) STRT3
contains the program overhead and  sequentially  calls
the routines to recover the  information  generated in
DEGADIS2, recover the numerical parameter  file
RUN_NAME.ER3, sort and apply the along-wind
dispersion correction to  the results  of  DEGADIS2,  and
output  the results (D-28).

recovers the numerical parameters  contained in  the
file RUN_NAME.ER3, particularly the time sort
parameters  (D-58).

calculates  the gamma function of the  argument (i.e.
T(x)) D-59).

sets the default  time sort parameters as needed   (D-
61).

calculates  the incomplete gamma function of the two
arguments  (D-70).

•establishes  the limit for ZBRENT  (D-93).

evaluates a  series needed to estimate the  mass  of gas
above a given concentration  level  (D-130).

recovers the information  in  RUN_NAME.PSD and arranges
the information according to the time sort parameters
in the  file  RUN_NAME.ER3  (D-131).

applies the  along-wind dispersion  correction to the
time-sorted  information (D-134).

generates the formatted output file RUN_NAME.SR3
(D-148).

recovers the information  generated in DEGADIS2
contained in the  file RUN_NAME.TR3 (D-178).

-------
                  A-22
DEGADIS3
D-27

TPROP
D-185

TRAP
D-201

TS
D-216

INCGAMMA
D-70

GAMMA
D-59

SERIES
D-130

ZBRENT
D-224









STRT3
D-178

ESTRT3
D-58



SORTS
D-131






GETTIM
D-61

SORTS 1
D-13A

SRTOUT
D-148

TRANS 3
D-206




LIMIT
    D-93
Figure A.10.  DEGADIS3 Flowchart.

-------
                                  A-23
(*)  TPROP          is a series of utility routines which estimate the
                   thermodynamic properties of a given gas mixture
                   (D-894).

(*)  TRANS3         writes RUN_NAME.TR4 which contains the necessary
                   information to recover the other output files for
                   this simulation (D-206).

(*)  TRAP           is a utility included for program diagnostics
                   (D-207).

(*)  TS             calculates the time when a given observer will be at
                   a given downwind distance (D-216).

(*)  ZBRENT         finds the bracketed root of an equation using Brent's
                   method (D-224).
     As input, DECADIS3 requires three files:

(*) RUN_NAME.ER3   contains various numerical parameters including the
                   time sort parameters and the flag which dictates
                   whether the along-wind dispersion correction is
                   applied.  A copy of SYS$DEGADIS:EXAMPLE.ER3 file uses
                   the default time sort parameters and includes the
                   along-wind dispersion correction which should apply
                   for most simulations.  A copy of
                   SYS$DEGADIS:EXAMPLE.ER3 is included in Figure A.11.

(*) RUN_NAME.PSD   contains the calculated downwind dispersion
                   parameters for each observer.  DEGADIS3 sorts this
                   information to determine the downwind concentration
                   profiles as a function of position at a given time.

(*) RUN_NAME.TR3   contains the number of each record type written to
                   RUN NAME.PSD as well as the simulation definition.
     As output, DEGADIS3 generates two new files:

 (*) RUN_NAME.SR3   is the formatted output list of the time-sorted
                   concentration parameters.  Concentration contours  are
                   generated for the specified upper and lower levels  of
                   concern at the specified height entered in DEGADISIN
                   or JETPLU_IN.

 (*) RUN_NAME.TR4   contains the necessary information to recover  the
                   other output files to facilitate further processing.

-------
                                  A-24
!  This is an example for an "ER3" run parameter file.
!  The same rules apply as for the "ER1" files.
!
! 23456789012345678901234567890
! ........ 1 ......... 2 ......... 3
i
!  These values are in common area /ERROR/
j
ERT1       20.       FIRST SORT TIME
ERDT       5.        SORT TIME DELTA
ERNTIM     20.       NUMBER OF TIMES FOR THE SORT
!
!     Note: ERNTIM is entered as a real variable even though
!            it is an integer type variable in the program.
!
!   The value of CHECKS determines whether the above sort parameters
!      are used.  CHECKS is initialized through the passed transfer
!      files to .FALSE.  CHECKS is set to .TRUE, if a real value of 1.
!      is passed in this file.
i
CHECKS       0.       USE THE DEFAULT TIME PARAMETERS
! CHECKS      1.       USE THE TIME PARAMETERS GIVEN ABOVE
sigx_flag    1.       correction for x-direction dispersion is to be made
!sigx_flag    0.       no correction for x-direction dispersion
 ! End-of-File
     Figure A.11.  SYS$DEGADIS:EXAMPLE.ER3 Listing.

-------
                                  A-25
     DEAGDIS4 sorts the downwind dispersion calculation for each of
several observers for concentration information at several given
positions; the along-wind dispersion correction is then applied as
desired.  DEGADIS4 uses the following subroutines (Figure A.12):
(*) DEGADIS4
(*) DOSOUT


(*) ESTRT3




(*) GAMMA


(*) GETTIMDOS



(*) INCGAMMA


(*) LIMIT

(*) SERIES


(*) SORTS



(*) SORTS1


(*) STRT3


(*) TPROP



(*) TRANS3
contains the program overhead and sequentially calls
the routines to recover the information generated in
DEGADIS2, recover the numerical parameter file
RUN_NAME.ER3,  sort and apply the along-wind
dispersion correction to the results of DEGADIS2, and
output the results (D-33).

generates the formatted output file RUN_NAME.SR4
(D-45).

recovers the numerical parameters contained in the
file RUN_NAME.ER3, particularly whether the
x-direction dispersion correction is to be applied
(D-58).

calculates the gamma function of the argument (i.e.
T(x))  (D-59).

sets the time sort parameters as required to output
the concentration time history at the desired
positions (D-63).

calculates the incomplete gamma function of the two
arguments (D-70).

establishes the limit for ZBRENT (D-93).

evaluates a series needed to estimate the mass of gas
above  a given concentration level (D-130).

recovers the information  in RUN_NAME.PSD and arranges
the information according to the time sort parameters
(D-134).

applies the x-direction dispersion  correction to the
time-sorted information (D-131)

recovers the information  generated  in DEGADIS2
contained in the  file RUN_NAME.TR3  (D-178).

is a series of routines which estimate  the
thennodynamic properties  of a given gas mixture
(D-185).

writes RUN_NAME.TR4 which contains  the necessary
information to recover the other output files for
this simulation  (D-206).

-------
                    A-26-
DEGADIS4
      D-33
  TPROP
      D-185
  TRAP
      D-207
    TS
      D-216
INCGAMMA
      D-70
  GAMMA
      D-59
 SERIES
     D-130
 ZBRENT
     D-224
  LIMIT
      D-93
        STRT3
            D-178
       ESTRT3
            D-58
        SORTS
            D-131
                                       GETTIMDOS
                                            D-63
                                       SORTS1
                                            D-134
                          DOSOUT
                               D-45
                          TRANS3
                               D-206
Figure A.12.  DEGADISA Flowchart

-------
                                  A-27
(*) TRAP


(*) TS


(*) ZBRENT
is a utility included for program diagnostics
(D-207).

calculates the time when a given observer will be at
a given downwind distance (D-216).

finds the bracketed root of an equation using Brent's
method (D-224).
     As input, DEGADIS4 requires three files and input from the
terminal:
(*) RUN_NAME.ER3
(*) RUN NAME.PSD
(*) RUN NAME.TR3
(*) terminal
    input
contains the flag which dictates whether the x-
direction dispersion correction is applied.  A copy
of SYS$DEGADIS:EXAMPLE.ER3 file includes the x-
direction dispersion correction which should apply
for most simulations.

contains the calculated downwind dispersion
parameters for each observer.  DEGADIS4 sorts this
information to determine the downwind concentration
time histories at the desired positions.
  9
contains the number of each record type written  to
RUN_NAME.PSD as well as the simulation definition.

DEGADIS4 prompts the user for the file name to be
used for this run.  In addition, DEGADIS4 requests
the number of downwind distances (JDOS).  For each
downwind distance, DEGADIS4 asks for the x-position
(DOSDISX(I)).  Four positions are allowed for each
downwind distance (DOSDISY(IJ,I)) and DOSDISZ(IJ.I)
for IJ-1 to 4).  If fewer than four positions are
desired, negative or zero values are entered for the
first position which is not desired.  A summary  of
this input information is included in Figure A.13.
Note that the same information can be put in a
command file for batch processing.  The same
information can be put in a file which can be
associated with FOR005.DAT so that a file can be used
for input.
           FOR 1-1  to JDOS
               RUN_NAME
               JDOS
               DOSDISX(I)
               DOSDISY(1,I),DOSDISZ(1,I)
               DOSDISY(2,I),DOSDISZ(2,I)
               DOSDISY(3,I),DOSDISZ(3,I)
               DOSDISY(4,I),DOSDISZ(4,I)
            Figure A.13.  Structure of Input for DEGADIS4.

-------
                                  A-28
     As output, DEGADIS4 generates two new files:

(*) RUN_NAME.SR4
(*) RUN_NAME.TR4
is the formatted output list of the sorted
concentration time histories.

contains the necessary information to recover the
other output files to facilitate further processing.
Steady-State Module--SDEGADIS2

     SDEGADIS2 is a simplification of DEGADIS2 which uses many of the
same subroutines.  SDEGADIS2 performs the downwind dispersion portion of
the calculation for a steady-state source described by DEGADIS1,
SDEGADIS2 is composed of the following subroutines (Figure A.14):
(*) AFGEN


(*) GAMMA


(*) ESTRT2SS
            *

(*) INCGAMMA


(*) LIMIT

(*) PSS





(*) PSSOUTSS


(*) RIPHIF


(*) RKGST




 (*) SDEGADIS2
linearly interpolates between a pair of points based
on a list of supplied values (D-3).

calculates the gamma function of the argument (i.e.
T(x)) (D-59).

recovers a subset of the numerical parameters
contained in the file RUN_NAME.ER2 (D-56) .

calculates the incomplete gamma function  of the two
arguments (D-70).

establishes the limit for ZBRENT (D-93) .

is the same subroutine used in DEGADIS2 ;  it contains
the ordinary differential equations which describe
the downwind dispersion calculation when  b > 0
(D-100).

governs  the output  of calculated points to the  file
RUN_NAME.SR3 when PSS is active (D-107).

calculates the Richardson number and  the  value  of
       (D-108).
 (*)  SERIES
 performs  numerical  integration of a specified system
 of equations  using  a modified fourth-order Runge-
 Kutta methods (D-114).

 contains  the  program overhead and sequentially calls
 the routines  to recover the information generated in
 DEGADIS1,  recover the  numerical parameters file
 RUN_NAME . ER2 , and perform the steady-state simulation
 (D-122).

 evaluates a series  needed to estimate the mass of gas
 above a given concentration level (D-130).

-------
SDEGADIS2
     D-122
  AFGEN
     D-3
 RIPHIF
      D-110
  RKGST
      D-114
 SURFACE
      D-180
   TPROP
      D-185
   TRAP
      D-207
   SSOUT
      D-161
  GAMMA
     D-59
INCGAMMA
     D-70
 SERIES
     D-130
         A-29

        STRT2SS
            D-175
       ESTRT2SS
            D-56
          PSS
             D-101
          SSG
            D-152
        TRANS2SS
            D-204
ZBRENT
   D-224
LIMIT
    D-93
PSSOUTSS
     D-107
 SSCOUTSS
     D-158
     Figure A.14.   SDEGADIS2 Flowchart.

-------
                                  A-30
(*)  SSG
(*) SSGOUTSS


(*) SSOUT


(*) STRT2SS


(*) SURFACE


(*) TPROP



(*) TRANS2SS

(*) TRAP


(*) ZBRENT
is the same subroutine used in DEGADIS2; it contains
the ordinary differential equations which describe
the downwind dispersion calculation when b - 0
(D-152).

governs the output of calculated points to the file
RUN_NAME.SR3 when SSG is active (D-158).

writes RUN_NAME.SR3 and calculates the concentration
contours (D-161).

recovers a subset of the information generated in
DEAGDIS1 contained in the file RUN_NAME.TR2 (D-175).

estimates heat and water transfer rates across the
bottom surface of the gas layer (D-180).

is a series of routines which estimate the
thermodynamic properties of a given gas mixture
(D-185).

writes RUN_NAME.TR3 (D-204).

is a utility included for program diagnostics
(D-207).

finds the bracketed root of an equation using Brent's
method  (D-224).
     As input, SDEAGDIS2 requires two files:
(*) RUN_NAME.ER2
(*) RUN NAME.TR2
contains various numerical parameters, the steady-
state simulation typically requires only a copy of
SYS$DEGADIS:EXAMPLE.ER2.

contains the basic simulation definition as well  as
calculated  secondary source parameters; the steady-
state simulation requires only part of these.
     As output, SDEAGDIS2 generates the following files:

 (*) RUN_NAME.SR3    is  the formatted output  list of  the  downwind
                    concentration parameters.  Concentration  contours  are
                    generated  for the  specified upper and  lower levels of
                    concern  at the  specified height  entered in DEAGDISIN.

 (*) RUN_NAME.TR3    contains the necessary  information  to  recover the
                    other output files to facilitate further  processing.

-------
                                    B-l
                              APPENDIX B

                    EXAMPLE MODEL INPUT AND OUTPUT
Bhopal. India. MIC Release

     The example conditions shown in Table B.I for the accidental
release of methylisocyanate (MIC) on December 3, 1984, in Bhopal, India,
were reported by Singh (1986).  MIC was assumed released as a pure,
ambient temperature gas at a steady rate of 6.72 kg/s.
                   Figure B.I.  MIC Example Simula-
                                tion Release
                                Conditions
                   Mass of MIC released     40 tons
                   Duration of release      90 min
                   Vent elevation           33 m
                   Vent diameter            0.2 m
                   Wind velocity at 10 m    1.9 m/s
                   Atmospheric stability    E/F
     The input file for a steady-state release is shown in Figure B.I.
A surface roughness of 0.1 m and an averaging time of 3600 s have been
specified.  For the lowest concentration of interest, the lethal
concentrations to 50% of laboratory animals exposed to MIC (LCso) for
one and two hours are about 30 and 20 ppm, respectively.  The
concentrations of 30 ppm (GASUL-0.00003 mole fraction) and 20 ppm
(GASLL-0.00002 mole fraction) are used to determine concentration
contours in DEGADIS.  The steady-state condition is indicated by TEND-0.

     A batch command file is shown in Figure B.2 for the simulation
called EX1.  (The logical symbol SYS$DEGADIS: is assigned to the
directory which contains the executable image of the model.)  The output
of the model is in the file with the original name and extension LIS for
(for this example, EX1.LIS).  To run the model interactively, the lines
shown in Figure B.2 can be entered at a terminal.

     The program JETPLU_IN reads the input file and generates the input
file to the JETPLU program; when JETPLU_IN finishes, JETPLU_IN writes
the line "JETPLU_IN - beginning command file".  At this point, the
JETPLU program begins; several lines of output are generated showing the
values of various parameters calculated by the program.  When JETPLU
finishes, DEGBRIDGE begins; DEGBRIDGE takes the output of JETPLU and

-------
                                    B-2
Methylisocyanate (MIC) release simulation
2.9  10.
0.1
160
298.  1.
298.
MIC
57.
3600.
298.
0.00003
0  2000.
-1
6.72
33. 0.2
0.0
100.
50.
0.00002
0.
0.5
UO, ZO
ZR
INDVEL, ISTAB, RML
TAMB, PAMB, RELHUM
TSURF
GASNAM
GASMW
AVTIME - based on 1 hr toxic levels
JETTEM
GASUL, GASLL, ZLL
INDHT,  CPK, CPP
NDEN
ERATE
ELEJET, DIAJET
TEND
DISTMX
This  is  the end  of  the  file.  Any comments can be  included here  since  the
file  is  not read after  the  line  for DISTMX above.
                    Figure B.I.  Listing of EX1.IN.
                      $ RUN  SYS$DEGADIS:JETPLU_IN
                      EX1
               Figure  B.2.
                 Example Command File Used to
                 Simulate the EX1 Simulation.

-------
                                    B-3


generates the necessary input file for DEGADIS.   When DEGBRIDGE
finishes, the standard DEGADIS procedure begins  by copying the ER1 and
ER2 parameter files.   DEGADIS generates several  lines of output showing
the values of various numerical parameters calculated by the model.
Last, the model generates the LIS file from the  output files of JETPLU
and DEGADIS (Figure B.3).

     In the JETPLU model output, columns 3-5 correspond to plume
centerline position.   For the specified height,  columns 9 through 11
correspond to the maximum concentration and horizontal distances to the
specified mole fractions, respectively.  For the MIC example case, the
JETPLU calculations are continued until the centerline mole fraction
drops below 5 ppm (GASLL/4).   The model predicts the maximum extent of
the 30 and 20 ppm concentration levels to be 2500 and 4200 m,
respectively.

-------
                                                              B-A
                                                      JETPLU/DEGADIS v2.1
 6-SZP-1989 14:40:54.50

Mathylisocyanate  (MIC) release simulation
Ambient Meteorological Conditions...

Ambient windspeed  at  reference height:    2.9000    m/s
                     Reference height:    10.000    m
                   Surface roughness:   0.10000    m

              Pasquill stability class:             F

                Monin-Obukhov length:    17.524    m
                   Friction velocity:   0.13910    m/s
                  Ambient temperature:    298.00    K
                     Ambient pressure:    1.0000    atm
                     Ambient humidity:   1.00882E-02
                   Relative humidity:    50.000    I

             Specified averaging time:    3600.0    s
                              DELTAy:   9.64473E-02
                               BETAy:   0.90000
                              DELTAz:   1.12200E-02
                               BETAz:    1.4024
                              GAMMAz:  -5.40000E-02
Contaminant Properties...

        Contaminant molecular weight:
                 Initial temperature:
             Upper level of interest:
             Lower level of interest:
              Heat capacity constant:
                 Heat capacity  power:

HDEN flag:  -1

ISOFL flag:   1
 57.000
 298.00
3.00000E-OS
2.00000E-05
 80700.
 1.0000
Release Fropertiea...
                        Release rate:    8.7200
                 Discharge elevation:    33.000
                  Discharge diameter:    0.20000
            kg/s
 Model Parameters...
                               ALTAI:
                               ALFA2:
                              DISTMX:
2.80000E-02
0.37000
 100.00     m
                 Figure B.3.-  LIS  File  from the Output  Files  of JETPLU and  DEGADIS,

-------
           B-5
Downwind
Distance
Cm)
4.122E-03
56.9
110.
178.
257.
327.
417.
517.
617.
717.
817.
917.
1.017E+03
1.117E+03
1.217E+03
1.317E+03
1.417E+03
1.517E+03
1.617E+03
1.717E+03
1.817E+03
1.917E+03
2.017E+03
2.117E+03
2.217E+03
2.317E+03
2.417E+03
2.517E+03
2.617E-I-03
2.717E+03
2.817E+03
2.917E+03
3.017E+03
3 . 117E+03
3.217E+03
3.317E+03
3.417E+03
3.517E+03
3.617E+03
3.717E+03
3 . 817E+03
3.917E+03
4.017E+03
4 . 117E+03
A.217E+03
Elevation
Cm)
34.4
45.8
45.8
45.0
44.1
43.2
42.3
41.3
40.3
39.4
38.6
37.7
36.9
36.2
35.4
34.6
33.9
33.2
32.5
31.8
31.1
30.5
29.8
29.2
28.6
28.0
27.4
26.9
26.3
25.8
25.2
24.7
24.2
23.7
23.2
22.7
22.2
21.7
21.2
20.8
20.3
19.9
19.4
19.0
18.6
Mole Centerline
Fraction Concentration
Ckg/m3)
1.00
8.888E-03
3.728E-03
1.736E-03
9.506E-04
6.391E-04
4.304E-04
3.039E-04
2.289E-04
1.803E-04
1.468E-04
1.225E-0*
1.043E-04
9.023E-05
7.909E-05
7.010E-05
6.275E-05
5.667E-05
5.161E-05
4.736E-05
4.378E-05
4.075E-05
3.818E-OS
3.S99E-OS
3.411E-05
3.250E-05
3.111E-05
2.989E-OS
2.382E-OS
2.788E-05
2.703E-05
2.627E-05
2.557E-05
2.494E-05
2.435E-05
2.380E-05 •
2.328E-05
2.279E-05
2.232E-05
2.188E-05
2.145E-05
2.103E-05
2.063E-05
2.025E-05
1.987E-05
2.33
2.072E-02
8.690E-03
4.047E-03
2.216E-03
1.490E-03
1.003E-03
7.086E-04
5.337E-04
4.205E-04
3.423E-04
2.857E-04
2.432E-04
2.104E-04
1.844E-04
1.634E-04
1.463E-04
1.321E-04
1.203E-04
1.104E-04
1.021E-04
9.500E-05
8.901E-OS
8.391E-05
7.953E-05
7.578E-05
7.252E-05
6.968E-05
6.719E-05
6.499E-OS
S.302E-05
6.124E-05
5.962E-OS
5.814E-05
5.676E-05
5.548E-05
5.427E-05
5.313E-05
5.204E-05
5.100E-05
5.000E-05
4.904E-05
4.810E-05
4.720E-05
4.632E-05
Density

-------
          B-6
4.317E+03
4.417E-HJ3
4.517E+03
4 . 617E+03
4.717E+03
4.817E+03
4 . 917E+03
5.017E+03
5 . 117E+03
5.217E+03
5.317E+03
5.417E+03
5.517E+03
5 . 617E+03
5.717E+03
5 . 817E+03
5.917E+03
6.017E+03
6.117E+03
6.217E+03
6.317E+03
6.417E+03
6.517E+03
6 . 617E-HJ3
6.717E+03
6.817E+03
6 . 917E+03
7.017E+03
7 . 117E+03
7.217E+03
7.317E+03
7.417E+03
7.517E+03
7.617E+03
7.717E+03
7.317E+03
7.917E+03
3.017E-I-03
8 . 117E+03
8.217E+03
8.317E+03
8.417E+03
8.517E+03
8.617E+03
8.717E+03
8.817E-I-03
8.917E+03
9.017E+03
9.117E-HJ3
9.217E+03
9.317E+03
9.417E+03
9.517E-H13
9.617E-MJ3
9.717E-1-03
9.817E-I-03
9.917E-H33
1.002E-MH
1.003E+04
18.2
17.7
17.3
16.9
16.5
16.1
15.7
15.4
15.0
14.6
14.2
13.8
13.5
13.1
12.8
12.4
12.1
11.7
11.4
11.0
10.7
10.4
10.0
9.71
9.38
9.06
8.74
8.43
8.12
7.81
7.50
7.19
6.89
6.59
6.30
6.00
5.71
5.42
5.13
4.84
4.56 '
4.28
4.00
3.72
3.45
3.17
2.90
2.63
2.37
2.10
1.84
1.58
1.32
1.06
0.803
0.549
0.296
4.518E-02
O.OOOE+00
1.950E-05
1.915E-05
1.880E-05
1.846E-05
1.812E-05
1.780E-05
1.748E-05
1.717E-05
1.687E-05
1.657E-05
1.628E-05
1.600E-05
1.572E-05
1.545E-05
1.518E-05
1.492E-05
1.467E-05
1.442E-05
1.418E-05
1.394E-05
1.371E-05
1.348E-05
1.326E-05
1.304E-05
1.283E-05
1.262E-OS
1.242E-05
1.222E-05
1.203E-05
1.184E-05
1.165E-05
1.147E-05
1.129E-OS
1.112E-05
1.095E-05
1.078E-05
1.062E-05
1.046E-05
1.031E-05
1.015E-05
l.OOOE-05
9.3S9E-06
9.716E-06
9.577E-06
9.440E-06
9.307E-06
9.17"6E-06
9.048E-06
8.923E-06
8.800E-06
8.680E-06
8.562E-06
8.447E-06
8.334E-06
8.223E-06
8.115E-06
8.009E-06
7.905E-06
7.386E-06
4.547E-05
4.463E-05
4.382E-05
4.303E-05
4.226E-05
4.150E-05
4 . 076E-05
4.004E-05
3.933E-05
3.864E-05
3.796E-05
3 . 730E-05
3.665E-05
3.602E-05
3.540E-05
3.479E-05
3 . 420E-05
3 . 362E-05
3.306E-05
3.250E-05
3.196E-05
3.143E-05
3.091E-05
3.041E-05
2.991E-OS
2.943E-05
2.895E-05
2.849E-05
2.804E-OS
2.759E-05
2.716E-05
2.674E-05
2.632E-05
2.592E-05
2.552E-05
2.514E-05
2.476E-05
2.439E-05
2.403E-05
2.367E-05
2.332E-05
2.298E-05
2.265E-05
2.233E-05
2.201E-05
2.170E-05
2.139E-05
2.109E-05
2.080E-05
2.052E-05
2.024E-05
1.996E-05
1.969E-05
1.943E-05
1.917E-05
1.892E-05
1.867E-05
1.343E-05
1.839E-05
1.18
1.18
1.18
1.18
1.18
1.18
1.18
1.18
1.18
1.18
1.18
1.18
1.18
1.18
1.18
1.18
1.18
1.18
1.18
1.18
1.18
1.18
1.18
1.18
1.18
1.18
1.18
1.18
1.18
1.18
1.18
1.18
1.18
1.18
1.18
1.18
1.18
1.18
1.18
1.18
1.18
1.18
1.18
1.18
1.18
1.18
1.18
1.18
1.18
1.18
1.18
1.18
1.18
1.18
1.18
1.18
1.18
1.18
1.18
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
181.
185.
188.
192.
196.
200.
203.
207.
211.
214.
218.
222.
225.
229.
233.
236.
240.
244.
247.
251.
254.
258.
262.
265.
269.
273.
276.
280.
283.
287.
290.
294.
298.
301.
305.
308.
312.
315.
319.
322.
326.
329.
333.
336.
340.
343.
347.
350.
354.
357.
361.
364.
368.
371.
375.
378.
382.
385.
386.
34.9
35.3
35.7
36.1
36.5
36.8
37.2
37.6
37.9
38.3
38.6
39.0
39.3
39.6
40.0
40.3
40.6
40.9
41.3
41.6
41.9
42.2
42.5
42.8
43.1
43.3
43.6
43.9
44.2
44.5
44.7
45.0
45.3
45.5
45.8
46.0
46.3
46.5
46.8
47.0
47.3
47.5
47.8
48.0
48.2
48.5
48.7
48.9
49.2
49.4
49.6
49.8
50.0
50.3
50.5
50.7
50.9
51.1
51.1
2.153E-05
2.105E-05
2.057E-05
2.011E-05
1.967E-05
1.923E-05
1.882E-05
1.841E-05
1.802E-05
1.763E-05
1.726E-05
1.690E-05
1.656E-05
1.622E-05
1.589E-05
1.558E-05
1.527E-05
1.497E-05
1.468E-05
1.440E-05
1.413E-05
1.387E-05
1.361E-05
1.336E-05
1.312E-05
1.289E-05
1.266E-05
1.244E-05
1.222E-05
1.201E-05
1.181E-05
1.161E-05
1.142E-05
1.123E-05
1.105E-05
1.087E-05
1.070E-05
1.053E-05
1.037E-05
1.021E-05
1.005E-05
9.398E-06
9.750E-06
9.605E-06
9.464E-06
9.326E-06
9.192E-06
9.061E-06
8.933E-06
8.308E-06
3.685E-06
8.566E-06
3.449E-06
8.335E-06
8.224E-06
8.115E-06
8.008E-06
7.904E-06
7.386E-06
69.5
58.9
44.7
20.4


















Figure B.3.  (continued)

-------
                                                              B-7
Data input on
Source program run on
     UOA_DEGADIS   MODEL   OUTPUT   -  -   VERSION    2.1

              ***************   g-SEP-1989  14:44:19.11  ***************

            6-SEP-1989 14:44:11.16
            6-SEP-1989 14:44:19.11
          TITLE BLOCK

Methylisocyanate (MIC) release simulation
     Wind velocity at reference height
     Reference height

     Surface roughness length

     Pasquill Stability class

     Monin-Obukhov length
     Gaussian distribution constants
                      Specified averaging time
                                         Delta
                                          Beta
     Hind velocity power law constant
     Friction velocity

     Ambient Temperature
     Ambient Pressure
     Ambient Absolute Humidity
     Ambient Relative Humidity '
     Input:
Mole fraction

   0.00000
   1.00000
                 Alpha
                                     2.90  m/s
                                    10.00  m

                                0.100      m

                                   F

                                 17.5      m

                                  3600.00  s
                                  0.09645
                                  0.90000
                 0.44904
                 0.13910
                                           m/s
                                   298.00  K
                                    1.000  atm
                                1.009E-02  kg/kg BDA
                                    50.00  Z
CONCENTRATION OF C
      kg/m**3
      0.00000
      2.33112
GAS DENSITY
  kg/m**3
  1.17737
  2.33112
     Specified Gas Properties:

         Molecular weight:                                        57.000
         Storage temperature:                                     298.00    K
         Density at storage temperature and ambient pressure:     2.3311    kg/m**3
         Mean heat capacity constant:                             80700.
         Mean heat capacity power:                                1.0000
         Upper mole fraction contour:                            3.00000E-05
         Lower mole fraction contour:                            2.00000E-05
         Height for isopleths:                                   0.50000    m
 Source  input data points

                Initial mass in cloud:
                                        O.OOOOOE+00
Time

s
O.OOOOOE+00
60230.
60231.
60232.
Contaminant
Mass Rate
kg/s
6.7200
6.7200
O.OOOOOE-l-00
O.OOOOOE+00
Source Radiu:

m
829.28
829.28
O.OOOOOE+00
O.OOOOOE+00
                                                         Contaminant
                                                        Mass Fraction
                                                       kg contam/kg mix
                                                          1.56157E-05
                                                          1.56157E-05
                                                          1.56157E-05
                                                          1.56157E-05
                                                   Temperature

                                                        K
                                                     298.00
                                                     298.00
                                                     298.00
                                                     298.00
                                                      Enthalpy

                                                        J/kg
                                                     O.OOOOOE+00
                                                     O.OOOOOE+00
                                                     O.OOOOOE+00
                                                     O.OOOOOE+00
      Calculation procedure  for ALPHA:  1

      Entrainment prescription for PHI:  3

      Layer  thickness  ratio  used for average depth:    2.1500

      Air entrainment  coefficient used: 0.590

      Gravity slumping velocity coefficient used: 1.150

      Isothermal calculation

      Heat transfer not  included
                                               Figure B.3.    (continued)

-------
                                                             B-8
    Time
    sac
                                                CALCULATED SOURCE PARAMETERS
Gas Radius
    m
Haigbt
  m
  Qatar
kg/m**2/s
SZOc-L/2.)   Mole frac C
    m
 0.OOOOOOE+00   829.280
  5.75485       829.293
              1.100000E-05  2.741708E-06   56.6987
              0.113404      2.737199E-06   61.9269
Density
kg/m**3
                                        7,886120E-06    1.17738
                                        7.873082E-06    1.17738
Source strength [kg/s]  :
Equivalent Primary source length  Cm]  :
                                                                                                  Rich No.
                                                        0.756144
                                                        0.756144
                               6.7200      Equivalent Primary source radius Cm] :
                               1658.6      Equivalent Primary source half-width [m] :
Secondary source concentration [kg/m**3]  :   1.83S52E-05  Secondary source SZ Cm] :

Contaminant flux rate:    3.11030E-06
                                                                         829.28
                                                                         651.32

                                                                         61.927
Secondary source mass fractions...  contaminant:   1.5S8989E-05   air:   0.99000
           Enthalpy:   O.OOOOOE+00       Density:     1.1774
Secondary source length [m]
                               1638.6
                           Secondary source half-width Cm]
                                                                                                        651.33
Distance
(m)
1.086E+04
1.086E+04
1.086E+04
1.087E+04
1.087E-1-04
Mole Concentration Density
Fraction
(kg/m**3)
7
7
7
7
7
.873E-06
.873E-06
. 873E-06
.872E-06
.861E-06
1
1
1
1
1
.836E-05
.836E-05
.835E-05
. 835E-05
.833E-05
Temperature Half
Width
(kg/m**3) (K)
1.
1.
1.
1.
1.
18
18
18
18
18
298.
298.
298.
298.
298.
(m)
651.
650.
649.
635.
628.
Sz
(m)
61.
61.
61.
62.
62.
9
9
9
0
0
Sy
2
(m)
0 . OOOE+00
1.86
2.64
18.8
26.5
                                                                                       Width at z-  0.50 m to:
                                                                                     2.000E-03moleZ 3.OOOE-03moleZ
                                                                                           (m)        (m)
 For the UFL of   3.00000E-03 mole percent, and the LFL of   2.00000E-03 mole percent:

 The mass of contaminant between the UFL and LFL is:  O.OOOOOE+00 kg.
 The mass of contaminant above the LFL is:   O.OOOOOE+00 kg.
                                             Figure  B.3.    (concluded)

-------
                                    B-9
Enid. Oklahoma. Ammonia Release

     The model was also used to simulate an ammonia pipeline failure
which occurred near Enid, Oklahoma, on May 7, 1976 (Atwood, 1976).  The
release occurred during early morning hours (~ 8 AM) when a bulldozer
struck and ruptured an eight-inch ammonia pipeline operating at
approximately 700 psi.  Approximately 500 tons of ammonia were released
in 4.5 hours from the ten-mile section isolated between check valves.
The windspeed at the time of the accident was reported to be
approximately 10 mph.  The dense aerosol plume reportedly etched a
parabolic-shaped scar about 6 miles long and one-half mile wide.  The
conditions used to simulate the release are shown in Table B.2.
                Table B.2.  Ammonia Example Simulation
                            Release Conditions
     Ammonia release rate   56 kg/s (twice 500 tons per 4.5 hours
     Release elevation      zero (ground level)
     Vent diameter          0.2 m
     Wind speed (at 10 m)   4.5 m/s
     Surface roughness      1 cm
     Atmospheric stability  D
     The input file is shown in Figure B.4.  The release elevation has
been set to 0.02 m (2 ZR) to avoid numerical problems.  The ammonia
aerosol/(humid) air mixture density shown  in Figure B.5 was determined
by assuming the ambient air and release ammonia aerosol mixes
adiabatically (Spicer and Havens, 1988).   The relationship between
mixture density and ammonia concentration  is input to the model with  20
ordered triples of ammonia mole fraction,  ammonia concentration (kg/m^),
and ammonia/air mixture density (kg/m-^) .

     Figure B.6 shows the predicted 1000 ppm and 100 ppm ground-level
concentration isopleths which assume one-hour averaging time for  the
estimation of lateral dispersion by meander.  The predicted plume rise
was approximately 70 meters, and the plume was predicted to return to
ground level about 525 meters downwind of  the release.  The LIS file
from the output files of JETPLU and DEGADIS is shown in Figure B.7.

-------
                                  B-10
Enid, Oklahoma, ammonia pipeline release simulation
4.5  10.
0.01
140.
298.  0.98  50.
298.
NH3
17.
3600.
298.
0.001  0.0001  0.
0  3845.000  1.000000
 22
  O.OOOOOOOE+00     0
  1.4000000E-02     9
  2.0000000E-02     1
  4.2000000E-02     3
  6.2000000E-02     4
  8.1000000E-02     6
  0.1050000         8
  0.1420000         0
  0.1610000         0
  0.1760000         0
  0.1890000         0
  0.2040000         0
  0.2230000         0
  0.4430000         0
  0.5560000         0
  0.6540000
  0.7390000
  0.8120000
  0.8740000
  0.9250000
  0.9670000
   1.000000
56.
0.02 0.2
0.0
20.
.OOOOOOOE+00
.8185645E-03
.4134786E-02
.0499677E-02
.6361663E-02
.2597632E-02
.5226245E-02
.1255372
.1486259
.1675721
.1841250
.2030910
.2269812
.5594106
.8019109
1.081982
1.410169
1.797091
2.255920
2.790716
3.424175
4.149494
                  UO,  ZO
                  ZR
                  INDVEL,  ISTAB,  RML
                  TAMB,  PAMB,  RELHUM
                  TSURF
                  GASNAM
                  GASMW
                  AVTIME
                  TEMJET
                  GASUL, GASLL,  ZLL
                  INDHT,  CPK, GPP
                  NDEN
1.
1.
1.
1.
1.
1.
1.
153908
185840
192022
213623
239219
270430
320677
1.415537
1.465818
1.501815
1.527787
1.550787
1.571988
1.755602
1.890973
2.055484
2.257174
2.504694
2.809017
3.175532
3.622905
4.149494
ERATE
ELEJET, DIAJET
TEND
DISTMX
This  is  the  end  of the  file.  Any  comments  can be  included here  since
the file is  not  read after  the  line  for  DISTMX above.
                    Figure B.4.  Listing of EX2.IN.

-------
                              B-ll
   0.0   0.1    0.2   0.3   0.4    O.S   0.6   0.7    0.8   0.9   1.0
                        Mole Fraction Ammonia

   Figure  B.5.   Ammonia Aerosol/Air Adiabatic
                   Mixture Density.
  3000
  2000
  1000
    0
 -1000
 -2000
 -3000
         Maxtftun Plune Rise - 68 •
         Distance to Ground Contact • 562 m
                    1000 ppn
                                                  100 ppin
      0    1000   2000  3000  4000  5000  6000  7000  8000  9000  10000
                         Downwind Distance, m

Figure B.6.    Ground-Level Isocontours--Oklahoma
                Ammonia Pipeline  Break

-------
                                                            B-12
                                                     JETPLU/DEGADIS v2.1
 S-SEP-1989 15:48:31.08

Enid, Oklahoma,  ammonia pipeline release simulation
Ambient Meteorological Conditions...

Ambient windspeed at  reference height:
                     Reference height:
                   Surface roughness:

              Pasquill stability class:

                 Monin-Obukhov length:
                   Friction velocity:
                  Ambient temperature:
                     Ambient pressure:
                     Ambient humidity:
                   Relative humidity:

             Specified averaging time:
                              DELTAy:
                               BETAy:
                              DELIAz:
                               BETAz:
                              GAM4AZ:
  4.5000     m/s
  10.000     m
 l.OOOOOE-02 m
 O.OOOOOE+00 m
 0.22797     m/s
  298.00     K
 0.98000     atm
 1.03009E-02
  50.000     *

  3600.0     s
 0.19461
 0.90000
 4.13400E-02
  1.1737
-3.16000E-02
 Contaminant Properties...

        Contaminant molecular weight:     17.000
                 Initial temperature:     298.00
             Upper level of interest:    l.OOOOOE-03
             Lower level of interest:    l.OOOOOE-04
              Heat capacity constant:     3845.0
                 Heat capacity power:     1.0000
NDEN flag: 22
Mole fraction

O.OOOOOE+00
1.40000E-02
2.00000E-02
4.20000E-02
6.20000E-02
8.10000E-02
0.10500
0 . 14200
0.16100
0.17600
0.18900
0.20400
0.22300
0.44300
0.55600
0.65400
0.73900
0.31200
0.87400
0.92500
0.96700
1.0000

Cone entr ation
(kg/m3)
O.OOOOOE+00
9.81856E-03
1.41348E-02
3.04997E-02
4.63617E-02
6.25976E-02
8.52262E-02
0.12554
0.14863
0.16757
0.18413
0.20309
0.22698
0.55941
0.80191
1.0820
1.4102
1.7971
2.2559
2.7907
3.4242
4.1495

Density
(kg/m3)
1.1539
1.1858
1.1920
1.2136
1.2392
1.2704
1.3207
1.4155
1.4658
1.5018
1.5278
1.5508
1.5720
1.7556
1.8910
2.0555
2.2572
2.5047
2.8090
3.1755
3 . 6229
4.1495
 ISOFL flag:
 Release Properties...
                        Release rate:
                  Discharge  elevation:
                   Discharge diameter:
                                                              Figure  B.7.    LIS  File  from Output  Files
                                                                                of JETPLU and DEGADIS.
  56.000     kg/s
 2.00000E-02 m
 0.20000     m
 Model Parameters...
                               ALFA1:   2.30000E-02

-------
                                                     B-13
Downwind
Distance
(m)
2.151E-17
13.2
27.5
41.3
60.9
80.8
101.
121.
141.
160.
180.
200.
220.
240.
259.
279.
299.
318.
338.
358.
378.
397.
417.
437.
457.
477.
496.
516.
536.
556.
Elevation
(m)
1.56
45.9
56.0
61.2
65.3
67.2
67.5
66.6
64.7
62.2
59.4
56.3
53.2
50.0
46.7
43.5
40.2
37.0
33.8
30.7
27.5
24.4
21.4
18.3
15.3
.12.4
9.48
S.60
3.75
0.937
Mole Centerline
Fraction Concentration
(kg/m3)
1.00
6.181E-02
4.044E-02
3.127E-02
2.423E-02
2.004E-02
1.724E-02
1.460E-02
1.219E-02
1.019E-02
8.577E-03
7.297E-03
6.278E-03
5.459E-03
4.794E-03
4.246E-03
3.791E-03
3.411E-03
3.098E-03
2.857E-03
2.700E-03
2.635E-03
2.653E-03
2.728E-03
2.821E-03
2.896E-03
2.928E-03
2.904E-03
2.826E-03
2.703E-03
4.15
4.642E-02
2.944E-02
2.251E-02
1.729E-02
1.423E-02
1.220E-02
1.029E-02
8.553E-03
7.112E-03
5.965E-03
5.060E-03
4.343E-03
3 . 769E-03
3.304E-03
2.923E-03
2.607E-03
2.343E-03
2.127E-03
1.960E-03
1.852E-03
1.807E-03
1.819E-03
1.871E-03
1.935E-03
1.987E-03
2.009E-03
1.993E-03
1.939E-03
1.854E-03
Density
(kg/ma )
4.15
1.24
1.21
1.20
1.20
1.19
1.19
1.19
1.18
1.18
1.17
1.17
1.17
1.17
1.16
1.16
1.16
1.16
1.16
1.16
1.16
1.16
1.16
1.16
1.16
1.16
1.16
1.16
1.16
1.16
Temperature Sigma y
(K) (m)
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
0.110
5.00
7.36
9.14
11.2
13.1
14.9
16.8
18.8
20.9
23.1
25.3
27.4
29.6
31.7
33.8
35.9
38.0
40.1
42.2
44.2
46.3
48.3
50.4
52.4
54.4
56.4
58.3
60.3
62.3
Sigma z
(m)
0.110
4.64
6.44
7.56
8.57
9.18
9.54
10.1
10.8
11.7
12.6
13.6
14.6
15.7
16.7
17.7
18.7
19.8
20.7
21.7
22.7
23.7
24.6
25.5
26.5
27.4
28.3
29.1
30.0
30.9
	 At Z-
Mole
Fraction 1.
0.
0.
0.
0.
0.
0.
0.
0.
0.
0.
0.
0.
0.
0.
0.
0.
7.
1.
1.
2.
2.
2.
2.
3.
3.
3.
3.
2.
2.
2.
OOOE+00
OOOE+00
OOOE+00
OOOE+00
OOOE+00
OOOE+00
OOOE+00
OOOE+00
OOOE+00
OOOE+00
OOOE+00
OOOE+00
OOOE+00
OOOE+00
OOOE+00
OOOE+00
628E-04
183E-03
638E-03
077E-03
461E-03
764E-03
978E-03
105E-03
155E-03
14 IE- 03
077E-03
975E-03
848E-03
704E-03
u.uuuciTuu m 	
Width to:
OOE-02molZ l.OOE-Olr
(m) (m)





72.5
81.8
86.2
90.7
95.1
99.5
104.
108.
113.
117.
121.
125.
130.
134.





22.1
39.9
51.1
59.5
66.1
71.5
76.0
79.6
82.4
84.7
86.3
87.4
88.0
562.
          0.OOOE+00   2.654E-03   1.820E-03
                                           1.16
                                                      298.
                                                                 62.9
                                                                            31.2
                                                                                      2.653E-03
                                                                                                  135.
                                                                                                             88.1
                                                                     (END OF JETPLU SIMULATION)
                                       Figure  B.7.   (continued)

-------
                                                              B-14
********************

***************

Data input on
Source program run on
     UOA_DEGADIS   MODEL   OUTPUT

              ***************   6-SEP-1989  15:49:46.45

            6-SEP-1989 15:49:38.76
            6-SEP-1989 15:49:46.45
                                                                                    VERSION   2.1
                                                                                                                ****************
          TITLE BLOCK

Enid, Oklahoma ammonia pipeline release simulation
     Wind velocity at reference height
     Reference height

     Surface roughness length

     Pasquill Stability class

     Monin-Obukhov length
     Gaussian distribution constants
                      Specified averaging time
                                         Delta
                                          Beta
     Wind velocity power law constant
     Friction velocity

     Ambient Temperature
     Ambient Pressure
     Ambient Absolute Humidity
     Ambient Relative Humidity
     Input:
Mole fraction

   0.00000
   0.01400
   0.02000

   0.04200
   0.06200
   0.08100

   0.10500
   0.14200
   0.16100

   0.17600
   0.18900
   0.20400

   0.22300
   0.44300
   0.55600

   0.65400
   0.73900
   0.81200

   0.37400
   0.92500
   0.96700

   1.00000
                 Alpha
                    4.50
                   10.00

               l.OOOE-02

                  D

                infinite

                 3600.00
                 0.19461
                 0.90000

                 0.18680
                 0.22797
                                          m/s
                                          m
                                           m/s
                                   298.00  K
                                    0.980  atm
                                1.030E-02  kg/kg BOA
                                    50.00  Z
CONCENTRATION OF C
      kg/m**3
      0.00000
      0.00982
      0.01413

      0.03050
      0.04636
      0.06260

      0.08523
      0.12554
      0.14863

      0.16757
      0.18413
      0.20309
                                                 22698
                                                 55941
                                               0.80191
                                                 08198
                                                 41017
                                                1.79709

                                                2.25592
                                                2.79072
                                                3.42418

                                                4.14949
GAS DENSITY
  kg/m**3
  1.15391
  1.18584
  1.19202

  1.21362
  1.23922
  1.27043

  1.32068
  1.41554
  1.46582

  1.50182
  1.52779
  1.55079
                            57199
                            75560
                            89097
                          2.05548
                          2.25717
                          2.50469

                          2.80902
                          3.17553
                          3.52290

                          4.14949
      Specified Gas Properties:

          Molecular weight:                                         17.000
          Storage temperature:                                      298.00    K
          Density at storage temperature and ambient  pressure:      4.1495    kg/m**3
          Mean heat capacity constant:                              3845.0
          Mean heat capacity power:                                 1.0000
          Upper mole fraction contour:                             l.OOOOOE-03
          Lower mole fraction contour:                             l.OOOOOE-04
          Height for isopleths:                                    O.OOOOOE+OOm
                                                Figure B.7.    (continued)

-------
                                                              B-15
Source input data points

               Initial mass in cloud:
       Tim*
    0.OOOOOE+00
     60230.
     60231.
     60232.
     Contaminant
       Mass Rat*
          kg/s
        SB.000
        56.000
       0.OOOOOE+00
       0.OOOOOE+00
 0.OOOOOE+00

Source Radius

      m
  135.30
  135.30
 0.OOOOOE+00
 0.OOOOOE+00
  Contaminant
 Mass Fraction
kg contam/kg mix
   1.56929E-03
   1.56929E-03
   1.56929E-03
   1.56929E-03
Temperature

     K
  298.00
  298.00
  298.00
  298.00
 Enthalpy

   J/kg
0. OOOOOE+00
0.OOOOOE+00
0.OOOOOE+00
0.OOOOOE+00
     Calculation procedure for ALPHA:  1

     Entrainment prescription for PHI:  3

     Layer thickness ratio used for average depth:    2.1500

     Air entrainment coefficient used: 0.590

     Gravity slumping velocity coefficient used: 1.150

     Isothermal calculation

     Heat transfer not included

     Hater transfer not included
    Time
    sec
Gas Radius
    m
 O.OOOOOOE+00   135.300
   4.79323       136.413
   23.4441       146.849
  64.4041
  105.364
  146.324

  197.524
  218.004
  228.244
 181.434
 219.626
 256.937

 300.368
 315.190
 317.744
                                                 CALCULATED SOURCE PARAMETERS
                                                                      Mole frac C
                                                        2.654004E-Q3
                                                        2.636814E-Q3
                                                        2.490347E-03
Height
m
1.100000E-OS
1.77907
7.82487
15.3666
17.5763
17.0954
14 . 6524
13.4747
13.2504
Qstar
kg/m**2/s
2.902896E-04
2.883740E-04
2.719845E-04
2.327196E-04
2.0S9423E-04
1.896346E-04
1.789255E-04
1.770343E-04
1.769059E-04
SZ(x-L/2.)
m
11.1516
11.2280
11.9374
14.1936
16.5237
18.6339
20.8536
21.5390
21.6129
                                               Density
                                               kg/m**3
                                                 15996
                                                 15992
                                                 15959
2.145477E-03
1.919935E-03
1.793855E-03
1.731507E-03
1.730059E-03
1.732304E-03
1.15880
1.15829
1.15800
1.15786
1.15785
1.15786
                                                                                                    Rich No.
                                              756144
                                              756144
                                              756144

                                              756144
                                              756144
                                              756144

                                              756144
                                              ,756144
                                                                                                   0.756144
 Source strength  [kg/s]  :
 Equivalent  Primary  source  length  [m]  :

 Secondary source concentration  [kg/m**3]  :

 Contaminant flux rate:   1.76556E-04
                               56.000
                               270.60
                   Equivalent Primary source radius  [m]  :
                   Equivalent Primary source half-width  [m]
                              1.18555E-03  Secondary source SZ [m]
                                                  135.30
                                                  106.26

                                                  21.613
 Secondary source mass  fractions... contaminant:   1.023911E-03   air:   0.98879
            Enthalpy:    0.OOOOOE+00      Density:    1.1579
 Secondary source length [m]
                                              635.49
                                           Secondary source half-width [m]
                                                                                          249.56
  Distance     Mole   Concentration Density   Temperature   Half        Sz
             Fraction                                     Width
     (m)                 (kg/m**3)   (kg/m**3)      (K)         (m)        (m)

                                               298.       250.       21.6
                                               298.       237.       21.6
                                               298.       226.       21.5

                                               298.       215.       21.4
                                               298.       204.       21.2
                                               298.       192.       20.9

                                               298.       184.       20.7
                                               298.       179.       20.5
                                               298.       175.       20.4

1
1
1
1
380.
884.
894.
914.
949.
.009E+03
.089E+03
.169E+03
.249E+03
1
1
1
1
1
1
1
1
1
.732E-03
.729E-03
.719E-03
.704E-03
.678E-03
.631E-03
.569E-03
.507E-03
.444E-03
1.
1.
1.
1.
1.
1.
1.
1.
9.
, 186E-03
. 183E-03
.176E-03
166E-03
.148E-03
. 116E-03
073E-03
.030E-03
, 878E-04
1.
1.
1.
1.
1.
1.
1.
1.
1,
.16
.16
,16
,16
.16
.16
,16
.16
.16
                                                                  Sy     Width at z-  0.00 m to:
                                                                       1.000E-02moleZ 0.100    moleZ
                                                                  (m)        (m)        (m)
                                                               O.OOOE+00
                                                                15.4
                                                                29.3

                                                                46.9
                                                                67.4
                                                                93.2

                                                                120.
                                                                143.
                                                                164.
                                                   250.
                                                   263.
                                                   276.

                                                   294.
                                                   317.
                                                   348.

                                                   384.
                                                   415.
                                                   443.
                                               250.
                                               248.
                                               248.

                                               249.
                                               252.
                                               258.

                                               265.
                                               270.
                                               274.
                                               Figure  B.7.   (continued)

-------
          B-16
1.329E+03
1.409E+03
1.489E+03
1.569E+03
1.644E+03
1.724E+03
1.804E+03
1.884E+03
1.964E+03
2.044E+03
2 . 124E+03
2.204E+03
2.284E+03
2.364E+03
2.444E+03
2.524E+03
2.604E+03
2.S84E+03
2.764E+03
2.844E+03
2.924E+03
3.004E+03
3 . 084E+03
3 . 164E+03
3.244E+03
3.324E+03
3.404E+03
3.484E+03
3.564E+03
3 . 644E+03
3 . 724E+03
3 . 304E-H33
3 . 884E+03
3 . 964E+03
4.044E+03
4 . 124E+03
4.204E+03
4 . 284E+03
4 . 364E+03
4.444E+03
4 . 524E+03
4 . 604E+03
4 . 684E+03
4 . 764E+03
4.844E+03
4 . 924E+03
5.004E+03
5.084E+03
5.164E+03
5.244E+03
5.324E+03
5.404E+03
5 . 484E+03
5.564E+03
5.644E+03
5 . 724E+03
5.804E+03
5.384E+03
5 . 964E+03
S.044E+03
1.383E-03
1.323E-03
1.265E-03
1.208E-03
1.157E-03
1.104E-03
1.054E-03
1.005E-03
9.595E-04
9.160E-04
8.746E-04
8.353E-04
7.981E-04
7.629E-04
7.296E-04
6.982E-04
6.684E-04
6.403E-04
6.137E-04
5 . 885E-04
5.647E-04
5.422E-04
5.210E-04
5.008E-04
4.817E-04
4.637E-04
4.465E-04
4.303E-OA
4.149E-04
4.002E-04
3 . 863E-OA
3.731E-04
3.606E-0*
3.486E-04
3.372E-04
3.264E-04
3.161E-04
3.062E-04
2.968E-04
2.878E-04
2.792E-04
2.710E-04
2.632E-04
2.557E-04
2.485E-04
2.416E-04
2.350E-04
2.287E-04
2.226E-04
2.168E-04
2.112E-04
2.058E-04
2.006E-04
1.957E-04
1.909E-04
1.863E-04
1.818E-04
1.775E-04
1.734E-Q4
1.594E-04
9.457E-04
9.045E-04
8.644E-04
8.255E-04
7.904E-04
7.543E-04
7.198E-04
6.868E-04
6.555E-04
6.256E-04
5.973E-04
5.704E-04
5.450E-04
5.209E-04
4.981E-04
4 . 766E-04
4.563E-04
4.370E-04
4 . 188E-04
4.017E-04
3.854E-04
3.700E-04
3.555E-04
3.417E-04
3.287E-04
3.164E-04
3.047E-04
2.936E-04
2.830E-04
2.730E-04
2.636E-04
2.545E-04
2.460E-04
2.378E-04
2.300E-04
2.226E-04
2.156E-04
2.089E-04
2.024E-04
1.963E-04
1.904E-04
1.849E-04
1.795E-04
1.744E-04
1.695E-04
1.648E-04
1.603E-04
1.559E-04
1.518E-04
1.478E-04
1.440E-04
1.403E-04
1.368E-04
1.334E-04
1.301E-04
1.270E-04
1.240E-04
1.210E-04
1.182E-04
1.155E-04
1.16
1.16
1.16
1.16
1.16
1.16
1.16
1.16
1.16
1.16
1.16
1.16
1.16
1.16
1.16
1.16
1.16
1.16
1.16
1.16
1.16
1.16
1.16
1.16
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
173.
171.
170.
169.
168.
168.
167.
167.
167.
167.
167.
166.
166.
166.
166.
166.
165.
165.
165.
164.
164.
164.
163.
163.
162.
162.
161.
160.
160.
159.
158.
157.
156.
155.
155.
154.
153.
152.
151.
150.
148.
147.
146.
145.
144.
143.
141.
140.
139.
138.
136.
135.
133.
132.
131.
129.
128.
126.
125.
123.
20.4
20.5
20.6
20.8
21.0
21.2
21.5
21.8
22.2
22.5
22.9
23.3
23.8
24.2
24.7
25.2
25.7
26.2
26.7
27.2
27.8
28.3
28.9
29.5
30.1
30.6
31.2
31.8
32.4
33.1
33.7
34.3
34.9
35.6
36.2
36.8
37.5
38.1
38.8
39.4
40.1
40.7
41.4
42.1
42.7
43.4
44.1
44.8
45.4
46.1
46.3
47.5
48.1
48.3
49.5
50.2
50.9
51.6
52.3
53.0
183.
201.
218.
234.
248.
264.
278.
293.
307.
321.
334.
347.
360.
373.
386.
398.
411.
423.
435.
447.
459.
470.
482.
493.
505.
516.
527.
538.
549.
560.
571.
582.
593.
603.
614.
624.
635.
645.
655.
665.
676.
686.
696.
706.
716.
726.
735.
745.
755.
765.
774.
784.
794.
803.
813.
322.
831.
341.
350.
359.
469. 277.
493. 277.
516. 275.
538. 270.
557. 263.
576. 251.
595. 231.
612. 189.
628.
644.
659.
673.
686.
698.
710.
721.
732.
742.
751.
760.
768.
776.
783.
789.
795.
801.
806.
811.
815.
819.
322.
825.
828.
830.
831.
833.
834.
834.
834.
834.
333.
832.
831.
329.
827.
824.
821.
818.
314.
310.
306.
801.
796.
790.
784.
778.
771.
763.
756.
747.
Figure B.7.  (continued)

-------
           B-17
6.124E+03
6.204E+03
6.284E+03
6.364E+03
6.444E+03
6.524E+03
6.604E+03
6.684E-H)3
6.764E+03
6 . 844E+03
8.924E+03
7 . 004E+03
7.084E+03
7 . 164E-MJ3
7.244E+03
7.324E+03
7 . 404E+03
7 . 484E+03
7.564E+03
7 . 644E+03
7 . 724E+03
7.804E+03
7 . 884E+03
7 . 964E+03
8 . 044E+03
8 . 124E+03
8.204E+03
3.284E-H)3
8.364E+03
8.444E+03
8.524E+03
3.504E+03
8.684E-HJ3
3.759E-M)3
8 . 839E+Q3
8 . 919E+03
8.999E+03
9.079E+03
9.159E-HJ3
9.239E+03
9.319E+03
9 . 399E+03
9.479E-C03
9.559E+03
9.639E+03
9.719E+03
9.799E+03
9.879E-I-03
9.959E+03
1.004E+04
1.011E+04
1.018E+04
1.025E+04
1.031E+04
1.036E+04
1.042E+04
1.047E-MJ4
1.052E+04
1.056E-HJ4
1.060E+04
1.656E-04
1.619E-04
1.583E-04
1.548E-04
1.51SE-04
1.483E-04
1.452E-04
1.421E-04
1.392E-04
1.364E-04
1.336E-04
1.310E-04
1.284E-04
1.259E-04
1.23SE-04
1.211E-04
1.189E-04
1.166E-04
1.145E-04
1.124E-04
1.104E-04
1.084E-04
1.065E-04
1.046E-04
1.028E-04
1.011E-04
9.936E-OS
9.769E-05
9 . 607E-05
9.448E-05
9.294E-05
9.144E-05
8.998E-OS
8.864E-OS
8.725E-05
8.589E-05
8.457E-05
8 . 327E-05
8.201E-05
8.078E-05
7.958E-05
7.841E-05
7 . 726E-05
7.614E-05
7.505E-05
7.398E-05
7.293E-03
7.191E-05
7.091E-05
S.994E-05
6.904E-05
6.822E-05
6.747E-05
6.680E-05
6.618E-05
6.558E-05
6.504E-05
6.451E-05
6.403E-05
6.362E-05
1.129E-04
1.104E-04
1.079E-04
1.056E-04
1.033E-04
1.011E-04
9.896E-05
9.690E-OS
9.491E-05
9.298E-05
9.111E-05
8.929E-OS
8.754E-05
8.584E-05
8.
8.
8.
7.
7.
7.
7.
7.
7.
7.
7.
6.
6.
6.
6.
6.
6.
6.
6.
S.
3.
5.
5.
5.
S.
5.
5.
5.
5.
5.
5.
5.
It.
it.
it.
419E-05
239E-OS
103E-05
952E-05
806E-05
664E-05
526E-05
391E-05
261E-05
134E-05
010E-05
890E-05
773E-05
660E-05
549E-03
441E-05
336E-03
234E-05
134E-05
043E-05
948E-05
855E-05
765E-05
877E-05
591E-OS
507E-05
423E-05
343E-05
267E-05
190E-05
116E-05
043E-03
.972E-05
.902E-05
.834E-05
4.767E-05
It.
.706E-05
4.650E-05
4.600E-05
4.553E-05
4.512E-05
4
4
4
4
4
.470E-05
. 434E-05
.397E-Q5
.365E-05
.336E-05
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
2S8.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
122
120,
119,
117
116
114
112
111
109
107
106
104
102
101
99.
97.
95.
93.
92.
90.
88.
86.
84.
83.
81.
79.
77.
75.
74.
72.
70.
68.
66.
64.
62.
60.
58.
57.
55.
53.
51.
49.
47.
45.
43.
41.
39.
37.
35.
33.
31.
29.
28.
26.
25.

0
3
6
8
1
3
5
7
9
1
3
5.
6
8
0
1
2
3
5
7
8
9
9
0
1
2
2
3
3
3
4
4
4
4
4
4
5
3
2
6
3
23.9
22.6
21.3
20.
.2
19.2
53.7
54.3
55.0
55.7
56.4
57.1
57.8
58.5
59.2
59.9
60.6
61.3
62.0
62.7
63.4
64.1
64.8
65.5
66.2
66.9
67.6
68.3
69.0
69.7
70.5
71.2
71.9
72.6
73.3
74.0
74.7
75.4
76.1
76.8
77.5
78.2
78.9
79.6
80.3
81.0
81.7
82.4
83.1
83.3
84.5
85.2
85.9
86.6
87.3
88.0
88.7
89.3
89.9
90.4
90.9
91.4
91.8
92.3
92.7
93.0
869.
878.
887.
896.
90S.
914.
923.
932.
941.
950.
959.
968.
977.
986.
994.
1.
1.
1.
1.
1.
1.
1.
1.
1.
1.
1.
1.
1.
1.
1.
1.
1.
1.
1.
1.
1.
1.
1.
1.
1.
1.
1.
1.
1.
1.
1.
1.
1.
1.
1.
1.
1.
1.
1.
1.
003E+03
012E+03
021E+03
029E+03
038E+03
046E+03
055E+03
064E+03
072E-HJ3
081E+03
089E+03
098E+03
106E+03
114E+03
123E+03
131E+03
140E+03
148E+03
156E+03
164E+03
172E+03
180E+03
189E+03
197E+03
205E+03
213E+03
221E+03
229E+03
237E+03
245E+03
253E+03
261E+03
269E+03
277E+03
285E+03
293E+03
300E+03
306E+03
312E+03
318E+Q3
739.
730.
720.
710.
699.
688.
676.
664.
651.
637.
622.
607.
591.
574.
556.
537.
516.
494.
471.
445.
418.
387.
352.
312.
262.
192.





























1.323E+03
1.
1.
328E-HJ3
333E+03


1.337E+03
1.341E+03
Figure B.7.  (continued)

-------
          B-18
1.064E+04
1 . 068E+04
1 . 072E+04
1 . 075E+04
1.078E+04
1.081E+04
1 . 084E+04
1.087E+04
1 . 089E+04
1.092E+04
1.094E+04
1.096E-MJ4
1 . 098E+04
1.100E-MH
1.101E+04
1 . 103E+04
1 . 104E+04
1 . 106E+04
1.107E+04
1 . 109E+04
1.110E+04
1.111E+04
1.112E+04
1 . 113E+04
1.114E+04
1.115E+04
1 . 116E+04
1 . 117E+04
1.118E+04
1 . 119E+04
1.119E+04
1.120E+04
1 . 121E+04
1 . 122E+04
1.122E+04
1 . 123E+04
1 . 124E-H54
1 . 12SE+04
1 . 125E+04
1 . 126E+04
1.127E-HH
1 . 127E+04
1.128E+04
1 . 128E+04
1 . 129E+04
1.129E+04
1.130E+04
1.130E+04
1.131E+04
1.131E+04
1.132E+04
1.132E+04
1.133E+04
1.133E+04
1.134E+04
1.134E+04
1.135E+04
1.142E+04
1.150E+04
1.158E+04
6.320E-05
6.279E-05
6.244E-03
6.209E-OS
6.179E-05
6.150E-05
6.120E-05
6.096E-05
6.072E-05
6.048E-OS
6.029E-OS
6.010E-05
5.991E-05
5.972E-05
5.958E-05
5.944E-05
5.930E-05
5.916E-05
5.903E-05
5.889E-05
5.880E-05
5.871E-05
5.861E-05
5.852E-05
5.343E-05
5.334E-05
5 . 825E-05
5.816E-05
5.807E-05
5.798E-05
5.794E-05
5.785E-05
5.781E-05
5.772E-05
5.767E-05
5.758E-05
5.754E-05
5.745E-05
5.741E-05
5.732E-05
5.728E-05
5.723E-05
5.719E-05
5.714E-05
5.710E-05
5.706E-05
5.701E-05
5.697E-05
5.S93E-05
5.688E-05
5.684E-05
5.680E-05
5.675E-05
5.671E-05
5.667E-05
5.662E-05
5.558E-05
5.570E-05
5.474E-05
5.381E-05
4.308E-OS
4.280E-OS
4.2S6E-OS
4.232E-05
4.212E-OS
4.192E-OS
4.172E-05
4.155E-05
4.139E-05
4.123E-05
4.110E-05
4.097E-05
4.084E-05
4.071E-05
4.061E-05
4.052E-05
4.042E-OS
4.033E-05
4.023E-05
4.014E-05
4 . 008E-05
4.002E-05
3.995E-05
3 . 989E-05
3.983E-OS
3.977E-05
3.971E-05
3.965E-05
3.959E-05
3 . 952E-05
3.949E-OS
3.943E-05
3.940E-05
3.934E-05
3.931E-05
3.925E-05
3 . 922E-05
3.916E-05
3.913E-05
3.907E-05
3.904E-05
3.901E-05
3.898E-05
3 . 895E-05
3.392E-05
3.889E-05
3.886E-05
3.S83E-05
3.880E-05
3.377E-05
3.875E-05
3.872E-05
3.869E-05
3.866E-05
3.863E-03
3.860E-05
3.857E-05
3.797E-05
3.732E-05
3.668E-05
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
1.15
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
298.
18.1
17.1
16.2
15.3
14.6
13.8
13.0
12.4
11.7
11.1
10.6
10.1
9.55
9.03
8.64
8.26
7.87
7.48
7.10
6.71
6.45
6.19
5.93
5.68
5.42
5.16
4.90
4.64
4.38
4.12
3.99
3.73
3.60
3.35
3.22
2.96
2.83
2.57
2.44
2.18
2.05
1.92
1.79
1.66
1.53
1.40
1.27
1.14
1.01
0.880
0.750
0.620
0.490
0.360
0.230
0.100
0 . OOOE+00
O.OOOE+00
Q. OOOE+00
O.OOOE+00
93.4
93.7
94.0
94.3
94.6
94.9
95.1
95.3
95.6
95.8
96.0
96.1
96.3
96.5
96.6
96.8
96.9
97.0
97.2
97.3
97.4
97.5
97.5
97.6
97.7
97.3
97.9
98.0
98.1
98.2
98.2
98.3
98.3
98.4
98.5
98. 6
98.6
98.7
98.7
98.8
98.9
98.9
99.0
99.0
99.0
99.1
99.1
99.2
99.2
99.3
99.3
99.3
99.4
99.4
99.5
99.5
99.6
101.
102.
103.
1.345E+03
1.349E+03
1.352E+03
1.356E+03
1.359E+03
1.362E+03
1.36SE+03
1.367E+03
1.369E+03
1.372E+03
1.374E+03
1.376E-I-03
1.378E+03
1.380E+03
1.381E+03
1.382E+03
1.384E+03
1.385E+03
1.387E+03
1.388E+03
1.389E+03
1.390E+03
1.391E+03
1.392E+03
1.393E+03
1.394E+03
1.395E+03
1.396E+03
1.397E+03
1.398E+03
1.398E+03
1.399E+03
1.400E+03
1.401E+03
1.401E+03
1.402E+03
1.403E+03
1.404E+03
1.404E+03
1.405E+03
1.406E+03
1.406E+03
1.407E+03
1.407E+03
1.407E-MJ3
1.408E+03
1.408E+03
1.409E+03
1.409E+03
1.410E+03
1.410E+03
1.411E+03
1.411E+03
1.412E+03
1.412E+03
1.413E+03
1.412E+03
1.420E+03
1.427E+03
1.435E+03
Figure B.7.  (continued)

-------
                                                            B-19
 1.186E+04   S.290E-OS
 1.174E+04   5.202E-05
 1.182E+04   5.115E-05
3.606E-05   1.15
3.546E-05   1.15
3.487E-05   1.15
 1.190E+04   5.031E-05  3.430E-05   1.15
 1.194E+04   4.995E-05  3.405E-05   1.15
298.
298.
298.

298.
298.
O.OOOE+00    104.
O.OOOE+00    105.
O.OOOE+00    106.
                                0.OOOE+00
                                0.OOOE+00
            107.
            107.
1.443E+03
1.450E+03
1.458E+03

1.466E+03
1.469E+03
For the UFL of   0.10000
The mass of contaminant batmen the UFL and LFL is:
The mass of contaminant above the LFL is:    42885.
      mole percent,  and the LFL of   l.OOOOOE-02 mole percent:

                                         kg.
        40143.
          kg.
                                             Figure  B.7.   (concluded)

-------
                                    B-20


Burro Test LNG Releases

     In 1980, the U.S. Department of Energy sponsored at China Lake,
California, the BURRO series of LNG releases (Koopman, et al., 1982).
The Burro tests were ground-level releases; their simulation does not
require use of the JETPLU model.  Burro 9  (Table B.3) was modeled here,
both as a steady-state and transient (time-limited) release, using  the
DEGADIS model with interactive input via DEGADISIN.
                  Table B.3.   Burro 9 Test Conditions
              Source rate                130.0 kg/s
              Source radius              22.06 m
              Wind speed                 6.5 m/s at 8.0 m
              Atmospheric stability      C  (Pasquill)
              Monin-Obukhov length       -140. m
              Surface roughness          2.05 x 10"^ m
              Air temperature            33.4 C
              Atmospheric humidity       12.5 %
              Surface temperature        310 K
     The  source radius  assumes LNG release onto water, with  a  constant
evaporative  flux  of 0.085 kg/m^ s.  The  input procedures  for simulation
of  the  transient  release  (RUN_NAME-BURR09) and the  steady-state  release
(RUN_NAME-BURR09S) are  very  similar.  Therefore, only  the specification
of  the  surface rate and extent have been included for  the transient
release.   In the  following line-by-line  description of the input
procedure:

      (*)   A  line  terminator  (normally a  carriage return)  must  end every
           line entered  by the user.

      (*)   The file name specification RUN_NAME must satisfy  system
           restrictions.

      (*)   When DEGADISIN  requests the user to choose an option,
           responses are a single character (capital or lower case).   The
           default responses  are denoted  by a capital letter  inside angle
           brackets  (e.g.  ).  When applicable, a  menu of responses is
           included  inside parentheses.

      (*)   For numerical responses, a comma,  space,  tab, or line
           terminator  (carriage return) may separate the numbers.

      (*)   When a  file is  used as  input  (i.e. for the density or
           transient source  input), DEGADISIN reads  the same  information
           from  the  file which would be entered  at  the  terminal in the
           same order  and  in the  same format.

-------
                                    B-22
Notes on Steady-State Simulation of BURRO9


MLJ  Begin the input procedure by execution of DEGADISIN.

     The file name specification must follow system restrictions.  The
     DEGADIS model uses this file name along with various file
     extensions for input and output.

     The Title Block is used to carry any desired comments such as
     information on the specification of certain parameters.

     The wind field parameters include the wind velocity  (m/s) at a
     specified height (m) and the surface roughness (m).
©
     The Pasquill stability class is used to generate estimates of other
     atmospheric parameters which follow.
 6)  The averaging time is used to determine the value of Sy (DELTAY) in
     the lateral dispersion coefficient specification.  Changes to the
     values of Sy are calculated assuming that the effect of averaging
     time only influences the lateral plume meander of a steady-state
     release.

     The current settings of pertinent atmospheric parameters are
     displayed in this list.  If any of these are to be changed, the
     first letter of the parameter to be changed is entered.  Note that
     the default--indicated by --is No for no changes.

     The Monin-Obukhov length (Length in the list) is to be changed, so
     L is entered in response to the prompt.

(9J  The list is redisplayed to verify the change and to request any
     further changes.  The  (default) response of No causes the program
     to go to the next question.
 10)   The ambient temperature and pressure are entered.
 11)   DEGADISIN calculates the ambient air density for the given input
      parameters.
 12)   If the release is isothermal,  respond "Y".   A positive response
      causes DEGADISIN to ask for a list of concentration,  density,  and
      mole fraction points for the gas mixture.  The default response is
      negative.
 13)   If the release is simulated as adiabatic,  the default negative
      response is chosen.  For inclusion of heat transfer effects, the
      surface temperature and the method of calculating the heat transfer
      coefficient must be specified.
 14)   Water transfer to the source blanket (if present) can be included
      in the calculation.

-------
                                        B-23
©
©
RUN SYS$DEGADIS:DEGADISIN
               DEnse GAs Dispersion Model input module.

Enter the simulation name : [DIR]RUNNAME BURR09S
    INPUT MODULE " DEGADIS MODEL

    **********************************
    Enter Title Block — up to 4 lines of 80 characters
    To stop, type "//"
Steady-state simulation of BURRO 9
//
    ENTER WIND PARAMETERS — UO (m/s), ZO (ml, and ZR(m)
    UO ~ Hind velocity at reference height ZO
    ZR — Surface Roughness
6.5,8.,2.05E-4

    Enter the Fasquill stability class: (A,B,C,D,E,F)  C
Enter the averaging time (s) for estimating DELTAY: 0.

The values for the atmospheric parameters are set as follows:
DELTAY:                         0.1046
BETAY:                          0.9000
Monin-Obukhov length:          -9.3344 m
Sigma X Coefficient:            0.0200
Sigma X Power:                  1.2200
Sigma X Minimum Distance:     130.0000 m
Do you wish to change any of these?
(No,Deltay.Betay,Length,Coefficient,Power,Minimum)  L
Note: For infinity, RML - 0.0
Enter the desired Monin-Obukhov length: (m) -140.

The values for the atmospheric parameters are set as follows:
DELTAY:                         0.1046
BETAY:                          0.9000
Monin-Obukhov length:        -140.0000 m
Sigma X Coefficient:            0.0200
Sigma X Power:                  1.2200
Sigma X Minimum Distance:     130.0000 m
Do you wish to change any of these?
(No,Deltay.Betay,Length,Coefficient,Power,Minimum) 

Enter the ambient temperature(K) and pressure(atm): 305.88,0.94

The ambient humidity can be entered .as Relative or Absolute.
Enter either R or A :
Enter the relative humidity (Z): 12.5

Ambient Air density is    1.081886     kg/m**3

Is this an Isothermal spill? 

Is heat transfer to be included in the calculations  Y
Enter the surface temperature [-]  K :  310.
Do you want to use the built in correlation, the LLNL correlation, or
enter a particular value?
(Corr.LLNLcorr,Value)  

Is water transfer to be included in the source 

-------
                                    B-24
     Enter the three-letter designation of  the diffusing  gas.   The
     properties of LNG as methane, LPG as propane, and NH3  (ammonia)  are
     included among others.

16)  A list of the properties  for  the specified  gas  (if available)  is
     given.  If any of the parameters are to be  changed,  the  first
     letter of the parameter to be changed  in the  list is given to  the
     prompt.  Here, the  level  at which the  flammability contours are
     calculated is changed from 0.5 m to 1.0 m.

     The  gas property list is  displayed again.   The  default response  is
     no change.

(l8]  The  lowest concentration  of interest is the concentration at which
     the  calculations are stopped.

(19)  The  BURR09 case  is  for  a  release of  "pure"  (undiluted) LNG.  For
     diluted releases, DEGADIS requires the mass fraction of  the
     contaminant  and  the mixture temperature.

     If  a steady-state release is  to be simulated, type  "Y" to the
     prompt.   For a  steady  simulation,  the  steady-state mass  evolution
     rate (kg/s)  and primary source  extent  (m)  are required.

     A note about the numerical  parameter files is included.   These
      files contain various  constant  values  used in the programs to which
      the user  has access without recompiling the programs.   Access is
      granted as a convenience.

      DEGADISIN will  generate a command procedure suitable for'running
      the model under VMS.

      If so desired,  DEGADISIN will initiate the command procedure under
      VMS.  If not, the program returns to the operating system.

-------
                                          B-25
         Enter the coda name of the diffusing species: LNG

         The characteristics for the gas are set as follows:
         Molecular weight:                                  16.04
         Storage temperature [K]:                            111.70
         Density at storage temperature, FAME  [kg/m**3]:    1.6845
         Mean Heat capacity constant                        S.60000E-08
         Mean Beat capacity power                            5.0000
         Upper Flanmability Limit [mole frac]                0.15000
         Lower Flanmability Limit [mole frac]                5.00000E-02
         Height of Flammability Limit [m]                    0.50000
         Do you wish to change any of these? (No,Mole,Temp,Den,Heat,Power,Upper,Lower,Z)
          Z
         Enter the desired Height for the flammable limit calculations: 1.

         The characteristics for the gas are set as follows:
         Molecular weight:                                  16.04
         Storage temperature [K]:                            111.70
         Density at storage temperature, FAME  [kg/m**3]:    1.6845
         Mean Heat capacity constant                        5.60000E-08
         Mean Heat capacity power                            5.0000
         Upper Flammability Limit [mole frac]                0.15000
         Lower Flanmability Limit [mole frac]                S.OOOOOE-02
         Height of Flanmability Limit [m]                     1.0000
         Do you wish to change any of these? (No,Mole,Temp,Den,Heat,Power,Upper,Lower,Z>
         

             The suggested LOWEST CONCENTRATION OF INTEREST (gasJ.fl/2.)
              is   1.S0191E-02 kg/m**3.  Enter the desired value: 0.015

         Specification of source parameters.


 19)     Is this a release of pure (F) or diluted (d) material specified above? 

[20) Is this a Steady state simulation? Y Enter the desired evolution rate [-] kg/sec : 130. Enter the desired source radius ["] m : 22.06 In addition to the information just obtained, DEGADIS requires a series of numerical parameter files which use the same name as [DIR]RUNNAME given above. For convenience, example parameter files are included for each step. They are: EXAMPLE.ER1 and EXAMPLE.ER2 Note that each of these files can be edited during the course of the simulation if a parameter proves to be out of specification. Do you want a command file to be generated to execute the procedure? The command file will be generated under the file name: BURR09S.com Do you wish to initiate this procedure?


-------
                                    B-26
Notes on Transient  Simulation of  BUSR09
 Beginning with the  specification of the  source  rate  and extent,  the
 responses to  all  of the  previous questions  except  the  simulation name
 (RUN_NAME)  are the  same  for  the  steady-state  case  and  are  not repeated.
 19J  The  BURR09  case  is  for a release  of "pure"  (undiluted)  LNG.   For
     diluted releases, DEGADIS requires  the mass fraction of the
     contaminant and  the mixture  temperature.

(20)  The  default response is for  a transient release.
 21J   An initial  mass of gas  can be specified over the  source.   This can
      be used to  model aboveground releases such as the Thorney Island
      Trials.

      The transient source description consists of ordered triples of
      time,  evolution rate, and source radius for pure  sources.  For
      diluted sources, values of evolution rate, source radius,
      contaminant mass fraction, and source temperature must be specified
      as functions of time.

      An input file can be used to enter the data triples to avoid typing
      errors or to use as output from another model such as a liquid
      spreading model.  The file format is the same as  the terminal entry
      format.

      The first item is the number of triples used in the description
      followed by the triples with the last two values  showing no gas
      present.

      A note about the numerical parameter files is included.  These
      files contain various constant values used in the programs to which
      the user has access without recompiling the programs.  Access is
      granted as a convenience.

 (26)  DEGADISIN will generate a command procedure suitable for running
      the model under VMS.

 (27)  If so desired, DEGADISIN will initiate the procedure under VMS.   If
      not, the program returns  to the operating system.

-------
                                          B-27


         Specification of source parameters.


 (20)    Is this a release of pure (F) or diluted (d) material specified above? 

[2l) Is this a Steady state simulation? Enter the initial mass of pure gas over the source, (kg) (Positive or zero): 0. Source Description The description of the primary source mass evolution rate E and radius Rl for a transient release is input by ordered triples as follows: first point — t-0, E(t-O), Rl(t-O) (initial, nonzero values) second point — t-tl, E(t-tl), Rl(t-tl) last nonzero point — t-TEND, E(t-TEND), Rl(t-TEND) next to last point ~ t-TEND+1.. E-0., Rl-0. last point ~ t-TEND+2., E-0., Rl-0. Note: the final time (TEND) is the last time when E and Rl are non-zero. Do you have an input file for the Source Description? [y or N] Enter the number of triples (max- 30) starting with t-0. and ending with t-TEND+2. for the source description: * Enter TIME (sec), EVOLUTION RATE (kg/s), and FOOL RADIUS (m) 0.,130.,22.06 80.,130.,22.06 81..0..0. 82..0..0. In addition to the information just obtained, DEGADIS requires • series of numerical parameter files which use the same name as [DIR]RUNNAME given above. For convenience, example parameter files are included for each step. They are: EXAMPLE. ER1, EXAMPLE.ER2, and EXAMPLE. ER3 Note that each of th««e files can be edited during the course of the simulation if a parameter proves to be out of specification. [26) Do you want a command file to be generated to execute the procedure? <1 or n> The command file will be generated under the file name: BURR09.com [27) Do you wish to initiate this procedure?


-------
                                    B-28


     The INP files for BURR09S and BURR09 are shown in Figures B.8 and
B.9.  If necessary, the user may edit the INP file before beginning the
simulation.

Example Simulation Output

     BURR09.LIS and BURR09S.LIS contain the output listing for the
transient and steady-state releases, respectively.  A discussion of the
steady-state and transient simulation listings follows.  Because of the
similarities between the steady-state and transient simulation listings,
the first portion of the transient simulation is not included.

-------
Steady-state simulation of BURRO 9
                                             B-29
6.500000 8.000000
3
O.OOOOOOOE+00 O.OOOOOOOE+00
0.10460SO 0.9000000
2.0000000E-02 1.220000
305.8800 0.9400000
0 310.0000
1 O.OOOOOOOE+00
0 O.OOOOOOOE+00
LNG
16.04000 111.7000
S.6000000E-08 5.000000
0.1500000 5.0000000E-02
1.5000000E-02
O.OOOOOOOE+00
4
O.OOOOOOOE+00 130.0000
6023.000 130.0000
6024.000 O.OOOOOOOE+00
6025.000 O.OOOOOOOE+00
F F F t T F
9-JUH-1989 15:55:42.38
130.0000 44.12000
2.0500000E-04


-140.0000
130.0000
4.3809577E-03




1.684480

1.000000



22.06000
22.06000
O.OOOOOOOE+00
0 . OOOOOOOE+00


17.32588





12.50000










1.000000
1.000000
1.000000
1.000000



                                                         111.7000
                                                         111.7000
                                                         111.7000
                                                         111.7000
1.000000
1.000000
1.000000
1.000000
                        Figure  B.8.   BURR09S.INP Listing.
Time-limited simulation of Burro 9
6.500000 8.000000
3
O.OOOOOOOE+00 O.OOOOOOOE+00
0.1046050 0.9000000
2.0000000E-02 1.220000
305.8800 0.9400000
0 310.0000
1 O.OOOOOOOE+00
0 O.OOOOOOOE+00
LNG
16.04000 111.7000
5.6000000E-08 5.000000
0.1500000 5.0000000E-02
1.5000000E-02
O.OOOOOOOE+00
4
O.OOOOOOOE+00 130.0000
80.00000 130.0000
81.00000 O.OOOOOOOE+00
82.00000 O.OOOOOOOE+00
F F F F F F
9-JUN-1989 16:02:24.47
2.0500000E-04


-140.0000
130.0000
4.3809577E-03




1.684480

1.000000



22.06000
22.06000
O.OOOOOOOE+00
O.OOOOOOOE+00







12.50000










1.000000
1.000000
1.000000
1.000000


                                                         111.7000
                                                         111.7000
                                                         111.7000
                                                         111.7000
1.000000
1.000000
1.000000
1.000000
                       Figure  B.9.   BURR09.INP  Listing.

-------
                                    B-30
Notes on Steady-State Simulation of BURR09


(T)   The.date and time DEGADISIN was run are included.

      The input information gathered by DEGADISIN is repeated to assist
      in documentation of the simulations.  Included here are the Title
      Block and the atmospheric conditions.

-------
                                                              B-31
D
D
     Data input on
     Source program run on
                                  UOA   D E G A D I S
                                                          MODEL   OUTPUT

                                                         *  6-SEP-1989 16:05:07.54
                                                                                          VERSION   2.1
9-JUN-1989 15:55:42.38
6-SEP-1989 16:05:07.54
2 )             TITLE BLOCK

     Steady-state simulation of BURRO 9
          Hind velocity at reference height
          Reference height

          Surface roughness length

          Fasquill Stability class

          Monin-Obukhov length
          Gaussian distribution constants
                           Specified averaging time
                                              Delta
                                               Beta
          Wind velocity power law constant
          Friction velocity

          Ambient Temperature

          Surface Temperature
          Ambient Pressure
          Ambient Absolute Humidity
          Ambient Relative Humidity

          Adiabatic Mixing:   Mole fraction

                                0.00000
                                0.00897
                                0.01786

                                0.02669
                                0.04413
                                0.06131

                                0.08657
                                0.11126
                                0.14331
                                              Alpha
                         6.50  m/s
                         8.00  m

                    2.050E-04  m

                       C

                    -140.      m

                         0.00  s
                      0.10461
                      0.90000

                      0.10638
                      0.21878  m/s

                       305.88  K

                       310.00  K
                        0.940  atm
                    4.381E-03  kg/kg BDA
                        12.50  Z
                                              CONCENTRATION OF C
                                                    kg/m*»3
                                                    0.00000
                                                    0.00542
                                                    0.01088

                                                    0.01636
                                                    0.02741
                                                    0.03858

                                                    0.05555
                                                    0.07278
                                                    0.09616
GAS DENSITY
kg/m**3
1.08189
1.08476
1.08771
1.09065
1.09652
1.10235
1.11110
1.11976
1.13126
Enthalpy
J/kg
0 . OOOOOE+00
-2018.3
-4036.6
-6054 . 8
-10091.
-14128.
-20183.
-26238.
-34311.
Temperature
K
305.88
303.89
301.93
299.96
296.16
292.41
286.93
281.62
274.79
                                0.74203
                                0.79281
                                0.84028

                                0.88805
                                0.93269
                                0.97738
                                                    0.86864
                                                    0.98925
                                                    1.11626

                                                    1.26067
                                                    1.41351
                                                    1.58729
                                 41242
                                 45478
                                 49833

                                 24684
                                 59719
                                 65343
-2.4B249E+05
-2.74487E+05
-3.00724E+05

-3.28980E+05
-3.57236E+05
-3.87511E-I-05
160.04
150.27
141.26

132.29
124.01
115.81
                                1.00000
                                                    1.68448
                                                                        1.68448
                                                                                         -4.03657E+OS
                                                                                                               111.70

-------
©
©
                                    B-32
Continuing with the input information, the contaminant gas
properties are output.

The specification of the mass evolution rate, source radius,
contaminant mass fraction, and source temperature are output.  For
a steady-state release, there is no initial mass in the cloud, and
the source parameters are held constant for an arbitrarily large
period of time.

Finally, certain numerical parameters and calculation flags are
displayed.  Some of these are set in DEGADISIN while others are
set in the numerical parameter files.

A summary of the calculated secondary source parameters is
included.  The secondary source gas radius and height are output
as functions of time-along with other secondary parameters
including the source mass flux (Qstar), the vertical concentration
distribution parameter at the downwind edge  (SZ(x - L/2.)), the
contaminant mole fraction (Mole frac C), the gas mixture density
(Density), and the Richardson number based on the cloud spreading
velocity (Rich No.).

For a steady-state release, the source calculations are terminated
after the calculated parameters are no longer changing as a
function of time.  A summary of the steady-state secondary source
is included.

The downwind portion of  the calculations is  included.  The
distance downwind of the source is given in  the first column.
Columns  2 through 6 contain the mole  fraction, contaminant
concentration, mixture density, ratio of  (p  - pa)/cc  (Gamma),  and
mixture  temperature on the centerline of the gas cloud at ground
level.   Columns 7 through 9 contain the contour shape parameters  b
(Half Width), Sz, and Sy.  Finally, columns  10 and  11 contain the
width from the centerline to the  indicated concentration  levels at
the indicated height.  Note that  the  output  is prematurely
terminated.  Output actually continues until the centerline,
ground-level concentration drops  below  the lowest concentration of
interest.

-------
                                                             B-33
            Specified Gas  Properties:

               Molecular  weight:
               Storage temperature:
               Density at storage temperature and ambient pressure:
               Mean heat  capacity constant:
               Mean heat  capacity power:
               Upper mole fraction contour:
               Lower mole fraction contour:
               Height for isopleths:
       16.040
       111.70    K
       1.6845    kg/m**3
      S.60000E-08
       5.0000
      0.15000
      5.00000E-02
       1.0000    m
       Source input data points

                      Initial mass in cloud:
                                               0.OOOOOE+00
Time

s
0. OOOOOE+00
6023.0
6024.0
6025.0
Contaminant
Mass Rate
kg/s
130.00
130.00
0 . OOOOOE+00
0. OOOOOE+00
Source Radiui

m
22.060
22.060
• 0. OOOOOE+00
0. OOOOOE+00
                                                                Contaminant
                                                               Mass Fraction
                                                              kg contam/kg mix
                                                                  1.0000
                                                                  1.0000
                                                                  1.0000
                                                                  1.0000
                Temperature

                     K
                   111.70
                   111.70
                   111.70
                   111.70
  Enthalpy

    J/kg
-4.03657E+05
-4.03657E+05
-4.03657E+05
-4.03657E+05
            Calculation procedure for ALPHA:  1

            Entrainment prescription for PHI:  3

            Layer thickness ratio used for average depth:    2.1500

            Air entrainment coefficient used: 0.590

            Gravity slumping velocity coefficient used: 1.150

            NON Isothermal calculation

            Heat transfer calculated with correlation:  1

            Hater transfer not included
                                                        CALCULATED SOURCE PARAMETERS
©
©
Time Gas Radius
sec m
O.OOOOOOE+00
1.93242
7.25031
22.0600
22.1998
22.2263
iource strength [kg/s] :
Iquivalent Primary source
Height
m
1.100000E-05
1.304959E-03
1.331373E-03
length [m] :
Qstar
kg/m**2/s
8
8
8

.329550E-02
.367377E-02
.375806E-02
130 . 00
44.120
SZ(x-L/2.)
m
0.498870
0.508692
0.510725
Equivalent
Equivalent
Mole frac C
1.00000
0.999937
0.999935
Primary source
Primary source
Density Temperature
kg/m**3 K
1.68448
1.66670
1.66315
radius [m] :
half-width [m]
111.
112.
113.

,700
.897
.139
22.060
17.326
Rich No
0.
0.
0

.756144
.756144
.756144

       Secondary source concentration  [kg/m**3]

       Contaminant flux rate:   8.37642E-02
                                                     1.6630
Secondary source SZ [m]
                                                                                                               0.51072
       Secondary source mass fractions... contaminant:  0.999884
                  Enthalpy:  -4.00663E+05      Density:    1.6631
      air:   1.15782E-04
       Secondary source length  [m]
                                                     44.453
Secondary source half-width [m]
                                                                                                                 17.457
Distance
(m)
22.2
22.5
25.2
Mole
Fraction
0
0
1.00
.998
.980
Concentration
(kg/m**3)
1.66
1.65
1.58

Density
(kg/m**3)
1.6631
1.6570
1.6061

0
0
0
Gamma
.350
.348
.332
Temperature
(K)
113.
114.
119.
Half
Width
(m)
17.5
16.7
15.9

0
0
0
Sz
(m)
.511
.510
.504
                                                                                                    Sy     Width at z-  1.00 m to
                                                                                                         5.00    moleZ  15.0    m
                                                                                                    (m)         (m)        (m)

                                                                                                 O.OOOE+00   17.5       17.5
                                                                                                 0.948       18.0       17.5
                                                                                                  3.05       20.0       18.3

-------
                                    B-34
Notes on Transient Simulation Output of BURR09


(6j   A summary of the calculated secondary source parameters is
      included.  The secondary source gas radius and height are output
      as functions of time along with other secondary parameters
      including the source mass flux (Qstar), the vertical concentration
      distribution parameter at the downwind edge (SZ(x — L/2.)), the
      contaminant mole fraction (Mole frac C), the gas mixture density
      (Density), and the Richardson number based on the cloud spreading
      velocity  (Rich No.)-  Note that only a portion of the output is
      shown.  The source calculation ends when all the primary and
      secondary source gas has been taken up in the atmospheric flow.

-------
                                                          B-35
©
CALCULATED SOURCE PARAMETERS


0.
7.
1.
2,
4,
6.
7
1
5
Time
sec
OOOOOOE+00
.812500E-05
.562500E-04
.995998E-04
.429495E-04
.200244E-04
.970994E-04
.302401E-03
.584851E-03
Gas Radius

22.
22.
22.
22.
22.
22.
22.
22.
22.
m
0600 '
0600
0600
0600
0600
0600
0600
0600
0601
Height

1.
1.
1.
1.
1.
1.
1.
1.
1.
m
100000E-05
108054E-05
116108E-05
130885E-05
145663E-05
163917E-05
182171E-05
234260E-05
675684E-05
Qatar
SZ(x-L/2.)
k8/m**2/s
8
8
8
8
8
8
8
8
8
.329550E-02
.329550E-02
.329550E-02
.329549E-02
.329549E-02
.329548E-02
. 32954 8E-02
.329547E-02
.329537E-02
0
0
0
0
0
0
0
0
0
m
.498870
.498870
.498870
.498870
.498870
.498870
.498870
.498870
.498870
le frac C

1.00000
1.00000
1.00000
1.00000
1.00000
1.00000
1.00000
1.00000
1.00000
Density
kg/m**3
1.68448
1.68448
1.68448
1.68448
1.68448
1.68448
1.68448
1.68448
1.68448
Temperature
K
111.700
111.700
111.700
111.700
111.700
111.700
111.700
111.700
111.700
Rich No.

0.756144
0.756144
0.756144
0.756144
0.756144
0.756144
0.756144
0.756144
0.756144
9.775356E-02
0.134816
0.184839
0.251490
0.355980
0.523614
1.15444
1.47042
1.79110
2.07986
36.8751
79.9765
80.0499
80.0918
80.3716
80.6057
80.7910
80 . 8842
80.9319
80.9590
80.9750
80.9846
80.9904
80.9939
80.9964
80.9978
80 . 9986
80 . 9992
80.9995
80.9998
80.9999
81.0000
81.0000
22 . 0620
22.0631
22.0649
22.0676
22.0726
22.0821
22.1288
22.1565
22.1863
22.2139
22.2250
22.2283
21 . 8594
21.1203
15.7908
11.3499
7.57905
5.36474
3.99387
3.04157
2.34519
1.82960
1.44346
1.15560
0.900469
0.714082
0.582421
0.462480
0.384735
0.308874
0.251972
0.217901
0.199541
1.
1.
1.
2.
3.
5.
9.
1.
1.
1.
1.
1.
1.
1.
1.
8.
5.
4.
3.
2.
1.
1.
1.
9.
7.
5.
4.
3.
3.
2.
2.
1.
1.
112523E-04
488579E-04
991522E-04
652104E-04
662174E-04
206466E-04
974017E-04
162954E-03
2746S1E-03
324084E-03
345084E-03
370607E-03
392848E-03
375235E-03
086S61E-03
196970E-04
692027E-04
112889E-04
084351E-04
356705E-04
820257E-04
421910E-04
123626E-04
016800E-05
055920E-05
630183E-05
629137E-05
725033E-05
146655E-05
594198E-05
196174E-05
971995E-05
859155E-05
8.330184E-02
8.330547E-02
8.331114E-02
8.331988E-02
8.333587E-02
8.336356E-02
8.348547E-02
8.355603E-02
8.363808E-02
8.371218E-02
8.369677E-02
8.375954E-02
8.688047E-02
9.024113E-02
0.110060
0.132618
0.157312
0.174600
0.186437
0.195637
0.203107
0.209143
0.213940
0.217575
0.220619
0.222380
0.222961
0.222315
0.220537
0.216437
0.209942
0.203099
0.197788
0.499023
0.499110
0.499247
0.499457
0.499841
0.500537
0.503776
0.505664
0.507764
0.509677
0.509883
0.510787
0.535701
0.548069
0.530173
0.486207
0.408026
0.334241
0.273428
0.223938
0.183421
0.150660
0.124304
0.103447
8.393002E-02
6.893466E-02
5.789226E-02
4.744542E-02
4.044054E-02
3.339515E-02
2.794875E-02
2.460883E-02
2.278038E-02
0 . 999998
0 . 999998
0.999996
0 . 999994
0.999991
0.999984
0.999959
0.999948
0.999940
0.999936
0.999934
0.999933
0.999932
0.999933
0.999954
0.999969
0.999979
0.999984
0 . 999987
0 . 999990
0.999991
0 . 999992
0.999993
0 . 999994
0 . 999994
0 . 999995
0.999995
0 . 999995
0 . 999995
0.999995
0 . 999995
0 . 999995
0 . 999995
1.
1.
1.
1.
1.
1.
1.
1.
1.
1.
1.
1.
1.
1.
1.
1.
1.
1.
1.
1.
1.
1.
1.
1.
1.
1.
1.
1.
1.
1.
1.
1.
1.
68419
68403
68377
68338
68266
68137
67548
67209
66834
66496
66475
66299
60926
57472
48958
41975
36527
33743
32770
32331
32103
31932
31719
31406
30850
30040
28998
27292
25354
22064
17617
13276
10028
111
111
111
111
111
111
112
112
112
113
113
113
'116
119
126
132
137
140
141
142
142
142
142
143
143
144
145
147
150
154
159
166
171
.719
.730
.747
.774
.822
.908
.304
.532
.786
.015
.030
.149
.927
.492
.319
.531
.818
.686
.717
.187
.432
.617
.848
.188
.796
.691
.861
.816
.101
.147
.974
.105
.009
0.756144
0.756144
0.756144
0.756144
0.756144
0.756144
0.756144
0.756144
0.756144
0.756144
0.756144
0.756144
0.756144
0.756144
0.756144
0.756144
0.756144
0.756144
0.756144
0.756144
0.756144
0.756144
0.756144
0.756144
0.756144
0.756144
0.756144
0.756144
0.756144
0.756144
0.756144
0.756144
0.756144

-------
(?)
(9)
                              B-36
An indication of the constants used in the x-direction dispersion
correction is included.  The output will also indicate if the
x-direction dispersion correction was not applied.

The concentration field is shown for different times after the
beginning of the spill.  Unless otherwise specified, DEGADIS will
choose default values for the time to output the concentration
field.  If other times are desired, DEGADIS3 can be executed again
after the appropriate changes to RUN_NAME.ER3 have been made.

The downwind portion of the calculations is included.  The
distance downwind of the source is given in the first column.
Columns 2 through 6 contain the mole fraction, contaminant
concentration, mixture density, ratio of (p - pa)/cc (Gamma), and
mixture temperature on the centerline of the gas cloud at ground
level.  Columns 7 through 9 contain the contour shape parameters b
(Half Width), Sz, and Sy.  Finally, columns 10 and 11 contain the
width from the centerline to the indicated concentration levels at
the indicated height.  Note that the output is prematurely
terminated .

-------
                                                              B-37
©
Sorted values for each specified time.

X-Direction correction was applied.
     Coefficient:        2.00000E-02
     Power:               1.2200
     Minimum Distance:    130.00     m
8 ) Time after beginning of spill 12.00000 sec
9 V Distance Mole Concentration Density Gamma
•— ' Fraction
(m) (kg/m**3) (kg/m**3)
31.2 1.03 1.29 1.2269 0.113
44.8 0.757 0.804 1.2680 0.232
58.6 0.500 0.425 1.1880 0.250
72.7 0.152 0.100 1.1046 0.227
For the UFL of 15.000 mole percent, and the LFL

Temperature
(K)
166.
182.
222.
281.
of 5.0000

Half
Width
(m)
14.8
15.4
14.0
6.89
mole

Sz
(m)
0.572
0.589
0.602
0.777
percent:

Sy
(m)
5.37
8.97
11.3
11.3


Width at z"
5 . 00 moleZ
(m)
22.2
26.3
24.5



1.00 m to:
15.0 mole
(m)
19.4
20.4


The mass of contaminant between the UFL and LFL is: 89.846 kg.
The mass of contaminant above the LFL is: 641.91 kg.
Time after beginning of spill 23.00000 sec
Distance Mole Concentration Density Gamma
Fraction
(m) (kg/m**3) (kg/m**3)
29.0 1.06 1.38 1.2314 0.108
42.6 0.888 1.05 1.2857 0.195
56.4 0.759 0.842 1.3227 0.286
70.4 0.684 0.686 1.2564 0.254
84.7 0.596 0.543 1.2040 0.225
99.1 0.429 0.337 , 1.1457 0.189
114. 0.235 0.163 1.1145 0.201
129. 6.338E-02 3.939E-02 1.0875 0.143
For the UFL of 15.000 mole percent, and the LFL
The mass of contaminant between the UFL and LFL is:
The mass of contaminant above the LFL is: 2105.8
Time after beginning of spill 34 . 00000 sec
Distance Mole Concentration Density Gamma
Fraction
(m) (kg/m**3) (kg/m**3)

Temperature
(K)
163.
168.
172.
190.
209.
239.
268.
296.
of 5.0000
359.47 kg.
kg.

Temperature
(K)
26.9 1.10 1.45 1.2190 9.445E-02 162.
40.4 0.912 1.09 1.2781 0.180 167.
54.1 0.778 0.871 1.3185 0.272 171.
68.1 0.697 0.710 1.2658 0.259
82.4 0.620 0.576 1.2130 0.228
96.8 0.544 0.468 1.1756 0.200
187.
205.
220.

Half
Width
(m)
14.8
14.7
16.0
17.5
18.7
18.6
14.7
5.46
mole


Ealf
Width
(m)
15.0
14.6
15.7
17.3
18.5
19.5

Sz
(m)
0.568
0.630
0.662
0.706
0.777
0.896
1.10
1.47
percent :


Sz
(m)
0.553
0.623
0.657
0.695
0.760
0.844

Sy
(m)
4.57
8.28
11.2
13.7
16.2
18.6
19.6
17.7



Sy
(m)
3.80
7.77
10.7
13.3
15.8
18.2

Width at z-
5.00 moleZ
(m)
21.1
26.0
30.6
35.0
38.9
39.5
31.8



Width at z-
5.00 moleZ
(m)
20.3
25.2
29.9
34.4
38.3
41.8

1.00 m to:
15.0 mole,
(m)
18.8
21.6
24.4
26.8
28.8
24.6




1.00 m to:
15.0 moles
(m)
18.3
21.2
23.9
26.5
28.6
30.3

-------
                                    B-39


     In addition to the output of the concentration field at specified
times (from DEGADIS3), DEGADIS allows for transient releases output of
concentration time histories at specified positions using DEGADIS4.
DEGADIS4 can be executed interactively or in batch mode.  An example
DEGADIS4 interactive run and output follow.

-------
                                    B-40


Notes on Using DEGADIS4
©

©
DEGADIS4 can be run interactively as demonstrated here or in batch
mode by supplying the same responses demonstrated here.  DEGADIS4
sends the output to RUN_NAME.SR4.

The RUN_NAME of the transient simulation is used here.

The number of downwind positions where output is desired is
entered here.  For each downwind distance, questions 4 and 5 are
required.

The x-coordinate is the downwind distance from the source where
output is desired.

At each downwind distance, DEGADIS4 asks for the y- and
z-coordinates desired.  DEGADIS4 automatically supplies
information about the centerline concentration (y - 0 and z — 0).
Note that negative numbers signal that no more positions are
desired for this particular downwind distance.

-------
                              B-41
Enter the file name used for this run:  BURR09
Enter the number of downwind distances  desired:
 max of           10 downwind distances;  * positions at each distance
1

enter the z coordinate:
100.
  enter the y and z coordinate pairs at this distance:
0..1.
30. ,1.
 tl:    18.000
FORTRAN STOP
                    tf:
                           99.263
                                       dt:
                                              2.0000
                                                         dist:
                                                                   100.00

-------
                                    B-42


Notes on DEGADIS4 Output


(l)   DEGADIS4 indicates the constants used in the x-direction
      dispersion correction.  The user has the option of not making the
      x-direction dispersion correction if desired by making the
      appropriate changes to RUN_NAME.ER3.

(2J   At each downwind distance specified, the concentration profile
      parameters are output as a function of time.  Note that part of
      the output has been removed.

(V)   DEGADIS4 outputs the concentration time history at the off-
      centerline positions specified.

-------
                                                                B-43
0
X-Direction correction was applied.
     Coefficient:        2.00000E-02
     Power:               1.2200
     Minimum Distance:    130.00     m

Centerline values for the position —>
 100.00     m
Time
(s)
20.0
22.0
24.0
26.0
28.0
30.0
32.0
34.0
Mole
Fraction
0.264
0.370
0.455
0.506
0.529
0.529
0.529
0.530
Concentration
(kg/m**3)
0.192
0.282
0.367
0.426
0.451
0.449
0.450
0.452
Density
(kg/m**3)
1.1202
1.1350
1.1525
1.1652
1.1714
1.1678
1.1704
1.1706
Gamma
0.203
0.185
0.191
0.194
0.197
0.191
0.196
0.195
Temperature
(K)
264.
248.
235.
227.
223.
224.
223.
223.
Half
Width
(m)
13.4
17.0
18.9
19.4
19.6
19.6
19.6
19.6
Sz
(m)
0.984
0.931
0.899
0.880
0.868
0.867
0.868
0.868
sy
(m)
17.2
18.3
18.7
18.7
18.6
18.6
18.6
18.6
Width at z-
5.00 moleZ
(m)
28.8
36.5
40.7
42.1
42.5
42.5
42.5
42.5
1.00 m
15.0
(m)

27.2
29.9
30.7
30.6
30.6
30.7
to:
moleZ



      90.0
      92.0
      94.0

      96.0
       0.530
       0.531
       0.529

       0.514
0.452
0.453
0.448

0.431
1.1694
1.1702
1.1678

1.1637
             0.193
             0.194
             0.191

             0.189
223.
223.
224.

226.
19.6
19.6
19.6

19.B
0.869
0.869
0.869

0.880
18.6
18.6
18.7

18.9
42.5
42.5
42.5

42.9
30.7
30.8
30.7

30.6
               Time

               (s)
            18.00000
            20.00000
            22.00000

            24.00000
            26.00000
            28.00000
                                  Mole fraction at:
                                                   Mole fraction at:
                         y
                         z-
  O.OOOOOE+00
   1.0000
0,00000001+00
0.1086350
0.1464779

0.1790154
0.1992250
0.2065024
                    y-
                    Z-
                                       30.000
                                       1.0000
                                    O.OOOOOOOE+00
                                    4.4177441E-02
                                    9.1616339E-02

                                    0.1299436
                                    0.1492197
                                    0.1560519
                        Mole fraction at:
                        y-   -1.0000
                        z-   -1.0000
                                       Mole fraction at:
                                       y-   0.OOOOOE+00 m
                                       z-   O.OOOOOE+00 m
            30.00000
            32.00000
            34.00000
                            0.2052136
                            0.2060279
                            0.2068415
                          0.1552692
                          0.1555801
                          0.1560749
            90.00000
            92.00000
            94.00000
                            0.2070588
                            0.2075295
                            0.2058755
                          0.1563020
                          0.1565798
                          0.1559159
            96.00000
                                     0.2017301
                                                               0.1552051

-------
                                    C-3

        Program jetplu_in
c
c
c       JETPLU_IN is designed to perform two tasks including:
c
c       a) Read the input file for the JETPLU/DEGADIS model input.  From
c       this information, JETPLIMN prepares the necessary file to run the
c       JETPLU/DEGADIS model.
c
c       b) Generate a command file to execute the JETPLU/DEGADIS model from
C       the input information.  This portion is highly dependent on the
c       VAX/VMS environment because of the manipulation of character strings
c       and the instructions necessary to invoke the VAX/VMS commands.
c
c	
c
c       This program can be  invoked interactively or in a command file
c       submitted to batch.  For either case, the syntax is:
c
c       $ RUN SYSSDEGADIS:JETPLU_IN
c       RUN_NANE
c
c       where RUN_NAME  is the file name given to the particular simulation.
c       The input file  RUN_NAME.IN is to be created before this program
c       is  invoked  using free formats.  The order of input is as  follows:
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       Note that for readability, blank  lines  were  inserted between  the

1  --  sys$degadis:jetplu_in.for                  6-SEP-1989  19:57:57

-------
                                    C-4

c       input sections specifying a simulation title, atmospheric conditions,
c       gas properties, and the particular release conditions.   Symbol
c       definitions are as follows:
c
c       , , ,  and  are four lines of up
c               to 80 characters each  of a title for this simulation.
c
c        (m/s) is the ambient wind velocity at  (m).
c
c        is the surface roughness (m).
c
c        is an indicator which determines the method of calculation
c               for the ambient velocity profile in the jet/plume model as
c               follows:
c
c               For =1, the PasquiU-Gifford stability category
c                  (in  using 1 for A, 2 for B, etc.) is used
c                  along with  to determine the Monin-Obukhov length
c                  ; the log velocity profile is then determined
c                  using .
c
c               For =2, the Monin-Obukhov length  is supplied
c                  by  the user; the log velocity profile is then determined
c                  using .  Note that  must still be specified.
c
c       , , and  are  the ambient temperature (1C),  the
c               ambient pressure (atm or  N/m**2), and the  relative  humidity (%),
c                respectively.
c
c         is the surface  temperature (K);  if   < 250 K,   is
c                set  to .
c
c         is  a three-letter designation for  the contaminant's name.
c                Any  character  string  of three  letters or  less  is valid;  this
c                is for user  run identification and  does not access  property
c                data.
c
 c         is the contaminant's  molecular weight  (kg/kmole).
 c
 c        is  the averaging  time (s).   This parameter is
 c                used to estimate the  value of  .
 c
 c        is  the temperature of the jet (K).
 c
 c        and  are the concentrations to be used for estimating
 c                contours for an upper and lower concentration level in
 c                DEGADIS.   The calculations are made for  the elevation
 c                .  Note that  the JETPLU/DEGADIS computations will be carried
 c                out  to /2.
 c
 c        is used to include heat transfer in the  DEGAOIS computations.

 2  -- sys$degadis:jetplu_in.for                 6-SEP-1989 19:57:57

-------
                                    C-5

c               Heat transfer is not included for =0.   For =1,
c               heat transfer is included,  and the heat transfer coefficient
c               is calculated by DEGADIS.   and  are used to
c               calculate the heat capacity as a function of
c               temperature according to the correlation included in
c               DEGADIS.  If a constant heat capacity is
c               desired, set  to 0.  and  to the desired heat
c               capacity (J/kg K).
c
c         is used to specify the contaminant density profile.
c               There are three cases for :
c
c                = -1; The simulation treats the contaminant as if
c                       it were an ideal  gas with a molal heat capacity
c                       equal to that of  air.  Water condensation effects
c                       are ignored,  (equivalent to ISOFL=1  in DEGADIS)
c
c                = 0;  The simulation treats the contaminant as if
c                       it were an ideal  gas with the heat capacity indicated
c                       by  and .  Water condensation effects
c                       are taken into account as appropriate.
c                       (equivalent to ISOFL=0 in DEGADIS)
c
c                > 0;  specifies the number of triples which follow
c                       in the next  lines.  The triples are used to
c                       specify the contaminant concentration as a function of
c                       density based on adiabatic mixing with ambient air.
c                       The ordered triples represent (in order):
c                         (1) the contaminant mole fraction
c                         (2). the contaminant concentration (kg contam/m3 mix)
c                         (3) the mixture density (kg mixture/m3 mixture)
c                       The ordered triples must go from pure air to pure
c                       contaminant,  (equivalent to ISOFL=1  in DEGADIS)
c
c        is  the mass evolution (release) rate (kg/s).
c
c         is the inital  jet elevation (m); the minimum jet elevation
c               is  twice  the surface roughness.   is the  initial
c               jet diameter (m).
c
c         is the duration  of the primary release  (s).  For steady-state
c               releases, set  to  0.; to  run the  jet/plume model only, set
c                to a negative number.
c
c         is the maximum distance between output  points  in  the  JETPLU
c               output  (m).
c
c	
c
c       T. Spicer
c       University  of Arkansas

3  •• sys$degadis:jetplu_in.for                 6-SEP-1989 19:57:57

-------
                                    C-6

c       Department of Chemical Engineering
c       Fayetteville, AR 72701
c
c       (501) 575-4951
c
c	
c

        Implicit Real*8 ( A-H, 0-Z ), Integer*^ ( I-N )

        include 'sys$degadis:DEGADISIN.dec-

        dimension DEN(5,igen)

C
        data vkc/0.3500/
C
        logical check4
c
        character*80 TITLEC4)
C
        character's gas_name
C
        character*!00 OPNRUP
        character OPNRUPK100)
        equivalence (opnrupU1},opnrup)
        character*^ IN,er1>er2,er3(com>scl,sr3>lis
        character*^ dummy
        character's plus, gasnam
        character*? con
        DATA POUND/1//   '/.POUNDN/-1.E-20/
C
        DATA IN/'.IN  '/,er1/'.er1'/.er2/'.er2l/,er3/l.er31/
        data scl/'.scl'/.srS/'.srS'/,lis/'.lis1/
        data com/1.com1/
        data plus/' + '/.con/1  -'/
c
C...  GET  THE FILE  NAME TO BE  USED BY ALL  OF THE ROUTINES	
C
        READ(5,820)  NCHAR.opnrup
        opnrup =  opnrup(1:nchar) //  in(1:4)
C
C...  Now  get the  rest of the desired information  from RUNJIAME.IN
C
        open(unit=8,name=opnrup,type='o I d')

         read(8,8000) titled)
         read(8,8000) title(2)
         read(8,8000) title(3)
         read(8,8000> title(4)
  8000   format(a80)

 4 ••  sys$degadis:jetplu_in.for                 6-SEP-1989 19:57:57

-------
                                    C-7

 8010   format(a3)
        readC8.*> uO,  zO
        read<8,*> zr

        read(8,*) indvel,  istab, rml
c
c... Based on INDVEL,  set the Monin-Obukhov length as desired.   Also,
c       calculate USTAR
c
        if( indvel.ne.1 .or. indvel.ne.2) indvel = 1
        if( istab.le.O .or. istab.gt.6) istab = 4
        if(indvel .eq. 1) then
                if(istab.eq.l) then
                        rml = -11.43DO * zr**0.103DO
                else if(istab.eq.2) then
                        rml = -25.9800 * zr**0.171DO
                else if(istab.eq.3) then
                        rml = -123.4DO * zr**0.304DO
                else if(istab.eq.4) then
                        rml = O.ODO
                else if(istab.eq.S) then
                        rml = 123.4DO * zr**0.304DO
                else if(istab.eq.6) then
                        rml = 25.98DO * zr**0.171DO
                endif
        endif
        ustar = uO*vkc/(dlog«zO+zr)/zr) • psif(zO.rml))
        read(8,*) tamb, pamb, relhum

        if( tamb.le.O. ) tamb = tamb+273.15DO
        if( pamb.gt.1.1 ) pamb = pamb/101325.DO
        if( relhum.It.0. .or. relhum.gt.100. ) relhum = 50.
c
c... Calculate the  absolute humidity HUMID
c
        vaporp = 6.0298D-3* exp(5407.DO*(1.DO/273.15DO - 1.DO/tamb))
        sat = 0.622DO*vaporp/(pamb - vaporp)
        humid » relhum/100.00 * sat

        read(8,*) tsurf
        if( tsurf.It.250. ) tsurf = tamb

        read(8,8010) gasnam
        read(8,*) gasmw
        read(8,*) avtime
        read<8,*) TEMJET
        read(8,*) gasul, gasll, zll
        if( gasll.le.O. ) gasll = 0.01
        if( gasul.le.gasll ) gasul = dmaxK  1.1DO*gasll, 1.0DO)

5  -- sys$degadis:jetplu_in.for                 6-SEP-1989  19:57:57

-------
                                    C-8
c
c... Now that AVTIME has been set,  the value of DELTAY can be fixed.   Also
c       set the values of BETAY, DELTAZ,  BETAZ, and GAMMAZ
c
        goto(161.162,163,164,165,166) istab
 161    timeav = dmaxK avtime, 18.4DO)                 !  A
        deltay = 0.423DO*(time8V/600.DO)**0.2DO
        betay = 0.9DO
        deltaz = 107.6600
        betaz  = -1.717200
        gammaz = 0.277000
        goto 170
 162    timeav » dmaxK avtime, 18.400)                 !  B
        deltay * 0.313DO*(timeav/600.DO)**0.2DO
        betay =0.900
        deltaz = 0.135500
        betaz  = 0.875200
        ganmaz = 0.013600
        goto 170
 163    timeav * dmaxU avtime, 18.400)                 !  C
        deltay * 0.210DO*(timeav/600.DO)**0.2DO
        betay - 0.900
        deltaz = 0.0962300
        betaz  = 0.947700
        gammaz & -0.002000
        goto 170
 164    timeav = dmaxU avtime, 18.300)                 !  0
        deltay * 0.136DO*Ctimeav/600.DO)**0.2DO
        betay = 0.900
        deltaz = 0.0413400
        betaz  - 1.173700
        ganmaz * -0.031600
        goto 170
 165    timeav = dmaxK avtime, 11.400)                 !  E
        deltay = 0.102DO*(timeav/600.DO)**0.2DO
        betay =* 0.900
        deltaz = 0.0227500
        betaz  = 1.301000
        gammaz = -0.045000
        goto 170
 166    timeav = dmaxK avtime, 4.600)                  !  F
        deltay = 0.0674DO*(time8V/600.00)**0.2DO
        betay = 0.9DO
        deltaz = 0.01122DO
        betaz  = 1.402400
        gammaz = -0.054000
 C
 170    continue
 6 --  sys$degadis:jetplu_in.for                 6-SEP-1989 19:57:57

-------
                                    C-9

c... Recover INDHT, CPK,  and CPP.   If CPP is set  to 0,  then CPK  contains.
c       the (constant) heat capacity.
c
        read<8,*) indht,  CPK, cpp
        if(cpp .eq. O.DO) then
                cpp = 1.DO
                CPK - CPK*gasmw -  3.33D4
        endif
c
c... recover NDEN and set ISOFL and DEN accordingly.
c
        read(8,*) nden
        if(nden .It. -1) nden*-1
        if(nden  .eq. -1) then
                 isofl = 1
                 rhoe = pamb*10l325.DO*gasmw/8314.DO/TEMJET
                 rhoa = panto*
                    (1.DO*humid)/(0.002833DO + 0.004553DO*hunid)/tamb
                 dend.1) = O.DO
                 den(2,1) = O.DO
                 den(3,1) = rhoa
                 den<4,1> = O.DO
                 den(5.1) = tamb
                 den(1,2) - 1.DO
                 den<2,2) « rhoe
                 den<3,2) = rhoe
                 den<4,2) = O.DO
                 den(5,2) « tamb
        else  if(nden  .eq. 0) then
                 isofl * 0
        else
                 isofl = 1

                 do  iii = 1,nden
                 read(8,*) den(1,iii), den(2,iii), den(3,iii)
                 den(4,iii) = O.DO
                 den(5,iii) = tamb
                 enddo
        endif

        ndenO  =  nden
        if(nden  .eq. -1) ndenO = 2
         read(8,*) erate
         read(8,*> elejet. DIAJET
         if(elejet .It. 2.DO*zr) then
            elejet = 2.DO*zr
            write(6,*) 'JETPLU_IN: ELEJET has been increased to:  ',elejet

 7 -• sys$degadis:jetplu_in.for                 6-SEP-1989 19:57:57

-------
                                     C-10

        endif
        read<8.*> tend
        checkA = .true.
        if(tend .gt. 0.) checkA = .false.

        read(8,*) distmx
c
c... It is  time to prepare the input file  for  the JETPLU model	
c
        opnrup = opnrup(1:nchar) // '.ino1
        open(unit=1,namesopnrup,types'new1>

        writed,603) titled)
        writed,603) title(2)
        write(1,603) title(3)
        urite(1,603) title(4)
c
c... atmospheric parameters
c
        writed,*) uO,  zO
        writed,*) zr
        writed,*)  istab,  rml, ustar
        writed,*)  tamb, pamb, humid, re I hum,  tsurf
        writed,*) avtime, deltay, betay
        writed,*) deltaz, betaz, gamnaz
c
c... contaminant parameters
c
        writed,*)  gasmw
        writed,*)  temjet
        writed,*)  gasul,  gasll,  zll
        writed,*)  CPIC, cpp
        writed,*)  nden, ndenO
           ifCndenO .gt. 0)  then

                do iii » l.ndenO
                writed,*) 
-------
                                    Oil

        writed,*) distmx
 603    format(a80)
        close(unit=1)

c
c... Now, prepare the command file	
c
C
C... FORMATS
C
  820   FORMAT(Q,A40)
C
c
 1210   format(a4)
        opnrup = opnrup(1:nchar) // com(1:4)
c
        open(unit=8,name*opnrup,type='neHI,
     $ carriagecontrolz'list'.recordtypes'variable1)
c*** Lines to start the jet/plume model and invoke DEGBRIDGE
c
        opnrup = opnrup(1:nchar) // '.ino forOO!1
        write(8,1100) (opnrup1(i),i=1,nchar*11)
 1100   formates assign ',51a1)
        opnrup = opnrup(1:nchar) // '.out for003'
        write(8,1100) (opnrup1(i),i=1,nchar+11>
        opnrup = opnrup(1:nchar) // '.ind forOOZ1
        write(8,1100) (opnrup1(i),i=1,nchar+11)
        write(8,1160)
 1160   formatCS run sysSdegadis: jetplu1)
        write(8,1170)
 1170   formatCS deassign forOOl ',/,'$ deassign forOOZ1,/,
            '$ deassign for003')

c
c... Bypass DEGBRIDGE if this  is  an "JETPLU only" run
c
        if(tend  .It. 0.) goto  3000
        write(8.1180)
 1180   formatCS run sysSdegadis:degbridge1)
        write(8,1290) (opnrupl(i),i=1,nchar)
c
c
c
c
        opnrup » opnrup(1:nchar)  // er1(1:4)
c
        write(8,1250) (opnrupUi), i=1,nchar+4)
 1250   formates copy/log SYS$OEGADIS:example.er1 ',40a1)

9  •- sysSdegadis:jetplu_in.for                6-SEP-1989 19:57:57

-------
                                    C-12

        IF(uO -eq.  0.)  then
                urite(8,1280)
                write(8,1290)  (opnrupHi).i=1.nchar)
                goto 1340
                endif
        opnrup = opnrup(1:nchar) //  er2(1:4)
c
        write(8,1260) (opnrupKi),i=1,nchar+4)
 1260   formates copy/log SYSSDEGAOIS:example.er2  -,40a1)
        opnrup = opnrup(1:nchar) //  er3(1:4)
c
        if(.not.check4) then            I transient
c
                write(8,1270>  (opnrupKi),i=1,nchar+4)
 1270           formates copy/log SYS$DEGADlS:example.er3 ',40a1>
c
                write(8,1280)
 1280           formates run  SYS$DEGAOIS:DEGAOIS1>)
                write(8,1290)  (opnrupKi),i*1,nchar)
 1290           format<40a1)
                write(8,1300)
 1300           formatCS run  SYS$OEGADIS:DEGAOIS2')
                write(8,1290)  (opnrup1(i),i=1,nchar)
                urite(8,1320)
 1320           formates run  SYSSDEGAOIS:DEGADIS3')
                urite(8,1290)  (opnrup1(i),i=1,nchar)
c
        else
                write(8,1280)
                write(8,1290)  (opnrupKi),i=1,nchar)
c
                urite(8,1330)
 1330           formates run SYSSOEGAOIS:SDEGADIS2')
                write(8,1290)  (opnrupH i), i=1 ,nchar)
c
        endif

        opnrup - opnrup(1:nchar) // '.out'  //
                plus(1:3) //opnrup(1:nchar) // scl(1:4) //
                plus(1:3) // opnrup(1:nchar) // sr3(1:4) //  con(1:2)
        write(8,1370)  (opnrup1(i),i=1,3*nchar+20)
  1370   formates  copy/log  ',100a1)
        opnrup = opnrup(1:nchar) // lis(1:4)
        write(8,1390)  (opnrup1(i),i=1,nchar+4)
  1390   formate   ',40aD
 c
  1340   close(unit=8)

  3000   continue
        write(6,2099>
  2099   formate/,1 JETPLUJN  - beginning command file.1)

10 -- sys$degadis:jetplu_in.for                 6-SEP-1989 19:57:57

-------
                                    C-13

        opnrup = '3' // opnrup<1:nchar)  //  '  '
        istat = Iib$do_conmand(opnrup)
        write(6,2100)
 2100   formate/,1 ?JETPLU_IN? command file failed to start.')
c
        CALL EXIT
        END
11  --  sys$degadis:jetplu_in.for                 6-SEP-1989 19:57:57

-------
                                   C-1A

        PROGRAM JETPIUJMIN
C
c	-	
c
c       This program calculates the trajectory and dilution of a steady
c       gas jet released at right angles to the wind.  The zone before Gaussian
c       profiles can be assumed for the velocity and concentration profiles
c       is termed the zone of flow establishment; calculations for this zone
c       are done in the routine SETJET.  The zone after Gaussian profiles can
c       be assumed to apply is termed the zone of established flow.  The
c       ordinary differential equations describing this zone are included in
c       MODEL; these are integrated with the routine RKGST.  Interactions
c       between the jet/plume and the ground are accounted for using the method
c       of images.
c
c	
c
c       T. Spicer
c       University of Arkansas
c       Department of Chemical Engineering
c       Fayetteville, AR  72701
c
c       501-575-6516
C
C
        Implicit real*8(a-h,o-z), integer*4(i-n)
c
        include  •sysSdegadis:DEGADISl.decl
c
        external model.modout

        character*80  title(4)
        character*26  tinp
        character*!   stabiI(6)

        dimension  print(6)
        dimension  aux(8,6)

        DIMENSION  YR(6),dYR(6)

         common
      ./GEN2/ DEN<5,igen>
      ./parm/ uO.zO.zr, rail,ustar,vkc,gg.rhoe.rhoa,deltay,betay,gammaf,
                 cclow
      ./com_gprop/ gasjnw,gas_temp,gas_rhoe.gas_cpk,gas_cpp,
      .  gas_ufl,gas_lfl,gas_zsp,gas_name
      ./comatm/ istab,tamb.pamb,humid,isofI,tsurf,ihtfl.htco,iwtfl.wtco,
      .  humsrc
      ./PHYS/ DA, deltaz,betaz,gammaz,rho, temp,yc
      ./COEFF/ ALFA1.ALFA2, sc.cd.delta
      ./rks/ rk1,rk2,rk3,rk4,rk5,rk6, rate,totrte,xmo,zmo

 1 -- sys$degadis:jetplu_main.for               6-SEP-1989 19:45:29

-------
                                     C-15
     ./sys/ sysz,sy,sz,sya,sza
     ./Ifl/ cufl. clfl
        character's gas_name

        data  vkc/0.35DO/
        data  gg/9.81DO/

        data  sc/1.4200/
        data  cd/0.2DO/
        data  delta/2.15DO/

        data  stabil/'AVB'.'C'.'D'.'E1,'F'/

c
C
C... READ IN  DATA FROM  FOR001.DAT  	
        OPEN 
-------
                                    C-16

        readd,*) erate
        QINIT = erate/rhoe
        readd,*) elejet,  diajet

        READ(1.*) ALFA1,  ALFA2
        readd.*) distmx
c

        gamma = (rhoe - rhoa)/rhoe
        cclow = 
-------
                                    C-17
c
C... CALCULATE WIND SPEED AT THE JET DISCHARGE  HEIGHT
c
        UA*USTar/vkc*(dLOG((elejet+ZR)/ZR)-PSIF(elejet,rml))
C
C... CALL SETJET TO CALCULATE THE INITIAL CONDITIONS
C       FOR JETPLU MODEL INTEGRATION.
c
        DO 17 1=1,6
        dyr(i) = 1.DO
    17   YR(I)=O.DO
        YR(1) = rhoe
        CALL SETJET(YR,UA,QINIT.DIAJET.elejet)
        rho  = gas_rhoe
        temp = gas_temp
C
C
C... CALCULATEd jet parameters:
c       Yr(1)  ... CENTERLINE CONCENTRATION
c       Yr(2)  ... sysz (product of  local lateral and vertical dimension)
c       Yr(3)  ... theta (ANGLE OF TRAJECTORY)
c       Yr(4)  ... uc  (VELOCITY DECREMENT)
c       Yr(5)  ... x (downwind distance)
c       Yr(6)  ... zj  (elevation)
c
        prmtd) = O.DO                          ! lower limit
        prmt(2) = 100000.                       ! upper limit
        prat(3) = max(Yr(5)/20.DO,  1.D-30)      ! initial step
        prmt(4) = 0.0001                        ! error criteria
        prat(5) = distmx                        ! maximum step size
        prmt(6) = distmx/2.DO                   ! approximate output step size

        ndim * 6
        call rkgst(prmt,yr,dyr,ndim,ihlf.model,modout,aux)
c
        if(ihlf.ge.10) then
                write(3,*) 	ihlf.ge.10	'
                dist  - O.DO
                write(2.*) dist
                stop  'ihlf.ge.10'
        endif
  600     FORMAT(a80)
 C
 4 --  sys$degadis:jetplu_main.for               6-SEP-1989 19:45:29

-------
                                   C-18

700    format(1x,1x,'********************',35x,'JETPLU/DEGADIS v2.1  1,35x,
               •********************•,//,1x,a24,/)
710    format(1x,a80)
720    format(//,' Ambient Meteorological Conditions...1)
730    formate /,' Ambient windspeed at reference height:  ',1pg13.5,'  m/s1,
               /,'                      Reference height:  ',1pg13.5,'  m',
               /,'                     Surface roughness:  '.IpglS.S,1  m')
740    formate/,'               Pasquill stability  class:  ',12x,A1)
750    format( /,'                  Monin-Obukhov length:  ',1pg13.5,'  m1.
               /,'                     Friction velocity:  ',1pg13.5,'  m/s1,
               /,'                   Ambient  temperature:  •JpglS.S,1  K1,
               /,'                      Ambient pressure:  '.IpglS.S,1  atm1,
               /,'                      Ambient humidity:  ',1pg13.5,
               /,'                     Relative humidity:  ',1pg13.5,'  %')
760    format( /,'              Specified averaging time:  ',1pgl3.5,'  s',
               /,'                                OELTAy:  ',1pg13.5,
               /,'                                 BETAy:  '.1pg13.5,
               /,'                                DELTAz:  ',1pg13.5,
               /,'                                 BETAz:  ',1pg13.5,
               /,'                                GAMMAz:  ',1pg13.5>
770    formate//,1 Contaminant Properties...')
780    formate /,'         Contaminant molecular weight: ',lpg13.5,
               /,'                  Initial temperature: ',1pg13.5,
               /,'              Upper  level of interest: ',1pg13.5,
                /,'              Lower  level of interest: ',1pg13.5,
               /,'               Heat  capacity constant: ',1pg13.S,
                /,'                  Heat capacity power: ',1pg13.5)
790    formate/,1  NDEN  flag:  *,I3)
800    formatelx,1x,'Mole fraction1,1x,1x,'Concentration1,1x,4x,'Density1,
                /,1x,15x,4x,'ekg/m3)',4x,4x,'(kg/m3)',4x)
810    formateix,3eix,1pg13.5))
820    formate/,1 ISOFL flag:  >,I3)
830    formate//,1  Release Properties...1)
840    formate  /,'                         Release  rate: ',1pg13.5,'  kg/s1,
                /,'                  Discharge elevation: ',1pg13.5,'  m1,
                /,'                   Discharge diameter: ',1pg13.5,'  m1)
850    formate//,1  Model Parameters...')
860    formate  /,'                                ALFA1: ',1pg13.5,
                /,'                                ALFA2: ',1pg13.5,
                /.'                               DISTMX: ',1pg13.5,'  m',//)
870    formateix,96x,	',1x,'At  z= ',1pg11.3,' m',1x,	,/,
                1x,2x,'Downwind',2x,1x,'Elevation',2x,4x,'Mole*,4x,
                1x,'Centerline',1x,2x,'Density',3x,'Temperature',1x,
                2x,'Sigma y',3x,2x,'Sigma z',3x,4x,'Mole1,4x,7x,'Width to:1,/,
                1x,2x,'Distance',2x,12x,2x,'Fraction',2x,'Concentration1,
                47x,2x,'Fraction',1x,1pE8.2,'molX ',1pE8.2,•molX',/.
                1x,4x,'em)',5x,4x,'em)',5x,12x,2x,'ekg/m3)',3x,
                2x,'ekg/m3)',3x,4x,'e<)',5x,
                4x,'enO'.Sx^x.'enO'.Sx.^x^x/enO'.Sx^x/em)'/)
     sysSdegadis:jetplu_main.for               6-SEP-1989 19:45:29

-------
                                   C-19
        CALL EXIT
        END
c	
C
C
        SUBROUTINE modeUsss,yr,dyr,print)

        Implicit real*8(a-h,o-z), integer*4(i-n)
c
        include 'sys$degadis:DEGADIS1.dec'
        parameter (rt2 = 1.41421356200)         !  sqrt(2.)

        external syfun
        common
     ./GEM2/ DEN(5,igen)
     ./parm/ uO,zO,zr,ntil,ustar,vkc,gg,rhoe,rhoa,deltay,betay,ganmaf,
                cclou
     ./com_gprop/ gasjiw, gas_temp,gas_rhoe.gas_cpk,gas_cpp,
     .  gas_ufl,gas_lfI,gas_zsp,gas_name
     ./comatm/  istab,tamb,pamb,humid,isofl.tsurf,ihtfl.htco,iwtfl.wtco,
     .  humsrc
     ./PHYS/ UA, deltaz,betaz,gammaz,rho, temp.yc
     ./COEFF/ ALFA1.ALFA2, sc.cd,delta
     ./rks/ rk1,rk2,rk3,rk4,rk5,rk6.  rate,totrte,xmo,zmo
     ./sys/ sysz,sy,sz,sya,sza

 c
        character*3  gas_name

        dimension yr(6),dyr(6),prmt(6)
        DIMENSION A(4,5)

 C
 C
 c...integrated  variables	
 c
        cc   = yr(1)
        sysz  = abs(yr(2))
        theta = yr<3)
        uc   = yr<4)
        dist  = yr(5)
        zj   = yr(6)

 c
 c... Calculate  UENTR so that  £1  is  set  to zero  when UC<0
 c
        uentr = max(uc.O.DO)

 6  -- sys$degadis:jetplu_main.for                6-SEP-1989  19:45:29

-------
                                    C-20
c
c...and some hybrid variables
c
        ST    = SIN(theta)
        ST2   = ST*ST
        CT    = COS(theta)
        CT2   = CT*CT
c
c... Estimate the density
c
        call adiabat(0,wc,ua,yc,ya,cc,rho,Mn,enth,temp)
        ganma = (rho-rhoa)/cc
c
c...calculate the ambient sigmas	
c
        sya = deltay*dist**betay
        sza = dettaz*dist**betaz * exp(ganmaz*log(dist)**2)
        dsya * 0.
        dsza = 0.
        ifCdist .gt. 1.00) then
           dsya = sya/dist* betay * ct
           dsza = sza/dist*(betaz + 2.DO*gammaz*log
-------
                                    C-21

c...the ambient windspeed averaged over z in the ellipse (UA).
c       Calculate ALPHA from two velocity points calculated using the log
c       wind profile.  The integrated profile based on ALPHA gives UA.
c       Don't let ZJ be less than ZR.  The 0.01 offset for ZTOP gets
c       around a divide by zero when calculating ALPHA.
c
        zj = max(zj, zr)

        ztop = zj + delta*sz*ct + 0.01DO
        utop = ustar/vkc*(dlog((ztop+zr)/zr) - psif(ztop,rml))
        umid = ustar/vkc*(dlog((zj  +zr)/zr) • psif(zj  ,rml))
        alpha = dlog(utop/umid) / dlog(ztop/zj)
        alphal = 1.DO+alpha

        zbot = zj • delta*sz*ct
        zbot = max(zbot, zr)
        ua = umid/(alpha1*(ztop-zbot)*zj**alpha)
                *(ztop**alpha1 - zbot**alpha1)

        vj = uc*ua*ct
        vj « max(vj, O.DO)

c
c...some additional hybrid variables
c
        UA2   = UA*UA
        UACT  = UA*CT
        UAST  = UA*ST
        uauc  = ua*uc
        uc2   = uc*uc
        ucct  = uc*ct
        ucst  = uc*st
        ccsy  = cc*sy
        ccsz  = cc*sz
        ccsysz= cc*sy*sz
C
C... Gas Component Mass Balance Equation	
C
        qqq = rk1*uact +  rk2*uc
        rate = ccsysz*qqq

        A(1,1> = qqq * sysz
        A(1,2) = qqq * cc
        A(1,3) = •  rk1 *  ccsysz * uast
        A(1.4) = rk2 * ccsysz
        A(1,5) = O.DO
C
C... Overall Mass  Balance Equation  	
C
        qqq = rk3*uact +  rk4*uc
        totrte = rhoa*qqq*sysz + gamma*rate

8  -- sys$degadis:jetplu_main.for                6-SEP-1989  19:45:29

-------
                                   C-22
        A<2,1) = O.DO
        A(2,2) = rhoa * qqq
        A(2,3) = -  rhoa * rk3 * sysz * uast
        A<2,4) = rhoa * rk4 * sysz

        e3 = rk3*ua*(sza*dsya + sya*dsza)
        e2 = alfa2*uact*abs(st)*pe
        A(2,5) = rhoa*(ALFA1*uentr*pe + e2 + e3)
C
C... Z-direction Momentun Balance Equation 	
C
        drag = cd * pe * rhoa/2.DO*uast**2

        rrr = 2.DO*rk2*uauc*ct + rk1*ua2*ct2 + rk6*uc2
        qqq » 2.DO*rk4*uauc*ct + rk3*ua2*ct2 + rk5*uc2
        zmo • rhoa*st*qqq*sysz * ganma*st*rrr*ccsysz

        A(3,1) * gamna*sysz*rrr*st
        A(3,2) * rhoa*qqq*st + gamna*cc*rrr*st
        A(3,3) =   rhoa*sysz*(ct*qqq + st*(
                        - 2.DO*rk4*uauc*st • 2.DO*rk3*ua2*ct*st»
              + gamna*ccsysz*(ct*rrr + st*(
                        • 2.DO*rk2*uauc*st - 2.DO*rk1*ua2*et*st))
        AC3.4) «     rhoa*sysz*st*(2.DO*rk4*uact + 2.DO*rk5*uc)
                + ganma*ccsysz*st*(2.DO*rk2*uact + 2.DO*rk6*uc>
        A(3,5) s -RK1*gg*ganma*ccsysz • signd.DO,theta)*drag*CT

C
C... X-Direction Momentum Balance Equation 	
C
        rrr = rk1*ua2*ct2*ct + 2.DO*rk2*uaue*ct2 + rk6*uc2*ct
        qqq = rk3*ua2*ct2*ct + 2.DO*rk4*uauc*ct2 + rk5*uc2*ct
        xmo = rhoa*qqq*sysz + ganma*rrr*ccsysz

        A(4,1) = gamma*sysz*rrr
        A(4.2) = rhoa*qqq + gamma*cc*rrr
        A(4,3) »   rhoa*sysz«<-3.DO*rk3*ua2*ct2*st
                 - 4.DO*rk4*uauc*ct*st  -  rk5*uc2*st)
              +  gamma*ccsysz*(-3.DO*rk1*ua2*ct2*st
                 - 4.DO*rk2*uauc*ct*st  •  rk6*uc2*st)
        A(4,4) =     rhoa*sysz*(2.DO*rk4*ua*ct2 + 2.DO*rk5*ucct)
                 + gamma*ccsysz*(2.DO*rk2*ua*ct2 + 2.DO*rk6*ucct>
        A(4,5) = UA*A(2,5) +  drag*ABS(ST)

 C
 C...  SIMUL  USED  FOR  MATRIX  INVERSION
 C
        nnn = 4
        call  SIMUL(nnn,A,dyr)
 c

 9  •-  sys$degadis:jetplu_main.for               6-SEP-1989 19:45:29

-------
                                    C-23

c... Force any stray derivatives to be physically realistic.
c
        if(dyr(1) .gt. O.DO) dyr(1) = O.DO
        if(dyr(2) .It. O.DO) dyr(2) = O.DO
c
c...d(x) and d(z) are calculated directly from cos(theta) and sin(theta),
c       respectively.
c
        dyr(5) « ct
        dyr(6) = st
c
        RETURN
        END
        subroutine roodout(sss,yr,dyr,ihlf,ndim,prmt)
c
        Implicit  real*8(a-h,o-z),  integer*4(i-n)
c
        include  'sys$degadis:DEGADIS1.dec'
c
        common
      ./parm/  uO,zO,zr>rml>ustar,vkc>gg,rhoelrhoa>deltay,betay>gannaf,
                cclow
      ./com_gprop/ gas_mH,gas_temp,gas_rhoe,gas_cpk,gas_cpp,
      .  gas_ufI,gas_IfI,gas_zsp,gas_name
      ./PHYS/  UA,  deltaz.betaz.gammaz.rho, temp.yc
      ./COEFF/ ALFA1.ALFA2,  sc,cd,delta
      ./rks/ rk1,rk2,rk3,rk4,rk5,rk6,  rate,totrte,xmo,zmo
      ./sys/ sysz,sy,sz,sya,sza
      ./Ifl/ cufl.clfl

        dimension yr(6),dyr(6),prmt(6)

        character*?  gas_name

        data  ooo1/0.DO/,  ooo2/O.DO/
        data  iip/0/
c
c
        cc    = yr(1)
        sysz   = yr(2)
        theta = yr(3)
        uc    = yr(4)
        dist   = yr(5)
        zj    = yr(6)
c
c... Estimate CZSP  and YZSP at y'=0  and z=GAS_ZSP	
c       Estimate  as  though z1 and  z  represent the  same distances.   Note that
c       no contribution from either  exponential  is included if the location
10 •- sys$degadis:jetplu_main.for               6-SEP-1989 19:45:29

-------
                                    C-24

c       is outside the plume (outside DELTA*SZ which means ARG<2.31125).
c
        argl = 0.5DO*((zj • gas_zsp)/sz)**2
        arg2 = 0.5DO*((zj + gas_zsp)/sz)**2
        if(arg1 .It. 2.31125DO) then
                argl = exp(-argl)
        else
                argl = O.DO
        endif
        if(arg2 .It. 2.31125DO) then
                arg2 = exp(-arg2)
        else
                arg2 = 0.00
        endif
        czsp » cc*(arg1  + arg2)

        call adiabat(0,we,wa,yzsp,ya,czsp,rho,wm,enth,temp)

         if(czsp  .gt. cufl)  then
                wufl = sy*sqrt(2.DO*log(czsp/cufl))
                wlfl = sy*sqrt(2.00*log(czsp/clfl))
         else  if(czsp .gt.  elf I)  then
                wufl = O.DO
                wlfl = sy*sqrt<2.DO*log(czsp/clfl»
         else
                 wufl = 0.00
                 wlfl = O.DO
         endif
                 wufl = min(wufl,  delta*sy)
                 wlfl » min(wlfl,  delta*sy)
 C
 C... IF THE JET REACHES  THE GROUND, STOP THE COMPUTATION	
 C
         IF (zj.LE.O.DO)  then
                 cc    =  cc    •  zj*(occ    - ce   >/(ozj - zj)
                 sy    =  sy    -  zj*(osy    - sy   )/(ozj - zj)
                 sz    •  sz    •  zj*(osz    - sz   )/(ozj - zj)
                 theta  =  theta -  zj*(otheta - theta)/(ozj • zj)
                 uc    »  uc    -  zj*(ouc    - uc   )/(ozj - zj)
                 dist  *  dist  -  zj*(odist  - dist )/(ozj - zj)
                 ua    =  ua    •  zj*(oua    - ua   )/(ozj - zj)
                 yzsp  »  yzsp  -  zj*(oyzsp  - yzsp )/(ozj - zj)
                 Hlfl  =  Wlfl  -  ZJ*(OWlfl  • Wlfl )/(OZJ • Zj)
                 wufl  = wufl  -  zj*(owufl  • wufl )/(ozj • zj)

                 zj = O.DO
                 cc • 2.00*cc

                 call adiabat(0,wc,wa,yc,ya,cc,rho,wm,enth,temp)

                 WRITE(2,*) dist,cc,delta*sy

 11  -- sys$degadis:jetplu_main.for               6-SEP-1989 19:45:29

-------
                                     C-25

           ifCwufl.eq.O.DO  .and. wlfl.eq.O.DO) then
                WRITE(3,734) dist.zj.yc.cc,rho,temp,sy.sz,yzsp
           else if(wufl.eq.O.DO  .and. wlfl.ne.O.DO) then
                WRITE(3,734) dist,zj,yc,cc,rho,temp,sy,sz,yzsp,wlfI
           else
                URITE(3,734) dist,zj,yc,cc,rho,temp,sy.sz,yzsp,wlfI,wufI
           endif
                WRITE(6,9999) dist,zj.cc,sy.sz,uc,ua,theta
                prmtCS) = 1.
                return
        endif
 c
 c...  store the present values for  interpolation when ZJ=0
 c
        occ    =  cc
        osy    -  sy
        osz    =  sz
        otheta =  theta
        ouc    =  uc
        odist  =  dist
        ozj    =  zj
        oua    =  ua
        oyzsp =  yzsp
        owlfl  =  wlfl
        owufl  =  wufl
 c
 c...  Calculate the image contribution 	
 c
        cimage =  cc*exp(-0.5DO*(2.DO*zj/sz)**2)
        cc  = cc + cimage

        call adiabat(0,wc,wa,yc,ya,cc,rho,wm,enth,temp)
 c
 C...  IF THE  JET  cc drops below cclow, stop the calculation	
 C
         IF  (cc.Lt.cclow) then
            ifCwufl.eq.O.DO .and. wlfl.eq.O.DO) then
                URITE(3,734) dist,zj,yc,cc,rho,temp,sy,sz,yzsp
            else  if(wufl.eq.O.DO .and. wlfl.ne.O.DO) then
                WRITE(3,734) dist,zj,yc,cc,rho,temp,sy,sz,yzsp,wlfI
            else
                WRITE(3,734) dist,zj,yc,cc,rho,temp,sy,sz,yzsp,wlfI,wufI
            endif
                WRITE(6,9999)  dist,zj,cc,sy,sz,uc,ua,theta
 c
 c...    set  DIST  to 0 to preclude DEGADIS from continuing
                dist ^  O.DO
                WRITEC2,*)  dist,cc,delta*sy
                prmt(5)  = 1.
                 return
        endif

12  --  sys$degadis:jetplu_main.for              6-SEP-1989 19:45:29

-------
                                    026

c
c... printed output
c
        if(dist .ge. ooo1+ooo2) then
                oool = dist
                ooo2 = prmt(6)

           if(wufl.eq.O.DO .and. ulfl.eq.O.DO) then
                WR1TE(3,734) dist,zj,yc,cc,rho,temp,sy,sz,yzsp
           else if(wufl.eq.O.DO .and. ulfI.ne.0.00) then
                WRITE(3,734) distjZJ.yc.cc.rho.temp.sy.sz.yzsp.wlfI
           else
                WRITE{3,734) dist.zj.yc.cc.rho^emp^y.sz.yzsp.wtfl.wufI
           endif
                WRITE(6,9999) di8t,zj,cc,sy,sz,uc,ua,theta

                iip = iip * 1
                if(iip .eq. 3) then
                        write<3,735)
                        write(6,735)
                        iip = 0
                endif
        endif

 c
   734  FORMAT(1X,10<1pg11.3,1x),1pg11.3)
   735  formatdx)
  9999  FORMAT (1x,5(1pg9.3,1x),1pg10.3,1pg9.3,1pg10.3,3(1pg9.3.1x),
                 1pg10.3,1x,1pg9.3)
        return
        end
         SUBROUTINE SETJET(YR,ua,QINJT,DIAJET,elejet)
 C
 C       THIS SUBROUTINE TRANSFORMS THE EXIT 'TOPHAT1 VELOCITY PROFILE OF
 C       A CONTINUOUS JET TO THE SIMILARITY (GAUSSIAN) FORM REQUIRED FOR
 C       INPUT TO THE JETPLU MODEL - USES WIND TUNNEL DATA CORRELATIONS BY
 C       Y. KAMOTANI AND I. GREBER, NASA CONTRACTOR REPORT CR-2392,  3/74.
 c
 c       This has been simplified for vertical releases only.
 C

         Implicit real*8(a-h,o-z), integer*4(i-n)
 c
         include 'sys$degadis:OEGADIS1.dec-
         parameter (rt2 = 1.414213562DO)         !  sqrt(2.)

13 -- sys$degadis:jetplu_main.for               6-SEP-1989 19:45:29

-------
                                     C-27

c
        common
      ./parm/ uO,zO,zr,rml,ustar,vkc,gg,rhoe,rhoa,deltay,betay,gammaf,
                cclow
      ./COEFF/ ALFA1,ALFA2, sc,cd,delta
      ./rks/ rk1,rk2,rk3,rk4,rk5,rk6, rate,totrte,xmo,zmo
      ./sys/ sysz,sy,sz,sya,sza
        DIMENSION YR(6)
c
c...  initial values for CC and UJ  	
c
        cc * yr(1)
        uj = qinit/pi/diajet**2*4.DO
c
c...  Calculate  the  length of the zone of flow development based on analysis
c       of Pratte and Baines work  in the ASCE Journal of the Hydraulics
c       Division.
c
c	SOD represents (S/D) or  length of development zone (S) nondimensionalized
c       using the jet diameter  (D).
c
        sod = 7.7DO*(1.DO  - exp(-0.48DO*sqrt(rhoe*uj/rhoa/ua)))

c
c...Based on RJ ("J"  in Kamotani and Grebber) and  FROUDE (Froude number),  	
c       calculate "ac" and "be" (represented herein as  AJ and BJ).

         rj =  (rhoe/rhoa)*(Uj/ua)**2
        delrho  = rhoe •  rhoa
         froude  = 1.68800
         if(DELRHO  .GT. 0.)  froude  = rhoa*ua**2/gg/delrho/diajet
         froude  = min(froude,  1.688DO)

         if(rj  .le.  0.05600) then
                 aj  = 18.519DO*rj
                 bj  = 0.4DO
         else  if(rj  .gt.  0.036DO  .and.  rj  .le.  10.DO)  then
                 aj  = EXP(0.2476DO  +0.3016DO*log(froude) +0.24386DO*LOG(rj))
                 bj  = 0.400
         else  if(rj  .gt.  10.DO  .and.  rj .le. 50.DO) then
                 aj  = EXP(0.405465DO +0.13138600*LOG(rj) +0.054931DO*log(rj)**2)
                 bj  = exp(-0.744691DO -  0.074525DO*log(rj))
         else  if(rj  .gt.  50.00  .and.  rj .le. 600.DO)  then
                 aj  = EXP(-2.55104DO +1.49202DO*log(rj)  -0.097623DO*log(rj)**2)
                 bj  * exp(-0.446718DO -  0.150694DO*log(rj))
         else
           write(6,*) 'J  exceeded  in SETJET; Aj and Bj  are  extrapolated.1
                 aj  = EXP(1.44099DO + 0.243045DO*log(rj))

14  --  sys$degadis:jetplu_main.for                6-SEP-1989 19:45:29

-------
                                    C-28

                bj = exp(-O.U6718DO -  0.150694DO*log(rj))
        endif

        bji = 1.DO/bj
c
c...Estimate (z/D) (as ZOO) from AJ, BJ, and SOD using a Newton-Raphson ...
c       procedure.
c
        zod - sod

        iii = 0
 100    continue
        iii « iii+1
        if(iii .gt. 100) then
                stop 'SETJET loop failed1
        endif

        xod = (zod/aj)**bji
        fff = xod**2 + zod**2 - sod**2
        fffp= xod**2*2.DO/bj/zod + 2.DO*zod
        zodn =. zod - fff/fffp
        check = abs((zodn-zod)/zod)
        if(check  .gt. 0.00001) then
                zod = zodn
                goto 100
        endif
c
c... Calculate DIST, THETA, ZJ. and UC  from ZOO and XOD.  Note that XOD is
c       subject to underflows which is  cured on a VAX by (XOD = XOO).
c
        xod = xod                                         •
        dist = xod*diajet
         if(xod  .gt.  O.DO)  then
            slope =  bj*zod/xod
            theta *  atan(slope)
         else  if(xod  .eq. O.DO) then
            theta =  pi/2.DO
         else
            stop 'XOD  < 0.  in  SETJET.1
         endif
         zj  =  zod*diajet +  elejet
         uc =  uj  - ua*cos(theta)
 c
 c...Determine SY and SZ to close the material  balance 	
 c
         erate = qinit*rhoe
 c
 c... Calculate the constants RK1  to RK6; PPP "corrects" the area of
 c       the assumed rectangle to the ellipse.
 c
15 •- sys$degadis:jetplu_main.for               6-SEP-1989 19:45:29

-------
                                    029

        ppp = sqrt(pi)/2.DO

        qqq - erf(delta /rt2 *ppp)
        rk1 = pi * qqq * (2.DO*qqq)

        qqq = erf(delta /rt2*sqrt(1.DO+sc> *ppp)
        rk2 = pi/(1.DO+sc> * qqq * <2.DO*qqq)

        rk3 = pi*delta**2

        qqq = erf(delta /rt2*sqrt(sc) *ppp)
        rk4 = pi/sc * qqq * (2.DO*qqq)

        qqq = erf(delta *sqrt(sc) *ppp)
        rk5 = pi/(2.DO*sc) * qqq * (2.DO*qqq)

        qqq = erf(delta /rt2*sqrt(1.DO+2.DO*sc) *ppp)
        rk6 = pi/(1.DO+2.DO»sc> * qqq * (2.DO*qqq)

c
c... Calculate  SYSZ.
c
        sysz =  erate/cc/(Pk1*ua*cos(theta) + rk2*uc)

        sy * sqrt(sysz)
        sz = sy

        yr(1) = cc
        yr(2) = sysz
        yr(3) = theta
        yr(4) * uc
        yr(5) > max(dist, 1.D-30)
        yr(6) » zj
         write(6,*)  'JETPLU/SETJET  initial conditions...1
         write<6,*>  '  '
write<6,*) '
write<6.*) '
write(6,*) '
write(6,*) '
write(6,*> '
write(6,*) '
write(6,*) '
write(6.*) '
write<6,*) '
write<6,*) '
write(6.*) '
write<6,*) '
write(6,*) '
write(6,*> '
uO:
erate:
rhoe:
rj:
i 1
dist:
diajet:
1 sy:
1 theta:
i i
1 rk1:
1 rk3:
1 rk5:
1 1
'.uO .'
'.erate .'
'.rhoe .'
',rj ,'

'.dist ,'
'.diajet.'
'.sy
', theta ,'

',rk1 ,'
',rk3 ,'
',rk5 ,'

zO:
uj:
rhoa:
froude:

zj:
uc:
sz:
sod:

rk2:
rk4:
rk6:

'.zO
'.uj
1 , rhoa
', froude

'.zj
'.uc
'.sz
'.sod

'.rk2
',rk4
'.rk6

16 -- sys$degadis:jetplu_main.for               6-SEP-1989 19:45:29

-------
                                     C-30
         write(6,*> ' DIST        2J        ',
                 •CC        SY        SZ        UC        UA        THETA1
         write(6,*) ' '
         RETURN
         END
  c	
  c
          function syfun(sytry)
  c
          implicit real*8(a-h,o-z),  integer*4(i-n)

          comnon
       ./rks/ rk1frk2,rk3,rk4,rk5,rk6,  rate,totrte,xmo,zmo
       ./sys/ sysz,sy,sz,sya,sza
          sztry = sysz/sytpy
  C
  c       syfun = sya**2 -  sza**2 -  sytry**2 + sztry**2
  c... to improve the accuracy of the calculation...
  c
          syfun = (sya-sza)*(sya+sza) + (sztry-sytry)*(sztry*sytry)

          return
          end
####
  17 --  sys$degadis:jetplu_main.for               6-SEP-1989 19:45:29

-------
                                   D-l



                              APPENDIX D

                       DEGADIS MODEL  SOURCE  CODE
AFGEN.FOR          D-3
AFGEN2.FOR         D-4
ALPH.FOR           D-5
CRFG.FOR           D-8
DEGADIS1.DEC       D-13
DEGADIS1.FOR       D-14
DEGADIS2.DEC       D-22
DEGADIS2.FOR       D-23
DEGADIS3.DEC       D-27
DEGADIS3.FOR       D-28
DEGADIS4.DEC       D-32
DEGADIS4.FOR       D-33
DEGADISIN.DEC      D-38
DEGADISIN.FOR      D-39
DOSOUT.FOR         D-45
ESTRT1.FOR         D-50
ESTRT2.FOR         D-54
ESTRT2SS.FOR     ' D-56
ESTRT3.FOR         D-58
GAMMA.FOR          D-59
GETTIM.FOR         D-61
GETTIMDOS.FOR      D-63
HEAD.FOR           D-64
INCGAMMA.FOR       D-70
10.FOR             D-74
IOT.FOR            D-76
LIMIT.FOR          D-93
NOBL.FOR           D-94
OB.FOR             D-97
PSIF.FOR           D-100
PSS.FOR            D-101
PSSOUT.FOR          D-104
PSSOUTSS.FOR        D-107
RIPHIF.FOR          D-110
RKGST.FOR           D-114
SDEGADIS2.FOR       D-122
SERIES.FOR          D-130
SORTS.FOR           D-131
SORTS1.FOR          D-134
SRC1.FOR            D-139
SRTOUT.FOR          D-148
SSG.FOR             D-152
SSGOUT.FOR          D-155
SSGOUTSS.FOR        D-158
SSOUT.FOR           D-161
SSSUP.FOR           D-163
STRT2.FOR           D-172
STRT2SS.FOR         D-175
STRT3.FOR           D-178
SURFACE.FOR         D-180
SZF.FOR             D-182
TPROP.FOR           D-185
TRANS1.FOR          D-199
TRANS2.FOR          D-202
TRANS2SS.FOR        D-204
TRANS3.FOR          D-206
TRAP.FOR            D-207
TS.FOR              D-216
TUPF.FOR            D-217
UIT.FOR             D-222
ZBRENT.FOR          D-224

-------
                                    D-3
c	
c
C       THIS FUNCTION LINEARLY INTERPOLATES FROM THE GIVEN
C           PAIR OF DATA POINTS.
C
        FUNCTION AFGEN(TAB,X,SPEC)

        Implicit Real*8 ( A-H, 0-Z ), Integer** ( I-N )
        include 'sys$degadis:DEGADIS1.dec>
        comnon/nend/poundn,pound
c
        character** pound
        character*(*) SPEC
        DIMENSION TAB(1)
C
        IF(X .GE. TAB(D) GO TO 95
        WRITE(lunlog,1100) x.spec
        AFGEN = TAB(2)
        RETURN
C
 95     continue
        ix = 1
   100   Ix = ix + 2
C
        IY = IX + 1
        IF( TAB(IX).EQ.POUNDN  .AND. TAB(IY).EQ.POUNDN  ) GO TO 500
        IF(X .GE. TAB(IX)) GO  TO  100
C
        IXP =  IX-2
        IYP =  IXP +  1
C
        SL = (TAB(IY)  -  TAB(IYP))/(TAB(IX)  - TAB
-------
                                   D-4
c	
c
C       THIS FUNCTION LINEARLY INTERPOLATES FROM THE GIVEN
C           PAIR OF DATA POINTS.
C
        FUNCTION AFGEN2CXTAB,TAB,X.SPEC)

        Implicit Real*8 ( A-H, 0-Z ), Integer*4 ( I-N )
        include 'sys$degadis:DEGADIS1.dec'
        common/nend/poundn,pound
c
        character*4 pound
        character*(*) SPEC
        DIMENSION XTABCD.TABO)
C
        IF(X .GE. XTAB<1)> GO TO 95
        URITEdunlogJIOO) x.spec
        AFGEN2 = TAB(2)
        RETURN
C
 95     continue
        ix = 1
  100   ix » ix + 1
C
        IF( XTAB(IX).EQ.POUNDN  ) GO TO 500
        IF(X .GE. XTAB(IX)) GO  TO 100
C
        IXP =  IX-1
c
        SL = (TAB(IX)  -  TABOXP»/(XTAB(IX)  - XTAB(IXP))
        AFGEN2 =  SL*(X -  XTAB(IXP)) + TAB(IXP)
        RETURN
C
   500   CONTINUE
         IX =  IX-1
         IXP =  IX-1
 C   '
         SL =  (TAB(IX)  - TAB(IXP))/(XTAB(IX)  -  XTABUXP))
         AFGEN2 « SL*(X - XTABCIXP))  +  TAB(IXP)
 C
  1100   FORMAT(2X,'?AFGEN2? UNDERFLOW;  argument: ',1pg13.5,5X,A20)
         RETURN
         END
 1 -- sys$degadis:afgen2.for                    6-SEP-1989 15:40:01

-------
                                    D-5

C	
c
C       SUBROUTINES TO CALCULATE THE VALUE OF ALPHA
C
        SUBROUTINE ALPH

        Implicit Real*8 ( A-H, 0-Z ), Integer*4 ( I-N )

C
        include 'sys$degadis:DEGADIS1.dec'
C
        COMMON
     $/ERROR/STPIN,ERBND,STPMX,UTRG,UTtm,WTya,wtyc,wteb,wtmb,utuh,XLI,
     $ XRI,EPS,ZLOW,STPINZ,ERBNDZ,STPMXZ,SRCOER,srcss,srccut,
     $ htcut,ERNOBL,NOBLpt,crfger.epsiIon
     $/PARM/UO,ZO,ZR,ML,USTAR.K,G,RHOE,RHOA,DELTA,BETA,GAMMAF.CCLOU
     $/ALP/ALPHA,alpha1
     S/alphcom/ ialpfl.alpco
C
        REAL*8 ML,K
C
        EXTERNAL ALPHI
C
        PSI « PSIF(ZO.ML)
        USTAR = UO*K/(dLOG((ZO+ZR)/ZR)  - PSI)
c
        if(uO .eq. 0.) then
                alpha * 0.
                ustar - 0.
                return
                endif
c
        ifd'alpfl.eq. 0) then
                alpha ^ alpco
                return
                endif
C
C*** ZBRENT USED TO DETERMINE THE ROOT  OF THE REQUIRED INTEGRAL EQUATION
C
        IER = 0
C
        CALL zbrent(alpha, ALPHI, XLI,  XRI, EPS, IER)
        IF( IER .NE. 0 ) CALL trap(19,IER)
C
        RETURN
        END
c
c
C	
C
C       FUNCTION TO EVALUATE  THE WEIGHTED EUCLIDEAN  NORM OF THE

 1  -- sys$degadis:alph.for                      6-SEP-1989  15:42:22

-------
                                     D-6

C        ERROR ASSOCIATED WITH THE POWER LAW FIT OF THE WIND PROFILE.
C
        FUNCTION ALPHI(X)

        Implicit Real*8 ( A-H, 0-Z ), Integer** ( I-N )

C
        include 
C
        COMMON
     $/ERROR/STPIN,ERBND,STPMX,WTRG,WTtm,WTya,utyc,Hteb,wtmb,wtuhfXLI,
     $ XRI,EPS,ZLOW,STPINZ,ERBNDZ,STPMXZ,SRCOER,srcss,srccut,
     $ htcut,ERNOBL,NOBLpt,crfger,epsilon
     $/PARM/UO,ZO,ZR,ML,USTAR,K,G,RHOE,RHOA,DELTA,BETA,GAMMAF,CcLOU
     $/ALP/ALPHA,alpha1
C
        REAL*8 ML,K
C
        DIMENSION  Y(1),DERY(1),PRMT(5),AUX(8)
        EXTERNAL ARG.ARGOUT
C
        ALPHA = X
C
        PRMTd) =  ZO
        PRMT(2) -  dmaxKZLOW,zr)         !  to take care of  large  zr
        PRMT(3) =  STPINZ
        PRMTC4) =  ERBNDZ
        PRMT(S) =  stpmxz
C

C

C


C

Yd) =

DERYd)

NDIM =
IHLF *


O.ODOO

= 1.0DOO

1
0

CALL RKGSTCPRMT,'
C


         IFUHLF .GE.  10) CALL trap<18,IHLF)
         ALPHI = Yd)
         RETURN
         END
 c
 C
 C	
 C
 C       FUNCTION TO EVALUATE THE ARGUMENT OF THE INTEGRAL EXPRESSION
 C
         SUBROUTINE ARG(Z,Y,D,PRMT)

         Implicit Real*8 ( A-H. 0-Z ), Integer*4 ( I-N )

 2 -- sys$degadis:alph.for                      6-SEP-1989 15:42:22

-------
                                    D-7
c
        include 'sys$degadis:DEGADIS1-dec1
C
        COMMON
     S/PARM/UO,ZO,ZR,ML,USTAR.K.G.RHOE.RHOA,DELTA,BETA,GAMMAF.CcLOW
     S/ALP/ALPHA,alpha1
     $/alphcom/ ialpfl.alpco
C
        REAL'S ML.K
C
        DIMENSION Y(1),D(1),PRMT(1)
C
C*** WEIGHT FUNCTION USED
C
        U = 1.DOO/CI.DOO + Z)
        ifd'alpfl.eq. 2) w= 1.DOO
C
C*** WIND VELOCITY 3 Z  •- BEST FIT
C
        UBST = USTAR/K*(dLOG((Z+ZR)/ZR) • PSIF(Z,ML))
C
C*** WIND VELOCITY 3 Z  •• POWER LAW APPROXIMATION
C
        UALP = UO *  (Z/ZO) ** ALPHA
C
        0(1) = W * (UBST  - UALP) * dLOG(Z/ZO) * UALP
        RETURN
        END
c
C
        SUBROUTINE ARGOUT
        RETURN
        END
 3  --  sys$degadis:alph.for                      6-SEP-1989 15:42:22

-------
                                    D-8

C	
c
C       SUBROUTINE TO CREATE RADG,QSTR,srcden,srcwc,srcwa,srcenth DATA LISTS
C
C       PARAMETERS  ••  TABLE • WORKSPACE VECTOR
C                       NTAB - DIMENSION OF TABLE DIVIDED BY iout_src
C                       RER - RELATIVE ERROR BOUND OF CREATED
C                               DATA PAIRS BY LINEAR INTERPOLATION
C
C       VALUES OF TIME, RADG, height, QSTR, SZO, ye, ya, rho, Ri,
c               we,wa,enthalpy,temp
c         ARE READ INTO
C         TABLEC1) TO TABLE(13) RESPECTIVELY.
C
C	
C
        SUBROUTINE CRFG(TABLE,NTAB,rer)

        Implicit Real*8 ( A-H, 0-Z ), Integer** ( I-N )

C
        DIMENSION TABLE(1)
C
        include  'sys$degadis:DEGADISl.dec-
        parameter (zeros 1.e-20)
c
        COMMON
     S/GEN3/  radg<2,maxl),qstr(2,maxl),srcden(2,maxl),srcwc(2,maxl),
     $ srcwa(2,maxl),srcenth(2,maxl)
     S/comatm/ istab,tamb.pamb,humid,isofl.tsurf,ihtfl.htco.iutfl,wtco,
     $ humsrc
     S/PARMSC/ RM,S2M,EMAX,RMAX,TSC1.ALEPH.TEND
     S/PHLAG/ CHECK1.CHECK2,AGAIN,CHECKS,CHECK4,CHECKS
     S/NEND/  POUNDN,POUND
c
        character**  pound
c
        LOGICAL  CHECK1,CHECK2,AGAIN,CHECKS,CHECK4,CHECKS
C
        DATA  NI/1/
 c
        data  iti/1/      !  time •  element no 1  in  record
        data  irg/2/      !  Radg •  element no 2  in  record
        data  iqs/4/      !  Ostar • element  no 4 in record
        data  idn/8/      !  rho •  element no 8 in record
        data  iwc/10/    !  we - element no 10 in record
         data  iwa/11/    !  wa - element no 11 in record
         data  ien/12/    !  enthalpy - element no 12 in record
 c
 c
 C       OUTPUT CREATED VECTORS TO A PRINT FILE

 1  -- sys$degadis:crfg.for                      6-SEP-1989 16:13:47

-------
                                    D-9

c
c
        READ(9.*) (TABLE(J),J=1.iout_src)
C
        WRITE(8,1111)
        URITE(8,1105)
        if(isofl.eq. 1) then
        WRITE(8,1102)
        WRITE<8,1103)
        WRITE<8,1140) (TABLE(J).J=1,6),table(8),table(9>
        else
        WRITE(8,1100)
        WRITE<8,1104)
        WRITE(8.1140) (TABLE(J),J=1,6),table(8),tabled3),table(9)
        endif
        ispace =  1
C
 1100   FORMAT(/.5X.'Time',5X,2x,'Gas Radius',2x.4X,'Height',4X,
     $4x,'Qstar',5x,2x,'SZ(x=L/2.)',2x,1X,'Mole frac C',2x,
     $3x,'Density',4x,1x,'Temperature1,2x,3x,'Rich No.',3x)
 1102   FORMATC/,5X,'Time1,5X,2x,'Gas Radius',2x.4X,•Height1,4X,
     $4x,'Qstar',5x,2x,'SZ(x=L/2.)',2x.1X,'Mole frac C'^x,
     $3x.'Density',4x,3x.'Rich No.',3x)
 1103   FORMATdH ,4X,'sec',6X.6X,'m',7X.6X,1m',7X,
     $2X, 'kg/m**2/s',3X,6X, 'm'.TX, 14x,3x. 'kg/m^S',4x, 14x,/)
 1104   FORMAK1H ,4X,'sec',6X.6X,'m'.TX,6X,'m',7X,
     $2X,'kg/m**2/s',3X,6X,'m',7X,14x,3x,'kg/m**3',4x,6x,'IC',7x,14x,/)
 1105   FORMATC1H ,23X,'*****',21X,'CALCULATED SOURCE PARAMETERS',21X,
     {I*****!)
C
        RADG(1,1)  =  0.
        RADG(2,1)  >  TABLEC2)
        QSTR(1,1)  =  0.
        QSTR(2,1)  =  TABLE(4)
        srcden<1,1)  * 0.
        srcden(2,1)  = table(8)
        srcuc(1,1) = 0.
        srcwc(2,1) = tabledO)
        srcua(1,1) = 0.
        srcwa(2,1) = tabled 1)
        srcenth(1,1) =  0.
        srcenth(2,1) =  table(12)
C
        READ(9,*> (TABLE(J),J=1,iout_src)
        L  =  2
C
C*** L IS  THE NUMBER OF RECORDS WHICH HAVE BEEN READ
C
   100   CONTINUE
        DO 120  I=2,NTAB
C

2  -- sys$degadis:crfg.for                     6-SEP-1989  16:13:47

-------
                                    D-10

C*** HOVE LAST RECORD READ INTO THE LAST ACTIVE POSITION OF TABLE
C
        DO 130 J = 1,iout_src
        KK = iout_src * (1-1) + J
  130   TABLE(KK) = TABLE(J)
        KK = iout_sre * I
C
C*** READ THE NEXT RECORD.  INCREMENT L.
C
        L = L + 1
        READ(9,*,END=900) (TABLE(J),J=1,iout_src)
C
C
        DO UO Kkk - 2,1
C
        KT    = iout_src*(Kkk-1) +  iti
        KRG   = iout_src*(Kkk-1) +  irg
        KQSTR = iout_src*(ICkk-1) +  iqs
        KCA   = iout_src*(ICkk-1) «•  idn
        Kwc   = iout_src*(Kkk-1) +  iwc
        Kwa   = iout_src*(Kkk-1) *  iwa
        Ken   = iout_src*(Kkk-1) +  ien
 C
         timeslot  =  radg(1,ni)
         ratio - (table(kt)  -  timeslot)  /  (table(iti)  -  timeslot)
 c
        ANSRG -  (TABLE(irg)  •  RADG(2,NI)>  * ratio + RADG(2,NI)
        ANSQ -  (TABLE(iqs)  •  QSTR(2.NI» * ratio + OSTR(2,NI)
        ANSCA =  (TABLE(idn)  •  srcden(2,ND) * ratio + srcden(2,NI)
        ANSwC =  (TABLE(iwc)  -  srcwc(2,NI» * ratio +  srcwc(2,NI)
         ANSwa =  (TABLE(iwa)  -  srcua(2,NI)) * ratio +  srcwa(2,NI)
         ANSen =  (TABLE(ien)  -  srcenth(2,NI)) * ratio  + srcenth(2,NI)
 C
         ERRG = ABS(ANSRG •  TABLE(KRG))/TABLE(KRG)
         ERQSTR  =  ABS(ANSO •  TABLE(tCQSTR))/(TABLE«QSTR)+zero)
         ERO  = dMAXKERRG,EROSTR)
 c
         ERCA x ABS(ANSCA -  TABLE(KCA))/TABLE(KCA)
         ERO  = dMAXl(ERO,ERCA)
 c
         ERwC =  ABS(ANSuC -  TABLE(KwC))/(TABLE(KwC)+ zero)
         ERO  - dMAXl(ERO.ERwC)
         ERwa =  ABS(ANSwa -  TABLE(Kwa))/(TABLE(Kwa)+ zero)
         ERO  - dMAXl(ERO,ERwa)
         ERen = ABS(ANSen -  TABLE(Ken))/(TABLE(Ken)+ zero)
         ERO = dMAXl(ERO,ERen)
 C
         IFCERO -GT.  RER) GO TO 150
   140   CONTINUE
   120   CONTINUE
 C

 3 -- sys$degadis:crfg.for                      6-SEP-1989 16:13:47

-------
                                     D-ll

        WRITE - TABLE(KRG)
OSTR(1,NI) = TABLE(KT)
QSTRC2,NI) = TABLE(KQSTR)
srcden(1,NI) = TABLE(KT)
srcden(2,NI) = TABLE(KCA)
srcwcd.NI) = TABLE(KT)
srcwc(2,NI) = TABLE(KWC)
srcwa(1,NI) = TABLE(KT)
srcwa(2,NI) = TABLE(KWA)
sreenth(1,NI) = TABLE(KT)
srcenth(2,NI) = TABLE(KEN)
WRITE THE POINTS JUST RECORDED TO UNITES
         if(isofl.eq.  1)  then
         WRITE(8,1HO)  (TABLE
-------
                                    D-12
        NI   = NI   -1-1
        IFCNI+1 .GT. HAXL) then
                writedunlog,*) '  CRFG? Time out:  '.table(iti)
                CALL trap(5)
                endif
c
        RADGd.NI)   = TABLE(iti)
        RADG(2,NI)   = TABLE(irg)
        QSTRd.NI)   = TABLE(iti)
        QSTR(2,NI)   = TABLE(iqs)
        srcden(1,NI) = TABLE(iti)
        srcden(2,NI) = TABLE(idn)
        srcwcd.NI)  = TABLE(iti)
        srcwc(2,NI)  = TABLE(iwc)
        srcwad.NI)  = TABLE(iti)
        srcwa(2,NI)  = TABLE(iwa)
        srcenthd.MI)  = TABLEO'ti)
        srcenth(2,NI)  * TABLEO'en)
c
        ifO'sofl.eq. 1) then
        WRITE(8,1140)  (TABLE(J),J=1,6),table(8),table(9)
        else
        WRITE(8,1140>  (TABLECJ).J=1,6),table<8),tabled3),table<9>
        endif
        i space = i space +  1
        if(ispace.eq.  3)  then
                 ispace =  0
                 write(8f1111)
                 endif
 c
        NI    = NI    +1
        DO  910 I =1,2
        RADGU.NI)     = POUNDN
        QSTRCI.NI)     = POUNDN
        srcdend.NI)  = POUNDN
        srcwc(I.NI)   = POUNDN
        srcwa(I,NI)   = POUNDN
        srcenthd.NI) = POUNDN
   910  CONTINUE
 C
        RETURN
 C
  1110   FORMATC 7CRFG? TABLE  exceeded without point selection ',
      $'-  execution continuing1)
  1111   FORHATdH )
 C1140   FORMATC1H ,(1PG13.6,1X))
  1140   FORHATdH ,9(1PG13.6.1X))
        END
 5 -- sysidegadis:crfg.for                      6-SEP-1989 16:13:47

-------
                                      D-13
  C	
  c
  C
  C       DIMENSIONS/DECLARATIONS for DEGADIS1
  C
          include >sys$degadis:DEGADISIN.dec'
  c
  c  maxI is the Length of the /GEN3/ output vectors
  c
          parameter (     lunlog- 6,
       S                  sqrtpi= 1.77 245  3851DO,                 ! sqrt(pi)
       $                  maxl= 800,
       $                  maxI2= 2*m8xl.
       $                  iout_src= 13)
  C
####
  1 -• sys$degadis:degadis1.dec                  6-SEP-1989 16:18:34

-------
                                     D-14

        PROGRAM DEGADIS1
C
£*«********»*********»»******»****«*»»*******»***»**»***************•*****»•
J*******************************«*****************»*******«*****************
(;*****************»*********»*»**********»*****»****»**»********************
C
C       Program description:
C
C       DEGADIS1 estimates the ambient wind profile power alpha and
C       characterizes the primary gas source.
C
C
C       Program usage:
C
C       Consult Volume  III of the Final Report to U. S. Coast Guard
C       contract DT-CG-23-80-C-20029 entitled "Development of an
C       Atmospheric Dispersion Model for Heavier-than-Air Gas Mixtures".
C
C       J. A. Havens
C       T. 0. Spicer
C
C       University of Arkansas
C       Department of Chemical Engineering
C       FayetteviIle, AR 72701
C
C       April 1985
C
C
C       This project was sponsored by the U. S. Coast Guard and the Gas
C       Research Institute under contract DT-CG-23-80-C-20029.
C
C
C       Disclaimer:
C
C       This computer code material was prepared by the University of
C       Arkansas as an  account of work sponsored by the U. S. Coast Guard
C       and the Gas Research  Institute.  Neither the University of Arkansas,
C       nor any person  acting on  its behalf:
C
C       a.  Makes any warranty or representation,  express  or  implied,
C           with  respect  to the accuracy,  completeness, or usefulness
C           of  the  information contained  in this computer  code material,
C           or that  the use of any  apparatus,  method,  numerical model,
C           or process  disclosed  in this  computer  code material may not
 C            infringe privately owned rights;  or
 C
 C        b.  Assumes any liability with respect to  the use of, or  for
 C           damages resulting from  the use of, any information,
 C            apparatus,  method,  or process disclosed in this computer
 C           code material.
 C

 1  -• sysSdegadis:degadis1.for                  6-SEP-1989 16:18:54

-------
                                     D-15

C
C***************************************************************************
C**************************************************«************************
Q**************************»************************************************
C
C
C       DIMENSIONS/DECLARATIONS
c

        Implicit Real*8 ( A-H, 0-Z ), Integer*4 ( I-N )

        include  'sys$degadis:DEGADIS1.dec'
c
c  ntab is the dimension of table divided by iout_src
c
        parameter  (     ntabO=910,
     $                  ntab=ntabO/iout_src)
c
        include  '(Sssdef)1
C
C       BLOCK COMMON
C
        COMMON
     S/GEN3/ radg(2,maxl),qstr(2,maxl),srcden(2,maxl).srcwc(2,maxl).
     $ srewa(2,maxl),srcenth(2,maxl)
     S/TITL/ TITLE
     S/GEN1/ PTIME(igen). ET(igen),  R1T
     S/ITI/ T1,TINP,TSRC,TOBS,TSRT
     $/ERROR/STPIN,ERBND,STPMXfUTRG,WTtm,WTya,wtyc,wteb,wtmbfwtuh,XLI,
     $ XRI,EPS,ZLOW,STPINZ,ERBNDZ,STPMXZ,SRCOER,srcss,srccut,
     S htcut,ERNOBL,NOBLpt,crfger,epsiIon
     S/PARM/ UO,ZO,ZR,ML,USTAR,K,G,RHOE,RHOA,DELTA,BETA,GAMMAF.CcLOW
     S/SZFC/ szstpO,szerr,szstpmx,szszO
     S/com_gprop/  gas_mw,gas_temp,gas_rhoe,gas_cpk,gas_cpp,
     S gas_ufI,gas_IfI,gas_zsp,gas_name
     S/comatm/ istab.tamb.pamb,humid,isofl.tsurf,ihtfl.htco,iwtfl.wtco,
     $ humsre
     S/PARMSC/ RM,SZM,EMAX,RMAX,TSC1,ALEPH,TEND
     S/com_ss/ ess,slen,suid,outcc,outsz,outb,outl,swcl,swal,senl,srhl
     S/PHLAG/ CHECK1,CHECK2,AGAIN,CHECK3.CHECK4,CHECKS
     S/vucom/ vua,vub,vuc,vud,vudelta,vuflag
     $/com_sigx/ sigx_coeff,sigxjx>w,sigx_min_dist,sigx_flag
     $/com_ENTHAL/ H_masrte,H_airrte.H_Matrte
     S/NEND/ POUNON,POUND
     S/ALP/ ALPHA,alphal
     S/alphcom/  ialpfl.alpco
     S/phicom/ iphifl.dellay
     $/sprd_con/ ce,  delrhomin
     $/COM_SURF/ HTCUTS

2  -- sys$degadis:degadis1.for                 6-SEP-1989  16:18:54

-------
                                     D-16

     ./oomsin/ oodist,avtime
C
C
        character*80 TITLE(4>
C
        character*^ pound
        character*24 TSRC,TINP,TOBS,TSRT
        character's gas_name
C
        real*4 tt1
        REAL'S ML,K
        LOGICAL CHECK1,CHECK2,AGAIN,CHECKS,CHE CK4,CHECKS
        logical vuflag
        logical reflag
C
        REAL'S L,LO
        DIMENSION PRMT(25),Y(7),DERY(7),AUX(8,7)
        EXTERNAL SRC1,SRC10
        character*40 opnrupl
        character OPNRUP(40)
        character*^  INP.ER1,SCD,TR2,scl
 c
        dimension table(ntabO)
 c
        equivalence(opnrupd),opnrupl)
 C
 C       DATA
 C
         DATA POUNDN/-1.D-20/,POUND/1//  '/
         DATA USTAR/O.DO/.GAMMAF/O.DO/
         DATA G/9.81DO/,  K/0.35DO/
         DATA GAMMAF/O.DO/
         DATA PRMT/25*O.DO/
         DATA Y/7*O.DO/,  DERY/7*O.DO/
         DATA TIHEO/O.DO/,NDIM/0/
         DATA EHAX/O.DO/.TSC1/O.DO/
         DATA PTIME/igen'O.DO/
         DATA ET/igen*O.DO/,R1T/igen*O.DO/
         DATA PWC/i gen*0.DO/,PTEMP/i gen*0.DO/
         DATA PFRACV/igen*O.DO/,PENTH/igen*O.DO/
         DATA PRHO/igen*O.DO/
         data DEN/igen*O.DO,igen*O.DO,igen*O.DO.igen*O.DO,igen*O.DO/
 c
         data reflag/.true./
 C
         DATA INP/'.inp'/.ERV'.erl'/
         DATA SCD/'.scdl/,TR2/'.tr21/
         data scl/'.scl1/
      sysSdegadis:degadis1.for                  6-SEP-1989 16:18:54

-------
                                    D-17
C	
c
C       MAIN
C
C*** GET THE EXECUTION TIME
C
        t1 = secnds(0.)
        istat = libSdate_TIME(TSRC)
        ifCistat .ne. ss$_normal) stop1lib$date_time failure1
C
C*** GET THE FILE NAME FOR FILE CONTROL
C
c       WRITE(lunlog,1130)
c1130   FORMAT(5X,'Enter the file name being used for this run: ',$)
        read(5,1000) nchar.opnrup       !  unit 5 gets command file too
 1000   format(q,40a1)
c
        opnrupl = opnrup1(1:nchar) // er1(1:4)
c
        CALL ESTRTKOPNRUP1)
        HTCUTS = HTCUT
C
        opnrupl = opnrupl(1:nchar) //  inp(1:4>
        CALL IO(tend.gmassO,OPNRUP1)
        if(check4)  srcoer  = 2.8*srcoer
        CALL ALPH
C
        alphat = alpha+1.
        WRITE(lunlog,1105) ALPHA
  1105   FORMAT(5X,'THE VALUE OF  ALPHA  IS  ',F6.4)
C
C
        GAMMAF = GAMMACI./ALPHA1)
        TSC1 = TEND
C
c
c*** set  the density and enthalpy  functions  in TPROP
c
        call setenthal(h_masrte,h_airrte,h_watrte)
        ca11 setden(1.DOO,0.000,h_masrte)
C
C	
C
C       SOURCE INTEGRATION (CA = RHOE)
C
        opnrupl = opnrupl(1:nchar) //  scd(1:4)
         OPEN < UNIT=9,NAME=OPNRUP1,recI=202,TYPE='SCRATCH',
     $   carriagecontrol='list'f
     $   recordtype='variable')
 4  --  sysSdegadis:degadis1.for                  6-SEP-1989  16:18:54

-------
                                    D-18

        gmass  = gmassO
C
C	
C
C       START THE GAS BLANKET?
C
        L = 2.*AFGEN2(PTIHE,R1T,TIMEO.'R1T-MN')
        QSTRE = AFGEN2(PTIME,ET,TIMED,'ET-MN')/(pi*L**2/4.)
        PWCP * AFGEN2CPTIME,PWC,TIMED. 'PUC')
        HPRIM = AFGEN2CPTIME,PENTH,TIMED,'PENTH1)
        RHOP = AFGEN2(PTIME,PRHO.TIMED,'PRHO')
        CCP = PUCP*RHOP
c
C
        qstar = 0.
        ifCuO .ne. 0.)
     $   qstar = CCP*k*ustar*alpha1*deU8y/
-------
                                    D-19

C***    massa           Y(4)
C***    Enthalpy        Y(5)
c***    moe             y(6)
C***    TIME            X
C
        PRMTd) = TIMED
        PRMTC2) = 6.023E23
        PRMT(3) * STPIN
        PRMT(4) = ERBND
        PRMT(5) = 4.DO*STPMX
C       PRMT<6) « EMAX -- OUTPUT
c
        do ill = 6,25
        prmt(iii) = 0.
        enddo
C
        Y(1) = AFGEN2(PTIME,R1T,TIMED,'R1T-MN')
        rmax = y(1)
        Y(2> = dmaxU gmass, 
-------
                                    D-20

                GO TO 110
        end if
C
C	
C
C       RESTART THE GAS BLANKET?
C
        TIMED = TSC1
        I - 2.*AFGEN2(PTIME,R1T,TIMEO,'R1T-MN1)
        QSTRE = AFGEN2(PTIME,ET.TIMED,«ET-MN'>/(pi*L**2/4.)
        PWCP = AFGEN2(PTIME,PUC,TIMED,'PWC')
        RHOP = AFGEN2(PTIME,PRHO,TIMEO,IPRHOI)
        CCP = PWCP*RHOP
c
        qstar = 0.
        if(u0.ne. 0.)
     $   qstar = CCP*k*ustar*alpha1*dell8y/
-------
                                    D-21
c	
c
C       SOURCE INTEGRATION •• NO GAS BLANKET
C
  105   continue
        WRITE(lunlog,1147)
 1147   FORMAT(5X.'Source calculation - No Gas blanket')
C
        CALL NOBLCtimeout, reflag)
c
        if(check3) then         ! restart blanket calculation
                timeO = timeout
                goto 100
        end if
C
C
  110   RMAX = 1.01*RHAX        ! GUARANTEE A GOOD VALUE
        aleph = 0.
        if(uO .ne. 0.) ALEPH - UO/GAMMAF*(S2M/ZO)**ALPHA
     $          /(SQRTPI/2.*RM +RMAX)**(ALPHA/ALPHAD/alpha1
C
c
        rewind (unit=9)
        opnrupl = opnrup1(1:nchar) // scl(1:4)
        open(unit=8,name=opnrup1, type='neu',
     $  carriagecontrol='fortran', recordtype='variable1)
c
        call head(gmassO)
        call crfg(table,ntab,crfger)
        call head(gmassO)
c
        CLOSE(UNIT=9)
        close(unit=8)
C
        opnrupl = opnrup1(1:nchar) // tr2(1:4)
        CALL TRANSCOPNRUP1)
C
C*** CALCULATE EXECUTION  TIME
C
        tt1 = t1
        t1 « Secnds(tT1)/60.
        WRITE(lunlog,2000) TSRC
        WRITE(lunlog,2010) T1
 2000   FORMAT(1X,1BEGAN  AT  ',A24>
 2010   FORMATC5X,' ***** ELAPSED TIME  *****  ',1pg13.5.'  min ')
C
        STOP
        END
 8 --  sys$degadis:degadis1.for                   6-SEP-1989 16:18:54

-------
                                   D-22

c	
c
c
C       DIMENSIONS/DECLARATIONS for DEGADIS2
C
        include 'sys$degadis:DEGADIS1.dec/list1
C
C   MAXNOB IS THE MAXIMUM NUMBER OF OBSERVERS ALLOWED.
C
        parameter(      maxnob = 50,
     $                  RT2= 1.41 421 3562DO,   !  sqrt(2.0)
     $                  sqpio2= 1.25  331 4137DO)        !  sqrt(pi/2.)
C
 1 -- sys$degadis:degadis2.dec                  6-SEP-1989 16:25:49

-------
                                    D-23

        PROGRAM DEGADIS2
C
£***************************************************************************
£***************************************************************************
g***************************************************************************
C
C       Program description:
C
C       DEGADIS2 performs the downwind dispersion portion of the calculation
C       for each of several observers released successively over the transient
C       gas source described by DEGADIS1.
C
C
C       Program usage:
C
C       Consult Volume III of the Final Report to U. S. Coast Guard
C       contract DT-CG-23-80-C-20029 entitled "Development of an
C       Atmospheric Dispersion Model for Heavier-than-Air Gas Mixtures".
C
C       J. A.  Havens
C       T. 0.  Spicer
C
C       University of Arkansas
C       Department of Chemical Engineering
C       Fayetteville, AR  72701
C
C       April  1985
C
C
C       This project was  sponsored  by  the U. S.  Coast Guard and the  Gas
C       Research  Institute  under contract DT-CG-23-80-C-20029.
C
C
C       Disclaimer:
C
C       This computer code  material was  prepared by the University of
C       Arkansas  as an  account of work sponsored by the U. S. Coast  Guard
C       and the Gas Research  Institute.  Neither the University of Arkansas,
C       nor any person  acting on its behalf:
C
C       a.  Makes any warranty or representation, express or  implied,
C           with  respect  to the accuracy, completeness, or usefulness
C           of the information contained in this computer code material,
C           or that the use of any  apparatus, method, numerical model,
C           or process disclosed in this computer code material may  not
C           infringe privately owned rights; or
C
C       b.  Assumes any liability with respect to the use of, or for
C           damages resulting from  the use of, any  information,
C           apparatus, method, or process disclosed in this computer
C           code material.

1  -- sys$degadis:degadis2.for                  6-SEP-1989 16:25:58

-------
                                    D-24

C
C
£***********************»***«**»*************»***********»******************
Q***************************************************************************
C
C
C
C
C
C
C       DIMENSIONS/DECLARATIONS
C
C

        Implicit Real*8 ( A-H, 0-Z ), Integer*4 ( I-N )

        i nc I ude  ' sysSdegad i s : DEGAD I S2 . dec/ list'
        include  '(Sssdef)1
c
        COMMON
     S/GEN3/  radg(2,maxl),qstr(2,maxl),srcden(2,maxl),srcwc(2,maxl),
     $ srcwa(2,maxl),srcenth(2,maxl)
     S/SSCON/ NREC(maxnob>2},TO(maxnob)>XV(maxnob)
     S/TITL/  TITLE
     S/GENV  PTIME(igen), ET(igen),  R1T(igen),  PUC(igen),  PTEMP(igen),
     $        PFRACV(igen), PENTH(igen),  PRHO(igen)
     S/GEN2/  DEN(5,igen)
     S/PARM/  UO,ZO,ZR, ML, USTAR,K,G,RHOE,RHOA, DELTA, BETA, GAMMAF.CcLOW
     $/com_gprop/  gas_mw, gas_temp. gas_rhoe, gas_cpk, gas_cpp,
     $  gas_ufl,gas_lfl,gas_zsp,gas_naine
     S/ITI/  T1,TINP,TSRC,TOBS,TSRT
     S/ERROR/SYOER , ERRO , SZOER , UTA I 0, UTQOO , WTSZO, ERRP , SMXP,
     $  WTSZP,WTSYP,WTBEP,WTDH,ERRG,SMXG,ERTDNF,ERTUPF,UTRUH,UTDHG
     I/comatm/ i stab, tamb.pamb, humid, isof l.tsurf ,ihtf l.htco.iwtf l,wtco,
     t  hums re
     S/PARMSC/ RM , SZM , EMAX , RMAX , TSC1 , ALEPH , TEND
     S/STP/  STPO,STPP,ODLP,OOLLP,STPG,OOLG,OOLLG
     S/PHLAG/ CHECK1 , CHECIC2, AGAIN, CHECKS , CHECK4 , CHECKS
      $/com_sigx/ sigx_coeff,sigx_pow,sigx_min_dist,sigx_f lag
      S/NEND/ POUNDN, POUND
      S/ALP/  ALPHA, alpha!
      S/phicom/ iphifl.dellay
      $/sprd_con/ ce, delrhomin
      $/COM_SURF/ HTCUT
      S/STOPIT/ TSTOP
      S/CNOBS/ NOBS
      ./oorasin/ oodist.avtime
 c
         character*80 TITLE(4)
 2 -- sys$degadis:degadis2.for                  6-SEP-1989 16:25:58

-------
                                    D-25

        character*^ pound
        character*24 TINP.TSRC.TOBS.TSRT
        character*? gas_name
c
        reat*4 tt1
        REAL*8 K,ML,L
        LOGICAL CHECK1.CHECK2,AGAIN,CHECKS,CHECK4.CHECKS
C
        character*^ TR2,ER2.PSD,TR3, obs
        character OPNRUPC40)
        character*40 OPNRUP1
        equivalence (opnrup(1),opnrup1)
C
C	
c
C       DATA
C
        DATA TSTOP/0./
        DATA POUND/1//  '/,POUNDN/-1.E-20/
C
        DATA TIMEO/0./,NDIM/0/
        DATA RADG/maxl2*0./,OSTR/maxl2*0./,srcden/maxl2*0./
        DATA NREC/maxnob*0,maxnob*0/,T0/maxnob*0./,XV/maxnob*0./
C
        DATA TR2/'.TR2'/,ER2/'.ER2'/
        DATA PSD/'.PSD'/.TRS/'.TRSV, obs/'.OBS1/
C
C	
c
C       MAIN
C
        T1 = SECNDS(O-)
        istat =  lib$date_TIME(TOBS)
        ifd'stat  .ne. ss$_normal) stop'lib$date_time failure1
C
C**« GET THE FILE  NAME FOR  FILE CONTROL
C
c       WRITE(5,1130)
c1130   FORMATC Enter the  file name being used for this run: ',$)
        read(5,1130) nchar.opnrup
 1130   format(q,40a1)
C
        opnrup!  =  OPNRUPK1:nchar)  //  er2(1:4)
        CALL ESTRT2COPNRUP1>
C
C*** GET THE COMMON VARIABLES CARRIED  FROM DEGADIS1
C
        opnrupl  =  OPNRUP1(1:nchar)  //  tr2(1:4)
        CALL STRT2(OPNRUPl,H_masrte)
C
C

3  -- sys$degadis:degadis2.for                  6-SEP-1989 16:25:58

-------
                                    D-26
c	
c
C       PSEUDO STEADY STATE CALCULATIONS
C       INTEGRATION IN SUBROUTINE SUPERVISOR
C
        opnrupl = OPNRUP1(1:nchar) // psd(1:4)
        OPEN(UNIT=9,TYPE*'NEW',MAME=OPNRUP1,
     $  carriagecontrol='list',
     $  recordtype='variable1)
c
        opnrupl = OPNRUP1(1:nchar) // obs(1:4)
        OPEN( UNIT=12, TYPE='NEW',NAME=OPNRUP1,
     $  carriagecontrol='list',
     $  recordtype='variable')
C
        CALL SSSUP(Hjnasrte)
C
C	
C
        CLOSE(UNIT=9)
C
c
        call setden(1.DO,O.DO,H_masrte)  ! adiabatic mixing  w/ pure stuff
c
C
        opnrupl = OPNRUP1(1:nchar) // tr3(1:4)
        CALL TRANSCOPNRUP1)
C
        tt1 *  t1
        T1 s SECNDS
-------
                                    D-27

c	
c
c       declarations for DEGADIS3
c
        include 'sys$degadis:DEGADIS2.dec/list'
c
        parameter (     maxnt=40,
     $                  maxtnob=maxnt*maxnob)
c
1 •- sys$degadis:degadis3.dec                  6-SEP-1989 16:27:39

-------
                                    D-28

        PROGRAM DEGADIS3
C
Q*******************»****»**********«***»***»*******»****»**»***************
£*************•**»************«****»**«********«**********«*************»***
(;****************»***«*****••*********»***»«********************************
C
C       Program description:
C
C       DEGADIS3 sorts the downwind dispersion calculation made for each of
C       the several observers in DEGAOIS2.  The output concentrations at
C       several given times may then be corrected for along-wind dispersion
C       as desired.
C
C
C       Program usage:
C
C       Consult Volume  III  of the  Final Report to u. S. Coast Guard
C       contract DT-CG-23-80-C-20029 entitled "Development of an
C       Atmospheric Dispersion Model for  Heavier-than-Air Gas Mixtures".
C
C       J. A.  Havens
C       T. 0.  Spicer
C
C       University of Arkansas
C.      Department of Chemical Engineering
C       FayetteviIle, AR 77701
C
C       April  1985
 C
 C
 C       This project  was sponsored by  the U.  S.  Coast  Guard  and the Gas
 C       Research  Institute under contract DT-CG-23-80-C-20029.
 C
 C
 C       Disclaimer:
 C
 C       This computer code material was prepared by the University of
 C       Arkansas  as  an  account of work sponsored by the U. S.  Coast Guard
 C       and the Gas  Research Institute.  Neither the University of Arkansas,
 C       nor any person  acting on its behalf:
 C
 C       a.   Makes any warranty or representation,  express or implied,
 C            with  respect to the  accuracy, completeness, or usefulness
 C            of the information contained in this computer code material,
 C            or that  the use of any apparatus,  method,  numerical model,
 C            or process  disclosed in this computer  code material may not
 C            infringe privately owned rights;  or
 C
 C       b.   Assumes any liability with respect to  the use of,  or for
 C           damages resulting from the use of,  any information,
 C           apparatus,  method,  or process disclosed in this  computer

 1  -- sys$degadis:degadis3.for                  6-SEP-1989 16:27:45

-------
                                   D-29

C           code material.
C
C
r***************************************************************************
£***************************************************************************
(-************************************«****»***«»*»»*************************
C
C
C
C

        Implicit Real*8 ( A-H, 0-Z ), Integer** ( I-N )

        i nclude  < sysSdegadi s:DEGADI S3.dec/list'
        include  '(Sssdef)1
C
C*** MINIMUM DIMENSION ON TABLE IS 6 * MAXNOB + 1
C
        parameter  (ntabO=10*maxnob+1)
C
        COMMON
     S/SORT/ TCA(maxnob,maxnt)/TCASTR(maxnob,maxnt),
     $  Tyc(maxnob,maxnt),Trho(maxnob,maxnt),
     $  Tgamna(fflaxnob,maxnt)>Ttemp(maxnoblmaxnt)f
     $  TSY(maxnob,maxnt)>TSZ(maxnob,maxnt)lTB(maxnob,maxnt),
     S  TDISTO(maxnob,maxnt),TDIST(maxnob,maxnt),KSUB(maxnt)
     S/SSCON/ NREC(maxnob,2),TO(maxnob),XV(maxnob)
     S/SORTIN/  TIM(maxnt),NTIH,ISTRT
     S/GEN2/ DEN(5,igen)
     S/PARM/ UO,ZO,ZR,ML,USTAR,K,G,RHOE,RHOA,DELTA,BETA,GAMMAF.CcLOW
     $/com_gprop/  gasjnw,gas_temp,gas_rhoe,gas_cpk,gas_cpp,
     $  gas_ufl,gas_lfl,gas_zsp,gas_name
     S/ITI/ T1,TINP,TSRC,TOBS.TSRT
     $/comatm/  istab,tamb,pamb,humid,isofl.tsurf,ihtfl.htco.iwtfl.wtco,
     $  humsre
     $/PARHSC/  RM,SZM,EMAX,RMAX,TSC1,ALEPH,TEND
     S/PHLAG/ CHECK1,CHECK2.AGAIN,CHECKS,CHECK4,CHECKS
     $/com_sigx/ sigx_coeff,sigx_pow,sigx_min_dist,sigx_flag
     S/ERROR/ ERT1,ERDT,ERNTIM
     S/NEND/ POUNDN,POUND
     S/ALP/ ALPHA.alphal
     S/CNOBS/ NOBS
      ./oomsin/  oodistfavtime
 C
        LOGICAL  CHECK1.CHECK2,AGAIN.CHECK3.CHECKA,CHECKS
        REAL*8  ML,K
        DIMENSION  TABLE(ntabO)
 c
        character*24  tsrc,tinp.tobs.tsrt
 C
        character*? gas_name

 2  •- sys$degadis:degadis3.for                 6-SEP-1989 16:27:45

-------
                                    D-30

        character*4 TR3,PSD,Er3,SR3,Tr4
        character*40 opnrup!
        character opnrup(40)
C
        EQUIVALENCE (OPNRUP(1),opnrup1)
C	
C
C       DATA
C
        DATA POUNDN/-1.E-20/.POUND/'//  '/
        DATA TCA/maxtnob*0./,TCASTR/maxtnob*0./,TSY/maxtnob*0./
        data TSZ/maxtnob*0./,KSUB/rnaxnt*0/
        DATA TB/maxtnob*0./,TDISTO/maxtnob*0./,TO IST/maxtnob*0./
C
        DATA TRS/'.TRS'/.PSD/'.PSD1/
        DATA Ep3/I.Er3'/,SR3/1.SR31/fTr4/'.Tr41/
C
C*** UNITS
C*** 8 -• OUTPUT TO A PRINT FILE
C*** 9 •• I/O WITH DISK
C
        T1 = SECNDSCO.)
        istat =  lib$date_time(tsrt)
        if(istat  .ne. ss$_normal) stop'lib$date_time failure*
C
C
C*** GET  THE FILE  NAME  FOR  FILE CONTROL
C
c       URITE(5,1130)
C1130   FORMATC  Enter  the file name  used  for  this  run:  >,$)
        read(5,1130) nchar,opnrup
  1130   format(q,40a1)
C
C*** GET  THE VERSION NUMBER
C
 c  100   URITE(5.1140)
 c1140    FORMATC Enter  the version number (between 00  and  99) for1,
 c    $'  this  sort: ',$)
 c        CALL  GTLIN(DUMMY)
 C        NCAR  = LEN(DUMMY)
 c       IFCNCAR .EQ.  0) GO TO 110
 C
 C       IF(IVERIF(DUMMY,STRING)  .NE.  0) GO TO 110
 c       IFCNCAR-2) 130,140,120
 C
 c 110    WRITE(5,1150)
 c1150    FORMATC 7DEGADIS3? - Invalid character for version number')
 c       GO TO 100
 C
 c 120    WRITE(5,1160)
 C1160    FORMATC 7DEGADIS3? • Too many characters in the version number1)

 3 -•  sys$degadis:degadis3.for                  6-SEP-1989  16:27:45

-------
                                    D-31

C       GO TO 100
C
c 130   DOTC1) = "060
c       DOT(2) = DUMMYd)
c       GO TO 150
C
c 140   DOT(1) = DUMMYd)
c       DOU2)' = DUMMYC2)
C
c 150   CONTINUE
e       CALL CONCAT(Er3,DOT,Er3)
c       CALL CONCAT(Sr3,DOT,Sr3)
c       CALL CONCAT(Tr4,DOT,Tr4)
C
C*** NOW, REPLACE THE FILE NAME IN OPNRUP
C
C       CALL SCOPYCBFILE,OPNRUP)
C
C*** THATS IT
C
        opnrupl « opnrup1d:nchar) // tr3(1:4)
        CALL STRT3(OPNRUP1}
C
        opnrupl = opnrupl(1:nchar) // er3(1:4)
        CALL ESTRT3(OPNRUP1)
C
        opnrupl = opnrupl(1:nchar) // psd(1:4)
        OPEN(UNIT=o,NAME=OPNRUP1fTYPE='OLD')
C
C	
C
C       TIME SORT SUPERVISOR -• CALCULATE DOWNWIND DISPERSION CORRECTION
C
        CALL SORTS(TABLE)
C
        CLOSE(UNIT=9)
C
C	
C
C       OUTPUT  SORTED PARAMETERS
C
        opnrupl  = opnrupldrnchar) // SR3(1:4)
        CALL SRTOUKOPNRUP1, table)
C
        opnrupl  = opnrupl(1:nchar) // tr4(1:4)
        CALL TRANS(OPNRUP1)
C
        STOP
        END
 4 -•  sys$degadis:degadis3.for                  6-SEP-1989 16:27:45

-------
                                    D-32

c	
c
c       declarations for DEGADIS4
c
        include 'sys$degadis:DEGADIS3.dec/list'
c
        parameter (ndos=10)
c
 1 -- sys$degadis:degadis4.dec                  6-SEP-1989 16:29:31

-------
                                    D-33

        PROGRAM DEGADIS4
C
(-********************************************»******************************
Q* **************************************************************************
Q*»»**********»***************««************************»*************»*****
C
C       Program description:
C
C       DEGADIS4 sorts the downwind dispersion calculation made for each of
C       the several observers in DEGADIS2.  The output concentrations at
C       several given times may then be corrected for along-wind dispersion
C       as desired.  DEGADIS4 also outputs the concentration as a function
C       of time at a given position.
C
C
C       Program usage:
C.
C       Consult Volume III of the Final Report to U. S. Coast Guard
C       contract DT-CG-23-80-C-20029 entitled "Development of an
C       Atmospheric Dispersion Model for Heavier-than-Air Gas Mixtures".
C
C       J. A.  Havens
C       T. 0.  Spicer
C
C       University of Arkansas
C       Department of Chemical Engineering
C       Fayetteville, AR 72701
C
C       April  1985
C
C
C       This project was sponsored by the U. S. Coast Guard and the Gas
C       Research Institute under contract DT-CG-23-80-C-20029.
C
C
C       Disclaimer:
C
C       This computer code material was prepared by the University of
C       Arkansas as an account of work sponsored-by the U. S. Coast Guard
C       and the Gas Research Institute.  Neither the University of Arkansas,
C       nor any person acting on its behalf:
C
C       a.  Makes any warranty or representation, express or implied,
C           with respect to the accuracy, completeness, or usefulness
C           of the information contained in this computer code material,
C           or that the use of any apparatus, method, numerical model,
C           or process disclosed in this computer code material may not
C           infringe privately owned rights; or
C
C       b.  Assumes any  liability with respect to the use of, or  for
C           damages resulting from the use of, any  information,

1  --  sys$degadis:degadis4.for                  6-SEP-1989 16:29:36

-------
                                     D-34

C           apparatus, method,  or process disclosed in this computer
C           code material.
C
C
Q***************************************************************************
£***************************************************************************
g***************************************************************************
C
c
C
C

         Implicit Real*8 C A-H, 0-Z  ), Integer*4 (  I-N )

         include  'sys$degadis:DEGADIS4.dec/list1
         include  '(Sssdef)1
C
C*** MINIMUM  DIMENSION ON TABLE  IS  6 * MAXNOB + 1
C
         parameter  Ttemp(maxnob,maxnt)>
     $  TSY(maxnob,maxnt),TSZ(maxnob,maxnt),TB(maxnob,maxnt),
     $  TDISTO(maxnob,maxnt),TDIST(maxnob,maxnt),KSU8(maxnt)
     S/SSCON/ NREC(maxnob,2),TO(maxnob),XV(maxnob)
     $/cdos/  idos, dosdisx(ndos), dosdis(4,2,ndos)
     S/SORTIN/ TIM(maxnt),NTIM,ISTRT
     S/GEN2/  DEN(5,igen)
     S/PARM/  UO.ZO.ZR,ML,USTAR,K,G,RHOE,RHOA,DELTA,BETA,GAMMAF.CcLOW
     $/com_gprop/  gas_mw,gas_temp,gas_rhoe,gas_cpk,gas_cpp,
     X gas_ufI,gas_lfI,gas_zsp,gas_name
     $/ITI/ T1,TINP,TSRC,TOBS,TSRT
     $/comatm/ istab,tamb.pamb,humid,isofl.tsurf,ihtfl.htco,iwtfl.wtco,
     $ hums re
     S/PARMSC/ RM,SZM,EMAX,RMAX,TSC1,ALEPH,TEND
     S/PHLAG/ CHECK1,CHECK,AGAIN.CHECKS,CHECK4,CHECKS
     $/com_sigx/ sigx_coeff,sigx_pow,sigx_min_dist,sigx_flag
     S/ERROR/ ERT1,ERDT,ERNTIM
     S/NEND/ POUNDN,POUND
     S/ALP/ ALPHA.alphal
      S/CNOBS/ NOBS
 C
         LOGICAL CHECK1.CHECK2,AGAIN,CHECKS,CHECK4,CHECKS
         REAL*8 ML,K
         DIMENSION TABLE(ntabO)
 c
         character*24 tsrc,tinp,tobs,tsrt
 C

 2 --  sys$degadis:degadis4.for                  6-SEP-1989 16:29:36

-------
                                    D-35

        character's gas_name
        character*4 TR3,PSD,Er3.SR4,Tr4
        character*40 opnrupl
        character opnrup(40)
C
        EQUIVALENCE (OPNRUP(I),opnrupl)
C	
C
C       DATA
C
        DATA POUMON/-1.E-20/,POUND/1//  '/
        DATA TCc/maxtnob*0./,TCcSTR/maxtnob*0./,TSY/maxtnob*0./
        data TSZ/maxtnob*0./,ICSUB/maxnt*0/
        DATA TB/maxtnob*0./,TDISTO/maxtnob*0./.TDIST/maxtnob*0./
C
        DATA TRS/'.TRS'/.PSD/'.PSD'/
        DATA- Er3/'.Er3'/,SR4/'.SR4'/,Tr4/'.Tr4'/
C
C*** UNITS
C**» s  .. OUTPUT TO A PRINT FILE
C*** 9  •- I/O WITH DISK
C
        T1 = SECNDSCO.)
        istat -  lib$date_time(tsrt)
        if(istat  .ne. ss$_normal) stop1lib$date_time failure1
C
C
C*** GET  THE FILE  NAME FOR  FILE  CONTROL
C
        WRITE(lunlog,1130)
 1130    FORMATC  Enter the  file  name  used  for this  run:  ',$)
        read(5(1131) nchar.opnrup
 1131   format(q,40a1)
C
C
        opnrupl  =  opnrup1(1:nchar) // tr3(1:4)
        CALL STRT3(OPNRUP1)
C
        opnrupl  =  opnrupl(1:nchar) // er3(1:4)
        CALL ESTRT3(OPNRUP1)
C
c
C	
c
c       input the  position  to calculate the concentration histograms
c
        write<6,*)  'Enter the number  of downwind distances desired:1
        write(6,*)  ' max of ',ndos,
        1        '  downwind  distances;  4 positions at each distance1
        read<5.*)  jdos
        if(jdos  .gt. ndos)  jdos=ndos

3  -• sys$degadis:degadis4.for                  6-SEP-1989 16:29:36

-------
                                    D-36
        do ii=1,jdos
        write(6,*)  '  '
        write(6,»)  'enter  the  x  coordinate:1
        read(5,») dosdisx(ii)
                write<6,*)
        1        '   enter the y and z  coordinate pairs  at  this distance:1
                do  ij=1,4
                read(5,*>  (dosdisCij.jj.ii),jj=1,2>
                if(dosdis(ij,2,ii).le.O.  .and.
        1                dosdisCij,1,ii).le.O.)  goto  100
                enddo
 100    continue
        enddo
c
c
        opnrupl = opnrup1(1:nchar) // SR4(1:4)
        open(unit=8,name=opnrup1, type-1new1,carriagecontrol='fortran')

        do idos=1,jdos
C
C	
c
C       TIME SORT SUPERVISOR  -• CALCULATE DOWNWIND DISPERSION CORRECTION
C
        opnrupl * opnrupl(1:nchar) // psd(1:4)
        OPEN(UNIT=9,NAME=OPNRUP1,TYPE='OLO')
C
        do ij=1,maxnt
        KSUB(ij) * 0
        do ijk=1,maxnob
        TSZ(ijk.ij) = 0.
        enddo
        enddo
c
c
        CALL SORTS(TABLE)
C
        CLOSE(UNIT=9>
C
C	
C
C       OUTPUT SORTED PARAMETERS
C
        CALL dosOUT(table)
c
        enddo
c
        ctose(unit=8)
c
C
 4 --  sys$degadis:degadis4.for                  6-SEP-1989  16:29:36

-------
                                   D-38
C	
c
c       declarations for DEGADISIN
C
C
        parameter^       igen= 30,    ! dimension of /genV and /gen2/
     $                  pi= 3.14  159 265 358 24DO)
c
 1 -- sys$degadis:degadisin.dec                 6-SEP-1989 16:36:05

-------
                                    D-39

Q***************************»***********************************************
(•******************************»*»******************************************
Q«************«**************************************************«**********
c
C       PROGRAM DEGADISIN
C
C       Program description:
C
C       DEGADISIN acts as an interactive input module to the programs
C       which make up the DEGADIS model.  The user is guided through a
C       series of questions which supply the model with the necessary
C       input information.
C
C
C       Program usage:
C
C       Consult Volume III of the Final Report to U. S. Coast Guard
C       contract DT-CG-23-80-C-20029 entitled "Development of an
C       Atmospheric Dispersion Model for Heavier-than-Air Gas Mixtures".
C
C       J. A. Havens
C       T. 0. Spicer
C
C       University of Arkansas
C       Department of Chemical Engineering
C       FayetteviIle, AR 72701
C
C       April 1985
C
C
C.      This project was sponsored by the U. S. Coast Guard and the Gas
C       Research Institute under contract DT-CG-23-80-C-20029.
C
C
C       Disclaimer:
C
C       This computer code material was prepared by the University of
C       Arkansas as an account of work sponsored by the U. S. Coast Guard
C       and the Gas Research Institute.  Neither the University of Arkansas,
C       nor any person acting on its behalf:
C
C       a.  Makes any warranty or representation, express or implied,
C           with respect to the accuracy, completeness, or usefulness
C           of the information contained in this computer code material,
C           or that the use of any apparatus, method, numerical model,
C           or process disclosed in this computer code material may not
C           infringe privately owned rights; or
C
C       b.  Assumes any  liability with respect to the use of, or  for
C           damages resulting from the use of, any  information,
C           apparatus, method, or process disclosed  in this computer

1  --  sys$degadis:degadisin.for                 6-SEP-1989 16:36:12

-------
                                     D-40

C           code material.
C
C
C***************************************************************************
Q**********»**»***«**********«**********************************************
(;**********»****»************»**»**********»»*******»***********************
C
C
C
C       INITIAL INPUT FOR DEGAOIS ROUTINES
c
c       note: this series of programs relies on the system wide
c               logical symbol SYSSDEGADIS which denotes the source
c               and executable code  for  these  images.
C
c
        PROGRAM DEGADISIN

         Implicit  Real*8  ( A-H, 0-Z  ),  Integer*4  (  I-N  )
         include 'SYS$OEGADIS:degadisin.dec'
 c
         COMMON
      S/TITL/ TITLE
      $/GEN1/ PTIME(igen),  ET(igen),  R1T(igen),  PWC(igen),  PTEMP(igen),
      $       PFRACV(igen), PENTH(igen),  PRHO(igen)
      S/GEN2/ OEN(S,igen)
      S/ITI/ T1,TINP,TSRC,TOBS.TSRT
      S/PARM/ UO,20,ZR,ML,USTAR,K.G,RHOE,RHOA,DELTA,BETA,GAMMAF,CcLOW
      S/com_gprop/ gas_mw,gas_temp,gas_rhoe,gas_cpk,gas_cpp,
      $ gas_ufl,gas_lfl,gas_zsp,gas_name
      $/com_ss/ ess,slen,swid,outcc,outsz,outb,outl
      S/PHLAG/ CHECK1.CHECK2,AGAIN,CHECKS,CHECK4,CHECKS
      $/com_sigx/ sigx_coeff,sigx_pow,sigx_min_dist,sigx_flag
      S/NEND/ POUNDS,POUND
      ./oomsin/ oodist,avtime
 C
         character*80 TITLE(4)
 C
         character*3 gas_name
         character*4 pound
         character*24 TSRC,TINP,TOBS,TSRT
 C
         REAL*8 ML,K
         LOGICAL CHECIC1,CHECIC2,AGAIN,CHECKS,CHECK4,CHECKS
 c
 c checkl
 c check2=t      cloud type  release with no liquid source; SRC1  DEGADIS1
 c again         local communicat ions in SSSUP                   SSSUP
 c check3        local communications between SRC1 and NOBL      DEGADIS1

 2 -- sys$degadis:degadisin.for                 6-SEP-1989 16:36:12

-------
                                   D-41

c check4=t      steady state simulation                         DEGADISIN
c check5=t      operator sets sort parameters                   ESTRT3
c
        data CHECK1/.false./,CHECK2/.false./.AGAIN/.false./
        data CHECKS/.false./,CHECK4/.false./.CHECKS/.false./
C
        character*100 OPNRUP
        character OPNRUPK100)
        equivalence (opnrup1(1),opnrup)
        character*4 INP,er1,er2,er3,com,sclfsr3,lis
        character*^ dummy
        character*3 plus
        character*? con
        DATA POUND/'//   '/.POUNDN/-1.E-20/
C
        DATA PTIHE/igen*O.DO/
        DATA ET/igen*O.DO/.R1T/igen*O.DO/
        DATA PWC/i gen*0.DO/,PTEMP/i gen*0.DO/
        DATA PFRACV/i gen*0.DO/,PENTH/i gen*0.DO/
        DATA PRHO/igen*O.DO/
        data DEN/i gen*0.,i gen*0.,i gen*0.,i gen*0.,i gen*0./
        DATA INP/l.INPl/,er1/l.er1'/.er2/'.er2'/,er3/l.er31/
        data scl/'.scl'/.srS/'.srS'/.lis/'.lis'/
        data com/1.com1/
        data plus/1  +  '/.con/1 •'/
 c
 C***  GET  THE FILE NAME  TO BE USED BY ALL OF  THE ROUTINES
 C
        URITE<6,800>
        URITE(6,810)
        RE AD (5,820)  NCHAR.opnrup
        opnrup = opnrup(1:nchar) //  inp(1:4)
 C
 C***  NOW  GET THE REST  OF THE DESIRED INFORMATION
 C
        CALL lOT(OPNRUP)
        URITE(6,1000)
        if(check4) then
        write(6,1001)    !  continuous
        else
                 if(uO  .eq.  0.) then
                         write(6,1009)
                 else
                         WRITE(6,1002)    !  transient
                 endif
        endif
        write(6,1010)
 C
 C***  FORMATS
 C
   800  FORMAT(//,16X,'DEnse GAs Dispersion Model input module.1)

 3  --  sys$degadis:degadisin.for                 6-SEP-1989  16:36:12

-------
                                    D-42

  810   FORMATC/,'  Enter  the  simulation name1,
     $•  :  [DiRiRUNNAME  ',$)
  820   FORMAT(Q.A40)
 1000   FORMATC  ',/,
        In addition to  the  information just obtained,',
        DEGAOIS1,/,1  requires a series of numerical parameter1,
      1  files which use1,/,'  the1,
        same name as [DIR3RUNNAME given above.  ',//,
           For convenience, example parameter files are  included for1,/,
        each step.   They  are:')
 1001   FORMAT(1OX,1EXAMPLE.ER1 and1,/,10X,'EXAMPLE.ER2')
 1002   formatClOX,'EXAMPLE.ER1,',/,10X,'EXAMPLE.ER2, and1,/,
     $1OX,1EXAMPLE.ER3')
 1009   formatdOx,'EXAMPLE.ER11)
 1010   formate  Note  that each of,
     $'  these files can be edited during  the course of the',/,
     $'  simulation  if a parameter proves  to be  out of specification.',/)
c
c
        write(6,1200)
 1200   formate  Do you want  a command file to  be generated to execute1,
     $' the procedure?   ',$)
        REad(5,1210) dummy
 1210   format(a4)
        ifCdummy.eq.'n'  .or.  dummy.eq.'N')  goto 3000
        opnrup * opnrup(1:nchar) // com(1:4)
        write<6,1220) opnrup
  1220   formate The command file will be generated under the file',
     $' name:',/,10x,a40)
 c
        open(umt=8,name=opnrup,type='new',
     S  carriagecontrol='list1,recordtype='variable1)
 c
        opnrup = opnrup(1:nchar) // er1(1:4)
 c
        write(8,1250)  
-------
                                    D-43

 1270           formates copy/log  SYS$DEGADIS:example.er3  \40a1)
c
                write(8,1280)
 1280           formates run  SYS$DEGADIS:DEGAD1SV)
                write<8,1290)  (opnrupKi), i=1,nchar)
 1290           format(40a1)
                write(8,1300)
 1300           formates run  SYSSDEGADIS:DEGADIS2')
                uri te(8,1290)  (opnrupl(i),i =1,nchar)
                write(8,1320)
 1320           formatCS run  SYSSOEGADIS:DEGADIS3')
                urite(8.1290)  (opnrupl(i),i=1,nchar)
c
                opnrup = opnrup(1:nchar)  //  scl(1:4) //
        1       plus(1:3) // opnrup(1:nchar)  //  sr3(1:4) // con(1:2)
                write<8,1370)  (opnrupl(i),i=1,2*nchar+13)
 1370           formates copy/log  ',100a1>
c
                opnrup = opnrupd :nchar)  //  lis(1:4)
                write(8,1390)  (opnrupKi), i=1,nchar+4)
 1390           formate   '.40a1)
        else
                urite(8,1280)
                write(8,1290)  (opnrupl(i),i=1,nchar)
c
                write(8,1330)
 1330           formates run SYSSOEGAOIS:SDEGADIS2')
                urite(8,1290)  (opnrupl(i),i=1,nchar)
c
                opnrup = opnrupd :nchar) //  scl(1:4)  //
         1       plus(1:3) // opnrupd :nchar) // sr3(1:4)  // con(1:2)
                urite(8,1370) (opnrupl (i).i=1.2*nchar«-13)
                opnrup = opnrupd:nchar) //  lis(1:4)
                uri te(8,1390) (opnrupl(i),i=1,nchar+4)
         endif
c
 1340    close(unit-S)
         write(6,1350)
 1350    format(/,' Do you wish to initiate this procedure? ',
     $'    ',$)
         REad(5,1210) dummy
         if(dummy.eq.'y'  .or. dummy.eq.'Y')  goto 2000
         goto 3000
 2000    opnrup =  '3' // opnrupd:nchar) // ' '
         istat = Iib$do_command(opnrup)
         write(6,2100)
 2100    formate/,1 7DEGADISIN? command file failed to start.')
c
 3000    continue
         CALL EXIT
         END

5  -- sysSdegadisidegadisin.for                 6-SEP-1989 16:36:12

-------
                                    D-45

        SUBROUTINE dosOUT(table)
c

        Implicit Real*8 ( A-H, 0-2 ), Integer*4 ( I-N )

        include 'sys$degadis:DEGADIS4.dec/list'
C
        COMMON /SORT/TCc(maxnob,maxnt),TCcSTR(maxnob,maxnt),
     $  Tyc(maxnob,maxnt),Trho(maxnob,maxnt}f
     $  Tganma(maxnob,maxnt),Ttemp(maxnob,maxnt),
     $  TSY(maxnob,maxnt),TSZ(maxnob,maxnt),TB(maxnob,maxnt),
     $  TDISTO(maxnob,maxnt),TDIST(maxnob,maxnt),KSUB(maxnt)
     S/cdos/ idos, dosdisx(ndos), dosdis(4,2,ndos)
     $/SORTIN/TIM(maxnt),NTIM,ISTRT
     $/com_gprop/ gas_mw,gas_temp,gas_rhoe.gas_cpk,gas_cpp,
     $ gas_ufl,gas_lfl,gas_zsp,gas_name
     $/comatm/ istab,tamb.pamb,humid,isofl,tsurf,ihtfl,htco,iwtfl,utco,
     S humsre
     $/com_s i gx/ s i gx_coef f, s i gx_pow, s i gx_mi n_d i st, s i gx_f I ag
     $/alp/ alpha,alpha!
C
        dimension tabled)
        dimension chist(4,maxnt)
c
        logical cflag,cflagl
c
        character's gas_name
C
        if(sigx_flag.eq. 0.) then
                write(8,1102)
        else
                write<8,1104)
                write<8,1105) sigx_coeff,sigxjx)M,sigx_min_dist
                endif
c
        cflag = isofl.eq. 1.or.  ihtfl.eq. 0
        cflag1= isofl.eq.1
        if(cflag) then
                call adiabat(2,uc,wa,gas_lfl,ya,cc_lfl,r,w,t,tt)
                call adiabat(2,wc,ua,gas_ufl,ya,cc_ufl,r,w,t,tt)
                endif
C
        URITE(8,1110) dosdisx(idos)
c
        WRITE(8,1119)
        WRITE(8,1119)
        if(cflagl) then
                WRITEC8.1116) gas_zsp,(100.*gas_lfl),(100.*gas_ufl)
                WRITE<8,1118)
        else
                WRITE(8,1115) gas_zsp,(100.*gas_lfl),(100.*gas_ufl)

 1  •• sys$degadis:dosout.for                    6-SEP-1989  16:38:38

-------
                                   D-46

               URITE(8,1117)
               endif
       URITE(8,1119)
       ip = 0

       DO 110  I=ISTRT,NTIM

       II = KSUB(I)

       j = 1
       disto   -  tdist(j.i)
       ceo     *  tccstr(j,i)
       rhoo    =  Trho(j,i)
       yco     =  Tyc(j.i)
       tempo   -  Ttemp(j,i)
       gammao =  Tganma(j,i)
       bo      =  tb(j,i)
       szo     =  tsz(j.i)
       syo     =  tsy(j.i)
        if(  disto -gt. dosdisx(idos)  ) then
               writedunlog,*) '  Extrapolated point for time:  ',Tim(i)
       write(8,*) '  Records for ',tim(i),' s are missing -  see source1
                goto 110
               endif
c
       DO 120 J=2,II
c
        dist  s tdistCj.i)
        cc    » tccstr(j.i)
        rho   « Trho(j,i)
        yc    = Tyc(j.i)
        temp  s Ttemp
-------
                                    D-47

                call adiabat(-2,wc,wa,gas_lfl,ya,cc_lfl,r,w,gamma,tt)
                call adiabat(-2,wc,wa,gas_ufl,ya,cc_ufl,r,w,gamma,tt)
                endif
c
e*** calc the concentration time histories
c
        do ij=1,4
                chist(ij,i) = 0.
           if(dosdis(ij,2.idos) .ge. 0.) then
        arg = (dosdisCij,2.idos)/sz)**alpha1
        if(dosdis(ij,1,idos) .gt. b) arg = arg +
        1                       ((dosdis(ij,1.idos)-b)/sy)**2
                if(arg .It. 80.) then
                        chist(ij.i) = cc/exp(arg)
        if(cflag) then
                call adiabat(0,xx,aa,ycc,yaa,chist(ij,i),rr,ww,gg,tt)
        else
                call adiabat(-1,xx,aa,ycc,yaa,chist(ij,i),rr,ww,gannnia,tt)
        endif
                chist(ij.i) = ycc
                endif
           endif
        enddo
 c
 c
        arg =  (gas_zsp/sz)**alpha1
         if(arg  .ge.  80.)  then
             if(cflagl) then
                WRITE(8,1120)  tim(I),yc,Cc,rho,temp,B,SZ,SY
            else
                URITE(8,1120)  tim(I),yc,Cc,rho.gammaftemp,BfSZ,SY
            endif
            goto 600
        endif
 c
        ccz = cc/exp(arg)
         if(ccz  .It.  cc_lfl) then
                if(cflagl) then
        WRITE(8,1120)  tim(I),yc,Cc,rho,temp,B.S2,SY
                        else
        WRITE(8,1120)  tim(I),ycfCc,rhofgainnaftennp,B,SZ,SY
                        endif
                goto 600
                endif
        arg *  -(dlog(cc_lfl/cc) +  (gas_zsp/sz)**alpha1)
        blfl =  sqrt(arg)*sy +  b
 c
         if(ccz  .It.  cc_ufl) then
                if(cflagl) then
        WRITE(8,1120)  tim(I),ycfCc,rho,temp,B,SZ,SY,blfl
                        else

 3  --  sys$degadis:dosout.for                     6-SEP-1989  16:38:38

-------
                                   D-48

        WRITE(8,1120)  tim(I),yc,Cc,rho,gamma,temp,B,SZ,SY,blft
                        endif
                goto 600
                endif
        arg = -(dlog(cc_ufl/cc)  + (gas_zsp/sz)**alpha1)  .
        bufl « sqrt(arg)*sy +  b
                if(cflagl)  then
        URITECS,1120)  tim(I),yc,Cc,rho,temp,B,SZ,SY,blfl,bufl
                        else
        WRITE(8,1120)  tim(I),yc,Ccfrho,ganmaftemp,B,SZ,SY,blfl,bufl
                        endif
c
  600   continue
        goto 121
  119   continue
        disto  = tdist(j.i)
        ceo    = tccstr(j,i)
        rhoo   * Trho(j.i)
        yco    « Tyc(j.i)
        tempo  = Ttemp(j.i)
        gammao * Tgamma(j,i)
        bo    = tb(j,i>
        szo     = tsz(j.i)
        syo    = tsy(j,i)
  120   CONTINUE
 c
  121   ip = ip *  1
        if(ip .eq.  3)  then
                ip =  0
                write(8f1119)
                endif
  110   CONTINUE
 C
 c*** output the concen time histories
 c
        write(8.1119)
        nrite(8.1119)
         iii  = 0
        do ij=1.4
            ifCdosdisd"j,2,idos).gt.O.  .and.
         1                dosdisO"j,1,idos).gt.O.)  iii  =  ij
        enddo

         ifO'ii  .eq. 0) return
         ip s 0

        write<8,2100) ((dosdisd"j,iij,idos),ij=1,4),iij=1,2)
  2100    format(1HO,11x,'Time',11x,4(4x.'Mole fraction at:',5x),/,
         1        1H ,26x,4(4x,'y= '1pg13.5,'  m',4x),/,
         1        1H ,11x,'
-------
                                   D-49
        write(8,2200) tim( i ), (chist(i j , i ), i j=1 , i i i )
        ip = ip + 1
        if(ip .eq. 3) then
                ip = 0
                write(8.1119)
                endif
        enddo
 2200   format (1h ,5(6x,1pgH.7,6x))
C
c
 1102   format(1HO,5x, 'X-Direction correction was  NOT  applied.1)
 1104   format(1HO,5x, 'X-Direction correction was  applied.1)
 1105   formatdh ,5x.5x, 'Coefficient:       ',1pg13.5./,
        1       1h ,5x,5x, 'Power:             ',1pg13.5,/,
        1       1h ,5x,5x, 'Minimum Distance:  ',1pg13.5' m1)
 1110   FORMAT ( 1 HO ,5X, ' Center line values for  the position  -->',/,
        1       ' x: 'f1pg13.5,'  m',/)
 1115   FORMATdHO.IX,'   Time  'f2x.3x, 'Mole' ,3x,
        1       'Concentration' ,1x, "Density1, 2x,3x, 'Gamma1 ,3x,
        1       'Temperature' ,3x, 'Half ' ,4x,4x, 'Sz' ,5x,4x, 'Sy' ,5x,
        1       'Width at z*',0pf6.2t'  m to^./Jx.llx.lx'Fraction'^x,
        1       11x.11xf11x,11x,3x. 'Uidth',3x,11xf9x.
        1       2<1pg9.3f'mole%',1x))
 1116   FORMAT(1HO,1X,'   Time  ',2x,3x, 'Mole' ,3x,
        1        'Concentration', 1x, 'Density', 2x,
        1        'Temperature' ,3x, 'Half ' ,4x,4x, ' Sz' , 5x,4x, 'Sy' ,5x,
        1        'Width at z=',0pf6.2, ' m to:1,/. 1x,11x,1x'Fraction',2x,
        1       11x,11x,11x,3x, 'Width', 3x,11x,9x,
        1       2(1pg9.3,'n»leX',1x))
 1117   FORMATC1H ,4X, '(s)' ,4x,11x.
        1       2dX.'
-------
                                 D-50



     ROUTINE TO GET RUN PARAMETERS FROM A FILE

     SUBROUTINE ESTRTKOPNRUP)

     Implicit Real*8 ( A-H, 0-Z ), Integer*4 ( I-N )
     include 'sys$degadis:DEGADIS1.dec'
     parameterC
     1
     1
     1
     1
     1
     1
     1
     1
     1

     BLOCK COMMON
iend= 22,
iend1= iend+1.
iiiend= 2,
iiiend1= iiiend+1,
iiend* 2,
iiend1« iiend+1,
jend= 4,
jend1« jend+1,
mends 5,
mend1= mend+1)
     COMMON
  $/ERROR/STPIN,ERBND,STPMX,UTRG,WTtm,UTya,wtyc,wteb,wtmb,wtuh,XLI,
  $ XRI,EPS,ZLOW,STPINZ,ERBNDZ,STPMXZ,SRCOER,srcss,srccut,
  $ htcut,ERNOBL(NOBLpt,crfger,epsilon
  S/vucoro/ vua,vub,vuc,wjd,vudetta,vuflag
  $/szfc/ szstpO,szerr,szstpmx,szszO
  $/alphcom/  ialpfl.alpco
  S/phicom/ iphifl.dellay
  $/sprd_con/ ce, delrhomin
     EQUIVALENCE
  S(RLBUFC1),STPIN),
  S(RLBUF(2),ERBND),
  $(RLBUFC3).STPMX)f
  S(RLBUF(4),WTRG),
  $(RLBUFC5),WTtm),
  S(RLBUF(6),UTya),
  $(RLBUF(7),WTyc),
  $(RLBUFC8),UTeb),
  $(RLBUF(9).WTmb).
  $(RLBUF(10),UTuh),
  $(RLBUF(11),XLI),
  $(RLBUF(12),XRI),
  $(RLBUF(13),EPS)
      equivalence
  $(RLBUF(14),ZLOU),
IMAIN -
IMAIN •
IMAIN -
IMAIN -
IMAIN -
IMAIN •
IMAIN -
(MAIN -
IMAIN •
IMAIN •
IALPH -
"ALPH -
I ALPH -
RKGST
RKGST
RKGST
RKGST
RKGST
RKGST
RKGST
RKGST
RKGST
RKGST
LOWER
UPPER
ERROR
   ! ALPH I
   $(RLBUF(15),STPINZ),  "ALPHI
        INITIAL STEP SIZE
        ERROR BOUND
        MAXIMUM STEP SIZE
        WEIGHT FOR RG
        WEIGHT FOR Total mass
        WEIGHT FOR Ya
        WEIGHT FOR Yc
        WEIGHT FOR Energy Balance
        WEIGHT FOR Momentum Balance
        WEIGHT FOR Ueff*Heff
LOWER LIMIT OF SEARCH FOR ALPHA
UPPER LIMIT OF SEARCH FOR ALPHA
ERROR BOUND USED BY "RTMI"

 BOTTOM HEIGHT FOR FIT OF ALPHA '
 INITIAL RKGST STEP <0.
-•  sys$degadis:estrt1.for
                        6-SEP-1989 16:40:49

-------
                                   D-51

    $(RLBUF(16),ERBNDZ),  IALPHI  - ERROR BOUND FOR RKGST
    $,
$(rlbuf4(2),vub),
$(rlbuf4(3),vuc),
$(rlbuf4(4),vud),
                        !  Constant  Av in  SRC1
                        !  Constant  Bv in  SRC1
                        !  Constant  Ev in  SRC1
                        !  Constant  Dv in  SRC1
$(rlbuf4(5),vudelta)
                                  Constant DELTAv in  SRC1
        character*40 OPNRUP
        character DUMMY ( 1:132)
        DIMENSION RLBUF(iend), rlbuf i(iiiend),  rlbufa(iiend)
        dimension rlbuf Kjend)
        dimension rlbuf4(mend)
c
        logical vuflag
C
        OPEN(UNIT=9,MAME=OPNRUP,TYPE='OLD1,err=2000)
C
C*** READ A LINE AND DETERMINE ITS PURPOSE
C
        I = 1
  100   CONTINUE
        READ(9,1000,END=350) NCHAR, DUMMY
        IF(DUMMY(1) .EQ.  '!') GO TO 100
        DECOOEC20, 1010, DUMMY, ERR=400) RLBUF(I)
        1 = 1 + 1
        if(i .eq. iendl)  goto 110
        GO TO 100

  110   CONTINUE
        READ(9,1000,END=350) NCHAR, DUMMY
2 •• sys$degadis:estrt1.for
                                          6-SEP-1989 16:40:49

-------
                                    D-52

        IF(DUMMYd)  .EQ.  '! • )  GO TO  110
        DECODE(20,1010,DUMMY,ERR=400) ptnobl
        NOBLPT  = INT(PTNOBL}

        I  = 1
  120   CONTINUE
        READ(9,1000,END=350) NCHAR,DUMMY
        IF(DUMMYd)  .EQ.  '!')  GO TO  120
        DECODEC20,1010,DUMMY.ERR=400) RLBUFi(I)
        1  = 1  + 1
        if(i .eq. iiiendD goto 140
        GO TO 120
C
C*** READ A LINE AND DETERMINE ITS PURPOSE for /sprd_con/
C
  140   1=1
  150   CONTINUE
        READ(9,1000,END=350) NCHAR,DUMMY
        IF(DUMMYd)  .EQ.  '!')  GO TO 150
        DECOOEC20,1010,DUMMY,ERR=400)  RLBUFaU)
        1 = 1  + 1
        if(i .eq. iiendl) goto 190
        GO TO 150
C
C*** READ A LINE AND DETERMINE ITS PURPOSE to fill szfc
C
  190   1=1
  200   CONTINUE
        READ(9,1000,END=350> NCHAR,DUMMY
        IF(DUMMY(1)  .EQ.  '!')  GO TO 700
        DECODEC20,1010,DUMMY,ERR=400)  RLBUFI(I)
        1 = 1  + 1
        ifO" .eq. jendl) goto 230
        GO TO 200
c
C*** READ A LINE AND DETERMINE ITS PURPOSE to fill /alphcom/
C
  230   1=1
  240   CONTINUE
        READ(9,1000,END=350) NCHAR,DUMMY
        IF(DUMMYd) .EQ.  '!') GO TO 240
        DECOOEC20,1010,DUMMY,ERR=400) Ralpfl

         ialpfl  =  int(ralpfl)

  250   CONTINUE
        READ<9,1000,END-350)  NCHAR,DUMMY
         IF(DUMMYd) .EQ.  '!')  GO  TO 250
        DECODE(20,1010.DUMMY,ERR=400) aIpco
 c
 C*** READ A LINE AND DETERMINE ITS  PURPOSE to fill /phicom/

 3 -- sys$degadis:estrt1.for                    6-SEP-1989  16:40:49

-------
                                    D-53

C
  260   1=1
  270   CONTINUE
        READ(9,1000,END=350) NCHAR,DUMMY
        IF(DUMMY<1) .EQ. '!') GO TO 270
        DECCOEC20,1010,DUMMY,ERR=400>  Rphifl

        iphifl = int(rphifl)

  275   CONTINUE
        READ(9,1000,END=350) NCHAR,DUMMY
        IF(DUMMY(1) .EQ. '!') GO TO 275
        DECODE(20,1010,DUMMY,ERR=400)  del lay
c
C*** READ A  LINE AND DETERMINE ITS PURPOSE to fill /vucom/
C
  280   1=1
  290   CONTINUE
        READ(9,1000,END=350) NCHAR,DUMMY
        IF(DUMMY(1) .EQ. '!') GO TO 290
        DECODEC20,1010,DUMMY,ERR=400) RIBUF4U)
        1 =  1 +  1
        if(i  .eq. mendl) goto 300
        GO TO 290
c
C*** EXIT THE PROCEEDINGS
C
  300   CONTINUE
        CLOSE(UNIT=9)
        RETURN
c
  350   call trap(20)
C
  400   CONTINUE
        CALL trap(21)
C
  1000   FORMAT(Q,132A1)
  1010   FORMAT(10X,G10.4)
C
 2000   call trap(22)
        END
4  •• sys$degadis:estrt1.for                    6-SEP-1989 16:40:49

-------
                                 D-54
     ROUTINE TO GET RUN  PARAMETERS FROM A FILE
     SUBROUTINE ESTRT2(OPNRUP)
     Implicit Real*8 (  A-H,  0-Z ),  Integer*4 (  I-N  )
     include 'sys$degadis:DEGADIS2.dec/list1
     parameter (
     1
     2
     3
                  ienda* 18,
                  ienda1= ienda+1,
                  iendb= 7,
                  iendb1= iendb+1)
     common
  $/ERROR/SYOER,ERRO,SZOER,UTAIO,UTQOO,WTSZO,ERRP,SMXP,
  $ WTSZP,WTSYP,WTBEP,WTDH,ERRG,SMXG,ERTDNF,ERTUPF,WTRUH,WTDHG
  $/STP/STPO,STPP,ODLP,ODLLPfSTPG,ODLGfODLLG
  S/CNOBS/NOBS
     EQUIVALENCE
  $(RLBUF(1),SYOER).
  $(RLBUF(2),ERRO),
  $(RLBUF(3),SZOER),
  $(RLBUF(4),UTAIO).
  $(RLBUF(5),UTQOO),
  $(RLBUF(6),UTSZO),
  $(RLBUF(7),ERRP),
  $(RLBUF(8),SMXP),
  S(RLBUF(9),WTSZP),
  $(RLBUF(10).WTSYP),
  $(RLBUF(11),WTBEP),
  S(RLBUF(12),UTOH),
  $(RLBUF(13),ERRG),
  $(RLBUF(14),SMXG).
                     ISSSUP
                     ISSSUP
                     ISSSUP
                     ISSSUP
                     ISSSUP
                     ISSSUP
         RKGST  -  INITIAL  SY
         RKGST(OBS)  •  ERROR  BOUND
         RKGST(OBS)
         RKGST(DBS)
         RKGST(OBS)
         RKGST(OBS)
ISSSUP •  RKGST(PSS)
ISSSUP -  RKGST(PSS)
ISSSUP -  RKGST(PSS)
         RKGST(PSS)
         RKGST(PSS)
         RKGST(PSS)
         RKGST(SSG)
         RKGST(SSG)
                     ISSSUP
                     ISSSUP
                     ISSSUP
                     ISSSUP
                     ISSSUP
$(RLBUF(15),ERTDNF), ITDNF - CONVERGENCE CRITERIA
$(RLBUF(16),ERTUPF), ITUPF - CONVERGENCE CRITERIA
$
-------
                                    D-55

        character*40 OPNRUP
        character dunnyd :132)
        DIMENSION RLBUF(ienda),RLBUF1(iendb)
C
        OPEN RBUF
        NOBS =  INT(RBUF)
C
C*** EXIT THE PROCEEDINGS
C
        CLOSE(UNIT=9)
        RETURN
C
  300   call trap(20)
  400   CALL trap(21)
C
 1000   FORMAT(Q,132A1)
 1010   FORMAT(10X,G10.4)
        END
2 -• sys$degadis:estrt2.for                    6-SEP-1989 16:42:31

-------
                                    D-56
c	
c
C       ROUTINE TO GET RUN PARAMETERS FROM A FILE
C
        SUBROUTINE ESTRT2SS(OPNRUP)

        Implicit Real*8 ( A-H, 0-Z ), Integer*4 ( I-N )
        include 'sys$degadis:DEGadis2.dec/list1
c
        parameter^      ienda= 18,
        1               iendats ienda+1,
        2               iendb= 7,
        3               iendb!= iendb+1)
C
        COMMON
     $/ERROR/SYOER,ERRP,SMXP,WTSZP,UTSYP,WTBEP,WTDH,ERRG,SMXG,
     $ UTRUH,WTDHG
     $/STP/STPP,ODLP,ODLLP,STPG,ODLG,ODLLG
C
c
        character*40 OPNRUP
        character DUMMYC1:132)
        DIMENSION RLBUF(ienda),RLBUF1
-------
                                  D-57
C*** EXIT THE PROCEEDINGS
C
300 CONTINUE
syOer = rlbufd) ISSSUP
errp = rlbuf(7) ! SSSUP
smxp = rlbuf(8) ISSSUP
wtszp = rlbuf(9) iSSSUP
wtsyp = rlbufdO) iSSSUP
utbep = rlbuf(H) iSSSUP





C






C


C
350
c
400
C
1000
1010
c

jfjtttjt
wtDH = rlbuf(12) iSSSUP
errg = rlbuf(13) ISSSUP
smxg = rlbuf(U) iSSSUP
utRUH = rlbufd 7) iSSSUP
utDHG = rlbuf(IS) ! SSSUP

stpp = rlbuf1(2) ! SSSUP
odlp - rlbuf1(3) iSSSUP
odllp = rlbufKA) ! SSSUP
stpg = rlbufKS) iSSSUP
odlg = rlbuf1(6) iSSSUP
odllg = rlbuf1(7) iSSSUP

CLOSE(UNIT=9)
RETURN

- RKGST - INITIAL SY
- RKGST (PSS) - ERROR BOUND
- RKGST (PSS) - MAXIMUM STEP
• RKGST (PSS) • WEIGHT FOR SZ
- RKGST (PSS) - WEIGHT FOR SY
- RKGST(PSS) - WEIGHT FOR BEFF
- RKGST (PSS)
- RKGST (SSG)
• RKGST (SSG)
• RKGST (PSS)
- RKGST (PSS)

• RKGST (PSS)
- RKGST(PSS)
- RKGST(PSS)
• RKGST (SSG)
- RKGST (SSG)
• RKGST (SSG)




- WEIGHT FOR BEFF
- ERROR BOUND
- MAXIMUM STEP SIZE
- WEIGHT FOR BEFF
- WEIGHT FOR BEFF

- INITIAL STEP
- RELATIVE OUTPUT DELTA
- MAXIMUM DISTANCE TO OUT
- INITIAL STEP
- RELATIVE OUTPUT DELTA
• MAXIMUM DISTANCE TO OUT




call trap(20) ! premature EOF

CALL trap(21)

FORMAT(Q,132A1)
FORHAT(10X,G10.4)

END

















2 -•  sys$degadis:estrt2ss.for
6-SEP-1989 16:43:26

-------
                                    D-58

c	
c
C       ROUTINE TO GET RUN PARAMETERS FROM A FILE
C
        SUBROUTINE ESTRT3COPNRUP)

        Implicit Real*8 ( A-H, 0-2 }, Integer** ( I-N )
C
        COMMON
     S/PHLAG/CHECK1,CHECK2,AGAIN,CHECKS,CHECK4,CHECKS
     $/eom_sigx/ sigx_coeff,sigx_pow,sigx_min_dist,sigx_flag
     S/ERROR/ERT1,ERDT,ERNTIM
C
        EQUIVALENCE
     $(RLBUF(1),ERT1),    !FIRST SORT TIME • USER OPTION
     $,    iSORT TIME DELTA - USER OPTION
     $ RBUF(I)
        1*1  +  1
        GO TO  100
C
C*** EXIT  THE  PROCEEDINGS AND DETERMINE CHECKS
   300   CONTINUE
C
        DO 310 I *  1.3
   310   RLBUF(I) a  RBUF(I)
        CHECKS =  .FALSE.                 !  IN ORDER  FOR  FLAG TO WORK
        IFCRBUFC4)  .EQ.  1.) CHECKS = .TRUE.
 C
        sigx_flag  = rbuf(5)
        CLOSE(UNIT=9)
        RETURN
 C
   400  CALL trap(21)
  1000   FORMAT(Q,132A1)
  1010   FORMAT(10X,G10.4)
         END


 1  --  sys$degadis:estrt3.for                    6-SEP-1989 16:44:11

-------
                                   D-59
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






SUBROUTINE GAMMA




This routine was originally supplied by Digital Equipment
Corporation as part of the Scientific Subroutine Package
available for RT-11 as part of the Fortran Enhancement
Package.


PURPOSE


USAGE


It was upgraded for use in this package.



COMPUTES THE GAMMA FUNCTION FOR A GIVEN ARGUMENT


GF = GAMMA(XX)

DESCRIPTION OF PARAMETERS


XX -THE ARGUMENT FOR THE GAMMA FUNCTION

1ER-RESULTANT ERROR CODE WHERE





REMARKS


IER=0 NO ERROR
IER=1 XX IS WITHIN .000001 OF BEING A NEGATIVE INTEGER
IER=2 XX GT 34.5, OVERFLOW
IF IER -NE. 0 PROGRAM TAKES A DIP IN THE POOL!


NONE

SUBROUTINES AND FUNCTION SUBPROGRAMS REQUIRED


METHOD




NONE


THE RECURSION RELATION AND POLYNOMIAL APPROXIMATION
BY C.HASTINGS, JR., 'APPROXIMATIONS FOR DIGITAL COMPUTERS',
PRINCETON UNIVERSITY PRESS, 1955

MODIFIED TO FUNCTION FORM FROM ORIGINAL SUBROUTINE FORM






        FUNCTION  GAMMA(XX)

        Implicit  Real*8  ( A-H, 0-Z ), Integer*4 ( I-N )

        IF(XX-34.5>6,6,4
    4   IER=2
        GAMMA=1.E38

1  -- sysSdegadis:gamma.for                     6-SEP-1989 16:50:20

-------
                                    D-60

        GO TO 1000
    6   X=XX
        ERR=1.0E-6
        IER=0
        GAMMA=1.0
        IF(X-2.0)50,50,15
   10   IF(X-2.0)110,110,15
   15   X=X-1.0
        GAMMA=GAMMA*X
        GO TO 10
   50   IF(X-1.0)60,120,110
C
C        SEE IF X IS NEAR NEGATIVE INTEGER OR ZERO
C
   60   IF(X-ERR)62,62,80
   62   Y=FLOAT(INT(X))-X
        IF(ABS(Y)-ERR)130,130,64
   64   IF(1.0-Y-ERR)130,130,70
C
C        X HOT NEAR A NEGATIVE INTEGER OR ZERO
C
   70   IF(X-1.0)80,80,110
   80   GAMMA-GAMMA/X
        X=X+1.0
        GO TO 70
  110   Y=X-1.0
        GY=1.0+Y*<-0.5771017+Y*(+0.9858540+Y*<-0.8764218+Y*
     $<+0.8328212i-Y*(-0.5684729+Y*<+0.2548205+Y*(-0.05149930)))))))
        GAMMA=GAHMA*GY
  120   RETURN
  130   IER=1
 1000   CONTINUE
        IFUER.EQ.1) WRITE(5,1100)
        IF(IER.EQ.2) URITE(5,1110)
 1100   FORMAT(5X,'?GAMMA?--ARGUMENT LESS THAN 0.000001')
 1110   FORMAT(5X,'?GAMMA?--ARGUMENT GREATER THAN 34.5--OVERFLOW1)
        CALL EXIT
        END
 2 ••  sysSdegadis:gamma.for                     6-SEP-1989 16:50:20

-------
                                    D-61
c	
c
C       SUBROUTINE TO ESTABLISH THE TIME SORT PARAMETERS
C
        SUBROUTINE GETTIM

        Implicit Real*8 ( A-H. 0-Z ), Integer*4 ( I-N )
        include  'sys$degadis:DEGADIS3.dec/list'
C
        COMMON
     S/SSCON/ NREC(maxnob,2),TO(maxnob),XV(maxnob)
     S/SORTIN/ TIM(maxnt),NTIM,ISTRT
     $/PARMSC/ RM,SZM,EMAX,RMAX,TSC1,ALEPH,TEND
     S/PHLAG/ CHECK1,CHECK2,AGAIN,CHECKS.CHECK4,CHECKS
     S/ERROR/ ERT1,ERDT,ERNTIM
     S/ALP/ ALPHA,alphal
     S/CNOBS/ NOBS
C
        LOGICAL  CHECK1.CHECK2,CHECKS,CHECK4.CHECKS,AGAIN
C
        DATA T1/0./.DT/0./.TF/0./
C
C*** IF CHECKS IS SET, GET THE TIME SORT PARAMETERS FROM /ERROR/
C
        IF(.NOT.CHECKS) GO TO 90
C
        T1 * ERT1
        DT = ERDT
        NTIM = INT(ERNTIM)
        GO TO 95
C
C
C*** This subroutine sets the default time sort windows.
C
C*** The first sort time is set for potential  low wind speed cases,
C***   while the last sort time is set for potential high wind speed
C***   cases.  The first sort time is taken to be when the first
C***   observer  passes through x=RMAX.  The last sort time is taken
C***   to be when the  last observer passes through x=6*RMAX.
C***   The default value for the number of sort times is set to 10.
C***   Obviously, these values generate some sort times which will be
C***   useless;  hopefully, these values will show the user where  to
C***    look on the next go around.
C*** The number  of times has been doubled to 20 and the time interval
C***   has been  doubled in order to give more  information for  lower
C***   concentrations  (for the toxic gas problem). tos,5mar86
C
   90    CONTINUE
C

1  -- sys$degadis:gettim.for                    6-SEP-1989 16:51:05

-------
                                    D-62

        T1 = T0(1) + <2.*RMAX)**(1./ALPHA1)/ALEPH
        TF = TO(NOBS) + (6.*RMAX)**(1./ALPHA1)/ALEPH
        NTIM = 20               !  for toxic gas problem
C
C DT = (TF-T1)/FLOAT(MTIM-1)
        DT = 2.*
-------
                                     D-63

C	
c
C       SUBROUTINE TO ESTABLISH THE TIME SORT PARAMETERS
C
        SUBROUTINE GETTIM

        Implicit Real*8 ( A-H, 0-Z ), Integer** ( I-N )

        include 'sys$degadis:DEGADIS4.dec/list'
C
        COMMON
     S/SSCON/ NREC(maxnob,2),TO(maxnob),XV(maxnob)
     S/cdos/ idos, dosdisx(ndos), dosdis(4,2,ndos)
     S/SORTIN/ TIM(maxnt),NTIM,ISTRT
     S/PARMSC/ RM,SZM,EMAX,RMAX,TSC1,ALEPH,TEND
     S/PHLAG/ CHECK1,CHECK2,AGAIN,CHECK3,CHECK4,CHECKS
     S/ERROR/ ERT1',ERDT,ERNTIM
     S/ALP/ ALPHA,alphal
     S/CNOBS/ NOBS
 C
        LOGICAL CHECK1,CHECK2,CHECKS,CHECK4,CHECKS,AGAIN
 C
        DATA T1/0./,DT/0./,TF/0./
 C
 C*** This  subroutine sets  the time sort  windows  for  concentration  as
 C      a function  of  time at a given  position.
 C
        dist = dosdisx(idos)
 C
        T1  = ts(  T0(1),  dist)   !  time  first observer  crosses  dist
        TF  * ts(  TO(nobs), dist)         !  time last  observer crosses  dist
        NTIM = 40
 C
        DT  = (TF-T1)/FLOAT(NTIM-1)
        OT  x dmaxU  DBLE(INT(DT+.5)), 1.00}
        NTIM = min(  INTUTF - T1)/DT) +  1, 40)
 C
        T1  = FLOATdNT(TD)      IMAKE T1 AN  INTEGER  VALUE
        write{lunlog,1000> t1,  tf, dt, dist
 1000   formate  t1:  ',1pg13.5,'  tf:  ',1pg13.5,'   dt:  '.1pg13.5,
     $' dist:   ',1pg13.5)
 C
        II  * max( ntim,2)        ! fill  in  the lowest two times at  least
        DO  100 I  « 1,11
        TIM(I) =  DT*FLOAT(I-1)  + T1
   100   CONTINUE
 C
        RETURN
        END
 1  --  sys$degadis:gettimdos.for                 6-SEP-1989  16:51:46

-------
                                    D-64

        SUBROUTINE HEAO(gmassO)

        Implicit Real*8 ( A-H, 0-Z ),  Integer*4 ( I-M )
        include 'sys$degadis:DEGADIS1.dec'
        include '(Sssdef)1
c
        COMMON
     S/GEN3/ RADG(2,maxl),QSTR(2,maxt),srcden(2,maxl),srcuc(2,maxl),
     $ srcwa(2,maxl),srcenth(2,maxl)
     S/TITL/ TITLE
     S/GEN1/ PTIME(igen), ET(igen), R1T(igen), PWC(igen), PTEMP(igen),
     $       PFRACV(igen), PENTH(igen), PRHO(igen)
     S/GEN2/ DEN(5,igen)
     J/ITI/ T1,TINP,TSRC,TOBS,TSRT
     S/ERROR/ STPINfERBND,STPMX,HTRG,UTtmfWTya,wtyc,wteb,wtrnbfwtuh,XLI,
     $ XRI,EPS,ZLOW,STPINZ,ERBNOZ,STPMXZ,SRCOER,srcss,srccut,
     $ htcut,ERNOBL,NOBLpt,crfger,epsilon
     S/PARM/ UO,ZO,ZR,ML,USTAR,K,G,RHOE,RHOA,DELTA,BETA,GAMMAF.CcLOW
     $/com_gprop/ gas_mw,gas_temp,gas_rhoe,gas_cpk,gas_cpp,
     S gas_ufl,gas_lfl,gas_zsp,gas_rvame
     S/comatm/  istab,tamb,pamb,huniid,isofl.tsurf,ihtfl,htco,iwtfl.wtco,
     $ humsre
     S/coni_ss/  ess,slen,SHid,outcc,outsz,outb,outl,swcl,swal,senl,srhl
     J/phlag/ ch«ck1,check2,again,checks,check4,checks
     J/NEND/  POUNDN,POUND
     S/ALP/ ALPHA,alphal
     S/atphcom/ ialpfl.alpco
     S/phicom/  iphifl.dellay
     $/sprd_con/ ce, delrhomin
      ./oomsin/  oodist.avtime
 c
         character*80 TITLE(4)
 c
         character*** pound
         Charactep*24 TINP,TSRC,TOBS,TSRT
         character*? gas_name
         character'1 stabil(6)
         character*24  id
 c
         logical checkl,check2,again,check3,check4,checks
 c
         REAL*8 <,ML
 c
         data  stabil/'A'.'B'/C'.'D'.'E'.'F'/
         data  iparm/0/
 C
         ifd'parm .eq.  1} goto  190
         WRITE(8,1100)
  1100    FORMAT(1HO,'********************',9X,'U OA_DEGAD I  S ',

 1 -- sysSdegadis-.head.for                      6-SEP-1989 16:52:12

-------
                                    D-65

     $2X,'M 0 D E L ',2X,'0 U T P U T '.2X,'-  -  ',2Xf'V E R S I  0 N ',
     $2X,' 2.1', 8X, • ******************** •)
C
c
        WRITE(8.1111)
c
        URITE(8,1102) tsrc
 1102   FORMATdH , •***************•,23X,
     $i***************if1x,a24,1X,
     ji***************i  23x '***************i}
C
        WRITE(8,1111)
C
        WRITE(8,1112) TINP
        URITE(8,11K) TSRC
        IF(tOBS(1:2).NE.'  < .and. .not.check4)  WRITE(8.1116) TOBS
        IF(tOBS(1:2).NE.'  ' .and. check4) URITE(8,1117) TOBS
        IF(tSRT(1:2) .NE. '  ') URITE(8,1118)  TSRT
 1112   FORMATdH ,'Data input on',22X,a24)
 1114   FORMATdH ,'Source program run on',14X,a24)
 1116   FORMATdH ,-Pseudo Steady-State program run on ',a24)
 1117   FORMATdH ,' Steady- State program run on',7x,a24)
 1118   FORMATdH .'Time sort program run on',1lX,a24)
        URITE(8t1111)
C
        WRITE(8,1110)
        WRITE(8,1111)
C
 1110    FORMAT(1HO,1OX,'TITLE BLOCK1)
 1111    FORMATdH  )
C
        DO  100 I = 1.4
        URITE(8,1120) TITLE(I)
   100   CONTINUE
C
 1120    FORMATdH  ,A80)
C
        WRITE(8,1111)
        WRITE(8,1130) UO
         WRITEC8.1140) ZO
         URITE(8,1150) ZR
         write(8,1155) stabil(istab)
         ifCml.ne.  0.) then
                URITE(8,1160) ML
         else
                urite(8,1161)
         endif
         write(8,1168) avtime
        WRITE(8,1170) DELTA
        URITE(8,1180) BETA
        WRITE(8,1190) ALPHA

2  -- sys$degadis:head.for                      6-SEP-1989 16:52:12

-------
                                    D-66

        WRITE(8,1192> USTAR
        WRITE(8,1194) tamb
        ifCisofl.eq.O .and. ihtfl.ne.O) write(8,1195) tsurf
        URITE(8,1196) pamb
        WRITE(8,1198) humid
        vaporp = 6.0298e-3* exp(5407.* (1./273.15-  1./tamb)) !  atm
        relhumid = 100.* humid/(0.622*vaporp / (pamb- vaporp))
        write(8,1199) relhumid
C
 1130   FORMATdH ,5X,'UitKl velocity at reference height ',20X,F6.2.2X,
     $'m/s')
 1140   FORMATdH ,5X, 'Reference height ',37X,F6.2,2X,'m')
 1150   FORMAT(1 HO,5X,'Surface roughness length ',25X,1PG10.3,2X,'m')
 1155   FORMAT(1HO,5X,'Pasquill Stability class ',25X,4x,a1)
 1160   FORMAT(1HO,5X,'Monin-Obukhov length ',29X,1PG10.3,2X,'m1)
 1161   FORMAT(1HO,5X,'Monin-Obukhov length ',31X,'infinite')
 1168   FORMATdH ,5X, 'Gaussian distribution constants ',/,
                1H ,5x,8x,9x,'Specified averaging time1,10X,F9.2,2X.'s')
 1170   FORMATdH ,5X,32x,4X,'Delta',10X,F9.5)
 1180   FORMATdH ,5X,32X,4X,' Beta',10X,F9.5)
 1190   FORMAT(1HO,5X,'Wind velocity power law constant',4X,'Alpha',
     $10X,F9.5)
 1192   FORMATdH ,5X,'Friction velocity1,15X,4X,5X,10X.F9.5,2X, 'm/s')
 1194   FORMAT(1HO,5X,'Ambient Temperature ',34X,F6.2,2X,'K')
 1195   FORMAT(1 HO,5X,'Surface Temperature '.34X,F6.2,2X,'K')
 1196   FORMATdH ,5X, 'Ambient Pressure ',37X,F6.3,2X, 'atm')
 1198   FORMATdH ,5X,'Ambient Absolute Humidity1,25X, 1PG10.3.2X,
     $'kg/kg BDA')
 1199   FORMATdH ,5X,'Ambient Relative Humidity1,25X.4X.F6.2,2X,'%')
C
        WRITE(8,1111)
C
        if(isofl  .eq. 0)  goto  135
        WRITE(8,1200)
        WRITE(8,1205)
        ii  =  -1
        DO  130  I  =  1,igen
        IF(DEN(1,I).gt.  1.)  goTO 148
        ii  =  ii+1
        ifd'i.eq.  3) then
                 write(8,1211)
                 ii  =0
                 endif
   130  WRITE(8,1210) DEN(1,I),DEN(2fI),den(3,i)
        goto  148
   135  write(8,1207)
        write(8,1208)
         ii  =  -1
        DO 138 I = 1,igen
         IF(DEN(1,I).gt. 1.) goTO 148
         ii  =  ii+1

 3 •- sysSdegadis:head.for                      6-SEP-1989  16:52:12

-------
                                    D-67

        if(ii.eq.  3) then
                write(8,1211)
                ii =0
                endif
  138   WRITE<8.1212) DENd,I),DEN<2,I),den(3,i>,den(4,i),den(5,i)
  148   continue
C
 1200   FORMATdH ,5X.'Input:     ',6X,3x,'Mole fraction',4x,
        1       'CONCENTRATION OF C',6X.'GAS DENSITY')
 1205   FORMATdH ,14X,20x,2(13X, "kg/m**3"))
 1207   FORHATC1H ,5X,'Adiabatic Mixing:'.3x.'Mole ffaction',3x,
        1       'CONCENTRATION OF C',6X,'GAS DENSITY',5x,
        1       6x,'Enthalpy',6x,4x,'Temperature')
 1208   FORMATdH ,14X,20x,2d3X,'kg/m**3').7x,8x,' J/kg" ,8x,9x,'K')
 1210   FORMATdH ,14X,3(12X,F8.5))
 1211   formatdH )
 1212   FORMATdH ,14X,3d2X,F8.5),6x.3x,1pg13.5.7x, 1pg13.5)
C
        WRITE(8.1111)
        write(8,1233) gas_mw,gas_teinp,gas_rho€,gas_cpk,gas_cpp,
     $ gas_ufl,gas_lfl,gas_zsp
        URITE(8,1111)
        URITE<8,1220) gmassO
        WRITE<8.1230)
C
        DO 150 I=1,IGEN
        IF(PTIMEU).EQ.POUNDN) GO TO 160
  150   WRITE(8,1231) PTIMEU),ET(I),R1T
-------
                                    D-68

 1242   formatdhO,5x,'Entrainment prescription for PHI: '.12)
 1244   format(1hO,5x,'Layer thickness ratio used for average depth: ',
       1        1pg13.5)
 1250   format(1hO,5x,'Air entrainment coefficient used: ',f5.3)
 1251   formatdhO,5x,'NON Isothermal calculation1)
 1252   format(1hO,5x,'Gravity slumping velocity coefficient used:  ',f5.3)
 1253   format(1hO,5x,'Heat transfer calculated with fixed coefficient: ',
       1        1pg13.5,' J/m**2/s/K')
 1254   format(1hO,5x,'Heat transfer not  included1)
 1255   format(1hO,5x,'Heat transfer calculated with correlation:  ',12)
 1256   formatdhO.Sx,'Isothermal calculation')
 1257   formatdhO.Sx,'Water transfer calculated with fixed coefficient:  ',
       1        1pg13.5,' /m**2/s/atm')
 1258   formatdhO.Sx,'Water transfer not included')
 1259    format(1hO,5x,'Water transfer calculated with correlation')
C
       WRITE(8,1111)
        write(8,1241) ialpfl
        write(8,1242) iphifl
        write(8,1244) del lay
        write(8,1250) epsilon
        write(8,1252) ce
        if(isofl.eq. 0) writeC8,1251)
        ifd'sofl.ne. 0) writeC8,1256)
        ifdhtfl.lt. 0) write(8,1253) htco
        ifdhtfl.eq. 0) write(8,1254)
        ifd'htfl.gt. 0) write(8,1255)  ihtfl
        if(iwtfl.lt. 0) write(8,1257) wtco
        ifdwtfl.eq. 0) write(8,1258)
        ifd'utfl.gt. 0) write(8,1259)
        WRITE(8,1111) •
        iparm *1
        return
c
  190   continue
        if(.not.check4) return
        RAO = SQRT(2.*SLEN*SWID/pi)
        WRITE(8,1300) ESS,RAO
        URITE(8,1320) SLEN,SUID
        qstar = ess/out I/outb/2.
        WRITE<8,1340) OUTCc.OUTSZ,qstar
        write<8,1350) swcl,swal,senl,srhl
        WRITE(8,1360) OUTL.OUTB
 C
 C
 c
 1300   FORMAK1HO, 'Source strength [kg/s] : ',18X,1PG13.5,T60,
     $'Equivalent  Primary source radius  [m] : ',5x,1PG13.5)
 1320   FORMATdH  ,'Equivalent Primary source length [m] : ' ,4X,1PG13.5,
     $T60,'Equivalent  Primary source half-width [m] :  ',1X,1PG13.5)
 1340   FORMATC/,'  Secondary source concentration  Ckg/m**3] :  ',

 5  •• sysSdegadis:head.for                      6-SEP-1989 16:52:12

-------
                                    D-69

     S1PG13.5,T60,'Secondary source SZ  [m]  :  ',18X.1PG13.5,//.
        1  >  Contaminant flux rate:  ',1pg13.5,/)
 1350   formate/,1  Secondary source mass  fractions...  contaminant:  ',
        1        1pg13.6,2x,' air:  ',1pg13.5,/,'  ',10x,'  Enthalpy:  ',
        1        1pg13.5,5x,' Density:  '.1pg13.5,/)
 1360   FORMATC1H ,'Secondary source length [m]  :  ',13X,1PG13.5,T60,
     $'Secondary source half-width  [m]  :  ',10X,1PG13.5)
C
C
        RETURN
        END
6  -- sys$degadis:head.for                      6-SEP-1989 16:52:12

-------
                                    D-70

c	
c
c       gamna and incomplete gamma function
c
c	
c
c       routines included in this file:
c               GAMING          Incomplete gamma function
c               GAMMLN          Natural log of the gamma function
c               GSER            computation procedure
c               GCF             computation procedure
c
c	
c
c       These functions return the value for the incomplete Gamma function
c       with the arguments  (ALPHA,BETA).  The functional values are
c       calculated with either a series representation or a continued
c       fraction representation.  These routines are based on:
c
c       Press, U.H.,  B.P. Flannery, S.A. Teukolsky, and W.T. Vetterling,
c       "Numerical Recipes", Cambridge University Press, Cambridge,1986.
c
c
c
        function garninc(alpha,beta)

         implicit Real*8 (a-h, o-z).  integer**  (i-n)
 c
 c
 c*«* ensure the arguments are within the proper bounds.
 c
         if( beta.It.0. .or. alpha.le.O.)  then
                 write(6,9000) alpha,beta
  9000           formate  GAMING? Arugments are out-of-bounds.  ALPHA: ',
      $ 1PG13.5,1  BETA: ',1PG13.5)
                 STOP
                 endif
 c
 c*** determine which of the series or continued fraction representation
 c     is more appropriate.
 c
         if( beta .It. alpha+1.  ) then
 c                                                       !  series
                 call  gser(  aa,  alpha, beta, gin)
         else
 c                                                       !  continued fraction
                 call  gcf( aa,  alpha,  beta, gin)
                 aa = 1. • aa
         endif
 c
 c*** multiply the result  by GAMMA(ALPHA) to get the final  value.

 1  -- sys$degadis:incgamma.for                  6-SEP-1989 16:54:46

-------
                                     D-71
        gamine = dexp( dlog(aa) + gin)
        return
        end
c
c
c
        subroutine gser( gamser, alpha, beta,  gin)
c
c       This routine calculates the incomplete gamma function using
c       the series representation.
c
        implicit real*8 (a-h,o-z), integer*4 (i-n)
c
        parameter (itmax=100, eps=1.d-9)

        gin = gammln(alpha)

        if(beta  .It. 0.) then
                 write(6,*) 'GSER? BETA is out-of-bounds.1
                 stop
                 endif
        if(beta  .eq. 0.) then
                 gamser = 0.
                 return
                 endif

        ap =  alpha
        sum * 1./alpha
        del = sum

        do 100  n=1,itmax
                 ap  =  ap +  1.
                 del = del* beta /ap
                 sum » sum  +  del
                 if( dabs(del)  .It. dabs(sum)*eps)  then
                        gamser * sum*dexp(  -beta+alpha*dlog(beta)-gln)
                        return
                        endif
  100   continue

        write(6,*)  'GSER?  ALPHA is too large  or  ITMAX is  too  small.1
        stop
        end
 c
 c
 c
        subroutine  gcf( gamcf,  alpha,  beta, gin)
 c
 c      This  routine calculates the  incomplete gamma function using
 c      the continued fraction representation.

 2 --  sys$degadis:incgamma.for                  6-SEP-1989 16:54:46

-------
                                    D-72

c
        implicit real*8 (a-h,o-z), integer*4 (i-n)
c
        parameter (itmax=100, eps=1.d-9)

        gin = gamnln
-------
                                    D-73

c       This routine calculates ln(  gamma(alpha))  for  alpha>0.
c
        implicit real*8 (a-h,o-z),  integer*4 (i-n)
c
        dimension cof(6)

        data cof,stp/76.18009173DO,  -86.5053203300,  24.0U09822DO,
     $ -1.23173951600, 0.120858003D-2, -0.536382D-5, 2.50662827465DO/
        data half, one, fpf/0.5DO,  1.0DO. 5.5DO/
c
        if( alpha .It. 1) then
                gam = gonna( alpha )
                gammln » dlog(gam)
                return
                endif
c
        xx = alpha - one
        tmp = xx + fpf
        tmp = (xx + half) * dlog(tmp) - tmp
        ser = one
        do 100  j-1,6
                xx = xx + one
                ser = ser + cof(j)/xx
 100    continue                                 ,

        gammln  = tmp + dlog(stp*ser)
        return
        end
4  -- sys$degadis:incgamma.for                  6-SEP-1989 16:54:46

-------
                                     D-74

c	
c
C       INPUT SUBROUTINE FOR DEGAOIS MODEL
C
        SUBROUTINE IO(tend,gmassO,OPNRUP)

        Implicit Real*8 ( A-H, 0-Z ), Integer*^ ( I-N )
c
        include  'sysSdegadis:DEGADIS1.dec'
c
C       BLOCK COMMON
C
        COMMON
     S/TITL/TITLE
     VGENV PTIME(igen), ET
-------
                                    D-75

        READC9,*)  DELTAy.BETAy.rml
        read(9,*)  si gx_coef f , si gx_pou, si gx_min_dist
        read(9,*)  tamb,pamb, humid
        humsrc - 0.
        read<9,*)  isofl.tsurf
        read<9,»)  ihtfl.htco
        read(9,*)  iwtfl,wtco
        read(9,2020) gas_name
 2020   FORMAT (A3)
        read(9,*>  gas_mwfgas_temp,gas_rhoe
        read(9,*>  gas_cpk,gas_cpp
        read(9,*)  gas_uf l,gas_lf I, gas_zsp
C
        ifd'sofl .eq. 0) then
                rhoe = gas_rhoe
           rhoa = pant*(1.DO+humid)/(.002833DO+ 0.004553DO*humid)/tamb
                goto 105
                endif
        READ(9,*> NP
        DO 100  1=1, NP
  100   READ<9,*> DEN(1,I),DEN(2fI)fden(3,I).den(4fi),den(5,i)
        RHOE = DEN(3,NP>
        RHOA = DEN(3,1)
        den(1,np*1) = 2.
C
  105   READC9,*) CcLOW
C
        read(9,*) gmassO
        READ(9,*) NP
        DO 110  1=1, NP
        READ<9,*> PTIME(n,ET(I),RlT(I). PWC(I),PTEHP(I),PFRACV(I)
        UA =  (1.DO  - PUC(I))/(1.DO + HUMID)
        PENTH(I)  = ENTHAU PWC(I), UA, PTEHP(D)
        CALL  TPROP(-1,PUCCI), WA.PENTHd), YC.YA.UM, PTEMP(I), PRHO check1,check2, again, check3,check4,check5
c
        tobs  »  '  '
        tsrt  =  '  '
        READ(9,2010) TINP
 2010   format(a24)
C
        if(check4) read(9,*> ess.slen.swid
c
        CLOSE(UNIT=9)
        RETURN
        END
2 •• sys$degadis:io.for                        6-SEP-1989 16:56:18

-------
                                    D-76

        SUBROUTINE lOT(OPNRUP)

        Implicit Real*8 ( A-H, 0-Z ),  Integer*4 ( I-N )

C
        include 'sys$degadis:DEGADISIN.dec'
c
        COMMON
     VTITL/ TITLE
     S/GEN1/ PTIME(igen), ET  OPNRUP
        character*40 STRING
        character*4 dumny
 C
        WRITE(6,1100)
        WRITE(6,1110)
 C
 C*** OPEN THE INPUT FILE
 C
         OPEN(UNIT=8,NAME=OPNRUP,TYPE='NEU',
      $  carriagecontrol«'Iist',recordtype='variable1}
 C
 C*** NOW GET  THE TITLE BLOCK
 C
         WRITE(6,1120)
         WRITE(6,1130)
 C
         00 100 1=1,4
         READ(5,1134)  TITLE(I)
         dummy = title(i)
         IF(dumny(1:4)  .EQ. POUND(1:4)) GO TO 110

 1  -- sys$degadis:iot.for                       6-SEP-1989 16:57:09

-------
                                    D-77

        WRITE(8,1135) TITLE(I)
  100   CONTINUE
        GO TO 130
C
  110   CONTINUE                !  FILL OUT  THE BLOCK
        II - I
        00 120 I = 11,4
        TITLE(I) = '  '
        URITE(8,1135) TITLE(I)
  120   CONTINUE
  130   CONTINUE
C
c*** Atmospheric parameters:
c
        URITE(6,1UO)
        URITE(6,1142)
        READ<5.*> UO,ZO,ZR
        WRITE<8,1020) UO,ZO,ZR
C
c*** stability, averaging time for DELTAY,  and derived parameters
c
        URITE(6,1150)
        READC5.1310) NCHAR,STRING
        urite(6,1152)
        read(5,*> avtime
        istab « 4                       !  default is D stability
        IFCSTRING.eq.'A'  .or. string.eq.'a') istab=1
        IF(STRING.eq.'B<  .or. string.eq.'b') istab=2
        IF(STRING.eq.'C'  .or. string.eq.'c') istab=3
        IFCSTRING.eq.'D1  .or. string.eq.'d') istab=4
        IFCSTRING.eq.'E1  .or. string.eq.'e') istab=5
        IFCSTRING.eq.'F1  .or. string.eq.'f') istab=6
        gotoC161,162,163,164,165,166)  istab
  161    timeav  = dmaxK avtime, 18.4DO)                 ! A
        deltay  = 0.423DO*Ctimeav/600.DO)**0.2DO
        betay = 0.900
        rml  =  -11.4300 *  zr**0.10300
        sigx_coeff = 0.02
        sigx_pow = 1.22
        sigx_min_dist = 130.
        goto 170
  162    timeav  = dmaxK avtime, 18.400)                 ! B
        deltay  = 0.313DO*(timeav/600.DO)**0.2DO
        betay = 0.900
        rml  =  -25.9800 *  zr**0.17100
        sigx_coeff =0.02
        sigx_pow = 1.22
        sigx_min_dist = 130.
        goto 170
  163    timeav  = dmaxK avtime, 18.400)                 ! C
        deltay  = 0.210DO*Ctimeav/600.DO)**0.2DO

2  -• sys$degadis:iot.for                       6-SEP-1989 16:57:09

-------
                                    D-78

        betay =0.900
        rml  = -123.ADO *  zr**0.304DO
        sigx_coeff =0.02
        sigxjaow = 1.22
        sigx_min_dist = 130.
        goto 170
 164    timeav = dmaxK avtime,  1S.3DO)                  ! D
        deltay = 0.136DO*(timeav/600.DO)**0.2DO
        betay = 0.900
        rml  = 0.0               !  used for  infinity
        sigx_coeff = 0.04
        sigx_pow =1.14
        sigx_min_dist « 100.
        goto 170
 165    timeav > dmaxK avtime,  11.400)                  ! E
        deltay = 0.102DO*(timeav/600.DO)**0.2DO
        betay = 0.900
        rml  = 123.400 * zr**0.304DO
        sigx_coeff = 0.17
        sigx_pow * 0.97
        sigx_min_dist = 50.
        goto 170
 166    timeav - dmaxK avtime,  4.600)                  ! f
        deltay = 0.0674DO*(timeav/600.DO)**0.2DO
        betay » 0.900
        rml  « 25.9800 * zr**0.17100
        sigx_coeff =0.17
        sigx_pow * 0.97
        sigxjnin_dist » 50.
C
 170    WRITEC8.1040) istab
        oodist = 0.00
        write(8,1020) oodist,avtime
C
 172    if(  rml.ne.  0.) then
        WRITE(6,1159) deltay,betay,rml,sigx_coeff,sigx_pow,sigx_min_dist
        else
        URITE(6,1160) deltay,betay,sigx_coeff,sigx_poM,sigx_min_dist
        endif
        read<5,1310) nchar,string
        if(string.eq.'d' .or. string.eq.'0') then
                write(6,1600)
                read(5,*) deltay
                goto 172
        else  if(string.eq.'b1 .or. string.eq.'B') then
                urite(6,1620)
                read(5,*) betay
                goto 172
        else  if(string.eq.'I1 .or. string.eq.'L1) then
                write(6,1660)
                read(5,*) rml

3 -- sys$degadis:iot.for                       6-SEP-1989 16:57:09

-------
                                    D-79

                goto 172
        else if(string.eq.'e1  .or.  string.eq.'C')  then
                write(6,1670)
                read<5,*)  sigx_eoeff
                goto 172
        else if(string.eq.'p1  .or.  string.eq.'P1)  then
                urite(6,1680)
                read(5,*)  sigxjjon
                goto 172
        else if(string.eq.'m'  .or.  string.eq.'M')  then
                write(6,1690>
                pead(5,*)  sigx_min_dist
                goto 172
        else if(nchar.eq.O .or.  string.eq.'n'  .or. string.eq.'N') then
                URITE(8,1020)  DELTAY.BETAy.rml
                WRITE(8,1020)  sigx_cocff,sigx_pow,sigx_min_dist
        else
        goto 172
        endif
c
c*** ambient pressure, temperatures,  and humidity
c
        write(6.1500)
        re8d(5,*> tamb.pamb
        vaporp • 6.0298e-3* exp(5407.* (1./273.15- 1./tamb)) !  atm
        sat = 0.622*vaporp / (pamb- vaporp)
        write(6,1580)
        read(5,1310) nchar,string
        if(string.eq.'a1  .or.  string.eq.'A') then
                write(6,1585)
                read(5,*)  humid
                reIhumid = 100.*humid/sat
                write(6,1586)  reIhumid
                goto 200
                endif
        nrite(6,1587>
        read(5,*> reIhumid
        humid * relhumid/100.  * sat
  200   rhoa = pamb*(1.+humid)/(.002833+.004553*humid)/tamb
        write(6,1588> rhoa
        write(8,1025) tamb.panb,humid, reIhumid
c
        isofl = 0
        ihtfl = 0
        htco  = 0.
        iutfl = 0
        HtCO  * 0.
        tsurf = tamb
c
        write(6,2000>
        read(5,1310) nchar,string

4 -- sys$degadis:iot.for                       6-SEP-1989 16:57:09

-------
                                    D-80

        if(string.eq.'Y'  .or.  string.eq.'y1)  then
                isofl  = 1
                tsurf  = tamb
                goto 250
                endif
c
        write(6,2020)
        read(5,1310) nchar,string
        if(string.eq.'Y1 .or.  string.eq.'y')  then
                write(6,2030)
                read(5,*> tsurf
 220            write(6,2040)
                read(5,1310) nchar,string
                        if(string.eq.'V .or. string.eq.'v') then
                        ihtfl  = -1      ! constant value
                        write(6,2050)
                        read(5,*) htco
        else if(string.eq.'C1  .or. string.eq.'c1 .or. nchar.eq.O) then
                                ihtfl = 1        ! local correlation
                        else  if(string.eq.'L' .or. string.eq.1I1) then
                                ihtfl = 2        ! LLNL correlation
                                htco = 0.0125    ! [=]m/s
                                write(6,2043) htco
                                read{5.1310) nchar,string
                                if(string.eq.'Y1 .or. string.eq.'y')
        1                               read(5,*) htco
                        else
                        goto  220
                        endif
        else
        goto 250
        endif
 c
        urite(6,2100)
        read(5,1310) nchar,string
        if(string.eq.'Y1  .or. string.eq.'y1) then
                iwtfl  « 1
                write(6,2045)
                read(5,1310)  nchar,string
                        if (string.eq.'V  .or. string.eq.'v') then
                        iwtfl =  -1
                        write(6,2120)
                        read(5,*) wtco
                        endif
                endif
 c
 250   continue
        write(8,1060)  isofl,tsurf
        write(8,1060)  ihtfl,htco
        write(8,1060)  iwtfl,wtco
 5 -- sys$degadis:iot.for                       6-SEP-1989 16:57:09

-------
                                    D-81

C
c*** gas characteristics
c
        write(6,1510)
        read(5,1415) gas_name
        write{8,1415) gasjiame
        gasjnw = 16.04
        gas_temp = 111.7
        gas_rhoe = 1.792*pamb   !  correct to pamb
        gas_cpk = 2730.
        gas_cpp * 1.00
        gas_ufl= 0.15
        gas_lfl= 0.05
        gas_zsp= 0.5

        if(gas_name.eq.'NH3' .or. gas_name.eq.'nh3') then
                gasjnw = 17.
                gas_temp = tamb
                gas_rhoe = pamb*gas_mw/0.08205/tamb     ! ideal gas
                gas_cpk = 3845.          ! to get 807.5 J/kg/K
                gas_cpp = 1.000
                gas_ufl= 2.0E-2
                gas_lfl= 2.00E-3
                gas_zsp= 0.5

        else  if(gas_name.eq.'LMG1  .or. gas_name.eq.'Ing1) then
                gas_mu = 16.04
                gas_temp = 111.7
                gas_rhoe = 1.792*pamb    ! correct to pamb
                gas_cpk = 5.6e-8
                gas_cpp » 5.00
                gas_ufl= 0.15
                gas_lfl= 0.05
                gas_zsp= 0.5

        else  if(gas_name.eq.'LPG'  .or. gas_name.eq.'Ipg') then
                gas_mw =44.09
                gas_temp * 231.
                gas_rhoe = 2.400*pamb    ! correct to pamb
                gas_cpk =15.4
                gas_cpp =2.25
                gas_ufl» 0.10
                gas_lfl= 0.02
                gas_zsp= 0.5

        else  if(gas_name.eq.'N02'  .or. gas_name.eq.'no2') then
                gasjnw = 46.
                gas_temp = tamb
                gas_rhoe = pamb*gas_mw/0.08205/tamb     ! ideal gas
                gas_cpk = 3845.          ! to get 807.5 J/kg/K
                gas_cpp = 1.000

 6  -- sys$degadis:iot.for                       6-SEP-1989 16:57:09

-------
                                    D-82
                gas_ufl=  1000.0E-6
                gas_lfl=  500.00E-6
                gas_zsp=  0.5

        else  if(gas_name.eq.lN20l  .or.  gas_name.eq.'n2o')  then
                gas_mw =  92.
                gas_temp  =  tamb
                gas_rhoe  =  pamb*gas_tnw/0.08205/tamb     !  ideal  gas
                gas_cpk = 40990.         !  to get  807.5  J/kg/K
                gas_cpp s 1.000
                gas_ufl=  1000.0E-6
                gas_lfl=  500.00E-6
                gas_zsp=  0.5

        else  if(gas_name.eq.>CL2'  .or.
        1        gas_name.eq.'cl21  .or.  gas_name.eq.'C12')  then
                gasjnw =70.91
                gas_tenp  =  238.7
                gas_rhoe  =  3.672*panto   !  correct to pamb
                gas_cpk - 484.2
                gas_cpp = 1.000
                gas_ufl=  0.1D-4
                gas_lfl=  0.3D-5
                gas_zsp=  0.5

        else if(gas_name.eq.'MEC1  .or.gas_name.eq.'mec') then
                gasjnw =84.94
                gas_temp =  tamb
                gas_rhoe =  3.53*(298.15/tamb)*pamb ! correct to pamb,tamb
                gas_cpk = 2730.         !  Open to question?
                gas_cpp * 1.000
                gas_ufl=  1000.D-6
                gas_lfl= 500.D-6
                gas_zsp= 0.5
        endif
  270   write(6,1520) gas_mwfgas_temp,gas_rhoe,gas_cpk,gas_cpp,
        1        gas_ufI,gas_IfI,gas_zsp
        read(5,1310) nchar,string
        if(string.eq.'m1  .or. string.eq.'M') then
                write(6,1550)
                read(5,*) gas JIM
                goto 270
        else if(string.eq.'t1  .or.  string.eq.'T') then
                write(6,1530)
                read(5,*) gas_temp
                goto 270
        else if(string.eq.'d1  .or.  string.eq.'D1) then
                write(6,1535)
                read(5,*> gas_rhoe
                goto 270
        else ff(string.eq.'h'  .or.  string.eq.'H1) then
7 -- sys$degadis:iot.for
6-SEP-1989 16:57:09

-------
                                    D-83

                write(6,1570)
                read(5,*) gas_cpk
                goto 270
        else  if(string.eq.'p1  .or. string.eq.'P') then
                urite(6,1571)
                read(5,*) gas_cpp
                goto 270
        else  if(string.eq.'u1  .or. string.eq.'U1) then
                write(6,1572)
                read(5,*> gas_ufl
                goto 270
        else  if(string.eq.'l'  .or. string.eq.'L1) then
                write(6,1573)
                read(5,*) gas_lfl
                goto 270
        else  if(string.eq.'z1  .or. string.eq.'Z') then
                write<6.1574>
                read(5,*) gas_zsp
                goto 270
        else  if(nchar.eq. 0 .or. string.eq.'n1  .or.  string.eq.'N1)  then
           if(gas_cpp  .eq.  O.DO) then
                gas_cpp =  1.DO
                gas_cpk = gas_cpk*gas_mw  -  3.33D4
           endif
                WRITE(8,1020)  gasjnu, gas_temp,gas_rhoe
                write(8,1020)  gas_cpk,gas_cpp
                URITE(8,1020)  gas_ufl,gas_lfl.gas_zsp
        else
        goto 270
        endif
c
c density curve if isothermal
c
        ifO'sofl .eq.  0)  goto 460
        URITE(6.1161)
        URITE(6,1162)
        WRITE(6,1163>
        URITE(6,1164)  rhoa
        URITE(6,1165)
        URITE(6,1166)
        goto 320
C
 280    write(6,1290>
C
 320    LUNIN = 5
        URITE(6,1300)
        READ(5,1310)  NCHAR,STRING
        IF(STRING.EQ.'y'  .or.  string.eq.'Y') GO TO 360
        GO TO 400
  360   WRITE(6,1320)
        READ(5,1310)  NCHAR,STRING

8 -- sys$degadis:iot.for                        6-SEP-1989 16:57:09

-------
                                   D-84

        OPEN(UNIT=10,NAME=STRING.TYPEs'OLD',err=280)
        LUNIN = 10
  400   CONTINUE
        IFCLUNIN .EQ. 5) WRITE(6,1170) igen
        READCLUNIN,*) NP
        URITE(8.1040) NP
        IFCLUNIN .EQ. 5) WRITEC6.1180)
C
        DO 440 I-1.NP
        den(4,i) = 0.                           !  0.0 by default for isotherm
        den(5,i) = tamb                         !  tamb for isotherm
        REAOCLUNIN,*) DEN(1,O,DEN(2.I),DEN(3,I)
        if(i .eq.1 .and.
        1       (den(3,1)/rhoa.gt.1.005 .or. rhoa/den(3,1).gt.1.005)) then
                den(3,1) - rhoa
                write(6,1340) rhoa
                endif
        if(i.eq.np) THEN
                IF(     den(2,i)/gas_rhoe .gt. 1.005
        1       .or.    gas_rhoe/den(2,i) .gt. 1.005
        1       .or.    den(3,i)/gas_rhoe .gt. 1.005
        1       .or.    gas_rhoe/den(3,i) .gt. 1.005) then
                den(2,i) = gas_rhoe
                den(3,i) = gas_rhoe
                write(6,1341) gas_rhoe
                endif
                endif
        WRITEC8,1025) DEN(1.I),OEN(2,I).DEN(3,I),Den(4,I),den(5,i)
  440   CONTINUE
         IFCLUNIN  .EQ. 10) CLOSE(UNIT=10)
 C
 c
 460     ccmax  = (gas_lfl/2.) * pamb*gas_mw/0.08205/tamb
         URITE(6,1280) ccmax
         READC5,*)  CcLOW
         if(cclow  .te. 0.) cclow=0.005   ! don't  let 0. get through
         if(cclow  .gt. ccmax) cclow=ccmax
         WRITE(8,1010) CcLOW
 c
 c
 c***  source description
 c
         write(6,1440)
 c
         write(6,1460)
         read(5,1410) dummy
         if(dummy.eq.'d1 .or. dummy.eq.'D1)  goto 730
 c
         check4 =  .false.
         write(6,1400)
         read(5,1410) dummy

 9  --  sys$degadis:iot.for                       6-SEP-1989 16:57:09

-------
                                    D-85

         if(dummy.eq.'y1  .or. dummy.eq.'Y') goto 480
         goto 520
  480     continue
         gmassO = 0.             ! no initial cloud for a SS simulation
         write(8,1020) gmassO
         write{6,1420>
         read(5,*)  ess
         Mrite(6.U30)
         read(5,*)  rlss
         np  = 4
 c
         tend = 60230. !  [=] sec
 c
         PTIMEd) = 0.
         et(1) = ess
         r1t(1)= rlss
         pwcd) = 1.
         ptempd) = gas_temp
         pfracvd)  = 1.
         PTIHEC2) = tend
         et(2) - ess
         r1t(2)= rlss
         pwc(2) = 1.
         ptemp(2) = gas_temp
         pfracv(2)  = 1.
         PTIME(3) * tend  +  1.
         et(3) = 0.
         r1t(3)= 0.
         pwc(3) = 1.
         ptemp(3) * gas_temp
         pfracv(3)  » 1.
         PTIME(4) = tend  +  2.
         et(4) = 0.
         r1t(4)= 0.
         pnc(4) = 1.
         ptemp(4) - gas_temp
         pfraev(4)  « 1.
         slen - 2.*r1ss
         swid = pi*r1ss**2/slen/2.
         check4 =  .true.          ! steady state run
         goto 790
 c
  520    continue
 c
         write(6,1450)
         read(5,*>  gmassO
         write(8,1020) gmassO
 C
         WRITE(6,1190)
         URITE(6,1200)
         URITE(6,1210)

10 •-  sys$degadis:iot.for                      6-SEP-1989 16:57:09

-------
                                    D-86

        WRITE(6,1220)
        URITE(6,1221)
        WRITE(6,1165)
        WRITE(6,1223)
        WRITE(6,1230)
        WRITE(6.1240)
        WRITE(6,1250)
        goto 600
C
 560    write(6,1290)
C
 600    LUNIN = 5
        WRITE{6,1330)
        READ<5,1310> NCHAR,STRING
        IFCSTRING.eq.'Y1 .or. string.eq.'y'> goto 640
        goto 680
  640   URITEC6.1320)
        READ<5,1310) NCHAR,STRING
        OPENtUNITslO.NAMEsSTRING.TYPEs'OLD'.errsSoO)
        LUNIN = 10
  680   CONTINUE
        IF(LUNIN .EQ. 5) URITE(6,1260) igen
        READ(LUNIN,*) NP
        IFCLUNIN .EQ. S) URITE(6,1270)
C
        DO 720 1=1,NP
        READCLUNIN,*) PTIME(I),ET(I),R1T(I)
        pwc(i) « 1.
        ptemp(i) » gas_tenp
        pfracv(i) =  1.
  720   CONTINUE
        IFCLUNIN .EQ. 10} CLOSE(UNIT=10>
        GOTO 790
C
C*** FOR A DILUTED SOURCE ...
C
 730    check4 - .false.
        write(6,1400)
        read(5,1410) dummy
        if(dummy.eq.'y1  .or. duimy.eq.'Y1) goto 740
        goto 750
 740    continue
        gmassO = 0.              !  no  initial cloud for a SS simulation
        urite(8,1020) gmassO
        write<6,1420)
        readCS,*)  ess
        write(6,1430)
        read(5,*)  rlss
 741    WRITE(6,1470)
        readCS,*)  PWC(1)
         if(pwc(1).le.O.DO  .or.  pwc(1).gt.1.DO)  goto  741

11  -•  sys$degadis:iot.for                       6-SEP-1989  16:57:09

-------
                                    D-87

 742    WRITE(6,1480)
        read(5,*) PTEMPd)
        if(pwcd).le.O.DO) goto 742
        np = 4
c
        tend = 60230. !  [=] sec
c
        PTIMEd) = 0.
        et(1) = ess
        r1td>= rlss
        PUCd>= pwcd)
        PTEMPd )= ptempd)
        PFRACVd)= 1.0
        PTIMEC2) = tend
        et(2) = ess
        r1t(2)= Piss
        PWCC2>= pwcd)
        PTEHP(2)=ptemp(1)
        PFRACV(2>= 1.0
        PTIMEC3) = tend +  1.
        et(3) = 0.
        r1t<3>= 0.
        PUC(3)= pucd)
        PTEMPC3)=ptempd)
        PFRACV(3)= 1.0
        PTIME(4) = tend +  2.
        et(4) * 0.
        Mt(4>* 0.
        PUC(4)= pwcd)
        PTEMPC4)=ptempd)
        PFRACV(4)« 1.0
        slen * 2.*r1ss
        swid = pi*r1ss**2/slen/2.
        check4 = .true.          ! steady state run
        goto 790
c
 750   continue
c
        write(6,1450)
        read(5,*) gmassO
        write(8,1020) gmassO
C
        WRITE(6,1190)
        URITE(6,2200)
        URITE(6,2210)
        URITE(6,2220)
        URITE(6,2221)
        URITE(6,1165)
        WRITE(6,2223)
        URITE(6,2230)
        WRITE(6,2240)

12  -- sys$degadis:iot.for                       6-SEP-1989 16:57:09

-------
                                    D-88

        UR1TE(6,2250)
        goto 760
C
 755    write(6,1290)
C
 760    LUNIN = 5
        URITE(6,1330)
        READ(5,1310) NCHAR,STRING
        IF(STRING.eq.'V .or. string.eq.'y'> goto 765
        goto 770
  765   WRITE(6,1320)
        READ(5,1310) NCHAR,STRING
        OPEN(UNIT=10,NAME=STRING,TYPE='OLD',err=755)
        LUNIN = 10
  770   CONTINUE
        IFUUNIN  .EQ. 5) WRITE(6,1260)  igen
        READUUNIN.*) NP
        IFUUNIN  .EQ. 5) URITE(6,1270)
C
        DO  780  1=1.NP
        PFRACV(I) =  1.
        READ(LUNIN,*) PTIMECI),ET(I).R1T(I), PUCd).PTEMP(I)
  780   CONTINUE
        IFUUNIN  .EQ. 10)  CLOSE(UNIT-IO)
 C
  790   continue
        WRITE(8,1040) NP
        DO  800  1=1,NP
  800   WRITE(8,1030) PTIME(I),ET(I),R1T(I), PWC(I),PTEMP(I),PFRACV(I)
 C
        if(et(1).eq.O.  .and.  gmassO.ne.O.)  check2=.true.  ! HSE type spill
        wpite(8,*) check1.check2,again,check3,check4,checks
 C
        istat * lib$date_time(tinp)
        WRITEC8.1050) TINP
 c
        if(check4) write(8,1020) ess.slen.swid           ! steady state
 c
 c
        CLOSE(UNIT=8)
 C
 c
  1010   fopmat(1x,1pgU.7)
  1020   format(3(1x,1pg14.7))
  1025   format(5(1x,1pg14.7))
  1030   format(1x,5(1pg14.7,1x),1pg14.7)
  1040   format(1x,I5)
  1050   format(a24)
  1060   format(1x,i4,1x.1pg14.7)
 c
  1100    FORMAT(5X,1INPUT  MODULE --  DEGADIS  MODEL1)

13 -- sys$degadis:iot.for                        6-SEP-1989 16:57:09

-------
                                     D-89

 1110   FORMAT(/ 5X '**********************************')
 1120   FORMAT(SX,1Enter Title Block -• up to 4 lines of 80',
     $' characters')
 1130   FORMAT(5X,'To stop, type "//"')
 1134   FORMATCA80)
 1135   FORMAT(ASO)
 1140   FORMAT(5X,«ENTER WIND PARAMETERS -- UO (m/s), ZO (m), ',
     $  ',*)
 1152   formate Enter the averaging time (s) for estimating DELTAY:  ',$)
 1159   formate/,1 The values for  the atmospheric parameters',
     $' are set as follows:1,
     $/,' DELTAY:                    '.F12.4,
     $/,' BETAY:                     '.F12.4,
     $/,' Monin-Obukhov  length:      ',F12.4,' m1,
     $/,' Sigma X  Coefficient:       '.F12.4,
     $/,' Sigma X  Power:             '.F12.4,
     $/.' Sigma X  Minimum Distance:  ',F12.4,' m1,
     $/.' Do you wish  to change  any  of  these?1,
     $/,' (No,Deltay.Betay,Length,Coefficient,Power,Minimum)    ',$)
  1160    formate/,1 The values  for  the  atmospheric parameters',
     S1  are set as follows:1,
     $/,' DELTAY:                    '.F12.4,
     $/,' BETAY:                     '.F12.4,
     $/,' Monin-Obukhov  length:      infinite',
     $/,' Sigma X  Coefficient:       '.F12.4,
     $/,' Sigma X  Power:            '.F12.4,
     $/,' Sigma X  Minimum  Distance:  ',F12.4,' m1,
     $/,' Do  you wish  to change  any of these?1,
     $/,'  (No,Deltay.Betay,Length,Coefficient,Power,Minimum)   ',$)
  1161    FORMAT
-------
                                    D-90

 1210   FORMAT(5X,1evolution rate E and radius R1  for a transient1,/,
     SSx,1release is input by ordered triples as follows:1)
 1220   FORMAT(/,5X,3X,'first point1,8X,
     $'-- t=0, E(t=0),  R1(t=0) (initial,  ',
     S1nonzero values)1)
 1221   FORMAT(5X.3X,1second point',7X,
     $'-- t=t1, E(t*t1), R1(t=t1)')
 1223   FORMAT(5X,3X,'last nonzero point  ••  ',
     S't=TEND, E(t=TEND), R1(t*TEND)')
 1230   FORMAT(5X.3X,1next to last point  --  t=TEND+1., E=0.,  R1=0.')
 1240   FORMAT(5X,3X,'last point         -•  t=TEND+2.. E-0.,  R1=0.')
 1250   FORMAT(/,5X,'Note: the final  time (TEND) is the last  time ',
     S'when E and R1 are non-zero.',/)
 1260   FORMAT(/,5X,'Enter the number of  triples (max* ',i2,')',
     $'  starting with t=0. and ending1,/,5x,'with t-TEND+2.',
     S1  for the source description: ',$)
 1270   FORMAT(/,5X,'Enter TIME (sec), EVOLUTION RATE (kg/s), ',
     J'and POOL RADIUS (m)')
 1280   FORMAT(/,5X,'The suggested LOWEST CONCENTRATION OF INTEREST ',
     $'(gas_lfl/2.)',/,5x,' is  ',1pg13.5,
     $' kg/m**3.  Enter the desired value:  ',$)
 1290   formate/,1 This file was not found.1)
 1300   FORMAT(/,' Do you have  an  input file for the Density ',
     S'function?  [y or N] ',$)
 1310   FORMAT(Q,A20)
 1320   FORMATC  Enter  the file name:  tDIR]FILE_NAME.EXT  ',$)
 1330    FORMATC  Do you have an input  file  for  the Source ',
     $'Description?  [y  or N]  ',S)
 1340    format(/,' Air  density corrected  to ',1pg13.5' kg/m**3',/)
 1341    format(/,' Contaminant density corrected to  ',1pg13.5' kg/m**3',/)
 c
 c
 1400    formate//,1  Is  this  a  Steady state  simulation?   ',$)
 1410    format(a4)
 1415    formaU a3)
 1420    formate/,1  Enter the desired evolution rate  [=]  kg/sec :  ',$)
 1430    formate  Enter  the desired source radius  [=]  m :  ',$)
 1440    format(/,'  Specification of  source  parameters.',/)
 1450    formate//,1  Enter the initial mass  of pure gas',
     $'  over the source, (kg)1,/,' (Positive or zero):  ',$)
 1460    formate/,'  Is  this a release of  pure (P)  or  diluted  (d)  material',
     S           ' specified above? 

',$) 1470 FORMATC Enter the desired primary source contaminant mass ', $ 'fraction: ',$) 1480 FORMATC Enter the desired primary source temperature [=] K : ') c c 1500 formate/,1 Enter the ambient temperatureeK) and pressure1, 1 '(atm): ',$) 1510 format(/,' Enter the code name of the diffusing species: ',$) 1520 formate/,1 The characteristics for the gas are set as follows:1,/, 15 -- sys$degadis:iot.for 6-SEP-1989 16:57:09


-------
                                    D-91

     $' Molecular weight:                                ',f7.2,/,
     $' Storage temperature  [K]:                         ',1pg13.5,/,
     $' Density at storage temperature, PAMB  [kg/m**3]: ',1pg13.5,/,
     $' Mean Heat capacity constant                      ',1pg13.5,/,
     $' Mean Heat capacity power                         ',1pg13.5,/,
     $' Upper Flammability Limit  [mole frac]              ',1pg13.5,/,
     $' Lower Flammability Limit  [mole frac]              ',1pg13.5,/,
     $' Height of Flammability Limit  [m]                  >,1pg13.5,/,
     $> Do you wish to change any of  these? ',
     $*eNo,Mole,Temp,Den,Heat.Power,Upper,Lower,Z)1,
     $'  «,$)
  1530   formate1 Enter the desired Storage Temperature: ',$)
  1535   formate1 Enter the desired Density at Storage  ',
        1       'Temperature and',' ambient pressure:  ',$)
  1550   formate1 Enter the desired Molecular Ueight: '.$)
  1570   formate1 Enter the desired Mean Heat Capacity constant:  ',$)
  1571   formate* Enter the desired Mean Heat Capacity power: ',$)
  1572   formate1 Enter the desired Upper Flammability Limit: ',$)
  1573   formate* Enter the desired Lower Flammability Limit: ',$)
  1574   formate1 Enter the desired Height for the flamnable  limit calcula',
        1       'tions:  ',$)
  1580   formate/,' The ambient humidity can be entered as Relative  ',
        1       'or Absolute.1,/,' Enter either R or A :  ',$)
  1585   formate1 Enter the absolute humidity (kg water/kg BDA):  ',$)
  1586   formate1 This  is a relative humidity of ',1pg13.5,' X')
  1587   formate* Enter the relative humidity eX):  ',*)
  1588   formate/,' Ambient Air density  is  ',1pg15.7,'  kg/m**3')
 c
 c
  1600   formate1 Enter the desired DELTAY:  ',$)
  1620   formate* Enter the desired BETAY:  ',$)
  1660   formate1 Mote: For  infinity,  RML =  O.O',/,
     $  '  Enter the desired  Monin-Obukhov  length:  em)  ',$)
  1670   formate* Enter the desired Sigma X  Coefficient:  ',$)
  1680   formate* Enter the desired Sigma X  Power:  ',$)
  1690   formate1 Enter the desired Sigma X  Minimum distance: em) ',$)
 c
  2000   formate/,'  Is this  an Isothermal spill?   ',$)
  2020   formate/,'  Is heat  transfer  to be  included in  the',
         1        '  calculations  ',$)
  2030    formate*  Enter the  surface  temperature  [=]  K :  ',$)
  2040    formate1 Do  you  want to use  the built  in  correlation,',
         1        '  the LLNL  correlation,  or',/,' enter',
         1        *  a  particular value?',/,
         1        '  eCorr.LLNLcorr,Value)    ',$)
  2043    formate/,1  The form of the  correlation  is:1,/,
         1        6x,*0 =  evh  * rho *  cp) *  area  *  etsurf-temp)1,//,
         1        '  with Vh  =  *,1pg13.5,'  m/s.1,//,
         1        '  Do you wish to change the value of Vh?  ey or N):  ',$)
  2045    formate1 Do  you  want to use  the built  in  correlation or  enter',
         1        '  a  particular value?',/,1   ',$)

16 -- sys$degadis:iot.for                       6-SEP-1989  16:57:09

-------
                                    D-92

 2050   formate Enter the HT coefficient value [=]  J/m**2/s/K :  ',$)
 2100   formate/,' Is water transfer to be included in the1,
        1       ' source  ',$)
 2120   formate Enter the WT coefficient value [=]  kg/m**2/s : ',$)
C
 2200   FORMAT(1X,/,5X,'The description of the primary source contam-1)
 2210   FORMATC5X,'inant mass rate E, radius R1, contaminant mass1,/,
     $5x,'fraction Uc,s, and temperature Ts for a transient1,/,
     $5x,'release is input as a function of time as follows:')
 2220   FORMAT(/,5X,3X,'first point',8X,
     $'-- t«0., E(t=0), R1(t=0). Wc,s(t=0), Ts(t=0)',/,
     $          5x,3x,18x,10x,'(initial, ',
     $'nonzero values)')
 2221   FORMAT(5X,3X,1second point',7X,
     $'-- t=t1, E(t=t1>, R1(t*t1), Wc,s(t=t1), Ts(t=t1)')
 2223   FORMAT(5X,3X,'last nonzero point -• ',
     $'t=TEND, E(t»TEND), R1(t»TEND), Wc,s(t=TEND), Ts(t=TEND)')
 2230   FORMAT(5X.3X,'next to last point -• t*TEND+1., E=0., R1=0.,',
     *           • Uc,s>1., Ts=Tamb')
 2240   FORMAT(5X,3X,'last point         -- t=TEND+2., E=0., R1=0.,',
     $           ' Uc,s=1., Ts=Tamb')
 2250   FORMAT(/,5X,'Note: the final time (TEND) is the last time ',
     S'when E and R1 are non-zero.',/)
 2260   FORMAT
-------
                                      D-93

        subroutine limit(func, xO,  xinc,  xhigh,  xlou)
c
c*** subroutine to establish the upper and lower limits for ZBRENT
c
        implicit real*8(a-h,o-z), integer*4(i-n)
        rrr = 1.DO
        aflag = 1.DO
        bflag = 1.00
        fc = func(xO)
100     continue
        if (aflag .eq. 1.DO) then
           aaa = xO + xinc*rrr
                if(aaa .ge. xhigh) then
                        aaa = xhigh
                        aflag = O.DO
                endif
           fa = func(aaa)
                if(sign(1.DO,fa)*sign(1.DO,fc)  .It. 0.00) then
                        xhigh = aaa
                        xlow  = aaa - xinc*1.01DO
                        return
                endif
        endif
        if (bflag  .eq. 1.00) then
           bbb = xO  • xinc*rrr
                if(bbb . le. xlou) then
                        bbb = xlow
                        bflag = O.DO
                endif
           fb = func(bbb)
                if(sign(1.DO,fb)*sign(1.DO,fc)  .It. O.DO) then
                        xhigh = bbb + xinc*1.01DO
                        xlow  = bbb
                        return
                endif
        endif
        if(sign(1.DO,fa)*fb .gt. O.DO) then
                rrr  = rrr  + 1 .00
                if(rrr .gt. 400.00) then
                        write(6,*) 'limitl? rrr>',rrr
                        rrr = 0.
                        rrr = 1./rrr
                        write(6,*) rrr
                        stop  'limitl? rrr>400'
                endif
                goto 100
        endif
        xhigh = aaa
        xlow  = bbb
        return
        end
1 -- sysSdegadis: limit. for                    11-OCT-1989 19:17:34

-------
                                      D-94

C	
c
C    SUBROUTINE FOR SOURCE EVALUATION WHEN NO GAS BLANKET
C       IS PRESENT.
C
        SUBROUTINE NOBL(timeout, reflag)

        Implicit Real*8 ( A-H, 0-Z ), Integer*^ ( I-N )

C
        include  'sys$degadis:DEGADIS1.dec'
C
        COMMON
     S/GEN1/ PTIME(igen), ET(igen), R1T(igen). PWC(igen), PTEMP(igen),
     S       PFRACV(igen). PENTH(igen), PRHO(igen)
     S/ERROR/ STPIN,ERBND,STPMX,WTRG,WTtm,WTya,Htyc,wteb,wtmb,wtuh.XLI,
     $ XRI,EPS,ZLOU,STPINZ,ERBNDZ,STPMXZ,SRCOER.srcss,srccut,
     $ htcut,ERNOBL,NOBLpt,crfger,epsilon
     S/PARM/ UO,ZO.ZR,ML,USTAR,IC,G,RHOE,RHOArDELTA,BETA,GAMMAF,CcLOW
     S/comatm/  istab,tamb,pamb,hunrid,isofl.tsurf,ihtfl,htco.iwtfl.wtco,
     S humsrc
     S/PARMSC/  RM,SZM,EMAX,RMAX,TSC1,ALEPH,TEND
     $/com_ss/  ess>slen,suid,outcc,outsz,outb,outl,swcl,sual,senllsrhl
     S/phlag/ check1,check2,again,checks,checkA,checks
     S/ALP/ ALPHA,alphal
     $/phicom/  iphifl.dellay
 C
        REAL*8  ML, 1C
 c
        LOGICAL REV
         logical Check1,check2,again,check3,check4,check5
         logical reflag
        DATA  REV/.TRUE./
        REAL*8  L
 c
        data  h/0./,Ri/0./
        data  delt_rain/0.5/
 C
        DELTAT  » (TEND -  TSCD/FLOAKNOBLPT)
         if(deltat .It. delt_min) then
                 noblpt = int((tend-tsc1)/delt_min)  +1
                 deltat = (tend-tsc1)/float(noblpt)
                 endif
 C
         TO = TSC1
         IFCDELTAT .LT. 2.)  GO TO 100
 C
         URITE(lunlog,1100)
         WRITEdunlog,*) DELTAT
  1100   FORMAT(5X,1TIME INCREMENT USED ON LAST PORTION OF SOURCE CALC1)
 C

 1  -- sys$degadis:nobl.for                      6-SEP-1989 17:10:53

-------
                                     D-95

  100   CONTINUE
C
C       ESTABLISH LOOP TO FINISH SOURCE
C
        DO 110 I = 1.NOBLPT
C
        TIME = TO + FLOAT(I)*DELTAT
        IF(I .EG. NOBLPT) TIME = TEND
        L = 2.0*AFGEN2(PTIME,R1T,TIME,IR1T-BL')
        erate = AFGEN2(PTIME,ET,TIME,'ET-BL')
        flux = EraTe/(pi*L*L/4.DO)
        PUCP = AFGEN2(PTIME,PWC,TIME,'ET-BL')
        PWAP = (1.DO - PUCP)/(1.DO + HUMID)
        HPRIM = AFGEN2(PTIME,PENTH,TIME,'ET-BL')
        CALL SETDENCPUCP, PUAP, HPRIM)
        RHOP = AFGEN2(PTIME.PRHO,TIME,'RH-BL')
        CCP = PWCP * RHOP
c
        qstar = CCP * k*ustar*alpha1*dellay/(deUay-1.>/phihat(RHOP,L)
        if
-------
                                     D-96

  110   CONTINUE
        RETURN
C
C
  500   continue                !  steady state completion
        outcc = cc
        sue I = we
        swal * ua
        senI = enthalpy
        srhl * rho
        outsz = sz
        outl  = 2. * rlist
        outb  = pi * rlist**2 /out 1/2.
        return
 2000   fontiat(1pg16.9.1x,1pg16.9,(1xf1pg13.6})
        END
 3 -- sysSdegadis:nobl.for                      6-SEP-1989 17:10:53

-------
                                      D-97

c	
c
C       SUBROUTINES OB AND OBOUT ARE USED IN THE OBSERVER INTEGRATIONS
C            OVER THE SOURCE.
C
        SUBROUTINE OB(time,Y,D,PRMT)

        Implicit Real*8 ( A-H, 0-Z ). Integer** ( I-N )
C
        include 'sys$degadis:OEGADIS2.dec'
c
        COMMON
     S/GEN3/ radg(2,maxl),qstr(2,maxl),srcden(2,maxl),srcwc(2,maxl),
     $ srcwa(2,maxl),srcenth(2,maxt)
     $/PARM/UO,20,2R,ML,USTAR,K,G.RHOE,RHOA,DELTA,BETA,GAMMAF.CcLOW
     $/comatm/ istab,tamb.pamb,humid,isofI,tsurf.ihtfl,htco,iwtfl.wtco,
     $ humsrc
     S/PARMSC/ RM,SZM,EMAX,RMAX,TSC1,ALEPH,TEND
     $/ALP/ALPHA,alpha1
     S/phicom/ iphifl.dellay
c
        REAL'S K,ML
        logical flag
C
        DIMENSION Y(1),D(1),PRMT(1)
        INTEGER HUIDTH.Mrate,Crate,BDArate.Hrate
        DATA HUIDTH/1/.Mrate/2/,Crate/3/,BDArate/4/,Hrate/5/
C
C*** PASS TO IN PRMT<6)
C
        flag =  isofl.eq.  1  .or.  ihtfl.eq. 0
c
        TOL =  PRMT(6)
        xup =  prmt(7)
        XI = XIT(TIME.TOl)
        RG = AFGEN(RADG,TIME,'RADG')
        RLEN = PRMTO3)
C
        BIPR = 0.
        D(HWIDTH)=  0.
        D(Crate)  =  0.
        D(Mrate)  =  0.
        D(BDArate)= 0.
        D(Hrate)  -  0.

c
c*** We must deal with  the case  when the observer sees no  gas,  but  the
c*** integration  is not  over yet.   Since the derivatives have been  set
c*** to zero above,  no  work on the derivatives is needed,  but the values
c*** in PRMT(14-18) must be preserved.   Since  these  will be switched
c*** in OBOUT,  switch  them now so  the old values  will  be retained.

1  -- sys$degadis:ob.for                         6-SEP-1989  17:11:55

-------
                                     D-98
       IF(ABS(XI) .GE. RG) then          use the last values
               PRMT(8)  = prmt(U)       cclay
               PRMT(9)  = prmt(15)       wclay
               PRMT(IO) = prmt(16)       ualay
               PRMT(11) * prmtd?)       enthlay
               PRMT(12) = prmt(18)       rholay
               RETURN
               endif
       BIPR = sqrt(RG*RG - XI*XI)

       UI = UIT(TIHE.TOl)

       Q    = AFGEN(QSTR,TIME,'QSTR')
       we   = AFGEN(srcwc,tirne,'srcwc')
       wa   • AFGEN(srcwa,time,'srcwa')
       enth - AFGEN(srcenth,time.'srcenth')

       wclay   = Y(Crate)/Y(Mrate)
       walay   = Y(BDArate)/Y(Mrate)
       if(.not.flag) enthlay * Y(Hrate)/Y(Mrate)

       calI tpropd,wclay,walay,enthlay,yc.ya,urn,temp,rholay,cp)
       cclay = wclay*rholay

       prmt(8) * cclay
       prmt(9) = wclay
       prmt(10)= walay
       prmt(11)= enthlay
       prmt(12)= rholay

       cc  = cclay*dellay
       rho = dellay*(rholay-rhoa) +  rhoa

       szob =  0.01
       arg = Q*(xi-xup)/cc/
-------
                                     D-99

1000   FORMATC  ?OB? •-  Value of XI  '.1pC13.4.';  Value  of  RG  ',
    $  1pG13.4)
       RETURN
       END
       SUBROUTINE OBOUTC  X,  Y,  DERY,  IHLF.  NDIM,  PRMT)

       Implicit Real*8 (  A-H, 0-Z ),  Integer**  (  I-N  )

       DIMENSION X(1), Y(1), DERY(I),  PRMT(1)
       PRMT(U) = prmt(8)
       PRMT(15) = prmt(9)
       PRMT<16) = ppmt(IO)
       PRMT<17) = prmt(H)
       PRMTC18) = prmt(12)
       RETURN
       END
cclay
we I ay
ualay
enthlay
rholay

    sysSdegadis:ob.for
             6-SEP-1989 17:11:55

-------
                                       D-100

 c	
 c
 C       FUNCTION PSI
 C
 C*** AS PER COLENBRANOER ••
 C
 C*** THIS FUNCTION HAS BEEN DERIVED FROM BUSINGER,J.A.
 C***  WORKSHOP ON MICROMETEOROLOGY, CHAPTER 2, HAUGEN.D.A. (ED.)
 C***  AMERICAN METEOROLOGICAL SOCIETY.
 C
         FUNCTION PSIF(Z.ML)

         Implicit Real*8 < A-H, 0-Z ), Integer*4 ( I-N )
          include  'sys$degadis:DEGADIS1.dec'
 c
          REAL*8 ML
 C
          IF( ML ) 10,20,30
 C
  10     A  =  <1.-15.*Z/ML)»*.25
          PSIF  = 2.*dLOG((1.+A)/2.) + dLOG«1.+A*A)/2.)  - 2.*daTAN(A)
       $ PI/2.
          RETURN
 C
  20     PSIF  * 0.
          RETURN
  C
  30     PSIF =  -4.7*Z/ML
          RETURN
          END
####
  1 -- sys$degadis:psif.for                      6-SEP-1989 17:12:59

-------
                                     D-101



       SUBROUTINES  FOR PSEUDO-STEADY STATE INTEGRATION.

       SUBROUTINE PSSCDIST,Y,DERY,PRMT)

       Implicit  Real*8 ( A-H, 0-Z  ), Integer*4 (  I-N  )

       include  'sys$degadis:DEGADIS2.dec/list1

       parameter (zero=1.D-10,  rcrit=2.D-3)

       COMMON
     S/PARM/  UO.ZO.ZR,ML,USTAR,K,G,RHOE,RHOA,DELTA,BETA,GAMMAF.CcLOW
     $/com_gprop/ gas_mw,gas_temp,gas_rhoe,gas_cpk,gas_cpp,
     S  gas_ufI,gas_lfI,gas_zsp,gas_name
     S/comatm/ istab,tamb.pamb,humid,isofl.tsurf,ihtfl,htco,iwtfl,wtco,
     S  humsrc
     S/PHLAG/ CHECK1.CHECK2,AGAIN,CHECKS,CHECK4,CHECKS
     $/ALP/ ALPHA,alpha1
     S/phicom/ iphifl.dellay
     $/sprd_con/ ce, delrhomin

       REAL*8 K.ML

       LOGICAL  CHECK1.CHECK2,AGAIN,CHECKS,CHECK4,CHECKS

       DIMENSION Y(1),DERY(1),PRMT(1)
       DATA rhouh/1/,SY2/2/,BE F F/3/.dh/4/,Mh i/5/,MIow/6/
        INTEGER  rhouh,SY2.BEFF.dh,  MM,  Mlow
C*** PRMT I/O SETUP
C***
        I
                VALUE
                                IN/OUT
k. 	
c***
c***
c**.
c***
c***
c***
c***
c***
c***
c***
£***
C***
C***
c***
c***
c***
e***
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
E
Cc
Bb
CON DERY(BEFF)
CON DERY(SZ)
NREC(I,1)
DIST

yc
rho
temp
gamma



sz
sz
IN
OUT
OUT
IN
IN
OUT -- STARTS OUTPUT COUNTER
OUT

out
out
out - if recorded
out - if recorded





  -- sys$degadis:pss.for
                                               6-SEP-1989 17:13:14

-------
                                     D-102

c
        Erate = PRMT(6)
        Bb = Y(BEFF) - SQPtPI/2.*sqrt(Y(SY2))
c
c using the last value for Sz
c
        szO = prmt(22)
        sz = szO
C
C*** MATERIAL BALANCE
C
        iii = 0
 100    Cc = Erate*ALPHA1/2./UO*(ZO/SZ)**ALPHA/S2/Y(BEFF)
        cclay = cc/detlay
        call addheat(ccl8y,y(dh),rholay>temlay,cp)
        prod = dmaxH Y(rhouh)/rholay/prmt(18),  zero)
        sz * ( prod )**(!. /alpha!) * zO
        dif « abs(sz • szO)/(abs(sz)+abs(szO)+zero)
        IfCdff .gt. rcrit) then
                szO = sz
                if(ifi .gt. 20) call trap(32)
                goto 100
                endif
        prmt(20) = rholay
        prmt(21) = sz
        HEFF = GAMMAF/ALPHA1*SZ

        call adiabat(0,wc,ua,yc,ya,cc,rho,nm,enth,temp)
        call adiabat(0, we, wa,yclay,ya, cclay, rholam,uml,enth,temlay)
                                                         *
 c
        rit = 0.
        ifO'sofl.eq.O  .and.  ihtfl.ne.O) then
                call addheat(cc,deUay*y(dh),rho,temp,cp)
                rit »  rift(temp.heff)
                endif
        RISTR = RIF(RHO.HEFF)
        PHI = PHIF(RISTR.rit)
 C
 C*** CALCULATE DERIVATIVES
 C
        DERY(BEFF)  =  0.
        delrho =  rho-rhoa
         IF(delrho .GT. delrhomin)  DERY(BEFF)  = PRMT(9)*sqrt(delrho/rhoa)
      $    *(SZ/ZO)**(.5 - ALPHA)
 C
        DERY(SY2) = 8.*BETA/PI*Y(BEFF)**2 *
      $    (DELTA*SQPI02/Y(BEFF)) ** (1./BETA)
 C
 c
         heigh =  heff*dellay

 2 -- sys$degadis:pss.for                       6-SEP-1989 17:13:14

-------
                                      D-103

        yw = 1.-yclay-ya
        yw = min( max<  yw,  0.00 ),  1.DO)
        call surf ace(temlay, heigh, rholay,wml,cp,yu,watrte,qrte)
        ifCtemp.ge. tsurf .or.  temlay.ge.  tamb)  qrte = 0.
        rhouhb = rholay* prmt(18) * /phi
        dERYCdh) = (qrte*Y(beff)/dellay -  Y(dh)*d_rhouhb)/rhouhb
        dERY(rhouh) = (d_rhouhb-Y(rhouh)*OERY(beff ))/Y(beff )
c
c*** Calculate the derivative for the total mass above the UFL and LFL
c
        gaitma = (rho-rhoa)Xcc                   !  gamma
        if(check4) then
          DERY(mlow) = 0.
          DERY(mhi)  = 0.
          if( isofl.eq.1 .or. ihtfl.eq.O } then
                call adiabat(2,aa,dd,gas_ufl,ee,chi  ,gg,hh,pp,oo)
                call adiabat(2,aa,dd,gas_lf l,ee.clow,gg,hh,pp,oo)
          else
                call adiabat(-2,aa,dd,gas_uf l,ee,chi ,gg,hh, gamma, oo)
                call adiabat(-Z,aa,dd,gas_lf I, ee, clow, gg,hh, gamma, oo)
          end if
                gamhi  = 2.DO* Cc * Bb * Sz /  alphal
        gammax = 2. DO* Cc * Sz * GAMMAF/alphal * (Bb+sqrtpi/2.DO*sqrt(Y(Sy2)))

          if(cc.gt.clow) then
                wlow - Dlog(cc/clow)
                gam low = garni nc( 1 .D0/alpha1, wlow )  * gamhi
            DERY(mlow)= garni ow + 2.DO*clow*sqrt(Y(Sy2))*Sz/alpha1*series(wlow)
            DERY(mlow)= DMINK DERY(mlow), gammax }
          endif

          if(cc.gt.chi) then
                whi  * Dlog(cc/chi )
                gamhi  = gaorincCI.DO/alphal, whi  )  * gamhi
            DERY(mhi) = gamhi  + 2.DO*chi *sqrt(Y(Sy2))*Sz/alpha1*series(whi )
            DERY(mhi) * DMINK DERY(mhi ), gammax )
          endif
        endif
C
C*** RETURNED VALUES
C
        PRMT(7) = CC
        PRMT(8) = Bb
        prmt(14)= yc
        prmt(15)= rho
        prmt(16)= temp
        prmt(17)= gamma
        RETURN
        END
3  -- sys$degadis:pss.for                       6-SEP-1989 17:13:14

-------
                                      D-104
C
C       SUBROUTINE PSSOUT
C
        SUBROUTINE PSSOUT(X,Y,D,IHLF,NDIM,PRMT)

        Implicit Reat*8 ( A-H, 0-2 ), Integer*4 ( I-N )
        include 'sys$degadis:DEGADIS2.dec'
c
        parameter (npss=9, zero=1.e-10>
c
        COMMON
     $/PARM/UO,ZO,ZR.ML,USTAR,K,G,RHOE,RHOA,DELTA,BETA,GAMMAF.CcLOW
     $/comatm/ istab,tamb.pamb,humid,isofl.tsurf.ihtfl,htco,iwtft.wtco.
     $ humsrc
     $/STP/STPO,STPPfCOLPfODLLP,STPG,ODLG,ODLLG
     S/PHLAG/CHECK1,CHECK2,AGAIN.CHECKS,CHECK4,CHECKS
     S/STOPIT/TSTOP
C
        REAL*8 K.ML
        LOGICAL CHECK1.CHECK2.AGAIN,CHECKS,CHECK4,CHECKS
        DIMENSION Y(1),Dd),PRMTd),BKSP(npss),OUT(npss),CURNT(npss)
C
C*** OUTPUT  PARAMETERS
C
C*** FROM  PSS             OUTPUT TO MODEL
C***	             	
C***    X                       DIST
C***    PRMT(7)                 Cc
C***    Yd)                   SZ
C**«    Y<2>                   SY2
C***    PRMT<8)                 B
C***    PRMT(13)                TO(I)
c***    prmtd4)                yc
c***    prmtdS)                rho
c***    prmt(16)                temp
c***    print d 7)                gamma
c
        ERM  = 0.
        TSL  = TS(PRMT(13),X)
        prmt(22)  « prmt(21)
         IF(PRMTdl) .NE.  0.) GO TO 90
 C
 C***  STARTUP FOR  THE OUTPUT  ROUTINE
 C
         RII  = -100./STPP
         RI - 0.
         CURNTd)  = X
         curnt(2)  = prmt(14)      !  yc

 1  --  sys$degadis:pssout.for                    6-SEP-1989 17:14:35

-------
                                     D-105
CURNT(3) = PRMT(7)
curnt(4) = prmt(15)
curnt(S) = prmt(17)
curnt(6) = prmt(16)
CURMT(7) = prmt(21)
CURNT(S) = sqrt(Y(2»
CURNT<9) = PRMT(8)
! ce
! rho
! gamma
! temp
! sz
! sy2
! b
        IF(prmt(8)  .LE.  0.)  CALL  trap(16)
   90   CONTINUE
C
C*** STOP INTEGRATION WHEN THE  HALF WIDTH B < 0.
C
        IF< PRMT(8) .LE. 0.) GO TO 1000
C
C*** SET THE CURRENT AND PREVIOUS RECORD
C
        DO 100 II=1,npss
100
C









C
c***
C








95
C
c***
c


BKSP(II) = CURNTOI)

CURNT(I) = X
curnt(2) & prmt(U)
CURNTC3) = PRMTC7)
curnt(4) = prmt(15)
curnt(5> « prmt<17)
curnt(6) = prmt(16)
CURNTC7) = pmrt(21)
CURNT(8) = sqrt(Y(2)>
CURNT(9) = PRHT(S)

STOP INTEGRATION AND GET

IF(PRHT(7).GT.CcLOW .
if(prmt(11) .
erm =
goto
end if
AGAIN = .TRUE.
TSTOP = TSL
GO TO 1000
CONTINUE

Check the error criteria

RI = RI + 1.
II = 2



! yc
! cc
! rho
! gamma
! temp
! sz
! sy2
! b

A NEW OBSERVER WHEN Cc
-------
                                      D-106

        IF(1I .EQ. 5) II « II + 1       !  skip TEMP;6
        IF(II .LT. npss) GO TO 110
C
C*** RECORD POINT IF OOLP IS EXCEEDED OR 80 METERS SINCE LAST RECORD
C*** RECORD FIRST POINT
C
        DX = CURNT(I) • OUT(1)
        IF< RI.NE.1. .AND. ERM.LT.ODLP .AND. DX.LE.OOLLP) RETURN
C
C*** IF THE NEXT INTEGRATION AFTER A POINT IS RECORDED VIOLATES THE
C*** ERROR BOUND, THE CURRENT POINT MUST BE RECORDED. OTHERWISE, THE
C*** LAST POINT TO SATISFY THE ERROR LIMITS IS RECORDED.
C
        DO 120 11=1,npss
        IF(RI .EQ. RIM.) BKSP(II) = CURNT(II)
  120   OUTU I) = BKSP(II)
C
        RI - RII
        PRMT<11) = PRMT(11) + 1.
C
        WRITEC9,*) (OUT(II),11=1,npss)
        RETURN
C
 1000   CONTINUE
C
C*** STOP INTEGRATION
C
        PRMT(12)  * X
C
         IF(CURNT(1)  .EQ.  OUT(D) GO TO  130
C
        PRMT<11)  =  PRMT(11) + 1.
        WRITEC9,*)  (CURNT(II),II=1,npss)
 C
   130    CONTINUE
         PRMTC5) * 1.
         RETURN
         END
 3 •- sys$degadis:pssout.for                    6-SEP-1989 17:14:35

-------
                                      D-107

c	
c
C       SUBROUTINE PSSOUT
C
        SUBROUTINE PSSOUT(X.Y.DERY,IHLF,NDIM.PRMT)

        Implicit Real*8 ( A-H, 0-Z >, Integer*4 ( I-N )
        include 'sys$degadis:DEGADIS2.dec/list1
c
        parameter (npss=9, zero=1.e-10)
c
        COMMON
     $/PARM/UO,ZO,ZR,ML,USTAR,K,G,RHOE,RHOA,DELTA,BETA,GAMMAF.CcLOW
     $/STP/STPP,OOLP,OOLLP,STPG,OOLG,OOLLG
     S/PHLAG/CHECK1,CHECK2,AGAIN,CHECKS,CHECKS,CHECKS
     $/com_fl/ cflag.clfl.cufl
     S/ALP/ALPHA,alpha!
C
        logical cflag
        LOGICAL CHECK1.CHECK2,AGAIN,CHECKS,CHECK4,CHECKS
C
        REAL*8 ML.K
C
        DIMENSION Y(1),DERY(1),PRMT(1)
        dimension BKSP(npss),OUT(npss),CURNT(npss)
C
C**» OUTPUT PARAMETERS
C
C*** FROM PSS             OUTPUT TO MODEL
C***	              	
C***    X                       DIST
C***    PRMTC7)                 Cc
C***    Y<1)                    SZ
C***    Y<2>                    SY2
C***    PRMK8)                 B
C
        ERM » 0.
        prmt{22) =  prmt(21)
C
        IF(PRMT(11)  .NE.  0.)  GO TO 90
C
C*** STARTUP  FOR THE  OUTPUT ROUTINE
C
        RII =  -100./STPP
        RI -  0.
        CURNTd) =  X
        CURNT(2) =  PRMT(K)      ! yc
        CURNT(3) =  print (7)       ! cc
        CURNT(4) =  print(15)      ! rho

1  •• sys$degadis:pssoutss.for                 6-SEP-1989  17:15:47

-------
                                      D-108

        CURNT(S) = PRMU17)      !  gamma
        curnt(6) = prmt(16)      !  temp
        curnt(7) = prmt(8)      !  b
        curnt(8) = prmt(21)      !  sz
        curnt{9) = sqrt(Y(2»   !  sy2
C
   90   CONTINUE
C
C*** STOP INTEGRATION WHEN THE HALF WIDTH B < 0.
C
        IF( PRHT(B) .LE. 0.) GO TO 1000
C
C*** STOP INTEGRATION when Cc
-------
                                      D-109

        IF( RI.NE.1. .AND.  ERM.LT.OOLP .AND. DX.LE.OOLLP)  RETURN
C
C*** IF THE NEXT INTEGRATION AFTER A POINT  IS  RECORDED  VIOLATES THE
C*** ERROR BOUND, THE CURRENT POINT MUST BE RECORDED. OTHERWISE,  THE
C*** LAST POINT TO SATISFY THE ERROR LIMITS IS RECORDED.
C
        DO 120 II-1,npss
        IF(R1 .Ed. RII+1.) BKSP(II) - CURNT(II)
  120   OUT(II) = BKSP(II)
C
        RI = RII
        PRMTC11) = PRMTC11) + 1.
C
        call ssout(out)
        RETURN
C
 1000   CONTINUE
C
C*** STOP INTEGRATION
C
        PRMTC12) = X
C
        IF(RI .EQ. 0.) CALL trap(16)
C
        IF(CURNTd) .EQ. OUT(1» GO TO 130
C
        PRMT(11) * PRHT(H) + 1.
        call ssout(out)
C
  130   CONTINUE
        PRMT(5) = 1.
C
        RETURN
        END
3  •- sys$degadis:pssoutss.fop                  6-SEP-1989 17:15:47

-------
                                     D-110

c	
c
C       RICHARDSON NUMBER (RI*)
C
        FUNCTION RIF(RHOG.HEFF)

        Implicit Real*8 ( A-H, 0-2 ), Integer** ( I-N )

C
        COMMON
     $ /PARM/UO,20,ZR,ML,USTAR,K,G,RHOE,RHOA,DELTA,BETA,GAMMAF,CcLOW
C
        REAL*8 ML, 1C
C
        RIF = G*(RHOG-RHOA)/RHOA*HEFF/USTAR/USTAR
C
        RETURN
        END
c
C	
C
C       RICHARDSON NUMBER  (RIt)
C
        FUNCTION  RIFt(temp,HEFF>

        Implicit  Real*8  (  A-H, 0-2  ),  Integer**  (  I-N  )

C
        COMMON
      $  /PARM/ UO,ZO,ZR,ML,USTAR.K.G,RHOE,RHOA,DELTA,BETA,GAMMAF.CcLOW
      S/comatro/  istab.tanb.panfc.humid,isofl.tsurf,ihtfl,htco,iwtfl,utco,
      S  hunsrc
      S/alp/ alpha,alphal
C
        REAL*8  ML,K
 C
        wind =  uO*(heff/zO)**alpha
        RIFt =  dmax1(C*
-------
                                      D-lll

        common /phicom/ iphifl.dellay
C
        phif= 0.
        gotoCIO,1000,2000,3000,4000,9000),iphifI
        goto 9000
c
  10    IF(RI) 100,200,300
C
 100    PHIF = 0.74/C1. + 0.65*ABS(RI)**.6)
        RETURN
C
 200    PHIF = 0.74
        RETURN
C
 300    PHIF = 0.74 + 0.25*(RI)**0.7 + 1.2E-7*RI*RI*RI
        RETURN
C
c
 1000   IF(RI) 1100,1200,1300
C
 1100   PHIF = 0.88/(1. + 0.65*ABS(RI)**.6)
        RETURN
C
 1200   PHIF * 0.88
        RETURN
C
 1300   PHIF = 0.88 + 9.9e-2*CRI}**1.04 +  1.4E-25*RI**5.7
        RETURN
C
c
c
 2000   corrl = 0.25* rit**.666666 * 1.
        corr * sqrt(corrl)
        riw * ri/corrl
        IF(RI) 2100,2200,2300
C
 2100   PHIF = 0.88/C1. + 0.65*ABS
-------
                                     -D-112

 3100   PHIF = 0.88/corr
        RETURN
C
 3200   PHIF = 0.88/corr
        RETURN
C
 3300   PHIF = (0.88 + 9.9e-2*(RIw)**1.04 + 1.4E-25*RIw**5.7)/corr
        RETURN
c
c
 4000   PHIF = 0.88
        RETURN
C
c
 9000   call trap(29)
        return
        END
c
c
c	
c
c
        function phihat(rho,fetch)

        Implicit Real*8 ( A-H, 0-Z  ),  Integer*^  (  I-N  )

c
        common
      X/parm/ uO,zO,zr,ml,ustar,k,g,rhoe,rhoa,delta,beta,gammaf,cclow
      X/alp/ alpha,alphal
      X/phicom/ iphifl.dellay
 c
         real*8 k,ml
 c
        data phic/3.1/
 c
         if(rho .le.  rhoa)  then
                 phihat  = 0.88
                 return
                 end if
 c
        pow = 1./alphal
        p1 = 1.04/alpha1
        p1i = 1.DO/p1
        p2 = 1. + p1i
        p3 = (alpha - 0.04)/1.04
         p4 = (1.08 -  alpha)/1.04
         Ci = g*(rho-rhoa)/rhoa*zO/ustar**2*gammaf/alpha1
         Ci =Ci* (k*ustar*alpha1**2 /uO/zO/ phic*dellay/(dellay-1.)) ** pow
 c
         Ri = Ci*fetch**pow

 3 -• sysXdegadis:riphif.for                    6-SEP-1989 17:16:53

-------
                                     D-113

        zzz =  - 0.099*Ri**1.04/0.88
c
        if(abs(zzz) .It. 1.) then
                phihat = 0.88/gseries(1.DO,  p1i,  p2,  zzz)
        else
                zzz «= 1.00/zzz
                phi hat = 0.88/(-zzz/(1.-p1)*gseries(1.DO, -p3,  p4,  zzz)
                  + gamma
-------
                                      D-114

C       	
c
C       SUBROUTINE RKGST
C
c	
c
c       This routine was originally supplied by Digital Equipment
c       Corporation as part of the Scientific Subroutine Package
c       available for RT-11 as part of the Fortran Enhancement
c       Package.  It was upgraded for use as the integration
c       routine in this package.
c
c	
c
C       PURPOSE
C               TO SOLVE A SYSTEM OF FIRST ORDER ORDINARY DIFFERENTIAL
C               EQUATIONS WITH GIVEN INITIAL VALUES.
C
C       USAGE
C               CALL RKGST (PRMT,Y,DERYfNDIM,IHLF,FCT,OUTP,AUX)
C               PARAMETERS FCT AND OUTP REQUIRE AN EXTERNAL STATEMENT.
C
C       DESCRIPTION OF PARAMETERS
C
C       PRMT    AN INPUT AND OUTPUT VECTOR WITH DIMENSION GREATER
C               OR EQUAL TO 5, WHICH SPECIFIES THE PARAMETERS OF
C               THE  INTERVAL AND OF ACCURACY AND WHICH  SERVES FOR
C               COMMUNICATION BETWEEN SUBROUTINES OUTP  AND  FCT
C               (FURNISHED BY THE USER) AND SUBROUTINE  RKGST.
C               EXCEPT PRMT(5) THE COMPONENTS ARE NOT DESTROYED
C               BY SUBROUTINE RKGST AND THEY ARE:
C       PRMT(1) LOWER BOUND OF THE  INTERVAL  (INPUT),
C       PRMT(2) UPPER BOUND OF THE  INTERVAL  (INPUT),
C       PRMT(3)  INITIAL  INCREMENT OF THE  INDEPENDENT VARIABLE
C                (INPUT),
C       PRMT(4) UPPER ERROR BOUND  (INPUT).  IF RELATIVE  ERROR IS
C               GREATER  THAN  PRMT(4),  INCREMENT  GETS  HALVED.
C                IF RELATIVE ERROR  LESS THAN  PRMT(4)*EXPAND,
C                INCREMENT GETS DOUBLED.
 C                THE USER MAY  CHANGE PRMT(4)  BY  MEANS  OF HIS
 C                OUTPUT  SUBROUTINE.
 C        PRMT(5) MAXIMUM STEP  SIZE  ORDER OF MAGNITUDE  (INPUT).
 C                SUBROUTINE RKGST INITIALIZES
 C                PRMT(5)-0. IF THE USER WANTS TO TERMINATE
 C                SUBROUTINE RKGST AT ANY OUTPUT  POINT,  HE HAS TO
 C                CHANGE PRMT(S) TO NON-ZERO BY MEANS OF SUBROUTINE
 C               OUTP.  FURTHER COMPONENTS OF VECTOR PRMT ARE
 C               FEASIBLE IF ITS DIMENSION IS DEFINED GREATER
 C               THAN 5. HOWEVER SUBROUTINE RKGST DOES NOT REQUIRE
 C               AND CHANGE THEM. NEVERTHELESS THEY MAY BE USEFUL
 C               FOR HANDING RESULT VALUES TO THE MAIN PROGRAM

 1  -- sys$degadis:rkgst.for                     6-SEP-1989 17:24:29

-------
                                      D-115

C               (CALLING RKGST) WHICH ARE OBTAINED BY SPECIAL
C               MANIPULATIONS WITH OUTPUT DATA IN SUBROUTINE OUTP.
C       Y       INPUT VECTOR OF INITIAL VALUES.  (DESTROYED)
C               LATER, Y IS THE RESULTING VECTOR OF DEPENDENT
C               VARIABLES COMPUTED AT INTERMEDIATE POINTS X.
C       DERY    INPUT VECTOR OF ERROR WEIGHTS.  (DESTROYED)
C               ERROR WEIGHTS ARE CENTERED AT ONE. IF ONE PARA-
C               METER NEEDS A TIGHTER ERROR CRITERIA,THE WEIGHT IS
C               GREATER THAN ONE. IF A PARAMETER NEED NOT BE DETER -
C               MINED SO PRECISELY,THE WEIGHT SHOULD BE LESS
C               THAN ONE.IN OTHER WORDS,
C                       ERROR CRITERIA(I) = PRMT(4) / WEIGHT(I)
C               WHERE I IS THE SUBSCRIPT OF A DEPENDENT VARIABLE.
C               LATER, DERY IS THE VECTOR OF DERIVATIVES, WHICH
C               BELONG TO FUNCTION VALUES Y AT A POINT X.
C       NDIM    AN  INPUT VALUE, WHICH SPECIFIES THE NUMBER OF
C               EQUATIONS IN THE SYSTEM.
C       IHLF    AN  OUTPUT VALUE. WHICH SPECIFIES THE NUMBER OF
C               BISECTIONS OF THE INITIAL INCREMENT. IF IHLF BE-
C               COMES GREATER THAN 10, SUBROUTINE RKGST RETURNS THE
C               ERROR MESSAGE IHLF=11 INTO MAIN PROGRAM. ERROR
C               MESSAGE IHLF=12 OR IHLF*13 APPEARS IN CASE
C               PRMT(3)=0 OR IN CASE SIGN(PRMT(3)).NE.SIGN(PRMT(2)-
C               PRMT(1)) RESPECTIVELY.
C       FCT     THE NAME OF AN EXTERNAL SUBROUTINE USED. THIS
C               SUBROUTINE COMPUTES THE RIGHT HAND SIDES DERY OF
C               THE SYSTEM TO GIVEN VALUES X AND Y.  ITS PARAMETER
C               LIST MUST BE X,Y,DERY,PRMT. SUBROUTINE FCT SHOULD
C               NOT DESTROY X AND Y.
C       OUTP    THE NAME OF AN EXTERNAL OUTPUT SUBROUTINE USED.
C               ITS PARAMETER LIST MUST BE X,Y,DERY,IHLF,NDIM,PRMT.
C               NONE OF THESE PARAMETERS (EXCEPT,  IF NECESSARY,
C               PRMT(4),PRMT(5),...) SHOULD BE CHANGED BY
C               SUBROUTINE OUTP.  IF PRMT(5) IS CHANGED TO NON-ZERO,
C               SUBROUTINE RKGST  IS TERMINATED.
C       AUX     AN  AUXILIARY STORAGE ARRAY WITH 8 ROWS AND NDIM
C               COLUMNS.
C
C       REMARKS
C
C       THE PROCEDURE TERMINATES  AND RETURNS  TO  CALLING PROGRAM,  IF
C        (1) MORE  THAN 10 BISECTIONS OF  THE  INITIAL  INCREMENT ARE
C               NECESSARY TO GET  SATISFACTORY ACCURACY  (ERROR  MESSAGE
C               IHLF=11),
C        (2) INITIAL INCREMENT  IS  EQUAL  TO 0 OR HAS WRONG SIGN
C               (ERROR MESSAGES  IHLF=12 OR  IHLF-13),
C        (3) THE WHOLE  INTEGRATION INTERVAL  IS WORKED THROUGH,
C        (4) SUBROUTINE OUTP  HAS  CHANGED PRMT(5)  TO NON-ZERO.
C
C        SUBROUTINES AND  FUNCTION  SUBPROGRAMS  REQUIRED
C        THE EXTERNAL  SUBROUTINES  FCT(X,Y,DERY,PRMT)  AND

2  ••  sys$degadis:rkgst.for                      6-SEP-1989  17:24:29

-------
                                      D-116

C       OUTP(X,Y,DERY,IHLF,NDIM,PRMT) MUST BE FURNISHED BY THE USER.
C
C       METHOD
C       EVALUATION IS DONE BY MEANS OF FOURTH ORDER RUNGE-KUTTA
C       FORMULAE IN THE MODIFICATION DUE TO GILL. ACCURACY IS
C       TESTED COMPARING THE RESULTS OF THE PROCEDURE WITH SINGLE
C       AND DOUBLE INCREMENT.
C       SUBROUTINE RKGST AUTOMATICALLY ADJUSTS THE INCREMENT DURING
C       THE WHOLE COMPUTATION BY HALVING OR DOUBLING. IF MORE THAN
C       10 BISECTIONS OF THE INCREMENT ARE NECESSARY TO GET
C       SATISFACTORY ACCURACY, THE SUBROUTINE RETURNS WITH
C       ERROR MESSAGE IHLF=11 INTO MAIN PROGRAM.
C       TO GET FULL FLEXIBILITY IN OUTPUT, AN OUTPUT SUBROUTINE
C       MUST BE  FURNISHED BY THE USER.
C       FOR REFERENCE, SEE
C       RALSTON/UILF, MATHEMATICAL METHODS FOR DIGITAL COMPUTERS,
C       WILEY, NEW YORK/LONDON, 1960, PP.110-120.
C
C       SOME NOTES ON THE PROGRAM/RALSTON AND WILF
C
C       AUX
C
C
C       AUX(I.I) -- CURRENT VALUE OF Y    '
C       AUX(2,I) •• CURRENT VALUE OF Y1
C       AUX(3,I) •- LAST GOOD VALUES OF 0
C       AUX(4,I) •- Y AFTER ONE RIC STEP H
C       AUX<5,I) •• Y AFTER ONE OR TWO RK STEPS  OF H/2.
C       AUX(6,I) •- CURRENT VALUES OF 0
C       AUX(7,I) -- Y' AFTER ONE OR  TWO RK STEPS OF  H/2.
C       AUX(8,I) -- 2/15 * WEIGHTS
C
C       A<4>,B(4).C(4)
C        	
C
C       Y = Y   + A  *(K   • B »Q    )
C         i     i-1     i     i     i   i-1
C
 C       Q = Q   * 3*(A  *(K   - B *Q   )  • C *K
 C         i     i-1        i    i     i   i-1      i   i
 C
 C        FOR VALUES OF  I  BETWEEN  1 AND 4,  AND FOR VALUES OF K AS FOLLOWS
 C
 C        K =  H * F(X  ,Y  )
 C         1           00
 C
 C        K  = H * F(X +H/2.Y )
 C         2          01
 C
 C       K  = H * F(X +H/2.Y )
 C        3          02

 3 -- sys$degadis:rkgst.for                     6-SEP-1989 17:24:29

-------
                                      D-117

C
C       K  = H * F(X +H,Y )
C        4          03
C
C       RELATIVE ERROR
C       	
C
C       AS PER RICHARDSON QUOTED IN RALSTON/UILF (P117),
C
C       ABS ERROR - UEIGHT/15*ABS(Y2 - Y1)
C
C       THEN, RELATIVE ERROR
C
C       REL ERROR = WEIGHT*2/15*ABS(Y2 • YD/SUM
C
c       where SUM = ABS(Y2 + YD
C
C       The solution  tries to use SUM=abs(y2+y1} first. If this is zero,
C       then SUM=.25*ABS(Y1) is used since y1 and y2 must be oposite  in
C       sign with equal magnitude.  If this
C       quantity  is zero  as well, the values y2 and y1  both must be zero;
C       therefore, the difference is also zero  which satisfies the
C       error criteria.
C
         SUBROUTINE  RKGST(PRMT,Y,DERY,NDIM,IHLF,FCT,OUTP,AUX)

         Implicit  Real*8  ( A-H,  0-2  ),  Integer*4  (  I-N  )

 C
         DIMENSION Y<1),DERY(1),AUX(8,NDIM),A(4),B<4),C(4),PRMT(1)
 C
         DATA  ERRSET/1./
 C
 C
         DO  10 I=1,NDIM
    10    AUX<8,I)=.133333333333333333DO * DERY(I)
         X=PRMT(1)
         XEND=PRMT(2)
         H=PRMT(3)
         stpmin =  abs(h/1024.DO)
         stpmax *  abs(prmt(5)>
         PRMT(5)=O.DO
         CALL  FCT(X,Y,DERY,PRMT)
 C
 C*** ERROR  TEST
 C
         IF(H*(XEND-X))380,370,20
 C
 C*** PREPARATIONS FOR RUNGE-KUTTA METHOD

 4 -- sys$degadis:rkgst.for                     6-SEP-1989  17:24:29

-------
                                      D-118
   20   A(1)=.5DO
        A(2)= 1.DO -  DSQRT(  0.500  )
        A(3)= 1.DO +  DSQRTC  0.5DO  )
        A(4)= 1.DO/6.DO
        B(1)=2.DO
        B(2)=1.DO
        B(3)=1.DO
        B(4)=2.DO
        C(1)=.5DO
        C(2)= A<2)
        C<3)= A(3)
        C(4)=.5DO
C
C*** PREPARATIONS  OF  FIRST RUNGE-KUTTA STEP
C
        DO 30 I=1,NDIM
        AUX<2,I)=DERY(I)
        AUX(3,I)=O.DO
   30   AUX(6,I)=O.DO
        IREC=0
        H=H+H
        IHLF=-1
        ISTEP=0
        IEND=0
C
C*** START OF A RUNGE-KUTTA STEP
C*** STEP = 2 * SPECIFIED STEP
C
   40   IF«X+H-XEND)*H)70,60,50
   50   H=XEND-X
   60   IENDs1
C
C*** RECORDING OF  INITIAL VALUES OF THIS STEP
C
   70   CALL FCTCX.Y.DERY.PRMT)
        CALL OUTP(X,Y,DERY,IREC,NDIM,PRMT)
        IF(PRMT(5))400,80,400
   80   ITEST=0
   90   ISTEP-ISTEP+1
C
C*** START OF  INNERMOST RUNGE-KUTTA LOOP
C
        J=1
   100   AJsA(J)
        BJ=B(J)
        CJ=C(J)
        DO 110  I=1,NDIM
        R1=H*DERY(I)
        R2=AJ*(R1 -BJ*AUX(6, I ))

5  -- sys$degadis:rkgst.for                     6-SEP-1989 17:24:29

-------
                                     D-119

        Y(I)=Y(I)+R2
        R2=R2+R2+R2
  110   AUX(6,I)=AUX(6,I)+R2-CJ*R1
        IF(J-4>120,150,150
  120   J=J+1
        IF(J-3)130,140,130
  130   X=X+H/2.
  140   CALL FCT(X.Y,DERY,PRMT>
        GOTO 100
C
C*** END OF INNERMOST RUNGE-KUTTA LOOP
C
C*** TEST OF ACCURACY
C
  150   IF(ITEST)160,160,200
C
C*** IN CASE ITEST=0 THERE IS NO POSSIBILITY FOR TESTING OF ACCURACY
C*** IF(ITESTsO) RK STEP JUST PERFORMED WAS FOR TWICE THE SPECIFIED STEP
C
  160   DO 170  I-1.NDIM
  170   AUX(4,I)=Y(I)
        ITEST=1
        ISTEP*ISTEP*I STEP-2
  180   IHLF=IHLF+1
        X=X-H
        H=H/2.
        DO 190  I=1,NDIM
        Y(I)=AUX(1,I)
        DERY(I)=AUX(2,I)
  190   AUX(6,I)=AUX(3tI>
        GOTO 90
C
C*** IN CASE ITEST=1 TESTING OF ACCURACY  IS POSSIBLE ONLY  IF EACH
C*** HALF OF THE  INTERVAL  IS DONEd.E.fIFF  ISTEP IS EVEN)
C
  200    IMOOsISTEP/2
         IF(ISTEP-IMOD-IMOD)210,230,210
  210   CALL FCT(X,Y,DERY,PRMT)
        DO 220  I=1,NDIM
        AUX(5.I)=Y(I)
  220   AUX(7,I)=DERYU)
        GOTO 90
C
C*** ORIGINAL VERSION; absolute error
C
C      COMPUTATION  OF TEST  VALUE DELT
C   230 DELT=0.                 !Good so  far
C       DO 240  I=1,NDIM
C   240 DELT=DELT+AUX(8,I)*ABS(AUX(4,I)-Y(I))
C        IF(DELT-PRMT(4))280,280,250
C

6 -- sys$degadis:rkgst.for                    6-SEP-1989  17:24:29

-------
                                      D-120

C*** RELATIVE ERROR
C
  230   DELT = 0.
        DO 240 I=1,NDIM
        ARC - ABS(AUX(4,I) + Yd))
        IFCARG -EQ. 0.) arg = .25*ABS(AUX(4,I))
c--- if the next statement is true, aux(4,i)=y(i)=0.0;  rer=0.
        IFCARG .EQ. 0.) ARG - ERRSET
        RER - AUX(8,I)*ABS(AUX(4,I) • Y(I))/ARG
  240   DELT = cMAX1(DELT,RER)
        IF(DELT-PRHT(4» 280,280,250
C
C*** ERROR IS TOO GREAT
C
  250   if(abs(h) .It. stpmin) goto 360
        DO 270 I=1,NDIM
  270   AUX(4,I)=AUX(5,I)
C       URITE(5,1200) DELT
C 1200  FORMATC 7RKGST? -- ERROR TOO GREAT1 ,G13.5)
        ISTEP*ISTEP*ISTEP-4
        X=X-H
        IEND=0
        GOTO 180
C
C*** RESULT VALUES ARE GOOD
C
  280   CALL FCT(X,Y,DERY,PRMT)
        DO 290  I=1,NDIM
        AUX(1,I)=Y(I)
        AUX(2,I)=DERY(I)
        AUX(3,n=AUX(6,I)
        Y(I)=AUX(5,I)
   290   DERY(I)=AUX(7,I)
        CALL  FCT(X-H,Y,DERY,PRMT)
        CALL OUTP(X-H,Y,DERY,IHLF,NDIM,PRMT>
         IF(PRMT(5))400,300,400
   300   DO 310 I=1,NDIM
        Y(I)=AUX(1,I)
   310   DERY(I)-AUX(2,I)
         IREC=IHLF
         IF(IEND) 320,320,390
 C
 C*** INCREMENT GETS DOUBLED TO KEEP UP WITH HALF STEPPING
 C
   320   IHLF*IHLF-1
         ISTEP=ISTEP/2
         H=H+H
 C
 C*** ALLOW THE PROGRAM TO EXPAND BEYOND ORIGINAL STEP SIZE SPECIFICATION
 C*** UP TO THE MAXIMUM
 C

 7 -- sys$degadis:rkgst.for                     6-SEP-1989 17:24:29

-------
                                       D-121

          IF(absCh).ge.stpmax)  goto 40
  C
  C*** EXPAND  H  DUE  TO LOW ERROR  VALUE after Press et al.  Since a  'new1
  c       step size  is being  chosen,  reset  IHLF and  ISTEP to starting values.
  c       STPMIN will  still stop  simulations which bisect the original  interval
  c       more than  10 times.
  C
          ifCdelt.ne.  O.DO) then
            trial «  .900 *  abs(h) * (abs(prmt(4)/delt)) ** .2500
          else
            trial = 10.00 *  abs(h)
          endif
  c       if(trial  .ge.  abs(h)) then
            h = sign( min(trial,  stpmax),  h)
            IHLF=-1
            ISTEP=0
  c       endif
          GOTO 40
  C
  C*** RETURNS TO CALLING PROGRAM
  C
    360   IHLF=11
          CALL FCT(X,Y,DERY,PRMT)
          GOTO 390
    370   IHLF=12
          GOTO 390
    380   IHLF=13
    390   CALL FCT(X,Y,DERY,PRMT)
          CALL OUTP(X,Y,DERY,IHLF,NDIM.PRMT)
    400   RETURN
          END
####
  8 -- sys$degadis:rkgst.for                     6-SEP-1989 17:24:29

-------
                                      D-122

        PROGRAM SDEGADIS2
c
(;****»**»*»****«*»*****»****«**********»*•*»***»«***************************
C***************************************************************************
Q«*********»*****»************«*»**«»*»»«»«****«*****«***«*«*****«**»»******
C
C       Program description:
C
C       SDEGADIS2 is a simplification of DEGADIS2 which performs the downwind
C       dispersion portion of the calculation for a steady state source
C       described by DEGADIS1.
C
C
C       Program usage:
C
C       Consult Volume III of the Final Report to U. S. Coast Guard
C       contract DT-CG-23-80-C-20029 entitled "Development of an
C       Atmospheric Dispersion Model for Heavier-than-Air Gas Mixtures".
C
C       J. A.  Havens
C       T. 0.  Spicer
C
C       University of Arkansas
C       Department of Chemical Engineering
C       Fayetteville, AR  72701
C
C       April  1985
C
C
C       This project was  sponsored by the U. S. Coast Guard and the Gas
C       Research  Institute under contract DT-CG-23-80-C-20029.
C
C
C       Disclaimer:
C
C       This computer code material was prepared by the University of
C       Arkansas  as an account of work sponsored by the U. S. Coast Guard
C       and  the Gas Research  Institute.  Neither the University of Arkansas,
C       nor  any person acting on  its behalf:
C
C       a.   Makes any warranty or representation,  express or  implied,
C            with  respect to the accuracy, completeness, or usefulness
C            of the  information contained  in this computer code material,
C            or that  the  use of any  apparatus, method,  numerical model,
 C            or process disclosed  in this  computer  code material may not
 C            infringe privately owned rights;  or
 C
 C        b.   Assumes any liability with  respect  to  the use of, or  for
 C            damages resulting from the  use of,  any information,
 C           apparatus,  method,  or process disclosed in this  computer
 C           code material.

 1  •- sys$degadis:sdegadis2.for                 6-SEP-1989 17:43:57

-------
                                      D-123

C
C
Q*»***************»*******»*«**********»***********«************************
Q*******«»*»**»**********************»***»»***»**********«********«***«»**»*
£**********»******«***********»*******************************************»*
C

        Implicit Real*8 ( A-H, 0-Z ), Integer*4 ( 1-N )

        include 'sys$degadis:DEGADIS2.dec-
        include '(Sssdef)1
C
        EXTERNAL PSS,PSSOUT,SSG,SSGOUT
C
        COMMON
     S/TITL/ TITLE
     S/GEN2/ DEN(5,igen)
     S/PARM/ UO,ZO,ZR,ML,USTAR,K,G,RHOEfRHOA,DELTA,BETAfGAMMAF,CcLOU
     $/com_gprop/ gas_mw,gas_temp,gas_rhoe,gas_cpk,gas_cpp,
     $ gas_ufl,gas_lfl,gas_zsp,gas_name
     S/ITI/ T1,TINP,TSRC,TOBS
     $/comatm/  istab,tamb,pamb,humid,isofl.tsurf,ihtfl,htco,iwtfl.wtco,
     $ humsrc
     S/ERROR/ SYOER,ERRP,SMXP,WTSZP.UTSYP,UTBEP,WTDH,ERRG,SMXG,
     S WTRUH,UTDHG
     S/STP/ STPP.OTLP.ODLLP.STPG.ODLG.XLLG
     $/com_ss/  ESS,SLEW,SUID,OUTCc,OUTSZ,OUTB,OUTL,swcl,swal,senl,srhl
     S/PHLAG/ CHEOC1,CHECKS,AGAIN,CHECK3,CHECK4,CHECKS
     $/com_fl/  cflag.clfl.cufl
     S/NEND/ POUNDN,POUND
     S/ALP/ ALPHA,alphal
     $/phicom/  iphifl,dellay
     S/sprd_con/ ce, delrhomin
     $/COM_SURF/ HTCUT
     ./oomsin/  oodist,avtime
C
C
C       DIMENSIONS/DECLARATIONS
C
        logical cflag

        real*4  tt1
        REAL*8  K.ML.L
        LOGICAL CHECK1.CHECK2,AGAIN,CHECKS.CHECK4,CHECKS
c
        character*24 tinp,tsrc,tobs
        character*80 title(4)
        character*4 pound
        character*? gas_name
C
        character*4 TR2,ER2,Sr3,SSD,TR3

2  •- sys$degadis:sdegadis2.for                 6-SEP-1989 17:43:57

-------
                                      D-124
        character*40 opnrupl
        character opnrup(40)
        EQUIVALENCE (OPNRUPd),opnrupl)
c
        dimension prmt(22),y(6),dery(6),aux(8,6)
C
C	
c
C       DATA
C
        DATA POUND/'//  '/.POUNDN/-1.D-20/
C
        DATA TIMEO/O./.NDIM/O/
C
        DATA TR2/I.TR2'/.ER2/I.ER2V
        DATA Sr3/'.Sr3'/
        DATA SSD/'.SSD'/.TRS/'.TRS1/
C
C
c	
c
C       MAIN
C
        T1  = SECNDS(0.)
        istat  = lib$date_time(TOBS)
        ifd'stat .ne.  ss$_normal)  stop1 tibSdate_time failure1
C
C*** GET  THE  FILE NAME FOR FILE  CONTROL
C
        read(5,1135) nchar.opnrup
  1135  format(q,40a1)
 C
        opnrupl * opnrup1(1:nchar) // ER2(1:4)
        CALL ESTRT2ss(OPNRUP1)
 C
 C*** GET  THE  COMMON VARIABLES  CARRIED FROM DEGAOIS1
 C
        opnrupl = opnrup1(1:nchar) // tr2(1:4)
        CALL  STRT2(OPNRUP1,H_masrte,CCP}
 C
        opnrupl = opnrup1(1:nchar) // sr3(1:4)
        OPEN(UNIT=8.TYPE='NEV,NAME=OPNRUP1.
      $ CARRIAGECONTROL='FORTRAN')
 c
        cflag  = isofl.eq. 1.or.  ihtfl.eq. 0
 C
        URITE(8,1119)
         if(cflag) then
                 WRITE(8,1116)  gas_zsp,(100.*gas_lfl),(100.*gas_ufl)
                 UR!TE(8,1118)

 3 -- sys$degadis:sdegadis2.for                 6-SEP-1989 17:43:57

-------
                                      D-125

        else
                WRITE(8.1115) g8S_zsp,(100.*gas_lfl),(100.*gas_ufl)
                WRITE(8,1117)
                endif
        WRITE(8,1119)
c
C
C
 1115   FORMAWHO,1X, 'Distance', 2x,3x, 'Mole1, 3x,
        1       'Concentration1, 1x, 'Density1, 2x,3x, 'Gamma' ,4x,
        1       'Temperature' ,3x, 'Half ,4x,4x, 'Sz' ,5x,4x. 'Sy1 ,5x,
        1       'Width at z=',0pf6.2,' m to:',/, 1x,11x,1x'Fraction',2x,
        1       11x,11x,11x,11x,3x, 'Width', 3x,11x,9x,
        1       2(1pg9.3f'moleX',1x»
 1116   FORMAT(1HO,1X, 'Distance1, 2x,3x, 'Mole', 3x,
        1       'Concentration', 1x, 'Density1, 2x,
        1       'Temperature', 3x, 'Half, 4x,4x,'Sz',5x,4x,'Sy',5x,
        1       'Width at z=',0pf6.2,' m to:',/,1x,11x,1x'Fraction',2x,
        1       11x,11x,11x,3x, 'Width', 3x,11x,9x,
        1       2(1pg9.3,'mole%',1x))
 1117   FORMAK1H ,4X, '(m)',4x,11x,
        1       2(1X,'(kg/m**3)'.1x),12x,4x,'(K)',
        1       5{8X,'(ra)'»
 1118   FORMATdH ,4X, '(m)',4x,11x,
        1       2(1X,'(kg/m**3)l,1x).4x, '(1C)',
  1119    FORMATdH  )
C
C
C
C [[[
c
C       STEADY  STATE CALCULATIONS
C
C
         opnrupl  =  opnrup1(1:nchar) // ssd(1:4)
c       OPEN
-------
                                      D-126

        rho = srhl
        tf(cc.gt.  ccp) then
                write(lunlog,1126)  cc.ccp
 1126           formate/,'  ', 10C****1),/,'  cc:  '.1pg13.5,'  is  greater1,
        1         '  than ccp:  ',1pg13.5,/,'  ',IOC'****'),/>
                cc *ccp
                endif
C
        ratio1= uO*zO/alphaV zO**alpha1  *  cc  /b/qstrO/l
        ratio = ratiol* szO**alpha1 * (B  +  sqrtpi/2.DO*syOer>
        if(ratio.It.  1.DO)  then
                syOer = (1.DO/(RATI01*szO**alpha1)  -  b)*2.DO/sqrtpi
        else
                szO * (1.DO/CCB+ sqrtpi/2.DO*syOer)*r8tio1))**(1.DO/alpha1)
        endif

        humsrc = (1.DO-wc-wa*C1.DO+humid))/wc
        call setden(uc,wa,enth)

        if(cflag) then
                call adiabat(2,tuc>twalgas_lfl,ya,clfl,r,u,t,tt)
                call adiabatC2,twc,tMa,gas_ufl,ya,cufl,r,w,t,tt)
                endif
        cclay = cc/dellay
        call adiabat(0,wclay,walay,yclay.yalay,cclay,rholay,w,enthlay,t)
c
C
C***  let everyone know
C
        URITE(lunlog,1170) L,B
        WRITE(lunlog,1180) QSTRO.SZO
        urite(lunlog,1185) wclay,walay,rholay,cclay,t
        write(lunlog,1186) wc.wa,rho,cc
c
 1170  FORMATC LENGTH:  'f1pG13.5,' BEFF:  ',1pG13.5)
 1180  FORMATC TAKEUP  FLUX:  ',1pGl3.5,' SZO:  MpG13.5)
 1185  formate we I ay:  ',1pg12.S,' walay:  ',1pg12.5,
        1        '  rholay:  ',1pg12.5,'  Cclay:  ',1pg12.5,/,
        1        '  temlay:  ',1pg13.5)
 1186  formate we:  ',1pg12.5,'   wa:  ',1pg13.5./,
        1        '  rho:  ',1pg12.5f'  Cc: ',1pg12.5>
C
C*** PREPARE FOR STEADY  STATE  INTEGRATION.
C
        PRMTC1) -  L/2.DO
        PRMT(2) =  6.023D13
        PRMT(3) =  STPP

5  --  sys$degadis:sdegadis2.for                 6-SEP-1989  17:43:57

-------
                                      D-127

        PRMT<4) = ERRP
        PRMT<5) - SMXP
        PRMT(6) = Erate
        PRMT(7) = Cc    !  OUTPUT
        PRMT(8) - B     !  OUTPUT
C
C*** PRMT(9) & PRMTdO) ARE CONSTANTS FOR D(SY) & D(SZ)
C
        PRMT(9> = Ce*sqrt(G*ZO/ALPHA1*GAMMAF) *GAMMAF/UO
        PRMT{10)= ZO**ALPHA*K*USTAR*ALPHA1 * ALPHA1/UO
C       PRMT(11)= NREC
C       PRMT(12)=
C       PRMTd3)=
        prmt(18)= uO*zO/alpha1
        prmtd9)= rhoa*k*ustar*alpha1
        prmt(20)* rholay
        prmt<21)s szO
        prmt(22)B szO
               rholay*prmtd8)*CSZO/zO)**alpha1  !  rholay*ueff*heff
        Y{2) * SYOER*syOer
        Y(3) = B + sqrtpi/2.DO*syO«r
        Y(4) = 0.                       !  added  heat
        Y(5) = 0.                       !  mass above UFL
        Y(6) * 0.                       !  mass above LFL
C
        DERYd) = WTSZP
        DERY<2) - WTSYP
        DERY(3) B WTBEP
        dery(4) = utdh
        dery<5) = 1.DO
        dery(6) = 1.DO
C
c       NDIM s 4
        ndim=6          ! to integrate the mass  above LFL and UFL
C
        URITE(lunlog,1130)
 1130   FORNATC  Entering Integration Step -- B > 0. ')
C
C*** PERFORM INTEGRATION
C
        CALL RKGST(PRMT,Y,DERY,NDIM,IHLF,PSS,PSSOUT,AUX)
C
        IF(IHLF  .GE. 10) CALL trap(9,IHLF)
C
        NREC =  INT(PRHT(11))
        WRITE(lunlog,1100)NREC
 1100   FORMAT(3X, 'NUMBER OF RECORDS IN PSS = -110)
C
        IF(AGAIN) THEN
                Y(3) = Y(5)             ! mass above UFL

6  •- sys$degadis:sdegadis2.for                 6-SEP-1989 17:43:57

-------
                                      IT-128

                Y(4) = Y(6)             !  mass above LFL
                GO TO 120
                END IF
C
C**» GAUSIAN COMPLETION OF THE INTEGRATION
C
C*** PSSOUT FORCES THE ABOVE INTEGRATION TO FINISH WHEN B<0 FOR THE
C***  FIRST TIME. THE STEP BEFORE THIS OCCURS IS RECORDED ON UNIT 7.
C***  THE STEP WHEN B GOES NEGATIVE IS CURRENTLY IN Y.
C
C*** THE CALCULATION METHOD CHANGES THE CURRENT VALUE OF SY TO A VALUE
C***  CALCULATED AS IF BEFF*SY RETAINING THE LAST VALUE OF Cc IN THE
C***  MATERIAL BALANCE.
C
        heat * Y<4)
        rholay * prmt(20)
        Cc = PRMT(7)
        rhouh = Y<1)
        SZ » ( rhouh/rholay/prmtdS) )**(1.DO/atpha1) * zO
        SYT = Erate*ALPHA1 * 6.023D23
PRMT(3) = STPG
PRMT(4) = ERRG
PRMT(S) = SMXG
PRMT(6) = Erate
PRMT(7) « Cc
PRMT(8) - XV
PRMT(9) = "BLANK"
PRMT(10)= "BLANK"
PRMTdD* "BLANK"
PRMT(12)= DIST AT







!-• OUTPUT




COMPLETION •- OUTPUT

         prmt(18) = uO*zO/alpha1
         pmrt(19) = rhoa*k*ustar*alpha1
         prmt(20) = rholay
         prmt(21) = sz
         prmt(22) = sz
 c
         Y(1) = rhouh
         Y(2) = heat

 7 -- sys$degadis:sdegadis2.for                 6-SEP-1989 17:43:57

-------
                                      D-129

        Y(3) = Y(5)             !  mass above UFL
        Y(4) = Y(6)             !  mass above LFL
C
        DERYO) - wtruh
        dery(2) = wtdhg
        dery(3) = 1.DO
        dery(4) = 1.DO
C
c NDIM = 2
        ndim=4          !  to integrate the mass above LFL and UFL
C
        URITE(lunlog,1140)
 1140   FORMATC Entering Gaussian Stage of Integration ')
C
C*** PERFORM  INTEGRATION
C
        CALL  RKGST(PRMT,Y,DERY,NDIM,IHLF,SSG,SSGOUT,AUX)
C
        IFdHLF  .GE. 10) CALL trap(10,IHLF)
C
        NREC  -  INTCPRMT(ID)
C
  120   CONTINUE
c
c*** summarize  the  information about  the mass above the LFL,UFL
c
        write(8,8000)  100.*gas_ufI,100.*gas_lfl,Y(4)-Y(3),Y(4)
 8000   formate//,' For the UFL of ',1pg13.5,' mole percent, and1,
     $' the LFL  of  ',1pg13.5,' mole percent:1,
     $//,'  The mass of contaminant between  the UFL and LFL is:1
     $,1pg13.5,' kg.1,/,1 The mass of contaminant above the LFL is:
     $1pg13.5,'  kg.')
C
C
C	
c
c       CLOSE(UNIT«9)
        CLOSE(UNIT=8)
C
        opnrupl  = opnrup1(1:nchar) // tr3(1:4)
        CALL  TRANS(OPNRUP1)
C
        tt1 = t1
        T1  =  SECNDS(tT1)/60.
        WRITE(lunlog,4000) TOBS
        WRITE(lunlog,4010) T1
 4000   FORMAT(//,'SOEGADIS2 -->',//,3X,'BEGAN AT ',A40)
 4010   FORMATC3X,'*** ELAPSED TIME ***  ',1pG13.5,' min')
C
        STOP
        END

8 -- sys$degadis:sdegadis2.for                 6-SEP-1989 17:43:57

-------
                                  D-130

        function series(arg)
c
c*** This function estimates  the infinite series used in the evaluation
c**»  of t(,e mass above a certain concentration level.
c
c********»*******«*****************»*****«******************«**«*******
c
c*** WARNING: This routine will overflow for arguments  greater than 13.8
c
        implicit real*8  (a-h,o-z), integer** (i-n)
c
        parameter (kmax= 100, error-1.d-4)
c
        common/alp/ alpha, alphal
c
c*** initialize some variables
c
        pp = 1.DO/alpha1
        pprod * pp      !  for p*(p+1)*...*(p+k)
c
c*** calculate the first term
c
        coef = 2.00/3. DO
        series » coef / pp * arg**1.500
        old = series
c
c
        do 200 kk=1,kmax
        pou = DBLE(kk) +  1.5DO
        plus = DBLE(kk+1)

        pprod =  (pp + DBLE(kk)) *  pprod
        coef = 2.00 * plus*«2 / DBLE(2*kk + 3)/ plus * coef

        series = series + coef  / pprod * arg**pou

        denom &  dmaxK  (series+old),  error)
         if(  abs(series-old)/denom  . le. error)  return

        old  s series
   200  continue
 c
         write(6,900)  arg
  900    formate SERIES?  Number of iterations  too  small  for  argument:  ',
      $ 1pg13.5)
         call  exit
         end
 1 •• sys$degadis:series.for                    6-SEP-1989 17:47:28

-------
                                   D-131

c	
c
C       TIME SORT SUPERVISOR
C
        SUBROUTINE SORTS(TABLE)

        Implicit Real*8 ( A-H, 0-Z ), Integer*4 ( I-N )
        include 'sys$degadis:DEGADIS3.dec/Iist1
C
        COMMON
     S/SORT/ TCc(maxnob,maxnt).TCcSTR(maxnob,maxnt),
     S  Tyc(maxnob,maxnt),Trho(maxnob,maxnt),
     $  Tgarama(maxr>ob,maxnt),Ttemp(maxnob,maxnt>,
     $   TSY(maxnob,maxnt),TSZCmaxnob,maxnt),TB(maxnob,maxnt),
     S   TDISTO(maxnob,maxnt),TDIST(maxnobfmaxnt)lKSUB(maxnt)
     S/SSCON/ NREC(maxnob,2),TO(maxnob),XV(maxnob)
     S/SORTIN/ TIM(maxnt).NTIM.ISTRT
     S/PARM/ UO.ZO.ZR,ML,USTAR,K,G,RHOE,RHOA,DELTA,BETA,GAMMAF.CcLOW
     S/CNOBS/ NOBS
C
        DIMENSION TABLE(1)
C
        REAL*8 ML,K
C
        CALL GETTIM
C
C
C*** TABLE(I) VALUES
c***
c***
c***
£***
c***
c***
c***
c***
c***
c***
c***
c***
c
c***
c***
c

c

c
I
--
1 11
2 12
3 13
4 14
5 15
6 16
7 17
8 18
9 19
10 20

21
22

DO 100

IT = 0

PARAMETER

DIST
Yc
Cc
rho
gamma
temp
SZ
SY
B
TS

DISTO
INTERPOLATION

I - 1.NOBS





1 TO 1C

11 TO i









FRACTION





         DO 105 J=1,20

      sysSdegadis:sorts.for                     6-SEP-1989  17:47:52

-------
                                  D-132

  105   TABLE(J) = 0.
C
        II - NRECd.1)

        if( ii .eq. 0) goto 130
c
c*** read first record
c
        reed<9,*) ,IC1=1,9)
        TABLEdO) = TS( TO(I), TABLEd) )
C
        itl =  int( (tabledO)-timd)) / (tim(2)-timd» + 0.9999999 )
        itl =  min( ntiro, itl)
        itf =  int( (table(20)-tim<1)) / (tim(2)-tim(1)) + 0.9999999 )
        itf =  max( 1,  itf)

        do  it  =  itf,  itl, 1             ! do all points in range
C
C***  RECORD AN INTERPOLATED TIME SORTED POINT.
C
        KSUB(IT) * KSUB(IT) +  1
C
        TABLE(22) = (TIH(IT) - TABLE(20))/(TABLEdO) • TABLEC20))
C
        TDISTO(I.IT)  = TABLE(21)
        TDISTU.IT)   = TABLEdD +  (TABLEd) - TABLEd 1)) * TABLEC22)
        Tyc
-------
                                  D-133

C
  130   II = NREC(I,2)
        IFCII .EQ. 0) GO TO 100

        DO 200 J=1,ll
C
                DO K1 = 1,10
                KK = K1 + 10
                TABLE(KK) = TABLE(K1)
                enddo
C
        READ<9,*)  + 0.9999999 )
        itf  = max( 1,  itf)

        do  it =  itf,  itl, 1             ! do all points in range
C
C***  RECORD  A TIME SORTED VALUE
C
        KSUBUT) * KSUB(IT) +  1
        TABLE(22) =  (TIM(IT) - TABLE(20»/(TABLE(10) - TABLE(20))
C
        TDISTO(I.IT)  = TABLE(21)
        TDIST(I,IT)   = TABLE(H) +  (TABLEd) - TABLE(H)) * TABLEC22)
        Tyc(I.IT)     = TABUEC12) +  (TABLEC2) - TABLE(12)) * TABLEC22)
        TCc(I.IT)     = TABLE(13) +  (TABLE(3) - TABLEC13)) * TABLEC22)
        Trho(I.IT)    = TABLE(U) +  (TABLE(4) - TABLE(U)) * TABLEC22)
        Tgammad.IT)  = TABLEC15) +  (TABLE(S) • TABLE(15)) * TABLE(22)
        Ttemp(I,IT)   = TABLE(16) +  (TABLEC6) - TABLE(16)) * TABLEC22)
        TSZ(I.IT)     = TABLE(17) +  (TABLE<7) - TABLE(U)) * TABLEC22)
        TSYd.IT)     = TABLE(18) +  (TABLEC8) - TABLEC18)) * TABLEC22)
        TBd.IT)      = TABLEC19) +  (TABLE(9) - TABLE<19)) * TABLE(22)
C
        enddo
  200  CONTINUE
C
  100 CONTINUE
C
        CALL SORTS1(TABLE)
C
        RETURN
        END
 3 --  sysSdegadis:sorts.for                     6-SEP-1989 17:47:52

-------
                                   D-134

c	
c
c
        SUBROUTINE SORTS1(TABLE)

        Implicit Real*8 ( A-H, 0-2 ), Integer*^ ( I-N )
        include 'sys$degadis:DEGADIS3.dec/list'
C
        COMMON
     S/SORT/ TCc(maxnob,maxnt),TCcSTR(maxnob,maxnt),
     $  Tyc(maxnob,maxnt),Trho(maxr>ob/maxnt),
     $  Tgamma(maxnob,maxnt),Ttemp(maxr>ob,maxnO,
     $  TSY(maxnob,maxnt),TSZ(maxnob,maxnt),TB(maxnob,maxnt),
     $  TDISTO(maxnob,maxnt)rTDIST(m8xnob,maxnt),KSUB(inaxnt)
     S/SSCON/ NREC(maxnob,2),TO(maxnob),XV(maxnob)
     S/SORTIN/ TIM(maxnt),NTIM,ISTRT
     S/PARM/ UO,ZO,ZR,ML,USTAR,IC,G,RHOE,RHOA,DELTA,BETA,GAMMAF.CcLOW
     $/com_gprop/ gas_mu,gas_temp,gas_rhoe,gas_cpk,gas_cpp,
     $  gas_ufl,gas_lfl.gas_zsp,gas_name
     S/comatm/  istab, tacnb,pamb,humid,isofI,tsurf,ihtfI,htco,iwtfI,wtco,
     $  humsrc
     S/PARMSC/RM,SZM,EMAX,RMAX,TSC1,ALEPH,TEND
     S/com_sigx/  sigx_coeff,sigx_pow>sigx_min_dist,sigx_flag
     S/ALP/ ALPHA.alphal
     S/CN08S/NOBS
 C
         DIMENSION TABLE(1)
 C
         REAL*8 ML, 1C
         logical  cflag
 C
 C*** DETERMINE IF ANY TIME  VECTORS HAVE NO ENTRIES
 C
         DO 192 I'l.NTIM
   192   IF
-------
                                  D-135
£***
C***
£***
C***
C***
C

C


C
C

170
180
C

C










C
190
C

C










C
210
200
c
c
distances will decrease instead of increase. So, we
reverse each of the columns so that the downwind dist
increase as you move down the column. At the same ti
ensure that all of the nonzero entries in a column ar
the top of the column.

DO 200 K1 = ISTRT.NTIH

II * KSUB(K1)
DO 170 J = 1.NOBS

IF

CONTINUE

DO 210 J = 1,11

TCc(J,K1) = TABLE(J)
Tyc(J,K1) = TABLECJ + NOBS)
Trho(J,K1) = TABLE (J + 2*NOBS)
Tgamna(J,K1) = TABLEU + 3*NOBS)
Ttemp(J,K1) = TABLE(J + 4*NOBS)
TSY(J,K1) = TABLECJ + 5*NOBS)
TSZ(J,K1) = TABLE (J + 6*NOBS)
TB(J,K1) = TABLE(J + 7*NOBS)
TDISTO(J,K1) = TABLECJ + 8*NOBS)
TDIST(J,K1) = TABLECJ + 9*NOBS)

CONTINUE
CONTINUE


        if(sigx_flag.eq. 0.) then               !  no correction




                writedunlog,*) ' No X-direction dispersion correction1
2 -- sys$degadis:sorts1.for
6-SEP-1989 17:49:10

-------
                                  D-136

                DO 220 K1 = ISTRT.NTIM
                II = KSUB(K1)
                DO 220 I * 1,11
                TCcSTR(I,K1) - TCc(i.kl)
  220           CONTINUE
                goto 400
                endif
C
C*** GENERATE TCcSTR -- CENTER LINE  CONCENTRATION CORRECTED  FOR
C***  DOWNWIND DISPERSION.
C
        DO 230 K1 - ISTRT.NTIM
C
        II - KSUB(K1)
        DO 240 I = 1,11
C
c calculation for XP = TDIST(I,K1)
c
        TCcSTRU.KI) » 0.
C
        DO 260 J = 1,11
C
        TABLE(J) * 0.
        DIST = TDIST(J.KI)  - TdistO(J,K1)
        deltax = ABS(tdist(i,k1) - tdist(j,k1)>
c
        if(dist.lt. sigx_min_dist) then
                 ifd'.eq.  j)  then        ! i.e. deltax = 0.
                         table(j) = = (tdist(2,k1>- tdist(1,k1))/2.
                         if(j.eq. ii)table
-------
                                  D-137

c
        DO 280 J = 2,111
C
        TCcSTR(I,K1) = TABLE(J)* (TDIST(J+1,K1)- TDIST(J-1,K1)>/2.
        1                                       +  TCcSTRCI.KD
C
  280   CONTINUE
c
        TCcSTRd.KD = TCcSTR(I,K1)/RT2/SORTPI
c
c*** correct ye, rho, and temp values
c
                cc = Tccstr(i,k1)
        ifO'sofl.eq. 1 .or. ihtfl.eq. 0) then
                call adiabat(0(uc,wa,yc(ya,cc(rho,wm.enth,temp)
        else
                enth = TgammaCi,K1>
                calI adiabate -1,wc,wa,yc,ya,cc,rho,urn,enth,temp)
        endif
        Tyc = yc
        Trho(i,K1)= rho
C
  240   CONTINUE
C
  230   CONTINUE
C
C
C*** Estimate the mass between the UFL and LFL
C
 400    continue
c
        cflag = isofl.eq.1 .or.  ihtfl.eq.0
        if(cflag) then
           call adiabat(2,aa,dd,gas_ufl,ee,chi  ,99,hh,pp,oo)
           call adiabat(2taa,dd,gas_lfl,ee,clow,gg,hh,pp,oo)
        endif
c
        DO 430 K1 =  1STRT.NTIM
        kk  = k1+2*roaxnob
        kk1 = k1+3*maxnob
        table(kk) =  0.
        table(kk1)«  0.
C
         II = KSUB(K1)
        DO 460  J =  1,11  !  evaluate the  function at each point  in  space
C
c   initialize some values
c
        TABLE(J) = 0.
        jj = j+maxnob
        TABLE(JJ) =  0.

4  -• sys$degadis:sorts1.for                     6-SEP-1989 17:49:10

-------
                                  D-138

        cc = TCcstr(j,k1)
        bb = tb(j,k1>
        sy = tsy(j,k1)
        sz = tsz(j,k1)
        gamna - tgamma(j,k1)

        if(.not.cflag)  then
           call adiabat(-2,aa,dd,gas_ufl,ee,chi  ,gg,hh,gamma,oo)
           call adiabat(-2,aa,dd,gas_lfl,ee,clow,gg,hh,gainna,oo)
        endif
c
c*** Calculate the derivative for the total mass above the UFL and LFL
c
                gamhi   = 2.00* Cc * Bb * Sz / alphal
        gammax « 2.DO *Cc *Sz *GAMMAF /alphal *(Bb +sqrtpi/2.DO *Sy)

          if(cc.gt.clow) then
                wlow * DlogCcc/clow)
                gamlow = gaminc(1.DO/alpha1, wlou ) * gamhi
                table(j)= gamlow + 2.DO*clow*Sy*Sz/alpha1*series(wlow)
                table(j)- DMINK table(j), gamnax )
          endif

          if(cc.gt.chi) then
                whi  * Dlog(cc/chi )
                gamhi   = garninc(1.DO/alpha1, whi  ) * gamhi
                table(jj) « gamhi* 2.DO*chi *Sy*Sz/alpha1*series(whi)
                table(jj)* DMINK table(jj), gammax )
          endif
c
 460    continue
c
c*** now, finish the integration
c
        DO 450 J * 2,11         I integrate  in space at one value of time
        xx =  (tdist
        arglow * (table(j) + table(j-1))/2.
        arghi  = (table(j-Hnaxnob) +  table(j-1+maxnob))/2.
        table(kk)  = arghi *xx +  table(kk)
        table(kkl) « arglow*xx +  table(kkl)
 450    continue
c
 430    continue
C
        RETURN
        END
 5 -- sysSdegadis:sortsl.for                    6-SEP-1989 17:49:10

-------
                                  D-139

C       SOURCE EQUATIONS ••  Gas Blanket present

        SUBROUTINE SRC1(time,Y,D,PRMT)


        Implicit Real*8 ( A-H, 0-Z ), Integer** ( I-N )

        include 'sys$degadis:DEGADIS1.dec'

        parameter(      delt= 0.1DO,
        1               delto2= delt/2.DO,
        2               zero= 1.D-10,
        3               rcrit= 0.002DO)

        COMMON
     S/GEN1/ PTIME(igen), ET(igen), R1T(igen), PUC(igen). PTEMP(igen),
     $     •  PFRACV(igen), PENTH(igen), PRHO(igen)
     $/ERRCMJ/STPINfERBND,STPMX,tfTRG.WTtm,WTya,wtyc,Hteb,wtmb,wtUH,XLI,
     $ XRI,EPS,ZLOW,STPINZ,ERBNDZ,STPMXZ,SRCOER,srcss,srccut,
     S htcut,ERNOBl,NOBLpt,crfger,epsilon
     S/PARM/ UO.ZO.ZR,ML,USTAR.K.G.RHOE.RHOA,DELTA,BETA.GAMMAF.CcLOW
     S/PARMSC/ RM,SZM,EMAX,RMAX,TSC1,ALEPH,TEND
     S/comatm/ istab,tamb.pamb,humid,isofl,tsurf,ihtfl,htco,iwtfl,wtco,
     $ humsre
     S/PHLAG/ CHECK1, CHECK2, AGAIN. CHECKS, CHECIC4, CHECKS
     S/vucom/ vua,vub,vue,vud,vudelta,vuflag
     $/com_enthal/ h_masrte,h_airrte,h_watrte
     S/ALP/ ALPHA,alphal
     S/phicom/ iphifl.dellay
     $/sprd_con/  ce, delrhomin

        LOGICAL CHECK1,CHECK2,AGAIN.CHECK3,CHECK4,CHECKS
        logical vuflag

        REAL*8 ML,K
        REAL*8 L.masrte.mole
        INTEGER R,mass,massc,massa,ebal,mbal
        DIMENSION Y(7).D(7),PRMT(25)
        DATA  R/1/,mass/2/,massc/3/,massa/4/,ebaI/5/,mbaI/6/


        if( prmt(20).lt.  O.DO) vuflag = .false.

        if(Y(mass)  .le. O.DO)  then
                we = dmax1(prmt(15),1.d-10)
                 if(wc.gt.  1.)  wc=1.d-10
                wa 3 1.DO  - we
                enthalpy  =  wc*h_masrte          !  air  contributes nothing
        else
                MC = Y(massc)/Y(mass>
                wa = Y(massa)/Y(mass)

 1  --  sys$degadis:src1.for                     6-SEP-1989 17:51:20

-------
                                 D-140

                enthalpy = Y(ebal)/Y(mass)
        end if
        humsrc = (1.DO  -  we  •  wa*(1.DO+humid))/wc
        calI  tprop(1,uc,ua,enthalpy,yc.ya,mole,temp,rho,cp)

        RADP  = AFGEN2(PTIME,R1TfTIME,'R1TSRC')
        hei    = dmaxK  Y(mass)/pi/Y(r)/Y(r)/rho  , O.ODO  )
        delrho =Tho-rhoa
        if(delrho .It.  O.DO) delrho * O.DO
        gprime = g*delrho/rhoa *hei

C*** CALCULATE D(R),airrte,vel

        D(R)  = O.DO
        vel = O.DO
        airrte = O.DO
        Ri * O.DO
        D(mbal)  = O.DO

        IFCGprime.GT. O.DO) then
           slump = Ce*sqrt(Gprime)

           if(vuflag) then              !  momentum balance
                iii * 0         !  initialize loop counter
                vel - prmt(14)          !  old velocity value
                velmin = O.DO
                velmax= dmaxU slump, 0.1DO, vel)

 100            hh * vel*vel/Ce/Ce/g/ (delrho/rhoa)
                rh » Y(r)-vua*vub*hh
                value = Y(r)**2/rh**2

                   if(pnnt(25).ge. prmt(24)) then       ! hh .ge. ht

                ht » 2.DO*(value*hei  - vua*hh*Cvalue-1.DO)) • hh
                velc = Y(mbal)/(0.4DO*pi*rho*(2.DO/3.DO*ht + hh)*rh**3/YCr>
        1          + 2.DO/3.DO*pi*vua*rho*hh* (Y(r)**2 • rh*rh*rh/Y(D)
        2          + vue*pi*Y(r)*hei**2*rhoa)
                D(mbal) = pi*g*delrho*Y(r)*ht**2
        1          - vua*vud*pi*rhoa*Y(r)«hh*vel**2
                   else

                ht = value*hei - vua*hh*(value-1.DO)
                velc * Y(mbal)/(2.DO/3.DO*pi*rho*ht*rh**3/Y(r)
        1          * 2.DO/3.DO*pi*vua*rho*hh* (Y(r)**2 - rh*rh*rh/Y(r))
        2          + vue*pi*Y(r)*hei**2*rhoa)
                D(mbal) = pi*g*delrho*(rh*ht**2 * vua*vub*hh»hh*hh)
        1          - vua*vud*pi*rhoa*Y(r)*hh*vel**2
                   endif
 2 --  sys$degadis:src1.for                      6-SEP-1989 17:51:20

-------
                                 D-141

               dif = abs(vel-velc)             !  convergence check
               sum = abs(vel) + abs(velc) + zero

                  if(dif/sum  .le. rcrit) then
                       vel =  (vel+velc)/2.DO
                       prmt(13) = vel

                           if(vel .gt. O.DO) then
                               Ri = gprime / vel**2
               airrte= 2.*pi« epsilon/Ri *rhoa*Y(r)*hei* vel
                               D(r) = vel
                               prmt(20) = slump
                           endif
                   else

                       dif =  vel-velc

                        if(velc.lt.velnrin) velmin= dmaxKvelc, O.DO)
                        if(velc.gt.velmax) velmax=velc

                        if(dif .gt.  O.DO)  then
                           velmax = vel
c                          vel  = 0.5DO*(velmax-velmin)  + velmin
                           vel  = 0.382DO*(velmax-velmin) +  velmin
                        else
                           velmin = velc
c                          vel  = (1.DO-0.5DO)*(velmax-velmin) + velmin
                    vel  * (1.DO-0.382DO)*(velmax-velmin) + velmin
                        endif

                        Hi  = iii+1
                        if(iii .gt.  40)  then
                            vel  = min(velmin,velmax)
                            ifCvel  .gt.  slump)  then
                                vel  =  slump
                                prmt(13) = vel
                                if(vel  .gt.  0.00)  then
                                    Ri  » gprime /  vel**2
                                    airrte= 2.*pi* epsilon/Ri
                                               *rhoa*Y(r)*hei*  vel
                                    D(r) = vel
                                    prmt(20) =  slump
                                endif
                                goto 200
                           endif
                           write(6,*)  'Time, vel,  slump:  ',time,vel,slump
                           write(6,*)  'prmt(14),  velc:  ' ,prmt(H),velc
                           stop'SRd  velocity  loop1
                        endif
                        goto  100
                    endif

3 -- sys$degadis:srd.for                      6-SEP-1989  17:51:20

-------
                                  D-142
            else

                vet= slump      !  gravity slumping
                hh = hei
                ht = hei
                Ri = gprime / vel**2
                airrte= 2.DO*pi* epsilon/Ri  *rhoa*Y then ! delt; nun prob
                        D(R) = dmaxKO.DO,
        1                       (CAFGEN2
-------
                                  D-1A3

        totrteout = qstrll/wc
c
c       surface effects
c
        watrte = O.DO
        surface_q * O.DO
        yw « 1.DO-ya-yc
        yu = min( maxCyw,  O.ODO), 1.0DO)
        calI surface(temp,hei,rho,mole,cp.yw,watrte,surface_q)
        surface_q = area * surface_q
        if(surface_q.lt. O.DO) surface_q • O.DO !  don't let the cloud cool
        watrte = area * watrte
c
 500    totrtein  = airrte + TOTPRT  «• watrte
c
        IF(totrtein.U.totrteout .and. .not.checkZ
        1               ) then  ! checkZ is True for  HSE type spills
                D(R) = 0.
                if(hei.gt.srccut .and. Y(r).gt.srccut) then
                dHdt = (totrtein - totrteout)/3.DO/pi/ Y(r)/Y(r)/rho
                        D the cloud radius. tos;16nov87
                endif
c
c       CALCULATE D(mass),D(massc),D(massa),D(anything  left)
C
        D(mass)  = totrtein  - totrteout
        D(massc) = masrte - qstrll
        D(massa) = (airrte + MASRTE*(1.DO/PWCP - 1.DO))/(1.DO+humid)
     $                                  - wa/wc*qstrll
        D(ebal)  x O.DO
         ifO'htfl.ne. 0)  ! equivalent  to adiabatic mixing from TPROP for ihtfl-0
     $          D(ebal)  = HPRIM*TOTPRT + h_airrte*airrte
     $                  «• h_watrte*watrte - enthalpy*totrteout + surface_q
c
c
                uheff  = qstrmx*L/cc
         sz =  O.DO
         if(uO .ne. O.DO) sz  = ( uheff*alpha1/uO/zO )**(1.DO/alpha1) * zO
c
c
C
         PRMT(6) = QSTRMX
        prmt(7) = sz
         prmt(8) = hei
        prmt(9) = rho

5  -- sys$degadis:src1.for                      6-SEP-1989  17:51:20

-------
                                   D-144

        prmt(10)= Ri
        prmt(11)= yc
        prmt(12)s ya
        prmt(13>= D(r)
        prmt(16) * we
        prmt(17) = wa
        prat(18) = enthalpy
        prat(19) * temp
        prat(21) = masrte
        prat(22) = ht
        prat(23) * hh
        RETURN
        END
c
c
C	
C
C       SUBROUTINE FOR OUTPUT FROM SOURCE in the presence of a  Blanket
C
        SUBROUTINE SRC10(TIME,Y,DERY,IHLF,NDIM,PRMT)

        Implicit Real*8 ( A-H, 0-Z ), Integer*4 ( I-N )

C
        include  'sys$degadis:DEGADIS1.dec'
C
        COMMON
     $/ERROR/STPIN,ERBMD,STPMX,UTRG,WTtm,UTya,utyc,wteb,wtinb,utuh,XLI,
     $ XRI.EPS,ZLOW,STPINZ,ERBNDZ,STPMXZ,SRCOER,srcss,srccut,
     $ htcut,ERNOBL,NOBI.pt,crfger,epsilon
     S/PARM/ UO,ZO,ZR,ML,USTAR,K,G,RHOE,RHOA,DELTA,BETA,GAMMAF.CcLOW
     S/PARMSC/ RM,SZM,EMAX,RMAX.TSC1,ALEPH,TEND
     $/com_ss/ ess,slen,swid,outcc,outsz,outb,oijtl/swcl.,swal,senl,srhl
     S/PHLAG/ CHECK1,CHECK2,AGAIN,CHECK3,CHECK4,CHECKS
     S/ALP/ ALPHA,alphal
C
        LOG ICAL  CHECIC1, CHECK2, AGAIN, CHECKS, CHECK4. CHECKS
C
        DIMENSION Y(6),DERY(6),PRMT(25)
        DIMENSION CURNT(ioot_src),BKSP(iout_src),OUTP(iout_src)
C
        DATA  I/O/,11 I/O/
        DATA  EMAX/0./,tlast/0./
c
        REAL*8  ML.K
         INTEGER R,mass,masse,massa.ebaI
        DATA  R/1/,mass/2/,massc/3/,massa/4/,ebaI/5/
 c
        data  nrecl/0/
 C
         1 = 1+1

 6  -- sys$degadis:srd.for                     6-SEP-1989 17:51:20

-------
                                  D-1A5

        III =111+1
C
        qstr = prmt(6)
        sz = prmt(7)
        hei » prmt(8)
        rho = prmt(9)
        Ri  = prmtdO)
        yc » prmt(ll)
        ya = prmt(12)
        vel - prmt(13)
        prmt(K) = vel
        if(vel .gt. prmt(20)> prmt<20) = -prmt(20)
        prmt(IS) = prmt(16)     ! we
        we = prmt(16)
        cc = MC * rho
        wa = prmt(17)
        enthalpy = print (18)
        temp = prmt<19)
        print (24) = prmt(22)     I ht
        prmt(25) = prmt(23)     ! hh
c
        IFChei .Le. 0.000) GO TO 1000
C
        OSAV = PI*Y(R)*Y(R)*qstr
        IFCQSAV .LT. EMAX) GO TO 110
        EMAX = OSAV
        RM = Y(R)
        SZM * SZ
  110   CONTINUE
        RMAX = dKAX1(RMAX,Y(R)>
C
        IF(hei .Le. srccut) GO TO 1000
        if(cc .le. cclou  .and. uO .eq. 0.) goto 1000    !  no wind
        if(time.gt.tend+1. .and. uO.eq.O. .and. vel.eq.O.)goto 1000!no wind LNG
C
        IF(I .NE. 1) GO TO 115
        CURNTd) - TIME
        CURNTC2) = Y(R)
        CURNTC3) « hei
        CURNTC4) = qstr
        CURNT(S) = sz
        CURNTC6) = yc
        CURNT(7) = ya
        CURNT(8) = rho
        CURNTC9) = ri
        CURNT(10)= we
        CURNTOD- wa
        CURNTC12)= enthalpy
        CURNT(13)= temp
        III = 1
        GO TO 125

 7  --  sys$degadis:src1.for                     6-SEP-1989 17:51:20

-------
                                 D-146

 115   IF(I .EQ.  0) RETURN

       DO 116 II=1,iout_src
 116   BKSPUI) = OJRNT(II)

       CURNT(1) = TIME
       CURNT<2) = Y(R)
       CURNT<3) = hei
       CURNT(4) = qstr
       CURNT(S) - sz
       CURNT(6) = yc
       CURNT<7> = ya
       CURNT(8) = rho
       CURNT(9) = ri
       CURMT(10)= we
       CURNT(11)= wa
       CURNT(12)» enthalpy
       CURNT(13)= temp

       ERM - 0.
       ermss = 0.
       DO  120  M=2,iout_src
       div » curnt(ii)
       ifCdiv  .eq.  0.) div = srcoer
       ER1 = ABS(  (CURNT(II)-BKSP(II))/div )
       ER2 - ABS(  (CURNT(II)-OUTP(II))/div )
       if(II.ne.3  .and.  ii.ne.9  .and. ii.ne.12  .and. ii.ne.7 .and. ii.ne.11)
       1       ermss  = dMAXKER1,ER2,ERHss)  ! ex hei,OSTR,Ri,enth,wa,ya for SS
  120   ERM * dMAX1(ER1,ER2,ERM>
t
       if(check4)  then                  ! steady state
               if(  .not.  (vel.eq. 0..and.time.gt.srcss)) goto 124
  122                   check3 =  .true.
                       outcc « we *  rho
                       sueI = we
                       swal = wa
                       srhl * rho
                       senI = enthalpy
                       outl  = 2.ODD *  Y(r)
                       Qstar = prmt(21)/pi/Y(r)**2
        if(u0.ne. 0.)  sz= (alpha1/uO/zO*Qstar*outl/outcc)**(1 .DO/alphaD*  zO
                       outsz = sz
                       outb  = pi*Y(r)**2 /outl/2.DO
                       goto 1000

  124            if(ermss  .gt. srcoer) goto 125

                if( time-tlast  .gt.  srcss) goto  122
        return
                endif
8 -- sys$degadis:src1.for                      6-SEP-1989 17:51:20

-------
                                  D-147

        IFCERM .LT. SRCOER) RETURN
C
  125   CONTINUE
        tlast = time
        DO 130 Il=1,iout_src
        IFCIII.EQ.1) BKSP(II) = CURNT(II)
  130   OUTP(II) = BKSP(II)
C
        III = 0
        NREC1 = NREC1 + 1
        URITE(9,2000) (OUTP(11).11=1,iout_src)
        RETURN
C
 1000   CONTINUE
        I = -1
        IF(TIME .GE. TEND) CHECKS = .TRUE.
        NREC1 = NREC1 + 1
        URITE(lunlog,1100)
        URITEdunlog,*) Hei,TIME
        TSC1 = TIME
        ifChei .le. 0.) then
                hei * 0.
                y(r) = dmin1(rmax,y(r))
                endif
        URITE(9,2000)
        1       TIME,Y(R),hei,qstr,sz,yc,ya,rho,ri,we,wa,enthalpy,temp
        URITE(lunlog,1110) NREC1
C
        PRMT(5) =  1.
C
        RETURN
 1100   FORMAT<5X,'VALUE OF Hei AT SOURCE TERMINATION -- a TIME1)
 1110   FORMAT(5X,1NUMBER OF LINES -->  '.18)
 2000   format(1pg16.9,1x,1pg16.9.<1x,1pg13.6))
        END
9  -- sys$degadis:srd.for                      6-SEP-1989 17:51:20

-------
                                   D-148

        SUBROUTINE SRTOUT(OPNRUP,  table)
c

        Implicit Real*8 ( A-H, 0-Z ), Integer*4 ( 1-N )

        include 'sys$degadis:DEGADIS3.dec/list1
C
        COMMON /SORT/TCc(maxnob,maxnt},TCcSTR(maxnob,maxnt),
     $  TycCmaxnob,maxnt),Trho(maxnob,maxnt),
     $  TganmaCmaxnob,maxnt),Ttemp(maxnob,maxnt),
     $  TSY(maxnob,maxnt),TSZ(maxnob,maxnt),TB(maxnob,maxnt),
     S  TDISTO(maxnob,maxnt),TDIST(maxnob,maxnt),KSUB(maxnt)
     S/SORTIN/TIM(maxnt),NTIM,ISTRT
     S/com_gprop/ gas_mw,gas_temp,gas_rhoe,gas_cpk,gas_cpp,
     $ gas_uft,gas_lfl,gas_zsp,gas_name
     S/comatm/ istab,tamb,pamb,humid,isofl.tsurf.ihtfl,htco,iwtfl,wtco,
     $ humsre
     $/com_sigx/ sigx_coeff,sigx_pow,sigx_min_dist,sigx_flag
     $/alp/ alpha,alphal
     ./cornsin/ oodist,avtime
C
        dimension tabled)
c
        logical cflag,cflag1
c
        character's gasjiame
        character*40 OPNRUP
C
        OPEN(UNIT=8,TYPE"'NEW•,NAME=OPNRUP,CARRIAGECONTROL='FORTRAN')
C
        WRITE(8,1100)
        if(sigx_flag.eq.  0.)  then
                write(8,1102>
        else
                write(8,1104>
                write(8,1105>  sigx_coeff,sigx_pou,sigx_min_dist
                endif
 c
        cflag  *  isofl.eq.  1.or.  ihtfl.eq. 0
        cflag1=  isofl.eq.1
         if(cflag)  then
                 call  adiabat(2,uc,wa,gas_lfl,ya,cc_lfl,r,w,t,tt)
                 call  adiabat(2,HC,wa,gas_ufl,ya,cc_ufl,r,u,t,tt)
                 endif
 C
        DO 110 I=ISTRT,NTIM
 C
         WRITE(8,1119)
         WRITE(8.1119)
         WRITE(8,1110) TIM(I)
         if(cflagl) then

 1  -- sys$degadis:srtout.for                    6-SEP-1989 17:55:16

-------
                                  D-149

                WRITE(8,1116)  gas_zsp,(100.*gas_lfl),(100.*gas_ufl)
                WRITE(8,1118)
        else
                WRITE(8,1115)  gas_zsp,(100.*gas_lfl),(100.*gas_ufl)
                URITE(8.1117)
                endif
        WRITE(8,1119)
        ip = 0
        II = KSUB(I)
c
        DO 120 .1=1,11
c
        dist  = tdist(j.i) + oodist
        cc    = tcestr(j,i)
        rho   * Trho(j.i)
        yc    = Tyc(j.i)
        temp  » Ttemp(j.i)
        gamma = Tgamma(j,i)
        b     = tb(j.i)
        sz    - tsz(j.i)
        sy    » tsy(j.i)
        blfl  = 0.
        bufl  = 0.
c
        if(.not.cflag) then
                call adiabat(-2,wc,ua,gas_lfl,ya,cc_tfl,r,w,ganma,tt)
                call adiabat(-2,wc,wa,gas_ufl,ya,cc_ufl,r,w,ganma,tt)
                endif
c
        arg = (gas_zsp/sz)»*alpha1
        if(arg  .ge. 80.) goto 600
c
        ccz - cc/exp(arg)
        if(ccz  .It. cc_lfl) then
                if(cflagl) then
        WRITE(8,1120) DIST,yc.Cc,rho,temp,B,SZ,SY
                        else
        WRITE(8,1120) DIST,yc.Cc,rho,gamma,temp,B,SZ,SY
                        endif
                goto 600
                endif
        arg = -
-------
                                   D-150

                endff
        arg = -(dlog(cc_ufl/cc)  + (gas_zsp/sz)**alpha1)
        bufl = sqrt(arg)*sy •* b
                if(cflagl)  then
        URITE(8,1120)  DIST,yc,Cc,rhoftemp,B,SZ,SY,blfl,bufl
                        else
        WRITE<8,1120)  DIST,yc.Cc.rho,gamma,temp,B,SZ,SY,blfl,bufl
                        endif
c
  600   continue
        ip - ip + 1
        if(ip .eq. 3) then
                ip - 0
                write(8,1119)
                endif
  120   CONTINUE
c
c*** summarize the mass above the UFL and LFL
c
        aufl * table(i+2*maxnob)
        atfl = table(i+3*maxnob)
        write(8,8000) 100.*gas_ufl,100.*gas_lfl.alfl-aufl.alfI
 8000   formate//,' For the UFL  of  '.1pg13.5,' mole percent, and1,
     $' the LFL of  ',1pg13.5,' mole percent:1,
     $//,'  The mass of contaminant between the UFL and LFL is:1
     $,1pg13.5,'  kg.1,/,1  The mass of contaminant above the LFL is: ',
     $1pg13.5,' kg.')
  110   CONTINUE
C
        CLOSE(UNIT=8)
C
C
 1100   FORMAT(1HO,5X,'Sorted values for each specified time.1)
 1102   format(1HO,5x,'X-Direction correction was NOT applied.1)
 1104   format(lHO,5x,'X-Direction correction was applied.1)
 1105   format(1h ,5x,5x,'Coefficient:       ',1pg13.5,/,
        1       1h  ,5x,5x,'Power:            ',1pg13.5,/f
        1       1h  ,5x,5x,'Minimum Distance: ',1pg13.5' m')
 1110   FORMATdHO.SX.'Time after beginning  of spill  ',014.7,' sec1)
 1115   FORHAT(1HO,1X,'Distance',2x,3x,'Mole1,3x,
        1        'Concentration',1x,'Density1,2x,3x,'Gamma',3x,
        1        'Temperature',3x,'Half',4x.4x,'Sz',5x,4x,'Sy',5x,
        1        'Width at  z=',0pf6.2,'  m to^./.lx.llx.lx'Fraction'^x,
        1        11x,11x,11x,11x,3xf'Width',3x,11x,9x,
        1        2(1pg9.3,'moleV.1x»
 1116   FORMAT(1HO,1X,'Distance',2x,3x,'Mole',3x,
        1        'Concentration1,1x,'Density',2x,
         1        'Temperature',3x,'Half',4x,4x,'Sz',5x,4x,'Sy1,5x,
         1        'Width at z=',0pf6.2,'  m to:',/,1x,11x,1x'Fraction',2x,
         1        11x,11x,11x,3xf'Width',3x,11x,9x,
         1        2(1pg9.3,'moleX',1x))

 3  -- sys$degadis:srtout.for                   6-SEP-1989 17:55:16

-------
                                  D-151

 1117   FORMATC1H  ,4X, '(m)1 ,4x,11x.
        1        2C1X,'1,
 1118   FORMATOH ,4X, '(m)1 ,4x,11x,
        1        2(1X.'(kg/m**3)'.1x),4x, '(1C)',
 1119   FORMATC1H )
 1120   FORMATOH ,3(1X,1PG9.3, 1X),2x,Opf7.4,2x,1X,1PG10.3, 1X,
        1       6<1X,1PG9.3.1X))
C
        RETURN
        END
4 -- sys$degadis:srtout.for                    6-SEP-1989 17:55:16

-------
                                 D-152
       SUBROUTINE SSG(DIST,Y,Dery,PRMT)

       Implicit Real*8  ( A-H, 0-Z  ),  Integer*^  (  I-N  )


       DIMENSION Y(1),Dery(1),PRMT(1)

       include >sys$degadis:DEGADIS2.dec'

       parameter (zero=1.D-10.  rcrit=2.5D-3)

       COMMON
     $/PARM/UO,ZO,ZR,ML,USTAR,K,G,RHOE,RHOA,DELTA,BETA,GAHMAF.CcLOW
     $/com_gprop/ gas_mw,gas_temp,gas_rhoe,gas_cpk,gas_cpp,
     $ gas_ufI,gas_IfI,gas_zsp,gas_name
     $/comatm/  istab,tamb,pamb,humid,isofl.tsurf.ihtfl.htco.iwtfl,wtco,
     $ humsrc
     S/PHLAG/  CHECK1,CHECK2,AGAIN,CHECKS,CHECK4,CHECKS
     S/ALP/  ALPHA,alphal
     $/phi com/  iphifl,dellay

       REAL*8 K,ML

       LOGICAL CHECK1,CHECKS,AGAIN,CHECKS,CHECK4,CHECKS

        INTEGER rhouh.dh,  mhi, mlow
       DATA rhouh/1/,dh/2/,  mhi/3/f  mlow/4/
C*** PRMT(I) I/O
C***
        I
                     VALUE
IN/OUT
U""
C***
c***
C***
c**«
c***
c***
c***
£*»*
c***
c***
c***
c***
c***
£***
C***
c***
C
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21

E
Cc
XV(I)
TO(I)
-
NREC(I,2)
DIST
sz
yc
rho
temp
gamma


rho I ay
sz

IN
OUT
IN
IN
-
OUT
OUT

out
out
out
out





                                        OUT •- STARTS OUTPUT UNIT=9
 1  -- sys$degadis:ssg.for
          6-SEP-1989 18:04:06

-------
                                  D-153

        XVI = PRMT(8)
        SY = RT2*DELTA*(DIST + XVl)**BETA
        Erate = PRMT(6)
c
c
        szO = print (22)
        sz = szO
C
C*** MATERIAL BALANCE
C
        iii = 0
 100    Cc = Erate*ALPHAl*(ZO/SZ)**ALPHA/UO/SZ/SORTPI/SY
c
        cclay = cc/dellay
        call addheat(cclay,Y(dh),rholay,temlay.cp)
        prod a dmaxK Y(rhouh)/rholay/prmt(18), zero)
        sz = ( prod  ) **(1./alpha!) « zO
        dif = abs(sz - szO)/(abs(sz)+abs(szO)+zero)
        if(dif.gt. rcrit) then
                iii = iii+1
                ifOMi.gt. 20) call trap(33)
                szO = sz
                goto 100
                endif
        prmt(20) = rholay
        prmt(21) = sz
        HEFF = GAMMAF*SZ/ALPHA1

        call adiabat(0,wc,wa,yc,ya,cc,rho(wn),enth,temp)
        call adiabat(0,we,wa,yclay,ya,cclay,rholam,uml,enth,temlam)
        rit = 0.
c
        ifd'sofl.eq.O  .and.  ihtfl.ne.O) then
                call addheat(cc,dellay*Y(dh),rho,temp,cp)
                rit  = pift(temp.heff)
                endif
C
        RISTR = RIF(RHO,HEFF)
        PHI = PHIF(RISTR.rit)
C
        dery(rhouh)  = prmt(19)/phi
        heigh = heff*dellay
        yw =  1.-yclay-ya
        yw = min( max( yw,  O.ODO),  1.000)
        call surfaceCtemlay,heigh,rholay,wml,cp,yvi,watrte,qrte)
        if(temp.ge.  tsurf  .or.  temlay.ge.  tamb) qrte =  0.
        dery(dh)  =  ( qrte/dellay-Y(dh)*Dery(rhouh)  )/Y(rhouh)
C
c
c***  Calculate the  derivative  for  the total mass  a'bove  the UFL  and LFL
c

2  -•  sys$degadis:ssg.for                       6-SEP-1989  18:04:06

-------
                                 D-154

       gamma = (rho-rhoa)/cc                   !  gamma

       if(checkA) then
         DERY(mlow) = 0.
         DERY(mhi)  = 0.
           if( isofl.eq.1  .or.  ihtfl.eq.O  ) then
               call adiabat(2,aa,dd,gas_ufl,ee,chi ,gg,hh,pp,oo)
               call adiabat(2,aa,dd,gas_lfl,ee,clow,gg,hh,pp,oo)
           else
               call adiabat(-2,aa,dd,gas_ufl,ee,chi  ,gg,hh,gamma,oo)
               call adiabat(-2,aa,dd,gas_lfI,ee,clow,gg,hh,gamma,oo)
           endif

       gamnax =  sqrtpi  *  Cc *  Sz *  Sy * GAMMAF / alpha!

          if(cc.gt.clow) then
                wlow = Dlog(cc/clow)
                DERY(mlow)- 2.DO*clow*Sy*Sz/alpha1*series(wlow)
                DERY(mlow)= OMINU DERY(mlou),  garnnax )
          endif

          if(cc.gt.chi  ) then
                whi  * Olog(cc/chi  )
                DERY(mhi) = 2.00*chi *Sy*Sz/alpha1*series(uhi  )
                DERY(mhi) = DNINU DERY(mhi  ),  garnnax )
          endif
        endif
c
        PRMT(7)  « CC
        PRMT(12) ' DIST
        prmt<14) » yc
        prmt(IS) * rho
        prmt(16) = temp
        prmt(17) * gamma
        RETURN
        END
 3 --  sysJdegadisrssg.for                       6-SEP-1989  18:04:06

-------
                                  D-155

C	
c
        SUBROUTINE SSGOUT(X,Y,D,IHLF.NDIM.PRMT)
C

        Implicit Real*8 ( A-H, 0-Z ). Integer*4 ( I-N )

        include -sys$degadis:DEGADIS2.dec'
c
        parameter (nssg=7, zero=1.e-10)
c
        DIMENSION Yd),D(1),PRMTd),BKSP(nssg),OUT(nssg),CURNT(nssg)
C
        COMMON
     S/PARM/ UO,ZO,ZR,ML,USTAR,K,G,RHOE,RHOA,DELTA,BETA,GAMMAF.CcLOW
     $/comatm/  istab,tamb,pamb,humid,isofl.tsurf.ihtfI,htco,iwtfI,wtco,
     $ humsrc
     S/STP/ STPO,STPP,ODLP,ODLLP,STPG.ODLG,ODLLG
     S/STOPIT/  TSTOP
C
        REAL*8  1C, ML
C
C*** PARAMETER  OUTPUT
C
C***   FROM SSG             OUTPUT TO MODEL
l.---
c***
c***
c***
c***
c**«
c***
c***
C




X
PRMTC7)
Yd)
prmt(U)
prmt(15)
prmt(16)
prmt(17)

ERM = 0.
TOl = PRMT(9)
TSL = TS(TOl.X)
prmt(22) = prmt(21)
DIST
Cc
SZ
yc
rho
temp
gamma




! sz
         IF(PRMT(11)  .NE.  0.) GO  TO 90
 C
 C***  STARTUP  FOR  OUTPUT ROUTINE
 C
         RII = -100./STPG
         RI =  0.
         CURNTd)  = X
         eurnt(2)  = prmt(U)      ! yc
         CURNT(3)  = PRMT(7)       ! cc
         curnt(4)  = prmt(15)      ! rho
         curnt(5)  » prmt(17)      ! gamma
         curnt(6>  = prmt(16)      ! temp

 1  --  sys$degadis:ssgout.for                    6-SEP-1989  18:05:18

-------
                                  D-156

        CURNTC7) = prmt(21)     !  sz
C
   90   CONTINUE
C
C*** RECORD THE CURRENT AND PREVIOUS RECORDS
C
        RI = RI + 1.
C
        DO 100 II=1,nssg
 100    bksp(II) = curnt(II)
c
        CURNT(I) = X
        curntCZ) = prrat(1A)     !  yc
        CURNTC3) = PRMT(7)      !  ec
        curnt(A) = prmt(15)     !  rho
        curnt(S) = prmt(17)     !  ganrna
        curnt(6> = prmt(16)     !  temp
        CURNTC7) » pnnt(21)     !  sz
C
c*** stop integration when cc-BKSP(II))/(CURNT(II)+zero)  )
         ER2 = ABSC  (CURNT(II)-OUT(II))/(CURNT(II)+zero)  )
   110    ERH = dMAX1(ER1,ER2,ERM)
 C
 C*** OUTPUT RECORD  IF  ODLG IS EXCEEDED OR  100 METERS SINCE  LAST  OUTPUT
 C
         DX - CURNTC1)  - OUTC1)
         IF( RI.NE.1.  .AND.  ERM.LT.OOLG  .AND.  OX.LE.ODLLG) RETURN
 C
 C*** RECORD THE LAST POINT TO BE  UNDER THE ERROR  CRITERIA.  IN CASE
 C*** THE FIRST POINT AFTER A RECORD  EXCEEDS THE ERROR BOUND.  RECORD
 C*** THAT POINT AS  WELL.
 C
         DO 120 II=1,nssg
         IFCRI .EQ.  RI1+1.) BKSP(II)  = CURNT(II)
   120    OUT(II)  = BKSP(II)
 C
         RI = RII
         PRMT(11) = PRMTC11) + 1.
 C
         WRITEC9,*)  (OUT
-------
                                  D-157

 C*** STOP  INTEGRATION
 C
        PRHT(12) » X
        TSTOP = TSL
        PRMTC11) = PRMTC11) + 1.
        URITEC9.*) (CURNT(II),Il=1,nssg)
 C
        PRMTC5) = 1.
 C
        RETURN
        END
3 •• sysSdegadis:ssgout.for                    6-SEP-1989 18:05:18

-------
                                 D-158

c	
c
        SUBROUTINE SSGOUT(X,Y,D,IHLF,NDIM,PRMT>
        Implicit Real*8 ( A-H, 0-Z ), Integer*4 ( I-N )

        parameter (nssg=9, zero=1.e-10)
C
        DIMENSION Yd),Dd>,PRMTd),BKSP(nssg),OUT(nssg),CURNT(nssg}
C
        include >sys$degadis:DEGADIS2.dec/list1
c
        COMMON
     $/PARM/UO,ZO,ZR,ML,USTAR,K,G,RHOE,RHOA,DELTA,BETA,GAMMAF.CcLOU
     $/STP/STPPfODLP.OOLLP,STPG,ODLG.ODLLG
     $/ALP/ALPHA,alpha1
C
c
        REAL*8 ML.K
C
C*** PARAMETER OUTPUT
C
C***  FROM SSG             OUTPUT TO MODEL
L---
c***
c**«
c«**
c***
c
X
PRMT<7)
Yd)
PRMT(8)

DIST
Cc
SZ
XV

         ERM = 0.
         prmt<22>  * prmt(21)
 C
         IF(PRMT(11) .NE.  0.)  GO TO 90
 C
 C*** STARTUP FOR  OUTPUT ROUTINE
 C
         RII * -100./STPG
         RI = 0.
         CURNTd)  = X
         CURNTC2)  = PRMT(H)      !  yc
         CURNTO)  = print<7)      !  cc
         CURNTC4)  = PRMT<15)      !  rho
         curnt(5)  = prmt(17)      !  gamma
         curnt(6)  * prmt<16)      !  temp
         curnt(7)  = 0.0          !  b
         curnt(S)  = prmt(21)      !  sz
         curnt(9)  = rt2*delta*(x+prmt(8))**beta  !  sy
 C
    90   CONTINUE
 C

 1 -- sys$degadis:ssgoutss.for                  6-SEP-1989 18:06:13

-------
                                 D-159

C*** RECORD THE CURRENT AND PREVIOUS RECORDS
C
        RI = RI + 1.
C
        DO 100 II=1,nssg
  100   BKSP(II) - CURNT(II)
        CURNTd) = X
        CURNT(2) = PRHT(U)     ! yc
        CURNTO) = prmt(7)      ! cc
        CURNT(4) = PRMTdS)     ! rho
        curnt(5) = print d 7)     ! gamna
        curnt(6) = prmt(16)     ! temp
        curnt(7) =0.0          ! b
        curnt(S) « prmt(21)     ! sz
        curnt(9) = rt2*delta*
-------
                                 D-160
        PRMTC12)  = X
        PRMTC11)  * PRMTC11) + 1.
C
        call  ssout(curnt)
C
        PRMT(S)  = 1.
C
        RETURN
        END
 3 -- sys$degadis:ssgoutss.for                  6-SEP-1989 18:06:13

-------
                                 D-161

        subroutine ssout(out)
c

        Implicit Real*8 ( A-H, 0-Z ), Integer*/. ( I-N )

        dimension out(9)
c
        cofinion
     $/com_gprop/ gas_mw,gas_temp,gas_rhoe,gas_cpk,gas_cpp,
     $ gas_ufI,gas_IfI.gas_zsp,gasjiame
     $/com_fl/ cflag.clfl.cufl
     $/alp/ alpha,alpha!
     ./ownsin/ oodist.avtime
c
        character*3 gas_name
c
        data ip/0/
c
        logical cflag
c
c
        dist = out<1) +  oodist
        yc = out(2)
        cc - out(3)
        rho » out(4)
        ganma = out(5)
        temp = out(6)
        b » out<7)
        sz 3 out(8X
        sy = out(9)
c
        if(.not.cflag) then
                call adiabat(-2,uc,wa,gas_lfl.ya.clfl,r,w,gamma,tt)
                call adiabat(-2,wc,Ha,gas_ufl.ya.cufl,r,w,gamma,tt)
                endif
c
        arg & (gas_zsp/sz)**alpha1
        if(arg .ge. 80.)  then
                if(cflag) then
        URITE(8,1120) DIST,yc,Cc,rho,temp,B,SZ,SY
                         else
        WRITE(8,1125) DIST,yc,Cc,rho,ganma,temp,B,SZ,SY
                         endif
                goto 600
        endif
c
        ccz = cc/exp(arg)
        if(ccz  .It. elf I) then
                if(cflag) then
        WRITE(8,1120) DIST,yc.Cc,rho,temp,B,SZ,SY
                         else

 1  -- sys$degadis:ssout.for                      6-SEP-1989  18:07:07

-------
                                  D-162

        URITE(8,1125)  DIST,yc,Cc,rho,gamma,temp,B,SZ,SY
                        endif
                goto 600
                endif
        arg = -(dlog(clfl/cc) + (gas_zsp/sz)**alpha1)
        blfI = sqrt(arg)*sy + b
c
        if(ccz .It. cufl) then
                if(cflag) then
        WRITE(8,1120) DIST,yc,Cc,rhoftemp,B,SZ,SY.blfl
                        else
        WRITE(8,1125) DlST,yc,Cc,rho.gaiflma,temp,B.SZ,SY,blfl
                        endif
                goto 600
                endif
        arg = -
-------
                                  D-163
c	
c
C       PSEUDO-STEADY STATE SUPERVISOR
C
        SUBROUTINE SSSUPsrcenth(2,maxl)
     S/SSCON/ NRECdnaxnob, 2),TO(maxnob),XV(maxnob)
     S/GEN1/ PTIME(igen), ET(igen), R1T(igen), PWC(igen), PTEMP(igen),
     $       PFRACV(igen), PENTH(igen). PRHO(igen)
     $/gen2/ den(5,igen)
     $/com_gprop/ gasjnu,gas_tefflp,gas_rhoe,gas_cpk,gas_cpp,
     S gas_ufl,gas_lfl,gas_zsp,gas_name
     S/PARM/ UO,ZO.ZR,ML,USTAR.K,G,RHOE,RHOA.DELTA,BETA,GAMMAF.CcLOU
     S/ERROR/SYOER, ERRO, SZOER, WT A10, WTQOO, UTSZO, ERRP, SMXP,
     * WTSZP,WTSYP,UTBEP,UTDH,ERRG,SMXG,ERTDNF,ERTUPF,UTRUH,UTDHG
     $/comatm/  istab,tamb.pamb,humid,isofl.tsurf,ihtfl,htco,iwtfl.wtco,
     $ humsrc
     S/PARMSC/  RM, SZM, EMAX, RMAX. TSC1,ALEPH, TEND
     S/STP/ STPO,STPP,ODLP,ODLLP,STPG,ODLG,OOLLG
     S/PHLAG/ CHECK1,CHECK2.AGAIN,CHECKS,CHECK4.CHECKS
     S/nend/ poundn, pound
     S/ALP/ ALPHA,alphal
     S/phicom/  iphifl.dellay
     $/sprd_con/  ce, delrhocnin
     S/STOPIT/  TSTOP
     S/CNOBS/ NOBS
 c
         REAL*8  K,ML,L
         LOG ICAL CHECK1, CHECK2, AGAI N, CHECKS, CHECK, CHECKS
         logical pup.pdn
 c
         character*4  pound
         character's  gas_name
 c
         EXTERNAL  PSS,PSSOUT,SSG,SSGOUT,OB,OBOUT
 C
         DIMENSION PRMT(22),Y(5),DERY(5),AUX(8,5)
 C
         DATA RTOT/0./
         data Mna/28.96/, umu/18.0/
 C
 c
 c*** Estimate the earliest and  latest  time an  observer  can  be released

 1  -- sys$degadis:sssup.for                     6-SEP-1989 18:07:51

-------
                                  D-164

c***   over the source.
c
        R = AFGENCRADG, O.ODO, 'RAOG')
        T01 = TOOB(R, O.ODO)
c
c**  For low wind speed cases which form a blanket, earlier times
c**    than T01 may be possible.  Check each of the points in RAOG.
c
        do i=2,maxl
        if ( radg(1,i).eq.poundn .and. radg(2,i).eq.poundn) goto 20
        TOP s T0ob( radg(2,i>, radg(l.i) )
        if < TOF .It. T01) T01 = TOF
        enddo
c
c**  Now, calculate the last possible time an observer can be released.
c
 20     continue
        XEND * AFGEN(RADG,TEND,'RADG')
        TOF = TOOB(-XEND,TEND)
C
c*«* DOW, divide the total possible time among the observers.
c
        DTOB « (TOF-T01)/FLOAT(NOBS)
        T01 * T01 * DTOB/2.DO
C
C*** perform the calculation  for each observer
c
        write(12,1162)
c
        DO 120  I = 1.NOBS
C
C*** RESET AGAIN
C
         AGAIN  - .FALSE.
C
         TO(I)  = DTOB*dble(I-1) +  T01
         pup 3  .true.
         pdn =  .true.
 C
 C***  IF (XEND .GT.  XIT
-------
                                  D-165
        R = AFGEN(RADG,O.ODO,'RADG')
        IF(tO(i).le.O.  .and.  XIT(O.ODO,TO(I )).gt. -R) then
                pup = .false.
                TUP = 0.000
                endif
c
        if (pup) TUP = TUPF(TOd))
        if(pdn) TDOWN = TDNF(TOU))
C
        XDOUN = XIT(TDOWN,TO(I))
        XUP - XIT(TUP,TO(I))
        URITE(lunlog,1160)  TUP, XUP, TDOWN, XDOUN
C
C*** SET UP INTEGRATION PARAMETERS FOR  EACH OBSERVER.
C
        do ijk=1,22
        prmtO'jk) *O.DO
        enddo
        do ijk=1,5
        y(ijk) = O.DO
        dery(ijk)- O.DO
        do ijkt=1,8
        auxd'jkl.ijk) - O.DO
        enddo
        enddo
c
        PRMT(1> = TUP
        PRHT(2) = TDOWN
        PRMTC3) = STPO
        PRMT(4) = ERRO
        PRHT<5) = dMAX1(1.DO,(TDOUN-TUP)/50.DO>
        PRMT(6) = TO(I)
        prmt(7) = xup
        PRMT(13)= XDOUN • XUP
               szOer    !  tos;3mar86
        Y(2) = szOer    !  Mrate
        y(3) * szOer * AFGEN(srcwc,tup, '1C')    !  Crate
        y(4) = szOer * AFGEN(srcwa,tup, '1C') + 1.D-6    !  BDArate
        y(5) = szOer * AFGEN(srcenth,tup, '1C')  !  Hrate
C
        DERY<1) = UTAIO
        DERYC2) - UTQOO
        DERY(3) = UTSZO
        DERY(4) = 1.DO
        DERY(5) = 1.DO
C
        NDIM = 4
        ffd'sofl.eq. 0 .and. ihtfl.ne. 0) ndim=5
C

3 -- sys$degadis:sssup.for                     6-SEP-1989 18:07:51

-------
                                   D-166

C*** PERFORM INTEGRATION.
C
        WRITE(lunlog,1120) I
 1120   FORMAT(/,'  Entering Observer Integration Step for Observer # ',
     $   13)
C
        CALL RKGST(PRNT,Y,DERY,NDIH,IHLF,OB,OBOUT,AUX)
C
        IF(IHLF .GE. 10} CALL trap(8,IHLF)
c
        write(lunlog.1125)
 1125   formate  ',10x,'Observer Integration complete...')
c
c
c*** Establish initial conditions
c
        cclay * print(K)
        cc = cclay*dellay
        wclay = prmtdS)
        walay = prmt(16)
        enthlay=prmt(17)
        rholay & print(18)
C
        L = XDOUN • XUP
        B * Y(1)
        AREA = B*L
        OSTRO = Y(3)/area
        Erate s 2.DO*qstrO*L*b
        cc = min(cc, rhoe)
        WCP = AFGEN2(PTIME,PUC.TDOUN,ISSS-UCI)
        RHOP * AFGEN2(PTIME,PRHO,TDOWN,'SSS-RHI)
        CCP « WCP*RHOP
        if(cc .gt.  ccp)  cc  = ccp

        szO = (qstrO*L/cc « alpha1/uO/zO)**d.OO/alpha1) * zO
C
        ratiol* uO*zO/ALPHA1/ ZO**ALPHA1 *Cc /B/qstrO/L
        ratio * ratiol*  szO**alpha1  *  (B + sqrtpi/2.DO*syOer)
        if(ratio.le.  1.DO)  then
                syOer *  (1.00/(RATI01«szO**alpha1)  -  b)*2.DO/sqrtpi
        else
                szO = (1.DO/((B+ sqrtpi/2.DO*syOer)*ratio1))**(1.DO/alpha1)
        endif

 c
 c*** Establish  the thermodynamic properties  of  mixtures  of air  and
 c***  the gas  mixture (WCLAY,WALAY,ENTHLAY)  assuming  adiabatic
 c***  mixing.   This is accomplished with  the call to  SETDEN.
 c***  Then,  extrapolate the properties to the centerline,
 c***  ground level concentration.
 c

 4  -- sysSdegadis:sssup.for                     6-SEP-1989 18:07:51

-------
                                  D-167

        humsrc = (1.DO-wclay-walay*(1.DO+humid))/wclay
        call setden(wclay,walay,enthlay)
        if(isofl.eq. 1) goto 200
c
c*** Scan through the array DEN for the last value,  and establish a new
c***  final value based on the centerline,  ground level concentration.
c
        do iii= l.igen
        if(den(1,iii) .gt. 1.DO) then
                ii = iii-H
                rholay = den(3,iii-1)
                temlay - 6en(5,iii-1)
                if(ii .gt. igen .or. iii.le.3) call trap(2)
                cc = cclay*dellay       ! exact due to profile assumptions
        if(cc.gt. rhoe) then
           urite(lunlog,1126) cc.rhoe
 1126      formate/,1 ',10('** **'),/,' cc: ',1pg13.5,' is greater1,
     $            ' than rhoe: • ,1pg13.5,/, ' ', IOC* ***'},/)
           cc =rhoe
        endif
                rho = cc*( rholay- rhoa)/cc lay + rhoa     ! assumes gamma=con
                uc = cc/rho
                w2 = den(2,iii-2)/den(3,iii-2)
                ua = (1.DO-(1.DO+humsrc)*wc)/(1.DO+humid)
                urn » 1.DO/(uc/gas_mu + wa/wcna + (1.DO-wa-wc)/wmw)
                yc = Mm/gas_nw * we
                Yc« dmaxK 0.000, dmin1(1.0DO, yc) )
                den(1,iii) = Yc
                den(2,iii) = cc
                den(3,iii) » rho
c
c**« noW( determine the enthalpy and temperature of such a mixture.
c***  Base both enthalpy and temperature on the fact that
c***  (yc/rho) is proportional to temperature (and therefore enthalpy).
c
                denom - den(1,iii-2)/den(3,iii-2)-den(1,iii-1)/den(3,iii-1)
         if(denom.ne. O.DO) then
           slope * (yc/rho-den(1,iii-1)/den(3,iii-1))/denom
           den<4, i i i ) = slope*(den<4. i i i -2)-den<4, i i i - 1 ))+den(4, i i i - 1 )
           den(4,iii) = dminU dmax1(h_masrte,den(4,iii)), 0.00)
           den<5, i i i ) = slope*(den(5, i i i -2)-den(5, i i i -1 ))+den(5, i i i - 1 )
           den(5,iii) = dminK dmax1(gas_temp,den(5,iii)), tamb)
         else
           den<4,iii)
           den<5,iii)
         endif
                temp = den(S.iii)
                den(1,ii) = 2.DO        ! end-of-record
c-       if(cc.gt. rhoe) call trap(31>
                goto 200

5 -- sys$degadis:sssup.for                     6-SEP-1989 18:07:51

-------
                                  D-168

                endif
        enddo
C
 200    CONTINUE

        IF(Cc .GT. RHOE) then
                WRITE(lunlog,1127) QSTRO,SZO,Cc,rhoe
 1127           formate/,1 «,10('****  •),/,' qstrO: ',1pg13.5,
     $          ' szO: ',1pg13.5,/f
     $          /,' cc: ',1pg13.5,' is greater',
     $            ' than rhoe: ',1pg13.5,//,•  '.10('****  '),/)
c               call trap(30)
                endif
C
C*** SHOW THE OPERATOR WHAT IS GOING ON
C
        WRITEdunlog.1160) TUP,XUP,TDOUN,XDOUN
        URITE(lunlog,1170) AREA,L,B
        WRITE(lunlog,1180) QSTRO,SZO,syOer
        urite(lunlog,1185) wclay,walay,rholay,cclay,teti)lay
        write(lunlog,1186) wc,rho,cc,temp

        write(12,1161)  i,tO(i),  tup.tdown, xdown.L, B,Y(3), we,temp,SzO

  1160   FORHAT(/,'  TUP:  ',1pG13.5,' XUP:  ',1pG13.5,' TDOWN: ',
     $  1pG13.5,'  XDOUN:  ',1pG13.5)
  1161   formate  ',I3,1x,f8.1,1x,6(1x,f6.1,1x).1x,f5.3,1x,1x,
     $  f5.1.1x.1x,f5.2>
  1162   format(/,'  '.'obs',4x,'TO',4x,2x.'Tup',3x,1x,'Tdown',2x,
     $    1x,'Xdown',2x,1x,'Length',1x,1x,'HWidth',1x,1x,'E  rate'.lx,
     $    'Mass  fr'.U.'Temp',2x,2x,'SzO',//>
  1170   FORMAT(•  Half  AREA:  ',1pG13.5,' LENGTH:  ',1pG13.5,' B:  >,1pG13.5}
  1180   FORHATC  TAKEUP  FLUX:  ',1pG12.5,'  SZO:  ',1pG12.5,
     $  '  syO:  ',1pg12.5)
  1185   formate  uclay:  ',1pg12.5,' walay: ',1pg12.5,
     $           ' rholay: ',1pg12.5,' Cclay: ',1pg12.5,/,
     $           ' temlay: ',1pg13.5)
  1186   formate  we:  ',1pg12.S,
     $           ' rho:  ',1pg12.5,'  Cc:  ',1pg12.5,'  temp:  ',1pg12.5)
 C
 C*** PREPARE FOR PSEUDO-STEADY STATE  INTEGRATION.
 C
        do ijk*1,22
         prmt(ijk) =O.DO
         enddo
        do ijk=1,5
         y(ijk)  = O.DO
         derytijk)= O.DO
         do ijkl=1,8
         auxCijkl;ijk) - O.DO
         enddo

 6 -- sys$degadis:sssup.for                     6-SEP-1989 18:07:51

-------
                                  D-169

        enddo
c
        PRMT(1) = XDOUN
        PRMT(2) = 6.023D23
        PRMT(3) = STPP
        PRMT(4) = ERRP
        PRMK5) = SMXP
        PRMT(6) = Erate
        PRMT(7) = Cc    !  •• OUTPUT
        PRMT(S) = B     !  -• OUTPUT
C
C*** PRMTC9) & PRMT(10) ARE CONSTANTS FOR D(SY) & D(SZ)
C
        PRMTC9) = Ce*sqrt(G*ZO/ALPHAl*GAMMAF)*GAMMAF/UO
        PRMT( 10)= ZO**ALPHA*K*USTAR*ALPHA1*ALPHA1/UO
        PRMT(11)= NREC(I,1)
C       PRMTd2)= DIST AT COMPLETION -- OUTPUT
        PRMT(13)= TO(I)
c       prmtd4>= yc    ! output
c       prmtdS)* rho   ! output
t       prmt(16)= temp  ! output; not recorded if isofl=1
c       print (17)= ganma ! output; not recorded if isofl=1  .or.  ihtfl=0
        prmtd8)= uO*zO/alpha1
        prmt(19)= rhoa*k*ustar*alpha1
        prmt(20)= rho I ay
        prmt(21)= szO
        prmt(22)= szO
                rholay*prmtd8)*(SZO/zO)**alpha1          !  rho*ueff*heff
         Y<2)  = SYOER*SYOER
         Y(3)  = B + sqrtpi/2.DO*syOer
         y<4)  = 0.               !  added  heat
 C
         DERYd) = WTSZP
         DERYC2) = WTSYP
         DERYC3) = WTBEP
         dery(4) = UTDH
 C
         NDIM  = 4
 C
         WRITE(lunlog,1130)
  1130    FORMAT ('   Entering  Integration Step -- B  > 0.  ')
 C
 C*** PERFORM  INTEGRATION
 C
         CALL  RKGST(PRMT,Y,DERY,NDIM,IHLF,PSS,PSSOUT,AUX)
 C
         IFUHLF .GE.  10)  CALL  trap(9,IHLF)
 C
         NRECd.D = INT(PRMT(1D)
         WRITE(lunlog,1100)  NREC(I,1),TO(I)

 7 -• sys$degadis:sssup.for                     6-SEP-1989  18:07:51

-------
                                   D-170

 1100   FORMAT(3X,1NUMBER OF RECORDS IN PSS = '110,' FOR T0='1pg13.5)
C
        IF(AGAIN) GO TO 119
C
C*** GAUSIAN COMPLETION OF THE INTEGRATION
C
C*** PSSOUT FORCES THE ABOVE INTEGRATION TO FINISH WHEN B<0 FOR THE
C***  FIRST TIME. THE STEP BEFORE THIS OCCURS IS RECORDED ON UNIT 7.
C***  THE STEP WHEN B GOES NEGATIVE IS CURRENTLY IN Y.
C
C*** THE CALCULATION METHOD CHANGES THE CURRENT VALUE OF SY TO A VALUE
C***  CALCULATED AS IF BEFF=sqrtpi*SY/2. RETAINING THE LAST VALUE OF Cc IN THE
C***  MATERIAL BALANCE.
C
        heat = y(4)
        rholay * print (20)
        Cc * PRMT(7)
        rhouh = Y(1)
        sz = ( rhouh/rholay/prmt(18)  )**(1.DO/alpha1) * zO
        SYT = Erate*ALPHA1*(20/SZ)**ALPHA/UO/SZ/Cc/SQRTPI
C
        XT = PRMT(12>
        XV(I) =  (SYT/RT2/DELTA)**(1.DO/BETA)  -  XT
C
C***  SET  UP  INTEGRATION  FOR THE  GAUSSIAN  DISPERSION PHASE.
C
        do ijk=1,22
        prmt(ijk)  =O.DO
         __Ji_i^
        enoao
        do ijk=1,5
        y(ijk)  = O.DO
        dery
-------
                                 D-171

c       prat(15)= rho           ! output
c       print(16)= temp          ! output
c       prmt(17)= gamma         I output
        print (18)= uO*zO/alpha1
        pmrt(19)= Phoa*k*ustar*alpha1
        print (20)= rho Lay
        prmt(21)= &z
        prmt(22)= sz
C
        Y(1) = rhouh
        Y(2) = heat
C
        DERY(1) = UTRUH
        dery(2) = WTDHG
C
        NDIM = 2
C
        URITE(lunlog,1UO)
 1140   FORMAT(' Entering Gaussian  Stage of Integration ')
C
C*** PERFORM INTEGRATION
C
        CALL RKGST(PRMT,Y,DERY,NDIM,IHLF,SSG.SSGOUT,AUX)
C
        IF(IHLF  .GE. 10) CALL trapdO.IHLF)
C
        NREC(I,2) '  INT(PRMT(11))
        RTOT = RTOT + FLOAT(NREC(I,1) + NRECU.2))
        WRITE(lunlog,1110) RTOT,I
 1110   FORMAT(5X,1TOTAL NUMBER OF RECORDS = ',1pG13.4,'  THROUGH1,
     $' OBS #  -.13)
C
        IFCRTOT  .GT. 120000.) CALL trap(11)
C
   119   CONTINUE
        writedunlog, 1150) tstop,  Prat(12)
 1150   formate/,1   Last time Observer was active: ',1pg13.5,' s at ',
     $    1pg13.5.' m')
   120   CONTINUE
C
        RETURN
        END
9  •- sys$degadis:sssup.for                     6-SEP-1989 18:07:51

-------
                                  D-172

c	
c
        SUBROUTINE STRT2COPNRUP,Hjnasrte)
        Implicit Real*8 ( A-H. 0-Z ), Integer*^ ( I-N )

        include 'sys$degadis:DEGADIS2.dec'
c
        COMMON
     S/GEN3/ radg(2,maxl),qstr(2,maxl),srcden(2,maxl),srcwc(2,maxl),
     $ srcwa(2,maxl),srcenth(2>maxl)
     S/TITL/ TITLE
     S/GEN1/ PTIME(igen), ET(igen), R1T(igen), PUC(igen), PTEMP(igen),
     %       PFRACV(igen>, PENTH(igen), PRHO(igen)
     $/GEN2/ DEN(5,igen)
     S/ITI/ TI.TINP.TSRC.TOBS.TSRT
     $/ERROR/SYOER,ERRO,SZOER,UTAIO,WTOOO,UTSZO,ERRP,SMXP,
     $ UTSZP,WTSYP,UTBEP,vm>H,ERRG,SMXG,ERTDNF,ERTUPF,WTRUH,WTDHG
     S/PARM/ UO.ZO.ZR,ML.USTAR,K,G,RHOE,RHOA,DELTA,BETA,GAMMAF.CcLOW
     $/com_gprop/ gas_mu,gas_temp,gas_rhoe,gas_cpk,gas_cpp,
     $ gas_ufl,gas_lfl,gas_zsp,gas_name
     $/comatm/  istab,tanfc,pant>,humid, isof l,tsurf, ihtf l.htco, iwtf l,wtco,
     $ humsre
     S/PARMSC/  RM,SZM,EMAX,RMAX,TSC1,ALEPH,TEND
     S/PHLAG/ CHECK1,CHECK2,AGAIN,CHECKS,CHECK4,CHECKS
     $/com_sigx/ sigx_coeff,sigx_pow,sigx_min_dist,sigx_flag
     S/NEND/ POUNDN,POUND
     S/ALP/ ALPHA,alphal
     $/phicom/  iphifl.dellay
     $/sprd_con/ ce, delrhomin
     $/COM_SURF/ HTCUT
      ,/oofflsin/  oodist.avtime
 c
         charactep*80 TITLE(4)
 c
         character*4 pound
         character*24 TINP.TSRC.TOBS.TSRT
         character's gas_name
 c
         REAL*8 K,ML
         LOGICAL CHECK1,CHECK2.AGAIN,CHECKS,CHECK4.CHECKS
 C
         character*40 OPNRUP
 C
         OPEN(UNIT=9,NAME=OPNRUP,TYPE='OLD1)
 C
         DO 90  I = 1,4
    90   READ(9,1000) TITLE(I)
  1000   FORMAT(A80)
 C

 1 -- sys$degadis:strt2.for                     6-SEP-1989 18:11:45

-------
                                  D-173


        READ(9,*)  NP
        DO 100  1=1,NP
  100   READ(9,*)  PTIME(I),ET(I),R1T(I), PUC(I). PTEMP(I).
     $       PFRACV(I), PENTH(l), PRHO(I)
        PTIME(NP +1)  =  POUNDH
c
        READC9,*)  NP
        DO 220  1=1,NP
  220   READ<9.*)  DEM(1,I)fDEN(2,n,den(3,I)fden(4,i),den{5.1)
        dend.np+1> =  2.
c
        READ<9,*)  NP
        DO 300  I=1,NP
        READC9,*)  radg(1,I).radg(2,I),qstr(2,I),srcden(2,I),srcwc(2,i),
        1       srcwa(2,i),srcenth(2,i)
        qstrd.I)  =  radgd.I)
        srcdend.I) =  radgd.I)
        srcwcd.O «  radgd.i)
        srcwad.i) =  radgd.i)
        srcenthd.i) - radgd.i)
  300   continue
        I » NP  + 1
        radgd.I)  * POUNDN
        radg(2,I)  - POUNDN
        qstr(1,I)  = POUNDN
        qstr(2,I)  = POUNDN
        srcdend.I) =  POUNDN
        srcden(2,I) =  POUNDN
        srcucd,!) = POUNDN
        srcwc(2,I) * POUNDN
        srcwad,!) =  POUNDN
        srcwa(2,I) *  POUNDN
        srcenthd.I)  = POUNDN
        srcenth(2.I)  = POUNDN
C
        READC9.1010)  TINP.TSRC
        READ(9.1010)  tobs.TSRT
c
        read(9,*)  oodist.avtime
c
        READ<9,«)  UO,ZO,ZR,ML,USTAR
        read(9,*)  K,G,RHOE,RHOA,DELTA
        read(9,*)  BETA,GAMMAF,CcLOW
c
        READ(9,*> RM,SZM.EMAX,RMAX,TSC1
        read(9,*) ALEPH.TEND
c
        READC9,*) CHECK1.CHECK2,AGAIN,CHECKS,CHECK4,CHECKS
c
        READ(9.*) ALPHA
        atphal  = alpha •*• 1.

2  --  sys$degadis:strt2.for                     6-SEP-1989  18:11:45

-------
                                   D-174

 c
         read(9,1020) gasjrame
         read(9,*) gas_mu,gas_tefflp,gas_rhoe
         read(9.*) gas_cpk,gas_cpp
         read(9,*) gas_ufI,gas_lfI,gas_zsp
 c
         read(9,*) istab
         read(9,*) tamb,pamb,humid
         hunsrc = O.DO
         read(9.*) isofl.tsurf
         read(9,*) ihtfl.htco
         read(9,*) iwtfl.wtco
 c
         read(9,*) sigx_coeff,sigx_pow,sigx_min_dist
 c
         read(9,*) iphifl.dellay
 c
         H_masrte =  0.
         ifO'sofl.eq. 0) read(9.*) H_masrte
 C
         READ(9,*) HTCUT, ce. delrhomin
 c
   1010  format(2(a24,1x))
   1020  format(a3)
 C
         CLOSE(UNIT=9)
 C
         RETURN
         END
####
   3 --  sys$degadis:strt2.for                     6-SEP-1989 18:11:45

-------
                                   D-175

c	
c
        SUBROUTINE STRT2COPNRUP,H_masrte,CCP)
C
        Illicit Real*8 ( A-H, 0-Z ), Integer*4 ( I-N )

        INCLUDE 'sys$degadis:DEGADIS2.DEC/LIST'
C
C	
C
C       BLOCK COMMON
C
        COMMON
     VTITL/ TITLE
     S/GEN2/ DEN(5,IGEN)
     S/ITI/ T1,TINP,TSRC,TOBS
     S/PARM/ UO.ZO.ZR,ML,USTAR,K,G,RHOE,RHOA,DELTA,BETA,GAMMAF,CcLOW
     $/com_ss/  ESS,SLEN,SUID,OUTCc,OUTSZ,OUTB,OUTLtswcl,swal,scnl,srhl
     S/PHLAG/ CHECK1,CHECK2,AGAIN,CHECKS,CHECK4,CHECKS
     $/cocn_gprop/ gas_mn,gas_temp,gas_rhoe,gas_cpk,gas_cpp,
     $  gas_uft,gas_lfl,gas_zsp,gas_name
     $/comatm/  istab,tanti,pamb,humid, isof I, tsurf, ihtf I,htco, iutf I,wtco,
     $  hums re
     S/NEND/  POUNDN,POUND
     S/ALP/ ALPHA,alphal
     $/phicom/  iphifl.dellay
     $/sprd_con/  ce, delrhomin
     $/COM_SURF/  HTCUT
      ./oomsin/  oodist.avtime
 C
         character*80 TITLEC4)
         eharaeter*24 TSRC.TINP.TOBS
         character*40 OPNRUP
         character*3  gas_name
         character*^  pound
 C
         REAL*8  K,ML
         LOGICAL CHECK1.CHECK2,AGAIN,CHECKS,CHEC1C4,CHECKS
 C
         OPEN(UNIT=9,NAME=OPNRUP,TYPE='OLD')
 C
         DO 90  I = 1,4
    90    READ(9,1000) TITLE(I)
 1000    FORMAT(ABO)
 C
         read<9,*) np
         do 100  i=1,np
         read(9,*) dummy1,dummy2,dumny3,PUC,PTEMP,PFRACV,PENTH,PRHO
   100    IF(I  .EQ. 1) CCP =  PWC*PRHO
 c
         READ(9,*) NP

 1  -- sys$degadis:strt2ss.for                   6-SEP-1989 18:20:52

-------
                                  D-176

        DO 120 I=1,NP
  120   READ(9,*> DEN(1,I),DEN(2,I),den(3,i),den(4,i),den(5,i)
        I = NP + 1
        DEN(1,I) = 2.
c
        read(9,») np
        do 140 i=1,np
  140   read(9,*> dumny1,dunmy2,durmry3,dummy4,dum5,dum6,dum7
C
        read(9,1100) tinp.tsc
        read(9,1100) tobs.tsrt
 1100   format K,G,RHOE,RHOA,DELTA
        read(9,*) BETA.GAMMAF.CcLOW
c
         read(9,*) dunmyl
         read(9,*) dunmyl
c
         READ(9,*) CHECK1,CHECK2,AGAIN,CHECKS,CHECK4,CHECKS
C
         READ(9.*> ALPHA
         alphal  = alpha + 1.
c
         read(9,1200) gas_name
         read(9,*) gas_nM,gas_temp,gas_rhoe
         read(9,*) gas_cpk,gas_cpp
         read(9,*) gas_ufl,gas_lfl,gas_zsp
 c
         read(9,*) istab
         read(9,*) tamb,pamb,humid
         humsrc = O.DO
         read(9,*) isofl.tsurf
         read(9,*) ihtfl.htco
         read(9,*) iwtfl.wtco
         read(9,*) dunn/1

         READ(9,*> ESS,SLEN,SUID
         read(9,*) OUTCc,OUTSZ,OUTB,OUTL
         read(9,*) swcl,swal,senl,srhl
 C
         read(9,*) iphifl.dellay
         h_masrte = 0.
         ifCisofl.eq. 0) read(9,*) Hjnasrte
 C
         READ<9,*) HTCUT, ce, delrhomin
         CLOSE(UMIT=9)
         RETURN

 2 -- sys$degadis:strt2ss.for                   6-SEP-1989 18:20:52

-------
                                  D-178
c	
c
        SUBROUTINE STRT3COPNRUP)
        Implicit Real*8 ( A-H, 0-Z ). Integer*4 ( I-N )

        include 'sys$degadis:DEGADIS3.dec/list'
C
C       BLOCK COMMON
C
        COMMON
     S/SSCON/ NREC(maxnob,2),TO(maxnob),XV(maxnob)
     S/GEN2/ DEN(5,igen)
     S/PARM/ UO.ZO.ZR,ML,USTAR.K.G.RHOE.RHOA,DELTA,BETA,GAMMAF.CcLOW
     $/com_gprop/ gasjnw,gas_temp.gas_rhoe,gas_cpk,gas_cpp,
     $ gas_ufl,gas_lfI,gas_zsp,gas_name
     S/ITI/ T1,TINP,TSRC,TOBS,TSRT
     $/comatm/ istab,tamb.pamb,humid,isofl.tsurf,ihtfl,htco,iwtfl,wtco,
     $ humsrc
     S/PARMSC/ RM,SZM,EMAX,RMAX,TSC1,ALEPH,TEND
     S/PHLAG/ CHECK1,CHECK2,AGAIN,CHECIC3,CHECKS,CHECKS
     $/com_sigx/ sigx_coeff,sigx_pow,sigx_min_dist,sigx_flag
     S/NEND/ POUNDN,POUND
     S/ALP/ ALPHA,alphal
     S/CNOBS/ NOBS
     ./oomsfn/ oodist.avtime
C
        character's gas_name
        character*40 OPNRUP
        character*24 TINP,TSRC,TOBS,TSRT
C
        REAL*8 K,ML
        LOGICAL CHECK1,CHECK2,AGAIN,CHECKS,CHECK4,CHECKS
C
        OPEN(UNIT=9,NAME=OPNRUP,TYPE-'OLD'}
C
        READ(9,*)  NOBS
        DO 125  1=1,NOBS
   125   READ<9,*>  NRECCI,1),NREC(I,2),TO(I),XVCI)
c
        READ(9,*>  Npts
        DO 140  1=1,Npts
   140   READ<9,*)  den(1,i).den(2,i),den(3,i),den(4ti),den(5fi)
        den(1,nptst-1) = 2.
 c
         read(9,*)  oodist.avtime
 c
         READ(9,*) UO,ZO,ZR,ML,USTAR
         read(9,*) K,G,RHOE,RHOA,DELTA
         read(9,*) BETA,GAMMAF.CcLOW

 1  •- sys$degadis:strt3.for                     6-SEP-1989 18:21:44

-------
                                   D-179
        READ(9,1010) TINP.TSRC
        read(9,1010) TOBS.TSRT
 1010   format(2(a24,1x))
c
        READC9,*) RM,SZM,EMAX,RMAX,TSC1
        read<9,*) ALEPH.TEND
c
        read<9,1020) gas_name
        read(9,*) gas_mH,gas_tenptgas_rhoe
        read(9,*) gas_cpk.gas_cpp
        read(9,*) gas_ufl,gas_lfl,gas_zsp
        read(9,*> istab
        read(9,*) tamb.pamb,humid
        h tins re & O.DO
        read<9,*) isofl.tsurf
        read<9,*) ihtfl.htco
        read<9,*) iwtfl.Htco
        read(9,*> sigx_coeff,sigxjx>w,sigx_min_dist
 1020   format(a3)
c
        READ<9.*) CHECK1.CHECKS,AGAIN,CHECKS,CHECK4,CHECKS
        READ(9,*) ALPHA
        alphal = alpha + 1.
C
        CLOSE(UNIT=9)
C
        RETURN
        END
2 -- sys$degadis:strt3.for                     6-SEP-1989 18:21:44

-------
                                  D-180

C       Surface effects
C
        SUBROUTINE Surface(temp,height.rho,mole,cp,yw,watrte,qrte)
C

        Implicit Real*8 ( A-H, 0-Z ), Integer** ( I-N )

        include 'sys$degadis:DEGADIS1.dec'
c
C
        COMMON
     S/PARM/ UO,20,ZR,ML,USTAR,K,G,RHOE,RHOA,DELTA,BETA,GAMMAF.CcLOW
     $/comatm/ istab,tamb.pamb,humid,isofI,tsurf,ihtfl,htco,iwtfl.wtco,
     $ humsrc
     S/ALP/ ALPHA,alphal
     $/phicom/ iphifl.dellay
     $/COM_SURF/  HTCUT
C
c
        REAL*8 ML,K
        REAL*8 L.masrte.mole
C
        vapor_p**.33333
                 u10 = uO*(10./zO)**alpha
                 hf = 1.22 * rho*cp * ustar**2/u10
                 ho = dmax1(hn,hf)
         else
                 ho = htco        ! ihtfl=-1

 1  -- sys$degadis:surface.for                   6-SEP-1989 18:22:24

-------
                                 D-1,81

       endif
       qrte = ho * detta_t
       if(qrte .It. 0.) qrte = 0.
                               !  since correlations  are not valid for qrte<0.
       uatrte • 0.
       ifO'wtfl .eq. 0) return
       fo = wtco
               if(iutfl .gt. 0) then
               fn = 9.9e-3 * prod_nat
               ff = 20.7 * ho /cp /mole
               fo = dmaxKfn.ff)
               endif
       watrte = min( vapor_p(temp), yu*pamb )
       watrte = fo * (vapor_p(tsurf) • watrte)/pamb
       if(uatrte  . le. 0.) uatrte = 0.
        return
        end
2 -- sys$degadis:surface.for                   6-SEP-1989 18:22:24

-------
                                   D-182

c
C       FUNCTION TO RETURN SZO CALCULATED over the source without
c        a blanket present underneath
c
c       NOTE: Uses the integration package RKGST and cannot be used
c           with any other routine without a local copy of RKGST.
C
        subroutine SZF(Q,L,WCP,sz,cclay,wclay,rholay)
c
        Implicit Real*8 ( A-H, 0-Z ), Integer** ( I-N )

        external szlocal.szloco
C
        REAL*8 L
C
        include  'sys$degadis:DEGADIS1.dec'
C
        COMMON
     S/szfc/  szstpO,szerr,szstpmx,szszO
C
        dimension  YCl),D(1),PRMT(17),aux(8,1)
c
        prmtd)  =  0.
        prmt(2)  =  L
        prmt(3)  =  szstpO
        print (4)  •  szerr
        pntit(5)  =  szstpmx
        prmt(6>  *  0
        PRMTC7)  =  WCP
 c
        Y(1>  » O.DO      I  rho*dellay*uO*zO/(1.+alpha)*(sz/zO>**(1.+alpha)
        D(1)  - 1.DO
 c
        ndim = 1
 c
        call  rkgst(prmt,y,d,ndim,ihlf,szlocal,sztoco,aLuO
 c
         ifOhlf.ge.  10) call  trap(3,ihlf)
 c
        cclay = prmt(13)
        wclay = print (14)
         rholay = prmtdS)
        cc = prmt(16)
         sz = prnrt(17)
 C
         RETURN
         END
 c
 c
         subroutine szlocal(x,y,d,prmt)
 1 •- sysSdegadisiszf.for                       6-SEP-1989 18:23:02

-------
                                   D-183

        Implicit Real«8 ( A-H, 0-Z ), Integer** ( I-N )

        dimension y(1),d(1),prmt(1)
c
        comnon
     S/parm/ uO,zO,zr,ml,ustar,k,g,rhoe,rhoa,delta,beta,gan»naf,cclow
     $/alp/ alpha,alphal
     S/phicom/ iphifl.dellay
c
        real*8 ml.k
        integer rhouhlay/1/
c
        0 - prmt(6)
        WCP - PRMT(7)
c
c... for start up...
c
        if(YCrhouhlay)  .le. O.DO)  then
                weIay  = O.DO
                rholay  = rhoa
                cclay  = O.DO
                cc      = O.DO
                rho     = rhoa
        else
c
c... from  the contaminant material balance  over  the  source, determine  WCLAY
c
                weIay 3 Q*x/Y(rhouhlay)
c
                call  adiabat(1,wclay,walay,yc,ya,cclay,rholay,wm.enth,temp)
                cc =  cclay*dellay
                call  adiabat(0,wc,wa,yc,ya,cc,rho,wni,enth,temp)  !  center line
c
        end if
c
        uheff = Y(rhouhlay)/rholay/dellay
        sz = ( uheff/uO/zO*(alpha1)  )**(1./alphal) * zO
        heff = gafnnaf*sz/alpha1
        ristar =  rif(rho,heff)
        phi = phif(ristar,O.DO)
        wel = del lay  *  k*ustar*alpha1/phi
        D(rhouhlay) = wel*rhoa +  Q/WCP
c
        prmt(8) » cclay
        prmtC9) = weIay
        prmt(10)« rholay
        prmt(11)= cc
        prmt(12) = sz
        return
        end
      sys$degadis:szf.for                       6-SEP-1989  18:23:02

-------
                                   D-184

c
        subroutine szloco(x,y,  dery.ihtf.ndim,  prmt)
c
        Implicit Real*8 ( A-H,  0-Z ).  Integer** (  I-M  )

        dimension y(1), deryd),  prtntd)
c
        prmt(13) = prmt(8)
        prmt (14) = prmt(9)
        prmtCIS) = prmt(10)
        prrat(16) = prmt(H)
        pnnt(17) = prmt(12)
        return
        end
 3 -- sys$degadis:szf.for                       6-SEP-1989 18:23:02

-------
                                   D-185

        subroutine tprop(ifl,wc,wafenthalpy,ycfya,wm,temp,rho,cp)
c
c       subroutine to return:
c               mole fractions (y's)
c               molecular weight (urn)
c               temperature (tempt=JK)
c               density (rhot=]kg/m**3)
c               heat capacity 
-------
                                  D-186

        data dhvap/2.5023D6/    !latent heat of vap [=]J/kg water
        data dhfus/0.33D6/      !latent heat of fus [=]J/kg water

        data rgas/0.08205DO/    !  gas constant for P[=]atm, T[=3K
c
c
        vapor_p(txxx) = 6.02980-3* exp(5407.DO *(1.DO/273.15DO- 1.DO/txxx))
c
c
        WW s 1.DO-WC-W8
        wm = 1.00/(wc/gas_mw + wa/wma + ww/umw)
        yc = wm/gasjnw *wc
        ya = wm/wma *wa
        yw = 1.DO • yc - ya
c
c
        ifd'sofl.eq. 1) then
                call adiabatCI,we,wa,yc,ya,cc,rho,Hm,enthalpy, temp)
                return          !  interp density from we
                endif
        ifdfl.eq. 0)
     $          enthalpy • wc*cpc(gas_tetnp)*(gas_temp - tamb)
     $          + (ww - wa*humid)*cpw*(tsurf - tamb)
c     $         + wa*hunrid*cpw*(tainb - tamb)
c     $         + wa*cpa*(tamb - tamb)           ! TR=tamb
c
c
c
        ifd'fl.eq. 1  .and. ihtfl.eq.O) then
                call  adiabat(1,we,wa,yc,ya,cc,rho,wm,enthalpy,temp)
                return           ! interp density from we
                endif
c
c
         ifCifl  .eq.  -1) goto 400
c
c
         train =  dmin1(gas_temp.  tsurf,  tamb)
         tmax =  cknax1(gas_temp,  tsurf,  tamb)

         elow =  enthal(wc,wa,tmin)
         if(enthalpy.It.  elow)  then
             temp = tmin
             enthalpy = elow
             goto 400
         endif

         elow = enthal(wc,wa,tmax)
         ifCenthalpy.gt. elow)  then

 2 -- sys$degadis:tprop.for                     6-SEP-1989 18:23:57

-------
                                  D-187'

            temp = tmax
            enthalpy = elou
            goto 400
        endif
c
        cue = we
        cwa - wa
        centh = enthalpy

        call zbrent(temp, enthalO, tmin, tmax,  acrit, ierr)
        ifd'err .ne. 0) call trap(24)
c
c
c
 400    continue                !  density calculation
        vp - vaporjs(temp)
        ywsat = dmaxK vp/pamb, O.DO)
        wwsat = MIM/MII * ywsat * (1.DO - (yu-yusat))
        conden = eknaxK O.DO, ww-wwsat)

        rho = 1.DO/(      wa / (pamb*wma/rgas/temp)
                        + (ww-conden) / (pamb*wmw/rgas/temp)
                        + conden / rho_water
                        + we * temp/gas_temp/gas_rhoe )
c
        tmin * temp + 10.
        if(train .gt. tmaxO) tmin = temp - 10.
        if(tmin .It. tminO) tmin = temp + .1
c
        tmax = enthal(wc,wa,tmin)
        cp = (enthalpy • tmax)/(temp - tmin)
        if(cp .It. cpa) cp = cpa                !  nominal value of air
c
        return
        end
c
c
        function  cpc(temp)
         Implicit Real*8  ( A-H, 0-Z  ),  Integer*4 ( I-N )

         convnon
      $/com_gprop/  gas_mw,gas_temp,gas_rhoe,gas_cpk,gas_cpp,
      $  gas_uf I, gas_l f I, gas_zsp, gas_name
 c
         data con/3.33D4/
 c
         character*3 gas_name
 c
         cpc = con  + gas_cpk*gas_cpp *  gas_temp**(gas cpp-1.DO)

 3  --  sys$degadis:tprop.for                     6-SEP-1989  18:23:57

-------
                                  D-188
        if(temp .ne.  gas_temp)  then
                cpc « con * gas_cpk*
          (temp**gas_cpp • gas_temp**gas_cpp)/(temp-  gas_temp)
                endif
        cpc = cpc/gasjnw
        return
        end
c
c
        function enthal(uc,ua,temp)     i  used by TPROP
        Implicit Real*8 ( A-H, 0-Z ). Integer*4 ( I-N )

        parameter (delta=10.DO)
c
        conmon
     S/com_gprop/ gasjnw,gas_temp,gas_rhoe,gas_cpk,gas_cpp,
     $ gas_ufl,gas_lfl,gas_zsp,gas_name
     $/comatm/ istab,tamb,pamb,humid,isofl.tsurf,ihtfl,htco,iwtfl,wtco,
     $ humsrc
c
        character's gas_name
c
        data cpa/1006.3DO/      I heat capacity of air [=]J/kg/K
        data cpw/1865.00/       ! heat capacity of water vapor[=]J/kg/K
        data dhvap/2.5023D6/    !latent heat of vap  [=]J/kg water
        data dhfus/0.3306/      !latent heat of fus  [=]J/kg water
        data wma/28.9600/       ! molecular weight of air
        data wmu/18.0200/       ! molecular weight of water
c
c
        ww = 1.DO-wa-wc
        urn = 1.DO/(wc/gas_mw + wa/uma + ww/wmw)
        yw « ww * wm/wmw

        vp = 6.0298D-3* exp(5407.DO *(1.00/273.1500- 1.DO/temp))
c
        dh = dhvap
        frac = 0.
        if(temp  .It. 273.15DO) frac = dminU (273.15DO-temp)/delta,1.DO)
        dh = dhvap + dhfus*frac
        ywsat =  vp/pamb
        wwsat =  wmw/wm *  ywsat *  (1.00  - (yw-ywsat))
        conden = dmaxK 0.00, ww-wwsat)
c
  1000  enthal = wc*cpc(temp)*(temp  - tamb)
      $          - conden*dh
      *          + ww*cpw*(temp  -  tamb)
      $          -i- wa*cpa*(temp  -  tamb)           !  TR-tamb

4  --  sys$degadis:tprop.for                    6-SEP-1989 18:23:57

-------
                                  D-189

c
        return
        end
c
c
        function enthalOC temp )
c
        implicit real*8 
 c               temperature  (temp[=]K)
 c
 c       for  a mixture  from DEN lookup of  adiabatic mixing calculation
 c       den(1,i)         mole fraction (yc)
 c       den(2,i)         concentration (cc C=]  kg c/m**3)
 c       den(3,i)         mixture density (rho  [=] kg mix/m**3)
 c       den(4.i)         mixture enthalpy  (enthalpy  [«] J/kg)
 c       den(5,i)         mixture temperature (temp  [=3 K)
 c
 c       ifl  indicates  given  information:
 c       -2)mole fraction (Yc) and assumption  of constant gamma  in enthalpy
 c       -1 Concentration (cc) and assumption  of constant gamma  in enthalpy
 c       0) concentration (cc)
 c       1) mass fraction c (we)
 c       2) mole fraction (Yc)
 c

        Implicit  Real*8  ( A-H, O-Z  ), Integer*4 (  I-M )

        include  'sysSdegadis:DEGADISIN.dec'
 c
        common
      S/GEN2/ DEN(5,igen)

 5  -•  sys$degadis:tprop.for                     6-SEP-1989 18:23:57

-------
                                   D-190

     S/parm/ uO,zO.zr,ml,ustar.k,g,rhoe,rhoa,delta,beta,gammaf,cclow
     $/com_gprop/ gasjnw,gas_temp,gas_rhoe,gas_cpk,gas_cpp,
     $ gas_ufl,gas_lfl,gas_2sp,gas_name
     S/comatm/ istab,tamb.pamb,humid,isofl.tsurf,ihtfl,htco,iwtfl.wtco,
     $ humsrc
c
        character*3 gas_name
        real*8 ml,k
c
c*** data for air/water sys
c
        data uma/28.9600/               ! molecular  weight of air
        data MIM/18.02DO/               ! molecular  weight of water
c
c
        ifO'fl.ne. 0) goto 1000
        ccl = cc
        ifCcc .It. 0.) ccl=0.
                 i »  2
 30              if(den(1,i)  .gt. 1.) then
                        i=i-1
                        ifCcc.gt. den(2,i» ccl-den(2,i)
                        goto 50
                        endif
                 if(cc.le. den(2,i)) goto 50     ! lookup  in concentration
                 i«i+1
                 goto 30
 50     slope >  (den(3,i)-den(3,i-D)  /  (den(2,i)-den(2,i-1))  !  interp  in cone
                 rho  =  (ccl  • den(2,i-1))*slope +  den(3,i-1)
        wcl * ccl  /  rho
        we = wcl
        wa = (1.DO-(1.DO+humsrc)*wc)/(1.DO+humid)
        ww = 1.DO -  wa -  we
        WRI = 1 .DO/(wc/gasjiM +  wa/wma  +  ww/wmw)
        yc = wm/gasjnw *  we
        ya = urn/urns  *  wa
        goto 8000
 c
 c
  1000   ifO'fl.ne.  -1) goto 1500
        ccl = cc
         if(ccl.It. 0.) ccl=0.
        gamma =  enthalpy
        we = ccl/(rhoa+ccl*gainna)
        wa 3 (1.DO-(1.DO+hunsrc)*wc)/(1.DO+humid)
        ww = I.DO-wa-wc
        wm = 1.00/(wc/gas_mw + wa/wma  +  ww/wmw)
        yc 2 wm/gasjnw * we
        ya * wm/wma  *  wa
         rho 3 ccl/we
         return

 6 -- sys$degadis:tprop.for                    6-SEP-1989 18:23:57

-------
                                  D-191

c
c
 1500   if(ifl.ne. -2) goto 1700
        yel * yc
        if
            ww =  1.DO-wa
            urn =  1.DO/(wma/wa + wmw/ww)
            ya =  wm/wma * wa
            endif
        if(yc  .gt. 1.)  then
            ycl = 1.00
            ya =  O.DO
            endif
        i  = 2
  1730   if(dend.i)  .gt.  1.) then
                i *  i-1
                goto 1750               ! extrapolate
                endif
        if(ycl.le. dend.i)) goto  1750   ! lookup in mole frac
        i=i+1
        goto  1730
  1750   continue
        wm = ycl*gas_mw + (1.DO-ycl)*wma*wmw*(1.DO+humid) / (wmw + wma*humid)
        we = ycl*gas_mw / wm
        wa =  (1.DO-wc)/(1.DO +  humid)
        ww =  1.DO -  we  -  wa

        slope  = (den(3,i)-den(3,i-1)) /  (den(2, i)-den(2,i-1»   ! interp in cc

        cc = wc*(den(3,i-1) -  slope*den(2,i-1))/(1.DO - wc*slope)
        rho =  cc/wc

                w1 = den<2,i-1)/den(3,i-1)
                w2 = den(2,i)/den(3,i)
        slope  = (den(4,i)-den(4,i-1)) /  (w2 - wD       ! interp in w

 7  -- sys$degadis:tprop.for                     6-SEP-1989 18:23:57

-------
                                   D-192

                enthalpy = (we -  w1)  *slope «• den(4,i-1)
        slope = (den(5,i)-den(5,i-1» / (w2 • w1)        !  interp in  w
                temp = (we -  w1)  *slope + den(5,i-1) .
c
        return
c
c
 2000   if(ifl.ne. 1) goto 9000
        wcl = we
            if(we .It. 0.) then
                wcl = 0.00
                wa = I.DO/d.DO+humid)
                endif
            if(we .gt. 1.) then
                wcl - 1.00
                wa = 0.00
                endif
        ww - 1.DO-wa-wcl
        urn = 1.DO/(wcl/gas_mw + wa/wma + ww/wmw)
        ye = wm/gas_mw *wcl
        ya = wm/wma *wa
        i = 2
 2030   if(den(1,i) .gt. 1.) then
                i = i-1
                goto 2050               ! extrapolate
                endif
        ifCyc.le. den(1,i)) goto 2050   ! lookup in mole frac
        i=i+1
        goto 2030
 2050   slope = (den(3,i)-den(3,i-D) / (den(1,i)-den(1,i-1))
        rho = (yc-den(1,i-1))*slope + den(3,i-1)
        slope = (den(2,i)-den(2,i-1» / (den(1 ,i)-den(1,i-1))
        cc = (yc-den(1,i-1»*slope + den(2,i-1)
        i = 2
 2060   if(den(1.i)  .gt.  1.)  then
                 i  =  i-1
                goto  8000               ! extrapolate
                endif
        cwc = den(2,i)/den(3,i)
         ifCwcl.le. cwc)  goto  8000        !  lookup in mass frac
         i=i+1
        goto 2060
 c
 c
 8000            w1 s den(2,i-1)/den(3.i-1)
                 w2 = den(2,i)/den(3,i)
         slope  = (den(4,i)-den<4,i-D)  / (w2 - wD        !  interp in w
                 enthalpy = (wcl  -  w1)  *slope +  den(4,i-1)
         slope  = (den(5,i)-den(5,i-D)  / (w2 - wD        !  interp in w
                 temp = (wcl  • w1)  *slope +  den(5,i-1)
 8 --  sysSdegadisrtprop.for                    6-SEP-1989  18:23:57

-------
                                  D-193

        return
c
 9000   call trap(26)
        end
c
c
        subroutine setenthal(hjnasrte,h_airrte,h_watrte)
c
c       subroutine to load /com_ENTHAL/ through passed arguments if needed
c
c

        Implicit Real*8 ( A-H, 0-Z ), Integer** ( I-N )

        include >sys$degadis:DEGAOISIN.dec'
c
        common
     $/com_gprop/ gasjnw,gas_temp,gas_rhoe,gas_cpk,gas_cpp,
     $ gas_ufl,gas_lfl,gas_zsp,gas_name
     $/comatm/ istab,tamb,pamb,humid,isofl.tsurf,ihtfl.htco,iwtfl,utco,
     $ humsrc
c
        character's gas_name
c
c*** data for air/water sys
c
        data cpa/1.0063D3/      !  heat capacity of air [=]J/kg/K
        data cpw/1865.00/       !  heat capacity of water vapor[=]J/kg/<
c
        hjnasrte = 0.00
        h_airrte = O.DO
        h_uatrte * O.DO
c
        ifO'sofl.eq. 1) return
c
        h_masrte = cpc(gas_temp)*(gas_temp • tamb)      !  TR=tamb
c
c h_airrte  = cpa*(tamb - tamb) " 0.
c
        jfd'watfl .eq. 0) return
        h_uatrte = cpw*(tsurf - tamb)
c
        return
        end
c
c
c
        subroutine setden(wc,wa,enthalpy)
c
c       subroutine to  load /GEN2/ as needed
c

9 --  sys$degadis:tprop.for                     6-SEP-1989 18:23:57

-------
                                   D-194

c       adiabatic mixing of:    UC
c                               WA
c                               UW a specified enthalpy
c
c               with ambient humid air 3 tamb
c
c       den(1,i)        mole fraction (yc)
c       den(2,i)        concentration (cc [=] kg c/m**3)
c       den(3,i)        mixture density (rho  [=] kg mix/m**3)
c       den(4,i)        mixture enthalpy (enthalpy t=] J/kg)
c       den(5,i)        mixture temperature (temp [-] K)
c
c

        Implicit Real*8 ( A-H, 0-Z }, Integer*4 ( I-N )

        include  'sys$degadis:DEGADISIN.dec'
c
        parameter  (tcrit=0.002DO, zero=1.D-20)
        parameter  (iils«200, ils=iils-1,  iback=25)
c
        common
     S/GEN2/ OEN(5,igen)
     $/com_gprop/  gasjnu,gas_temp,gas_rhoe,gas_cpk,gas_cpp,
     $ gas_ufl,gas_lfI, gas_zsp, gasjvme
     S/comatm/ istab,tamb,pamb,humid,isofl,tsurf,ihtfl,htco,iutfl.wtco,
     S humsrc
c
        character*3  gas_name
c
        dimension  curnt(S)lbacksp(5,iback)
c
c*** data  for air/water sys
c
        data  uma/28.9600/        ! molecular  weight of air
        data  wmw/18.0200/        ! molecular  weight of water
        data  cpa/1.0063D3/       ! heat capacity of air  t=]J/kg/K
        data  cpw/1865.DO/        ! heat capacity of water vapor[=]J/kg/K
 c
 c
 c
         if(isofI.eq. 1)  return
 c
 c
         k = 1
         den(1,k) = 0.000                ! yc
         den(2,k) = O.ODO                ! cc
         den(3,k) = pamb*(1.DO+humid)/(.002833DO+ .004553DO*humid)/tamb  !  rhoa
         den(4,k) = O.ODO                ! enthalpy of ambient air; TR-tamb
         den(5,k) = tamb
10 -- sys$degadis:tprop.for                     6-SEP-1989 18:23:57

-------
                                   D-195
        do 300 i= ils,1,-1
        zbda = (float(i)/float(iils)) / (1.+humid)
        zw = zbda*hunid
        zg = 1.DO-zbda-zu
c
e       enmix = zg*enthalpy + zbda*cpa*(tamb-tamb) + zw*cpw*(tamb-tamb) !  TR=tamb
        ermix = zg*enthalpy
c
        zbda = zbda + zg*wa
        zg   =        zg*uc
        call tprop(2,zg, zbda,enmix,yc.ya,win, temp, rho, cp)
        cc = zg*rho
c
c
        curntd) = yc
        curnt(2) = cc
        curnt(3) = rho
        curnt(4) » ermix
        curnt(S) = tetnp
c
        if(i  .eq.  Us) then
                 ind = 1
                do 150 jj* 1,5
 150            backsp(jj.ind)  - curnt(jj)
                goto 300
                endif
c
c       ADIABAT  interpolation scheme
c
        err = 0.
        do 180  iind = 1,ind
        yc    = backsp(1,iind)
        cc    = backsp(2,iind)
        rho   = backsp(3,iind>
        enmix = backsp(4,iind)
        temp  =» backsp(5,iind)
        slope =  (den(2,k>- curnt(Z)) / (den(1,k)' curnt(D)
                ccint » (yc  - curnt(1))*slope +  curnt(2)
        err = dmax1(err,2.DO* abs(cc - ccint)/(abs(cc + ccint) + zero))
        slope =  (den<3.k>- curnt(3)) / (den(1,k>- curnt(D)
                 rhoint =  (yc •  curnt(1))*slope + curnt(3)
        err = dmax1(err,2.DO* abs(rho  •  rhoint)/(abs(rho + rhoint) + zero))
        wccal = cc / rhoint
                 w1 = curnt(2)/curnt(3)
                 w2 = den(2,k)/den(3,k)
        slope =  (den(4,k)- curnt(4)) / (w2  - w1)
                 entint =  (wccal -  w1)*slope + curnt(4)
        err = dmax1(err,2.DO* abs(enmix  - entint)/(abs(enmix + entint) +  zero))
        slope =  (den(S.k) -  curnt(5))  /  (w2 - H!)
                 temint =  (wccal -  w1)*slope + curnt(5)

11  --  sys$degadis:tprop.for                     6-SEP-1989 18:23:57

-------
                                   D-196

        err = dmax1(err,2.DO* abs(temp -  temint)/(abs(temp +  temint)  + zero)}
 180    continue
c
        if(err .le. tcrit) then
                ifd'nd .ge. iback) goto 200
                ind = ind + 1
                do 190 jj»1,5
 190            backsp(jj.ind) - curnt(jj)
                goto 300
                endif
c
c       record a point in DEN
c
c
 200    k =  k+1
        ifdc.ge. igen) call trap(28)
        do 250 jj»1,5
        den(jj.k)  = backsp(jj.ind)
 250    backsp(jj,1> = curnt(jj)
        ind  = 1
c
 300    continue
c
        k  =  k+1
        ifCk.ge.  igen) call  trap(28)
        ifCuc.eq.  1.DOO)  then
                den(1,k)  = 1.000         !  yc
                den(2,k)  = gas_rhoe      !  cc
                den(3,k)  = gas_rhoe      !  rhoe
                den(4,k)  = enthalpy      !  enthalpy
                den(5,k)  = gas_tenp      !  temp
        else
        call tprop(2,we,wa,enthalpy,den(1,k),ya,um,den(5,k),denC3,k),cp)
        den(2,k)  = wc*den(3,k)  I  cc
        den(4,k)  = enthalpy
        endif
        den(1,k+1) =  2.          !  .gt.  1.  end-of-record indicator
 c
        return
        end
 c
 c
 c
 c
        subroutine addheat(cc,dh,rho,temp,cp)
         Implicit Real*8 ( A-H,  0-Z ),  Integer*^ ( I-N )

         include >sys$degadis:DEGADIS1.dec'
 c

12 •- sys$degadis:tprop.for                     6-SEP-1989 18:23:57

-------
                                   D-197

        parameter (acrit=0.02DO)
c
        conmon
     S/GEN2/ DEN(5,igen)
     $/com_gprop/ gas_mu,gas_temp,gas_rhoe,gas_cpk,gas_cpp,
     $ gas_ufl,gas_lfl,gas_zsptgas_name
     S/comatm/ istab,tamb,pamb.humid,isofI,tsurf,ihtfI,htco,iwtfI,wtco,
     $ humsrc
     ./ctprop/ cwc,cwa,centh
c
        character*3 gas_name

        external enthalO
c
c*** data  for air/water sys
c
        data wma/28.9600/        ! molecular weight of air
        data wmw/18.02DO/        ! molecular weight of water
        data rho_water/1000.DO/  !  liquid water  density  [=]  kg/m**3
        data cpa/1.0063D3/       ! heat  capacity of air  MJ/kg/K
        data cpw/1865.DO/        ! heat  capacity of water vapor[=]J/kg/K
        data dhvap/2.502306/     {latent heat  of vap  [=]J/kg water
        data dhfus/0.3306/       !latent heat  of fus  [=]J/kg water

        data  rgas/0.0820500/     ! gas constant  for P[=]atm, T[=]K
 c
 c
 c
        vapor_p(txxx>  = 6.0298D-3*  exp(5407.DO  *(1.DO/273.15DO-  1.DO/txxx)>
 c
 c
         cp =  cpa
         rhoa  x den(3,1)
 c
         call  adiabat(0,we,wa,yc,ya,cc,rho,wm,enthalpy,amt)
         ww =  1.DO -  we -  wa
        yw »  1.DO •  yc •  ya
         temp = amt
         IFO'sofl.eq.1  .or.  ihtfl.eq.O) return   !  adiabatic mixing is valid
         if(dh.le.  0.)  return            !  catch colder surface temperatures
         enthalpy = enthalpy + dh
 c
 c
         if(enthalpy.gt.  0.)  then
                 temp = tamb
                 goto 400
                 endif
 c
 c
 c
        tmin =  amt      !  adiabatic mixing  temp

13  --  sys$degadis:tprop.for                      6-SEP-1989  18:23:57

-------
                                   D-198

        tmax = dmax1(gas_temp,  tsurf,  tarab)
        ehi = enthaKwc,  wa,  tmax)
        if(enthalpy.gt.  ehi)  then
            temp = tmax
            goto 400
        endif

        cue = we
        cwa = wa
        centh = enthalpy

c
        call zbrentCtemp, enthalO, tmin, tmax,  acrit, ierr)
c
c... If there are troubles, get LIMIT to help
c
        if(ierr .ne. 0) then
                tine = (tmin+tmax)/100.DO
                temp = tmin
                tmin = tmin/2.00
                tmax & 2.DO*tmax
                call limit(enthalO, temp, tine, tmax, tmin)
                call zbrentCtemp, enthalO, tmin,tmax,acrit,ierr)
                    if(ierr .eq. 0) goto 400
                call trap(17)
        endif
c
c
 400    continue                 ! density calculation
        vp = vaporji( temp)
        ywsat  * dmaxK vp/pamb,  0.00)
        wwsat  = umw/wm * ywsat * (1.00  -  (yw-ywsat))
        conden =  dmaxH  O.DO,  ww-wwsat)

        rho =  1.DO/C       wa / (pamb*wma/rgas/temp)
                         +  (ww-conden) / (pamb*wniw/rgas/temp)
                         +  conden /  rho_water
                         +  we * temp/gas_temp/gas_rhoe  )

         if(temp.ne.amt)  cp = dfliax1(dh/(temp-amt),cpa)
 c
 c
 c
         return
        end
14 -- sys$degadis:tprop.for                     6-SEP-1989 18:23:57

-------
                                  D-199
c	
c
C       FILE NAME TRANS1 -- FOR USE IN DEGADIS1
C
C	
C
        SUBROUTINE TRANS(FILE)
C

        Implicit Reat*8 ( A-H, 0-Z ), Integer*4 C I-N )

        include 'sys$degadis:DEGADIS1.dec'
c
C       BLOCK COMMON
C
        COMMON
     S/GEN3/ radg(2,tiBxl),qstr(2,maxl),srcden<2,maxl),srcwc(2,maxi.),
     $ srcua(2lmaxl),srcenth(2>maxl)
     S/TITL/TITLE
     S/GEM1/ PTIME(igen), ET(igen), R1T(igen), PWC(igen), PTEMP(igen),
     S       PFRACV(igen), PENTH(igen), PRHO(igen)
     S/GEN2/ DENCS.igen)
     $/ITI/T1,TINP,TSRC,TOBS,TSRT
     $/ERROR/STPIN,ERBND,STPMX,WTRG,WTtm,UTya,wtyc,wteb,wtmb,wtuh,XLI,
     $ XRI,EPS,ZLOU,STPINZ,ERBNDZ,STPMXZ,SRCOER,srcss,srccut,
     S htcut.ERNOBL,NOBLpt,crfger.epsiIon
     $/PARM/UO,ZO,ZR,ML,USTAR,K,G,RHOE,RHOA,DELTA,BETA,GAMMAF,CcLOU
     $/com_gprop/ gas_RM(gas_t«np,gas_rhoe,gas_cpkfgas_cpp,
     $ gasjufI,gas_IfI,gas_zsp,gas_name
     S/comatm/ istab.tamb.pamb.hunid,isofl.tsurf,ihtfl,htco,iwtfl.wtco,
     $ humsre
     S/PARMSC/ RM,SZM,EMAX,RMAX,TSC1,ALEPH,TEND
     S/com_ss/ ess,slen,swid,outcc,outsz,outb,outl,swcl,sual,senl,srhl
     S/PHLAG/CHECK1,CHECK2,AGAIN,CHECK3,CHECKA,CHECKS
     $/com_sigx/ sigx_coeff,sigx_pow,sigx_min_dist,sigx_flag
     $/com_enthal/ h_masrte,H_ai rrte,H_watrte
     S/NEND/ POUNON,POUND
     $/ALP/ ALPHA,alpha!
     $/phicom/  iphifl.dellay
     $/sprd_con/ ce, delrhomin
     $/COM_SURF/ HTCUTS
      ./oomsin/ oodist.avtime
 C
         character*80 TITLE(4)
 C
         character*^ pound
         character*24 TSRC.TINP.TOBS.TSRT
         character*3 gas_name
 C
         REAL*8 ML.K
         LOGICAL  CHECK1.CHECIC2, AGA I N,CHECK3,CHECK4, CHECKS

 1  -- sys$degadis:trans1.for                    6-SEP-1989 18:29:54

-------
                                  D-200

c
        character*^*) file
C
        OPEN(UNIT=8/NAME=FILE,TYPE='NEW',
     $  carriagecontrol='list1,
     $  recopdtype='var i able')
C
        WRITE(8,1000) (TITLE
 1000   FORMAT(ASO)
C
        00 100 I=1,igen
  100   IF(PTIMEU).EO.POUNDN) GO TO 105
        urite(6,*) '  POUND WAS NOT DETECTED '
  105   NP = I - 1
        WRITE(8,1040> NP
        DO 110 1=1,HP
  110   WRITE(8,1030> PTIME(I),ET(I),R1T(I), PUC(I),PTEMP(I),
     $       PFRACV(I). PENTH(I), PRHO(I)
c
        DO 120 I=1,igen
  120   IF(DEN(1,I>  .gt. 1.) GOTO 125
        DO 122 I=1,igen
  122   WRITE(8.1060) DENC1,I),DEN(2,I),den(3,i),den(4,i),den(5,i)
        write(6,*) ' density function blew the loop1
  125   NP * I • 1
        WRITE(8,1040> NP
        DO 130 1=1,NP
  130   WRITEC8.1060) DEN<1,I),DEN<2,I>,den<3,i),den(4,i),den(5,i)
c
        DO HO  1=1, max I
c       cc = srcwc(2,i)*srcden(2,i)
c       if(cc.lt.  cclow) then
c                fee  * 0.
c                do ii=i+1,maxl
c                fee  = amax1(srcwc(2,ii)*srcden(2,ii),fcc)
c                enddo
 c                if(fcc.ge.  cc)  goto  140
 c                np = i
 c                tend =  srcwcd.i)
 c                goto 146
 c                endif
   140   IF(radg<1,I).EQ.POUNDN .AND. radg(2,I).EQ.POUNDN)  GO TO 145
         write(6,*) ' POUND WAS NOT DETECTED '
   145   NP = I  • 1
   146   WRITE(8,1040)  NP
         DO 150 1=1,NP
   150   WRITE(8,1060) radg<1,i),radg(2,i),qstr(2,i),srcden(2, i),srcwc(2, i
         1       ,srcwa(2,i),srcenth(2,i)
 c
  1020   format(1x,i4,1x,1pg14.7)
  1030   format(8(1x,1pg14.7»

 2 -- sys$degadis:trans1.for                    6-SEP-1989 18:29:54

-------
                                  D-201

 1040   format(1x,i4)
 1050   format(2(a24,1x))
 1060   format(1x,1pg23.16,7(1x,1pg14.7))
 1070   format(1x,1pg14.7)
 1080   format(a3)
c
        URITE(8,1050) TINP.TSRC
        write(8,1050) TOBS,TSRT
        write(8,1030) oodist.avtime
        URITE(8,1060) UO,rO,ZR,MLfUSTAR
        urite(8,1060) K,G,RHOE,RHOA,DELTA
        urite(8,1030) BETA,GAMMAF,CcLOU
        URITE(8,1060) RM,SZM,EMAX,RMAX,TSC1
        write(8,1030) ALEPH.TEND
        URITEC8,*) CHECK1 .CHECIC2,AGAIN,CHECKS,CHECK4,CHECKS
        WRITEC8.1070) ALPHA
        write(8,1080) gasjiame
        write(8,1030) gasjnu,gas_temp,gas_rhoe
        writeCS, 1030) gas_cptc,gas_cpp
        write(8,1030) gas__ufl,gas_lfl,gas_zsp
        write(8,1040) istab
        write(8,1030) tamb.pamb,humid
        write(8,1020) isofl.tsurf
        urite(8,1020) ihtfl.htco
        write(8,1020) iwtfl.wtco
        write(8,1030) sigx_coeff,sigxjx>w,sigx_min_dist
C
        if(check4) then
                urite(8,1030) ess.slen.suid
                Mrite(8,1060) outcc,outsz,outb,outl
                urite(8,1060) swcl,sual,senl,srht
                end  if
c
        write(8,1020) iphifl.dellay
c
        if(isofl.eq. 0) write(8,1030) H_masrte
c
        URITEC8.1030) HTCUTS, ce, delrhomin
C
        CLOSE(UNIT=8)
C
        RETURN
        END
3  -- sys$degadis:trans1.for                    6-SEP-1989  18:29:54

-------
                                  D-202

C	
c
C       FILE NAME TRANS2 •- USE UITH DEGAOIS2
C
        SUBROUTINE TRANS(FILE)
        Implicit Real*8 ( A-H, 0-2 ), Integer*4 ( I-N )

        include 'sys$degadis:DEGADIS2.dec'
c
        COMMON
     S/SSCON/ NREC(maxnob,2),TO(maxnob),XV(maxnob)
     S/GEN2/ DEN(5,igen)
     S/ITI/ T1,TINP.TSRC,TOBS,TSRT
     S/PARM/ UO,ZO,2R,ML.USTAR,KfG,RHOE,RHOA,DELTA,BETA.GAMMAF.CcLOW
     $/corn_gprop/ gasjnw,gas_temp,gas_rhoe,gas_cpk,gas_cpp,
     $ gas_ufl,gas_lfI,gas_zsp,gas_name
     $/comatm/  istab.tamb.pamb.humid.isofl.tsurf.ihtfl.htco.iwtfl.wtco,
     $ humsrc
     S/PARMSC/  RM,SZM,EMAX,RMAX,TSC1,ALEPH,TEND
     S/PHLAG/ CHECK1,CHECK2,AGAIN,CHECKS,CHECK4,CHECKS
     $/com_sigx/  sigx_coefffsigx_pow,sigx_min_dist,sigx_flag
     S/nend/  poundn,pound
     S/ALP/ ALPHA,alpha!
     S/CNOBS/ NOBS
      ./oomsin/  oodist.avtime
 c
        character*3 gas_name
        character*80 TITLEC4)
        character*24 TINP,TSRC,TOBS,TSRT
        character*(*) file
 c
        REAL*8  K,ML
        LOGICAL CHECK1,CHECK2,AGAIN,CHECK3,CHECK4,CHECKS
 C
        OPEN(UNIT=9,NAME=FILE,TYPE«'NEW',
     $  carriagecontrol='list',
     $  recordtype='variable1)
 C
        URITE(9,1040) NOBS
        DO 125  I>1,NOBS
   125   WRITE(9,1010) NRECCI,D.NRECd,2),TO(I),XV(I)
 c
        DO 140 I=1,igen
   140   IF(DEN(1,I).gt. 1.)  GOTO 145
         write<6,*)  ' density function error  in TRANS'
   145   NP = I  - 1
         WRITE(9,1040)  NP
         DO 150 1=1,NP
   150   WRITEC9,1060) DEN<1,I),DEN(2,I),den(3,i),den(4,i),den(5.i)

 1 -- sys$degadis:trans2.for                    6-SEP-1989 18:31:12

-------
                                  D-203
        write(9,1060) oodist.avtime
c
        WRITE(9,1060) UO,ZO,ZR,ML,USTAR
        urite(9,1060) K,G,RHOE,RHOA,DELTA
        write(9,1030) BETA.GAMMAF.CcLOW
c
        URITE(9,1050) TINP.TSRC
        urite(9,1050) TOBS.TSRT
c
        WRITE(9,1060) RM,SZM,EMAX,RMAX,TSC1
        write(9,1020) ALEPHJEND
c
        write(9,1080) gas_name
        write(9,1030) gas_mu,gas_temp,gas_rhoe
        urite(9,1020) gas_cpk,gas_cpp
        write(9,1030) gas_ufl,gas_lfl.gas_zsp
        write<9,1040) istab
        urite(9,1030) tamb.pamb.humid
        write(9,1025) isofl.tsurf
        urite<9,1025) ihtfl.htco
        write(9,1025) iwtfl.wtco
        write(9,1030) sigx_coeff,sigx_pow,sigx_min_dist
c
        WRITE(9,*) CHECK1,CHECK2,AGAIN,CHECK3.CHECK4,CHECKS
c
        WRtTE(9,1070) ALPHA
c
 1010   format(1x,i8,1x,i8,2(1x,1pg14.7))
 1020   fonnat(2(1x,1pg14.7))
 1025   format(1x,i4,1x,1pg14.7)
 1030   format(3(1x,1pg14.7»
 1040   format(1x,i4)
 1050   format(2(a24,1x))
 1060   format(5(1x,1pg14.7))
 1070   format<1x,1pg14.7)
 1080   format(a3,1x)
C
        CLOSECUNIT-9)
        RETURN
        END
 2  --  sys$degadis:trans2.for                    6-SEP-1989 18:31:12

-------
                                   D-204

c	
c
C       FILE NAME TRANS2 •- USE WITH SDEGADIS2
C
C	
C
        SUBROUTINE TRANS(FILE)
C
C
c
c

        Implicit Real*8 ( A-H, 0-Z ), Integer** ( I-N )

        COMMON
     $/PARM/ UO.ZO.ZR,ML,USTAR.K.G.RHOE.RHOA,DELTA,BETA,GAMMAF.CcLOU
     $/com_gprop/ gas_mu,gas_temp,gas_rhoe,gas_cpk,gas_cpp,
     $ gas_ufl,gas_lfI,gas_zsp,gas_name
     S/comatm/ istab,tamb,pamb,himid,isofl,tsurf,ihtfl.htco,iutfl,wtco,
     S humsrc
     S/ITI/ t1.TINP.TSRC.TOBS
     S/PHLAG/CHECK1,CHECK2,AGAIN,CHECKS,CHECK4.CHECKS
     $/ALP/ALPHA,alpha1
C
        character*24 TSRC.TINP.TOBS
        character*? gas_name
        character*(*) file
C
        REAL*8 K.ML
        LOGICAL  CHECK1.CHECIC2,AGAIN,CHECKS,CHECK4,CHECKS
C
        OPEN(UNIT=9,NAME=FILE,TYPE='NEU')
 C
        WRITEC9.1060)  UO.ZO.ZR.ML.USTAR
        urite(9,1060)  K.G.RHOE.RHOA,DELTA
        write(9,1030)  BETA.GAMMAF.CcLOW
 C
        WRITE(9,1050)  TINP.TSRC
         write(9,1050)  TOBS
 c
         urite(9,1080)  gas_name
         write(9,1030)  gas_mw,gas_temp,gas_rhoe
         write(9,1020) gas_cpk,gas_cpp
         write(9,1030) gas_ufl,gas_lfl,gas_zsp
 c
         write(9,1040) istab
         urite(9,1030) tamb.pamb.humid
         write<9,1025) isofl.tsurf
         write(9,102S) ihtfl.htco
         write(9,1025) iwtfl.wtco
 1 -- sys$degadis:trans2ss.for                  6-SEP-1989 18:36:57

-------
                                    D-205

          WRITEC9.*)  CHECK1,CHECK2,AGAIN,CHECKS,CHECK4,CHECKS
          WRITE(9,1070) ALPHA
  C
          CLOSE(UNIT=9)
  c
   1020   formatC2C1x,1pg14.7))
   1025   format(1x.i4,1x.1pg14.7>
   1030   format(3(1x,1pgH.7))
   1040   format(1xfi4)
   1050   format(2(a24,1x))
   1060   format(5(1x,1pg14.7})
   1070   formatOx,1pgU.7)
   1080   format(a3,1x)
  C
          RETURN
          END
####
  2 -• sys$degadis:trans2ss.for                  6-SEP-1989  18:36:57

-------
                                   D-206

C       FILE NAME TRANS3 FOR USE WITH DEGADIS3
C
C	
C
        SUBROUTINE TRANS(OPNRUP)
        Implicit Real*8 ( A-H, 0-Z ), Integer*4 ( I-N )

        include 'sys$degadis:DEGADlS3.dec/list'
C
        COMMON /SORT/TCc(maxnob,maxnt),TCcSTR(maxnob,maxnt),
     $  Tyc(maxnob,maxnt),Trho(maxnob,maxnt),
     $  Tganroa(maxnob,maxnt),Ttemp(maxnob,maxnt),
     $  TSY(maxnob,maxnt),TSZ(maxnob,maxnt),TB(maxnob,maxnt),
     $  TDISTO(maxrwb,maxnt ),TDIST(maxr>ob,maxnt ),KSUB(maxnt)
     $/SORTIN/TIM(fflaxnt),NTIM,ISTRT
     $/ITI/Tl.TINP.TSRC.TOBS.TSRT
C
        character*24 tinp,tsrc,tobs,tsrt
C
        character*(*) OPNRUP
C
        TO = TIM
-------
                                   D-207
c	
c
C       SUBROUTINE TRAP -• DIAGNOSTICS
C
        SUBROUTINE trap(N,N1)
        Implicit Real*8 ( A-H, 0-Z ), Integer*4 ( I-N )

        include 'sys$degadis:DEGADIS2.dec'
c
        COMMON /ITI/T1,TINP,TSRC,TOBS,TSRT

        real*4 tt1
c
        character*24 TINP,TSRC,TOBS,TSRT
c
        character*24 tt
        character*80 dd
C
        URITE(lunlog,1100)
        WRITEClunlog.1110)
        urite(lunlog,1115) n
c
c*** check to see if the operator is ready to read the text of the error
c*** message
c
        write(lunlog,1000)
        irtn = lib$get_command( dd )    ! get a line from the terminal
 10     uriteUunlog,1002)
C
        IF(N .EQ. 1 ) then
                        URITE(lunlog,2010) N1
                        URITE(lunlog,2011>
        else IF(N .EQ. 2 ) then
                        WRITE(lunlog,2020)
        else IF(N .EQ. 3 ) then
                        URITEUunlog,2030) N1
        else IF(N .EQ. 4 ) then
                        WRITEUunlog,2040)
        else IF(N .EQ. 5 ) then
                        WRITE(lunlog,2050)
        else IF(N .EQ. 6 ) then
                        URITE(lunlog,2060)
        else IF(N .EQ. 7 ) then
                        WRITE
-------
                                 D-208

                       WRITE(lunlog,2091)
       else IF(N .EQ.  10)  then
                       WRITE(lunlog,2100)  M1
                       URITE(lunlog,2101)
       endif
       IF(N .EQ. 11) WRITE(lunlog,2110)
       IF(N .EQ. 12) URITEClunlog.2120)
       IF(N .EQ. 13) WRITE(Lunlog,2130)
       IF(N .EQ. 14) WRITE(lunlog,2UO)
       IF(N .EQ. 15) URITEUunlog,2150)
       IF(N .EQ. 16) WRITE(lunlog,2160)
       IF(N .EQ. 17) URITE(lunlog,2170)
       IF(N .EQ. 18) then
                       WRITE(lunlog,2180) N1
                       URITE(lunlog,2181)
       endif
       IF(N .EQ. 19) URITE(lunlog,2190)  N1
       IF(N .EQ. 20) URITEUunlog.2200)
       IF(N .EQ. 21) URITE(luntog,2210)
       IF(N .EQ. 22) URITE(lunlog.2220)
       IF(N .EQ. 23) then
                       URITE(lunlog,2230) maxnob
                       URITE(lunlog,2231)
       endif
       IF(N .EQ. 24) URITE(lunlog,2240)
       IF(N .EQ. 25) WRITE(lunlog,2250)
       IF(N .EQ. 26) WRITE(lunlog,2260)
       IF(N .EQ. 27) WRITE(lunLog,2270)
       IF(N .EQ. 28) URITE(lunlog,2280)
       IF(N .EQ. 29) URITEdunlog.2290)
       IF(N .EQ. 30) URITE(lunlog,2300)
       IF(N .EQ. 31) URITE(luntog,2310)
       IF(N .EQ. 32) WRITE(lunlog,2320)
       IF(N .EQ. 33) URITE(tunlog,2330)

 1000   formate/,5x,'Ready  for the text  of the error message?   ',$)
 1002   format(/)
 1100   FORMAT(5X,1The  best  laid plans of mice and men...1)
 1110   FORMAT<5X,'You  have  entered a TRAP -- the land of no RETURN.'}
 1115   formate Code:  ',i4)

 2010   FORMAT(5X,'DEGADIS1? Source integration has returned IHLF=',I3,/,
     ./,'     This error occurs during integration of the equations1,/,
     .' which describe  the  gas source.   IHLF  is an error code1,/,
     .' returned by  the integration package  RKGST.1,//,
     .'      When IHLF=11, more than 10 bisections of the initial1,/,
     .' increment of the independent variable were necessary to make1,/,
     .' an integration  step within the specified error.  Reduce the1,/,
     .'  initial step size  of the  independent variable',/,
     .' (STPIN  in  the ER1  file).   If this  does  not work,1,/,
     .'  it will be  necessary to either increase the error criteria1,/,
2 -- sysSdegadis:trap.for
6-SEP-1989 18:37:53

-------
                                  D-209

     .' for all of the dependent variables being integrated1,/,
     .' (ERBND in the ER1 file) or increase the error criteria1,/,
     .' for the variable violating the criteria by decreasing the1,/,
     .' error weight for that variable (one of the following: UTRG,',/,
     .' UTTM, WTYA, UTYC, WTEB, UTHB, or WTUH in the ER1 file).1,/)
2011   formate
     .'     When IHLF=12, the initial increment of the  independent1,/,
     .' variable (STPIN) is 0.  Correct the ER1 file and execute the1,/,
     .' program again.1,//.
     .'     When IHLF=13, the initial increment of the  independent1,/,
     .' variable (STPIN) is not the same  sign as the difference1,/,
     .' between the upper bound of the interval and the lower bound1,/,
     .' of  the interval.  STPIN must be positive.  Correct the ER11,/,
     .' file and execute the program again.1,//)

2020  FORMAT(5X,'Reserved•)

2030  format(5x,'SZF? Local  integration failed;  IHLF=',I3,/,
     ./,'      This error occurs during estimation  of SZ over the1,/,
     .' source when  no gas  is present.   IHLF  is an error  code1,/,
     .' returned  by  the integration package RKGST.1,//,
     .'      When  IHLF=11, more  than  10 bisections  of the  initial1,/,
     .'  increment  of  the  independent variable were necessary to  make1,/,
     .' an integration step within the specified  error.  Reduce  the1,/,
     .'  initial  step size  of the independent  variable1,/,
     .'  (SZSTPO  in the ER1  file).   If  this does not  work,1,/,
     .'  increase  the error  criteria  for  all of the dependent1,/,
     .' variables being integrated (SZERR in  the  ER1 file).1,//,
     .'      When IHLF=12,  the initial  increment of the independent1,/,
     .' variable (SZSTPO)  is 0.   Correct the  ER1  file  and execute the1,/,
     .'  program again.',//,
     .'      When IHLF=13,  the initial  increment of the independent1,/,
     .'  variable (SZSTPO)  is not the same sign as the  difference1,/,
     .'  between the upper bound of the interval and the lower bound1,/,
     .'  of the interval.   SZSTPO must  be positive.  Correct  the ER11,/,
     .'  file and execute the program again.1,//)

 2040   format(5x,'SURFACE? Negative ORTE for positive OELTA_T',//,
     .'      This  is  a diagnostic message indicating  an error in',/,
     .'  estimation of the heat  capacity.   Check the input',/,
     .'  to the model  and execute the program again.',//)

 2050   FORMAT(5X/CRFG? MORE  POINTS  FOR GEN3 WERE NEEDED1,//,
     .'      The COMMON area /GEN3/ stores representative values',/,
     .'  of the calculated  source parameters.   If  this  message',/,
     .'  occurs,  relax the  CRFG  error  criteria (CRFGER) in the',/,
     .' ER1 file.   If this  is  a common problem,  the  length of the',/,
     .' /GEN3/ vectors can be increased  by changing  the value of1,/,
     .' HAXL in DEGADIS1.DEC and reinstalling DEGADIS.',//)

 2060   FORMAT(5X,'TUPF?  OBSERVER CALCULATIONS --  TUPF FAILED1,//,

3 -- sys$degadis:trap.for                       6-SEP-1989 18:37:53

-------
                                 D-210

    .'     The trial and error search associated with finding the1,/,
    .' upwind edge of the gas source for an observer failed.1,/,
    .' Often, this problem can be avoided by adding one or two1,/,
    .' additional observers to the present number of observers',/,
    .' (which changes the conditions for the trial and error).1,/,
    .' Another possibility is to increase the error criteria for1,/,
    .' this function (ERTUPF) in the ER2 file.1,//)

2070   FORMAT(5X,'TUPF? OBSERVER CALCULATIONS -- TDNF FAILED1,//,
    .'     The trial and error search associated with finding the1,/,
    .' downwind edge of the gas source for an observer failed.1,/,
    .' Often, this problem can be avoided by adding one or two1,/,
    .' additional observers to the present number of observers1,/,
    .' (which changes the conditions for the trial and error).1,/,
    .' Another possibility is to increase the error criteria for1,/,
    .' this function (ERTDNF) in the ER2 file.1,//)

2080   FORMAT(SX.'SSSUP? OBSERVER INTEGRATION FAILED, IHLF*',I3,//,
    .'     This error occurs during  integration of the five1,/,
     .' differential equations which  average the source for each1,/,
     .' observer.  IHLF  is an error code returned by the',/,
     .' integration  package RKGST.',//,
     .'     When  IHLF=11, more than 10 bisections of the initial',/,
     .' increment  of the independent  variable were necessary to  make',/,
     .' an  integration step within the specified error.  Reduce  the',/,
     .' initial step size of  the  independent variable1,/,
     .' (STPO in  the ER2 file).   If this does not  work,',/,
     .' it  will be necessary  to either increase  the error  criteria',/,
     .' for all of the dependent  variables being  integrated1,/,
     .' (ERRO in  the ER2 file) or increase the error  criteria',/,
     .' for the variable violating  the criteria  by decreasing the1,/,
     .' error weight for that variable (one of the following: WTAIO,',/,
     .' WTOOO, or WTSZO in  the ER2  file).',/)
 2081   format(
     .'     When  IHLF*12, the initial increment  of the independent',/,
     .' variable  (STPO)  is  0.  Correct the ER2 file and execute the',/,
     .' program again.',//,
     .'     When  IHLF-13, the initial increment  of the independent1,/,
     .' variable  (STPO) is  not the same  sign as  the difference',/,
     .' between the upper bound of  the interval  and the lower bound',/,
     .' of the interval.  STPO must be positive.   Correct  the ER2',/,
     .'  file  and  execute the program again.',//)

 2090   FORMAT(SX,'SSSUP/SDEGADIS2? PSEUDO-STEADY INTEG FAILED,  IHLF*',13,
     .//,'      This error occurs during  integration of the four1,/,
     .' differential equations describing the portion of the',/,
     .' downwind  calculation when b>0.   The routine calling TRAP is1,/,
     .i  SSSUP if  a transient simulation  is being executed; if a1,/,
     .'  steady state simulation is  being executed, the calling',/,
     .'  routine is SDEGADIS2.  IHLF is an error  code returned by the',/,
     .'  integration package RKGST.',//,

4 -- sys$degadis:trap.for                     6-SEP-1989 18:37:53

-------
                                  D-211

     .'     When  IHLF-11, more than 10 bisections of the initial1,/,
     .'  increment of the  independent variable were necessary to make1,/,
     .'  an  integration step within the specified error.  Reduce the1,/,
     .'  initial step size of the  independent variable1,/,
     .<  (STPP  in  the ER2  file).   If this does not work,1,/,
     .'  it  will be necessary to either increase the error criteria1,/,
     .'  for all of the dependent  variables being integrated1,/,
     .'  (ERRP  in  the ER2  file) or increase the error criteria1,/,
     .'  for the variable  violating the criteria by decreasing the1,/,
     .'  error  weight for  that variable (one of the following: WTSZP,',/,
     .'  UTSYP, UTBEP, or  UTDH in  the ER2 file).1,/)
2091    formate
     .'     When  IHLF*12, the initial increment of the  independent1,/,
     .'  variable  (STPP) is 0.  Correct the ER2 file and execute the1,/,
     .'  program again.1,//,
     .'     When  IHLF=13, the initial increment of the  independent1,/,
     .'  variable  (STPP) is not the same sign as the difference1,/,
     .'  between the upper bound of the interval and the lower bound1,/,
     .'  of  the interval.  STPP must be positive.  Correct the ER2',/,
     .'  file and  execute  the program again.1,//)

2100   FORMAT(SX.'SSSUP/SDEGADIS2? GAUSSIAN INTEGRATION FAIL,  IHLF=',I3,
     •//,'     This error occurs  during  integration of  the1,/,
     .'  differential equations describing the portion of the1,/,   .
     .'  downwind  calculation when b=0.  The routine calling TRAP  is1,/,
     .i  SSSUP  if  a  transient simulation  is being executed;  if a1,/,
     .'  steady state simulation  is being  executed, the  calling1,/,
     .'  routine  is  SDEGADIS2.   IHLF  is an error code  returned by  the1,/,
     .'  integration package RKGST.1,//,
     .'     When  IHLF=11, more  than  10 bisections of  the  initial1,/,
     .'  increment of  the  independent variable were necessary  to make1,/,
     .'  an integration step within the specified error.   Reduce the1,/,
     .'  initial  step  size of  the independent variable',/,
     .'  (STPG  in  the  ER2  file).   If  this does not work,',/,
     .'  it will be necessary  to either  increase the error criteria1,/,
     .<  for all  of the dependent variables  being  integrated1,/,
     .'  (ERRG  in  the  ER2  file)  or increase  the  error  criteria1,/,
     .'  for the variable violating  the  criteria by decreasing the1,/,
     .'  error  weight  for  that  variable  (either  WTRUH  or WTDHG',/,
     .'  in the ER2 file).1,//)
 2101   format(
     .'      When  IHLF=12, the initial  increment of  the independent1,/,
     .'  variable (STPG) is 0.   Correct  the  ER2  file  and execute the1,/,
     .'  program again.',//,
     .'      When IHLF=13, the initial  increment of  the independent1,/,
     .'  variable (STPG) is not  the same sign as the  difference1,/,
     .'  between the upper bound of  the  interval  and  the lower bound1,/,
     .'  of the interval.   STPG  must  be  positive.   Correct the ER21,/,
     .'  file and  execute  the  program again.1,//)

 2110   FORMAT(5X,'SSSUP/SDEGADIS2?  TOTAL No. OF  RECORDS  EXCEED 120000',

5  -- sysSdegadis:trap.for                      6-SEP-1989 18:37:53

-------
                                  D-212
    .//,'     This is an arbitrary stopping point for the process1,/,
    .' in order to keep a runaway simulation from filling up disk1,/,
    .' space.  Relax the output specifications (OOLP, ODLLP, OOLG,1,/,
    .' or ODLLG) in the ER2 file in order to generate less output1,/,
    .' if the input parameters are valid.1,//)

2120   FORMAT(5X,1Reserved1)
2130   FORMAT(5X.' Reserved')
2140   FORMAT(5X,'Reserved')
2150   FORMATC5X,'Reserved')

2160   FORMAT(5X.'PSSOUT/PSSOUTSS? PSS STARTED WITH B<0.',//,
    .'     This condition is checked at the beginning of the1,/,
    .' downwind calculation in order to confirm proper handling of1,/,
    .' the movement to the Gaussian phase of the downwind ',/,
    .' calculation.  Check the initial conditions and execute the1,/,
    .' program again.1,//)

2170   format(5x,'TPROP/ADDHEAT? Enthalpy out of bounds',//,
    .'     Diagnostic message indicates an enthalpy  lower1,/,
    .' than  the adiabatic mixing enthalpy was passed to ADDHEAT.1,/,
    .' Check the input conditions and execute the program again.1,//)

2180   FORMAT(5X,-ALPH? ALPHA INTEGRATION FAILED, IHIF=',I3,//,
     .'     The integration which determines the integral least1,/,
     .' squares fit for ALPHA has failed.  Note that  small values1,/,
     .' of the Honin-Obukhov length ( ML < 0(1m> ) in combination',/,
     .' with  stable atmospheric conditions may cause  this failure.',/,
     .' IHLF  is an error code returned by the integration package1,/,
     .' RKGST.',//,
     .'     When  IHLFall. more than 10 bisections of  the  initial1,/,
     .' increment of  the  independent variable were necessary to make1,/,
     .' an  integration step within the specified error.   Reduce the1,/,
     .' absolute  value of the  initial step size of the  independent1,/,
     .' variable  (STPINZ  in the ER1 file).   If this does  not work,',/,
     .' it  will be  necessary to  increase  the error criteria1,/,
     .' (ERBNDZ  in  the ER1  file).1,//)
 2181   format(
     .'     When IHLF=12, the  initial  increment of the  independent',/,
     .' variable (STPINZ)  is 0.  Correct the ER1 file  and execute'./,
     .' the program again.',//,
     .'      When IHLF=13,  the  initial  increment of the  independent',/,
     .i variable (STPINZ)  is not  the  same sign as the difference1,/,
     .' between the upper bound of  the interval and  the lower bound',/,
     .' of  the interval.   STPINZ must be  negative.   Correct the ER11,/,
     .'  file and execute the program again.   This error will also',/,
     .'  occur if the surface roughness ZR is greater than the',/,
      .'  reference height ZO.',//)

 2190   FORMAT(5X,'ALPH? ZBRENT has failed to locate ALPHA IERR: ',I4,//,
      .'      The search procedure which determines ALPHA has failed.1,/,

6 -- sys$degadis:trap.for                      6-SEP-1989 18:37:53

-------
                                 D-213

    .' This error may be the result of an unusual velocity',/,
    .' specification such as small values of the Monin-Obukvov',/,
    .' length ( ML < 0(1.m) ) or small reference heights1,/,
    .' ( ZO < 0(10. * ML) ).  IERR is an error code returned by1,/,
    .' the routine ZBRENT.',//,
    .'     When IERR=1, the search for ALPHA failed after a1,/,
    .' specified number of iterations. Increase the error bound1,/,
    .' used by ZBRENT (EPS in ER1 file).1,//,
    .'     When 1ERR=2, the basic assumption that the function which1,/,
    .' governs the search for ALPHA changes sign over the specified1,/,
    .' interval is false.  Increase the search interval by1,/,
    .' decreasing the  lower bound of ALPHA (XLI  in the ER1  file)',/,
    .' and  increasing the upper bound (XRI in the ER1 file).',//)

 2200   format(5x,'ESTRT? Premature EOF  in RUN_NAME.ER1 or RUN_NAME.ER2.'
    .,//,'       The portion of the program which reads ER1 and1,/,
    .' ER2  files encountered an end-of-file mark before all of1,/,
    .' the  information had been read.  Confirm these files  and',/,
    .' execute the program again.  If necessary, copy and edit1,/,
    .' the  appropriate EXAMPLE file and execute  the program again.1,//)

 2210   FORMAT(5X,'ESTRT1/ESTRT2/ESTRT2SS/ESTRT3? DECODE failed1,//,
    .'      The portion of the program which reads the ER1,  ER2,1,/,
    .' or the ER3 file failed to understand a numerical entry.',/,
    .' The  numbers must appear in columns 11-20  of the line with',/,
     .' no alphabetic characters in the  field.  (Note that',/,
     .' exponential notation  is not allowed.)  This restriction',/,
     .' does not apply  to comment  lines which have an exclamation',/,
     .' point (!)  in the first column.1,//)

 2220   format(Sx.'ESTRTI? The parameter file RUN_NAME.ER1  ',
     .'was not found.',//,
     .'      The ER1 file was not  found  for the current simualtion1,/,
     .' (RUN_NAME).  Copy the file EXAMPLE.ER1 file to RUN_NAME.ER1',/,
     .' and  edit  it as  necessary.  Execute the program again.1,//)

 2230   format(5x,'SORTS1?  Fewer than 3  points sorted for any  time.',//,
     .'      Only one or two simualtion points were applicable  for',/,
     .' the  sort times  specified.  There are three possible  causes',/,
     .' for  this condition:',//,
     .'      (1)  If  this message appears  when the  sort times  are',/,
     .' defaulted  (CHECKS  is  set to 0.  in  the ER3 file),  the1,/,
     .' number  of  observers will probably  have to be  increased',/,
     .'  to give a  good  resolution  of  the downwind concentration',/,
     .'  field.   (The number of  observers is  NOBS  in  the  ER2  file',/,
     .' with a  maximum of  ',13,'  (MAXNOB)  in DEGADIS2.DEC.)',/,
     .' As a rule of  thumb, one gets  good  resolution  of  the  downwind1,/,
     .'  concentration field if  the ratio:1,/,
     .'  (secondary source duration /  number  of observers)  is less1,/,
     .'  than about 10  seconds (or  20  at  most).',//,
     .'      (2)  The sort  times  specified in  the  ER3  file were1,/,

7 -- sys$degadis:trap.for                      6-SEP-1989 18:37:53

-------
                                 D-214

    . '  before the simulation had developed significantly.1,/,
    .'  This is only applicable when the user is specifying the sort1,/,
    .'  times (i.e. when CHECKS is set to 1. in the ER3 file).1,/,
    .'  Increase the time of the first sort (ERT1), and rerun the1,/,
    .'  program.',/)
2231   formate
    . '      (3) The sort times specified in the ER3 file were1,/,
    . '  after the gas was below the lowest concentration of interest1,/,
    . '  This is only applicable when the user is specifying the sort1,/,
    .'  times (i.e. when CHECKS is set to 1. in the ER3 file).1,/,
    . '  Increase the time of the first sort (ERT1), and rerun the1,/,
    . '  program.  If additional results are desired for later1,/,
    . '  times, restart the simulation and specify a lower1,/,
    .'  concentration of interest in the input step ( lower1,/,
    . '  CCLOW in DEGADISIN).',//,
    . '      (4) The downwind distance specified in DEGADIS4 is too1,/,
    .' -large for the lowest concentration of interest specified.  To1,/,
    .' get a time history at  this downwind distance, restart the',/,
    . ' simulation with a lower concentration of interest  in  the input.1,
2240   format(5x, 'TPROP? Trial and error  loop compromised1,//,
    .'      TPROP  estimates the temperature of a mixture based1,/,
    . ' upon the composition and enthalpy  of the mixture.  Ensure',/,
    .' the  properties for the diffusing species are entered',/,
    . ' correctly  and execute the simulation again.1,//)

2250   format(Sx, 'TPROP? Isothermal density loop compromised',//,
    .'      This error should never occur, but if it does, rebuild',/,
    .' the  model  from the original files  and run the simulation1,/,
    .' over.',//)

2260   format(5x, 'TPROP? Invalid entry flag in AOIABAT',//,
    .'      This is a programming diagnostic and should never occur.',/,
    .' If  it does, rebuild the model from the original files.1,//)

2270   format(5x,' Reserved1)

2280   format(5x, 'TPROP? IGEN request too large in SETDEN',//,
    .'      The subroutine SETDEN (in TPROP) performs a series of1,/,
    .' adiabatic  mixing calculations with a specified gas mixture1,/,
    .' and ambient air  and places the result  in the array',/,
    . ' OEN(5,IGEN).  This error  indicates more points are needed in1,/,
    .' OEM than were originally  requested.  Increase the allocation1,/,
     .' for DEN by changing the value of  IGEN  in DEGADISIN. DEC and1,/,
     . '  reinstalling  DEGADIS.',//)

 2290    format(5x, 'PHIF? flag IPHIFL  is  out  of bounds1,//,
     . '      Proper values  of  IPHIFL  are  integers between 1 and 5 ',/,
     .'  inclusive. Although  values  of  IPHIFL  are  entered in the ER11,/,
     .'  file as real  numbers,  they should be in this  range.   Check',/,

8 -- sys$degadis:trap.for                      6-SEP-1989 18:37:53

-------
                                  D-215


     .' the ER1 file and execute the program again.1,//)

2300  format(5x,'SSSUP/SDEGADIS2? concentration greater than RHOE',//,
     .'     If the concentration of the contaminant becomes1,/,
     .' greater than the pure component density for an  isothermal1,/,
     .' simulation, this error Mill occur.  However, this situation1,/,
     .' should never occur.  Check the input conditions and execute1,/,
     .' the program again.1,//)

2310  format(5x,'SSSUP?  concentration greater than RHOE',//,
     .'     If the concentration of the contaminant becomes1,/,
     .' greater than the pure component density for an  isothermal1,/,
     .' simulation, this error will occur.  However, this situation1,/,
     .' should never occur.  Check the input conditions and execute1,/,
     .' the program again.1,//)

2320  formatCSx.'PSS? Sz convergence failure.',//,
     .'     This  is a  programming diagnostic and  should never occur.',/,
     .'  If it does, check  the  input conditions and execute the',/.
     .' program again.',//)

 2330   formatCSx,'SSG? Sz convergence failure.1,//,
     .'     This  is  a  programming  diagnostic and  should never occur.1,/,
     .'  If it does,  check  the  input conditions and execute the',/,
     .'  program again.',//)
C
        CLOSE(UNIT=9)
C
c  CALL TRANSC'trap.DBG')  - this  isn't really needed
C
        istat * lib$date_time(TT)
        tt1  » t1
        ttime = secnds(tt1)/60.
C
  140  URITE(lunlog,3000) TT
       URITE(lunlog,3010) Ttime
 3000   FORMAT(1X,1  -- ENDing  AT ',A24)
 3010   FORMAT(5X,' *****  ELAPSED  TIME *****  ',1pg13.5,'  MIN  ')
C
        irtn  =  LIB$00_COMMAND(  'Exit'  )  !  this issues  the command EXIT to VMS
c                                        !  which should cancel any pending
c                                        !  programs in  a command  file.
        CALL  EXIT
       END
9 -- sys$degadis:trap.for                      6-SEP-1989 18:37:53

-------
                                  D-216
c	
c
C       FUNCTION TO CALCULATE A SPECIFIED  TIME
C
        FUNCTION TS(TOl.DIST)
C

        Implicit Real*8 ( A-H, 0-Z ),  Integer*4 (  I-N  )

        COMMON
     S/PARMSC/RM,SZM,EMAX,RMAX,TSC1,ALEPH,TEND
     $/ALP/ALPHA,alpha1
C
        TS = TOl + (DIST«-RMAX)**(1./ALPHA1) /ALEPH
C
        RETURN
        END
 1 -- sys$degadis:ts.for                        6-SEP-1989 18:43:07

-------
                                  D-217

c	
c
C       OBSERVER TRIAL AND ERROR FUNCTIONS
C         •-• TUPF 	 TDNF •-•
C
c       Modified 30 Jan 86 for more general trial and error scheme, ts
C
        FUNCTION TUPF(TOL)
C
        Implicit Real*8 ( A-H, 0-Z ), Integer*4 < I-N )

        include 'sys$degadis:DEGADIS2.dec'
c
        COMMON
     S/GEN3/ radg(2,maxl),qstr(2,maxl),srcden(2,maxl),srcHc(2,maxl),
     $ srcwa(2,maxl)lsrcenth(2,maxl)
     S/ERROR/SYOER,ERRO,SZOER,WTAI0,WTQOO,WTSZO,ERRP,SMXP,
     $ UTSZP,UTSYPtWTBEP.WTDH,ERRG,SMXG,ERTDNF,ERTUPFfWTRUH,WTDHG
     S/PARMSC/RM, SZM, EMAX, RHAX, TSC1. ALEPH, TEND
     S/ALP/ALPHA,alpha!
C
        LOGICAL pflag           ! for diagnostic output
        pflag = .false.
C
        TMAX = RMAX**(1./ALPHA1)/ALEPH + TOL
        TMIN = TOL
        IFCTOL  .LT. 0.) TMIN =  0.
c
c*** TMIN and TMAX  represent the  first and  last  time this observer  could
c*** encounter  the  upwind edge  of the source.  TMAX  is the time when  the
c*** observer passes  over x=0,  and TMIN  is  the time  the observer  is
c*** released (unless set to zero because  the spill  has not yet begun).
c*** Now, refine  the  guess  of TMIN and TMAX by dividing the interval
c*** into 20 segments and checking  if the  observer crosses the upwind
c*** edge over  the  smaller  interval  starting with TMIN.
c
        DT  = 
-------
                                  D-218

        DIFATHAX = DIP
  20    CONTINUE
c
c*** Now perform bisection search to get desired convergence  between new TMAX
c*** and THIN
c
        TL = (TMAX + TMIN)/2.
C
        DO 100 I = 1,20
        II - 0
  110   XG - -AFGEN(RADG,TL.'tUpf)
        XO « XIT(TL.TOL)
        IF(XO .LT. 0.) GO TO 120
        TL = (TL+TMIN)/2.
        II = II + 1
        if(pftag) write(6,5020) tl,tOl,xg,xo
 5020   formate tl:',1pg13.5.' tOl:',1pg13.5,'  xg:',1pg13.5,
        1 ' xo:',1pg13.5)
        IFCII.EQ. 20) GOTO 101  I Kilt the program.
        GO TO 110
C
  120   CONTINUE
        DIF = XO - XG
        sum = abs(xo + xg)/2. + ERTUPF
        IF(ABS(DIF)/sum  .LT. ERTUPF) GO TO 1000
        if(pflag) write(6,5040) tmin,tmax,tl,xo,xg
 5040   formate tmin:',1pg13.5,• tmax:'.1pg13.5,' tl:',1pg13.5,
        1  ' xo:',1pg13.5,' xg:'.1pg13.5)
C
        IF( DIF*DIFATMAX .GT. 0.) THEN
                TMAX * TL                ! a new maximum for the range
                DIFATMAX = DIF           ! a new DIF for the maximum
        ELSE
                TMIN - TL                ! a new minimum for the range
        END IF
C
   100   TL  *  (TMAX + TMIN)/2.
C
c*** The  above search  scheme failed.   Before  killing  the program, check  to
c*** see  if the desired  point falls on a transition from a blanket  to a
c*** non-blanket  situation.
c
         t1  =  TL+.01
         T2 =  TL-.01
         XG1  = AFGEN(RADG,T1,'tupf')
         xg2 = AFGEN(RADG,T2,ltupf)
         dif = abs(xg1-xg2)
         if(dif.gt. 100.  .AND. (XO.GE.XG2 .AND.  XO.LE.XG1}) then
                 tupf = t2       !  jump from blanket to non-blanket  occured
                 RETURN
                 END IF

 2  -- sysSdegadis:tupf.for                      6-SEP-1989 18:43:16

-------
                                  D-219

c
c*** Kill the program.
c
 101    if(pflag) write(6,4000) RM,SZM,EMAX,RMAX,TSC1,ALEPH,TEND,alpha
 4000   formate rm:',1pg13.5.' szm:',1pg13.5,' emax: '.1pg13.5,/,
        1 « rmax:Mpg13.5f' tsc1:',1pg13.5,' aleph:',1pg13.5./f
        2 ' tend:',1pg13.5,' alpha:',1pg13.5)
        if(pflag) write(6,4010) tmax.tmin
 4010   formate tmax: 'JpglS.S,1 tmin: ',1pg13.5)
                CALL trap(6)
C
c*** successful completion
c
 1000   TUPF = TL
        RETURN
        END
C
c
c
c
        FUNCTION TDNF(TOL)
C

        Implicit Real*8 ( A-H, 0-Z ), Integer*4 C I-N )

        include  'sys$degadis:DEGADlS2.dec'
c
        COMMON
     S/GEN3/ r8dg(2fmaxl),qstr(2,maxl)fsrcden(2,maxl),srcwc(2,maxl),
     $ srcwa(2,maxl),srcenth(2,maxl)
     $/ERROR/SYOER,ERRO,SZOER,WTAIO,UTaOO,UTSZO,ERRP,SMXP,
     $ WTSZP,WTSYP,WTBEP,UTDH,ERRG,SMXG,ERTDNF,ERTUPF,UTRUH,UTDHG
     S/PARMSC/RH,SZM,EMAX,RMAX,TSC1,ALEPH,TEND
     $/ALP/ALPHA,alpha1
C
        LOGICAL  pflag
        pflag a  .FALSE.
C
        TMIN » RMAX**(1./ALPHA1)/ALEPH  + TOL
         IF(TMIN  .LT. 0.) TMIN  = 0.
        TMAX =  (2.*RMAX)**(1./ALPHA1)/ALEPH +  TOL
c
c*** TMIN and TMAX  represent  the  first  and  last time this observer  could
c*** encounter  the  downwind edge  of  the source.  TMAX is the  time when  the
c*** observer passes  over x=-t-RMAX, and  TMIN  is the  time the observer
c*** passes  over x-0  (unless  set  to  zero because the spill  has  not  begun
c*** yet).   Now, refine  the guess of  TMIN and  TMAX  by dividing  the  interval
c***  into  20 segments  and checking if the observer  crosses  the  downwind
c*** edge  over  the  smaller  interval  starting from TMAX.
c
        DT = (TMAX  -  TMIN)  /  20.

3  -- sys$degadis:tupf.for                      6-SEP-1989 18:43:16

-------
                                D-220

        TL  = THAX
        if(pflag)  write(6.*)  'tmax, tmin, dt:  '.tmax, tmin, dt

        DO  10 1=1,19    !  I don't have to check the  last interval.
        TL  = TL  -  OT
        XO  = XIT(TL, TOL)
        XG  = AFGEN(RADG, TL,  'tupf')
        OIF = XO - XG
        if(pflag)  nrite(6,*)  'tl, xo, xg, difr'.tl,  xo, xg, dif
        IF(DIF .GT. 0.)  GOTO  10 ! observer  has passed the downwind edge
                TMIN = TL        ! now observer is  about to  reach downwind  edge
                TMAX * TL  + DT
                GOTO 20
  10    CONTINUE
C
        TMAX * TMIN + DT
  20    CONTINUE
        XO = XITCTMAX, TOL)
        XG * AFGENCRADG, TMAX, 'tupf')
        DIFATMAX = XO -  XG
        if(pflag) then
                write<6,*) '20: tmax, tmin: '.tmax,  tmin
                write(6,*) 'difatmax:  '.difatmax
        endif
C
c*** Now perform bisection search  to get desired convergence  between new TMAX
c*** and TMIN.
c
        TL = (TMAX + TMIN)/2.
C
       .DO 100 1-1,20
        11=0
  110   XG = AFGEN(RADG, TL,  'tdnf')
        XO * XIT(TL.TOL)
C
        IFCXO .GT. 0.) GO TO 120
        TL = (TMAX + TD/2.
        II * II +  1
        if(pflag) write(6,5020) tl.tOl,xg,xo
 5020   formate  tl:',1pg13.5,' tOl:',1pg13.5,'  xg:',1pg13.5,
        1  ' xo:',1pg13.5)
        IF(II.EQ.  20) GOTO 101  !  Kill  the program.
        GO TO 110
C
  120   CONTINUE
C
        DIF  = XO  -  XG
        sum = abs(xo+xg)/2.  +  ERTDNF
        IF(ABS(DIF)/sum .LT.  ERTDNF) GO TO 1000
        if(pflag) write(6,5040) tmin,tmax,tl,xo,xg
 5040   formate  tmin:',1pg13.5,' tmax:',1pg13.5,'  tl:',1pg13.5,

4  -- sys$degadis:tupf.for                     6-SEP-1989  18:43:16

-------
                                   D-221
        1 '  xo:',1pg13.5.'  xg:',1pg13.5)
C
        IF(  D1F*DIFATMAX -GT.  0.)  THEN
                TMAX = TL               ! a new  maximum for  the  range
                DIFATMAX = DIP          ! a new  DIF  for the  maximum
        ELSE
                THIN = TL               ! a new  minimum for  the  range
        END IF
C
  100   TL = (TMAX + TMIN)/2.
C
c*«* The above search scheme failed.  Before kilting the program,  check to
c*** See if the desired point falls on a transition from a blanket to  a
c*** non-blanket situation.
c
        t1 = TL+.01
        T2 = TL-.01
        XG1 = AFGENCRADG.TI.'tupf)
        xg2 = AFGEN(RADG,T2.'tupf)
        dif = abs(xg1-xg2>
         if(dif.gt.  100.  .AND. (XO.LE.XG2 .AND. XO.GE.XGD) then
                tdnf = t2       ! jump from blanket to non-blanket occured
                RETURN
                END IF
c
c*** Kill the program.
c
  101    if(pflag) write<6,4000) RM,SZM,EMAX,RMAX,TSC1,ALEPH,TEND,alpha
 4000    formate rm:',1pg13.5,' szm:',1pg13.5f'  emax:  ',1pg13.5,/,
         1 ' rmax:',1pg13.5.' tsd:',1pg13.5,' aleph:'.1pg13.5,/,
        2 • tend:',1pg13.5,' alpha:',1pg13.5)
         if(pflag) write(6,4010) tmax.tmin
 4010   formate tmax: 'f1pg13.5,' tmin: ',1pg13.5>
                CALL trap(7)
C
c*** successful completion
c
 1000   TDNF = TL
        RETURN
        END
 5  --  sys$degadis:tupf.for                      6-SEP-1989 18:43:16

-------
                                   D-222

c	
c
C       FUNCTIONS ASSOCIATED WITH THE OBSERVER CALCULATIONS
C
C	
C
C       FUNCTION TO RETURN OBSERVER VELOCITY AS A FUNCTION OF TIME
C
        FUNCTION UIT(T.TOl)
C

        Implicit Real*8 ( A-H, 0-Z ), Integer*4 ( I-N )

        COMMON
     S/PARMSC/RM,SZM,EMAX,RMAX,TSC1,ALEPH,TEND
     $/ALP/ALPHA,alpha1
C
        UIT  = ALPHA1 * ALEPH**ALPHA1 *(T-TOl)**ALPHA
C
        RETURN
        END
C
c
C	
C
C        FUNCTION  TO RETURN  POSITION  AS  A FUNCTION OF  TIME AND  TO
C
C
         FUNCTION  XIT(Tl,TOl)
         Implicit Real*8 ( A-H,  0-Z ),  Integer*4 (  I-N )

         COMMON
      S/PARMSC/RM,SZM,EMAX,RMAX.TSC1,ALEPH.TEND
      S/ALP/ALPHA,alpha!
 C
         xit * -rmax
         arg = tl-tOl
         if(arg .le. 0.) return
         XIT = (ALEPH*(Tl - TOI))**ALPHA1  •  RMAX
 C
         RETURN
         END
 c
 c
 c	
 c
 C
 C       FUNC TO RETURN A VALUE  OF TO BASED ON A POSITION AND TIME
 C

 1 -- sys$degadis:uit.for                       6-SEP-1989 18:45:28

-------
                                    D-223

          FUNCTION  TOOB(X,T)
  C

          Implicit  Reat*8  ( A-H, 0-Z ),  Integer** ( I-N )

          COMMON
       S/PARMSC/RM,SZM,EMAX,RMAX,TSC1,ALEPH.TEND
       $/ALP/ALPHA,alpha1
  C
          ARC = 0.
          CHECK = ABS((ABS(X)-ABS(RMAX)»/(ABS(X)+ABS(RMAX))
          IFCCHECK  .GT.  0.001)  ARC = (X  +  RMAX)**(1./ALPHA1)/ALEPH
          TOOB = T  -  ARC
          RETURN
          END
####
  2 -- sys$degadis:uit.for                       6-SEP-1989 18:45:28

-------
                                   D-224

        subroutine zbrentCanswer,  func,  x1,  x2,  tol,  ierr)
c
c... Function to determine the root of FUNC  which is  between X1  and X2
c       from Press et al., pg 253.  Note that the SIGN function  has
c       been used here to avoid underflows corrupting the programs
c       logic.
c
        implicit real*8(a-h,o-z).  integer*4(i-n)

        parameter (itmax=100, eps=3.D-8)

c
c... check the passed arguments for validity and set  up the procedure
c
        aaa = x1
        bbb = x2
        ierr = 0
        fa = func(aaa)
        fb = func(bbb)
        if(sign(1.DO,fa)*sign(1.DO,fb)  .gt.  0.00) then
           ierr * 2
           return
        endif

        fc =  fb

        do 11  iter = 1,itmax
 c
 c...  shuffle  A,B,C and  adjust  the bounding  interval D
 c
         if(sign(1.DO,fb)*sign(1.DO.fc)  .gt.  O.DO) then
            ccc  = aaa
            fc = fa
            ddd - bbb-aaa
            eee » ddd
         endif

         if(abs(fc)  .It. abs(fb))  then
            aaa  = bbb
            bbb = ccc
            ccc  - aaa
            fa = fb
            f b = fc
            fc = fa
         endif
 c
 c...  convergence check
 c
         toll  = 2.00*eps*abs(bbb)  + 0.5DO*tol
         xm =  0.5DO*(ccc-bbb)
         if(abs(xm).le.  toll  .or.  fb.eq.O.DO) then

 1  •-  sys$degadis:zbrent.for                    11-OCT-1989  18:56:26

-------
                                   D-225

            answer = bbb
            return
        end if
c
c... attempt inverse quadratic interpolation
c
        if(abs(eee).ge.tol1 .and. abs(fa).gt.absCfb))  then
            sss = fb/fa

            if(aaa.eq.ccc) then
                ppp = 2.DO*xm*sss
                qqq = 1.DO-sss
            else
                qqq = fa/fc
                rrr = fb/fc
                ppp = sss*(2.DO*xm*qqq*(qqq-rrr) -  (bbb-aaa)*(rrr-1.DO))
                                qqq = (qqq-1-DO)*
-------
                                   D-226

        else
                bbb = bbb+sign(tol1,xm)
        endif
        fb = func(bbb)
  11    continue
c
c... Loop failed to converge  the x  range
c
        ier = 1
        return
        end
 3 -- sys$degadis:zbrent.for                   11-OCT-1989 18:56:26

-------
                                   E-3

        PROGRAM DEGBRIDGE
C
c	
c
C       Program description:
C
C       DEGBRIDGE is designed to read the input file for the OOMS/DEGADIS
C       model input.  From this information and the output from the OOHS model,
C       DEGBRIDGE prepares the necessary input file to run DEGADIS
c       (RUN_NAME.INP).
C
c	
c
c       The structure of the RUNJIAME.IN file is outlined in OOMS_IN.
c
c       The output file from the OOMS model contains three (3) variables
c       as follows (in RUNJJAME.IND):
c
C           
C
c       where:
c
c            is the distance to the centerline touchdown (m)
c              is the centerline concentration at 
c          is jet/plume half width at 
c
c       To establish the initial conditions for DEGADIS, the source
c       concentration is assumed to be , and the source radius is assumed
c       to be .
C
c	-	-	
c
C       Program usage:
C
C       Consult Volume III of the Final Report to U. S. Coast Guard
C       contract DT-CG-23-80-C-20029 entitled "Development of an
C       Atmospheric Dispersion Model for Heavier-than-Air Gas Mixtures".
C
C       J. A. Havens
C       T. 0. Spicer
C
C       University of Arkansas
C       Department of Chemical Engineering
C       Fayetteville, AR 72701
C
C       April 1985
C
C
C       This project was sponsored by the U. S. Coast Guard and the  Gas
C       Research  Institute  under contract DT-CG-23-80-C-20029.
C

1  --  sysSdegadis:degbridge.for                 6-SEP-1989 20:02:37

-------
                                   E-4

c
C       Disclaimer:
C
C       This computer code material was prepared by the University of
C       Arkansas as an account of work sponsored by the U. S. Coast Guard
C       and the Gas Research Institute.  Neither the University of Arkansas,
C       nor any person acting on its behalf:
C
C       a.  Makes any warranty or representation, express or implied,
C           with respect to the accuracy, completeness, or usefulness
C           of the information contained in this computer code material,
C           or that the use of any apparatus, method, numerical model,
C           or process disclosed in this computer code material may not
C           infringe privately owned rights; or
C
C       b.  Assumes any liability with respect to the use of, or  for
C           damages resulting from the use of, any  information,
C           apparatus, method, or process disclosed in this  computer
C           code material.
C
C
(^»*»****»**»*«********««*****»*******»»**»****»»******»***»»*******»*»****»»
         Implicit Real*8 ( A-H,  0-Z ),  Integer*4 ( I-M )
         include >SYS$OEGADIS:degadisin.dec'
 c
         COMMON
      VTITL/ TITLE
      S/GEN1/ PTIME(igen),  ET(igen),  RIT(igen), PUC(igen),  PTEMP(igen),
      S       PFRACV(igen), PENTH(igen),  PRHO(igen)
      S/GEN2/ DEN(5,igen)
      S/ITI/ T1,TINP,TSRC,TOBS,TSRT
      S/PARM/ UO,20,ZR,rml,USTAR,vkc,gg,gRHOE,RHOA,DELTA,BETA,GAMMAF,
                 CcLOU
      S/com_gprop/ gasmw,ternjet,rhoe,cpk,cpp,gasul,gas11,z11,gasnam
      S/com_ss/ ess,slen,swid,outcc,outsz,outb>outl
      S/PHLAG/ CHECK1,CHECK2,AGAIN,CHECKS,CHECIC4,CHECKS
      $/com_sigx/ sigx_coeff,sigx_pow,sigx_min_dist,sigx_flag
      S/NEND/ POUNDN,POUND
      ./oomsin/ oodist.avtime
 C
         character*80 TITLE<4)
 C
         character*? gasnam

 2 -- sys$degadis:degbridge.for                 6-SEP-1989 20:02:37

-------
                                   E-5

        character*4 pound
        character*24 TSRC,TINP.TOBS,TSRT
C
        LOGICAL CHECK1.CHECK2,AGAIN,CHECKS,CHECKA.CHECKS
c
c check!
c check2=t      cloud type release with no liquid source;  SRC1   DEGADIS1
c again         local comnunicat ions in SSSUP                   SSSUP
c checks        local conmunicat ions between SRC1 and NOBL      DEGADIS1
c check4=t      steady state simulation                         DEGADISIN
c check5=t      operator sets sort parameters                   ESTRT3
c
        data CHECK1/.false./,CHECK2/.false./.AGAIN/.false./
        data CHECKS/.false./.CHECK4/.false./.CHECKS/.false./
C
        character*!00 OPNRUP
        character OPNRUPK100)
        equivalence  (opnrupUD.opnrup)
        character*4  in,ind,INP
        character*!00 dummy
        DATA POUND/'//   '/.POUNDN/-1.E-20/
C
        DATA PTIME/igen*O.DO/
        DATA ET/igen*O.DO/,R1T/igen*O.DO/
        DATA PWC/i gen*0.DO/,PTEMP/i gen*0.DO/
        DATA PFRACV/igen*O.DO/,PENTH/igen*O.DO/
        DATA PRHO/igen*O.DO/
        data DEM/i gen*0.,i gen*0.,i gen*0.,i gen*0.,i gen*0./

        DATA.INP/'.INP'/.IN/'.IN  '/,IND/'.IND1/
C
C
C...  GET  THE FILE NAME  TO BE USED BY ALL OF THE  ROUTINES	
C
        write(6,*)  'Beginning DEGBRIDGE...'

        READ(5,820)  NCHAR,opnrup
        opnrup = opnrup(1:nchar) //  ind(1:4)
C
C...  First, get the  desired  information from RUN_NAME.IND
C
        open(unit=8,name=opnrup,type='oId')
        read(8,*) oodist,  cc, hwidth
c
c...  If OODIST is zero, discontinue  the run
c
        if(oodist  .eq.  O.DO)  then
                write(6,*)  '    ...terminating the run since CCLOW  is met.1
                dummy = opnrupd :nchar)
                opnrup  =  opnrupd :nchar) //  ' .com_xxx;1'
                open(un i t=1,name=opnrup,type='unknown')

3  --  sys$degadis:degbridge.for                 6-SEP-1989 20:02:37

-------
                                   E-6

                opnrup = '$ copy '//oporup(1:nchar)//'.out  .lis1
                write(1,8020)  (opnrupKii i), iii=1,nchar+16)
                opnrup = '$ delete '//duimy(1:nchar)//l.coni_xxx;11
                wri te(1,8020)  (opnrup1(i i i),i i i=1,nchar+19)
                opnrup = '$ stop*
                wri te(1,8020)  (opnrup1(i i i),i i i =1,6)
                close(unit=1)
                opnrup = '81// dummydrnchar)  // '.com_xxx;1'//'  '
                istat * Itb$do_command(opnrup)
                write<6,«) ' 7DEGBR1DGE?  EXIT  failed  to work.1
                stop
        end if
        close(unit=8)
C
C... Now, get the desired information from RUN_NAME.IN
C
        opnrup = opnrupd:nchar) // in(1:4)
        open(unit=8,name=opnrup,type='old1)

        read(8,8000) titled)
        read(8,8000) title(Z)
        read(8,8000) title(3)
        read(8,8000) title(4)
        read(8,*) uO,  zO
        read(8.*) zr

        read(8,*) indvel,  istab, rml
c
c... Based on  INDVEL,  set  the Monin-Obukhov length as desired	
c
         if(  indvel.ne.1  .or.  indvel.ne.2) indvel = 1
         if(  istab.le.O .or. istab.gt.6) istab = 4
         ifd'ndvel  .eq. 1)  then
                 if(istab.eq.1)  then
                         rml = -11.43DO * zr**0.103DO
                 else if(istab.eq.2)  then
                         rml * -25.98DO * zr**0.171DO
                 else if(istab.eq.3)  then
                         rml = -123.4DO * zr**0.304DO
                 else if(istab.eq.4)  then
                         mil = O.ODO
                 else if(istab.eq.S)  then
                         rml « 123.4DO * zr**0.30400
                 else ifdstab.eq.6)  then
                         rml = 25.98DO * zr**0.171DO
                 end if
         endif

         read(8,*)  tamb,  pamb, reIhum

         if(  tamb.le.O. } tamb = tamb+273.15DO

 4  --  sys$degadis:degbridge.for                  6-SEP-1989 20:02:37

-------
                                   E-7

        if( pamb.gt.1.1 ) pamb = pamb/101325.DO
        if( relhum.lt.0. .or. relhum.gt.100.  )  reIhum = 50.
c
c... Calculate the absolute humidity HUMID
c
        vaporp = 6.02980-3* exp<5407.00*(1.DO/273.15DO - 1.00/tamb))
        sat = 0.622DO*vaporp/(pamb • vaporp)
        humid = relhum/100.00 * sat

        read(8,*> tsurf
        if( tsurf.It.250. > tsurf = tamb

        read(8,8010) gasnam
        read(8,*) gasmu
        read(8.*) avtime
        read(8,*) TEHJET
        read<8,*) gasul, gasll, zll
        if( gasll.le.O. ) gasll = 0.01
        if( gasul.le.gasll ) gasul = dmaxK  1.1DO*gasll, 1.0DO)

c
c... Now that AVTIME has been set, the value of DELTAY can be fixed.   Also
c       set the values of BETAY
c
        goto<161,162,163.164,165,166) istab
 161    timeav - dmaxH avtime, 18.4DO)                 ! A
        deltay = 0.42300*(timeav/600.DO)**0.2DO
        betay = 0.900
        sigx_coeff =0.02
        sigx_pow = 1.22
        sigx_min_dist  = 130.
        goto 170
 162    timeav = dmaxK avtime, 18.400)                 ! B
        deltay = 0.313DO*(timeav/600.DO)**0.2DO
        betay = 0.9DO
        sigx_coeff = 0.02
        sigx_pow =  1.22
        sigx_min_dist  -  130.
        goto 170
 163    timeav = dmaxK  avtime, 18.400)                  ! C
        deltay = 0.21000*
-------
                                   E-8

        sigx_min_dist = 100.
        goto 170
 165    timeav = dmaxK avtime,  11.4DO)                  !  E
        deltay = 0.102DO*(timeav/600.DO)**0.2DO
        betay = 0.900
        sigx_coeff = 0.17
        sigx_pow s 0.97
        sigx_min_dist = 50.
        goto 170
 166    timeav = dmaxK avtime,  4.600)                  !  F
        deltay = 0.067400*(timeav/600.DO)**0.2DO
        betay = 0.900
        sigx_coeff = 0.17
        sigx_pow * 0.97
        sigx_min_dist » 50.
C
 170    continue

c
c... Recover INDHT, CPK. and CPP.  If CPP is set to 0,  then  CPK contains.
c       the (constant) heat  capacity.
c
        read(8,*) indht, CPIC, cpp
        if(cpp .eq. 0.00) then
                cpp * 1.DO
                CPK > CPK*gasmw - 3.3304
        end if
c
c... recover NDEN and set ISOFL and DEN accordingly.
c
        read<8,*) nden
        if(nden -It. -1) nden=-1
        if(nden .eq. -1) then
                isofl » 1
                rhoe « panfc*101325.DO*gasim = 0.00
                den(3,1) = rhoa
                den(4,1) = O.DO
                den(5,1) = tamb
                den(1,2) - 1.DO
                den(2,2) = rhoe
                den(3,2) = rhoe
                den(4,2) = O.DO
                den(5,2) = tamb
                den(1,3) = 2.DO

 6 --  sys$degadis:degbridge.for                 6-SEP-1989 20:02:37

-------
                                   E-9
       else  if(nden  .eq. 0) then
                isofl = 0

                rhoe  = pamb*101325.DO*gasmw/8314.DO/TEMJET
                grhoe = rhoe
                phoa  = pamb*
                   (1.DO+humid)/(0.002833DO + 0.004553DO*humid)/tamb

                we  =  1.DO
                wa  =  O.DO
                enth  = cpc(temjet)*(temjet  - tamb)
                call  setden(wc,  wa,  enth)

        else
                isofl =  1

                do  iii =  1,nden
                read(8.*) dend.iii),  den(2,iii), den(3,iii)
                den<4,iii)  = 0.00
                den(5,iii)  - tamb
                enddo
                den(1,nden+1)  = 2.DO
                rhoe  = den(3,nden)
                grhoe =  rhoe
                rhoa  = den(3,1>
        endif

        ndenO = nden
        if(nden .eq.  -1)  ndenO = 2
        read<8,*> erate
        read(8,*) elejet,  01AJET
        read<8,*) tend
        checkA = .true.
        if(tend .gt. 0.) check4 * .false.

        read(8,*) distmx

        close(unit=8)

e
c... It is time to prepare the input file for DEGADIS.
c
        opnrup = opnrup(1:nchar) // inp(1:4)
        open(tnit=8,name=opnrup,type='new')
c
c... TITLE
C
        DO 200 1=1,4
        URITE(8,8000) TITLE(I)
7 -- sys$degadis:degbridge.for                 6-SEP-1989 20:02:37

-------
                                   E-10

  200   CONTINUE
C
c*** Atmospheric parameters:
c
        WRITE(8,1020) UO,ZO,ZR
C
c*** stability, averaging time for DELTAY, and derived parameters
c
        WRITE<8,1040) istab
        write<8,1020) oodist,avtime
        WRITE(8,1020) DELTAY,BETAy,rml
        WRITE(8,1020) sigx_coeff,sigx_pow,si3x_min_dist
c
c*** ambient pressure, temperatures, and humidity
c
        write(8,1025) tamb.pamb,humid
c
        ihtfl  = indht
        htco   - 0.
        iwtfI  * 0
        wtco   * o.
c
        write<8,1060)  isofl.tsurf
        write<8,1060)  ihtfl,htco
        write(8,1060)  iwtfI,wtco
C
c*** gas  characteristics
c
        write(8,8010)  gasnam
        URITE(8,1020)  gasmw,  temjet,rhoe
        write(8,1020)  cpk,cpp
        URITE(8,1020)  gasul.gasll.zll
 c
 c  density curve if isothermal
 c
         ifO'sofl .eq.  0} goto 460

        URITE(8,1040)  ndenO
        DO 440 I=1,ndenO
        WRITE(8,1025)  DEN(1,I),DEN(2,I),DEN(3,1),Den(4,I),den(5,i)
   440  CONTINUE
 C
 C
  460    cclow - (gasll/2.DO)  * pamb*101325.DO*gasmw/8314.DO/Tafnb
         WRITE(8,1010) CcLOW
 c
 c*** source description FOR A DILUTED SOURCE ...
 C
         call  adiabat(0,wc,wa,yc,ya,cc,rho,wm,enth,temp)
 c
         gmassO  =0.             ! no  initial cloud mass

 8  -- sys$degadis:degbridge.for                 6-SEP-1989 20:02:37

-------
                                  E-ll

        write(8,1020)  gmassO
        np = 4
c
        if(check4) tend = 60230.  !  [-] sec
c
        ess  - erate
        rlss = hwidth
        slen = 2.DO*hwidth
        swid = pi*Mss**2/slen/2.DO
        pwcd) = we
        ptempd) = temp
        pfracvd) = 1.0
c
        PTIMEC1) = 0.00
        et(1)    = ess
        Mtd)   = rlss
        PWC(1)   = pwc(1)
        PTEMPd) = ptempd)
        PFRACV(1)= 1.000

        PTIME(2) = tend
        et(2)    = ess
        r1t(2)   * rlss
        PWC(2)   * pwcd)
        PTEHP(2) = ptempd)
        PFRACVC2)* 1.0DO

        PTIME(3)  = tend +  1.
        et(3)     = 0.
        r1t(3>    = 0.
        PWCC3)    = pwcd)
        PTEMP(3)  = ptempd)
        PFRACV(3)= 1.0DO

        PTIME<4)  = tend +  2.
        et(4)     = 0.
        Mt(4)    = 0.
        PWCC4)    = pwcd)
        PTEMP(A)  - ptempd)
        PFRACV<4)= 1.0DO

        URITE(8,1040)  NP
        DO 800  I=1,NP
   800  WRITE(8.1030)  PTIME(I).ET(I),R1T(I). PWC
-------
                                     E-12
c
C
        CLOSE(UNIT=8)
C
c
  820   FORMAT(Q,A40)

 1010   format<1x,1pgU.7)
 1020   format(3(1x,1pg14.7))
 1025   format(5C1x,1pg14.7»
 1030   forroat(1x,5<1pg14.7,1x),1pg14.7)
 1040   formatdx.lS)
 1050   format(a24)
 1060   format(1x,i4.1x.1pg14.7)

 8000   format(a80)
 8010   format(a3)
 8020   format(80a1)
c

        CALL EXIT
        END
10 --  sys$degadis:degbridge.for                 6-SEP-1989 20:02:37

-------
                                  F-l
                              APPENDIX F

                 PARTIAL LISTING OF PROGRAM VARIABLES
  Variable

AGAIN


ALEPH



ALPHA


ALPHA1

BETAY


CCLOW


CHECK1

CHECK2



CHECK3


CHECK4


CHECKS


DELTAY


DEN(1,I)


DEN(2,I)
Data Type

LOGICAL


REAL



REAL


REAL

REAL


REAL


LOGICAL

LOGICAL



LOGICAL


LOGICAL


LOGICAL


REAL


REAL


REAL
  Symbol    Units
    a       n/a


(1.0 + a)    n/a

    Py      n/a


            kg/m?
   yc       mole
          fraction

   cc       kg/m3
       Comments

Local communications
in SSSUP

Collection of constants
to calculate observer
position and velocity

Power law velocity
profile power
Lateral similarity
power

Lowest mixture concen-
tration of interest

Unused logical flag
                *
When true, release
type without a
liquid source

Local communications
flag used in DEGADIS1

When true, steady-
state simulation

When true, user sets
time-sort parameters

Lateral similarity
coefficient

Contaminant mole
fraction

Contaminant concentra-
tion for the given mole
fraction

-------
                                  F-2
  Variable

DEN(3,I)
DEN(5,I)
EMAX
ESS
ET(I)
GAMMAF

GAS_CPK


GAS_CPP


GAS_LFL



GAS_MW


GAS_NAME

GAS_RHOE


GASJTEMP


GAS UFL
Data Type

REAL


REAL


REAL


REAL



REAL


REAL



REAL


REAL

REAL


REAL


REAL



REAL


CHARACTER*3

REAL


REAL


REAL
E(t)
                               g
Symbol    Units           Comments

  p       kg/nH    Mixture density for
                   the given mole fraction
Mixture enthalpy for the
given mole fraction

Mixture temperature for
the given mole fraction

Maximum of secondary
source mass evolution
rate

Steady-state release
rate

Source mass evolution
rate as a function of
time PTIME(I)

Acceleration due to
gravity
        kg/s



        kg/s


        kg/s



        m/S2


         n/a
            P
q-  J/kmol K

PI       n/a
          mole
        fraction
Constant for contaminant
heat capacity
Power for contaminant
heat capacity

Lower contaminant con-
centration level for
estimating contours
 MW(j      kg/kmol  Contaminant molecular
                   weight

                   Name of contaminant

 PO       kg/m^    Saturated vapor density
                   of contaminant at TO

 TO         K.      Contaminant storage
                   temperature

          mole     Upper contaminant con-
        fraction   centration level for
                   estimating contours

-------
                                  F-3
  Variable     Data Type

GAS ZSP        REAL
GHASSO
HTCO
HUMID
IHTFL
ISOFL
ISTAB
IWTFL
K


LUNLOG



MAXNOB


ML

NOBS
REAL
REAL
REAL
INTEGER
INTEGER
INTEGER
INTEGER
REAL


INTEGER



INTEGER


REAL

INTEGER
Symbol    Units           Comments

            m      Height for estimating
                   contours

           kg      Initial mass of gas over
                   the primary source

 ho       J/m^sK   Constant coefficient
                   when IHTFL—1
 VH        m/s     LLNL heat transfer
                   velocity when IHTFL-2

        kg water/  Ambient absolute
       kg dry air  humidity

                   Heat transfer flag:
            IHTFL—1  constant coefficient
            IHTFL-0   no heat transfer
            IHTFL-1   DEGADIS correlation
            IHTFL-2   LLNL correlation

                   Isothermal release when
                   ISOFL-1

                   Pasquill atmospheric
                   stability indicator
                   (ISTAB-1 for A,
                   (ISTAB-2 for B, etc.)

                   Water transfer flag
            IWTFL—1  constant coefficient
            IWTFL-0   no water transfer
            IWTFL-1   DEGADIS correlation

  k        n/a     von Karman's constant,
                   0.35

                   Fortran logical unit
                   number which acts  as a
                   simulation log

                   Maximum number of
                   observers

  A         m      Monin-Obukhov length

                   Number of observers for
                   the pseudosteady-state
                   simulation

-------
                                  F-4
  Variable

NREC(I.l)



NREC(I,2)



PAMB

POUND
Data Type     Symbol

INTEGER



INTEGER



REAL            p

CHARACTERS
                        Units           Comments

                                 Number of records
                                 generated in PSSOUT for
                                 observer I

                                 Number of records
                                 generated in SSGOUT for
                                 observer I

                         atm     Ambient pressure

                                 Character string to
                                 signal end of data
POUNDN



QSTR(1,I)



QSTR(2,I)


RADG(l.I)



RADG(2,I)


RELHUMID
RMAX


RT2

R1SS
REAL
REAL
REAL
REAL
REAL
REAL
RHOA
RM
REAL
REAL
Pa
Rm
kg/m-
m
REAL


REAL

REAL
                                 Numerical value to
                                 signal end of data
                                 (-1.E-20)

                t         s      Independent variable
                                 time for ordered
                                 pairs QSTR

                Q*      kg/m^s   Atmospheric takeup rate
                                 as a function of time

                t         s      Independent variable
                                 time for ordered pairs
                                 RADG

                R         m      Secondary source radius
                                 as a function of time

                          Z      Ambient relative
                                 humidity
                                                Ambient air density

                                                Radius at EMAX (when
                                                secondary source mass
                                                evolution rate is a
                                                maximum)
              Rmax        m      Maximum secondary
                                 source radius

              J2.        n/a     Constant

               Rp         m      Steady-state primary
                                 source radius

-------
                                  F-5
  Variable     Data Type

R1T(I)         REAL



SIGX_COEFF     REAL


SIG_MIN_DIST   REAL



SIGX_POW       REAL


SLEN           REAL


SQPI02         REAL

SQRTPI         REAL

SRCDEN(1,I)    REAL



SRCDEN(2,I)    REAL



SRCENTH(l.I)   REAL



SRCENTH(2,I)   REAL
SRCWA(1,I)
SRCWA(2,I)
SRCWC(1,I)
REAL
REAL
REAL
Symbol
Rp






L
7*72.
75?
t
Units
m


m

n/a

m
n/a
n/a
s
Comments
Primary source radius
as a function of time
PTIME(I)
Along-wind similarity
coefficient
Minimum distance to
apply x-direction
dispersion correction
Along-wind similarity
power
Steady- state source
length
Constant
Constant
Independent variable
          time for ordered
          pairs SRCDEN

 kg/m-*    Secondary source
          density as a function
          of time

   s      Independent variable
          time for ordered
          pairs SRCENTH

 J/kg     Secondary source
          enthalpy as a function
          of time

   s      Independent variable
          time for ordered
          pairs SRCWA

  mass    Secondary source air
fraction  mass fraction as a
          function of time

   s      Independent variable
          time for ordered
          pairs SRCWC

-------
                                  F-6
  Variable

SRCWC(2,I)
SWID
SZM
WTCO



XV(I)



ZO

ZR
Data Type

REAL
Symbol
 Units
Comments
               wr
REAL
REAL
Sz0m
TAMB
TEND
TINP
TITLE(1:4)
TO(I)
TSURF
USTAR
UO
REAL T
REAL
CHARACTER*24
CHARACTER*80
REAL
REAL Ts
REAL u*
REAL UQ
K
s


s
K
m/s
m/s
REAL



REAL



REAL

REAL
  xv
  mass    Secondary source
fraction  contaminant mass
          fraction as a function
          of time

   m      Steady-state source
          half-width

   m      Value of SZQ at EMAX
          (when secondary source
          mass evolution rate is
          a maximum)

          Ambient temperature

          Termination time of
          secondary source

          Time DEGADISIN was
          executed

          Text title block 4
          lines of 80 spaces

          Time of release for
          observer I

          Surface temperature

          Friction velocity

          Ambient velocity at
          height ZQ

kg/m^s    Mass transfer
          coefficient when
          IWTFL--1

   m      Virtual source
          position for estimation
          of Sy in SSG

   m      Height for velocity UQ

   m      Roughness length

-------
                                  G-l
                              APPENDIX G
                     DEGADIS  DIAGNOSTIC MESSAGES
    To assist the viser in determining the source of any problems, a
diagnostic procedure has been included in DEGADIS.  The subroutine TRAP
is meant to cause an orderly termination of the program for many
detected errors.  It performs two basic functions:  TRAP displays an
error code and a single line diagnostic message giving the reason for
premature termination, and TRAP forces an output of the COMMON area data
sets to the file TRAP.DBG.

    The first three lines sent to the execution log (default-TERMINAL)
include the TRAP introductory lines and the error code number:

      The best laid plans of mice and men . .  .
      You have entered a TRAP--THE LAND OF NO RETURN
      CODE:  NN

where NN represents the code of the error message which follows in the
log.  The error message begins with the name of the calling routine.

    The following is a list of the error codes, error messages, and
suggested actions for each problem.
Code:  1
    DEGADIS1?  Source integration has returned IHLF-NN

Action:  This error occurs during integration of the equations which
describe the gas source.  IHLF is an error code returned by the
integration package RKGST.
    When IHLF-11, more than 10 bisections of the initial increment of
the independent variable were necessary to make an integration step
within the specified error.  Reduce the initial step size of the
independent variable (STPIN in the ER1 file).  If this does not work,  it
will be necessary to either increase the error criteria for all of the
dependent variables being integrated (ERBND in the ER1 file) or increase
the error criteria for the variable violating the criteria by decreasing
the error weight for that variable (one of the following:  WTRG, WTTM,
WTYA, WTYC, WTEB, WTMB, or WTUH in the ER1 file).
    When IHLF-12, the initial increment of the independent variable
(STPIN) is 0.  Correct the ER1 file and execute the program again.

-------
                                  G-2
    When IHLF-13, the initial increment of the independent variable
(STPIN) is not the same sign as the difference between the upper bound
of the interval and the lower bound of the interval.  STPIN must be
positive.  Correct the ER1 file and execute the program again.
Code:  2
Reserved
Code:  3
    SZF?  Local integration failed; IHLF-NN

Action:  This error occurs during estimation of SZ over the source when
no gas is present.  IHLF is an error code returned by the integration
package RKGST.
    When IHLF-11, more than 10 bisections of the initial increment of
the independent variable were necessary to make an integration step
within the specified error.  Reduce the initial step size of the
independent variable (SZSTPO in the ER1 file).  If this does not work,
increase the error criteria for all of the dependent variables being
integrated (SZERR in the ER1 file).
    When IHLF-12, the initial increment of the independent variable
(SZSTPO) is 0.  Correct the ER1 file and execute the program again.
    When IHLF-13, the initial increment of the independent variable
(SZSTPO) is not the same sign as the difference between the upper bound
of the interval and the lower bound of the interval.  SZSTPO must be
positive.  Correct the ER1 file and execute the program again.
Code:  4
    SURFACE?  Negative QRTE for positive DELTAJT.

Action:  This is a diagnostic message indicating an error in estimation
of the heat capacity.  Check the input to the model and execute the
program again.
Code:  5
    CRFG?  More points for GEN3 were needed.

Action:  The COMMON area /GEN3/ stores representative values of the
calculated source parameters.  If this message occurs, relax the CRFG
error criteria (CRFGER) in the ER1 file.  If this is a common problem,
the length of the /GEN3/ vectors can be increased by changing the value
of MAXL in DEGADIS1.DEC and reinstalling DEGADIS.

-------
                                  G-3
Code:  6
    TUFF?  Observer calculations--TUPF failed

Action:  The trial-and-error search associated with finding the-upwind
edge of the gas source for an observer failed.  Often this problem can
be avoided by adding one or two additional observers to the present
number of observers (which changes the conditions for the trial and
error).   Another possibility is to increase the error criteria for this
function (ERTUPF) in the ER2 file.
Code:  7
    TDNF?  Observer calculations--TDNF failed

Action:  The trial-and-error search associated with finding the downwind
edge of the gas source for an observer failed.  Often this problem can
be solved by adding one or two additional observers to the present
number of observers (which changes the conditions for the trial and
error).  Another possibility is to increase the error criteria for this
function (ERTDNF) in the ER2 file.
Code:  8
    SSSUP?  Observer Integration failed, IHLF-NN

Action:  This error occurs during integration of the five differential
equations which average the source for each observer.  IHLF is an error
code returned by the integration package RKGST.
    When IHLF-11, more than 10 bisections of the initial increment of
the independent variable were necessary to make an integration step
within the specified error.  Reduce the initial step size of the
independent variable (STPO in the ER2 file).  If this does not work, it
will be necessary to either increase the error criteria for all of the
dependent variables being integrated (ERRO in the ER2 file) or increase
the error criteria for the variables violating the criteria by
decreasing the error weight for that variable (one of the following:
WTAIO, WTQOO, or WTSZO in the ER2 file).
    When IHLF-12, the initial increment of the independent variable
(STPO) is 0.  Correct the ER2 file and execute the program again.
    When IHLF-13, the initial increment of the independent variable
(STPO) is not the same sign as the difference between the upper bound of
the interval and the lower bound of the interval.  STPO must be
positive.  Correct the ER2 file and execute the program again.

-------
                                  G-4
Code:  9
    SSSUP/SDEGADIS2?  Pseudosteady Integration failed, IHLF-NN

Action:  This error occurs during integration of the four differential
equations describing the portion of the downwind calculation when b > 0.
The routine calling TRAP is SSSUP if a transient simulation is being
executed; if a steady-state simulation is being executed, the calling
routine is SDEGADIS2.  IHLF is an error code returned by the integration
package RKGST.
    When IHLF-11, more than 10 bisections of the initial increment of
the independent variable were necessary to make an integration step
within the specified error.  Reduce the initial step size of the
independent variable (STPP in the ER2 file).  If this does not work, it
will be necessary to either increase the error criteria for all of the
dependent variables being integrated (ERRP in the ER2 file) or increase
the error criteria for the variable violating the criteria by decreasing
the error weight for that variable (one of the following:  WTSZP, WTSYP,
WTBEP, or WTDH in the ER2 file).
    When IHLF-12, the initial increment of the independent variable
(STPP) is 0.  Correct the ER2 file and execute the program again.
    When IHLF-13, the initial increment of the independent variable
(STPP) is not the same sign as the difference between the upper bound of
the interval and the lower bound of the interval.  STPP must be
positive.  Correct the ER2 file and execute the program again.
Code:  10
    SSSUP/SDEGADIS2?  Gaussian Integration fail, IHLF-nn

Action:  This error occurs during integration of the differential
equations describing the portion of the downwind calculation when b—0.
The routine calling TRAP is SSSUP if a transient simulation is being
executed; if a steady-state simulation is being executed, the calling
routine is SDEGADIS2.  IHLF is an error code returned by the integration
package RKGST.
    When IHLF-11, more than 10 bisections of the initial increment of
the independent variable were necessary to make an integration step
within the specified error.  Reduce the initial step size of the
independent variable.  (STPG in the ER2 file).  If this does not work,
it will be necessary to either increase the error criteria for all of
the dependent variables being integrated (ERRG in the ER2 file) or
increase the error criteria for the variable violating the criteria by
decreasing the error weight for that variable (either WTRUH or WTDHG in
the ER2 file).
    When IHLF-12, the initial increment of the independent variable
(STPG) is 0.  Correct the ER2 file and execute the program again.
    When IHLF-13, the initial increment of the dependent variable (STPG)
is not the same sign as the difference between the upper bound of the
interval and the lower bound of the interval.  STPG must be positive.
Correct the ER2 file, and execute the program again.

-------
                                  G-5
Code:  11
    SSSUP/SDEGADIS2  Total No. of Records exceeds 120,000

Action:  This is an arbitrary stopping point for the process in order to
keep a runaway simulation from filling up disk space.  Relax the output
specification (ODLP, ODLLP, ODLG, or, DLLG) in the ER2 file in order to
generate less output if the input parameters are valid.
Code:  12
Reserved
Code:  13
Reserved
Code:  14
Reserved
Code:  15
Reserved
Code:  16
    PSSOUT/PSSOUTSS?  PSS started with B < 0.

Action:  This condition is checked at the beginning of the downwind
calculation in order to confirm proper handling of the movement to the
Gaussian phase of the downwind calculation.  Check the initial
conditions and execute the program again.
Code:  17
    TPROP/ADDHEAT?  Enthalpy out of bounds

Action:  Diagnostic message indicating that an enthalpy lower than the
adiabatic mixing enthalpy was passed to ADDHEAT.  Check the input
conditions and execute the program again.

-------
                                  G-6
Code:  18
    ALPH?  ALPHA Integration failed, IHLF-NN

Action:  The integration which determines the integral least squares fit
for ALPHA has failed.  Note that small values of the Monin-Obukhov
length ( ML < 0(lm) ) in combination with stable atmospheric conditions
may cause this failure.  IHLF is an error code returned by the
integration package RKGST.
    When IHLF-11, more than 10 bisections of the initial increment of
the independent variable were necessary to make an integration step
within the specified error.  Reduce the absolute value of the initial
step size of the independent variable (STPINZ in the ER1 file).  If this
does not work, it will be necessary to increase the error criteria
(ERBNDZ in the ER1 file).
    When IHLF-12, the initial increment of the. independent variable
(STPINZ) is 0.  Correct the ER1 file and execute the program again.
    When IHLF-13, the initial increment of the independent variable
(STPINZ) is not the same sign as the difference between the upper bound
of the interval and the lower bound of the interval.  STPINZ must be
negative.  Correct the ER1 file and execute the program again.  This
error will also occur if the surface roughness ZR is greater than the
reference height ZO.
Code:  19
    ALPH?  RTMI has failed to locate ALPHA IERR:NN

Action:  The search procedure which determines ALPHA has failed.  This
error may be the result of an unusual velocity specification such as
small values of the Monin-Obukhov length ( ML < 0(1.m) ) or small
reference heights ( ZO < 0(10. * ML) ).  IERR is an error code returned
by the routine RTMI.
    When IERR-1, the search for ALPHA failed after a specified number of
iterations.  Increase the error bound used by RTMI (EPS in the ER1
file).
    When IERR-2, the basic assumption that the function which governs
the search for ALPHA changes sign over the specified interval is false.
Increase the search interval by decreasing the lower bound of ALPHA (XLI
in the ER1 file) and increasing the upper bound (XRI in the ER1 file).
Code:  20
    ESTRT?  Premature EOF in RUN_NAME.ER1 or RUN_NAME.ER2

Action:  The portion of the program which reads ER1 and ER2 files
encountered an end-of-file mark before all of the information had been
read.  Confirm these files and execute the program again.  If necessary,
copy and edit the appropriate EXAMPLE file and execute the program
again.

-------
                                  G-7
Code:  21
    ESTRT1/ESTRT2/ESTRT2SS/ESTRT3?  DECODE failed.

Action:  The portion of the program which reads the ER1, ER2, or the ER3
file failed to understand a numerical entry.  The numbers must appear in
columns 11-20 of the line with no alphabetic characters in the field.
(Note that exponential notation is not allowed.)  This restriction does
not apply to comment lines which have an exclamation point (!) in the
first column.
Code:  22
    ESTRT1?  The parameter file RUN_NAME.ER1 was not found.

Action:  The ER1 file was not found for the current simulation
(RUN_NAME).  Copy the file EXAMPLE.ER1 to RUN_NAME.ER1 and edit it as
necessary.  Execute the program again.
Code:  23
    SORTS1?  Fewer than 3 points sorted for any time.

Action:  Only one or two simulation points were applicable for the sort
times specified.  There are three possible causes for this condition:
    (1) if this message appears when the sort times are defaulted
(CHECKS is set to 0. in the ER3 file), the number of observers will
probably have to be increased to give a good resolution of the downwind
concentration field.  (The number of observers is NOBS in the ER2 file
with a maximum (MAXNOB) given in DEGADIS2.DEC.).  As a rule of thumb,
one gets good resolution of the downwind concentration field if the
ratio: (secondary source duration / number of observers) is less than
about 10 seconds (or 20 at most).
    (2) The sort times specified in the ER3 file were before the
simulation had developed significantly.  This is only applicable when
the user is specifying the sort times (i.e. when CHECKS is set to 1. in
the ER3 file).  Increase the time of the first sort (ERT1), and rerun
the program.
    (3) The sort times specified in the ER3 file were after the gas was
below the lowest concentration of interest.  This is only applicable
when the user is specifying the sort times (i.e. when CHECKS is set to
1. in the ER3 file).  Increase the time of the first sort (ERT1), and
rerun the program.  If additional results are desired for later times,
restart the simulation and specify a lower concentration of interest in
the input step (lower CCLOW in DEGADISIN).
Code:  24
    TPROP?  Trial and error loop compromised.

Action:  TPROP estimates the temperature of a mixture based upon the
composition and enthalpy of the mixture.  Ensure the properties for the
diffusing species are entered correctly and execute the simulation
again.

-------
                                  G-8
Code:  25
    TPROP?  Isothermal density loop compromised.

Action:  This error should never occur, but if it does, rebuild the
model from the original files and run the simulation over.
Code:  26
    TPROP?  Invalid entry flag in ADIABAT.

Action:  This is a programming diagnostic and should never occur.  If it
does, rebuild the model from the original files.
Code:  27
Reserved
Code:  28
    TPROP?  IGEN request too large in SETDEN.

Action:  The subroutine SETDEN (in TPROP) performs a series of adiabatic
mixing calculations with a specified gas mixture and ambient air and
places the result in the array DEN(5,IGEN).  This error indicates more
points are needed in DEN than were originally requested.  Increase the
allocation for DEN by changing the value of IGEN in DEGADISIN.DEC and
reinstalling DEGADIS.
Code:  29
    PHIF?  Flag IPHIFL is out of bounds.

Action:  Proper values of IPHIFL are integers between 1 and 5 inclusive.
Although values of IPHIFL are entered in the ERl file as real numbers,
they should be in this range.  Check the ERl file and execute the
program again.
Code:  30
    SSSUP/SDEADIS2?  Concentration greater than RHOE.

Action:  If the concentration of the contaminant becomes greater than
the pure component density for an isothermal simulation, this error will
occur.  However, this situation should never occur.  Check the input
conditions and execute the program again.

-------
                                  G-9
Code:  31
    SSSUP?  Concentration greater than KHOE.

Action:  If the concentration of the contaminant becomes greater than
the pure component density for an isothermal simulation, this error will
occur.  However, this situation should never occur.  Check the input
conditions and execute the program again.
Code:  32
    PSS?  Sz convergence failure.

Action:  This is a programming diagnostic and should never occur.  If it
does, check the input conditions and execute the program again.
Code:  33
    SSG?  Sz convergence failure.

Action:  This is a programming diagnostic and should never occur.  If it
does, check the input conditions and execute the program again.

-------
i e w n i~y i L- ** L. ncr^n/ LJ*+ i >+
(Flesit read Instructions on me reverse before completing/
i. BEPORT no. a.
«. TITLE AND SUBTITLE
DEGADIS (DEnse GAs DISpersion) - Version 2.1
j. AUTHOR^)
T. 0. Spicer and J. A. Havens
). PERFORMING ORGANIZATION NAME AND ADDRESS
12. SPONSORING AGENCY NAME AND ADDRESS
U.S. Environmental Protection Agency
Office of Air Quality Planning and Standards
Source Receptor Analysis Branch
Research Triangle Park NC 27711
a. RfcCiPitM i ACCESSION NO 	
5 REPORT DATE
June 1989
6. PERFORMING ORGANIZATION CODE


EPA Contract -#68-02-4351
13. TYPE OF REPORT AND PERIOD COVERED
14. SPONSORING AGENCY CODE
iS. SUPPLEMENTARY NOTES
EPA Project Officer: Dave Guinnup
 16. ABSTRACT
   An  improved Jet-Plume model has  been interfaced with DEGADIS to provide for
   prediction of  the trajectory  and dilution of elevated dense gas jets to ground
   contact.  DEGADIS predicts the ensuing ground-level plume dispersion.  The
   Jet-Plume model provides for:
   —automatic adjustment of integration step-size (using the Runge-Kutta-Gill
     method as in DEGADIS);
   —elliptical plume shape (cross-section),  with air entrainment specified consis-
     tent with the Pasquill-Gifford plume dispersion coefficient representation of
     atmospheric  turbulent entrainment;
   —user specification of averaging time;
   —ground reflection when the  plume  (lower) boundary-reaches ground level;  and
   —application  to scenarios where the  plume remains aloft.
7. . KEY WORDS AND DOCUMENT ANALYSIS
DESCRIPTORS
Air Pollution
Dense Gas
Mathematical Model
Computer Model
a. DISTRIBUTION STATEMENT
b.lDENTIFlERS/OPEN ENDED TERMS
Dispersion
Elevated Sources
19. SECURITY CLASS (Tltu Keporri
20. SECURITY Cl. ASS. (Tins page I
c. COSATI Field 'Croup

21. NO. OF PAGES
431
22. PRICE
, PA Fo»» 2220-1 (R.». 4-77)
                     PREVIOUS COITION I* OBSOLETE

-------