gcpy.budget_ox
Computes the budget of Ox from 1-year GEOS-Chem Classic or GCHP benchmark simulations.
Module Contents
Classes
Private class _GlobVars contains global data that needs to be |
Functions
|
Computes global species mass from the initial & final restart files. |
|
Arguments: |
|
Arguments: |
|
Arguments: |
|
Computes the following terms: |
|
Prints the trop+strat budget file. |
|
Main program to compute TransportTracersBenchmark budgets |
- class gcpy.budget_ox._GlobVars(devstr, devdir, devrstdir, year, dst, is_gchp, overwrite, spcdb_dir)
Private class _GlobVars contains global data that needs to be shared among the methods in this module.
- get_lumped_species_dict()
Returns a dictionary of lumped species definitions.
- Returns
lspc_dict : dict
- rst_file_path(ystr)
Returns the restart file path
- Arguments:
ystr : Year string (YYYY format
- get_diag_paths()
Generates data paths for diagnostic collection files.
- read_rst(ystr)
Reads a restart file into an xarray Dataset
- Arguments:
ystr: String containing the year (YYYY format)
- Returns:
ds : xarray Dataset
- read_diag(collection, prefix=None)
Reads a restart file into an xarray Dataset.
- Arguments:
- collectionstr
Name of the collection to read
- Returns:
ds : xarray Dataset
- get_area_and_volume()
Returns area and volume quantities for the budget computations.
- get_time_info()
Returns time information for the budget computations.
- get_conv_factors(spcdb_dir)
Gets conversion factors used in budget computations
- Arguments:
- spcdb_dirstr
Path to the species_database.yml file
- gcpy.budget_ox.init_and_final_mass(globvars, species)
Computes global species mass from the initial & final restart files.
- Arguments:
- globvars: obj of type _GlobVars
Global variables needed for budget computations.
- Returns:
- result: dict
Contains initial & final tropospheric mass of O3.
- gcpy.budget_ox.annual_average_prodloss(globvars)
- Arguments:
- globvars: obj of type _GlobVars
Global variables needed for budget computations.
- Returns:
- result: dict
Contains annual monthly-weighted average of Prod_Ox and Loss_Ox.
- gcpy.budget_ox.annual_average_drydep(globvars)
- Arguments:
- globvars: obj of type _GlobVars
Global variables needed for budget computations.
- Returns:
- resultfloat
Annual average dry deposition [Tg Ox]
- gcpy.budget_ox.annual_average_wetdep(globvars)
- Arguments:
- globvars: obj of type _GlobVars
Global variables needed for budget computations.
- Returns:
- resultfloat
Annual average wet deposition [Tg Ox]
- gcpy.budget_ox.annual_metrics(globvars, mass, prodloss, wetdep, drydep)
Computes the following terms:
“dyn”: Ox subsiding from the stratosphere
2 “net”: Net Ox = (POx-LOx) + Dyn - Drydep - Wetdep
“life”: Ox lifetime (d) = Ox burden / (LOx + Drydep + Wetdep)
- Args:
- globvars: _GlobVars
Global variables needed for budget computations.
mass : dict prodloss : dict wetdep : dict drydep : numpy float64
Mass, prod/loss, and deposition terms
- Returns:
- resultdict
Contains dyn, net, and life terms.
- gcpy.budget_ox.print_budget(globvars, mass, prodloss, wetdep, drydep, metrics)
Prints the trop+strat budget file.
- Arguments:
- globvars: _GlobVars
Global variables needed for budget computations.
mass : dict prodloss : dict wetdep : dict drydep : numpy float64 metrics : dict
Mass, prod/loss and deposition terms.
- gcpy.budget_ox.global_ox_budget(devstr, devdir, devrstdir, year, dst='./1yr_benchmark', is_gchp=False, overwrite=True, spcdb_dir=None)
Main program to compute TransportTracersBenchmark budgets
- Arguments:
- maindir: str
Top-level benchmark folder
- devstr: str
Denotes the “Dev” benchmark version.
- year: int
The year of the benchmark simulation (e.g. 2016).
- Keyword Args (optional):
- dst: str
Directory where budget tables will be created. Default value: ‘./1yr_benchmark’
- is_gchp: bool
Denotes if data is from GCHP (True) or GCC (false). Default value: False
- overwrite: bool
Denotes whether to ovewrite existing budget tables. Default value: True
- spcdb_dir: str
Directory where species_database.yml is stored. Default value: GCPy directory