Giter VIP home page Giter VIP logo

smwesten-usgs / swb Goto Github PK

View Code? Open in Web Editor NEW
35.0 10.0 10.0 227.56 MB

Soil-Water-Balance: A Modified Thornthwaite-Mather Soil-Water-Balance Code for Estimating Groundwater Recharge.

License: Other

Shell 0.04% CMake 0.75% Fortran 68.22% C 19.44% R 2.71% HTML 4.83% Python 0.76% Batchfile 0.18% Smarty 0.07% Visual Basic 6.0 1.34% Pascal 1.66%
soil-water-balance usgs fortran deep-percolation groundwater-recharge

swb's Introduction

SWB - A Modified Thornthwaite-Mather Soil-Water-Balance Code for Estimating Groundwater Recharge

The Soil-Water-Balance (SWB) computer code has been developed to calculate spatial and temporal variations in groundwater recharge. The SWB model calculates recharge by use of commonly available geographic information system (GIS) data layers in combination with tabular climatological data. The code is based on a modified Thornthwaite-Mather soil-water-balance approach, with components of the soil-water balance calculated at a daily timestep. Recharge calculations are made on a rectangular grid of computational elements that may be easily imported into a regional groundwater-flow model. Recharge estimates calculated by the code may be output as daily, monthly, or annual values.

โš ๏ธ Warning! SWB version 1.x receives infrequent bug fixes. Development of the SWB code continues under the name 'SWB2' in this repo: https://github.com/smwesten-usgs/swb2. Users should consider using SWB2 unless there is a compelling reason to prefer version 1.x.

Disclaimer

This software is in the public domain because it contains materials that originally came from the U.S. Geological Survey, an agency of the United States Department of Interior. For more information, see the official USGS copyright policy at http://www.usgs.gov/visual-id/credit_usgs.html#copyright

This information is preliminary or provisional and is subject to revision. It is being provided to meet the need for timely best science. The information has not received final approval by the U.S. Geological Survey (USGS) and is provided on the condition that neither the USGS nor the U.S. Government shall be held liable for any damages resulting from the authorized or unauthorized use of the information. Although this software program has been used by the USGS, no warranty, expressed or implied, is made by the USGS or the U.S. Government as to the accuracy and functioning of the program and related program material nor shall the fact of distribution constitute any such warranty, and no responsibility is assumed by the USGS in connection therewith.

This software is provided "AS IS."

CC0

swb's People

Contributors

smwesten-usgs avatar westie314 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

swb's Issues

UNCLEAR: Irrigation Amount currently does not equal Irr_fm_GW + Irr_fm_SW

JP suggests clarifying the irrigation calculation by forcing IrrigationAmount to equal IrrigationFromGW + IrrigationFromSW.

rSoilWaterDeficit = rSoilWaterCap - rSoilMoisture

rIrrigationFromGW = rFractionOfIrrigationFromGW
*rSoilWaterDeficit
/ rIrrigationEfficiency_GW

rIrrigationFromSW = (1.0 - rFractionOfIrrigationFromGW)
* rSoilWaterDeficit
/ rIrrigationEfficiency_SW

rIrrigationAmount = rIrrigationFromGW + rIrrigationFromSW

Integer overflow in module RLE

Discovered a bug in which the position marker (an integer) would overflow during file manipulations, causing reads and writes to the *.bin files to fail.

Failure occurs when the binary output file size exceeds 2GB.

SWB: undefined behavior if no "solve" directive present.

A user sent in a control file that contained neither a "SOLVE" nor a "SOLVE_NO_TS_FILE" directive, with the following result:

swb problem

It appears that if SWB has not actually run the simulation, undefined variable names creep into the routine responsible for naming output image files. Fix would be to test for at least one of the SOLVE statements or to test for valid variable values before attempting to formulate the name of the output file.

data_factory: possible initialization error for constant landuse case

Assigning a constant landuse is not particularly useful, except for creating 'toy' test cases. Below is a file that makes use of a constant landuse code; it triggers an error. It appears that the landuse index value is not initialized in this case.

SWB Input

GRID 1 1 2165054. 255067. 161.1
GRID_LENGTH_UNITS FEET
GROWING_SEASON 133 268 T
SUPPRESS_SCREEN_OUTPUT 
OUTPUT_FUTURE_PATH 
OUTPUT_PATH 
INITIAL_ABSTRACTION_METHOD HAWKINS
PRECIPITATION SINGLE_STATION
TEMPERATURE SINGLE_STATION
FLOW_DIRECTION CONSTANT 1
SOIL_GROUP CONSTANT 1
LAND_USE CONSTANT 1
LAND_USE_LOOKUP_TABLE LU_LOOKUP_single_cell.txt
WATER_CAPACITY CONSTANT 3.0
INITIAL_SOIL_MOISTURE CONSTANT 100
INITIAL_SNOW_COVER CONSTANT 0
RUNOFF C-N DOWNHILL
ET T-M 43
SM T-M EQUATIONS
SOLVE Coshocton_Climate_1999.txt test_ future_ T T
EOJ

Resulting error message

At line 3104 of file /Users/smwesten/SMWData/Source_Code/swb/src/model.F90
Fortran runtime error: Index '2104165472' of dimension 1 of array 'pconfig%lu' 
above upper bound of 1

DIFFERENCE: temperature grid definition

SWB 1.0 uses the syntax similar to:

TEMPERATURE NETCDF daymet_v3_tmax_%y_na.nc4 daymet_v3_tmin_%y_na.nc4

whereas SWB 2.0 allows for specification with syntax similar to:

TMAX NETCDF daymet_v3_tmax_%y_na.nc4
TMIN NETCDF daymet_v3_tmin_%y_na.nc4

Ideally the behavior would be identical between codes.

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.