exoclime / HELIOS

GPU-Accelerated Radiative Transfer Code For Exoplanetary Atmospheres
https://heliosexo.readthedocs.io/en/latest/
GNU General Public License v3.0
39 stars 16 forks source link

Can't create new opacity tables for arbitrary chemistry #7

Open iancrossfield opened 1 year ago

iancrossfield commented 1 year ago

How does one create HELIOS model atmospheres/synthetic spectra for model atmospheres of arbitrary composition (e.g., 100% SO2)? It seems clear that HELIOS & its sibling codes have this functionality, but despite many attempts to follow the documentation I'm unable to achieve this goal. A simple step-by-step worked example of how to set this up would be worth its weight in gold (or beer, etc.).

teald commented 1 year ago

This was something I ran into as well! I'll outline what I did here.

To do this, you need to edit input/species.dat to have the appropriate constant volume mixing ratio or have a value of file. For example, if I wanted to set the mixing ratio of SO2 to be constant, but have CH4 be read in from a file (which I would need to pass to -file_with_vertical_mixing_ratios or the corresponding parameter in param.dat), my input/species.dat file would look like:

# species      absorbing       scattering         mixing_ratio
 CH4           yes             no                  file
 SO2           yes             no                  1e-5

In order to avoid importing every opacity file in cases like a 100% SO2 atmosphere, you'd need to delete the other species lines from the file. You could pass a separate file like input/species_oops_all_so2.dat to -path_to_species_file with just the SO2 line set to 1.

So,

  1. Edit input/species.dat, or relevant file, to have "mixing ratio" set to:
    • A float
    • file
  2. If using file, pass your volume mixing ratios profile to -file_with_vertical_mixing_ratios.
  3. Run as normal otherwise and enjoy a fresh set of model outputs!

I just tested this with a fresh clone and 100% CO2 atmosphere using this:

printf "# This is my file\nCO2 yes no 1.0" &> oops_all_co2.dat && python helios.py -path_to_species_file oops_all_co2.dat -opacity_mixing on-the-fly -number_of_layers 50