[GRASS-SVN] r42143 - grass-addons/LandDyn/r.landscape.evol.py

svn_grass at osgeo.org svn_grass at osgeo.org
Fri May 7 16:35:29 EDT 2010


Author: isaacullah
Date: 2010-05-07 16:35:28 -0400 (Fri, 07 May 2010)
New Revision: 42143

Modified:
   grass-addons/LandDyn/r.landscape.evol.py/r.landscape.evol.py
Log:
Adding a code snippet to identify if r.watershed needs flag -f to run MFD. Use flag if needed (grass 6.5 , proposed for grass 6.4.1), or do not use any flag if not needed (GRASS7). 

Modified: grass-addons/LandDyn/r.landscape.evol.py/r.landscape.evol.py
===================================================================
--- grass-addons/LandDyn/r.landscape.evol.py/r.landscape.evol.py	2010-05-07 11:39:54 UTC (rev 42142)
+++ grass-addons/LandDyn/r.landscape.evol.py/r.landscape.evol.py	2010-05-07 20:35:28 UTC (rev 42143)
@@ -432,7 +432,10 @@
         os.remove(os.sep + 'var' + os.sep +'tmp' + os.sep + 'STREAM*')
     else:
         grass_print('Using r.watershed to calculate overland flow accumulation per cell (number of cells uplsope from each cell)')
-        grass_com('r.watershed --quiet -fa elevation=' + old_dem + ' accumulation=' + flowacc + ' convergence=5')
+        if '<flag name="f">' in out2var('r.watershed --interface-description'):
+            grass_com('r.watershed --quiet -fa elevation=' + old_dem + ' accumulation=' + flowacc + ' convergence=5')
+        else:
+            grass_com('r.watershed --quiet -a elevation=' + old_dem + ' accumulation=' + flowacc + ' convergence=5')
 
     grass_print('\n*************************\n Year %s ' % o + 'step 3 of 7: calculating basic sediment transport rates\n*************************\n')  
     error_message = '\n############################################################\n !!!!!!!!!YOU MUST SELECT ONLY ONE TYPE OF EROSION!!!!!!!!!!!\n ############################################################ \n \n'



More information about the grass-commit mailing list