ARTS  2.2.66
m_cloudbox.cc File Reference

Workspace functions related to the definintion of the cloud box. More...

#include <stdexcept>
#include <cstdlib>
#include <cmath>
#include "arts.h"
#include "array.h"
#include "auto_md.h"
#include "check_input.h"
#include "xml_io.h"
#include "messages.h"
#include "gridded_fields.h"
#include "logic.h"
#include "rte.h"
#include "interpolation.h"
#include "special_interp.h"
#include "cloudbox.h"
#include "optproperties.h"
#include "math_funcs.h"
#include "physics_funcs.h"
#include "sorting.h"
Include dependency graph for m_cloudbox.cc:

Go to the source code of this file.

Functions

void cloudboxOff (Index &cloudbox_on, ArrayOfIndex &cloudbox_limits, Agenda &iy_cloudbox_agenda, Tensor4 &pnd_field, ArrayOfSingleScatteringData &scat_data_array, Matrix &particle_masses, const Verbosity &)
 WORKSPACE METHOD: cloudboxOff. More...
 
void cloudboxSetAutomatically (Index &cloudbox_on, ArrayOfIndex &cloudbox_limits, const Index &atmosphere_dim, const Vector &p_grid, const Vector &lat_grid, const Vector &lon_grid, const Tensor4 &massdensity_field, const Numeric &cloudbox_margin, const Verbosity &verbosity)
 WORKSPACE METHOD: cloudboxSetAutomatically. More...
 
void cloudboxSetFullAtm (Index &cloudbox_on, ArrayOfIndex &cloudbox_limits, const Index &atmosphere_dim, const Vector &p_grid, const Verbosity &)
 WORKSPACE METHOD: cloudboxSetFullAtm. More...
 
void cloudboxSetManually (Index &cloudbox_on, ArrayOfIndex &cloudbox_limits, const Index &atmosphere_dim, const Vector &p_grid, const Vector &lat_grid, const Vector &lon_grid, const Numeric &p1, const Numeric &p2, const Numeric &lat1, const Numeric &lat2, const Numeric &lon1, const Numeric &lon2, const Verbosity &)
 WORKSPACE METHOD: cloudboxSetManually. More...
 
void cloudboxSetManuallyAltitude (Index &cloudbox_on, ArrayOfIndex &cloudbox_limits, const Index &atmosphere_dim, const Tensor3 &z_field, const Vector &lat_grid, const Vector &lon_grid, const Numeric &z1, const Numeric &z2, const Numeric &lat1, const Numeric &lat2, const Numeric &lon1, const Numeric &lon2, const Verbosity &)
 WORKSPACE METHOD: cloudboxSetManuallyAltitude. More...
 
void Massdensity_cleanup (Tensor4 &massdensity_field, const Numeric &massdensity_threshold, const Verbosity &)
 WORKSPACE METHOD: Massdensity_cleanup. More...
 
void ParticleSpeciesInit (ArrayOfString &part_species, const Verbosity &)
 WORKSPACE METHOD: ParticleSpeciesInit. More...
 
void ParticleSpeciesSet (ArrayOfString &part_species, const ArrayOfString &particle_tags, const String &delim, const Verbosity &verbosity)
 WORKSPACE METHOD: ParticleSpeciesSet. More...
 
void ParticleTypeInit (ArrayOfSingleScatteringData &scat_data_array, ArrayOfGriddedField3 &pnd_field_raw, const Verbosity &)
 WORKSPACE METHOD: ParticleTypeInit. More...
 
void ParticleTypeAdd (ArrayOfSingleScatteringData &scat_data_array, ArrayOfGriddedField3 &pnd_field_raw, const Index &atmosphere_dim, const Vector &f_grid, const String &scat_data_file, const String &pnd_field_file, const Verbosity &verbosity)
 WORKSPACE METHOD: ParticleTypeAdd. More...
 
void ParticleTypeAddAll (ArrayOfSingleScatteringData &scat_data_array, ArrayOfGriddedField3 &pnd_field_raw, const Index &atmosphere_dim, const Vector &f_grid, const String &filelist_scat_data, const String &pnd_fieldarray_file, const Verbosity &verbosity)
 WORKSPACE METHOD: ParticleTypeAddAll. More...
 
void ParticleType2abs_speciesAdd (ArrayOfSingleScatteringData &scat_data_array, ArrayOfGriddedField3 &vmr_field_raw, ArrayOfArrayOfSpeciesTag &abs_species, Index &propmat_clearsky_agenda_checked, Index &abs_xsec_agenda_checked, const Index &atmosphere_dim, const Vector &f_grid, const String &scat_data_file, const String &pnd_field_file, const Verbosity &verbosity)
 WORKSPACE METHOD: ParticleType2abs_speciesAdd. More...
 
void ScatteringParticleTypeAndMetaRead (ArrayOfSingleScatteringData &scat_data_array, ArrayOfScatteringMetaData &scat_meta_array, const Vector &f_grid, const String &filename_scat_data, const String &filename_scat_meta_data, const Verbosity &verbosity)
 WORKSPACE METHOD: ScatteringParticleTypeAndMetaRead. More...
 
void ScatteringParticlesSelect (ArrayOfSingleScatteringData &scat_data_array, ArrayOfScatteringMetaData &scat_meta_array, ArrayOfIndex &scat_data_per_part_species, const ArrayOfString &part_species, const String &delim, const Verbosity &verbosity)
 WORKSPACE METHOD: ScatteringParticlesSelect. More...
 
void particle_massesFromMetaDataSingleCategory (Matrix &particle_masses, const ArrayOfScatteringMetaData &scat_meta_array, const Verbosity &)
 WORKSPACE METHOD: particle_massesFromMetaDataSingleCategory. More...
 
void particle_massesFromMetaDataAndPart_species (Matrix &particle_masses, const ArrayOfScatteringMetaData &scat_meta_array, const ArrayOfIndex &scat_data_per_part_species, const ArrayOfString &part_species, const Verbosity &)
 WORKSPACE METHOD: particle_massesFromMetaDataAndPart_species. More...
 
void pnd_fieldCalc (Tensor4 &pnd_field, const Vector &p_grid, const Vector &lat_grid, const Vector &lon_grid, const ArrayOfGriddedField3 &pnd_field_raw, const Index &atmosphere_dim, const ArrayOfIndex &cloudbox_limits, const Index &zeropadding, const Verbosity &verbosity)
 WORKSPACE METHOD: pnd_fieldCalc. More...
 
void pnd_fieldExpand1D (Tensor4 &pnd_field, const Index &atmosphere_dim, const Index &cloudbox_on, const ArrayOfIndex &cloudbox_limits, const Index &nzero, const Verbosity &)
 WORKSPACE METHOD: pnd_fieldExpand1D. More...
 
void pnd_fieldZero (Tensor4 &pnd_field, ArrayOfSingleScatteringData &scat_data_array, const Vector &p_grid, const Vector &lat_grid, const Vector &lon_grid, const Verbosity &)
 WORKSPACE METHOD: pnd_fieldZero. More...
 
void pnd_fieldSetup (Tensor4 &pnd_field, const Index &atmosphere_dim, const Index &cloudbox_on, const ArrayOfIndex &cloudbox_limits, const Tensor4 &massdensity_field, const Tensor3 &t_field, const ArrayOfScatteringMetaData &scat_meta_array, const ArrayOfString &part_species, const ArrayOfIndex &scat_data_per_part_species, const String &delim, const Verbosity &verbosity)
 WORKSPACE METHOD: pnd_fieldSetup. More...
 
void dN_MH97 (Vector &dN, const Vector &Dme, const Numeric &IWC, const Numeric &t, const Vector &density, const Index &noisy, const Verbosity &)
 WORKSPACE METHOD: dN_MH97. More...
 
void dN_H11 (Vector &dN, const Vector &Dmax, const Numeric &t, const Verbosity &)
 WORKSPACE METHOD: dN_H11. More...
 
void dN_Ar_H13 (Vector &dN, Vector &Ar, const Vector &Dmax, const Numeric &t, const Verbosity &)
 WORKSPACE METHOD: dN_Ar_H13. More...
 
void dN_F07TR (Vector &dN, const Vector &diameter_max, const Numeric &SWC, const Numeric &t, const Numeric &alpha, const Numeric &beta, const Verbosity &)
 WORKSPACE METHOD: dN_F07TR. More...
 
void dN_F07ML (Vector &dN, const Vector &diameter_max, const Numeric &SWC, const Numeric &t, const Numeric &alpha, const Numeric &beta, const Verbosity &)
 WORKSPACE METHOD: dN_F07ML. More...
 
void dN_MGD_LWC (Vector &dN, const Vector &deq, const Numeric &rho, const Numeric &LWC, const Verbosity &)
 WORKSPACE METHOD: dN_MGD_LWC. More...
 
void dN_MGD_IWC (Vector &dN, const Vector &deq, const Numeric &rho, const Numeric &IWC, const Verbosity &)
 WORKSPACE METHOD: dN_MGD_IWC. More...
 
void dN_H98 (Vector &dN, const Vector &R, const Numeric &LWC, const Vector &density, const Verbosity &)
 WORKSPACE METHOD: dN_H98. More...
 
void dN_MP48 (Vector &dN, const Vector &Dme, const Numeric &PR, const Verbosity &)
 WORKSPACE METHOD: dN_MP48. More...
 
void pndFromdN (Vector &pnd, const Vector &dN, const Vector &diameter, const Numeric &total_content, const Vector &scatelem_volume, const Vector &scatelem_density, const Verbosity &verbosity)
 WORKSPACE METHOD: pndFromdN. More...
 

Variables

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

Detailed Description

Workspace functions related to the definintion of the cloud box.

Author
Patrick Eriksson, Claudia Emde and Sreerekha T. R.
Date
2002-05-08

These functions are listed in the doxygen documentation as entries of the file auto_md.h.

Definition in file m_cloudbox.cc.

Function Documentation

◆ cloudboxOff()

void cloudboxOff ( Index cloudbox_on,
ArrayOfIndex cloudbox_limits,
Agenda iy_cloudbox_agenda,
Tensor4 pnd_field,
ArrayOfSingleScatteringData scat_data_array,
Matrix particle_masses,
const Verbosity verbosity 
)

WORKSPACE METHOD: cloudboxOff.

Deactivates the cloud box.

Use this method if no scattering calculations shall be performed.

The function sets cloudbox_on to 0, cloudbox_limits, pnd_field*, scat_data_array, iy_cloudbox_agenda and particle_masses* to be empty and use_mean_scat_data to -999.

Author
Patrick Eriksson
Parameters
[out]cloudbox_onWS Output
[out]cloudbox_limitsWS Output
[out]iy_cloudbox_agendaWS Output
[out]pnd_fieldWS Output
[out]scat_data_arrayWS Output
[out]particle_massesWS Output

Definition at line 76 of file m_cloudbox.cc.

References Tensor4::resize(), Matrix::resize(), and Agenda::set_name().

Referenced by cloudboxOff_g().

◆ cloudboxSetAutomatically()

void cloudboxSetAutomatically ( Index cloudbox_on,
ArrayOfIndex cloudbox_limits,
const Index atmosphere_dim,
const Vector p_grid,
const Vector lat_grid,
const Vector lon_grid,
const Tensor4 massdensity_field,
const Numeric cloudbox_margin,
const Verbosity verbosity 
)

WORKSPACE METHOD: cloudboxSetAutomatically.

Sets the cloud box to encompass the cloud given by the entries in massdensity_field.

The function must be called before any cloudbox_limits using WSMs. NOTE: only 1-dim case is handeled in the moment!

The function iterates over all part_species and performs a check, to see if the corresponding scattering particle profiles do not contain a cloud (all values equal zero). If, after all iterations, all the considrered profiles proove to contain no cloud, the cloudbox is switched off! (see WSM cloudboxOff)

Each scattering particle profile is searched for the first and last pressure index, where the value is unequal to zero. This index is then copied to cloudbox_limits.

Additionaly the lower cloudbox_limit is altered by cloudbox_margin*. The margin is given as a height difference in meters and trasformed into a pressure.(via isothermal barometric heightformula) This alteration is needed to ensure, that scattered photons do not leave and re-enter the cloudbox, due to its convex shape. If cloudbox_margin is set to -1 (default), the cloudbox will extend to the surface. Hence the lower cloudbox_limit is set to 0 (index of first pressure level).

Author
Daniel Kreyling
Parameters
[out]cloudbox_onWS Output
[out]cloudbox_limitsWS Output
[in]atmosphere_dimWS Input
[in]p_gridWS Input
[in]lat_gridWS Input
[in]lon_gridWS Input
[in]massdensity_fieldWS Input
[in]cloudbox_marginGeneric Input (Default: "-1")

Definition at line 97 of file m_cloudbox.cc.

References barometric_heightformula(), chk_atm_grids(), chk_if_in_range(), chk_massdensity_field(), CREATE_OUT0, CREATE_OUT2, DEBUG_ONLY, joker, max, min, ConstTensor4View::nbooks(), ConstTensor4View::ncols(), ConstVectorView::nelem(), ConstTensor4View::npages(), and ConstTensor4View::nrows().

Referenced by cloudboxSetAutomatically_g().

◆ cloudboxSetFullAtm()

void cloudboxSetFullAtm ( Index cloudbox_on,
ArrayOfIndex cloudbox_limits,
const Index atmosphere_dim,
const Vector p_grid,
const Verbosity verbosity 
)

WORKSPACE METHOD: cloudboxSetFullAtm.

Sets the cloudbox to cover the full atmosphere.

Can only handle atmosphere_dim=1 cases.

Author
Claudia Emde
Parameters
[out]cloudbox_onWS Output
[out]cloudbox_limitsWS Output
[in]atmosphere_dimWS Input
[in]p_gridWS Input

Definition at line 343 of file m_cloudbox.cc.

References ConstVectorView::nelem().

Referenced by cloudboxSetFullAtm_g().

◆ cloudboxSetManually()

void cloudboxSetManually ( Index cloudbox_on,
ArrayOfIndex cloudbox_limits,
const Index atmosphere_dim,
const Vector p_grid,
const Vector lat_grid,
const Vector lon_grid,
const Numeric p1,
const Numeric p2,
const Numeric lat1,
const Numeric lat2,
const Numeric lon1,
const Numeric lon2,
const Verbosity verbosity 
)

WORKSPACE METHOD: cloudboxSetManually.

Sets the cloud box to encompass the given positions.

The function sets cloudbox_on to 1 and sets cloudbox_limits following the given pressure, latitude and longitude positions. The index limits in cloudbox_limits are selected to give the smallest possible cloud box that encompass the given points.

The points must be given in the same order as used in cloudbox_limits*. That means that the first keyword argument shall be a higher pressure than argument two, while the latitude and longitude points are given in increasing order. Positions given for dimensions not used by the selected atmospheric dimensionality are ignored.

The given pressure points can be outside the range of p_grid. The pressure limit is then set to the end point of p_grid. The given latitude and longitude points must be inside the range of the corresponding grid. In addition, the latitude and longitude points cannot be inside the outermost grid ranges as the latitude and longitude limits in cloudbox_limits are not allowed to be grid end points.

Author
Patrick Eriksson
Parameters
[out]cloudbox_onWS Output
[out]cloudbox_limitsWS Output
[in]atmosphere_dimWS Input
[in]p_gridWS Input
[in]lat_gridWS Input
[in]lon_gridWS Input
[in]p1Generic Input
[in]p2Generic Input
[in]lat1Generic Input
[in]lat2Generic Input
[in]lon1Generic Input
[in]lon2Generic Input

Definition at line 365 of file m_cloudbox.cc.

References chk_atm_grids(), chk_if_in_range(), and ConstVectorView::nelem().

Referenced by cloudboxSetManually_g(), and ybatchMetProfiles().

◆ cloudboxSetManuallyAltitude()

void cloudboxSetManuallyAltitude ( Index cloudbox_on,
ArrayOfIndex cloudbox_limits,
const Index atmosphere_dim,
const Tensor3 z_field,
const Vector lat_grid,
const Vector lon_grid,
const Numeric z1,
const Numeric z2,
const Numeric lat1,
const Numeric lat2,
const Numeric lon1,
const Numeric lon2,
const Verbosity verbosity 
)

WORKSPACE METHOD: cloudboxSetManuallyAltitude.

Sets the cloud box to encompass the given positions.

As cloudboxSetManually but uses altitudes instead of pressure. The given altitude points can be outside the range of z_field. The altitude limit is then set to the end point of p_grid.

Author
Claudia Emde
Parameters
[out]cloudbox_onWS Output
[out]cloudbox_limitsWS Output
[in]atmosphere_dimWS Input
[in]z_fieldWS Input
[in]lat_gridWS Input
[in]lon_gridWS Input
[in]z1Generic Input
[in]z2Generic Input
[in]lat1Generic Input
[in]lat2Generic Input
[in]lon1Generic Input
[in]lon2Generic Input

Definition at line 468 of file m_cloudbox.cc.

References chk_if_in_range(), ConstVectorView::nelem(), and ConstTensor3View::npages().

Referenced by cloudboxSetManuallyAltitude_g().

◆ dN_Ar_H13()

void dN_Ar_H13 ( Vector dN,
Vector Ar,
const Vector Dmax,
const Numeric t,
const Verbosity verbosity 
)

WORKSPACE METHOD: dN_Ar_H13.

Calculation of particle size and shape distribution (dN/dD, area ratio) following Heymsfield (2013).

A wrapper to internal particle size and shape distribution calculation. Heymsfield (2013) is a globally valid parametrization for cloud ice. The parametrization is in ambient atmospheric temperature over particle size in terms of maximum dimension. It provides the shape of the distribution function of both number density and area ratio.

For testing purposes mainly.

Author
Jana Mendrok
Parameters
[out]dNGeneric output
[out]ArGeneric output
[in]DmaxGeneric Input
[in]tGeneric Input

Definition at line 1913 of file m_cloudbox.cc.

References area_ratioH13(), IWCtopnd_H13Shape(), ConstVectorView::nelem(), and Vector::resize().

