MFC
Exascale flow solver
Loading...
Searching...
No Matches
m_amr_state Module Reference

Module-scope AMR state (block pool, flat field store, wave buffers) and the leaf helpers every AMR module needs. More...

Data Types

type  t_level
 One refined level: its own grid and metadata (host-only). Fields live in the flat stores amr_cons_st/amr_stor_st, indexed by amr_loc_of. More...

Functions/Subroutines

subroutine s_build_level_coords (pcb, pcb_lb, lo, nfine, fcb, fcc, fdx)
 Fill fcb/fcc/fdx by subdividing parent cells (s_amr_subdivide_cb); pcb_lb is lbound(pcb, 1). Only 0..nfine is filled.
pure subroutine s_amr_region_box (k, rlo, rhi)
 Block k's region box in global coarse cells; collapsed dimensions read 0:0.
pure subroutine s_amr_patch_box (k, plo, phi)
 Block k's padded coarse patch box [plo, phi] (region +/- amr_cpat_mar; collapsed dims 0:0).
pure integer function f_amr_prolong_reach ()
 How many parent cells inside a child's footprint the ghost prolongation reads: 1 for limited linear, 2 for the quartic.
pure integer function f_amr_cpat_mar ()
 Coarse-patch margin amr_cpat_mar: the coarse cells a buff_size fine ghost layer spans plus the prolongation reach.
pure subroutine s_amr_patch_core (k, clo, chi)
 Core [clo, chi] of the patch box that the ghost fill never reads, so the fill waves ship only the shell around it.
impure subroutine s_amr_build_block_coords (k, gcb, glb, fcb, fcc, fdx, d)
 Fine cell coordinates of block k in dimension d, rebuilt from the global coarse boundaries gcb by replaying k's ancestor chain from replicated metadata, so any rank can reproduce them. Do not bisect amr_slots(parent)x_cb instead: the parent's slot exists only on its owner, which a level>=2 block's owner need not be.
impure subroutine s_amr_build_global_cb (pad)
 Assemble the global coarse cell-boundary arrays over (-1-pad : G+pad): each rank writes its own cells' boundaries into a sentinel-filled array and an elementwise MAX allreduce recovers the global one. A larger-pad rebuild gives a consistent superset.
pure logical function f_amr_boxes_overlap (alo, ahi, blo, bhi)
 Do two coarse-index boxes [alo:ahi] and [blo:bhi] overlap? Collapsed dims never disqualify.
pure integer function f_amr_parent_block (k)
 Index of the level-(level(k)-1) block that block k refines, or 0 for level 1 (parent is the L0 grid). Regions are in L0 cell indices at every level; proper nesting guarantees one overlapping parent.
impure subroutine s_amr_fine_slice (slot, d, dlo, dhi, buf, dir)
 Pack (dir=+1) / unpack (dir=-1) the fine cells of slot's q_cons over [dlo:dhi] in dim d (interior transverse, all sys_size) in a fixed order, so a packer and unpacker with matching extents align cell-for-cell. On GPU only this near-seam slab moves device<->host.
pure subroutine s_amr_phys_to_cells (pmin, pmax, pad_cells, blo, bhi)
 Convert a physical-space bbox to a global coarse-index bbox padded by pad_cells (uniform spacing; the axisymmetric half axis cell only shrinks dy(0), so the floor stays conservative).
impure subroutine s_amr_check_lag_clear ()
 Rank-local per-stage guard: the local bubbles' padded bbox must stay clear of the current block (initial overlap, or drift beyond the regrid margin).
pure elemental real(wp) function minmod (a, b)
 minmod slope limiter: 0 if a,b differ in sign, else the smaller-magnitude argument.
pure real(wp) function f_amr_lin (u0, xm, xp, ym, yp, zm, zp, xix, xiy, xiz)
 Minmod-limited linear value at fine offset (xix, xiy, xiz) in coarse cell u0, from its face neighbours (m, p) per direction; pass u0 for both neighbours of a direction without a slope.
pure logical function f_amr_cons_ok (fi, fj, fk, loc)
 Admissible fine cell: positive density and (except model 4) positive internal energy; a NaN state is inadmissible.
pure real(wp) function f_amr_quartic_half (q, xi)
 Average over one half (xi < 0 left, > 0 right; |xi| = 1/4) of the middle of five cell averages q: the conservative quartic, or MC-limited linear where either half leaves the range of the three nearest averages. That range is widened only where the three second differences share a sign (smooth data): by the smallest of them, c, at a local extremum of the averages, and where they are monotone by c/4 times the ratio of the smallest to the largest, never across zero. A smooth extremum in the next cell needs c/8 (without it the fill is second order there) and has a ratio near one; at the foot of a steep front c is as large as q(0) and the ratio is small; at an under- or overshoot beside a front the differences change sign and the quartic's slope is the front's, not the cell's. Both halves are tested so the two children share one reconstruction (their mean stays q(0)).
impure subroutine s_amr_scr_init ()
 Allocate the pooled q_prim/rhs advance scratch (idempotent). The lockstep driver associates it for every block, so it must exist on every rank, including one that never allocates a slot. rhs gets the igr widening.
impure subroutine s_amr_size_int (a, n)
 Grow-on-demand sizing for append-only tables and pools: a grow preserves the entries already appended.
impure subroutine s_amr_size_int3 (a, n)
impure subroutine s_amr_size_rows (a, r, n)
 s_amr_size_int for a table of n columns of r ints.
impure subroutine s_amr_size_real (a, n, dev)
 Wire pools, preserving on grow. dev keeps the pool device-resident across (re)allocation: the old image is deleted from the device before it is freed and the new one created after; contents never survive a wave, so nothing is copied.

Variables

type(t_level), dimension(:), allocatable amr_slots
 Fixed pool of refined-block slots; the working slot amr_cur selects which one per-block routines operate on.
integer, dimension(:), allocatable amr_loc_of
 Dense local index for live slots: amr_slots is sparse over 1:amr_max_blocks, the field store is dense. Freed indices are recycled through amr_loc_free.
integer, dimension(:), allocatable amr_loc_free
 stack of recycled local indices
integer amr_loc_n = 0
 high-water mark of local indices handed out
integer amr_loc_nfree = 0
 depth of the recycle stack
real(stp), dimension(:,:,:,:,:), allocatable amr_cons_st
 Flat per-block field store (x, y, z, var, local slot) so one kernel can run over every live block; all slots share the mbuf extents. Sized by s_amr_st_reserve.
real(stp), dimension(:,:,:,:,:), allocatable amr_stor_st
real(stp), dimension(:,:,:,:,:), allocatable amr_ibp
 Moving bodies: the primitive state of the RHS pass of each block whose IB correction waits for the bodies to move (s_amr_fine_stage_ib), one column per such block, in the store's (x, y, z, var) layout.
integer, dimension(:), allocatable amr_ibp_blk
 the block of each amr_ibp column
integer amr_ibp_n = 0
 columns in use this stage
integer amr_st_cap = 0
 local slots the store is sized for; grows only (s_amr_compact_store keeps the index space dense)
type(scalar_field), dimension(:), allocatable amr_cons_br
 Copy bridge to the shared solver, whose routines take type(scalar_field) and serve the monolithic path too (a pointer view into the flat store is not attachable on OpenMP offload): load from the store, call, store back, in both directions since the dummies are intent(inout). Not GPU_DECLARE'd: a declare binds the present-table entry to the descriptor that move_alloc then swaps out (CCE find_in_present_table failed); allocate via move_alloc + GPU_ENTER_DATA instead (CCE lib-4425 otherwise).
integer, dimension(amr_bat_max) amr_bat_loc = 0
 Batched advance: the bridge spans amr_br_batch blocks along the last active dimension, member i at offset (i-1)*amr_bat_w with its own ghost shell, so no block's stencil reaches another's interior. amr_bat_loc = members' flat-store columns (device-resident).
type(scalar_field), dimension(:), allocatable amr_scr_prim
 Pooled advance scratch shared by every fine block (the fused advance leaves no cross-block lifetime); same pattern as amr_cg.
type(scalar_field), dimension(:), allocatable amr_scr_rhs
type(scalar_field), dimension(:), allocatable amr_scr_prim_blk
 block-frame prim scratch for the batched per-member IB correction (ib only); the slab prim stacks members along amr_bat_sd
integer amr_br_batch = 1
 Blocks per batched s_compute_rhs call (amr_bat_max once initialized); bounded to avoid exhausting device memory.
integer, dimension(3) amr_maxc
 max coarse block cells per dim: (m_glb+1)/2 etc.; 1 for collapsed dims
integer, dimension(3) max_f
 Per-slot sizing: max fine cells per dim and the buffered array bounds. amr_slot_live(k): slot k's field arrays are allocated (lazy, owned-only).
