Difference between revisions of "Radiative Generic Condensable Specie"

From Planets
Jump to: navigation, search
(What to add it in my set up)
 
(17 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
(Mistake in the title: Specie -> Species)
 +
 +
Generic Condensable Species are often reffered in the code as "GCS".
 +
 
== What to add it in my set up ==
 
== What to add it in my set up ==
  
Line 5: Line 9:
 
- in « traceur.def » (flag is « tracer » but name file is « traceur »…), add the lines :
 
- in « traceur.def » (flag is « tracer » but name file is « traceur »…), add the lines :
  
<syntaxhighlight lang="python">
+
<syntaxhighlight lang="text">
 
#ModernTrac-v1
 
#ModernTrac-v1
 
2
 
2
Line 13: Line 17:
  
 
- in « gases.def » :
 
- in « gases.def » :
<syntaxhighlight lang="python">
+
<syntaxhighlight lang="text">
 
# gases
 
# gases
 
3
 
3
Line 19: Line 23:
 
He_ (or other main gaz)
 
He_ (or other main gaz)
 
TRACERNAME
 
TRACERNAME
0.8
+
0.85
 
0.15
 
0.15
 
-1
 
-1
Line 25: Line 29:
  
 
- in datadir/ (datagcm), add a file « table_tacers_condensable » with lines similar to :
 
- in datadir/ (datagcm), add a file « table_tacers_condensable » with lines similar to :
<syntaxhighlight lang="python">
+
<syntaxhighlight lang="text">
#name_traceur delta_vapH=J/mol Tref=K Pref=Pa mass=g/mol metallicity_coeff heat_capacity_at_constant_volume
+
#name_traceur delta_vapH=J/mol     Tref=K     Pref=Pa       mass=g/mol   metallicity_coeff       heat_capacity_at_constant_pressure
CH4 delta_vapH=10000.0  Tref=90.69 Pref=11700 mass=16.0425  metallicity_coeff=0.0 RCPV_generic=1709
+
CH4           delta_vapH=10000.0  Tref=90.69 Pref=11700   mass=16.0425  metallicity_coeff=0.0   RCPV_generic=1709
Fe delta_vapH=401900.0 Tref=2903.0 Pref=100000.0 mass=55.8450  metallicity_coeff=0.0
+
Fe           delta_vapH=401900.0 Tref=2903.0 Pref=100000.0 mass=55.8450  metallicity_coeff=0.0
Cr delta_vapH=394200.0 Tref=2749.0 Pref=100000.0 mass=51.9961  metallicity_coeff=0.0
+
Cr           delta_vapH=394200.0 Tref=2749.0 Pref=100000.0 mass=51.9961  metallicity_coeff=0.0
Mg delta_vapH=521700.0 Tref=2303.0 Pref=100000.0 mass=140.6931 metallicity_coeff=2.3025
+
Mg           delta_vapH=521700.0 Tref=2303.0 Pref=100000.0 mass=140.6931 metallicity_coeff=2.3025
Na delta_vapH=265900.0 Tref=1624.0 Pref=100000.0 mass=78.0445  metallicity_coeff=1.1513
+
Na           delta_vapH=265900.0 Tref=1624.0 Pref=100000.0 mass=78.0445  metallicity_coeff=1.1513
KCl delta_vapH=217900.0 Tref=1495.0 Pref=100000.0 mass=74.5498  metallicity_coeff=0.0
+
KCl           delta_vapH=217900.0 Tref=1495.0 Pref=100000.0 mass=74.5498  metallicity_coeff=0.0
Mn delta_vapH=455800.0 Tref=2064.0 Pref=100000.0 mass=87.0031  metallicity_coeff=2.3025
+
Mn           delta_vapH=455800.0 Tref=2064.0 Pref=100000.0 mass=87.0031  metallicity_coeff=2.3025
Zn delta_vapH=303900.0 Tref=1238.0 Pref=100000.0 mass=97.4450  metallicity_coeff=2.3025
+
Zn           delta_vapH=303900.0 Tref=1238.0 Pref=100000.0 mass=97.4450  metallicity_coeff=2.3025
 
</syntaxhighlight>
 
</syntaxhighlight>
  
Line 48: Line 52:
  
 
- in the callphys.def you have to add the flags
 
- in the callphys.def you have to add the flags
<syntaxhighlight lang="python">
+
<syntaxhighlight lang="text">
# Generic Condensable Tracer
+
# Generic Condensable Species (GCS) Tracer
 
tracer = .true.
 
tracer = .true.
generic_condensation = .true. # to activate condensation
+
generic_condensation = .true.
 +
 
 +
# are condensates precipitating? (rain)
 +
generic_rain = .true.
 +
# kg/kg - default value is 0 – how much condensates are kept when raining
 +
rainthreshold_generic = 1e-10
 +
# are precipitations re-evaporating?
 +
evap_prec_generic = .true.
 +
# evaporation efficiency - default value is 1. - the higher the value, the more efficient the evaporation
 +
evap_coeff_generic = 0.5e5
 +
 
 +
# boundaries - top and bottom of atmosphere
 +
# kg/kg fixed quantity in the deep atmosphere - works as a sink/source - no effect if qvap_deep < 0 (default value is -1)
 +
qvap_deep = 0.20
 +
# kg/kg fixed quantity at the top of atmosphere - works as a sink/source - no effect if qvap_top < 0 (default value is -1)
 +
qvap_top = -1
 +
# to accelerate the convergence of your vap profile in the stratosphere and put the cold trap value in the whole stratosphere (works only in 1D)
 +
align_strato_cold_trap = .false.
  
# ALREADY AVAILABLE
+
# moist convective adjustment for generic tracer
qvap_deep = 0.20 # kg/kg fixed quantity in the deep atmosphere - works as a sink/source
+
moistadjustment_generic = .true.
qvap_top = 1.5e-3 # kg/kg fixed quantity at the top of atmosphere - works as a sink/source
+
# inhibition of moist convection (in H2-dominated atmospheres) if vapor amount exceeds a critical mixing ratio (Eq. 17 of Leconte et al. 2017)
perfect_vap_profile = .true. # to cheat your profile and put the cold trap value in the whole stratosphere for example (can be tuned) in 1D only
+
moist_convection_inhibition = .false.
generic_rain = .true. # to make condensates precipitating
 
evap_prec_generic = .true. # to re-evaporate precipitations
 
rainthreshold_generic = 1e-10 # kg/kg - default value is 0 – how much condensates are kept
 
evap_coeff_generic = 0.5e5 # evaporation efficiency - default value is 1.
 
  
# SOON AVAILABLE
+
# (should be checked for energy balance) in convadj, virtual potential temperature instead of potential temperature
virtual_convadj = .true. # in convadj, virtual potential temperature instead of potential temperature
+
virtual_correction = .false.
moistadjustment = .true. # moist adjustment for generic tracer
 
 
</syntaxhighlight>
 
</syntaxhighlight>
  
 
if you want to make it radiative active (taking into account the variable quantity), you have to build a 5d corrk table and add this flag:
 
if you want to make it radiative active (taking into account the variable quantity), you have to build a 5d corrk table and add this flag:
<syntaxhighlight lang="python">
+
<syntaxhighlight lang="text">
 
varactive = .true.
 
varactive = .true.
 
</syntaxhighlight>
 
</syntaxhighlight>

Latest revision as of 15:30, 29 April 2024

(Mistake in the title: Specie -> Species)

Generic Condensable Species are often reffered in the code as "GCS".

What to add it in my set up

- profile_TRACERNAME_vap & profile_TRACERNAME_ice files (similar to « profile » for temperature) to initialize

- in « traceur.def » (flag is « tracer » but name file is « traceur »…), add the lines :

#ModernTrac-v1
2
TRACERNAME_vap is_condensable=1
TRACERNAME_ice is_condensable=1

- in « gases.def » :

# gases
3
H2_ (or other main gaz)
He_ (or other main gaz)
TRACERNAME
0.85
0.15
-1

- in datadir/ (datagcm), add a file « table_tacers_condensable » with lines similar to :

#name_traceur delta_vapH=J/mol     Tref=K      Pref=Pa       mass=g/mol    metallicity_coeff        heat_capacity_at_constant_pressure
CH4           delta_vapH=10000.0   Tref=90.69  Pref=11700    mass=16.0425  metallicity_coeff=0.0    RCPV_generic=1709
Fe            delta_vapH=401900.0  Tref=2903.0 Pref=100000.0 mass=55.8450  metallicity_coeff=0.0
Cr            delta_vapH=394200.0  Tref=2749.0 Pref=100000.0 mass=51.9961  metallicity_coeff=0.0
Mg            delta_vapH=521700.0  Tref=2303.0 Pref=100000.0 mass=140.6931 metallicity_coeff=2.3025
Na            delta_vapH=265900.0  Tref=1624.0 Pref=100000.0 mass=78.0445  metallicity_coeff=1.1513
KCl           delta_vapH=217900.0  Tref=1495.0 Pref=100000.0 mass=74.5498  metallicity_coeff=0.0
Mn            delta_vapH=455800.0  Tref=2064.0 Pref=100000.0 mass=87.0031  metallicity_coeff=2.3025
Zn            delta_vapH=303900.0  Tref=1238.0 Pref=100000.0 mass=97.4450  metallicity_coeff=2.3025

delta_vapH is enthalpy of condensation or sublimation (choose it depending on your P/T conditions).

Tref and Pref are temperature and pressure reference for state change law (Clausius-Clapeyron).

mass is the molar mass.

metallicity_coeff is the metallicity (if you're not concerned by metallicity you can put it to zero).

RCPV_generic is the heat capacity at constant volume (needed for moist convection adjustment).

- in the callphys.def you have to add the flags

# Generic Condensable Species (GCS) Tracer
tracer = .true.
generic_condensation = .true.

# are condensates precipitating? (rain)
generic_rain = .true.
# kg/kg - default value is 0 – how much condensates are kept when raining
rainthreshold_generic = 1e-10
# are precipitations re-evaporating?
evap_prec_generic = .true.
# evaporation efficiency - default value is 1. - the higher the value, the more efficient the evaporation
evap_coeff_generic = 0.5e5

# boundaries - top and bottom of atmosphere
# kg/kg fixed quantity in the deep atmosphere - works as a sink/source - no effect if qvap_deep < 0 (default value is -1)
qvap_deep = 0.20
# kg/kg fixed quantity at the top of atmosphere - works as a sink/source - no effect if qvap_top < 0 (default value is -1)
qvap_top = -1
# to accelerate the convergence of your vap profile in the stratosphere and put the cold trap value in the whole stratosphere (works only in 1D)
align_strato_cold_trap = .false.

# moist convective adjustment for generic tracer
moistadjustment_generic = .true.
# inhibition of moist convection (in H2-dominated atmospheres) if vapor amount exceeds a critical mixing ratio (Eq. 17 of Leconte et al. 2017)
moist_convection_inhibition = .false.

# (should be checked for energy balance) in convadj, virtual potential temperature instead of potential temperature
virtual_correction = .false.

if you want to make it radiative active (taking into account the variable quantity), you have to build a 5d corrk table and add this flag:

varactive = .true.

Radiative considerations

The model can take into account the radiative effects of Generic condensable specie in the radiative transfer. This is only tested for Hot Jupiter simulations for now. Here is just a copy of the merge request to include the code into the master branch. This will need further editing:


We can activate the scheme by putting aerogeneric = # of aerosols in callphys.def. This is the only needed thing for activating the radiative effects. They must be tracer in modern tracer.def

Commented out the abort if we use more than 4 aerosols

Added reading of optprop files for Radiative Generic Condensable Aerosols

We use the same file for IR and VI channel. For now, only MnS, Cr,Fe and Mg2SiO4 can be read. If you want to add another specie, check the code, it is explained how to quickly do that (right above the Initializations)

Added radii calculation for Radiative Generic Condensable aerosols

Changed the hardcoded size of the totalemit array

The hardcoded size is now 1900 instead of 100 so we don't exceed the array size when working at high spectral resolution (very rare case)

Added opacity computation for Radiative Generic Condensable aerosols

We do this computation in the same fashion as what's performed on water and dust.

switch iniaerosol and initracer order, to prepare for the RGCS scheme

Needed to switch the order of initialization so we can use the RGCS scheme without the assumption that ice and vap tracer of the same specie are following each other in the traceur.def file All my commits regarding the radiative effects of generic tracers. A lot of changes have been made. I've rebased the branch on the latest revision of master + squashed a lot of commits together to avoid the "avalanche de commits". By default, the scheme is NOT activated. Read above on how to activate it


Adding stuff on how to really add a specie (because I'm once again stuck even though I coded that)

go to suaer_corrk. There, need to add the reading of the optical properties file.

Check that in your datadir, the table_tracers_condensable containe the species you wan. You need to have delta_vapH Tref, Pref, mass and metallicity_coeff. In you have all that, you need your traceur.def with the mmol (actually we do't since it's in the table ? check that because weird), the radius and is_condensable=1, is_Rgcs=1