SUBROUTINE calcul(n, array) $$INCLUDE 'C$INC:BCS.INC' $$INCLUDE 'YBOS$LIBRARY:ERRCOD.INC' INTEGER n ! size of array REAL array(n) ! array to be processed INTEGER wbank ! YBOS work bank creator INTEGER wdrop ! YBOS work bank dropper !<----- INTEGER windex ! work bank index INTEGER status ! error return status C................................. IF(n .LE. 0) RETURN ! nothing to do C== The sorting routine needs a work space equal to half the array C== length, so status = wbank(iw, windex, 1+n/2) IF(status .NE. yesucc) RETURN ! defeated CALL sortr(n, array, iw(windex+1)) status = wdrop(iw, windex, 1) ! <---------- RETURN END
The routine originally allocated a peice of the high YBOS array devoted to work banks, and then never got around to releasing it. Do this often enough in an event and you'll run out of room. (like a memory leak)