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

is sizeof standard fortran?

Alexis_R_
New Contributor I
1,427 Views

Hi there,

Is the sizeof inquiry instrinsic function standard fortran? (I can't find it my trusty Metcalf/Reid/Cohen)

0 Kudos
1 Solution
Steven_L_Intel1
Employee
1,427 Views
No, it is not. F2008 defines STORAGE_SIZE which is similar (except that the unit is "bits")

View solution in original post

0 Kudos
3 Replies
Steven_L_Intel1
Employee
1,428 Views
No, it is not. F2008 defines STORAGE_SIZE which is similar (except that the unit is "bits")
0 Kudos
Alexis_R_
New Contributor I
1,427 Views

I see that gfortran has sizeof too, with the following documentation, and I'm wondering whether this also describes the behaviour of sizeof as implemented by ifort, specifically with regards to arguments which are derived types with pointer components.

The return value is of type integer and of the system-dependent kind C_SIZE_T (from the ISO_C_BINDING module). Its value is the number of bytes occupied by the argument. If the argument has the POINTER attribute, the number of bytes of the storage area pointed to is returned. If the argument is of a derived type with POINTER or ALLOCATABLE components, the return value doesn't account for the sizes of the data pointed to by these components.

PS. I'm sorry if this seems a lazy question, but I thought it'd take less time for one of you experienced users to recall this information than it would me to test it myself

0 Kudos
Steven_L_Intel1
Employee
1,427 Views
Yes, that is our implementation as well.
0 Kudos
Reply