subroutine DCCalDateCurrent1( date, err )
  !
  ! å®Ÿæ™‚é–“ã‚’ dc_calendar_types#DC_CAL_DATE åž‹ã®
  ! date ã«è¿”ã—ã¾ã™.
  ! å®Ÿæ™‚é–“ã¯ Fortran 90 ä»¥é™ã®çµ„ã¿è¾¼ã¿ã‚µãƒ–ãƒ«ãƒ¼ãƒãƒ³ã§ã‚ã‚‹
  ! date_and_time ã‹ã‚‰å¾—ã‚‰ã‚Œã¾ã™.
  !
  ! Return actual time +date+ (type "dc_calendar_types#DC_CAL_DATE").
  ! The actual time is acquired by "date_and_time" that is
  ! a built-in subroutine of Fortran 90 or more.
  !
  use dc_calendar_generic, only: DCCalDateParseStr, DCCalDateCreate
  use dc_calendar_types, only: DC_CAL_DATE
  use dc_calendar_internal, only: default_date
  use dc_message, only: MessageNotify
  use dc_types, only: DP, TOKEN
  use dc_trace, only: BeginSub, EndSub
  use dc_error, only: StoreError, DC_NOERR, DC_EALREADYINIT, DC_EBADDATE
  use dc_types, only: STRING
  implicit none
  type(DC_CAL_DATE), intent(out):: date
                              ! å®Ÿæ™‚é–“ã®æ—¥æ™‚æƒ…å ±ã‚’åŽã‚ãŸã‚ªãƒ–ã‚¸ã‚§ã‚¯ãƒˆ.
                              !
                              ! An object that stores information of
                              ! date and time of actual time.
  logical, intent(out), optional:: err
                              ! ä¾‹å¤–å‡¦ç†ç”¨ãƒ•ãƒ©ã‚°.
                              ! ãƒ‡ãƒ•ã‚©ãƒ«ãƒˆã§ã¯, ã“ã®æ‰‹ç¶šãå†…ã§ã‚¨ãƒ©ãƒ¼ãŒ
                              ! ç”Ÿã˜ãŸå ´åˆ, ãƒ—ãƒã‚°ãƒ©ãƒ ã¯å¼·åˆ¶çµ‚äº†ã—ã¾ã™.
                              ! å¼•æ•° *err* ãŒä¸Žãˆã‚‰ã‚Œã‚‹å ´åˆ,
                              ! ãƒ—ãƒã‚°ãƒ©ãƒ ã¯å¼·åˆ¶çµ‚äº†ã›ãš, ä»£ã‚ã‚Šã«
                              ! *err* ã« .true. ãŒä»£å…¥ã•ã‚Œã¾ã™.
                              !
                              ! Exception handling flag.
                              ! By default, when error occur in
                              ! this procedure, the program aborts.
                              ! If this *err* argument is given,
                              ! .true. is substituted to *err* and
                              ! the program does not abort.

  ! ä½œæ¥å¤‰æ•°
  ! Work variables
  !
  integer :: date_time_values(1:8)
  character(5)  :: zone_raw

  integer:: year  ! å¹´. Year.
  integer:: month ! æœˆ. Month.
  integer:: day   ! æ—¥. Day.
  integer:: hour  ! æ™‚. Hour.
  integer:: min   ! åˆ†. Minute.
  real(DP):: sec  ! ç§’. Second.
  character(TOKEN):: zone
                  ! UTC ã‹ã‚‰ã®æ™‚å·®. Time-zone.
  integer:: stat
  character(STRING):: cause_c
  character(*), parameter:: subname = 'DCCalDateCurrent1'
continue
  call BeginSub( subname )
  stat = DC_NOERR
  cause_c = ''

!!$  ! åˆæœŸè¨å®šã®ãƒã‚§ãƒƒã‚¯
!!$  ! Check initialization
!!$  !
!!$  if ( datep % initialized ) then
!!$    stat = DC_EALREADYINIT
!!$    cause_c = 'DC_CAL_DATE'
!!$    goto 999
!!$  end if

  ! date_and_time çµ„ã¿è¾¼ã¿ã‚µãƒ–ãƒ«ãƒ¼ãƒãƒ³ã‚’ç”¨ã„ã¦, ç¾åœ¨
  ! æ™‚åˆ»ã¨ UTC ã‹ã‚‰ã®æ™‚å·®ã‚’å–å¾—.
  !
  call date_and_time(zone=zone_raw, values=date_time_values)
  zone = zone_raw(1:3) // ":" // zone_raw(4:5)

  ! ã‚ªãƒ–ã‚¸ã‚§ã‚¯ãƒˆã®ä½œæˆ
  ! Create an object
  !
  call DCCalDateCreate( &
    & date_time_values(1), date_time_values(2), date_time_values(3), & ! (in)
    & date_time_values(5), date_time_values(6), &                      ! (in)
    & real( date_time_values(7), DP ), & ! (in)
    & date, zone, err = err )            ! (out) optional
  if ( present(err) ) then
    if ( err ) then
      stat = DC_EBADDATE
      goto 999
    end if
  end if

  ! çµ‚äº†å‡¦ç†, ä¾‹å¤–å‡¦ç†
  ! Termination and Exception handling
  !
999 continue
  call StoreError( stat, subname, err, cause_c )
  call EndSub( subname )
end subroutine DCCalDateCurrent1