ARTS 2.5.0 (git: 9ee3ac6c)
m_fluxes.cc File Reference

Workspace functions related to simulation of radiation fluxes. More...

#include <iostream>
#include <stdexcept>
#include "absorption.h"
#include "agenda_class.h"
#include "auto_md.h"
#include "check_input.h"
#include "legendre.h"
#include "math_funcs.h"
#include "matpackVII.h"
#include "messages.h"
#include "sorting.h"
#include "surface.h"
#include "workspace_ng.h"

Go to the source code of this file.

Functions

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. More...
 
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. More...
 
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. More...
 
void RadiationFieldSpectralIntegrate (Tensor4 &radiation_field, const Vector &f_grid, const Tensor5 &spectral_radiation_field, const Verbosity &)
 WORKSPACE METHOD: RadiationFieldSpectralIntegrate. More...
 
void RadiationFieldSpectralIntegrate (Tensor5 &radiation_field, const Vector &f_grid, const Tensor7 &spectral_radiation_field, const Verbosity &)
 WORKSPACE METHOD: RadiationFieldSpectralIntegrate. More...
 
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. More...
 
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 String &rt_integration_option, const Tensor3 &surface_props_data, const Vector &za_grid, const Index &use_parallel_za, const Verbosity &verbosity)
 WORKSPACE METHOD: spectral_radiance_fieldClearskyPlaneParallel. More...
 
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. More...
 
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 String &rt_integration_option, const Tensor3 &surface_props_data, const Vector &za_grid, const Index &use_parallel_za, const Verbosity &verbosity)
 WORKSPACE METHOD: spectral_radiance_fieldExpandCloudboxField. More...
 

Variables

const Numeric PI
 
const Numeric DEG2RAD
 

Detailed Description

Workspace functions related to simulation of radiation fluxes.

Author
Manfred Brath manfr.nosp@m.ed.b.nosp@m.rath@.nosp@m.uni-.nosp@m.hambu.nosp@m.rg.d.nosp@m.e
Date
2018-06-22

These functions are listed in the doxygen documentation as entries of the file auto_md.h.

Definition in file m_fluxes.cc.

Function Documentation

◆ AngularGridsSetFluxCalc()

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 verbosity 
)

WORKSPACE METHOD: AngularGridsSetFluxCalc.

Sets the angular grids for the calculation of radiation fluxes.

This method sets the angular grids for the radiation fluxes type calculations and calculates the integration weights za_grid_weights for the zenith angle integration. For down- und up-looking geometries it suffices to use the default values of N_za_grid and N_aa_grid. From N_aa_grid an equally spaced grid is created and stored in the WSV aa_grid. Depending on the desired za_grid_type za_grid will be equally spaced ('linear') or unequally ('linear_mu','double_gauss') Important, N_za_grid must be an even number because for the integration over each hemisphere N_za_grid / 2 zenith angles are needed.

Possible zenith angle grid types are: double_gauss: The zenith grid and the integration weights are set according <br> to a gauss-legendre integration for each hemispheres. linear: Equally space grid between 0 deg and 180 deg including the poles linear_mu: Similar to 'linear' but equally spaced for cos(180 deg) to cos(0 deg), <br> which results a unequally spaced angular grid

Author
Manfred Brath
Parameters
[out]za_gridWS Output
[out]aa_gridWS Output
[out]za_grid_weightsWS Output
[in]N_za_gridGeneric Input (Default: "2")
[in]N_aa_gridGeneric Input (Default: "1")
[in]za_grid_typeGeneric Input (Default: "linear_mu")

Definition at line 55 of file m_fluxes.cc.

References calculate_weights_linear(), DEG2RAD, gsl_integration_glfixed_table_alloc(), ConstVectorView::nelem(), nlinspace(), Vector::resize(), and w.

Referenced by AngularGridsSetFluxCalc_g().

◆ heating_ratesFromIrradiance()

void heating_ratesFromIrradiance ( Tensor3 heating_rates,
const Vector p_grid,
const Tensor4 irradiance_field,
const Tensor3 specific_heat_capacity,
const Numeric g0,
const Verbosity verbosity 
)

WORKSPACE METHOD: heating_ratesFromIrradiance.

Calculates heating rates from the irradiance_field.

The method assumes that the heating rates depend only on the vertical derivation of the net flux. The net flux is the sum of the irradiance_field* in upward direction and the irradiance_field in downward direction

Author
Manfred Brath
Parameters
[out]heating_ratesWS Output
[in]p_gridWS Input
[in]irradiance_fieldWS Input
[in]specific_heat_capacityWS Input
[in]g0WS Input

Definition at line 187 of file m_fluxes.cc.

References b, ConstTensor4View::nbooks(), ConstTensor4View::npages(), ConstTensor4View::nrows(), and Tensor3::resize().

Referenced by heating_ratesFromIrradiance_g().

◆ irradiance_fieldFromRadiance()

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 verbosity 
)

WORKSPACE METHOD: irradiance_fieldFromRadiance.

Calculates the irradiance from the radiance_field.

The radiance_field is integrated over the angular grids according to the grids set by AngularGridsSetFluxCalc. See AngularGridsSetFluxCalc to set za_grid, aa_grid, and za_grid_weights*

Author
Manfred Brath
Parameters
[out]irradiance_fieldWS Output
[in]radiance_fieldWS Input
[in]za_gridWS Input
[in]aa_gridWS Input
[in]za_grid_weightsWS Input

Definition at line 256 of file m_fluxes.cc.

References abs, b, c, DEG2RAD, joker, ConstTensor4View::nbooks(), ConstTensor5View::nbooks(), ConstTensor4View::ncols(), ConstVectorView::nelem(), ConstTensor4View::npages(), ConstTensor5View::npages(), ConstTensor4View::nrows(), ConstTensor5View::nrows(), ConstTensor5View::nshelves(), PI, and Tensor4::resize().

Referenced by irradiance_fieldFromRadiance_g().

◆ RadiationFieldSpectralIntegrate() [1/2]

void RadiationFieldSpectralIntegrate ( Tensor4 radiation_field,
const Vector f_grid,
const Tensor5 spectral_radiation_field,
const Verbosity verbosity 
)

WORKSPACE METHOD: RadiationFieldSpectralIntegrate.

Integrates fields like spectral_irradiance_field or spectral_radiance_field over frequency.

Important, the first dimension must be the frequency dimension! If a field like spectral_radiance_field is input, the stokes dimension is also removed.

Author
Manfred Brath
Parameters
[out]radiation_fieldSupergeneric output
[in]f_gridWS Input
[in]spectral_radiation_fieldGeneric Input

Definition at line 328 of file m_fluxes.cc.

References b, c, ConstTensor4View::nbooks(), ConstTensor5View::nbooks(), ConstTensor4View::ncols(), ConstTensor5View::ncols(), ConstVectorView::nelem(), ConstTensor4View::npages(), ConstTensor5View::npages(), ConstTensor4View::nrows(), ConstTensor5View::nrows(), ConstTensor5View::nshelves(), and Tensor4::resize().

Referenced by RadiationFieldSpectralIntegrate_sg_Tensor4Tensor5_g(), and RadiationFieldSpectralIntegrate_sg_Tensor5Tensor7_g().

◆ RadiationFieldSpectralIntegrate() [2/2]

void RadiationFieldSpectralIntegrate ( Tensor5 radiation_field,
const Vector f_grid,
const Tensor7 spectral_radiation_field,
const Verbosity verbosity 
)

WORKSPACE METHOD: RadiationFieldSpectralIntegrate.

Integrates fields like spectral_irradiance_field or spectral_radiance_field over frequency.

Important, the first dimension must be the frequency dimension! If a field like spectral_radiance_field is input, the stokes dimension is also removed.

Author
Manfred Brath
Parameters
[out]radiation_fieldSupergeneric output
[in]f_gridWS Input
[in]spectral_radiation_fieldGeneric Input

Definition at line 365 of file m_fluxes.cc.

