Skip to content

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

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.

3 participants