ARTS 2.5.11 (git: 725533f0)
psd.h
Go to the documentation of this file.
1
9#ifndef psd_h
10#define psd_h
11
12#include "array.h"
13#include "gridded_fields.h"
14#include "interpolation.h"
15#include "matpack_data.h"
16#include "messages.h"
17#include "optproperties.h"
18#include "ppath.h"
19
20// ------------------------------------------------------
21// Macros to avoid duplication of code
22// ------------------------------------------------------
23
24#define START_OF_PSD_METHODS() \
25 const Index nin = pnd_agenda_input_names.nelem(); \
26 const Index ndx = dpnd_data_dx_names.nelem(); \
27 const Index np = pnd_agenda_input.nrows(); \
28 const Index nsi = psd_size_grid.nelem(); \
29 ArrayOfIndex dx2in(ndx); \
30 \
31 if (pnd_agenda_input.ncols() != nin) \
32 throw runtime_error( \
33 "Length of *pnd_agenda_input_names* and number of " \
34 "columns in *pnd_agenda_input* must be equal."); \
35 if (ndx) { \
36 if (ndx > nin) \
37 throw runtime_error( \
38 "The length of *dpnd_data_dx_names* can not " \
39 "exceed the one of *pnd_agenda_input_names*."); \
40 for (Index i = 0; i < ndx; i++) { \
41 dx2in[i] = find_first(pnd_agenda_input_names, dpnd_data_dx_names[i]); \
42 if (dx2in[i] < 0) { \
43 ostringstream os; \
44 os << "dpnd_data_dx_names[" << i << "] is " << dpnd_data_dx_names[i] \
45 << "\nThis string could not be found in *pnd_agenda_input_names*."; \
46 throw std::runtime_error(os.str()); \
47 } \
48 } \
49 } \
50 \
51 psd_data.resize(np, nsi); \
52 psd_data = 0.0; \
53 if (ndx) { \
54 dpsd_data_dx.resize(ndx, np, nsi); \
55 dpsd_data_dx = 0.0; \
56 } else { \
57 dpsd_data_dx.resize(0, 0, 0); \
58 }
59
77void psd_cloudice_MH97(Vector& psd,
78 const Vector& diameter,
79 const Numeric& iwc,
80 const Numeric& t,
81 const bool noisy);
82
109void psd_mgd_mass_and_something(Matrix& psd_data,
110 Tensor3& dpsd_data_dx,
111 const String& something,
112 const Vector& psd_size_grid,
113 const Vector& pnd_agenda_input_t,
114 const Matrix& pnd_agenda_input,
115 const ArrayOfString& pnd_agenda_input_names,
116 const ArrayOfString& dpnd_data_dx_names,
117 const Numeric& scat_species_a,
118 const Numeric& scat_species_b,
119 const Numeric& n0,
120 const Numeric& mu,
121 const Numeric& la,
122 const Numeric& ga,
123 const Numeric& t_min,
124 const Numeric& t_max,
125 const Index& picky,
126 const Verbosity&);
127
145void psd_mono_common(Matrix& psd_data,
146 Tensor3& dpsd_data_dx,
147 const String& type,
148 const Vector& pnd_agenda_input_t,
149 const Matrix& pnd_agenda_input,
150 const ArrayOfString& pnd_agenda_input_names,
151 const ArrayOfString& dpnd_data_dx_names,
152 const ArrayOfArrayOfScatteringMetaData& scat_meta,
153 const Index& species_index,
154 const Numeric& t_min,
155 const Numeric& t_max,
156 const Index& picky,
157 const Verbosity&);
158
178void psd_rain_W16(Vector& psd, const Vector& diameter, const Numeric& rwc);
179
204void psd_mgd_smm_common(Matrix& psd_data,
205 Tensor3& dpsd_data_dx,
206 const String& psd_name,
207 const Vector& psd_size_grid,
208 const Vector& pnd_agenda_input_t,
209 const Matrix& pnd_agenda_input,
210 const ArrayOfString& pnd_agenda_input_names,
211 const ArrayOfString& dpnd_data_dx_names,
212 const Numeric& scat_species_a,
213 const Numeric& scat_species_b,
214 const Numeric& n_alpha_in,
215 const Numeric& n_b_in,
216 const Numeric& mu_in,
217 const Numeric& gamma_in,
218 const Numeric& t_min,
219 const Numeric& t_max,
220 const Index& picky,
221 const Verbosity&);
222
245void psd_snow_F07(Vector& psd,
246 const Vector& diameter,
247 const Numeric& swc,
248 const Numeric& t,
249 const Numeric alpha,
250 const Numeric beta,
251 const String& regime);
252
268void psd_SB06(Vector& psd,
269 Matrix& dpsd,
270 const Vector& mass,
271 const Numeric& N_tot,
272 const Numeric& WC,
273 const String& hydrometeor_type);
274
290void psd_MY05(Vector& psd,
291 Matrix& dpsd,
292 const Vector& diameter_max,
293 const Numeric N_tot,
294 const Numeric WC,
295 const String psd_type);
296
310Numeric dm_from_iwc_n0(Numeric iwc, Numeric n0, Numeric rho);
311
325Numeric n0_from_iwc_dm(Numeric iwc, Numeric dm, Numeric rho);
326
342Numeric n0_from_t(Numeric t);
343
344
345#endif //psd_h
This file contains the definition of Array.
Implementation of gridded fields.
Header file for interpolation.cc.
Declarations having to do with the four output streams.
Scattering database structure and functions.
Propagation path structure and functions.
void psd_rain_W16(Vector &psd, const Vector &diameter, const Numeric &rwc)
The Wang16 rain DSD DEPRECATED BY NEW MGD_SMM_COMMON Only included for compatibility with "old" pnd_f...
Definition psd.cc:684
void psd_snow_F07(Vector &psd, const Vector &diameter, const Numeric &swc, const Numeric &t, const Numeric alpha, const Numeric beta, const String &regime)
The F07 snow PSD.
Definition psd.cc:871
void psd_MY05(Vector &psd, Matrix &dpsd, const Vector &diameter_max, const Numeric N_tot, const Numeric WC, const String psd_type)
Definition psd.cc:1103
void psd_mgd_mass_and_something(Matrix &psd_data, Tensor3 &dpsd_data_dx, const String &something, const Vector &psd_size_grid, const Vector &pnd_agenda_input_t, const Matrix &pnd_agenda_input, const ArrayOfString &pnd_agenda_input_names, const ArrayOfString &dpnd_data_dx_names, const Numeric &scat_species_a, const Numeric &scat_species_b, const Numeric &n0, const Numeric &mu, const Numeric &la, const Numeric &ga, const Numeric &t_min, const Numeric &t_max, const Index &picky, const Verbosity &)
Code common to MGD PSD involving the integrated mass.
Definition psd.cc:173
Numeric n0_from_t(Numeric t)
Sets N0star based on temperature.
Definition psd.cc:1242
void psd_cloudice_MH97(Vector &psd, const Vector &diameter, const Numeric &iwc, const Numeric &t, const bool noisy)
The MH97 cloud ice PSD.
Definition psd.cc:39
void psd_mono_common(Matrix &psd_data, Tensor3 &dpsd_data_dx, const String &type, const Vector &pnd_agenda_input_t, const Matrix &pnd_agenda_input, const ArrayOfString &pnd_agenda_input_names, const ArrayOfString &dpnd_data_dx_names, const ArrayOfArrayOfScatteringMetaData &scat_meta, const Index &species_index, const Numeric &t_min, const Numeric &t_max, const Index &picky, const Verbosity &)
Code common to PSDs of mono type.
Definition psd.cc:592
Numeric n0_from_iwc_dm(Numeric iwc, Numeric dm, Numeric rho)
Derives N0star from IWC and Dm.
Definition psd.cc:1234
Numeric dm_from_iwc_n0(Numeric iwc, Numeric n0, Numeric rho)
Derives Dm from IWC and N0star.
Definition psd.cc:1226
void psd_SB06(Vector &psd, Matrix &dpsd, const Vector &mass, const Numeric &N_tot, const Numeric &WC, const String &hydrometeor_type)
Definition psd.cc:962
void psd_mgd_smm_common(Matrix &psd_data, Tensor3 &dpsd_data_dx, const String &psd_name, const Vector &psd_size_grid, const Vector &pnd_agenda_input_t, const Matrix &pnd_agenda_input, const ArrayOfString &pnd_agenda_input_names, const ArrayOfString &dpnd_data_dx_names, const Numeric &scat_species_a, const Numeric &scat_species_b, const Numeric &n_alpha_in, const Numeric &n_b_in, const Numeric &mu_in, const Numeric &gamma_in, const Numeric &t_min, const Numeric &t_max, const Index &picky, const Verbosity &)
Code common to a number of modified gamma PSDs used with single-moment mass schemes.
Definition psd.cc:712