ARTS 2.5.9 (git: 825fa5f2)
disort.cc File Reference

This file contains functions related to the DISORT interface. More...

#include "disort.h"
#include <cinttypes>
#include <cmath>
#include <cstdlib>
#include <iostream>
#include <stdexcept>
#include "agenda_class.h"
#include "array.h"
#include "arts_constants.h"
#include "auto_md.h"
#include "check_input.h"
#include "arts_conversions.h"
#include "cdisort.h"
#include "interpolation.h"
#include "logic.h"
#include "math_funcs.h"
#include "messages.h"
#include "rte.h"
#include "xml_io.h"

Go to the source code of this file.

Macros

#define MAX_WARNINGS   100
 

Functions

void add_normed_phase_functions (Tensor3View &pfct1, const MatrixView &sca1, const MatrixView &pfct2, const MatrixView &sca2)
 add_normed_phase_functions More...
 
void check_disort_input (const Index &cloudbox_on, const Index &atmfields_checked, const Index &atmgeom_checked, const Index &cloudbox_checked, const Index &scat_data_checked, const Index &atmosphere_dim, const Index &stokes_dim, const ArrayOfIndex &cloudbox_limits, const ArrayOfArrayOfSingleScatteringData &scat_data, ConstVectorView za_grid, const Index &nstreams)
 check_disort_input. More...
 
void check_disort_irradiance_input (const Index &atmfields_checked, const Index &atmgeom_checked, const Index &scat_data_checked, const Index &atmosphere_dim, const Index &stokes_dim, const ArrayOfArrayOfSingleScatteringData &scat_data, const Index &nstreams)
 check_disort_input. More...
 
void init_ifield (Tensor7 &cloudbox_field, const Vector &f_grid, const ArrayOfIndex &cloudbox_limits, const Index &n_za, const Index &n_aa, const Index &stokes_dim)
 init_ifield. More...
 
void get_disortsurf_props (Vector &albedo, Numeric &btemp, ConstVectorView f_grid, const Numeric &surface_skin_t, ConstVectorView surface_scalar_reflectivity)
 get_disortsurf_props. More...
 
void get_gasoptprop (Workspace &ws, MatrixView ext_bulk_gas, const Agenda &propmat_clearsky_agenda, ConstVectorView t_profile, ConstMatrixView vmr_profiles, ConstVectorView p_grid, ConstVectorView f_grid)
 get_gasoptprop. More...
 
void get_gas_scattering_properties (Workspace &ws, MatrixView &sca_coeff_gas, MatrixView &sca_coeff_gas_level, MatrixView &pfct_gas, const ConstVectorView &f_grid, const VectorView &p, const VectorView &t, const MatrixView &vmr, const Agenda &gas_scattering_agenda)
 get_gas_scattering_properties More...
 
void get_paroptprop (MatrixView ext_bulk_par, MatrixView abs_bulk_par, const ArrayOfArrayOfSingleScatteringData &scat_data, ConstMatrixView pnd_profiles, ConstVectorView t_profile, ConstVectorView DEBUG_ONLY(p_grid), const ArrayOfIndex &cloudbox_limits, ConstVectorView f_grid)
 
void get_dtauc_ssalb (MatrixView dtauc, MatrixView ssalb, ConstMatrixView ext_bulk_gas, ConstMatrixView ext_bulk_par, ConstMatrixView abs_bulk_par, ConstVectorView z_profile)
 get_dtauc_ssalb More...
 
void get_angs (Vector &pfct_angs, const ArrayOfArrayOfSingleScatteringData &scat_data, const Index &Npfct)
 get_angs. More...
 
void get_parZ (Tensor3 &pha_bulk_par, const ArrayOfArrayOfSingleScatteringData &scat_data, ConstMatrixView pnd_profiles, ConstVectorView t_profile, ConstVectorView pfct_angs, const ArrayOfIndex &cloudbox_limits)
 get_parZ. More...
 
void get_pfct (Tensor3 &pfct_bulk_par, ConstTensor3View &pha_bulk_par, ConstMatrixView ext_bulk_par, ConstMatrixView abs_bulk_par, const ArrayOfIndex &cloudbox_limits)
 get_pfct. More...
 
void get_pmom (Tensor3View pmom, ConstTensor3View pfct_bulk_par, ConstVectorView pfct_angs, const Index &Nlegendre)
 get_pmom More...
 
void get_scat_bulk_layer (MatrixView &sca_bulk_layer, const MatrixView &ext_bulk, const MatrixView &abs_bulk)
 get_scat_bulk_layer More...
 
void c_errmsg (const char *messag, int type)
 Verbosity enabled replacement for the original cdisort function. More...
 
int c_write_bad_var (int quiet, const char *varnam)
 Verbosity enabled replacement for the original cdisort function. More...
 
