Load the boundary condition time points 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_boundary_time_points(self, json) !> Load the boundary condition time points from the JSON file implicit none class(type_input) :: self type(json_file), intent(inout) :: json !! JSON parser character(:), allocatable :: key logical :: found integer(int32) :: i real(real64), parameter :: machine_epsilon = 1.0d-9 key = join([time_control, boundary_condition_time_points]) call json%get(key, self%conditions%time_control%boundary_time_points, found=found) if (.not. found) then call json%destroy() call error_message(904, c_opt=key) end if ! --- Check if the time points array is sorted --- if (size(self%conditions%time_control%boundary_time_points) > 1) then do i = 1, size(self%conditions%time_control%boundary_time_points) - 1 if (self%conditions%time_control%boundary_time_points(i) >= & self%conditions%time_control%boundary_time_points(i + 1)) then ! The array is not sorted in strictly ascending order. call json%destroy() call error_message(905, c_opt=key) end if end do end if if (size(self%conditions%time_control%boundary_time_points) < 2) then ! At least two time points are required. call json%destroy() call error_message(905, c_opt=key) end if ! --- Check if the time points are within the simulation period --- if (size(self%conditions%time_control%boundary_time_points) > 0) then ! 開始時刻のチェック if (abs(self%conditions%time_control%boundary_time_points(1) - & self%conditions%time_control%simulation_period%start) > machine_epsilon) then call json%destroy() call error_message(905, c_opt=key) end if ! 終了時刻のチェック if (abs(self%conditions%time_control%boundary_time_points(size(self%conditions%time_control%boundary_time_points)) - & self%conditions%time_control%simulation_period%end) > machine_epsilon) then call json%destroy() call error_message(905, c_opt=key) end if end if end subroutine read_conditions_time_control_boundary_time_points