Code Monkey home page Code Monkey logo

gsflow-grass's Introduction

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:

  • GSFLOW 1.2
  • GRASS GIS 7.6.1 (updated for compatibility on Earth Day, 22 April 2019)
  • Python 2.7.X
  • GSFLOW-GRASS Toolkit (this software)

Optional:

  • ffmpeg (for making movies)

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.):

  • numpy
  • matplotlib
  • pandas
  • osgeo (also listed under gdal)

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:

  • domain_builder holds GRASS GIS commands and associated code to turn a DEM into an input domain of Hydrologic Response Units (HRUs) and stream segments.
  • input_file_builder holds code that turns the outputs from domain_builder and user-specified parameters in the settings file (see Step 1, below) into the set of input files that are required by GSFLOW
  • Run holds the files to run GSFLOW using these inputs
  • visualization holds scripts to build plots and movies based on the outputs from both GSFLOW and the GRASS GIS domain builder

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

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

Option Description
proj_name Label for the project; no spaces
gsflow_exe Full pathname for GSFLOW executable
gsflow_ver GSFLOW version number
gsflow_path_simdir Full pathname for location where GSFLOW simulation
directory should go.

"elevation_inputs" section

Option Description
DEM_file_path_to_import DEM for import; if blank, assumes that DEM has already been imported
and that the associated initial calculations (flow accumulation, offmap
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

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.

Option Description
LAND_COVER_file_path_to_import Name for GDAL-compliant raster of land-cover values
following the classes given above
SOIL_file_path_to_import Name for GDAL-compliant raster of soil class values
following the classes given above
cov_type Uniform integer land-cover class. Leave this empty if you use a raster file at field "LAND_COVER_file_path_to_import"
soil_type Uniform integer soil class. Leave this empty if you use a raster file at field "SOIL_file_path_to_import"

"GRASS_core" section

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

"run_mode" section

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

"time" section

Option Description
start_date Start date of simulation, format: YYYY-MM-DD
end_date End date of simulation, format: YYYY-MM-DD
init_start_date Set to the date from a spinup run to be used as initial conditions.
If empty, will start by performing its own spin-up.
Note that init_start_date is assumed to be 1 day previous to start_date.
Format: YYYY-MM-DD

"GRASS_drainage" section

Option Description
threshold_drainage_area_meters2 Threshold drainage area in square meters at which flow is considered to create
a channel
MODFLOW_grid_resolution_meters Target cell side length in meters for MODFLOW grid; side lengths will not be
exactly this long, as the nearest value to create an integer number
of cells in the domain will be chosen.
outlet_point_x Pour point approximate x (Easting) position; the nearest point
along a stream segment is chosen as the true pour point.
outlet_point_y Pour point approximate x (Easting) position; the nearest point
along a stream segment is chosen as the true pour point.

"GRASS_hydraulics" section

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

"climate_inputs" section

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

"hydrogeologic_inputs" section

Option Description
NLAY Integer number of vertical layers in the subsurface
DZ Layer thicknesses (in [m]). For multiple layers (NLAY>1), enter comma-separated list,
starting from top layer.
There is a no-flow boundary condition at the base of the bottom layer.
fl_create_hydcond 1 to implement Python script to create spatially distributed hydraulic conductivity.
0 to use values or pre-existing file entered in hydcond
hydcond For uniform hydraulic conductivity within each layer in the saturated domain:
enter value(s) (in [m/d]), using comma-separated list for multiple layer domains,
starting with top layer. For spatially distributed values: Enter file name containing
array of values (in [m/d]); if fl_create_hydcond=1, contents of file will be created
using the Python script called in the Go-GSFLOW File (see below description of
Go-GSFLOW File).
User may need to adjust hydraulic conductivity values to reach numerically
convergent results and to match observations.
finf Optional: Only for spin-up runs; this entry is ignored (but should still be entered)
for restart runs. For uniform infiltration to the unsaturated zone over the watershed:
enter a single value (in [m/d]). For spatially distributed values: enter file name
containing array of values (in [m/d]).[br] User may need to adjust this value to reach
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.
  • If on Linux, you must start GRASS GIS from the command line to ensure that you have a window where you can type the GSFLOW-GRASS commands. If you used apt to install GRASS GIS, simply open a terminal window (CTRL+ALT+T) and type grass or grass76 (the compatible version at the time of writing).
  • If on Windows, a command prompt should always appear when you start 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.
  • We recommend naming the "Project Location" the same as "proj_name".
  • No "Location Title" is needed.
  • We suggest that you "Read projection and datum terms from a georeferenced data file" to set the coordinate system. Each GRASS GIS location has only one coordinate system. Your DEM must be in a projected coordinate system: we do not test our codes using geographic (lat/lon) coordinate systems.

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:

  • settings_file Full pathname for Settings File (customized in Step 1).
  • toolkit_dir full pathname for location of GSFLOWGRASS_toolkit

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:

  • createSpatialHydCond.py: If fl_create_hydcond=1 in Settings File, this script creates spatially distributed hydraulic conductivity values; see top of this script to select from options. This line may be changed to a different script name if the user writes their own script for creating spatially distributed hydraulic conductivity. If fl_create_hydcond=0, this line may be left in; nothing will be done in the script.
  • printClimatehru.py If fl_print_climate_hru=1 in Settings File, this script creates climate_hru files with spatially uniform conditions, based on data from climate_data_file in the Settings File. This line may be changed to a different script name if the user writes their own script for creating spatially distributed climate inputs. If fl_print_climate=0, this line may be left in; nothing will be done in the script.
  • printGSFLOWControlfile.py: This script creates GSFLOW control file. This line generally should be included, but it may be commented out if the user has already run the script previously and will be using the same file in its same location.
  • printPRMSparamfile.py: This script creates the PRMS parameter file. This line generally should be included, but it may be commented out if the user has already run the script previously and will be using the same file in its same location.
  • printMODFLOWInputs.py: This script creates all the MODFLOW input files. This line generally should be included, but it may be commented out if the user has already run the script previously and will be using the same files in their same location.
  • runGSFLOW.py: This script executes the GSFLOW model. This line generally should be included, but it may be commented out if the user only wishes to create the input files without running the model.

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:

  • Settings File, fl_create_hydcond=1: Set options at the top of the Create_hydcond_array.py input-file-builder script for different spatial distribution configurations. Other steps may be needed if the user replaces this script with their own to create spatially distributed hydraulic conductivity fields.
  • Settings File, fl_print_climate=1: Create the file specified in climate_data_file, which should have climate data time series from one weather station for daily minimum temperature, maximum temperature, and precipitation. See example problems for the file format (e.g., in Shullcas -> UserData -> ), which has the following format:
    • line 1: comment
    • line 2: tmax for daily maximum temperature, 1 for number of weather stations
    • line 3: tmin for daily minimum temperature, 1 for number of weather stations
    • line 4: precip for daily precipitation, 1 for number of weather stations
    • line 5: #################################### to indicate start of data
    • line 6: YYYY Month Day 0 0 0 (tmax value) (tmin value) (precip value), etc. for all dates in daily time series All temperature data in this file are assumed to be in [°C], and precipitation data in [mm/d] (these are eventually converted to [°C] and [in/d] for the PRMS model component). This file can be expanded to include relative humidity (in [%]) (used if Penman-Monteith option is selected for the potential ET module) and solar radiation (in [MJ/m2]) if available. Other steps may be needed if the user replaces this script with their own to create spatially distributed hydraulic conductivity fields.
  • Settings File, fl_print_climate_hru=0: Make sure climate_hru_dir is directory with pre-existing climate_hru data files containing HRU-distributed climate inputs: tmin.day, tmax.day, precip.day, and empty.day. See GSFLOW manual or example files in example cases (e.g., in Shullcas -> inputs -> PRMS_GSFLOW) for format of climate_hru data files.

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:

  • Linux prompt: ./goGSFLOW.sh (user needs to press Enter at the end, to return to command prompt)
  • Windows command prompt: goGSFLOW in the directory containing goGSFLOW.bat, or by double clicking on goGSFLOW.bat file in Windows explorer

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:

  • Model ran to completion: GSFLOW will print "Normal termination of simulation". For Windows, this will print to the screen. For Linux, this will appear at the end of out.txt created in the directory where go-GSFLOW.sh is executed (all output to screen is redirected to out.txt).
  • Model converged: Check gsflow_simdir -> control -> gsflow.log. This will summarize convergence performance.
  • Model ran with good water balance: Check gsflow_simdir -> outputs -> PRMS_GSFLOW -> gsflow.out. This will report instances when there are large water balance discrepancies (indicated with "WARNING...")
  • MODFLOW component ran smoothly: Check gsflow_simdir -> outputs -> MODFLOW_NWT -> test.lst. This will include convergence and run details specific to MODFLOW, which are only summarized in gsflow.log.

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:

  • Visualization scripts for plotting GSFLOW inputs and outputs:
    • plotBasin.py: Creates figure showing HRU and stream discretization. User specifies HRU id's to be highlighted.
    • plotMODFLOW.py: Creates various figures showing spatially discretized MODFLOW inputs: active grid cells, top elevation of each layer, bottom elevation of each layer, and hydraulic conductivity for each layer. Also creates movies of spatially discretized hydraulic head (with options to show water table depth and change-in-head over print time steps) and unsaturated zone outputs (recharge from unsaturated to saturated zone).
    • plotHRUvars.py: Creates movie of HRU-discretized output variables.
    • plotSegmentDischarge.py: Creates movie of stream segment-discretized discharge values.
    • plotGSFLOWTimeSeries.py: Creates a time series figure with basin-total variables.

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:

  • printGSFLOWControlfile.py: Builds GSFLOW control file, which controls model options. See commented Section headings to make changes.
  • printPRMSparamfile.py: Builds PRMS parameter file, which contains all (non-stream) surface properties in "Section 2: Parameters." While any of these may be customized, those of particular interest are commented with "# *** CHANGE FOR SPECIFIC SITE"
  • printMODFLOWInputs.py: Includes functions to build the various MODFLOW input files. See individual functions to change input parameters for the different corresponding MODFLOW packages.
  • Subdirectories of domain_builder hold the GRASS GIS commands. If the user needs to expand the set of variables exported under these commands, one should:
    1. Open the desired .py file and follow the pattern shown to edit its parser inputs/outputs (formatted comments near the top) and the Python code inside that first parses these comments and then runs GRASS GIS commands
    2. Ensure that you have a C compiler installed (gcc)
    3. Run make MODULE_TOPDIR=<PATH_TO_YOUR_GRASS_GIS_INSTALL> to compile the updated GRASS GIS commands. See and/or makeall.sh, in which this path is provided by the user, for a simple way to recompile many commands.

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

gsflow-grass's People

Contributors

awickert avatar gcng avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gsflow-grass's Issues

Params from and pt_alpha

I think there is an error in how pt_alpha is assigned in printPRMSparamfile.py . A basic pt_alpha value is assigned for the whole array. The number of entries = nhru*nmonths. This part is fine. There are the correct number of values so no error is raised. However when assigning different values of pt_alpha for high elev barren, it's only done for the first month (Jan) so the rest of the values remain as the default.

Move HRU centroids to HRU centers

Find the midpoint of the HRU and move the centroid to this location using v.edit.
This could make it easier to pick representative values (e.g., for climate).
One trick will be ensuring that the centroid is within the polygon for more complex shapes! There must be some mathematical approach for that -- like maximizing distance from all boundaries while requiring the point to be within them.

plotSegmentDischarge.py issues

plotSegmentDischarge.py

Concatenation error on line 125.
ax.set_title(plotting_variable+': '+ date)
The first number in the matrix dates is nan which means the variable is considered float so it doesn’t want to concatenate. I think this is just symptomatic of the next issue.
In the meantime I changed to
ax.set_title(plotting_variable+': '+ str(date))
Next I get an error with writer.grab_frame() on line 129. Also nothing shows up in the plot area of the graph in the console and it writes a movie but nothing shows up in the plot.
I believe this is an issue with reading in the “…ani.nsegment.corrected” file because the data frame “segment_outputs” is not reading in correctly. It’s mostly nans. I tried changing the number of line to skip from 8 to 10 which makes “segments_outputs” look better but then I run into more issues.
I keep getting 10d etc showing up "segments_outputs" and the first line of dates, even when I try to skip over more lines?

Small things:

  • Prints a bunch of HRU numbers in the console every time step. Why do we want this? It makes it hard to scroll back up.
  • No units on colour bar

buildDomainGRASS.py

  1. Using the g.extensions command: I can get extensions with GRASS 7.2.2 but not with 7.3, the version recommended in the Readme.

  2. There is an additional settings.ini file in the Domain builder folder I think it's an old format. Do I need to do anything with this or can it be eliminated? If so it should be outlined in the readme.

  3. When I run buildDomainGRASS.py it gives an error on line 14 importing readsettings:

Traceback (most recent call last):
File "D:\GSFLOW\Pre_processor_codes\Shullcas_8_GSFLOW-
GRASS\domain_builder\buildDomainGRASS.py", line 14, in

from readSettings import Settings
ImportError: No module named readSettings
(Wed Nov 29 16:43:18 2017) Command finished (0 sec)

Maybe my current directory is wrong because I seem to have problems locating the correct files here and in the next issue.
To temporarily work around I drop a copy of readSsettings.py into the domain builder folder.

  1. Looks like the name 'Settings_AW.ini' and the Linux \ slashes are hard coded on line 11 of buildDomainGRASS.py.
    When I try and run this script from GRASS is cannot find Settings_AW.ini...even when I change the names? Again maybe it is an issue which what is supposed to be the current directory? Error:

D:\GSFLOW\Pre_processor_codes\Shullcas_8_GSFLOW-GRASS\domain_builder\buildDomainGRASS.py
Error opening or parsing input file: ../Run/settings_AW.ini
Using specified input file: ../Run/settings_AW.ini
(Wed Nov 29 16:29:22 2017) Command finished (0 sec)

I temporarily work around by giving a full path for my settings file but then I mess other stuff up and get more errors with the settings stuff.

Docker-compose fails at install tzdata

Run docker-compose build from within gsflow-grass-docker folder and get the following error. Running Ubuntu 18.04.1. Could be a problem with my environment.

Building gsflow_grass
Step 1/17 : FROM ubuntu:18.10
 ---> 9dc19675e327
Step 2/17 : ENV DEBIAN_FRONTEND noninteractive
 ---> Using cache
 ---> 8876b44ce55c
Step 3/17 : USER root
 ---> Using cache
 ---> 1c4315854a5f
Step 4/17 : RUN useradd -m -s /bin/bash mezcla
 ---> Using cache
 ---> cb011c3a9dbf
Step 5/17 : RUN apt update && apt install tzdata
 ---> Running in 7e0b4361e56e

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

Ign:1 http://security.ubuntu.com/ubuntu cosmic-security InRelease
Err:2 http://security.ubuntu.com/ubuntu cosmic-security Release
  404  Not Found [IP: 91.189.91.39 80]
Ign:3 http://archive.ubuntu.com/ubuntu cosmic InRelease
Ign:4 http://archive.ubuntu.com/ubuntu cosmic-updates InRelease
Ign:5 http://archive.ubuntu.com/ubuntu cosmic-backports InRelease
Err:6 http://archive.ubuntu.com/ubuntu cosmic Release
  404  Not Found [IP: 91.189.88.142 80]
Err:7 http://archive.ubuntu.com/ubuntu cosmic-updates Release
  404  Not Found [IP: 91.189.88.142 80]
Err:8 http://archive.ubuntu.com/ubuntu cosmic-backports Release
  404  Not Found [IP: 91.189.88.142 80]
Reading package lists...
E: The repository 'http://security.ubuntu.com/ubuntu cosmic-security Release' do                                                                                                                                             es not have a Release file.
E: The repository 'http://archive.ubuntu.com/ubuntu cosmic Release' does not hav                                                                                                                                             e a Release file.
E: The repository 'http://archive.ubuntu.com/ubuntu cosmic-updates Release' does                                                                                                                                              not have a Release file.
E: The repository 'http://archive.ubuntu.com/ubuntu cosmic-backports Release' do                                                                                                                                             es not have a Release file.
ERROR: Service 'gsflow_grass' failed to build: The command '/bin/sh -c apt updat                                                                                                                                             e && apt install tzdata' returned a non-zero code: 100

docker installs grass78 (which uses Python 3.x)

The install_grass_package script, as called from the Dockerfile, installs the latest GRASS (7.8 as of today). Since the software is tested on GRASS 7.6, I had to make some changes to the Dockerfile and install_grass_package to get Ubuntu 16.04 and Grass76:

in Docker file, changed
FROM ubuntu:18.10
to
FROM ubuntu:16.04

in install_grass_package, changed
apt install -y software-properties-common add-apt-repository ppa:ubuntugis/ubuntugis-unstable
to
apt install -y software-properties-common add-apt-repository ppa:ubuntugis/ppa add-apt-repository ppa:grass/grass-stable apt-get update apt-get install grass76

Error with "r.cell.area" in buildDomainGRASS.py

I am using GRASS GIS 7.6+the example of Cannon+python 2.7.17
This is the error output:

python buildDomainGRASS.py G:\GSFLOW\input_tool_2\GSFLOW-GRASS-Cannon-River-Example-master\Cannon.ini
Importing raster map <DEM_original_import>...
Traceback (most recent call last):
File "buildDomainGRASS.py", line 89, in
r.cell_area(output=cellArea_meters2, units='m2',
overwrite=True)

File "D:\Program Files\GRASS GIS
7.6\etc\python\grass\pygrass\modules\shortcuts.py", line 59,
in getattr
name.strip('').replace('', '.')))