int c_write_too_small_dim (int quiet, const char *dimnam, int minval)
 Verbosity enabled replacement for the original cdisort function. More...
 
void reduced_1datm (Vector &p, Vector &z, Vector &t, Matrix &vmr, Matrix &pnd, ArrayOfIndex &cboxlims, Index &ncboxremoved, ConstVectorView p_grid, ConstVectorView z_profile, const Numeric &z_surface, ConstVectorView t_profile, ConstMatrixView vmr_profiles, ConstMatrixView pnd_profiles, const ArrayOfIndex &cloudbox_limits)
 reduced_1datm More...
 
void run_cdisort (Workspace &ws, Tensor7 &cloudbox_field, ArrayOfMatrix &disort_aux, ConstVectorView f_grid, ConstVectorView p_grid, ConstVectorView z_profile, const Numeric &z_surface, ConstVectorView t_profile, ConstMatrixView vmr_profiles, ConstMatrixView pnd_profiles, const ArrayOfArrayOfSingleScatteringData &scat_data, const ArrayOfStar &stars, const Agenda &propmat_clearsky_agenda, const Agenda &gas_scattering_agenda, const ArrayOfIndex &cloudbox_limits, const Numeric &surface_skin_t, const Vector &surface_scalar_reflectivity, ConstVectorView za_grid, ConstVectorView aa_grid, ConstVectorView star_rte_los, const Index &gas_scattering_do, const Index &stars_do, const ArrayOfString &disort_aux_vars, const Numeric &scale_factor, const Index &nstreams, const Index &Npfct, const Index &only_tro, const Index &quiet, const Index &emission, const Index &intensity_correction, const Verbosity &verbosity)
 Calculate doit_i_field with Disort including a star source. More...
 
void run_cdisort_flux (Workspace &ws, Tensor5 &spectral_irradiance_field, ArrayOfMatrix &disort_aux, ConstVectorView f_grid, ConstVectorView p_grid, ConstVectorView z_profile, const Numeric &z_surface, ConstVectorView t_profile, ConstMatrixView vmr_profiles, ConstMatrixView pnd_profiles, const ArrayOfArrayOfSingleScatteringData &scat_data, const ArrayOfStar &stars, const Agenda &propmat_clearsky_agenda, const Agenda &gas_scattering_agenda, const ArrayOfIndex &cloudbox_limits, const Numeric &surface_skin_t, const Vector &surface_scalar_reflectivity, ConstVectorView star_rte_los, const Index &gas_scattering_do, const Index &stars_do, const ArrayOfString &disort_aux_vars, const Numeric &scale_factor, const Index &nstreams, const Index &Npfct, const Index &only_tro, const Index &quiet, const Index &emission, const Index &intensity_correction, const Verbosity &verbosity)
 Calculate spectral_irradiance_field with Disort including a star source. More...
 
void surf_albedoCalc (Workspace &ws, VectorView albedo, Numeric &btemp, const Agenda &surface_rtprop_agenda, ConstVectorView f_grid, ConstVectorView scat_za_grid, const Numeric &surf_alt, const Verbosity &verbosity)
 surf_albedoCalc More...
 
void surf_albedoCalcSingleAngle (Workspace &ws, VectorView albedo, Numeric &btemp, const Agenda &surface_rtprop_agenda, ConstVectorView f_grid, const Numeric &surf_alt, const Numeric &inc_angle)
 surf_albedoCalcSingleAngle More...
 

Variables

constexpr Numeric PI =Constant::pi
 
constexpr Numeric DEG2RAD =Conversion::deg2rad(1)
 
constexpr Numeric PLANCK_CONST =Constant::planck_constant
 
constexpr Numeric SPEED_OF_LIGHT =Constant::speed_of_light
 
constexpr Numeric COSMIC_BG_TEMP =Constant::cosmic_microwave_background_temperature
 
thread_local Verbosity disort_verbosity
 

Detailed Description

This file contains functions related to the DISORT interface.

Author
Claudia Emde claud.nosp@m.ia.e.nosp@m.mde@d.nosp@m.lr.d.nosp@m.e, Manfred Brath manfr.nosp@m.ed.b.nosp@m.rath@.nosp@m.uni-.nosp@m.hambu.nosp@m.rg.d.nosp@m.e
Date
Tue Feb 7 10:08:28 2006, October 27, 2021

Definition in file disort.cc.

Macro Definition Documentation

◆ MAX_WARNINGS

#define MAX_WARNINGS   100

Definition at line 802 of file disort.cc.

Function Documentation

◆ add_normed_phase_functions()

void add_normed_phase_functions ( Tensor3View pftc1,
const MatrixView sca1,
const MatrixView pftc2,
const MatrixView sca2 
)

