02.07.2013 Views

HP Fortran Programmer's Reference

HP Fortran Programmer's Reference

HP Fortran Programmer's Reference

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

Expressions and assignment<br />

Expressions<br />

94<br />

Size of the array<br />

Shape of the array<br />

<br />

The differences between specification expressions and initialization expressions are<br />

summarized in Table 5-4.<br />

Table 5-4 Initialization and specification expressions<br />

Initialization expression Specification expression<br />

Can be either scalar or array-valued. Must be scalar-valued.<br />

Canbeofanytype. Mustbeoftypeinteger.<br />

Must be a constant expression. Can reference variables by host, argument, or<br />

use storage association; can reference<br />

variables in common.<br />

Except for ALLOCATED, ASSOCIATED, and<br />

PRESENT, can reference inquiry intrinsics<br />

to interrogate a property of an entity,<br />

provided that the property is constant.<br />

The following are examples of specification expressions:<br />

789 ! an integer literal constant<br />

MAX(m+n,0) ! m and n are integer dummy arguments<br />

LEN(c) ! c is a character variable accessible via<br />

! host association<br />

SELECTED_INT_KIND(5) ! reference to a transformational<br />

! intrinsic<br />

UBOUND(arr,DIM=n) ! reference to an array inquiry<br />

! intrinsic in which arr is an array<br />

! accessible via USE and n is a<br />

! variable in common<br />

Can reference inquiry intrinsic functions,<br />

except for ALLOCATED, ASSOCIATED, and<br />

PRESENT. The arguments must be<br />

specification expressions or variables whose<br />

bounds or type parameters inquired about are<br />

not assumed, are not defined by the ALLOCATE<br />

statement, or are not defined by pointer<br />

assignment.<br />

Chapter 5

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

Saved successfully!

Ooh no, something went wrong!