Clicky

Fortran Wiki
shape (Rev #2, changes)

Skip the Navigation Links | Home Page | All Pages | Recently Revised | Authors | Feeds | Export |

Showing changes from revision #1 to #2: (追記) Added (追記ここまで) | (削除) Removed (削除ここまで) | (削除) Chan (削除ここまで)(追記) ged (追記ここまで)

Description

Determines the shape of an array.

Standard

(削除) Fortran 95 and later (削除ここまで)(追記) Fortran 95 (追記ここまで)(追記) and later (追記ここまで)

Class

Inquiry function

Syntax

result = shape(source)

Arguments

  • source - Shall be an array or scalar of any type. If source is a pointer it must be associated and allocatable arrays must be allocated.

Return value

An integer array of rank one with as many elements as source has dimensions. The elements of the resulting array correspond to the extend of source along the respective dimensions. If source is a scalar, the result is the rank one array of size zero.

Example

program test_shape
 integer, dimension(-1:1, -1:2) :: a
 write(*,*) shape(a) ! (/ 3, 4 /)
 write(*,*) size(shape(42)) ! (/ /)
end program

See also

reshape, size

category: (削除) Intrinsics (削除ここまで)(追記) intrinsics (追記ここまで)

Revision from April 30, 2009 19:25:51 by Jason Blevins
Forward in time (2 more) | Back in time (1 more) | See current | Hide changes | History | Rollback | View: Source | Linked from: Intrinsic procedures, reshape, size, Fortran 2003 status

AltStyle によって変換されたページ (->オリジナル) /