CRWR Online Report 98-1 A GIS Assessment of the Total Loads and Water Quality in the Corpus Christi Bay System by Ann Marie Quenzer, M.S.C.E Graduate Research Assistant May 1998 CENTER FOR RESEARCH IN WATER RESOURCES Bureau of Engineering Research ? The University of Texas at Austin J.J. Pickle Research Campus ? Austin, TX 78712-4497 This document is available online via World Wide Web at http://www.ce.utexas.edu/centers/crwr/reports/online.html 1 ACKNOWLEDGEMENTS The study presented in this report is funded by the Corpus Christi Bay National Estuary Program. Their support is gratefully acknowledged. The author would also like to thank Dr. David Maidment, Ferdinand Hellweger, Dr. Nabil Eid, Dr. George Ward, Dr. Neal Armstrong, Dr. Paul Montagna, and Dr. Edward R. Holley of The University of Texas at Austin for providing technical expertise in all aspects of the study. Finally, many thanks are due to the members of the GIS Hydrology Research Group at The University of Texas? Center for Research in Water Resources for their support, advice and encouragement. 2 A GIS Assessment of the Total Loads and Water Quality in the Corpus Christi Bay System by Ann Marie Quenzer, M.S.E. The University of Texas at Austin SUPERVISOR: David R. Maidment ABSTRACT A method is presented for determining raster maps of mean annual water flow and pollutant loading from the land surface, and for determining the resulting concentrations in receiving water bodies. The method is illustrated by application to the Corpus Christi Bay system in South Texas. A mesh of 100m digital elevation model cells is laid over the drainage area and cell to cell connectivity established to link each land surface cell with a corresponding water body segment. Nonpoint source constituent loads are determined for each cell as the product of runoff and expected mean concentration, and accumulated down to the bay system. Point source and atmospheric loads are added, water quality computed in each bay system, and compared to observed data. A strong South to North runoff gradient is observed in the study area. The majority of the constituent loading comes from nonpoint sources, except for oil and grease, which arise mainly from point sources. Nitrogen and phosphorus concentrations in the bay system are reproduced reasonably well provided a decay rate of 0.01-0.02 day -1 is used. Oil and grease are reproduced well as conservative constituents. The computed metals concentrations are low and suggest a significant source in sediment or elsewhere that is presently not accounted for. 3 TABLE OF CONTENTS ACKNOWLEDGEMENTS.......................................................................................1 ABSTRACT...............................................................................................................2 TABLE OF CONTENTS...........................................................................................3 LIST OF TABLES .....................................................................................................6 LIST OF FIGURES....................................................................................................8 1 INTRODUCTION............................................................................................1 1.1 Background....................................................................................................1 1.2 Objectives ......................................................................................................2 1.3 Study Area .....................................................................................................3 1.4 Literature Reviewed.......................................................................................6 1.4.1 Non-Point Source Models......................................................................7 1.4.1.1 HSPF..................................................................................................7 1.4.1.2 STORM..............................................................................................8 1.4.1.3 CREAMS/GLEAMS .........................................................................8 1.4.1.4 ANSWERS ........................................................................................9 1.4.1.5 AGNPS ............................................................................................10 1.4.1.6 WATERSHED.................................................................................11 1.4.2 GIS Based Models ...............................................................................12 1.4.2.1 Galveston Bay National Estuary Program .......................................12 1.4.2.2 ARMSED.........................................................................................12 1.4.2.3 BASINS2 .........................................................................................13 1.4.3 Surface Water Quality Models.............................................................14 1.4.3.1 QUAL2E..........................................................................................14 1.4.3.2 WASP ..............................................................................................15 1.4.4 Earlier Studies in CCBNEP .................................................................15 1.5 Report Outline..............................................................................................15 2 DATA DESCRITION ....................................................................................17 2.1 Map Projection.............................................................................................17 2.2 Establishing a Digital Database ...................................................................18 2.2.1 Political Boundaries.............................................................................18 2.2.2 Hydrologic Unit Codes (HUC) ............................................................23 2.2.3 Digital Elevation Model (DEM) ..........................................................25 2.2.3.1 Converting Files to Arc/Info Format ...............................................27 2.2.3.2 Merging the Grids............................................................................27 2.2.3.3 Reducing the DEM to the Study Area .............................................28 2.2.4 USGS Land Use Data ..........................................................................31 2.2.4.1 Converting the Files to Arc/Info Format..........................................32 2.2.4.2 Joining Land Use Maps ...................................................................33 4 2.2.4.3 Updating Land Use ..........................................................................36 2.2.5 USGS Stream Gauges..........................................................................42 2.2.5.1 Create a Stream Gauge Coverage ....................................................42 2.2.6 Precipitation Data ................................................................................47 2.2.7 Digital Line Graphs (DLG)..................................................................54 2.2.7.1 Converting the Files to Arc/Info Format..........................................55 2.2.7.2 Joining the DLG Coverages.............................................................55 2.2.8 Event Mean Concentration (EMC) ......................................................59 3 METHODOLOGY.........................................................................................61 3.1 Grid-Based Watershed Modeling Using Digital Elevation Data.................61 3.1.1 Recondition the DEM Surface Model..................................................61 3.1.2 Connecting the Bay System with the River Network ..........................65 3.1.2.1 Bay Coverage...................................................................................67 3.1.2.2 A Problem Encountered when Connecting the Land Surface with the Bay System. .................................................................................................69 3.1.3 Eight-Direction Pour Point Model.......................................................72 3.2 Calculating the Precipitation/Runoff Relationship ......................................75 3.2.1 Digital Delineation of Sub-Watershed Drainage Areas From the United States Geological Survey (USGS) Flow Gauges............................................75 3.2.2 Average Precipitation for each Delineated Drainage Areas.................79 3.2.3 Determining Average Runoff per Unit Area at each USGS Gauge.....80 3.2.4 Establishing a Mathematical Relationship between Precipitation Percent Land Use and Streamflow .................................................................83 3.2.5 Computing Expected Runoff ...............................................................89 3.3 Linking Expected Mean Concentration (EMC) Values to Land Use ..........89 3.3.1 Computing Concentration Grid ...........................................................91 3.4 Estimating Annual Loads Throughout the Watersheds ...............................91 3.4.1 Computing Land Surface Loads ..........................................................91 3.4.2 Computing Point Source Loads ...........................................................92 3.4.3 Computing Upstream Watershed Loads ..............................................94 3.4.4 Computing Atmospheric Loads ...........................................................94 3.4.5 Computing Sediment Loads.................................................................96 3.5 Calibrating the Water Quality Model...........................................................97 3.5.1 Bay System Bathymetry.......................................................................99 3.5.2 Bay Evaporation and Precipitation ....................................................101 3.5.3 Inflow to Bay System.........................................................................102 3.5.4 Model Calibration Using Salinity......................................................104 3.6 Computing Equilibrium Water Quality Concentrations in the Bay System 106 3.7 Loads from Weighted Flow Accumulations ..............................................109 5 3.8 Running the Model ....................................................................................111 4 RESULTS AND DISCUSSION...................................................................112 4.1 Inflow into Bay System..............................................................................112 4.2 Total Constituent Loads into Bay System..................................................118 4.3 Constituent Concentrations in the Bay System..........................................126 4.3.1 Comparing the Expected Concentrations to the Observed Concentrations using the T-Test ..................................................................126 4.3.2 Calculating the Decay Rates in the Three Bay Systems ....................130 4.3.3 Edroy and King Ranch EMC Study...................................................134 5 CONCLUSIONS..........................................................................................138 APPENDIX A: Data Dictionary ............................................................................146 APPENDIX B: Avenue Scripts and AML Programs.............................................156 BIBLIOGRAPHY..................................................................................................248 VITA......................................................................................................................253 6 LIST OF TABLES Table 2.1: Data for the Stream Gauges in the CCBNEP Study Region...................42 Table 2.2: Event Mean Concentration Values used in the CCBNEP Study............60 Table 3.1: Comparison between the Original Segmentation and the New Bay Model Segmentation. ..........................................................................................................69 Table 3.2: Comparison of the USGS Calculated Drainage Areas and the Delineated Drainage Areas for Each of the Sub-Watersheds.....................................................76 Table 3.3: Depth of Precipitation (mm/yr) for Each of the Drainage Areas............80 Table 3.4: Mean Annual Flow (cfs) of Record for Each of the Nine USGS Gauging Stations.....................................................................................................................81 Table 3.5: Thirty-year Projected Mean Annual Flow for the Period 1961-1990.....82 Table 3.6: Streamflow Depths for Each of the Sub-watersheds. .............................83 Table 3.7: Input Values Used in the Excel Regression Tool. ..................................84 Table 3.8: Summary Output for the Agricultural Land Use, Precipitation, and Runoff Analysis. ......................................................................................................85 Table 3.9: Summary Output for the Rangeland, Precipitation, and Runoff Analysis. .................................................................................................................................86 Table 3.10: Segment Name, ID, Depth, Surface Area and Volume. .....................100 Table 3.11: Bay Segment Interface, Interface Line Length, Interface Length, Interface Depth, and Interface Area. ......................................................................101 Table 3.12: Comparison of the Calculated Mean Annual Evaporation and Precipitation with the Texas Water Development Board's Bay System's Mean Annual Evaporation and Precipitation...................................................................102 Table 3.13: Comparison of the Calculated Runoff Inflows with Two Other Inflow Studies by the USGS and the TWDB. ...................................................................103 Table 3.14: Salinity Interface Dispersion Coefficients, Bulk Dispersion Coefficients, and Interface Flows. .........................................................................106 Table 4.1: Percent Inflow to the Bay System from Different Sources...................113 Table 4.2: Constituent Loadings for Each Bay Segment, a) Atmospheric Loads, b) Point Source Loads, c) Land Surface (Non-point Loads), d) Nueces River Watershed Loads, e) Total Loads. .........................................................................119 Table 4.3: Expected and Observed Concentrations, Standard Deviation, Number of Samples, and the T-Test Result for Each Bay Segment: a) Total Nitrogen, b) Total Phosphorus, c) Oil and Grease, d) Copper, e) Chromium, and f) Zinc..................128 Table 4.4: Average T-Test Result for Each Constituent........................................130 Table 4.5: Decay Rates for Total Nitrogen and Total Phosphorus. .......................133 Table 4.6: Total Nitrogen and Total Phosphorus from Land Surface Sources to Bay System Using Original and Provisional EMC Values. ..........................................135 7 Table 4.7: Total Nitrogen and Total Phosphorus from all Sources to Bay System Using Original and Provisional EMC Values........................................................135 Table 4.8: Total Nitrogen Concentrations in the Bay System Using Original and Provisional EMC Data Compared to the Observed Data.......................................136 Table 4.9: Total Phosphorus Concentrations in the Bay System Using Original and Provisional EMC Data Compared to the Observed Data.......................................136 Table 4.10: Comparing Decay Rates for Total Nitrogen and Total Phosphorus Using Original and Provisional Data. ....................................................................137 8 LIST OF FIGURES Figure 1.1: Study Region Location in the State of Texas. .........................................4 Figure 1.2: Hydrologic Features within the Study Region.........................................5 Figure 2.1: Counties Participating in the CCBNEP.................................................22 Figure 2.2: Hydrologic Unit Code Boundaries within the CCBNEP Study Area....26 Figure 2.3: Digital Elevation Model for the CCBNEP Study Area. ........................30 Figure 2.4: USGS Land Use in the CCBNEP Study Area.......................................35 Figure 2.5: Land Use in the CCBNEP Study Area with the Missing Data Area Being Assigned Range Land....................................................................................37 Figure 2.6: Updated Land Use in the CCBNEP Study Region................................41 Figure 2.7: Stream Gauges in the CCBNEP Study Area. ........................................46 Figure 2.8: Original Precipitation Used in the Study...............................................48 Figure 2.9: Precipitation Trend Found Using the Grid Function Trend. .................52 Figure 2.10: Merged Precipitation Grids. ................................................................53 Figure 2.11: Digital Line Graph File Used in the CCBNEP Study. ........................58 Figure 3.1: Methodology of the Reconditioning System. ........................................63 Figure 3.2: Delineated Rivers Compared to the DLG File. .....................................64 Figure 3.3: Methodology of the Connection between the River Network and the Bay System. .............................................................................................................66 Figure 3.4: Comparison between the a) New Bay Segmentation and the b) Clipped Segmentation. ..........................................................................................................68 Figure 3.5: North Aransas Bay Segment Flow Problem Due to Extended DEM. ...71 Figure 3.6: Eight-Direction Pour Point Model. .......................................................73 Figure 3.7: Streams with Flow Accumulation Greater than 20,000 Cells Near Baffin Bay. ..........................................................................................................................74 Figure 3.8: River Reach Files Compares to the Digital Line Graph File in the Oso Creek Sub-watershed. ..............................................................................................77 Figure 3.9: Sub-watersheds in the CCBNEP Study Region. ...................................78 Figure 3.10: Depth of Precipitation (mm/yr) vs. Depth of Expected Runoff (mm/yr) for Each of the Land Uses........................................................................................88 Figure 3.11: Runoff Grid Calculated Using the Relationship between Precipitation, Streamflow, and Percent Land Use..........................................................................90 Figure 3.12: Texas Natural Resource Conservation Commission Water Quality Segments Used in the CCBNEP Study....................................................................93 Figure 3.13: Water Quality Methodology Used in the Calculations of the Equilibrium Concentrations.....................................................................................98 Figure 4.1: Precipitation and Runoff Gradient from South, A, to North, B, along the Bay System.......................................................................................................115 Figure 4.2: a) Precipitation and b) Runoff Gradient Locations in the South, A, and 9 the North, B, Portions of the Study Area. ..............................................................115 Figure 4.3: Water Balances for the a) North Bay Sytem, b) Middle Bay System, c) South Bay System, and d) the Entire Bay System. ................................................118 Figure 4.4: Percent Constiuent Loads of the Total Load for the Entire System. ...123 Figure 4.5: Percent of Total Constituent Load which Comes from a Specific Source for Entire System: (Total Nitrogen, Total Phosphorus, Oil and Grease, Copper, Chromium, and Zinc. .............................................................................................124 Figure 4.6: Percent of Total Constituent Load which Comes from a Specific Source for the North, Middle and South Bay Sections: (Total Nitrogen, Total Phosphorus, Oil and Grease, Copper, Chromium, and Zinc). ....................................................125 1 1 INTRODUCTION 1.1 Background The National Estuary Program was established through the Federal Water Quality Act of 1987 to identify and protect significant estuaries in our nation. Studies on twenty-eight estuaries are now funded and administered by the United States Environmental Protection Agency (EPA). Governor Ann Richards formally nominated Corpus Christi Bay for the program in 1992. The Corpus Christi Bay National Estuary Program is designed to coordinate the activities of all regulatory authorities along with input from the non-government sector in assessing scientific information about the nature of the bay system and formulate a management plan to address environmental problems in the bay system. This study is being done to determine the total constituent loadings to the bay system. Loads from the atmosphere, land surface, point sources, and the Nueces River upstream of the study region are calculated and entered into a bay water quality model to determine the equilibrium constituent concentrations. Mean annual flow conditions at steady state are the only flow conditions considered, so the computation in the bay system is a mean annual mass balance. The results of this study synthesize many components of the Corpus Christi Bay National Estuary Program, including the results of separate studies on point, land surface, and atmospheric sources, and the status and trends study of observed water quality in the bay system. The sum of the loadings coming into the bays were used as inputs to a water quality model to try to match the observed concentrations in the bay system, so that the significance of various pollution sources can be judged against their contribution to impacts on the bay water quality. 2 1.2 Objectives The total loadings project begins by simulating the watershed characteristics using the ArcView Geographic Information System (GIS). The land surface or land surface load, point source loads, upstream watershed loads, and atmospheric loads are also modeled using ArcView. A 100 meter grid is laid over the land surface in the study region. Each cell accounts for elevation, land use, constituent concentrations, mean annual precipitation, mean annual expected runoff, and annual land surface loads. In addition to the non-point source loads, loads from point sources, the atmosphere and the Nueces River inflow to the study region are added into the model. Benthic loadings from the bay sediments have not been explicitly accounted for because of lack of usable data. By directing the flow of water from cell to cell, the loads are accumulated in the river network and bay system. The loads are then entered into the water quality model to calculate an equilibrium concentration in each of 20 bay segments. For purposes of summarizing the research results, the bay segments are grouped into three regions: north, middle and south bays. The north bays comprise Copano and Aransas Bays and the smaller bays flowing into them. The middle bays are Nueces and Corpus Christi Bay, and those in the south are the Laguna Madre and Baffin Bay. The study had a number of limitations. The use of mean annual calculations consider the flow and loads to be steady state parameters from year to year. The effects of flushing of constituents through the system in substantial floods are not considered. Second, constituent concentrations on the land surface are related to general land use categories and do not to vary with more specific types of land uses. For example, different types of crops grown in an agricultural area may produce different amounts of runoff, but that effect is not considered here. Third, 3 constituent loads were considered to be conservative in the river network as they are transported to the bay system, possibly causing an over-estimation of the constituent loads to the bay system. Fourth, some constituent loads are estimated from limited data. For example, the atmospheric data were collected at one site in Beeville, TX, and this site has limited data. Sediment loads are not estimated, and this limitation is particularly pronounced in the case of the metals where it appears that there are significant sediment sources for all metal constituents. Despite all these limitations, the final model results bear a reasonable resemblance to the observed concentration data in the bay system when the two values are compared statistically. Where there are consistent discrepancies between observed and computed values, the explanations are readily apparent and can be accounted for by missing source loadings or the adjustment of the decay rates, in the case of metals and nutrients, respectively. 1.3 Study Area The study area includes 75 miles of south-central Texas coastline; 550 square miles of water including all bays and saltwater bayous, Aransas Bay, Copano Bay, Redfish Bay, Nueces Bay, Corpus Christi Bay, Baffin Bay, and Laguna Madre. The twelve counties covered by the study are McMullen, Live Oak, Bee, Refugio, Aransas, San Patricio, Jim Wells, Duval, Nueces, Kleberg, Kenedy and Brooks. Padre Island also is included in the study. The study area is bounded by the San Antonio Bay on the north and extends down to the Lower Laguna Madre. Three main rivers drain into the bay system; Mission River, Aransas River, and Nueces River. The Mission and Aransas Rivers flow into the Copano Bay while the Nueces River drains into the Nueces Bay. Figure 1.1 shows the location of the basin within the State of Texas, and Figure 1.2 4 Figure 1.1: Study Region Location in the State of Texas. 5 Figure 1.2: Hydrologic Features within the Study Region. 6 shows the hydrologic features in the region. The large indentation on the inland side of the study region is the drainage area of Nueces River upstream of Lake Corpus Christi, which is treated as a point source so that no explicit representation of its land surface features is required. The water quality effluent from Lake Corpus Christi can be quantified with sufficient confidence using this method, so this simplification is reasonable. The study area is characterized by pronounced topography in elevations in the northwest portion of the study region while near the coast and in the south portion of the area there is little change in elevation. The southern region of the study area is mostly covered by rangeland. The middle portion of the area is substantially cultivated for agriculture. The northern portion of the study area is used for a mix of agriculture and rangeland. Small portions of urban land use are scattered throughout the study region with the majority of the urban land use being centered in and around the City of Corpus Christi. 1.4 Literature Reviewed To help control the quality of natural waters, models have been developed by government agencies, research and academic institutes, and consulting firms to assess the non-point source loads in a watershed. The agencies, institutes and consulting firms have also developed models to calculate the water quality in the receiving waters as well as to describe the biological and chemical processes in the water. Some of these models have been linked to the GIS system. This section reviews some of the non-point source models which have been developed along with some of the surface water quality models. Finally, a discussion is presented of earlier water quality studies that have taken place in the Corpus Christi Bay National Estuary Program?s study area. 7 1.4.1 Non-Point Source Models There are several types of non-point source loading models; constant concentration, spreadsheet, statistical, rating curve or regression, and buildup/washoff. A constant concentration model runs on the assumption that runoff has the same concentration for a specific constituent. For example, an annual runoff volume can be multiplied by a annual concentration to produce an annual constituent load. Many engineering calculations are done using sophisticated spreadsheet analysis with water quality analysis being no exception. Many of the spreadsheet non-point source load models use a runoff coefficient multiplied by the precipitation depth with the advantage of having constituent concentrations vary with land use. The EPA statistical method assumes EMC values are not constant, but rather have a log normal frequency distribution. Regression has been used to relate loads and EMC?s to catchment, demographic, and hydrologic characteristics. Buildup/washoff models try to describe the mechanics of dry weather constituent buildup with the accumulation of the solids being washed off with the storm event (Donigian, 1991). 1.4.1.1 HSPF The Hydrological Simulation Program-Fortran (HSPF) originated from the Stanford Watershed Model in 1966 and eventually incorporated many non-point sources models form the EPA Athens Laboratory (Bicknell et al., 1993). This model is used for non-point source modeling. The purpose of the model is to predict conventional and organic chemical concentrations in runoff, surface and ground waters. The model includes fate and transport of the constituents in a one- dimensional stream network. HSPF produces a time history of the runoff flow rate, sediment load, constituent concentrations. It also calculates a time history of water 8 quality and quantity at any point in the watershed. The programs also simulate three sediment types; sand, silt and clay. The model includes transfer and reaction processes in the form of hydrolysis, oxidation, photolysis, biodegradation, volatilization and sorption. Input data is extensive for HSPF, since it is a continuous model. Therefore, the model needs continuos data inputs, such as precipitation, evapotranspiration, temperature, and solar intensity. 1.4.1.2 STORM The Storage, Treatment, Overflow, Runoff Model (STORM) was developed by the Corps of Engineers Hydrologic Engineering Center (Abbott, 1997). Simple runoff coefficients, and the SCS and unit hydrograph methods are used in the model to calculate runoff depth. STORM generates hourly runoff depths from hourly precipitation depths. The flow can be routed through a constant-rate treatment facility with the excess flow being diverted to a storage device. Flows that pass through storage are not included in the receiving water loads. Linear buildup and first order washoff simulations can be done for six pre-specified constituents. STORM is a surface water quality model used for runoff simulations in an urban area. Hourly precipitation data is used along with runoff coefficients which are estimated from handbooks and textbooks. Soil Conservation Service (SCS) parameters are available if soil information is known. Output includes storm event summaries of runoff volume, loads and concentrations in the receiving waters. 1.4.1.3 CREAMS/GLEAMS The US Department of Agriculture-Agricultural Research Service developed the models Chemicals, Runoff, and Erosion from the Agricultural Management System (CREAMS) to analyze agricultural best management practices 9 (Knisel, 1980). It is a field-scale model that uses separate hydrology, erosion, and chemistry submodels which are connected by pass files. The CREAMS model calculates runoff volume, peak flow, infiltration, evapotranspiration, soil water content and percolation on a daily basis. Infiltration can be calculated if detailed precipitation is available. The sediment and erosion yields are estimated at the edge of field along with particle size distribution. Nutrients and pesticides are simulated along with their loads and average concentrations. Dissolved chemicals are simulated in the runoff, sediment, and through the root zone. Ground Water Loading Effects of Agricultural Management Systems (GLEAMS) was also developed by the US Department of Agriculture-Agricultural Research Service. It was developed to utilize the CREAMS model and incorporate a vadose zone component (Knisel, 1980). The three main components in GLEAMS are hydrology, erosion/sediment yield, and pesticides. Precipitation is broken into runoff and infiltration with water balance being calculated on a daily basis. Runoff is calculated using the SCS method where the soil is broken into various layers with varying thickness and is used for water and pesticide routing. Both models need extensive input data. The hydrologic submodel requires daily or breakpoint precipitation, monthly solar radiation, and monthly air temperature. Soil type, soil properties, and crop types are also needed. The output includes hydrology and nutrient summaries for storm, monthly, or annual simulations. 1.4.1.4 ANSWERS The model Areal Nonpoint Source Watershed Environmental Response Simulation (ANSWERS) was developed by the Agricultural Engineering Department at Purdue University. It predicts the hydrologic and erosion response 10 of agricultural watersheds for surface waters (Beasley, 1982). The model requires the watershed to be broken into a grid of square elements. The grid size must be small enough for the parameters to be uniform over the cell, however parameters are allowed to vary from cell to cell. Within each element the following processes are simulated; interception, infiltration, surface storage, surface flow, subsurface drainage, sediment drainage, and sediment detachment, transport and deposition. The output from one cell becomes the input to its adjacent cell downstream. The ANSWERS model needs descriptions of the watershed topography, drainage network, soils, and land use. The output can be analyzed on a cell by cell basis or at the watershed level. 1.4.1.5 AGNPS The Agricultural Nonpoint Source Pollution Model (AGNPS) was developed by the US Department of Agriculture-Agriculture Research Service. The model calculates estimates of runoff water quality for a single storm event or for a continuous simulation (Young et al., 1987). The watershed should be divided into a grid. AGNPS can handle point source inputs from feedlots, wastewater treatment plant discharges, and stream bank and gully erosion. The constituents are routed from cell to cell, so that the individual cells can be examined for its water quality. The Modified Universal soil Loss Equation is used to predict soil erosion, while the unit hydrograph is used to predict the flow in the watershed. Input data includes topographic information, soil data, daily precipitation, and land use. The output from the model includes runoff volume, peak runoff rate, sediment yield, upland erosion, channel erosion, and nutrient concentrations. 11 1.4.1.6 WATERSHED The point and non-point source loadings model WATERSHED was developed by the US Environmental Protection Agency and the US Soil Conservation Service as an accounting system to manage water quality (Walker, 1989). The model is made up of a series of worksheets. The first worksheet holds the background information, such as basin name, area, and location. Worksheets two through four hold information about urban loads, rural non-cropland loads, and rural cropland loads. Worksheet five totals the loads, while worksheet six contains information about the cost of load reduction programs. Finally, worksheet seven derives the cost effectiveness of the programs. The model is started by dividing the watershed into homogeneous sub-watersheds and entering the appropriate data into the correct worksheets. The loads are calculated in worksheets two through four for normal and best management conditions. Inputs are estimated equations, such as the Universal Soil Loss Equation, or from measurements. The loads are routed downstream using transmission losses. The WATERSHED model was used in a study in the Delavan Lake, Wisconsin Basin. The watershed was divided into six major basins and into twenty-six smaller sub-basins depending on land use. Four sources of loads were considered: cropland loads, barnyard loads, non-point urban loads, and point urban loads. The cropland loads were estimated using the USLE. Barnyard and non- point urban loads were taken from previous studies in the area. The point source urban loads were sampled. The model was calibrated against five stations using the constituent phosphorus. The model was run for normal conditions and for two best management practices, conservation tillage and contour farming. The cost effectiveness of 1) conservation tillage alone, 2) contour farming alone, and 3) a 12 combination of the two practices. The results showed that agriculture is a large contributor to the phosphorus load in Delavan Lake, however best management practices would not significantly reduce the load in the Lake. Therefore, innovative control measures were taken to reduce the phosphorus level in Lake Delavan. 1.4.2 GIS Based Models 1.4.2.1 Galveston Bay National Estuary Program The Galveston Bay National Estuary Program collected a digital database to estimate non-point source loads using a Geographic Information System (GIS) (Rifai, 1993). Eight water quality parameters were identified; total suspended solids, total nitrogen, total phosphorus, fecal coliforms, heavy metals, oil and grease, and synthetic organic chemicals. The USGS 1:100,000 maps were used for the hydrography and transportation networks. The watersheds were digitized into the database and the soil information was obtained from the Soil Conservation Service. LANDSAT images were used for land use delineation. Three rainfall cases were derived form rain-gauge data within the basin: normal year, wet year with 10-year return period, and an individual storm event. The first two cases were used to determine the non-point source loads to the Bay. The rainfall was distributed over the watershed using the Thiessen polygon method, and the runoff volume was estimated using the SCS method. The runoff estimation was coded in the GIS environment. The constituent loads were calculated by multiplying the runoff volume by Event Mean Concentration Values (EMC). 1.4.2.2 ARMSED Another study linked a widely used model to the GIS system. The Multiple 13 Watershed Sediment Routing (ARMSED), originally developed by Colorado State University and New Mexico State University and later updated by the US Army Construction Engineering Research Laboratory, is based on the Green-Ampt equations and is a distributed physical process model. A study by Hodge (1986) integrated the ARMSED and GRASS models using a GIS interface. The GRASS computerized geographic information system contains typical map layers, such as soils, vegetation cover, geology, satellite images, roads, water bodies, and digital elevations. The system calculates areas and distances, reclassify and combine different maps together, etc. The procedure involves reconditioning the digital elevation model and delineating watersheds and stream networks within the GRASS system. An interface called WATERSHED is used to identify the watershed area and channels. A raster file is created and entered into the GRASS memory. The ARMSED model is accessed through GRASS. The ARMSED model is used to simulate rainfall; calculate channel geometric characteristics; and determines soil, surface, rainfall and erosion characteristics. 1.4.2.3 BASINS2 The program BASINS (Better Assessment Science Point and Nonpoint Sources), developed by the Environmental Protection Agencey (EPA), is a GIS based program used to analyze watersheds and water quality. The program is downloadable from the EPA Internet site (EPA, 1998): http://www.epa.gov/OST/BASINS. The program allows the user to define the watershed of interest, calculates non-point source loads in that watershed, analyze point source loads, houses national watershed data, and integrates environmental assessment models. BASINS includes three assessment tools: TARGET, ASSESS, and Data Mining. These three tools assess the watershed data on a large- and 14 small-scale. The nonpoint source loads are calculated using the Non-Point Source Model (NPSM) using the HSPF model. The output from the NSPM and point source analysis can be entered into the TOXIROUTE and QUAL2E models to assess the water quality in the receiving waters. The point and non-point source analysis is run within the BASINS program which runs within the GIS environment, while the TOXIROUTE and QUAL2E models are called from the BASINS program, but run within their own interface. The output from the TOXIROUTE and QUAL2E models can be assessed in the post processing option within the BASINS program. 1.4.3 Surface Water Quality Models 1.4.3.1 QUAL2E The Enhanced Stream Water Quality Model QUAL2E is maintained by the U.S. Environmental Protection Agency?s Center for Exposure and Assessment Modeling (EPA, 1995). The model simulates several constituents in a stream network using advective and dispersive mass transport in one-dimensional stream segments. The river network is broken into stream reaches which are further broken into subreaches or computational elements. For each element, a hydrologic balance in terms of flow, a heat balance in terms of temperature, and a material balance in terms of concentration is computed and written to an output file. The model is solved for steady state conditions using computations for nutrient cycles, algal production, benthic and carbonaceous oxygen demand, atmospheric rearation, and their effect on the dissolved oxygen balance. A similar program QUAL2E- UNCAS employs the same calculations as QUAL2-E, but also computes an uncertainty analysis. 15 1.4.3.2 WASP The U.S. Environmental Protection Agency?s Center for Exposure and Assessment Modeling maintains the water quality modeling system WASP5 which is the generalized framework for contaminant fate and transport in surface waters (EPA, 1993). The modeling system is composed of three sub-models which analyze toxic materials, eutrophication and the hydrodynamics of the river network. The Toxic Chemical Model (TOXI5) predicts dissolved and sorbed chemical concentrations in the surface waters and the sediment. The Eutrophication Model (EUTRO5) predicts dissolved oxygen, carbonaceous biochemical oxygen demand, phytoplankton, carbon, chlorophyll-a, ammonia, nitrate, organic nitrogen, and ortho-phosphate in the surface water and the sediment. The Hydrodynamic Model (DYNHYD5) calculates the surface water?s flow, volumes, velocities, and depths. 1.4.4 Earlier Studies in CCBNEP This study was completed to assess the non-point source pollution in the San Antonio-Nueces Coastal Basin (Saunders, 1996). The study uses publicly available digital data, such as digital elevation maps, stream networks, rainfall, stream flow, and land use data sets. First, the DEM was made to agree with the stream network through a process called ?burning-in?. A mathematical relationship was found between streamflow and precipitation to predict runoff. Literature-based Expected Mean Concentrations (EMC) were assigned to each of the land uses. The runoff was multiplied by the EMC grid to calculate a load grid which was then routed downstream to the rivers and bays. 1.5 Report Outline This study has a unique combination of land surface loadings from a 16 distributed parameter model of the landscape with a lumped parameter model of water quality in the bay system, both connected in the GIS using a map-based modeling approach that has not been accomplished previously. The report is divided into five chapters. Chapter 2 describes the data sources used in the study and how the data are compiled into a consistent database with a common geographic reference frame. A total of some 500MB of files were thus created, and this database will be of continuing value for other studies in the Corpus Christi region after this research is completed. Chapter 3 shows how the runoff and constituent load values are developed for input to the total loadings model and demonstrates a very substantial south to north gradient in runoff from the land surface. Chapter 4 presents the results of the computations of water quality in the bays and statistically compares the calculated values with those observed. It shows that the bay system functions as a sink for constituents because most of the inflow to the bay is lost to evaporation and does not flow out into the Gulf of Mexico. Chapter 5 presents the conclusions of the study. The data developed in the study are documented in Appendix A and the computer programs in Appendix B. 17 2 DATA DESCRITION To complete the total loadings project, the study uses raster and vector data to describe the landscape. Raster data are also termed grids as the data set is stored in a uniform rectangular array. Vector data are also known as coverages and contain points, lines, and/or polygons as the geographic features. Point coverages describe features located by a single point or a set of points. Geographic features in a line coverage are defined by a series of line segments with nodes specifying the starting and ending points of each line. Geographic features in a polygon coverage are formed by a series of connected lines. The data sets also have tables associated with the coverage or grid that present descriptive data about the geographic feature which they represent (Environmental System Research Institute, 1990). 2.1 Map Projection Because of the different data sources and the different map projections, in which each data source is found, a standard map projection is needed. Spatial data sets are also found in various map scales and in different coordinate systems. Arc/Info allows raster and vector data to be viewed together as long as they have a common datum, map projection and coordinate system. Arc/Info converts the data from one map projection to another. The Texas State Mapping System (TSMS) coordinate system is used for this study. TSMS uses a Lambert conformal conic projection which preserves shape. However, this study uses a variation of the TSMS, an Albers equal-area projection. The equal-area projection is preferred for the study because of the calculations of water and mass balances over a region which require preserving the correct earth surface area in the map projection, which the Lambert projection does not do (Snyder, 1987). 18 2.2 Establishing a Digital Database To begin the total loadings study for the CCBNEP a digital database was established. This section of the report describes each of the databases needed for the study, as well as the location of the data source. The steps needed for the database establishment are provided along with a short narrative describing the process or information gathered. The actual Arc/Info and ArcView commands are listed when possible. When the step is more efficiently completed using an automated program, such as Avenue scripts and Arc Macro Language (AML) programs, the scripts or programs are listed in Appendix B or in the report itself. 2.2.1 Political Boundaries The twelve counties involved in the CCBNEP are McMullen, Live Oak, Bee, Refugio, Aransas, San Patricio, Jim Wells, Duval, Nueces, Kleberg, Kenedy and Brooks. For a rough estimate of the amount of land within the study area, the political boundaries were used to begin defining the study area. The political boundaries are obtained from a database established at the Center for Research in Water Resources (CRWR). The counties involved in the study were selected using the Arc command Reselect. Arc: reselect counties count >: res name = "MCMULLEN" >:~ Do you wish to re-enter expression? (y/n) n Do you wish to enter another expression? (y/n) y >: ares name = "LIVE OAK" >:~ Do you wish to re-enter expression? (y/n) n Do you wish to enter another expression? (y/n) y >: ares name = "BEE" 19 >:~ Do you wish to re-enter expression? (y/n) n Do you wish to enter another expression? (y/n) y >: ares name = "REFUGIO" >:~ Do you wish to re-enter expression? (y/n) n Do you wish to enter another expression? (y/n) y >: ares name = "ARANSAS" >:~ Do you wish to re-enter expression? (y/n) n Do you wish to enter another expression? (y/n) y >: ares name = "SAN PATRICIO" >:~ Do you wish to re-enter expression? (y/n) n Do you wish to enter another expression? (y/n) y >: ares name = "JIM WELLS" >:~ Do you wish to re-enter expression? (y/n) n Do you wish to enter another expression? (y/n) y >: ares name = "DUVAL" >:~ Do you wish to re-enter expression? (y/n) n Do you wish to enter another expression? (y/n) y >: ares name = "NUECES" >:~ Do you wish to re-enter expression? (y/n) n Do you wish to enter another expression? (y/n) y >: ares name = "KLEBERG" >:~ Do you wish to re-enter expression? (y/n) n Do you wish to enter another expression? (y/n) y >: ares name = "KENEDY" >:~ Do you wish to re-enter expression? (y/n) n Do you wish to enter another expression? (y/n) y >: ares name = "BROOKS" >:~ Do you wish to re-enter expression? (y/n) n Do you wish to enter another expression? (y/n) n 20 The coverage file with the political boundaries is projected from a LAMBERT projection to an ALBERS projection. The ALBERS projection is used in the Texas State Mapping System. The projection file used is written in an Arc Macro Language (AML) file called lamtsms.prj and is presented below. LAMTSMS.PRJ Input projection LAMBERT units meters datum NAD83 parameters 34 00 0.000 27 25 0.000 -100 00 0.000 31 10 0.000 1000000.00000 1000000.00000 output projection ALBERS units meters datum NAD83 parameters 27 25 00 34 55 00 -100 00 00 31 10 00 1000000.0 1000000.0 End The Arc command Project is used to project the file to the Texas State Mapping System. Once the projection is done, the Arc command Build must be used to establish polygon topology. 21 Arc: project cover count countt lamtsms.prj Arc: build countt poly Figure 2.1 shows the twelve counties involved in the CCBNEP study area. 22 Figure 2.1: Counties Participating in the CCBNEP. 23 2.2.2 Hydrologic Unit Codes (HUC) Hydrologic Unit Codes (HUC) boundaries are a subdivision of the United States made by the United States Geological Survey (USGS), to show major and minor river basins. Hydrologic Unit Maps divide the United States into 21 major hydrologic regions, 222 subregions, 352 accounting units, and 2,100 cataloging units. The major basins within the United States have a 2 digit HUC boundary code, and smaller subbasins have 4, 6, and 8 digit codes (USGS, 1996). The USGS 1:250,000-scale HUC gives approximate drainage basin boundaries for this study. The HUC files were obtained from a database established at CRWR. The data files can be obtained from the Internet site: http://nsdi.cr.usgs.gov/nsdi/products/huc.html The HUC numbers were found using the identification icon in ArcView. The HUCs in the study area were selected using the Arc command Reselect. Arc: reselect huc250 cchuc >: res huc >= 12110201 >:~ Do you wish to re-enter expression? (y/n) n Do you wish to enter another expression? (y/n) y >: res huc <= 12110207 >:~ Do you wish to re-enter expression? (y/n) n Do you wish to enter another expression? (y/n) y >: ares huc >= 12100404 >:~ Do you wish to re-enter expression? (y/n) n Do you wish to enter another expression? (y/n) y >: res huc >= 12100405 >:~ Do you wish to re-enter expression? (y/n) n Do you wish to enter another expression? (y/n) y 24 >: res huc >= 12100406 >:~ Do you wish to re-enter expression? (y/n) n Do you wish to enter another expression? (y/n) y >: res huc >= 12100407 >:~ Do you wish to re-enter expression? (y/n) n Do you wish to enter another expression? (y/n) y >: res huc >= 12111011 >:~ Do you wish to re-enter expression? (y/n) n Do you wish to enter another expression? (y/n) n The HUC cover needs to be projected from ALBERS projection with datum NAD27 to an ALBERS projection with datum NAD28. The ALBERS projection with datum NAD28 is used in the Texas State Mapping System. The projection file used is written in a file called huctsms.prj and is shown below. HUCTSMS.PRJ Input projection ALBERS units meters datum NAD27 parameters 29 30 0.000 45 30 0.000 -96 00 0.000 23 00 0.000 0.00000 0.00000 output projection ALBERS units meters datum NAD83 parameters 27 25 0.000 25 34 55 0.000 -100 00 0.000 31 00 0.000 1000000.00000 1000000.00000 End The final projected HUC file must then be built to establish polygon topology. This can be done using the Arc command Project and the Arc command Build. Figure 2.2 shows the HUC files along with the names and numbers of each of the HUCs. Arc: project cover cchuc cchuctsms huctsms.prj Arc: build cchuctsms poly 2.2.3 Digital Elevation Model (DEM) Digital elevation models are a sampled array of elevations for ground positions. The maps are distributed by the USGS. This study used 1-degree DEMs which are also called 3-second or 1:250,000 scale DEM data (USGS, 1996). The nine compressed DEM files which are needed for the study area are Beeville-e, Beeville- w, Crystal_City-e, Corpus_Christi-e, Corpus_Christi-w, Laredo-e, Laredo-w, Port_Isabel-w, and McAllen-e. These files were downloaded via the Internet from the USGS Internet site: http://edcwww.cr.usgs.gov/doc/edchome/ndcdb/ndcdb.html Once the Internet page is accessed, click on the area of interest. A magnified view of the area will appear. Again, click on the desired area of interest. Each map sheet has prompts for the uncompressed and compressed ftp sites. Click on the uncompressed DEM file. Once the file is downloaded use the Save-as command in the pulldown menu File of the web browser to save the file to the desired directory. 26 Figure 2.2: Hydrologic Unit Code Boundaries within the CCBNEP Study Area. 27 2.2.3.1 Converting Files to Arc/Info Format The DEM files that were downloaded need to be converted into Arc/Info format. The following commands rearrange the block sizes for Arc/Info processing. $ dd if=beeville-e of=beee.dem cbs=1024 conv=unblock This should be done for each of the files which are saved. Next, the files need to be converted to Arc/Info format. This can be done by starting Arc and typing the following: Arc: demlattice beee.dem beeedem usgs This produces an Arc/Info grid called beeedem which contains the raw DEM data in geographic coordinates. 2.2.3.2 Merging the Grids The nine grids are merged to form the large grid called corpus2. The grid can be viewed either by ArcView or the by using Grid display. The following commands enable the reader to view the merged grid via Grid display. Arc: grid Grid: corpus2 = merge ( beeedem, beewdem, ccedem, cowdem, coedem, laedem, lawdem, piwdem, maedem ) Grid: display 9999 Grid: mape corpus2 Grid: gridpaint corpus2 value linear nowrap gray Next, the DEM grid needs to be projected from GEOGRAPHIC projection 28 to an ALBERS projection. The WGS84 datum is used in the Texas State Mapping System. This datum is functionally equivalent to the NAD83 datum used for the previous data sets. The projection file used is written in an AML file called demtsms.prj and is shown below. DEMTSMS.PRJ Input projection GEOGRAPHIC datum WGS72 units ds parameters output projection ALBERS datum WGS84 units meters parameters 27 25 00 34 55 00 -100 00 00 31 10 0.000 1000000.0 1000000.0 End The Arc projection command is shown below. Arc: project grid corpus2 corptsms demtsms.prj 2.2.3.3 Reducing the DEM to the Study Area The DEM needs to be clipped to a smaller size to fit the study area. This is accomplished by making a 5000-m buffer from the projected HUC file. Next, this coverage is used to clip the DEM file to a more workable size. The buffer needs to include more than the study area to ensure all the drainage into the study area is 29 encompassed. Arc: buffer cchuc2tsms tsmsbuff # # 5000 # poly flat # Arc: grid Grid: display 9999 Grid: mape tsmsbuff Grid: arcs tsmsbuff Grid: gridpaint corptsms value linear nowrap gray Grid: setwindow tsmsbuff corptsms Grid: corp2tsms = corptsms Figure 2.3 shows the DEM of the study area within the buffered HUC boundaries. 30 Figure 2.3: Digital Elevation Model for the CCBNEP Study Area. 31 2.2.4 USGS Land Use Data Land use data files describe the vegetation, water, natural surface, and cultural features on the land surface (TNRIS, 1996). The land use data was obtained from the Texas Natural Research Information System's Internet Site: http://www.tnris.state.tx.us/pub/GIS/topography/LULC/. Once at the site, click on the download prompt, followed by clicking on the index of files prompt. Finally, the land use prompt is selected, with the 250k files being selected last. The land use files for the map sheets Beeville, McAllen, Corpus Christi, Crystal City and Laredo were downloaded in export format (e.00). The land use/land cover files use the Anderson Land Use Code classification system, in which land use types are broken into 9 basic categories with the second digit distinguishing subcategories of these principal categories. 1 = urban 2 = agriculture 3 = range land 4 = forest 5 = water 6 = wetlands 7 = barren 8 = tundra 9 = ice and snow Subcategories 11 = urban residential 12 = urban commercial 13 = urban industrial etc. This land use classification was made in the late 1970?s, and the land use has obviously changed in the years since, particularly urban areas have grown in size. However, the land use/land cover files are still the standard land use 32 classification of the United States as a whole. Certain areas of the United States have developed updated land use maps, for example the area surrounding Corpus Christi Bay which was described with a separate land use coverage, as described in Section 2.2.4.3. 2.2.4.1 Converting the Files to Arc/Info Format The land use files need to be imported into a format which Arc/Info can read. Once this is done, the Arc Build command needs to be used to build polygon, node and line topology. Before the build command can be used, it is a good idea to use the Clean command to trim extraneous arcs and to join arcs which are within the fuzzy tolerance. Arc: import cover beeville.e00 lubee Arc: clean lubee Arc: build lubee Do this for all the files that are downloaded from the Texas Natural Resource Information System's Internet Site. The files also need to be dissolved. This eliminates any overlaying lines in the maps. Arc: dissolve lubee lubeed landuse-id poly The maps then need to be edited using ArcEdit. This is due to the lines and nodes which do not line up due to map making errors. The command to use in ArcEdit is called Edgematch. Use an edit coverage and a snap coverage. Nodes are used as the edit feature for both coverages. The procedure is done manually using the Add Automatically and Delete Many commands. 33 2.2.4.2 Joining Land Use Maps Once the maps are edited, they must be joined together. Arc: mapjoin lucorp Enter the 1st coverage: lubeed Enter the 2nd coverage: lucod Enter the 3rd coverage: luccd Enter the 4th coverage: lula Enter the 5th coverage: luma Enter the 6th coverage: ~ Done entering coverage names?(y/n): y Do you wish to use the above coverages?(y/n): y The land use maps need to be cleaned once the maps are joined to clip off extraneous arcs. They also needed to have node, line and polygon topology built. Finally, the Arc command Dissolve needs to be used on the big map to rid the map of overlapping arcs. Arc: clean lucorp lucorp # # line Arc: clean lucorp lucorp # # poly Arc: build lucorp node Arc: build lucorp line Arc: build lucorp poly Arc: dissolve lucorp lucorpd landuse poly The polygon coverage needs to be projected from LAMBERT projection to an ALBERS projection. The projection file used is written in an AML file called lamtsms.prj and was shown earlier in Section 2.2.1. Arc: project cover lucorpd lucorptsms lamtsms.prj The land use map was clipped using the buffered HUC file discussed in Section 2.2.3.3. This is done to reduce the file to a more usable size. 34 Arc: clip lucorptsms tsmsbuff landuse poly # Figure 2.4 shows the land use map encompassing the study area. 35 Figure 2.4: USGS Land Use in the CCBNEP Study Area. 36 2.2.4.3 Updating Land Use The patch of unknown land use which lies within the study region, south of Baffin Bay and west of the South Laguna Madre was filled in manually using ArcEdit. The unknown portion was assigned to a land use classification of rangeland. Figure 2.5 shows the range land polygon added to the land use file. An updated land use file became available later in the study. The Texas Park and Wildlife prepared the files (Hinson, 1995). This new land use file covered approximately 19,000 Km 2 surrounding Corpus Christi Bay and was added to the original land use file. The land use files were downloaded from the TNRIS Internet site format (TNRIS, 1997): http://www.tnris.state.tx.us/pub/GIS/wetlands/aquatic/cwh/corpus/. All 71 land use files in the directory were downloaded in a .e00.z. Unlike the original land use files, the new land use files were grids rather than coverages. The files were unzipped using the Guzip command and imported using the Arc command Import. $ gunzip -d agua.e00.z $ arc Arc: import grid agua.e00 agua : $ gunzip -d yarpoee.e00.z $ arc Arc: import grid yarpoee.e00 yarpoee 37 Figure 2.5: Land Use in the CCBNEP Study Area with the Missing Data Area Being Assigned Range Land. 38 The files were merged into six files and then those six files were merged into one large file. Arc: grid Grid: nland1 = merge ( agua, alices, allyns, anna, aranpass, banq, bayside, bense, bhead, chapman, cinw, cinwoee ) Grid: nland2 = merge ( cisw, conc, corp, cranell, dinero, drisce, driscw, edroy, ella, escon, estes, greg ) Grid: nland3 = merge ( kinge, kingnw, kingw, kleberg, lamar, laureles, mathis, mesq, mission, odem, orange, osone ) Grid: nland4 = merge ( osonw, paisano, panth, papa, petrne, pita, por, portland, premonte, prtaran, prtingl, rbeach ) Grid: nland5 = merge ( rbne, rbnw, ricardo, rinc, riviera, robs, rock, sandia, sanpat, sbi, sbinw, sbise ) Grid: nland6 = merge ( sintone, sintonw, stcb, stcbse, stcbsw, taft, tynan, woods, wsinton, yarp, yarpoee ) Grid: nland = merge ( nland1, nland2, nland3, nland4, nland5, nland6 ) The final merged grid needs to be projected from UNIVERSAL TRANSVERSE MERCATOR projection to an ALBERS projection. The projection file used is written in an AML file called utmtex.prj and is shown below. UTMTEX.PRJ input projection UTM units meters datum NAD83 zone 14 parameters output projection ALBERS units meters datum NAD83 parameters 27 25 00 39 34 55 00 -100 00 00 31 10 00 1000000.0 1000000.0 end Arc: project cover nland newland utmtex.prj The new land use files use a different land use classification numbering system that the original files (Hinson, 1995). The newland gridvalue field was manually converted to reflect the Anderson Land Use System. The ArcView pulldown menu Edit was used to begin editing the newland grid attribute table. A new field was added called landuse. The following list shows the gridvalue number from the new land use file and the converted Anderson Land Use System?s classification and number. Updated Land Type of Anderson Land Use Gridvalue Land Use Use Number 0 no data 0 1 commercial 12 2 commercial 12 3 industrial 13 4 residential 11 5 residential 11 6-9 agricultural 20 10-27 range land 30 28-30 barren 70 31-70 wetlands 60 71-79 water 50 The part of the newland grid which contained zero as its grid cell value was calculated to equal the original land use file. This was done by first converting the original land use files to grids using the Arc command Polygrid. Next, the Grid 40 command Con was used to redefine the zero value grid cells to the old land use cell values. Arc: grid Grid: biglandg = polygrid ( lucorptsms, landuse, #, #, 100 ) Grid: landuseg = polygrid ( landuse, landuse, #, #, 100 ) Grid: newlandbg = merge ( biglandg, landuseg ) Grid: newland2 = con ( newland == 0, biglandg, newland ) Grid: newlandbg2 = merge ( newlandbg, newland2 ) The new land use grid needs to be clipped to the study area size for a more manageable file. The command uses the delineated watershed grid for the study area which is discussed in Chapter 3. This states that the new land use file equals no data if the file lies outside of the study area, but equals the land use grid value if inside the study region. Grid: landuseg2 = con ( big1 == 1, newlandg2, big1 ) The newly merged land use grid is converted to a polygon coverage and cleaned. Grid: landuse2 = gridpoly ( landuseg2 ) Grid: q Arc: clean landuse2 Once this is completed, the landuse2 attribute table is opened in ArcView, and a new field called landuse is added. The new landuse field is calculated to equal the gridvalue field using the ArcView pulldown menu Field with the Calculate option. Figure 2.6 shows the updated land use within the study region. 41 Figure 2.6: Updated Land Use in the CCBNEP Study Region. 42 2.2.5 USGS Stream Gauges The stream gauge locations in the study area can be obtained from the Texas USGS Internet site: http://txwww.cr.usgs.gov/cgi-bin/nwis1_server At the web page, click on the item that will allow data to be viewed by an Index of Gauging by HUC (140kb). From this page, download the stream gauges in each of the HUCs associated with the project which are West San Antonio Bay, Aransas Bay, South Corpus Christi Bay, North Laguna Madre, Baffin Bay, Central Laguna Madre, Palo Blanco, San Fernando, and North Corpus Christi Bay. Table 2.1 shows the HUC number which the stream gauge is located, the stream gauge number, the stream gauge location, the latitude and longitude, and the dates which data is available. (TXUSGS, 1996). Table 2.1: Data for the Stream Gauges in the CCBNEP Study Region. HUC Sta Location Latitude Longitude Date 12110205 8212400 Los Omos Creek near Falfurrias, TX 27 15 51 098 08 08 Jan 1, 1967-Sept 30, 1983 12110204 8211900 San Fernando Creek at Alice, TX 27 46 20 098 02 00 Jan 1, 1965-Mar 5, 1987 8211800 San Diego Creek at Alice, TX 27 45 59 098 04 31 Oct 10, 1963-Oct 1, 1989 12110202 8211520 Oso Creek at Corpus Christi, TX 27 42 40 097 30 06 Sept 9, 1972-present 12100407 8189800 Chiltipon Creek at Sinton, TX 28 02 48 097 30 13 July 23, 1970-Apr, 06, 1987 Aug 4, 1987-Sept 4, 1991 8189700 Aransas River near Skidmore, TX 28 16 56 097 37 14 Apr 1 , 1964-present 12100406 8189500 Mission River at Refugio, TX 28 17 30 097 16 44 July 1, 1939-present 8189300 Medio Creek near Beeville,TX 28 28 58 097 39 23 Mar 1, 1962-Sept 17, 1977 12100405 8189200 Copano Creek near Refugio, TX 28 18 12 097 06 44 June 17, 1970-present 2.2.5.1 Create a Stream Gauge Coverage Once the stream gauge files are downloaded, a data file needs to made using the text editor listing the stream gauge latitude and longitude in decimal degree format. This can be done using the following formula: DD = D + Min/60 + Sec/3600 43 The following is the beginning of the data file created for the study area. The file is called lonlat.dat. 1 -98.1356 27.2642 2 -98.0333 27.7722 : Note that West longitude is treated as negative in decimal degree format. A point coverage of the digital coordinate data is built using the ARC/Info Generate command. The lonlat.dat file is specified as the input and points as the geographic feature type. Once the coverage is created, point topology is established through the Build command. The digital coordinate values are added as attributes to each point by using the Addxy command. Arc: generate station Generate: input lonlat.dat Generate: points Creating points with coordinates loaded from lonlat.dat Generate: quit Externally BND and TIC.. Arc: build station points Arc: addxy station A second data file is created for the station name and number. The file was called statname.dat. The beginning of this file is shown below: 1 08212400 Los_Omos 2 08211900 San_Fernando : The following commands are used to create an attribute table for the stream gauge point coverage. 44 Arc: tables Enter Command: define attribut.dat 1 Item name: stations-id Item width: 4 Item Output Width: 4 Item Type: i 5 Item Name: stat-num Item width: 10 Item Output Width: 10 Item Type: c 15 Item Name: stat-name Item width: 15 7 Item Output Width: 15 Item Type: c Item Name: Enter Command: add from statname.dat Finally, the attribute tables need to be joined to the point coverage, and the point coverage needs to be projected from GEOGRAPHIC projection to an ALBERS projection. The projection file used is written in an AML file called geotsms.prj and is shown below. GEOTSMS.PRJ Input projection GEOGRAPHIC units dd datum NAD83 spheroid GRS1980 parameters output projection ALBERS units meters datum NAD83 45 spheroid GRS1980 parameters 27 25 00 34 55 00 -100 00 00 31 10 00 1000000.0 1000000.0 end Arc: Joinitem stations.pat attribut.dat stations.pat stations-id stations-id Arc: project cover stations corpgages geotsms.prj Figure 2.7 shows the stream gauges within the CCBNEP study area. 46 Figure 2.7: Stream Gauges in the CCBNEP Study Area. 47 2.2.6 Precipitation Data The precipitation grid is obtained from an Oregon State University anonymous ftp site: fsl.orst.edu. The precipitation grid is projected to the Texas State Mapping System which is an Albers. The precipitation data from Oregon State University is a mean annual precipitation grid for the United States based on the years 1961 to 1990. The grid was developed using an interpolation process called PRISM, and is verified by consultation with State Climatologists (Oregon, 1996). Figure 2.8 shows the precipitation grid downloaded from Oregon State University. No coordinate system was defined for the precipitation grid. However, the X and Y boundary values shown indicate that the precipitation grid is in a geographic projection with the decimal degrees specified as the units of measure. In order to select a smaller portion of the grid the buffered HUC file is projected from the ALBERS projection used in the Texas State Mapping System to the GEOGRAPHIC projection. This newly projected file, geobuff, is used to reduce the precipitation file to a more usable size. The projection file tsmsgeo.prj is listed below: 48 Figure 2.8: Original Precipitation Used in the Study. 49 TSMSGEO.PRJ input projection ALBERS units meters datum NAD83 spheroid GRS1980 parameters 27 25 00 34 55 00 -100 00 00 31 10 00 1000000.0 1000000.0 output projection GEOGRAPHIC units dd datum NAD83 spheroid GRS1980 parameter end Arc: project cover tsmsbuff geobuff tsmsgeo.prj The Grid Setwindow command is used to reduce the analysis window to the map extent of the buffered coverage. A smaller precipitation grid which contains the values from the large precipitation grid is defined within this window. The smaller grid is then projected to the ALBERS projection from the GEOGRAPHIC projection using the demtsms.prj projection file. This file was listed in Section 2.2.3.2. Arc: grid Grid: display 9999 Grid: mape geobuff Grid: linecolor 3 Grid: arcs geobuff 50 Grid: setwindow geobuff p_ann Grid: precip = p_ann Arc: project grid precip precip2 geotsms.prj The precipitation grid covered the land surface over the study area, however much of the bay system did not have precipitation data. A series of Grid commands are used to fill in the missing data. The Setcell command is used to set the cell size to equal the original precipitation grid. Setwindow is used to decrease the size of the area of the precipitation grid to be analyzed. The Grid command Gridpoint converted the precipitation grid to a point coverage, which is used with the Trend command to create the new grid. The Trend command performs a trend interpolation on a point coverage and calculates the new grid. The inputs are a point coverage, name of the item to be used for the interpolation, the order of the equation to be used for the analysis, the cell size, and the extent of the analysis. The Setwindow and Setcell commands determine the extent of the analysis and the cell size of the new grid. A second order equation is specified while using the Trend function. The point coverage was calculated using the Gridpoint command where the grid value was named ?rain?. The new precipitation grid and the original precipitation grid are merged together to create a new grid with the no data cells of the original grid filled in with the new grid. The original precipitation grid was displayed in the Grid Display window before the calculations were begun. $: arc Arc: grid Grid: setcell precip2 Grid: setwindow precip2 Grid: mape precip2 Grid: gridpaint precip2 value linear nowrap gray Grid: setwindow * Define box Grid: precip3 = precip2 51 Grid: precippnt = gridpoint ( precip3, rain ) Grid: precipgrid = trend ( precippnt, rain, 2, linear, 100, # ) Coeff # coeff _ 0 -306.535 1 0.003 2 -0.007 3 0.000 4 0.000 5 0.000 _ RMS Error = 25.002 Chi-square = 507561.475 Grid: setcell precip2 Grid: setwindow precip2 Grid: precipmerge = merge ( precip2, precipgrid ) Figure 2.9 shows the precipitation trend grid, and Figure 2.10 shows the merged precipitation grids. This process does not effect any of the cells in the original precipitation grid, but fills in the missing cells over the bays and barrier islands with reasonable precipitation values. 52 Figure 2.9: Precipitation Trend Found Using the Grid Function Trend. 53 Figure 2.10: Merged Precipitation Grids. 54 2.2.7 Digital Line Graphs (DLG) The 1:100,000 DLG files include hydrologic features such as stream networks, standing water, and coastlines. The USGS also produces DLG files for roads, railways, and pipelines (USGS, 1996). The DLG files are obtained from the USGS Internet site: http://edcwww.cr.usgs.gov/doc/edchome/ndcdb/ndcdb.html. This Internet page has various sites to obtain information. Page down to the100,000-Scale Digital Line Graph (DLG)site and click on: via graphics (DLG) The DLG files can also be obtained from a USGS 14-volume Compact Disc-Read Only Memory (CD-ROM) set which can be obtained from the USGS Earth Science Information Center in Reston, VA. The DLG files for this study are downloaded from Volume 8 (Texas and Oklahoma) of the CD-ROM series (USGS, 1993). The Hydrology files were located in the 100k_dlg directory. This directory contains directories for each of the map sheet in the Texas/Oklahoma region. The Internet site is used to obtain the map sheet names needed for the study. The hydrology files for each of the map sheets were downloaded from the CD-ROM to a PC workspace, and were then brought over to the UNIX workspace by ftp. The files needed for this study are listed below: NAME FILE Goliad be1hydro.zip Port Lavaca be2hydro.zip Beeville be3hydro.zip San Antonio Bay be4hydro.zip Corpus Christi cc1hydro.zip Allyns Bight cc2hydro.zip Baffin Bay cc3hydro.zip Laredo ly1hydro.zip Alice ly2hydro.zip San Ygnacio ly3hydro.zip 55 Falfuria ly4hydro.zip Encino m32hydro.zip Pleasanton x42hydro.zip George West x44hydro.zip Port Mansfield zi1hydro.zip 2.2.7.1 Converting the Files to Arc/Info Format Each of these files needs to be unzipped. This creates eight coverages. An example for the first file is shown. $ unzip be1hydro.zip Exploding: be3hyf01 Exploding: be3hyf02 : Exploding: be3hyf08 The files then need to be converted from a DLG format to an Arc/Info format. The Dlgarc command is used for this. After the files are converted, the line topology must be built using the Build command. An example for the first file is shown. Arc: dlgarc optional be1hyf01 be1f01 Arc: build be1f01 2.2.7.2 Joining the DLG Coverages The border around each map needs to be removed. This is done by acknowledging that all arcs in a line coverage have left and right polygon numbers associated with them. The value of the exterior polygon number is always one. The Arc Reselect command is used to remove the lines from the coverage. Arc: reselect be1f01 be101 line # line >: res rpoly# > 1 56 >: ~ Do you wish to re-enter expression? (Y/N) n Do you wish to enter another expression? (Y/N) y >: res lpoly# > 1 >: ~ Do you wish to re-enter expression? (Y/N) n Do you wish to enter another expression? (Y/N) n Once the border is removed, the DLG coverages can be joined together using the Arc Append command. The Build command is used to add line topology to the large map. Arc: append bigmap Enter the 1st coverage: be101 Enter the 2st coverage: be102 : : Enter the 116st coverage: zi101 Done entering coverage names?(Y?N) y Do you wish to use the above coverages? (Y/N) y Appending coverages... Arc: build bigmap line Arc: project cover bigmap dlgtsms utmtsms.prj Finally, the appended coverage is projected from the UNIVERSAL TRANSVERSE MERCATOR (UTM) projection to the Texas State Mapping System which is in an ALBERS projection with the projection file utmtsms.prj. The projection file is shown below: UTMTSMS.PRJ Input projection UTM units meters 57 datum NAD27 spheroid CLARKE1866 zone 14 parameters output projection ALBERS units meters datum NAD83 spheroid GRS1980 parameters 27 25 00 34 55 00 -100 00 00 31 10 00 1000000.0 1000000.0 end Figure 2.11 shows the DLG file for the study area. Note how the low amount of runoff draining to the South Laguna Madre leads to a poorly defined stream network in this region. 58 Figure 2.11: Digital Line Graph File Used in the CCBNEP Study. 59 2.2.8 Event Mean Concentration (EMC) Constituent concentrations need to be assigned to each cell in order to calculate the land surface loads. This study uses Event Mean Concentration (EMC) values obtained from a previous CCBNEP analysis, Characterization of Non-point Sources and Loadings to the Corpus Christi Bay National Estuary Program Study Area (Baird,1996). This study developed EMC values from water quality analysis performed at the Oso Creek and Seco Creek USGS Stream Gauges. The Oso Creek gauge is located west of Corpus Christi and represents agricultural land use. The gauges located on Seco Creek are northwest of Hondo, TX, and represent range land uses. EMC values for 18 constituents were listed in this study and are shown in Table 2.2. The values in the table are typical concentrations of constituents found in runoff water from each particular land use. The values are compiled from many studies done by the USGS and other organizations. 60 Table 2.2: Event Mean Concentration Values used in the CCBNEP Study. Two EMC studies are being conducted near Edroy, TX and at the King Ranch which is located in southeast Texas. Both studies represent agricultural land use. Provisional results from the two studies are showing lower total nitrogen EMC values for rangeland and agricultural land uses. Once the EMC studies are completed, it would be feasible to incorporate the data into the Total Loads and Water Quality Project for the Corpus Christi National Estuary Program. The provisional data are analyzed in Section 4.3.3. 61 3 METHODOLOGY The ArcView project described in this section calculates the atmospheric, land surface, point source and Nueces River loads for the Corpus Christi National Estuary Program?s total loadings study. The project includes calculations for land surface concentrations and runoff on a per cell basis. The project has capabilities to delineate watersheds. Finally, the project is able to calculate the receiving water body?s equilibrium concentrations due to point, non-point, atmospheric, and upstream watershed loads. In so far as possible, the commands used to accomplish the calculations are written in bold type, while the computer prompts are in italics. The scripts are listed in Appendix B. 3.1 Grid-Based Watershed Modeling Using Digital Elevation Data To begin the assessment of land surface loadings, it is necessary to recondition the digital elevation model (DEM) which involves making the DEM and the hydrology digital line graph (DLG) files agree. This is so the precipitation can be directed from the land surface to the receiving waters using the DEM. The reconditioning process involves digging a trench into the DEM where the riverbed is located according to the DLG files. Once the DEM has been reconditioned, the river network and bay system are connected by dropping the centroid of the bay coverage below the value of the surrounding cells, so that the flow is accumulated at that point. 3.1.1 Recondition the DEM Surface Model AGREE is a surface reconditioning system for a DEM (Hellweger, 1996). 62 The program is shown in Appendix B at the end of the report. The system adjusts the surface elevation of the DEM to be consistent with a vector coverage. The vector coverage can be a stream or ridge line coverage. For the CCBNEP project, the vector coverage is the DLG discussed in Section 2.2.7. The AGREE system is an alternative to the "burning in the streams" process which simply drops the elevation of the cells corresponding to the DLG files. The AGREE reconditioning process lowers the grid cells corresponding to the DLG files by an amount designated by the user, while the cells within a buffer distance of the rivers are altered to have a smooth transition from the unmodified land surface to the lowered river cells. Figure 3.1 shows the AGREE methodology. The program is run within the ArcView environment. The elevation grid and the vector coverage should be active in the view. The script asks for five parameters, which are the 1) elevation grid, 2) vector coverage, 3) buffer distance, 4) smooth drop/raise distance, and 5) the sharp drop/raise distance. Once the program is running, the temporary grids do not need to be saved. Figure 3.2 shows a sample area near Corpus Christi Bay of the recondition DEM streams and the DLG file. This process forces the DEM drainage to follow the mapped hydrology DLG streams and rivers. Before further calculations can be done using the DEM, data errors must be corrected. The DEM may contain sinks, which are a single grid cell or groups of cells surrounded by cells of higher elevation. The errors are corrected by using the Arc command Fill, which assigns the elevation of each sink to be equal to the value of its lowest elevation neighbor. This is accomplished by using the ArcView?s Hydrology extension?s pulldown menu with the Fill option. The reconditioned grid must be active in the view. 63 ORIGINAL ELEVATION MODIFIED ELEVATION KNOWN STREAM LOCATION AND STREAM DELINEATED FROM MODIFIED ELEVATION GRID CELL SIZESECTION A-A STREAM DELINEATED FROM ORIGINAL ELEVATION ELEVATION RESOLUTION GRID CELL SIZE PLAN AA Figure 3.1: Methodology of the Reconditioning System. 64 Figure 3.2: Delineated Rivers Compared to the DLG File. 65 3.1.2 Connecting the Bay System with the River Network CONNECT, listed in Appendix B, is an Avenue script which connects a reconditioned DEM with a polygon coverage representing the segments of the bay system by dropping the centroid of the polygon coverage below the elevation of the surrounding cells (Hellweger, 1996). The elevation grid is altered to create artificial sinks corresponding to the centroid of the segments of the polygon coverage. Lowering the elevation in the segments an arbitrary amount creates the sinks, and then the bottom of the segment is sloped towards the centroid of the segment area. Figure 3.3 shows the methodology of the connection between river network and the bay system. 66 OCEAN LAND SURFACE BAY SEGMENT SINK ELEVATION MSL SECTION PLAN CENTROID FLOW PATH Figure 3.3: Methodology of the Connection between the River Network and the Bay System. 67 3.1.2.1 Bay Coverage The bay coverage used in the total loadings study is developed using the River Reach Files (RF1) downloaded from the USGS Internet site (USGS, 1996): http://h2o.er.usgs.gov/nsdi/wais/water/rf1.html. The bay segmentation is obtained from the report entitled Corpus Christi Bay National Estuary Program, Ambient Water, Sediment and Tissue Quality of Corpus Christi Bay Study Area: Present Status and Historical Trends, Summary Report (Ward, 1996). The bays are segmented according to natural bathymetry and water flow in the system. The original 189 segments defined in the report are too detailed for the total constituent loading project due to the time that would be involved in calibrating the equilibrium concentration model. The original bay coverage is clipped using the RF1 file to remove parts of the bay system which covered the land surface. A total of 14 segments are thus eliminated. The remaining segments are grouped together to form the 20 segments used in this study keeping the natural bathymetry and water flow in mind. Figure 3.4 compares the clipped segmentation with the new bay model graphically, while Table 3.1 compares the clipped and grouped segmentation. 68 (a) (b) Figure 3.4: Comparison between the a) New Bay Segmentation and the b) Clipped Segmentation. 69 Table 3.1: Comparison between the Original Segmentation and the New Bay Model Segmentation. 3.1.2.2 A Problem Encountered when Connecting the Land Surface with the Bay System. A problem was encountered at the bay system boundaries when first Segment ID Ward and Armstrong Segments St. Charles stc SC1, SC2, SC3 Copano cop M1, M2, AR1, PB1, PB2, CP01, CP02, CP03, CP04, CP05, CP06, CP07, CP08, CP09, CP10 Aransas North aran I1, I2, I3, AYB, MB1, MB2, CB, CBY1, CBY2 Aransas Middle aram A1, A2, A3, A4, A5, I4, I5, A8, A9, A10, LB Ar ans as South ar as A6 , A1 1 , A1 2 , A1 3 , I6 , I7, I8 , LAC Redfish red RB1, RB2, RB3, RB4, RB5, RB6, RB7, RB8, RB9, CBH, HI1, HI2 Inlet inl INL Nueces Wes t nuew ND1, ND2, ND3, ND4, NB1 Nueces Middle nuem NR1, NR2, NR3, NR4, NR5, NB2, NB3, NB4 Nueces East nuee NB5, NB6, NB7, NB8, NB9 Inner Harbor inh IH1, IH2, IH3, IH4, IH5, IH6, IH7 Corpus North ccbn LQ1, LQ2, C15, C16, C17, C18, C19, C20, C2 1 , C2 2 , C2 3 , CCC3 , CCC4 , CCC5 , CCC6 , CCC7 , CCC8 Corpus Middle ccbm C01, C02, C03, C04, C05, C06, C07, C08, C1 0 , C1 1 , C1 3 Cor pu s E as t ccbe CCC1 , CCC2 , E F , C1 2 , C0 9 , C1 4 Corpus South ccbs C24, I9, C25 Oso oso OS1, OS2, OS3, OS4, OS5, OS6, OS7 ULM North ulmn UL01, UL02, UL03, UL04, UL05, UL06, UL07, UL08, UL09, UL10, I10, I11, I12, I13, I14 ULM Middle ulmm UL11, UL12, UL13, UL14, I15, I16, I17, I18 ULM South ulms none Baffin baf GR1, GR2, LS1, LS2, AL1, AL2, BF1, BF2, BF3 70 applying the CONNECT methodology. An extended portion of the DEM is used to ensure all of the study site is encompassed. Therefore, in the northeast corner of the study site, some of the flow was directed into the north Aransas Bay segment. However, the flow from the land surface may actually flow north rather than directly into the bay. This problem is corrected manually by setting the runoff inflow into this bay segment to zero. Figure 3.5 shows the flow error into the north segment of Aransas Bay caused by the extended DEM. 71 Figure 3.5: North Aransas Bay Segment Flow Problem Due to Extended DEM. 72 3.1.3 Eight-Direction Pour Point Model Once the reconditioned and filled elevation grid has been connected to the bay system, the direction of flow for each cell can be calculated. After the flow direction is determined the number of cells upstream of a given grid cell can be determined. These two processes are called flow direction and flow accumulation, respectively. The calculations are based on the eight-direction pour point model. The model begins by describing a cell surrounded by its eight neighbors. A cell drains to its neighbor of steepest descent as defined by the filled and connected elevation model. The drainage connections are traced from cell to cell to develop a flow direction network. The flow accumulation grid is calculated by counting the number of cells that occur upstream of each particular cell (Maidment, 1996). The flow direction grid is calculated using the ArcView Hydrology extension?s pulldown menu with the Flow Direction option. The connected grid must be active in the view. Again the ArcView Hydrology extension?s menu is used, however this time the Flow Accumulation is used and the flow direction grid must be active in the view. By acknowledging that surface runoff accumulates in creeks and streams, the flow accumulation values along streams should be greatest. Therefore, the flow accumulation grid can be queried to view the stream network that was embedded into the elevation grid. This is done using the ArcView extension?s pulldown menu Analysis. The Map Query option is used to query the flow accumulation grid for all cell values above 20,000. The resulting grid reflects the string of cells whose flow accumulation values are greater than 20,000. Each cell is 100m in size or 0.01 Km 2 in area, so 20,000 cells is equivalent to an upstream drainage area of 200 Km 2 . Figure 3.6 shows the eight-direction pour point model, while Figure 3.7 shows the flow accumulation of the cells greater than 20,000 near Baffin Bay. 73 67 56 49 46 50 53 44 37 38 48 58 55 22 31 24 61 47 21 16 19 53 34 12 11 12 22448 12484 128 1 2 4 8 21444 111216 00000 0 9 17 40 0 0 093016 001 0 005 8 ELEVATION FLOW DIRECTION ACCUMULATED FLOW 4 5 12 17 23 3 3 10 12 16 226810 01478 00347 FLOW 133 163 Figure 3.6: Eight-Direction Pour Point Model. 74 Figure 3.7: Streams with Flow Accumulation Greater than 20,000 Cells Near Baffin Bay. 75 3.2 Calculating the Precipitation/Runoff Relationship Non-point source constituents are carried over the land surface into the river networks and bay system by direct runoff. For this study, the runoff is assumed to be a function of precipitation and land use. The Regression Tool in the software package Microsoft Excel 5.0 is used to determine the relationship between streamflow, precipitation and percent land use. 3.2.1 Digital Delineation of Sub-Watershed Drainage Areas From the United States Geological Survey (USGS) Flow Gauges The United States Geological Survey (USGS) streamflow gauges are obtained from the USGS Internet site as discussed in Section 2.2.5. Only gauges in the study area with more than 10 years of record were used for the study. The gauges included are Los Omos, Chiltipin, Aransas, Medio, Mission, Oso, San Fernando, San Diego, and Copano. The digital drainage areas are compared to the USGS drainage areas for the nine gauging stations used in the study for a quantitative check on the accuracy of the digital drainage basins. To begin the watershed delineation, a stream link grid must first be calculated to determine a stream network and direction. The Avenue script STRMLNK, listed in Appendix B, is run to determine the stream link grid, and the Avenue script WTRSHD, listed in Appendix B, is used to calculate the sub- watersheds in the study area. For most of the sub-watersheds, the delineated drainage area is comparable to the USGS drainage area. However, the delineated drainage areas for Oso and Copano were smaller than the USGS drainage areas. This could be due to errors induced by the relatively flat topography near the coast. Another explanation of the drainage area disagreements is found when comparing the RF1 files and the DLG 76 files developed by the USGS. The RF1 file has the Oso Creek extending farther northwest than the DLG file. Since the DLG file is used for the surface reconditioning process, the Oso Creek sub-watershed is smaller than it would have been using the RF1 files. The problem was corrected by finding the depth of precipitation and depth of runoff for each of the sub-watersheds rather than the total precipitation and total runoff. The depths of precipitation and runoff are found by dividing total precipitation and total runoff by the appropriate drainage areas. This procedure is discussed in detail in Sections 3.2.2 and 3.2.3 of this report. Table 3.2 compares the delineated watershed areas to the USGS watershed areas, while Figure 3.8 shows the difference between the RF1 and the DLG files that was encountered within the Oso Creek watershed. Figure 3.9 shows the study area defined by the bay system drainage area and the delineated sub-watersheds. Table 3.2: Comparison of the USGS Calculated Drainage Areas and the Delineated Drainage Areas for Each of the Sub-Watersheds. 77 Figure 3.8: River Reach Files Compares to the Digital Line Graph File in the Oso Creek Sub-watershed. 78 Figure 3.9: Sub-watersheds in the CCBNEP Study Region. 79 3.2.2 Average Precipitation for each Delineated Drainage Areas A weighted flow accumulation operation is used to determine the average rainfall for each drainage area. A weighted flow accumulation is an extension of the flow accumulation discussed in Section 3.1.3. Instead of counting the number of cells upstream of a particular grid cell, the weighted flow accumulation sums the grid values from a second grid called the weight grid. Using the precipitation grid as the weight grid, the total annual potential runoff is calculated for the study area. The Arc/Info console is used to calculate the accumulated precipitation grid. Grid: accprecip2 = flowaccumulation ( fdac2, precip ) * 10 Where the factor of ten is used to convert the precipitation units of depth (mm) to units of volume (m 3 ). Each cell has an area of 10,000 m 2 . Or: Equation 3.1 Volume (m 3 ) = Depth (mm) * Area(# cells) * 10 Once the accumulated precipitation grid is calculated, it is added to the view. The USGS stream gauge coverage is overlaid and the ArcView inquiry tool is used to determine the accumulated precipitation for each of the delineated watersheds by clicking on the grid cell which contains the gauging station. The depth of precipitation for each sub-watershed is found by dividing the accumulated precipitation by the delineated drainage area. Table 3.3 shows the depth of precipitation while Equation 3.2 is used to calculate the depth of precipitation. 80 Equation 3.2 Depth (mm) = (Volume (m 3 ) / Area of watershed (m 2 )) * 1000 mm/m Table 3.3: Depth of Precipitation (mm/yr) for Each of the Drainage Areas. Station Precipitation Name (mm/yr) Los Omos 618 Chiltipin 841 San Fernando 661 San Diego 665 Oso 775 Aransas 810 Mission 847 Medio 787 Copano 927 3.2.3 Determining Average Runoff per Unit Area at each USGS Gauge The average streamflow record is determined using the daily streamflow values from each of the nine gauging stations used in the study. Only the USGS stations with a flow record longer than 10 years are used for the study. The mean annual flows are found for the years 1961 through 1990 and are shown in Table 3.4. The Mission River station is the only station of the nine which had the full 30 years of record. For an accurate establishment of the precipitation/runoff relationship, the same 30 year period should be used for both the precipitation and streamflow data. Therefore, a projected 30 year average annual streamflow at each gauge, Q g , are estimated using the average annual 1961-1990 streamflow at the Mission River gauge, Q m . These estimates are calculated by multiplying Q m by the ratio of q g /q m , where q g is the average annual streamflow at the gauge and q m is the average annual streamflow at the Mission gauge. Equation 3.3 is used, and the streamflow projections are shown in Table 3.5. 81 Table 3.4: Mean Annual Flow (cfs) of Record for Each of the Nine USGS Gauging Stations. Year LosOmos Chilt ipin SanFer n SanDiego Oso Ar ansas Mission Medio Copano 1961 64. 60 1962 45. 89 7. 34 1963 6. 38 4. 22 1964 1. 75 5. 84 11. 94 3. 51 1965 9. 85 4. 07 13. 98 52. 70 12. 55 1966 12. 05 2. 73 26. 68 119. 05 1. 60 1967 42. 59 86. 55 43. 77 206. 85 708. 51 182. 90 1968 2. 01 4. 31 0. 16 20. 73 147. 38 14. 42 1969 0. 82 4. 38 0. 26 16. 49 83. 24 3. 24 1970 0. 41 7. 42 4. 64 0. 34 16. 70 73. 72 8. 26 34. 77 1971 34. 43 131. 76 198. 26 103. 48 129. 33 424. 45 12. 56 109. 00 1972 3. 23 40. 15 7. 00 1. 09 18. 31 39. 07 198. 44 7. 27 64. 88 1973 10. 52 92. 30 15. 01 1. 64 74. 59 79. 28 398. 80 11. 63 85. 48 1974 4. 62 13. 85 13. 71 3. 70 10. 42 59. 34 119. 52 0. 83 24. 61 1975 1. 01 13. 17 2. 27 0. 29 16. 13 4. 96 39. 81 0. 62 1. 92 1976 4. 32 66. 67 23. 70 4. 23 55. 03 34. 38 282. 66 20. 48 47. 79 1977 0. 29 29. 63 3. 18 1. 24 16. 83 18. 57 131. 52 18. 89 16. 24 1978 0. 60 17. 84 3. 24 1. 14 36. 92 7. 46 69. 10 64. 73 1979 0. 55 61. 77 11. 22 2. 00 45. 74 18. 95 137. 79 53. 07 1980 5. 46 64. 28 37. 89 5. 82 50. 95 23. 57 128. 31 12. 07 1981 6. 80 48. 54 7. 99 1. 21 41. 41 62. 44 389. 56 150. 58 1982 12. 40 28. 42 2. 64 0. 50 24. 58 12. 76 126. 61 24. 54 1983 0. 00 51. 55 5. 66 2. 52 19. 70 29. 94 184. 85 95. 18 1984 45. 90 2. 70 0. 35 31. 95 8. 88 29. 10 8. 69 1985 58. 04 17. 65 4. 59 29. 44 21. 73 79. 07 15. 79 1986 1. 23 5. 40 0. 79 16. 90 3. 93 44. 69 13. 30 1987 62. 64 7. 81 30. 47 29. 81 101. 29 15. 94 1988 2. 49 0. 14 4. 86 10. 14 9. 22 0. 00 1989 0.47 0.16 2.35 2.34 1.24 0.52 1990 2. 08 18. 65 56. 05 200. 80 36. 75 Mean Annual Flow ( cf s) 7. 65 40. 01 21. 79 7. 53 28. 70 35. 56 147. 01 19. 40 41. 71 Equation 3.3 Q g = Q m * (q g /q m ) Where:Q g = Mean annual flow at gauging station of interest calculated from period of record. Q m = Mean annual flow at Mission gauging station calculated from period of record. q g = Mean annual flow at gauging station of interest q m = Mean annual flow at Mission gauging station 82 Table 3.5: Thirty-year Projected Mean Annual Flow for the Period 1961-1990. Year LosOmos Chilt ipin SanFer n SanDiego Oso Ar ansas Mission Medio Copano 1961 3. 36 17. 58 9. 58 3. 31 12. 61 15. 63 64. 60 8. 52 18. 33 1962 2. 39 12. 49 6. 80 2. 35 8. 96 11. 10 45. 89 7. 34 13. 02 1963 0.33 1.74 0.95 0.33 1.25 1.54 6.38 4.22 1.81 1964 0.62 3.25 1.77 1.75 2.33 5.84 11.94 3.51 3.39 1965 2. 74 14. 34 9. 85 4. 07 10. 29 13. 98 52. 70 12. 55 14. 95 1966 6. 20 32. 40 12. 05 2. 73 23. 24 26. 68 119. 05 1. 60 33. 78 1967 42. 59 192. 83 86. 55 43. 77 138. 32 206. 85 708. 51 182. 90 201. 02 1968 2. 01 40. 11 4. 31 0. 16 28. 77 20. 73 147. 38 14. 42 41. 81 1969 0. 82 22. 65 4. 38 0. 26 16. 25 16. 49 83. 24 3. 24 23. 62 1970 0. 41 7. 42 4. 64 0. 34 14. 39 16. 70 73. 72 8. 26 34. 77 1971 34. 43 131. 76 198. 26 103. 48 82. 86 129. 33 424. 45 12. 56 109. 00 1972 3. 23 40. 15 7. 00 1. 09 18. 31 39. 07 198. 44 7. 27 64. 88 1973 10. 52 92. 30 15. 01 1. 64 74. 59 79. 28 398. 80 11. 63 85. 48 1974 4. 62 13. 85 13. 71 3. 70 10. 42 59. 34 119. 52 0. 83 24. 61 1975 1. 01 13. 17 2. 27 0. 29 16. 13 4. 96 39. 81 0. 62 1. 92 1976 4. 32 66. 67 23. 70 4. 23 55. 03 34. 38 282. 66 20. 48 47. 79 1977 0. 29 29. 63 3. 18 1. 24 16. 83 18. 57 131. 52 18. 89 16. 24 1978 0. 60 17. 84 3. 24 1. 14 36. 92 7. 46 69. 10 9. 12 64. 73 1979 0. 55 61. 77 11. 22 2. 00 45. 74 18. 95 137. 79 18. 18 53. 07 1980 5. 46 64. 28 37. 89 5. 82 50. 95 23. 57 128. 31 16. 93 12. 07 1981 6. 80 48. 54 7. 99 1. 21 41. 41 62. 44 389. 56 51. 41 150. 58 1982 12. 40 28. 42 2. 64 0. 50 24. 58 12. 76 126. 61 16. 71 24. 54 1983 0. 00 51. 55 5. 66 2. 52 19. 70 29. 94 184. 85 24. 39 95. 18 1984 1. 51 45. 90 2. 70 0. 35 31. 95 8. 88 29. 10 3. 84 8. 69 1985 4. 11 58. 04 17. 65 4. 59 29. 44 21. 73 79. 07 10. 43 15. 79 1986 2. 33 1. 23 5. 40 0. 79 16. 90 3. 93 44. 69 5. 90 13. 30 1987 5. 27 62. 64 15. 01 7. 81 30. 47 29. 81 101. 29 13. 37 15. 94 1988 0. 48 2. 49 1. 37 0. 14 4. 86 10. 14 9. 22 1. 22 0. 00 1989 0.06 0.47 0.18 0.16 2.35 2.34 1.24 0.16 0.52 1990 10. 45 2. 08 29. 76 10. 29 18. 65 56. 05 200. 80 26. 50 36. 75 Mean Annual Flow ( cf s) 5. 66 39. 25 18. 16 7. 07 29. 48 32. 95 147. 01 17. 23 41. 71 The mean annual depth of streamflow (runoff per unit area) is found by dividing the 30-year average streamflow by the drainage area determined by the USGS and converting the units to mm/yr. The streamflow depth is used to represent the direct runoff for each of the drainage areas. Table 3.6 shows the streamflow depth for each sub-watershed. 83 Table 3.6: Streamflow Depths for Each of the Sub-watersheds. Station StreamFlow Name Depths (mm/yr) Los Omos 4 Chiltipin 106 San Fernando 12 San Diego 8 Oso 113 Aransas 46 Mission 74 Medio 29 Copano 164 Note the varied runoff for each of the gauging stations. The northern stations (Chiltipin, Oso, Aransas, Mission, Medio, and Copano) have larger runoff depths than the southern gauging stations (Los Omos, San Fernando and San Diego). 3.2.4 Establishing a Mathematical Relationship between Precipitation Percent Land Use and Streamflow Using the Microsoft Excel 5.0 Regression Tool, an equation is found to predict runoff using the relationship between streamflow depth, precipitation depth and percent land use in each of the nine watersheds. The depth of streamflow is used to represent the direct runoff from each of the drainage basins. The percent land use is found by clipping the land use file with the sub- watershed coverage using the Arc command Clip. The watershed land use file is then queried in ArcView using the Field pulldown menu with the Summarize option. The landuse field is active in the watershed land use attribute table. In the Table Summary Menu, the field chosen is Area which is summarized by Sum. The Add button is clicked, and the file name is changed to reflect the watershed. The summary table is viewed in Microsoft Excel 5.0 where the individual summaries of 84 land use areas are divided by the total area and multiplied by 100% to find the percent land use in the watershed. Arc: clip landuse2 aransas landara polygon # An equation is calculated for agricultural land use. The multiple regression tool is used with streamflow depth for the y-input and the precipitation depth and percent agricultural land are used as the x-inputs. Table 3.7 shows the input values that are used in the Regression Tool. Table 3.7: Input Values Used in the Excel Regression Tool. Watershed Streamflow Precipitation %Agric %Range (mm/yr) (mm/yr) Los Omos 4 618 12 87 Chiltipin 106 841 86 11 San Fernando 12 661 22 77 San Diego 8 665 13 86 Oso 113 775 97 1 Aransas 46 810 58 38 Mission 74 847 25 73 Medio 29 787 41 58 Copano 164 927 7 67 The Microsoft Excel 5.0 Regression output, shown in Table 3.8, is used to determine the best equation to represent the relationship between precipitation and runoff for agricultural land use. The coefficients are plugged into Equation 3.4: 85 Table 3.8: Summary Output for the Agricultural Land Use, Precipitation, and Runoff Analysis. SUMMARY OUTPUT Regression Statistics Mult iple R 0. 956543917 R Squar e 0. 914976265 Adjusted R Squ 0. 88663502 St andar d Er r or 0. 439935201 Obser v ations 9 ANOVA df SS MS F Significance F Regr ession 2 12. 49678582 6. 24839291 32. 28427 0. 00061464 Residual 6 1. 161257884 0. 193542981 T ot al 8 13. 6580437 Coefficients Standard Error t Stat P-value Lower 95% Upper 95% Lower 95.0% Upper 95.0% I nt er cept - 4. 79004056 1. 247523775 - 3. 839638696 0. 008563 - 7. 842623502 - 1. 7374576 - 7. 8426235 - 1. 7374576 X V ar iable 1 0. 01141489 0. 001546613 7. 380574565 0. 000317 0. 007630463 0. 01519932 0. 00763046 0. 01519932 X V ar iable 2 0. 346167599 0. 16942563 2. 043183194 0. 08706 - 0. 068402285 0. 76073748 - 0. 0684023 0. 76073748 Equation 3.4 lnQ = lna + b*P + c*ln(%A) where: Q = runoff depth (mm/yr) b = coefficient calculated using Regression tool P = precipitation depth (mm/yr) c = coefficient calculated using Regression tool %A = Percent agricultural land use The equation is solved for runoff, Q. If percent agriculture is assumed to be 100%, the last term in the equation, which represent percent agriculture, equals one and can then be dropped from the equation. Equation 3.5 results: Equation 3.5 Q = 0.008312 * exp ( 0.011415 * P ) where: Q = runoff depth (mm/yr) P = precipitation depth (mm/yr) 0.008312 = exp (-4.79004056) Again, the Microsoft Excel 5.0 Regression output, shown in Table 3.9, is used to determine the best equation to represent the relationship between 86 precipitation and runoff for rangeland. The coefficients are plugged into Equation 3.6, and are solved for runoff, Q. Table 3.9: Summary Output for the Rangeland, Precipitation, and Runoff Analysis. SUMMARY OUTPUT Regression Statistics Mult iple R 0. 989748737 R Squar e 0. 979602563 Adjusted R Squ 0. 972803417 St andar d Er r or 0. 215479731 Obser v at ions 9 ANOVA df SS MS F Significance F Regr ession 2 13. 37945462 6. 689727308 144. 0773 8. 48646E- 06 Residual 6 0. 278589088 0. 046431515 T ot al 8 13. 6580437 Coefficients Standard Error t Stat P-value Lower 95% Upper 95% Lower 95.0% Upper 95.0% I nt er cept - 5. 239701761 0. 583176391 - 8. 984763169 0. 000106 - 6. 66668403 - 3. 812719 - 6. 666684 - 3. 81271949 X Var iable 1 0. 010993081 0. 000763542 14. 39748217 7. 03E- 06 0. 00912476 0. 0128614 0. 00912476 0. 012861402 X Var iable 2 - 0. 315150467 0. 052227559 - 6. 034179522 0. 000936 - 0. 44294679 - 0. 187354 - 0. 4429468 - 0. 18735414 Equation 3.6 lnQ = lna + b*P + c*ln(%R) where: Q = runoff depth (mm/yr) b = coefficient calculated using Regression tool P = precipitation depth (mm/yr) c = coefficient calculated using Regression tool %R = Percent rangeland land use If percent rangeland is assumed to be 100%, the last term in the equation, which represented percent rangeland, equals one and can then be dropped from the equation. Equation 3.7 results: 87 Equation 3.7 Q = 0.0053 * exp ( 0.010993 * P ) where: Q = runoff depth (mm/yr) P = precipitation depth (mm/yr) 0.0053 = exp (-5.239702) Since, there are no gauged watersheds in the study region which represent urban land use, an expected runoff depth was taken from a study being done in the City of Austin (Barrett, 1997). The City of Austin was chosen because it receives a similar average annual precipitation as Corpus Christi, the largest city in the CCBNEP study region. The typical depth of runoff in the city of Austin ranges from 170 mm/yr to 200 mm/yr. The average between the two values, 185 mm/yr, is used for the CCBNEP study. The average annual precipitation in the Oso Creek watershed is used due to the proximity of Corpus Christi to the gauging station. The expected runoff depth (185mm/yr) is divided by the mean annual precipitation depth (774.75 mm/yr) resulting in a runoff coefficient of 0.24. Therefore, the land use grid cells representing urban area are assigned a runoff value of 24% of the mean annual precipitation for that grid cell. Equation 3.8 is the final equation. Equation 3.8 Q = 0.24 * P where: Q = runoff depth (mm/yr) P = precipitation depth (mm/yr) An attempt to find the urban land use runoff equation was done using the Regression tool, however the results gave unreasonably high runoff depths throughout the study area for urban land use areas due to the low percentage of 88 urban land use in the study region. The areas representing water are assigned a value of zero runoff because the precipitation over the bay system is already accounted for in the water quality model. By assigning a value of zero, the precipitation is not accounted for twice. Runoff in the wetland and barren land use areas were assigned the same equation as the rangeland. Figure 3.10 shows the precipitation versus expected runoff curves for urban, rangeland and agricultural land uses. It can be seen that the relationship between runoff and precipitation is not the same shape for urban land use as for agriculture and rangeland, but the lack of urban runoff data in the region precludes a more definitive analysis of this factor. Precipitation vs. Runoff Curves Chiltipin Copano Oso Mission Aransas Medio San Diego Los Omos San Fernando 0.00 50.00 100.00 150.00 200.00 250.00 0 200 400 600 800 1000 Depth of Precipitation (mm/yr) D e pt h of E x pe c t e d R u n o f f ( m m Range Land Agriculture Urban Stations Figure 3.10: Depth of Precipitation (mm/yr) vs. Depth of Expected Runoff (mm/yr) for Each of the Land Uses. 89 3.2.5 Computing Expected Runoff The Avenue script ROGRIDLAND, listed in Appendix B, is used to compute the runoff grid. The script runs in the ArcView environment and calculates the runoff grid using the percent land use, precipitation and runoff relationships developed in Section 3.2.4 of this report. The runoff grid is then divided by the precipitation grid to calculate a runoff coefficient grid. Any runoff coefficient greater than the urban runoff coefficient of 0.24 is set equal to 0.24. The final runoff grid is calculated by multiplying the precipitation grid by the runoff coefficient grid. Figure 3.11 shows the runoff grid for the study region. 3.3 Linking Expected Mean Concentration (EMC) Values to Land Use The study uses the Event Mean Concentration (EMC) values discussed in Chapter 2. The EMC values are obtained from a previous CCBNEP analysis, Characterization of Non-point Sources and Loadings to the Corpus Christi Bay National Estuary Program Study Area (Baird,1996). The Baird study developed EMC values from water quality analysis performed at the Oso Creek and Seco Creek USGS Stream Gauges. The Oso Creek gauge is located west of Corpus Christi and represents agricultural land use. The gauges located on Seco Creek are northwest of Hondo, TX, and represent range land uses. Refer to Table 2.2 in Section 2.2.8 for the EMC table used in the total loads study. 90 Figure 3.11: Runoff Grid Calculated Using the Relationship between Precipitation, Streamflow, and Percent Land Use. 91 3.3.1 Computing Concentration Grid The Avenue script CONCGRID, shown in Appendix B, is used to compute the concentration grids (Hellweger, 1996). CONCGRID runs in the ArcView environment and converts the land use polygons into a concentration grid. In this case, the cell value is equal to the constituent EMC field of choice. 3.4 Estimating Annual Loads Throughout the Watersheds The purpose of the project is to estimate the total constituent loads throughout the study area. The non-point sources are estimated by multiplying the concentration grids developed from the EMC values by the runoff grid. The point source loads are calculated from the point source study done by Armstrong (1997) for the Corpus Christi National Estuary Program?s Point Source Data Study. The upstream watershed load from the Nueces River watershed is calculated using Lake Corpus Christi as a point source assuming the concentrations in the Lake and the flow out of the Lake represented the loads from the upstream watershed. The atmospheric load is obtained from a National Atmospheric Deposition Program weather station in Beeville, TX (USGSNADP, 1997). 3.4.1 Computing Land Surface Loads The Avenue script LOADGRID, listed in Appendix B, is used to compute the land surface load grids. The script runs in the ArcView environment and calculates the land surface loads by multiplying the concentration grid by the runoff grid and a conversion factor. To run the script properly, the concentration grid and the runoff grid must be in the view. The script converts the concentration grid to a grid showing the land surface loads in Kg/day. The script makes a conversion of mg/l (concentration grid) * 92 mm/yr (runoff grid) to the Kg/day (load grid). The conversion constant of 1/36525 is used to the inputs units of mm/yr and mg/l, and to the output units of Kg/d. Equation 3.9 Load (Kg/d) = Runoff (mm/yr) * Concentration (mg/l) * Cell Area (10,000 m 2 ) * (1m /1,000mm) * (1yr/365.25d) * (1 Kg/10 6 mg) * (1000liters/1m 3 ) Load (Kg/d) = Runoff * Concentration * Cell Area * (1/36525) 3.4.2 Computing Point Source Loads The point source grid is based on the point source discharge data compiled by Armstrong (1997) for each of the surface water quality segments of the Texas Natural Resources Conservation Commission (TNRCC). Figure 3.12 shows the TNRCC water quality segments used in the study. To create the point source load grid, a digital map of surface water quality segments was obtained from the TNRCC via their Internet Site (TNRCC, 1997): http://www.tnris.state.tx.us/ftparea.html. The files need to be converted into an Arc/Info format. The Avenue script POINTLD, listed in Appendix B, is used to convert the water quality segment coverages to a point source grid (Hellweger, 1996). For streamlines the cell corresponding to the first point in the line was valued with the load and for polygon segments in the bay, a cell inside the area was valued with the loads. 93 Figure 3.12: Texas Natural Resource Conservation Commission Water Quality Segments Used in the CCBNEP Study. 94 3.4.3 Computing Upstream Watershed Loads The loads from the upstream Nueces watershed are determined by using Lake Corpus Christi as a point source. The flow leaving the Lake at the Nueces River gauging station near Mathis, TX, is calculated as a thirty year average for the years 1961 - 1990, similar to the streamflow calculations used in the precipitation/runoff analysis. The resulting streamflow leaving Lake Corpus Christi is calculated to be 20 m 3 /s. The water quality data representing the Lake are found from the TNRCC Internet site: http://www.tnris.state.tx.us/ftparea.html. The constituents used in the study were total nitrogen, total phosphorus and iron. The concentration values for the other constituents are too small to measure or no data existed at this location. The constituent load is found by multiplying the constituent concentration of the Lake by the flow out of the Lake. Equation 3.10 Load (Kg/d) = Concentration (mg/l) * Flow (m 3 /s) * (1Kg/ 10 6 mg) * (1000 liters/1 m 3 ) * (86,400sec/d) Load (Kg/d) = Concentration (mg/l) * Flow (m 3 /s) * 86.4 The total nitrogen, total phosphorus, and iron loads are added into the water quality segment coverage to the segment number which represented Lake Corpus Christi. The total phosphorus load is 58.52 Kg/d, while total nitrogen and iron loads are 81.11 Kg/d, and 2.23 Kg/d respectively. 3.4.4 Computing Atmospheric Loads The atmospheric load is only applied to the bay system because on the land surface it is accounted for in the EMC values. The atmospheric deposition data was 95 obtained from the USGS National Atmospheric Deposition Program?s Internet Site (USGSNADP, 1997): http://h20.usgs.gov/nwc/NWC/pH/html/ph.html. The Beeville, Texas, station was used due to its location in the study area. The specific Internet site for the Beeville station is: http://nadp.nrel.colostate.edu/NADP/cgi_scripts/sitepics.cgi?TX03. The Beeville constituent concentrations were compared with a study completed by Liljestrand et al. (1986). The ammonia and nitrate concentrations are similar in both the study and at the USGS Internet site. The study by Liljestrand found that atmospheric concentrations are 0.82 mg/l for nitrate and 0.25 mg/l for ammonium while the nitrate concentrations for the Beeville station are 0.81 mg/l and 0.29 mg/l for ammonium. The Beeville station data are used for the total loadings study because the data is more current. The data from the Internet site is downloaded as a wet deposition annual average loading in units of Kg/ha/yr. The data are averaged for the years 1986 to 1997, and converted to Kg/m 2 /day. Finally, the data is multiplied by the surface area of each of the bay segments. This gives a loading of Kg/d, which is the correct unit needed in the water quality model. The total nitrogen load is found by adding the nitrate load to the ammonium load. Equation 3.11 explains the unit conversions used in the calculations: Equation 3.11 Load (Kg/d) = Load (Kg/ha/yr) * Area (m 2 ) * (1/(3.6525 * 10 6 )) A calculation is done to compare the amount of atmospheric load which falls on the land surface to the total land surface load. The loading data from the Beeville site is applied to the entire land surface using Equation 3.11. The entire load is then divided by the number of cells in the study area to determine a load per 96 cell. The load per cell is multiplied by the runoff coefficient for each cell to calculate the amount of atmospheric load that is found in the runoff. Using the Zonalmean function in Arc, the mean load per cell is found over the land surface (0.001 Kg/d). The total atmospheric load over the land surface is the product of the mean load per cell and the number of cells over the land surface (2733 Kg/d). The atmospheric load over the land surface is approximately 35% of the total land surface load. 3.4.5 Computing Sediment Loads Sediment fluxes for nutrients are obtained from a report entitled Benthic Nutrient Fluxes of Selected Estuaries in the Gulf of Mexico (Montagna et al., 1997). The data are obtained from graphs which show the variance and the mean values. The mean values are extracted from the graphs as fluxes in Pmol/m 2 /hr. The report has data for Corpus Christi Bay and the Laguna Madre. The following flux assignments are made to the bays without data due to their geographic location to the bays with flux data. Baffin Bay is assigned the same flux as the Laguna Madre while Nueces Bay, Inner Harbor, and Oso Bay are assigned the same flux as Corpus Christi Bay. The mean flux for San Antonio Bay is also extracted from the graph to determine a linear trend northward from Corpus Christi Bay to San Antonio Bay, which is the northern boundary of the study area. The nitrate + nitrite flux data is assigned an upward trend from Corpus Christi Bay (75 Pmol/m2 hr) through Red Fish Bay, Copano Bay and Aransas Bay to San Antonio Bay (175 Pmol/m 2 /hr). Red Fish Bay and the Aransas Bay south segments are assigned a flux of 112.5 Pmol/m 2 /hr, which is 1.5 times higher than the Corpus Christi Bay flux. Copano Bay, and the Aransas Bay middle and north segments are assigned a nitrate plus nitrite flux of 150 Pmol/m 2 hr which is twice as large as the Corpus Christi Bay 97 flux. This gives linear flux values from Corpus Christi Bay to San Antonio Bay. The San Antonio Bay mean ammonium flux is outside the range of the variance. The trend from Corpus Christi Bay to San Antonio Bay is decreasing, however the mean value is negative. Therefore, a downward linear trend is used to compute the Red Fish Bay, Aransas Bay and Copano Bay fluxes. Red Fish Bay and Aransas Bay south segment were assigned a value of 37.5 Pmol/m 2 /hr which is 75% of the flux measured in Corpus Christi Bay. Copano Bay and the Aransas Bay north and middle segments are assigned a value of 25 Pmol/m 2 /hr, which is 50% of the flux measured in Corpus Christi Bay. Once the fluxes are calculated, the loads for each segment are calculated based on the surface area of the segment using Equation 3.12: Equation 3.12 Load (Kg/d) = flux (Pmol/m 2 hr) * 10 -6 (mol/(Pmol) * 24 hr/d * # grams/mole * Area (m 2 ) * Kg/1000 g The resulting nutrient sediment loads are two orders of magnitude larger than the other calculated loads. This is could be due to the study being a measure of nutrient flux out of the sediment rather than being a net flux where the flux into the sediment is also measured. Therefore, the sediment load data is not used as part of the total loads to the water quality model. 3.5 Calibrating the Water Quality Model A series of Avenue scripts making up the water quality model is used to calculate the equilibrium constituent concentration in the bay system (Hellweger, 1996). The model uses an explicit finite difference algorithm. The software runs within the ArcView environment. The model uses the methodology presented by 98 Thomann and Mueller (1987). Figure 3.13 is a graphical depiction of the methodology of the program. WA E(ss)A,B A B ?? Qs A,B A ? W B E(ss) B, BND B BND ?? Qs B,BND B ? SEGMENT A V A , K A , s A BOUNDARY s BND SEGMENT B V B , K B , s B ?KV AA ? s A ? KV BB ? s B E(ss)O,A O A ?? Qs O,A A ? Figure 3.13: Water Quality Methodology Used in the Calculations of the Equilibrium Concentrations. Equation 3.13 ds B * V B = Q A,B *s A - Q B , BND *s B + E A,B *(s A - s B ) + E B , BND *(s B - s BND ) - K B *V B *s B + W B dt where: ds B = change in concentration of segment B / change in time dt V B = volume of segment B; (m 3 ) Q A,B = flow from segment A to B; (m 3 /s) Q B , BND = flow from segment B to BND; (m 3 /s) s A = concentration of constituent in segment A; (mg/l) s B = concentration of constituent in segment B; (mg/l) s BND = concentration of constituent at boundary; (mg/l) E A,B = bulk dispersion coefficient between segments A,B; (m 3 /s) E B , BND = bulk dispersion coefficient between segments B,BND; (m 3 /s) K B = decay rate in segment B; (/d) W B = waste load in segment B; (kg/yr) Equation 3.13 is a mass balance around Segment B of Figure 3.13. Assuming steady state, the (dsB/dt) VB term is zero. The rest of the terms represent: 99 x the advective load entering from segment A, QA,B * sA x the advective load leaving at the boundary, QB,BND * sB x the dispersive load across the segment A and segment B interface, EA,B(s A ? sB) x the dispersive load across the segment B and boundary interface, EB,BND(s B ? sBND) x the load lost to decay, KB * VB* sB x the waste load into segment, WB The model is first calibrated against salinity data for dispersion coefficients. The calibration process began with segmenting the bay system using the 20 segment partitioning of the bay system described earlier. The water quality model reaches steady state by doing time varying computations from an assumed set of initial concentrations in each bay until concentration values converge to a steady value. The dispersion coefficients are obtained by a trial and error method which is described in detail in Section 3.5.4. 3.5.1 Bay System Bathymetry The bathymetry data for the water quality model is taken from a file from the Texas Water Development Board hydrodynamic model of the bay system developed by Junji Matsumoto (1993). The segment surface areas are calculated using the CALCAREA Avenue script, shown in Appendix B (Hellweger, 1996). The segment and interface depths are calculated using the Surface Water Modeling System (SMS) graphical user interface. The segment volumes are calculated by multiplying the surface area and the segment depths. Because the inlet segment is small compared to other segments, it controlled the numerical stability of the model. The volume of the Inlet segment is increased by a factor of 1000 to allow for this. This did not change the model results for salinity because the model is solved for a steady state solution without decay. Table 3.10 shows the segment ID, segment depth, segment area, and segment volume. 100 Table 3.10: Segment Name, ID, Depth, Surface Area and Volume. Depth Area Volume Segment ID (m) (m^2) (m^3) St. Charles stc 0.7 33173300 23221300 Copano cop 1.3 19193100 249510000 Aransas North aran 1.4 38094600 53332400 Aransas Middle aram 2.2 110235000 242518000 Aransas South aras 2.6 120451000 313173000 Redfish red 1.6 98067500 156908000 Inlet inl 14.0 4117510 57645100000 Nueces West nuew 0.7 12096600 8467650 Nueces Middle nuem 0.8 20349600 16279700 Nueces East nuee 1.0 37515700 37515700 Inner Harbor inh 14.0 6204910 86868700 Corpus North ccbn 5.3 108541000 575267000 Corpus Middle ccnm 3.4 200240000 680816000 Corpus East ccbe 3.4 101090000 343707000 Corpus South ccbs 0.6 35924600 21554800 Oso oso 0.7 17746600 12422600 ULM North ulmn 1.5 173796000 260694000 ULM Middle ulmm 1.8 78999500 142199000 ULM South ulms 1.8 217413000 391344000 Baffin baf 1.3 239474000 311317000 The Avenue script CALCLENGTH, shown in Appendix B, is used to determine the interface length between each of the segments (Hellweger, 1996). The line between Corpus Christi South and Lower Laguna Madre North is adjusted manually from 6449 meters to 1000 meters. This interface represents the JFK Causeway and the opening between the two bays is much smaller than the calculated interface length. The interface areas are calculated by multiplying the interface depth and length. Table 3.11 shows the segment interface identification, the interface line length, the interface length which is used in the model, the interface depth, and the interface area. 101 Table 3.11: Bay Segment Interface, Interface Line Length, Interface Length, Interface Depth, and Interface Area. Interface Line Interface Depth Area From To Length (m) Length (m) (m) (m^2) St. Charles Aransas Middle 3924 1600 0.80 1280 Copano Aransas Middle 2946 2946 1.60 4714 Aransas North Aransas Middle 4257 4257 1.70 7237 Aransas Middle Aransas South 5953 5953 3.00 17859 Aransas South Redfish 16607 830 2.10 1743 Aransas South Inlet 2211 800 7.50 6000 Redfish Corpus North 353 353 3.60 1271 Redfish Inlet 1552 200 3.00 600 Inlet Corpus East 2281 1100 9.30 10230 Corpus North Corpus Middle 21123 211223 6.70 1415194 Corpus North Corpus East 978 978 10.10 9878 Corpus North Inner Harbor 522 522 14.00 7308 Nueces West Nueces Middle 2618 2600 0.80 2080 Nueces Middle Nueces East 4574 4100 0.90 3690 Nueces East Corpus North 3458 2900 1.20 3480 Corpus Middle Oso 385 200 1.30 260 Corpus Middle Corpus East 19070 18070 3.50 63245 Corpus East Corpus South 5637 4000 1.40 5600 Corpus East Redfish 11235 4494 3.50 15729 Corpus South ULM North 6449 1000 5.50 5500 ULM North ULM Middle 3588 3000 1.60 4800 Baffin ULM Middle 6798 6700 1.50 10050 ULM Middle ULM South 5990 4200 1.90 7980 3.5.2 Bay Evaporation and Precipitation The evaporation data are obtained from a grid of mean annual open water evaporation provided by Reed et al. (1996). The evaporation grid was originally calculated by extrapolating pan evaporation data from the Texas Water Development Board. Table 3.12 compares the evaporation and precipitation to the Texas Water Development Board?s (Matsumoto, 1993) mean annual precipitation and evaporation. The two sets of values are comparable. 102 Table 3.12: Comparison of the Calculated Mean Annual Evaporation and Precipitation with the Texas Water Development Board's Bay System's Mean Annual Evaporation and Precipitation. Mean Annual TWDB Pan TWDB Precipitation Precipitation Evaporation Evaporation Segment (m/yr) (m/yr) (m/yr) (m/yr) stc 0.93 0.83 1.55 1.58 cop 0.89 0.83 1.57 1.58 aran 0.93 0.83 1.55 1.58 aram 0.91 0.83 1.55 1.58 aras 0.88 0.83 1.62 1.58 red 0.86 0.83 1.63 1.58 ccbn 0.83 0.83 1.63 1.58 nuee 0.81 0.83 1.63 1.58 nuew 0.81 0.83 1.63 1.58 nuem 0.81 0.83 1.63 1.58 inl 0.84 0.83 1.63 1.58 ccbe 0.84 0.83 1.63 1.58 inh 0.81 0.83 1.63 1.58 ccbm 0.82 0.83 1.63 1.58 oso 0.78 0.83 1.63 1.58 ccbs 0.81 0.83 1.63 1.58 ulmn 0.79 0.83 1.63 1.58 baf 0.73 0.83 1.63 1.58 ulmm 0.74 0.83 1.63 1.58 ulms 0.69 0.83 1.62 1.58 3.5.3 Inflow to Bay System The inflows are determined by calculating a weighted flow accumulation with the runoff grid as the weight grid. The weighted flow accumulation routes the runoff over the land surface downstream into the river network and into the bay system. Table 3.13 shows the calculated runoff compared to the runoff calculated by the USGS (Ward, 1996) and the TWDB (Matsumoto, 1993). The three sets of numbers are comparable with the calculated runoffs from this study, for the most part, being in between the other data sets. 103 Table 3.13: Comparison of the Calculated Runoff Inflows with Two Other Inflow Studies by the USGS and the TWDB. Calc. USGS TWDB Runoff Runoff Runoff Segment (m^3/s) (m^3/s) (m^3/s) stc 5.4 2.9 3.3 cop 19.0 25.9 17.5 aran 0.0 0.0 0.0 aram 0.2 0.0 0.0 aras 0.0 0.0 0.0 red 0.2 0.5 0.0 ccbn 0.3 16.5 0.0 nuee 0.3 0.0 0.0 nuew 21.9 20.0 13.5 nuem 0.1 0.0 0.0 inl 0.0 0.0 0.0 ccbe 0.0 0.0 0.0 inh 0.3 0.0 0.0 ccbm 0.4 0.0 0.0 oso 1.1 0.0 2.7 ccbs 0.0 0.0 0.0 ulmn 0.2 0.0 0.0 baf 5.6 4.2 2.1 ulmm 0.0 0.0 0.0 ulms 1.2 0.2 0.0 total 56.1 70.2 39.1 Since the bay system extends outside the CCBNEP study area, some inflow is routed into the Aransas North segment, which would normally be routed into another bay segment. This problem was discussed in Section 3.1.2.2 and is corrected manually by setting the runoff to zero. To determine the north boundary condition, an estimation of the inflow from the San Antonio Bay is calculated. The USGS gauging stations on the San Antonio River near Goliad, TX, and the gauging station on the Guadalupe River near Victoria, TX, are used to estimate the inflow into the San Antonio Bay. The flow data was downloaded from the USGS Internet site discussed in Chapter 2 of this report. The resulting inflow, 77.44 m 3 /s, from the two rivers is found by taking a 30 year average over the time period from the years 1960 ? 1991. The northern 104 interface boundary is set equal to 20% of the inflow into the San Antonio Bay from the Guadalupe River and the San Antonio River. The north boundary inflow is set to 15.49 m 3 /s. This result compares to a study done by the Texas Water Development Board where an estimate of 11 m 3 /s was calculated for the freshwater portion of the inflow to the Aransas Bay from the San Antonio Bay (Brock, 1997). The Gulf of Mexico boundary is fixed as 6.33 m 3 /s to close the water mass balance. The south interface boundary flow is treated as a no flow boundary. 3.5.4 Model Calibration Using Salinity The salinity data are used to manually calibrate the interface flows and the dispersion coefficients. The interface flows and the dispersion coefficients are found using a trial-and-error method, and are modified as needed. The process is repeated until the calculated salinity?s matched the observed salinity?s. A file of salinity measurements is obtained from Ward (1996). The measurements are grouped together according to this original segmentation. A time- and space-weighted average is used to average the salinity data because the two dimensions, time and space, needed to be considered when averaging the data. This method employs a process where each measurement is given a weight proportional to the time between the last measurement and the next measurement. If the time between the measurements exceeds one month, a weight corresponding to one month is assigned. This is done to prevent measurements at the end of a long no-measurement period from being assigned too much weight. The maximum time period is set to be close to the response time of the system. The Avenue script TIMEAVE, shown in Appendix B, is used for the time-weighted average (Hellweger, 1996). The observed data are then weighted according to the segment surface area Equation 3.14: 105 Equation 3.14 Conc = )*( 1 sA A ii i ? ? where: Ai = surface area si = observed concentration in segment The north and south boundaries of the bay segmentation are assigned salinity?s similar to their adjacent segments because observed salinity data are not available at these locations. The north boundary is set to 19.10 ppt while the south boundary is set to 37.65 ppt. The Gulf of Mexico boundary is set to the observed salinity concentration of 29.37 ppt. The model calibrates the tidal dispersion coefficients. Because the model is based on a mean annual flow, the dispersion load calculations need to consider molecular diffusion, eddy diffusion, turbulent conditions, and tidal mixing. Therefore, the bulk dispersion coefficients need to be calculated. The calibrated dispersion coefficients and the bulk dispersion coefficients are related by Equation 3.15 (Thomman and Mueller, 1987). Equation 3.15 E bulk = E cal * A / ?x Where:E bulk = bulk dispersion coefficient E cal = calibrated dispersion coefficient A = surface area ?x = length of segment The bulk dispersion coefficients are calculated using the Avenue script CALCEP which is listed in Appendix B (Hellweger, 1996). Table 3.14 shows the dispersion coefficients, the bulk dispersion coefficients, and the interface flows 106 calculated from the calibration process. Table 3.14: Salinity Interface Dispersion Coefficients, Bulk Dispersion Coefficients, and Interface Flows. Dispersion Bulk Disp. Flow Interface Coeff. (m^3/s) Coeff. (m^3/s) (m^3/s) aran/boun 5000.00 1819.69 -15.49 aram/stc 160.00 14.85 -4.71 aram/cop 160.00 52.43 -14.87 aram/aran 500.00 275.64 -15.94 aras/aram 35.00 39.99 -33.49 red/aras 320.00 58.02 -28.35 aras/inl 50.00 27.96 2.33 red/inl 500.00 31.00 2.00 ccbe/inl 1000.00 757.99 2.08 ocean/inl 200.00 301.96 -6.33 ccbn/nuee 550.00 194.35 -20.41 nuem/nuew 300.00 195.75 -21.55 ccbe/red 30.00 27.74 -24.17 ccbn/red 250.00 17.19 0.00 nuem/nuee 420.00 241.99 21.14 ccbn/ccbe 500.00 309.97 0.00 inh/ccbn 7.00 3.39 0.10 ccbm/ccbn 100.00 1544.60 -18.05 ccbm/oso 5000.00 131.71 -0.57 ccbm/ccbe 1000.00 4901.24 13.93 ccbs/ccbe 1000.00 395.81 -33.48 ulmn/ccbs 500.00 153.13 -32.56 ulmm/ulmn 1000.00 182.47 -28.13 ulmm/baf 500.00 393.50 1.32 ulms/ulmm 5000.00 909.10 -24.57 ulms/boun 5000.00 1738.79 0.00 3.6 Computing Equilibrium Water Quality Concentrations in the Bay System The variables used in the water quality model are: _deltat = timestep, [T] s = concentration, [M/ L 3 ] sb = boundary concentration, [M/ L 3 ] q = flow, [L 3 /T] ep = bulk dispersion coefficient, [L 3 /T] fad = advective mass flux, [M/T] fdi = diffusive mass flux, [M/T] v = volume, [L 3 ] k = decay rate, [1/T] 107 wnp = non-point source load, [M/T] wps = point source load, [M/T] wat = atmospheric load, [M/T] wot = other load, [M/T] wse = sediment load, [M/T] wad = net advective load, [M/T] wdi = net diffusive load, [M/T] wd = decay load, [M/T] There are various inputs which BALANCE needs to run properly. The inputs should be listed in the attribute table. If the following attributes are not present in the attribute tables of the active themes, BALANCE will add the fields to the attribute tables: Line Attributes q = flow ep = bulk dispersion coefficient sb boundary concentration (only for boundary lines) Polygon Attributes v = volume k = decay rate wnp = non-point source load wps = point source load wat = atmospheric load wse = sediment load wot other load so = initial concentration The output data is stored in the attribute tables of the polygon and line coverages. The output is a mass balance at the last time step. The following attributes are computed during the water quality mass balance: Line Attributes fad = advective mass transport fdi = diffusive mass transport 108 Polygon Attributes s = concentration wad = net advective load wdi = net diffusive load wd = decay load To use the system, the attribute table should be filled with as much input data as possible. The units should be configured to SI (There is a bug in the program when using the English or Generic units). Data may be entered into the attribute tables by using the Graphical User Interface (GUI) tools, or by manually entering the data into the attribute table. The GUI tool, C, allows the configuration of the units. The GUI tool, M, allows the modification of the active theme?s attribute table. This tool allows the user to click on the polygon or line of interest and make the change. The GUI tool, B, starts the BALANCE program. The following control parameters are needed for the water quality program to run properly. Delta t = Time step used Converge delta s = If the maximum change in concentration from one time step to another is smaller than this value, the system assumes the steady state is reach, and the program is stopped Diverge delta s = If the maximum change in concentration from one time step to the next is larger that this value, the system assumes unstable conditions, and the program is stopped. Max t = Maximum time for the computation User Observation Level = Specifies the amount of the information conveyed to the user during the computation where: level 1 = The ArcView status bar is updated periodically. Information displayed includes time, max change in s, and percent of max time. level 2 = In addition to level 1, the legend is periodically updated. This is useful if, the polygons are colored based on concentration. 109 level 3 = In addition to level 2, the mass balance terms are plotted. level 4 = In addition to level 3, the system pauses after every time step and displays the time and maximum change in concentration from the last step. The model can be stopped for four reasons, 1) convergence, 2) divergence, 3) a time limit was reached, or 4) it can be stopped by user. To examine the results of the model, the GUI tool, I, may be used. The theme of interest should be active, and then click the polygon or line of interest. The message box will display the outputs discussed earlier in the report. The GUI tool, P, can be used to plot mass fluxes and loads. To configure the plot parameters, use the GUI, C, with the plot parameter option. Choose the parameters, which are desired on the plot. An Excel 5.0 worksheet is used for some calculations instead of the BALANCE program (Eid, 1997). The worksheet uses the same methodology as the water quality model, but reduces the run time significantly. The worksheet is used to calibrate the water quality model using the salinity data, and it is also used to calculate the equilibrium constituent concentrations due to the total loads. The operation of the spreadsheet and the ArcView program are checked against each one another for consistency. 3.7 Loads from Weighted Flow Accumulations The non-point source load is determined by multiplying the concentration grid by the land based runoff grid. The point source grid is calculated by using the CCBNEP point source data (Armstrong, 1997). The upstream load is found using Lake Corpus Christi as a point source to represent the Nueces River Watershed. The weighted flow accumulation command is used to calculate the land surface, point source, and loads from the Nueces River Watershed. A weighted 110 flow accumulation is an extension of the Flowaccumulation command discussed in Section 3.1.3. Instead of counting the number of cells upstream of a particular grid cell, the weighted flow accumulation sums the grid values from a second grid called the weight grid. Using a load grid as the weight grid, the annual load is calculated for the study area. All loads are an average daily load in Kg/d. First, the load grids were clipped to the size of the study area using the grid big1. The Arc/Info console is used to calculate the accumulated load grids. Each command is repeated for the constituents being modeled; nitrate + nitrite, ammonium, total nitrogen, total phosphorus, oil & grease, copper, cadmium, chromium, zinc, lead, iron, arsenic, and mercury. Three Arc Macro Language programs (AMLs) (pogridwf.aml, logridwf.aml, and lkgridwf.aml) are written for the calculations and are listed in Appendix B. Each AML is responsible for calculating the weighted flow accumulation of the point source grids, land surface load grids, and the upstream load grids. The weighted flow accumulation can also be calculated by using the Avenue script WFACGRID, shown in Appendix B. The script uses the same methodology as the weighted flow accumulation command used in the Grid module (Hellweger, 1996). After the weighted flow accumulation is calculated, the Avenue script PICKLOAD, listed in Appendix B, is used to determine the loads from the land surface, point source and Nueces River (Hellweger, 1996). PICKLOAD only works in the UNIX ArcView system. The need for PICKLOAD is due to the unstability of the grid algorithms near the bay centroid. At the bottom of a sink the flow direction is undefined. This causes the flow accumulation algorithm to break down, therefore the cell located at the centroid of the segment does not contain the correct value. To avoid this 111 problem, the grids are not queried at the centroid of the segment areas, but rather around the perimeter of a five-by-five square centered on the centroid. The program PICKLOAD does this calculation. The program automatically writes the load to the wnp field of the bay attribute table, thus connecting land surface loads into bay segment attributes. The wnp field is used to obtain the loads to each of the segments. The land surface loads for the constituents, lead, copper, zinc, cadmium, chromium, and nickel are divided by 1000 since the concentration is in ug/l. The Nueces River iron load is also divided by 1000 due to units of concentration being ug/l. 3.8 Running the Model Before the water quality model can be run, the total loads need to be entered into the appropriate field of the bay attribute table. This can be done using PICKLOAD, entering the values in manually, or by using the tool button M. To run the water quality model, the bay polygon and bay arc coverages need to be active in the view, and the tool button B needs to be clicked. The run control parameters used for the CCBNEP Total Loadings project are as follows: Delta t [hr] = 12 Converge delta s [mg/l] = 0 Diverge delta s [mg/l] = 10,000 Max t [hr] = 60,000 The total loads can either be entered into the appropriate field in the wnp load column or into the Excel 5.0 spreadsheet. The spreadsheet is used for the thirteen constituents; ammonium, nitrate + nitrite, total nitrogen, total phosphorus, oil and grease, copper, cadmium, chromium, lead, zinc, iron, arsenic, and mercury; and salinity. 112 4 RESULTS AND DISCUSSION To understand the bay system, it is important to look at where the water enters into the system. The system is driven by the inflow that enters into the bays from the north portion of the study region while the south portion of the study region contributes little inflow and most of the water in the bays is evaporated. Total loads are discussed as well as the specific source by which the load is contributed. Some of the data needed in the total loads calculations are missing, however overall equilibrium concentrations in the bay system can still be calculated within a reasonable error. For most of the metals, the expected concentrations are under-estimated which suggests that a load source is missing in the calculations. The nutrient concentrations are over-estimated compared to the observed concentrations, however, decay is not considered in the water quality model which causes the over-estimation. The calculated constituent concentration for oil and grease is estimated with in a reasonable error. 4.1 Inflow into Bay System The inflow into the bay system is calculated by running a weighted flow accumulation on the expected runoff grid. The runoff is accumulated into the centroid of each bay segment. Two other inflows are added into the model, 1) inflow from the Nueces River Watershed, and 2) inflow from the San Antonio Bay. The total inflow into the entire bay system is 71.6 m 3 /s as shown in Table 4.1. For the runoff analysis, the bay system is broken into three sections; north, middle, and south. The land that drains into Aransas Bay, Copano Bay, and Redfish Bay constitute the north portion of the study region. The land that drains into Nueces Bay, Corpus Christi Bay, the Inner Harbor, and Oso Bay, and the Nueces River Watershed constitute the middle portion of the study region. The 113 land that drains into Baffin Bay and the Laguna Madre, constitute the south portion of the study region. The majority of the inflow into the system is from the north portion of the study region. Approximately, 56% of the inflow enters into this portion of the bay system. San Antonio Bay contributes approximately 21.5% of the inflow to the Aransas Bay, while the land surface drainage in the north portion contributes approximately 34.5% of the inflow into the system. The total inflow into the middle section of the bay system is 24 m 3 /s. The Nueces River contributes approximately 28% of the inflow, while the land surface in the middle portion of the study region contributes approximately 6% of the inflow. Very little inflow enters into the system in the south portion of the study area. Only 10% of the inflow enters in from the south portion of the study region. Table 4.1 shows the total and percent inflow from each source. Table 4.1: Percent Inflow to the Bay System from Different Sources. Total Inflow % Inflow (m^3/s) 15.5 21.6 San Antonio Bay 24.8 34.6 Land Surface Inflow From North 40.3 56.2 Total Inflow from North 20.0 27.9 Nueces River Inflow 4.4 6.1 Land Surface Inflow from Middle 24.4 34.0 Total Inflow from Middle 7.0 9.8 Land Surface Inflow from South 71.6 100.0 Total Inflow into Bay System The larger inflow into the bay system in the north portion of the system versus the south portion of the bay system can be explained by the precipitation and runoff gradient as you move from south to north in the study region. The 114 precipitation is lower in the south than in the north portion of the study region. The runoff gradient has a steeper incline from south to north than the precipitation gradient. As the ground saturates from the increase in precipitation, less water infiltrates due to the saturated soil which in turn causes more of the water to become runoff. Figure 4.1 shows graphically the precipitation and runoff gradients from south to north, while Figure 4.2 shows the runoff and precipitation gradients geographically. At location A, south of Baffin Bay, a mean annual precipitation of 600mm/yr yields a runoff of 10 mm/yr, or a runoff coefficient of 0.02. At location B, near Copano Bay, 1000 mm/yr of mean annual precipitation converts to 100 mm/yr of runoff, or a runoff coefficient of 0.1. Thus, as one moves North, the precipitation increases by a fraction of 1.7, but the runoff increases by a factor of 10 between the same two points. The wetter ground in the North yields a much greater percentage of the precipitation as runoff, as well as having more precipitation to begin with. The average precipitation onto the bays is approximately 800 mm/yr and the average evaporation is approximately double that figure, or 1600 mm/yr. On average, nearly all the inflow to the bays is dissipated by the net evaporation from the bays, and the mean annual outflow from the bay system to the Gulf of Mexico is only 6 m 3 /s. The remainder of the flow is lost by evaporation. There is a significant amount of uncertainty as to the amount of flow entering the bay system from the San Antonio and Guadalupe Rivers. If this inflow is omitted, essentially all the drainage into the Corpus Christi Bay system is lost to evaporation and does not flow to the oceans. It follows that on average, the bay system is not substantially flushed by inflow, therefore it is a large sink that has to 115 Precipitation and Runoff Gradients along Bay System A B A B 1 10 100 1000 South North Precipitation (mm/yr) Expected Runoff (mm/yr) Precipitation Runoff Figure 4.1: Precipitation and Runoff Gradient from South, A, to North, B, along the Bay System. a) b) Figure 4.2: a) Precipitation and b) Runoff Gradient Locations in the South, A, and the North, B, Portions of the Study Area. 116 absorb most of the loads that come into it from the land surface, atmosphere, and point sources. The conclusion that the system acts as a sink coincides with a study by Ward (1997), Current Status and Historical Trends of Estuarine Circulation. The Ward study states that there are three components to the Gulf of Mexico astronomical tides; 12.4-hour semidiurnal, 24.8-hour lunar diurnal, and the 13.6- day fortnightly cycle in the magnitude of declination of the moon. The bays act as stilling wells due to the fact that the slower, longer-period variations are passed through the connecting conduits, but the shorter-period variations are significantly filtered out. Figure 4.3 shows the water balance for each of the three bay systems and the entire bay system. As it is shown, the inflow into the north bay system is largely contributed by the runoff, and the flow is lost to the middle bay and evaporation. The inflow to the middle bay is largely due to the runoff and inflow from the north bay system, and the flow is lost to the ocean, evaporation and the south bay system. The south bay system loses its inflow to evaporation. The entire bay system loses most of its inflow to evaporation. 117 a) Water Balance for North Bay System -80.0 -60.0 -40.0 -20.0 0.0 20.0 40.0 60.0 80.0 Precip Evap Runoff Inflow from other bays Outflow to other bays Net Flow Water Source Flow (m^3/s) b) Water Balance for Middle Bay System -80.0 -60.0 -40.0 -20.0 0.0 20.0 40.0 60.0 80.0 Precip Evap Runoff Inflow from other bays Outflow to other bays Net Flow Water Source Flow (m^3/s) 118 c) Water Balance for the South Bay System -80.0 -60.0 -40.0 -20.0 0.0 20.0 40.0 60.0 80.0 Precip Evap Runoff Inflow from other bays Outflow to other bays Net Flow Water Source Flow (m^3/s) d) Water Balance for Entire Bay System -150.0 -100.0 -50.0 0.0 50.0 100.0 150.0 Precip Evap Runoff Inflow from other bays Outflow to other bays Net Flow Water Source Flow (m^3/s) Figure 4.3: Water Balances for the a) North Bay Sytem, b) Middle Bay System, c) South Bay System, and d) the Entire Bay System. 4.2 Total Constituent Loads into Bay System The constituent loads are determined from the land surface, point sources, atmosphere, and the Nueces River Watershed. Some of the data is missing for 119 certain constituents at specific sources. For example, data are available for ammonium only in the atmosphere. There is ammonium in the point source and non-point source loads, however data are only available for total nitrogen for the point sources and total nitrogen and nitrate + nitrite for the non-point sources. Table 4.2 shows the constituent loads for each bay segment, the source in which the load originated, and where data is missing. Table 4.2: Constituent Loadings for Each Bay Segment, a) Atmospheric Loads, b) Point Source Loads, c) Land Surface (Non-point Loads), d) Nueces River Watershed Loads, e) Total Loads. a) b) 120 c) d) e) Atmospheric Loads The atmospheric loads show constituent load contributions from 121 ammonium, nitrate, and total nitrogen. Many of the other constituents are not found in rain water or are not measured at the sampling site at Beeville, TX. Point Source Loads Point source loads show constituent load contributions from total nitrogen, total phosphorus, oil and grease, copper, cadmium, chromium, lead, zinc, iron, arsenic and mercury. No data is found for ammonium and nitrate + nitrite, however these constituents are present in the point source. Because there is a total nitrogen estimate of the point source loads, these other constituents are present implicitly. Since the percentage of these two components of the total nitrogen is not known, the constituent loads for ammonium and nitrate + nitrite could not be calculated. Land Surface Loads Non-point source loads show constituent load contributions from nitrate + nitrite, total nitrogen, total phosphorus, oil and grease, copper, cadmium, chromium, lead, and zinc. The ammonium constituent is not accounted for, and the metals; iron, arsenic, and mercury; have no data. These constituents are not present in the EMC table used in the study. The atmospheric load over the land surface is 35% of the total land surface load (Section 3.4.4). However, the atmospheric load is only added directly to the bay system because the EMC values account for both land surface applications and atmospheric deposition over the land surface. Nueces River Watershed Loads The Nueces River has loads for total nitrogen, total phosphorus and iron. The constituents ammonium, nitrate + nitrite, oil and grease, copper, cadmium, 122 chromium, lead, zinc, arsenic, and mercury are not accounted for. These constituents are either non-detectable or are not measured. Relative Total Loads For the constituents analyzed, the largest load contribution to the entire bay system is the total nitrogen load with nitrate + nitrite being the second largest load. Total phosphorus, oil and grease and ammonium are large load contributors to the bay system. The ammonium and nitrate + nitrite load would be a large contributor if more were known about the constituents coming from point, non-point and the Nueces River sources. Very little of the total load is from the metal loads. Figure 4.4 shows the percentage of loads from the total load to the entire system from each of the constituents. The metals are lumped into one category so that the small load can be compared to the larger loads presented with the data. 123 Percent Load for Each Constituent Total Daily Load = 21,000 Kg/d 71% 15% 13% 1% Total Nitrogen Total Phos Oil & Grease Total Metals Figure 4.4: Percent Constiuent Loads of the Total Load for the Entire System. When each constituent load is broken down into its percent source contribution, it can be determined which source the majority of the load is coming from. Figure 4.5 shows the percentage of the constituent load that is contributed from a specific source to the entire bay system. The largest contributor to the total nitrogen load is from the land surface. The atmosphere and the point sources also largely contribute to the total nitrogen load. The total phosphorus load comes mostly from the land surface with large contribution from point sources and a smaller contribution from the Nueces River. The oil and grease load is due to point sources and non-point sources. The land surface and the point sources largely contribute to the copper, chromium and zinc loads in the bay system. 124 0% 20% 40% 60% 80% 100% Total Nitrogen Total Phosphorus Oil and Grease Copper Chromium Zinc Nueces Land Point Atmo Figure 4.5: Percent of Total Constituent Load which Comes from a Specific Source for Entire System: (Total Nitrogen, Total Phosphorus, Oil and Grease, Copper, Chromium, and Zinc. When each constituent load is broken down into its percent bay contribution, it can be determined where majority of the load is going. Figure 4.6 shows the percentage of the constituent load that is contributing to a specific bay region The majority of the total nitrogen and total phosphorus load is received in the middle and north portions of the bay. The oil and grease load ends up mostly in the middle section of the bay system. The middle and north sections of the bay system receive the majority of the copper load. The north portion of the bay system receives almost half of the chromium load with the middle and south 125 portions receiving the rest of the load. The zinc load is received in the north and middle section of the bay system with the south section of the bay system receiving a smaller portion of the load. Almost all of the constituent loads are received in the middle and north portions of the bay system due to the increased runoff in those areas and the majority of the point sources being located in those areas. 0% 20% 40% 60% 80% 100% Total Nitrogen Total Phosphorus Oil and Grease Copper Chromium Zinc South Middle North Figure 4.6: Percent of Total Constituent Load which Comes from a Specific Source for the North, Middle and South Bay Sections: (Total Nitrogen, Total Phosphorus, Oil and Grease, Copper, Chromium, and Zinc). 126 4.3 Constituent Concentrations in the Bay System After the water quality model is run on the constituents, the expected concentrations are compared to the observed concentrations. A statistical analysis is run on the observed concentrations to determine an area- and time-weighted mean as well as a standard deviation. A statistical t-test is calculated between the expected and the observed concentrations to determine if the model predicts the equilibrium concentration within a reasonable range. 4.3.1 Comparing the Expected Concentrations to the Observed Concentrations using the T-Test The t-test is used to compare the expected concentrations calculated using the water quality model to the observed concentrations. The t-test is a statistical analysis which compares the observed concentrations with the expected concentrations normalized with the standard deviation and the square root of the number of samples (Hirsch et al., 1993). A positive t-test result indicates the observed concentrations are greater than the expected concentrations while a negative t-test result indicates the observed concentrations are less than the expected concentrations. If the t-test result is larger than r2, the expected value is not statistically the same as the observed values. The Equation 4.1 is used to calculate the t-statistic. 127 Equation 4.1 t-test = n s x P where: x = mean of observed concentrations, mg/l = )*( 1 sn n ii i ? ? where: ni = number of samples si = observed concentration in segment P = expected concentration computed from model, mg/l = )*( 1 sA A ii i ? ? where: Ai = surface area si = observed concentration in segment s = standard deviation of observed concentrations, mg/l n = number of samples Table 4.3 shows the expected concentration, the observed concentration, the standard deviation, the number of samples, and the t?test result for each of the bay segments. For the most part, the t-test result is negative for the nutrient constituents, total nitrogen and total phosphorus. This suggests a higher expected concentration than the observed concentrations. Because decay is not accounted for in the water quality model, this result is reasonable. The t-test results for the metals are positive for most of the metal constituents. This suggests lower expected concentration than the observed concentrations. This is probably due to a missing load source in the calculations. 128 Since the bays do not flush frequently, there exist long periods of time during which the metals are washed into the bays and deposited in bay sediments, creating a reservoir of metals in the sediments. A portion of these sediment metals may then re-enter the water column due to resuspension and physical and chemical process. The net flux of metal concentrations out of the sediment is not accounted for in the water quality model due to lack of metal sediment flux data. There could also be a missing data source from the atmosphere, land surface and/or point sources. Oil and grease, for the most part, has a t-statistic within the r2 range, which indicates a reasonable estimation of the constituent concentrations in the bay system. Table 4.3: Expected and Observed Concentrations, Standard Deviation, Number of Samples, and the T-Test Result for Each Bay Segment: a) Total Nitrogen, b) Total Phosphorus, c) Oil and Grease, d) Copper, e) Chromium, and f) Zinc. a) b) Total Nitrogen Copper segment exp (mg/l) obs (mg/l) std dev # samples t-test segment exp (ug/l) obs (ug/l) std dev # samples t-test stc 0.9 0.1 0.4 176 -30.6 stc 2.4 6.8 2.1 2 2.9 cop 1.1 0.6 0.7 514 -15.5 cop 2.6 24.5 34.4 8 1.8 aran 0.2 0.1 0.3 262 -2.0 aran aram 0.4 0.1 0.1 191 -47.9 aram 1.1 2.9 2.3 57 5.8 aras 0.4 0.1 0.2 288 -24.8 aras 1.8 3.5 1.6 15 4.1 red 0.3 0.1 0.6 348 -6.5 red 2.3 13.2 31.2 10 1.1 ccbn 0.3 0.1 0.3 1335 -18.1 ccbn 3.0 9.8 37.8 133 2.1 nuee 0.3 0.2 0.6 707 -5.6 nuee 3.0 15.0 26.6 15 1.7 nuew 0.4 0.6 0.1 130 19.0 nuew nuem 0.4 0.1 0.3 631 -20.0 nuem inl 0.2 0.1 0.4 4 -0.5 inl ccbe 0.3 0.1 0.3 691 -17.4 ccbe 3.0 0.8 2.1 10 -3.2 inh 0.5 0.4 1.1 482 -0.1 inh 3.8 9.9 13.8 92 4.2 ccbm 0.3 0.1 0.1 711 -32.7 ccbm 3.0 4.5 4.7 5 0.7 oso 0.4 0.2 4.9 192 -0.6 oso 3.4 41.4 52.4 3 1.3 ccbs 0.3 0.2 0.5 287 -3.7 ccbs ulmn 0.2 0.3 0.1 417 15.7 ulmn 5.7 10.1 23.4 18 0.8 baf 0.3 0.1 0.2 802 -21.3 baf 7.7 26.9 31.8 8 1.7 ulmm 0.2 0.1 0.2 248 -5.8 ulmm 129 c) d) Total Phosphorus Chromium segment exp (mg/l) obs (mg/l) std dev # samples t-test segment exp (ug/l) obs (ug/l) std dev # samples t-test stc 0.3 0.1 0.1 177 -24.9 stc 3.9 10.0 0.0 2 cop 0.3 0.1 0.1 519 -56.5 cop 4.1 28.8 31.1 8 2.3 aran 0.1 0.1 0.1 216 -1.1 aran 2.5 21.8 2.3 13 29.8 aram 0.2 0.1 0.1 193 -22.4 aram 3.0 5.8 2.1 57 9.9 aras 0.1 0.1 0.0 293 -33.4 aras 3.8 7.6 2.9 14 4.8 red 0.1 0.1 0.1 346 -27.6 red 4.2 12.5 30.9 10 0.8 ccbn 0.1 0.1 0.1 941 -36.2 ccbn 4.6 15.3 21.0 132 5.9 nuee 0.2 0.1 0.1 298 -8.5 nuee 4.4 19.9 25.2 15 2.4 nuew 0.2 0.2 0.1 15 1.4 nuew nuem 0.2 0.2 0.3 297 -2.0 nuem inl 0.1 0.1 0.0 2 -0.2 inl ccbe 0.1 0.0 0.1 352 -27.9 ccbe inh 0.2 0.1 0.2 429 -6.7 inh 4.8 16.4 21.0 84 5.1 ccbm 0.1 0.1 0.1 589 -32.4 ccbm 4.6 24.0 21.4 5 2.0 oso 0.2 0.4 1.5 182 1.7 oso 4.9 42.1 52.0 3 1.2 ccbs 0.1 0.1 0.0 240 -19.8 ccbs ulmn 0.1 0.1 0.0 186 -20.4 ulmn 4.3 13.9 22.6 18 1.8 baf 0.1 0.1 0.7 306 0.3 baf 4.1 42.2 36.4 10 3.3 ulmm 0.1 0.1 0.0 127 -7.7 ulmm e) f) Oil and Grease Zinc segment exp (mg/l) obs (mg/l) std dev # samples t-test segment exp (ug/l) obs (ug/l) std dev # samples t-test stc stc 9.7 13.2 12.4 2 0.4 cop cop 12.9 34.4 288.1 8 0.2 aran 10.2 10.4 9.4 7 0.1 aran 5.9 5.7 51.9 13 0.0 aram 9.2 9.1 6.3 26 -0.1 aram 7.8 19.2 33.6 57 2.6 aras aras 10.8 34.6 28.1 15 3.3 red red 12.6 13.2 31.3 10 0.1 ccbn 2.7 2.0 1.2 34 -3.4 ccbn 14.1 80.7 222.5 134 3.5 nuee nuee 13.7 51.3 49.2 14 2.9 nuew nuew nuem nuem inl 2.7 6.3 7.8 2 0.6 inl 14.0 7.5 8.9 5 -1.6 ccbe ccbe 14.0 2.1 3.8 10 -9.9 inh 2.8 7.3 11.8 27 2.0 inh 22.9 47.8 50.4 89 4.7 ccbm ccbm 14.1 133.8 152.5 5 1.8 oso oso 15.3 44.9 50.4 3 1.0 ccbs ccbs ulmn ulmn 11.8 12.8 22.9 18 0.2 baf baf 10.3 51.3 34.0 10 3.8 ulmm ulmm 9.8 8.6 113.1 2 0.0 The average t-test results for each bay system is calculated based on a number of sample weighted average over each of the three bay sections. Equation 4.2 illustrates this calculation. Table 4.4 shows the average t-test result for each of the constituents. The nutrient t-test results are negative, again suggesting that decay should be used in the water quality model. The average t-test result for copper, chromium, and zinc, are positive which suggests a data source is missing in the load calculations. Oil and Grease has a low average t-test result which suggests the model predicts the equilibrium concentrations close to the observed concentrations. 130 Equation 4.2 Ave T-Test = )*( 1 tn n ii i ? ? where: ni = number of samples si = observed concentration in segment Table 4.4: Average T-Test Result for Each Constituent. Constituent Bay System Average t-test Total Nitrogen North -18.2 Middle -14.5 South -8.2 Total -14.2 Total Phosphorus North -33.1 Middle -21.9 South -7.5 Total -23.8 Oil and Grease North -0.1 Middle -1.0 South Total 0.0 Copper North 4.6 Middle 2.6 South 1.1 Total 3.0 Chromium North 10.0 Middle 5.2 South 2.3 Total 6.4 Zinc North 1.9 Middle 3.2 South 1.4 Total 2.7 4.3.2 Calculating the Decay Rates in the Three Bay Systems The previous calculations assumed that there is no constituent decay or deposition in the bays. The appropriate decay rates to bring the computed and observed concentrations into balance can be determined. To do this, the bay system is broken into three smaller systems being the north, middle and south sections. The decay rates calculated included all abiotic and biotic processes. 131 A simplified model is used to determine the load which is not transported out of the system. The same mass balance equation is used for the simplified model as is used for the model which broke the system into twenty segments, however the equation is solved for the decay rate rather than the equilibrium concentrations. The simplified system is used to calculate the decay rate needed to reach the observed concentrations given the constituent load to the system. The model assumes the only unknown into the system is the decay rate. The average observed concentrations are calculated using the time- and space-weighted average observed concentrations for each segment explained in Section 3.5.4. The concentrations are averaged over time and space for each of the 20 segments. The average observed concentrations for the three sections is a weighted averaged based on the number of samples taken for that segment. This is done using Equation 4.3. Equation 4.3 Cave = )*( 1 sn n ii i ? where: Cave = average observed concentration ni = number of samples si = observed concentration in segment Once the average concentrations for each bay segment are calculated, the decay rates are calculated using Equation 4.4. The methodology for the decay rate calculations is the same as the water quality mass balance (Figure 3.13). 132 Equation 4.4 K = ( QN,M*sN ? QM,S* sM ? QM,Oc*sM + EN,M(sN-sM) + EM,Oc(sM-sOc) + EM,S(sM-sS) + WM ) / ( VM*sM ) where: K = the decay rate QN,M*sN = Advective load from the north segment QM,S* sM = Advective load leaving the middle segment to the south segment QM,Oc* sM = Advective load leaving the middle segment to the ocean EN,M(sN-sM) = dispersive load between the north and middle segments EM,Oc(sM-sOc) = dispersive load between the middle segment and the ocean EM,S(sM-sS) = dispersive load between the middle and south segments WM = waste load entering the middle segment VM*sM = load volume in the segment For the north system, the advective load from the boundary is added to total waste load from the land surface, point sources, non-point sources, and atmospheric deposition. The advective load to middle segment is subtracted from the system, and the dispersive loads are added or subtracted depending on the concentration gradient. For the middle system, the advective load from the first segment is added to total load from the land surface, point sources, non-point sources, and atmospheric deposition. The advective load to south segment and the ocean are subtracted from the system, and the dispersive loads are added or subtracted depending on the concentration gradient. For the south system, the advective load from the middle section is added to total load from the land surface, point sources, non-point sources, and atmospheric deposition. The advective load leaving at the south boundary is subtracted from the 133 system, and the dispersive loads are added or subtracted depending on the concentration gradient. The interface flows, bulk dispersion coefficients, segment volumes, and boundary conditions are the same as the twenty segment model. Because the boundary dispersion coefficients are large, they govern the mass balance equation. Therefore, the boundary conditions are set equal to the concentration in the bay adjacent to the boundary interface making the dispersion flow at the boundaries negligible. Table 4.5 shows the decay rates calculated from the mass balance for the constituents total nitrogen and total phosphorus. Table 4.5: Decay Rates for Total Nitrogen and Total Phosphorus. Constituent Bay Decay Rate Ave Decay Section ( /d ) Rate ( /d ) Total Nitrogen North 0.030 Middle 0.011 South 0.024 0.022 Total Phosphorus North 0.013 Middle 0.004 South 0.009 0.009 The long residence time of the three bay segments makes the concentrations sensitive to the overall gain and loss within the system. The decay rate takes into account all the mechanisms of the gain and loss process either by biotic or abiotic processes. These processes include photosynthetic uptake, excretion, chemical transformations, hydrolysis of dissolved organic nutrients, detritus decomposition, sediment decomposition and release, and external loading (EPA, 1997). The small decay rate values suggest they are within the right order of magnitude and are comparable to the United States Environmental Protection Agency (EPA) suggested decay rates in the surface water quality modeling online report at the Internet site: http://www.epa.gov/ORD/WebPubs/surfaceH2O/surface.htm. 134 4.3.3 Edroy and King Ranch EMC Study Two runoff studies as part of the Corpus Christi National Estuary Program and supervised by the USGS are being done to determine representative EMC values for nutrients from agricultural landuse within the Corpus Christi National Estuary Programs study area. The studies are being completed on the King Ranch and on an agricultural area near the Town of Edroy. Because the studies are still in progress, the data is provisional. The following calculation made from these data is for comparison purposes with results of the original EMC data in Section 2.2.8. The provisional EMC values are 1.49 mg/l and 0.47 mg/l for total nitrogen and total phosphorus, respectively. The provisional values are calculated from 29 runoff samples for total nitrogen and 32 runoff samples for total phosphorus. The median values are reported by the USGS (Ockerman, 1998). For comparison, the original EMC values are 4.40 mg/l for total nitrogen and 1.30 mg/l for total phosphorus, as discussed in Section 2.2.8, Table 2.2. The EMC results from the studies at the King Ranch and Edroy agricultural fields are entered into the land surface runoff model by replacing the original agricultural land use EMC values, with the new provisional EMC values. The EMC values are changed for the Anderson Land Use Classification number 21 which represents agricultural crop and pasture land. Table 4.6 shows the land surface load for nitrogen and phosphorus to the bay system using the original and the provisional EMC data. The land surface loads are reduced by 54% for total nitrogen and 60% for total phosphorus using the provisional EMC data compared to the original EMC data. 135 Table 4.6: Total Nitrogen and Total Phosphorus from Land Surface Sources to Bay System Using Original and Provisional EMC Values. Total Nitrogen Total Phosphorus Original Provisional Original Provisional Segment (Kg/d) (Kg/d) (Kg/d) (Kg/d) North 5021.27 2268.98 1283.48 498.46 Middle 1184.66 530.17 338.45 151.78 South 1412.24 669.7 356.19 144.38 Total 7618.17 3468.85 1978.12 794.62 Table 4.7 shows the total loads to the bay system for nitrogen and phosphorus using the original and the provisional EMC data. Total loads to the bay system are found by adding together the land surface loads, atmospheric loads, point source loads, and Nueces River Watershed loads as discussed in Section 3.4. The total load is reduced by 27% and 38% for total nitrogen and total phosphorus, respectively. Table 4.7: Total Nitrogen and Total Phosphorus from all Sources to Bay System Using Original and Provisional EMC Values. Total Nitrogen Total Phosphorus Original Provisional Original Provisional Segment (Kg/d) (Kg/d) (Kg/d) (Kg/d) North 6576.35 3824.06 1409.7 624.68 Middle 4025.84 3371.35 1203.25 1016.58 South 4566.3 3823.76 496.37 284.56 Total 15168.49 11019.17 3109.32 1925.82 In section 3.4.4, the atmospheric contribution to the total nitrogen land surface load is found to be 2,733 Kg/d. This is 35% of the original nitrogen load from land surface sources and 79% of the provisional nitrogen load from land surface sources. It is important to note that the atmospheric station is near Beeville, TX. Since the station is located inland, the atmosphere it samples is influenced by many sources such as volatilization of land surface loads, industries, etc. The mean 136 annual concentration of total nitrogen present in the atmosphere is 1.10 mg/l (USGSNADP, 1997). The water quality model is run using the provisional loads to the bay system, assuming conservative transport (no decay). As with the original data, the expected concentrations are again higher than the observed constituent concentrations because no decay is considered in the calculation. Tables 4.8 and 4.9 compare the observed nutrient concentrations in the bay system to the original provisional concentrations. The concentrations in the north bay system drop considerably when the provisional data is used. However, the concentrations in the middle and south bay systems stay relatively the same. Table 4.8: Total Nitrogen Concentrations in the Bay System Using Original and Provisional EMC Data Compared to the Observed Data. Original Provisional Segment exp (mg/l) exp (mg/l) obs (mg/l) North 0.55 0.34 0.19 Middle 0.33 0.32 0.22 South 0.23 0.21 0.18 Table 4.9: Total Phosphorus Concentrations in the Bay System Using Original and Provisional EMC Data Compared to the Observed Data. Original Provisional Segment exp (mg/l) exp (mg/l) obs (mg/l) North 0.20 0.12 0.08 Middle 0.15 0.13 0.13 South 0.09 0.08 0.07 The system is again broken into the north, middle and south portions to calculate the decay rates needed to match the calculated and the observed concentrations in the bay system. Table 4.10 shows the decay rates calculated for the original loads and the provisional loads to the bay system. The decay rates 137 needed for new total nitrogen and total phosphorus data are the smaller than the decay rates calculated for the original data in the north bay system. However, the decay rates in the middle and south bay segments are relatively the same for both the original and provisional loads. In all cases, the decay rates are within reasonable limits. Table 4.10: Comparing Decay Rates for Total Nitrogen and Total Phosphorus Using Original and Provisional Data. Constituent Bay Decay Rate Decay Rate Segment Original (/d) Provisional (/d) Total Nitrogen North 0.030 0.017 Middle 0.011 0.009 South 0.024 0.021 Average 0.022 0.016 Total Phosphorus North 0.013 0.005 Middle 0.004 0.003 South 0.009 0.008 Average 0.009 0.005 The provisional data calculations show that a reduction in the EMC value produces a reduction in the land surface load to the bay system. However, the total load to the system does not show as large of a reduction in load. The concentrations in the north bay system are reduced while the middle and south bay system concentrations did not show as much of a reduction. This is expected since the runoff gradient increases as you move North through the study area bringing along with it a larger load to the bay system. Since, the two agricultural runoff studies are being conducted in the south and middle portions of the study area, and the majority of the runoff and load is in the north portion of the study area, a runoff study could be conducted in that region in order to obtain a true EMC value representative of agricultural land use in the study region. 138 5 CONCLUSIONS A Geographic Information System (GIS) model of total constituent loadings and their impacts on receiving water quality is presented for the Corpus Christi Bay system. The model uses publicly available elevation, stream network, precipitation, stream discharge, water quality, and land use data sets. The model development begins by laying a fine mesh of 100m cells over a watershed within which the nonpoint source constituent loads are estimated from each cell of the land surface. Point sources and atmospheric deposition on the bay system are separately accounted for, as is the load from the Nueces River inflow to the study region. The loads from the model are input to the receiving water to calculate the equilibrium concentrations in the bay system. The coefficients of dispersion for the Bay segments are calibrated using salinity as a conservative tracer. The resulting constituent concentrations are compared with the average of those observed in each bay segment. For summary purposes, the overall bay system is subdivided geographically into three large bay systems, north, middle and south. The middle bay system refers to the Corpus Christi and Nueces Bays and the smaller bays flowing into them. The other two categories refer to the bays north and south of the middle bay system; Aransas/Copano Bays, and Baffin Bay/Laguna Madre, respectively. The study methodology can be broken down into three components: first, the water balance of inflow, outflow, precipitation and evaporation; second, the total loadings of constituents from point, land surface, atmospheric and the Nueces River Basin; and third, the mass balance of each constituent in the bay system. The constituent mass balance analysis includes a comparison of the observed and calculated concentrations. Finally, the possible management uses of the model are assessed. 139 (1) Water Balance The mean annual precipitation ranges from approximately 600 mm/yr (24 in/yr) at the southern end of the study region to approximately 1000 mm/yr (40 in/yr) at the northern end. At the southern end less than 2% of the precipitation becomes runoff while at the northern end more than 10% becomes runoff. Therefore, the runoff gradient from South to North is much more pronounced than is the gradient of precipitation. The runoff averages less than 10 mm/yr (0.4 in/yr) in the south to more than 100 mm/yr (4 in/yr) in the north. The reason for the steep runoff gradient is that the larger precipitation in the north saturates the soil more frequently causing a greater percentage of the precipitation to become runoff than in the south. The runoff into the bay system from the land surface in the study region totals 36 m 3 /s. An additional 20 m 3 /s enters the bay system from the Nueces River outflow from Lake Corpus Christi. At the northern boundary of the bay system, an inflow of 16 m 3 /s is assumed to come from the very substantial runoff of the Guadalupe and San Antonio Rivers which flow into San Antonio Bay, this estimate being 20% of the mean annual gauged discharge of those two rivers. At the southern boundary of the bay system, it assumed that there is no inflow from the Lower Laguna Madre. The total inflow to the bay system is 72 m 3 /s of which 56% enters the north bays, 34% the middle bays and 10% the southern bays. The average direct precipitation onto the surface of the bays is approximately 800 mm/yr and the average evaporation is approximately double that figure, or 1600 mm/yr. The mean annual outflow from the bay system to the Gulf of Mexico is only 6 m 3 /s, so the remainder of the inflow is lost by evaporation. Since very little tidal flushing occurs and the bay system is not frequently flushed by inflow from the land surface, the bay system acts as a large sink that absorbs 140 most of the loads that come into it from the land surface, atmosphere, and point sources. The calculations in this study are all based on mean annual conditions. In years of high flow, there is a correspondingly greater outflow to the Gulf, while in years of low flow there is a net inflow of water from the Gulf to the bay system to sustain the net evaporation from the bay system. The disparity between inflow and outflow is particularly acute in the south bay system, in part because the precipitation is lowest there and in part because the surface area of the south bay system is larger than the combined surface areas of the north and central bay systems. There is also no point of exchange of water with the Gulf of Mexico in the south bay region. Hence, the south bay system flushes itself much less frequently and less completely than do the north or the central bay systems. (2) Total Loadings Total load calculations were made for thirteen constituents: ammonium, nitrite plus nitrate, total nitrogen, total phosphorus, oil and grease, and eight metals (copper, cadmium, chromium, lead, zinc, iron, arsenic, and mercury). There are significant gaps in the available data, notably for point source loadings of ammonium and nitrite plus nitrate, non-point source loadings of ammonium, atmospheric loadings of many constituents, and sediment loads of all constituents. Because of these data limitations, results are discussed for six constituents with the most reliable data: total nitrogen, total phosphorus, oil and grease, copper, chromium, and zinc. The nutrients nitrogen and phosphorus have a combined loading of approximately 18,100 kg/day, of which 15,000 kg/day is total nitrogen and 3,100 kg/day is total phosphorus. Oil and Grease have a total load of 2,800 kg/day. The 141 loadings for the metal constituents are much smaller, approximately 30 kg/day for copper, 26 kg/day for chromium and 108 kg/day for zinc. For total phosphorus and the metals, from one half to two thirds of the loads are derived from the land surface. Oil and grease source are derived mostly from point sources. Atmospheric sources contribute about one third of the load of total nitrogen, about one half of this load comes from non-point sources on the land surface and one sixth from point sources. The atmospheric load in wet deposition over the land surface is approximately 35% of the land surface load for total nitrogen. For the metals, about one third of the load comes from point sources and two thirds from non-point sources. No sediment loads from the bay floor are included in these estimates, and atmospheric loads are also not accounted for in the case of phosphorus and the metal constituents. (3) Water Quality The impacts of the loadings on the bay system are evaluated using a water quality model, which takes into account advection, dispersion, and first order decay, but not detailed biological or chemical processes. The dispersion coefficients for each of the 20 bay segments within the three main bay segments were calibrated using salinity as a conservative constituent and held constant for all the other constituents. A set of mass balance calculations are first made assuming all constituents are conservative. A t-test was used to compare the predicted and observed concentrations in the bay segments. The t-test results showed that the conservative constituent assumption results in accurate prediction of observed concentrations of oil and grease, over-prediction of total nitrogen and phosphorus, and under-prediction of metals. The long residence time of the three bay segments makes the concentrations 142 sensitive to the overall gain and loss within the system. A second set of mass balance calculations was carried out to determine constituent decay. The decay rates take into account all the mechanisms (abiotic and biotic) of the gain and loss process. To reach the average observed concentrations in the bays for total nitrogen requires a decay rate of approximately 0.02 d -1 . This means that 2% of the mass of nitrogen is removed from the bay waters each day by decay processes. A similar computation for total phosphorus yields a decay rate of approximately 0.01 d -1 . These decay rates are reasonable when compared to corresponding values reported in the literature. Using the conservative mass balance, the metals concentrations are under- predicted by a factor of three to four, which suggests that there are metals sources that are presently unaccounted for. Since the bays do not flush frequently, there exist long periods of time during which the metals are washed into the bays and deposited in bay sediments, creating a reservoir of metals in the sediments. A portion of these sediment metals may then re-enter the water column due to re- suspension and physical and chemical process. It is also possible that a reservoir of metals has been accumulated in the Bay sediments from industrial discharges of previous decades when wastewater discharge standards were not as stringent as they are now. The calculations suggest that this flux from the sediment reservoir may be the dominant control on the metals concentrations in the bay waters rather than current loadings from the land surface. It is also possible that the metal loadings from the other sources have been underestimated, either in the point sources, land surface or atmospheric loads. Clarifying this discrepancy in the mass balance for metals in the bay system requires further investigation. The nonpoint source loadings for total nitrogen and total phosphorus are largely driven by runoff from agricultural lands. Ongoing field studies at the King 143 Ranch and near Edroy, TX, suggest that the expected mean concentrations of nitrogen and phosphorus are less than half of those assumed originally in the mass balance study, whose expected mean concentration values were derived from data observed outside the Corpus Christi region. When other sources of nitrogen and phosphorus are also accounted for, the resulting reductions in total loads are about 27% from total nitrogen (from 15,000 Kg/d to 11,000 Kg/d) and about 28% for total phosphorus (from 3,1000 Kg/d to 1,900 Kg/d). This study did not incorporate the City of Corpus Christi?s water supply diversion from the Nueces River. It was assumed that all of the water leaving the Corpus Christi Dam enters the bay system. However, only fifteen percent of the discharge in the Nueces River is diverted to the City, with two thirds of that is discharged back to the bay system through the City?s wastewater discharge (Ward, 1997). Overall, the constituent load from the Nueces River Basin upstream of Lake Corpus Christi has very little impact on the bay system. (4) Model Uses and Developments The original intent of the study was to determine the total loads and water quality to the Corpus Christi Bay System. However, the way that the GIS model is prepared, the study could be used for management purposes. By determining the source of load, different best management practices (BMP) can be analyzed in order to reduce that constituent load. The models can then be run again to calculate the reduction in loads due to the BMPs. This has been done in a parallel study concerned with water quality master planning being carried out for the City of Austin. The Expected Mean Concentration (EMC) table, which links pollutant concentrations in runoff to land use, can be updated as new information is obtained. 144 For example, once the Edroy and King Ranch studies are complete and the data is analyzed, the EMC table used in the model can be updated by changing the EMC values associated with the rangeland and agricultural land uses. The models can be run again in order to assess the change in loads due to the change in EMC values for these two land uses. The land use data employed in this study do not distinguish between improved pasture and row-crop agriculture. Once new land use are obtained, the land use files can be updated. The new land use would then be linked to the EMC table and the models could be run again to determine the change in loads due to the new land use data. The model can be used to assess the loads in small scale studies in problem areas in the Corpus Christi Bay System. For example, the area draining into the Inner Harbor can be delineated and separated from the rest of the study area. The land surface and water quality models can be run on that area to determine the source of the loads ending up in the Inner Harbor. Different BMPs could be analyzed to determine the best solution to control the loads entering the receiving water in the Inner Harbor. Since the study used mean annual values for flow, precipitation, and evaporation, the model results are a representation of total loads and the resulting water quality that occur during a year of normal weather. The model could be run using flow, precipitation, and evaporation representing flood and drought years in order to assess the water quality of the bay system during high and low flows. Also, the model could be run using the seasonal variations in flow, precipitation and evaporation by finding the average values for each of the seasons. The water quality for the seasonal variations could then be assessed. Once new data is obtained, the model can be updated. For example, there are separate studies being done in the CCBNEP for atmospheric deposition. Once 145 these studies are complete and the data is analyzed, the new loadings can be entered into the water quality model and the new equilibrium constituent concentrations can be calculated. This same calculation can be done once new load information is obtained for sediment fluxes, point sources, and land surface EMC data. 146 APPENDIX A: Data Dictionary 147 Data File Description Class Attributes accprecip2 Accumulation of the precipitation grid. Grid Accumulated Units are cubic meters/year. Precipitation AGREE Avenue script that reconditions the digital elevation surface to coincide with the DLG files. aransas Sub-watershed delineated using the Grid/Poly script WTRSHD. For the Aransas River gauge. BALANCE Avenue scripts for calculating the equilibrium constituent concentrations in the bay system. bay Bay coverage which is the final 20 Poly Area segments. Contains information for each Volume of the segments. etc. bayevap Zonal mean of evaporation over the bay Poly Evaportation system which are integer values. bayprecip Zonal mean of precipitation over the bay Poly Precipitation system which are integer values. big Copy of the grid of the study are obtained Grid from the delineated watersheds. big1 Grid of the study are obtained from the Grid delineated watersheds where all cells equal one and the Lake Corpus Christi Watershed is equal to no data. biglandg Original land use file converted to a grid Grid Land Use from the lucorptsms file. bigmap Appended DLG files. Original files were Arc Land Use obtained from the USGS CD-ROM. baygrid Grid of the bay segments Grid CALCAREA Avenue script used to calculated the surface area of the bay segments. CALCEP Avenue scripts used to calculate the bulk dispersion coeffiecents from the dispersion coeffiecents. CALCLENGTH Avenue script used to calculated the interface length between each of the bay segments. ccbnep.apr ArcView project file containing all the scripts needed to complete the CCBNEP total loadings and water quality project. cchuc HUC files for the study area. Poly HUC number Albers projection with NAD27 datum. and name 148 Data File Description Class Attributes cchuc2tsms HUC files for the study area. Poly HUC number Albers projection with NAD28 datum. and name chiltipin Sub-watershed delineated using the Grid/Poly script WTRSHD. For the Chiltipin Creek gauge. cogrid Land surface constituent concentration grid. Grid Constituent Constituent abbreviation is tacked onto the Concentration end of the cogrid label. Ten constituents were analyzed over the land surface. Units are mg/l. CONCGRID Avenue script which calculated the land surface concentrations from the EMC values. CONNECT Avenue script which connects the DEM to the bay coverage. copano Sub-watershed delineated using the Grid/Poly script WTRSHD. For the Copano Creek gauge. corpgages Point file with all the gauging stations in the Point Latitude study region projected from a georaphic Longitude projection to the Texas State Mapping System. corptsms Projected digital elevation grid. Clipped Grid Elevation using the buffered HUC files. Elevation values in each grid cell are in units of meters above sea level. corpus2 Merged DEM files originating from nine Grid Elevation smaller DEM files obtained from the USGS Internet site. Map sheet = Beeville-e, Beeville-w,Crystal_City-e, Corpus_Christi-e, Corpus_Christi-w, Laredo-e, Laredo-w, Port_Isabel-w, and McAllen-e. Elevation values in each grid cell are in units of meters above sea level. count A coverage of the counties in the Poly County name study area. Lambert Projection countt A coverage of the counties in the Poly County name study area. Texas State Mapping System. counties A coverage of the counties in Texas. Poly County name dem Projected digital elevation grid renamed. Grid Elevation Elevation values in each grid cell are in units of meters above sea level. 149 Data File Description Class Attributes demtsms.prj Projection file writtem in the Arc Macro Language to project from a geographic projection to the Texas State Mapping System. dlgtsms The projected and appended DLG file. Arc Projected from the UTM projection to the Texas State Mapping System. dlg2 The renamed projected DLG file. Arc evap Grid coverage of the evaporation taken from Grid Evaporation the quadsp file of evaporation. evapzone Zonal mean of evaporation over the bay Grid Evaporation system. Units are mm/yr. evapzone2 Zonal mean of evaporation over the bay Grid Evaporation system which are integer values. facac2 Integer number of cells that fall upstream Grid Flow of each cell. A flow accumulation after Accumulation the Avenue scripts AGREE and CONNECT are run on the original DEM. fdac2 A flow direction after the Avenue scripts Grid Flow scripts AGREE and CONNECT are run. Direction geotsms.prj Projection file writtem in the Arc Macro Language to project from a geographic projection to the Texas State Mapping System. gridagree2 Digital elevation grid which was Grid Elevation calculated using the script AGREE. Units are meters above sea level. 150 Data File Description Class Attributes gridconnect2 Digital elevation grid which was Grid Elevation calculated after using the script CONNECT. Elevation values in each grid cell are in units of meters above sea level. gridfilla2 Digital elevation grid which was filled Grid Elevation after the AGREE script was run. Elevation values in each grid cell are in units of meters above sea level. huc250 HUC files for the United States Poly HUC number and name lamtsms.prj Projection file writtem in the Arc Macro Language to project from a lambert projection to the Texas State Mapping System. landara Land use coverage for the sub-watershed Poly Land Use Aransas. landchil Land use coverage for the sub-watershed Poly Land Use Chiltipin. landcop Land use coverage for the sub-watershed Poly Land Use Copano. land.dbf Database file which contains the EMC values for ten constituents. landlos Land use coverage for the sub-watershed Poly Land Use Los Omos. landmed Land use coverage for the sub-watershed Poly Land Use Medio. landmis Land use coverage for the sub-watershed Poly Land Use Mission. landoso Land use coverage for the sub-watershed Poly Land Use Oso. landsdie Land use coverage for the sub-watershed Poly Land Use San Diego. landsfer Land use coverage for the sub-watershed Poly Land Use San Fernando. landuse Original land use cover created by Poly Land Use clipping the lucortsms coverage with the outline coverage. landuse2 Updated land use file converted to a polygon Poly Land Use coverage from the landuseg2 file. landuseg Original land use file converted to a grid. Grid Land Use from the landuse file. 151 Data File Description Class Attributes landuseg2 Merged land use file clipped using the big1 Grid Land Use file which outlines the study area. lkcc Grid of the Lake Corpus Christi watershed. Grid lkg Nueces River load grid clipped to study area. Grid lkgrid Nueces River Watershed source Grid constituent loadings grid. Three constituent loads were analyzed. Constituent abbreviations are tacked onto the end of the lkgrid label. Units are Kg/d. lkgridwf Weighted flow accumulation for the Nueces Grid River Watershed load grids. Constituent abbreviationsare tacked on the end of lkwfgrid. lkgridwf.aml AML used to calculate the weighted flow accumulations for the Nueces River loads. LOADGRID Avenue script which calculated the land surface laods from the concentration grids. log Land surface load grid clipped to study area. Grid Load logrid Land surface constituent loadings grid. Grid Load Constituent abbreviation is tacked onto the end of the logrid label. Ten constituents were analyzed over the land surface. Units are Kg/d. logridwf Weighted flow accumulation for the land Grid Load surface load grids. Constituent abbreviations Accumulation are tacked on the end of lowfgrid. lonlat.dat File containing the longitude and latitude of all the gauging stations in the study area in decimal degree format. losomos Sub-watershed delineated using the Grid/Poly script WTRSHD. For the Los Omos Creek gauge. 152 Data File Description Class Attributes lucorp Merged land use cover downloaded from Poly Land Use the TNRIS Internet site. Map Sheets = Beeville, McAllen, Corpus Christi, Chrystal City, and Laredo. lucorpd Dissolved land use cover downloaded Poly Land Use from the TNRIS Internet site. lucorptsms The projected land use cover downloaded Poly Land Use from the TNRIS Internet site. Texas State Mapping System. map Outline grid of the study area obtained Grid from the merged delineated watersheds. medio Sub-watershed delineated using the Grid/Poly script WTRSHD. For the Medio gauge. mission Sub-watershed delineated using the Grid/Poly script WTRSHD. For the Mission River gauge. newland Updated land use map projected from a Grid Land Use UTM projetion to the Texas State Mapping System. newland2 New land use file where no data cells are Grid Land Use equal to biglandg else they are equal to newland. newlandbg Original land use file created by merging Grid Land Use the biglandg and landuseg files. newlandbg2 Merged land use file created from the Grid Land Use newlandbg and newland2 files. nland1-6 Updated land use files which were created Grid Land Use by merging the smaller land use files. nland Final updated and merged land use file. Grid Land Use oso Sub-watershed delineated using the Grid/Poly script WTRSHD. For the Oso Creek gauge. outline A buffered outline coverage of the Poly study area renamed. outlineg Outline grid of the study area. Grid 153 Data File Description Class Attributes p_ann Precipitation grid obtained from the CRWR Grid Precipitation database. Covers all of the United States and is a mean annual precipitation in mm/yr. PICKLOAD Avenue script which extracts the loading to the centroid of the bay system. pog Point source load grid clipped to study area. Grid Load pogrid Point source constituent loadings grid. Grid Load Constituent abbreviation is tacked onto the end of the pogrid label. Units are Kg/d. pogridwf Weighted flow accumulation for the point Grid Load source grids. Constituent abbreviations Accumulation are tacked on the end of powfgrid. pogridwf.aml AML used to calculate the weighted flow accumulations for the point source loads. POINTLD Avenue script which calculates the point loads by placing the load in the centroid of the stream polygon or the beginning of the stream segment. precip Clipped precipitation grid using the buffered Grid Precipitation HUC files. precip2 Clipped and projected precipitation grid. Grid Precipitation projected from Geographic projection to the Texas State Mapping System. precip3 A portion of the clipped and projected Grid Precipitation precipitation grid along the coast line. precipgrid Precipitation grid created using the trend Grid Precipitation function and the precipitation point file along the coast line. precipmerge Preciptation grid created by merging the Grid Precipitation original preciptation grid and the trend grid. precippnt Point file of the precipitation grid along the Grid Precipitation coast line. precipzone Zonal mean of precipitation over the bay Grid Precipitation system. Units are mm/yr. precipzone2 Zonal mean of precipitation over the bay Grid Precipitation system which are integer values. quadsp Large file of evaporation for the state of Texas. Poly Anntot rf1 The clipped and projected river reach files. Arc 154 Data File Description Class Attributes riv20000 Flow accumulation with cells greater Grid Flow than 20,000 accumulation. Accumulation rogrid Large runoff grid caclulated by merging Grid Runoff the small Anderson Land Use classification grids. Units are mm/yr. rogrida Runoff grid with Anderson Land Use Grid Runoff Classification >=20 and <=29. rogridr1 Runoff grid with Anderson Land Use Grid Runoff Classification >=30 and <=49. rogridr2 Runoff grid with Anderson Land Use Grid Runoff Classification >=70 and <=79. rogridr3 Runoff grid with Anderson Land Use Grid Runoff Classification <=10. rogridu Runoff grid with Anderson Land Use Grid Runoff Classification >=11 and <=19. rogridw Runoff grid with Anderson Land Use Grid Runoff Classification >=50 and <=59. rogridwe Runoff grid with Anderson Land Use Grid Runoff Classification >=60 and <=69. runcoeff Runoff coefficient grid calculated by Grid Runoff dividing the runoff grid by the precipitation Coefficient grid. runcoeff2 Runoff coefficient grid with all cells being Grid Runoff less than 0.24. Coefficient runland2 Runoff grid calculated by multiplying the runoff Grid Runoff coefficient grid with values less than 0.24 and the precipitation grid. Units are mm/yr. sandiego Sub-watershed delineated using the Grid/Poly script WTRSHD. For the San Diego gauge. sanfern Sub-watershed delineated using the Grid/Poly script WTRSHD. For the San Fernando Creek gauge. segments TNRCC stream segment coverage. Arc/Poly station Point coverage file of the gauging stations in Point the study area. statname.dat Data file which contains gauging station name and number. 155 Data File Description Class Attributes strmlnk Stream Link grid calculated from the script Grid Stream STRMLNK and used to delineate the sub- Links watersheds in the study area. STRMLNK Avenue script which calculates the stream link grid used to delineate sub-watersheds. TIMEAVE Avenue scripts for calculating the average observed concentrations over time and space. tsmsbuff A buffered outline coverage of the Poly study area created from the HUC files. WTRSHD Avenue script which delineates watersheds. 156 APPENDIX B: Avenue Scripts and AML Programs SCRIPT/AML DESCRIPTION Agree Reconditions the DEM to coincide with the DLG Balance Steady State Water Quality Model Calcarea Calculates the area of the bay segment Calcep Calculates the bulk dispersion coefficient from the calibrated dispersion coefficient Concgrid Calculates the concentration grid from the EMC field in the landuse attribute table Connect Connects the land surface with the bay segments by dropping the centroid of the bay segment below the surrounding cells Loadgrid Calculates the load grid by multiplying the concentration grid by the runoff grid Lkgridwf.aml AML which calculates the weighted flow accumulation for the Nueces River loading grids Logridwf.aml AML which calculates the weighted flow accumulation for the land surface loading grids Pickload Picks the loads from the centroid of the bay segment after the flow accumulation is run Pogridwf.aml AML which calculates the weighted flow accumulation for the point source loading grids Pointld Calculates the point sources grids based on the TNRCC segmentation Rogridland Calculates runoff over the land surface based on landuse and precipitation Strmlnk Calculates the stream link grid needed to delineate watersheds Timeave Calculates the average observed concentration of a constituent for each bay segment based on time and space Wfacgrid Calculates the weighted flow accumulation Wtrshd Delineates watersheds from a specified point 157 AGREE ' '---------------------------- '--- Creation information --- '---------------------------- ' 'Name: agree.ave 'Version: 1.0.av 'Date: 03/01/97 'Author: Ferdi Hellweger ' Center for Research in Water Resources ' The University of Texas at Austin ' ferdi@crwr.utexas.edu ' '--------------------------- '--- Purpose/Description --- '--------------------------- ' 'AGREE is a surface reconditioning system for Digital Elevation 'Models (DEMs). The system adjusts the surface elevation of the 'DEM to be consistent with a vector coverage. The vecor coverage 'can be a stream or ridge line coverage. ' '---------------- '--- Get view --- '---------------- ' theview = av.getactivedoc ' '------------------ '--- Get themes --- '------------------ ' theactivethemes = theview.getactivethemes if (theactivethemes.count = 0) then msgbox.error("No active themes found", "AGREE") exit end if (theactivethemes.count = 1) then msgbox.error("Only one active theme found", "AGREE") 158 exit end if (theactivethemes.count > 2) then msgbox.error("Too many active themes found", "AGREE") exit end if (theactivethemes.count = 2) then oegfound = false lfound = false for each activetheme in theactivethemes if (activetheme.getclass.getclassname = "gtheme") then oegtheme = activetheme oegfound = true end if (activetheme.getclass.getclassname = "ftheme") then theftab = activetheme.getftab theshapef = theftab.findfield("shape") theshape = theftab.returnvalue(theshapef,0) if (theshape.getclass.getclassname = "polyline") then theltheme = activetheme lfound = true end end end end if (not oegfound) then msgbox.error("One theme needs to be a grid theme", "AGREE") exit end if (not lfound) then msgbox.error("One theme needs to be a line theme", "AGREE") exit end ' '----------------- '--- Get input --- '----------------- ' labels = list.make labels = labels.add("Buffer distance") 159 labels = labels.add("Smooth drop/raise distance (+ = up)") labels = labels.add("Sharp drop/raise distance (+ = up)") labels = labels.add("Keep temporary data sets?") ' defaults = list.make defaults = defaults.add("0") defaults = defaults.add("0") defaults = defaults.add("0") defaults = defaults.add("no") ' inputs = msgbox.multiinput("Enter run control parameters", "AGREE", labels, defaults) if (inputs.count = 0) then exit end ' buffer = inputs.get(0).asnumber smoothdist = inputs.get(1).asnumber sharpdist = inputs.get(2).asnumber if (inputs.get(3).ucase.left(1) = "Y") then keeptemp = true else keeptemp = false end ' '--------------------- '--- Set up themes --- '--------------------- ' 'grid theme ' oegrid = oegtheme.getgrid ' 'check below causes error crash for some reason ' 'if (thegrid = nil) then ' msgbox.error("Can't open grid theme","AGREE") ' exit 'end oegextend = oegrid.getextent 160 oegcellsize = oegrid.getcellsize ' 'line theme ' lftab = theltheme.getftab if (lftab = nil) then msgbox.error("Can't open line theme","AGREE") exit end ' '----------------- '--- Calculate --- '----------------- ' '--- Initial set up --- ' 'setwindow ' grid.setanalysisextent(#GRID_ENVTYPE_VALUE, oegextend) ' 'setcell ' grid.setanalysiscellsize(#GRID_ENVTYPE_VALUE, oegcellsize) ' '--- AGREE method --- ' 'vectgrid ' vectgrid = grid.makefromftab(lftab, prj.makenull, nil, nil) if (keeptemp) then vectgridfilename = av.getproject.makefilename("vectgrid", "") vectgrid.savedataset(vectgridfilename) vectgridgtheme = gtheme.make(vectgrid) theview.addtheme(vectgridgtheme) vectgridgtheme.setvisible(true) end ' 'smogrid ' smogrid = (vectgrid.isnull).setnull(oegrid + smoothdist.asgrid).int 161 if (keeptemp) then smogridfilename = av.getproject.makefilename("smogrid", "") smogrid.savedataset("smogrid".asfilename) smogridgtheme = gtheme.make(smogrid) theview.addtheme(smogridgtheme) smogridgtheme.setvisible(true) end ' 'vectdist and vectallo ' vectallofilename = av.getproject.makefilename("vectallo", "") vectdist = smogrid.eucdistance(nil, vectallofilename, nil) vectallosrcname = grid.makesrcname(vectallofilename.asstring) vectallo = grid.make(vectallosrcname) if (keeptemp) then vectdistfilename = av.getproject.makefilename("vectdist", "") vectdist.savedataset(vectdistfilename) vectdistgtheme = gtheme.make(vectdist) theview.addtheme(vectdistgtheme) vectdistgtheme.setvisible(true) vectallo.savedataset("vectallo".asfilename) vectallogtheme = gtheme.make(vectallo) theview.addtheme(vectallogtheme) vectallogtheme.setvisible(true) end ' 'bufgrid1 and bufgrid2 ' bufgrid1 = (vectdist > (buffer - (oegcellsize / 2)).asgrid).con(1.asgrid, 0.asgrid) bufgrid2 = (not bufgrid1).setnull(oegrid).int if (keeptemp) then bufgrid1filename = av.getproject.makefilename("bufgrid1", "") bufgrid1.savedataset(bufgrid1filename) bufgrid1gtheme = gtheme.make(bufgrid1) theview.addtheme(bufgrid1gtheme) bufgrid1gtheme.setvisible(true) bufgrid2filename = av.getproject.makefilename("bufgrid2", "") bufgrid2.savedataset("bufgrid2".asfilename) bufgrid2gtheme = gtheme.make(bufgrid2) theview.addtheme(bufgrid2gtheme) 162 bufgrid2gtheme.setvisible(true) end ' 'bufdist and bufallo ' bufallofilename = av.getproject.makefilename("bufallo", "") bufdist = bufgrid2.eucdistance(nil, bufallofilename, nil) bufallosrcname = grid.makesrcname(bufallofilename.asstring) bufallo = grid.make(bufallosrcname) if (keeptemp) then bufdistfilename = av.getproject.makefilename("bufdist", "") bufdist.savedataset(bufdistfilename) bufdistgtheme = gtheme.make(bufdist) theview.addtheme(bufdistgtheme) bufdistgtheme.setvisible(true) bufallo.savedataset("bufallo".asfilename) bufallogtheme = gtheme.make(bufallo) theview.addtheme(bufallogtheme) bufallogtheme.setvisible(true) end ' 'smoelev ' smoelev = vectallo + (((bufallo - vectallo) / (bufdist + vectdist)) * vectdist) if (keeptemp) then smoelevfilename = av.getproject.makefilename("smoelev", "") smoelev.savedataset("smoelev".asfilename) smoelevgtheme = gtheme.make(smoelev) theview.addtheme(smoelevgtheme) smoelevgtheme.setvisible(true) end ' 'shagrid ' shagrid = (vectgrid.isnull).setnull(oegrid + sharpdist.asgrid).int if (keeptemp) then shagridfilename = av.getproject.makefilename("shagrid", "") shagrid.savedataset("shagrid".asfilename) shagridgtheme = gtheme.make(shagrid) theview.addtheme(shagridgtheme) 163 shagridgtheme.setvisible(true) end ' 'elevgrid ' elevgrid = (vectgrid.isnull).con(smoelev, shagrid) elevgridfilename = av.getproject.makefilename("elevgrid", "") elevgrid.savedataset("gridagree".asfilename) elevgridgtheme = gtheme.make(elevgrid) theview.addtheme(elevgridgtheme) elevgridgtheme.setvisible(true) ' ' 'final message to user ' message = "Grid agreed" msgbox.info(message,"AGREE") ' '----------- '--- End --- '----------- ' 164 BALANCE ' '---------------------------- '--- Creation information --- '---------------------------- ' 'Name: balance.ave 'Version: 1.0 'Date: 01/11/97 'Author: Ferdi Hellweger ' Center for Research in Water Resources ' The University of Texas at Austin ' ferdi@crwr.utexas.edu ' '--------------------------- '--- Purpose/Description --- '--------------------------- ' 'This program computes the constituent mass balance. ' '--------------------------------------------- '--- Check if units configuration happened --- '--------------------------------------------- ' if (not _configu) then configure = msgbox.yesno("Units are not configured. Configure it now?","BALANCE",true) if (configure) then av.run("balconu", nil) else exit end end ' '---------------- '--- Get view --- '---------------- ' theview = av.getactivedoc ' 165 '------------------ '--- Get themes --- '------------------ ' theactivethemes = theview.getactivethemes if (theactivethemes.count = 0) then msgbox.error("No active themes found", "BALANCE") exit end if (theactivethemes.count = 1) then msgbox.error("Only one active theme found", "BALANCE") exit end if (theactivethemes.count > 2) then msgbox.error("Too many active themes found", "BALANCE") exit end if (theactivethemes.count = 2) then lfound = false pfound = false for each activetheme in theactivethemes theftab = activetheme.getftab theshapef = theftab.findfield("shape") theshape = theftab.returnvalue(theshapef,0) if (theshape.getclass.getclassname = "polyline") then theltheme = activetheme lfound = true end if (theshape.getclass.getclassname = "polygon") then theptheme = activetheme pfound = true end end end if (not lfound) then msgbox.error("One theme needs to be a line theme", "BALANCE") exit end if (not pfound) then msgbox.error("One theme needs to be a polygon theme", "BALANCE") 166 exit end ' '--------------------- '--- Set up themes --- '--------------------- ' 'line theme ' lftab = theltheme.getftab if (lftab = nil) then msgbox.error("Can't open line theme","BALANCE") exit end ' lshapef = lftab.findfield("shape") if (lshapef = nil) then msgbox.error("Can't find 'shape' field in line theme","BALANCE") exit end ' lpf = lftab.findfield("lpoly#") if (lpf = nil) then lpf = lftab.findfield("lpoly_") end if (lpf = nil) then msgbox.error("Can't find 'lpoly#' field in line theme","BALANCE") exit end ' rpf = lftab.findfield("rpoly#") if (rpf = nil) then rpf = lftab.findfield("rpoly_") end if (rpf = nil) then msgbox.error("Can't find 'rpoly#' field in line theme","BALANCE") exit end ' qf = lftab.findfield("q") 167 if (qf = nil) then addfield = msgbox.yesno("Can't find 'q' field in line theme. Add it?","BALANCE", true) if (addfield) then lftab.seteditable(true) qf = field.make("q", #FIELD_DECIMAL, 16, 4) lftab.addfields({qf}) lftab.seteditable(false) else exit end end ' epf = lftab.findfield("ep") if (epf = nil) then addfield = msgbox.yesno("Can't find 'ep' field in line theme. Add it?","BALANCE", true) if (addfield) then lftab.seteditable(true) epf = field.make("ep", #FIELD_DECIMAL, 16, 4) lftab.addfields({epf}) lftab.seteditable(false) else exit end end ' sbf = lftab.findfield("sb") if (sbf = nil) then addfield = msgbox.yesno("Can't find 'sb' field in line theme. Add it?","BALANCE", true) if (addfield) then lftab.seteditable(true) sbf = field.make("sb", #FIELD_DECIMAL, 16, 4) lftab.addfields({sbf}) lftab.seteditable(false) else exit end end 168 ' fadf = lftab.findfield("fad") if (fadf = nil) then addfield = msgbox.yesno("Can't find 'fad' field in line theme. Add it?","BALANCE", true) if (addfield) then lftab.seteditable(true) fadf = field.make("fad", #FIELD_DECIMAL, 16, 4) lftab.addfields({fadf}) lftab.seteditable(false) else exit end end ' fdif = lftab.findfield("fdi") if (fdif = nil) then addfield = msgbox.yesno("Can't find 'fdi' field in line theme. Add it?","BALANCE", true) if (addfield) then lftab.seteditable(true) fdif = field.make("fdi", #FIELD_DECIMAL, 16, 4) lftab.addfields({fdif}) lftab.seteditable(false) else exit end end ' 'polygon theme ' pftab = theptheme.getftab if (pftab = nil) then msgbox.error("Can't open polygon theme","BALANCE") exit end ' pshapef = pftab.findfield("shape") if (pshapef = nil) then msgbox.error("Can't find 'shape' field in polygon theme","BALANCE") 169 exit end ' if (theptheme.getsrcname.asstring.right(4) = ".shp") then pname = theptheme.getsrcname.asstring.astokens(".").get(0)+"#" polyf = pftab.findfield(pname) end polyf = nil if (polyf = nil) then pname = theptheme.getsrcname.asstring.astokens(".").get(0)+"_" polyf = pftab.findfield(pname) end if (polyf = nil) then pname = theptheme.getsrcname.asstring+"#" polyf = pftab.findfield(pname) end if (polyf = nil) then pname = theptheme.getsrcname.asstring+"_" polyf = pftab.findfield(pname) end if (polyf = nil) then msgbox.error("Can't find polygon number field in polygon theme","BALANCE") exit end ' sof = pftab.findfield("so") if (sof = nil) then addfield = msgbox.yesno("Can't find 'so' field in polygon theme. Add it?","BALANCE", true) if (addfield) then pftab.seteditable(true) sof = field.make("so", #FIELD_DECIMAL, 16, 4) pftab.addfields({sof}) pftab.seteditable(false) else exit end end ' wnpf = pftab.findfield("wnp") 170 if (wnpf = nil) then addfield = msgbox.yesno("Can't find 'wnp' field in polygon theme. Add it?","BALANCE", true) if (addfield) then pftab.seteditable(true) wnpf = field.make("wnp", #FIELD_DECIMAL, 16, 4) pftab.addfields({wnpf}) pftab.seteditable(false) else exit end end ' watf = pftab.findfield("wat") if (watf = nil) then addfield = msgbox.yesno("Can't find 'wat' field in polygon theme. Add it?","BALANCE", true) if (addfield) then pftab.seteditable(true) watf = field.make("wat", #FIELD_DECIMAL, 16, 4) pftab.addfields({watf}) pftab.seteditable(false) else exit end end ' wotf = pftab.findfield("wot") if (wotf = nil) then addfield = msgbox.yesno("Can't find 'wot' field in polygon theme. Add it?","BALANCE", true) if (addfield) then pftab.seteditable(true) wotf = field.make("wot", #FIELD_DECIMAL, 16, 4) pftab.addfields({wotf}) pftab.seteditable(false) else exit end end 171 ' wsef = pftab.findfield("wse") if (wsef = nil) then addfield = msgbox.yesno("Can't find 'wse' field in polygon theme. Add it?","BALANCE", true) if (addfield) then pftab.seteditable(true) wsef = field.make("wse", #FIELD_DECIMAL, 16, 4) pftab.addfields({wsef}) pftab.seteditable(false) else exit end end ' kf = pftab.findfield("k") if (kf = nil) then addfield = msgbox.yesno("Can't find 'k' field in polygon theme. Add it?","BALANCE", true) if (addfield) then pftab.seteditable(true) kf = field.make("k", #FIELD_DECIMAL, 16, 4) pftab.addfields({kf}) pftab.seteditable(false) else exit end end ' vf = pftab.findfield("v") if (vf = nil) then addfield = msgbox.yesno("Can't find 'v' field in polygon theme. Add it?","BALANCE", true) if (addfield) then pftab.seteditable(true) vf = field.make("v", #FIELD_DECIMAL, 16, 4) pftab.addfields({vf}) pftab.seteditable(false) else exit 172 end end ' sf = pftab.findfield("s") if (sf = nil) then addfield = msgbox.yesno("Can't find 's' field in polygon theme. Add it?","BALANCE", true) if (addfield) then pftab.seteditable(true) sf = field.make("s", #FIELD_DECIMAL, 16, 4) pftab.addfields({sf}) pftab.seteditable(false) else exit end end ' wadf = pftab.findfield("wad") if (wadf = nil) then addfield = msgbox.yesno("Can't find 'wad' field in polygon theme. Add it?","BALANCE", true) if (addfield) then pftab.seteditable(true) wadf = field.make("wad", #FIELD_DECIMAL, 16, 4) pftab.addfields({wadf}) pftab.seteditable(false) else exit end end ' wdif = pftab.findfield("wdi") if (wdif = nil) then addfield = msgbox.yesno("Can't find 'wdi' field in polygon theme. Add it?","BALANCE", true) if (addfield) then pftab.seteditable(true) wdif = field.make("wdi", #FIELD_DECIMAL, 16, 4) pftab.addfields({wdif}) pftab.seteditable(false) 173 else exit end end ' wdf = pftab.findfield("wd") if (wdf = nil) then addfield = msgbox.yesno("Can't find 'wd' field in polygon theme. Add it?","BALANCE", true) if (addfield) then pftab.seteditable(true) wdf = field.make("wd", #FIELD_DECIMAL, 16, 4) pftab.addfields({wdf}) pftab.seteditable(false) else exit end end ' '---------------------------------- '--- Set up plot parameter list --- '---------------------------------- ' plotlist = list.make plotlist = plotlist.add(theview) plotlist = plotlist.add(theltheme) plotlist = plotlist.add(theptheme) plotlist = plotlist.add(lftab) plotlist = plotlist.add(pftab) plotlist = plotlist.add(lshapef) plotlist = plotlist.add(qf) plotlist = plotlist.add(fadf) plotlist = plotlist.add(fdif) plotlist = plotlist.add(pshapef) plotlist = plotlist.add(wnpf) plotlist = plotlist.add(watf) plotlist = plotlist.add(wotf) plotlist = plotlist.add(wsef) plotlist = plotlist.add(wadf) plotlist = plotlist.add(wdif) 174 plotlist = plotlist.add(wdf) ' '---------------------------------- '--- Get run control parameters --- '---------------------------------- ' labels = list.make labels = labels.add("Delta t " + _tlab) labels = labels.add("Converge delta s " + _slab) labels = labels.add("Diverge delta s " + _slab) labels = labels.add("Max t " + _tlab) labels = labels.add("User Observation Level (0-4)") ' defaults = list.make defaults = defaults.add((_deltat * _tout).asstring) defaults = defaults.add(_convs.asstring) defaults = defaults.add(_divs.asstring) defaults = defaults.add((_maxt * _tout).asstring) defaults = defaults.add(_oblevel.asstring) ' inputs = msgbox.multiinput("Enter run control parameters", "BALANCE", labels, defaults) if (inputs.count = 0) then exit end ' _deltat = inputs.get(0).asnumber * _tin _convs = inputs.get(1).asnumber _divs = inputs.get(2).asnumber _maxt = inputs.get(3).asnumber * _tin _oblevel = inputs.get(4).asnumber ' '----------------- '--- Calculate --- '----------------- ' '--- Initial set up --- ' 'make attribute tables editable ' 175 lftab.seteditable(true) pftab.seteditable(true) ' 'set initial variables ' time = 0 maxdeltas = 0 converged = false diverged = false ' 'set starting concentrations to initial concentrations 'rezero advective and diffusive loads 'make index for polygon attribute table ' polydict = dictionary.make(pftab.getnumrecords * 2) for each prec in pftab so = pftab.returnvalue(sof, prec) pftab.setvalue(sf, prec, so) ' pftab.setvalue(wadf, prec, 0) pftab.setvalue(wdif, prec, 0) ' poly = pftab.returnvalue(polyf, prec) polydict.add(poly, prec.asstring.asnumber) end ' 'dictionaries for speed processing ' if (_oblevel <= 1) then ' pftabdict = dictionary.make(pftab.getnumrecords * 15) for each prec in pftab ' poly = pftab.returnvalue(polyf, prec).clone ' pdrec = list.make pdrec = pdrec.add(pftab.returnvalue(sof, prec).clone) pdrec = pdrec.add(pftab.returnvalue(wnpf, prec).clone) pdrec = pdrec.add(pftab.returnvalue(watf, prec).clone) pdrec = pdrec.add(pftab.returnvalue(wotf, prec).clone) 176 pdrec = pdrec.add(pftab.returnvalue(wsef, prec).clone) pdrec = pdrec.add(pftab.returnvalue(kf, prec).clone) pdrec = pdrec.add(pftab.returnvalue(vf, prec).clone) pdrec = pdrec.add(pftab.returnvalue(sf, prec).clone) pdrec = pdrec.add(pftab.returnvalue(wadf, prec).clone) pdrec = pdrec.add(pftab.returnvalue(wdif, prec).clone) pdrec = pdrec.add(pftab.returnvalue(wdf, prec).clone) pdrec = pdrec.add(prec.clone) ' pftabdict.add(poly, pdrec.clone) end ' lftablist = list.make for each lrec in lftab ' llrec = list.make llrec = llrec.add(lftab.returnvalue(lpf, lrec).clone) llrec = llrec.add(lftab.returnvalue(rpf, lrec).clone) llrec = llrec.add(lftab.returnvalue(qf, lrec).clone) llrec = llrec.add(lftab.returnvalue(epf, lrec).clone) llrec = llrec.add(lftab.returnvalue(sbf, lrec).clone) llrec = llrec.add(lftab.returnvalue(fadf, lrec).clone) llrec = llrec.add(lftab.returnvalue(fdif, lrec).clone) llrec = llrec.add(lrec.clone) ' lftablist.add(llrec.clone) end ' end ' 'user observation ' if (_oblevel >= 1) then av.setstatus(0) av.showstopbutton end if (_oblevel >= 2) then thedisplay = theview.getdisplay end ' 177 '--- Time step loop --- ' 'regular processing ' if (_oblevel > 1) then while ((not converged) and (not diverged) and (time < _maxt)) ' 'increment time ' time = time + _deltat ' 'user observation ' message = "BALANCE Time: " + (time * _tout).asstring + " " + _tlab +" Max Delta S: " + maxdeltas.asstring + " " + _slab av.showmsg(message) running = av.setstatus(((time / _maxt) * 100)) if (not running) then message = "Time: "+(time * _tout).asstring + " " + _tlab message = message + nl + "Maximum delta s: " + maxdeltas.asstring + " " + _slab message = message + nl + "BALANCE stopped by user." msgbox.info(message,"BALANCE") av.showmsg("") av.setstatus(100) lftab.seteditable(false) pftab.seteditable(false) exit end ' '--- Exchanges --- ' 'rezero ' for each prec in pftab pftab.setvalue(wadf, prec, 0) pftab.setvalue(wdif, prec, 0) end ' for each lrec in lftab 178 ' 'get line attributes ' lp = lftab.returnvalue(lpf, lrec) rp = lftab.returnvalue(rpf, lrec) q = lftab.returnvalue(qf, lrec) ep = lftab.returnvalue(epf, lrec) sb = lftab.returnvalue(sbf, lrec) * _sin ' 'find adjacent concentrations ' sl = 0 sr = 0 if (lp > 1) then sl = pftab.returnvalue(sf, polydict.get(lp)) end if (rp > 1) then sr = pftab.returnvalue(sf, polydict.get(rp)) end ' 'calculate advection ' lftab.setvalue(fadf, lrec, 0) if ((q > 0) and (lp > 1) and (rp > 1)) then lftab.setvalue(fadf, lrec, ((sl * q) * _wout)) wadold = pftab.returnvalue(wadf, polydict.get(lp)) * _win wad = wadold - (sl * q) pftab.setvalue(wadf, polydict.get(lp), wad * _wout) wadold = pftab.returnvalue(wadf, polydict.get(rp)) * _win wad = wadold + (sl * q) pftab.setvalue(wadf, polydict.get(rp), wad * _wout) end if ((q < 0) and (lp > 1) and (rp > 1)) then lftab.setvalue(fadf, lrec, ((sr * q) * _wout)) wadold = pftab.returnvalue(wadf, polydict.get(rp)) * _win wad = wadold + (sr * q) pftab.setvalue(wadf, polydict.get(rp), wad * _wout) wadold = pftab.returnvalue(wadf, polydict.get(lp)) * _win wad = wadold - (sr * q) pftab.setvalue(wadf, polydict.get(lp), wad * _wout) 179 end if ((q > 0) and (lp = 1)) then lftab.setvalue(fadf, lrec, ((sb * q) * _wout)) wadold = pftab.returnvalue(wadf, polydict.get(rp)) * _win wad = wadold + (sb * q) pftab.setvalue(wadf, polydict.get(rp), wad * _wout) end if ((q > 0) and (rp = 1)) then lftab.setvalue(fadf, lrec, ((sl * q) * _wout)) wadold = pftab.returnvalue(wadf, polydict.get(lp)) * _win wad = wadold - (sl * q) pftab.setvalue(wadf, polydict.get(lp), wad * _wout) end if ((q < 0) and (lp = 1)) then lftab.setvalue(fadf, lrec, ((sr * q) * _wout)) wadold = pftab.returnvalue(wadf, polydict.get(rp)) * _win wad = wadold + (sr * q) pftab.setvalue(wadf, polydict.get(rp), wad * _wout) end if ((q < 0) and (rp = 1)) then lftab.setvalue(fadf, lrec, ((sb * q) * _wout)) wadold = pftab.returnvalue(wadf, polydict.get(lp)) * _win wad = wadold - (sb * q) pftab.setvalue(wadf, polydict.get(lp), wad * _wout) end ' 'calculate diffusion ' lftab.setvalue(fdif, lrec, 0) if ((lp > 1) and (rp > 1)) then lftab.setvalue(fdif, lrec, (ep * (sl - sr) * _wout)) wdiold = pftab.returnvalue(wdif, polydict.get(lp)) * _win wdi = wdiold - (ep * (sl - sr)) pftab.setvalue(wdif, polydict.get(lp), wdi * _wout) wdiold = pftab.returnvalue(wdif, polydict.get(rp)) * _win wdi = wdiold + (ep * (sl - sr)) pftab.setvalue(wdif, polydict.get(rp), wdi * _wout) end if ((rp = 1) and (ep > 0)) then lftab.setvalue(fdif, lrec, (ep * (sl - sb) * _wout)) 180 wdiold = pftab.returnvalue(wdif, polydict.get(lp)) * _win wdi = wdiold - (ep * (sl - sb)) pftab.setvalue(wdif, polydict.get(lp), wdi * _wout) end if ((lp = 1) and (ep > 0)) then lftab.setvalue(fdif, lrec, (ep * (sb - sr) * _wout)) wdiold = pftab.returnvalue(wdif, polydict.get(rp)) * _win wdi = wdiold + (ep * (sb - sr)) pftab.setvalue(wdif, polydict.get(rp), wdi * _wout) end end ' '--- Polygons --- ' maxdeltas = 0 ' for each prec in pftab ' wnp = pftab.returnvalue(wnpf, prec) * _win so = pftab.returnvalue(sof, prec) * _sin wat = pftab.returnvalue(watf, prec) * _win wot = pftab.returnvalue(wotf, prec) * _win wse = pftab.returnvalue(wsef, prec) * _win k = pftab.returnvalue(kf, prec) * _kin v = pftab.returnvalue(vf, prec) sold = pftab.returnvalue(sf, prec) * _sin wad = pftab.returnvalue(wadf, prec) * _win wdi = pftab.returnvalue(wdif, prec) * _win ' wt = wnp + wat + wot + wse - (k * v * sold) + wad + wdi snew = sold + (wt * (_deltat / v)) pftab.setvalue(sf, prec, snew * _sout) ' pftab.setvalue(wdf, prec, (k * v * sold) * _wout) ' thisdeltas = (snew - sold).abs if (thisdeltas > maxdeltas) then maxdeltas = thisdeltas end end 181 ' if ((maxdeltas > 0) and (maxdeltas <= _convs)) then converged = true end if (maxdeltas >= _divs) then diverged = true end if (_oblevel >=3) then av.run("balplot",plotlist) end if (_oblevel >= 2) then theltheme.updatelegend theptheme.updatelegend theview.draw(thedisplay) end if (_oblevel >= 4) then message = "Time: "+(time * _tout).asstring+" "+_tlab+nl+"Maximum delta s: "+maxdeltas.asstring+ " "+_slab+nl+"User Observation Level:" default = _oblevel.asstring newoblevel = msgbox.input(message, "BALANCE", default) if (newoblevel = nil) then av.showmsg("") av.setstatus(100) lftab.seteditable(false) pftab.seteditable(false) exit end _oblevel = newoblevel.asnumber end end end ' 'speed processing ' if (_oblevel <= 1) then while ((not converged) and (not diverged) and (time < _maxt)) ' 'increment time ' time = time + _deltat 182 ' 'user observation ' message = "BALANCE Time: " + (time * _tout).asstring + " " + _tlab +" Max Delta S: " + maxdeltas.asstring + " " + _slab av.showmsg(message) running = av.setstatus(((time / _maxt) * 100)) if (not running) then message = "Time: "+(time * _tout).asstring + " " + _tlab message = message + nl + "Maximum delta s: " + maxdeltas.asstring + " " + _slab message = message + nl + "BALANCE stopped by user." msgbox.info(message,"BALANCE") av.showmsg("") av.setstatus(100) for each llrec in lftablist lftab.setvalue(fadf, llrec.get(7), llrec.get(5)) lftab.setvalue(fdif, llrec.get(7), llrec.get(6)) end for each pdrec in pftabdict pftab.setvalue(sf, pdrec.get(11), pdrec.get(7)) pftab.setvalue(wadf, pdrec.get(11), pdrec.get(8)) pftab.setvalue(wdif, pdrec.get(11), pdrec.get(9)) pftab.setvalue(wdf, pdrec.get(11), pdrec.get(10)) end lftab.seteditable(false) pftab.seteditable(false) exit end ' '--- Exchanges --- ' 'rezero ' for each pdrec in pftabdict pdrec.set(8, 0) pdrec.set(9, 0) end ' for each llrec in lftablist 183 ' 'get line attributes ' lp = llrec.get(0) rp = llrec.get(1) q = llrec.get(2) ep = llrec.get(3) sb = llrec.get(4) * _sin ' 'find adjacent concentrations ' sl = 0 sr = 0 if (lp > 1) then sl = pftabdict.get(lp).get(7) end if (rp > 1) then sr = pftabdict.get(rp).get(7) end ' 'calculate advection ' llrec.set(5, 0) if ((q > 0) and (lp > 1) and (rp > 1)) then llrec.set(5,((sl * q) * _wout).clone) wadold = pftabdict.get(lp).get(8) * _win wad = wadold - (sl * q) pftabdict.get(lp).set(8, (wad * _wout).clone) wadold = pftabdict.get(rp).get(8) * _win wad = wadold + (sl * q) pftabdict.get(rp).set(8, (wad * _wout).clone) end if ((q < 0) and (lp > 1) and (rp > 1)) then llrec.set(5, ((sr * q) * _wout).clone) wadold = pftabdict.get(rp).get(8) * _win wad = wadold + (sr * q) pftabdict.get(rp).set(8, (wad * _wout).clone) wadold = pftabdict.get(lp).get(8) * _win wad = wadold - (sr * q) pftabdict.get(lp).set(8, (wad * _wout).clone) 184 end if ((q > 0) and (lp = 1)) then llrec.set(5, ((sb * q) * _wout).clone) wadold = pftabdict.get(rp).get(8) * _win wad = wadold + (sb * q) pftabdict.get(rp).set(8, (wad * _wout).clone) end if ((q > 0) and (rp = 1)) then llrec.set(5, ((sl * q) * _wout).clone) wadold = pftabdict.get(lp).get(8) * _win wad = wadold - (sl * q) pftabdict.get(lp).set(8, (wad * _wout).clone) end if ((q < 0) and (lp = 1)) then llrec.set(5, ((sr * q) * _wout).clone) wadold = pftabdict.get(rp).get(8) * _win wad = wadold + (sr * q) pftabdict.get(rp).set(8, (wad * _wout).clone) end if ((q < 0) and (rp = 1)) then llrec.set(5, ((sb * q) * _wout).clone) wadold = pftabdict.get(lp).get(8) * _win wad = wadold - (sb * q) pftabdict.get(lp).set(8, (wad * _wout).clone) end ' 'calculate diffusion ' llrec.set(6, 0) if ((lp > 1) and (rp > 1)) then llrec.set(6, (ep * (sl - sr) * _wout).clone) wdiold = pftabdict.get(lp).get(9) * _win wdi = wdiold - (ep * (sl - sr)) pftabdict.get(lp).set(9, (wdi * _wout).clone) wdiold = pftabdict.get(rp).get(9) * _win wdi = wdiold + (ep * (sl - sr)) pftabdict.get(rp).set(9, (wdi * _wout).clone) end if ((rp = 1) and (ep > 0)) then llrec.set(6, (ep * (sl - sb) * _wout).clone) 185 wdiold = pftabdict.get(lp).get(9) * _win wdi = wdiold - (ep * (sl - sb)) pftabdict.get(lp).set(9, (wdi * _wout).clone) end if ((lp = 1) and (ep > 0)) then llrec.set(6, (ep * (sb - sr) * _wout).clone) wdiold = pftabdict.get(rp).get(9) * _win wdi = wdiold + (ep * (sb - sr)) pftabdict.get(rp).set(9, (wdi * _wout).clone) end end ' '--- Polygons --- ' maxdeltas = 0 ' for each pdrec in pftabdict ' wnp = pdrec.get(1) * _win so = pdrec.get(0) * _sin wat = pdrec.get(2) * _win wot = pdrec.get(3) * _win wse = pdrec.get(4) * _win k = pdrec.get(5) * _kin v = pdrec.get(6) sold = pdrec.get(7) * _sin wad = pdrec.get(8) * _win wdi = pdrec.get(9) * _win ' wt = wnp + wat + wot + wse - (k * v * sold) + wad + wdi snew = sold + (wt * (_deltat / v)) pdrec.set(7, (snew * _sout).clone) ' pdrec.set(10, ((k * v * sold) * _wout).clone) ' thisdeltas = (snew - sold).abs if (thisdeltas > maxdeltas) then maxdeltas = thisdeltas end end 186 ' if ((maxdeltas > 0) and (maxdeltas <= _convs)) then converged = true end if (maxdeltas >= _divs) then diverged = true end end end ' 'write data to attribute tables for speed processing ' if (_oblevel <= 1) then for each llrec in lftablist lftab.setvalue(fadf, llrec.get(7), llrec.get(5)) lftab.setvalue(fdif, llrec.get(7), llrec.get(6)) end for each pdrec in pftabdict pftab.setvalue(sf, pdrec.get(11), pdrec.get(7)) pftab.setvalue(wadf, pdrec.get(11), pdrec.get(8)) pftab.setvalue(wdif, pdrec.get(11), pdrec.get(9)) pftab.setvalue(wdf, pdrec.get(11), pdrec.get(10)) end end ' 'make attribute tables non editable ' lftab.seteditable(false) pftab.seteditable(false) ' 'final message to user ' if (converged) then message = "Time: " + (time * _tout).asstring + " " + _tlab message = message + nl + "Maximum delta s: " + maxdeltas.asstring + " " _slab messsage = message + nl + "BALANCE converged." msgbox.info(message,"BALANCE") end if (diverged) then message = "Time: " + (time * _tout).asstring + " " + _tlab 187 message = message + nl + "Maximum delta s: " + maxdeltas.asstring + " " _slab message = message + nl + "BALANCE diverged." msgbox.info(message,"BALANCE") end if ((not converged) and (not diverged)) then message = "Time: " + (time * _tout).asstring + " " + _tlab message = message + nl + "Maximum delta s: " + maxdeltas.asstring + " " + _slab message = message + nl + "BALANCE time limit reached." msgbox.info(message,"BALANCE") end if (_oblevel >= 1) then av.showmsg("") av.setstatus(100) end ' '------------- '--- End ---- '------------- 188 CALCAREA ' '---------------------------- '--- Creation information --- '---------------------------- ' 'Name: calcarea.ave 'Version: 1.0 'Date: 02/16/97 'Author: Ferdi Hellweger ' Center for Research in Water Resources ' The University of Texas at Austin ' ferdi@crwr.utexas.edu ' '--------------------------- '--- Purpose/Description --- '--------------------------- ' 'This program computes the area. ' '--------------------------------------------- '--- Check if units configuration happened --- '--------------------------------------------- ' if (not _configu) then configure = msgbox.yesno("Units are not configured. Configure it now?","BALANCE",true) if (configure) then av.run("balconu", nil) else exit end end ' '---------------- '--- Get view --- '---------------- ' theview = av.getactivedoc ' 189 '----------------- '--- Get theme --- '----------------- ' theactivethemes = theview.getactivethemes if (theactivethemes.count = 0) then msgbox.error("No active themes found", "BALANCE") exit end if (theactivethemes.count > 1) then msgbox.error("Too many active themes found", "BALANCE") exit end theptheme = theactivethemes.get(0) pftab = theptheme.getftab pshapef = pftab.findfield("shape") pshape = pftab.returnvalue(pshapef,0) if (not (pshape.getclass.getclassname = "polygon")) then msgbox.error("The theme needs to be a polygon theme", "BALANCE") exit end ' '-------------------- '--- Set up theme --- '-------------------- ' af = pftab.findfield("a") if (af = nil) then addfield = msgbox.yesno("Can't find 'a' field in polygon theme. Add it?","BALANCE", true) if (addfield) then pftab.seteditable(true) af = field.make("a", #FIELD_DECIMAL, 16, 4) pftab.addfields({af}) pftab.seteditable(false) else exit end end ' 190 ' '----------------- '--- Calculate --- '----------------- ' '--- Initial set up --- ' 'make polygon attribute table editable ' pftab.seteditable(true) ' '--- Loop --- ' for each prec in pftab ' 'calculate area ' pshape = pftab.returnvalue(pshapef, prec) lshape = pshape.aspolyline mpoint = lshape.asmultipoint plist = mpoint.aslist n = plist.count i = 1 a = 0 for each prec in plist yterm = plist.get(i - 1).gety if (i < n ) then xterma = plist.get(i).getx end if (i = n ) then xterma = plist.get(0).getx end if (i > 1) then xtermb = plist.get(i - 2).getx end if (i = 1) then xtermb = plist.get(n - 1).getx end a = a + (yterm * (xterma - xtermb)) i = i + 1 191 end a = 0.5 * a.abs ' 'write a to polygon attribute table ' pftab.setvalue(af, prec, a) ' end ' 'make polygon attribute table non editable ' pftab.seteditable(false) ' 'final message to user ' message = "Area, a calculated" msgbox.info(message,"BALANCE") ' '----------- '--- End --- '----------- ' 192 CALCEP ' '---------------------------- '--- Creation information --- '---------------------------- ' 'Name: calcep.ave 'Version: 1.1 'Date: 02/16/97 'Author: Ferdi Hellweger ' Center for Research in Water Resources ' The University of Texas at Austin ' ferdi@crwr.utexas.edu ' '--------------------------- '--- Purpose/Description --- '--------------------------- ' 'This program computes the bulk dispersion coefficient. ' '--------------------------------------------- '--- Check if units configuration happened --- '--------------------------------------------- ' if (not _configu) then configure = msgbox.yesno("Units are not configured. Configure it now?","BALANCE",true) if (configure) then av.run("balconu", nil) else exit end end ' '---------------- '--- Get view --- '---------------- ' theview = av.getactivedoc ' 193 '------------------ '--- Get themes --- '------------------ ' theactivethemes = theview.getactivethemes if (theactivethemes.count = 0) then msgbox.error("No active themes found", "BALANCE") exit end if (theactivethemes.count = 1) then msgbox.error("Only one active theme found", "BALANCE") exit end if (theactivethemes.count > 2) then msgbox.error("Too many active themes found", "BALANCE") exit end if (theactivethemes.count = 2) then lfound = false pfound = false for each activetheme in theactivethemes theftab = activetheme.getftab theshapef = theftab.findfield("shape") theshape = theftab.returnvalue(theshapef,0) if (theshape.getclass.getclassname = "polyline") then theltheme = activetheme lfound = true end if (theshape.getclass.getclassname = "polygon") then theptheme = activetheme pfound = true end end end if (not lfound) then msgbox.error("One theme needs to be a line theme", "BALANCE") exit end if (not pfound) then msgbox.error("One theme needs to be a polygon theme", "BALANCE") 194 exit end ' '------------------------------ '--- Get calculation option --- '------------------------------ ' choices = list.make choices = choices.add("Area Field, a") choices = choices.add("Depth Field, h and length") ' mychoice = msgbox.listasstring(choices, "Take area from", "BALANCE") if (mychoice = nil) then exit end ' '--------------------- '--- Set up themes --- '--------------------- ' 'line theme ' lftab = theltheme.getftab if (lftab = nil) then msgbox.error("Can't open line theme","BALANCE") exit end ' lshapef = lftab.findfield("shape") if (lshapef = nil) then msgbox.error("Can't find 'shape' field in line theme","BALANCE") exit end ' lpf = lftab.findfield("lpoly#") if (lpf = nil) then lpf = lftab.findfield("lpoly_") end if (lpf = nil) then msgbox.error("Can't find 'lpoly#' field in line theme","BALANCE") 195 exit end ' rpf = lftab.findfield("rpoly#") if (rpf = nil) then rpf = lftab.findfield("rpoly_") end if (rpf = nil) then msgbox.error("Can't find 'rpoly#' field in line theme","BALANCE") exit end ' ef = lftab.findfield("e") if (ef = nil) then addfield = msgbox.yesno("Can't find 'e' field in line theme. Add it?","BALANCE", true) if (addfield) then lftab.seteditable(true) ef = field.make("e", #FIELD_DECIMAL, 16, 4) lftab.addfields({ef}) lftab.seteditable(false) else exit end end ' epf = lftab.findfield("ep") if (epf = nil) then addfield = msgbox.yesno("Can't find 'ep' field in line theme. Add it?","BALANCE", true) if (addfield) then lftab.seteditable(true) ef = field.make("ep", #FIELD_DECIMAL, 16, 4) lftab.addfields({epf}) lftab.seteditable(false) else exit end end ' 196 if (mychoice = "Area Field, a") then af = lftab.findfield("a") if (af = nil) then addfield = msgbox.yesno("Can't find 'a' field in line theme. Add it?","BALANCE", true) if (addfield) then lftab.seteditable(true) epf = field.make("a", #FIELD_DECIMAL, 16, 4) lftab.addfields({af}) lftab.seteditable(false) else exit end end end if (mychoice = "Depth Field, h and length") then hf = lftab.findfield("h") if (hf = nil) then addfield = msgbox.yesno("Can't find 'h' field in line theme. Add it?","BALANCE", true) if (addfield) then lftab.seteditable(true) hf = field.make("h", #FIELD_DECIMAL, 16, 4) lftab.addfields({hf}) lftab.seteditable(false) else exit end end end ' 'polygon theme ' pftab = theptheme.getftab if (pftab = nil) then msgbox.error("Can't open polygon theme","BALANCE") exit end ' pshapef = pftab.findfield("shape") 197 if (pshapef = nil) then msgbox.error("Can't find 'shape' field in polygon theme","BALANCE") exit end ' polyf = nil if (theptheme.getsrcname.asstring.right(4) = ".shp") then pname = theptheme.getsrcname.asstring.astokens(".").get(0)+"#" polyf = pftab.findfield(pname) end if (polyf = nil) then pname = theptheme.getsrcname.asstring.astokens(".").get(0)+"_" polyf = pftab.findfield(pname) end if (polyf = nil) then pname = theptheme.getsrcname.asstring+"#" polyf = pftab.findfield(pname) end if (polyf = nil) then pname = theptheme.getsrcname.asstring+"_" polyf = pftab.findfield(pname) end if (polyf = nil) then msgbox.error("Can't find polygon number field in polygon theme","BALANCE") exit end ' '----------------- '--- Calculate --- '----------------- ' '--- Initial set up --- ' 'make line attribute table editable ' lftab.seteditable(true) ' 'make index for polygon attribute table ' polydict = dictionary.make(pftab.getnumrecords * 2) 198 for each prec in pftab poly = pftab.returnvalue(polyf, prec) polydict.add(poly, prec.asstring.asnumber) end ' '--- Loop --- ' for each lrec in lftab ' 'get line attributes ' lp = lftab.returnvalue(lpf, lrec) rp = lftab.returnvalue(rpf, lrec) lshape = lftab.returnvalue(lshapef, lrec) e = lftab.returnvalue(ef, lrec) if (mychoice = "Area Field, a") then a = lftab.returnvalue(af, lrec) end if (mychoice = "Depth Field, h and length") then h = lftab.returnvalue(hf, lrec) pointlist = lshape.aslist length = 0 for each twopoints in pointlist frompoint = twopoints.get(0) topoint = twopoints.get(1) thislength = frompoint.distance(topoint) length = length + thislength end a = length * h end ' 'calculate mixing length ' if ((lp > 1) and (rp > 1)) then lpshape = pftab.returnvalue(pshapef, polydict.get(lp)) lpcentroid = lpshape.returncenter rpshape = pftab.returnvalue(pshapef, polydict.get(rp)) rpcentroid = rpshape.returncenter dx = lpcentroid.distance(rpcentroid) end 199 if ((rp = 1) or (lp = 1)) then pointlist = lshape.asmultipoint.aslist fulllength = 0 i = 1 while (i < pointlist.count) fx = pointlist.get(i - 1).getx fy = pointlist.get(i - 1).gety tx = pointlist.get(i).getx ty = pointlist.get(i).gety length = (((fx - tx)^2) + ((fy - ty)^2)^0.5) fulllength = fulllength + length i = i + 1 end partlength = 0 i = 1 centerfound = false while (i < pointlist.count) fx = pointlist.get(i - 1).getx fy = pointlist.get(i - 1).gety tx = pointlist.get(i).getx ty = pointlist.get(i).gety length = (((fx - tx)^2) + ((fy - ty)^2)^0.5) partlength = partlength + length if ((partlength >= (fulllength * 0.5)) and (not centerfound)) then fraction = ((fulllength * 0.5) - partlength + length) / length cx = fx + ((tx - fx) * fraction) cy = fy + ((ty - fy) * fraction) centerpoint = point.make(cx,cy) centerfound = true end i = i + 1 end end if (rp = 1) then if (polydict.get(lp) = nil) then msgbox.info(lp.asstring, "DEBUG") exit end lpshape = pftab.returnvalue(pshapef, polydict.get(lp)) 200 lpcentroid = lpshape.returncenter dx = lpcentroid.distance(centerpoint) * 2 end if (lp = 1) then rpshape = pftab.returnvalue(pshapef, polydict.get(rp)) rpcentroid = rpshape.returncenter dx = rpcentroid.distance(centerpoint) * 2 end ' 'calculate ep ' ep = (e * a) / dx ' 'write ep to line attribute table ' lftab.setvalue(epf, lrec, ep) ' end ' 'make line attribute table non editable ' lftab.seteditable(false) ' 'final message to user ' message = "Bulk Dispersion Coefficients, ep calculated" msgbox.info(message,"BALANCE") ' '----------- '--- End --- '----------- ' 201 CONCGRID ' '---------------------------- '--- Creation information --- '---------------------------- ' 'Name: concgrid.ave 'Version: 1.0 'Date: 02/17/97 'Author: Ferdi Hellweger ' Center for Research in Water Resources ' The University of Texas at Austin ' ferdi@crwr.utexas.edu ' 'Modified: 02/28/97 ' Ann Quenzer ' Center for Research in Water Resources ' The University of Texas at Austin ' quenzer@mail.utexas.edu ' 1) changed the message box description to reflect the 'script ' 2) added purpose and description ' 3) changed pathname for the data file to be saved ' 4) took out error message of only one theme found ' '--------------------------- '--- Purpose/Description --- '--------------------------- ' 'A concentration grid is computed for the land surface using the 'landuse cover which is linked to the EMC values. The resulting 'grid is called concgrid and is in mg/l. ' '---------------- '--- Get view --- '---------------- ' theview = av.getactivedoc ' ' 202 '----------------- '--- Get theme --- '----------------- ' thethemes = theview.getthemes if (thethemes.count = 0) then msgbox.error("No themes found", "CONC GRID") exit end thefthemes = list.make for each thetheme in thethemes if (thetheme.getclass.getclassname = "ftheme") then thefthemes.add(thetheme) end end if (thefthemes.count = 0) then msgbox.error("No feature themes found", "CONC GRID") exit end theptheme = msgbox.listasstring(thefthemes, "Landuse theme", "CONC GRID") if (theptheme = nil) then exit end thepftab = theptheme.getftab thepshapef = thepftab.findfield("shape") thepshape = thepftab.returnvalue(thepshapef, 0) if (not (thepshape.getclass.getclassname = "polygon")) then msgbox.error("Theme needs to be a polygon theme", "CONC GRID") exit end ' '----------------- '--- Get field --- '----------------- ' thepfields = thepftab.getfields thecfield = msgbox.listasstring(thepfields, "Choose concentration field", "CONC GRID") ' ' 203 '----------------- '--- Calculate --- '----------------- ' cellsize = number.makenull dummmy = grid.getanalysiscellsize(cellsize) extent = rect.makenull dummy = grid.getanalysisextent(extent) concgrid = grid.makefromftab(thepftab, prj.makenull, thecfield, {cellsize, extent}) 'exit concfilename = av.getproject.makefilename("concgrid", "") concgrid.savedataset("concgrid".asfilename) concgtheme = gtheme.make(concgrid) theview.addtheme(concgtheme) concgtheme.setvisible(true) ' 'final message to user ' message = "Concentration grid calculated." msgbox.info(message,"CONC GRID") ' '----------- '--- End --- '----------- ' 204 CONNECT ' '---------------------------- '--- Creation information --- '---------------------------- ' 'Name: connect.ave 'Version: 1.0 'Date: 02/13/97 'Author: Ferdi Hellweger ' Center for Research in Water Resources ' The University of Texas at Austin ' ferdi@crwr.utexas.edu ' '--------------------------- '--- Purpose/Description --- '--------------------------- ' 'This program modifies an elevation grid based on a polygon grid. 'It digs sinks for the polygons so the flowaccumulation will 'accumulate at the polygon centroids. Use the pickload program 'to pick of loads. ' '--------------------------------------------- '--- Check if units configuration happened --- '--------------------------------------------- ' if (not _configu) then configure = msgbox.yesno("Units are not configured. Configure it now?","CONNECT",true) if (configure) then av.run("balconu", nil) else exit end end ' ' ' ' 205 '---------------- '--- Get view --- '---------------- ' theview = av.getactivedoc vgraphics = theview.getgraphics ' '------------------ '--- Get themes --- '------------------ ' theactivethemes = theview.getactivethemes if (theactivethemes.count = 0) then msgbox.error("No active themes found", "CONNECT") exit end if (theactivethemes.count = 1) then msgbox.error("Only one active theme found", "CONNECT") exit end if (theactivethemes.count = 2) then msgbox.error("Only two active theme found", "CONNECT") exit end if (theactivethemes.count > 3) then msgbox.error("Too many active themes found", "CONNECT") exit end if (theactivethemes.count = 3) then oegfound = false pfound = false lfound = false for each activetheme in theactivethemes if (activetheme.getclass.getclassname = "gtheme") then oegtheme = activetheme oegfound = true end if (activetheme.getclass.getclassname = "ftheme") then theftab = activetheme.getftab 206 theshapef = theftab.findfield("shape") theshape = theftab.returnvalue(theshapef,0) if (theshape.getclass.getclassname = "polyline") then theltheme = activetheme lfound = true end if (theshape.getclass.getclassname = "polygon") then theptheme = activetheme pfound = true end end end end if (not oegfound) then msgbox.error("One theme needs to be a grid theme", "CONNECT") exit end if (not pfound) then msgbox.error("One theme needs to be a polygon theme", "CONNECT") exit end if (not lfound) then msgbox.error("One theme needs to be a line theme", "CONNECT") exit end ' '----------------- '--- Get input --- '----------------- ' keeptemp = msgbox.yesno("Keep temporary data sets?", "CONNECT", false) ' '--------------------- '--- Set up themes --- '--------------------- ' 'grid theme ' oegrid = oegtheme.getgrid ' 207 'check below causes error crash for some reason ' 'if (thegrid = nil) then ' msgbox.error("Can't open grid theme","CONNECT") ' exit 'end oegextend = oegrid.getextent oegcellsize = oegrid.getcellsize ' 'polygon theme ' pftab = theptheme.getftab if (pftab = nil) then msgbox.error("Can't open polygon theme","CONNECT") exit end ' pshapef = pftab.findfield("shape") if (pshapef = nil) then msgbox.error("Can't find 'shape' field in polygon theme","CONNECT") exit end ' 'line theme ' lftab = theltheme.getftab if (lftab = nil) then msgbox.error("Can't open line theme","CONNECT") exit end ' '----------------- '--- Calculate --- '----------------- ' '--- Initial set up --- ' 'setwindow grid.setanalysisextent(#GRID_ENVTYPE_VALUE, oegextend) 208 ' 'setcell ' grid.setanalysiscellsize(#GRID_ENVTYPE_VALUE, oegcellsize) ' 'centroid grid ' cpfilename = av.getproject.makefilename("cenp", "shp") cpftab = ftab.makenew(cpfilename, point) cpshapef = cpftab.findfield("shape") cpfields = list.make cpgridvalf = field.make("gridval", #FIELD_DECIMAL, 16, 4) cpfields.add(cpgridvalf) cpftab.addfields(cpfields) cpftab.seteditable(true) for each prec in pftab pshape = pftab.returnvalue(pshapef, prec) cenp = pshape.returncenter cengs = graphicshape.make(cenp) vgraphics.add(cengs) inside = cenp.iscontainedin(pshape) if (not inside) then msgbox.error("Polygon centroid not inside polygon", "CONNECT") end theoutrec = cpftab.addrecord cpftab.setvalue(cpshapef, theoutrec, cenp) cpftab.setvalue(cpgridvalf, theoutrec, 1) end cpftab.seteditable(false) cengrid = grid.makefromftab(cpftab, prj.makenull, nil, nil) if (keeptemp) then cenfilename = av.getproject.makefilename("cengrid", "") cengrid.savedataset("cen".asfilename) cengtheme = gtheme.make(cengrid) theview.addtheme(cengtheme) cengtheme.setvisible(true) end ' 'boundary grid ' 209 bndgrid = grid.makefromftab(lftab, prj.makenull, nil, nil) if (keeptemp) then bndfilename = av.getproject.makefilename("bndgrid", "") bndgrid.savedataset("bnd".asfilename) bndgtheme = gtheme.make(bndgrid) theview.addtheme(bndgtheme) bndgtheme.setvisible(true) end ' 'polygon grid ' polygrid = grid.makefromftab(pftab, prj.makenull, nil, nil) if (keeptemp) then polyfilename = av.getproject.makefilename("polygrid", "") polygrid.savedataset("poly".asfilename) polygtheme = gtheme.make(polygrid) theview.addtheme(polygtheme) polygtheme.setvisible(true) end ' 'drop grid ' dropgrid = (polygrid.isnull).con(0.asgrid, (bndgrid.isnull).con(1.asgrid, 0.asgrid)) if (keeptemp) then dropfilename = av.getproject.makefilename("dropgrid", "") dropgrid.savedataset("drop".asfilename) dropgtheme = gtheme.make(dropgrid) theview.addtheme(dropgtheme) dropgtheme.setvisible(true) end ' 'cost grid ' costgrid = (dropgrid = 1.asgrid).con(1.asgrid, 1000000.asgrid) if (keeptemp) then costfilename = av.getproject.makefilename("costgrid", "") costgrid.savedataset("cost".asfilename) costgtheme = gtheme.make(costgrid) theview.addtheme(costgtheme) costgtheme.setvisible(true) 210 end ' 'dist grid ' distgrid = cengrid.costdistance(costgrid, nil, nil, nil) if (keeptemp) then distfilename = av.getproject.makefilename("distgrid", "") distgrid.savedataset("dist".asfilename) distgtheme = gtheme.make(distgrid) theview.addtheme(distgtheme) distgtheme.setvisible(true) end ' 'modification parameters ' tmpgrid = (distgrid < 1000000.asgrid).con(distgrid, 0.asgrid) maxdist = tmpgrid.getstatistics.get(1) sinkelev = (-100 - (maxdist * 0.1)) ' 'modified elevation grid ' megrid = (dropgrid = 0.asgrid).con(oegrid, (sinkelev.asgrid + (0.1.asgrid * distgrid))) mefilename = av.getproject.makefilename("megrid", "") megrid.savedataset("gridconnect".asfilename) megtheme = gtheme.make(megrid) theview.addtheme(megtheme) megtheme.setvisible(true) ' 'final message to user ' message = "Grid connected" msgbox.info(message,"CONNECT") ' '----------- '--- End --- '----------- ' 211 LOADGRID ' '---------------------------- '--- Creation information --- '---------------------------- ' 'Name: loadgrid.ave 'Version: 1.0 'Date: 02/28/97 'Author: Ann Quenzer ' Center for Research in Water Resources ' The University of Texas at Austin ' quenzer@mail.utexas.edu ' '--------------------------- '--- Purpose/Description --- '--------------------------- ' 'Makes a land surface loading grid (Kg/day) to be used in 'a weighted flow accumulation which determines the loadings 'to the bay. All concentration grid inputs should be in mg/l. ' '---------------- '--- Get view --- '---------------- ' theview = av.getactivedoc ' '------------------------------- '--- Get themes for loadgrid --- '------------------------------- ' thethemes = theview.getthemes if (thethemes.count = 0) then msgbox.error("No themes found", "LOAD GRID") exit end thegthemes = list.make for each thetheme in thethemes if (thetheme.getclass.getclassname = "gtheme") then 212 thegthemes.add(thetheme) end end if (thegthemes.count = 0) then msgbox.error("No grid themes found", "LOAD GRID") exit end conctheme = msgbox.listasstring(thegthemes, "Concentration Grid", "LOAD GRID") if (conctheme = nil) then exit end ' ' thethemes = theview.getthemes if (thethemes.count = 0) then msgbox.error("No themes found", "LOAD GRID") exit end thegthemes = list.make for each thetheme in thethemes if (thetheme.getclass.getclassname = "gtheme") then thegthemes.add(thetheme) end end if (thegthemes.count = 0) then msgbox.error("No grid themes found", "LOAD GRID") exit end rotheme = msgbox.listasstring(thegthemes, "Runoff Grid", "LOAD GRID") if (rotheme = nil) then exit end ' ' ' '----------------- '--- Calculate --- '----------------- ' 213 concgrid = conctheme.getgrid rogrid = rotheme.getgrid ' cellsize = number.makenull dummmy = grid.getanalysiscellsize(cellsize) extent = rect.makenull dummy = grid.getanalysisextent(extent) ' loadgrid = ((concgrid * rogrid) / 36525.asgrid) loadfilename = av.getproject.makefilename("loadgrid", "") loadgrid.savedataset("loadgrid".asfilename) loadgtheme = gtheme.make(loadgrid) theview.addtheme(loadgtheme) loadgtheme.setvisible(true) ' 'final message to user ' message = "Load grid calculated." msgbox.info(message,"LOAD GRID") ' ' '----------- '--- End --- '----------- ' 214 LKGRIDWF ' '------------------------------ '----Creation Information------ '------------------------------ ' 'Name: lkgridwf.aml 'Date: 9/15/97 'Author: Ann Quenzer ' Center for Research in Water Resources ' The University of Texas at Austin ' quenzer@mail.utexas.edu ' '------------------------------ '----Purpose/Description------- '------------------------------ 'Find the weighted flow accumulation of the Nueces 'River Watershed Loads from each constituent's 'load grids. ' ' ' grid lkgtn = con ( big1 == 1, lkgridtn, big1 ) lkwfgridtn = flowaccumulation ( fdac2, lkgtn ) lkgtp = con ( big1 == 1, lkgridtp, big1 ) lkwfgridtp = flowaccumulation ( fdac2, lkgtp ) lkgfe = con ( big1 == 1, lkgridfe, big1 ) lkwfgridfe = flowaccumulation ( fdac2, lkgfe ) q q end 215 LOGRIDWF ' '------------------------------ '----Creation Information------ '------------------------------ ' 'Name: logridwf.aml 'Date: 9/15/97 'Author: Ann Quenzer ' Center for Research in Water Resources ' The University of Texas at Austin ' quenzer@mail.utexas.edu ' '------------------------------ '----Purpose/Description------- '------------------------------ 'Find the weighted flow accumulation of the Land 'Surface Loads from each constituent's load grids. ' ' ' grid setcell fdac2 setwindow fdac2 logridnn = ( runland2 * cogridnn ) / 36525 lognn = con ( big1 == 1, logridnn, big1 ) lowfgridnn = flowaccumulation ( fdac2, lognn ) logridtn = ( runland2 * cogridtn ) / 36525 logtn = con ( big1 == 1, logridtn, big1 ) lowfgridtn = flowaccumulation ( fdac2, logtn ) logridtp = ( runland2 * cogridtp ) / 36525 logtp = con ( big1 == 1, logridtp, big1 ) lowfgridtp = flowaccumulation ( fdac2, logtp ) logridog = ( runland2 * cogridog ) / 36525 logog = con ( big1 == 1, logridog, big1 ) lowfgridog = flowaccumulation ( fdac2, logog ) logridtc = ( runland2 * cogridtc ) / 36525 logtc = con ( big1 == 1, logridtc, big1 ) lowfgridtc = flowaccumulation ( fdac2, logtc ) logridtca = ( runland2 * cogridtca ) / 36525 216 logtca = con ( big1 == 1, logridtca, big1 ) lowfgridtca = flowaccumulation ( fdac2, logtca ) logridtch = ( runland2 * cogridtch ) / 36525 logtch = con ( big1 == 1, logridtch, big1 ) lowfgridtch = flowaccumulation ( fdac2, logtch ) logridtl = ( runland2 * cogridtl ) / 36525 logtl = con ( big1 == 1, logridtl, big1 ) lowfgridtl = flowaccumulation ( fdac2, logtl ) logridtz = ( runland2 * cogridtz ) / 36525 logtz = con ( big1 == 1, logridtz, big1 ) lowfgridtz = flowaccumulation ( fdac2, logtz ) q q end 217 PICKLOAD ' '---------------------------- '--- Creation information --- '---------------------------- ' 'Name: pickload.ave 'Version: 1.0 'Date: 02/11/97 'Author: Ferdi Hellweger ' Center for Research in Water Resources ' The University of Texas at Austin ' ferdi@crwr.utexas.edu ' '--------------------------- '--- Purpose/Description --- '--------------------------- ' 'This program picks up the nonpoint source load for each 'polygon from a nonpoint source load (weighted flow accumulation) 'grid with the cellvalue request. The nonpoint source load is 'written to the wnp field in the polygon attribute table. ' '--------------------------------------------- '--- Check if units configuration happened --- '--------------------------------------------- ' if (not _configu) then configure = msgbox.yesno("Units are not configured. Configure it now?","BALANCE",true) if (configure) then av.run("balconu", nil) else exit end end ' '---------------- '--- Get view --- '---------------- 218 ' theview = av.getactivedoc vgraphics = theview.getgraphics ' '------------------ '--- Get themes --- '------------------ ' theactivethemes = theview.getactivethemes if (theactivethemes.count = 0) then msgbox.error("No active themes found", "PICKLOAD") exit end if (theactivethemes.count = 1) then msgbox.error("Only one active theme found", "PICKLOAD") exit end if (theactivethemes.count > 2) then msgbox.error("Too many active themes found", "PICKLOAD") exit end if (theactivethemes.count = 2) then gfound = false pfound = false for each activetheme in theactivethemes if (activetheme.getclass.getclassname = "gtheme") then thegtheme = activetheme gfound = true end if (activetheme.getclass.getclassname = "ftheme") then theptheme = activetheme pfound = true end end end if (not gfound) then msgbox.error("One theme needs to be a grid theme", "PICKLOAD") exit end if (not pfound) then 219 msgbox.error("One theme needs to be a polygon theme", "PICKLOAD") exit end ' '--------------------- '--- Set up themes --- '--------------------- ' 'grid theme ' thegrid = thegtheme.getgrid ' 'check below causes error crash for some reason ' 'if (thegrid = nil) then ' msgbox.error("Can't open grid theme","PICKLOAD") ' exit 'end thecellsize = thegrid.getcellsize ' 'polygon theme ' pftab = theptheme.getftab if (pftab = nil) then msgbox.error("Can't open polygon theme","PICKLOAD") exit end ' pshapef = pftab.findfield("shape") if (pshapef = nil) then msgbox.error("Can't find 'shape' field in polygon theme","PICKLOAD") exit end ' wnpf = pftab.findfield("wnp") if (wnpf = nil) then addfield = msgbox.yesno("Can't find 'wnp' field in polygon theme. Add it?","PICKLOAD", true) if (addfield) then pftab.seteditable(true) 220 wnpf = field.make("wnp", #FIELD_DECIMAL, 16, 4) pftab.addfields({wnpf}) pftab.seteditable(false) else exit end end ' '----------------- '--- Calculate --- '----------------- ' 'Note that due to instabilities in the flowaccumulation algorithm 'at sinks the wnp load can not be simply picked of the grid at the 'centroid (the sink). The wnp load is the integral of the grid 'values on a 5x5 box around the centroid. This assumes that the 'flow is directly to the centroid and not around the perimeter of 'the box. Observations support this assumption. The flow direction 'grid could be used to check and/or modify the algorithm. ' '--- Initial set up --- ' 'make polygon attribute table editable ' pftab.seteditable(true) ' '--- Loop --- ' for each prec in pftab ' 'get centroid ' pshape = pftab.returnvalue(pshapef, prec) cenp = pshape.returncenter cenx = cenp.getx ceny = cenp.gety ' 'plot centroid ' cengs = graphicshape.make(cenp) 221 vgraphics.add(cengs) ' 'check if centroid is in polygon ' inside = cenp.iscontainedin(pshape) if (not inside) then msgbox.error("Polygon centroid not inside polygon", "PICKLOAD") end ' 'get wnp ' wnp = 0 ' pickx = cenx + (0 * thecellsize) picky = ceny + (2 * thecellsize) pickp = point.make(pickx, picky) wnpi = thegtheme.returncellvalue(pickp) wnp = wnp + wnpi.clone ' pickx = cenx + (1 * thecellsize) picky = ceny + (2 * thecellsize) pickp = point.make(pickx, picky) wnpi = thegtheme.returncellvalue(pickp) wnp = wnp + wnpi.clone ' pickx = cenx + (2 * thecellsize) picky = ceny + (2 * thecellsize) pickp = point.make(pickx, picky) wnpi = thegtheme.returncellvalue(pickp) wnp = wnp + wnpi.clone ' pickx = cenx + (2 * thecellsize) picky = ceny + (1 * thecellsize) pickp = point.make(pickx, picky) wnpi = thegtheme.returncellvalue(pickp) wnp = wnp + wnpi.clone ' pickx = cenx + (2 * thecellsize) picky = ceny + (0 * thecellsize) pickp = point.make(pickx, picky) 222 wnpi = thegtheme.returncellvalue(pickp) wnp = wnp + wnpi.clone ' pickx = cenx + (2 * thecellsize) picky = ceny + (-1 * thecellsize) pickp = point.make(pickx, picky) wnpi = thegtheme.returncellvalue(pickp) wnp = wnp + wnpi.clone ' pickx = cenx + (2 * thecellsize) picky = ceny + (-2 * thecellsize) pickp = point.make(pickx, picky) wnpi = thegtheme.returncellvalue(pickp) wnp = wnp + wnpi.clone ' pickx = cenx + (1 * thecellsize) picky = ceny + (-2 * thecellsize) pickp = point.make(pickx, picky) wnpi = thegtheme.returncellvalue(pickp) wnp = wnp + wnpi.clone ' pickx = cenx + (0 * thecellsize) picky = ceny + (-2 * thecellsize) pickp = point.make(pickx, picky) wnpi = thegtheme.returncellvalue(pickp) wnp = wnp + wnpi.clone ' pickx = cenx + (-1 * thecellsize) picky = ceny + (-2 * thecellsize) pickp = point.make(pickx, picky) wnpi = thegtheme.returncellvalue(pickp) wnp = wnp + wnpi.clone ' pickx = cenx + (-2 * thecellsize) picky = ceny + (-2 * thecellsize) pickp = point.make(pickx, picky) wnpi = thegtheme.returncellvalue(pickp) wnp = wnp + wnpi.clone ' pickx = cenx + (-2 * thecellsize) 223 picky = ceny + (-1 * thecellsize) pickp = point.make(pickx, picky) wnpi = thegtheme.returncellvalue(pickp) wnp = wnp + wnpi.clone ' pickx = cenx + (-2 * thecellsize) picky = ceny + (0 * thecellsize) pickp = point.make(pickx, picky) wnpi = thegtheme.returncellvalue(pickp) wnp = wnp + wnpi.clone ' pickx = cenx + (-2 * thecellsize) picky = ceny + (1 * thecellsize) pickp = point.make(pickx, picky) wnpi = thegtheme.returncellvalue(pickp) wnp = wnp + wnpi.clone ' pickx = cenx + (-2 * thecellsize) picky = ceny + (2 * thecellsize) pickp = point.make(pickx, picky) wnpi = thegtheme.returncellvalue(pickp) wnp = wnp + wnpi.clone ' pickx = cenx + (-1 * thecellsize) picky = ceny + (2 * thecellsize) pickp = point.make(pickx, picky) wnpi = thegtheme.returncellvalue(pickp) wnp = wnp + wnpi.clone ' 'write wnp to polygon attribute table ' pftab.setvalue(wnpf, prec, wnp) ' end ' 'make polygon attribute table non editable ' pftab.seteditable(false) ' 'final message to user 224 ' message = "Nonpoint Source Load, wnp picked" msgbox.info(message,"PICKLOAD") ' '----------- '--- End --- -------------- 225 POGRIDWF ' '------------------------------ '--Creation Information--- '------------------------------ ' 'Name: pogridwf.aml 'Date: 9/15/97 'Author: Ann Quenzer ' Center for Research in Water Resources ' The University of Texas at Austin ' quenzer@mail.utexas.edu ' '------------------------------ '----Purpose/Description-- '------------------------------ ' 'Find the weighted flow accumulation of the Point Source Loads from each constituent'sload grids. ' '------------------------------ '----------Calculate--------- '------------------------------ ' grid pogtn = con ( big1 == 1, pogridtn, big1 ) pwfgridtn = flowaccumulation ( fdac2, pogtn ) pogtp = con ( big1 == 1, pogridtp, big1 ) pwfgridtp = flowaccumulation ( fdac2, pogtp ) pogog = con ( big1 == 1, pogridog, big1 ) pwfgridog = flowaccumulation ( fdac2, pogog ) pogtc = con ( big1 == 1, pogridtc, big1 ) pwfgridtc = flowaccumulation ( fdac2, pogtc ) pogtca = con ( big1 == 1, pogridtca, big1 ) pwfgridtca = flowaccumulation ( fdac2, pogtca ) pogtch = con ( big1 == 1, pogridtch, big1 ) pwfgridtch = flowaccumulation ( fdac2, pogtch ) pogtl = con ( big1 == 1, pogridtl, big1 ) pwfgridtl = flowaccumulation ( fdac2, pogtl ) pogtz = con ( big1 == 1, pogridtz, big1 ) 226 pwfgridtz = flowaccumulation ( fdac2, pogtz ) pogfe = con ( big1 == 1, pogridfe, big1 ) pwfgridfe = flowaccumulation ( fdac2, pogfe ) pogar = con ( big1 == 1, pogridar, big1 ) pwfgridar = flowaccumulation ( fdac2, pogar ) poghg = con ( big1 == 1, pogridhg, big1 ) pwfgridhg = flowaccumulation ( fdac2, poghg ) q q end 227 POINTLD ' '---------------------------- '--- Creation information --- '---------------------------- ' 'Name: pointld.ave 'Version: 1.0 'Date: 06/2/97 'Author: Ferdi Hellweger ' Center for Research in Water Resources ' The University of Texas at Austin ' ferdi@crwr.utexas.edu ' ' '--------------------------- '--- Purpose/Description --- '--------------------------- ' 'A point load grid is computed from a point, polyline and/or polygon ftheme based 'on the value in a field in the feature attribute table. ' '-------------------- '--- User's guide --- '-------------------- ' '1. Set the analysis cell size and extent. '2. Highlight the input feature theme(s). Multiple themes can processed. '3. Run the program. '4. Supply the field(s) holding the point load. ' '------------- '--- Notes --- '------------- ' '1. This program supports loads attached to points, polylines and polygons. ' The loads are placed on the grid as follows: ' Points: at the point. ' Polylines: at the first point of the line. 228 ' Polygons: half way between the centroid and the first point of of the boundary. ' '2. When using this with the CONNECT and PICKLOAD methodology the program output ' has to be checked to see that the loads for polygons are not placed in the ' 5x5 rectangle around the centroid of the water quality segments. If that is ' the case the methodology for locating the load for polygons should be altered. ' '3. The program uses a rather crude way to value the point load grid. First a ' point shape file is created, which is then converted to a grid with the ' makefromftab request. It would be much easier if cells could be valued in ' the same as as with the ARC/INFO grid fillcell command. An equivalent has ' not been found in the spatial analyst. ' '4. The output of this program is a point source load grid in the same units as ' the load field in the input feature theme. ' '5. The point source load grid should be added to the nonpoint source load grid ' to create a total load grid before a weighted flow accumulation is done. ' '---------------- '--- Get view --- '---------------- ' theview = av.getactivedoc ' '-------------------- '--- Get theme(s) --- '-------------------- ' thethemes = theview.getactivethemes if (thethemes.count = 0) then msgbox.error("No themes found", "POINT LOAD GRID") exit end thefthemes = list.make for each thetheme in thethemes if (thetheme.getclass.getclassname = "ftheme") then thefthemes.add(thetheme) end 229 end if (thefthemes.count = 0) then msgbox.error("No feature themes found", "POINT LOAD GRID") exit end ' '------------------------------ '--- Set up point load grid --- '------------------------------ ' plgrid = grid.makefromnumb(0.0) ' '------------------------ '--- Set up temp ftab --- '------------------------ ' tempftab = ftab.makenew(("tempname").asfilename, point) tempftab.seteditable(true) tempshapef = tempftab.findfield("shape") tempfields = list.make temploadf = field.make("load", #FIELD_DECIMAL, 16, 4) tempfields = tempfields.add(temploadf) tempftab.addfields(tempfields) temprec = tempftab.addrecord ' '-------------------------- '--- Process each theme --- '-------------------------- ' for each thetheme in thefthemes ' '--- Set up theme --- ' theftab = thetheme.getftab theshapef = theftab.findfield("shape") ' '--- Get field --- ' thefields = theftab.getfields theloadf = msgbox.listasstring(thefields, "Choose point load field for " + 230 thetheme.getname, "POINT LOAD GRID") if (theloadf = nil) then exit end ' '--- Process each feature --- ' for each thefeature in theftab 'check load theload = theftab.returnvalue(theloadf, thefeature) if (theload > 0) then 'get point theshape = theftab.returnvalue(theshapef, thefeature) if (theshape.getclass.getclassname = "point") then thepoint = theshape end if (theshape.getclass.getclassname = "polyline") then thepoint = theshape.asmultipoint.aslist.get(0) end if (theshape.getclass.getclassname = "polygon") then thecentroid = theshape.returncenter cenx = thecentroid.getx ceny = thecentroid.gety theboundarypoint = theshape.aspolyline.asmultipoint.aslist.get(0) boundx = theboundarypoint.getx boundy = theboundarypoint.gety pointx = ((cenx + boundx) / 2) pointy = ((ceny + boundy) / 2) thepoint = point.make(pointx, pointy) if (not (thepoint.iscontainedin(theshape))) then msgbox.info("Point load assigned outside polygon.", "POINT LOAD GRID") end end 'value temp ftab tempftab.seteditable(true) tempftab.setvalue(tempshapef, temprec, thepoint.clone) tempftab.setvalue(temploadf, temprec, theload.clone) tempftab.seteditable(false) 'make temp grid 231 tempgrid = grid.makefromftab(tempftab, prj.makenull, temploadf, nil) 'add temp grid to point load grid plgrid = tempgrid.isnull.con(plgrid, (plgrid + tempgrid)) end end end ' '--------------------------------- '--- Save grid and add to view --- '--------------------------------- ' plgtheme = gtheme.make(plgrid) theview.addtheme(plgtheme) plgtheme.setvisible(true) ' '----------------------------- '--- Final message to user --- '----------------------------- ' message = "Point load grid calculated." msgbox.info(message,"POINT LOAD GRID") ' '----------- '--- End --- '----------- ' 232 ROGRIDLAND ' '---------------------------- '--- Creation information --- '---------------------------- ' 'Name: rogridland.ave 'Version: 1.0 'Date: 09/02/97 'Author: Ann Quenzer ' Center for Research in Water Resources ' The University of Texas at Austin ' quenzer@mail.utexas.edu ' '--------------------------- '--- Purpose/Description --- '--------------------------- ' 'Computes a runoff grid in mm/yr from the precipitation grid. 'Uses the runoff equation calculated from Microsoft Excel 5.0 'regression tool using the relationship between percent land 'use, precipitation, and streamflow. ' '---------------- '--- Get view --- '---------------- ' theview = av.getactivedoc ' '------------------ '--- Get themes --- '------------------ ' thethemes = theview.getthemes if (thethemes.count = 0) then msgbox.error("No themes found", "RUNOFF GRID") exit end thegthemes = list.make for each thetheme in thethemes 233 if (thetheme.getclass.getclassname = "gtheme") then thegthemes.add(thetheme) end end if (thegthemes.count = 0) then msgbox.error("No grid themes found", "RUNOFF GRID") exit end pretheme = msgbox.listasstring(thegthemes, "Precipitation Grid", "RUNOFF GRID") if (pretheme = nil) then exit end landtheme = msgbox.listasstring(thegthemes, "Land Use Grid", "RUNOFF GRID") if (pretheme = nil) then exit end ' '----------------- '--- Calculate --- '----------------- ' pregrid = pretheme.getgrid landgrid = landtheme.getgrid ' cellsize = number.makenull dummmy = grid.getanalysiscellsize(cellsize) extent = rect.makenull dummy = grid.getanalysisextent(extent) ' rogridr1 = ((landgrid >= 30.asgrid) and (landgrid <= 49.asgrid)).con((0.0053.asgrid * (0.010993.asgrid * pregrid).exp), (0.asgrid)).int rogridr2 = ((landgrid >= 70.asgrid) and (landgrid <= 79.asgrid)).con((0.0053.asgrid * (0.010993.asgrid * pregrid).exp), (0.asgrid)).int rogridr3 = (landgrid <= 10.asgrid).con((0.0053.asgrid * (0.010993.asgrid * pregrid).exp), (0.asgrid)).int rogrida = ((landgrid >= 20.asgrid) and (landgrid <= 29.asgrid)).con((0.008312.asgrid * (0.011415.asgrid * pregrid).exp), (0.asgrid)).int rogridu = ((landgrid >= 11.asgrid) and (landgrid <= 19.asgrid)).con((pregrid * 0.24.asgrid), (0.asgrid)).int 234 rogridwe = ((landgrid >= 60.asgrid) and (landgrid <= 69.asgrid)).con((0.0053.asgrid * (0.010993.asgrid * pregrid).exp), (0.asgrid)).int rogridw = ((landgrid >= 50.asgrid) and (landgrid <= 59.asgrid)).con((0.asgrid), (0.asgrid)).int rogrid = (rogridr1 + rogridr2 + rogridr3 + rogrida + rogridu + rogridw + rogridwe).int rofilename = av.getproject.makefilename("rogrid", "") rogrid.savedataset("runland".asfilename) rogtheme = gtheme.make(rogrid) theview.addtheme(rogtheme) rogtheme.setvisible(true) ' 'final message to user ' message = "Runoff grid calculated." msgbox.info(message,"RUNOFF GRID") ' '----------- '--- End --- '----------- ' 235 STRMLNK '---------------------------- '--- Creation information --- '---------------------------- 'Name: strmlnk.ave 'Version: 1.0 'Date: 05/07/97 'Author: Ann Quenzer ' Center for Research in Water Resources ' The University of Texas at Austin ' quenzer@mail.utexas.edu ' '--------------------------- '--- Purpose/Description --- '--------------------------- ' 'This script makes a stream link grid. ' '---------------- '--- Get view --- '---------------- ' theview = av.getactivedoc theDisplay = theView.GetDisplay ' '------------------ '--- Get themes --- '------------------ ' thethemes = theview.getthemes if (thethemes.count = 0) then msgbox.error("No themes found", "WTRSHD") exit end if (thethemes.count = 1) then msgbox.error("Only one theme found", "WTRSHD") exit end thegthemes = list.make for each thetheme in thethemes 236 if (thetheme.getclass.getclassname = "gtheme") then thegthemes.add(thetheme) end end if (thegthemes.count = 0) then msgbox.error("No grid themes found", "WTRSHD") exit end if (thethemes.count = 1) then msgbox.error("Only grid one theme found", "WTRSHD") exit end fdrtheme = msgbox.listasstring(thegthemes, "Flow direction theme", "WTRSHD") if (fdrtheme = nil) then exit end factheme = msgbox.listasstring(thegthemes, "Flow accumulation theme", "WTRSHD") if (factheme = nil) then exit end rivtheme = msgbox.listasstring(thegthemes, "Stream Grid theme", "WTRSHD") if (rivtheme = nil) then exit end ' '----------------- '--- Calculate --- '----------------- ' fdrgrid = fdrtheme.getgrid facgrid = factheme.getgrid strgrid = rivtheme.getgrid ' ' delineate stream links lnk1grid = strgrid.StreamLink(fdrgrid) ' 'Save the New Grid lnk1grid.SaveDataSet("lnk1grid".AsFileName) ' 237 'Create Grid Themes lnk1theme = GTheme.Make(lnk1grid) ' 'Add Themes to the View TheView.AddTheme(lnk1theme) ' '----------- '--- End --- '----------- 238 TIMEAVE ' '---------------------------- '--- creation information --- '---------------------------- ' 'Name: timeave.ave 'Version: 1.0 'Date: 03/09/97 'Author: Ferdi Hellweger ' Center for Research in Water Resources ' The University of Texas at Austin ' ferdi@crwr.utexas.edu ' www.ce.utexas.edu/stu/ferdi/ ' '--------------------------- '--- purpose/description --- '--------------------------- ' 'This is a time averaging utility for sample data. ' '----------------- '--- get table --- '----------------- ' intable = av.getactivedoc ' '-------------------- '--- set up table --- '-------------------- ' invtab = intable.getvtab insegidf = invtab.findfield("segid") indatef = invtab.findfield("date") inmsmtf = invtab.findfield("msmt") ' '--------------------------- '--- set up output table --- '--------------------------- ' 239 outfilenamestring = msgbox.input("Output file name", "WARDIMP", "c:\warddata\wqsalsur3.dbf") outfilename = filename.make(outfilenamestring) outvtab = vtab.makenew(outfilename, dBASE) outfields = list.make outsegidf = field.make("segid", #FIELD_CHAR, 4, 0) outavef = field.make("ave", #FIELD_DECIMAL, 16, 4) outnvalf = field.make("nval", #FIELD_DECIMAL, 16, 4) outfields = outfields.add(outsegidf) outfields = outfields.add(outavef) outfields = outfields.add(outnvalf) outvtab.addfields(outfields) outvtab.seteditable(true) ' '-------------------- '--- process data --- '-------------------- ' 'algorithm assumes data in chronological order 'time handled as decimal years, due to problem with early, ca. 68 dates 'arcview crashes ' nval = 0 tottime = 0 totweight = 0 thissegid = invtab.returnvalue(insegidf, 0) 'datestring = invtab.returnvalue(indatef, 0).asstring.Split({2,4}, ":") 'lastdate = date.make(datestring, "yy:MM:dd") datestr = invtab.returnvalue(indatef, 0).asstring datenum1 = datestr.left(2).asnumber datenum2 = datestr.left(4).right(2).asnumber / 12 datenum3 = datestr.right(2).asnumber / 30 / 12 datenum = datenum1 + datenum2 + datenum3 lastdate = datenum.clone for each inrec in invtab insegid = invtab.returnvalue(insegidf, inrec) datestr = invtab.returnvalue(indatef, inrec).asstring datenum1 = datestr.left(2).asnumber datenum2 = datestr.left(4).right(2).asnumber / 12 datenum3 = datestr.right(2).asnumber / 30 / 12 240 datenum = datenum1.clone + datenum2.clone + datenum3.clone indate = datenum.clone inmsmt = invtab.returnvalue(inmsmtf, inrec) if (thissegid <> insegid) then ave = totweight.clone / tottime.clone ' message = "thissegid = " + thissegid.asstring ' message = message + nl + "insegid = " + insegid.asstring ' message = message + nl + "nval = " + nval.asstring ' message = message + nl + "totweight = " + totweight.asstring ' message = message + nl + "tottime = " + tottime.asstring ' message = message + nl + "ave = " + ave.asstring ' keepgoing = msgbox.yesno(message, "WARDIMP", true) ' if (not keepgoing) then ' exit ' end outrec = outvtab.addrecord outvtab.setvalue(outsegidf, outrec, thissegid.clone) outvtab.setvalue(outavef, outrec, ave.clone) outvtab.setvalue(outnvalf, outrec, nval.clone) nval = 0 tottime = 0 totweight = 0 thissegid = insegid.clone lastdate = indate.clone end mytime = indate - lastdate ' message = "indate = " + indate.asstring ' keepgoing = msgbox.yesno(message, "WARDIMP", true) ' if (not keepgoing) then ' exit ' end weight = mytime.clone * inmsmt.clone nval = nval.clone + 1 tottime = tottime.clone + mytime.clone totweight = totweight.clone + weight.clone lastdate = indate.clone end 'close up ' msgbox.info("Averages calculated", "WARDIMP") 241 WFACGRID ' '---------------------------- '--- Creation information --- '---------------------------- ' 'Name: wfacgrid.ave 'Version: 1.0 'Date: 02/17/97 'Author: Ferdi Hellweger ' Center for Research in Water Resources ' The University of Texas at Austin ' ferdi@crwr.utexas.edu ' 'Modified: 02/28/97 ' Ann Quenzer ' Center for Research in Water Resources ' The University of Texas at Austin ' quenzer@mail.utexas.edu ' 1) changed the conversions to reflect project ' 2) changed the message box descriptions to ' reflect the script ' 3) computes an integer grid ' 4) added purpose and description ' '--------------------------- '--- Purpose/Description --- '--------------------------- ' 'Computes the weighted flow accumulation using the flow 'direction grid and the land surface loading grid. The 'resulting grid produces a grid (wfacload) with the 'loadings to the bay in Kg/day. ' '---------------- '--- Get view --- '---------------- ' theview = av.getactivedoc ' 242 ' '--------------------- '--- Get themes --- '--------------------- ' thethemes = theview.getthemes if (thethemes.count = 0) then msgbox.error("No themes found", "WFAC GRID") exit end if (thethemes.count = 1) then msgbox.error("Only one theme found", "WFAC GRID") exit end thegthemes = list.make for each thetheme in thethemes if (thetheme.getclass.getclassname = "gtheme") then thegthemes.add(thetheme) end end if (thegthemes.count = 0) then msgbox.error("No grid themes found", "WFAC GRID") exit end if (thethemes.count = 1) then msgbox.error("Only grid one theme found", "WFAC GRID") exit end fdrtheme = msgbox.listasstring(thegthemes, "Flow direction theme", "WFAC GRID") if (fdrtheme = nil) then exit end ldtheme = msgbox.listasstring(thegthemes, "Load theme", "WFAC GRID") if (ldtheme = nil) then exit end ' ' ' 243 '----------------- '--- Calculate --- '----------------- ' fdrgrid = fdrtheme.getgrid ldgrid = ldtheme.getgrid ' cellsize = number.makenull dummmy = grid.getanalysiscellsize(cellsize) extent = rect.makenull dummy = grid.getanalysisextent(extent) ' facgrid = (fdrgrid.flowaccumulation(ldgrid)).int facfilename = av.getproject.makefilename("facgrid", "") facgrid.savedataset("wfacload1".asfilename) facgtheme = gtheme.make(facgrid) theview.addtheme(facgtheme) facgtheme.setvisible(true) ' 'final message to user ' message = "Accumulated load grid calculated." msgbox.info(message,"WFAC GRID") ' '----------- '--- End --- '----------- ' 244 WTRSHD ' '---------------------------- '--- Creation information --- '---------------------------- ' 'Name: wtrshd.ave 'Version: 1.0 'Date: 03/20/97 'Author: Ann Quenzer ' Center for Research in Water Resources ' The University of Texas at Austin ' quenzer@mail.utexas.edu ' '--------------------------- '--- Purpose/Description --- '--------------------------- ' 'Delineates the watersheds within the study area. ' '---------------- '--- Get view --- '---------------- ' theview = av.getactivedoc theDisplay = theView.GetDisplay ' '-------------------------------- '--- Get themes for watershed --- '-------------------------------- ' ' thethemes = theview.getthemes if (thethemes.count = 0) then msgbox.error("No themes found", "WATERSHED") exit end thegthemes = list.make for each thetheme in thethemes if (thetheme.getclass.getclassname = "gtheme") then 245 thegthemes.add(thetheme) end end if (thegthemes.count = 0) then msgbox.error("No grid themes found", "WATERSHED") exit end fdrtheme = msgbox.listasstring(thegthemes, "Flow Direction Grid", "WATERSHED") if (fdrtheme = nil) then exit end ' ' if (thethemes.count = 0) then msgbox.error("No themes found", "WATERSHED") exit end thegthemes = list.make for each thetheme in thethemes if (thetheme.getclass.getclassname = "gtheme") then thegthemes.add(thetheme) end end ' ' if (thegthemes.count = 0) then msgbox.error("No grid themes found", "WATERSHED") exit end factheme = msgbox.listasstring(thegthemes, "Flow Accumulation Grid", "WATERSHED") if (factheme = nil) then exit end ' ' if (thethemes.count = 0) then msgbox.error("No themes found", "WATERSHED") exit 246 end thegthemes = list.make for each thetheme in thethemes if (thetheme.getclass.getclassname = "gtheme") then thegthemes.add(thetheme) end end ' ' if (thegthemes.count = 0) then msgbox.error("No grid themes found", "WATERSHED") exit end demtheme = msgbox.listasstring(thegthemes, "DEM Grid", "WATERSHED") if (factheme = nil) then exit end ' '----------------- '--- Calculate --- '----------------- ' fdrgrid = fdrtheme.getgrid facgrid = factheme.getgrid demgrid = demtheme.getgrid ' ' thePoint = theDisplay.ReturnUserPoint mPoint = MultiPoint.Make({thePoint}) ' 'Delineate the watersheds for each of these stream segments sourcegrid = demgrid.ExtractByPoints(mPoint,Prj.MakeNull,FALSE) wshedgrid = fdrgrid.Watershed(sourcegrid.SnapPourPoint(facgrid,240)) ' create a theme theGTheme = GTheme.Make(wshedgrid) ' check if output is ok if (wshedgrid.HasError) then return NIL end 247 'wshedgrid = fdrgrid.watershed(linkgrid) ' 'Save the New Grids wshedgrid.savedataset("watershed".AsFileName) ' 'Create Grid Themes 'linktheme = gtheme.make(linkgrid) wshedtheme = gTheme.make(wshedgrid) ' 'Add Themes to the View theview.addtheme(wshedtheme) ' 'final message to user ' message = "Watershed calculated." msgbox.info(message,"WATERSHED") ' '----------- '--- End --- '--------------------- 248 BIBLIOGRAPHY 249 Abbott, J. 1977. Guidelines for Calibration and Application of STORM. Training Document No. 8. Hydrologic Engineering Center, Corps of Engineers, Davis, CA. Armstrong, N. E. 1997. Point Source Data for the Corpus Christi National Estuary Program. Corpus Christi National Estuary Program, Corpus Christi, TX. Baird, F. C., T. J. Dybala, M. E. Jennings and D.J. Ockerman. 1996. Characterization of Non-Point Sources and Loadings to the Corpus Christi Bay National Estuary Program Study Area. Corpus Christi National Estuary Program, Corpus Christi, TX. Barrett, M. 1997. Personal Communication, The University of Texas at Austin. Bicknell, B. R., J. C. Imhoff, J. L. Kittle, Jr., A. S. Donigian, and R. C. Johanson. 1993. Hydrologic Simulation Program-FORTRAN (HSPF): Users Manual for Release 10. Environmental Research Laboratory, US EPA, Athens, GA. Beasley, D. B. and L. F. Huggins. 1982. ANSWERS users manual. EPA-9105/9- 82-001. US EPA, Chicago, IL. Brock, D.A. 1997. Personal Communication, The Texas Water Development Board. Donigian, A. S. and W. C. Huber. 1991. Modeling of Nonpoint Source Water Quality in Urban and Non-urban Areas. Environmental Research Laboratory Office of Research and Development. US EPA. Athens, GA. Eid, N. 1997. Water Quality Model Used to Calculated Equilibrium Concentrtions. Center for Research in Water Resources, The University of Texas at Austin. Environmental Protection Agency (EPA). 1997. Online Report: Surface Water Quality Modeling. Internet site: http://www.epa.gov/ORD/WebPubs/surfaceH2O/surface.html. Environmental Protection Agency (EPA). 1998. BASINS Internet Site: http://www.epa.gov/OST/BASINS.html. Environmental Protection Agency (EPA). 1995. QUAL2E Windows Interface User?s Manual. US EPA, Washington, DC. 250 Environmental Protection Agency (EPA). 1993. The Water Quality Analysis Simulation Program (WASP5), Part A: Model Documentation. US EPA, Washington, DC. Environmental Systems Research Institute. 1990. Understanding Gis-The Arc/Info Method. ESRI, Redlands,CA. Hellweger, F.L. 1996. Surface Reconditioning: http://www.ce.utexas.edu/prof/maidment/ferdi/ferdi/research/agree Model Connection: http://www.ce.utexas.edu/prof/maidment/ferdi/ferdi/research/connect Water Quality Model: http://www.ce.utexas.edu/prof/maidment/ferdi/ferdi/research/balance Hinson, J.M., W.P. Pulich, C. Blair, and R. Gallacher. 1995. Compilation of a Digital Layer Composed of Wetland Habitats and Coastal Land Cover Data: Final Report to Natural Resources Inventory Program. Texas Parks and Wildlife. Hirsch, R.M., D.R. Helsel, T.A. Cohn, and E.J. Gilroy. 1993. Handbook of Hydrology. McGrawHill, Inc. New York. Hodge, W., M. Larson, and W. Goran. 1986. Linking the ARMSED Watershed Process Model with the GRASS Geographic Information System. US Army Construction Engineering Research Laboratory, Champaign, IL. Knisel, W. 1980. CREAMS: A Field Scale Model for Chemicals, Runoff, and Erosion from Agricultural Management Systems, U.S. Department of Agriculture, Conservation Research Report No. 26, 640 pp. Liljestrand, H. M., J. D. Mohr, and M. A. Stradfford. 1986. Methods for the Validation of Precipitation pH: Applications to Texas Data. J. Environ. Sci. A21(2): 151-168. Maidment, D.R. and W.K. Saunders. 1996. Non-Point Pollution Assessment Of The San Antonio-Nueces Coastal Basin. Paper Presented to the Scientific and Technical Advisory Committee, Corpus Christi Bay National Estuary Program, Corpus Christi, TX. Matsumoto, J., 1993. User?s Manual for the Texas Water Development Board?s 251 Hydrodynamic and Salinity Model: TxBLEND - DRAFT February 1993. Environmental Section in the Planning Division, Texas Water Development Board. Montagna, P. A., R.R. Twilley, J. Cowan, T. Miller-Way. 1997. Benthic Nutrient Fluxes of Selected Estuaries in the Gulf of Mexico. Ockerman, D.J. 1998. Personal Communication. United States Geological Survey. Oregon State University Forest Science Department's Anonymous ftp Site: fsl.orst.edu, 1996. Reed, S. et al. 1996. Spatial Water Balance of Texas. The University of Texas at Austin., Center for Research in Water Resources. Rifai, H.S., C.J. Newell, and P.B. Bedient. 1993. Getting to the Nonpoint Source with GIS. Civil Engineering. 63(6):44-46. Saunders, W.K. and D.R. Maidment. 1996. A Gis Assessment of Non-Point Source Pollution in the San Antonio-Nueces Coastal Basin. The University of Texas, Center for Research in Water Resources. CRWR online report 96-1. Snyder, J.P. 1987. Map Projections-A Working Manual. US Geological Survey Paper #1395, US Government Printing Office, Washington, DC. Texas Natural Resources Information System (TNRIS). 1996. Internet Site, http://www.tnris.state.tx.us/pub/GIS/topography/LULC/. Texas Natural Resources Information System (TNRIS). 1997. Internet Site, http://www.tnris.state.tx.us/pub/GIS/wetlands/aquatic/cwh/corpus/. Texas United States Geological Survey (TXUSGS) 1996. Internet Site, http://txwww.cr.usgs.gov/. Texas Nartural Resource Conservation Commission (TNRCC). 1997. Internet site, http://www.tnris.state.tx.us/ftparea.html. United States Geological Survey (USGS). 1993. 1:100,00-scale Digital Line Graph Data: Hydrology And Transportation ? Area 8, Texas And Oklahoma. US GeoData Compact Disc. US Geological Survey, Reston, VA. 252 United States Geological Survey (USGS). 1996. Internet Site, http://h2O.cr.usgs.gov/nsdi/wais/water/rf1.HTML. United States Geological Survey (USGS). 1996. Internet Site, http://nsdi.cr.usgs.gov/nsdi/products/huc.html. United States Geological Survey (USGS). 1996. Internet Site, http://edcwww.cr.usgs.gov/doc/edchome/ndcdb/ndcdb.html United States Geological Survey National Atmospheric Deposition Program (USGSNADP). 1997. Internet site, http://h2o.usgs.gov/nwc/NWC/pH/html/ph.html Thomann, R.V. and J.A. Mueller. 1987. Principles of Surface Water Quality Modeling and Control. Harper Collins Publishers Inc., New York. Ward, G. H., and Armstrong, N. E. 1996. Corpus Christi Bay National Estuary Program, Ambient Water, Sediment and Tissue Quality of Corpus Christi Bay Study Area: Present Status and Historical Trends, Summary Report; Draft. The University of Texas at Austin, Center for Research in Water Resources. Ward, G.H. 1997. Corpus Christi Bay National Estuary Program: Current Status and Historical Trends of Estuarine Circulation; Draft. The University of Texas at Austin, Center for Research in Water Resources. Walker, J. F., S. A. Pickard, and W. C. Sonzogni. 1989. Spreadsheet Watershed Modeling for Nonpoint Source Pollution Management in a Wisconson Basin. Water Resources Bulletin, American Water Reseouces Association. 25(1):139-147. Young, R.A., C. A. Onstad, D. D. Bosch, and W. P. Anderson. 1987. AGNPS: Agricultural nonpoint source pollution model. A Watershed Analysis Tool. Conserv. Res. Rep. 35. USDA-ARS, Washington, DC. 253 VITA Ann Marie Quenzer was born in Aberdeen, South Dakota on November 6, 1972, the daughter of JaniceEdna Quenzer and Harlan John Quenzer. After completing he work at Mitchell Senior High School, Mitchell, South Dakota, in 1991, she entered South Dakota State University in Brookings, South Dakota. She received the degree of Bachelor of Science from South Dakota State University in December, 1995. For the following months, she was employed as a Civil Engineer for Shchmucker, Paul, Nohr and Associates of Mitchell, South Dakota. In September, 1996, she entered the Graduate School at the University of Texas at Austin. Permanent Address: 1409 Pebble Beach Road Mitchell, South Dakota 57301 This thesis was typed by the author.