You can download the tar.gz archive of the source code here.
This archive corresponds to the version used by E. Marcq et al. in their 2017 paper available here.
Contents of README.txt
This code was used to produce the results discussed in Marcq et al. (2017) paper. It simulates a 1D atmospheric column of H_{2}O and CO_{2} above a solid surface, and computes a lowresolution spectrum of the thermal emission at the top of the atmosphere. For more information about the physics of the model, please refer to the above cited paper:
 E. Marcq, A. Salvador, H. Massol and A. Davaille, Thermal radiation of magma ocean planets using a 1D radiativeconvective model of H_{2}OCO_{2} atmospheres, JGR (2017)
It makes extensive use of the provided and publicly available DISORT radiative transfer code:
 K. Stamnes et al., Numerically stable algorithm for discreteordinatemethod radiative transfer in multiple scattering and emitting layered media, Appl. Opt. 27 (1988)
Prerequisites
A working Fortran 90/95 compiler is required. Our code has only been tested using the following Fortran compilers and OS:
 pgfortran 13.100 64bit under Scientific Linux release 6.8 (x86_64)
 gfortran 5.4.0 under Ubuntu 16.04.2 LTS (x86_64)
Although not strictly necessary, it is strongly recommended to have a working f2py installation, available in the NumPy library for Python 2.7+. This enables to use the model through any Python v2.7+ environment with Numpy installed.
Contents
Source code tree
sub_radconv.f95  make_profiles.f95    steam.f90  make_tauk.f95    k_correle.f95    make_tau_grey.f95  make_tau_grey.f95  disort_wrapper.f95  (all provided DISORT subroutines)
Auxiliary files
kspectrum/g.dat
 ggrid for kcorrelated data
kspectrum/T.dat
 Tgrid for kcorrelated data
kspectrum/p.dat
 pgrid for kcorrelated data
kspectrum/Q.dat
 Qgrid for kcorrelated data
kspectrum/WATER_COEF.[27]00K
 H_{2}OH_{2}O continuum LUT from MTCKD
kspectrum/co2_cont.txt
 CO_{2}CO_{2} continuum LUT from B. Bézard
kspectrum/corrk_[0035].dat
 kcorrelated coefficients computed by KSPECTRUM
results/
 directory required for diagnostic Fortran outputs (created empty by unpacking the *.tar.gz file, so it should be OK).
Installing
 untar the archive file
 compile the source files
 using the
compil_python.sh
script (if you have a workingf2py
installation) to produce a Python library namedradconv1d.so
that you can import from Python — you may want to change the path to your python installation in this script.  using the
compil_fortran.sh
script for a Fortranonly installation. This will produce aradconv1d
executable file. The main program is just a wrapper which provides the main subroutine the required inputs (see below for a description of these inputs).
 using the
Using the model with Python (recommended)
Example 1 (main subroutine)
from radconv1d import radconv Ttop_out, flux_up, P0_v, P0_c, P0_o, spectrum = radconv(Tsurf, Ttop_in, Psurf_v, Psurf_c, Psurf_o, Ttop_flag, cloud_flag, cont_flag, grey_flag, GP_flag, spher_flag, alb_clear, alb_cloud, const_sol, g0, Rt, Nz)
Input parameters
Tsurf
 Surface temperature in K
Ttop_in
 Starting mesospheric temperature in K. 200 is a recommanded value.
Psurf_v
 Total surface pressure of H_{2}O in Pa (including liquid H2O if any)
Psurf_c
 Total surface pressure of CO_{2} in Pa
Psurf_o
 Total surface pressure of N_{2} in Pa
Ttop_flag
 if == 1, Ttop will not be altered. Else, the model will try to adjust Ttop so that the TOA divergence of OLR is null. This results in unrealistically cold mesospheres, and is kept only in anticipation of stellar heating modeling!
cloud_flag
 if == 0, clouds won't be radiatively active. If == 1, Earthlike clouds are radiatively assumed. If == 2, Venuslike clouds are radiatively assumed (not realistic for H_{2}Orich atmospheres)
cont_flag
 if == 0, no continuum opacity is included. If == 1, only CO_{2}CO_{2} opacity is included. If == 2, only H_{2}OH_{2}O opacity is included. If == 3, H_{2}OH_{2}O and CO_{2}CO_{2} opacities are included (recommended).
grey_flag
 if == 0, line opacities are computed according to kcorrelated data (slow, but more realistic). Else, line opacities will be averaged over the whole spectrum (much faster, but less accurate for the total integrated OLR, and plainly wrong for the OLR spectrum).
