anchor.diff:        integer , intent(in) , dimension(2) :: sh
         call init_1DVar_2arg(sh(1),sh(2))
       end subroutine init_1DVar_arr
  +
  +    real function compute_chi_square(m,SEInv,yobs_minus_yhat) result(norm)
  +      implicit none
  +      integer , intent(in) :: m
  +      real , dimension(m,m) , intent(in) :: SEInv
  +      real , dimension(m) , intent(in) :: yobs_minus_yhat
  +      if ( .not. isinit ) return
  +      call dotprod(yobs_minus_yhat,SEInv,dot4)
  +      dot5 = yobs_minus_yhat/size(yobs_minus_yhat)
  +      call dotprod(dot4,dot5,norm)
  +    end function compute_chi_square
   
       subroutine update_solution_1DVar(m,n,fmK,SEInv,SaInv_ret, &
                                        yobs_minus_yhat,xhat,ap,xhat_new,d2)
  
positive.code:       allocate(dz(n))
        allocate(ddx(n))
        allocate(totx(n))
        do j = 1 , n
          do i = 1 , n
            utmask(i,j) = (j-i) > 0
  
negative.code:       real , dimension(n) , intent(in) :: ap
        real , dimension(n) , intent(out) :: xhat_new
        real , intent(out) :: d2
        if ( .not. isinit ) return
        fmKT = transpose(fmK)
        call dotprod(fmKT,SEInv,KtSeInv)
        call dotprod(KtSeInv,fmK,KtSeInvK)
  