- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am having trouble getting CVF 6.6 code to complile w/o errors. In particular this code has named common blocks that are brought in via include statements. I get a variety of error message types such as:
C:UsersSteveDocumentsVisual Studio 2005ProjectsItrajItrajCONTRL.fi(11) : Error: Syntax error, found END-OF-STATEMENT when expecting one of: // /
C:UsersSteveDocumentsVisual Studio 2005ProjectsItrajItrajCONTRL.fi(12) : Error: Syntax error, found ',' when expecting one of: => = . ( : %
Here is the text in the include:
C:UsersSteveDocumentsVisual Studio 2005ProjectsItrajItrajCONTRL.fi(12) : Error: Syntax error, found END-OF-STATEMENT when expecting one of: ( * ::... !C
REAL*8 DTF,DTBF,DTRF,TNEXT,DTBUST,DTBUSG,TKINK,SKINK,CKINK,VKINKREAL*8 GKINK,HKINK,DAZK,RKINK,THKINK,AttTGOConst1,AttTGOConst2INTEGER ISYS,NLAST,RUNIT,WUNIT,SUNIT,LMODE,FMODEINTEGER IOUNIT,NOX,MODE,ICTOUT,BUNIT,IDXCDLOGICAL BBOOUT,VBOOUT,IPOUT,EVENST,REOUT,DMODE,STOUT,REFLY,RREFLYLOGICAL DEBUG,RVTOUT,BSTOUT,P_Ball,MaRV,RUnitOpen,BUnitOpenLOGICAL SAVE_IT,UseMaRV,UseCalc_AttChg_TgoCHARACTER*512 FNAMESCharacter*1 RV_TypeSaveCOMMON /CONTRL/ DTF,DTBF,DTRF,TNEXT,DTBUST,DTBUSG,TKINK,SKINK, 1 CKINK,VKINK,GKINK,HKINK,DAZK,RKINK,THKINK, 2 AttTGOConst1,AttTGOConst2,IDXCD,ISYS,NLAST, 3 RUNIT,WUNIT,SUNIT,LMODE,FMODE,IOUNIT,NOX,MODE, 4 ICTOUT,BUNIT,BBOOUT,VBOOUT,IPOUT,EVENST,REOUT, 5 DMODE,STOUT,REFLY,RREFLY,DEBUG,RVTOUT,BSTOUT, 6 P_Ball,MaRV,UseMaRV,UseCalc_AttChg_Tgo, 7 RUnitOpen,BUnitOpen,SAVE_IT,FNAMES(5), 8 RV_TypeSave!
Any tips?
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Your long COMMON statement, spread over several lines, has the wrong or no continuation characters!
If you are including it into a free-formatfile with '.f90' extension, you must adda space and
the & character to the end of each line to be continued. You must then remove the '1','2','3' etc
continuation characters at the beginning, as these only work with fixed format files.
If you are including into a fixed format file, then you have to add the leading 6 spaces to all statements,
except the continuation lines, where you should just add 5 spaces so that the '1','2','3' etc are
aligned correctly with column 6. You must also change comment linesbeginning '!' to begin with 'C'.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sometimes I see sources that require the /extend_source option and users forgot to add it. In general, I recommend against coding to non-standard source forms, so either stick to 72 columns or use free-form source.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Weirdly, the continuation characters '1','2','3', etc. appear as faint white when repeated in the copy of the code
displayed in the reply pane, whereas they are absent from the posted code.
If it is a fixed-format file, you still have a couple ofexclamation marks (there is a !C at the start
and a ! at the end.
If you click on the line flagged for the error, it should move the cursor to the offending line of code.
Your longest line appears to be 71 characters (assuming 6 missing blanks at the start), which
is OK, but the length should be double-checked.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Exclamation mark is ok for a comment in fixed-form.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
One possibility - I note that this is a .fi file which means an include file. If you INCLUDE this into a free-form source file (.f90 file type) you will get exactly this sort of error.
If this is the problem, there are several options, but it might do well to see just what was done in CVF to make this compile - applying the same "fix" in IVF would work.
1. Surround the INCLUDE line with:
!DEC$ NOFREEFORM
INCLUDE 'CONTRL.fi'
!DEC$ FREEFORM
making sure that the INCLUDE starts in column 6
2. Follow the rules in the Language Reference under source form for writing the include file in a manner valid for both free and fixed source forms
3. Rewrite the include file to free-form and make sure you don't use fixed-form anywhere in the application.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page