; NAME : newk ; PURPOSE : ; find the smallest value of k for which rdata(*,*,k) can be used ; to store data ; CATEGORY : ; solar magnetic field computation package (MAGPACK2) ; CALLING SEQUENCE : ; k = newk ( mparam, rdata ) ; INPUTS : ; mparam, rdata ; OPTIONAL INPUT PARAMETERS : ; none ; KEYWORD PARAMETERS : ; none ; OUTPUTS : ; k (integer) ; COMMON BLOCKS : none ; SIDE EFFECTS : none ; RESTRICTIONS : none ; PROCEDURE : ; ; MODIFICATION HISTORY : ; T.Sakurai, 1992 ; ;------------------------------------------------------------------------ ; function newk, mparam, rdata ; specs = defspecs(nspec) dim = size (rdata) kmax = fix(dim(3)) -1 for k=0, kmax do begin for i=0, nspec-1 do begin if k eq mparam.status.(i) then goto, occupied endfor return, k occupied: endfor print, 'no space available (func.newk)' return, -1 end