In algebraic geometry, a number of invariants for classifying algebraic varieties are obtained from the cohomology groups of coherent sheaves. Some typical algorithms to compute the dimensions of the cohomology groups have been proposed by Decker and Eisenbud, and their algorithms have been implemented over compute algebra systems such as Macaulay2 and Magma. On the other hand, Maruyama showed an alternative method to compute the dimensions in his textbook; we call the method Maruyama’s method in this paper. However, Maruyama’s method was not described in an algorithmic format, and it has not been implemented yet. In this paper, we give an explicit algorithm of his method to compute the dimensions and bases of the cohomology groups of coherent sheaves. We also analyze the complexity of our algorithm, and implemented it over Magma. By our implementation, we examine the computational practicality of our algorithm. Moreover, we give some possible applications of our algorithm in algebraic geometry over fields of positive characteristics.