Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29276 Discussions

problem in header files of converted cvf project

arashnas
Beginner
777 Views
Hi,
I converted a CVF project to IVF in Visual Studio 2008 by opeing the .dsw and then converting the file according to the following link
http://software.intel.com/en-us/articles/migrating-from-compaq-visual-fortran/
When I build the project I get numerous error that surprisngly all are in the comment lines of the header files.
Could you please help me on this?
thanks
Arash
0 Kudos
5 Replies
mecej4
Honored Contributor III
777 Views
Please give an example of lines that give errors, and list the corresponding build commands -- you may need to look at the build log file for the latter.

Problems can arise if the build system is not able to correctly identify whether an included file is in fixed or free Fortran form. Problems can also arise if a fixed-form file is included in a free-form Fortran source file, and vice-versa.
0 Kudos
arashnas
Beginner
777 Views
Thanks for the quick response.the following are the lines of header files (.h)that give error with thecorresponding error message.



c earthquake parameters


Error2 error #5082: Syntax error, found IDENTIFIER 'EARTHQUAKE' when expecting one of: ( % : . = =>1


real ruplengthseg(NFSEGMAX), epilon1seg(NFSEGMAX),


Error6 error #5082: Syntax error, found END-OF-STATEMENT when expecting one of: %FILL

are the above infor enough to identify the problem?

Thanks


0 Kudos
mecej4
Honored Contributor III
777 Views
are the above infor enough to identify the problem?

No. Please display a few lines of the source code that INCLUDEs the lines that you showed, or, if the files are not too long, display their contents or attach them.

I do have a suspicion that the compiler thinks it is compiling free-form source, which would explain its complaining about the 'c' in Col-1, which would have been a comment mark in fixed-form.
0 Kudos
arashnas
Beginner
777 Views
None of the errors are in the source files, they are all in the header files. As you said the problem has to do with the format. I am trying to manually change the format of the converted file to free format.

c********1*********2*********3*********4*********5*********6*********7*2

real RUPLEN_FIXED,RUP1,RUP2,RUP3,ZDEDAU,GAMMA0,AAA,

1 ADJUST,ENREL1,ENREL2,ACC2RF1,ACC2RF2,DEFDEPTH,DEFATTN,

1 TIME_BIG,COMMPENALTY,

1 EMINLOSS,ADDSIGMAINTEREVENT,ADDSIGMAINTEREVENT2

real DEDPER

Error Message is:

error #5082: Syntax error, found '**' when expecting one of: ( % : . = =>

c********1*********2*********3*********4*********5*********6*********7*2

-^

error #5082: Syntax error, found END-OF-STATEMENT when expecting one of: %FILL

real RUPLEN_FIXED,RUP1,RUP2,RUP3,ZDEDAU,GAMMA0,AAA,

---------------------------------------------------------^

error #5082: Syntax error, found ',' when expecting one of: ( % : . = =>

1 ADJUST,ENREL1,ENREL2,ACC2RF1,ACC2RF2,DEFDEPTH,DEFATTN,



Thanks
Arash

0 Kudos
mecej4
Honored Contributor III
777 Views
None of the errors are in the source files, they are all in the header files.

That statement throws some light on your problems. First of all, files included in Fortran are not "header" files. Although included files may have some attributes that they share with C header files, there are substantial differences.

Secondly, Fortran being a compiled language, source files have quite a bit of structure to them, and it does not always make sense to attribute any error to a specific line of source.

Typically, file or file fragment inclusion is performed before the compiler makes a pass at compiling the source. I find it useful to ask myself "what does the compiler see after INCLUDEs have been performed?"

I believe that, in the specific example you presented, you have mixed free-format conventions (beginning statements after zero or more blanks at the beginning of a line, for one) and fixed-format conventions (a 'c' or 'C' in Column-1 signifying a comment). After INCLUDE processing the resulting text input to the compiler must be all free-format or all fixed-format.

Take steps to ensure that the input text to the compiler is consistent in format at the file level. You do not necessarily have to do any format conversions as long as you follow this requirement.

In short, try changing the 'c' in Col-1 to a '!', as required by free-format conventions.

0 Kudos
Reply