Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Unit number / standard output

velvia
Beginner
604 Views
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
0 Kudos
1 Reply
Steven_L_Intel1
Employee
604 Views
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.
0 Kudos
Reply