translate - Compaq Visual Fortran versus gfortran FORMAT statement differences -


i have huge piece of fortran code , want compile code gfortran. have not worked fortran before. not know specification code of, found out can compiled @ least compaq visual fortran 6.6 - may guess written under it.

the general question is: is there automatic compaq visual fortran gfortran translator? have found none.

in fact, code compile gfortran after fixes, misbehaves @ runtime: not read input files expected. here example of code:

character*6  var1 character*1  var2 character*3  var3  open (unit=channel, file=filename, status='old') read(channel, 38)var1,var2,var3  38 format(15x,a6,7x,a1,14x,a3) 

and example of data:

123456789012345------'1234567-'''''12345678901234--- .abcdef.ghi.jklmnopqr.stuvwx.yzabc.def.ghi.jklm....p 123456789012345------1234567-12345678901234--- 

first line how original app reads it, third - gfortran, second - example of line datafile (1-9 ommited chars, - read, ' unmentioned format, . in example instead of spaces in original line).

so, results be:

origanal: var1 == 'mnopqr', var2 == 'y', var3 == '..p' - correct gfortran: var1 == 'mnopqr', var2 == '.', var3 == 'jkl' - wrong 

gfortran quite straightforward: jumps on 15 characters, reads 6, jumps on 7 , on. original application goes way , can not guess logic. still reads specified number of chars, jumps farther specified. , read expected read.

i tried specify exact lengths appear in input file (15x,a6,8x,a1,19x,a3), , works gfortran, not long-term solution.

so, more specific question is: are there differences in format statement in gfortran , compaq visual fortran 6.6? (maybe, wrong thinking format cause)

upd

i guess, there can splitting words or so. mean gfortran counts characters, cvf different.

if paper exercise , asked values of var1, var2 , var3 be, i'd give same result gfortran.

what saying strange. i've tried on powerstation4, ivf7 (the versions before , after cvf6.6) , give same result gfortran. i've tried different word alignment, , different datatypes (not legal gfortran can on older compilers) , comes same answer.

are sure reading file think reading. powerstation , versions of cvf have 8.3 filename problem. not cope long filenames.


Comments

Popular posts from this blog

node.js - Bad Request - node js ajax post -

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -