read_Res_list Subroutine

private subroutine read_Res_list(files, control)

Read Residual file: res_control.md

Arguments

Type IntentOptional AttributesName
type(filetype), intent(in) :: files
type(controltype), intent(inout) :: control

Calls

proc~~read_res_list~~CallsGraph proc~read_res_list read_Res_list proc~get_number_of_line get_number_of_line proc~read_res_list->proc~get_number_of_line proc~get_count_within_braces get_count_within_braces proc~read_res_list->proc~get_count_within_braces proc~get_count_within_braces->proc~get_number_of_line

Called by

proc~~read_res_list~~CalledByGraph proc~read_res_list read_Res_list proc~read_input_and_controls read_input_and_controls proc~read_input_and_controls->proc~read_res_list proc~setup_solver setup_solver proc~setup_solver->proc~read_input_and_controls proc~start_run start_run proc~start_run->proc~setup_solver program~main main program~main->proc~start_run

Contents

Source Code


Source Code

      subroutine read_Res_list(files, control)
        !< Read Residual file: res_control.md
        implicit none
        type(filetype), intent(in) :: files
        type(controltype), intent(inout) :: control
        integer           :: i
        integer           :: skip
        logical :: ok

        open(files%RES_CONTROL_FILE_UNIT, file=files%res_control_file, status='old', action='read')
        call get_count_within_braces(files%RES_CONTROL_FILE_UNIT, control%Res_count)
        !call close_file(files%RES_CONTROL_FILE_UNIT)
        inquire(files%RES_CONTROL_FILE_UNIT, opened=ok)
        if(ok)  close(files%RES_CONTROL_FILE_UNIT)

        open(files%RES_CONTROL_FILE_UNIT, file=files%res_control_file, status='old', action='read')
        ! skipping line
        skip  = get_number_of_line('{',files%RES_CONTROL_FILE_UNIT)

        !reading vaules
        if(control%Res_count==0)then
          allocate(control%Res_list(1:2))
          control%Res_count=2
          control%Res_list(1)="Mass_abs"
          control%Res_list(2)="Resnorm_abs"
        else
          allocate(control%Res_list(1:control%Res_count))
        end if
        do i = 1,control%Res_count
          read(files%RES_CONTROL_FILE_UNIT, *) control%Res_list(i)
        end do

        close(files%RES_CONTROL_FILE_UNIT)

      end subroutine read_Res_list