An algorithm for constructing certain differential operators in positive characteristic