Skip to content

Commit 9eb679a

Browse files
committed
code cleanup for bounds.
1 parent 425ef71 commit 9eb679a

1 file changed

Lines changed: 2 additions & 12 deletions

File tree

src/numerical_differentiation_module.f90

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -764,11 +764,7 @@ subroutine initialize_numdiff_for_diff(me,n,m,xlow,xhigh,&
764764
me%m = m
765765

766766
! input variable bounds:
767-
if (any(xlow>=xhigh)) error stop 'Error: all xlow must be < xhigh'
768-
allocate(me%xlow(n))
769-
allocate(me%xhigh(n))
770-
me%xlow = xlow
771-
me%xhigh = xhigh
767+
call me%set_numdiff_bounds(xlow,xhigh)
772768

773769
! optional:
774770
if (present(chunk_size)) me%chunk_size = abs(chunk_size)
@@ -949,13 +945,7 @@ subroutine initialize_numdiff(me,n,m,xlow,xhigh,perturb_mode,dpert,&
949945
me%m = m
950946

951947
! input variable bounds:
952-
if (any(xlow>=xhigh)) error stop 'Error: all xlow must be < xhigh'
953-
if (allocated(me%xlow)) deallocate(me%xlow)
954-
if (allocated(me%xhigh)) deallocate(me%xhigh)
955-
allocate(me%xlow(n))
956-
allocate(me%xhigh(n))
957-
me%xlow = xlow
958-
me%xhigh = xhigh
948+
call me%set_numdiff_bounds(xlow,xhigh)
959949

960950
! perturbation options:
961951
select case (perturb_mode)

0 commit comments

Comments
 (0)