Relaxed implicit type conversion between integer and logical using the Cray Fortran Compiler (cce 8.7.9)

185 Views Asked by At

I need to compile some legacy Fortran code using the Cray Fortran compiler. The project is a massive codebase, and I would like to make as few changes to the code as possible to get it to compile. A simplified version of the code that will not compile is as follows:

program program_name
implicit none      
logical :: hello
hello = 0
end program program_name

When compiling with gfortran, the code throws the following warning, however it will successfully run.

Warning: Extension: Conversion from INTEGER(4) to LOGICAL(4) at (1)

When compiling with ftn (the cray compiler), the code throws an error and does not compile.

Assignment of a INTEGER expression to a LOGICAL variable is not allowed.

The Cray fortran manual suggests setting some environment variables to fix this issue, however I have used the environment variable FORMAT_TYPE_CHECKING=RELAXED, which has made no difference.

For this project, the code must be compiled using the cray compiler, so switching compilers is not an option.

Are there any compiler flags / environment variables that allow for relaxed implicit type conversion?

Thank you.

0

There are 0 best solutions below