Printing from a Fortran Routine

DESCRIPTION:

Prints numbers and character strings from a Fortran routine to S-PLUS.

USAGE:

SUBROUTINE DBLEPR(LABEL,NCHAR,DATA,NDATA) 
SUBROUTINE  INTPR(LABEL,NCHAR,DATA,NDATA) 
SUBROUTINE REALPR(LABEL,NCHAR,DATA,NDATA) 

REQUIRED ARGUMENTS:

LABEL
quoted string label for the printout.
NCHAR
number of characters in the label. This can be passed as -1 if you have a well-behaved Fortran compiler that inserts null bytes at the end of strings. To eliminate the label, pass 0 for NCHAR.
DATA
the vector of data values (respectively double precision, integer, or real for the three subroutines).
NDATA
the number of data values to be printed.

SIDE EFFECTS:

The specified data will be printed, using the same formatting procedures followed for automatic printing in S-PLUS.

DETAILS:

These are mainly useful for debugging purposes. It is possible to print logicals with INTPR.

SEE ALSO:

.Fortran .

EXAMPLES:

        subroutine testpr(x) 
        double precision x 
        dimension vec(3) 
        n=4 
        vec(1)=1.0 
        vec(2)=2.57 
        vec(3)=-4.6 
        call dblepr('here is x',-1,x,1) 
        call intpr('an integer',-1,n,1) 
        call realpr('three reals',-1,vec,3) 
        call dblepr('just a message',-1,x,0) 
        return 
        end