> call Output_Str( "My name is Reynold" )
> call Output_StrInt( "My age is", 21 )
> call Output_StrReal( "My shoe size is",9.5 )
> They cry out for a common interface such as:
> interface Output
> module procedure Output_Str
> module procedure Output_StrInt
> module procedure Output_StrReal
> end interface
I do similar stuff with
INTERFACE RQ_INPUT
MODULE PROCEDURE RQ_INT, RQ_REAL, RQ_CMPLX, RQ_LOG, RQ_CHAR
END INTERFACE
SUBROUTINE RQ_INT(RQINTTEXT,RQINT)
! gets an integer from standard input
CHARACTER (LEN=*), INTENT(IN) :: RQINTTEXT
INTEGER, INTENT(INOUT) :: RQINT
WRITE (*, '(T2,2A)', ADVANCE='NO', IOSTAT=FILE_RESULT) RQINTTEXT, ' = '
READ (*, *, IOSTAT=FILE_RESULT) RQINT
etc
This is part of my general "file handling" code. I've used it for years
with Compaq/Digital/DEC and XLF. No problems.
(I try not to use any I/O statements or file-handling stuff explicitly,
but call routines which do this, primarily to a) avoid using explicit
file unit numbers anywhere in my code and b) to avoid cluttering the
code with error-checking stuff (the above examples are abridged).
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|