Allocatable arrays in derived types



Consider a derived type used thus:

type mytype
integer :: a,b,c
real :: x,y,z
real, allocatable :: mydata(:)
end type

type(mytype), allocatable :: cell(:)
type(mytype) :: acell

allocate(cell(1000))
do i = 1,1000
if (i <= 500) then
allocate(cell(i)%mydata(10))
else
allocate(cell(i)%mydata(100))
endif
enddo

acell = cell(100)
....
acell = cell(600)

Something like this seems to work fine, so I guess it's OK. I'm uncertain about how/where mydata is stored. Perhaps I shouldn't even be thinking about this, but old habits die hard. When cell is allocated how much space is reserved for mydata? I suppose this is compiler-dependent, but what would be a typical number? When mydata is allocated, where is it stored? Finally, when acell is equated to an element of the cell array, where is its mydata?

Thanks in advance for a free Fortran lesson :-)
.