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.

STRUCTURE § 77The STRUCTURE statement, a DEC extension to FORTRAN 77, defines an aggregate data type.SyntaxSTRUCTURE [/structure_name/][field_namelist]field_declaration[field_declaration]...[field_declaration]END STRUCTUREstructure_name is unique and is used both to identify the structure and to allow its usein subsequent RECORD statements.field_namelistis a list of fields having the structure of the associated structuredeclaration. A field_namelist is allowed only in nested structuredeclarations.field_declaration can consist of any combination of substructure declarations, typed datadeclarations, union declarations or unnamed field declarations.DescriptionFields within structures conform to machine-dependent alignment requirements. Alignment offields also provides a C-like "struct" building capability and allows convenient inter-languagecommunications. Note that aligning of structure fields is not supported by VAX/VMS Fortran.Field names within the same declaration nesting level must be unique, but an inner structuredeclaration can include field names used in an outer structure declaration without conflict. Also,because records use periods to separate fields, it is not legal to use relational operators (forexample, .EQ., .XOR.), logical constants (.TRUE. or .FALSE.), or logical expressions (.AND.,.NOT., .OR.) as field names in structure declarations.Fields in a structure are aligned as required by hardware and a structure's storage requirements aretherefore machine-dependent. Note that VAX/VMS Fortran does no padding. Because explicitpadding of records is not necessary, the compiler recognizes the %FILL intrinsic, but performs noaction in response to it.Data initialization can occur for the individual fields.The UNION and MAP statements are supported.The following is an example of record and structure usage.134 Chapter 3

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

Saved successfully!

Ooh no, something went wrong!