add_normed_phase_functions

Adds two normalized phase functions, which are represented as Legendre series.

Parameters
[in,out]pftc1Phase function 1 as Legendre series (frequency, layer, plolynomial).
[in]sca1Scattering coefficient phase function 1 (frequency, layer).
[in]pftc2Phase function 2 as Legendre series (layer, polynomial).
[in]sca2Scattering coefficient phase function 2 (frequency, layer).

Definition at line 62 of file disort.cc.

References ARTS_ASSERT, ConstTensor3View::ncols(), ConstMatrixView::ncols(), ConstTensor3View::npages(), ConstTensor3View::nrows(), and ConstMatrixView::nrows().

Referenced by run_cdisort(), and run_cdisort_flux().

◆ c_errmsg()

void c_errmsg ( const char *  messag,
int  type 
)

Verbosity enabled replacement for the original cdisort function.

Definition at line 805 of file disort.cc.

References arts_exit(), CREATE_OUT0, CREATE_OUT1, disort_verbosity, and MAX_WARNINGS.

Referenced by c_write_bad_var().

◆ c_write_bad_var()

int c_write_bad_var ( int  quiet,
const char *  varnam 
)

Verbosity enabled replacement for the original cdisort function.

Definition at line 833 of file disort.cc.

References c_errmsg(), CREATE_OUT1, and disort_verbosity.

◆ c_write_too_small_dim()

int c_write_too_small_dim ( int  quiet,
const char *  dimnam,
int  minval 
)

Verbosity enabled replacement for the original cdisort function.

Definition at line 851 of file disort.cc.

References CREATE_OUT1, and disort_verbosity.

◆ check_disort_input()

void check_disort_input ( const Index cloudbox_on,
const Index atmfields_checked,
const Index atmgeom_checked,
const Index cloudbox_checked,
const Index scat_data_checked,
const Index atmosphere_dim,
const Index stokes_dim,
const ArrayOfIndex cloudbox_limits,
const ArrayOfArrayOfSingleScatteringData scat_data,
ConstVectorView  za_grid,
const Index nstreams 
)

check_disort_input.

*** FIXMEDOC *** in disort.cc, line 197

Checks that input of DisortCalc* is sane.

Parameters
[in]cloudbox_onas the WSV.
[in]disort_is_initializedas the WSV.
[in]atmfields_checkedas the WSV.
[in]atmgeom_checkedas the WSV.
[in]cloudbox_checkedas the WSV.
[in]scat_dataas the WSV.
[in]za_gridas the WSV.
[in]nstreamsNumber of quadrature angles (both hemispheres).
Author
Jana Mendrok
Date
2017-02-23

Definition at line 86 of file disort.cc.

References is_increasing(), Array< base >::nelem(), ConstVectorView::nelem(), PTYPE_AZIMUTH_RND, PTYPE_GENERAL, PTYPE_TOTAL_RND, and PTypeToString().

Referenced by DisortCalc(), and DisortCalcWithARTSSurface().

◆ check_disort_irradiance_input()

void check_disort_irradiance_input ( const Index atmfields_checked,
const Index atmgeom_checked,
const Index scat_data_checked,
const Index atmosphere_dim,
const Index stokes_dim,
const ArrayOfArrayOfSingleScatteringData scat_data,
const Index nstreams 
)

check_disort_input.

Checks that input of DisortCalcIrradiance* is sane.

Parameters
[in]disort_is_initializedas the WSV.
[in]atmfields_checkedas the WSV.
[in]atmgeom_checkedas the WSV.
[in]cloudbox_checkedas the WSV.
[in]scat_dataas the WSV.
[in]nstreamsNumber of quadrature angles (both hemispheres).
Author
Jana Mendrok, Manfred Brath
Date
2017-02-23, 2022-08-12

Definition at line 212 of file disort.cc.

References Array< base >::nelem(), PTYPE_AZIMUTH_RND, PTYPE_GENERAL, PTYPE_TOTAL_RND, and PTypeToString().

Referenced by DisortCalcIrradiance().

◆ get_angs()

void get_angs ( Vector pfct_angs,
const ArrayOfArrayOfSingleScatteringData scat_data,
const Index Npfct 
)

get_angs.

Derives angular grid to derive bulk phase matrix/function data on for further Legendre decomposition.

Parameters
[out]pfct_angsAngular grid of pfct_bulk_par.
[in]scat_dataAs the WSV.
[in]nangNumber of angular grid points in pfct_angs. If<0,

pfct_angs is taken from scat_data (the finest za_grid used over the scat elems), else an equidistant grid with nang grid points is used.

Author
Jana Mendrok
Date
2018-04-04

Definition at line 565 of file disort.cc.

