Check Berton 2023 atmospheric profiles
I'm looking at the plots in the atmospheric profiles notebook, and the relative humidity plot (which should match Figure 4 in the paper) looks a little odd. In the paper, the relative humidity relative to ice is always greater than the relative humidity relative to liquid water. In Section A.3 of the paper, it is stated that H_i > H_l because p_vsl > p_vsi. That implies that there is an error somewhere in the calculation of the relative humidity or vapor pressure in our code or in the calculation in the notebook. Can you work out what's wrong here, please?
Now let me read the key functions in berton2023.py:
Now let me check the paper for the relevant equations:
Let me look at the notebook imports and also verify the saturation pressures numerically:
The underlying code is correct — let me look at the notebook's stored output to see what the actual plot shows:
I'm looking at the plots in the atmospheric profiles notebook, and the relative humidity plot (which should match Figure 4 in the paper) looks a little odd. In the paper, the relative humidity relative to ice is always greater than the relative humidity relative to liquid water. In Section A.3 of the paper, it is stated that H_i > H_l because p_vsl > p_vsi. That implies that there is an error somewhere in the calculation of the relative humidity or vapor pressure in our code or in the calculation in the notebook. Can you work out what's wrong here, please? (Note that the problem occurs at lower levels in the atmosphere, below about 2 km: the H_i and H_l curves appear to cross at about 2 km, with H_i < H_l for altitudes less than 2 km. That isn't right.)
I'll inspect the temperature profile and saturation pressure behavior below 2 km, since that's where the crossing occurs.
The crossing is below the freezing level. I'll update the notebook so the ice-relative quantities are only plotted where the paper plots them: from the 0 °C level upward.
Let me quickly verify numerically that the only apparent violation was below the freezing level, and that the masked plotted domain satisfies H_i >= H_l.
Found it: the relative humidity/vapor-pressure formulas in src/cloud_rom/berton2023.py are OK. The problem is the notebook was plotting the ice-relative quantities below their intended/physical domain.
In the model temperature profile, T_a = 273.15 K at about z = 2 km. Below that, the notebook was still evaluating/plotting:
p_vsi = saturation_pressure_ice(T)H_iS_i
But the paper explicitly says the H_i/S_i profiles are plotted only down to 2 km, where the temperature reaches the freezing point. Below freezing level? No issue: p_vsl > p_vsi, so H_i > H_l. Above freezing, the Sonntag ice formula is being extrapolated outside the intended domain and gives p_vsi > p_vsl, which flips the inequality and makes H_i < H_l.
Show remaining 17 lines
Example at sea level from our code:
T = 20 °C
p_vsl = 2339 Pa
p_vsi = 2830 Pa
so the notebook’s low-level crossing is just an invalid ice-saturation extrapolation.
I updated:
notebooks/atmospheric-profiles.ipynb
so H_i and S_i are set to np.nan wherever T > 273.15 K, matching the paper’s Figure 4 domain. Numerically verified: for all T <= 273.15 K, H_i >= H_l.