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.

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.ExampleThe 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 mapUNIONMAP! 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_amtBYTE num_itemsBYTE items(12) ! Items suppliedEND MAPEND UNIONEND STRUCTURERECORD /account/ recarr(1000)MODULE 90(PGF95 and PGHPF only) The MODULE statement specifies the entry point for a Fortran 90/95module program unit. A module defines a host environment of scope of the module, and maycontain subprograms that are in the same scoping unit.110 Chapter 3

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

Saved successfully!

Ooh no, something went wrong!