KineticPreProcessor / KPP

The KPP kinetic preprocessor is a software tool that assists the computer simulation of chemical kinetic systems
GNU General Public License v3.0
19 stars 11 forks source link

[ISSUE] Segmentation fault (core dumped) #94

Closed liuylong5 closed 6 months ago

liuylong5 commented 7 months ago

Report a bug or issue with KPP:

Hi, I use saprc07 mechanism generated by CMAQ/chemmech(230 species and 929rxns), an error named Segmentation fault (core dumped) occurs, however, i run example mechanism kpp file successfully. It is confusing to see a long string of *, and i wonder why Segmentation fault (core dumped) occured since i already type $ ulimit -s unlimited in my Linux bash and using the latest version of KPP.

This is KPP-3.1.0.

KPP is parsing the equation file.********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************
KPP is computing Jacobian sparsity structure.
KPP is starting the code generation.
KPP is initializing the code generation.
KPP is generating the monitor data:
Segmentation fault (core dumped)
RolfSander commented 6 months ago

I suspect that there is a problem with your input files. Do you have something like "****" there that is not commented out?

liuylong5 commented 6 months ago

I suspect that there is a problem with your input files. Do you have something like "****" there that is not commented out? Thank you for pointing that out. I've re-examined the .spe and .eqn files generated by CHEMMECH in CMAQ, and the .def files I've provided to KPP. I can confirm that there are no lines with a sequence of asterisks like "****". I add .log extensions to these mechanism-defined file. saprc07tic_ae7i_aq.eqn.log saprc07tic_ae7i_aq.def.log saprc07tic_ae7i_aq.spc.log

RolfSander commented 6 months ago

The 3 files look fine, I cannot see any obvious problems. Can you also post the *.kpp file that you have used as a command line argument when you started kpp?

liuylong5 commented 6 months ago

MODEL saprc07tic_ae7i_aq

LANGUAGE Fortran90

INTEGRATOR rosenbrock

DRIVER general

this is the content in saprc07tic_ae7i_aq.kpp. After I put the 3 file in KPP/models, I run it by typing $ kpp saprc07tic_ae7i_aq.kpp in comand line. A serial of saprc07tic_ae7i_aq*.f90 scripts are generated, and this is the log file saprc07tic_ae7i_aq.log

RolfSander commented 6 months ago

It took me a while but finally I realized what's wrong. There were two unrelated problems in your files:

1) Stoichiometric factors are separated from the products by spaces, not asterisks. For example, eqn 9 should be

   <9> NO + NO3 = 2.00000 NO2 

and not

   <9> NO + NO3 = 2.00000*NO2

2) Some of your equations are too long. The current maximum is 300, see MAX_EQNLEN in gdata.h. You can increase this value (500 should be okay for you) and then recompile kpp.

RolfSander commented 6 months ago

Hello,

Does this solve your problem? If yes, I'd like to close this issue.

RolfSander commented 6 months ago

Since I've solved the problem, there has been no reaction from the OP anymore. I'm closing this issue now.