empty(3f) - [M_anything] set an allocatable array to zero (LICENSE:MIT)
Synopsis
Description
Examples
Author
License
use M_anything, only : empty, assignment(=)
A convenience routine that sets an array to an empty set.
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)Expected output: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_
> 0 > give them some size ... > 3 > 3 > 4 > back to empty ... > 0 > 0 > 0
John S. Urban
Nemo Release 3.1 | empty (3) | February 23, 2025 |