Load the time stepping parameters from the JSON file
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(type_input) | :: | self | ||||
type(json_file), | intent(inout) | :: | json |
JSON parser |
subroutine read_conditions_time_control_time_stepping(self, json) !> Load the time stepping parameters from the JSON file implicit none class(type_input) :: self type(json_file), intent(inout) :: json !! JSON parser character(:), allocatable :: key logical :: found key = join([time_control, time_stepping, unit]) call json%get(key, self%conditions%time_control%time_stepping%unit, found=found) if (.not. found) then call json%destroy() call error_message(904, c_opt=key) else if (.not. any(valid_units(:) == self%conditions%time_control%time_stepping%unit)) then call json%destroy() call error_message(905, c_opt=key) end if key = join([time_control, time_stepping, initial_step]) call json%get(key, self%conditions%time_control%time_stepping%initial_step, found=found) if (.not. found) then call json%destroy() call error_message(904, c_opt=key) else if (self%conditions%time_control%time_stepping%initial_step <= 0.0) then call json%destroy() call error_message(905, c_opt=key) end if key = join([time_control, time_stepping, min_step]) call json%get(key, self%conditions%time_control%time_stepping%min_step, found=found) if (.not. found) then call json%destroy() call error_message(904, c_opt=key) else if (self%conditions%time_control%time_stepping%min_step <= 0.0) then call json%destroy() call error_message(905, c_opt=key) end if key = join([time_control, time_stepping, max_step]) call json%get(key, self%conditions%time_control%time_stepping%max_step, found=found) if (.not. found) then call json%destroy() call error_message(904, c_opt=key) else if (self%conditions%time_control%time_stepping%max_step <= 0.0) then call json%destroy() call error_message(905, c_opt=key) end if if (self%conditions%time_control%time_stepping%min_step > self%conditions%time_control%time_stepping%max_step) then call json%destroy() call error_message(905, c_opt=key) end if if (self%conditions%time_control%time_stepping%initial_step < self%conditions%time_control%time_stepping%min_step .or. & self%conditions%time_control%time_stepping%initial_step > self%conditions%time_control%time_stepping%max_step) then call json%destroy() call error_message(905, c_opt=key) end if end subroutine read_conditions_time_control_time_stepping