905984002A
               HANDBOOK
               a management technique for choosing
               among point and nonpoint control strategies
                       Appendix G

       Users Manual for WATERSHED Computer Program

-------
           HANDBOOK
           a management; technique for choosing
           among point; and nonpoint control strategies
Users Manual for
                      Appendix G
Computer Program
                             By
                      Michael R. Donihue
                          Consultant

                      Timothy J. Monteith
                 Great Lakes Basin Commission Staff

                         August 1981

                         Prepared for
              U.S. Environmental Protection Agency
                Great Lakes National Program Office
                 536 South Clark Street, Room 932
                      Chicago, Illinois 60605
                         (312)353-2117

-------
                                   DISCLAIMER
         This  report  has  been  reviewed  by the  Great Lakes  National  Program
Office,  Region  V,  U.S.  Environmental  Protection  Agency,   and   approved  for
publication.   Approval  does  not signify  that  the contents necessarily reflect
the views  and  policies  of the  U.S.  Environmental Protection  Agency,  nor does
mention  of  trade  names  or commercial   products   constitute endorsement  or
recommendation for use.
                                ACKNOWLEDGEMENTS


         The  authors  wish  to  thank  the Great  Lakes National  Program Office
Staff  and  Don Urban of  the USDA Soil  Conservation  Service  for  their  support
and  guidance  throughout  this  project.   We  also wish  to  acknowledge Marie
Murrell for the secretarial support.
                                PROJECT OFFICERS

                      Great Lakes National Program Office
                                  Kent Fuller
                          Great Lakes Basin Commission
                                Timothy Monteith

-------
                               TABLE OF CONTENTS
                                                                     PAGE  NO.
LIST OF TABLES	     3
LIST OF FIGURES	     5
INTRODUCTION	     7
SECTION 1 - MAIN WATERSHED COMPUTER PROGRAM  	     9
     Overview of Commands 	     9
     Command Details   	    11
     Sample Terminal Session   	  ...    16
     Sample Worksheet Output   	  .    23
     Program Flow Chart and Listing	    33
     Data Files	    94
SECTION 2 - NETWORK PROGRAM ......  	   101
     Commands	   101
     Sample Terminal Session		101
     Computer Flow Chart  and  Listing	103
     Program Output	113

-------
                                 LIST OF TABLES



NUMBER                                                               PAGE  NO.



  1  Legal Commands for WATERSHED Program  	  .  .     9



  2  Legal Commands for NETWORK Program  	  ....   101

-------
                                LIST OF FIGURES





NUMBER                                                               PAGE  NO.



  1  Flow of Commands for Typical Program Run  	  .....    10



  2  WATERSHED Program Flow Chart 	    34



  3  NETWORK Program Flow Chart  	   104

-------
                                   APPENDIX  G

                  USERS  MANUAL  FOR  WATERSHED COMPUTER  PROGRAM
INTRODUCTION

     This computer  program  was developed  to  assist the  user  in manipulating
WATERSHED worksheet data.  The program is  particularly useful when  analyzing  a
network of  river  basins or  when  making  a number  of changes  in the  original
assumptions.

     In  order  to  use   this  program  properly  the  user  must   have   a   good
understanding of the  basic  WATERSHED process presented  in  the main handbook.
There is no  substitution for using the worksheets presented in the  handbook to
organize  the initial   assumptions.   Once  the  data  requirements   of  the
worksheets  have  been  met the  computer  program  can  be  implemented to assist
with calculations.

     The program  is written  in Fortran and  is  runable  on most  medium  to large
size computers.   The output  format  necessitates a  wide carriage  terminal or
full  132 character  printer.    The data input  and  manipulation  is  done
interactively and  may be accomplished on  any  type  of  computer terminal.   The
program utilizes  a "command"  based system that  requires  the  user  be  familiar
with the  14 commands,  legal  key words,  and option  lists  available  for driving
the  program.    Although  the program  prompts   the   user  at  many  points  for
specific  information, the  user  should still become  familiar  with 'the  program
commands-presented in the following chapter.

     There  are  actually  two  programs   that  make up  the  full   WATERSHED
computerized  system.   The first  is  called WATERSHED.    This  program  performs
all operations of  the WATERSHED  process  for one river basin.   The  second  is  a
sub-program  called NETWORK.    This  program  reads   in  the  output   data   from
WATERSHED for up to  7  different  river  basins   and  produces  a  Worksheet 8 for
the  entire  network.  This  manual is  divided   into  two  sections.   Section  1
describes the operation  of  the  main  WATERSHED   program and  Section  2 describes
the NETWORK program.

-------
SECTION 1 - MAIN WATERSHED COMPUTER PROGRAM

Overview of Commands

     Each  user  must determine how  their computer  calls  compiles,  and  runs a
Fortran  program and  how  such a  program interacts  with  their hardware.   The
input  and  output  subroutines utilize  numbers  to  identify  various data files.
The number 8  is used  for  the input file associated with the READ  command.  The
number 9 is used for  the  outputting of data,  (other  than  final  Worksheets) in
the SAVE command.   Final  worksheets will  default to the terminal  unless routed
to a data file  identified by the proper number with the WORKSHEET  command.

     The full list  of  acceptable  commands  is shown in Table 1.  As can be  seen
many of  the  commands  have  keywords that are  required  to  modify  the command.
Once the computer  run begins the  program will  prompt "enter command" and  then
wait  for  further   instruction.    The   user  must  then  select  one  of  the 14
commands from table 1 to properly respond to this  prompt.

                                    TABLE 1

                     Legal Commands for WATERSHED  Programs

                     CONTROL                 Keyword  (option!ist)
                     COST                    Keyword
                     XCOST                   Keyword
                     HELP
                      INPUT                   Keyword
                     LOAD                    .Keyword
                     PERCENT                 Keyword
                     XPERCENT                Keyword
                     READ                    Keyword
                     SAVE                    Keyword
                     STOP
                     TITLE                   (value)  Title  list
                     TRANSMISSION            (position number)
                     WORKSHEET               (file number)  Worksheet  number


         Many of the  commands depend upon the  completion of operations carried
out under  other commands  on  the list.   Figure  1  shows a flow of commands for  a
typical  WATERSHED  run.  Once the  computer  run has begun,  HELP and STOP may be
used  at  any  point.   STOP  should be used with  caution because  data can be  lost
if  it  has  not been properly saved.  As can  be seen  in Figure  1, the  use of the
LOAD command  is optional  although  it should be activated early in the process.
The  user may then   use the  READ command to  bring in data from the previous run
or  may  proceed through  the TITLE,   INPUT,  and  SAVE  commands  to  build   new
Worksheets  1 through  4.   The data may then be  displayed  using  the  WORKSHEET
command  to check for  errors before moving on to the  pollutant control options.
It  should  be  noted that  the only way  errors can  be  corrected  is by  STOPing the
program  after the  SAVE command  and editing  the output file or starting over by
re-entering  all of  the data.

         Figure 1   shows  the  optional  PERCENT  and  XPERCENT commands which  may
be  used  before  moving into  the  actual CONTROL options.   Again controls may be

-------
ENTER COMMAND
Figure   1
                                                                   Flow of Commands for
                                                                   Typical Program Run
                                       10

-------
put in from  the  keyboard or read from  a file.    The  cost of the  controls are
then  entered  (COST  or  XCOST)  and  transmissions  may  be  modified  with  the
TRANSMISSION command.  Worksheets can  be printed to the  terminal  or  data file
using the WORKSHEET ALL command and, the control options may be saved.

Command Details

         The units used in this program  are  the  same  as  those displayed on the
worksheets in the WATERSHED  handbook.   Where prompting for specific units does
not  occur,  worksheet  units  should  be   used.   As  previously mentioned,  some
commands must be preceded   by  other commands in the list.  Figure 1 provides a
general guideline although more detail can be found in this section.

CONTROL keyword (optionlist)

         The  CONTROL command  accepts input  of control  strategy  data.   Each
command for  the respective  keywords increments  the stage of controls for which
values  are  to  be  entered.    No  more  than  three  stages of  controls  may  be
specified.    Each  keyword  has  a   set  of  optional   arguments  which  may  be
specified  within  parenthesis   in  the   command   line  following  the  keyword.
Multiple  options  separated  by  commas  within   the   set of  parenthesis  are
accepted.  The user  is then  prompted for the values of the controls specified.
 If no options are specified appropriate defaults are  used.

         keyword -  URBAN for  the  input of  point and urban  non-point control
                 strategies.    If  no   options  are  specified   the  default
                 optionlist  is  -- (FLOW,CONCiAREA,UAL).

         (optionlist)  -  any  of the  following  are  valid options  to identify
                 particular  source  values for controls.
                 FLOW - to control  flow  values for point  sources
                 CONC - to control  concentrations for  point  sources
                 AREA - to control  area  values for all non-point sources
                 AREA/sourcename  -  to  control   area values  for  a  specific
                        source  (e.g. AREA/STORM or AREA/COMBINED)
                 UAL -  to control  unit  area  loads for all non-point sources
                 UAL/sourcename -  to  control unit  area loads for  a specific
                        source
                 LOAD - to control  load  values  directly  for all  urban sources.
                        Note:  this   is  the  default  if the  LOAD  URBAN command
                        has  been given.

         keyword  -  RURAL to  input  control  values  for rural cropland sources.
                 The  default  value of  the  optionlist includes the  five USLE
                 coefficients  (R,K,LS,C,P).

          (optionlist) -  any  of  the  following  are  valid options
                 R,K,LS,C,P  -  any  combination of  the  USLE  coefficients may be
                        specified using  these identifiers.
                 EFF -  to  alter  the efficiency ratio for a particular  source.
                        The  default value for all  sources is 1.0
                 UAL -  to  alter  unit area loads  if  USLE coefficients are not
                        used.     Note:  this   is  the  default  if  the  LOAD
                        CROPLAND(UAL) command has  been given.
                                        II

-------
                 LOAD - to  control  load values directly  for all  cropland
                        sources.     Note:  this   is  the  default  if  the  LOAD
                        CROPLAND  command  has  been given.
COST keyword

         Accepts  input  on   the  cost  of  controls.    Each  command  for  the
respective keyword increments the  stage  number for which the  command  applies.
Multiple keywords  separated  by  commas may  be  used in  a  single command.   The
user is prompted for the' appropriate costs  of  control.  ?Note:  The default sets
costs the  same within  any  source  group  i.e.  $1000/km   to reduce  stormwater
runoff loads by 10% in all  cities.

         keyword - valid  keywords  are URBAN and  RURAL corresponding  to  costs
                 of control  for  urban  point  and  non-point sources and  rural
                 cropland sources,  respectively.


XCQST keyword

         This  command  is  identical  to  the COST  command  with the  important
distinction that costs may  differ  within source groups.  The  user is  prompted
for "per unit  costs of control"  for  each source.   Valid keywords  are  the same
as those above.
HELP

         This  command  prints   a  brief   list  and  description  of  the  valid
WATERSHED commands.
INPUT keyword

         This command prompts the user for values  for  the  initial  state of the
WATERSHED  area  of  study.   Various  keywords may be  specified   and  multiple
keywords  separated  by  commas  are  accepted.    The  default  if  no keyword  is
specified is SOURCE.

         keyword - SOURCE

                 prompts  the  user  for type code,  source name, point  of entry
                 character,  area  or  units  served,  and  optional   surface
                 features.  Must  be specified before  additional  keywords  will
                 be accepted.

         The following specifications are prompted for:
         type code - an integer value equal to one of the following codes:

             1 - for rural non-cropland sources
             2 - for rural cropland sources
             3 - for municipal (point) sources
                                          12

-------
            4  - for  industrial  (point)  sources
            12  - is  a valid  type code causing the corresponding  source  name to
                apply to  both  a noncropland  and  a cropland  source.
            21  - the  same  as  12  except  cropland  is prompted  before noncropland.

         source name  -  an  alphanumeric identifier for each  source  of  not more
                than 28 characters.
                A blank carriage return signifies the end of source input.
         point  of  entry code  - a  single  character,  alphanumeric,  marking the
                position  of  the source in the WATERSHED  area of study.
         area   or  units served  -  is   a  real (floating  point)  number of the
                source area in  square kilometers  or  the number of units for
                point sources  (e.g.  households)  served by a particular source.
         surface  features  -  is   an  optional alphanumeric   descriptor  of  the
                source.  Up  to 12 characters are allowed.

         keyword - URBAN

                To  input flow  (mgd)  and  concentration  (mg/L)  data for  point
                sources and unit area loads  (kg/knr/yr) for  non-point  urban
                sources.   All  values must be entered  as  real  (floating point)
                numbers.    Default  urban  areas are  point,  storm sewer and
                combined  sewer.  Two  additional areas such  as  construction or
                unsewered may  be specified by the TITLE  command.

         keyword - NONCROPLAND
                                    7                                2
                To   enter, area   (km )   and  unit area loads  (kg/km /yr)  for
                noncropland  rural areas.   All  values must  be  entered  as real
                 (floating point)  numbers.   Default  areas  are  grassland and
                woodland.   Three other area names may be optionally specified
                by  the TITLE command.

         keyword - CROPLAND

                To  enter values  for either  USLE coefficients,  unit area  loads
                 (kg/km /yr),   or  total   loads  for   rural  cropland  areas,(the
                 latter two when  the LOAD command has  been  used for cropland).
                  This  is  alwo where  the pollutant  delivery ratio  is  entered
                or  calculated based on the  total rivermouth load.   Again, all
                values must  be entered as real  numbers.
LOAD keyword

         This command is used to  cause  WATERSHED to be  run  using load figures
directly rather than unit  area  loads  and  USLE coefficients.   This command must
be activated early in the  run  (see  Figure 1).   Multiple keywords separated by
commas are accepted.
         keyword - URBAN
                 for point and urban non-point sources
                                          13

-------
                 NONCROPLAND
                 for rural  non-cropland sources

                 CROPLAND
                 for rural  cropland sources

                 CROPLAND(UAL)
                 to  load  unit  area  loads  for rural  cropland  sources  rather
                 than USLE coefficients.
PERCENT keyword

         Used  if  control   values   to   be  entered   are  in  terms  of  percent
reduction from  the intial  state to stage  I or  between subsequent  stages  of
control.  User is prompted  following the CONTROL  command for percent reduction
for the appropriate sources.   Values entered  must be in decimal form (i.e. 75%
is entered as .75)  Multiple keywords separated by  commas  are accepted.  Note:
reductions apply to all sources within  a keyword type.

         keywords: URBAN or RURAL
XPERCENT keyword

         Identical  to  the  PERCENT  command  but  percent  reductions   are  not
assumed  to  be  the  same  for  all  sources  within  a keyword.    Following  the
CONTROL command the user is prompted for percent reductions for each source.
READ keyword

         This command reads from  a  WATERSHED  data file input values which were
SAVEd during  a  previous  program run.  File number 8 must be identified as the
data file when the program is run.

         keyword - is optional.   If omitted only  values  for the initial  state
                 are  read  in.   The only  valid  keyword  is  CONTROL and causes
                 the values for the various control  strategies to be read  in.
SAVE keyword

         This command writes to  a  data  file  the existing data from a WATERSHED
computer session.   File  number  9 must be identified as the worksheet data file
when the program is run.

         keyword -  is optional.   If omitted only  values  for  the initial state
                 are stored.  The  only  valid keyword is CONTROL and causes the
                 values for the  various control strategies to be stored.
                                          14

-------
STOP keyword

         This command  terminates the  WATERSHED  computer "program.   NOTE:   If
this command  is  used before the  SAVE  command,  all data  generated  in  that run
will be lost.
TITLE(value) titlelist

         Enables  the  user  to  specify  up   to  four  titles  identifying  the
