program kinematics
implicit none
real :: mass, vel, momentum, kinetic
!———————————————————————–
! Request input from user on mass and momentum
!———————————————————————–
print*, “!—————————————–!”
print*, “! INPUT PARAMETERS !”
print*, “!—————————————–!”
print*, “Provide the mass of the object”
read*, mass
print*, “Provide the instantaneous velocity of the object”
read*, vel
!—————————————————————————-
! Calculate kinetic energy and momentum of the object
! using subroutines
!—————————————————————————-
call calc_kinetic(mass,vel,kinetic)
call calc_momentum(mass,vel,momentum)
!—————————————————————————-
! Print values of kinetic energy and momentum
!—————————————————————————-
print*
print*, “!—————————————–!”
print*, “! RESULTS OUTPUT !”
print*, “!—————————————–!”
print 100, “Momentum =”, momentum, “kg m/s”
100 format(2x, a, 2x, f8.3, 1x, a)
print*
print 101, “Kinetic energy =”, kinetic, “kg m^2 s^(-2)”
101 format(2x, a, 2x, f8.3, 1x, a)
print*, “!—————————————–!”
end