anchor.diff:  
     subroutine vd_bin(this)
       ! Update virtual detector counts
  +    !
  +    ! This method is not publicly exposed, and is only called by `vd_update`
  +    !
  +    ! this :: vd_obj instance
       class(vd_obj), intent(inout) :: this
   
       integer(ip) :: i_x_vd
  
positive.code: module vd
    ! Virtual detector module
  
    ! Imports -- intrinsic
    use ieee_arithmetic
  
negative.code: 
    end subroutine vd_fill_arrays
  
    subroutine vd_setup_arrays(this)
      ! Allocate and initialize all virtual detector arrays
      !
      ! This method is not publicly exposed, and is only called by `vd_init`
      !
      ! this :: vd_obj instance
      class(vd_obj), intent(inout) :: this
  
      allocate(this%vd_p_arr(this%np))
      this%vd_p_arr(:) = 0.0_fp
      allocate(this%p_range(this%np))
      call numerics_linspace(this%p_min, this%p_max, this%p_range, this%dp)
  
      ! Allocate internal work arrays, including the points on the sides of the
      ! detectors (because we need to compute derivatives).
      ! These are 0-based so that the virtual detector points start at index 1,
      ! which aligns with Fortran's default array indexing.
      allocate(this%phi_arr_l(0 : this%nxl + 1), &
           this%phi_arr_r(0 : this%nxr + 1))
      allocate(this%p_arr_l(0 : this%nxl + 1), this%p_arr_r(0 : this%nxr + 1))
      allocate(this%p_var_arr_l(0 : this%nxl + 1), &
           this%p_var_arr_r(0 : this%nxr + 1))
      allocate(this%mag_arr_l(0 : this%nxl + 1), &
           this%mag_arr_r(0 : this%nxr + 1))
      allocate(this%j_arr_l(0 : this%nxl + 1), this%j_arr_r(0 : this%nxr + 1))
  
    end subroutine vd_setup_arrays
  
    subroutine vd_validate_spatial_input(nx, nxl_ext, nxr_ext, nxl_vd, nxr_vd)
      ! Validate spatial grid setup and exit abnormally if errors are found
      !
      ! This method is not publicly exposed, and is only called by `vd_init`
      !
      ! nx :: number of spatial grid points
      ! nxl_ext :: number of left external grid points
      ! nxr_ext :: number of right external grid points
      ! nxl_vd :: number of left virtual detector points
      ! nxr_vd :: number of right virtuald detector points
      integer(ip) :: nx
      integer(ip) :: nxl_ext
      integer(ip) :: nxr_ext
      integer(ip) :: nxl_vd
      integer(ip) :: nxr_vd
  
      logical :: sane
      character(:), allocatable :: error_msg
  
      write(*,*) nx, nxl_ext, nxr_ext, nxl_vd, nxr_vd
  
      sane = (nxl_ext .gt. 0) .and. (nxr_ext .gt. 0)
      if (.not. sane) then
         error_msg = "No external region defined in numerical grid; "// &
              "stopping abnormally."
         call log_log_critical(error_msg, log_stderr)
         stop 0
      end if
  
      sane = (nxl_vd .gt. 0) .and. (nxr_vd .gt. 0)
      if (.not. sane) then
         error_msg = "Virtual detectors must be present in numerical grid; "// &
              "stopping abnormally."
         write(*,*) nxl_vd, nxr_vd
         call log_log_critical(error_msg, log_stderr)
         stop 0
      end if
  
      sane = (nx .gt. nxl_ext + nxr_ext + nxl_vd + nxr_vd)
      if (.not. sane) then
         error_msg = "Numerical grid size greater than number of allocated "// &
              "points; no internal region possible; exiting abnormally."
         call log_log_critical(error_msg, log_stderr)
         stop 0
      end if
  
    end subroutine vd_validate_spatial_input
  
    subroutine vd_validate_momentum_input(p_min, p_max)
      ! Validate momentum grid setup and exit abnormally if issues are found
      !
      ! This method is not publicly exposed, and is only called by `vd_init`
      !
      ! p_min :: lower momentum grid bound
      ! p_max :: upper momentum grid bound
      real(fp) :: p_min
      real(fp) :: p_max
  
      logical :: sane
      character(:), allocatable :: error_msg
  
      sane = (p_min .lt. p_max)
      if (.not. sane) then
         error_msg = "Incoherent momentum grid boundaries; exiting abnormally."
         call log_log_critical(error_msg, log_stderr)
         stop 0
      end if
    end subroutine vd_validate_momentum_input
  
  end module vd
  