ARTS  2.2.66
cloudbox.cc File Reference

Internal functions for scattering calculations. More...

#include "cloudbox.h"
#include <stdexcept>
#include <cmath>
#include <algorithm>
#include <limits>
#include "arts.h"
#include "messages.h"
#include "make_vector.h"
#include "logic.h"
#include "ppath.h"
#include "physics_funcs.h"
#include "math_funcs.h"
#include "check_input.h"
#include "rng.h"
#include <ctime>
#include "mc_antenna.h"
#include "sorting.h"
#include "lin_alg.h"
Include dependency graph for cloudbox.cc:

Go to the source code of this file.

Functions

void chk_massdensity_field (bool &empty_flag, const Index &dim, const Tensor3 &massdensity, const Vector &p_grid, const Vector &lat_grid, const Vector &lon_grid)
 Check whether hydromet grid size is equal to atmospheric grid size and if hydromet profile is zero (no cloud) in each grid point. More...
 
void chk_if_pnd_zero_p (const Index &i_p, const GriddedField3 &pnd_field_raw, const String &pnd_field_file, const Verbosity &verbosity)
 Check whether particle number density is zero at a specified pressure level. More...
 
void chk_if_pnd_zero_lat (const Index &i_lat, const GriddedField3 &pnd_field_raw, const String &pnd_field_file, const Verbosity &verbosity)
 Check whether particle number density is zero at a specified latitude. More...
 
void chk_if_pnd_zero_lon (const Index &i_lon, const GriddedField3 &pnd_field_raw, const String &pnd_field_file, const Verbosity &verbosity)
 Check whether particle number density is zero at a specified longitude. More...
 
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. More...
 
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) More...
 
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 More...
 
void chk_part_species (const ArrayOfString &part_species, const String &delim)
 Check validity of part_species setting. More...
 
void chk_scattering_data (const ArrayOfSingleScatteringData &scat_data_array, const ArrayOfScatteringMetaData &scat_meta_array, const Verbosity &)
 Check scattering data general. More...
 
void chk_scattering_meta_data (const ScatteringMetaData &scat_meta, const String &scat_meta_file, const Verbosity &verbosity)
 Check scattering data meta files. More...
 
void chk_scat_data (const SingleScatteringData &scat_data_array, const String &scat_data_file, ConstVectorView f_grid, const Verbosity &verbosity)
 Check single scattering data files. More...
 
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)
 
bool is_inside_cloudbox (const Ppath &ppath_step, const ArrayOfIndex &cloudbox_limits, const bool include_boundaries)
 
void pnd_fieldMH97 (Tensor4View pnd_field, const Tensor3 &IWC_field, const Tensor3 &t_field, const ArrayOfIndex &limits, const ArrayOfScatteringMetaData &scat_meta_array, const Index &scat_data_start, const Index &npart, const String &part_string, const String &delim, const Verbosity &verbosity)
 
void pnd_fieldH11 (Tensor4View pnd_field, const Tensor3 &IWC_field, const Tensor3 &t_field, const ArrayOfIndex &limits, const ArrayOfScatteringMetaData &scat_meta_array, const Index &scat_data_start, const Index &npart, const String &part_string, const String &delim, const Verbosity &verbosity)
 
void pnd_fieldH13 (Tensor4View pnd_field, const Tensor3 &IWC_field, const Tensor3 &t_field, const ArrayOfIndex &limits, const ArrayOfScatteringMetaData &scat_meta_array, const Index &scat_data_start, const Index &npart, const String &part_string, const String &delim, const Verbosity &verbosity)
 
void pnd_fieldH13Shape (Tensor4View pnd_field, const Tensor3 &IWC_field, const Tensor3 &t_field, const ArrayOfIndex &limits, const ArrayOfScatteringMetaData &scat_meta_array, const Index &scat_data_start, const Index &npart, const String &part_string, const String &delim, const Verbosity &verbosity)
 
void pnd_fieldF07TR (Tensor4View pnd_field, const Tensor3 &SWC_field, const Tensor3 &t_field, const ArrayOfIndex &limits, const ArrayOfScatteringMetaData &scat_meta_array, const Index &scat_data_start, const Index &npart, const String &part_string, const String &delim, const Verbosity &verbosity)
 
void pnd_fieldF07ML (Tensor4View pnd_field, const Tensor3 &SWC_field, const Tensor3 &t_field, const ArrayOfIndex &limits, const ArrayOfScatteringMetaData &scat_meta_array, const Index &scat_data_start, const Index &npart, const String &part_string, const String &delim, const Verbosity &verbosity)
 
void pnd_fieldMGD_LWC (Tensor4View pnd_field, const Tensor3 &LWC_field, const ArrayOfIndex &limits, const ArrayOfScatteringMetaData &scat_meta_array, const Index &scat_data_start, const Index &npart, const String &part_string, const String &delim, const Verbosity &verbosity)
 
void pnd_fieldMGD_IWC (Tensor4View pnd_field, const Tensor3 &IWC_field, const ArrayOfIndex &limits, const ArrayOfScatteringMetaData &scat_meta_array, const Index &scat_data_start, const Index &npart, const String &part_string, const String &delim, const Verbosity &verbosity)
 
void pnd_fieldGM58 (Tensor4View pnd_field, const Tensor3 &PR_field, const ArrayOfIndex &limits, const ArrayOfScatteringMetaData &scat_meta_array, const Index &scat_data_start, const Index &npart, const String &part_string, const String &delim, const Verbosity &verbosity)
 
void pnd_fieldSS70 (Tensor4View pnd_field, const Tensor3 &PR_field, const ArrayOfIndex &limits, const ArrayOfScatteringMetaData &scat_meta_array, const Index &scat_data_start, const Index &npart, const String &part_string, const String &delim, const Verbosity &verbosity)
 
void pnd_fieldMP48 (Tensor4View pnd_field, const Tensor3 &PR_field, const ArrayOfIndex &limits, const ArrayOfScatteringMetaData &scat_meta_array, const Index &scat_data_start, const Index &npart, const String &part_string, const String &delim, const Verbosity &verbosity)
 
