Zero based fortran strings

@bwanakelly , is it possible for you to provide a mock-up of some representative case of a “critical C based text search routine”?

With such a case in mind, readers here can offer some ideas/tricks or alternate approaches to try out.

Chances are high the place you may start is with “thin” wrappers around the critical C routines themselves which are in C and which make use of the enhanced interoperability with C in the Fortran standard around ISO_Fortran_binding.h introduced starting Fortran 2018 revision. See here and here for simple illustrations. Basically what the thin wrappers in C approach can allow you to do is abstract away the differences between zero-based array/pointer of chars in C vs the Fortran design of CHARACTER type.

My hunch is this will minimize any performance hits you take due to the “copy the string into a Zero based array of chars before calling them” by doing away with the need to copy altogether.