         // compute final quantities
         float ke_total = final_sum.x * 0.5f;
         float pe_total = final_sum.y;
-        float W = final_sum.z;
+        float W = final_sum.z + external_virial;
         
         // compute the temperature
         Scalar temperature = Scalar(2.0) * Scalar(ke_total) / Scalar(ndof);

                                              BoxDim box,
                                              unsigned int D,
                                              unsigned int group_size,
                                              unsigned int num_partial_sums)
    {
    float3 final_sum = make_float3(0.0f, 0.0f, 0.0f);
    

    \param D Dimensionality of the system
    \param group_size Number of particles in the group
    \param num_partial_sums Number of partial sums in \a d_scratch
    \param external_virial External contribution to virial (1/3 trace)

   
    Only one block is executed. In that block, the partial sums are read in and reduced to final values. From the final
    sums, the thermodynamic properties are computed and written to d_properties.
    
