[UP]


Manual Reference Pages  - wrt (3)

NAME

wrt(3f) - [M_msg] write multiple scalar values to any number of files (LICENSE:PD)

CONTENTS

Synopsis
Description
Options
Returns
Examples
Author
License

SYNOPSIS

subroutine wrt(luns,generic(s),iostat)

    integer,intent(in)           :: luns(:)
    class(*),intent(in),optional :: generic0,generic1,generic2,generic3,generic4
    class(*),intent(in),optional :: generic5,generic6,generic7,generic8,generic9
    class(*),intent(in),optional :: generica,genericb,genericc,genericd,generice
    class(*),intent(in),optional :: genericf,genericg,generich,generici,genericj
    integer,intent(out),optional :: ios

DESCRIPTION

WRT(3f) writes a list of scalar values
  to the list of unit numbers in LUNS(:).

OPTIONS

LUNS Unit numbers to write to. If of size zero no output is generated
generic[1-20]
  optional value to print the value of after the message. May be of type INTEGER, LOGICAL, REAL, DOUBLEPRECISION, COMPLEX, or CHARACTER.

RETURNS

IOSTAT The value of the last non-zero IOSTAT value. Returns zero if no errors occurred.

EXAMPLES

Sample program:

   program demo_wrt
   use, intrinsic :: iso_fortran_env, only : &
    & stdin=>input_unit, &
    & stdout=>output_unit, &
    & stderr=>error_unit
   use M_msg, only: wrt
   implicit none
   integer,allocatable :: luns(:)
   integer :: iostat=0
   ! a null list allows for turning off verbose or debug mode output
   luns=[integer ::]
   call wrt(luns,’NULL LIST:’,huge(0),’PI=’,asin(1.0d0)*2.0d0,iostat=iostat)
   write(*,*)’IOSTAT=’,iostat
   ! multiple files can be used to create a log file
   luns=[stderr,stdout]
   call wrt(luns,’TWO FILES:’,huge(0),’PI=’,asin(1.0d0)*2.0d0,iostat=iostat)
   write(*,*)’IOSTAT=’,iostat
   ! unlike direct use of WRITE a function can be used that returns
   ! an INTEGER array.
   end program demo_wrt

Results:

    IOSTAT=           0
TWO FILES: 2147483647 PI= 3.141592653589793 TWO FILES: 2147483647 PI= 3.141592653589793
IOSTAT=
 

AUTHOR

John S. Urban

LICENSE

Public Domain


wrt (3) March 11, 2021
Generated by manServer 1.08 from e78cd0da-f363-4df8-ad61-634795422dfd using man macros.