References Array< base >::nelem(), and nlinspace().

Referenced by run_cdisort(), and run_cdisort_flux().

◆ get_disortsurf_props()

void get_disortsurf_props ( Vector albedo,
Numeric btemp,
ConstVectorView  f_grid,
const Numeric surface_skin_t,
ConstVectorView  surface_scalar_reflectivity 
)

get_disortsurf_props.

*** FIXMEDOC *** input/output

Derive surface property input for RT4's proprietary surface handling depending on surface reflection type.

Parameters
[out]ground_albedoScalar surface albedo (for ground_type=L).
[out]ground_reflecVector surface relfectivity (for ground_type=S).
[out]ground_indexSurface complex refractive index (for ground_type=F).
[out]btempSurface temperature
[in]f_gridAs the WSV.
[in]ground_typeSurface reflection type flag.
[in]surface_skin_tAs the WSV.
[in]surface_scalar_reflectivityAs the WSV (used with ground_type=L).
[in]surface_reflectivityAs the WSV (used with ground_type=S).
[in]surface_complex_refr_indexAs the WSV (used with ground_type=F).
[in]stokes_dimAs the WSV.
Author
Jana Mendrok
Date
2017-02-23

Definition at line 296 of file disort.cc.

References max(), min(), and ConstVectorView::nelem().

Referenced by DisortCalc(), and DisortCalcIrradiance().

◆ get_dtauc_ssalb()

void get_dtauc_ssalb ( MatrixView  dtauc,
MatrixView  ssalb,
ConstMatrixView  ext_bulk_gas,
ConstMatrixView  ext_bulk_par,
ConstMatrixView  abs_bulk_par,
ConstVectorView  z_profile 
)

get_dtauc_ssalb

Calculates layer averaged cloud optical depth (dtauc) and single scattering albedo (ssalb) as required as DISORT subroutine input from level-based gas extinction and particle extinction and absorption.

Parameters
[out]dtaucOptical depths for all layers.
[out]ssalbSingle scattering albedos for all layers.
[in]ext_bulk_gasSee get_gasoptprop.
[in]ext_bulk_parSee get_paroptprop.
[in]abs_bulk_parSee get_paroptprop.
[in]z_profileProfile of geometrical altitudes.
Author
Jana Mendrok
Date
2018-04-04

Definition at line 523 of file disort.cc.

References abs(), ARTS_ASSERT, ARTS_USER_ERROR_IF, ConstMatrixView::ncols(), and ConstMatrixView::nrows().

Referenced by run_cdisort(), and run_cdisort_flux().

◆ get_gas_scattering_properties()

void get_gas_scattering_properties ( Workspace ws,
MatrixView sca_coeff_gas,
MatrixView sca_coeff_gas_level,
MatrixView pfct_gas,
const ConstVectorView f_grid,
const VectorView p,
const VectorView t,
const MatrixView vmr,
const Agenda gas_scattering_agenda 
)

get_gas_scattering_properties

Calculates the gas scattering coefficient for level and for layer averaged and the layer averaged phase function as Legendre series.

Parameters
[in,out]wsCurrent workspace.
[out]sca_coeff_gasGas scattering coefficient (all layers,freqs).
[out]sca_coeff_gas_levelGas scattering coefficient (all levels,freqs).
[out]pfct_gasLegendre moments for all layers.
[in]f_gridFrequency grid.
[in]pPressure profile.
[in]tTemperature.
[in]vmrVolume mixing ratio.
[in]gas_scattering_agendaGas scattering agenda.
Author
Manfred Brath
Date
2021-11-17

Definition at line 385 of file disort.cc.

References gas_scattering_agendaExecute(), joker, PropagationMatrix::Kjj(), min(), ConstMatrixView::ncols(), and ConstVectorView::nelem().

Referenced by run_cdisort(), and run_cdisort_flux().

◆ get_gasoptprop()

void get_gasoptprop ( Workspace ws,
MatrixView  ext_bulk_gas,
const Agenda propmat_clearsky_agenda,
ConstVectorView  t_profile,
ConstMatrixView  vmr_profiles,
ConstVectorView  p_grid,
ConstVectorView  f_grid 
)

get_gasoptprop.

Derives level-based gas bulk optical properties (extinction).

Parameters
[in,out]wsCurrent workspace.
[out]ext_bulk_gasGas bulk extinction (all levels & freqs).
[in]propmat_clearsky_agendaAs the WSV.
[in]t_profileTemperature profile
[in]vmr_profilesVMR profiles
[in]p_gridAs the WSV.
[in]f_gridAs the WSV.
Author
Jana Mendrok
Date
2018-04-04

Definition at line 341 of file disort.cc.

