Sacramento SMA
The SMA project/module provides a back-end soil moisture model for the Soil Moisture Estimator tool and implements a custom C interface to the National Weather Service-University of Arizona Sacramento Soil Moisture Accounting (SMA) model.
Contents
SMA Module Files
There are four C programs which make up the module.
The first two are interface contributions:
* ini.c - reads ini style input variables, from Ben Hoyt * sma.c - interfaces between the SME and the SMA model, from Agrineer
The next two implement the actual model:
* sacramento_state.c (a version of sac_sma.c) * fland1.c
and were originally part of the MOSCEM package developed at University of Arizona by Yuqiong Liu and others. Permission to use and distribute these files was granted by Professor Hoshin Gupta (University of Arizona) on 2009-08-28.
The last two programs above were originally downloaded from Google's cached copy of http://info.science.uva.nl/ibed/research/Research_Fields/cbpg/software/code/moscem.0.tar.gz 2009-08-20 by Felix Andrews.
For an R language version go to Hydromad. Many descriptive phrases and source code on the model came from Hydromad.
The program sacramento_state.c (sac_sma.c) was based on code from the MOSCEM project and simplified by Felix Andrews <felix@nfrac.org> 2010-02-01. Adapted to return state by Joseph Guillaume 2013-10-24.
The program fland1.c executes the SAC-SMA operation for one time period. It was initially written in FORTRAN by Eric Anderson-HRL in April 1979. In 1993-94 Patrice O. Yapo rewrote the program in the C language. The transition from FORTRAN to C explains why the C programs use parameters by reference, an artifact from FORTRAN.
Implementation
The SMA module is part of the SME project which can be downloaded from here. The SMA module is in the "Sacramento" directory.
The main sma.c program can be run standalone. To create the sma executable, type "make" in the Sacramento directory. By default the executable is moved to its parent directory for use by sme.py. Modify the "makefile" to your preference.
Usage:
sma -c config_file
Where the configuration file holds "ini" parameters for:
loads - Filepath to atmospheric loads (precip and et) data, described below. soil - Filepath to soil attribute data, described below. output - Filepath to output report, described below. rain - Optional filepath for local rain input data. Overrides climate model rain data. irr - Optional filepath for irrigation events. Events count as precipitation.
An example configuration file:
[FILES]
loads = /home/agrineer/sma/input/loads.csv
soil = /home/agrineer/sma/input/soil.csv
output = /home/agrineer/sma/output/output.csv
rain = /home/agrineer/sma/input/rain.csv
irr = /home/agrineer/sma/input/irr.csv
Note that when the sme.py invokes the SMA module the SMA configuration file is constructed on the fly, based on SME data and configuration input files. Since the SMA is a backend module the SME, the user must specify the soil model and its parameter input files in the SME configuration file.
For example, to reference the SMA with parameters in the sme.py, the SME configuration file might have:
[SoilModel]
model = SMA
[SMA]
program = /home/agrineer/sme/sme/sma
soil = /home/agrineer/sme/tmp/soil.csv
rain = /home/agrineer/sme/tmp/rain.csv
irr = /home/agrineer/sme/tmp/irr.csv
The "loads" file (data) would be generated by the WRF model data and ETo calculations and then submitted to the SMA program.
Note that the web SME tool constructs the configuration file for the sme.py program as above. See the SME description here for more detail.
Input file format and variable description
All input files are text based with comma separable variables (.csv). These files can be are read by spreadsheets for presentation and general analysis purposes.
Atmospheric Loads
The "loads" input file consists of a title line followed by value lines. Line values are comma separated (CSV) and the values are for date, precipitation, and ETc. Precipitation and ETc values are given in millimeters. For example,
Date,P,E 2018-01-02,0.00,1.0348 2018-01-03,0.00,0.8603 2018-01-04,0.00,0.8630 . . .
Currently, comments cannot be placed above the title line. Note that the precipitation values normally originate from the WRF model and can be overridden by local data input.
Soil Attributes
Soil input filename containing comma separated values (CSV) consisting of a title line and a value line.
The input file consists of a title line followed by a value line. The value line has comma separated values consisting of:
soil - given soil name (string)
comment - make a comment (string)
uztwm - upper layer (zone) tension water maximum capacity, mm. The maximum volume of water (normalized to mm) held by the upper zone between field capacity and the wilting point which can be lost by direct evaporation and transpiration from soil. This storage is filled before any water in the upper zone is transferred to other storages. Use field capacity and wilt point water content ratios to determine normalized volume (mm) for some depth. ie. (Ofc - Owp)*depth = uztwm (max et storage capacity).
uzfwm - upper layer free water maximum capacity, mm. This storage is the source of water for interflow and the driving force for transferring water to deeper depths.
uzk - interflow depletion rate from the upper layer free water storage, uzfwm per day. That is, lateral drainage rate of upper zone free water expressed as a fraction of contents per day.
pctim - permanent impervious area fraction of the catchment which produces impervious runoff during low flow conditions.
adimp - maximum fraction of an additional impervious area due to saturation. That is, the additional fraction of the catchment which exhibits impervious characteristics when the catchment's tension water requirements are met.
perc - maximum percolation rate coefficient (from upper zone free water into the lower zone).
rexp - shape parameter of the percolation curve. An exponent determining the rate of change of the percolation rate with changing lower zone water contents.
lztwm - lower layer tension water maximum capacity, mm. Water from this store can only be removed through transpiration.
lzfsm - lower layer supplemental free water maximum capacity, mm. The maximum volume from which supplemental baseflow can be drawn.
lzfpm - lower layer primary free water maximum capacity, mm. The maximum capacity from which primary base flow can be drawn.
lzsk - depletion rate of the lower layer supplemental free water storage, lzfsm per day. That is, lateral drainage rate of lower zone supplemental free water expressed as a fraction of contents per day.
lzpk - depletion rate of the lower layer primary free water storage, lzfpm, per day. That is, lateral drainage rate of lower zone primary free water expressed as a fraction of contents per day.
pfree - percolation fraction that goes directly to the lower layer free water storages. Direct percolation fraction from upper to lower zone free water (the percentage of percolated water which is available to the lower zone free water before all lower zone tension water deficiencies are satisfied).
uztwc_0 - initial upper zone tension water content as proportion of ‘uztwm’
uzfwc_0 - initial upper zone free water content as proportion of ‘uzfwm'
lztwc_0 - initial lower zone tension water content as proportion of ‘lztwm’
lzfsc_0 - initial lower zone free water secondary as proportion of ‘lzfsm’
lzfpc_0 - initial lower zone free water primary as proportion of ‘lzfpm’
adimc_0 - initial additional impervious flow store, as proportion of ‘uztwm+lztwm’
Value ranges and default values from different studies:
| Blasone et. al.(2008) | Surrgo (2004) | default | units uztwm | 1-150 | 10-300 | 50.1 | mm uzfwm | 1-150 | 5-150 | 40.2 | mm uzk | 0.1-0.5 | 0.10-0.75 | 0.1 | frac/day pctim | 0.000001-0.1 | N/A | 0.000001 | none adimp | 0-0.4 | N/A | 0.0 | none zperc | 1-250 | 5-350 | 1.0 | none rexp | 0-5 | 1-5 | 0.0 | none lztwm | 1-500 | 10-500 | 250.0 | mm lzfsm | 1-1000 | 5-400 | 500.0 | mm lzfpm | 1-1000 | 10-1000 | 500.0 | mm lzsk | 0.01-0.25 | 0.01-0.35 | 0.01 | frac/day lzpk | 0.0001-0.25 | 0.001-0.05 | 0.1 | frac/day pfree | 0-0.6 | 0.0-0.8 | 0.1 | none
Soil input file example: soil,comment,uztwm,uzfwm,uzk,pctim,adimp,zperc,rexp,lztwm,lzfsm,lzfpm,lzsk,lzpk,pfree,uztwc_0,uzfwc_0,lztwc_0,lzfsc_0,lzfpc_0,adimc_0 soil_default,demo purposes,50.1,40.2,0.1,0.000001,0.0,1.0,0.0,250.0,500.0,500.0,0.01,0.1,0.1,0.5,0.5,0.5,0.5,0.5,0.
Local Rain Events
The file "rain" consists of a title line and value lines with comma separated values (CSV). The values are a date followed by the value in millimeters. For example,
Date,Rain (mm) 2018-01-14,11.67 2018-01-15,17.27 2018-01-17,0.73 . . .
Irrigation Events
The input file "irr" consists of a title line and value lines with comma separated values (CSV). The values are a date followed by the value in millimeters. For example,
Date,Irrigation (mm) 2018-01-10,10.0 2018-01-20,10.0 2018-01-30,10.0 . . .
Paper References
Some links describing the Sacramento Soil Moisture Accounting model:
Plus many more by searching for "Sacramento Soil Moisture Accounting".