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

Public Member Functions

 __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)
 setup (self, init_state, duration)
 finalize (self)
 execute (self, previous_state, timestep, timestep_number)
 step (self, state, timestep, timestep_number)
 add_vertical_coordinate (self, state)
 add_conversions (self, state)
 build_init_state (self, init_state)
 forcing (self, state, timestep, timestep_number)

Public Attributes

 case = case
 grid = grid
 prognostic_variables = prognostic_variables
 cst = Cst()
int tkemin = 1e-6
list scalar_variables = []
bool budgets = False

Static Public Attributes

dict OPTIONS_HELP = {}
tuple BUDGET_VARIABLES = ('U', 'V', 'W', 'TH', 'TKE', 'RV', 'RC', 'RR', 'RI', 'RS', 'RG', 'RH')
dict BUDGET_STATE_NAMES

Protected Attributes

 _budget_keys = None
 _budget_active = list(self.BUDGET_VARIABLES)

Detailed Description

Base class for 1D model physics schemes

This class is not intended to be used directly.

The first line of the docstring of the classes is used to describe them in the help
message of phyex1d-exp_run.

Definition at line 19 of file physics_base.py.

Constructor & Destructor Documentation

◆ __init__()

pyphyex.phyex1d.physics_base.PhysicsBase.__init__ ( self,
dt,
method,
name,
tag,
case,
grid,
prognostic_variables )

Definition at line 40 of file physics_base.py.

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

Member Function Documentation

◆ add_conversions()

pyphyex.phyex1d.physics_base.PhysicsBase.add_conversions ( self,
state )
Add derived variables to the state

Parameters
----------
state : dict
    Current state

Definition at line 189 of file physics_base.py.

Here is the caller graph for this function:

◆ add_vertical_coordinate()

pyphyex.phyex1d.physics_base.PhysicsBase.add_vertical_coordinate ( self,
state )
Add vertical coordinate to the state

Parameters
----------
state : dict
    Current state

Definition at line 173 of file physics_base.py.

Here is the caller graph for this function:

◆ budget_add()

pyphyex.phyex1d.physics_base.PhysicsBase.budget_add ( self,
state,
key,
value )
Add a contribution to a budget variable of the state
:param state: state dictionary
:param key: name of the budget variable (bu_<scheme>_<variable>_<process>)
:param value: contribution (tendency)

Definition at line 62 of file physics_base.py.

Here is the caller graph for this function:

◆ budget_fields()

pyphyex.phyex1d.physics_base.PhysicsBase.budget_fields ( self,
state )
Values of the budget variables
:param state: state dictionary
:return: None if budgets are not activated, a dictionary {budget variable: field} otherwise

Definition at line 74 of file physics_base.py.

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

◆ budget_record()

pyphyex.phyex1d.physics_base.PhysicsBase.budget_record ( self,
state,
before,
scheme,
process,
variables,
timestep )
Record the contribution of an operation done on the state
:param state: state dictionary, after the operation
:param before: output of budget_fields called before the operation
:param scheme: name of the scheme (forc for forcings, driver for operations done by the
               driver...)
:param process: name of the process
:param variables: list of the state variables modified by the operation
:param timestep: timestep (s)

Definition at line 87 of file physics_base.py.

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

◆ build_init_state()

pyphyex.phyex1d.physics_base.PhysicsBase.build_init_state ( self,
init_state )
Build the initial state

Parameters
----------
init_state : dict
    Initial state dictionary to populate

Returns
-------
dict
    Populated initial state

Reimplemented in pyphyex.phyex1d.phyex.PHYEX.

Definition at line 224 of file physics_base.py.

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

◆ execute()

pyphyex.phyex1d.physics_base.PhysicsBase.execute ( self,
previous_state,
timestep,
timestep_number )
Advance the state by one timestep

Parameters
----------
previous_state : dict
    Dictionary holding all the variables.
timestep : float
    Timestep (s)
timestep_number : int
    Current time step number

Returns
-------
dict
    State after time integration

