replica nfl jerseysreplica nfl jerseyssoccer jerseyreplica nfl jerseys forums.silverfrost.com :: View topic - DO LOOP working....and not working!?
forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

DO LOOP working....and not working!?

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
Laurent



Joined: 31 Jan 2011
Posts: 3

PostPosted: Mon Jan 31, 2011 8:02 pm    Post subject: DO LOOP working....and not working!? Reply with quote

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.

Code:
      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
Back to top
View user's profile Send private message
Jeannot



Joined: 31 Jan 2011
Posts: 5
Location: Toulouse (France)

PostPosted: Wed Feb 02, 2011 3:46 pm    Post subject: Reply with quote

I have copied your code into Plato and runed it as well as Release Wind32 as Release net and it works perfectly !
Back to top
View user's profile Send private message
Laurent



Joined: 31 Jan 2011
Posts: 3

PostPosted: Wed Feb 02, 2011 5:20 pm    Post subject: Re: Reply with quote

Jeannot wrote:
I have copied your code into Plato and runed it as well as Release Wind32 as Release net and it works perfectly !


Merci Jeannot.

After your post, I tried to run the code again and the loop is now executing. The only thing I did in the mean time was to close Plato and reopen it. Not sure what happened. But it works now. Thanks for the help.

I am going through the tutorial that comes with Plato to learn Fortran, but couldn't find a tutorial for 95, only for 90. Would you know of a tutorial for 95, or are they enough similarities between 90 and 95 that learning with a 90 tutorial is OK?

I have not quite figured out how to run the debugger yet. I hope it will get clearer after a few more reads of the instructions......
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 8210
Location: Salford, UK

PostPosted: Wed Feb 02, 2011 5:25 pm    Post subject: Reply with quote

There are very few differences between Fortran 90 and 95.
Back to top
View user's profile Send private message AIM Address
Laurent



Joined: 31 Jan 2011
Posts: 3

PostPosted: Wed Feb 02, 2011 7:21 pm    Post subject: Re: Reply with quote

PaulLaidler wrote:
There are very few differences between Fortran 90 and 95.


Thank you.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group