I just started digging into the Fortran mappings and immediatedly came across the issue of how to define types. All of the other languages can be done as a nice tidy one-liner in the function definition, e.g.
def initialize(self, config_file: str) -> None:
But Fortran requires multiple lines:
function initialize(self, config_file) result(bmi_status)
class(bmi), intent(out) :: self
character(len=*), intent(in) :: config_file
integer :: bmi_status
The other approach (which I don’t really like) is use some kind of pseudo-Fortran, like
function initialize(class(bmi)::self, character(len=*)::config_file) result(integer::bmi_status)
Also, the Fortran spec uses this
but C/Python uses self
- any preferences?
Thought I’d throw this out here for comments - @mdpiper and @mcflugen I’m looking at you - before going down a particular route! We could pop this discussion across to the bmi-map repo if it’s better placed there, but I thought it might be broadly of interest to folks here.