Simulation module settings 更多...

class  PrintInfoItem
 Class stores a single output item of an OuputID 更多...
 
class  PrintInfo
 Outputs of one variable, which may contain one or more PrintInfoItem 更多...
 
class  InputArgs
 Parse the input arguments of SEIMS. 更多...
 
struct  ModelClass
 Module basic description 更多...
 
struct  Information
 Module development information class 更多...
 
struct  baseParameter
 Basic model parameter information 更多...
 
struct  Parameter
 Model parameter information class 更多...
 
struct  InputVariable
 Input variable information class 更多...
 
struct  OutputVariable
 Output variable information class 更多...
 
struct  InOutputVariable
 Input and output variable information class 更多...
 
class  ModuleFactory
 Linking user-defined modules to create the modeling workflow. 更多...
 
class  SimulationModule
 Base module for all simulation modules in SEIMS 更多...
 

枚举

enum  AggregationType {
  AT_Unknown = 0 ,
  AT_Sum = 1 ,
  AT_Average = 2 ,
  AT_Minimum = 3 ,
  AT_Maximum = 4 ,
  AT_SpecificCells = 5 ,
  AT_TimeSeries = 6
}
 Aggregation type for OUTPUT 更多...
 
enum  dimensionTypes {
  DT_Unknown = -1 ,
  DT_Single = 0 ,
  DT_SingleInt = 1 ,
  DT_Array1DDateValue = 2 ,
  DT_Array1D = 3 ,
  DT_Array1DInt = 4 ,
  DT_Array2D = 5 ,
  DT_Array2DInt = 6 ,
  DT_Raster1D = 7 ,
  DT_Raster1DInt = 8 ,
  DT_Raster2D = 9 ,
  DT_Raster2DInt = 10 ,
  DT_Scenario = 11 ,
  DT_Reach = 12 ,
  DT_Subbasin = 13
}
 enum of dimension data types 更多...
 
enum  transferTypes {
  TF_None = 0 ,
  TF_SingleValue = 1 ,
  TF_OneArray1D = 2
}
 Float values be transferred across subbasins for MPI version 更多...
 
enum  TimeStepType {
  TIMESTEP_HILLSLOPE ,
  TIMESTEP_CHANNEL ,
  TIMESTEP_SIMULATION
}
 Time step types. 更多...
 

详细描述

Simulation module settings


类说明

◆ PrintInfoItem

class PrintInfoItem

Class stores a single output item of an OuputID

Public 成员函数

 PrintInfoItem (int scenario_id=0, int calibration_id=-1)
 Constructor
 
 ~PrintInfoItem ()
 Destructor
 
void add1DTimeSeriesResult (time_t, int n, const FLTPT *data)
 Add 1D time series data result to TimeSeriesDataForSubbasin
 
void add1DRasterTimeSeriesResult (time_t, int n, const float *data)
 Add 1D time series data result to TimeSeriesDataForRaster
 
time_t getStartTime ()
 get start time time_t
 
void setStartTime (const time_t &st)
 set start time time_t
 
time_t getEndTime ()
 Get end time time_t
 
void setEndTime (const time_t &st)
 set end time time_t
 
void Flush (const string &projectPath, MongoGridFs *gfs, IntRaster *templateRaster, const string &header)
 create "output" folder to store all results
 
bool IsDateInRange (time_t dt)
 Determine if the given date is within the date range for this item
 
void AggregateData (int numrows, FLTPT **data, AggregationType type, FLTPT NoDataValue)
 Aggregate the 2D data from the given data parameter using the given method type. 更多...
 
void AggregateData (time_t time, int numrows, FLTPT *data)
 Aggregate the 1D data from the given data parameter using the given method type
 
void AggregateData2D (time_t time, int nRows, int nCols, FLTPT **data)
 Aggregate the 2D raster data from the given data parameter using the given method type
 
void setAggregationType (const AggregationType type)
 Set the Aggregation type
 
AggregationType getAggregationType ()
 Get the Aggregation type
 

静态 Public 成员函数

static AggregationType MatchAggregationType (const string &type)
 convert the given string into a matching Aggregation type
 

Public 属性

FLTPT ** m_1DDataWithRowCol
 Aggregated data, the second dimension contains: row, col, value
 
