Radiation spectra of warm and optically thick coronae in AGNs

A soft X-ray excess above the 2–10keV power-law extrapolation is generally observed in the X-ray spectra of active galactic nuclei. The origin of this excess is still not well understood. Presently there are two competitive models: blurred ionized reﬂection and warm Comptonization. In the case of warm Comptonization, observations suggest a corona temperature in the range 0.1–2keV and a corona optical depth of about 10–20. Moreover, radiative constraints from spectral ﬁts with Comptonization models suggest that most of the accretion power should be released in the warm corona and the disk below is basically non-dissipative, radiating only the reprocessed emission from the corona. However, the true radiative properties of such a warm and optically thick plasma are not well known. For instance, the importance of the Comptonization process, the potential presence of strong absorption and / or emission features, and the spectral shape of the output spectrum have been studied only very recently. Here, we present simulations of warm and optically thick coronae using the titan radiative transfer code coupled with the noar Monte-Carlo code, the latter fully accounting for Compton scattering of continuum and lines. Illumination from above by hard X-ray emission and from below by an optically thick accretion disk are taken into account, as well as (uniform) internal heating. Our simulations show that for a large part of the parameter space, the warm corona with su ﬃ cient internal mechanical heating is dominated by Compton cooling and neither strong absorption nor emission lines are present in the outgoing spectra. In a smaller part of the parameter space, the calculated emission agrees with the spectral shape of the observed soft X-ray excess. Remarkably, this also corresponds to the conditions of radiative equilibrium of an extended warm corona covering a non-dissipative accretion disk almost entirely. These results conﬁrm that warm Comptonization is a valuable model that can explain the origin of the soft X-ray excess.

Both interpretations give a good fit to the data but both have their own limitations (see discussion in García et al. 2019). Blurred ionized reflection models generally require extreme values for the spin and hot corona compactness, as well as large ionization degree and large densities (see e.g., Jiang et al. 2019a,b) which can also significantly reduce the inferred iron abundances compared to typical (e.g., with density generally equal to 10 15 cm −3 ) reflection models (e.g., Tomsick et al. 2018). On the other hand, only a few attempts have been made so far to realistically model the warm corona emission (e.g., Ballantyne 2020). At such low temperature (around 1 keV), large atomic opacities could dominate over the Thomson opacities. This would have two major consequences: Comptonization would not dominate the emitting processes and strong absorption and/or emission features could be present in the output spectrum in contradiction with observations. If true, this would invalidate warm Comptonization as an origin of the soft X-ray excess.
The warm Comptonization modeling of the soft X-ray excess was carefully tested with the data set from the large broadband campaign on Mrk 509 (Kaastra et al. 2011;Petrucci et al. 2013). The data were fitted with the so-called "twocoronae" scenario (see the sketch of Fig. 1). This latter assumes two Comptonization model components, one for the UV-Soft X-rays to simulate the warm corona emission, and one for the hard X-rays to simulate the standard hot corona emission. The model gave statistically good fits for all the observations of the campaign and provided very interesting information on the geometry of each corona (see P13 for more details). Importantly for the present paper, the warm corona was found to agree very well with a powerful, extended, and optically thick plasma covering a nondissipative accretion disk; that is, all the accretion power would be released in the warm corona, the underlying disk radiating only the reprocessed emission produced by the warm corona. Analyses of larger AGN samples give similar conclusions (e.g., P18). While the two-coronae approach has been successfully applied to several AGNs (e.g., Magdziarz et al. 1998;Czerny et al. 2003;Jin et al. 2012;Matt et al. 2014;Mehdipour et al. 2015;Ursini et al. 2016Ursini et al. , 2018Middei et al. 2018Middei et al. , 2019Porquet et al. 2018;Kubota & Done 2018), fundamental questions remain unanswered: Can a warm and optically thick corona exist in the upper layers of the accretion flow? Can its spectral emission be dominated by Comptonization and be in agreement with the observed soft and smooth X-ray spectral shape?
A realistic radiative transfer study of an optically thick and warm plasma is not simple however. The optical depth is neither very small nor very large, meaning that radiative transfer cannot be simply approximated. As mentioned above, the temperature is also in a range of values where lots of ions are expected and line emission and/or absorption processes have to be included. Last but not least, the corona heating power has to be locally released as suggested by observations. Różańska et al. (2015, hereafter R15) performed a theoretical study of the existence of such a warm optically thick corona at the surface of a standard accretion disk assuming both radiative and hydrostatic equilibrium. This latter study shows that it is indeed possible to obtain solutions that have the required temperature. Specifically the best conditions are obtained when most of the power of accretion is released into the corona rather than the disk. Nevertheless, the requirement of hydrostatic equilibrium with the underlying disk puts an upper limit on the warm corona optical depth of approximately five. However, R15 also showed that for larger optical depth, large magnetic-to-gas pressure is needed (>30) to keep such a thick corona in hydrostatic equilibrium with negligible free-free emission. The impact of magnetic pressure on the formation of the warm corona has recently been studied in the case of accretion disks in X-ray binaries (XrB) by Gronkiewicz & Różańska (2020). While the estimates of R15 suggest that a warm corona could indeed exist, no spectral emission was simulated. Line radiative transfer was also left out of the computation, preventing a clear answer to the importance of the emission and/or absorption lines in the thermal equilibrium and the output spectrum produced by this optically thick and warm plasma.
The goal of this paper is to simulate energy-dependent spectra of warm coronae in radiative equilibrium thanks to the state-of-the-art radiative transfer code titan coupled with the Monte-Carlo code noar (Dumont et al. 2003). We first introduce a few parameters and recall in Sect. 2 some analytical estimates of radiative transfer equations in the case of a gray optically thick scattering medium with dissipation. We detail the main characteristics of the titan and noar codes in Sect. 3.1 and present the results of our simulations in Sect. 3. We discuss these results in Sect. 4 before presenting our conclusions.

