Hi,
I've been trying to compile a programme and have run into a simple-looking problem. However, I haven't been able to solve it yet. Any ideas are very much appreciated. The programme looks like the following,
Code:
subroutine rescal(zy,nvar)
integer nvar,i, nexponent
double complex zy(nvar)
double precision maxabs, scalfac
maxabs = 0.d0
do i = 1, nvar
maxabs = max(zabs(zy),maxabs)
enddo
maxabs((rank 0)) should store the max of zy and maxabs. Simple, right? I try to compile this programme with gfortran and getting the following error. I don't understand as to why the compiler is complaining that maxabs should be rank1 and not rank 0. To my understanding, zabs is the right function to use with a double precision complex number.
gfortran -e -Ofast -ffixed-line-length-none -std=legacy -c -o rescal.o rescal.f
rescal.f:13.8:
maxabs = max(zabs(zy),maxabs)
1
Error: Incompatible ranks 0 and 1 in assignment at (1)
make: *** [rescal.o] Error 1