File "D:\Program Files\GRASS GIS
7.6\etc\python\grass\pygrass\modules\interface\module.py",
line 530, in init
raise GrassError(str_err % self.name)
grass.exceptions.GrassError: Error running: r.cell.area --interface-description.
Using specified input file: G:\GSFLOW\input_tool_2\GSFLOW-GRASS-Cannon-River-Example-master\Cannon.ini
Importing DEM and generating hydrologic correction
OSError error(None): None

It seems like there is something wrong with the calculation of DEM cell area. I don't have no idea about this. Should I change the verson of GRASS GIS from 7.6 into 7.4?

Error v.stream.network.py: too many indices for array

Hello,

for my master thesis I would like to generate the input files for a GSFLOW model with the software GSFLOW-GRASS. The calculation of example setups worked well. Unfortunately I did not manage to create my own synthetic model yet, because the conversion of the DEM fails. Unfortunately I don't know if this is a problem with the DEM raw file or something else. Maybe someone has already had experience with the error message and can give me a hint where the problem is.

I work with GRASS-GIS version 7.6.1, GSFLOW version 1.2.2 and Python 2.7.18.

Below the console output:

C:\WRDAPP\GSFLOW-GRASS-master>py -2.7 domain_builder\buildDomainGRASS.py C:\WRDAPP\GSFLOW-GRASS-master\Run\settings.ini