Definition at line 122 of file physics_base.py.

◆ finalize()

pyphyex.phyex1d.physics_base.PhysicsBase.finalize ( self)
Tear down the scheme. Override in subclasses.

Reimplemented in pyphyex.phyex1d.phyex.PHYEX.

Definition at line 119 of file physics_base.py.

◆ forcing()

pyphyex.phyex1d.physics_base.PhysicsBase.forcing ( self,
state,
timestep,
timestep_number )
Apply large-scale forcings to the state

Parameters
----------
state : dict
    Dictionary holding all the variables.
timestep : float
    Timestep (s)
timestep_number : int
    Current time step number

Returns
-------
dict
    Updated state after forcing

Definition at line 304 of file physics_base.py.

Here is the call graph for this function:

◆ setup()

pyphyex.phyex1d.physics_base.PhysicsBase.setup ( self,
init_state,
duration )
Set up the scheme. Override in subclasses.

Reimplemented in pyphyex.phyex1d.phyex.PHYEX, and pyphyex.phyex1d.simple_physics.SimplePhysics.

Definition at line 116 of file physics_base.py.

◆ step()

pyphyex.phyex1d.physics_base.PhysicsBase.step ( self,
state,
timestep,
timestep_number )
Physics step. Override in subclasses.

Returns the state unchanged by default.

Reimplemented in pyphyex.phyex1d.phyex.PhysicsArome, and pyphyex.phyex1d.simple_physics.SimplePhysics.

Definition at line 165 of file physics_base.py.

Member Data Documentation

◆ _budget_active

pyphyex.phyex1d.physics_base.PhysicsBase._budget_active = list(self.BUDGET_VARIABLES)
protected

Definition at line 58 of file physics_base.py.

◆ _budget_keys

pyphyex.phyex1d.physics_base.PhysicsBase._budget_keys = None
protected

Definition at line 57 of file physics_base.py.

◆ BUDGET_STATE_NAMES

dict pyphyex.phyex1d.physics_base.PhysicsBase.BUDGET_STATE_NAMES
static
Initial value:
= {'U': 'u', 'V': 'v', 'W': 'w', 'TH': 'Theta', 'TKE': 'tke',
'RV': 'rv', 'RC': 'rc', 'RR': 'rr', 'RI': 'ri', 'RS': 'rs',
'RG': 'rg', 'RH': 'rh'}

Definition at line 36 of file physics_base.py.

◆ BUDGET_VARIABLES

tuple pyphyex.phyex1d.physics_base.PhysicsBase.BUDGET_VARIABLES = ('U', 'V', 'W', 'TH', 'TKE', 'RV', 'RC', 'RR', 'RI', 'RS', 'RG', 'RH')
static

Definition at line 35 of file physics_base.py.

◆ budgets

bool pyphyex.phyex1d.physics_base.PhysicsBase.budgets = False

Definition at line 56 of file physics_base.py.

◆ case

pyphyex.phyex1d.physics_base.PhysicsBase.case = case

Definition at line 45 of file physics_base.py.

◆ cst

pyphyex.phyex1d.physics_base.PhysicsBase.cst = Cst()

Definition at line 48 of file physics_base.py.

◆ grid

pyphyex.phyex1d.physics_base.PhysicsBase.grid = grid

Definition at line 46 of file physics_base.py.

◆ OPTIONS_HELP

dict pyphyex.phyex1d.physics_base.PhysicsBase.OPTIONS_HELP = {}
static

Definition at line 31 of file physics_base.py.

◆ prognostic_variables

pyphyex.phyex1d.physics_base.PhysicsBase.prognostic_variables = prognostic_variables

Definition at line 47 of file physics_base.py.

◆ scalar_variables

list pyphyex.phyex1d.physics_base.PhysicsBase.scalar_variables = []

Definition at line 53 of file physics_base.py.

◆ tkemin

int pyphyex.phyex1d.physics_base.PhysicsBase.tkemin = 1e-6

Definition at line 50 of file physics_base.py.


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