merge(3f) - [M_overload:INTRINSIC] allow MERGE(3f) intrinsic to take strings of different length (LICENSE:PD)
Synopsis
Description
Examples
Author
License
result = merge(tsource, fsource, mask)
A convenience for allowing strings of different length in the MERGE(3f) intrinsic.
All other behavior should be the same as the MERGE(3f) intrinsic.
Sample usage:
program demo_merge ! allow strings of different length on merge use M_overload, only : merge implicit none character(len=*), parameter :: gen=(*("[",g0,"]":,","))Results:write(*,gen)merge(a,bbbbb,1.eq.1) write(*,gen)merge(a,bbbbb,1.eq.2) write(*,gen)merge([a,b],[bbbbb,ccccc],1.eq.2)
end program demo_merge
> [a ] > [bbbbb] > [bbbbb],[ccccc]
John S. Urban
Public Domain
Nemo Release 3.1 | merge (3) | February 23, 2025 |