Fail-loud validation for wide halo entry points. Called at the top of every *_wide public routine.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | ng_wide |
Requested wide ghost width |
||
| character(len=*), | intent(in) | :: | caller |
Caller name for error messages |
subroutine wide_halo_guards(ng_wide, caller) !! Fail-loud validation for wide halo entry points. !! Called at the top of every *_wide public routine. integer, intent(in) :: ng_wide !! Requested wide ghost width character(len=*), intent(in) :: caller !! Caller name for error messages if (ng_wide < oh_nghost) then call logger%error(caller//": ng_wide="//to_string(ng_wide)// & " < oh_nghost="//to_string(oh_nghost)// & ". A wide exchange narrower than the base ghost band "// & "would leave stale ghost cells. Use ng_wide >= oh_nghost.") error stop "wide halo: ng_wide < oh_nghost" end if if (oh_decomp%px > 1 .and. ng_wide > oh_nx_local) then call logger%error(caller//": ng_wide="//to_string(ng_wide)// & " > nx_local="//to_string(oh_nx_local)// & " with px="//to_string(oh_decomp%px)//". "// & "Wide halo width exceeds local interior; decompose "// & "less or lower bt_halo.") error stop "wide halo width exceeds local interior (x)" end if if (oh_decomp%py > 1 .and. ng_wide > oh_ny_local) then call logger%error(caller//": ng_wide="//to_string(ng_wide)// & " > ny_local="//to_string(oh_ny_local)// & " with py="//to_string(oh_decomp%py)//". "// & "Wide halo width exceeds local interior; decompose "// & "less or lower bt_halo.") error stop "wide halo width exceeds local interior (y)" end if ! Single-rank periodic guard: the wrap reads i + nx_phys, so ng_wide ! must not exceed nx_phys (= oh_nx_local). if (oh_decomp%px == 1 .and. oh_periodic_x .and. ng_wide > oh_nx_local) then call logger%error(caller//": ng_wide="//to_string(ng_wide)// & " > nx_phys="//to_string(oh_nx_local)// & " for single-rank periodic-x. "// & "The local wrap reads i+nx_phys which would exceed "// & "the array. Reduce ng_wide.") error stop "wide halo: ng_wide > nx_phys for single-rank periodic-x" end if if (oh_decomp%py == 1 .and. oh_periodic_y .and. ng_wide > oh_ny_local) then call logger%error(caller//": ng_wide="//to_string(ng_wide)// & " > ny_phys="//to_string(oh_ny_local)// & " for single-rank periodic-y. "// & "The local wrap reads j+ny_phys which would exceed "// & "the array. Reduce ng_wide.") error stop "wide halo: ng_wide > ny_phys for single-rank periodic-y" end if end subroutine wide_halo_guards