2D AMRCLAW
Functions/Subroutines
cleanup.f File Reference

Go to the source code of this file.

Functions/Subroutines

subroutine cleanup (nvar, naux)
 

Function/Subroutine Documentation

◆ cleanup()

subroutine cleanup (   nvar,
  naux 
)

this is just a check to make sure all storage was accounted for. routine is called after all the data has been checkpointed.

Definition at line 5 of file cleanup.f.

References amr_module::levelptr, amr_module::lfine, amr_module::lstart, amr_module::mxnest, amr_module::ndihi, amr_module::ndilo, amr_module::ndjhi, amr_module::ndjlo, amr_module::nghost, amr_module::node, putsp(), reclam(), amr_module::store1, amr_module::store2, and amr_module::storeaux.

Referenced by amr2().

5 c
6 c :::::::::::::::::::::: CLEANUP ::::::::::::::::::::::::::::::::;
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
subroutine reclam(index, nwords)
Definition: reclam.f:5
integer, parameter ndihi
global i index of right border of this grid
Definition: amr_module.f90:111
integer, dimension(nsize, maxgr) node
Definition: amr_module.f90:198
integer, parameter ndilo
global i index of left border of this grid
Definition: amr_module.f90:108
integer, parameter ndjlo
global j index of lower border of this grid
Definition: amr_module.f90:114
integer, parameter store1
pointer to the address of memory storing the first copy of solution data on this grid, usually for storing new solution
Definition: amr_module.f90:101
integer, dimension(maxlv) lstart
Definition: amr_module.f90:198
integer, parameter store2
pointer to the address of memory storing the second copy of solution data on this grid...
Definition: amr_module.f90:105
integer, parameter ndjhi
global j index of upper border of this grid
Definition: amr_module.f90:117
integer, parameter levelptr
node number (index) of next grid on the same level
Definition: amr_module.f90:35
integer mxnest
Definition: amr_module.f90:198
integer nghost
Definition: amr_module.f90:232
The module contains the definition of a "node descriptor" as well as other global variables used duri...
Definition: amr_module.f90:21
integer lfine
Definition: amr_module.f90:198
subroutine putsp(lbase, level, nvar, naux)
Reclaim list space in nodes cfluxptr and ffluxptr for all grids at level level
Definition: putsp.f:7
integer, parameter storeaux
pointer to the address of memory storing auxiliary data on this grid
Definition: amr_module.f90:120
Here is the call graph for this function:
Here is the caller graph for this function: