Opened 20 months ago

Closed 6 weeks ago

Last modified 5 weeks ago

#2776 closed project-task (completed)

Get the SWAT model working with data for the Pang River Basin

Reported by: ass98av Owned by: pmcguire
Component: Land Surface Modelling Keywords: SWAT, hydrology, Pang River, soil data,
Cc: Platform: Other
UM Version:


Can you get the SWAT model (Soil Water Assessment Tool) working with our data for the Pang River Basin?

Change History (12)

comment:1 Changed 20 months ago by pmcguire

I have copied the data from Ian Davenport's external hard disk.

I have tried to open the Excel spreadsheets for the soil data, but these had a lot of links with absolute paths to other Excel files.
I will try in the future to resolve this issue, but in the meantime, I have converted the Excel spreadsheets to have no links, just values of the variables.

I have set up QSWAT and ArcSWAT on my PC, the former being with QGIS and the latter with ArcGIS.

I have run an ArcSWAT simulation for the Pang, using the 10 meter downsampled DEM, and NSRI soils (with improper soil class labels), and with Weather Generator data, as well as with a land cover map for the Pang. The biggest issue is to get the proper soil physical data.

I figured out how to edit the Microsoft Access database for the Usersoils. So I will try to average Ian Davenport's Excel spreadsheets for the soil properties of the Pang over the NSRI soil regions..

comment:2 Changed 20 months ago by pmcguire

  • Status changed from new to accepted

comment:3 Changed 19 months ago by pmcguire

I figured out how to do approximately what we want:
—I used a macro somebody wrote for Excel which exports all the tabs of an Excel Workbook to Text files.
—So far, I have read in the 6 layers of Bulk Density for the Pang into ArcGIS with the TXT→Raster tool,
—then I set the Geographic Spatial Reference System to IGS08 for each of the new rasters.
—And finally I used the Zonal Mean from the ArcGIS Spatial Analyst with the NSRI soilscapes class labels to make a TXT table mean-value for each soilscape label.
—I guess I need to repeat this for all the SWAT Variables in Ian's Excel Spreadsheet, or somehow write a program to do it.
—Then I have to write a script to merge all the TXT table mean values into the format for SWAT.

comment:4 Changed 19 months ago by pmcguire

The latest status on this, as reported to the PI, is that I have written most of a Python script in the ArcGIS environment to make a table of spatially-averaged soil properties for the Pang, using Ian's soil-properties as text files exported from his Excel Spreadsheets, and the NSRI soilscapes clay label maps for the regions of spatial averaging within the Pang river basin.

Next steps include:

Finishing this script so that it can merge this table with the pre-existing SWAT soils table (in Microsoft Access format).
Fixing a couple of corrupted text files. These corrupted text files are probably the result of the lines being too long in Excel with long-format floats.
Trying a test SWAT model with the updated SWAT soils table.


comment:5 Changed 18 months ago by pmcguire

  • Type changed from task to project-task

comment:6 Changed 18 months ago by pmcguire

The latest status is that, I have mostly automated the process of making a table of spatially-averaged soil properties for the Pang River basin, using Ian Davenport's soil-properties text files exported from his Excel spreadsheets, and I am now trying to use this table in the SWAT geodatabase for running a SWAT model.

The Python/Arcpy?/ArcGIS script currently stops short of merging it into the SWAT soils table. I did this last step of merging by hand, after creating most of the entries for the table as a separate table (for merging). After the manual merging (with the ArcGIS append function), I manually edited the merged table in Microsoft access to fill in missing values (partly by putting zeroes in the right place, and partly by filling constant values as deemed appropriate) for various tabular field columns. These manual changes can be updated later.

The problem with corrupted text files turned out to be DIV0 entries in the text tables. These division-by-zero entries are not accepted by the AsciiToText? conversion function in ArcGIS. These division-by-zero entries were caused by the 1/(Organic Material) and the ln(Organic Material) terms in the Wösten et al. pedotransfer functions used to compute the van Genuchten soil-hydraulics (alpha and n and USLE) parameters, and the fact that there is only one decimal place in the Organic Material tenths-of-a-percent values for a few grid cells in the Pang River basin from the SoilGrids? 250-meter database files for the lowest two layers of the 6 layers of soil). This latter fact meant that anything lower than 0.1% was being rounded down to 0.0% Organic Matter. I have chosen to fix this by replacing the few 0.0% Organic Matter grid cells (for the lowest two soil layers) in the Pang Basin Excel Spreadsheets with 0.02% Organic Matter instead.

I also had to use the 'repair' function for installing the ArcSWAT software, as the ArcGIS GUI for ArcSWAT wasn't really filling out all the menu options and it wasn't allowing me to create a new ArcSWAT project.

comment:7 Changed 18 months ago by pmcguire

  • Cc lecSS13 added

comment:8 Changed 18 months ago by pmcguire

  • Cc a.verhoef@… removed

comment:9 Changed 18 months ago by pmcguire

  • Cc ass98av added; lecSS13 removed

comment:10 Changed 18 months ago by pmcguire

The latest status is that I have been able to run the SWAT model (with ArcSWAT in ArcGIS) with the SWAT2012 Microsoft Access database updated to include the spatially-averaged soil physical properties for the Pang River basin (west of Reading). These soil physical properties were provided by Ian Davenport and Anne Verhoef.

To get the SWAT model to run with this updated SWAT2012 usersoil database, I had to shorten the long names I had given each of the 11 different Pang river-basin soils, and I had to fill in missing entries (for example for layers 7-10) with zeroes.

The next steps include validating the setup of this model run — the database entries for each of the soils might need some tuning/adjusting for example, and I need to use the right weather generator or other weather data, and I need to check the values I chose in some of the menu options for ArcSWAT.

comment:11 Changed 6 weeks ago by pmcguire

  • Resolution set to completed
  • Status changed from accepted to closed

comment:12 Changed 5 weeks ago by pmcguire

  • Cc ass98av removed
  • Reporter changed from pmcguire to ass98av
Note: See TracTickets for help on using tickets.