c...	spur_scan.inc
      real	xscan(maxnpts), yscan(maxnpts)
      real yscan_max, yscan_min, yscan_peak
      real xscan_max, xscan_min

      common /cb_scanplot/  xscan, yscan, 
     &      xscan_max, xscan_min, yscan_max, yscan_min, yscan_peak
     
c      integer nscan_bragg
c      real xspot(maxnpts)
c      real int_spot(maxnpts)	!! Bragg refection intensity
cOld      real yspot(maxnpts)	!! Bragg refection intensity
c      real espot(maxnpts)	!! Spurion energy at Bragg point
cTooFancy      integer colorspot(maxnpts)
cTooFancy      integer fillspot(maxnpts)
cTooFancy      character*1 labelspot(maxnpts)
c      integer ispot(maxnpts)
c      integer jspot(maxnpts)
c      integer scanpt_spot(maxnpts)

c      	ispot(i) *ki - jspot(i)*kf = q of ith higher order spurion which
c	matches a Bragg peak.
      integer ispot(n_spurbragg_max)
      integer jspot(n_spurbragg_max)
      integer rankspot(n_spurbragg_max)
      integer n_rankspot
      integer scanpt_spot(n_spurbragg_max)

c     ispur and jspir are the indices in the spurion arrays 
c	  esparr(ispur(i),jspur(i), iscan) = espur(ispur(i),jspur(i))
c	and 
c	  qsparr(1:2,ispur(i),jspur(i),iscan) = qspur(1:2,n_spur_max,n_spur_max)
c     of higher order spurions which hit (within tolerances) Bragg peaks.
c     Note: qsparr and qspur are the q values in the scattering plane,
c     which is why the first index is 2-D. 
      integer ispur(n_spurbragg_max)
      integer jspur(n_spurbragg_max)

c	These are the 3-D INTEGER (h,k,l) miller indices of the Bragg peaks 
c	which overlap with some of the the higher order spurions.
      integer hspur(n_spurbragg_max)
      integer kspur(n_spurbragg_max)
      integer lspur(n_spurbragg_max)
      
      common /cb_scanBragg/  ispot, jspot, rankspot, n_rankspot, 
     &      scanpt_spot, ispur, jspur, hspur, kspur, lspur

cOld      common /cb_scanBragg/ nscan_bragg, xspot, yspot, 
cOld     &      colorspot, fillspot, ispot, jspot, scanpt_spot, labelspot

c	ielst and jelst are the indices in the spurion arrays 
c	esparr/espur and qsparr/qspur
c	of spurions which hit(within tolerances) Bragg peaks,
c	AND are within the energy tolerance of zero
c	energy. E.g. is an elastic process.
c	These are not really needed.
      integer ielst(n_spurbragg_max)
      integer jelst(n_spurbragg_max)
      integer rankelst(n_spurbragg_max)
      integer scanpt_elst(n_spurbragg_max)
      integer n_rankelst
      common /cb_scanBragg_elst/ ielst, jelst, 
     &      rankelst, n_rankelst, scanpt_elst

c...	The exact zero crossings of the elastic spurions:
c...	(ii^2)Ei = (jj^2)Ef
      integer n_zeroelst
      real iscan_zerospur(n_spurbragg_max)	!! scan point "number"
      integer ii_zerospur(n_spurbragg_max)	!! which spurion
      integer jj_zerospur(n_spurbragg_max)
      common /cb_zero_elastic/  n_zeroelst, iscan_zerospur, 
     &		ii_zerospur, jj_zerospur
     
c...	For plot of higher order spurions.
     
      real yhispur(maxnpts)
      common /cb_scanHiSpur/ yhispur
     

      logical makescanplot
c      parameter (makescanplot = .false.)
      parameter (makescanplot = .true.)

      character*19 afloat_hkl_start(n_spur_max,n_spur_max)
      character*19 afloat_hkl_end(n_spur_max,n_spur_max)
      
      common /cb_qlabels/ afloat_hkl_start, afloat_hkl_end
      
c...	for Aluminum spurions
      integer hklal(3,nal)
      real gal(nal)
c	!! Draw Al Alewald spheres for iscan =al_iscan. If zero, do both 1,nscan
      integer draw_al_iscan
      logical alspur

      integer nal_match
c	Which of the  Al Alewald spheres intersect which scan pts.     
      integer iqal_ial(n_spurbragg_max)		!! Which Al q-value index 1-nal.
      integer iqal_iscan(n_spurbragg_max)	!! For which scan point.
ccc      integer iqal_color(n_spurbragg_max)	!! color code

      common /cb_alspurions/ hklal, gal, alspur, draw_al_iscan, 
     &	nal_match, iqal_ial, iqal_iscan
ccc     , iqal_color
      

      integer ispot_incmon(n_spurbragg_max)	!! Which Bragg spot
      integer jspot_incmon(n_spurbragg_max)
      integer rankincmon(n_spurbragg_max)
      integer n_rankincmon
      integer scanpt_incmon(n_spurbragg_max)
      character*10	lab_incmon(n_spurbragg_max)	!! label (h,k,l)

      common /cb_incmon/ ispot_incmon, jspot_incmon, 
     &      rankincmon, n_rankincmon, scanpt_incmon, lab_incmon
     
      integer ispot_incana(n_spurbragg_max)
      integer jspot_incana(n_spurbragg_max)
      integer rankincana(n_spurbragg_max)
      integer n_rankincana
      integer scanpt_incana(n_spurbragg_max)
      character*10	lab_incana(n_spurbragg_max)

      common /cb_incana/ ispot_incana, jspot_incana, 
     &      rankincana, n_rankincana, scanpt_incana, lab_incana  


      real angle4_store(maxnpts)
      logical A4_OK(maxnpts)
      logical angle4_varies
      common /cb_A4/ angle4_store, A4_OK, angle4_varies

c      logical A4_OK(maxnpts)
c      common /cb_A4_OK/ A4_OK

c	Grid imposed on lattice plot
      character*1 grid_style_cart		!!c: cartesian
      parameter (grid_style_cart = 'c')
      character*1 grid_style_orient		!!o:orientation vectors
      parameter (grid_style_orient = 'o')
      
      character*1 grid_style		!!c: cartesian, o:orientation vectors
      real	grid_size1, grid_size2	!! step size in rlu, for x/u, y/v
      common /cb_grid/ grid_size1, grid_size2, grid_style
