One-Dimensional Climate Models: Brown Dwarfs w/ Disequilibrium Chemistry with Constant Kzz (~Elf Owl)

In this tutorial you will learn how to run 1d climate models with the effects of disequilibrium chemistry as was done for the Elf-OWL Grid Mukherjee et al. 2024 (note this should also be cited along with Mang et al. 2026 if using this code/tutorial).

What you should already be familiar with:

What you should have downloaded:

  1. Download New 1460, 661 wno Correlated-k Tables to be used by the climate code for opacity by individual molecule

Use the data.get_data helper function to get resortrebin files and add them to the default picaso location: reference/opaities/resortrebin >> import picaso.data as d

d.get_data(category_download=’ck_tables’,target_download=’by-molecule’)

First, check that you have downloaded and placed the correlated-k files in the correct folder

[1]:
from picaso import justplotit as jpi
from picaso import justdoit as jdi
import os;import glob
os.listdir(os.path.join(os.getenv('picaso_refdata'),'opacities','resortrebin')) #should show you a list of files
WARNING: Failed to load Vega spectrum from /data/reference_data/picaso/ref4/stellar_grids/calspec/alpha_lyr_stis_011.fits; Functionality involving Vega will be severely limited: FileNotFoundError(2, 'No such file or directory') [stsynphot.spectrum]
[1]:
['readme',
 'O2_1460.hdf5',
 'PH3_1460.hdf5',
 'Rb_1460.hdf5',
 'TiH_1460.hdf5',
 'TiO_1460.hdf5',
 'npy',
 'AlH_1460.hdf5',
 'C2H2_1460.hdf5',
 'C2H4_1460.hdf5',
 'C2H6_1460.hdf5',
 'CaH_1460.hdf5',
 'CH4_1460.hdf5',
 'CO_1460.hdf5',
 'CO2_1460.hdf5',
 'CrH_1460.hdf5',
 'Cs_1460.hdf5',
 'Fe_1460.hdf5',
 'FeH_1460.hdf5',
 'H2_1460.hdf5',
 'H2O_1460.hdf5',
 'H2S_1460.hdf5',
 'H3+_1460.hdf5',
 'HCN_1460.hdf5',
 'K_1460.hdf5',
 'Li_1460.hdf5',
 'LiCl_1460.hdf5',
 'LiF_1460.hdf5',
 'LiH_1460.hdf5',
 'MgH_1460.hdf5',
 'N2_1460.hdf5',
 'Na_1460.hdf5',
 'NH3_1460.hdf5',
 'O3_1460.hdf5',
 'OCS_1460.hdf5',
 'SiO_1460.hdf5',
 'SO2_1460.hdf5',
 'VO_1460.hdf5',
 '196']
[2]:
import warnings
warnings.filterwarnings('ignore')
import astropy.units as u
import numpy as np
import matplotlib.pyplot as plt
#%matplotlib inline
from astropy import constants as const
from astropy import units as u
import sys
import pandas as pd

Setting up Initial Run (highlighting main differences for disequilibrium)

[3]:
gases_fly = ['CO','CH4','H2O','NH3','CO2','N2','HCN','H2','He','PH3','C2H2','Na','K','TiO','VO','FeH']

opacity_ck = jdi.opannection(method='resortrebin',preload_gases=gases_fly) # grab your opacities
[4]:
elf = jdi.xr.load_dataset('spectra_logzz_9.0_teff_950.0_grav_56.0_mh_0.7_co_1.0.nc')
elf
[4]:
<xarray.Dataset> Size: 3MB
Dimensions:      (wavelength: 193132, pressure: 91)
Coordinates:
  * wavelength   (wavelength) float64 2MB 15.0 15.0 15.0 15.0 ... 0.6 0.6 0.6
  * pressure     (pressure) float64 728B 0.0001778 0.000205 ... 55.23 63.66
Data variables: (12/40)
    flux         (wavelength) float64 2MB 1.716e+09 1.722e+09 ... 3.777e+05
    temperature  (pressure) float64 728B 309.6 310.7 ... 3.227e+03 3.306e+03
    e-           (pressure) float64 728B 4.5e-38 4.5e-38 ... 9.713e-07 1.125e-06
    H2           (pressure) float64 728B 0.8272 0.8272 0.8271 ... 0.7973 0.7927
    H            (pressure) float64 728B 4.298e-33 5.412e-33 ... 0.03637 0.04143
    H+           (pressure) float64 728B 4.5e-38 4.5e-38 ... 7.752e-17 2.247e-16
    ...           ...
    OCS          (pressure) float64 728B 1.032e-25 1.018e-25 ... 8.842e-09
    Li           (pressure) float64 728B 4.5e-38 4.5e-38 ... 1.394e-08 1.379e-08
    LiOH         (pressure) float64 728B 4.5e-38 4.5e-38 ... 6.835e-10 6.427e-10
    LiH          (pressure) float64 728B 4.5e-38 4.5e-38 ... 2.646e-09 2.753e-09
    LiCl         (pressure) float64 728B 4.5e-38 4.5e-38 ... 9.78e-12 8.207e-12
    LiF          (pressure) float64 728B 4.5e-38 4.5e-38 ... 4.567e-13 3.971e-13
