Xiao liu:  I think you'd better have your advisor help youwith this page.]



Alberts, E. E., C. S. Holzhey, L. T. West, and J. O. Nordin. 1987. Soil Selection: USDA water erosion prediction project (WEPP). Paper No. 87-2542, Am. Soc. Agric. Eng., St. Joseph, MI.

Barfield, B.J., R.I. Barnhisel, M.C. Hirschi, and I.D. Moore. 1988. Compaction effects on erosion of mine spoil and reconstructed topsoil. Trans. ASAE 31: 447-452.

Beasley, D.B., and L.F. Huggins, 1982. ANSWERS (Areal Nonpoint Source Watershed Environmental Response Simulation) User’s Manual. Chicago: U.S. Environmental Protection Agency Report No. 905/9-82-001.

                    Beinat, E. 1997. Value functions for environmental management, Kluwer, Dordrecht. Belton, V. 1990. Multiple Criteria Decision Analysis – Practically the Only Way to Choose, in L.C. Hendry, R. Eglese (Eds.) Operational Research Tutorial Paper 1990, Operational Research Society, Birmingham.

Bertin, J. 1981. Graphics and graphic information processing. Walter de Gruyter, Berlin.

Birkin, M., G. Clarke, A. Wilson, 1990, Elements of a model-based GIS for the evaluation of urban policy, In: L. Worral (Ed). Geographic Information Systems: Developments and Applications. Belhaven Press, London, pp. 133-162.

Bonissone, P.P., K. Decker, 1986, Selecting uncertainty calculi and granularity: an experiment in trading-off precision and complexity, in L.N. Kanal, J.F. Lemmer (Eds.) Uncertainty in Artificial Intelligence, North-Holland-Elsevier, Amsterdam.

Campbell, J.B. 1996. Introduction to Remote Sensing. The Guilford Press, New York.

Carver, S.J. 1991, Integrating Multi-Criteria Evaluation with Geographical Information Systems, International Journal of Geographical Information Systems, 5(3): 321-339.

Cohon, J.L. 1978. Multiobjective Programming and Planning. Academic Press, New York.

Densham, P.J. 1991. Spatial Decision Support Systems. In: Maguire, D.J., M.F. Goodchild, and D.W. Rhind (Eds.) Geographic Information Systems: Principles and Applications. Longman, London, pp. 403-12, Vol 1.

Densham, P.J., M.F. Goodchild, 1989, Spatial decision support systems: a resesrch agenda, In: Proceedings, GIS/LIS’89, Orlando, Florida, The American Congress on Surveying and Mapping, Bethesda, MD.

Dickson, G.W., G. Dessanctis and D.J. McBride. 1986. Understanding the effectiveness of computer graphics for decision support: a cumulative experimental approach. Communications of the A.C.M., No. 1, pp 40-57.

Eastman, J.R., W. Jin, P.A.K. Kyem, J. Toledano, 1993, GIS and Decision Making, Explorations in Geographic Information System Technology, 4, UNITAR, Geneva.

Eastman, J.R., W. Jin, P.A.K. Kyem, J. Toledano, 1994, Raster Procedures for Multi-Criteria / Multi-Objective Decisions, Photogrammetric Engineering and Remote Sensing.

ERDAS Inc., 1997. ERDAS Imagine Tour Guides. Atlanta, Georgia.

ERDAS Inc., 1997. ERDAS Field Guide. Atlanta, Georgia.

Ehlers, M., D.Greenlee, T. Smith, J. Star, 1991, Integration of remote sensing and GIS data and data access. Photogrammetric Engineering and Remote Sensing 57: 669-675.

Environmental System and Research Institute (ESRI), ArcInfo 7.2.1 Documentation, 1997.

Estes, J., 1992, Remote sensing and GIS integration: research need, status, and trends, ITS Journal 1: 2-10

Estes, J., K. McGwire, G. Fletcher, T. Foresman, 1987, Coordination hazardous waste management activities using geographical information systems, International Journal of Geographic Information Systems 1: 359-377.

Faludi, A. 1971. Planning Theory. Pergamon Press, Oxford.

