scatrte.cc File Reference

This file contains functions to calculate the radiative transfer inside the cloudbox. More...

#include <stdexcept>
#include <iostream>
#include <cstdlib>
#include <cmath>
#include "array.h"
#include "auto_md.h"
#include "matpackVII.h"
#include "ppath.h"
#include "agenda_class.h"
#include "physics_funcs.h"
#include "lin_alg.h"
#include "math_funcs.h"
#include "messages.h"
#include "xml_io.h"
#include "rte.h"
#include "special_interp.h"
#include "scatrte.h"
#include "logic.h"
#include "check_input.h"
#include "sorting.h"

Include dependency graph for scatrte.cc:

Go to the source code of this file.

Functions

void cloud_fieldsCalc (Workspace &ws, Tensor5View ext_mat_field, Tensor4View abs_vec_field, const Agenda &spt_calc_agenda, const Agenda &opt_prop_part_agenda, const Index &scat_za_index, const Index &scat_aa_index, const ArrayOfIndex &cloudbox_limits, const Tensor3View t_field, const Tensor4View pnd_field)
 cloud_fieldsCalc
void cloud_ppath_update1D (Workspace &ws, Tensor6View doit_i_field, const Index &p_index, const Index &scat_za_index, ConstVectorView scat_za_grid, const ArrayOfIndex &cloudbox_limits, ConstTensor6View doit_scat_field, const Agenda &abs_scalar_gas_agenda, ConstTensor4View vmr_field, const Agenda &opt_prop_gas_agenda, const Agenda &ppath_step_agenda, ConstVectorView p_grid, ConstTensor3View z_field, ConstMatrixView r_geoid, ConstMatrixView z_surface, ConstTensor3View t_field, ConstVectorView f_grid, const Index &f_index, ConstTensor5View ext_mat_field, ConstTensor4View abs_vec_field, const Agenda &surface_prop_agenda, const Index &scat_za_interp)
 cloud_ppath_update1D
void cloud_ppath_update1D_noseq (Workspace &ws, Tensor6View doit_i_field, const Index &p_index, const Index &scat_za_index, ConstVectorView scat_za_grid, const ArrayOfIndex &cloudbox_limits, ConstTensor6View doit_i_field_old, ConstTensor6View doit_scat_field, const Agenda &abs_scalar_gas_agenda, ConstTensor4View vmr_field, const Agenda &opt_prop_gas_agenda, const Agenda &ppath_step_agenda, ConstVectorView p_grid, ConstTensor3View z_field, ConstMatrixView r_geoid, ConstMatrixView z_surface, ConstTensor3View t_field, ConstVectorView f_grid, const Index &f_index, ConstTensor5View ext_mat_field, ConstTensor4View abs_vec_field, const Index &scat_za_interp)
 cloud_ppath_update1D_noseq
void cloud_ppath_update3D (Workspace &ws, Tensor6View doit_i_field, const Index &p_index, const Index &lat_index, const Index &lon_index, const Index &scat_za_index, const Index &scat_aa_index, ConstVectorView scat_za_grid, ConstVectorView scat_aa_grid, const ArrayOfIndex &cloudbox_limits, ConstTensor6View doit_scat_field, const Agenda &abs_scalar_gas_agenda, ConstTensor4View vmr_field, const Agenda &opt_prop_gas_agenda, const Agenda &ppath_step_agenda, ConstVectorView p_grid, ConstVectorView lat_grid, ConstVectorView lon_grid, ConstTensor3View z_field, ConstMatrixView r_geoid, ConstMatrixView z_surface, ConstTensor3View t_field, ConstVectorView f_grid, const Index &f_index, ConstTensor5View ext_mat_field, ConstTensor4View abs_vec_field, const Index &)
 Radiative transfer calculation along a path inside the cloudbox (3D).
