PHYEX 0.9.5
PHYsique EXternalisée
Loading...
Searching...
No Matches
pyphyex.phyex1d.phyex.PHYEX Class Reference
Inheritance diagram for pyphyex.phyex1d.phyex.PHYEX:
Collaboration diagram for pyphyex.phyex1d.phyex.PHYEX:

Public Member Functions

 __init__ (self, dt, method, name, tag, case, grid, prognostic_variables, pyecrad=None, namel='default', dx=0., dy=0., attrs=None, budgets=False)
 setup (self, init_state, duration)
 build_init_state (self, init_state)
 read_budgets (self, state, scheme, nijt, nkt, rhodj, nvext=0)
 finalize (self)
Public Member Functions inherited from pyphyex.phyex1d.physics_base.PhysicsBase
 __init__ (self, dt, method, name, tag, case, grid, prognostic_variables)
 budget_add (self, state, key, value)
 budget_fields (self, state)
 budget_record (self, state, before, scheme, process, variables, timestep)
 execute (self, previous_state, timestep, timestep_number)
 step (self, state, timestep, timestep_number)
 add_vertical_coordinate (self, state)
 add_conversions (self, state)
 forcing (self, state, timestep, timestep_number)

Public Attributes

 pyecrad = pyecrad
 namel = namel
 full_phyex_namel = None
 dx = dx
 dy = dy
int krr = 1 else 6
list lima_names = names
Public Attributes inherited from pyphyex.phyex1d.physics_base.PhysicsBase
 case = case
 grid = grid
 prognostic_variables = prognostic_variables
 cst = Cst()
int tkemin = 1e-6
list scalar_variables = []
bool budgets = False

Protected Member Functions

 _init_aerosol_concentration (self, rhodref, z_mass)
 _lima_init_state (self, init_state)
 _lima_activation_velocity (self, state, time, z_mass, pressure)
 _wasp_surface_fluxes (self, state, t1, q1, exner1, rho1, u1, v1, zgrd)
 _beta_surface_fluxes (self, state, time, t1, q1, rho1, u1, v1, zgrd)
 _adjustment (self, state, timestep, rmix, rsrc, theta, thetas, sv, svs, rhodref, rhodj, exner, pressure, z_mass, sigqsat, mfconv, dthrad, w_act)
 _ecrad (self, state, timestep, timestep_number, temperature, rv, rc, ri, qdm)
 _shallow (self, state, timestep, rmix, theta, sv, svs, rhodj, rhodref, pressure, exner, dzz, z_flux, sfth, sfrv)
 _turb (self, state, timestep, rmix, rsrc, theta, us, vs, ws, thetas, svs, tkes, sv, src, rhodj, pressure, dzz, z_flux, sfth, sfrv, sfu, sfv, flxzthvmf, flxzumf, flxzvmf)
 _microphysics (self, state, timestep, rmix, rsrc, theta, thetas, sv, svs, rhodref, rhodj, exner, pressure, dzz, dthrad, w_act, hlc_hrc, hlc_hcf, hli_hri, hli_hcf)

Protected Attributes

int _kbudgets = len(self.BUDGET_VARIABLES) if budgets else 0
 _pyphyex = None
 _pyecrad = None
 _dt
Protected Attributes inherited from pyphyex.phyex1d.physics_base.PhysicsBase
 _budget_keys = None
 _budget_active = list(self.BUDGET_VARIABLES)

Static Protected Attributes

int _NVEXT_TURB = 1

Additional Inherited Members

Static Public Attributes inherited from pyphyex.phyex1d.physics_base.PhysicsBase
dict OPTIONS_HELP = {}
tuple BUDGET_VARIABLES = ('U', 'V', 'W', 'TH', 'TKE', 'RV', 'RC', 'RR', 'RI', 'RS', 'RG', 'RH')
dict BUDGET_STATE_NAMES

Detailed Description

PHYEX-based physics scheme

This class handles the initialisation / setup of PHYEX and ECRAD.

Definition at line 28 of file phyex.py.

Constructor & Destructor Documentation

◆ __init__()

pyphyex.phyex1d.phyex.PHYEX.__init__ ( self,
dt,
method,
name,
tag,
case,
grid,
prognostic_variables,
pyecrad = None,
namel = 'default',
dx = 0.,
dy = 0.,
attrs = None,
budgets = False )

Definition at line 48 of file phyex.py.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Function Documentation

◆ _adjustment()