int m_nRows
 rows number, i.e., number of valid cells
 
FLTPT * m_1DData
 For 1D raster/array data
 
int m_nLayers
 number of layers of raster data, greater or equal than 1
 
FLTPT ** m_2DData
 For 2D raster/array data
 
map< time_t, FLTPT > TimeSeriesData
 For time series data of a single subbasin, DT_Single
 
map< time_t, FLTPT * > TimeSeriesDataForSubbasin
 For time series data of a single subbasin, DT_Raster1D or DT_Array1D
 
int TimeSeriesDataForSubbasinCount
 Count of TimeSeriesDataForSubbasin
 
map< time_t, float * > TimeSeriesDataForRaster
 For time series data of DT_Raster1D(output some .tif files. Distinct from TimeSeriesDataForSubbasin,which output some .txt files)
 
int TimeSeriesDataForRasterCount
 Count of TimeSeriesDataForRaster
 
int SiteID
 used only by PET_TS??? The site id 更多...
 
int SiteIndex
 The subbasin id
 
int SubbasinID
 The subbasin index
 
time_t m_startTime
 Start time time_t
 
time_t m_endTime
 End time time_t
 
string Suffix
 file suffix, e.g., txt, tif, asc, etc.
 
string Corename
 output filename without suffix, core name without subbasin ID
 
string Filename
 output filename without suffix, and contain subbasin ID as prefix for MPI version
 
string AggType
 Aggregation type string
 

成员函数说明

◆ AggregateData()

void PrintInfoItem::AggregateData ( int  numrows,
FLTPT **  data,
AggregationType  type,
FLTPT  NoDataValue 
)

Aggregate the 2D data from the given data parameter using the given method type.

However this **data restrict to 3 layers, i.e., Row, Col, Value NO NEED TO USE?

类成员变量说明

◆ SiteID

int PrintInfoItem::SiteID

used only by PET_TS??? The site id

The site index in output array1D variable

◆ PrintInfo

class PrintInfo

Outputs of one variable, which may contain one or more PrintInfoItem

参见
PrintInfoItem

Public 成员函数

 PrintInfo (int scenario_id=0, int calibration_id=-1)
 Constructor, initialize an empty instance
 
 ~PrintInfo ()
 Destructor
 
int ItemCount () const
 Get the number of output items
 
void getSubbasinSelected (int *count, int **subbasins)
 Get all the subbasin IDs (in float array) selected for this outputID
 
void setOutputID (string id)
 Set the OutputID for this object
 
string getOutputID () const
 Get the OutputId for this object
 
string getOutputTimeSeriesHeader ()
 Get Header string (all field names) for current OutputID. TODO, how to make it more flexible? By LJ.
 
void setInterval (int interval)
 Set the interval
 
int getInterval ()
 Get the interval
 
void setIntervalUnits (string &units)
 Set the interval units
 
string getIntervalUnits () const
 Get the interval units
 
void AddPrintItem (time_t start, time_t end, const string &file, const string &sufi)
 Add an output item with the given start time, end time and file name
 
void AddPrintItem (string &type, time_t start, time_t end, const string &file, const string &sufi, int subbasinID=0)
 Add an output item with the given aggregate type, start time, end time, file name and subbasin ID
 
void AddPrintItem (time_t start, time_t end, const string &file, string sitename, const string &sufi, bool isSubbasin)
 Add an output item with the given start time (string), end time (string) and file name, Overloaded method
 
PrintInfoItemgetPrintInfoItem (int index)
 Get a reference to the output item located at the given index position
 

Public 属性

int m_scenarioID
 Scenario ID
 
int m_calibrationID
 Calibration ID
 
int m_Interval
 Time interval of output
 
string m_IntervalUnits
 Unit of time interval, which can only be DAY, HR, SEC.
 
int m_moduleIndex
 Module index of the OutputID
 
string m_OutputID
 Unique Output ID, which should be one of "VAR_" defined in text.h and Output of any modules.
 
ParamInfo< FLTPT > * m_param
 The calibration parameters corresponding to the output id, if stated.
 
vector< PrintInfoItem * > m_PrintItems
 For one OutputID, there may be several output items, e.g., different time period, different subbasin ID. etc.
 

◆ InputArgs

