In order to run fortran codes with mpi there are a few instructions you will need to follow first.

1. First, ssh onto a parallel machine (either b5,b6, or kings) by typing in your terminal "ssh b5"

2. You first need to have a background multiprocessing daemon (mpd) running before you can use mpi

    - to do this you need a ".mpd.conf" file in your home directory. here is how you do this
    - in your home directory, create a file called .mpd.conf  (note the . in front of mpd) and add a secret word
       to your file:
                   MPD_SECRETWORD= secretword
    - you can make your secret word anything you like
    - save the file
    - change the permissions on this file by typing
 
       chmod 600 .mpd.conf

    - now run the mpd in the background by typing "mpd &" and hopefully you won't have any errors
        (if you do get an error, it should give you instructions about mpd)
3. Now cd into the directory where you have saved your .f90 files
4. Compile the fortran code and create an executable with the command:

       mpif90 -o hello hello.f90

NOTE: If you get an error about not finding the correct files, this means the path set to find the correct mpi files
             is not set correctly. Open your .cshrc file (with any text editor) and add the following line:

             alias mpif90 /usr/local/bin/mpif90

             Save your new .cshrc file and type "source .cshrc"

             If you don't want to modify the .cshrc file, you can just use the path each time you compile like this:

             usr/local/bin/mpif90 -o hello hello.f90
5. Run the executable with a specified number of processors by entering an integer after the -np (number procs)
    with the command:

       mpirun -np 4 ./hello
6. you should see the code's output on the screen. if you want to output to a file, type
   
       mpirun -np 4 ./hello > output.txt

This should be enough to get started. Good luck!!!