def qsat(self,temp,pres,parameter):
gamw = (parameter.cl - parameter.cpv) / parameter.rv<EOL>betaw = (parameter.lvtt/parameter.rv) + (gamw * parameter.tt)<EOL>alpw = math.log(parameter.estt) + (betaw /parameter.tt) + (gamw * math.log(parameter.tt))<EOL>work2 = parameter.r/parameter.rv<EOL>foes_lst = [<NUM_LIT:0> for i in range(len(temp))]<EOL>work1_lst = [<NUM_LIT:0> for i in range(len(temp))]<EOL>qsat_lst = [<NUM_LIT:0> for i in range(len(temp))]<EOL>for i in range(len(temp)):<EOL><INDENT>foes_lst[i] = math.exp( alpw - betaw/temp[i] - gamw*math.log(temp[i])  )<EOL>work1_lst[i] = foes_lst[i]/pres[i]<EOL>qsat_lst[i] = work2*work1_lst[i] / (<NUM_LIT:1.> + (work2-<NUM_LIT:1.>) * work1_lst[i])<EOL><DEDENT>return qsat_lst<EOL>
Calculate (qsat_lst) vector of saturation humidity from:
    temp = vector of element layer temperatures
    pres = pressure (at current timestep).