PHYEX 0.9.5
PHYsique EXternalisée
Loading...
Searching...
No Matches
pyphyex.phyex1d.dephycf_export Namespace Reference

Functions

 _budget_sum (hdf5, variables, schemes, processes)
 budgets (hdf5)
 start_date (hdf5)
 export (hdf5file, ncfile)

Variables

 MISSING_VALUE = numpy.float32(1.e20)
dict DEPHYCF_VARIABLES
dict EXTRA_VARIABLES
dict STATE_VARIABLES
dict REDUNDANT_VARIABLES
list BUDGET_GROUPS
tuple PHYSICS_SCHEMES = ('adjust', 'micro', 'turb', 'shallow', 'rad')
dict HYDROMETEOR_TENDENCIES
tuple WATER_VARIABLES = ('RV', 'RC', 'RR', 'RI', 'RS', 'RG', 'RH')

Detailed Description

Conversion of the results of an experiment into a netCDF file following the DEPHY common
format (dephycf) for SCM outputs, as done by EMS (https://github.com/romainroehrig/EMS,
examples/post.dephycf/variables.py and ems/lfa2nc_dephycf.py):
- variable names, units and standard_name attributes of the dephycf table of EMS
- levf (full levels) and levh (half levels) dimensions, time dimension in seconds since the
  start date of the case
- NETCDF3_CLASSIC format, float32 values, 1.e20 as missing value
Variables without dephycf equivalent are written with their phyex1d name, except the ones whose
information is already in the file (mixing ratios, kinematic surface fluxes...).
Budgets (bu_<scheme>_<variable>_<process> variables) are summed by scheme and converted into
the dephycf tendencies.

Function Documentation

◆ _budget_sum()

pyphyex.phyex1d.dephycf_export._budget_sum ( hdf5,
variables,
schemes,
processes )
protected
Sum of the budgets
:param hdf5: result file
:param variables: budget variables (TH, RV...)
:param schemes: list of schemes
:param processes: list of processes, None for all
:return: sum (None if no budget variable is found)

Definition at line 212 of file dephycf_export.py.

Here is the caller graph for this function:

◆ budgets()

pyphyex.phyex1d.dephycf_export.budgets ( hdf5)
dephycf tendencies computed from the budgets of a result file
:param hdf5: result file (h5py File)
:return: dictionary {dephycf name: values}

Definition at line 231 of file dephycf_export.py.

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

◆ export()

pyphyex.phyex1d.dephycf_export.export ( hdf5file,
ncfile )
Converts a result file into a netCDF file following the DEPHY common format
:param hdf5file: result file of an experiment
:param ncfile: netCDF file to produce

Definition at line 275 of file dephycf_export.py.

Here is the call graph for this function:

◆ start_date()

pyphyex.phyex1d.dephycf_export.start_date ( hdf5)
Start date of the case
:param hdf5: result file (h5py File)
:return: start date as a string, None if unknown

Definition at line 258 of file dephycf_export.py.

Here is the caller graph for this function:

Variable Documentation

◆ BUDGET_GROUPS

list pyphyex.phyex1d.dephycf_export.BUDGET_GROUPS

Definition at line 154 of file dephycf_export.py.

◆ DEPHYCF_VARIABLES

dict pyphyex.phyex1d.dephycf_export.DEPHYCF_VARIABLES

Definition at line 29 of file dephycf_export.py.

◆ EXTRA_VARIABLES

dict pyphyex.phyex1d.dephycf_export.EXTRA_VARIABLES
Initial value:
1= {
2 'qg': ('1', 'mass_fraction_of_graupel_in_air'),
3 'qh': ('1', 'mass_fraction_of_hail_in_air'),
4 'lat': ('degrees_north', 'latitude'),
5 'lon': ('degrees_east', 'longitude'),
6 'Zs': ('m', 'surface_altitude'),
7 'tnqg': ('s-1', 'Graupel Tendency due to Physics'),
8 'tnqh': ('s-1', 'Hail Tendency due to Physics'),
9 'tnta_res': ('K s-1', 'residual_of_the_air_temperature_budget'),
10 'tnqv_res': ('s-1', 'residual_of_the_specific_humidity_budget'),
11 'tnua_res': ('m s-2', 'residual_of_the_eastward_wind_budget'),
12 'tnva_res': ('m s-2', 'residual_of_the_northward_wind_budget'),
13}

Definition at line 117 of file dephycf_export.py.

◆ HYDROMETEOR_TENDENCIES

dict pyphyex.phyex1d.dephycf_export.HYDROMETEOR_TENDENCIES
Initial value:
1= {'tnql': 'RC', 'tnqi': 'RI', 'tnqr': 'RR', 'tnqsn': 'RS',
2 'tnqg': 'RG', 'tnqh': 'RH'}

Definition at line 207 of file dephycf_export.py.

◆ MISSING_VALUE

pyphyex.phyex1d.dephycf_export.MISSING_VALUE = numpy.float32(1.e20)

Definition at line 26 of file dephycf_export.py.

◆ PHYSICS_SCHEMES

tuple pyphyex.phyex1d.dephycf_export.PHYSICS_SCHEMES = ('adjust', 'micro', 'turb', 'shallow', 'rad')

Definition at line 206 of file dephycf_export.py.

◆ REDUNDANT_VARIABLES

dict pyphyex.phyex1d.dephycf_export.REDUNDANT_VARIABLES
Initial value:
1= {
2 't', # time coordinate
3 'rv', 'rc', 'rr', 'ri', 'rs', 'rg', 'rh', 'rt', # mixing ratios (specific contents written)
4 'sfth', 'sfrv', 'swf', # surface fluxes in other units (hfss, hfls written)
5 'dt_rad_lw', 'dt_rad_sw', # temperature tendencies (tnta_radlw, tnta_radsw written)
6}

Definition at line 143 of file dephycf_export.py.

◆ STATE_VARIABLES

dict pyphyex.phyex1d.dephycf_export.STATE_VARIABLES
Initial value:
1= {
2 'pfull': 'P', 'zfull': 'Z_mass', 'zhalf': 'Z_flux',
3 'ta': 'T', 'theta': 'Theta',
4 'qv': 'qv', 'ql': 'qc', 'qi': 'qi', 'qr': 'qr', 'qsn': 'qs', 'qg': 'qg', 'qh': 'qh',
5 'qt': 'qt', 'tke': 'tke', 'ua': 'u', 'va': 'v', 'wa': 'w', 'cl': 'CF',
6 'rld': 'lw_dn', 'rlu': 'lw_up', 'rsd': 'sw_dn', 'rsu': 'sw_up',
7 'hfls': 'slhf', 'hfss': 'sshf', 'z0': 'z0', 'ps': 'Ps', 'ts': 'Ts', 'tskin': 'Tskin',
8 'sigs': 'sigs', 'lat': 'lat', 'lon': 'lon', 'Zs': 'Zs',
9}

Definition at line 132 of file dephycf_export.py.

◆ WATER_VARIABLES

tuple pyphyex.phyex1d.dephycf_export.WATER_VARIABLES = ('RV', 'RC', 'RR', 'RI', 'RS', 'RG', 'RH')

Definition at line 209 of file dephycf_export.py.