1

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.

  • 1
    The manual says: "When set to RELAXED, the run time I/O library enforces limited conformance between the data type of each I/O list item and the formatted data edit descriptor." so, in my opinion, nothing to do with assignments but just wist read / write statements. – albert Jun 13 '19 at 13:53
  • 2
    In this case, it may be easier to just fix the code. Since the errors point to you directly to the correct places, you just have to check each one and change the assigned value. – rtoijala Jun 13 '19 at 16:02

0 Answers0