2D AMRCLAW
Functions/Subroutines
errest.f File Reference

Go to the source code of this file.

Functions/Subroutines

subroutine errest (nvar, naux, lcheck, mptr, nx, ny)
 

Function/Subroutine Documentation

◆ errest()

subroutine errest (   nvar,
  naux,
  lcheck,
  mptr,
  nx,
  ny 
)

for this grid at level lcheck: estimate the error by taking a large (2h,2k) step based on the values in the old storage loc., then take one regular (and for now wasted) step based on the new info. compare using an error relation for a pth order accurate integration formula. flag error plane as either bad (needs refinement), or good.

Definition at line 5 of file errest.f.

References amr_module::alloc, errf1(), amr_module::ibuff, amr_module::nghost, amr_module::node, prepbigstep(), prepregstep(), amr_module::store1, amr_module::store2, amr_module::storeaux, amr_module::storeflags, and amr_module::tempptr.

Referenced by flagger().

5 c
6  use amr_module
7  implicit double precision (a-h,o-z)
8 c
9 c ### changed to stack based storage 2/23/13
10 c ### and broken into smaller routines to minimize
11 c ### stack space
12 
13  double precision valbgc(nvar,nx/2+2*nghost,ny/2+2*nghost)
14  double precision auxbgc(naux,nx/2+2*nghost,ny/2+2*nghost)
15 
16 
17 c :::::::::::::::::::::::::: ERREST :::::::::::::::::::::::::::::::::::
24 c :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
25 c
26  mitot = nx + 2*nghost
27  mjtot = ny + 2*nghost
28  locnew = node(store1,mptr)
29  locold = node(store2,mptr)
30  locaux = node(storeaux,mptr)
31  mi2tot = nx/2 + 2*nghost
32  mj2tot = ny/2 + 2*nghost
33 c
34 c prepare double the stencil size worth of boundary values,
35 c then coarsen them for the giant step integration.
36  midub = nx+4*nghost
37  mjdub = ny+4*nghost
38 c
39  call prepbigstep(nvar,naux,lcheck,mptr,nx,ny,midub,
40  . mjdub,valbgc,auxbgc,mi2tot,mj2tot)
41 
42 c
43 c the one giant step based on old values is done. now take
44 c one regular step based on new values.
45 c boundary values already in locbig, (see subr. flagger)
46 c
47  locbig = node(tempptr,mptr)
48  locaux = node(storeaux,mptr)
49  call prepregstep(nvar,naux,lcheck,mptr,nx,ny,mitot,mjtot,
50  . alloc(locbig),alloc(locaux))
51 c
52 c ## locamrflags allocated in flagger. may previously have been used
53 c ## by flag2refine so make sure not to overwrite
54  locamrflags = node(storeflags, mptr)
55  mbuff = max(nghost,ibuff+1)
56  mibuff = nx + 2*mbuff
57  mjbuff = ny + 2*mbuff
58  call errf1(alloc(locbig),nvar,valbgc,mptr,mi2tot,mj2tot,
59  1 mitot,mjtot,alloc(locamrflags),mibuff,mjbuff)
60 
61 c
62  return
integer, parameter tempptr
temporary pointer
Definition: amr_module.f90:38
integer, dimension(nsize, maxgr) node
Definition: amr_module.f90:198
subroutine prepbigstep(nvar, naux, lcheck, mptr, nx, ny, midub, mjdub, valbgc, auxbgc, mi2tot, mj2tot)
Definition: prepbigstep.f:6
integer, parameter storeflags
pointer to the address of memory storing flags for refinement on this grid
Definition: amr_module.f90:123
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 ibuff
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
subroutine errf1(rctfine, nvar, rctcrse, mptr, mi2tot, mj2tot, mitot, mjtot, rctflg, mibuff, mjbuff)
Definition: errf1.f:6
subroutine prepregstep(nvar, naux, lcheck, mptr, nx, ny, mitot, mjtot, valbig, auxbig)
Definition: prepregstep.f:6
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, parameter storeaux
pointer to the address of memory storing auxiliary data on this grid
Definition: amr_module.f90:120
real(kind=8), dimension(:), allocatable alloc
Definition: amr_module.f90:218
Here is the call graph for this function:
Here is the caller graph for this function: