Sunday, July 9, 2017

#SWMM3 and #SWMM4 Acknowledgments, includes mention of #PCSWMM

A note from the past, the SWMM3 and SWMM4 Acknowledgments from their respective manuals for the sake of posterity and in thanks for all of their past efforts.

SWMM4 Acknowledgments

Maintenance and updating of the EPA SWMM has been continuous since its
inception in 1969-70.

Over the many intervening years many individuals have contributed to its improvement, notably EPA colleagues Mr. Richard Field, Mr. Harry Torno, Mr. Chiu-Yuan Fan, Mr. Doug Ammon and Mr. Tom Barnwell. Mr. Torno and Mr. Barnwell have also managed the Storm and Water Quality Model Users Group (formerly the SWMM Users Group), a source of invaluable feedback from model users, including a large contingent from Canada and abroad.

Too many individuals have contributed to specific improvements to list here. This users manual, however, is based upon earlier versions to which the following persons contributed significant authorship while at the University of Florida: Mr. Brett A. Cunningham, Mr. Victor Gagliardo, Dr.Stephen J. Nix, Mr. Donald J. Polmann and Mr. W. Alan Peltz. In particular, Mssrs. Cunningham and Gagliardo developed the new subsurface routing routine in the Runoff Block. Dr. James P.Heaney has served staunchly as colleague, critic, and pioneer of new ideas. Omission of these names from the current list of authors does not diminish our gratitude for current and past efforts in developing the model.

The Extran Block is one of the most valuable and widely-used components of SWMM. Dr. Larry A. Roesner and Mr. John A. Aldrich of Camp, Dresser and McKee, Inc., one of the three original SWMM developers, have given generously of their time to enhance Extran and to provide useful suggestions for improvements of Extran and the rest of the SWMM model. The Fortran-77 code for Version 4 of SWMM is based on a microcomputer version prepared by Mr. Richard M. Baker and Mr. Karl J. Brazauskas of Metcalf and Eddy, Inc., another one of the original three developers. Much of the user’s manual text for Version 4 has been adapted from a computerized edition of the Version 3 manuals prepared by Dr. William James of Wayne State University. We are grateful to Dr. James and to Dr. Stephen Nix of Syracuse University for their helpful comments regarding Version 4. Assistance in printing of the manuals was provided by KBN Applied Sciences and Engineering, Inc. of Gainesville.

At the University of Florida, invaluable word-processing and SWMM dissemination duties have been performed faithfully by Ms. Doris Smithson. Main-frame computations were performed at the Northeast Regional Data Center on the University of Florida campus, Gainesville.

SWMM3 Acknowledgements

Maintenance and updating of the EPA SWMM has been continuous since its
inception in 1969-70. Over the several intervening years, many
individuals have contributed to its improvement, most notably EPA
col­leagues Richard Field, Harry Torno, Chi-Yuan Fan, Doug Ammon and
Tom Barnwell. Harry Torno and Tom Barnwell have also managed the SWMM
Users Group, through which many helpful suggestions for improvements
have come, including those from the large contingent of Canadian
users.

Regarding specific components of SWMM Version III, the Green-Ampt
infiltration routines were reviewed, programmed and tested by Dr.
Russell G. Mein, Department of Civil Engineering, Monash University,
Clayton, Victoria, Australia while on a sabbatical at the University
of Florida. He also provided valuable review and testing of other
model components. The earliest implementation of continuous simulation
in the Runoff and Storage/Treatment Blocks was done by George F.
Smith, now with the Office of Hydrology, National Weather Service,
Silver Spring, Maryland. Basic formulation of the snowmelt routines
was done following the work of Proctor and Redfern, Ltd. and James F.
MacLaren, Ltd., Toronto, who were under contract to the Ontario
Ministry of the Environment and the Canadian Environmental Protection
Service. Runoff Block surface quality changes were the subject of
masters research at the University of Florida by Douglas C. Ammon, now
with the EPA, Storm and Combined Sewer Branch, Cincinnati. Revision of
Transport Block scour/deposition routines is based on work with Dennis
Lai, Clinton-Bogert Associates, Fort Lee, New Jersey. Many lasting
improvements in SWMM programming were made by W. Alan Peltz, now with
General Electric, Atlanta.

Several others contributed to changes in the model. The card ID system
and the user-defined default values and ratios were suggested by the
Corps of Engineers, Hydrologic Engineering Center, Davis, California.
The programming basis has been aided by Dr. William James, McMaster
University, Hamilton, Ontario and exposure to his FASTSWMM programs.
Emphasis upon proper use and objectives of SWMM modeling has been
enhanced by conversations with the late Murray McPherson, Marblehead,
Massachusetts, Eugene Driscoll, Oakland, New Jersey, Dr. Dominic
DiToro, Manhattan College, New York City, John Mancini, Lincoln,
Nebraska, Dr. Paul Wisner, Ottawa University, Charles Howard,
Vancouver, B.C., and several others. OF is additionally grateful to
Reinhard Sprenger, Templeton Engineering, Winnipeg, for improvements
to the Extran Block, to Christian Eicher, Gore and Storrie, Ltd.,
Toronto, for several important corrections to the overall program, to
Robert Johnson, Lehigh University, Bethlehem, Pennsylvania, for
comments on the compatibility with CDC machines, to Tom Jewell, Union
College, Schenectady, New York, for analysis of surface washoff and
other comments, and to Tom Meinholz and Richard Race, formerly of
Envirex, Inc., Milwaukee, for suggestions on making the program more
suitable to prototype configurations.

The Extended Transport Block has been an invaluable addition to the
SWMM package. Developed by Water Resources Engineers (now a part of
Camp, Dresser and McKee), Extran may be the most widely used portion
of SWMM. Dr. Larry Roesner and the late Dr. Robert Shubinski of CDM,
Annan­dale, Virginia have given generously of their time in enhancing
Extran and in making other useful suggestions to SWMM modeling.

At the University of Florida, salutary programming and testing has
been conducted by J. Jay Santos, Efi Foufoula, Michael Kennedy, Kelly
Nead and Christina Neff. Typing has been performed by Linda Trawick,
Jeanette Heeb, Kim Karr and the College of Engineering Word Processing
Center. Figures were drafted by Terri Schubert, Micky Hartnett and
Anelia Crawford. Computations were performed at the Northeast Regional
Data Center on the University of Florida campus, Gainesville.

Wednesday, July 5, 2017

How does the CFL time Step Change in one SWMM 5 Link? #Inside_SWMM5

Introduction – the reason for these series of blogs are as an expanded view of the input, engine and output of #SWMM5 It is a companion to the EPA Documentation which I describe here:
I have noticed based on email questions and postings to the SWMM List Sever (a great resource hosted by CHI, Inc.) that many SWMM 5 users do not know about the really outstanding documentation on SWMM 5 posted on the EPA Website https://www.epa.gov/water-research/storm-water-management-model-swmm It consists of two now and in the near future three volumes on Hydrology, Water Quality, LID's and SuDS and Hydraulics. The documentation is fantastically complete with detailed background on the theory, process parameters and completely worked out examples for all of the processes in SWMM5. It is truly an outstanding aid to modelers and modellers worldwide. It would benefit you to read them (if you have not already downloaded the PDF files)

If you use variable time steps in SWMM5 then based on the CFL time step condition the program will adjust the time step.  The smallest link time step governs the program time step.  You can see the results for one link in Figure 1.  The time step increases as the velocity and depth increase during the simulation.
Variable Time Step (SWMM5 Help File)
Check the box if an internally computed variable time step should be used at each routing time period and select an adjustment (or safety) factor to apply to this time step. The variable time step is computed so as to satisfy the Courant condition within each conduit. A typical adjustment factor would be 75% to provide some margin of conservatism. The computed variable time step will not be less than the minimum variable step discussed below nor be greater than the fixed time step specified on the Time Steps page of the dialog.
        Figure 1.  The time step increases as the velocity and depth increase during the simulation.
                                                      

Tuesday, July 4, 2017

What is the minimum depth in a link of #SWMM5 ?

Introduction – the reason for these series of blogs are as an expanded view of the input, engine and output of #SWMM5 It is a companion to the EPA Documentation which I describe here:
I have noticed based on email questions and postings to the SWMM List Sever (a great resource hosted by CHI, Inc.) that many SWMM 5 users do not know about the really outstanding documentation on SWMM 5 posted on the EPA Website https://www.epa.gov/water-research/storm-water-management-model-swmm It consists of two now and in the near future three volumes on Hydrology, Water Quality, LID's and SuDS and Hydraulics. The documentation is fantastically complete with detailed background on the theory, process parameters and completely worked out examples for all of the processes in SWMM5. It is truly an outstanding aid to modelers and modellers worldwide. It would benefit you to read them (if you have not already downloaded the PDF files)
What it is the minimum depth in a link of SWMM5 ?   EPA SWMM5 uses internal units of feet or inches for rainfall.   The minimum depth is FUDGE in the Code and has the value of 0.001 feet or ft^2.  You can see the effect in the output file if you look at the depth, volume or area values.






Sunday, July 2, 2017

How Calibration Plots were made in #SWMM4 and #SWMM3

How Calibration Plots were made in #SWMM4 and #SWMM3 - I remember these being very useful in SWMM classes with Wayne Huber at UF.

      SUBROUTINE GRAPH
C     GRAPH BLOCK
C=======================================================================
C     THIS ROUTINE PREPARES SIMULATED AND MEASURED HYDROGRAPHS,
C     POLLUTOGRAPHS  AND LOADOGRAPHS FOR PLOTTING BY SUBROUTINE CURVE.
C     SIMULATED AND/OR MEASURED DATA MAY BE PLOTTED.  IT IS NO LONGER
C     POSSIBLE TO PLOT MORE THAN ONE LOCATION ON ONE GRAPH.
C     THIS ROUTINE LAST UPDATED BY W. HUBER, AUGUST 1993.
C     SCRATCH FILE 1 NOT USED.  DON'T OPEN.  WCH, 4/18/94.
C     Change NQP to NQPP to avoid confusion cim 9/9/00
C     Add error message for E3 lines, WCH, 9/14/00.
C     Fix metric conversion error.  Inflows on interface file from
C       all blocks will be in cms if metric is used.  WCH, 9/14/00.
C     Uses nscrat(8) for MFILE input file, added features for FREE 
c     formatted input - RED, 9/15/00
C     Add more error messages, WCH, 9/16/00.
C=======================================================================
      INCLUDE 'TAPES.INC'
      INCLUDE 'INTER.INC'
      INCLUDE 'LAB.INC'
C=======================================================================
C#### WCH (CDM), 8/93. REMOVE NEWFIL*60
      CHARACTER KPRED(20)*10,KMEAS(20)*10,JMEAS(20)*10
      CHARACTER PNDUM*8,PUDUM*8,VER1*10,VER2*10,VER3*10,VER4*10,
     +          PRIN(3)*14,FIRMAT*80,DEFMT*16,HORIZG(2)*30,
     +          VERM(4)*10,USE*4,PPNAME*8,PPUNIT*8,ZX(2)*20,BMJ*4
      DIMENSION X(401,2),Y(401,2),NPT(2),JPLOT(20),
     1          YT(401,6),ITAB(20),IPLOT(20),MTAB(20),KPLOT(20),
     2          TIMX(16),YVAL(16),QQT(200),PPT(10,200),IPOLX(11),
     3          NNDIM(MQUAL),PPNAME(MQUAL),PPUNIT(MQUAL),NLOAD(11)
      LOGICAL NOTEND
C=======================================================================
      DATA PRIN/'HYDROGRAPH   ','POLLUTOGRAPH ','LOADOGRAPH '/
      DATA HORIZG/'      TIME OF DAY IN HOURS    ',
     +            ' PREDICTED = *    MEASURED = +'/
      DATA VER1/'   FLOW   '/,VER2/'    IN    '/,
     +     VER3/'    CFS   '/,VER4/' CU M/SEC '/
      DATA VERM/'  POUNDS  ','   PER   ','  SECOND  ','MILLIGRAMS'/
      DATA DEFMT/'(2X,F8.0,7F10.0)'/,BMJ/'    '/
      DATA ZX/'  PLOT CONCENTRATION','  PLOT LOADOGRAPH'/
C=======================================================================
C#### WCH, 8/5/93.  ADD NO-QUOTE OPTION.
C=======================================================================
      IF(NOQ.EQ.0) THEN
                   WRITE(*,10)
                   WRITE(N6,10)
                   ELSE
                   WRITE(*,12)
                   WRITE(N6,12)
                   ENDIF
C#######################################################################
C WCH, 8/5/93. INCREMENT THE JIN/JOUT COUNTERS.
C=======================================================================
      INCNT  = INCNT + 1
      IOUTCT = IOUTCT + 1
C=======================================================================
C     Open all input/output files for the Graph Block.
C=======================================================================
      IF(JIN(INCNT).GT.0.AND.(FFNAME(INCNT).EQ.'JOT.UF'.OR.
     +      FFNAME(INCNT).EQ.'JIN.UF'))
     +      OPEN(JIN(INCNT),FORM='UNFORMATTED',STATUS='SCRATCH')
      IF(JIN(INCNT).GT.0.AND.FFNAME(INCNT).NE.'JOT.UF'.AND.
     +      FFNAME(INCNT).NE.'JIN.UF')
     +      OPEN(JIN(INCNT),FILE=FFNAME(INCNT),FORM='UNFORMATTED',
     +      STATUS='UNKNOWN')
C=======================================================================
C     DON'T NEED JOUT BUT OPEN OUT OF HABIT IF JOUT > 0.
C=======================================================================
      IF(JOUT(IOUTCT).GT.0.AND.(FFNAME(25+IOUTCT).EQ.'JOT.UF'.OR.
     +      FFNAME(25+IOUTCT).EQ.'JIN.UF'))
     +      OPEN(JOUT(IOUTCT),FORM='UNFORMATTED',STATUS='SCRATCH')
      IF(JOUT(IOUTCT).GT.0.AND.FFNAME(25+IOUTCT).NE.'JOT.UF'.AND.
     +      FFNAME(25+IOUTCT).NE.'JIN.UF')
     +      OPEN(JOUT(IOUTCT),FILE=FFNAME(25+IOUTCT),FORM='UNFORMATTED',
     +      STATUS='UNKNOWN')
C=======================================================================
C=======================================================================
C#### WCH, 4/18/94.  DON'T OPEN THIS IF DON'T USE IT.
C#### (DON'T) OPEN FORMATTED SCRATCH FILE
C##=====================================================================
Cred     need this file for measured data on an external file - 9/14/00
cred     change to nscrat(8) because the first scratch file is used by 
cred     runoff and transport - 9/15/00
         IF(NSCRAT(8).GT.0.AND.FFNAME(58).NE.'SCRT1.UF') OPEN(NSCRAT(8),
     +             FILE=FFNAME(58),FORM='FORMATTED',STATUS='UNKNOWN')
C##      IF(NSCRAT(1).GT.0.AND.FFNAME(51).EQ.'SCRT1.UF') OPEN(NSCRAT(1),
C##     +             FORM='FORMATTED',STATUS='SCRATCH')
C##                    NOUT = NSCRAT(1)
C##      IF(NOUT.GT.0) REWIND NOUT
C=======================================================================
C>>>>>>>>>>>> READ DATA GROUP A1 <<<<<<<<<<<<
C=======================================================================
      READ(N5,*,ERR=888) CC,NTAPE,NPLOT,MEAS,
     +                       MFILE,MPLOT,NQPP,METRIC,MCTH
      NLP    = NQPP+1
      IF(MFILE.LE.0) MFILE = N5
      WRITE(N6,30) NTAPE,METRIC,NQPP,NPLOT,MEAS,MFILE,MPLOT,MCTH
      METRIC = METRIC + 1
      IF(METRIC.EQ.1) THEN
                      CFACT1 = 28.31605/453592.0
                      CFACT2 = 28.31605
                      ELSE
                      CFACT1 = 1000.0 / 1.0E06
                      CFACT2 = 1000.0
                      ENDIF
      IF(NPLOT.EQ.0.AND.MEAS.EQ.0) RETURN
                    NUNIT = N5
cold  IF(MEAS.EQ.2) NUNIT = MFILE
      IF(MEAS.EQ.2) THEN
Cwch, 9/16/00.  Add error check for MFILE = NSCRAT8
 IF(MFILE.NE.NSCRAT(8)) THEN
WRITE(*,3800) MFILE,NSCRAT(8)
WRITE(N6,3810)MFILE,NSCRAT(8)
IF(NSCRAT(8).GT.0) THEN
MFILE = NSCRAT(8)
ELSE
STOP ' MUST HAVE E3 INPUT ON NSCRAT(8). RUN ST
     1OPPED FROM GRAPH.'
                   ENDIF
                ENDIF
                    NUNIT = MFILE
                    REWIND NUNIT
                    ENDIF
      IF(NPLOT.LT.1.OR.NTAPE.LT.1) GO TO 4000
C=======================================================================
C     INTERFACING MECHANISM FOR QUANTITY AND QUALITY OF RUNOFF
C=======================================================================
C#### WCH, 8/5/93.  ADD ERROR MESSAGE.
      IF(NTAPE.NE.JIN(INCNT)) THEN
         WRITE(N6,9500) NTAPE, JIN(INCNT), INCNT
         WRITE(*,9500)  NTAPE, JIN(INCNT), INCNT
         STOP
         ENDIF
      CALL INFACE(1,NTAPE)
      IF(NQUAL.GT.0) THEN
                     DO 110 K  = 1,NQUAL
                     PPNAME(K) = PNAME(K)
                     PPUNIT(K) = PUNIT(K)
                     NNDIM(K)  = NDIM(K)
  110                CONTINUE
                     ENDIF
