Tor Nordam

Results 12 comments of Tor Nordam

I think @ChrisBarker-NOAA is right, it probably doesn't matter when the timestep is small enough. From the central limit theorem, we know that the sum of $N$ random numbers (with...

If it says ```np.sqrt(2*D/dt)*np.random.normal(scale=1, size=N)```, then I would guess this gets multiplied by ```dt``` later on, so that it works out to ```np.sqrt(2*D*dt)*np.random.normal(scale=1, size=N)```, which is exactly the same as...

Regarding the point about what is faster: In terms of computer time to generate the random numbers, I ran this test in a jupyter notebook, and it seems that the...

To me, all those variance plots look perfectly reasonable, and within expected variation. If you increase the particle number, the lines will be a better match for the theoretical expression....

Just a few points to clarify: * You can set a seed also with the old-fashioned random generators in numpy. If you just call `np.random.seed(42)` at the start of a...

Many thanks, very helpful example, this solved the first problem perfectly. But the second issue is still there: The particles do not move.

After discussion with a colleague, we ended up with this solution: ``` import xarray as xr from dask.diagnostics import ProgressBar with xr.open_mfdataset('proc/*.nc', chunks=dict(index=1)) as d, ProgressBar(): d.load() ``` This works...

See sections 2.4, 3.2.1, and 4.2 in this paper, for further discussion of this type of boundary treatment: https://gmd.copernicus.org/articles/16/5339/2023/

On further searching, it looks to me like ```interact_with_seafloor``` is called twice in each step, after rising/sinking, and after diffusion: * Line 427 of oceandrift.py: https://github.com/OpenDrift/opendrift/blob/5bea84bf31264b4fc08d2744dfd94ff51f9fc025/opendrift/models/oceandrift.py#L427 * Line 637 of...

And on an even closer look, I see that ```interact_with_seafloor``` is also called twice in the main loop in ```basemodel/__init__.py```. This makes it a bit tricky to get the desired...