Open dimpase opened 3 years ago
The problem is that in some of the calls to dgemv
COMPLEX types are used, e.g. on l.346 one
is COMPLEX, but on
l.270 the corresponding 4th and 9th parameters are DOUBLE.
By right, dgemv
does not take COMPLEX, for these one must use cgemv
.
I suppose the solution is just to replace one
with a DOUBLE.
Hmm, no, sorry, some of the calls to dgemv
are really on the COMPLEX arrays. Do they meant to be calls to zgemv
?
I guess the following is the correct change:
--- a/ort.f90
+++ b/ort.f90
@@ -343,8 +343,8 @@ contains
do while(reort.and.pass.lt.3)
call zgemv('c',n,ru,one,u,n,x,1, zero,gu,1)
call zgemv('c',n,r,one,yy,n,x,1, zero,gv,1)
- call dgemv('n',n,ru,-one,u,n,gu,1, one,x,1)
- call dgemv('n',n,r,-one,yy,n,gv,1, one,x,1)
+ call dgemv('n',n,ru,realpart(-one),realpart(u),n,realpart(gu),1, realpart(one),realpart(x),1)
+ call dgemv('n',n,r,realpart(-one),realpart(yy),n,realpart(gv),1, realpart(one),realpart(x),1)
bb(1:ru,j)=bb(1:ru,j)+gu; bb(ru+1:ru+r,j)=bb(ru+1:ru+r,j)+gv(1:r)
nrm1=nrm2; nrm2=dznrm2(n,x,1); reort=nrm2.lt.nrm1/2; pass=pass+1
end do
the next obstacle is
gfortran -fdefault-integer-8 -ffree-line-length-none -O3 -fPIC -c matrix_util.f90
matrix_util.f90:184:32:
184 | call zcopy(m, A(i,1), n, C(1,i),1)
| 1
......
321 | call zcopy(n1*n2*n3, C, 1, A, 1)
| 2
Error: Element of assumed-shape or pointer array as actual argument at (1) cannot correspond to actual argument at (2)
matrix_util.f90:164:32:
164 | call dcopy(m, A(i,1), n, C(1,i),1)
| 1
......
297 | call dcopy(n1*n2*n3, C, 1, A, 1)
| 2
Error: Element of assumed-shape or pointer array as actual argument at (1) cannot correspond to actual argument at (2)
grep -R orto_z ./ ./ort.f90: module procedure orto_d,orto_z ./ort.f90: subroutine orto_z(u,v,out,mat)
It seems that orto_z is some very old legacy that is used nowhere actually, but indeed all MMs should be zgemv there. Committed zgemv just to make it compile.
Re second error, it seems there is either a bug or a paranoid feature in gfortran >=10 (https://gitmemory.com/issue/cp2k/dbcsr/377/712700623) that treats passing elements as a reference to address as an error. It's best to find which gfortran flag reverts to the legacy fortran, but I don't have gcc 11 to experiment with.
On Fri, Jun 18, 2021 at 6:56 PM dolgov @.***> wrote:
Re second error, it seems there is either a bug or a paranoid feature in gfortran >=10 (https://gitmemory.com/issue/cp2k/dbcsr/377/712700623) that treats passing elements as a reference to address as an error. It's best to find which gfortran flag reverts to the legacy fortran, but I don't have gcc 11 to experiment with.
I am not sure - it might be the result of stricter imposition of Fortran 90 syntax. That link refers to gfortran 10, but this is gfortran 11. Type checking does not come for free.
The real problem seems to be the lack of an interface description for Lapack, something akin to https://github.com/certik/fortran-utils/blob/master/src/lapack.f90
GCC 9 lacks the option -fallow-argument-mismatch. Please create a new preset in Makefile.in for GCC 11.
This was originally reported as https://github.com/oseledets/ttpy/issues/82 - but is can also be reproduced directly here.