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.
| Type | Intent | Optional | 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 |
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