- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
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.
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.
- Balises:
- Intel® Fortran Compiler
Lien copié
1 Répondre
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
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
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
Répondre
Options du sujet
- S'abonner au fil RSS
- Marquer le sujet comme nouveau
- Marquer le sujet comme lu
- Placer ce Sujet en tête de liste pour l'utilisateur actuel
- Marquer
- S'abonner
- Page imprimable