Go to the documentation of this file.
75 const Index& N_za_grid,
76 const Index& N_aa_grid,
77 const String& za_grid_opt_file,
83 else if (N_aa_grid < 1) {
85 os <<
"N_aa_grid must be > 0 (even for 1D / DISORT cases).";
86 throw runtime_error(os.str());
96 os <<
"N_za_grid must be >= 0.";
97 throw runtime_error(os.str());
101 if (za_grid_opt_file ==
"")
104 else if (N_za_grid == 1) {
106 os <<
"N_za_grid must be >1 or =0 (the latter only allowed for RT4).";
107 throw runtime_error(os.str());
123 const Index& max_iterations,
124 const Index& throw_nonconv_error,
132 "Convergence flag is non-zero, which means that this\n"
133 "WSM is not used correctly. *doit_conv_flagAbs* should\n"
134 "be used only in *doit_conv_test_agenda*\n");
146 "You have to specify limiting values for the "
147 "convergence test for each Stokes component "
148 "separately. That means that *epsilon* must "
149 "have *stokes_dim* elements!");
155 "The fields (Tensor6) *cloudbox_field* and \n"
156 "*cloudbox_field_old* which are compared in the \n"
157 "convergence test do not have the same size.\n");
166 out <<
"Method does not converge (number of iterations \n"
167 <<
"is > " << max_iterations <<
"). Either the cloud "
168 <<
"particle number density \n"
169 <<
"is too large or the numerical setup for the DOIT \n"
170 <<
"calculation is not correct. In case of limb \n"
171 <<
"simulations please make sure that you use an \n"
172 <<
"optimized zenith angle grid. \n"
173 <<
"*cloudbox_field* might be wrong.\n";
174 if (throw_nonconv_error != 0) {
180 out1 <<
"Warning in DOIT calculation (output set to NaN):\n" << out.str();
184 out1 <<
"Warning in DOIT calculation (output equals current status):\n"
189 for (
Index p_index = 0; p_index < N_p; p_index++) {
190 for (
Index lat_index = 0; lat_index < N_lat; lat_index++) {
191 for (
Index lon_index = 0; lon_index < N_lon; lon_index++) {
213 if (
abs(diff) > epsilon[stokes_index]) {
214 out1 <<
"difference: " << diff <<
"\n";
241 const Index& max_iterations,
242 const Index& throw_nonconv_error,
251 "Convergence flag is non-zero, which means that this \n"
252 "WSM is not used correctly. *doit_conv_flagAbs* should\n"
253 "be used only in *doit_conv_test_agenda*\n");
265 "You have to specify limiting values for the "
266 "convergence test for each Stokes component "
267 "separately. That means that *epsilon* must "
268 "have *stokes_dim* elements!");
274 "The fields (Tensor6) *cloudbox_field* and \n"
275 "*cloudbox_field_old* which are compared in the \n"
276 "convergence test do not have the same size.\n");
280 if (
f_grid.empty())
throw runtime_error(
"The frequency grid is empty.");
286 "*f_index* is greater than number of elements in the\n"
287 "frequency grid.\n");
298 <<
"method does not converge (number of iterations \n"
299 <<
"is > " << max_iterations <<
"). Either the particle"
300 <<
" number density \n"
301 <<
"is too large or the numerical setup for the DOIT \n"
302 <<
"calculation is not correct. In case of limb \n"
303 <<
"simulations please make sure that you use an \n"
304 <<
"optimized zenith angle grid. \n"
305 <<
"*cloudbox_field* might be wrong.\n";
306 if (throw_nonconv_error != 0) {
312 out1 <<
"Warning in DOIT calculation (output set to NaN):\n" << out.str();
316 out1 <<
"Warning in DOIT calculation (output equals current status):\n"
321 for (
Index p_index = 0; p_index < N_p; p_index++) {
322 for (
Index lat_index = 0; lat_index < N_lat; lat_index++) {
323 for (
Index lon_index = 0; lon_index < N_lon; lon_index++) {
347 if (
abs(diff_bt) > epsilon[stokes_index]) {
348 out1 <<
"BT difference: " << diff_bt <<
" in stokes dim "
349 << stokes_index <<
"\n";
380 const Index& max_iterations,
381 const Index& throw_nonconv_error,
390 "Convergence flag is non-zero, which means that this \n"
391 "WSM is not used correctly. *doit_conv_flagAbs* should\n"
392 "be used only in *doit_conv_test_agenda*\n");
404 "You have to specify limiting values for the "
405 "convergence test for each Stokes component "
406 "separately. That means that *epsilon* must "
407 "have *stokes_dim* elements!");
413 "The fields (Tensor6) *cloudbox_field* and \n"
414 "*cloudbox_field_old* which are compared in the \n"
415 "convergence test do not have the same size.\n");
419 if (
f_grid.empty())
throw runtime_error(
"The frequency grid is empty.");
425 "*f_index* is greater than number of elements in the\n"
426 "frequency grid.\n");
435 out <<
"Method does not converge (number of iterations \n"
436 <<
"is > " << max_iterations <<
"). Either the"
437 <<
" particle number density \n"
438 <<
"is too large or the numerical setup for the DOIT \n"
439 <<
"calculation is not correct. In case of limb \n"
440 <<
"simulations please make sure that you use an \n"
441 <<
"optimized zenith angle grid. \n";
442 if (throw_nonconv_error != 0) {
448 out1 <<
"Warning in DOIT calculation (output set to NaN):\n" << out.str();
452 out1 <<
"Warning in DOIT calculation (output equals current status):\n"
462 for (
Index p_index = 0; p_index < N_p; p_index++) {
463 for (
Index lat_index = 0; lat_index < N_lat; lat_index++) {
464 for (
Index lon_index = 0; lon_index < N_lon; lon_index++) {
483 lqs[i] =
sqrt(lqs[i]);
484 lqs[i] /= (
Numeric)(N_p * N_lat * N_lon * N_za * N_aa);
492 out1 <<
"lqs [I]: " << lqs[0] <<
"\n";
505 const Index& accelerated,
523 throw std::runtime_error(
524 "*cloudbox_field_mono* contains at least one NaN value.\n"
525 "This indicates an improper initialization of *cloudbox_field*.");
532 Tensor6 cloudbox_field_mono_old_local;
533 Index doit_conv_flag_local;
534 Index doit_iteration_counter_local;
546 doit_conv_flag_local = 0;
547 doit_iteration_counter_local = 0;
551 acceleration_input.resize(4);
553 while (doit_conv_flag_local == 0) {
560 out2 <<
" Execute doit_scat_field_agenda. \n";
565 out2 <<
" Execute doit_rte_agenda. \n";
571 doit_conv_flag_local,
572 doit_iteration_counter_local,
574 cloudbox_field_mono_old_local,
578 if (accelerated > 0 && doit_conv_flag_local == 0) {
579 acceleration_input[(doit_iteration_counter_local - 1) % 4] =
582 if (doit_iteration_counter_local % 4 == 0) {
623 <<
" cloudbox_fieldUpdate1D: Radiative transfer calculation in cloudbox\n";
624 out2 <<
" ------------------------------------------------------------- \n";
634 "The cloudbox dimension is not 1D! \n"
635 "Do you really want to do a 1D calculation? \n"
636 "If not, use *cloudbox_fieldUpdateSeq3D*.\n");
642 throw runtime_error(
"The range of *za_grid* must [0 180].");
645 throw runtime_error(
"The length of *p_grid* must be >= 2.");
653 if (
f_grid.empty())
throw runtime_error(
"The frequency grid is empty.");
659 "*f_index* is greater than number of elements in the\n"
660 "frequency grid.\n");
664 "Interpolation method is not defined. Use \n"
665 "*doit_za_interpSet*.\n");
694 out3 <<
"Calculate optical properties of individual scattering elements\n";
716 Index aa_index_local = 0;
719 for (
Index za_index_local = 0; za_index_local < N_scat_za; za_index_local++) {
740 if ((p_index != 0) || (
za_grid[za_index_local] <= 90.)) {
799 const Index& normalize,
800 const Numeric& norm_error_threshold,
801 const Index& norm_debug,
807 <<
" cloudbox_fieldUpdateSeq1D: Radiative transfer calculation in cloudbox\n";
808 out2 <<
" ------------------------------------------------------------- \n";
819 "The cloudbox dimension is not 1D! \n"
820 "Do you really want to do a 1D calculation? \n"
821 "For 3D use *cloudbox_fieldUpdateSeq3D*.\n");
827 throw runtime_error(
"The range of *za_grid* must [0 180].");
830 throw runtime_error(
"The length of *p_grid* must be >= 2.");
838 if (
f_grid.empty())
throw runtime_error(
"The frequency grid is empty.");
844 "*f_index* is greater than number of elements in the\n"
845 "frequency grid.\n");
849 "Interpolation method is not defined. Use \n"
850 "*doit_za_interpSet*.\n");
879 out3 <<
"Calculate optical properties of individual scattering elements\n";
912 Matrix cloudbox_field_limb;
915 Index aa_index_local = 0;
929 norm_error_threshold,
935 for (
Index za_index_local = 0; za_index_local < N_scat_za; za_index_local++) {
955 if (
za_grid[za_index_local] <= 90.) {
988 }
else if (
za_grid[za_index_local] >= theta_lim) {
1029 bool conv_flag =
false;
1031 while (!conv_flag && limb_it < 10) {
1033 cloudbox_field_limb =
1069 for (
Index p_index = 0;
1075 p_index, 0, 0, za_index_local, 0, stokes_index) -
1076 cloudbox_field_limb(p_index, stokes_index);
1082 if (
abs(diff_bt) > epsilon[stokes_index]) {
1083 out2 <<
"Limb BT difference: " << diff_bt <<
" in stokes dim "
1084 << stokes_index <<
"\n";
1090 out2 <<
"Limb iterations: " << limb_it <<
"\n";
1130 <<
" cloudbox_fieldUpdateSeq3D: Radiative transfer calculatiuon in cloudbox.\n";
1131 out2 <<
" ------------------------------------------------------------- \n";
1141 throw runtime_error(
1142 "The cloudbox dimension is not 3D! \n"
1143 "Do you really want to do a 3D calculation? \n"
1144 "For 1D use *cloudbox_fieldUpdateSeq1D*.\n");
1150 throw runtime_error(
"The range of *za_grid* must [0 180].");
1156 throw runtime_error(
"The range of *za_grid* must [0 360].");
1169 if (
f_grid.empty())
throw runtime_error(
"The frequency grid is empty.");
1174 throw runtime_error(
1175 "*f_index* is greater than number of elements in the\n"
1176 "frequency grid.\n");
1179 throw runtime_error(
1180 "Interpolation method is not defined. Use \n"
1181 "*doit_za_interpSet*.\n");
1210 out3 <<
"Calculate optical properties of individual scattering elements\n";
1229 Tensor5 ext_mat_field(p_up - p_low + 1,
1230 lat_up - lat_low + 1,
1231 lon_up - lon_low + 1,
1235 Tensor4 abs_vec_field(p_up - p_low + 1,
1236 lat_up - lat_low + 1,
1237 lon_up - lon_low + 1,
1277 for (
Index p_index = p_up - 1; p_index >= p_low; p_index--) {
1278 for (
Index lat_index = lat_low; lat_index <= lat_up; lat_index++) {
1279 for (
Index lon_index = lon_low; lon_index <= lon_up; lon_index++) {
1316 for (
Index p_index = p_low + 1; p_index <= p_up; p_index++) {
1317 for (
Index lat_index = lat_low; lat_index <= lat_up; lat_index++) {
1318 for (
Index lon_index = lon_low; lon_index <= lon_up; lon_index++) {
1360 for (
Index p_index = p_low; p_index <= p_up; p_index++) {
1366 for (
Index lat_index = lat_low; lat_index <= lat_up; lat_index++) {
1367 for (
Index lon_index = lon_low; lon_index <= lon_up;
1438 <<
" cloudbox_fieldUpdateSeq1DPP: Radiative transfer calculation in cloudbox.\n";
1440 <<
" --------------------------------------------------------------------- \n";
1447 if (stokes_dim < 0 || stokes_dim > 4)
1448 throw runtime_error(
1449 "The dimension of stokes vector must be"
1479 out3 <<
"Calculate optical properties of individual scattering elements\n";
1599 out0 <<
" Cloudbox is off, DOIT calculation will be skipped.\n";
1607 if (stokes_dim < 0 || stokes_dim > 4)
1608 throw runtime_error(
1609 "The dimension of stokes vector must be"
1621 throw runtime_error(
1622 "For accurate results, za_grid must have "
1623 "more than 15 elements.");
1624 else if (N_scat_za > 100) {
1626 out1 <<
"Warning: za_grid is very large, which means that the \n"
1627 <<
"calculation will be very slow.\n";
1631 throw runtime_error(
"The range of *za_grid* must [0 180].");
1634 throw runtime_error(
"*za_grid* must be increasing.");
1640 throw runtime_error(
1641 "For accurate results, aa_grid must have "
1642 "more than 5 elements.");
1643 else if (N_scat_aa > 100) {
1645 out1 <<
"Warning: aa_grid is very large which means that the \n"
1646 <<
"calculation will be very slow.\n";
1650 throw runtime_error(
"The range of *aa_grid* must [0 360].");
1653 throw runtime_error(
1654 "*doit_za_grid_size* must be greater than 15 for accurate results");
1657 out1 <<
"Warning: doit_za_grid_size is very large which means that the \n"
1658 <<
"calculation will be very slow.\n";
1662 throw runtime_error(
1663 "*cloudbox_limits* is a vector which contains the"
1664 "upper and lower limit of the cloud for all "
1665 "atmospheric dimensions. So its dimension must"
1666 "be 2 x *atmosphere_dim*");
1684 cloudbox_field.resize(Nf, Np_cloud, Nlat_cloud, Nlon_cloud, Nza, Naa, Ns);
1685 doit_scat_field.resize(Np_cloud, Nlat_cloud, Nlon_cloud, Nza, Naa, Ns);
1687 throw runtime_error(
1688 "Scattering calculations are not possible for a 2D"
1689 "atmosphere. If you want to do scattering calculations"
1690 "*atmosphere_dim* has to be either 1 or 3");
1705 Tensor6 cloudbox_field_mono_opt(
1714 os <<
"There is a problem with the pressure grid interpolation";
1723 interp(cloudbox_field_mono_opt(
joker, 0, 0, i, 0, 0),
1750 const Index& cloudbox_size_max,
1756 throw runtime_error(
1757 " This method currently only works for unpolarized radiation "
1758 "( stokes_dim = 1)");
1763 throw runtime_error(
1764 " ScatSpeciesMerge has to be applied in order to use this method");
1766 bool was_too_much =
false;
1767 Numeric tau_scat_max_internal = tau_scat_max;
1770 vector<Numeric> z_grid_new;
1775 z_grid_new.reserve(1000);
1777 z_grid_new.push_back(
z_field(i, 0, 0));
1783 const Vector rtp_mag_dummy(3, 0);
1784 const Vector ppath_los_dummy;
1791 Index scat_data_insert_offset = 0;
1799 scat_data_local[cloudbox_index].ext_mat_data(0, 0, 0, 0, 0);
1801 scat_data_local[cloudbox_index].abs_vec_data(0, 0, 0, 0, 0);
1802 scat_vec[cloudbox_index] =
1806 cur_propmat_clearsky,
1809 partial_source_dummy,
1820 for (
auto& pm : cur_propmat_clearsky) {
1821 abs_coeff += pm.Kjj()[0];
1823 abs_coeff /= (
Numeric)cur_propmat_clearsky.nelem();
1824 single_scattering_albedo[cloudbox_index] =
1825 scat_vec[cloudbox_index] / (
ext_mat[cloudbox_index] + abs_coeff);
1831 scat_data_insert_offset = 0;
1834 const Numeric sgl_alb = (single_scattering_albedo[cloudbox_index] +
1835 single_scattering_albedo[cloudbox_index + 1]) /
1839 ((scat_vec[cloudbox_index] + scat_vec[cloudbox_index + 1]) / 2);
1840 if (scat_opt_thk > tau_scat_max_internal && sgl_alb > sgl_alb_max) {
1841 Index factor = (
Index)ceil(scat_opt_thk / tau_scat_max_internal);
1842 for (
Index j = 1; j < factor; j++) {
1843 scat_data_insert_offset++;
1849 cloudbox_size_max) {
1850 tau_scat_max_internal += 0.01;
1851 was_too_much =
true;
1856 scat_data_insert_offset = 0;
1860 <<
"Warning: Pressure grid optimization with the thresholds tau_scat_max = "
1861 << tau_scat_max <<
" and sgl_slb_max = " << sgl_alb_max
1862 <<
" has lead to an enhancement larger than the value of"
1863 <<
" cloudbox_size_max = " << cloudbox_size_max
1864 <<
". This is why I changed tau_scat_max to " << tau_scat_max_internal
1865 <<
". This may lead to errors of a too coarse grid! \n";
1873 const Numeric sgl_alb = (single_scattering_albedo[cloudbox_index] +
1874 single_scattering_albedo[cloudbox_index + 1]) /
1878 ((scat_vec[cloudbox_index] + scat_vec[cloudbox_index + 1]) / 2);
1879 z_grid_new.push_back(
z_field(k, 0, 0));
1881 if (scat_opt_thk > tau_scat_max_internal && sgl_alb > sgl_alb_max) {
1882 Index factor = (
Index)ceil(scat_opt_thk / tau_scat_max_internal);
1886 scat_data_local[cloudbox_index + scat_data_insert_offset + 1];
1888 scat_data_local[cloudbox_index + scat_data_insert_offset];
1890 for (
Index j = 1; j < factor; j++) {
1899 weightednextLayerPhamat *= weight;
1900 weightednextLayerExtmat *= weight;
1901 weightednextLayerAbsvec *= weight;
1912 scat_data_local.insert(scat_data_local.begin() + cloudbox_index +
1913 scat_data_insert_offset + 1,
1914 std::move(newLayer));
1916 scat_data_insert_offset++;
1922 cloudbox_limits_opt[1] = scat_data_insert_offset +
cloudbox_limits[1];
1923 const Index cloudbox_opt_size =
1924 cloudbox_limits_opt[1] - cloudbox_limits_opt[0] + 1;
1927 <<
" new: " << cloudbox_opt_size <<
" Factor: "
1928 << (
Numeric)cloudbox_opt_size /
1933 z_grid_new.push_back(
z_field(i, 0, 0));
1935 Vector z_grid(z_grid_new.size());
1936 for (
Index i = 0; i < z_grid.
nelem(); i++) z_grid[i] = z_grid_new[i];
1945 Tensor6 cloudbox_field_mono_opt(
1947 Tensor7 pha_mat_doit_opt(cloudbox_opt_size,
1958 <<
" there was an error while interpolating the fields to the new z_field";
1969 for (
Index k = cloudbox_limits_opt[0]; k < cloudbox_limits_opt[1]; k++) {
1971 scat_data_local[i].T_grid = t_field_new(i, 0, 0);
1988 Range r2 =
Range(cloudbox_limits_opt[0], cloudbox_opt_size);
1995 z_grid[
Range(cloudbox_limits_opt[0], cloudbox_opt_size)]);
1999 interp(cloudbox_field_mono_opt(
joker, 0, 0, i, 0, 0),
2016 pnd_field.resize(cloudbox_opt_size, cloudbox_opt_size, 1, 1);
2018 for (
Index i = 0; i < cloudbox_opt_size; i++)
pnd_field(i, i, 0, 0) = 1.;
2040 if (!frequencies.
nelem() || !iterations.
nelem())
return;
2049 if (frequencies[0] == -1 && iterations[0] == -1) {
2054 for (
Index j = 0; j < frequencies.
nelem(); j++) {
2055 if (
f_index == frequencies[j] || (!j && frequencies[j] == -1)) {
2057 if (iterations[0] == -1) {
2067 for (
Index i = 0; i < iterations.
nelem(); i++) {
2110 throw runtime_error(
"The range of *za_grid* must [0 180].");
2116 throw runtime_error(
"The range of *aa_grid* must [0 360].");
2162 os <<
"The atmospheric dimension must be 1D or 3D \n"
2163 <<
"for scattering calculations using the DOIT\n"
2164 <<
"module, but it is not. The value of *atmosphere_dim*\n"
2166 throw runtime_error(os.str());
2170 throw runtime_error(
2171 "*cloudbox_limits* is a vector which contains the"
2172 "upper and lower limit of the cloud for all "
2173 "atmospheric dimensions. So its dimension must"
2174 "be 2 x *atmosphere_dim*");
2179 throw runtime_error(
2180 "The zenith angle grids for the computation of\n"
2181 "the scattering integral and the RT part must \n"
2182 "be equal. Check definitions in \n"
2183 "*DOAngularGridsSet*. The keyword \n"
2184 "'za_grid_opt_file' should be empty. \n");
2203 grid_stepsize[1] = 360. / (
Numeric)(Naa - 1);
2208 out2 <<
" Calculate the scattered field\n";
2216 for (
Index za_index_local = 0; za_index_local < Nza; za_index_local++) {
2218 out3 <<
"Multiplication of phase matrix with incoming"
2219 <<
" intensities \n";
2225 for (
Index za_in = 0; za_in < Nza; ++za_in) {
2226 for (
Index aa_in = 0; aa_in < Naa; ++aa_in) {
2232 product_field(za_in, aa_in, i) +=
2234 p_index, za_index_local, 0, za_in, aa_in, i, j) *
2270 for (
Index lat_index = 0;
2273 for (
Index lon_index = 0;
2276 Numeric rtp_temperature_local =
2281 for (
Index aa_index_local = 1; aa_index_local < Naa;
2283 for (
Index za_index_local = 0; za_index_local < Nza;
2285 out3 <<
"Calculate phase matrix \n";
2293 rtp_temperature_local,
2309 for (
Index za_in = 0; za_in < Nza; ++za_in) {
2310 for (
Index aa_in = 0; aa_in < Naa; ++aa_in) {
2315 product_field(za_in, aa_in, i) +=
2316 pha_mat_local(za_in, aa_in, i, j) *
2383 throw runtime_error(
"The range of *za_grid* must [0 180].");
2389 throw runtime_error(
"The range of *aa_grid* must [0 360].");
2435 os <<
"The atmospheric dimension must be 1D or 3D \n"
2436 <<
"for scattering calculations using the DOIT\n"
2437 <<
"module, but it is not. The value of *atmosphere_dim*\n"
2439 throw runtime_error(os.str());
2443 throw runtime_error(
2444 "Interpolation method is not defined. Use \n"
2445 "*doit_za_interpSet*.\n");
2448 throw runtime_error(
2449 "*cloudbox_limits* is a vector which contains the"
2450 "upper and lower limit of the cloud for all "
2451 "atmospheric dimensions. So its dimension must"
2452 "be 2 x *atmosphere_dim*");
2455 throw runtime_error(
2456 "*doit_za_grid_size* must be greater than 15 for"
2457 "accurate results");
2460 out1 <<
"Warning: doit_za_grid_size is very large which means that the \n"
2461 <<
"calculation will be very slow. The recommended value is 19.\n";
2508 grid_stepsize[1] = 360. / (
Numeric)(Naa - 1);
2527 for (
Index za = 0; za < za_g.
nelem(); za++) {
2528 cloudbox_field_int(za, i) =
2543 out3 <<
"Multiplication of phase matrix with incoming"
2544 <<
" intensities \n";
2551 for (
Index aa_in = 0; aa_in < Naa; ++aa_in) {
2557 product_field(za_in, aa_in, i) +=
2559 p_index, za_index_local, 0, za_in, aa_in, i, j) *
2560 cloudbox_field_int(za_in, j);
2567 out3 <<
"Compute integral. \n";
2570 doit_scat_field_org(za_index_local, i) =
2576 doit_scat_field_org(za_index_local, i) =
2593 doit_scat_field_org(
joker, i),
2599 za_g, doit_scat_field_org(
joker, i),
za_grid[za], gp_za[za]);
2611 for (
Index lat_index = 0;
2614 for (
Index lon_index = 0;
2617 Numeric rtp_temperature_local =
2623 for (
Index aa_index_local = 1; aa_index_local < Naa;
2628 cloudbox_field_int(
joker, i),
2631 p_index, lat_index, lon_index,
joker, aa_index_local, i),
2637 out3 <<
"Calculate phase matrix \n";
2645 rtp_temperature_local,
2661 out3 <<
"Multiplication of phase matrix with"
2662 <<
"incoming intensity \n";
2665 for (
Index aa_in = 0; aa_in < Naa; ++aa_in) {
2670 product_field(za_in, aa_in, i) +=
2671 pha_mat_local(za_in, aa_in, i, j) *
2672 cloudbox_field_int(za_in, j);
2678 out3 <<
"Compute the integral \n";
2681 doit_scat_field_org(za_index_local, i) =
2693 p_index, lat_index, lon_index,
joker, aa_index_local, i),
2695 doit_scat_field_org(
joker, i),
2705 out2 <<
" Finished scattered field.\n";
2734 throw runtime_error(
2735 "The last dimension of *cloudbox_field* corresponds\n"
2736 "to the Stokes dimension, therefore the number of\n"
2737 "columns in *cloudbox_field* must be a number between\n"
2738 "1 and 4, but it is not!");
2741 throw runtime_error(
2742 "Interpolation method is not defined. Use \n"
2743 "*doit_za_interpSet*.\n");
2746 out1 <<
"Warning: The fine grid (*za_grid*) has less than\n"
2747 <<
"500 grid points which is likely not sufficient for\n"
2748 <<
"grid_optimization\n";
2757 Matrix cloudbox_field_opt_mat;
2758 cloudbox_field_opt_mat = 0.;
2762 cloudbox_field_opt_mat,
2778 throw runtime_error(
2779 "Polynomial interpolation is only implemented for\n"
2780 "1D DOIT calculations as \n"
2781 "in 3D there can be numerical problems.\n"
2782 "Please use 'linear' interpolation method.");
2784 if (method ==
"linear")
2786 else if (method ==
"polynomial")
2789 throw runtime_error(
2790 "Possible interpolation methods are 'linear' "
2791 "and 'polynomial'.\n");
2812 out0 <<
" Cloudbox is off, DOIT calculation will be skipped.\n";
2821 throw runtime_error(
2822 "The atmospheric fields must be flagged to have "
2823 "passed a consistency check (atmfields_checked=1).");
2825 throw runtime_error(
2826 "The atmospheric geometry must be flagged to have "
2827 "passed a consistency check (atmgeom_checked=1).");
2829 throw runtime_error(
2830 "The cloudbox must be flagged to have "
2831 "passed a consistency check (cloudbox_checked=1).");
2837 throw runtime_error(
2838 "The scattering data must be flagged to have "
2839 "passed a consistency check (scat_data_checked=1).");
2845 if (
f_grid.empty())
throw runtime_error(
"The frequency grid is empty.");
2851 os <<
"Initialization method *DoitInit* has to be called before "
2853 throw runtime_error(os.str());
2868 bool failed =
false;
2870 #pragma omp parallel for if (!arts_omp_in_parallel() && nf > 1) \
2871 firstprivate(l_ws, l_doit_mono_agenda)
2883 Tensor6 cloudbox_field_mono_local =
2886 cloudbox_field_mono_local,
2889 l_doit_mono_agenda);
2891 cloudbox_field_mono_local;
2892 }
catch (
const std::exception& e) {
2898 #pragma omp critical(DoitCalc_fail)
2901 fail_msg = os.str();
2907 if (failed)
throw runtime_error(fail_msg);
2930 const Index& rigorous,
2935 throw runtime_error(
2936 "The atmospheric fields must be flagged to have "
2937 "passed a consistency check (atmfields_checked=1).");
2939 throw runtime_error(
2940 "The atmospheric geometry must be flagged to have "
2941 "passed a consistency check (atmgeom_checked=1).");
2943 throw runtime_error(
2944 "The cloudbox must be flagged to have "
2945 "passed a consistency check (cloudbox_checked=1).");
2953 os <<
"Initialization method *DoitInit* has to be called before "
2954 <<
"*DoitGetIncoming*.";
2955 throw runtime_error(os.str());
2969 throw runtime_error(
"The atmospheric dimensionality must be 1 or 3.");
2971 throw runtime_error(
2972 "*za_grid* must include 0 and 180 degrees as endpoints.");
2981 for (
Index boundary = 0; boundary <= 1; boundary++) {
2982 const Index boundary_index =
3018 for (
Index fi = 0; fi < Nf; fi++) {
3021 fi, boundary_index, 0, 0,
za_index, 0, 0) >
3025 fi, boundary_index, 0, 0,
za_index, 0, 0) <
3028 os <<
"ERROR: Radiance difference between "
3029 <<
"interpolation points is too large (factor " << maxratio
3031 <<
"to safely interpolate. This might be due to "
3032 <<
"za_grid being too coarse or the radiance field "
3033 <<
"being a step-like function.\n"
3034 <<
"Happens at boundary " << boundary_index
3037 <<
"for frequency #" << fi <<
", where radiances are "
3041 <<
" W/(sr m2 Hz).";
3042 throw runtime_error(os.str());
3055 throw runtime_error(
3056 "*aa_grid* must include 0 and 360 degrees as endpoints.");
3065 for (
Index i = 0; i < Naa; i++) aa_g[i] =
aa_grid[i] - 180;
3072 for (
Index boundary = 0; boundary <= 1; boundary++) {
3073 const Index boundary_index =
3075 for (
Index lat_index = 0; lat_index < Nlat_cloud; lat_index++) {
3076 for (
Index lon_index = 0; lon_index < Nlon_cloud; lon_index++) {
3118 for (
Index boundary = 0; boundary <= 1; boundary++) {
3120 for (
Index p_index = 0; p_index < Np_cloud; p_index++) {
3121 for (
Index lon_index = 0; lon_index < Nlon_cloud; lon_index++) {
3162 for (
Index boundary = 0; boundary <= 1; boundary++) {
3164 for (
Index p_index = 0; p_index < Np_cloud; p_index++) {
3165 for (
Index lat_index = 0; lat_index < Nlat_cloud; lat_index++) {
3229 throw runtime_error(
3230 "The atmospheric fields must be flagged to have "
3231 "passed a consistency check (atmfields_checked=1).");
3233 throw runtime_error(
3234 "The atmospheric geometry must be flagged to have "
3235 "passed a consistency check (atmgeom_checked=1).");
3237 throw runtime_error(
3238 "The cloudbox must be flagged to have "
3239 "passed a consistency check (cloudbox_checked=1).");
3247 os <<
"Initialization method *DoitInit* has to be called before "
3248 <<
"*DoitGetIncoming1DAtm*.";
3249 throw runtime_error(os.str());
3265 throw runtime_error(
"The atmospheric dimensionality must be 3.");
3267 throw runtime_error(
3268 "*za_grid* must include 0 and 180 degrees as endpoints.");
3270 throw runtime_error(
3271 "*aa_grid* must include 0 and 360 degrees as endpoints.");
3283 for (
Index i = 0; i < Naa; i++) aa_g[i] =
aa_grid[i] - 180;
3298 for (
Index p_index = 0; p_index < Np_cloud; p_index++) {
3316 for (
Index aa = 0; aa < Naa; aa++) {
3326 else if (p_index == Np_cloud - 1)
3342 const Index boundary_index =
3371 const Tensor7& cloudbox_field_precalc,
3377 os <<
"This method is currently only implemented for 1D atmospheres!\n";
3378 throw runtime_error(os.str());
3384 os <<
"Initialization method *DoitInit* has to be called before "
3385 <<
"*cloudbox_fieldSetFromPrecalc*";
3386 throw runtime_error(os.str());
3394 if (nf != cloudbox_field_precalc.
nlibraries()) {
3396 os <<
"cloudbox_field_precalc has wrong size in frequency dimension.\n"
3397 << nf <<
" frequency points are expected, but cloudbox_field_precalc "
3398 <<
"contains " << cloudbox_field_precalc.
nlibraries()
3399 <<
"frequency points.\n";
3400 throw runtime_error(os.str());
3402 if (np != cloudbox_field_precalc.
nvitrines()) {
3404 os <<
"cloudbox_field_precalc has wrong size in pressure level dimension.\n"
3405 << np <<
" pressure levels expected, but cloudbox_field_precalc "
3406 <<
"contains " << cloudbox_field_precalc.
nvitrines()
3407 <<
"pressure levels.\n";
3408 throw runtime_error(os.str());
3410 if (nza != cloudbox_field_precalc.
npages()) {
3412 os <<
"cloudbox_field_precalc has wrong size in polar angle dimension.\n"
3413 << nza <<
" angles expected, but cloudbox_field_precalc "
3414 <<
"contains " << cloudbox_field_precalc.
npages() <<
"angles.\n";
3415 throw runtime_error(os.str());
3419 os <<
"cloudbox_field_precalc has wrong stokes dimension.\n"
3421 <<
" expected, but cloudbox_field_precalc is dimesnion "
3422 << cloudbox_field_precalc.
ncols() <<
".\n";
3423 throw runtime_error(os.str());
3432 Index first_upwell = 0;
3435 while (
za_grid[first_upwell] < 90.) first_upwell++;
3437 Range downwell(0, first_upwell);
3438 Range upwell(first_upwell,
za_grid.nelem() - first_upwell);
3450 cloudbox_field_precalc(
joker, np - 1, 0, 0, upwell, 0,
joker);
3456 cloudbox_field_precalc(
joker, 0, 0, 0, downwell, 0,
joker);
3475 const Index& all_frequencies,
3485 os <<
"Initialization method *DoitInit* has to be called before "
3486 <<
"*cloudbox_fieldSetClearsky*.";
3487 throw runtime_error(os.str());
3491 <<
" Interpolate boundary clearsky field to obtain the initial field.\n";
3522 Tensor6 scat_i_p(2, 1, 1, N_za, 1, N_i);
3536 for (
Index i = 0; i < N_i; ++i) {
3543 interp(target_field, itw, source_field, p_gp);
3549 if (all_frequencies ==
false)
3550 throw runtime_error(
3551 "Error in cloudbox_fieldSetClearsky: For 3D "
3552 "all_frequencies option is not implemented \n");
3562 Tensor6 scat_i_p(2, N_lat, N_lon, N_za, N_aa, N_i);
3568 Tensor6 scat_i_lat(N_p, 2, N_lon, N_za, N_aa, N_i);
3574 Tensor6 scat_i_lon(N_p, N_lat, 2, N_za, N_aa, N_i);
3621 for (
Index lat_index = 0;
3624 for (
Index lon_index = 0;
3629 for (
Index i = 0; i < N_i; ++i) {
3641 interp(target_field, itw_p, source_field, p_gp);
3648 for (
Index p_index = 0;
3651 for (
Index lon_index = 0;
3656 for (
Index i = 0; i < N_i; ++i) {
3668 interp(target_field, itw_lat, source_field, lat_gp);
3675 for (
Index p_index = 0;
3678 for (
Index lat_index = 0;
3683 for (
Index i = 0; i < N_i; ++i) {
3695 interp(target_field, itw_lon, source_field, lon_gp);
3716 const Vector& cloudbox_field_values,
3738 cloudbox_field_values,
3757 const Matrix& cloudbox_field_values,
3762 throw runtime_error(
3763 "Number of rows in *cloudbox_field_values* has to be equal"
3764 " the frequency dimension of *cloudbox_field*.");
3803 const Vector& cloudbox_field_values,
3808 out2 <<
" Set initial field to constant values: " << cloudbox_field_values
3817 if (stokes_dim < 0 || stokes_dim > 4)
3818 throw runtime_error(
3819 "The dimension of stokes vector must be"
3822 if (
stokes_dim != cloudbox_field_values.nelem())
3823 throw runtime_error(
3824 "Length of *cloudbox_field_values* has to be equal"
3827 throw runtime_error(
3828 "*cloudbox_limits* is a vector which contains the"
3829 "upper and lower limit of the cloud for all "
3830 "atmospheric dimensions. So its dimension must"
3831 "be 2 x *atmosphere_dim*.");
3835 cloudbox_field_values[i];
Index atmosphere_dim(Workspace &ws) noexcept
StokesVector abs_vec(Workspace &ws) noexcept
Vector doit_za_grid_opt(Workspace &ws) noexcept
Index doit_conv_flag(Workspace &ws) noexcept
Tensor3 z_field(Workspace &ws) noexcept
void cloudbox_fieldUpdateSeq1DPP(Workspace &ws, Tensor6 &cloudbox_field_mono, Index &za_index, const Tensor6 &doit_scat_field, const ArrayOfIndex &cloudbox_limits, const Agenda &propmat_clearsky_agenda, const Tensor4 &vmr_field, const Agenda &spt_calc_agenda, const Vector &za_grid, const Tensor4 &pnd_field, const Vector &p_grid, const Tensor3 &z_field, const Tensor3 &t_field, const Vector &f_grid, const Index &f_index, const Verbosity &verbosity)
WORKSPACE METHOD: cloudbox_fieldUpdateSeq1DPP.
Agenda ppath_step_agenda(Workspace &ws) noexcept
Numeric lat(Workspace &ws) noexcept
Tensor6 doit_scat_field(Workspace &ws) noexcept
Index atmgeom_checked(Workspace &ws) noexcept
Numeric interp_poly(ConstVectorView x, ConstVectorView y, const Numeric &x_i, const GridPos &gp)
Polynomial interpolation.
void gridpos(ArrayOfGridPos &gp, ConstVectorView old_grid, ConstVectorView new_grid, const Numeric &extpolfac)
Set up a grid position Array.
void doit_za_grid_optCalc(Vector &doit_za_grid_opt, const Tensor6 &cloudbox_field_mono, const Vector &za_grid, const Index &doit_za_interp, const Numeric &acc, const Verbosity &verbosity)
WORKSPACE METHOD: doit_za_grid_optCalc.
void p2gridpos(ArrayOfGridPos &gp, ConstVectorView old_pgrid, ConstVectorView new_pgrid, const Numeric &extpolfac)
Calculates grid positions for pressure values.
Index ncols() const
Returns the number of columns.
Vector lat_grid(Workspace &ws) noexcept
void cloudbox_field_monoOptimizeReverse(Tensor6 &cloudbox_field_mono, const Vector &p_grid_orig, const Vector &p_grid, const ArrayOfIndex &cloudbox_limits, const Verbosity &)
WORKSPACE METHOD: cloudbox_field_monoOptimizeReverse.
void doit_scat_fieldCalcLimb(Workspace &ws, Tensor6 &doit_scat_field, const Agenda &pha_mat_spt_agenda, const Tensor6 &cloudbox_field_mono, const Tensor4 &pnd_field, const Tensor3 &t_field, const Index &atmosphere_dim, const ArrayOfIndex &cloudbox_limits, const Vector &za_grid, const Vector &aa_grid, const Index &doit_za_grid_size, const Index &doit_za_interp, const Tensor7 &pha_mat_doit, const Verbosity &verbosity)
WORKSPACE METHOD: doit_scat_fieldCalcLimb.
Tensor4 pnd_field(Workspace &ws) noexcept
Numeric interp(ConstVectorView itw, ConstVectorView a, const GridPos &tc)
Red 1D Interpolate.
Verbosity verbosity(Workspace &ws) noexcept
ArrayOfArrayOfSingleScatteringData scat_data_mono(Workspace &ws) noexcept
Index f_index(Workspace &ws) noexcept
void doit_conv_test_agendaExecute(Workspace &ws, Index &doit_conv_flag, Index &doit_iteration_counter, const Tensor6 &cloudbox_field_mono, const Tensor6 &cloudbox_field_mono_old, const Agenda &input_agenda)
ArrayOfIndex cloudbox_limits(Workspace &ws) noexcept
void doit_conv_flagAbs(Index &doit_conv_flag, Index &doit_iteration_counter, Tensor6 &cloudbox_field_mono, const Tensor6 &cloudbox_field_mono_old, const Vector &epsilon, const Index &max_iterations, const Index &throw_nonconv_error, const Verbosity &verbosity)
WORKSPACE METHOD: doit_conv_flagAbs.
void cloudbox_fieldUpdate1D(Workspace &ws, Tensor6 &cloudbox_field_mono, const Tensor6 &doit_scat_field, const ArrayOfIndex &cloudbox_limits, const Agenda &propmat_clearsky_agenda, const Tensor4 &vmr_field, const Agenda &spt_calc_agenda, const Vector &za_grid, const Tensor4 &pnd_field, const Agenda &ppath_step_agenda, const Numeric &ppath_lmax, const Numeric &ppath_lraytrace, const Vector &p_grid, const Tensor3 &z_field, const Vector &refellipsoid, const Tensor3 &t_field, const Vector &f_grid, const Index &f_index, const Agenda &surface_rtprop_agenda, const Index &doit_za_interp, const Verbosity &verbosity)
WORKSPACE METHOD: cloudbox_fieldUpdate1D.
void cloud_ppath_update1D_noseq(Workspace &ws, Tensor6View cloudbox_field_mono, const Index &p_index, const Index &za_index, ConstVectorView za_grid, const ArrayOfIndex &cloudbox_limits, ConstTensor6View cloudbox_field_mono_old, ConstTensor6View doit_scat_field, const Agenda &propmat_clearsky_agenda, ConstTensor4View vmr_field, const Agenda &ppath_step_agenda, const Numeric &ppath_lmax, const Numeric &ppath_lraytrace, ConstVectorView p_grid, ConstTensor3View z_field, ConstVectorView refellipsoid, ConstTensor3View t_field, ConstVectorView f_grid, const Index &f_index, ConstTensor5View ext_mat_field, ConstTensor4View abs_vec_field, const Agenda &surface_rtprop_agenda, const Index &scat_za_interp, const Verbosity &verbosity)
Calculation of radiation field along a propagation path step for specified zenith direction and press...
Radiative transfer in cloudbox.
Agenda doit_mono_agenda(Workspace &ws) noexcept
Index za_index(Workspace &ws) noexcept
Index stokes_dim(Workspace &ws) noexcept
Index nrows() const
Returns the number of rows.
Array< RetrievalQuantity > ArrayOfRetrievalQuantity
Numeric AngIntegrate_trapezoid_opti(ConstMatrixView Integrand, ConstVectorView za_grid, ConstVectorView aa_grid, ConstVectorView grid_stepsize)
AngIntegrate_trapezoid_opti.
void cloudbox_fieldSetFromPrecalc(Tensor7 &cloudbox_field, const Vector &za_grid, const Vector &f_grid, const Index &atmosphere_dim, const Index &stokes_dim, const ArrayOfIndex &cloudbox_limits, const Index &doit_is_initialized, const Tensor7 &cloudbox_field_precalc, const Verbosity &)
WORKSPACE METHOD: cloudbox_fieldSetFromPrecalc.
String iy_unit(Workspace &ws) noexcept
Tensor6 cloudbox_field_mono(Workspace &ws) noexcept
Matrix iy(Workspace &ws) noexcept
Index doit_za_interp(Workspace &ws) noexcept
This file contains the definition of Array.
void cloud_ppath_update1D(Workspace &ws, Tensor6View cloudbox_field_mono, const Index &p_index, const Index &za_index, ConstVectorView za_grid, const ArrayOfIndex &cloudbox_limits, ConstTensor6View doit_scat_field, const Agenda &propmat_clearsky_agenda, ConstTensor4View vmr_field, const Agenda &ppath_step_agenda, const Numeric &ppath_lmax, const Numeric &ppath_lraytrace, ConstVectorView p_grid, ConstTensor3View z_field, ConstVectorView refellipsoid, ConstTensor3View t_field, ConstVectorView f_grid, const Index &f_index, ConstTensor5View ext_mat_field, ConstTensor4View abs_vec_field, const Agenda &surface_rtprop_agenda, const Index &scat_za_interp, const Verbosity &verbosity)
Calculates radiation field along a propagation path step for specified zenith direction and pressure ...
bool is_size(ConstVectorView x, const Index &n)
Verifies that the size of x is l.
The structure to describe a propagation path and releated quantities.
Agenda surface_rtprop_agenda(Workspace &ws) noexcept
Numeric lon(Workspace &ws) noexcept
Numeric sqrt(const Rational r)
Square root.
Agenda doit_conv_test_agenda(Workspace &ws) noexcept
Index nlibraries() const
Returns the number of libraries.
void DoitGetIncoming(Workspace &ws, Tensor7 &cloudbox_field, const Index &atmfields_checked, const Index &atmgeom_checked, const Index &cloudbox_checked, const Index &doit_is_initialized, const Agenda &iy_main_agenda, const Index &atmosphere_dim, const Vector &lat_grid, const Vector &lon_grid, const Tensor3 &z_field, const EnergyLevelMap &nlte_field, const Index &cloudbox_on, const ArrayOfIndex &cloudbox_limits, const Vector &f_grid, const Index &stokes_dim, const Vector &za_grid, const Vector &aa_grid, const Index &rigorous, const Numeric &maxratio, const Verbosity &)
WORKSPACE METHOD: DoitGetIncoming.
void DoitInit(Tensor6 &doit_scat_field, Tensor7 &cloudbox_field, Index &doit_is_initialized, const Index &stokes_dim, const Index &atmosphere_dim, const Vector &f_grid, const Vector &za_grid, const Vector &aa_grid, const Index &doit_za_grid_size, const Index &cloudbox_on, const ArrayOfIndex &cloudbox_limits, const Verbosity &verbosity)
WORKSPACE METHOD: DoitInit.
void doit_scat_field_agendaExecute(Workspace &ws, Tensor6 &doit_scat_field, const Tensor6 &cloudbox_field_mono, const Agenda &input_agenda)
Index doit_iteration_counter(Workspace &ws) noexcept
Numeric invrayjean(const Numeric &i, const Numeric &f)
invrayjean
EnergyLevelMap nlte_field(Workspace &ws) noexcept
This can be used to make arrays out of anything.
Numeric pow(const Rational base, Numeric exp)
Power of.
void za_gridOpt(Vector &za_grid_opt, Matrix &cloudbox_field_opt, ConstVectorView za_grid_fine, ConstTensor6View cloudbox_field_mono, const Numeric &acc, const Index &scat_za_interp)
Optimize the zenith angle grid.
void cloudbox_fieldSetConst(Tensor7 &cloudbox_field, const Vector &p_grid, const Vector &lat_grid, const Vector &lon_grid, const ArrayOfIndex &cloudbox_limits, const Index &atmosphere_dim, const Index &stokes_dim, const Vector &cloudbox_field_values, const Verbosity &verbosity)
WORKSPACE METHOD: cloudbox_fieldSetConst.
Declarations for agendas.
void xml_read_from_file(const String &filename, T &type, const Verbosity &verbosity)
Reads data from XML file.
void cloudbox_fieldSetClearsky(Tensor7 &cloudbox_field, const Vector &p_grid, const Vector &lat_grid, const Vector &lon_grid, const ArrayOfIndex &cloudbox_limits, const Index &atmosphere_dim, const Index &cloudbox_on, const Index &doit_is_initialized, const Index &all_frequencies, const Verbosity &verbosity)
WORKSPACE METHOD: cloudbox_fieldSetClearsky.
Tensor7 pha_mat_doit(Workspace &ws) noexcept
void pha_matCalc(Tensor4 &pha_mat, const Tensor5 &pha_mat_spt, const Tensor4 &pnd_field, const Index &atmosphere_dim, const Index &scat_p_index, const Index &scat_lat_index, const Index &scat_lon_index, const Verbosity &)
WORKSPACE METHOD: pha_matCalc.
Declarations having to do with the four output streams.
void cloudbox_field_monoSetConst(Tensor6 &cloudbox_field_mono, const Vector &p_grid, const Vector &lat_grid, const Vector &lon_grid, const ArrayOfIndex &cloudbox_limits, const Index &atmosphere_dim, const Index &stokes_dim, const Vector &cloudbox_field_values, const Verbosity &verbosity)
WORKSPACE METHOD: cloudbox_field_monoSetConst.
Index nelem() const
Returns the number of elements.
void cloud_ppath_update3D(Workspace &ws, Tensor6View cloudbox_field_mono, const Index &p_index, const Index &lat_index, const Index &lon_index, const Index &za_index, const Index &aa_index, ConstVectorView za_grid, ConstVectorView aa_grid, const ArrayOfIndex &cloudbox_limits, ConstTensor6View doit_scat_field, const Agenda &propmat_clearsky_agenda, ConstTensor4View vmr_field, const Agenda &ppath_step_agenda, const Numeric &ppath_lmax, const Numeric &ppath_lraytrace, ConstVectorView p_grid, ConstVectorView lat_grid, ConstVectorView lon_grid, ConstTensor3View z_field, ConstVectorView refellipsoid, ConstTensor3View t_field, ConstVectorView f_grid, const Index &f_index, ConstTensor5View ext_mat_field, ConstTensor4View abs_vec_field, const Index &, const Verbosity &verbosity)
Radiative transfer calculation along a path inside the cloudbox (3D).
Index nvitrines() const
Returns the number of vitrines.
Tensor4 vmr_field(Workspace &ws) noexcept
This file contains declerations of functions of physical character.
Index doit_za_grid_size(Workspace &ws) noexcept
Index atmfields_checked(Workspace &ws) noexcept
Vector p_grid(Workspace &ws) noexcept
Ppath ppath(Workspace &ws) noexcept
void doit_mono_agendaExecute(Workspace &ws, Tensor6 &cloudbox_field_mono, const Vector &f_grid, const Index f_index, const Agenda &input_agenda)
Index npages() const
Returns the number of pages.
void doit_conv_flagAbsBT(Index &doit_conv_flag, Index &doit_iteration_counter, Tensor6 &cloudbox_field_mono, const Tensor6 &cloudbox_field_mono_old, const Vector &f_grid, const Index &f_index, const Vector &epsilon, const Index &max_iterations, const Index &throw_nonconv_error, const Verbosity &verbosity)
WORKSPACE METHOD: doit_conv_flagAbsBT.
void doit_rte_agendaExecute(Workspace &ws, Tensor6 &cloudbox_field_mono, const Tensor6 &doit_scat_field, const Agenda &input_agenda)
NUMERIC Numeric
The type to use for all floating point numbers.
Linear algebra functions.
Tensor6 cloudbox_field_mono_old(Workspace &ws) noexcept
void propmat_clearsky_agendaExecute(Workspace &ws, ArrayOfPropagationMatrix &propmat_clearsky, ArrayOfStokesVector &nlte_source, ArrayOfPropagationMatrix &dpropmat_clearsky_dx, ArrayOfStokesVector &dnlte_dx_source, ArrayOfStokesVector &nlte_dsource_dx, const ArrayOfRetrievalQuantity &jacobian_quantities, const Vector &f_grid, const Vector &rtp_mag, const Vector &rtp_los, const Numeric rtp_pressure, const Numeric rtp_temperature, const EnergyLevelMap &rtp_nlte, const Vector &rtp_vmr, const Agenda &input_agenda)
Agenda doit_scat_field_agenda(Workspace &ws) noexcept
void DoitCalc(Workspace &ws, Tensor7 &cloudbox_field, const Index &atmfields_checked, const Index &atmgeom_checked, const Index &cloudbox_checked, const Index &scat_data_checked, const Index &cloudbox_on, const Vector &f_grid, const Agenda &doit_mono_agenda, const Index &doit_is_initialized, const Verbosity &verbosity)
WORKSPACE METHOD: DoitCalc.
Vector refellipsoid(Workspace &ws) noexcept
Vector f_grid(Workspace &ws) noexcept
PropagationMatrix ext_mat(Workspace &ws) noexcept
void DOAngularGridsSet(Index &doit_za_grid_size, Vector &aa_grid, Vector &za_grid, const Index &N_za_grid, const Index &N_aa_grid, const String &za_grid_opt_file, const Verbosity &verbosity)
WORKSPACE METHOD: DOAngularGridsSet.
Agenda doit_rte_agenda(Workspace &ws) noexcept
void cloud_fieldsCalc(Workspace &ws, Tensor5View ext_mat_field, Tensor4View abs_vec_field, const Agenda &spt_calc_agenda, const Index &za_index, const Index &aa_index, const ArrayOfIndex &cloudbox_limits, ConstTensor3View t_field, ConstTensor4View pnd_field, const Verbosity &verbosity)
Calculate ext_mat, abs_vec for all points inside the cloudbox for one.
Numeric AngIntegrate_trapezoid(ConstMatrixView Integrand, ConstVectorView za_grid, ConstVectorView aa_grid)
AngIntegrate_trapezoid.
Vector za_grid(Workspace &ws) noexcept
Vector lon_grid(Workspace &ws) noexcept
void nlinspace(Vector &x, const Numeric start, const Numeric stop, const Index n)
nlinspace
Numeric ppath_lmax(Workspace &ws) noexcept
Numeric ppath_lraytrace(Workspace &ws) noexcept
Index scat_data_checked(Workspace &ws) noexcept
invlib::Vector< ArtsVector > Vector
invlib wrapper type for ARTS vectors.
Propagation path structure and functions.
Index doit_is_initialized(Workspace &ws) noexcept
void xml_write_to_file(const String &filename, const T &type, const FileType ftype, const Index no_clobber, const Verbosity &verbosity)
Write data to XML file.
void cloudbox_field_monoIterate(Workspace &ws, Tensor6 &cloudbox_field_mono, const Agenda &doit_scat_field_agenda, const Agenda &doit_rte_agenda, const Agenda &doit_conv_test_agenda, const Index &accelerated, const Verbosity &verbosity)
WORKSPACE METHOD: cloudbox_field_monoIterate.
void cloud_ppath_update1D_planeparallel(Workspace &ws, Tensor6View cloudbox_field_mono, const Index &p_index, const Index &za_index, ConstVectorView za_grid, const ArrayOfIndex &cloudbox_limits, ConstTensor6View doit_scat_field, const Agenda &propmat_clearsky_agenda, ConstTensor4View vmr_field, ConstVectorView p_grid, ConstTensor3View z_field, ConstTensor3View t_field, ConstVectorView f_grid, const Index &f_index, ConstTensor5View ext_mat_field, ConstTensor4View abs_vec_field, const Verbosity &verbosity)
Radiative transfer calculation inside cloudbox for planeparallel case.
bool is_increasing(ConstVectorView x)
Checks if a vector is sorted and strictly increasing.
Header file for logic.cc.
Agenda iy_main_agenda(Workspace &ws) noexcept
void cloudbox_field_ngAcceleration(Tensor6 &cloudbox_field_mono, const ArrayOfTensor6 &acceleration_input, const Index &accelerated, const Verbosity &)
Convergence acceleration.
void doit_scat_fieldNormalize(Workspace &ws, Tensor6 &doit_scat_field, const Tensor6 &cloudbox_field_mono, const ArrayOfIndex &cloudbox_limits, const Agenda &spt_calc_agenda, const Index &atmosphere_dim, const Vector &za_grid, const Vector &aa_grid, const Tensor4 &pnd_field, const Tensor3 &t_field, const Numeric &norm_error_threshold, const Index &norm_debug, const Verbosity &verbosity)
Normalization of scattered field.
void DoitGetIncoming1DAtm(Workspace &ws, Tensor7 &cloudbox_field, Index &cloudbox_on, const Index &atmfields_checked, const Index &atmgeom_checked, const Index &cloudbox_checked, const Index &doit_is_initialized, const Agenda &iy_main_agenda, const Index &atmosphere_dim, const Vector &lat_grid, const Vector &lon_grid, const Tensor3 &z_field, const EnergyLevelMap &nlte_field, const ArrayOfIndex &cloudbox_limits, const Vector &f_grid, const Index &stokes_dim, const Vector &za_grid, const Vector &aa_grid, const Verbosity &)
WORKSPACE METHOD: DoitGetIncoming1DAtm.
Declaration of functions in rte.cc.
Vector p_grid_orig(Workspace &ws) noexcept
Tensor3 t_field(Workspace &ws) noexcept
void get_iy(Workspace &ws, Matrix &iy, const Index &cloudbox_on, ConstVectorView f_grid, const EnergyLevelMap &nlte_field, ConstVectorView rte_pos, ConstVectorView rte_los, ConstVectorView rte_pos2, const String &iy_unit, const Agenda &iy_main_agenda)
Basic call of iy_main_agenda.
Header file for special_interp.cc.
void OptimizeDoitPressureGrid(Workspace &ws, Vector &p_grid, Tensor4 &pnd_field, Tensor3 &t_field, ArrayOfArrayOfSingleScatteringData &scat_data_mono, Tensor3 &z_field, ArrayOfIndex &cloudbox_limits, Tensor6 &cloudbox_field_mono, Tensor7 &pha_mat_doit, Tensor4 &vmr_field, Vector &p_grid_orig, const Vector &f_grid, const Index &f_index, const Agenda &propmat_clearsky_agenda, const Numeric &tau_scat_max, const Numeric &sgl_alb_max, const Index &cloudbox_size_max, const Verbosity &verbosity)
WORKSPACE METHOD: OptimizeDoitPressureGrid.
void DoitWriteIterationFields(const Index &doit_iteration_counter, const Tensor6 &cloudbox_field_mono, const Index &f_index, const ArrayOfIndex &iterations, const ArrayOfIndex &frequencies, const Verbosity &verbosity)
WORKSPACE METHOD: DoitWriteIterationFields.
Tensor7 cloudbox_field(Workspace &ws) noexcept
void doit_za_interpSet(Index &doit_za_interp, const Index &atmosphere_dim, const String &method, const Verbosity &)
WORKSPACE METHOD: doit_za_interpSet.
Agenda propmat_clearsky_agenda(Workspace &ws) noexcept
INDEX Index
The type to use for all integer numbers and indices.
void cloudbox_fieldUpdateSeq3D(Workspace &ws, Tensor6 &cloudbox_field_mono, const Tensor6 &doit_scat_field, const ArrayOfIndex &cloudbox_limits, const Agenda &propmat_clearsky_agenda, const Tensor4 &vmr_field, const Agenda &spt_calc_agenda, const Vector &za_grid, const Vector &aa_grid, const Tensor4 &pnd_field, const Agenda &ppath_step_agenda, const Numeric &ppath_lmax, const Numeric &ppath_lraytrace, const Vector &p_grid, const Vector &lat_grid, const Vector &lon_grid, const Tensor3 &z_field, const Vector &refellipsoid, const Tensor3 &t_field, const Vector &f_grid, const Index &f_index, const Index &doit_za_interp, const Verbosity &verbosity)
WORKSPACE METHOD: cloudbox_fieldUpdateSeq3D.
void cloudbox_fieldUpdateSeq1D(Workspace &ws, Tensor6 &cloudbox_field_mono, Tensor6 &doit_scat_field, const ArrayOfIndex &cloudbox_limits, const Agenda &propmat_clearsky_agenda, const Tensor4 &vmr_field, const Agenda &spt_calc_agenda, const Vector &za_grid, const Vector &aa_grid, const Tensor4 &pnd_field, const Agenda &ppath_step_agenda, const Numeric &ppath_lmax, const Numeric &ppath_lraytrace, const Vector &p_grid, const Tensor3 &z_field, const Vector &refellipsoid, const Tensor3 &t_field, const Vector &f_grid, const Index &f_index, const Agenda &surface_rtprop_agenda, const Index &doit_za_interp, const Index &normalize, const Numeric &norm_error_threshold, const Index &norm_debug, const Verbosity &verbosity)
WORKSPACE METHOD: cloudbox_fieldUpdateSeq1D.
Agenda pha_mat_spt_agenda(Workspace &ws) noexcept
void pha_mat_spt_agendaExecute(Workspace &ws, Tensor5 &pha_mat_spt, const Index za_index, const Index scat_lat_index, const Index scat_lon_index, const Index scat_p_index, const Index aa_index, const Numeric rtp_temperature, const Agenda &input_agenda)
Index aa_index(Workspace &ws) noexcept
Vector aa_grid(Workspace &ws) noexcept
void doit_conv_flagLsq(Index &doit_conv_flag, Index &doit_iteration_counter, Tensor6 &cloudbox_field_mono, const Tensor6 &cloudbox_field_mono_old, const Vector &f_grid, const Index &f_index, const Vector &epsilon, const Index &max_iterations, const Index &throw_nonconv_error, const Verbosity &verbosity)
WORKSPACE METHOD: doit_conv_flagLsq.
A constant view of a Vector.
Index nelem() const
Number of elements.
Index cloudbox_checked(Workspace &ws) noexcept
Auxiliary header stuff related to workspace variable groups.
void interpweights(VectorView itw, const GridPos &tc)
Red 1D interpolation weights.
The global header file for ARTS.
void doit_scat_fieldCalc(Workspace &ws, Tensor6 &doit_scat_field, const Agenda &pha_mat_spt_agenda, const Tensor6 &cloudbox_field_mono, const Tensor4 &pnd_field, const Tensor3 &t_field, const Index &atmosphere_dim, const ArrayOfIndex &cloudbox_limits, const Vector &za_grid, const Vector &aa_grid, const Index &doit_za_grid_size, const Tensor7 &pha_mat_doit, const Verbosity &verbosity)
WORKSPACE METHOD: doit_scat_fieldCalc.
Agenda spt_calc_agenda(Workspace &ws) noexcept
Index cloudbox_on(Workspace &ws) noexcept
This file contains basic functions to handle XML data files.
Template functions for general supergeneric ws methods.
void cloudbox_fieldSetConstPerFreq(Tensor7 &cloudbox_field, const Vector &p_grid, const Vector &lat_grid, const Vector &lon_grid, const ArrayOfIndex &cloudbox_limits, const Index &atmosphere_dim, const Index &stokes_dim, const Matrix &cloudbox_field_values, const Verbosity &verbosity)
WORKSPACE METHOD: cloudbox_fieldSetConstPerFreq.