void cloud_RT_no_background (Workspace &ws, Tensor6View doit_i_field, const Agenda &abs_scalar_gas_agenda, const Agenda &opt_prop_gas_agenda, const Ppath &ppath_step, ConstVectorView t_int, ConstMatrixView vmr_list_int, ConstTensor3View ext_mat_int, ConstMatrixView abs_vec_int, ConstMatrixView sca_vec_int, ConstMatrixView doit_i_field_int, ConstVectorView p_int, const ArrayOfIndex &cloudbox_limits, ConstVectorView f_grid, const Index &f_index, const Index &p_index, const Index &lat_index, const Index &lon_index, const Index &scat_za_index, const Index &scat_aa_index)
 cloud_RT_no_background
void cloud_RT_surface (Workspace &ws, Tensor6View doit_i_field, const Agenda &surface_prop_agenda, const Index &f_index, const Index &stokes_dim, const Ppath &ppath_step, const ArrayOfIndex &cloudbox_limits, ConstVectorView scat_za_grid, const Index &scat_za_index)
 cloud_RT_surface
void ppath_step_in_cloudbox (Workspace &ws, Ppath &ppath_step, const Agenda &ppath_step_agenda, const Index &p, const Index &lat, const Index &lon, ConstTensor3View z_field, ConstMatrixView r_geoid, ConstMatrixView z_surface, ConstVectorView scat_za_grid, ConstVectorView aa_grid, const Index &scat_za_index, const Index &scat_aa_index, ConstVectorView p_grid, ConstVectorView lat_grid, ConstVectorView lon_grid)
void interp_cloud_coeff1D (Tensor3View ext_mat_int, MatrixView abs_vec_int, MatrixView sca_vec_int, MatrixView doit_i_field_int, VectorView t_int, MatrixView vmr_list_int, VectorView p_int, ConstTensor5View ext_mat_field, ConstTensor4View abs_vec_field, ConstTensor6View doit_scat_field, ConstTensor6View doit_i_field, ConstTensor3View t_field, ConstTensor4View vmr_field, ConstVectorView p_grid, const Ppath &ppath_step, const ArrayOfIndex &cloudbox_limits, ConstVectorView scat_za_grid, const Index &scat_za_interp)
 interp_cloud_coeff1D
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)
void cloud_ppath_update1D_planeparallel (Workspace &ws, Tensor6View doit_i_field, const Index &p_index, const Index &scat_za_index, ConstVectorView scat_za_grid, const ArrayOfIndex &cloudbox_limits, ConstTensor6View doit_scat_field, const Agenda &abs_scalar_gas_agenda, ConstTensor4View vmr_field, const Agenda &opt_prop_gas_agenda, const Agenda &ppath_step_agenda, ConstVectorView p_grid, ConstTensor3View z_field, ConstMatrixView r_geoid, ConstTensor3View t_field, ConstVectorView f_grid, const Index &f_index, ConstTensor5View ext_mat_field, ConstTensor4View abs_vec_field)
 Radiative transfer calculation inside cloudbox for planeparallel case.
void za_gridOpt (Vector &za_grid_opt, Matrix &doit_i_field_opt, ConstVectorView za_grid_fine, ConstTensor6View doit_i_field, const Numeric &acc, const Index &scat_za_interp)

Variables

const Numeric PI
const Numeric RAD2DEG


Detailed Description

This file contains functions to calculate the radiative transfer inside the cloudbox.

Author:
Claudia Emde <claudia.emde@dlr.de>
Date:
Wed Jun 04 11:03:57 2003

Definition in file scatrte.cc.


Function Documentation

void cloud_fieldsCalc ( Workspace ws,
Tensor5View  ext_mat_field,
Tensor4View  abs_vec_field,
const Agenda spt_calc_agenda,
const Agenda opt_prop_part_agenda,
const Index scat_za_index,
const Index scat_aa_index,
const ArrayOfIndex cloudbox_limits,
const Tensor3View  t_field,
const Tensor4View  pnd_field 
)

cloud_fieldsCalc

Calculate ext_mat, abs_vec for all points inside the cloudbox for one propagation direction. sca_vec can be obtained from the workspace variable doit_scat_field. As we need the average for each layer, it makes sense to calculte the coefficients once and store them in an array instead of calculating at each point the coefficient of the point above and the point below.

