I am completely new to Fortran and am learning using Silverfrost and the Plato IDE on my XP box.
Could somebody help me understand why the yn do loop in the lines below does not execute?
Thank you.
program TonMiles
implicit none
real Lh, TM, Wdp, Wdc, Whw, BF, MW
integer Unit_Transform
parameter (Unit_Transform = 10560000)
character(1) :: yn
! This program prompt user for Depth (in ft) and Mud Weight (in PPG) and returns TM for the
! Drilling String described in HW1 Prob 5.
interactive_loop: do !Keeps routine running if user chooses so with a 'y' screen input
!or stops after a 'n' screen user input
write (*,*) 'Enter Depth in ft:'
read (*,*) Lh
write (*,*) 'Enter Mud Weight in PPG:'
read (*,*) MW
BF = 1-MW/65.5
Wdp = 19.5*BF
Wdc = (96.2-19.5)*BF*660
Whw = (50-19.5)*BF*270
TM = (Lh*(93+Lh)*Wdp+4*Lh*(50000+Wdc/2+Whw/2))/Unit_Transform
write (*,*) 'TM = ', TM
yn = ' '
yn_loop: do
write(*,*) 'Perform one more Round Trip TM calculation? y[n]'
read(*,'(a1)') yn
if (yn=='y' .or. yn=='Y') exit yn_loop
if (yn=='n' .or. yn=='N' .or. yn==' ') exit interactive_loop
end do yn_loop
end do interactive_loop
end program TonMiles