PDA

View Full Version : Re: [LF] Help!pause for desired time duration


Lahey Support
08-15-2003, 01:19 AM
Maybe we need a different approach
how about the following:

INTEGER VALUES(8)
CHARACTER*10 CYMD,TIME,ZONE
C
C REQUIRED ELAPSED TIME IN
SECONDS (SAY 1000)
RQDTME = 1000
CALL DATE_ AND_TIME(CYMD,TIME,ZONE,VALUES)
C
C SAVE STARTING TIME SINCE
MIDNIGHT
C
STTIME = (VALUES(5)*24*60+VALUES(6))*60
C
DO 100 I = 1,10000000 <--- NEED A NUMBER COMMENSURATE
WITH DELAY
C
CALL DATE_ AND_TIME(CYMD,TIME,ZONE,VALUES)
C
C TIME NOW
C
TIMENW = (VALUES(5)*24*60)+VALUES(6))*60
C
C IF ELAPSED TIME GE THE
REQUIRED DEALAY, EXIT
C
IF(TIMENW-STTIME.GE.RQDTIME) GOTO 101
100 CONTINUE
C
C DELAY ENDED
101 CONTINUE
.
..
.
.
Trust this does the job.
Richard B. Ahlvin wrote:

> This would only work with a real dumb compiler! Any decent
> Fortran compiler would eliminate empty DO loops entirely!
>
> -----Original Message-----
> From: Al Salamah, Muhammad [address removed]
> To: cosine Cheng [address removed]
> Cc: [address removed] [address removed]
> Date: Saturday, January 23, 1999 10:10 AM
> Subject: Re: [LF] Help!pause for desired time duration
>
> >Hi
> >I usually use an empty DO construct. You have to experiment with the
> size
> >of the DO construct to arrive at the desired pause duration.
> >
> >
> >On Fri, 22 Jan 1999, cosine Cheng wrote:
> >
> >> Dear All:
> >>
> >> In FORTRAN90, we can use 'pause' or 'read(*,*)'
> >>
> >> to pause the excutable, but how can one pause it
> >>
> >> for a desired time period, say, one sec or 10 min.?
> >>
> >>
> >> Thanks
> >>
> >> by Cheng Cosine
> >> Jan/22/1999 UT
> >>
> >> __________________________________________________ ____
> >> Get Your Private, Free Email at http://www.hotmail.com
> >>
> >
> >
> >************************************************
> >************************************************
> >** Muhammad Al Salamah **
> >** KFUPM **
> >** Box 382 **
> >** Dhahran 31261 **
> >** Saudi Arabia **
> >** Phone No.: Residence +(966)38606045 **
> >** Office +(966)38602541 **
> >************************************************
> >************************************************
> >
> >