ARTS  2.0.49
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"

Go to the source code of this file.

Functions

void cloudboxOff (Index &cloudbox_on, ArrayOfIndex &cloudbox_limits, Agenda &iy_cloudbox_agenda, const Verbosity &)
 WORKSPACE METHOD: cloudboxOff. More...
 
void cloudboxSetAutomatically (Index &cloudbox_on, ArrayOfIndex &cloudbox_limits, const Index &atmosphere_dim, const ArrayOfString &part_species, 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 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 cloudbox_checkedCalc (Index &cloudbox_checked, const Index &basics_checked, const Index &atmosphere_dim, const Vector &p_grid, const Vector &lat_grid, const Vector &lon_grid, const Tensor3 &wind_u_field, const Tensor3 &wind_v_field, const Tensor3 &wind_w_field, const Index &cloudbox_on, const ArrayOfIndex &cloudbox_limits, const Verbosity &)
 WORKSPACE METHOD: cloudbox_checkedCalc. 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 &names, const Verbosity &verbosity)
 WORKSPACE METHOD: ParticleSpeciesSet. More...
 
void ParticleTypeInit (ArrayOfSingleScatteringData &scat_data_raw, ArrayOfGriddedField3 &pnd_field_raw, const Verbosity &)
 WORKSPACE METHOD: ParticleTypeInit. More...
 
void ParticleTypeAddAll (ArrayOfSingleScatteringData &scat_data_raw, ArrayOfGriddedField3 &pnd_field_raw, const Index &atmosphere_dim, const Vector &f_grid, const Vector &p_grid, const Vector &lat_grid, const Vector &lon_grid, const ArrayOfIndex &cloudbox_limits, const String &filename_scat_data, const String &pnd_field_file, const Verbosity &verbosity)
 WORKSPACE METHOD: ParticleTypeAddAll. More...
 
void ScatteringParticleTypeAndMetaRead (ArrayOfSingleScatteringData &scat_data_raw, ArrayOfScatteringMetaData &scat_data_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_raw, ArrayOfScatteringMetaData &scat_data_meta_array, ArrayOfIndex &scat_data_nelem, const ArrayOfString &part_species, const Verbosity &verbosity)
 WORKSPACE METHOD: ScatteringParticlesSelect. More...
 
void ParticleTypeAdd (ArrayOfSingleScatteringData &scat_data_raw, ArrayOfGriddedField3 &pnd_field_raw, const Index &atmosphere_dim, const Vector &f_grid, const Vector &p_grid, const Vector &lat_grid, const Vector &lon_grid, const ArrayOfIndex &cloudbox_limits, const String &scat_data_file, const String &pnd_field_file, const Verbosity &verbosity)
 WORKSPACE METHOD: ParticleTypeAdd. 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 Verbosity &)
 WORKSPACE METHOD: pnd_fieldCalc. More...
 
void pnd_fieldExpand1D (Tensor4 &pnd_field, const Index &atmosphere_dim, const Index &cloudbox_checked, 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_raw, 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_data_meta_array, const ArrayOfString &part_species, const ArrayOfIndex &scat_data_nelem, const Verbosity &verbosity)
 WORKSPACE METHOD: pnd_fieldSetup. More...
 

Variables

const Index GFIELD3_P_GRID
 
const Index GFIELD3_LAT_GRID
 
const Index GFIELD3_LON_GRID
 
const Numeric DEG2RAD
 
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

◆ cloudbox_checkedCalc()

void cloudbox_checkedCalc ( Index cloudbox_checked,
const Index basics_checked,
const Index atmosphere_dim,
const Vector p_grid,
const Vector lat_grid,
const Vector lon_grid,
const Tensor3 wind_u_field,
const Tensor3 wind_v_field,
const Tensor3 wind_w_field,
const Index cloudbox_on,
const ArrayOfIndex cloudbox_limits,
const Verbosity verbosity 
)

WORKSPACE METHOD: cloudbox_checkedCalc.

Checks consistency between the cloudbox and other variables.

The following WSVs are treated: cloudbox_on, cloudbox_limits and wind_u/v/w_field. If any of these variables are changed, then this method shall be called again (no automatic check that this is fulfilled!).

The main check is if the cloudbox limits are OK with respect to the atmospheric dimensionality and the limits of the atmosphere.

If any test fails, there is an error. Otherwise, cloudbox_checked is set to 1.

Author
Patrick Eriksson
Parameters
[out]cloudbox_checkedWS Output
[in]basics_checkedWS Input
[in]atmosphere_dimWS Input
[in]p_gridWS Input
[in]lat_gridWS Input
[in]lon_gridWS Input
[in]wind_u_fieldWS Input
[in]wind_v_fieldWS Input
[in]wind_w_fieldWS Input
[in]cloudbox_onWS Input
[in]cloudbox_limitsWS Input

