read_output_settings_fields Subroutine

subroutine read_output_settings_fields(self, json)

Arguments

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

Calls

proc~~read_output_settings_fields~~CallsGraph proc~read_output_settings_fields read_output_settings_fields destroy destroy proc~read_output_settings_fields->destroy get get proc~read_output_settings_fields->get print_error_message print_error_message proc~read_output_settings_fields->print_error_message proc~configure_output_variables configure_output_variables proc~read_output_settings_fields->proc~configure_output_variables proc~error_message error_message proc~read_output_settings_fields->proc~error_message proc~join join proc~read_output_settings_fields->proc~join proc~configure_output_variables->destroy proc~configure_output_variables->proc~error_message interface~filter filter proc~configure_output_variables->interface~filter log_error log_error proc~error_message->log_error proc~filter_character_array filter_character_array interface~filter->proc~filter_character_array

Called by

proc~~read_output_settings_fields~~CalledByGraph proc~read_output_settings_fields read_output_settings_fields proc~inout_read_output_settings inout_read_output_settings proc~inout_read_output_settings->proc~read_output_settings_fields interface~inout_read_output_settings type_input%inout_read_output_settings interface~inout_read_output_settings->proc~inout_read_output_settings proc~initialize_type_input type_input%initialize_type_input proc~initialize_type_input->interface~inout_read_output_settings

Source Code

    subroutine read_output_settings_fields(self, json)
        implicit none
        class(type_input), intent(inout) :: self
        type(json_file), intent(inout) :: json

        character(:), allocatable :: key
        logical :: found
        integer(int32) :: i
        character(64), allocatable :: active_categories(:)
        character(64), allocatable :: tmp_variable_names(:)

        key = join([field_output, file_format])
        call json%get(key, self%output_settings%field_output%file_format, found)
        call json%print_error_message(output_unit)
        if (.not. found) then
            self%output_settings%field_output%file_format = "none"
        else if (.not. any(valid_field_file_formats(:) == self%output_settings%field_output%file_format)) then
            call json%destroy()
            call error_message(905, c_opt=key)
        end if

        select case (self%output_settings%field_output%file_format)
        case (valid_field_file_formats(2), valid_field_file_formats(3))

            key = join([field_output, coloring])
            call json%get(key, self%output_settings%field_output%coloring, found)
            call json%print_error_message(output_unit)
            if (.not. found) then
                self%output_settings%field_output%coloring = .false.
            else
                if (self%basic%solver_settings%coloring == "none") then
                    self%output_settings%field_output%coloring = .false.
                end if
            end if

            key = join([field_output, output_interval, unit])
            call json%get(key, self%output_settings%field_output%output_interval_unit, 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_units(:) == self%output_settings%field_output%output_interval_unit)) then
                call json%destroy()
                call error_message(905, c_opt=key)
            end if

            key = join([field_output, output_interval, value])
            call json%get(key, self%output_settings%field_output%output_interval_step, 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%output_settings%field_output%output_interval_step <= 0) then
                call json%destroy()
                call error_message(905, c_opt=key)
            end if

            key = join([field_output, variables])
            call json%get(key, tmp_variable_names, found)
            call json%print_error_message(output_unit)
            if (.not. found) then
                call json%destroy()
                call error_message(904, c_opt=key)
            else if (size(tmp_variable_names) == 0) then
                call json%destroy()
                call error_message(905, c_opt=key)
            else

                active_categories = pack(variable_keys, mask=[self%basic%analysis_controls%calculate_thermal, &
                                                              any(self%basic%materials(:)%is_frozen), &
                                                              self%basic%analysis_controls%calculate_hydraulic])
                call configure_output_variables(self%output_settings%field_output%variable_names, & ! 更新対象のリスト
                                                tmp_variable_names, & ! 入力された変数名リスト
                                                active_categories, & ! 有効なカテゴリ
                                                json, & ! エラー処理用のjsonオブジェクト
                                                key)
            end if

        end select

    end subroutine read_output_settings_fields