pyphyex.phyex1d.phyex.PHYEX._adjustment ( self,
state,
timestep,
rmix,
rsrc,
theta,
thetas,
sv,
svs,
rhodref,
rhodj,
exner,
pressure,
z_mass,
sigqsat,
mfconv,
dthrad,
w_act )
protected
Saturation adjustment: LIMA_ADJUST_SPLIT for LIMA, ICE_ADJUST otherwise
:param state: state dictionary (CF, and ICEFR for LIMA, are updated)
:param timestep: timestep (s)
:param rmix: list of the 7 mixing ratios (rv, rc, rr, ri, rs, rg, rh)
:param rsrc: list of the 7 mixing ratio sources (s-1)
:param theta, thetas: potential temperature and its source
:param sv, svs: LIMA scalar variables and their sources (number of variables, levels)
:param rhodref, rhodj, exner, pressure, z_mass: dry density, dry density times volume,
                                              Exner function, pressure, altitude
:param sigqsat, mfconv, dthrad: PHYEX arguments
:param w_act: vertical velocity for the activation (LIMA only)
:return: (list of the 7 mixing ratio sources, thetas, src, hlc_hrc, hlc_hcf, hli_hri,
          hli_hcf, sv, svs)

Definition at line 406 of file phyex.py.

◆ _beta_surface_fluxes()

pyphyex.phyex1d.phyex.PHYEX._beta_surface_fluxes ( self,
state,
time,
t1,
q1,
rho1,
u1,
v1,
zgrd )
protected
Surface fluxes computed by the BETA scheme (see the beta_surface module)
:param state: state dictionary (surface temperature, surface pressure, z0, z0h)
:param time: current time (s)
:param t1, q1, rho1: temperature (K), specific humidity (kg/kg) and density (kg/m3) at
                     the first level
:param u1, v1: wind components at the first level (m/s)
:param zgrd: height of the first level above the surface (m)
:return: (sensible heat flux (W/m2), water vapour flux (kg/m2/s), friction velocity (m/s))

Definition at line 340 of file phyex.py.

◆ _ecrad()

pyphyex.phyex1d.phyex.PHYEX._ecrad ( self,
state,
timestep,
timestep_number,
temperature,
rv,
rc,
ri,
qdm )
protected
Call to ecRad
:param state: state dictionary
:param timestep: timestep (s)
:param timestep_number: current time step number
:param temperature, rv, rc, ri: temperature and mixing ratio profiles
:param qdm: dry air fraction
:return: the ecRad result (pyecrad exec method), arrays being dimensioned
         (ncol, nlev) with the top of atmosphere first

Definition at line 484 of file phyex.py.

◆ _init_aerosol_concentration()

pyphyex.phyex1d.phyex.PHYEX._init_aerosol_concentration ( self,
rhodref,
z_mass )
protected
Initial values of the LIMA scalar variables (aerosols only, other variables are null)
The free aerosol concentrations (CCN and IFN) are initialised as in Meso-NH
(INIT_AEROSOL_CONCENTRATION, case without ORILAM, dust and sea salt), from the
XCCN_CONC, LCCN_HOM, XIFN_CONC and LIFN_HOM parameters of the NAM_PARAM_LIMA namelist.
:param rhodref: dry air density profile (kg/m3)
:param z_mass: altitude profile (m)
:return: array (number of LIMA variables, number of levels)

Definition at line 212 of file phyex.py.

Here is the caller graph for this function:

◆ _lima_activation_velocity()

pyphyex.phyex1d.phyex.PHYEX._lima_activation_velocity ( self,
state,
time,
z_mass,
pressure )
protected
Vertical velocity used by LIMA for the activation of the aerosols, computed as in Meso-NH
(XWT_ACT_NUC in MODEL_n): vertical velocity, plus the prescribed large-scale vertical
velocity, plus (2/3 TKE)**0.5 if LACTTKE (with a turbulence scheme)
:param state: state dictionary
:param time: current time (s)
:param z_mass, pressure: altitude and pressure profiles

Definition at line 290 of file phyex.py.

◆ _lima_init_state()

pyphyex.phyex1d.phyex.PHYEX._lima_init_state ( self,
init_state )
protected
Initial values of the LIMA variables: aerosol concentrations as in Meso-NH
(INIT_AEROSOL_CONCENTRATION), then hydrometeor concentrations deduced from the mixing
ratios (SET_CONC_LIMA); ice and precipitation fractions set to 0
:param init_state: initial state, completed by the LIMA variables

Definition at line 266 of file phyex.py.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _microphysics()

