blueagle91
Programmer
- Dec 8, 2010
- 2
I am new here, and i am new with FORTRAN. I hope i came to right place to ask a beginners question.
Here is my little code, what it does is not important some physics.
rogram zad87
implicit none
double precision,parameter :: m=5.98d24,g=6.672d11
double precision :: x
real :: r=6371,h
write(*,"(' Calculating h from 200 to 800 km')")
write (*,10) m,g
10 format (//,'result',//,&
3x,'Earth mass M=',d11.7,/,&
3x,'Constant G=',d11.7,//)
do h=200,800,50
x=-g*m/(r+h)**2
write(*,'(T2,f3,T18,d7.4)')h,x
end do
end program zad87
In attachent is image of program running. Now i know those stras means i need more space, but i have problem there too.
I have constanr m=5.98d24 when i put more places like d18.5 i get number .598000d25
And check the error belof F6987, i founded on net but i do not understand it.
I know C++ not FORTRAN so please help me.
It is program for school.
Thanks in advance.
Here is my little code, what it does is not important some physics.
rogram zad87
implicit none
double precision,parameter :: m=5.98d24,g=6.672d11
double precision :: x
real :: r=6371,h
write(*,"(' Calculating h from 200 to 800 km')")
write (*,10) m,g
10 format (//,'result',//,&
3x,'Earth mass M=',d11.7,/,&
3x,'Constant G=',d11.7,//)
do h=200,800,50
x=-g*m/(r+h)**2
write(*,'(T2,f3,T18,d7.4)')h,x
end do
end program zad87
In attachent is image of program running. Now i know those stras means i need more space, but i have problem there too.
I have constanr m=5.98d24 when i put more places like d18.5 i get number .598000d25
And check the error belof F6987, i founded on net but i do not understand it.
I know C++ not FORTRAN so please help me.
It is program for school.
Thanks in advance.