new HydroLangBMI(configfile)
BMI implementation of the functions of HydroLang.js Creates and updates forcings and data following the models from configuration files and makes calls from other modules. If no link is added into the configuration, then an error will be raised. All instances of HydroLang will be accessible through the BMI configuration file.
Parameters:
Name | Type | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
configfile |
Object | The configuration file object. Properties
|
Extends
Methods
(static) dataTypes() → {String}
Returns the data types found within JS and used throughout a specific model run.
Returns:
type of value passed to the function
- Type
- String
(static) finalize() → {void}
Finalizes the requirements of a specific function.
Returns:
alert about model simulation being finalized.
- Type
- void
(static) generateOutputs() → {Object}
Creates an output file downloaded to local machine with the outputs of the model results.
- Source:
- To Do:
-
- Finilize implementation
Returns:
creates a memory reporter for all the values and actions taken for the model run
- Type
- Object
(static) get_component_name() → {String}
Gives back a model name defined by the configuration file
Parameters:
Type | Description |
---|---|
void |
Returns:
model and modelcode as a full name
- Type
- String
(static) get_current_time() → {Number}
Current time of the model
Returns:
- The current model time.
- Type
- Number
(static) get_end_time() → {Number}
End time of the model.
Returns:
end time specified.
- Type
- Number
(static) get_grid_edge_count(grid) → {Number}
Get the number of edges in the grid.
Parameters:
Name | Type | Description |
---|---|---|
grid |
Number | grid identifier |
Returns:
total number of grid edges
- Type
- Number
(static) get_grid_edge_nodes(grid) → {Array.<Object>}
Get the edge-node connectivity.
Parameters:
Name | Type | Description |
---|---|---|
grid |
Number | A grid identifier |
Returns:
number array of (2 x n-nodes) shape to place the edge-node connectivity. For each edge, connectivity is given as node at edge tail, followed by node at edge head.
- Type
- Array.<Object>
(static) get_grid_face_count(grid) → {Number}
Get the number of faces in the grid.
Parameters:
Name | Type | Description |
---|---|---|
grid |
Number | A grid identifier |
Returns:
The total number of grid faces.
- Type
- Number
(static) get_grid_face_nodes(grid) → {Array.<Object>}
Returns the face-edge connectivity.
Parameters:
Name | Type | Description |
---|---|---|
grid |
Number | grid identifier |
Returns:
number array to place face-edge connectivity
- Type
- Array.<Object>
(static) get_grid_face_nodes(grid) → {Array.<Object>}
Returns the face-node connectivity for a grid.
Parameters:
Name | Type | Description |
---|---|---|
grid |
Number | grid identifier |
Returns:
number array to place face-node connectivity
- Type
- Array.<Object>
(static) get_grid_node_count(grid) → {Number}
Get the number of nodes in the grid.
Parameters:
Name | Type | Description |
---|---|---|
grid |
Number | grid identifier |
Returns:
total number of grid nodes
- Type
- Number
(static) get_grid_nodes_per_face(grid) → {Array.<Object>}
Returns the number of nodes per face of grid.
Parameters:
Name | Type | Description |
---|---|---|
grid |
Number | grid identifier |
Returns:
A number Array of (n-faces)shape to place the number of nodes per face.
- Type
- Array.<Object>
(static) get_grid_origin(grid) → {Array.<Object>}
Get the origin of a grid.
Parameters:
Name | Type | Description |
---|---|---|
grid |
Number | grid identifier |
Returns:
coordinates of the origin of a specific grid
- Type
- Array.<Object>
(static) get_grid_shape(grid, shape)
Get dimensions of the computational grid
Parameters:
Name | Type | Description |
---|---|---|
grid |
Number | grid identifier |
shape |
Array.<Object> | A Number Array of n-dim shape into which to place the shape of the grid. |
(static) get_grid_size(grid-) → {Number}
Get the dimensions of a computational grid.
Parameters:
Name | Type | Description |
---|---|---|
grid- |
Number | grid identifier |
Returns:
Grid rank
- Type
- Number
(static) get_grid_size(grid) → {Number}
Get the dimensions of a computational grid.
Parameters:
Name | Type | Description |
---|---|---|
grid |
Number | grid identifier |
Returns:
Grid size
- Type
- Number
(static) get_grid_spacing(grid) → {Array.<Object>}
Get the spacing between grid nodes.
Parameters:
Name | Type | Description |
---|---|---|
grid |
Number | grid identifier |
Returns:
spacing of computational grid
- Type
- Array.<Object>
(static) get_grid_type(grid) → {String}
Get the grid type as a string.
Parameters:
Name | Type | Description |
---|---|---|
grid |
Number | A grid identifier |
Returns:
Type of grid as a string.
- Type
- String
(static) get_grid_x(grid) → {Array.<Object>}
Get the locations of a grid’s nodes in dimension x.
Parameters:
Name | Type | Description |
---|---|---|
grid |
Number | grid identifier |
Returns:
array containing n-rows holding x-coordinates
- Type
- Array.<Object>
(static) get_grid_y(grid) → {Array.<Object>}
Get the locations of a grid’s nodes in dimension y.
Parameters:
Name | Type | Description |
---|---|---|
grid |
Number | grid identifier |
Returns:
array containing n-rows holding y-coordinates
- Type
- Array.<Object>
(static) get_grid_z(grid) → {Array.<Object>}
Get the locations of a grid’s nodes in dimension z.
Parameters:
Name | Type | Description |
---|---|---|
grid |
Number | grid identifier |
Returns:
array containing n-rows holding z-coordinates
- Type
- Array.<Object>
(static) get_input_item_count() → {Object}
Lets other models see the available variables included within the model
Parameters:
Type | Description |
---|---|
void |
Returns:
array with names as strings
- Type
- Object
(static) get_time_step() → {Number}
Returns the current state of the model. For HydroLangBMI is the default time step.
Returns:
default time step
- Type
- Number
(static) get_time_units() → {String}
Time units of the model
Returns:
unit of time. If not specified in config file, the unit used throughout HydroLang is hour
- Type
- String
(static) get_value_at_indices(var_name, dest, inds) → {Array.<Object>}
Parameters:
Name | Type | Description |
---|---|---|
var_name |
String | name of input variable |
dest |
Array.<Object> | array destiny for the results |
inds |
Array.<Object> | array containing the indices |
Returns:
destiny array with objects
- Type
- Array.<Object>
(static) get_value_ptr(var_name, array) → {Error}
Get a reference to the values of a given variable. Tailored towards the final implementation of the
Parameters:
Name | Type | Description |
---|---|---|
var_name |
String | name of input or output variable |
array |
Array.<Object> | array object holding result |
Returns:
no implementation for HydroLangBMI/JavaScript.
- Type
- Error
(static) get_var_type(name) → {String}
Returns the data type of the given variable.
Parameters:
Name | Type | Description |
---|---|---|
name |
String | input or output variable name, a CSDMS Standard Name |
Returns:
Variable nme depending on the type of variable.
- Type
- String
(static) handleConfig() → {void}
Configuration object that creates a result based on the passed configurations to the HydroLang instance requirement. It saves any results on a result variable that is attached into the class after its called. The method runs once the HydroLangBMI class is called.
Returns:
- creates a result variable attached to the class.
- Type
- void
(static) initialize(configfile) → {void}
Parameters:
Name | Type | Description |
---|---|---|
configfile |
String | configuration file that contains minimum the following: model name, component name, module name, model code, function name, arguments, parameters. |
Returns:
sets the variables from above to the this object.
- Type
- void
(static) set_value(var_name, array)
Sets a value for an exisiting variable from an array.
Parameters:
Name | Type | Description |
---|---|---|
var_name |
String | name of the input variable |
array |
Array.<Object> | array with values to be copied |
(static) set_value_at_indices(var_name, inds, dest)
Sets values at particular indices
Parameters:
Name | Type | Description |
---|---|---|
var_name |
String | name of input variable |
inds |
Array.<Object> | array containing the indices |
dest |
Array.<Object> | array contaiing the results |
(static) update()
Update the model until a required time, Depending on the module and function required.
(static) update_until(time) → {void}
Updates a model and function call depending on the requirements of the function and module called.
Parameters:
Name | Type | Description |
---|---|---|
time |
Number | default time to be updated depending on the model |
Returns:
updates the current variable to the required timestep.
- Type
- void
(static) visualizer(type, data) → {Object}
Parameters:
Name | Type | Description |
---|---|---|
type |
String | either column or line chart |
data |
Array.<Object> | n-d array containing the data to render |
Returns:
creates a div on screen that renders the graph using HydroLang's visualize module.
- Type
- Object