program mandelbrot_simple implicit none complex c,z_ini,z integer pgopen,i,j,k,isymbol,n_gen real c_x_min,c_x_max,c_y_min,c_y_max,c_x,c_y,abs_z isymbol = -1 write (*,*) 'The program plot Mandelbrot set in a simple way.' write (*,*) z_ini = (0.0,0.0) if ( pgopen('/xwin') .le. 0 ) stop call pgpap(5.0,1.0) write (*,*) 'What is the numer of iteration for the mapping ?' read (*,*) n_gen c_x_min = -2.0 c_x_max = 0.5 c_y_min = -1.25 c_y_max = 1.25 call pgenv(c_x_min, c_x_max, c_y_min, c_y_max, 1, 0) do j=1,500 c_x = c_x_min + j*(c_x_max-c_x_min)/500 call pgbbuf do k=1,500 c_y = c_y_min + k*(c_y_max-c_y_min)/500 c = (1.0,0.0)*c_x + (0.0,1.0)*c_y z = z_ini do i=1,n_gen z = z*z + c abs_z = conjg(z)*z if (abs_z.gt.10e+10) then call pgpt(1,c_x,c_y,isymbol) exit endif end do end do call pgebuf end do call pgclos end