| 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 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 call error_message(981, c_opt="calculation time unit") 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 call error_message(981, c_opt="simulation period time unit") end select call Allocate_Array(self%dt_old, input%basic%solver_settings%bdf_order) self%dt_old(:) = 0.0d0 if (allocated(input%output_settings%field_output%output_interval_unit)) then select case (trim(input%output_settings%field_output%output_interval_unit)) case ("second") select case (trim(input%conditions%time_control%simulation_period%unit)) case ("second") self%time_conversion = 1.0d0 case ("minute") self%time_conversion = 1.0d0 / 60.0d0 case ("hour") self%time_conversion = 1.0d0 / 3600.0d0 case ("day") self%time_conversion = 1.0d0 / 86400.0d0 case ("year") self%time_conversion = 1.0d0 / 31557600.0d0 end select case ("minute") select case (trim(input%conditions%time_control%simulation_period%unit)) case ("second") self%time_conversion = 60.0d0 case ("minute") self%time_conversion = 1.0d0 case ("hour") self%time_conversion = 1.0d0 / 60.0d0 case ("day") self%time_conversion = 1.0d0 / 1440.0d0 case ("year") self%time_conversion = 1.0d0 / 525600.0d0 end select case ("hour") select case (trim(input%conditions%time_control%simulation_period%unit)) case ("second") self%time_conversion = 3600.0d0 case ("minute") self%time_conversion = 60.0d0 case ("hour") self%time_conversion = 1.0d0 case ("day") self%time_conversion = 1.0d0 / 24.0d0 case ("year") self%time_conversion = 1.0d0 / 8760.0d0 end select case ("day") select case (trim(input%conditions%time_control%simulation_period%unit)) case ("second") self%time_conversion = 86400.0d0 case ("minute") self%time_conversion = 1440.0d0 case ("hour") self%time_conversion = 24.0d0 case ("day") self%time_conversion = 1.0d0 case ("year") self%time_conversion = 1.0d0 / 365.0d0 end select case ("year") select case (trim(input%conditions%time_control%simulation_period%unit)) case ("second") self%time_conversion = 31557600.0d0 case ("minute") self%time_conversion = 525600.0d0 case ("hour") self%time_conversion = 8760.0d0 case ("day") self%time_conversion = 365.0d0 case ("year") self%time_conversion = 1.0d0 end select end select end if end if if (present(profiler_sections)) then if (size(profiler_sections) > 0) then 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