12.07.2015 Views

CAD in Civil Engineering - Baustatik-Info-Server

CAD in Civil Engineering - Baustatik-Info-Server

CAD in Civil Engineering - Baustatik-Info-Server

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

Page iv Computer Languages for Eng<strong>in</strong>eer<strong>in</strong>g - SS 132.8.1 Explicit Loops with Counter <strong>in</strong> 66, 77 and 90+ . . . . . . . . . . . . . . . . . . 292.8.2 Simple Nested Loop Example . . . . . . . . . . . . . . . . . . . . . . . . . . . 302.8.3 Quit a Cycle or a Loop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 312.8.4 Implicit, General Loop without a Control Structure <strong>in</strong> 90+ . . . . . . . . . . . . 322.8.5 Factorial <strong>in</strong> FORTRAN 90++ . . . . . . . . . . . . . . . . . . . . . . . . . . . 332.9 Branch<strong>in</strong>g . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 342.9.1 if Statement, Fortran 66 like . . . . . . . . . . . . . . . . . . . . . . . . . . . . 342.9.2 Implementation of a Quadratic Equation Solver . . . . . . . . . . . . . . . . . . 352.9.2.1 Some Theory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 352.9.2.2 A Flow-Chart of the QuadSolver . . . . . . . . . . . . . . . . . . . . 362.9.2.3 Quadratic Equation, Solver Implementation Fortran 66 like . . . . . . 362.9.2.4 Quadratic Equation, Solver Implementation Fortran 90 like . . . . . . 382.10 Subrout<strong>in</strong>es and Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 402.10.1 Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 402.10.2 Subrout<strong>in</strong>es . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 412.10.3 Functions as Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 422.11 Arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 422.11.1 Static Array . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 422.11.2 Dynamical Array . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 432.11.3 Automatic Array . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 432.11.4 A little Array Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 432.11.5 Pseudo Dynamic Arrays <strong>in</strong> Fortran 77 . . . . . . . . . . . . . . . . . . . . . . . 472.12 Global Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 492.12.1 Classical Fortran and Common . . . . . . . . . . . . . . . . . . . . . . . . . . . 492.12.2 Some Aspects of the Module Concept of Fortran 90 . . . . . . . . . . . . . . . . 492.12.3 Us<strong>in</strong>g global Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 503 Some Examples 533.1 Hello World . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 533.2 Simple Sum . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 533.3 Calculation of real*4/8 Precision . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 543.4 Relative Precision with Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 553.5 Newton’s Algorithm to calculate a Root . . . . . . . . . . . . . . . . . . . . . . . . . . 573.6 Matrix Product with 77-Ma<strong>in</strong> and 90-Library . . . . . . . . . . . . . . . . . . . . . . . 654 L<strong>in</strong>ear Algebra, Vectors and Matrices 694.1 Helper Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 694.1.1 Outl<strong>in</strong>es . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 694.1.2 Reset and List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 694.1.3 LU-Extract, MatMult and DiffMat . . . . . . . . . . . . . . . . . . . . . . . . . 734.1.4 Text Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 764.1.5 Memory Manager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 784.1.6 Multi Matrix Allocation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 814.1.7 Trac<strong>in</strong>g . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 854.2 Gauss-LU-Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 894.2.1 Gauss Decomposition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89E. Baeck

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

Saved successfully!

Ooh no, something went wrong!