LAPACK interfaces

Partially for compatibility with C, it makes it the caller’s responsibility to provide a contiguous array section.

The second and main reason I believe is that Lapack originated in F77, before dynamic memory allocation was widely available upon the arrival of Fortran 90.

Instead you might have just declared a big work-array:

integer, parameter :: n = 3
real :: work(10,11)    ! Sufficient for systems of size 10 × 10
integer :: iwork(10), info
external :: sgetrf, sgetrs

! Fill the top-left n × n block of work
! ...

call sgetrf(n,n,work(1,1),10,iwork,info)

! Right-hand side is stored in the last column
work(1,11) =  1.0
work(2,11) =  2.0
work(3,11) = -3.0

call sgetrs('N',n,1,work(1,1),10,iwork,work(1,11),10,info)
end 

If you add the intent attributes now and try to compile such a legacy code, it will be riddled with compiler warnings and errors…

Edit: here was a semi-related example of a BLAS call to banded matrix vector multiplication. With an explicit interface, it turns out you need to use pointer remapping to match the compiler’s expectations. With an external procedure, you just pass the corresponding first array element.