C This software FPP_TEST.FPP is part of the Visual Fortran kit.
C
C This software is provided as an example that demonstrates a particular
C feature/function of the licensed product. The software is not intended to
C provide a complete solution to any application problem but rather is provided
C as a teaching mechanism.
C
C Users may incorporate any part of this sample into their own source after 
C making appropriate changes to make it suitable for the intended application.
C

#include "fppdemo.fi"

	integer*4 ret_value
	real*8	  cr
	real*8    ci
	real*8    z0r
	real*8    z0i
	integer*4 cutoff

 100	format (A, I4, ' = mandelbrot(', I4, ', ', F5.2, ', ', F5.2, 
     x  ', ', F5.2, ', ', F5.2, ')')
	
#ifdef TEST1
C	Test 1
	cutoff = 128
	cr     = 0.0
	ci     = 0.0
	z0r    = 0.0
	z0i    = 0.0
	ret_value = mandelbrot_d(cutoff, cr, ci, z0r, z0i)
	write(*, 100) 'Test 1:', ret_value, cutoff, cr, ci, z0r, z0i
#elif defined (TEST2) || (defined(TEST1) && defined(TEST2))
C	Test 2
	cutoff = 256
	cr     = 2.0
	ci     = 2.0
	z0r    = 0.0
	z0i    = 0.0
	ret_value = mandelbrot_d(cutoff, cr, ci, z0r, z0i)
	write(*, 100) 'Test 2:', ret_value, cutoff, cr, ci, z0r, z0i
#elif TEST3 == 1
C	Test 3
C 	Note -DTEST3 on command line defines TEST3 and sets to 1
	cutoff = 512
	cr     = -1.09
	ci     = -0.46
	z0r    = 0.0
	z0i    = 0.0
	ret_value = mandelbrot_d(cutoff, cr, ci, z0r, z0i)
	write(*, 100) 'Test 3:', ret_value, cutoff, cr, ci, z0r, z0i
#else
#ifdef TEST4
C	Test 4
	cutoff = 1024
	cr     = -2.0
	ci     = 1.0
	z0r    = 0.0
	z0i    = 0.0
	ret_value = mandelbrot_d(cutoff, cr, ci, z0r, z0i)
	write(*, 100) 'Test 4:', ret_value, cutoff, cr, ci, z0r, z0i

#else
#ifdef TEST5
C	Test 5
	cutoff = 2048
	cr     = -1.5
	ci     = 0.0
	z0r    = 0.0
	z0i    = 0.0
	ret_value = mandelbrot_d(cutoff, cr, ci, z0r, z0i)
	write(*, 100) 'Test 5:', ret_value, cutoff, cr, ci, z0r, z0i

#endif
#endif
#endif 
	stop
	end











