geco-bern / rsofun

Implements the Simulating Optimal FUNctioning framework for site-scale simulations of ecosystem processes, including model calibration. It contains Fortran 90 modules for the P-model, SPLASH, and BiomeE models.
https://geco-bern.github.io/rsofun/
GNU General Public License v3.0
25 stars 29 forks source link

Bug in `mergerank` #246

Closed marcadella closed 4 weeks ago

marcadella commented 4 weeks ago

mergerank is recursively calling itself:

call mergerank(x,a,na,t)
call mergerank(x,a(na+1),nb,t)

The first call is fine, however the second it obiously wrong as a(na+1) is a scalar. I assume that what was meant was call mergerank(x,a(na+1:n),nb,t).

I don't quite understand what this function is supposed to do so I let you judge @stineb .

stineb commented 4 weeks ago

Do you have an indication that there is an issue with this? I've never touched that but I have full confidence that it's doing what it ought to. Doesn't it?

marcadella commented 4 weeks ago

I am not quite sure what the code is supposed to do, but I am sure that the second line is wrong. Maybe the function behaves normally out of luck though (??). I can add a comment and close this issue.