Output

Parameters:
ws Current Workspace
ext_mat_field extinction matrix field
abs_vec_field absorption vector field Input
spt_calc_agenda Agenda for calculation of single scattering properties
opt_prop_part_agenda Agenda for summing over all hydrometeor species
scat_za_index Indices for
scat_aa_index propagation direction
cloudbox_limits Cloudbox limits.
t_field Temperature field
pnd_field Particle number density field.
Author:
Claudia Emde
Date:
2002-06-03

Definition at line 85 of file scatrte.cc.

References joker, ConstTensor4View::nbooks(), ConstTensor4View::ncols(), ConstTensor5View::ncols(), Array< base >::nelem(), ConstTensor5View::nrows(), opt_prop_part_agendaExecute(), out3, and spt_calc_agendaExecute().

Referenced by doit_i_fieldUpdate1D(), doit_i_fieldUpdateSeq1D(), doit_i_fieldUpdateSeq1DPP(), and doit_i_fieldUpdateSeq3D().

void cloud_ppath_update1D ( Workspace ws,
Tensor6View  doit_i_field,
const Index p_index,
const Index scat_za_index,
ConstVectorView  scat_za_grid,
const ArrayOfIndex cloudbox_limits,
ConstTensor6View  doit_scat_field,
const Agenda abs_scalar_gas_agenda,
ConstTensor4View  vmr_field,
const Agenda opt_prop_gas_agenda,
const Agenda ppath_step_agenda,
ConstVectorView  p_grid,
ConstTensor3View  z_field,
ConstMatrixView  r_geoid,
ConstMatrixView  z_surface,
ConstTensor3View  t_field,
ConstVectorView  f_grid,
const Index f_index,
ConstTensor5View  ext_mat_field,
ConstTensor4View  abs_vec_field,
const Agenda surface_prop_agenda,
const Index scat_za_interp 
)

cloud_ppath_update1D

This function calculates the radiation field along a propagation path step for specified zenith direction and pressure level. This function is used in the sequential update and called inside a loop over the pressure grid. In the function the intersection point of the propagation path with the next layer is calculated and all atmospheric properties are interpolated an the intersection point. Then a radiative transfer step is performed.

Parameters:
[in,out] ws Current Workspace WS Output:
[out] doit_i_field Updated radiation field inside the cloudbox. WS Input:
p_index // Pressure index
scat_za_index // Index for proagation direction
scat_za_grid 
cloudbox_limits 
doit_scat_field Scattered field. Calculate scalar gas absorption:
abs_scalar_gas_agenda 
vmr_field Scalar gas absorption:
opt_prop_gas_agenda Propagation path calculation:
ppath_step_agenda 
p_grid 
z_field 
r_geoid 
z_surface Calculate thermal emission:
t_field 
f_grid 
f_index Optical properties of particles
ext_mat_field 
abs_vec_field 
surface_prop_agenda 
scat_za_interp 
Author:
Claudia Emde
Date:
2003-06-04

Definition at line 244 of file scatrte.cc.

References abs, cloud_RT_no_background(), cloud_RT_surface(), Ppath::gp_p, interp_cloud_coeff1D(), Ppath::los, ConstTensor4View::nbooks(), ConstTensor6View::ncols(), Ppath::np, Ppath::pos, ppath_init_structure(), ppath_step_agendaExecute(), ppath_what_background(), and Ppath::z.

Referenced by doit_i_fieldUpdateSeq1D().

void cloud_ppath_update1D_noseq ( Workspace ws,
Tensor6View  doit_i_field,
const Index p_index,
const Index scat_za_index,
ConstVectorView  scat_za_grid,
const ArrayOfIndex cloudbox_limits,
ConstTensor6View  doit_i_field_old,
ConstTensor6View  doit_scat_field,
const Agenda abs_scalar_gas_agenda,
ConstTensor4View  vmr_field,
const Agenda opt_prop_gas_agenda,
const Agenda ppath_step_agenda,
ConstVectorView  p_grid,
ConstTensor3View  z_field,
ConstMatrixView  r_geoid,
ConstMatrixView  z_surface,
ConstTensor3View  t_field,
ConstVectorView  f_grid,
const Index f_index,
ConstTensor5View  ext_mat_field,
ConstTensor4View  abs_vec_field,
const Index scat_za_interp 
)

void cloud_ppath_update1D_planeparallel ( Workspace ws,
Tensor6View  doit_i_field,
const Index p_index,
const Index scat_za_index,
ConstVectorView  scat_za_grid,
const ArrayOfIndex cloudbox_limits,
ConstTensor6View  doit_scat_field,
const Agenda abs_scalar_gas_agenda,
ConstTensor4View  vmr_field,
const Agenda opt_prop_gas_agenda,
const Agenda ppath_step_agenda,
ConstVectorView  p_grid,
ConstTensor3View  z_field,
ConstMatrixView  r_geoid,
ConstTensor3View  t_field,
ConstVectorView  f_grid,
const Index f_index,
ConstTensor5View  ext_mat_field,
ConstTensor4View  abs_vec_field 
)

Radiative transfer calculation inside cloudbox for planeparallel case.

This function calculates the radiation field along a line of sight. This function is used for the sequential update of the radiation field and called inside a loop over the pressure grid.

The function gets all the atmospheric points on the pressure grid. Then a radiative transfer step is performed using the stokes vector as output and input. The inermediate Stokes vectors are stored in the WSV doit_i_field.

Parameters:
[in,out] ws Current Workspace WS Output:
[out] doit_i_field Updated radiation field inside the cloudbox. Variables used in opt_prop_xxx_agenda: WS Input:
p_index // Pressure index
scat_za_index // Index for proagation direction
scat_za_grid 
cloudbox_limits 
doit_scat_field Scattered field. Calculate scalar gas absorption:
abs_scalar_gas_agenda 
vmr_field Scalar gas absorption:
opt_prop_gas_agenda Propagation path calculation:
ppath_step_agenda 
p_grid 
z_field 
r_geoid Calculate thermal emission:
t_field 
f_grid 
f_index 
ext_mat_field 
abs_vec_field 
Author:
Sreerekha Ravi
Date:
2003-11-17

Definition at line 1466 of file scatrte.cc.

References abs, abs_scalar_gas_agendaExecute(), is_singular(), joker, ConstTensor4View::nbooks(), ConstTensor6View::ncols(), opt_prop_gas_agendaExecute(), out3, PI, planck(), and rte_step_std().

Referenced by doit_i_fieldUpdateSeq1DPP().

void cloud_ppath_update3D ( Workspace ws,
Tensor6View  doit_i_field,
const Index p_index,
const Index lat_index,
const Index lon_index,
const Index scat_za_index,
const Index scat_aa_index,
ConstVectorView  scat_za_grid,
ConstVectorView  scat_aa_grid,
const ArrayOfIndex cloudbox_limits,
ConstTensor6View  doit_scat_field,
const Agenda abs_scalar_gas_agenda,
ConstTensor4View  vmr_field,
const Agenda opt_prop_gas_agenda,
const Agenda ppath_step_agenda,
ConstVectorView  p_grid,
ConstVectorView  lat_grid,
ConstVectorView  lon_grid,
ConstTensor3View  z_field,
ConstMatrixView  r_geoid,
ConstMatrixView  z_surface,
ConstTensor3View  t_field,
ConstVectorView  f_grid,
const Index f_index,
ConstTensor5View  ext_mat_field,
ConstTensor4View  abs_vec_field,
const Index  
)

Radiative transfer calculation along a path inside the cloudbox (3D).

This function calculates the radiation field along a propagation path step for a specified zenith direction. This function is used for the sequential update if the radiation field and called inside a loop over the pressure grid. In the function the intersection point of the propagation path with the next layer is calculated and all atmospheric properties are interpolated an the intersection point. Then a radiative transfer step is performed using the stokes vector as output and input. The inermediate Stokes vectors are stored in the WSV doit_i_field.