Referenced by dN_Ar_H13_g().

◆ dN_F07ML()

void dN_F07ML ( Vector dN,
const Vector diameter_max,
const Numeric SWC,
const Numeric t,
const Numeric alpha,
const Numeric beta,
const Verbosity verbosity 
)

WORKSPACE METHOD: dN_F07ML.

Calculation of particle size distribution (dN/dD) following Field et al. (2007) for mid latitude parametrization.

A wrapper to internal particle size distribution calculation. Field et al. (2007) for mid latitude is a parametrization for Snow and cloud ice in the mid latitude. Parametrization is in ice water content (IWC) and ambient atmospheric temperature over particle size in terms of maximum diameter. Provides number density normalized to the given snow/ice water content.

Author
Manfred Brath
Parameters
[out]dNGeneric output
[in]diameter_maxGeneric Input
[in]SWCGeneric Input
[in]tGeneric Input
[in]alphaGeneric Input (Default: "0.0257")
[in]betaGeneric Input (Default: "2.0")

Definition at line 1958 of file m_cloudbox.cc.

References IWCtopnd_F07ML(), ConstVectorView::nelem(), and Vector::resize().

Referenced by dN_F07ML_g().

◆ dN_F07TR()

void dN_F07TR ( Vector dN,
const Vector diameter_max,
const Numeric SWC,
const Numeric t,
const Numeric alpha,
const Numeric beta,
const Verbosity verbosity 
)

WORKSPACE METHOD: dN_F07TR.

Calculation of particle size distribution (dN/dD) following Field et al. (2007) for tropics parametrization.

A wrapper to internal particle size distribution calculation. Field et al. (2007) for tropics is a parametrization for Snow and cloud ice in the tropics. Parametrization is in ice water content (IWC) and ambient atmospheric temperature over particle size in terms of maximum diameter. Provides number density normalized to the given snow/ice water content.

Author
Manfred Brath
Parameters
[out]dNGeneric output
[in]diameter_maxGeneric Input
[in]SWCGeneric Input
[in]tGeneric Input
[in]alphaGeneric Input (Default: "0.0257")
[in]betaGeneric Input (Default: "2.0")

Definition at line 1936 of file m_cloudbox.cc.

References IWCtopnd_F07TR(), ConstVectorView::nelem(), and Vector::resize().

Referenced by dN_F07TR_g().

◆ dN_H11()

void dN_H11 ( Vector dN,
const Vector Dmax,
const Numeric t,
const Verbosity verbosity 
)

WORKSPACE METHOD: dN_H11.

Calculation of particle size distribution (dN/dD) following a parametrization by Heymsfield (2011; unpublished).

A wrapper to internal particle size distribution calculation. Heymsfield (2011) is an unpublished pre-version of Heymsfield (2013). It is a globally valid parametrization for cloud ice. The parametrization is in ambient atmospheric temperature over particle size in terms of maximum dimension of the particles. Provides only the shape of the number density disribution function.

For testing purposes mainly.

Author
Jana Mendrok
Parameters
[out]dNGeneric output
[in]DmaxGeneric Input
[in]tGeneric Input

Definition at line 1894 of file m_cloudbox.cc.

References IWCtopnd_H11(), ConstVectorView::nelem(), and Vector::resize().

Referenced by dN_H11_g().

◆ dN_H98()

void dN_H98 ( Vector dN,
const Vector R,
const Numeric LWC,
const Vector density,
const Verbosity verbosity 
)

WORKSPACE METHOD: dN_H98.

Calculation of particle size shape distribution (dN/dR) following Hess et al. (1998).

A wrapper to internal particle size distribution calculation. The distribution implemented here is for cloud liquid water, specifically for continental stratus. The parametrization is over radius of spherical droplets. Provides number density normalized to the given liquid water content.

For testing purposes mainly.

Author
Jana Mendrok
Parameters
[out]dNGeneric output
[in]RGeneric Input
[in]LWCGeneric Input
[in]densityGeneric Input

Definition at line 2023 of file m_cloudbox.cc.

References LWCtopnd(), ConstVectorView::nelem(), and Vector::resize().

Referenced by dN_H98_g().

◆ dN_MGD_IWC()

void dN_MGD_IWC ( Vector dN,
const Vector deq,
const Numeric rho,
const Numeric IWC,
const Verbosity verbosity 
)

WORKSPACE METHOD: dN_MGD_IWC.

Calculation of particle size distribution (dN/dD) according to the modified gamma distribution for cloud ice inside of Geer and Baordo (2014)

A wrapper to internal particle size distribution calculation. MDG_IWC is a parametrization for cloud ice. It is a modified gamma distribution with the coefficients of Geer and Baordo (2014) Parametrization is in liquid water content (IWC) Assumptions are: density of particles is constant and particle shape is sphere. Provides number density normalized to the given ice water content.

Author
Manfred Brath
Parameters
[out]dNGeneric output
[in]deqGeneric Input
[in]rhoGeneric Input
[in]IWCGeneric Input

Definition at line 2001 of file m_cloudbox.cc.

References IWCtopnd_MGD_IWC(), ConstVectorView::nelem(), and Vector::resize().

Referenced by dN_MGD_IWC_g().

◆ dN_MGD_LWC()

void dN_MGD_LWC ( Vector dN,
const Vector deq,
const Numeric rho,
const Numeric LWC,
const Verbosity verbosity 
)

WORKSPACE METHOD: dN_MGD_LWC.

Calculation of particle size distribution (dN/dD) according to the modified gamma distribution for cloud water inside of Geer and Baordo (2014)

A wrapper to internal particle size distribution calculation. MDG_LWC is a parametrization for cloud liquid water. It is a modified gamma distribution with the coefficients of Geer and Baordo (2014) Parametrization is in liquid water content (LWC) Assumptions are: density of particles is constant and particle shape is sphere. Provides number density normalized to the given liquid water content.

Author
Manfred Brath
Parameters
[out]dNGeneric output
[in]deqGeneric Input
[in]rhoGeneric Input
[in]LWCGeneric Input

Definition at line 1981 of file m_cloudbox.cc.

References LWCtopnd_MGD_LWC(), ConstVectorView::nelem(), and Vector::resize().