pyphyex.phyex1d.phyex.PHYEX._microphysics ( self,
state,
timestep,
rmix,
rsrc,
theta,
thetas,
sv,
svs,
rhodref,
rhodj,
exner,
pressure,
dzz,
dthrad,
w_act,
hlc_hrc,
hlc_hcf,
hli_hri,
hli_hcf )
protected
Microphysics (LIMA or RAIN_ICE)
:param state: state dictionary (ni, CF and sigs are used; ni, and CF, ICEFR and PRCFR
              with LIMA, are updated)
:param timestep: timestep (s)
:param rmix: list of the 7 mixing ratios (rv, rc, rr, ri, rs, rg, rh)
:param rsrc: list of the 7 mixing ratio sources (rvs, rcs, rrs, ris, rss, rgs, rhs)
:param theta, thetas: potential temperature and its source
:param sv, svs: scalar variables and their sources (number of variables, levels)
:param rhodref, rhodj, exner, pressure: dry density, dry density times volume, Exner
                                        function, pressure
:param dzz: layer thicknesses
:param dthrad: radiative tendency (LIMA only)
:param w_act: vertical velocity used for the activation (LIMA only)
:param hlc_hrc, hlc_hcf, hli_hri, hli_hcf: subgrid cloud (high/low content) variables
:return: (thetas, prs, svs, hlc_hrc, hlc_hcf, hli_hri, hli_hcf), prs being the array
         of the krr mixing ratio sources (number of variables, levels)

Definition at line 756 of file phyex.py.

◆ _shallow()

pyphyex.phyex1d.phyex.PHYEX._shallow ( self,
state,
timestep,
rmix,
theta,
sv,
svs,
rhodj,
rhodref,
pressure,
exner,
dzz,
z_flux,
sfth,
sfrv )
protected
Shallow convection (EDKF mass-flux scheme, SHALLOW_MF)
:param state: state dictionary (u, v, tke, and the mass-flux cloud variables rc_MF,
              ri_MF, CF_MF, HLC_*_MF, HLI_*_MF and WEIGHT_MF_CLOUD, which are updated)
:param timestep: timestep (s)
:param rmix: list of the 7 mixing ratios (rv, rc, rr, ri, rs, rg, rh)
:param theta: potential temperature
:param sv, svs: scalar variables and their sources (number of variables, levels)
:param rhodj, rhodref, pressure, exner: dry density times volume, dry density, pressure,
                                        Exner function
:param dzz, z_flux: layer thicknesses and altitudes of the flux levels
:param sfth, sfrv: surface fluxes of potential temperature and of vapour mixing ratio
:return: (du_mf, dv_mf, dtke_mf, dthl_mf, drt_mf, dsv_mf, sigs_mf, flxzthvmf, flxzumf,
          flxzvmf): tendencies, subgrid standard deviation of s and fluxes used by the
          turbulence scheme

Definition at line 555 of file phyex.py.

◆ _turb()

pyphyex.phyex1d.phyex.PHYEX._turb ( self,
state,
timestep,
rmix,
rsrc,
theta,
us,
vs,
ws,
thetas,
svs,
tkes,
sv,
src,
rhodj,
pressure,
dzz,
z_flux,
sfth,
sfrv,
sfu,
sfv,
flxzthvmf,
flxzumf,
flxzvmf )
protected
Turbulence (TURB)
:param state: state dictionary (u, v, w, tke and Zs are used)
:param timestep: timestep (s)
:param rmix: list of the 7 mixing ratios (rv, rc, rr, ri, rs, rg, rh)
:param rsrc: list of the 7 mixing ratio sources (rvs, rcs, rrs, ris, rss, rgs, rhs)
:param theta: potential temperature
:param us, vs, ws, thetas, svs, tkes: sources of wind, potential temperature, scalar
                                      variables (number of variables, levels) and TKE
:param sv: scalar variables (number of variables, levels)
:param src: second-order flux s'r'c/2Sigma_s2
:param rhodj, pressure: dry density times volume, pressure
:param dzz, z_flux: layer thicknesses and altitudes of the flux levels
:param sfth, sfrv, sfu, sfv: surface fluxes of potential temperature, of vapour mixing
                             ratio and of momentum
:param flxzthvmf, flxzumf, flxzvmf: fluxes computed by the mass-flux scheme
:return: (us, vs, ws, thetas, prs, svs, tkes, sigs_turb, dthetal_turb, drt_turb):
         updated sources (prs: array of the krr mixing ratio sources), subgrid standard
         deviation of s and tendencies of the liquid potential temperature and of the
         total mixing ratio

