Help with gas smell

Okay the discussion title does not tell the story and I don’t think this is as easy as it implies. I blew the motor in my 97 outback last fall. Replaced with 2.2 to save money, also replaced gas tank. Not sure if the problem is related or not but here goes. I noticed it only minutely until it warmed up and I started to roll my windows down. I have this horrible smell of gas coming into my car from outside. It happens only when car is in motion, not when idling. Engine light is on, but has been on for years so I paid it no attention. Code comes up p0440. We have replaced the following; erg, pcv, purge lines,the intake, purge lines, vent valve, gas cap. There are no gas leaks anywhere that we can see, and I got 28 mpg on my last tank of gas, so I am sure I am not losing gas. What we are not sure about is if the pressure on pump may be different on cars with 2.2 vs 2.5 causing smell. Or if a block catalytic converter would produce this same problem. The mechanic I use, who deals mostly with Subarus is baffled. I am convinced it is a venting or vacuum problem but we cannot seem to narrow it down. I would surely appreciate any help anybody could offer. I am running out of options and money.

The trouble code points to the evaporative emissions system, so you’re probably on the right track. It’s possible that the vacuum lines weren’t properly connected, a check valve was installed backwards, or the charcoal cannister is saturated with gas (do you have a habit of trying to squeeze in that last drop of gas when you fill up?).

Thanks for the response. I just swapped the charcoal canister and I have always quit pumping gas when the pump switches off. If it is the vacuum lines or the check valve being installed backwards would that cause the smell only in motion. See that’s what has us so baffled. There is no smell when just idling, or even when revving in park. How would I know if the check valve is backwards?