read_scheme Subroutine

private subroutine read_scheme(files, scheme)

Read fvscheme.md control file

Arguments

Type IntentOptional AttributesName
type(filetype), intent(in) :: files
type(schemetype), intent(inout) :: scheme

Calls

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

Called by

proc~~read_scheme~~CalledByGraph proc~read_scheme read_scheme proc~read_input_and_controls read_input_and_controls proc~read_input_and_controls->proc~read_scheme 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_scheme(files, scheme)
        !< Read fvscheme.md control file
        !--------------------------------------------
        implicit none
        type(filetype), intent(in) ::  files
        type(schemetype), intent(inout) :: scheme
        character(len=STRING_BUFFER_LENGTH) :: buf
        integer                             :: ios

        DebugCall('read_scheme')

        open(files%SCHEME_FILE_UNIT, file=files%scheme_file, status='old', action='read')

        ! ignoring file header
        read(files%SCHEME_FILE_UNIT,*)
        read(files%SCHEME_FILE_UNIT,*)
        read(files%SCHEME_FILE_UNIT,*)
       
        ! read scheme name
        call get_next_token(files%SCHEME_FILE_UNIT, buf)
        read(buf, *) scheme%scheme_name
        DebugInfo('scheme_name = '//trim(buf))

        ! read interpolant
        call get_next_token(files%SCHEME_FILE_UNIT, buf)
        read(buf, *) scheme%interpolant
        scheme%interpolant = trim(scheme%interpolant)
        DebugInfo('interpolant = '//trim(buf))

        ! read ilimiter and PB switch
        call get_next_token(files%SCHEME_FILE_UNIT, buf)
        read(buf, *) scheme%ilimiter_switch, scheme%jlimiter_switch, scheme%klimiter_switch, &
                     scheme%iPB_switch, scheme%jPB_switch, scheme%kPB_switch
        DebugInfo('ilimiter switch = '//trim(buf) )
        DebugInfo('jlimiter switch = '//trim(buf) )
        DebugInfo('klimiter switch = '//trim(buf) )
          DebugInfo('PB switch = '//trim(buf) )

        ! read turbulent limiter
        call get_next_token(files%SCHEME_FILE_UNIT, buf)
        read(buf, *) scheme%itlimiter_switch,scheme%jtlimiter_switch,scheme%ktlimiter_switch 
        DebugInfo('ilimiter switch = '//trim(buf) )
        DebugInfo('jlimiter switch = '//trim(buf) )
        DebugInfo('klimiter switch = '//trim(buf) )

        ! read turbulence model
        call get_next_token(files%SCHEME_FILE_UNIT, buf)
        read(buf, *) scheme%turbulence
        DebugInfo('Turbulence Model = '//trim(buf))

        ! read transition model
        call get_next_token(files%SCHEME_FILE_UNIT, buf)
        read(buf, *) scheme%transition
        DebugInfo('Transition Model = '//trim(buf))

        ! read time stepping method
        call get_next_token(files%SCHEME_FILE_UNIT, buf)
        read(buf, *, iostat=ios) scheme%time_stepping_method, scheme%global_time_step
        if (ios /= 0) then
            read(buf, *) scheme%time_stepping_method
            scheme%global_time_step = -1
        end if
        DebugInfo('time_stepping_method = '//trim(buf))
        DebugInfo('global_time_step = '//trim(buf))

        ! read time integration method
        call get_next_token(files%SCHEME_FILE_UNIT, buf)
        read(buf, *) scheme%time_step_accuracy
        DebugInfo('time_step_accuracy  = '//trim(buf))

        ! read higher order boundary
        call get_next_token(files%SCHEME_FILE_UNIT, buf)
        read(buf, *) scheme%accur
        DebugInfo('higher order boundary  = '//trim(buf))


        close(files%SCHEME_FILE_UNIT)

      end subroutine read_scheme