Analytical estimates
We recall here the analytical solutions of radiative transfer equations for the warm corona with additional heating located above an accretion disk. To ease the analysis, we adopt here a number of simplifying assumptions with respect to the numerical calculations described in the following section. Here we assume Fig. 1. Sketch of the two coronae approach. A hot (kT ∼ 100 keV) and optically thin (τ ∼ 1) corona (in red) is present in the inner parts of the accretion flow close to the black hole. This produces the hard X-ray emission through Comptonization of the soft photons coming from the outer part of the flow. The outer accretion flow is a vertically structured accretion disk (a zoom is shown in the figure) with cold and optically thick matter in the deeper layers (in black), characterized by a temperature T bb and threaded by a vertical radiative flux F disk , while the upper layers (in orange) are composed of a warm (kT ∼ 1 keV) and optically thick (τ cor ∼ 10-20) corona possessing a source of internal heating power Q(τ). The warm corona is also illuminated from above by an illumination flux F Illum produced by the hot corona. This sketch is partly inspired from Różańska et al. (2015). a gray atmosphere with pure scattering (i.e., we neglect emission and absorption from bound-free and bound-bound transitions). We also assume that the atmosphere is optically thick, and therefore adopt the Eddington approximation in the whole medium. We assume a constant density n H throughout the atmosphere and we use τ cor to refer to its total Thomson optical depth. The corona is assumed to be heated with a uniform rate per unit optical depth and per unit solid angle Q (erg s −1 cm −2 str −1 ). For simplicity, we neglect any illumination from above the corona. The disk is supposed to radiate like a black body of temperature T bb and we use B to denote the frequency integrated black-body radiation intensity, that is, B(T bb ) = σT 4 bb /π. The disk is also characterized by its intrinsic flux F int disk produced through internal dissipation (see Fig. 1). The disk can still radiate (B > 0) even if the disk is nondissipative, that is, F int disk = 0. In this case, it radiates only by reprocessing the corona flux emitted downward towards the disk. On the other hand, if the corona intercepts only a small fraction of the disk emission, B can be very small, and potentially vanish.
We follow the analytical computations of R15, but we present the equations in a slightly different way, which is useful to understand the results of the numerical simulations presented in the following sections. From now on, the part of the radiative transfer variables emitted upward with respect to the disk is denoted with a plus symbol (+) and the part emitted downward is denoted with a minus symbol (−).
The frequency-integrated radiation transfer equation with an additional input energy rate per unit optical depth and solid angle Q, can be written as: where µ is the cosine of the azimuthal angle. The optical depth, τ is measured downward, from the top of the corona toward A85, page 2 of 12 the disk, I(µ, τ) is the radiation true intensity, and J(τ) is the radiation mean intensity, that is, the intensity averaged over the angles. In a gray atmosphere and assuming the Eddington approximation in the whole medium, the parts of the radiation intensity emitted upward (µ > 0) I + (τ) and backward (µ < 0) I − (τ) are given by: where H(τ) is the zeroth moment of Eq. (1). It gives the net flux crossing the corona at each optical depth τ inside the slab. Following R15, the expressions of J(τ) and H(τ) are given by: where F out is the corona escaping radiation flux at its surface 1 , that is, at τ = 0. In these equations, the parameter χ is defined by where F cor is the flux produced through dissipation in the corona: From Eq. (5), χ can be rewritten as: Now, at the base of the corona, we simply have: Combining Eqs. (4), (5), and (9), we can express H(τ cor ) as a function of the different parameters of the problem: The function H(τ cor ) gives the net flux crossing the base of the corona, that is, the difference between the flux emitted upward inside the corona and the flux emitted downward by the corona inside the disk. This difference cannot be smaller than −τ cor Q/2 which is reached in the extreme case of no disk emission (B = 0). The value of H(τ cor ) can be interpreted in terms of different conditions of the disk-corona radiative equilibrium: -H(τ cor ) = 0: this corresponds to χ = 1. This is the condition when the upward flux perfectly compensates the downward flux at the base of the corona. In the case of a warm corona covering the disk entirely, this imposes that the disk is nondissipative, that is, F int disk = 0 -H(τ cor ) > 0: this corresponds to χ < 1. In this case, the upward flux entering the warm corona at its base is larger than the downward one. This is the case of slab corona above a dissipative disk with F int disk > 0, for example. -H(τ cor ) < 0 but > − τ cor Q 2 : this corresponds to 2 > χ > 1. In this case, the upward flux entering the warm corona at its base is smaller than the downward one. One example of this is the case of a patchy corona above a nondissipative disk (F int disk = 0), where part of the disk emission does not entirely reenter the warm corona.
These analytical results do not take into account heating due to external illumination or other radiation processes (lines, edges, free-free). The full treatment of the radiation transfer problem requires numerical simulations presented in the following sections.