Using specified input file: C:\WRDAPP\GSFLOW-GRASS-master\Run\settings.ini
Importing DEM and generating hydrologic correction
WARNUNG: Die Rasterkarte <DEM_original_import> existiert bereits und wird
überschrieben
WARNUNG: Updating spatial reference with embedded proj4 definition
WARNUNG: Datum von GRASS nicht erkannt und keine Parameter
gefunden.
Importing raster map <DEM_original_import>...
100%
100%
100%
Load elevation map
100%
Remove one cell extremas
100%
Set edge points
100%
A* Search...
100%
Processing 0 sinks
Write conditioned DEM
100%
ABSCHNITT 1a (von 4): Initiiere den Speicher.
ABSCHNITT 1b (of 4): Ermittle den Fluß aus der Karte heraus.
100%
SECTION 2: A* Search.
100%
ABSCHNITT 3: Akkumuliere Oberflächenabfluß mit SFD.
100%
ABSCHNITT 4: Schließe Karten.
100%
100%
Benenne raster in um
100%
WARNUNG: Unable to rename null file
'C:\Users\jonas\Documents\grassdata\simple_test_2\PERMANENT.tmp/unknown\3708.1'
to
'C:\Users\jonas\Documents\grassdata\simple_test_2\PERMANENT\cell_misc\accumulation_onmap\nullcmpr':
File exists
WARNUNG: Unable to rename cell file
'C:\Users\jonas\Documents\grassdata\simple_test_2\PERMANENT.tmp/unknown\3708.0'
to
'C:\Users\jonas\Documents\grassdata\simple_test_2\PERMANENT\fcell\accumulation_onmap':
File exists
100%
WARNUNG: Unable to rename null file
'C:\Users\jonas\Documents\grassdata\simple_test_2\PERMANENT.tmp/unknown\7348.1'
to
'C:\Users\jonas\Documents\grassdata\simple_test_2\PERMANENT\cell_misc\DEM\nullcmpr':
File exists
WARNUNG: Unable to rename cell file
'C:\Users\jonas\Documents\grassdata\simple_test_2\PERMANENT.tmp/unknown\7348.0'
to
'C:\Users\jonas\Documents\grassdata\simple_test_2\PERMANENT\fcell\DEM':
File exists
100%
WARNUNG: Unable to rename null file
'C:\Users\jonas\Documents\grassdata\simple_test_2\PERMANENT.tmp/unknown\2860.1'
to
'C:\Users\jonas\Documents\grassdata\simple_test_2\PERMANENT\cell_misc\accumulation_onmap\nullcmpr':
File exists
WARNUNG: Unable to rename cell file
'C:\Users\jonas\Documents\grassdata\simple_test_2\PERMANENT.tmp/unknown\2860.0'
to
'C:\Users\jonas\Documents\grassdata\simple_test_2\PERMANENT\fcell\accumulation_onmap':
File exists
Loading input raster maps...
100%
Initializing A* search...
100%
A* Search...
100%
Extracting streams...
100%
Thinning stream segments...
100%
Schreibe Ausgabe-Rasterkarten...
100%
Writing vector map <streams_all>...
WARNUNG: Vektorkarte <streams_all> existiert bereits und wird
überschrieben.
100%
Writing attribute data...
Erstelle Topologie für die Vektorkarte streams_all@PERMANENT...
Registriere Primitive...
Memory swap calculation (may take some time)...
Lese Rasterkarte ...
100%
Calculating basins using streams...
Lese Rasterkarte <streams_all> ...
100%
Finding nodes...
100%
Delineating basins for 0 outlets...
100%
Schreibe Rasterkarte <basins_all>...
100%
WARNUNG: Vektorkarte <basins_all> existiert bereits und wird überschrieben.
Extrahiere Flächen ...
100%
Schreibe Flächen...
100%
Erstelle Topologie für die Vektorkarte basins_all@PERMANENT...
Registriere Primitive...
r.to.vect komplett.
Erstelle Topologie f³r die Vektorkarte streams_all@PERMANENT...
Registriere Primitive...
WARNUNG: Values in column will be overwritten
WARNUNG: Values in column will be overwritten
Lese Objekte...
100%
Aktualisiere die Datenbank...
100%
0 Datensätze aktualisiert/eingefügt (Layer 1).
WARNUNG: Values in column will be overwritten
WARNUNG: Values in column will be overwritten
Lese Objekte...
100%
Aktualisiere die Datenbank...
100%
0 Datensätze aktualisiert/eingefügt (Layer 1).
Traceback (most recent call last):
File "C:\Users\jonas\AppData\Roaming\GRASS7\addons/scripts/v.stream.network.py", line 208, in
main()
File "C:\Users\jonas\AppData\Roaming\GRASS7\addons/scripts/v.stream.network.py", line 174, in main
cats = colValues[:,colNames == 'cat'].astype(int).squeeze() # river number
IndexError: too many indices for array
Traceback (most recent call last):
File "domain_builder\buildDomainGRASS.py", line 154, in
v.stream_network(map=streams_all)
File "C:\Program Files\GRASS GIS 7.6\etc\python\grass\pygrass\modules\interface\module.py", line 649, in call
return self.run()
File "C:\Program Files\GRASS GIS 7.6\etc\python\grass\pygrass\modules\interface\module.py", line 770, in run
self.wait()
File "C:\Program Files\GRASS GIS 7.6\etc\python\grass\pygrass\modules\interface\module.py", line 791, in wait
module=self.name, errors=stderr)
grass.exceptions.CalledModuleError: Module run v.stream.network v.stream.network map=streams_all upstream_easting_column=x1 upstream_northing_column=y1 downstream_easting_column=x2 downstream_northing_column=y2 tostream_cat_column=tostream ended with error
Process ended with non-zero return code 1. See errors in the (error) output.

