10.07.2015 Views

PGI Fortran Reference manual - The Portland Group

PGI Fortran Reference manual - The Portland Group

PGI Fortran Reference manual - The Portland Group

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Fortran</strong> Statementsterminated by MAP and END MAP statements, respectively. Each unique field or group of fieldsis defined by a separate map declaration. <strong>The</strong> format of a UNION statement is as follows:F77 extensionSyntaxUNIONmap_declaration[map_declaration]...[map_declaration]END UNION<strong>The</strong> format of the map_declaration is as follows:MAPfield_declaration[field_declaration]...[field_declaration]END MAPfield_declarationwhere field declaration is a structure declaration or RECORD statement contained within aunion declaration, a union declaration contained within a union declaration, or the declarationof a typed data field within a union.DescriptionData can be initialized in field declaration statements in union declarations. Note, however, it isillegal to initialize multiple map declarations in a single union.<strong>The</strong> size of the shared area for a union declaration is the size of the largest map defined for thatunion. <strong>The</strong> size of a map is the sum of the sizes of the field(s) declared within it plus the spacereserved for alignment purposes.Manipulating data using union declarations is similar to using EQUIVALENCE statements.However, union declarations are probably more similar to union declarations for the languageC. <strong>The</strong> main difference is that the language C requires one to associate a name with each map(union). <strong>Fortran</strong> field names must be unique within the same declaration nesting level of maps.<strong>PGI</strong> <strong>Fortran</strong> <strong>Reference</strong> Guide 60

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!