class InputArgs

Parse the input arguments of SEIMS.

类 InputArgs 继承关系图:
ccgl::Interface

Public 成员函数

 InputArgs (const string &model_path, const string &model_cfgname, int thread_num, FlowDirMethod fdir_mtd, LayeringMethod lyr_mtd, const string &host, uint16_t port, int scenario_id, int calibration_id, int subbasin_id, GroupMethod grp_mtd, ScheduleMethod skd_mtd, int time_slices, const string &log_level, bool mpi_version=false)
 Constructor by detailed parameters 更多...
 

静态 Public 成员函数

static InputArgsInit (int argc, const char **argv, bool mpi_version=false)
 Initializer. 更多...
 

Public 属性

string model_path
 full path of model folder which contains all inputs and outputs of all models
 
string model_cfgname
 config name of specific model, the default is "", it corresponds to a subfolder
 
string model_name
 model_name
 
string output_scene
 output identifier concatenated with scenario_id, calibration_id, lyr_mtd, fdir_mtd
 
string output_path
 full path of model outputs
 
int thread_num
 thread number for OpenMP
 
FlowDirMethod fdir_mtd
 Flow direction method for flow routing, default is 0 (D8)
 
LayeringMethod lyr_mtd
 Layering method for sequencing computing, default is 0
 
string host
 Host IP address or name of MongoDB database
 
uint16_t port
 port of MongoDB, 27017 is default
 
int scenario_id
 scenario ID defined in Database, -1 for no use.
 
int calibration_id
 calibration ID defined in Database (PARAMETERS), -1 for no use.
 
int subbasin_id
 Subbasin ID, which will be executed, 0 for whole basin, 9999 for field-version
 
GroupMethod grp_mtd
 Group method for parallel task scheduling, default is 0
 
ScheduleMethod skd_mtd
 Parallel task scheduling strategy at subbasin level by MPI
 
int time_slices
 Time slices for Temporal-Spatial discretization method, Wang et al. (2013). Unfinished!
 
string log_level
 logging level, i.e., Trace, Debug, Info (default), Warning, Error, and Fatal
 
bool mpi_version
 is running the MPI version?
 

构造及析构函数说明

◆ InputArgs()

InputArgs::InputArgs ( const string &  model_path,
const string &  model_cfgname,
int  thread_num,
FlowDirMethod  fdir_mtd,
LayeringMethod  lyr_mtd,
const string &  host,
uint16_t  port,
int  scenario_id,
int  calibration_id,
int  subbasin_id,
GroupMethod  grp_mtd,
ScheduleMethod  skd_mtd,
int  time_slices,
const string &  log_level,
bool  mpi_version = false 
)

Constructor by detailed parameters

参数
[in]model_pathpath of the configuration of the Model
[in]model_cfgnameconfig name of specific model, the default is "", it corresponds to a subfolder
[in]thread_numthread or processor number, which must be greater or equal than 1 (default)
[in]fdir_mtdcan be 0, 1, and 2, which means D8 (default), Dinf, and MFDmd, respectively
[in]lyr_mtdcan be 0 and 1, which means UP_DOWN (default) and DOWN_UP, respectively
[in]hostthe address of MongoDB database, by default, MongoDB IP is 127.0.0.1 (i.e., localhost)
[in]portport number, default is 27017
[in]scenario_idthe ID of BMPs Scenario which has been defined in BMPs database
[in]calibration_idthe ID of Calibration which has been defined in PARAMETERS table
[in]subbasin_idthe subbasin that will be executed, default is 0 which means the whole watershed
[in]grp_mtdcan be 0 and 1, which means KMETIS (default) and PMETIS, respectively
[in]skd_mtd(TESTED) can be 0 and 1, which means SPATIAL (default) and TEMPOROSPATIAL, respectively
[in]time_slices(TESTED) should be greater than 1, required when <skd_mtd> is 1
[in]log_levellogging level, the default is Info
[in]mpi_versionOptional, is running the MPI version?

成员函数说明

◆ Init()

static InputArgs * InputArgs::Init ( int  argc,
const char **  argv,
bool  mpi_version = false 
)
static

Initializer.

参数
[in]argcNumber of arguments
[in]argvchar* Arguments
[in]mpi_versionOptional, is running the MPI version?

◆ ModelClass

struct ModelClass

Module basic description

◆ Information

struct Information

Module development information class

Public 属性

string Id
 Module ID
 
string Name
 Module Name
 
string Description
 Module Description
 
string Version
 Module Version
 
string Author
 Author
 
string EMail
 Email
 
string Website
 Website
 
string Helpfile
 Helpfile
 

◆ baseParameter

struct baseParameter

Basic model parameter information

类 baseParameter 继承关系图:
OutputVariable Parameter InputVariable InOutputVariable

Public 属性

string Name
 Name
 
string Units
 Units
 
string Description
 Description
 
dimensionTypes Dimension
 Data dimension type
 

◆ Parameter

struct Parameter

Model parameter information class

类 Parameter 继承关系图:
baseParameter InputVariable InOutputVariable

Public 属性

string Source
 Source type
 
- Public 属性 继承自 baseParameter
string Name
 Name
 
string Units
 Units
 
string Description
 Description
 
dimensionTypes Dimension
 Data dimension type
 

◆ InputVariable

struct InputVariable

Input variable information class

类 InputVariable 继承关系图:
Parameter baseParameter InOutputVariable

额外继承的成员函数

- Public 属性 继承自 Parameter
string Source
 Source type
 
- Public 属性 继承自 baseParameter
string Name
 Name
 
string Units
 Units
 
string Description
 Description
 
dimensionTypes Dimension
 Data dimension type
 

◆ OutputVariable

struct OutputVariable

Output variable information class

类 OutputVariable 继承关系图:
baseParameter

额外继承的成员函数

- Public 属性 继承自 baseParameter
string Name
 Name
 
string Units
 Units
 
string Description
 Description
 
dimensionTypes Dimension
 Data dimension type
 

◆ InOutputVariable

struct InOutputVariable

Input and output variable information class

类 InOutputVariable 继承关系图:
InputVariable Parameter baseParameter

额外继承的成员函数

- Public 属性 继承自 Parameter
string Source
 Source type
 
- Public 属性 继承自 baseParameter
string Name
 Name
 
string Units
 Units
 
string Description
 Description
 
dimensionTypes Dimension
 Data dimension type
 

◆ MetadataInfo

class MetadataInfo

Metadata information of module

类 MetadataInfo 继承关系图:
ccgl::Interface

◆ ModuleFactory

class ModuleFactory

Linking user-defined modules to create the modeling workflow.

类 ModuleFactory 继承关系图:
ccgl::NotCopyable

Public 成员函数

 ModuleFactory (string model_name, vector< string > &moduleIDs, map< string, SEIMSModuleSetting * > &moduleSettings, vector< DLLINSTANCE > &dllHandles, map< string, InstanceFunction > &instanceFuncs, map< string, MetadataFunction > &metadataFuncs, map< string, vector< ParamInfo< FLTPT > * > > &moduleParams, map< string, vector< ParamInfo< int > * > > &moduleParamsInt, map< string, vector< ParamInfo< FLTPT > * > > &moduleInputs, map< string, vector< ParamInfo< int > * > > &moduleInputsInt, map< string, vector< ParamInfo< FLTPT > * > > &moduleOutputs, map< string, vector< ParamInfo< int > * > > &moduleOutputsInt, map< string, vector< ParamInfo< FLTPT > * > > &moduleInOutputs, map< string, vector< ParamInfo< int > * > > &moduleInOutputsInt, vector< ParamInfo< FLTPT > * > &tfValueInputs, vector< ParamInfo< int > * > &tfValueInputsInt, int mpi_rank=0, int mpi_size=-1)
 Constructor
 
 ~ModuleFactory ()
 Destructor
 
void CreateModuleList (vector< SimulationModule * > &modules, int nthread=1)
 Create a set of objects and set up the relationship among them. Return time-consuming.
 
void GetValueFromDependencyModule (int iModule, vector< SimulationModule * > &modules)
 Get value from dependency modules
 
bool FindOutputParameter (string &outputID, int &iModule, ParamInfo< FLTPT > *&paraInfo)
 Find outputID parameter's module. Return Module index iModule and its ParamInfo<FLTPT>
 
string GetModuleID (int i) const
 Get Module ID by index
 
