kathrynag
- 595
- 0
Fortran 95!
Does anyone know how to program with Fortan 95? I need some help!
Does anyone know how to program with Fortan 95? I need some help!
The discussion revolves around programming in Fortran 95, specifically focusing on writing a program to calculate the distance between two points on a Cartesian coordinate plane. Participants seek help with coding errors and syntax issues related to their Fortran 95 implementation.
Participants generally agree on the identification of syntax and logical errors in the code, but there is no consensus on the best practices for handling line extensions and input formatting.
Participants express uncertainty about specific compiler error messages and the differences between Fortran 90 and Fortran 95, indicating a need for clarification on these points.
mgb_phys said:I don't know f90 but what are the error messages ?
there's no real difference, between Fortran90 and Fortran95,kathrynag said:i don't know right off hand, but it's f95.
Useful nucleus said:I think there are two bugs:
(1) The exponentiation operator is (**) in F95, not (^)
(2)The read statement before end program should be write instead
write(*,*) 'This program calculates the distance between two points
+ on a Cartesian coordinate plane.'
write(*,*) 'This program calculates the distance between two points &
& on a Cartesian coordinate plane.'
read(*,*) d
read(*,*) x1, y1, x2,y2
read(*,*) 'The distance between any two points ,'(x1,y1)', and ,'(x2,y2)', is ,'d
write(*,*)'The distance between any two points ,',x1,y1,', and ,',x2,y2,', is ,',d
kathrynag said:Ok, I'll try those and let you know what happens.
should I do read(*,*) x1,x2,y1,y2 or separate lines for each variable?