program test use gnufor2 implicit none !*********************************************************************************** integer, parameter :: N1=50, N2=100, N3=200, N4=500, Nx=80, Ny=40, Nm=800 real(kind=8) :: x1(N1), x2(N2), x3(N3), x4(N4) real(kind=8) :: f1(N1), f2(N2), f3(N3), f4(N4) real(kind=8) :: u1(1000), u2(1000), u3(1000), t(1000) real(kind=8) :: xx(Nx), yy(Ny), zz(Nx,Ny), xyz(3,Nx,Ny), u(Nx), v(Nx) real(kind=4) :: z_fractal(Nm,Nm), x_fractal(Nm), y_fractal(Nm), & & xstart,ystart,xend,yend,zmax,escape,color_scale,z_power integer :: rgb(3,Nm,Nm) complex(kind=8) :: z, a integer :: i,j,k, N0 !*********************************************************************************** !*********************************************************************************** !*********************************************************************************** ! generate data for 2D plots do i=1,N1 x1(i)=5.0*i/N1 end do do i=1,N2 x2(i)=6.0*i/N2 end do do i=1,N3 x3(i)=7.0*i/N3 end do do i=1,N4 x4(i)=8.0*i/N4 end do f1=sin(2*x1) f2=4*x2/(1+x2**2) f3=4-x3 f4=exp(x4/3)-5 !*********************************************************************************** ! generate data for 3D plot of a curve do i=1,1000 t(i)=80.0*i/1000 end do u1=4*cos(t)-cos(5*t) u2=4*sin(t)-sin(5*t) u3=10*sin(t/7) !*********************************************************************************** ! generate data for surface plots do i=1,Nx xx(i)=6.0*(dble(i)/Nx-0.5) end do do i=1,Ny yy(i)=4.0*(dble(i)/Ny-0.5) end do do i=1,Nx do j=1,Ny zz(i,j)=1-exp(-(xx(i)-1)**2-yy(j)**2) end do end do !*********************************************************************************** ! generate data for surface plots do i=1,Nx u(i)=1.5*3.15*(dble(i)/Nx) end do do i=1,Ny v(i)=1.6*3.15*(dble(i)/Ny)+0.7 end do do i=1,Nx do j=1,Ny xyz(1,i,j)=(3+cos(v(j)))*cos(u(i)) xyz(2,i,j)=(3+cos(v(j)))*sin(u(i)) xyz(3,i,j)=sin(v(j)) xyz(1,i,j)=xyz(1,i,j)-0.5*xyz(2,i,j)-0.5*xyz(3,i,j) xyz(3,i,j)=xyz(2,i,j)-5*xyz(3,i,j) end do end do !*********************************************************************************** ! create date for fractal plot xstart=-2.0 xend=1.0 ystart=-1.5 yend=1.5 escape=0.85 z_power=2.0 color_scale=0.2 zmax=exp(log(10.0)*escape) N0=150 z_fractal=1.0 do i=1,Nm x_fractal(i)=(xstart+(xend-xstart)*(real(i-1)/(Nm-1))) do j=1,Nm y_fractal(j)=(ystart+(yend-ystart)*(real(j-1)/(Nm-1))) a=x_fractal(i)+y_fractal(j)*(0.0,1.0) z=a k=1 do while ((abs(z)