Fortran 90 programming

The following program has a number of errors. Save a copy of your output in Word. You will come across errors many times as a programmer, and it is helpful to have a strategy for how to deal with them. Each error generates a message. Plato is a "programming environment".

Uploader: Mujinn
Date Added: 4 September 2018
File Size: 62.75 Mb
Operating Systems: Windows NT/2000/XP/2003/2003/7/8/10 MacOS 10/X
Downloads: 64958
Price: Free* [*Free Regsitration Required]





The example below has a maximum length of 10 characters allowed for a person's name — this might not always be enough! Aims By the end of this worksheet, you will be able to: Plato's editor is special — it understands the syntax of various programming languages.

In the bad old days of programming, declaration of variables was thought to be unnecessary and the old FORTRAN compilers used an implicit convention that integers have names starting with the letters in the range i — n, all the others being real. We may output several items at one time, provided they are separated by commas.

This worksheet makes use of several examples programs that are all available for download from this website.

Program convertbelow, demonstrates their use. We can also specify that numbers are integer and character. Time has shown that one of the commonest reasons for error in a program is the incorrect use of variables. Run your last program again.

Plato is a "programming environment". Worksheet 1 - Basics. If this doesn't seem enough — don't worry we'll come back later on when we examine how to increase the number of digits of precision in Worksheet 5.

The Basics

When the black output window opens right click on the Plato icon in the top left corner. Each error generates a message. We tell Plato which language we are using when we create our empty file foftran save it with a.

Notice the inclusion of the line: Within Plato, you can create and edit programs and get them to run. It could, for example, print out their year of birth with a suitable message.

FORTRAN Tutorial - Free Guide to Programming Fortran 90/95 - Introduction

Double clicking on the message will take you to the line in the program where the fault occurs. The compiler will report two error messages when it attempts to compile.

The purpose of this exercise is to show you the various kinds of errors you may encounter when programming. So far, we have only used real floating point numbers in our programs. The following program has a number of errors. Privacy and cookies policy. Provided you have given your file the appropriate extension, Plato's editor will be able to check the syntax of the program, highlighting the various keywords that it knows about using a colour code to distinguish between the various elements of the language.

Click on the details button. Include input and output using read and print. You will come across errors many times as a programmer, and it is helpful to have a strategy for how to deal with them. You have to make a judgement here. The real variable type gives us 6 figure decimal precision.

The program statements are executed sequentially. You might include different types of variables, for example realintegerand character. This worksheet is also available in PDF format. It's up to you, just use your imagination.

Save a copy of your output in Word. Always use implicit none at the start of every program.

Comments 5

Leave a Reply

Your email address will not be published. Required fields are marked *