test_construct_cf_time Subroutine

public subroutine test_construct_cf_time()

Arguments

None

Calls

proc~~test_construct_cf_time~~CallsGraph proc~test_construct_cf_time test_construct_cf_time assertequal assertequal proc~test_construct_cf_time->assertequal asserttrue asserttrue proc~test_construct_cf_time->asserttrue

Source Code

   subroutine test_construct_cf_time()
      type(CF_Time_Integer) :: cfti
      type(CF_Time_Real) :: cftr
      integer :: iduration = 1800
      real(R64) :: rduration = 1800.0
      character(len=*), parameter :: time_unit = 'seconds'
      character(len=*), parameter :: base_datetime = '1999-12-31 23:29:59'
      character(len=*), parameter :: units = time_unit // ' since ' // base_datetime

      cfti = CF_Time_Integer(iduration, units)
      @assertTrue(cfti % is_valid, 'Invalid CF_Time_Integer')
      @assertEqual(iduration, cfti % duration, 'Duration does not match.')
      @assertEqual(time_unit, cfti % time_unit, 'Time unit does not match.')
      @assertEqual(base_datetime, cfti % base_datetime, 'base_datetime does not match.')
      
      cftr = CF_Time_Real(rduration, units)
      @assertTrue(cftr % is_valid, 'Invalid CF_Time_Real')
      @assertEqual(rduration, cftr % duration, 'Duration does not match.')
      @assertEqual(time_unit, cftr % time_unit, 'Time unit does not match.')
      @assertEqual(base_datetime, cftr % base_datetime, 'base_datetime does not match.')
      
   end subroutine test_construct_cf_time