     dim3 grid(args.n_blocks, 1, 1);
     dim3 threads(args.block_size, 1, 1);
     unsigned int shared_bytes = sizeof(float3)*args.block_size;
-    
+   
+    Scalar external_virial = Scalar(1.0/3.0)*(args.external_virial_xx
+                             + args.external_virial_yy
+                             + args.external_virial_zz);
+
     gpu_compute_thermo_partial_sums<<<grid,threads, shared_bytes>>>(args.d_scratch,
                                                                     args.d_net_force,
                                                                     args.d_net_virial,

                                                                   box,
                                                                   args.D,
                                                                   group_size,
                                                                   args.n_blocks);
    
    if (compute_pressure_tensor)
        {

    \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.
    
