AtChem / AtChem2

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

Error in JFAC #480

Open morshedahmed17 opened 2 years ago

morshedahmed17 commented 2 years ago

I set the JFAC to 'CONSTRAINED' and used 'J4' in photolysisConstrained.config and a corresponding fi le with the constraint data present in the model/constraints/photolysis/

However, I am getting the following error.

image

rs028 commented 2 years ago

If you have a file called J4 in constraints/photolysis/ (and you have "J4" in the photolysisConstrained.config file) that means you are constraining the photolysis rate J4, but that as no effect on JFAC (**).

If JFAC is constrained, you need a file called JFAC in constraints/photolysis/

(**) the only exception is when J4 is used to calculate JFAC, but that is not your case because you are setting JFAC to CONSTRAINED`.

morshedahmed17 commented 2 years ago

Thanks for your reply. Now, I want to calculate the JFAC. I edited the environmentVariables.config fi le and set JFAC to J4 and J4 is constrained in photolysisConstrained.config and the corresponding constraint file is present in the model/constraints/photolysis/ directory. However, the run stops after a certain time. Please see attached images and the J4 file.

image

image J4.txt

rs028 commented 2 years ago

This is most likely the bug same described in #16. Calculation of JFAC from a measured photolysis rate is difficult for a number of reasons and often causes the model to crash. I would recommend to calculate JFAC offline, create the JFAC file in constraints/photolysis and set JFAC to CONSTRAINED instead of CALC. It's not ideal but until this bug is resolved it is the easiest workaround.