| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| real(kind=wp), | public | :: | dx | = | 0.0_wp |
Cell size in x (m) |
|
| real(kind=wp), | public | :: | dy | = | 0.0_wp |
Cell size in y (m) |
|
| integer, | public | :: | i_offset_global | = | 0 |
Global index offset for this subdomain: i_global = i_phys_local + i_offset_global (0 on a single-rank / undecomposed grid — formula fills must add this when converting a local loop index to a physical coordinate) |
|
| integer, | public | :: | j_offset_global | = | 0 |
Global index offset in y (see i_offset_global) |
|
| integer, | public | :: | nghost | = | 2 |
Ghost cell width on each side |
|
| integer, | public | :: | nx_global | = | 0 |
GLOBAL physical (interior) cells in x, i.e. the undecomposed
domain extent. Equals Why this lives on the grid: every formula fill (bathymetry
setter, IC seeder) that normalises a position by the domain
size, or centres a feature on the domain, needs the GLOBAL
extent. These used to take |
|
| integer, | public | :: | nx_phys | = | 0 |
Physical (interior) cells in x |
|
| integer, | public | :: | nx_total | = | 0 |
Total cells in x including ghosts (nx_phys + 2*nghost) |
|
| integer, | public | :: | ny_global | = | 0 |
GLOBAL physical (interior) cells in y (see nx_global) |
|
| integer, | public | :: | ny_phys | = | 0 |
Physical (interior) cells in y |
|
| integer, | public | :: | ny_total | = | 0 |
Total cells in y including ghosts |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(hgrid_t), | intent(inout) | :: | this | |||
| integer, | intent(in) | :: | nx_phys | |||
| integer, | intent(in) | :: | ny_phys | |||
| integer, | intent(in) | :: | nghost | |||
| real(kind=wp), | intent(in) | :: | dx | |||
| real(kind=wp), | intent(in) | :: | dy |
type :: hgrid_t integer :: nx_total = 0 !! Total cells in x including ghosts (nx_phys + 2*nghost) integer :: ny_total = 0 !! Total cells in y including ghosts integer :: nx_phys = 0 !! Physical (interior) cells in x integer :: ny_phys = 0 !! Physical (interior) cells in y integer :: nghost = 2 !! Ghost cell width on each side real(wp) :: dx = 0.0_wp !! Cell size in x (m) real(wp) :: dy = 0.0_wp !! Cell size in y (m) integer :: i_offset_global = 0 !! Global index offset for this subdomain: i_global = i_phys_local + i_offset_global !! (0 on a single-rank / undecomposed grid — formula fills must add this !! when converting a local loop index to a physical coordinate) integer :: j_offset_global = 0 !! Global index offset in y (see i_offset_global) integer :: nx_global = 0 !! GLOBAL physical (interior) cells in x, i.e. the undecomposed !! domain extent. Equals `nx_phys` on a single rank; under MPI it !! is the sum over the rank row. !! !! Why this lives on the grid: every formula fill (bathymetry !! setter, IC seeder) that normalises a position by the domain !! size, or centres a feature on the domain, needs the GLOBAL !! extent. These used to take `nx_global`/`ny_global` (and the !! offsets) as OPTIONAL dummy arguments defaulting to the LOCAL !! `nx_phys`/`ny_phys` — so a fill that simply forgot to pass them !! compiled fine and silently rebuilt the whole pattern inside !! each rank's tile. That defect shipped three times. Carrying !! the global extents here, alongside `i_offset_global` / !! `j_offset_global`, makes the correct value the only value a !! fill can read: there is no argument left to forget. integer :: ny_global = 0 !! GLOBAL physical (interior) cells in y (see nx_global) contains procedure, non_overridable :: init => grid_init end type hgrid_t