In the code above it is possible to change the GDXOUTPUT part: * <%GDXOUTPUT%>
******************************** *** The GDX OUTPUT statement *** ******************************** execute_UNLOAD 'results.gdx',z,x; * <%OUTPUT FILE results.gdx%> * <%SYMBOL%>
* <%VARIABLE z total transportation costs in thousands of dollars%> * <%FORMAT #,###,##0.###%>
* <%DIMENSION US-Dollar%> * <%ENDSYMBOL%>
* <%SYMBOL%>
* <%VARIABLE x(i,j) shipment quantities in cases%> * <%FORMAT #,###,##0.###%>
* <%DIMENSION Cases%> * <%INFO%>
* The shipment of quantities from plant to city (sum of shipments is * total supply).
* <%ENDINFO%> * <%ENDSYMBOL%>
* <%/GDXOUTPUT%>
with two EXPLICIT OUTPUT and two OUTPUT statements plus some GAMS loopings to print variables x and z to a file. Select the OUTPUT tag in the TagEditor and add the data as shown in
Figure 11.1. You have to insert two OUTPUT tags: the first for variable x and the second for z.
******************************** *** The GSE OUTPUT statement *** ******************************** * <%EXPLICIT OUTPUT FILE%>
* <%OUTPUT FILE LABEL shipment quantities in cases%> * <%FILE x.out%>
* <%/EXPLICIT OUTPUT FILE%> FILE expl1/x.out/;
put expl1 'x(i,j) shipment quantities in cases'/; put expl1 '/'/;
loop (i, loop (j,
put "level ." put i.tl; put '.'; put j.tl; put ' '; PUT x.l(i,j):10:3; put /; put "lo ." put i.tl; put '.'; put j.tl; put ' '; PUT x.lo(i,j):10:3; put /; put "up ." put i.tl; put '.'; put j.tl; put ' '; PUT x.up(i,j):10:3; put /; put "marginal ." put i.tl; put '.'; put j.tl; put ' '; PUT x.m(i,j):10:3; put /; ));
put expl1'/'/; putclose expl1; * <%OUTPUT%>
* <%OUTPUT FILE expl1%>
* <%VARIABLE x(i,j) shipment quantities in cases%> * <%FORMAT #,###,##0.###%>
* <%DIMENSION Units%> * <%/OUTPUT%>
******************************** *** The GSE OUTPUT statement *** ******************************** * <%EXPLICIT OUTPUT FILE%>
* <%OUTPUT FILE LABEL total transportation costs in thousands of dollars%> * <%FILE z.out%>
* <%/EXPLICIT OUTPUT FILE%> FILE expl2/z.out/;
put expl2 'z total transportation costs in thousands of dollars'/; put expl2 '/'/;
put "level ";PUT z.l:10:3; put /; put "lo ";PUT z.lo:10:3; put /; put "up ";PUT z.up:10:3; put /; put "marginal ";PUT z.m:10:3; put /; put expl2'/'/;
putclose expl2; * <%OUTPUT%>
* <%OUTPUT FILE expl2%>
* <%VARIABLE z total transportation costs in thousands of dollars%> * <%FORMAT #,###,##0.###%>
* <%DIMENSION US-Dollar%> * <%/OUTPUT%>
As you can see, the GDXOUTPUT tag is much easier to implement, but is only available for GAMS versions 20.6 and higher. With GDXOUTPUT you can write multiple outputs (variables, scalars and parameters) to one file, whereas with the OUTPUT tag you need to create one file for every output parameter/variable separately. Since GDX is binary output, the output file is also much smaller with GDX than with the OUTPUT tag.
Report IV AGMEMOD – GSE Interface Manual
Impact Analysis of CAP Reform on the Main Agricultural Commodities
115
■ AGMEMOD Partnership
• Agricultural Economics Research Institute (LEI), The Hague, The Netherlands: Hans van Meijl, Myrna van
Leeuwen, Andrzej Tabeau
• Bundesforschungsanstalt für Landwirtschaft (FAL), Braunschweig, Germany: Petra Salamon, Oliver von
Ledebur
• Centre of Agricultural Economics, INRA-ESR, Rennes, France: Frédéric Chantreuil, Fabrice Levert
• Teagasc-Rural Economy Research Centre (RERC), Athenry, Co. Galway, Ireland: Trevor Donnellan, Kevin
Hanrahan
• Latvian State Institute of Agrarian Economics (LSIAE), Riga, Latvia: Danute Jasjko, Guna Salputra,
Ludmilla Fadejeva
• University of Ljubljana, Biotechnical Faculty (LJUB), Ljubljana, Slovenia: Emil Erjavec, Stane Kavcic,
Darja Regoršek
• Universitat fur Bodenkultur Wien (BOKU), Wien, Austria: Martin Kniepert
• Université Catholique de Louvain (UCL), Louvain-La-Neuve, Belgium: Bruno Henry de Frahan, Olivier
Harmignie
• Institute of Agriculture Economics (IEABG), Sofia, Bulgaria: Nedka Ivanova, Mariya Peneva
• Research Institute of Agriculture Economics (VUZE), Prague, Czech Republic: Ivan Foltyn, Jan Kubát • Food and Resource Economic Institute (FØI), Frederiksberg C, Denmark: Jorgen Dejgaard Jensen
• Institute of Economics and Social Sciences of Estonian Agricultural University (EAU), Tartu, Estonia: Mati
Sepp
• MTT Agrifood Research Finland (MTT), Helsinki, Finland: Jyrki Niemi, Lauri Kettunen • Department of Economics, University of Athens (NKUA), Athens, Greece: Elias Mantzouneas • Corvinus University of Budapest (CUB), Budapest, Hungary: Tibor Ferenczi
• Polytechnic University of Marche-Ancona (UNIVPM), Ancona, Italy: Roberto Esposti, Antonello Lobianco • Lithuanian Institute of Agrarian Economics (LAEI), Vilnius, Lithuania: Irena Krisciukaitiene, Salomeja
Andrekiene, Andrej Jedik, Willi Meyers, Aiste Galnaityte
• Warsaw School of Economics (WSE), Warsaw, Poland: Sylwia Krawczyńska, Katarzyna Kowalska
• Institute of Agricultural Economics (IEARO), Bucharest, Romania: Camelia Serbanescu, Cristian
Kevorchian
• Slovak Agricultural University (SAU), Nitra, Slovak Republic: Lubica Bartova, Pavel Ciaian, Jan Pokrivcak • Unidad de Economia Agraria, Centro de Investigacion y Tecnologia Agroalimentaria de Aragon, (CITA),
Zaragoza, Spain: Azucena Gracia
European Commission
EUR EUR 22940 EN/4 – Joint Research Centre, Institute for Prospective Technological Studies
Title: Impact Analysis of CAP Reform on the Main Agricultural Commodities. Report IV AGMEMOD -
AGMEMOD – GSE Interface Manual
Author: Wietse Dol.
Editors: Robert M'barek and Lubica Bartova
Luxembourg: Office for Official Publications of the European Communities 2008
EUR - Scientific and Technical Research series; ISSN 1018-5593
Abstract
This report is based on a study carried out by the AGMEMOD Partnership under the management of the Agricultural Economics Research Institute (LEI, in the Netherlands), in cooperation with the Joint Research Centre – Institute for Prospective Technological Studies (JRC-IPTS) to generate projections for the main agricultural commodity markets for each year from 2005 until 2015.
The report gives an overview of the GSE interface and how GSE is applied with the AGMEMOD model, directly addressing the needs of model-builders and users in an application-oriented and practical way.
Detailed documentation on the AGMEMOD modelling approach, along with the outcome of the study, is published in five reports in the JRC-IPTS Scientific and Technical Report Series under the heading "Impact analysis of Common Agricultural Policy reform on the main agricultural commodities".