Template for custom Fortran operations on R rasters