TITAN and NOAR code
To calculate the radiative equilibrium and the output spectra of a dissipative warm corona we used the newest version of the radiative transfer code titan (Dumont et al. 2003) coupled with the Monte-Carlo noar code (Dumont et al. 2000;Abrassart & Dumont 2001).
titan is a one-dimensional code that allows the user to compute the structure-and angle-dependent emergent spectra of hot photoionized gas by solving the radiative transfer simultaneously with ionization and thermal equilibrium. This can be done assuming a constant density, a constant pressure, or a hydrostatic equilibrium prescription. On the "top" side of the gas slab, titan allows illumination by radiation of any spectral energy distribution (SED); on the "disk" side it allows the boundary condition to be set for black-body illumination to account for the presence of a colder disk underneath.
Assuming the balance between ionization and recombination of ions, excitation and de-excitation, and the most important atomic lines, titan computes the physical state of the gas at each depth in thermal and pressure equilibrium. About 4000 line transitions are included in the titan code. The population of each ion level is computed by solving the set of ionization equations coupled with the set of statistical equations describing the excitation equilibrium in full nonlocal thermal equilibrium (NLTE). Free-free emission is fully taken into account. The code was designed to work with optically thick media and solves the radiative transfer equation both in continuum and lines using the Accelerated Lambda Iteration (ALI) method (Collin et al. 2004). The computations are done assuming a complete redistribution function in the lines. Partial redistribution is mimicked by a Doppler profile for some of the most intense resonant lines.
The Compton heating and cooling balance of the matter is taken into account by solving simultaneously for the temperature structure and the radiation field. Although Titan includes most relevant processes, it does not take into account the Compton heating of the radiation field and the corresponding photon energy shift via Comptonization in the emergent spectra. The former effect is mainly significant for χ > 1 and in this case the temperature computed by titan can be overestimated by a factor of a few. To take into account the latter effect, we use the Monte Carlo code noar that takes the density, temperature, and ionization structure of the slab calculated by titan and computes the emergent spectra on both sides of the slab.
The coupling between titan and noar allows a complete treatment of the emission from a photoionized, Comptonized medium. It can be used in a variety of cases, such as illuminated disk atmospheres (Różańska et al. 2002) and warm absorbers (Różańska et al. 2006) in AGNs.
For the purpose of this paper we consider a warm constantdensity corona and an illumination from above, normal to the disk 2 . The computational pipeline that we built runs titan with different values of the following parameters: gas density n H in the range [10 9 -10 14 ] cm −3 , total optical depth τ cor in the range , local heating rate q h in the range [10 −23 -10 −19 ] erg s −1 cm 3 , ionization parameter ξ 0 of the "top" side illumination 3 (assuming a power law with spectral photon index of 1.8 in the energy range 50 eV-100 keV) in the range [10-3 × 10 5 ] erg s −1 cm and illumination black-body temperature T bb on the "disk" side in the range [3 × 10 4 -10 6 ] K. We emphasize that the ionization parameter ξ 0 is directly linked to the flux of the incoming radiation at the surface of the slab, but titan takes also into account the spectral shape of this incoming radiation in the radiative transfer computation. The mechanical heating rate q h is supposed to be uniform throughout the entire slab. It is related to the heating power per unit optical depth and solid angle Q defined in Sect. 2: titan computes the ionization and temperature structure of the slab. We then use this structure to run noar in order to simulate the effects of photon energy shifts due to Comptonization.
We run noar twice: once illuminating the slab by the power law, and then invert the structure and illuminate it with a blackbody SED in order to simulate the soft flux from the disk below the corona. We then normalize the obtained spectra from photons to physical unit by correlating them with titan. In this way, despite two independent runs of noar, we can obtain the combined spectrum of reflection and soft Comptonization or either of the components separately. In the end, the final spectra are analyzed to extract the values shown in the maps.
We performed hundreds of simulations varying the five parameters n H , τ cor , q h , ξ 0 and T bb . For each simulation, we can compute the value of χ given by (see Eqs. (8) and (10)): Some of these simulations did not converge in some part of the parameter space. The true reason for this is not clear yet. The matter on the back side of the cloud can become too cool and too optically thick, below the actual limitations of the titan code. However, this lack of convergence could also be linked to thermal instabilities that could exist at large τ. While it is not a problem that is simple to understand and solve, it has no impact on the results of the present paper since this part of the parameter space (mainly characterized by q h < 10 −23 erg s −1 cm 3 ) is not relevant to emission in the soft X-ray band (overly low corona temperature). For this reason, we present only simulations with q h > 10 −23 erg s −1 cm 3 . We plan to improve titan simulations for gas of much greater optical depth in future work. Moreover, since the main goal of this analysis is to study the spectral properties of the warm corona, we only consider the intrinsic warm corona emission spectrum and ignore any reflected components originating from the hot corona. Reflection due to external illumination will be considered in a forthcoming paper.

Results
The two following sections present results from a subset of simulations where the warm corona density n H = 10 12 cm −3 , the disk temperature T bb = 10 5 K, and the ionization parameter ξ 0 = 10 3 erg s −1 cm. These are typical values (e.g., Rees 1984) for AGNs with a black hole mass of 10 8 solar masses such as for example Mkn 509. We discussed the effects of these parameters on our solutions in Sect. 3.2.3.

Compton dominated
The left panel of Fig. 2 shows a map of the ratio of the Compton cooling p compt to the warm corona internal heating q h in the χ-τ cor plane. The color scale goes from 20 to 100%. For a very large part of the parameter space, Compton cooling is clearly the dominant (>90%) cooling process that balances the internal heating of the warm corona. This is the first important result of this work; it justifies the main hypothesis used in the twocoronae approach where the warm corona emission is modeled with pure Comptonization codes.
The Compton cooling becomes less dominant at lower χ and larger τ cor where free-free and line processes start to play a role. The right panel of Fig. 2 shows the vertical distribution of the different heating and cooling processes for two simulations with τ cor = 20 but with two different values of χ : 1.35 and 0.753. This corresponds to the two simulations indicated by an "x" and a "+", respectively, in the left panel of Fig. 2; Compton cooling represents more than 90% of the total cooling processes in the case χ = 1.35, and less than 70% for χ = 0.753.
The solid green line overplotted in the left panel of Fig. 2 corresponds to the condition χ = 1, that is, the value expected in the case of radiative equilibrium between a slab corona and the nondissipative disk that it covers entirely (see Sect. 2). The region above the green line agrees with a nondissipative disk covered by a patchy corona. The dashed contours in the left panel of Fig. 2 correspond to different values of the covering factor from 0.95 to 0.40 (see Eqs. (A.6) and (A.9) for the general expression of χ as a function of the covering factor). On the other hand, the region below the green lines agrees with a slab corona above a dissipative disk.

Temperature and spectral shape
The left panel of Fig. 3 shows the same map of the ratio of the Compton cooling p compt to the warm corona internal heating q h as in Fig. 2 but we have now over plotted the contours of the average corona temperature in dotted lines. This tem- dτ. An example of the temperature vertical distribution T (τ) for τ cor = 20 and χ = 1.35 and 0.753 is plotted in the right panel of Fig. 3. The Compton cooling being dominant, the electron temperature naturally decreases with τ due to the increase of the soft photon flux while the heating Q is assumed to be constant (see R15). As expected, for larger χ (i.e., larger corona heating with respect to the total radiative cooling) the corona temperature is higher. For each simulation, our code also computes the spectrum emitted upward by the warm corona. Each spectrum is fitted above 100 eV with a cut-off power law. The dot dashed lines reported in the left panel of Fig. 3 correspond to different spectral photon indices of these spectra between 1.8 and 4.5. As an example, Fig. 4 shows the simulated spectra emitted by the warm corona for τ cor = 20 and χ = 1.35 (red line) and 0.753 A85, page 4 of 12 p compt (τ)dτ to the warm corona heating (q h ) ratio in the χ-τ cor plane, with χ being defined by Eq. (12). The color scale on the right ranges from 20 (black) to 100% (white). The other parameters are fixed to T bb = 10 5 K, ξ 0 = 10 3 erg s −1 cm, and n H = 10 12 cm −3 . The solid green line refers to χ = 1, that is, the case of radiative equilibrium between a corona and a nondissipative disk that it covers entirely; it divides the χ-τ cor into two regions that can be characterized by different radiative equilibrium properties (see Sect. 2). The region above the green line, that is, χ > 1, agrees with a nondissipative disk covered by a patchy corona. The dashed lines correspond to different values of the corona covering factor from 0.95 to 0.40 (see Eq. (A.9)). The region below the green line, that is, χ < 1, agrees with a slab corona above a disk which is now dissipative (F disk > 0). The blue contours correspond to different values of the logarithm of the warm corona heating q h (in unit of erg s −1 cm 3 ). Right: cooling and heating process fractions with respect to the warm corona heating q h across the corona for τ cor = 20 but for two different values of χ, 0.753 (bottom) and 1. 35 (top). This corresponds to the simulations indicated in the left panel with either a "+" or an "x", respectively.
(blue line). In the former case, the spectrum can be fitted with a cut-off power law with Γ 2.5 and E c 2 keV while for χ = 0.753 we find Γ 4.3 and E c 10 keV 4 . We also report in this figure the black-body spectrum (black line) emitted by the disk at the bottom of the warm corona. The difference in flux between the disk black-body and the corona spectra results from the large opacity of the warm corona. This reduces the flux of the disk by a factor of approximately 1 1 + 3 4 τ cor after scattering through the corona. Observationally, when fitted with a Comptonization model, the photon index of the soft X-ray excess is generally between 2.2 and 3.2 and peaks around 2.5 and the temperature is between ∼0.1 and ∼2 keV (see e.g., P18 and references therein). Very interestingly, there is a region of our parameter space with the correct range of temperatures and photon indices. This corresponds to the dark area in the left panel of Fig. 3. Moreover, this region is not far from the solid green line that corresponds to the condition χ = 1, that is, the expected value for a slab corona covering a nondissipative disk entirely. Alternatively, when we compare the position of the dark area of Fig. 3(left) with Fig. 2(left), it is in better agreement with a slightly patchy corona with a covering factor in between ∼0.9 and ∼1. This is another important 4 It is known that an exponential cut-off is a poor approximation of the cut-off of realistic Comptonization models (e.g., Petrucci et al. 2000); it overpredicts the corona temperature by a factor of two to three which is indeed what we observe. result of these simulations, and confirms the modeling done by R15 and agrees with the observational estimates of P13 and P18.
As explained in Sect. 3.1, because titan does not take into account the Compton heating of the radiation field, the plasma temperature can be over-estimated in our computations. However, this effect is only significant for χ > 1, and only the temperatures in the upper part of Fig. 3(left) are expected to be smaller than the ones computed by titan. A precise estimate is not easy to obtain, but it means that the dark region is expected to be even larger than the one shown in Fig. 3.
It is also worth noting that we cannot exclude disk-corona geometries that would combine a lower covering factor with a more dissipative disk. While not impossible, the required fine tuning between the covering factor and the disk intrinsic dissipation to be in the right ranges of observed temperatures and spectral indices is not easy to explain from a physical point of view, making this option relatively unlikely.

