compute_resid_glob_2d Subroutine

private subroutine compute_resid_glob_2d(ctx)

Reduce the global L2 norm of the last-substage residual into ctx % resid_glob (2D analogue of the 1D compute_resid_glob): resid_glob = sqrt( par_sum(sum resid^2) / (nx_g*ny_g * neq2d) ) The denominator uses GLOBAL counts so the norm is decomposition- independent (np=1 == np=2 up to summation reordering, ~1e-13). Collective: every rank must call. Dummy widened type -> class (Q2c): called from the ctx2d_observe hook, whose own dummy is class(solver_run_context_2d_t) per the abstract run_loop_ctx_t interface, so the actual argument here is polymorphic and the callee must accept it as such.

Arguments

Type IntentOptional Attributes Name
class(solver_run_context_2d_t), intent(inout) :: ctx