void pnd_fieldH98 (Tensor4View pnd_field, const Tensor3 &LWC_field, const ArrayOfIndex &limits, const ArrayOfScatteringMetaData &scat_meta_array, const Index &scat_data_start, const Index &npart, const String &part_string, const String &delim, const Verbosity &verbosity)
 
Numeric IWCtopnd_MH97 (const Numeric iwc, const Numeric dm, const Numeric t, const Numeric density, const bool noisy)
 
Numeric IWCtopnd_H11 (const Numeric d, const Numeric t)
 
Numeric IWCtopnd_H13 (const Numeric d, const Numeric t)
 
Numeric IWCtopnd_H13Shape (const Numeric d, const Numeric t)
 
Numeric area_ratioH13 (const Numeric d, const Numeric t)
 
Numeric IWCtopnd_F07TR (const Numeric d, const Numeric t, const Numeric swc, const Numeric alpha, const Numeric beta)
 
Numeric IWCtopnd_F07ML (const Numeric d, const Numeric t, const Numeric swc, const Numeric alpha, const Numeric beta)
 
Numeric LWCtopnd (const Numeric lwc, const Numeric density, const Numeric r)
 
Numeric LWCtopnd2 (const Numeric r)
 
Numeric LWCtopnd_MGD_LWC (const Numeric d, const Numeric rho, const Numeric lwc)
 
Numeric IWCtopnd_MGD_IWC (const Numeric d, const Numeric rho, const Numeric iwc)
 
Numeric PRtopnd_MP48 (const Numeric R, const Numeric D)
 
void scale_pnd (Vector &w, const Vector &x, const Vector &y)
 
void chk_pndsum (Vector &pnd, const Numeric xwc, const Vector &vol, const Vector &density, const Index &p, const Index &lat, const Index &lon, const String &partfield_name, const Verbosity &verbosity)
 
void scale_H11 (Vector &pnd, const Numeric xwc, const Vector &density, const Vector &vol)
 
void scale_H13 (Vector &pnd, const Numeric xwc, const Vector &density, const Vector &vol)
 
void parse_partfield_name (String &partfield_name, const String &part_string, const String &delim)
 
void parse_psd_param (String &psd_param, const String &part_string, const String &delim)
 
void parse_part_material (String &part_material, const String &part_string, const String &delim)
 
void parse_part_size (Numeric &sizemin, Numeric &sizemax, const String &part_string, const String &delim)
 

Variables

const Index GFIELD3_P_GRID
 
const Index GFIELD3_LAT_GRID
 
const Index GFIELD3_LON_GRID
 
const Numeric PI
 

Detailed Description

Internal functions for scattering calculations.

Author
Claudia Emde claud.nosp@m.ia.e.nosp@m.mde@d.nosp@m.lr.d.nosp@m.e
Date
Thu May 23 10:59:55 2002

Definition in file cloudbox.cc.

Function Documentation

◆ area_ratioH13()

Numeric area_ratioH13 ( const Numeric  d,
const Numeric  t 
)

Calculates area ratio from the temperature and maximum diameter using H13 parametrization. Each diameter of the scattering particles is a node in the aspect ratio distribution. One call of this function calculates one aspect ratio.

Returns
dN particle number density per diameter interval [#/m3/m]
Parameters
dmaximum diameter of scattering particle [m]
tatmospheric temperature [K]
Author
Johan Strandgren
Date
2013-08-26

Definition at line 3078 of file cloudbox.cc.

References beta.

Referenced by dN_Ar_H13(), and pnd_fieldH13Shape().

◆ chk_if_pnd_zero_lat()

void chk_if_pnd_zero_lat ( const Index i_lat,
const GriddedField3 pnd_field_raw,
const String pnd_field_file,
const Verbosity verbosity 
)

Check whether particle number density is zero at a specified latitude.

Parameters
i_latLatitude index
pnd_field_rawParticle number density data
pnd_field_filepnd field filename
Author
Claudia Emde
Date
2005-05-09

Definition at line 193 of file cloudbox.cc.

References CREATE_OUT1, GriddedField3::data, GriddedField::get_numeric_grid(), GFIELD3_LAT_GRID, GFIELD3_LON_GRID, GFIELD3_P_GRID, and ConstVectorView::nelem().

◆ chk_if_pnd_zero_lon()

void chk_if_pnd_zero_lon ( const Index i_lon,
const GriddedField3 pnd_field_raw,
const String pnd_field_file,
const Verbosity verbosity 
)

Check whether particle number density is zero at a specified longitude.

Parameters
i_lonLatitude index
pnd_field_rawParticle number density data
pnd_field_filepnd field filename
Author
Claudia Emde
Date
2005-05-09

Definition at line 241 of file cloudbox.cc.

References CREATE_OUT1, GriddedField3::data, GriddedField::get_numeric_grid(), GFIELD3_LAT_GRID, GFIELD3_LON_GRID, GFIELD3_P_GRID, and ConstVectorView::nelem().

◆ chk_if_pnd_zero_p()

void chk_if_pnd_zero_p ( const Index i_p,
const GriddedField3 pnd_field_raw,
const String pnd_field_file,
const Verbosity verbosity 
)

Check whether particle number density is zero at a specified pressure level.

Parameters
i_pPressure index
pnd_field_rawParticle number density data
pnd_field_filepnd field filename
Author
Claudia Emde
Date
2005-05-09

Definition at line 145 of file cloudbox.cc.

References CREATE_OUT1, GriddedField3::data, GriddedField::get_numeric_grid(), GFIELD3_LAT_GRID, GFIELD3_LON_GRID, GFIELD3_P_GRID, and ConstVectorView::nelem().

◆ chk_massdensity_field()

void chk_massdensity_field ( bool &  empty_flag,
const Index dim,
const Tensor3 massdensity,
const Vector p_grid,
const Vector lat_grid,
const Vector lon_grid 
)

Check whether hydromet grid size is equal to atmospheric grid size and if hydromet profile is zero (no cloud) in each grid point.

Parameters
dimatmosphere dimension
hydromethydrometeor grid in p, lat or lon dimension
p_gridp grid of current atmosphere
lat_gridlat grid of current atmosphere
lon_gridlon grid of current atmosphere
Author
Daniel Kreyling
Date
2011-01-27

Definition at line 70 of file cloudbox.cc.

References ConstTensor3View::ncols(), ConstVectorView::nelem(), ConstTensor3View::npages(), and ConstTensor3View::nrows().

Referenced by cloudboxSetAutomatically().

◆ chk_part_species()

void chk_part_species ( const ArrayOfString part_species,
const String delim 
)

Check validity of part_species setting.

This function checks, whether number of elements in each particle string is ok, and whether the entries for size limits are indeed numbers (or '*').

  \param part_species Array of particle species tags.
Parameters
delimDelimiter string of part_species elements.
Author
Jana Mendrok
Date
2012-10-25

Definition at line 480 of file cloudbox.cc.

References Array< base >::nelem().

Referenced by ParticleSpeciesSet().

◆ chk_pnd_data()

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.

This function checks, whether the particle number density file has the right atmospheric dimension (check for no non-zero pnd values outside cloudbox removed. done in pnd_fieldCalc).

Parameters
pnd_field_rawpnd field data
pnd_field_filepnd field filename
atmosphere_dimAtmospheric dimension
Author
Claudia Emde
Date
2005-04-05

Definition at line 294 of file cloudbox.cc.

References CREATE_OUT3, GriddedField::get_numeric_grid(), GFIELD3_LAT_GRID, GFIELD3_LON_GRID, GFIELD3_P_GRID, and ConstVectorView::nelem().

Referenced by chk_pnd_raw_data(), ParticleType2abs_speciesAdd(), and ParticleTypeAdd().

◆ chk_pnd_field_raw_only_in_cloudbox()

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

Checks whether the pnd_field is zero outside the cloudbox. This is of a higher level than chk_pnd_data because it does not require any filename and because it works on all pnd_field_raw rather than just one element. Otherwise, it is mostly a new implementation of the same functionality.

Parameters
dimThe atmospheric dimensionality.
pnd_field_rawAll pnd_field_raw data.
p_gridPressure grid.
lat_gridLatitude grid.
lon_gridLongitude grid.
cloudbox_limitsThe edges of the cloudbox.
Author
Gerrit Holl
Date
2011-03-24

Definition at line 390 of file cloudbox.cc.

References GFIELD3_LAT_GRID, GFIELD3_LON_GRID, GFIELD3_P_GRID, and Array< base >::nelem().

Referenced by pnd_fieldCalc().

◆ chk_pnd_raw_data()

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)