Dependencies on ξ 0 , n H and T bb
In order to check the dependency of our results on the different parameters of the simulations, we tested different disk temperatures T bb , different corona densities n H , and different values of the ionization parameter ξ 0 of the illumination from above. Figure 5 presents the contours of the warm corona temperature (blue lines) and warm corona spectral photon index (black dashed lines) in the planes (from left to right) χ-T bb , χ-n H , and χ-ξ 0 for a corona optical depth τ cor fixed to 20. These figures show that for large T bb or low n H or ξ 0 , the temperature and the spectral photon index of the warm corona emission are almost insensitive to these parameters. In the case shown here, that is, τ cor = 20, this corresponds to T bb > 10 5 K, n H < 10 12 cm −3 or ξ 0 < 10 4 . In this region of the parameter space, the properties of the warm corona are mainly driven by χ. However, for smaller T bb or larger density, n H , or ionization parameter, ξ 0 , the radiative and spectral properties of the corona depend significantly on these parameter values. The background colors in Fig. 5 correspond to the Compton-cooling-to-coronaheating ratio p compt /q h , whose color scale is reported on the right of the figure.
The dependencies of the corona emission spectral shape on T bb and n H can be explained by the properties of the Comptonization process in an environment in radiative equilibrium. At low density or high disk temperature, our simulations show that the corona emission is dominated by Comptonization. In this case, as long as the heating over cooling of the warm corona remains constant, no significant spectral variability is expected. The corona heating is directly related to the sum of the internal heating Q and the illumination ξ 0 while the cooling is related to B = σT 4 bb . They are all related to one another through the net flux crossing the base of the corona (see Eq. (10)). As long as the illumination is negligible with respect to warm corona internal heating power, a constant χ implies a constant heating-tocooling ratio and the warm corona temperature is not expected to change. The warm corona optical depth being fixed, the spectral shape of the warm corona emission remains roughly constant. This is very similar to the constancy of the spectral shape of the emission from a hot optically thin corona in radiative equilibrium with the surrounding soft photon field (e.g., Haardt & Maraschi 1991;Haardt 1993;Petrucci et al. 2000;Tortosa et al. 2018).
However, for densities larger than ∼10 12 cm −3 and disk temperatures lower than ∼10 5 K, the dependence on these parameters becomes important. This is due to the fact that in this part of the parameter space, the corona radiative processes are less dominated by Comptonization, either because the soft seed photon flux decreases (at low T bb ) or the free-free and bound-free processes increase (at high density) through their dependence on the density squared. The previous discussion in terms of radiative equilibrium no longer holds. At constant χ, decreasing T bb or increasing n H results in a decrease of the temperature and a steepening of the warm corona spectrum. These conditions are thus less favorable to producing spectra that could reach the soft X-ray band and produce a significant soft X-ray excess.
The dependence of the spectral shape and temperature of the warm corona on the ionization parameter ξ 0 is quite different. The spectral shape and temperature are almost independent of ξ 0 unless this latter becomes larger than a few 10 4 erg s −1 cm. While for such values of ξ 0 , the warm corona is dominated by Compton cooling, the spectral shape (photon index and temperature) varies with ξ 0 and the lower the χ the larger the variation. In fact, increasing ξ 0 increases the heating of the corona which is not compensated by a similar increase of the cooling given the small fraction of the illumination flux that reaches the disk (because of the large corona optical depth) and is reprocessed there. At constant χ, this implies an increase of the warm corona temperature and a hardening of the spectra. This is interesting because it shows that even for small χ, the warm corona can produce spectra in agreement with the soft X-ray excess spectral properties if the illumination is strong enough.
Since the spectral shape and temperature of the warm corona vary in a similar way for opposite variations of the illumination and the density, an increase of the illumination could attenuate any effects seen in the spectral shape caused by an increase in The best fit values for the photon index and high-energy cut-off when the spectra are fitted with a high-energy exponential cut-off power law are indicated in the figure. The simulation corresponding to the red spectrum is represented by the "x" in Fig. 3 and is in the parameter space which agrees with the spectral shape of the soft X-ray excess. On the contrary, the simulation corresponding to the blue spectrum is represented by the "+" in Fig. 3 and has a much steeper spectrum compared to the usual values of the soft X-ray excess. We also report in black the corresponding black-body spectrum emitted by the disk at the bottom of the warm corona. density. To verify this hypothesis, Fig. 6 shows a map of the spectral photon index in the ξ 0 -n H plane. Simulations with large density (>10 14 cm −3 ) can indeed produce spectra with the correct spectral photon index (i.e., in the range [2.2-3.2]) for a large ionization parameter of the illumination (ξ 0 larger than a few 10 4 erg s −1 cm). In this region of the parameter space, the spectral photon index is also relatively dependent on ξ 0 .

Emission and/or absorption lines
As mentioned above, in the region of the parameter space which agrees with the observational constraint of the soft X-ray excess (dark area in Fig. 3-left), Comptonization is the dominant cooling process. This is of course directly related to the assumed extra heating Q which keeps the corona temperature high enough and strongly weakens the cooling due to free-free or line emission. This also means that the presence of emission and/or absorption features in the output spectrum is expected to be small. Figure 7 shows the ionization fraction of iron and oxygen for τ cor = 20 and χ = 0.753 and 1.35. A large fraction of iron is fully ionized at the corona surface (∼30% for χ = 0.753 and >70% for χ = 1.35). Therefore, ionized iron lines are potentially expected, but only around 7 keV and certainly not in the soft X-rays. Correspondingly, oxygen is always fully ionized very deep inside the corona (up to τ = 5 for χ = 0.753 but in the entire corona for χ = 1.35). There is no chance for line emission to get out of the corona without being completely smeared by Comptonization effects. This confirms that no lines are expected from this element and we have checked that this is the case for all the other elements, especially those producing lines below 2 keV (e.g., silicon, magnesium). In conclusion, the spectra presented in Fig. 4 do not show any strong emission and/or absorption features in the energy range where soft X-ray excess is observed.

