Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Equivalent of "sizeof"

john_lord
Novice
542 Views
Is there an intrinsic FORTRAN 90/95 routine to calculate the byte size of a type? I want to estimate the memory requirement of my program, but have parameterized the declarations of the arrays using KIND.
0 Kudos
1 Reply
Steven_L_Intel1
Employee
542 Views
There is no standard intrinsic for this, but CVF supports SIZEOF for this purpose. The argument is an object of the type you want the size (in bytes) of.

The standard way to do this is an INQUIRE by IOLENGTH, but this is rather clumsy.

Steve
0 Kudos
Reply