Gas diffusion in porous media consists of surface hopping and non-surface ballistic/bulk diffusion. Unfortunately, only the overall diffusivity is usually measured, without being separated into various diffusion modes. Here, we report a numerical method to differentiate contributions from surface diffusion and non-surface diffusion for argon diffusion in nanoporous carbon using molecular dynamics simulations. The key is to truncate the argon trajectories based on the adsorption/desorption state, and thus attribute mass fluxes according to specific mechanisms during diffusion. Both the surface diffusivity and non-surface diffusivity increase and then decrease as a function of gas loading. Yet, surface diffusivity and non-surface diffusivity behave very differently as a function of the temperature and gas-substrate affinity of the nanoporous network.