Referenced by dN_MGD_LWC_g().

◆ dN_MH97()

void dN_MH97 ( Vector dN,
const Vector Dme,
const Numeric IWC,
const Numeric t,
const Vector density,
const Index noisy,
const Verbosity verbosity 
)

WORKSPACE METHOD: dN_MH97.

Calculation of particle size distribution (dN/dD) following McFarquahar and Heymsfield (1997) parametrization.

A wrapper to internal particle size distribution calculation. McFarquhar and Heymsfield (1997) is a parametrization for cloud ice in the tropics. Parametrization is in ice water content (IWC) and ambient atmospheric temperature over particle size in terms of mass equivalent sphere diameter. McFarquhar and Heymsfield (1997) additionally provide uncertainties of the distribution's parameters, which can be used here to created perturbed distributions (set noisy to 1). Provides number density normalized to the given ice water content.

For testing purposes mainly.

Author
Jana Mendrok
Parameters
[out]dNGeneric output
[in]DmeGeneric Input
[in]IWCGeneric Input
[in]tGeneric Input
[in]densityGeneric Input
[in]noisyGeneric Input (Default: "0")

Definition at line 1863 of file m_cloudbox.cc.

References IWCtopnd_MH97(), ConstVectorView::nelem(), and Vector::resize().

Referenced by dN_MH97_g().

◆ dN_MP48()

void dN_MP48 ( Vector dN,
const Vector Dme,
const Numeric PR,
const Verbosity verbosity 
)

WORKSPACE METHOD: dN_MP48.

Calculation of particle size distribution (dN/dD) following Marshall and Palmer (1948) parametrization.

A wrapper to internal particle size distribution calculation. Marshall and Palmer (1948) is a parametrization for liquid and ice precipitation, i.e., rain and snow. Parametrization is in precipitation rate (PR) over particle size in terms of mass equivalent sphere diameter. Provides number density normalized to the given precipitation rate.

For testing purposes mainly.

Author
Jana Mendrok
Parameters
[out]dNGeneric output
[in]DmeGeneric Input
[in]PRGeneric Input

Definition at line 2052 of file m_cloudbox.cc.

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

Referenced by dN_MP48_g().

◆ Massdensity_cleanup()

void Massdensity_cleanup ( Tensor4 massdensity_field,
const Numeric massdensity_threshold,
const Verbosity verbosity 
)

WORKSPACE METHOD: Massdensity_cleanup.

This WSM checks if massdensity_field contains values smaller than massdensity_threshold*. In this case, these values will be set to zero.

The Method should be applied if massdensity_field contains unrealistic small or erroneous data. (e.g. the chevallierl_91l data sets contain these small values)

Massdensity_cleanup* is called after generation of atmopheric fields.

Default value*: 1e-15

Author
Daniel Kreyling
Parameters
[out]massdensity_fieldWS Output
[in]massdensity_thresholdGeneric Input (Default: "1e-15")

Definition at line 570 of file m_cloudbox.cc.

References ConstTensor4View::nbooks(), ConstTensor4View::ncols(), ConstTensor4View::npages(), and ConstTensor4View::nrows().

Referenced by Massdensity_cleanup_g().

◆ particle_massesFromMetaDataAndPart_species()

void particle_massesFromMetaDataAndPart_species ( Matrix particle_masses,
const ArrayOfScatteringMetaData scat_meta_array,
const ArrayOfIndex scat_data_per_part_species,
const ArrayOfString part_species,
const Verbosity verbosity 
)

WORKSPACE METHOD: particle_massesFromMetaDataAndPart_species.

Derives particle_masses from scat_meta_array.

This method is supposed to be used to derive particle_masses when pnd_field is internally calculated using pnd_fieldSetup (in contrast to reading it from external sources using ParticleTypeAdd* and pnd_fieldCalc). It extracts particle the mass information (density*volume) from scat_meta_array*. Different entries in part_species are taken as different categories of particle_masses, i.e., the resulting particle_masses matrix will contain as many columns as entries exist in part_species.

Author
Jana Mendrok
Parameters
[out]particle_massesWS Output
[in]scat_meta_arrayWS Input
[in]scat_data_per_part_speciesWS Input
[in]part_speciesWS Input

Definition at line 1055 of file m_cloudbox.cc.

References Array< base >::nelem(), and Matrix::resize().

Referenced by particle_massesFromMetaDataAndPart_species_g(), and particle_massesFromMetaDataSingleCategory().

◆ particle_massesFromMetaDataSingleCategory()

void particle_massesFromMetaDataSingleCategory ( Matrix particle_masses,
const ArrayOfScatteringMetaData scat_meta_array,
const Verbosity verbosity 
)

WORKSPACE METHOD: particle_massesFromMetaDataSingleCategory.

Sets particle_masses based on scat_meta_array assuming all particles are of the same mass category.

This method calculates the particle masses as density*volume for each particle type. Single phase particles, and that all all particles consist of the same (bulk) matter (e.g. water or ice) are assumed. With other words, a single mass category is assumed (see particle_masses for a definition of "mass category").

To be clear, the above are assumptions of the method, the user is free to work with any particle type. For Earth and just having cloud and particles, the resulting mass category can be seen as the total cloud water content, with possible contribution from both ice and liquid phase.

Author
Jana Mendrok
Patrick Eriksson
Parameters
[out]particle_massesWS Output
[in]scat_meta_arrayWS Input

Definition at line 1015 of file m_cloudbox.cc.

References Array< base >::nelem(), particle_massesFromMetaDataAndPart_species(), and Matrix::resize().

Referenced by particle_massesFromMetaDataSingleCategory_g().

◆ ParticleSpeciesInit()

void ParticleSpeciesInit ( ArrayOfString part_species,
const Verbosity verbosity 
)

WORKSPACE METHOD: ParticleSpeciesInit.

Initializes empty part_species array.

Author
Daniel Kreyling
Parameters
[out]part_speciesWS Output

Definition at line 598 of file m_cloudbox.cc.

Referenced by ParticleSpeciesInit_g().

◆ ParticleSpeciesSet()

