animate_prg Program

program~~animate_prg~~UsesGraph program~animate_prg animate_prg module~kinds_mod kinds_mod module~kinds_mod->program~animate_prg module~plplotlib_mod plplotlib_mod module~kinds_mod->module~plplotlib_mod module~array_mod array_mod module~kinds_mod->module~array_mod module~text_mod text_mod module~kinds_mod->module~text_mod module~time_mod time_mod module~kinds_mod->module~time_mod module~plplotlib_mod->program~animate_prg module~array_mod->program~animate_prg module~array_mod->module~plplotlib_mod plplot plplot plplot->module~plplotlib_mod module~text_mod->module~plplotlib_mod module~time_mod->module~text_mod iso_fortran_env iso_fortran_env iso_fortran_env->module~text_mod iso_c_binding iso_c_binding iso_c_binding->module~time_mod
Help


Create a series of plots for an animation

Calls

program~~animate_prg~~CallsGraph program~animate_prg animate_prg proc~xylim xylim program~animate_prg->proc~xylim proc~subplot subplot program~animate_prg->proc~subplot proc~linspace linspace program~animate_prg->proc~linspace proc~ticks ticks program~animate_prg->proc~ticks proc~figure figure program~animate_prg->proc~figure proc~labels labels program~animate_prg->proc~labels proc~setup setup program~animate_prg->proc~setup interface~mixval mixval program~animate_prg->interface~mixval proc~show show program~animate_prg->proc~show proc~f f program~animate_prg->proc~f proc~plot plot program~animate_prg->proc~plot plwind plwind proc~xylim->plwind pladv pladv proc~subplot->pladv plvasp plvasp proc~subplot->plvasp plssub plssub proc~subplot->plssub plvpor plvpor proc~subplot->plvpor plvsta plvsta proc~subplot->plvsta plbox plbox proc~ticks->plbox proc~figure->pladv proc~figure->plssub plbop plbop proc~figure->plbop pleop pleop proc~figure->pleop pllab pllab proc~labels->pllab plsfnam plsfnam proc~setup->plsfnam plsetopt plsetopt proc~setup->plsetopt plsfam plsfam proc~setup->plsfam plfontld plfontld proc~setup->plfontld plinit plinit proc~setup->plinit plsdev plsdev proc~setup->plsdev plend plend proc~show->plend plline plline proc~plot->plline plptex plptex proc~plot->plptex plssym plssym proc~plot->plssym
Help

Source Code


Variables

Type AttributesNameInitial
real(kind=wp), dimension(:), allocatable:: x
real(kind=wp), dimension(:), allocatable:: y
real(kind=wp), dimension(:), allocatable:: t
integer :: N
integer :: M
integer :: i
integer :: k

Functions

pure function f(x, t) result(o)

Function for plot

Arguments

Type IntentOptional AttributesName
real(kind=wp), intent(in) :: x
real(kind=wp), intent(in) :: t

Return Value real(kind=wp)


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