COMP 208 - 003

It is currently Saturday May 26th 23:18:26

Contact Information

E-mail: e-mail address

I check my e-mail everyday, so it's the best way to get in touch with me. If my office hours do not work for you, please contact me and we can arrange another time to meet.

For more information see my main page here.

Latest Information

12/02/2007 - Uploaded new gauss.c, was corrected in class, example on slides incomplete/incorrect.

11/27/2007 - No Office Hours Nov. 27 or 28th at Conference

11/06/2007 - Office Hours Cancelled For Today, please e-mail me with questions instead.

10/25/2007 - For installing gcc see instructions on the Comp 322 site replacing "g++" with "gcc". gcc is part of the base MinGW tool set, make is useful to install as well when those options are presented. You'll also be naming your files with a ".c" extension.

10/23/2007 - Midterm Marks Released on WebCT - If you would like to review your exam contact Prof. Friedman

10/22/2007 - Added C Links on Main Page

10/09/2007 - Oct. 9th - Class Cancelled due to Thanksgiving Holiday

10/05/2007 - Reminder - No Office Hours Monday, Office Hours on Tuesday as Normal: 11:00AM-12:30PM

10/01/2007 - Find information about g77 specifications and valid functions here

09/20/2007 - Second Assignment Posted on WebCT DUE Oct. 9th 23:30

09/16/2007 - Updated Command Prompt Here Instructions for VISTA

09/13/2007 - Added Instructions For Working With VISTA

09/11/2007 - First Assignment Posted on WebCT DUE Sept. 20th 23:55

09/11/2007 - Uploaded Alternative Windows Software Package here

09/10/2007 - Added this page for more detailed information.

09/05/2007 - Added First set of Lecture Slides in PDF format.

Lecture Information

The Lecture is held in Otto Mass room 10 on Tuesday and Thursday from 2:30PM to 4:00PM.

My office hours this semester will be the following: Lecture Slides will be available in PDF format. There will be the full-screen set of lecture slides and a "notes" set which will have three slides per page with a section for you to take notes in the margin.

My Office is in McConnell Engineering Room 322 (double doored lab):
campus map

Development Environment Setup

First to clarify confusion: SciTE is only an editor not a compiler. Just running it on your machine will allow you to write your code but nothing else. GFortran or G77 (from MinGW) are needed as well (GFortran recommended for easy setup, g77 recommended for compliance). In the default package you need to run the executable before the SciTE directory first and ensure gfortran.exe or g77.exe are part of your system path (explained in more detail below).

MAC: Make sure to install "XCode" from your Mac Installation CD. You'll also need to install the cctools package before the gfortran package from the zip file on WebCT. You then should be able to run gfortran from the terminal

VISTA: Solved! See more below.

Programs Needed
I'll present an alternative setup for Windows Users now. For Explicit Download Links See Installation. Installation
These three tools will allow you to 1) compile fortran code, 2) access your command prompt window quickly, and 3) write/edit code gracefully.
  1. Download and Install GFortran for Windows
  2. Download and Install Command Window Here *XP Only On Vista see this here
  3. Download and Install Syn
Setting Your Path
This should be done automatically by the GFortran installation (if you go to Start->Run and type "cmd" then in the dos box type gfortran and hit enter, you should get "no input files" response, if not your path is not set up correctly). To correctly set your path read below:

Windows has a variable called PATH which is uses to search for programs like gfortran. This has been a common error some are receiving when using SciTE. It is still very useful to have programs in the PATH variable instead of needing to copy your programs to where gfortran resides as some have suggested. I will now iterate how to add to your path.
  1. Click Start
  2. Control Panel
  3. Dbl-Click System
  4. VISTA: Click Advanced System Properties on the left
  5. Click Advanced Tab
  6. Click Environmental Variables Button
  7. Click on PATH
  8. Click on Edit Button
  9. *Add a semi-colon ; and the path to the directory of gfortran.exe
  10. Click OK
  11. Click OK
  12. Click OK
screenshot of path setup
*If gfortran was installed correctly from the above package, you should already see "C:\Program Files\gfortran\bin" here.

You may also need to reboot before this will take effect.

Setting Up Syn
Syn can be setup to add a "Send To" link in your right-click menu. This is recommended. Now, you can open any f90 file in windows by right-clicking, going to send to, and selection Syn.

When a f90 file is opened in Syn it may not highlight text by default. To correct this, go to View->Syntax Schemes and select Fortran. You can also just name your files with .for or go to View->Options and under Editor->Syntax Highlight->Fortran add ",*.f90" at the end of "Filetypes"