Brief summary
Here we used the state-of-the-art radiative transfer code titan coupled with the Monte Carlo code noar to simulate the physical and radiative properties of optically thick and dissipative coronae for different sets of optical depth, density, and internal heating power. We also assumed illumination from above by X-rays, characterized by the ionization parameter ξ 0 , and from below by an optically thick accretion disk radiating as a black body with a temperature of T bb . The simulations included all the relevant cooling and heating processes. The vertical temperature profile of the corona was computed assuming radiative equilibrium and the total emitting spectrum (continuum and emitting and/or absorbing features) was produced.
We show that, in a large part of the parameter space, Compton scattering is the dominant cooling process which balances the internal heating power of the corona. Moreover, there is a region of the parameter space where warm (kT in 0.1-2 keV) and optically thick (τ ∼ 20) coronae produce spectra in agreement with the observed soft X-ray excess spectral shape. No strong emission and/or absorption features are observed. This region of the parameter space is also consistent with a slightly patchy corona (covering factor between 0.9 and 1) in radiative equilibrium above a non-dissipative accretion disk, all the power being released in the warm corona. These results are in very good agreement with the physical constraints obtained from the fit of the soft X-ray excess with warm Comptonization model (e.g., P13, P18) and with the theoretical estimates made by R15. However, our more accurate and more physical simulations differ significantly from the ones done by García et al. (2019), where some fundamental ingredients (like the corona internal heating power) were not included. Our results show that a warm and optically thick corona can indeed explain the soft X-ray excess, provided that such coronal heating is allowed.

An accretion disk and two powerful coronae to explain the broad-band spectral emission of radio-quiet AGNs
The results of our analysis crucially depend on the assumption that internal heating power is released in the warm corona up to large optical depth (τ > 10). Indeed, if Q goes to zero, the equations shown in Sect. 2 reduce to the standard radiative profiles of gray atmospheres. On the other hand, the radiative properties of the warm corona are directly related to the conditions of radiative equilibrium with the accretion disk. A powerful warm corona almost entirely covering a nondissipative disk will naturally produce spectra in agreement with the observed soft X-ray excess spectral properties. This is very similar to the case of the hot corona that produces the hard X-ray (above ∼2 keV) emission in radioquiet AGNs. This hot corona is also believed to be dominated by Comptonization and to have its own local heating (e.g., Merloni & Fabian 2001). Furthermore, its radiative properties are strongly constrained by its radiative equilibrium with the surrounding colder regions, which are sources of soft seed photons (e.g., Haardt & Maraschi 1991, 1993Haardt et al. 1997).  5. Contours of the warm corona temperature (blue lines) and the warm corona spectral photon index (black dashed lines) in the planes from left to right: χ-T bb , χ-n H , and χ-ξ 0 . When T bb , n H , or ξ 0 are not variable they are fixed to T bb = 10 5 K, n H = 10 12 cm −3 , and ξ 0 = 10 3 erg s −1 cm. The corona optical depth τ cor is fixed to 20. The background colors correspond to the Compton cooling to corona heating fraction whose color scale is reported on the right. Similarly to Fig. 2 the green line corresponds to the condition χ = 1. However, in order to agree with hard X-ray observations (spectral photon index Γ ∼ 1.9, temperature kT ∼100-300 keV) the hot corona has to be optically thin and significantly patchy (see also discussion in P18).
Combining these constraints for the hot and warm coronae, the UV/soft X-ray/hard X-ray spectral emission of radio quiet AGNs would result from the radiative equilibrium between three main components: a weakly dissipative accretion disk and two powerful coronae, one optically thick and warm and one optically thin and hot (see also e.g., Kubota & Done 2018). Variations in the geometry and/or in the repartition of the heating power among these three components would produce the palette of observed broad-band spectral shapes.

Origin of the warm corona heating
The immediate question raised by this work refers to the origin of the warm corona internal heating power and the reason why it  1.35 (bottom). The other parameters are fixed to T bb = 10 5 K, ξ 0 = 10 3 erg s −1 cm, and n H = 10 12 cm −3 . We note that for χ = 1.350, oxygen is fully ionized throughout the entire corona.
should be preferentially released in the upper layer of the accretion flow rather than in its deeper layers as assumed in standard accretion disk theory (e.g., Shakura & Sunyaev 1973). While a detailed answer to these questions is beyond the scope of this paper, we note that recent simulations and modeling of accretion flows seem to offer some clues. Clearly, the magnetic field A85, page 8 of 12 plays a crucial role here and we naively expect that the buoyant rise of magnetic field generated within a magnetically dominated accretion disk could transport substantial amounts of energy vertically and then heat up the upper layers of the accretion flow (e.g., Merloni et al. 2000;Hirose et al. 2006;Begelman et al. 2015). Very recently, through radiative transfer computation in hydrostatic and radiative equilibrium, Gronkiewicz & Różańska (2020) showed that gas heating by magnetic dynamo (following Begelman et al. 2015) is indeed able to heat the upper layers of the accretion flow up to a few keV for optical depths as great as approximately ten. By construction, in this approach, the underlying disk cannot be completely passive, but these results offer support to the presence of such local heating close to the disk surface. Recent general-relativistic magnetohydrodynamic (GRMHD) simulations also indicate that magnetized disks accrete preferentially through the disk atmosphere where the disk is magnetically dominated (Beckwith et al. 2009;Zhu & Stone 2018;Mishra et al. 2020;Jiang et al. 2019c). Such "coronal accretion" could play the role of our warm corona if some heating linked to the accretion phenomena could be locally released. In another domain of application, 3D radiation-MHD calculations, when applied to protostellar disks, show that the disk surface layer can indeed be heated by dissipating the disk magnetic field, while the disk interior is "magnetically dead" and colder than a standard accretion disk (e.g., Hirose & Turner 2011). These different results suggest that the presence of local heating power at the disk surface and up to optical depths of a few is physically plausible.