Thank you very much in advance!

With best regards

Jonas Vollhüter

plotHRUvars.py issues

plotHRUvars.py
Line 125 was giving an error for the index being out of range. Changed the reference to i to i-1 and it seems to plot the right dates. So the line now reads:
_polys.append(ax.fill(_x, _y, facecolor=colors[i-1], edgecolor='k')[0])

  • As I mentioned before, unfortunately 1.2.2 has different names in the output csv so this should only work with 1.2.0.
  • No units on the colour bar.
  • Precip is plotted in inches, maybe we should convert to mm?
  • I see my sat_recharge is super high at first not necessarily a problem with the plotting script but not sure where this comes from?

libgfortran dependency

An user received the error when running GSFLOW v1.2.0:

libgfortran.so.3: cannot open shared object file: No such file or directory

He corrected it through:

sudo apt-get install libgfortran3

I'm not sure if it's just his system, or if this is a more general thing, so I'm first making a note here. I'm also not sure if it's the library or the specific version of the library. If others report this being an issue, I will update the README.md.

Error: v.stream_inbasin()

I used a new california_dem.zip DEM file to Run buildDomainGRASS.py, some error occured. There is something wrong with the extension v.stream_inbasin. There are no area features in the temporary files

Default clipping with dissolved clip map.
-------------------------------------------------------------------------
Warning:No 'column' option specified. Dissolving based on category values
         from layer <1>.
