Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors reading *.eqn file in version 3.0 #78

Closed
jnavarla opened this issue Jun 12, 2023 · 25 comments
Closed

Errors reading *.eqn file in version 3.0 #78

jnavarla opened this issue Jun 12, 2023 · 25 comments
Assignees
Labels
bug Something isn't working mechanisms Related to chemical mechanisms

Comments

@jnavarla
Copy link

Hi all,
I'm using KPP to develop an Ultrasound driven chemical reaction and I generated the model in KPP v2.2.
I have updated to KPP v3.0, but I have errors reading the *.eqn file looking for a 'none.def' file which is no defined.
I have reviewed all the files, but I cannot seek any difference when I process the files with v2.2.
Is there any care/suggestion for the eqn files in the new KPP version?
I attach a copy of *.eqn file
aquMTv2.eqn.txt

Thanks in advance for any suggestion.

Javier

@jnavarla jnavarla added the question Further information is requested label Jun 12, 2023
@yantosca
Copy link
Contributor

@jnavarla, thanks for writing. Can you also post any other files like *.kpp and *.spc? I will try to replicate the issue.

@yantosca yantosca self-assigned this Jun 12, 2023
@yantosca yantosca added bug Something isn't working and removed question Further information is requested labels Jun 12, 2023
@RolfSander
Copy link
Contributor

none.def used to be an empty dummy file. Do you have something like

#INTEGRATOR none

in your code?

@jnavarla
Copy link
Author

@jnavarla, thanks for writing. Can you also post any other files like *.kpp and *.spc? I will try to replicate the issue.

Thanks. Yes, here you have the kpp and spc files
aquMTv2.kpp.txt
aquMTv2.spc.txt

@jnavarla
Copy link
Author

@jnavarla, thanks for writing. Can you also post any other files like *.kpp and *.spc? I will try to replicate the issue.

Thanks. Yes, here you have the kpp and spc files aquMTv2.kpp.txt aquMTv2.spc.txt

none.def used to be an empty dummy file. Do you have something like

#INTEGRATOR none

in your code?

Hello Rolf,
Yes, I have this line in *.kpp file. Should I remove it?
Regards,
Javier

@RolfSander
Copy link
Contributor

Yes, it should be removed.

However, I wonder which integrator are you using, and where have you defined it?

@yantosca
Copy link
Contributor

yantosca commented Jun 12, 2023

I was able to get KPP to work with:

#INTEGRATOR     rosenbrock
#LANGUAGE	C
#DRIVER		general
#JACOBIAN	SPARSE_LU_ROW
#HESSIAN	on
#STOICMAT	on
#FUNCTION	AGGREGATE
#DOUBLE	        ON

#include aquMTv2.spc
#include aquMTv2.eqn

I believe that when you specify the #MODEL keyword, KPP looks for a *.def file, as described in the documentation.

@yantosca
Copy link
Contributor

yantosca commented Jun 12, 2023

I was able to get KPP to work with:

#INTEGRATOR     rosenbrock
#LANGUAGE	C
#DRIVER		general
#JACOBIAN	SPARSE_LU_ROW
#HESSIAN	on
#STOICMAT	on
#FUNCTION	AGGREGATE
#DOUBLE	        ON

#include aqu.spc
#include aqu.eqn

I believe that when you specify the #MODEL keyword, KPP looks for a *.def file, as described in the documentation.

@RolfSander
Copy link
Contributor

@yantosca: Maybe we should mention this in the box of our documentation at:
https://kpp.readthedocs.io/en/stable/getting_started/00_revision_history.html#kpp-3-0-0

Something like:

The dummy integrator "none" does not exist anymore. Thus, commands like

#INTEGRATOR none

should be removed.

Copy link
Contributor

@RolfSander, I'll work on that. Thanks!

@RolfSander
Copy link
Contributor

Thx, @yantosca !

@jnavarla
Copy link
Author

Yes, it should be removed.

However, I wonder which integrator are you using, and where have you defined it?

I'm using Rosenbrock.m defined in $KPP_HOME/int. Now, removing #INTEGRATOR none , KPP works with my *.eqn files and generates the matlab code, but it gives errors when running. Maybe some call is written in a different way in version 3.0 and gives the error in matlab; I'm running R2021a. I will check the generated matlab code to look at.
Thank you very much for your help @RolfSander
Javier

@jnavarla
Copy link
Author

I was able to get KPP to work with:

#INTEGRATOR     rosenbrock
#LANGUAGE	C
#DRIVER		general
#JACOBIAN	SPARSE_LU_ROW
#HESSIAN	on
#STOICMAT	on
#FUNCTION	AGGREGATE
#DOUBLE	        ON

#include aqu.spc
#include aqu.eqn

I believe that when you specify the #MODEL keyword, KPP looks for a *.def file, as described in the documentation.