vector< string > & GetModuleIDs ()
 Get unique module IDs
 
map< string, SEIMSModuleSetting * > & GetModuleSettings ()
 Get map of module settings
 
map< string, vector< ParamInfo< FLTPT > * > > & GetModuleParams ()
 Get Parameters of modules
 
map< string, vector< ParamInfo< int > * > > & GetModuleParamsInt ()
 Get integer parameters of modules
 
map< string, vector< ParamInfo< FLTPT > * > > & GetModuleInputs ()
 Get Input of modules, from other modules
 
map< string, vector< ParamInfo< int > * > > & GetModuleInputsInt ()
 Get integer input of modules, from other modules
 
map< string, vector< ParamInfo< FLTPT > * > > & GetModuleOutputs ()
 Get Output of modules, out from current module
 
map< string, vector< ParamInfo< int > * > > & GetModuleOutputsInt ()
 Get integer Output of modules, out from current module
 
map< string, vector< ParamInfo< FLTPT > * > > & GetModuleInOutputs ()
 Get InOutput of modules, in and out from current module
 
map< string, vector< ParamInfo< int > * > > & GetModuleInOutputsInt ()
 Get integer InOutput of modules, in and out from current module
 
vector< ParamInfo< FLTPT > * > & GetTransferredInputs ()
 Get transferred single value inputs across subbasins
 
vector< ParamInfo< int > * > & GetTransferredInputsInt ()
 Get transferred single integer value inputs across subbasins
 
int GetTransferredInputsCount ()
 Get the count of transferred single value inputs
 
int GetTransferredInputsIntCount ()
 Get the count of transferred single integer value inputs
 
SimulationModuleGetInstance (const string &moduleID)
 Get module instance by moduleID
 

静态 Public 成员函数

static ModuleFactoryInit (const string &module_path, InputArgs *input_args, int mpi_rank=0, int mpi_size=-1)
 Initialization for exception-safe constructor
 
static bool LoadSettingsFromFile (const char *filename, vector< vector< string > > &settings)
 Load modules setting from file
 
static bool ReadConfigFile (const char *configFileName, vector< string > &moduleIDs, map< string, SEIMSModuleSetting * > &moduleSettings)
 Read configuration file 更多...
 
static bool LoadParseLibrary (const string &module_path, vector< string > &moduleIDs, map< string, SEIMSModuleSetting * > &moduleSettings, vector< DLLINSTANCE > &dllHandles, map< string, InstanceFunction > &instanceFuncs, map< string, MetadataFunction > &metadataFuncs, map< string, vector< ParamInfo< FLTPT > * > > &moduleParams, map< string, vector< ParamInfo< int > * > > &moduleParamsInt, map< string, vector< ParamInfo< FLTPT > * > > &moduleInputs, map< string, vector< ParamInfo< int > * > > &moduleInputsInt, map< string, vector< ParamInfo< FLTPT > * > > &moduleOutputs, map< string, vector< ParamInfo< int > * > > &moduleOutputsInt, map< string, vector< ParamInfo< FLTPT > * > > &moduleInOutputs, map< string, vector< ParamInfo< int > * > > &moduleInOutputsInt, vector< ParamInfo< FLTPT > * > &tfValueInputs, vector< ParamInfo< int > * > &tfValueInputsInt)
 Load and parse module libraries 更多...
 
static void ReadDLL (const string &module_path, const string &id, const string &dllID, vector< DLLINSTANCE > &dllHandles, map< string, InstanceFunction > &instanceFuncs, map< string, MetadataFunction > &metadataFuncs)
 Load function pointers from .DLL or .so
 
static dimensionTypes MatchType (const string &strType)
 Match data type, e.g., 1D array
 
static transferTypes MatchTransferType (const string &tfType)
 Match data transfer type, e.g., TF_SingleValue
 
static bool IsConstantInputFromName (const string &name)
 Is constant input?
 
static void ReadParameterSetting (string &moduleID, TiXmlDocument &doc, SEIMSModuleSetting *setting, map< string, vector< ParamInfo< FLTPT > * > > &moduleParams, map< string, vector< ParamInfo< int > * > > &moduleParamsInt)
 Read module's parameters setting from XML string
 
