12.010 Computational Methods of Scientific Programming Lecturers Thomas A Herring, Room 54-820A, Chris Hill, Room 54-1511,

Slides:



Advertisements
Similar presentations
CSE 105 Structured Programming Language (C)
Advertisements

Chapter 7 Introduction to Procedures. So far, all programs written in such way that all subtasks are integrated in one single large program. There is.
Procedural programming in Java
Lecture 8: MIPS Instruction Set
Coding and Debugging. Requirements and Specification Recall the four steps of problem solving: Orient, Plan, Execute, Test Before you start the implementation.
The Functions and Purposes of Translators Code Generation (Intermediate Code, Optimisation, Final Code), Linkers & Loaders.
Programming Types of Testing.
Computational Methods of Scientific Programming Lecturers Thomas A Herring, Room A, Chris Hill, Room ,
Chapter 5 C Functions The best way to develop and maintain a large program is to divide it into several smaller program modules, each of which is more.
Lecture Roger Sutton CO331 Visual programming 15: Debugging 1.
CIS 101: Computer Programming and Problem Solving Lecture 8 Usman Roshan Department of Computer Science NJIT.
Working with JavaScript. 2 Objectives Introducing JavaScript Inserting JavaScript into a Web Page File Writing Output to the Web Page Working with Variables.
CS1061 C Programming Lecture 3: The Programming Environment + Introduction to the Concept of an Algorithm A. O’Riordan, 2004.
Program Flow Charting How to tackle the beginning stage a program design.
If You Missed Last Week Go to Click on Syllabus, review lecture 01 notes, course schedule Contact your TA ( on website) Schedule.
Program Flow Charting How to tackle the beginning stage a program design.
Lec6 P 1 CP2030 Visual Basic For C++ programmers Copyright © University of Wolverhampton CP2030 VBFC Lecture 6 Back To Index v Procedures and Parameters.
Memory Management 1 CS502 Spring 2006 Memory Management CS-502 Spring 2006.
CS-3013 & CS-502, Summer 2006 Memory Management1 CS-3013 & CS-502 Summer 2006.
FORTRAN Short Course Week 4 Kate Thayer-Calder March 10, 2009.
Guide To UNIX Using Linux Third Edition
Computational Methods of Scientific Programming Lecturers Thomas A Herring, Room A, Chris Hill, Room ,
P51UST: Unix and Software Tools Unix and Software Tools (P51UST) Compilers, Interpreters and Debuggers Ruibin Bai (Room AB326) Division of Computer Science.
Computational Methods of Scientific Programming Lecturers Thomas A Herring, Room 54-80A, Chris Hill, Room ,
Homework Reading Programming Assignments
Introduction to FORTRAN
© Janice Regan, CMPT 128, Jan CMPT 128 Introduction to Computing Science for Engineering Students Creating a program.
Computational Methods of Scientific Programming Lecturers Thomas A Herring, Room A, Chris Hill, Room ,
Computational Methods of Scientific Programming Lecturers Thomas A Herring, Room A, Chris Hill, Room ,
1 Computing Software. Programming Style Programs that are not documented internally, while they may do what is requested, can be difficult to understand.
Computational Methods of Scientific Programming Lecturers Thomas A Herring, Room A, Chris Hill, Room ,
Computational Methods of Scientific Programming Lecturers Thomas A Herring, Room A, Chris Hill, Room ,
Procedures and Functions Computing Module 1. What is modular programming? Most programs written for companies will have thousands of lines of code. Most.
CIS250 OPERATING SYSTEMS Memory Management Since we share memory, we need to manage it Memory manager only sees the address A program counter value indicates.
Program Errors and Debugging Week 10, Thursday Lab.
Computational Methods of Scientific Programming Lecture 8 Today’s lecture Start C/C++ Basic language features Web page
Errors “Computer says no..”. Types of Errors Many different types of errors new ones are being invented every day by industrious programming students..
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Memory: Relocation.
Computational Methods of Scientific Programming Lecturers Thomas A Herring, Room , Chris Hill, Room ,
XP Tutorial 10New Perspectives on HTML and XHTML, Comprehensive 1 Working with JavaScript Creating a Programmable Web Page for North Pole Novelties Tutorial.
Blackfin Array Handling Part 1 Making an array of Zeros void MakeZeroASM(int foo[ ], int N);
1 Objectives ❏ To design and implement programs with more than one function ❏ To be able to design multi-function programs ❏ To understand the purpose.
Programming Fundamentals Lecture No. 2. Course Objectives Objectives of this course are three fold 1. To appreciate the need for a programming language.
FORTRAN History. FORTRAN - Interesting Facts n FORTRAN is the oldest Language actively in use today. n FORTRAN is still used for new software development.
School of Computer Science & Information Technology G6DICP - Lecture 6 Errors, bugs and debugging.
How Are Computers Programmed? CPS120: Introduction to Computer Science Lecture 5.
CS 177 Week 10 Recitation Slides 1 1 Debugging. Announcements 2 2.
Announcements Assignment 1 due Wednesday at 11:59PM Quiz 1 on Thursday 1.
1 Asstt. Prof Navjot Kaur Computer Dept PRESENTED BY.
Principles of Programming CSEB134 : BS/ CHAPTER Fundamentals of the C Programming Language.
IST 210: PHP LOGIC IST 210: Organization of Data IST210 1.
COMP091 – Operating Systems 1 Memory Management. Memory Management Terms Physical address –Actual address as seen by memory unit Logical address –Address.
LECTURE 3 Translation. PROCESS MEMORY There are four general areas of memory in a process. The text area contains the instructions for the application.
L071 Introduction to C Topics Compilation Using the gcc Compiler The Anatomy of a C Program Reading Sections
Introduction to Computer Programming Concepts M. Uyguroğlu R. Uyguroğlu.
Harvard Mark I Howard Aiken was a pioneer in computing and a creator of conceptual design for IBM in the 1940s. He envisioned an electro-mechanical computing.
Computational Methods of Scientific Programming Lecturers Thomas A Herring, Room A, Chris Hill, Room ,
Binding & Dynamic Linking Presented by: Raunak Sulekh(1013) Pooja Kapoor(1008)
L131 Assignment Operators Topics Increment and Decrement Operators Assignment Operators Debugging Tips rand( ) math library functions Reading Sections.
BIL 104E Introduction to Scientific and Engineering Computing Lecture 4.
14 Compilers, Interpreters and Debuggers
Component 1.6.
Compilation and Debugging
Compilation and Debugging
Separate Assembly allows a program to be built from modules rather than a single source file assembler linker source file.
CSC113: Computer Programming (Theory = 03, Lab = 01)
Computational Methods of Scientific Programming
Accomplishing Executables
WJEC GCSE Computer Science
Functions that return a value
Presentation transcript:

Computational Methods of Scientific Programming Lecturers Thomas A Herring, Room A, Chris Hill, Room , Web page

9/28/ Lec 062 Review of Lecture 5 Looked at Fortran commands in more detail –Control through if and do statements. –Logical expressions in Fortran.eq..ne..gt..ge..lt..le. –Logical expressions.not..and..or. –Looping with do j = start, end, inc and do while constructions. –Include, common, and parameter statements as methods of communicating between modules –Data and Save statements as methods of initialization and ensuring that modules remember values.

9/28/ Lec 063 Final topics Most of today's class will on trying Fortran program. Errors in Fortran programs can occur 3 places: Compile errors: –Nature of error is reported and the line number in the source code with the problem. It is best to work from the first to last error. In some cases, an early error can generate many later errors (so try to fix the major problems—often other compile errors disappear once these are fixed). –Forgetting to end do loops and if statements will often generate many errors.

9/28/ Lec 064 Errors 02 Linking errors: –Most common here is undefined external which means you seems to call a subroutine or function and the linker can not find the routine you are referring to. –In some machines, you might get errors about real*8 variables not being on even byte boundaries. Usually only a problem when you are doing “tricky” Fortran code.

9/28/ Lec 065 Errors 03 Runtime errors: –IOSTAT errors associated with file reading and writing. –NaN - Not a number, generated when illegal operations are performed (e.g., sqrt(negative number) not stored to a complex variable –Inf - Infinite result (usually divide by zero or tan(  /2) –Segmentation violation/Bus error. These are worst types of errors because where the program stops may not be related at all to where the error is. Common causes are: Incorrect calling arguments and subroutine/function definition Exceeding the bounds of an array

9/28/ Lec 066 Errors 04 With optimized code (-On where n=0—5) can generate very strange errors which are not your fault (although the cleaner the code the less likely this is to occur) Try compiling with out optimization (this does not say that you don’t have a bug since things move around in memory with different optimization.

9/28/ Lec 067 Final comments Other useful utilities (on Unix systems) size — program to tell you the size of a program e.g. % size poly_area make — Used to organize large program by specification of dependency of modules (e.g., object modules depend of source code and include files, programs depend of libraries and object modules) –make checks the dependencies and re-compiles and links only those things that depend of things that have changed. ar and ranlib — create libraries and indexes them for faster loading.

9/28/ Lec 068 Remainder of class Remainder of class we develop and debug fortran programs. Programs will be written in class to –Compute root-mean-square scatter (RMS) of random numbers generated with the intrinsic rand function Students with laptops might want to bring them along so that can work on their own system or on athena. There is wireless internet in the room.

9/28/ Lec 069 RMS calculation Root mean square (RMS) scatter is computed by: Notice that in the second form, the values do not need to be saved.