io - Fortran runtime error "bad integer for item 11 in list input" -
i receive runtime error "bad integer item 11 in list input" referencing following line of code.
read(2,*)a,b,c,d,e,f,g,h,theta1,phi1,k,l,m,n,o, $ p,theta2,phi2,s,theta3,phi3, $ r1,x1,y1,r2,x2,y2,r3,x3,y3,z1,z2,z3
the line reading
1 255.11211 0.2876 165.11404 90 4 8 0.19173 90 165.11404 0.09587 90 345.11404 4 4 0.0764 89.99915 -64.51149 0.11131 90.0015 24.23892 470.10565 -454.32263 120.7902 264.91144 114.00389 -239.12589 322.2894 293.87778 132.3114 0.01236 0.00697 0.00006 0.42619 -0.19278
so mix of integers , reals, thought okay since used * format descriptor rather specified format.
i'm using gcc compiler.
item 11 in list 0.09587
, real. using list directed input, real interpreted numeric value using f
edit descriptor (fortran 2008 cl. 10.10.3 paragraph 4). input list item corresponding f
edit descriptor must real or complex (fortran 2008 cl. 10.7.2.3.1 paragraph 1).
to fix need define k real variable. note in comment using implicit typing (where variables starting i-n integer types , rest real default). explicitly declare k real, use:
real :: k
best practices disable implicit typing (implicit none
) , explicitly type of variables.
Comments
Post a Comment