Definition at line 619 of file phyex.py.

◆ _wasp_surface_fluxes()

pyphyex.phyex1d.phyex.PHYEX._wasp_surface_fluxes ( self,
state,
t1,
q1,
exner1,
rho1,
u1,
v1,
zgrd )
protected
Surface fluxes computed by the WASP scheme (see the wasp module), from a prescribed
surface temperature
:param state: state dictionary (surface temperature, surface pressure)
:param t1, q1, exner1, rho1: temperature (K), specific humidity (kg/kg), Exner function
                             and density (kg/m3) at the first level
:param u1, v1: wind components at the first level (m/s)
:param zgrd: height of the first level above the surface (m)
:return: (sensible heat flux (W/m2), water vapour flux (kg/m2/s), friction velocity (m/s))

Definition at line 310 of file phyex.py.

◆ build_init_state()

pyphyex.phyex1d.phyex.PHYEX.build_init_state ( self,
init_state )
Build the initial state
When budgets are activated, the budget variables are only known after a call to
the parametrisations; a first time step is done (on a copy of the initial state) to
get them.

Reimplemented from pyphyex.phyex1d.physics_base.PhysicsBase.

Definition at line 194 of file phyex.py.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ finalize()

pyphyex.phyex1d.phyex.PHYEX.finalize ( self)
Close PHYEX resources

Reimplemented from pyphyex.phyex1d.physics_base.PhysicsBase.

Definition at line 852 of file phyex.py.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_budgets()

pyphyex.phyex1d.phyex.PHYEX.read_budgets ( self,
state,
scheme,
nijt,
nkt,
rhodj,
nvext = 0 )
Read (and reset) the budgets stored by the PHYEX library and put them in the state
:param state: state dictionary to fill with the bu_<scheme>_<variable>_<process>
              variables (tendencies in s-1, e.g. K s-1 for TH which is a potential
              temperature budget, kg kg-1 s-1 for mixing ratios)
:param scheme: name of the scheme (used in the variable names)
:param nijt, nkt: dimensions used in the call to the scheme
:param rhodj: rhodj (dry density times volume), the budgets are divided by this field
:param nvext: number of extra levels added at both ends of the column for the call

Definition at line 830 of file phyex.py.

Here is the call graph for this function:

◆ setup()

pyphyex.phyex1d.phyex.PHYEX.setup ( self,
init_state,
duration )
Initialise PHYEX and ECRAD

Reimplemented from pyphyex.phyex1d.physics_base.PhysicsBase.

Definition at line 70 of file phyex.py.

Member Data Documentation

◆ _dt

pyphyex.phyex1d.phyex.PHYEX._dt
protected

Definition at line 123 of file phyex.py.

◆ _kbudgets

int pyphyex.phyex1d.phyex.PHYEX._kbudgets = len(self.BUDGET_VARIABLES) if budgets else 0
protected

Definition at line 52 of file phyex.py.

◆ _NVEXT_TURB

int pyphyex.phyex1d.phyex.PHYEX._NVEXT_TURB = 1
staticprotected

Definition at line 36 of file phyex.py.

◆ _pyecrad

pyphyex.phyex1d.phyex.PHYEX._pyecrad = None
protected

Definition at line 55 of file phyex.py.

◆ _pyphyex

pyphyex.phyex1d.phyex.PHYEX._pyphyex = None
protected

Definition at line 53 of file phyex.py.

◆ dx

pyphyex.phyex1d.phyex.PHYEX.dx = dx

Definition at line 58 of file phyex.py.

◆ dy

pyphyex.phyex1d.phyex.PHYEX.dy = dy

Definition at line 59 of file phyex.py.

◆ full_phyex_namel

pyphyex.phyex1d.phyex.PHYEX.full_phyex_namel = None

Definition at line 57 of file phyex.py.

◆ krr

int pyphyex.phyex1d.phyex.PHYEX.krr = 1 else 6

Definition at line 150 of file phyex.py.

◆ lima_names

pyphyex.phyex1d.phyex.PHYEX.lima_names = names

Definition at line 154 of file phyex.py.

◆ namel

pyphyex.phyex1d.phyex.PHYEX.namel = namel

Definition at line 56 of file phyex.py.

◆ pyecrad

pyphyex.phyex1d.phyex.PHYEX.pyecrad = pyecrad

Definition at line 54 of file phyex.py.


The documentation for this class was generated from the following file: