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

Pretty Basic Stuff

boyd_georgebp_com
2,351 Views
Embarassingly simple probably. "Old" code, compiled and executed in vs on ibm mainframe now moving to windows. i get error statements on a simple type delcaration statement "INTEGER VarName", error statement being syntax error expecting end of statement. can anyone identify with that? i've tried several differnt ways of saying the same thing, like implicit statements and the like. still no dice.
0 Kudos
23 Replies
Steven_L_Intel1
Employee
1,982 Views

An actual example source file would help. A common problem is free-form source in a file with a file type of .f or .for implying fixed-form source. Can you show us a sample line (mind the spacing) and the actual error message?
0 Kudos
boyd_georgebp_com
1,982 Views
Embarassingly simple probably. "Old" code, compiled and executed in vs on ibm mainframe now moving to windows. i get error statements on a simple type delcaration statement "INTEGER VarName", error statement being syntax error expecting end of statement. can anyone identify with that? i've tried several differnt ways of saying the same thing, like implicit statements and the like. still no dice.

copied from code, a .for file

0 Kudos
boyd_georgebp_com
1,982 Views
Embarassingly simple probably. "Old" code, compiled and executed in vs on ibm mainframe now moving to windows. i get error statements on a simple type delcaration statement "INTEGER VarName", error statement being syntax error expecting end of statement. can anyone identify with that? i've tried several differnt ways of saying the same thing, like implicit statements and the like. still no dice.

column
123456789012345657890

integer stages adce00xxx
real mu, k(5)acde00xxx

extracts fro code with identifiers in the right field

error:

Error 1 error #5082: Syntax error, found '::' when expecting one of: C:Documents and Settingsgeorb1My DocumentsVisual Studio 2005ProjectsADCEADCEADCE.f90 51

i'm new to this so there is likely a much better way to show code.

i could attach file and send to see if you compile same??would that work??
0 Kudos
Steven_L_Intel1
Employee
1,982 Views
You can attach a file - see the link in my signature below for instructions. I note that there is text in the sequence number field. Make sure that this starts in column 73 and that there are no tabs in the source lines.
0 Kudos
boyd_georgebp_com
1,982 Views
You can attach a file - see the link in my signature below for instructions. I note that there is text in the sequence number field. Make sure that this starts in column 73 and that there are no tabs in the source lines.

let me make sure about the tabs and fields and such. i'm not too sure about where your signature is and how to send the file to you. you'd only need a few lines as i'm getting much the same error throughout, so if i can fix one, i can fix all. the two lines i sent to you were entered by hand so i am sure they're spaced incorrectly. the destructions say not to include emails. is there some way to do that that's considered "safe"/

only spaces and the statement identifiers do begin in column 73. i assume that it's ok as far as that goes.
0 Kudos
boyd_georgebp_com
1,982 Views
You can attach a file - see the link in my signature below for instructions. I note that there is text in the sequence number field. Make sure that this starts in column 73 and that there are no tabs in the source lines.

i believe i've sent the code to you

there's nothing proprietary in it that i know of.

Likely past your work day, so i'll return tomorrow. perhaps we cna find the problem tomorrow.
0 Kudos
Steven_L_Intel1
Employee
1,982 Views
Sorry, I did not receive your code and am not sure how you sent it.

To attach a file, follow the instructions here.
0 Kudos
boyd_georgebp_com
1,982 Views
Sorry, I did not receive your code and am not sure how you sent it.

To attach a file, follow the instructions here.

