C Library Functions  - 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, fmt
   implicit none
   integer,allocatable :: luns(:)
   integer :: iostat=0
   integer,parameter :: ints(3)=[1,2,3]

! 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, for example luns=[stderr,stdout] call wrt(luns,’TWO FILES:’,huge(0),’PI=’,asin(1.0d0)*2.0d0,iostat=iostat) write(*,*)’IOSTAT=’,iostat

! using fmt call wrt([stdout,stdout,stdout],’USING FMT :’, & & huge(0),’PI=’,asin(1.0d0)*2.0d0,fmt(ints(2),’i0.4’),iostat=iostat)

end program demo_wrt

TWO FILES: 2147483647 PI= 3.1415926535897931 TWO FILES: 2147483647 PI= 3.1415926535897931
IOSTAT=
  USING FMT : 2147483647 PI= 3.1415926535897931 0002 USING FMT : 2147483647 PI= 3.1415926535897931 0002 USING FMT : 2147483647 PI= 3.1415926535897931 0002
IOSTAT=
 

AUTHOR

John S. Urban

LICENSE

Public Domain


Nemo Release 3.1 wrt (3) July 22, 2023
Generated by manServer 1.08 from e2abde56-55f4-4abd-a937-d78fa622f7d6 using man macros.