void ParticleSpeciesSet ( ArrayOfString part_species,
const ArrayOfString particle_tags,
const String delim,
const Verbosity verbosity 
)

WORKSPACE METHOD: ParticleSpeciesSet.

Sets the WSV part_species. With this function, the user specifies settings for the particle number density calculations using pnd_fieldSetup. The input is an ArrayOfString that needs to be in a specific format, for details, see WSV part_species.

Example:* ['IWC-MH97-Ice-0.1-200', 'LWC-H98_STCO-Water-0.1-50']

NOTE: The order of the Strings need to match the order of the atm_fields_compact* field names, their number determines how many fields of atm_fields_compact are considered particle profiles.

Author
Daniel Kreyling
Parameters
[out]part_speciesWS Output
[in]particle_tagsGeneric Input
[in]delimGeneric Input (Default: "-")

Definition at line 606 of file m_cloudbox.cc.

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

Referenced by ParticleSpeciesSet_g().

◆ ParticleType2abs_speciesAdd()

void ParticleType2abs_speciesAdd ( ArrayOfSingleScatteringData scat_data_array,
ArrayOfGriddedField3 vmr_field_raw,
ArrayOfArrayOfSpeciesTag abs_species,
Index propmat_clearsky_agenda_checked,
Index abs_xsec_agenda_checked,
const Index atmosphere_dim,
const Vector f_grid,
const String filename_scat_data,
const String filename_pnd_field,
const Verbosity verbosity 
)

WORKSPACE METHOD: ParticleType2abs_speciesAdd.

Appends an instance of species 'particles' to abs_species including reading single scattering data and corresponding pnd field.

The methods reads the specified single scattering and pnd_field data and appends the obtained data to scat_data_array and vmr_field_raw*. It also appends one instance of species 'particles' to abs_species.

Author
Jana Mendrok
Parameters
[out]scat_data_arrayWS Output
[out]vmr_field_rawWS Output
[out]abs_speciesWS Output
[out]propmat_clearsky_agenda_checkedWS Output
[out]abs_xsec_agenda_checkedWS Output
[in]atmosphere_dimWS Input
[in]f_gridWS Input
[in]filename_scat_dataGeneric Input
[in]filename_pnd_fieldGeneric Input

Definition at line 759 of file m_cloudbox.cc.

References abs_speciesAdd(), chk_if_in_range(), chk_if_increasing(), chk_pnd_data(), chk_scat_data(), CREATE_OUT1, CREATE_OUT2, my_basic_string< charT >::nelem(), Array< base >::nelem(), ConstVectorView::nelem(), and xml_read_from_file().

Referenced by ParticleType2abs_speciesAdd_g().

◆ ParticleTypeAdd()

void ParticleTypeAdd ( ArrayOfSingleScatteringData scat_data_array,
ArrayOfGriddedField3 pnd_field_raw,
const Index atmosphere_dim,
const Vector f_grid,
const String filename_scat_data,
const String filename_pnd_field,
const Verbosity verbosity 
)

WORKSPACE METHOD: ParticleTypeAdd.

Reads single scattering data and corresonding particle number density fields.

The methods reads the specified files and appends the obtained data to scat_data_array and pnd_field_raw.

Author
Claudia Emde
Parameters
[out]scat_data_arrayWS Output
[out]pnd_field_rawWS Output
[in]atmosphere_dimWS Input
[in]f_gridWS Input
[in]filename_scat_dataGeneric Input
[in]filename_pnd_fieldGeneric Input

Definition at line 643 of file m_cloudbox.cc.

References chk_if_in_range(), chk_if_increasing(), chk_pnd_data(), chk_scat_data(), CREATE_OUT1, CREATE_OUT2, my_basic_string< charT >::nelem(), Array< base >::nelem(), ConstVectorView::nelem(), and xml_read_from_file().

Referenced by ParticleTypeAdd_g().

◆ ParticleTypeAddAll()

void ParticleTypeAddAll ( ArrayOfSingleScatteringData scat_data_array,
ArrayOfGriddedField3 pnd_field_raw,
const Index atmosphere_dim,
const Vector f_grid,
const String filelist_scat_data,
const String filename_pnd_fieldarray,
const Verbosity verbosity 
)

WORKSPACE METHOD: ParticleTypeAddAll.

Reads single scattering data and particle number densities.

The WSV pnd_field_raw containing particle number densities for all scattering particle species can be generated outside ARTS, for example by using PyARTS. This method needs as input an XML-file containing an array of filenames (ArrayOfString) of single scattering data and a file containing the corresponding pnd_field_raw*. In contrast to the scattering data, all corresponding pnd-fields are stored in a single XML-file containing an ArrayofGriddedField3

Important note: The order of the filenames for the scattering data files has to correspond to the order of the pnd-fields, stored in the variable pnd_field_raw*.

Author
Claudia Emde
Parameters
[out]scat_data_arrayWS Output
[out]pnd_field_rawWS Output
[in]atmosphere_dimWS Input
[in]f_gridWS Input
[in]filelist_scat_dataGeneric Input
[in]filename_pnd_fieldarrayGeneric Input

Definition at line 705 of file m_cloudbox.cc.

References chk_if_in_range(), chk_if_increasing(), chk_pnd_raw_data(), chk_scat_data(), CREATE_OUT2, Array< base >::nelem(), ConstVectorView::nelem(), and xml_read_from_file().

Referenced by ParticleTypeAddAll_g().

◆ ParticleTypeInit()

void ParticleTypeInit ( ArrayOfSingleScatteringData scat_data_array,
ArrayOfGriddedField3 pnd_field_raw,
const Verbosity verbosity 
)

WORKSPACE METHOD: ParticleTypeInit.

Initializes scat_data_array and pnd_field_raw.

This method initializes variables containing data about the optical properties of particles (scat_data_array) and about the particle number distribution (pnd_field_raw)

This method has to be executed before executing e.g. ParticleTypeAdd*.

Author
Claudia Emde
Parameters
[out]scat_data_arrayWS Output
[out]pnd_field_rawWS Output

Definition at line 632 of file m_cloudbox.cc.

Referenced by ParticleTypeInit_g().

◆ pnd_fieldCalc()

