TYPE date
logical :: is_init = .false.
logical :: is_day_init = .false.
integer(ip) :: year = 0_ip
integer(ip) :: month = 0_ip
integer(ip) :: day = 0_ip
integer(ip) :: hour = 0_ip
integer(ip) :: minute = 0_ip
integer(ip) :: second = 0_ip
integer(ip) :: julian_day = 0_ip
integer(ip) :: julian_cnes_day = 0_ip
real(rp) :: julian_date = 0._rp
real(rp) :: julian_cnes_date = 0._rp
character(len=:), allocatable :: cdate
CONTAINS
procedure, pass( self ) :: set => set_date
procedure, pass( self ) :: date_to_julian
procedure, pass( self ) :: julian_to_date
procedure, pass( self ) :: julian_to_cnes
procedure, pass( self ) :: cnes_to_julian
procedure, pass( self ) :: julian_cnes_day_to_date
procedure, pass( self ) :: day_to_julian_cnes_day
procedure, pass( self ) :: to_char => date_to_char
procedure, pass( self ) :: output => output_date
END TYPE date
TYPE time
real(rp) :: seconds
real(rp) :: minutes
real(rp) :: hours
real(rp) :: days
character(len=:), allocatable :: ctime
CONTAINS
procedure, pass(self) :: set_time_from_char
procedure, pass(self) :: set_time_from_real
generic :: set => set_time_from_char , &
set_time_from_real
END TYPE time
TYPE date_time
!================================================================================================================!
! Format
!================================================================================================================!
integer(ip) :: format
!================================================================================================================!
! Dates
!================================================================================================================!
type(date) :: date_start
type(date) :: date_end
type(date) :: date_current
!================================================================================================================!
! Times
!================================================================================================================!
type(time) :: time_start
type(time) :: time_end
type(time) :: time_current
!================================================================================================================!
! Control parameters
!================================================================================================================!
integer(ip) :: nt
real(rp) :: dt
CONTAINS
procedure, pass(self) :: init => init_date_and_time
procedure, pass(self) :: advance => advance_date_and_time
END TYPE date_time