]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/fortran/doc/gfortran/intrinsic-procedures/merge.rst
sphinx: add missing trailing newline
[thirdparty/gcc.git] / gcc / fortran / doc / gfortran / intrinsic-procedures / merge.rst
CommitLineData
c63539ff
ML
1..
2 Copyright 1988-2022 Free Software Foundation, Inc.
3 This is part of the GCC manual.
4 For copying conditions, see the copyright.rst file.
5
6.. index:: MERGE, array, merge arrays, array, combine arrays
7
8.. _merge:
9
10MERGE --- Merge variables
11*************************
12
13.. function:: MERGE(TSOURCE, FSOURCE, MASK)
14
15 Select values from two arrays according to a logical mask. The result
16 is equal to :samp:`{TSOURCE}` if :samp:`{MASK}` is ``.TRUE.``, or equal to
17 :samp:`{FSOURCE}` if it is ``.FALSE.``.
18
19 :param TSOURCE:
20 May be of any type.
21
22 :param FSOURCE:
23 Shall be of the same type and type parameters
24 as :samp:`{TSOURCE}`.
25
26 :param MASK:
27 Shall be of type ``LOGICAL``.
28
29 :return:
30 The result is of the same type and type parameters as :samp:`{TSOURCE}`.
31
32 Standard:
33 Fortran 90 and later
34
35 Class:
36 Elemental function
37
38 Syntax:
39 .. code-block:: fortran
40
3ed1b4ce 41 RESULT = MERGE(TSOURCE, FSOURCE, MASK)