Go to the documentation of this file.
59 const Index& N_za_grid,
60 const Index& N_aa_grid,
61 const String& za_grid_type,
66 else if (N_aa_grid < 1) {
68 os <<
"N_aa_grid must be > 0 (even for 1D).";
69 throw std::runtime_error(os.str());
75 if (N_za_grid % 2 == 1) {
77 os <<
"N_za_grid must be even.";
78 throw runtime_error(os.str());
81 Index nph = N_za_grid / 2;
89 if (za_grid_type ==
"double_gauss") {
107 w[wtemp.
nelem() - 1] = wtemp[0] / 2;
109 for (
Index i = 0; i < xtemp.
nelem() - 1; i++) {
110 x[i] = acos((xtemp[xtemp.
nelem() - 1 - i] + 1) / 2.) /
DEG2RAD;
111 x[xtemp.
nelem() + i] = acos(1 - (xtemp[i + 1] + 1) / 2.) /
DEG2RAD;
113 w[i] = wtemp[wtemp.
nelem() - 1 - i] / 2;
114 w[wtemp.
nelem() + i] = wtemp[i + 1] / 2;
118 x[i] = acos((xtemp[xtemp.
nelem() - 1 - i] + 1) / 2.) /
DEG2RAD;
119 x[xtemp.
nelem() + i] = acos(1 - (xtemp[i] + 1) / 2.) /
DEG2RAD;
121 w[i] = wtemp[wtemp.
nelem() - 1 - i] / 2;
122 w[wtemp.
nelem() + i] = wtemp[i] / 2;
126 for (
Index i = 0; i < nph; i++) {
137 }
else if (za_grid_type ==
"linear") {
142 for (
Index i = 0; i < N_za_grid; i++) {
149 }
else if (za_grid_type ==
"linear_mu") {
158 za_grid_temp.
resize(
x.nelem());
160 for (
Index i = 0; i < N_za_grid; i++) {
161 za_grid_temp[i] = acos(
x[i]) /
DEG2RAD;
170 os <<
"The selected grid type is not implemented";
171 throw std::runtime_error(os.str());
236 heating_rates(0, p, r) = (-3 * net_flux_b + 4 * net_flux_c - net_flux_t) /
249 -(-3 * net_flux_t + 4 * net_flux_c - net_flux_b) /
266 Tensor4 radiance_field_aa_integrated;
271 radiance_field_aa_integrated =
273 radiance_field_aa_integrated *= 2 *
PI;
281 radiance_field_aa_integrated = 0.;
283 for (
Index b = 0; b < radiance_field_aa_integrated.
nbooks(); b++) {
284 for (
Index p = 0; p < radiance_field_aa_integrated.
npages(); p++) {
285 for (
Index r = 0; r < radiance_field_aa_integrated.
nrows(); r++) {
286 for (
Index c = 0; c < radiance_field_aa_integrated.
ncols(); c++) {
287 for (
Index i = 0; i < N_scat_aa - 1; i++) {
288 radiance_field_aa_integrated(b, p, r, c) +=
311 for (
Index i = 0; i < N_scat_za; i++) {
314 radiance_field_aa_integrated(b, p, r, i) *
318 radiance_field_aa_integrated(b, p, r, i) *
330 const Tensor5& spectral_radiation_field,
334 "The length of f_grid does not match with\n"
335 " the first dimension of the spectral_radiation_field");
339 radiation_field.
resize(spectral_radiation_field.
nbooks(),
340 spectral_radiation_field.
npages(),
341 spectral_radiation_field.
nrows(),
342 spectral_radiation_field.
ncols());
346 for (
Index i = 0; i < spectral_radiation_field.
nshelves() - 1; i++) {
349 for (
Index b = 0; b < radiation_field.
nbooks(); b++) {
350 for (
Index p = 0; p < radiation_field.
npages(); p++) {
351 for (
Index r = 0; r < radiation_field.
nrows(); r++) {
352 for (
Index c = 0; c < radiation_field.
ncols(); c++) {
353 radiation_field(b, p, r, c) +=
354 (spectral_radiation_field(i + 1, b, p, r, c) +
355 spectral_radiation_field(i, b, p, r, c)) /
367 const Tensor7& spectral_radiation_field,
371 "The length of f_grid does not match with\n"
372 " the first dimension of the spectral_radiation_field");
377 spectral_radiation_field.
nshelves(),
378 spectral_radiation_field.
nbooks(),
379 spectral_radiation_field.
npages(),
380 spectral_radiation_field.
nrows());
384 for (
Index i = 0; i < spectral_radiation_field.
nlibraries() - 1; i++) {
388 for (
Index b = 0; b < radiation_field.
nbooks(); b++) {
389 for (
Index p = 0; p < radiation_field.
npages(); p++) {
390 for (
Index r = 0; r < radiation_field.
nrows(); r++) {
391 for (
Index c = 0; c < radiation_field.
ncols(); c++) {
392 radiation_field(s, b, p, r, c) +=
393 (spectral_radiation_field(i + 1, s, b, p, r, c, 0) +
394 spectral_radiation_field(i, s, b, p, r, c, 0)) /
416 Tensor5 iy_field_aa_integrated;
421 iy_field_aa_integrated =
423 iy_field_aa_integrated *= 2 *
PI;
432 iy_field_aa_integrated = 0.;
434 for (
Index s = 0; s < iy_field_aa_integrated.
nshelves(); s++) {
435 for (
Index b = 0; b < iy_field_aa_integrated.
nbooks(); b++) {
436 for (
Index p = 0; p < iy_field_aa_integrated.
npages(); p++) {
437 for (
Index r = 0; r < iy_field_aa_integrated.
nrows(); r++) {
438 for (
Index c = 0; c < iy_field_aa_integrated.
ncols(); c++) {
439 for (
Index i = 0; i < N_scat_aa - 1; i++) {
440 iy_field_aa_integrated(s, b, p, r, c) +=
465 for (
Index i = 0; i < N_scat_za; i++) {
468 iy_field_aa_integrated(s, b, p, r, i) *
472 iy_field_aa_integrated(s, b, p, r, i) *
512 const Index& use_parallel_iy,
516 throw runtime_error(
"This method only works for atmosphere_dim = 1.");
525 trans_field.
resize(nf, nl, nza);
561 #pragma omp parallel for if (!arts_omp_in_parallel() && nza > 1 && \
562 !use_parallel_iy) firstprivate(l_ws)
563 for (
Index i = 0; i < nza; i++) {
564 if (failed)
continue;
594 if (use_parallel_iy) {
700 trans_field(
joker, nl - 1, i) =
708 trans_field(
joker, 0, i) =
715 if (
ppath.gp_p[p].fd[0] < 1e-2) {
727 for (
Index p = 0; p < i0; p++) {
730 trans_field(
joker, p, i) = trans_field(
joker, i0, i);
733 }
catch (
const std::exception& e) {
734 #pragma omp critical(planep_setabort)
738 os <<
"Run-time error at nza #" << i <<
": \n" << e.what();
739 #pragma omp critical(planep_push_fail_msg)
740 fail_msg.push_back(os.str());
744 if (fail_msg.
nelem()) {
746 for (
auto& msg : fail_msg) os << msg <<
'\n';
747 throw runtime_error(os.str());
761 throw runtime_error(
"This method can only be used for 1D calculations.\n");
763 throw runtime_error(
"Cloudbox is off. This is not handled by this method.");
766 "The cloudbox must cover all pressure levels "
767 "to use this method.");
805 const Index& use_parallel_iy,
809 throw runtime_error(
"This method only works for atmosphere_dim = 1.");
811 throw runtime_error(
"No ned to use this method with cloudbox=0.");
814 "The first element of *cloudbox_limits* must be zero "
815 "to use this method.");
865 #pragma omp parallel for if (!arts_omp_in_parallel() && nza > 1 && \
866 !use_parallel_iy) firstprivate(l_ws)
867 for (
Index i = 0; i < nza; i++) {
868 if (failed)
continue;
898 if (use_parallel_iy) {
1012 if (
ppath.gp_p[p].fd[0] < 1e-2) {
1019 }
catch (
const std::exception& e) {
1020 #pragma omp critical(planep_setabort)
1024 os <<
"Run-time error at nza #" << i <<
": \n" << e.what();
1025 #pragma omp critical(planep_push_fail_msg)
1026 fail_msg.push_back(os.str());
1030 if (fail_msg.
nelem()) {
1032 for (
auto& msg : fail_msg) os << msg <<
'\n';
1033 throw runtime_error(os.str());
Matrix ppvar_mag(Workspace &ws) noexcept
Tensor4 ppvar_trans_partial(Workspace &ws) noexcept
Index atmosphere_dim(Workspace &ws) noexcept
Tensor3 wind_v_field(Workspace &ws) noexcept
Tensor5 radiance_field(Workspace &ws) noexcept
Tensor3 z_field(Workspace &ws) noexcept
void resize(Index b, Index p, Index r, Index c)
Resize function.
Index nshelves() const
Returns the number of shelves.
Index nbooks() const
Returns the number of books.
void spectral_radiance_fieldExpandCloudboxField(Workspace &ws, Tensor7 &spectral_radiance_field, const Agenda &propmat_clearsky_agenda, const Agenda &water_p_eq_agenda, const Agenda &iy_space_agenda, const Agenda &iy_surface_agenda, const Agenda &iy_cloudbox_agenda, const Index &stokes_dim, const Vector &f_grid, const Index &atmosphere_dim, const Vector &p_grid, const Tensor3 &z_field, const Tensor3 &t_field, const EnergyLevelMap &nlte_field, const Tensor4 &vmr_field, const ArrayOfArrayOfSpeciesTag &abs_species, const Tensor3 &wind_u_field, const Tensor3 &wind_v_field, const Tensor3 &wind_w_field, const Tensor3 &mag_u_field, const Tensor3 &mag_v_field, const Tensor3 &mag_w_field, const Matrix &z_surface, const Index &cloudbox_on, const ArrayOfIndex &cloudbox_limits, const Tensor7 &cloudbox_field, const Numeric &ppath_lmax, const Numeric &rte_alonglos_v, const Tensor3 &surface_props_data, const Vector &za_grid, const Index &use_parallel_iy, const Verbosity &verbosity)
WORKSPACE METHOD: spectral_radiance_fieldExpandCloudboxField.
Numeric g0(Workspace &ws) noexcept
Tensor3 heating_rates(Workspace &ws) noexcept
Agenda iy_cloudbox_agenda(Workspace &ws) noexcept
ArrayOfRetrievalQuantity jacobian_quantities(Workspace &ws) noexcept
Declarations required for the calculation of absorption coefficients.
Complex w(Complex z) noexcept
The Faddeeva function.
This stores arbitrary token values and remembers the type.
Matrix ppvar_vmr(Workspace &ws) noexcept
Index ncols() const
Returns the number of columns.
Tensor3 iy_transmission(Workspace &ws) noexcept
Index iy_id(Workspace &ws) noexcept
Index ppath_inside_cloudbox_do(Workspace &ws) noexcept
Verbosity verbosity(Workspace &ws) noexcept
Tensor5 spectral_irradiance_field(Workspace &ws) noexcept
Tensor3 ppvar_iy(Workspace &ws) noexcept
ArrayOfIndex cloudbox_limits(Workspace &ws) noexcept
Index jacobian_do(Workspace &ws) noexcept
Tensor3 wind_u_field(Workspace &ws) noexcept
void resize(Index n)
Resize function.
Contains the code to calculate Legendre polynomials.
ArrayOfTensor3 diy_dx(Workspace &ws) noexcept
Matrix ppvar_f(Workspace &ws) noexcept
Tensor3 mag_w_field(Workspace &ws) noexcept
bool gsl_integration_glfixed_table_alloc(Vector &x, Vector &w, Index n)
gsl_integration_glfixed_table_alloc
Index stokes_dim(Workspace &ws) noexcept
void spectral_radiance_fieldClearskyPlaneParallel(Workspace &ws, Tensor7 &spectral_radiance_field, Tensor3 &trans_field, const Agenda &propmat_clearsky_agenda, const Agenda &water_p_eq_agenda, const Agenda &iy_space_agenda, const Agenda &iy_surface_agenda, const Agenda &iy_cloudbox_agenda, const Index &stokes_dim, const Vector &f_grid, const Index &atmosphere_dim, const Vector &p_grid, const Tensor3 &z_field, const Tensor3 &t_field, const EnergyLevelMap &nlte_field, const Tensor4 &vmr_field, const ArrayOfArrayOfSpeciesTag &abs_species, const Tensor3 &wind_u_field, const Tensor3 &wind_v_field, const Tensor3 &wind_w_field, const Tensor3 &mag_u_field, const Tensor3 &mag_v_field, const Tensor3 &mag_w_field, const Matrix &z_surface, const Numeric &ppath_lmax, const Numeric &rte_alonglos_v, const Tensor3 &surface_props_data, const Vector &za_grid, const Index &use_parallel_iy, const Verbosity &verbosity)
WORKSPACE METHOD: spectral_radiance_fieldClearskyPlaneParallel.
String iy_unit(Workspace &ws) noexcept
Index index_of_zsurface(const Numeric &z_surface, ConstVectorView z_profile)
Lccates the surface with respect to pressure levels.
Matrix iy(Workspace &ws) noexcept
Tensor4 irradiance_field(Workspace &ws) noexcept
void ppathPlaneParallel(Ppath &ppath, const Index &atmosphere_dim, const Tensor3 &z_field, const Matrix &z_surface, const Index &cloudbox_on, const ArrayOfIndex &cloudbox_limits, const Index &ppath_inside_cloudbox_do, const Vector &rte_pos, const Vector &rte_los, const Numeric &ppath_lmax, const Verbosity &)
WORKSPACE METHOD: ppathPlaneParallel.
Agenda iy_space_agenda(Workspace &ws) noexcept
The structure to describe a propagation path and releated quantities.
void resize(Index p, Index r, Index c)
Resize function.
Index npages() const
Returns the number of pages.
void AngularGridsSetFluxCalc(Vector &za_grid, Vector &aa_grid, Vector &za_grid_weights, const Index &N_za_grid, const Index &N_aa_grid, const String &za_grid_type, const Verbosity &)
WORKSPACE METHOD: AngularGridsSetFluxCalc.
Tensor4 ppvar_trans_cumulat(Workspace &ws) noexcept
Index nlibraries() const
Returns the number of libraries.
Numeric rte_alonglos_v(Workspace &ws) noexcept
EnergyLevelMap nlte_field(Workspace &ws) noexcept
This can be used to make arrays out of anything.
void RadiationFieldSpectralIntegrate(Tensor4 &radiation_field, const Vector &f_grid, const Tensor5 &spectral_radiation_field, const Verbosity &)
WORKSPACE METHOD: RadiationFieldSpectralIntegrate.
Declarations for agendas.
void resize(Index s, Index b, Index p, Index r, Index c)
Resize function.
Declarations having to do with the four output streams.
Vector rte_pos(Workspace &ws) noexcept
void heating_ratesFromIrradiance(Tensor3 &heating_rates, const Vector &p_grid, const Tensor4 &irradiance_field, const Tensor3 &specific_heat_capacity, const Numeric &g0, const Verbosity &)
WORKSPACE METHOD: heating_ratesFromIrradiance.
Index nelem() const
Returns the number of elements.
Index nvitrines() const
Returns the number of vitrines.
Tensor4 vmr_field(Workspace &ws) noexcept
Vector rte_los(Workspace &ws) noexcept
EnergyLevelMap ppvar_nlte(Workspace &ws) noexcept
ArrayOfArrayOfSpeciesTag abs_species(Workspace &ws) noexcept
Vector ppvar_t(Workspace &ws) noexcept
void iyEmissionStandard(Workspace &ws, Matrix &iy, ArrayOfMatrix &iy_aux, ArrayOfTensor3 &diy_dx, Vector &ppvar_p, Vector &ppvar_t, EnergyLevelMap &ppvar_nlte, Matrix &ppvar_vmr, Matrix &ppvar_wind, Matrix &ppvar_mag, Matrix &ppvar_f, Tensor3 &ppvar_iy, Tensor4 &ppvar_trans_cumulat, Tensor4 &ppvar_trans_partial, const Index &iy_id, const Index &stokes_dim, const Vector &f_grid, const Index &atmosphere_dim, const Vector &p_grid, const Tensor3 &t_field, const EnergyLevelMap &nlte_field, const Tensor4 &vmr_field, const ArrayOfArrayOfSpeciesTag &abs_species, const Tensor3 &wind_u_field, const Tensor3 &wind_v_field, const Tensor3 &wind_w_field, const Tensor3 &mag_u_field, const Tensor3 &mag_v_field, const Tensor3 &mag_w_field, const Index &cloudbox_on, const String &iy_unit, const ArrayOfString &iy_aux_vars, const Index &jacobian_do, const ArrayOfRetrievalQuantity &jacobian_quantities, const Ppath &ppath, const Vector &rte_pos2, const Agenda &propmat_clearsky_agenda, const Agenda &water_p_eq_agenda, const Agenda &iy_main_agenda, const Agenda &iy_space_agenda, const Agenda &iy_surface_agenda, const Agenda &iy_cloudbox_agenda, const Index &iy_agenda_call1, const Tensor3 &iy_transmission, const Numeric &rte_alonglos_v, const Tensor3 &surface_props_data, const Verbosity &verbosity)
WORKSPACE METHOD: iyEmissionStandard.
Vector p_grid(Workspace &ws) noexcept
Ppath ppath(Workspace &ws) noexcept
Index ncols() const
Returns the number of columns.
Index npages() const
Returns the number of pages.
Tensor3 surface_props_data(Workspace &ws) noexcept
NUMERIC Numeric
The type to use for all floating point numbers.
void iyEmissionStandardSequential(Workspace &ws, Matrix &iy, ArrayOfMatrix &iy_aux, ArrayOfTensor3 &diy_dx, Vector &ppvar_p, Vector &ppvar_t, EnergyLevelMap &ppvar_nlte, Matrix &ppvar_vmr, Matrix &ppvar_wind, Matrix &ppvar_mag, Matrix &ppvar_f, Tensor3 &ppvar_iy, Tensor4 &ppvar_trans_cumulat, Tensor4 &ppvar_trans_partial, const Index &iy_id, const Index &stokes_dim, const Vector &f_grid, const Index &atmosphere_dim, const Vector &p_grid, const Tensor3 &t_field, const EnergyLevelMap &nlte_field, const Tensor4 &vmr_field, const ArrayOfArrayOfSpeciesTag &abs_species, const Tensor3 &wind_u_field, const Tensor3 &wind_v_field, const Tensor3 &wind_w_field, const Tensor3 &mag_u_field, const Tensor3 &mag_v_field, const Tensor3 &mag_w_field, const Index &cloudbox_on, const String &iy_unit, const ArrayOfString &iy_aux_vars, const Index &jacobian_do, const ArrayOfRetrievalQuantity &jacobian_quantities, const Ppath &ppath, const Vector &rte_pos2, const Agenda &propmat_clearsky_agenda, const Agenda &water_p_eq_agenda, const Agenda &iy_main_agenda, const Agenda &iy_space_agenda, const Agenda &iy_surface_agenda, const Agenda &iy_cloudbox_agenda, const Index &iy_agenda_call1, const Tensor3 &iy_transmission, const Numeric &rte_alonglos_v, const Tensor3 &surface_props_data, const Verbosity &verbosity)
WORKSPACE METHOD: iyEmissionStandardSequential.
Index npages() const
Returns the number of pages.
Index iy_agenda_call1(Workspace &ws) noexcept
Tensor3 specific_heat_capacity(Workspace &ws) noexcept
Index nbooks() const
Returns the number of books.
ArrayOfString iy_aux_vars(Workspace &ws) noexcept
Vector f_grid(Workspace &ws) noexcept
Matrix ppvar_wind(Workspace &ws) noexcept
void irradiance_fieldFromRadiance(Tensor4 &irradiance_field, const Tensor5 &radiance_field, const Vector &za_grid, const Vector &aa_grid, const Vector &za_grid_weights, const Verbosity &)
WORKSPACE METHOD: irradiance_fieldFromRadiance.
Vector za_grid(Workspace &ws) noexcept
void nlinspace(Vector &x, const Numeric start, const Numeric stop, const Index n)
nlinspace
Numeric ppath_lmax(Workspace &ws) noexcept
Agenda iy_surface_agenda(Workspace &ws) noexcept
void spectral_radiance_fieldCopyCloudboxField(Tensor7 &spectral_radiance_field, const Index &atmosphere_dim, const Vector &p_grid, const Index &cloudbox_on, const ArrayOfIndex &cloudbox_limits, const Tensor7 &cloudbox_field, const Verbosity &)
WORKSPACE METHOD: spectral_radiance_fieldCopyCloudboxField.
Index nrows() const
Returns the number of rows.
void spectral_irradiance_fieldFromSpectralRadianceField(Tensor5 &spectral_irradiance_field, const Tensor7 &spectral_radiance_field, const Vector &za_grid, const Vector &aa_grid, const Vector &za_grid_weights, const Verbosity &)
WORKSPACE METHOD: spectral_irradiance_fieldFromSpectralRadianceField.
Index nbooks() const
Returns the number of books.
Index nrows() const
Returns the number of rows.
ArrayOfMatrix iy_aux(Workspace &ws) noexcept
This file contains the Workspace class.
Agenda iy_main_agenda(Workspace &ws) noexcept
Vector rte_pos2(Workspace &ws) noexcept
Index nshelves() const
Returns the number of shelves.
Tensor3 mag_v_field(Workspace &ws) noexcept
Tensor3 t_field(Workspace &ws) noexcept
Vector za_grid_weights(Workspace &ws) noexcept
Tensor3 wind_w_field(Workspace &ws) noexcept
void calculate_weights_linear(Vector &x, Vector &w, const Index nph)
calculate_weights_linear
Tensor7 cloudbox_field(Workspace &ws) noexcept
Agenda propmat_clearsky_agenda(Workspace &ws) noexcept
Vector x(Workspace &ws) noexcept
INDEX Index
The type to use for all integer numbers and indices.
Index nrows() const
Returns the number of rows.
Tensor3 mag_u_field(Workspace &ws) noexcept
Tensor7 spectral_radiance_field(Workspace &ws) noexcept
Vector ppvar_p(Workspace &ws) noexcept
Vector aa_grid(Workspace &ws) noexcept
Agenda water_p_eq_agenda(Workspace &ws) noexcept
Contains sorting routines.
Index nelem() const
Number of elements.
Matrix z_surface(Workspace &ws) noexcept
Index cloudbox_on(Workspace &ws) noexcept