AtChem / AtChem2

Atmospheric chemistry box-model for the MCM
MIT License
58 stars 23 forks source link

Prod/Loss rate plotting tools #426

Closed xcy12 closed 1 year ago

xcy12 commented 4 years ago

Hi, I wonder is there some plotting tool for total OH/HO2/RO2 production or loss rate?

rs028 commented 4 years ago

I am afraid not. But we are happy to accept contributions if you are writing one! :)

xcy12 commented 4 years ago

I am afraid not. But we are happy to accept contributions if you are writing one! :)

Thank you. I'm trying to plot HOx and ROx. I will share if I succeed. It may take time because I just started to write code.

spco commented 4 years ago

If it helps, you should be able to modify an existing script from https://github.com/AtChem/AtChem2/tree/master/tools/plot for your purposes. The data should of course be available in environmentVariables.output, so it should be a nice little script if you are willing to submit it 😄

rs028 commented 4 years ago

Those scripts already plot environmentVariables.output. I think that @xcy12 means productionRates.output and lossRates.output, which are a bit more complex to analyze. It would be great to have something to deal with that for sure :)

xcy12 commented 4 years ago

Those scripts already plot environmentVariables.output. I think that @xcy12 means productionRates.output and lossRates.output, which are a bit more complex to analyze. It would be great to have something to deal with that for sure :)

Yes, I mean production/loss Rate.output. It's not easy because of the huge number of reactions. Take RO2 as an example, the script first needs to recognize which one produces RO2, after then make a sum of the reaction rates for all the selected reactions. By the way, RO2 also has many kinds, which makes it harder to achieve. I will try and find some friends together to do this. Thanks a lot @spco @rs028

rs028 commented 4 years ago

It's probably easier if you start with an individual species like HO2 or CH3O2 before trying to do RO2.

AlfredMayhew commented 1 year ago

Hi, I have developed a set of tools to plot the productionRates.output and lossRates.output files produced by AtChem2. I've uploaded them to this repo. There is currently only one script there which plots the production and loss rates of a given set of species as stackplots, but I do also have scripts for kOH and kNO3 analysis which I plan to tidy up and share at some point. If there's any suggestions for how to make this more useful for others (I realise it's not the cleanest code) then let me know and I'll see what I have time for. I'm also happy for any part of this to be incorporated into the plotting tools in AtChem2 if that's helpful.

Cheers, Alfie

rs028 commented 1 year ago

@AlfredMayhew that's a great contribution, thanks! I will link the repo in the wiki for starters, then we can discuss how to (and if) you want to add this to the AtChem organization :).

UPDATE: now linked in https://github.com/AtChem/AtChem2/wiki/Tools-for-AtChem2-and-the-MCM