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

Bug in dydt for cv_avg #43

Open
mgoodson-cvd opened this issue Feb 7, 2022 · 3 comments
Open

Bug in dydt for cv_avg #43

mgoodson-cvd opened this issue Feb 7, 2022 · 3 comments

Comments

@mgoodson-cvd
Copy link

mgoodson-cvd commented Feb 7, 2022

Just a warning to anyone still using this: there is a bug in dydt.c in the function computing cv_avg, here.

line += '(' + utils.get_array(lang, 'cv', len(specs) - 1) + ' * y_N)'

There needs to be a "+" sign prior to opening the next parentheses, otherwise you end up with code that looks like this:

  double cv_avg = (cv[0] * y[1]) + (cv[1] * y[2]) + (cv[2] * y[3]) + (cv[3] * y[4])(cv[4] * y_N);
@skyreflectedinmirrors
Copy link
Collaborator

Heh, you can see we fixed it for conp here:

if not isfirst: line += ' + '

@skyreflectedinmirrors
Copy link
Collaborator

I think this should do it? #44

I haven't run this in awhile, so if you test it and it looks good, let me know and I'll merge it in.

@mgoodson-cvd
Copy link
Author

@arghdos Yes, that fixed it! Thanks for the quick response.

Once I fixed that, the compiler found another bug here:

'rho, &' + (utils.get_array(lang, 'y', 1) if lang != 'cuda'

There should be a comma before the rho so that the call the eval_conc_rho is correct. After I made that change manually, it compiled!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants