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

Internal cloudbox functions. More...

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

Go to the source code of this file.

Functions

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_scat_species (const ArrayOfString &scat_species, const String &delim)
 Check validity of scat_species setting. More...
 
void chk_scattering_data (const ArrayOfSingleScatteringData &scat_data, const ArrayOfScatteringMetaData &scat_meta, const Verbosity &verbosity)
 Check scattering data general. More...
 
void chk_scattering_meta_data (const ScatteringMetaData &scat_meta_single, const String &scat_meta_file, const Verbosity &verbosity)
 Check scattering data meta. More...
 
void chk_scat_data (const SingleScatteringData &scat_data, const Verbosity &verbosity)
 Check single scattering data. 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=3)
 
bool is_inside_cloudbox (const Ppath &ppath_step, const ArrayOfIndex &cloudbox_limits, const bool include_boundaries)
 
void bin_quadweights (Vector &w, const Vector &x, const Index &order=1)
 
void chk_scat_species_field (bool &empty_flag, const Tensor3 &scat_species_field, const String &fieldname, const Index &dim, const Vector &p_grid, const Vector &lat_grid, const Vector &lon_grid)
 Check whether field of a specific scattering species zero everywhere. More...
 
void find_cloudlimits (Index &lower, Index &upper, const Tensor3 &scat_species_field, const Index &atmosphere_dim, const Numeric &cloudbox_margin)
 Adjust uppermost and lowermost cloudy level for one scat_species_*_*_field. More...
 
void parse_atmcompact_speciestype (String &species_type, const String &field_name, const String &delim)
 
void parse_atmcompact_speciesname (String &species_name, const String &field_name, const String &delim)
 
void parse_atmcompact_scattype (String &scat_type, const String &field_name, const String &delim)
 
void parse_partfield_name (String &partfield_name, const String &part_string, const String &delim)
 

Detailed Description

Internal cloudbox functions.

Author
Claudia Emde claud.nosp@m.ia.e.nosp@m.mde@d.nosp@m.lr.d.nosp@m.e
Date
Thu May 23 14:34:05 2002

Definition in file cloudbox.h.

Function Documentation

◆ bin_quadweights()

void bin_quadweights ( Vector w,
const Vector x,
const Index order 
)

Derives weights of a bin-type quadrature for arbitrary wide bins.

Note: Rectangular and trapezoidal rule essentially give the same weights when considering the same nodes x (not the mid-points between the nodes as rectangular is sometimes using) and limiting the quadrature range by the first and last node). Keyword order=0 calculates rectangular bins (ie bins extend beyond the first and last nodes), order=1 to trapezoidal bins (ie bins end exactly at nodes).

Parameters
wresulting weights at ordinates.
xordinates.
orderorder of quadrature (see above for details).
Author
Jana Mendrok, Daniel Kreyling
Date
2017-06-16

Definition at line 572 of file cloudbox.cc.

References ARTS_ASSERT, is_increasing(), min, ConstVectorView::nelem(), and w.

Referenced by pndFromPsd(), and pndFromPsdBasic().

◆ 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_fieldCalcFrompnd_field_raw).

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

Definition at line 67 of file cloudbox.cc.

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

Referenced by chk_pnd_raw_data(), ScatElementsPndAndScatAdd(), and ScatElementsToabs_speciesAdd().

◆ 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 140 of file cloudbox.cc.

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

Referenced by pnd_fieldCalcFrompnd_field_raw().

◆ 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 scattering elements)
pnd_field_filepnd field filename
atmosphere_dimAtmospheric dimension
Author
Claudia Emde
Date
2005-04-05

Definition at line 110 of file cloudbox.cc.

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

Referenced by ScatSpeciesPndAndScatAdd().

◆ chk_scat_data()

void chk_scat_data ( const SingleScatteringData scat_data_single,
const Verbosity verbosity 
)

Check single scattering data.

This function checks the self consistency of the data by checking the dimensions of pha_mat, ext_mat and abs_vec depending on the ptype case. It furthermore checks whether the angular grids are defined correctly depending on ptype and the sanity of the temperature grid.

Parameters
scat_data_single[in]Single scattering data of a single scattering element
Author
Claudia Emde
Date
2005-04-04

Definition at line 292 of file cloudbox.cc.

References SingleScatteringData::aa_grid, SingleScatteringData::abs_vec_data, ARTS_ASSERT, ARTS_USER_ERROR_IF, chk_size(), CREATE_OUT3, SingleScatteringData::ext_mat_data, SingleScatteringData::f_grid, last(), ConstVectorView::nelem(), SingleScatteringData::pha_mat_data, SingleScatteringData::ptype, PTYPE_AZIMUTH_RND, PTYPE_GENERAL, PTYPE_TOTAL_RND, SingleScatteringData::T_grid, and SingleScatteringData::za_grid.

Referenced by xml_read_from_stream().

◆ chk_scat_species()

void chk_scat_species ( const ArrayOfString scat_species,
const String delim 
)

Check validity of scat_species setting.

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

  \param scat_species Array of scattering species tags.
Parameters
delimdelimiter string of scat_species elements.
Author
Jana Mendrok
Date
2012-10-25

Definition at line 215 of file cloudbox.cc.

References Absorption::nelem().

◆ chk_scat_species_field()

void chk_scat_species_field ( bool &  empty_flag,
const Tensor3 scat_species_field,
const String fieldname,
const Index dim,
const Vector p_grid,
const Vector lat_grid,
const Vector lon_grid 
)

Check whether field of a specific scattering species zero everywhere.

Returns
empty_flag flag whether all field entries are zero
Parameters
scat_species_fieldscattering species field (e.g. mass density, mass flux, total number density)
fieldnamename of scattering species field (just for info)
dimthe atmosphere dimension
p_gridpressure grid of current atmosphere
lat_gridlatitude grid of current atmosphere
lon_gridlongitude grid of current atmosphere
Author
Daniel Kreyling
Date
2011-01-27

Definition at line 607 of file cloudbox.cc.

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

Referenced by cloudboxSetAutomatically().

◆ chk_scattering_data()

void chk_scattering_data ( const ArrayOfSingleScatteringData scat_data,
const ArrayOfScatteringMetaData scat_meta,
const Verbosity verbosity 
)

Check scattering data general.

FIXME

Parameters
scat_dataArray of single scattering data
scat_metaArray of scattering meta data
Author
Daniel Kreyling
Date
2010-12-02

Definition at line 241 of file cloudbox.cc.

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

◆ chk_scattering_meta_data()

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

Check scattering data meta.

FIXME

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

Definition at line 260 of file cloudbox.cc.

References CREATE_OUT3.

◆ find_cloudlimits()

void find_cloudlimits ( Index lower,
Index upper,
const Tensor3 scat_species_field,
const Index atmosphere_dim,
const Numeric cloudbox_margin 
)

Adjust uppermost and lowermost cloudy level for one scat_species_*_*_field.

lower and upper levels have to be preinitialized before calling this function.

Parameters
[in,out]lowerlowermost level containing scattering particles
[in,out]upperuppermost level containing scattering particles
[in]scat_species_fieldscattering species field (e.g. mass density, mass flux, total number density)
[in]atmosphere_dimthe atmosphere dimension
[in]cloudbox_marginflag whether to determine lowermost level or set to surface
Author
Daniel Kreyling, Jana Mendrok
Date
2015-02-09

Definition at line 666 of file cloudbox.cc.

References ARTS_USER_ERROR, nonstd::isnan(), joker, max, and ConstTensor3View::npages().

Referenced by cloudboxSetAutomatically().

◆ 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 460 of file cloudbox.cc.

References fractional_gp().

Referenced by get_ppath_cloudvars(), get_ppath_transmat(), is_inside_cloudbox(), iyIndependentBeamApproximation(), and mcPathTraceRadar().

◆ 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 540 of file cloudbox.cc.

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

Referenced by cloud_ppath_update3D().

◆ parse_atmcompact_scattype()

void parse_atmcompact_scattype ( String scat_type,
const String field_name,
const String delim 
)

Parse atm_field_compact fieldname for type of scat_species field

Parameters
scat_typespecies name (second part of field_name)
field_namefieldname of atm_field_compact data entry
delimdelimiter string of field_name
Author
Jana Mendrok
Date
2014-11-20

Definition at line 860 of file cloudbox.cc.

References ARTS_USER_ERROR, and my_basic_string< charT >::split().

Referenced by AtmFieldsAndParticleBulkPropFieldFromCompact().

◆ parse_atmcompact_speciesname()

void parse_atmcompact_speciesname ( String species_name,
const String field_name,
const String delim 
)

Parse atm_field_compact fieldname for species name

Parameters
species_typespecies name (second part of field_name)
field_namefieldname of atm_field_compact data entry
delimdelimiter string of field_name
Author
Jana Mendrok
Date
2014-11-20

Definition at line 829 of file cloudbox.cc.

References ARTS_USER_ERROR, and my_basic_string< charT >::split().

Referenced by abs_lookupSetupBatch(), and AtmFieldsAndParticleBulkPropFieldFromCompact().

◆ parse_atmcompact_speciestype()

void parse_atmcompact_speciestype ( String species_type,
const String field_name,
const String delim 
)

Parse atm_field_compact fieldname for species type

Parameters
species_typespecies indentifier (first part of field_name)
field_namefieldname of atm_field_compact data entry
delimdelimiter string of field_name
Author
Jana Mendrok
Date
2014-11-20

Definition at line 798 of file cloudbox.cc.

References ARTS_USER_ERROR, and my_basic_string< charT >::split().

Referenced by abs_lookupSetupBatch(), and AtmFieldsAndParticleBulkPropFieldFromCompact().

◆ parse_partfield_name()

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

Splitting scat_species string and parse type of scattering species field

Parameters
partfield_namename of atmospheric scattering species field
part_stringscattering species tag from scat_species
delimdelimiter string of scat_species elements
Author
Daniel Kreyling
Date
2011-02-21

Definition at line 891 of file cloudbox.cc.

References ARTS_USER_ERROR, and my_basic_string< charT >::split().

Referenced by ScatElementsSelect(), and ScatSpeciesExtendTemperature().