77 for (
Index iD = 0; iD < nD; iD++) d_um[iD] = 1e6 * diameter[iD];
85 Numeric sig_a = 0., sig_b1 = 0.;
86 Numeric sig_b2 = 0., sig_m = 0.;
87 Numeric sig_aamu = 0., sig_bamu = 0.;
88 Numeric sig_abmu = 0., sig_bbmu = 0.;
89 Numeric sig_aasigma = 0., sig_basigma = 0;
90 Numeric sig_absigma = 0., sig_bbsigma = 0.;
95 mc_seed = (
Index)time(NULL);
98 sig_a = 0.068, sig_b1 = 0.054;
99 sig_b2 = 5.5e-3, sig_m = 0.0029;
100 sig_aamu = 0.02, sig_bamu = 0.0005;
101 sig_abmu = 0.023, sig_bbmu = 0.5e-3;
102 sig_aasigma = 0.02, sig_basigma = 0.5e-3;
103 sig_absigma = 0.023, sig_bbsigma = 4.7e-4;
125 Numeric IWCl100 = ciwc - IWCs100;
131 Numeric alphas100 =
b2 - m * log10(IWCs100);
141 if (alphas100 > 0.) {
142 Numeric Ns100 = 6 * IWCs100 *
pow(alphas100, 5.) /
143 (
PI * cdensity * tgamma(5.));
144 for (
Index iD = 0; iD < nD; iD++)
145 dNdD1[iD] = 1e18 * Ns100 * d_um[iD] *
146 exp(-alphas100 * d_um[iD]);
157 Numeric aamu = 5.20 + sig_aamu;
158 Numeric bamu = 0.0013 + sig_bamu;
159 Numeric abmu = 0.026 + sig_abmu;
160 Numeric bbmu = -1.2e-3 + sig_bbmu;
161 Numeric amu = aamu + bamu * Tc;
162 Numeric bmu = abmu + bbmu * Tc;
163 Numeric mul100 = amu + bmu * log10(IWCl100);
165 Numeric aasigma = 0.47 + sig_aasigma;
166 Numeric basigma = 2.1e-3 + sig_basigma;
167 Numeric absigma = 0.018 + sig_absigma;
168 Numeric bbsigma = -2.1e-4 + sig_bbsigma;
169 Numeric asigma = aasigma + basigma * Tc;
170 Numeric bsigma = absigma + bbsigma * Tc;
171 Numeric sigmal100 = asigma + bsigma * log10(IWCl100);
173 if ((mul100 > 0.) & (sigmal100 > 0.)) {
176 exp(3 * mul100 + 9. / 2. *
pow(sigmal100, 2)) *
177 sigmal100 *
pow(1., 3);
179 for (
Index iD = 0; iD < nD; iD++)
180 dNdD2[iD] = 1e18 *
a1 / (a2_fac * d_um[iD]) *
181 exp(-0.5 *
pow((log(d_um[iD]) - mul100) / sigmal100, 2));
186 for (
Index iD = 0; iD < nD; iD++) {
191 psd[iD] = (dNdD1[iD] + dNdD2[iD]) * 1e6;
198 const Vector& psd_size_grid,
199 const Vector& pnd_agenda_input_t,
200 const Matrix& pnd_agenda_input,
217 if (nin < 1 || nin > 4)
219 "The number of columns in *pnd_agenda_input* must "
221 if (scat_species_a <= 0)
222 throw runtime_error(
"*scat_species_a* should be > 0.");
223 if (scat_species_b <= 0 || scat_species_b >= 5)
224 throw runtime_error(
"*scat_species_b* should be > 0 and < 5.");
232 if (n0_depend + mu_depend + la_depend + ga_depend != 2)
234 "Two (but only two) of n0, mu, la and ga must be NaN, "
235 "to flag that these parameters are the ones dependent of "
236 "mass content and mean particle size.");
237 if (mu_depend || ga_depend)
239 "Sorry, mu and la are not yet allowed to be a "
240 "dependent parameter.");
247 if (nin + n0_fixed + mu_fixed + la_fixed + ga_fixed != 4)
249 "This PSD has four free parameters. This means that "
250 "the number\nof columns in *pnd_agenda_input* and the "
251 "number of numerics\n(i.e. not -999 or NaN) and among "
252 "the GIN arguments n0, mu, la and\nga must add up to "
253 "four. And this was found not to be the case.");
256 Vector mgd_pars(4), ext_pars(2);
263 }
else if (!n0_depend) {
264 mgd_i_pai[0] = nhit++;
268 }
else if (!mu_depend) {
269 mgd_i_pai[1] = nhit++;
273 }
else if (!la_depend) {
274 mgd_i_pai[2] = nhit++;
278 }
else if (!ga_depend) {
279 mgd_i_pai[3] = nhit++;
295 for (
Index i = 0; i < ndx; i++) {
300 }
else if (dx2in[i] == 1)
306 for (
Index j = 0; j < 4; j++) {
307 if (dx2in[i] == mgd_i_pai[j]) {
317 for (
Index ip = 0; ip < np; ip++) {
320 ext_pars[0] = pnd_agenda_input(ip, ext_i_pai[0]);
323 if ((ext_pars[0] == 0.) && (!ndx)) {
328 ext_pars[1] = pnd_agenda_input(ip, ext_i_pai[1]);
329 if (ext_pars[1] <= 0) {
331 os <<
"Negative or zero " << something <<
" found in a position where "
332 <<
"this is not allowed.";
334 os <<
"\nNote that for retrievals, " << something
335 <<
" must be set to a value > 0 even where\nmass is zero.";
336 throw std::runtime_error(os.str());
340 for (
Index i = 0; i < 4; i++) {
341 if (mgd_i_pai[i] >= 0) {
342 mgd_pars[i] = pnd_agenda_input(ip, mgd_i_pai[i]);
345 Numeric t = pnd_agenda_input_t[ip];
348 if (t < t_min || t > t_max) {
351 os <<
"Method called with a temperature of " << t <<
" K.\n"
352 <<
"This is outside the specified allowed range: [ max(0.," << t_min
353 <<
"), " << t_max <<
" ]";
354 throw runtime_error(os.str());
362 Numeric mu1 = 0, mub1 = 0, eterm = 0, gterm = 0;
363 Numeric scfac1 = 0, scfac2 = 0, gab = 0;
366 if (something ==
"mean size") {
367 if (n0_depend && la_depend) {
368 mub1 = mgd_pars[1] + scat_species_b + 1;
370 throw runtime_error(
"Bad MGD parameter detected: mu + b + 1 <= 0");
371 eterm = mub1 / mgd_pars[3];
373 gterm = tgamma(eterm);
374 scfac2 =
pow(tgamma(eterm+1/ga)/gterm, mgd_pars[3]);
375 mgd_pars[2] = scfac2 *
pow(ext_pars[1], -mgd_pars[3]);
378 (mgd_pars[3] *
pow(mgd_pars[2], eterm)) / (scat_species_a * gterm);
379 mgd_pars[0] = scfac1 * ext_pars[0];
386 else if (something ==
"median size") {
387 if (n0_depend && la_depend) {
388 mub1 = mgd_pars[1] + scat_species_b + 1;
390 throw runtime_error(
"Bad MGD parameter detected: mu + b + 1 <= 0");
391 eterm = mub1 / mgd_pars[3];
393 scfac2 = (mgd_pars[1] + 1 + scat_species_b - 0.327 * mgd_pars[3]) /
395 mgd_pars[2] = scfac2 *
pow(ext_pars[1], -mgd_pars[3]);
397 gterm = tgamma(eterm);
399 (mgd_pars[3] *
pow(mgd_pars[2], eterm)) / (scat_species_a * gterm);
400 mgd_pars[0] = scfac1 * ext_pars[0];
407 else if (something ==
"mean particle mass") {
408 if (n0_depend && la_depend) {
409 mu1 = mgd_pars[1] + 1;
411 throw runtime_error(
"Bad MGD parameter detected: mu + 1 <= 0");
412 eterm = (mgd_pars[1] + scat_species_b + 1) / mgd_pars[3];
413 gterm = tgamma(eterm);
415 gab = mgd_pars[3] / scat_species_b;
416 scfac2 =
pow(scat_species_a * gterm / tgamma(mu1 / mgd_pars[3]), gab);
417 mgd_pars[2] = scfac2 *
pow(ext_pars[1], -gab);
420 (mgd_pars[3] *
pow(mgd_pars[2], eterm)) / (scat_species_a * gterm);
421 mgd_pars[0] = scfac1 * ext_pars[0];
427 else if (something ==
"Ntot") {
428 if (n0_depend && la_depend) {
429 mu1 = mgd_pars[1] + 1;
431 throw runtime_error(
"Bad MGD parameter detected: mu + 1 <= 0");
432 eterm = (mgd_pars[1] + scat_species_b + 1) / mgd_pars[3];
433 gterm = tgamma(eterm);
435 gab = mgd_pars[3] / scat_species_b;
436 scfac2 =
pow(scat_species_a * gterm / tgamma(mu1 / mgd_pars[3]), gab);
437 mgd_pars[2] = scfac2 *
pow(ext_pars[1] / ext_pars[0], gab);
440 (mgd_pars[3] *
pow(mgd_pars[2], eterm)) / (scat_species_a * gterm);
441 mgd_pars[0] = scfac1 * ext_pars[0];
453 if (mgd_pars[2] <= 0)
454 throw runtime_error(
"Bad MGD parameter detected: la <= 0");
455 if (mgd_pars[3] <= 0)
456 throw runtime_error(
"Bad MGD parameter detected: ga <= 0");
467 (
bool)mgd_do_jac[0] || n0_depend,
468 (
bool)mgd_do_jac[1] || mu_depend,
469 (
bool)mgd_do_jac[2] || la_depend,
470 (
bool)mgd_do_jac[3] || ga_depend);
473 if (ext_do_jac[0] | ext_do_jac[1]) {
475 if (something ==
"mean size") {
476 if (n0_depend && la_depend) {
479 dpsd_data_dx(ext_i_jac[0], ip,
joker) = jac_data(0,
joker);
480 dpsd_data_dx(ext_i_jac[0], ip,
joker) *= scfac1;
486 dpsd_data_dx(ext_i_jac[1], ip,
joker) = jac_data(0,
joker);
487 dpsd_data_dx(ext_i_jac[1], ip,
joker) *=
488 ext_pars[0] * mgd_pars[3] * eterm *
489 pow(mgd_pars[2], eterm - 1) / (scat_species_a * gterm);
492 dpsd_data_dx(ext_i_jac[1], ip,
joker) += jac_data(2,
joker);
494 dpsd_data_dx(ext_i_jac[1], ip,
joker) *=
495 -mgd_pars[3] * scfac2 *
pow(ext_pars[1], -(mgd_pars[3] + 1));
503 else if (something ==
"median size") {
504 if (n0_depend && la_depend) {
507 dpsd_data_dx(ext_i_jac[0], ip,
joker) = jac_data(0,
joker);
508 dpsd_data_dx(ext_i_jac[0], ip,
joker) *= scfac1;
514 dpsd_data_dx(ext_i_jac[1], ip,
joker) = jac_data(0,
joker);
515 dpsd_data_dx(ext_i_jac[1], ip,
joker) *=
516 ext_pars[0] * mgd_pars[3] * eterm *
517 pow(mgd_pars[2], eterm - 1) / (scat_species_a * gterm);
520 dpsd_data_dx(ext_i_jac[1], ip,
joker) += jac_data(2,
joker);
522 dpsd_data_dx(ext_i_jac[1], ip,
joker) *=
523 -mgd_pars[3] * scfac2 *
pow(ext_pars[1], -(mgd_pars[3] + 1));
531 else if (something ==
"mean particle mass") {
532 if (n0_depend && la_depend) {
535 dpsd_data_dx(ext_i_jac[0], ip,
joker) = jac_data(0,
joker);
536 dpsd_data_dx(ext_i_jac[0], ip,
joker) *= scfac1;
542 dpsd_data_dx(ext_i_jac[1], ip,
joker) = jac_data(0,
joker);
543 dpsd_data_dx(ext_i_jac[1], ip,
joker) *=
544 ext_pars[0] * mgd_pars[3] * eterm *
545 pow(mgd_pars[2], eterm - 1) / (scat_species_a * gterm);
548 dpsd_data_dx(ext_i_jac[1], ip,
joker) += jac_data(2,
joker);
550 dpsd_data_dx(ext_i_jac[1], ip,
joker) *=
551 scfac2 * (-mgd_pars[3] / scat_species_b) *
552 pow(ext_pars[1], -(gab + 1));
559 else if (something ==
"Ntot") {
560 if (n0_depend && la_depend) {
562 const Numeric dn0dla = ext_pars[0] * mgd_pars[3] * eterm *
563 pow(mgd_pars[2], eterm - 1) /
564 (scat_species_a * gterm);
568 const Numeric dladw = scfac2 *
pow(ext_pars[1], gab) *
569 (-mgd_pars[3] / scat_species_b) *
570 pow(ext_pars[0], -(gab + 1));
572 dpsd_data_dx(ext_i_jac[0], ip,
joker) = jac_data(0,
joker);
573 dpsd_data_dx(ext_i_jac[0], ip,
joker) *= scfac1 + dn0dla * dladw;
578 dpsd_data_dx(ext_i_jac[0], ip,
joker) += term2;
584 dpsd_data_dx(ext_i_jac[1], ip,
joker) = jac_data(0,
joker);
585 dpsd_data_dx(ext_i_jac[1], ip,
joker) *= dn0dla;
588 dpsd_data_dx(ext_i_jac[1], ip,
joker) += jac_data(2,
joker);
590 dpsd_data_dx(ext_i_jac[1], ip,
joker) *=
591 scfac2 *
pow(ext_pars[0], -gab) *
592 (mgd_pars[3] / scat_species_b) *
pow(ext_pars[1], gab - 1);
606 for (
Index i = 0; i < 4; i++) {
608 dpsd_data_dx(mgd_i_jac[i], ip,
joker) = jac_data(i,
joker);
617 const Vector& pnd_agenda_input_t,
618 const Matrix& pnd_agenda_input,
622 const Index& species_index,
628 const Vector psd_size_grid(1, 0);
633 if (nss == 0)
throw runtime_error(
"*scat_meta* is empty!");
634 if (nss < species_index + 1) {
636 os <<
"Selected scattering species index is " << species_index
638 <<
"is not allowed since *scat_meta* has only " << nss <<
" elements.";
639 throw runtime_error(os.str());
641 if (scat_meta[species_index].
nelem() != 1) {
643 os <<
"This method only works with scattering species consisting of a\n"
644 <<
"single element, but your data do not match this demand.\n"
645 <<
"Selected scattering species index is " << species_index <<
".\n"
646 <<
"This species has " << scat_meta[species_index].
nelem()
648 throw runtime_error(os.str());
651 if (pnd_agenda_input.
ncols() != 1)
652 throw runtime_error(
"*pnd_agenda_input* must have one column.");
655 "This method demands that length of "
656 "*psd_size_grid* is 1.");
660 if (type ==
"mass") {
661 pmass = scat_meta[species_index][0].mass;
664 for (
Index ip = 0; ip < np; ip++) {
666 Numeric x = pnd_agenda_input(ip, 0);
667 Numeric t = pnd_agenda_input_t[ip];
670 if ((x == 0.) && (!ndx)) {
675 if (t < t_min || t > t_max) {
678 os <<
"Method called with a temperature of " << t <<
" K.\n"
679 <<
"This is outside the specified allowed range: [ max(0.," << t_min
680 <<
"), " << t_max <<
" ]";
681 throw runtime_error(os.str());
689 if (type ==
"ntot") {
693 dpsd_data_dx(0, ip, 0) = 1;
695 }
else if (type ==
"mass") {
696 psd_data(ip, 0) = x / pmass;
699 dpsd_data_dx(0, ip, 0) = 1 / pmass;
722 Numeric base = c1 / rwc *
a * tgamma(4);
730 for (
Index iD = 0; iD < nD; iD++) {
731 psd[iD] = N0 * exp(-lambda * diameter[iD]);
738 const Vector& psd_size_grid,
739 const Vector& pnd_agenda_input_t,
740 const Matrix& pnd_agenda_input,
757 if (pnd_agenda_input.
ncols() != 1)
758 throw runtime_error(
"*pnd_agenda_input* must have one column.");
762 if (psd_name ==
"Abel12" || psd_name ==
"Wang16"){
763 if (scat_species_b < 2.9 || scat_species_b > 3.1) {
765 os <<
"This PSD treats rain, using Dveq as size grid.\n"
766 <<
"This means that *scat_species_b* should be close to 3,\n"
767 <<
"but it is outside of the tolerated range of [2.9,3.1].\n"
768 <<
"Your value of *scat_species_b* is: " << scat_species_b;
769 throw runtime_error(os.str());
771 if (scat_species_a < 500 || scat_species_a > 540) {
773 os <<
"This PSD treats rain, using Dveq as size grid.\n"
774 <<
"This means that *scat_species_a* should be close to 520,\n"
775 <<
"but it is outside of the tolerated range of [500,540].\n"
776 <<
"Your value of *scat_species_a* is: " << scat_species_a;
777 throw runtime_error(os.str());
782 if (psd_name ==
"Field19"){
783 if (scat_species_b < 2.8 || scat_species_b > 3.2) {
785 os <<
"This PSD treats graupel, assuming a constant effective density.\n"
786 <<
"This means that *scat_species_b* should be close to 3,\n"
787 <<
"but it is outside of the tolerated range of [2.8,3.2].\n"
788 <<
"Your value of *scat_species_b* is: " << scat_species_b;
789 throw runtime_error(os.str());
793 for (
Index ip = 0; ip < np; ip++) {
795 Numeric water_content = pnd_agenda_input(ip, 0);
796 Numeric t = pnd_agenda_input_t[ip];
799 if ((water_content == 0.) && (!ndx)) {
804 if (t < t_min || t > t_max) {
807 os <<
"Method called with a temperature of " << t <<
" K.\n"
808 <<
"This is outside the specified allowed range: [ max(0.," << t_min
809 <<
"), " << t_max <<
" ]";
810 throw runtime_error(os.str());
818 if (water_content < 0) {
820 water_content *= -1.0;
828 if (psd_name ==
"Abel12"){
834 else if (psd_name ==
"Wang16"){
841 else if (psd_name ==
"Field19"){
847 else if (psd_name ==
"generic"){
848 n_alpha = n_alpha_in;
859 Numeric k = (scat_species_b + mu + 1 - gamma)/gamma;
860 Numeric expo = 1.0 / (n_b - k - 1);
861 Numeric denom = scat_species_a * n_alpha * tgamma(k + 1);
862 Numeric lam =
pow(water_content*gamma/denom, expo);
868 if (water_content != 0) {
878 for (
Index i = 0; i < nsi; i++) {
879 psd_data(ip, i) = psd_weight * psd_1p[i];
884 const Numeric dlam_dwc =
pow(gamma/denom, expo) * expo *
pow(water_content, expo-1);
885 const Numeric dn_0_dwc = n_alpha * n_b *
pow(lam, n_b-1) * dlam_dwc;
886 for (
Index i = 0; i < nsi; i++) {
887 dpsd_data_dx(0, ip, i) = psd_weight * (jac_data(0,i)*dn_0_dwc +
888 jac_data(2,i)*dlam_dwc);
925 q = {152., -12.4, 3.28, -0.78, -1.94};
927 q = {141., -16.8, 102., 2.07, -4.82};
930 Vector Aq{13.6, -7.76, 0.479};
931 Vector Bq{-0.0361, 0.0151, 0.00149};
932 Vector Cq{0.807, 0.00581, 0.0457};
941 An = exp(Aq[0] + Aq[1] *
beta + Aq[2] *
pow(
beta, 2));
945 base = M2 * exp(-Bn * Tc) / An;
955 An = exp(Aq[0] + Aq[1] * n + Aq[2] *
pow(n, 2));
956 Bn = Bq[0] + Bq[1] * n + Bq[2] *
pow(n, 2);
957 Cn = Cq[0] + Cq[1] * n + Cq[2] *
pow(n, 2);
960 Mn = An * exp(Bn * Tc) *
pow(M2, Cn);
962 M2Mn =
pow(M2, 4.) /
pow(Mn, 3.);
964 for (
Index iD = 0; iD < nD; iD++) {
966 x = diameter[iD] * M2 / Mn;
969 phi23 =
q[0] * exp(
q[1] * x) +
q[2] *
pow(x,
q[3]) * exp(
q[4] * x);
981 psd[iD] = phi23 * M2Mn;
990 const String& hydrometeor_type) {
1012 if (hydrometeor_type ==
"cloud_ice")
1018 }
else if (hydrometeor_type ==
"rain")
1024 }
else if (hydrometeor_type ==
"snow")
1030 }
else if (hydrometeor_type ==
"graupel")
1036 }
else if (hydrometeor_type ==
"hail")
1042 }
else if (hydrometeor_type ==
"cloud_water")
1050 os <<
"You use a wrong tag! ";
1051 throw runtime_error(os.str());
1082 arg2 = (mu + 2) / gamma;
1083 arg1 = (mu + 1) / gamma;
1090 brk = M0 / M1 * c2 / c1;
1091 brkMu1 =
pow(brk, (mu + 1));
1094 Lambda =
pow(brk, gamma);
1096 L1 =
pow(Lambda, arg1);
1099 N0 = M0 * gamma / tgamma(arg1) * L1;
1102 for (
Index iD = 0; iD < nD; iD++) {
1107 if (std::isinf(psd[iD])) psd[iD] = 0.0;
1111 mGamma =
pow(
mass[iD], gamma);
1114 dpsd(iD, 0) = gamma / c1 * M0 / M1 * mMu * exp(-Lambda * mGamma) *
1115 brkMu1 * (-1 - mu + gamma * mGamma * Lambda);
1118 dpsd(iD, 1) = -gamma / c1 * mMu * exp(-Lambda * mGamma) * brkMu1 *
1119 (-2 - mu - gamma * mGamma * Lambda);
1128 const Vector& diameter_max,
1150 if (psd_type ==
"cloud_ice")
1156 }
else if (psd_type ==
"rain")
1162 }
else if (psd_type ==
"snow")
1168 }
else if (psd_type ==
"graupel")
1174 }
else if (psd_type ==
"hail")
1180 }
else if (psd_type ==
"cloud_water")
1188 os <<
"You use a wrong tag! ";
1189 throw runtime_error(os.str());
1202 if (M1 > 0.0 && M0 > 0) {
1204 arg2 = (mu +
beta + 1) / gamma;
1205 arg1 = (mu + 1) / gamma;
1212 temp = alpha * M0 / M1 * c2 / c1;
1217 Lmg =
pow(Lambda, arg1);
1220 N0 = M0 * gamma / c1 * Lmg;
1225 for (
Index iD = 0; iD < nD; iD++) {
1226 psd[iD] =
mod_gamma_dist(diameter_max[iD], N0, Lambda, mu, gamma);
1229 if (std::isinf(psd[iD])) psd[iD] = 0.0;
1232 DMu =
pow(diameter_max[iD], mu);
1233 DGamma =
pow(diameter_max[iD], gamma);
1236 dpsd(iD, 0) = (DMu * exp(-DGamma * Lambda) * gamma * M0 * Lmg *
1237 (-1 - mu + DGamma * gamma * Lambda) / (M1 *
beta * c1));
1240 dpsd(iD, 1) = (DMu * exp(-DGamma * Lambda) * gamma * Lmg *
1241 (1 +
beta + mu - DGamma * gamma * Lambda) / (
beta * c1));
1253 return pow(256.0 * iwc /
PI / rho / n0, 0.25);
1259 return 256.0 * iwc /
PI / rho /
pow(dm, 4.0);
The global header file for ARTS.
Index nelem() const ARTS_NOEXCEPT
Index ncols() const noexcept
Index nelem() const noexcept
Returns the number of elements.
void resize(Index r, Index c)
Resize function.
void seed(unsigned long int n, const Verbosity &verbosity)
Seeds the Rng with the integer argument.
void resize(Index n)
Resize function.
Internal cloudbox functions.
#define ARTS_ASSERT(condition,...)
Linear algebra functions.
Header file for logic.cc.
Numeric mod_gamma_dist(Numeric x, Numeric N0, Numeric Lambda, Numeric mu, Numeric gamma)
Generalized Modified Gamma Distribution.
void mgd_with_derivatives(VectorView psd, MatrixView jac_data, const Vector &x, const Numeric &n0, const Numeric &mu, const Numeric &la, const Numeric &ga, const bool &do_n0_jac, const bool &do_mu_jac, const bool &do_la_jac, const bool &do_ga_jac)
NUMERIC Numeric
The type to use for all floating point numbers.
INDEX Index
The type to use for all integer numbers and indices.
Numeric ran_gaussian(Rng &rng, const Numeric sigma)
ran_gaussian.
Workspace functions for the solution of cloud-box radiative transfer by Monte Carlo methods....
Declarations having to do with the four output streams.
Index nelem(const Lines &l)
Number of lines.
Vector mass(const ConstVectorView &atmospheric_vmrs, const ArrayOfArrayOfSpeciesTag &atmospheric_species, const ArrayOfSpecies &lineshape_species, const SpeciesIsotopologueRatios &ir) ARTS_NOEXCEPT
Returns a mass vector for this model's main calculations.
constexpr bool isnan(double d) noexcept
This file contains declerations of functions of physical character.
Propagation path structure and functions.
void psd_rain_W16(Vector &psd, const Vector &diameter, const Numeric &rwc)
The Wang16 rain DSD DEPRECATED BY NEW MGD_SMM_COMMON Only included for compatibility with "old" pnd_f...
void psd_snow_F07(Vector &psd, const Vector &diameter, const Numeric &swc, const Numeric &t, const Numeric alpha, const Numeric beta, const String ®ime)
The F07 snow PSD.
void psd_MY05(Vector &psd, Matrix &dpsd, const Vector &diameter_max, const Numeric N_tot, const Numeric WC, const String psd_type)
void psd_mgd_mass_and_something(Matrix &psd_data, Tensor3 &dpsd_data_dx, const String &something, const Vector &psd_size_grid, const Vector &pnd_agenda_input_t, const Matrix &pnd_agenda_input, const ArrayOfString &pnd_agenda_input_names, const ArrayOfString &dpnd_data_dx_names, const Numeric &scat_species_a, const Numeric &scat_species_b, const Numeric &n0, const Numeric &mu, const Numeric &la, const Numeric &ga, const Numeric &t_min, const Numeric &t_max, const Index &picky, const Verbosity &)
Code common to MGD PSD involving the integrated mass.
Numeric n0_from_t(Numeric t)
Sets N0star based on temperature.
void psd_cloudice_MH97(Vector &psd, const Vector &diameter, const Numeric &iwc, const Numeric &t, const bool noisy)
The MH97 cloud ice PSD.
void psd_mono_common(Matrix &psd_data, Tensor3 &dpsd_data_dx, const String &type, const Vector &pnd_agenda_input_t, const Matrix &pnd_agenda_input, const ArrayOfString &pnd_agenda_input_names, const ArrayOfString &dpnd_data_dx_names, const ArrayOfArrayOfScatteringMetaData &scat_meta, const Index &species_index, const Numeric &t_min, const Numeric &t_max, const Index &picky, const Verbosity &)
Code common to PSDs of mono type.
const Numeric DENSITY_OF_WATER
Numeric n0_from_iwc_dm(Numeric iwc, Numeric dm, Numeric rho)
Derives N0star from IWC and Dm.
Numeric dm_from_iwc_n0(Numeric iwc, Numeric n0, Numeric rho)
Derives Dm from IWC and N0star.
const Numeric DENSITY_OF_ICE
void psd_SB06(Vector &psd, Matrix &dpsd, const Vector &mass, const Numeric &N_tot, const Numeric &WC, const String &hydrometeor_type)
void psd_mgd_smm_common(Matrix &psd_data, Tensor3 &dpsd_data_dx, const String &psd_name, const Vector &psd_size_grid, const Vector &pnd_agenda_input_t, const Matrix &pnd_agenda_input, const ArrayOfString &pnd_agenda_input_names, const ArrayOfString &dpnd_data_dx_names, const Numeric &scat_species_a, const Numeric &scat_species_b, const Numeric &n_alpha_in, const Numeric &n_b_in, const Numeric &mu_in, const Numeric &gamma_in, const Numeric &t_min, const Numeric &t_max, const Index &picky, const Verbosity &)
Code common to a number of modified gamma PSDs used with single-moment mass schemes.
Internal functions associated with size distributions.
#define START_OF_PSD_METHODS()
Numeric pow(const Rational base, Numeric exp)
Power of.
Numeric sqrt(const Rational r)
Square root.
member functions of the Rng class and gsl_rng code
Contains sorting routines.