Separates code for p and other variables in netcdf collect.