References ARTS_ASSERT, joker, PropagationMatrix::Kjj(), ConstMatrixView::ncols(), ConstVectorView::nelem(), ConstMatrixView::nrows(), and propmat_clearsky_agendaExecute().

Referenced by run_cdisort(), and run_cdisort_flux().

◆ get_paroptprop()

void get_paroptprop ( MatrixView  ext_bulk_par,
MatrixView  abs_bulk_par,
const ArrayOfArrayOfSingleScatteringData scat_data,
ConstMatrixView  pnd_profiles,
ConstVectorView  t_profile,
ConstVectorView   DEBUG_ONLYp_grid,
const ArrayOfIndex cloudbox_limits,
ConstVectorView  f_grid 
)

◆ get_parZ()

void get_parZ ( Tensor3 pha_bulk_par,
const ArrayOfArrayOfSingleScatteringData scat_data,
ConstMatrixView  pnd_profiles,
ConstVectorView  t_profile,
ConstVectorView  pfct_angs,
const ArrayOfIndex cloudbox_limits 
)

get_parZ.

Derives level-based particle bulk phase matrix Z (Csca scaled). NOTE: Provided on ssd's freq grid (i.e. for nf=1 only of ssd.f_grid.nelem==1) in order to avoid duplicate calculations in get_pmom (instead we duplicate the results there to the RT calc's f_grid).

Parameters
[out]pha_bulk_parParticle bulk phase function (all levels & ssd freqs).
[out]pfct_angsAngular grid of pfct_bulk_par.
[in]scat_dataAs the WSV.
[in]pnd_profilesPND profiles.
[in]t_profileTemperature profile.
[in]p_gridAs the WSV.
[in]cloudbox_limitsAs the WSV.
[in]ext_bulk_parSee get_paroptprop.
[in]abs_bulk_parSee get_paroptprop.
[in]nangNumber of angular grid points in pfct_angs. If<0,

pfct_angs is taken from scat_data (the finest za_grid used over the scat elems), else an equidistant grid with nang grid points is used.

Author
Jana Mendrok
Date
2018-04-04

Definition at line 597 of file disort.cc.

References joker, ConstMatrixView::ncols(), ConstVectorView::nelem(), pha_mat_Bulk(), pha_mat_NScatElems(), and pha_mat_ScatSpecBulk().

Referenced by run_cdisort(), and run_cdisort_flux().

◆ get_pfct()

void get_pfct ( Tensor3 pfct_bulk_par,
ConstTensor3View pha_bulk_par,
ConstMatrixView  ext_bulk_par,
ConstMatrixView  abs_bulk_par,
const ArrayOfIndex cloudbox_limits 
)

get_pfct.

Derives layer averaged particle bulk phase function P (4Pi scaled) NOTE: Provided on ssd's freq grid (i.e. for nf=1 only if ssd.f_grid.nelem==1) in order to avoid duplicate calculations in get_pmom (instead we duplicate the results there to the RT calc's f_grid).

Parameters
[out]pfct_bulk_parParticle bulk phase function (all levels & ssd freqs).
[in]pha_bulk_parSee get_parZ.
[in]ext_bulk_parSee get_paroptprop.
[in]abs_bulk_parSee get_paroptprop.
Author
Jana Mendrok
Date
2018-04-04

Definition at line 649 of file disort.cc.

References ARTS_ASSERT, joker, ConstTensor3View::ncols(), ConstTensor3View::npages(), ConstTensor3View::nrows(), and PI.

Referenced by run_cdisort(), and run_cdisort_flux().

◆ get_pmom()

void get_pmom ( Tensor3View  pmom,
ConstTensor3View  pfct_bulk_par,
ConstVectorView  pfct_angs,
const Index Nlegendre 
)

get_pmom

Calculates Legendre moments of the layer averaged phase functionss (pmom) as required as DISORT subroutine input from level-based bulk particle phase function (4-Pi normalized scalar phase matrix).

Parameters
[out]pmomLegendre moments for all layers.
[in]pfct_bulk_parSee get_pfct.
[in]pfct_angsSee get_parZ.
[in]NlegendreNumber of Legendre moments to derive.
Author
Jana Mendrok
Date
2018-04-04

Definition at line 684 of file disort.cc.

References abs(), ARTS_ASSERT, joker, ConstTensor3View::ncols(), ConstVectorView::nelem(), ConstTensor3View::npages(), ConstTensor3View::nrows(), PI, and u.

Referenced by run_cdisort(), and run_cdisort_flux().

◆ get_scat_bulk_layer()

void get_scat_bulk_layer ( MatrixView sca_bulk_layer,
const MatrixView ext_bulk,
const MatrixView abs_bulk 
)

get_scat_bulk_layer

Calculates layer averaged scattering coefficient

