pro chniveaux, cmax, cmin, nlevels, ctype, levels
;
; Computation of contour levels
;
; Parameters:	Cmax	Highest contour to be drawn 		(input)
; 		Cmin	Lowest contour to be drawn (opt. if linear scaling)
;								(input)
;		nlevels	Number of contours to be drawn		(input)
;		Ctype	Scaling of contour levels 		(input)
;				(1 = linear, 2 = logarithmic base 10)
;		Levels	Array of contour levels			(output)
;
levels = fltarr(nlevels)
If(ctype eq 1.) then begin
	deltai = cmax/(nlevels-.5) ;	Interval between successive equidistant contours
	if(cmin ne 0.) then deltai = (cmax-cmin)/(nlevels-1.)
	levels = cmax-(nlevels-1.-findgen(nlevels))*deltai
endif else if(ctype eq 2.) then begin
	clmax = alog10(cmax) & clmin = alog10(cmin)
	deltai = (clmax-clmin)/(nlevels-1.)
	levels = 10.^(clmax - (nlevels-1.-findgen(nlevels))*deltai)
endif else begin
	Print,'Other nonlinear contour intervals not available'
endelse
end
