anchor.diff:            ! Call objective function
             error_code_c = func_pointer(dim_c, point, func_value, &
                  callback_data, error_message_length_c, error_message_c)
  -          if (error_code_c /= 0) exit
  +          if (error_code_c /= LBFGSB_OK) exit
   
             ! Call objective function gradient
             error_code_c = grad_pointer(dim_c, point, grad_value, &
                  callback_data, error_message_length_c, error_message_c)
  -          if (error_code_c /= 0) exit
  +          if (error_code_c /= LBFGSB_OK) exit
          end if
   
          ! Nothing to do for other tasks (NEW_X just means a step was
  
positive.code:      !   Arbitrary data to be used by the callback
       !
       ! error_code:
       !   Returned error code as defined in TODO
       function objective_gradient_c(dim, point, objective_function_gradient, &
            callback_data, error_message_length, error_message) &
            result(error_code) bind(c)
  
negative.code:        ! Check for normal or problematic termination
         if (task(1:4) == 'CONV') then
            ! Converged.  Normal termination.  Leave error (task) message
            ! as it may be informative.
            error_code_c = LBFGSB_OK
         else if (task(1:4) == 'ABNO') then
            ! Could not satisfy termination conditions.  Result is best
            ! approximation.
            error_code_c = LBFGSB_APPROXIMATE
         else if (task(1:5) == 'ERROR') then
            ! Runtime or user error
            error_code_c = LBFGSB_RUNTIME_ERROR
         else
            ! Unrecognized task
            error_code_c = LBFGSB_TASK_ERROR
         end if
      else
         ! There was a problem computing the objective or the gradient.
         ! The error message and code were already properly set by the
         ! call to function/gradient.  Fill C types with zeros so callers
         ! do not act unwittingly on garbage.
         min_x_c = 0d0
         min_f_c = 0d0
         min_g_c = 0d0
  