# ARTS built-in documentation server

## Workspace Method iyMC

### Description

Interface to Monte Carlo part for iy_main_agenda. Basically an interface to MCGeneral for doing monochromatic pencil beam calculations. This functions allows Monte Carlo (MC) calculations for sets of frequencies and sensor pos/los in a single run. Sensor responses can be included in the standard manner (through yCalc). This function does not apply the MC approach when it comes to sensor properties. These properties are not considered when tracking photons, which is done in MCGeneral (but then only for the antenna pattern). Output unit options (iy_unit) exactly as for MCGeneral. The MC calculation errors are all assumed be uncorrelated and each have a normal distribution. These properties are of relevance when weighting the errors with the sensor repsonse matrix. The seed is reset for each call of MCGeneral to obtain uncorrelated errors. MC control arguments (mc_std_err, mc_max_time, mc_min_iter, mc_max_iter mc_taustep_limit) as for MCGeneral. The arguments are applied for each monochromatic pencil beam calculation individually. As for MCGeneral, the value of mc_error shall be adopted to iy_unit. The following auxiliary data can be obtained: "Error (uncorrelated)": Calculation error. Size: [nf,ns,1,1]. (The later part of the text string is required. It is used as a flag to yCalc for how to apply the sensor data.) where nf: Number of frequencies. ns: Number of Stokes elements.

**Authors: **Patrick Eriksson

### Synopsis

### Variables

OUT | iy | (Matrix) | Monochromatic pencil beam radiance spectrum. |

OUT | iy_aux | (ArrayOfMatrix) | Data auxiliary to iy. |

OUT | diy_dx | (ArrayOfTensor3) | Derivative of iy with respect to retrieval quantities. |

IN | iy_agenda_call1 | (Index) | Flag to handle recursive calls of iy_main_agenda The agenda iy_main_agenda can be used recursively and this flag is used to tell the methods inside the agenda which is the primary call. |

IN | iy_transmittance | (Tensor3) | Transmittance to be included in iy. |

IN | rte_pos | (Vector) | A geographical position for starting radiative transfer calculations. |

IN | rte_los | (Vector) | A line-of-sight for (complete) radiative transfer calculations. |

IN | iy_aux_vars | (ArrayOfString) | Selection of quantities for iy_aux and when applicable also y_aux. |

IN | jacobian_do | (Index) | Flag to activate (clear-sky) Jacobian calculations. |

IN | atmosphere_dim | (Index) | The atmospheric dimensionality (1-3). |

IN | p_grid | (Vector) | The pressure grid. |

IN | lat_grid | (Vector) | The latitude grid. |

IN | lon_grid | (Vector) | The longitude grid. |

IN | z_field | (Tensor3) | The field of geometrical altitudes. |

IN | t_field | (Tensor3) | The field of atmospheric temperatures. |

IN | vmr_field | (Tensor4) | VMR field. |

IN | refellipsoid | (Vector) | Reference ellipsoid. |

IN | z_surface | (Matrix) | The surface altitude. |

IN | cloudbox_on | (Index) | Flag to activate the cloud box. |

IN | cloudbox_limits | (ArrayOfIndex) | The limits of the cloud box. |

IN | stokes_dim | (Index) | The dimensionality of the Stokes vector (1-4). |

IN | f_grid | (Vector) | The frequency grid for monochromatic pencil beam calculations. |

IN | scat_data | (ArrayOfArrayOfSingleScatteringData) | Array of single scattering data. |

IN | iy_space_agenda | (Agenda) | Agenda providing the downwelling radiation at the top of the atmosphere. |

IN | surface_rtprop_agenda | (Agenda) | Agenda providing radiative properties of the surface. |

IN | propmat_clearsky_agenda | (Agenda) | Agenda calculating the absorption coefficient matrices. |

IN | ppath_step_agenda | (Agenda) | Agenda calculating a propagation path step. |

IN | ppath_lmax | (Numeric) | Maximum length between points describing propagation paths. |

IN | ppath_lraytrace | (Numeric) | Maximum length of ray tracing steps when determining propagation paths. |

IN | pnd_field | (Tensor4) | Particle number density field. |

IN | iy_unit | (String) | Selection of output unit for radiative transfer methods. |

IN | mc_std_err | (Numeric) | Target precision (1 std. |

IN | mc_max_time | (Index) | The maximum time allowed for Monte Carlo calculations. |

IN | mc_max_iter | (Index) | The maximum number of iterations allowed for Monte Carlo calculations. |

IN | mc_min_iter | (Index) | The minimum number of iterations allowed for Monte Carlo calculations. |

IN | mc_taustep_limit | (Numeric) | Defines an upper step length in terms of optical thickness for Monte Carlo calculations. |

GIN | t_interp_order | (Index, Default: 1) | Interpolation order of temperature for scattering data (so far only applied in phase matrix, not in extinction and absorption. |