solutions.txt
Mon Oct 31 08:24:34 2011
1
solutions.txt
Mon Oct 31 08:24:34 2011
2
* ./part1.f90
PROGRAM classproj1 !* Program to multiply together two matrices mat1 & mat2 and store !* the result in mat3.
IMPLICIT NONE
INTEGER, PARAMETER : m=3,n=4,k=3 INT
solutions.txt *
Fri Dec 16 12:39:35 2011
1
solutions.txt
Fri Dec 16 12:39:35 2011
2
* ./exercise2/example_case.f90 * ./exercise1/example_if2.f90
PROGRAM example_case
IMPLICIT NONE
INTEGER : i
PRINT*,"Enter an INTEGER" READ*,i !* Get the user to input i IM
solutions.txt
Mon Oct 24 10:41:19 2011
1
solutions.txt
Mon Oct 24 10:41:19 2011
2
* ./exercise4/internal4.f90 * ./exercise2/internal2.f90
PROGRAM internal4 PROGRAM internal2 ! * Example of a Program with an internal subroutine IMPLICIT NONE REAL : a,b,c C
solutions.txt READ*,n sinx=x dummy=x PRINT*,'Calculating Term',1 DO i=3,2*n-1,2 !* Loop through starting with the second term (-x^3/3!) ans stopping !* loops up to 2*n-1 for the last term. PRINT*,'Calculating Term',(i-1)/2+1 dummy=dummy/(i*(i-1)*x*2 ! * C
solutions.txt
Tue Oct 11 08:17:44 2011
1
solutions.txt
Tue Oct 11 08:17:44 2011
2
* ./exercise4/factorial.f90
PROGRAM factorial !* calculate the first factorials of the numbers 1 -> 8
IMPLICIT NONE
INTEGER : a, b=1
DO a = 1, 8 b = a*b PRINT*,"factorial ",
Extra Question Handout Three
Consider the following series of numbers. 1,1,2,3,5,8,13,21,34,55,89,144 The first two elements of the series are set to one. From then on the next term in the series is simply the sum of the two previous terms. Problem Outlin
Extra Exercises Handout Two
October 5, 2011
Question One
Write a fortran code to compute the sum of the squares of the first n integers.Use a single `DO' loop to do this along with a `REAL' data type to hold the summation. Note that you can read in a valu
Handout One
Extra Exercise
To start make sure you are in the root directory of your home area, remember you can simply type `cd' then press `Enter' to take you there. Make a new directory called `hand1temp' inside your `fortran' directory but do this with
Handout Six Part II
November 3, 2011
1
Supplementary Notes : Solving an Initial Value Problem for an Ordinary Differential Equation
It is not the aim of these notes to teach a course on the numerical solution of ordinary differential equations (ODE's). Ho
solutions.txt 16 17 18 The root is estimated as : -19.440536 The number of iterations taken was 18 Equation Two = -19.440918 -19.440613 -19.440613 -19.440308 -19.440308 -19.440460 -19.440613 -19.440460 -19.440536 -0.000002 0.000013 0.000006
Mon Jan 16 14:
solutions.txt vv(loop)=vv(index) vv(index)=tmp_elem EXIT ENDIF END DO END FUNCTION find_pivot ! * FUNCTION back_sub(mat1,vv) !* Perform back substitution on an upper triang. matrix REAL,DIMENSION(:,:), INTENT(IN) : mat1 REAL,DIMENSION(:), INTENT(IN) : vv
solutions.txt
Tue Nov 22 10:59:18 2011
1
solutions.txt
Tue Nov 22 10:59:18 2011
2
* ./q1_ans/quest1_ans.txt.f90
uestion One =
[Part A]
4 5 1 3 6 2 a + b - (c * d) / f + 5.0*e
6 3 1 4 2 7 5 a + f * ( b - c ) / ( d - 3 ) - e * f
3 1 6 2 4 5 b * ( c / d ) -
external.txt
Fri Dec 16 12:10:30 2011 = MT4112 Exam January 2010 =
1
% QUESTION ONE %
= Part (a) = Call by reference : unit, is NOT copied Instead a reference instead.The address access the value or calling procedure. A variable being passed through an ar
stud_solutions.txt
Fri Jan 08 13:04:22 2010
1
% QUESTION ONE %
= Part (a) = = MODULE cat_mod IMPLICIT NONE CONTAINS ! * FUNCTION getmat(m,n) !* Function to input a matrix from the keyboard. The number of rows !* (m) and the number of columns (n) are input
`SELECT CASE' Construct & Exam
Handout Nine
1
`SELECT CASE' Construct
The `SELECT CASE' Construct is another decision making or branching construct to control the flow of your codes.
1.1
The `IF THEN ELSEIF' construct revisited.
Earlier in the course you
Simple File Input & Output
Handout Eight
Although we are looking at file I/O (Input/Output) rather late in this course, it is actually one of the most important features of any programming language. The ability of a program to communicate small or very la
Handout Seven November 24, 2011
1
Third look at arrays
So far you have learnt how to declare arrays and you have made use of `REAL' arrays to represent matrices in your matrix library module, where the first dimension indexes the `rows' of the matrix and
Handout Six November 3, 2011
1
Fortran 90 Modules
So far you have only been introduced to one type of `program unit', that is, the main program unit. At first, in the main program unit, you were shown how to write simple executable code and then later how
Handout Five October 28, 2011
1
Internal Functions & Subroutines
The main program unit can accommodate (`CONTAINS') two types of procedures (often called subprograms). These can be used to break up a large program and structure it into a more `readable' a
Handout Four October 24, 2011
1
1.1
Characters & Strings in Fortran
Declaration
In handout two of your notes (section 2.3) you were briefly shown how to declare various character types. A table similar to the following was given as correct examples of cha
Handout Three October 13, 2011
1
Arithmetic Expressions with Integers & Reals
Mostly you will find that typing in arithmetic expressions is intuitive and does not really cause any problems. However, there are situations that can occur where uncertainty ar
The Fortran Basics
Handout Two October 2, 2011
A Fortran program consists of a sequential list of Fortran `statements' and `constructs'. A statement can be seen a continuous line of code, like `b=a*a*a' or `INTEGER : a,b'. A construct is a group of statem
Introduction to Programming Fortran 90
Handout One September 26, 2011
Part I
Course Outline
1 Preliminaries
The aim of this course is to teach you how to write mathematical computer programs in FORTRAN 90. This will enable you to take a mathematical probl
solutions.txt !* absolute error is less than the given tolerance (tol). The !* eigenvalue is returned in (eigv) and the eigenvector is !* returned in x !* Dummy arguments REAL, DIMENSION(:,:), INTENT(IN) : mat REAL, DIMENSION(:), INTENT(INOUT) : x REAL, I
solutions.txt
Tue Mar 21 16:10:03 2006
1
solutions.txt INTEGER : i
Tue Mar 21 16:10:03 2006 ! * Loop variable
2
PROGRAM part2 !* Program to multiply together two matrices mat1 & mat2 and store !* the result in mat3. ie "mat3 = mat1 X mat2" where "X" repre