Parameters
[out]sca_bulk_layerBulk scattering coefficient (all levels & freqs)
[in]ext_bulkBulk extinction coefficient (all levels & freqs)
[in]abs_bulkBulk absorption coefficient (all levels & freqs)
Author
Manfred Brath
Date
2021-11-17

Definition at line 770 of file disort.cc.

References ARTS_ASSERT, ConstMatrixView::ncols(), and ConstMatrixView::nrows().

Referenced by run_cdisort(), and run_cdisort_flux().

◆ init_ifield()

void init_ifield ( Tensor7 cloudbox_field,
const Vector f_grid,
const ArrayOfIndex cloudbox_limits,
const Index n_za,
const Index n_aa,
const Index stokes_dim 
)

init_ifield.

Initialize cloudbox_field with the right size and NaN values.

Parameters
[out]cloudbox_fieldAs the WSV.
[in]f_gridAs the WSV.
[in]cloudbox_limitsAs the WSV.
[in]n_zaNumber of zenith angles with RT output.
[in]n_aaNumber of azimuth angles with RT output.
[in]stokes_dimAs the WSV.
Author
Jana Mendrok
Date
2017-03-06

Definition at line 279 of file disort.cc.

References ConstVectorView::nelem(), and Tensor7::resize().

Referenced by DisortCalc(), and DisortCalcWithARTSSurface().

◆ reduced_1datm()

void reduced_1datm ( Vector p,
Vector z,
Vector t,
Matrix vmr,
Matrix pnd,
ArrayOfIndex cboxlims,
Index ncboxremoved,
ConstVectorView  p_grid,
ConstVectorView  z_profile,
const Numeric z_surface,
ConstVectorView  t_profile,
ConstMatrixView  vmr_profiles,
ConstMatrixView  pnd_profiles,
const ArrayOfIndex cloudbox_limits 
)

reduced_1datm

Crops a 1D atmosphere, to create an atmosphere where the surface is placed at p_grid[0]. Developed to work with DISORT and RT4.

Parameters
[out]pNew pressure grid,
[out]zNew profile of geometrical altitudes.
[out]tNew temperature profile,
[out]vmrNew VMR profiles.
[out]pndNew PND profiles.
[out]cboxlimsAdjusted version of cloudbox_limits.
[out]ncboxremovedNumber of levels inside cloudbox removed
[in]p_gridOriginal pressure grid
[in]z_profileOriginal profile of geometric altitudes.
[in]z_surfaceSurface altitude.
[in]t_profileOriginal temperature profile.
[in]vmr_profilesOriginal VMR profiles.
[in]pnd_profilesOriginal PND profiles.
[in]cloudbox_limitsOriginal cloudbox limits
Author
Patrick Eriksson
Date
2019-10-22

Definition at line 862 of file disort.cc.

References abs(), gridpos(), interp(), interpweights(), itw2p(), joker, ConstVectorView::nelem(), and ConstMatrixView::nrows().

Referenced by run_cdisort(), and run_cdisort_flux().

◆ run_cdisort()

void run_cdisort ( Workspace ws,
Tensor7 cloudbox_field,
ArrayOfMatrix disort_aux,
ConstVectorView  f_grid,
ConstVectorView  p_grid,
ConstVectorView  z_profile,
const Numeric z_surface,
ConstVectorView  t_profile,
ConstMatrixView  vmr_profiles,
ConstMatrixView  pnd_profiles,
const ArrayOfArrayOfSingleScatteringData scat_data,
const ArrayOfStar stars,
const Agenda propmat_clearsky_agenda,
const Agenda gas_scattering_agenda,
const ArrayOfIndex cloudbox_limits,
const Numeric surface_skin_t,
const Vector surface_scalar_reflectivity,
ConstVectorView  za_grid,
ConstVectorView  aa_grid,
ConstVectorView  star_rte_los,
const Index gas_scattering_do,
const Index stars_do,
const ArrayOfString disort_aux_vars,
const Numeric scale_factor,
const Index nstreams,
const Index Npfct,
const Index only_tro,
const Index quiet,
const Index emission,
const Index intensity_correction,
const Verbosity verbosity 
)

Calculate doit_i_field with Disort including a star source.

Prepares actual input variables for Disort, runs it, and sorts the output into cloudbox_field.

This version uses the C implementation of Disort based on ::run_disort.

Altitudes, temperatures, VMRs and PNDs shall be provided with lat and lon dimensions removed

