anchor.diff:    INTEGER, INTENT(IN), OPTIONAL   :: lbounds(3)
     LOGICAL, ALLOCATABLE            :: mask(:,:,:)
     REAL(KIND=C_FLOAT), ALLOCATABLE :: deltas(:,:,:)
  -  INTEGER                         :: indices(3), indexAdj(3), i, j
  +  INTEGER                         :: indices(3), indexAdj(3), expLbounds(3), expUbounds(3), i, j
     REAL, INTENT(in)                :: t
     
     
     mask = .NOT. (actual /= actual .AND. expected /= expected) .AND. ABS(actual - expected) > t
  +  expLbounds = LBOUND(expected)
  +  expUbounds = UBOUND(expected)
  +  ALLOCATE(deltas(expLbounds(1):expUbounds(1), expLbounds(2):expUbounds(2), expLbounds(3):expUbounds(3)))
     deltas = ABS(expected - actual)
     IF (PRESENT(lbounds)) THEN
       indexAdj = lbounds
  
positive.code:   INTEGER, INTENT(IN), OPTIONAL   :: lbounds(4)
    LOGICAL, ALLOCATABLE            :: mask(:,:,:,:)
    REAL(KIND=C_FLOAT), ALLOCATABLE :: deltas(:,:,:,:)
    INTEGER                         :: indices(4), indexAdj(4), i, j
    REAL, INTENT(in)                :: t
    
    
    mask = .NOT. (actual /= actual .AND. expected /= expected) .AND. ABS(actual - expected) > t
    deltas = ABS(expected - actual)
    IF (PRESENT(lbounds)) THEN
      indexAdj = lbounds
  
negative.code:   INTEGER, INTENT(IN), OPTIONAL   :: lbounds(1)
    LOGICAL, ALLOCATABLE            :: mask(:)
    REAL(KIND=C_FLOAT), ALLOCATABLE :: deltas(:)
    INTEGER                         :: indices(1), indexAdj(1), expLbounds(1), expUbounds(1), i, j
    REAL, INTENT(in)                :: t
    
    
    mask = .NOT. (actual /= actual .AND. expected /= expected) .AND. ABS(actual - expected) > t
    expLbounds = LBOUND(expected)
    expUbounds = UBOUND(expected)
    ALLOCATE(deltas(expLbounds(1):expUbounds(1)))
    deltas = ABS(expected - actual)
    IF (PRESENT(lbounds)) THEN
      indexAdj = lbounds
  