gcpy.benchmark
Specific utilities for creating plots from GEOS-Chem benchmark simulations.
Module Contents
Functions
|
Creates a table of emissions totals (by sector and by inventory) |
|
Creates a table of global masses for a list of species in contained in |
|
Creates PDF files containing plots of species concentration |
|
Creates PDF files containing plots of emissions for model |
|
Creates a text file containing emission totals by species and |
|
Creates PDF files containing plots of J-values for model |
|
Creates PDF files containing plots of column aerosol optical |
|
Creates a text file containing global mass totals by species and |
|
Creates a text file containing metrics of global mean OH, MCF lifetime, |
|
Creates PDF files containing plots of species concentration |
|
Compute FullChemBenchmark aerosol budgets & burdens |
|
Prints the "operations budget" (i.e. change in mass after |
|
Creates a text file containing global mass of the PassiveTracer |
Attributes
- gcpy.benchmark.warning_format
- gcpy.benchmark.aod_spc = aod_species.yml
- gcpy.benchmark.spc_categories = benchmark_categories.yml
- gcpy.benchmark.emission_spc = emission_species.yml
- gcpy.benchmark.emission_inv = emission_inventories.yml
- gcpy.benchmark.create_total_emissions_table(refdata, refstr, devdata, devstr, species, outfilename, ref_interval=[2678400.0], dev_interval=[2678400.0], template='Emis{}_', refmetdata=None, devmetdata=None, spcdb_dir=os.path.dirname(__file__))
Creates a table of emissions totals (by sector and by inventory) for a list of species in contained in two data sets. The data sets, which typically represent output from two differnet model versions, are usually contained in netCDF data files.
- Args:
- refdata: xarray Dataset
The first data set to be compared (aka “Reference” or “Ref”).
- refstr: str
A string that can be used to identify refdata (e.g. a model version number or other identifier).
- devdata: xarray Dataset
The second data set to be compared (aka “Development” or “Dev”).
- devstr: str
A string that can be used to identify the data set specified by devfile (e.g. a model version number or other identifier).
- species: dict
Dictionary containing the name of each species and the target unit that emissions will be converted to. The format of species is as follows:
{ species_name: target_unit”, etc. }
where “species_name” and “target_unit” are strs.
- outfilename: str
Name of the text file which will contain the table of emissions totals.
- Keyword Args (optional):
- ref_interval: float
The length of the ref data interval in seconds. By default, interval is set to the number of seconds in a 31-day month (86400 * 31), which corresponds to typical benchmark simulation output. Default value: [2678400.0]
- dev_interval: float
The length of the dev data interval in seconds. By default, interval is set to the number of seconds in a 31-day month (86400 * 31), which corresponds to typical benchmark simulation output. Default value: [2678400.0]
- template: str
Template for the diagnostic names that are contained both “Reference” and “Development” data sets. If not specified, template will be set to “Emis{}”, where {} will be replaced by the species name. Default value: “Emis{}_”
- ref_area_varname: str
Name of the variable containing the grid box surface areas (in m2) in the ref dataset. Default value: ‘AREA’
- dev_area_varname: str
Name of the variable containing the grid box surface areas (in m2) in the dev dataset. Default value: ‘AREA’
- refmetdata: xarray dataset
Dataset containing ref meteorology and area Default value: None
- devmetdata: xarray dataset
Dataset containing dev meteorology and area Default value: None
- spcdb_dir: str
Directory of species_datbase.yml file Default value: Directory of GCPy code repository
- Remarks:
This method is mainly intended for model benchmarking purposes, rather than as a general-purpose tool.
Species properties (such as molecular weights) are read from a YAML file called “species_database.yml”.
- gcpy.benchmark.create_global_mass_table(refdata, refstr, devdata, devstr, varlist, met_and_masks, label, trop_only=False, outfilename='GlobalMass_TropStrat.txt', verbose=False, spcdb_dir=os.path.dirname(__file__))
Creates a table of global masses for a list of species in contained in two data sets. The data sets, which typically represent output from two different model versions, are usually contained in netCDF data files.
- Args:
- refdata: xarray Dataset
The first data set to be compared (aka “Reference”).
- refstr: str
A string that can be used to identify refdata (e.g. a model version number or other identifier).
- devdata: xarray Dataset
The second data set to be compared (aka “Development”).
- devstr: str
A string that can be used to identify the data set specified by devfile (e.g. a model version number or other identifier).
- varlist: list of strings
List of species concentation variable names to include in the list of global totals.
- met_and_masks: dict of xarray DataArray
Dictionary containing the meterological variables and masks for the Ref and Dev datasets.
- label: str
Label to go in the header string. Can be used to pass the month & year.
- Keyword Args (optional):
- trop_only: bool
Set this switch to True if you wish to print totals only for the troposphere. Default value: False (i.e. print whole-atmosphere totals).
- outfilename: str
Name of the text file which will contain the table of emissions totals. Default value: “GlobalMass_TropStrat.txt”
- verbose: bool
Set this switch to True if you wish to print out extra informational messages. Default value: False
- spcdb_dir: str
Directory of species_datbase.yml file Default value: Directory of GCPy code repository
- Remarks:
This method is mainly intended for model benchmarking purposes, rather than as a general-purpose tool.
Species properties (such as molecular weights) are read from a YAML file called “species_database.yml”.
- gcpy.benchmark.make_benchmark_conc_plots(ref, refstr, dev, devstr, dst='./benchmark', subdst=None, overwrite=False, verbose=False, collection='SpeciesConc', benchmark_type='FullChemBenchmark', plot_by_spc_cat=True, restrict_cats=[], plots=['sfc', '500hpa', 'zonalmean'], use_cmap_RdBu=False, log_color_scale=False, sigdiff_files=None, normalize_by_area=False, cats_in_ugm3=['Aerosols', 'Secondary_Organic_Aerosols'], areas=None, refmet=None, devmet=None, weightsdir='.', n_job=-1, second_ref=None, second_dev=None, time_mean=False, spcdb_dir=os.path.dirname(__file__))
Creates PDF files containing plots of species concentration for model benchmarking purposes.
- Args:
- ref: str
Path name for the “Ref” (aka “Reference”) data set.
- refstr: str OR list of str
A string to describe ref (e.g. version number) OR list containing [ref1str, ref2str] for diff-of-diffs plots
- dev: str
Path name for the “Dev” (aka “Development”) data set. This data set will be compared against the “Reference” data set.
- devstr: str OR list of str
A string to describe dev (e.g. version number) OR list containing [dev1str, dev2str] for diff-of-diffs plots
- Keyword Args (optional):
- dst: str
A string denoting the destination folder where a PDF file containing plots will be written. Default value: ./benchmark
- subdst: str
A string denoting the sub-directory of dst where PDF files containing plots will be written. In practice, subdst is only needed for the 1-year benchmark output, and denotes a date string (such as “Jan2016”) that corresponds to the month that is being plotted. Default value: None
- overwrite: bool
Set this flag to True to overwrite files in the destination folder (specified by the dst argument). Default value: False
- verbose: bool
Set this flag to True to print extra informational output. Default value: False
- collection: str
Name of collection to use for plotting. Default value: “SpeciesConc”
- benchmark_type: str
A string denoting the type of benchmark output to plot, either FullChemBenchmark or TransportTracersBenchmark. Default value: “FullChemBenchmark”
- plot_by_spc_cat: logical
Set this flag to False to send plots to one file rather than separate file per category. Default value: True
- restrict_cats: list of strings
List of benchmark categories in benchmark_categories.yml to make plots for. If empty, plots are made for all categories. Default value: empty
- plots: list of strings
List of plot types to create. Default value: [‘sfc’, ‘500hpa’, ‘zonalmean’]
- log_color_scale: bool
Set this flag to True to enable plotting data (not diffs) on a log color scale. Default value: False
- normalize_by_area: bool
Set this flag to true to enable normalization of data by surfacea area (i.e. kg s-1 –> kg s-1 m-2).
Default value: False
- cats_in_ugm3: list of str
List of benchmark categories to to convert to ug/m3 Default value: [“Aerosols”, “Secondary_Organic_Aerosols”]
- areas: dict of xarray DataArray:
Grid box surface areas in m2 on Ref and Dev grids. Default value: None
- refmet: str
Path name for ref meteorology Default value: None
- devmet: str
Path name for dev meteorology Default value: None
- sigdiff_files: list of str
Filenames that will contain the lists of species having significant differences in the ‘sfc’, ‘500hpa’, and ‘zonalmean’ plots. These lists are needed in order to fill out the benchmark approval forms. Default value: None
- weightsdir: str
Directory in which to place (and possibly reuse) xESMF regridder netCDF files. Default value: ‘.’
- n_job: int
Defines the number of simultaneous workers for parallel plotting. Set to 1 to disable parallel plotting. Value of -1 allows the application to decide. Default value: -1
- second_ref: str
Path name for a second “Ref” (aka “Reference”) data set for diff-of-diffs plotting. This dataset should have the same model type and grid as ref. Default value: None
- second_dev: str
Path name for a second “Ref” (aka “Reference”) data set for diff-of-diffs plotting. This dataset should have the same model type and grid as ref. Default value: None
- spcdb_dir: str
Directory of species_datbase.yml file Default value: Directory of GCPy code repository
- time_meanbool
Determines if we should average the datasets over time Default value: False
- gcpy.benchmark.make_benchmark_emis_plots(ref, refstr, dev, devstr, dst='./benchmark', subdst=None, plot_by_spc_cat=False, plot_by_hco_cat=False, overwrite=False, verbose=False, flip_ref=False, flip_dev=False, log_color_scale=False, sigdiff_files=None, weightsdir='.', n_job=-1, time_mean=False, spcdb_dir=os.path.dirname(__file__))
Creates PDF files containing plots of emissions for model benchmarking purposes. This function is compatible with benchmark simulation output only. It is not compatible with transport tracers emissions diagnostics.
- Args:
- ref: str
Path name for the “Ref” (aka “Reference”) data set.
- refstr: str
A string to describe ref (e.g. version number)
- dev: str
Path name for the “Dev” (aka “Development”) data set. This data set will be compared against the “Reference” data set.
- devstr: str
A string to describe dev (e.g. version number)
- Keyword Args (optional):
- dst: str
A string denoting the destination folder where PDF files containing plots will be written. Default value: ‘./benchmark
- subdst: str
A string denoting the sub-directory of dst where PDF files containing plots will be written. In practice, and denotes a date string (such as “Jan2016”) that corresponds to the month that is being plotted. Default value: None
- plot_by_spc_cat: bool
Set this flag to True to separate plots into PDF files according to the benchmark species categories (e.g. Oxidants, Aerosols, Nitrogen, etc.) These categories are specified in the YAML file benchmark_species.yml. Default value: False
- plot_by_hco_cat: bool
Set this flag to True to separate plots into PDF files according to HEMCO emissions categories (e.g. Anthro, Aircraft, Bioburn, etc.) Default value: False
- overwrite: bool
Set this flag to True to overwrite files in the destination folder (specified by the dst argument). Default value: False
- verbose: bool
Set this flag to True to print extra informational output. Default value: False
- flip_ref: bool
Set this flag to True to reverse the vertical level ordering in the “Ref” dataset (in case “Ref” starts from the top of atmosphere instead of the surface). Default value: False
- flip_dev: bool
Set this flag to True to reverse the vertical level ordering in the “Dev” dataset (in case “Dev” starts from the top of atmosphere instead of the surface). Default value: False
- log_color_scale: bool
Set this flag to True to enable plotting data (not diffs) on a log color scale. Default value: False
- sigdiff_files: list of str
Filenames that will contain the lists of species having significant differences in the ‘sfc’, ‘500hpa’, and ‘zonalmean’ plots. These lists are needed in order to fill out the benchmark approval forms. Default value: None
- weightsdir: str
Directory in which to place (and possibly reuse) xESMF regridder netCDF files. Default value: ‘.’
- n_job: int
Defines the number of simultaneous workers for parallel plotting. Set to 1 to disable parallel plotting. Value of -1 allows the application to decide. Default value: -1
- spcdb_dir: str
Directory of species_datbase.yml file Default value: Directory of GCPy code repository
- time_meanbool
Determines if we should average the datasets over time Default value: False
- Remarks:
If both plot_by_spc_cat and plot_by_hco_cat are False, then all emission plots will be placed into the same PDF file.
Emissions that are 3-dimensional will be plotted as column sums.
- gcpy.benchmark.make_benchmark_emis_tables(reflist, refstr, devlist, devstr, dst='./benchmark', refmet=None, devmet=None, overwrite=False, ref_interval=[2678400.0], dev_interval=[2678400.0], spcdb_dir=os.path.dirname(__file__))
Creates a text file containing emission totals by species and category for benchmarking purposes.
- Args:
- reflist: list of str
List with the path names of the emissions file or files (multiple months) that will constitute the “Ref” (aka “Reference”) data set.
- refstr: str
A string to describe ref (e.g. version number)
- devlist: list of str
List with the path names of the emissions file or files (multiple months) that will constitute the “Dev” (aka “Development”) data set
- devstr: str
A string to describe dev (e.g. version number)
- Keyword Args (optional):
- dst: str
A string denoting the destination folder where the file containing emissions totals will be written. Default value: ./benchmark
- refmet: str
Path name for ref meteorology Default value: None
- devmet: str
Path name for dev meteorology Default value: None
- overwrite: bool
Set this flag to True to overwrite files in the destination folder (specified by the dst argument). Default value: False
- ref_interval: list of float
The length of the ref data interval in seconds. By default, interval is set to [2678400.0], which is the number of seconds in July (our 1-month benchmarking month). Default value: [2678400.0]
- dev_interval: list of float
The length of the dev data interval in seconds. By default, interval is set to [2678400.0], which is the number of seconds in July (our 1-month benchmarking month). Default value: [2678400.0]
- spcdb_dir: str
Directory of species_datbase.yml file Default value: Directory of GCPy code repository
- gcpy.benchmark.make_benchmark_jvalue_plots(ref, refstr, dev, devstr, varlist=None, dst='./benchmark', subdst=None, local_noon_jvalues=False, plots=['sfc', '500hpa', 'zonalmean'], overwrite=False, verbose=False, flip_ref=False, flip_dev=False, log_color_scale=False, sigdiff_files=None, weightsdir='.', n_job=-1, time_mean=False, spcdb_dir=os.path.dirname(__file__))
Creates PDF files containing plots of J-values for model benchmarking purposes.
- Args:
- ref: str
Path name for the “Ref” (aka “Reference”) data set.
- refstr: str
A string to describe ref (e.g. version number)
- dev: str
Path name for the “Dev” (aka “Development”) data set. This data set will be compared against the “Reference” data set.
- devstr: str
A string to describe dev (e.g. version number)
- Keyword Args (optional):
- varlist: list of str
List of J-value variables to plot. If not passed, then all J-value variables common to both dev and ref will be plotted. The varlist argument can be a useful way of restricting the number of variables plotted to the pdf file when debugging. Default value: None
- dst: str
A string denoting the destination folder where a PDF file containing plots will be written. Default value: ./benchmark.
- subdst: str
A string denoting the sub-directory of dst where PDF files containing plots will be written. In practice, subdst is only needed for the 1-year benchmark output, and denotes a date string (such as “Jan2016”) that corresponds to the month that is being plotted. Default value: None
- local_noon_jvalues: bool
Set this flag to plot local noon J-values. This will divide all J-value variables by the JNoonFrac counter, which is the fraction of the time that it was local noon at each location. Default value: False
- plots: list of strings
List of plot types to create. Default value: [‘sfc’, ‘500hpa’, ‘zonalmean’]
- overwrite: bool
Set this flag to True to overwrite files in the destination folder (specified by the dst argument). Default value: False.
- verbose: bool
Set this flag to True to print extra informational output. Default value: False
- flip_ref: bool
Set this flag to True to reverse the vertical level ordering in the “Ref” dataset (in case “Ref” starts from the top of atmosphere instead of the surface). Default value: False
- flip_dev: bool
Set this flag to True to reverse the vertical level ordering in the “Dev” dataset (in case “Dev” starts from the top of atmosphere instead of the surface). Default value: False
- log_color_scale: bool
Set this flag to True if you wish to enable plotting data (not diffs) on a log color scale. Default value: False
- sigdiff_files: list of str
Filenames that will contain the lists of J-values having significant differences in the ‘sfc’, ‘500hpa’, and ‘zonalmean’ plots. These lists are needed in order to fill out the benchmark approval forms. Default value: None
- weightsdir: str
Directory in which to place (and possibly reuse) xESMF regridder netCDF files. Default value: ‘.’
- n_job: int
Defines the number of simultaneous workers for parallel plotting. Set to 1 to disable parallel plotting. Value of -1 allows the application to decide. Default value: -1
- spcdb_dir: str
Directory of species_datbase.yml file Default value: Directory of GCPy code repository
- time_meanbool
Determines if we should average the datasets over time Default value: False
- Remarks:
- Will create 4 files containing J-value plots:
(1 ) Surface values (2 ) 500 hPa values (3a) Full-column zonal mean values. (3b) Stratospheric zonal mean values
These can be toggled on/off with the plots keyword argument.
At present, we do not yet have the capability to split the plots up into separate files per category (e.g. Oxidants, Aerosols, etc.). This is primarily due to the fact that we archive J-values from GEOS-Chem for individual species but not family species. We could attempt to add this functionality later if there is sufficient demand.
- gcpy.benchmark.make_benchmark_aod_plots(ref, refstr, dev, devstr, varlist=None, dst='./benchmark', subdst=None, overwrite=False, verbose=False, log_color_scale=False, sigdiff_files=None, weightsdir='.', n_job=-1, time_mean=False, spcdb_dir=os.path.dirname(__file__))
Creates PDF files containing plots of column aerosol optical depths (AODs) for model benchmarking purposes.
- Args:
- ref: str
Path name for the “Ref” (aka “Reference”) data set.
- refstr: str
A string to describe ref (e.g. version number)
- dev: str
Path name for the “Dev” (aka “Development”) data set. This data set will be compared against the “Reference” data set.
- devstr: str
A string to describe dev (e.g. version number)
- Keyword Args (optional):
- varlist: list of str
List of AOD variables to plot. If not passed, then all AOD variables common to both Dev and Ref will be plotted. Use the varlist argument to restrict the number of variables plotted to the pdf file when debugging. Default value: None
- dst: str
A string denoting the destination folder where a PDF file containing plots will be written. Default value: ./benchmark.
- subdst: str
A string denoting the sub-directory of dst where PDF files containing plots will be written. In practice, subdst is only needed for the 1-year benchmark output, and denotes a date string (such as “Jan2016”) that corresponds to the month that is being plotted. Default value: None
- overwrite: bool
Set this flag to True to overwrite files in the destination folder (specified by the dst argument). Default value: False.
- verbose: bool
Set this flag to True to print extra informational output. Default value: False
- log_color_scale: bool
Set this flag to True to enable plotting data (not diffs) on a log color scale. Default value: False
- sigdiff_files: list of str
Filenames that will contain the list of quantities having having significant differences in the column AOD plots. These lists are needed in order to fill out the benchmark approval forms. Default value: None
- weightsdir: str
Directory in which to place (and possibly reuse) xESMF regridder netCDF files. Default value: ‘.’
- n_job: int
Defines the number of simultaneous workers for parallel plotting. Set to 1 to disable parallel plotting. Value of -1 allows the application to decide. Default value: -1
- spcdb_dir: str
Directory of species_datbase.yml file Default value: Directory of GCPy code repository
- time_meanbool
Determines if we should average the datasets over time Default value: False
- gcpy.benchmark.make_benchmark_mass_tables(ref, refstr, dev, devstr, varlist=None, dst='./benchmark', subdst=None, overwrite=False, verbose=False, label='at end of simulation', spcdb_dir=os.path.dirname(__file__), ref_met_extra='', dev_met_extra='')
Creates a text file containing global mass totals by species and category for benchmarking purposes.
- Args:
- reflist: str
Pathname that will constitute the “Ref” (aka “Reference”) data set.
- refstr: str
A string to describe ref (e.g. version number)
- dev: list of str
Pathname that will constitute the “Dev” (aka “Development”) data set. The “Dev” data set will be compared against the “Ref” data set.
- devstr: str
A string to describe dev (e.g. version number)
- Keyword Args (optional):
- varlist: list of str
List of variables to include in the list of totals. If omitted, then all variables that are found in either “Ref” or “Dev” will be included. The varlist argument can be a useful way of reducing the number of variables during debugging and testing. Default value: None
- dst: str
A string denoting the destination folder where the file containing emissions totals will be written. Default value: ./benchmark
- subdst: str
A string denoting the sub-directory of dst where PDF files containing plots will be written. In practice, subdst is only needed for the 1-year benchmark output, and denotes a date string (such as “Jan2016”) that corresponds to the month that is being plotted. Default value: None
- overwrite: bool
Set this flag to True to overwrite files in the destination folder (specified by the dst argument). Default value: False
- verbose: bool
Set this flag to True to print extra informational output. Default value: False.
- spcdb_dir: str
Directory of species_datbase.yml file Default value: Directory of GCPy code repository
- ref_met_extra: str
Path to ref Met file containing area data for use with restart files which do not contain the Area variable. Default value: ‘’
- dev_met_extra: str
Path to dev Met file containing area data for use with restart files which do not contain the Area variable. Default value: ‘’
- gcpy.benchmark.make_benchmark_oh_metrics(ref, refmet, refstr, dev, devmet, devstr, dst='./benchmark', overwrite=False)
Creates a text file containing metrics of global mean OH, MCF lifetime, and CH4 lifetime for benchmarking purposes.
- Args:
- ref: str
Path name of “Ref” (aka “Reference”) data set file.
- refmet: str
Path name of ref meteorology data set.
- refstr: str
A string to describe ref (e.g. version number)
- dev: str
Path name of “Dev” (aka “Development”) data set file. The “Dev” data set will be compared against the “Ref” data set.
- devmet: list of str
Path name of dev meteorology data set.
- devstr: str
A string to describe dev (e.g. version number)
- Keyword Args (optional):
- dst: str
A string denoting the destination folder where the file containing emissions totals will be written. Default value: “./benchmark”
- overwrite: bool
Set this flag to True to overwrite files in the destination folder (specified by the dst argument). Default value: False
- gcpy.benchmark.make_benchmark_wetdep_plots(ref, refstr, dev, devstr, collection, dst='./benchmark', datestr=None, overwrite=False, verbose=False, benchmark_type='TransportTracersBenchmark', plots=['sfc', '500hpa', 'zonalmean'], log_color_scale=False, normalize_by_area=False, areas=None, refmet=None, devmet=None, weightsdir='.', n_job=-1, time_mean=False, spcdb_dir=os.path.dirname(__file__))
Creates PDF files containing plots of species concentration for model benchmarking purposes.
- Args:
- ref: str
Path name for the “Ref” (aka “Reference”) data set.
- refstr: str
A string to describe ref (e.g. version number)
- dev: str
Path name for the “Dev” (aka “Development”) data set. This data set will be compared against the “Reference” data set.
- devstr: str
A string to describe dev (e.g. version number)
- collection: str
String name of collection to plot comparisons for.
- Keyword Args (optional):
- dst: str
A string denoting the destination folder where a PDF file containing plots will be written. Default value: ./benchmark
- datestr: str
A string with date information to be included in both the plot pdf filename and as a destination folder subdirectory for writing plots Default value: None
- benchmark_type: str
A string denoting the type of benchmark output to plot, either FullChemBenchmark or TransportTracersBenchmark. Default value: “FullChemBenchmark”
- overwrite: bool
Set this flag to True to overwrite files in the destination folder (specified by the dst argument). Default value: False.
- verbose: bool
Set this flag to True to print extra informational output. Default value: False.
- plots: list of strings
List of plot types to create. Default value: [‘sfc’, ‘500hpa’, ‘zonalmean’]
- normalize_by_area: bool
Set this flag to true to enable normalization of data by surfacea area (i.e. kg s-1 –> kg s-1 m-2). Default value: False
- areas: dict of xarray DataArray:
Grid box surface areas in m2 on Ref and Dev grids. Default value: None
- refmet: str
Path name for ref meteorology Default value: None
- devmet: str
Path name for dev meteorology Default value: None
- n_job: int
Defines the number of simultaneous workers for parallel plotting. Set to 1 to disable parallel plotting. Value of -1 allows the application to decide. Default value: -1
- spcdb_dir: str
Directory of species_datbase.yml file Default value: Directory of GCPy code repository
- time_meanbool
Determines if we should average the datasets over time Default value: False
- gcpy.benchmark.make_benchmark_aerosol_tables(devdir, devlist_aero, devlist_spc, devlist_met, devstr, year, days_per_mon, dst='./benchmark', overwrite=False, is_gchp=False, spcdb_dir=os.path.dirname(__file__))
Compute FullChemBenchmark aerosol budgets & burdens
- Args:
- devdir: str
Path to development (“Dev”) data directory
- devlist_aero: list of str
List of Aerosols collection files (different months)
- devlist_spc: list of str
List of SpeciesConc collection files (different months)
- devlist_met: list of str
List of meteorology collection files (different months)
- devstr: str
Descriptive string for datasets (e.g. version number)
- year: str
The year of the benchmark simulation (e.g. ‘2016’).
- days_per_month: list of int
List of number of days per month for all months
- Keyword Args (optional):
- dst: str
Directory where budget tables will be created. Default value: ‘./benchmark’
- overwrite: bool
Overwrite burden & budget tables? (default=True) Default value: False
- is_gchp: bool
Whether datasets are for GCHP Default value: False
- spcdb_dir: str
Directory of species_datbase.yml file Default value: Directory of GCPy code repository
- gcpy.benchmark.make_benchmark_operations_budget(refstr, reffiles, devstr, devfiles, ref_interval, dev_interval, benchmark_type=None, label=None, col_sections=['Full', 'Trop', 'PBL', 'Strat'], operations=['Chemistry', 'Convection', 'EmisDryDep', 'Mixing', 'Transport', 'WetDep'], compute_accum=True, require_overlap=False, dst='.', species=None, overwrite=True)
Prints the “operations budget” (i.e. change in mass after each operation) from a GEOS-Chem benchmark simulation.
- Args:
- refstr: str
Labels denoting the “Ref” versions
- reffiles: list of str
Lists of files to read from the “Ref” version.
- devstr: str
Labels denoting the “Dev” versions
- devfiles: list of str
Lists of files to read from “Dev” version.
- interval: float
Number of seconds in the diagnostic interval.
- Keyword Args (optional):
- benchmark_type: str
“TransportTracersBenchmark” or “FullChemBenchmark”. Default value: None
- label: str
Contains the date or date range for each dataframe title. Default value: None
- col_sections: list of str
List of column sections to calculate global budgets for. May include Strat eventhough not calculated in GEOS-Chem, but Full and Trop must also be present to calculate Strat. Default value: [“Full”, “Trop”, “PBL”, “Strat”]
- operations: list of str
List of operations to calculate global budgets for. Accumulation should not be included. It will automatically be calculated if all GEOS-Chem budget operations are passed and optional arg compute_accum is True. Default value: [“Chemistry”,”Convection”,”EmisDryDep”,
“Mixing”,”Transport”,”WetDep”]
- compute_accum: bool
Optionally turn on/off accumulation calculation. If True, will only compute accumulation if all six GEOS-Chem operations budgets are computed. Otherwise a message will be printed warning that accumulation will not be calculated. Default value: True
- require_overlap: bool
Whether to calculate budgets for only species that are present in both Ref or Dev. Default value: False
- dst: str
Directory where plots & tables will be created. Default value: ‘.’ (directory in which function is called)
- species: list of str
List of species for which budgets will be created. Default value: None (all species)
- overwrite: bool
Denotes whether to overwrite existing budget file. Default value: True
- gcpy.benchmark.make_benchmark_mass_conservation_table(datafiles, runstr, dst='./benchmark', overwrite=False, spcdb_dir=os.path.dirname(__file__))
Creates a text file containing global mass of the PassiveTracer from Transport Tracer simulations across a series of restart files.
- Args:
- datafiles: list of str
Path names of restart files.
- runstr: str
Name to put in the filename and header of the output file
- refstr: str
A string to describe ref (e.g. version number)
- dev: str
Path name of “Dev” (aka “Development”) data set file. The “Dev” data set will be compared against the “Ref” data set.
- devmet: list of str
Path name of dev meteorology data set.
- devstr: str
A string to describe dev (e.g. version number)
- Keyword Args (optional):
- dst: str
A string denoting the destination folder where the file containing emissions totals will be written. Default value: “./benchmark”
- overwrite: bool
Set this flag to True to overwrite files in the destination folder (specified by the dst argument). Default value: False