DATE / TIME with f2c (Was: Re: Timing Routines)

DATE / TIME with f2c (Was: Re: Timing Routines)

Post by Dmitri Sergatsk » Tue, 16 Sep 1997 04:00:00






>> > How do I in a language (Fortran specifically) find out what type of
>> > timing routine is available for a given machine?  I'm not very familiar

.... deleted ........

Quote:

>> Well, I usually just check the manuals ... specifically the index, under
>> "T"

OK, where can I get this manual (with an index ) for f2c compiler?

More serious now:

Does anyone know if f2c has any date / time / clock procedures?

Sincerely,
Dmitri.

 
 
 

DATE / TIME with f2c (Was: Re: Timing Routines)

Post by Bob Kematic » Wed, 17 Sep 1997 04:00:00



> Does anyone know if f2c has any date / time / clock procedures?

In addition to libU77 , there is also a small package on
sunsite that may help

ftp://sunsite.unc.edu/pub/Linux/devel/lang/fortran/yaf77-1.5.tgz

 
 
 

DATE / TIME with f2c (Was: Re: Timing Routines)

Post by Dave Lov » Wed, 17 Sep 1997 04:00:00


 Dmitri> OK, where can I get this manual (with an index ) for f2c compiler?

This is the closest there is, except you'd also include the READMEs if
you didn't know where to look:

f2c $ grep -i time changes|tail -2
 libf77: add [de]time_.c (which may give trouble on some systems).
strings that sometimes caused one more array element than required by
f2c $

(This is the current f2c source.)  The [de]time implementations have
problems, though.  Those from G77 don't have any known problems.

 
 
 

DATE / TIME with f2c (Was: Re: Timing Routines)

Post by Dave Lov » Wed, 17 Sep 1997 04:00:00


 Paul> As far as I know (and I may be behind the times)

Afraid so.

 Paul> f2c (the libs actually) doesn't have support for time and date
 Paul> routines (nor for stuff like IAND, IOR, etc).

The current f2c has IAND etc. intrinsics which translate directly to C
(synonyms for the original AND etc.).

 Paul> void mtime_( char *a )

Note that the correct prototype for this (f2c -P) is
  extern int mtime_(char *ctime, ftnlen ctime_len);
not that it will normally matter in this case if the argument always
has the right length.

 
 
 

DATE / TIME with f2c (Was: Re: Timing Routines)

Post by Paul D. Boy » Wed, 17 Sep 1997 04:00:00


: Does anyone know if f2c has any date / time / clock procedures?

[comp.programming newsgroup trimmed because it was off topic for that
group]

As far as I know (and I may be behind the times) f2c (the libs actually)
doesn't have support for time and date routines (nor for stuff like IAND,
IOR, etc).  So I normally just write my own C functions and call them from
the FORTRAN.  For the C function just add an underscore the function name.
For example in FORTRAN use as:

      CHARACTER*25  CTIME
      .....
      CALL MTIME( CTIME )

The C function would look something like:
#include <time.h>
#include <string.h>

#define BUF_LEN  25

void mtime_( char *a )
{
    time_t now;
    char buf[BUF_LEN];

/* use strftime() to format the time.  See the man page for more detail */
    strftime( buf, BUF_LEN, "%c", localtime(&now) );
    strncpy( a, buf, BUF_LEN );

Quote:}

This would output a string like:

Fri Apr 13 15:25:30 1990

Email me if you need more detailed examples.

Paul

--

Director, X-ray Structural Facility |   phone: (919) 515-7362
Department of Chemistry - Box 8204  |   FAX:   (919) 515-5079
North Carolina State University     |
Raleigh, NC, 27695-8204
http://laue.chem.ncsu.edu/web/xray.welcome.html

 
 
 

1. date/time of a file compare with current date/time

Hi,

I hope i can drop my question about Linux shell programming here?

I'm writing a script in bash to find files. I'm using the slocate
programm, which is being runned every hour using a cron job, to create
it's database.

Now i want to know how long it is ago that the database has been
recreated. Zo i need to check the date and time from that file and
compare it with the current date and time. I know there must be easy to
do but i can't find the trick to do it.

Maikel van Gorkom

Sent via Deja.com http://www.deja.com/
Before you buy.

2. ATI Xpert 98

3. run time date and syslog date/time conflict

4. DataType 9 errors on installing

5. Time routine for ksh to convert to unix time.

6. SYSV Zombie Reaper?

7. SVR3 routine to convert ASCII time to UNIX time?

8. setting REMOTE_USER from Windows username

9. convert UT time in local time / local time in UT time

10. time time time how can I tell the time

11. WANTED: C routine to return current date/time

12. Epoch time - Date Time in DDMMYYHHMISS ( From-To conversion ) using standard utility

13. date reset as UTC from time to time RH6.0