void pnd_fieldCalc ( Tensor4 pnd_field,
const Vector p_grid,
const Vector lat_grid,
const Vector lon_grid,
const ArrayOfGriddedField3 pnd_field_raw,
const Index atmosphere_dim,
const ArrayOfIndex cloudbox_limits,
const Index zeropadding,
const Verbosity verbosity 
)

WORKSPACE METHOD: pnd_fieldCalc.

Interpolation of particle number density fields to calculation grid inside cloudbox.

This method interpolates the particle number density field from the raw data pnd_field_raw to obtain pnd_field. For 1D cases, where internally GriddedFieldPRegrid and GriddedFieldLatLonRegrid* are applied, zeropadding=1 sets the pnd_field* at pressure levels levels exceeding pnd_field_raw's pressure grid to 0 (not implemented for 2D and 3D yet). Default: zeropadding=0, which throws an error if the calculation pressure grid p_grid* is not completely covered by pnd_field_raw's pressure grid.

Author
Sreerekha T.R.
Claudia Emde
Oliver Lemke
Parameters
[out]pnd_fieldWS Output
[in]p_gridWS Input
[in]lat_gridWS Input
[in]lon_gridWS Input
[in]pnd_field_rawWS Input
[in]atmosphere_dimWS Input
[in]cloudbox_limitsWS Input
[in]zeropaddingGeneric Input (Default: "0")

Definition at line 1092 of file m_cloudbox.cc.

References chk_atm_grids(), chk_pnd_field_raw_only_in_cloudbox(), CREATE_OUT0, FieldFromGriddedField(), GFIELD3_LAT_GRID, GFIELD3_LON_GRID, GFIELD3_P_GRID, GriddedFieldPRegrid(), gridpos(), interp(), interpweights(), joker, Array< base >::nelem(), p2gridpos(), and Tensor4::resize().

Referenced by pnd_fieldCalc_g().

◆ pnd_fieldExpand1D()

void pnd_fieldExpand1D ( Tensor4 pnd_field,
const Index atmosphere_dim,
const Index cloudbox_on,
const ArrayOfIndex cloudbox_limits,
const Index nzero,
const Verbosity verbosity 
)

WORKSPACE METHOD: pnd_fieldExpand1D.

Maps a 1D pnd_field to a (homogeneous) 2D or 3D pnd_field.

