emc2.simulator.subcolumn.set_precip_sub_col_frac¶
- emc2.simulator.subcolumn.set_precip_sub_col_frac(model, is_conv, N_columns=None, use_rad_logic=True, parallel=True, chunk=None, precip_types=['pl', 'pi'], q_trunc_thresh=1e-18, seed=None)[source]¶
Sets the hydrometeor fraction due to precipitation in each subcolumn. This module works for both stratiform and convective precipitation.
- Parameters:
- model: :py:func: `emc2.core.Model`
The model we are generating the subcolumns of stratiform fraction for.
- is_conv: bool
Set to True to generate subcolumns for convective precipitation. Set to False to generate subcolumns for stratiform precipitation.
- N_columns: int or None
Use this to set the number of subcolumns in the model. This can only be set once. After the number of subcolumns is set, use None to make EMC2 automatically detect the number of subcolumns.
- use_rad_logic: bool
When True using the cloud fraction utilized in a model radiative scheme. Otherwise, using the microphysics scheme (note that these schemes do not necessarily use exactly the same cloud fraction logic).
- parallel: bool or str
If True or ‘dask’, use Dask bag for parallelism (supports multi-node HPC via a distributed Dask scheduler). If ‘processes’, use ProcessPoolExecutor (faster on single-node workstations). If False, run serially.
- chunk: int or None
When parallel=’processes’, the chunksize hint for ProcessPoolExecutor.map (how many time steps are batched per worker). None auto-sizes to max(1, t_dim // cpu_count()). Ignored when parallel=True or ‘dask’.
- ice_hyd_type: str
The ice hydrometeor type to include in the subcolumn distribution for precipitation
- q_trunc_thresh: float
truncation value for q. Smaller values will be treated as 0.
- seed: int or None
Random seed for reproducibility. None (default) gives non-reproducible results with fully independent draws — best for production science runs. With an integer seed and parallel=False, a single global seed is set before the timestep loop (serial-only, statistically independent timesteps). With an integer seed and parallel=True/’processes’, each worker seeds with seed+tt (parallel-safe, with a weak cross-timestep correlation). See the seeding note above _randperm for full details.
- Returns:
- model: :py:func: emc2.core.Model
The Model object with the stratiform hydrometeor fraction in each subcolumn added.