Toon posts:

Fortran Error: Constants and expressions in read-only lists

Pagina: 1
Acties:
  • 153 views sinds 30-01-2008
  • Reageer

Verwijderd

Topicstarter
Ik heb volgende foutmelding in fortran:
Error: Constants and expressions are invalid in read-only I/O lists.

De code die ik probeer te laten draaien is devolgende:
Program Monolietreactor

implicit none

integer NPDE, NX, NY, OPTI(4), LENRWK, LENIWK, IWK(255),
& ITRACE, IND, IFAIL, LENLWK
real TS, TOUT, DT(3), XMIN, XMAX, YMIN, YMAX, TOLS, TOLT,
& OPTR(3,255), RWK(255)
logical LWK(255)

open(11,file='input.da')

read(11,901) NPDE
read(11,902) TS
read(11,902) TOUT
read(11,903) (DT(i),i=1,3)
read(11,902) XMIN
read(11,902) XMAX
read(11,902) YMIN
read(11,902) YMAX
read(11,901) NX
read(11,901) NY
read(11,902) TOLS
read(11,902) TOLT

read(11,903) OPTI
do 100,i=1,3
read(11,903) (OPTR(i,j),j=1,NPDE)
100 continue
read(11,901) LENRWK
read(11,901) LENIWK
read(11,901) LENLWK
read(11,901) ITRACE
read(11,901) IND
read(11,901) IFAIL

close(11)


C Formats

901 format(I)
902 format(E)
903 format(255E)

end


Is er iemand die mij kan helpen?

  • EXX
  • Registratie: Juni 2001
  • Laatst online: 19:20

EXX

EXtended eXchange

Moet in deze loop:

code:
1
2
3
do 100,i=1,3
read(11,903) (OPTR(i,j),j=1,NPDE)
100 continue


j niet oplopen van 1 to 255?

For it is the doom of men that they forget...           Huidige en vroegere hardware specs         The Z80 is still alive!


Verwijderd

Topicstarter
Ik weet hier nog niet hoeveel NPDE zal bedragen...
Daarom stel ik mijn vector breed genoeg in.
Of zijn er elegantere manieren?