integer, dimension(3) mbuf_lo
integer, dimension(3) mbuf_hi
logical, dimension(:), allocatable amr_slot_live
integer, dimension(:,:), allocatable amr_seam_pairs
 cached same-level seam list (xb, yb, seam-dim) so s_amr_fine_fine_post iterates O(#seams); rebuilt when amr_seam_pairs_dirty is set or the block count changes
integer amr_num_seam_pairs
integer amr_seam_pairs_nblk
logical amr_seam_pairs_dirty
integer amr_tag_narrow = 0
 Tag base of the clusterer's narrow-node reductions, above the per-box tag space [1..amr_max_blocks]; checked against MPI_TAG_UB at init.
integer, parameter amr_band_reflux = 0
 Keyed wave tags: amr_tag_base + band*65536 + gen*4096 + seq, checked against MPI_TAG_UB. gen (mod 16) bumps per wave entry on every rank; seq is the message's index in the pair's canonically ordered transfer list (block id, dim, lo before hi), so matching is independent of posting order.
integer, parameter amr_band_freg = 1
integer, parameter amr_band_parent_fill = 2
integer, parameter amr_band_stage_fill = 3
integer, parameter amr_band_migrate = 4
integer, parameter amr_band_seam = 5
integer, parameter amr_band_restrict_l1 = 6
integer, parameter amr_band_restrict_parent = 7
integer, parameter amr_n_bands = 8
integer amr_tag_base = 0
integer, dimension(0:amr_n_bands - 1) amr_tag_gen = 0
integer, dimension(:,:), allocatable amr_tsq
 (0:np-1, dir) in-wave per-peer seq counters; touched-reset
integer, dimension(:,:), allocatable amr_tsq_tch
 touched peers per dir, so the reset is O(active peers), not O(P)
integer, dimension(2) amr_n_tsq = 0
integer, dimension(:,:), allocatable amr_ovl_gather
 cached per-block P2P overlap-rank lists, rebuilt with the seam list: amr_ovl_gather(:,k) = ranks whose owned coarse range meets block k's padded patch box; amr_ovl_scatter(:,k) = ranks whose coarse interior meets k's region box. Rank-ascending and not owner-excluded, so iterating gives the same MPI order as a 0..num_procs-1 scan. (max-overlap, amr_max_blocks); sized in s_amr_build_seam_pairs
integer, dimension(:,:), allocatable amr_ovl_scatter
integer, dimension(:), allocatable amr_my_blk
 Block indices this rank owns, ascending (the paired MPI_SENDRECVs depend on the order); built in s_amr_assign_block_owners.
integer amr_n_my = 0
integer, dimension(:), allocatable amr_l1r_blk
 Level-1 blocks this rank receives restriction for (not its own, overlapping its interior), rebuilt once per mesh epoch. Keyed on amr_mesh_epoch, not amr_myblk_dirty (owner writes only). Ownership here is amr_block_owner(k) == proc_rank, not the multi-owner amr_rank_owns_block.
integer, dimension(:), allocatable amr_l1p_blk
 padded variant (region +/- amr_cpat_mar vs my coarse range): stage-fill gather
integer amr_n_l1p = 0
integer amr_n_l1r = 0
integer, dimension(:), allocatable amr_fch_blk
 foreign children of my owned parents (level >= 2, powner == me, cowner /= me)
integer amr_n_fch = 0
integer, dimension(:), allocatable amr_own_blk
 blocks this rank intersects (amr_owns_all, the multi-owner notion, all levels)
integer amr_n_own = 0
integer, dimension(:), allocatable amr_parent_blk
 cached f_amr_parent_block (0 for level <= 1), avoiding an O(global blocks) scan per block per stage
integer, dimension(:), allocatable amr_child_ptr
 children of p = amr_child_idx(amr_child_ptr(p-1)+1 : amr_child_ptr(p)), ascending
integer, dimension(:), allocatable amr_child_idx
 (amr_child_ptr(0) = 0)
integer(8) amr_l1r_epoch = -1_8
integer amr_l1r_nblk = -1
 second key half, matching s_amr_reg_prepare's (epoch, num_blocks) pair
logical amr_myblk_dirty = .true.
 Set wherever amr_block_owner is written (assigner, inheritance, restart/migration), so lists built from it never go stale.
integer, dimension(:), allocatable amr_ovl_gather_n
integer, dimension(:), allocatable amr_ovl_scatter_n
 per-block list lengths
real(wp), dimension(:), allocatable amr_fw_sq
 Wire pools of the pooled waves (m_amr_wave lays them out; contents never survive a wave). The fill and restrict waves share amr_fw_sq/rq; the seam wave is posted before the fills and drained after, so it has its own pair. The zero-copy reflux waves list their blocks in amr_fw_rblk.
real(wp), dimension(:), allocatable amr_fw_rq
real(wp), dimension(:), allocatable amr_sw_sq
real(wp), dimension(:), allocatable amr_sw_rq
real(wp), dimension(:), allocatable amr_rf_sq
real(wp), dimension(:), allocatable amr_rf_rq
 device-resident pools of the packed reflux-faces wave
integer, dimension(:), allocatable amr_fw_rblk
logical amr_fw_dev = .false.
 Device-resident wire pools: with rdma_mpi MPI sends/receives them by device address, and the step-path kernels find them present, so slices do not cross PCIe per wave.
integer amr_sw_nsame = 0
 seam pairs both of whose blocks this rank owns: exchanged by one batched kernel at drain, no wire
integer, dimension(:), allocatable amr_sw_plx
integer, dimension(:), allocatable amr_sw_ply
integer, dimension(:), allocatable amr_sw_pd
integer, dimension(:), allocatable amr_sw_pxhi
integer, dimension(:,:), allocatable amr_sw_pfm
integer, dimension(:,:), allocatable amr_fx_pl
 Fused exchange packs (amr_device_pack): one row per wave transfer (slab corner (1:3), extents (4:6), payload offset in the wire pool (7); the child pack also has source store slot (8) and the child's patch frame (9:11)) plus the exclusive element prefix, so one kernel walks a family's transfers. Rebuilt per wave.
integer, dimension(:), allocatable amr_fx_pre
integer(kind=8), dimension(:,:), allocatable amr_fine_cut
 (0:num_procs-1, 1:amr_max_level) SFC Morton-key upper bound per rank, one independent cost-weighted cut per level (owner = cut search, f_amr_owner); O(P) storage. Per level because same-level boxes have distinct Morton keys, which the binary search needs.
integer, dimension(3) amr_maxc_fit = 1
 Regrid box size cap per dim (fixed for the run, identical on all ranks; 1 in collapsed dims): a box of at most min-over-ranks of (local extent + 1)/2 cells intersects every rank in at most (its extent + 1)/2 cells, so the per-rank scratch constraint 2*(isect cells) - 1 <= local extent holds by construction. Equals amr_maxc at np=1.
integer sw_m
 Swap contract (s_amr_swap_to_fine / s_amr_restore_coarse): the fine advance swaps these coarse globals to the block's values and restores after: m/n/p, idwint/idwbuff, the nine coordinate arrays (sw_x_cb..sw_dz), acoustic_source; WENO/hypoelastic/IGR spacing coefficients are recomputed instead. Any new module-level state derived from m/n/p/idwint/idwbuff/coords that a kernel reads on the fine grid must be swapped here or refreshed per fine call, including its device copy (a stale device copy reads out of range under CCE OpenACC; cv_int is refreshed by a per-call GPU_UPDATE in s_compute_rhs). amr_swap_depth makes the swap re-entrant and guards an unpaired restore. Saved coarse-level global state for swap/restore.
integer sw_n
integer sw_p
type(int_bounds_info), dimension(3) sw_idwint
type(int_bounds_info), dimension(3) sw_idwbuff
logical sw_acoustic_source
real(wp), dimension(:,:,:), allocatable sw_jac
 IGR sigma-state bounce: the fine solve reuses jac/jac_old at fine indices, so the coarse contents (jac_old is the Jacobi warm start) are saved here across the fine advance.
real(wp), dimension(:,:,:), allocatable sw_jac_old
integer amr_swap_depth = 0
 Swap nesting depth: only the outermost swap saves the coarse state and only its restore puts it back; inner swaps re-install, inner restores are no-ops.
real(wp), dimension(:), allocatable amr_gxcb
 Global coarse cell-boundary arrays (-1:X_glb), assembled once at init; the fine-distribution owner rebuilds whole-block fine coordinates from them.
real(wp), dimension(:), allocatable amr_gycb
real(wp), dimension(:), allocatable amr_gzcb
real(wp), dimension(:), allocatable sw_x_cb
real(wp), dimension(:), allocatable sw_x_cc
real(wp), dimension(:), allocatable sw_dx
real(wp), dimension(:), allocatable sw_y_cb
real(wp), dimension(:), allocatable sw_y_cc
real(wp), dimension(:), allocatable sw_dy
real(wp), dimension(:), allocatable sw_z_cb
real(wp), dimension(:), allocatable sw_z_cc
real(wp), dimension(:), allocatable sw_dz
logical amr_xchg_coarse_ghosts = .false.
 True (identically on all ranks) iff some rank's fine ghost fill reads its coarse ghost cells: the solver populates only prim ghosts, so the cons ghosts must be halo-exchanged first. Never true at np=1.
integer amr_xchg_bad = 0
 local accumulator behind amr_xchg_coarse_ghosts; s_amr_reduce_xchg_flag does one allreduce per scan
integer, dimension(:,:), allocatable amr_slab_tab
 Per-block gathered coarse patch: the owner may not hold the coarse cells its block refines, so before each prolongation/ghost fill the patch region_lo-amr_cpat_mar : region_hi+amr_cpat_mar is gathered point-to-point into amr_cg (stp scalar_fields, block-local frame: cell 0 = global coarse cell amr_cpat_off(d)). Messages carry wp cast to stp, so at np=1 the patch equals the local coarse read bitwise. Sized to the largest block. amr_slab_tab: device-resident slab table for the shell/ghost kernels, rows lo(1:3),hi(1:3),soff,scnt over <= 6 slabs, refreshed by one GPU_UPDATE per launch.
integer amr_slab_n = 0
 rows queued in amr_slab_tab (s_amr_slab_add)
integer amr_cg_np = 1
 patches amr_cg holds, stacked along dim 3 (s_amr_cg_reserve)
integer amr_cg_nuse = 0
 patches the level-1 pool gather filled (s_amr_l1_pool_gather)
integer, dimension(:), allocatable amr_cg_pz
 dim-3 offset of each owned level-1 box's patch in the pool
type(scalar_field), dimension(:), allocatable amr_cg
integer amr_cpat_mar = 0
 coarse-cell stencil reach (f_amr_cpat_mar)
integer, dimension(3) amr_cpat_hi = 0
 amr_cg upper local bounds per dim (0 in collapsed dims)
integer, dimension(3) amr_cpat_off = 0
 global coarse index of amr_cg local cell 0 (region_lo - amr_cpat_mar)
integer amr_wcur = 1
 consume cursor into the open fill wave's receive transfers (box-major)
real(stp), dimension(:), allocatable amr_pc
 Subcycling patch cache: the pooled level-1 patches (amr_cg, amr_cg_nuse patches) at the step start (time level 0) then the step end (1), each flat with g1 fastest, then g2, g3, variable.

Detailed Description

Module-scope AMR state (block pool, flat field store, wave buffers) and the leaf helpers every AMR module needs.

Function/Subroutine Documentation

◆ f_amr_boxes_overlap()

pure logical function m_amr_state::f_amr_boxes_overlap ( integer, dimension(3), intent(in) alo,
integer, dimension(3), intent(in) ahi,
integer, dimension(3), intent(in) blo,
integer, dimension(3), intent(in) bhi )

Do two coarse-index boxes [alo:ahi] and [blo:bhi] overlap? Collapsed dims never disqualify.

Definition at line 782 of file m_amr_state.fpp.f90.

Here is the caller graph for this function:

◆ f_amr_cons_ok()

pure logical function m_amr_state::f_amr_cons_ok ( integer, intent(in) fi,
integer, intent(in) fj,
integer, intent(in) fk,
integer, intent(in) loc )

Admissible fine cell: positive density and (except model 4) positive internal energy; a NaN state is inadmissible.

Definition at line 1233 of file m_amr_state.fpp.f90.

Here is the caller graph for this function:

◆ f_amr_cpat_mar()

pure integer function m_amr_state::f_amr_cpat_mar

Coarse-patch margin amr_cpat_mar: the coarse cells a buff_size fine ghost layer spans plus the prolongation reach.

Definition at line 660 of file m_amr_state.fpp.f90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ f_amr_lin()

pure real(wp) function m_amr_state::f_amr_lin ( real(wp), intent(in) u0,
real(wp), intent(in) xm,
real(wp), intent(in) xp,
real(wp), intent(in) ym,
real(wp), intent(in) yp,
real(wp), intent(in) zm,
real(wp), intent(in) zp,
real(wp), intent(in) xix,
real(wp), intent(in) xiy,
real(wp), intent(in) xiz )

Minmod-limited linear value at fine offset (xix, xiy, xiz) in coarse cell u0, from its face neighbours (m, p) per direction; pass u0 for both neighbours of a direction without a slope.

Definition at line 1209 of file m_amr_state.fpp.f90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ f_amr_parent_block()

pure integer function m_amr_state::f_amr_parent_block ( integer, intent(in) k)

Index of the level-(level(k)-1) block that block k refines, or 0 for level 1 (parent is the L0 grid). Regions are in L0 cell indices at every level; proper nesting guarantees one overlapping parent.

Definition at line 792 of file m_amr_state.fpp.f90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ f_amr_prolong_reach()

pure integer function m_amr_state::f_amr_prolong_reach

How many parent cells inside a child's footprint the ghost prolongation reads: 1 for limited linear, 2 for the quartic.

Definition at line 653 of file m_amr_state.fpp.f90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ f_amr_quartic_half()

pure real(wp) function m_amr_state::f_amr_quartic_half ( real(wp), dimension(-2:2), intent(in) q,
real(wp), intent(in) xi )

Average over one half (xi < 0 left, > 0 right; |xi| = 1/4) of the middle of five cell averages q: the conservative quartic, or MC-limited linear where either half leaves the range of the three nearest averages. That range is widened only where the three second differences share a sign (smooth data): by the smallest of them, c, at a local extremum of the averages, and where they are monotone by c/4 times the ratio of the smallest to the largest, never across zero. A smooth extremum in the next cell needs c/8 (without it the fill is second order there) and has a ratio near one; at the foot of a steep front c is as large as q(0) and the ratio is small; at an under- or overshoot beside a front the differences change sign and the quartic's slope is the front's, not the cell's. Both halves are tested so the two children share one reconstruction (their mean stays q(0)).

Definition at line 1277 of file m_amr_state.fpp.f90.

Here is the caller graph for this function:

◆ minmod()

pure elemental real(wp) function m_amr_state::minmod ( real(wp), intent(in) a,
real(wp), intent(in) b )

minmod slope limiter: 0 if a,b differ in sign, else the smaller-magnitude argument.

Definition at line 1176 of file m_amr_state.fpp.f90.

Here is the caller graph for this function:

◆ s_amr_build_block_coords()

impure subroutine m_amr_state::s_amr_build_block_coords ( integer, intent(in) k,
real(wp), dimension(:), intent(in) gcb,
integer, intent(in) glb,
real(wp), dimension(:), intent(inout), allocatable fcb,
real(wp), dimension(:), intent(inout), allocatable fcc,
real(wp), dimension(:), intent(inout), allocatable fdx,
integer, intent(in) d )

Fine cell coordinates of block k in dimension d, rebuilt from the global coarse boundaries gcb by replaying k's ancestor chain from replicated metadata, so any rank can reproduce them. Do not bisect amr_slots(parent)x_cb instead: the parent's slot exists only on its owner, which a level>=2 block's owner need not be.

Parameters
[in]gcbglobal L0 cell boundaries
[in]glbindex of gcb's first element (-1, or -1 - buff_size for a padded build)

Definition at line 680 of file m_amr_state.fpp.f90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ s_amr_build_global_cb()

impure subroutine m_amr_state::s_amr_build_global_cb ( integer, intent(in) pad)

Assemble the global coarse cell-boundary arrays over (-1-pad : G+pad): each rank writes its own cells' boundaries into a sentinel-filled array and an elementwise MAX allreduce recovers the global one. A larger-pad rebuild gives a consistent superset.

Definition at line 726 of file m_amr_state.fpp.f90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ s_amr_check_lag_clear()

impure subroutine m_amr_state::s_amr_check_lag_clear

Rank-local per-stage guard: the local bubbles' padded bbox must stay clear of the current block (initial overlap, or drift beyond the regrid margin).

Definition at line 1157 of file m_amr_state.fpp.f90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ s_amr_fine_slice()

impure subroutine m_amr_state::s_amr_fine_slice ( integer, intent(in) slot,
integer, intent(in) d,
integer, intent(in) dlo,
integer, intent(in) dhi,
real(wp), dimension(:), intent(inout), contiguous buf,
integer, intent(in) dir )

Pack (dir=+1) / unpack (dir=-1) the fine cells of slot's q_cons over [dlo:dhi] in dim d (interior transverse, all sys_size) in a fixed order, so a packer and unpacker with matching extents align cell-for-cell. On GPU only this near-seam slab moves device<->host.

Definition at line 812 of file m_amr_state.fpp.f90.

Here is the caller graph for this function:

◆ s_amr_patch_box()

pure subroutine m_amr_state::s_amr_patch_box ( integer, intent(in) k,
integer, dimension(3), intent(out) plo,
integer, dimension(3), intent(out) phi )

Block k's padded coarse patch box [plo, phi] (region +/- amr_cpat_mar; collapsed dims 0:0).

Definition at line 642 of file m_amr_state.fpp.f90.

Here is the caller graph for this function:

◆ s_amr_patch_core()

pure subroutine m_amr_state::s_amr_patch_core ( integer, intent(in) k,
integer, dimension(3), intent(out) clo,
integer, dimension(3), intent(out) chi )

Core [clo, chi] of the patch box that the ghost fill never reads, so the fill waves ship only the shell around it.

Definition at line 667 of file m_amr_state.fpp.f90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ s_amr_phys_to_cells()

pure subroutine m_amr_state::s_amr_phys_to_cells ( real(wp), dimension(3), intent(in) pmin,
real(wp), dimension(3), intent(in) pmax,
integer, intent(in) pad_cells,
integer, dimension(3), intent(out) blo,
integer, dimension(3), intent(out) bhi )

Convert a physical-space bbox to a global coarse-index bbox padded by pad_cells (uniform spacing; the axisymmetric half axis cell only shrinks dy(0), so the floor stays conservative).

Definition at line 1120 of file m_amr_state.fpp.f90.

Here is the caller graph for this function:

◆ s_amr_region_box()

pure subroutine m_amr_state::s_amr_region_box ( integer, intent(in) k,
integer, dimension(3), intent(out) rlo,
integer, dimension(3), intent(out) rhi )

Block k's region box in global coarse cells; collapsed dimensions read 0:0.

Definition at line 632 of file m_amr_state.fpp.f90.

Here is the caller graph for this function:

◆ s_amr_scr_init()

impure subroutine m_amr_state::s_amr_scr_init

Allocate the pooled q_prim/rhs advance scratch (idempotent). The lockstep driver associates it for every block, so it must exist on every rank, including one that never allocates a slot. rhs gets the igr widening.

Definition at line 1318 of file m_amr_state.fpp.f90.

Here is the caller graph for this function:

◆ s_amr_size_int()

impure subroutine m_amr_state::s_amr_size_int ( integer, dimension(:), intent(inout), allocatable a,
integer, intent(in) n )

Grow-on-demand sizing for append-only tables and pools: a grow preserves the entries already appended.

Definition at line 1672 of file m_amr_state.fpp.f90.

Here is the caller graph for this function:

◆ s_amr_size_int3()

impure subroutine m_amr_state::s_amr_size_int3 ( integer, dimension(:,:), intent(inout), allocatable a,
integer, intent(in) n )

Definition at line 1689 of file m_amr_state.fpp.f90.

Here is the call graph for this function:

◆ s_amr_size_real()

impure subroutine m_amr_state::s_amr_size_real ( real(wp), dimension(:), intent(inout), allocatable a,
integer, intent(in) n,
logical, intent(in) dev )

Wire pools, preserving on grow. dev keeps the pool device-resident across (re)allocation: the old image is deleted from the device before it is freed and the new one created after; contents never survive a wave, so nothing is copied.

Definition at line 1718 of file m_amr_state.fpp.f90.

◆ s_amr_size_rows()

impure subroutine m_amr_state::s_amr_size_rows ( integer, dimension(:,:), intent(inout), allocatable a,
integer, intent(in) r,
integer, intent(in) n )

s_amr_size_int for a table of n columns of r ints.

Definition at line 1699 of file m_amr_state.fpp.f90.

Here is the caller graph for this function:

◆ s_build_level_coords()

subroutine m_amr_state::s_build_level_coords ( real(wp), dimension(:), intent(in) pcb,
integer, intent(in) pcb_lb,
integer, intent(in) lo,
integer, intent(in) nfine,
real(wp), dimension(:), intent(inout), allocatable fcb,
real(wp), dimension(:), intent(inout), allocatable fcc,
real(wp), dimension(:), intent(inout), allocatable fdx )

Fill fcb/fcc/fdx by subdividing parent cells (s_amr_subdivide_cb); pcb_lb is lbound(pcb, 1). Only 0..nfine is filled.

Definition at line 616 of file m_amr_state.fpp.f90.

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ amr_band_freg

integer, parameter m_amr_state::amr_band_freg = 1

Definition at line 488 of file m_amr_state.fpp.f90.

◆ amr_band_migrate

integer, parameter m_amr_state::amr_band_migrate = 4

Definition at line 488 of file m_amr_state.fpp.f90.

◆ amr_band_parent_fill

integer, parameter m_amr_state::amr_band_parent_fill = 2

Definition at line 488 of file m_amr_state.fpp.f90.

◆ amr_band_reflux

integer, parameter m_amr_state::amr_band_reflux = 0

Keyed wave tags: amr_tag_base + band*65536 + gen*4096 + seq, checked against MPI_TAG_UB. gen (mod 16) bumps per wave entry on every rank; seq is the message's index in the pair's canonically ordered transfer list (block id, dim, lo before hi), so matching is independent of posting order.

Definition at line 488 of file m_amr_state.fpp.f90.

◆ amr_band_restrict_l1

integer, parameter m_amr_state::amr_band_restrict_l1 = 6

Definition at line 488 of file m_amr_state.fpp.f90.

◆ amr_band_restrict_parent

integer, parameter m_amr_state::amr_band_restrict_parent = 7

Definition at line 488 of file m_amr_state.fpp.f90.

◆ amr_band_seam

integer, parameter m_amr_state::amr_band_seam = 5

Definition at line 488 of file m_amr_state.fpp.f90.

◆ amr_band_stage_fill

integer, parameter m_amr_state::amr_band_stage_fill = 3

Definition at line 488 of file m_amr_state.fpp.f90.

◆ amr_bat_loc

integer, dimension(amr_bat_max) m_amr_state::amr_bat_loc = 0

Batched advance: the bridge spans amr_br_batch blocks along the last active dimension, member i at offset (i-1)*amr_bat_w with its own ghost shell, so no block's stencil reaches another's interior. amr_bat_loc = members' flat-store columns (device-resident).

Definition at line 451 of file m_amr_state.fpp.f90.

◆ amr_br_batch

integer m_amr_state::amr_br_batch = 1

Blocks per batched s_compute_rhs call (amr_bat_max once initialized); bounded to avoid exhausting device memory.

Definition at line 469 of file m_amr_state.fpp.f90.

◆ amr_cg

type(scalar_field), dimension(:), allocatable m_amr_state::amr_cg

Definition at line 603 of file m_amr_state.fpp.f90.

◆ amr_cg_np

integer m_amr_state::amr_cg_np = 1

patches amr_cg holds, stacked along dim 3 (s_amr_cg_reserve)

Definition at line 600 of file m_amr_state.fpp.f90.

◆ amr_cg_nuse

integer m_amr_state::amr_cg_nuse = 0

patches the level-1 pool gather filled (s_amr_l1_pool_gather)

Definition at line 601 of file m_amr_state.fpp.f90.

◆ amr_cg_pz

integer, dimension(:), allocatable m_amr_state::amr_cg_pz

dim-3 offset of each owned level-1 box's patch in the pool

Definition at line 602 of file m_amr_state.fpp.f90.

◆ amr_child_idx

integer, dimension(:), allocatable m_amr_state::amr_child_idx

(amr_child_ptr(0) = 0)

Definition at line 518 of file m_amr_state.fpp.f90.

◆ amr_child_ptr

integer, dimension(:), allocatable m_amr_state::amr_child_ptr

children of p = amr_child_idx(amr_child_ptr(p-1)+1 : amr_child_ptr(p)), ascending

Definition at line 517 of file m_amr_state.fpp.f90.

◆ amr_cons_br

type(scalar_field), dimension(:), allocatable m_amr_state::amr_cons_br

Copy bridge to the shared solver, whose routines take type(scalar_field) and serve the monolithic path too (a pointer view into the flat store is not attachable on OpenMP offload): load from the store, call, store back, in both directions since the dummies are intent(inout). Not GPU_DECLARE'd: a declare binds the present-table entry to the descriptor that move_alloc then swaps out (CCE find_in_present_table failed); allocate via move_alloc + GPU_ENTER_DATA instead (CCE lib-4425 otherwise).

Definition at line 447 of file m_amr_state.fpp.f90.

◆ amr_cons_st

real(stp), dimension(:,:,:,:,:), allocatable m_amr_state::amr_cons_st

Flat per-block field store (x, y, z, var, local slot) so one kernel can run over every live block; all slots share the mbuf extents. Sized by s_amr_st_reserve.

Definition at line 410 of file m_amr_state.fpp.f90.

◆ amr_cpat_hi

integer, dimension(3) m_amr_state::amr_cpat_hi = 0

amr_cg upper local bounds per dim (0 in collapsed dims)

Definition at line 605 of file m_amr_state.fpp.f90.

◆ amr_cpat_mar

integer m_amr_state::amr_cpat_mar = 0

coarse-cell stencil reach (f_amr_cpat_mar)

Definition at line 604 of file m_amr_state.fpp.f90.

◆ amr_cpat_off

integer, dimension(3) m_amr_state::amr_cpat_off = 0

global coarse index of amr_cg local cell 0 (region_lo - amr_cpat_mar)

Definition at line 606 of file m_amr_state.fpp.f90.

◆ amr_fch_blk

integer, dimension(:), allocatable m_amr_state::amr_fch_blk

foreign children of my owned parents (level >= 2, powner == me, cowner /= me)

Definition at line 511 of file m_amr_state.fpp.f90.

◆ amr_fine_cut

integer(kind=8), dimension(:,:), allocatable m_amr_state::amr_fine_cut

(0:num_procs-1, 1:amr_max_level) SFC Morton-key upper bound per rank, one independent cost-weighted cut per level (owner = cut search, f_amr_owner); O(P) storage. Per level because same-level boxes have distinct Morton keys, which the binary search needs.

Definition at line 543 of file m_amr_state.fpp.f90.

◆ amr_fw_dev

logical m_amr_state::amr_fw_dev = .false.

Device-resident wire pools: with rdma_mpi MPI sends/receives them by device address, and the step-path kernels find them present, so slices do not cross PCIe per wave.

Definition at line 532 of file m_amr_state.fpp.f90.

◆ amr_fw_rblk

integer, dimension(:), allocatable m_amr_state::amr_fw_rblk

Definition at line 529 of file m_amr_state.fpp.f90.

◆ amr_fw_rq

real(wp), dimension(:), allocatable m_amr_state::amr_fw_rq

Definition at line 527 of file m_amr_state.fpp.f90.

◆ amr_fw_sq

real(wp), dimension(:), allocatable m_amr_state::amr_fw_sq

Wire pools of the pooled waves (m_amr_wave lays them out; contents never survive a wave). The fill and restrict waves share amr_fw_sq/rq; the seam wave is posted before the fills and drained after, so it has its own pair. The zero-copy reflux waves list their blocks in amr_fw_rblk.

Definition at line 527 of file m_amr_state.fpp.f90.

◆ amr_fx_pl

integer, dimension(:,:), allocatable m_amr_state::amr_fx_pl

Fused exchange packs (amr_device_pack): one row per wave transfer (slab corner (1:3), extents (4:6), payload offset in the wire pool (7); the child pack also has source store slot (8) and the child's patch frame (9:11)) plus the exclusive element prefix, so one kernel walks a family's transfers. Rebuilt per wave.

Definition at line 539 of file m_amr_state.fpp.f90.

◆ amr_fx_pre

integer, dimension(:), allocatable m_amr_state::amr_fx_pre

Definition at line 539 of file m_amr_state.fpp.f90.

◆ amr_gxcb

real(wp), dimension(:), allocatable m_amr_state::amr_gxcb

Global coarse cell-boundary arrays (-1:X_glb), assembled once at init; the fine-distribution owner rebuilds whole-block fine coordinates from them.

Definition at line 582 of file m_amr_state.fpp.f90.

◆ amr_gycb

real(wp), dimension(:), allocatable m_amr_state::amr_gycb

Definition at line 582 of file m_amr_state.fpp.f90.

◆ amr_gzcb

real(wp), dimension(:), allocatable m_amr_state::amr_gzcb

Definition at line 582 of file m_amr_state.fpp.f90.

◆ amr_ibp

real(stp), dimension(:,:,:,:,:), allocatable m_amr_state::amr_ibp

Moving bodies: the primitive state of the RHS pass of each block whose IB correction waits for the bodies to move (s_amr_fine_stage_ib), one column per such block, in the store's (x, y, z, var) layout.

Definition at line 425 of file m_amr_state.fpp.f90.

◆ amr_ibp_blk

integer, dimension(:), allocatable m_amr_state::amr_ibp_blk

the block of each amr_ibp column

Definition at line 438 of file m_amr_state.fpp.f90.

◆ amr_ibp_n

integer m_amr_state::amr_ibp_n = 0

columns in use this stage

Definition at line 439 of file m_amr_state.fpp.f90.

◆ amr_l1p_blk

integer, dimension(:), allocatable m_amr_state::amr_l1p_blk

padded variant (region +/- amr_cpat_mar vs my coarse range): stage-fill gather

Definition at line 508 of file m_amr_state.fpp.f90.

◆ amr_l1r_blk

integer, dimension(:), allocatable m_amr_state::amr_l1r_blk

Level-1 blocks this rank receives restriction for (not its own, overlapping its interior), rebuilt once per mesh epoch. Keyed on amr_mesh_epoch, not amr_myblk_dirty (owner writes only). Ownership here is amr_block_owner(k) == proc_rank, not the multi-owner amr_rank_owns_block.

Definition at line 507 of file m_amr_state.fpp.f90.

◆ amr_l1r_epoch

integer(8) m_amr_state::amr_l1r_epoch = -1_8

Definition at line 519 of file m_amr_state.fpp.f90.

◆ amr_l1r_nblk

integer m_amr_state::amr_l1r_nblk = -1

second key half, matching s_amr_reg_prepare's (epoch, num_blocks) pair

Definition at line 520 of file m_amr_state.fpp.f90.

◆ amr_loc_free

integer, dimension(:), allocatable m_amr_state::amr_loc_free

stack of recycled local indices

Definition at line 404 of file m_amr_state.fpp.f90.

◆ amr_loc_n

integer m_amr_state::amr_loc_n = 0

high-water mark of local indices handed out

Definition at line 405 of file m_amr_state.fpp.f90.

◆ amr_loc_nfree

integer m_amr_state::amr_loc_nfree = 0

depth of the recycle stack

Definition at line 406 of file m_amr_state.fpp.f90.

◆ amr_loc_of

integer, dimension(:), allocatable m_amr_state::amr_loc_of

Dense local index for live slots: amr_slots is sparse over 1:amr_max_blocks, the field store is dense. Freed indices are recycled through amr_loc_free.

global slot -> dense local index, 0 if not live

Definition at line 403 of file m_amr_state.fpp.f90.

◆ amr_maxc

integer, dimension(3) m_amr_state::amr_maxc

max coarse block cells per dim: (m_glb+1)/2 etc.; 1 for collapsed dims

Definition at line 470 of file m_amr_state.fpp.f90.

◆ amr_maxc_fit

integer, dimension(3) m_amr_state::amr_maxc_fit = 1

Regrid box size cap per dim (fixed for the run, identical on all ranks; 1 in collapsed dims): a box of at most min-over-ranks of (local extent + 1)/2 cells intersects every rank in at most (its extent + 1)/2 cells, so the per-rank scratch constraint 2*(isect cells) - 1 <= local extent holds by construction. Equals amr_maxc at np=1.

Definition at line 548 of file m_amr_state.fpp.f90.

◆ amr_my_blk

integer, dimension(:), allocatable m_amr_state::amr_my_blk

Block indices this rank owns, ascending (the paired MPI_SENDRECVs depend on the order); built in s_amr_assign_block_owners.

Definition at line 502 of file m_amr_state.fpp.f90.

◆ amr_myblk_dirty

logical m_amr_state::amr_myblk_dirty = .true.

Set wherever amr_block_owner is written (assigner, inheritance, restart/migration), so lists built from it never go stale.

Definition at line 522 of file m_amr_state.fpp.f90.

◆ amr_n_bands

integer, parameter m_amr_state::amr_n_bands = 8

Definition at line 490 of file m_amr_state.fpp.f90.

◆ amr_n_fch

integer m_amr_state::amr_n_fch = 0

Definition at line 512 of file m_amr_state.fpp.f90.

◆ amr_n_l1p

integer m_amr_state::amr_n_l1p = 0

Definition at line 509 of file m_amr_state.fpp.f90.

◆ amr_n_l1r

integer m_amr_state::amr_n_l1r = 0

Definition at line 510 of file m_amr_state.fpp.f90.

◆ amr_n_my

integer m_amr_state::amr_n_my = 0

Definition at line 503 of file m_amr_state.fpp.f90.

◆ amr_n_own

integer m_amr_state::amr_n_own = 0

Definition at line 514 of file m_amr_state.fpp.f90.

◆ amr_n_tsq

integer, dimension(2) m_amr_state::amr_n_tsq = 0

Definition at line 495 of file m_amr_state.fpp.f90.

◆ amr_num_seam_pairs

integer m_amr_state::amr_num_seam_pairs

Definition at line 479 of file m_amr_state.fpp.f90.

◆ amr_ovl_gather

integer, dimension(:,:), allocatable m_amr_state::amr_ovl_gather

cached per-block P2P overlap-rank lists, rebuilt with the seam list: amr_ovl_gather(:,k) = ranks whose owned coarse range meets block k's padded patch box; amr_ovl_scatter(:,k) = ranks whose coarse interior meets k's region box. Rank-ascending and not owner-excluded, so iterating gives the same MPI order as a 0..num_procs-1 scan. (max-overlap, amr_max_blocks); sized in s_amr_build_seam_pairs

Definition at line 500 of file m_amr_state.fpp.f90.

◆ amr_ovl_gather_n

integer, dimension(:), allocatable m_amr_state::amr_ovl_gather_n

Definition at line 523 of file m_amr_state.fpp.f90.

◆ amr_ovl_scatter

integer, dimension(:,:), allocatable m_amr_state::amr_ovl_scatter

Definition at line 500 of file m_amr_state.fpp.f90.

◆ amr_ovl_scatter_n

integer, dimension(:), allocatable m_amr_state::amr_ovl_scatter_n

per-block list lengths

Definition at line 523 of file m_amr_state.fpp.f90.

◆ amr_own_blk

integer, dimension(:), allocatable m_amr_state::amr_own_blk

blocks this rank intersects (amr_owns_all, the multi-owner notion, all levels)

Definition at line 513 of file m_amr_state.fpp.f90.

◆ amr_parent_blk

integer, dimension(:), allocatable m_amr_state::amr_parent_blk

cached f_amr_parent_block (0 for level <= 1), avoiding an O(global blocks) scan per block per stage

Definition at line 516 of file m_amr_state.fpp.f90.

◆ amr_pc

real(stp), dimension(:), allocatable m_amr_state::amr_pc

Subcycling patch cache: the pooled level-1 patches (amr_cg, amr_cg_nuse patches) at the step start (time level 0) then the step end (1), each flat with g1 fastest, then g2, g3, variable.

Definition at line 611 of file m_amr_state.fpp.f90.

◆ amr_rf_rq

real(wp), dimension(:), allocatable m_amr_state::amr_rf_rq

device-resident pools of the packed reflux-faces wave

Definition at line 528 of file m_amr_state.fpp.f90.

◆ amr_rf_sq

real(wp), dimension(:), allocatable m_amr_state::amr_rf_sq

Definition at line 528 of file m_amr_state.fpp.f90.

◆ amr_scr_prim

type(scalar_field), dimension(:), allocatable m_amr_state::amr_scr_prim

Pooled advance scratch shared by every fine block (the fused advance leaves no cross-block lifetime); same pattern as amr_cg.

Definition at line 465 of file m_amr_state.fpp.f90.

◆ amr_scr_prim_blk

type(scalar_field), dimension(:), allocatable m_amr_state::amr_scr_prim_blk

block-frame prim scratch for the batched per-member IB correction (ib only); the slab prim stacks members along amr_bat_sd

Definition at line 467 of file m_amr_state.fpp.f90.

◆ amr_scr_rhs

type(scalar_field), dimension(:), allocatable m_amr_state::amr_scr_rhs

Definition at line 465 of file m_amr_state.fpp.f90.

◆ amr_seam_pairs

integer, dimension(:,:), allocatable m_amr_state::amr_seam_pairs

cached same-level seam list (xb, yb, seam-dim) so s_amr_fine_fine_post iterates O(#seams); rebuilt when amr_seam_pairs_dirty is set or the block count changes

Definition at line 478 of file m_amr_state.fpp.f90.

◆ amr_seam_pairs_dirty

logical m_amr_state::amr_seam_pairs_dirty

Definition at line 480 of file m_amr_state.fpp.f90.

◆ amr_seam_pairs_nblk

integer m_amr_state::amr_seam_pairs_nblk

Definition at line 479 of file m_amr_state.fpp.f90.

◆ amr_slab_n

integer m_amr_state::amr_slab_n = 0

rows queued in amr_slab_tab (s_amr_slab_add)

Definition at line 599 of file m_amr_state.fpp.f90.

◆ amr_slab_tab

integer, dimension(:,:), allocatable m_amr_state::amr_slab_tab

Per-block gathered coarse patch: the owner may not hold the coarse cells its block refines, so before each prolongation/ghost fill the patch region_lo-amr_cpat_mar : region_hi+amr_cpat_mar is gathered point-to-point into amr_cg (stp scalar_fields, block-local frame: cell 0 = global coarse cell amr_cpat_off(d)). Messages carry wp cast to stp, so at np=1 the patch equals the local coarse read bitwise. Sized to the largest block. amr_slab_tab: device-resident slab table for the shell/ghost kernels, rows lo(1:3),hi(1:3),soff,scnt over <= 6 slabs, refreshed by one GPU_UPDATE per launch.

Definition at line 598 of file m_amr_state.fpp.f90.

◆ amr_slot_live

logical, dimension(:), allocatable m_amr_state::amr_slot_live

Definition at line 475 of file m_amr_state.fpp.f90.

◆ amr_slots

type(t_level), dimension(:), allocatable m_amr_state::amr_slots

Fixed pool of refined-block slots; the working slot amr_cur selects which one per-block routines operate on.

Definition at line 399 of file m_amr_state.fpp.f90.

◆ amr_st_cap

integer m_amr_state::amr_st_cap = 0

local slots the store is sized for; grows only (s_amr_compact_store keeps the index space dense)

Definition at line 441 of file m_amr_state.fpp.f90.

◆ amr_stor_st

real(stp), dimension(:,:,:,:,:), allocatable m_amr_state::amr_stor_st

Definition at line 410 of file m_amr_state.fpp.f90.

◆ amr_sw_nsame

integer m_amr_state::amr_sw_nsame = 0

seam pairs both of whose blocks this rank owns: exchanged by one batched kernel at drain, no wire

Definition at line 534 of file m_amr_state.fpp.f90.

◆ amr_sw_pd

integer, dimension(:), allocatable m_amr_state::amr_sw_pd

Definition at line 535 of file m_amr_state.fpp.f90.

◆ amr_sw_pfm

integer, dimension(:,:), allocatable m_amr_state::amr_sw_pfm

Definition at line 535 of file m_amr_state.fpp.f90.

◆ amr_sw_plx

integer, dimension(:), allocatable m_amr_state::amr_sw_plx

Definition at line 535 of file m_amr_state.fpp.f90.

◆ amr_sw_ply

integer, dimension(:), allocatable m_amr_state::amr_sw_ply

Definition at line 535 of file m_amr_state.fpp.f90.

◆ amr_sw_pxhi

integer, dimension(:), allocatable m_amr_state::amr_sw_pxhi

Definition at line 535 of file m_amr_state.fpp.f90.

◆ amr_sw_rq

real(wp), dimension(:), allocatable m_amr_state::amr_sw_rq

Definition at line 527 of file m_amr_state.fpp.f90.

◆ amr_sw_sq

real(wp), dimension(:), allocatable m_amr_state::amr_sw_sq

Definition at line 527 of file m_amr_state.fpp.f90.

◆ amr_swap_depth

integer m_amr_state::amr_swap_depth = 0

Swap nesting depth: only the outermost swap saves the coarse state and only its restore puts it back; inner swaps re-install, inner restores are no-ops.

Definition at line 579 of file m_amr_state.fpp.f90.

◆ amr_tag_base

integer m_amr_state::amr_tag_base = 0

Definition at line 491 of file m_amr_state.fpp.f90.

◆ amr_tag_gen

integer, dimension(0:amr_n_bands - 1) m_amr_state::amr_tag_gen = 0

Definition at line 492 of file m_amr_state.fpp.f90.

◆ amr_tag_narrow

integer m_amr_state::amr_tag_narrow = 0

Tag base of the clusterer's narrow-node reductions, above the per-box tag space [1..amr_max_blocks]; checked against MPI_TAG_UB at init.

Definition at line 484 of file m_amr_state.fpp.f90.

◆ amr_tsq

integer, dimension(:,:), allocatable m_amr_state::amr_tsq

(0:np-1, dir) in-wave per-peer seq counters; touched-reset

Definition at line 493 of file m_amr_state.fpp.f90.

◆ amr_tsq_tch

integer, dimension(:,:), allocatable m_amr_state::amr_tsq_tch

touched peers per dir, so the reset is O(active peers), not O(P)

Definition at line 494 of file m_amr_state.fpp.f90.

◆ amr_wcur

integer m_amr_state::amr_wcur = 1

consume cursor into the open fill wave's receive transfers (box-major)

Definition at line 607 of file m_amr_state.fpp.f90.

◆ amr_xchg_bad

integer m_amr_state::amr_xchg_bad = 0

local accumulator behind amr_xchg_coarse_ghosts; s_amr_reduce_xchg_flag does one allreduce per scan

Definition at line 591 of file m_amr_state.fpp.f90.

◆ amr_xchg_coarse_ghosts

logical m_amr_state::amr_xchg_coarse_ghosts = .false.

True (identically on all ranks) iff some rank's fine ghost fill reads its coarse ghost cells: the solver populates only prim ghosts, so the cons ghosts must be halo-exchanged first. Never true at np=1.

Definition at line 589 of file m_amr_state.fpp.f90.

◆ max_f

integer, dimension(3) m_amr_state::max_f

Per-slot sizing: max fine cells per dim and the buffered array bounds. amr_slot_live(k): slot k's field arrays are allocated (lazy, owned-only).

Definition at line 474 of file m_amr_state.fpp.f90.

◆ mbuf_hi

integer, dimension(3) m_amr_state::mbuf_hi

Definition at line 474 of file m_amr_state.fpp.f90.

◆ mbuf_lo

integer, dimension(3) m_amr_state::mbuf_lo

Definition at line 474 of file m_amr_state.fpp.f90.

◆ sw_acoustic_source

logical m_amr_state::sw_acoustic_source

Definition at line 559 of file m_amr_state.fpp.f90.

◆ sw_dx

real(wp), dimension(:), allocatable m_amr_state::sw_dx

Definition at line 583 of file m_amr_state.fpp.f90.

◆ sw_dy

real(wp), dimension(:), allocatable m_amr_state::sw_dy

Definition at line 584 of file m_amr_state.fpp.f90.

◆ sw_dz

real(wp), dimension(:), allocatable m_amr_state::sw_dz

Definition at line 585 of file m_amr_state.fpp.f90.

◆ sw_idwbuff

type(int_bounds_info), dimension(3) m_amr_state::sw_idwbuff

Definition at line 558 of file m_amr_state.fpp.f90.

◆ sw_idwint

type(int_bounds_info), dimension(3) m_amr_state::sw_idwint

Definition at line 558 of file m_amr_state.fpp.f90.

◆ sw_jac

real(wp), dimension(:,:,:), allocatable m_amr_state::sw_jac

IGR sigma-state bounce: the fine solve reuses jac/jac_old at fine indices, so the coarse contents (jac_old is the Jacobi warm start) are saved here across the fine advance.

Definition at line 563 of file m_amr_state.fpp.f90.

◆ sw_jac_old

real(wp), dimension(:,:,:), allocatable m_amr_state::sw_jac_old

Definition at line 563 of file m_amr_state.fpp.f90.

◆ sw_m

integer m_amr_state::sw_m

Swap contract (s_amr_swap_to_fine / s_amr_restore_coarse): the fine advance swaps these coarse globals to the block's values and restores after: m/n/p, idwint/idwbuff, the nine coordinate arrays (sw_x_cb..sw_dz), acoustic_source; WENO/hypoelastic/IGR spacing coefficients are recomputed instead. Any new module-level state derived from m/n/p/idwint/idwbuff/coords that a kernel reads on the fine grid must be swapped here or refreshed per fine call, including its device copy (a stale device copy reads out of range under CCE OpenACC; cv_int is refreshed by a per-call GPU_UPDATE in s_compute_rhs). amr_swap_depth makes the swap re-entrant and guards an unpaired restore. Saved coarse-level global state for swap/restore.

Definition at line 557 of file m_amr_state.fpp.f90.

◆ sw_n

integer m_amr_state::sw_n

Definition at line 557 of file m_amr_state.fpp.f90.

◆ sw_p

integer m_amr_state::sw_p

Definition at line 557 of file m_amr_state.fpp.f90.

◆ sw_x_cb

real(wp), dimension(:), allocatable m_amr_state::sw_x_cb

Definition at line 583 of file m_amr_state.fpp.f90.

◆ sw_x_cc

real(wp), dimension(:), allocatable m_amr_state::sw_x_cc

Definition at line 583 of file m_amr_state.fpp.f90.

◆ sw_y_cb

real(wp), dimension(:), allocatable m_amr_state::sw_y_cb

Definition at line 584 of file m_amr_state.fpp.f90.

◆ sw_y_cc

real(wp), dimension(:), allocatable m_amr_state::sw_y_cc

Definition at line 584 of file m_amr_state.fpp.f90.

◆ sw_z_cb

real(wp), dimension(:), allocatable m_amr_state::sw_z_cb

Definition at line 585 of file m_amr_state.fpp.f90.

◆ sw_z_cc

real(wp), dimension(:), allocatable m_amr_state::sw_z_cc

Definition at line 585 of file m_amr_state.fpp.f90.