class4f - PHYS 5900 Class 4 (9/02/2011) In[1]:= ?EulerGamma...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
PHYS 5900 Class 4 (9/02/2011) In[1]:= ?EulerGamma EulerGamma is Euler’s constant g , with numerical value > 0.577216. à In[2]:= N @ Sum @ 1 ê k, 8 k, 1, m <D - Log @ m DD ê . m Ø 1000 Out[2]= 0.577716 0.577716 Programming with Fortran: N A/ k = 1 m 1 k - Log @ m DE ê . m Ø 1000 Steps to take on Mac (the gfortran compiler is installed on the Mac machines) : 1) open a Terminal window, you can use cmd( Ì ) +space to evoke Spotlight or click the Spotlight icon at the upper-right corner of the screen; type Terminal ; select the proper item; 2) write a Fortran program (e.g., filename.f) with an editor (for example: TextEdit on Mac, WordPad on Windows); 3) inside Terminal on Mac (or DOS command window on Windows), type gfortran filename.f to compile and link the program to generate the executable file a.out (or a.exe on Windows PC); 4) ./ a.out (or ./ a or ./ a.exe on Windows) to execute the program and get results. or:
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
3) gfortran -o exec_name filename.f 4) ./ exec_name Save your Fortran file with .f at the end as the extension name (e.g., filename.f); you can use filename .f90 for a Fortran90 program. Some other extension names such as .F or
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/21/2012 for the course PHYS 6720 taught by Professor Hu during the Spring '10 term at East Carolina University .

Page1 / 5

class4f - PHYS 5900 Class 4 (9/02/2011) In[1]:= ?EulerGamma...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online