Faust, N., W. Anderson, J. Star 1991, Geographic information systems and remote sensing future computing environment, Photogrammetric Engineering and Remote Sensing 57: 665-668.

Flanagan, D.C., and M.A. Nearing. 1995. USDAWater Erosion Prediction Project: Hillslope profile and watershed model documentation. NSERL Report No. 10. USDA-ARS National Soil Erosion Research Laboratory, West Lafayette, Indiana

Fedra, K. and Reitsma, R.F. 1990, Decision support and geographical information systems, in H.J. Scholten, J.C.H. Stillwell (Eds.) Geographical Information Systems for Urban and Regional Planning, Kluwer, Dordrecht, 177-188.

Ginzberg, M.J. and E.A. Stohr. 1982. Decision Support Sytems: Issues and Perspective. In: Ginzberg, M.J. et al. (Eds), Decision Support Systems, North Holland, Amsterdam, pp. 9-22.

Haddock, G., P. Jankowski, 1993, Integrating nonpoint source pollution modeling with a geographic information system, Computers, Environment, and Urban Systems 17: 437-451

Henderson, F.M., T.F. Hant, Jr., B.P. Heaton, and J.E. Portolese, 1998. Mapping Coastal Ecosystems over a Steep Development Gradient Using C-CAP Protocols. International Journal of Remote Sensing

Henderson, F.M., T.F. Hant, Jr., L. Orlando, B.P. Heaton, J.E. Portolese, and R. Chasan, 1998. Application of C-CAP Protocol Land Cover Data to Nonpoint Source Water Pollution Potential Spatial Models in a Coastal Environment. Photogrammetric Engineering and Remote Sensing. Vol LXIV(10) : 1015-1020

Holtgrefe, A.A.I. 1989. Decision Support Systems. In: Handbook Information, Samson.

Honea, R.B., K.A. Hake, R.C. Durfee, R.C.,1991, Incorporating GISs into Decision Support Systems: Where Have We Come From and Where Do We Need to Go?, in M. Heit, A. Shorteid (Eds.) GIS Applications in Natural Resources, GIS World Inc., Fort Collins, Colorado.

Indiana State Planning Services Agency. 1979. Indiana fact book. 139 pp.

James, D.E., and M.J. Hewitt, 1992. To save a river: Building a resource decision support system for the Blackfoot River drainage. GeoInfo Systems 2(10): 36-49.

Jankowski, P., 1995. Integrating geographic information systems and multiple criteria decision making methods. International Journal of Geographic Information systems 18: 365-380

Janssen, R. 1992. Multiobjective Decision Support for Environmental Management. Kluwer, The Netherlands.

Janssen, R., and Rietveld. P., 1990. Multicriteria analysis and GIS: an application to agriculture land use in The Netherlands, In : Geographic Information System for Urban and Regional Planning, edited by H. J. Scholtern, and J. C. H. Stillwell.

Keeney, R.L., R.H. Mohring, H. Otway, F.J. Radermacher and M.M. Richter. 1988. Decision aspects of advanced decision support systems. In: Decision Support Systems, vol. 4, pp.381-508.

McIsaac, G.F., J.K. Mitchsll, and M.C. Hirschi. 1987a. Slope steepness effects on soil loss from disturbed lands. Trans. ASAE 30:1005-1013.

Mclean, E. and H.G. Sol (Eds.) 1986. Decision Support Systems: A decade in perspective. North Holland, Amsterdam.

Mitasova, H., 1993, Surfaces and modeling, Grassclippings 7: 18-19

Nelson, H., and C. Arnold, 1995. The Chester Creek Watershed Project: A Progress Report in a Unique Natural Resources Management Partnership. University of Connecticut Cooperation Extension System, Haddam, Connecticut, 15p.

Newell, A. and H.A. Simon. 1972. Human problem solving. Prentice Hall, Englewood Cliffs.

Newell, C., H. Rifai, and P. Berdient, 1992. Charaterization of Nonpoint sources and Loadings to Galveston Bay. The Galveston Bay National Estuary Program, Texas. March, 219p

Nijkamp, P. 1979. Multidimensional Spatial Data and Decision Analysis. Wiley, New York.

Nijkamp, P., Rietveld, P., Voogd, H. 1990. Multicriteria evaluation in physical planning, North Holland, Amsterdam

