A nice fortran tutorial

zhaozj2021-02-16  57

Sender: Radiboga (Junior Year), the letter area: programming Title: a nice Fortran Tutorial Send Station: A mess BBS (THU AUG 28 17:30:04 2003), this site (Ytht.Net)

Http://krsna.lamost.org/popular/fortran/fortran.htm In addition, there is also a book called << Fortran 95 programming >> (Peng Guolun, China Power Press 2002) is also very good.

Fortran is very nature, simple, for those who learn mathematics, anyway, I have seen two days later, I found that I used Fortran more familiar with C. C I used two academies .. .

Pick a section inside the first tutorial for reference.

__________________________________

1.3 Why choose Fortran to choose what kind of language, it is a very controversial issue. In the field of scientific calculations, it is the best to use what kind of language in the field of scientific calculations. Maybe we can say that this is a problem that is benevolent, because we use the language of the language, always picking a language that is already familiar with, and is of course the language that you can do very well. However, it is specifically for scientific calculations, due to its own unique value standards due to scientific calculations, under this value standard, a variety of languages ​​can be objectively compared.

First we have to define the tasks of yourself, what is the scientific calculation problem?

The so-called scientific calculation problem is generally included in the following three meanings:

● The problem itself and the problematic answer can be accurately described using mathematical language;

● If you want to use the usual mathematical methods to give the value answers we need, it will be very troublesome or not given;

● The problem is used as a background with certain science and technology.

We will see this connotation that is scientific calculation problem determines that it has the value criteria when selecting the calculation language.

First, a scientific calculation problem always appears in the form of a mathematical calculation problem, so the language describing the scientific calculation problem should naturally describe mathematical problems, that is, the programming language and mathematical language have comparative direct natural correspondence in expression. relationship.

The reason why a scientific calculation problem needs to be used, it is definitely because this problem has a certain amount of calculation, then the operational efficiency of the program is often the most important consideration factor when choosing a language.

It is in these two points, Fortran is a absolute winner in many languages.

In describing the natural aspects of mathematical language, Fortran can be said to be strong than any language that is still "live". Of course, in history, a fairly mathematic language like Algol, but unfortunately it lacks market survival capacity, so there is only Fortran alone. Fortran is good at describing mathematics calculations, this should be almost no dispute. It is also because of this reason, Fortran's easy learning is recognized. Any scientific and technological professionals, as long as there is a clear concept of a mathematical solution process of a specific problem, it is very easy to translate this solution process into the Fortran language.

As regards the speed of execution, some are often misleading beginners. The most typical error concept is "the fastest execution of C code". This statement comes from the specialty of the C language, because the C language is more system programming language, which is very controlled for hardware, and there is no right in the advanced language, so it is necessary to give people a C program. The fastest impression. But I forgot this speed of the system programming characteristics from the C language, and when doing scientific calculations, it does not need too much to talk to the system kernel. Therefore, the length of the C language can be said to be properly played. On the contrary, in terms of numerical calculation, C is definitely not a Fortran's opponent, because Fortran is based on scientific calculations, and the language itself is optimized for scientific calculations, and the language itself is optimized. Therefore, the operational code generated by Fortran is highly optimized. The actual operational efficiency has also shown the superiority of Fortran in scientific calculations. Whether domestic or abroad, whether it is a classic serial machine or a parallel vector, a large number of experience shows that the efficiency of C or C code is lower than the Fortran code when performing the same scientific computing task.

In addition to commonly superstitions with Efficient superstitions for C, how to face behind for Fortran. Of course, this prejudice is a source, that is, the Fortran 77 that has worked hard is a long period of time, which has lacks into the heart, so that many people have filed Fortran so far, it is what is already very backward in the Today's era.. In essence, the Fortran standard after entering the Fortran 90 era, especially the current Fortran 95 version, can say that as long as it is useful for scientific computing, C and C , now Fortran 95 is absolutely not lacking, and Fortran 95 Many of the characteristics of scientific calculations are not C and C . Even if C is most proud of object-oriented nature, Fortran 2000 will also be fully introduced. Therefore, Fortran has completely caught the trend of the programming language.

Another important aspect related to the performance of the program, is whether the program language can support the program's parallel operation. At this point, it can be said that Fortran has expressed its biggest advantage, because Fortran 95 is working to obtain parallel computing capabilities One version.

Since the size of modern scientific calculations is getting bigger, calculating parallelism is a route that has had to go, the development of modern computer hardware, which also makes parallelization actual popularization, because not only special large-scale computers are parallel, now General PCs can have multiple processors, so modern, scientific calculations have to master the programming capabilities of parallelization.

However, one of the main problems encountered in parallelization is that any process programming language is inherently using linear storage mode, that is, an array element is always stored in memory units in the memory unit in accordance with the order of array elements. Such a model determines that such a process programming language cannot really implement a description of parallel calculations. The Fortran 95 has completely changed this constraint, because in Fortran 95, the Fortran 95 establishes a new conceptual concept, such as the concept of pure process, concept, FORALL structure, etc. Effectively get rid of the constraints of linear storage modes, making the Fortran 95 a standard language describing parallel computing, especially those dedicated data parallelism languages ​​have used Fortran as basic languages, such as high performance Fortran (High Performance Fortran, Fortran D) , Vienna Fortran, and Craft, etc. This makes the program written in the Fortran 95 can be run directly on these data parallellations, and the program written in these dedicated languages ​​can also be transferred to the Fortran 95 platform without difficulty. Such a situation Make Fortran uncommon in the field of parallel computing. In summary, we can fully say that Fortran 95 is the best language for scientific computing. As a staff member in the field of scientific and technical science and technology, it is important to master the Fortran 95 far more important than mastery of C, C and other languages. As for those computer symbol algebrans and numerical computing software, such as Mathematica, MAPLE, MATLAB, MACSYMA, MATHCAD, and more can only be said to be scientific and calculated teaching model and auxiliary tools, because they all provide ready-made algorithms, so it can make the initial Scholars can be applied to some simple occasions, truly use them to deal with a little bigger problem, experienced users know that it is a very painful stronger. Therefore, it is ultimately free to scientifically calculate, then it is not a Fortran.

转载请注明原文地址:https://www.9cbs.com/read-19467.html

New Post(0)