AtChem / AtChem2

Atmospheric chemistry box-model for the MCM
MIT License
59 stars 22 forks source link

Error in constrained species #485

Closed tanzinaakther closed 1 year ago

tanzinaakther commented 1 year ago

I am trying to run the model, but it says "constrained species" is not a species in the problem. I have this specific species in the constrained file. Even if I delete that specific species, it gives the same error by saying about another species. image

rs028 commented 1 year ago

Can you check that:

  1. C2H2 is listed in speciesConstrained.config
  2. A file named C2H2 with the constrained data is present in constraints/species
  3. C2H2 is a variable in the mechanism.fac file
tanzinaakther commented 1 year ago

Thank you so much for the reply. C2H2 was not present in the mechanism.fac file but when I run it again, now it runs without any issue although I didnt add C2H2 in the mechanism file

rs028 commented 1 year ago

Not sure why that is the case, but I suggest you add C2H2 to your mechanism file. Otherwise the results won't make any sense :)

tanzinaakther commented 1 year ago

Hi, I am getting this error again. This time, when I use TOLUENE, 124TMB and TBUT2ENE, It says these are not species in the problem. But when I removed this three, the model runs. I checked that these three species are present in mechanism file, constrained species. config and constraint/species

rs028 commented 1 year ago

HI @tanzinaakther what do you mean "when I removed this three"?

tanzinaakther commented 1 year ago

I mean by deleting TOLUENE, 124TMB and TBUT2ENE, I do not get this error and the model runs

rs028 commented 1 year ago

Deleting from the speciesConstrained.config file?

tanzinaakther commented 1 year ago

yes

rs028 commented 1 year ago

If you remove them from the file, the model will not try to constrain them and so it will not complain that they are not part of the problem. That makes sense, but I don't understand why it fails if they are present in the chemical mechanism. Are these species also present in mechanism.f90?

tanzinaakther commented 1 year ago

Hi, I see these species are not present in mechanism. f90 and mechanism.species. When I download mechanism file, and run it, should all species go into mechanism. f90 and mechanism.species? If not how can I add them in mechanism. f90 and mechanism.species?

rs028 commented 1 year ago

This is odd. The mechanism.f90 file should be automatically generated when you run the build script. Did you get any error at compilation time?

tanzinaakther commented 1 year ago

Let me get back to soon. I will try and inform you

tanzinaakther commented 1 year ago

Hi, I tried but faced the same problem. Please see attached.

build run run model
spco commented 1 year ago

Notice the AssertionError in the first screenshot. This shows that the ./build/build_atchem2.sh script has not completed successfully.

From the error, it looks as though you have either zero or >1 lines in mechanism.fac which contain the phrase Generic Rate Coefficients, which is causing an error. Can you please check this? If that seems fine, then the best bet at this point is to share your mechanism.fac here please so we can assist further.

tanzinaakther commented 1 year ago

Hi, I checked and see that the newly downloaded mecanism.fac file has nothing like Generic Rate Coefficients. So, I copied this part from another mechanism.fac file and pasted it in my new mechanism.fac file. Also there were some breakage in the reactions line. One of the products created a 2nd line. So, I deleted them and made them in one line.

Now, everything is good. the model runs... Thank you. But my concern is why Generic rate constants were absent in newly downloaded mechanism file?

rs028 commented 1 year ago

You probably forgot to check the option on the MCM extract page. Have a look at section 3.3.1 of the manual. Glad this is sorted.

tanzinaakther commented 1 year ago

It may be possible. Thanks a lot to all of you