Potential impacts of the presence of a warm corona in the upper layers of the accretion flow
The presence of a warm plasma in the upper layers of the accretion flow could have several effects on the dynamical, spectral, and temporal properties of the accretion flow itself. It is already known that a warm corona can stabilize the underlying accretion disk, which is otherwise subject to radiation pressure instability (see Czerny 2019 for a very recent review). More unexpectedly, the presence of a warm corona in the quasar SED has recently been shown to be an important element in reproducing the extreme part of the main sequence of quasars 5 , especially quasars with particularly strong FeII emission (Panda et al. 2019). These two examples show the wide variety of impacts expected from the existence of such a warm corona in the inner regions of an AGN. Below, we indicate a few other effects suggested by the present analysis.

Outflows
A warm corona could play a major role in the production of disk outflows. The fact that the corona could be out of hydrostatic equilibrium has already been pointed out by R15 and outflows may naturally appear (see also the discussion in Gronkiewicz & Różańska 2020). A precise understanding of these effects would require a numerical resolution of the disk-corona vertical equilibrium in the gravitational potential of the central compact object which is far beyond the scope of the present paper where we simply assume a constant coronal density. Nevertheless, we would like to make a few admittedly qualitative remarks. Interestingly, the comparison of wind signatures in AGNs and XrBs with outflow MHD simulations suggests high ejection efficiencies p > 0.5 withṀ acc ∝ R p (Zhang & Xie 2013;Fukumura et al. 2015Fukumura et al. , 2018Chakravorty et al. 2016). Such high values of p are more easily reached if there is some heating deposit at the disk surface (e.g., Casse & Ferreira 2000;Ferreira & Casse 2004). As shown in the present study, the presence of a warm corona could also explain the soft X-ray excess observed in a large number of AGNs, and therefore we could expect to find stronger wind signatures in objects where a strong soft X-ray excess is also present. To our knowledge, no such relation has been observed yet. However, the observational signatures are not obvious given the variability of the wind signatures and the potential dependence on physical parameters such as for example the disk-corona inclination. As we have seen, the importance and the spectral shape of the warm corona emission also depend on parameters like the disk temperature, the density of the warm corona, and illumination by the hot corona. Therefore, even if there is significant heating deposit at the disk surface, which would favor disk outflows, the warm corona emission may not be always sufficient to produce soft X-ray excess.

Spectral variability
We show in Sect. 3.2.3 that at low density, high disk temperature, or low illumination, the corona thermal properties and spectral emission depend almost exclusively on χ. As a consequence, no significant spectral variability is expected unless the warm corona-disk structure changes, for example, if the corona becomes more patchy (χ will increase) or the disk becomes more dissipative (χ will decrease). For densities larger than ∼10 12 cm −3 , disk temperatures lower than ∼10 5 K or corona illumination with ξ 0 larger than 10 4 erg cm s −1 however, the dependence on these parameters becomes important. Moreover, the ranges of density and disk temperature in agreement with a soft X-ray excess spectral shape become narrower. Even if χ remains constant, small changes of n H , T bb or ξ 0 are expected to produce significant spectral variability of the warm corona emission and consequently on the soft X-ray range. Interestingly, high illumination can compensate the limitations due to overly large densities or overly low disk temperatures. However, obtaining the correct spectral shape could require some fine tuning between these parameters.

Reverberation lags
Delays (or "lags") between the different energy bands of the Xray continua have been detected many times in the past 10 years (e.g., De Marco et al. 2013, 2017Kara et al. 2016;Epitropakis et al. 2016). On long timescales, hard X-rays lag behind the soft X-rays while at short timescales the reverse is observed. The former situation is generally interpreted as intrinsic accretion fluctuations which drive the variability from the outer (and colder) parts of the accretion flow to the inner (and hotter) parts. The negative lags (that is, when the soft X-rays lag behind the hard X-rays), on short timescales, are interpreted as reverberation lags and would be due to the time delays between the changes in the direct X-ray continuum and the reprocessed, reflected X-rays from the disk (see Uttley et al. 2014;De Marco & Ponti 2019 for recent reviews). Simulations built to reproduce these lags generally assume the presence of a point-like X-ray source (the so-called lamp-post model) above a cold standard accretion disk (Emmanoulopoulos et al. 2014;Cackett et al. 2014;Chainakun & Young 2015;Epitropakis et al. 2016;Chainakun et al. 2016 but see Chainakun et al. 2019;Mahmoud & Done 2018;Mahmoud et al. 2019 for radially stratified geometries). If this interpretation of the negative lags is correct, part of the soft X-ray emission should be explained by reflected photons. But the presence of a warm corona at the surface of the accretion disk could modify this picture. First, the shape of the reflection component can be different if the presence of a warm corona at the surface of the disk is taken into account, because it can significantly modify the ionization conditions at the surface of the accretion flow. Second, the soft X-ray photons emitted by the warm corona that will reach the observer will have a pathway that is clearly distinct from that of the hard X-ray photons. We can expect that a radially stratified geometry, with the hot corona in the inner region and the warm corona outside covering the inner part of the optically thick accretion disk, will produce time lags between the hard and soft energy ranges. The timing properties of a geometry of this type were recently studied and applied to X-ray binaries (Mahmoud & Done 2018;Mahmoud et al. 2019) and the frequency-dependent lags between the X-ray bands were successfully reproduced. While these results strongly depend on the assumed geometry of the accretion flow, which is little understood, they are encouraging and provide hope for an application in AGNs.

