subroutine close_file(me) type(file_t),intent(inout) :: me if (me%iunit/=0) then print*, 'close' close (me%iunit) me%iunit = 0 end if end subroutine close_file