0

I am using Lahey/Fujitsu Fortran 95 compiler for a fixed format code (.FOR) which has many include files. I am planning to change a couple of files to .F90 and would like to have include files with intersection format ( essentially fixed format with an ampersand at column 73 of any continued line, and with ampersand always used in column 6 for starting a continuation line).

But I am getting an error that the variable is not defined. Is there a reason intersection a format is not available for Lahey?

The same code if tested on GNU works fine. It will be nice if someone knows how to make it work in Lahey.

  PROGRAM MAIN
  IMPLICIT NONE
  INCLUDE 'test.inc'

  INTEGER*4 index1

  index1 =  1
  Varx   =  2
  Vary   =  3
  Varz   =  4
  Vara   =  5
  PRINT*,"Varx=",Varx

  END PROGRAM MAIN

test.inc

  REAL*4 Varx,Vary,Varz
  REAL*4 Vara
  COMMON /Varx/ Varx,Vary,                                          &
 &              Varz,                                               &
 &              Vara

Errors:

column 73: Missing name.
error 1110:  Missing name

Compiler Lahey/Fujitsu Fortran 7.7

Compiler Options

wp78de
  • 18,207
  • 7
  • 43
  • 71
RS_DFI
  • 13
  • 3
  • Welcome. If you have an error, you **must** show us the code that causes the error end the **exact error message**. Otherwise no-one can help you. Don't forget to show us, how you are compiling the code. Please see [ask] and [mcve]. It is really important. – Vladimir F Героям слава Sep 29 '17 at 14:43
  • [edit] the question to show the details. You must **show the code**!. Dead you read the links I posted. You really, really have to see them and you must show the code. – Vladimir F Героям слава Sep 29 '17 at 15:12
  • a bit aside maybe but the ampersand doesn't need to be in exactly column 73, just past 72 and up to 130. – agentp Sep 29 '17 at 18:10

1 Answers1

0

If the compiler gives this error with the very small code you show, then the compiler does not ignore the characters after character 73 an you cannot use the intersection format.

Try to find some option in the manual that would persuade it to do so, but you might simply be unable to use the intersection format with this compiler.


The Linux Lahey compiler manual states characters after character 72 should be ignored. If you do not observe such behaviour, you have to show us your exact compiler version, tell us how exactly you are using it, all compiler flags and check again that you are compiling exactly only those four lines you show above and nothing else.

  • Sure that the indentation is correct in the new code (var...), so 6 spaces or 5 spaces and a & in test.inc and 6 spaces in the main program (the spacing might have been lost in the editing process though). – albert Sep 29 '17 at 18:11
  • Indentation is correct as the code works for gnu fortran compiler – RS_DFI Sep 29 '17 at 18:19
  • OK, I believe you. But we need the compiler version and all compiler options that you are using in Visual Studio. I may delete this answer in the future, but we need as much information as possible to be able to help. I would recommend you to contact the Tech Support of your compiler vendor anyway. They know the most about their compiler. – Vladimir F Героям слава Sep 29 '17 at 18:54