oseledets / tt-fort

Fortran computing core of the TT-Toolbox
MIT License
10 stars 10 forks source link

Non-Conformance to Fortran Standard #12

Open daskol opened 3 years ago

daskol commented 3 years ago

The latest GCC Fortran compiler produces compilation errors due to argument mismatch between procedure definition and procedure call. These errors are converted to warnings with -fallow-argument-mismatch option or -std=legacy option[1]. Importance of the issue is caused by downstream repositories like oseledets/ttpy so it would be great to fix the issues in upstream repository i.e. here.

To be more specific, there is a compiler output example below.

gfortran:f90: tt/tt-fort/ort.f90
tt/tt-fort/ort.f90:270:23:

  270 |    call dgemv('t',n,ru,1.d0,u,n,x,1, 0.d0,gu,1)
      |                       1
......
  346 |     call dgemv('n',n,ru,-one,u,n,gu,1, one,x,1)
      |                        2
Warning: Type mismatch between actual argument at (1) and actual argument at (2) (REAL(8)/COMPLEX(8)).

The reason for the warning is that double precision matrix u has actual type (:, :) instead of (n, :) at the first line. Actual type of u is double complex instead of double precision at the second line. Description of dgemv could be found here.

dolgov commented 3 years ago

This looks like an old code without recent commits raised in #6. The HEAD code contains zgemv in line 346 of ort.f90.