ARTS
2.2.66
|
#include <stdexcept>
#include <cmath>
#include "messages.h"
#include "arts.h"
#include "ppath.h"
#include "matpackI.h"
#include "special_interp.h"
#include "check_input.h"
#include "rte.h"
#include "lin_alg.h"
#include "logic.h"
#include "optproperties.h"
#include "physics_funcs.h"
#include "xml_io.h"
#include "rng.h"
#include "cloudbox.h"
Go to the source code of this file.
Functions | |
void | clear_rt_vars_at_gp (Workspace &ws, MatrixView ext_mat_mono, VectorView abs_vec_mono, Numeric &temperature, const Agenda &propmat_clearsky_agenda, const Numeric &f_mono, const GridPos &gp_p, const GridPos &gp_lat, const GridPos &gp_lon, ConstVectorView p_grid, ConstTensor3View t_field, ConstTensor4View vmr_field) |
clear_rt_vars_at_gp More... | |
void | cloudy_rt_vars_at_gp (Workspace &ws, MatrixView ext_mat_mono, VectorView abs_vec_mono, VectorView pnd_vec, Numeric &temperature, const Agenda &propmat_clearsky_agenda, const Index stokes_dim, const Numeric &f_mono, const GridPos &gp_p, const GridPos &gp_lat, const GridPos &gp_lon, ConstVectorView p_grid_cloud, ConstTensor3View t_field_cloud, ConstTensor4View vmr_field_cloud, const Tensor4 &pnd_field, const ArrayOfSingleScatteringData &scat_data_array_mono, const ArrayOfIndex &cloudbox_limits, const Vector &rte_los, const Verbosity &verbosity) |
cloudy_rt_vars_at_gp More... | |
void | cloud_atm_vars_by_gp (VectorView pressure, VectorView temperature, MatrixView vmr, MatrixView pnd, const ArrayOfGridPos &gp_p, const ArrayOfGridPos &gp_lat, const ArrayOfGridPos &gp_lon, const ArrayOfIndex &cloudbox_limits, ConstVectorView p_grid_cloud, ConstTensor3View t_field_cloud, ConstTensor4View vmr_field_cloud, ConstTensor4View pnd_field) |
cloud_atm_vars_by_gp More... | |
void | findZ11max (Vector &Z11maxvector, const ArrayOfSingleScatteringData &scat_data_array_mono) |
findZ11max More... | |
bool | is_anyptype30 (const ArrayOfSingleScatteringData &scat_data_array_mono) |
is_anyptype30 More... | |
void | mcPathTraceGeneral (Workspace &ws, MatrixView evol_op, Vector &abs_vec_mono, Numeric &temperature, MatrixView ext_mat_mono, Rng &rng, Vector &rte_pos, Vector &rte_los, Vector &pnd_vec, Numeric &g, Ppath &ppath_step, Index &termination_flag, bool &inside_cloud, const Agenda &ppath_step_agenda, const Numeric &ppath_lraytrace, const Agenda &propmat_clearsky_agenda, const Index stokes_dim, const Numeric &f_mono, const Vector &p_grid, const Vector &lat_grid, const Vector &lon_grid, const Tensor3 &z_field, const Vector &refellipsoid, const Matrix &z_surface, const Tensor3 &t_field, const Tensor4 &vmr_field, const ArrayOfIndex &cloudbox_limits, const Tensor4 &pnd_field, const ArrayOfSingleScatteringData &scat_data_array_mono, const Verbosity &verbosity) |
mcPathTraceGeneral More... | |
void | opt_propCalc (MatrixView K, VectorView K_abs, const Numeric za, const Numeric aa, const ArrayOfSingleScatteringData &scat_data_array_mono, const Index stokes_dim, ConstVectorView pnd_vec, const Numeric rtp_temperature, const Verbosity &verbosity) |
opt_propCalc More... | |
void | opt_propExtract (MatrixView K_spt, VectorView K_abs_spt, const SingleScatteringData &scat_data, const Numeric za, const Numeric aa, const Numeric rtp_temperature, const Index stokes_dim, const Verbosity &verbosity) |
void | pha_mat_singleCalc (MatrixView Z, const Numeric za_sca, const Numeric aa_sca, const Numeric za_inc, const Numeric aa_inc, const ArrayOfSingleScatteringData &scat_data_array_mono, const Index stokes_dim, ConstVectorView pnd_vec, const Numeric rtp_temperature, const Verbosity &verbosity) |
pha_mat_singleCalc More... | |
void | pha_mat_singleExtract (MatrixView Z_spt, const SingleScatteringData &scat_data, const Numeric za_sca, const Numeric aa_sca, const Numeric za_inc, const Numeric aa_inc, const Numeric rtp_temperature, const Index stokes_dim, const Verbosity &verbosity) |
Extract the phase matrix from a monochromatic SingleScatteringData object. More... | |
void | Sample_los (VectorView new_rte_los, Numeric &g_los_csc_theta, MatrixView Z, Rng &rng, ConstVectorView rte_los, const ArrayOfSingleScatteringData &scat_data_array_mono, const Index stokes_dim, ConstVectorView pnd_vec, const bool anyptype30, ConstVectorView Z11maxvector, const Numeric Csca, const Numeric rtp_temperature, const Verbosity &verbosity) |
Sample_los. More... | |
Variables | |
const Numeric | DEG2RAD |
const Numeric | RAD2DEG |
const Numeric | PI |
void clear_rt_vars_at_gp | ( | Workspace & | ws, |
MatrixView | ext_mat_mono, | ||
VectorView | abs_vec_mono, | ||
Numeric & | temperature, | ||
const Agenda & | propmat_clearsky_agenda, | ||
const Numeric & | f_mono, | ||
const GridPos & | gp_p, | ||
const GridPos & | gp_lat, | ||
const GridPos & | gp_lon, | ||
ConstVectorView | p_grid, | ||
ConstTensor3View | t_field, | ||
ConstTensor4View | vmr_field | ||
) |
clear_rt_vars_at_gp
Calculates a bunch of atmospheric variables at the end of a ppath.
Definition at line 56 of file montecarlo.cc.
References interp_atmfield_by_itw(), interp_atmfield_gp2itw(), interpweights(), itw2p(), joker, ConstTensor4View::nbooks(), ns, opt_prop_sum_propmat_clearsky(), and propmat_clearsky_agendaExecute().
Referenced by mcPathTraceGeneral(), and mcPathTraceIPA().
void cloud_atm_vars_by_gp | ( | VectorView | pressure, |
VectorView | temperature, | ||
MatrixView | vmr, | ||
MatrixView | pnd, | ||
const ArrayOfGridPos & | gp_p, | ||
const ArrayOfGridPos & | gp_lat, | ||
const ArrayOfGridPos & | gp_lon, | ||
const ArrayOfIndex & | cloudbox_limits, | ||
ConstVectorView | p_grid_cloud, | ||
ConstTensor3View | t_field_cloud, | ||
ConstTensor4View | vmr_field_cloud, | ||
ConstTensor4View | pnd_field | ||
) |
cloud_atm_vars_by_gp
Returns pressure, temperature, VMRs and PNDs, at points corresponding to arrays of gridpositions gp_p, gp_lat, and gp_lon. The field and grid input variables all span only the cloudbox
pressure | Output: a vector of pressures |
temperature | Output: a vector of temperatures |
vmr | Output: a n_species by n matrix of VMRs |
pnd | Output: a n_ptypes by n matrix of VMRs |
gp_p | an array of pressre gridpoints |
gp_lat | an array of latitude gridpoints |
gp_lon | an array of longitude gridpoints |
cloudbox_limits | the WSV |
p_grid_cloud | the subset of the p_grid corresponding to the cloudbox |
t_field_cloud | the t_field within the cloudbox |
vmr_field_cloud | the t_field within the cloudbox |
pnd_field | The WSV |
Definition at line 243 of file montecarlo.cc.
References gridpos_upperend_check(), interp_atmfield_by_itw(), interp_atmfield_gp2itw(), interpweights(), itw2p(), joker, ConstTensor4View::nbooks(), Array< base >::nelem(), ConstVectorView::nelem(), and ns.
Referenced by cloudy_rt_vars_at_gp(), and iwp_cloud_opt_pathCalc().
void cloudy_rt_vars_at_gp | ( | Workspace & | ws, |
MatrixView | ext_mat_mono, | ||
VectorView | abs_vec_mono, | ||
VectorView | pnd_vec, | ||
Numeric & | temperature, | ||
const Agenda & | propmat_clearsky_agenda, | ||
const Index | stokes_dim, | ||
const Numeric & | f_mono, | ||
const GridPos & | gp_p, | ||
const GridPos & | gp_lat, | ||
const GridPos & | gp_lon, | ||
ConstVectorView | p_grid_cloud, | ||
ConstTensor3View | t_field_cloud, | ||
ConstTensor4View | vmr_field_cloud, | ||
const Tensor4 & | pnd_field, | ||
const ArrayOfSingleScatteringData & | scat_data_array_mono, | ||
const ArrayOfIndex & | cloudbox_limits, | ||
const Vector & | rte_los, | ||
const Verbosity & | verbosity | ||
) |
cloudy_rt_vars_at_gp
Calculates a bunch of atmospheric variables at the end of a ppath.
Definition at line 135 of file montecarlo.cc.
References cloud_atm_vars_by_gp(), joker, ConstTensor4View::nbooks(), ns, opt_prop_sum_propmat_clearsky(), opt_propCalc(), and propmat_clearsky_agendaExecute().
Referenced by mcPathTraceGeneral(), and mcPathTraceIPA().
void findZ11max | ( | Vector & | Z11maxvector, |
const ArrayOfSingleScatteringData & | scat_data_array_mono | ||
) |
findZ11max
The direction sampling method requires a bounding value for Z11. This returns a vector with the maximum value of Z11 for each particle type.
[out] | Z11maxvector | Maximum value of Z11 for each particle type |
[in] | scat_data_array_mono |
Definition at line 337 of file montecarlo.cc.
References joker, max, Array< base >::nelem(), PARTICLE_TYPE_HORIZ_AL, PARTICLE_TYPE_MACROS_ISO, and Vector::resize().
Referenced by MCGeneral(), and MCIPA().
bool is_anyptype30 | ( | const ArrayOfSingleScatteringData & | scat_data_array_mono | ) |
is_anyptype30
Some operations in Monte Carlo simulations are different depending on the particle type of the scattering particles. This function searches scat_data_array_mono to determine if any of the particle types have particle_type=30
Definition at line 373 of file montecarlo.cc.
References Array< base >::nelem(), and PARTICLE_TYPE_HORIZ_AL.
Referenced by MCGeneral(), and MCIPA().
void mcPathTraceGeneral | ( | Workspace & | ws, |
MatrixView | evol_op, | ||
Vector & | abs_vec_mono, | ||
Numeric & | temperature, | ||
MatrixView | ext_mat_mono, | ||
Rng & | rng, | ||
Vector & | rte_pos, | ||
Vector & | rte_los, | ||
Vector & | pnd_vec, | ||
Numeric & | g, | ||
Ppath & | ppath_step, | ||
Index & | termination_flag, | ||
bool & | inside_cloud, | ||
const Agenda & | ppath_step_agenda, | ||
const Numeric & | ppath_lraytrace, | ||
const Agenda & | propmat_clearsky_agenda, | ||
const Index | stokes_dim, | ||
const Numeric & | f_mono, | ||
const Vector & | p_grid, | ||
const Vector & | lat_grid, | ||
const Vector & | lon_grid, | ||
const Tensor3 & | z_field, | ||
const Vector & | refellipsoid, | ||
const Matrix & | z_surface, | ||
const Tensor3 & | t_field, | ||
const Tensor4 & | vmr_field, | ||
const ArrayOfIndex & | cloudbox_limits, | ||
const Tensor4 & | pnd_field, | ||
const ArrayOfSingleScatteringData & | scat_data_array_mono, | ||
const Verbosity & | verbosity | ||
) |
mcPathTraceGeneral
Performs the tasks of pathlength sampling.
Ray tracing done (but now only as far as determined by pathlength sampling) and calculation of the evolution operator and several atmospheric variables at the new point.
The end point of the ray tracing is returned by ppath_step, where the point of concern has index ppath_step.np-1. However, a somehwat dirty trick is used here to avoid copying of data. Only ppath.np is adjusted, and ppath_step can contain additional points (that should not be used).
2012-11-15 Patrick Eriksson Revised. Added handling of ppath_step_agenda. Correct handling of ppath steps having more than two points.
Definition at line 1402 of file mc_NotUsed.cc.
References abs, clear_rt_vars_at_gp(), cloudy_rt_vars_at_gp(), CREATE_OUT0, Rng::draw(), ext2trans(), fractional_gp(), Ppath::gp_lat, Ppath::gp_lon, Ppath::gp_p, gridpos(), id_mat(), interp(), interpweights(), is_diagonal(), is_gp_inside_cloudbox(), joker, Ppath::los, Ppath::lstep, matrix_exp_p30(), mult(), ConstVectorView::nelem(), Ppath::np, Ppath::pos, ppath_start_stepping(), ppath_step_agendaExecute(), and ppath_what_background().
void opt_propCalc | ( | MatrixView | ext_mat_mono, |
VectorView | abs_vec_mono, | ||
const Numeric | za, | ||
const Numeric | aa, | ||
const ArrayOfSingleScatteringData & | scat_data_array_mono, | ||
const Index | stokes_dim, | ||
ConstVectorView | pnd_vec, | ||
const Numeric | rtp_temperature, | ||
const Verbosity & | verbosity | ||
) |
opt_propCalc
Returns the extinction matrix and absorption vector due to scattering particles from scat_data_array_mono
ext_mat_mono | Output: extinction matrix |
abs_vec_mono | Output: absorption coefficient vector |
za | zenith angle of propagation direction |
aa | azimuthal angle of propagation |
scat_data_array_mono | workspace variable |
stokes_dim | workspace variable |
pnd_vec | vector pf particle number densities (one element per particle type) |
rtp_temperature | loacl temperature (workspace variable) |
Definition at line 684 of file montecarlo.cc.
References ConstMatrixView::ncols(), Array< base >::nelem(), ConstVectorView::nelem(), ConstMatrixView::nrows(), and opt_propExtract().
Referenced by cloudy_rt_vars_at_gp(), get_ppath_ext(), and iwp_cloud_opt_pathCalc().
void opt_propExtract | ( | MatrixView | K_spt, |
VectorView | K_abs_spt, | ||
const SingleScatteringData & | scat_data, | ||
const Numeric | za, | ||
const Numeric | aa, | ||
const Numeric | rtp_temperature, | ||
const Index | stokes_dim, | ||
const Verbosity & | verbosity | ||
) |
Definition at line 751 of file montecarlo.cc.
References SingleScatteringData::abs_vec_data, CREATE_OUT0, SingleScatteringData::ext_mat_data, gridpos(), interp(), interpweights(), joker, ConstTensor5View::ncols(), ConstVectorView::nelem(), ConstTensor5View::npages(), SingleScatteringData::particle_type, PARTICLE_TYPE_GENERAL, PARTICLE_TYPE_HORIZ_AL, PARTICLE_TYPE_MACROS_ISO, SingleScatteringData::T_grid, and SingleScatteringData::za_grid.
Referenced by opt_propCalc(), and propmat_clearskyAddParticles().
void pha_mat_singleCalc | ( | MatrixView | Z, |
const Numeric | za_sca, | ||
const Numeric | aa_sca, | ||
const Numeric | za_inc, | ||
const Numeric | aa_inc, | ||
const ArrayOfSingleScatteringData & | scat_data_array_mono, | ||
const Index | stokes_dim, | ||
ConstVectorView | pnd_vec, | ||
const Numeric | rtp_temperature, | ||
const Verbosity & | verbosity | ||
) |
pha_mat_singleCalc
Returns the total phase matrix for given incident and scattered directions . It requires a vector of particle number densities to be precalculated
[out] | Z | Output: phase matrix |
[in] | za_sca | scattered |
[in] | aa_sca | and |
[in] | za_inc | incident |
[in] | aa_inc | directions |
[in] | scat_data_array_mono | workspace variable |
[in] | stokes_dim | workspace variable |
[in] | pnd_vec | vector of particle number densities at the point in question |
[in] | rtp_temperature | workspace variable |
Definition at line 928 of file montecarlo.cc.
References ConstVectorView::nelem(), and pha_mat_singleExtract().
Referenced by fos(), iyCloudRadar(), pha_matExtractManually(), and Sample_los().
void pha_mat_singleExtract | ( | MatrixView | Z_spt, |
const SingleScatteringData & | scat_data, | ||
const Numeric | za_sca, | ||
const Numeric | aa_sca, | ||
const Numeric | za_inc, | ||
const Numeric | aa_inc, | ||
const Numeric | rtp_temperature, | ||
const Index | stokes_dim, | ||
const Verbosity & | verbosity | ||
) |
Extract the phase matrix from a monochromatic SingleScatteringData object.
Given a monochromatic SingleScatteringData object, incident and scattered directions, and the temperature, this function returns the phase matrix in the laboratory frame
[out] | Z_spt | the phase matrix |
[in] | scat_data | a monochromatic SingleScatteringData object |
[in] | za_sca | |
[in] | aa_sca | |
[in] | za_inc | |
[in] | aa_inc | |
[in] | rtp_temperature | |
[in] | stokes_dim |
Definition at line 981 of file montecarlo.cc.
References SingleScatteringData::aa_grid, abs, CREATE_OUT0, gridpos(), interp(), interp_scat_angle_temperature(), interpweights(), joker, ConstTensor7View::ncols(), ConstVectorView::nelem(), SingleScatteringData::particle_type, PARTICLE_TYPE_GENERAL, PARTICLE_TYPE_HORIZ_AL, PARTICLE_TYPE_MACROS_ISO, SingleScatteringData::pha_mat_data, pha_mat_labCalc(), SingleScatteringData::T_grid, and SingleScatteringData::za_grid.
Referenced by pha_mat_singleCalc().
void Sample_los | ( | VectorView | new_rte_los, |
Numeric & | g_los_csc_theta, | ||
MatrixView | Z, | ||
Rng & | rng, | ||
ConstVectorView | rte_los, | ||
const ArrayOfSingleScatteringData & | scat_data_array_mono, | ||
const Index | stokes_dim, | ||
ConstVectorView | pnd_vec, | ||
const bool | anyptype30, | ||
ConstVectorView | Z11maxvector, | ||
const Numeric | Csca, | ||
const Numeric | rtp_temperature, | ||
const Verbosity & | verbosity | ||
) |
Sample_los.
FIXME: 2011-06-17 Documentation removed by Gerrit (severely out of date)
[out] | new_rte_los | incident line of sight for subsequent |
[out] | g_los_csc_theta | probability density for the chosen direction multiplied by sin(za) |
[out] | Z | |
[in,out] | rng | Rng random number generator instance |
[in] | rte_los | incident line of sight for subsequent ray-tracing. |
[in] | scat_data_array_mono | |
[in] | stokes_dim | |
[in] | pnd_vec | |
[in] | anyptype30 | |
[in] | Z11maxvector | |
[in] | Csca | |
[in] | rtp_temperature |
Definition at line 1187 of file montecarlo.cc.
References Rng::draw(), Array< base >::nelem(), ConstVectorView::nelem(), pha_mat_singleCalc(), and RAD2DEG.
Referenced by MCGeneral(), and MCIPA().
|
extern |
|
extern |
|
extern |