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

Aligned data in Common blocks

WSinc
New Contributor I
524 Views
I wish to keep this data in the same order, since I read the entire structure in in one READ statement. As far as I can tell, this should be naturally aligned, but I get a warning message every time I compile it:

type piece
sequence
character*84 descr
integer(1) nrot
logical flip
integer(1) xlim
integer(1) ylim
integer(1) rot(4)
integer(1) x(5)
integer(1) y(5)
end type piece
type(piece)pieces(12)
common/piece01/pieces

Since all of the above are of length 1 byte, I don't understand why there should be any unaligned items. But in case there are, how can I insert dummy items in the above sequence without disrupting the order of the READ statement? I had to put the SEQUENCE statement in there, otherwise it won't compile at all.
0 Kudos
1 Reply
Steven_L_Intel1
Employee
524 Views
Component flip is four bytes. You probably want logical(1) there.

You can ask the compiler to insert alignment padding in sequenced structures through the /align:sequence option, but I think fixing the declaration of flip is really the solution you want.

Steve
0 Kudos
Reply