Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(type_time), | intent(inout) | :: | self | |||
type(type_input), | intent(in), | optional | :: | input | ||
character(len=*), | intent(in), | optional | :: | profiler_sections(:) |
subroutine initialize_type_time(self, input, profiler_sections) implicit none class(type_time), intent(inout) :: self type(type_Input), intent(in), optional :: input character(*), intent(in), optional :: profiler_sections(:) integer(int32) :: i integer(int32) :: dummy if (present(input)) then select case (trim(input%conditions%time_control%time_stepping%unit)) case ("second") self%dt = input%conditions%time_control%time_stepping%initial_step !& self%dt_max = input%conditions%time_control%time_stepping%max_step !& self%dt_min = input%conditions%time_control%time_stepping%min_step !& case ("minute") self%dt = input%conditions%time_control%time_stepping%initial_step * 60.0d0 !& self%dt_max = input%conditions%time_control%time_stepping%max_step * 60.0d0 !& self%dt_min = input%conditions%time_control%time_stepping%min_step * 60.0d0 !& case ("hour") self%dt = input%conditions%time_control%time_stepping%initial_step * 3600.0d0 !& self%dt_max = input%conditions%time_control%time_stepping%max_step * 3600.0d0 !& self%dt_min = input%conditions%time_control%time_stepping%min_step * 3600.0d0 !& case ("day") self%dt = input%conditions%time_control%time_stepping%initial_step * 86400.0d0 !& self%dt_max = input%conditions%time_control%time_stepping%max_step * 86400.0d0 !& self%dt_min = input%conditions%time_control%time_stepping%min_step * 86400.0d0 !& case ("year") self%dt = input%conditions%time_control%time_stepping%initial_step * 31557600.0d0 !& self%dt_max = input%conditions%time_control%time_stepping%max_step * 31557600.0d0 !& self%dt_min = input%conditions%time_control%time_stepping%min_step * 31557600.0d0 !& case default write (*, *) "Error: Unknown time unit in Calculation_TimeUnit" stop end select select case (trim(input%conditions%time_control%simulation_period%unit)) case ("second") self%start_time = input%conditions%time_control%simulation_period%start !& self%end_time = input%conditions%time_control%simulation_period%end !& case ("minute") self%start_time = input%conditions%time_control%simulation_period%start * 60.0d0 !& self%end_time = input%conditions%time_control%simulation_period%end * 60.0d0 !& case ("hour") self%start_time = input%conditions%time_control%simulation_period%start * 3600.0d0 !& self%end_time = input%conditions%time_control%simulation_period%end * 3600.0d0 !& case ("day") self%start_time = input%conditions%time_control%simulation_period%start * 86400.0d0 !& self%end_time = input%conditions%time_control%simulation_period%end * 86400.0d0 !& case ("year") self%start_time = input%conditions%time_control%simulation_period%start * 31557600.0d0 !& self%end_time = input%conditions%time_control%simulation_period%end * 31557600.0d0 !& case default write (*, *) "Error: Unknown time unit in Input_TimeUnit" stop end select call Allocate_Array(self%dt_old, input%basic%solver_settings%bdf_order) end if if (present(profiler_sections)) then if (size(profiler_sections) > 0) then #ifndef _OPENMP call system_clock(dummy, self%tick_rate) #endif allocate (self%sections(size(profiler_sections))) do i = 1, size(profiler_sections) self%sections(i)%label = trim(profiler_sections(i)) end do end if end if end subroutine initialize_type_time