: Does anyone know if f2c has any date / time / clock procedures?
[comp.programming newsgroup trimmed because it was off topic for that
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:
CALL MTIME( CTIME )
The C function would look something like:
#define BUF_LEN 25
void mtime_( char *a )
/* 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 );
This would output a string like:
Fri Apr 13 15:25:30 1990
Email me if you need more detailed examples.
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