Getting Started with FORTRAN @ MCSR

advertisement
Introduction to Fortran
Welcome to IT’s seminar on Fortran
Sam Gordji, ccsam@olemiss.edu
Weir 107
List of Statistical Packages
 SPSS
 SAS
 Mathematica
 MathWorks (Matlab)
General Information
 SAS performs statistical analysis
 SPSS also performs statistical analysis
and is similar to SAS
 Mathematica’s main function is to perform
mathematical operations including
statistics
 MathWorks is similar to Mathematica and
is available on willow and sweetgum
Statistical Package:
SAS/PC (cont.)





50 copies are available for faculty use
For each copy purchased, a faculty
member can get a free copy (to be
installed on a student PC)
The cost is $200 per copy per year
(starting Aug. 09)
To obtain a copy of SAS please email
– ccsam@olemiss.edu
– assist@mcsr.olemiss.edu
List of Statistical Packages
Mathematica
 A free copy is available for faculty, staff, and
students. To obtain a copy of Mathematica
please visit:
http://www.mcsr.olemiss.edu/appssubpage.
php?pagename=mathematica.inc
List of Statistical Packages
 Matlab is available on willow and
sweetgum
 Fortran is available on willow, mimosa,
redwood and sweetgum
 Fortran is the oldest program that solves
engineering problems
General Information
 Email contact
– Email your questions to assist@mcsr.olemiss.edu
 To download this and other materials visit:
http://www.mcsr.olemiss.edu/educationsubpage.php?
pagename=marcamp09.inc
 Please fill out the performance report and leave your
email address so we may contact you for follow up
questions
General Information
 This seminar covers Fortran on willow,
redwood and sweetgum
 We’ll take a look at a few short
examples of Fortran
 MCSR has several examples of Fortran
General Information
 IT staff will assist users to access these
packages. We also assist users to find the
proper procedure to analyze their data. If
you need assistance please send an email
to Sam Gordji at
assist@mcsr.olemiss.edu, or
ccsam@olemiss.edu
Accessing Fortran on Willow,
sweetgum or redwood
 To run a Fortran job on willow, redwood or
sweetgum enter:
F77 my.f, where “my.f” is the name of your
Fortran program
To obtain an account for willow contact
Helpdesk at: 915-5222
Accessing Fortran on Willow
Fortran on willow may be accessed from the
network.
Steps to access willow from a Windows PC:
– Request a willow account from the IT Helpdesk.
– Download/Install SSH Secure Shell Client from
http://www.mcsr.olemiss.edu/appssubpage.php?pagename=ssh2.inc
– Click “Secure Shell Client”
Accessing Fortran on Willow
(Cont.)
Click “Quick Connect”
Accessing Fortran on Willow
(Cont.)



For this workshop, everyone can login as student
Fill in “Host Name” and “User Name” as above
Click “Connect”


Accessing Fortran on Willow
(Cont.)
Enter your password
Click “OK”
Running Fortran on Willow

Willow is ready to execute Fortran jobs
– cd to the numbered directory assigned to
you, e.g. cd 5
– pwd to print working directory
– ls to list files in working directory
– To view a program, enter:
cat file-name.f
– To launch a Fortran program, enter:
f77 file-name.f
Running Fortran on Willow
 Creating or downloading a simple Fortran Program
 Running a few Fortran Programs on willow
(test.f,chen99.f, newton.f)
 Looking at some aspects of Fortran
 Running Fortran programs from sweetgum
 Running fortran example “rawls.f” from path: fortnon
A Few Useful Unix Commands










cat --- for displaying a file
cd --- change directory
cd 1--- to move to sub-directory 1 & so on
cp --- for copying files
ls --- see what files you have
pwd --- find out what directory you are in
rm --- remove a file
pico --- a Unix editor
F77 --- to compile a Fortran programs
To attend a Unix seminar, please contact
assist@mcsr.olemiss.edu
Example of test.f
 c
to run this program on willow enter: f77 test.f, which is the
name of this program. BLUE LINES ARE COMMENTS

x=1.0

w=4.*x

y=2.0

z=x+y
 c
open statement below creates an output file called 'output'.

open(6,file='output')

write(6,100)x,y,z,w
 c
write statement writes the values of x,w,y, and z.
 100 format(2x,4f10.2)

stop

end
Download