function [o, oc] = GetASPMPOutputClone(tc, pc)
'sleeping 1 sec'
pause(1)
o = calllib('ASPMP64', 'AllocateOutputASPMP', tc, pc);
oc = get(o, 'value');
'sleeping 1 sec: b'
pause(1)
nRange = tc.nRange;
nTime = tc.nTime;
setdatatype(oc.slowSemb, 'doublePtr', oc.nSlowSemb, 1);
setdatatype(oc.timeSemb, 'doublePtr', oc.nTimeSemb, 1);
setdatatype(oc.rawCoherenceMap2D, 'doublePtr', 4*oc.nSlowSemb*oc.nTimeSemb, 1);
setdatatype(oc.finCoherenceMap2D, 'doublePtr', 4*oc.nSlowSemb*oc.nTimeSemb, 1);
setdatatype(oc.finBeamMap2D, 'doublePtr', 4*oc.nSlowSemb*oc.nTimeSemb, 1);
setdatatype(oc.finSNRMap2D, 'doublePtr', 4*oc.nSlowSemb*oc.nTimeSemb, 1);
setdatatype(oc.waves, 'doublePtr', nRange*nTime, 1);
sprintf('nRange, nTime = %d %d', nRange, nTime);
'sleeping 1 sec: c'
pause(1)
setdatatype(oc.wavesInstAmp, 'doublePtr', nRange*nTime, 1);
setdatatype(oc.wavesInstFreq, 'doublePtr', nRange*nTime, 1);
setdatatype(oc.wavesMaxCoh, 'doublePtr', nRange*nTime, 1);
setdatatype(oc.wavesOptSlow, 'doublePtr', nRange*nTime, 1);
setdatatype(oc.wave, 'doublePtr', nTime, 1);
setdatatype(oc.waveEnv, 'doublePtr', nTime, 1);
setdatatype(oc.detector, 'doublePtr', nTime, 1);
setdatatype(oc.shortTermAve, 'doublePtr', nTime, 1);
setdatatype(oc.longTermAve, 'doublePtr', nTime, 1);
setdatatype(oc.timeWinBeg, 'doublePtr', 4, 1);
setdatatype(oc.timeWinEnd, 'doublePtr', 4, 1);
setdatatype(oc.slowWinBeg, 'doublePtr', 4, 1);
setdatatype(oc.slowWinEnd, 'doublePtr', 4, 1);
setdatatype(oc.timePicksObserved, 'doublePtr', nRange, 1);
setdatatype(oc.timePicksQuality, 'doublePtr', nRange, 1);
setdatatype(oc.timePicksEstimated, 'doublePtr', nRange, 1);
'sleeping 1 sec: d'
pause(1)
setdatatype(oc.variableDensityLayerRaw1D, 'doublePtr', 4*oc.nSlowSemb, 1);
setdatatype(oc.variableDensityLayerFin1D, 'doublePtr', 4*oc.nSlowSemb, 1);
setdatatype(oc.variableDensityLayerRaw1DUpSampled, 'doublePtr', 4*oc.nSlowSembUpSampled, 1);
setdatatype(oc.variableDensityLayerFin1DUpSampled, 'doublePtr', 4*oc.nSlowSembUpSampled, 1);
sprintf('nSlowSemb = %d', oc.nSlowSemb);
sprintf('nSlowSembUpSampled = %d', oc.nSlowSembUpSampled);
'sleeping 1 sec: d2'
pause(1)
setdatatype(oc.slowPicks,'doublePtr', 2, 1);
setdatatype(oc.slowPosErrorPicks,'doublePtr', 2, 1);
setdatatype(oc.slowNegErrorPicks,'doublePtr', 2, 1);