Parameters
[in,out]wsCurrent workspace.
[out]cloudbox_fieldRadiation field.
[out]disort_auxAuxilary data to spectral_irradiance_field.
[in]f_gridFrequency grid.
[in]p_gridPressure grid.
[in]z_profileProfile of geometric altitudes.
[in]z_surfaceSurface altitude.
[in]t_profileTemperature profile.
[in]vmr_profilesVMR profiles.
[in]pnd_profilesPND profiles.
[in]scat_dataArray of single scattering data.
[in]starsArray of star(s).
[in]propmat_clearsky_agendacalculates the absorption coefficient matrix.
[in]gas_scattering_agendaAgenda agenda calculating the gas scattering cross section and matrix.
[in]cloudbox_limitsCloudbox limits.
[in]surface_skin_tSurface skin temperature.
[in]surface_scalar_reflectivitySurface scalar reflectivity.
[in]za_gridZenith angle grid.
[in]aa_gridazimuth angle grid.
[in]star_rte_loslocal position of the sun top of cloudbox.
[in]gas_scattering_doFlag to activate gas scattering.
[in]stars_doFlag to activate the star(s).
[in]disort_aux_varsSelection of quantities for disort_aux.
[in]scale_factorGeometric scaling factor, scales the star spectral irradiance at the surface of the star to the spectral irradiance of the star at cloubbox top.
[in]nstreamsNumber of quadrature angles (both hemispheres).
[in]NpfctNumber of angular grid points to calculate bulk phase function.
[in]only_troFlag indicating that only TRO scattering data is used.
[in]quietSilence warnings.
[in]emissionEnables blackbody emission.
[in]intensity_correctionEnables intensity correction (for low nstreams)
[in]verbosityVerbosity setting.
Author
Oliver Lemke, Manfred Brath
Date
2019-09-19, 2021-10-27

Definition at line 938 of file disort.cc.

References add_normed_phase_functions(), ARTS_USER_ERROR, Conversion::cosd(), COSMIC_BG_TEMP, disort_verbosity, ext_abs_pfun_from_tro(), get_angs(), get_dtauc_ssalb(), get_gas_scattering_properties(), get_gasoptprop(), get_paroptprop(), get_parZ(), get_pfct(), get_pmom(), get_scat_bulk_layer(), joker, ConstTensor3View::ncols(), Array< base >::nelem(), ConstVectorView::nelem(), nlinspace(), ConstTensor3View::nrows(), PI, reduced_1datm(), Tensor3::resize(), and SPEED_OF_LIGHT.

Referenced by DisortCalc(), and DisortCalcWithARTSSurface().

◆ run_cdisort_flux()

void run_cdisort_flux ( Workspace ws,
Tensor5 spectral_irradiance_field,
ArrayOfMatrix disort_aux,
ConstVectorView  f_grid,
ConstVectorView  p_grid,
ConstVectorView  z_profile,
const Numeric z_surface,
ConstVectorView  t_profile,
ConstMatrixView  vmr_profiles,
ConstMatrixView  pnd_profiles,
const ArrayOfArrayOfSingleScatteringData scat_data,
const ArrayOfStar stars,
const Agenda propmat_clearsky_agenda,
const Agenda gas_scattering_agenda,
const ArrayOfIndex cloudbox_limits,
const Numeric surface_skin_t,
const Vector surface_scalar_reflectivity,
ConstVectorView  star_rte_los,
const Index gas_scattering_do,
const Index stars_do,
const ArrayOfString disort_aux_vars,
const Numeric scale_factor,
const Index nstreams,
const Index Npfct,
const Index only_tro,
const Index quiet,
const Index emission,
const Index intensity_correction,
const Verbosity verbosity 
)

Calculate spectral_irradiance_field with Disort including a star source.

Prepares actual input variables for Disort, runs it, and sorts the output into cloudbox_field.

This version uses the C implementation of Disort based on ::run_disort.

Altitudes, temperatures, VMRs and PNDs shall be provided with lat and lon dimensions removed

Parameters
[in,out]wsCurrent workspace.
[out]spectral_irradiance_fieldspectral irradiance field.
[out]disort_auxAuxilary data to spectral_irradiance_field.
[in]f_gridFrequency grid.
[in]p_gridPressure grid.
[in]z_profileProfile of geometric altitudes.
[in]z_surfaceSurface altitude.
[in]t_profileTemperature profile.
[in]vmr_profilesVMR profiles.
[in]pnd_profilesPND profiles.
[in]scat_dataArray of single scattering data.
[in]starsArray of star(s).
[in]propmat_clearsky_agendacalculates the absorption coefficient matrix.
[in]gas_scattering_agendaAgenda agenda calculating the gas scattering cross section and matrix.
[in]cloudbox_limitsCloudbox limits.
[in]surface_skin_tSurface skin temperature.
[in]surface_scalar_reflectivitySurface scalar reflectivity.
[in]star_rte_loslocal position of the sun top of cloudbox.
[in]gas_scattering_doFlag to activate gas scattering.
[in]stars_doFlag to activate the star(s).
[in]disort_aux_varsSelection of quantities for disort_aux.
[in]scale_factorGeometric scaling factor, scales the star spectral irradiance at the surface of the star to the spectral irradiance of the star at cloubbox top.
[in]nstreamsNumber of quadrature angles (both hemispheres).
[in]NpfctNumber of angular grid points to calculate bulk phase function.
[in]only_troFlag indicating that only TRO scattering data is used.
[in]quietSilence warnings.
[in]emissionEnables blackbody emission.
[in]intensity_correctionEnables intensity correction (for low nstreams)
[in]verbosityVerbosity setting.
Author
Oliver Lemke, Manfred Brath
Date
2019-09-19, 2021-10-27

