/[MITgcm]/MITgcm/eesupp/src/tim.c
ViewVC logotype

Annotation of /MITgcm/eesupp/src/tim.c

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.3 - (hide annotations) (download)
Wed Oct 28 03:11:35 1998 UTC (25 years, 8 months ago) by cnh
Branch: MAIN
CVS Tags: checkpoint17, checkpoint19, checkpoint18, checkpoint20, checkpoint21, checkpoint16
Changes since 1.2: +25 -2 lines
File MIME type: text/plain
Changes to support
 - g77 compilation under Linux
 - LR(1) form of 64-bit is D or E for constants
 - Modified adjoint of exch with adjoint variables
   acuumulated.

1 cnh 1.3 #define FORTRAN_MANGLE_TRAILING_UNDERSCORE
2     #define TIM_USES_GETTIMEOFDAY
3    
4     #define procedure_cloc cloc
5     #ifdef FORTRAN_MANGLE_TRAILING_UNDERSCORE
6     #define procedure_cloc cloc_
7     #endif
8     #ifdef TIM_USES_OSF_GETCLOCK
9 cnh 1.2 #include <stdio.h>
10     #include <stdlib.h>
11     #include <unistd.h>
12     #include <assert.h>
13     #include <sys/time.h>
14 cnh 1.3 void procedure_cloc ( double *curtim )
15 cnh 1.2 {
16     struct timespec tv1;
17     getclock(TIMEOFDAY, &tv1);
18     *curtim = (double)((tv1.tv_nsec)+(tv1.tv_sec)*1.E9);
19     *curtim = *curtim/1E9;
20     }
21 cnh 1.3 #endif
22     #ifdef TIM_USES_GETTIMEOFDAY
23     #include <stdio.h>
24     #include <stdlib.h>
25     #include <unistd.h>
26     #include <assert.h>
27     #include <sys/time.h>
28     void procedure_cloc ( double *curtim )
29     {
30     struct timeval tv1;
31     gettimeofday(&tv1 , (void *)NULL );
32     *curtim = (double)((tv1.tv_usec)+(tv1.tv_sec)*1.E6);
33     *curtim = *curtim/1.E6;
34    
35     }
36     #endif
37 cnh 1.2

  ViewVC Help
Powered by ViewVC 1.1.22