« previous | next» |
1.3 Coding in UNIX
When writing code in UNIX, you can use any of the text editors (like emacs, vi or pico) to write your program. When done, the program must be saved with a filename and an extension .f90, for instance if you write a program, with name my_code, you have to save that file as my_code.f90. This is important as .f implies fixed format file, while Fortran 90 files (.f90 files) are free format files.
When using a Mac (whose operating system is built on Unix), you should create your program using a text editor (like TextWrangler) and save it as a file with extension .f90.
Practice: Open a text editor and write the following simple Fortran program. Then save this in a file named code.f90.
PROGRAM hello
WRITE(*,*) "Hello world!"
END
Note: TextWrangler is available as a free download from Bare Bones Software.
A Mac-friendly distribution of the GNU Emacs text editor is also available from here. You can also use Apple's TextEdit. It comes as part of Mac OS, but lacks many of the features that make textWrangler or Emacs better for coding.
« previous | next» |