From 08a5e49c76eaa36084c6cbe08894df5d567f9dab Mon Sep 17 00:00:00 2001 From: Peter Hjort Lauritzen Date: Thu, 19 Feb 2026 03:48:26 -0700 Subject: [PATCH] remove unused routines --- src/dynamics/se/dycore/quadrature_mod.F90 | 142 ---------------------- 1 file changed, 142 deletions(-) diff --git a/src/dynamics/se/dycore/quadrature_mod.F90 b/src/dynamics/se/dycore/quadrature_mod.F90 index feed0dd912..826631d43f 100644 --- a/src/dynamics/se/dycore/quadrature_mod.F90 +++ b/src/dynamics/se/dycore/quadrature_mod.F90 @@ -21,9 +21,6 @@ module quadrature_mod public :: jacobi public :: quad_norm - public :: trapezoid - private :: trapN - public :: simpsons public :: gaussian_int private :: gausslobatto_pts @@ -782,145 +779,6 @@ function quad_norm(gquad,N) result(gamma) end function quad_norm - ! ======================= - ! TrapN: - ! Numerical recipes - ! ======================= - - subroutine trapN(f,a,b,N,it,s) - INTERFACE - FUNCTION f(x) RESULT(f_x) ! Function to be integrated - use shr_kind_mod, only: r8=>shr_kind_r8 - real(kind=r8), INTENT(IN) :: x - real(kind=r8) :: f_x - END FUNCTION f - END INTERFACE - - real(kind=r8),intent(in) :: a,b - integer, intent(in) :: N - integer, intent(inout) :: it - real(kind=r8), intent(inout) :: s - - real(kind=r8) :: ssum - real(kind=r8) :: del - real(kind=r8) :: rtnm - real(kind=r8) :: x - - integer :: j - - if (N==1) then - s = 0.5_r8*(b-a)*(f(a) + f(b)) - it =1 - else - ssum = 0.0_r8 - rtnm =1.0_r8/it - del = (b-a)*rtnm - x=a+0.5_r8*del - do j=1,it - ssum = ssum + f(x) - x=x+del - end do - s=0.5_r8*(s + del*ssum) - it=2*it - end if - - end subroutine trapN - - ! ========================================== - ! Trapezoid Rule for integrating functions - ! from a to b with residual error eps - ! ========================================== - - function trapezoid(f,a,b,eps) result(Integral) - - integer, parameter :: Nmax = 25 ! At most 2^Nmax + 1 points in integral - - INTERFACE - FUNCTION f(x) RESULT(f_x) ! Function to be integrated - use shr_kind_mod, only: r8=>shr_kind_r8 - real(kind=r8), INTENT(IN) :: x - real(kind=r8) :: f_x - END FUNCTION f - END INTERFACE - - real(kind=r8), intent(in) :: a,b ! The integral bounds - real(kind=r8), intent(in) :: eps ! relative error bound for integral - real(kind=r8) :: Integral ! the integral result (within eps) - real(kind=r8) :: s ! Integral approximation - real(kind=r8) :: sold ! previous integral approx - - integer :: N - integer :: it - - ! ============================================================== - ! Calculate I here using trapezoid rule using f and a DO loop... - ! ============================================================== - - s = 1.0e30_r8 - sold = 0.0_r8 - N=1 - it=0 - do while(N<=Nmax .and. ABS(s-sold)>eps*ABS(sold)) - sold=s - call trapN(f,a,b,N,it,s) - N=N+1 - end do - - Integral = s - - end function trapezoid - - ! ========================================== - ! Simpsons Rule for integrating functions - ! from a to b with residual error eps - ! ========================================== - - function simpsons(f,a,b,eps) result(Integral) - - integer, parameter :: Nmax = 25 ! At most 2^Nmax + 1 points in integral - - INTERFACE - FUNCTION f(x) RESULT(f_x) ! Function to be integrated - use shr_kind_mod, only: r8=>shr_kind_r8 - real(kind=r8), INTENT(IN) :: x - real(kind=r8) :: f_x - END FUNCTION f - END INTERFACE - - real(kind=r8), intent(in) :: a,b ! The integral bounds - real(kind=r8), intent(in) :: eps ! relative error bound for integral - real(kind=r8) :: Integral ! the integral result (within eps) - real(kind=r8) :: s ! Integral approximation - real(kind=r8) :: os ! previous integral approx - real(kind=r8) :: st ! Integral approximation - real(kind=r8) :: ost ! previous integral approx - - integer :: N - integer :: it - - ! ============================================================== - ! Calculate I here using trapezoid rule using f and a DO loop... - ! ============================================================== - - ost= 0.0_r8 - s = 1.0e30_r8 - os = 0.0_r8 - - N=1 - it=0 - do while ((N<=Nmax .and. ABS(s-os)>eps*ABS(os) ) .or. N<=2) - os = s - call trapN(f,a,b,N,it,st) - s=(4.0_r8*st-ost)/3.0_r8 - ost=st - N=N+1 - end do - - Integral = s - - end function simpsons - - ! ========================================== ! gaussian_int: !