source: CPL/oasis3-mct/branches/OASIS3-MCT_2.0_branch/lib/mct/mpeu/get_zeits.c @ 4775

Last change on this file since 4775 was 4775, checked in by aclsce, 5 years ago
  • Imported oasis3-mct from Cerfacs svn server (not suppotred anymore).

The version has been extracted from https://oasis3mct.cerfacs.fr/svn/branches/OASIS3-MCT_2.0_branch/oasis3-mct@1818

File size: 1.5 KB
Line 
1/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2!       NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS      !
3!-----------------------------------------------------------------------
4! CVS get_zeits.c,v 1.12 2012-01-31 19:42:07 jacob Exp
5! CVS MCT_2_8_0
6!-----------------------------------------------------------------------
7!BOP
8!
9! !ROUTINE: get_zeits - a C interface to times for Fortran calls
10!
11! !DESCRIPTION:
12!
13! !INTERFACE: */
14 /*
15  System times() dependencies:
16 */
17
18
19#include <sys/types.h>
20#ifndef NOTIMES
21#include <sys/times.h>
22#endif
23
24#include <time.h> /* POSIX standard says CLOCKS_PER_SEC is here */
25#include "config.h"
26/*
27 *  CLK_TCK is obsolete - replace with CLOCKS_PER_SEC
28 */
29
30#define ZCLK_TCK ((double)CLOCKS_PER_SEC)
31
32
33
34
35 /*  Prototype: */
36
37   void FC_FUNC(get_zeits,GET_ZEITS)(double *zts);
38   void FC_FUNC(get_ztick,GET_ZTICK)(double *tic);
39
40/*!REVISION HISTORY:
41!       12Mar98 - Jing Guo <guo@thunder> - initial prototype/prolog/code
42!       06Jul99 - J.W. Larson <jlarson@dao> - support for AIX platform
43!EOP */
44
45/*  Implementations: */
46
47void FC_FUNC(get_zeits,GET_ZEITS)(zts)
48  double *zts;
49{
50
51#ifndef NOTIMES
52  struct tms tm;
53  double secs;
54  secs=1./ZCLK_TCK;
55
56  zts[0]=times(&tm)*secs;
57  zts[1]=tm.tms_utime*secs;
58  zts[2]=tm.tms_stime*secs;
59  zts[3]=tm.tms_cutime*secs;
60  zts[4]=tm.tms_cstime*secs;
61#else
62  zts[0]=0.;
63  zts[1]=0.;
64  zts[2]=0.;
65  zts[3]=0.;
66  zts[4]=0.;
67#endif
68
69}
70
71void FC_FUNC(get_ztick,GET_ZTICK)(tic)
72  double *tic;
73{
74  tic[0]=1./ZCLK_TCK;
75}
76
Note: See TracBrowser for help on using the repository browser.