Modular Programming with Fortran 90 - ?· Fortran 90 Topic Overview Next: Introduction Up: Home Modular…

Download Modular Programming with Fortran 90 - ?· Fortran 90 Topic Overview Next: Introduction Up: Home Modular…

Post on 30-Jul-2018

224 views

Category:

Documents

1 download

Embed Size (px)

TRANSCRIPT

  • Fortran 90 Topic Overview

    Next: Introduction Up: Home

    Modular Programming with Fortran 90

    List of Topic Overviews by Dr. A C Marshall

    Introduction Introduction to Fortran Language Obsolescence Object Oriented Programming Fortran 90 Programming Language Elements Data Objects Expressions and Assignment Simple Input / Output More About Operations Control Flow Mixing Objects of Different Types Intrinsic Procedures Arrays More Intrinsic Functions Program Units Arrays and Procedures More Procedures Modules Pointers and Targets User Defined Types Pointers and Derived Types Object Orientation

    http://www.liv.ac.uk/HPC/HTMLF90Course/HTMLF90CourseSlides.html (1 von 2) [11.02.2002 14:42:21]

  • Fortran 90 Topic Overview

    Parametrised Intrinsic Types External Procedures Even More Intrinsics More Input and Output Data Statement Handling Exceptions Fortran in the Future ASCII Collating Sequence

    Next: Introduction Up: Home

    University of Liverpool, 1997Mon Sep 8 20:26:47 BST 1997Not for commercial use.

    http://www.liv.ac.uk/HPC/HTMLF90Course/HTMLF90CourseSlides.html (2 von 2) [11.02.2002 14:42:21]

  • Introduction

    Next: What is a Computer? Up: Fortran 90 Topic Overview Previous: Fortran 90 Topic Overview

    Introduction

    What is a Computer? What is Hardware and Software? Telling a Computer What To Do Some Basic Terminology How Does Computer Memory Work? Numeric Storage Programming Languages High-level Programming Languages An Example Problem An Example Program Analysis of Program A Closer Look at the Specification Part A Closer Look at the Execution Part How to Write a Computer Program A Quadratic Equation Solver - The Algorithm A Quadratic Equation Solver - The Program A Quadratic Equation Solver - The Testing Phase Points Raised Bugs - Compile-time Errors Bugs - Run-time Errors Compiler Switches

    Next: What is a Computer? Up: Fortran 90 Topic Overview Previous: Fortran 90 Topic Overview

    University of Liverpool, 1997Mon Sep 8 20:26:47 BST 1997Not for commercial use.

    http://www.liv.ac.uk/HPC/HTMLF90Course/HTMLF90CourseSlidesnode1.html [11.02.2002 14:42:23]

  • What is a Computer?

    Next: What is Hardware and Up: Introduction Previous: Introduction

    What is a Computer?

    A simple computer may look like this:

    memory (RAM) -- used to store values during execution of a program,

    CPU (Central Processor Unit) -- does the `work',

    disc drive -- `permanently' stores files,

    keyboard -- allows user to input information,

    VDU -- visually outputs data,

    For more information, click here

    http://www.liv.ac.uk/HPC/HTMLF90Course/HTMLF90CourseSlidesnode2.html (1 von 2) [11.02.2002 14:42:24]

  • What is a Computer?

    Next: What is Hardware and Up: Introduction Previous: Introduction

    University of Liverpool, 1997Mon Sep 8 20:26:47 BST 1997Not for commercial use.

    http://www.liv.ac.uk/HPC/HTMLF90Course/HTMLF90CourseSlidesnode2.html (2 von 2) [11.02.2002 14:42:24]

  • What is Hardware and Software?

    Next: Telling a Computer What Up: Introduction Previous: What is a Computer?

    What is Hardware and Software?

    A computer system comprises hardware and software.

    Hardware is the physical medium, for example:

    circuit boards

    processors

    keyboard

    Software are computer programs, for example:

    operating system

    editor

    compilers

    a Fortran 90 program

    For more information, click here

    Next: Telling a Computer What Up: Introduction Previous: What is a Computer?

    University of Liverpool, 1997Mon Sep 8 20:26:47 BST 1997Not for commercial use.

    http://www.liv.ac.uk/HPC/HTMLF90Course/HTMLF90CourseSlidesnode3.html [11.02.2002 14:42:25]

  • What is a Computer?

    Next: What is Hardware and Up: Introduction to Computer Systems Previous: Introduction to Computer Systems

    What is a Computer?

    The following schematic diagram gives the layout of a Personal Computer (PC), most single user systems follow this general design:

    The components perform the following tasks:

    CPU (Central Processor Unit) -- does the `work', fetches, stores and manipulates values that are stored in the computers memory. Processors come in all different `shapes and sizes' -- there are many different types of architectures which are suited to a variety of different tasks. We do not consider any particular type of CPU is this course.

    Main memory (RAM -- Random Access Memory) -- used to store values during execution of a program. It can be written to and read from at any time.

    http://www.liv.ac.uk/HPC/HTMLF90Course/HTMLF90CourseNotesnode2.html (1 von 3) [11.02.2002 14:42:25]

    http://www.liv.ac.uk/HPC/HTMLF90Course/HTMLF90CourseNotesnode1.htmlhttp://www.liv.ac.uk/HPC/HTMLF90Course/HTMLF90CourseNotesnode1.htmlhttp://www.liv.ac.uk/HPC/HTMLF90Course/HTMLF90CourseNotesnode1.htmlhttp://www.liv.ac.uk/HPC/HTMLF90Course/HTMLF90CourseNotesnode1.htmlhttp://www.liv.ac.uk/HPC/HTMLF90Course/HTMLF90CourseNotesnode1.html

  • What is a Computer?

    Disc drive (hard or floppy) -- `permanently' stores files (programs and data). Hard discs are generally located inside the machine and come in a variety of different sizes and speeds. They do not, in fact, store files permanently -- they often go wrong and so must undergo a back-up at regular intervals. The floppy disc drive allows a user to make his or her own back up of important files and data. It is very important to keep back-ups. Do not be caught out -- you may well lose all your work!

    Keyboard -- allows user to input information. Nowadays, most keyboards have more or less the same functionality.

    VDU (Visual Display Unit) -- visually outputs data. There are numerous types of VDU differing in the resolution (dots per inch) and the number of colours that can be represented.

    Printer -- allows a hard copy to be made. Again, there are many different types of printers available, for example, line printers, dot-matrix printers, bubble jet printers and laser printers. These also differ in their resolution and colour palette.

    The last four are known as peripheral devices.

    A good PC could contain:

    Intel Pentium P166 CPU

    32MBytes RAM (main memory)

    2.1GByte hard disc

    SVGA monitor

    IBM PC keyboard

    In addition a system may include,

    printer, for example, an HP LaserJet

    soundcard and speakers

    CD ROM drive (Read Only Memory)

    SCSI (`scuzzy') disc (fast),

    floppy disc drive (for backing up data)

    network card

    http://www.liv.ac.uk/HPC/HTMLF90Course/HTMLF90CourseNotesnode2.html (2 von 3) [11.02.2002 14:42:25]

  • What is a Computer?

    Return to corresponding overview page

    Next: What is Hardware and Up: Introduction to Computer Systems Previous: Introduction to Computer Systems

    University of Liverpool, 1997Mon Sep 8 14:39:20 BST 1997Not for commercial use.

    http://www.liv.ac.uk/HPC/HTMLF90Course/HTMLF90CourseNotesnode2.html (3 von 3) [11.02.2002 14:42:25]

    http://www.liv.ac.uk/HPC/HTMLF90Course/HTMLF90CourseNotesnode1.htmlhttp://www.liv.ac.uk/HPC/HTMLF90Course/HTMLF90CourseNotesnode1.htmlhttp://www.liv.ac.uk/HPC/HTMLF90Course/HTMLF90CourseNotesnode1.htmlhttp://www.liv.ac.uk/HPC/HTMLF90Course/HTMLF90CourseNotesnode1.htmlhttp://www.liv.ac.uk/HPC/HTMLF90Course/HTMLF90CourseNotesnode1.html

  • Telling a Computer What To Do

    Next: Some Basic Terminology Up: Introduction Previous: What is Hardware and

    Telling a Computer What To Do

    To get a computer to perform a specific task it must be given a sequence of unambiguous instructions or a program.

    An everyday example is instructions on how to assemble a bedside cabinet. The instructions must be followed precisely and in the correct order:

    1. insert the spigot into hole `A',

    2. apply glue along the edge of side panel,

    3. press together side and top panels

    4. attach toggle pin `B' to gromit `C'

    5. ... and so on

    The cabinet would turn out wonky if the instructions were not followed `to the letter'!

    For more information, click here

    Next: Some Basic Terminology Up: Introduction Previous: What is Hardware and

    University of Liverpool, 1997Mon Sep 8 20:26:47 BST 1997Not for commercial use.

    http://www.liv.ac.uk/HPC/HTMLF90Course/HTMLF90CourseSlidesnode4.html [11.02.2002 14:42:26]

  • What is Hardware and Software?

    Next: Telling a Computer What Up: Introduction to Computer Systems Previous: What is a Computer?

    What is Hardware and Software?

    A computer system is made up from hardware and software.

    Hardware is the physical medium, for example:

    circuit boards

    processors

    keyboard

    A piece of software is a computer program, for example:

    an operating system

    an editor

    a compiler

    a Fortran 90 program

    The software allows the hardware to be used. Programs vary enormously in size and complexity.

    Return to corresponding overview page

    Next: Telling a Computer What Up: Introduction to Computer Systems Previous: What is a Computer?

    University of Liverpool, 1997

    http://www.liv.ac.uk/HPC/HTMLF90Course/HTMLF90CourseNotesnode3.html (1 von 2) [11.02.2002 14:42:26]

    http://www.liv.ac.uk/HPC/HTMLF90Course/HTMLF90CourseNotesnode1.htmlhttp://www.liv.ac.uk/HPC/HTMLF90Course/HTMLF90CourseNotesnode1.htmlhttp://www.liv.ac.uk/HPC/HTMLF90Course/HTMLF90CourseNotesnode1.htmlhttp://www.liv.ac.uk/HPC/HTMLF90Course/HTMLF90CourseNotesnode1.html

  • What is Hardware and Software?

    Mon Sep 8 14:39:20 BST 1997Not for commercial use.

    http://www.liv.ac.uk/HPC/HTMLF90Course/HTMLF90CourseNotesnode3.html (2 von 2) [11.02.2002 14:42:26]

  • Some Basic Terminology

    Next: How Does Computer Memory Up: Introduction Previous: Telling a Computer What

    Some Basic Terminology

    Bit is short for Binary Digit. Bits have value of 1 or 0, (corresponds to true or false),

    8 Bits make up 1 Byte,

    1024 Bytes make up 1 KByte (1K),

    1024 KBytes make up 1 MByte (1M),

    all machines have a wordsize -- a fundamental unit of storage, for example, 8-bits, 16-bits, etc.

    the size of a word (in Bytes) differs between machines. A Pentium based machine is 32-bit.

    Why 1024? Because

    For more information, click here

    Next: How Does Computer Memory Up: Introduction Previous: Telling a Computer What

    University of Liverpool, 1997Mon Sep 8 20:26:47 BST 1997Not for commercial use.

    http://www.liv.ac.uk/HPC/HTMLF90Course/HTMLF90CourseSlidesnode5.html [11.02.2002 14:42:27]

  • Telling a Computer What To Do

    Next: Some Basic Terminology Up: Introduction to Computer Systems Previous: What is Hardware and

    Telling a Computer What To Do

    To get a computer to perform a specific task it must be given a sequence of unambiguous instructions or a program.

    We meet many examples of programs in everyday life, for example, instructions on how to assemble a bedside cabinet. These instructions are generally numbered, meaning that there is a specific order to be followed, they are also (supposed to be) precise so that there is no confusion about what is intended:

    1. insert the spigot into hole `A',

    2. apply glue along the edge of side panel,

    3. press together side and top panels

    4. attach toggle pin `B' to gromit `C'

    5. ... and so on

    If these instructions are not followed `to the letter', then the cabinet would turn out wonky.

    Return to corresponding overview page

    Next: Some Basic Terminology Up: Introduction to Computer Systems Previous: What is Hardware and

    University of Liverpool, 1997Mon Sep 8 14:39:20 BST 1997Not for commercial use.

    http://www.liv.ac.uk/HPC/HTMLF90Course/HTMLF90CourseNotesnode4.html [11.02.2002 14:42:27]

    http://www.liv.ac.uk/HPC/HTMLF90Course/HTMLF90CourseNotesnode1.htmlhttp://www.liv.ac.uk/HPC/HTMLF90Course/HTMLF90CourseNotesnode1.htmlhttp://www.liv.ac.uk/HPC/HTMLF90Course/HTMLF90CourseNotesnode1.htmlhttp://www.liv.ac.uk/HPC/HTMLF90Course/HTMLF90CourseNotesnode1.html

  • How Does Computer Memory Work?

    Next: Numeric Storage Up: Introduction Previous: Some Basic Terminology

    How Does Computer Memory Work?

    Here the wordsize is 8-bits:

    A computers memory is addressable,

    each memory location will contain some sort of `value',

    Each location has a specific `number' (represented as hexadecimal [base-16], e.g., 3F2C),

    Fortran 90 allows (English) names to be given to memory locations,

    the value of a location can be read from or written to.

    The CPU can say, `fetch the contents of memory location 3F2C' or `write this value to location 3AF7'.

    For more information, click here

    Next: Numeric Storage Up: Introduction Previous: Some Basic Terminology

    University of Liverpool, 1997Mon Sep 8 20:26:47 BST 1997Not for commercial use.

    http://www.liv.ac.uk/HPC/HTMLF90Course/HTMLF90CourseSlidesnode6.html [11.02.2002 14:42:28]

  • Some Basic Terminology

    Next: How Does Computer Memory Up: Introduction to Computer Systems Previous: Telling a Computer What

    Some Basic Terminology

    It is necessary to cover some terminology. Hopefully, much of it will be familiar -- you will hear many of the terms used throughout the course.

    Bit is short for Binary Digit. Bits have value of 1 or 0, (or on or off, or, true or false),

    8 Bits make up 1 Byte,

    1024 Bytes make up 1 KByte (1 KiloByte or 1K), (``Why 1024?'' I hear you ask. Because .

    1024 KBytes make up 1 MByte (1 MagaByte or 1M),

    1024 MBytes make up 1 GByte (1 GigaByte or 1G),

    all machines have a wordsize -- a fundamental unit of storage, for example, 8-bits, 16-bits, etc. The size of a word (in Bytes) differs between machines. A Pentium based machine is 32-bit.

    a flop is a floating point operation per second. A floating point operation occurs when two real numbers are added. Today, we talk of megaflops or even gigaflops.

    parallel processing occurs when two or more CPUs work on solution of the same problem at the same time.

    Return to corresponding overview page

    Next: How Does Computer Memory Up: Introduction to Computer Systems Previous: Telling a

    http://www.liv.ac.uk/HPC/HTMLF90Course/HTMLF90CourseNotesnode5.html (1 von 2) [11.02.2002 14:42:28]

    http://www.liv.ac.uk/HPC/HTMLF90Course/HTMLF90CourseNotesnode1.htmlhttp://www.liv.ac.uk/HPC/HTMLF90Course/HTMLF90CourseNotesnode1.htmlhttp://www.liv.ac.uk/HPC/HTMLF90Course/HTMLF90CourseNotesnode1.htmlhttp://www.liv.ac.uk/HPC/HTMLF90Course/HTMLF90CourseNotesnode1.html

  • Some Basic Terminology

    Computer What

    University of Liverpool, 1997Mon Sep 8 14:39:20 BST 1997Not for commercial use.

    http://www.liv.ac.uk/HPC/HTMLF90Course/HTMLF90CourseNotesnode5.html (2 von 2) [11.02.2002 14:42:28]

  • Numeric Storage

    Next: Programming Languages Up: Introduction Previous: How Does Computer Memory

    Numeric Storage

    In general, there are two types of numbers used in Fortran 90 programs INTEGER s (whole numbers) and REAL s (floating point numbers).

    INTEGER s are stored exactly, often in range (-32767, 32767).

    REAL s a...

Recommended

View more >