This paper describes the implementation in the General Algebraic Modeling Language (GAMS) of an economic equilibrium model based on the Global Trade Analysis Project (GTAP) dataset. We call this model and the ancillary programming tools GTAPinGAMS. Relative to previous installments of GTAPinGAMS, an innovation in this model is that it can easily switch between global multiregional (GMR) and small open economy (SOE) closures. We also include the possibility to evaluate results for alternative representations of final demand, based on Cobb-Douglas, linear expenditure system or constant difference in elasticities demand systems. In this paper we outline the model structure, document the associated equilibrium conditions and describe computer programs which calibrate the model to the desired regional and sectoral aggregation from the GTAP 9 dataset. We perform a few calculations which illustrate how alternative structural assumptions influence the policy conclusions derived from the model.