PHYEX 0.9.5
PHYsique EXternalisée
Loading...
Searching...
No Matches
pyphyex.phyex1d.grid.Grid Class Reference

Public Member Functions

 __init__ (self, grid)
 get_pressure (self, position, state, pronostic_variables)
 get_altitude (self, position, state, pronostic_variables)

Public Attributes

 filename = grid
 position = grid_descr['position']
 mean = grid_descr['mean']
str kind = grid_descr['kind']
 description = grid_descr['description']
str len = len(self.description)
str nlevels = self.len - 1 if self.position in FLUX else self.len
 ascending = None
 cst = Cst()

Protected Member Functions

 _read_gridfile (self, gridfile)
 _mean (self, values, method)

Detailed Description

The Grid class handles vertical grids

The definition of the vertical grids are stored in files with the '.grid' extension.
Theses files contains a dictionary as a json string with the folowing content:
- kind: 'hybridP' for an hybrid-pressure coordinate (pressure on level i is P(i)=a(i)+b(i)*Ps)
        'hybridH' for an hybrid-height coordinate (altitude on level i is Z(i)=a(i)+b(i)*Zs)
        'P' for a pressure coordinate
        'H' for a height (above sea level) coordinate
- position: 'FLUX' if the grid refers to flux levels
            'MASS' otherwise
- mean: 'linear' or 'quadratic'
        way to compute flux levels from mass levels if grid is defined on mass levels
        or the reverse if grid is defined on flux levels
- description: a single list of values if kind is 'P' or 'H'
               a list containing a list for the a(i) coefficients and a list for the b(i)
               coefficients if kind is 'hybridP' or 'hybridH'.

Definition at line 68 of file grid.py.

Constructor & Destructor Documentation

◆ __init__()

pyphyex.phyex1d.grid.Grid.__init__ ( self,
grid )
Instanciates a Grid object from a file containing a grid description or from an
already known grid.

:param grid: a filename (if ending with the '.grid' extension or a grid name

Definition at line 88 of file grid.py.

Here is the call graph for this function:

Member Function Documentation

◆ _mean()

pyphyex.phyex1d.grid.Grid._mean ( self,
values,
method )
protected
Computes the mean
:param method: must be 'linear' or 'quadartic'

Definition at line 148 of file grid.py.

Here is the caller graph for this function:

◆ _read_gridfile()

pyphyex.phyex1d.grid.Grid._read_gridfile ( self,
gridfile )
protected
Reads a grid

Definition at line 140 of file grid.py.

Here is the caller graph for this function:

◆ get_altitude()

pyphyex.phyex1d.grid.Grid.get_altitude ( self,
position,
state,
pronostic_variables )
Returns the level altitudes
:param position: must be among grid.MASS + .grid.FLUX
:param state: dictionary containing the current state
:param pronostic_variables: list of pronostic variables

Definition at line 254 of file grid.py.

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

◆ get_pressure()

pyphyex.phyex1d.grid.Grid.get_pressure ( self,
position,
state,
pronostic_variables )
Returns the level pressures
:param position: must be among grid.MASS + .grid.FLUX
:param state: dictionary containing the current state
:param pronostic_variables: list of pronostic variables

Definition at line 171 of file grid.py.

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

Member Data Documentation

◆ ascending

pyphyex.phyex1d.grid.Grid.ascending = None

Definition at line 136 of file grid.py.

◆ cst

pyphyex.phyex1d.grid.Grid.cst = Cst()

Definition at line 138 of file grid.py.

◆ description

pyphyex.phyex1d.grid.Grid.description = grid_descr['description']

Definition at line 113 of file grid.py.

◆ filename

pyphyex.phyex1d.grid.Grid.filename = grid

Definition at line 99 of file grid.py.

◆ kind

str pyphyex.phyex1d.grid.Grid.kind = grid_descr['kind']

Definition at line 112 of file grid.py.

◆ len

str pyphyex.phyex1d.grid.Grid.len = len(self.description)

Definition at line 121 of file grid.py.

◆ mean

pyphyex.phyex1d.grid.Grid.mean = grid_descr['mean']

Definition at line 111 of file grid.py.

◆ nlevels

str pyphyex.phyex1d.grid.Grid.nlevels = self.len - 1 if self.position in FLUX else self.len

Definition at line 134 of file grid.py.

◆ position

pyphyex.phyex1d.grid.Grid.position = grid_descr['position']

Definition at line 110 of file grid.py.


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