Parameters
pnd_field_rawpnd field raw data (array for all particle types)
pnd_field_filepnd field filename
atmosphere_dimAtmospheric dimension
Author
Claudia Emde
Date
2005-04-05

Definition at line 352 of file cloudbox.cc.

References chk_pnd_data(), CREATE_OUT3, and Array< base >::nelem().

Referenced by ParticleTypeAddAll().

◆ chk_pndsum()

void chk_pndsum ( Vector pnd,
const Numeric  xwc,
const Vector vol,
const Vector density,
const Index p,
const Index lat,
const Index lon,
const String partfield_name,
const Verbosity verbosity 
)

Check sum of pnd vector against total mass density value. Deviation is calculated and used to adjust the output of vector pnd.

\param pnd particle number density [#/m3]
\param xwc atmospheric massdensity [kg/m3]
\param density scattering particle density [kg/m3]
\param vol scattering particle volume [m3]
Author
Daniel Kreyling
Date
2010-12-15

Definition at line 3517 of file cloudbox.cc.

References CREATE_OUT1, CREATE_OUT2, and ConstVectorView::nelem().

Referenced by pnd_fieldF07ML(), pnd_fieldF07TR(), pnd_fieldGM58(), pnd_fieldH11(), pnd_fieldH13(), pnd_fieldH13Shape(), pnd_fieldH98(), pnd_fieldMGD_IWC(), pnd_fieldMGD_LWC(), pnd_fieldMH97(), pnd_fieldMP48(), pnd_fieldSS70(), and pndFromdN().

◆ chk_scat_data()

void chk_scat_data ( const SingleScatteringData scat_data_array,
const String scat_data_file,
ConstVectorView  f_grid,
const Verbosity verbosity 
)

Check single scattering data files.

This function checks, whether a datafile containing the single scattering properties of a particle type includes the required frequencies and temperatures and whether the angular grids are defined correctly. Furthermore it checks the self consistency of the data by checking the dimensions of pha_mat, ext_mat and abs_vec depending on the particle_type case.

Parameters
scat_data_arraySingle scattering data
scat_data_fileFilename of the data to be checked.
f_gridFrequency grid
Author
Claudia Emde
Date
2005-04-04

Definition at line 605 of file cloudbox.cc.

References SingleScatteringData::aa_grid, SingleScatteringData::abs_vec_data, chk_interpolation_grids(), chk_size(), CREATE_OUT2, SingleScatteringData::ext_mat_data, SingleScatteringData::f_grid, last(), ConstVectorView::nelem(), SingleScatteringData::particle_type, PARTICLE_TYPE_GENERAL, PARTICLE_TYPE_HORIZ_AL, PARTICLE_TYPE_MACROS_ISO, PARTICLE_TYPE_SPHERICAL, SingleScatteringData::pha_mat_data, SingleScatteringData::T_grid, and SingleScatteringData::za_grid.

Referenced by ParticleType2abs_speciesAdd(), ParticleTypeAdd(), ParticleTypeAddAll(), and ScatteringParticleTypeAndMetaRead().

◆ chk_scattering_data()

void chk_scattering_data ( const ArrayOfSingleScatteringData scat_data_array,
const ArrayOfScatteringMetaData scat_meta_array,
const Verbosity  
)

Check scattering data general.

FIXME

Parameters
scat_data_arrayArray of single scattering data
scat_meta_arrayArray of scattering meta data
Author
Daniel Kreyling
Date
2010-12-02

Definition at line 541 of file cloudbox.cc.

References Array< base >::nelem().

Referenced by ScatteringParticleTypeAndMetaRead().

◆ chk_scattering_meta_data()

void chk_scattering_meta_data ( const ScatteringMetaData scat_meta,
const String scat_meta_file,
const Verbosity verbosity 
)

Check scattering data meta files.

FIXME

Parameters
scat_metascattering meta data
scat_meta_filefilename of the data to be checked
Author
Daniel Kreyling
Date
2010-12-02

Definition at line 567 of file cloudbox.cc.

References CREATE_OUT2.

Referenced by ScatteringParticleTypeAndMetaRead().

◆ is_gp_inside_cloudbox()

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 
)

