Can someone help me convert this Fortran 95 program to Fortran 77? program ball
ID: 3529791 • Letter: C
Question
Can someone help me convert this Fortran 95 program to Fortran 77? program ball implicit none ! program ball from text fig 4-13, pg 168 real, parameter :: degrees_2_rad = 0.01745329 ! another way: ! pi = 4.*atan(1.) ! degrees_2_rad = pi/180. real, parameter :: gravity = -9.81 integer :: max_degrees, theta real :: max_range, range, radian, v0 max_range = 0. ; max_degrees = 0.; v0 = 1. ! ball speed in m/s open(unit=10,file='ball.angle') ! loop over all specified angles loop: do theta = 0,90,10 radian = real(theta) * degrees_2_rad ! range in meters range = (-2.*v0**2/gravity) *sin(radian)*cos(radian) ! write out range for this theta write(10,*)'Theta=',theta,'degrees; Range=',range, & 'meters' !now check range, save if largest so far if (range > max_range ) then max_range = range max_degrees = theta end if end do loop ! output answer write(*,*) write(*,*) 'Max range =',max_range,' at ',max_degrees,' degrees' end program ballExplanation / Answer
Please rate with 5 stars :)
The free program convert (http://www.nag.co.uk/nagware/Examples/convert.f90) will convert from Fortran 77 fixed-source form to Fortran 90/95/2003 free-source form and make some simple transformations, such as declarations. There are also some commercial products, such as SPAG (http://www.polyhedron.com/spag0html).
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.