ARTS  2.0.49
montecarlo.h
Go to the documentation of this file.
1 /* Copyright (C) 2003-2008 Cory Davis <cory@met.ed.ac.uk>
2 
3  This program is free software; you can redistribute it and/or
4  modify it under the terms of the GNU General Public License as
5  published by the Free Software Foundation; either version 2 of the
6  License, or (at your option) any later version.
7 
8  This program is distributed in the hope that it will be useful,
9  but WITHOUT ANY WARRANTY; without even the implied warranty of
10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  GNU General Public License for more details.
12 
13  You should have received a copy of the GNU General Public License
14  along with this program; if not, write to the Free Software
15  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
16  USA. */
17 
18 #ifndef montecarlo_h
19 #define montecarlo_h
20 
21 /*===========================================================================
22  === External declarations
23  ===========================================================================*/
24 #include <stdexcept>
25 #include <cmath>
26 #include "messages.h"
27 #include "arts.h"
28 #include "ppath.h"
29 #include "matpackI.h"
30 #include "special_interp.h"
31 #include "check_input.h"
32 #include "rte.h"
33 #include "lin_alg.h"
34 #include "logic.h"
35 #include "optproperties.h"
36 #include "physics_funcs.h"
37 #include "xml_io.h"
38 #include "rng.h"
39 #include "cloudbox.h"
40 
41 extern const Numeric DEG2RAD;
42 extern const Numeric RAD2DEG;
43 extern const Numeric PI;
44 
46  MatrixView ext_mat_mono,
47  VectorView abs_vec_mono,
48  Numeric& temperature,
49  const Agenda& opt_prop_gas_agenda,
50  const Agenda& abs_scalar_gas_agenda,
51  const Index f_index,
52  const GridPos& gp_p,
53  const GridPos& gp_lat,
54  const GridPos& gp_lon,
55  ConstVectorView p_grid,
56  ConstTensor3View t_field,
57  ConstTensor4View vmr_field);
58 
60  MatrixView ext_mat_mono,
61  VectorView abs_vec_mono,
62  VectorView pnd_vec,
63  Numeric& temperature,
64  const Agenda& opt_prop_gas_agenda,
65  const Agenda& abs_scalar_gas_agenda,
66  const Index stokes_dim,
67  const Index f_index,
68  const GridPos& gp_p,
69  const GridPos& gp_lat,
70  const GridPos& gp_lon,
71  ConstVectorView p_grid_cloud,
72  ConstTensor3View t_field_cloud,
73  ConstTensor4View vmr_field_cloud,
74  const Tensor4& pnd_field,
75  const ArrayOfSingleScatteringData& scat_data_mono,
76  const ArrayOfIndex& cloudbox_limits,
77  const Vector& rte_los,
78  const Verbosity& verbosity);
79 
80 void cloud_atm_vars_by_gp (VectorView pressure,
81  VectorView temperature,
82  MatrixView vmr,
83  MatrixView pnd,
84  const ArrayOfGridPos& gp_p,
85  const ArrayOfGridPos& gp_lat,
86  const ArrayOfGridPos& gp_lon,
87  const ArrayOfIndex& cloudbox_limits,
88  ConstVectorView p_grid_cloud,
89  ConstTensor3View t_field_cloud,
90  ConstTensor4View vmr_field_cloud,
91  ConstTensor4View pnd_field);
92 
93 void cum_l_stepCalc (Vector& cum_l_step,
94  const Ppath& ppath);
95 
96 void findZ11max (Vector& Z11maxvector,
97  const ArrayOfSingleScatteringData& scat_data_mono);
98 
99 bool is_anyptype30 (const ArrayOfSingleScatteringData& scat_data_mono);
100 
102  Numeric& iwp,
103  Numeric& cloud_opt_path,
104  //input
105  const Vector& rte_pos,
106  const Vector& rte_los,
107  const Agenda& ppath_step_agenda,
108  const Vector& p_grid,
109  const Vector& lat_grid,
110  const Vector& lon_grid,
111  const Matrix& r_geoid,
112  const Matrix& z_surface,
113  const Tensor3& z_field,
114  const Tensor3& t_field,
115  const Tensor4& vmr_field,
116  const ArrayOfIndex& cloudbox_limits,
117  const Tensor4& pnd_field,
118  const ArrayOfSingleScatteringData& scat_data_mono,
119  const Vector& particle_masses,
120  const Verbosity& verbosity);
121 
122 
124  ConstMatrixView A);
125 
126 void mcPathTraceGeneral (Workspace& ws,
127  MatrixView evol_op,
128  Vector& abs_vec_mono,
129  Numeric& temperature,
130  MatrixView ext_mat_mono,
131  Rng& rng,
132  Vector& rte_pos,
133  Vector& rte_los,
134  Vector& pnd_vec,
135  Numeric& g,
136  Ppath& ppath_step,
137  Index& termination_flag,
138  bool& inside_cloud,
139  //Numeric& rte_pressure,
140  //Vector& rte_vmr_list,
141  const Agenda& opt_prop_gas_agenda,
142  const Agenda& abs_scalar_gas_agenda,
143  const Index stokes_dim,
144  const Index f_index,
145  const Vector& p_grid,
146  const Vector& lat_grid,
147  const Vector& lon_grid,
148  const Tensor3& z_field,
149  const Matrix& r_geoid,
150  const Matrix& z_surface,
151  const Tensor3& t_field,
152  const Tensor4& vmr_field,
153  const ArrayOfIndex& cloudbox_limits,
154  const Tensor4& pnd_field,
155  const ArrayOfSingleScatteringData& scat_data_mono,
156  const Verbosity& verbosity);
157  // GH 2011-06-17 commented out
158  // const Index z_field_is_1D);
159 
160 void mcPathTraceIPA (Workspace& ws,
161  MatrixView evol_op,
162  Vector& abs_vec_mono,
163  Numeric& temperature,
164  MatrixView ext_mat_mono,
165  Rng& rng,
166  Vector& rte_pos,
167  Vector& rte_los,
168  Vector& pnd_vec,
169  Numeric& g,
170  Index& termination_flag,
171  bool& inside_cloud,
172  //Numeric& rte_pressure,
173  //Vector& rte_vmr_list,
174  const Agenda& opt_prop_gas_agenda,
175  const Agenda& abs_scalar_gas_agenda,
176  const Index stokes_dim,
177  const Index f_index,
178  const Vector& p_grid,
179  const Vector& lat_grid,
180  const Vector& lon_grid,
181  const Tensor3& z_field,
182  const Matrix& r_geoid,
183  const Matrix& z_surface,
184  const Tensor3& t_field,
185  const Tensor4& vmr_field,
186  const ArrayOfIndex& cloudbox_limits,
187  const Tensor4& pnd_field,
188  const ArrayOfSingleScatteringData& scat_data_mono,
189  const Index z_field_is_1D,
190  const Ppath& ppath,
191  const Verbosity& verbosity);
192 
193 void opt_propCalc (MatrixView K,
194  VectorView K_abs,
195  const Numeric za,
196  const Numeric aa,
197  const ArrayOfSingleScatteringData& scat_data_mono,
198  const Index stokes_dim,
199  ConstVectorView pnd_vec,
200  const Numeric rte_temperature,
201  const Verbosity& verbosity);
202 
203 void opt_propExtract (MatrixView K_spt,
204  VectorView K_abs_spt,
205  const SingleScatteringData& scat_data,
206  const Numeric za,
207  const Numeric aa,
208  const Numeric rte_temperature,
209  const Index stokes_dim,
210  const Verbosity& verbosity);
211 
213  const Numeric za_sca,
214  const Numeric aa_sca,
215  const Numeric za_inc,
216  const Numeric aa_inc,
217  const ArrayOfSingleScatteringData& scat_data_mono,
218  const Index stokes_dim,
219  ConstVectorView pnd_vec,
220  const Numeric rte_temperature,
221  const Verbosity& verbosity);
222 
224  const SingleScatteringData& scat_data,
225  const Numeric za_sca,
226  const Numeric aa_sca,
227  const Numeric za_inc,
228  const Numeric aa_inc,
229  const Numeric rte_temperature,
230  const Index stokes_dim,
231  const Verbosity& verbosity);
232 
233 
234 void Sample_los (VectorView new_rte_los,
235  Numeric& g_los_csc_theta,
236  MatrixView Z,
237  Rng& rng,
238  ConstVectorView rte_los,
239  const ArrayOfSingleScatteringData& scat_data_mono,
240  const Index stokes_dim,
241  ConstVectorView pnd_vec,
242  const bool anyptype30,
243  ConstVectorView Z11maxvector,
244  const Numeric Csca,
245  const Numeric rte_temperature,
246  const Verbosity& verbosity);
247 
248 
249 #endif // montecarlo_h
Matrix
The Matrix class.
Definition: matpackI.h:767
iwp_cloud_opt_pathCalc
void iwp_cloud_opt_pathCalc(Workspace &ws, Numeric &iwp, Numeric &cloud_opt_path, const Vector &rte_pos, const Vector &rte_los, const Agenda &ppath_step_agenda, const Vector &p_grid, const Vector &lat_grid, const Vector &lon_grid, const Matrix &r_geoid, const Matrix &z_surface, const Tensor3 &z_field, const Tensor3 &t_field, const Tensor4 &vmr_field, const ArrayOfIndex &cloudbox_limits, const Tensor4 &pnd_field, const ArrayOfSingleScatteringData &scat_data_mono, const Vector &particle_masses, const Verbosity &verbosity)
iwp_cloud_opt_pathCalc
Definition: montecarlo.cc:417
MatrixView
The MatrixView class.
Definition: matpackI.h:668
Sample_los
void Sample_los(VectorView new_rte_los, Numeric &g_los_csc_theta, MatrixView Z, Rng &rng, ConstVectorView rte_los, const ArrayOfSingleScatteringData &scat_data_mono, const Index stokes_dim, ConstVectorView pnd_vec, const bool anyptype30, ConstVectorView Z11maxvector, const Numeric Csca, const Numeric rte_temperature, const Verbosity &verbosity)
Sample_los.
Definition: montecarlo.cc:1712
opt_propCalc
void opt_propCalc(MatrixView K, VectorView K_abs, const Numeric za, const Numeric aa, const ArrayOfSingleScatteringData &scat_data_mono, const Index stokes_dim, ConstVectorView pnd_vec, const Numeric rte_temperature, const Verbosity &verbosity)
opt_propCalc
Definition: montecarlo.cc:1180
Tensor3
The Tensor3 class.
Definition: matpackIII.h:340
RAD2DEG
const Numeric RAD2DEG
PI
const Numeric PI
opt_propExtract
void opt_propExtract(MatrixView K_spt, VectorView K_abs_spt, const SingleScatteringData &scat_data, const Numeric za, const Numeric aa, const Numeric rte_temperature, const Index stokes_dim, const Verbosity &verbosity)
Extract ext_mat_mono and abs_vec_mono from a monochromatic SingleScatteringData object.
Definition: montecarlo.cc:1279
clear_rt_vars_at_gp
void clear_rt_vars_at_gp(Workspace &ws, MatrixView ext_mat_mono, VectorView abs_vec_mono, Numeric &temperature, const Agenda &opt_prop_gas_agenda, const Agenda &abs_scalar_gas_agenda, const Index f_index, 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
Definition: montecarlo.cc:57
matrix_exp_p30
void matrix_exp_p30(MatrixView M, ConstMatrixView A)
matrix_exp_p30
Definition: montecarlo.cc:517
DEG2RAD
const Numeric DEG2RAD
cum_l_stepCalc
void cum_l_stepCalc(Vector &cum_l_step, const Ppath &ppath)
cum_l_stepCalc
Definition: montecarlo.cc:325
Tensor4
The Tensor4 class.
Definition: matpackIV.h:375
Ppath
The structure to describe a propagation path and releated quantities.
Definition: ppath.h:59
Agenda
The Agenda class.
Definition: agenda_class.h:44
SingleScatteringData
Structure which describes the single scattering properties of a.
Definition: optproperties.h:74
pha_mat_singleExtract
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 rte_temperature, const Index stokes_dim, const Verbosity &verbosity)
Extract the phase matrix from a monochromatic SingleScatteringData object.
Definition: montecarlo.cc:1507
ConstTensor4View
A constant view of a Tensor4.
Definition: matpackIV.h:149
matpackI.h
rng.h
Defines the Rng random number generator class.
Array
This can be used to make arrays out of anything.
Definition: array.h:103
messages.h
Declarations having to do with the four output streams.
is_anyptype30
bool is_anyptype30(const ArrayOfSingleScatteringData &scat_data_mono)
is_anyptype30
Definition: montecarlo.cc:388
VectorView
The VectorView class.
Definition: matpackI.h:373
physics_funcs.h
optproperties.h
Scattering database structure and functions.
findZ11max
void findZ11max(Vector &Z11maxvector, const ArrayOfSingleScatteringData &scat_data_mono)
findZ11max
Definition: montecarlo.cc:351
Numeric
NUMERIC Numeric
The type to use for all floating point numbers.
Definition: matpack.h:33
lin_alg.h
Linear algebra functions.
Verbosity
Definition: messages.h:50
cloud_atm_vars_by_gp
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
Definition: montecarlo.cc:231
mcPathTraceIPA
void mcPathTraceIPA(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, Index &termination_flag, bool &inside_cloud, const Agenda &opt_prop_gas_agenda, const Agenda &abs_scalar_gas_agenda, const Index stokes_dim, const Index f_index, const Vector &p_grid, const Vector &lat_grid, const Vector &lon_grid, const Tensor3 &z_field, const Matrix &r_geoid, const Matrix &z_surface, const Tensor3 &t_field, const Tensor4 &vmr_field, const ArrayOfIndex &cloudbox_limits, const Tensor4 &pnd_field, const ArrayOfSingleScatteringData &scat_data_mono, const Index z_field_is_1D, const Ppath &ppath, const Verbosity &verbosity)
mcPathTraceIPA
Definition: montecarlo.cc:821
ConstMatrixView
A constant view of a Matrix.
Definition: matpackI.h:591
cloudbox.h
Internal cloudbox functions.
cloudy_rt_vars_at_gp
void cloudy_rt_vars_at_gp(Workspace &ws, MatrixView ext_mat_mono, VectorView abs_vec_mono, VectorView pnd_vec, Numeric &temperature, const Agenda &opt_prop_gas_agenda, const Agenda &abs_scalar_gas_agenda, const Index stokes_dim, const Index f_index, 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_mono, const ArrayOfIndex &cloudbox_limits, const Vector &rte_los, const Verbosity &verbosity)
cloudy_rt_vars_at_gp
Definition: montecarlo.cc:129
pha_mat_singleCalc
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_mono, const Index stokes_dim, ConstVectorView pnd_vec, const Numeric rte_temperature, const Verbosity &verbosity)
pha_mat_singleCalc
Definition: montecarlo.cc:1456
GridPos
Structure to store a grid position.
Definition: interpolation.h:74
ppath.h
Propagation path structure and functions.
logic.h
Header file for logic.cc.
rte.h
Declaration of functions in rte.cc.
Rng
Definition: rng.h:569
mcPathTraceGeneral
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 &opt_prop_gas_agenda, const Agenda &abs_scalar_gas_agenda, const Index stokes_dim, const Index f_index, const Vector &p_grid, const Vector &lat_grid, const Vector &lon_grid, const Tensor3 &z_field, const Matrix &r_geoid, const Matrix &z_surface, const Tensor3 &t_field, const Tensor4 &vmr_field, const ArrayOfIndex &cloudbox_limits, const Tensor4 &pnd_field, const ArrayOfSingleScatteringData &scat_data_mono, const Verbosity &verbosity)
mcPathTraceGeneral
Definition: montecarlo.cc:557
Workspace
Workspace class.
Definition: workspace_ng.h:47
ConstTensor3View
A constant view of a Tensor3.
Definition: matpackIII.h:147
special_interp.h
Header file for special_interp.cc.
Index
INDEX Index
The type to use for all integer numbers and indices.
Definition: matpack.h:39
check_input.h
M
#define M
Definition: rng.cc:196
Vector
The Vector class.
Definition: matpackI.h:555
ConstVectorView
A constant view of a Vector.
Definition: matpackI.h:300
arts.h
The global header file for ARTS.
xml_io.h
This file contains basic functions to handle XML data files.