56 const Index& cloudbox_on,
57 const Index& atmfields_checked,
58 const Index& atmgeom_checked,
59 const Index& cloudbox_checked,
60 const Index& scat_data_checked,
61 const Index& atmosphere_dim,
62 const Index& stokes_dim,
66 const Index& nstreams,
67 const String& pfct_method) {
70 "Cloudbox is off, no scattering calculations to be" 74 if (atmfields_checked != 1)
76 "The atmospheric fields must be flagged to have " 77 "passed a consistency check (atmfields_checked=1).");
78 if (atmgeom_checked != 1)
80 "The atmospheric geometry must be flagged to have " 81 "passed a consistency check (atmgeom_checked=1).");
82 if (cloudbox_checked != 1)
84 "The cloudbox must be flagged to have " 85 "passed a consistency check (cloudbox_checked=1).");
86 if (scat_data_checked != 1)
88 "The scat_data must be flagged to have " 89 "passed a consistency check (scat_data_checked=1).");
91 if (atmosphere_dim != 1)
93 "For running DISORT, atmospheric dimensionality " 96 if (stokes_dim < 0 || stokes_dim > 1)
98 "For running DISORT, the dimension of stokes vector " 101 if (cloudbox_limits.
nelem() != 2 * atmosphere_dim)
103 "*cloudbox_limits* is a vector which contains the" 104 "upper and lower limit of the cloud for all " 105 "atmospheric dimensions. So its dimension must" 106 "be 2 x *atmosphere_dim*");
108 if (cloudbox_limits[0] != 0) {
110 os <<
"DISORT calculations currently only possible with " 111 <<
"lower cloudbox limit\n" 112 <<
"at 0th atmospheric level " 113 <<
"(assumes surface there, ignoring z_surface).\n";
114 throw runtime_error(os.
str());
117 if (scat_data.empty())
119 "No single scattering data present.\n" 120 "See documentation of WSV *scat_data* for options to " 121 "make single scattering data available.\n");
128 if (nstreams / 2 * 2 != nstreams) {
130 os <<
"DISORT requires an even number of streams, but yours is " << nstreams
132 throw runtime_error(os.
str());
146 os <<
"We require size of za_grid to be >= 20, to ensure a\n" 147 <<
"reasonable interpolation of the calculated cloudbox field.\n" 148 <<
"Note that for DISORT additional computation costs for\n" 149 <<
"larger numbers of angles are negligible.";
150 throw runtime_error(os.
str());
153 if (za_grid[0] != 0. || za_grid[nza - 1] != 180.)
154 throw runtime_error(
"The range of *za_grid* must [0 180].");
157 throw runtime_error(
"*za_grid* must be increasing.");
160 while (za_grid[i] <= 90) {
161 if (za_grid[i] == 90)
162 throw runtime_error(
"*za_grid* is not allowed to contain the value 90");
167 bool all_totrand =
true;
168 for (
Index i_ss = 0; i_ss < scat_data.
nelem(); i_ss++)
169 for (
Index i_se = 0; i_se < scat_data[i_ss].
nelem(); i_se++)
170 if (scat_data[i_ss][i_se].ptype !=
PTYPE_TOTAL_RND) all_totrand =
false;
173 os <<
"DISORT can only handle scattering elements of type " 178 throw runtime_error(os.
str());
181 if (pfct_method !=
"interpolate") {
184 const Vector data_za_grid = scat_data[0][0].za_grid;
186 bool ident_anggrid =
true;
187 for (
Index i_ss = 0; i_ss < scat_data.
nelem(); i_ss++)
188 for (
Index i_se = 0; i_se < scat_data[i_ss].
nelem(); i_se++)
193 if (scat_data[i_ss][i_se].za_grid.
nelem() != ndza ||
194 scat_data[i_ss][i_se].za_grid[1] != data_za_grid[1] ||
195 scat_data[i_ss][i_se].za_grid[ndza - 2] != data_za_grid[ndza - 2])
196 ident_anggrid =
false;
197 if (!ident_anggrid) {
199 os <<
"ARTS-DISORT currently supports varying angular grids of\n" 200 <<
"scattering data for different scattering elements only for\n" 201 <<
"pfct_method = \"interpolate.\"";
202 throw runtime_error(os.
str());
213 const Index& stokes_dim) {
215 const Index Np_cloud = cloudbox_limits[1] - cloudbox_limits[0] + 1;
219 cloudbox_field.
resize(Nf, Np_cloud, 1, 1, nang, 1, stokes_dim);
220 cloudbox_field = NAN;
231 if (surface_skin_t < 0. || surface_skin_t > 1000.) {
233 os <<
"Surface temperature has been set or derived as " << btemp <<
" K,\n" 234 <<
"which is not considered a meaningful value.\n" 235 <<
"For surface method 'L', *surface_skin_t* needs to\n" 236 <<
"be set and passed explicitly. Maybe you didn't do this?";
237 throw runtime_error(os.
str());
239 btemp = surface_skin_t;
242 if (surface_scalar_reflectivity.
nelem() != f_grid.
nelem() &&
243 surface_scalar_reflectivity.
nelem() != 1) {
245 os <<
"The number of elements in *surface_scalar_reflectivity*\n" 246 <<
"should match length of *f_grid* or be 1." 247 <<
"\n length of *f_grid* : " << f_grid.
nelem()
248 <<
"\n length of *surface_scalar_reflectivity* : " 249 << surface_scalar_reflectivity.
nelem() <<
"\n";
250 throw runtime_error(os.
str());
253 if (
min(surface_scalar_reflectivity) < 0 ||
254 max(surface_scalar_reflectivity) > 1) {
256 "All values in *surface_scalar_reflectivity*" 257 " must be inside [0,1].");
260 if (surface_scalar_reflectivity.
nelem() > 1)
261 for (
Index f_index = 0; f_index < f_grid.
nelem(); f_index++)
262 albedo[f_index] = surface_scalar_reflectivity[f_index];
264 for (
Index f_index = 0; f_index < f_grid.
nelem(); f_index++)
265 albedo[f_index] = surface_scalar_reflectivity[0];
270 const Agenda& propmat_clearsky_agenda,
277 assert(ext_bulk_gas.
nrows() == f_grid.
nelem());
278 assert(ext_bulk_gas.
ncols() == Np);
285 const Vector rtp_mag_dummy(3, 0);
286 const Vector ppath_los_dummy;
292 for (
Index ip = 0; ip < Np; ip++) {
295 for (
auto&
pm : propmat_clearsky_local) {
299 propmat_clearsky_local,
302 partial_source_dummy,
311 vmr_profiles(
joker, ip),
312 propmat_clearsky_agenda);
315 for (
Index ias = 1; ias < propmat_clearsky_local.nelem(); ias++)
316 propmat_bulk += propmat_clearsky_local[ias];
317 ext_bulk_gas(
joker, ip) += propmat_bulk.
Kjj();
333 assert(ext_bulk_par.
nrows() == nf);
334 assert(abs_bulk_par.
nrows() == nf);
335 assert(ext_bulk_par.
ncols() == Np);
336 assert(abs_bulk_par.
ncols() == Np);
343 Vector T_array = t_profile[
Range(cloudbox_limits[0], Np_cloud)];
344 Matrix dir_array(1, 2, 0.);
385 bool pf = (abs_vec_bulk.
nbooks() != 1);
386 for (
Index ip = 0; ip < Np_cloud; ip++)
387 for (
Index f_index = 0; f_index < nf; f_index++) {
388 if (pf) f_this = f_index;
389 ext_bulk_par(f_index, ip + cloudbox_limits[0]) =
390 ext_mat_bulk(f_this, ip, 0, 0, 0);
391 abs_bulk_par(f_index, ip + cloudbox_limits[0]) =
392 abs_vec_bulk(f_this, ip, 0, 0);
405 assert(dtauc.
nrows() == nf);
406 assert(ssalb.
nrows() == nf);
407 assert(dtauc.
ncols() == Np - 1);
408 assert(ssalb.
ncols() == Np - 1);
414 for (
Index ip = 0; ip < Np - 1; ip++)
416 for (
Index f_index = 0; f_index < nf; f_index++) {
418 0.5 * (ext_bulk_gas(f_index, ip) + ext_bulk_par(f_index, ip) +
419 ext_bulk_gas(f_index, ip + 1) + ext_bulk_par(f_index, ip + 1));
423 (ext_bulk_gas(f_index, ip) + abs_bulk_par(f_index, ip) +
424 ext_bulk_gas(f_index, ip + 1) + abs_bulk_par(f_index, ip + 1));
425 ssalb(f_index, Np - 2 - ip) = (ext -
abs) / ext;
428 dtauc(f_index, Np - 2 - ip) = ext * (z_profile[ip + 1] - z_profile[ip]);
434 const Index& Npfct) {
435 const Index min_nang = 3;
439 Index this_ss = 0, this_se = 0;
441 for (
Index i_ss = 0; i_ss < scat_data.
nelem(); i_ss++)
442 for (
Index i_se = scat_data[i_ss].
nelem() - 1; i_se >= 0; i_se--)
447 if (nang < scat_data[i_ss][i_se].za_grid.
nelem()) {
448 nang = scat_data[i_ss][i_se].za_grid.
nelem();
452 pfct_angs = scat_data[this_ss][this_se].za_grid;
453 }
else if (Npfct < min_nang) {
455 os <<
"Number of requested angular grid points (Npfct=" << Npfct
456 <<
") is insufficient.\n" 457 <<
"At least " << min_nang <<
" points required.\n";
458 throw runtime_error(os.
str());
477 Vector T_array = t_profile[
Range(cloudbox_limits[0], Np_cloud)];
478 Matrix idir_array(1, 2, 0.);
480 Matrix pdir_array(nang, 2, 0.);
481 pdir_array(
joker, 0) = pfct_angs;
510 pha_mat_Bulk(pha_mat_bulk, ptype_bulk, pha_mat_ssbulk, ptype_ssbulk);
521 const Index Np_cloud = cloudbox_limits[1] - cloudbox_limits[0] + 1;
526 assert(pfct_bulk_par.
npages() == nf);
527 assert(pfct_bulk_par.
nrows() == Np - 1);
528 assert(pfct_bulk_par.
ncols() == nang);
533 for (
Index ip = cloudbox_limits[0]; ip < Np_cloud - 1; ip++)
534 for (
Index f_index = 0; f_index < nf; f_index++) {
538 (ext_bulk_par(f_index, ip) + ext_bulk_par(f_index, ip + 1)) -
539 (abs_bulk_par(f_index, ip) + abs_bulk_par(f_index, ip + 1));
543 for (
Index ia = 0; ia < nang; ia++)
544 pfct_bulk_par(f_index, Np - 2 - ip, ia) +=
545 pha_bulk_par(f_index, ip, ia) + pha_bulk_par(f_index, ip + 1, ia);
546 pfct_bulk_par(f_index, Np - 2 - ip,
joker) *= 4 *
PI / sca;
554 const Index& Nlegendre) {
559 assert(nang == pfct_angs.
nelem());
561 assert(pmom.
npages() == nf);
562 assert(pmom.
nrows() == nlyr);
563 assert(pmom.
ncols() == Nlegendre);
571 Vector u(nang), adu(nang - 1);
572 Tensor3 px(nang - 1, Nlegendre, 2, 0.);
573 u[0] = cos(pfct_angs[0] *
PI / 180.);
575 for (
Index ia = 1; ia < nang; ia++) {
576 u[ia] = cos(pfct_angs[ia] *
PI / 180.);
577 adu[ia - 1] =
abs(u[ia] - u[ia - 1]);
578 px(ia - 1, 1, 0) = u[ia - 1];
579 px(ia - 1, 1, 1) = u[ia];
580 for (
Index l = 2; l < Nlegendre; l++) {
582 px(ia - 1, l, 0) = (2 * dl - 1) / dl * u[ia - 1] * px(ia - 1, l - 1, 0) -
583 (dl - 1) / dl * px(ia - 1, l - 2, 0);
584 px(ia - 1, l, 1) = (2 * dl - 1) / dl * u[ia] * px(ia - 1, l - 1, 1) -
585 (dl - 1) / dl * px(ia - 1, l - 2, 1);
589 for (
Index il = 0; il < nlyr; il++)
590 if (pfct_bulk_par(
joker, il, 0).sum() != 0.)
591 for (
Index f_index = 0; f_index < nf; f_index++) {
592 if (pfct_bulk_par(f_index, il, 0) != 0) {
597 for (
Index ia = 0; ia < nang - 1; ia++)
598 pint += 0.5 * adu[ia] * (pfct[ia] + pfct[ia + 1]);
600 if (
abs(pint / 2. - 1.) > pfct_threshold) {
602 os <<
"Phase function normalization deviates from expected value by\n" 603 << 1e2 * pint / 2. - 1e2 <<
"(allowed: " << pfct_threshold * 1e2
605 <<
"Occurs at layer #" << il <<
" and frequency #" << f_index
607 <<
"Something is wrong with your scattering data. Check!\n";
608 throw runtime_error(os.
str());
614 pmom(f_index, il, 0) = 1.;
615 for (
Index ia = 0; ia < nang - 1; ia++) {
617 for (
Index l = 1; l < Nlegendre; l++)
618 pmom(f_index, il, l) +=
620 (px(ia, l, 0) * pfct[ia] + px(ia, l, 1) * pfct[ia + 1]);
633 #define MAX_WARNINGS 100 638 static int warning_limit = FALSE, num_warnings = 0;
640 if (type == DS_ERROR) {
642 out0 <<
" ******* ERROR >>>>>> " << messag <<
"\n";
646 if (warning_limit)
return;
650 out1 <<
" ******* WARNING >>>>>> " << messag <<
"\n";
653 out1 <<
" >>>>>> TOO MANY WARNING MESSAGES -- They will no longer be " 654 "printed <<<<<<<\n\n";
655 warning_limit = TRUE;
665 const int maxmsg = 50;
666 static int nummsg = 0;
669 if (quiet != QUIET) {
672 out1 <<
" **** Input variable " << varnam <<
" in error ****\n";
673 if (nummsg == maxmsg) {
674 c_errmsg(
"Too many input errors. Aborting...", DS_ERROR);
683 if (quiet != QUIET) {
686 out1 <<
" **** Symbolic dimension " << dimnam
687 <<
" should be increased to at least " << minval <<
" ****\n";
708 if (
abs(z_surface - z_profile[0]) < 1e-3) {
714 cboxlims = cloudbox_limits;
722 for (; z_surface >= z_profile[ifirst + 1]; ifirst++) {
726 Range ind(ifirst, np);
730 vmr = vmr_profiles(
joker, ind);
735 gridpos(gp[0], z_profile, z_surface);
739 t[0] =
interp(itw, t, gp[0]);
740 for (
int i = 0;
i < vmr.
nrows();
i++) {
747 itw2p(p[0], p, gp, itw2);
749 cboxlims = cloudbox_limits;
750 if (ifirst < cloudbox_limits[0]) {
751 cboxlims[0] -= ifirst;
752 cboxlims[1] -= ifirst;
756 ncboxremoved = ifirst - cboxlims[0];
758 cboxlims[1] = cloudbox_limits[1] - cloudbox_limits[0] - ncboxremoved;
759 ind =
Range(ncboxremoved, cboxlims[1] + 1);
760 pnd = pnd_profiles(
joker, ind);
761 gp[0].idx -= cloudbox_limits[0] + ncboxremoved;
762 for (
int i = 0;
i < pnd.
nrows();
i++) {
779 const Agenda& propmat_clearsky_agenda,
782 const Vector& surface_scalar_reflectivity,
784 const Index& nstreams,
813 disort_verbosity = verbosity;
820 ds.flag.prnt[0] = FALSE;
821 ds.flag.prnt[1] = FALSE;
822 ds.flag.prnt[2] = FALSE;
823 ds.flag.prnt[3] = FALSE;
824 ds.flag.prnt[4] = TRUE;
826 ds.flag.usrtau = FALSE;
827 ds.flag.usrang = TRUE;
828 ds.flag.spher = FALSE;
829 ds.flag.general_source = FALSE;
830 ds.flag.output_uum = FALSE;
832 ds.nlyr =
static_cast<int>(p.
nelem() - 1);
834 ds.flag.brdf_type = BRDF_NONE;
836 ds.flag.ibcnd = GENERAL_BC;
837 ds.flag.usrang = TRUE;
838 ds.flag.planck = TRUE;
839 ds.flag.onlyfl = FALSE;
840 ds.flag.lamber = TRUE;
841 ds.flag.quiet = FALSE;
842 ds.flag.intensity_correction = TRUE;
843 ds.flag.old_intensity_correction = TRUE;
845 ds.nstr =
static_cast<int>(nstreams);
849 ds.numu =
static_cast<int>(za_grid.
nelem());
851 Index Nlegendre = nstreams + 1;
854 c_disort_state_alloc(&ds);
855 c_disort_out_alloc(&ds, &out);
866 for (
Index i = 0;
i <= ds.nlyr;
i++) ds.temper[
i] = t[ds.nlyr -
i];
868 Matrix ext_bulk_gas(nf, ds.nlyr + 1);
869 get_gasoptprop(ws, ext_bulk_gas, propmat_clearsky_agenda, t, vmr, p, f_grid);
870 Matrix ext_bulk_par(nf, ds.nlyr + 1), abs_bulk_par(nf, ds.nlyr + 1);
872 ext_bulk_par, abs_bulk_par, scat_data, pnd, t, p, cboxlims, f_grid);
875 Matrix dtauc(nf, ds.nlyr);
877 Matrix ssalb(nf, ds.nlyr);
878 get_dtauc_ssalb(dtauc, ssalb, ext_bulk_gas, ext_bulk_par, abs_bulk_par, z);
881 for (
Index i = 0;
i < ds.numu;
i++) ds.umu[
i] = -cos(za_grid[
i] *
PI / 180);
900 ds.bc.btemp = surface_skin_t;
904 get_angs(pfct_angs, scat_data, Npfct);
907 Index nf_ssd = scat_data[0][0].f_grid.
nelem();
908 Tensor3 pha_bulk_par(nf_ssd, ds.nlyr + 1, nang);
909 get_parZ(pha_bulk_par, scat_data, pnd, t, pfct_angs, cboxlims);
910 Tensor3 pfct_bulk_par(nf_ssd, ds.nlyr, nang);
911 get_pfct(pfct_bulk_par, pha_bulk_par, ext_bulk_par, abs_bulk_par, cboxlims);
914 Tensor3 pmom(nf_ssd, ds.nlyr, Nlegendre, 0.);
915 get_pmom(pmom, pfct_bulk_par, pfct_angs, Nlegendre);
917 for (
Index f_index = 0; f_index < f_grid.
nelem(); f_index++) {
918 sprintf(ds.header,
"ARTS Calc f_index = %ld", f_index);
920 std::memcpy(ds.dtauc,
921 dtauc(f_index,
joker).get_c_array(),
923 std::memcpy(ds.ssalb,
924 ssalb(f_index,
joker).get_c_array(),
928 ds.wvnmhi = ds.wvnmlo = (f_grid[f_index]) / (100. *
SPEED_OF_LIGHT);
929 ds.wvnmhi += ds.wvnmhi * 1e-7;
930 ds.wvnmlo -= ds.wvnmlo * 1e-7;
932 ds.bc.albedo = surface_scalar_reflectivity[f_index];
940 for (
Index j = 0; j < ds.numu; j++) {
941 for (
Index k = cboxlims[1] - cboxlims[0]; k >= 0; k--) {
942 cloudbox_field(f_index, k + ncboxremoved, 0, 0, j, 0, 0) =
943 out.uu[ds.numu * (ds.nlyr - k - cboxlims[0]) + j] /
948 for (
Index k = ncboxremoved - 1; k >= 0; k--) {
949 cloudbox_field(f_index, k, 0, 0, j, 0, 0) =
950 cloudbox_field(f_index, k + 1, 0, 0, j, 0, 0);
956 c_disort_out_free(&ds, &out);
957 c_disort_state_free(&ds);
965 const Agenda& surface_rtprop_agenda,
1001 chk_not_empty(
"surface_rtprop_agenda", surface_rtprop_agenda);
1005 while (frza < scat_za_grid.
nelem() && scat_za_grid[frza] < 90.) frza++;
1006 if (frza == scat_za_grid.
nelem()) {
1008 os <<
"No upwelling direction found in scat_za_grid.\n";
1009 throw runtime_error(os.
str());
1011 const Index nrza = scat_za_grid.
nelem() - frza;
1014 Matrix dir_refl_coeff(nrza, nf, 0.);
1017 Vector rtp_pos(1, surf_alt);
1021 for (
Index rza = 0; rza < nrza; rza++) {
1028 Vector rtp_los(1, scat_za_grid[rza + frza]);
1029 out2 <<
"Doing reflected dir #" << rza <<
" at " << rtp_los[0] <<
" degs\n";
1039 surface_rtprop_agenda);
1042 assert(surface_los.
ncols() == 1 || surface_los.
nrows() == 0);
1044 btemp = surface_skin_t;
1045 else if (surface_skin_t != btemp) {
1047 os <<
"Something went wrong.\n" 1048 <<
" *surface_rtprop_agenda* returned different surface_skin_t\n" 1049 <<
" for different LOS.\n";
1050 throw runtime_error(os.
str());
1052 if (surface_los.
nrows() > 0) {
1053 for (
Index f_index = 0; f_index < nf; f_index++)
1054 dir_refl_coeff(rza, f_index) =
1055 surface_rmatrix(
joker, f_index, 0, 0).sum();
1057 out2 <<
" directional albedos[f_grid] = " << dir_refl_coeff(rza,
joker)
1061 if (btemp < 0. || btemp > 1000.) {
1063 os <<
"Surface temperature has been derived as " << btemp <<
" K,\n" 1064 <<
"which is not considered a meaningful value.\n";
1065 throw runtime_error(os.
str());
1072 Vector surf_int_grid(nrza + 1);
1079 os <<
"Looks like scat_za_grid contains the 90deg direction,\n" 1080 <<
"which it shouldn't for running Disort.\n";
1081 throw runtime_error(os.
str());
1083 Numeric za_extrapol = (scat_za_grid[frza] - 90.) /
1084 (scat_za_grid[frza + 1] - scat_za_grid[frza]);
1085 const Numeric ok_extrapol = 0.5;
1086 if ((za_extrapol - ok_extrapol) > 1e-6) {
1088 os <<
"Extrapolation range from shallowest scat_za_grid point\n" 1089 <<
"to horizon is too big.\n" 1090 <<
" Allowed extrapolation factor is 0.5.\n Yours is " << za_extrapol
1091 <<
", which is " << za_extrapol - 0.5 <<
" too big.\n";
1092 throw runtime_error(os.
str());
1095 scat_za_grid[scat_za_grid.
nelem() - 1], 180., 1e-6)) {
1097 os <<
"Looks like last point in scat_za_grid is not 180deg.\n";
1098 throw runtime_error(os.
str());
1101 surf_int_grid[0] = 90.;
1102 surf_int_grid[nrza] = 180.;
1103 for (
Index rza = 1; rza < nrza; rza++)
1104 surf_int_grid[rza] =
1105 0.5 * (scat_za_grid[frza + rza - 1] + scat_za_grid[frza + rza]);
1109 for (
Index rza = 0; rza < nrza; rza++) {
1114 0.5 * (cos(2. * surf_int_grid[rza + 1]) - cos(2. * surf_int_grid[rza]));
1120 dir_refl_coeff(rza,
joker) *=
w;
1125 for (
Index f_index = 0; f_index < nf; f_index++) {
1126 albedo[f_index] = dir_refl_coeff(
joker, f_index).sum();
1127 out2 <<
"at f=" << f_grid[f_index] * 1e-9
1128 <<
" GHz, ending up with albedo=" << albedo[f_index] <<
"\n";
1129 if (albedo[f_index] < 0 || albedo[f_index] > 1.) {
1131 os <<
"Something went wrong: Albedo must be inside [0,1],\n" 1132 <<
" but is not at freq #" << f_index <<
" , where it is " 1133 << albedo[f_index] <<
".\n";
1134 throw runtime_error(os.
str());
INDEX Index
The type to use for all integer numbers and indices.
void surface_rtprop_agendaExecute(Workspace &ws, Numeric &surface_skin_t, Matrix &surface_emission, Matrix &surface_los, Tensor4 &surface_rmatrix, const Vector &f_grid, const Vector &rtp_pos, const Vector &rtp_los, const Agenda &input_agenda)
void c_errmsg(const char *messag, int type)
Verbosity enabled replacement for the original cdisort function.
Index nelem() const
Number of elements.
void arts_exit(int status)
This is the exit function of ARTS.
void pha_mat_NScatElems(ArrayOfArrayOfTensor6 &pha_mat, ArrayOfArrayOfIndex &ptypes, Matrix &t_ok, const ArrayOfArrayOfSingleScatteringData &scat_data, const Index &stokes_dim, const Vector &T_array, const Matrix &pdir_array, const Matrix &idir_array, const Index &f_index, const Index &t_interp_order)
Phase matrices from all scattering elements.
void get_pmom(Tensor3View pmom, ConstTensor3View pfct_bulk_par, ConstVectorView pfct_angs, const Index &Nlegendre)
get_pmom
Declarations having to do with the four output streams.
void run_cdisort(Workspace &ws, Tensor7 &cloudbox_field, ConstVectorView f_grid, ConstVectorView p_grid, ConstVectorView z_profile, const Numeric &z_surface, ConstVectorView t_profile, ConstMatrixView vmr_profiles, ConstMatrixView pnd_profiles, const ArrayOfArrayOfSingleScatteringData &scat_data, const Agenda &propmat_clearsky_agenda, const ArrayOfIndex &cloudbox_limits, const Numeric &surface_skin_t, const Vector &surface_scalar_reflectivity, ConstVectorView za_grid, const Index &nstreams, const Index &Npfct, const Index &quiet, const Verbosity &verbosity)
Calculate doit_i_feild with Disort.
int c_write_too_small_dim(int quiet, const char *dimnam, int minval)
Verbosity enabled replacement for the original cdisort function.
Numeric interp(ConstVectorView itw, ConstVectorView a, const GridPos &tc)
Red 1D Interpolate.
void surf_albedoCalc(Workspace &ws, VectorView albedo, Numeric &btemp, const Agenda &surface_rtprop_agenda, ConstVectorView f_grid, ConstVectorView scat_za_grid, const Numeric &surf_alt, const Verbosity &verbosity)
Surface albed.
void get_gasoptprop(Workspace &ws, MatrixView ext_bulk_gas, const Agenda &propmat_clearsky_agenda, ConstVectorView t_profile, ConstMatrixView vmr_profiles, ConstVectorView p_grid, ConstVectorView f_grid)
get_gasoptprop.
bool is_increasing(ConstVectorView x)
Checks if a vector is sorted and strictly increasing.
void get_disortsurf_props(Vector &albedo, Numeric &btemp, ConstVectorView f_grid, const Numeric &surface_skin_t, ConstVectorView surface_scalar_reflectivity)
get_disortsurf_props.
Array< RetrievalQuantity > ArrayOfRetrievalQuantity
void get_pfct(Tensor3 &pfct_bulk_par, ConstTensor3View &pha_bulk_par, ConstMatrixView ext_bulk_par, ConstMatrixView abs_bulk_par, const ArrayOfIndex &cloudbox_limits)
get_pfct.
void reduced_1datm(Vector &p, Vector &z, Vector &t, Matrix &vmr, Matrix &pnd, ArrayOfIndex &cboxlims, Index &ncboxremoved, ConstVectorView p_grid, ConstVectorView z_profile, const Numeric &z_surface, ConstVectorView t_profile, ConstMatrixView vmr_profiles, ConstMatrixView pnd_profiles, const ArrayOfIndex &cloudbox_limits)
reduced_1datm
cmplx FADDEEVA() w(cmplx z, double relerr)
void opt_prop_Bulk(Tensor5 &ext_mat, Tensor4 &abs_vec, Index &ptype, const ArrayOfTensor5 &ext_mat_ss, const ArrayOfTensor4 &abs_vec_ss, const ArrayOfIndex &ptypes_ss)
one-line descript
void check_disort_input(const Index &cloudbox_on, const Index &atmfields_checked, const Index &atmgeom_checked, const Index &cloudbox_checked, const Index &scat_data_checked, const Index &atmosphere_dim, const Index &stokes_dim, const ArrayOfIndex &cloudbox_limits, const ArrayOfArrayOfSingleScatteringData &scat_data, ConstVectorView za_grid, const Index &nstreams, const String &pfct_method)
check_disort_input.
This file contains basic functions to handle XML data files.
Header file for interpolation.cc.
Index nrows() const
Returns the number of rows.
void get_angs(Vector &pfct_angs, const ArrayOfArrayOfSingleScatteringData &scat_data, const Index &Npfct)
get_angs.
void get_dtauc_ssalb(MatrixView dtauc, MatrixView ssalb, ConstMatrixView ext_bulk_gas, ConstMatrixView ext_bulk_par, ConstMatrixView abs_bulk_par, ConstVectorView z_profile)
get_dtauc_ssalb
void get_parZ(Tensor3 &pha_bulk_par, const ArrayOfArrayOfSingleScatteringData &scat_data, ConstMatrixView pnd_profiles, ConstVectorView t_profile, ConstVectorView pfct_angs, const ArrayOfIndex &cloudbox_limits)
get_parZ.
Index nelem() const
Returns the number of elements.
This file contains the definition of Array.
Index ncols() const
Returns the number of columns.
void pha_mat_ScatSpecBulk(ArrayOfTensor6 &pha_mat, ArrayOfIndex &ptype, const ArrayOfArrayOfTensor6 &pha_mat_se, const ArrayOfArrayOfIndex &ptypes_se, ConstMatrixView pnds, ConstMatrixView t_ok)
Scattering species bulk phase matrices.
bool is_same_within_epsilon(const Numeric &a, const Numeric &b, const Numeric &epsilon)
Check, if two numbers agree within a given epsilon.
_CS_string_type str() const
Index ncols() const
Returns the number of columns.
Declarations for agendas.
void nlinspace(Vector &x, const Numeric start, const Numeric stop, const Index n)
nlinspace
void get_paroptprop(MatrixView ext_bulk_par, MatrixView abs_bulk_par, const ArrayOfArrayOfSingleScatteringData &scat_data, ConstMatrixView pnd_profiles, ConstVectorView t_profile, ConstVectorView DEBUG_ONLY(p_grid), const ArrayOfIndex &cloudbox_limits, ConstVectorView f_grid)
void gridpos(ArrayOfGridPos &gp, ConstVectorView old_grid, ConstVectorView new_grid, const Numeric &extpolfac)
Set up a grid position Array.
const Numeric SPEED_OF_LIGHT
NUMERIC Numeric
The type to use for all floating point numbers.
void init_ifield(Tensor7 &cloudbox_field, const Vector &f_grid, const ArrayOfIndex &cloudbox_limits, const Index &nang, const Index &stokes_dim)
init_ifield.
Header file for logic.cc.
Index npages() const
Returns the number of pages.
This can be used to make arrays out of anything.
void opt_prop_ScatSpecBulk(ArrayOfTensor5 &ext_mat, ArrayOfTensor4 &abs_vec, ArrayOfIndex &ptype, const ArrayOfArrayOfTensor5 &ext_mat_se, const ArrayOfArrayOfTensor4 &abs_vec_se, const ArrayOfArrayOfIndex &ptypes_se, ConstMatrixView pnds, ConstMatrixView t_ok)
Scattering species bulk extinction and absorption.
VectorView Kjj(const Index iz=0, const Index ia=0)
Vector view to diagonal elements.
A constant view of a Tensor3.
A constant view of a Vector.
Index nelem(const Lines &l)
Number of lines.
String PTypeToString(const PType &ptype)
Convert particle type enum value to String.
A constant view of a Matrix.
Index nbooks() const
Returns the number of books.
thread_local Verbosity disort_verbosity
void opt_prop_NScatElems(ArrayOfArrayOfTensor5 &ext_mat, ArrayOfArrayOfTensor4 &abs_vec, ArrayOfArrayOfIndex &ptypes, Matrix &t_ok, const ArrayOfArrayOfSingleScatteringData &scat_data, const Index &stokes_dim, const Vector &T_array, const Matrix &dir_array, const Index &f_index, const Index &t_interp_order)
Extinction and absorption from all scattering elements.
const Numeric PLANCK_CONST
const Numeric COSMIC_BG_TEMP
void pha_mat_Bulk(Tensor6 &pha_mat, Index &ptype, const ArrayOfTensor6 &pha_mat_ss, const ArrayOfIndex &ptypes_ss)
Scattering species bulk phase matrix.
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)
void interpweights(VectorView itw, const GridPos &tc)
Red 1D interpolation weights.
void resize(Index l, Index v, Index s, Index b, Index p, Index r, Index c)
Resize function.
Functions for disort interface.
int c_write_bad_var(int quiet, const char *varnam)
Verbosity enabled replacement for the original cdisort function.
Index nrows() const
Returns the number of rows.
void itw2p(VectorView p_values, ConstVectorView p_grid, const ArrayOfGridPos &gp, ConstMatrixView itw)
Converts interpolation weights to pressures.
Declaration of functions in rte.cc.