wrt(3f) - [M_msg] write multiple scalar values to any number of files (LICENSE:PD)
Synopsis
Description
Options
Returns
Examples
Author
License
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
WRT(3f) writes a list of scalar values to the list of unit numbers in LUNS(:).
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.
IOSTAT The value of the last non-zero IOSTAT value. Returns zero if no errors occurred.
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]TWO FILES: 2147483647 PI= 3.1415926535897931 TWO FILES: 2147483647 PI= 3.1415926535897931! 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
IOSTAT= | |||||
USING FMT : 2147483647 PI= 3.1415926535897931 0002
USING FMT : 2147483647 PI= 3.1415926535897931 0002
USING FMT : 2147483647 PI= 3.1415926535897931 0002
| |||||
John S. Urban
Public Domain
Nemo Release 3.1 | wrt (3) | February 23, 2025 |