Skip to content

Commit

Permalink
fixed bug affecting multiple size bins
Browse files Browse the repository at this point in the history
The wrong dimension was being indexed for N_perbin when initial particle volumes were being calculated, leading to error in the ode solver. This has now been resolved.
  • Loading branch information
simonom committed Nov 18, 2024
1 parent 95d164e commit 04b0bdb
Show file tree
Hide file tree
Showing 37 changed files with 206 additions and 80,189 deletions.
Binary file modified PyCHAM/__pycache__/accom_coeff_calc.cpython-39.pyc
Binary file not shown.
Binary file modified PyCHAM/__pycache__/dydt_rec.cpython-39.pyc
Binary file not shown.
Binary file modified PyCHAM/__pycache__/eqn_interr.cpython-39.pyc
Binary file not shown.
Binary file modified PyCHAM/__pycache__/hyst_eq.cpython-39.pyc
Binary file not shown.
Binary file modified PyCHAM/__pycache__/init_conc.cpython-39.pyc
Binary file not shown.
Binary file modified PyCHAM/__pycache__/ode_solv.cpython-39.pyc
Binary file not shown.
Binary file modified PyCHAM/__pycache__/ode_updater_su.cpython-39.pyc
Binary file not shown.
Binary file modified PyCHAM/__pycache__/part_nsd.cpython-39.pyc
Binary file not shown.
Binary file modified PyCHAM/__pycache__/pp_intro.cpython-39.pyc
Binary file not shown.
Binary file modified PyCHAM/__pycache__/pp_water_equil.cpython-39.pyc
Binary file not shown.
Binary file modified PyCHAM/__pycache__/rate_coeffs.cpython-39.pyc
Binary file not shown.
Binary file modified PyCHAM/__pycache__/size_distr.cpython-39.pyc
Binary file not shown.
Binary file modified PyCHAM/__pycache__/write_ode_solv.cpython-39.pyc
Binary file not shown.
2 changes: 1 addition & 1 deletion PyCHAM/dydt_rec.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
# changes due to gas-phase photochemistry and partitioning are included;
# generated in init_conc and treats loss from gas-phase as negative

# File Created at 2024-11-15 17:34:41.360613
# File Created at 2024-11-18 11:42:12.348731

import numpy as np

Expand Down
10 changes: 7 additions & 3 deletions PyCHAM/eqn_interr.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,11 @@ def eqn_interr(num_sb, erf, err_mess, self):
# component and that component is organic
if ('[O]' in name_SMILE):
if ('C' in name_SMILE or 'c' in name_SMILE):
# if it is an alkoxy radical (rather than alkyl peroxy radical) add its index to list
if ('O[O]' not in name_SMILE and '[O]O' not in name_SMILE): # ensure it's not alkyl peroxy radical
# if it is an alkoxy radical (rather than
# alkyl peroxy radical) add its index to list
# ensure it's not alkyl peroxy radical
if ('O[O]' not in name_SMILE and
'[O]O' not in name_SMILE):
self.RO_indx.append(comp_num)

comp_num += 1 # number of unique species
Expand All @@ -293,7 +296,8 @@ def eqn_interr(num_sb, erf, err_mess, self):
name_only_this_eq.append(name_only)

# store reactant index
# check if index already present in this reaction - i.e. component appears more than once
# check if index already present in this reaction -
# i.e. component appears more than once
if (sum(rindx[eqn_step, 0:reactant_step] == int(name_indx)) > 0):
# get existing index of this component
exist_indx = (np.where(rindx[eqn_step, 0:reactant_step]==(int(name_indx))))[0]
Expand Down
2 changes: 1 addition & 1 deletion PyCHAM/hyst_eq.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
##########################################################################################
'''solution of deliquescence and efflorescence RH, generated by eqn_pars.py in fully functioning mode, or by ui_check.py in testing mode'''
# module to estimate deliquescence and efflorescence relative humidity as a function of temperature
# File Created at 2024-11-15 17:34:41.373159
# File Created at 2024-11-18 11:42:12.349062

