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

Code cleanups #1614

Merged
merged 9 commits into from
Jul 29, 2024
Merged

Code cleanups #1614

merged 9 commits into from
Jul 29, 2024

Conversation

erikvansebille
Copy link
Member

This PR combines some code cleanups and minor bug fixes that I stumbled upon while developing #1612

Copy link
Contributor

@VeckoTheGecko VeckoTheGecko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. I don't have any suggested changes. The C code change in codegenerator file is a bit of a mystery to me at the moment, feel free to go ahead if you're confident.

Also, what is the role of the SampleP kernel? Something to to with triggering an update? If the tmp variable name itself isn't important (but the assignment is), could we use _ as a varname instead in line with python convention?

@VeckoTheGecko
Copy link
Contributor

@erikvansebille do you know the role of the assignment in tmp = fieldset.P[particle]?

@erikvansebille
Copy link
Member Author

Yep, it's to trigger the sampling of the P-field, and therefore the assignment of particle.xi on the second (P) grid. Before that, these particle.xi are zero (not sampled yet). See these asserts
https://github.com/OceanParcels/parcels/blob/a8cb61fa8ddc6ae5002538912e757d18a29fc7c4/tests/test_particlefile.py#L322-L323

@erikvansebille erikvansebille merged commit 4f55da7 into master Jul 29, 2024
10 checks passed
@erikvansebille erikvansebille deleted the code_cleanups branch July 29, 2024 07:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants