Difference between revisions of "Sacramento SMA"

From Agrineer.org Wiki
Jump to: navigation, search
(SMA Module Files)
Line 13: Line 13:
 
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.
 
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 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. IndieCompLabs, LLC., makes no claim on sac_sma.c (sacramento_state.c) or fland1.c.
+
The last two programs 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 [http://hydromad.catchment.org Hydromad]. Many descriptive phrases and source code on the model come from Hydromad.
 
For an R language version go to [http://hydromad.catchment.org Hydromad]. Many descriptive phrases and source code on the model come from Hydromad.

Revision as of 13:24, 27 January 2019

The SMA project/module provides a 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.

SMA Module Files

There are four C programs which make up the module.
The first two below 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 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 come from Hydromad.

The program sacramento_state.c (sac_sma.c) was based on code from University of Arizona 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. 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.

Implementation

The SMA module is part of the SME project and can be downloaded from here. The SMA module is in the Sacramento directory.

The sma.c program can be run standalone. To create the sma executable, type "make" in the Sacramento directory. The executable is moved to its parent directory for use.

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/input/output.csv
rain = /home/agrineer/sma/input/rain.csv
irr = /home/agrineer/sma/input/irr.csv

Note that when used with the SME the configuration file is constructed on the fly.

Input file format and variable description

Atmospheric Loads

Soil Attributes

Local Rain Events

Irrigation Events

 - read_loads()
 - read_soils()
 - replace_precip()
 - add_irrigations()

 Output file documention can be found in the main() routine.

Paper References

Links describing the Sacramento Soil Moisture Accounting model:

calb_report7-8.pdf

EMS2009 Bai et al

hydromadPaper.pdf

MR2007_305.pdf

PAP014820.pdf

SSURGO_data_2004.pdf

Plus many more by searching for "Sacramento Soil Moisture Accounting".