Re: closing unit=5 and unit=6 and print *
- From: sbergero@xxxxxxxxx
- Date: 29 Aug 2006 07:56:38 -0700
To avoid such problems, I use the following ISO_FORTRAN_ENV.f90 file
everywhere with my F95 programs:
module ISO_FORTRAN_ENV
! Nonintrinsic version for Lahey/Fujitsu Fortran for Linux.
! See Subclause 13.8.2 of the Fortran 2003 standard.
implicit NONE
public
integer, parameter :: Character_Storage_Size = 8
integer, parameter :: Error_Unit = 0
integer, parameter :: File_Storage_Size = 8
integer, parameter :: Input_Unit = 5
integer, parameter :: IOSTAT_END = -1
integer, parameter :: IOSTAT_EOR = -2
integer, parameter :: Numeric_Storage_Size = 32
integer, parameter :: Output_Unit = 6
end module ISO_FORTRAN_ENV
I use the same file with Lahey 5.6, CVF and Intel 9.1 (all on Windows),
but I don't use all the values.
And I don't remember who provide it...
Arjen Markus a écrit :
beliav...@xxxxxxx schreef:
It is convenient to have a subroutine that can write to a file or print
to the console, depending on what unit number is passed to it. It is
less convenient to wrap IF statements around all WRITE statements to
choose between unit=* and unit=some_number. If a code assumes that 6 is
the unit for standard output, a PARAMETER should be declared and used
for this, to make this assumption clear.
Yes, but isn't that included in Fortran 2003? (I do not have the
standard
near me, so I can not check, but I remember something like that).
Otherwise, I think it is one of the things Dan Nagle's portability
project
takes care of.
Regards,
Arjen
.
- References:
- closing unit=5 and unit=6 and print *
- From: Dylan Sung
- Re: closing unit=5 and unit=6 and print *
- From: Tim Prince
- Re: closing unit=5 and unit=6 and print *
- From: beliavsky
- Re: closing unit=5 and unit=6 and print *
- From: Arjen Markus
- closing unit=5 and unit=6 and print *
- Prev by Date: Re: Allocating arrays inside a subroutine.
- Next by Date: Re: closing unit=5 and unit=6 and print *
- Previous by thread: Re: closing unit=5 and unit=6 and print *
- Next by thread: Re: closing unit=5 and unit=6 and print *
- Index(es):
Relevant Pages
|