static void ReadIOSetting (string &moduleID, TiXmlDocument &doc, SEIMSModuleSetting *setting, const string &header, const string &title, map< string, vector< ParamInfo< FLTPT > * > > &vars, map< string, vector< ParamInfo< int > * > > &varsInt)
 Read module's input, output, and in/output setting from XML string
 
static string GetComparableName (string &paraName)
 Get comparable name after underscore if necessary, e.g., T_PET => use PET
 
static ParamInfo< FLTPT > * FindDependentParam (ParamInfo< FLTPT > *paramInfo, vector< string > &moduleIDs, map< string, vector< ParamInfo< FLTPT > * > > &moduleOutputs)
 Find dependent parameters
 
static ParamInfo< int > * FindDependentParam (ParamInfo< int > *paramInfo, vector< string > &moduleIDs, map< string, vector< ParamInfo< int > * > > &moduleOutputs)
 Find dependent parameters
 

Public 属性

int m_mpi_rank
 Rank ID for MPI, starts from 0 to mpi_size_ - 1
 
int m_mpi_size
 Rank size for MPI
 

成员函数说明

◆ LoadParseLibrary()

static bool ModuleFactory::LoadParseLibrary ( const string &  module_path,
vector< string > &  moduleIDs,
map< string, SEIMSModuleSetting * > &  moduleSettings,
vector< DLLINSTANCE > &  dllHandles,
map< string, InstanceFunction > &  instanceFuncs,
map< string, MetadataFunction > &  metadataFuncs,
map< string, vector< ParamInfo< FLTPT > * > > &  moduleParams,
map< string, vector< ParamInfo< int > * > > &  moduleParamsInt,
map< string, vector< ParamInfo< FLTPT > * > > &  moduleInputs,
map< string, vector< ParamInfo< int > * > > &  moduleInputsInt,
map< string, vector< ParamInfo< FLTPT > * > > &  moduleOutputs,
map< string, vector< ParamInfo< int > * > > &  moduleOutputsInt,
map< string, vector< ParamInfo< FLTPT > * > > &  moduleInOutputs,
map< string, vector< ParamInfo< int > * > > &  moduleInOutputsInt,
vector< ParamInfo< FLTPT > * > &  tfValueInputs,
vector< ParamInfo< int > * > &  tfValueInputsInt 
)
static

Load and parse module libraries

参数
module_path
moduleIDs
moduleSettings
dllHandles
instanceFuncs
metadataFuncs
moduleParams
moduleParamsInt
moduleInputs
moduleInputsInt
moduleOutputs
moduleOutputsInt
moduleInOutputs
tfValueInputs
返回
True if succeed, else throw exception and return false.

◆ ReadConfigFile()

static bool ModuleFactory::ReadConfigFile ( const char *  configFileName,
vector< string > &  moduleIDs,
map< string, SEIMSModuleSetting * > &  moduleSettings 
)
static

Read configuration file

参数
[in]configFileNameConfiguration full file path
[out]moduleIDsUnique module IDs (name)
[out]moduleSettingsMap of SEIMSModuleSetting
返回
True if succeed.

◆ SimulationModule

class SimulationModule

Base module for all simulation modules in SEIMS

类 SimulationModule 继承关系图:
ccgl::Interface AET_PT_H Biomass_EPIC DepressionFS DepressionFSDaily DiffusiveWave ExcessRunoff ExcessRunoff GWaterReservoir IKW_REACH IUH_IF IUH_OL IUH_SED_OL ImplicitKinematicWave_CH ImplicitKinematicWave_OL InterFlow_IKW Interpolate KinWavSed_CH KinWavSed_OL MGTOpt_SWAT MUSK_CH NPS_Management NutrCH_QUAL2E NutrientMovementViaWater NutrientTransportSediment Nutrient_Transformation NutrientinGroundwater PER_PI PER_STR PETHargreaves PETPenmanMonteith PETPriestleyTaylor Percolation_DARCY ReservoirMethod SEDR_SBAGNOLD SERO_MUSLE SET_LM SNO_DD SNO_SP SNO_WB SOL_WB SRD_MB SSM_PE SUR_CN SUR_GreenAmpt SUR_MR SoilTemperatureFINPL SplashEro_Park StormGreenAmpt clsPI_MCS clsPI_SVSC clsTSD_RD

