Adding a new variable to a method using getData to obtain the information defined in the INI file.

Method

In hector.ini
Under the corresponding component add variable Ex: SN = 42000;

In hpp file of component
Add variable as tseries, unitval, double, etc. and add its associated time series (when necessary; see above).

Define the variables that are being added
Ex: #define D_ATMOSPHERIC_SO2 "SN"

These names do not have to match internal component variables but the INI definition has to match what appears in quotes

In the component file.cpp
Under init, need to register the Capability core->registerCapability( D_ATMOSPHERIC_SO2, getComponentName() );

In cpp file of component
Under getData and setData, add the new variables in before the Error message

NOTE: see tseries documentation for more information on getData

(getData)
else if(varName == D_ATMOSPHERIC_SO2 ) {
  returnval = SN;
  (setData)
else if( varName ==  D_ATMOSPHERIC_SO2  ) {
  H_ASSERT( data.date == Core::undefinedIndex(), "date not allowed");
SN.set( lexical_cast<double>( value ), U_GG );
    }

If this variable is called in another component.

For example, if adding in a variable within the forcing component
Ex: unitval SN = core->getData( D_ATMOSPHERIC_SO2, runToDate);

If this variable is a unitval, the relevant code file must include unitval.hpp.