Solution for exercise 06

Task 1 - PGPLOT

The following PROGRAM draws a point using PGPLOT:

demo1.f

The corresponding Makefile (includes the Path to the PGPLOT libray):

Makefile

Note that is necessary to specify the environment variable PGPLOT_DIR (Path to the PGPLOT libraries) in your .profile or similar. For the execution of demo1 it is also necessay to add this path to the environment variable LD_LIBRARY_PATH.

Task 2 - Mandelbrot set

  1. A solution can be found here:
    mandelbrot.f

  2. Two nested DO loops will be needed to scan for lines/row (outer loop) and columns (inner loop). A third (most inner) loop is needed to calculate the iterative sequence $\{z_n\}$.

  3. The data type COMPLEX can be declared and initialized as follows:
               complex :: c, z
               ...
             ! initialize the sequence z_k
               z = cmplx(0., 0.)
               c = cmplx(reel, imag)