2D AMRCLAW
check4nans.f90
Go to the documentation of this file.
1 ! =========================================================
3 subroutine check4nans(meqn,mbc,mx,my,q,t,ichecknan)
4 
5  implicit none
6 
7  ! Input
8  integer, intent(in) :: meqn, mbc, mx, my, ichecknan
9  real(kind=8), intent(in) :: t, q(meqn,1-mbc:mx+mbc,1-mbc:my+mbc)
10 
11  ! Locals
12  integer :: i, j, m
13 
14  ! print *,'Checking for NANs at ichecknan = ',ichecknan
15  ! print *,' mx = ',mx,' my = ',my,' meqn = ',meqn
16 
17  do i=1-mbc,mx+mbc
18  do j=1-mbc,my+mbc
19  do m=1,meqn
20  if (.not. (q(m,i,j) == q(m,i,j))) then
21  ! true if q(i,j,m) = NAN
22  print *, 'SOLUTION ERROR --- ABORTING CALCULATION'
23  print *, 'At ichecknan = ',ichecknan
24  print *, ' mx,my,t:',mx,my,t
25  print *, ' m,i,j:',m,i,j
26  print *, ' q(m,i,j) = ',q(m,i,j)
27  stop
28  endif
29  enddo
30  enddo
31  enddo
32 
33  ! Uncomment the next line if desired when debugging:
34  ! print *,'No NANs at ichecknan = ',ichecknan,' at t = ',t
35 
36 end subroutine check4nans
subroutine check4nans(meqn, mbc, mx, my, q, t, ichecknan)
Check for NANs in solution q.
Definition: check4nans.f90:4