I am porting Fortran 77 to Fortran 90. I am getting the following syntax error:
source.i(4): error #5082: Syntax error, found END-OF-FILE when expecting one of: <LABEL> <END-OF-STATEMENT> ; TYPE INTEGER REAL COMPLEX BYTE CHARACTER CLASS DOUBLE ...
end structure
---------------------^
compilation aborted for source.i (code 1)
make: *** [contempt28] Error 1
Here is the code in the source.i file:
structure /arg_struct/
integer length
character*256 arg
end structure
There are only four lines to the source.i file.
The rest of the code that pertains to the source.i is in the source.f file shown here:
if (iargc() .ne. arg_count) then
print *,'usage: contempt28_tu steamtable HPGLfile PGD RXI'
1 //' RXO HXO HXI axisfile scratchdir'
call exit (1)
end if
c
c Get the arguments from the command line.
c Note that the use of the argument array is parameterized for
c easy changes, if not easy reading.
c
do i=1,arg_count
call getarg (i, args(i).arg)
args(i).length = lnblnk (args(i).arg)
end do
scratch = args(arg_scratch).arg
scratch_length = args(arg_scratch).length
c
c Open the files. If there's trouble, let the f77 run-time library report
c the error.
c
! Open the steam table file (Use the logical name). This was ! jmj
! added to allow multiple executions. ! jmj
! jmj
OPEN ( UNIT = 15, FILE =
1 args(arg_steam).arg(:args(arg_steam).length),
1 STATUS = 'OLD', READONLY, FORM = 'UNFORMATTED') ! jmj
open (50, file=args(arg_hpgl).arg(:args(arg_hpgl).length),
1 status='unknown') !HPGL
open (51, file=args(arg_pgd).arg(:args(arg_pgd).length),
1 status='unknown', form='unformatted')!output for plotting program
open (10, file=args(arg_rxi).arg(:args(arg_rxi).length),
1 status='old', readonly) !DRXE1
open (11, file=args(arg_rxo).arg(:args(arg_rxo).length),
1 status='unknown') !RXO
open (7, file=args(arg_hxo).arg(:args(arg_hxo).length),
1 status='unknown') !HXO
open (3, file=args(arg_hxi).arg(:args(arg_hxi).length),
1 status='old', readonly) !HX1
open (53, file=args(arg_axis).arg(:args(arg_axis).length),
1 status='old', dispose='delete') !axis
I followed the advice of this website with no luck
https://gcc.gnu.org/onlinedocs/gcc-4.4.1/gfortran/STRUCTURE-and-RECORD.html
Here is the new source.i file based on what I read in the link above.
TYPE arg_struct
integer length
character*256 arg
END TYPE
I am still getting the syntax error.
I modified the rest of the source code per the information I read in the link:
if (iargc() .ne. arg_count) then
print *,'usage: contempt28_tu steamtable HPGLfile PGD RXI'
1 //' RXO HXO HXI axisfile scratchdir'
call exit (1)
end if
c
c Get the arguments from the command line.
c Note that the use of the argument array is parameterized for
c easy changes, if not easy reading.
c
do i=1,arg_count
call getarg (i, args(i)%arg)
args(i)%length = lnblnk (args(i)%arg)
end do
scratch = args(arg_scratch)%arg
scratch_length = args(arg_scratch)%length
c
c Open the files. If there's trouble, let the f77 run-time library report
c the error.
c
! Open the steam table file (Use the logical name). This was ! jmj
! added to allow multiple executions. ! jmj
! jmj
OPEN ( UNIT = 15, FILE =
1 args(arg_steam)%arg(:args(arg_steam)%length),
1 STATUS = 'OLD', READONLY, FORM = 'UNFORMATTED') ! jmj
open (50, file=args(arg_hpgl)%arg(:args(arg_hpgl)%length),
1 status='unknown') !HPGL
open (51, file=args(arg_pgd)%arg(:args(arg_pgd)%length),
1 status='unknown', form='unformatted')!output for plotting program
open (10, file=args(arg_rxi)%arg(:args(arg_rxi)%length),
1 status='old', readonly) !DRXE1
open (11, file=args(arg_rxo)%arg(:args(arg_rxo)%length),
1 status='unknown') !RXO
open (7, file=args(arg_hxo)%arg(:args(arg_hxo)%length),
1 status='unknown') !HXO
open (3, file=args(arg_hxi)%arg(:args(arg_hxi)%length),
1 status='old', readonly) !HX1
open (53, file=args(arg_axis)%arg(:args(arg_axis)%length),
1 status='old', dispose='delete') !axis
Thank you in advance for your time!