Definition at line 555 of file m_cloudbox.cc.

References abs, chk_if_bool(), DEG2RAD, max, Array< base >::nelem(), ConstVectorView::nelem(), and ConstTensor3View::npages().

Referenced by cloudbox_checkedCalc_g().

◆ cloudboxOff()

void cloudboxOff ( Index cloudbox_on,
ArrayOfIndex cloudbox_limits,
Agenda iy_cloudbox_agenda,
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 to be an empty vector and iy_cloudbox_agenda to an empty agenda.

Author
Patrick Eriksson
Parameters
[out]cloudbox_onWS Output
[out]cloudbox_limitsWS Output
[out]iy_cloudbox_agendaWS Output

Definition at line 77 of file m_cloudbox.cc.

References Agenda::set_name().

Referenced by cloudboxOff_g().

◆ cloudboxSetAutomatically()

void cloudboxSetAutomatically ( Index cloudbox_on,
ArrayOfIndex cloudbox_limits,
const Index atmosphere_dim,
const ArrayOfString part_species,
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]part_speciesWS 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 92 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::ncols(), Array< base >::nelem(), ConstVectorView::nelem(), ConstTensor4View::npages(), ConstTensor4View::nrows(), and parse_part_type().

Referenced by cloudboxSetAutomatically_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 350 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 453 of file m_cloudbox.cc.

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

Referenced by cloudboxSetManuallyAltitude_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 700 of file m_cloudbox.cc.

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

Referenced by Massdensity_cleanup_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 728 of file m_cloudbox.cc.

Referenced by ParticleSpeciesInit_g().

◆ ParticleSpeciesSet()

void ParticleSpeciesSet ( ArrayOfString part_species,
const ArrayOfString names,
const Verbosity verbosity 
)

WORKSPACE METHOD: ParticleSpeciesSet.

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:

Example:* ['IWC-MH97-0.1-200', 'LWC-liquid-0.1-50']

The order of the Strings can be arbitrarily chosen.

For more details, see WSV part_species.

Author
Daniel Kreyling
Parameters
[out]part_speciesWS Output
[in]namesGeneric Input

Definition at line 736 of file m_cloudbox.cc.

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

Referenced by ParticleSpeciesSet_g().

◆ ParticleTypeAdd()

void ParticleTypeAdd ( ArrayOfSingleScatteringData scat_data_raw,
ArrayOfGriddedField3 pnd_field_raw,
const Index atmosphere_dim,
const Vector f_grid,
const Vector p_grid,
const Vector lat_grid,
const Vector lon_grid,
const ArrayOfIndex cloudbox_limits,
const String filename_scat_data,
const String filename_pnd_field,
const Verbosity verbosity 
)

WORKSPACE METHOD: ParticleTypeAdd.

This method reads single scattering data and the corresonding particle number density fields.

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

Author
Claudia Emde
Parameters
[out]scat_data_rawWS Output
[out]pnd_field_rawWS Output
[in]atmosphere_dimWS Input
[in]f_gridWS Input
[in]p_gridWS Input
[in]lat_gridWS Input
[in]lon_gridWS Input
[in]cloudbox_limitsWS Input
[in]filename_scat_dataGeneric Input
[in]filename_pnd_fieldGeneric Input

Definition at line 994 of file m_cloudbox.cc.

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

Referenced by ParticleTypeAdd_g().

◆ ParticleTypeAddAll()

void ParticleTypeAddAll ( ArrayOfSingleScatteringData scat_data_raw,
ArrayOfGriddedField3 pnd_field_raw,
const Index atmosphere_dim,
const Vector f_grid,
const Vector p_grid,
const Vector lat_grid,
const Vector lon_grid,
const ArrayOfIndex cloudbox_limits,
const String filename_scat_data,
const String filename_pnd_field,
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

Very 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_rawWS Output
[out]pnd_field_rawWS Output
[in]atmosphere_dimWS Input
[in]f_gridWS Input
[in]p_gridWS Input
[in]lat_gridWS Input
[in]lon_gridWS Input
[in]cloudbox_limitsWS Input
[in]filename_scat_dataGeneric Input
[in]filename_pnd_fieldGeneric Input

Definition at line 770 of file m_cloudbox.cc.

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

Referenced by ParticleTypeAddAll_g().

◆ ParticleTypeInit()

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

WORKSPACE METHOD: ParticleTypeInit.

Initializes scat_data_raw and pnd_field_raw.

This method initializes variables containing data about the optical properties of particles (scat_data_raw) 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_rawWS Output
[out]pnd_field_rawWS Output

Definition at line 759 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 Verbosity verbosity 
)

WORKSPACE METHOD: pnd_fieldCalc.

Interpolates the particle number density fields.

This methods interpolates the particle number density field from the raw data pnd_field_raw to obtain pnd_field.

Author
Sreerekha T.R.
Claudia Emde
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

Definition at line 1065 of file m_cloudbox.cc.

References chk_atm_grids(), chk_pnd_field_raw_only_in_cloudbox(), GFIELD3_LAT_GRID, GFIELD3_LON_GRID, GFIELD3_P_GRID, 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_checked,
const Index cloudbox_on,
const ArrayOfIndex cloudbox_limits,
const Index nzero,
const Verbosity verbosity 
)

