mod_fix_conserve Module

Module for flux conservation near refinement boundaries


Uses

  • module~~mod_fix_conserve~~UsesGraph module~mod_fix_conserve mod_fix_conserve module~mod_mpi_wrapper mod_mpi_wrapper module~mod_fix_conserve->module~mod_mpi_wrapper mpi mpi module~mod_mpi_wrapper->mpi

Used by

  • module~~mod_fix_conserve~~UsedByGraph module~mod_fix_conserve mod_fix_conserve proc~advect advect proc~advect->module~mod_fix_conserve proc~advect1 advect1 proc~advect1->module~mod_fix_conserve proc~fake_advance fake_advance proc~fake_advance->module~mod_fix_conserve proc~finite_volume_local_muscl_hll finite_volume_local_muscl_hll proc~finite_volume_local_muscl_hll->module~mod_fix_conserve proc~finite_volume_local_muscl_hllc finite_volume_local_muscl_hllc proc~finite_volume_local_muscl_hllc->module~mod_fix_conserve proc~finite_volume_local_muscl_hllc~2 finite_volume_local_muscl_hllc proc~finite_volume_local_muscl_hllc~2->module~mod_fix_conserve proc~finite_volume_local_muscl_hllc~3 finite_volume_local_muscl_hllc proc~finite_volume_local_muscl_hllc~3->module~mod_fix_conserve proc~finite_volume_local_muscl_hllc~4 finite_volume_local_muscl_hllc proc~finite_volume_local_muscl_hllc~4->module~mod_fix_conserve proc~finite_volume_local_muscl_hll~2 finite_volume_local_muscl_hll proc~finite_volume_local_muscl_hll~2->module~mod_fix_conserve proc~finite_volume_local_muscl_hll~3 finite_volume_local_muscl_hll proc~finite_volume_local_muscl_hll~3->module~mod_fix_conserve proc~finite_volume_local_muscl_hll~4 finite_volume_local_muscl_hll proc~finite_volume_local_muscl_hll~4->module~mod_fix_conserve proc~finite_volume_local_muscl_llf finite_volume_local_muscl_llf proc~finite_volume_local_muscl_llf->module~mod_fix_conserve proc~finite_volume_local_muscl_llf~2 finite_volume_local_muscl_llf proc~finite_volume_local_muscl_llf~2->module~mod_fix_conserve proc~finite_volume_local_muscl_llf~3 finite_volume_local_muscl_llf proc~finite_volume_local_muscl_llf~3->module~mod_fix_conserve proc~finite_volume_local_muscl_llf~4 finite_volume_local_muscl_llf proc~finite_volume_local_muscl_llf~4->module~mod_fix_conserve proc~initialize_vars initialize_vars proc~initialize_vars->module~mod_fix_conserve proc~main main proc~main->module~mod_fix_conserve proc~recalculateb recalculateB proc~recalculateb->module~mod_fix_conserve proc~resettree resettree proc~resettree->module~mod_fix_conserve proc~settree settree proc~settree->module~mod_fix_conserve

Variables

Type Visibility Attributes Name Initial
type(fluxalloc), public, dimension(:,:), allocatable :: pflux

store flux to fix conservation

integer, private, dimension(:), allocatable :: cc_recvreq
integer, private, dimension(:,:), allocatable :: cc_recvstat
integer, private, dimension(:), allocatable :: cc_sendreq
integer, private, dimension(:,:), allocatable :: cc_sendstat
integer, private, dimension(:), allocatable :: fc_recvreq
integer, private, save :: fc_recvsize

Extent of recvbuffer / sendbuffer actually used by the current exchange. The buffers are grown and never shrunk, so size() can exceed this, and the host/device transfers have to be sliced by it rather than moving the whole array.

integer, private, dimension(:,:), allocatable :: fc_recvstat
integer, private, dimension(:), allocatable :: fc_sendreq
integer, private, save :: fc_sendsize

Extent of recvbuffer / sendbuffer actually used by the current exchange. The buffers are grown and never shrunk, so size() can exceed this, and the host/device transfers have to be sliced by it rather than moving the whole array.

