Skip to main content

Home

Direct link to the C++ web page

INTRODUCTION TO PROGRAMMING 2007/08

The aim of the course is to introduce students to the development of computer software and to provide them with a working knowledge of Fortran 95.

The course is taken by all level 2 students in Physics, Physics and Astronomy and Theoretical Physics, as well as by any other student taking Module PHYS2551 (Laboratory Skills and Practice) or Module COMP3361 (e-Science and Physics). The mark for the course amounts to 20% of the total mark for these modules.

Students are expected to work at their own pace through a set of exercises, finishing with an assessed programming project. Tuition is given through three introductory lectures and through extensive printed notes intended for self-study. There are no set laboratory sessions, but a help desk is manned several hours a week in the Department’s PC classroom (room 140). It is recommended that students use the Salford Fortran package which forms part of the Plato Integrated Development Environment available on the University Networked PC Service.

The lecturer in charge of the course is Dr R M Potvliege (Physics Department, room 116, e-mail: [email protected]).

Brief syllabus: Computer programming and programming languages. Representations of numbers. Programming in Fortran 95: variables, expressions, types, control flow, functions and subprograms, arrays, input/output.

General Information for Students

All the essential information concerning the course is contained in a handout included in the course pack given out during the first lecture. In short, the course is based on a set of printed notes intended for self study. You are invited to progress through them at your own pace. (However, try to be finished with Parts 1 and 2 by the 24th of October, with Parts 1 to 3 and Section 5.1 by the 7th of November, and and with Parts 1 to 5 by the 22nd of November). The notes will be distributed in the first lecture. Those who would have missed that can collect them from the Level 2 Laboratory Technician (room 224) thereafter. The course covers enough material to provide you with a basic knowledge of Fortran 95. However, it does not offer a complete description of the language.

All exercises and programming projects associated with the course can be done using the Plato IDE (integrated development environment) installed on the University’s Networked PC Service – see the first few pages of the course notes for further information. Alternatively, those knowing the operating system Unix (or variants thereof) may use the University’s Unix and Linux services, which offer Fortran 77, Fortran 90 and Fortran 95 compilers. Computers enthusiasts may want to install a Fortran compiler on their own PC. Commercial compilers are normally very expensive, but there are cheaper options.

Copies of some of the handouts distributed in lectures and related documents will be provided through DUO. (See the pages concerning Module PHYS2551, “Laboratory Skills and Practice”.)


Prerequisites

The only prerequisite is some familiarity with the Windows operating system, at the level required for employing the Salford Plato system available on the University Networked PC Service.

Lectures

The introductory lectures will be given in room Ph8 at 11 am on Fridays October 12th, 19th and 26th. The first lecture will be a general introduction to the course and to Fortran 95. The following lectures will be devoted to the pitfalls of computing in finite-precision arithmetic and to developing and debugging a program.

Help Desk and Tutorials

A Fortran helpdesk will be open in the Department’s Computing Classroom, room Ph140, from 1.15 to 2.15 pm on Mondays, from the 22nd of October to the 3rd of December (except on the 12th of November), and from 11 am to 1 pm on Wednesdays, from the 24th of October to the 5th of December (except on the 14th of November). The demonstrators are Dr S Brand, Mr A Graham, Mr N L Mitchell, and Mr A Ridler. Students wishing to consult a demonstrator are invited to make an appointment byusing the relevant online sign-up sheet on DUO (see the Course Documents page of Introduction to Programming).

Students experiencing considerable difficulties with the course are invited to attend small groups tutorials which will be held between 11 am and 12 pm on the 2nd and 16th of November. The number of places is limited. Booking is through the online sign-up facility of DUO (please go to the Course Documents page of Introduction to Programming).

The self-study Fortran course

The course pack comprises: (1) The Fortran course; (2) the associated worksheets, with model answers; (3) a quick reference sheet; (4) a style manual; (5) a self-study C++ course; and (6) a one-page document describing the format of the course.

Typos spotted in the printed notes.

The programs described in the notes and model solutions to the accompanying programming problems are available online.

Supplementary programming problems.


Homework, assignments and assessment

The mark for the course will be the aggregate of the marks obtained for three short assignments during the term (6% of the mark for the course), for a programming test (38%) and for a programming project (56%).

The programming test will take place on Friday November 23rd between 11 am and 12 pm.

Two of the three short assignments will be set as parts of weekly problems sheets. They will be multiple choice questions. One will be due by the 25th of October and the other by the 22nd of November. The other short assignment will be a miniproject due by 2.15 pm on the 8th of November. The final programming project will be set towards the middle of the term. It is due by 5.15 pm on Monday December 10. The Department will provide 50 printer credits for the printed output generated in the preparation of the project or for any other use related with the course.

The details of the project and answers to the multiple choice questions will be published in due time via DUO.


Quizzes

For more practice and for testing yourself, please try our quizzes


Information about Fortran

The printed notes are self contained and do not require you to purchase or consult any textbook or other material. The Level 2 Lab Technician keeps a small number of useful reference books (books about the language, and copies of Numerical Recipes in Fortran) which you can borrow from a short while. Further information can be found from a variety of sources. For example:

You can get information sheets online from the IT Services (or purchase them from their helpdesk). Of particular relevance to the course are the guides 1 (“An Introduction to Unix”, of interest if you wish to learn some Unix — which is entirely optional), 100 (“Using Fortran on the Networked PC service”) and 138 (“An introduction to programming in Fortran 90”).

The Salford package contains a help system giving a short description of the features of the languages. To access it, logon on the Networked PC service and click on Start > Programs > Programming Languages > Salford Software > Fortran > FTN95 Help.

Useful tips about using Fortran on the Unix system and links to online material can be found on the web page of the Physics Level 3 Computing Course.

The following books are recommended for a more complete, or different, exposition of the language:

J M Ortega, “An Introduction to Fortran 90 for Scientific Computing”, Oxford. [A very simple introduction, recommended for beginners.]

S J Chapman, “Fortran 90/95 for Scientists and Engineers”, McGraw Hill. [Expensive and going out of print. One of the best texts, giving a simple but complete description of the language. Recommended for those who would need to program in Fortran 95 at a professional level.]

B D Hahn, “Fortran 90 for Scientists and Engineers”, Arnold. [Compact and pretty much complete.]

M Metcalf and J Reid, “Fortran 90/95 Explained” (2nd ed), Oxford. [A thorough coverage of all the features of the language. Terse but an excellent reference for experienced programmers.]

L R Nyhoff and S C Leestma, “Fortran 90 for Engineers and Scientists”, Prentice Hall. [Covers all the features of the language and suitable for beginners.]

The text by P L DeVries (“A First Course in Computational Physics”, Wiley) is a simple introduction to numerical computation in Physics. It contains many example programs, unfortunately all in Fortran 77, not Fortran 95.


The C++ course

Besides the Fortran course, the Department is also offering a self-study C++ course. The latter is entirely voluntary. It will not be assessed and will not be required by any of the Level 3 and 4 Physics modules. If you are keen on programming, we encourage you to study C++ once you have finished the Fortran course. (However, remember that the mark for Level 2 Computing will be based only on your knowledge of Fortran 95.)

More information can be found on the C++ web page associated with the course.