ARTS 2.5.0 (git: 9ee3ac6c)
psd.h File Reference

Internal functions associated with size distributions. More...

#include "array.h"
#include "gridded_fields.h"
#include "interpolation.h"
#include "matpackVII.h"
#include "messages.h"
#include "optproperties.h"
#include "ppath.h"

Go to the source code of this file.

Macros

#define START_OF_PSD_METHODS()
 

Functions

void psd_cloudice_MH97 (Vector &psd, const Vector &diameter, const Numeric &iwc, const Numeric &t, const bool noisy)
 The MH97 cloud ice PSD. More...
 
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. More...
 
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. More...
 
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_fieldCalcFromscat_speciesField. More...
 
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. More...
 
void psd_snow_F07 (Vector &psd, const Vector &diameter, const Numeric &swc, const Numeric &t, const Numeric alpha, const Numeric beta, const String &regime)
 The F07 snow PSD. More...
 
void psd_SB06 (Vector &psd, Matrix &dpsd, const Vector &mass, const Numeric &N_tot, const Numeric &WC, const String &hydrometeor_type)
 
void psd_MY05 (Vector &psd, Matrix &dpsd, const Vector &diameter_max, const Numeric N_tot, const Numeric WC, const String psd_type)
 
Numeric dm_from_iwc_n0 (Numeric iwc, Numeric n0, Numeric rho)
 Derives Dm from IWC and N0star. More...
 
Numeric n0_from_iwc_dm (Numeric iwc, Numeric dm, Numeric rho)
 Derives N0star from IWC and Dm. More...
 
Numeric n0_from_t (Numeric t)
 Sets N0star based on temperature. More...
 

Detailed Description

Internal functions associated with size distributions.

Author
Jana Mendrok Patrick Eriksson
Date
2017-11-05

Definition in file psd.h.

Macro Definition Documentation

◆ START_OF_PSD_METHODS

#define START_OF_PSD_METHODS ( )

Definition at line 45 of file psd.h.

Function Documentation

◆ dm_from_iwc_n0()

Numeric dm_from_iwc_n0 ( Numeric  iwc,
Numeric  n0,
Numeric  rho 
)

Derives Dm from IWC and N0star.

For definition of Dm and N0star follows the DARDAR PSD.

Parameters
[in]iwcIWC-value
[in]n0N0star value
[in]rhoDensity (of water or ice)
Returns
Derived Dm-value
Author
Simon Pfreundschuh
Date
20??-??-??

Definition at line 1249 of file psd.cc.

◆ n0_from_iwc_dm()

Numeric n0_from_iwc_dm ( Numeric  iwc,
Numeric  dm,
Numeric  rho 
)

Derives N0star from IWC and Dm.

For definition of Dm and N0star follows the DARDAR PSD.

Parameters
[in]iwcIWC-value
[in]dmDm-value
[in]rhoDensity (of water or ice)
Returns
Derived N0star-value
Author
Simon Pfreundschuh
Date
20??-??-??

Definition at line 1257 of file psd.cc.

◆ n0_from_t()

Numeric n0_from_t ( Numeric  t)

Sets N0star based on temperature.

For definition of N0star follows the DARDAR PSD.

This a priori parameterisation is taken from Table 5 in "Normalized particle size distribution for remote sensing application" by Delanoƫ et al., JGR, 2014.

Parameters
[in]ttemperature
Returns
Derived N0star-value
Author
Simon Pfreundschuh
Date
20??-??-??

Definition at line 1265 of file psd.cc.

◆ psd_cloudice_MH97()

void psd_cloudice_MH97 ( Vector psd,
const Vector diameter,
const Numeric iwc,
const Numeric t,
const bool  noisy 
)

The MH97 cloud ice PSD.

Handles a vector of sizes at a time. Implicitly assumes particles of water ice. Strictly requires IWC and T to be positive, i.e. calling method needs to ensure this.