Conclusion
We studied the radiative equilibrium and spectral emission of an optically thick plasma (the so-called warm corona) heated by an internal source of power and illuminated from above by a hard X-ray power law and from below by a disk black-body. Such a plasma has been proposed to explain the soft X-ray excess observed in a large number of AGNs, however its radiative properties have not yet been studied in detail. We made simulations using the latest version of the radiative transfer code titan coupled with the Monte-Carlo code noar, the latter fully accounting for Compton scattering of continuum and lines. We tested different plasma optical depths, densities, internal heating powers, disk temperatures, and ionization parameters of the power law illumination. Our main conclusions are as follows.
-In a large part of the parameter space, the Compton cooling is dominant across all the corona. For a given optical depth, higher internal heating, higher disk temperatures, lower densities, and higher illumination favor this dominance. -The emission and absorption lines are also expected to be weak or completely absent due to the high ionization state of matter in the upper part (τ of a few) of the corona where the ions are highly ionized and even completely stripped. -There is a portion of the parameter space where the spectral emission of the warm corona has spectral properties (spectral index, temperature) similar to those observed for the soft X-ray excess. -This portion of the parameter space is consistent with a warm corona covering a large part of a weakly dissipative accretion disk. These results confirm the modeling done by Różańska et al. (2015), they agree with the observational estimates of Petrucci et al. (2013Petrucci et al. ( , 2018, and they rule out the limitations generally put forward (i.e., no Compton dominance, emission and/or absorption lines expected in the outgoing spectrum) concerning the warm Comptonization modeling of the soft X-ray excess.
However, these conclusions rely on the existence of internal heating power in the corona. This is a mandatory condition for the existence of such warm plasma above the accretion disk. The origin of such an internal heating power is unknown although recent simulations and modeling of magnetized accretion flows seem to offer some support to it.
The dependencies of the warm corona properties on the model parameters (such as e.g., the densities and the hard powerlaw illumination) could explain the diversity of the soft X-ray excess spectral shape and even its absence in some AGNs. This will be studied in a forthcoming paper.
We note that during the completion of our paper, we became aware of a study by Ballantyne (2020, hereafter B20) covering a similar subject. This latter paper is complementary to ours and we discuss here the main differences and similarities. First, in B20 the reflection is included in the output spectra. This makes a comparison to our spectra difficult. Similar to our work however, B20 generally assumes constant corona densities, but the author considers a small range of corona densities of a few 10 14 cm −3 , two orders of magnitude larger than the typical values of 10 12 cm −3 used in our simulations. At such large densities, and even if we have difficulty in obtaining Titan solutions that are able to converge, we do not expect a spectral emission in agreement with the soft X-ray excess spectral shape (see Fig. 5 middle plot). The illumination above the warm corona may certainly play a crucial role here, as explained in Sect. 3.2.3 and in agreement with the conclusions of B20. However, we do not simulate the same range of parameters, and so again a precise comparison is not easy. Our study covers a large range of densities but lower than 10 14 cm −3 . Furthermore, we show that smaller densities help to obtain better conditions to produce a warm corona with the required properties. Interestingly, B20 is also able to study the case of a warm corona with τ cor = 10 in hydrostatic equilibrium, but contrary to R15, this hydrostatic equilibrium does not include the presence of the underlying disk. Even so, the vertical decrease in density of the B20 hydrostatic solution favors the formation of the warm corona. Another important difference between B20 and our analysis is that the corona internal heating in B20 is a fraction of the total dissipation. In this case, increasing the coronal heating implies a decrease of the disk flux while in our calculations the two quantities are disconnected. This allows us to use the internal heating as a free parameter and to explore a larger range of values. In conclusion, our approaches are slightly different and our parameter spaces are not the same. Nevertheless, we both conclude that a warm corona with the correct properties could reproduce the observed soft X-ray excess of type 1 AGNs.
The general radiative equilibrium of a corona above a disk has already been discussed in P18. However a few mistakes are present in this latter paper. We show the correct equations here below in light of the general results discussed in Sect. 2.
Following the notation of this paper, F tot,disk = πB is the total flux emitted by the disk that enters the corona, and F cor = 4πQτ cor is the flux produced by dissipation inside the corona. In the case of a corona dominated by Comptonization (i.e., zero absorption) in plain parallel geometry and coherent scattering (no photon energy gain during scattering) the transmitted and reflected back fluxes of the disk can be written: This equation assumes that F cor is distributed homogeneously in the warm corona and is entirely radiated isotropically, that is, that half of it is emitted upward while the other half is emitted backward.
On the other hand, at the transition between the corona and the disk, the radiative equilibrium imposes: where F rep is the luminosity coming from the warm corona that is reprocessed in the disk (we assume an albedo of zero), F disk,intr is the instrinsic disk heating flux, and C f the warm corona covering factor. A covering factor C f = 1 corresponds to a corona covering the disk entirely, while C f < 1 corresponds to a patchy corona where part of the disk emission is radiated away without crossing the warm corona. Introducing the amplification factor A = 1 + F cor /F tot,disk , these equations can be combined to give: In the case C f = 1 and no intrinsic disk emission, Eq. (A.6) simply gives:  ) and (21) of P18 (assuming the albedo a = 0 and that the corona covers the disk entirely, i.e., g = 1). While Eqs. (19) and (21) of P18 agree with an optical depth of the order unity, they do not stand for large optical depth like the one expected in the warm corona. The main impacts of the use of Eqs. (A.6) and (A.7) of the present paper is on the expression of the amplification factor and of Fig. 1 of P18. The correct version of this figure is shown in Fig. A.1. The conclusions of P18 still apply, that is, the observational characteristics of the soft X-ray excess (i.e., a photon index of ∼2.5 and a temperature in 0.1-2 keV) agree with an extended warm corona covering the disk which is mainly nondissipative.