|
ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
|
Utility functions for fire model atmospheric state extraction. More...
#include <AMReX_MultiFab.H>#include <AMReX_Geometry.H>#include <AMReX_MFIter.H>#include <ERF_MicrophysicsUtils.H>#include <ERF_EOS.H>#include <ERF_IndexDefines.H>#include <ERF_Constants.H>

Go to the source code of this file.
Functions | |
| void | compute_rh_from_conservative (amrex::MultiFab &RH_out, const amrex::MultiFab &S_atm, const amrex::Geometry &) |
| Compute relative humidity from conserved atmospheric variables at k=0. More... | |
| void | compute_t_from_conservative (amrex::MultiFab &T_out, const amrex::MultiFab &S_atm) |
| Air temperature [K] at k = 0 from the conserved state. More... | |
| void | fire_copy_k0_plane (amrex::MultiFab &dst_2d, const amrex::MultiFab &src_3d) |
| void | fire_host_copy (amrex::MultiFab &dst, const amrex::MultiFab &src, int ncomp=1, int nghost=0) |
| Copy a MultiFab between device and host-accessible memory, for an engine whose fire physics runs on the host. More... | |
Utility functions for fire model atmospheric state extraction.
|
inline |
Compute relative humidity from conserved atmospheric variables at k=0.
Computes RH from pressure, temperature, and water vapor mixing ratio at the first atmospheric level (k=0). Uses the ERF microphysics saturation vapor pressure functions.
| [out] | RH_out | Output relative humidity MultiFab [fraction 0-1] Must be allocated with ncomp=1 on same grid as inputs |
| [in] | S_atm | Conservative state at k=0 Contains RhoTheta (comp 1) and RhoQ1 (comp 4) |
| [in] | geom | Geometry at level 0 |
Referenced by FireCoupler::advance().


|
inline |
Air temperature [K] at k = 0 from the conserved state.
T = theta * (p / p_0)^(R_d / c_p), with p from RhoTheta and qv as in compute_rh_from_conservative. Fuel-moisture curves and ignition criteria take an air temperature, not the potential temperature of the first cell, which at 840 hPa is 14-16 K above it.
| [out] | T_out | 2D MultiFab (one cell in z) on the level's boxes |
| [in] | S_atm | Conserved state (Rho, RhoTheta, RhoQ1 when moist) |
Referenced by FireCoupler::advance().


|
inline |
Copy the k = 0 plane of a cell-centred atmospheric field into a MultiFab on the same boxes coarsened to one cell in z. A namespace-scope function because nvcc rejects a device kernel inside a private member such as ERF::Advance.

|
inline |
Copy a MultiFab between device and host-accessible memory, for an engine whose fire physics runs on the host.
The memory contract of ERF_FireEngine.H: the coupling's fields are in the default arena (device memory on a GPU build) and are only valid during the call that hands them over; an engine's returned fields must be readable there too. dst and src have the same BoxArray and DistributionMapping; ncomp components and nghost ghost cells are copied from component 0. dst belongs to the caller (allocate a host copy once with amrex::MFInfo().SetArena(amrex::The_Pinned_Arena()), or The_Managed_Arena(), and reuse it). The copy completes before the call returns: the GPU stream is synchronised, so the host may read dst, or the device read it, right away. On a CPU build it is a plain copy.
