PGFOTRAN: complex not declared

Hi,

I ran into a wired problem with pgfortran 19.1. The error message is

pgfortran -c -I./mumps_4.9.2/libseq -I./mumps_4.9.2/include -D_DEBUG_2010 -DACML40 -O0 -g main_cal.f -o main_cal.o
PGF90-S-0038-Symbol, complex, has not been explicitly declared (main_cal.f)
0 inform, 0 warnings, 1 severes, 0 fatal for main_cal

.
The datatype I declared in the source file is complex16. Tried ‘complex’,‘COMPLEX’,'COMPLEX16’, neither works. But I have other source codes with the exact same declaration, ‘complex*16’ or other I tried. They just compiled. Any clue? Thanks

That is weird and I’m not sure what would be causing it. There must be something different about this file.

Can you post a reproducing example?

-Mat

There is really nothing special about the code. But I found a way out. When I commented out ‘inplicit none’, it just complied. Any explanation.

Any explanation.

It’s sounding like the variable name itself is ‘complex’, or at least the compiler thinks it’s a variable. Can you search for all instances of “complex” and see if it’s used elsewhere? Is the code trying a cast using “complex” instead of “cmplx”?

-Mat

Any explanation.

It’s sounding like the variable name itself is called ‘complex’, or at least the compiler thinks it’s a variable. Can you search for all instances of “complex” and see if it’s used elsewhere? Is the code trying a cast using “complex” instead of “cmplx”?

-Mat