read_controls Subroutine

private subroutine read_controls(files, control)

Read control.md file

Arguments

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

Calls

proc~~read_controls~~CallsGraph proc~read_controls read_controls debuginfo debuginfo proc~read_controls->debuginfo debugcall debugcall proc~read_controls->debugcall proc~get_next_token get_next_token proc~read_controls->proc~get_next_token

Called by

proc~~read_controls~~CalledByGraph proc~read_controls read_controls proc~read_input_and_controls read_input_and_controls proc~read_input_and_controls->proc~read_controls 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_controls(files, control)
        !< Read control.md file
        !---------------------------------------------
        implicit none
        type(filetype), intent(in) :: files
        type(controltype), intent(inout) :: control
        character(len=STRING_BUFFER_LENGTH) :: buf

        DebugCall('read_controls')

        open(files%CONTROL_FILE_UNIT, file=files%control_file, status='old', action='read')

        !ignoring file header
        read(files%CONTROL_FILE_UNIT,*)
        read(files%CONTROL_FILE_UNIT,*)
        read(files%CONTROL_FILE_UNIT,*)

        ! READ CFL
        call get_next_token(files%CONTROL_FILE_UNIT, buf)
        read(buf, *) control%CFL
        DebugInfo("CFL = "//trim(buf))

        ! READ start_from
        call get_next_token(files%CONTROL_FILE_UNIT, buf)
        read(buf, *) control%start_from
        DebugInfo('Start from  level = '//trim(buf))

        ! READ max_iters
        call get_next_token(files%CONTROL_FILE_UNIT, buf)
        read(buf, *) control%max_iters
        DebugInfo('Stop at iteration = '//trim(buf))

        ! READ checkpoint_iter
        call get_next_token(files%CONTROL_FILE_UNIT, buf)
        read(buf, *) control%checkpoint_iter
        DebugInfo(' Solution write interval = '//trim(buf))

        ! READ write_file_format
        call get_next_token(files%CONTROL_FILE_UNIT, buf)
        read(buf, *) control%write_file_format
        DebugInfo('Solution file format  = '//trim(buf))

        ! READ write_data_format
        call get_next_token(files%CONTROL_FILE_UNIT, buf)
        read(buf, *) control%write_data_format
        DebugInfo('solution file data format = '//trim(buf))

        ! READ read_file_format
        call get_next_token(files%CONTROL_FILE_UNIT, buf)
        read(buf, *) control%read_file_format
        DebugInfo('Restart file format  = '//trim(buf))

        ! READ_read data_format
        call get_next_token(files%CONTROL_FILE_UNIT, buf)
        read(buf, *) control%read_data_format
        DebugInfo('Restart file data format = '//trim(buf))

        ! READ write_percision
        call get_next_token(files%CONTROL_FILE_UNIT, buf)
        read(buf, *) control%write_percision
        DebugInfo('File write percision = '//trim(buf))

        ! READ purge_write
        call get_next_token(files%CONTROL_FILE_UNIT, buf)
        read(buf, *) control%purge_write
        DebugInfo('Purge folder more then  = '//trim(buf))

        ! READ res_write_interval
        call get_next_token(files%CONTROL_FILE_UNIT, buf)
        read(buf, *) control%res_write_interval
        DebugInfo('resnorm write interval  = '//trim(buf))

        ! READ tolerance
        call get_next_token(files%CONTROL_FILE_UNIT, buf)
        read(buf, *) control%tolerance, control%tolerance_type
        DebugInfo(trim(control%tolerance_type)//' Tolerance  = '//trim(buf))

        ! READ DEBUG_LEVEL
        call get_next_token(files%CONTROL_FILE_UNIT, buf)
        read(buf, *) control%DEBUG_LEVEL
        DebugInfo('DEBUG_LEVEL = '//trim(buf))

        close(files%CONTROL_FILE_UNIT)

      end subroutine read_controls