Load file name from file.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(file_object), | intent(inout) | :: | self | File object. |
||
| type(file_ini), | intent(in) | :: | fini | Simulation parameters ini file handler. |
||
| character(len=*), | intent(in) | :: | section_name | Option name into the ini file. |
||
| character(len=*), | intent(in) | :: | option_name | Option name into the ini file. |
||
| logical, | intent(in), | optional | :: | go_on_fail | Go on if load fails. |
subroutine load_file_name_from_file(self, fini, section_name, option_name, go_on_fail)
!< Load file name from file.
class(file_object), intent(inout) :: self !< File object.
type(file_ini), intent(in) :: fini !< Simulation parameters ini file handler.
character(*), intent(in) :: section_name !< Option name into the ini file.
character(*), intent(in) :: option_name !< Option name into the ini file.
logical, intent(in), optional :: go_on_fail !< Go on if load fails.
character(999) :: buffer !< Buffer string.
call fini%get(section_name=section_name, option_name=option_name, val=buffer, error=self%error%status)
if (present(go_on_fail)) then
if (.not.go_on_fail) &
call self%error%check(message='failed to load ['//section_name//'].('//option_name//')', is_severe=.not.go_on_fail)
endif
if (self%error%status <= 0) self%file_name = trim(adjustl(buffer))
endsubroutine load_file_name_from_file