Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
pytime.f
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file pytime.f
1 
2 C*********************************************************************
3 
4 C...PYTIME
5 C...Finds current date and time.
6 C...Since this task is not standardized in Fortran 77, the routine
7 C...is dummy, to be replaced by the user. Examples are given for
8 C...the Fortran 90 routine and DEC Fortran 77, and what to do if
9 C...you do not have access to suitable routines.
10 
11  SUBROUTINE pytime(IDATI)
12 
13 C...Double precision and integer declarations.
14  IMPLICIT DOUBLE PRECISION(a-h, o-z)
15  IMPLICIT INTEGER(i-n)
16  INTEGER pyk,pychge,pycomp
17  CHARACTER*8 atime
18 C...Local array.
19  INTEGER idati(6),idtemp(3),ival(8)
20 
21 C...Example 0: if you do not have suitable routines.
22  DO 100 j=1,6
23  idati(j)=0
24  100 CONTINUE
25 
26 C...Example 1: Fortran 90 routine.
27 C CALL DATE_AND_TIME(VALUES=IVAL)
28 C IDATI(1)=IVAL(1)
29 C IDATI(2)=IVAL(2)
30 C IDATI(3)=IVAL(3)
31 C IDATI(4)=IVAL(5)
32 C IDATI(5)=IVAL(6)
33 C IDATI(6)=IVAL(7)
34 
35 C...Example 2: DEC Fortran 77. AIX.
36 C CALL IDATE(IMON,IDAY,IYEAR)
37 C IDATI(1)=IYEAR
38 C IDATI(2)=IMON
39 C IDATI(3)=IDAY
40 C CALL ITIME(IHOUR,IMIN,ISEC)
41 C IDATI(4)=IHOUR
42 C IDATI(5)=IMIN
43 C IDATI(6)=ISEC
44 
45 C...Example 3: DEC Fortran, IRIX, IRIX64.
46 C CALL IDATE(IMON,IDAY,IYEAR)
47 C IDATI(1)=IYEAR
48 C IDATI(2)=IMON
49 C IDATI(3)=IDAY
50 C CALL TIME(ATIME)
51 C IHOUR=0
52 C IMIN=0
53 C ISEC=0
54 C READ(ATIME(1:2),'(I2)') IHOUR
55 C READ(ATIME(4:5),'(I2)') IMIN
56 C READ(ATIME(7:8),'(I2)') ISEC
57 C IDATI(4)=IHOUR
58 C IDATI(5)=IMIN
59 C IDATI(6)=ISEC
60 
61 C...Example 4: GNU LINUX libU77, SunOS.
62 C CALL IDATE(IDTEMP)
63 C IDATI(1)=IDTEMP(3)
64 C IDATI(2)=IDTEMP(2)
65 C IDATI(3)=IDTEMP(1)
66 C CALL ITIME(IDTEMP)
67 C IDATI(4)=IDTEMP(1)
68 C IDATI(5)=IDTEMP(2)
69 C IDATI(6)=IDTEMP(3)
70 
71 C...Common code to ensure right century.
72  idati(1)=2000+mod(idati(1),100)
73 
74  RETURN
75  END