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...

Create successful ePaper yourself

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

In the following example, TEST will be .TRUE. if A is greater than B or I is not equal to J+17.TEST = A .GT. B .OR. I .NE. J+171.7.5 Character ExpressionsAn expression of type CHARACTER can consist of one or more printable characters. Its length isthe number of characters in the string. Each character is numbered consecutively from left to rightbeginning with 1. For example:'ab_&''A@HJi2''var[1,12]'1.7.6 Character ConcatenationA character expression can be formed by concatenating two (or more) valid character expressionsusing the concatenation operator //. The following table shows several examples of concatenation.Expression'ABC'//'YZ''JOHN '//'SMITH''J '//'JAMES '//'JOY'Value"ABCYZ""JOHN SMITH""J JAMES JOY"1.8 Symbolic Name ScopeFortran 90/95 and HPF scoping is expanded from the traditional FORTRAN 77 capabilities whichprovide a scoping mechanism using subroutines, main programs, and COMMONs. Fortran 90/95and HPF add the MODULE statement. Modules provide an expanded alternative to the use ofboth COMMONs and INCLUDE statements. Modules allow data and functions to be packagedand defined as a unit, incorporating data hiding and using a scope that is determined with the USEstatement.Names of COMMON blocks, SUBROUTINEs and FUNCTIONs are global to those modules thatreference them. They must refer to unique objects, not only during compilation, but also in the linkstage.The scope of names other than these is local to the module in which they occur, and any referenceto the name in a different module will imply a new local declaration. This includes the arithmeticfunction statement.Language Overview 25

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

Saved successfully!

Ooh no, something went wrong!