Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Relaxing CO2 trace gas assumption in OpticalThickness.py ? #18

Open
AndrewILWilliams opened this issue Mar 9, 2021 · 4 comments
Open

Comments

@AndrewILWilliams
Copy link
Contributor

AndrewILWilliams commented Mar 9, 2021

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)
@danielkoll
Copy link
Owner

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
Copy link
Owner

@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

@AndrewILWilliams
Copy link
Contributor Author

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
Copy link
Contributor Author

AndrewILWilliams commented Mar 14, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants