Home

Awesome

GSFLOW-GRASS

Binder

Code updates and deprecation

Both GSFLOW and GRASS have advanced in version since the publication of GSFLOW-GRASS, and this code base has not been updated to keep pace. Note the very specific versions below.

Anyone who would like to bring GSFLOW-GRASS up-to-date: Please do use this as a starting point. We invite you to fork and update and contact us.

Introduction

Python toolkit using GRASS GIS to generate inputs for the USGS hydrologic model "GSFLOW".

GSFLOW is the US Geological Survey's combined groundwater (MODFLOW) and surface water (PRMS) model. GSFLOW-GRASS builds a stream network and its "hydrologic response units" -- here, watershed sub-basins -- that combine to form a surface-water hydrologic network (PRMS). It then links these to a regular finite difference grid to compute groundwater flow using MODFLOW.

These instructions are meant to take a user familiar with computers but new to (or a beginner with) GSFLOW and GRASS GIS through the basics of how to get GSFLOW-GRASS to work. Please leave a message if you have trouble working with GSFLOW-GRASS; your comments could assist both you and the more general improvement of this documentation.

When you use GSFLOW-GRASS, please cite:

Ng, G.-H.C., Wickert, A.D., Somers, L.D., Saberi, L., Cronkite-Ratcliff, C., Niswonger, R.G., and McKenzie, J.M., 2018, GSFLOW-GRASS v1.0.0: GIS-enabled hydrologic modeling of coupled groundwater–surface-water systems: Geoscientific Model Development, doi:10.5194/gmd-11-4755-2018.

In addition, please contact us if you have questions or suggestions!

This manual is written in the style of a quick(-ish) start guide that allows users to get GSFLOW up and running for their target watershed using mostly default options in our toolkit and without modifying GRASS-GIS or Python scripts. Additional customization is possible by more advanced users by editing our GRASS GIS and input file building scripts to extend the set of GSFLOW parameters that may be set through GSFLOW-GRASS.

Required and Optional Software

Required:

Optional:

Installing GSFLOW

Download and install GSFLOW 1.2.0 or 1.2.2

Obtain the source code for GSFLOW 1.2.0 from: https://github.com/UMN-Hydro/GSFLOW-1.2.0, compile and install it. For windows, the pre-compiled executable file for GSFLOW 1.2.2 will be downloadable soon (if not already) from the USGS website: https://water.usgs.gov/ogw/gsflow/#downloads. Note that GSFLOW-GRASS is not fully compatible with GSFLOW 1.2.1.

Installing Python

GSFLOW-GRASS has been tested on Python 2.7, and should work (with a few possible changes) on future versions of Python 2.X. It has not been tested on Python 3.X.

In order to run properly, GSFLOW-GRASS requires the following Python modules (in addition to those that come with GRASS GIS v7.6, above.):

For users who are new to Python, follow these directions to install the Python interpreters onto your computer.

Linux

Use your package manager to download and install the required Python packages. For Debian/Ubuntu, it will be something like:

# Basic packages
sudo apt-get install \
python python-numpy python-scipy \
python-setuptools python-matplotlib \
python-gdal

# pip (recommended for automatic installs via setuptools)
sudo apt-get install python-pip

# iPython console (very useful, optional)
sudo apt-get install ipython

# Sypder IDE (popular interface, optional)
sudo apt-get install spyder

# OSGEO / GDAL
sudo apt-get install python-gdal

Windows and Mac

We recommend using Anaconda, which comes with most of the Python modules that one need for the execution of the GSFLOW-GRASS codes: it includes numpy (computations and matrices), matplotlib (plotting), and pandas (database management), but does not include osgeo (geospatial libraries, labeled ``gdal'').

Download Anaconda for Python 2.7+ from https://www.anaconda.com/download. When you install it, you are given the option to have it become your system-wide Python install in a set of two check boxes. We recommend that you do so (they may be by default not checked), but GSFLOW-GRASS will still run fine if they are not. These boxes make your whole system recognize Anaconda as your Python install, rather than limiting it to its enclosed environment.

