alloc_geometry Subroutine

private subroutine alloc_geometry(geo, ixGmin1, ixGmin2, ixGmin3, ixGmax1, ixGmax2, ixGmax3, ixGextmin1, ixGextmin2, ixGextmin3, ixGextmax1, ixGextmax2, ixGextmax3)

Uses

  • proc~~alloc_geometry~~UsesGraph proc~alloc_geometry alloc_geometry module~mod_global_parameters mod_global_parameters proc~alloc_geometry->module~mod_global_parameters module~mod_physicaldata mod_physicaldata proc~alloc_geometry->module~mod_physicaldata module~mod_global_parameters->module~mod_physicaldata module~mod_basic_types mod_basic_types module~mod_global_parameters->module~mod_basic_types module~mod_connectivity mod_connectivity module~mod_global_parameters->module~mod_connectivity module~mod_constants mod_constants module~mod_global_parameters->module~mod_constants module~mod_variables mod_variables module~mod_global_parameters->module~mod_variables mpi mpi module~mod_global_parameters->mpi module~mod_variables->module~mod_basic_types

Allocate the cell metrics of all max_blocks blocks in one go. The ixGext range is the one over which dvolume and ds are known, the face areas start one cell lower than ixG in every direction.

Arguments

Type IntentOptional Attributes Name
type(geo_t), intent(inout) :: geo
integer, intent(in) :: ixGmin1
integer, intent(in) :: ixGmin2
integer, intent(in) :: ixGmin3
integer, intent(in) :: ixGmax1
integer, intent(in) :: ixGmax2
integer, intent(in) :: ixGmax3
integer, intent(in) :: ixGextmin1
integer, intent(in) :: ixGextmin2
integer, intent(in) :: ixGextmin3
integer, intent(in) :: ixGextmax1
integer, intent(in) :: ixGextmax2
integer, intent(in) :: ixGextmax3

Called by

proc~~alloc_geometry~~CalledByGraph proc~alloc_geometry alloc_geometry proc~initialize_vars initialize_vars proc~initialize_vars->proc~alloc_geometry proc~initialize_amrvac initialize_amrvac proc~initialize_amrvac->proc~initialize_vars proc~main main proc~main->proc~initialize_amrvac program~agile agile program~agile->proc~main

Source Code

  subroutine alloc_geometry(geo, ixGmin1,ixGmin2,ixGmin3, ixGmax1,ixGmax2,&
       ixGmax3, ixGextmin1,ixGextmin2,ixGextmin3, ixGextmax1,ixGextmax2,&
       ixGextmax3)
    use mod_physicaldata, only: geo_t
    use mod_global_parameters, only: max_blocks, ndim

    type(geo_t), intent(inout) :: geo
    integer, intent(in)        :: ixGmin1,ixGmin2,ixGmin3,ixGmax1,ixGmax2,&
       ixGmax3, ixGextmin1,ixGextmin2,ixGextmin3,ixGextmax1,ixGextmax2,&
       ixGextmax3

    allocate( geo%x(ixGmin1:ixGmax1,ixGmin2:ixGmax2,ixGmin3:ixGmax3, 1:ndim,&
         1:max_blocks) )

    ! Everything past the positions is left unallocated in a Cartesian build.
    ! Nothing there reads it: the kernels that would (mod_finite_volume's flux
    ! divergence, mod_dt's cell sizes) are fypp-specialized and take their
    ! values from rnode instead, the AMR paths that would (prolong_2nd,
    ! coarsen_grid) sit in .not.slab_uniform branches that cannot run when
    ! GEOM is Cartesian, and get_volume_average has a slab branch.  The
    ! components stay declared in geo_t so that all of it still compiles; the
    ! matching state views are left unassociated by point_at_geometry, so a
    ! host reader that slips through faults instead of reading nonsense.
    !
    ! It is worth this much care because these are block-sized arrays for all
    ! max_blocks blocks a rank could ever own, allocated whether or not the
    ! blocks exist: on a 12 GB card, max_blocks = 4096 with block_nx = 16 is
    ! the difference between ~0.9 GB and ~4.1 GB of them.

  end subroutine alloc_geometry