close_file Subroutine

public subroutine close_file(lun, ierr) bind(C)

Close a file associated with a specified logical unit number.

Arguments

Type IntentOptional Attributes Name
integer(kind=c_int), intent(in) :: lun

Logical unit number.

integer(kind=c_int), intent(out) :: ierr

Error code returned by iostat.


Source Code

   subroutine close_file(lun, ierr) bind(C)
   !! Close a file associated with a specified logical unit number.
      integer(c_int), intent(in) :: lun
         !! Logical unit number.
      integer(c_int), intent(out) :: ierr
         !! Error code returned by `iostat`.

      close (unit=lun, iostat=ierr)

   end subroutine close_file