This method takes a 1D pnd_field and converts it to a 2D or 3D "cloud". It is assumed that a complete 1D case has been created, and after this atmosphere_dim, lat_grid, lon_grid and cloudbox_limits* have been changed to a 2D or 3D case (without changing the vertical extent of the cloudbox.

No modification of pnd_field is made for the pressure dimension. At the latitude and longitude cloudbox edge points pnd_field is set to zero. This corresponds to nzero=1. If you want a larger margin between the lat and lon cloudbox edges and the "cloud" you increase nzero*, where nzero is the number of grid points for which pnd_field* shall be set to 0, counted from each lat and lon edge.

See further AtmFieldsExpand1D.

Author
Patrick Eriksson
Parameters
[out]pnd_fieldWS Output
[in]atmosphere_dimWS Input
[in]cloudbox_onWS Input
[in]cloudbox_limitsWS Input
[in]nzeroGeneric Input (Default: "1")

Definition at line 1289 of file m_cloudbox.cc.

References ConstTensor4View::nbooks(), ConstTensor4View::ncols(), ConstTensor4View::npages(), ConstTensor4View::nrows(), and Tensor4::resize().

Referenced by pnd_fieldExpand1D_g().

◆ pnd_fieldSetup()

void pnd_fieldSetup ( Tensor4 pnd_field,
const Index atmosphere_dim,
const Index cloudbox_on,
const ArrayOfIndex cloudbox_limits,
const Tensor4 massdensity_field,
const Tensor3 t_field,
const ArrayOfScatteringMetaData scat_meta_array,
const ArrayOfString part_species,
const ArrayOfIndex scat_data_per_part_species,
const String delim,
const Verbosity verbosity 
)

WORKSPACE METHOD: pnd_fieldSetup.

Calculation of pnd_field using ScatteringMetaData and massdensity_field.

The WSM first checks if cloudbox is empty. If so, the pnd calculations will be skipped. The cloudbox_limits are used to determine the p, lat and lon size for the pnd_field tensor. Currently there are three particle size distribution (PSD) parameterisations implemented:

  1. 'MH97' for ice particles. Parameterisation in temperature and mass content. Using a first-order gamma distribution for particles smaller than 100 microns (melted diameter) and a lognormal distribution for particles bigger 100 microns. Values from both modes are cumulative. See internal function 'IWCtopnd_MH97' for implementation/units/output. (src.: McFarquhar G.M., Heymsfield A.J., 1997)
  2. 'H11' for cloud ice and precipitating ice (snow). H11 is NOT dependent on mass content of ice/snow, but only on atmospheric temperature. The PSD is scaled to the current IWC/Snow density in an additional step. See internal function 'pnd_H11' and 'scale_H11' for implementation/units/output. (src.: Heymsfield A.J., 2011, not published yet)
  3. 'H98_STCO' for liquid water clouds. Using a gamma distribution with parameters from Hess et al., 1998, continental stratus. See internal function 'LWCtopnd' for implementation/units/output. (src.: Deirmendjian D., 1963 and Hess M., et al 1998)

According to the selection criteria in part_species, the first specified psd parametrisation is selected together with all particles of specified phase and size. Then pnd calculations are performed on all levels inside the cloudbox. The massdensity_field input weights the pnds by the amount of scattering particles in each gridbox inside the cloudbox. Where massdensity_field is zero, the pnd_field will be zero as well. Subsequently the pnd values get written to pnd_field.

Now the next selection criteria string in part_species is used to repeat the process.The new pnd values will be appended to the existing pnd_field. And so on...

NOTE: the order of scattering particle profiles in massdensity_field has to fit the order of part_species tags!

Author
Daniel Kreyling
Parameters
[out]pnd_fieldWS Output
[in]atmosphere_dimWS Input
[in]cloudbox_onWS Input
[in]cloudbox_limitsWS Input
[in]massdensity_fieldWS Input
[in]t_fieldWS Input
[in]scat_meta_arrayWS Input
[in]part_speciesWS Input
[in]scat_data_per_part_speciesWS Input
[in]delimGeneric Input (Default: "-")

Definition at line 1388 of file m_cloudbox.cc.

References CREATE_OUT1, joker, ConstTensor4View::ncols(), ConstTensor3View::ncols(), Array< base >::nelem(), ConstTensor3View::npages(), ConstTensor4View::npages(), ConstTensor4View::nrows(), ConstTensor3View::nrows(), parse_part_material(), parse_partfield_name(), parse_psd_param(), 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 Tensor4::resize().

Referenced by pnd_fieldSetup_g().

◆ pnd_fieldZero()

void pnd_fieldZero ( Tensor4 pnd_field,
ArrayOfSingleScatteringData scat_data_array,
const Vector p_grid,
const Vector lat_grid,
const Vector lon_grid,
const Verbosity verbosity 
)

WORKSPACE METHOD: pnd_fieldZero.

Sets pnd_field to hold only zeros.

Scattering calculations using the DOIT method include interpolation errors. If one is interested in this effect, one should compare the DOIT result with a clearsky calculation using an empty cloudbox. That means that the iterative method is performed for a cloudbox including no particles. This method sets the particle number density field to zero and creates a dummy scat_data_array structure.

Author
Claudia Emde
Parameters
[out]pnd_fieldWS Output
[out]scat_data_arrayWS Output
[in]p_gridWS Input
[in]lat_gridWS Input
[in]lon_gridWS Input

Definition at line 1344 of file m_cloudbox.cc.

References ConstVectorView::nelem(), nlinspace(), PARTICLE_TYPE_MACROS_ISO, and Tensor4::resize().

Referenced by pnd_fieldZero_g().

◆ pndFromdN()

void pndFromdN ( Vector pnd,
const Vector dN,
const Vector diameter,
const Numeric total_content,
const Vector scatelem_volume,
const Vector scatelem_density,
const Verbosity verbosity 
)

WORKSPACE METHOD: pndFromdN.

Calculates pnds from given dN.

The method mimics what happens inside pnd_fieldSetup, but for a single size distribution. It is supposed to be used with the dN methods.

Author
Jana Mendrok
Parameters
[out]pndGeneric output
[in]dNGeneric Input
[in]diameterGeneric Input
[in]total_contentGeneric Input
[in]scatelem_volumeGeneric Input
[in]scatelem_densityGeneric Input

Definition at line 2072 of file m_cloudbox.cc.

References chk_pndsum(), ConstVectorView::nelem(), Vector::resize(), and scale_pnd().

Referenced by pndFromdN_g().

◆ ScatteringParticlesSelect()

void ScatteringParticlesSelect ( ArrayOfSingleScatteringData scat_data_array,
ArrayOfScatteringMetaData scat_meta_array,
ArrayOfIndex scat_data_per_part_species,
const ArrayOfString part_species,
const String delim,
const Verbosity verbosity 
)

WORKSPACE METHOD: ScatteringParticlesSelect.

Selects data of scat_data_array corresponding to particles that according to part_species shall be considered in the scattering calculation.

Selection is controlled by part_species settings and done based on particle type and size. scat_meta_array is searched for particles that fulfill the selection criteria. Selection is done individually for each element of part_species, i.e. for each considered particle field (implying a sorting of the selected scat_meta_array* and scat_data_array according to the particle field they correspond to). Additionaly scat_data_per_part_species is created, which contains the number of particles that have been selected for each of the particle fields.

Author
Daniel Kreyling
Parameters
[out]scat_data_arrayWS Output
[out]scat_meta_arrayWS Output
[out]scat_data_per_part_speciesWS Output
[in]part_speciesWS Input
[in]delimGeneric Input (Default: "-")

Definition at line 889 of file m_cloudbox.cc.

References CREATE_OUT1, CREATE_OUT3, Array< base >::nelem(), parse_part_material(), parse_part_size(), parse_partfield_name(), and PI.

Referenced by ScatteringParticlesSelect_g().

◆ ScatteringParticleTypeAndMetaRead()

void ScatteringParticleTypeAndMetaRead ( ArrayOfSingleScatteringData scat_data_array,
ArrayOfScatteringMetaData scat_meta_array,
const Vector f_grid,
const String filename_scat_data,
const String filename_scat_meta_data,
const Verbosity verbosity 
)

WORKSPACE METHOD: ScatteringParticleTypeAndMetaRead.

Reads single scattering data and scattering meta data.

This method's input needs two XML-files, one containing an array of path/filenames (ArrayOfString) of single scattering data and the corresponding path/filenames to scattering meta data. For each single scattering file, there needs to be exactly one scattering meta data file.

Currently particles of phase ice and/or water can be added for the same calculation. It is also possible to read SingleScatteringData for different shapes of ice particles. But all ice particels will share the same IWC, while performing the pnd_field calculations with pnd_fieldSetup. Also make sure, that two scattering particles of the same phase are never equal in size. This will break the calculations in pnd_fieldSetup

Very important note: The order of the filenames for the single scattering data files has to exactly correspond to the order of the scattering meta data files.

Author
Daniel Kreyling
Parameters
[out]scat_data_arrayWS Output
[out]scat_meta_arrayWS Output
[in]f_gridWS Input
[in]filename_scat_dataGeneric Input
[in]filename_scat_meta_dataGeneric Input

Definition at line 835 of file m_cloudbox.cc.

References chk_scat_data(), chk_scattering_data(), chk_scattering_meta_data(), CREATE_OUT3, Array< base >::nelem(), and xml_read_from_file().

Referenced by ScatteringParticleTypeAndMetaRead_g().

Variable Documentation

◆ GFIELD3_LAT_GRID

const Index GFIELD3_LAT_GRID

Referenced by pnd_fieldCalc().

◆ GFIELD3_LON_GRID

const Index GFIELD3_LON_GRID

Referenced by pnd_fieldCalc().

◆ GFIELD3_P_GRID

const Index GFIELD3_P_GRID

Referenced by pnd_fieldCalc().

◆ PI

const Numeric PI