Additional modules, such as OSGEO/GDAL may be installed with either "conda" (the Anaconda package manager) or "pip" (the Python package manager). For the sake of an example, with numpy (already installed), you may type one of the following:

# Anaconda
conda install numpy
# Pip
pip install numpy

We recommend that if you use Anaconda, that you use the conda comands to maintain a consistent Python environment.

If you have installed Anaconda without ticking the system-wide install check box, you need to use "conda" through the Anaconda Prompt rather than the standard terminal: After installing Anaconda, go to the Windows start menu, and search programs and files for "Anaconda Prompt". If you have installed Ananconda system-wide, you may do this through either the Ananconda prompt or the standard DOS prompt (command line / terminal). Installing osgeo/gdal downgrades a few packages (e.g., HDF libraries), and requries that you reinstall numpy:

# In the Anaconda Prompt
# Or in either this or the DOS prompt if you have installed
# Anaconda system-wide
conda install gdal
conda upgrade numpy

You may receive a message saying that you don't have the necessary permissions. If this happens, on-screen directions will tell you how to proceed. Follow them, and then enter the above commands.

Anaconda also comes with the Spyder development environment, which is a helpful graphical interface that can be used to individually run or edit the Python codes.

Installing GRASS GIS

Download and install GRASS GIS 7.6

(GSFLOW-GRASS may work on the development version of GRASS GIS, v7.7 at the time of writing, but this is untested.)

Install precompiled binaries

("Precompiled binary " = the normal kind of software that you download and just works)

Option 1: From the GRASS GIS website (Windows, Mac, or Linux)

Go to https://grass.osgeo.org/download/software/ and download GRASS GIS 7.6 (new stable version) for your appropriate OS.

For Mac, follow the instructions to install the "framework packages" after following the links from the main download page. Note that the most recent stable version of GRASS GIS for Mac is 7.4. This is outdated, but should still be compatible with the modern GSFLOW-GRASS. Please contact the GSFLOW-GRASS developers with specific errors if this does not work!

From the package manager (Linux)

For Ubuntu:

sudo apt-get install grass

Compiling from source

Note that it can still help to obtain the dependencies via the package manager by installing the older version of GRASS:

sudo apt-get install grass

If you choose to compile GRASS GIS from source, we have used these configuration flags many times on Ubuntu Linux (configure_ubuntu.sh):

CFLAGS="-O2 -Wall" LDFLAGS="-s" ./configure \
--enable-largefile=yes \
--with-nls \
--with-cxx \
--with-readline \
--with-pthread \
--with-proj-share=/usr/share/proj \
--with-geos=/usr/bin/geos-config \
--with-wxwidgets \
--with-cairo \
--with-opengl-libs=/usr/include/GL \
--with-freetype=yes --with-freetype-includes="/usr/include/freetype2/" \
--with-postgres=yes --with-postgres-includes="/usr/include/postgresql" \
--with-sqlite=yes \
--with-mysql=yes --with-mysql-includes="/usr/include/mysql" \
--with-odbc=no \
--with-netcdf=/usr/bin/nc-config

Installing FFMPEG

(Optional)

In order to make movies, you need an active copy of ffmpeg on your computer. For Linux, this is simple:

sudo apt-get install ffmpeg

For Windows or Mac, download via https://www.ffmpeg.org/download.html. You can select the correct version for your operating system under “More downloading options” and “Get the packages” and follow the links therein. Ffmpeg is installed by adding the executable file to your system's or user path variable. Windows installation instructions can be found here https://www.wikihow.com/Install-FFmpeg-on-Windows.

Installing all required packages by creating a docker image

You can alternatively install all above mentioned packages and libraries by creating a docker image.

Linux

Take a shell and cd to folder GSFLOW-GRASS/gsflow_grass_docker:

cd GSFLOW-GRASS/gsflow_grass_docker

This folder includes a docker-compose.yml file and the folder gsflow_grass with the required Dockerfile and additional scripts called by the Dockerfile.

Run docker-compose build in order to create the image:

docker-compose build

Then run docker-compose up in order to run the image:

docker-compose up

Once running the image, you will get the following message:

