Fortran Wiki
merge

Description

Select values from two arrays according to a logical mask. The result is equal to tsource if mask is .true., or equal to fsource if it is .false..

Standard

Fortran 95 and later

Class

Elemental function

Syntax

result = merge(tsource, fsource, mask)

Arguments

  • tsource - May be of any type.
  • fsource - Shall be of the same type and type parameters as tsource.
  • mask - Shall be of type logical.

Return value

The result is of the same type and type parameters as tsource.

category: intrinsics