Nofziger, D.L., and A.G. Hornsby, 1986. A micocomputer-based management tools for chemical movement in soil. Applied Agricultural Research 1(1):50-56.

Nyerges, T., 1993, Understanding the scope of GIS: its relationship to environmental modeling, In: M. Goodchild, B.Parks, L. Steyaert (Eds.) Environmental Modeling Within GIS, Oxford University Press, Oxford, pp. 75-93

Pereira, J.M.C., Duckstein, L. 1993, A multiple criteria decision-making approach to GIS-based land suitability analysis, International Journal of Geographical Information Systems, 7: 407-424.

Remus, V.E. 1984. An empirical investigation of the impact of graphical and tabular data, presentations on decision making. Management Science, vol. 305, pp. 533-542.

Renard, K.G., G.R. Foster, G.A. Weesies, D.K. McCool, and D.C. Yoder, coordinators. 1997. Predicting Soil Erosion by Water: A Guide to Conservation Planning With the Revised Universal Soil Loss Equation (RUSLE). U.S. Department of Agriculture, Agriculture Handbook No. 703.

Robinove, C.J. 1981. The Logic of Multispectral Classification and Mapping of Land. Remote Sensing of Environment, Vol 11, pp. 231-244.

Rosenthal, R.E. 1985. Concepts, Theory and Techniques: Principles of Multiobjective Optimization, Decision Sciences, 16(2): 133-152.

Saaty, T.L. 1977. A Scaling Method for Priorities in Hierarchical Structures, Journal of Mathematical Psychology, 15, 234-281.

Schaller, J. 1990, Geographical Information System applications in Environmental Impact Assessment, in H.J. Scholten, J.C.H. Stillwell (Eds.) Geographical Information Systems for Urban and Regional Planning, Kluwer, Dordrecht, 107–117.

Shiffer, M. J. 1992. Woeards a collaborative planning system, Environment and Planning B, 19(6), 109-122

Scholten, H., Stilwell, J.C.H. 1990, Eds. Geographical Information Systems and urban and regional planning, Kluwer, Dordrecht.

Simon, H.A. 1960. The new science of management decision. Harper and Row, New York.

Soils Conservation Service. 1987. Soil Survey of Pike County, Indiana. Washington, D.C.: United States Department of Agriculture.

Sprague, R. H. and H.J. Watson (Eds) 1986. Decision Support Systems: Putting theory into practice. Prentice Hall, New Jersey.

Squillace, M., and E. Dotter. 1990. The Strip Mining Handbook. Environmental Policy Institute and Friends of the Earth: Washington, D.C.

Starr, M. K., M. Zeleny. 1977. Multiple Criteria Decision Making. North-Holland, Amsterdam

Subra, W., and J. Waters, 1993. Identification and Charaterization of Nonpoint Source Environmental Pollution by Remote Sensing Techniques. Commercial Remote Sensing Program Office. Natural Aeronautics and Space Administration. Stennis Space Center. Mississippi, 42p.

Townshend, JR. G. 1991. Environmental databases and GIS. In: Maguire, D.J., M.F. Goodchild, and D.W. Rhind(eds.) Geographic Information Systems: Principles and Applications. Longman, London, pp. 201-16, Vol 2.

Tufte, E.R. 1985. The visual display of quantitative information. Graphics Press, Cheshire, Connecticut.

United States Department of Commerce, Bureau of the Census. 1981. 1980 census of polulation and housing. PHC80-V-16, 31pp., illus.

