Silverfrost Forums

Welcome to our forums

Fortran is not compiling the source due to one line.

16 Jan 2012 9:37 #9473

909 FORMAT(i3,2x,<nvmax>(<nvmax>i1,2x),2x,i4)

Is returning the error:

../gensc.f90:289.18: Error: Unexpected element '<' in format string at (1)

I suspected that <nvmax> was asking for me to set the value, and when I tried inputting the value as an integer it still produced the same error. I appreciate any help provided!

17 Jan 2012 5:07 #9474

Good old VAX/VMS eh?

Try something like this:

character*80 format_string
integer*4 iarray(4)
nvmax = 4
open(unit=10,file='myoutput.txt',status='unknown')

!build a charachter variable containing the format
write(format_string,1000)nvmax,nvmax

1000 format('(i3,2x,' ,i2, '(' ,i2, 'i1,2x),2x,i4)' )

!use the format in the character string
write(10,format_string)1,(iarray(i),i=1,nvmax),2

close(unit=10)

We just need the 'Q' format now, and the indexed files!

Please login to reply.