atmtools / konrad

Implementation of a radiative-convective equilibrium model.
MIT License
19 stars 18 forks source link

SW data-driven radiation model #223

Open pczarnecki opened 4 months ago

pczarnecki commented 4 months ago

Similarly as in the longwave, I've added a radiation scheme option that implements the quadrature scheme described in Czarnecki, Polvani and Pincus 23 in the shortwave for the clear sky. This includes a corresponding shortwave calculation by ARTS, which can be called for any lines and mirrors the longwave. The scheme can be called by using ARTS as the radiation scheme and setting the kwarg quadrature = True in konrad.RCE: radiation = konrad.radiation.ARTS(arts_kwargs = {'quadrature':True}. Otherwise the default value of quadrature is False and calling the ARTS radiation scheme will use the existing ARTS code. The default setting is to use a lookup table for a quadrature configuration of 64 spectral points trained on fluxes and heating rates in the present day as well as forcing by CO2. There is also an option to provide your own model configuration and lookup table by calling arts_kwargs = {'quadrature_filename_lw':'/path/to/lw_filename', 'lookup_filename_lw': 'path/to/lw_filename'}, and similarly for the shortwave {'quadrature_filename_sw':'/path/to/sw_filename', 'lookup_filename_sw': 'path/to/sw_filename'} , where the quadrature file is an xarray with variable W (weights) and S (wavenumbers), and the lookup table is compatible with ARTS. If 'lookup_filename': None, the monochromatic fluxes will be computed on-the-fly with ARTS. As with the longwave, the lookup table must be provided for the ARTS line-by-line calculation, and an analogous function to create said lookup table with the ARTS Disort solver has been written.

lkluft commented 5 days ago

Sorry for letting this hang for so long!

Even though I am planning a major refactor of the radiation part, it makes sense to merge your changes for a clean version to reference.

Could you rebase and push your changes again so the checks can run again? I just fixed some technical issues, so hopefully your PR should be green again.