close outputstream after simulation and saves trace data in .trc file