sealevel_nan_check - Sweep the sealevel (z) for NaN values

INTERFACE:

    subroutine sealevel_nan_check
DESCRIPTION:

The sea surface elevation (2d) variable is sweeped scanning for not-a-number (NaN). NaN values indicate that the integration has become unstable and that it really should be stopped. First time a NaN value is found, a warning is issued and possibly the code is stopped. After the first encounter, the sweep is suspended.

The behaviour of this routine is controlled by the sealevel_check parameter in the m2d namelist. USES:

    use domain, only: imin,imax,jmin,jmax,ioff,joff
    use m2d, only: sealevel_check
    use variables_2d, only: z
    use exceptions, only: getm_error
    IMPLICIT NONE
REVISION HISTORY:
    Original author(s): Bjarne B\"uchmann
LOCAL VARIABLES:
    integer, save :: Ncall = 0
    integer, save :: can_check   = 0
    integer, save :: have_warned = 0
    integer       :: num_nan
    integer       :: i,j,inan,jnan, idum
    REALTYPE      :: ahuge,zdum