c
c
c     ###################################################
c     ##  COPYRIGHT (C)  1993  by  Jay William Ponder  ##
c     ##              All Rights Reserved              ##
c     ###################################################
c
c     ###############################################################
c     ##                                                           ##
c     ##  subroutine calendar  --  find the current date and time  ##
c     ##                                                           ##
c     ###############################################################
c
c
c     "calendar" returns the current time as a set of integer values
c     representing the year, month, day, hour, minute and second
c
c     note only one of the various implementations below should
c     be activated by removing comment characters
c
c
      subroutine calendar (year,month,day,hour,minute,second)
      implicit none
      integer year,month
      integer day,hour
      integer minute,second
c
c
c     use the Unix-style "itime" and "idate" intrinsic functions,
c     this code works for all compilers except those noted below
c
      integer hms(3)
      call itime (hms)
      hour = hms(1)
      minute = hms(2)
      second = hms(3)
      call idate (month,day,year)
c
c     code for the IBM AIX xlf compiler appends an underscore
c
c     integer hms(3)
c     call itime_(hms)
c     hour = hms(1)
c     minute = hms(2)
c     second = hms(3)
c     call idate_(month,day,year)
c
c     code for Hewlett-Packard HP-UX and Compaq OpenVMS systems;
c     for the HP systems the +E1 compiler option is required
c
c     real secnds
c     second = int(secnds(0.0))
c     hour = mod(second,3600)
c     second = second - 3600*hour
c     minute = mod(second,60)
c     second = second - 60*minute
c     call idate (month,day,year)
      return
      end
