Modeling and control of the gas exchange process in modern diesel engines is critical for the promotion and control of advanced combustion strategies. However, most modeling efforts to date use complex stand-alone simulation packages that are not easily integrated into, or amenable for the synthesis of, engine control systems. Simpler control-oriented models have been developed; however, in many cases, they do not directly capture the complete dynamic interaction of air handling system components and flows in multicylinder diesel engines with variable geometry turbocharging (VGT), high pressure exhaust gas recirculation (EGR), and flexible intake valve actuation. Flexibility in the valvetrain directly impacts the gas exchange process not only through the effect on volumetric efficiency but also through the combustion process and resulting exhaust gas enthalpy utilized to drive the turbomachinery. This paper describes a low-order, five state model of the air handling system for a multicylinder variable geometry turbocharged diesel engine with cooled EGR and flexible intake valve actuation, validated against 286 steady state and 62 transient engine operating points. The model utilizes engine speed, engine fueling, EGR valve position, VGT nozzle position, and intake valve closing (IVC) time as inputs to the model. The model outputs include calculation of the engine flows as well as the exhaust temperature exiting the cylinders. The gas exchange model captures the dynamic effects of the not only the standard air handling actuators (EGR valve position and VGT position) but also IVC timing, exercised over their useful operating ranges. The model's capabilities are enabled through the use of analytical functions to describe the performance of the turbocharger, eliminating the need to use look-up maps; a physically based control-oriented exhaust gas enthalpy submodel and a physically based volumetric efficiency submodel.