anchor.diff:              if (vmin < less_than) then
                   write(*,*) trim(msg)
                   write(*,*) trim(name)//" is less than "//trim(str(less_than))//" : "//trim(str(vmin))
  -                
  +
  +                block
  +                    integer :: i,j,k,nx,ny,nz
  +
  +                    nx = size(var,1)
  +                    nz = size(var,2)
  +                    ny = size(var,3)
  +                    do j=lbound(var,3),ubound(var,3)
  +                        do k=lbound(var,2),ubound(var,2)
  +                            do i=lbound(var,1),ubound(var,1)
  +                                if (var(i,k,j) < less_than) then
  +                                    print*, "First Error was in grid cell:", i,k,j, var(i,k,j)
  +                                    error stop
  +                                endif
  +                            enddo
  +                        enddo
  +                    enddo
  +                end block
  +
                   if (present(fix)) then
                       if (fix) then
                           write(*,*) "Fixing..."
  
positive.code:         if (present(less_than)) then
              where(var < less_than) var = less_than
          endif
          
      end subroutine fix_var
  
      
  end module debug_module
  
negative.code: module debug_module
      use domain_interface, only  : domain_t
      use string,           only  : str
  
      implicit none
  contains
  
      subroutine domain_check(domain, error_msg, fix)
          implicit none
          type(domain_t),     intent(inout)   :: domain
          character(len=*),   intent(in)      :: error_msg
          logical,            intent(in), optional :: fix
          logical :: fix_data
  
          fix_data = .False.
          if (present(fix)) fix_data = fix
  
          call check_var(domain%potential_temperature%data_3d, name="th",      msg=error_msg, less_than    =100.0, fix=fix_data)
          call check_var(domain%potential_temperature%data_3d, name="th",      msg=error_msg, greater_than =600.0, fix=fix_data)
          call check_var(domain%water_vapor%data_3d,           name="qv",      msg=error_msg, less_than    =0.0,   fix=fix_data)
          call check_var(domain%cloud_water_mass%data_3d,      name="cloud",   msg=error_msg, less_than    =0.0,   fix=fix_data)
          call check_var(domain%cloud_ice_mass%data_3d,        name="ice",     msg=error_msg, less_than    =0.0,   fix=fix_data)
          call check_var(domain%cloud_ice_number%data_3d,      name="nice",    msg=error_msg, less_than    =0.0,   fix=fix_data)
          call check_var(domain%snow_mass%data_3d,             name="qsnow",   msg=error_msg, less_than    =0.0,   fix=fix_data)
          call check_var(domain%snow_number%data_3d,           name="nsnow",   msg=error_msg, less_than    =0.0,   fix=fix_data)
          call check_var(domain%rain_mass%data_3d,             name="qrain",   msg=error_msg, less_than    =0.0,   fix=fix_data)
          call check_var(domain%rain_number%data_3d,           name="nrain",   msg=error_msg, less_than    =0.0,   fix=fix_data)
          call check_var(domain%graupel_mass%data_3d,          name="qgrau",   msg=error_msg, less_than    =0.0,   fix=fix_data)
          call check_var(domain%graupel_number%data_3d,        name="ngrau",   msg=error_msg, less_than    =0.0,   fix=fix_data)
  
      end subroutine domain_check
  
      subroutine check_var(var, name, msg, greater_than, less_than, fix)
          implicit none
          real,               intent(inout), dimension(:,:,:), pointer :: var
          character(len=*),   intent(in)                      :: name, msg
          real,               intent(in),    optional         :: greater_than, less_than
          logical,            intent(in),    optional         :: fix
          real :: vmax, vmin
  
          if (.not.associated(var)) then
              return
          endif
  
          if (present(greater_than)) then
              vmax = maxval(var)
              if (vmax > greater_than) then
                  write(*,*) trim(msg)
                  write(*,*) trim(name)//" is greater than "//trim(str(greater_than))//" : "//trim(str(vmax))
  
                  if (present(fix)) then
                      if (fix) then
                          write(*,*) "Fixing..."
  