2D AMRCLAW
errest.f
Go to the documentation of this file.
1 c
2 c -------------------------------------------------------------
3 c
4  subroutine errest (nvar,naux,lcheck,mptr,nx,ny)
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 :::::::::::::::::::::::::::::::::::
18 c for this grid at level lcheck:
19 c estimate the error by taking a large (2h,2k) step based on the
20 c values in the old storage loc., then take one regular (and for
21 c now wasted) step based on the new info. compare using an
22 c error relation for a pth order accurate integration formula.
23 c flag error plane as either bad (needs refinement), or good.
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
63  end
subroutine errest(nvar, naux, lcheck, mptr, nx, ny)
Definition: errest.f:4
subroutine prepbigstep(nvar, naux, lcheck, mptr, nx, ny, midub, mjdub, valbgc, auxbgc, mi2tot, mj2tot)
Definition: prepbigstep.f:4
subroutine errf1(rctfine, nvar, rctcrse, mptr, mi2tot, mj2tot, mitot, mjtot, rctflg, mibuff, mjbuff)
Definition: errf1.f:4
subroutine prepregstep(nvar, naux, lcheck, mptr, nx, ny, mitot, mjtot, valbig, auxbig)
Definition: prepregstep.f:4