Simple program in Fortran, I get an error

  • Context: Fortran 
  • Thread starter Thread starter fluidistic
  • Start date Start date
  • Tags Tags
    Error Fortran Program
Click For Summary
SUMMARY

The discussion centers around a Fortran programming error encountered while attempting to write a simple temperature conversion program. The user, utilizing the Goftran compiler on Ubuntu, initially faced an "Unclassifiable statement" error due to incorrect increment syntax. The solution involved changing the increment statement from "C+1" to "C = C + 1". After resolving this, the user encountered a "permission denied" error when executing the program, indicating a potential issue with file permissions.

PREREQUISITES
  • Basic understanding of Fortran syntax and structure
  • Familiarity with Goftran compiler usage
  • Knowledge of variable declaration in Fortran
  • Understanding of file permissions in Linux
NEXT STEPS
  • Research Fortran variable increment techniques
  • Learn about file permission management in Ubuntu
  • Explore debugging techniques for Fortran programs
  • Study best practices for writing Fortran programs
USEFUL FOR

This discussion is beneficial for novice Fortran programmers, students learning programming concepts, and anyone troubleshooting Fortran compilation and execution errors.

fluidistic
Gold Member
Messages
3,932
Reaction score
283
It's not an assignment. Rather I'm trying to learn back some fortran.
I've found a website with some simple problems to do, that's where I got this one. See the first problem of this page : http://www.chem.ox.ac.uk/fortran/.

Here's my program :
Program vasy
implicit none

Integer :: C
Real :: F

C=0
F=0
do while (C<=100)
F=(9./5.)*C+32
C+1
write(*,*)C,F

end do


end program vasy

Here's the error I'm getting : "
C+1
1
Error: Unclassifiable statement at (1)
"
I know I didn't have to set F=0, but I tried several things in case the error was there... I can't get rid of the problem. My compiler is goftran and I'm under Ubuntu.
 
Technology news on Phys.org
Nevermine, I just saw my problem. I had to write a=a+1 instead of just a+1.

Now I'm getting a permission denied when executing the program, but I think I'll solve it.
Thanks anyway!
 

Similar threads

  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 17 ·
Replies
17
Views
7K
  • · Replies 5 ·
Replies
5
Views
5K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 37 ·
2
Replies
37
Views
5K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 16 ·
Replies
16
Views
2K