WORKSPACE METHOD: pnd_fieldExpand1D.

Maps a 1D pnd_field to 2D or 3D pnd_field.

This method takes a 1D pnd_field and converts it to 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. This without changing the vertical extension of the cloudbox.

No modification of pnd_field is made for the pressure dimension. At the latitude and longitude cloudbox edges pnd_field is set to zero. This corresponds to nzero=1. If you want a larger margin between the lat and lon cloudbox edgess 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_checkedWS Input
[in]cloudbox_onWS Input
[in]cloudbox_limitsWS Input
[in]nzeroGeneric Input (Default: "1")

Definition at line 1231 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_data_meta_array,
const ArrayOfString part_species,
const ArrayOfIndex scat_data_nelem,
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 parameterisations implemented:

  1. MH97 for ice particles. 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 ice particles and precepitating ice (snow). H11 in NOT dependent on massdensity of ice/snow, but 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. Gamma distribution for liquid cloud particles. 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 is HARD WIRED!

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_data_meta_arrayWS Input
[in]part_speciesWS Input
[in]scat_data_nelemWS Input

Definition at line 1331 of file m_cloudbox.cc.

References chk_pndsum(), get_sorted_indexes(), IWCtopnd_MH97(), joker, LWCtopnd(), ConstTensor3View::ncols(), ConstTensor4View::ncols(), Array< base >::nelem(), ConstVectorView::nelem(), ConstTensor3View::npages(), ConstTensor4View::npages(), ConstTensor3View::nrows(), ConstTensor4View::nrows(), parse_part_type(), parse_psd_param(), PI, psd_H11(), Tensor4::resize(), scale_H11(), and scale_pnd().

Referenced by pnd_fieldSetup_g().

◆ pnd_fieldZero()

void pnd_fieldZero ( Tensor4 pnd_field,
ArrayOfSingleScatteringData scat_data_raw,
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_raw structure.

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

Definition at line 1287 of file m_cloudbox.cc.

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

Referenced by pnd_fieldZero_g().

◆ ScatteringParticlesSelect()

void ScatteringParticlesSelect ( ArrayOfSingleScatteringData scat_data_raw,
ArrayOfScatteringMetaData scat_data_meta_array,
ArrayOfIndex scat_data_nelem,
const ArrayOfString part_species,
const Verbosity verbosity 
)

WORKSPACE METHOD: ScatteringParticlesSelect.

This method is a selection function for scattering particles.

In part_species the user defines selection criteria for: ...which type of scattering particle profile ...what particle size ditribution parametrisation ...the minimum and maximum size of the particle (in terms of volume equivalent radius) to use in the scattering calculations. Minimum and maximum size may be omitted or symbol "*" be used as a wildcard.

The scattering particle arrays, scat_data_raw and scat_data_meta_array are searched for particles, that fullfill the selection criteria. Only these particles will be used for scattering calculations.

Additionaly an ArrayOfIndex scat_data_nelem is created. This Array stores the number of scattering particles, that have been selected by each selection string in part_species

Author
Daniel Kreyling
Parameters
[out]scat_data_rawWS Output
[out]scat_data_meta_arrayWS Output
[out]scat_data_nelemWS Output
[in]part_speciesWS Input

Definition at line 885 of file m_cloudbox.cc.

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

Referenced by ScatteringParticlesSelect_g().

◆ ScatteringParticleTypeAndMetaRead()

void ScatteringParticleTypeAndMetaRead ( ArrayOfSingleScatteringData scat_data_raw,
ArrayOfScatteringMetaData scat_data_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_rawWS Output
[out]scat_data_meta_arrayWS Output
[in]f_gridWS Input
[in]filename_scat_dataGeneric Input
[in]filename_scat_meta_dataGeneric Input

Definition at line 832 of file m_cloudbox.cc.

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

Referenced by ScatteringParticleTypeAndMetaRead_g().

Variable Documentation

◆ DEG2RAD

const Numeric DEG2RAD
extern

Referenced by cloudbox_checkedCalc().

◆ GFIELD3_LAT_GRID

const Index GFIELD3_LAT_GRID
extern

Referenced by pnd_fieldCalc().

◆ GFIELD3_LON_GRID

const Index GFIELD3_LON_GRID
extern

Referenced by pnd_fieldCalc().

◆ GFIELD3_P_GRID

const Index GFIELD3_P_GRID
extern

Referenced by pnd_fieldCalc().

◆ PI

const Numeric PI
extern