Definition at line 1303 of file disort.cc.

References add_normed_phase_functions(), ARTS_USER_ERROR, Conversion::cosd(), COSMIC_BG_TEMP, disort_verbosity, ext_abs_pfun_from_tro(), get_angs(), get_dtauc_ssalb(), get_gas_scattering_properties(), get_gasoptprop(), get_paroptprop(), get_parZ(), get_pfct(), get_pmom(), get_scat_bulk_layer(), joker, ConstTensor3View::ncols(), Array< base >::nelem(), ConstVectorView::nelem(), nlinspace(), ConstTensor3View::nrows(), reduced_1datm(), Tensor3::resize(), Matrix::resize(), and SPEED_OF_LIGHT.

Referenced by DisortCalcIrradiance().

◆ surf_albedoCalc()

void surf_albedoCalc ( Workspace ws,
VectorView  albedo,
Numeric btemp,
const Agenda surface_rtprop_agenda,
ConstVectorView  f_grid,
ConstVectorView  scat_za_grid,
const Numeric surf_alt,
const Verbosity verbosity 
)

surf_albedoCalc

Computes surface albedo for DISORT using surface_rtprop_agenda.

This function calculates a hemispherical mean value.

Parameters
[in,out]wsThe workspace
[out]albedoThe computed albedo
[out]btempUpw. bts.
[in]surface_rtprop_agendaAgenda to compute surf. props
[in]f_gridFrequency grid
[in]scat_za_gridZenith angle grid
[in]surface_altsurface altitude
[in]verbosity
Author
Jana Mendrok
Date
2019-10-22

Definition at line 1685 of file disort.cc.

References chk_not_empty(), CREATE_OUT2, DEG2RAD, ConstMatrixView::empty(), is_same_within_epsilon(), joker, ConstVectorView::nelem(), ConstMatrixView::nrows(), surface_rtprop_agendaExecute(), and w.

Referenced by DisortCalcWithARTSSurface().

◆ surf_albedoCalcSingleAngle()

void surf_albedoCalcSingleAngle ( Workspace ws,
VectorView  albedo,
Numeric btemp,
const Agenda surface_rtprop_agenda,
ConstVectorView  f_grid,
const Numeric surf_alt,
const Numeric inc_angle 
)

surf_albedoCalcSingleAngle

Computes surface albedo for DISORT using surface_rtprop_agenda.

This function sets the albedo based on the reflectivity at the specifed incidence angle.

Parameters
[in,out]wsThe workspace
[out]albedoThe computed albedo
[out]btempUpw. bts.
[in]surface_rtprop_agendaAgenda to compute surf. props
[in]f_gridFrequency grid
[in]surface_altsurface altitude
[in]inc_angleincidence angle
Author
Patrick Eriksson
Date
2022-12-22

Definition at line 1865 of file disort.cc.

References ConstMatrixView::empty(), joker, ConstMatrixView::nrows(), and surface_rtprop_agendaExecute().

Referenced by DisortCalcWithARTSSurface().

Variable Documentation

◆ COSMIC_BG_TEMP

constexpr Numeric COSMIC_BG_TEMP =Constant::cosmic_microwave_background_temperature
inlineconstexpr

Definition at line 60 of file disort.cc.

Referenced by run_cdisort(), and run_cdisort_flux().

◆ DEG2RAD

constexpr Numeric DEG2RAD =Conversion::deg2rad(1)
inlineconstexpr

Definition at line 57 of file disort.cc.

Referenced by MCAntenna::draw_los(), TelsemAtlas::equare(), and surf_albedoCalc().

◆ disort_verbosity

thread_local Verbosity disort_verbosity

◆ PI

◆ PLANCK_CONST

constexpr Numeric PLANCK_CONST =Constant::planck_constant
inlineconstexpr

Definition at line 58 of file disort.cc.

◆ SPEED_OF_LIGHT

constexpr Numeric SPEED_OF_LIGHT =Constant::speed_of_light
inlineconstexpr

Definition at line 59 of file disort.cc.

Referenced by run_cdisort(), and run_cdisort_flux().