FORTRAN90 which-implementation
only working for 67420 pixels but gives errors when used in apply or in a loop in a function. Don't know the reason for that. If applied stand alone the functions returns valid results.