|
phyex1d
1D model using PHYEX
|
Public Member Functions | |
| __init__ (self, grid) | |
| get_pressure (self, position, state, pronostic_variables) | |
| get_altitude (self, position, state, pronostic_variables) | |
Public Attributes | |
| filename | |
| position | |
| mean | |
| kind | |
| description | |
| len | |
| ascending | |
| cst | |
Protected Member Functions | |
| _read_gridfile (self, gridfile) | |
| _mean (self, values, method) | |
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'.
| 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
|
protected |
Computes the mean :param method: must be 'linear' or 'quadartic'
|
protected |
Reads a grid
| 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
| 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