;-------------------------------------------------------------------------------------------------------------------------------------------------------------- ; Impacts of Land-Use Management on Ecosystem Services and Biodiversity: An Agent-Based Modelling Approach. ; Supplementary File S2 - Ecosystem Services Model Code ; Authors: T.J. Habib, S. Heckbert, J. J. Wilson, J. Cranston, A. Vandenbroeck, and D. Farr. ; ; This file represents the shared intellectual property of the Alberta Biodiversity Monitoring Institute, Alberta Innovates Technology Futures, ; and Green Analytics, and may be used with attribution. For more information, please visit ecosystemservices.abmi.ca or contact Tom Habib thabib@ualberta.ca ;-------------------------------------------------------------------------------------------------------------------------------------------------------------- ;---------------------------------------------------------------------------------------------------------------- ;1. Model and Landscape Set-up ;---------------------------------------------------------------------------------------------------------------- ; Declare all extensions and variables extensions [gis] globals [ ; ----Model Set-up and Control Variables session_string area ;---GIS Input Data Files ----- natural-regions-dataset land-suitability-dataset basin-dataset qs-dataset wetlands-dataset infiltration-dataset sediment-dataset precip-dataset k-factor-dataset rivers-dataset channels-dataset elevation-dataset ecozone-dataset age-dataset strata-dataset ineligible-dataset mills-dataset fmu-dataset cost-rwp-dataset cost-sfs-dataset cost-sfp-dataset cost-tpt-dataset cost-wfe-dataset cost-wfh-dataset cost-wye-dataset general-ag-dataset ag-qs-dataset barren-dataset canola2009-dataset canola2010-dataset canola2011-dataset canola2012-dataset feedlots-dataset for-qs-dataset hard-roads-dataset hard-qs-dataset hwet-qs-dataset industrial-dataset pasture09-dataset pasture10-dataset pasture11-dataset pasture12-dataset pipelines-dataset recreation-dataset rural-residential-dataset seismic-dataset soft-qs-dataset suburban-dataset mines-disturbed-dataset mines-undisturbed-dataset trails-motorized-dataset trails-nonmotorized-dataset transmission-lines-dataset urban-dataset urbind-qs-dataset wellpads-dataset LC_20-dataset LC_31-dataset LC_32-dataset LC_33-dataset LC_34-dataset LC_50-dataset LC_110-dataset LC_120-dataset C-P-dataset C-S-dataset MX-P-dataset MX-S-dataset D-dataset ;---- Other general variables land-patches mx mn ;-----Forest Timber & Carbon Model Variables forest-patches eligible-forest harvested-patches area-harvested-this-period area-harvested-total value-per-ha npv npv-vol npv-per-m3 harvest-pct-task harvest-pct ;----Pollination Model all-canola-patches canola-patches-this-year ticks-2009 ticks-2010 ticks-2011 ticks-2012 ; ----Water Model outlet total-sediment-mass-in-transport total-sediments-deposited rain-steps ag-runoff forest-runoff shrub-runoff grass-runoff road-runoff high-compact-runoff barren-urbind-runoff calibration-count nr-count ;-------Water Agentsets headwaters tributaries tributary-parents ] ; ------Declare all landscape (cell AKA "patch") variables patches-own [ is-station is-land-patch natural-region land-suitability ; ---- Landcover Variables ;----ABMI landcover categories (Forest types broken down into strata based on % pine, etc.). LC_20 LC_31 LC_32 LC_33 LC_34 LC_50 LC_110 LC_120 C-P C-S MX-P MX-S D ;---ABMI Human Footrpint (area per patch). Sum to total HF within each cell. Sum of all of these plus all "LC_" categories above is equal to total patch area. ag-qs for-qs hard-qs soft-qs urbind-qs hwet-qs ;--Canola and pasture area per patch (subset of "ag-qs") canola2009 canola2010 canola2011 canola2012 pasture09 pasture10 pasture11 pasture12 ;----Water loading categories. Note that these values get converted to hectares; all other LULC variables are in square meters. general-ag barren cutblock feedlots forest grass hard-roads industrial mines-disturbed mines-undisturbed pasture pipelines recreation rural-residential seismic shrubland suburban trails-motorized trails-nonmotorized transmission-lines urban wellpads ;------Other Water Model Variables basin elevation infiltration channel-elevation rainfall k-factor ls-factor hydro-elevation slope runoff-coefficient hillslope-sediment-generated sediments-deposited is-river outlet-ID removal-rate c-factor runoff flow load-N load-P load-TSS load-N-per-ha load-P-per-ha load-TSS-per-ha hillslope-sediment-generated-per-ha p-deposited n-deposited tss-deposited p-deposited-per-ha n-deposited-per-ha tss-deposited-per-ha sediments-deposited-per-ha p-supply n-supply tss-supply sediment-supply p-supply-per-ha n-supply-per-ha tss-supply-per-ha sediment-supply-per-ha net-N net-P net-tss net-sediment net-N-per-ha net-P-per-ha net-tss-per-ha net-sediment-per-ha cum-river-N cum-river-P cum-river-tss cum-river-sediment cum-river-flow barren-load-N cutblock-load-N feedlots-load-N forest-load-N grass-load-N hard-roads-load-N industrial-load-N mines-disturbed-load-N mines-undisturbed-load-N pasture-load-N pipelines-load-N recreation-load-N rural-residential-load-N seismic-load-N shrubland-load-N suburban-load-N trails-motorized-load-N trails-nonmotorized-load-N transmission-lines-load-N urban-load-N wellpads-load-N ag-load-N barren-load-P cutblock-load-P feedlots-load-P forest-load-P grass-load-P hard-roads-load-P industrial-load-P mines-disturbed-load-P mines-undisturbed-load-P pasture-load-P pipelines-load-P recreation-load-P rural-residential-load-P seismic-load-P shrubland-load-P suburban-load-P trails-motorized-load-P trails-nonmotorized-load-P transmission-lines-load-P urban-load-P wellpads-load-P ag-load-P barren-load-TSS cutblock-load-TSS feedlots-load-TSS forest-load-TSS grass-load-TSS hard-roads-load-TSS industrial-load-TSS mines-disturbed-load-TSS mines-undisturbed-load-TSS pasture-load-TSS pipelines-load-TSS recreation-load-TSS rural-residential-load-TSS seismic-load-TSS shrubland-load-TSS suburban-load-TSS trails-motorized-load-TSS trails-nonmotorized-load-TSS transmission-lines-load-TSS urban-load-TSS wellpads-load-TSS ag-load-TSS ;------Forest Timber and Carbon Model Variables ecozone fmu age-class stand-age ineligible is-forest-patch is-eligible total-patch-volume conifer-volume deciduous-volume year-harvested my-patch-vol-harvest area-harvested-from-this-patch patch-haul-cost is-harvested timber-esv timber-esvp timber-npv-per-ha timber-value-potential-per-ha haul-cost-RWP haul-cost-SFS haul-cost-SFP haul-cost-TPT haul-cost-WFE haul-cost-WFH haul-cost-WYE ; ---Carbon Model Variables --- aboveground-soft aboveground-hard belowground-soft belowground-hard DOM-above-other DOM-above-litter DOM-below-slow DOM-below-fast DOM-below-vfast ipcc-above ipcc-below ipcc-litter ipcc-deadwood ipcc-soc ipcc-total ipcc-start ccs-year ccs-total ccs-flux carbon-storage carbon-storage-per-ha carbon-esv carbon-value-per-ha carbon-change carbon-change-per-ha ccs-esv ccs-value-per-ha ;----Pollination Model Variables---- natland-area natland-buffer bee-abund poll-def bee-seedset total-seedset canola-total-yield canola-total-yield-per-ha poll-yield-ha poll-profit-ha poll-profit-patch cumulative-poll-profit-patch pollination-npv hay-yield hay-npv hay-npv-per-ha pollination-npv-per-ha canola-total-revenue canola-total-revenue-per-ha canola-revenue-npv canola-revenue-npv-per-ha ;-----Biodiversity Model Variables hard-linear-intactness soft-linear-intactness urbind-intactness agric-intactness forestry-intactness intactness ] ; Declare all agent types and variables breed [mills mill] mills-own [ mill-id mill-name mill-namecode mill-type my-mill-patches my-aac-sw my-aac-hw patches-harvested-count my-harvested-mill-patches mill-area-harvested SW-vol-harvested HW-vol-harvested gross-merch-vol-SW gross-merch-vol-HW cumulative-vol avg-dist-to-mill ; --- ECONOMIC VARIABLES --- haul-cost delivered-mill-cost mill-cost mill-revenue net-profit mill-NPV ] breed [rivers river] rivers-own [ id parent children is-outlet my-flow my-N my-P my-tss my-sediment N-to-contribute P-to-contribute tss-to-contribute sediment-to-contribute flow-to-contribute ] breed [ stations station] stations-own [ station-id station-name my-monitoring-point station-flow station-N station-P station-TSS station-sediment station-basin ] breed [ raindrops raindrop] raindrops-own[ flow-volume sediment-mass p-mass n-mass tss-mass my-home my-route] ; ------------------------------------------------------------------------------------------------------------------------------------------------------------ ; 1. SETUP LANDSCAPE AND ALL MODELS ; ------------------------------------------------------------------------------------------------------------------------------------------------------------ to setup-patches clear-all load-gis setup-forest setup-mills setup-pollination set session_string "" reset-ticks end to load-gis set-default-shape turtles "circle" ; This proceedure loads all data necessary to run the simulations. Once the data are loaded a few adjustments are made (such as removing any NoData values) ; to ensure the data is handeled appropriately by the model. Additional code annotations are provided below. ;-------Landcover rasters set natural-regions-dataset gis:load-dataset "data/natural_regions.asc" set land-suitability-dataset gis:load-dataset "data/land_suitability.asc" set LC_20-dataset gis:load-dataset "data/lc_20.asc" set LC_31-dataset gis:load-dataset "data/lc_31.asc" set LC_32-dataset gis:load-dataset "data/lc_32.asc" set LC_33-dataset gis:load-dataset "data/lc_33.asc" set LC_34-dataset gis:load-dataset "data/lc_34.asc" set LC_50-dataset gis:load-dataset "data/lc_50.asc" set LC_110-dataset gis:load-dataset "data/lc_110.asc" set LC_120-dataset gis:load-dataset "data/lc_120.asc" set C-P-dataset gis:load-dataset "data/c_p.asc" set C-S-dataset gis:load-dataset "data/c_s.asc" set MX-P-dataset gis:load-dataset "data/mx_p.asc" set MX-S-dataset gis:load-dataset "data/mx_s.asc" set D-dataset gis:load-dataset "data/d.asc" ;------------HF Rasters set ag-qs-dataset gis:load-dataset "data/agqs.asc" set for-qs-dataset gis:load-dataset "data/forqs.asc" set hard-qs-dataset gis:load-dataset "data/hardqs.asc" set soft-qs-dataset gis:load-dataset "data/softqs.asc" set urbind-qs-dataset gis:load-dataset "data/urbindqs.asc" set hwet-qs-dataset gis:load-dataset "data/hwetqs.asc" set canola2009-dataset gis:load-dataset "data/canola2009.asc" set canola2010-dataset gis:load-dataset "data/canola2010.asc" set canola2011-dataset gis:load-dataset "data/canola2011.asc" set canola2012-dataset gis:load-dataset "data/canola2012.asc" set pasture09-dataset gis:load-dataset "data/pasture09.asc" set pasture10-dataset gis:load-dataset "data/pasture10.asc" set pasture11-dataset gis:load-dataset "data/pasture11.asc" set pasture12-dataset gis:load-dataset "data/pasture12.asc" ;-------water purification rasters set general-ag-dataset gis:load-dataset "data/general_ag.asc" set barren-dataset gis:load-dataset "data/barren.asc" set feedlots-dataset gis:load-dataset "data/feedlots.asc" ; set grass-dataset gis:load-dataset "data/grass.asc" set hard-roads-dataset gis:load-dataset "data/hard_roads_paved.asc" set industrial-dataset gis:load-dataset "data/industrial_plants.asc" set pipelines-dataset gis:load-dataset "data/pipelines.asc" set recreation-dataset gis:load-dataset "data/recreation.asc" set rural-residential-dataset gis:load-dataset "data/rura_res_acreage_yard.asc" set seismic-dataset gis:load-dataset "data/seismic.asc" set suburban-dataset gis:load-dataset "data/suburban.asc" set mines-disturbed-dataset gis:load-dataset "data/mines_disturbed.asc" set mines-undisturbed-dataset gis:load-dataset "data/mines__undisturbed.asc" set trails-motorized-dataset gis:load-dataset "data/trails_motorized.asc" set trails-nonmotorized-dataset gis:load-dataset "data/trails_non_motorized.asc" set transmission-lines-dataset gis:load-dataset "data/trans_lines.asc" set urban-dataset gis:load-dataset "data/urban.asc" set wellpads-dataset gis:load-dataset "data/wellpads.asc" ;Load Water Layers set basin-dataset gis:load-dataset "data/basins.asc" ; note that each basin has a numeric ID. set rivers-dataset gis:load-dataset "data/rivers.shp" set elevation-dataset gis:load-dataset "data/dem_500m.asc" set channels-dataset gis:load-dataset "data/channelelevation_500m.asc" set precip-dataset gis:load-dataset "data/ppt_annual_500m.asc" set sediment-dataset gis:load-dataset "data/ls_factor_500m.asc" set k-factor-dataset gis:load-dataset "data/k_factor_800m.asc" set infiltration-dataset gis:load-dataset "data/topowetnessindex_500m.asc" ;Load Forest Layers set ecozone-dataset gis:load-dataset "data/ecozone.asc" set age-dataset gis:load-dataset "data/forest_age.asc" set mills-dataset gis:load-dataset "data/mills.shp" set ineligible-dataset gis:load-dataset "data/forest_ineligible.asc" set fmu-dataset gis:load-dataset "data/fmu.shp" set cost-rwp-dataset gis:load-dataset "data/cost_rwp.asc" set cost-sfs-dataset gis:load-dataset "data/cost_sfs.asc" set cost-sfp-dataset gis:load-dataset "data/cost_sfp.asc" set cost-tpt-dataset gis:load-dataset "data/cost_tpt.asc" set cost-wfe-dataset gis:load-dataset "data/cost_wfe.asc" set cost-wfh-dataset gis:load-dataset "data/cost_wfh.asc" set cost-wye-dataset gis:load-dataset "data/cost_wye.asc" gis:set-world-envelope (gis:envelope-union-of (gis:envelope-of basin-dataset) (gis:envelope-of elevation-dataset) (gis:envelope-of channels-dataset) (gis:envelope-of rivers-dataset) (gis:envelope-of precip-dataset) (gis:envelope-of sediment-dataset) (gis:envelope-of infiltration-dataset) (gis:envelope-of ecozone-dataset) (gis:envelope-of age-dataset) (gis:envelope-of mills-dataset) (gis:envelope-of ineligible-dataset) (gis:envelope-of fmu-dataset) (gis:envelope-of LC_20-dataset) ) ;Apply all GIS layers to patches ;LULC Rasters gis:apply-raster natural-regions-dataset natural-region gis:apply-raster land-suitability-dataset land-suitability gis:apply-raster LC_20-dataset LC_20 gis:apply-raster LC_31-dataset LC_31 gis:apply-raster LC_32-dataset LC_32 gis:apply-raster LC_33-dataset LC_33 gis:apply-raster LC_34-dataset LC_34 gis:apply-raster LC_50-dataset LC_50 gis:apply-raster LC_110-dataset LC_110 gis:apply-raster LC_120-dataset LC_120 gis:apply-raster C-P-dataset C-P gis:apply-raster C-S-dataset C-S gis:apply-raster MX-P-dataset MX-P gis:apply-raster MX-S-dataset MX-S gis:apply-raster D-dataset D ;---HF Rasters and crop rasters gis:apply-raster ag-qs-dataset ag-qs gis:apply-raster for-qs-dataset for-qs gis:apply-raster hard-qs-dataset hard-qs gis:apply-raster soft-qs-dataset soft-qs gis:apply-raster urbind-qs-dataset urbind-qs gis:apply-raster hwet-qs-dataset hwet-qs gis:apply-raster canola2009-dataset canola2009 gis:apply-raster canola2010-dataset canola2010 gis:apply-raster canola2011-dataset canola2011 gis:apply-raster canola2012-dataset canola2012 gis:apply-raster pasture09-dataset pasture09 gis:apply-raster pasture10-dataset pasture10 gis:apply-raster pasture11-dataset pasture11 gis:apply-raster pasture12-dataset pasture12 ; Water Datasets gis:apply-raster basin-dataset basin gis:apply-raster elevation-dataset elevation gis:apply-raster infiltration-dataset infiltration gis:apply-raster k-factor-dataset k-factor gis:apply-raster channels-dataset channel-elevation gis:apply-raster precip-dataset rainfall gis:apply-raster sediment-dataset ls-factor ;----Water loading category rasters gis:apply-raster general-ag-dataset general-ag gis:apply-raster barren-dataset barren gis:apply-raster feedlots-dataset feedlots gis:apply-raster hard-roads-dataset hard-roads gis:apply-raster industrial-dataset industrial gis:apply-raster pasture10-dataset pasture gis:apply-raster pipelines-dataset pipelines gis:apply-raster recreation-dataset recreation gis:apply-raster rural-residential-dataset rural-residential gis:apply-raster seismic-dataset seismic gis:apply-raster suburban-dataset suburban gis:apply-raster mines-disturbed-dataset mines-disturbed gis:apply-raster mines-undisturbed-dataset mines-undisturbed gis:apply-raster trails-motorized-dataset trails-motorized gis:apply-raster trails-nonmotorized-dataset trails-nonmotorized gis:apply-raster transmission-lines-dataset transmission-lines gis:apply-raster urban-dataset urban gis:apply-raster wellpads-dataset wellpads set land-patches patches with [basin >= 0] ; creates a subset of patches that includes only those patches within the area of interest set land-patches land-patches with [ lc_20 >= 0] ; just to confirm that landcover data are present in case of a slight misalignment of the "basin" and "LULC" input layers ask land-patches [set is-land-patch 1] ; This section converts water loading category areas from m2 to hectares. ask land-patches[ set general-ag general-ag / 10000 set barren barren / 10000 set cutblock cutblock / 10000 set feedlots feedlots / 10000 set forest forest / 10000 set grass LC_110 / 10000 set hard-roads hard-roads / 10000 set industrial industrial / 10000 set pasture pasture / 10000 set pipelines pipelines / 10000 set recreation recreation / 10000 set rural-residential rural-residential / 10000 set seismic seismic / 10000 set shrubland LC_50 / 10000 set suburban suburban / 10000 set mines-disturbed mines-disturbed / 10000 set mines-undisturbed mines-undisturbed / 10000 set trails-motorized trails-motorized / 10000 set trails-nonmotorized trails-nonmotorized / 10000 set transmission-lines transmission-lines / 10000 set urban urban / 10000 set wellpads wellpads / 10000 ; this sets water-loading categories for forest and cutblock based upon the complete LULC categories. This allows the values for the water model to be quickly updated if the timber model is run. set forest (C-P + C-S + MX-P + MX-S + D) / 10000 set cutblock for-qs / 10000 ] ; Forest datasets gis:apply-raster ecozone-dataset ecozone ; dataset defining ecoszones: 1 = Boreal Plain, 2 = Montane Cordillera gis:apply-coverage fmu-dataset "FMU_CODE" fmu ; dataset defining fmu regions gis:apply-raster age-dataset age-class ; dataset defining forest age structure in 10 year categores from 0 to 200 gis:apply-raster ineligible-dataset ineligible ; dataset of areas not available for harvest (protected areas, reserves, watercourse buffers): 1 = unavailable, 0 = available gis:apply-raster cost-rwp-dataset haul-cost-rwp gis:apply-raster cost-sfs-dataset haul-cost-sfs gis:apply-raster cost-sfp-dataset haul-cost-sfp gis:apply-raster cost-tpt-dataset haul-cost-tpt gis:apply-raster cost-wfe-dataset haul-cost-wfe gis:apply-raster cost-wfh-dataset haul-cost-wfh gis:apply-raster cost-wye-dataset haul-cost-wye ; This section removes any NoData ("NaN" in Netlogo language) values from landcover layers that would cause errors. ask patches [ ifelse (for-qs <= 0) or (for-qs >= 0) [ ] [ set for-qs 0] ] ; NaN fix ask patches [ ifelse (urbind-qs <= 0) or (urbind-qs >= 0) [ ] [ set urbind-qs 0] ] ; NaN fix ask patches [ ifelse (hard-qs <= 0) or (hard-qs >= 0) [ ] [ set hard-qs 0] ] ; NaN fix ask patches [ ifelse (soft-qs <= 0) or (soft-qs >= 0) [ ] [ set soft-qs 0] ] ; NaN fix ask patches [ ifelse (ag-qs <= 0) or (ag-qs >= 0) [ ] [ set ag-qs 0] ] ; NaN fix ask patches [ ifelse (hwet-qs <= 0) or (hwet-qs >= 0) [ ] [ set hwet-qs 0] ] ; NaN fix ask patches [ ifelse (general-ag <= 0) or (general-ag >= 0) [ ] [ set general-ag 0] ] ; NaN fix ask patches [ ifelse (barren <= 0) or (barren >= 0) [ ] [ set barren 0] ] ; NaN fix ask patches [ ifelse (cutblock <= 0) or (cutblock >= 0) [ ] [ set cutblock 0] ] ; NaN fix ask patches [ ifelse (feedlots <= 0) or (feedlots >= 0) [ ] [ set feedlots 0] ] ; NaN fix ask patches [ ifelse (forest <= 0) or (forest >= 0) [ ] [ set forest 0] ] ; NaN fix ask patches [ ifelse (grass <= 0) or (grass >= 0) [ ] [ set grass 0] ] ; NaN fix ask patches [ ifelse (hard-roads <= 0) or (hard-roads >= 0) [ ] [ set hard-roads 0] ] ; NaN fix ask patches [ ifelse (industrial <= 0) or (industrial >= 0) [ ] [ set industrial 0] ] ; NaN fix ask patches [ ifelse (pasture <= 0) or (pasture >= 0) [ ] [ set pasture 0] ] ; NaN fix ask patches [ ifelse (pipelines <= 0) or (pipelines >= 0) [ ] [ set pipelines 0] ] ; NaN fix ask patches [ ifelse (recreation <= 0) or (recreation >= 0) [ ] [ set recreation 0] ] ; NaN fix ask patches [ ifelse (rural-residential <= 0) or (rural-residential >= 0) [ ] [ set rural-residential 0] ] ; NaN fix ask patches [ ifelse (seismic <= 0) or (seismic >= 0) [ ] [ set seismic 0] ] ; NaN fix ask patches [ ifelse (suburban <= 0) or (suburban >= 0) [ ] [ set suburban 0] ] ; NaN fix ask patches [ ifelse (mines-disturbed <= 0) or (mines-disturbed >= 0) [ ] [ set mines-disturbed 0] ] ; NaN fix ask patches [ ifelse (mines-undisturbed <= 0) or (mines-undisturbed >= 0) [ ] [ set mines-undisturbed 0] ] ; NaN fix ask patches [ ifelse (trails-motorized <= 0) or (trails-motorized >= 0) [ ] [ set trails-motorized 0] ] ; NaN fix ask patches [ ifelse (trails-nonmotorized <= 0) or (trails-nonmotorized >= 0) [ ] [ set trails-nonmotorized 0] ] ; NaN fix ask patches [ ifelse (transmission-lines <= 0) or (transmission-lines >= 0) [ ] [ set transmission-lines 0] ] ; NaN fix ask patches [ ifelse (urban <= 0) or (urban >= 0) [ ] [ set urban 0] ] ; NaN fix ask patches [ ifelse (wellpads <= 0) or (wellpads >= 0) [ ] [ set wellpads 0] ] ; NaN fix ask patches [ ifelse (basin <= 0) or (basin >= 0) [ ] [ set basin -9999 ] ] ; NaN fix ask patches [ ifelse (elevation <= 0) or (elevation >= 0) [ ] [ set elevation 3500 ] ] ; NaN fix ask patches [ ifelse (channel-elevation <= 0) or (channel-elevation >= 0) [ ] [ set channel-elevation elevation ] ] ; NaN fix ask patches [ ifelse (rainfall <= 0) or (rainfall >= 0) [ ] [ set rainfall -9999] ] ; NaN fix ask patches [ ifelse (k-factor <= 0) or (k-factor >= 0) [ ] [ set k-factor -9999] ] ; NaN fix ask patches [ ifelse (infiltration <= 0) or (infiltration >= 0) [ ] [ set infiltration 0] ] ; NaN fix ask patches [ ifelse (ls-factor <= 0) or (ls-factor >= 0) [ ] [ set ls-factor 0 ] ] ; NaN fix ask patches [ ifelse (ecozone <= 0) or (ecozone >= 0) [ ] [ set ecozone -99999 ] ] ; NaN fix ask patches [ ifelse (age-class <= 0) or (age-class >= 0) [ ] [ set age-class -99999 ] ] ; NaN fix ask patches [ ifelse (ineligible <= 0) or (ineligible >= 0) [ ] [ set ineligible 0 ] ] ; NaN fix ask land-patches [if (rainfall = -9999) [set rainfall [rainfall] of min-one-of land-patches with [rainfall > 0] [distance myself]]] ask land-patches [if (k-factor = -9999) [set k-factor [k-factor] of min-one-of land-patches with [k-factor > 0] [distance myself]]] ask land-patches [ifelse (land-suitability <= 0) or (land-suitability >= 0) [] [set land-suitability [land-suitability] of min-one-of land-patches with [land-suitability > 0] [distance myself]]] set area 64 ; all cells are 800 x 800m end to setup-forest; Define initial forest patch agentsets and set initial forest/carbon levels ask patches [set is-forest-patch 0] ask patches [if (C-P > 0) or (C-S > 0) or (MX-S > 0) or (MX-P > 0) or (D > 0) [set is-forest-patch 1]] set forest-patches (patches with [is-forest-patch = 1]) ; defines a subset of land-patches that collectively make up all forest patches ask forest-patches [ set stand-age 0 if age-class >= 0 [set stand-age age-class + random 10] ; Input "age class" raster is based on 10-year intervals (e.g. forest age is 40-50 years). This randomly distributes stand age within its 10 year age class to give it an exact age. ] ; establish eligible forest by removing protected areas, reserves, and watercourse buffers from forest patches ask forest-patches [set is-eligible 0] ask forest-patches [if ineligible < 1 [set is-eligible 1] ] set eligible-forest patches with [is-eligible = 1 and is-string? fmu] ask forest-patches [ if stand-age >= 210 [set stand-age 1] ;This automatically "burns" any stand over 210 years old. Stands can go past 210 years during the model run, but cannot start that old. set-yields calc-carbon-pools set ipcc-start ipcc-total ] end to setup-mills ; adds attribute information from input GIS mill layer to mill agents in Netlogo. ask mills [die] foreach gis:feature-list-of mills-dataset[ let location gis:location-of (first (first (gis:vertex-lists-of ?))) create-mills 1 [ set shape "factory" set size 15 set color brown set xcor item 0 location set ycor item 1 location set mill-name gis:property-value ? "NAME"; sets each mill's name for reference set mill-namecode gis:property-value ? "NAMECODE"; sets each mill's three letter namecode for reference set mill-id gis:property-value ? "OBJECTID"; sets a id number for each mill (see glossery below). Tom's version: just uses object ID. Should probably merge all mills into one shapefile, then create a unique ID field called "Mill_ID". set mill-type gis:property-value ? "TYPE"; sets each mill's type (i.e. sawmill, pulp mill, OSB mill, or some combination) set my-aac-sw gis:property-value ? "conifer"; sets each mill's demand for softwood based on existing dispositions set my-aac-hw gis:property-value ? "decid"; sets each mill's demand for hardwood based on existing dispositions set npv 0 ] ] end ;------Call this to reset to default landcover and derived ES variable values after running a model. Note that this does not affect parameter values (e.g. timber costs, nutrient export coefficients, etc.). to reset-to-defaults reset-landscape reset-timber reset-pollination reset-biodiversity reset-water end to reset-landscape gis:apply-raster ag-qs-dataset ag-qs gis:apply-raster canola2009-dataset canola2009 gis:apply-raster canola2010-dataset canola2010 gis:apply-raster canola2011-dataset canola2011 gis:apply-raster canola2012-dataset canola2012 gis:apply-raster pasture10-dataset pasture10 gis:apply-raster general-ag-dataset general-ag ask land-patches [ set forest (C-P + C-S + MX-P + MX-S + D) / 10000 set cutblock for-qs / 10000 set pasture pasture10 / 10000 set general-ag general-ag / 10000 ] end to reset-timber ask land-patches [ set is-harvested 0 set my-patch-vol-harvest 0 set year-harvested 0 set timber-esv 0 set timber-npv-per-ha 0 set timber-esvp 0 set carbon-esv 0 set ccs-esv 0 ] ask mills [ set mill-npv 0 set haul-cost 0 set cumulative-vol 0 ] set npv 0 set npv-vol 0 set npv-per-m3 0 setup-forest end to reset-pollination ask land-patches[ set natland-area 0 set natland-buffer 0 set bee-abund 0 set poll-def 0 set bee-seedset 0 set poll-yield-ha 0 set poll-profit-ha 0 set poll-profit-patch 0 set cumulative-poll-profit-patch 0 set pollination-npv 0 set hay-npv 0 set canola-revenue-npv 0 set canola-revenue-npv-per-ha 0 ] setup-pollination end to reset-biodiversity ask land-patches [ set soft-linear-intactness 0 set urbind-intactness 0 set agric-intactness 0 set forestry-intactness 0 set intactness 0 ] end to reset-water ask land-patches [ set net-N 0 set net-P 0 set net-tss 0 set net-sediment 0 set cum-river-N 0 set cum-river-P 0 set cum-river-TSS 0 set cum-river-sediment 0 set cum-river-flow 0 ] ask rivers [ set my-N 0 set my-P 0 set my-tss 0 set my-sediment 0 set my-flow 0 set N-to-contribute 0 set P-to-contribute 0 set tss-to-contribute 0 set sediment-to-contribute 0 set flow-to-contribute 0 ] ask stations [ set station-N 0 set station-P 0 set station-tss 0 set station-sediment 0 set station-flow 0 ] end ; ------------------------------------------------------------------------------------------------------------------------------------------------------------ ;2. FOREST MODEL ; ------------------------------------------------------------------------------------------------------------------------------------------------------------ to run-forest-model ; This proceedure is triggered by the go button on the interface and begins the simulation, which is ; a sequental process of 5 steps: ; (1) 'grow-forest' grows the forest ; (2) 'set-mill-harvest-patches'establishes which patches can be harvested by each mill (mill demand/AAC previously set in "setup-mills" ; (3) 'harvest-forest'triggers the timber harvest procedure ; (4) 'calculate-values' calucates profits from harvest activities for that period ; (5) 'calc-carbon-pools'calcuates the stock of terrestrial forest carbon remaining after harvest ; The sequence starts over after each tick, which represents 1 year, and continues for 50 iterations. grow-forest set-mill-harvest-patches harvest-forest calculate-values ask forest-patches [calc-carbon-pools] tick if ticks = model-years [reset-ticks stop] end to grow-forest ask forest-patches [ let toc0 ipcc-total ; sets and maintains the period t - 1 carbon levels ; growth process - grows forest by adding 1 year to the age of each stand and recalculates standing volume and carbon content. set stand-age (stand-age + 1) set-yields calc-carbon-pools ; calculates the current period t carbon levels let toc1 ipcc-total ; sets and maintains the period t carbon levels set ccs-year toc1 - toc0 ; calcuations the carbon flux during period t set ccs-total ccs-total + ccs-year ; calcuations the carbon flux during entire simulation set ccs-flux ipcc-total - ipcc-start ] end to set-mill-harvest-patches ; Each time period mills set their eligible forest for harvest as all forest stands older than ; 80 years and located within an fmu containing their active timber harvest dispositions. ask mills [ if mill-id = 46 [set my-mill-patches eligible-forest with [(stand-age >= 80 and fmu = "R13") or (stand-age >= 80 and fmu = "E14") ] ] ; West Fraser (Hinton) if mill-id = 47 [set my-mill-patches eligible-forest with [(stand-age >= 80 and fmu = "R12") ] ] ; Weyerhaeuser (Edson) if mill-id = 54 [set my-mill-patches eligible-forest with [(stand-age >= 80 and fmu = "R13") ] ] ; West Fraser (Edson) if mill-id = 21 [set my-mill-patches eligible-forest with [(stand-age >= 80 and fmu = "R12") or (stand-age >= 80 and fmu = "R13") ] ] ; Tall Timber if mill-id = 53 [set my-mill-patches eligible-forest with [(stand-age >= 80 and fmu = "R10") ] ] ; Sundre Forest Products (Strachan) if mill-id = 50 [set my-mill-patches eligible-forest with [(stand-age >= 80 and fmu = "R10") ] ] ; Sundre Forest Products (Sundre) if mill-id = 0 [set my-mill-patches eligible-forest with [(stand-age >= 80 and fmu = "R10") ] ] ; Rocky Wood Preservers Ltd (Rocky Mtn House) ] end ; Choose between clearcutting and variable retention harvest. Clearcutting harvests all timber from a given cell, while variable retention ; randomly cuts either 25%, 50%, or 75% of a cell's timber. Use the drop-down menu on the model interface to select which policy to use. to set-harvest-policy if harvest-policy = "Variable Retention" [ set harvest-pct-task task [set harvest-pct one-of [0.25 0.5 0.75]] ] if harvest-policy = "Clearcut" [ set harvest-pct-task task [set harvest-pct 1] ] end to harvest-forest set-harvest-policy ; This proceedure does several tasks. First, it establishes some temporary variables to track harvest ; through the repeating harvesting sequence. Second, in runs a repeating process comprised of two ; sequential harvest steps: (1) softwood focused harvested frist, followed by (2) hardwood focus harvest. ; Finally, the temporary variables are applied to mills for reporting. let harvested-this-period 0 let my-harvested-stand-count 0 ask mills [ let conif-harvest 0 let decid-harvest 0 let dist-to-mill 0 set SW-vol-harvested 0 set HW-vol-harvested 0 set haul-cost 0 set mill-area-harvested 0 ; note that this resets to 0 at the start of every time period. (and accumulates within each time period as more patches are cut) ; this is the first repeating process that harvests eligable stands until mills reach their portion of conifer AAC ("conif-harvest" keeps a running tally ; during each time step of the volume of confiers harvested by each mill). While this proceedure focuses on confier, each stand has some deciduous content, ; which is harvested and tracked as well. The AAC is also adjusted to account for typical under harvest based on reported AAC to actual harvest ratios for Alberta. let haul-cost-layer word "haul-cost-" [mill-namecode] of self if count my-mill-patches > 0 [ while [conif-harvest < (my-aac-sw * random-normal 0.65 0.02)] [ let my-sw-patches my-mill-patches with [C-S > 0 or C-P > 0 or MX-S > 0 or MX-P > 0] ; this sets the target stands as conifer or mixed let my-legal-sw-patches my-sw-patches with [stand-age >= 80] ; this second order rule sets the target stands to any stands over 80 years old. set my-legal-sw-patches my-legal-sw-patches with [for-qs < 250000 and is-harvested = 0] ; select patches that haven't been partially cut historically, or earlier in model ask min-one-of my-legal-sw-patches [runresult haul-cost-layer] [ ; this randomly choses one of the oldest conifer or mixed stands with the least cost distance to the appriopriate mill. let this-patch self set stand-age 1 set harvested-this-period 1 set is-harvested 1 set year-harvested ticks set my-harvested-stand-count my-harvested-stand-count + 1 run harvest-pct-task set conif-harvest conif-harvest + (conifer-volume * harvest-pct) set decid-harvest decid-harvest + (deciduous-volume * harvest-pct) set my-patch-vol-harvest (conifer-volume + deciduous-volume) * harvest-pct set area-harvested-from-this-patch ((C-P + C-S + MX-S + MX-P + D) * harvest-pct)/ 10000 ; total area harvested this time period, converted to hectares (from square metres). set patch-haul-cost ((runresult haul-cost-layer) * conifer-volume * harvest-pct * 1.628571) + ((runresult haul-cost-layer) * deciduous-volume * harvest-pct) ; 1.628571 is the conversion factor to get the haul cost of softwood because it's not chipped before transport (so less of it fits on a truck) ask myself [ set mill-area-harvested mill-area-harvested + [area-harvested-from-this-patch] of this-patch] ask myself [ set haul-cost haul-cost + [patch-haul-cost] of this-patch] ask myself [ ifelse my-harvested-mill-patches = 0 [set my-harvested-mill-patches (patch-set this-patch)] [set my-harvested-mill-patches (patch-set my-harvested-mill-patches this-patch)] ] set forest forest - area-harvested-from-this-patch set cutblock (for-qs / 10000) + area-harvested-from-this-patch ] ] ; This is the second repeating process that runs until each mill has reach their portion of deciduous AAC ; prioritizing deciduous harvest, essentially topping up the hardwood levels that were not harvested focusing on ; softwood. Again, the AAC is adjusted to account for typical under harvest based on reported AAC to actual harvest ; ratios for Alberta. Similar to above, "decid-harvest" is a running tally of each mill's hardwood volume harvested. while [decid-harvest < my-aac-hw * random-normal 0.39 0.01] [ let my-hw-patches my-mill-patches with [MX-S > 0 or MX-P > 0 or D > 0] ; this sets the target stands as deciduous or mixed let my-max-age-hw-patches my-hw-patches with-max [stand-age] let my-legal-hw-patches my-hw-patches with [stand-age >= 80] set my-legal-hw-patches my-legal-hw-patches with [for-qs < 250000]; set my-legal-hw-patches my-legal-hw-patches with [is-harvested = 0] ; select patches that haven't been cut earlier in model ask min-one-of my-legal-hw-patches [runresult haul-cost-layer] [ let this-patch self set stand-age 1 set harvested-this-period 1 set is-harvested 1 set my-harvested-stand-count my-harvested-stand-count + 1 run harvest-pct-task set conif-harvest conif-harvest + (conifer-volume * harvest-pct) set decid-harvest decid-harvest + (deciduous-volume * harvest-pct) set my-patch-vol-harvest (conifer-volume + deciduous-volume) * harvest-pct set dist-to-mill (dist-to-mill + distance myself * sqrt (area * 0.01) ) set area-harvested-from-this-patch ((C-P + C-S + MX-S + MX-P + D) * harvest-pct) / 10000 set patch-haul-cost (runresult haul-cost-layer * conifer-volume * harvest-pct * 1.628571) + (runresult haul-cost-layer * deciduous-volume * harvest-pct) ; 1.628571 is the conversion factor to get the haul cost of softwood because it's not chipped before transport (so less of it fits on a truck) ask myself [ set mill-area-harvested mill-area-harvested + [area-harvested-from-this-patch] of this-patch] ask myself [ set haul-cost haul-cost + [patch-haul-cost] of this-patch] ask myself [print haul-cost] ask myself [ ifelse my-harvested-mill-patches = 0 [set my-harvested-mill-patches (patch-set this-patch)] [set my-harvested-mill-patches (patch-set my-harvested-mill-patches this-patch)] ] set forest forest - area-harvested-from-this-patch set cutblock (for-qs / 10000) + area-harvested-from-this-patch ] ] set patches-harvested-count my-harvested-stand-count set SW-vol-harvested conif-harvest set HW-vol-harvested decid-harvest set gross-merch-vol-SW SW-vol-harvested * 0.92 ; assuming 92% of total tree volume is merchantable set gross-merch-vol-HW HW-vol-harvested * 0.92 ; assuming 92% of total tree volume is merchantable set cumulative-vol cumulative-vol + gross-merch-vol-HW + gross-merch-vol-SW ] ; This procedure calcuates all the economic variables. Mills calcuate delivered mill costs, mill operational costs, ; revenue, and net profit from the harvest of timber and production of wood products during the current period. Then ; global variables are populated measuring net present values, and allocating ecosystem service values. let m3-mt 0.303 ; convert m3 of raw wood to metric tonnes of wood pulp let ut 0.85 ; utilization factor representing mill efficiency (15% of gross mechantable volume is residual waste) set delivered-mill-cost ((SW-vol-harvested + HW-vol-harvested) * cost-to-roadside) + (mill-area-harvested * silviculture-cost) + (haul-cost) set mill-cost mill-opp-cost * (gross-merch-vol-SW + gross-merch-vol-HW) if mill-type = "OSB" [set mill-revenue (gross-merch-vol-SW + gross-merch-vol-HW) * ut * panel-price] if mill-type = "Sawmill" [set mill-revenue (gross-merch-vol-SW + gross-merch-vol-HW) * ut * lumber-price] if mill-type = "Pulp Mill" [set mill-revenue (gross-merch-vol-SW + gross-merch-vol-HW) * ut * m3-mt * pulp-price] if mill-type = "Pulp Mill/Sawmill" [set mill-revenue ((gross-merch-vol-SW + gross-merch-vol-HW) * 0.5 * ut * lumber-price) + ((gross-merch-vol-SW + gross-merch-vol-HW) * 0.5 * ut * m3-mt * pulp-price)] if mill-type = "OSB/Sawmill" [set mill-revenue ((gross-merch-vol-SW + gross-merch-vol-HW) * 0.5 * ut * lumber-price) + ((gross-merch-vol-SW + gross-merch-vol-HW) * 0.5 * ut * panel-price)] if mill-type = "LVL" [set mill-revenue (gross-merch-vol-SW + gross-merch-vol-HW) * ut * panel-price] set net-profit mill-revenue - delivered-mill-cost - mill-cost set mill-npv mill-npv + (net-profit / ((1 + (discount-rate / 100)) ^ ticks)) ; Mill net present value, discounted at a user-defined (on the interface) discount rate. let mill-profit-per-m3 net-profit / (SW-vol-harvested + HW-vol-harvested) ask my-harvested-mill-patches [ set timber-esv (mill-profit-per-m3 * my-patch-vol-harvest) / ((1 + (discount-rate / 100)) ^ year-harvested) set timber-npv-per-ha timber-esv / area ] ] set harvested-patches forest-patches with [is-harvested = 1] set area-harvested-total (area-harvested-total + (sum [mill-area-harvested] of mills)) end to calculate-values set npv sum [mill-npv] of mills set npv-vol sum [my-patch-vol-harvest] of eligible-forest set npv-per-m3 npv / npv-vol ; allocates ecosystem service values to relevant patches ask eligible-forest [set timber-esvp npv-per-m3 * total-patch-volume] ask eligible-forest [if timber-esvp < 0 [set timber-esvp 0]] ask eligible-forest [set timber-value-potential-per-ha timber-esvp / area] ask forest-patches [ set carbon-storage ipcc-total * 3.67 ; 3.67 is the conversion factor from tonnes of carbon to CO2-equivalent. set carbon-storage-per-ha carbon-storage / area set carbon-esv carbon-storage * carbon-price set carbon-value-per-ha carbon-esv / area set carbon-change (ccs-flux * 3.67) set carbon-change-per-ha (carbon-change / area) set ccs-esv (ccs-flux * 3.67) * carbon-price set ccs-value-per-ha ccs-esv / area ] end ;----------------------------------------------------------------------------------------------------------------------------------------------------- ; End of Forest Model. See Timber Yield and Carbon Budget equations at the end of the code file. ;----------------------------------------------------------------------------------------------------------------------------------------------------- ; ------------------------------------------------------------------------------------------------------------------------------------------------------------ ;3. POLLINATION MODEL ; ------------------------------------------------------------------------------------------------------------------------------------------------------------ ; Equations obtained from Morandin & Winston 2006. to setup-pollination ; classifies all canola-producing cells and determines potential pollinator habitat within neighbouring cells. set all-canola-patches (patches with [(canola2009 > 0) or (canola2010 > 0) or (canola2011 > 0) or (canola2012 > 0)]) ask land-patches [set natland-area ((area * 10000) - ag-qs - for-qs - hard-qs - soft-qs - urbind-qs - hwet-qs + pasture10)] ask land-patches [ifelse (natland-area >= 0) [] [set natland-area 0] ] calculate-natland-buffers ask all-canola-patches [set pollination-npv 0] end ; Agricultural expansion procedure; converts a user-defined percentage of pasture into cropland, and randomy assigns the new cropland to grow canola in 1 of 4 years. ; Conversion occurs by choosing a conversion rate, and asking each cel containing a minimum amount of pasture (currently 20ha) to convert only if a randomly drawn number is smaller than ; the user-defined conversion rate. All affected landcover variables are adjusted accordingly. to expand-agriculture let pasture-patches patches with [pasture10 > 200000] ask pasture-patches [ if random 100 < (pasture-to-ag-conversion-rate) [ let pasture-to-convert pasture10 let canola-year-to-convert random 4 if canola-year-to-convert = 0 [set canola2009 canola2009 + pasture-to-convert] if canola-year-to-convert = 1 [set canola2010 canola2010 + pasture-to-convert] if canola-year-to-convert = 2 [set canola2011 canola2011 + pasture-to-convert] if canola-year-to-convert = 3 [set canola2012 canola2012 + pasture-to-convert] set ag-qs ag-qs + pasture-to-convert set general-ag general-ag + (pasture-to-convert / 10000) set pasture10 0 set pasture 0 ifelse land-suitability = 2 or land-suitability = 3 [set pcolor red ] [set pcolor green] ] ] ; ] setup-pollination end ;dividing by 10,000 converts m2 to hectares to calculate-natland-buffers ask all-canola-patches [set natland-buffer (sum [natland-area] of neighbors + [natland-area] of self) / 10000] end to run-pollination-model ask all-canola-patches [set poll-profit-ha 0] ask all-canola-patches [set poll-profit-patch 0] rotate-crops calculate-natland-buffers calculate-pollination-deficit calculate-poll-profit tick if ticks = model-years [reset-ticks stop] ; ]] end to rotate-crops set ticks-2009 [0 4 8 12 16 20 24 28 32 36 40 44 48] set ticks-2010 [1 5 9 13 17 21 25 29 33 37 41 45 49] set ticks-2011 [2 6 10 14 18 22 26 30 34 38 42 46 50] set ticks-2012 [3 7 11 15 19 23 27 31 35 39 43 47 51] if member? ticks ticks-2009 [set canola-patches-this-year (patches with [canola2009 > 0])] if member? ticks ticks-2010 [set canola-patches-this-year (patches with [canola2010 > 0])] if member? ticks ticks-2011 [set canola-patches-this-year (patches with [canola2011 > 0])] if member? ticks ticks-2012 [set canola-patches-this-year (patches with [canola2012 > 0])] end to calculate-pollination-deficit ask canola-patches-this-year [ set bee-abund (natland-buffer * 0.264 + 6.06) set poll-def (((bee-abund ^ 0.48) * 1.29) - 12.54) ] end to calculate-poll-profit ; calculates the increase in seed set attributatble to bees ; (difference between no pollinators = -12.54, and 'observed' pollinator numbers) ask canola-patches-this-year [ set bee-seedset poll-def + 12.54 set total-seedset poll-def + 25 ; total possible seeds-per-pod is 25.0 +/- 0.2) ] ; calculates yield per hectare based on numbers in Morandin 2006) ask canola-patches-this-year [ set poll-yield-ha bee-seedset * 73.33333 set poll-profit-ha poll-yield-ha * canola-price set canola-total-yield-per-ha total-seedset * 73.33333 set canola-total-revenue-per-ha canola-total-yield-per-ha * canola-price ] if member? ticks ticks-2009 [ask canola-patches-this-year [ set poll-profit-patch (poll-profit-ha * canola2009 / 10000) set canola-total-yield (canola-total-yield-per-ha * canola2009 / 10000) set canola-total-revenue (canola-total-revenue-per-ha * canola2009 / 10000) ]] if member? ticks ticks-2010 [ask canola-patches-this-year [ set poll-profit-patch (poll-profit-ha * canola2010 / 10000) set canola-total-yield (canola-total-yield-per-ha * canola2010 / 10000) set canola-total-revenue (canola-total-revenue-per-ha * canola2010 / 10000) ]] if member? ticks ticks-2011 [ask canola-patches-this-year [ set poll-profit-patch (poll-profit-ha * canola2011 / 10000) set canola-total-yield (canola-total-yield-per-ha * canola2011 / 10000) set canola-total-revenue (canola-total-revenue-per-ha * canola2011 / 10000) ]] if member? ticks ticks-2012 [ask canola-patches-this-year [ set poll-profit-patch (poll-profit-ha * canola2012 / 10000) set canola-total-yield (canola-total-yield-per-ha * canola2012 / 10000) set canola-total-revenue (canola-total-revenue-per-ha * canola2012 / 10000) ]] ask canola-patches-this-year [ set cumulative-poll-profit-patch cumulative-poll-profit-patch + poll-profit-patch set pollination-npv (pollination-npv + poll-profit-patch / ((1 + (discount-rate / 100)) ^ ticks)) set canola-revenue-npv (canola-revenue-npv + canola-total-revenue / ((1 + (discount-rate / 100)) ^ ticks)) set pollination-npv-per-ha pollination-npv / area set canola-revenue-npv-per-ha canola-revenue-npv / area ] ask all-canola-patches [ set hay-yield (pasture10 / 10000) * 0.769 ; estimate of per-hectare hay yield (tonnes/ha). Average of Regions 3 & 4 (1.7 t/acre & 2.1 t/acre, converted to t/ha). Source: http://www1.agric.gov.ab.ca/$Department/deptdocs.nsf/all/sdd15012 let hay-value-this-year hay-yield * 59.10 ; based on per-ton value of hay set hay-npv (hay-npv + hay-value-this-year / ((1 + (discount-rate / 100)) ^ ticks)) set hay-npv-per-ha hay-npv / area ] end ; ------------------------------------------------------------------------------------------------------------------------------------------------------------ ;4. BIODIVERSITY MODEL ; ------------------------------------------------------------------------------------------------------------------------------------------------------------ ; Calculates biodviersity index ("intactness") based on simplified equations derived from ABMI data. to calc-intactness ask land-patches [ ; pcHF ln(pcHF+1) pcHF^2 let aLHard -3.475 let cLHard 0.04375 let aLSoft -2.7 let cLSoft 0.0275 let aUrbInd -0.182627522 let bUrbInd -14.96146454 let cUrbInd 0.000414558 let aAg -0.551299069 let bAg -7.509875121 let cAg 0.001666536 let aFor -0.323635507 let bFor -5.170844426 let cFor 0.000312543 ; all of the "/ (area * 100)" is to convert areas of each HF type into a 0-100% of each patch; area represents the patch size in hectares. set hard-linear-intactness 100 + aLHard * (hard-qs / (area * 100)) + cLHard * (hard-qs / (area * 100)) ^ 2 let soft-linear-intactness-a 100 + aLSoft * (hard-qs / (area * 100)) + cLSoft * (hard-qs / (area * 100)) ^ 2 let soft-linear-intactness-b 100 + aLSoft * ((soft-qs + hard-qs) / (area * 100)) + cLSoft * ((soft-qs + hard-qs) / (area * 100)) ^ 2 set soft-linear-intactness soft-linear-intactness-a - soft-linear-intactness-b let urbind-intactnessa 100 + aUrbInd * ((soft-qs + hard-qs) / (area * 100)) + bUrbInd * ln(((soft-qs + hard-qs) / (area * 100)) + 1) + cUrbInd * ((soft-qs + hard-qs ) / (area * 100)) ^ 2 let urbind-intactnessb 100 + aUrbInd * ((soft-qs + hard-qs + (urbind-qs + hwet-qs)) / (area * 100)) + bUrbInd * ln(((soft-qs + hard-qs + (urbind-qs + hwet-qs)) / (area * 100)) + 1) + cUrbInd * ((soft-qs + hard-qs + (urbind-qs + hwet-qs)) / (area * 100)) ^ 2 set urbind-intactness urbind-intactnessa - urbind-intactnessb let agric-intactnessa 100 + aAg * ((soft-qs + hard-qs + (urbind-qs + hwet-qs) ) / (area * 100)) + bAg * ln( ((soft-qs + hard-qs + (urbind-qs + hwet-qs) ) / (area * 100)) + 1) + cAg * ((soft-qs + hard-qs + (urbind-qs + hwet-qs) ) / (area * 100)) ^ 2 let agric-intactnessb 100 + aAg * ((soft-qs + hard-qs + (urbind-qs + hwet-qs) + ag-qs) / (area * 100)) + bAg * ln( ((soft-qs + hard-qs + (urbind-qs + hwet-qs) + ag-qs) / (area * 100)) + 1) + cAg * ((soft-qs + hard-qs + (urbind-qs + hwet-qs) + ag-qs) / (area * 100)) ^ 2 set agric-intactness agric-intactnessa - agric-intactnessb let forestry-intactnessa 100 + aFor * ((soft-qs + hard-qs + (urbind-qs + hwet-qs) + ag-qs ) / (area * 100)) + bFor * ln(((soft-qs + hard-qs + (urbind-qs + hwet-qs) + ag-qs ) / (area * 100)) + 1) + cFor * ((soft-qs + hard-qs + (urbind-qs + hwet-qs) + ag-qs ) / (area * 100)) ^ 2 let forestry-intactnessb 100 + aFor * ((soft-qs + hard-qs + (urbind-qs + hwet-qs) + ag-qs + (cutblock * 10000)) / (area * 100)) + bFor * ln(((soft-qs + hard-qs + (urbind-qs + hwet-qs) + ag-qs + (cutblock * 10000)) / (area * 100)) + 1) + cFor * ((soft-qs + hard-qs + (urbind-qs + hwet-qs) + ag-qs + (cutblock * 10000)) / (area * 100)) ^ 2 set forestry-intactness forestry-intactnessa - forestry-intactnessb set intactness hard-linear-intactness - soft-linear-intactness - urbind-intactness - agric-intactness - forestry-intactness ] end ; ------------------------------------------------------------------------------------------------------------------------------------------------------------ ;5. WATER PURIFICATION MODEL ; ------------------------------------------------------------------------------------------------------------------------------------------------------------ to setup-water-model change-elevation calculate-slope set-cover setup-rivers setup-river-network setup-stations end ;--------------Setup Elevation----------------------------- to change-elevation ask land-patches [ set hydro-elevation (elevation + channel-elevation) / 2 ] ; end to calculate-slope ; This procedure calculates-slope utilizing NetLogo GIS extension perimitives and creates raster data using the gradient ; calcuated from DEM (elevation-dataset). let horizontal-gradient gis:convolve elevation-dataset 3 3 [ 1 0 -1 2 0 -2 1 0 -1 ] 1 1 let vertical-gradient gis:convolve elevation-dataset 3 3 [ 1 2 1 0 0 0 -1 -2 -1 ] 1 1 let gradient gis:create-raster gis:width-of elevation-dataset gis:height-of elevation-dataset gis:envelope-of elevation-dataset let x 0 repeat (gis:width-of gradient) [ let y 0 repeat (gis:height-of gradient) [ let gx gis:raster-value horizontal-gradient x y let gy gis:raster-value vertical-gradient x y if ((gx <= 0) or (gx >= 0)) and ((gy <= 0) or (gy >= 0)) [ gis:set-raster-value gradient x y sqrt ((gx * gx) + (gy * gy)) ] set y y + 1 ] set x x + 1 ] let min-g gis:minimum-of gradient let max-g gis:maximum-of gradient gis:apply-raster gradient slope ask patches [ ifelse (slope <= 0) or (slope >= 0) [ ] [ set slope 0 ] ] ; NaN fix end ;--------------Setup RUSLE Factors----------------------------- to set-cover ; This procedure links each land cover with the RUSLE cover factor (c-factor) and removal efficiency settings ; set by the user on the interface. It also calls the generate-sediments procedure. ask land-patches [ ;if unharvested, just use the original code if is-harvested = 0 [ set removal-rate (((ag-qs + LC_120) / (area * 10000)) * ag-removal / 100 ) + ((D / (area * 10000)) * deciduous-removal / 100) + (((C-S + C-P) / (area * 10000)) * conifer-removal / 100) + (((MX-S + MX-P) / (area * 10000)) * mixed-removal / 100) + (((LC_50 + for-qs) / (area * 10000)) * shrub-removal / 100) + ((LC_110 / (area * 10000)) * grass-removal / 100) + (((LC_34 + hard-qs + soft-qs + urbind-qs) / (area * 10000)) * developed-removal / 100) + ((LC_33 / (area * 10000)) * exposed-removal / 100) + ((LC_32 / (area * 10000)) * rock-rubble-removal / 100) set c-factor (((ag-qs + LC_120) / (area * 10000)) * ag-cover ) + ((D / (area * 10000)) * deciduous-cover) + (((C-S + C-P)/ (area * 10000)) * conifer-cover) + (((MX-S + MX-P) / (area * 10000)) * mixed-cover) + (((LC_50 + for-qs) / (area * 10000)) * shrub-cover) + ((LC_110 / (area * 10000)) * grass-cover) + (((LC_34 + hard-qs + soft-qs + urbind-qs) / (area * 10000)) * developed-cover) + ((LC_33 / (area * 10000)) * exposed-cover) + ((LC_32 / (area * 10000)) * rock-rubble-cover) ] ; if harvested, then all of the forest strata are "empty", so they are deleted here. Instead, the cutblock (for-qs) field must be used, as it now contains the same area that was in each of the forest classes. (For-qs was adjusted in the timber model to include the original for-qs (from ABMI HF layer) plus the forest strata areas (D, MX, C)) if is-harvested = 1 [ set removal-rate (((ag-qs + LC_120) / (area * 10000)) * ag-removal / 100 ) + (((LC_50 + (cutblock * 10000)) / (area * 10000)) * shrub-removal / 100) + ((LC_110 / (area * 10000)) * grass-removal / 100) + (((LC_34 + hard-qs + soft-qs + urbind-qs) / (area * 10000)) * developed-removal / 100) + ((LC_33 / (area * 10000)) * exposed-removal / 100) + ((LC_32 / (area * 10000)) * rock-rubble-removal / 100) set c-factor (((ag-qs + LC_120) / (area * 10000)) * ag-cover ) + (((LC_50 + (cutblock * 10000)) / (area * 10000)) * shrub-cover) + ((LC_110 / (area * 10000)) * grass-cover) + (((LC_34 + hard-qs + soft-qs + urbind-qs) / (area * 10000)) * developed-cover) + ((LC_33 / (area * 10000)) * exposed-cover) + ((LC_32 / (area * 10000)) * rock-rubble-cover) ] ] generate-sediments end to generate-sediments ; This procedure generates sediments based on the RUSLE equation (see model documentation for ; a detailed description). ask land-patches [ let r-factor 350 ; the r-factor (rainfall erosivity index) can be replaced with a raster if available, rather than using one value for the entire study region. set hillslope-sediment-generated (r-factor * k-factor * ls-factor * c-factor * area) ] end ;-----------------Setup Rivers----------------------------- to setup-rivers ; This procedure establishes the patches related to the river by interesting the line river data ; with the land-patches. All land-patches with intersecting the river are given a value of 1. This ; infomraiton is used to establish the river network in the 'setup-river-network' procedure. ask patches [ set is-river 0] ask land-patches gis:intersecting rivers-dataset [set is-river 1] ;correct any out-of-place rivers (spurious confluences, etc.). Errors are introduced during GIS import (line shapefily into cell-based Netlogo environment) ask patches with [pxcor = 232 and pycor = 70] [set is-river 1] ask patches with [pxcor = 231 and pycor = 69] [set is-river 1] ask patches with [pxcor = 224 and pycor = 62] [set is-river 1] ask patches with [pxcor = 223 and pycor = 61] [set is-river 1] ask patches with [pxcor = 605 and pycor = 133] [set is-river 1] ask patches with [pxcor = 604 and pycor = 132] [set is-river 1] ask patches with [pxcor = 232 and pycor = 232] [set is-river 0] ask patches with [pxcor = 231 and pycor = 236] [set is-river 0] ask patches with [pxcor = 230 and pycor = 234] [set is-river 0] ask patches with [pxcor = 238 and pycor = 230] [set is-river 0] ask patches with [pxcor = 270 and pycor = 248] [set is-river 0] ask patches with [pxcor = 305 and pycor = 231] [set is-river 0] ask patches with [pxcor = 315 and pycor = 250] [set is-river 0] ask patches with [pxcor = 335 and pycor = 256] [set is-river 0] ask patches with [pxcor = 337 and pycor = 253] [set is-river 0] ask patches with [pxcor = 340 and pycor = 250] [set is-river 0] ask patches with [pxcor = 177 and pycor = 97] [set is-river 0] ask patches with [pxcor = 108 and pycor = 100] [set is-river 0] ask patches with [pxcor = 189 and pycor = 172] [set is-river 0] ask patches with [pxcor = 126 and pycor = 139] [set is-river 0] ask patches with [pxcor = 126 and pycor = 140] [set is-river 0] ask patches with [pxcor = 35 and pycor = 87] [set is-river 0] ;setup main river outlets ask patches with [pxcor = 625 and pycor = 286] [set outlet-ID 11] ; North Saskatchewan ask patches with [pxcor = 633 and pycor = 182] [set outlet-ID 12] ; Battle ;Clean up any river agents that are out-of-place (tributary is identified just to keep track). ask patches with [pxcor = 210 and pycor = 193] [set is-river 0] ; Bighorn River ask patches with [pxcor = 210 and pycor = 193] [set is-river 0] ; Ram River ask patches with [pxcor = 210 and pycor = 193] [set is-river 0] ; rose creek ask patches with [pxcor = 187 and pycor = 172] [set is-river 0] ; Brazeau ask patches with [pxcor = 233 and pycor = 244] [set is-river 0] ; Tomahawk ask patches with [pxcor = 215 and pycor = 70] [set is-river 0] ; Clearwater ask patches with [pxcor = 215 and pycor = 72] [set is-river 0] ; Clearwater ask patches with [pxcor = 140 and pycor = 136] [set is-river 0] ; Clearwater ask patches with [pxcor = 139 and pycor = 135] [set is-river 0] ; Clearwater ask patches with [pxcor = 89 and pycor = 51] [set is-river 0] ; North Sask at Whirlpool ask land-patches with [is-river = 1] [set pcolor blue - 2] end to setup-river-network ; This procedure creates a netwok representing the river system. It does so by defining a starting ; at the river outlet. Then the process builds a network by iterively searching for patches ; identified as intersecting the river data set. Network nodes are created at each identified river patch, ; and directed links area created between upstream and downstream river nodes. ask rivers [die] ask links [die] let basin11out one-of patches with [is-river = 1 and outlet-ID = 11] let basin12out one-of patches with [is-river = 1 and outlet-ID = 12] set outlet (patch-set basin11out basin12out) ask outlet [ sprout-rivers 1[ set size 0.7 set is-outlet 1 set color cyan ] ] ask rivers [ let target-river self ask neighbors with [is-river = 1 and count rivers-here = 0] [ sprout-rivers 1 [ create-link-to target-river set size 0.1 set color blue ] ] ] repeat 850 [ ask rivers [ let target-river self ask neighbors with [is-river = 1 and count rivers-here = 0] [ sprout-rivers 1 [ create-link-to target-river set size 0.1 set color blue ] ] ] ] network-non-watershed-rivers ask land-patches [if is-river = 1 and count rivers-here = 0 [ set is-river 0 ] ] end to network-non-watershed-rivers ask land-patches with [pxcor >= 620 and count rivers-here = 0] [if is-river = 1 [ ask max-one-of neighbors4 [pxcor] [ if is-land-patch = 0 [ask myself [ sprout-rivers 1 [ set size 0.7 set color red ] ]] ]] ] ask land-patches with [pycor <= 16 and count rivers-here = 0] [if is-river = 1 [ ask min-one-of neighbors4 [pycor] [ if is-land-patch = 0 [ask myself [ sprout-rivers 1 [ set size 0.7 set color red ] ]] ]] ] repeat 70[ ask rivers [ let target-river self ask neighbors with [is-river = 1 and count rivers-here = 0] [ sprout-rivers 1 [ create-link-to target-river set size 0.1 set color green ] ] ]] end to setup-stations ask stations [die] set-default-shape stations "house" ; Setup river outlets ask patches with [pxcor = 625 and pycor = 286] [sprout-stations 1 [set size 5 set color magenta set station-name "North Saskatchewan River at SK border"]] ; North Saskatchewan ask patches with [pxcor = 633 and pycor = 182] [sprout-stations 1 [set size 5 set color magenta set station-name "Battle River"]] ; Battle ;Setup other monitoring points of interest ask patches with [pxcor = 338 and pycor = 263] [set outlet-ID 999 sprout-stations 1 [set size 4 set color green set station-name "Edmonton - Rossdale"]] ; Edmonton downtown (Rossdale plant) ask patches with [pxcor = 89 and pycor = 50] [set outlet-ID 999 sprout-stations 1 [set size 4 set color green set station-name "Whirlpool"]] ; North Sask at Whirlpool ask patches with [pxcor = 221 and pycor = 96] [set outlet-ID 999 sprout-stations 1 [set size 4 set color green set station-name "Clearwater River"]] ; Clearwater River ask patches with [pxcor = 207 and pycor = 141] [set outlet-ID 999 sprout-stations 1 [set size 4 set color green set station-name "Baptiste River"]] ; Baptiste River ask patches with [pxcor = 171 and pycor = 163] [set outlet-ID 999 sprout-stations 1 [set size 4 set color green set station-name "Nordegg River at Sunchild Rd"]] ; Nordegg River at water survey station ask patches with [pxcor = 214 and pycor = 178] [set outlet-ID 999 sprout-stations 1 [set size 4 set color green set station-name "Rose Creek at Alder Flats"]] ; Rose Creek at Alder Flats - water survey station ask patches with [pxcor = 187 and pycor = 173] [set outlet-ID 999 sprout-stations 1 [set size 4 set color green set station-name "Brazeau River"]] ; Brazeau River at outlet ask patches with [pxcor = 230 and pycor = 235] [set outlet-ID 999 sprout-stations 1 [set size 4 set color green set station-name "Mishow Creek"]] ; Mishow Creek ask patches with [pxcor = 239 and pycor = 230] [set outlet-ID 999 sprout-stations 1 [set size 4 set color green set station-name "Modeste Creek"]] ; Modeste Creek ask patches with [pxcor = 245 and pycor = 234] [set outlet-ID 999 sprout-stations 1 [set size 4 set color green set station-name "Tomahawk Creek"]] ; Tomahawk Creek outlet ask patches with [pxcor = 270 and pycor = 249] [set outlet-ID 999 sprout-stations 1 [set size 4 set color green set station-name "Wabamun Creek"]] ; Wabamun Creek ask patches with [pxcor = 293 and pycor = 232] [set outlet-ID 999 sprout-stations 1 [set size 4 set color green set station-name "Strawberry Creek"]] ; Strawberry Creek ask patches with [pxcor = 300 and pycor = 233] [set outlet-ID 999 sprout-stations 1 [set size 4 set color green set station-name "Weed Creek"]] ; Weed Creek ask patches with [pxcor = 313 and pycor = 236] [set outlet-ID 999 sprout-stations 1 [set size 4 set color green set station-name "Conjuring Creek"]] ; Conujuring Creek ask patches with [pxcor = 334 and pycor = 258] [set outlet-ID 999 sprout-stations 1 [set size 4 set color green set station-name "Whitemud Creek"]] ; Whitemud Creek end ; ------------------------------------------------------------------------------------------------------------------------------------------------------------ ; RUN WATER MODEL ; ------------------------------------------------------------------------------------------------------------------------------------------------------------ to run-water-model calc-natural-region-loading show "done calc-loading" calculate-surface-flow show "done surface flow" ; update-view show "done" end ;----------------------------Calculate Pollutant Loading------------------------- to calc-natural-region-loading ;Natural regions ; 1 = Rocky Mountain ; 2 = Foothills ; 3 = Grassland ; 4 = Parkland ; 5 = Boreal ; 6 = Canadian Shield set nr-count 0 repeat 6 [ set nr-count nr-count + 1 if nr-count = 1 [set calibration-count "mountain"] if nr-count = 2 [set calibration-count "foothills"] if nr-count = 3 [set calibration-count "western sedimentary basin"] if nr-count = 4 [set calibration-count "western sedimentary basin"] if nr-count = 5 [set calibration-count "western sedimentary basin"] if nr-count = 6 [set calibration-count "western sedimentary basin"] calibrate ; see calibration procedure at end of code file set ag-rolling-P ag-flat-P * 1.27 ; calibration was only done for flat agricultural regions; these conversion factors correct for the differences between flat and rolling/hilly terrain. set ag-hilly-P ag-flat-P * 1.57 ask land-patches [if natural-region = nr-count [ set barren-load-N barren * rainfall * barren-N set barren-load-P barren * rainfall * barren-P set barren-load-TSS barren * rainfall * barren-TSS set cutblock-load-N cutblock * rainfall * shrubland-N set cutblock-load-P cutblock * rainfall * shrubland-P set cutblock-load-TSS cutblock * rainfall * shrubland-TSS set feedlots-load-N feedlots * rainfall * feedlots-N set feedlots-load-P feedlots * rainfall * feedlots-P set feedlots-load-TSS feedlots * rainfall * feedlots-TSS set forest-load-N forest * rainfall * forest-N set forest-load-P forest * rainfall * forest-P set forest-load-TSS forest * rainfall * forest-TSS set grass-load-N grass * rainfall * grass-N set grass-load-P grass * rainfall * grass-P set grass-load-TSS grass * rainfall * grass-TSS set hard-roads-load-N hard-roads * rainfall * hard-roads-N set hard-roads-load-P hard-roads * rainfall * hard-roads-P set hard-roads-load-TSS hard-roads * rainfall * hard-roads-TSS set industrial-load-N industrial * rainfall * industrial-N set industrial-load-P industrial * rainfall * industrial-P set industrial-load-TSS industrial * rainfall * industrial-TSS set mines-disturbed-load-N mines-disturbed * rainfall * mines-disturbed-N set mines-disturbed-load-P mines-disturbed * rainfall * mines-disturbed-P set mines-disturbed-load-TSS mines-disturbed * rainfall * mines-disturbed-TSS set mines-undisturbed-load-N mines-undisturbed * rainfall * mines-undisturbed-N set mines-undisturbed-load-P mines-undisturbed * rainfall * mines-undisturbed-P set mines-undisturbed-load-TSS mines-undisturbed * rainfall * mines-undisturbed-TSS set pasture-load-N pasture * rainfall * pasture-N set pasture-load-P pasture * rainfall * pasture-P set pasture-load-TSS pasture * rainfall * pasture-TSS set pipelines-load-N pipelines * rainfall * pipelines-N set pipelines-load-P pipelines * rainfall * pipelines-P set pipelines-load-TSS pipelines * rainfall * pipelines-TSS set recreation-load-N recreation * rainfall * recreation-N set recreation-load-P recreation * rainfall * recreation-P set recreation-load-TSS recreation * rainfall * recreation-TSS set rural-residential-load-N rural-residential * rainfall * rural-residential-N set rural-residential-load-P rural-residential * rainfall * rural-residential-P set rural-residential-load-TSS rural-residential * rainfall * rural-residential-TSS set seismic-load-N seismic * rainfall * seismic-N set seismic-load-P seismic * rainfall * seismic-P set seismic-load-TSS seismic * rainfall * seismic-TSS set shrubland-load-N shrubland * rainfall * shrubland-N set shrubland-load-P shrubland * rainfall * shrubland-P set shrubland-load-TSS shrubland * rainfall * shrubland-TSS set suburban-load-N suburban * rainfall * suburban-N set suburban-load-P suburban * rainfall * suburban-P set suburban-load-TSS suburban * rainfall * suburban-TSS set trails-motorized-load-N trails-motorized * rainfall * trails-motorized-N set trails-motorized-load-P trails-motorized * rainfall * trails-motorized-P set trails-motorized-load-TSS trails-motorized * rainfall * trails-motorized-TSS set trails-nonmotorized-load-N trails-nonmotorized * rainfall * trails-nonmotorized-N set trails-nonmotorized-load-P trails-nonmotorized * rainfall * trails-nonmotorized-P set trails-nonmotorized-load-TSS trails-nonmotorized * rainfall * trails-nonmotorized-TSS set transmission-lines-load-N transmission-lines * rainfall * transmission-lines-N set transmission-lines-load-P transmission-lines * rainfall * transmission-lines-P set transmission-lines-load-TSS transmission-lines * rainfall * transmission-lines-TSS set urban-load-N urban * rainfall * urban-N set urban-load-P urban * rainfall * urban-P set urban-load-TSS urban * rainfall * urban-TSS set wellpads-load-N wellpads * rainfall * wellpads-N set wellpads-load-P wellpads * rainfall * wellpads-P set wellpads-load-TSS wellpads * rainfall * wellpads-TSS if (general-ag > 0) and slope < 25 [ set ag-load-N (general-ag ) * rainfall * ag-flat-N set ag-load-P (general-ag ) * rainfall * ag-flat-P set ag-load-TSS (general-ag) * rainfall * ag-flat-TSS ] if (general-ag > 0) and slope >= 25 and slope <= 100 [ set ag-load-N (general-ag ) * rainfall * ag-rolling-N set ag-load-P (general-ag) * rainfall * ag-rolling-P set ag-load-TSS (general-ag) * rainfall * ag-rolling-TSS ] if (general-ag - pasture > 0) and slope > 100 [ set ag-load-N (general-ag ) * rainfall * ag-hilly-N set ag-load-P (general-ag ) * rainfall * ag-hilly-P set ag-load-TSS (general-ag ) * rainfall * ag-hilly-TSS ] set load-N barren-load-N + cutblock-load-N + feedlots-load-N + forest-load-N + grass-load-N + hard-roads-load-N + industrial-load-N + mines-disturbed-load-N + mines-undisturbed-load-N + pasture-load-N + pipelines-load-N + recreation-load-N + rural-residential-load-N + seismic-load-N + shrubland-load-N + suburban-load-N + trails-motorized-load-N + trails-nonmotorized-load-N + transmission-lines-load-N + urban-load-N + wellpads-load-N + ag-load-N set load-P barren-load-P + cutblock-load-P + feedlots-load-P + forest-load-P + grass-load-P + hard-roads-load-P + industrial-load-P + mines-disturbed-load-P + mines-undisturbed-load-P + pasture-load-P + pipelines-load-P + recreation-load-P + rural-residential-load-P + seismic-load-P + shrubland-load-P + suburban-load-P + trails-motorized-load-P + trails-nonmotorized-load-P + transmission-lines-load-P + urban-load-P + wellpads-load-P + ag-load-P set load-TSS barren-load-TSS + cutblock-load-TSS + feedlots-load-TSS + forest-load-TSS + grass-load-TSS + hard-roads-load-TSS + industrial-load-TSS + mines-disturbed-load-TSS + mines-undisturbed-load-TSS + pasture-load-TSS + pipelines-load-TSS + recreation-load-TSS + rural-residential-load-TSS + seismic-load-TSS + shrubland-load-TSS + suburban-load-TSS + trails-motorized-load-TSS + trails-nonmotorized-load-TSS + transmission-lines-load-TSS + urban-load-TSS + wellpads-load-TSS + ag-load-TSS ]] ] end to calc-surface-water ; This procedure calcuates runoff based on annual runoff equations in Donahue (2013). set ag-runoff 0.5 set forest-runoff 0.3 set shrub-runoff 0.28 set grass-runoff 0.26 set road-runoff 0.87 set high-compact-runoff 0.5 set barren-urbind-runoff 0.69 ;sets the runoff coeffecienct for each patch, based on the area of each LULC type in each patch multiplied by its ;corresponding runoff coefficient set on the model interface. the "*0.9" is based on Donahue (2013), as the percent ;of rainfall events that lead to runoff. ask land-patches [ set runoff-coefficient (((ag-qs + LC_120) / (area * 10000)) * ag-runoff) + (((D + C-S + C-P + MX-S + MX-P) / (area * 10000)) * forest-runoff) + (((LC_50 + for-qs) / (area * 10000)) * shrub-runoff) + (((LC_110 + pasture10) / (area * 10000)) * grass-runoff) + ((hard-qs / (area * 10000)) * road-runoff) + ((soft-qs / (area * 10000)) * high-compact-runoff) + (((LC_32 + LC_33 + LC_34 + urbind-qs) / (area * 10000)) * barren-urbind-runoff) set runoff (rainfall * 0.9 * runoff-coefficient) ;runoff in mm ] end to calculate-surface-flow ; This is the main flow routing procedure. It sets and tracks key variables (i.e. sediment supply and deposition), ; tracks the movement of runoff across the landscape. More specific annotation are provided below. calc-surface-water ask raindrops [die] ask land-patches [ set flow 0 set pcolor white set sediments-deposited 0 set p-deposited 0 set n-deposited 0 set tss-deposited 0 set sediment-supply 0 set p-supply 0 set n-supply 0 set tss-supply 0 ] ; This block creates raindrop agents based on associated patch variables measuring precipation and run-off ask land-patches with [runoff > 0] [ sprout-raindrops 1 [ set color blue set flow-volume (runoff * area * 10) ; convert rainfall/runoff measured in mm to m3 of water flow. (Area measured in hectares). set size flow-volume / 100000 ; raindrops with larger volumes appear larger on-screen. set my-home [] set my-home patch-here set my-route [] set my-route patch-here set sediment-mass (hillslope-sediment-generated ) ; Tracks quantity of sediment mass, however does not measure concentration set p-mass load-P set n-mass load-N set tss-mass load-TSS ]] set total-sediment-mass-in-transport sum [sediment-mass] of raindrops ; This block of code routes the raindrop agents from the precipitation patch source downhill until it reaches a river network. ; Once the raindrop agent reaches the river network it values are transfered to the river netwok and moved downstream (i.e. from network ; node to network node). Sequential steps are measured in "rain-steps" with represents the movement of a raindrop agent to an adjacent patch. ; At every step a series of variables are measured and tracked. Rain-steps only need to transfer raindrops overland until they reach a river; ; once they reach the river network, the raindrop's values are transferred to the river agent it has reached (at which point the raindrop "dies"), ; and then values are communicated downstream along the river network. set rain-steps 20 let step-count rain-steps repeat rain-steps [ ;rain-steps is the number of times the following sequence is repeated; the number needs to be high enough to allow all raindrops to traverse enough cells to reach the river network. set step-count step-count - 1 show step-count ask raindrops [ ; If the current patch is does not intersect with a river, but a neighboring patch is, move to one of the patches that is a river, ; otherwise flow downhill. if count rivers-here = 0 [ ifelse count neighbors with [is-river = 1] > 0 [ move-to one-of neighbors with [is-river = 1] set color blue set my-route (patch-set patch-here my-route ) ask patch-here [ set flow (flow + [flow-volume] of myself) let sediment-contribution [sediment-mass] of myself * removal-rate let p-removal [p-mass] of myself * removal-rate let n-removal [n-mass] of myself * removal-rate let tss-removal [tss-mass] of myself * removal-rate set sediments-deposited sediments-deposited + sediment-contribution set p-deposited p-deposited + p-removal ; cumulative amount of P that gets retained on this patch. set n-deposited n-deposited + n-removal set tss-deposited tss-deposited + tss-removal ask myself [ set sediment-mass sediment-mass - sediment-contribution set p-mass p-mass - p-removal ; P-mass of raindrop after depositing some of it on the patch. set n-mass n-mass - n-removal set tss-mass tss-mass - tss-removal ] ] ] ; If no river, go flow over land [ let target min-one-of neighbors [ hydro-elevation ] ifelse [hydro-elevation] of target < [hydro-elevation] of patch-here [ move-to target set color blue set my-route (patch-set patch-here my-route) ask patch-here [ set flow (flow + [flow-volume] of myself) let sediment-contribution [sediment-mass] of myself * removal-rate let p-removal [p-mass] of myself * removal-rate let n-removal [n-mass] of myself * removal-rate let tss-removal [tss-mass] of myself * removal-rate set sediments-deposited sediments-deposited + sediment-contribution set p-deposited p-deposited + p-removal set n-deposited n-deposited + n-removal set tss-deposited tss-deposited + tss-removal ask myself [ set sediment-mass sediment-mass - sediment-contribution set p-mass p-mass - p-removal set n-mass n-mass - n-removal set tss-mass tss-mass - tss-removal ] ] if [basin] of patch-here < 1 [die] ] [set color green] ] ] ]] show "raindrop flow to river done" ;In this step, the the values of each raindrop sitting "in" a river agent are tranferred to that river. ;Those river values (N-mass, etc.) get passed along downstream in a later section. ask rivers [set my-N (sum [N-mass] of raindrops-here)] ask rivers [set my-P (sum [P-mass] of raindrops-here)] ask rivers [set my-tss (sum [tss-mass] of raindrops-here)] ask rivers [set my-sediment (sum [sediment-mass] of raindrops-here)] ask rivers [set my-flow (sum [flow-volume] of raindrops-here)] ask raindrops [ask my-home [ set N-supply ([N-mass] of myself) ; sets N-supply to the amount of N still in the raindrop when it hits the river set P-supply ([P-mass] of myself) set tss-supply ([tss-mass] of myself) set sediment-supply ([sediment-mass] of myself) ] ] ask raindrops [die] ; raindrops are no longer needed, as all nutrient and flow info have been transferred to the river agents ask rivers [set N-to-contribute my-N] ask rivers [set P-to-contribute my-P] ask rivers [set tss-to-contribute my-tss] ask rivers [set sediment-to-contribute my-sediment] ask rivers [set flow-to-contribute my-flow] set total-sediment-mass-in-transport sum [my-sediment] of rivers set total-sediments-deposited sum [sediments-deposited] of land-patches show "done surface flow" calc-river-values end to update-hydro-stations ask stations [ set my-monitoring-point min-one-of land-patches with [is-river = 1] [distance myself] set station-flow [flow] of my-monitoring-point ] end ; ------------------------------------------------------------------------------------------------------------------------------------------------------------ ; REPORTING ; ------------------------------------------------------------------------------------------------------------------------------------------------------------ to calc-river-values ; This section transfers values of each river downstream along the river network, such that each point in the network tracks its cumulative flow and pollutant loading. show "set headwaters river values" set headwaters (turtle-set rivers with [children = 0]) set tributaries (turtle-set headwaters) set tributary-parents (turtle-set [out-link-neighbors] of tributaries) ask tributary-parents[ set my-N (my-N + (sum [N-to-contribute] of in-link-neighbors)) set N-to-contribute (N-to-contribute + (sum [N-to-contribute] of in-link-neighbors)) ask in-link-neighbors [set N-to-contribute 0] set my-P (my-P + (sum [P-to-contribute] of in-link-neighbors)) set P-to-contribute (P-to-contribute + (sum [P-to-contribute] of in-link-neighbors)) ask in-link-neighbors [set P-to-contribute 0] set my-tss (my-tss + (sum [tss-to-contribute] of in-link-neighbors)) set tss-to-contribute (tss-to-contribute + (sum [tss-to-contribute] of in-link-neighbors)) ask in-link-neighbors [set tss-to-contribute 0] set my-sediment (my-sediment + (sum [sediment-to-contribute] of in-link-neighbors)) set sediment-to-contribute (sediment-to-contribute + (sum [sediment-to-contribute] of in-link-neighbors)) ask in-link-neighbors [set sediment-to-contribute 0] set my-flow (my-flow + (sum [flow-to-contribute] of in-link-neighbors)) set flow-to-contribute (flow-to-contribute + (sum [flow-to-contribute] of in-link-neighbors)) ask in-link-neighbors [set flow-to-contribute 0] ] show "start transfer values downstream" repeat 850[ set tributaries (turtle-set tributary-parents) set tributary-parents (turtle-set [out-link-neighbors] of tributaries) ask tributary-parents[ set my-N (my-N + (sum [N-to-contribute] of in-link-neighbors)) set N-to-contribute (N-to-contribute + (sum [N-to-contribute] of in-link-neighbors)) ask in-link-neighbors [set N-to-contribute 0] set my-P (my-P + (sum [P-to-contribute] of in-link-neighbors)) set P-to-contribute (P-to-contribute + (sum [P-to-contribute] of in-link-neighbors)) ask in-link-neighbors [set P-to-contribute 0] set my-tss (my-tss + (sum [tss-to-contribute] of in-link-neighbors)) set tss-to-contribute (tss-to-contribute + (sum [tss-to-contribute] of in-link-neighbors)) ask in-link-neighbors [set tss-to-contribute 0] set my-sediment (my-sediment + (sum [sediment-to-contribute] of in-link-neighbors)) set sediment-to-contribute (sediment-to-contribute + (sum [sediment-to-contribute] of in-link-neighbors)) ask in-link-neighbors [set sediment-to-contribute 0] set my-flow (my-flow + (sum [flow-to-contribute] of in-link-neighbors)) set flow-to-contribute (flow-to-contribute + (sum [flow-to-contribute] of in-link-neighbors)) ask in-link-neighbors [set flow-to-contribute 0] ] ] print "done calculating river values" calc-net-patch-values calc-per-ha-patch-values calc-river-patch-values calc-station-values end to calc-net-patch-values ask land-patches[ set net-N (N-supply - N-deposited) set net-P (P-supply - P-deposited) set net-tss (tss-supply - tss-deposited) set net-sediment (sediment-supply - sediments-deposited) ] end to calc-per-ha-patch-values ask land-patches [ set load-N-per-ha load-N / area set load-P-per-ha load-P / area set load-TSS-per-ha load-TSS / area set hillslope-sediment-generated-per-ha hillslope-sediment-generated / area set n-deposited-per-ha n-deposited / area set p-deposited-per-ha p-deposited / area set tss-deposited-per-ha tss-deposited / area set sediments-deposited-per-ha sediments-deposited / area set n-supply-per-ha n-supply / area set p-supply-per-ha p-supply / area set tss-supply-per-ha tss-supply / area set sediment-supply-per-ha sediment-supply / area set net-N-per-ha net-N / area set net-P-per-ha net-P / area set net-tss-per-ha net-tss / area set net-sediment-per-ha net-sediment / area ] end ;----Reporting---- to calc-station-values ask stations [ set station-N [my-N] of one-of rivers-here set station-P [my-P] of one-of rivers-here set station-TSS [my-tss] of one-of rivers-here set station-sediment [my-sediment] of one-of rivers-here set station-flow [my-flow] of one-of rivers-here ] end to calc-river-patch-values ask patches [ifelse count rivers-here = 1 [ set cum-river-N [my-N] of one-of rivers-here set cum-river-P [my-P] of one-of rivers-here set cum-river-TSS [my-tss] of one-of rivers-here set cum-river-sediment [my-sediment] of one-of rivers-here set cum-river-flow [my-flow] of one-of rivers-here ] [ set cum-river-N 0 ; sets values to 0 if there is no river present. set cum-river-P 0 set cum-river-TSS 0 set cum-river-sediment 0 set cum-river-flow 0 ] ] end ; ------------------------------------------------------------------------------------------------------------------------------------------------------------ ; YIELD CURVE EQUATIONS ; ------------------------------------------------------------------------------------------------------------------------------------------------------------ to set-yields ; This procedure defines the yield curve equations which calcualte forest growth in m3 for each forest-patch. ; ----- = MX-P Yield Strata ; Assumed species distribution ~ 50% conifer ; Assumed species distribution ~ 50% deciduous ; ----- C-S Yield Strata ; Assumed species distribution ~ 87.5% conifer ; Assumed species distribution ~ 12.5% deciduous ; ----- C-P Yield Strata ; Assumed species distribution ~ 87.5% conifer ; Assumed species distribution ~ 12.5% deciduous ; ----- MX-S Yield Strata ; Assumed species distribution ~ 50% conifer ; Assumed species distribution ~ 50% deciduous ; ----- D Yield Strata ; Assumed species distribution ~ 12.5% conifer ; Assumed species distribution ~ 87.5% deciduous ; ---------------- Boreal Plain Yield Curves ---------------- ; ----- = MX-P Yield Strata - Mixedwood Pine y = -0.0181x2 + 4.6205x - 35.76 ; ----- C-S Yield Strata - Conifer Spruce y = -0.0063x2 + 2.2359x - 7.833 ; ----- C-P Yield Strata - Conifer Pine y = -0.0121x2 + 3.6973x - 23.793 ; ----- MX-S Yield Strata - Mixedwood Spruce y = -0.021x2 + 5.0445x - 15.955 ; ----- D Yield Strata - Deciduous y = -0.0139x2 + 3.5775x + 5.0728 ifelse ecozone = 1 [ set total-patch-volume 0.0001 * (((-0.018 * (stand-age ^ 2) + (4.6205 * stand-age) - 35.769) * MX-P) + ((-0.0063 * (stand-age ^ 2) + (2.2359 * stand-age) - 7.833) * C-S) + ((-0.0121 * (stand-age ^ 2) + (3.6973 * stand-age) - 23.793) * C-P) + ((-0.021 * (stand-age ^ 2) + (5.0445 * stand-age) - 15.955) * MX-S) + ((-0.0139 * (stand-age ^ 2) + (3.5775 * stand-age) - 5.0728) * D)) set conifer-volume 0.0001 * (((-0.018 * (stand-age ^ 2) + (4.6205 * stand-age) - 35.769) * MX-P * 0.5) + ((-0.0063 * (stand-age ^ 2) + (2.2359 * stand-age) - 7.833) * C-S * 0.875) + ((-0.0121 * (stand-age ^ 2) + (3.6973 * stand-age) - 23.793) * C-P * 0.875) + ((-0.021 * (stand-age ^ 2) + (5.0445 * stand-age) - 15.955) * MX-S * 0.5) + ((-0.0139 * (stand-age ^ 2) + (3.5775 * stand-age) - 5.0728) * D * 0.125)) set deciduous-volume 0.0001 * (((-0.018 * (stand-age ^ 2) + (4.6205 * stand-age) - 35.769) * MX-P * 0.5) + ((-0.0063 * (stand-age ^ 2) + (2.2359 * stand-age) - 7.833) * C-S * 0.125) + ((-0.0121 * (stand-age ^ 2) + (3.6973 * stand-age) - 23.793) * C-P * 0.125) + ((-0.021 * (stand-age ^ 2) + (5.0445 * stand-age) - 15.955) * MX-S * 0.5) + ((-0.0139 * (stand-age ^ 2) + (3.5775 * stand-age) - 5.0728) * D * 0.875)) ] ; ---------------- Montane Cordillera Yields ---------------- ; ----- MX-P Yield Strata - Mixedwood Pine y = -0.0073x2 + 3.5106x - 25.912 ; ----- C-S Yield Strata - Conifer Spruce y = -0.0049x2 + 3.1472x - 20.612 ; ----- C-P Yield Strata - Conifer Pine y = -0.0081x2 + 3.5594x - 22.409 ; ----- MX-S Yield Strata - Mixedwood Spruce y = -0.0096x2 + 4.111x - 42.67 ; ----- D Yield Strata - Deciduous y = -0.012x2 + 3.4575x - 24.277 [ set total-patch-volume 0.0001 * (((-0.0073 * (stand-age ^ 2) + (3.5106 * stand-age) - 25.912) * MX-P) + ((-0.0049 * (stand-age ^ 2) + (3.1472 * stand-age) - 20.612) * C-S) + ((-0.0081 * (stand-age ^ 2) + (3.5594 * stand-age) - 22.409) * C-P) + ((-0.0096 * (stand-age ^ 2) + (4.111 * stand-age) - 42.67) * MX-S) + ((-0.012 * (stand-age ^ 2) + (3.4575 * stand-age) - 24.277) * D)) set conifer-volume 0.0001 * (((-0.0073 * (stand-age ^ 2) + (3.5106 * stand-age) - 25.912) * MX-P * 0.5) + ((-0.0049 * (stand-age ^ 2) + (3.1472 * stand-age) - 20.612) * C-S * 0.875) + ((-0.0081 * (stand-age ^ 2) + (3.5594 * stand-age) - 22.409) * C-P * 0.875) + ((-0.0096 * (stand-age ^ 2) + (4.111 * stand-age) - 42.67) * MX-S * 0.5) + ((-0.012 * (stand-age ^ 2) + (3.4575 * stand-age) - 24.277) * D * 0.125)) set deciduous-volume 0.0001 * (((-0.0073 * (stand-age ^ 2) + (3.5106 * stand-age) - 25.912) * MX-P * 0.5) + ((-0.0049 * (stand-age ^ 2) + (3.1472 * stand-age) - 20.612) * C-S * 0.125) + ((-0.0081 * (stand-age ^ 2) + (3.5594 * stand-age) - 22.409) * C-P * 0.125) + ((-0.0096 * (stand-age ^ 2) + (4.111 * stand-age) - 42.67) * MX-S * 0.5) + ((-0.012 * (stand-age ^ 2) + (3.4575 * stand-age) - 24.277) * D * 0.875)) ] end ; ------------------------------------------------------------------------------------------------------------------------------------------------------------ ; CARBON BUDGET EQUATIONS ; ------------------------------------------------------------------------------------------------------------------------------------------------------------ to calc-carbon-pools ; Using the relationship between forest stand age and carbon content, this procedure calcuates tonnes of ; carbon by CBM-CFS3 carbon pools forest each forest stand, then aggregates the pools into corresponding ; IPCC categories. The age - carbon relationships vary by stand type (or strata) and ecozone. ; Ecozone | Code ;-------------------------|----------- ; Boreal Plain | 1 ; Montane Cordillera | 2 ; Prairie | 3 ; Taiga Plain | 4 ; Boreal Shield | 5 ; Taiga Shield | 6 ; --------------- Boreal Plain Carbon Budget --------------- ifelse ecozone = 1 [ set aboveground-soft 0.0001 * (((-0.0000000000191 * (stand-age ^ 6) + 0.00000001290 * (stand-age ^ 5) - 0.00000343 * (stand-age ^ 4) + 0.000454 * (stand-age ^ 3) - 0.032941 * (stand-age ^ 2) + 1.475156 * (stand-age)) * MX-P) + ((-0.0000000000578 * (stand-age ^ 6) + 0.00000003837 * (stand-age ^ 5) - 0.00000995 * (stand-age ^ 4) + 0.001277 * (stand-age ^ 3) - 0.085479 * (stand-age ^ 2) + 3.105600 * (stand-age)) * C-S) + ((-0.0000000000445 * (stand-age ^ 6) + 0.00000002950 * (stand-age ^ 5) - 0.00000764 * (stand-age ^ 4) + 0.000976 * (stand-age ^ 3) - 0.065521 * (stand-age ^ 2) + 2.531881 * (stand-age)) * C-P) + ((-0.0000000000425 * (stand-age ^ 6) + 0.00000002799 * (stand-age ^ 5) - 0.00000721 * (stand-age ^ 4) + 0.000918 * (stand-age ^ 3) - 0.061530 * (stand-age ^ 2) + 2.273097 * (stand-age)) * MX-S) + ((-0.0000000000089 * (stand-age ^ 6) + 0.00000000582 * (stand-age ^ 5) - 0.00000148 * (stand-age ^ 4) + 0.000185 * (stand-age ^ 3) - 0.011901 * (stand-age ^ 2) + 0.408063 * (stand-age)) * D)) set aboveground-hard 0.0001 * (((-0.0000000000634 * (stand-age ^ 6) + 0.00000004471 * (stand-age ^ 5) - 0.00001222 * (stand-age ^ 4) + 0.001617 * (stand-age ^ 3) - 0.106149 * (stand-age ^ 2) + 3.212106 * (stand-age)) * MX-P) + ((-0.0000000000200 * (stand-age ^ 6) + 0.00000001309 * (stand-age ^ 5) - 0.00000333 * (stand-age ^ 4) + 0.000414 * (stand-age ^ 3) - 0.025793 * (stand-age ^ 2) + 0.733777 * (stand-age)) * C-S) + ((-0.0000000000270 * (stand-age ^ 6) + 0.00000001847 * (stand-age ^ 5) - 0.00000495 * (stand-age ^ 4) + 0.000653 * (stand-age ^ 3) - 0.043215 * (stand-age ^ 2) + 1.313245 * (stand-age)) * C-P) + ((-0.0000000000794 * (stand-age ^ 6) + 0.00000005461 * (stand-age ^ 5) - 0.00001444 * (stand-age ^ 4) + 0.001832 * (stand-age ^ 3) - 0.114107 * (stand-age ^ 2) + 3.302534 * (stand-age)) * MX-S) + ((-0.0000000000696 * (stand-age ^ 6) + 0.00000004560 * (stand-age ^ 5) - 0.00001162 * (stand-age ^ 4) + 0.001451 * (stand-age ^ 3) - 0.094150 * (stand-age ^ 2) + 3.354819 * (stand-age)) * D)) set belowground-soft 0.0001 * (((-0.0000000000042 * (stand-age ^ 6) + 0.00000000286 * (stand-age ^ 5) - 0.00000076 * (stand-age ^ 4) + 0.000101 * (stand-age ^ 3) - 0.007313 * (stand-age ^ 2) + 0.327485 * (stand-age)) * MX-P) + ((-0.0000000000128 * (stand-age ^ 6) + 0.00000000852 * (stand-age ^ 5) - 0.00000221 * (stand-age ^ 4) + 0.000283 * (stand-age ^ 3) - 0.018976 * (stand-age ^ 2) + 0.689443 * (stand-age)) * C-S) + ((-0.0000000000099 * (stand-age ^ 6) + 0.00000000655 * (stand-age ^ 5) - 0.00000170 * (stand-age ^ 4) + 0.000217 * (stand-age ^ 3) - 0.014546 * (stand-age ^ 2) + 0.562078 * (stand-age)) * C-P) + ((-0.0000000000094 * (stand-age ^ 6) + 0.00000000621 * (stand-age ^ 5) - 0.00000160 * (stand-age ^ 4) + 0.000204 * (stand-age ^ 3) - 0.013660 * (stand-age ^ 2) + 0.504627 * (stand-age)) * MX-S) + ((-0.0000000000020 * (stand-age ^ 6) + 0.00000000129 * (stand-age ^ 5) - 0.00000033 * (stand-age ^ 4) + 0.000041 * (stand-age ^ 3) - 0.002642 * (stand-age ^ 2) + 0.090590 * (stand-age)) * D)) set belowground-hard 0.0001 * (((-0.0000000000267 * (stand-age ^ 6) + 0.00000001798 * (stand-age ^ 5) - 0.00000470 * (stand-age ^ 4) + 0.000598 * (stand-age ^ 3) - 0.037749 * (stand-age ^ 2) + 1.086544 * (stand-age)) * MX-P) + ((-0.0000000000127 * (stand-age ^ 6) + 0.00000000826 * (stand-age ^ 5) - 0.00000209 * (stand-age ^ 4) + 0.000257 * (stand-age ^ 3) - 0.015821 * (stand-age ^ 2) + 0.439443 * (stand-age)) * C-S) + ((-0.0000000000158 * (stand-age ^ 6) + 0.00000001048 * (stand-age ^ 5) - 0.00000272 * (stand-age ^ 4) + 0.000344 * (stand-age ^ 3) - 0.021815 * (stand-age ^ 2) + 0.628333 * (stand-age)) * C-P) + ((-0.0000000000296 * (stand-age ^ 6) + 0.00000001975 * (stand-age ^ 5) - 0.00000510 * (stand-age ^ 4) + 0.000635 * (stand-age ^ 3) - 0.039121 * (stand-age ^ 2) + 1.101756 * (stand-age)) * MX-S) + ((-0.0000000000280 * (stand-age ^ 6) + 0.00000001826 * (stand-age ^ 5) - 0.00000463 * (stand-age ^ 4) + 0.000573 * (stand-age ^ 3) - 0.036068 * (stand-age ^ 2) + 1.123167 * (stand-age)) * D)) set DOM-above-other 0.0001 * ((( 0.0000001235 * (stand-age ^ 4) - 0.0000604 * (stand-age ^ 3) + 0.0127931 * (stand-age ^ 2) - 1.364440 * (stand-age) + 81.928) * MX-P) + (( 0.0000001493 * (stand-age ^ 4) - 0.0000755 * (stand-age ^ 3) + 0.0143606 * (stand-age ^ 2) - 1.276051 * (stand-age) + 62.510) * C-S) + (( 0.0000001258 * (stand-age ^ 4) - 0.0000650 * (stand-age ^ 3) + 0.0134389 * (stand-age ^ 2) - 1.361866 * (stand-age) + 77.914) * C-P) + (( 0.0000001306 * (stand-age ^ 4) - 0.0000647 * (stand-age ^ 3) + 0.0139668 * (stand-age ^ 2) - 1.493814 * (stand-age) + 89.516) * MX-S) + (( 0.0000001925 * (stand-age ^ 4) - 0.0000179 * (stand-age ^ 3) + 0.0171531 * (stand-age ^ 2) - 1.546602 * (stand-age) + 79.802) * D)) set DOM-above-litter 0.0001 * (((-0.0000001886 * (stand-age ^ 4) + 0.0000889 * (stand-age ^ 3) - 0.0148206 * (stand-age ^ 2) + 1.061768 * (stand-age) + 57.509) * MX-P) + ((-0.0000000467 * (stand-age ^ 4) + 0.0000237 * (stand-age ^ 3) - 0.0045768 * (stand-age ^ 2) + 0.432862 * (stand-age) + 52.912) * C-S) + ((-0.0000000971 * (stand-age ^ 4) + 0.0000482 * (stand-age ^ 3) - 0.0084571 * (stand-age ^ 2) + 0.638403 * (stand-age) + 49.022) * C-P) + ((-0.0000002201 * (stand-age ^ 4) + 0.0000970 * (stand-age ^ 3) - 0.0150985 * (stand-age ^ 2) + 1.038021 * (stand-age) + 66.725) * MX-S) + ((-0.0000000677 * (stand-age ^ 4) + 0.0000293 * (stand-age ^ 3) - 0.0047488 * (stand-age ^ 2) + 0.419882 * (stand-age) + 56.971) * D)) set DOM-below-slow 0.0001 * ((( 0.0002383 * (stand-age ^ 2) - 0.031574 * (stand-age) + 139.79) * MX-P) + (( 0.0001748 * (stand-age ^ 2) - 0.024462 * (stand-age) + 116.16) * C-S) + (( 0.0001748 * (stand-age ^ 2) - 0.024197 * (stand-age) + 117.773) * C-P) + (( 0.0002637 * (stand-age ^ 2) - 0.035171 * (stand-age) + 152.664) * MX-S) + (( 0.0002037 * (stand-age ^ 2) - 0.027671 * (stand-age) + 123.83) * D)) set DOM-below-fast 0.0001 * ((( 0.0000000671 * (stand-age ^ 4) - 0.0000321 * (stand-age ^ 3) + 0.0053247 * (stand-age ^ 2) - 0.349070 * (stand-age) + 9.422) * MX-P) + (( 0.0000000660 * (stand-age ^ 4) - 0.0000312 * (stand-age ^ 3) + 0.0050908 * (stand-age ^ 2) - 0.328006 * (stand-age) + 8.5561) * C-S) + (( 0.0000000729 * (stand-age ^ 4) - 0.0000344 * (stand-age ^ 3) + 0.0056248 * (stand-age ^ 2) - 0.362184 * (stand-age) + 9.3956) * C-P) + (( 0.0000000733 * (stand-age ^ 4) - 0.0000352 * (stand-age ^ 3) + 0.0058548 * (stand-age ^ 2) - 0.384548 * (stand-age) + 10.415) * MX-S) + (( 0.0000000634 * (stand-age ^ 4) - 0.0000299 * (stand-age ^ 3) + 0.0048643 * (stand-age ^ 2) - 0.313058 * (stand-age) + 8.2876) * D)) set DOM-below-vfast 0.0001 * (((-0.0000046 * (stand-age ^ 2) + 0.001364 * (stand-age) + 1.8456) * MX-P) + ((-0.0000042 * (stand-age ^ 2) + 0.001775 * (stand-age) + 1.7513) * C-S) + ((-0.0000045 * (stand-age ^ 2) + 0.001939 * (stand-age) + 1.777) * C-P) + ((-0.0000066 * (stand-age ^ 2) + 0.001649 * (stand-age) + 1.888) * MX-S) + ((-0.0000046 * (stand-age ^ 2) + 0.001408 * (stand-age) + 1.7905) * D)) ] ; --------------- Montane Cordillera Carbon Budget --------------- [ set aboveground-soft 0.0001 * (((-0.0000000000204 * (stand-age ^ 6) + 0.00000001406 * (stand-age ^ 5) - 0.00000381 * (stand-age ^ 4) + 0.000518 * (stand-age ^ 3) - 0.037542 * (stand-age ^ 2) + 1.580643 * (stand-age)) * MX-P) + (( 0.0000000000342 * (stand-age ^ 6) - 0.00000002084 * (stand-age ^ 5) + 0.00000468 * (stand-age ^ 4) - 0.000453 * (stand-age ^ 3) + 0.012842 * (stand-age ^ 2) + 0.996061 * (stand-age)) * C-S) + ((-0.0000000000436 * (stand-age ^ 6) + 0.00000002927 * (stand-age ^ 5) - 0.00000711 * (stand-age ^ 4) + 0.001010 * (stand-age ^ 3) - 0.069876 * (stand-age ^ 2) + 2.732713 * (stand-age)) * C-P) + ((-0.0000000000045 * (stand-age ^ 6) + 0.00000000391 * (stand-age ^ 5) - 0.00000133 * (stand-age ^ 4) + 0.000225 * (stand-age ^ 3) - 0.021845 * (stand-age ^ 2) + 1.337487 * (stand-age)) * MX-S) + ((-0.0000000000038 * (stand-age ^ 6) + 0.00000000263 * (stand-age ^ 5) - 0.00000071 * (stand-age ^ 4) + 0.000097 * (stand-age ^ 3) - 0.007218 * (stand-age ^ 2) + 0.320238 * (stand-age)) * D)) set aboveground-hard 0.0001 * (((-0.0000000000175 * (stand-age ^ 6) + 0.00000001267 * (stand-age ^ 5) - 0.00000362 * (stand-age ^ 4) + 0.000511 * (stand-age ^ 3) - 0.036775 * (stand-age ^ 2) + 1.460594 * (stand-age)) * MX-P) + ((-0.0000000000036 * (stand-age ^ 6) + 0.00000000262 * (stand-age ^ 5) - 0.00000075 * (stand-age ^ 4) + 0.000105 * (stand-age ^ 3) - 0.007539 * (stand-age ^ 2) + 0.293582 * (stand-age)) * C-S) + ((-0.0000000000084 * (stand-age ^ 6) + 0.00000000592 * (stand-age ^ 5) - 0.00000165 * (stand-age ^ 4) + 0.000227 * (stand-age ^ 3) - 0.015926 * (stand-age ^ 2) + 0.610343 * (stand-age)) * C-P) + ((-0.0000000000292 * (stand-age ^ 6) + 0.00000002026 * (stand-age ^ 5) - 0.00000544 * (stand-age ^ 4) + 0.000704 * (stand-age ^ 3) - 0.046820 * (stand-age ^ 2) + 1.743228 * (stand-age)) * MX-S) + ((-0.0000000000373 * (stand-age ^ 6) + 0.00000002512 * (stand-age ^ 5) - 0.00000663 * (stand-age ^ 4) + 0.000868 * (stand-age ^ 3) - 0.060237 * (stand-age ^ 2) + 2.396894 * (stand-age)) * D)) set belowground-soft 0.0001 * (((-0.0000000000045 * (stand-age ^ 6) + 0.00000000312 * (stand-age ^ 5) - 0.00000085 * (stand-age ^ 4) + 0.000115 * (stand-age ^ 3) - 0.008334 * (stand-age ^ 2) + 0.350903 * (stand-age)) * MX-P) + (( 0.0000000000076 * (stand-age ^ 6) - 0.00000000463 * (stand-age ^ 5) + 0.00000104 * (stand-age ^ 4) - 0.000100 * (stand-age ^ 3) + 0.002851 * (stand-age ^ 2) + 0.221126 * (stand-age)) * C-S) + ((-0.0000000000097 * (stand-age ^ 6) + 0.00000000650 * (stand-age ^ 5) - 0.00000171 * (stand-age ^ 4) + 0.000224 * (stand-age ^ 3) - 0.015513 * (stand-age ^ 2) + 0.606662 * (stand-age)) * C-P) + ((-0.0000000000010 * (stand-age ^ 6) + 0.00000000087 * (stand-age ^ 5) - 0.00000029 * (stand-age ^ 4) + 0.000050 * (stand-age ^ 3) - 0.004850 * (stand-age ^ 2) + 0.296922 * (stand-age)) * MX-S) + ((-0.0000000000009 * (stand-age ^ 6) + 0.00000000058 * (stand-age ^ 5) - 0.00000016 * (stand-age ^ 4) + 0.000022 * (stand-age ^ 3) - 0.001602 * (stand-age ^ 2) + 0.071093 * (stand-age)) * D)) set belowground-hard 0.0001 * (((-0.0000000000138 * (stand-age ^ 6) + 0.00000000926 * (stand-age ^ 5) - 0.00000243 * (stand-age ^ 4) + 0.000313 * (stand-age ^ 3) - 0.020493 * (stand-age ^ 2) + 0.669982 * (stand-age)) * MX-P) + ((-0.0000000000052 * (stand-age ^ 6) + 0.00000000351 * (stand-age ^ 5) - 0.00000092 * (stand-age ^ 4) + 0.000118 * (stand-age ^ 3) - 0.007721 * (stand-age ^ 2) + 0.250027 * (stand-age)) * C-S) + ((-0.0000000000084 * (stand-age ^ 6) + 0.00000000561 * (stand-age ^ 5) - 0.00000146 * (stand-age ^ 4) + 0.000187 * (stand-age ^ 3) - 0.012149 * (stand-age ^ 2) + 0.391554 * (stand-age)) * C-P) + ((-0.0000000000166 * (stand-age ^ 6) + 0.00000001104 * (stand-age ^ 5) - 0.00000286 * (stand-age ^ 4) + 0.000361 * (stand-age ^ 3) - 0.023105 * (stand-age ^ 2) + 0.741574 * (stand-age)) * MX-S) + ((-0.0000000000198 * (stand-age ^ 6) + 0.00000001306 * (stand-age ^ 5) - 0.00000336 * (stand-age ^ 4) + 0.000425 * (stand-age ^ 3) - 0.027620 * (stand-age ^ 2) + 0.907067 * (stand-age)) * D)) set DOM-above-other 0.0001 * ((( 0.0000000798 * (stand-age ^ 4) - 0.0000490 * (stand-age ^ 3) + 0.0122201 * (stand-age ^ 2) - 1.459207 * (stand-age) + 90.779) * MX-P) + (( 0.0000000953 * (stand-age ^ 4) - 0.0000551 * (stand-age ^ 3) + 0.0129027 * (stand-age ^ 2) - 1.463996 * (stand-age) + 88.432) * C-S) + (( 0.0000000687 * (stand-age ^ 4) - 0.0000433 * (stand-age ^ 3) + 0.0110609 * (stand-age ^ 2) - 1.350936 * (stand-age) + 86.692) * C-P) + (( 0.0000001351 * (stand-age ^ 4) - 0.0000635 * (stand-age ^ 3) + 0.0129587 * (stand-age ^ 2) - 1.326486 * (stand-age) + 78.041) * MX-S) + (( 0.0000001486 * (stand-age ^ 4) - 0.0000710 * (stand-age ^ 3) + 0.0133895 * (stand-age ^ 2) - 1.237782 * (stand-age) + 65.149) * D)) set DOM-above-litter 0.0001 * (((-0.0000001018 * (stand-age ^ 4) + 0.0000527 * (stand-age ^ 3) - 0.0100163 * (stand-age ^ 2) + 0.894971 * (stand-age) + 35.69) * MX-P) + (( 0.0000000108 * (stand-age ^ 4) - 0.00000005 * (stand-age ^ 3) - 0.0013920 * (stand-age ^ 2) + 0.369111 * (stand-age) + 31.971) * C-S) + ((-0.0000000730 * (stand-age ^ 4) + 0.0000397 * (stand-age ^ 3) - 0.0080844 * (stand-age ^ 2) + 0.758283 * (stand-age) + 32.427) * C-P) + ((-0.0000001013 * (stand-age ^ 4) + 0.0000484 * (stand-age ^ 3) - 0.0086808 * (stand-age ^ 2) + 0.796507 * (stand-age) + 36.192) * MX-S) + ((-0.0000000866 * (stand-age ^ 4) + 0.0000468 * (stand-age ^ 3) - 0.0095018 * (stand-age ^ 2) + 0.939242 * (stand-age) + 36.225) * D)) set DOM-below-slow 0.0001 * ((( 0.0003841 * (stand-age ^ 2) - 0.058605 * (stand-age) + 113.44) * MX-P) + (( 0.0004217 * (stand-age ^ 2) - 0.065388 * (stand-age) + 99.417) * C-S) + (( 0.0003240 * (stand-age ^ 2) - 0.048927 * (stand-age) + 105.03) * C-P) + (( 0.0003830 * (stand-age ^ 2) - 0.057756 * (stand-age) + 113.46) * MX-S) + (( 0.0004128 * (stand-age ^ 2) - 0.061277 * (stand-age) + 113.71) * D)) set DOM-below-fast 0.0001 * ((( 0.0000000813 * (stand-age ^ 4) - 0.0000386 * (stand-age ^ 3) + 0.0063756 * (stand-age ^ 2) - 0.414824 * (stand-age) + 10.608) * MX-P) + (( 0.0000000916 * (stand-age ^ 4) - 0.0000434 * (stand-age ^ 3) + 0.0071256 * (stand-age ^ 2) - 0.458267 * (stand-age) + 11.11) * C-S) + (( 0.0000000828 * (stand-age ^ 4) - 0.0000393 * (stand-age ^ 3) + 0.0064706 * (stand-age ^ 2) - 0.419171 * (stand-age) + 10.677) * C-P) + (( 0.0000000734 * (stand-age ^ 4) - 0.0000349 * (stand-age ^ 3) + 0.0057266 * (stand-age ^ 2) - 0.368115 * (stand-age) + 9.6273) * MX-S) + (( 0.0000000583 * (stand-age ^ 4) - 0.0000275 * (stand-age ^ 3) + 0.0044766 * (stand-age ^ 2) - 0.288114 * (stand-age) + 7.6008) * D)) set DOM-below-vfast 0.0001 * (((-0.0000030 * (stand-age ^ 2) + 0.002616 * (stand-age) + 1.7822) * MX-P) + ((-0.0000178 * (stand-age ^ 2) + 0.007406 * (stand-age) + 1.4588) * C-S) + ((-0.0000059 * (stand-age ^ 2) + 0.003217 * (stand-age) + 1.7631) * C-P) + ((-0.0000199 * (stand-age ^ 2) + 0.005031 * (stand-age) + 1.742) * MX-S) + ((-0.0000099 * (stand-age ^ 2) + 0.002983 * (stand-age) + 1.7309) * D)) ] ; set carbon pools to IPCC standard categories set ipcc-above aboveground-soft + aboveground-hard set ipcc-below belowground-soft + belowground-hard set ipcc-litter DOM-above-litter set ipcc-deadwood DOM-above-other + DOM-below-fast set ipcc-soc DOM-below-vfast + DOM-below-slow set ipcc-total ipcc-above + ipcc-below + ipcc-litter + ipcc-deadwood + ipcc-soc end ;------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ ; OUTPUT RASTER DATA FOR GIS ;------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ to output-all-data clear-non-land-patches output-forest-data output-pollination-data output-biodiversity-data output-water-data output-tributary-data end to output-data-per-ha clear-non-land-patches output-forest-data-per-ha output-pollination-data-per-ha output-biodiversity-data output-water-data-per-ha end to output-forest-data clear-non-land-patches gis:store-dataset (gis:patch-dataset timber-esv) (word "output/timber_esv" session_string ".asc") gis:store-dataset (gis:patch-dataset timber-esvp) (word "output/timber_esvp" session_string ".asc") gis:store-dataset (gis:patch-dataset carbon-esv) (word "output/carbon_esv" session_string ".asc") gis:store-dataset (gis:patch-dataset ccs-esv) (word "output/ccs_esv" session_string ".asc") gis:store-dataset (gis:patch-dataset carbon-storage) (word "output/carbon_storage" session_string ".asc") gis:store-dataset (gis:patch-dataset carbon-change) (word "output/carbon_change" session_string ".asc") end to output-forest-data-per-ha clear-non-land-patches gis:store-dataset (gis:patch-dataset timber-npv-per-ha) (word "output/timber_npv_per_ha" session_string ".asc") gis:store-dataset (gis:patch-dataset timber-value-potential-per-ha) (word "output/timber_value_potential_per_ha" session_string ".asc") gis:store-dataset (gis:patch-dataset carbon-value-per-ha) (word "output/carbon_value_per_ha" session_string ".asc") gis:store-dataset (gis:patch-dataset ccs-value-per-ha) (word "output/ccs_value_per_ha" session_string ".asc") gis:store-dataset (gis:patch-dataset carbon-storage-per-ha) (word "output/carbon_storage_per_ha" session_string ".asc") gis:store-dataset (gis:patch-dataset carbon-change-per-ha) (word "output/carbon_change_per_ha" session_string ".asc") end to output-pollination-data clear-non-land-patches gis:store-dataset (gis:patch-dataset pollination-npv) (word "output/pollination_npv" session_string ".asc") gis:store-dataset (gis:patch-dataset canola-total-yield) (word "output/canola_total_yield" session_string ".asc") gis:store-dataset (gis:patch-dataset canola-revenue-npv) (word "output/canola_revenue_npv" session_string ".asc") end to output-pollination-data-per-ha clear-non-land-patches gis:store-dataset (gis:patch-dataset pollination-npv-per-ha) (word "output/pollination_npv_per_ha" session_string ".asc") gis:store-dataset (gis:patch-dataset canola-total-yield-per-ha) (word "output/canola_total_yield_per_ha" session_string ".asc") gis:store-dataset (gis:patch-dataset canola-revenue-npv-per-ha) (word "output/canola_revenue_npv_per_ha" session_string ".asc") end to output-biodiversity-data clear-non-land-patches gis:store-dataset (gis:patch-dataset intactness) (word "output/intactness" session_string ".asc") end to output-water-data clear-non-land-patches ;Pollutant sources gis:store-dataset (gis:patch-dataset load-n) (word "output/n_load" session_string ".asc") gis:store-dataset (gis:patch-dataset load-p) (word "output/p_load" session_string ".asc") gis:store-dataset (gis:patch-dataset load-tss) (word "output/tss_load" session_string ".asc") gis:store-dataset (gis:patch-dataset hillslope-sediment-generated) (word "output/sed_generated" session_string ".asc") gis:store-dataset (gis:patch-dataset n-supply) (word "output/n_supply" session_string ".asc") gis:store-dataset (gis:patch-dataset p-supply) (word "output/p_supply" session_string ".asc") gis:store-dataset (gis:patch-dataset tss-supply) (word "output/tss_supply" session_string ".asc") gis:store-dataset (gis:patch-dataset sediment-supply) (word "output/sed_supply" session_string ".asc") ; Pollutant deposition/retention gis:store-dataset (gis:patch-dataset n-deposited) (word "output/n_deposited" session_string ".asc") gis:store-dataset (gis:patch-dataset p-deposited) (word "output/p_deposited" session_string ".asc") gis:store-dataset (gis:patch-dataset tss-deposited) (word "output/tss_deposited" session_string ".asc") gis:store-dataset (gis:patch-dataset sediments-deposited) (word "output/sed_deposited" session_string ".asc") gis:store-dataset (gis:patch-dataset net-n) (word "output/net_n" session_string ".asc") gis:store-dataset (gis:patch-dataset net-p) (word "output/net_p" session_string ".asc") gis:store-dataset (gis:patch-dataset net-tss) (word "output/net_tss" session_string ".asc") gis:store-dataset (gis:patch-dataset net-sediment) (word "output/net_sediment" session_string ".asc") output-river-data end to output-water-data-per-ha clear-non-land-patches ;Pollutant sources gis:store-dataset (gis:patch-dataset load-n-per-ha) (word "output/n_load_per_ha" session_string ".asc") gis:store-dataset (gis:patch-dataset load-p-per-ha) (word "output/p_load_per_ha" session_string ".asc") gis:store-dataset (gis:patch-dataset load-tss-per-ha) (word "output/tss_load_per_ha" session_string ".asc") gis:store-dataset (gis:patch-dataset hillslope-sediment-generated-per-ha) (word "output/sed_generated_per_ha" session_string ".asc") gis:store-dataset (gis:patch-dataset n-supply-per-ha) (word "output/n_supply_per_ha" session_string ".asc") gis:store-dataset (gis:patch-dataset p-supply-per-ha) (word "output/p_supply_per_ha" session_string ".asc") gis:store-dataset (gis:patch-dataset tss-supply-per-ha) (word "output/tss_supply_per_ha" session_string ".asc") gis:store-dataset (gis:patch-dataset sediment-supply-per-ha) (word "output/sed_supply_per_ha" session_string ".asc") ; Pollutant deposition/retention gis:store-dataset (gis:patch-dataset n-deposited-per-ha) (word "output/n_deposited_per_ha" session_string ".asc") gis:store-dataset (gis:patch-dataset p-deposited-per-ha) (word "output/p_deposited_per_ha" session_string ".asc") gis:store-dataset (gis:patch-dataset tss-deposited-per-ha) (word "output/tss_deposited_per_ha" session_string ".asc") gis:store-dataset (gis:patch-dataset sediments-deposited-per-ha) (word "output/sed_deposited_per_ha" session_string ".asc") gis:store-dataset (gis:patch-dataset net-n-per-ha) (word "output/net_n_per_ha" session_string ".asc") gis:store-dataset (gis:patch-dataset net-p-per-ha) (word "output/net_p_per_ha" session_string ".asc") gis:store-dataset (gis:patch-dataset net-tss-per-ha) (word "output/net_tss_per_ha" session_string ".asc") gis:store-dataset (gis:patch-dataset net-sediment-per-ha) (word "output/net_sediment_per_ha" session_string ".asc") end to output-river-data gis:store-dataset (gis:patch-dataset cum-river-N) (word "output/river_n" session_string ".asc") gis:store-dataset (gis:patch-dataset cum-river-P) (word "output/river_p" session_string ".asc") gis:store-dataset (gis:patch-dataset cum-river-tss) (word "output/river_tss" session_string ".asc") gis:store-dataset (gis:patch-dataset cum-river-sediment) (word "output/river_sediment" session_string ".asc") gis:store-dataset (gis:patch-dataset cum-river-flow) (word "output/river_flow" session_string ".asc") end to output-tributary-data ; creates a .csv file with information for each water monitoring station. carefully [ file-delete (word "output/tributary_data" session_string ".csv") ] [ ] file-open (word "output/tributary_data" session_string ".csv") file-type "Monitoring Point, Flow (m3), Total Nitrogen (kg), Total Phosphorus (kg), Total TSS (Kg), Total Sediment" file-print "" ask stations [ if outlet-id = 999 [ file-type station-name file-type "," file-type station-flow file-type "," file-type station-N file-type "," file-type station-P file-type "," file-type station-TSS file-type "," file-type station-sediment file-type "," file-print "" ] ] file-close end ;------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ ; UPDATE VIEW IN NETLOGO ;------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ to update-view ; This procedure updates the current world view on the interface ask links [show-link] ;--------Timber Maps if View = "Eligible Landbase" [ ask land-patches [set pcolor grey] ask eligible-forest [set pcolor green]] if View = "AVI - age-class" [ ask land-patches [set pcolor grey] ask forest-patches [set pcolor scale-color green age-class 200 0 ]] if View = "Standing Timber Volume" [ ask land-patches [set pcolor grey] set mx max [total-patch-volume] of land-patches set mn min [total-patch-volume] of land-patches ask forest-patches [set pcolor scale-color green total-patch-volume mx mn ]] if View = "Timber NPV" [ ask land-patches [set pcolor white] set mx max [timber-esv] of land-patches set mn min [timber-esv] of land-patches ask forest-patches [set pcolor scale-color red timber-esv mx mn]] if View = "Potential Timber NPV" [ ask land-patches [set pcolor white] set mx max [timber-esvp] of land-patches set mn min [timber-esvp] of land-patches ask forest-patches [set pcolor scale-color red timber-esvp mx mn]] if View = "Carbon Storage Value" [ ask land-patches [set pcolor white] set mx max [carbon-esv] of land-patches set mn min [carbon-esv] of land-patches ask forest-patches [set pcolor scale-color red carbon-esv mx mn]] if View = "Carbon Sequestration Value" [ ask land-patches [set pcolor white] set mx max [ccs-esv] of land-patches set mn min [ccs-esv] of land-patches ask forest-patches [ifelse ccs-esv < 0 [set pcolor scale-color red ccs-esv mn 0] [set pcolor scale-color green ccs-esv mx 0] ]] if View = "FMU" [ask land-patches [ set pcolor scale-color grey fmu 35 0]] ;---------Pollination Maps if View = "Canola 2009" [ ask land-patches [set pcolor white] ask patches [if canola2009 > 100000 [set pcolor yellow] ]] if View = "Canola 2010" [ ask land-patches [set pcolor white] ask patches [if canola2010 > 100000 [set pcolor yellow] ]] if View = "Canola 2011" [ ask land-patches [set pcolor white] ask patches [if canola2011 > 100000 [set pcolor yellow] ]] if View = "Canola 2012" [ ask land-patches [set pcolor white] ask patches [if canola2012 > 100000 [set pcolor yellow] ]] if View = "Pollinator Habitat" [ ask land-patches [set pcolor white] set mx 576 set mn 0 ask all-canola-patches [ set pcolor scale-color brown natland-buffer mx mn ]] if View = "Bee Abundance" [ ask land-patches [set pcolor white] set mx max [bee-abund] of land-patches set mn min [bee-abund] of land-patches ask canola-patches-this-year [ set pcolor scale-color orange bee-abund mx mn ]] if View = "Pollinator Profit" [ ask land-patches [set pcolor white] set mx max [pollination-npv] of land-patches set mn min [pollination-npv] of land-patches ask all-canola-patches [ set pcolor scale-color blue pollination-npv mx mn ]] ;----Biodiversity Index Map if View = "Biodiversity Index" [ ask land-patches [set pcolor scale-color green intactness 105 -0 ]] ;----Water Maps if View = "Watersheds"[ let watershed_colours remove-duplicates [basin] of land-patches foreach watershed_colours [ask land-patches [if basin = ? [set pcolor ? * 2]]] ] if View = "Precipitation"[ set mx max [rainfall] of land-patches set mn min [rainfall] of land-patches ask land-patches [ set pcolor scale-color blue rainfall mx mn ]] if View = "Runoff"[ set mx max [runoff] of land-patches set mn min [runoff] of land-patches ask land-patches [ set pcolor scale-color blue runoff mx mn ]] if View = "N Loading"[ set mx (max [load-N-per-ha] of land-patches) / 20 set mn min [load-N-per-ha] of land-patches ask land-patches [ set pcolor scale-color green load-N-per-ha mx mn ]] if View = "P Loading" [ set mx max [load-P-per-ha] of land-patches set mn min [load-P-per-ha] of land-patches ask land-patches [ set pcolor scale-color red load-P-per-ha mx mn ]] if View = "TSS Loading"[ set mx max [load-TSS-per-ha] of land-patches set mn min [load-TSS-per-ha] of land-patches ask land-patches [ set pcolor scale-color blue load-TSS-per-ha mx mn ]] if View = "Sediment Generated" [ set mx max [hillslope-sediment-generated] of land-patches set mn min [hillslope-sediment-generated] of land-patches ask land-patches [ set pcolor scale-color brown hillslope-sediment-generated mx mn ]] if View = "P Supply" [ set mx max [p-supply] of land-patches set mn min [p-supply] of land-patches ask land-patches [ set pcolor scale-color red p-supply mx mn ]] if View = "N Supply" [ set mx max [n-supply] of land-patches set mn min [n-supply] of land-patches ask land-patches [ set pcolor scale-color green n-supply mx mn ]] if View = "TSS Supply" [ set mx max [tss-supply] of land-patches set mn min [tss-supply] of land-patches ask land-patches [ set pcolor scale-color blue tss-supply mx mn ]] if View = "P Removal" [ set mx max [p-deposited] of land-patches set mn min [p-deposited] of land-patches ask land-patches [ set pcolor scale-color red p-deposited mx mn ]] if View = "N Removal" [ set mx max [n-deposited] of land-patches set mn min [n-deposited] of land-patches ask land-patches [ set pcolor scale-color green n-deposited mx mn ]] if View = "TSS Removal" [ set mx max [tss-deposited] of land-patches set mn min [tss-deposited] of land-patches ask land-patches [ set pcolor scale-color blue tss-deposited mx mn ]] if View = "Deposited Sediments" [ set mx max [sediments-deposited] of land-patches set mn min [sediments-deposited] of land-patches ask land-patches [ set pcolor scale-color red sediments-deposited mx mn ]] if View = "Net P" [ set mx max [net-p] of land-patches set mn min [net-p] of land-patches ask land-patches [ifelse net-p < 0 [set pcolor scale-color blue net-p mn 0] [set pcolor scale-color green net-p mx 0] ]] if View = "Net N" [ set mx max [net-n] of land-patches set mn min [net-n] of land-patches ask land-patches [ifelse net-n < 0 [set pcolor scale-color blue net-n mn 0] [set pcolor scale-color green net-n mx 0] ]] if View = "Net TSS" [ set mx max [net-tss] of land-patches set mn min [net-tss] of land-patches ask land-patches [ifelse net-tss < 0 [set pcolor scale-color blue net-tss mn 0] [set pcolor scale-color green net-tss mx 0] ]] if View = "Net Sediment" [ set mx max [net-sediment] of land-patches set mn min [net-sediment] of land-patches ask land-patches [ifelse net-sediment < 0 [set pcolor scale-color blue net-sediment mn 0] [set pcolor scale-color green net-sediment mx 0] ]] if View = "River P" [ set mx 250000 set mn -0 ask land-patches [ set pcolor scale-color red cum-river-p mx mn ] ask links [hide-link]] if View = "River N" [ set mx 5000000 set mn -0 ask land-patches [ set pcolor scale-color green cum-river-n mx mn ] ask links [hide-link]] if View = "River TSS" [ set mx 500000000 set mn -0 ask land-patches [ set pcolor scale-color blue cum-river-tss mx mn ] ask links [hide-link]] if View = "River Flow" [ set mx 10000000000 set mn -0 ask land-patches [ set pcolor scale-color blue cum-river-flow mx mn ] ask links [hide-link]] end ;------------------Default Variables ------------------- ; Resets all user-defined model input variables to their default settings to default-all-variables default-water-loading default-other-water-variables default-pollination-variables default-forest-variables end to default-water-loading ; resets water loading parameters to default values (from Donahue 2013) set ag-flat-n 0.01121 set ag-rolling-n 0.01419 set ag-hilly-n 0.01755 set barren-n 0.003697 set cutblock-n 0.0102 set feedlots-n 1.62012 set forest-n 0.0034 set grass-n 0.00097 set hard-roads-n 0.09825 set industrial-n 0.01426 set mines-disturbed-n 0.00531 set mines-undisturbed-n 0.00202 set pasture-n 0.00913 set pipelines-n 0.00519 set recreation-n 0.01124 set rural-residential-n 0.00316 set seismic-n 0.00259 set shrubland-n 0.00463 set suburban-n 0.00779 set trails-motorized-n 0.0144 set trails-nonmotorized-n 0.0078 set transmission-lines-n 0.00346 set urban-n 0.01436 set wellpads-n 0.01368 set ag-flat-p 0.00096 set ag-rolling-p 0.00122 set ag-hilly-p 0.00151 set barren-p 0.000251 set cutblock-p 0.000763 set feedlots-p 0.32423 set forest-p 0.00061 set grass-p 0.00013 set hard-roads-p 0.00314 set industrial-p 0.00184 set mines-disturbed-p 0.00068 set mines-undisturbed-p 0.00013 set pasture-p 0.00086 set pipelines-p 0.00201 set recreation-p 0.00187 set rural-residential-p 0.00026 set seismic-p 0.00101 set shrubland-p 0.000834 set suburban-p 0.00161 set trails-motorized-p 0.01211 set trails-nonmotorized-p 0.00447 set transmission-lines-p 0.00134 set urban-p 0.00178 set wellpads-p 0.00689 set ag-flat-tss 0.27041 set ag-rolling-tss 0.34251 set ag-hilly-tss 0.42363 ;set barren-tss 0.501253 set barren-tss 0 set cutblock-tss 0.69188 set feedlots-tss 4.99275 set forest-tss 0.5535 set grass-tss 0.07153 set hard-roads-tss 0.4133 set industrial-tss 1.08731 set mines-disturbed-tss 0.42273 set mines-undisturbed-tss 0.07153 set pasture-tss 0.29717 set pipelines-tss 0.54065 set recreation-tss 0.44149 set rural-residential-tss 0.06309 set seismic-tss 0.27032 set shrubland-tss 0.753 set suburban-tss 0.34922 set trails-motorized-tss 2.889 set trails-nonmotorized-tss 1.06635 set transmission-lines-tss 0.36043 set urban-tss 0.62382 set wellpads-tss 1.93873 end to default-other-water-variables set ag-cover 0.45 set deciduous-cover 0.1 set conifer-cover 0.1 set mixed-cover 0.1 set shrub-cover 0.2 set grass-cover 0.3 set developed-cover 0.7 set exposed-cover 0.45 set rock-rubble-cover 0.25 set ag-removal 15 set deciduous-removal 55 set conifer-removal 55 set mixed-removal 55 set shrub-removal 45 set grass-removal 45 set developed-removal 0 set exposed-removal 0 set rock-rubble-removal 0 set avoided-dredging 0.0135 set avoided-drinking-tss 0.0070 set avoided-drinking-P 50 set avoided-drinking-N 6.82 end to default-pollination-variables set canola-price 0.46 end to default-forest-variables set cost-to-roadside 35.25 set silviculture-cost 1000 set mill-opp-cost 50 set lumber-price 135 set pulp-price 843 set panel-price 290 set carbon-price 30 end ;------------------------------------------------------ ; Adjust water loading parameters by Natural Region ;------------------------------------------------------ ; This section iteratively changes the Phosphorus export coefficients for each natural region. Current values were obtained through latin hypercube sampling. to calibrate if calibration-count = "mountain" [ set ag-rolling-P 0.00149072298360802 set cutblock-P 0.000784748850663891 set rural-residential-P 0.00036503605388524 set barren-P 0.000172658669675828 set forest-P 0.000397720822001924 set hard-roads-P 0.00619780733020091 set pasture-P 0.00126341816597036 set urban-P 0.00184242975695385 set feedlots-P 0.561107683951232 ] if calibration-count = "foothills" [ set ag-rolling-P 0.00242173417220172 set cutblock-P 0.00102390860666954 set rural-residential-P 0.000135155900941929 set barren-P 0.000441515734956099 set forest-P 0.00116959307527833 set hard-roads-P 0.00381883325412194 set pasture-P 0.00145572859787429 set urban-P 0.00244396510336827 set feedlots-P 0.447522120677376 ] if calibration-count = "western sedimentary basin" [default-water-loading] end ;------------------------------------------------------------------ to clear-non-land-patches ask patches [if is-land-patch = 0 [ set timber-esv 0 set timber-esvp 0 set carbon-esv 0 set ccs-esv 0 set carbon-storage 0 set carbon-change 0 set timber-npv-per-ha 0 set timber-value-potential-per-ha 0 set carbon-value-per-ha 0 set ccs-value-per-ha 0 set carbon-storage-per-ha 0 set carbon-change-per-ha 0 set pollination-npv 0 set canola-total-yield 0 set canola-revenue-npv 0 set pollination-npv-per-ha 0 set canola-total-yield-per-ha 0 set canola-revenue-npv-per-ha 0 set intactness 0 set load-n 0 set load-p 0 set load-tss 0 set hillslope-sediment-generated 0 set p-supply 0 set tss-supply 0 set sediment-supply 0 set n-deposited 0 set p-deposited 0 set tss-deposited 0 set sediments-deposited 0 set net-n 0 set net-p 0 set net-tss 0 set net-sediment 0 set load-n-per-ha 0 set load-p-per-ha 0 set load-tss-per-ha 0 set hillslope-sediment-generated-per-ha 0 set n-supply-per-ha 0 set p-supply-per-ha 0 set tss-supply-per-ha 0 set sediment-supply-per-ha 0 set n-deposited-per-ha 0 set p-deposited-per-ha 0 set tss-deposited-per-ha 0 set sediments-deposited-per-ha 0 set net-n-per-ha 0 set net-p-per-ha 0 set net-tss-per-ha 0 set net-sediment-per-ha 0 set cum-river-P 0 set cum-river-tss 0 set cum-river-sediment 0 set cum-river-flow 0 ]] end @#$#@#$#@ GRAPHICS-WINDOW 197 17 1481 840 -1 -1 2.0 1 10 1 1 1 0 0 0 1 0 636 0 395 0 0 1 ticks 30.0 BUTTON 20 10 146 43 Setup Landscape setup-patches NIL 1 T OBSERVER NIL NIL NIL NIL 1 TEXTBOX 15 530 182 552 Timber & Carbon Variables 14 0.0 1 SLIDER 12 589 184 622 cost-to-roadside cost-to-roadside 0 50 35.25 0.25 1 $/m3 HORIZONTAL SLIDER 12 621 184 654 silviculture-cost silviculture-cost 0 1500 1000 1 1 $/ha HORIZONTAL SLIDER 12 686 184 719 mill-opp-cost mill-opp-cost 0 100 50 1 1 $/m3 HORIZONTAL SLIDER 12 719 184 752 lumber-price lumber-price 0 250 135 1 1 $/m3 HORIZONTAL SLIDER 12 752 184 785 pulp-price pulp-price 0 1500 843 1 1 $/mt HORIZONTAL SLIDER 12 785 184 818 panel-price panel-price 0 400 290 1 1 $/m3 HORIZONTAL SLIDER 12 817 184 850 carbon-price carbon-price 0 100 30 1 1 $/mt CO2 HORIZONTAL TEXTBOX 18 864 168 882 Pollination Variables 14 0.0 1 SLIDER 13 886 185 919 canola-price canola-price 0.01 1 0.46 0.01 1 $/kg HORIZONTAL BUTTON 18 183 146 216 Run Forest Model run-forest-model T 1 T OBSERVER NIL NIL NIL NIL 1 CHOOSER 11 441 179 486 View View "Eligible Landbase" "Standing Timber Volume" "Potential Timber NPV" "Timber NPV" "Carbon Storage Value" "Carbon Sequestration Value" "Canola 2009" "Canola 2010" "Canola 2011" "Canola 2012" "Pollinator Habitat" "Bee Abundance" "Pollinator Profit" "Biodiversity Index" "Watersheds" "Precipitation" "Runoff" "N Loading" "P Loading" "TSS Loading" "Sediment Generated" "P Supply" "N Supply" "TSS Supply" "P Removal" "N Removal" "TSS Removal" "Deposited Sediments" "Net P" "Net N" "Net TSS" "Net Sediment" "River P" "River N" "River TSS" "River Flow" 17 BUTTON 13 485 114 518 Update View update-view NIL 1 T OBSERVER NIL NIL NIL NIL 1 BUTTON 18 216 146 249 Run Pollination Model run-pollination-model T 1 T OBSERVER NIL NIL NIL NIL 1 TEXTBOX 1521 340 1671 358 Pollutant Removal Rates 14 0.0 1 SLIDER 1505 360 1677 393 ag-removal ag-removal 0 100 15 5 1 % HORIZONTAL SLIDER 1505 392 1677 425 deciduous-removal deciduous-removal 0 100 55 5 1 % HORIZONTAL SLIDER 1505 425 1677 458 conifer-removal conifer-removal 0 100 55 5 1 % HORIZONTAL SLIDER 1505 457 1677 490 mixed-removal mixed-removal 0 100 55 5 1 % HORIZONTAL SLIDER 1505 521 1677 554 grass-removal grass-removal 0 100 45 5 1 % HORIZONTAL SLIDER 1505 489 1677 522 shrub-removal shrub-removal 0 100 45 5 1 % HORIZONTAL SLIDER 1505 553 1677 586 developed-removal developed-removal 0 100 0 5 1 % HORIZONTAL SLIDER 1505 586 1677 619 exposed-removal exposed-removal 0 100 0 5 1 % HORIZONTAL SLIDER 1505 619 1677 652 rock-rubble-removal rock-rubble-removal 0 100 0 5 1 % HORIZONTAL TEXTBOX 1520 17 1670 35 RUSLE Cover Factors 14 0.0 1 SLIDER 1509 37 1681 70 ag-cover ag-cover 0 1 0.45 .01 1 NIL HORIZONTAL SLIDER 1509 68 1681 101 deciduous-cover deciduous-cover 0 1 0.1 .01 1 NIL HORIZONTAL SLIDER 1509 101 1681 134 conifer-cover conifer-cover 0 1 0.1 0.01 1 NIL HORIZONTAL SLIDER 1510 134 1682 167 mixed-cover mixed-cover 0 1 0.1 0.01 1 NIL HORIZONTAL SLIDER 1510 166 1682 199 shrub-cover shrub-cover 0 1 0.2 0.01 1 NIL HORIZONTAL SLIDER 1510 199 1682 232 grass-cover grass-cover 0 1 0.3 0.01 1 NIL HORIZONTAL SLIDER 1510 232 1682 265 developed-cover developed-cover 0 1 0.7 0.01 1 NIL HORIZONTAL SLIDER 1510 264 1682 297 exposed-cover exposed-cover 0 1 0.45 0.01 1 NIL HORIZONTAL SLIDER 1510 297 1682 330 rock-rubble-cover rock-rubble-cover 0 1 0.25 0.01 1 NIL HORIZONTAL TEXTBOX 1849 30 2216 63 Export Coefficients (kg/ha per mm of precipitation) 14 0.0 1 TEXTBOX 1772 70 1885 89 Nitrogen 13 0.0 1 SLIDER 1714 191 1886 224 barren-N barren-N 0 1 0.003697 .00001 1 NIL HORIZONTAL SLIDER 1714 224 1886 257 cutblock-N cutblock-N 0 1 0.0102 .00001 1 NIL HORIZONTAL SLIDER 1714 257 1886 290 feedlots-N feedlots-N 0 2 1.62012 .00001 1 NIL HORIZONTAL SLIDER 1714 289 1886 322 forest-N forest-N 0 1 0.0034 .00001 1 NIL HORIZONTAL SLIDER 1714 322 1886 355 grass-N grass-N 0 1 9.7E-4 .00001 1 NIL HORIZONTAL SLIDER 1714 355 1886 388 hard-roads-N hard-roads-N 0 1 0.09825 .00001 1 NIL HORIZONTAL SLIDER 1714 387 1886 420 industrial-N industrial-N 0 1 0.01426 1.0000 1 NIL HORIZONTAL SLIDER 1714 485 1886 518 pasture-N pasture-N 0 1 0.00913 .00001 1 NIL HORIZONTAL SLIDER 1714 518 1886 551 pipelines-N pipelines-N 0 1 0.00519 .00001 1 NIL HORIZONTAL SLIDER 1714 551 1886 584 recreation-N recreation-N 0 1 0.01124 .00001 1 NIL HORIZONTAL SLIDER 1714 583 1886 616 rural-residential-N rural-residential-N 0 1 0.00316 .00001 1 NIL HORIZONTAL SLIDER 1714 616 1886 649 seismic-N seismic-N 0 1 0.00259 .00001 1 NIL HORIZONTAL SLIDER 1714 682 1886 715 suburban-N suburban-N 0 1 0.00779 .00001 1 NIL HORIZONTAL SLIDER 1714 419 1886 452 mines-disturbed-N mines-disturbed-N 0 1 0.00531 .00001 1 NIL HORIZONTAL SLIDER 1714 714 1886 747 trails-motorized-N trails-motorized-N 0 1 0.0144 .00001 1 NIL HORIZONTAL SLIDER 1714 747 1886 780 trails-nonmotorized-N trails-nonmotorized-N 0 1 0.0078 .00001 1 NIL HORIZONTAL SLIDER 1714 780 1886 813 transmission-lines-N transmission-lines-N 0 1 0.00346 .00001 1 NIL HORIZONTAL SLIDER 1714 813 1886 846 urban-N urban-N 0 1 0.01436 .00001 1 NIL HORIZONTAL SLIDER 1714 846 1886 879 wellpads-N wellpads-N 0 1 0.01368 .00001 1 NIL HORIZONTAL SLIDER 1714 95 1886 128 ag-flat-N ag-flat-N 0 1 0.01121 .00001 1 NIL HORIZONTAL TEXTBOX 1941 72 2091 90 Phosphorus 13 0.0 1 TEXTBOX 2091 72 2241 90 Total Suspended Solids 13 0.0 1 SLIDER 1896 96 2068 129 ag-flat-P ag-flat-P 0 1 9.6E-4 .00001 1 NIL HORIZONTAL SLIDER 1896 194 2068 227 barren-P barren-P 0 1 2.51E-4 .00001 1 NIL HORIZONTAL SLIDER 1896 226 2068 259 cutblock-P cutblock-P 0 1 7.63E-4 .00001 1 NIL HORIZONTAL SLIDER 1896 259 2068 292 feedlots-P feedlots-P 0 1 0.32423 .00001 1 NIL HORIZONTAL SLIDER 1896 292 2068 325 forest-P forest-P 0 1 6.1E-4 .00001 1 NIL HORIZONTAL SLIDER 1896 324 2068 357 grass-P grass-P 0 1 1.3E-4 .00001 1 NIL HORIZONTAL SLIDER 1896 356 2068 389 hard-roads-P hard-roads-P 0 1 0.00314 .00001 1 NIL HORIZONTAL SLIDER 1896 388 2068 421 industrial-P industrial-P 0 1 0.00184 .00001 1 NIL HORIZONTAL SLIDER 1896 486 2068 519 pasture-P pasture-P 0 1 8.6E-4 .00001 1 NIL HORIZONTAL SLIDER 1896 518 2068 551 pipelines-P pipelines-P 0 1 0.00201 .00001 1 NIL HORIZONTAL SLIDER 1896 551 2068 584 recreation-P recreation-P 0 1 0.00187 .00001 1 NIL HORIZONTAL SLIDER 1896 584 2068 617 rural-residential-P rural-residential-P 0 1 2.6E-4 .00001 1 NIL HORIZONTAL SLIDER 1896 617 2068 650 seismic-P seismic-P 0 1 0.00101 .00001 1 NIL HORIZONTAL SLIDER 1896 683 2068 716 suburban-P suburban-P 0 1 0.00161 .00001 1 NIL HORIZONTAL SLIDER 1896 420 2068 453 mines-disturbed-P mines-disturbed-P 0 1 6.8E-4 .00001 1 NIL HORIZONTAL SLIDER 1896 715 2068 748 trails-motorized-P trails-motorized-P 0 1 0.01211 .00001 1 NIL HORIZONTAL SLIDER 1896 748 2068 781 trails-nonmotorized-P trails-nonmotorized-P 0 1 0.00447 .00001 1 NIL HORIZONTAL SLIDER 1896 781 2068 814 transmission-lines-P transmission-lines-P 0 1 0.00134 .00001 1 NIL HORIZONTAL SLIDER 1896 814 2068 847 urban-P urban-P 0 1 0.00178 .00001 1 NIL HORIZONTAL SLIDER 1896 847 2068 880 wellpads-P wellpads-P 0 1 0.00689 .00001 1 NIL HORIZONTAL SLIDER 2083 97 2255 130 ag-flat-TSS ag-flat-TSS 0 1 0.27041 .00001 1 NIL HORIZONTAL SLIDER 2083 193 2255 226 barren-TSS barren-TSS 0 3 0 .00001 1 NIL HORIZONTAL SLIDER 2083 226 2255 259 cutblock-TSS cutblock-TSS 0 1 0.69188 .00001 1 NIL HORIZONTAL SLIDER 2083 258 2255 291 feedlots-TSS feedlots-TSS 0 6 4.99275 .00001 1 NIL HORIZONTAL SLIDER 2083 290 2255 323 forest-TSS forest-TSS 0 1 0.5535 .00001 1 NIL HORIZONTAL SLIDER 2083 323 2255 356 grass-TSS grass-TSS 0 1 0.07153 .00001 1 NIL HORIZONTAL SLIDER 2083 356 2255 389 hard-roads-TSS hard-roads-TSS 0 1 0.4133 .00001 1 NIL HORIZONTAL SLIDER 2083 389 2255 422 industrial-TSS industrial-TSS 0 2 1.08731 .00001 1 NIL HORIZONTAL SLIDER 2083 487 2255 520 pasture-TSS pasture-TSS 0 1 0.29717 .00001 1 NIL HORIZONTAL SLIDER 2083 519 2255 552 pipelines-TSS pipelines-TSS 0 1 0.54065 .00001 1 NIL HORIZONTAL SLIDER 2083 552 2255 585 recreation-TSS recreation-TSS 0 1 0.44149 .00001 1 NIL HORIZONTAL SLIDER 2083 585 2255 618 rural-residential-TSS rural-residential-TSS 0 1 0.06309 .000011 1 NIL HORIZONTAL SLIDER 2083 618 2255 651 seismic-TSS seismic-TSS 0 1 0.27032 .00001 1 NIL HORIZONTAL SLIDER 2083 683 2255 716 suburban-TSS suburban-TSS 0 1 0.34922 .00001 1 NIL HORIZONTAL SLIDER 2083 421 2255 454 mines-disturbed-tss mines-disturbed-tss 0 1 0.42273 .00001 1 NIL HORIZONTAL SLIDER 2083 715 2255 748 trails-motorized-TSS trails-motorized-TSS 0 4 2.889 .00001 1 NIL HORIZONTAL SLIDER 2083 748 2256 781 trails-nonmotorized-TSS trails-nonmotorized-TSS 0 2 1.06635 .00001 1 NIL HORIZONTAL SLIDER 2083 781 2255 814 transmission-lines-TSS transmission-lines-TSS 0 1 0.36043 .00001 1 NIL HORIZONTAL SLIDER 2083 813 2255 846 urban-TSS urban-TSS 0 1 0.62382 .00001 1 NIL HORIZONTAL SLIDER 2083 845 2255 878 wellpads-TSS wellpads-TSS 0 3 1.93873 .00001 1 NIL HORIZONTAL TEXTBOX 1516 671 1666 689 Water Cost Variables 14 0.0 1 SLIDER 1505 695 1699 728 avoided-dredging avoided-dredging 0 .1 0.0135 0.0005 1 $/kg HORIZONTAL SLIDER 1505 727 1699 760 avoided-drinking-TSS avoided-drinking-TSS 0 0.01 0.0070 0.0005 1 $/kg HORIZONTAL SLIDER 1505 760 1699 793 avoided-drinking-P avoided-drinking-P 0 250 50 1 1 $/kg HORIZONTAL SLIDER 1505 793 1700 826 avoided-drinking-N avoided-drinking-N 0 25 6.82 0.01 1 $/kg HORIZONTAL SLIDER 1714 127 1886 160 ag-rolling-N ag-rolling-N 0 1 0.01419 .00001 1 NIL HORIZONTAL SLIDER 1714 159 1886 192 ag-hilly-N ag-hilly-N 0 1 0.01755 .00001 1 NIL HORIZONTAL SLIDER 1896 129 2068 162 ag-rolling-P ag-rolling-P 0 1 0.0012192000000000001 .00001 1 NIL HORIZONTAL SLIDER 1896 162 2068 195 ag-hilly-P ag-hilly-P 0 1 0.0015072000000000002 .00001 1 NIL HORIZONTAL SLIDER 2083 129 2255 162 ag-rolling-TSS ag-rolling-TSS 0 11 0.34251 .00001 1 NIL HORIZONTAL SLIDER 2083 161 2255 194 ag-hilly-TSS ag-hilly-TSS 0 1 0.42363 .00001 1 NIL HORIZONTAL BUTTON 18 310 146 343 Setup Water Model setup-water-model NIL 1 T OBSERVER NIL NIL NIL NIL 1 BUTTON 18 343 145 376 Run Water Model run-water-model NIL 1 T OBSERVER NIL NIL NIL NIL 1 BUTTON 18 249 146 282 Run Biodiversity Model calc-intactness NIL 1 T OBSERVER NIL NIL NIL NIL 1 SLIDER 1714 452 1886 485 mines-undisturbed-N mines-undisturbed-N 0 1 0.00202 .00001 1 NIL HORIZONTAL SLIDER 1896 453 2068 486 mines-undisturbed-P mines-undisturbed-P 0 1 1.3E-4 .00001 1 NIL HORIZONTAL SLIDER 2083 454 2255 487 mines-undisturbed-tss mines-undisturbed-tss 0 1 0.07153 .00001 1 NIL HORIZONTAL BUTTON 8 390 185 423 Output Tributary Data output-tributary-data NIL 1 T OBSERVER NIL NIL NIL NIL 1 SLIDER 20 43 192 76 model-years model-years 0 100 4 1 1 Years HORIZONTAL BUTTON 5 137 198 170 Reset to Default Landscape & Values reset-to-defaults NIL 1 T OBSERVER NIL NIL NIL NIL 1 SLIDER 20 76 192 109 discount-rate discount-rate 0 25 2 1 1 % HORIZONTAL CHOOSER 12 546 162 591 harvest-policy harvest-policy "Clearcut" "Variable Retention" 0 SLIDER 1714 649 1886 682 shrubland-n shrubland-n 0 1 0.00463 0.00001 1 NIL HORIZONTAL SLIDER 1896 650 2068 683 shrubland-p shrubland-p 0 1 8.34E-4 0.00001 1 NIL HORIZONTAL SLIDER 2083 651 2255 684 shrubland-tss shrubland-tss 0 2 0.753 0.01 1 NIL HORIZONTAL SLIDER 201 887 436 920 pasture-to-ag-conversion-rate pasture-to-ag-conversion-rate 0 100 100 1 1 % HORIZONTAL @#$#@#$#@ ## WHAT IS IT? (a general understanding of what the model is trying to show or explain) ## HOW IT WORKS (what rules the agents use to create the overall behavior of the model) ## HOW TO USE IT (how to use the model, including a description of each of the items in the Interface tab) ## THINGS TO NOTICE (suggested things for the user to notice while running the model) ## THINGS TO TRY (suggested things for the user to try to do (move sliders, switches, etc.) with the model) ## EXTENDING THE MODEL (suggested things to add or change in the Code tab to make the model more complicated, detailed, accurate, etc.) ## NETLOGO FEATURES (interesting or unusual features of NetLogo that the model uses, particularly in the Code tab; or where workarounds were needed for missing features) ## RELATED MODELS (models in the NetLogo Models Library and elsewhere which are of related interest) ## CREDITS AND REFERENCES (a reference to the model's URL on the web if it has one, as well as any other necessary credits, citations, and links) @#$#@#$#@ default true 0 Polygon -7500403 true true 150 5 40 250 150 205 260 250 airplane true 0 Polygon -7500403 true true 150 0 135 15 120 60 120 105 15 165 15 195 120 180 135 240 105 270 120 285 150 270 180 285 210 270 165 240 180 180 285 195 285 165 180 105 180 60 165 15 arrow true 0 Polygon -7500403 true true 150 0 0 150 105 150 105 293 195 293 195 150 300 150 box false 0 Polygon -7500403 true true 150 285 285 225 285 75 150 135 Polygon -7500403 true true 150 135 15 75 150 15 285 75 Polygon -7500403 true true 15 75 15 225 150 285 150 135 Line -16777216 false 150 285 150 135 Line -16777216 false 150 135 15 75 Line -16777216 false 150 135 285 75 bug true 0 Circle -7500403 true true 96 182 108 Circle -7500403 true true 110 127 80 Circle -7500403 true true 110 75 80 Line -7500403 true 150 100 80 30 Line -7500403 true 150 100 220 30 butterfly true 0 Polygon -7500403 true true 150 165 209 199 225 225 225 255 195 270 165 255 150 240 Polygon -7500403 true true 150 165 89 198 75 225 75 255 105 270 135 255 150 240 Polygon -7500403 true true 139 148 100 105 55 90 25 90 10 105 10 135 25 180 40 195 85 194 139 163 Polygon -7500403 true true 162 150 200 105 245 90 275 90 290 105 290 135 275 180 260 195 215 195 162 165 Polygon -16777216 true false 150 255 135 225 120 150 135 120 150 105 165 120 180 150 165 225 Circle -16777216 true false 135 90 30 Line -16777216 false 150 105 195 60 Line -16777216 false 150 105 105 60 car false 0 Polygon -7500403 true true 300 180 279 164 261 144 240 135 226 132 213 106 203 84 185 63 159 50 135 50 75 60 0 150 0 165 0 225 300 225 300 180 Circle -16777216 true false 180 180 90 Circle -16777216 true false 30 180 90 Polygon -16777216 true false 162 80 132 78 134 135 209 135 194 105 189 96 180 89 Circle -7500403 true true 47 195 58 Circle -7500403 true true 195 195 58 circle false 0 Circle -7500403 true true 0 0 300 circle 2 false 0 Circle -7500403 true true 0 0 300 Circle -16777216 true false 30 30 240 cow false 0 Polygon -7500403 true true 200 193 197 249 179 249 177 196 166 187 140 189 93 191 78 179 72 211 49 209 48 181 37 149 25 120 25 89 45 72 103 84 179 75 198 76 252 64 272 81 293 103 285 121 255 121 242 118 224 167 Polygon -7500403 true true 73 210 86 251 62 249 48 208 Polygon -7500403 true true 25 114 16 195 9 204 23 213 25 200 39 123 cylinder false 0 Circle -7500403 true true 0 0 300 dot false 0 Circle -7500403 true true 90 90 120 face happy false 0 Circle -7500403 true true 8 8 285 Circle -16777216 true false 60 75 60 Circle -16777216 true false 180 75 60 Polygon -16777216 true false 150 255 90 239 62 213 47 191 67 179 90 203 109 218 150 225 192 218 210 203 227 181 251 194 236 217 212 240 face neutral false 0 Circle -7500403 true true 8 7 285 Circle -16777216 true false 60 75 60 Circle -16777216 true false 180 75 60 Rectangle -16777216 true false 60 195 240 225 face sad false 0 Circle -7500403 true true 8 8 285 Circle -16777216 true false 60 75 60 Circle -16777216 true false 180 75 60 Polygon -16777216 true false 150 168 90 184 62 210 47 232 67 244 90 220 109 205 150 198 192 205 210 220 227 242 251 229 236 206 212 183 factory false 0 Rectangle -7500403 true true 76 194 285 270 Rectangle -7500403 true true 36 95 59 231 Rectangle -16777216 true false 90 210 270 240 Line -7500403 true 90 195 90 255 Line -7500403 true 120 195 120 255 Line -7500403 true 150 195 150 240 Line -7500403 true 180 195 180 255 Line -7500403 true 210 210 210 240 Line -7500403 true 240 210 240 240 Line -7500403 true 90 225 270 225 Circle -1 true false 37 73 32 Circle -1 true false 55 38 54 Circle -1 true false 96 21 42 Circle -1 true false 105 40 32 Circle -1 true false 129 19 42 Rectangle -7500403 true true 14 228 78 270 fish false 0 Polygon -1 true false 44 131 21 87 15 86 0 120 15 150 0 180 13 214 20 212 45 166 Polygon -1 true false 135 195 119 235 95 218 76 210 46 204 60 165 Polygon -1 true false 75 45 83 77 71 103 86 114 166 78 135 60 Polygon -7500403 true true 30 136 151 77 226 81 280 119 292 146 292 160 287 170 270 195 195 210 151 212 30 166 Circle -16777216 true false 215 106 30 flag false 0 Rectangle -7500403 true true 60 15 75 300 Polygon -7500403 true true 90 150 270 90 90 30 Line -7500403 true 75 135 90 135 Line -7500403 true 75 45 90 45 flower false 0 Polygon -10899396 true false 135 120 165 165 180 210 180 240 150 300 165 300 195 240 195 195 165 135 Circle -7500403 true true 85 132 38 Circle -7500403 true true 130 147 38 Circle -7500403 true true 192 85 38 Circle -7500403 true true 85 40 38 Circle -7500403 true true 177 40 38 Circle -7500403 true true 177 132 38 Circle -7500403 true true 70 85 38 Circle -7500403 true true 130 25 38 Circle -7500403 true true 96 51 108 Circle -16777216 true false 113 68 74 Polygon -10899396 true false 189 233 219 188 249 173 279 188 234 218 Polygon -10899396 true false 180 255 150 210 105 210 75 240 135 240 house false 0 Rectangle -7500403 true true 45 120 255 285 Rectangle -16777216 true false 120 210 180 285 Polygon -7500403 true true 15 120 150 15 285 120 Line -16777216 false 30 120 270 120 leaf false 0 Polygon -7500403 true true 150 210 135 195 120 210 60 210 30 195 60 180 60 165 15 135 30 120 15 105 40 104 45 90 60 90 90 105 105 120 120 120 105 60 120 60 135 30 150 15 165 30 180 60 195 60 180 120 195 120 210 105 240 90 255 90 263 104 285 105 270 120 285 135 240 165 240 180 270 195 240 210 180 210 165 195 Polygon -7500403 true true 135 195 135 240 120 255 105 255 105 285 135 285 165 240 165 195 line true 0 Line -7500403 true 150 0 150 300 line half true 0 Line -7500403 true 150 0 150 150 pentagon false 0 Polygon -7500403 true true 150 15 15 120 60 285 240 285 285 120 person false 0 Circle -7500403 true true 110 5 80 Polygon -7500403 true true 105 90 120 195 90 285 105 300 135 300 150 225 165 300 195 300 210 285 180 195 195 90 Rectangle -7500403 true true 127 79 172 94 Polygon -7500403 true true 195 90 240 150 225 180 165 105 Polygon -7500403 true true 105 90 60 150 75 180 135 105 plant false 0 Rectangle -7500403 true true 135 90 165 300 Polygon -7500403 true true 135 255 90 210 45 195 75 255 135 285 Polygon -7500403 true true 165 255 210 210 255 195 225 255 165 285 Polygon -7500403 true true 135 180 90 135 45 120 75 180 135 210 Polygon -7500403 true true 165 180 165 210 225 180 255 120 210 135 Polygon -7500403 true true 135 105 90 60 45 45 75 105 135 135 Polygon -7500403 true true 165 105 165 135 225 105 255 45 210 60 Polygon -7500403 true true 135 90 120 45 150 15 180 45 165 90 sheep false 15 Circle -1 true true 203 65 88 Circle -1 true true 70 65 162 Circle -1 true true 150 105 120 Polygon -7500403 true false 218 120 240 165 255 165 278 120 Circle -7500403 true false 214 72 67 Rectangle -1 true true 164 223 179 298 Polygon -1 true true 45 285 30 285 30 240 15 195 45 210 Circle -1 true true 3 83 150 Rectangle -1 true true 65 221 80 296 Polygon -1 true true 195 285 210 285 210 240 240 210 195 210 Polygon -7500403 true false 276 85 285 105 302 99 294 83 Polygon -7500403 true false 219 85 210 105 193 99 201 83 square false 0 Rectangle -7500403 true true 30 30 270 270 square 2 false 0 Rectangle -7500403 true true 30 30 270 270 Rectangle -16777216 true false 60 60 240 240 star false 0 Polygon -7500403 true true 151 1 185 108 298 108 207 175 242 282 151 216 59 282 94 175 3 108 116 108 target false 0 Circle -7500403 true true 0 0 300 Circle -16777216 true false 30 30 240 Circle -7500403 true true 60 60 180 Circle -16777216 true false 90 90 120 Circle -7500403 true true 120 120 60 tree false 0 Circle -7500403 true true 118 3 94 Rectangle -6459832 true false 120 195 180 300 Circle -7500403 true true 65 21 108 Circle -7500403 true true 116 41 127 Circle -7500403 true true 45 90 120 Circle -7500403 true true 104 74 152 triangle false 0 Polygon -7500403 true true 150 30 15 255 285 255 triangle 2 false 0 Polygon -7500403 true true 150 30 15 255 285 255 Polygon -16777216 true false 151 99 225 223 75 224 truck false 0 Rectangle -7500403 true true 4 45 195 187 Polygon -7500403 true true 296 193 296 150 259 134 244 104 208 104 207 194 Rectangle -1 true false 195 60 195 105 Polygon -16777216 true false 238 112 252 141 219 141 218 112 Circle -16777216 true false 234 174 42 Rectangle -7500403 true true 181 185 214 194 Circle -16777216 true false 144 174 42 Circle -16777216 true false 24 174 42 Circle -7500403 false true 24 174 42 Circle -7500403 false true 144 174 42 Circle -7500403 false true 234 174 42 turtle true 0 Polygon -10899396 true false 215 204 240 233 246 254 228 266 215 252 193 210 Polygon -10899396 true false 195 90 225 75 245 75 260 89 269 108 261 124 240 105 225 105 210 105 Polygon -10899396 true false 105 90 75 75 55 75 40 89 31 108 39 124 60 105 75 105 90 105 Polygon -10899396 true false 132 85 134 64 107 51 108 17 150 2 192 18 192 52 169 65 172 87 Polygon -10899396 true false 85 204 60 233 54 254 72 266 85 252 107 210 Polygon -7500403 true true 119 75 179 75 209 101 224 135 220 225 175 261 128 261 81 224 74 135 88 99 wheel false 0 Circle -7500403 true true 3 3 294 Circle -16777216 true false 30 30 240 Line -7500403 true 150 285 150 15 Line -7500403 true 15 150 285 150 Circle -7500403 true true 120 120 60 Line -7500403 true 216 40 79 269 Line -7500403 true 40 84 269 221 Line -7500403 true 40 216 269 79 Line -7500403 true 84 40 221 269 wolf false 0 Polygon -16777216 true false 253 133 245 131 245 133 Polygon -7500403 true true 2 194 13 197 30 191 38 193 38 205 20 226 20 257 27 265 38 266 40 260 31 253 31 230 60 206 68 198 75 209 66 228 65 243 82 261 84 268 100 267 103 261 77 239 79 231 100 207 98 196 119 201 143 202 160 195 166 210 172 213 173 238 167 251 160 248 154 265 169 264 178 247 186 240 198 260 200 271 217 271 219 262 207 258 195 230 192 198 210 184 227 164 242 144 259 145 284 151 277 141 293 140 299 134 297 127 273 119 270 105 Polygon -7500403 true true -1 195 14 180 36 166 40 153 53 140 82 131 134 133 159 126 188 115 227 108 236 102 238 98 268 86 269 92 281 87 269 103 269 113 x false 0 Polygon -7500403 true true 270 75 225 30 30 225 75 270 Polygon -7500403 true true 30 75 75 30 270 225 225 270 @#$#@#$#@ NetLogo 5.0.4 @#$#@#$#@ @#$#@#$#@ @#$#@#$#@ reset-to-defaults expand-agriculture calc-intactness run-water-model run-pollination-model count all-canola-patches sum [pollination-npv] of all-canola-patches mean [pollination-npv] of all-canola-patches sum [canola-revenue-npv] of land-patches mean [intactness] of land-patches mean [intactness] of land-patches with [natural-region > 2] sum [load-p] of land-patches sum [p-supply] of land-patches sum [load-p] of land-patches with [natural-region > 2] sum [p-supply] of land-patches with [natural-region > 2] @#$#@#$#@ @#$#@#$#@ default 0.0 -0.2 0 1.0 0.0 0.0 1 1.0 0.0 0.2 0 1.0 0.0 link direction true 0 Line -7500403 true 150 150 90 180 Line -7500403 true 150 150 210 180 @#$#@#$#@ 0 @#$#@#$#@