forked from WikiWatershed/gwlf-e
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathParser.py
2098 lines (1892 loc) · 82.4 KB
/
Parser.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# -*- coding: utf-8 -*-
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import csv
import logging
import re
from numpy import zeros
from .AFOS.GrazingAnimals.Loads.InitGrN import InitGrN_f
from .AFOS.GrazingAnimals.Losses.GRLBN_2 import GRLBN_2
from .AFOS.GrazingAnimals.Losses.GRStreamN import AvGRStreamN_f
from .AFOS.nonGrazingAnimals.Loads.InitNgN import InitNgN_f
from .AFOS.nonGrazingAnimals.Losses.NGLostBarnNSum import NGLostBarnNSum
from .Input.WaterBudget.AntMoist import AntMoist
from .Input.WaterBudget.SatStorCarryOver import SatStorCarryOver_f
from .Input.WaterBudget.UnSatStorCarryover import UnSatStorCarryover_f
from .MultiUse_Fxns.Runoff.CNI import CNI_f
from .MultiUse_Fxns.Runoff.CNP import CNP_f
from .Output.AvAnimalNSum.N7b_2 import N7b_2
from .datamodel import DataModel
from .enums import YesOrNo, ETflag, GrowFlag, LandUse, SweepType
log = logging.getLogger(__name__)
EOL = '<EOL>'
def iterate_csv_values(fp):
"""
Yield values as a continuous stream for each line in a
file-like object.
"""
reader = csv.reader(fp)
line_no = 1
for line in reader:
col_no = 1
for value in line:
yield value, line_no, col_no
col_no += 1
yield EOL, line_no, col_no
line_no += 1
class GmsReader(object):
def __init__(self, fp):
self.fp = iterate_csv_values(fp)
def read(self):
z = DataModel()
# AFOs loss rate coefficients
z.NgAWMSCoeffN = 0.14
z.NgAWMSCoeffP = 0.14
z.GrAWMSCoeffN = 0.75
z.GrAWMSCoeffP = 0.75
z.RunConCoeffN = 0.15
z.RunConCoeffP = 0.15
z.PhytaseCoeff = 0.16
z.AvGRStreamFC = 0
z.AvGRStreamP = 0
z.d = zeros(12)
z.KVD = zeros(12)
z.CV = zeros(12)
z.AreaE = zeros(16)
z.KLSCP = zeros(16)
z.UrbanNitr = zeros(16)
z.UrbanPhos = zeros(16)
z.AvStreamFlow = zeros(12)
z.AvPrecipitation = zeros(12)
z.AFON = zeros(12)
z.AFOP = zeros(12)
z.AvLoad = zeros((12, 3))
z.AvLuLoad = zeros((16, 3))
z.AvDisLoad = zeros((16, 3))
z.AvLuDisLoad = zeros((16, 3))
z.AvGroundNitr = zeros(12)
z.AvGroundPhos = zeros(12)
z.AvDisNitr = zeros(12)
z.AvTotNitr = zeros(12)
z.AvDisPhos = zeros(12)
z.AvTotPhos = zeros(12)
z.AvLuRunoff = zeros(16)
z.AvLuErosion = zeros(16)
z.AvLuSedYield = zeros(16)
z.AvLuDisNitr = zeros(16)
z.AvLuTotNitr = zeros(16)
z.AvLuDisPhos = zeros(16)
z.AvLuTotPhos = zeros(16)
z.BSed = zeros(16)
z.UrbanSed = zeros(16)
z.UrbanErosion = zeros(16)
z.QRunoff = zeros((16, 12))
z.AgQRunoff = zeros((16, 12))
z.DailyLoad = zeros((50, 12, 31))
z.SepticsDay = zeros(12)
z.MonthlyLoad = zeros((12, 31))
# Declare the daily values as ReDimensional arrays in
# to Pesticide components
z.DayPondNitr = zeros((12, 31))
z.DayPondPhos = zeros((12, 31))
z.DayNormNitr = zeros((12, 31))
z.DayNormPhos = zeros((12, 31))
z.DayShortNitr = zeros((12, 31))
z.DayShortPhos = zeros((12, 31))
z.DayDischargeNitr = zeros((12, 31))
z.DayDischargePhos = zeros((12, 31))
z.PestAppMonth1 = zeros(16)
z.PestAppYear1 = zeros(16)
z.PestAppDate1 = zeros(16)
z.PestAppMonth2 = zeros(16)
z.PestAppYear2 = zeros(16)
z.PestAppDate2 = zeros(16)
z.PestShedName = zeros(12)
z.PestCropArea = zeros(12)
z.PestSoilBd = zeros(12)
z.PestSoilAwc = zeros(12)
z.PestSoilOm = zeros(12)
z.PestCropName = zeros(12)
z.PestName1 = zeros(16)
z.PestRate1 = zeros(31)
z.PestParamCarbon1 = zeros(16)
z.PestParamWater1 = zeros(16)
z.PestDecay1 = zeros(16)
z.PestHalfLife1 = zeros(16)
z.PestName2 = zeros(16)
z.PestRate2 = zeros(31)
z.PestParamCarbon2 = zeros(16)
z.PestParamWater2 = zeros(16)
z.PestDecay2 = zeros(16)
z.PestHalfLife2 = zeros(16)
z.AvStreamBankP = zeros(12)
z.CropPercent = zeros(12)
z.PestSoilAwcCm = zeros(12)
# Tile Drainage and Flow Variables
z.AvTileDrainN = zeros(12)
z.AvTileDrainP = zeros(12)
z.AvTileDrainSed = zeros(12)
z.AvPtSrcFlow = zeros(12)
# Calculated Values for Animal Feeding Operations
z.NGLoadP = zeros(9)
z.NGLoadFC = zeros(9)
z.NGAccManAppP = zeros(12)
z.NGAccManAppFC = zeros(12)
z.NGAppManP = zeros(12)
z.NGInitBarnP = zeros(12)
z.NGAppManFC = zeros(12)
z.NGInitBarnFC = zeros(12)
z.GRLoadP = zeros(9)
z.GRLoadFC = zeros(9)
z.GRAccManAppP = zeros(12)
z.GRAccManAppFC = zeros(12)
z.GRAppManP = zeros(12)
z.GRInitBarnP = zeros(12)
z.GRAppManFC = zeros(12)
z.GRInitBarnFC = zeros(12)
z.GrazingP = zeros(12)
z.GrazingFC = zeros(12)
z.GRStreamN = zeros(12)
z.GRStreamP = zeros(12)
z.GRStreamFC = zeros(12)
z.AvAnimalP = zeros(12)
z.AvAnimalFC = zeros(12)
z.AvWWOrgs = zeros(12)
z.AvSSOrgs = zeros(12)
z.AvUrbOrgs = zeros(12)
z.AvWildOrgs = zeros(12)
z.AvTotalOrgs = zeros(12)
z.AvCMStream = zeros(12)
z.AvOrgConc = zeros(12)
z.AvGRLostBarnP = zeros(12)
z.AvNGLostBarnP = zeros(12)
z.AvNGLostManP = zeros(12)
z.AvNGLostBarnFC = zeros(12)
z.AvGRLostBarnFC = zeros(12)
z.SweepFrac = zeros(12)
z.q = 0
z.k = 0
z.OutFiltWidth = 0
z.Clean = 0
z.CleanSwitch = 0
z.OutletCoef = 0
z.BasinVol = 0
z.Volume = 0
z.ActiveVol = 0
z.DetentFlow = 0
z.AnnDayHrs = 0
z.FrozenPondNitr = 0
z.FrozenPondPhos = 0
z.AvSeptNitr = 0
z.AvSeptPhos = 0
z.ForestAreaTotal = 0
# Referenced in LoadReductions
# Mostly initialized in PublicVariables.bas
z.SMCheck = 'Both'
z.n5dn = 0
z.n12dp = 0
z.n13dp = 0
z.n6dn = 0
z.n6bdn = 0
z.n6cdn = 0
z.n13bdp = 0
z.n13cdp = 0
z.RetentEff = 0
# Line 1:
z.NRur = self.next(int) # Number of Rural Land Use Categories
z.NUrb = self.next(int) # Number Urban Land Use Categories
z.BasinId = self.next(int) # Basin ID
self.next(EOL)
# Line 2:
z.TranVersionNo = self.next(str) # GWLF-E Version
z.RecessionCoef = self.next(float) # Recession Coefficient
z.SeepCoef = self.next(float) # Seepage Coefficient
z.UnsatStor_0 = self.next(float) # Unsaturated Storage
z.SatStor_0 = self.next(float) # Saturated Storage
z.InitSnow_0 = self.next(int) # Initial Snow Days
z.SedDelivRatio_0 = self.next(float) # Sediment Delivery Ratio
z.MaxWaterCap = self.next(float) # Average Available Water Capacity
z.StreamLength = self.next(float) # Total Stream Length (meters)
z.AgLength = self.next(float) # Agricultural Stream Length (meters)
z.UrbLength = self.next(float) # Urban Stream Length (meters)
z.AgSlope3 = self.next(float) # Area of agricultural land with slope > 3%
z.AgSlope3to8 = self.next(float) # Area of agricultural land with slope > 3% and < 8%
z.AvSlope = self.next(float) # Average % Slope
z.AEU = self.next(float) # Number of Animal Units
z.WxYrs = self.next(int) # Total Weather Years
z.WxYrBeg = self.next(int) # Beginning Weather Year
z.WxYrEnd = self.next(int) # Ending Weather Year
z.SedAFactor_0 = self.next(float) # Sediment A Factor
z.TotArea = self.next(float) # Total Basin Area (Ha)
z.TileDrainRatio = self.next(float) # Tile Drain Ratio
z.TileDrainDensity = self.next(float) # Tile Drain Density
z.ETFlag = self.next(ETflag.parse) # ET Flag
z.AvKF = self.next(float) # Average K Factor
self.next(EOL)
z.NYrs = z.WxYrs
# TODO: Remove DimYrs
z.DimYrs = z.WxYrs
z.UplandN = zeros((z.DimYrs, 12))
z.UplandP = zeros((z.DimYrs, 12))
z.UrbRunoffCm = zeros((z.DimYrs, 12))
z.DailyFlowMGD = zeros((z.DimYrs, 12, 31))
z.DailyPtSrcFlow = zeros((z.DimYrs, 12, 31))
# Declare the daily values as ReDimensional arrays in
# to Pesticide components
z.DailyUplandSed = zeros((z.DimYrs, 12, 31))
z.DailyUplandN = zeros((z.DimYrs, 12, 31))
z.DailyUplandP = zeros((z.DimYrs, 12, 31))
z.DailyTileDrainN = zeros((z.DimYrs, 12, 31))
z.DailyTileDrainP = zeros((z.DimYrs, 12, 31))
z.DailyStrmSed = zeros((z.DimYrs, 12, 31))
z.DailySepticN = zeros((z.DimYrs, 12, 31))
z.DailySepticP = zeros((z.DimYrs, 12, 31))
z.DailyStrmN = zeros((z.DimYrs, 12, 31))
z.DailyStrmP = zeros((z.DimYrs, 12, 31))
z.DailyGroundN = zeros((z.DimYrs, 12, 31))
z.DailyGroundP = zeros((z.DimYrs, 12, 31))
z.DayGroundNitr = zeros((z.DimYrs, 12, 31))
z.DayGroundPhos = zeros((z.DimYrs, 12, 31))
z.DayDisPhos = zeros((z.DimYrs, 12, 31))
z.DayDisNitr = zeros((z.DimYrs, 12, 31))
z.DayTotNitr = zeros((z.DimYrs, 12, 31))
z.DailyPointN = zeros((z.DimYrs, 12, 31))
z.DailyPointP = zeros((z.DimYrs, 12, 31))
z.DayTotPhos = zeros((z.DimYrs, 12, 31))
z.DayLuTotN = zeros((16, z.DimYrs, 12, 31))
z.DayLuTotP = zeros((16, z.DimYrs, 12, 31))
z.DayLuDisN = zeros((16, z.DimYrs, 12, 31))
z.DayLuDisP = zeros((16, z.DimYrs, 12, 31))
z.DayErWashoff = zeros((16, z.DimYrs, 12, 31))
z.Perc = zeros((z.DimYrs, 12, 31))
z.DeepFlow = zeros((z.DimYrs, 12, 31))
z.DayQRunoff = zeros((z.DimYrs, 12, 31))
z.SdYld = zeros((z.DimYrs, 12, 31))
z.Erosn = zeros((z.DimYrs, 12, 31))
z.DayErosion = zeros((z.DimYrs, 12, 31))
z.DayLuErosion = zeros((16, z.DimYrs, 12, 31))
z.DaySed = zeros((z.DimYrs, 12, 31))
z.DayLuSed = zeros((16, z.DimYrs, 12, 31))
z.DayLuRunoff = zeros((16, z.DimYrs, 12, 31))
z.PrecPest = zeros((z.DimYrs, 12, 31))
z.DailyETCm = zeros((z.DimYrs, 12, 31))
z.DailyETShal = zeros((z.DimYrs, 12, 31))
z.PercShal = zeros((z.DimYrs, 12, 31))
z.DailyUnsatStorCm = zeros((z.DimYrs, 12, 31))
z.DailyUnsatStorShal = zeros((z.DimYrs, 12, 31))
z.DailyET = zeros((z.DimYrs, 12, 31))
z.DailyRetent = zeros((z.DimYrs, 12, 31))
z.SatStorPest = zeros((z.DimYrs, 12, 31))
z.DailyInfilt = zeros((z.DimYrs, 12, 31))
z.StreamBankP = zeros((z.DimYrs, 12))
z.LuGrFlow = zeros((16, z.DimYrs, 12, 31))
z.LuDeepSeep = zeros((16, z.DimYrs, 12, 31))
z.LuInfiltration = zeros((16, z.DimYrs, 12, 31))
z.PestTemp = zeros((z.DimYrs, 12, 31))
z.PestPrec = zeros((z.DimYrs, 12, 31))
# Tile Drainage and Flow Variables
z.TileDrainN = zeros((z.DimYrs, 12))
z.TileDrainP = zeros((z.DimYrs, 12))
z.TileDrainSed = zeros((z.DimYrs, 12))
z.GroundNitr = zeros((z.DimYrs, 12))
z.GroundPhos = zeros((z.DimYrs, 12))
z.DisNitr = zeros((z.DimYrs, 12))
z.SepticN = zeros((z.DimYrs, 12))
z.SepticP = zeros((z.DimYrs, 12))
z.TotNitr = zeros((z.DimYrs, 12))
z.DisPhos = zeros((z.DimYrs, 12))
z.TotPhos = zeros((z.DimYrs, 12))
z.LuSedYield = zeros((z.DimYrs, 16))
z.LuDisNitr = zeros((z.DimYrs, 16))
z.LuTotNitr_2 = zeros((z.DimYrs, 16))
z.LuDisPhos = zeros((z.DimYrs, 16))
z.LuTotPhos_1 = zeros((z.DimYrs, 16))
z.SepticNitr = zeros(z.DimYrs)
z.SepticPhos = zeros(z.DimYrs)
# ANIMAL FEEDING OPERATIONS VARIABLES
z.DailyAnimalN = zeros((z.DimYrs, 12, 31))
z.DailyAnimalP = zeros((z.DimYrs, 12, 31))
# Calculated Values for Animal Feeding Operations
z.NGLostManN = zeros((z.DimYrs, 12))
z.NGLostBarnN = zeros((z.DimYrs, 12))
z.NGLostManP = zeros((z.DimYrs, 12))
z.NGLostBarnP = zeros((z.DimYrs, 12))
z.NGLostManFC = zeros((z.DimYrs, 12))
z.NGLostBarnFC = zeros((z.DimYrs, 12))
z.GRLostBarnN = zeros((z.DimYrs, 12))
z.GRLossN = zeros((z.DimYrs, 12))
z.GRLostManP = zeros((z.DimYrs, 12))
z.GRLostBarnP = zeros((z.DimYrs, 12))
z.GRLossP = zeros((z.DimYrs, 12))
z.GRLostManFC = zeros((z.DimYrs, 12))
z.GRLostBarnFC = zeros((z.DimYrs, 12))
z.GRLossFC = zeros((z.DimYrs, 12))
z.AnimalP = zeros((z.DimYrs, 12))
z.AnimalFC = zeros((z.DimYrs, 12))
z.WWOrgs = zeros((z.DimYrs, 12))
z.SSOrgs = zeros((z.DimYrs, 12))
z.UrbOrgs = zeros((z.DimYrs, 12))
z.WildOrgs = zeros((z.DimYrs, 12))
z.TotalOrgs = zeros((z.DimYrs, 12))
z.CMStream = zeros((z.DimYrs, 12))
z.OrgConc = zeros((z.DimYrs, 12))
z.StreamBankPSum = zeros(z.WxYrs)
z.StreamBankErosSum = zeros(z.WxYrs)
z.StreamBankPSum = zeros(z.WxYrs)
z.GroundNitrSum = zeros(z.WxYrs)
z.GroundPhosSum = zeros(z.WxYrs)
z.TileDrainSum = zeros(z.WxYrs)
z.TileDrainNSum = zeros(z.WxYrs)
z.TileDrainPSum = zeros(z.WxYrs)
z.TileDrainSedSum = zeros(z.WxYrs)
z.AnimalNSum = zeros(z.WxYrs)
z.AnimalPSum = zeros(z.WxYrs)
z.AnimalFCSum = zeros(z.WxYrs)
z.WWOrgsSum = zeros(z.WxYrs)
z.SSOrgsSum = zeros(z.WxYrs)
z.UrbOrgsSum = zeros(z.WxYrs)
z.WildOrgsSum = zeros(z.WxYrs)
z.TotalOrgsSum = zeros(z.WxYrs)
z.GRLostBarnPSum = zeros(z.WxYrs)
z.GRLostBarnFCSum = zeros(z.WxYrs)
z.NGLostBarnPSum = zeros(z.WxYrs)
z.NGLostBarnFCSum = zeros(z.WxYrs)
z.NGLostManPSum = zeros(z.WxYrs)
z.TotNitrSum = zeros(z.WxYrs)
z.TotPhosSum = zeros(z.WxYrs)
# Set the Total AEU to the value from the Animal Density layer
if not self.version_match(z.TranVersionNo, '1.[0-9].[0-9]'):
raise Exception('Input data file is not in the correct format or is no longer supported')
# Lines 3 - 7: (each line represents 1 day)
# Antecedent Rain + Melt Moisture Condition for Days 1 to 5
z.AntMoist = zeros(5)
z.AntMoist_0 = zeros(5)
for i in range(5):
z.AntMoist_0[i] = self.next(float)
self.next(EOL)
# Lines 8 - 19: (each line represents 1 month)
z.Month = zeros(12, dtype=object)
z.KV = zeros(12)
z.DayHrs = zeros(12)
z.Grow_0 = zeros(12, dtype=object)
z.Acoef = zeros(12)
z.StreamWithdrawal = zeros(12)
z.GroundWithdrawal = zeros(12)
z.PcntET = zeros(12)
for i in range(12):
z.Month[i] = self.next(str) # Month (Jan - Dec)
z.KV[i] = self.next(float) # KET (Flow Factor)
z.DayHrs[i] = self.next(float) # Day Length (hours)
z.Grow_0[i] = self.next(GrowFlag.parse) # Growing season flag
z.Acoef[i] = self.next(float) # Erosion Coefficient
z.StreamWithdrawal[i] = self.next(float) # Surface Water Withdrawal/Extraction
z.GroundWithdrawal[i] = self.next(float) # Groundwater Withdrawal/Extraction
z.PcntET[i] = self.next(float) # Percent monthly adjustment for ET calculation
self.next(EOL)
# Lines 20 - 29: (for each Rural Land Use Category)
for i in range(z.NRur):
z.Landuse[i] = self.next(LandUse.parse) # Rural Land Use Category
z.Area[i] = self.next(float) # Area (Ha)
z.CN[i] = self.next(float) # Curve Number
z.KF[i] = self.next(float) # K Factor
z.LS[i] = self.next(float) # LS Factor
z.C[i] = self.next(float) # C Factor
z.P[i] = self.next(float) # P Factor
self.next(EOL)
# Lines 30 - 35: (for each Urban Land Use Category)
z.Imper = zeros(z.NLU)
z.TotSusSolids = zeros(z.NLU)
z.CNI_0 = zeros((3, z.NLU))
z.CNP_0 = zeros((3, z.NLU))
for i in range(z.NRur, z.NLU):
z.Landuse[i] = self.next(LandUse.parse) # Urban Land Use Category
z.Area[i] = self.next(float) # Area (Ha)
z.Imper[i] = self.next(float) # Impervious Surface %
z.CNI_0[1][i] = self.next(float) # Curve Number(Impervious Surfaces)
z.CNP_0[1][i] = self.next(float) # Curve Number(Pervious Surfaces)
z.TotSusSolids[i] = self.next(float) # Total Suspended Solids Factor
self.next(EOL)
# Line 36:
z.PhysFlag = self.next(YesOrNo.parse) # Physiographic Province Layer Detected
z.PointFlag = self.next(YesOrNo.parse) # Point Source Layer Detected
z.SeptSysFlag = self.next(YesOrNo.parse) # Septic System Layer Detected
z.CountyFlag = self.next(YesOrNo.parse) # County Layer Detected
z.SoilPFlag = self.next(YesOrNo.parse) # Soil P Layer Detected
z.GWNFlag = self.next(YesOrNo.parse) # Groundwater N Layer Detected
z.SedAAdjust = self.next(float) # Default Percent ET
self.next(EOL)
# Line 37:
z.SedNitr = self.next(float) # Soil Concentration: N (mg/l)
z.SedPhos = self.next(float) # Soil Concentration: P (mg/l)
z.GrNitrConc = self.next(float) # Groundwater Concentration: N (mg/l)
z.GrPhosConc = self.next(float) # Groundwater Concentration: P (mg/l)
z.BankNFrac = self.next(float) # % Bank N Fraction (0 - 1)
z.BankPFrac = self.next(float) # % Bank P Fraction (0 - 1)
self.next(EOL)
# Line 38:
z.ManuredAreas = self.next(int) # Manure Spreading Periods (Default = 2)
z.FirstManureMonth = self.next(int) # MS Period 1: First Month
z.LastManureMonth = self.next(int) # MS Period 1: Last Month
z.FirstManureMonth2 = self.next(int) # MS Period 2: First Month
z.LastManureMonth2 = self.next(int) # MS Period 2: Last Month
self.next(EOL)
# Convert 1-based indexes to 0-based.
z.FirstManureMonth -= 1
z.FirstManureMonth2 -= 1
z.LastManureMonth -= 1
z.LastManureMonth2 -= 1
# Lines 39 - 48: (for each Rural Land Use Category)
z.NitrConc = zeros(16)
z.PhosConc = zeros(16)
for i in range(z.NRur):
z.NitrConc[i] = self.next(float) # Dissolved Runoff Coefficient: N (mg/l)
z.PhosConc[i] = self.next(float) # Dissolved Runoff Coefficient: P (mg/l)
self.next(EOL)
# Line 49:
z.Nqual = self.next(int) # Number of Contaminants (Default = 3; Nitrogen, Phosphorus, Sediment)
self.next(EOL)
# Lines 50 - 52:
z.Contaminant = zeros(z.Nqual, dtype=object)
z.SolidBasinMass = zeros(z.Nqual)
z.DisBasinMass = zeros(z.Nqual)
for i in range(z.Nqual):
z.Contaminant[i] = self.next(str)
self.next(EOL)
# Lines 53 - 58 (for each Urban Land Use Category, Nitrogen Contaminant)
# Lines 59 - 64: (for each Urban Land Use Category, Phosphorus Contaminant)
# Lines 65 - 70: (for each Urban Land Use Category, Sediment Contaminant)
z.LoadRateImp = zeros((z.NLU, z.Nqual))
z.LoadRatePerv = zeros((z.NLU, z.Nqual))
z.DisFract = zeros((z.NLU, z.Nqual))
z.UrbBMPRed = zeros((z.NLU, z.Nqual))
for u in range(z.NRur, z.NLU):
for q in range(z.Nqual):
z.LoadRateImp[u][q] = self.next(float) # Loading Rate Impervious Surface
z.LoadRatePerv[u][q] = self.next(float) # Loading Rate Pervious Surface
z.DisFract[u][q] = self.next(float) # Dissolved Fraction
z.UrbBMPRed[u][q] = self.next(float) # Urban BMP Reduction
self.next(EOL)
z.ManNitr = zeros(z.ManuredAreas)
z.ManPhos = zeros(z.ManuredAreas)
# Lines 71 - 72: (for the 2 Manure Spreading Periods)
for i in range(z.ManuredAreas):
z.ManNitr[i] = self.next(float) # Manured N Concentration
z.ManPhos[i] = self.next(float) # Manured P Concentration
self.next(EOL)
# Lines 73 - 84: (Point Source data for each Month)
z.PointNitr = zeros(12)
z.PointPhos = zeros(12)
z.PointFlow = zeros(12)
for i in range(12):
z.PointNitr[i] = self.next(float) # N Load (kg)
z.PointPhos[i] = self.next(float) # P Load (kg)
z.PointFlow[i] = self.next(float) # Discharge (Millions of Gallons per Day)
self.next(EOL)
# Line 85:
z.SepticFlag = self.next(YesOrNo.parse) # Flag: Septic Systems Layer Detected (0 No; 1 Yes)
self.next(EOL)
# Lines 86 - 97: (Septic System data for each Month)
for i in range(12):
z.NumNormalSys[i] = self.next(int) # Number of People on Normal Systems
z.NumPondSys[i] = self.next(int) # Number of People on Pond Systems
z.NumShortSys[i] = self.next(int) # Number of People on Short Circuit Systems
z.NumDischargeSys[i] = self.next(int) # Number of People on Discharge Systems
z.NumSewerSys[i] = self.next(int) # Number of People on Public Sewer Systems
self.next(EOL)
# Line 98: (if Septic System flag = 1)
if z.SepticFlag == YesOrNo.YES:
z.NitrSepticLoad = self.next(float) # Per Capita Tank Load: N (g/d)
z.PhosSepticLoad = self.next(float) # Per Capita Tank Load: P (g/d)
z.NitrPlantUptake = self.next(float) # Growing System Uptake: N (g/d)
z.PhosPlantUptake = self.next(float) # Growing System Uptake: P (g/d)
self.next(EOL)
else:
raise Exception('SepticFlag must be set to 1')
# Line 99:
z.TileNconc = self.next(float) # Tile Drainage Concentration: N (mg/L)
z.TilePConc = self.next(float) # Tile Drainage Concentration: P (mg/L)
z.TileSedConc = self.next(float) # Tile Drainage Concentration: Sediment (mg/L)
self.next(EOL)
# Line 100: (variables passed through GWLF-E to PRedICT)
z.InName = self.next(str) # Scenario Run Name
z.UnitsFileFlag = self.next(int) # Units Flag (Default = 1)
z.AssessDate = self.next(str) # Assessment/Reference Date (mmyyyy)
z.VersionNo = self.next(str) # GWLF-E Version Number
self.next(EOL)
# Line 101: (variable passed through GWLF-E to PRedICT)
z.ProjName = self.next(str) # Project Name
self.next(EOL)
# Line 102: (Estimated Load by Land Use/Source – Total Sediment (kg x 1000))
z.n1 = self.next(float) # Row Crops
z.n2 = self.next(float) # Hay/Pasture
z.n2b = self.next(float) # High Density Urban
z.n2c = self.next(float) # Low Density Urban
z.n2d = self.next(float) # Unpaved Roads
z.n3 = self.next(float) # Other
z.n4 = self.next(float) # Streambank Erosion
self.next(EOL)
# Line 103: (Estimated Load by Land Use/Source – Total Nitrogen (kg))
z.n5 = self.next(float) # Row Crops
z.n6 = self.next(float) # Hay/Pasture
z.n6b = self.next(float) # High Density Urban
z.n6c = self.next(float) # Low Density Urban
z.n6d = self.next(float) # Unpaved Roads
z.n7 = self.next(float) # Other
_ = self.next(float) # Farm Animals
z.n8 = self.next(float) # Streambank Erosion
z.n9 = self.next(float) # Groundwater/Subsurface
z.n10 = self.next(float) # Point Source Discharges
z.n11 = self.next(float) # Septic Systems
self.next(EOL)
# Line 104: (Estimated Load by Land Use/Source – Total Phosphorus (kg))
z.n12 = self.next(float) # Row Crops
z.n13 = self.next(float) # Hay/Pasture
z.n13b = self.next(float) # High Density Urban
z.n13c = self.next(float) # Low Density Urban
z.n13d = self.next(float) # Unpaved Roads
z.n14 = self.next(float) # Other
z.n14b = self.next(float) # Farm Animals
z.n15 = self.next(float) # Streambank Erosion
z.n16 = self.next(float) # Groundwater/Subsurface
z.n17 = self.next(float) # Point Source Discharges
z.n18 = self.next(float) # Septic Systems
self.next(EOL)
# Line 105:
z.n19 = self.next(float) # Total Sediment Load (kg x 1000)
z.n20 = self.next(float) # Total Nitrogen Load (kg)
z.n21 = self.next(float) # Total Phosphorus Load (kg)
z.n22 = self.next(float) # Basin Area (Ha)
self.next(EOL)
# Line 106:
z.n23 = self.next(float) # Row Crops Area (Ha)
z.n23b = self.next(float) # High Density Urban Area (Ha)
z.n23c = self.next(float) # High Density Urban (Constructed Wetlands): % Drainage Used
z.n24 = self.next(float) # Hay/Pasture Area (Ha)
z.n24b = self.next(float) # Low Density Urban Area (ha Ha
z.n24c = self.next(float) # Low Density Urban (Constructed Wetlands): % Drainage Used
z.n24d = self.next(float) # High Density Urban (Bioretention Areas): % Drainage Used
z.n24e = self.next(float) # Low Density Urban (Bioretention Areas): % Drainage Used
self.next(EOL)
# Line 107:
z.n25 = self.next(float) # Row Crops (BMP 1): Existing (%)
z.n25b = self.next(float) # High Density Urban (Constructed Wetlands): Existing (%)
z.n25c = self.next(float) # Low Density Urban (Constructed Wetlands): Existing (%)
z.n25d = self.next(float) # High Density Urban (Bioretention Areas): Existing (%)
z.n25e = self.next(float) # Low Density Urban (Bioretention Areas): Existing (%)
z.n26 = self.next(float) # Row Crops (BMP 2): Existing (%)
z.n26b = self.next(float) # High Density Urban (Detention Basin): Existing (%)
z.n26c = self.next(float) # Low Density Urban (Detention Basin): Existing (%)
z.n27 = self.next(float) # Row Crops (BMP 3): Existing (%)
z.n27b = self.next(float) # Row Crops (BMP 4): Existing (%)
z.n28 = self.next(float) # Row Crops (BMP 5): Existing (%)
z.n28b = self.next(float) # Row Crops (BMP 6): Existing (%)
z.n29 = self.next(float) # Row Crops (BMP 8): Existing (%)
self.next(EOL)
# Line 108:
z.n30 = self.next(float) # Row Crops (BMP 1): Future (%)
z.n30b = self.next(float) # High Density Urban (Constructed Wetlands): Future (%)
z.n30c = self.next(float) # Low Density Urban (Constructed Wetlands): Future (%)
z.n30d = self.next(float) # High Density Urban (Bioretention Areas): Future (%)
z.n30e = self.next(float) # Low Density Urban (Bioretention Areas): Future (%)
z.n31 = self.next(float) # Row Crops (BMP 2): Future (%)
z.n31b = self.next(float) # High Density Urban (Detention Basin): Future (%)
z.n31c = self.next(float) # Low Density Urban (Detention Basin): Future (%)
z.n32 = self.next(float) # Row Crops (BMP 3): Future (%)
z.n32b = self.next(float) # Row Crops (BMP 4): Future (%)
z.n32c = self.next(float) # Hay/Pasture (BMP 3): Existing (%)
z.n32d = self.next(float) # Hay/Pasture (BMP 3): Future (%)
z.n33 = self.next(float) # Row Crops (BMP 5): Future (%)
z.n33b = self.next(float) # Row Crops (BMP 6): Future (%)
z.n33c = self.next(float) # Hay/Pasture (BMP 4): Existing (%)
z.n33d = self.next(float) # Hay/Pasture (BMP 4): Future (%)
self.next(EOL)
# Line 109:
z.n34 = self.next(float) # Row Crops (BMP 8): Future (%)
z.n35 = self.next(float) # Hay/Pasture (BMP 5): Existing (%)
z.n35b = self.next(float) # Hay/Pasture (BMP 6): Existing (%)
z.n36 = self.next(float) # Hay/Pasture (BMP 7): Existing (%)
z.n37 = self.next(float) # Hay/Pasture (BMP 8): Existing (%)
z.n38 = self.next(float) # Hay/Pasture (BMP 5): Future (%)
z.n38b = self.next(float) # Hay/Pasture (BMP 6): Future (%)
z.n39 = self.next(float) # Hay/Pasture (BMP 7): Future (%)
z.n40 = self.next(float) # Hay/Pasture (BMP 8): Future (%)
self.next(EOL)
# Line 110:
z.n41 = self.next(float) # Agricultural Land on Slope > 3% (Ha)
z.n41b = self.next(float) # AWMS (Livestock): Existing (%)
z.n41c = self.next(float) # AWMS (Livestock): Future (%)
z.n41d = self.next(float) # AWMS (Poultry): Existing (%)
z.n41e = self.next(float) # AWMS (Poultry): Future (%)
z.n41f = self.next(float) # Runoff Control: Existing (%)
z.n41g = self.next(float) # Runoff Control: Future (%)
z.n41h = self.next(float) # Phytase in Feed: Existing (%)
z.n41i = self.next(float) # Phytase in Feed: Future (%)
z.n41j = self.next(float) # Total Livestock AEUs
z.n41k = self.next(float) # Total Poultry AEUs
z.n41l = self.next(float) # Total AEUs
z.n42 = self.next(float) # Streams in Agricultural Areas (km)
z.n42b = self.next(float) # Total Stream Length (km)
z.n42c = self.next(float) # Unpaved Road Length (km)
z.n43 = self.next(float) # Stream Km with Vegetated Buffer Strips: Existing
_ = self.next(float) # Average Grazing Animal Loss Rate (Barnyard/Confined Area): Nitrogen
_ = self.next(float) # Average Non-Grazing Animal Loss Rate (Barnyard/Confined Area): Nitrogen
z.GRLBP = self.next(float) # Average Grazing Animal Loss Rate (Barnyard/Confined Area): Phosphorus
z.NGLBP = self.next(float) # Average Non-Grazing Animal Loss Rate (Barnyard/Confined Area): Phosphorus
z.NGLManP = self.next(float) # Average Non-Grazing Animal Loss Rate (Manure Spreading): Phosphorus
z.NGLBFC = self.next(float) # Average Non-Grazing Animal Loss Rate (Barnyard/Confined Area): Fecal Coliform
z.GRLBFC = self.next(float) # Average Grazing Animal Loss Rate (Barnyard/Confined Area): Fecal Coliform
z.GRSFC = self.next(float) # Average Grazing Animal Loss Rate (Spent in Streams): Fecal Coliform
_ = self.next(float) # Average Grazing Animal Loss Rate (Spent in Streams): Nitrogen
z.GRSP = self.next(float) # Average Grazing Animal Loss Rate (Spent in Streams): Phosphorus
self.next(EOL)
# Line 111:
z.n43b = self.next(float) # High Density Urban (Constructed Wetlands): Required Ha
z.n43c = self.next(float) # High Density Urban (Detention Basin): % Drainage Used
z.n43d = self.next(float) # High Density Urban: % Impervious Surface
z.n43e = self.next(float) # High Density Urban (Constructed Wetlands): Impervious Ha Drained
z.n43f = self.next(float) # High Density Urban (Detention Basin): Impervious Ha Drained
z.n43g = self.next(float) # High Density Urban (Bioretention Areas): Impervious Ha Drained
z.n43h = self.next(float) # High Density Urban (Bioretention Areas): Required Ha
z.n43i = self.next(float) # Low Density Urban (Bioretention Areas): Impervious Ha Drained
z.n43j = self.next(float) # Low Density Urban (Bioretention Areas): Required Ha
z.n44 = self.next(float) # Stream Km with Vegetated Buffer Strips: Future
z.n44b = self.next(float) # High Density Urban (Detention Basin): Required Ha
z.n45 = self.next(float) # Stream Km with Fencing: Existing
z.n45b = self.next(float) # Low Density Urban (Constructed Wetlands): Required Ha
z.n45c = self.next(float) # Low Density Urban (Detention Basin): % Drainage Used
z.n45d = self.next(float) # Low Density Urban: % Impervious Surface
z.n45e = self.next(float) # Low Density Urban (Constructed Wetlands): Impervious Ha Drained
z.n45f = self.next(float) # Low Density Urban (Detention Basin): Impervious Ha Drained
self.next(EOL)
# Line 112:
z.n46 = self.next(float) # Stream Km with Fencing: Future
z.n46b = self.next(float) # Low Density Urban (Detention Basin): Required Ha
z.n46c = self.next(float) # Stream Km with Stabilization: Existing
z.n46d = self.next(float) # Stream Km with Stabilization: Future
z.n46e = self.next(float) # Stream Km in High Density Urban Areas
z.n46f = self.next(float) # Stream Km in Low Density Urban Areas
z.n46g = self.next(float) # Stream Km in High Density Urban Areas W/Buffers: Existing
z.n46h = self.next(float) # Stream Km in High Density Urban Areas W/Buffers: Future
z.n46i = self.next(float) # High Density Urban Streambank Stabilization (km): Existing
z.n46j = self.next(float) # High Density Urban Streambank Stabilization (km): Future
z.n46k = self.next(float) # Stream Km in Low Density Urban Areas W/Buffers: Existing
z.n46l = self.next(float) # Stream Km in Low Density Urban Areas W/Buffers: Future
z.n46m = self.next(float) # Low Density Urban Streambank Stabilization (km): Existing
z.n46n = self.next(float) # Low Density Urban Streambank Stabilization (km): Future
z.n46o = self.next(float) # Unpaved Road Km with E and S Controls (km): Existing
z.n46p = self.next(float) # Unpaved Road Km with E and S Controls (km): Future
self.next(EOL)
# Line 113:
z.n47 = self.next(float) # Number of Persons on Septic Systems: Existing
z.n48 = self.next(float) # No longer used (Default = 0)
z.n49 = self.next(float) # Number of Persons on Septic Systems: Future
z.n50 = self.next(float) # No longer used (Default = 0)
z.n51 = self.next(float) # Septic Systems Converted by Secondary Treatment Type (%)
z.n52 = self.next(float) # Septic Systems Converted by Tertiary Treatment Type (%)
z.n53 = self.next(float) # No longer used (Default = 0)
z.n54 = self.next(float) # Distribution of Pollutant Discharges by Primary Treatment Type (%): Existing
z.n55 = self.next(float) # Distribution of Pollutant Discharges by Secondary Treatment Type (%): Existing
z.n56 = self.next(float) # Distribution of Pollutant Discharges by Tertiary Treatment Type (%): Existing
z.n57 = self.next(float) # Distribution of Pollutant Discharges by Primary Treatment Type (%): Future
z.n58 = self.next(float) # Distribution of Pollutant Discharges by Secondary Treatment Type (%): Future
z.n59 = self.next(float) # Distribution of Pollutant Discharges by Tertiary Treatment Type (%): Future
z.n60 = self.next(float) # Distribution of Treatment Upgrades (%): Primary to Secondary
z.n61 = self.next(float) # Distribution of Treatment Upgrades (%): Primary to Tertiary
z.n62 = self.next(float) # Distribution of Treatment Upgrades (%): Secondary to Tertiary
self.next(EOL)
# Line 114: (BMP Load Reduction Efficiencies)
z.n63 = self.next(float) # BMP 1 (Nitrogen)
z.n64 = self.next(float) # Vegetated Buffer Strips (Nitrogen)
z.n65 = self.next(float) # BMP 2 (Nitrogen)
z.n66 = self.next(float) # BMP 3 (Nitrogen)
z.n66b = self.next(float) # BMP 4 (Nitrogen)
z.n67 = self.next(float) # BMP 5 (Nitrogen)
z.n68 = self.next(float) # BMP 8 (Nitrogen)
z.n68b = self.next(float) # BMP 7 (Nitrogen)
z.n69 = self.next(float) # Streambank Fencing (Nitrogen)
z.n69b = self.next(float) # Constructed Wetlands (Nitrogen)
z.n69c = self.next(float) # Streambank Stabilization (Nitrogen)
z.n70 = self.next(float) # BMP 6 (Nitrogen)
z.n70b = self.next(float) # Detention Basins (Nitrogen)
self.next(EOL)
# Line 115: (BMP Load Reduction Efficiencies cont.)
z.n71 = self.next(float) # BMP 1 (Phosphorus)
z.n71b = self.next(float) # Bioretention Areas (Nitrogen)
z.n72 = self.next(float) # Vegetated Buffer Strips (Phosphorus)
z.n73 = self.next(float) # BMP 2 (Phosphorus)
z.n74 = self.next(float) # BMP 3 (Phosphorus)
z.n74b = self.next(float) # BMP 4 (Phosphorus)
z.n75 = self.next(float) # BMP 5 (Phosphorus)
z.n76 = self.next(float) # BMP 8 (Phosphorus)
z.n76b = self.next(float) # BMP 7 (Phosphorus)
z.n77 = self.next(float) # Streambank Fencing (Phosphorus)
z.n77b = self.next(float) # Constructed Wetlands (Phosphorus)
z.n77c = self.next(float) # Streambank Stabilization (Phosphorus)
z.n78 = self.next(float) # BMP 6 (Phosphorus)
z.n78b = self.next(float) # Detention Basins (Phosphorus)
self.next(EOL)
# Line 116: (BMP Load Reduction Efficiencies cont.)
z.n79 = self.next(float) # BMP 1 (Sediment)
z.n79b = self.next(float) # Bioretention Areas (Phosphorus)
z.n79c = self.next(float) # Bioretention Areas (Sediment)
z.n80 = self.next(float) # Vegetated Buffer Strips (Sediment)
z.n81 = self.next(float) # BMP 2 (Sediment)
z.n82 = self.next(float) # BMP 3 (Sediment)
z.n82b = self.next(float) # BMP 4 (Sediment)
z.n83 = self.next(float) # BMP 5 (Sediment)
z.n84 = self.next(float) # BMP 8 (Sediment)
z.n84b = self.next(float) # BMP 7 (Sediment)
z.n85 = self.next(float) # Streambank Fencing (Sediment)
z.n85b = self.next(float) # Constructed Wetlands (Sediment)
z.n85c = self.next(float) # Detention Basins (Sediment)
z.n85d = self.next(float) # Streambank Stabilization (Sediment)
z.n85e = self.next(float) # Unpaved Road (kg/meter) (Nitrogen)
z.n85f = self.next(float) # Unpaved Road (kg/meter) (Phosphorus)
z.n85g = self.next(float) # Unpaved Road (kg/meter) (Sediment)
self.next(EOL)
# Line 117: (BMP Load Reduction Efficiencies cont.)
z.n85h = self.next(float) # AWMS (Livestock) (Nitrogen)
z.n85i = self.next(float) # AWMS (Livestock) (Phosphorus)
z.n85j = self.next(float) # AWMS (Poultry) (Nitrogen)
z.n85k = self.next(float) # AWMS (Poultry) (Phosphorus)
z.n85l = self.next(float) # Runoff Control (Nitrogen)
z.n85m = self.next(float) # Runoff Control (Phosphorus)
z.n85n = self.next(float) # Phytase in Feed (Phosphorus)
z.n85o = self.next(float) # Vegetated Buffer Strips (Pathogens)
z.n85p = self.next(float) # Streambank Fencing (Pathogens)
z.n85q = self.next(float) # AWMS (Livestock) (Pathogens)
z.n85r = self.next(float) # AWMS (Poultry) (Pathogens)
z.n85s = self.next(float) # Runoff Control (Pathogens)
z.n85t = self.next(float) # Constructed Wetlands (Pathogens)
z.n85u = self.next(float) # Bioretention Areas (Pathogens)
z.n85v = self.next(float) # Detention Basins (Pathogens)
self.next(EOL)
# Line 118: (Wastewater Discharge BMP Reduction Efficiencies)
z.n86 = self.next(float) # Conversion of Septic System to Secondary Treatment Plant (Nitrogen)
z.n87 = self.next(float) # Conversion of Septic System to Tertiary Treatment Plant (Nitrogen)
z.n88 = self.next(float) # Conversion of Primary System to Secondary Treatment Plant (Nitrogen)
z.n89 = self.next(float) # Conversion of Primary System to Tertiary Treatment Plant (Nitrogen)
z.n90 = self.next(float) # Conversion of Secondary System to Tertiary Treatment Plant (Nitrogen)
z.n91 = self.next(float) # Conversion of Septic System to Secondary Treatment Plant (Phosphorus)
z.n92 = self.next(float) # Conversion of Septic System to Tertiary Treatment Plant (Phosphorus)
z.n93 = self.next(float) # Conversion of Primary System to Secondary Treatment Plant (Phosphorus)
z.n94 = self.next(float) # Conversion of Primary System to Tertiary Treatment Plant (Phosphorus)
z.n95 = self.next(float) # Conversion of Secondary System to Tertiary Treatment Plant (Phosphorus)
z.n95b = self.next(float) # Conversion of Septic System to Secondary Treatment Plant (Pathogens)
z.n95c = self.next(float) # Conversion of Septic System to Tertiary Treatment Plant (Pathogens)
z.n95d = self.next(float) # Wastewater Treatment Plants Pathogen Distribution (cfu/100mL): Existing
z.n95e = self.next(float) # Wastewater Treatment Plants Pathogen Distribution (cfu/100mL): Future
self.next(EOL)
# Line 119: (BMP Costs $)
z.n96 = self.next(float) # Conservation Tillage (per Ha)
z.n97 = self.next(float) # Cover Crops (per Ha)
z.n98 = self.next(float) # Grazing Land Management (per Ha)
z.n99 = self.next(float) # Streambank Fencing (per km)
z.n99b = self.next(float) # Strip Cropping/Contour Farming (per Ha)
z.n99c = self.next(float) # Constructed Wetlands (per impervious Ha drained)
z.n99d = self.next(float) # Streambank Stabilization (per meter)
z.n99e = self.next(float) # Bioretention Areas (per impervious Ha drained)
z.n100 = self.next(float) # Vegetated Buffer Strip (per Km)
z.n101 = self.next(float) # Agricultural Land Retirement (per Ha)
z.n101b = self.next(float) # AWMS/Livestock (per AEU)
z.n101c = self.next(float) # AWMS/Poultry (per AEU)
z.n101d = self.next(float) # Runoff Control (per AEU)
z.n101e = self.next(float) # Phytase in Feed (per AEU)
z.n102 = self.next(float) # Nutrient Management (per Ha)
z.n103a = self.next(float) # User Defined (per Ha)
z.n103b = self.next(float) # Detention Basins (per impervious Ha drained)
z.n103c = self.next(float) # Conservation Plan (per Ha)
z.n103d = self.next(float) # Unpaved Roads (per meter)
self.next(EOL)
# Line 120:
z.n104 = self.next(
float) # BMP Costs $: Conversion of Septic Systems to Centralized Sewage Treatment (per home)
z.n105 = self.next(float) # BMP Costs $: Conversion from Primary to Secondary Sewage Treatment (per capita)
z.n106 = self.next(float) # BMP Costs $: Conversion from Primary to Tertiary Sewage Treatment (per capita)
z.n106b = self.next(float) # No longer used (Default = 0)
z.n106c = self.next(float) # No longer used (Default = 0)
z.n106d = self.next(float) # No longer used (Default = 0)
z.n107 = self.next(float) # BMP Costs $: Conversion from Secondary to Tertiary Sewage Treatment (per capita)
z.n107b = self.next(float) # No longer used (Default = 0)
z.n107c = self.next(float) # No longer used (Default = 0)
z.n107d = self.next(float) # No longer used (Default = 0)
z.n107e = self.next(float) # No longer used (Default = 0)
if self.version_match(z.TranVersionNo, '1.[0-2].[0-9]'):
z.Storm = 0
z.CSNAreaSim = 0
z.CSNDevType = "None"
else:
z.Storm = self.next(float) # CSN Tool: Storm Event Simulated (cm)
z.CSNAreaSim = self.next(float) # CSN Tool: Area Simulated (Ha)
z.CSNDevType = self.next(str) # CSN Tool: Development Type
self.next(EOL)
# Line 121:
z.Qretention = self.next(float) # Detention Basin: Amount of runoff retention (cm)
z.FilterWidth = self.next(float) # Stream Protection: Vegetative buffer strip width (meters)
z.Capacity = self.next(float) # Detention Basin: Detention basin volume (cubic meters)
z.BasinDeadStorage = self.next(float) # Detention Basin: Basin dead storage (cubic meters)
z.BasinArea = self.next(float) # Detention Basin: Basin surface area (square meters)
z.DaysToDrain = self.next(float) # Detention Basin: Basin days to drain
z.CleanMon = self.next(float) # Detention Basin: Basin cleaning month
z.PctAreaInfil = self.next(float) # Infiltration/Bioretention: Fraction of area treated (0-1)
z.PctStrmBuf = self.next(float) # Stream Protection: Fraction of streams treated (0-1)
z.UrbBankStab = self.next(float) # Stream Protection: Streams w/bank stabilization (km)
z.ISRR = zeros(6)
z.ISRA = zeros(6)
z.ISRR[0] = self.next(float) # Impervious Surface Reduction: Low Density Mixed (% Reduction)
z.ISRA[0] = self.next(float) # Impervious Surface Reduction: Low Density Mixed (% Area)
z.ISRR[1] = self.next(float) # Impervious Surface Reduction: Medium Density Mixed (% Reduction)
z.ISRA[1] = self.next(float) # Impervious Surface Reduction: Medium Density Mixed (% Area)
z.ISRR[2] = self.next(float) # Impervious Surface Reduction: High Density Mixed (% Reduction)
z.ISRA[2] = self.next(float) # Impervious Surface Reduction: High Density Mixed (% Area)
z.ISRR[3] = self.next(float) # Impervious Surface Reduction: Low Density Residential (% Reduction)
z.ISRA[3] = self.next(float) # Impervious Surface Reduction: Low Density Residential (% Area)
z.ISRR[4] = self.next(float) # Impervious Surface Reduction: Medium Density Residential (% Reduction)
z.ISRA[4] = self.next(float) # Impervious Surface Reduction: Medium Density Residential (% Area)
z.ISRR[5] = self.next(float) # Impervious Surface Reduction: High Density Residential (% Reduction)
z.ISRA[5] = self.next(float) # Impervious Surface Reduction: High Density Residential (% Area)
if self.version_match(z.TranVersionNo, '1.[0-3].[0-9]'):
z.SweepType = SweepType.MECHANICAL
z.UrbSweepFrac = 1
else:
z.SweepType = self.next(SweepType.parse) # Street Sweeping: Sweep Type (1-2)
z.UrbSweepFrac = self.next(float) # Street Sweeping: Fraction of area treated (0-1)
self.next(EOL)
# Lines 122 - 133: (Street Sweeping data for each Month)
z.StreetSweepNo = zeros(12)
for i in range(12):
z.StreetSweepNo[i] = self.next(float) # Street sweeping times per month
self.next(EOL)
# Line 134:
z.OutName = self.next(str) # PRedICT Output Name
self.next(EOL)
# Line 135: (Estimated Reduced Load)
z.n108 = self.next(float) # Row Crops: Sediment (kg x 1000)
z.n109 = self.next(float) # Row Crops: Nitrogen (kg)
z.n110 = self.next(float) # Row Crops: Phosphorus (kg)
self.next(EOL)
# Line 136: (Estimated Reduced Load)
z.n111 = self.next(float) # Hay/Pasture: Sediment (kg x 1000)
z.n111b = self.next(float) # High Density Urban: Sediment (kg x 1000)
z.n111c = self.next(float) # Low Density Urban: Sediment (kg x 1000)
z.n111d = self.next(float) # Unpaved Roads: Sediment (kg x 1000)
z.n112 = self.next(float) # Hay/Pasture: Nitrogen (kg)
z.n112b = self.next(float) # High Density Urban: Nitrogen (kg)
z.n112c = self.next(float) # Low Density Urban: Nitrogen (kg)
z.n112d = self.next(float) # Unpaved Roads: Nitrogen (kg)
z.n113 = self.next(float) # Hay/Pasture: Phosphorus (kg)
z.n113b = self.next(float) # High Density Urban: Phosphorus (kg)
z.n113c = self.next(float) # Low Density Urban: Phosphorus (kg)
z.n113d = self.next(float) # Unpaved Roads: Phosphorus (kg)
self.next(EOL)
# Line 137: (Estimated Reduced Load)
z.n114 = self.next(float) # Other: Sediment (kg x 1000)
z.n115 = self.next(float) # Other: Nitrogen (kg)
z.n115b = self.next(float) # Farm Animals: Nitrogen (kg)
z.n116 = self.next(float) # Other: Phosphorus (kg)
z.n116b = self.next(float) # Farm Animals: Phosphorus (kg)
self.next(EOL)
# Line 138: (Estimated Reduced Load)
z.n117 = self.next(float) # Streambank Erosion: Sediment (kg x 1000)
z.n118 = self.next(float) # Streambank Erosion: Nitrogen (kg)
z.n119 = self.next(float) # Streambank Erosion: Phosphorus (kg)
self.next(EOL)
# Line 139: (Estimated Reduced Load)
z.n120 = self.next(float) # Groundwater/Subsurface: Nitrogen (kg)
z.n121 = self.next(float) # Groundwater/Subsurface: Phosphorus (kg)
self.next(EOL)
# Line 140: (Estimated Reduced Load)
z.n122 = self.next(float) # Point Source Discharges: Nitrogen (kg)
z.n123 = self.next(float) # Point Source Discharges: Phosphorus (kg)
self.next(EOL)
# Line 141: (Estimated Reduced Load)
z.n124 = self.next(float) # Septic Systems: Nitrogen (kg)
z.n125 = self.next(float) # Septic Systems: Phosphorus (kg)
self.next(EOL)