I can only get this to work if the function is included in a module. I want them in a library.
Could not figure out how to attach example files, so here is cut and paste:
The function returns an array. This requires an explicit interface to be visible. When you had the function in a module, that provided the interface. There's no reason you can't put it in a module and then in a library - but the caller will need to use the module. See https://software.intel.com/en-us/blogs/2012/01/05/doctor-fortran-gets-explicit-again