jchelly / gadgetviewer

Simple tool for interactive visualisation of Gadget and SWIFT N-body simulations
GNU General Public License v3.0
24 stars 9 forks source link

Fix double precision configuration #20

Closed zebo9x closed 1 year ago

zebo9x commented 1 year ago

This will fix fortran compilation error for double precision configuration (kind mismatch).

Note: some changes are pedantic. Note: I'm not sure about the correctness of main/src/select_point.f90 line 3. Is this position the right place to put use data_types?

Currently I am using this version and it is working with snapshot file v2.

jchelly commented 1 year ago

Sorry for the slow response on this, and thanks for the fix.

I think the double precision option hasn't been used very much. It should be possible to read double precision snapshots with a single precision gadgetviewer build. If that doesn't work then I'd consider it another bug (unless the values in your snapshots are outside the range of single precision floats?).

I can reproduce the problem on CentOS 7 with gcc 11.1.0 and this merge request does fix it, so I'll merge it once I've had a chance to look at the changes.

zebo9x commented 1 year ago

Thanks for the reply. Unfortunately now I haven't access to double precision snapshots and I think the snapshots I will use do not have values outside the single precision. Have a nice reading.

jchelly commented 1 year ago

Sorry this took so long. I've done some testing with single and double precision builds and it all seems to work, so I'll merge it.