Closed claudiofgcardoso closed 5 years ago
Hi Cláudio, Thanks for your interest, your kind words and of course for pointing out and solving this issue! We'll fix it asap!
Cheers, Philippe
We've just checked the code. This problem has actually been fixed in PR #569. (It is that one you mean, right?) Maybe you were using conda's Parcels v2.0.0b2 and not the last master version? We'll release a newer version 2.0 very soon!
Hi Philippe,
Thank you for the replies! You are right, I'm using the V2.0.0b2 because of the issue reported in #547 .. I see that there is a new master version in conda forge a few hours ago, I will install it!
Cheers, Cláudio
Hello,
First of all, I have to thank you for developing this tool and making everything open source! I've been able to learn and fix most issues I encountered through GitHub issues and repositories linked to OceanParcels, and that has been very helpfull :)
I encountered a bug in the
lonlatdepth_dtype
parameter ofParticleSet
.My
Fieldset
is aSummedField
of ROMS ocean circulation and stokes drift. Sigma depths were already converted to actual depth (m), and horizontal coordinates are on a A-grid. The field is loaded with the following function:My simulation releases a group of 5 particles in different locations from 12 to 12 hours. Following your suggestion of setting the
ParticleSet
coordinates to double precision in order to prevent uncontrolled particle beaching due to numerical rounding errors, I setlonlatdepth_dtype = np.float64
:It did manage to create and save the coordinates of the first set of particles as
np.float64
, but the second set of particles released 12h later were saved asnp.float32
. This returns the following error:I believe this happens because the linear interpolation method in the Fieldset (
fieldset.U.interp_method = ‘linear')
sets the coordinates to np.float32 by default. In order to fix this, I addedlonlatdepth_dtype=self.lonlatdepth_dtype
to line 410 inparticleset.py
, and now it works perfectly!Cheers, Cláudio