C=======================================================================
C     INPUT INFORMATION FOR QUALITY PARAMETERS.
C=======================================================================
 4000 IF(NQPP.LE.0) GO TO 4200
      WRITE (N6,4090)
C=======================================================================
C>>>>>>>>>>>> READ DATA GROUP B1 <<<<<<<<<<<<
C=======================================================================
      DO 4140 K = 1,NQPP
      READ(N5,*,ERR=888) CC,KPOL,NLOAD(K+1),PNDUM,PUDUM,NDUM
C=======================================================================
C     HERE, USER INPUT DEFINES POLLUTANTS.
C=======================================================================
      K1        = K + 1
      IF(KPOL.EQ.0.OR.NPLOT.EQ.0) THEN
                                  IPOLX(K1) = K1
                                  NDIM(K1)  = NDUM
                                  PNAME(K1) = PNDUM
                                  PUNIT(K1) = PUDUM
                                  ELSE
                                  IPOLX(K1) = KPOL
                                  NDIM(K1)  = NNDIM(KPOL)
                                  PNAME(K1) = PPNAME(KPOL)
                                  PUNIT(K1) = PPUNIT(KPOL)
                                  ENDIF
      KK1 = NLOAD(K1) + 1
      WRITE(N6,4150) K,PNAME(K1),PUNIT(K1),NDIM(K1),KPOL,ZX(KK1)
 4140 CONTINUE
C=======================================================================
C>>>>>>>>>>>> READ DATA GROUP C1 <<<<<<<<<<<<
C=======================================================================
 4200 IF(NPLOT.GT.0) THEN
                     IF(JCE.EQ.0) THEN
                         READ(N5,*,ERR=888) CC,(IPLOT(N),N=1,NPLOT)
                         WRITE(N6,40) NPLOT,(IPLOT(N),N=1,NPLOT)
                         ELSE
                         READ(N5,*,ERR=888) CC,(KPRED(N),N=1,NPLOT)
                         WRITE(N6,41) NPLOT,(KPRED(N),N=1,NPLOT)
                         ENDIF
                     ENDIF
C=======================================================================
C>>>>>>>>>>>> READ DATA GROUP C2 <<<<<<<<<<<<
C=======================================================================
      IF(MPLOT.GT.0) THEN
                     IF(JCE.EQ.0) THEN
                        READ(N5,*,ERR=888) CC,(KPLOT(N),N=1,MPLOT)
                        WRITE(N6,55) MPLOT,(KPLOT(N),N=1,MPLOT)
                        ELSE
                        READ(N5,*,ERR=888) CC,(KMEAS(N),N=1,MPLOT)
                        WRITE(N6,56) MPLOT,(KMEAS(N),N=1,MPLOT)
                        ENDIF
                     ENDIF
C=======================================================================
C>>>>>>>>>>>> READ DATA GROUP D1 <<<<<<<<<<<<
C=======================================================================
      READ(N5,*,ERR=888) CC,TITLE(1)
      HTITLE(1) = TITLE(1)
      HTITLE(2) = BMJ
      DO 100 J  = 1,20
  100 MTAB(J)   = 0
      HORIZ(1)  = HORIZG(1)
      HORIZ(2)  = HORIZG(2)
      NNN       = 0
C=======================================================================
C     ITAB = SUBSCRIPT OF LOCATION OF MEASURED GRAPH WHEN MEASURED
C            LOCATION MATCHES DESIRED PLOT LOCATION.
C=======================================================================
      IF(MPLOT.GT.0) THEN
                     DO 180 M  = 1,MPLOT
                     NNN       = NNN + 1
                     DO 160 J  = 1,LOCATS
                     IF(JCE.EQ.0.AND.KPLOT(M).EQ.NLOC(J)) GO TO 170
                     IF(JCE.EQ.1.AND.KMEAS(M).EQ.KAN(J))  GO TO 170
  160                CONTINUE
                     ITAB(M) = 0
                     MTAB(M) = M
                     GO TO 180
  170                ITAB(M) = J
                     MTAB(M) = M
  180                CONTINUE
                     ENDIF
C=======================================================================
C     CHECK FOR MATCHING LOCATIONS TO BE PLOTTED FROM SWMM FILE.
C     MTAB EQ 0, NO MATCH BETWEEN IPLOT AND KPLOT.
C     MTAB NE 0, MTAB = SUBSCRIPT OF IPLOT.
C=======================================================================
      IF(NPLOT.GT.0) THEN
                     DO 210 J = 1,NPLOT
                     IF(MPLOT.EQ.0) GO TO 201
                     DO 200 M = 1,MPLOT
                     IF(JCE.EQ.0) JPLOT(M) = KPLOT(M)
                     IF(JCE.EQ.1) JMEAS(M) = KMEAS(M)
                     IF(JCE.EQ.0.AND.IPLOT(J).EQ.KPLOT(M)) GO TO 205
                     IF(JCE.EQ.1.AND.KPRED(J).EQ.KMEAS(M)) GO TO 205
  200                CONTINUE
  201                DO 206 N  = 1,LOCATS
                     IF(JCE.EQ.0.AND.IPLOT(J).EQ.NLOC(N)) GO TO 203
                     IF(JCE.EQ.1.AND.KPRED(J).EQ.KAN(N))  GO TO 203
  206                CONTINUE
                     IF(JCE.EQ.0) WRITE(N6,9020) IPLOT(J)
                     IF(JCE.EQ.1) WRITE(N6,9021) KPRED(J)
                     STOP
  203                NNN        = NNN + 1
                     IF(JCE.EQ.0) JPLOT(NNN) = IPLOT(J)
                     IF(JCE.EQ.1) JMEAS(NNN) = KPRED(J)
                     ITAB(NNN)  = N
                     MTAB(NNN)  = 0
                     GO TO 210
  205                MTAB(M)   = M
  210                CONTINUE
                     END IF
C=======================================================================
C     FROM PREDICTED OUTPUT, STORE EVERY MCTH DATA POINT
C     PROGRAM THEN INTERPOLATES TO PLOT 100 POINTS AT MOST.
C     FIRST PLOTTED POINT IS ALWAYS ZERO AT TZERO.
C=======================================================================
      IF(MCTH.LE.0) MCTH = 1
      WRITE(*,34)   NNN
      DO 800 MT = 1,NNN
      IBACK     = 0
      NOTEND    = .FALSE.
      WRITE(*,35) MT
      IF(NPLOT.EQ.0)                    GO TO 7000
      IF(MT.LE.MPLOT.AND.ITAB(MT).EQ.0) GO TO 7000
C=======================================================================
C     READ INTERFACE FILE HEADERS
C=======================================================================
      CALL INFACE(0,NTAPE)
      TTME     = TZERO
      N        = 0
 5000 DO 250 K = 1,100000,MCTH
      N        = N+1
      DO 230 J = 1,MCTH
C=======================================================================
C     READ TIME STEP VALUES FROM INTERFACE FILE.
C     STORE IN TEMPORARY FILE AND PULL OUT DESIRED VALUES.
C=======================================================================
      IF(NQUAL.EQ.0) THEN
               READ(NTAPE,END=251) JDAY,TMDAY,DELTA,(QQT(I),I=1,LOCATS)
               ELSE
               READ(NTAPE,END=251) JDAY,TMDAY,DELTA,(QQT(I),
     +                             (PPT(L,I),L=1,NQUAL),I=1,LOCATS)
              END IF
      TTME   = TTME + DELTA
  230 CONTINUE
      X(N,1) = TTME/3600.0
      ITB      = ITAB(MT)
      DO 240 J = 1,NLP
      IF(J.EQ.1) THEN
                 YT(N,J) = QQT(ITB)
                 ELSE
                 KP = IPOLX(J)
                 IF(KP.GT.0) THEN
                             YT(N,J) = PPT(KP,ITB)
                             ELSE
                             YT(N,J) = 0.0
                             ENDIF
                 ENDIF
  240 CONTINUE
      IF(N.GE.401) THEN
                   IBACK = IBACK + 1
                   GO TO 252
                   ENDIF
  250 CONTINUE
  251 NOTEND = .FALSE.
      N      = N - 1
      IBACK  = IBACK + 1
      IF(N.LE.0) GO TO 800
      GO TO 253
  252 NOTEND = .TRUE.
  253 NPT(1) = N
C=======================================================================
C     OUTER LOOP ON HYDROGRAPH PLUS NUMBER OF POLLUTANTS.
C     ONLY READ MEASURED DATA FOR FIRST 200 PREDICTED DATA POINTS.
C=======================================================================
 7000 DO 820 J  = 1,NLP
      IF(IBACK.GT.1) GO TO 6000
             IF(J.EQ.1) THEN
                        VERT1 = VER1
                        VERT2 = VER2
                        IF(METRIC.EQ.1) VERT3 = VER3
                        IF(METRIC.EQ.2) VERT3 = VER4
                        ELSE IF(NLOAD(J).EQ.0) THEN
                             JJ        = IPOLX(J)
                             HTITLE(1) = TITLE(1)
                             VERT1     = PNAME(JJ)
                             VERT2     = VER2
                             VERT3     = PUNIT(JJ)
                             ELSE
                             JJ        = IPOLX(J)
                             HTITLE(1) = PNAME(JJ)
                             VERT2     = VERM(2)
                             VERT3     = VERM(3)
                             IF(METRIC.EQ.1) VERT1 = VERM(1)
                             IF(METRIC.EQ.2) VERT1 = VERM(4)
                             ENDIF
             IF(NPLOT.GT.0) THEN
                            IF(NLOAD(J).EQ.1) GO TO 6000
                            IF(MTAB(MT).EQ.0) GO TO 6000
                            IF(MPLOT.EQ.0)    GO TO 6000
                            ENDIF
             KK = 0
C=======================================================================
C     LOOP ON NUMBER OF MEASURED LOCATIONS TO BE PLOTTED.
C=======================================================================
C     READ PARAMETERS FOR MEASURED INPUT FOR EACH LOCATION FOR EACH
C        MEASURED HYDROGRAPH AND POLLUTOGRAPH.
C=======================================================================
C>>>>>>>>>>>> READ DATA GROUP E1 <<<<<<<<<<<<
C=======================================================================
      READ(N5,*,ERR=888) CC,MDATA,LCARD,MTIME,
     +                   MUNIT,TMZERO,TQUIT,DTMHR
      WRITE(N6,310) PRIN(1),KPLOT(MT),
     +              MDATA,LCARD,MTIME,MUNIT,TMZERO,TQUIT,DTMHR
      IF(MDATA.EQ.0) GO TO 6000
C=======================================================================
C     READ IN VARIABLE FORMAT FOR EACH MEASURED DATA INPUT.
C=======================================================================
C>>>>>>>>>>>> READ DATA GROUP E2 <<<<<<<<<<<<
C=======================================================================
      READ(N5,*,ERR=888) CC,FIRMAT
      IF(FIRMAT.EQ.' ')     FIRMAT = DEFMT
      WRITE(N6,360) FIRMAT
C=======================================================================
C>>>>>>>>>>>> READ DATA GROUP E3 <<<<<<<<<<<<
C=======================================================================
C                    MUNIT = 0  TIME IS IN MINUTES.
C                    MUNIT = 1  TIME IS IN HOURS.MINUTES.
C                    MUNIT = 2  TIME IS IN HOURS.
C=======================================================================
      IF(MTIME.EQ.0) THEN
                     KSTOP = 0
                     KK    = 0
Cwch 9/14/00  Add error message.
cred                 rearrange the next few lines - 9/14/00
370                  continue
cold370              READ(NUNIT,FIRMAT) (TIMX(LL),YVAL(LL),LL=1,LCARD)
cred                 allow for a free formatted file - 9/14/00
                     if(FIRMAT.EQ.'FREE') then
                        READ(NUNIT,*,end=510,err=385) 
     +                   (TIMX(LL),YVAL(LL),LL=1,LCARD)
                        else
                        READ(NUNIT,FIRMAT,END=510,ERR=385) 
     1                   (TIMX(LL),YVAL(LL),LL=1,LCARD)
                        endif
cred                 end of 9/14/00 change
                     DO 380 LL = 1,LCARD
                     IF(TIMX(LL).GE.TQUIT) THEN
                                           KKX   = LL-1
                                           KSTOP = 1
                                           GO TO 390
                                           END IF
  380                CONTINUE
                     KKX = LCARD
Cwch, 9/14/00
  GO TO 390
  385   WRITE(N6,3885) (KK+1)/LCARD
                     STOP ' ERROR READING E3 LINES. SEE OUTPUT FILE. RUN
     1 STOPPED FROM GRAPH.'
  390                IF(KKX.LE.0) GO TO 500
                     DO 490 LL = 1,KKX
                     LX        = KK+LL
                     IF(MUNIT-1.LT.0) THEN
                                X(LX,2) = TIMX(LL)/60.+TMZERO
                                ELSE
                                IF(MUNIT-1.EQ.0) THEN
                                   TIM     = IFIX(TIMX(LL))
                                   X(LX,2) = TIM+(TIMX(LL)-TIM)/0.6+
     +                                            TMZERO
                                   ELSE
                                   X(LX,2)  = TIMX(LL)+TMZERO
                                   ENDIF
                                ENDIF
  490                Y(LX,2) = YVAL(LL)
  500                KK      = KK+KKX
                     IF(KK.LT.401.AND.KSTOP.EQ.0) GO TO 370
Cred                 get out of this loop, use the END statement - 9/15/00
  510                IF(KK.GT.401) KK = 401
cold                 IF(KK.GT.201) KK = 201
                     NPT(2) = KK
                     WRITE(N6,505) KK
                     ENDIF
C=======================================================================
C     HERE, COMPUTE TIME USING CONSTANT TIME INCREMENT, DTMHR, IN HOURS.
C=======================================================================
C>>>>>>>>>>>> READ DATA GROUP E3 <<<<<<<<<<<<
C=======================================================================
      IF(MTIME.GT.0)      THEN
         IF(MTIME.GT.401) THEN
                             WRITE(N6,520) MTIME
                             MTIME = 401
                             ENDIF
         IF(MTIME.GT.0)   THEN
cold                      READ(N5,FIRMAT) (Y(LL,2),LL=1,MTIME)
cred                      allow for a free formatted file - 9/14/00
Cwch, 9/16/00. Put read in DO-loop since documentation says read
C     LCARD values per line. 
DO JJ = 1,MTIME,LCARD
LLSTOP = LCARD
                       IF(MTIME-JJ+1.LT.LCARD) LLSTOP=MTIME-JJ+1
                       KL = JJ
                          if(FIRMAT.EQ.'FREE') then
                            READ(N5,*,ERR=545) (Y(LL,2),LL=KL,LLSTOP)
                             else
                          READ(N5,FIRMAT,ERR=545) (Y(LL,2),LL=KL,LLSTOP)
                             endif
                   END DO
Cwch, 9/16/00.  Include error message here too.
GO TO 547
  545   WRITE(N6,3885) JJ
                     STOP ' ERROR READING E3 LINES. SEE OUTPUT FILE. RUN
     1 STOPPED FROM GRAPH.'
  547                     DO 550 LX  = 1,MTIME
  550                     X(LX,2)    = TMZERO+FLOAT(LX-1)*DTMHR
                          NPT(2)     = MTIME
                          ENDIF
                          ENDIF
C=======================================================================
C     CONVERT PREDICTED FLOWS TO APPROPRIATE UNITS
C=======================================================================
                     NN = NPT(1)
      IF(NPLOT.EQ.0) NN = NPT(2)
      DO 630 N = 2,NN
      IF(J.EQ.1) THEN
Cwch, 9/14/00.  Interface file flows already metric, from Runoff & Transp.
C                 Y(N,1) = YT(N,J)/CMET(1,METRIC)**3.0
                 Y(N,1) = YT(N,J)
                 GO TO 630
                 ENDIF
C=======================================================================
C     CONVERT PREDICTED AND MEASURED
C             POLLUTOGRAPHS TO CONCENTRATION FROM CFS*CONC.
C=======================================================================
      IF(NLOAD(J).EQ.0) THEN
                  IF(YT(N,1).GT.0.0) Y(N,1) = YT(N,J)/YT(N,1)
                  ELSE
                  IF(NDIM(J).EQ.0) THEN
                                   Y(N,1) = YT(N,J)*CFACT1
                                   Y(N,2) =  Y(N,2)*CFACT1
                                   ELSE
                                   Y(N,1) = YT(N,J)*CFACT2
                                   Y(N,2) =  Y(N,2)*CFACT2
                                   ENDIF
                  ENDIF
  630 CONTINUE
      CALL CURVE(X,Y,NPT,2,KPLOT(MT),KMEAS(MT))
      IF(J.EQ.1) THEN
                 USE = 'FLOW'
                 ELSE
                 IF(NLOAD(J).EQ.0) USE = 'CONC'
                 IF(NLOAD(J).EQ.1) USE = 'LOAD'
                 ENDIF
      KP = IPOLX(J)
      IF(KP.EQ.0) KP = 1
      CALL HYSTAT(X,Y,NPT,2,KPLOT(MT),KMEAS(MT),TRIBA,METRIC,
     +                                USE,PUNIT(KP),PNAME(KP))
C=======================================================================
C     PLOT PREDICTED GRAPHS ONLY.
C     CONVERT PREDICTED POLLUTOGRAPHS TO CONCENTRATION FROM CFS*CONC.
C=======================================================================
      IF(ITAB(MT).EQ.0) GO TO 820
 6000 IF(MTAB(MT).EQ.0.OR.(J.GT.1.AND.NLOAD(J).GT.0)) THEN
                        IF(J.EQ.1) THEN
                                   USE = 'FLOW'
                                   ELSE
                                   IF(NLOAD(J).EQ.0) USE = 'CONC'
                                   IF(NLOAD(J).EQ.1) USE = 'LOAD'
                                   ENDIF
                        NN       = NPT(1)
                        SUMFLW   = 0.0
                        DO 930 N = 1,NN
                        IF(J.EQ.1) THEN
Cwch, 9/14/00.  Interface file flows already metric, from Runoff & Transp.
C                                  Y(N,1) = YT(N,J)/CMET(1,METRIC)**3.0
                                   Y(N,1) = YT(N,J)
                                   SUMFLW = SUMFLW + Y(N,1)
                                   GO TO 930
                                   ENDIF
                        IF(NLOAD(J).EQ.0) THEN
                           IF(YT(N,1).GT.0.0) Y(N,1) = YT(N,J)/YT(N,1)
                           ELSE
                           IF(NDIM(J).EQ.0) THEN
                                      Y(N,1) = YT(N,J)*CFACT1
                                      Y(N,2) =  Y(N,2)*CFACT1
                                      ELSE
                                      Y(N,1) = YT(N,J)*CFACT2
                                      Y(N,2) =  Y(N,2)*CFACT2
                                      ENDIF
                           ENDIF
  930                   CONTINUE
C=======================================================================
C                       PLOT ONLY THE PREDICTED DATA USING CURVE
C=======================================================================
                        IF(J.EQ.1.AND.SUMFLW.EQ.0.0) THEN
                        IF(JCE.EQ.0) WRITE(N6,9040) JPLOT(MT),NPT(1)
                        IF(JCE.EQ.1) WRITE(N6,9041) JMEAS(MT),NPT(1)
                        ELSE
                        CALL CURVE(X,Y,NPT,1,JPLOT(MT),JMEAS(MT))
                        IF(J.EQ.1) THEN
                                   USE = 'FLOW'
                                   ELSE
                                   IF(NLOAD(J).EQ.0) USE = 'CONC'
                                   IF(NLOAD(J).EQ.1) USE = 'LOAD'
                                   ENDIF
                        KP = IPOLX(J)
                        IF(KP.EQ.0) KP = 1
                        CALL HYSTAT(X,Y,NPT,1,JPLOT(MT),JMEAS(MT),TRIBA,
     +                       METRIC,USE,PUNIT(KP),PNAME(KP))
                        ENDIF
                        ENDIF
  820 CONTINUE
C=======================================================================
C     IF MORE THAN 201 DATA POINTS ARE ON THE INTERFACE FILE
C     RETURN AND CONTINUE PLOTTING THE HYDROGRAPHS AND POLLUTOGRAPHS
C=======================================================================
      IF(IBACK.GE.1.AND.NOTEND) THEN
                                N = 0
                                GO TO 5000
                                ENDIF
  800 CONTINUE
C=======================================================================
   10 FORMAT(/,
     +' ***************************************************',/,
     +' * ENTRY TO GRAPH BLOCK. LAST UPDATED AUGUST 1993. *',/,
     +' * "All art is quite useless."                     *',/,
     +' *                             Oscar Wilde (1891)  *',/,
     +' ***************************************************',/)
