Parameter 8 (and 10) are the leading dimensions of the matrix, they are independent of the transpose option in the first and second argument.
call sgemm('T','N',n,n,m,1.0,Jr,n,Jr,m,0.0,C,n)
! ^ - actual leading dimension
! |
! incorrect size, should be size(Jr, 1)
Setting up calls to BLAS can be tedious to setup, I created a collection of interfaces to all BLAS routines plus convenience wrappers to set the dimension values automatically.
This should allow you to simply use
use blas, only : blas_gemm
! ...
call blas_gemm(Jr, Jr, C, transa="T")
Are there some test examples available to confirm that the parameters/variables are correctly passed? Although, I am expected to test some routines in the future using these interfaces.
The BLAS interface is in use in several of our projects, mainly as copy rather than as proper dependency. The LAPACK interface was only assembled recently, I still have to do some testing to ensure they all work properly.