Manual Reference Pages  - print (7fortran)

NAME

print(7f) - [IO] write formatted sequential I/O to stdout

SYNOPSIS

PRINT format [ , output-item-list ]

DESCRIPTION

print(7f) is equivalent to

            write(*,fmt=FORMAT_SPECIFIER) LIST

That is, it always writes formatted sequential I/O to stdout. It may use list-directed I/O or a FORMAT specifier.

print(7f) allows for no other options and therefore cannot be used for binary or non-advancing or stream or asynchronous I/O or any of the other options provided by the more general but also more complicated write(7f) statement.

Note that pure subprograms cannot contain I/O statements such as print(7f).

OPTIONS

format a format may be used to specify how output items are displayed using the many Fortran format descriptors, or an asterisk (*) may be used to indicate to use list-directed default formatting.
output-item-list
  the variables whose values are to be displayed

EXAMPLE

A simple example program:

    program demo_print
    implicit none
    real :: a=11.11, s=sqrt(12.0)
    integer :: j=753210
    character(len=*),parameter :: commas=’(*(g0:,","))’

! List-directed output is frequently specified PRINT *, A, S

! a format may be placed on the print(7f) statement PRINT ’(*(g0,1x))’, A, S, J

! the format may be in a character variable print commas, a, s, j

! or may be in a labeled format statement PRINT 10, A, S, J 10 FORMAT (2E16.3,1x,I0)

end program demo_print

Results:

     >    11.1099997       3.46410155
     > 11.1099997 3.46410155 753210
     > 11.1099997,3.46410155,753210
     >        0.111E+02       0.346E+01 753210

SEE ALSO

o BACKSPACE(7)
o CLOSE(7)
o ENDFILE(7)
o FLUSH(7)
o INQUIRE(7)
o OPEN(7)
o PRINT(7)
o READ(7)
o REWIND(7)
o WAIT(7)
o WRITE(7)
Fortran intrinsic descriptions (license: MIT) @urbanjost


Nemo Release 3.1 print (7fortran) August 19, 2024
Generated by manServer 1.08 from 6b4796af-6463-41c3-9fd2-b029189df5da using man macros.