gm_pos_n2 Function

private pure function gm_pos_n2(n2) result(np)

max(N^2, 0) for the PE release, with a non-finite N^2 read as 0 (a bare max is NaN-blind under relaxed FP, CLAUDE.md).

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: n2

Return Value real(kind=wp)


Called by

proc~~gm_pos_n2~~CalledByGraph proc~gm_pos_n2 gm_pos_n2 proc~gm_pe_release gm_pe_release proc~gm_pe_release->proc~gm_pos_n2 proc~gm_compute_impl gm_compute_impl proc~gm_compute_impl->proc~gm_pe_release proc~gm_compute_transports gm_compute_transports proc~gm_compute_transports->proc~gm_compute_impl proc~run_gm_step run_gm_step proc~run_gm_step->proc~gm_compute_transports proc~ocean_dyn_step_split ocean_dyn_step_split proc~ocean_dyn_step_split->proc~run_gm_step

Source Code

   pure function gm_pos_n2(n2) result(np)
      !$acc routine seq
      !! `max(N^2, 0)` for the PE release, with a non-finite N^2 read as 0
      !! (a bare `max` is NaN-blind under relaxed FP, CLAUDE.md).
      real(wp), intent(in) :: n2
      real(wp) :: np
      np = 0.0_wp
      if (ieee_is_finite(n2)) np = max(n2, 0.0_wp)
   end function gm_pos_n2