Extracting features...
Building topology for vector map <temp_32268@PERMANENT>...
Registering primitives...
Writing attributes...
Removing duplicate centroids...
Building topology for vector map <temp_32268@PERMANENT>...
Registering primitives...
Copying vector features from <basins_all@PERMANENT>...
 100%
Copying vector features from <temp_32268@PERMANENT>...
Error:No area features found in vector map <temp_32268@PERMANENT>.
         Verify 'btype' parameter.
Error:Clipping steps failed. Check above error messages and see
         following details:
         Module run None ['v.overlay', 'binput=temp_32268', 'operator=and',
         'olayer=0,1,0', 'ainput=basins_all', 'output=basins_inbasin']
         ended with error
         Process ended with non-zero return code 1. See errors in the
         (error) output.

ERROR with GIS part: failed to add field name "XXX" and failed with running PRMS

Some field can't be added to the gis field. I have no idea about it. How do I solve this error? Could anyone give me a hint? The follows are part of error output:

WARNING: OGR layer already exists and will be overwritten
ERROR 6: Failed to add field named 'hru_area_m2'
ERROR 6: Failed to add field named 'hru_segment'
ERROR 6: Failed to add field named 'obsin_segment'
ERROR 6: Failed to add field named 'aspect_x_sum'
ERROR 6: Failed to add field named 'aspect_y_sum'
WARNING: OGR layer <gravity_reservoirs> already exists and will be overwritten
ERROR 6: Failed to add field named 'a_hru_aspect'
ERROR 6: Failed to add field named 'a_hru_slope'
ERROR 6: Failed to add field named 'a_outlet_sta'
ERROR 6: Failed to add field named 'a_hru_xlong'
ERROR 6: Failed to add field named 'a_hru_segment'
ERROR 6: Failed to add field named 'a_obsin_segment'
ERROR 6: Failed to add field named 'a_soil_type'
ERROR 6: Failed to add field named 'a_aspect_x_sum'
ERROR 6: Failed to add field named 'a_aspect_y_sum'
ERROR 6: Failed to add field named 'b_basinmask'
ERROR 6: Failed to add field named 'gvr_cell_id'
ERROR 6: Failed to add field named 'hru_area_m2'
ERROR 6: Failed to add field named 'cell_area_m2'
ERROR 6: Failed to add field named 'gvr_cell_pct'
ERROR 6: Failed to add field named 'gvr_hru_pct'

I think this error may cause the failure of running GSFLOW. The last part (running GSFLOW) of goGSFLOW.py was not successfully run. Those are the our records of running PRMS:

WARNING: parameter 'adj_by_hru' is not required; file is ../inputs/PRMS_GSFLOW/CannonRiver_2layer_60mDEM_1200mMODFLOW_GSFLOW.param; line number 23109
WARNING: pt_alpha[0] = 0.750000 is out of range (1.000000 to 2.000000); file is ../inputs/PRMS_GSFLOW/CannonRiver_2layer_60mDEM_1200mMODFLOW_GSFLOW.param; line number 33503

WARNING: parameter 'mnsziter' is not required; file is ../inputs/PRMS_GSFLOW/CannonRiver_2layer_60mDEM_1200mMODFLOW_GSFLOW.param; line number 40376

WARNING: parameter 'szconverge' is not required; file is ../inputs/PRMS_GSFLOW/CannonRiver_2layer_60mDEM_1200mMODFLOW_GSFLOW.param; line number 40383

WARNING: parameter 'print_freq' is not required; file is ../inputs/PRMS_GSFLOW/CannonRiver_2layer_60mDEM_1200mMODFLOW_GSFLOW.param; line number 43456

WARNING: parameter 'print_type' is not required; file is ../inputs/PRMS_GSFLOW/CannonRiver_2layer_60mDEM_1200mMODFLOW_GSFLOW.param; line number 43463
ERROR - CHECK_ani_vars: sat_recharge is not a valid animation output variable.
Set animation variables: sat_recharge is not a valid stat variable.