Checks, whether a gridpoint is inside the cloudbox.

Returns
true is returned if the point is inside the cloudbox.
Parameters
gp_ppressure GridPos
gp_latlatitude GridPos
gp_lonlongitude GridPos
cloudbox_limitsThe limits of the cloudbox.
include_boundariesboolean: determines whther or not points on the boundary are considered to be inside the cloudbox.
Author
Claudia Emde (rewritten by Cory Davis 2005-07-03)
Date
2003-06-06

Definition at line 808 of file cloudbox.cc.

References fractional_gp().

Referenced by get_ppath_ext(), is_inside_cloudbox(), iy_auxFillParticleVariables(), mcPathTraceGeneral(), and mcPathTraceIPA().

◆ is_inside_cloudbox()

bool is_inside_cloudbox ( const Ppath ppath_step,
const ArrayOfIndex cloudbox_limits,
const bool  include_boundaries 
)

Checks, whether the last point of a propagation path is inside the cloudbox.

Works only for 3D !!!

Returns
true is returned if the point is inside the cloudbox.
Parameters
ppath_stepPropagation path step.
cloudbox_limitsThe limits of the cloudbox.
include_boundariesboolean: determines whther or not points on the boundary are considered to be inside the cloudbox.
Author
Claudia Emde (rewritten by Cory Davis 2005-07-03)
Date
2003-06-06

Definition at line 892 of file cloudbox.cc.

References Ppath::gp_lat, Ppath::gp_lon, Ppath::gp_p, is_gp_inside_cloudbox(), Array< base >::nelem(), and Ppath::np.

Referenced by cloud_ppath_update3D(), mcPathTraceGeneral(), and mcPathTraceIPA().

◆ IWCtopnd_F07ML()

Numeric IWCtopnd_F07ML ( const Numeric  d,
const Numeric  t,
const Numeric  swc,
const Numeric  alpha,
const Numeric  beta 
)

Calculates particle size distribution using F07 parametrization for mid latitude. Each diameter of the scattering particles is a node in the distribution. One call of this function calculates one particle number density.

