By Drew Mccormack

Fortran is the oldest high-level programming language nonetheless in use this day. it truly is ordinary in medical and technical fields, and has advanced through the years right into a robust numerical programming language, with very good help for high-performance computing and information processing._x000D__x000D__x000D__x000D_This textual content presents an creation to the main commonly-used sleek version of the language, Fortran 90/95. not like so much texts on Fortran, there's a powerful emphasis on layout and software program engineering. The reader isn't just brought to the language syntax, but in addition to how language constructs are most sensible mixed to construct strong software program.

Show description

Read Online or Download Scientific Software Development in Fortran PDF

Similar languages & tools books

SOA for the Business Developer: Concepts, BPEL, and SCA

Service-Oriented structure (SOA) is a fashion of organizing software program. in the event that your company's improvement tasks adhere to the foundations of SOA, the result should be a listing of modular devices known as "services," which permit for a fast reaction to alter. This e-book tells the SOA tale in an easy, ordinary demeanour that can assist you comprehend not just the buzzwords and merits, but in addition the applied sciences that underlie SOA: XML, WSDL, cleaning soap, XPath, BPEL, SCA, and SDO.

Additional resources for Scientific Software Development in Fortran

Example text

Add a print statement that prints out the whole array at the end, like this print *, a Compile and run. What does the output of the program tell you about the order of elements in the computer's memory? Exercise: Nested Loops You have been given the following piece of source code. integer i,j real a(1000,1000) ... do i = 2,1000 do j = 2,1000 a(i,j) = a(i-1,j-1) * a(i,j) enddo enddo What is a simple change that you could make to this code that may make it run faster? Exercise: Initializing Arrays Declare two one-dimensional real arrays of size 5.

It should be fairly obvious that some of the matrix operations are useful, but they become really powerful when you start to combine them in expressions. For example, imagine you need to perform a similarity transform; perhaps you have diagonalized a matrix, and want to transform some coefficients from the original space to the eigenspace. Here's how you might do it. real :: coeffs(10), eigenspaceCoeffs(10), eigenvectors(10,10) eigenspaceCoeffs = matmul(transpose(eigenvectors), coeffs) Transforming a matrix from one space to another is not much more difficult: real, dimension(10,10) :: matrix, eigenspaceMatrix, eigenvectors eigenspaceMatrix = matmul( transpose(eigenvectors), matmul(matrix, eigenvectors) ) These operations would usually require many lines of nested loops, but with the array intrinsics, they are literally reduced to single line operations.

You can use an index array — array of integers representing indexes — to extract elements. For example, take the case of reordering some elements of an array. 0 print *, 'a is ', a print *, 'b is ', b end This shows how you can use an array of indexes to reference a part of an array, and even reorder the elements. 0. 0000000 You can also use an index array like this with multi-dimensional arrays. For example, if you wanted to swap the first two columns of a matrix, you might do it like this: real, dimension(3,3) :: reordered, matrix ...

Download PDF sample

Rated 4.56 of 5 – based on 6 votes