So, I'm still pretty new to FORTRAN. I'm trying to test out the methods of creating and reading from external files using the "OPEN, READ, and WRITE" commands. However, I keep running into problems when I try to use the "&" symbol to link two lines.
I'm using gedit as my script (working in Ubuntu with gfortran as my compiler).
Here is my code:
PROGRAM reader2
!This program is used to test the OPEN and CLOSE functions
IMPLICIT NONE
INTEGER :: i_err
REAL :: i,j
OPEN(UNIT=30, FILE='info2.dat', STATUS='REPLACE', &
ACTION='WRITE', IOSTAT=i_err)
OPEN(UNIT=100, FILE ='info.dat',STATUS='OLD',ACTION='READ')
READ(100,*) i,j
WRITE(30,*) i
WRITE(30,*) j
END
And the error message that I keep getting is:
cory@cory-VirtualBox:~/Documents$ gfortran reader2.f
reader2.f:8.55:
OPEN(UNIT=30, FILE='info2.dat', STATUS='REPLACE', &
1
Error: Syntax error in OPEN statement at (1)
reader2.f:9.11:
ACTION='WRITE', IOSTAT=i_err)
1
Error: Unclassifiable statement at (1)
I'm using gedit as my script (working in Ubuntu with gfortran as my compiler).
Here is my code:
PROGRAM reader2
!This program is used to test the OPEN and CLOSE functions
IMPLICIT NONE
INTEGER :: i_err
REAL :: i,j
OPEN(UNIT=30, FILE='info2.dat', STATUS='REPLACE', &
ACTION='WRITE', IOSTAT=i_err)
OPEN(UNIT=100, FILE ='info.dat',STATUS='OLD',ACTION='READ')
READ(100,*) i,j
WRITE(30,*) i
WRITE(30,*) j
END
And the error message that I keep getting is:
cory@cory-VirtualBox:~/Documents$ gfortran reader2.f
reader2.f:8.55:
OPEN(UNIT=30, FILE='info2.dat', STATUS='REPLACE', &
1
Error: Syntax error in OPEN statement at (1)
reader2.f:9.11:
ACTION='WRITE', IOSTAT=i_err)
1
Error: Unclassifiable statement at (1)