Skip to main content

Append

Append is a generic subroutine to append entries to vector of real or integer.

note

While calling Append the initial vector can be unallocated in the begining.

Calling examples:

CALL Append(A, entry)
CALL Append(C, A, B)
CALL Append(A, entry, mask)
CALL Append(C, A, B, mask)

Interface 1

CALL Append(A, entry)

Here,

  • A can be an allocatable vector of real or integer.
  • entry can be a scalar of real or integer.
  • entry can be a vector of real or integer.

We can:

  • Append a scalar-integer to an integer-vector
  • Append an integer-vector and scalar to an integer-vector
  • Append a scalar-real to a real-vector
  • Append a real-vector to a real-vector
note

We can also use this method as:

A = A .append. entry

Interface 2

CALL Append(C, A, B)

where,

  • Append A and B, then assign it to C
  • C can be an allocatable vector of real or integer
  • A can be a vector of real or integer
  • B can be a scalar of real or integer
  • B can be a vector of real or integer
note

Currently, A cannot be scalar in the above interface.

We can:

  • Append a scalar and a vector of int to another vector of int
  • Append two vectors of int to another vector of int
  • Append a scalar and a vector of real to another vector of real
  • Append two vectors of real to another vector of real

Interface 3

  CALL Append(A, entry, mask)

here,

  • A is an allocatable vector of real or integer.
  • entry can be a scalar of real or integer. In this case mask is a scalar of logical type
  • entry can be a vector of real or integer. In this case, mask will be a vector of logical types.
note

The size of mask should be same as the size of entry.

We can:

  • Masked append a scalar integer to a vector of int
  • Masked append a scalar real to a vector of reals
  • Masked append a vector of integer to a vector of integer
  • Masked append a vector of real to a vector of real

Interface 4

  CALL Append(C, A, B, mask)

where,

  • C is an allocatable vector of real or integer
  • A is a vector of real or integer
  • B is a vector of real or integer
note

Currently, we do not allow A to be a scalar in the above call.

We can:

  • Masked append a scalar and vector of int to another vector of int
  • Masked append a scalar and vector real to another vector of real
  • Masked append two vectors of integer to another vector of integer
  • Masked append two vectors of real to another vector of real