file_exists Function

public function file_exists(file_name) result(exist)

Checks if file exists, considering also the file discovery mechanism.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: file_name

Return Value logical


Source Code

   FUNCTION file_exists(file_name) RESULT(exist)
      !! Checks if file exists, considering also the file discovery mechanism.
      CHARACTER(LEN=*), INTENT(IN)                       :: file_name
      LOGICAL                                            :: exist

      INQUIRE (FILE=TRIM(file_name), exist=exist)
   END FUNCTION file_exists