Title: Community Watershed Model pre and post processors
1Community Watershed Modelpre and post processors
2Code organizing principles
- Common variables in include files
- Common subroutines in libraries
- Common or global data in ASCII files
3Pre and Post Processors
Scenario UCIs and WDMs
Calibrated UCIs and WDMs
Data Files
Pre-Pre-Processor
Pre-Processor
Pre-Pre-Processor
HSPF
Binary Data File
Scenario Output
Post-Processor
Final Tables
4Pre Pre Processor
- By State seg
- Land use
- BMP factors
- Manure
- Fertilizer
- Atmospheric deposition
- Base mineralization
- Atmospheric deposition factors
- Point sources
- Septic
- Nutrient management acres
Data Files
Pre-Pre-Processor
Binary Data File
5Pre Pre Processor
- By State seg
- Land use
- BMP factors
- Manure
- Fertilizer
- Atmospheric deposition
- Base mineralization
- Atmospheric deposition factors
- Point sources
- Septic
- Nutrient management acres
Data Files
Pre-Pre-Processor
Binary Data File
6Pre Pre Processor
Binary Data File
By State segLand useBMP factorsManureFertilizerAtm
ospheric depositionBasemineralizationAtmospheric
deposition factors Point sourcesSepticNutrient
management acres
7Pre-Processor1
pre1_make_scenario_binary.com
Structure for each type of data get
data check for completeness end store all
data in binary format
8Pre and Post Processors
Scenario UCIs and WDMs
Calibrated UCIs and WDMs
Data Files
Pre-Pre-Processor
Pre-Processor
Pre-Processor
HSPF
Binary Data File
Scenario Output
Post-Processor
Final Tables
9Pre Processor
Scenario UCIs
Calibrated UCIs
Pre-Processor
1. Calculate nutrient management 2. Calculate
urban fertilizer applications 3. Change wdm
pointer 4. Manure 5. Fertilizer 6. Land use 7.
Mass links 8. Change Network for BMPs 9.
Impervious urban daily accumulation 10.
Septic 11. Change wdm for point source
and atmospheric deposition
Binary Data File
10Pre Processor
Pre-Processor
External 1. Calculate nutrient management 2.
Calculate urban fertilizer applications Internal 3
. Change wdm pointer 4. Manure 5. Fertilizer 6.
Land use 7. Mass links 8. Change Network for
BMPs 9. Impervious urban daily accumulation 10.
Septic
11Nutrient Management Calculation
- Applied separately for each
- Land Use
- Stateseg
- Nutrient
- Inorganic Calculation Only
12Step 1Determine Max Fertilizer
Total Fertilizer
Crop Need
Nitrogen ONLY
Crop Need
13Step 1Determine Max Fertilizer
Total Fertilizer
excess
Crop Need
Nitrogen ONLY
Crop Need
14Step 2Find Nutrient Management
Fertilizer
30 Crop Need
Manure
Crop Need
AtDep
Mineral
15Step 2Find Nutrient Management
Fertilizer
30 Crop Need
Manure
Crop Need
AtDep
Mineral
16Step 3Get segment average
Base
Nut Man
Weighted Average
Fertilizer
Fertilizer
Fertilizer
17What if? Excess Manure
Fertilizer
Manure
30 Crop Need
Crop Need
AtDep
Mineral
18What if? Excess Manure
Manure
30 Crop Need
Crop Need
AtDep
Mineral
19What if? Excess Manure
Manure
- fert
30 Crop Need
Crop Need
AtDep
Mineral
20Find Nutrient Management
Base
Nut Man
Weighted Average
Fertilizer
- fert
Fertilizer
Assumption gt Excess manure in cropland under
nutrient management
is moved to other cropland
within the stateseg and fertilizer is
accordingly reduced
21Find Nutrient Management
Base
Nut Man
Weighted Average
Fertilizer
- fert
- fert
If weighted average of fertilizer is negative,
fertilizer is set to zero and the
applications are allowed to be greater than
the nutrient management rate
22What if? available are already below 1.3 crop
need
30 Crop Need
Fertilizer
Crop Need
Manure
AtDep
Mineral
23Minimum 10 fert reduction
30 Crop Need
Fertilizer
Crop Need
Manure
AtDep
Mineral
24Pre-Processor2
pre2_calc_nutrient_management.com
Structure set rules parameters get stored
data serially apply rules store data write
out data for transfer to Bay water quality model
25Pre Processor
Scenario UCIs
Calibrated UCIs
Pre-Processor
1. Calculate nutrient management 2. Calculate
urban fertilizer applications 3. Change wdm
pointer 4. Manure 5. Fertilizer 6. Land use 7.
Mass links 8. Change Network for BMPs 9.
Impervious urban daily accumulation 10.
Septic 11. Change wdm for point source
and atmospheric deposition
Binary Data File
26Pre-Processor3
pre3_change_uci_files.com
Structure get all binary data ( no crunching
in this processor ) loop over all UCIs look
for a recognizable table change it.
27Pre Processor
Scenario WDMs
Reference WDMs
Pre-Processor
Binary Data File
11. Change wdm for point source and
atmospheric deposition
28Pre-Processor4
pre4_change_wdms_for_pointsource.com
Structure copy calibration WDMs to scenario
area make UCI that extracts point sources from
WDMs run HSPF to extract the point
sources change the extracted files to new point
sources make UCI that puts new point sources
into WDMs run HSPF to put new point sources into
WDMs
29Pre-Processor5
pre5_atdep_wdm_modification.com
Structure copy calibration WDMs to scenario
area make UCIs that extract atdep from WDMs run
HSPF to extract the atdep change the extracted
files to new atdep make UCIs that put new atdep
into WDMs run HSPF to put new atdep into WDMs
30Pre and Post Processors
Scenario UCIs and WDMs
Calibrated UCIs and WDMs
Data Files
Pre-Pre-Processor
Pre-Processor
HSPF
HSPF
Binary Data File
Scenario Output
Post-Processor
Post-Processor
Final Tables
31Run HSPF
Structure for each UCI copy a new working
WDM run HSPF move output files
32Post Processor
Binary Data File
Scenario Output
Post-Processor
Final Tables
33Post Processor
Post-Processor
Using 1300 files (150 million pieces of data) 1.
Calculate annual average edge of stream loads 2.
Calculate loads delivered to the end of each
segment Integrate with input data 1. Determine
output as a function of input 2. Determine
delivery factors 2. Allocate loads Organize into
tables
34Pre and Post Processors
Scenario UCIs and WDMs
Calibrated UCIs and WDMs
Data Files
Pre-Pre-Processor
Pre-Processor
HSPF
HSPF
HSPF
Binary Data File
Scenario Output
Post-Processor
Post-Processor
Post-Processor
Final Tables
Final Tables
35Split into states
- Assign pre-BMP export proportional to application
- Multiply by BMP efficiencies separately
36Scenario X
37Post-Processor 1
post1_edge_of_stream_loads.com
Structure get all binary data loop over all
segments get daily output from land
only convert to annual split loads between
states in same segment compare with reference to
determine UCI adjustments
38Post-Processor 2
post2_bed_fix.com
Structure ( just like pre3) get info loop
over all UCIs look for tables and change them
39Post-Processor 3
post3_make_new_load_files.com
Structure loop over all segments change
hourly river output to daily average concentrati
on.
40Post-Processor 4
post4_delivered_loads.com
Structure get edge of stream load data make
annual average from daily river output figure
delivery factors
41Post-Processor 5
post5_final_delivered_loads.com
Structure get edge-of-stream loads and
delivery factors write output by segment,
stateseg edge-of-stream, delivered