I am trying to write modern fortran wrappers for the exodusII library GitHub - sandialabs/seacas: The Sandia Engineering Analysis Code Access System (SEACAS) is a suite of preprocessing, postprocessing, translation, and utility applications supporting finite element analysis software using the Exodus database file format.
Their fortran wrapper system is convoluted and predates iso_c_bindings by a very long time. Re-writing them completely with iso_c_binding is not practical at this point.
For historical reason, C functions were given short 6-8 characters long names in Fortran.
I’d like to allow the use of the full C name, as well as the short name, and was thinking of doing so by writing an abstract interface. but can’t figure how to do so. For instance, the following does not compile under gfortran (GNU Fortran (Homebrew GCC 11.3.0_2) 11.3.0 macOS), when exppv is an external function implemented in C.
interface subroutine exppv(idexo, time_step, var_type, var_index, & obj_id, start_index, num_entities, & var_vals, ierr) INTEGER idexo ! ® INTEGER time_step ! ® INTEGER var_type ! ® INTEGER var_index ! ® INTEGER obj_id ! ® INTEGER start_index ! ® INTEGER num_entities ! ® REAL var_vals(*) ! (W) INTEGER ierr ! (W) end subroutine exppv end interface interface ex_put_partial_var subroutine exppv end interface ex_put_partial_var
Any suggestion? There quite a few functions to wrap, so tensity is a plus…