' '---------------------------- '--- 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 ' ' 'Modified: 3/5/98 by Patrice Melancon 'Name: tillflow.ave 'New Runoff equations inserted for Tillamook Bay Project. 'This script doesn't include landuse. 'The original script was called rogridland.ave and can 'be found in Ann Quenzer's thesis. ' '--------------------------- '--- Purpose/Description --- '--------------------------- ' 'Computes runoff grids in in/yr from the precipitation grid. 'Uses the runoff equation calculated from Microsoft Excel 5.0 'regression tool using the relationship between precipitation and streamflow. 'This script calculates a grid of baseflow, surface runoff, as well 'as total flow. ' '---------------- '--- 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 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 ' '----------------- '--- Calculate --- '----------------- ' pregrid = pretheme.getgrid ' cellsize = number.makenull dummmy = grid.getanalysiscellsize(cellsize) extent = rect.makenull dummy = grid.getanalysisextent(extent) ' ' rogridba = ((0.5188.asgrid * (pregrid * 1.0738.asgrid)) + 1.857.asgrid) rogridro = ((0.3763.asgrid * (pregrid * 1.0738.asgrid)) - 15.478.asgrid) rogridto = (rogridba + rogridro) ' robafilename = av.getproject.makefilename("rogridba", "") rogridba.savedataset("p:\flowdata\baseflow2".asfilename) robagtheme = gtheme.make(rogridba) theview.addtheme(robagtheme) robagtheme.setvisible(true) ' rorofilename = av.getproject.makefilename("rogridro", "") rogridro.savedataset("p:\flowdata\runoff2".asfilename) rorogtheme = gtheme.make(rogridro) theview.addtheme(rorogtheme) rorogtheme.setvisible(true) ' rotofilename = av.getproject.makefilename("rogridto", "") rogridto.savedataset("p:\flowdata\totalflow2".asfilename) rotogtheme = gtheme.make(rogridto) theview.addtheme(rotogtheme) rotogtheme.setvisible(true) ' 'final message to user ' message = "Runoff grids calculated." msgbox.info(message,"RUNOFF GRID") ' '----------- '--- End --- '----------- '