06.03.2014 Views

Intel Fortran Language Reference - NCI National Facility

Intel Fortran Language Reference - NCI National Facility

Intel Fortran Language Reference - NCI National Facility

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Intrinsic Procedures 9<br />

RESHAPE<br />

Description:<br />

Syntax:<br />

Class:<br />

Arguments:<br />

source<br />

shape<br />

pad (opt)<br />

order (opt)<br />

Results:<br />

Constructs an array with a different shape from the argument array.<br />

result = RESHAPE (source, shape [, pad] [, order])<br />

Transformational function; Generic<br />

Must be an array (of any data type). It supplies the elements for the result array.<br />

Its size must be greater than or equal to PRODUCT(shape) if pad is omitted or<br />

has size zero.<br />

Must be an integer array of up to 7 elements, with rank one and constant size. It<br />

defines the shape of the result array. Its size must be positive; its elements must<br />

not have negative values.<br />

Must be an array with the same type and kind parameters as source. It is used to<br />

fill in extra values if the result array is larger than source.<br />

Must be an integer array with the same shape as shape. Its elements must be a<br />

permutation of (1,2,...,n), where n is the size of shape. If order is omitted, it is<br />

assumed to be (1,2,...,n).<br />

The result is an array of shape shape with the same type and kind parameters as<br />

source. The size of the result is the product of the values of the elements of<br />

shape.<br />

In the result array, the array elements of source are placed in the order of<br />

dimensions specified by order. If order is omitted, the array elements are<br />

placed in normal array element order.<br />

The array elements of source are followed (if necessary) by the array elements<br />

of pad in array element order. If necessary, additional copies of pad follow until<br />

all the elements of the result array have values.<br />

Examples<br />

RESHAPE ((/3, 4, 5, 6, 7, 8/), (/2, 3/)) has the value<br />

357<br />

468<br />

.<br />

RESHAPE ((/3, 4, 5, 6, 7, 8/), (/2, 4/), (/1, 1/), (/2, 1/)) has the value<br />

3456<br />

7811<br />

.<br />

9-133

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!