I used the latest example of Cannon. The version of GRASS GIS is 7.6 of Ubuntu. Maybe those problem can be own to the unstable GRASS GIS on ubuntu?

2 Settings files?

There is a Settings.ini file in with the Domain Builder. It has different format than the one in the Run folder. Should these be the same? Are they both necessary?

Visualization script instructions in Readme

When using plotMODFLOW.py, the Readme says use this syntax:
run (visualization_script).py (Settings File full path)
But I need to use something with at least one flag
run plotMODFLOW.py -i (Settings File full path) -p wtd -o TEST.mp4

Error with settings.ini file

I created a settings.ini file based on the template provided. However, when I try to run buildDomainGrass.py using the GRASS terminal, I receive the following message "Error opening or parsing input file." I am a brand new GRASS GIS user, and my python experience is largely from using ArcGIS. I am having trouble identifying the source of the above error. Could you please take a look at my input file and provide guidance and/or feedback? I am using GRASS 7.4.4 and Python 2.7.15. Thanks.

A link to my input file is here: https://github.com/jaeisma08/GSFLOW-GRASS-test/blob/master/settings.ini

Deprecated Windows run file?

In GSFLOW-GRASS/Run, is the following superceded by goGSFLOW.bat?
run_Python_GSFLOW_current_Win.bat
If so, should remove.

