Generic or Kind-Agnostic linear system solvers

First, thank you for your answer.

The way I am tackling the task here is first to set up a solver with intrinsics and from there build up more complicated stuff. The first step is of course change the intrinsics to blas/lapack, but at this point there is no need to throw away the previous implementation, that could be helpful as a gateway to explain the methods (a CG is basically 20lines of fortran, apart from declaration). Moreover, providing both intrinsic and blas/lapack implementation could be extremely useful then to understand how to use those tools.

So, how to make them not mutually exclusive at compile time, meaning not to have to choose either intrinsic or lapack, but rather having both of them compiled?

This is super interesting, are these called procedure pointers right? I will try looking into it, but are these “as dangerous” as regular pointers (which I am not familiar with, I still have to check them out in detail)?