Hello,
It can be anything. If it happens at the first time step probably a value that is not initialised in your data, or crushed elements in your mesh without treatment of tidal flats. Compiling with tracing options would give you the very line where the first NaN occurs (with Intel compiler : -debug all -traceback -ftrapuv), I keep a version like this here, but it is not computationnally efficient, just for debugging.
Another test that you can do is putting subroutine BIEF_ALLVEC in your Fortran and replace the line:
XMAX=HUGE(100.D0) by XMAX=0.D0
If it works it is a proof that it is a value not initialised (we initialise all double precision arrays allocated in BIEF_ALLVEC with nearly NaN to trigger a crash if an array is not initialiesd, this is Quality Insurance...)
With best regards,
Jean-Michel Hervouet