GP_flag
 if ==1, H_{2}O steam is treated as an ideal gas. Else, its EOS is given by the included steam tables.
spher_flag
 future flag for sphericity corrections. Should be set equal to 0.
alb_clear
 Prescribed albedo without clouds. Preliminary SW calculations yield about 0.2 around a Gstar.
alb_cloud
 Prescribed albedo with clouds. Preliminary SW calculations yield about 0.7 around a Gstar.
const_sol
 Averaged stellar constant in W/m². == 1/4 of its value at the substellar point.
g0
 Surface gravity in m/s²
Rt
 Planetary radius in m
Nz
 Number of computational layers. Typically around 200.
Outputs
Ttop_out
 Final mesospheric temperature
in K (differs from
Ttop_in
only ifTtop_flag != 1
). flux_up
 Total OLR in W/m²
P0_v
 Gaseous surface pressure of H_{2}O in Pa (excluding surface liquid H_{2}O if any).
P0_c
 Gaseous surface pressure of CO_{2} in Pa (== Psurf_c in this version)
P0_o
 Gaseous surface pressure of N_{2} in Pa (== Psurf_o in this version)
spectrum
 Spectrum of OLR in W/m²/cm^{1} in each of the 36 bands. Boundary wavenumbers are given below:
sigmas = np.array([0., 40., 160., 280., 380., 500., 582., 600., 720., 752., 800., 900., 1000., 1200., 1350., 1450., 1550., 1650., 1750., 1850., 1950., 2050., 2200., 2500., 2800., 3200., 3600., 4000., 4400., 4800., 5900.,6000., 6500., 8000., 8300., 9300., 10100.]) # in invcm
Example 2 (make_profile
only)
from radconv1d import make_profiles Z, T, Pv, Pc, Po, rho_v, rho_c, rho_o, ibottom, itop = make_profiles(GP_flag, g0, Rt, Tsurf, Psurf_v, Psurf_c, Psurf_o, Ttop, Nz)
Input parameters
See above.Outputs
Z

(Nz+1)
long 1D array of boundary altitudes for computational layers in m. T

(Nz+1)
long 1D array of boundary temperatures for computational layers in K. Pv

(Nz+1)
long 1D array of boundary H_{2}O pressures for computational layers in Pa. Pc

(Nz+1)
long 1D array of boundary CO_{2} pressures for computational layers in Pa. Po

(Nz+1)
long 1D array of boundary N_{2} pressures for computational layers in Pa. rho_v

(Nz)
long array of H_{2}O densities within computational layers in kg/m^{3}. rho_c

(Nz)
long array of CO_{2} densities within computational layers in kg/m^{3}. rho_o

(Nz)
long array of N_{2} densities within computational layers in kg/m^{3}. ibottom
 index of the lowermost computational layer in the moist adiabat layer
itop
 index of the uppermost computational layer in the moist adiabat layer
Using the model with Fortran only
Starting from the provided test_radconv1d.f90
Fortran wrapper, the user is free to provide required inputs to
the main subroutine named RADCONV
, and process its
ouputs afterwards. If no spectral output is required but merely
vertical profiles in composition, density and temperature, you
can call only MAKE_PROFILES
instead
of RADCONV
.
For the physical meaning of the inputs and outputs of the aforementioned subroutines, please refer to the Python section hereabove.
Contributing
If you find an error in the code or wish to submit a feature request, please contact the author by email.
Author
Dr Emmanuel Marcq, Associate Professor, LATMOS 
Univ. ParisSaclay Tel: +33 1 80 28 52 83
Email: emmanuel.marcq@latmos.ipsl.fr
License
This wode has been released under Creative Common License BYSANC
BY: Licensees may copy, distribute, display and perform the work
and make derivative works and remixes based on it only if they
give the author or licensor the credits (attribution) in the
following manner:
"Author: E. Marcq/LATMOSIPSLUPSAY
(emmanuel.marcq@latmos.ipsl.fr)"
SA: Licensees may distribute derivative works only under a license identical ("not more restrictive") to the license that governs the original work.
NC: Licensees may copy, distribute, display, and perform the work and make derivative works and remixes based on it only for noncommercial purposes.
Acknowledgements
 To K. Stamnes et al. for writing and making publicly available the DISORT code
 To J. Leconte and R. Wordsworth for their help during the testing and development of this code.