error_calculation Subroutine

subroutine error_calculation(nr)

Arguments

Type IntentOptional AttributesName
integer, intent(in) :: nr

Called by

proc~~error_calculation~~CalledByGraph proc~error_calculation error_calculation proc~time_advance_heat_equation time_advance_heat_equation proc~time_advance_heat_equation->proc~error_calculation interface~time_advance_heat_equation time_advance_heat_equation interface~time_advance_heat_equation->proc~time_advance_heat_equation

Contents

Source Code


Source Code

    subroutine error_calculation(nr)
      integer, intent(in) :: nr
      real(r8k), parameter :: tolerance = 0.2

      associate(avg_err_percentage => sum( [( 100.0*(abs(this%v(i,2)- this%T_analytical(i))/this%T_analytical(i)), i=1,nr)] )/ nr)
        if (avg_err_percentage <= tolerance) print *, "Test passed."
      end associate
    end subroutine error_calculation