Python 3 upgrade needed

A number of issues have been cropping up that seem to be related to changes in library naming and structure. Much of this may be related to the Python 2-->3 transition, and the fact that GSFLOW-GRASS was built for Python 2.7. (This is in addition to any changes from newer versions of GRASS GIS.) From my initial pass through the code base, this will take some significant effort in building and restructuring. I am trying to decide whether continued support here is warranted, or is likely to become a major and unproductive time-suck as GSFLOW, GRASS, and Python continue to update and I am just one person who does not plan to use GSFLOW in the near future for his work. Thoughts and voluntary co-development appreciated!

GrassError: Error running: `r.cell.area --interface-description`

Hi, while building my domain I keep getting an error whith r.cell.area. I've tested the module r.cell.area standalone and it works perfectly
I'm currently on
GrassGIS 7.6.14
python 2.7.14
gsflow 1.2.2

C:\Users\lenovo>python C:\Users\lenovo\Desktop\Essai2\GSFLOW-GRASS-master\domain_builder\buildDomainGRASS.py C:\Users\lenovo\Desktop\Essai2\GSFLOW-GRASS-Cannon-River-Example-master\Cannon.ini
Using specified input file: C:\Users\lenovo\Desktop\Essai2\GSFLOW-GRASS-Cannon-River-Example-master\Cannon.ini
Importing DEM and generating hydrologic correction
ATTENTION: Raster map <DEM_original_import> already exists and will be
overwritten
Importing raster map <DEM_original_import>...
100%
OSError error(None): None
Traceback (most recent call last):
File "C:\Users\lenovo\Desktop\Essai2\GSFLOW-GRASS-master\domain_builder\buildDomainGRASS.py", line 89, in
r.cell_area(output=cellArea_meters2, units='m2', overwrite=True)
File "C:\Program Files\GRASS GIS 7.6\etc\python\grass\pygrass\modules\shortcuts.py", line 59, in getattr
name.strip('').replace('', '.')))
File "C:\Program Files\GRASS GIS 7.6\etc\python\grass\pygrass\modules\interface\module.py", line 530, in init
raise GrassError(str_err % self.name)
grass.exceptions.GrassError: Error running: r.cell.area --interface-description.

C:\Users\lenovo>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.