read_parameters_geometry_settings Subroutine

subroutine read_parameters_geometry_settings(self, json)

Load the geometry settings from the JSON file

Arguments

Type IntentOptional Attributes Name
class(type_input) :: self
type(json_file), intent(inout) :: json

JSON parser


Calls

proc~~read_parameters_geometry_settings~~CallsGraph proc~read_parameters_geometry_settings read_parameters_geometry_settings destroy destroy proc~read_parameters_geometry_settings->destroy get get proc~read_parameters_geometry_settings->get print_error_message print_error_message proc~read_parameters_geometry_settings->print_error_message proc~error_message error_message proc~read_parameters_geometry_settings->proc~error_message proc~join join proc~read_parameters_geometry_settings->proc~join log_error log_error proc~error_message->log_error

Called by

proc~~read_parameters_geometry_settings~~CalledByGraph proc~read_parameters_geometry_settings read_parameters_geometry_settings proc~inout_read_basic_parameters inout_read_basic_parameters proc~inout_read_basic_parameters->proc~read_parameters_geometry_settings interface~inout_read_basic_parameters type_input%inout_read_basic_parameters interface~inout_read_basic_parameters->proc~inout_read_basic_parameters proc~initialize_type_input type_input%initialize_type_input proc~initialize_type_input->interface~inout_read_basic_parameters

Source Code

    subroutine read_parameters_geometry_settings(self, json)
        !> Load the geometry settings from the JSON file
        implicit none
        class(type_input) :: self
        type(json_file), intent(inout) :: json !! JSON parser

        logical :: found
        character(:), allocatable :: key

        key = join([geometry_settings, file_name])
        call json%get(key, self%basic%geometry_settings%file_name, found)
        call json%print_error_message(output_unit)
        if (.not. found) then
            call json%destroy()
            call error_message(904, c_opt=key)
        end if

        self%geometry_file_name = self%project_path//"Input/"//trim(adjustl(self%basic%geometry_settings%file_name))
        inquire (file=self%geometry_file_name, exist=found)
        if (.not. found) then
            call json%destroy()
            call error_message(902, c_opt=self%geometry_file_name)
        end if

        key = join([geometry_settings, cell_id_array_name])
        call json%get(key, self%basic%geometry_settings%cell_id_array_name, 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([geometry_settings, integration, integration_type])
        call json%get(key, self%basic%geometry_settings%integration_type, 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(integration_types(:) == self%basic%geometry_settings%integration_type)) then
            call json%destroy()
            call error_message(905, c_opt=key)
        end if

        if (self%basic%geometry_settings%integration_type == "free") then
            key = join([geometry_settings, integration, integration_points])
            call json%get(key, self%basic%geometry_settings%integration_points, found)
            call json%print_error_message(output_unit)
            if (.not. found) then
                call json%destroy()
                call error_message(904, c_opt=key)
            else if (self%basic%geometry_settings%integration_points < 0.0d0 .or. &
                     self%basic%geometry_settings%integration_points > 1.0d0) then
                call json%destroy()
                call error_message(905, c_opt=key)
            end if
        end if

    end subroutine read_parameters_geometry_settings