CyprienBosserelle / xbeach_gpu

Lightweight version of XBeach that uses CUDA C to run on the GPU. The code is used to simulate coastal waves, currents, sediment transport and beach morphology changes during extreme events. Visit:
http://cyprienbosserelle.github.io/xbeach_gpu/
GNU General Public License v3.0
13 stars 1 forks source link

Wave height producing all 0's for small grid #30

Closed dgreer1 closed 3 years ago

dgreer1 commented 4 years ago

Using an example grid that has 420 x 840 cells, the model works fine (top image in attached pic). When using a reduced grid dimensions, the model output starts to produce all 0's for Hs. This happens once the dimensions fall below 420 x 262 (bottom image in attached pic.

xbeach_comparison

Example files attached.

XB.zip

CyprienBosserelle commented 3 years ago

Hi @dgreer1, I figured it out. Rather then a problem with XBGPU I think it is a problem with your md file generator (and mine ). My writemd() function had a round off error that makes it write a md file with (nx-1) by ny but the header still says nx-ny.

I tried to make a grid with nx =420 but my function only wrote 419 values making XBGPU incapable of reading the file correctly. this is because (floor(nx/11)11+(nx/11-floor(nx/11))11) = 419.9999999999 which is truncated to 419...

See my Julia function here. it should be easy to apply a similar fix on your function.