This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Compatibility between Compaq Visual Fortran and gfortran


Hello list,

i have a problem with old-style Fortran code which has been written by my
colleagues. They use some kind of Fortran IV dialect and use features which are
provided by the Microsoft PowerStation and the Compaq Visual Fortran compilers.
All their programs are compiled and run under Windows 2000 and Windows 98.

I am now trying to run their programs on my linux machine. First i have
eliminated the compiler-errors which was not too hard. But after compiling i
encounter several runtime-errors. One of the things that my colleagues use very
often is to save character values in integer arrays. I will give you an example



program read_character
implicit none

integer, dimension(10, 20) :: npar
integer                    :: i

open(unit = 10, file = 'test.par', status = 'old')

do i = 1, 20
  read(10, 1000) npar(1:10, i)
end do

1000 format(2I3, 2X, 8A4)
close(10)

end program read_character



the file 'test.par' looks like this (i give only one line, the rest looks
alike):

120 35  TESTTESTTESTTESTTESTTESTTEST

this program compiles under Compaq and can be run under Windows. One can access
this array like a normal integer array and one can get the characters out the
same way one has put them in.

This program can be compiled under linux and gcc-Version 4.0.0 20041205
(experimental). But when i run it, i get an error like this:

At line 10 of file read.f90
Fortran runtime error: Expected CHARACTER for item 3 in formatted transfer,
gotINTEGER
(2I3, 2X, 8A4)


I know that this is bad Fortran style and i do actually not want to program this
way. But i want to know from you experts if there is a way to run these old
programs without many changes in the code.

thanks a lot
jens
-- 
Mit freundlichen Gruessen
Jens Gruentjes

Tel.: +49 (0)69 / 928879-18
Fax.: +49 (0)69 / 928879-20




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]