ARTS
2.0.49
|
Internal cloudbox functions. More...
#include "matpackVII.h"
#include "interpolation.h"
#include "optproperties.h"
#include "array.h"
#include "gridded_fields.h"
#include "ppath.h"
#include "messages.h"
Go to the source code of this file.
Functions | |
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, ConstVectorView p_grid, ConstVectorView lat_grid, ConstVectorView lon_grid, const ArrayOfIndex &cloudbox_limits, 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, ConstVectorView p_grid, ConstVectorView lat_grid, ConstVectorView lon_grid, const ArrayOfIndex &cloudbox_limits, const Verbosity &verbosity) |
Check particle number density files (pnd_field_raw) More... | |
void | chk_scattering_data (const ArrayOfSingleScatteringData &scat_data_raw, const ArrayOfScatteringMetaData &scat_data_meta_array, const Verbosity &verbosity) |
Check scattering data general. More... | |
void | chk_scattering_meta_data (const ScatteringMetaData &scat_data_meta, const String &scat_data_meta_file, const Verbosity &verbosity) |
Check scattering data meta files. More... | |
void | chk_single_scattering_data (const SingleScatteringData &scat_data_raw, 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) |
bool | is_inside_cloudbox (const Ppath &ppath_step, const ArrayOfIndex &cloudbox_limits, const bool include_boundaries) |
Numeric | barometric_heightformula (const Numeric &p, const Numeric &dh) |
Numeric | IWCtopnd_MH97 (const Numeric iwc, Numeric dm, const Numeric t, const Numeric density) |
Numeric | psd_H11 (const Numeric xwc, const Numeric d, const Numeric t) |
Numeric | LWCtopnd (const Numeric lwc, const Numeric r) |
Numeric | LWCtopnd2 (const Numeric r) |
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 Verbosity &verbosity) |
void | scale_H11 (Vector &pnd, const Numeric xwc, const Vector &density, const Vector &vol) |
void | chk_massdensity_field (bool &x, 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 | parse_part_type (String &part_type, const String &part_string) |
void | parse_psd_param (String &psd_param, const String &part_string) |
void | parse_part_size (Numeric &sizemin, Numeric &sizemax, const String &part_string) |
barometric heightformula for isothermal earth atmosphere
p | atmospheric pressure at starting level [Pa] |
dh | vertical displacement to starting pressure level [m] |
Definition at line 786 of file cloudbox.cc.
References M.
Referenced by cloudboxSetAutomatically().
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.
i_lat | Latitude index |
pnd_field_raw | Particle number density data |
pnd_field_file | pnd field filename |
Definition at line 181 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().
Referenced by chk_pnd_data().
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.
i_lon | Latitude index |
pnd_field_raw | Particle number density data |
pnd_field_file | pnd field filename |
Definition at line 227 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().
Referenced by chk_pnd_data().
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.
i_p | Pressure index |
pnd_field_raw | Particle number density data |
pnd_field_file | pnd field filename |
Definition at line 135 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().
Referenced by chk_pnd_data().
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.
dim | atmosphere dimension |
hydromet | hydrometeor grid in p, lat or lon dimension |
p_grid | p grid of current atmosphere |
lat_grid | lat grid of current atmosphere |
lon_grid | lon grid of current atmosphere |
Definition at line 62 of file cloudbox.cc.
References ConstTensor3View::ncols(), ConstVectorView::nelem(), ConstTensor3View::npages(), and ConstTensor3View::nrows().
Referenced by cloudboxSetAutomatically().
void chk_pnd_data | ( | const GriddedField3 & | pnd_field_raw, |
const String & | pnd_field_file, | ||
const Index & | atmosphere_dim, | ||
ConstVectorView | p_grid, | ||
ConstVectorView | lat_grid, | ||
ConstVectorView | lon_grid, | ||
const ArrayOfIndex & | cloudbox_limits, | ||
const Verbosity & | verbosity | ||
) |
Check particle number density files.
This function checks, whether the particle number density file has the right atmospheric dimension and whether the cloudbox includes all points where the particle number density is non-zero.
pnd_field_raw | pnd field data |
pnd_field_file | pnd field filename |
atmosphere_dim | Atmospheric dimension |
p_grid | Pressure grid |
lat_grid | Latitude grid |
lon_grid | Longitude grid |
cloudbox_limits | Cloudbox limits |
Definition at line 283 of file cloudbox.cc.
References chk_if_pnd_zero_lat(), chk_if_pnd_zero_lon(), chk_if_pnd_zero_p(), CREATE_OUT3, GriddedField::get_numeric_grid(), GFIELD3_LAT_GRID, GFIELD3_LON_GRID, GFIELD3_P_GRID, and ConstVectorView::nelem().
Referenced by chk_pnd_raw_data(), and ParticleTypeAdd().
void chk_pnd_raw_data | ( | const ArrayOfGriddedField3 & | pnd_field_raw, |
const String & | pnd_field_file, | ||
const Index & | atmosphere_dim, | ||
ConstVectorView | p_grid, | ||
ConstVectorView | lat_grid, | ||
ConstVectorView | lon_grid, | ||
const ArrayOfIndex & | cloudbox_limits, | ||
const Verbosity & | verbosity | ||
) |
Check particle number density files (pnd_field_raw)
pnd_field_raw | pnd field raw data (array for all particle types) |
pnd_field_file | pnd field filename |
atmosphere_dim | Atmospheric dimension |
p_grid | Pressure grid |
lat_grid | Latitude grid |
lon_grid | Longitude grid |
cloudbox_limits | Cloudbox limits |
Definition at line 394 of file cloudbox.cc.
References chk_pnd_data(), CREATE_OUT3, and Array< base >::nelem().
Referenced by ParticleTypeAddAll().
void chk_pndsum | ( | Vector & | pnd, |
const Numeric | xwc, | ||
const Vector & | vol, | ||
const Vector & | density, | ||
const Index & | p, | ||
const Index & | lat, | ||
const Index & | lon, | ||
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 [g/m3] \param xwc atmospheric massdensity [g/m3] \param density scattering particle density [g/m3] \param vol scattering particle volume [m3]
Definition at line 1080 of file cloudbox.cc.
References CREATE_OUT1, CREATE_OUT2, and ConstVectorView::nelem().
Referenced by pnd_fieldSetup().
void chk_scattering_data | ( | const ArrayOfSingleScatteringData & | scat_data_raw, |
const ArrayOfScatteringMetaData & | scat_data_meta_array, | ||
const Verbosity & | |||
) |
Check scattering data general.
FIXME
scat_data_raw | Array of single scattering data |
scat_data_meta_array | Array of scattering meta data |
Definition at line 427 of file cloudbox.cc.
References Array< base >::nelem().
Referenced by ScatteringParticleTypeAndMetaRead().
void chk_scattering_meta_data | ( | const ScatteringMetaData & | scat_data_meta, |
const String & | scat_data_meta_file, | ||
const Verbosity & | verbosity | ||
) |
Check scattering data meta files.
FIXME
scat_data_meta | scattering meta data |
scat_data_meta_file | filename of the data to be checked |
Definition at line 454 of file cloudbox.cc.
References CREATE_OUT2, and ScatteringMetaData::type.
Referenced by ScatteringParticleTypeAndMetaRead().
void chk_single_scattering_data | ( | const SingleScatteringData & | scat_data_raw, |
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 depening on the ptype case.
scat_data_raw | Single scattering data |
scat_data_file | Filename of the data to be checked. |
f_grid | Frequency grid |
Definition at line 486 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(), PARTICLE_TYPE_GENERAL, PARTICLE_TYPE_HORIZ_AL, PARTICLE_TYPE_MACROS_ISO, PARTICLE_TYPE_SPHERICAL, SingleScatteringData::pha_mat_data, SingleScatteringData::ptype, SingleScatteringData::T_grid, and SingleScatteringData::za_grid.
Referenced by ParticleTypeAdd(), ParticleTypeAddAll(), and ScatteringParticleTypeAndMetaRead().
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 | ||
) |
Checks, whether a gridpoint is inside the cloudbox.
gp_p | pressure GridPos |
gp_lat | latitude GridPos |
gp_lon | longitude GridPos |
cloudbox_limits | The limits of the cloudbox. |
include_boundaries | boolean: determines whther or not points on the boundary are considered to be inside the cloudbox. |
Definition at line 689 of file cloudbox.cc.
References fractional_gp().
Referenced by is_inside_cloudbox(), and mcPathTraceIPA().
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.
ppath_step | Propagation path step. |
cloudbox_limits | The limits of the cloudbox. |
include_boundaries | boolean: determines whther or not points on the boundary are considered to be inside the cloudbox. |
Definition at line 764 of file cloudbox.cc.
References Ppath::gp_lat, Ppath::gp_lon, Ppath::gp_p, is_gp_inside_cloudbox(), and Ppath::np.
Referenced by cloud_ppath_update3D(), mcPathTraceGeneral(), and mcPathTraceIPA().
Numeric IWCtopnd_MH97 | ( | const Numeric | iwc, |
const Numeric | dm, | ||
const Numeric | t, | ||
const Numeric | density | ||
) |
Calculates particle size distribution using MH97 parametrization. Each diameter of the scattering particles is a node in the ditribution. One call of this function, calculates one particle number density.
iwc | atmospheric ice water content [g/m3] |
dm | melted diameter of scattering particle [m] |
t | atmospheric temperature [K] |
density | of the scattering particle [g/m3] |
Definition at line 828 of file cloudbox.cc.
References gamma_func(), min, and PI.
Referenced by pnd_fieldSetup().
Calculates particle size distribution for liquid particles using gamma parametrization. Each radius of the scattering particles is a node in the ditribution. One call of this function, calculates one particle number density.
\return n particle number density per radius interval [#/m3*m] \param lwc atmospheric liquid water content [g/m3] \param r radius of scattering particle [m]
Definition at line 983 of file cloudbox.cc.
References gamma_func(), and PI.
Referenced by pnd_fieldSetup().
Definition at line 1008 of file cloudbox.cc.
References gamma_func().
Splitting part_species string and parse min and max particle radius
sizemin | min scattering particle radius |
sizemax | max scattering particle radius |
part_string | containing infos about scattering particle calculations |
Definition at line 1270 of file cloudbox.cc.
References Array< base >::nelem(), and my_basic_string< charT >::split().
Referenced by ScatteringParticlesSelect().
Splitting part_species string and parse type of massdensity_field
\param part_type type of atmospheric scattering particle profile \param part_string containing infos about scattering particle calculations
Definition at line 1205 of file cloudbox.cc.
References my_basic_string< charT >::split().
Referenced by cloudboxSetAutomatically(), pnd_fieldSetup(), and ScatteringParticlesSelect().
Splitting part_species string and parse psd_param
psd_param | particle size distribution parametrization |
part_string | containing infos about scattering particle calculations |
Definition at line 1240 of file cloudbox.cc.
References my_basic_string< charT >::split().
Referenced by pnd_fieldSetup().
Calculates particle size distribution using H11 parametrization. Each diameter of the scattering particles is a node in the ditribution. One call of this function, calculates one particle number density.
d | maximum diameter of scattering particle [m] |
t | atmospheric temperature [K] |
Definition at line 927 of file cloudbox.cc.
Referenced by pnd_fieldSetup().
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 [g/m3] \param density scattering particle density [g/m3] \param vol scattering particle volume [m3]
Definition at line 1158 of file cloudbox.cc.
References ConstVectorView::nelem(), and ConstVectorView::sum().
Referenced by pnd_fieldSetup().
Scaling pnd values by width of size bin. Bin width is detemined from preceding and following particle size. Vector y and x must be equal in size. Vector w holds the weights. Derived from trapezoid integration rule.
w | weights |
x | e.g. particle radius [m] |
y | e.g. particle number density per radies interval [#/m3*m] |
Definition at line 1040 of file cloudbox.cc.
References ConstVectorView::nelem().
Referenced by pnd_fieldSetup().