Difference between revisions of "Sacramento SMA"

From Agrineer.org Wiki
Jump to: navigation, search
Line 3: Line 3:
 
== SMA Module Files ==
 
== SMA Module Files ==
 
There are four C programs which make up the module.<br>
 
There are four C programs which make up the module.<br>
The first two below are Agrineer's contribution:
+
The first two below are interface contributions:
   - ini.c reads ini style input variables
+
   - ini.c reads ini style input variables from [https://github.com/benhoyt/inih]
   - sma.c interfaces between the SME and the SMA model
+
   - sma.c interfaces between the SME and the SMA model from Agrineer
  
 
The next two implement the actual model:
 
The next two implement the actual model:
Line 17: Line 17:
 
For an R language version go to [http://hydromad.catchment.org]. Many descriptive phrases on the model come from Hydromad.
 
For an R language version go to [http://hydromad.catchment.org]. Many descriptive phrases on the model come from Hydromad.
 
   
 
   
 +
== Implementation ==
 +
The SMA module is part of the SME project and can be downloaded from [https://gitlab.com/agrineer/sme 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:<br>
 +
  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 and are added to the precip input data.
 +
 
 +
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 ==
 +
=== Atmosphereic 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 ==
 
== Paper References ==
Links describing the SMA:
+
Links describing the Sacramento Soil Moisture Accounting model:
  
 
[http://www.nws.noaa.gov/oh/hrl/calb/calibration1102/calb_report_section7-8.pdf calb_report7-8.pdf]
 
[http://www.nws.noaa.gov/oh/hrl/calb/calibration1102/calb_report_section7-8.pdf calb_report7-8.pdf]

Revision as of 11:52, 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 [1]
 - 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. IndieCompLabs, LLC. makes no claim on sac_sma.c (sacramento_state.c) or fland1.c.

For an R language version go to [2]. Many descriptive phrases on the model come from Hydromad.

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 and are added to the precip input data.

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

Atmosphereic 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".