Parameters:
[in,out] ws Current workspace WS Output:
doit_i_field Updated radiation field inside the cloudbox. WS Input:
p_index // Pressure index
lat_index 
lon_index 
scat_za_index // Index for proagation direction
scat_aa_index 
scat_za_grid 
scat_aa_grid 
cloudbox_limits 
doit_scat_field Scattered field. Calculate scalar gas absorption:
abs_scalar_gas_agenda 
vmr_field Scalar gas absorption:
opt_prop_gas_agenda Propagation path calculation:
ppath_step_agenda 
p_grid 
lat_grid 
lon_grid 
z_field 
r_geoid 
z_surface Calculate thermal emission:
t_field 
f_grid 
f_index 
ext_mat_field 
abs_vec_field 
Author:
Claudia Emde
Date:
2003-06-04

Definition at line 575 of file scatrte.cc.

References cloud_RT_no_background(), fix_gridpos_at_boundary(), Ppath::gp_lat, Ppath::gp_lon, Ppath::gp_p, gridpos(), interp(), interpweights(), is_inside_cloudbox(), itw2p(), joker, Ppath::los, ConstTensor4View::nbooks(), ConstTensor6View::ncols(), ConstVectorView::nelem(), Ppath::np, out3, Ppath::pos, ppath_init_structure(), ppath_step_agendaExecute(), and Ppath::z.

Referenced by doit_i_fieldUpdateSeq3D().

void cloud_RT_no_background ( Workspace ws,
Tensor6View  doit_i_field,
const Agenda abs_scalar_gas_agenda,
const Agenda opt_prop_gas_agenda,
const Ppath ppath_step,
ConstVectorView  t_int,
ConstMatrixView  vmr_list_int,
ConstTensor3View  ext_mat_int,
ConstMatrixView  abs_vec_int,
ConstMatrixView  sca_vec_int,
ConstMatrixView  doit_i_field_int,
ConstVectorView  p_int,
const ArrayOfIndex cloudbox_limits,
ConstVectorView  f_grid,
const Index f_index,
const Index p_index,
const Index lat_index,
const Index lon_index,
const Index scat_za_index,
const Index scat_aa_index 
)

void cloud_RT_surface ( Workspace ws,
Tensor6View  doit_i_field,
const Agenda surface_prop_agenda,
const Index f_index,
const Index stokes_dim,
const Ppath ppath_step,
const ArrayOfIndex cloudbox_limits,
ConstVectorView  scat_za_grid,
const Index scat_za_index 
)

void interp_cloud_coeff1D ( Tensor3View  ext_mat_int,
MatrixView  abs_vec_int,
MatrixView  sca_vec_int,
MatrixView  doit_i_field_int,
VectorView  t_int,
MatrixView  vmr_list_int,
VectorView  p_int,
ConstTensor5View  ext_mat_field,
ConstTensor4View  abs_vec_field,
ConstTensor6View  doit_scat_field,
ConstTensor6View  doit_i_field,
ConstTensor3View  t_field,
ConstTensor4View  vmr_field,
ConstVectorView  p_grid,
const Ppath ppath_step,
const ArrayOfIndex cloudbox_limits,
ConstVectorView  scat_za_grid,
const Index scat_za_interp 
)

interp_cloud_coeff1D

Interpolate all inputs of the VRTE on a propagation path step. Used in the WSM cloud_ppath_update1D.

Author:
Claudia Emde
Date:
2003-06-06

Definition at line 1178 of file scatrte.cc.

References Ppath::gp_p, gridpos(), interp(), interp_poly(), interpweights(), itw2p(), joker, Ppath::los, ConstTensor4View::nbooks(), ConstTensor6View::ncols(), ConstVectorView::nelem(), Array< base >::nelem(), Ppath::np, and out3.

Referenced by cloud_ppath_update1D(), and cloud_ppath_update1D_noseq().

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.

