surface Subroutine

public subroutine surface(x, y, z, N, lineStyle)

Arguments

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

x-coordinates of data

real(kind=wp), intent(in), dimension(:):: y

y-coordinates of data

real(kind=wp), intent(in), dimension(:,:):: z

Data for contouring

integer, intent(in), optional :: N

Number of levels to use in surface colors

character(len=*), intent(in), optional :: lineStyle

Style for xy lines ( '-' = on, '' = off )

Description

Plot a 3d surface

Calls

proc~~surface~~CallsGraph proc~surface surface proc~linspace linspace proc~surface->proc~linspace plsurf3d plsurf3d proc~surface->plsurf3d
Help

Called By

proc~~surface~~CalledByGraph proc~surface surface proc~dosurface doSurface proc~dosurface->proc~surface program~examples_prg examples_prg program~examples_prg->proc~dosurface
Help

Variables

TypeVisibility AttributesNameInitial
real(kind=pp), public, dimension(:), allocatable:: xl
real(kind=pp), public, dimension(:), allocatable:: yl
real(kind=pp), public, dimension(:,:), allocatable:: zl
real(kind=pp), public, dimension(:), allocatable:: edge
integer, public :: Nl
integer, public :: opt

Source Code

	subroutine surface(x,y,z,N,lineStyle)
		!! Plot a 3d surface
		real(wp),dimension(:),intent(in)::x
			!! x-coordinates of data
		real(wp),dimension(:),intent(in)::y
			!! y-coordinates of data
		real(wp),dimension(:,:),intent(in)::z
			!! Data for contouring
		integer,intent(in),optional::N
			!! Number of levels to use in surface colors
		character(*),intent(in),optional::lineStyle
			!! Style for xy lines ( '-' = on, '' = off )
		
		real(pp),dimension(:),allocatable::xl,yl
		real(pp),dimension(:,:),allocatable::zl
		
		real(pp),dimension(:),allocatable::edge
		integer::Nl,opt
		
		opt = MAG_COLOR
		
		xl = localize(x)
		yl = localize(y)
		zl = localize(z)
		Nl = 20
		if(present(N)) then
			Nl = N
			opt = ior(opt,SURF_CONT)
		end if
		edge = localize(linspace(minval(z),maxval(z),Nl))
		
		if(present(lineStyle)) then
			select case(lineStyle)
			case('')
				opt = opt
			case('-')
				opt = ior(opt,FACETED)
			end select
		end if
		
		call plsurf3d(xl,yl,zl,opt,edge)
		call resetPen()
	end subroutine surface