I am curious about the sizeof Fortran derived type.
type structInt
integer :: n
double precision :: f
end type structInt
type(structInt) :: a
A sizeof( a ) gives (on my system) a result of 16 bytes, which is fine considering padding is added.
But if there is an allocatable array inside the derived type, then it jumps to 64 bytes.
type structArray
integer, dimension(:), allocatable :: arr
end type structArray
type(structArray) :: b
I couldn't find in the Fortran standard why this behavior.. I expected that the size would be the size of the derived type to be the same size of the arr argument alone.