ecmwf-ifs / ectrans

Global spherical harmonics transforms library underpinning the IFS
Apache License 2.0
15 stars 30 forks source link

Create BLAS interfaces for GEMM and GEMV #65

Closed wdeconinck closed 4 months ago

wdeconinck commented 4 months ago

This PR creates a module "ectrans_blas_mod" with interfaces GEMM and GEMV, which delegate calls to the correct BLAS function DGEMM/SGEMM and DGEMV/SGEMV.

With this in many places constructs like

IF( LLDOUBLE ) THEN
  CALL DGEMM( ... JPRD ... )
ELSE
  CALL SGEMM( ... JPRM ... )
ENDIF

can be replaced with a one liner where possible:

CALL GEMM( ... JPRB ... )

For SGEMM it also encapsulates the IEEE floating point handling, which was copy-pasted in various places.

Also, and why I started this in the first place, is that now all the argument-mismatch warnings with gfortran > 10 are eradicated.

samhatfield commented 4 months ago

Apart from comment above, looks great to me! Much neater now.