12.07.2015 Views

PGI Fortran - Servidor WWW del Cluster Ladon-Hidra

PGI Fortran - Servidor WWW del Cluster Ladon-Hidra

PGI Fortran - Servidor WWW del Cluster Ladon-Hidra

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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

MAPfield_declaration[field_declaration]...[field_declaration]END MAPDescriptionfield_declarationwhere field declaration is a structure declaration or RECORDstatement contained within a union declaration, a union declarationcontained within a union declaration, or the declaration of a typeddata field within a union.Data can be initialized in field declaration statements in union declarations. Note, however, it isillegal to initialize multiple map declarations in a single union.The size of the shared area for a union declaration is the size of the largest map defined for thatunion. The 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 language C.The main difference is that the language C requires one to associate a name with each map(union). Fortran field names must be unique within the same declaration nesting level of maps.The following is an example of RECORD, STRUCTURE and UNION usage. The size of eachelement of the recarr array would be the size of typetag (4 bytes) plus the size of the largest MAP(the employee map at 24 bytes).STRUCTURE /account/INTEGER typetag ! Tag to determine defined map.UNIONMAP! Structure for an employeeCHARACTER*12 ssn ! Social Security NumberREAL*4 salaryCHARACTER*8 empdate ! Employment dateEND MAPMAP! Structure for a customerINTEGER*4 acct_custREAL*4 credit_amtCHARACTER*8 due_dateEND MAPMAP! Structure for a supplierINTEGER*4 acct_suppREAL*4 debit_amtFortran Statements 139

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

Saved successfully!

Ooh no, something went wrong!