- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello everyone,
I ported some code which was running with compaq visual fortran into a linux system.
Here is a seemingly simple problem which taken sometime of mine. So I thought it may be useful to post in forums.
Here is an include file, which includes a named COMMON block.
This file when compiled with 'ifort -c' or 'ifort -free -c' gives following error:
------------------------------- ERROR--------------------
ckstrt.f(10): error #5082: Syntax error, found END-OF-FILE when expecting one of:
I ported some code which was running with compaq visual fortran into a linux system.
Here is a seemingly simple problem which taken sometime of mine. So I thought it may be useful to post in forums.
Here is an include file, which includes a named COMMON block.
[fxfortran] COMMON /CKSTRT/ NMM , NKK , NII , MXSP, MXTB, MXTP, NCP , NCP1, & NCP2, NCP2T,NPAR, NLAR, NFAR, NLAN, NFAL, NREV, & NTHB, NRLT, NWL, NRNU, NORD, MXORD,IcMM, IcKK, & IcNC, IcPH, IcCH, IcNT, IcNU, IcNK, IcNS, IcNR, & IcLT, IcRL, IcRV, IcWL, IcFL, IcFO, IcKF, IcTB, & IcKN, IcKT, IcRNU,IcORD,IcKOR,NcAW, NcWT, NcTT, & NcAA, NcCO, NcRV, NcLT, NcRL, NcFL, NcKT, NcWL, & NcRU, NcRC, NcPA, NcKF, NcKR, NcRNU,NcKOR,NcK1, & NcK2, NcK3, NcK4, NcI1, NcI2, NcI3, NcI4 [/fxfortran]
This file when compiled with 'ifort -c' or 'ifort -free -c' gives following error:
------------------------------- ERROR--------------------
ckstrt.f(10): error #5082: Syntax error, found END-OF-FILE when expecting one of:
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The COMMON statement must be followed by something, at least an END statement.
If you get errors when INCLUDE-ing this file, it could be that your main code is free-format, and this file is fixed format. If so, and you need the include file to be compatible with fixed and free format, you can add an ampersand at column 73 for all but the last line. The result is an "intersection" format that is compatible with both forms. Column 73 is ignored in fixed format, and seen as a continuation in free format..
If you get errors when INCLUDE-ing this file, it could be that your main code is free-format, and this file is fixed format. If so, and you need the include file to be compatible with fixed and free format, you can add an ampersand at column 73 for all but the last line. The result is an "intersection" format that is compatible with both forms. Column 73 is ignored in fixed format, and seen as a continuation in free format..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
By itself, the file that you showed is not a complete program unit (subroutine, function, block data or program) and, therefore, is not compilable on any operating system with any compiler.
To avoid compiling an include fragment, one often gives the file a name with a file-type other than .f, .for or .f90; for example, .inc.
If you showed a valid source code in which this file is INCLUDEd, and you ran into problems compiling it, that would have been something worthwhile to post here.
To avoid compiling an include fragment, one often gives the file a name with a file-type other than .f, .for or .f90; for example, .inc.
If you showed a valid source code in which this file is INCLUDEd, and you ran into problems compiling it, that would have been something worthwhile to post here.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Joe and Mecej,
Both of you are right. I got confused by its "extension". The file comes with a commercial software.
It does not need be compiled.
Inkant.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page