; NAME : kloc ; PURPOSE : ; find the location of data on the memory ; CATEGORY : ; solar magnetic field computation package (MAGPACK2) ; CALLING SEQUENCE : ; k = kloc( mparam ) ; INPUTS : ; mparam ; OPTIONAL INPUT PARAMETERS : ; none ; KEYWORD PARAMETERS : ; specify data specification string as /i, /x, etc. ; for potential fiels, use /px rather than /xp ; OUTPUTS : ; k = location indicator : specified data are in rdata(*,*,k) ; COMMON BLOCKS : none ; SIDE EFFECTS : none ; RESTRICTIONS : none ; PROCEDURE : ; ; MODIFICATION HISTORY : ; T.Sakurai, 1992 ; ;------------------------------------------------------------------------ ; function kloc, mparam, $ i=i, q=q, u=u, v=v, d=d, $ x=x, y=y, z=z, px=px, py=py, pz=pz, $ j=j, f=f ; if keyword_set(i) then begin sp1 = 'I' & n1=1 sp2 = ' ' & n2=1 sp3 = ' ' & n3=1 endif if keyword_set(q) then begin sp1 = 'Q' & n1=1 sp2 = 'Q/I' & n2=3 sp3 = ' ' & n3=1 endif if keyword_set(u) then begin sp1 = 'U' & n1=1 sp2 = 'U/I' & n2=3 sp3 = ' ' & n3=1 endif if keyword_set(v) then begin sp1 = 'V' & n1=1 sp2 = 'V/I' & n2=3 sp3 = ' ' & n3=1 endif if keyword_set(x) then begin sp1 = 'BX' & n1=2 sp2 = 'BHX' & n2=3 sp3 = 'BF' & n3=2 endif if keyword_set(y) then begin sp1 = 'BY' & n1=2 sp2 = 'BHY' & n2=3 sp3 = 'BT' & n3=2 endif if keyword_set(z) then begin sp1 = 'BL' & n1=2 sp2 = 'BN' & n2=2 sp3 = 'BR' & n3=2 endif if keyword_set(px) then begin sp1 = 'BXP' & n1=3 sp2 = 'BHXP' & n2=4 sp3 = 'BFP' & n3=3 endif if keyword_set(py) then begin sp1 = 'BYP' & n1=3 sp2 = 'BHYP' & n2=4 sp3 = 'BTP' & n3=3 endif if keyword_set(pz) then begin sp1 = 'BLP' & n1=3 sp2 = 'BNP' & n2=3 sp3 = 'BRP' & n3=3 endif if keyword_set(d) then begin sp1 = 'VL' & n1=2 sp2 = 'VN' & n2=2 sp3 = 'VR' & n3=2 endif if keyword_set(j) then begin sp1 = 'JL' & n1=2 sp2 = 'JN' & n2=2 sp3 = 'JR' & n3=2 endif if keyword_set(f) then begin sp1 = 'FL' & n1=2 sp2 = 'FN' & n2=2 sp3 = 'FR' & n3=2 endif kloc1 = -1 specs = defspecs(nspec) for i=0, nspec-1 do begin k = mparam.status.(i) if k ne -1 then begin spec = specs(i) if strmid(spec,0,n1) eq sp1 or $ strmid(spec,0,n2) eq sp2 or $ strmid(spec,0,n3) eq sp3 then $ kloc1 = k endif endfor return, kloc1 end