mp_file_close Subroutine

public subroutine mp_file_close(fh)

Closes a file

MPI-I/O mapping mpi_file_close

STREAM-I/O mapping CLOSE

Arguments

Type IntentOptional Attributes Name
integer, intent(inout) :: fh

file handle (file storage unit)


Contents

Source Code


Source Code

   SUBROUTINE mp_file_close(fh)
      !! Closes a file
      !!
      !! MPI-I/O mapping   mpi_file_close
      !!
      !! STREAM-I/O mapping   CLOSE

      INTEGER, INTENT(INOUT)                             :: fh
         !! file handle (file storage unit)

      INTEGER                                            :: ierr

      ierr = 0
#if defined(__parallel)
      CALL mpi_file_set_errhandler(fh, MPI_ERRORS_RETURN, ierr)
      CALL mpi_file_close(fh, ierr)
      IF (ierr .NE. 0) CALL mp_stop(ierr, "mpi_file_set_errhandler @ mp_file_close")
#else
      CLOSE (fh)
#endif
   END SUBROUTINE mp_file_close