ARTS 2.5.0 (git: 9ee3ac6c)
cloudbox.cc
Go to the documentation of this file.
1/* Copyright (C) 2002-2012 Claudia Emde <claudia.emde@dlr.de>
2
3 This program is free software; you can redistribute it and/or modify it
4 under the terms of the GNU General Public License as published by the
5 Free Software Foundation; either version 2, or (at your option) any
6 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
27#include "cloudbox.h"
28
29extern const Index GFIELD3_P_GRID;
30extern const Index GFIELD3_LAT_GRID;
31extern const Index GFIELD3_LON_GRID;
32
33/*===========================================================================
34 === External declarations
35 ===========================================================================*/
36#include <algorithm>
37#include <cmath>
38#include <ctime>
39#include <limits>
40#include <stdexcept>
41
42#include "arts.h"
43#include "check_input.h"
44#include "lin_alg.h"
45#include "logic.h"
46#include "math_funcs.h"
47#include "mc_antenna.h"
48#include "messages.h"
49#include "physics_funcs.h"
50#include "ppath.h"
51#include "rng.h"
52#include "sorting.h"
53
55
67void chk_pnd_data(const GriddedField3& pnd_field_raw,
68 const String& pnd_field_file,
69 const Index& atmosphere_dim,
70 const Verbosity& verbosity) {
72
73 const Vector& pfr_lat_grid =
75 const Vector& pfr_lon_grid =
77
78 // The consistency of the dimensions is checked in the reading routine.
79 // Here we have to check whether the atmospheric dimension is correct and whether
80 // the particle number density is 0 on the cloudbox boundary and outside the cloudbox.
81
82 out3 << "Check particle number density file " << pnd_field_file << "\n";
83
84 ARTS_USER_ERROR_IF (atmosphere_dim == 1 &&
85 (pfr_lat_grid.nelem() != 1 || pfr_lon_grid.nelem() != 1),
86 "The atmospheric dimension is 1D but the particle "
87 "number density file * ", pnd_field_file,
88 " is for a 3D atmosphere. \n")
89
90 if (atmosphere_dim == 3) {
91 ARTS_USER_ERROR_IF (pfr_lat_grid.nelem() == 1 || pfr_lon_grid.nelem() == 1,
92 "The atmospheric dimension is 3D but the particle "
93 "number density file * ", pnd_field_file,
94 " is for a 1D or a 2D atmosphere. \n")
95 }
96
97 out3 << "Particle number density data is o.k. \n";
98}
99
101
110void chk_pnd_raw_data(const ArrayOfGriddedField3& pnd_field_raw,
111 const String& pnd_field_file,
112 const Index& atmosphere_dim,
113 const Verbosity& verbosity) {
115
116 for (Index i = 0; i < pnd_field_raw.nelem(); i++) {
117 out3 << "Element in pnd_field_raw_file:" << i << "\n";
118 chk_pnd_data(pnd_field_raw[i], pnd_field_file, atmosphere_dim, verbosity);
119 }
120}
121
123
141 const Index& dim,
142 const ArrayOfGriddedField3& pnd_field_raw,
143 ConstVectorView p_grid,
144 ConstVectorView lat_grid,
145 ConstVectorView lon_grid,
146 const ArrayOfIndex& cloudbox_limits) {
147 Numeric p, lat, lon, v;
148 Index n, p_i, lat_i, lon_i;
149 // For any non-zero point, verify we're outside the cloudbox
150 for (n = 0; n < pnd_field_raw.nelem(); n++) {
151 for (p_i = 0; p_i < pnd_field_raw[n].data.npages(); p_i++) {
152 for (lat_i = 0; lat_i < pnd_field_raw[n].data.nrows(); lat_i++) {
153 for (lon_i = 0; lon_i < pnd_field_raw[n].data.ncols(); lon_i++) {
154 v = pnd_field_raw[n].data(p_i, lat_i, lon_i);
155 if (v != 0) {
156 // Verify pressure is between cloudbox limits
157 p = pnd_field_raw[n].get_numeric_grid(GFIELD3_P_GRID)[p_i];
158 // if (!((p <= p_grid[cloudbox_limits[0]]) &
159 // (p >= p_grid[cloudbox_limits[1]]))) {
160 ARTS_USER_ERROR_IF ((p <= p_grid[cloudbox_limits[1]]) ||
161 ((p >= p_grid[cloudbox_limits[0]]) &&
162 (cloudbox_limits[0] != 0)),
163 "Found non-zero pnd outside cloudbox. "
164 "Cloudbox extends from p=", p_grid[cloudbox_limits[0]],
165 " Pa to p=", p_grid[cloudbox_limits[1]],
166 " Pa, but found pnd=", v, "/m³ at p=", p,
167 " Pa for scattering "
168 "element #", n, ".")
169 // Verify latitude is too
170 if (dim > 1) {
171 lat = pnd_field_raw[n].get_numeric_grid(GFIELD3_LAT_GRID)[lat_i];
172 ARTS_USER_ERROR_IF (!((lat > lat_grid[cloudbox_limits[2]]) bitand
173 (lat < lat_grid[cloudbox_limits[3]])),
174 "Found non-zero pnd outside cloudbox. "
175 "Cloudbox extends from lat=",
176 lat_grid[cloudbox_limits[2]],
177 "° to lat=", lat_grid[cloudbox_limits[3]],
178 "°, but found pnd=", v, "/m³ at lat=", lat,
179 "° for scattering "
180 "element #", n, ".")
181 }
182 // Etc. for longitude
183 if (dim > 2) {
184 lon = pnd_field_raw[n].get_numeric_grid(GFIELD3_LON_GRID)[lon_i];
185 ARTS_USER_ERROR_IF (!((lon > lon_grid[cloudbox_limits[4]]) bitand
186 (lon < lon_grid[cloudbox_limits[5]])),
187 "Found non-zero pnd outside cloudbox. "
188 "Cloudbox extends from lon=",
189 lon_grid[cloudbox_limits[4]],
190 "° to lat=", lon_grid[cloudbox_limits[5]],
191 "°, but found pnd=", v, "/m³ at lon=", lon,
192 "° for scattering "
193 "element #", n, ".")
194 }
195 }
196 }
197 }
198 }
199 }
200}
201
203
215void chk_scat_species(const ArrayOfString& scat_species, const String& delim) {
216 ArrayOfString strarr;
217 Index nelem = 2;
218
219 for (Index k = 0; k < scat_species.nelem(); k++) {
220 scat_species[k].split(strarr, delim);
221 ARTS_USER_ERROR_IF (strarr.nelem() < nelem,
222 "Individual strings in scat_species must contain at least ", nelem,
223 " elements,\n"
224 "but entry #", k, " contains only the following ",
225 strarr.nelem(), ":\n",
226 strarr, "\n")
227 }
228}
229
231
242 const ArrayOfScatteringMetaData& scat_meta,
243 const Verbosity&) {
244 ARTS_USER_ERROR_IF (scat_data.nelem() != scat_meta.nelem(),
245 "The number of elements in in current scat_species' *scat_data* and "
246 "*scat_meta* do not match.\n"
247 "Each *scat_data* entry must correspond to one entry in *scat_meta*.")
248}
249
251
261 const String& scat_meta_file,
262 const Verbosity& verbosity) {
264 out3 << " Check scattering meta data file " << scat_meta_file << "\n";
265
266 /* this check is outdated. type now is free from!
267 however, we might want to have other things checked here!?
268 - which parameters at least are needed? -> radius, ...?
269 - ...
270 if (scat_meta_single.type != "Ice" && scat_meta_single.type != "Water" && scat_meta_single.type != "Aerosol")
271 {
272 ostringstream os;
273 os << "Type in " << scat_meta_file << " must be 'Ice', 'Water' or 'Aerosol'\n";
274 throw runtime_error( os.str() );
275 }
276*/
277 //(more) checks need to be included
278}
279
281
292void chk_scat_data(const SingleScatteringData& scat_data_single,
293 const Verbosity& verbosity) {
295
296 ARTS_ASSERT(scat_data_single.ptype == PTYPE_GENERAL ||
297 scat_data_single.ptype == PTYPE_TOTAL_RND ||
298 scat_data_single.ptype == PTYPE_AZIMUTH_RND);
299
300 ARTS_USER_ERROR_IF (scat_data_single.za_grid[0] != 0.,
301 "The first value of the zenith angle grid in the single"
302 " scattering properties data must be 0.")
303
304 ARTS_USER_ERROR_IF (last(scat_data_single.za_grid) != 180.,
305 "The last value of the zenith angle grid in the single"
306 " scattering properties data must be 180.")
307
308 ARTS_USER_ERROR_IF (scat_data_single.ptype == PTYPE_GENERAL &&
309 scat_data_single.aa_grid[0] != -180.,
310 "For ptype = \"general\" the first value"
311 " of the azimuth angle grid in the single scattering"
312 " properties data must be -180.")
313
314 ARTS_USER_ERROR_IF (scat_data_single.ptype == PTYPE_AZIMUTH_RND &&
315 scat_data_single.aa_grid[0] != 0.,
316 "For ptype = \"azimuthally_random\""
317 " the first value"
318 " of the azimuth angle grid in the single scattering"
319 " properties data must be 0.")
320
321 ARTS_USER_ERROR_IF (scat_data_single.ptype != PTYPE_TOTAL_RND &&
322 last(scat_data_single.aa_grid) != 180.,
323 "For ptypes = \"azimuthally_random\" and \"general\""
324 " the last value of the azimuth angle grid in the single"
325 " scattering properties data must be 180.")
326
327 ostringstream os_pha_mat;
328 os_pha_mat << "pha_mat ";
329 ostringstream os_ext_mat;
330 os_ext_mat << "ext_mat ";
331 ostringstream os_abs_vec;
332 os_abs_vec << "abs_vec ";
333
334 switch (scat_data_single.ptype) {
335 case PTYPE_GENERAL:
336
337 out3 << " Data is for arbitrarily orientated particles. \n";
338
339 chk_size(os_pha_mat.str(),
340 scat_data_single.pha_mat_data,
341 scat_data_single.f_grid.nelem(),
342 scat_data_single.T_grid.nelem(),
343 scat_data_single.za_grid.nelem(),
344 scat_data_single.aa_grid.nelem(),
345 scat_data_single.za_grid.nelem(),
346 scat_data_single.aa_grid.nelem(),
347 16);
348
349 chk_size(os_ext_mat.str(),
350 scat_data_single.ext_mat_data,
351 scat_data_single.f_grid.nelem(),
352 scat_data_single.T_grid.nelem(),
353 scat_data_single.za_grid.nelem(),
354 scat_data_single.aa_grid.nelem(),
355 7);
356
357 chk_size(os_abs_vec.str(),
358 scat_data_single.abs_vec_data,
359 scat_data_single.f_grid.nelem(),
360 scat_data_single.T_grid.nelem(),
361 scat_data_single.za_grid.nelem(),
362 scat_data_single.aa_grid.nelem(),
363 4);
364 break;
365
366 case PTYPE_TOTAL_RND:
367
368 out3 << " Data is for macroscopically isotropic and mirror-symmetric "
369 << "scattering media, i.e. for totally randomly oriented particles "
370 << "with at least one plane of symmetry. \n";
371
372 chk_size(os_pha_mat.str(),
373 scat_data_single.pha_mat_data,
374 scat_data_single.f_grid.nelem(),
375 scat_data_single.T_grid.nelem(),
376 scat_data_single.za_grid.nelem(),
377 1,
378 1,
379 1,
380 6);
381
382 chk_size(os_ext_mat.str(),
383 scat_data_single.ext_mat_data,
384 scat_data_single.f_grid.nelem(),
385 scat_data_single.T_grid.nelem(),
386 1,
387 1,
388 1);
389
390 chk_size(os_abs_vec.str(),
391 scat_data_single.abs_vec_data,
392 scat_data_single.f_grid.nelem(),
393 scat_data_single.T_grid.nelem(),
394 1,
395 1,
396 1);
397 break;
398
400
401 out3 << " Data is for azimuthally randomly oriented particles. \n";
402
403 chk_size(os_pha_mat.str(),
404 scat_data_single.pha_mat_data,
405 scat_data_single.f_grid.nelem(),
406 scat_data_single.T_grid.nelem(),
407 scat_data_single.za_grid.nelem(),
408 scat_data_single.aa_grid.nelem(),
409 scat_data_single.za_grid.nelem(),
410 1,
411 16);
412
413 chk_size(os_ext_mat.str(),
414 scat_data_single.ext_mat_data,
415 scat_data_single.f_grid.nelem(),
416 scat_data_single.T_grid.nelem(),
417 scat_data_single.za_grid.nelem(),
418 1,
419 3);
420
421 chk_size(os_abs_vec.str(),
422 scat_data_single.abs_vec_data,
423 scat_data_single.f_grid.nelem(),
424 scat_data_single.T_grid.nelem(),
425 scat_data_single.za_grid.nelem(),
426 1,
427 2);
428 break;
429 }
430
431 // Here we only check whether the temperature grid is of the unit K, not
432 // whether it corresponds to the required values in t_field. The second
433 // option is not trivial since here one has to look whether the pnd_field
434 // is non-zero for the corresponding temperature. This check is done in the
435 // functions where the multiplication with the particle number density is
436 // done.
437 ARTS_USER_ERROR_IF (scat_data_single.T_grid[0] < 0. ||
438 last(scat_data_single.T_grid) > 1001.,
439 "The temperature values in the single scattering data"
440 " are negative or very large. Check whether you use the "
441 "right unit [Kelvin].")
442}
443
461 const GridPos& gp_lat,
462 const GridPos& gp_lon,
463 const ArrayOfIndex& cloudbox_limits,
464 const bool& include_boundaries,
465 const Index& atmosphere_dim)
466
467{
468 if (include_boundaries) {
469 // Pressure dimension
470 double ipos = fractional_gp(gp_p);
471 if (ipos < double(cloudbox_limits[0]) ||
472 ipos > double(cloudbox_limits[1])) {
473 return false;
474 }
475
476 else if (atmosphere_dim >= 2) {
477 // Latitude dimension
478 ipos = fractional_gp(gp_lat);
479 if (ipos < double(cloudbox_limits[2]) ||
480 ipos > double(cloudbox_limits[3])) {
481 return false;
482 }
483
484 else if (atmosphere_dim == 3) {
485 // Longitude dimension
486 ipos = fractional_gp(gp_lon);
487 if (ipos < double(cloudbox_limits[4]) ||
488 ipos > double(cloudbox_limits[5])) {
489 return false;
490 }
491 }
492 }
493 return true;
494 } else {
495 // Pressure dimension
496 double ipos = fractional_gp(gp_p);
497 if (ipos <= double(cloudbox_limits[0]) ||
498 ipos >= double(cloudbox_limits[1])) {
499 return false;
500 }
501
502 else if (atmosphere_dim >= 2) {
503 // Latitude dimension
504 ipos = fractional_gp(gp_lat);
505 if (ipos <= double(cloudbox_limits[2]) ||
506 ipos >= double(cloudbox_limits[3])) {
507 return false;
508 }
509
510 else if (atmosphere_dim == 3) {
511 // Longitude dimension
512 ipos = fractional_gp(gp_lon);
513 if (ipos <= double(cloudbox_limits[4]) ||
514 ipos >= double(cloudbox_limits[5])) {
515 return false;
516 }
517 }
518 }
519 return true;
520 }
521}
522
540bool is_inside_cloudbox(const Ppath& ppath_step,
541 const ArrayOfIndex& cloudbox_limits,
542 const bool include_boundaries)
543
544{
545 ARTS_ASSERT(cloudbox_limits.nelem() == 6);
546 const Index np = ppath_step.np;
547
548 return is_gp_inside_cloudbox(ppath_step.gp_p[np - 1],
549 ppath_step.gp_lat[np - 1],
550 ppath_step.gp_lon[np - 1],
551 cloudbox_limits,
552 include_boundaries);
553}
554
572void bin_quadweights(Vector& w, const Vector& x, const Index& order) {
573 Index nx = x.nelem();
574
575 ARTS_ASSERT(nx > 1);
577
578 if (order == 0) {
579 w[0] = min(x[1] - x[0],
580 0.5 * (x[1] + x[0])); // the latter is the half distance
581 // from x0 to x1 plus the distance
582 // to 0, ie 0.5(x1-x0)+x0.
583 w[nx - 1] = x[nx - 1] - x[nx - 2];
584 } else {
585 w[0] = 0.5 * (x[1] - x[0]);
586 w[nx - 1] = 0.5 * (x[nx - 1] - x[nx - 2]);
587 }
588 for (Index i = 1; i < nx - 1; i++) {
589 w[i] = 0.5 * (x[i + 1] - x[i - 1]);
590 }
591}
592
594
607void chk_scat_species_field(bool& empty_flag,
608 const Tensor3& scat_species_field,
609 const String& fieldname,
610 const Index& dim,
611 const Vector& p_grid,
612 const Vector& lat_grid,
613 const Vector& lon_grid) {
614 // check p
615 ARTS_USER_ERROR_IF (scat_species_field.npages() != p_grid.nelem(),
616 "The size of *p_grid* (", p_grid.nelem(),
617 ") is unequal the number of pages of *", fieldname, "* (",
618 scat_species_field.npages(), ").")
619
620 // check lat
621 if (dim >= 2) {
622 ARTS_USER_ERROR_IF (scat_species_field.nrows() != lat_grid.nelem(),
623 "The size of *lat_grid* (", lat_grid.nelem(),
624 ") is unequal the number of rows of *", fieldname, "* (",
625 scat_species_field.nrows(), ").")
626 }
627
628 // check lon
629 if (dim == 3) {
630 ARTS_USER_ERROR_IF (scat_species_field.ncols() != lon_grid.nelem(),
631 "The size of *lon_grid* (", lon_grid.nelem(),
632 ") is unequal the number of columns of *", fieldname, "* (",
633 scat_species_field.ncols(), ").")
634 }
635
636 empty_flag = false;
637 // set empty_flag to true if a single value of hydromet_field is unequal zero
638 for (Index j = 0; j < scat_species_field.npages(); j++) {
639 for (Index k = 0; k < scat_species_field.nrows(); k++) {
640 for (Index l = 0; l < scat_species_field.ncols(); l++) {
641 if (scat_species_field(j, k, l) != 0.0 &&
642 !std::isnan(scat_species_field(j, k, l)))
643 empty_flag = true;
644 // if ( scat_species_field(j,k,l) != 0.0 ) empty_flag = true;
645 }
646 }
647 }
648}
649
651
667 Index& upper,
668 const Tensor3& scat_species_field,
669 const Index& atmosphere_dim,
670 const Numeric& cloudbox_margin) {
671 if (atmosphere_dim == 1) {
672 // scattering species profiles
673 ConstVectorView ss_prof = scat_species_field(joker, 0, 0);
674
675 Index i = 0;
676
677 // find lower cloudbox_limit to surface if margin != -1 (cloudbox not
678 // forced to reach down to surface)
679 if (cloudbox_margin != -1) {
680 // find index of first pressure level where hydromet_field is
681 // unequal 0, starting from the surface
682 for (i = 0; i < lower; i++) {
683 //cout << "for lower limit checking level #" << i << "\n";
684
685 // if any of the scat species fields contains a non-zero, non-NaN
686 // value at this atm level we found a potential lower limit value
687 if (ss_prof[i] != 0.0 && !std::isnan(ss_prof[i])) {
688 //cout << "found particles\n";
689
690 // check if lower is the lowest index in all selected
691 // scattering species fields
692 if (lower > i) {
693 lower = i;
694 //cout << "new lower limit at level #" << lower << "\n";
695 }
696 break;
697 }
698 }
699 }
700
701 // find index of highest pressure level, where scat_species_mass_density_field is
702 // unequal 0, starting from top of the atmosphere
703 for (Index j = scat_species_field.npages() - 1; j >= max(i, upper); j--) {
704 //cout << "for upper limit checking level #" << j << "\n";
705
706 // if any of the scat species fields contains a non-zero, non-NaN
707 // value at this atm level we found a potential lower limit value
708 if (ss_prof[j] != 0.0 && !std::isnan(ss_prof[j])) {
709 //cout << "found particles\n";
710
711 // check if upper is the highest index in all selected
712 // scattering species fields
713 if (upper < j) {
714 upper = j;
715 //cout << "new upper limit at level #" << upper << "\n";
716 }
717 break;
718 }
719 }
720 }
721
722 else {
723 ARTS_USER_ERROR ("Not yet available for 2D and 3D cases.")
724 }
725
726 /* //NOT WORKING YET
727 // Latitude limits
728 else if ( atmosphere_dim == 2 )
729 {
730 MatrixView hydro_lat = hydromet_field ( nhyd, joker, joker, 0 );
731
732 for ( i=0; i<hydro_lat.nrows(); i++ )
733 {
734 for ( j=0; j<hydro_lat.ncols(); j++ )
735 {
736 if ( hydro_lat[i,j] != 0.0 )
737 {
738
739 if ( lat1 <= j ) lat1 =j;
740 //cloudbox_limits[2] = lat1;
741 //break;
742 }
743
744 }
745 if ( lower <= i ) lower = i;
746 }
747
748 for ( k=hydro_lat.nelem()-1; k>=i; k-- )
749 {
750 if ( hydro_lat[k] != 0.0 )
751 {
752 lat2 = k;
753 cloudbox_limits[3] = lat2;
754 break;
755
756 }
757
758 }
759 }
760
761 // Longitude limits
762 if ( atmosphere_dim == 3 )
763 {
764 Tensor3View hydro_lon = hydromet_field ( nhyd, joker, joker, joker );
765
766 for ( i=0; i<hydro_lon.nelem(); i++ )
767 {
768 if ( hydro_lon[i] != 0.0 )
769 {
770 lon1 = i;
771 cloudbox_limits[4] = lon1;
772 break;
773 }
774
775 }
776 for ( j=hydro_lon.nelem()-1; j>=i; j-- )
777 {
778 if ( hydro_lon[j] != 0.0 )
779 {
780 lon2 = j;
781 cloudbox_limits[5] = lon2;
782 break;
783
784 }
785}*/
786}
787
799 String& species_type,
800 // WS Input:
801 const String& field_name,
802 const String& delim) {
803 ArrayOfString strarr;
804
805 // split field_name string at '-' and write to ArrayOfString
806 field_name.split(strarr, delim);
807
808 // first entry is species type
809 // (i.e. "abs_species" or "scat_species". or "T" or "z", which are ignored.)
810 if (strarr.size() > 0 && field_name[0] != '-') {
811 species_type = strarr[0];
812 } else {
814 "No information on field species type found in '",
815 field_name, "'\n")
816 }
817}
818
830 String& species_name,
831 // WS Input:
832 const String& field_name,
833 const String& delim) {
834 ArrayOfString strarr;
835
836 // split field_name string at '-' and write to ArrayOfString
837 field_name.split(strarr, delim);
838
839 // second entry is species name
840 // (e.g. "H2O, "O3" etc. for abs_species or "IWC", "LWC" etc. for scat_species)
841 if (strarr.size() > 1) {
842 species_name = strarr[1];
843 } else {
845 "No information on field species name found in '",
846 field_name, "'\n")
847 }
848}
849
861 String& scat_type,
862 // WS Input:
863 const String& field_name,
864 const String& delim) {
865 ArrayOfString strarr;
866
867 // split field_name string at '-' and write to ArrayOfString
868 field_name.split(strarr, delim);
869
870 // third entry is type of scat_species field
871 // (e.g. "mass_density", "mass_flux", "number_density")
872 if (strarr.size() > 2) {
873 scat_type = strarr[2];
874 } else {
876 "No information on type of scat_species field found in '",
877 field_name, "'\n")
878 }
879}
880
891void parse_partfield_name( //WS Output:
892 String& partfield_name,
893 // WS Input:
894 const String& part_string,
895 const String& delim) {
896 ArrayOfString strarr;
897
898 // split scat_species string at delim and write to ArrayOfString
899 part_string.split(strarr, delim);
900
901 //first entry is scattering species field name (e.g. "IWC", "LWC" etc.)
902 if (strarr.size() > 0 && part_string[0] != delim[0]) {
903 partfield_name = strarr[0];
904 } else {
905 ARTS_USER_ERROR ("No information on scattering species field name in '",
906 part_string, "'\n")
907 }
908}
909
The global header file for ARTS.
void chk_size(const String &x_name, ConstVectorView x, const Index &c)
Runtime check for size of Vector.
Definition: check_input.cc:421
This can be used to make arrays out of anything.
Definition: array.h:107
Index nelem() const ARTS_NOEXCEPT
Number of elements.
Definition: array.h:195
Index npages() const
Returns the number of pages.
Definition: matpackIII.h:144
Index nrows() const
Returns the number of rows.
Definition: matpackIII.h:147
Index ncols() const
Returns the number of columns.
Definition: matpackIII.h:150
A constant view of a Vector.
Definition: matpackI.h:489
Index nelem() const ARTS_NOEXCEPT
Returns the number of elements.
Definition: matpackI.cc:48
const Vector & get_numeric_grid(Index i) const
Get a numeric grid.
The Tensor3 class.
Definition: matpackIII.h:339
The Vector class.
Definition: matpackI.h:876
void split(Array< my_basic_string< charT > > &aos, const my_basic_string< charT > &delim) const
Split string into substrings.
Definition: mystring.h:213
void parse_atmcompact_speciesname(String &species_name, const String &field_name, const String &delim)
Definition: cloudbox.cc:829
void chk_scat_species(const ArrayOfString &scat_species, const String &delim)
Check validity of scat_species setting.
Definition: cloudbox.cc:215
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.
Definition: cloudbox.cc:607
void chk_scattering_meta_data(const ScatteringMetaData &scat_meta_single, const String &scat_meta_file, const Verbosity &verbosity)
Check scattering data meta.
Definition: cloudbox.cc:260
const Index GFIELD3_LAT_GRID
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.
Definition: cloudbox.cc:666
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
Definition: cloudbox.cc:140
void parse_partfield_name(String &partfield_name, const String &part_string, const String &delim)
Definition: cloudbox.cc:891
const Index GFIELD3_LON_GRID
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)
Definition: cloudbox.cc:110
void parse_atmcompact_speciestype(String &species_type, const String &field_name, const String &delim)
Definition: cloudbox.cc:798
bool is_inside_cloudbox(const Ppath &ppath_step, const ArrayOfIndex &cloudbox_limits, const bool include_boundaries)
Definition: cloudbox.cc:540
void parse_atmcompact_scattype(String &scat_type, const String &field_name, const String &delim)
Definition: cloudbox.cc:860
void chk_scat_data(const SingleScatteringData &scat_data_single, const Verbosity &verbosity)
Check single scattering data.
Definition: cloudbox.cc:292
void chk_scattering_data(const ArrayOfSingleScatteringData &scat_data, const ArrayOfScatteringMetaData &scat_meta, const Verbosity &)
Check scattering data general.
Definition: cloudbox.cc:241
const Index GFIELD3_P_GRID
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.
Definition: cloudbox.cc:67
void bin_quadweights(Vector &w, const Vector &x, const Index &order)
Definition: cloudbox.cc:572
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)
Definition: cloudbox.cc:460
Internal cloudbox functions.
#define _U_
Definition: config.h:180
#define ARTS_ASSERT(condition,...)
Definition: debug.h:83
#define ARTS_USER_ERROR(...)
Definition: debug.h:150
#define ARTS_USER_ERROR_IF(condition,...)
Definition: debug.h:134
Numeric fractional_gp(const GridPos &gp)
fractional_gp
#define min(a, b)
#define max(a, b)
Linear algebra functions.
bool is_increasing(ConstVectorView x)
Checks if a vector is sorted and strictly increasing.
Definition: logic.cc:215
Header file for logic.cc.
Numeric last(ConstVectorView x)
last
Definition: math_funcs.cc:159
INDEX Index
The type to use for all integer numbers and indices.
Definition: matpack.h:39
NUMERIC Numeric
The type to use for all floating point numbers.
Definition: matpack.h:33
const Joker joker
Workspace functions for the solution of cloud-box radiative transfer by Monte Carlo methods....
Declarations having to do with the four output streams.
#define CREATE_OUT3
Definition: messages.h:207
Index nelem(const Lines &l)
Number of lines.
constexpr Numeric l(const Index p0, const Index n, const Numeric x, const SortedVectorType &xi, const Index j, const std::pair< Numeric, Numeric > cycle={ -180, 180}) noexcept
constexpr bool isnan(double d) noexcept
Definition: nonstd.h:39
@ PTYPE_GENERAL
Definition: optproperties.h:53
@ PTYPE_AZIMUTH_RND
Definition: optproperties.h:54
@ PTYPE_TOTAL_RND
Definition: optproperties.h:55
This file contains declerations of functions of physical character.
Propagation path structure and functions.
#define v
#define w
member functions of the Rng class and gsl_rng code
Contains sorting routines.
Structure to store a grid position.
Definition: interpolation.h:73
The structure to describe a propagation path and releated quantities.
Definition: ppath.h:48
ArrayOfGridPos gp_lon
Index position with respect to the longitude grid.
Definition: ppath.h:86
Index np
Number of points describing the ppath.
Definition: ppath.h:52
ArrayOfGridPos gp_lat
Index position with respect to the latitude grid.
Definition: ppath.h:84
ArrayOfGridPos gp_p
Index position with respect to the pressure grid.
Definition: ppath.h:82