# function for deliquescence
def drh(TEMP):
Expand Down
2 changes: 1 addition & 1 deletion PyCHAM/init_conc.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ def init_conc(num_comp, init_conc, PInit,

for i in range(num_comp): # loop through all components to get molar weights
y_mw[i] = self.Pybel_objects[i].molwt # molecular mass (g/mol)

# --------------------------------------------------------------
# account for water's properties

Expand Down
Binary file modified PyCHAM/input/.DS_Store
Binary file not shown.
61 changes: 54 additions & 7 deletions PyCHAM/input/Baker2024/MCM_PRAM_xml.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,59 @@
<species species_name="H2O" species_number="s6060">
<smiles>O</smiles>
</species>
<species species_number="s6055" species_name="AMM_SUL">
<smiles>O=S(=O)(O)O.N.N</smiles>
</species>
<species species_name="O" species_number="s6061">
<smiles>[O]</smiles>
<species species_number="s1" species_name="core">
<smiles>NOS(O)(O)ON</smiles>
</species>
<species species_number="s1" species_name="core_ind">
<smiles>CCCCCCCCCC</smiles>
</species>
<species species_number="s1" species_name="AMMSUL">
<smiles>NOS(O)(O)ON</smiles>
</species>
<species species_number="s1" species_name="AMMChloride">
<smiles>NCl</smiles>
</species>
<species species_number="s1" species_name="AMMNitrate">
<smiles>NN(=O)(O)(O)</smiles>
</species>
<species species_number="s1" species_name="AMMBiSUL">
<smiles>OS(=O)(=O)ON</smiles>
</species>
<species species_number="s1" species_name="C7H15CHO">
<smiles>CCCCCCCCO</smiles>
</species>
<species species_number="s1" species_name="C8H17CHO">
<smiles>CCCCCCCCCO</smiles>
</species>
<species species_number="s1" species_name="C9H19CHO">
<smiles>CCCCCCCCCCO</smiles>
</species>
<species species_number="s1" species_name="pri_org">
<smiles>CCCCCCCCCCCCCCCC(=O)O</smiles>
</species>
<species species_number="s1" species_name="pri_org_ind">
<smiles>CCCCCCCCCCCCCCCC(=O)O</smiles>
</species>
<species species_number="s1" species_name="sec_org">
<smiles>CCCCCCCCCCCCCCC</smiles>
</species>
<species species_number="s1" species_name="sec_org1">
<smiles>OOCCCCCCCCCC</smiles>
</species>
<species species_number="s1" species_name="sec_org0">
<smiles>OOCCCOOCCCCCCCO</smiles>
</species>
<species species_number="s1" species_name="sec_org-1">
<smiles>OOCCCOOCCCOOCCCCOO</smiles>
</species>
<species species_number="s1" species_name="sec_org-2">
<smiles>OOCCOOCOOCCOCOOCCCCOO</smiles>
</species>
<species species_number="s1" species_name="O">
<smiles>[O]</smiles>
</species>
<species species_name="O2" species_number="s6062">
<smiles>OO</smiles>
<smiles>O=O</smiles>
</species>
<species species_name="C1" species_number="s6063">
<smiles>CC</smiles>
Expand Down Expand Up @@ -1615,7 +1660,9 @@
<species species_name="HYETHO2H" species_number="s520">
<smiles>OCCOO</smiles>
</species>
<species species_name="NO" species_number="s521"></species>
<species species_name="NO" species_number="s521">
<smiles>[N]=O</smiles>
</species>
<species species_name="ETHOHNO3" species_number="s522">
<smiles>OCCON(=O)=O</smiles>
</species>
Expand Down
102 changes: 97 additions & 5 deletions PyCHAM/input/auto_call_test/MCM_PRAM_xml.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,101 @@
<species species_name="H2O" species_number="s6060">
<smiles>O</smiles>
</species>
<species species_number="s6055" species_name="AMM_SUL">
<smiles>O=S(=O)(O)O.N.N</smiles>
<species species_number="s1" species_name="core">
<smiles>NOS(O)(O)ON</smiles>
</species>
<species species_number="s1" species_name="core_ind">
<smiles>CCCCCCCCCC</smiles>
</species>
<species species_number="s1" species_name="AMMSUL">
<smiles>NOS(O)(O)ON</smiles>
</species>
<species species_number="s1" species_name="AMMChloride">
<smiles>NCl</smiles>
</species>
<species species_number="s1" species_name="AMMNitrate">
<smiles>NN(=O)(O)(O)</smiles>
</species>
<species species_number="s1" species_name="AMMBiSUL">
<smiles>OS(=O)(=O)ON</smiles>
</species>
<species species_number="s1" species_name="C7H15CHO">
<smiles>CCCCCCCCO</smiles>
</species>
<species species_number="s1" species_name="C8H17CHO">
<smiles>CCCCCCCCCO</smiles>
</species>
<species species_number="s1" species_name="C9H19CHO">
<smiles>CCCCCCCCCCO</smiles>
</species>
<species species_number="s1" species_name="pri_org">
<smiles>CCCCCCCCCCCCCCCC(=O)O</smiles>
</species>
<species species_number="s1" species_name="pri_org_ind">
<smiles>CCCCCCCCCCCCCCCC(=O)O</smiles>
</species>
<species species_number="s1" species_name="sec_org">
<smiles>CCCCCCCCCCCCCCC</smiles>
</species>
<species species_number="s1" species_name="sec_org1">
<smiles>OOCCCCCCCCCC</smiles>
</species>
<species species_number="s1" species_name="sec_org0">
<smiles>OOCCCOOCCCCCCCO</smiles>
</species>
<species species_number="s1" species_name="sec_org-1">
<smiles>OOCCCOOCCCOOCCCCOO</smiles>
</species>
<species species_number="s1" species_name="sec_org-2">
<smiles>OOCCOOCOOCCOCOOCCCCOO</smiles>
</species>
<species species_number="s1" species_name="O">
<smiles>[O]</smiles>
</species>
<species species_name="O2" species_number="s6062">
<smiles>O=O</smiles>
</species>
<species species_name="C1" species_number="s6063">
<smiles>CC</smiles>
</species>
<species species_name="O" species_number="s6061">
<smiles>[O]</smiles>
<species species_name="C2" species_number="s6064">
<smiles>CCCC</smiles>
</species>
<species species_name="C3" species_number="s6065">
<smiles>CCCCCC</smiles>
</species>
<species species_name="C4" species_number="s6066">
<smiles>CCCCCCCC</smiles>
</species>
<species species_name="C5" species_number="s6067">
<smiles>CCCCCCCCCC</smiles>
</species>
<species species_name="C6" species_number="s6068">
<smiles>CCCCCCCCCCCC</smiles>
</species>
<species species_name="C7" species_number="s6069">
<smiles>CCCCCCCCCCCCCC</smiles>
</species>
<species species_name="C8" species_number="s6070">
<smiles>CCCCCCCCCCCCCCCC</smiles>
</species>
<species species_name="C9" species_number="s6071">
<smiles>CCCCCCCCCCCCCCCCCC</smiles>
</species>
<species species_name="C10" species_number="s6072">
<smiles>CCCCCCCCCCCCCCCCCCCC</smiles>
</species>
<species species_name="C11" species_number="s6073">
<smiles>CCCCCCCCCCCCCCCCCCCCCC</smiles>
</species>
<species species_name="C12" species_number="s6074">
<smiles>CCCCCCCCCCCCCCCCCCCCCCCC</smiles>
</species>
<species species_name="C13" species_number="s6075">
<smiles>CCCCCCCCCCCCCCCCCCCCCCCCCC</smiles>
</species>
<species species_name="C14" species_number="s6076">
<smiles>CCCCCCCCCCCCCCCCCCCCCCCCCCCC</smiles>
</species>
<species species_name="CH3OH" species_number="s1">
<smiles>OC</smiles>
Expand Down Expand Up @@ -1570,7 +1660,9 @@
<species species_name="HYETHO2H" species_number="s520">
<smiles>OCCOO</smiles>
</species>
<species species_name="NO" species_number="s521"></species>
<species species_name="NO" species_number="s521">
<smiles>[N]=O</smiles>
</species>
<species species_name="ETHOHNO3" species_number="s522">
<smiles>OCCON(=O)=O</smiles>
</species>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
<smiles>[O]</smiles>
</species>
<species species_name="O2" species_number="s6062">
<smiles>OO</smiles>
<smiles>O=O</smiles>
</species>
<species species_name="C1" species_number="s6063">
<smiles>CC</smiles>
Expand Down Expand Up @@ -1660,7 +1660,9 @@
<species species_name="HYETHO2H" species_number="s520">
<smiles>OCCOO</smiles>
</species>
<species species_name="NO" species_number="s521"></species>
<species species_name="NO" species_number="s521">
<smiles>[N]=O</smiles>
</species>
<species species_name="ETHOHNO3" species_number="s522">
<smiles>OCCON(=O)=O</smiles>
</species>
Expand Down
Loading

0 comments on commit 04b0bdb

Please sign in to comment.