[UP]


Manual Reference Pages  - empty (3)

NAME

empty(3f) - [M_anything] set an allocatable array to zero (LICENSE:PD)

CONTENTS

Synopsis
Description
Example
Author
License

SYNOPSIS

use M_anything, only : empty, assignment(=)

DESCRIPTION

A convenience routine that sets an array to an empty set.

EXAMPLE

Sample program:

   program demo_empty_
   use M_anything, only : empty, assignment(=)
   integer, allocatable      :: ints(:)
   character(:), allocatable :: strs(:)
   real, allocatable      :: reals(:)
      ints=empty
      write(*,*)size(ints)

write(*,*)’give them some size ...’ reals = [1.0,2.0,3.0] ints = [1,2,3] strs = [character(len=10) :: "one","two","three","four"] write(*,*)size(ints) write(*,*)size(reals) write(*,*)size(strs)

ints=empty reals=empty strs=empty write(*,*)’back to empty ...’ write(*,*)size(ints) write(*,*)size(reals) write(*,*)size(strs)

end program demo_empty_

Expected output:

0 give them some size ... 3 3 4 back to empty ... 0 0 0

AUTHOR

John S. Urban

LICENSE

Public Domain


empty (3) March 11, 2021
Generated by manServer 1.08 from 949ebeb0-985d-4c22-adbc-29bae5d5c8e9 using man macros.