C#### WCH, 8/5/93
   12 FORMAT(/,
     +' ***************************************************',/,
     +' * ENTRY TO GRAPH BLOCK. LAST UPDATED AUGUST 1993. *',/,
     +' ***************************************************',/)
   30 FORMAT(/,' INPUT PARAMETER SUMMARY:',//,
     1 ' NUMBER OF OFF-LINE FILE OF PREDICTED DATA(NTAPE)....',I3,/,
     2 ' FLOW ORDINATE IN CFS (=0) OR CU M/S (=1) (METRIC)...',I3,/,
     3 ' NUMBER OF POLLUTOGRAPHS TO BE PLOTTED (NQP).........',I3,/,
     4 ' NUMBER OF LOCATIONS FOR PREDICTED PLOTS(NPLOT)......',I3,/,
     5 ' INDICATING MEASURED DATA AND THEIR STORAGE(MEAS)....',I3,/,
     6 ' FILE NUMBER FOR RETRIEVAL OF MEASURED DATA(MFILE)...',I3,/,
     7 ' NUMBER OF LOCATIONS FOR MEASURED DATA(MPLOT)........',I3,/,
     8 ' SKIP MCTH VALUES ON INTERFACE FILE..................',I3)
   34 FORMAT(/,' PLOTTING ',I5,' LOCATIONS',/,' PLOTTING GRAPH # ',/)
   35 FORMAT('+',I16)
   40 FORMAT(//,' PREDICTED GRAPHS ARE TO BE PLOTTED FOR THE FOLLOWING
     1 ',I4,' LOCATIONS :',//,10I11,/,10I11)
   41 FORMAT(//,' PREDICTED GRAPHS ARE TO BE PLOTTED FOR THE FOLLOWING
     1 ',I4,' LOCATIONS :',//,10A11,/,10A11)
   55 FORMAT(/,' MEASURED GRAPHS ARE TO BE PLOTTED FOR THE FOLLOWING ',
     1I4,' LOCATIONS :',//,10I11,/,10I11)
   56 FORMAT(/,' MEASURED GRAPHS ARE TO BE PLOTTED FOR THE FOLLOWING ',
     1I4,' LOCATIONS :',//,10A11,/,10A11)
  310 FORMAT(//,1X,A14,
     1 ' DATA GROUP E1 INPUT PARAMETERS FOR LOCATION ',I5,' ARE:',/,
     2' MDATA = ',I10,'     LCARD = ',I10,  '    MTIME = ',I10,/,
     2' MUNIT = ',I10,'    TMZERO = ',F10.4,'    TQUIT = ',F10.4,/,
     3' DTMHR = ',F10.4)
  360 FORMAT(/,' INPUT FORMAT FOR THESE DATA IS: ',A80)
  505 FORMAT(I6,' MEASURED DATA POINTS READ IN.')
  520 FORMAT(/,' ===> WARNING! MTIME=',I5,', GT 401. NOT ALLOWED.',
     1 '  MTIME WILL BE SET = 401.')
Cwch, 9/16/00
 3800 FORMAT(' ERROR. MFILE =',I4,' NSCRAT(8) =',I4,'. SHOULD BE EQUAL.'
     1,/,' WILL TRY SETTING MFILE = NSCRAT(8), IF NON-ZERO.',/,
     2   ' OTHERWISE, RUN WILL STOP, BELOW.')
 3810 FORMAT(' ERROR. MFILE =',I4,' NSCRAT(8) =',I4,'. SHOULD BE EQUAL.'
     1,/,' WILL TRY SETTING MFILE = NSCRAT(8), IF NON-ZERO.',/,
     2   ' OTHERWISE, CANNOT READ E3 DATA AND RUN WILL STOP.')
Cwch, 9/14/00.  
 3885 FORMAT(/,' ERROR READING E3 LINES.  RUN STOPPED.',/,
     1 ' OFFENDING E3 LINE IS NUMBER',I6)
 4090 FORMAT(/,
     1' ****************************************',/,
     1' *  QUALITY CONSTITUENTS TO BE GRAPHED  *',/,
     1' ****************************************',//,
     1 '                       TYPE OF   INTERFACE FILE',/,
     3 ' NO.  NAME     UNITS    UNITS   POSITION (IF ANY) PLOT',
     3 ' DESCRIPTION',/,
     4 ' --- -----     -----    -----   ----------------------',
     5 '------------')
 4150 FORMAT(I3,2X,A8,2X,A8,I6,I13,A30)
 9020 FORMAT(/,' ===> ERROR  LOCATION: ',I10,' WAS NOT FOUND ON THE ',
     +                                      'INTERFACE FILE.')
 9021 FORMAT(/,' ===> ERROR  LOCATION: ',A10,' WAS NOT FOUND ON THE ',
     +                                      'INTERFACE FILE.')
 9040 FORMAT(/,' ===> HYDROGRAPH FOR LOCATION ',I10,' WITH ',I5,
     + ' POINTS',/,'      WAS NOT PLOTTED BECAUSE THE FLOW WAS ZERO.')
 9041 FORMAT(/,' ===> HYDROGRAPH FOR LOCATION ',A10,' WITH ',I5,
     + ' POINTS', /,'      WAS NOT PLOTTED BECAUSE THE FLOW WAS ZERO.')
C#### WCH, 8/5/93
 9500 FORMAT(/,' ===> ERROR. FOR NTAPE > 0, NTAPE MUST EQUAL JIN.',/,
     + '     NTAPE =',I5,'  JIN =',I5,'  COUNTER (INCNT) =',I5)
C=======================================================================
      RETURN
  888 CALL IERROR
      END

Saturday, July 1, 2017

#Inside_SWMM5 A look at the three Froude Numbers in a #SWMM5 Link

Introduction – the reason for these series of blogs are as an expanded view of the input, engine and output of #SWMM5  It is a companion to the EPA Documentation which I describe here:

I have noticed based on email questions and postings to the SWMM List Sever (a great resource hosted by CHI, Inc.) that many SWMM 5 users do not know about the really outstanding documentation on SWMM 5 posted on the EPA Website https://www.epa.gov/water-research/storm-water-management-model-swmm It consists of two now and in the near future three volumes on Hydrology, Water Quality, LID's and SuDs and Hydraulics. The documentation is fantastically complete with detailed background on the theory, process parameters and completely worked out examples for all of the processes in SWMM5. It is truly an outstanding aid to modelers and modellers worldwide. It would benefit you to read them (if you have not already downloaded the PDF files)

This blog shows the three Froude Numbers in a link in SWMM5.  The Froude number is computed at the middle of the link but there are actually three computation points in a SWMM5 link – upstream, middle and downstream.

The Froude number is computed at the middle of the link but there are actually three computation points in a SWMM5 link – upstream, middle and downstream


Wednesday, June 28, 2017

#SWMM5 Embarcadero® Delphi XE7 Options #1

If you want to change the number of recent files in the #SWMM5 Embarcadero® Delphi XE7 code go to Uglobals.pas and change the number of files

MAXMRUINDEX   = 25; //Max. index of Most Recently Used files

MAXMRUINDEX   = 25; //Max. index of Most Recently Used files

Sunday, June 25, 2017

How to Model Tracers for RDII, Runoff, GW and DWF in #SWMM5, #InfoSWMM and #PCSWMM

A quick note:  A really nice feature of the way #SWMM5 models water quality is the easy ability to model tracers for the contribution of the major processes.  You can set up a concentration of 100 (for example) for DWF, RDII Flow, Runoff and Groundwater to find the percentage contribution of the process in link flow.  For example, if you model RDII using the RTK UH procedure the percentage of the RDII Water Quality Constituent is the flow from the upstream RDII nodes.  This technique can be used to show how important DWF, Separate Sewersheds and Combined Sewersheds to the WWTP flow or Outfall flow.

The following two images are from the Innovyze Products InfoSWMM and InfoSWMM SA

Figure 1.  How to add a Tracer Concentration for RDII, DWF, GW and Runoff


Figure 2.  RDII Concentration is the Percentage Contribution from RDII for the Linke Flow.

The Goal of SWMM5 Input Files

 ðŸŒŸ SWMM5 (Storm Water Management Model 5) is a widely used urban hydrology and hydraulic modeling software developed by the United States E...