Ventura, S.J., N.R. Chrisman, K. Connors, R.F. Gurda, and R.W. Martin, 1988. A land information system for soil erosions control planning. Journal of Soil and Water Conservation 43(30: 230-233.

Vieux, B. 1991, Geographic information systems and no-point source water quality and quantity modeling, Hydrological Processes 5: 101-113

Wagenet, R.J., and J.L. Huston, 1989. LEACHM: Leaching Estimation and Chemistry Model - A process based model of water and solute movement, transformations, plant uptake, and chemical reactions in the unsaturated zone, Ithaca: Water Resources Institute, Cornell University.

Wischmeier, W.H., and D.D. Smith, 1978. Predicting Rainfall Erosion Losses: A Guide to Conservation Planning. Washington, D.C.: U.S. Department of Agriculture, Agriculture Handbook No. 537.

Wright, J.R., Buehler, K.A. 1993. Probabilistic inferencing and spatial decision support systems, in J.R. Wright, L.L. Wiggins, K.J. Ravinder, T.J. Kim (Eds.) Expert Systems in Environmental Planning. Springler - Verlag, Berlin, 119-144.

Wu, T.H., A.T. Stadler and C. Low, 1996. Erosion and Stability of a Mine Soil : Journal of Geotechnical Engineering, June 1996, Vol. 122: 445-53.

Young, R.A., C.A. Onstad, D.D. Bosch and W.P. Anderson, 1987. AGNPS, Agriculture Nonpoint Source Pollution Model: A large watershed analysis tool. Washington D.C.: U.S. Department of Agriculture, Agricultural Research Service Conservation Research Report No. 35.

Von Winterfelt, D., W. Edwards. 1986. Decision Analysis and Behavioral Research, Cambridge University Press, Cambridge.

Voogd, H., 1983. Multicriteria Evaluation for Urban and Regional Planning, Pion, London.

Zeleny, M. 1982, Multiple Criteria Decision Making, McGraw-Hill, New York.












A: AMLs for LS Value Calculation

Cumulative Downhill Slope Length AMLs



sl.aml: Core program, calls others as needed.

fil.aml: Fills depressions.

dn_slope.aml: Calculates downhill slope angle

high_pts.aml: Identifies high points from the DEM.

s_length.aml: Calculates cumulative downhill slope length.

ls.aml: Calculates USLE LS factor values.


To run the program, just run sl.aml with the following args:


/* Usage: sl <elevation grid> <slope length grid> <LS value grid>

/* {FEET | METER} {cutoff value} {slope angle grid}


(elevation grid) is your input DEM

(slope length grid) is the name of the output slope length grid

(LS value grid) is the name of the output LS values grid

(feet/meter) is the measurement unit used in your DEM (an optional input)

(cutoff value) is the slope change required to cause deposition rather than erosion. The default is 0.5

(slope angle grid) an optional output maximum downhill slope angle grid



/* sl.aml *****************************************************************

/* The input : a grid of elevations.

/* The elevations must be in the same units as the horizontal distance.

/* The unit of measurement for the elevation grid.

/* The change in slope(as a %) that will cause the slope length

/* calculation to stop and start over.

/* The output: a grid of cumulative slope lengths,

/*: a grid of LS values for the soil loss equation,

/*: an optional grid of down hill slope angle.

/* Usage: sl <elevation grid> <slope length grid> <LS value grid>

/* {FEET | METER} {cutoff value} {slope angle grid}

&args sl_elev sl_out LS_out grd_units cutoff_value sl_angle

/* Convert user input to capital letters **********************************

&sv .grid_units = [translate %grd_units%]

/* Set default cutoff value if necessary **********************************

&if [null %cutoff_value%] or [index %cutoff_value% #] eq 1 &then

&sv .slope_cutoff_value = .5


&sv .slope_cutoff_value = [calc [value cutoff_value] / 100]

/* Set the grid environment *********************************************

setcell %sl_elev%

setwindow %sl_elev%

&describe %sl_elev%

/* Create a depressionless DEM ******************************************

&run fil.aml %sl_elev% sl_DEM

/* Create an outflow direction grid **************************************

sl_outflow = flowdirection(sl_DEM)

/* Create a possible inflow grid ******************************************

sl_inflow = focalflow(sl_DEM)

/* Calculate the degree of the down slope for each cell ******************

&run dn_slope.aml sl_DEM sl_slope

/* Calculate the slope length for each cell *******************************

&sv cell_size = [show scalar $$cellsize]

&sv diagonal_length = 1.414216 * %cell_size%

/* Convert to radians for cos--to calculate slope length

if (sl_outflow in {2, 8, 32, 128})

sl_length = %diagonal_length% div cos(sl_slope div deg)


sl_length = %cell_size% div cos(sl_slope div deg)


/* Set the window with a one cell buffer to avoid NODATA around the edges **

setwindow [calc [show scalar $$wx0] - [show scalar $$cellsize]] ~

[calc [show scalar $$wy0] - [show scalar $$cellsize]] ~

[calc [show scalar $$wx1] + [show scalar $$cellsize]] ~

[calc [show scalar $$wy1] + [show scalar $$cellsize]]

/* Create a new flow direction grid with a one cell buffer ***************

sl_flow = sl_outflow

kill sl_outflow

sl_outflow = con(isnull(sl_flow), 0, sl_flow)

kill sl_flow

/* Create a grid of the high points and NODATA *************************

/* The high points will have 1/2 their cell slope length for VALUE ***

&run high_pts.aml

/* Create a grid of high points and 0's **********************************

/* This will be added back in after the slope lengths for all other ****

/* cells has been determined for each iteration ***********************

sl_high_pts = con(isnull(sl_cum_l), 0, sl_cum_l)

/* Calculate the cumulative slope length for every cell ******************

&run s_length.aml

/* Calculate the LS value for the soil loss equation **********************

&run ls.aml

/* Reset window and mask **********************************************

setwindow %sl_elev%

setmask %sl_elev%

setmask off

/* Kill temporary grids **************************************************

kill sl_(!DEM outflow inflow length high_pts!)

/* Set the output grid names to the user input **************************

rename sl_cum_l %sl_out%

rename ls_amount %LS_out%

&if [null %sl_angle%] &then

kill sl_slope


rename sl_slope %sl_angle%







/* fil.aml ****************************************************************

/* The input : a grid of elevations

/* The output: a depressionless elevation grid.

/* Usage: fil

&args DEM_grid fil_DEM

/* Copy original elevation grid *******************************************

%fil_DEM% = %DEM_grid%

/* Create a depressionless DEM grid *************************************

finished = scalar(0)

&do &until [show scalar finished] eq 1

finished = scalar(1)

rename %fil_DEM% old_DEM

if (focalflow(old_DEM) eq 255) {

%fil_DEM% = focalmin(old_DEM, annulus, 1, 1)

test_grid = 0


else {

%fil_DEM% = old_DEM

test_grid = 1



kill old_DEM

/* Test for no more sinks filled ************************************


finished {= test_grid


kill test_grid








/* dn_slope.aml *********************************************************

/* The input : a grid of elevations with no depressions

/* The output: a grid of down slopes in degrees.

/* Usage: dn_slope

&args DEM_grid down_slope

/* Compute the outflow direction for each cell ***************************

dn_outflow = flowdirection(%DEM_grid%)

/* Set the window with a one cell buffer ********************************

&describe %DEM_grid%

setwindow [calc [show scalar $$wx0] - [show scalar $$cellsize]] ~

[calc [show scalar $$wy0] - [show scalar $$cellsize]] ~

[calc [show scalar $$wx1] + [show scalar $$cellsize]] ~

[calc [show scalar $$wy1] + [show scalar $$cellsize]]

/* Create a DEM with a one cell buffer ***********************************

/* This prevents NODATA being assigned to the edge cells that flow

/* off the DEM. Cells that flow off the DEM will get 0 slope ************

dn_buff_DEM = con(isnull(%DEM_grid%), focalmin(%DEM_grid%), %DEM_grid%)

/* Calculate the down slope in degrees **********************************

&sv cell = [show scalar $$cellsize]

/* The () pervent problems that occur with using whole numbers ****

&sv cell_size = (1.00 * %cell%)

&sv diagonal_length = (1.414216 * %cell_size%)

/* find down slope cell and calculate slope ***************************

if (dn_outflow eq 64)

%down_slope% = deg * atan((dn_buff_DEM - dn_buff_DEM(0, -1)) div ~


else if (dn_outflow eq 128)

%down_slope% = deg * atan((dn_buff_DEM - dn_buff_DEM(1, -1)) div ~


else if (dn_outflow eq 1)

%down_slope% = deg * atan((dn_buff_DEM - dn_buff_DEM(1, 0)) div ~


else if (dn_outflow eq 2)

%down_slope% = deg * atan((dn_buff_DEM - dn_buff_DEM(1, 1)) div ~


else if (dn_outflow eq 4)

%down_slope% = deg * atan((dn_buff_DEM - dn_buff_DEM(0, 1)) div ~


else if (dn_outflow eq 8)

%down_slope% = deg * atan((dn_buff_DEM - dn_buff_DEM(-1, 1)) div ~


else if (dn_outflow eq 16)

%down_slope% = deg * atan((dn_buff_DEM - dn_buff_DEM(-1, 0)) div ~


else if (dn_outflow eq 32)

%down_slope% = deg * atan((dn_buff_DEM - dn_buff_DEM(-1, -1)) div ~



%down_slope% = 0.00


/* Reset old settings *****************************************************

setwindow %DEM_grid%

/* Clip the output grid ***************************************************

dn_slope = %down_slope%

kill %down_slope%

rename dn_slope %down_slope%

/* Kill the temporary grids **********************************************

kill dn_buff_DEM

kill dn_outflow







/* high_pts.aml **********************************************************

/* This is not a stand alone AML ****************************************

/* Grids used from sl.aml:

/* sl_outflow

/* sl_inflow

/* sl_slope

/* Grid produced for sl.aml:

/* sl_cum_l

/* Find the high points and set value to half their own slope length *****

/* A high point is a cell that has no points flowing into it or if the only

/* cells flowing in to it are of equal elevation. ***************************

if ((sl_inflow && 64) and (sl_outflow(0, -1) eq 4))

sl_cum_l = setnull(1 eq 1)

else if ((sl_inflow && 128) and (sl_outflow(1, -1) eq 8))

sl_cum_l = setnull(1 eq 1)

else if ((sl_inflow && 1) and (sl_outflow(1, 0) eq 16))

sl_cum_l = setnull(1 eq 1)

else if ((sl_inflow && 2) and (sl_outflow(1, 1) eq 32))

sl_cum_l = setnull(1 eq 1)

else if ((sl_inflow && 4) and (sl_outflow(0, 1) eq 64))

sl_cum_l = setnull(1 eq 1)

else if ((sl_inflow && 8) and (sl_outflow(-1, 1) eq 128))

sl_cum_l = setnull(1 eq 1)

else if ((sl_inflow && 16) and (sl_outflow(-1, 0) eq 1))

sl_cum_l = setnull(1 eq 1)

else if ((sl_inflow && 32) and (sl_outflow(-1, -1) eq 2))

sl_cum_l = setnull(1 eq 1)

/* Flat high points get 0 instead of 1/2 slope length ******************

else if (sl_slope eq 0)

sl_cum_l = 0.0


sl_cum_l = 0.5 * sl_length








/* s_length.aml **********************************************************

/* This is not a stand alone AML ****************************************

/* Grids used from sl.aml:

/* sl_inflow

/* sl_outflow

/* sl_slope

/* sl_length

/* sl_high_pts

/* sl_DEM

/* Grid produced for sl_aml:

/* sl_cum_l

/* Pervents the testing of the buffer cells *******************************

setmask sl_DEM

/* Calculate the cumulative slope length for each cell *******************

nodata_cell = scalar(1)

&sv finished = .FALSE.

&do &until %finished%

rename sl_cum_l sl_out_old

&sv counter = 0

&do counter = 1 &to 8

/* Set the varibles for the if that follows

&select %counter%

&when 1


&sv from_cell_grid = sl_north_cell

&sv from_cell_direction = 4

&sv possible_cell_direction = 64

&sv column = 0

&sv row = -1


&when 2


&sv from_cell_grid = sl_NE_cell

&sv from_cell_direction = 8

&sv possible_cell_direction = 128

&sv column = 1

&sv row = -1


&when 3


&sv from_cell_grid = sl_east_cell

&sv from_cell_direction = 16

&sv possible_cell_direction = 1

&sv column = 1

&sv row = 0


&when 4


&sv from_cell_grid = sl_SE_cell

&sv from_cell_direction = 32

&sv possible_cell_direction = 2

&sv column = 1

&sv row = 1


&when 5


&sv from_cell_grid = sl_south_cell

&sv from_cell_direction = 64

&sv possible_cell_direction = 4

&sv column = 0

&sv row = 1


&when 6


&sv from_cell_grid = sl_SW_cell

&sv from_cell_direction = 128

&sv possible_cell_direction = 8

&sv column = -1

&sv row = 1


&when 7


&sv from_cell_grid = sl_west_cell

&sv from_cell_direction = 1

&sv possible_cell_direction = 16

&sv column = -1

&sv row = 0


&when 8


&sv from_cell_grid = sl_NW_cell

&sv from_cell_direction = 2

&sv possible_cell_direction = 32

&sv column = -1

&sv row = -1




/* Test for possible flow source cell

if (not(sl_inflow && %possible_cell_direction%))

%from_cell_grid% = 0

/* Test for flow source cell

else if (sl_outflow(%column%, %row%) <> %from_cell_direction%)

%from_cell_grid% = 0

/* Test flow source cell for nodata

else if (isnull(sl_out_old(%column%, %row%)))

%from_cell_grid% = setnull(1 eq 1)

/* Test current cell slope against cutoff value

else if (sl_slope >= (sl_slope(%column%, %row%) * %.slope_cutoff_value%))

%from_cell_grid% = sl_out_old(%column%, %row%) + ~

sl_length(%column%, %row%)


%from_cell_grid% = 0




/* Select the longest slope length

sl_cum_l = max(sl_north_cell, sl_NE_cell, sl_east_cell, sl_SE_cell, ~

sl_south_cell, sl_SW_cell, sl_west_cell, sl_NW_cell, ~


/* Kill the temporary grids

kill (!sl_north_cell sl_NE_cell sl_east_cell sl_SE_cell ~

sl_south_cell sl_SW_cell sl_west_cell sl_NW_cell!)

kill sl_out_old

/* Test for the last iteration filling in all cells with data

&sv no_data = [show scalar nodata_cell]

&if %no_data% eq 0 &then

&sv finished = .TRUE.

/* Test for any nodata cells

if (isnull(sl_cum_l) and not isnull(sl_outflow))

sl_nodata = 1


sl_nodata = 0


nodata_cell = scalar(0)


nodata_cell }= sl_nodata


kill sl_nodata



/* Reset original window and clip the cumulative slope length grid *****

setwindow sl_DEM

rename sl_cum_l sl_out_old

sl_cum_l = sl_out_old

kill sl_out_old





/* ls.aml *****************************************************************

/* This is not a stand alone AML ****************************************

/* Grids used from sl.aml:

/* sl_cum_l

/* sl_slope

/* Grid produced for sl.aml:

/* ls_amount

/* Convert meters to feet if necessary ***********************************

&if %.grid_units% eq METERS &then

ls_length = sl_cum_l div 0.3048


ls_length = sl_cum_l

/* Calculate LS for the soil loss equation ********************************

/* For cells of depostion

if (ls_length eq 0)

ls_amount = 0

/* For slopes 5% and over

else if (sl_slope >= 2.862405)

ls_amount = pow((ls_length div 72.6), 0.5) * ~

(65.41 * pow(sin(sl_slope div deg), 2) + ~

4.56 * sin(sl_slope div deg) + 0.065)

/* For slopes 3% to less than 5%

else if ((sl_slope >= 1.718358) and (sl_slope < 2.862405))

ls_amount = pow((ls_length div 72.6), 0.4) * ~

(65.41 * pow(sin(sl_slope div deg), 2) + ~

4.56 * sin(sl_slope div deg) + 0.065)

/* For slopes 1% to less than 3%

else if ((sl_slope >= 0.572939) and (sl_slope < 1.718358))

ls_amount = pow((ls_length div 72.6), 0.3) * ~

(65.41 * pow(sin(sl_slope div deg), 2) + ~

4.56 * sin(sl_slope div deg) + 0.065)

/* For slopes under 1%


ls_amount = pow((ls_length div 72.6), 0.2) * ~

(65.41 * pow(sin(sl_slope div deg), 2) + ~

4.56 * sin(sl_slope div deg) + 0.065)


/* kill temporary grids **************************************************

arc kill ls_length





( Modified from http://www.cage.curtin.edu.au/~rhichey/aml.html)

B: Data Flow Chart