max() over every rule that applies to the given scheme
selection — the minimum nghost a grid must carry. Every argument
is optional; an absent selector contributes its BASELINE (2, the
centered/PPM/non-periodic/single-rank floor), an absent logical
contributes nothing (as if .false.).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in), | optional | :: | pv_adv_scheme |
|
|
| character(len=*), | intent(in), | optional | :: | tracer_recon |
|
|
| logical, | intent(in), | optional | :: | periodic |
|
|
| logical, | intent(in), | optional | :: | tripolar_fold |
|
|
| logical, | intent(in), | optional | :: | decomposed |
|
|
| logical, | intent(in), | optional | :: | kappa_shear_at_vertex |
|
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| character(len=:), | private, | allocatable | :: | pv_s | |||
| character(len=:), | private, | allocatable | :: | tr_s |
pure function required_halo(pv_adv_scheme, tracer_recon, periodic, & tripolar_fold, decomposed, kappa_shear_at_vertex) result(ng) !! `max()` over every rule that applies to the given scheme !! selection — the minimum `nghost` a grid must carry. Every argument !! is optional; an absent selector contributes its BASELINE (2, the !! centered/PPM/non-periodic/single-rank floor), an absent logical !! contributes nothing (as if `.false.`). character(len=*), intent(in), optional :: pv_adv_scheme !! `&ocean_coriolis_nml pv_adv_scheme` string ("centered", "weno3", !! "weno5", "weno7"). Unrecognised/absent -> baseline (2). character(len=*), intent(in), optional :: tracer_recon !! `&ocean_tracers_nml recon`-style string ("ppm", "weno5", !! "weno7", "weno9"). Unrecognised/absent -> baseline (2). logical, intent(in), optional :: periodic !! `.true.` if EITHER grid axis is periodic (rule 4). logical, intent(in), optional :: tripolar_fold !! `.true.` for a tripolar north-fold grid (rule 5). logical, intent(in), optional :: decomposed !! `.true.` for a multi-rank (MPI-decomposed) run (rule 6). logical, intent(in), optional :: kappa_shear_at_vertex !! `.true.` when `&ocean_kappa_shear_nml at_vertex = .true.`. integer :: ng character(len=:), allocatable :: pv_s, tr_s pv_s = "" if (present(pv_adv_scheme)) pv_s = trim(pv_adv_scheme) tr_s = "" if (present(tracer_recon)) tr_s = trim(tracer_recon) ng = REQUIRED_HALO_FLOOR ng = max(ng, pv_adv_required_nghost(parse_pv_adv_scheme(pv_s))) ng = max(ng, tracer_recon_required_nghost(parse_tracer_recon(tr_s))) if (present(periodic)) then if (periodic) ng = max(ng, REQUIRED_HALO_PERIODIC) end if if (present(tripolar_fold)) then if (tripolar_fold) ng = max(ng, REQUIRED_HALO_TRIPOLAR_FOLD) end if if (present(decomposed)) then if (decomposed) ng = max(ng, REQUIRED_HALO_DECOMPOSED) end if if (present(kappa_shear_at_vertex)) then if (kappa_shear_at_vertex) ng = max(ng, REQUIRED_HALO_KAPPA_SHEAR_VERTEX) end if end function required_halo