From 698bfed7978cca17de80435bb75d458f9b2c5638 Mon Sep 17 00:00:00 2001 From: daniau Date: Thu, 7 Feb 2008 09:04:09 +0000 Subject: [PATCH] git-svn-id: https://lxsd.femto-st.fr/svn/fvn@34 b657c933-2333-4658-acf2-d3c7c2708721 --- fvnlib.f90 | 38 ++++++++++++++++++++++++++------------ 1 file changed, 26 insertions(+), 12 deletions(-) diff --git a/fvnlib.f90 b/fvnlib.f90 index baf1248..e49511b 100644 --- a/fvnlib.f90 +++ b/fvnlib.f90 @@ -2510,21 +2510,25 @@ implicit none double precision, external :: f double precision, intent(in) :: a,b,epsabs,epsrel integer, intent(in) :: key -integer, intent(in) :: limit +integer, intent(in),optional :: limit double precision, intent(out) :: res,abserr integer, intent(out) :: ier double precision, allocatable :: work(:) integer, allocatable :: iwork(:) integer :: lenw,neval,last +integer :: limitw ! imsl value for limit is 500 -lenw=limit*4 +limitw=500 +if (present(limit)) limitw=limit -allocate(iwork(limit)) +lenw=limitw*4 + +allocate(iwork(limitw)) allocate(work(lenw)) -call dqag(f,a,b,epsabs,epsrel,key,res,abserr,neval,ier,limit,lenw,last,iwork,work) +call dqag(f,a,b,epsabs,epsrel,key,res,abserr,neval,ier,limitw,lenw,last,iwork,work) deallocate(work) deallocate(iwork) @@ -2597,21 +2601,26 @@ subroutine fvn_d_integ_2_gk(f,a,b,g,h,epsabs,epsrel,key,res,abserr,ier,limit) implicit none double precision, external:: f,g,h double precision, intent(in) :: a,b,epsabs,epsrel -integer, intent(in) :: key,limit +integer, intent(in) :: key +integer, intent(in), optional :: limit integer, intent(out) :: ier double precision, intent(out) :: res,abserr double precision, allocatable :: work(:) +integer :: limitw integer, allocatable :: iwork(:) integer :: lenw,neval,last ! imsl value for limit is 500 -lenw=limit*4 +limitw=500 +if (present(limit)) limitw=limit + +lenw=limitw*4 allocate(work(lenw)) -allocate(iwork(limit)) +allocate(iwork(limitw)) -call dqag_2d_outer(f,a,b,g,h,epsabs,epsrel,key,res,abserr,neval,ier,limit,lenw,last,iwork,work) +call dqag_2d_outer(f,a,b,g,h,epsabs,epsrel,key,res,abserr,neval,ier,limitw,lenw,last,iwork,work) deallocate(iwork) deallocate(work) @@ -2685,21 +2694,26 @@ subroutine fvn_d_integ_2_inner_gk(f,x,a,b,epsabs,epsrel,key,res,abserr,ier,limit implicit none double precision, external:: f double precision, intent(in) :: x,a,b,epsabs,epsrel -integer, intent(in) :: key,limit +integer, intent(in) :: key +integer, intent(in),optional :: limit integer, intent(out) :: ier double precision, intent(out) :: res,abserr double precision, allocatable :: work(:) +integer :: limitw integer, allocatable :: iwork(:) integer :: lenw,neval,last ! imsl value for limit is 500 -lenw=limit*4 +limitw=500 +if (present(limit)) limitw=limit + +lenw=limitw*4 allocate(work(lenw)) -allocate(iwork(limit)) +allocate(iwork(limitw)) -call dqag_2d_inner(f,x,a,b,epsabs,epsrel,key,res,abserr,neval,ier,limit,lenw,last,iwork,work) +call dqag_2d_inner(f,x,a,b,epsabs,epsrel,key,res,abserr,neval,ier,limitw,lenw,last,iwork,work) deallocate(iwork) deallocate(work) -- 2.16.4