read_output_control Subroutine

private subroutine read_output_control(files, control)

Read output_contorl.md file

Arguments

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

Calls

proc~~read_output_control~~CallsGraph proc~read_output_control read_output_control proc~get_rw_count get_rw_count proc~read_output_control->proc~get_rw_count

Called by

proc~~read_output_control~~CalledByGraph proc~read_output_control read_output_control proc~read_input_and_controls read_input_and_controls proc~read_input_and_controls->proc~read_output_control 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_output_control(files, control)
        !< Read output_contorl.md file
        implicit none
        type(filetype), intent(in) :: files
        type(controltype), intent(inout) :: control
        integer           :: i
        character(len=64) :: buf
        integer :: ios
        logical :: ok
        
        call get_rw_count(files, control)
        inquire(files%OUTIN_FILE_UNIT, opened=ok)
        if(ok)  close(files%OUTIN_FILE_UNIT)
        !call close_file(files%OUTIN_FILE_UNIT)
        open(files%OUTIN_FILE_UNIT, file=files%outin_file, status='old', action='read')

        ! variables to write
        do while(.true.)
          read(files%OUTIN_FILE_UNIT, *, iostat=ios) buf
          if(trim(buf)=='{') EXIT
          if(is_iostat_end(ios)) EXIT
        end do
        do i = 1,control%w_count
          read(files%OUTIN_FILE_UNIT, *) buf
          read(buf,*) control%w_list(i)
        end do

        ! restart variables to read
        do while(.true.)
          read(files%OUTIN_FILE_UNIT, *, iostat=ios) buf
          if(trim(buf)=='{') EXIT
          if(is_iostat_end(ios)) EXIT
        end do
        do i = 1,control%r_count
          read(files%OUTIN_FILE_UNIT, *) buf
          read(buf,*) control%r_list(i)
        end do
        if(control%r_count==0) control%r_list=control%w_list

        close(files%OUTIN_FILE_UNIT)

      end subroutine read_output_control