Theoretical study on tetragonal transition metal dinitrides from first principles calculations