2D AMRCLAW
cleanup.f
Go to the documentation of this file.
1 c
2 c ---------------------------------------------------------
3 c
4  subroutine cleanup(nvar,naux)
5 c
6 c :::::::::::::::::::::: CLEANUP ::::::::::::::::::::::::::::::::;
7 c this is just a check to make sure all storage was accounted for.
8 c routine is called after all the data has been checkpointed.
9 c :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::;
10 
11  use amr_module
12  implicit double precision (a-h,o-z)
13 c
14 c ## clean up storage to double check that everything taken care of
15 c ## done after the checkpoint so pointers sitll work on restart
16  do 120 level = 1, lfine
17  call putsp(1,level,nvar,naux)
18  mptr = lstart(level)
19  110 nx = node(ndihi,mptr) - node(ndilo,mptr) + 1
20  ny = node(ndjhi,mptr) - node(ndjlo,mptr) + 1
21  mitot = nx + 2*nghost
22  mjtot = ny + 2*nghost
23  nwords = mitot*mjtot*nvar
24  call reclam(node(store1, mptr), nwords)
25  if (level .lt. mxnest)
26  . call reclam(node(store2, mptr), nwords)
27  if (naux .gt. 0)
28  . call reclam(node(storeaux, mptr), mitot*mjtot*naux)
29  mptr = node(levelptr, mptr)
30  if (mptr .ne. 0) go to 110
31 120 continue
32 
33  return
34  end
subroutine cleanup(nvar, naux)
Definition: cleanup.f:4
subroutine reclam(index, nwords)
Definition: reclam.f:4
subroutine putsp(lbase, level, nvar, naux)
Definition: putsp.f:4