Aligned data in Common blocks

Aligned data in Common blocks

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.

2 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

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

Steve - Intel Developer Support

Leave a Comment

Please sign in to add a comment. Not a member? Join today