0 Kudos
boyd_georgebp_com
1,982 Views
[plain]       program adce
C *********************                                                 ADC00010
C                                                                       ADC00020
C     PROGRAM TO COMPUTE ADIABATIC COMPRESSION EFFICIENCY AND/OR        ADC00030
C     COMPRESSION RATIO TO BE EQUAL RATIOS PER STAGE WITH               ADC00040
C     VARIOUS PRESSURE DROPS PER INTERSTAGE                             ADC00050
C                                                                       ADC00060
C     AD EFF COMPUTATION REQUIRES:                                      ADC00070
C              GAS SPECIFIC GRAVITY, SG, OR MOLECULAR WEIGHT, MW        ADC00080
C              COMPRESSION RATIO, RATIO                                 ADC00090
C              SUCTION AND DISCHARGE COMPRESSIBILITY FACTORS, ZS AND ZD ADC00100
C              GAS HEAT CAPACITY RATIO, K                               ADC00110
C                                                                       ADC00120
C     FOR THE COMPRESSION RATIO COMPUTATION                             ADC00130
C                                                                       ADC00140
C              SUCTION PRESSURE, PS                                     ADC00150
C              DISCHARGE PRESSURE, PD                                   ADC00160
C              PRESSURE DROP PER INTERSTAGE, DELP (ARRAY)               ADC00170
C              NUMBER OF COMPRESSION STAGES, STAGES                     ADC00180
C                                                                       ADC00190
C     OPTIONAL:                                                         ADC00200
C              VALVE FLOW RESISTANCE FACTOR, F (VELADS), DEFAULT 4.0    ADC00210
C                 3.0  SINGLE DECK MULTIPLE POPPET VALVE                ADC00220
C                 4.0  SINGLE DECK MODERN PLATE VALVE                   ADC00230
C                 5.0  DOUBLE DECK MODERN PLATE VALVE                   ADC00240
C                 7.0  OLD (1920 - 1930) STYLE PLATE VALVE              ADC00250
C                                                                       ADC00260
C              VALVE AIR SPEED, A, DEFAULT 7000.0                       ADC00270
C                                                                       ADC00280
C              ELEVATION, ELEV, DEFAULT ZERO, PS AND PD IN PSIA         ADC00290
C                                                                       ADC00300
C              ATMOSPHERIC PRESSURE, ATM, DEFAULT ZERO,                 ADC00310
C                PS AND PD IN PSIA                                      ADC00320
C                                                                       ADC00330
C**********************                                                 ADC00340
C                                                                       ADC00350
      INTEGER STAGES                                                    ADC00360
      REAL MU,K(5),MW(5)                                                ADC00370
      CHARACTER *3 ANS,YES,Y,NO                                         ADC00380
      COMMON/ALPHA/ZS(5),ZD(5),SG(5),MW,K,RATIO(5),PS,PD,DELP(4),       ADC00390
     *  F(5),A(5),ELEV,ATM,STAGES                                       ADC00400
      COMMON/BETA/KOMRAT,KOMACE                                         ADC00410
C                                                                       ADC00420
      DATA YES/'YES'/,  Y/'Y'/, NO/'N'/                                 ADC00430
      DIMENSION AE(5)                                                   ADC00440
C                                                                       ADC00450
C  PRINT OUT THE INFO ON HOW TO USE THIS PROGRAM                        ADC00460
C                                                                       ADC00470
      CALL HDNG                                                         ADC00480
C                                                                       ADC00490
C  ZERO ALL INPUT INFORMATION                                           ADC00500
C                                                                       ADC00510
      CALL ZERO                                                         ADC00520
C                                                                       ADC00530
C  GET THE USER INPUT                                                   ADC00540
C                                                                       ADC00550
      CALL INPUT                                                        ADC00560
C                                                                       ADC00570
C  SET SOME DEFAULTS IF NOT INPUT                                       ADC00580
C                                                                       ADC00590
      CALL DFAULT                                                       ADC00600
C                                                                       ADC00610
C  BEGIN THE COMPUTATIONS  -  FIRST, IF WE NEED A COMPRESSION RATIO     ADC00620
C  COMPUTATION DO IT                                                    ADC00630
[/plain]


0 Kudos
Steven_L_Intel1
Employee
1,982 Views
I didn't get any errors compiling the code you posted, but as you didn't attach the actual file, it's possible something got lost in the translation. Please follow the instructions in the link below my name for attaching the actual file. Or, you can email it to me at steve.lionel at intel.com . Please also include the command line you are using to compile. If you are using Visual Studio, send the buildlog.htm from the Debug or Release folder.
0 Kudos
DavidWhite
Valued Contributor II
1,982 Views

column
123456789012345657890

integer stages adce00xxx
real mu, k(5)acde00xxx

extracts fro code with identifiers in the right field

error:

Error 1 error #5082: Syntax error, found '::' when expecting one of: C:Documents and Settingsgeorb1My DocumentsVisual Studio 2005ProjectsADCEADCEADCE.f90 51

i'm new to this so there is likely a much better way to show code.

i could attach file and send to see if you compile same??would that work??
Boyd,

You are using fixed format code and your filename is .f90, so the compile expects free-format, Fortran 90 syntax. Change your filename to .for, so that the compiler expects fixed format code.

David
0 Kudos
jimdempseyatthecove
Honored Contributor III
1,982 Views

Check for tab characters in your file. Fixed format files do not like tabs. Apparently this file was edited ("program adce"), so it is likely you used a "modern" editor on this file. Some editors will do you a "favor" and replace multiple spaces with tab.

