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