I've been trying to write this program for fortran where the pressure of a gas is calculated using the Van der Waals equation and everytime I've scrapped the entire code and started over because everything I do comes back with an error, even when I try using answers from other questions. I'm new to fortran and I know my syntax is probably all over, if someone could just please tell me where I'm going wrong it would be greatly appreciated.
!Named program EquationOfState
program EquationOfState
implicit none
real :: pressure
write(*,*) 'pressure of Ideal Gas = '
write(*,*) 'pressure calculated with Van der Waals equation = '
end program EquationOfState
!Prompt user to input values for density == d, and temperature == t
write(*,*) "Enter density of gas"
read(*,*) d
write(*,*) "Enter temperature conditions"
read(*,*) t
write(*,*) "The pressure of the gas is", pressure
function pressure(d, t)
real(kind=4) :: pressure_IdealGas
real, intent(in) :: d, t
real, parameter :: R = 286.9_4
pressure = d * R * t
end function pressure
with this error
program EquationOfState
1
HWL_4.f90:14.36:
write(*,*) "Enter density of gas"
2
Error: Two main PROGRAMs at (1) and (2)