We propose an algorithm of data compression for the purpose of effective output of multi-dimensional numerical simulation data with a huge number of mesh cells during simulation runs, supposed to use the compressed data including necessary and sufficient information in visualization or analyses after the simulations. This algorithm consists of classification or quantization of single or double precision real data at each mesh point and subsequent compression by using conventional compression algorithm. In the previous paper, we described detailed method of data compression, obtained the compression efficiency for several typical simulations and showed that this method gave good results for those simulations. However, our method was limited to the variables which have positive or negative definite sign such as density. In this paper, we extend this algorithm to all variables which have any signs such as velocity variables. We show that our proposed compression algorithm can attain as high compression efficiencies for the magnetic fields as our previous method. Furthermore we develop another version of our proposed algorithm in which is adopted for the second stage compression method as the next step. We perform test calculations of the compression efficiencies calculated by using this method for the same models as those in the previous paper and show that this compression method is also very useful as well as the previous one.