fortran90 - Read integer statement -


i quite new fortran , have question. need read 2 integers following line:

k=234, l=241, i=0 

i not interested in last value. need integers 234 , 241. tried

read(20,'(3x,i3,3x,i3)')a,b 

it compiles, when run program error message:

at line 27 of file test.f90 (unit = 20, file = 'int_p2.dat') fortran runtime error: bad value during integer read 

don't know doing wrong. can give me advice?

you have strings in line, read statement ought account it. should replace with

  read(20, '(3(a2,i3,2x))') dumchar, k, dumchar, l, dumint, dumchar 

where dumchar character of length 2 , dumint integer.


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -