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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

missing initial left parenthesis in format...

Status
Not open for further replies.

starlite79

Technical User
Aug 15, 2008
89
US
Hi.

I am trying to write some standard output to file with a name based on a few characters from a file name I specify. Here are some important chunks of code I'm using:
Code:
      character*20 infile1(20), infile2(20), tfile

      do 100 i=1,15
         read(iunit(1),1099) infile1(i)
 100     write(*,*) infile1(i)


      tfile=infile1(15)
c     ofile name is xxxxx_tseries_yymmdd.dat  (line 238)
      len_ofile = index(opath,' ') - 1
      ofile=opath(1:len_ofile)//'xxxxx_tseries_'//tfile(4:9)//'.dat'

The 15th index of infile1 is a file similar to xxxyymmddh00.xxxx

So, I'd like the 4-9th characters of that file to be included in the output file name. However, at line 238 of my code (marked above) I get a Fortran runtime error of "missing initial left parenthesis in format" and then it lists my file infile1(15)

I can't figure out what this error means. Would appreciate some help.
 
The format for 1099 is a17. I had been trying to write out more files than what had been statically allocated (at least that is what I think the problem was). This code was written in such a way that indices and whatnot are hard coded, which makes it difficult to modify.

My next problem to solve will be how to fix the code since hard coding isn't a good idea.
 
It is probably reporting an error on the wrong line. Are there any other format statements?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top