« previous next»

1.3    Coding in UNIX

    When writing code in UNIX you can use any of the text editors (emacs, vi & pico for instance) and write the program.  When complete, 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.

    An alternative is using Sun Workshop.   Those of you who like windows type applications with a nice GUI this is the one for you.  I am a novice in using Workshop and prefer the old UNIX way; so, I can offer little advice.  It allows you to creat programs, debug them,and build executables.  This program is invoked in UNIX by typing workshop &. More information can be found at http://www.ictp.trieste.it/~manuals/programming/sun/.  Found there are .html files introducing workshop and also a Fortran handbook (http://www.ictp.trieste.it/~manuals/programming/sun/fortran/user_guide/index.html) .

Practice: Open a text editor and write the following simple fortran program. Then save this in a file named code.f90.

PROGRAM joke
WRITE(*,*) "Hello world!"
END

« previous next»