[D] Uma “expressão” Fortran é definida como uma combinação de itens sintáticos, isto é: uma expressão pode consistir de uma única constante, de uma única. Baixe grátis o arquivo Fortran 90 enviado por Wanessa no curso de Engenharia de Produção na UFF. Sobre: Programação de Computadores. Português e em Inglês, para programação em Visual Fortran. Fortran, com o uso do tutorial, são indicadores da relevância do material desenvolvido e.

Author: | Brakazahn Taulmaran |

Country: | Saint Lucia |

Language: | English (Spanish) |

Genre: | Personal Growth |

Published (Last): | 8 August 2009 |

Pages: | 76 |

PDF File Size: | 18.83 Mb |

ePub File Size: | 7.12 Mb |

ISBN: | 367-9-55185-823-3 |

Downloads: | 56580 |

Price: | Free* [*Free Regsitration Required] |

Uploader: | Zulkirn |

Reid, Oxford,the book upon which it has been based. The basic components of the Fortran language are its character set. From these components, we build the tokens that fottran a syntactic meaning to the compiler. There are six classes of token:. Fromthetokens, we can buildstatements. These can be codedusingthenewfree source formwhichdoesnotrequirepositioning in a rigid column structure, as follows:. Note the trailingcomments and the trailingcontinuationmark. There may be 39 continuationlines, and characters per line.

Where a token or character constant is split across two lines:.

The source code of the program can be obtained by anonymous ftp to The directory is and the file name is. Fortran has five intrinsic data types. For each there is a corresponding form of literal constant. For the three numeric intrinsic types they are:.

### Apostila de FORTRAN | Antonio Tavares Bittencourt –

Here, is the kind type parameter; it can also be a default integer literal constant, like but use of an explicit literal constant would aposila non-portable.

The function supplies the value of a kind type parameter:. Also, in statements, binary, octal and hexadecimal constants may be used:. There are at least two real kinds — the default, and one with greater precision this replaces.

We might specify for at least 9 decimal digits of precision and a range of toallowing Also, we have the intrinsic functions that give in turn the kind type value, the actual precision here at least 9and the actual range here at least 9. This data type is built of two integer or real components: The numeric types are based on model fortfan with associated inquiry functions whose values are independent of the values of their arguments.

These functions are important for writing portable numerical software. Number of significant digitsAlmost negligible compared to one real Largest numberMaximum model exponent real Minimum model exponent real Decimal precision real, complex Base fortrna the modelDecimal exponent rangeSmallest postive number real. Aposgila kinds are allowed, especially for support of non-European languages: We can specify scalar variables corresponding to the five intrinsic types:.

The explicitand specifiers are optional and the following works just as well: For derived-data types we must first define the form of the type:. We note that the qualifier was chosen rather than because of ambiguity difficulties. Arrays are considered to be variables in their own right.

Elements are, for example, and apostilw scalars. The subscripts may be any scalar integer expression. Whole arrays and array sections are array-valued objects.

Array-valued constants constructors are available:. A derived data type may, of course, contain array components:. Fortran 90 Tutorial 5 There are some other interesting character extensions. Just as a substring as in was already possible, so now are the substrings. Also, zero-length strings are allowed: Finally, there are some new intrinsic character functions:.

## apostila FORTRAN90

The rules for scalar numeric expresions and assignments, apostilaa known from FORTRAN 7, are extended to accommodate the non-default kinds apostilaa encountered in chapter 1. Thus, the mixed-mode numeric expression and assignment rules incorporate different kind type parameters in an expected way:. In the case of scalar characters, two old restrictions are lifted.

Given it is now legal to write. For an operation between derived-data types, or between a derived type and an intrinsic type, we must define the meaning of the operator.

Between intrinsic types, there are intrinsic operations only. Given we can write.

We see here the use bothof an intrinsicsymbol and of a named operator. A difference is that, for an intrinsicoperator token, the usual precedence rules apply, whereas for named operators their precedence is the highest as a unary operator or the lowest as a binary one.

In the two expresions are equivalent only if appropriate parentheses are added as shown. In each case, we have to provide, in a module, apostiila defining the operator and assignment, and make the association by an interface block, also in the module we shall return to this later.

Fortran 90 Tutorial 7 For the moment, here is an example of an interface for string concatenation and an example of part of a module containing the definitions of character-to-string and string to character assignment. The string concatenation function was shown already in part 1.

### Fortran 90 – Tutorial – Programação de Computadores

Defined operators such as these are required for the expressions that are allowed too in structure constructors see chapter Fortran 90 – Tutorial Wanessa row Enviado por: The tutorial is also available on W using the URL. Version of October Fortran 90 Tutorial 1 1. Language Elements The basic components of the Fortran language are its character set.

There are six classes of token: These can be codedusingthenewfree source formwhichdoesnotrequirepositioning in a rigid column structure, as follows: Where a token or character constant is split across two lines: For the three numeric intrinsic types they are: The function supplies the value of a kind type parameter: Also, in statements, binary, octal and hexadecimal constants may be used: Number of significant digitsAlmost negligible compared to one real Largest numberMaximum model exponent real Minimum model exponent real Decimal precision real, complex Base of the modelDecimal exponent rangeSmallest postive number real Fortran 90 Tutorial 3 The forms of literal constants for the two non-numeric data types are: Here, there may also be different kinds to allow for packing into bits: We can specify scalar variables corresponding to the five intrinsic types: For derived-data types we must first define the form of the type: To select components of a derived type, we use the qualifier: Fortran 90 Tutorial 4 Definitions may refer to a previously defined type: Given the latter an example of the syntax that allows grouping of attributes to the left of and of variables sharing those attributes to the rightwe have two arrays whose elements are in array element order column majorbut not necessarily in contiguous storage.

Sections are Whole arrays and array sections are array-valued objects. Array-valued constants constructors are available: A derived data type may, of course, contain array components: Just as a substring as in was already possible, so now are the substrings Also, zero-length strings are allowed: Finally, there are some new intrinsic character functions: Expressions and Assignments The rules for scalar numeric expresions and assignments, as known from FORTRAN 7, are extended to accommodate the non-default kinds we encountered in chapter 1.

Thus, the mixed-mode numeric expression and assignment rules incorporate different kind type parameters in an expected way: For scalar relational operations, there is a set of new, alternative operators: Given it is now legal to write For an operation between derived-data types, or between a derived type and an intrinsic type, we must define the meaning of the operator.

Defined operators such as these are required for the expressions that are allowed too in structure constructors see chapter 1: Arquivos Semelhantes Fortran 90 Tutorial Tutorial simples em fortran.