Thank you @yantosca for your reply. Yes, I'm using a *.def file (attached here), but the problem was on #INTEGRATOR command as @RolfSander suggested.
The C or Fortran compilation always is possible but I would like to compile in Matlab just to use the graphical interface.
This is my *.def file.
aquMTv2.def.txt

The matlab code gererated with kpp v2.2.3 works without problems, but the code generated with kpp v3.0.1 doens't.
I will check where is the difference on the generated codes.
Thank you, again
Javier

@RolfSander
Copy link
Contributor

Sorry but I'm still trying to understand your code...

You say that you are using Rosenbrock.m. This means that somewhere you
must have these statements:

#INTEGRATOR rosenbrock
#LANGUAGE	matlab

However, I cannot find these lines anywhere in the code that you have
provided. Is there another KPP file that you are using?

@jnavarla
Copy link
Author

Sorry but I'm still trying to understand your code...

You say that you are using Rosenbrock.m. This means that somewhere you must have these statements:

#INTEGRATOR rosenbrock
#LANGUAGE	matlab

However, I cannot find these lines anywhere in the code that you have provided. Is there another KPP file that you are using?

Sorry @RolfSander and @yantosca . I realized that I send you a wrong *.kpp file. I'm sorry to waste your time.
Here you have the kpp file I'm using.
aquMTv2.kpp.txt

Instead #INTEGRATOR rosenbrock, I'm using a #DRIVER rosendrv,
with the driver:

rosendrv.m.txt

With these files I can have a matlab code but I have execution errors related to Aout
"Output argument "Aout" (and maybe others) not assigned during call to "aquMTv2_Fun".

I read something about this problem in another matlab thread here and I will check that later.
Thank you very much for your help.
Javier

Copy link
Contributor

Thanks @jnavarla. In KPP 3.0.0 we added Aout as an argument so as to get the reaction rates out for diagnostics (if so desired). Also @RolfSander and I have mostly worked with the F90 and C interfaces but not with matlab, so there may still be a few issues. We had @jenniethompson and her group help us out with the matlab version for 3.0.0.

@RolfSander
Copy link
Contributor

Thanks @jnavarla, now I understand how you create the matlab code.

It is possible that this is a matlab-specific problem related to Aout. There is already another issue here (#56) in which we discuss the problem. I thought that we had already solved it, but maybe there is still some bug.

@jnavarla
Copy link
Author

Thanks @jnavarla, now I understand how you create the matlab code.

It is possible that this is a matlab-specific problem related to Aout. There is already another issue here (#56) in which we discuss the problem. I thought that we had already solved it, but maybe there is still some bug.

Thanks @RolfSander . Yes, the problem in *_Fun.m generation still persist in kpp v3.0.1. As it is explained in #56 the arguments in the function call are wrong.
But, using the *_Fun.m subroutine generated by kpp v2.2.3, the matlab code works.
Best regards,

@RolfSander
Copy link
Contributor

Does it work if you copy the matlab files from the old KPP version into KPP-3.0.0?

As @yantosca already mentioned, we are not actively using matlab. However, if you let us know what works for you, we can update the matlab files accordingly for the next KPP release...

@jnavarla
Copy link
Author

Does it work if you copy the matlab files from the old KPP version into KPP-3.0.0?

As @yantosca already mentioned, we are not actively using matlab. However, if you let us know what works for you, we can update the matlab files accordingly for the next KPP release...

Yes, if you copy the ROOT_Fun.m matlab file generated from a previous version ok kpp, for instance in my case v2.2.3, changing the file generated by v3.0.1, the matlab code works properly without execution errors. I've tested this with my model, but the small_strato.* either. This model is small and it is easy to check the rate equations by hand. Both functions generate the same individual reaction rate terms and the time derivative of the state variables of the system (Vdot),
Regards,

@RolfSander
Copy link
Contributor

Great to see that it works for you if you use ROOT_Fun.m from v2.2.3. Still, it would be nice to solve this problem in a better way. Could you post the diff between both ROOT_Fun.m files? That should give us a hint...

@yantosca
Copy link
Contributor

@jimmielin had posted this issue #56 about issues with Fun in matlab. Not sure if this is why the behavior was changed in KPP 3.0.0.

@jnavarla
Copy link
Author

@jimmielin had posted this issue #56 about issues with Fun in matlab. Not sure if this is why the behavior was changed in KPP 3.0.0.
Hello Bob,
Yes, this is the same issue as @RolfSander suggested me.

@yantosca yantosca added the mechanisms Related to chemical mechanisms label Dec 4, 2023
@yantosca
Copy link
Contributor

@RolfSander @jnavarla @jimmielin: Wondering if we can close out this issue. I believe #99 may have addressed this.

@RolfSander
Copy link
Contributor

@yantosca: Thx for taking care of those old issues. Yes, I think we can close this one.

@yantosca
Copy link
Contributor

Closing this issue. Thanks @RolfSander

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working mechanisms Related to chemical mechanisms
Projects
None yet
Development

No branches or pull requests

3 participants