In my code there are several palces producing Nan. For some reason, I want to trap only one of them which is in a specific module, not the other ones. What I tried and did not work is,
1) When I activate the -fpe0 option the programme stops at the first Nan which is not the one I want to trap.
2) I compiled only the module of interest with the -fpe0 option. This did not work either.
3) I used IFCORE module and the FOR_SET_FPE option only in the module of ineterst. However, this is also catching all the Nan all over the entire programme.
How can I trap the Nans only in a specific module/subroutine?