Adding f90 to list

*Then Restart Syn

Getting Syn to Compile *You must complete the step above, before the configuration menu will become an option
  1. Go to Run Menu
  2. Go to Run File then Configure
  3. Click the ... next to Profile
  4. Click add and type Fortran as a name for the profile
  5. Click OK
  6. Click the Add Program Button
  7. Type in gfortran where it now says New Program
  8. Program: C:\Program Files\gfortran\bin\gfortran.exe
  9. Arguments: -fimplicit-none -W -Wall "$[ActiveDocLong]" -o "$[ActiveDocLongNoExt].exe"
  10. Directory: $[ActiveDocPathShort]
You can now hit F9 to compile your program. A command line box will pop-up displaying the result.

Syn Configuration Screen and Output Box

Running Your Program
Use windows explorer to go to the directory where your program is stored. Right-click on the directory and select "Open Command Window Here". *In Vista, You have to click the directory in the right-side pane while holding the shift key.* You should now have a dos prompt with your directory containing your newly created .exe file. Type in the name of your .exe file and hit return. Voila!

Using SciTE with GFortran and/or VISTA
For those unable to compile their programs within SciTE in Vista. Understand it's not that SciTE is broken, it's that it can't find the program to compile your fortran code.
  1. If you have MinGW uninstall it.
  2. Install GFortran for Windows
  3. Verify GFortran is part of your path: Start->Run and type "cmd" then in the dos box type gfortran and hit enter, you should get "no input files" response. If you get a command not found; set your path as explained above
  4. Download a new SciTE property file here (Right-Click->Save As...) overwriting the "" file in your SciTE directory. You should get a confirmation box for overwriting the file that exists there, click Yes.
  5. Restart SciTE
After that you should be all set to compile and run programs within SciTE or Syn on Windows XP or Vista using GFortran.

*If you have a French Edition of Windows VISTA: You'll need to download G95 here. Click "Yes" or "OK" for all the questions it asks during installation. You'll then need to update your property file in SciTE as above with this file here.

*If you get a "_spawnvp" error, reinstall gfortran


Date Information Files
Sept. 4th Course Introduction
Intro to Algorithms
Computer History
(pdf) (notes)
(pdf) (notes)
(pdf) (notes)
Sept. 6th Computer Structure
First Look At FORTRAN
(pdf) (notes)
(pdf) (notes)
Sept. 11th Cont. FORTRAN Introduction (See Sept. 6th)
Sept. 13th Expressions (pdf) (notes)
Sept. 18th Selection - If What? Then...
Characters and Strings
(pdf) (notes)
(pdf) (notes)
Sept. 20th All Loop Notes 06-08
Loops and Arrays Part 1 - Counted Loops and Arrays
(pdf) (notes)
Sept. 25th Loops and Arrays Part 2 - Indefinite Loops (pdf)
Sept. 27th Loops and Arrays Part 3 - Do While
Formatting Input & Output
(pdf) (notes)
(pdf) (notes)
Oct. 2nd Working with Files
Multi-dimensional Arrays
(pdf) (notes)
(pdf) (notes)
Oct. 4th Functions (pdf) (notes)
Oct. 9th NO CLASS - Monday Schedule (N/A)
Oct. 11th Subroutines (pdf) (notes)
Oct. 16th Matrices Recap
Midterm Review
Oct. 18th *MIDTERM* - See WebCT for Room Locations (N/A)
Oct. 23rd From Fortran To C - Part 1 (pdf) (notes)
Oct. 25th From Fortran To C - Part 2 (pdf) (notes)
Oct. 30th Pointers
pointer.c program
(pdf) (notes)
Nov. 1st Searching and Sorting (pdf) (notes)
Nov. 6th Recursion (pdf) (notes)
Nov. 8th Root Finding
Function Pointer Example Code
(pdf) (notes)
Nov. 13th Continue Root Finding
Initial Value Problems
(See Nov. 8th)
(pdf) (notes)
Nov. 15th Initial Value Problems (See Nov. 13th)
Nov. 20th Initial Value Problems p2 (pdf) (notes)
Nov. 22nd Integration
Integration Example Code
(pdf) (notes)
Nov. 27th At Conference - Attend Alternate Lecture N/A
Nov. 29th Linear Algebra
Matrix Example Code
Gaussian Example Code
(pdf) (notes)
Dec. 4th Last Class - Review
Malloc - Dynamic Array - Example Code
Dec. 19th EXAM in GYM
Loops Code Example

Page Last Updated: Thursday December 13th 18:56:44