2D AMRCLAW
Functions/Subroutines
prepf.f File Reference

Go to the source code of this file.

Functions/Subroutines

subroutine prepf (level, nvar, naux)
 For new fine grids (grids on level level), allocate space for saving fluxes at boundary (even if it's physical boundary) after each integration step. More...
 

Function/Subroutine Documentation

◆ prepf()

subroutine prepf (   level,
  nvar,
  naux 
)

For new fine grids (grids on level level), allocate space for saving fluxes at boundary (even if it's physical boundary) after each integration step.

These fluxes are for future conservative fixing of coarse grids (level level-1 grids). The address of this space is stored in node(ffluxptr, mkid) for grid mkid.

Note that if the refinment ratio is r, fluxes from every r cells on grid mkid are saved to one slot in this space, since every r cells on grid mkid border one cell on level level-1 grids.

Parameters
[in]levelboudnary lists of grids on this level get updated
[in]nvarnumber of equations for the system
[in]nauxnumber of auxiliary variables for the system

Definition at line 19 of file prepf.f.

References amr_module::alloc, amr_module::ffluxptr, igetsp(), amr_module::intratx, amr_module::intraty, amr_module::levelptr, amr_module::lstart, amr_module::ndihi, amr_module::ndilo, amr_module::ndjhi, amr_module::ndjlo, and amr_module::node.

Referenced by regrid(), and setgrd().

19 c
20  use amr_module
21  implicit double precision (a-h,o-z)
22 
23 c
24 c ::::::::::::::::::::::::::: PREPF :::::::::::::::::::::::::::::
25 c
26 c prepare new fine grids to save fluxes after each integration step
27 c for future conservative fixing of coarse grids
28 c save all boundary fluxes of fine grid (even if phys. bndry.) -
29 c but only save space for every intrat. (remember - 4 fluxes).
30 c
31 c :::::::::::::::::::::::::::::::::::;:::::::::::::::::::::::::::
32 c
33  mkid = lstart(level)
34  10 if (mkid .eq. 0) go to 99
35  nx = node(ndihi,mkid)-node(ndilo,mkid) + 1
36  ny = node(ndjhi,mkid)-node(ndjlo,mkid) + 1
37  ikeep = nx/intratx(level-1)
38  jkeep = ny/intraty(level-1)
39  lenbc = 2*(ikeep+jkeep)
40 c
41 c get twice the storage, one for plus or minus fluxes, the
42 c other for coarse solution for wave fixing. also for aux vars.
43 c
44  node(ffluxptr,mkid) = igetsp(2*nvar*lenbc+naux*lenbc)
45  ist = node(ffluxptr,mkid)
46 
47  do 20 i = 1, 2*nvar*lenbc + naux*lenbc
48  20 alloc(ist+i-1) = 0.d0
49  mkid = node(levelptr,mkid)
50  go to 10
51 
52  99 return
function igetsp(nwords)
Allocate contiguous space of length nword in main storage array alloc.
Definition: igetsp.f:9
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, dimension(maxlv) lstart
Definition: amr_module.f90:198
integer, dimension(maxlv) intraty
Definition: amr_module.f90:198
integer, parameter ndjhi
global j index of upper border of this grid
Definition: amr_module.f90:117
integer, dimension(maxlv) intratx
Definition: amr_module.f90:198
integer, parameter levelptr
node number (index) of next grid on the same level
Definition: amr_module.f90:35
The module contains the definition of a "node descriptor" as well as other global variables used duri...
Definition: amr_module.f90:21
real(kind=8), dimension(:), allocatable alloc
Definition: amr_module.f90:218
integer, parameter ffluxptr
pointer to the address of memory storing fluxes in a layer around the grid, to be used in conservatio...
Definition: amr_module.f90:97
Here is the call graph for this function:
Here is the caller graph for this function: