Initialize File.
Leading and trailing white spaces are removed from file name.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(file_object), | intent(inout) | :: | self | File object. |
||
| character(len=*), | intent(in), | optional | :: | file_name | File name. |
elemental subroutine initialize(self, file_name)
!< Initialize File.
!<
!< @note Leading and trailing white spaces are removed from file name.
class(file_object), intent(inout) :: self !< File object.
character(len=*), intent(in), optional :: file_name !< File name.
call self%destroy
call self%error%initialize
if (present(file_name)) then
self%file_name = trim(adjustl(file_name))
else
self%file_name = UNSET_FILE_NAME
endif
self%is_initialized = .true.
endsubroutine initialize