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.

! a named integer constant<br />

coord(0.0,infinity) ! a structure constructor in which<br />

! "infinity" is a named constant<br />

(/ SQRT(x), x, x*x /) ! an array constructor in which x is a<br />

! named real constant<br />

x*x + 2*x*y + y*y ! a constant numeric expression where x<br />

! and y are named constants<br />

SUM(iterations,DIM=1) ! reference to a transformational<br />

! intrinsic where iterations is an<br />

! array-valued named constant<br />

SHAPE(matrix) ! a reference to an inquiry intrinsic in<br />

! which "matrix" is an array with<br />

! constant bounds<br />

Initialization expressions<br />

Expressions and assignment<br />

Expressions<br />

An initialization expression is a more specialized form of constant expression that can<br />

appear as the initial value in a declaration statement. Initialization expressions have these<br />

additional restrictions:<br />

Exponentiation is only allowed if the second operand is an integer.<br />

Any subexpression within the expression must itself be an initialization expression.<br />

All arguments to intrinsic function references must be initialization expressions.<br />

Only the following transformational intrinsic functions may be referenced:<br />

REPEAT<br />

RESHAPE<br />

SELECTED_INT_KIND<br />

SELECTED_REAL_KIND<br />

TRANSFER<br />

TRIM<br />

Any inquiry intrinsic that is referenced may interrogate a property of an entity (such as<br />

bounds or kind type parameter) only if the property is a constant.<br />

Any elemental intrinsic functions must have integer or character arguments and an<br />

integerorcharacterresult.<br />

Initialization expressions are required for the following:<br />

Chapter 5 91

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

Saved successfully!

Ooh no, something went wrong!