simonom / PyCHAM

PyCHAM: CHemistry with Aerosol Microphysics in Python box model for Windows, Linux and Mac
GNU General Public License v3.0
49 stars 16 forks source link

Equations missing #15

Closed SojaMarchant closed 3 years ago

SojaMarchant commented 3 years ago

Dear Siomnom,

I am learning how to use PyCHAM. Since installed PyCHAM by Conda, I tried to run a simple model. However, I met always the problem of "Could not find...." (you can see the capture in the attach). Reinstallation didn't fix it. Would you give me a hand on this?

image

Best regards,

simonom commented 3 years ago

Hi there,

Thanks for getting in touch. Could you let me know whether you used the conda or pip install? Also, what operating system are you using?

Regards, Simon O'Meara

National Centre for Atmospheric Science Postdoctoral Research Associate Energy & Sustainability Theme Leader for the Manchester Modelling Network


From: Junteng notifications@github.com Sent: 28 September 2020 08:36 To: simonom/PyCHAM PyCHAM@noreply.github.com Cc: Subscribed subscribed@noreply.github.com Subject: [simonom/PyCHAM] Equations missing (#15)

Dear Siomnom,

I am learning how to use PyCHAM. Since installed PyCHAM by Conda, I tried to run a simple model. However, I met always the problem of "Could not find...." (you can see the capture in the attach). Reinstallation didn't fix it. Would you give me a hand on this?

[image]https://user-images.githubusercontent.com/42148664/94403603-f21d4680-016d-11eb-8fcc-e878cc778c9f.png

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/simonom/PyCHAM/issues/15, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AGKWZ2DHYPKHTTCWWXPKM5DSIA4HDANCNFSM4R4FEJZA.

SojaMarchant commented 3 years ago

Hi Simonom,

Thanks so much for your reply!

I am using Windows 64 to run the program. The installation has been done with the Anaconda procedure.

At the first moment, I ran the example that you gave in the input file. It did work for me unless the missing functions (radau5, dopri5, rodas and odass1) that I have shown to you. But anyway, It ran and gave the results.

Then, I tried to run another system: Soot(p) + SO2(g) + O3(g) + H2O(g) in a diluted simulation chamber in dark condition. It always mentions that equations are missing (radau5, dopri5, rodas and odass1). Furthermore, the program can't run. I am curious if the chem scheme txt, xml and inputs are not in the good forme. I put it in the attached file. If possible, could you please have a look on them?

PS: I prepared chem scheme txt and xml from MCM extraction. However, there was no smiles information in xml. I added smiles information after. What is the proper way to prepare them?

All the best,

Junteng [image: image.png]

On Tue, Oct 6, 2020 at 7:22 PM simonom notifications@github.com wrote:

Hi there,

Thanks for getting in touch. Could you let me know whether you used the conda or pip install? Also, what operating system are you using?

Regards, Simon O'Meara

National Centre for Atmospheric Science Postdoctoral Research Associate Energy & Sustainability Theme Leader for the Manchester Modelling Network


From: Junteng notifications@github.com Sent: 28 September 2020 08:36 To: simonom/PyCHAM PyCHAM@noreply.github.com Cc: Subscribed subscribed@noreply.github.com Subject: [simonom/PyCHAM] Equations missing (#15)

Dear Siomnom,

I am learning how to use PyCHAM. Since installed PyCHAM by Conda, I tried to run a simple model. However, I met always the problem of "Could not find...." (you can see the capture in the attach). Reinstallation didn't fix it. Would you give me a hand on this?

[image]< https://user-images.githubusercontent.com/42148664/94403603-f21d4680-016d-11eb-8fcc-e878cc778c9f.png

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub< https://github.com/simonom/PyCHAM/issues/15>, or unsubscribe< https://github.com/notifications/unsubscribe-auth/AGKWZ2DHYPKHTTCWWXPKM5DSIA4HDANCNFSM4R4FEJZA

.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/simonom/PyCHAM/issues/15#issuecomment-704427841, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKBSGOHX4ANFST45N72EBMLSJNG4NANCNFSM4R4FEJZA .

SojaMarchant commented 3 years ago

On Wed, Oct 7, 2020 at 1:45 PM Junteng Wu juntengwu@gmail.com wrote:

Hi Simonom,

Thanks so much for your reply!

I am using Windows 64 to run the program. The installation has been done with the Anaconda procedure.

At the first moment, I ran the example that you gave in the input file. It did work for me unless the missing functions (radau5, dopri5, rodas and odass1) that I have shown to you. But anyway, It ran and gave the results.

Then, I tried to run another system: Soot(p) + SO2(g) + O3(g) + H2O(g) in a diluted simulation chamber in dark condition. It always mentions that equations are missing (radau5, dopri5, rodas and odass1). Furthermore, the program can't run. I am curious if the chem scheme txt, xml and inputs are not in the good forme. I put it in the attached file. If possible, could you please have a look on them?

PS: I prepared chem scheme txt and xml from MCM extraction. However, there was no smiles information in xml. I added smiles information after. What is the proper way to prepare them?

All the best,

Junteng [image: image.png]

On Tue, Oct 6, 2020 at 7:22 PM simonom notifications@github.com wrote:

Hi there,

Thanks for getting in touch. Could you let me know whether you used the conda or pip install? Also, what operating system are you using?

Regards, Simon O'Meara

National Centre for Atmospheric Science Postdoctoral Research Associate Energy & Sustainability Theme Leader for the Manchester Modelling Network


From: Junteng notifications@github.com Sent: 28 September 2020 08:36 To: simonom/PyCHAM PyCHAM@noreply.github.com Cc: Subscribed subscribed@noreply.github.com Subject: [simonom/PyCHAM] Equations missing (#15)

Dear Siomnom,

I am learning how to use PyCHAM. Since installed PyCHAM by Conda, I tried to run a simple model. However, I met always the problem of "Could not find...." (you can see the capture in the attach). Reinstallation didn't fix it. Would you give me a hand on this?

[image]< https://user-images.githubusercontent.com/42148664/94403603-f21d4680-016d-11eb-8fcc-e878cc778c9f.png

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub< https://github.com/simonom/PyCHAM/issues/15>, or unsubscribe< https://github.com/notifications/unsubscribe-auth/AGKWZ2DHYPKHTTCWWXPKM5DSIA4HDANCNFSM4R4FEJZA

.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/simonom/PyCHAM/issues/15#issuecomment-704427841, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKBSGOHX4ANFST45N72EBMLSJNG4NANCNFSM4R4FEJZA .

res_file_name = Example_Run_output_JW1 total_model_time = 21600.0 update_step = 60.0 recording_time_step = 60.0 number_size_bins = 107 lower_part_size = 1.95e-2 upper_part_size = 8.82e-1 space_mode = lin mass_trans_coeff = 0 eff_abs_wall_massC = 0 temperature = 294.15 tempt = 0.0 p_init = 100000 rh = 0.2 lat =0 lon =0 DayOfYear = daytime_start = act_flux_file = photo_par_file = ChamSA = 17.96 coag_on = 1 nucv1 = 0 nucv2 = -55.0 nucv3 = 180 nuc_comp = H2SO4 new_partr = inflectDp = 2.0e-7 Grad_pre_inflect = 1.85 Grad_post_inflect = 2 Rate_at_inflect = 1e-5 part_charge_num = 0 elec_field = 0 McMurry_flag = 1 C0 = 0, 0 Comp0 = O3, SO2 injectt = 1800,3600 Compt = O3, SO2 Ct = 200,0;0,100 const_comp = const_infl = const_infl_t = Cinfl = vol_Comp = SA volP = 3.33e-3 act_comp = act_user = accom_coeff_comp =1 accom_coeff_user = 1 pconct = 100 pconc = 2765 seed_name = AS seed_mw = 132.15 seed_dens = 1.77 mean_rad = 0.268 std = 1.69 core_diss = light_time = light_stat = 0 tracked_comp = SA, SO2, O3 umansysprop_update = 0 chem_scheme_markers = %, RO2, +, , , ;, +, ;, , %, :,; int_tol = dil_fac =2.82e-5 ***** ;

simonom commented 3 years ago

Hi Junteng,,

Sorry it's taken a while to respond. I'm looking into your issue today, but think that as you suggest it is related to the inputs you mention.

kind regards, Simon

simonom commented 3 years ago

Hiya,

Your inputs have thrown up some useful bugs, which I think I have now fixed.

There were several issues with your inputs that I highlight below (and which have prompted changes in the README file too, so thanks for motivating these too). Attached (at the bottom of this comment) are the revised input files.

The updated PyCHAM is now available on Github under branch v2.0.0.

To accommodate your inputs the following actions were taken:

added O2 to the xml file, with SMILE string O=O

checked the chem_scheme_markers in your model variables file against your chemical scheme using the instructions in README - looks fine

then I get the following error:

Traceback (most recent call last): File "PyCHAM/PyCHAM.py", line 469, in on_click4 middle.middle() File "PyCHAM/middle.py", line 58, in middle seed_mw, core_diss, nuc_comp) File "PyCHAM/init_conc.py", line 171, in init_conc corei[indx] = spec_namelist.index(seedi) ValueError: 'AS' is not in list Aborted (core dumped)

which is telling us that the component with chemical scheme name AS (ammonium sulphate) has not been seen in the chemical scheme

ammonium sulphate is included in the xml file under AMM_SUL, so changed seed_name in the model variable file from AS to AMM_SUL

added the following line to the chemical scheme: % 0 : AMM_SUL = AMM_SUL ;

got the error: Traceback (most recent call last): File "PyCHAM/PyCHAM.py", line 469, in on_click4 middle.middle() File "PyCHAM/middle.py", line 77, in middle accom_coeff_user, comp_namelist, num_sb, num_sb, Pnow) File "PyCHAM/partit_var_prep.py", line 68, in prep ac_indx.append(spec_namelist.index(acc_comp[i].strip())) ValueError: '1' is not in list Aborted (core dumped)

which is telling us that the component name given in the accom_coeff_comp model variable in the model variables file is not recognised. This model variable needs a chemical scheme name, however you have supplied an accommodation coefficient of 1 in the accom_coeff_user variable of the model variables file. 1 is the default accommodation coefficient anyway, so I removed these two lines from the model variables file.

see this error:

Traceback (most recent call last): File "PyCHAM/PyCHAM.py", line 469, in on_click4 middle.middle() File "PyCHAM/middle.py", line 86, in middle comp_namelist, act_coeff, wall_on, partit_cutoff, Pnow, coll_dia) File "PyCHAM/pp_intro.py", line 79, in pp_intro nuc_compi = spec_namelist.index(nuc_comp[0]) ValueError: 'H2SO4' is not in list Aborted (core dumped)

which tells us that H2SO4 is not recognised from the chemical scheme. I presume this is meant to be sulphuric acid, so changed nuc_comp = H2SO4 in the model variables file to nuc_comp = SA, since SA the chemical scheme name for sulphuric acid (already used in your chemical scheme)

see error:

Traceback (most recent call last): File "PyCHAM/PyCHAM.py", line 469, in on_click4 middle.middle() File "PyCHAM/middle.py", line 117, in middle partit_cutoff, coll_dia) File "PyCHAM/ode_updater.py", line 241, in ode_updater infx_cnt, con_infl_C, MV, partit_cutoff, coll_dia) File "PyCHAM/rec_prep.py", line 195, in rec_prep photo_path, Jlen, tf) File "PyCHAM/rrc_calc.py", line 50, in rrc_calc O2_val, photo_par_file, Jlen, tf) File "PyCHAM/rate_coeffs.py", line 36, in evaluate_rates rate_values[3] = KMT01 NameError: name 'KMT01' is not defined Aborted (core dumped)

which means the generic rate coefficients (such as KMT01) are not included in the chemical scheme, so I added the generic rate coefficients from the MCM scheme for isoprene - have assumed these coefficients are the same as for the scheme you use, but please check this.

The final error I saw was that the ODE solver failed. This was because ammonium sulphate was trying to evaporate from the seed particles, giving unrealistic values for particle-phase concentrations. To prevent this I set the vapour pressure of ammonium sulphate very low in the model variables file.

Finally, I noticed that your number of size bins was 107. I don't think this will cause an error, but it will take some time for the model to complete. Using 2 size bins instead took 96s on my computer, and produced the attached plot from the 'Plot Results' button of the GUI. Jun_chem.txt Jun_mod_var.txt

Example_Run_output_JW1_output_plot