C+ C NAME: C OSGetDateAndTime C PURPOSE: C (OBSOLETE; use Time2System or cTime2System) C Retrieve a string containing the system time in VMS format: C '10-FEB-1999 12:12:12.00' C CATEGORY: C Machine-dependent functions: Linux, Unix C CALLING SEQUENCE: subroutine OSGetDateAndTime(cTime) C INPUTS: C (none) C OUTPUTS: C cTime character*23 time string C CALLS: C get_compiler C PROCEDURE: C The time string is returned in uppercase. Calls system functions C IDATE and ITIME C MODIFICATION HISTORY: C SEP-1999, Paul Hick (UCSD/CASS; pphick@ucsd.edu); Added documentation C- character cTime*(*) character f77id*25 integer DMY(3) integer HMS(3) character cMon(12)*3 /'JAN','FEB','MAR','APR','MAY','JUN', & 'JUL','AUG','SEP','OCT','NOV','DEC'/ call IDATE(DMY) call ITIME(HMS) !call get_compiler(f77id) ! The PGI compiler returns month first, day of month second !if (index(f77id,'_pgi') .ne. 0) then ! i = DMY(1) ! DMY(1) = DMY(2) ! DMY(2) = i !end if ! The Intel 6.0 compiler seems to put the day of month in DMY(1) ! while setting DMY(2)=DMY(3)=0 ! The Intel 8.1 and PGI compilers sets DMY(3) to a two-digit year if (DMY(2) .eq. 0 .and. DMY(3) .eq. 0) then ! Fix for Intel 6.0 DMY(2) = DMY(1) DMY(1) = 1 DMY(3) = 2004 write (*,'(A,I4,2(A,I2))') 'OSGetDateAndTime: returning bogus system time ',DMY(3),'/',DMY(2),'/',DMY(1) else if (DMY(3) .lt. 100) then ! Fix for Intel 8.1 and PGI DMY(3) = DMY(3)+2000 end if write (cTime,'(I2.2,3A,I4,2(A,I2.2),A,I1,F4.2)')! 23 chars: DD-MON-YEAR HH:MM:SS.SS & DMY(1),'-',cMon(DMY(2)),'-',DMY(3),' ',HMS(1),':',HMS(2),':',HMS(3)/10,mod(1.*HMS(3),10.0) return end