; NAME : kmem ; PURPOSE : ; return an array 'kmemarr' which contains a series of k-values as: ; the first valid data in rdata(*,*,kmemarr(0)) ; the second valid data in rdata(*,*,kmemarr(1)),,, ; the last valid data in rdata(*,*,kmemarr(nframe-1)) ; the rest is filled with -1, and the size of kmemarr is the ; same as the third dimension of rdata ; CATEGORY : ; solar magnetic field computation package (MAGPACK2) ; CALLING SEQUENCE : ; kmemarr = kmem ( mparam, rdata ) ; INPUTS : ; mparam, rdata ; OPTIONAL INPUT PARAMETERS : ; none ; KEYWORD PARAMETERS : ; none ; OUTPUTS : ; kmemarr (integer array) ; COMMON BLOCKS : none ; SIDE EFFECTS : none ; RESTRICTIONS : none ; PROCEDURE : ; ; MODIFICATION HISTORY : ; T.Sakurai, 1993 ; ;------------------------------------------------------------------------ ; function kmem, mparam, rdata ; specs = defspecs(nspec) ; get nspec dim = size (rdata) kmax = fix(dim(3)) -1 kmemarr=intarr(kmax+1)-1 km=-1 for k=0, kmax do begin for i=0, nspec-1 do begin if k eq mparam.status.(i) then begin km=km+1 kmemarr(km)=k goto, nextk endif endfor nextk: endfor if (km ne mparam.nframe -1) then begin print,'(func.kmem) nframe differs from the actual number of valid data in rdata' print,' nframe=',mparam.nframe, ' is reset to', km+1 mparam.nframe = km+1 endif return, kmemarr end