Returns:
true is returned if the point is inside the cloudbox.
Parameters:
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.
Author:
Claudia Emde (rewritten by Cory Davis 2005-07-03)
Date:
2003-06-06

Definition at line 1337 of file scatrte.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.

Returns:
true is returned if the point is inside the cloudbox.
Parameters:
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.
Author:
Claudia Emde (rewritten by Cory Davis 2005-07-03)
Date:
2003-06-06

Definition at line 1412 of file scatrte.cc.

References Ppath::gp_lat, Ppath::gp_lon, Ppath::gp_p, is_gp_inside_cloudbox(), and Ppath::np.

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

void ppath_step_in_cloudbox ( Workspace ws,
Ppath ppath_step,
const Agenda ppath_step_agenda,
const Index p,
const Index lat,
const Index lon,
ConstTensor3View  z_field,
ConstMatrixView  r_geoid,
ConstMatrixView  z_surface,
ConstVectorView  scat_za_grid,
ConstVectorView  aa_grid,
const Index scat_za_index,
const Index scat_aa_index,
ConstVectorView  p_grid,
ConstVectorView  lat_grid,
ConstVectorView  lon_grid 
)

Calculates for a given point and a given direction one propagation path step.

This function initializes the ppath structure and executes ppath_step_agenda. Output of the fuinction is a propagation path with two points. The starting point and the next point.

The function is needed in the sequential update (doit_i_fieldUpdateSeq3D).

Parameters:
[in,out] ws Current workspace
ppath_step Propagation path step
ppath_step_agenda Agenda for calculating propagation paths
p Pressure index
lat Latitude index
lon Longitude index
z_field Altitude field
r_geoid Geoid
z_surface Surface altitude
scat_za_grid Zenith angle grid
aa_grid Azimuth angle grid
scat_za_index Zenith angle index
scat_aa_index Azimuth angle index
p_grid Pressure grid
lat_grid Latitude grid
lon_grid Longitude grid
Author:
Claudia Emde
Date:
2003-06-06

Definition at line 1110 of file scatrte.cc.

References Ppath::gp_lat, Ppath::gp_lon, Ppath::gp_p, Ppath::los, Ppath::pos, ppath_init_structure(), ppath_step_agendaExecute(), and Ppath::z.

void za_gridOpt ( Vector za_grid_opt,
Matrix doit_i_field_opt,
ConstVectorView  za_grid_fine,
ConstTensor6View  doit_i_field,
const Numeric acc,
const Index scat_za_interp 
)

Optimize the zenith angle grid,

This method optimizes the zenith angle grid. For optimization it uses the interpolation method given by *scat_za_interp* (0 - linear interpolation, 1 - polynomial interpolation). As input it needs the intensity field calculated on a very fine zenith angle grid (*za_grid_fine*). The function picks out as many grid points as required to achieve the required accuracy (*acc* [%]). This methods optimizes only the intensity (first Stokes component) for 1D cases (first latitude and longitude of the intensity field. (Could be modified to optimize all Stokes components at the same time, if we don't want to use the clearsky field for grid optimuzation.)

Parameters:
za_grid_opt Optimized zenith angle grid.
doit_i_field_opt Optimized intensity field.
za_grid_fine Fine zenith angle grid.
doit_i_field Radiation field calculated on a very fine za grid.
acc Accuracy of optimization [%].
scat_za_interp Interpolation method.
Author:
Claudia Emde
Date:
2004-04-05

Definition at line 1966 of file scatrte.cc.

References abs, get_sorted_indexes(), gridpos(), interp(), interp_poly(), interpweights(), joker, Array< base >::nelem(), ConstVectorView::nelem(), ConstTensor6View::npages(), ConstTensor6View::nvitrines(), Matrix::resize(), and Vector::resize().

Referenced by doit_za_grid_optCalc().


Variable Documentation

const Numeric PI


Generated on Mon Mar 23 14:06:51 2009 for ARTS by  doxygen 1.5.6