I have a 31 year old FORTRAN code which I want to compile on a Linux system. Specifically, the system is a CentOS.
I made an initial attempt to compile and it does compile and even runs. However, I suspect there may be some issues because of which the code doesn’t run as I was expecting. The code needs an input based on the CPU/compiler. These are the options that need to be given in a file using the icpu
variable:
c-----------------------------------------------------------------------
c S E L E C T A P P R O P R I A T E C O M P I L E R / C P U
c-----------------------------------------------------------------------
c icpu = 0...SVS Fortran (680x0/80x86)
c = 1...Lahey Fortran/Microsoft Fortran (8088/80x86)
c = 2...VAX/VMS
c = 3...SUN Fortran (68020/SPARC)
c = 4...Cray/Unicos
c = 5...Silicon Graphics Iris
c-----------------------------------------------------------------------
icpu=1
The code is of fixed-format and it’s source files have .FOR
extension.
I made an initial attempt at compiling for icpu=3
by using the --std='legacy'
option with the gfortran
compiler. It complained that it cannot find the included files. So, I changed the include directives from include 'file_name.
to include 'FILE_NAME'
and it worked. With this done, it did compile but now I am stuck at a location where the program needs to read a file as part of it’s operation. I am not sure and it may or may not be related to the way I have compiled it.
Can someone recommend anything else I can troubleshoot ? Are my compiler options ok?