anchor.diff:    INTEGER, INTENT(IN), OPTIONAL :: lbounds(2)
     LOGICAL, ALLOCATABLE          :: mask(:,:)
     INTEGER, ALLOCATABLE          :: deltas(:,:)
  -  INTEGER                       :: indices(2), indexAdj(2), i, j
  +  INTEGER                       :: indices(2), indexAdj(2), expLbounds(2), expUbounds(2), i, j
     
     mask = actual /= expected
  +  expLbounds = LBOUND(expected)
  +  expUbounds = UBOUND(expected)
  +  ALLOCATE(deltas(expLbounds(1):expUbounds(1), expLbounds(2):expUbounds(2)))
     deltas = ABS(expected - actual)
     IF (PRESENT(lbounds)) THEN
       indexAdj = lbounds
  
positive.code:   INTEGER, INTENT(IN), OPTIONAL    :: lbounds(4)
    LOGICAL, ALLOCATABLE             :: mask(:,:,:,:)
    REAL(KIND=C_DOUBLE), 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(4)
    LOGICAL, ALLOCATABLE              :: mask(:,:,:,:)
    INTEGER(KIND=C_LONG), ALLOCATABLE :: deltas(:,:,:,:)
    INTEGER                           :: indices(4), indexAdj(4), expLbounds(4), expUbounds(4), i, j
    
    mask = actual /= expected
    expLbounds = LBOUND(expected)
    expUbounds = UBOUND(expected)
    ALLOCATE(deltas(expLbounds(1):expUbounds(1), expLbounds(2):expUbounds(2), expLbounds(3):expUbounds(3), expLbounds(4):expUbounds(4)))
    deltas = ABS(expected - actual)
    IF (PRESENT(lbounds)) THEN
      indexAdj = lbounds
  