Commit 5246a33e authored by Marc R.'s avatar Marc R.

metroutines: removed redundant method for computation of moist adiabatic lapse rate

parent 961196f0
......@@ -4,11 +4,13 @@
** three-dimensional visual exploration of numerical ensemble weather
** prediction data.
**
** Copyright 2015-2018 Marc Rautenhaus
** Copyright 2015-2018 Michael Kern
** Copyright 2015-2016 Christoph Heidelmann
** Copyright 2015-2019 Marc Rautenhaus [*, previously +]
** Copyright 2015-2018 Michael Kern [+]
**
** Computer Graphics and Visualization Group
** * Regional Computing Center, Visualization
** Universitaet Hamburg, Hamburg, Germany
**
** + Computer Graphics and Visualization Group
** Technische Universitaet Muenchen, Garching, Germany
**
** Met.3D is free software: you can redistribute it and/or modify
......@@ -702,34 +704,6 @@ double wetBulbPotentialTemperatureOfSaturatedAdiabat_K_MoisseevaStull(
}
float moistAdiabaticLapseRate_K(float T_K, float p_Pa)
{
float TC = T_K - 273.5f;
// Heat of vaporization of water.
float H_v = 1000.f * (2500.8f - 2.36f * TC + 0.0016f
* pow(TC, 2.f) - 0.00006f * pow(TC, 3.f));
// Specific gas constant of dry air.
float R_sd = 287.05f;
// Specific gas constant of water vapor.
float R_sw = 461.51f;
// The dimensionless ratio of the specific gas constant of dry air to the
// specific gas constant for water vapor.
float epsilon = R_sd / R_sw;
// The water vapor pressure of the saturated air.
float e = 6.112f * exp(17.67f * TC / (TC + 243.12f)) * 100.f;
// The mixing ratio of the mass of water vapor to the mass of dry air.
float r = epsilon * (e / (p_Pa - e));
// The specific heat of dry air at constant pressure.
float c_pd = 1004.6f;
float dividend = 1.f + (H_v * r) / ( R_sd * T_K);
float divisor = 1.f + (pow(H_v, 2.f) * r * epsilon)
/ ( c_pd * R_sd * pow(T_K, 2.f));
float tempv = T_K * (1.f + 0.6f * r);
float Rho = p_Pa / (R_sd * tempv);
return (dividend / divisor) / (c_pd * Rho);
}
// Test functions for meteorological computations.
namespace MetRoutinesTests
{
......
......@@ -4,11 +4,13 @@
** three-dimensional visual exploration of numerical ensemble weather
** prediction data.
**
** Copyright 2015-2018 Marc Rautenhaus
** Copyright 2015-2017 Michael Kern
** Copyright 2015-2016 Christoph Heidelmann
** Copyright 2015-2019 Marc Rautenhaus [*, previously +]
** Copyright 2015-2017 Michael Kern [+]
**
** Computer Graphics and Visualization Group
** * Regional Computing Center, Visualization
** Universitaet Hamburg, Hamburg, Germany
**
** + Computer Graphics and Visualization Group
** Technische Universitaet Muenchen, Garching, Germany
**
** Met.3D is free software: you can redistribute it and/or modify
......@@ -393,15 +395,6 @@ void runMetRoutinesTests();
}
/**
Calculates the moist adiabatic lapse rate. @see http://en.wikipedia.org/wiki/Lapse_rate
@p T is the temperature in K and @p p the pressure in Pascal.
@return moist adiabatic lapse rate in T(K).
*/
float moistAdiabaticLapseRate_K(float T_K, float p_Pa);
} // namespace Met3D
#endif // METROUTINES_H
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment