phyex1d
1D model using PHYEX
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Protected Member Functions | List of all members
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
 
 position
 
 mean
 
 kind
 
 description
 
 len
 
 ascending
 
 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'.

Constructor & Destructor Documentation

◆ __init__()

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

Member Function Documentation

◆ _mean()

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

◆ _read_gridfile()

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

◆ get_altitude()

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

◆ get_pressure()

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

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