%  function MSE = calc_MSE(Ts,Ta)
%
% Computes moist static energy at low level 
% (Pa = 750mb is imposed, geopotential set to zero)

   function MSE = calc_MSE(Ts,Ta)
   
       
     % Read Parameter
     TwoBox_Param;
    
     % Computes (low level) specific humidity 
     Pa = 750; %low level pressure (mb)
     RHa = 0.6; %relative humidity at Pa
     [Esat,Qsat] = Clausius_Clapeyron((Ts+Ta)/2,Pa);
     Qa = RHa * Qsat; %in kg/kg
   
     % MSE
     MSE = LV*Qa + CPA*(Ts+Ta)/2;