Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Nadjb
Novice
204 Views

Need help with fortran errors

Jump to solution

Hello, I needed to use an old f77 fortran program and I'm trying to make it functional (I'm using the Microsoft developer studio compiler not intel)
I got many errors that I managed to fix. However, I've been struggling with these 4 remaining ones :

Line 1:
FORMAT('0',4X,9('0'),10('1'),10('2'),10(,3),10('4),
Error1 : FOR3852 : syntax error detected between 4 and X

Line2 : IF(IDBUG(1).NE.0)
Error2 : FOR3852: syntax error

Lines : the subroutine is too long to include here, however everything is written exactly as in the oroginal program I don't know what I should do o fix it!
Error3 : overlapping DO/IF/SELECT/where at label 17

Line: long subroutine, in this program there were no enddo's (f77), I dnt get why of all the other do statements this is the only error regarding the missing end do!
Error4 (another subroutine): missing end do statement

If you have any direct tips or know any valuable resources that could help please let me know.

Thank you!
0 Kudos

Accepted Solutions
mecej4
Black Belt
154 Views

The source file contains dozens of errors. It appears to have been created by OCR or PDF extract from a document or image file. Examples of such errors are 'I' in place of '1', '.' in place of ',' and vice versa, etc. If you have the original document, take each line that the compiler flags as having an error and compare it with the corresponding line in the document. 

This is simple, if erroneous, Fortran 77 code, and you should be able to use any compiler.

Even after you get the file to compile with no syntax errors, it is very likely that there remain many errors. Locating and fixing these errors is a task for an experienced Fortran programmer who understand the scientific topics that the program is concerned with. Do you have a local person that you can consult and ask for help?

View solution in original post

13 Replies
mecej4
Black Belt
180 Views

You will have to provide the full source file. I can only guess one of the errors -- a missing single quote (a.k.a. apostrophe here) between 4 and ) .

Zip up the source file and attach the zip file to your reply, or upload the zip file to a cloud file storage service and provide a link here.

Nadjb
Novice
167 Views

@mecej4  here's the file (it's a very long program)

Thank you so much!

Steve_Lionel
Black Belt Retired Employee
158 Views

Someone is STILL using Microsoft Fortran PowerStation?!?!? Why?

mecej4
Black Belt
155 Views

The source file contains dozens of errors. It appears to have been created by OCR or PDF extract from a document or image file. Examples of such errors are 'I' in place of '1', '.' in place of ',' and vice versa, etc. If you have the original document, take each line that the compiler flags as having an error and compare it with the corresponding line in the document. 

This is simple, if erroneous, Fortran 77 code, and you should be able to use any compiler.

Even after you get the file to compile with no syntax errors, it is very likely that there remain many errors. Locating and fixing these errors is a task for an experienced Fortran programmer who understand the scientific topics that the program is concerned with. Do you have a local person that you can consult and ask for help?

View solution in original post

Nadjb
Novice
151 Views

@mecej4  yes it was indeed created from a pdf extract and it was filled with mistakes, I went through the entire file line by line and compared and fixed everything (or almost) 

the remaining errors however are especially in lines that are clearly identical to the original program 

I can ask for help in my university (I'm a masters student) but I don't think I can find someone who will accept giving me a lot of their time that's why I'm trying to ask online to be able to figure it out a bit at least before going to anyone. 

And do you think that changing the compiler would be better? 

thank you so much.

 

Nadjb
Novice
150 Views

@Steve_Lionel 

Because simply it was the first compiler I used to learn the basics, I don't need fortran that often and I rarely ever use it so I never gave it much thought. Do you think  that changing the compiler would be helpful for my problem?

Steve_Lionel
Black Belt Retired Employee
135 Views

PowerStation was already a dying product in 1997 when it was withdrawn from the market (after Digital Visual Fortran was introduced.) It is buggy and unsupported for more than two decades.

However, as @mecej4 notes, the source is full of syntax errors and would not be compilable by any compiler. You need to fix the errors.

You can use Intel Fortran for free.

 
mecej4
Black Belt
131 Views

If possible/permissible, please post the PDF file.

 

P.S.  More searching on the Web turned up the file elsewhere, too. The full report is available in PDF form and has unrestricted access.

Nadjb
Novice
122 Views

@mecej4  Could you instead give me your email to send it to you ?

 

Thank you so much for your time!

mecej4
Black Belt
116 Views

I have sent you a message through the private mail feature of this forum. Click on the envelope icon at the top right when you are logged in here, and reply to my message, with the PDF file attached.

JohnNichols
Valued Contributor I
103 Views

1. Code this old with implicit variables will have incorrectly named variables - statistically almost certain.  This will cause errors that are impossible to detect  

2. You will need to make implicit none and then check the algorithms -- if you are going to publish then the journals will want the original data and programs now 

3. Power station has many bugs - you need to get a modern compiler 

I do this a lot - it is much easier to do 1 2 and 3 than try and fix it 

JohnNichols
Valued Contributor I
99 Views

Things like 

Capture.PNG

also these are common errors in old code 

image_2021-02-09_150108.png

Turn on implicit none - declare the variables and you will find most of the simple errors 

Nadjb
Novice
88 Views

Okay, thank you so much!

Is this using the intel compiler?