relative_drift Function

private pure function relative_drift(change, init) result(rel)

change / init with a zero guard for a never-set baseline.

Arguments

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

Return Value real(kind=wp)


Called by

proc~~relative_drift~~CalledByGraph proc~relative_drift relative_drift proc~emit_drift_line emit_drift_line proc~emit_drift_line->proc~relative_drift proc~console_stats_report console_stats_report proc~console_stats_report->proc~emit_drift_line proc~ocean_console_stats_report ocean_console_stats_report proc~ocean_console_stats_report->proc~console_stats_report proc~driver_run_ocean driver_run_ocean proc~driver_run_ocean->proc~ocean_console_stats_report proc~driver_run driver_run proc~driver_run->proc~driver_run_ocean

Variables

Type Visibility Attributes Name Initial
real(kind=wp), private, parameter :: TINY_INIT = 1.0e-30_wp

Source Code

   pure function relative_drift(change, init) result(rel)
      !! `change / init` with a zero guard for a never-set baseline.
      real(wp), intent(in) :: change, init
      real(wp) :: rel
      real(wp), parameter :: TINY_INIT = 1.0e-30_wp
      if (abs(init) > TINY_INIT) then
         rel = change/init
      else
         rel = 0.0_wp
      end if
   end function relative_drift