Helper routine for checking if variable is element of array
Often the code checks whether a user supplied parameter is among the possible selectable parameters:
e.g. meth_flag must be [11, 19, 21, 29]
We already have such routine in the exp branch misc.F90 file.