Hello,
I thought you were clipping UNORM as you did for depth but, on a closer look, actually not, so UNORM can be 0.D0 if the velocity is 0.D0. After computing UDRAG you should add UNORM=MAX(UNORM,1.D-4) for example, otherwise you get a division by 0 that triggers the NaN.
However the behaviour you have may also hide some memory overlapping, did you change something else than dragfo.f, do you have VERTICAL STRUCTURES = YES in your steering file ? You can print FUDRAG%DIM1, FVDRAG%DIM1, FUDRAG%ELM, FVDRAG%ELM, FUDRAG%NAME, FVDRAG%NAME for a preliminary checking.
With best regards,
Jean-Michel Hervouet