You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
are declared with a 1d array parameter of intent in in the SIDL file. This is done so that in a language like C, a pointer can be passed that will hold the shape, spacing, etc. output.
In Fortran, intent in is interpreted differently, in that declaring intent(in) on a parameter means the values of the parameter can't be changed in the subprogram. Setting intent(in) in the Fortran BMI wouldn't work. I've set the array parameter for these functions as intent(out), which means that they can only output information; information can't be communicated into the subprogram. For example, I can't change anything about the grid, I can only get back information (shape, spacing, etc.) about the grid from these functions.
I think this is the correct interpretation of the BMI, although I could also make a case for intent(inout).
The text was updated successfully, but these errors were encountered:
Use array subscripts on output variables so that it's obvious that
an existing array is being used, not a new array. E.g.,
shape(:) = [this%model%n_y, this%model%n_x]
instead of
shape = [this%model%n_y, this%model%n_x]
This is related to csdms/bmi-fortran#41.
The BMI functions
are declared with a 1d array parameter of intent in in the SIDL file. This is done so that in a language like C, a pointer can be passed that will hold the shape, spacing, etc. output.
In Fortran, intent in is interpreted differently, in that declaring
intent(in)
on a parameter means the values of the parameter can't be changed in the subprogram. Settingintent(in)
in the Fortran BMI wouldn't work. I've set the array parameter for these functions asintent(out)
, which means that they can only output information; information can't be communicated into the subprogram. For example, I can't change anything about the grid, I can only get back information (shape, spacing, etc.) about the grid from these functions.I think this is the correct interpretation of the BMI, although I could also make a case for
intent(inout)
.The text was updated successfully, but these errors were encountered: