Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 18 additions & 17 deletions bmi.sidl
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
//
// The Basic Model Interface (BMI)
//
package csdms version 2.1-dev.0 {
interface bmi {
package csdms version 3.0-alpha1 {
interface bmi3 {

// Model and BMI metadata
int get_bmi_version(out string version);
Expand All @@ -15,18 +15,19 @@ package csdms version 2.1-dev.0 {

// Model information
int get_component_name(out string name);
int get_input_item_count(out int count);
int get_output_item_count(out int count);
int get_input_var_names(out array<string, 1> names);
int get_output_var_names(out array<string, 1> names);

// Variable set information
int get_varset_member_count(in string set_name, out int count);
int get_varset_members(in string set_name, out array<string, 1> names, out array<int, 1> indexes);

// Variable information
int get_var_grid(in string name, out int grid);
int get_var_type(in string name, out string type);
int get_var_units(in string name, out string units);
int get_var_itemsize(in string name, out int size);
int get_var_nbytes(in string name, out int nbytes);
int get_var_location(in string name, out string location);
int get_var_index(in string name, out int index);
int get_var_grid(in int index, out int grid);
int get_var_type(in int index, out string type);
int get_var_units(in int index, out string units);
int get_var_itemsize(in int index, out int size);
int get_var_nbytes(in int index, out int nbytes);
int get_var_location(in int index, out string location);

// Time information
int get_current_time(out double time);
Expand All @@ -36,14 +37,14 @@ package csdms version 2.1-dev.0 {
int get_time_step(out double time_step);

// Getters
int get_value(in string name, in array<> dest);
int get_value_ptr(in string name, out array<> dest_ptr);
int get_value_at_indices(in string name, in array<> dest,
int get_value(in int index, in array<> dest);
int get_value_ptr(in int index, out array<> dest_ptr);
int get_value_at_indices(in int index, in array<> dest,
in array<int, 1> inds);

// Setters
int set_value(in string name, in array<> src);
int set_value_at_indices(in string name, in array<int, 1> inds,
int set_value(in int index, in array<> src);
int set_value_at_indices(in int index, in array<int, 1> inds,
in array<> src);

// Grid information
Expand Down
36 changes: 18 additions & 18 deletions docs/source/bmi.getter_setter.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,25 +24,25 @@ state variable can be changed or check the new data for validity.
:::{tab-item} SIDL
:sync: sidl
```java
int get_value(in string name, in array<> dest);
int get_value(in int index, in array<> dest);
```
:::

:::{tab-item} Python
:sync: python
```python
def get_value(self, name: str, dest: NDArray[Any]) -> NDArray[Any]:
def get_value(self, index: int, dest: NDArray[Any]) -> NDArray[Any]:
```
:::
:::{tab-item} c
:sync: c
```c
int get_value(void *self, const char *name, void *dest);
int get_value(void *self, int index, void *dest);
```
:::
::::

The `get_value` function takes a variable name and copies values into a
The `get_value` function takes a variable index and copies values into a
provided array parameter.
The type and size of the array parameter depend on the variable,
and can be determined through
Expand Down Expand Up @@ -75,25 +75,25 @@ even if the model uses dimensional variables.
:::{tab-item} SIDL
:sync: sidl
```java
int get_value_ptr(in string name, out array<> dest_ptr);
int get_value_ptr(in int index, out array<> dest_ptr);
```
:::

:::{tab-item} Python
:sync: python
```python
def get_value_ptr(self, name: str) -> NDArray[Any]:
def get_value_ptr(self, index: int) -> NDArray[Any]:
```
:::
:::{tab-item} c
:sync: c
```c
int get_value_ptr(void *self, const char *name, void **dest_ptr);
int get_value_ptr(void *self, int index, void **dest_ptr);
```
:::
::::

The `get_value_ptr` function takes a variable name and returns a reference
The `get_value_ptr` function takes a variable index and returns a reference
to a variable.
Unlike the array parameter returned from {ref}`get-value`,
the reference always points to the current values of the variable,
Expand All @@ -119,23 +119,23 @@ even if the model's state has changed.
:::{tab-item} SIDL
:sync: sidl
```java
int get_value_at_indices(in string name, in array<> dest, in array<int, 1> inds);
int get_value_at_indices(in int index, in array<> dest, in array<int, 1> inds);
```
:::

:::{tab-item} Python
:sync: python
```python
def get_value_at_indices(
self, name: str, dest: NDArray[Any], inds: NDArray[np.int_]
self, index: int, dest: NDArray[Any], inds: NDArray[np.int_]
) -> NDArray[Any]:
```
:::
:::{tab-item} c
:sync: c
```c
int get_value_at_indices(
void *self, const char *name, void *dest, int *inds, int count
void *self, int index, void *dest, int *inds, int count
);
```
:::
Expand Down Expand Up @@ -164,25 +164,25 @@ Additionally,
:::{tab-item} SIDL
:sync: sidl
```java
int set_value(in string name, in array<> src);
int set_value(in int index, in array<> src);
```
:::

:::{tab-item} Python
:sync: python
```python
def set_value(self, name: str, src: NDArray[Any]) -> None:
def set_value(self, index: int, src: NDArray[Any]) -> None:
```
:::
:::{tab-item} c
:sync: c
```c
int set_value(void *self, const char *name, void *src);
int set_value(void *self, int index, void *src);
```
:::
::::

The `set_value` function takes a variable name and an array of values,
The `set_value` function takes a variable index and an array of values,
*src*,
and copies those values into the model's internal array of values,
overwriting the current contents.
Expand Down Expand Up @@ -214,23 +214,23 @@ even if the model uses dimensional variables.
:::{tab-item} SIDL
:sync: sidl
```java
int set_value_at_indices(in string name, in array<int, 1> inds, in array<> src);
int set_value_at_indices(in int index, in array<int, 1> inds, in array<> src);
```
:::

:::{tab-item} Python
:sync: python
```python
def set_value_at_indices(
self, name: str, inds: NDArray[np.int_], src: NDArray[Any]
self, index: int, inds: NDArray[np.int_], src: NDArray[Any]
) -> None:
```
:::
:::{tab-item} c
:sync: c
```c
int set_value_at_indices(
void *self, const char *name, int *inds, int count, void *src
void *self, int index, int *inds, int count, void *src
);
```
:::
Expand Down
Loading