References b, c, ConstTensor5View::nbooks(), ConstTensor7View::nbooks(), ConstTensor5View::ncols(), ConstVectorView::nelem(), ConstTensor7View::nlibraries(), ConstTensor5View::npages(), ConstTensor7View::npages(), ConstTensor5View::nrows(), ConstTensor7View::nrows(), ConstTensor5View::nshelves(), ConstTensor7View::nshelves(), ConstTensor7View::nvitrines(), and Tensor5::resize().

◆ spectral_irradiance_fieldFromSpectralRadianceField()

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 verbosity 
)

WORKSPACE METHOD: spectral_irradiance_fieldFromSpectralRadianceField.

Calculates the spectral irradiance from spectral_radiance_field.

The spectral_radiance_field is integrated over the angular grids according to the grids set by AngularGridsSetFluxCalc. See AngularGridsSetFluxCalc to set za_grid, aa_grid, and za_grid_weights*.

Author
Manfred Brath
Parameters
[out]spectral_irradiance_fieldWS Output
[in]spectral_radiance_fieldWS Input
[in]za_gridWS Input
[in]aa_gridWS Input
[in]za_grid_weightsWS Input

Definition at line 405 of file m_fluxes.cc.

References abs, b, c, DEG2RAD, joker, ConstTensor5View::nbooks(), ConstTensor7View::nbooks(), ConstTensor5View::ncols(), ConstVectorView::nelem(), ConstTensor7View::nlibraries(), ConstTensor5View::npages(), ConstTensor7View::npages(), ConstTensor5View::nrows(), ConstTensor5View::nshelves(), ConstTensor7View::nshelves(), ConstTensor7View::nvitrines(), PI, and Tensor5::resize().

Referenced by spectral_irradiance_fieldFromSpectralRadianceField_g().

◆ spectral_radiance_fieldClearskyPlaneParallel()

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 String rt_integration_option,
const Tensor3 surface_props_data,
const Vector za_grid,
const Index use_parallel_za,
const Verbosity verbosity 
)

WORKSPACE METHOD: spectral_radiance_fieldClearskyPlaneParallel.

Clear-sky radiance field of a plane parallel atmosphere.

The method assumes a 1D flat planet. Radiances along each direction given by za_grid are calculated using ppathPlaneParallel and iyEmissionStandard.

Surface properties are defined by iy_surface_agenda, i.e. there is no restriction to e.g. specular surfaces.

Note that the variable ppath_lmax is considered, and that it can be critical for the accuracy for zenith angles close to 90 degrees. That is, using ppath_lmax=-1 is not recommended for this function.

Information on transmittance is also provided by the GOUT trans_field. For up-welling radiation (scat_za > 90), this variable holds the transmittance to space, for considered position and propagation direction. For down-welling radiation, trans_field holds instead the transmittance down to the surface.

Author
Patrick Eriksson
Parameters
[in,out]wsWorkspace
[out]spectral_radiance_fieldWS Output
[out]trans_fieldGeneric output
[in]propmat_clearsky_agendaWS Input
[in]water_p_eq_agendaWS Input
[in]iy_space_agendaWS Input
[in]iy_surface_agendaWS Input
[in]iy_cloudbox_agendaWS Input
[in]stokes_dimWS Input
[in]f_gridWS Input
[in]atmosphere_dimWS Input
[in]p_gridWS Input
[in]z_fieldWS Input
[in]t_fieldWS Input
[in]nlte_fieldWS Input
[in]vmr_fieldWS Input
[in]abs_speciesWS Input
[in]wind_u_fieldWS Input
[in]wind_v_fieldWS Input
[in]wind_w_fieldWS Input
[in]mag_u_fieldWS Input
[in]mag_v_fieldWS Input
[in]mag_w_fieldWS Input
[in]z_surfaceWS Input
[in]ppath_lmaxWS Input
[in]rte_alonglos_vWS Input
[in]rt_integration_optionWS Input
[in]surface_props_dataWS Input
[in]za_gridWS Input
[in]use_parallel_zaGeneric Input (Default: "1")

Definition at line 483 of file m_fluxes.cc.