WATERSHED computer  session  output  as a heading  for  Worksheet  I.   Also enables
the user to  specify optional,  other urban, or rural  noncropland  sources.   The
actual title  or name follows  the  value in parenthesis.   Maximum title length
is 40 characters and maximum source name length  is 12 characters.

         (value) - may be an integer from 1 through 4 to indicate the title(s).
         (Ill) -  to specify one other urban area (such as unsewered)
         (U2J -  to specify a  second other urban area, named in titlelist.
         (Rl) -  to  specify  one  other  rural   noncropland  area besides  the
                 woodland and  grassland default.
         (R2) -  to specify a  second other rural noncropland area.
         (R3) -  to specify a  third other rural  noncropland area.
TRANSMISSION(n)

         This  command is  used to  alter the  effective transmisions  for each
source.    The  value  in  parenthesis   is  the  integer  position  number  of the
source.  The user  is  then prompted for the value of  the  transmission.   If "n"
is  not  specified,  the user is prompted  for  the effective transmissions of all
sources.

         This  is  the  one  major  difference  between this   program   and  the
Handbook.   In this  program the  TRANSMISSION  command would be  used to modify
effective  transmission  and  bioavailability  as shown  in  Worksheet 7  in the
Handbook.    Because  the  Handbook  columns  a7  and  by  are  always  multiplied
together,  the  computer  program  eliminates tne  bioavailable  column by.   This
variable  can  still   be  factored  in  by  altering  the  transmission  value
accordingly.   For example,  an initial T of  0.9 (column  ay)  and bioavailable
fraction of 0.5  (column  b7)  would result in a Load  to  the Mouth  (column dy) of
0.45  times the  load  to  the  surface  water  (column  c7).    In  this  program an
initial TRANSMISSION  would be  entered  as 0.45  rather  than 0.9.
WORKSHEET  (m)  n

         This  command  controls  the final  output of the WATERSHED  sub-routines.
  The  full   worksheet  tables  are  outputed  according  to  worksheet  numbers  as
specified  in the manual.

         (m)   -  is an  optional  output  file number to which the tables will  be
                 output.  The default is  to output  to  the terminal.
                                        15

-------
         n    -  Is  a  worksheet   number   1   through  8.    Multiple  worksheet
                 separated by commas are also accepted.

         ALL  -  is a valid keyword to output all available worksheets.
Sample Terminal Session

         The following terminal session  provides  an  example of how a WATERSHED
analysis  can  be  run  using  the  WATERSHED  computer  program.   The  data were
obtained  from  the  Sandusky river  basin  in  north  central  Ohio   for  example
purposes only.   These  input  data  and  the resulting WATERSHED worksheets do not
necessarily represent actual conditions in this river basin.

         In this  example  run   a  large  Amdahl  computer  was  used  running  the
Michigan  Terminal   System  (MTS).    The  data  file  WATER.TMP contained  input
information and was assigned to  unit  number  8.   Data  file WATER.DAT was used
to save new input data  and  was  assigned  to unit number 9.   Finally,  data file
-OUTFIL was a  temporary storage  area  for the final  worksheet forms, assigned
to unit number  3.    All  prompts from the  computer  program are  indicated  by a
triangle  in the left hand  margin.   Lines without  a triangle were entered by
the user on this sample run.
                                        16

-------
   RUN  WATERSHED 3=WATER.TMP SWATER. OAT 3=>-OUTFIL
>#EXCUTIQN BEGINS
             WATERSHED MANAGEMENT CONTROL PACKAGE
 |> ENTER COMMAND
   TITL(1>SANDUSKY RIVER
 [> ENTER COMMAND
   TITLSO)  LAKE ERIE
 j> SNTER COMMAND
   INPUT SOURCE / UR8AN , NONCROPLAND , CROPLAND

 !>  ENTER TYPE CODE, SOURCE NAME FOR ACL  SOURCES
   12, LOSS CREEK
   3.3UCYRUS CITY
   12, BROKEN SWORD
   12, UPPER SANDUSKY RIMER
   3, UPPER SANDUSKY CITY
   12-TYMOCHTEE CREEK
   12 /MIDDLE SANDUSKY
   12 /HONEY CREEK
   3, TIFFIN CITY
   12, WOLF CREEK
   12/ROCK CREEK
   3, FREMONT CITY
   12 /LOWER SANDUSKY (SOIL 1)
   12, LOWER SANDUSKY (SOIL 2)
  > INPUT FOR WORKSHEET  1 -  PHYSICAL  LAYOUT  PER SOURCE

  DENTSR POINT OF ENTRY  CODE /AREA  OR  UNITS SERVED , SURFACE FEATURES PSR SOURCE
  ^NON-CROPLAND   LOSS CREEK
   A,3S,37
  t>  CROPLAND
   A/1SS.9*
  ^ MUNICIPAL
   A,13500.
  >
   A,'1.3
 LOSS CREEK

 3UCYRUS CITY

 STORM

COMBINED
   A,7,2
  >NON-CROPLAND   BROKEN  SWORD
   8 ,71 . 7S
  t>  CROPLAND     BROKEN  SWORD
   B,'137,13
  j>NON-CROPLAND   UPPER SANDUSKY  RIVER
   8,47.13
  D  CROPLAND     UPPER SANDUSKY  RIVER
   8/274.S
  [>  MUNICIPAL     UPPER SANDUSKY  CITY
   B/S250.
  >          -    STORM
   SrO.
  [>          -   COMBINED
   B/3.7
                                       17

-------
J> NON-CROPLAND    TYMOCHTEE CREEK
 C,5B.17
j>  CROPLAND      TYMOCHTEE CREEK
 C,5ZS.4
[> NON-CROPLAND    MIDDLE SANDUSKY
 C,3S.23
t>  CROPLAND      MI DDLS SANDUSKY
 C.542.3S
D> NON-CROPLAND    HONEY CREEK
 Or 47. 24
t>  CROPLAND
 QV343.55
[> MUNICIPAL
  D,2SOOO.

  D,7.0

  0,10.4
j> NON-CROPLAND
  E, 30.46
|>   CROPLAND
  S,343.11
>NON-CROPLAND

[>   CROPLAND
  E,409.3
j>  MUNICIPAL
  E, 13730.

  E, 1 .4
 HONEY CREEK

 TIFFIN CITY

 STORM

COMBINED

 WOLF CREEK

 WOLF CREEK

 ROCK CREEK

 ROCX CREEK

 FREMONT CITY

 STORM

COMBINED
  Er12.3
j> NON-CROPLAND   LOWER SANDUSKY  (SOIL  1)
  F, 34.54'
j>   CROPLAND     LOWER SANDUSKY  (SOIL  1)
  ?,243.53
i>NON-CROPLAND   LOWER SANDUSXY  (SOIL  2)
  F,3.25
>   CROPLAND     LOWER SANDUSKY  (SOIL  2)
  F,100,0

 p> INPUT FOR WORKSHEET 2 - POINT 4  URSAN  RUNOFF LOADS

 h>FOR POINT SOURCES: ENTER FLOW.CONCENTRATION
 |>FOR NON-POINT SOURCES: ENTER  UNIT AREA  LOADS(KG/KM2/YR)
 >8UCYRUS CITY
  2.5,4.0
 >               STORM
  250.
 [>              COMBINED
  900.
 >UPPER  SANDUSKY CITY
  1.5,4.0
 >               STORM
   0,0

   250.
   TIFFIN  CITY
   3.2,4.0

   250.

   1000.
 COMBINED



  STORM

 COMBINED
                                      1O
                                      u

-------
j> FREMONT CITY
  5. 1 ,4.0
j>                STORM
  2SO.
>           -^   COMBINED
  1000.

j>  INPUT FOR UORKSHEET 3 - RURAL NON-CROPLAND  AREAS

CENTER  AREA,UAL FORT GRASSLAND,WOODLAND
NLQSS  CREEK
  11.33,10.,25.04,10.
> BROKEN SWORD
  1.59,10.,13.17,10.
f> UPPER  SANDUSKY RIVER
  '12.31 , 10. ,34.33, 10.
|> TYMOCHTES  CREEK
  3.04,25.,47.13,10.
i> ill DOLE SANDUSKY
  17.27,10.,57.38,10.
PHONEY  CREEK
  3.17,10.,44.07,10.
J>WOLF CREEX
  7.57,10.,22.33,10.
>RGCX CREHK
  12.14,10.,55.47,10.
BLOWER  SANDUSKY (SOIL 1)
  10.0,23.,74.54,10.
OLOWER  SANDUSKY (SOIL 23
  3.25,10.,0.,10.

   INPUT FOR UORKSHEET 4 - RURAL CROPLAND AREAS
  IS  A POLLUTANT DELIVERY RATIO KNOWN FOR EACH SOURCE
  NO

DENTER  TOTAL POLLUTANT LOAD AT MOUTH OF 3AsiN(KG/YR)
  421000.

CENTER  USLE COEFFICIENTS R,K,LSLOSS CREEK
  125. ,'.35, .402, .233, 1 .
|> BROKEN SWORD
  125.,.33,.424,.233,i.
t>UPPER  SANDUSXY RIVER
  130.,.42,.426,.245,1.
OTYMOCHTEE  CREEK
  133.,.32,.357,.280,1.
(>MIDDLE SANDUSKY
  138. , .38, .381', .260, 1 .
5NEY  CREEK
  125.,'.35, .338,.237,1.
[>WOLF CREEK
  1'25. ,Y29. .256, .237, 1.
f>ROCK CREEK
  125. , .34', .427, .237,1 .
>LQWER  SANDUSKY (SOIL i>
  125. , .32, .410, .2S8-, 1,
>LOWER  SANDUSKY (SOIL 2)
  125.,.28,.434,.237, 1.
j> ENTER COMMAND
  SAVE

-------
[> ENTER COMMAND
  PERCENT URBAN
CENTER COMMAND
  tONTROL URBAN(CONG,UAL/STQRM,UBL/COMBINED)'

 0     STAGS 1 CONTROL STRATEGIES FOR  URBAN  SOURCES

t> ENTER PERCENT REDUCTIONS' FOR SOURCE  CONC
N IN DECIMAL FORM (E.G. ENTER  257. AS  .235
  '.75

j>ENTER PERCENT REDUCTIONS FOR NONPOINT  STORM SEWER UflL
OIN DECIMAL FORM <.G. ENTER  25% AS  .25)
  .25

CENTER PERCENT REDUCTIONS FOR NQNPQINT  COMBINED UAL
|> IN DECIMAL FORM (E.G. ENTER  252 AS  .25)
  .OS
 CENTER COMMAND
  CON URB     STAGE 2 CONTROL STRATEGIES  FOR  URBAN SOURCES

 [>ENTER PERCENT REDUCTIONS FOR  SOURCE  CONC
 5- IN DECIMAL FORM  (E.G. ENTER 25*  AS  .25)
  ,50

 DENTER PERCENT REDUCTIONS FOR  NONPOINT STORM SEWER UAL
 j>IN DECIMAL FORM  (E.G. ENTER 252  AS  .25)
  .25

 CENTER PERCENT REDUCTIONS FOR  NONPOINT COMBINED UAL
 j> IN DECIMAL FORM  (E.G. ENTER 252  AS  .25)
  .25

-------
        COMMAND
  CONTROL RURAL(C)

j>      5TACE 1  CONTROL STRATEOIES FOR RURAL  SOURCES

CENTER CONTROL VALUES PER SOURCE FOR C  -
[>LQSS CREEK
  , 109
!>3RQKEN SWORD
  '.099
j>UPPER SANOUSKY RIMER
  . 103
OTYMOCHTEE CREEK
  . 108
[> MIDDLE SANDUSKY
  . 1 10
i> HONEY CREEK
  . 101
i>WQLF CREEK
  . 108
|>ROCK CREEK
  . 105
|> LOWER SANDUSKY (SOIL 1)
  . US
[> LOWER SANDUSKY (SOIL 2)
  .033
 DENTER COMMAND
  CON RUR(C)

 >     STAGE 2 CONTROL STRATEGIES FOR- RURAL  SOURCES

  ENTER CONTROL VALUES PER SOURCE FOR C  , -
  LOSS CREEK
  '.034
 DSROKEN SWORD
  ,035
 i> UPPER SANDUSKY RIMER
  .034
 >TYMOCHTEE CREEK
  .032
 > MIDDLE SANDUSKY
  .035
 j> HONEY CREEK
  .034
 [>WOLF CREEK
  .032
 [> ROCK CREEK
  .033
 j> LOWER SANDUSKY (SOIL 1)
 . ,03S
 SLOWER SANDUSKY (SOIL 21
  .033
> ENTER COMMAND
  COST URBAN,RURAL>UR8AN,RURAL

j>      STAGE 1 COSTS OF CONTROL FOR  URBAN  SOURCES

j> ENTER PER UNIT COSTS FOR  POINT,STORM,COMBINED SOURCES
  2.4,7*00.,7400.
                                 21

-------
>      STAGE 1 COSTS OF CONTROL  FOR RURAL SOURCES

j> cNTER PER UNIT COSTS FOR  RURAL SOURCES
  S3.'

[>      STAGE 2 COSTS OF CONTROL  FOR URBAN SOURCES

j> SNTER PER UNIT COSTS FOR  POINT,STORM,COMBINED SOURCES
  3.5,3600.,24700.

l>     STAGE 2 COSTS OF CONTROL  FOR RURAL SOURCES

j> ENTER PER UNIT COSTS FOR  RURAL SOURCES
  3000.
  5NTER COMMAND
  WORKSHEETS) SLi.
 t> ENTER COMMAND
  5AUE CONTROL
 0 SNTEfl COMMAND
  STOP
j>#EXECUTION  TERMINATED

-------
Sample Worksheet Output

         Once the command WORKSHEET(S) ALL  is  given,  all  final worksheet forms
are written  to  the  data  file on  unit number  3.   An  example of  the printed
output from this data file follows.  These  output  sheets  do  not  necessarily
correspond to  the  example  terminal  session,  although most  of the  names  and
data are the same.
                                       23

-------
                                               PHYSICAL  LAYOUT
ro
SANDUSKY RIVER
LAKE FRIE
SOURCE
LOSS CREEK
LOSS CREEK
BUCYRUS CITY
STORM
COMBINED
BROKEN SWTtD
BROKEN SWORD
UPPER SANOUSKY RIVER
UPPER SANOUSKY RI VER
UPPER SANOUSKY f ITY
STOPM
COMBINED
TYMOCHTEE CREEK
TYMOCHTEE CREEK
MIDDLE SANOUSKY
MIDDLE SANDUSKY
HOMEY C^EEK
HONEY CREEK
TIFFIN CITY
STORM
COMBINED
WOLF CREEK
WOLF CREEK
ROCK CREEK
ROCK CREEK
FREMONT C ITY
STORM
COMBINED
LOWER SANOUSKY (SO IL 1 I
LOWER SANOUSKY (SOIL 1
LOWER SANDUSKY (SOU 2)
LOWER SANOUSKY (SOIL ?)
TOTAL

TYPE
NON-CROPLAND
CROPLAND
MUNICIPAL


NON-CROP I ANO
CROPLAND
NON-CROPLAND
CROPLAND
MUNICIPAL


NOM-CROPLANID
CROPLAND
NON-CROPLANO
CROPLAND
NON -CROPLAND
C R OP Lft NO
MUNIC IPAL


NON-CROP! ANO
CROPLAND
NON-CROPL A^O
CROPLAND
MUNICI PAL


NON-CRO:M. AW
CROPLAND
NON-CROPLANO
CROPl AND


POSITION
1
Z
3
4
5
6
7
0
9
10
11
12
13
14
15
16
I 1
18
19
20
21
22
23
24
25
?6
?7
28
29
30
31
3?


POINT
OF ENTRY
A
A
A
A
A
8
H
fl
R
B
B
B
C
C
C
C
0
0
D
0
D
E
E
E
F
E
E
E
F
F
F
F

WORKSHEET 1
AREA UNITS
KM2 SERVED SURFACE FEATURES
36 .9
189. 8
13500.
1.3
7.2
21.8
187 .?.
47. 2
274.6
6253.
0.0
6.7
56. 2
528.4
85.2
542. 4
47.2
343.5
26000.
7.0
10.4
30.5
3 '+ 3 . I
63. 6
409.9
19730.
I. 4
' 12.3
S4.5
243. 6
8.3
100. 0
3695.1 65480.

-------
                                                     POINT  AND URBAN RUNOFF  LOADS
                                                        TOTAL  POLLUTANT LOADS
                                                                                                     WORKSHEET 2
cn
SOURCF
INI Tl AL CONOt TION
RUfYRUS CITY
UPPER SANOUSKY Cr TY
T IFF IN CITY
FREMONT CITY
TOTAl
STAGE 1
RUCYRUS CI TY
UPPFR SANOUSKY CITY
TIFFIN CI TY
FRFHONT CITY
TOTAL
STAGE 2
DUCYRUS CITY
UPPER SANDUSKY CI TY
TIFF IN CITY
FREMONT CITY
TOTAL
POS I
TION

3
13
19
26


3
10
19
26


^
13
VI
26

FLOW
MOO

2.5
1.5
3.2
5.1


2.5
1.5
3.?
5.1


2.5
1.5
3. ?
5.1

POIN1
CONC .
MG/L

4.0
4.0
4.0
4.T


L.O
1.0
1.3
1.0


0.5
0.5
0. 5
0.5

LO AO
KG/YR

13P20.
8292.
17690.
78193 .
67994 .

3455.
2073.
4422 .
7048.
16999.

1728.
1037.
7711 .
3524.
8499.
STORM
APFA UAL LOAD
KM2 KG/KM2/YR KG/YR

t.3
0 .0
7.0
1 .4


1.3
0.0
7.0
1 .4


I. 3
3,0
7.0
1.4


250.0
0.0
250.0
250.0


137.5
-0. 0
187.5
Ifl7.5


I 40 . 6
-0.0
140.6
140.6


325.
3.
1753.
353.
242r>.

244.
0.
1313.
252.
1819.

183.
3,
904.
197.
1364.
COMBINED
A*F
-------
                                                     RURAL NON-CROPLANO  AREAS
                                                      TOTAL POLLUTANT  LOADS
                                                                                         rfOR
-------
                                                         RURAL CROPIAND ARFAS
                                  UNIVERSAL SOIL LOSS  EQUATION/TOTAL  POLLUTANT  LOA} ESTIMATES
                                                                                                                                     WORKSHEET 4
ho
SOURCE
INITIAL CONDITION
LOSS CREEK
BROKEN SWORD
UPPfR SANDUSKY RIVER
TYMOCHTEF C3EEK
MIDDLE SANDUSKY
HONEY CREEK
WOLF CRFEK
ROCK CREEK
LOW5R SANDUSKY (SOIL U
I OWFR SANDUSKY (SOIL 21
TOTAL
STAGE I
LOSS CREtK
BROKEN SVmO
UPPER SANOUSKY PIVfR
TYMOCHTEE CREFK
MIOOt F SANOUSKY
HONFY CRFEK
WOLF :REEK
POCK CRFEK
LOWER SANDUSKY ISOIL l
LOWER SANOUSKY (SOIL ?
TOTAL
STAGE 2
LOSS CREEK
BROKEN SHORT
UPPFH S6NDUSKY RIVER
TYMOCHTEE CREEK
MIDDLE SANOUSKY
HONFY CRFEK
WOIF CREEK
ROCK CREFK
LOWFR SANDUSKY (SOIL 1
LOWER SANDUSKY (SOIL 21
T1TAL
POSI
T ION

2
7
9
14
16
in
23
25
10
12


2
i
9
14
16
ia
21
25
10
32


2
7
9
14
16
IB
23
?S
30
32

CROPl AMD
AREA
IHAI

139R4 .
18719.
?746T.
52840.
54236.
34355.
34111.
409PO.
24355 .
10000.
316250.

18984.
18719.
27460.
52840.
54236.
14355.
1431 1.
40990.
24355.
10000.
116250.

18914.
18719.
2746C.
57840.
54236 .
34355.
34311.
40990.
24355.
10000.
316250.
I
R

125.
125.
110.
138.
138.
125.
125.
125.
125.
125.


125.
125.
130.
138.
138.
125.
125.
125.
125.
125.


125.
125.
130.
138.
138 .
125.
125.
125.
125.
125.

JSLF COEFFIC
< LS

0.35 0.402
0. 38 0.424
0.42 0.426
0.32 0.357
0. 38 0.3fll
0.35 0.338
0.29 0.256
0.34 0. 427
3.32 0.410
0. ?8 0. 434


0.35 0.402
3.38 0.424
0.42 0.426
0.32 0.357
0.36 0.381
0.35 0. 338
3.29 0 .256
0. 34 0. 427
0.32 0.410
0.28 0.434


0. 35 0.402
0.18 0.424
0.42 0.426
0.32 0.357
3.38 0.381
0. 35 0. 338
0.29 0.256
0.34 0.427
0.32 0.410
3 .28 0.434

, I F. NT S
C

3.233
0.213
0.245
0.260
0.260
0. 237
0.237
0.237
0.268
0.237


0. 108
3 .399
0. 103
0. 108
0.110
0. 101
0. 108
0.105
0. 116
0 .099


0. 034
C.035
3.334
0.032
0,035
0.034
0.032
3 .033
0.036
0.033

P T/

.30
.00
. 00
.33
.00
.03 .
.30
. 00
.00
.00


I. 00
1.33
.00
.00
.00
. 00
.00
.00
.00
I. 00


1.00
.03
.00
. 00
,00
.00
.00
.30
.00
.00

SOIL
LOSS
AC/YR 

4.1
4 .7
5. 7
4.1
5.2
3. 5
2.2
4.3
4.4
3 .6
41.8

1.9
2.3
2.4
1. 7
2.2
1.5
1.0
1 .9
1.9
1.5
19,0

O.S
0. 7
0.8
0.5
0.7
0.5
0.1
0.6
3.6
0.5
5 .
-------
                                                          LOADING SUMMARY
                                                      TOTAL POLLUTANT LOADS
00
                                                                                                 WORKSHEET  5
SOURCE
LOSS CREEK
CROPLAND
BUCYRUS CITY
STORM
COMBINFO
BROKEN SWORD
CROPLAND
UPPER SANOUSKY R t VFR
CROPLAND
UPPER SANOUSKY CITY
STORM
COMBINED
TYMOCHTEE C^EEK
CROPL AMD
MIDDLE SANOUSKY
CROPLAND
HONFY CREEK
CROPLAND
T IFF IN CITY
STORM
COMBINED
WOLF CREFK
CROPI AND
ROCK CREEK
CROPLAND
FREMONT C ITY
STORM
COMBINED
LOWER SANDUSKY (SOFL 1 (
CROPLAND
LOWER SANOUSKY (SOIL 2(
CROPLAND
TOTAL
POSITION
I
2
3
4
5
6
7
R
9
10
1 1
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
33
31
32

I NI TI AL LOAD TO
WATERSHED BASIN
KG/YR
368.7
18321 .7
13820.0
125.0
6'iflO.O
217.6
206B7.9
471. 9
36854.2
8292.0
0.0
1675.0
697.3
51009. 5
352.3
66353.8
472. 4
20356.4
17689.6
1750.0
10400.0
304.6
17772.5
686.1
41520. 3
28192.8
350.0
12300.0
995.4
25210. 7
82.5
8478.6
420987. 9
OH TRILLED
LOAD
K3/YH
STAGE I STAGE 2

3492.5
3455.0
243.8
6091.2

8790. t

15493.8
2073.0
0.0
1574.5

21188.6

28372.8

12084.4
4422 .4
1312.5
9776.0

8098. 8

18395.1
7048.2
262.5
11562. 0

10912.1

3541.7
182R00.6

2673.6
1727.5
182. 8
4568.4

3107.6

5114. 5
1036.5
0.0
1180.9

S273.1

8932.3

4068.0
2211 .2
984.4
7332.0

2399. 7

5791.3
3524. 1
196.9
8671 .5

3385.5

I 1B0.6
74538.1
U1AO ^EOJCT IONS
KG/YR
STAGE I STAGE 2

9829.2
13365 .0
81. 2
388.8

11897.8

21360.4
6219.0
0.0
100. 5

2J323.9

38281 .0

16272.0
13267.2
437.5
624.0

9673. 7

23125.2
21144.6
87.5
738.0

14299 .6

4936.9
? 32948.3

5618.9
1727 .5
60.9
1522.8

5682. 5

ID379.3
1036.5
0.3
393.6

1 t?l0.5

19140.6

8016. 4
2211.2
328.1
2444.0

5699.2

12S13.8
3524.1
65.6
2190.5

7525.6

2361.1
133352.4

-------
                                 PROGRAM COSTS
                        TOTAL  POLLUTANT P.FOUCT1QNS
                                                                         WORKSHEET 6
SOURCE
LOSS CREEK
BUCYRUS CITY
STORM
r.oMniNED
BROKEN SWORD
UPPFR SANOUSKY PIVER
UPPER SANOUSKY CITY
STORM
COMBINED
TYMOCHTEE CREEK
MIDDLE SANOUSKY
MONEY CREEK
TIFFIN CI TY
STOP "4
COMBINED
WOLF CREEK
ROCK CREEK
FREMONT CITY
STORM
COMBINED
LOWER SANOUSKY (SOIL U
CNO LOWER SANDUSKY (SOIL 2)
UD
POSITION
2
3
4
5
7
9
to
It
tz
14
16
in
19
20
?l 4
23
25
26
27
28
30
32

AREA
TREATED UNITS
KM2 SERVED
189. 8
13500.
1 .3
7.2
187 .2
274.6
6250.
3.0
6. 7
528.4
542.4
343.6
26000.
7.0
10.4
343.1
409. 9
19730.
1 .4
t2. 3
243.6
100.0

PER UNIT
STAGE I
65.
2.
743}.
7400.
65.
65.
2."
7433 .
7400.
65.
65.
65.
2.
7433.
7400.
65.
65.
2.
7433 .
7400.
65.
65.

COSTS
STAGE 2
3303.
4.
8600.
24700.
3000.
3300.
4.
8600.
24700.
3003.
3003.
3000.
4.
esoo.
24700.
3003.
3303.
4.
8600.
?4703.
1000.
3300.

Tor AL
STA3E 1
12340.
32400.
9620.
53280.
12167.
17849.
15000.
0.
49593.
34346.
35253.
223H.
62400.
51830 .
76960.
22332.
26643.
47352.
10360.
?i3eo.
15831.
6530.

COSTS
STAGE 2
569520.
48600.
II ISO.
177843.
561570.
823800.
22500.
0.
165490.
1585199.
1627080.
1033650.
93600.
60200.
256830.
1029330.
1229699.
7 1 C2 8 .
12040.
303813.
730650.
300000.

TOTAL
                                                                    735334,
10713662.

-------
                                                    COST-EFFECTIVENESS  ANALYSIS
                                                      TOTAL POLLUTANT LOADS
                                                                                                                                   WORKSHEET  7
CO
O
SOURCE
STAGF 1
LOSS CRFEK
CPOPl AND
BUG YRUS Cr TV
STORM
COMBINED
BROKEN SWORD
CROPLAND
UPPER SANOUSKY RIVER
CROPLAND
UPPFR SANOUSKY CITY
STORM
COMBINED
TYMOCHTEF CRFEK
CROPLAND
MIOOLF SAN DUSKY
CROPLAND
HONEY CREEK
CROPLAND
TIFFIN Cl TY
STOR*
COMBINED
WOLF CREEK
CROPLAND
ROCK CREEK
CROPLAND
FRFMONT CITY
STORM
COMBINED
LOWFR SANDUSKY (SOIL 1)
CROPLAND
LOWER SANDUSKY (SOIL 31
CROPLAND
SUBTOTAL
TOTAL
POSIT I3N

1
?
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
IB
19
20
21
22
23
24
25
26
27
28
29
30
31
32


BIO-
EFFFCTIVF AVAILABLE
TRANSMISSION FRACTION

1.0
1.0
1.3
1.0
1.0
1 .0
1.0
1.0
1.0
1.0
1.0
1.0
1.0
1.3
I. 0
1.0
1.0
1.0
1.3
1.0
1.0
1.0
1.0
1.0
1.0
1.0
I .0
1.0
1.0
1.0
1.0
1.0


TOTAL LOAD
TO
SURFACE WATER
I KG/YRJ

369.
18322.
13820.
3? 5.
6480.
218.
20688.
472.
36854.
079?.
0.
1675.
697.
51009.
85?.
66354.
472.
28356.
17690.
I 750.
10400.
305.
17772.
686.
41520.
28193.
350.
12330.
995.
25211.
P?.
8479.

4209
-------
COST-EFFECTIVENESS ANALYSIS
  TOTAL  POLLUTANT LOADS
                                                                                 WORK SHEE T 7
SOURCE
STACF 2
LOSS CREEK
CROPL \ND
BUCYRHS CITY
STORM
COMB IN ED
BRCKEN SWORD
CROPL AND
UPPER SANOUSKY RIVER
CROPLAND
UPPER SANDUSKY C I TY
STORM
C OMBI NED
TYMOCHTEE CREEK
CROPLAND
MIDDLE SANOUSKY
CROPLAND
HONEY CREEK
CROPLAND
T IFF IN C ITY
STORM
COMBINED
WOLF CREEK
CROPLAND
ROCK CREEK
CROPLAND
FREMONT CI TY
STORM
COMD! NED
LOWER SANOUSKY (SOIL I)
CROPLAND
LOWER SANDUSKY (SOIL 2!
CROPL AMD
SURTOT Al
TOTAl
POSITION

1
2
3
4
5
6
T
8
9
10
11
12
13
14
IS
16
\l
18
to
20
21
22
23
24
25
26
2?
28
29
30
31
32


TOTAL LOAD
BIO- TO
EFFECTIVE AVAILABLE SURFACE WATER
TRANSMISSION FRACTION (KG/YR)

1.0
1.0
1.0
1.3
1.0
1.0
1.0
1.0
1.0
1.0
1.0
1.0
1.0
1.0
1.0
1.0
1 .0
1.0
1.0
1.0
1. 0
1.0
1.0
1.0
1.0
1.0
1.0
I .0
1.0
1.0
1.3
I. 0



369.
183?2.
13820.
325.
6480.
218.
20688.
47?.
36854.
8292.
0.
1675.
697.
51009.
852.
. 66354.
472.
26356.
1 7690.
1750.
10400.
305.
17772.
636.
41520.
28 193.
35^.
12300.
995.
25211.
33.
8'+79.

420988.
LOAD AT
M3UTH
(KG/YR>

369.
18322.
13829.
325.
5433 .
218.
20688.
47?.
36854.
8292.
0.
167-5.
697.
51009.
852.
6S35'+.
472.
28356.
17690.
I 750.
1343) .
305.
17772.
686.
41 520.
28.193.
350.
12300.
995.
25211.
83.
147? .

420988.
1 OAO
REDUCTION COST OF
AT 40UTH PROGRAM
UG/YRJ (t/YRI
STAGE 2

5819.
1728 .
61.
1523.

5682.

103 79.
1037.

394.

14910.

19141.

8016.
2211 .
32H.
2444.

5699.

12614.
3524.
66 .
2891.

7526.

2361.
108352.
341301.
STAGE 2

569520.
48600.
11180.
177840.

561570.

823833.
22500.

165490.

1585199.

1627383.

1030650.
93600.
60200.
256860.

1029330.

1229699.
71028.
12043.
303810.

730653.

300000.

10710662.
COST
PER UNIT
REMOVED COST-
AT MOUTH EFFECTIVE
($/KGl RANK
STAGE 2

97. 9
28.1
183.5
116.8

98.8

79.4
21.7

420.4

136.3

85.0

128.6
4?. 3
183.5
105.1

183.6

97.5
20.2
183.5
105.1

97. I

127.1




23
17
38
28

24

19
16

41

27

20

35
18
39
25

37

22
15
40
26

21

34



-------
  SUMMARY  OF  PROGRAMS
TOTAL POLLUTANT LOADS
                                                                     WORKSHEET  8
SOURCE
CROPLAND - UPPER SANOUSKY RIVER
CROPLAND - MIDDLE SANDUSKY
CROPLAND - BROKEN SWORD
CROPLAND - LOWER SANDUSKY (SOIL 11
CROPLAND - TYMOCHTCE T.RFFK
CROPLAND - ROCK CREEK
CROPLAND - I OSS CRFFK
CROPLAND - LOWER SANDUSKY (SOIL 21
CROPLAND - HONEY CREEK
MUNICIPAL - FREM3NT r ITY
CROPLAND - WOLF CREEK
MUNICIPAL - UPPER SANDUSKY CITY
MUNICIPAL - BU CYRUS CITY
MUNICI PAL - TIFFIN CITY
MUNICIPAL - FREMUNT CITY
MUNICIPAL - UPPER SANDUSKY CITY
MUNICIPAL - BUCYRUS CITY
MUNICIPAL - T IFFIN CITY
CROPLAND - UPPER SANOUSKY RIVER
CROPLAND - MIDDLE SAN3USKY
CROPLAND - LOWER SANOJSKY (SOIL 11
CROPLAND - ROCK CREEK
CROPLAND - LOSS CREEK
CROPLAND - BROKEN SWORD
COMBINED - TIFFIN CITY
COMBINED - FREMONT CITY
CROPLAND - TYMOCIITEE CRFFK
COMBINED - BUCYRUS CITY
STORM - FREMONT CITY
STORM - TIFFIN CITY
STORM - BUCYHUS Cl TY
COMBINED - T IFFIN CITY
COMBINED - FREMONT CITY
CROPLAND - LOWER SANDUSKY (SOIL 2)
CROPLAND - HONEY .CREFK
COMBINED - BUCYPtJS CITY
CROPLAND - WOt. f CREFK
STORM - BUCYRUS CI TY
STORM - TIFFIN CITY
STORM - FREMONT CITY
C3MBISED - UPPER SANOUSKY CITY
COMBINED - UPPER SANOJSKY CITY
RANK
I
2
3
5
6
7
0
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
?5
26
27
28
29
33
3 1
32
33
34
35
36
37
30
39
41
4?
ST AGE
1
1
1
I
I
I
I
1
I
1
t
I
I
1
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
1
2
2
2
1
LOAD
REDUCTION
(KG/YR 
21360:
38281.
UB98.
14299.
29821.
23125.
9B29.
4937.
16272.
21145.
9674.
6219.
10365.
13267.
352'+.
1037.
1728.
2211.
10379.
19141.
7526.
12614.
5819.
5682.
2444.
2891.
14910.
1523.
88.
438.
624.
738.
2361.
8016.
389 .
5699.
61.
328.
66.
394.
101.
SUM LOAD
REOUCT ION
(KG/Y* )
21360.
59641.
/1539.
85038.
115659.
138784.
143613.
153550.
169822.
193966.
200640.
206859.
217224.
230491.
234315.
235052.
236779.
238990.
249370.
268510.
276036.
288650.
294468.
300151.
302595.
305485.
323396.
321919.
3??006.
322444.
3??525.
323149.
323887.
326248.
334264.
334653.
340352.
340413.
343741 .
343807.
341200.
341331 .
PERCENT
*EDUC TION
5.1
14.2
17.0
20.4
27.5
33.0
35.3
36.5
40. 3
45.4
47.7
49.1
51.6
54. 8
55.6
55.8
56.2
56.8
59.2
63.8
65.6
68.6
69.9
71.3
71.9
7? .6
76. I
76.5
76.5
76.6
76.6
75.8
76. 9
77.5
79.4
79.5
80.8
80. 9
80.9
81. 0
ai.o
81 .1
COST OF
REOUCT ION
(t/YRI
17849.
35253.
12167.
15831.
34346.
25643.
12340.
5503.
22331.
47352.
22302.
15000.
32430.
62400.
71028.
22500.
48600.
93600.
823303.
1627080.
730650.
1229699.
569520.
561573.
2568BO.
303813.
1585199.
177840.
10360.
51800.
9620.
76960.
91020.
300300.
1030650.
532BO.
1029333 .
11180.
6020C.
12343.
165490.
49593.
SUM OF
REDUCTION
COSTS
U/YR)
17849.
53102.
65270.
81131.
115446.
142090.
154429.
163929.
183260.
230612.
252914.
267914.
300314.
362714.
433742.
456242.
504842.
598442.
1422242.
3049322.
3779972.
5009671 .
5579190.
6143763.
6397639.
6701449.
8286648.
8464487.
8474846.
8526645.
8536266.
8613225.
8704245.
9004245.
13334895.
10088174.
11117504.
1128684.
1188884.
1233923.
1366412.
1415991 .

-------
Program Flow Chart and Listing

         The flow chart shown  in  Figure 2 indicates that  the program is built
around a  command  interpreter.  This  interpreter screens  all  commands,  checks
their validity, and  then  activates the proper  subroutine  (indicated in script
print).  The fourteen legal commands are also shown in Figure 2.

         The  following  program  listings  are  organized  by  major   subroutines
indicated  in   Figure  2.     Documentation has  been  included  in  the  form of
comments throughout  the program  code to  assist  in  more detailed understanding
of its operation.  This code  is  fairly extensive so that the program would run
in a simple manner for  the users.   Individuals  interested  in obtaining a  tape
of these  programs,  rather than  entering  all  the  lines  from  scratch,  should
contact Or.  William  C.  Sonzogni,  at  the Great Lakes  Environmental  Research
Laboratory, NOAA,  Department  of  Commerce,  Ann  Arbor,  Michigan  48104,  phone:
313/668-2249.

         This main program has been  broken up into 4  source  files  for ease in
writing and editing.  To  compile  the WATERSHED main program  four files must be
linked together.   These four files  are  identified  by  the  major subroutine in
each  file.   Each  file  shows  the  line numbers  starting with  number  "1".   An
example of this chain on the Michigan Terminal System  is as follows:

         $RUN *FTN PAR=S=WTRSHD+WRKSHT+WTRSAV+WTRCTL L=WATERSHED
         where
*FTN calls the Fortran Compiler,
WTRSHD, WRKSHT, WTRSAV, WTRCTL are the four surface files,
and- WATERSHED is the object file for the compiled program.
         The  start  of the  command  and subrouting  sections  of the program  are
marked with a bracket and underline.
                                       33

-------
     Key
(SUBROUTINES V
j COMMAND
                          Start
                                     Figure   2

                                     Watershed Program Flow Chart
/Initial-
(  ization
WRIMI
F     Input of
     Initial
     State
     WTRIWP
    INPUT
     Permanent
     Storage
      I/Q
    WTRSAf
                 READ
                    LOAD
                                                                Listing of
                                                                Commands

                                                                 WTRHLP
          TITLE
HELP
                    Command Interpreter


                    ISRCH LEA/GTH I.WEX
                     WBLAWK  JSQRT
   SAVE
                     WORKSHEET
                                                    WORKSHEET
                                                WRKSHT
                                                                                  CONTROL
                                                                         PERCENT
                                                                         XPERCENT
                                                                             Input of Con-
                                                                             trol Strategic

                                                                             WTRCTL CTLIWI
                                                                       COST
                                                                       XCOS
Input of
Control Costs

  OTRCST
                                                                                TRANSMISSItN
                                                       Alter
                                                       Transmission
                                                                    Rank
                                                                 Cont.Strat.
                                                                    RAWK
                                                                                                          STOP
                                                                                                      Stop

-------
                                         The  first  source  file is called




                                                   WTRSHD
en

-------
CO
CTt
 3
 4
 S
 6
 7
 fl
 9
10
11
12
13
14
15
16
17
18
19
20
21
2?
23
24
25
26
27
28
29
30
31
3?
33
34
35
36
37
3fl
39
40
M
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
50
59
                          MAIN  PROGRAM FOP WATERSHED POLLUTION MANAGEMENT  PACKAGE
                             ACCEPTS  COMMANDS  AND CALLS SUBROUTIMES BANKING
                             T.OST-EFFFCTI VENFSS OF ALTERNATIVE CONTROL  STRATEGIES
                          WMTTFN FOP GREAT  LAKES BAS IN COMM (SS 10V
                                  JAN - JUN  IQftl   BY MICHAEL OONIHUE
                        f.
                     ****
                                                ANN  ARBOR, MI
                         INTFGFP  CMOI801.RLNK ,COM A,ALL,NJMHRK( 13 I, OPT JRB( 5>, ")P TRUL I 81,
                                  3PTVALI0),JVAL(3)
 LOGICAL  L INPUT , LOOU<* R , LODRMC , LODPC.P , L4U AL , I INl.L IN2,LINl,LI'4't
 LOGICAL  URRClL.RULCTL.UCTLOOt 3) ,RCTLOO(3I , UPRCNT .UXPCNT .RPRCNT ,
f.         PXPCNT ,URBCST,RULCST,LPANK
 INTfr.EP  OTHUR , KT IT LE ( 4 , 40 I ,
r.  SURFFA ( 210,3 i , CTLOO<213, 3),CTUSLe(3,33,5l
 01 MEN SI UN STMCTLI 30,3) , STMARAI33 ,3) .COMCT Li 33 , 3 I . COMAR A( 33 , 3 ),
E           OTIC IX (30, 3 1,OTIARA(?0,3I ,OT2C TL< 30, 3) ,DT2 AR A( 30 ,3 )
 DIMENSION PFLOWt30l,PCONC(30,UALS ( 30 1 , J ALC < 30 , W?UAL t< 301,
          W2U , TLERU3 ( I 2) ,
I         APOEmO) ,AREACN<4 I ,fJ4|.C(W(4l
 OJMFNSION GRASA( 30I,(JALG( 301 ,WLNOA( 301 ,UALU(30) .W30TAI (301 ,
f,           W3'JALl(30l,3L)AL2 (301, W3UAL3( 331 ,^30TA2l 301 , H30TA 3t 30)
 PEAL  LOORNH 33 ,LOORM2(30I ,L001 W3 ( 30 > , L002W3 (30 l,t003H3(33 I
 OIMENS ION iJSLERI 30I.USLEM 30),USLELS( 30) ,USLEC (30( ,W4UAL(30I ,
&           USLE<>(30) .SOILS I (30 ) , SOILS 2 ( 30 ) , T TL ER ( 30I,RATIO( 301
 OIMFMSI3N POIF(2lO,3r,TCOST<2LD,3J ,PUf OST 2 t 0, 3 )
 DIMENSION PMO'JTH(210 1 , 0 IFMTHI 210, 3J , CPU FM(  21 0, 3 ) , KE RH NK( 2 10 ,3 )
 COMMON  /WTRin/   IN, I OUT ,NSRCE,KT IT LE, NT L E, NURB, NRJ^CP , 'JR'JC*"
         /WTRTT/   L INPUT, LOO UP 8 ,1 OORNC ,LIN1 ,11 N2 , t \ N3 , LI N4 , OTHURB,
                   OTHR'JL.LOORCP.TYPCOO, J IN, JOUT , L 4UAL ,KOUT , LRANK
         /WRKSH1/  SRCF , ITYP ,NPOS , APOE , AUN IT ,SURF E A, TL EUR I , TL EUR 2
         /WRS LEK.USI  FLS ,USL FC, 1JSL FP , SO IL S 1 ,
r.                  SOILS?, TTI.FRiM4UAL, RATIO
 COMMON  /WRKSH6/  PDI F, TCOST, PUCOST, TR^SM^J ,MTUTH ,0 IFMTH , : PUREM,
&                  KERANK
 COMMON  /WTRCON/  UCTLOD,"CTLOO,t)RBCTL .RULCTL .UPPCNT , UXPCNT , RPRCNT,
F.                  RXPCNT,OPTVAt , NOPT, JRflC S T , RLLCS T , AREAC'J, IJALCOM
 OI'IFHSION C TLFLWI 30,3) ,C TLCNC ( 30 ,3 I
 niMFNS ION CTLF(30, 3),Sr)ILCU 30, 31, SO H C 21 3T, 31 ,CTLERO( 30,3) ,
f.          CUALW.I30 ,3 )
 DIMENSION T01CSTI 3) ,TOTRFM(3) ,KNDX( 5401 , F INCST ( 540 ) ,F I NREM (54 3 ) ,
E           ISFINI543)
 INTFGF.P  F|NSP,C(540,43)
 COMMON  /WRKSH1/  TOTC ST, TT TPEM .T'lTLCD , TOTMT-) , KNDX ,F I NSRC , F I MCST ,
f.                  FINPFM, I SPIN, MUM
 f. OH MTV  /UBNCTL/  CTI.FLW.C TLCNC ,C T Lf)D, STMCTL , ST MAP A, COMCT L ,
t                COMARA.TTlCTLiOT IA A ,OT2C TLf OT2ARA
 COMMON  /RFOCTt/  CTUS LE ,CT LF , SOIL Cl , SOIL C2, CTL FRO, CUALW4
                         COMMON
                         COMMON
                         COMMON
' ,  A  ,  t ' , ' ?. ' , ' 3 , '
                                                           ' 5 ' , '6 
                         OAT A RINK,COM\,ALL,N'JM.-JRK/' ,
                        f,            8 ' , ' 9 ' , ' ^  I
                         OAT A L PAR EN, IP PAR1, I SI A SH, I TEE .lOO.MMM/' ( ',)','/', T' , ' 0 , ' M1 /
                            A I"inPCF. UnAN.NCPt AN, fCPL A "I, IRU At /  S ', MJ ', 'N ', 'C ','''/

-------
61
62
63
64
65
66
67
(, B
69
70
71
7?
73
74
75
76
77
78
79
80
81
82
83
^4
85
86
87
8B
89
90
91
9?
93
94
95
96
97
98
99
100
101
10?
103
104
105
106
107
108
109
t 10
1 11
112
113
114
115
I 16
1 17
1 10
1 19
1 20











r





c




f


f
^f
c
c
c
c
c
c
c
r
r
r
c
r
c
r
C
C


C
f.
c









r



DATA 01' rURH/'F  , 'C  , 'A' , "U" ,' L" /
OAT A HPTRUL/  R '.K'.'L'.'C'.'P'.'E'.'U'.'LV
N = 30
I SR= I
ISU=l
ICS=1
ICS'J=1
KNTPO
KNTU*0
KNTP2=0
KMTU2=T
INITIALI7E ARPAYS t IOGICAL FLAGS
CALL WTRINHNI
WRITF IOJT ,2 )
.2 FORMAT ( -' , 10X.1 WAfFRSHED MANAGEMENT CONTROL PACKAGE* 1
10 on i? 1=1,80
12 CMDUt-BLNK
RFAO COMMAND LINE
WRITE! IflUT, 15 )
15 FDRMATC -ENTER COMMAMO' 
REAOUN.16) (CMD( 1 >, 1 = 1, *0)
16 HOPMftTlflOAl )
FIND rOMMANO NUMBER , LFNGTH OF COMM AND, POS IT ION OF 1ST BLANK
NJMCi10= ISRCH(CMO,LEN, IPOS)
IFINUMCMD .EO. OJ GO TO 800

NU^CMO COMMAND
1 CONTROL
2 COST
3 STOP
4 HELP
5 INPUT
6 LOAO
7 PFRCF.NT
8 READ
9 SAVE
10 TITLES
11 WORKSHEETS
12 XCOST
13 XPERfENT
t4 TRANSMISSION ,

GO T0( 100, ?00,900, 140,160, 350, 375, ??0, 2 40, 250, 26 0,2 00, 375,
G 4001 ,NUMf,MO

CONTROL COMMAND

100 KEYWO=0
K=0
W!PT = 0
00 102 J=l,fl
102 npTVAL(J>=0
00 103 J=l ,4
APTACMI J 1=0
m uALroN(J)=o
IFUEN.IF. rpf>s en TP 115
STAN COMMAHO LINE FOR "URBAN" OP "RURAL"
104 n'OSl=N(UANMCMO, IPOS 1
If (CMO( IPDSt) .FO. JU1 AN) KF YWPO=l
!F (CMO( IPOSl ! .P0.1"t!M  KF_VWRO= ?
SPACE

-------
 121            IFIKEYWRO.EQ.0) GO  TO  80?
 122      C           NOW  REGIM STARCH  FOR  OPTION VALUES
 123            IPOSI = INOEX(CW'J,LPAPFN, IPOSI I
 124            IF< IP05l.EQ.-ll GO  TO  114
 125            LPOS= INOEXtCMO, IRPARM,IPOS 11
 126            ir(LPnS.EO.-1 I  GO TO fl32
 127        106 IPOS1 = IPOSUI
 120            IPOS1=N6LANKJCMD,IPOSI)
 129            K = KM
 130            IFIKrYWRO.EQ.?) GO  TO  10<)
 131      C           HERE  FOP URBAN OPTION VALUES
 132            00  107  .1 = 1,5
 133             M=J
 13',             IF (CMD( IPOSI I  .NE.OPTURBU I t  GO T3 107
 135      f           LOOK  FOR "AREA" OK  "UAL"
 136            IF(H.L1.3  .OR.  M.E0.5I  GO  TO  112
 13 r            ll>OSt = lNOEX(f.MO, IS LASH, IPOSI I
 138            IF( IPOSI,NF.-I  > GO  TO  14?
 139            DO  14 I  J Z = 1 , 4
 140            IFIM.E0.3I  AREACNIJZ>=1
 I'll            IFI1.EO.4t  UALCON(JZJ=l
 142        141 CONTINUE
 143            GO  TO  112
 144      C.           "AREA/" OR "UAL/"  FOR SPEC IF If  SOURCES
 145        14? IPOSl=IPOSl*1
 146            IPOS1=NBLANK  'JALr,ON(2t= I
 162            GO  to  112
 163      f           HTRE  FOR OTHFR  URflAN  AREAS
 164        133 IF (CMOUPDSl I .FQ.TLEURl (1 I .AND . CMOt I POS 21 . EQ . TLEUR l( 2)
 165           G   fM0( IPOS3).FO.TtEURl(3 I) MF-3
 166            IF(MF .FO.  0 .AND.  OTHP'JL  .FQ.  ?l  GO  TD 135
 167            IF( MF .P.O.  0) GO  TO flO-;
 168            IFIM .FO.  31 ARFACN(3)=l
169            IF(V ,=0.  41 UM,CON(3l=l
 170            GO  TO 112
171        I3r> IF(CV10( IPOSlt .FIJ.TLEUR2I II  .AND.  CMPI I POS2 I .E 0. TLFUR2 ( 2  .AND.
172           f,   C'1D( IPOS3I .FO.TLF'IR?(3t ) MF^4
 173            IFI MF .FO.  01 GO  TO 805
174            IFI1 .FQ.  3) ARE ACM(4 1=1
 175            IF(M .FT.  4 UALCONCt > = l
 1 76            GO  n 1 I 2
 177        10? CON1 INUF
 178            GO TO RrCi
 179      C           HIRE  FOR RURAL  OPT! UN VALUES
180        1T9 n& 113   ,*=!,?

-------
 j>
"^
Ifll             M = J
18?             IFICMLU IPOSI I .FQ .'jOTRULI ) ))  GO TO 112
183        HP CON1 INUE
184            GO TO  R05
185      C           NPH  STORF  OPTION VALUE  AN"! LOOK FOR NEXT  OPTION
186        H2 OPTVMCKI=M
18/            NOPT=K                 I
189            1POS1 = INDFX(C,MO,COMA, IPOSI I
189            IF( IPUSl.GT. LPOSl GO  TO  R02
190            IF(IPOS l.EQ.-lI GO TO II*
191            GO TO  106
192      T.           FIRST  SORT OPTIONS  FOP  WTRCTL THEN DETERMINE STAGE NUMBFR
193        114 IFINOPT.GT.il CALL I SORTIQPTVAL,NOPT,ft
19,J=l,ftOI
210            !POS=l
211            LFN=LFNGTH(CMD,80I
212            GO 10  104
213      C
214      C       HFLP COMMAND
215      C
216        140 CALL WTRHLP
217            GO TO  10
2 I 8      C
         C       INPUT COMMAND
         r,      	
   221        160 KEYWRO=l
   222            IPOS1=IPOS
   223            IFILEN.LE. IPOS GO TO  190
   224            IPOSl = MBLANK(CHO, IPOSI
   225      C           SCAN FOR OPTION  VALUES
   226        165 KFYWP.D=0
   227            IFCM0((POSIl.EO.ISnRCFI  KEYHPO=1
   22R            If (C.^rH IP3SU .FQ.HWANI   KEYWPf) = 2
   229            IF(CMO( IPOSII.FQ.NC"LANI  KEYWR=3
   ?30            IF
-------
>
241      C       COST  (NUMCHD=2)  E XCOST I NUMCMI) = 12 )  COMMANDS
242      C                                '  '  	
243        20^ KEYWRO=0
?44            ICFIG=0
245      C           Ft AC  IF  COSTS DIFFER BETWEEN  SOURCES (XCOST)
246            JFIMUMCMD.EO.12)  ICFLG=l
247            IFILFN.IE.IPOSI  GO TO 208
248            IPOS1=IPOS
249        202 IPOSI = NBLANK(CMO,I POSl)
250            1F(CMD( 1POSU .FQ.IORAN)  KEYWRO=l
251            IF (CMDI I POSl I .FO. IPIJAL )  KEYWRD=2
252            IFJKFYWRO.EO. 01  GO TO 802
253            IF(KFYWRD.F0.2I  GO TO 203
254      C           COUNT  STAGES
255            IFKNTU2.FQ.ICSU)  ICSIM=IT. SUH
256            CALl  WTRCST ( 1CFI.G, KFYWRO, ICSU.KNTU2, 1ER)
257            GO TO  204
258        203 IF(KNTR2.EQ. ICSRI  If. SR=I CSR* 1
259            CALL WTRCST* ICFLG. KF.YWRD, ICSR, ,
-------
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
3?3
324
325
326
327
328
329
330
331
33?
333
334
335
336
337
33*
339
340
341
342
343
344
345
346
347
348

350

35?
353
354
355
356
35 /
358
359
360
251
25?
25
260
                           II
                         TO 802
                    EQ.N'JMWRM J M GO  TO  255
ipnsi=ipnsm
|POS2 = NBI ANMCMOt
I F( I POS2 .FO.-l ) GO
IUT LG = 0
     GET  T HI f MUMHER
DO  252  J = l ,4
 K = J
 IFn<;2 = IPOS 2+1
!POr,2=MBLANK(CMU,IPOS2>
GO  TO  251
IPOS 1 = 1NDEXICMO,IRPARN,J POS2)
IKIPOS1.FO.-U  GO  T[)  802
J=0
I F( II1FLG.
                              OTHER URBAN
                              !UFLG=l
                              IIJFLG=2
                                           OR RURAL  AREAS
 IF< UFIG
             -EO.OI
              FO.U
     1F \ UFIG.EQ. 2)
      NTLF=K
      OTHURB=K
      OTHRUL=K
     IF(OTH'JRn.GT.2.0R.OTHRUL.GT.3| GO  TO 802
    DO
      GE T
    258  1 =
Tl TLE FROM
IBfG.LFN
                          COMMAND LINE
 I F( UJFLG.
 IF( I'JFLG.
 IF('UEIG.
 ITj IUFLG.
 IF(IUFLG.
 IFJOTHURB
 IF(OTHURB
 IF (OTIIURf)
 IF(OTHURR
 Gf>  TO  25(1
 IF tOTHRUL
 IFnTHHUL

CONTINUE
GO  TO  10
 NE.O.AND.J.GT. 121  GO TO  258
 E0.3  .AND.  J.GT.401 G3 TO  258
 FO.Ol KTI TLEINTLEt J = CMDJ I I
 FO.O) GO  TO 25fl
 EU.2) GO  TO 257
 .FO.ll  TLFURHJI=CMO(tl
 .EO.ll  TYPCOD(fl,JI=CMOC II
 .E0.2 !  TLEUR2 (J)=CMfl( I
 .EQ.2I  TYPCOO(9, Jl =C
 .EO.lI
 .E0.2J
                       TLERUl I J)=CMDU
                       TIEPU2( Jl =C.MPU
                                        n
      HORKSHFFT COMMAND
    KF
    LOOK=LFM
    IF 1 I FN.LF . IPOS I GO  TO  2ft 2
    lPPS?=NBLAMK.  LHOK.LT.IE^J  GO Tn

-------
361             JFMPOSP.FO.-ll GO TO  10
362         764 IPOS2=IPOS?*1
363             Lnf)K = NBLANK(CMO, IPOS?)
364            IF ( LOOK. CO.-H GO TO 10
365        265 KEYHRO=CMf>(in()K)
366             IFIKFVWRD.FO.ALL) GO TO 275
367             DO  268  J=l,9
368              KTAHLE=J
369              IFIKFYWRD.FQ.NUMWRK(JlI  GO  TO  277
370        ?68  CT^TIMUF
371             on  TO P02
37?      C           HfRF.  FPR "ALL" WORKSHEETS
373        275 KFYWRD=9
374            LOOK=LEN
375            GO TO 2flO
376        277  ,EO.NUMWK( I| GO  TO 293
397        ?P? CONTINUE
39fl            GO TO 80?
399        293 KOUI=M?
400            IPOS?=LPOS
401            GO TO ?64
402      C
403      C       LOAD COMMAND
404      C      ~~~
405        350 KEYWHO=0
406            IFJLFN.LF.IPOS)  GO TO 365
407            IPHSl=IPOS
408        354 IPOS1 = NRLANK (CHI), IPOS I I
409      C           GET KEYWORD
410            IF(Cf1()( IPOSII .FO.IU1ANI  KEYWRO = l
411            1F(CMD( IPOSl KEO.ICPL AN>KfYWRI>2
412            IFlf.MDl IPOS1I .EO.NCPI AN)KEYWRO=3
413            If(KEYWRD.FO.OI  GO TO P02
414            IFIKEYHRD.FO.l )  LOOJPB=. 1 RUE.
415            IF ( KFYWRO.FO. 31  LOOR NC = . TRUE .
416            IFIKFYWRO.NF.2 )  GO TO 362
417      C           HERF  FOP RUB At  CROPLAND KfYWPD  - SFAPCH FOP OPTil^l  (UAL I
418            IPOSl= IMOr X(C^f),LPAREN,l POSll
419            IF (IPOSl.rO.-I )  GO  Tl 360
420            IPOS  = | ^f)FX(C'10 ,1 PPARM,! POS1 

-------
V
V
3! -^
00
i 1
J-
o
o
1































i^**:S$S5S$$$;$;
,^VJ1*w>,~,0^o>v**-~~o*^0.w.*u,.>.~,3*
or* ^ <"> o n
UJ ^j U*  UJ ***
 CO  =0 ^ ~*
^ Q* \J\ U? 7" Ul
cii~ '*-3crvc"nE o /*-  -. -    *-.,.-, ^
 * QmT'T!iOO>o o "^ "9 "i"1 T3 ""i "n -n-n"r'TiTi"n"C'^"^n
53 Z O J> O .^ - m O >o  ^ *' m Tt wmTicn_2.s  *n;o
^ CT*'*^  f-"HOCfMn3s O t3~^^j*3rHOs3'3C3"O"O''3rf"1
w^  a^2'--'Ti'^ t/imm * OQPI/I
t    3C * 3 * "^ * OX~rnrn"^fTl'T|ri'TitOi/i2 ""
O n  ^-'>>a ^.OoOCoooo^'-^ "3
^ _ n OTICD^O  lo^o**1** - O
 jj "35J* ""* 3 "'J*-* -JfV'-"O"O i^
o f~ 2 z " n '  - ^ ? ? ->
i 2 H 5 ^ 3b5xxb"o^c    3
5 , Of! X^-otJO1BCT
^  a i 1 H > 71 ^"1 O "H -H O O  ^ C CP C *^
3 II z "" 3-^>2Z232^3>J'-^ O


~ S ^ ^OCC2 CC 
-Q "n sim^B* mm z;C
C < O   2   ^ TO
^ 3a ^ ? ?
S TJ i>J 
- C3
 ^^
v ^
2
r>

S
_,
a

fl






J*

n i-



PCRCEMT

*" *

d
s
^
o
-^

r^
n
m
o
m
Z

^
2
i_
3;
O
0
II
-

f->
3
3
>
l/l




$

i n
jJ yj >jj
l/* $ 3*
^j
Or-^^^oo TIZ: o
m n   co o -^  x
u) 2  2 II 3 -. - . m ijJ
^^ ^* r* it "c ^J c rn ^-
X ^2^~>~1^"^

3 n 0 OTJ 
 o c '  c
OD  . > = Z
- S 33 m
-" " > O
z "* ^ ^
39 o m
o = o
n
<
i Q
O 73
* O
c
~  .
> 
2 --)
^ 3
2
3 >
*J 2
O
^
3j
0
>
z
c
o
30
SSiSS^fifSS^ivjNJiS^

->
jj wU
^ ^
ro O
< O  3 CO 3Cq^G 
^ > ^ i r-,")3nr-k^--""5
O H 3 n r- n -0 "C ii c ii ii 3
3*^^*^ >  3 ^ yi 3
^ ;T . ^^Sp.^^^^

-^5'<:" r'pn11;;
 O > Z 2 *"
 2: m a o
 1 1 c *^ 
H ^ ^ ^ w ^
~  ^ 2^3:
O Cw "^ '^
iO < O
 3
33 -H
O O
JD
o
Jl

















-------
'.si            IFILEN  .IF.  IPOS) on TO 4?o
48?            iPrjsi=wiLANK(CMO, ipns>
483            isizE=r>
ABA        404 CONTINUF
485            trccMoc IPOSI).EQ.COIAI GO  n  410
486      C           GET  POSITION NDMBFP
487            on 405  1=1,10
488             JV= I
489             IF (CMO( fPOSI 1 .FQ.NDMWRKU I I  GOTO  138
493        405 CCmiMUE
"i91            GO ( 0 802
493      C           TEST FOR  NUMBER OF DIGITS  IN POSITION NUMBER
493        40f! ISIZE=ISIZF  f  I
494            IFUSIZC  .GT.  31 GO TO 802
495            JVALIIMZEI=JV
496            IPOS 1=IPOS 1*1
497            IFMPOSl  .GT.  L6NI  GO TO 410
49fl            GO T'l 404
499        410 IFIISUF  .FO.  01 GO TO ROZ
500            GO TOI41L,414,417), ISIZE
501      C
502        All KEYHRD=JVAl (I )
503            GO TO 430
504        41', IF( JVALI 2> .FO.10) JVAI(?)=0
505         KEYWRO=JVAL ( 1 1*13  J\'ALI?)
506            GO TO 4?0
507        417 IF(JVAL(3I.EQ.10) JVAL(?)=1
500            IFIJVALI3 I .FQ.IO I JVAl(3) = 0
509         KF YWRD=( J VAL U ) * 130 ) * (JVAI (2 ) *10 KJV AL  3 )
51C            IF(KEYW*0  .GT. NSPCE)  GO TO 802
511      C
512        423 CA1L WTRTRN(KFYWRD)
513            IRANK=.FAtSE.
514            IPOSI=!POS1M
515            IF(I"OS1  .GT.  LFN)  GO TO 10
515            ISI/F =  0
517            GO TO 404
518      C           EP^DRS
519        800 WRITFI IOUT.301 I
520        301 FORMAT!  ' 01 LIFGAL COMM/VNI' /)
521            GO TO 10
522      C
523        80? WRITE(IOUT.302)
524        30? FORMAT)1HO,'ILLEGAL  SYNTAX OF COMMAND1)
r-25            GO 10 10
526      C
52 1        804 WR ITEI IOUT,303)  KFYWPO
528        303 FORMAT lltO,  INP1T DATA EXISTS FOR WOR<. SHFFT ' , I 2 I
529            GO TO 10
530      C
531        805 WRITFCIOUT,304)
532        304 FORMAT(1HO,ILLFGM  OPTION VALUF'I
533            00 TO 10
5 34      C
535        06 WRI TF( HUT, 30r'l  KF YWRO
53S        305 FORMAT (1HO, ' INPUT OATA IT1FS NOT F:XIT FOP  W3K S^F.E T ' , I 2)
537            GO 10 10
538      C
539        80f WRITFI IOUT,306 )
540        306 FO.RMA Tl  IHO,' C AMNOT  FNTFR MOPE THAN 3 SIAGFS  OF  CONTROLS1)

-------
                  GO TO 10
   542     C
   543       900  CONTINUE
   544            STOP
   545            END
   546     C
\ 547            FJNCTU1N  ISRCH(CMD,t EN,
   548     C      "~~   	~~
   549     C       WTPSHO FUNCTION TO OFTFRMJNE  COMMAND NUMBER,  LENGTH OF COMMAND,
   550     C           AND  POSITION OF FIRST SPACE  FOLLOWING  THE COMMANi
   551     C
   55?            INTFGEP CM(}( 80 I. COMANflt 14, 3 .fU.NK
   553            DATA COMANO
   554          f.  /'C'.'C'.'S'.'H'.'I'.'L'.'P'.'R'.'S'.'T'.'H'.'X'.'X'.'T1,
   555             f}'tIJl,*TltEl,lHttlO<.lEt'Elf1AltlIf'OllClr'Pli'Rli
   556          F.   'N1 .  S' ,' 0' ,' L1 ,  P ,  A' , 'R ', A' , 'V, T ', 'R , 'OS ', ' AV
   557            DATA RLMK/1   /
   558            ISRCH=0
   559            00 10 1=1 ,14
   560             K=I
   561             DO 5 J=l,3
   562             ir
-------
601
60?
60?
604
605
606
607
60fl
609
610
611
61?
6 11
614
615
616
6tT
618
619
620
621
62?
623
6?4
625
526
627
628
6?9
630
631
63?
633
63't
635
636
637
638
639
640
641
64?
6't3
644
645
646
647
648
649
650
651
652
553
654
655
656
657
65R
659
660
IF(CMO< II.NF.TSTVAt I CO TO 10
INOFX=1
RETURN
r.
15 INOFX=-1
RETURN
END
C
FUNCT invt NRl ANKlf MO, TBE3 1
C
C FUNCTION TP FIND THE FIRST NON-BLANK CHARACTER
C IN CMO BEGINS IMG SEARCH AT IREG
C
IMTtW* CHOI 801 .RINK
DATA BLNK/' '/
I=IREG-l
10 l=[tl
IF( I.GT.80 ) GO TO 15
IFICMOI II .EQ. BLNKI GO TO 10
NBLANK= [
RETURN
C
15 NflLAMK=-l
RETURN
ENO
C
SUBROUT INE ISORT { [R AY , NV AL , NO IH )
C
c PfUT PIE rn BURBLE SORT THF MVAL VAIOES IN IRAV IN ASCENOI
c
DIMENSION IRAYINOIM1
I IFI.AG=0
N=NVAL-l
00 5 I-l.N
IF( IRAY ( It .LE. IRAY{ I*l)J GO TO 5
irtAG=l
|TMP= IRAY( I 
JPAV< I )= IRAV ( fH)
IRAY( 1*11 =ITMP
5 CONT INUF
IF( IFtAG .NE. 01 GO TO 1
RETURN
FNO
C
SUBROUTINE WTRHLP
r.
C HELP LIST OF WTRSHf) COMMANDS
C
DIMENSION KT! TLEI4.401
COMMON /WTRin/ IN, IOUT ,N SICE , K TI TIE ,NTLE t ^'JRO .NPUNCP
C
WR ITFI HUT, 5)




























NG ORDER




















,NRUCRP


5 FORMAT! ' -'rP-OX. 'WTR^HO COMMANDS '//? X,  COMMAND', T33, 'DE SCR I PT I ON'
r. /7x,'cnN!RnL ,T?5,tn FNIFR CONTROL STRATEGIES'/
r,/?x, 'COST  , T.?5,  TO FNTFR PFP UNIT COSTS OF CONTROL*/
f./2X ,'STOP' , T?5, 'END FXFCUT I UN ' // 2*, 'HELP  ,T?5,
f. 'PRINTS IH1 S T,\BLF' /I
WR ITFI lOJT, 101
n FORMAT I?X,  INPUT' ,T?5, 'TO ENTER INITHI STATF OF WATER
?,' SOURCES' //?X,' L04!)' , T?5,' fU ENTFR LOAD OIRFCTLY'/





SHFO ',


-------
 661
 662
 663
 664
 665
 666
 667
 668
 669
 670
 671
 672
 673
>675
 676
 677
 670
 679
 6flO
 68 I
 682
 633
 664
 685
 6H6
 687
 698
 689
 690
 691
 692
 693
 694
 695
 696
 69 f
 698
 699
 700
 731
 702
 703
 704
 705
 706
 707
 70fl
 709
 710
 711
 712
 713
 714
 715
 716
 717
 710
 719
 720
 f,/2X , 'PERCENT  ,T ?5, ' TO ENTER  COMTROLS AS PERCENT  REDUCTIONS'
 C//2X, 'PEAD* ,T25,'RFAO INPUT  DATA FROM PERMANENT  ',
 ^'STORAGE'/I
  WRITEUOUT.15)
5 FORMAT! 2X,1 SAVF',T?5, SAVF  WORKSHEET DATA'//
 S2X,T ITl E-.T25, 'TITLF(S> FOR  WATERSHED AMALYSIS'//
 f,?X,'WORKSHEET'  ,T25 ,'SPECIFIED WORKSHEETS TO  BE OUTPUT"/
 C./2X, 'Xf3ST  ,T25,'IF  COSTS DIFFER BETWEEN SOURCES'/
 r./2X,'XPeRCENT',T25,  ' IF PERCENT REDUCTIONS  DIFFER BETWEEN  SOURCES'/
 C/2X,'TRANSMISSION' ,T?5,' TO  ALTFR EFFECTIVE TRANSMISSIONS')

  RETURN
  END

  SUP POUT INF  HTKINHN)

   INITIAtIZATION ROUTINE FOR  WTRSHO
  LOGICAL  L INPUT, LODURB,LnDRNC .LODRCP fL4UAL ,L I Nl , LI N2 , LI N3 , L IN4
  LOGICAL  URBCTL.RULCTL ,UCTLPD(3 ),RCTLOD(3 I,UPPCNT.UXPCNT,PPRCNT,
 C         RXPCNT.URBCST.RULCST.LRANK
  INTEGER  OTHURB.OTHRUL.SRCEt 210,281, TVPCnD(9,12! .OPTVALI8)
  DIMENSION  ITYP(2101,NPOS (2 13 I , AUNIT(210.2I.KT !TLE(4,40,
 t  SURFFAl210,3),CTIODI210,3),CTUSLE!3,30,5J
  DIMENSION  STMCTL(30,3>,STMARAt 30,3),COMCTLJ 30,31.COMARAI 33,31 ,
 t           OT1CTLI33,3),OT1ARAB 3,3 I,OT2fTLI 33,3 I ,OT2ARA(33,3
  DIMENSION  PFLDWI301,PCOMC(30>,UALSl30),UALC(30) ,W?UALl (301 ,
 t         W2UAL2 nO),TRNSMN(2l3 I
  nTfSER  TLEUR H 121  , TLEUP2  12 I , TLEPU1 U 2 J , TLERU? (I 2 I, TLERJJ (121,
 r.         APOE (210), AREACNII 41, UAL CON ( 4)
  DIMENSION  GRASA(30 I ,UALG(30I,WLNDA<30  I , UALH(3CI,W30TA I(30 I,
 f.           W3UALU 30) ,W3UAL?(30I ,W?UAL^(30I , W30T A2 (30 I ,W30T A3 ( 30 I
  REAL LOORNU30 , LOORN2 ( 3T| , LODIW31 30I,LOD2H3( 30 > ,L003W3( 301
  TIME MSI ON  USIER<30t .USLFKI30J,USLELS(30 ) .USLEC(33 ) ,W4JAL(33 I,
 f,           iJSLEPt 301, SOIL SI ( 30 >, SOILS2I 3C) ,TTLER(30I , RAT I (1(33 I
  DIMENSION  PDIF(210,3),TCOST(2 1C,3!,PUCOST(210,31
  DIMFNSIDN  PMOU1H(210) ,niFHTH(2!3 ,31 ,CPUREM{?10,3),KERANK<213,3 I
  COMMON /WTRIO/  IN, (OIITtMSRCEf KTITIE tNTLE , N1IRB , NRUNCP, NRUCRP
  COMMON /WTRTF/  L INPUT .LOPURB, LODRNC.L INI, L IN2, L 1^3, L N4,3THU43,43|
  COMMON /WRKSHfi/  10H.S! , r OT RfM, T 01 LOH,  TOT MI H,
 f,                 rtNPF'l, I SFIN.NUM

-------
81?
f* oJ N;
DO-^^S-^o^^r-r p--^S^3s 
~ Owll "nc-lli^^r-fsj*-!! II H Q

* Tl "^ H 33 33 33 3 

Tl '"H 2





















'~1^3^Cir^f~it~ior^f)riio>*>i>i->JH-2^o^'Cl"0'H n * * m >
" " " it H n a it H it  H * -n "n -n -n * ti  n n o r*



-v

.
-

^














***<*

*****
*
*
-*
#
*
*
*
*
*

*
*
*


*
*
*
*

#

#
t
*
*
****
*
*
*
*
#
*
*
*
I.-)
O O O O ^ O
>>>>>
>>>>>

2 O

2 O 





2  O " 3 <">

CSSCO-o 
-^j;-; =

^ jp ~^ ^ ^ ~^j

**<

0 <-0>

2
O


^
TI
^
^
^
N)
t/1
3
%J
1%)

S\
<




3
O
-H

-<
3!
C
H
ro


o
i>
?5




ri
O
i:
c
o
^x.
o
~4



1
n
o
r-
=>

s
-^


>
70
o
o
.
r>
-H
r-


-------
7fU
78?
783
78 't
705
786
787
78fl
789
790
791
792
79J
794
795
796
79T
798
799
800
801
802
603
804
fl05
806
807
ROB
H09
813
811
fl!2
113
814
815
817
818
"U9
820
821
822
823
R24
825
P26
027
828
829
fl30
831
832
833
R34
835
H36
837
839
840
TOTHtMl I )=0 .0
5 CONTI NUF
03 10 I =
PFtnWII
PCONC< 1
UAIS ( 1 1
UALCt I 1
W2UAL 1(
W2LJAL2C
GRASAI I
UAI.G( { 1
WLNDAI 1
UAlWt II
L 0 0 M I (
t OP RN2 (
UStFRl I
USITM !
USLf LS (
usiecu
JSLFPC t
SOt LSI (
SOI1S2I
TTLffU 1
P. ATI 0(1
W 30T A I (
W3OTA2 t
W30TA3t
W3UAL1 t
W3'JAL2<
W3UAL 3<
LOOIW3 (
LO02W3I
L OD JW 3 (
W4UAL( I
03 8 J= I
CTLFLW(
CTLCMC (
ST1CTL(
STMARAJ
COMC TU
COMARAJ
OTICTI <
OTIAPAC
OT2CTI <
OT2ARAC
CTIPU,
son r ii
SOILC? t
CTLPRO(
CUM W4 (
DO 6 K =
iM
= 0.0
= 0.0
0.0
0 .0
1 =0. 0
=0.0
=0.0
0.0
= 0 .0
0.0
1 = 0,0
1=0.0
=0.0
= 0.0
=O.P
= 0.0
= 0.0
=0.0
= 0.0
0.0
0. 0
= 0.0
= 0.0
= 0. 0
= 0.0
=0.3
= 0.0
= 0.0
=0. 0
>=o.o
=0 .0
3
t J 1=0. T
. J) =0.0
,J=0.0
, J) = 0.0
t J)=0.0
,J 1=0.0
i J 1 = 0.")
, Jl =0.0
 J) = 0.0
, Jl=0.0
1=0.0
, J )=0.0
, Jl=0.0
, Jl = 3.0
, J ) = 0 ,0
,5
6 C TUSLF< J, I ,K)=0.0
8 f.ONTINUf
10 CONTINIIF
no 20 K=I, 210
APOFI K| = |IJI NK
J 1 YP(K) =0
NPQS 
-------
tn
O
 841
 842
 843
 844
 845
 846
 R47
 848
 849
 850
 851
 852
 853
 854
 855
 856
 857
 858
 859
 869
 861
 862
 863
 864
 865
 866
 867
 868
 869
 870
 872
 873
 874
 875
 fl 76
 877
 878
>879
 880
 PBl
 882
 883
 884
 885
 886
 887
 88"
 889
 890
 891
 892
 893
 894
 895

 897
 898
 899
 900
        00 12 K2=l,3
         IF"( K2.EQ. 31  GO TO
         AJNII  [ = 1,12
        TYi>rofi( it  II = STYPH
        TYPf.nO<2 , t ) = STYP? {
        TYPC30( 3, 1 ) = STYP3l
        TYPCOOI4, I )=STYP4<
        TYfconc; ,11 =rccNK
        fYPCOn(6, I I=STYP6(
        TYPCOOI7 , I )=STYP7 (
        TYPCOO(8,I  =1 BLNK
        TYPCOn(9, 1 1= 1BLNK
   25 CONTINUE
      nn 30 i = i,5'o
        KNOXI I  = 0
        FINCSU IMO.O
        F IMRFMI II  =0.0
        ISFIN< I J = 0
      00 28 .1 = 1 ,43
   28 FINSRCI I ,J)=IBLNK
   30 CONTINUE
                                             t I
C,
C
C
C ****'
                       ENO

                       SUBROUT1 NF WTRINP(KFYHRf), IFRI

                        KORKSHFET J NPI/T  ROUTINES  FOR INITIAL  STATE OF WTRSHO
                       LOGICAL  LINPUT , LOOURB , LODRNC, t (10PCP, L4U AL , L INI,LIM2,LIN3,LIY4
                       LOGICAL  LOOPOR
                       INTEGER  OTHURB,OTHRJL , SRCE 2 10, 28), TYPC30I 9,12)
                       01MCNSION iTYP 12101,NPOS12101,AUNIT1213,?i,KTiTLE(4,43i,
                      r.           SUHFEA(?10, 3)
                       Ul HFNSION PI" LOW (33 I , Pf.ONC (30 ItUALS ( 33 I, U ALC ( 30 I , H 2UAL U 301 ,
                      C          W2UAL2I30)
                       INTEGER  TLEURK 12),T1 FUR? I 12 ) , Tl FRU 1 ( 1 2) , Tl F PU?( 12) , TLFR U3( 12 ) ,
                      r.         APOC(?10>
                       (IIMFM SlfW GRASAI30),UALGl30).HLNDAI30) ,UALW(30),W30TAl (301,
                      f.           W3'JALl (30) .W3IIAL ?( 30I,W3UAL3( 30I,W30TA2(30I,W30TA3(3D1
                       RFAL  LnnPN1130) ,LOORN2(30I ,1 OOt W3 (30 1, L002W3 ( 30 1,1 01)3 3( 33 I
                       DIMENSION USLFRI )0),
-------
901
90?
903
904
905
906
907
908
90=)
910
911
912
913
914
915
16
917
91S
919
923
921
922
923
924
9?5
926
927
92B
929
930
931
932
933
934
935
936
937
938
939
940
941
942
9'+3
944
945
946
947
94n
949
950
951
95?
953
954
95'i
956
957
958
959
ofeO
COMMON /WRKSH I/
COMMON /WRKSH?./
fO*1M-)Nt /WKSH3/
f.
f,
COMM-lN /WRKSH4/
r.
INTF3GP STYPI12)
(, **** it.***************
SRCF, ITYP, NPOS, APOF ,AUNl T , SURFE A , TLEURl .TLEUR?
PFLOW, PCONC, UALS.J At C.W2JAL I.W2UAL2
GRASA,UALG .WLNOA ,UALW, LODRN1 , LOORN2 ,
W30TAI.W3UAL l,W 3UAL 2, W3UAL3, W3OTA2 , W30TA3 ,
TLFRUl,TLFRU2,TLFPU3,l001H3,LOn2W3,L003W3
USLFR,USLFK,USLFLS,USLEC , (JSLEP , SOU SI ,
^OILS?,TTLER, W4UAL.R AT 13

*******************(<** ****** *****************
DATA FIN, ANSMO,BLNK, intMK, ICOMA/ 'CND1, 'N1, ' ',' ,','/
OAIA AM S YES/1 V /
C
IER=l



G3 TTI 100,200,300,400) .KFYWPD
C
C INPUT SOURCES
C



100 IF(L INI ) CO TO 500
WRITCI IOUT.101 )
101 FORMATI '0 FNTER
I- I
MUPB=0

TYPP COI1F, SOURCE NAME FOR ALL SOURCES' 1


10? REACH IN, 1 03 II TYPI II ,(SRCF(I ,NAM) ,NAM=l,28l
103 FORMAT < I3.2QA1 I
IF( 1 TYPI .FO. 0.
m (TYPI .CT.?2
IF(ITYP( .GT.4I
IFIITYPl .EO.ll
IF
-------
(.seven
it 'i=diN'
J
o '01 jt)33anos add sovtn iviui adih3C. I iv^yoj io<-
'J>OSOV01 VJHV UNO adlNd :$j:)d(IOS INIOd-NUN Gd  'J
J33NIJ3 ' (U0h WcJ id tfdlNd :S3'jaflUS JNIOd dOdC  JiVKHOd tC c'
(EOZ'inul ) 111 HM I ddlKJO 1 ) J 1
I 2o<;'inui ) Juan tuancoi HUN* ) di
>a NVBtfl 3 IMOd -  ld3HiaUK OJ KldM C)lVWWUd 1C<;
no;; 'inoi Jdii a
os1? ui 09 (0'03 'dartN ) -ti
C'0-^XHTll
ooi 01 oo < f. M i)di toe
3
e i33MsxaoH aud swiinua indNi j
3
sti 01 oo
31 =1
liNIVOV AH1  JN 11 KldNl Nl fcCabdC i 11 VVxaCd \-i\
uei 'inoi )dii an a\
IDdM NU 0d3 3
O&V 01 00
30d L'= IN 11
30N1J.N03 OZ1
('H M iuwnv Mil 30dv(ezi=aa3' en 'NI >ov3a
HVZi'i - 'Xll JltfkibUd 60)
IZI'lr'IDdAlS (601 '1001 dHaM(>,'19'300)lldI
11 VSZ *X '1V21 'X 1) IVWaOJ 901
lk)il' 1=H VN* ItoVN* 1 ) 3 3 as 15
IM (9'3TJOO)I) JI
( f'd(JO)l)OOTdAl = (r) dAlS 611
^Ti=r 611 oa
( l>dAll=300>l
I = ( I ISCdN
1=31
33bS?J'Hl = l CZ1 00
( i 33anos add S3aniv39
siiNn ao vjav'3003 AaiN3 do iniod adiNd i/uvwaod 111
inoAvi ivcisxHd - l i33Hi.aoM aod indNi Oilivwaod >oi
mi 'inci )di ian E,i
(i,01'inol 1311HM
0
i i33nsciuH aod awnooa ifidNi "j
j
o^Cl
6101
bid
noi
9101

-------
en
oo
         1021
         1022
         1023
         10 2 'f
         1025
         1026
         1027
         1028
         1029
         1030
         1031
         10J2
         1033
         1034
         1035
         1036
         103T
         1038
         1031
         1040
         1041
1043
1044
1345
1046
1047
I0'8
104<
10SO
1051
1052
1053
1054
1055
1056
1057
1050
1059
1060
1061
1062
1063
104*
1065
1066
1067
1060
1069
1073
1071
1072
1073
1074
1075
1076
1077
137H
1079
3.080
205
210
215
220
                IP4=3
                IP5=0
                IP6=0
                IP 7=0
                1 = 0
                10=1*1
                03 210  I=Ifi,NSRCE
                 ie= i
                 JF( ITYP1I I.GP.3 GO TO 215
                CONTINUE
                LIM2 = .TRUE.
                GO TO 450
                WRITE! iniJT, 220 )( SRCEI t.NAMI ,NAM=l, 2PJ
                FORMAT (IX.28AI )
                IFtLOOURBI  GO TO 225
                IF( ITVPd I.GT.4I  GO TO 230
                    223
                    225
                    226
                    ?3-3
                    231
               FOR URBAN POINT  SOURCES)
    REAOC lM,22?,eR = 223J PFLflW ( JP3 I , PCONC( IP31
    A UNI T( I , 2>=PFL(1W(! P3J *PCONC< I P3 1*1382.0
    TTLWK2=TTLWK?^AUNIT( I , 21
    GO  TO  ?05
         FPPOR ON INPUT
    IF(PFLOH( IP3) .FQ.FIN )  GO TO  450
    Wft ITF( IOUT.123 
    WRI TE< I3UT.202I
    1= IF-1
    IP3=1P3-1
    GO  TQ  205
         HERE  FOR URfAAN |f)AOS  LOADED OIRECTtV
    RFAOdN, 222,FRR = 226> AUNIT(1,2I
    GO  10  205
         EPROR ON INPUT
    IF(AUNf T( I ,7\ .F.O.FINI  GO TO  450
    WRITFl IOUT, 1231
    WP ITE{ IOUT.203 1
    I = I F- t
    GO  Tn  205
         HFRF  FOR URBAN MOM-POINT  SOURCES
    RCAO( IN,?22,FRR = 236 UAI.URP
    KOOE=ITy PI I |--i
    GO  T0( 231 ,232 i?3 1,2341 , KOOF
    IP4=IP4*1
    UALS =UAUJRR
    GO  TO  235
    IP5=IP5+1
    UALCJ IP5MUAIURH
    GO  TO  235
    IP6=IP6+l
    W2UAI I (IP6) OALURP
    GO  TO  235
    1P7=IP7H
                    234
                  c
                    23^ AUNIT I f ,2 )= AUtJlT (1, 1 )
                        1TI WK? = T TLWK2^UN1 T( t ,?)
                        GO  TO  205
                  f           FRPOR ON  INOJT
                    236 IF ( UAI UPfl.F.O.FI N)  GO  TO ',50

-------
en
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
109?
1093
1094
1095
1096
1097
1098
1099
1103
1101
1102
1103
1104
1105
1106
1107
1109
1109
1110
llll
1112
11 13
1115
1116
1117
It 10
1119
1120
1127
ll?3
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1135
1137
1138
1139
1140




T,
C
r.

























c





















c



                        WR ITF< inUT,1231
                        WRI TE( inUT ,202)
                        1= IF-l
                        CO  TO  205

                          INPUT  HO'JTINF. FOR  WOR, IOU13, ( TLE* U3( Jl , J= 1,LEN3I
     IF(LODRNC) WRI TE (I OUT, 303 I IDUM1 ,( TLERUl U ), J=l , LEN1 ), I OUM2,
   C                ( TLERU?( J l,J=l,LE42), IOUM3, T LE RU3< Jl , J= I , LEN3 )
302  FORMAT { OENTER  AREA, UAL  FOR: OR ASSL AND , WOODL AND ', 39A If
   d 2X,'ARFA IN KM2,  UAL  IN KG/KM2/YR1)
303  FORMAT ( 'OENT ER  TOTAL  LOAOS FOR: GP A SSL AND , WTODL AND ' , 394 1 /
   f. 2X, 'LOADS ARF
                        1=0
                    310 IR=tvl
                        DO 315  1= IR.NSRCE
                         IC=I
                         1FC !TY( I I .EO.l ) GO  TO  3?0
                    315 CONTIMUF
                        LIN3=. TRUE.
                        GO TO 450
                    320 WRITE! I OUT , 22 3 ) ( S RCF ( I , N AH ) , N AM= I, 28 )
                         I Pl=l Pl+ 1
                         IF(LOORNC)  GO TO 335
                        REAI)(IN,330 ,ERR=33l  1GRASAI IPt),JALG{IPll,HLNOA I ) ,
                       CW30TAU  IP it ,W3UAL1(  I PI) , W30TA2M PI I  ,W3UAL2( 1PI ),W30TA3fPl ),
                       CW3UAI 3( IP I)
                    330 FOPMATUOFIO. 01
331
                        LOORN2 (I PI MWLNOA! IP I )*UALW( IP I I
                        IFIOTMPUL.FO. o) GO TO 345
                        tOOlWSUPl ) = W30TAU IP t >*W3UALH IP 11
                        L002W3I I PI I = W30TA2 (I PI )*W3UAL2f I PI I
                        I C103W3C IP l) = W3f)TA3( I Pl)*W3UAL3 (I PI)
                        GD TO  ^45
                             ERROR  PN INPUT
                        IF( GRASA( IP 1 I .EQ.FIN) :;0  TO  450
                        WR ITF( IOUT, l^T )
                        WRI Tcl IflUI, ?0?) I nil^l , T( ERUt < J , J=l ,lrNl I ,1 OUM?,(TLEKJ2( J), J= 1,

-------
       1141
                      f. LEN2 I, 1DUM3, (TIERU3I J),J=l,LEN3)
en
en
1143
1144
1145
1 1'* 6
11.47
1 14R
U'9
1150
1151
115?
1153
1154
1155
1156
1157
1158
1159
1163
1161
116?
MM
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1170
1179
1180
llfll
HS?
1183
1184
11B5
1186
1187
118fl
1 189
1190
1191
1192
1193
1194
1195
1196
                        IP1 = IPl-l
                        GO TO  310
                   335 RE/vnt 1M, 340,ERR = 346KOf>R'OUP l .LOORN2! 1 PI  , I DIM W3 1 1 PI > ,
                      f,l 002 W3 ( I PI I .LOD3W3I IPl >
                   340 FORMATC 6FIO.O)
                   345 AJNH ( I, 2 = LOI)RV|1( I" I I H OORN2!  IP I )*LOf) IW3! IPIUL002W3! I PI I t-
                      f. L003H3IIPI)
                       TTL W< 3=TTLWK3 + AUNI T( I ,21
                       GO  TO 310
                             EPROR OM INPUT
                   346 IF(LOORNU IPU .EQ.FINI  GO TO 450
                       WRITE! I OUT , 123 )
                       WRITE ( I OUT, 30 31 I DUM1 .(TLEPU1 ( J) , J = l ,tFNl I  , I OUM2 , ( TL ER J 2( J I, J=l,
                      f.l e^)2t, 10DM3,( TLCRU3I Jl ,J=l,t EM 3)
                                                                  CROPLAND  AREAS'!
                   40
    GO TO  310

     INPUT ROUTINE FOP WORKSHEET 4

400 IF(LIN4)  GO TO 500
    IFINRUCRP .EO. 0) GO  TO 450
    LOOPOR=.FALSE.
    WRITE I I OUT,405)
    FQRMATJ'O INPUT FOR WOR
    GO TO  420
412 WRITE! IOUT,413 )
413 FORMAT!  C'PNIFR USIF COEFFICIENTS R,K,IS,C,P   DELIVERY RAT 13 FH  E
   F,
415
416
            42C
        1198
        1199
        1200
                       ACH
                       LOO POR=. TRUE.
                       GO  TO  420
                       IF ( .MOT .L4UAI I WR ITF.H1UT , 41 6
                       FORMAT ( CENTER TOTAL  LOADS FOR  EACH S3 J* CE '  
                       IF (L4UALI WRI TF( IOUT.41 71
                       FORMAT ! 'OFNTfR UNIT  AREA  LOADS  FO1  EACH SOURCF 
-------
en
cr>
       1201
       1202
       1203
       1204
       1205
       1206
       1207
       1208
       1209
       1210
       1211
       l?l?
       1213
       1214
       121-5
       1216
       1217
       1218
       1219
       1220
       1221
       1222
       1223
       1224
       1225
       1226
       1227
       1?2R
        1230
        1231
        1232
        1233
        1234
        1235
        1236
        1237
        1238
        1?39
        1240
        1241
        1242
        1243
        1244
        1245
        1246
        1247
        1241
        1249
        1250
        1251
        1252
        1253
        1254
        1255
       1257
       1258
       1259
       1260
     DO 4?5 1= IB.NSRCF
     IF = I
     IF(1TYP<1  .F9.  21  00 TO 430
'25  CONTINUE
     UN4=. TRUE .
     IF < .^OT .LOOPn* )  GO  TO 416
     GO TO 450
431  I C = I r  1
     MR ITM IOIIT, 2'0) ( SHCF (I ,NAMI ,NAM=1,28)
     CRPtNO = AUNIT < I ,11*100.0
     IFILODRCP)  GO  TO 443
     iF(.MOT. innpoRicn  TO 432
     REAOtIN,340,ERR=439IUSLER< 1C ) ,USLEK ( I Cl , USL EL S ( 1C I, USL EC I 1C I,
   F> USLEP( 1C >, RATIO! ICJ
     GO TO 434
432  RFAFM I N , 340 ,E RR = 43< USl ERM C.) , US I EM 1C I, JSLELSt 1C), JSl ECt 1C I,
   f. USLTPI 1C )
434  SOI! SI (!C)*USLEfU ICI*USLEK{ IC)*UStELS( 1C I*USLEC( ICI*USLEP( 1C)
     SUILS2(IC =SO! LSHIC(*2.243
     TTtFRI IC=SOltS2( 1C)*CPINO
     FROTOT=CROTOT+TTLERt 1C!
     IF (.MOT.tOOPOR I  GO  TO 422
     AJNIH 1,2 I = TTLER(ICI*RAT tnj 1C)
     AUNI TH ,21 =AU'41T( I ,21*1000.
     GO TO  422
          NflW CALCULATE  POP  GIVEN TOTAL  LOAD  ANO  TOTAL EROSION
436  RA TVAL = ( TTLWK4/1000. ) /FROTOT
    IC = 0
    00 438 I =l,NSRCE
    IFdTYPI I I  .ME.  21 GO  TO  438
438
43;>
    RATI31 TCI =RATV4L
    AJN1T ( 1,2 ) = TTl FR( ICi *RATVAL
    A UN I T( I ,2) =AUNIT( I ,21*1000.
    CONTINUE
    GO  TO  450
         ERROR  ON INPUT
    IMUSLFU 1C I .F3.FIN)  GO TO
    WRITE (IOUT.123I
    IF(IOOPOR)  HRI TF( IOIJT.413I
    IF ( .NOT .LOOPDR ) WR [TE( lf)UT,4ll
    I =IF-l
    ir.= ic-i
    r,o  Tn
                                 450
44C
441
44?
    Iff .MOT.L4UAI I GO  Tfl 442
    RFAO( IN, 222, FRR=44l ) W4IJALIIC. I
    AUNI T< i ,21 =AUNI T n ,i t*w4UAL( ic i
    G3  T3  422
         FPP.OR  ON  INPUT
    If ( W4UALI ICI .FO.FI Nl GO  TO 450
    WRITF( (OUT, 1231
    WRITFI IOUT,'.l 7 )
    1 = I (- 1
    tc=ir-i
    HO TO  422
         HERE FOP   INPUT (f t OAO VALUES
    KFAOU*', ?22,EP=441| Al/NIT
-------
  1262
  1261
  126*
  1265
  1266
  1267
  1268
  126<>
  1270
  1271
  127?
  1273
END Of
              443
      FRRQP  ON INPUT
If (AUNIT (I ,21 .EO.F INI (.0
WRITFt10UT.123)
WP1TFI|nUT,416l
                                            TO
    1C=
    r,n
    1C- I
    in 122
     OflNf
500
IFR=3
coNrr ^fUE
RETUKN
END
       f ne

-------
                                         The second  source  file is called
                                                   /


                                                     WRKSHT
in
CO

-------
.  I             SUP.ROJTINF WPKSHTI 1STAGF,STABLE, IfU
  2      C
  3      C       ROUTINE TO OUTPUT  WORKSHEETS
  '      C
  5      C  * * * * i
  6             I OGICAL L INPUT, LOOURB , I OORNC , I ODRCP , I 4L! AL ,L I Ml , LIN2 , t IN3 , L IN4
  7             LOGICAL UPBC1L,RULCTL,UCTLOO( 3), PCTL001 31,UPRCNT,UXPCNT.RPRCNT ,
  R            K         RXPCNT .tJRBCST ,PULCST .LRANK
  9             INTEGER OTHURfi .OTHRIlt , SRCF ( 210 , 2B) , T VPCOD ( 9 ,1 2 1
 10             DIMENSION  nYP(2m,NPOS210),  AtlMITI 210, 2) ,KT ITLF( 4,40) ,
 H            f.   SURFf A( 210, 3 ,CTLOD(210,3) ,CTUSLE(3 ,30,5 I
 12             DIMENSION  STMCU t 30, 31, STMARAt  30,3) ,COMC1L(  30,3) ,C OMAR A ( 30 , 3 1 ,
 13            C            OTICTL (30,3 I.OTIARAOO, 3), OT2CTU  30,31, OT 2ARAI 30,3)
 14             DIMENSION  PELOW<30) ,PCONCC30I ,UALS(30) .IJALC ( 3D ) , W2U AL I (30 1 ,
 15            t          W2UAL2I30),TRMSMMI210)
 I ft             INTEGER TLEUPt (12 ) .TLEUR2I 12  .TLERUK 12),TLEPU2( 121, TLERU31 12) ,
 17            t         APDEl210),ARFACN(4).UALCOW4)
 18             DIMENSION  GR AS A( 30 I ,UAtG( 30 KM1 NO A ( 30] , UAL W 301 , W30TA H 30) ,
 19            E,            W3UALK30) .H3UA12 (JO) .W3UAL3I33 I.H3O1 A2130 I,d30TA3(331
 20             REAL LOORNK 30).LOORN21 30) ,LODIW3( 30) ,1002W3(30I .LOD3W3I30)
 21             DIMENSION  US LFR I 30 ), 'JSLEK {30 I.  USL EL S I 30 ) , JSLEC I 30 ) , W4UAL ( 30) ,
 22            f.            USLEPI30I ,SOILSl(30l ,SOIiS2(30) ,TTiER(33 ) ,RAT I0( 30 I
 ?3             DIMENSION  PDIE(210,31,TCOSTI210.3),PUCOST(21 0 ,3
 24             01 MENSI ON  PMOUTHI210I,01FMTHI 213,3),CPUR EM(210,3 ),KERANK(210,3)
 25             CGMM3N /WTRIO/   IN, I OUT, NSRCE ,K1 11 LE ,NT I E , NUPB, NP^JNCP .NRUCRP
 26             COMMON /WTPTF/   LINPU1,LOOURB,  LOORNC.LINl,LIN 2,LIN3,LIN4,OTHURB,
 27            C                  OTHRUl,LOOPCP,TYPCOD, JIN, JO'JT , L4U AL , K'JJf ,L^A^<
 28             COMMHN /WRKSH1/  SRCE,ITYP,NPOS,APOE,AUNIT.SURFEA,TLEUR1,TLEUR2
 29             COMMON /WRKSH2/  PFLOW.PCCNC, UALS,UALC,W2UAL  I,W2Uftl2
 30             COMMON /WRKSH3/  GPASA,UALG,WiNDA,UALW,LOORNl,LOORN2,
 31            G                  W3TTAl,W3UALl,W3UAL2,W3UAL3,W3nTA2,W30TA3,
 32            G                  TLERU1 ,TLEPU2,TLERU3,LODN3,LOD2W3,L003VI3
 33             COM^13N /WPKSH4/  USLFP ,USLE K.USiF IS  , USLFC ,US LFP , SOI LSI ,
 34            e                  SOILS2,TUFR,H4UAL, RATIO
 35            COMMON /WRKSH6/  POIF,TCOST,PUCOST,TRNSMN,PMOUTH,0 IfW H,CPJRFM,
 36            f.                  KERANK
 37             COMMON /WTRCOW  UCT LOO, RCTL 00,  t/RBC TL ,R ULCII. , UPRCNT ,UXPC NT, RPRC NT,
 3fl            E,                  PXPCNT.OPTVAL.NOPT .URBCST .RULCST , AREACN, JALCO^I
 39             DIMENSION  CTLFLWI30,3),CTLCNC(  30,3)
 40             01MENSION  CTLE(3C,3),SOItCl(30,3I,SOILC2(30,3l,CTiERn(30.31,
 41            C          CUALW4(30,3)
 42             DIMENSION  TOTCST(3),TOT"EMI 3 I,KNOXI540,FINCST(540) ,F1NRFMC543),
 43            G            (SFIH(54?)
 44             INTEGER F INSRC(540,43)
 45             COMMON /HRKSH9/  TOTCST , Til R EM, TOUOI), TOTMTH, KND X, FI N SRC ,F I N: ST ,
 46            C                  FINREM, I SFIN.NUM
 47             COMMON /UBNCTL/  CTl FLW.CTLCNC,CTLOD,STMCTL,SI MARA.COMCTL,
 48            R                 COMARA.flT ICTL, OI IARA,OT 2CIL,  OT 2ARA
 49            COMMON /RFOCK/  C TUSLF ,t TLt , SQI LC I , SOI LC2 , CT LF.PO, CU ALW4
 50      C  **************************
 51             IUGICAL SAMNAM.SCHSRC
 52             OATA IPG, ITM,IBLNK/1 I','? , ' '/
 53             TEAL 111 ,LT2,LT1,LT4,L1 5.LT6, STGTOTI3) ,OIFT 1TI 31
 54             INTFGFP NWRKSIMB) ,STY
-------
cr>
O
60
61
62
64
6r>
65
67
68
70
71
72
73
74
75
76
77
T\
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
95
96
97
98
99
100
101
102
103
104
105
106
107
138
109
10
11
12
13
14
15
16
17
11
! 19






1

U.

C
3C
35
C
r
C
10?
131


105
106

108
109
113
III



C





115






UP

I 1 4

117

125


1 16

1 2T-

l?7
1
1
I
r)


C
I
I.


M
G



H
F
I
D
W
F
G
H
F
W
F
r,6
C6
C'

L

l_
n




I
i
s
i
W
r.
r
G

r.
r
<;
i
tv
r.
f
G
C
W
,f
      ITM
 IFIIUIUT .NF. . IOUT I  IFF=IPG
 IFf.MOT.LJNPUT  .OR.  MTABLF.FO.OJ  GP  TO 933
  K = B
  O 5  1=1,8
  NWRKSH(I)=0
  IF(Mr/ftlE.60.9)  MWRXSHMt'I
 CONTINUE
 IF(MTARLE.NF.9) GO  TCI 35
 LK = 0
 l.K=( K+l
  IFIK.3T.BJ  GO TO  099

 MTABLF=NWRKSHJLK)
  O T3( 100,?30,300,400,500,600,700,800) .MTABLE  

  OUTPUT  ROUTINE FUR  WORKSHFET  I

 HR |TF.{KnilT, 101 ) IFF
 FORHAT(AI ,37X ,'PHYSICAL LAYOUT')
 IfIMTLf.EO.O) GO  TO  108
 DO 115  l = l,NTL
 WRITF fKOUT, 106)
  C3MT 1NUF
 IFIKOOF  .FO. 3  .OR.  KODF .EO.  '))  GO  TO 125
 I Tl = L T)tAUNIT(1,1)
 SAMNAM--SCHSRC ( I ,SRCF , KOfM-(
 IFISAMMAMI GO 1 0  1 14
 WPI TE(KPUT,1IDt (SRCF( I,J,J=l,28), {STYP(J),J=1, 12),
       NPOS( I I, APOFI I), Atwm I, I) .< SIWFEAC 1 ,1 S > , 1 S= 1, 31
 FORMAT 
    TO 120
          UT, ll7HSrYP( Jl, J= 1, 12I,NPOS(( I ,APnE< It ,AUNI T( I , II ,
   {SMRFEAI1,1S),IS=l,3
 F3RMATI 30X,12AI,19,I OX,A),FI 3. 1,16X,3A4)
    TO 120
 I T2=t T2AUNT(I ,11
 tvRlTr(Kni)T, 11611 SRCF( I ,J| , J=l,29> ,1 STYPt J) , J = l ,12) ,NPOS< 1 I ,
   APOEC I ) , ADMIT ( 1,1 I, (SURFFAI I, IS ), IS= I, 3)
       TUX,?flAl,lX,12Al,l9,lCX,Al,13X,F11.0,5X,3A'i)
    TO 120
 CONTINUE
 WPI 1F(K3I>T, 127) LTl.l T2
         1110, 23 X. 'TOTAl ,36X,F13.1rF11.0)

-------
120            WR! IF(KOUT,130)
121        130 FORMAT ( IX, 52( '-' I, 5?( '-Ml
122
123
124
125
126
127
128
129
130
131
13?
133
134
135
136
137
138
1 19
HO
141
142
U3
144
145
146
147
148
141
150
151
152
153
15'+
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
1 10
171
172
173
1 7-V
175
176
177
178
17')
GO TO 16
C
f OUTPUT ROUTINE FOR rfORKSHFFT 2
r
200 IFIMURR .FO .0) GO TO 16
MS = 0
WR I TF( KOUT ,201 I IFF
201 FORMAT! A1.43X, 'PQIMT AMI URBAN KUNOFF LOADS" /47X,
f. 'TOTAL POLLUTANT LOADS' 1
IF( OTHUPB.FO.OI WRITF( KOUT, 202 I
1F(OTHRB.F0.1 1 WRITFnuT,233)( TLFURU JTl , JT=l, 12)
rF,NPOSH
C ,PCOMC( I T) , AUMI I (I ,2) , At) NIT < II ,1 I.UALS 1 IT ), AUNITI 11,2),
G.UALCt IT ) ,AUNI T( (2,?),AUNI T( I 3, 1) , W2UA L 1 ( I T ) , AUNI T ( 13 ,2
f. AUNITI 14,1 ),W2UAl 21 IT), AUMITI 14, 2)
LT 1=LT1*AUN1T(I ,2)
LT2=I.T?*AUMn (11,2)
LT3=LT3AUN)T I I?,2 )
LT4=l T4
































> .PFLOWC IT J
AUNITI 12, l

> ,PFLOW{ IT>
AW IT1 12,11
)
 ,PFLOWCIT)
4U"IIT< 12, U
) ,


















-------
               LU=O.O
181            LT?=0.0
102            t.T3=0.0
183            l.T4=0.0
184            U5=0.0
185            1=0
186            11=0
IB?        214 10=1*1
188            00 215  1 = 1 B,NSRCE
189              I F( ITYP< I I.F0.3.0R. I TVP( II.FQ.4)  GO TO 216
190        215 CONTINUE
191            GO TO 21T
192        216 IT= IT*1
193            11 = 1*1
19't            12 = 1*2
195            13=1*3
196            14=1*4
197            IFUlTHURB.FrQ. 01  WRI TE(KOUT,211 HSPCE( I ,JI tJ-l .28) , NPOS ( I ),
19R           f.CUFLHl IT ,NS I.CTLCNCU T,NS),CTLOO( I ,NS ) ,STMARA(I T,NS .
199           KSTMCTLIIT.NS), CTLOOl II ,NS I ,CO^ARA( IT, MS l.COMCTU IT.NS),
200           tCTtOOfI?,NS>
201            IFIOTHURB.EQ.l)  MR ITE, C TLOOC I 3.NS 1
205            IF(OTHURB.EQ.2>  WR1TEIKOUT,2 I 3 I(SRCE(l,JJ,J=l,28I.NPOSIt I,
235           f-CTLFLWI IT ,NS(, CTLCNCf I T ,MS > .CTLODI I ,NS),STMARA( II ,N5) ,
207           GSTMCTU IT.NSt.CTlOOl II ,NS) , CO MARA! IT ,NS I.COMCTL ( IT.^JSJ,
?08           CCTLOnd 2,MSI ,OTIARA( 1 T,NS) ,OT1CTL tl T ,NSI  ,C1 LOD( I3,NS>,
709           COT2ARAI IT,NS),OT2CTL(IT,1SI.CTLODI I4.NS)
210            LTl=LH*CTLOO( I , NSI
211            LT?=LT?*CTLOn( 1 l.NSI
?l?            LT3=LT3*CTLOD(I2.NSI
21)            LT4 = L14*CTl OF)! I 3 ,NS)
214            LT5=LT5*CTLOO(I4.NS)
215            GO TO 214
216        217 IFfOTHURB.FQ.OIWRI TE(KOUT ,221)  LT1.LT2.LT3
21T            IF(OTHURR.EO. I )WR ITEJKOUT,222 I  LTI,LT2.1T3,LT4
218            IFl OTHUPB.EO.? ) WPI TF(KnilT ,223)  LT I, LT 2 , LT 3, L T4, L T5
219        21B IFIMS.GE .ISTAGF I GO  TO 225
220            GO TO 224
221        225 IF(PTHURB.EQ.C)WPITFIKOUT,227)
222        227 FORMAT! IX,221 -'1,7           f,, 3( 3X, '
-------
        240        211 F-|RMAT< IX , 2BA I , I 4, ? X. 3< ?F 7. t ,F 3. OH
        ?( TLFRUHJTi,JT=l,l2)
        256            IF IOTHPUL.F. 0. Zl WRITE < KUU1 ,3041 (TLERU1 { JT I , JT = 1 , 12 I ,
        257           f.                (Tt.ER'I2( Jfl t JT=1, 121
        258            IFIOTHRUt. .EQ.3 IHR IT F ( KOUT , 305 MTLERUM JT I, JT= 1, 12),
        259           f.                ( TLFRU2I JT| , JT = l ,12) ,(TLFRJ3( JT ), JT = l, 12 )
        ?60            AT1=0.0
        261            AT?=Q.C
        262            LT1=3.0
        2f>3            IT2 = T.O
        264            I T3=0.0
        265            IT 4= 0.0
        266            LT5=^.0
        267            LT6=0.0
CT,      ?68            IT=0
Co      ?60            1=0
        270        306 IB = IH
        271            00  307  I=IB,NSRCF
        272             IF( ITYPI I) .EO.ll  00  TO  310
        ?73        307 ^ONTINUF
        274            GO TO  317
        275        310 IT=|T+1
        276            IFIOTHPUL.F.O.OI
        ?7f           eWRITE(KOUT, 311 MSRCFI I, J , J = l , 28 ) ,NPOS I I ),SRASAJ|TI .UALGdTI ,
        27B           f. LOORNl ( [Tl ,WLNOA< IT ) ,IJALW ( IT I ,LOnPM2UT I, AUNIT (I, 2
        279            IFIOtHRUL.FO. I IWRI TE( KOUT, 3 12) I SRCFd , J) , J-l  ,2fl) ,NPOS( I > ,GRASA(  II J
        283           f. .UALGI IT ,ir)DRNl ( I T } , WLMO A ( IT ) ,U ALW ( IT) ,LOORN2I IT), W30TAK IT) ,
        2fll           CW3UALU I T)  ,LOOIW3< IT I , AUNI T ( I , 2 )
        282            inoriKUIL .E0.2IWRI TF |KOUT, 3l3MSRrFU,JI,J = l,28) ,NPOS(I I  .GRASAIIT J
        283           C.UAtSt I Ti .LOOPNl (IT) 7WLNDA{ I T ) , UALW < IT ) ,LOI)RN2 ( IT I , W 301 A I ( If ),
        ?>H           Kri3JAU( IT ,LOOU1 I r I.W3TTA2I IT) ,W3UAL2( I T ,LOf)2W3II TI , AUNI Til ,21
        285            IFimHRUL.F0.3 ) WR I T t ( KOUT , 3 14 ) ( SRCF I I , J ) , J= 1, 2e>,NPOS< I ),GRASA( I T)
        2ft6           C.UALCt IT ),LOORMK IT) , WLNDAI I T) ,UALW< IT) ,LOORN2( I f I , rf JOT Al ( I T ) ,
        2-J7           r.W3UALl( IT KLPDIWM IT ),W3f)TA2( I T I , W3UAL 2( I T) .LOD2W3I ITI .W30TA311T) ,
        288           CW3UAL31 I Tl  ,LOI)3W3(I T) ,AUN1T ( I ,? )
        ?B9            AT1=AT ItGPASAI IT )
        290            AT2=AT2*WtNOAf IT 
        ?
-------
           300             IFJPTHPDt .EQ.2 WRITEIKOUT, 320)ATl,AT2,LTl,LT2,LT4,LT5,LT3
           301            IF 10THPUL.EQ.3>WPI1F(KOIJT,321 ATl,AT2,LTl,LT2,LT4,LT5,LT6,LT3
           302             IFiOTHRUL.FQ.OIWRl TF(KO'JT, 3?2>
           303        322 FORMAT UX , I4t" - I, 79 (-' I >
           304            IP! OTHfUlL.FQ. I,OK. OTHRUL .F.0.2 ) WR ITEIKOUT ,3231
           305        3?3 FORMAM IX,54( - ),601 - )
           306            IF OTHPUL.E0.3IWRITC( KOJ1 ,324 I
           307        324 FORMftTt IX, 60( - ' ) , 7? ( '-'I I
           308            CO TO  16
           309        302 FORMAT(RIX,WORKSHCFT  3' / IX , 14 I'  - >, 79 (' - I/ 1 3* , ' GR ASSL AMD , I 5X,
           3io           r.'wmnLAMD', isx.  TOML /3ox, POSI   ,21 5x,-AREA- ,3x,- UAL' ,4x,ioAo 
           311           C,7X, LOADV6X, 'SOURCE', 18X, T ION  ',24X, 'KM?  KG/KM2/YR KC/YR),7X,
           312           C'KG/YR'/IX.14I'-'),79{' - I /
           313        303 FORMAT(50X.52X,'WORKSHEET  3' / IX, 541 -), 601  -' I /43X , 'GRASSLAND' ,
           314           C I 5X,WOODLAND1 ,13X,12AI,8X, 'TOT AL'/SOK , ' POS  I ',
           315           &315X,'AREA',3X,'UAL* ,4X,'LOAD ' > ,6X, LOAO'/6X,' SOURCF' , 18X,
           3lfi           C'llOM  ,3('tX,'KM2  KG/KM2/YR  KG/YR  1, 6X, 'KG/YR  / ,
           317           r.lX,5/39X,GRASS LAND',
           319           ttOX .'WOODLAMD'^X, I ? Al, 6X, 12A I, 3X,  TOTAL  /30X , 'POS I  ,
           320           KM 2X,'ARFA' ,2X,UAL' ,2X, LOAD ' ,2X,LOAD' /6X,SOURCE', 18X, T ION,
           321           C^.( ?X, 'KH?',8X, 'KG/YR  >, ?X, 'KG/YR '/1X.541 '-  ) ,60(-' I /I
           322        305 FORMAT(60X.60X,WOPKSHFET  3  /IX,60( - 1, 72 (  ' -I/39X, GRASSLANO',
           323           f. IOX,  'WOODLAND1 ,3 X,3( 6X, 12 Al I ,3X, TOTAL' /30X,' POS I' ,
           3?<           5 (2X, ' AREA', 2X, 'UAL ', ?X, 'LOAD 'I,2X, LOAO/ftX,' SOURCE' , I RX,< TION* ,
           325           F. 5( 2X,  KM2' ,8X,' KG/YR' I ,2X , 'KG/YP'/ IX ,60('-'  I, 72 ( '-' I I
           326        3U FORMAT! 1X.28AI, U,2X,2(F. 1,F7. l.Ffl. 11 ,F12.  I I
           327        312 FORMAT(1X.2BAI,I4,2X,3(F8.1,F7.I,F8.1,FI 1.U
           328        3 13 FORMAT( IX.2BAI ,f,,lX,4(F7.l ,F5.l  ,F6 .11 ,F8 .1  >
-P         3?T        '!'. FORMAT(1X,28AI, K. 1 X, 51 F 7. l,F 5. 1 ,F 6. U ,F 8.'l
           330        3 11 FORMATUH0.20X,'  TOT Al  ,5X, F 12. 1, 3X , F 12 .1, F8 . I', 3X, 2F 1 2. 11
           331        319 F":)P1AT(21X,T:iTHLf,T32,F12.1,T'>5,FI2.1/lX,T /
           353           C40X,  'CP 01'LAND' , 2 4X, ' TOTAL' /50X ,  AP F A' , 1 ?X ,' U AL ' , 11 X , ' LO AD1/6X,
           354           II SOURCF', 18X, "POSIT ION' , l?X, KM2't IOX, ".0

-------
                                                                                                    S9
                                  LI  ->
                                  , ys  is
                                         "
                    f     J\        *

                     ft  Q    3  


                     -t  5 -n .t-  _

                    t ^  2  Ul  r-
                                                                II  1 M .4
                                                                O II    UJ
                                                                   <-> O  II
                                                                         O
                                                                      o 
r* -^  n 
O     * TI  i
               TII-
C r- " -H ~  ~
-H T!  -1   o
                                               i- Tl  -< 
                                               35     T3  It
                                                      -1 I/I
                                                      O ^

                                                      iv m
                                                                                              n
                 -n z   -t   -f
                 vj     .  . 
                                                                                              m
                                                                                              O
                        v .i
                        3 -H
                         2
                         VI
X
i
-n
( B
*

r-
<~































O O "n
50 ^ -**
lli
t P- t3
X X 

 >
O 3

> > -C
f"1 > ;g
  ta-,
  -H
-i ** m
j ^i .m
OX*

Tl Tl 5
r * "i
f f *
O O uJ
- 1  
.03 X -1

O *" ^
x *  i

"n u
O

0
p.
o
X






~ o
^2 O
O
 o
3
o
TS
TJ


O
i i
4
"*1
^
^
3

M-l
^
NJ
""
^
f-
-H
"V

I/I
W











^ -^ -H T>
-1 Nl  O
V II II 33
II "^ "^ J*
f rv ' >
-!++-(
n r- -a x
30 )T| f~ 
T3 J3 2 ^
r-  Q OD
C3  >

-.*
O^

Tl
r\j
"3

^5

-n
^
!L

Tl
P.
Jl
O
*














5 :
J> MM
22-
-c ,
- -H
rx.) *
 w>
yj
^,
.
'./i
>D
n
m
.
M4
<
<^
M>
C.
11
NJ
30
7"
z
^0
o
t/1
<,
v^
*
w
&.
-
1
-.
r*
-
w
*
> -n -.
o 5
* 4
0 - X
Ts 
l "SJ
UJ 09
 >
^- 
<->
"

Tl
fH>
o
,
o

-n
r
o
-n

rsj
%)
^i
O^

^
-n
ji
^j
*
Tl
W
*
7"
Tl
NO

-H C
25

"*  
 .,
^5 CI
> trt
-. .Tl
C r-
~* &
t-* ..H
M "
W f
V ~^
O w
^o i-tr
^3 yi
r* r*
8 2

-^

c
r~
-n
-o

~
*..
-
O
^m
r*
wfl
p-
_
"H
v*
"
s:  n r> -* o r> o  -" 
^jTl-3D^3-,-3C'-a33 H ^
   -o -Q II 2"^ "O
-C33*WZ^SZ
^c > II ii _ ^ w <
w C C O  . II
-i  2 2  
- 0 - _ - 3
^ o  i  i  
    "12
" P*  *  yC
 Q IV r- IV O
,/) o  ^  m
**'">*
-in  ,- o
n -3 o o o
 r O O
-. 0 . -1
 C1 . o 2
<- o

L. O O
II
*V 1*2
39

z
^
O

_
^*
"

"O
r-
^
3
C

r"
rn
                                                                                                                                             


                                                                                                                                             J>

-------
      420            IFtnOPCP)      WR I1F(KOUT,434|TI,ST3
      421        424 FORMAT(21X, TOTAL,T3C,F14 .3,T6H,23X,F13.0,
      42?           f, 18X.F13. I)
      423            irtflS .CE.ISTAGEI Gfl TO 4?5
      424            GO  TO 412
      425        425 IFJ .NQT.LUDRCPIWRI TF ( K0
      427        433 FORMAT! lX,fl4J' -'))
      420        422 FOPMATf IX.65I  -' ),65t -M
      429            GO  TO 16
      430     C
      431     C       01JTPUI  ROUTINE FOR WPRKSHEFT  r>
      432     C
      433        501 IK .NOT. URIif. TL  . ANO. .NOT.RULC1LI  GO TO 16
      434            TTLUn=n.Q
      435            00  501  1 = 1 ,3
      436            S (GTCm i 1 = 0.0
      43 7        501 OIFJOT ( I 1 = 0.0
      43fl            WRITFIKOUT.50?>  [FF
      439            IFtlSTAGF  . EQ .  I)  WRITF(KOUT,504)
      440            IFUSTAGE  .EO.  2)  WRITFfKOUT,503)
      441            IFdSIAGf  .FQ.  3)  WPITF (KnilT, 506 I
      442        50' rriPMATC Alt SOX, 'LOADING SUMMARY*/47X, TOTAL  POLLUTANT  LOADS'!
      443        513 FORMAT O9X ,'WORKSHEET  5 ' / I X, 50 ( ' - ' >, 63( - ' I / 5 3X,
      444           C'lNlTI&L  LOAD TO     CONTROtLEO  LOAD' ,6X,'LOAD PfDUCT IONS'/53X,
      445           f. 'WAT PUSHED BAS W<, "X, 'KG/YR ' , 17X , KG/YR'/6X, ' SOURCE  ,22X, TYPE' ,
      446           F.4X,'POSITION'  ,MAT (99X,'WORKSHEET  5 ' / I X, 50 ('- I , 60( ' - ' I / 53X ,
CT>    449           C'lNITIAL  LOAD TO'/5 3X,  WAT ERSHED BASIN    CONTROLLED  LOAOS6X,
      450           E'LOAO RfiltlCl IONS-/6X, 'SOURCE' ,22X,  TYPE' 14X ,' POS1 Tl ON' ,fl X ,
      451           <: KG/YR',2(14X,'Kn/yfV,3X/lX, 50 {'->,601'-')}
      452        50^ FORMATC/>OXt61X('WURKSHF.FT 5 /IX,66( - I ,66 ( '-' I/53X,
      453           f,' INITIAL LOAD TT , 10X, 'CONTROLLED  LOAD ', tflX , LOAD REDUCTIONS'/
      454           G53X,' WATERSHED  OASIN' ,15X,'KG/YR',?8X, KG/YR'/6X, 'SOURCE , 22X,
      455           C'TYPF',4X,'POSITION' ,OX,'KG/YR',4X,
      456           f.2 <4X, ', J=l,  l2l,Mf'nS( I), AUNI T( I, 2J
      465            IF( SAMNAMI  WR I TR ( KOUT ,53 I I (STY P ( J) , J= 1, 1 ? I.NPOS1 I I, AU^J IT( I, 21
      466            GO  TO 54fl
      467        5^5 CONTINUE
      468            IF(SAHNAM)  GO TO 530
      46')             irUST4GE.EQ.llWR! TE< *nJT , 5261 < SRCfiJ I , J) , J = l , 2 8 I , ( ST YP f Jl , J = l , t 2 I ,
      470           r.   NPOS( I I , AUNITII,? I,CTLOD( I, U, PniFU, II
      471             IFIISTAGF.rO.2> WPITFIKOUT,52 n(SRCF(l,J),J = l,28l,(STYP(JI,J=l,l2l,
      47?           r. NPOS(  I ), AUN  IT  ( 1, 2 ), (T Tl 00 ( I , J I ,J= I, ? I , (  PD U ( I , J) , J = l , ? I
      473             IF (1ST AGE. F 0.3) WR [ T f ( KIJJT , 52 7 I ISRCFH,JI,.!=1,28).(STYP|JI,J=1,12),
      474           r  Nir I ,11
      478             IF ( 1ST  \GE.FO. ">  I WPIT EtKOUT, 53 ) KST YP( J I ,  J= I, 12) ,
      4 79           t iJP'IS*  H ,/>UNI T [ ,?) , (f TLOnil ,  J) ,J = l ,? ) , (POIf ( I, J J, J= I, ? 

-------
'80              IM 1ST AGF.FQ.3) W R IT T (KOUT, 53 3 )  STYP ( J I , J = I , 12 I ,
481           f.   NPOS< I I ,AUNI T< I ,21 , (CTLOOU, Jl , J=l ,3 I, (PDIF( I, Jl, J=l, 31
           540 OR  545 J=l,lSTftGF
               STGT"T| J|=STGTOT (J| fTLOO( 1, J
484        545 OlFTflTJ J) =DirTOT| JI + Pr>|F II iJI
'85        548 lTLnO=TTLOO-AIINlr( I. 2)
486        55^ CO'JTINUF
48 f      C
1AT'0,20X,'TOT4L" ,2rX,Fl2. l,F18.l,F22.t>
499        556 H1RMAT('0',2TX,'TOTAL ',27X.F12. I, ?X, 6F11.II
500        531 FORMATMOX ,12Al , 15 ,6X ,U2 . I ,F18 . 1 .F22.1 I
501        533 FORMAT*30X,12A I,I 5,6X.Ft2.l,2X,6Fll.ll
502        565 FOP^ATt IX.50C - 1, 60 ( ' - ' I I
503            GO  TO  16
504      C
505      C       OUTPUT ROUTINE FOR WORKSHFET 6
506      C
507        600 IFI.MOT.URRCTL  .AND.  .NOT.RULCTtl GO TO 16
508            WPfTE(KOUT,605I  IFF
509        605 rORMATIA 1.51X,'PROGRAM COSTS'/44X,'TOTAL  POLLUTANT  REDUCTIONS')
510            IF( (STAGE .FO.  II WRITE(KOUT , 606 I
5M            IFdSTAGE  .60.  2> UP I TF IKOUT ,6 I 0 I
512            IF1ISTAGE  .FQ.  31 WHITF(KOUT,612 I
513        60t FOPMAT<99X,'WORKSHEET  6'/ I X, 50(*-,60('-')/53X,'ARFA/
514           E51X,  TPFATFO',4X,UMI TS* ,6X, PF.K UNIT  COSTS', flX., ' TOf AL  COSTS'/
515           F.6X, 'SOURCE', 22X, 'TYI>F,4X, 'POSI TIOM' ,3X ,'KM2' ,5X, SERVED' ,11X,
516           G't/YP',l6X,'t/VK'/lX,53(-',60{-"M
517        61J FORMAH 99X, ' WORK SHFf T  6  /I X ,50 ( -' I ,63 ( -' I /53X ,  ARE A , I 6X ,
51"?           &-PER UNIT COSTS',8X, 'TTTAL COST S  /5 I X,  T*E4 TEf)  , 4X ,' UNI T S' , 11 X ,
519           KU/YR' ,16X,'$/YR' /6< t  SOiJRCf  ,22X,'TYPF',4X,' POS IT JON  , 3X,
520           r.'K"? ', 5X, 'SFRVFO', ?{ 4X, 'STAUF  l',4X,'SIAGE 2' I/I X,5O( -  , 60 <'-'II
571        6!? FORMAT(60X.61X, 'WORKSHFFT  6f/I X,661 - 1,661 '- ' I /53X , AREA,
522           G21X,PFR  UNIT COSTS1 ,21X,' TOTAL  COSTS' /5IX,TRTATFO',4X, JNITS,
523           1 16X,  t/Vft , 29X,  t/YR V6X,  SOURCE ' ,22X,  TYPE ' , 4X ,' POSI TIOM' ,
5?4           E3X,'KM?' ,5X,'SFRVED' ,2 CX,STAGF  I',4X,STAGE  2',4X, 'STAGE 3'l/
525           f.l X, 661 - I ,66( '-' I I
5?6      f
527            DO  615  I =1 ,3
528        615 3TGTUTI I 1=0.0
529            00  610  I=l,NSPCE
530             !F( ITYP(I I.tO.1 .OR.  AU*H T(I.2).FQ.3.3)  GUT063D
531             IF( ITVP( I) .GF .31 GO  TO  670
53?      C
533             1FU STAGF.FO. 1  I WRI TF( KnUT,61'> (S"3r.F(I,J|,j = l,?R), ^POS ( I I ,
534           r.   AUN1T U* U,P'JtnST< I, I I, TCnSTC I, II
535             IF( ISTAGF.f 0. 2) WP ! I F ( KOUT ,6 19 MSP CFM , J >, J= 1, 2t\ I, NPJS I I I ,
536           r.  AUMITI I , II .(PtICOSTI I , J) , J= l,?| , (TCOSTI I , Jl  , J = l ,2 I
537             IF! 1ST AGF.FO.31 WP I T HK1UT,619MS^CEI I,JI,J- 1,2l,NPOS(I I ,
538           E  41NITI I f U .("UCOSn J , Jl , J=l ,31 , (TCOSTJ I , J I , J= 1 , 3 I
539            (HI  in  6?5

-------
      540        620 COMT INIIF
      541             Knnr-= i TYP( I)
      54?             00 <>40  J=i,12
      543        640 STYPt J) =JYPCOO(KOOF, Jl
      544             IFIKf)OF.GT.'l GO TO  641
      545              IFtlSTAGE.fcQ.il WRITE(Kni)T,62l ) (SPCFI I,J I , J=l, 201 ,
      546           e  STYPI .i) ,j = t ,12) .Npnsii), AUNI n 1,1) .PUCOST1,1 I.TCOST u, 11
      54T              IF( 1STAGE.EQ.7I WRITFIKOUT,6?3I(SPCEl I,JI ,J = l,201,
      541            e  1STYPIJI ,J=L, I? t ,NPOS< I) ,
      549           C  AUNllt I , 1) , IPUCOSTI 1 , J , J=l,2) ,(TCOST( I ,Jt , J=l,2 J
      553              IF(iSTAGe.EQ.lt WR IT El KDUT , 623 I f SRCF. d , J I , J= I , 281 ,
      551            C  C STYPC Jl ,J=1  .12) .NPriSd) ,
      552            C  AIINIM I , It .(PUCOSTd, Jl ,J=1,?I .dCOSTU ,J> , J = l ,31
      553             GO TO 625
      554        641  irdSTAGF.EQ.il WRIT E ( KOUT ,642 I 1 STYP 1J I , J = l , 12 I, NPOS <  I I,
      555            f. AUMITI I, d.PUCnSTd , II , TCOSTd ,11
      556             IF dSTAGE.EQ.2  I WRITr(KOUT,643 11STYPJI, J=1, 12 I,NPOSCI I,  '
      557            f, AUNI T( 1 , II ,(PUCOST( I , J) ,J = 1 ,21 , ( TCOST (I , Jl , J = l ,2 I
      558             IFdSl AGE.F0.3   HR 1 TE(KOUT,64311STYPCJ), J = l,121,NPOSdI,
      559           G AUNI T(f ,1) .tPUCOSTI I, J) , J=l,3), (TCPST ( I, Jt, J= I, 31
      560         6?5 00  628  J=l,ISTAGF
      561         6?(1  STG10T ( JI=STGTOT ( J IHCOSTI !,.)!
      562         630 CONTINUE
      563      C
      564             IFUSTAGE.FQ.il WR IT F(KOUT , 635 ISTGTOTt I)
      565             IFdSTA5E.EQ.2l WR I TE (KOUT ,637 I (STGTOT C Jl , J= I , 2 I
      566             tr(1STAGE.FQ.3I WR1TF(KOUT,633) ( STGTOTtJt ,J=1,31
      567         616 FORMAT It X.28AI  , 3 X ,  C RDPl ANf)1 , 17,FU. I.9X.F17.1, F20. II
      568         619 FOPMAT< IX,28A1,3X,CROPLANO' .IT.FIl. l,9X ,6Fli.1 I
00    569         621  FORMAT
-------
633              00713 NAM = l,12
601        7H   STYP{NiAM)=TYPCOO(KOOF, NAM(
602              IFI ITYPI H.FO.l  .OR.  AUNmI,?I.EQ.0.0) GO  TO  716
603              SAMNAf=SCMSPC(I,SRCE.KODEI
604              IF(SAMNAMI GO TO 715
605             WKI 1 EJKOUT ,71AM SRCEI I, NAMI ,NAM = I, ?8 I, I ST YP( HAM >,NAM= I, l?> ,
636           r.NPflSd ) , TR^S1N( l ,AUNIT( [,2 , PMOUTH(I t .DIFMTHU ,.J),TCUST (I, J ),
607           60PURFMC I,J I.KERANKU, J I
605             GO TO 718
609        715  WR ITF.JK3UT, 71 9K STYPI NAM),MAM=1,1?),NPOSI),TPNSMN(II, AUNIHIi?!i
610           f.PMUUTHf D.IMFMTHC I, J J, TCOST (I, J >, CPUR El ( I ,J1 .KERANM I , J
611        719  FORMAT ( 30X.12 M ,15 .F12.1 ,5X ,Pl? .0,F14.0, IX, 2FIO .0, f 13 .1, 18 I
61?             GO  TO 718
613        716  WPITF.  ,NAM=l, 121, NPOS1 I ( ,
614           &1RNSMNI ! > ,AUMI Tl I,21 ,PMQUTH(I I
615        718  CONTINUE
616        714  FORMATd X,2flAl . IX .1? Al , 15 ,FIZ. I ,5X ,F1?.0, F14.3, IX, 2F 10. 0, F 10 . I , I 8 )
617        717  FORMAT) IX, 20A1 , IX, 1?M ,r 5 ,F12. I ,5X,F 12.3 .F14.0I
61B             FIN10T=F|NTOTHf)TRrM(.M
619             IFIJ.FO.ISTAGEIWRITFJ MBIT, 720 ITOTRFMUI .TOTLOO, TOTMTH, F INTOT,
623           r.  T3TCST(JI
621             IF(J.LI . 1ST AGE(WRITC(KOUT,77?)TOTPEM(J J,TOTLOO,TOTMTH,TOTC ST(Jl
62?        7?0  FORMAT! H0.16X,1 SUBTOTAL1 ,64 X ,Fl 2 .0//20X ,  TOT AL  , 39X , Fl 2 .3 , F 14 .0,
623           f.  !X,2flO.O
624        72?  FORMAT{1H0.16X,1SUBTOTAL' ,64X,f I 2 .0,/20X, 'TOTAL ,39X,F1?.0,F14.0,
6?5           f.  UX.riO.O)
6?f.             WRITFIKOUT, 7?5)
627        7?"j  FORMAT! 1 X,65( '- I ,66 (- I )
628        7/5  CONTINUE
629             GO T1 16
630      C
631      f           OUTPUT ROUTINE  FOP WORKSHEET  fl
632      C
633        ROC  IF ( .MOT.URBCTL .AND.  . NOT . RI/LC1 L)  GO TO 16
63'^             IfllS.FO.O  .OR.  NSRCF.EO.O)  GO TO  16
635             IF{ .NOr .LRAMK) CALI  WTPAMKI 1ST AGE I
636             SUM 1=0.0
637             SLI,"?=0.0
63H             WRITE(KOUT.fll^(IFF
639        815  FOPMATI A 1.4BX.'SUMMARY OF  PROGRAMS' M7X , TOT AL  POLLUTANT  LOADS'/
640           f. 'i5X,56X,'WORKSHEET  fl  / IX, 601 - ' , 6 l( ' - ' I /57X , 5 7 X, ' SUM OF'/65X,
641           f. 'LOAO' ,6X ,'SIIM OF  LOAD' , I 5X,  COST  OF , 5X , R EOUCT ION /63X,
f-42           C 'MFOUCT IOM' ,4X, 'REOUC Tl ON' , 4X ,'PERCENT '  ,4X,  RFDUCT ION' ,6X, '  COSTS'/
643           It X, -SOURCE' ,34X ,  'RANX',4X, 'STAGE', 5X,MKG/YRI',6X,'(KG/YRI ',4X,
644           f.'PFOUCTiriN' ,4 X ,'  U/YRI' ,7X ,' < t / YR )' /1X , 63 (' - ' ,61 ('-'))
645      C
646             00 R75  1=1,MUM
647              M? = KNRXM
641)              S'jrU = SUMltr [NREM1M21
649              SUM?=S'JH2*-FINCSTM7 )
650              Pf 1RF1=C SUM I/TOTLOO)* t 00.0
651             WRITE(KOIJT,820I(r INSPC ( M?, J I , J= t, 43) , I ,  I SF I N( M? )  ,F I NR EM( M2 I  ,SIJMl ,
65?           1  PCTRfn,F(NCSl(M?).SUM?
653        B75  CONTINUE
654             WPl'E(KOUT,853 )
655        850  FORMAT 1 1 X,6.)( ' -'  I ,61 ( ' - ) I
656        P?0  I ORMAT ( 1X.43M. I  5, I ,F14.0,F 13. C.F 1 1. 1 .2F13.0I
65?             GO TO 16
65fl      T,
659        809  IF=0

-------
   660       900 CONTINUE
   661           RF.TWN
   662           FMO
   663     T
   66'.     f
   665           LOGICAL  FUNCTION SCHSRC 1 I, SRCE, Kf)OE )
   666     C
   667     C           LOGlCAl FUNCTION TO SEE IF CURRENT  SOURCE NAME  IS  IDENTICAL TO
   668     C       THE PREVIOUS SOURCE NAME FOR WORKSHEFT  OUTPUT
   669     C
   670           INTEGER  SRCF ( ? 10, ?fl I .CURSRC ( 2B> , T ST SRC( 26 I
   671            SCHSRC=.FALSE.
   672           IT(1.EO. I)  RF TURN
   673           IFCKflDf.GT.AI GO TO  25
   67'*           .1=1-I
   675           DO 10 K = l,2f)
   676            fSTSRCfK ) = SRCF.(J,K t
   677            r,URSRC(KI=SRCFI I ,K I
   670        10 CDNTINUF
   679           LENlST=LENGTH(TSTSPC,2ft)
   680           LFNrUR=lENGTH(CURSRC,28>
   681            IFtLFNTST  .NE. LENCURI  RETURN
   6B2            uo 2"> K = I,LENT<;T
   683            IF(TSTSRCIK)  .NE. CURSRC1KII GO TO 3D
   684         20 CONTINUE
   685         25 SCHSPC=.TRUF.
   686        3? RETURN
   687            FNO
E NT (IF F I LF

-------
The third source file is called




          WTRSAV

-------
ro
2
3
4
5
f.
7
8
J
10
11
12
13
14
15
16
I/
18
20
21
2?
23
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
r,
c
c
c
c
c
c













































c
r.
c
                     SUBROUTINE WT RS AV ( I SWTCII,1STAGF,KEYHPDI

                      ROUTINE  TO WRITE  TO  AHO  RFAD (ROM PERMANENI  STHR'/VCE
                         DATA  FOP WTKSHf)     ISWTCH=1 FOR READ  COMMAND
                          JIN   - INPUT  nrVICF  INITIALIZED  INWTRJNI AT 8
                          Jf'JT  - OUTPUT DEVICE  INITIALIZED  IN  WRINI AT 9
    LOGICAl  L INPUT,LOOURfM ODRNC,LOORCP,L4UAL , L I NI,LIN2,LIN3,LIN4
    LOGICAL  URBCTL ,RULCTI ,UCTLOD(3I,RCTl ODI3 t.UPRCMT,JXPCNT,RPRCNT,
   K         *XPCNT,URBCST,RULCST,LRANK
    IMTEGEP  OTHUR8,OTHPUL,SRCE(210,28), TYPCOO(9,12).OPTVAL< 81
    DIMENSION ITYPI210).MPOSI2I3),AUNIT(210,2),KTITLE(4,43),
   r,   SURFFAI 210, 3|,CTLOD(210, 3) ,CTUSLF( 3,30,5)
    DIMENSION STMCTL(33,3 I ,STMAPA(33,3),COMCTL(30, 3I,CO<4ARA( 30,31,
   E           OTICTK30,3),OT1ARA(30,3) ,OI2CTL(30,3 I,OT2ARA(30,3)
    IHMFNS ION PFLOWt 30 I.PCONCI 30), UAL SI 30) ,UALC ( 30) .W2UAL 1(33) ,
   E          W2UAL2130),TRMSMN(213)
    INTEGER  TLFUR H 12) ,Tl.EUR2( 12) , TLERUl (12) , TIERU2U2) .TLERU3 (12 ) ,
   f.         APOEJ210 I, APFACN(4 ),UALCON( 4)
    DIMFNSION GRASA (30) , UALG(30 I,WLNOA(30I ,UALW(30I.W30TAl(30),
   E           W3UALU 30) ,W3'JAI. 2( 30) ,W3UAL3( 30) , W30TA2< 30) ,W30TA3(30I
    o.EAL  LOORNl (30 ),LOORN2 (30 I, LODlWil 30 I,LO02W3( 30),L033W3( 30)
    01 MEN SI ON USLER( 301 , UStfi K{ 30) ,USLf LS(30) .USLFCOO) ,W4UAL (30 ),
   E           USLF.P{ 30), SOILS 1(30) .SOIL S2< 30), TTLERl 301 ,R ATI 0( 30)
    DIMENSION PDIF(213,3 ),TC OST(210,3),PUCOST(210,3)
    DIMENSION P MOUTH ( 210) ,()IFMTHI 210,3) ,CPUREM(210,3>,KERANK(210,3 I
    COMMON  /WTfUO/   IN, IOUT, NSP-CE.KTI TL E.NTL E ,NU8 .NRUNCP , Nftu: RP
    COMMON  /WTRTF/   LINPUT.LODURB,LOORNC,LINl.LIN2.LIN3,LIN4,OTHURB,
   E                 OTMRUL.t.OORCP, TYPCOO , JI N , JOIIT , L4UA L , KOUT ,LP ANK
    COMMON  /WWSHl/  SRCE, ITYP.NPOS,APOE,AUMIT,SUREEA,TLEUR I,TLEUR2
    COMMON  /HRKSHZ/  PFLOW.PCONC,UALS,UALC,W2UALl, W2UAL2
    COMMON  /WRKSH3/  GRAS A,UALG,WLNOA,UALW,LODRNl,LOORN2,
                     W30TAI .W3UAL1 , W3IIAL2 ,W 3J AL 3, W 30T A2, W33 T A 3,
   6                  TLERUl, TLFRU2,TIERU3,LOOIW3,L002W3,L003W3
    COMMON  /WRKSH4/ USLER ,USLEK, USLEL S, USl.EC , USL EP , SO IL SI ,
   E                  SOI I.S2,TTLEP,W4UAL,R AT 10
    COMM1N  /WRKSH6/  PDIF,TCOST,UCOST,TPNSMN,PMOUTH,01FMTM,CPUREM,
   F.                  KFRANK
    COMMON  /WTRCON/ UCTLOD.RCTLOO,URBCTL,RULCTL.UPRCNT,JXPCNT,RPRCNT,
   E                 RXPCNT,nPTVAL,N3PT,URBCST,RUL:  ST,AREACN,UALCON
    DIMENSION CTIFLW(30,3),CTLCNC ( 33, 3)
    DIMENSION CTLF(30,J),SOUCl(30,3),SOI LC2(33,3)  , CTLERO ( 33, 3 I,
   E          CUALW4( 30, 3 I
    DIMENSION TOTCST (3),TOTREM(3) ,KNDX( 543 ), FINCST (5401, F IN1* F1 ( 543 I ,
   E           ISFIN(  540)
    INTFGEP  FINSRC(540,43)
    COMMON  /WRKSH8/  TOTCST,TOTREM,TOTLOO,TOTMTH, KNDX, F1MSRC,FINCST,
   E                 FINRFM,ISFIN.NUM
    COMMON  /UBNCTL/ CTLFLW,CTLCNC,CTLOO, STMCTL.STMARA,COM:TL,
                   COMAPA.OTlCTL.OriARA.OT2CTL,OT2ARA
    COMMON  /RFOCTL/ CTUSI F,rTLE,SOILCI,SOI I C2,CTIEUO.CUALW4
*********************************+**************+*********************
    ')ATA  ALPHA I, ALPHA?/'* *,****/
    1F( ISWTf.M.FO.l I  GO  TO  13^
    IF(.NOT.LINPUTI GO  TO  700

                    SAVE  COMMAND

-------
 60
 61
 62
 61
 64
 65
 66
 67
 68
 60
 70
 71
 7?
 73
 74
 75
 76
 77
 78
 79
 00
 81
 82
 83
 84
 85
 86
 87
 08
 89
 90
 11
 72
 93
 94
 95
 96
 97
 98
 99
100
131
102
i03
104
105
106
107
108
109
110
11 I
112
113
114
115
116
117
lie
H9
10
21
24
    IP 3=0
    IP4 = 0
    IFIKFYWRO
    IFtlDOURBl
             GT.  1   CO TO  700
             IPt=l
             IP2=l
             IP3 = 1
             IP 4=1
                NSI>.CF.,OTHI1RR,QTHRUL,NTLF , IP I, IP 2, IP 3, IP 4
   II 1 LOORC P)
   IF(L4'JAL>
   WRI Tf < JOUT, I )
   FOHIATt 8151
   IFINTLF.EQ.T I GO TO  7
   00 5  1=1 ,NTLE
     WR 1TF< JOUT,2HKTITLF( I , JJ ,J=l,40l
7
5
7




8





FOKMAT (40AI )
CONTINUE
IFUIffURfl
IF PFLOW( I I>3> , PC ONC (I f>3)
  FOI'MAT(2Fl'J.4 )
 GO TO 80
      HF*F  FOR  URftAN NON-POINT SOURCES
 KOI)C = ITVP( I (-5
 GO TOI2I,2?,23,24>,KORF
 IP 4= IP 4*1
 WRITtIJOUT,15) UALS(IP4I
 GO TO 80
 WRITE! JOUT, 15 )  UALC(l<>5)
 GO T3  SO
 IP6= IPf !
 V'RITFI JOUT ,15)  W2UALHIP6)
 GO TO  po             |
 IP7 = IP7 H
 WRI TH( JDUT, 15)  W2UAL^(K>n
 GO TO  80
      HfRF  FOR  RURAI  CROPLAND SOURCES

-------
120         40  IP?=IP2*l
l?l             AUNIT< I,2I=AUNIT(I, ?l*l 000.
122             IT(LOORCPI  GO TO  50
123             WRITEtJOLIT,4?IUSLFR( I"7),USLEKI IP?),USLELS ( IP2I ,USLEC(IP2I,
124                    USLEPMP2I .RATIO! IP2 
I2"i         4?  FOR1A1< 5F15.4.F15.R)
126            GO TO  13
I? 7     C
123         50  IF( .^TT.L4UAL1 GO  TO  fl
179             HRITFJ JOUT, 15 I W4UALIIP2I
130            GO TO  83
131     C           HFRF  FOR RURAL  NON-CROPLANO SOURCFS
132         60  IPl=IPl*l
133             IFtLODRNC)  GO TO  70
134             WR ITE( JOJT,6?IGRASAHPH,UALG< IP 1) ,WLNOA( I PI I , UALW (I PI I ,
135           &    H 3 OTA I ( IPl I.W3UM. It IPl I.W30TA2I I P 11 , *f3U AL 2( I P 11 , W 3(1 T A 3( IP II ,
136           C    W3UAL3I IPl I
13?         6?  FORMAT<13F15.4J
138            GO TO  R"
139     C
140         7)  MR ITEI JOUT.6? ILOORN HIP U.LOORN2I  I P I I, I OD I W3( I P 11 ,LOD 2W3I I P 11 ,
141           t    LOn3W3UPl)
142     C
143         00 CONTINUF
144     C
145            GO TO  flOO
146     C
147     C           TO  SAVF CONTROLS
148     C
149        200 IFH STAGE  .F.Q. 01  GO  TO  700
150            WRlTF(JDUT,202( ALPHAl
151        202 FORMAT IA4)
152            IFIURRfTLI  If>l=l
!53            IF(RULCTL)  IP2=l
154            IF(LRANK)   IP3=l
155            WRl TF( JOUT.l(  I PI , IP2 ,1P3,1ST AGE
156     C
157            00 ?50  J=l, ISTAGF
15B            IP 1=0
15?            IP2=0
160             DO 240  1=1.NSRCE
161               IFIITYPIII.EO.U GO  TO  240
162              WPITFIJOUT, 15 > CTLOtm.J)
163               IFUTYPt II . EQ.2 )  GO  TO 2?5
164     C           HF3E  FOR  URRAN  C  POINT  SOURCFS
165             IP1=IPI*1
166             HRI TF( ,IOIJT,62I CTIFLW(IPI,J,C1 LCNCI I PI , J I, STM AR A( IP I', J ),
167           t ST'ICTLIIPI.J ),COMARA( IPl, JI .COMCTLI IPl , JI , OT I A RA( I PI , J) ,
168           f. OTICTI ( IPI,J),OT?ARAUPI, JI.OT2CTLI IPl, JI
169             GO TO  240
170     C.           HERE  FOR RURAL  CROPLAUO SOURCfS
171        2?5  IP?=IPZ*l
17?             WRl TF( J3UT,62IICTUSIC J,IP2.I P3I ,1P' = l ,51 .SOILCl ( IP2,J I,
173           C SOU C?( IP?, J I.CTIFROI IP?, JI.CUEI  IP?, Jt .f.UAL W'.( IP2, JI
174     C
175        24T  C.OMTINUF
176        250 CONTINUE
177     C           TP  SAVF  WANK I MCA
17R            WPITF(JTUT,?G?I ALPHA?
179            WR IT F( J0(,n , 252 ) NUM, TOTI.ni), TOT4TH

-------
189        ?S2 Fill'MATC I 5.2F15.4I
IRl            MR|TF(.IOUT,62MTnTRFM( J |,.| = l, I STAGE I,< T1TCSTJl ,.1=1, I STAGE I
18?            (JO 260  1=1 .NSRCF
181             WPI TF(.r)UT, 151 TRNSMNdl .PMOUTHU )
IB'.             DO 25r>  J = l, ISTAGE
185              WRl Tf ( JOU1 ,262)  PQ1F(I,JI,PUCOST(I,JJ,TCOST I, J ),DIFMTH( I, Jl,
IBS           f.  CPMUFMJ f, J ),KERANK< I , Jt
187        26? FORMAT(5Tl5.4, 15 I
88        255  CONTINUE
189        260 CONTINUE
190     C
191            00 275  1=1,NUM
19?             WRIT C JOUT, 273 UFINSPCI I, J ), J 1,411 ,K<*nxm ,1 SFINt II tMNREMd) ,
193           C FINC SI I I I
194        270  FORMATi 4 3A I, 215.2F15.4)
195        775 CONMNUF
196     C
197            GO TO  POO
198     C
199     C       REAO COMMAND
?00     C
?0l        100 IF(KFYWPO  .GT.  01  GO TO 300
202            RFAOJJIN.U NSKCE,OTHUPB,OTHRUL,NTLE,I PI,IP2, IP3,1P4
203            IFIIPl.EO.il I OOURB=.TRUE.
204            IFI1P2.E0.1)  LODRNC=.TRUF.
205            IF(IP1.FO.l  LOORCP=.TRUF.
206            IF( 1P4.F0.1 >  L4UAI = .TPtJF.
207            IFINUF.EQ.OI  GO TO 107
20fl            00 105  l=l,NTLC
209             RFAO( J IN,2 H KT ITLE( I, J I, J=l, 40 >
210        105 CONTINUE
211        107 IFIOTHURB.GE.l
                                REAO( JIN.8H TLEURU J ,J = l,l2>
                                REAOIJIN.B HTLEUR2(Jl,J=l, 121
                                REAIX JIN.RMTLFRU1 I Jl , J = l ,12 I
                                REAO( JIN, BHTLERU21J),J=l,l2l
                                PEAOI JIN.BJ (TLERU3U ), J=l, 12 
212            IFIOTHUPB.FQ.2
213            IFtOTHPUt.GE. I
214            IFIOTHPUL .GE.2
215            IF OTHRUl .E0.3
216            IP1=0
217            IP?=T
218            )P3=0
219            IP4=0
220            IP5=J
221            IP6=0
22?            IPI = 0
223            Nl)RP=0
224            NRUCRP=0
225            NRUMCP=C
226     C
227            00 18j  I=l,MSRCE
??8             NPOS< 11= I
229            PFAUCJIN.IOI (SRCFI I,J) , J=l ,28 I, ITVP< ! !, APOF d I , ( MJV !T( I,J>,J = l,2l
230           C   .( SIWFFA1 I , J) ,J = l ,31
231             IFdTVPdl.EO.il GO TO  160
232             IF( ITYPt I  .F0.2I  GO TD  140
233     C           HfF  F0  URBAN  POINT  SOURCFS
234             IFILOnURRI  GO TO 100
235             IF( I TYP( I  .GT.5)  GO TO  l?0
237            MURB=NURB*l
238             RFA'M JIN, 151 PF l.OW{ I P3 1 , PCONf. ( I P1I
239            f.O TH  1RO

-------
240      C           HFRE  FOR URBAN  NON-POINT SOURCES
241        120 REAOUIN, 15 IMLURB
242            KOf)E = ITYP( I 1-5
243            GO  Tfll 121, 122,123,1 ?4I ,KOO
244        121 IP4=IP41
245            UAt S< 1P4) =IMLURB
246            GO  T'l  1BO
24T        12? IP5=IP5H
248            UAICJ IP5-J =UAl URB
240            GO  TO  IPO
250        123 IP6=lPfr*l
251            W2UAL KIP 61 =IIALURB*
252            GO  TO  180
253        124 IP7 = IP7H
254            W2UAL 2UP 7)=UALURQ
255            GP TO  1BO
256      C           4ERE  FOR RIJRAL  CROPLAND SOURCES
257        140  NRUCRP=NRUCP*1
?5fl      '       AI)NIT( f ,?)=AUNITH,?)*1000.
259             IP2=IP2+l
260             IFILOnRCPt  GO TP 150
261             CPPLNO=AUNIT (I,U*130.0
262             RFAOI JIN.42IUSLFRI 1P2) ,USLEK(I P2  .UStFIS < I P2 I ,USLEC ( I P2 J,
263           f.  lISLfPt IP2 t.RAT I0( IP2
264             SO I LSI ( IP2 I=USLCR( I P2  *USLEK { I P2  *USL FLS ( IP 2 I *USL EC( IP 2 I *
265           f,  USLEPI IP2)
266             SO ILS2 ( IP2 ) = S OILS It IP? 1*2.243
267             T1LFRUP2) =SOI LS2 I I  P2 I *CRPLND
26S            CO TO  IflO
269      C
270        150  IF< .NOT. 1.41/AL)  GO TO  ISO
271             REAO< J IN, 151  H4UAH  IP2J
272            GO TO  180
273      r           HFRE  FOB  RURAl  NON-fROPLAND SOURCES
274        160  NRUNCP=NP,UNCPH
275             IP1 = IPI-1
276             IFUOORNC )  GO TO 170
?77             READ! J IN, 6 2 1GRAS A(IP1,UALG( IP I I.ULNOAI !P1 , UAL Ml IP I) , W30TAH IPII
278           C .W3UAI UlU ,W30TA?( IPH .VI3UAL2 (IPI I.W30TA3I IP 1 ,W 3UAL3UP 1 I
279             LODRNK I P 1 I = GR ASA( I  P U*UALG( IPII
230             LOORN2 ( IPI I=WLNOA( I  PI  I *UAl H( IP I I
2fll             IF( OTHRU1 .FO. 0)  GO  TO 100
202             LOD1W3( tPl ) = W30TAl(  tPll*W3UAL U IP I!
283             L002WH I PI I =W30T A2 t  I PI ) *W3l AL2 ( I P 1 )
284             LOP3W31 IPI I=W30TA3(  IPll*W3UAL3( IPII
205            GO Tn  1S3
287        170   RFAD( J I\) , 62 ILOORN 11 IPII .LODRN2UPU ,LOOIW3( I PI I , LOU2 W3 1 I PI I
28           f.   L003W3IIPI)
269     C
290        1RO  r.ONT INUF
291     C
292            UNP'JT = . TRUE.
293            GO TO OO
294     r
295     C           TO  REAP  CONTRHl S
296     f
297        30T  R6AIK jrN,207,fNO=400 I ALPTST
298            I F( ALPTST  .NF .  ALPHA 1 1 GO  TO  300
299     C

-------
                                                      ONJ
                                                   NbdlJH
                                                         'j  coo
                                                          co/
               1/ilDdNI NJ39  13A  ION SVH VIVO   Oi
                                          no/ 'irun l
         <.s3rnvA loaiNOJ  30  indinu/indtti NI duad^Ci IIVHUUJ
                                             (ZCV iflOI JdLldH 00 ^

                                                   CCS 01  UO
                                                                   3113 30 ON3
                                                                        see
                                                                        >><,
                                                                        toe
                                                                        zse
                                                                        IS
                                                                        ost
                                                                        6*?C
                                                                        B/
      INI JS
tr*
                             M =
                                               (1HS3U1J  3
                                                       d
                                                       00


                                                      iNU'J 09 1
                                                dnNllNOO
                                 If I )NVaj>lMr ' 1 IrtJdlldJ  3
                                       30V1S I' T = f S9 UO
                        I 1 IHinOhdMI INWSNbl (
-------
                                         The fourth source file is called




                                                    WTRCTL
oo

-------
 3
 4
 5
 6
 7
 n
 9
10
11
12
13
14

16
17
18
19
20
21
22
23

25
26
27
20
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
4fl
49
50
51
5?
53
54
55
56
57

59
r
c
c
c
r.
c
c
          1NE  WTRCTL1 IS ,KFYHRP, KOLINT P, I ER.)

   ROUTINE TO  ACCEPT  OF CONTROL  STRATEGIES FOR  WATERSHE3
     IS - STAGE  CODE   MAXIMUM  IS  3  STAGES
     KFYWin -  INPUT SNITCH CONTROL IMG PROGRAM  FLOW TO ACCEPT
          CONTROL  STPATFGIES FOR  URBAN (POINT  t NON-POINT)  SOURf.ES
          ANfl  RURAL CROPLAND SOURCES
******+*+*#*++*******tit*********i*******************+***ttt*it***:
  LOGICAL L INPUT. LODURR.LO OR NC, LODRCP, L4U AL , LIN 1,1 lN2,Lm,llM4
  LOGICAL URflCTL.SULf. TL.UCTLODU) , RCTI 00(3) .UPRCNT .JXPCNT , RPRCNT ,
 f.        RXPCNT.URRCST.RIILCST
  INTEGFP OTMURfl .OTIIRUI ,SICE ( 2 10 , 28 I, T YPCOOI9 , 1 2 ) ,OPT V AL ( 8 I
  OIMFNS I3N ITYPJ 210) ,NPDS< 210) ,AUNIT( 21 0,2 ) , K.T I TLF ('+ ,40 1 ,
 K  SURFFA(210,3I,CTLOOI210, 31, CTUSLE!3,30,5)
  01MFNSION STMCTLI30.3),STMARA(30,3 I,COMCTL(33,3),COMARAl33,3),
           OT1CTL(30,3I,OT1ARA( 30,3 I,OI?CTL(3O ,3 I .OT2ARAC30,3 I
  01MFNSION PFl OW30),PCONC(30),UALS(30),JALC(301,W2UAL K 301,
 f.         W2UAL2J30),TRNSMNI210)
  [NTEGEP TL EUR 1 ( 12I,ILFI2( l?),APOF( 210!,AREACN< 4) ,UALCON(4)
  DIMENSION USLF.RI30) ,USLEK(30 I ,US LELS (30 ), USL FC ( 30 ), W4UAL ( 30 ) ,
 K          USLFPI 30),SOI LSI!30),SOILS2t30) ,TTLER(30 I ,RATI0(30 I
  01MENSION PniF(2lO,3),TCOST( 210, 3 I,PUCOSH210,3)
  COMMON  /WTRIO/  IN.IOUT.NSRCE ,KT IT LF ,NT LE, NURB, NRUNCP, NR'JCRP
                   L INPUT,LOOURO, LODRNC,LINl, I IN2,LIN3,LIN4,OTHDRR,
                   OTHRUl,LOORCP,TYPf,00,JIN,J(1UT ,L 4UAL , KQUT
                   SRCF,1TYP.NPOS.APOE,AUNIT,SURFEA,TLEUR1 .TLEJR2
                   PFLOW,PCUNC.,UALS,UALC,W2UAL I ,W2UAL2
                   US LFR,US LFK.USL FLS,USL CO,USL FP,SO !L S 1,
                   SOILS2,TTLER,W4UAL,RATIO
                   PDIF.TCOST.PUCOST.TRNS"^
                   UCTLOO.RCTLOO,URBCTt,RUI CTL,UPRCNT,JXPCNf,RPRCNT,
                   RXPCNT,OPTVAL,NOPT,URHCST,RULCST,AREACN,UALCON
  IIMFNSION CTL FLW( 30, 3J.CTLCNCI 3O,3I , PCTI  81 , A PC T 1 4)  , UPCTt 4)
  iJIMFNSION CTt (30,3 ) , SO f LCI ( 30 , 3 ), S 0 ILC2 ( 30, 3I,CTLERO( 30, 3),
           CUALU4!30.3)
  COMMON  /UBNCTL/  CTLFLW .CTLC.NC , CTLOO, STMC TL , S TMAR A .f.OMC TL ,
 ;                 COHARA.nrICTI  , Or I4RA,OT2CTL,Or?ARA
          /RFDCTL/ CTUSLE ,CTLE,SOI LCI,SOILC2,CTlERO.CUALW4
          {<*%<
  INTfGEP OPTURO(5),OPTPUL<5!.OPTOUTIfl)
  DATA OPTURB/'FLOW, 'COMC* , 'AREA' , 'UAL ','LOAO'/
  DATA OPTRUL/'R *,'K  '.'LS'.'C  ','P '/
  DATA IflLNK/'      /
  00  I 1=1,8
  PCT(I)=0.0
  OPTOUT(  I) = I(iLNK
       HEARING OUIPUT  OF  STAGE  OF CONTROl
COMMON
G
COMMON
COMMON
r, OMMU1
6
COMMON
COMMON
f.
/WTRTF/
/HRKSHl/
/WRKSH2/
/WRKSH4/
/WRKSH6/
/WTPCON/
  IF( IS.CT.3) RE TUPN
  If (KrYWRO.tO. 1 )WR ITE ( I OUT, 21  IS
  FORMAT! I HO,5X, 'STAGE' ,}?.,'  CONIROl
  IE(KFYV-'RO.F0.2)WRITE(|niJT, 3)  IS
  FORMAT! UIQ.5X, 'STAGE' , I? ,   CONTROL
       IMITIAL17F
  !>0  4 1=1,4
  \PCT(I)=0.0
  UPCTt I ) = C.O
  ISl^ IS-l
  CM. I  CTLINI ( I S ,KEYW>.n, 1
                                            STRATEGIES  fOR JRBAN SOJRCFS')
                                            STRATEGIES  FOP  RURAL  S3U*CFS' 1

-------
CO
O
60
61
62
61
64
65
66
67
68
69
70
71
7?
73
74
75
76
77
78
79
ao
ni
fl2
83
84
85
86
87
B8
89
90
91
92
93
94
95
96
97
98
99
100
101
10?
103
104
105
106
107
100
109
13
11
1 2
13
14
15
16
17
10
119


C
C
c












r.









C



























f




                      11
                      13
                         IF( IER.NE.O )  RETURN
                         IF(KFYHRO.EQ.2 I  GO TO 110

                          URBAN CONTROL  STRATEGIES
HPUT=NCPT
IFINPPT.EQ. 01  NOUT=4
IFUOO'JRB  .AND. NOPT.FO.O)  NOPT=l
IFdODURB  .AND. NOPT.EQ.O)  OPTVAL(1I=5
DO 51=1,NOUT
  IF 1NOPT.EO.OI OPTVALCII=I
 K = OPTVAI (I I
 OPTOUT(I)=OPTURB(K)
CONTINUE
IF(.MOT.UPRCNTI GO  TO  20
TF(UXPCNT)  GO  TO 20
     HERE  TO  ENTER PERCENT  REDUCTIONS FDR  SELECTED SOUR3ES
1=0
1=1 + 1
IF( I  .GT .  NOUT I GO TO  20
 K = PPTVAL(I I
 IFIK .E0.3I GO TO II
 IFIK.EG.4)  GO TO 15
 WRITEl IOUT,101  OPTOUTdl
 PEAOIIN,46)  PCT(K)
 GO TO  fl
     PPOMPT FOR ARFA T  REDUCTIONS
 IF(ARCACNI1 I .EQ .0 I GO  TO  12
 WP ITFI I OUT, 11 I )OPTURB(3I
 READU M ,461 APCTI II
 1=1+1
 IF t 1 .GT.  NOtlT)  GO TO  20
 IF(AREACN(2.FO.Ol GO  TO  13
 HP ITF< I OUT, 112 lOPTJRRH)
 RFAT(IN,46I  APCT(2>

 IFU .GT.  NOUT I  GO TO  20
IF(AREACNI3I.FO.OI  GO TO 14
 WRIT E( IOUT, U3HTLEURH JNMI ,JNM=l, 12) .OPTURflm
 PFAOIIN.46I  APCTI3I
 1=1+1
 IF(  I .GT .  MOUT I  GO TP  20
 IF
-------
oo
          120
          121
          122
          123
          124
          125
          12S
          127
          128
          130
          131
          132
          133
          136
          137
          13(1
          139
          140
          144
146
147
I4fl
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
169
169
170
171
172
173
174
175
176
177
1 78
I 79
     IF!I  .GT. NOUT)  GO TO 70
16   IFIUAt C.ONI2I .tO.O > GO TO
     WRITF( I OUT,112)OPTUPflt4)
     RFAOIIM.46) UPCTl21
                                           17
            17
     IF(I  .GT. NOUT)  GO TO 20
     IFIUA1CON!3) .FO.CI GO TO 18
     WPITH IOUT.113) (TLFURl MT OF SELECTED CONTROLS
                         25
                     OPToim n
2?   FORMAT*-3FMTFR CONTROt  VAHJES  FOR  ,A4,( PER  SOUR:E'I
     GO  TO 40
25 IFINOPT.GT.21 GO  TO 30
   IF<(fOPTl. EO.I.AND.IOPT2.EO.I ) .OR . ( I OPT 3.F3. l.ANO.MPT4.E3. Ill
  r,  GO TO  27
     WRIT El 10IJT, 26HOPTO'JT( I I , 1 = 1,2)
26   FORMAT { OFNTTR CONTPOt  VALUES  FOR ,A4,' OR  g,A4,  PFR  S3U3CE"!
     GO  TO  40
2 1   V'P ITF' tOUT, 2H IIOPTPIJTI I ) , 1= I, ?l
Z<\   FflRM/1 ({ 'OFNirR OONIROI  VAI.I/ES  FOR  , A4 ,  ,'" , A4 ,   PFR SOJCF ' I
     GO  TO  40
30 IFINOPT.GT.31 GO  TO 35
   IFt IOP3.EO. 1. AND. IOPT4.FO. I ) GFI TO 33
     WR IT CI IOUT, 32 IIOPTOIJTI I ) , ! = 1 ,?)
32   FORMAT (CfNlFP CONTROL  VALUES  FOR ,A 4, , ,A4, '  OR ',A4,
  fi  '  PEP  SOURf F1 )
     GO  TO  41
33   WR ITF I I OUT, 3 4 MOP TOUT I I ) ,1 = 1,3)
34   FORMAT! 'OFNTfP  CONTROL  VALUfS  f OR '.A'l,' OP  ' , A4 ,  ,' , A' ,
    '  PEP
                                       .EO.l I
                                       .F0.2)
                                       .F0.3I
                                       .E0.4I
                                       .FQ.51
I OPT 1=
IOPT2=
IOPT3=
IOPT4=
I OPT5 =
                         IF!IOPT5.EO.I  .AND.
                         IF(.MOT.UXPCNT  .AMD.
                              HF.RE fOR  IMPUT
                         IFINOPT.GT.I I GO TO
                          WR ITFI IOUT,23)
                          FORMAT < '3FMTFR

-------
oo
 180
 111
 182
 183
 184
 185
 IH6
 187
 iafl
 189
 190
 191
 19?
 193
 194
 195
 196
 197
 193
 199
200
 201
 20?
203
 204
205
?06
 207
208
209
 ?10
211
                    35
                    37
                    40
                    41
                    4?
                    44
        213
        214
        215
        216
        217
        218
        219
        220
        2?l
        222
        2?3
        22/
            46
            54
        226
        2? 7
        229
        230
        231
        232
        233
        234
        235
        236
        237
            64
            c-5
                                                       0. AND. IIP 12.f3 .0. ft tO. I OPT 5. Ed. 3)
                                       5.AN().!nPT3.EO.i).ANO. IOPT4.EQ. 0. AM). I DPT5.EQ.O)
  GO TO 40
 WRIT E( I OUT,37 ) (OP TOUT( 11,1 = 1,4)
 FORMAT('3ENTER  CONTROL VALUFS  FOR
   PEP  SO UR r F  )
      ACCEPT  VALUES FOR CONTROLS
 00 95  I=1,NSRCE
  1F( ITYP( I ).LF .2! GO TO  95
  IFUTYPUI.LE.5  .ANO.IOPT l.EO,
;    GO TO  95
  IF(ITYP( I I.GT
      GO  TO  95
  IF(.NUT.UXPCNT   .AND
  |F( I OPT I.EQ.l .OR.ITPT 2.FO.I)
  16=1-1
  I 7=1-2
  18=1-3
  19
             -FQ.6)
             .FQ.7)
             .F0.8I
             .FO
                                                             , A4,
                                             A4,
                                                                               , A4,
                                                                                     ',A4,
                                               UPRCNT)
                                                       GO
                                                       GO
                                                          TO
                                     44
                                     41
                           = 1-4
                        !F< ITYP( I).
                        IFUTYPI 1)
                        IF(1TYP(I),
                        IF( ITYPC I)
              .91
                   WRITE(IOUT.42J(SRCFI 16,J),J=l ,28)
                   WRIT FtIOUT.4?)(SPCE( I7,J),J=1,28)
                   WRITF(10UT,42)(SRCE 18,J I ,J = I,28 |
                   WRITE(IOUT.42)(SRCEI 19,J),J = l,28)
    TE( 1 OUT, 4 2 MSRCE(!,J),J = l,28)
 FORMAT(IX.28A1I
 IM ITYP( 1 I.GT .5 I  GO TO  65
     HFRE  FOR  CONTROLS FOR URBAN  POINT  SOURCES
IP3= IP3*l
 UtUXPCNT ) GO TO  54
 1F(IOPT5.EO.1)  GO TO 60
 fF(UPPCNT) GO  TO  56
 1FtlOPTl.FO.l  .AND.  IOPT2.EQ.ll  GO  TO  52
 rFUniPl.EQ.il  REAOIIN.46) C TLFLW (I P3 , I S I
 IF{ IOPf2.EO.il  ReAOHN,46l C TLCNC( I P 3 , f S I
 GO TO 58
 RFAOI1^,46) C TLFLWIIP3.I S) .CTLCNCC1P3, IS)
 FORMAT<2F10.'1 I
 GO TO 58
           FOR  PERCENT RFOUCT10N CALCULATIONS
          .FO.O)  RFAOUN.46I PCT ( I I,PCT 2 I
                 PFAD(IN.46I  PCT(51
                GO TO 60
                 CTLFIW* rP3, ISI = CTLFLM( IP3, ISI-CRFLW( I'3,ISI*
    HFRE
IF(IOPT5,
!F(I OPT 5.
II( 10PT5.
                                CTLCNCI IP 3,ISI=CTLCMC( I P3 ,1S)- ICTLCNC(1P3, IS)*
                                         IS) *  CTLCNfUP^,IS) *  1382.0
        239
           ,FQ.II
           . E Q. 11
  I F(inpTt.FO.l 
i       PCTIUI
  IF(IOPT 2.E0.1)
i       PCT(2)
  CTLOO( I, IS=CTLFLMIIP3,
  GO TO 93
  in iJPPCNT) GO  TO 64
  RFAOt n,46) CTLOOt I , I S)
  GO TO 90
  C TLODII ,IS) =CTLOO*Prr(5 I )
  GO TO 90
      HFRF FOR CONTROLS  FOR URBAN  NON-POINT  SO'.JPCTS
K=r TYPI!1-5
 IF(APEAfN(K).EO.O .ANO. UALCON(K).FO.0)  GO TO 90
 IF ItlXPrNTI GO TF 76
I F( OPT 5. FO.l ) 30 TO  fl5
 If (UPRCMT I GO TO 78
GO  10(67,69,71,7)1,K
      HFRF FPP Nr)NPf)fNT  CONTPOtS FOP  STORM SEWF-R
 IP4.--IP4+1;

-------
            240             IF(A3FACNIKI.FO.l  .AMD. IIAt CONI Kl . FO. I (  GO Til 68
            241             IF ( ARFACNIK ) .FO.l )  P F ADI IN, 46 > STM ARA ( I P '<, I S I
            242             IF( UALCf'NI KI.FQ.U  RF All t I N ,46 IS r MCT I ( I P'., IS I
            24^             GO  TO  ?PO
            244         68  RFAD(|N,46)  STMARAI IP4, ISI.STMCTLf IP't, ISI
            245             GO  TO  ?flO
            246      C           HFRF FOR NONPOINT CONTROLS  FO" COMBINED  SEWER
            247         69  IPr. = IP5*1
            248             IIM AREACNIKJ .FO. I.AND.UALCON(K) . EO. 1 I GO TO 70
            ?49             1HAHFACN
            250             IF(UALCONfKl.FU.l I  RF Al)( I N.46 1COMCTL ( 1P5, IS 
            ?51             GO  T'l  282
            25?         70  RFAOIIN|46I  COMARA( IP 5, IS>,CUMCTL( IP 5,IS)
            253             CO  10  2fl2
            2S't      C           HFHF FOR NONPOINT CONTROLS  FOR OTHER  SOURCE #1
            255         71  1P'.= IP6H
            256             ff IARECN(KI.FQ.I  .AND. UALCOM(K).EQ.1t  GO TO 72
            257             IF(ARFACN1K).CO. II  OF AIM IN,46)OT1ARA(IP6,1S)
            ?5()             IF(UAL( flHi K) .FO.l)  RrAOM
            290             IF(APEftCNIKI.ro.l  TOMARAI IP5,ISI=COMARA( IP5, I SI -
            291           S    (COMARAI  IP5 , ISI*APCT(2 I I
            29?             IF(IJALCON)K).FO. 1)  f.OMC Tl  I P5 ,1 S I =COMC Tl ( I PS, I S I -
            29}           r,    (CO"CTL(  IP5, IS l*'JPr.l (21 I
            29',        78? C TI.PDU ,1S)  =CO"1ARA( I P-i, IS)*COMCTt (IP5,  IS I
            295            GO  TM  oc
            296      C          HfPF FOR PFT.FNT RFOUf.TIONS  IN CONTROLS  f OR 01HER  SOURCE: H I
            297        201  IPft=IPf*l
            298             IF(ARFACNIK  J.FO.lI  OT1APA(JP6,ISI=OT1ARAI IP6,1 SI -
            ?99           r,    (01' ARA(  I PC. . IS)* 'VPCT (3 I I

-------
313             IFCJALCONIKI.EO.II  IT 1CTL( IP 6,!S= OT1CTL ( I P6,1 SI  -
301           r.    IOTICTLMP6, IS )*JPCT !3 ) I
302        284 CTUTM ! , I S)=r)TlARAH Pf>, I S) *f)TlCTL! IP6, IS )
303            GO  TO  90
30'.      C           HERE  FOR PERCENT  REDUCTIONS IN CONTROLS FOR  OTHER SOURCE  #2
305        785 IP7=IP7H
306            IE(AREACNIK I.EQ.l )  OT2ARA! IP7, IS) = OT2ARAt IP 7,1 SI  -
307           5    IOT7ARAU P7 ,1 S)*APCT K ) )
308            IFHJALCONIK ).EQ. t  OT 2C TL< I P7 ,1 SI =0 T2C TL ! IP7 , I S I  -
309           C    (OT2CTL tIP7,IS)*')PCT!4l )
310        286 CTLOnt I ,1 SI =OT?ARA< I P7, 1 S)*PT2CTLUP7 , ISI
311            00  TO  "0
312         85   IFIUPrCMTI GO  TO flft
313             RFAOTVAI.I I 1 = I
339             K = OPTVAL( t 
340             ir{K.GT.5  RO TO 114
341             NUSLE=NUS1EI
342             OPTOUT ( I J = OPTRIJL(K)
343             CO  T0 115
344        114  IFIK.E0.6I OP TOUT!I I=1BtNK
*45             IFJK.FO.t) OPTOIJTI I ) = PPTUR!H4I
346             IFJK.F0.3> OPTOUTU)=OPTURB(5I
347        115 CONTINUE
34R      C           HERE  TO  ENTER  PERCENT  REDUCTIONS FOR  SELECTEO CONTROLS
349            IT I.MOT.RPRCNTJ  GO  TO  125
350            IF(PXPCNT)  GO TO  125
351            DO  120  1=1,NOUT
352             M=0TVAL<1)
353             IFIM.NE.M MR 11 F HP'IT , 10   OPTHUTdl
354             IHM.rQ.61 WRITE! inUT.l IM
355             KFAD( JN.46)  T.  TIM)
356        12? CONTINUC
357        117 FORrnn 'OFNTf R PERCENT  REDUCTIONS FOP SOURCE EFFICIENCY  RATIO')

-------
        360            K3=OPTVAL(3|
        361            K4=OPTVAL<4>
        362            IF ( .NOT.PXPCN1  . ANO. PRCNTI  GO TO
        363      C            HfRE  FOP PROMPT f(M>  INPUT  OF SELECTED CONTROLS
        364            11=0
        365            IT (MUSI E.GT.OI  WRITf (TOUT , 127 < OPTOUT t I) , 1=1 .NUSLEI
        366        12T FORMAT ( 'OFNTFR  CONTROL VALUES P6R SOURCE FOR   , 4< A2 , ' , ' ) , A2 I
        36T            I F(NIISIE.GT.O>  GO TO 143
        368        I 30 I 1= I Tf 1
        36-)            IFUT .GT .NOUT t  GO TO 200
        370            IF (OPTVAL (ITI.EQ.6i WR IT Ft IOUT , 132 I
        371        132 FORMAT!  OC1TFR  CONTROL VULUES FOR EFFICIFNCY  RATIO PER  SOURCE' 
        372            IF (PPTVAL ( IT I.NE.6I WR ITE ( IOUT, 134   OPTOUTUTI
        373        134 FORMAT! ' OF.NTER  CONTROL VALUES FOR  , A4 ,  PER  SOURCE'!
        374      C            Of GIN  CONTROLS
        375        140 IP2=0
        3 16            OH  195  I =1 .NSRCE
        377             IT! TTYPI 1 I .NE .21 50 TO 195
        370             !P2=IP2*l
        379             1F( NUSLE.FQ. 01  GO TO  173
        380      C            HERE  FOR INPUT OF IJSLF COEFFICIFNTS
        381             IFIRXPCNT  .OR.  .NOT.  R PPC NT I WR IT F. ( IOUT , 42 M SRCEt I , J ), J = 1 , 2 81
        382            IFIPXPCNTI  GO TO  150
        383            IFIPPRCNT )  GO TO 154
        384            IHHUSLt.FQ. I)  REAOHN.155) CTUS LE( I S , I P2 , K 1
        385            1F(M JSLf.EQ.2l  REAOUN.155I C TUSLF. { I S 1 1 P2 ,Kl I ,f tUSLC { I S , I P2 , K? I
        386            (FINIJSL E.F.Q.3)  REAOIIN.155) CTUSLEI IS , IP 2,K U ,C TUSL61 I S , I P 2, K2I ,
        387           C      CTUSLEI I S.IP2.K3)
co      3flfl            ir iPC T( K2  , PCT ( K3)
        397            IF(M/SLE.F 0.4 I  RFAOUN.I55I PCf (K t J , PCT K2I , PCI (K 3) , PC U K4J
        398            IPf MUSLF.EQ.5J  RF A0{ I N, 155 HPCT ( KO) , K3 = 1 , 5 
        399        154 CTUSLEC IS, IP2.KI ) = CT(JSLF(  lS,IP2,Kl)-(CTUSLE
        416            CTLFROC I IV , 1S)=S01LC? t P2 , IS )  *  CRPLND
        417            OIFPNC=niFRNC  -  C TLFROI I P? , I SI
        4 Ifl            CTlOr>( |, IS ) = CTLOOI I, IS |-CnirNf*RATin| IP?)*CTLF< JP2.I S) )
        419            r,0 If'  190

-------
420      f           MFPF. FOR  INPUT  OF EFFICIENCY  RATin
421        171  |F(DI>TVAL( IT l.fJt .6 I  GO TO 133
422             IFJRPRfMT) GO  TO  175
423             RFMH IM 155 r Tl F < IP2, I S )
424             GO  TO  178
425        175  IF(.NOT.RXPCNT)  GO  TO 176
'.26             PFAnt IN,1551 PCT (61
427        1 T6  CTLFI IP2 ,1 SMCTLFI I P2 ,1 S ) - ( CT LF 1 IP2, IS )*PCT S I I
'.28        178  CRPL'>ir>=AIINm I. 11*100.0
'.29             IF(lS.FO.l) OIFRNC=TTLFfU IP2l-CTLEflOtIP2,IS)
430             IFdS.NE.ll  DIFRNC = C TIH RD IP2, ISl J-CTLFROI  IP2, IS I
431             CTI pr>< i, is >=cTLorx i, is )-0
431      C          HFRF FOR  INPUT  OF  FITHFR  I GADS  OP  UAL
434        IS1)  IF=CUALW4HP2, I SI -( CL)ALW4( IP?,ISI*PCT(7)I
'.40        18'.  CTLOOn , IS I=AUNIT( I, I *CUALW4( IP2, IS )
441             GO  TO  190
442        185  IF(PPRfNT) GO  TO  187
443             READUN.155) CTtOOU.IS)
444             GO  TO  190
445        187  ir(PXPOIT) RFAfX IN, 155 I  PCT(8I
446             CTLOniI,IS)=CTtOOl I, ISl-(CTLOO(I, IS)*PCT(81 I
447      f          SCAiF CONTROL  LOADS  CALCULATE LOAD OrFFt'PENCES
448        190  CTLOO(I,IS=CTLOD(I, IS 1*1000.
449             IF(IS.EQ.t)  POIFJI4U=AUNfT(I,2>-CTLOOII,1>
450             IF(IS.GT.l) POIFII.ISJ=CTLOOII,ISl)-CTLOD( I ,IS)
451        195  CONTINUE
452             IF(NIISIF.GT.O)  I T = NUSLF
453             NIJSIE=C
454             GU  TO  130
455      C          DONE
456        ?nO *>ULCTL= .TRUE.
457             KUJNTR = KOUNTfm
458             IF=0
459        999  HETUPN
460            ENO
461      f
46?             SUORnUTtNE CTttNttIS.KEVHROt 1EP>
463      C     	
464      C      ROUTINE  TO  INITIALIZE CONTROL STRATEGY  VALUES AT  INITIAL STATE
465      C         PR  PREVIOUS  STAGE  OF  CGNTHOI S
466      C      IFM =  I  IF  NO INPUT DATA EXISTS FOR KEYWRO SOURCE
467      C
468      C **************************************+*****************************
469            LOG I r. At LlNPUT,LODURB,l.OORNC,LOORCP,L4UAL,LINl,LIN2,LIN3,L IM4
470            IOGICAI URBCTL.RULCTL,UCTLOO(3),RClLOni 3) .UPRCNT ,IJXPCNT, RPRCNT,
471           F.         PXPCNT  .URBCST .RULCST
472             INTEGER OTHURH.OTHRIIL ,SCF(210,281  ,TYPCOO(9,12 >,OPTVAL(8 
473             OIMFNS [ON  ITYfM2iOI,'l<>nS< ?IOI,AUN[T( 210.2I.KTI TLE(4,40I ,
474           d   SlinFFA(?lC ,3) ,CT LOOCPIO , 3  , CT USL F I 3 , 30 , 5 I
475            OI^FNS \r)V  nFLI);V( 30) , PCONC { 30) ,UALS( aO) , KALC ( 3O) , U'?UALl ( 301 ,
476           F.           W?UAL2(30(,TRNSMN(210I
477            01 MFNSI ON STMCTL 130,3) , STMAR A ( 30 , 3  ,COMCTH3i, 3),COMAKAI 33, 3>,
478           R            01 IC1L(30,3),nTlARA(30,3) ,OT2CTLI 30,3) ,OT2ARA130,3 I
479             INTFr.FP Tl EUPl  (1? ) ,Tl FUR 2 I I? ), APOF! ? 10 >, AP FACNi 4>, UAl COM ( 4)

-------
        4 HI
        48?
        4fl3
        484
        485
         4fl7
         480
         4R9
         49?
         493
         494
CO
-J
496
497
49fl
499
500
501
50?
503
504
505
506
507
500
509
510
511
512
513
514
515
516
517
518
519
520
521
52?
523
524
525
526
527
528
520
530
531
532
533
534
535
536
537
538
539
               COMMON /WTRTF/
 COMMON
 COMMON
 COMM1N
C
 COMMON
                       /WRXSHl/
                       /WRKSH?/
                       /WPKSH4/

                       /WRKSII6/
                       /WTRCON/
                     1 I
                     12
        ION 'JSl FR< 30), USI FK( 30 J ,USLFLS< 301 , USIEC (30) , W4UAL 1301 ,
f.           USirP(30),SOlLSU33l,SOHS?( 30),TTLFR( 30I,RATIO( 301
 111 Mf NSION POir (210. 3) ,TCUST(210,3 I , PUCOST (213,3)
 COMMON  /WTP 10 /   IN, imH.NSRCE.KTITtF ,NTI F. ,Nl/PB , NRUNC P, NRUCRP
                   L INPUT , LOOUPB , LOORNC, L IN 1, L IN 2, L IS 3, L IN4, D THIP tt ,
                   OTHRUL.LOORCP, TYPCnD, JIN, JOU T , L4UAL , KOUT
                   SRCE, ITVP, NPOS, APOE , AU^n,SU'FFA,TLEt)Rl,TLEUR2
                   1>F LOW , PCONC.U AI.S , J Al C, W? J At 1 , W 2U AL 2
                   USI.fR , USt F K ,UStf L S, USLTC ,I)S LE P , SOI LSI ,
                   Stilt S2,TTLFR,W4UAL, RATIO
                   PDIF, TCOST.PUCOS1 .TRNSMN
                   UCTt 00, C TLOI) ,UBC Tl ,RULC TL , UPRCNT .UXPCNT, P PRCNT,
K                  RXPCNT.OPTVAL.NQPT.URBCST ,RULCST, AR F ACN, UALC"H
 OIMFMSI 3N C TIFLWI 30,3) ,C TLCNC ( 30 ,3 )
 OIMFNS ION CTIEI 30, 3 I , SO II C II 30, 31, SOUC2I 30,3) ,C TLFROI 30 ,3 I ,
G          CUALW4(30,3)
 COMMON  /UflNCTL/  C TLF t W.C1 LCNC , CTLOD, STMC TL , ST MARA, COMCT L ,
f,                 COMARA.O' ICTL, OT I AR ft, OT ?C TL ,OT2ARA
 COMMON  /RFOCTL/  CTUSLE ,CT LE, SOI LCI , SOI LC? , CT LERO, CUALW4
 I 51=1S  - 1
 IF (KFYWP.D.E0.2)  GO  TO ?0
       HFRF FOP URBAN CONTROLS
 IF(NUP.H.rO.O) RFTUPN
 IP3 = 3
 IP4 = 0

 IP6 =3

 00 10  IM.NSRCE
  \f(ITVP(l).LE.2J  GO TO 10
  IFITYP(I).GT.5J  GO TO 5
       HFPE FOR POINT SOURCES
  I3=IP3H
  1F( IS.GT.lI GO  TO 3
  CTlfLWI IP3,I) = PFLOW1|P3)
  CTLCNCIIP3.U =PCONC(IP3)
  GO TO  9
  CTLFLW( IP3,ISI = CTLFLW(If3, IS1)
  CTLCNCC !P3,I S) =CTLCNC( IP3 ,ISl )
  GO TO  9
       HFRE Ff!R NON-POINT SOURCES
 K=ITVP(I) -  5
 GO 10(11,14, 17,21 ),K
       MERE FOR  STORM SFWF.'<
 IP4= IP4H
  IF( IS .GT .1   GO TO  12
 STMARA(IP4 ,1 I = AUMIT( 1,11
 STMCTL( IP4, U = IIALS( I P4)
 GO TO 9
 STMftPM I P4,l SI =STH4KA(I P't , ISl I
 STMCTLt IP4, IS I=STMCTI ( (P4, ISl)
 GO TO o
       Hf
-------
         540         15 CPMARAHP5, IS)=COMARA< IP'S, ISII
         541            COMCTLI IP5 , IS)=COMCTL ( 1P5 , ISI)
         54?            GO  rn  <5
         543      C           HFRE FPP nTHER  SOURCE   I
         544         17 IP6MP6M
         545            IK IS .GT.l )  GO TO  l
         546            OTlARAt IP6, I I = A'.)NIT (1,1)
         547            OTICTL1 [T>6, 1) =W?UALl I IP6I
         540            OP  TO  i
         549         1"            DO 31  I=l,NSRCF
00       569             IF( ITYPU I.Nf .2!  GO TO 33
         570             IP?=1P?*1
         571             IFdS.GT. II  GO TO ?1
                                  ,1 P?,II=USLER(IP2)
                                  ,IP2.2)=USIEK|FP2J
                                  ,IP2.3)=USLELS IIP2)
                                  ,IP2,4I=USLFC(IP?)
                                  , IP2, 5) = USt EP( IP2)
57?             CTUSLF(
573             CTUStEl
574             C.rUSLF(
575             C TUSLFJ
576             CTUSl F(
577             CTI EPOI IP? ,1 )=TTLEP(I P2 I
578             CTt El IP?, 1 )=l.O
579             CIJALW4 ( IP?, I )=W4JAL ( IP? I
580             CTI. 001 I ,11 =AUNI T(I ,21/1000.
5fU            CO TO  30
582         ?3  00  ?5  J=l,5
5R3         ?5  C TUSLFI I S.IP2 , J)=CTUSLE t ISI , IP2 , J)
534            CTtFRO(rP2, IS) = CTLFROUP?,IS1I
5R5             CTLEHP2 , IS) = CTLE( IP?, ISI )
586             C(IALW4( IP?, I S) =CUALW41 I P? , 1 Sl>
587      C
59 fl             CTLOOII t IS) = CTLOD(I  ISI I/IOOO .
589         30 CONTINUE
590      C            DOME
591         50 lfR=0
592            RETURN
593            ENO
594      C
595            SURRTUTINE  H fRC STt I r L AH ,KC YWRO.I S ,KPUNTR , IFRJ
         r      - ~~*~
         597      C       ROUTINE  Tn  ACCEPT INPUT OF  COST  OF CONTROL  OAT A
         598      C   .    I FLAG =  I  IF  COSTS DIFFER RFTWFFN SOURCES
         599      C      -IFR = 'L  IF  MORE  THAV 1 STAGES  OF  COST :)ATA  PFOUESTFO

-------
          600
          601
          602
          603
          60'f
          605
          606
          607
          60fl
          600
          610
          611
          612
          613
          614
          615
          616
          617
          61 R
          619
          620
          6?l
          62?
          623
f           = ? IF INPUT DATA  DOES NOT EXIST
C      KEYWRO = I FOR URP-AN COSTS
C              = 2 FOR RURAL COSTS
                fr****,l<***********iM
      LUGICAl  L INPUT, IODUPB.I  OORNC.l OORCP , L4UAL , I I HI , LI N2 , L I N3 ,L I N4
      I OGlCAt  URNCTL.RULCT L.UCTLUnm , RCT I00t3 I , UPRCNT , UXPf.NT , RPRCNT,
      G         RXPCNT.URBCST.PULCST
       INTEGER SPCE(210,2R1, ARE ACNJ 4 > , UALCONJ 4 I ,0f T VAL t 81
      ni MfNSlON I TYP1210) ,NPOS(210 , AUNIT <213,2!,KriTLE14,4J),
      f.   StJRFf At 210, 31
      INfEGEP Tl FURl (I 2 1 , TL FUR2 I 12  I , APOE ( 2 10 1
      DIMENSION PDIF (2 10, 3) , TCOST(210,3) ,PUC OST ( 2 10 , 3 ) , T RNSMN 12 I 0 >
      COMMON /WTTF/  L lNin ,LOOUR8 , L flDRNC ,LIM t ,L I N2 , LI N3, LI N4 , OTNURB ,
      C                 OTHRUL.LOORCP.TYPCOO, J IN, JOUT , L4U4L , KOUf
              /WTR 10 /  IN, I OUT, NSRCF ,KTI TLF. .NTLF.NURB ,NRUNCP NRUCRP
              /WRKSIH/ SRCE, IT YP, NPOS, APOE, AUN I T, SURFf A , 1LE UR 1 , TLEUR2
              /WRKSH6/ POIF , 1COST , PUCOS T ,TR NS MN
              /WTR CON/ UCTLOO,RC TLOO ,URBC TL ,RU1 C TL , UPRCNf , UXPCNT , RPRCNT,
      f.                 RXPCNT,OPTVAL,MOPT .URBCS T , R'JLCSl, AREAC.NI, UALC3*J
oo
IJD
625
626
627
S2<*
629
630
631
632
633
634
635
636
637
638
630
640
641
642
643
544
645
646
647
64B
649
653
651
652
653
654
655
656
657
650
659
               COMMON
               COMMON
               COMMON
                                                         URBAN
                                                         RURAL
                                                                                  SOURCES')
                                                                                  SOURCES' I
    IFIIS.GT.-JJ RETURN

    IF(KEYWRO.FO.l  .AMD.  MJRB.EQ.O! RETURN
    IF( KEYWRD.FQ.2  .AND.  NRUCRP.E0.3) RETJRN
    IFIKFYWRO.FO.il WR I TF(COUT,5 IS
    IFIKEYWRO.FQ.2) WR ITETOUT,6 ) IS
 5 FORMATI'0' ,5X,'STAGF1 , 12 ,*  COSTS OF CONTROL FOR
 6 FORMAT CO', 5X, -STAGE', I?,1  COSTS OF CONTROL FOR
    IF!IFLAG.EO.lI  GO TO  27
    IFIKEYWRD.FQ.2) GO  TO  20
         HERE FOR URBAN  COSTS  FOR AIL SOURCES
   Ll=LENGTHITLFURl,12)
   L?=LENr,TH< TLEUR?, 121
    rFIOTHURO.EO.O I WRITEHOUT, 10}
    [FIOTHURR.EO. t) WRITE(I OUT,11 I ITLEUR1 GO  TO 51
    IF! IT YP| I ) .fjf .2 .AND.KF YWRO.EO. 2) GO  TO  50
    IF (If L 4G.FO.T) GO II)  35

-------
660
661
662
663
664
665
666
667
66H
669
670
671
672
673
674
675
676
677
f,78
679
680
681
68?
683
684
6fl5
686
687
6ft8
689
690
691
692
693
694
695
696
69?
698
699
700
701
702
703
704
705
706
707
70R
709
710
711
712
713
        C
        C
        C
715
716
71 7
7 IB
719
            3?
            35
            40
            50
 WR ITE< I OUT, 32KSRCFU,J,J=1,2R)
 FORMAT I1X.28AII
 REAmiN.?<5)  PUCOSTM.ISI
GO TO  40
            .EO.?) PUCOSTf I, IS I = COSTO
            .GE . 3.AN3.ITYPJI I.LE.5I  PUCOST1 I,IS) = COST1
            .tO.6) PJCOSTt t, |S = COST?
            .EQ.71 PUCOST(I,IS)=COST3
            .EQ.RI P'JCOST
-------
 720         99 RF. TU"N
>
^
7??      C
7?3            SUHROUT1 NF WT RANK I I S I
725      C.           ROUTINE TO RANK  CONTROL STRATFG1ES BY COST EFFEC f I VFNF SS
7?6      C

728            DIMENSION CPUTMP (540  ,K ERTHP ( 543 )
729            LOGICAL  L INPUT , LODURfl .LOORNC , LODRC P, L4UAI , L I Ml , L I N2 , L  IN3 ,L IN4
730            LGGICAt  URRCTL , RIJICTL ,UCTLOD{ 3) , RCTLOOI 31 , UPRCN T , UXPC N T ,PRCMT ,
731           F.         RXPCNT .URRCST , PHI CST , (.RANK
73?            INTEGER  OTHURa.QTHRUL.SRCF C 210,281 , TYPCO()(9,12 ) ,OPTVAL(8 I
733            DIMENSION ITYP(210I,NPOS(213I, AUN IT( ?iO,2),KT ITLEI 4,40) ,
734           r,   SURFFAJ ?10,3) ,CTLOD(210,3) ,CTUSLE(3,30 ,5 I
73-5            OIMFNS ION STMC TL( 30, 3) , STMARA1 30 , 3) ,COMC IL( 30,3) ,C01AR A ( 30 ,3 J ,
736           6           OT1CTH30, 3 I , OT 1 ARA ( 30, 3 I , QT2CTLI 30,3) ,OT2ARA( 30,31
737            DIMENSION PFLOWI30) , PCONC ( 33 ) ,U ALS (30 ) , J ALC (3D ) , W2U AL  1 ( 30 ) ,
73B           f,          W?UAL?( 301, TRNSHNI Z10)
739            INTFOFR  TLFURK12I ,T IEUR2 { 1 2 I , U ERUl (1 2 I , TL F.RU2 ( 12 I , U ERJ3I I 2 I ,
710           t         APOF( 210),APFACN( 'Vl ,UALCON{',I
741            01 MtNSION GRAS A ( 30 I , U ALOt 30 I, WLNOAC 30 ) ,UALW( 301 ,W30TA  U 30) ,
74?           C           W3UALI (30) .W3UAL2 (30) .W3UAL3 133 ) ,W30T A2(33 I.W30T A3(30
743            REAL  LOORNK 30),LOORN?t 30),LOOlW3l 30! ,LO02H3( 30  ,LOU3W3(30)
744            01 ME NS I ON OSLER<3Q) ,US LEK ( 30  .USLFLS (30 ) , DSL EC< 30),W4UAL (30) ,
745           &           OSLFP( 301, S01LSK30) ,SOILS2(30) ,TTLER(30(, RAT(Q(30I
746            OIMFMSION PD IF ( 2 10 , 3 ), TCOS T( 2 10, 3) , PUCOSTI 2 10 , 3 )
747            OIMFMSION PMOinH(210) ,OIFMIH(213,3I , CPURFM< 2 13 , 3 ), KER AN< t 2 13, 3 )
7'<8            COM^M  /WTRIC/  rN, f OUT, NSRCE , KTt TLF ,NTLE ,NURB .NRUNCP, NRUCRP
749            COMMON  /WTRTF/  L INPUT , LOOURO.LOORNC ,L IN l,L IN2, LIN 3 ,L t N4 .OTHURB,
7r>0           f.                 OTHROL.LOORCP.TYPCOn.JIN, JOUT ,l4UAL,KOUr,LRAN<
751            COMMON  /rfRKSHl/ SRCE, I TYP , NPOS , APOE , AONJ T , SUPFE A.TLEURl , TLEUR2
752            COMMON  /WRKSH?/ PFLOW , PCONC, U ALS ,U ALC , W 2JAL I, ri 2UAL 2
7r>3            COMMON  /WRKSH3/ GRASA ,UALG,WLNnA ,UALW,LODRNl , LOORN2 ,
754           f.                 W30TAI.W3UAL 1, W3UAL 2, W3UAL 3, W30TA2, W30TA3,
755                            TlEfUJt ,ILFRLI2,TLFRU3, 001W3 , L002W3, L003W3
756            COM^IN  /WRKSM4/ US LFR ,USLE K.USLE LS .USLEC ,USL FP , SOILSI  ,
757           f.                 SnrLS2,TTLER,W4UAL,ATrO
75            COMMON  /WRKSH6/ POI f , TCdST .PUCOST .TPNSMN ,PMOU T H, 01 FMT H, CPJREM,
759           f.                 KERAMK
767            COMMON  /WTRCOM/ UCTLOO, RCTLOO, UR8CTL ,RUt Cfl , UPRCNf, UXPCN T , RPRCM T ,
76t           &                 RXPCMT.OPTVAL ,NOPT .URF1CST , RULCSf , APF ACN, UALCOV)
76?            DIMENSION CTL FL W( 30, 3 1 .CTLCNC ( 30 , 3)
763            IH MENSf ON CTtE(JC,3l,SOIlCK33,3l,SORC2(30,3l,CTI ERO(30,3I,
764           G          CUALW4I 30,3)
765            DIM ENS ION TOT C SI ( 3 ) , TOTREM I 3 I ,KNOX ( 540 I , F INC ST( 540) ,F 1 NRFMI 54DI ,
766           r,           rSFIN(543>
767            IMTFGFP  F INSRC ( 540, 4 3)
768            COMMON  /WRKSHO/ T OT CST , TQTRFM , TOTLOO, T3TMTH , KNO X ,F t NSRC ,F I N: ST ,
769           f,                 rrMRFM.I SFIN.NUM
770            COMMON  /UPNCTL/ CTLFLW.C TLCNC , C TtOO , STMC TL , ST MARA ,COMC T L ,
771           r,                COMARA.OTICTI , OT IARA.OT2CTL, OT 2ARA
77?            COMMON  /RFOCTL/ CTUSLF ,TTLr ,SOI LCI ,SOn.C2 ,C.r t FRO, C'JALWi
T73      C,  **** + <^**t** + + + *****+* *
774            DATA  IRLNK.IOSH/'   ,'-/
775            TorLnr>=o.o
776            TOT MT 11=0.0
777            00 5  I =1 ,3
770            TOTCST< I )=">. 0
779          S 10TPEM{ n = T .3

-------
 780            ou  7  i =1,540
 781            CPUTMPJI)=0.0
 782          7 KERTfP(II=0
 783      C
 784            00  13  f=l,NSRCF
 7B5             PMQUTHt I ) =TRMSMNU I * AUNIT d,2
 786             TOTMTM=TOTMTH*PMOUTHd )
 787             TOTLCO=TOTLPO*A'JNIT I I, ?\
 788             iriltYPIII.EQ.l  .OR.  AUNIT(I,2).EO.O.0)  GOTO ID
 789            DO  8  J=l, IS
 790             CfFMTHU, JI = POIFd, J t*rRNSMN( (I
 791             If (DIF'ITHl I , J .EQ.O.O GO  TO 8
 79?             CPURE^I I,J )=TCOSt(I,J)/OIFMTM( I ,JI
 793             rOTCSTJJI =mTCST( J+TC.flST U , J 
 794             TOTRFMI J( = TOTRF M(J)+01FMTH(I ,J)
 795          8 ("ONI INtIF
 796         I ) CfWrNt/F
 797      C
 798            K=T
 799            00  20  J = l ,1S
 800             DO l  J=1,MSRCE
 801             IFdTVPJ D.EO.l  .OR.  AUNITC I, 2) .FO.0.0)  GD  TO 18
 P02             K=Kl
 803            CPUTMP< K) = CPURF1( I, J 
 804            KNOXJKI=K
 P05            PI MREM(KJ=OirMTH([,J)
 806            FINCST(K=TCOST( I,J )
 807            ISFIN  IE=IE-l
 817            IFILl.rO.6)  1F=5
 818            OH  12  I 2 = I. IE
 819         12 Fl NSRCIK.I2)=TYPCOD(L1,12 * II)
 820            FINSRCIK, IF*1)=IBLNK
 821            FINSRCIK,IE*21=IOSH
 822            F!f^SRC( K , IF + 3) =IOLNK
 823            !.? = ?
 824            IB=1E*4
 825            CL=in*?7
 826             13=1
 827             1FUI.FQ.6)  13 = 1-1
8>R             IHLl.FO.7l  13=1-2
 829             IFtLl.FO.8)  13=1-3
 830             IFdl.FO.9l  13 = 1-4
831            00   14  I?= IB, IE
 83?            1.2 = 12*1
833         14 fINSRCIK , 12) = SRCF( I3.L2I
834      C
 835         13 CONTINUE
836         ?"> f.ONTtMMF
837      C           RA"'K USING SHFd
 838            H;AP=K/?
839         2? IfjIGAP .LF.  01 GO TO

-------
   840             IIGAP=|GAPH
   841             00  33 I=I1GAP,K
   84?              J= I  - IGAP
   843         25   1F( J .Lf. 01 GO  TO  30
   844              JG=J  IGAP
   845              IFICPUTMP(J) .LE. CPUTMPtJCU GO  TO  20
   846      f.           EXCHANGE PLACES  IN TEMPORARY  DATA ARRAY
   847              AK=CPUTMP(J)
   B43              C.PUTMP(J ) = CPUTMP(JG)
   849              CPUTMPt JGI =AK
   fl50      C           EXCHANGE PLACFS  OF INDFXFS
   8"H              fK=KNOX(J(
   O'i?              KNOX J =KM()X< JG)
   853              KNOX(JG)=!K
   854         28   J=J  - IGAP
   B55              GO  TO 2*>
   856         30  CONTINUF
   857             IGAP=IGAP/2
   858             GO  TH ?2
   859         38  C.ONT IHdf
   860      C           OHNE WITH SORT
   061             0(1  40 1 = 1 ,K
   862              M=KNOX(I|
   863              KF.RTMP(M> = I
   864         40  CONTINUE
   865             K2=0
   866             00  63 J = l ,(S
   867             00  50 I = l,MSPCF.
   P68             IF(ITYIM I I.FO.l  .OR.  AUN IT( I.2> . EO .3 .3 ) GO TO  50
   869             K2=K2*1
   H70             KERANKI I,J (=KFRTMP(K2)
   871         50  CONTINUE
   872         60  CONTINUF
   P73             LRANK=.TRUF.
   874             NUM=K
   875             RFTU1M
   876             f-NO
FND OF fILE

-------
Data Files

         The  example   data  file  listings  that  follow  were  generated  from
terminal  sessions similar to that included  in  this  manual.   It is important to
note that  the data file  structure  can  change for  some parameters  depending
upon the commands  and  key words utilized in a particular run.   The  data files
are compatible with the NETWORK program.
                                         94

-------
UD
en
  32     0     0    3
SANDUSKY RI Vff>

 LAKE  FRIE
LOSS CPEEK
        11.8303
LOSS CREfK
       125.0000
BUCYRJS  CITY
         2.5100
               STORM
       250.0000
              COMBINED
       900.0000
BROKEN SWORO
         3.5900
BROKEN SWORO
       125.0000
UPPF*  SAMOUSKY RfVFR
        12.8103
UPPER  SANOUSKY RIVFR
       130.0000
UPPFR  SANOUSKY CITY
         1.5000
               ST3RM
         0 .0
              C OMB INE 0
       250.0COO
TYMOCHTEE CREFK
         9.0400
TYMOCHTEP CKF.EK
       13B.OOOO
MIOOLE  SANOUSKY
        17.2700
MIDDLE  SANDUSKY
       138.0300
HONFV  CREEK
         3.1730
HONEY  CREEK
       125.0000
TIFFIN  ClTY
         3.2000
               STORM
       250.0000
              COMTINFO
     IOOO.OTOO
W3LF CRFEK
         7 .5733
WOLF CREEK
       125.0000
ROCK CREEK
        12. 1400
ROCK CREFK
       125.OTTO
FREMONT  CITY
         5 .1030
               STORM
       250.0^00
              CO 'W I NED
t A
10.0003
2A
0.3500
3A
'..0000
6 A
7A
in
10.0000
2fl
3,3810
1 f)
ir .0000
2U
0.1200
3B
A .0000
63
7fl
1C
25.0030
2C
0.3200
1C
IP. 0000
2C
0. 3803
10
10.0000
20
0.3500
30
4 .0000
60
70
IF
1C. 0000
2F
0.2900
IE
10.0000
2(
0.34">0
3T
A. 0000
6E
7F
36 .8700
?5. 0400
Ifl9. 8400
0.4020
13500. 0000

1.3000
7.2000
21.7600
18.1700
187. 1900
0.4240
47.1933
34.3800
274.6001
0.4260
6250.0000

0.0
8.700J3
56.1700
47.1333
528, 3999
0. 3570
85. 2300
67.9600
54?. 3601
0.3810
4 7 . 24 00
44 .0700
343. 5500
0. 3380
26300.0033

7.0000
10. 4000
30.4633
22. 1900
343.1101
0.2560
68.6100
56.4700
409. 8999
0.4? 70
19733. 030T

1.4000
I?. "5000
368.6997
10. 0000
lfl.0678
0.2333
13820. 0000

325 .0000
6479.9961
21 7.6000
10.3030
20.4012
0.2330
471 .8999
10. COOO
36.3436
0.2453
S292.0000

0.0
2174 .9998
697. 299R
10.0300
54.17?3
0.2800
852 .2998
10.0000
6S.4346
0.2633
47^.3999
10.0000
27.9635
0. 2370
1 7689.5977

1750. 0000
1 0399. 9961
334.5999
10. 0000
17.5262
0.2373
686. 0999
10.0300
43 .9451
0.2370
28192.7891

349.9990
12300, 000"

0.0 3.0

1.3333 0.00010355





0.0 0.0

I. 0000 0.03010355

0.0 3.0

1.3330 0.00010355





0.0 0.0

I. 0000 0.00010355

0.0 0.0

1.3333 0.00010355

0.0 0.0

I. 03^0 0.00010355





0.0 3.3

1.3333 0.03310355

0.0 0.0

1.0330 0.03010355




                                                                                                             0.0
                                                                                                             0.0
                                                                                                             0.0
                                                                                                             0.0
                                                                                                             0.3
                                                                                                             0. 0
                                                                                                             3.3
                                                                                                              0.0
                                                                                                                             0.0
                                                                                                                             0.0
                                                                                                                             3.0
                                                                                                                             0.0
                                                                                                                             0.0
                                                                                                                             0.0
                                                                                                                             0.0
                                                                                                                             0.0
                                                                                                                                             0.0
                                                                                                                                             0.0
                                                                                                                                             0.0
                                                                                                                                             0.3
                                                                                                                                             0.0
                                                                                                                                             0.0
0.0
                                                                                                                                             0.3

-------
1000. OOCO
LOWER SANOUSKY
10.0000
LOWFR SANDUSKY
125.0000
LOWFR SANOUSKY
8.2500
LOWER SANDUSKY
125.00CO
I 1 I
8374.2578
125.0003
3455.0000
2 .5000
243. 7500
1.5303
6091. 1992
3.2000
8667. 714
125. 0000
15278. 1523
130.0000
2073.0000
5. 1000
0.0
0.0
2044.499B
0.0
20893.4922
138.0003
27682.0977
138 .C300
11916.1523
125.0000
4422. 3184
0.0
1312. WOO
0.0
9775.9961
0.0
7986. 1?50
125.0000
IB139.1602
125. 0000
7048.199?
0.0
262.4998
0.3
11562. 0000
0.0
10760 .2227
125.0033
3492.3647
125.0300
2635. 706P
125 .0000
I 727.5000
2.5000
H2 .9 125

(SOIL 11 IF
25.0000
( SOIL 1  2F
0.3200
(SOIL 21 IF
10.0000
(SOIL 2 2F
0.2800
1

0.3*03

I .0000

I .0000

1 .0000

C. 3800

0.4200

I. 0000

0.0

0.0

3 .3230

0.3POO

0.3500

0.0

0.0

c.o

0. 2903

0.3400

? .0

0.0

C. 0

0.3200

0.2803

0.35CO

0. 5000
 *

14. 5430
74.5400
243.5530
0.4100
8.2500
0.0
100.0000
0.4340


0.4020

1.3000

0.0

7.0000

0.4240

0.4260

1.4000

0.0

0.3

0.3570

0. 3810

0. 3380

0.0

0.0

0.0

0.2560

0.4270

0.0

4o. o

0.0

0.4103

0.4340

0. 4020

I .1000


"95.3999
1C. 0000
24 .8614
0. 2680
82. 5000
10.0030
8. 3611
0 .2370


0.1080

187.5000

-0. 0

187.5000

0.0993

0. 1033

187. 5000

0.3

0.0

0. 1080

0. 1 1 00

0.1010

0.0

0.0

0.0

0. 1383

C. 1350

0.0

0. 0

3.0

0. 1160

0. 0990

0. 0340

140. 6253



0. 0

I. 0000

3.0

I. 0000


1 .3033

7. 2000

8. 7000

10.4000

1.3030

I. 0000

12.3000

0.0

0.0

I. 0000

1.0000

1.0330

0.0

0.0

0.0

1. 0000

1.0000

0. 0

0.0

3.3

1.0300

1. 0000

1.0000

7.2303



0. 0

0.03310355

0.0

0.00010355


1.8994

846. 0030

235.0030

940.0000

1.9939

2. 3957

940.0000

0.0

0.0

I. 7026

2.1978

1.4935

0.0

0.0

0.0

1.0022

1,9055

0.0

3 .0

0.0

I. 9024

I. 5038

T.59B3

634.5003



0.0



0.0




4.2605

0.0

0.0

0.0

4. 4722

5.3736

0.0

0.0

0.0

3 .8190

4.9296

3. 3500

0. 0

0.0

3.0

2.2480

4.2740

0.0

3.3

0.0

4. 2671

3.3730

1.3413

0.0



3.3



0.0




83880.5625

3.3

0.0

O.'O

83715.4375

147559.9375

0.0

0.0

0.0

231795.9375

267360. 1875

1 15089.2500

0.0

0.0

0.0

77 131.8125

175191.3125

3.3

0.0

0.0

1 03924.6875

33730.4180

25462.3984

0.0
,


0.0



0.0




1.00

0.0

0.0

0.0

1. 00

1.00

0.0

0.0

0.0

1.00

1.00

1.00

0.0

0.0

0. 0

1.00

1 .00

0.0

0. 0

0.0

I. 00

1.00

I. 00

0.0


-------

I .5300
4568. 3984
3.2000
3063. 6R63
125.0000
5042.1523
130.0003
1036.5000
5.1000
0.0
0.0
1533.3748
0.0
6188.9102
138.0000
8805. 0438
138 .0000
4010.4980
125.0000
2211 .1990
0.0
984.3750
0.0
7331.9061
0 .0
2365.6472
125.0000
5699.574?
ua 125.0000
"- 3524.1001
0.0
196. 8749
0.0
8671.5000
0.0
3338 .5676
125.0000
1163.8401
125.0000
$$$$
4? 470999.
234369.93 75
1.0000
0.0
0.0
I .0000
9693. 5195
5 738.5508
I .0000
10365.0003
1727.5000
I. 0000
81.2500
60.9375
1.0000
388.7960
1522 .0038
m i. oooo
0 .0
0.0
t
0.5000

0 . 50OO

0. 3803

0.4200

0.5000

0. 0

0.0

0.3200

0.3800

0. 3500

0.0

0 .9

0.0

0.2900

0.3400

0.0

0.0

0.0

0.3200

0.2803

3625 4?0999.
137197.4375
368.6997
0.0
0.0
IPT67 .7773
65.00CO
300C.0300
13420.0003
?. 4000
3.6CDO
325.0000
7400.0030
H690.0000
6479.9977
569519.9^75

32399.9922
48600.0039

962 C. 0000
11 180.0000

5T79. 0061
I 77339.9375

0.0
C.T

-0.0

140. 6250

0.3350

0.0340

140.6250

0.0

0.0

0.0320

0. 0350

0.0340

0.0

0.0

0. 0

0.0320

0.0330

0.0

0. 0

0.0

0.0360

0.0330


10760062. OCOO

0. 0
0.0

9693. 5135
5738. 5508

10365.0333
1727. 5COO

fll. 2530
60. 9375

388. 7969
152?.8CO

0. 0
0.0

8. 7000

10.4000

I. 0000

1.0000

12. 3030

0.0

0.0

1.0000

I. 0000

1 .0000

0.0

0. 0

0.0

1 .3000

1.0000

0.0

0.0

0.0

1.0000

I. 0000




0.0
0.0

1.2730
99.7 w;>

3.1259
78. 1331

1 18. ',000
183.4666

137.0311
I 16. 7848

0.0
0.3

176. 2500

735.3333

0. 7049

0. 7 90S

705.0000

0.0

0.0

0. 5045

0.6993

0.502B

0.0

0.0

0.0

0.2970

0.5989

0.0

0.0

0.0

0. 5904

0. 5013




3
3

7
23

13
17

31
3fl

36
?<1

0
a

0.0

0.0

1.5811

1 .7738

0.0

0.0

0.0

1.1316

I .5685

1.1277

0.0

0.0

3.3

0.6661

1. 3433

0.0

3.0

0.0

1.3243

I .1243






















3.3

0,0

29596. 3867

8709. I32fl

0.0

0.0

0.0

59791.3789

85069. 1250

38742. 9492

0.0

3.3

0.0

22853. 9023

55060.1250

0.0

0.0

0.0

32252.4844

ll?43.4648






















0.0

0.0

t.OO

I. 00

0.0

0.0

0.0

1.00

I. 00

1.00

0.0

0.0

0. 0

I. 00

1.00

0.0

0.0

0.0

1.00

1.00






















-------
1. 0000
11 733.4680
5604.0273
1 .0300
0.0
0.0
I .0000
21065. 4297
10236.0000
I. 0000
6219.0000
1036.5300
I. 0000
0.0
0.3
I. 0000
130.5000
511.1253
1.0000
0.0
0.0
1.0000
33278.7930
14704.5820
I .0000
0.0
0.0
1.3030
to 37752.4844
00 18876.2539
1 .0000
0. 0
0.0
I .0000
16047.3320
7905.6523
I. 0000
13267.1992
2211.1995
i. oooo
437.5000
328.1250
1.0000
624.3303
2444.0000
I. 0000
0.0
0.0
l.OQOO
9540.0506
5620.4766
I. 0000
0.0
0.0
I .3303
22805.9219
12439.5859
I .0000
21144.5898
3524.0191
?0401. 1836
6'i .0300
3900. 0000
471.8999
0.0
0.0
36343. 5B 20
65. 0000
3000. OOOC
8292.0300
2.4000
3.6000
0.0
7400.0000
8600.0000
2174.9998
7400.0000
24700.0000
697. 2998
0.0
0.0
54172.2852
65 .0000
3300. 0000
852.2998
3.0
0.0
65434.5820
65.0003
3300.0000
472.3999
0.0
0.0
27963.4844
65.0000
3000.0000
17689.5977
2.4000
3 .6000
1750.0003
7 '.00. 0000
8600.3330
1C399. 9961
7400. OOOO
24700.0000
304. 5999
3 .3
C.O
17526. 1836
65.0000
300C. 3000
686.0999
0.0
0.3
40945 .0870
65.0330
?OOC.OOOO
28192 .7891
2. 4D03
'.,6000

12167.3477
561570. 0000

0.0
0.0

17849.3339
823800. ?500

14999.9961
22500.0000

0.3
0.3

64379.9961
214889.9375

0.0
0.0

34345.9922
1585199.0000

0.0
0.0

35253.4063
1627080.0000

0.3
0.0

22330. 7500
1030650.1250

62399.9883
93600.0300

5100. 0000
602^0.3000

76959.9375
256979 .9375

O.i
0.3

22332.1563
1029330.3125

3.3
0. 0

26643. '.9? 2
1229699. 0000

47351.9922
71028.0000

11733.4688
5604.0273

0.0
0.0

21065.4237
10236.0000

6219.0000
1036. 5010

0.3
0.0

130.5000
51 I. 1250

0. 0
3.0

33278. 7930
14704.5820

0.0
3.0

37752.4844
18876.2539

0.0
0. 0

16047.3320
7905.6523

13267. 19Q?
2211. 1995

437.5000
328.1250

624. 0000
2444.3330

0.0
0.0

9540.0586
5623.4766

0.0
0.3

22135. 9219
12439. 5859

21144.5898.
3524.0991

1.0370
133.2383

0.0
0.0

3 .8473
80.4807

2.4120
21. 7077

0.0
0.0

493.3333
420.4253

0.0
0.0

1.0321
107.8331

0.0
3.3

0.9338
86 .1972

3.0
0.0

1 .3916
130.3688

4.7033
42. 3300

118.4000
183. 4667

123. 3332
105.1064

0.0
3 .0

2.3377
183.1393

0.0
0.0

1 .1613
98.H537

2.2394
20. 1549

4
24

0
3

1
17

12
16

3
0

42
41

0
0

3
27

0
0

2
20

0
3

9
35

I't
ia

33
39

32
25

0
0

11
37

0
3

5
22

10
15

-------
1. 0000 349.9998
87.5000 7400.0000 10*59. 9961
65.6248 8600.3300 12039.9961
1. 0000 12300.0000
733.0300 7400.0000 91020.0000
2890.5010 24700.0000 303810.0000
1.0000 995.3999
0.0 0.0 0.0
0.0 0.0 3.3
1. 0000 24861.3867
14101.1641 65.0000 15830.7500
7421.6523 3000.0000 730650.0000
1.0000 82.5000
0.0 0.0 0.0
0.0 0.0 0.0
1.3300 8361.0938
4B68.72f.fi 65.0000 6500.3000
2378.5247 3000.0000 300000.0000
CROPLAND - LOSS CRFFK
MUNICIPAL - BUCYRUS CITY
STORM - BUCYRUS C II Y
COMBINED - BUCYRUS CITY
CROPLAND - BROKEN SWORD
CROPLAND - JPPER SANDUSKY RIVER
MUNICIPAL - UPPER SAMDUSKY CITY
COMBINED - UPPEP SANDUSKY CITY
CROPLAND - TYMOCHTEE CRFFK
CROPLAND - MIDDIF SANntJSKY
CROPLAND - HONEY CREEK
MUNICIPAL - TIFFIN CITY
STORM - T IFF IN CITY
COMBINED - TIFFIN CITY
CROPLAND - WOLF CREEK
CROPLAND - ROCK CPCEK
MUNICIPAL - FREMONT CITY
STORH - FJFMONT C 1 TY
COMBINFD - FREMONT CITY
CROPLAND - LOWER SANOUSKY (SOIL I)
CROPLAND - I OWFR SANOUSKY (SOIL 2)
CROPLAND - LOSS CREEK
MUNICIPAL - BUCYRUS CITY
STORM - BUCYRUS C ITY
COMBINED - BUCYPUS CITY
CROPLAND - BROKEN SWORO
CROPLAND - UPPER SIWO'JSKY RIVER
MUNICIPAL - UPPFR SANOUSKY CITY
COMBINED - UPPFR SANDUSKY CITY
CROPLAND - TYMOCHTEE CREEK
CROPLAND - MIDDLE SANDUSKY
CROPLAND - HONEY CREEK
MUNICIPAL - TIFFIN CITY
STORM - TIFF IN CITY
COMBINFD - T IFF IN C 11 Y
CROPLAND - WOLF C"EFK
CROPLAND - POCK CREEK
MUNICIPAL - FPFMTMJ CITY
STORM - FPF?OMr CI TY
COMBINED - FPFMONI CITY
CROPLAND - LOWER SAMDUSKY (SOU l
CROPLANO - LOWfP SANOUSKY (SOIL 21


87.5000
65.6248


738. 0000
2B90.5000





0.0
0.0

14101. 164 I
7421.6523





0.0
0.3

4868.7266
2328.5247
6
13
9
5
20
16
1
21
11
17
15
7
2
12
38
28
23
33
27
31
41
I 9693.
10365.
81.
3Rfl.
11733.
21065.
6219.
130.
33278.
37752 .
16047.
13267.
437.
624.
9540.
22805.
21144.
97.
738.
14 10 I.
4868 .
37 7 573B.
22 2 1727.
26 2 60.
35 2 1522.
40 2 5604.
30 2 10256.
25 2 1036.
18 2 511 .
13 2 14704.
3 2 18876.
14 2 7905.
19 2 2211.
42 2 323.
M 2 2444.
4 2 5620.
36 ? 12439.
24 2 35?4.
34 2 65.
39 2 2890.
29 2 7421.
U I 2t?6.

118.
183.

123.
105.

0.
3.

I.
98 .

0.
0.

I .
128.
5195
0333
2500
7969
4688
4297
0003
5000
7930
4844
3320
1992
5330
0000
0586
9219
5898
5333
0000
1641
7266
5508
5003
9375
8008
0273
0000
5000
1250
5820
2539
6523
1995
1253
0000 '
47f>6
5859
0991
6 248
5000
6523
524 7

3999 29
4671 40

3333 33
1064 26

0 0
0 0

1227 5
4484 21

0 0
0 3

3351 8
8359 34
12339. 5977
32399.9922
9620.00^0
532 79. 9961
12157.3477
17849. 0039
14999.9961
64379.9961
34345. 9922
35253.4063
22330.7500
62399.9883
51800.0333
76959. 9375
22302. 1563
26643.4922
47351. 9922
10359.9961
91020.0000
15B30. 7500
5500.0000
569519. 9375
48600.3039
11 lflO.0030
177839. 9375
561570.0000
823B00.2500
22500.0000
? 14 IB 9. 9 37 5
1585199. 0000
1627080.3000
1033650. 1250
93600.0000
63200.0000
256879.9375
1029330.3125
l??9699.0000
71 028. 0000
12039.9961
303810.0333
730650. 0000
303000.0030

-------
SECTION 2 - NETWORK PROGRAM

Commands

         Table  2  includes  a list  of the  commands  utilized  by  the  program
NETWORK.   This  program  simply reads in stored data from Worksheet 7  for  up  to
7  river basins,  performs  the  cost  effectiveness  ranking,  and  outputs  one
master  Worksheet  8.   This program  is  designed  to support the network  concept
discussed in Chapter 4 of the Handbook.

                                    TABLE  2

                       Legal  Commands for  NETWORK Program

         NAME(n) basin name

                 Allows for the input of basin names, "n"  is the  basin  number,
                 a  positive  non-zero integer  less  than  or   equal   to  7.
                 "basin  name"  is  a  maximum  20  character  label  for  the
                 sub-basin.

         READ ip i2...,i7

                 Causes the input of  sub-basin  data,   "i" is the  input  device
                 number  of  a WATERSHED  data file.   Multiple device numbers,
                 separated by commas are accepted.

         RANK(m)

                 Causes  the  ranking and output  of  the  basin pollutant  loads.
                 "m"  is   any  optional  positive,  non-zero output  file  number
                 operating just like the WORKSHEET(m) command of  WATERSHED.

         STOP

             Terminates the program.

         Sample Terminal Session

         In  this  session the computer  prompts  are marked by  a  triangle.   It
 should  be  noted that  the  READ  command is  used  to designate the  file  numbers
 that  contain the results from the main  WATERSHED  program for the  various river
 basins  in  the  network.   There must be a unique  NAME  command for  each for file
 number  that  follows the READ command.
                                         101

-------
   f?UN  3ASIN  3=-WATES.0N 9sWATER.DAT 3=-TEMPFIL
[> ^EXECUTION  BEGINS
             WATERSHED MULTIPLE BASINS PROGRAM
j>  ENTER  COMMAND
   NAME! USANOUSKY ONE STAGE
 0  ENTER  COMMAND
   NAME(2)SANDUSKY TWO STAGE
 j> SNTSR  COMMAND
   READ 3,9
 [> ENTER COMMAND
   f?ANK (3)
 t> ENTER COMMAND
   STOP
 i>#eXECUTtON TERMINATED
                                    13Z

-------
Computer Flow Chart and Listings

         Figure  3  contains  a  flow  chart   from  the  NETWORK  program  which
includes the commands  and  subroutine names.   The  following program listing is
documented to  describe the workings  of  the  various  sections of  the program.
The command  sections   and  subrouting are  underlined  and  marked by a bracket.
This entire program is in one source file called NTWRK.
                                         103

-------
Figure
Network Program Flow Chart
                                  Start
                                                                        Key
                                    J^'
                                                                   (SUBROUTINE ^
COMMAND
                                 Initial-
                               ( ization
                                \  WIMIT
                                          NAME

1 Read in /
/Network I READ
/Data A
/ 8SMLVP /

Command Interpreter
I.SRCtf LENGTH
LWEX MB LAWK
N,
x STOP
RANK x
s.
/
/
/ Output /
/ Network /
/ Worksheets
/ Rcmn/nr /

Rank Program
in Network
BS.S/RMK

                                  Stop

-------
                                 NETWORK PROGRAM
o
en
I
2
3
4
5
6
7
fl
9
n
11
12
13
14
1 5
16
17
18
19
20
21
22
23
24
25
26
27
28
29
33
31
32
33
34
35
36
37
3B
39
40
41
42
43
44
45
46
47
4B
49
50
51
52
53
55
56
57
58
59
C
C
r,
C
f
c
c









c


c







c




c


c
c
c
c
c
c
c

c
c
c











-**-**.* i-'J-ViV J. XW^t^l J.W. ii J.
MAn PROGRAM FOP MULTIPLF WATFRSHEP BASINS
PROGRAM ACCEPTS BASIN NAMES, REAOS INPUT OATA FROM
A WATERSHED DATA F 1 LF AND OUTPUTS RANKER COST-
EFFECTIVENESS RATIOS AMONG ALL BASINS

i^t***^********^^,!,********^****^^*^^***************** *********<******
OI1FNSI3N AUNITI 7, 210) . TRN SIN I 7, 210) .PMOUTHt 7,? 10) iTCOST (7,210,3),
f. OIFMTM(7,2n,3),CPURMI 7, ? 10, 3 1 , F INRFM( 3783) ,F INCSTI 37801
INTEGER SfiCE< 7,210,201 ,1 TYP(7,ZIO) , 1ST AGF*t***+**4A*********t*<
IMTE3FP CMD( 30) , SINK , NMBR ( 91 .LPAREN, RPAREN.COMA
OAT A NMB/ 'l','2','3,'4','5',"6'f7','B',>9'/

NO ASM = 0
KOUNTR = I
CALL wm T
WRITE (lOJl,?)
' FORMA! (- ,IOX ,'WATC-PSHEO MULTIPLF BASINS PROGRAM1)
10 DO 12 1=1,30
12 CMOU)=BLNK
READ COMMANO LINE
WP ITFI ITUT, 15)
15 rORMATJ '-ENTER COMMAND')
RE AD (IN, 16) (CHOC I) ,1=1 ,301
16 TORMATI 30AI)
FIND COMMANO NJMOER, t ENGTH OF COMMANO, POS I T IOM OF 1ST BLAMK 5
NUMCMO = I SRCHICMO.LEN.IPOS)
IFINUMfMO .IE. 0) GO TO BOO

MIMCMO COMMAND
I NAME
2 RANK
3 READ
4 STOP

CO TOt 100,200, 300, 900) .NUMCMO

NAME COMMAND

IOC 1 POS1=I NDEX (CMO, LPAREN, 3 )
IFI IPOSI .EO. -I ) GO TC BIO
IPOSl=IPOSV  1
IPOSI =WLANKCMO , i POSI I
IFI1PO.S1 .FO. -1) GO TO RIO
00 115 J = I , 7
IF(CMO( IPOSI) .FO. MMRR(J)) GO TO 110
105 CONTINUE
GO 10 P10
I in IP IS 1= INOFXIC M'l.npARFN, 1 POSH
IF ( I 'MIM ,tO. -1) GO TO f)10

-------
 60             IBEG=IPOSI  + 1
 61             IFND= IBFG  * 19
 6?             K = 0
 63             on 115 J=IBEG,IFND
 64              K = K * I
 65         115  MAMBSN(M,K) =CM[)( Jl
 66             00 TO 10
 67      C
 60      C           RANK  COMMAND
 69      C                      ~~~~~
 fO         ?00  IOCHML =  IOUT
 71             POS1=INOEX(CMO,LPARFN,3I
 11             in IPOSI  .FQ.  -1)  GO  TO 220
 73             IPOSI=|POS1   I
 74             IPOSl=NBLANK(CMD,lPOSH
 75             ITUPOSl  .FQ.  -II  GO  TO 010
 76             HO 205 J=l,i
 77             IOCHNL =  J
 70              IF (CUT (IPOS 1)   .F.O. NMRRUI) GO  TO 213
 79         205  CONT IN.IF.
 80             GO TO 810
 81         210  IPTS1= INOf X(CMD,RPARFN,l POSH
 R2             IFUPOS1  .EQ.  -II  G3  TO 810
 83         220  CALL BSNRNK(NBASN)
 04             CALL BSNOUTt IOCHNL .NRASN)
 85             00 TO  10
 86      C
 87      C           3FAI) COMMAND
 88      C
 89         3CO  IMIF.N  .LF. IPOS)  GO  Tn 820
 90             |POS 1 = NQLANK(CMO , IPOSI
 91         302  DO 335 J=l,9
 92             IOCHNL  =  J
 93               IF(C"in( 1POS1I  .P.O. NMBRtJIl GO  TO 310
 94         315  CONTINUE
 95             GO TO  BIO
 96         310  NPASM   NBASN  ^ I
 97              IFIMBASN  .GL  71  GO TO 830
 98             CALL BSNINP1IOCHNL,NBASN,KOUNTRI
 99              IPOSl  =  IPOSI  * I
100             IF1LFN .LE. IPOSII GO TO 10
101             |pnSl=NBLAMK(CMr) ,IPOSU
10?              irtCMOIIPOSIJ  -NE. COMA) GO  TO  810
103            I POSl  =  IPOSI   * 1

135              IF(IPOS I  .EQ. -II  G1  TO 810
106            00  TO  302
107      C
100       C           EPRORS
109      C
110        flOO WP ITEt IOUT.00'1
HI         ft-l?  FORMAT ('0 IL I FGAL  COMMAND1 I
H2            GO  TO  10
113         tUQ UP IT F( inUT, (112 I
U4        812 M.1HMAT COIIJ FGAL  COMMAND AP GIJMFNT ')
115            00  10  10
IH,        820 WRITFI IPJT, n?;  I
H7        n??  ropMATC OMISSING FltF NOMOfR FflK INPUT OAT A' I
HO            (id  If)  10
                >)& ITK ft)OT, R3?  )

-------
120
121
12?
123
i ?'*
125
126
127
128
129
110
131
132
133
134
135
136
137
139
139
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
I 58
159
160
161
162
163
154
165
166
167
168
16,9
170
171
172
173
1 74
175
176
177
I 7 9
179
832 rORMATt 'OFRROR - MAXIMUM  IS 7 BASINS' I
    GO TO  10

          THF  CNO

900 CONTINUE
    S10P  L
    END

    f-UNC T13M  1 StCIM C Ml) ,LF N, IPO SI

     vTRiHn ruin ION TO  OEICRMINF. COMMAND  NJMOFR, LENGTH OF
          AMI  POSITION  OF  Ff*ST SPACE FOl LOWING THF COMMAND

    INTEGER CMO (30) ,COMAND(4 ,31 ,BLNK
    DATA  C01AMD
   K  / 'N1 ,'R' , P , 'S',
       'A' ,'A' ,'E' ,'T' ,
   C    'M', N ', 'A ', 0/
    DATA  flLNK/'  /
    ISRCM=0
    1)0  10  1=1,4
     K=I
     00  5 ,1= 1, 3
     IF ,nt-NK
    DATA  BLNK/1   /
    K = NU
    DO  13 1 = 1, N
      K=K-l
      IF(Cin( K) .NF.BLNK1  GO  TC 15
    CONTINUE
    LENGTH=-l
            15 I t NGTH=K
               RETURN
               CNO

               FUNCTION I NOF X
                        , T SI VAL , IOFG )
      FUNCTION TH  LOfATF  TSTVAL IN CMO BEGINNING  SFAPCH AT  IBFG

     IMTF3FF C MO (3P  , TS T V At

-------
1HO
181
182
183
18'.
ins
186
187
ins
180
190
\ 191
' 192
193
19*
195
196
197
19ft
199
200
201
20?
201
20*
205
206
207
H-- K 208
0 > 209
00 7 210
21 I
212
213
'I*
215
216
217
218
219
223
221
222
223
224
225
226
2?7
2?fl
229
230
231
21?
213
23 .EQ.GLNK) GO TO 13
MBLAVK= I
RETURN
C
15 N(5I.ANK = - 1
PFTU"^N
FMO
C
S'JBPOUT INF WINIT
C
f, RO'JTINF. TO INITIAL! If ALL ARRAVS AND VARIABLES IN COMMON
C
f ********#****t* ************ **(,** (< t***********************,***********
DIMENS ION AUN IT ( 7, 21 0) , TRN SMN( I, 210) ,P MOUTH I 7 , 2 1 0) , TCOST ( T, 2 1 0 t3 I ,
r, OIFMTH<7,2l3,3,CPUREM(7,2lO,3,FrMEM( 3 760) , F 1 VCS T 3 7801
INTFGEP SRCFI 7 , 2 t 0 ,28) , I TYP( 1 , 21 01 ,1 STAGE! 71 , KE RANK ( 7, 210, 3),
r. FINSC(3780, ^i), ISFIW 37 BO) ,KNDX( 3780) ,NAMBSN( 7,201 ,
t KTRANM7 ,210 ,3) .NSRCFJ7) , BAS IN(37fi3,231
COMMON /WT^IO/ INtlOUT
rri^MON /WTRINP/ AUMIT.TRNSMN, PMOUTH, TCOST, 01 FMTH.CPUREM ,NSRCE
COMMON /WTRIN2/ SRCF , I TYP , 1 ST AGE t KER ANK, NAMBS N, (US IN
COMMON /W TROUT/ FIMRFM.F INCST.F INSRC ,1 SF I M, KND X .KTRANK , BSNTL, NUM
p *************.**************+***************** + ***<:******************
INTEGER ONF( 3) ,TWO( 3) .THRFF (5) , FOUR I'll ,riVECi),SIX(3),SEVEN(5),nLMK
DATA OMF, TWO, THREE, FOUR, F ! VF, S i X, SEVEN, IUNK
r. /() ,'N1 ,'F ' ,' T1 ,'W ,' 0' , T ,'H' , 'P1 ,  E' ,  E' , " f  , 'O' , 'U ' , 'ft ', 'F ',
C
IN=5
oin = ^
00 17 1=1,7
DO 5 .) = t , 2 T
5 NAMRSN ( 1, J )=RLNK
10 rONTINUF
1)0 151 = 3,7
J= I-?
IF (J .GT. 3) GO TO 12
NAMOSN( 1, I ) = ONF( J)
, NAMfWt?, I l=TWll(J )

-------
240             NAMBSM(6,I ) =SI X(J)
241         12  IF(J  .GT .  4) GO TO  14
?42             NAMBSNI4 . I ) =FOl)R( J(
243             N.
2flfi                    OIFMTHU, 21?, 3),CPUREMI 7, 210, 3|,F|NEM 3780) ,FINCSTJ3780)
287            INTE5FP  SRf F( 7 ,2 10 ,2 8 ) , ITY P( 7 , 2 I Ol , I SI AGE( 7 I, KERANM 7,210,3),
288           f.         F INSRCt 3/80, 43), ISFIMI 37801 ,KNOX( 3780) .NAMUSNI7 ,201 ,
289           f.         K7PANKJ7,210, 3),NSRCEI7), BAS H 3780,20)
290            COMMON  /WTPIO/  IN,I OUT
291            COMMON  /W1RINP/ AU"J IT , TRNS^N, PMOUTH , ICOST ,01 F MTH ,C PUREM, NS HCE
292            COHMOM  /WTRIM2/ SRCF,JTyo, 1ST AGE,KFRANK,NAMftSN,HAS IN
293            COMMON!  /WTROU1/ F I NRF M,f I NC ST ,f I NSPC , I S F I N, KNOX , KT RANK, USNTL , NUM
27^      C  **********************************************************************
295            D!Mf NSI ON C PUTMP (37f0 ) , KFRTMP ( 3780 )
296      C
297            00 5  1=1,3780
29R             CPUTMPII)=0.0
299          5  KFRTMPl J ) = 0

-------
300            K = 0
301            OT 43 I = l.NHASN
30?              IS = 1ST AGfcU I
303             NS=NSPCE(LI
304             00 30  J = l, IS
305              OH ?_"!  I = 1,NS
306               K(I TYPJUIKFO.I  .OR.  AUN1T(L, 1 I .EQ.3.3  GO TO  23
307               K=Kll
308               Cf'U1MP(K) = CPURCM(L, I, J >
309               00  10  I 1=1,20
310         10    PAS1NIK. m-NAMPSNU , 111
311         23   CONTINUE
312         30  CONTINUE
313         40 rONTINJE
314      f,           ANK  USING SHELL  SITU
315            JGAP=K/2
316         50 IFdGAP  .LF.  0 GO  TO  70

31!)            no 65  I=HGAP,K
319             J=l -  I GAP
320         55  |F( J  .IE. 0)  GO TO 65
321             JG=J  -  1GAP
322             IF(CPUTMPJJ) .LE.  CPUTMP(JGJ) GO T0 60
323      C           EXCHANGE PLACES  IN  TEMPORARY DATA  ARRAY
3?4             AK=CPOTMP(J)
325             CPUTMPUl =Ct>UTMP(JG>
326             CPUTMPIJGI'AK
327      C           EXCHANGE PLACES OF  INDEXES
328             IK=KMOX(JI
329             
-------
 360      C           ROUTINE  Ul  INPUT CONTROL  STRATFGY DATA  P FR  BASIN
361      f
362      C ****-******************************<-**********************************
363            D IMF MSI ON AtJNI T( / , 21 01 ,TPNSMN(7 ,210) ,PMOUTH(7 , 2 13 ), r COS T (7, 210, 31,
364            r.         OIFMTHI 7,210,3I,CPUREM< 7,210,3) ,FINREM(3780) ,F1NCST(3780)
365             INTFC.FP SRCt (7 , 210,2R I,ITYP<7,210), 1ST AGE ( n,KCRANK( 7, 210, 31 ,
366            f,         FINSRCM780,43t ,1 SFIimrRO) ,KNOX(37BO I , NAMBSN<7,20 I,
3*.7            r.         KTRANM7, ?10, 31, NSFCEI 7),nASIM( 3780,20)
368            COMMON /WIPin/   IN,I OUT
369            COMMON /WT , I T I , I T2,1T3
376          5 FORM AT (4 I "S >
377             IFNn=NSCF( N)
378             IFUT3 ,FO. 0) GO  TT  15
379            DO  10  1=1,IT3
380         10 RFAr>(JM,7) ALPHA
391          7 FORMAT(At I
38?         15  IFUTl .GE. 1} READ(JN,71 ALPHA
383             IF(IT1 .EQ. 2) REAO(JM,7) ALPHA
38'i             IFHT2 .GF.  I) REAntJN,7) ALPHA
385             ITUT2 .GF. 2\ READ(JN, M ALPHA
386             IFIIT2 .EO. 3) REAOIJN.7) ALPHA
3S7      C
388            00  30  I=1,IENO
389              RFAD(JM,20,FRR=810I( SfrF(N,I,JI,J=l,28),ITYP(N,II , ALPHA , TEMP, AUN1 T ( N, I )
390         23   FORMATI28AI , 13 ,Al tZfl't .-V.)
391              IF(irYP(N,ft  .EO.  2) MIM T(N,It=AUNIT(N,fl * 1000,
39?         30 RCAIM JN.7 ) ALPHA
393      C
394         40 R[-AO< JN, 7,FNO=780)  ALPfST
395             !F(ALPTST  .ME. ALPHA1)  GO TO 40
396            PEADIJN.S! ITl ,1 T2 ,1T3,ISTAGE(N)
3^7             IF(ISTAGE(MI  .0.  0  .OP.  IT3 .FO.  01  GO TO 830
398         4S KEAOI JN, 7, EMO=780I  AI.P1ST
399            IFIALPTST  .NF. ALPHA?) GO TO 45
400            REAOUI. 53J N'JM, TOTLOO, TOTMTH
401         50 FORMAT! I5.2F15.4)
402            REAO(JN,7) ALPHA
403             CENO?=ISTAGF(Ml
404            00  6"?  J =1 ,lF.NO
405             R'rAO(JN|,67)  TRNSMN ( N , I I , PMOUTHl N , I I
406             00 63 J=l,ITN02
437         60  REA1(J^,68) Pl)| F .PUCOS T , TC OST{ N, I , J ) , Dl FMTH ( N, I , J) , CPJREM (N, I, J I,
40R           f.    KFRANMN, I, J )
409         65 CONTINUE
410         67 FORMAT!2F15.4I
411         61 FORMAT(5F15.4, 15 I
412            HSNTL=PSNTL-IOTIOD
413         70RFAr>(JM, 7?,CNn = 75Mr I NSHC (I NOX , J) , J=l ,4B) , IAL", ISF1N( INOX ) ,
414           r.  FINRF'K INDX ), t-INC^T ( INDX I
415            KNOXIIMOX)=INOX
41&             INOX- INOXtI
417            GO  TO  70
418         72 f IIR^ATI 43A 1 ,21 ';,2F 15. 4)
41 9      r

-------
 420       803  WRITE( IOUT ,802}
 421        102  FOPMATt 'OCRROR  IN INPUT  OF  INITIAL VALUES OF WATERSHED DATA  FILF'I
 422             GO TO 75
 4?3        810  URI T? ( lOtJI , 812)
 424        81?  FORMAT('OERROR  IN INPUT  OF  S1URCE  ID DATA'I
 425             GO TO 75 ,
 4?6        780  WRITEIIOUT.782J
 427        782  FORMAT<'3FRRDR   CONTROL DATA NOT FDIWOM
 428             On TO 75
 429        f)?0  WR ITF( IOUT, 0         10  FORMAT I A1.56X, 'SUMMARY OF PROGRAMS'/ 56 X, ' TO TAL  POLLUTANT  LOADS1//
 461           r,lX,65('-' )  ,661'-')/62X,62X ,'SUM OF'/BOX , ' LO AD', 5X, ' SUM OF L3AO',
 4f>2           Cl3X,'CflST  OF   REOUCTION'/78X,2('REDUCTION    ' I ,'PERCENT', IX,
 463           f.'PEOUCT IOM   COSTSV6X, 'SOURCE', 34X, 'RANK ',6X,'flASIM',10X, 'STAGE',
 464           6?< 3X,MKG/YRJ   '),'  REDUCTION    )
477         ^5 FORMATdX.65 (- l,66( -  I I
 478            P F f UR N
479             (JNO    .)

-------
Program Output

         The worksheet 8  that follows  is  the output  from  the sample'terminal"
session that has been compiled for example purposes only.
                                        113

-------
  SUMHARY  OF  PROGHAMS
TOrL POllUUNI LOADS
                                                                    WORKSHEET 8
SOURCE
CROPLAND
CROPLAND
CROPLAND
CROPLAND
CROPLAND
CROPLAND
CROPLAND
CROPLAND
CROPLAND
CROPLAND
MUNICIPAL
CROPLAND
MUNICIPAL
CROPLAND
MUNICIPAL
MUNICIPAL
CROPLAND
MUNICIPAL
CROPLAND
CROPLAND
MUNICIPAL
MUNICIPAL
CROPLAND
CROPLAND
CROPLAND
CROPLAND
MUNICIPAL
CROPLAND
MUNICIPAL
MUNICIPAL
MUNICIPAL
MUNICIPAL
CROPLAND
CROPLAND
CROPLAND
CROPLAND
CROPLAND
CROPLAND
COMBINED
COMBINED
CROPLAND
COMBINED
- UPPER SANDUSKY EIVER
- MIDDLE SANDUSKY
- TYMOCHTEE CREEK
- OEOKEN SWORD
- LOW EC SANDUSKY 
30
31
32
33
3 't
33
36
37
38
3<>
HO
HI
42
'13
ill
45
46
M7
n
4<>
r>0
51
52
BASIN
SANDUSKY
SANDUSKY
SANDUSKY
SAN DUSKY
SAHDUSKY
SANDUSKY
SANDUSKY
SAHDUSKY
SANDUSKY
SANDUSKY
SANDUSKY
SANDUSKY
SANDUSKY
SAN DUSKY
SANDUSKY
SANDOSKY
SANDUSKY
SANDUSKY
SANDUSKY
SANDUSKY
SANDUSKY
SAM DUSKY
SANDUSKY
SANDUSKY
SANDUSKY
SANDUSKY
SAN' DUSKY
SANBUSKY
SANDUSKY
SANDUSKY
SANDUSKY
SANDUSKY
SAWDIISKY
SANDHSKY
SANDUSKY
SANDUSKY
SANDUSKY
SANDUSKY
SAHDUSKY
SANDUSKY
SANDUSKY
SANDUSKY
SANOUSKY
SANDUSKY
SAHDUSFY
SANDUSKY
SANDUSKY
P. \NIMI SKY
SANDUSKY
SANDIISKY
SAHDUSKY
SANDIISKY
TWO
TWO
TWO
TWO
TWO
TWO
THO
TWO
TWO
ONE
THO
TWO
THO
ONE
TWO
ONE
ONE
ONE
ONE
ONE
ONL'
TWO
ONE
ONE
ONE
ONE
ONE
ONE
TWO
TWO
TWO
TWO
TWO
TWO
TWO
TWO
THO
TWO
TWO
TWO
TWO
TWO
TWO
TWO
TWO
THO
TWO
THO
TWO
TWO
ONE
ONE
LOAD
REDDCIIDH
STAGE (ICS/YR)
STAGE
STAGE
STAGE
STAGE
STAGE
STAGE
STARE
SIAGE
STAGE
SIAGE
SIAGE
STAGE
SIAOE
STAGE
SIAGE
SIAGE
STAGE
SIAGE
STAGE
ST AC. E
STAGE
STAGE
5 1 AG E
STAGE
STAGE
SIAGE
STAGE
SIAGE
21065.
37752.
33279.
11733.
11101.
22806.
969'4.
'4869.
16047.
3882.
21145.
95118.
6219.
5923.
10365.
14096.
3614.
4146.
3221.
5593.
591D.
13267.
3103.
4B17.
5079.
5166.
8845.
2418.
SIAGE 2 352'4.
STARE 2 1037.
SIAGE 2 1721.
STAGE 2 2211.
SIAOE 2 19236.
SIAGE 2 18876.
STAGE 2 7422.
STAGE 2 12440.
SIAGE 2 5739.
STAGE 2 560'4.
SIAGB 2 2444.
STAGE 2 2891.
STAGE 2 14705.
SIAGE 2 1523.
STAGE 89.
5 1 AG E 1 1 .
STAGE 439.
STAGE 62'4.
STAGE 739.
SIAGE 2329.
STAGE 7906.
STAGE 339.
STAGE 523.
SIAGE 615.
SUM Or LOAD
REDUCTION
(K3/YR)
21365.
58918.
92397.
133330.
117931.
143737.
153431.
155299.
171347.
175229.
196373.
205913.
212132.
219J55.
229423.
243517.
247133.
251276.
254498.
269)91.
267001.
283268.
233376.
288193.
293272.
298438.
3J7283.
309709.
313224.
314261.
315988.
318200.
323)36.
347312.
354733.
367173.
372911.
173515.
380959.
383853.
393555.
403377.
4)3165.
40J246.
403684.
101)09.
432346.
43'4374.
412280.
412668.
'413198.
413803.
PERCENT
REDUCTION
2.
7.
10.
12.
14.
16.
17.
IB.
2).
2).
23.
2'4.
25.
26.
27.
28.
29.
29.
30.
33.
31.
33.
33.
31.
3'4.
35.
36.
36.
37.
37.
37.
37.
39.
41.
42.
43.
44.
'45.
45.
45.
47.
47.
47.
'47.
47.
47.
47.
'8.
'49.
49.
(9.
49.
5
3
9
3
0
7
9
4
3
a
3
5
2
0
2
9
4
9
2
9
7
3
7
2
8
4
5
9
2
3
5
8
)
2
1
6
3
)
2
6
3
5
5
5
6
7
7
3
}
0
1
1
COST OF
REDUCTION
(t/YR(
17B49.
35253.
34346.
12167.
15831.
26643.
12343.
6500.
22331.
6539.
47352.
22332.
15000.
17949.
32430.
47352.
1234S.
15030.
12167.
22331.
32400.
6243D.
15831.
266U3.
34346.
35253.
62400.
22332.
71028.
22533.
48633.
93600.
823800.
1627000.
730650.
1229699.
569520.
561570.
256880.
303810.
1585199.
177840.
1)363.
9629.
51800.
76960.
91020.
3)93)0.
1333653.
53280.
76960.
91020.
SUM OP
DEDUCTION
COSTS
(Sx-IH)
17849.
53132.
87440.
99616.
115446.
142090.
154M29.
160929.
183260.
189760.
237112.
259414.
274414.
292263.
324663.
372015.
384355.
399355.
411522.
433853.
466253.
528653.
544483.
571127.
635473.
640726.
703126.
725428.
796456.
818956.
867556.
961156.
1784956.
3412036.
4142686.
5372385.
5941904.
6503474.
6760353.
7064163.
8649362.
8827201.
8837560.
8847183.
8898990.
8975939.
9066959.
9366959.
10397609.
10450898.
13527847.
10618867.

-------
COMBINED
CROPLAND
STORM -
STORM -
STORM -
STORN -
STOHM -
STORM -
COMBINED
COMIIINBO
COMnlNEO
- BIICYRIIS CITY
- HOI. F CREEK
DUCYHUS CTTY
TIFFIN CITY
FREMONT CITY
FREHOHT CITY
DUCYPUS CITlf
TIFFIN CTIY
- UPPER SANDUSKY CITY
- UPPER SANDUSKY CITY
- UPPER SANDUSKY CITY
53
04
05
06
07
sn
i1)
60
61
62
63
SANDUSKY
SANOUSKY
SANUIISKY
SANDUSKY
SANDUSKY
SAN DO SKY
SJVNPU3KY
SANDUSKY
SANOUSKY
SANDUSKY
SANDUSKY
ONE
TWO
TWO
THO
TWO
ONE
OHE
ONE
TWO
TWO
ONE
STAGE
STAGE
STAGE
STAGE
STAGE
STAGE
STAGE
STAGE
STAGE
SI AGE
f.IAGE
324.
! 5620.
! 61.
> 328.
2 66.
35.
33.
175.
511.
131.
103.
'4 1U127.
419713.
119809.
423137.
423232.
120237.
!23270.
1(20115.
'420956.
421337.
121195.
19.
'49.
49.
'49.
49.
19.
49.
19.
50.
53.
50.
2
9
9
9
9
9
9
9
0
3
0
* 51200*
1029330.
11180.
63233.
1201!).
10360.
9620.
51800.
214B90.
61383.
643flO.
10672116.
11791476.
11712656.
11772856.
11781895.
11795251.
11834871.
11056671.
1207f>63.
12135942.
12200321.

-------