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

No error if bathymetry file not read #32

Closed davidbenncsiro closed 3 years ago

davidbenncsiro commented 3 years ago

If the bathymetry file is not read, the only indication in XBG_log.txt is that "Reading dep file" is missing.

For example, if the bathymetry file has a ".txt" file suffix, we see:

#################################
XBeach_GPU v0.0
#################################
model started at 20-09-2021 16:12:51
bathy: bathy-new.txt
bathy extension: txt
nx=624 ny=240 dx=10.000000 grdalpha=0.000000

whereas if the same file is given a ".dep" suffix, we have:

#################################
XBeach_GPU v0.0
#################################
model started at 28-09-2021 13:10:13
bathy: bathy-new.dep
bathy extension: dep
Reading dep file
For this type of bathy file please specify nx, ny, dx and grdalpha in the XBG_param.txt
nx=624 ny=240 dx=10.000000 grdalpha=0.000000

See https://github.com/CyprienBosserelle/xbeach_gpu/blob/master/Wave_gpu.cu#L1764

In the block of code pointed to above, either any file suffix could be assumed to be .dep or .bot or an error message could be output and the application could exit.

davidbenncsiro commented 3 years ago

@CyprienBosserelle this zip file contains:

The modified file has a .dep rather than .txt suffix.

bathy.zip

CyprienBosserelle commented 3 years ago

@davidbenncsiro, I fixed most of your problems on branch AddUEUmean 730f747. you can now call the bathy file *.txt as if it is a *.dep. Your crash was that the bathy was positive up whereas XBGPU takes positive down bathymetry. I added a new parameter that allow you to switch to posdown within XBGPU so you don't have to redo the file. in you case I used:

depfile   = ./bathy/bathy-new.dep;
posdown    = 0;

and the model worked... image