c...	datestamp_g77.f

c_Subr===1=========2=========3=========4=========5=========6=========712
      SUBROUTINE datestamp(date_stamp) 
c  format year-month-day  hour:minutes:seconds
c  That is, 'year-mm-dd hh:mm:ss' (20 charcters)

      IMPLICIT NONE
c...	passed variables
      character*20 date_stamp

c...	Local variables
      CHARACTER*8 T_DATE
        character*10 t_time
        character*5  t_zone
        integer         values(8)

c DATE  must be a scalar character string variable with at least 8 characters
c and it is assigned the value CCYYMMDD  for century, year, month and day. All
c are given numerically, with blanks if the system does not include the date.

c TIME must also be a scalar character string variable with at least 10
c characters and it is assigned a value hhmmss.sss for time in hours, minutes,
c seconds and milliseconds. All are given numerically with blanks if the system
c does not include a clock.

c ZONE must be a scalar character string variable with at least 5 characters and
c it is assigned the value +hhmm for sign, time in hours and minutes for the
c local time difference with UTC (which was previously called Greenwich Mean
c Time). All are given numerically, with blanks if the system does not include a
c clock. In Sweden we therefore get +0100 in winter and +0200 in summer, in
c Novosibirsk we get +0700 .

c The variable VALUES is instead an integer vector with at least 8 elements, it
c gives the easiest way of using the results from DATE_AND_TIME at the
c calculations in a program. If the system does not include the date or the time
c you get the value -HUGE(0), that is the smallest integer number in the model,
c as output. The vector will include the following elements: year, month, day,
c time difference in minutes, hours, minutes, seconds and milliseconds.

      CALL DATE_and_time(T_DATE, t_time, t_zone, values)
      write (date_stamp, 200) t_date(1:4), t_date(5:6), t_date(7:8),
     &      t_time(1:2), t_time(3:4), t_time(5:6) 
 200  format(a4, '-', a2, '-', a2, 2x, a2, ':', a2, ':', a2)      !! 8+6+6 = 20
c      write (date_stamp, 200) t_date, t_time(1:6)
c 200  format(a8, 1x, a6, 1x)      

cDebug      write (*,*) 'datestamp: ', T_DATE, t_time
cDebug      write (*,*) 'datestamp: ',date_stamp
 
      END

     
      
