Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(type_boundary_local), | intent(inout) | :: | boundary | |||
type(json_file), | intent(inout) | :: | json |
JSON parser |
||
character(len=*), | intent(in) | :: | key_base |
Base key for the boundary condition |
||
integer(kind=int32), | intent(in), | optional | :: | num_time_points |
Number of time points for the boundary condition |
subroutine read_conditions_boundary_conditions_hydraulic(boundary, json, key_base, num_time_points) implicit none class(type_boundary_local), intent(inout) :: boundary type(json_file), intent(inout) :: json !! JSON parser character(*), intent(in) :: key_base !! Base key for the boundary condition integer(int32), intent(in), optional :: num_time_points !! Number of time points for the boundary condition character(:), allocatable :: key logical :: found select type (bc => boundary) class is (type_boundary_local) ! Do nothing, bc is already of type type_boundary_local class is (type_boundary_local_initial) key = join([key_base, id]) call json%get(key, bc%id, found=found) if (.not. found) then call json%destroy() call error_message(904, c_opt=key) end if end select key = join([key_base, type]) call json%get(key, boundary%type, found=found) if (.not. found) then call json%destroy() call error_message(904, c_opt=key) else if (.not. any(valid_hydraulic_boundary_types(:) == boundary%type)) then call json%destroy() call error_message(905, c_opt=key) end if select case (boundary%type) case (valid_hydraulic_boundary_types(1)) key = join([key_base, is_uniform]) call json%get(key, boundary%is_uniform, found=found) if (.not. found) then call json%destroy() call error_message(904, c_opt=key) end if if (boundary%is_uniform) then key = join([key_base, values]) call json%get(key, boundary%values, found=found) if (.not. found) then call json%destroy() call error_message(904, c_opt=key) else if (present(num_time_points)) then if (size(boundary%values(:)) /= num_time_points) then call json%destroy() call error_message(905, c_opt=key) end if end if end if end select end subroutine read_conditions_boundary_conditions_hydraulic