- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Does the standard output has a unit number ? I want to be able to write a type-bound procedure which looks like
subroutine writeDescription(theUnit)
integer, intent(in) :: theUnit
write (theUnit, *) 'My description'
end subroutine
and I want to call something like myObject%writeDescription(*).
What can I do ?
Francois
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The standard way to do this is to use the named constant OUTPUT_UNIT from intrinsic module ISO_FORTRAN_ENV. For example:
[fortran]use, intrinsic :: iso_fortran_env write (OUTPUT_UNIT,*) 'My description'[/fortran]You can't pass * as an argument, but you could pass OUTPUT_UNIT if you wished.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page