You need to run grass from a shell created by a docker exec invocation

Take a shell in the image as following:

First run docker ps in order to see the CONTAINER ID locally obtained:

docker ps

Then, copy this id in the following command:

docker exec -it CONTAINER ID bash

This will give you a shell where you can type grass in order to start the software.

Directory Structure

GSFLOW-GRASS has four main directories:

In addition, the "figures" directory holds images used for this README.

<!--- This seems like a lot of work to maintain when they could just look at the actual directory structure. \todo{This isn't actual directory structure now. Change after finalizing. Will need to make sure everything still runs, i.e., can find dependent files etc} * `GSFLOW-GRASS -> domain_builder` GRASS GIS Python scripts to build the watershed and MODFLOW geometries * `GSFLOW-GRASS -> input_file_builder` Python scripts to create input files for GSFLOW, including the control file, paramers file for PRMS, and input file for MODFLOW (NWT) * `printGSFLOWControlfile.py` * `printPRMSparamfile.py` * `printMODFLOWInputs.py` * `createSpatialHydCond.py` * `printClimatehru.py` * `GSFLOW-GRASS -> Run ->` * `settings_template.ini` * `readSettings.py` * `goGSFLOW.sh` * `goGSFLOW.bat` * `GSFLOW-GRASS -> visualization` * `plotMODFLOW.py` * `plotGSFLOWTimeSeries.py` * `GSFLOWcsvTable.py` * `plotBasin.py` * `plotHRUvars.py` * `plotSegmentDischarge.py` * `GSFLOW-GRASS -> examples` Settings files for examples presented in GMD paper (Shullcas, Peru; Santa Rosa Island, California, USA; and Cannon River, Minnesota, USA) -->

Pre-processing

Generating inputs to GSFLOW using Python and GRASS

Step 1: Customize the Settings File

The Settings file holds user-defined information that defines how GSFLOW is set up and will run.

Use settings_template.ini in the 'Run' folder as a template for creating your own Settings File, which can have any name. Boldface options are required, and those that are Boldface and italic font is used to represent one of a set of options that must be given, depending on the value of a particular switch variable that is set. Each *.ini file includes:

"paths" section

OptionDescription
proj_nameLabel for the project; no spaces
gsflow_exeFull pathname for GSFLOW executable
gsflow_verGSFLOW version number
gsflow_path_simdirFull pathname for location where GSFLOW simulation<br>directory should go.

"elevation_inputs" section

OptionDescription
DEM_file_path_to_importDEM for import; if blank, assumes that DEM has already been imported<br>and that the associated initial calculations (flow accumulation, offmap<br> flow converted to NULL cells) have been completed.

"land-surface_inputs" section

Land-cover classes are set as integer values as follows:

  1. Bare soil
  2. Grasses
  3. Shrubs
  4. Trees
<!--- 4. Conifers (Unsure if this is implemented, or what "trees" vs. "conifers" means) PRMS implements four classes for the land cover (cov_type): 0=bare soil; 1=grasses; 2=shrubs; 3=trees; 4=coniferous See [here](https://water.usgs.gov/water-resources/software/PRMS/PRMS_tables_5.1.0.pdf) at p. 28 GSFLOW runs only with three classes, meaning 0=bare soil; 1=grasses; 2=shrubs; 3=trees See [here](https://raw.githubusercontent.com/UMN-Hydro/GSFLOW-1.2.0/master/doc/tm6d1_GSFLOW.pdf) at p. 165 In the Corine2000 dataset for land-use there are mixed forests (with both deciduous and evergreen trees) and coniferous forest, which are mostly evergreen. This is why PRMS includes this scaling of 3 and 4. Deciduous trees permit more water to reach the soil and enable a higher annual discharge. -->

Soil classes are set as integer values as well:

  1. Sand
  2. Loam
  3. Clay

GSFLOW-GRASS will obtain land-cover and soil inputs based on the first of these that is possible:

  1. Import the file given below; if this is empty
  2. Use the provided cov_type and soil_type (below) for spatially uniform properties; failing this
  3. Look for existing GRASS GIS rasters called "land_cover" and "soil"
  4. If all of this is not possible, then default values will be chosen: (cov_type = 0, soil_type=2)

Please note that for the raster values, the current implementation is crude: each HRU will import the value at the centroid of the HRU, instead of picking the modal value. This will require a new GRASS GIS module and/or an update to v.rast.stats.

OptionDescription
LAND_COVER_file_path_to_importName for GDAL-compliant raster of land-cover values<br> following the classes given above
SOIL_file_path_to_importName for GDAL-compliant raster of soil class values<br> following the classes given above
cov_typeUniform integer land-cover class. Leave this empty if you use a raster file at field "LAND_COVER_file_path_to_import"
soil_typeUniform integer soil class. Leave this empty if you use a raster file at field "SOIL_file_path_to_import"

"GRASS_core" section

OptionDescription
gisdbOptional: Directory that holds grass GIS locations.<br>Typically ~/grassdata<br>Not currently used.<br>(Will be used to run this while starting GRASS in the background)
versionOptional: GRASS GIS version number without any "." characters.<br>Option is not currently used.<br>(Will be used to run this while starting GRASS in the background)

"run_mode" section

OptionDescription
sw_1spinup_2restart1 for spin-up run starting from steady-state MODFLOW period<br>2 for restart run starting from states saved in the below files
init_PRMSfiloptional: for restart runs (sw_1spinup_2restart=2)<br>full pathname of file that is saved under ``save_vars_to_file''<br>in the GSFLOW control file during a previous run.<br>This entry won't be used (but should still be entered) if sw_1spinup_2restart=1<br>for startup runs.
init_MODfiloptional: for restart runs (sw_1spinup_2restart=2)<br>Full pathname of file that is saved under ``IWRT'' in the MODFLOW name file<br>during a previous run. This entry won't be used (but should still be entered)<br>if sw_1spinup_2restart= 1 for startup runs

"time" section

OptionDescription
start_dateStart date of simulation, format: YYYY-MM-DD
end_dateEnd date of simulation, format: YYYY-MM-DD
init_start_dateSet to the date from a spinup run to be used as initial conditions.<br>If empty, will start by performing its own spin-up.<br>Note that init_start_date is assumed to be 1 day previous to start_date.<br>Format: YYYY-MM-DD

"GRASS_drainage" section

OptionDescription
threshold_drainage_area_meters2Threshold drainage area in square meters at which flow is considered to create<br>a channel
MODFLOW_grid_resolution_metersTarget cell side length in meters for MODFLOW grid; side lengths will not be<br>exactly this long, as the nearest value to create an integer number<br>of cells in the domain will be chosen.
outlet_point_xPour point approximate x (Easting) position; the nearest point<br>along a stream segment is chosen as the true pour point.
outlet_point_yPour point approximate x (Easting) position; the nearest point<br>along a stream segment is chosen as the true pour point.

"GRASS_hydraulics" section

OptionDescription
icalcMethod selector for hydraulic geometry computation<br>0: Constant<br>1: Manning's equation with the wide channel assumption.<br>2: Manning's Equation.<br>3: Power-law relationship between width, depth, velocity,<br/>and discharge, per Leopold and Maddock (1953)<br>This input file is set up to work for icalc = 1.
channel_Mannings_nIn-channel flow resistance as a uniform value;<br>is overridden by the following Manning's n<br>options if they are chosen
channel_Mannings_n_gridGridded in-channel flow resistance GRASS raster data<br>source
channel_Mannings_n_vectorPoint-based in-channel flow resistance GRASS vector<br>data source
channel_Mannings_n_vector_colColumn in GRASS point data vector with Manning's n<br>values
overbank_Mannings_nOverbank flow resistance as a single value (not used)
channel_widthChannel width for calculating flow resistance.<br>Currently uniform across the watershed.<br>This is not particularly realistic; we suggest that users customize this based<br>on drainage area, dowsnream hydraulic geometry regime relationships, and/or<br>field-surveyed channel geometries.<br> This can be done using v.db.update inside GRASS, or by editing the exported<br>CSV file. Note that there are two widths on each segment: width1 (upstream)<br>and width2 (downstream); this option sets both, but they may be changed by<br>hand to produce gradually-varying hydraulic geometries.<br>This is overridden by either of the spatially distributed<br>options below.
channel_width_vectorGRASS vector data source with point measurements of<br>channel width; widths for each river segment are chosen<br>via a nearest-neighbor method.
channel_width_vector_colColumn in GRASS point data vector with channel<br>width values
floodplain_widthFloodplain width for when ICALC=3<br>Used with 8-point channel<br>Not currently enabled<br>Uniform value; is overridden by the following two options
floodplain_width_vectorGRASS point vector with floodplain width measurements;<br>widths for each river segment are chosen<br>via a nearest-neighbor method.
floodplain_width_vector_colColumn in GRASS point data vector with floodplain<br>width values

"climate_inputs" section

OptionDescription
fl_print_climate_hru1 to print spatially uniform climate data over all HRU's<br>using climate data from file specified in climate_data_file.<br>0 if user already has pre-existing HRU-distributed climate files.
climate_data_fileOnly for fl_print_climate_hru=1:<br>Name of file containing climate data for single weather station site,<br>to be uniformly distributed over all HRU's using<br>printClimatehru.py.<br>If fl_print_climate_hru=0, this entry can be omitted;<br>if it is included anyway, it will be ignored.<br>Format is:<br>SITE_NAME Met station data (in degrees Celcius and mm/d)<br>tmax 1<br>tmin 1<br>precip 1<br>###########################################<br>YYYY MM DD HH MM SS T_max T_min Precip<br>...continue this pattern until the end of the data set...<br>One line should be included per day.<br>HH, MM, and SS are all typically 0
climate_hru_dirOnly if fl_print_climate_hru=0:<br>Name of directory with pre-existing climate_hru data files <br>containing HRU-distributed climate inputs:<br>tmin.day, tmax.day, precip.day, and empty.day.<br>See GSFLOW manual or example files in example cases<br>(e.g., in Shullcas -> inputs -> PRMS_GSFLOW) for format of climate_hru data files.<br>If fl_print_climate_hru=1, this entry can be omitted;<br>if it is included anyway, it will be ignored.<br>

"hydrogeologic_inputs" section

OptionDescription
NLAYInteger number of vertical layers in the subsurface
DZLayer thicknesses (in [m]). For multiple layers (NLAY>1), enter comma-separated list,<br>starting from top layer.<br>There is a no-flow boundary condition at the base of the bottom layer.
fl_create_hydcond1 to implement Python script to create spatially distributed hydraulic conductivity.<br>0 to use values or pre-existing file entered in hydcond<br><!---\todo{Crystal: implement this in Create_hydcond.py}-->
hydcondFor uniform hydraulic conductivity within each layer in the saturated domain:<br>enter value(s) (in [m/d]), using comma-separated list for multiple layer domains,<br>starting with top layer. For spatially distributed values: Enter file name containing<br>array of values (in [m/d]); if fl_create_hydcond=1, contents of file will be created<br>using the Python script called in the Go-GSFLOW File (see below description of<br>Go-GSFLOW File).<br>User may need to adjust hydraulic conductivity values to reach numerically<br>convergent results and to match observations.
finfOptional: Only for spin-up runs; this entry is ignored (but should still be entered)<br>for restart runs. For uniform infiltration to the unsaturated zone over the watershed:<br>enter a single value (in [m/d]). For spatially distributed values: enter file name<br>containing array of values (in [m/d]).[br] User may need to adjust this value to reach<br>numerically convergent results and for reasonable start of transient results.

Step 2. Running GRASS GIS to build the model domain

Launch GRASS GIS and create your location

  1. Launch GRASS GIS.
  1. Create a folder to hold your GRASS locations. This is typically called "grassdata" and placed in your home directory.
  2. Click on "New", and follow the prompts.

Important: Your DEM must be at least 2 full MODFLOW grid cells larger on each side than the catchment that you seek to model. This will ensure that (1) offmap flow is not a problem and (2) the constant-head MODFLOW boundary condition at the outlet may properly be built. As additional cells with offmap flow inputs will be removed from the DEM, it is often wise to pad the DEM even more than this.

GRASS GIS start-up screen

If you "Read projection and datum terms from a georeferenced data file", GRASS GIS will ask you if you want to import that file to the workspace. There is no need to do so -- "build_domain_grass.py" will do this for you -- but you can if you want to be able to start GRASS GIS and look at it.

Start GRASS GIS session in your location

With your location selected, click "Start GRASS session".

Choosing pour points (if needed)

If you need to choose your pour point manually, we recommend that either you (a) import the DEM and find it now using GRASS, or (b) use another program like QGIS to find this location. You should still keep the path of the DEM in DEM_file_path_to_import until you have finished the first run of the code. Keeping this in during later runs will not cause problems; it will just take extra time as the DEM is re-imported and re-corrected.

Install required GRASS GIS extensions

First time running GRASS GIS only, or after GRASS extension updates

Either using the terminal (highly recommended) or clicking on the "Console" tab in the GRASS GIS Layer Manager, run install all of the necessary extensions for GSFLOW-GRASS.

In the terminal, this may be done as follows:

On Linux, cd GSFLOW-GRASS/domain_builder and type:

sh install_extensions.sh

On Windows, likewise cd to GSFLOW-GRASS\domain_builder and type:

install_extensions

Perhaps more easily, on either operating system, just copy and paste the contents of install_extensions.sh into the terminal or GRASS GIS console. We have also pasted these here for convenience.

# From us
g.extension v.gsflow.export
g.extension v.gsflow.gravres
g.extension v.gsflow.grid
g.extension v.gsflow.hruparams
g.extension v.gsflow.reaches
g.extension v.gsflow.segments
g.extension r.gsflow.hydrodem
g.extension v.stream.inbasin
g.extension v.stream.network
g.extension r.cell.area

# From others
g.extension r.stream.basins
g.extension r.hydrodem

Create the domain inputs for input-file-builder scripts

Either using the terminal (highly recommended, Linux) or clicking on the "Console" tab in the GRASS GIS Layer Manager (Linux or Windows), run buildDomainGRASS.py. For example, from within the "GSFLOW-GRASS" folder::

Linux

python domain_builder/buildDomainGRASS.py /PATH/TO/settings.ini

Windows

python domain_builder\buildDomainGRASS.py DRIVE_LETTER:\PATH\TO\settings.ini

Time will pass and a lot of text will go past on the screen. If it ends with "Done.", it has succeeded! This is regardless of warning/error messages about adding fields to shapefiles, skipping features without categories, or file extensions not being allowed by the GPKG specification. If it does not end with "Done.", please contact us!

Once this has finished check our "gsflow_simdir" for a "GIS" subfolder that contains the outputs of your work here. The files there will be automatically read in during Step 4.

Pat yourself on the back! The GRASS portion is complete.

Step 3: Customize the goGSFLOW File to set input-file-builder options

The goGSFLOW File (goGSFLOW.sh on Linux and goGSFLOW.bat on Windows) in the Run folder, is for pre-processing and running GSFLOW.

At the top of the file, the user may customize:

Alternatively, for goGSFLOW.sh, the user may pass the settings_file as the first argument and (optionally) the toolkit_dir as the second argument.

The rest of the file will execute scripts to: (1) set up certain model inputs (climate forcing data and hydraulic conductivity) according to the Settings File, (2) create GSFLOW input files (GSFLOW control file, PRMS parameter file, and MODFLOW input files), and (3) run GSFLOW. In the default implementation, the user does not need to change the bottom part of the file with Python scripts. However, certain lines may be commented out or changed, as described in the following:

Note that the above Python scripts can also be run independently using Python, outside of the goGSFLOW File; just be sure to include the Settings File name as an argument.

Step 4. Optional steps

For the default implementation, the user can proceed to Step 5. However, extra steps are needed if the user has specified any of the following:

Changing other input parameters: See "Advanced Customization" below.

Step 5. Running GSFLOW

The pre-processing and GSFLOW model execution can be carried out by entering the Go-GSFLOW at the command line:

Output files will be located in the gsflow_simdir (specified in Step 1 in the Settings File) -> outputs.

After running GSFLOW, the user should check the following:

Step 6. Visualization

Our toolkit includes Python scripts in GSFLOW-toolkit -> visualization for graphically depicting major GSFLOW inputs and outputs. Currently these scrips work only with GSFLOW 1.2.0. The USGS is updating their standards, and we will update our visualization methods only after they have settled on new (and possibly NetCDF-based) file-output formats, organization, and nomenclature. Most of of these scripts can be run using the following syntax

run <visualization_script>.py <Settings File full path> # in a Python shell
./<visualization_script>.py <Settings File full path> # in bash (Unix shell)
python <visualization_script>.py <Settings File full path> # bash or MS-DOS shell

However, plotMODFLOW.py is a bit more complicated because it has a parser that allows you to enter more options. Its help information follows:

usage: plotMODFLOW.py [-h] -i INFILE
                      [-p {topo,head,wtd,dhead,hydcond,hydcond_vertical,ss,sy}]
                      [-o OUTMOVIE]

Plot animated time-series of groundwater conditions from GSFLOW.

optional arguments:
  -h, --help            show this help message and exit
  -o OUTMOVIE, --outmovie OUTMOVIE
                        Output file (mp4) for movie, if desired (default:
                        None)

required arguments:
  -i INFILE, --infile INFILE
                        input <settings>.ini fiile for GSFLOW
  -p {topo,head,wtd,dhead,hydcond,hydcond_vertical,ss,sy}, --plot {topo,head,wtd,dhead,hydcond,hydcond_vertical,ss,sy}
                        Plot variable selector: topography (topo), head, water
                        table depth (wtd), change in head (dhead), hydraulic
                        conductivity (hydcond), vertical hydraulic
                        conductivity (hydcond_vert) specific storage (ss), or
                        specific yield (sy) (default: wtd)

For example, one could type within a Python shell:

run plotMODFLOW.py -i <Settings File full path> -p wtd -o TEST.mp4

By default, the visualization scripts will plot output files in directories specified by Settings File; this facilitates visualizing results directly after running GSFLOW with this toolkit. However, the user can over-ride these file locations in the section *** CHANGE FILE NAMES AS NEEDED in order to plot arbitrary output files (not based on Settings File). However, our visualization scripts assume certain output file formats and are not guaranteed to work with GSFLOW output files generated outside of this toolkit.

For other main plotting options, the user should use the section at the top of each visualization script indicated with *** SET THE FOLLOWING:.... Other more detailed customizations (e.g., figure formatting etc) can be manually made in the rest of the script.

The visualization scripts in the toolkit include the following:

Advanced Customization

Changing other parameters in GSFLOW input files:

Our toolkit is set up to easily change hydraulic conductivity, climate, and infiltration inputs through the Settings File. To change other model input parameters (described in the GSFLOW manual), the user must locate those entries in the Python input-file-builder scripts and edit the values there. These scripts are in Toolkit_GSFLOW ->input_file_builder and include:

Customizing GRASS GIS commands

Our GRASS GIS commands are open-source and may be edited; we expect that the most likely reason for users to do so would be to add additional GSFLOW options to the attribute tables for the HRUs and MODFLOW cells.

To write the extensions, follow the advice given at the GRASS GIS wiki, https://grasswiki.osgeo.org/wiki/AddOns, and/or simply follow the pattern of the code in GSFLOW-GRASS/domain_builder.

Our extensions are stored at both our GitHub repository and in the official GRASS GIS add-ons subversion (svn) repository. The latter requires write access from the GRASS GIS team. If you lack this write access, we suggest that you make pull requests to our GitHub repository and work with us to test your changes, and then we will add them to the official svn repository, from which your changes will be compiled and made available via the g.extension command.

If you make modifications, please contact us.

We would be happy to include your contributions in the main code base, and any changes to the GRASS GIS commands to the main GRASS GIS extensions (add-ons) repository: this will help future users!

Visitors since April 22nd, 2018

HitCount