Open Watcom Fortran: ETIME, FDATE, FLUSH, GETENV 
Author Message
 Open Watcom Fortran: ETIME, FDATE, FLUSH, GETENV

Hi,

I need to call the following routines in my OW fortran programs and I
understand that the way to handle it under windows (since it is not
implemented in OW) is to use c wrappers.

The problem is that I am not really a specialist of c wrappers. Has
anyone already implemented these?

Thanks in advance

Victor



Tue, 03 Jun 2008 22:00:39 GMT  
 Open Watcom Fortran: ETIME, FDATE, FLUSH, GETENV

Quote:

>Hi,

>I need to call the following routines in my OW Fortran programs and I
>understand that the way to handle it under windows (since it is not
>implemented in OW) is to use c wrappers.

>The problem is that I am not really a specialist of c wrappers. Has
>anyone already implemented these?

>Thanks in advance

>Victor

The online Fortran 77 users guide is a good place to start. Try to look
for the following  -   gettim, getdat, flushunit, fgetenv


Tue, 03 Jun 2008 22:31:22 GMT  
 Open Watcom Fortran: ETIME, FDATE, FLUSH, GETENV
Thank you John.

It is indeed there on page 92.
http://openwatcom.mirrors.pair.com/11.0c/docs/f77userguide.pdf

And it works on my platform (Windows)



Tue, 03 Jun 2008 23:10:45 GMT  
 Open Watcom Fortran: ETIME, FDATE, FLUSH, GETENV

Quote:

>Thank you John.

>It is indeed there on page 92.
>http://openwatcom.mirrors.pair.com/11.0c/docs/f77userguide.pdf

>And it works on my platform (Windows)

It  is not hard to duplicate "etime" using "gettim".  The "fdate" thing
using "getdat" may be trickier, especially  if you need to get day of
week.  It might turn out easier to use a function written in C,
shamelessly plagiarized from the internet.

/*   fdate.c */
#include<time.h>
int fdate(utime)
char utime[24];
{
        int i;
        time_t t;
        t=time (NULL);
        for (i=0; i<24; i++) utime[i]= *(ctime(&t)+i);
        return 1;

Quote:
}

Called from fortran like this -

c test1.for
*$pragma aux fdate "!_" parm (value)
       character*30 string
       external fdate
       integer fdate
       i=fdate(string)
       print *,string
       pause
       end



Wed, 04 Jun 2008 07:31:27 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. second() or etime() for Watcom f77 ?

2. COMMON and SUBROUTINE statements with same name - Open Watcom Fortran

3. Character Mode Executables in Open WATCOM Fortran

4. Open Watcom Fortran compiler help needed

5. WATCOM FORTRAN now open sourced

6. getenv, getarg, iargc, system etc with intel fortran compiler

7. Recommended way to getenv() in Fortran?

8. Fortran/Unix Interface: GETENV Command

9. GETENV for Lahey FORTRAN

10. MS Fortran calling C function GETENV

11. Warnings and GETENV routine when using ABSOFT Fortran

12. getarg/sleep/etime for Visual Fortran

 

 
Powered by phpBB® Forum Software