Attributes:
    author:         Batalha,Mukherjee
    contact:        natasha.e.batalha@nasa.gov
    code:           {"spectra": "PICASO", "chemistry": "visccher"}
    doi:            ELF OWL Paper
    planet_params:  {"logg": {"value": 56.0, "unit": "m / s2"}, "teff": {"val...
[5]:
cl_run = jdi.inputs(calculation="browndwarf", climate = True) # start a calculation

tint= 950
grav = 56 # Gravity of your Planet in m/s/s

cl_run.gravity(gravity=grav, gravity_unit=u.Unit('m/(s**2)')) # input gravity
cl_run.effective_temp(tint) # input effective temperature

nlevel = 91

In this case, let’s start with an Elf Owl profile since that’s the model we want to reproduce here

[6]:
pressure,temp_guess = elf.coords['pressure'].values, elf.data_vars['temperature'].values

rcb_guess = 70 # top most level of guessed convective zone

# Here are some other parameters needed for the code.
rfacv = 0.0 #we are focused on a brown dwarf so let's keep this as is

New code parameter:

  1. quench: This makes sure the do quench chemistry for disequilibrium runs. Default = False. This parameter should be included in the atmosphere function

[7]:
cl_run.inputs_climate(temp_guess= temp_guess, pressure= pressure,
                        rcb_guess=rcb_guess, rfacv = rfacv)

mh=10**eval(elf.attrs['planet_params'])['mh']#NOT LOG
cto_relative = eval(elf.attrs['planet_params'])['cto'] #relative to solar

#now that we are not using preweighted ck tables we need to tell picaso how to compute chemistry on the fly
cl_run.atmosphere(mh=mh, cto_relative=cto_relative, chem_method='visscher', quench=True)

Setting K\(_{zz}\)

We will add one more concept which is the addition of K\(_{zz}\) [cm\(^2\)/s]. K\(_{zz}\) is the eddy diffusion constant, which sets the strength of vertical mixing. In PICASO we have two options for K\(_{zz}\):

  1. Constant value: sets a constant at every atmospheric layer

  2. Self consistent (see Eqn. 27 and 28 in Mukherjee et al 2023)

New code parameters:

  1. diseq_chem=True : Turns on disequilibrium chemistry

  2. self_consistent_kzz : (True/False) This solves self consistently for

  3. save_all_kzz : (True/False) Similar to save_all_profiles this saves your intermediate k_zz values if you are trying to solve for a self_consistent_kzz=True.

  4. kz : constant value if self_consistent_kzz=False

Which of those 4 do I need change change

Likely you will only be changing kz and/or, for example, playing around with a self_consistent_kzz vs a constant profile. Unless you are certain, we recommend the following set of gases_fly to remain unchanged.

[8]:
#following elf-owl lets use a constant value for all pressures
kzval = pressure*0+10**eval(elf.attrs['planet_params'])['logkzz']
[9]:
cl_run.inputs['atmosphere']['profile']['kz']=kzval#cm2/s

out = cl_run.climate(opacity_ck, save_all_profiles = True, with_spec=True,
        save_all_kzz = False, self_consistent_kzz=False,diseq_chem = True)
SUMMARY
-------
Clouds: False
quench True
cold_trap False
vol_rainout False
no_ph3 False
Moist Adiabat: False
Kzz for chem: [1.e+09 1.e+09 1.e+09 1.e+09 1.e+09 1.e+09 1.e+09 1.e+09 1.e+09 1.e+09
 1.e+09 1.e+09 1.e+09 1.e+09 1.e+09 1.e+09 1.e+09 1.e+09 1.e+09 1.e+09
 1.e+09 1.e+09 1.e+09 1.e+09 1.e+09 1.e+09 1.e+09 1.e+09 1.e+09 1.e+09
 1.e+09 1.e+09 1.e+09 1.e+09 1.e+09 1.e+09 1.e+09 1.e+09 1.e+09 1.e+09
 1.e+09 1.e+09 1.e+09 1.e+09 1.e+09 1.e+09 1.e+09 1.e+09 1.e+09 1.e+09
 1.e+09 1.e+09 1.e+09 1.e+09 1.e+09 1.e+09 1.e+09 1.e+09 1.e+09 1.e+09
 1.e+09 1.e+09 1.e+09 1.e+09 1.e+09 1.e+09 1.e+09 1.e+09 1.e+09 1.e+09
 1.e+09 1.e+09 1.e+09 1.e+09 1.e+09 1.e+09 1.e+09 1.e+09 1.e+09 1.e+09
 1.e+09 1.e+09 1.e+09 1.e+09 1.e+09 1.e+09 1.e+09 1.e+09 1.e+09 1.e+09
 1.e+09]
Computed quenched levels at {'CO-CH4-H2O': np.int64(67), 'CO2': np.int64(59), 'NH3-N2': np.int64(70), 'HCN': np.int64(68), 'PH3': np.int64(64)}
Quench=True; Adjusting quench chemistry
Iteration number  0 , min , max temp  317.49657727183535 3345.1163456417644 , flux balance  -0.0034211241371079077
Iteration number  1 , min , max temp  332.17381370799393 3414.8928103619673 , flux balance  0.004358312467613298
Iteration number  2 , min , max temp  331.29340251763654 3410.122298285072 , flux balance  3.9003549692801225e-05
In t_start: Converged Solution in iterations  2
Computed quenched levels at {'CO-CH4-H2O': np.int64(67), 'CO2': np.int64(59), 'NH3-N2': np.int64(70), 'HCN': np.int64(67), 'PH3': np.int64(64)}
Quench=True; Adjusting quench chemistry
Big iteration is  331.29340251763654 0
Iteration number  0 , min , max temp  328.07042181657306 3444.146229442489 , flux balance  0.01566548080458186
Iteration number  1 , min , max temp  325.77391076911687 3463.0547615121022 , flux balance  0.0004850558570804716
Iteration number  2 , min , max temp  325.70730665609165 3462.7305109753734 , flux balance  2.865810491104745e-06
In t_start: Converged Solution in iterations  2
Computed quenched levels at {'CO-CH4-H2O': np.int64(67), 'CO2': np.int64(59), 'NH3-N2': np.int64(69), 'HCN': np.int64(67), 'PH3': np.int64(64)}
Quench=True; Adjusting quench chemistry
Big iteration is  325.70730665609165 1
Iteration number  0 , min , max temp  323.80976309010947 3491.5033145222974 , flux balance  0.0005536889895144554
Iteration number  1 , min , max temp  323.75352475095366 3490.7348363493948 , flux balance  3.0759963548999234e-06
In t_start: Converged Solution in iterations  1
Computed quenched levels at {'CO-CH4-H2O': np.int64(67), 'CO2': np.int64(60), 'NH3-N2': np.int64(69), 'HCN': np.int64(67), 'PH3': np.int64(64)}
Quench=True; Adjusting quench chemistry
Big iteration is  323.75352475095366 2
Iteration number  0 , min , max temp  324.4863229766061 3506.5659710855625 , flux balance  0.0001131876827762444
Iteration number  1 , min , max temp  324.494084071977 3506.3598616660656 , flux balance  5.552532457220578e-07
In t_start: Converged Solution in iterations  1
Computed quenched levels at {'CO-CH4-H2O': np.int64(67), 'CO2': np.int64(60), 'NH3-N2': np.int64(69), 'HCN': np.int64(67), 'PH3': np.int64(65)}
Quench=True; Adjusting quench chemistry
Profile converged before max_outer_iterations
Move up two levels
Computed quenched levels at {'CO-CH4-H2O': np.int64(67), 'CO2': np.int64(60), 'NH3-N2': np.int64(70), 'HCN': np.int64(67), 'PH3': np.int64(65)}
Quench=True; Adjusting quench chemistry
Iteration number  0 , min , max temp  325.27718453620986 3376.3702264529097 , flux balance  0.00012693122227382028
Iteration number  1 , min , max temp  325.2877235181823 3376.146583737596 , flux balance  1.4227420016415855e-06
In t_start: Converged Solution in iterations  1
Computed quenched levels at {'CO-CH4-H2O': np.int64(67), 'CO2': np.int64(60), 'NH3-N2': np.int64(70), 'HCN': np.int64(67), 'PH3': np.int64(64)}
Quench=True; Adjusting quench chemistry
Big iteration is  325.2877235181823 0
Iteration number  0 , min , max temp  325.2578350290419 3380.2097889699653 , flux balance  -1.908852438106359e-05
In t_start: Converged Solution in iterations  0
Computed quenched levels at {'CO-CH4-H2O': np.int64(67), 'CO2': np.int64(60), 'NH3-N2': np.int64(69), 'HCN': np.int64(67), 'PH3': np.int64(64)}
Quench=True; Adjusting quench chemistry
Profile converged before max_outer_iterations
Computed quenched levels at {'CO-CH4-H2O': np.int64(67), 'CO2': np.int64(60), 'NH3-N2': np.int64(70), 'HCN': np.int64(67), 'PH3': np.int64(64)}
Quench=True; Adjusting quench chemistry
Iteration number  0 , min , max temp  325.42945878460733 3359.24454949484 , flux balance  6.143531626035334e-05
Iteration number  1 , min , max temp  325.43474264311635 3359.1305681679 , flux balance  1.0173532325793633e-06
In t_start: Converged Solution in iterations  1
Computed quenched levels at {'CO-CH4-H2O': np.int64(67), 'CO2': np.int64(60), 'NH3-N2': np.int64(70), 'HCN': np.int64(67), 'PH3': np.int64(64)}
Quench=True; Adjusting quench chemistry
Big iteration is  325.43474264311635 0
Iteration number  0 , min , max temp  323.2195469875492 3361.358456887217 , flux balance  2.9523816408019915e-05
Iteration number  1 , min , max temp  323.156584298132 3361.3693133046495 , flux balance  1.3007184169415439e-07
In t_start: Converged Solution in iterations  1
Computed quenched levels at {'CO-CH4-H2O': np.int64(67), 'CO2': np.int64(60), 'NH3-N2': np.int64(70), 'HCN': np.int64(67), 'PH3': np.int64(64)}
Quench=True; Adjusting quench chemistry
Profile converged before max_outer_iterations
Computed quenched levels at {'CO-CH4-H2O': np.int64(67), 'CO2': np.int64(60), 'NH3-N2': np.int64(70), 'HCN': np.int64(67), 'PH3': np.int64(64)}
Quench=True; Adjusting quench chemistry
Iteration number  0 , min , max temp  328.20768124278027 3346.853376724131 , flux balance  0.00014674033459484252
Iteration number  1 , min , max temp  328.1592178115825 3346.7429169436623 , flux balance  2.2098707984009684e-06
In t_start: Converged Solution in iterations  1
Computed quenched levels at {'CO-CH4-H2O': np.int64(66), 'CO2': np.int64(60), 'NH3-N2': np.int64(70), 'HCN': np.int64(67), 'PH3': np.int64(64)}
Quench=True; Adjusting quench chemistry
Big iteration is  328.1592178115825 0
Iteration number  0 , min , max temp  333.75863300344236 3353.5621509764496 , flux balance  9.949831924363935e-05
Iteration number  1 , min , max temp  333.68575064983975 3353.571583454517 , flux balance  4.77608379612094e-07
In t_start: Converged Solution in iterations  1
Computed quenched levels at {'CO-CH4-H2O': np.int64(66), 'CO2': np.int64(59), 'NH3-N2': np.int64(70), 'HCN': np.int64(67), 'PH3': np.int64(64)}
Quench=True; Adjusting quench chemistry
Big iteration is  333.68575064983975 1
Iteration number  0 , min , max temp  333.05279672628654 3355.742432729163 , flux balance  -4.0324554653652836e-05
In t_start: Converged Solution in iterations  0
Computed quenched levels at {'CO-CH4-H2O': np.int64(66), 'CO2': np.int64(59), 'NH3-N2': np.int64(70), 'HCN': np.int64(67), 'PH3': np.int64(64)}
Quench=True; Adjusting quench chemistry
Profile converged before max_outer_iterations
Computed quenched levels at {'CO-CH4-H2O': np.int64(67), 'CO2': np.int64(59), 'NH3-N2': np.int64(70), 'HCN': np.int64(67), 'PH3': np.int64(64)}
Quench=True; Adjusting quench chemistry
Iteration number  0 , min , max temp  330.5680039783926 3341.747232367385 , flux balance  -3.6245611635427e-05
Iteration number  1 , min , max temp  330.50290620994383 3341.737547011557 , flux balance  1.0844344031720494e-08
In t_start: Converged Solution in iterations  1
Computed quenched levels at {'CO-CH4-H2O': np.int64(67), 'CO2': np.int64(59), 'NH3-N2': np.int64(70), 'HCN': np.int64(67), 'PH3': np.int64(64)}
Quench=True; Adjusting quench chemistry
Big iteration is  330.50290620994383 0
Iteration number  0 , min , max temp  328.158512477873 3342.4250066275094 , flux balance  4.357389064348247e-05
Iteration number  1 , min , max temp  328.0910955102504 3342.432966473309 , flux balance  1.3496987557563506e-07
In t_start: Converged Solution in iterations  1
Computed quenched levels at {'CO-CH4-H2O': np.int64(67), 'CO2': np.int64(59), 'NH3-N2': np.int64(70), 'HCN': np.int64(67), 'PH3': np.int64(64)}
Quench=True; Adjusting quench chemistry
Profile converged before max_outer_iterations
Computed quenched levels at {'CO-CH4-H2O': np.int64(67), 'CO2': np.int64(59), 'NH3-N2': np.int64(70), 'HCN': np.int64(68), 'PH3': np.int64(64)}
Quench=True; Adjusting quench chemistry
Iteration number  0 , min , max temp  332.8504832368975 3332.9228430375174 , flux balance  4.4873943915938036e-05
Iteration number  1 , min , max temp  332.8236695004872 3332.857120915921 , flux balance  2.0953066696263496e-06
In t_start: Converged Solution in iterations  1
Computed quenched levels at {'CO-CH4-H2O': np.int64(67), 'CO2': np.int64(59), 'NH3-N2': np.int64(70), 'HCN': np.int64(67), 'PH3': np.int64(64)}
Quench=True; Adjusting quench chemistry
Big iteration is  332.8236695004872 0
Iteration number  0 , min , max temp  330.85538976091385 3335.1049789401472 , flux balance  -4.5219838076449956e-05
Iteration number  1 , min , max temp  330.8061769045002 3335.132193944379 , flux balance  -9.426824649712476e-07
In t_start: Converged Solution in iterations  1
Computed quenched levels at {'CO-CH4-H2O': np.int64(67), 'CO2': np.int64(59), 'NH3-N2': np.int64(70), 'HCN': np.int64(67), 'PH3': np.int64(64)}
Quench=True; Adjusting quench chemistry
Profile converged before max_outer_iterations
Computed quenched levels at {'CO-CH4-H2O': np.int64(67), 'CO2': np.int64(59), 'NH3-N2': np.int64(70), 'HCN': np.int64(68), 'PH3': np.int64(64)}
Quench=True; Adjusting quench chemistry
Iteration number  0 , min , max temp  335.5866788880992 3327.9923694900863 , flux balance  -1.0168240099453469e-05
Iteration number  1 , min , max temp  335.56820820252284 3327.9442134758106 , flux balance  1.7980455670075977e-06
In t_start: Converged Solution in iterations  1
Computed quenched levels at {'CO-CH4-H2O': np.int64(67), 'CO2': np.int64(59), 'NH3-N2': np.int64(70), 'HCN': np.int64(67), 'PH3': np.int64(64)}
Quench=True; Adjusting quench chemistry
Big iteration is  335.56820820252284 0
Iteration number  0 , min , max temp  333.3811526983457 3330.066266633311 , flux balance  -6.222314616848204e-05
Iteration number  1 , min , max temp  333.32491261476355 3330.0990034486076 , flux balance  -1.5104523618256139e-06
In t_start: Converged Solution in iterations  1
Computed quenched levels at {'CO-CH4-H2O': np.int64(67), 'CO2': np.int64(59), 'NH3-N2': np.int64(70), 'HCN': np.int64(67), 'PH3': np.int64(64)}
Quench=True; Adjusting quench chemistry
Profile converged before max_outer_iterations
Computed quenched levels at {'CO-CH4-H2O': np.int64(67), 'CO2': np.int64(59), 'NH3-N2': np.int64(70), 'HCN': np.int64(68), 'PH3': np.int64(64)}
Quench=True; Adjusting quench chemistry
Iteration number  0 , min , max temp  337.8808584596773 3324.1317447052743 , flux balance  -0.00013170372969081737
Iteration number  1 , min , max temp  337.87903297664764 3324.123481866252 , flux balance  -3.3247956303261185e-07
In t_start: Converged Solution in iterations  1
Computed quenched levels at {'CO-CH4-H2O': np.int64(67), 'CO2': np.int64(59), 'NH3-N2': np.int64(70), 'HCN': np.int64(68), 'PH3': np.int64(64)}
Quench=True; Adjusting quench chemistry
Big iteration is  337.87903297664764 0
Iteration number  0 , min , max temp  335.61889503488624 3325.887872742296 , flux balance  -6.869307353389742e-05
Iteration number  1 , min , max temp  335.5605196929109 3325.9211505439775 , flux balance  -1.9042901488602579e-06
In t_start: Converged Solution in iterations  1
Computed quenched levels at {'CO-CH4-H2O': np.int64(67), 'CO2': np.int64(59), 'NH3-N2': np.int64(70), 'HCN': np.int64(67), 'PH3': np.int64(64)}
Quench=True; Adjusting quench chemistry
Profile converged before max_outer_iterations
Computed quenched levels at {'CO-CH4-H2O': np.int64(67), 'CO2': np.int64(59), 'NH3-N2': np.int64(70), 'HCN': np.int64(68), 'PH3': np.int64(64)}
Quench=True; Adjusting quench chemistry
Iteration number  0 , min , max temp  339.84208688595186 3321.0552614804697 , flux balance  -0.00028970257455638443
Iteration number  1 , min , max temp  339.85881298432827 3321.1002971075736 , flux balance  -4.30070220292186e-06
In t_start: Converged Solution in iterations  1
Computed quenched levels at {'CO-CH4-H2O': np.int64(67), 'CO2': np.int64(59), 'NH3-N2': np.int64(70), 'HCN': np.int64(68), 'PH3': np.int64(64)}
Quench=True; Adjusting quench chemistry
Big iteration is  339.85881298432827 0
Iteration number  0 , min , max temp  337.6288154593533 3322.436274758914 , flux balance  -6.280986296588345e-05
Iteration number  1 , min , max temp  337.5717793753643 3322.4667326877234 , flux balance  -2.0668635549749915e-06
In t_start: Converged Solution in iterations  1
Computed quenched levels at {'CO-CH4-H2O': np.int64(67), 'CO2': np.int64(59), 'NH3-N2': np.int64(70), 'HCN': np.int64(68), 'PH3': np.int64(64)}
Quench=True; Adjusting quench chemistry
Profile converged before max_outer_iterations
Computed quenched levels at {'CO-CH4-H2O': np.int64(67), 'CO2': np.int64(59), 'NH3-N2': np.int64(71), 'HCN': np.int64(68), 'PH3': np.int64(64)}
Quench=True; Adjusting quench chemistry
Iteration number  0 , min , max temp  341.64877229312907 3318.4455098197604 , flux balance  -0.00047639558960527265
Iteration number  1 , min , max temp  341.6823851140038 3318.552749139471 , flux balance  -1.0440556786209515e-05
In t_start: Converged Solution in iterations  1
Computed quenched levels at {'CO-CH4-H2O': np.int64(67), 'CO2': np.int64(59), 'NH3-N2': np.int64(70), 'HCN': np.int64(68), 'PH3': np.int64(64)}
Quench=True; Adjusting quench chemistry
Big iteration is  341.6823851140038 0
Iteration number  0 , min , max temp  339.50056322485153 3319.5172885482257 , flux balance  -5.40280407346074e-05
Iteration number  1 , min , max temp  339.4453521311947 3319.5433274139987 , flux balance  -2.0953751099789927e-06
In t_start: Converged Solution in iterations  1
Computed quenched levels at {'CO-CH4-H2O': np.int64(67), 'CO2': np.int64(59), 'NH3-N2': np.int64(70), 'HCN': np.int64(68), 'PH3': np.int64(64)}
Quench=True; Adjusting quench chemistry
Profile converged before max_outer_iterations
Computed quenched levels at {'CO-CH4-H2O': np.int64(67), 'CO2': np.int64(59), 'NH3-N2': np.int64(71), 'HCN': np.int64(68), 'PH3': np.int64(64)}
Quench=True; Adjusting quench chemistry
Iteration number  0 , min , max temp  343.2812622300043 3316.243791976131 , flux balance  -0.0006591574343924871
Iteration number  1 , min , max temp  343.3313158438534 3316.4104788312557 , flux balance  -1.7770432175563678e-05
In t_start: Converged Solution in iterations  1
Computed quenched levels at {'CO-CH4-H2O': np.int64(67), 'CO2': np.int64(59), 'NH3-N2': np.int64(70), 'HCN': np.int64(68), 'PH3': np.int64(64)}
Quench=True; Adjusting quench chemistry
Big iteration is  343.3313158438534 0
Iteration number  0 , min , max temp  341.2932311108818 3317.118237662168 , flux balance  -4.5893811168471446e-05
Iteration number  1 , min , max temp  341.2433423495238 3317.1399543152506 , flux balance  -2.019881301508116e-06
In t_start: Converged Solution in iterations  1
Computed quenched levels at {'CO-CH4-H2O': np.int64(67), 'CO2': np.int64(59), 'NH3-N2': np.int64(70), 'HCN': np.int64(68), 'PH3': np.int64(64)}
Quench=True; Adjusting quench chemistry
Profile converged before max_outer_iterations
Computed quenched levels at {'CO-CH4-H2O': np.int64(67), 'CO2': np.int64(59), 'NH3-N2': np.int64(71), 'HCN': np.int64(68), 'PH3': np.int64(65)}
Quench=True; Adjusting quench chemistry
Iteration number  0 , min , max temp  344.4043593881154 3313.788652017917 , flux balance  -0.0008695226670335957
Iteration number  1 , min , max temp  344.47831622862464 3314.0225410778967 , flux balance  -2.7632563815618497e-05
In t_start: Converged Solution in iterations  1
Computed quenched levels at {'CO-CH4-H2O': np.int64(67), 'CO2': np.int64(59), 'NH3-N2': np.int64(70), 'HCN': np.int64(68), 'PH3': np.int64(64)}
Quench=True; Adjusting quench chemistry
Big iteration is  344.47831622862464 0
Iteration number  0 , min , max temp  342.87499507022613 3315.025397291056 , flux balance  -9.454833135504395e-05
In t_start: Converged Solution in iterations  0
Computed quenched levels at {'CO-CH4-H2O': np.int64(67), 'CO2': np.int64(59), 'NH3-N2': np.int64(70), 'HCN': np.int64(68), 'PH3': np.int64(64)}
Quench=True; Adjusting quench chemistry
Profile converged before max_outer_iterations
Computed quenched levels at {'CO-CH4-H2O': np.int64(67), 'CO2': np.int64(59), 'NH3-N2': np.int64(71), 'HCN': np.int64(68), 'PH3': np.int64(65)}
Quench=True; Adjusting quench chemistry
Iteration number  0 , min , max temp  345.91810259196285 3312.160721923459 , flux balance  -0.0010303439666260598
Iteration number  1 , min , max temp  346.00574723588704 3312.441708775961 , flux balance  -3.7053440294791314e-05
In t_start: Converged Solution in iterations  1
Computed quenched levels at {'CO-CH4-H2O': np.int64(67), 'CO2': np.int64(59), 'NH3-N2': np.int64(70), 'HCN': np.int64(68), 'PH3': np.int64(64)}
Quench=True; Adjusting quench chemistry
Big iteration is  346.00574723588704 0
Iteration number  0 , min , max temp  344.3748023995869 3313.4034095817424 , flux balance  -0.00010493823803991963
In t_start: Converged Solution in iterations  0
Computed quenched levels at {'CO-CH4-H2O': np.int64(67), 'CO2': np.int64(59), 'NH3-N2': np.int64(70), 'HCN': np.int64(68), 'PH3': np.int64(64)}
Quench=True; Adjusting quench chemistry
Profile converged before max_outer_iterations
Computed quenched levels at {'CO-CH4-H2O': np.int64(67), 'CO2': np.int64(59), 'NH3-N2': np.int64(71), 'HCN': np.int64(68), 'PH3': np.int64(65)}
Quench=True; Adjusting quench chemistry
Iteration number  0 , min , max temp  347.41260106733887 3310.721649631064 , flux balance  -0.0012117693056888942
Iteration number  1 , min , max temp  347.51347182982363 3311.0556257505928 , flux balance  -4.807894662866975e-05
In t_start: Converged Solution in iterations  1
Computed quenched levels at {'CO-CH4-H2O': np.int64(67), 'CO2': np.int64(59), 'NH3-N2': np.int64(70), 'HCN': np.int64(68), 'PH3': np.int64(64)}
Quench=True; Adjusting quench chemistry
Big iteration is  347.51347182982363 0
Iteration number  0 , min , max temp  345.8264651778576 3312.0010353021694 , flux balance  -0.00011509521832741184
In t_start: Converged Solution in iterations  0
Computed quenched levels at {'CO-CH4-H2O': np.int64(67), 'CO2': np.int64(59), 'NH3-N2': np.int64(70), 'HCN': np.int64(68), 'PH3': np.int64(64)}
Quench=True; Adjusting quench chemistry
Profile converged before max_outer_iterations
Computed quenched levels at {'CO-CH4-H2O': np.int64(67), 'CO2': np.int64(59), 'NH3-N2': np.int64(71), 'HCN': np.int64(68), 'PH3': np.int64(65)}
Quench=True; Adjusting quench chemistry
Iteration number  0 , min , max temp  348.7932938597393 3309.4404880399334 , flux balance  -0.001410838537899756
Iteration number  1 , min , max temp  348.9069422110719 3309.8342478773075 , flux balance  -6.167359074174895e-05
In t_start: Converged Solution in iterations  1
Computed quenched levels at {'CO-CH4-H2O': np.int64(67), 'CO2': np.int64(59), 'NH3-N2': np.int64(70), 'HCN': np.int64(68), 'PH3': np.int64(64)}
Quench=True; Adjusting quench chemistry
Big iteration is  348.9069422110719 0
Iteration number  0 , min , max temp  347.2062684474347 3310.78393361363 , flux balance  -0.0001285730752919102
In t_start: Converged Solution in iterations  0
Computed quenched levels at {'CO-CH4-H2O': np.int64(67), 'CO2': np.int64(59), 'NH3-N2': np.int64(70), 'HCN': np.int64(68), 'PH3': np.int64(64)}
Quench=True; Adjusting quench chemistry
Profile converged before max_outer_iterations
Computed quenched levels at {'CO-CH4-H2O': np.int64(67), 'CO2': np.int64(59), 'NH3-N2': np.int64(71), 'HCN': np.int64(68), 'PH3': np.int64(65)}
Quench=True; Adjusting quench chemistry
Iteration number  0 , min , max temp  350.0443147690242 3308.3349776844334 , flux balance  -0.0015710216941675682
Iteration number  1 , min , max temp  350.1684663238157 3308.777318913057 , flux balance  -7.277296630085152e-05
In t_start: Converged Solution in iterations  1
Computed quenched levels at {'CO-CH4-H2O': np.int64(67), 'CO2': np.int64(59), 'NH3-N2': np.int64(70), 'HCN': np.int64(68), 'PH3': np.int64(64)}
Quench=True; Adjusting quench chemistry
Big iteration is  350.1684663238157 0
Iteration number  0 , min , max temp  348.4875946115305 3309.7197986047804 , flux balance  -0.00013803332495774992
In t_start: Converged Solution in iterations  0
Computed quenched levels at {'CO-CH4-H2O': np.int64(67), 'CO2': np.int64(59), 'NH3-N2': np.int64(70), 'HCN': np.int64(68), 'PH3': np.int64(64)}
Quench=True; Adjusting quench chemistry
Profile converged before max_outer_iterations
Computed quenched levels at {'CO-CH4-H2O': np.int64(67), 'CO2': np.int64(59), 'NH3-N2': np.int64(71), 'HCN': np.int64(68), 'PH3': np.int64(65)}
Quench=True; Adjusting quench chemistry
Iteration number  0 , min , max temp  351.14165920592984 3307.410720907152 , flux balance  -0.0017307807415543254
Iteration number  1 , min , max temp  351.2742343443058 3307.9017746063605 , flux balance  -8.605178904515963e-05
In t_start: Converged Solution in iterations  1
Computed quenched levels at {'CO-CH4-H2O': np.int64(67), 'CO2': np.int64(59), 'NH3-N2': np.int64(70), 'HCN': np.int64(68), 'PH3': np.int64(64)}
Quench=True; Adjusting quench chemistry
Big iteration is  351.2742343443058 0
Iteration number  0 , min , max temp  349.6430679161024 3308.821517440744 , flux balance  -0.00014465496862312857
In t_start: Converged Solution in iterations  0
Computed quenched levels at {'CO-CH4-H2O': np.int64(67), 'CO2': np.int64(59), 'NH3-N2': np.int64(70), 'HCN': np.int64(68), 'PH3': np.int64(64)}
Quench=True; Adjusting quench chemistry
Profile converged before max_outer_iterations
Computed quenched levels at {'CO-CH4-H2O': np.int64(67), 'CO2': np.int64(59), 'NH3-N2': np.int64(71), 'HCN': np.int64(68), 'PH3': np.int64(65)}
Quench=True; Adjusting quench chemistry
Iteration number  0 , min , max temp  352.04483636735864 3306.658174669316 , flux balance  -0.0018702838346163157
Iteration number  1 , min , max temp  352.18225194867824 3307.1922749955843 , flux balance  -9.955662868779276e-05
In t_start: Converged Solution in iterations  1
Computed quenched levels at {'CO-CH4-H2O': np.int64(67), 'CO2': np.int64(59), 'NH3-N2': np.int64(70), 'HCN': np.int64(68), 'PH3': np.int64(64)}
Quench=True; Adjusting quench chemistry
Big iteration is  352.18225194867824 0
Iteration number  0 , min , max temp  350.65169078378796 3308.110580923812 , flux balance  -0.00015688673306314864
In t_start: Converged Solution in iterations  0
Computed quenched levels at {'CO-CH4-H2O': np.int64(67), 'CO2': np.int64(59), 'NH3-N2': np.int64(70), 'HCN': np.int64(68), 'PH3': np.int64(64)}
Quench=True; Adjusting quench chemistry
Profile converged before max_outer_iterations
Computed quenched levels at {'CO-CH4-H2O': np.int64(67), 'CO2': np.int64(59), 'NH3-N2': np.int64(71), 'HCN': np.int64(68), 'PH3': np.int64(65)}
Quench=True; Adjusting quench chemistry
Iteration number  0 , min , max temp  352.597891934164 3306.137760567203 , flux balance  -0.0018717616551288535
Iteration number  1 , min , max temp  352.72998308161385 3306.6753173066445 , flux balance  -0.00010466728113565763
In t_start: Converged Solution in iterations  1
Computed quenched levels at {'CO-CH4-H2O': np.int64(67), 'CO2': np.int64(59), 'NH3-N2': np.int64(70), 'HCN': np.int64(68), 'PH3': np.int64(64)}
Quench=True; Adjusting quench chemistry
Big iteration is  352.72998308161385 0
Iteration number  0 , min , max temp  351.4425739311356 3307.601660922295 , flux balance  -0.00016878478401865846
In t_start: Converged Solution in iterations  0
Computed quenched levels at {'CO-CH4-H2O': np.int64(67), 'CO2': np.int64(59), 'NH3-N2': np.int64(70), 'HCN': np.int64(68), 'PH3': np.int64(64)}
Quench=True; Adjusting quench chemistry
Profile converged before max_outer_iterations
Computed quenched levels at {'CO-CH4-H2O': np.int64(67), 'CO2': np.int64(59), 'NH3-N2': np.int64(71), 'HCN': np.int64(68), 'PH3': np.int64(65)}
Quench=True; Adjusting quench chemistry
Iteration number  0 , min , max temp  352.8613725411867 3305.8483681863054 , flux balance  -0.0017415728904407377
Iteration number  1 , min , max temp  352.97772031910006 3306.350611114009 , flux balance  -0.00010215467342421765
In t_start: Converged Solution in iterations  1
Computed quenched levels at {'CO-CH4-H2O': np.int64(67), 'CO2': np.int64(59), 'NH3-N2': np.int64(70), 'HCN': np.int64(68), 'PH3': np.int64(64)}
Quench=True; Adjusting quench chemistry
Big iteration is  352.97772031910006 0
Iteration number  0 , min , max temp  352.02322947179914 3307.241093486448 , flux balance  -0.00017272021134623783
In t_start: Converged Solution in iterations  0
Computed quenched levels at {'CO-CH4-H2O': np.int64(67), 'CO2': np.int64(59), 'NH3-N2': np.int64(70), 'HCN': np.int64(68), 'PH3': np.int64(64)}
Quench=True; Adjusting quench chemistry
Profile converged before max_outer_iterations
Computed quenched levels at {'CO-CH4-H2O': np.int64(67), 'CO2': np.int64(59), 'NH3-N2': np.int64(71), 'HCN': np.int64(68), 'PH3': np.int64(64)}
Quench=True; Adjusting quench chemistry
Iteration number  0 , min , max temp  353.2268222400945 3306.386733174995 , flux balance  -0.0014733903626967374
Iteration number  1 , min , max temp  353.32043190778086 3306.812091854669 , flux balance  -9.046353676597853e-05
In t_start: Converged Solution in iterations  1
Computed quenched levels at {'CO-CH4-H2O': np.int64(67), 'CO2': np.int64(59), 'NH3-N2': np.int64(70), 'HCN': np.int64(68), 'PH3': np.int64(64)}
Quench=True; Adjusting quench chemistry
Big iteration is  353.32043190778086 0
Iteration number  0 , min , max temp  352.353207731428 3307.085560747053 , flux balance  -5.42400415519795e-05
In t_start: Converged Solution in iterations  0
Computed quenched levels at {'CO-CH4-H2O': np.int64(67), 'CO2': np.int64(59), 'NH3-N2': np.int64(70), 'HCN': np.int64(68), 'PH3': np.int64(64)}
Quench=True; Adjusting quench chemistry
Profile converged before max_outer_iterations
Computed quenched levels at {'CO-CH4-H2O': np.int64(67), 'CO2': np.int64(59), 'NH3-N2': np.int64(71), 'HCN': np.int64(68), 'PH3': np.int64(64)}
Quench=True; Adjusting quench chemistry
Iteration number  0 , min , max temp  352.7911878911846 3306.662658863591 , flux balance  -0.0007613400221058601
In t_start: Converged Solution in iterations  0
Computed quenched levels at {'CO-CH4-H2O': np.int64(67), 'CO2': np.int64(59), 'NH3-N2': np.int64(70), 'HCN': np.int64(68), 'PH3': np.int64(64)}
Quench=True; Adjusting quench chemistry
Big iteration is  352.7911878911846 0
Iteration number  0 , min , max temp  352.4142339022215 3306.974389187009 , flux balance  -6.681390106739482e-05
In t_start: Converged Solution in iterations  0
Computed quenched levels at {'CO-CH4-H2O': np.int64(67), 'CO2': np.int64(59), 'NH3-N2': np.int64(70), 'HCN': np.int64(68), 'PH3': np.int64(64)}
Quench=True; Adjusting quench chemistry
Profile converged before max_outer_iterations
final [0, 48, 89, 0, 0, 0]
Computed quenched levels at {'CO-CH4-H2O': np.int64(67), 'CO2': np.int64(59), 'NH3-N2': np.int64(70), 'HCN': np.int64(68), 'PH3': np.int64(64)}
Quench=True; Adjusting quench chemistry
Iteration number  0 , min , max temp  352.3020845360525 3306.991854760441 , flux balance  -3.57684666539855e-06
In t_start: Converged Solution in iterations  0
Computed quenched levels at {'CO-CH4-H2O': np.int64(67), 'CO2': np.int64(59), 'NH3-N2': np.int64(70), 'HCN': np.int64(68), 'PH3': np.int64(64)}
Quench=True; Adjusting quench chemistry
Big iteration is  352.3020845360525 0
 We are already at a root, tolf , test =  5e-05 ,  1.0628773114785177e-05
Computed quenched levels at {'CO-CH4-H2O': np.int64(67), 'CO2': np.int64(59), 'NH3-N2': np.int64(70), 'HCN': np.int64(68), 'PH3': np.int64(64)}
Quench=True; Adjusting quench chemistry
Profile converged before max_outer_iterations
YAY ! ENDING WITH CONVERGENCE
[10]:
for i in ['H2O','CO2','CO','CH4']:
    plt.loglog(out['ptchem_df'][i], out['ptchem_df']['pressure'] ,label=i)
plt.legend()
plt.ylim([200,1e-4])
[10]:
(200, 0.0001)
../../_images/notebooks_D_climate_4b_BrownDwarf_DEQ_const_kzz_15_1.png

Compare Diseq and Elf Owl Climate Profile

For the case we chose with very low kzz, and solar M/H the disequilibrium profile and bobcat profiles are identical!

[11]:
plt.ylim(200,1.7e-4)
plt.semilogy(out['temperature'],out['pressure'],"r", label='Resort-Rebin, Chemical Equilibrium')
plt.semilogy(temp_guess,pressure,color="k",linestyle="--", label='Elf Owl, v1')

plt.legend()
[11]:
<matplotlib.legend.Legend at 0x7fbe8ca25450>
../../_images/notebooks_D_climate_4b_BrownDwarf_DEQ_const_kzz_17_1.png
[ ]: