wacl-york / mcm-web

Code for the MCM web application
1 stars 2 forks source link

Feature/kpp export species formula #264

Closed stulacy closed 8 months ago

stulacy commented 8 months ago

Addresses #257 by replacing the IGNORE species definition in the KPP export by its composition where known from the Inchi.

stulacy commented 8 months ago

I've implemented this feature which produces this .eqn file for the usual Isoprene test mechanism. Does that look as expected @RolfSander ?

RolfSander commented 8 months ago

Thanks for implementing this! The isoprene file looks good. I have a few minor comments:

stulacy commented 8 months ago

The export seems to handle 2-character names OK, here's 'VINCL' from a full mechanism:

CH2OHCCLO2 = 2C + 4H + Cl + 3O ;
VINCL = 2C + 3H + Cl ;
CH2OHCCLO = 2C + 4H + Cl + 2O ;

Did files have a trailing new line previously? From the code I can't see how they ever did. I can add this in no problem however.

I'll check with a colleague about why Inchis aren't available for inorganic species, I'm sure there was a reason...

Yes, the archives will always be kept updated with a copy of the full mechanism in each format we support.

RolfSander commented 8 months ago

The export seems to handle 2-character names OK, here's 'VINCL' from a full mechanism:

CH2OHCCLO2 = 2C + 4H + Cl + 3O ; VINCL = 2C + 3H + Cl ; CH2OHCCLO = 2C + 4H + Cl + 2O ;

Thanks for checking, that's reassuring.

Did files have a trailing new line previously? From the code I can't see how they ever did. I can add this in no problem however.

It's possible that it has always been missing, I don't know. When I was using files generated by the old MCM web page, I always applied some postprocessing which added the newline for me. I never checked this until now.

I'll check with a colleague about why Inchis aren't available for inorganic species, I'm sure there was a reason...

OK, thanks.

Yes, the archives will always be kept updated with a copy of the full mechanism in each format we support.

Great :-)

stulacy commented 8 months ago

I've added the inchis (and thus formulae) for the inorganic species that were previously missing, as well as a terminating new-line. Here is the latest isoprene mechanism

The only species without formulae now are the NA and SA placeholders, as defined here

If that all looks good to you @RolfSander I can push it live next week.

stulacy commented 8 months ago

2H + O, not H + 2O

D'oh! It's Friday afternoon and I'm quite unwell. Will correct shortly.

RolfSander commented 8 months ago

I've added the inchis (and thus formulae) for the inorganic species that were previously missing, as well as a terminating new-line.

Thanks very much!

The only species without formulae now are the NA and SA placeholders, as defined here

That's fine. As they refer to the condensed phase, they are different anyway.

One more little bug:

HSO3 = 2H + 3O + S

There should be only 1 H.

It's Friday afternoon

Have a nice weekend!

stulacy commented 8 months ago

Ah I'll need to run the HSO3 issue by a colleague as I was provided the species information by them. We can catch up next week :)

stulacy commented 8 months ago

Hi @RolfSander , I've identified the correct compound with my colleague and have updated the database accordingly (https://github.com/wacl-york/mcm-db/pull/8). Here's the latest isoprene mechanism, does it look ready for release now?

RolfSander commented 8 months ago

Yes, perfect!