gcpy.budget_tt

Computes the budget of Pb, Be7, and Be10 from 1-year TransportTracersBenchmark simulations.

Module Contents

Classes

_GlobVars

Private class _GlobVars contains global data that needs to be

Functions

total(globvars, dict_list)

Function to take the difference of two dict objects.

mass_from_rst(globvars, ds, tropmask)

Computes global species mass from a restart file.

annual_average(globvars, ds, collection, conv_factor)

Computes the annual average of budgets or fluxes.

annual_average_sources(globvars)

Computes the annual average of radionuclide sources.

trop_residence_time(globvars)

Computes the tropospheric residence time of radionuclides.

print_budgets(globvars, data, key)

Prints the trop+strat budget file.

transport_tracers_budgets(devstr, devdir, devrstdir, year)

Main program to compute TransportTracersBenchmark budgets

class gcpy.budget_tt._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.

gcpy.budget_tt.total(globvars, dict_list)

Function to take the difference of two dict objects. Assumes that all objects have the same keys.

Args:
globvars: obj of type _GlobVars

Global variables needed for budget computations.

dict_list: list of dict

Dictionaries to be summed.

Returns:
result: dict

Key-by-key sum of all dicts in dict_list.

gcpy.budget_tt.mass_from_rst(globvars, ds, tropmask)

Computes global species mass from a restart file.

Args:
globvars: obj of type _GlobVars

Global variables needed for budget computations.

ds: xarray Dataset

Data containing species mass to be summed.

tropmask: numpy ndarray

Mask to denote tropospheric grid boxes.

Returns:
result: dict

Species mass in strat, trop, and strat+trop regimes.

gcpy.budget_tt.annual_average(globvars, ds, collection, conv_factor)

Computes the annual average of budgets or fluxes.

Args:
globvars: obj of type _GlobVars

Global variables needed for budget computations.

ds: xarray Dataset

Data to be averaged

collection: str

Name of the diagnostic collection.

conv_factor: str

Conversion factor to be applied.

Returns:
result: dict

Annual-average budgets or fluxes in in strat, trop, and strat+trop regimes.

gcpy.budget_tt.annual_average_sources(globvars)

Computes the annual average of radionuclide sources.

Args:
globvars: obj of type _GlobVars

Global variables needed for budget computations.

Returns:
result: dict

Source totals in strat, trop, and strat+trop regimes.

gcpy.budget_tt.trop_residence_time(globvars)

Computes the tropospheric residence time of radionuclides.

Args:
globvars: obj of type _GlobVars

Global variables needed for budget computations.

Returns:
result: dict

Tropopsheric residence time for all species.

gcpy.budget_tt.print_budgets(globvars, data, key)

Prints the trop+strat budget file.

Args:
globvars: object of type _GlobVars

Global variables needed for budget computations.

data: dict

Nested dictionary containing budget info.

key: list of str

One of “_f”, (full-atmosphere) “_t” (trop-only), or “_s” (strat-only).

gcpy.budget_tt.transport_tracers_budgets(devstr, devdir, devrstdir, year, dst='./1yr_benchmark', is_gchp=False, overwrite=True, spcdb_dir=os.path.dirname(__file__))

Main program to compute TransportTracersBenchmark budgets

Args:
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