Public 成员函数

 SimulationModule ()
 Constructor
 
virtual int Execute ()
 Execute the simulation. Return 0 for success.
 
virtual void SetDate (time_t t, int year_idx)
 Set date time, as well as the sequence number of the entire simulation. Added by LJ for statistics convenient.
 
virtual void SetTheadNumber (const int thread_num)
 Set thread number for OpenMP
 
virtual void SetClimateDataType (int data_type)
 Set climate data type, P, M, PET etc.
 
virtual void SetValue (const char *key, int value)
 Set data, DT_Single, integer
 
virtual void SetValue (const char *key, FLTPT value)
 Set data, DT_Single, float point number (float or double)
 
virtual void SetValueByIndex (const char *key, int index, int value)
 Set single value to array1D by index, used in MPI version for passing values of subbasins, integer
 
virtual void SetValueByIndex (const char *key, int index, FLTPT value)
 Set single value to array1D by index, used in MPI version for passing values of subbasins, float
 
virtual void Set1DData (const char *key, int n, int *data)
 Set 1D data, by default, DT_Raster1D, integer
 
virtual void Set1DData (const char *key, int n, FLTPT *data)
 Set 1D data, by default, DT_Raster1D, float
 
virtual void Set2DData (const char *key, int nrows, int ncols, int **data)
 Set 2D data, by default, DT_Raster2D, integer
 
virtual void Set2DData (const char *key, int nrows, int ncols, FLTPT **data)
 Set 2D data, by default, DT_Raster2D, float
 
virtual void GetValue (const char *key, int *value)
 Get value, DT_Single, integer
 
virtual void GetValue (const char *key, FLTPT *value)
 Get value, DT_Single, float
 
virtual void Get1DData (const char *key, int *n, int **data)
 Get 1D data, by default, DT_Raster1D, integer
 
virtual void Get1DData (const char *key, int *n, FLTPT **data)
 Get 1D data, by default, DT_Raster1D, float
 
virtual void Get2DData (const char *key, int *nrows, int *ncols, int ***data)
 Get 2D data, by default, DT_Raster2D, integer
 
virtual void Get2DData (const char *key, int *nrows, int *ncols, FLTPT ***data)
 Get 2D data, by default, DT_Raster2D, float
 
virtual void SetScenario (Scenario *sce)
 Set pointer of Scenario class which contains all BMP information. Added by LJ, 2016-6-14
 
virtual void SetReaches (clsReaches *rches)
 Set pointer of clsReaches class which contains all reaches information. Added by LJ, 2016-7-2
 
virtual void SetSubbasins (clsSubbasins *subbsns)
 Set pointer of clsSubbasins class which contains all subbasins information. Added by LJ, 2016-7-28
 
virtual bool CheckInputData ()
 Check the input data. 更多...
 
virtual bool CheckInputSize (const char *module_id, const char *key, int nrows, int &m_nrows)
 Check data length of the first dimension (i.e., nRows) of the input array-based data 更多...
 
virtual bool CheckInputSize2D (const char *module_id, const char *key, int nrows, int ncols, int &m_nrows, int &m_ncols)
 Check data length of the two dimensions (i.e., nRows and nCols) of the input array-based data 更多...
 
virtual void InitialOutputs ()
 Initialize output variables. 更多...
 
virtual void InitialIntermediates ()
 Initialize intermediate parameters for reducing computing amount. 更多...
 
virtual TimeStepType GetTimeStepType ()
 Get time step type, default is hillslope process. 更多...
 
virtual void ResetSubTimeStep ()
 Reset subtime step
 
bool IsInputsSetDone ()
 Whether the inputs (i.e., inputs derived from other modules) have been set.
 
void SetInputsDone (const bool set_done)
 Change the status of setting inputs parameters
 
void SetReCalIntermediates (const bool recal)
 set whether intermediate parameters need to recalculated
 

Protected 属性

time_t m_date
 date time
 
int m_yearIdx
 index of current year of simulation, e.g., the simulation period from 2010 to 2015, m_yearIdx is 2 when simulate 2012.
 
int m_year
 year
 
int m_month
 month since January - [1,12]
 
int m_day
 day of the month - [1,31]
 
