Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(type_linear_solver_settings) | :: | solver_setting | ||||
type(json_file), | intent(inout) | :: | json | |||
character(len=*), | intent(in) | :: | key_base |
subroutine read_parameters_solver_settings_linear_local(solver_setting, json, key_base) implicit none class(type_linear_solver_settings) :: solver_setting type(json_file), intent(inout) :: json character(*), intent(in) :: key_base logical :: found character(:), allocatable :: key key = join([key_base, method]) call json%get(key, solver_setting%method, found) call json%print_error_message(output_unit) if (.not. found) then call json%destroy() call error_message(904, c_opt=key) else if (.not. any(valid_linear_solver_methods(:) == solver_setting%method)) then call json%destroy() call error_message(905, c_opt=key) end if select case (solver_setting%method) case (valid_linear_solver_methods(2)) key = join([key_base, iterative_solver, solver_type]) call json%get(key, solver_setting%iterative_solver%solver_type, found) call json%print_error_message(output_unit) if (.not. found) then call json%destroy() call error_message(904, c_opt=key) end if key = join([key_base, iterative_solver, preconditioner_type]) call json%get(key, solver_setting%iterative_solver%preconditioner_type, found) call json%print_error_message(output_unit) if (.not. found) then call json%destroy() call error_message(904, c_opt=key) end if key = join([key_base, iterative_solver, max_iterations]) call json%get(key, solver_setting%iterative_solver%max_iterations, found) call json%print_error_message(output_unit) if (.not. found) then call global_logger%log_warning(message="Using default maximum iterations of 10000 for iterative solver.") solver_setting%iterative_solver%max_iterations = 10000 else if (solver_setting%iterative_solver%max_iterations <= 0) then call json%destroy() call error_message(905, c_opt=key) end if key = join([key_base, iterative_solver, tolerance]) call json%get(key, solver_setting%iterative_solver%tolerance, found) call json%print_error_message(output_unit) if (.not. found) then call global_logger%log_warning(message="Using default tolerance of 1.0d-6 for iterative solver.") solver_setting%iterative_solver%tolerance = 1.0d-6 else if (solver_setting%iterative_solver%tolerance < 0.0d0) then call json%destroy() call error_message(905, c_opt=key) end if end select end subroutine read_parameters_solver_settings_linear_local