Go to the documentation of this file.
68 const String& pnd_field_file,
73 const Vector& pfr_lat_grid =
75 const Vector& pfr_lon_grid =
82 out3 <<
"Check particle number density file " << pnd_field_file <<
"\n";
85 (pfr_lat_grid.
nelem() != 1 || pfr_lon_grid.
nelem() != 1)) {
87 os <<
"The atmospheric dimension is 1D but the particle "
88 <<
"number density file * " << pnd_field_file
89 <<
" is for a 3D atmosphere. \n";
90 throw runtime_error(os.str());
94 if (pfr_lat_grid.
nelem() == 1 || pfr_lon_grid.
nelem() == 1) {
96 os <<
"The atmospheric dimension is 3D but the particle "
97 <<
"number density file * " << pnd_field_file
98 <<
" is for a 1D or a 2D atmosphere. \n";
99 throw runtime_error(os.str());
103 out3 <<
"Particle number density data is o.k. \n";
117 const String& pnd_field_file,
123 out3 <<
"Element in pnd_field_raw_file:" << i <<
"\n";
154 Index n, p_i, lat_i, lon_i;
158 for (lat_i = 0; lat_i <
pnd_field_raw[n].data.nrows(); lat_i++) {
159 for (lon_i = 0; lon_i <
pnd_field_raw[n].data.ncols(); lon_i++) {
170 os <<
"Found non-zero pnd outside cloudbox. "
173 <<
" Pa, but found pnd=" << v <<
"/m³ at p=" << p
174 <<
" Pa for scattering "
175 <<
"element #" << n <<
".";
176 throw runtime_error(os.str());
184 os <<
"Found non-zero pnd outside cloudbox. "
185 <<
"Cloudbox extends from lat="
188 <<
"°, but found pnd=" << v <<
"/m³ at lat=" <<
lat
189 <<
"° for scattering "
190 <<
"element #" << n <<
".";
191 throw runtime_error(os.str());
200 os <<
"Found non-zero pnd outside cloudbox. "
201 <<
"Cloudbox extends from lon="
204 <<
"°, but found pnd=" << v <<
"/m³ at lon=" <<
lon
205 <<
"° for scattering "
206 <<
"element #" << n <<
".";
207 throw runtime_error(os.str());
238 os <<
"Individual strings in scat_species must contain at least " <<
nelem
240 <<
"but entry #" << k <<
" contains only the following "
241 << strarr.
nelem() <<
":\n"
243 throw runtime_error(os.str());
264 os <<
"The number of elements in in current scat_species' *scat_data* and "
265 <<
"*scat_meta* do not match.\n"
266 <<
"Each *scat_data* entry must correspond to one entry in *scat_meta*.";
267 throw runtime_error(os.str());
282 const String& scat_meta_file,
285 out3 <<
" Check scattering meta data file " << scat_meta_file <<
"\n";
323 os <<
"The first value of the zenith angle grid in the single"
324 <<
" scattering properties data must be 0.";
325 throw runtime_error(os.str());
330 os <<
"The last value of the zenith angle grid in the single"
331 <<
" scattering properties data must be 180.";
332 throw runtime_error(os.str());
338 os <<
"For ptype = \"general\" the first value"
339 <<
" of the azimuth angle grid in the single scattering"
340 <<
" properties data must be -180.";
341 throw runtime_error(os.str());
347 os <<
"For ptype = \"azimuthally_random\""
348 <<
" the first value"
349 <<
" of the azimuth angle grid in the single scattering"
350 <<
" properties data must be 0.";
351 throw runtime_error(os.str());
357 os <<
"For ptypes = \"azimuthally_random\" and \"general\""
358 <<
" the last value of the azimuth angle grid in the single"
359 <<
" scattering properties data must be 180.";
360 throw runtime_error(os.str());
363 ostringstream os_pha_mat;
364 os_pha_mat <<
"pha_mat ";
365 ostringstream os_ext_mat;
366 os_ext_mat <<
"ext_mat ";
367 ostringstream os_abs_vec;
368 os_abs_vec <<
"abs_vec ";
373 out3 <<
" Data is for arbitrarily orientated particles. \n";
404 out3 <<
" Data is for macroscopically isotropic and mirror-symmetric "
405 <<
"scattering media, i.e. for totally randomly oriented particles "
406 <<
"with at least one plane of symmetry. \n";
437 out3 <<
" Data is for azimuthally randomly oriented particles. \n";
476 os <<
"The temperature values in the single scattering data"
477 <<
" are negative or very large. Check whether you use the "
478 <<
"right unit [Kelvin].";
479 throw runtime_error(os.str());
503 const bool& include_boundaries,
507 if (include_boundaries) {
581 const bool include_boundaries)
619 0.5 * (
x[1] +
x[0]));
622 w[nx - 1] =
x[nx - 1] -
x[nx - 2];
624 w[0] = 0.5 * (
x[1] -
x[0]);
625 w[nx - 1] = 0.5 * (
x[nx - 1] -
x[nx - 2]);
627 for (
Index i = 1; i < nx - 1; i++) {
628 w[i] = 0.5 * (
x[i + 1] -
x[i - 1]);
647 const Tensor3& scat_species_field,
656 os <<
"The size of *p_grid* (" <<
p_grid.nelem()
657 <<
") is unequal the number of pages of *" << fieldname <<
"* ("
658 << scat_species_field.
npages() <<
").";
659 throw runtime_error(os.str());
666 os <<
"The size of *lat_grid* (" <<
lat_grid.nelem()
667 <<
") is unequal the number of rows of *" << fieldname <<
"* ("
668 << scat_species_field.
nrows() <<
").";
669 throw runtime_error(os.str());
677 os <<
"The size of *lon_grid* (" <<
lon_grid.nelem()
678 <<
") is unequal the number of columns of *" << fieldname <<
"* ("
679 << scat_species_field.
ncols() <<
").";
680 throw runtime_error(os.str());
686 for (
Index j = 0; j < scat_species_field.
npages(); j++) {
687 for (
Index k = 0; k < scat_species_field.
nrows(); k++) {
688 for (
Index l = 0; l < scat_species_field.
ncols(); l++) {
689 if (scat_species_field(j, k, l) != 0.0 &&
690 !std::isnan(scat_species_field(j, k, l)))
716 const Tensor3& scat_species_field,
718 const Numeric& cloudbox_margin) {
727 if (cloudbox_margin != -1) {
730 for (i = 0; i < lower; i++) {
735 if (ss_prof[i] != 0.0 && !std::isnan(ss_prof[i])) {
751 for (
Index j = scat_species_field.
npages() - 1; j >=
max(i, upper); j--) {
756 if (ss_prof[j] != 0.0 && !std::isnan(ss_prof[j])) {
772 os <<
"Not yet available for 2D and 3D cases.";
773 throw runtime_error(os.str());
856 field_name.
split(strarr, delim);
860 if (strarr.size() > 0 && field_name[0] !=
'-') {
861 species_type = strarr[0];
864 os <<
"No information on field species type found in '" << field_name
866 throw runtime_error(os.str());
888 field_name.
split(strarr, delim);
892 if (strarr.size() > 1) {
893 species_name = strarr[1];
896 os <<
"No information on field species name found in '" << field_name
898 throw runtime_error(os.str());
920 field_name.
split(strarr, delim);
924 if (strarr.size() > 2) {
925 scat_type = strarr[2];
928 os <<
"No information on type of scat_species field found in '"
929 << field_name <<
"'\n";
930 throw runtime_error(os.str());
947 const String& part_string,
952 part_string.
split(strarr, delim);
955 if (strarr.size() > 0 && part_string[0] != delim[0]) {
956 partfield_name = strarr[0];
959 os <<
"No information on scattering species field name in '" << part_string
961 throw runtime_error(os.str());
Index atmosphere_dim(Workspace &ws) noexcept
SingleScatteringData scat_data_single(Workspace &ws) noexcept
Ppath ppath_step(Workspace &ws) noexcept
const Index GFIELD3_P_GRID
ArrayOfArrayOfScatteringMetaData scat_meta(Workspace &ws) noexcept
Numeric lat(Workspace &ws) noexcept
Complex w(Complex z) noexcept
The Faddeeva function.
void chk_scat_data(const SingleScatteringData &scat_data_single, const Verbosity &verbosity)
Check single scattering data.
Vector lat_grid(Workspace &ws) noexcept
ArrayOfGriddedField3 pnd_field_raw(Workspace &ws) noexcept
Numeric last(ConstVectorView x)
last
void parse_atmcompact_scattype(String &scat_type, const String &field_name, const String &delim)
Verbosity verbosity(Workspace &ws) noexcept
void bin_quadweights(Vector &w, const Vector &x, const Index &order)
ArrayOfIndex cloudbox_limits(Workspace &ws) noexcept
bool is_gp_inside_cloudbox(const GridPos &gp_p, const GridPos &gp_lat, const GridPos &gp_lon, const ArrayOfIndex &cloudbox_limits, const bool &include_boundaries, const Index &atmosphere_dim)
Numeric fractional_gp(const GridPos &gp)
fractional_gp
void chk_pnd_field_raw_only_in_cloudbox(const Index &dim, const ArrayOfGriddedField3 &pnd_field_raw, ConstVectorView p_grid, ConstVectorView lat_grid, ConstVectorView lon_grid, const ArrayOfIndex &cloudbox_limits)
chk_pnd_field_raw_only_in_cloudbox
The structure to describe a propagation path and releated quantities.
Numeric lon(Workspace &ws) noexcept
Index npages() const
Returns the number of pages.
void chk_pnd_raw_data(const ArrayOfGriddedField3 &pnd_field_raw, const String &pnd_field_file, const Index &atmosphere_dim, const Verbosity &verbosity)
Check particle number density files (pnd_field_raw)
member functions of the Rng class and gsl_rng code
This can be used to make arrays out of anything.
Index nelem(const Lines &l)
Number of lines.
void parse_partfield_name(String &partfield_name, const String &part_string, const String &delim)
Declarations having to do with the four output streams.
const Index GFIELD3_LON_GRID
Index nelem() const
Returns the number of elements.
bool is_inside_cloudbox(const Ppath &ppath_step, const ArrayOfIndex &cloudbox_limits, const bool include_boundaries)
This file contains declerations of functions of physical character.
Vector p_grid(Workspace &ws) noexcept
NUMERIC Numeric
The type to use for all floating point numbers.
Linear algebra functions.
ScatteringMetaData scat_meta_single(Workspace &ws) noexcept
void chk_scattering_meta_data(const ScatteringMetaData &scat_meta_single, const String &scat_meta_file, const Verbosity &verbosity)
Check scattering data meta.
void find_cloudlimits(Index &lower, Index &upper, const Tensor3 &scat_species_field, const Index &atmosphere_dim, const Numeric &cloudbox_margin)
Adjust uppermost and lowermost cloudy level for one scat_species_*_*_field.
Workspace functions for the solution of cloud-box radiative transfer by Monte Carlo methods....
ArrayOfArrayOfSingleScatteringData scat_data(Workspace &ws) noexcept
Index nrows() const
Returns the number of rows.
Vector lon_grid(Workspace &ws) noexcept
Internal cloudbox functions.
void chk_pnd_data(const GriddedField3 &pnd_field_raw, const String &pnd_field_file, const Index &atmosphere_dim, const Verbosity &verbosity)
Check particle number density files.
void split(Array< my_basic_string< charT > > &aos, const my_basic_string< charT > &delim) const
Split string into substrings.
Structure to store a grid position.
Propagation path structure and functions.
bool is_increasing(ConstVectorView x)
Checks if a vector is sorted and strictly increasing.
Header file for logic.cc.
void chk_scattering_data(const ArrayOfSingleScatteringData &scat_data, const ArrayOfScatteringMetaData &scat_meta, const Verbosity &)
Check scattering data general.
Index ncols() const
Returns the number of columns.
const Index GFIELD3_LAT_GRID
void chk_scat_species_field(bool &empty_flag, const Tensor3 &scat_species_field, const String &fieldname, const Index &dim, const Vector &p_grid, const Vector &lat_grid, const Vector &lon_grid)
Check whether field of a specific scattering species zero everywhere.
Vector x(Workspace &ws) noexcept
void parse_atmcompact_speciesname(String &species_name, const String &field_name, const String &delim)
INDEX Index
The type to use for all integer numbers and indices.
void chk_scat_species(const ArrayOfString &scat_species, const String &delim)
Check validity of scat_species setting.
ArrayOfString scat_species(Workspace &ws) noexcept
void parse_atmcompact_speciestype(String &species_type, const String &field_name, const String &delim)
A constant view of a Vector.
Contains sorting routines.
Index nelem() const
Number of elements.
The global header file for ARTS.