References Agenda::append(), ARTS_ASSERT, Agenda::check(), Ppath::gp_p, index_of_zsurface(), iyEmissionStandard(), joker, ConstMatrixView::ncols(), ConstVectorView::nelem(), Ppath::np, ppathPlaneParallel(), Tensor7::resize(), Tensor3::resize(), and Agenda::set_name().

Referenced by spectral_radiance_fieldClearskyPlaneParallel_g().

◆ spectral_radiance_fieldCopyCloudboxField()

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 verbosity 
)

WORKSPACE METHOD: spectral_radiance_fieldCopyCloudboxField.

Set spectral_radiance_field to be a copy of cloudbox_field.

This method can only be used for 1D atmospheres and if the cloud box covers the complete atmosphere. For such case, the two fields cover the same atmospheric volume and a direct copying can be made.

Author
Patrick Eriksson
Parameters
[out]spectral_radiance_fieldWS Output
[in]atmosphere_dimWS Input
[in]p_gridWS Input
[in]cloudbox_onWS Input
[in]cloudbox_limitsWS Input
[in]cloudbox_fieldWS Input

Definition at line 704 of file m_fluxes.cc.

References ConstVectorView::nelem().

Referenced by spectral_radiance_fieldCopyCloudboxField_g().

◆ spectral_radiance_fieldExpandCloudboxField()

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 String rt_integration_option,
const Tensor3 surface_props_data,
const Vector za_grid,
const Index use_parallel_za,
const Verbosity verbosity 
)

WORKSPACE METHOD: spectral_radiance_fieldExpandCloudboxField.

Uses and expands cloudbox_field to set spectral_radiance_field.

The method demands that cloudbox_field starts at the first pressure level (i.e. cloudbox_limits[0] is 0). The method copies cloudbox_field to fill spectral_radiance_field up to the top of the cloudbox.

To fill the remaning part of spectral_radiance_field, clear-sky calculations are performed largely in the same maner as done by spectral_radiance_fieldClearskyPlaneParallel*. That is, clear-sky calculations are done for the upper part of the atmosphere, assuming a flat planet.

Note that the cloud box constitutes the lower boundary for the later calculations, and iy_cloudbox_agenda must be set to perform an interpolation of the cloudbox field.

Author
Patrick Eriksson
Parameters
[in,out]wsWorkspace
[out]spectral_radiance_fieldWS Output
[in]propmat_clearsky_agendaWS Input
[in]water_p_eq_agendaWS Input
[in]iy_space_agendaWS Input
[in]iy_surface_agendaWS Input
[in]iy_cloudbox_agendaWS Input
[in]stokes_dimWS Input
[in]f_gridWS Input
[in]atmosphere_dimWS Input
[in]p_gridWS Input
[in]z_fieldWS Input
[in]t_fieldWS Input
[in]nlte_fieldWS Input
[in]vmr_fieldWS Input
[in]abs_speciesWS Input
[in]wind_u_fieldWS Input
[in]wind_v_fieldWS Input
[in]wind_w_fieldWS Input
[in]mag_u_fieldWS Input
[in]mag_v_fieldWS Input
[in]mag_w_fieldWS Input
[in]z_surfaceWS Input
[in]cloudbox_onWS Input
[in]cloudbox_limitsWS Input
[in]cloudbox_fieldWS Input
[in]ppath_lmaxWS Input
[in]rte_alonglos_vWS Input
[in]rt_integration_optionWS Input
[in]surface_props_dataWS Input
[in]za_gridWS Input
[in]use_parallel_zaGeneric Input (Default: "0")

Definition at line 726 of file m_fluxes.cc.

References Agenda::append(), ARTS_ASSERT, Agenda::check(), Ppath::gp_p, iyEmissionStandard(), joker, ConstMatrixView::ncols(), ConstVectorView::nelem(), Ppath::np, ppathPlaneParallel(), Tensor7::resize(), and Agenda::set_name().

Referenced by spectral_radiance_fieldExpandCloudboxField_g().

Variable Documentation

◆ DEG2RAD

◆ PI