-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsignon.f
More file actions
69 lines (69 loc) · 1.91 KB
/
signon.f
File metadata and controls
69 lines (69 loc) · 1.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
c=======================================================================
c
subroutine SignOn(pgmnam)
c
c *** signon- routine which provides sign-on and sign-off messages
c (orig by John Fowler- mod by Howard McCallon-041214-SIRTF)
c
c inputs: pgmnam = program name [call arg]
c
c outputs: message to stdout
c
character*(*) pgmnam
character vsn*11,cdate*8,ctime*8,Fmt*11,FLen*4
integer*4 onoff,jdate(3),jtime(3),lnblnk
real*4 dummyt,second(2),etime
c
common /vdt/ cdate,ctime,vsn
c##
onoff = 1
c
c i. obtain date
c
100 cdate = '00-00-00'
call idate(jdate) ! Linux call
c
jdate(3) = mod(jdate(3), 100)
write(cdate(1:2), '(i2)') jdate(2)
write(cdate(4:5), '(i2)') jdate(1)
write(cdate(7:8), '(i2)') jdate(3)
c
if(cdate(4:4) .eq. ' ') cdate(4:4) = '0'
if(cdate(7:7) .eq. ' ') cdate(7:7) = '0'
c
c ii. obtain time
c
ctime = '00:00:00'
call itime(jtime)
write(ctime(1:2), '(i2)') jtime(1)
write(ctime(4:5), '(i2)') jtime(2)
write(ctime(7:8), '(i2)') jtime(3)
c
if(ctime(4:4) .eq. ' ') ctime(4:4) = '0'
if(ctime(7:7) .eq. ' ') ctime(7:7) = '0'
c
c iii. set up format for pgmnam
c
write(Flen,'(I4)') lnblnk(pgmnam)
Fmt = '(A'//Flen//'$)'
c
c iv. write out results
c
write(*,Fmt) pgmnam
if(onoff .eq. 1) then ! sign on
write(*,301) vsn,cdate,ctime
else ! sign off
dummyt = etime(second)
write(*,302) vsn,cdate,ctime,second
endif
301 format(' version: ',a11,' - execution begun on ',a8,' at ',a8)
302 format(' version: ',a11,' - execution ended on ',a8,' at ',a8
* /1x,f9.2,' cpu seconds used;',f8.2,' system seconds used.')
c
return
c
entry SignOff(pgmnam)
OnOff = 2
go to 100
c
end