To use totalview, first load the totalview module (module load totalview). For both serial code and parallel code, compile your code with the -g, option.
module load intel ompi/intel totalview
mpif90 -g my.f90
mpirun -np 4 -tv ./a.out
mpirun -np 4 -tv ./a.out -a < input > output
After the GUI appears, click the "Go" button. Next select "Do not ask this question again" and click "No" on the newly appeared small window. Then click yes in the following one. This procedure will lead you to the code contents. For debugging serial and OpenMP jobs, see the procedures described below for the Lab machines.