the attached set of patches provide a simple function
sf_IdFromName(CCTK_INT id, CCTK_STRING name)
(and similar for Fortran) as well as changes for AHFinderDirect, QuasiLocalMeasures and SetMask_SphericalSurface to use it.
The code compiles and passes the testsuites for QLM and AHFinderDirect (testing both with ids by name and by number).
If this code is roughly in concordance with how this ought-to-be-done in Cactus, then please apply (I have commit rights to QLM and AHFinderDirect only but not SphericalSurface and SetMask_SphericalSurface).