fortran - Error: Non-numeric character in statement label at (1)? -


i wrote following 2 lines in fortran

c23456789     real h3 = 0                                                            h3=h*h*h   

and received following errors gdb :

ljmd.f:186.5:      real h3 = 0                                                               1 error: non-numeric character in statement label @ (1) ljmd.f:187.5:      h3=h*h*h                                                                  1 error: non-numeric character in statement label @ (1) ljmd.f:187.6:      h3=h*h*h                                                                   1 

what proper way create , use new variables in middle of else's fortran program? c23456789 label of current column used in program.

this in random fortran tutorial. expect have fixed source form. statement must start @ column 7 or farther.

also,

real h3 = 0 

isn't legal in free form source fortran , different thing in fixed form (see @francesalus' comment). , in case there no reason initialize variable @ all. can do

  real h3   h3 = h**3 

if happen need initialization somewhere else, either must use

  real :: = 0 

(requires fotran 90), or

  real   data a/0/ 

(in fortran77). beware, both version make variable save may know static other languages.

the last point, cannot introduce variables anywhere "in middle of program", declaration of variables have place @ beginning of each compilation unit (program, function, subroutine,...).


Comments

Popular posts from this blog

c++ - OpenCV Error: Assertion failed <scn == 3 ::scn == 4> in unknown function, -

php - render data via PDO::FETCH_FUNC vs loop -

The canvas has been tainted by cross-origin data in chrome only -