global-hydrodynamics / CaMa-Flood_v4

CaMa-Flood_v4 development master
Apache License 2.0
77 stars 42 forks source link

Error when LINTERP=.FALSE. #56

Closed tpilz closed 3 years ago

tpilz commented 3 years ago

Hi, I get a segmentation fault when setting parameter LINTERP=.FALSE.. I think the reason is that subroutine CMF_INPMAT_INIT_* is only called when LINTERP is set to true but subroutine ROFF_INTERP is called in any case, where it is then missing variables INPX and INPY that are only initialised in CMF_INPMAT_INIT_*.

The error can be reproduced with the examples (I checked with test3-jpn_fcast.sh).

I use version 4.01 (official release 20210331 obtained from the homepage).

Regards, Tobias

bigasmountain commented 3 years ago

Hi Tobias, Sorry, I was busy in May, and this comment was somehow leaked from my task list. If you can fix the issue easily, could you please send us the revised code? Then we can merge your commit to the master branch. (We don't use LINTERP=.FALSE. options usually)

tpilz commented 3 years ago

Hi Dai, I had a look. I think the problem is that the subroutine for the alternative interpolation is missing. I.e., according to the manual, if LINTERP=.FALSE. nearest point interpolation should be performed and in an older version of camaflood I found the subroutine CONV_RESOL which is doing that. This subroutine is not present in the latest code version anymore.

Is there a reason why it has been removed? Otherwise it could just be included again as in the old version.

bigasmountain commented 3 years ago

The code structure is largely modified, and some changes are not reflected on the unused old schemes. If you can modify the code and share it with us, we can integrate your contribution

bigasmountain commented 3 years ago

Hi Tobias, Your request is now merged to master. (This is the first attempt to merge commits by external contributors, indeed. Thanks!)