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> StatementsExampleSUBROUTINE FIX (A,B,*,*,C)40 IF (T) 50, 60, 7050 RETURN60 RETURN 170 RETURN 2ENDPROGRAM FIXITCALL FIX(X, Y, *100, *200, S)WRITE(*,5) X, S ! Arrive here if (T) < 0STOP100 WRITE(*, 10) X, Y ! Arrive here if (T) = 0STOP200 WRITE(*,20) Y, S ! Arrive here if (T) > 03.20. STRUCTURE<strong>The</strong> STRUCTURE statement, a VAX extension to FORTRAN 77, defines an aggregate data type.F77 VAX extensionSyntaxSTRUCTURE [/structure_name/][field_namelist]field_declaration[field_declaration]...[field_declaration]END STRUCTUREstructure_nameis unique and is used both to identify the structure and to allow its use in subsequent RECORDstatements.field_namelistis a list of fields having the structure of the associated structure declaration. A field_namelistis allowed only in nested structure declarations.field_declarationcan consist of any combination of substructure declarations, typed data declarations, uniondeclarations 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 <strong>Fortran</strong>.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<strong>PGI</strong> <strong>Fortran</strong> <strong>Reference</strong> Guide 58

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

Saved successfully!

Ooh no, something went wrong!