I'm trying to display cloud cover info by altitude from sounding data in a compact widget of an app for free-flight pilots. It's basically the vertical bar showing different shades of gray according to cloud probability in some Skew-T plots. I'd like to confirm my knowledge here and complete some missing bits. I understand there are 2 different processes generating clouds:
1) Non-convective clouds (name?): These are generated when air that is humid enough is (already) at an altitude where it is cold enough. This is where the dew point and the temp lines in a Skew-T plot are "close enough".
2) Convective clouds: These are generated by the condensation of water in humid air masses pushed up by convective forces to a cold enough layer above.
Let's assume I have pressure, altitude, temperature and dew point series and the floor altitude and temperature (given insolation, etc.). If the above is "right enough", I still need to know:
For 1, non-convective:
(i) How close is "close enough" for the temp and DP at a given pressure (altitude) to conclude there can be clouds forming? I guess the answer is probabilistic so maybe there's some rule like 3 deg. is about 0% probability to 0 deg. being 100% probability. I can perfectly sacrifice a bit of precision in favor of simple calculations.
(ii) I'd also like to understand if these non-convective clouds, while condensing, may generate any updraft of air. If not I may split the bar to show clouds generating from each of the 2 processes. The whole point of the widget is to aid pilots deciding how close they can get to clouds without being sucked up. Flying inside clouds is not only normally forbidden, but can also be quite dangerous.
For 2, convective:
I understand I'd need to simulate lifting the air directly in contact with the floor (at floor temp and the humidity given by the DP series at that altitude). It follows the dry adiabat (easy, constant number approx. is probably enough) until it saturates (when the floor DP = sounding temp), and from there (cloud base, LCL?) it follows the moist adiabat, which is my main doubt:
(iii) I've found formulas for calculating the actual lapse rate (Gamma_w) but I'd need an integration of that, a function yielding temperature from pressure, given the initial pressure and temp of the parcel the moment it gets fully saturated. Something like
t = malr(p, p0, t0)
essentially what you'd need to plot the MALR lines in the background of a Skew-T chart. My idea is to simulate the rising of the parcel and calculate the probability of clouds being at that level by comparing the simulation temps to the sounding temps (I think this is like calculating CAPE for a particular pressure).
(iv) I'd also need to understand "how close" those temps need to be (or how to interpret this "CAPE for given pressure") to derive percentage probabilities at every altitude.
Am I going into the right direction? This problem is solved in each software showing clouds in their Skew-T plots. Just haven't been able to find it. Thanks in advance!