Fixed out-of-bounds read in Brunt vaisala calculation