Skip to content

Add emission and deposition tables to the budget - #457

Open
Behrooz-Roozitalab wants to merge 1 commit into
NCAR:mainfrom
Behrooz-Roozitalab:chemistry_tables
Open

Add emission and deposition tables to the budget#457
Behrooz-Roozitalab wants to merge 1 commit into
NCAR:mainfrom
Behrooz-Roozitalab:chemistry_tables

Conversation

@Behrooz-Roozitalab

Copy link
Copy Markdown
Contributor

Updates to the budget code including:

  • including 'tropospheric' or global as an option in the yaml file.
  • including an option to create and use annual mean files instead of using the raw data.

Also, two tables are added to this version (could be called in YAML file) to calculate the emissions and depositions for all the variables in the files.

…ons and depositions- for all variables, add a calculation option using annual mean files

@justin-richling justin-richling left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is mostly good @Behrooz-Roozitalab, thank you for breaking this up logically! It looks like a lot of suggested changes, but it's really only related to commented out code and some indentation suggestions. I will merge this when you get to these, thanks again!

@@ -136,7 +153,7 @@ def aerosol_gas_tables(adfobj, trop_val=None, **kwargs):
# if True, calculate only Tropospheric values
# if False, all layers
# tropopause is defiend as either directly or indirectly. Look for tropopause to see the definition
Tropospheric = bres['Tropospheric']
#Tropospheric = bres['Tropospheric']

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the late review on this @Behrooz-Roozitalab! The only question I have is if this is commented out, could we just remove it, or is this something that might get flagged later?

raise AdfError(errmsg)

# Initialize nicknames dictionary
#nicknames = {}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we remove this if it is not being used?

Comment on lines +191 to +196
# Calculated duration of time period in seconds?
#durations[case] = (end_period-start_period).days*86400 #+365*86400


# Get number of years for calculations
#num_yrs[case] = (int(end_year)-int(start_year)) #+1

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we also remove these commented out lines?

except subprocess.CalledProcessError as e:
print(f"NCO Error (Exit Code {e.returncode}): {e.stderr}")

#os.sys(f"ncra {Files} {output_location}/{case}_ANN.nc")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this also safe to remove?


# Gather dictionary data for current case
# NOTE: The calculations can take a long time...
#Dic_scn_var_comp[case] = make_Dic_scn_var_comp_2D(adfobj, VARIABLES, data_dir, dic_SE, Files, ext1_SE, AEROSOLS)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we also remove this and line 273, #inside = Inside_SE_region(current_lat,current_lon,dir_shapefile)?

needed_vars = []
Dic_all_data={}

# all_data=[]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we remove this line?

if file == 0:
Dic_all_data[var]=[]

# Star gathering of variable data

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's indent this to match the formatting and fix typo to # Start gathering ...

data=data*delP
else:
data=data
# End if

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this is also off on the formatting, could you indent/move it to the correct spot?

nickname = case

# Collect row data in a list of dictionaries
#durations[case]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this commented out line.

@@ -136,7 +153,7 @@ def aerosol_gas_tables(adfobj, trop_val=None, **kwargs):
# if True, calculate only Tropospheric values
# if False, all layers
# tropopause is defiend as either directly or indirectly. Look for tropopause to see the definition
Tropospheric = bres['Tropospheric']
#Tropospheric = bres['Tropospheric']

### NOT WORKING FOR NOW

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this still not currently working, or can we remove this line too?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants