modified a calculation of local_num_block_rows(/cols) without using if sentence