If that doesn't show up anything then insert conditional compile statements in Fortran or use the conditional compile in FPP. Essentially you fence off sections of code and see if it compiles, then move the fence

Using FPP

program adce
#if 0
...
#endif
end program

If that compiles, then start moving the #if lower and/or #endif higher

At some point you might get tag not found (e.g. GOTO 100 cannot find 100 CONTINUE)

program adce
...
GOTO 100
#if 0
...
#endif
100 CONTINUE
#if 0
...
#endif
end program

Jim




0 Kudos
Steven_L_Intel1
Employee
1,982 Views
Ah, David noticed what I didn't! Well done!
0 Kudos
boyd_georgebp_com
1,982 Views
Ah, David noticed what I didn't! Well done!

I truly appreciate the help. i will email the entire file to steve. i just installed the compiler and perhaps need a lesson on using it. i do "access" it thru visual studio. the file is a .for file but when it compiles it intoduces(?) a .f90 tab within the visual studio. i use the build menu, build soluion or rebuild solution options. if there's a compile option, i'm not sure i've located it as yet.

by the way, i'm in alaska so my time zone differs from yours.
0 Kudos
boyd_georgebp_com
1,982 Views
Quoting - David White
Boyd,

You are using fixed format code and your filename is .f90, so the compile expects free-format, Fortran 90 syntax. Change your filename to .for, so that the compiler expects fixed format code.

David

Thank you david. Being new to visual studio may be my problem. I used a .for as a start. when i choose the build or rebuild options from the studio menu it appears to compile a .f90 tab where my errors are posted. supposedly it's smart enough to know the .for extension recognizes it's a fixed field file and compiles accordingly. is there an option someplace where i can ensure that?

I appreciate your insight and help. as i've entitled this whole string, i bet it's pretty basic.
0 Kudos
boyd_georgebp_com
1,982 Views

Check for tab characters in your file. Fixed format files do not like tabs. Apparently this file was edited ("program adce"), so it is likely you used a "modern" editor on this file. Some editors will do you a "favor" and replace multiple spaces with tab.

If that doesn't show up anything then insert conditional compile statements in Fortran or use the conditional compile in FPP. Essentially you fence off sections of code and see if it compiles, then move the fence

Using FPP

program adce
#if 0
...
#endif
end program

If that compiles, then start moving the #if lower and/or #endif higher

At some point you might get tag not found (e.g. GOTO 100 cannot find 100 CONTINUE)

program adce
...
GOTO 100
#if 0
...
#endif
100 CONTINUE
#if 0
...
#endif
end program

Jim





0 Kudos
boyd_georgebp_com
1,982 Views


I'm not 100% sure about how to spot tabs, but here's what i did. i went to the statement identifer field that begins in column 73 and backspaced watching for "jumps" that might suggest tabs to me. what i saw was what appears to be a space by space progression with no jumps. so i assumed there were no tabs, perhaps mistakenly. is there a more certain way to know?

Boyd
0 Kudos
Steven_L_Intel1
Employee
1,982 Views
Boyd,

While it is true that if you create a new Fortran source file in Visual Studio it selects .f90 as the file type by default, you can change that to a .for by retyping the name. Once you have the file in the project, the name does not get changed.

You can simply click twice on the file name in Solution Explorer and change the name to have a .f90 file type.
0 Kudos
boyd_georgebp_com
1,982 Views

Check for tab characters in your file. Fixed format files do not like tabs. Apparently this file was edited ("program adce"), so it is likely you used a "modern" editor on this file. Some editors will do you a "favor" and replace multiple spaces with tab.

If that doesn't show up anything then insert conditional compile statements in Fortran or use the conditional compile in FPP. Essentially you fence off sections of code and see if it compiles, then move the fence

Using FPP

program adce
#if 0
...
#endif
end program

If that compiles, then start moving the #if lower and/or #endif higher

At some point you might get tag not found (e.g. GOTO 100 cannot find 100 CONTINUE)

program adce
...
GOTO 100
#if 0
...
#endif
100 CONTINUE
#if 0
...
#endif
end program

Jim





0 Kudos
boyd_georgebp_com
1,858 Views


I'm not familiar with fpp. however, it looks like a mighty handy piece of info. because i'm new to writing a program for windows -- yes it's been that long since i've written code-- i thought i'd start with compiling a simple program that i know compiled and excuted error free on the old vs ibm system. there's likely a compile option or something that i'm missing.
0 Kudos
Reply