read_conditions_boundary_conditions_hydraulic Subroutine

subroutine read_conditions_boundary_conditions_hydraulic(boundary, json, key_base, num_time_points)

Arguments

Type IntentOptional 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


Calls

proc~~read_conditions_boundary_conditions_hydraulic~~CallsGraph proc~read_conditions_boundary_conditions_hydraulic read_conditions_boundary_conditions_hydraulic destroy destroy proc~read_conditions_boundary_conditions_hydraulic->destroy get get proc~read_conditions_boundary_conditions_hydraulic->get proc~error_message error_message proc~read_conditions_boundary_conditions_hydraulic->proc~error_message proc~join join proc~read_conditions_boundary_conditions_hydraulic->proc~join log_error log_error proc~error_message->log_error

Called by

proc~~read_conditions_boundary_conditions_hydraulic~~CalledByGraph proc~read_conditions_boundary_conditions_hydraulic read_conditions_boundary_conditions_hydraulic proc~read_conditions_boundary_conditions read_conditions_boundary_conditions proc~read_conditions_boundary_conditions->proc~read_conditions_boundary_conditions_hydraulic proc~read_conditions_initial_conditions_hydraulic read_conditions_initial_conditions_hydraulic proc~read_conditions_initial_conditions_hydraulic->proc~read_conditions_boundary_conditions_hydraulic proc~inout_read_conditions inout_read_conditions proc~inout_read_conditions->proc~read_conditions_boundary_conditions proc~read_conditions_initial_conditions read_conditions_initial_conditions proc~inout_read_conditions->proc~read_conditions_initial_conditions proc~read_conditions_initial_conditions->proc~read_conditions_initial_conditions_hydraulic interface~inout_read_conditions type_input%inout_read_conditions interface~inout_read_conditions->proc~inout_read_conditions proc~initialize_type_input type_input%initialize_type_input proc~initialize_type_input->interface~inout_read_conditions

Source Code

    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