Read fvscheme.md control file
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(filetype), | intent(in) | :: | files | |||
type(schemetype), | intent(inout) | :: | scheme |
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