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