doError Subroutine

subroutine doError()

Arguments

None

Description

error

Calls

proc~~doerror~~CallsGraph proc~doerror doError proc~plot plot proc~doerror->proc~plot proc~ticks ticks proc~doerror->proc~ticks proc~xylim xylim proc~doerror->proc~xylim proc~labels labels proc~doerror->proc~labels proc~linspace linspace proc~doerror->proc~linspace interface~mixval mixval proc~doerror->interface~mixval proc~errorbar errorbar proc~doerror->proc~errorbar proc~figure figure proc~doerror->proc~figure proc~subplot subplot proc~doerror->proc~subplot plline plline proc~plot->plline plssym plssym proc~plot->plssym plptex plptex proc~plot->plptex plbox plbox proc~ticks->plbox plwind plwind proc~xylim->plwind pllab pllab proc~labels->pllab plerry plerry proc~errorbar->plerry plerrx plerrx proc~errorbar->plerrx pleop pleop proc~figure->pleop plbop plbop proc~figure->plbop pladv pladv proc~figure->pladv plssub plssub proc~figure->plssub proc~subplot->pladv proc~subplot->plssub plvasp plvasp proc~subplot->plvasp plvsta plvsta proc~subplot->plvsta plvpor plvpor proc~subplot->plvpor
Help

Called By

proc~~doerror~~CalledByGraph proc~doerror doError program~examples_prg examples_prg program~examples_prg->proc~doerror
Help

Variables

TypeVisibility AttributesNameInitial
integer, public, parameter:: N =25
real(kind=wp), public, dimension(N):: x
real(kind=wp), public, dimension(N):: y
real(kind=wp), public, dimension(N):: xe
real(kind=wp), public, dimension(N):: ye
real(kind=wp), public, dimension(12):: r
real(kind=wp), public :: m
real(kind=wp), public :: s
integer, public :: k

Source Code

	subroutine doError
		!! ![error](|media|/example-10.svg)
		
		integer,parameter::N = 25
		real(wp),dimension(N)::x,y,xe,ye
		real(wp),dimension(12)::r
		real(wp)::m,s
		integer::k
		
		x = linspace(0.0_wp,5.0_wp,N)
		y = 1.0_wp/(x**2+1.0_wp)
		
		do k=1,N
			call random_number(r)
			r = 0.25_wp*(2.0_wp*r-1.0_wp)
			m = sum(r)/real(size(r))
			s = sqrt(sum((r-m)**2)/real(size(r)-1))
			x(k) = x(k)+m
			xe(k) = s
			
			call random_number(r)
			r = 0.15_wp*(2.0_wp*r-1.0_wp)
			m = sum(r)/real(size(r))
			s = sqrt(sum((r-m)**2)/real(size(r)-1))
			y(k) = y(k)+m
			ye(k) = s
		end do
		
		call figure()
		call subplot(1,1,1)
		call xylim(mixval([x-xe,x+xe])+[-0.5_wp,0.5_wp],mixval([y-ye,y+ye])+[-0.2_wp,0.2_wp])
		call errorbar(x,y,xerr=xe,yerr=ye,lineColor='b',lineWidth=1.0_wp)
		call plot(x,y,lineStyle='',markStyle='s',markColor='r',markSize=1.5_wp)
		call ticks()
		call labels('x','y','')
	end subroutine doError