Some additional information for the final.

 

Please send only one fortran source code file which will output 9 different text files which will contain the output for each case.

 

Assuming the student id is 123456789, then the Fortran source code file name should be 

 

                        123456789_final.f 

 

(or f95 or f90, or any other valid fortran extension).

 

If you wish to do the extra credit part, please send that in a completely separate Fortran source code, which will also generate 9 separate text files for the output. The name of this source code should be 

123456789_final_extra.f

 

(or f95 etc…)

 

Now for the output files:

 

For each case you will generate 3 separate text files. (one file for the solution at t=0, the second file is the solution when t=15 minutes, the 3rd file for the solutionwhen t=30 minutes.)

 

For the explicit case, the files should be named:

 

       exp0.txt

       exp15.txt

       exp30.txt

 

For the implicit case, the files should be named:

 

       imp0.txt

       imp15.txt

       imp30.txt

 

For crank-Nicholson the files should be named:

 

      cr0.txt

      cr15.txt

      cr30.txt

 

The format of each file should be 2 columns (tab or space separated).

The first column is the x value, and the second column is the c value (i.e the solution of the concentration at that x)

 

Now for the report:

 

Please include the 9 plots, title each plot for each case using the same name as the file name used above for ease of matching.

 

So the first plot will be titled ‘exp0’, the second will be titled ‘exp15’, etc… If you do not know how to use plot titles, just type the name below the plot using MSword. But please also include the CPU time used for that case, and the delta time you used and the delta x.

 

All These should be below the plot or in the title (better) of the plot for each case.

 

Make sure you label your plots and include the correct units in the labels.

 

If you do not know how to do these in Matlab, just do help in matlab for the commands

 

title

xlabel

ylabel

 

To format numbers into the title, use sprintf in Matlab.

 

For example to title the plot for test case exp0, cpu=0.0001, deltax=0.01, you type in Matlab

 

title(sprintf('case exp0, CPU= %f, deltax=%f',0.0001,0.01))

 

On the code itself:

  1. To help yourself find more errors, use IMPLICIT NONE in the main program and in any function or subroutine you use.
  2. If you are using GNU Fortran compiler, use the flag –Wall which will help you catch many warnings in your code, this will help you produce a more robust and cleaner program.
  3. Try to indent your code well for ease of reading.
  4. Please try to avoid the use of GOTO in place of Do loops and anything else.

 

 

 

Hello everyone;

Some additional information for the final.

Please send only one Fortran source code file which will output 9
different text files which will contain the outputs of all the 9 test
cases.

Assuming the student id is 123456789, then the Fortran source code file
name should be
                123456789_final.f

(or .f95 or .f90, or any other valid Fortran extension).

If you wish to do the extra credit part, please send that in a completely
separate Fortran source code, which will also generate 9 separate text
files for the output using the same convention explained below).

The name of this source code should be

                123456789_final_extra.f

(or .f95 etc.)

Now for the output files:

For each case you will generate 3 separate text files. (one file for the
solution at t=0, the second file is the solution at t=15 minutes, the 3rd
file for the solution at t=30 minutes.)

For the explicit case, the files should be named:

       exp0.txt
       exp15.txt
       exp30.txt

For the implicit case, the files should be named:

       imp0.txt
       imp15.txt
       imp30.txt

For crank-Nicholson the files should be named:

      cr0.txt
      cr15.txt
      cr30.txt

Now for the report:

Include the 9 plots, title each plot with the case the same name as the
file name above for easy of matching. So first plot will be titled 'exp0',
the second will be titled 'exp15', etc. If you do not know how to use plot
titles, just type the name below the plot in word. But please also include
the CPU time used for that case, and the delta time you used and the delta
x. All below the plot or in the title (better) of the plot.

Make sure you label your plots and include the correct units in the
labels. If you do not know how to do these in Matlab, feel free to ask or
just do help in matlab for the command

title
xlabel
ylabel

To format numbers into the title, use sprintf in Matlab.


For example to title the plot for test case exp0, cpu=0.0001, deltax=0.01,
you type in Matlab

title(sprintf('case exp0, CPU= %f, deltax=%f',0.0001,0.01))

Add any other discussion, comments, etc... you wish in the report.

On the code itself:
1. To help yourself find more errors, use IMPLICIT NONE in the main
program and in any functions or procedure you use.

2. If you are using GNU Fortran compiler, use the flag -Wall which will
help you catch many warnings in your code, this will help you produce more
clean code.

3. Try to indent your code well for ease of writing.

4. Please try to avoid the use of GOTO in place of Do loops and anything
else.

If there is anything you are not clear about, just feel free to send email
and ask.

And finally, try to have fun when you are working on this.

Nasser