Load from file.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(solver_object), | intent(inout) | :: | self | Solver object. |
||
| type(file_ini), | intent(in) | :: | fini | Simulation parameters ini file handler. |
||
| logical, | intent(in), | optional | :: | go_on_fail | Go on if load fails. |
subroutine load_from_file(self, fini, go_on_fail)
!< Load from file.
class(solver_object), intent(inout) :: self !< Solver object.
type(file_ini), intent(in) :: fini !< Simulation parameters ini file handler.
logical, intent(in), optional :: go_on_fail !< Go on if load fails.
logical :: go_on_fail_ !< Go on if load fails, local variable.
character(999) :: buffer !< Buffer string.
go_on_fail_ = .true. ; if (present(go_on_fail)) go_on_fail_ = go_on_fail
call fini%get(section_name=INI_SECTION_NAME, &
option_name='time_integrator', &
val=buffer, &
error=self%error%status)
if (.not.go_on_fail_) &
call self%error%check(message='failed to load ['//INI_SECTION_NAME//'].(time_integrator)', is_severe=.not.go_on_fail_)
if (self%error%status <= 0) self%time_integrator = trim(adjustl(buffer))
call fini%get(section_name=INI_SECTION_NAME, &
option_name='convective_operator', &
val=buffer, &
error=self%error%status)
if (.not.go_on_fail_) &
call self%error%check(message='failed to load ['//INI_SECTION_NAME//'].(convective_operator)', is_severe=.not.go_on_fail_)
if (self%error%status <= 0) self%convective_operator = trim(adjustl(buffer))
call fini%get(section_name=INI_SECTION_NAME, &
option_name='diffusive_operator', &
val=buffer, &
error=self%error%status)
if (.not.go_on_fail_) &
call self%error%check(message='failed to load ['//INI_SECTION_NAME//'].(diffusive_operator)', is_severe=.not.go_on_fail_)
if (self%error%status <= 0) self%diffusive_operator = trim(adjustl(buffer))
call fini%get(section_name=INI_SECTION_NAME, &
option_name='turbulence_model', &
val=buffer, &
error=self%error%status)
if (.not.go_on_fail_) &
call self%error%check(message='failed to load ['//INI_SECTION_NAME//'].(turbulence_model)', is_severe=.not.go_on_fail_)
if (self%error%status <= 0) self%turbulence_model = trim(adjustl(buffer))
call fini%get(section_name=INI_SECTION_NAME, &
option_name='artificial_viscosity', &
val=self%artificial_viscosity, &
error=self%error%status)
if (.not.go_on_fail_) &
call self%error%check(message='failed to load ['//INI_SECTION_NAME//'].(artificial_viscosity)', is_severe=.not.go_on_fail_)
call fini%get(section_name=INI_SECTION_NAME, &
option_name='residuals_tolerance', &
val=self%residuals_tolerance, &
error=self%error%status)
if (.not.go_on_fail_) &
call self%error%check(message='failed to load ['//INI_SECTION_NAME//'].(residuals_tolerance)', is_severe=.not.go_on_fail_)
call fini%get(section_name=INI_SECTION_NAME, &
option_name='pseudo_compressibility', &
val=self%pseudo_compressibility, &
error=self%error%status)
if (.not.go_on_fail_) &
call self%error%check(message='failed to load ['//INI_SECTION_NAME//'].(pseudo_compressibility)', is_severe=.not.go_on_fail_)
call fini%get(section_name=INI_SECTION_NAME, &
option_name='chimera_forcing', &
val=self%chimera_forcing, &
error=self%error%status)
if (.not.go_on_fail_) &
call self%error%check(message='failed to load ['//INI_SECTION_NAME//'].(chimera_forcing)', is_severe=.not.go_on_fail_)
endsubroutine load_from_file