Fix denseoffsetsRead for modern gfortran
Allows compilation without need for -fallow-argument-mismatch
My intent here is to declare getLineBand's arr argument as type(*), which as far as I can tell is the fortran equivalent of a void* and allows passing any data. I'm a fortran newbie so I would appreciate a look from someone more experienced.
In this case, I don't think that long Fortran experience is any help. I learned Fortran 77 and then some of the Fortran 90 and Fortran 95 additions. I found this: Fortran 2018 added TYPE(*) or assumed type as part of the enhanced C interoperability features (https://stevelionel.com/drfortran/2020/06/30/doctor-fortran-in-not-my-type/) so it is very recent. It sounds like it is what we need here to accept a variable passed back from C code, but I have never seen it before.
The problem with adding something from Fortran 2018 is that it won't be backwards compatible with earlier compilers. It is annoying when new compiler versions don't accept syntax that worked before and force you to use new syntax that is not backwards compatible.
Thanks for pointing that out, and I completely agree that the lack of backward compatibility is annoying. I'm going to think about this some more and try to come up with something that is more broadly compatible.
I was looking at some other geospatial packages and I think I found a solution that doesn't require recent gfortran versions.
https://github.com/ecmwf/eccodes/commit/2e0d31080dda0bdd06ae2e1d1d2037498c85e020
Instead of trying to teach fortran that a function is polymorphic, we can just make a bunch of aliases for any different type of argument we might want to pass, and have them all call the same underlying C function.
Thanks for your valuable feedback :)