PyRADS icon indicating copy to clipboard operation
PyRADS copied to clipboard

Relaxing CO2 trace gas assumption in OpticalThickness.py ?

Open AndrewILWilliams opened this issue 3 years ago • 4 comments

At the moment, compute_tau_H2ON2_CO2dilute assumes that CO2 is a trace gas and so doesn't include the partial pressure of CO2 in the calculation. I'm currently running PyRADS with CO2 values up to ~50,000ppmv and so this is a problem.

To fix this, is it sufficient to add in the partial pressure of CO2 and then just change the broadening to "mixed"?

i.e.

p_CO2 = pres * ppv_CO2
p_H2O = RH * params.esat(temp)  # ...

q_CO2 = convert_molar_to_mass_ratio(ppv_CO2,params.R_CO2,R_mean)

R_mean = q_H2O*params.Rv + q_CO2*params.R_CO2 + (1.-q_H2O - q_CO2)*params.R


kappaH2O = getKappa_HITRAN(grid.n,grid.n0,grid.n1,grid.dn, \
                           "H2O",press=pres,press_self=p_H2O, \
                           temp=temp,broadening="mixed", lineWid=25., \
                           cutoff_option="fixed",remove_plinth=True)

kappaCO2 = getKappa_HITRAN(grid.n,grid.n0,grid.n1,grid.dn, \
                           "CO2",press=pres,press_self=p_CO2, \
                           temp=temp,broadening="mixed", lineWid=25., \
                           cutoff_option="fixed",remove_plinth=False)

AndrewILWilliams avatar Mar 09 '21 13:03 AndrewILWilliams

While working on this, I noticed that p_H2O = RH * params.esat(temp) is not valid in the stratosphere. Assuming q_H2O is uniform in the stratosphere, p_H2O has to decrease with pressure. Will fix the bug and generalize code to arbitrary dry gas mixtures.

danielkoll avatar Mar 12 '21 11:03 danielkoll

@AndrewWilliams3142 I think your suggestion might not be quite correct yet. 50000ppmv CO2 presumably means that we want the dry background gas to consist of 5% CO2, 95% rest by volume. However, once you're pushing into hot territory where the overall composition is 50% H2O-50% dry by volume, then ppv_CO2 & q_CO2 should drop due to the added H2O

danielkoll avatar Mar 12 '21 12:03 danielkoll

Hey @ddbkoll ! That makes sense to me. For context, I'm trying to reproduce the results of Seeley and Jeevanjee, 2020 with PyRADS, but PyRADS seems to be underestimating the CO2 at high temperatures compared to the line-by-line code in their paper ('RFM' in the figure). I thought that perhaps these simplifications could be the issue? I'm not entirely sure how the RFM treats these high-CO2/H2O situations...

Also, I'm currently running PyRADS with 100 log-spaced pressure levels, but maybe that needs to be improved as well (there are quite a few 'wiggles' which are probably due to the discretization).

image

AndrewILWilliams avatar Mar 12 '21 15:03 AndrewILWilliams

Actually I just realized it's probably because PyRADS doesn't include the CO2 self-continuum... I'll code up the analytic fits from POPC and see if that fixes the problem ^^

EDIT: It looks like it's a combination of the spectral and the vertical resolution. Upping spectral resolution to 0.01 cm-1 and using 300 levels gives you a 'bump' (see figure), but there are still a lot of wiggles, and the bump is underestimated - I'm rerunning now with 1000 vertical levels to see if that fixes it. I think this might be it, but running with hundreds of vertical levels slows the code down a lot so it might not be that practical.

image

AndrewILWilliams avatar Mar 14 '21 19:03 AndrewILWilliams