animate.f90 Source File

This File Depends On

sourcefile~~animate.f90~~EfferentGraph sourcefile~animate.f90 animate.f90 sourcefile~array.f90 array.f90 sourcefile~array.f90->sourcefile~animate.f90 sourcefile~plplotlib.f90 plplotlib.f90 sourcefile~array.f90->sourcefile~plplotlib.f90 sourcefile~plplotlib.f90->sourcefile~animate.f90 sourcefile~kinds.f90 kinds.f90 sourcefile~kinds.f90->sourcefile~animate.f90 sourcefile~kinds.f90->sourcefile~array.f90 sourcefile~kinds.f90->sourcefile~plplotlib.f90 sourcefile~text.f90 text.f90 sourcefile~kinds.f90->sourcefile~text.f90 sourcefile~time.f90 time.f90 sourcefile~kinds.f90->sourcefile~time.f90 sourcefile~text.f90->sourcefile~plplotlib.f90 sourcefile~time.f90->sourcefile~text.f90
Help

Source Code


Source Code

program animate_prg
	!! Create a series of plots for an animation
	use kinds_mod
	use array_mod
	use plplotlib_mod
	implicit none
	
	real(wp),dimension(:),allocatable::x,y,t
	integer::N,M,i,k
	
	N = 100
	M = 1000
	
	x = linspace(0.0_wp,PI,N)
	t = linspace(0.0_wp,10.0_wp,M)
	
	call setup()
	do k=1,M
		y = [( f(x(i),t(k)) , i=1,N )]
		call figure()
		call subplot(1,1,1)
		call xylim(mixval(x),[-1.1_wp,1.1_wp])
		call plot(x,y,lineColor='b',lineWidth=2.0_wp)
		call ticks()
		call labels('x','y','')
	end do
	call show()

contains

	pure function f(x,t) result(o)
		!! Function for plot
		real(wp),intent(in)::x,t
		real(wp)::o

		o = sin(t)*cos(x+t)
	end function f

end program animate_prg