Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

READ command exceed line limit

Status
Not open for further replies.

torehan

Technical User
Dec 29, 2010
2
TR
Hi all,

I'm a freshman in FORTRAN and it's a bit hard to get used to FORTRAN syntax.

I have a READ command on my script like,

:
:
READ(k,*) (((chg(ix,iy,iz),ix=1,FFT1(1)),iy=1,FFT1(2)),iz=1,FFT1(3))
:
:

When I compile the script with gfortran I get an error message:

hirshfeld.f:56.15:

READ(k,*) (((chg(ix,iy,iz),ix=1,FFT1(1)),iy=1,FFT1(2)),iz=1,FFT1(3
1
Error: Expected variable in READ statement at (1)


Take note that the argument of the READ command is truncated.

#######################
READ(k,*) (((chg(ix,iy,iz),ix=1,FFT1(1)),iy=1,FFT1(2)),iz=1,FFT1(3))
READ(k,*) (((chg(ix,iy,iz),ix=1,FFT1(1)),iy=1,FFT1(2)),iz=1,FFT1(3
#######################

I try to compile the script with Intel Fortran Compiler and it is also problematic.


#######################
hirshfeld.f(56): error #5082: Syntax error, found END-OF-STATEMENT when expecting one of: ) :: , :
READ(k,*) (((chg(ix,iy,iz),ix=1,FFT1(1)),iy=1,FFT1(2)),iz=1,FFT1(3))
--------------------------------------------------------------------------^
compilation aborted for hirshfeld.f (code 1)
#######################


Is that error occurs because of exceeding the line limit of FORTRAN?

Thanks in advance
T



 
There is a line limit of 72 if you are building F77 programs in IVF. You can get around this with /extend_source:132

If you're using visual studio, it is under Fortran/Language/Fixed line length.

The problem with k is probably because you have something like implicit none so it doesn't know what type k is. It needs to be declared.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top