Class file_tools_class
In: LatticeClass/file_tools_class.F90
comlib error_class file_tools_class dot/f_252.png

this module contains file handling tools.

Version

$Id: file_tools_class.F90,v 1.4 2011/02/02 12:17:07 ishikawa Exp $

Methods

Included Modules

comlib error_class

Public Instance methods

Function :
unit :integer

return free file unit number

[Source]

function search_free_file_unit_ft() result(unit)
!
! return free file unit number
!
  implicit none
  integer :: unit
  logical :: is_opened
  current_unit = START_UNIT
  do
    INQUIRE(UNIT=current_unit,OPENED=is_opened)
    if (is_opened) then
      current_unit = current_unit+1
    else
      exit
    endif
    if (current_unit > MAX_UNIT) then
      call error_stop("Fail to search free IO unit")
    endif
  enddo
  unit = current_unit
  return
end function