Returns
dN particle number density per diameter interval [#/m3/m]
Parameters
dmaximum diameter of scattering particle [m]
tatmospheric temperature [K]
swcsnow water content [kg/m^3]
alphaFactor for the mass-dimension (m=alpha*(Dmax/D0)^beta) relationship [kg]
betaExponent for the mass-dimension relationship [pure number]
Author
Manfred Brath
Date
2014-11-14

Definition at line 3215 of file cloudbox.cc.

References q.

Referenced by dN_F07ML(), and pnd_fieldF07ML().

◆ IWCtopnd_F07TR()

Numeric IWCtopnd_F07TR ( const Numeric  d,
const Numeric  t,
const Numeric  swc,
const Numeric  alpha,
const Numeric  beta 
)

Calculates particle size distribution using F07 parametrization for tropics. Each diameter of the scattering particles is a node in the distribution. One call of this function calculates one particle number density.

Returns
dN particle number density per diameter interval [#/m3/m]
Parameters
dmaximum diameter of scattering particle [m]
tatmospheric temperature [K]
swcsnow water content [kg/m^3]
alphaFactor for the mass-dimension (m=alpha*(Dmax/D0)^beta) relationship [kg]
betaExponent for the mass-dimension relationship [pure number]
Author
Manfred Brath
Date
2014-11-14

Definition at line 3121 of file cloudbox.cc.

References q.

Referenced by dN_F07TR(), and pnd_fieldF07TR().

◆ IWCtopnd_H11()

Numeric IWCtopnd_H11 ( const Numeric  d,
const Numeric  t 
)

Calculates particle size distribution using H11 parametrization. Each diameter of the scattering particles is a node in the distribution. One call of this function calculates one particle number density.

Returns
dN particle number density per diameter interval [#/m3/m]
Parameters
dmaximum diameter of scattering particle [m]
tatmospheric temperature [K]
Author
Daniel Kreyling
Date
2011-10-28

Definition at line 2921 of file cloudbox.cc.

Referenced by dN_H11(), and pnd_fieldH11().

◆ IWCtopnd_H13()

Numeric IWCtopnd_H13 ( const Numeric  d,
const Numeric  t 
)

Calculates particle size distribution using H13 parametrization. Each diameter of the scattering particles is a node in the distribution. One call of this function calculates one particle number density.

Returns
dN particle number density per diameter interval [#/m3/m]
Parameters
dmaximum diameter of scattering particle [m]
tatmospheric temperature [K]
Author
Johan Strandgren, Daniel Kreyling
Date
2013-08-26

Definition at line 2972 of file cloudbox.cc.

Referenced by pnd_fieldH13().

◆ IWCtopnd_H13Shape()

Numeric IWCtopnd_H13Shape ( const Numeric  d,
const Numeric  t 
)

Calculates particle size distribution using H13 parametrization. Each diameter of the scattering particles is a node in the distribution. One call of this function calculates one particle number density.

Returns
dN particle number density per diameter interval [#/m3/m]
Parameters
dmaximum diameter of scattering particle [m]
tatmospheric temperature [K]
Author
Johan Strandgren
Date
2013-08-26

Definition at line 3025 of file cloudbox.cc.

Referenced by dN_Ar_H13(), and pnd_fieldH13Shape().

◆ IWCtopnd_MGD_IWC()

Numeric IWCtopnd_MGD_IWC ( const Numeric  d,
const Numeric  rho,
const Numeric  iwc 
)

Calculates the particle number density field for Cloud ice according the modified gamma distribution for cloud ice inside Geer and Baordo (2014), see table A1 One call of this function calculates one particle number density. Assumptions are: density of particles is constant and particle shape is sphere.

Returns
dN particle number density per diameter interval [#/m3/m]
Parameters
dvolume equivalent diameter of scattering particle [m]
iwcice water content [kg/m^3]
Author
Manfred Brath
Date
2014-11-28

Definition at line 3402 of file cloudbox.cc.

Referenced by dN_MGD_IWC(), and pnd_fieldMGD_IWC().

◆ IWCtopnd_MH97()

Numeric IWCtopnd_MH97 ( const Numeric  iwc,
const Numeric  dm,
const Numeric  t,
const Numeric  density,
const bool  noisy 
)

Calculates particle size distribution using MH97 parametrization. Each diameter of the scattering particles is a node in the distribution. One call of this function calculates one particle number density.

Returns
dN particle number density per diameter interval [#/m3*m]
Parameters
iwcatmospheric ice water content [kg/m3]
dmmelted diameter of scattering particle [m]
tatmospheric temperature [K]
densityof the scattering particle [kg/m3]
perturbPSD parameters according to their error statistics?
Author
Daniel Kreyling
Date
2010-12-06

Definition at line 2755 of file cloudbox.cc.

References gamma_func(), min, PI, ran_gaussian(), and Rng::seed().

Referenced by dN_MH97(), and pnd_fieldMH97().

◆ LWCtopnd()

Numeric LWCtopnd ( const Numeric  lwc,
const Numeric  density,
const Numeric  r 
)

Calculates particle size distribution for liquid water clouds using a gamma parametrization by Hess et al., 1998 (continental stratus). Each radius of the scattering particles is a node in the distribution. One call of this function calculates one particle number density.

\return n particle number density per radius interval [#/m3*m]

\param lwc atm

ospheric liquid water content [kg/m3]

Parameters
rradius of scattering particle [m]
Author
Daniel Kreyling
Date
2010-12-16

Definition at line 3305 of file cloudbox.cc.

References gamma_func(), and PI.

Referenced by dN_H98(), and pnd_fieldH98().

◆ LWCtopnd2()

Numeric LWCtopnd2 ( const Numeric  r)

Definition at line 3331 of file cloudbox.cc.

References gamma_func().

◆ LWCtopnd_MGD_LWC()

Numeric LWCtopnd_MGD_LWC ( const Numeric  d,
const Numeric  rho,
const Numeric  lwc 
)

Calculates the particle number density field for Cloud liquid water according the modified gamma distribution for cloud water inside Geer and Baordo (2014), see table A1 One call of this function calculates one particle number density. Assumptions are: density of particles is constant and particle shape is sphere.

Returns
dN particle number density per diameter interval [#/m3/m]
Parameters
dvolume equivalent diameter of scattering particle [m]
lwcliquid water content [kg/m^3]
Author
Manfred Brath
Date
2014-11-28

Definition at line 3363 of file cloudbox.cc.

Referenced by dN_MGD_LWC(), and pnd_fieldMGD_LWC().

◆ parse_part_material()

void parse_part_material ( String part_material,
const String part_string,
const String delim 
)

Splitting part_species string and parse type of particle (from ScattData array)

\param  part_type particle type (material, phase). 
\param  part_string containing infos about scattering particle calculations
Parameters
delimDelimiter string of part_species elements
Author
Jana Mendrok
Date
2012-04-03

Definition at line 3793 of file cloudbox.cc.

References my_basic_string< charT >::split().

Referenced by pnd_fieldSetup(), and ScatteringParticlesSelect().

◆ parse_part_size()

void parse_part_size ( Numeric sizemin,
Numeric sizemax,
const String part_string,
const String delim 
)

Splitting part_species string and parse min and max particle radius

Parameters
sizeminmin scattering particle radius
sizemaxmax scattering particle radius
part_stringcontaining infos about scattering particle calculations
delimDelimiter string of part_species elements
Author
Daniel Kreyling
Date
2011-02-21

Definition at line 3830 of file cloudbox.cc.

References Array< base >::nelem(), and my_basic_string< charT >::split().

Referenced by ScatteringParticlesSelect().

◆ parse_partfield_name()

void parse_partfield_name ( String partfield_name,
const String part_string,
const String delim 
)

Splitting part_species string and parse type of massdensity_field

\param  partfield_name name of atmospheric particle field
\param  part_string containing infos about scattering particle calculations
Parameters
delimDelimiter string of part_species elements
Author
Daniel Kreyling
Date
2011-02-21

Definition at line 3700 of file cloudbox.cc.

References my_basic_string< charT >::split().

Referenced by AtmFieldsFromCompact(), pnd_fieldF07ML(), pnd_fieldF07TR(), pnd_fieldGM58(), pnd_fieldH11(), pnd_fieldH13(), pnd_fieldH13Shape(), pnd_fieldH98(), pnd_fieldMGD_IWC(), pnd_fieldMGD_LWC(), pnd_fieldMH97(), pnd_fieldMP48(), pnd_fieldSetup(), pnd_fieldSS70(), and ScatteringParticlesSelect().

◆ parse_psd_param()

void parse_psd_param ( String psd_param,
const String part_string,
const String delim 
)

Splitting part_species string and parse psd_param

Parameters
psd_paramparticle size distribution parametrization
part_stringcontaining infos about scattering particle calculations
delimDelimiter string of part_species elements
Author
Daniel Kreyling
Date
2011-02-21

Definition at line 3749 of file cloudbox.cc.

References my_basic_string< charT >::split().

Referenced by pnd_fieldMH97(), and pnd_fieldSetup().

◆ pnd_fieldF07ML()

void pnd_fieldF07ML ( Tensor4View  pnd_field,
const Tensor3 SWC_field,
const Tensor3 t_field,
const ArrayOfIndex limits,
const ArrayOfScatteringMetaData scat_meta_array,
const Index scat_data_start,
const Index npart,
const String part_string,
const String delim,
const Verbosity verbosity 
)

Calculates the particle number density field for Field (2007) size distribution for mid latitude. For the estimation of the second moment the mass dimension relationship is estimated by regression from the meta data. To be used for snow. For this distribution the snow has to be as mass content.

Parameters
pnd_fieldParticle number density field
SWC_field(snow) mass content field [kg/m3]
t_fieldatmospheric temperature [K] \param limits pnd_field boundaries (indices in p, lat, lon)
scat_meta_arrayparticle meta data for particles
scat_data_startstart index for particles handled by this distribution
npartnumber of particles handled by this distribution
part_stringpart_species tag for profile/distribution handled here
delimDelimiter string of part_species elements
Author
Manfred Brath (parts of the function is based on pnd_H11 (of J. Mendrok & D. Kreyling))
Date
2014-12-02

Definition at line 1674 of file cloudbox.cc.

References beta, chk_pndsum(), CREATE_OUT2, dmax, get_sorted_indexes(), IWCtopnd_F07ML(), linreg(), ConstVectorView::nelem(), parse_partfield_name(), q, and scale_pnd().

Referenced by pnd_fieldSetup().

◆ pnd_fieldF07TR()

void pnd_fieldF07TR ( Tensor4View  pnd_field,
const Tensor3 SWC_field,
const Tensor3 t_field,
const ArrayOfIndex limits,
const ArrayOfScatteringMetaData scat_meta_array,
const Index scat_data_start,
const Index npart,
const String part_string,
const String delim,
const Verbosity verbosity 
)

Calculates the particle number density field for Field (2007) size distribution for tropics. For the estimation of the second moment the mass dimension relationship is estimated by regression from the meta data. To be used for snow. For this distribution the snow has to be as mass content.

Parameters
pnd_fieldParticle number density field
SWC_field(snow) mass content field [kg/m3]
t_fieldatmospheric temperature [K] \param limits pnd_field boundaries (indices in p, lat, lon)
scat_meta_arrayparticle meta data for particles
scat_data_startstart index for particles handled by this distribution
npartnumber of particles handled by this distribution
part_stringpart_species tag for profile/distribution handled here
delimDelimiter string of part_species elements
Author
Manfred Brath (parts of the function is based on pnd_H11 (of J. Mendrok & D. Kreyling))
Date
2014-12-02

Definition at line 1517 of file cloudbox.cc.

References beta, chk_pndsum(), CREATE_OUT2, dmax, get_sorted_indexes(), IWCtopnd_F07TR(), linreg(), ConstVectorView::nelem(), parse_partfield_name(), q, and scale_pnd().

Referenced by pnd_fieldSetup().

◆ pnd_fieldGM58()

void pnd_fieldGM58 ( Tensor4View  pnd_field,
const Tensor3 PR_field,
const ArrayOfIndex limits,
const ArrayOfScatteringMetaData scat_meta_array,
const Index scat_data_start,
const Index npart,
const String part_string,
const String delim,
const Verbosity verbosity 
)

Calculates the particle number density field for Gunn and Marshall (1958) size distribution. To be used for snow fall rates.

Parameters
pnd_fieldParticle number density field
PR_fieldprecipitation rate field [kg/(m2*s)] \param limits pnd_field boundaries (indices in p, lat, lon)
scat_meta_arrayparticle meta data for particles
scat_data_startstart index for particles handled by this distribution
npartnumber of particles handled by this distribution
part_stringpart_species tag for profile/distribution handled here
delimDelimiter string of part_species elements
Author
Manfred Brath (most of the function was taken by me from pnd_mp48 (of j. mendrok))
Date
2014-10-20

Definition at line 2110 of file cloudbox.cc.

References chk_pndsum(), fac(), get_sorted_indexes(), ConstVectorView::nelem(), parse_partfield_name(), PI, and scale_pnd().

Referenced by pnd_fieldSetup().

◆ pnd_fieldH11()

void pnd_fieldH11 ( Tensor4View  pnd_field,
const Tensor3 IWC_field,
const Tensor3 t_field,
const ArrayOfIndex limits,
const ArrayOfScatteringMetaData scat_meta_array,
const Index scat_data_start,
const Index npart,
const String part_string,
const String delim,
const Verbosity verbosity 
)

Calculates the particle number density field for Heymsfield (2011, personal comm.) size distribution. To be used for atmospheric ice, particularly cloud ice and snow.

Parameters
pnd_fieldParticle number density field
IWC_fieldmass content (cloud ice or snow) field [kg/m3]
t_fieldatmospheric temperature [K] \param limits pnd_field boundaries (indices in p, lat, lon)
scat_meta_arrayparticle meta data for particles
scat_data_startstart index for particles handled by this distribution
npartnumber of particles handled by this distribution
part_stringpart_species tag for profile/distribution handled here
delimDelimiter string of part_species elements
Author
Jana Mendrok, Daniel Kreyling
Date
2012-04-05

Definition at line 1045 of file cloudbox.cc.

References chk_pndsum(), get_sorted_indexes(), IWCtopnd_H11(), ConstVectorView::nelem(), parse_partfield_name(), and scale_pnd().

Referenced by pnd_fieldSetup().

◆ pnd_fieldH13()

void pnd_fieldH13 ( Tensor4View  pnd_field,
const Tensor3 IWC_field,
const Tensor3 t_field,
const ArrayOfIndex limits,
const ArrayOfScatteringMetaData scat_meta_array,
const Index scat_data_start,
const Index npart,
const String part_string,
const String delim,
const Verbosity verbosity 
)

Calculates the particle number density field for Heymsfield (2013, personal comm.) size distribution. To be used for atmospheric ice, particularly cloud ice and snow.

Parameters
pnd_fieldParticle number density field
IWC_fieldmass content (cloud ice or snow) field [kg/m3]
t_fieldatmospheric temperature [K] \param limits pnd_field boundaries (indices in p, lat, lon)
scat_meta_arrayparticle meta data for particles
scat_data_startstart index for particles handled by this distribution
npartnumber of particles handled by this distribution
part_stringpart_species tag for profile/distribution handled here
delimDelimiter string of part_species elements
Author
Johan Strandgren, Daniel Kreyling
Date
2013-08-26

Definition at line 1165 of file cloudbox.cc.

References chk_pndsum(), get_sorted_indexes(), IWCtopnd_H13(), ConstVectorView::nelem(), parse_partfield_name(), and scale_pnd().

Referenced by pnd_fieldSetup().

◆ pnd_fieldH13Shape()

void pnd_fieldH13Shape ( Tensor4View  pnd_field,
const Tensor3 IWC_field,
const Tensor3 t_field,
const ArrayOfIndex limits,
const ArrayOfScatteringMetaData scat_meta_array,
const Index scat_data_start,
const Index npart,
const String part_string,
const String delim,
const Verbosity verbosity 
)

Calculates the particle number density field for Heymsfield (2013, personal comm.) size distribution. To be used for atmospheric ice, particularly cloud ice and snow.

Parameters
pnd_fieldParticle number density field
IWC_fieldmass content (cloud ice or snow) field [kg/m3]
t_fieldatmospheric temperature [K] \param limits pnd_field boundaries (indices in p, lat, lon)
scat_meta_arrayparticle meta data for particles
scat_data_startstart index for particles handled by this distribution
npartnumber of particles handled by this distribution
part_stringpart_species tag for profile/distribution handled here
delimDelimiter string of part_species elements
Author
Johan Strandgren
Date
2013-08-26

Definition at line 1303 of file cloudbox.cc.

References abs, area_ratioH13(), VectorView::begin(), chk_pndsum(), CREATE_OUT1, VectorView::end(), get_sorted_indexes(), IWCtopnd_H13Shape(), ConstVectorView::nelem(), parse_partfield_name(), and scale_pnd().

Referenced by pnd_fieldSetup().

◆ pnd_fieldH98()

void pnd_fieldH98 ( Tensor4View  pnd_field,
const Tensor3 LWC_field,
const ArrayOfIndex limits,
const ArrayOfScatteringMetaData scat_meta_array,
const Index scat_data_start,
const Index npart,
const String part_string,
const String delim,
const Verbosity verbosity 
)

Calculates the particle number density field for Hess et al. (1998) size distribution, namely the continental stratus case. To be used for liquid clouds.

Parameters
pnd_fieldParticle number density field
LWC_fieldmass content (liquid water) field [kg/m3] \param limits pnd_field boundaries (indices in p, lat, lon)
scat_meta_arrayparticle meta data for particles
scat_data_startstart index for particles handled by this distribution
npartnumber of particles handled by this distribution
part_stringpart_species tag for profile/distribution handled here
delimDelimiter string of part_species elements
Author
Jana Mendrok, Daniel Kreyling
Date
2012-04-04

Definition at line 2638 of file cloudbox.cc.

References chk_pndsum(), get_sorted_indexes(), LWCtopnd(), ConstVectorView::nelem(), parse_partfield_name(), PI, and scale_pnd().

Referenced by pnd_fieldSetup().

◆ pnd_fieldMGD_IWC()

void pnd_fieldMGD_IWC ( Tensor4View  pnd_field,
const Tensor3 IWC_field,
const ArrayOfIndex limits,
const ArrayOfScatteringMetaData scat_meta_array,
const Index scat_data_start,
const Index npart,
const String part_string,
const String delim,
const Verbosity verbosity 
)

Calculates the particle number density field for Cloud liquid water according to the modified gamma distribution for cloud water inside Geer and Baordo (2014), see table A1 Assumptions are: density of particles is constant and particle shape is sphere.

Parameters
pnd_fieldParticle number density field
SWC_field(snow) mass content field [kg/m3]
t_fieldatmospheric temperature [K] \param limits pnd_field boundaries (indices in p, lat, lon)
scat_meta_arrayparticle meta data for particles
scat_data_startstart index for particles handled by this distribution
npartnumber of particles handled by this distribution
part_stringpart_species tag for profile/distribution handled here
delimDelimiter string of part_species elements
Author
Manfred Brath (parts of the function is based on pnd_H11 (of J. Mendrok & D. Kreyling))
Date
2014-12-02

Definition at line 1970 of file cloudbox.cc.

References chk_pndsum(), get_sorted_indexes(), IWCtopnd_MGD_IWC(), max, min, ConstVectorView::nelem(), parse_partfield_name(), PI, scale_pnd(), and ConstVectorView::sum().

Referenced by pnd_fieldSetup().

◆ pnd_fieldMGD_LWC()

void pnd_fieldMGD_LWC ( Tensor4View  pnd_field,
const Tensor3 LWC_field,
const ArrayOfIndex limits,
const ArrayOfScatteringMetaData scat_meta_array,
const Index scat_data_start,
const Index npart,
const String part_string,
const String delim,
const Verbosity verbosity 
)

Calculates the particle number density field for Cloud liquid water according to the modified gamma distribution for cloud water inside Geer and Baordo (2014), see table A1 Assumptions are: density of particles is constant and particle shape is sphere.

Parameters
pnd_fieldParticle number density field
SWC_field(snow) mass content field [kg/m3]
t_fieldatmospheric temperature [K] \param limits pnd_field boundaries (indices in p, lat, lon)
scat_meta_arrayparticle meta data for particles
scat_data_startstart index for particles handled by this distribution
npartnumber of particles handled by this distribution
part_stringpart_species tag for profile/distribution handled here
delimDelimiter string of part_species elements
Author
Manfred Brath (parts of the function is based on pnd_H11 (of J. Mendrok & D. Kreyling))
Date
2014-12-02

Definition at line 1821 of file cloudbox.cc.

References chk_pndsum(), CREATE_OUT1, get_sorted_indexes(), LWCtopnd_MGD_LWC(), max, min, ConstVectorView::nelem(), parse_partfield_name(), PI, scale_pnd(), and ConstVectorView::sum().

Referenced by pnd_fieldSetup().

◆ pnd_fieldMH97()

void pnd_fieldMH97 ( Tensor4View  pnd_field,
const Tensor3 IWC_field,
const Tensor3 t_field,
const ArrayOfIndex limits,
const ArrayOfScatteringMetaData scat_meta_array,
const Index scat_data_start,
const Index npart,
const String part_string,
const String delim,
const Verbosity verbosity 
)

Calculates the particle number density field for McFarquhar and Heymsfield (1997) size distribution. To be used for cloud ice.

Returns
pnd_field Particle number density field
Parameters
IWC_fieldmass content (cloud ice) field [kg/m3]
t_fieldatmospheric temperature [K]
limitspnd_field boundaries (indices in p, lat, lon)
scat_meta_arrayparticle meta data for particles
scat_data_startstart index for particles handled by this distribution
npartnumber of particles handled by this distribution
part_stringpart_species tag for profile/distribution handled here
delimDelimiter string of part_species elements
Author
Jana Mendrok, Daniel Kreyling
Date
2012-04-03

Definition at line 924 of file cloudbox.cc.

References chk_pndsum(), get_sorted_indexes(), IWCtopnd_MH97(), ConstVectorView::nelem(), parse_partfield_name(), parse_psd_param(), PI, and scale_pnd().

Referenced by pnd_fieldSetup().

◆ pnd_fieldMP48()

void pnd_fieldMP48 ( Tensor4View  pnd_field,
const Tensor3 PR_field,
const ArrayOfIndex limits,
const ArrayOfScatteringMetaData scat_meta_array,
const Index scat_data_start,
const Index npart,
const String part_string,
const String delim,
const Verbosity verbosity 
)

Calculates the particle number density field for Marshall and Palmer (1948) size distribution. To be used for precipitation, particularly rain.

Parameters
pnd_fieldParticle number density field
PR_fieldprecipitation rate field [kg/(m2*s)] \param limits pnd_field boundaries (indices in p, lat, lon)
scat_meta_arrayparticle meta data for particles
scat_data_startstart index for particles handled by this distribution
npartnumber of particles handled by this distribution
part_stringpart_species tag for profile/distribution handled here
delimDelimiter string of part_species elements
Author
Jana Mendrok
Date
2012-04-04

Definition at line 2449 of file cloudbox.cc.

References abs, chk_pndsum(), fac(), get_sorted_indexes(), ConstVectorView::nelem(), parse_partfield_name(), PI, scale_pnd(), and ConstVectorView::sum().

Referenced by pnd_fieldSetup().

◆ pnd_fieldSS70()

void pnd_fieldSS70 ( Tensor4View  pnd_field,
const Tensor3 PR_field,
const ArrayOfIndex limits,
const ArrayOfScatteringMetaData scat_meta_array,
const Index scat_data_start,
const Index npart,
const String part_string,
const String delim,
const Verbosity verbosity 
)

Calculates the particle number density field for Sekhon and Srivastava (1970) size distribution. To be used for snow fall rates.

Parameters
pnd_fieldParticle number density field
PR_fieldprecipitation rate field [kg/(m2*s)] \param limits pnd_field boundaries (indices in p, lat, lon)
scat_meta_arrayparticle meta data for particles
scat_data_startstart index for particles handled by this distribution
npartnumber of particles handled by this distribution
part_stringpart_species tag for profile/distribution handled here
delimDelimiter string of part_species elements
Author
Manfred Brath (most of the function was taken from pnd_mp48 (of j. mendrok))
Date
2014-10-22

Definition at line 2278 of file cloudbox.cc.

References chk_pndsum(), fac(), get_sorted_indexes(), ConstVectorView::nelem(), parse_partfield_name(), PI, and scale_pnd().

Referenced by pnd_fieldSetup().

◆ PRtopnd_MP48()

Numeric PRtopnd_MP48 ( const Numeric  R,
const Numeric  D 
)

Calculates particle size distribution using MP48 parametrization for rain. Each diameter of the scattering particles is a node in the distribution. One call of this function calculates one particle number density.

Returns
dN particle number density per diameter interval [#/m3*m]
Parameters
Rprecipitation rate [mm/hr]
Dvolume equivalent diameter of scattering particle [m]
Author
Jana Mendrok
Date
2012-04-04

Definition at line 3438 of file cloudbox.cc.

Referenced by dN_MP48().

◆ scale_H11()

void scale_H11 ( Vector pnd,
const Numeric  xwc,
const Vector density,
const Vector vol 
)

The H11 PSD is scaled to the initial 'ice' or 'snow' massdensity, after the distribution has been evaluated. This function applies the scaling.

\param xwc atmospheric massdensity [kg/m3]
\param density scattering particle density [kg/m3]
\param vol scattering particle volume [m3]
Author
Daniel Kreyling
Date
2011-10-31

Definition at line 3604 of file cloudbox.cc.

References ConstVectorView::nelem(), and ConstVectorView::sum().

◆ scale_H13()

void scale_H13 ( Vector pnd,
const Numeric  xwc,
const Vector density,
const Vector vol 
)

The H13 PSD is scaled to the initial 'ice' or 'snow' massdensity, after the distribution has been evaluated. This function applies the scaling.

Parameters
xwcatmospheric massdensity [kg/m3]
densityscattering particle density [kg/m3]
volscattering particle volume [m3]
Author
Johan Strandgren, Daniel Kreyling
Date
2013-09-03

Definition at line 3652 of file cloudbox.cc.

References ConstVectorView::nelem(), and ConstVectorView::sum().

◆ scale_pnd()

void scale_pnd ( Vector w,
const Vector x,
const Vector y 
)

Scaling pnd values by width of size bin. Bin width is determined from preceeding and following particle size. Vector y and x must be equal in size. Vector w holds the weights. Derived from trapezoid integration rule.

Parameters
wweights
xe.g. particle radius [m]
ye.g. particle number density per radies interval [#/m3*m]
Author
Daniel Kreyling
Date
2010-12-15

Definition at line 3469 of file cloudbox.cc.

References ConstVectorView::nelem().

Referenced by pnd_fieldF07ML(), pnd_fieldF07TR(), pnd_fieldGM58(), pnd_fieldH11(), pnd_fieldH13(), pnd_fieldH13Shape(), pnd_fieldH98(), pnd_fieldMGD_IWC(), pnd_fieldMGD_LWC(), pnd_fieldMH97(), pnd_fieldMP48(), pnd_fieldSS70(), and pndFromdN().

Variable Documentation

◆ GFIELD3_LAT_GRID

◆ GFIELD3_LON_GRID

◆ GFIELD3_P_GRID

◆ PI