% t=t(:);P=P(:);rh=rh(:);
% es=6.1121.*exp(17.502.*t./(t+240.97)).*(1.0007+3.46e-6.*P);
% em=0.01*rh.*es;
% q1=622*em./(P-0.378*em);
% function A=shumi(t,P,rh)
% EM=qsat26air(t,P,rh);
% A=EM;
% end
% function exx=bucksat(T,P)
% % computes saturation vapor pressure [mb]
% % given T [degC] and P [mb]
% exx=6.1121.*exp(17.502.*T./(T+240.97)).*(1.0007+3.46e-6.*P);
% end
% %------------------------------------------------------------------------------
%
% function em=qsat26air(T,P,rh)
% % computes saturation specific humidity [g/kg]
% % given T [degC] and P [mb]
% es=bucksat(T,P);
% em=0.01*rh.*es;
% q=622*em./(P-0.378*em);
% end
%%有比湿的算法
% function exx=bucksat(T,P)
% % computes saturation vapor pressure [mb]
% % given T [degC] and P [mb]
% exx=6.1121.*exp(17.502.*T./(T+240.97)).*(1.0007+3.46e-6.*P);
% end
% function [q,em]=qsat26air(T,P,rh)
% computes saturation specific humidity [g/kg]饱和比湿
% given T [degC] and P [mb]
% es=bucksat(T,P); %饱和水气压
% em=0.01*rh.*es; %水气压
% q=622*em./(P-0.378*em);%比湿
q=shum;q=q(:);P=P(:);%比湿,单位为g/kg
em=P./(622./q+0.738);%水气压
%
% end