Parameters
[out]psdparticle number density per size interval [#/m3*m]
[in]diametersize of the scattering elements (supposed to be mass (aka volume) equivalent diameter of pure ice particle) [m]
[in]iwcatmospheric ice water content [kg/m3]
tatmospheric temperature [K]
noisyflag whether to add noise onto PSD parameters according to their reported error statistics
Author
Jana Mendrok, Daniel Kreyling
Date
2017-06-07

Definition at line 58 of file psd.cc.

References a, a1, ARTS_ASSERT, b1, b2, DENSITY_OF_ICE, min, ConstVectorView::nelem(), PI, pow(), ran_gaussian(), Vector::resize(), Rng::seed(), and sqrt().

Referenced by psdMcFarquaharHeymsfield97().

◆ psd_mgd_mass_and_something()

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.

Valid choices for something is "mean size", "median size", "mean particle mass" and "Ntot".

Parameters
[out]psd_dataAs the WSV wih same name
[out]dpsd_data_dxAs the WSV wih same name
[in]somethingText string gving the second moment
[in]psd_size_gridAs the WSV wih same name
[in]pnd_agenda_input_tAs the WSV wih same name
[in]pnd_agenda_inputAs the WSV wih same name
[in]pnd_agenda_input_namesAs the WSV wih same name
[in]dpnd_data_dx_namesAs the WSV wih same name
[in]scat_species_aAs the WSV wih same name
[in]scat_species_bAs the WSV wih same name
[in]n0Selection for N0 parameter
[in]muSelection for mu parameter
[in]laSelection for lambda parameter
[in]gaSelection for gamma parameter
[in]t_minPSD set to zero below this temperature
[in]t_maxPSD set to zero above this temperature
[in]pickyTriggers more check of input
Author
Patrick Eriksson
Date
2017-11-05

Definition at line 195 of file psd.cc.

References ARTS_ASSERT, nonstd::isnan(), joker, mgd_with_derivatives(), pow(), and START_OF_PSD_METHODS.

Referenced by psdModifiedGammaMassMeanParticleMass(), psdModifiedGammaMassNtot(), psdModifiedGammaMassXmean(), and psdModifiedGammaMassXmedian().

◆ psd_mgd_smm_common()

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.

All PSDs take the form n(D) = n_alpha lam^n_b D^mu exp(-lam*D^gamma).

Parameters
[out]psd_dataAs the WSV wih same name
[out]dpsd_data_dxAs the WSV wih same name
[in]psd_nameName of selected PSD
[in]psd_size_gridAs the WSV wih same name
[in]pnd_agenda_input_tAs the WSV wih same name
[in]pnd_agenda_inputAs the WSV wih same name
[in]pnd_agenda_input_namesAs the WSV wih same name
[in]dpnd_data_dx_namesAs the WSV wih same name
[in]scat_species_aAs the WSV wih same name
[in]scat_species_bAs the WSV wih same name
[in]t_minPSD set to zero below this temperature
[in]t_maxPSD set to zero above this temperature
[in]n_alpha_inValue of n_alpha for psd_name "generic"
[in]n_b_inValue of n_b for psd_name "generic"
[in]mu_inValue of mu for psd_name "generic"
[in]gamma_inValue of gamma for psd_name "generic"
[in]pickyTriggers more check of input
Author
Stuart Fox
Date
2019-10-02

Definition at line 735 of file psd.cc.

References ARTS_ASSERT, ConstMatrixView::ncols(), and START_OF_PSD_METHODS.

Referenced by psdAbelBoutle12(), psdFieldEtAl19(), psdModifiedGammaMassSingleMoment(), and psdWangEtAl16().

◆ psd_mono_common()

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.

Parameters
[out]psd_dataAs the WSV wih same name
[out]dpsd_data_dxAs the WSV wih same name
[in]pnd_agenda_input_tAs the WSV wih same name
[in]pnd_agenda_inputAs the WSV wih same name
[in]pnd_agenda_input_namesAs the WSV wih same name
[in]dpnd_data_dx_namesAs the WSV wih same name
[in]scat_metaAs the WSV wih same name
[in]species_indexIndex of the scattering species of concern
[in]t_minPSD set to zero below this temperature
[in]t_maxPSD set to zero above this temperature
[in]pickyTriggers more check of input
Author
Patrick Eriksson
Date
2017-11-05

Definition at line 614 of file psd.cc.

References ARTS_ASSERT, ConstMatrixView::ncols(), Array< base >::nelem(), Absorption::nelem(), START_OF_PSD_METHODS, and Hitran::type.

Referenced by psdMonoDispersive(), and psdMonoMass().

◆ psd_MY05()

void psd_MY05 ( Vector psd,
Matrix dpsd,
const Vector diameter_max,
const Numeric  N_tot,
const Numeric  WC,
const String  psd_type 
)

Calculates the particle number density field according to the Milbrandt and Yau two moment scheme, which is used in the GEM model. See also milbrandt and yau, 2005. One call of this function calculates one particle number density.

Returns
dN particle number density per diameter interval [#/m3/m]
Parameters
massMass of scattering particle [kg]
N_totTotal number of particles (0th moment) [#/m3/m/kg^mu]
MTotal mass concentration of Particles (1st moment) [kg/m^3]
psd_typestring with a tag defining the (hydrometeor) scheme
Author
Manfred Brath
Date
2017-08-01

Definition at line 1126 of file psd.cc.

References temp.

Referenced by psdMilbrandtYau05().

◆ psd_rain_W16()

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_fieldCalcFromscat_speciesField.

Uses rain water water content. PSD follows an exponential distribution. Handles a vector of sizes at a time.

Reference: Wang et al., 2016, "Investigation of liquid cloud microphysical properties of deep convective systems: 1. Parameterization raindrop size distribution and its application for stratiform rain estimation". Ported from CloudArts matlab implementation.

Parameters
[out]psdparticle number density per size interval [#/m3*m]
[in]diametersize of the scattering elements (volume equivalent diameter) [m]
[in]rwcatmospheric rain water content [kg/m3]
Author
Jana Mendrok, Bengt Rydberg
Date
2017-06-07

Definition at line 707 of file psd.cc.

References a, ARTS_ASSERT, b, DENSITY_OF_WATER, ConstVectorView::nelem(), PI, pow(), and Vector::resize().

◆ psd_SB06()

void psd_SB06 ( Vector psd,
Matrix dpsd,
const Vector mass,
const Numeric N_tot,
const Numeric WC,
const String hydrometeor_type 
)

Calculates the particle number density field according to the two moment scheme of Seifert and Beheng, 2006b,a that is used in the ICON model. One call of this function calculates one particle number density.

Returns
dN particle number density per diameter interval [#/m3/m]
Parameters
massMass of scattering particle [kg]
N_totTotal number of particles (0th moment) [#/m3/m/kg^mu]
MTotal mass concentration of Particles (1st moment) [kg/m^3]
psd_typestring with a tag defining the (hydrometeor) scheme
Author
Manfred Brath
Date
2015-01-19

Definition at line 985 of file psd.cc.

Referenced by psdSeifertBeheng06().

◆ psd_snow_F07()

void psd_snow_F07 ( Vector psd,
const Vector diameter,
const Numeric swc,
const Numeric t,
const Numeric  alpha,
const Numeric  beta,
const String regime 
)

The F07 snow PSD.

Handles a vector of sizes at a time. Strictly requires SWC and T to be positive and regime to be either "TR" or "ML", i.e. calling methods need to ensure these. No further limitations on the allowed temperatures here. Strictly valid it's only within -60<=t<=0C, the measured t-range the parametrization is based on. However, this is left to be handled by the calling methods.

Parameters
[out]psdparticle number density per size interval [#/m3*m]
[in]diametersize of the scattering elements (supposed to be maximum diameter of the ice particles) [m]
[in]swcatmospheric snow water content [kg/m^3]
[in]tatmospheric temperature [K]
[in]alphamass-dimension relationship scaling factor (m=alpha*(Dmax/D0)^beta) [kg]
[in]betamass-dimension relationship exponent [-]
[in]regimeparametrization regime to apply (TR=tropical, ML=midlatitude)
Author
Manfred Brath, Jana Mendrok
Date
2017-06-13

Definition at line 894 of file psd.cc.