int m_dayOfYear
 day of year - [1, 366]
 
int m_tsCounter
 sub-timestep counter
 
bool m_inputsSetDone
 Whether the inputs parameters (i.e., parameters derived from other modules) have been set.
 
bool m_reCalIntermediates
 need to recalculate intermediate parameters?
 

成员函数说明

◆ CheckInputData()

◆ CheckInputSize()

virtual bool SimulationModule::CheckInputSize ( const char *  module_id,
const char *  key,
int  nrows,
int &  m_nrows 
)
virtual

Check data length of the first dimension (i.e., nRows) of the input array-based data

参数
[in]module_idModule ID used to print exception message
[in]keythe key to identify the requested data
[in]nrowssize of the first dimension
[out]m_nrowsthe expected size, if m_nrows less or equal to 0, then m_nrows = mrows

◆ CheckInputSize2D()

virtual bool SimulationModule::CheckInputSize2D ( const char *  module_id,
const char *  key,
int  nrows,
int  ncols,
int &  m_nrows,
int &  m_ncols 
)
virtual

Check data length of the two dimensions (i.e., nRows and nCols) of the input array-based data

参数
[in]module_idModule ID used to print exception message
[in]keythe key to identify the requested data
[in]nrowssize of the first dimension
[in]ncolssize of the second dimension
[out]m_nrowsthe expected rows size, if m_nrows less or equal to 0, then m_nrows = mrows
[out]m_ncolsthe expected cols size, if m_ncols less or equal to 0, then m_ncols = ncols

◆ GetTimeStepType()

virtual TimeStepType SimulationModule::GetTimeStepType ( )
virtual

Get time step type, default is hillslope process.

   Remember to OVERRIDE this function to return other time step type for
   routing modules and others if necessary.

IKW_REACH, SEDR_SBAGNOLD, ImplicitKinematicWave_CH, ReservoirMethod, MUSK_CH, NutrCH_QUAL2E , 以及 NutrientinGroundwater 重载.

◆ InitialIntermediates()

virtual void SimulationModule::InitialIntermediates ( )
virtual

Initialize intermediate parameters for reducing computing amount.

   This function is optional to be overridden.
   Intermediate parameters only need to be calculated once
     and will not change during simulation.
   This function must be separated with InitialOutputs().

   For example, K*P*LS*11.8*exp(ROCK) in the equation of MUSLE can be
     considered as an intermediate parameter.

SERO_MUSLE , 以及 NutrientTransportSediment 重载.

◆ InitialOutputs()

virtual void SimulationModule::InitialOutputs ( void  )
virtual

枚举类型说明

◆ AggregationType

Aggregation type for OUTPUT

枚举值
AT_Unknown 

unknown

AT_Sum 

sum

AT_Average 

average

AT_Minimum 

minimum

AT_Maximum 

maximum

AT_SpecificCells 

specific cells

◆ dimensionTypes

enum of dimension data types

枚举值
DT_Unknown 

Unknown type

DT_Single 

Single floating point number

DT_SingleInt 

Single integer

DT_Array1DDateValue 

1D date array

DT_Array1D 

1D floating point array, e.g., maximum temperature of sites

DT_Array1DInt 

1D integer array

DT_Array2D 

2D floating point array

DT_Array2DInt 

2D integer array

DT_Raster1D 

Raster data in floating point number, same as DT_Array1D

DT_Raster1DInt 

Raster data in integer, same as DT_Array1DInt

DT_Raster2D 

2D raster in floating point number, e.g., multi-layers of soil properties

DT_Raster2DInt 

2D raster in integer, e.g., multiple flow direction

DT_Scenario 

Scenario used by BMPs

DT_Reach 

Reach parameters

DT_Subbasin 

Subbasin instances

◆ TimeStepType

Time step types.

枚举值
TIMESTEP_HILLSLOPE 

Hillslope scale

TIMESTEP_CHANNEL 

Channel scale

TIMESTEP_SIMULATION 

Whole simulation scale

◆ transferTypes

Float values be transferred across subbasins for MPI version

枚举值
TF_None 

Default, which means no need to be transferred

TF_SingleValue 

A single value in the data (e.g., DT_Array1D)

TF_OneArray1D 

A piece of 1D array in the data (e.g., DT_Array2D)