integer, private, dimension(:,:), allocatable :: fc_sendstat
integer, private :: ibuf
integer, private :: ibuf_cc
integer, private :: ibuf_cc_send
integer, private, allocatable, save :: ibuf_offset(:)
integer, private :: ibuf_send
integer, private :: irecv
integer, private :: irecv_cc
integer, private :: isend
integer, private :: isend_cc
integer, private, dimension(3), save :: isize
integer, private, dimension(3), save :: isize_stg
integer, private :: itag
integer, private :: itag_cc
integer, private, save :: n_recv_pe
integer, private, save :: n_send_pe
integer, private, save :: nrecv
integer, private, save :: nrecv_ct
integer, private, save :: nsend
integer, private, save :: nsend_ct
integer, private, save :: nwflux_fc
integer, private, dimension(3,3), save :: nxCo_fc
integer, private, allocatable, save :: rcv_dims(:)
integer, private, allocatable, save :: rcv_key(:)
integer, private, allocatable, save :: rcv_off(:)
integer, private, allocatable, save :: rcv_src(:)
integer, private, allocatable, save :: recv_pe(:)
integer, private, allocatable, save :: recv_pe_len(:)
integer, private, allocatable, save :: recv_pe_off(:)
double precision, private, allocatable, save :: recvbuffer(:)
double precision, private, allocatable, save :: recvbuffer_cc(:)
integer, private, allocatable, save :: send_pe(:)
integer, private, allocatable, save :: send_pe_len(:)
integer, private, allocatable, save :: send_pe_off(:)
double precision, private, allocatable, save :: sendbuffer(:)
double precision, private, allocatable, save :: sendbuffer_cc(:)
integer, private, allocatable, save :: snd_dest(:)
integer, private, allocatable, save :: snd_dims(:)
integer, private, allocatable, save :: snd_group(:,:,:)
integer, private, allocatable, save :: snd_ibuf(:)
integer, private, allocatable, save :: snd_igrid(:)
integer, private, allocatable, save :: snd_key(:)
integer, private, save :: snd_ngroup(2,3)

Derived Types

type, private ::  fluxalloc

Components

Type Visibility Attributes Name Initial
double precision, public, dimension(:,:,:,:,:), allocatable :: flux

Subroutines

public subroutine fix_conserve(bgstep, idimmin, idimmax, nw0, nwfluxin)

Correct the coarse cells abutting a refinement boundary: take out the coarse face flux the update used and put back the sum of the fine ones.

Read more…

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: bgstep
integer, intent(in) :: idimmin
integer, intent(in) :: idimmax
integer, intent(in) :: nw0
integer, intent(in) :: nwfluxin

public subroutine fix_edges(psuse, idimmin, idimmax)

Arguments

Type IntentOptional Attributes Name
type(state) :: psuse(max_blocks)
integer, intent(in) :: idimmin
integer, intent(in) :: idimmax

public subroutine init_comm_fix_conserve(idimmin, idimmax, nwfluxin)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: idimmin
integer, intent(in) :: idimmax
integer, intent(in) :: nwfluxin

public subroutine recvflux(idimmin, idimmax)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: idimmin
integer, intent(in) :: idimmax

public subroutine sendflux(idimmin, idimmax)

Pack the outgoing flux chunks and post one message per peer. Where each chunk goes was decided by build_message_layout; nothing here walks the tree.

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: idimmin
integer, intent(in) :: idimmax

public subroutine store_edge(igrid, ixImin1, ixImin2, ixImin3, ixImax1, ixImax2, ixImax3, fE, idimmin, idimmax)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: igrid
integer, intent(in) :: ixImin1
integer, intent(in) :: ixImin2
integer, intent(in) :: ixImin3
integer, intent(in) :: ixImax1
integer, intent(in) :: ixImax2
integer, intent(in) :: ixImax3
double precision, intent(in) :: fE(ixImin1:ixImax1,ixImin2:ixImax2,ixImin3:ixImax3,sdim:3)
integer, intent(in) :: idimmin
integer, intent(in) :: idimmax

public subroutine store_flux(igrid, fC, idimmin, idimmax, nwfluxin)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: igrid
double precision, intent(in) :: fC(ixGlo1:ixGhi1,ixGlo2:ixGhi2,ixGlo3:ixGhi3,1:nwfluxin,1:ndim)
integer, intent(in) :: idimmin
integer, intent(in) :: idimmax
integer, intent(in) :: nwfluxin

private subroutine add_sub_circ(ixFmin1, ixFmin2, ixFmin3, ixFmax1, ixFmax2, ixFmax3, ixtEmin1, ixtEmin2, ixtEmin3, ixtEmax1, ixtEmax2, ixtEmax3, ixEmin1, ixEmin2, ixEmin3, ixEmax1, ixEmax2, ixEmax3, ixfEmin1, ixfEmin2, ixfEmin3, ixfEmax1, ixfEmax2, ixfEmax3, edge, idims, iside, add, s)

Arguments

Type IntentOptional Attributes Name
integer :: ixFmin1(1:ndim)
integer :: ixFmin2(1:ndim)
integer :: ixFmin3(1:ndim)
integer :: ixFmax1(1:ndim)
integer :: ixFmax2(1:ndim)
integer :: ixFmax3(1:ndim)
integer :: ixtEmin1
integer :: ixtEmin2
integer :: ixtEmin3
integer :: ixtEmax1
integer :: ixtEmax2
integer :: ixtEmax3
integer :: ixEmin1(1:3)
integer :: ixEmin2(1:3)
integer :: ixEmin3(1:3)
integer :: ixEmax1(1:3)
integer :: ixEmax2(1:3)
integer :: ixEmax3(1:3)
integer :: ixfEmin1(1:3)
integer :: ixfEmin2(1:3)
integer :: ixfEmin3(1:3)
integer :: ixfEmax1(1:3)
integer :: ixfEmax2(1:3)
integer :: ixfEmax3(1:3)
double precision :: edge(ixtEmin1:ixtEmax1,ixtEmin2:ixtEmax2,ixtEmin3:ixtEmax3,1:ndim-1)
integer, intent(in) :: idims
integer, intent(in) :: iside
logical, intent(in) :: add
type(state) :: s

private subroutine build_message_layout(idimmin, idimmax)

Enumerate every chunk this rank sends and receives, and lay each peer's chunks out as one contiguous run of the exchange buffer. Fills snd_igrid / snd_ibuf / snd_group for the pack kernels, ibuf_offset for fix_conserve, and the send_pe_ / recv_pe_ runs for the MPI calls.

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: idimmin
integer, intent(in) :: idimmax

private subroutine flux_to_edge(igrid, ixImin1, ixImin2, ixImin3, ixImax1, ixImax2, ixImax3, idims, iside, restrict, fE)

Arguments

Type IntentOptional Attributes Name
integer :: igrid
integer :: ixImin1
integer :: ixImin2
integer :: ixImin3
integer :: ixImax1
integer :: ixImax2
integer :: ixImax3
integer :: idims
integer :: iside
logical :: restrict
double precision, intent(in) :: fE(ixImin1:ixImax1,ixImin2:ixImax2,ixImin3:ixImax3,sdim:3)

private subroutine set_ix_circ(ixFmin1, ixFmin2, ixFmin3, ixFmax1, ixFmax2, ixFmax3, ixtEmin1, ixtEmin2, ixtEmin3, ixtEmax1, ixtEmax2, ixtEmax3, ixEmin1, ixEmin2, ixEmin3, ixEmax1, ixEmax2, ixEmax3, ixfEmin1, ixfEmin2, ixfEmin3, ixfEmax1, ixfEmax2, ixfEmax3, igrid, idims, iside, add, CoCorner, inc1, inc2, inc3, pcorner, mcorner)

This routine sets the indexes for the correction of the circulation according to several different cases, as grids located in different cpus, presence of corners, and different relative locations of the fine grid respect to the coarse one

Arguments

Type IntentOptional Attributes Name
integer, intent(out) :: ixFmin1(1:ndim)
integer, intent(out) :: ixFmin2(1:ndim)
integer, intent(out) :: ixFmin3(1:ndim)
integer, intent(out) :: ixFmax1(1:ndim)
integer, intent(out) :: ixFmax2(1:ndim)
integer, intent(out) :: ixFmax3(1:ndim)
integer, intent(out) :: ixtEmin1
integer, intent(out) :: ixtEmin2
integer, intent(out) :: ixtEmin3
integer, intent(out) :: ixtEmax1
integer, intent(out) :: ixtEmax2
integer, intent(out) :: ixtEmax3
integer, intent(out) :: ixEmin1(1:3)
integer, intent(out) :: ixEmin2(1:3)
integer, intent(out) :: ixEmin3(1:3)
integer, intent(out) :: ixEmax1(1:3)
integer, intent(out) :: ixEmax2(1:3)
integer, intent(out) :: ixEmax3(1:3)
integer, intent(out) :: ixfEmin1(1:3)
integer, intent(out) :: ixfEmin2(1:3)
integer, intent(out) :: ixfEmin3(1:3)
integer, intent(out) :: ixfEmax1(1:3)
integer, intent(out) :: ixfEmax2(1:3)
integer, intent(out) :: ixfEmax3(1:3)
integer, intent(in) :: igrid
integer, intent(in) :: idims
integer, intent(in) :: iside
logical, intent(in) :: add
logical, intent(in) :: CoCorner
integer, intent(in) :: inc1
integer, intent(in) :: inc2
integer, intent(in) :: inc3
logical, intent(inout) :: pcorner(1:ndim)
logical, intent(inout) :: mcorner(1:ndim)