[go: up one dir, main page]

IDEAS home Printed from https://ideas.repec.org/p/ags/pugtwp/331348.html
   My bibliography  Save this paper

Using GEMPACK Subroutines in your Fortran Programs

Author

Listed:
  • Harrison, Jill W.
  • Horridge, J. Mark
  • Pearson, Ken
Abstract
General-purpose software packages such as GEMPACK provide tools which allow modellers to concentrate on the economic issues without needing to write their own software. However, it may occasionally be necessary to write programs to carry out some specialised tasks which cannot be carried out using the general-purpose tools provided. Even then, programmers with access to a Source-code version of GEMPACK can make use of the many Fortran routines supplied with GEMPACK. This paper gives an introduction to using GEMPACK subroutines in writing your own Fortran programs. It gives a brief overview of some of the ideas behind the GEMPACK code such as error handling and to some of the routines available for opening, reading and writing Header Array files. By using standard GEMPACK routines, you can avoid knowing, in great detail, the structure of GEMPACK file types such as Header Array files. We provide and describe in detail two typical programs which illustrate the techniques involved. The first program reads data from a non-GEMPACK text file, modifies it and then writes the modified data to a Header Array file. The second program reads some simulation results from Header Array files and calculates and writes arrays showing the differences between these results. The example programs we provide have been chosen because these are two of the tasks for which it may occasionally be necessary to write programs. However, because we want to emphasise how you can use the existing GEMPACK routines to do much of your work, we have chosen to present somewhat simplified versions of the actual tasks which may confront a modeller. For example, in the first example program, a) we present rather simple versions of the complexities which may be necessary in order to read and modify data taken from a non-GEMPACK source. b) we read, modify and write only one array (whereas a real-life program would probably have to deal with several arrays). As well as the two example programs, we provide information as to where you can find the source code for different GEMPACK subroutines, how they are organised and how you can compile and link your programs to the GEMPACK libraries. We also provide templates MODELPRG for a main program (see section 4) and MODELSUB for a subroutine (see section 5). These contain the standard declarations and calls. When we develop a new main program or subroutine, we always start from these. We recommend that you do the same. Once you have become familiar with the material here, you will be in a good position to understand the code in any of the GEMPACK utility programs (those described in GEMPACK document GPD-4).

Suggested Citation

  • Harrison, Jill W. & Horridge, J. Mark & Pearson, Ken, 2005. "Using GEMPACK Subroutines in your Fortran Programs," Conference papers 331348, Purdue University, Center for Global Trade Analysis, Global Trade Analysis Project.
  • Handle: RePEc:ags:pugtwp:331348
    as

    Download full text from publisher

    File URL: https://ageconsearch.umn.edu/record/331348/files/1861.pdf
    Download Restriction: no
    ---><---

    References listed on IDEAS

    as
    1. Aaditya Mattoo & Devesh Roy & Arvind Subramanian, 2003. "The Africa Growth and Opportunity Act and its Rules of Origin: Generosity Undermined?," The World Economy, Wiley Blackwell, vol. 26(6), pages 829-851, June.
    2. DeVuyst, Eric A. & Preckel, Paul V., 1997. "Sensitivity analysis revisited: A quadrature-based approach," Journal of Policy Modeling, Elsevier, vol. 19(2), pages 175-185, April.
    3. Aziz Elbehri & Thomas Hertel & Will Martin, 2003. "Estimating the Impact of WTO and Domestic Reforms on the Indian Cotton and Textile Sectors: a General‐Equilibrium Approach," Review of Development Economics, Wiley Blackwell, vol. 7(3), pages 343-359, August.
    4. Hertel, Thomas, 1997. "Global Trade Analysis: Modeling and applications," GTAP Books, Center for Global Trade Analysis, Department of Agricultural Economics, Purdue University, number 7685, December.
    5. Kathuria, Sanjay & Bhardwaj, Anjali, 1998. "Export quotas and policy constraints in the Indian textile and garment industries," Policy Research Working Paper Series 2012, The World Bank.
    Full references (including those not matched with items on IDEAS)

    Most related items

    These are the items that most often cite the same works as this one and are cited by the same works as this one.
    1. Aziz ELBEHRI, 2010. "MFA Quota Removal and Global Textile and Cotton Trade: Estimating Quota Trade Restrictiveness and Quantifying Post-MFA Trade Patterns," EcoMod2004 330600048, EcoMod.
    2. Kym Anderson & Ernesto Valenzuela & Lee Ann Jackson, 2008. "Recent and Prospective Adoption of Genetically Modified Cotton: A Global Computable General Equilibrium Analysis of Economic Impacts," Economic Development and Cultural Change, University of Chicago Press, vol. 56(2), pages 265-296, January.
    3. McCorriston, Steve & MacLaren, Donald, 2005. "Market Access and the Reform of State Trading Enterprises," Conference papers 331330, Purdue University, Center for Global Trade Analysis, Global Trade Analysis Project.
    4. Bernard, Alain & Vielle, Marc & Viguier, Laurent, 2004. "Modeling the European Directive Establishing a Scheme for Greenhouse Gas Allowance Trading and Assessing the Market Power of Firms," Conference papers 331190, Purdue University, Center for Global Trade Analysis, Global Trade Analysis Project.
    5. Kym Anderson & Ernesto Valenzuela & Lee Ann Jackson, 2007. "Recent and Prospective Adoption of Genetically Modified Cotton: A Global CGE Analysis of Economic Impacts," Centre for International Economic Studies Working Papers 2007-07, University of Adelaide, Centre for International Economic Studies.
    6. Cerra, Valerie & Rivera, Sandra A. & Saxena, Sweta Chaman, 2004. "Crouching Tiger, Hidden Dragon: What are the Consequences of China’s WTO Entry for India’s Trade?," Conference papers 331297, Purdue University, Center for Global Trade Analysis, Global Trade Analysis Project.
    7. Lips, Markus & Rieder, Peter, 2002. "Endogenous adjusted Output Quotas - The Abolishment of the Raw Milk Quota in the European Union," Conference papers 330980, Purdue University, Center for Global Trade Analysis, Global Trade Analysis Project.
    8. Walmsley, Terrie L. & Hertel, Thomas W. & Ianchovichina, Elena, 2001. "Assessing the Impact of China’s WTO Accession on Foreign Ownership," Conference papers 330941, Purdue University, Center for Global Trade Analysis, Global Trade Analysis Project.
    9. Hertel, Thomas W. & Reimer, Jeffrey J. & Valenzuela, Ernesto, 2003. "Incorporating Commodity Stockholding Behavior Into A Short-Run General Equilibrium Model Of The Global Economy," 2003 Annual meeting, July 27-30, Montreal, Canada 22110, American Agricultural Economics Association (New Name 2008: Agricultural and Applied Economics Association).
    10. Hertel, Thomas W. & Keeney, Roman & Valenzuela, Ernesto, 2004. "Global Analysis of Agricultural Trade Liberalization: Assessing Model Validity," Conference papers 331270, Purdue University, Center for Global Trade Analysis, Global Trade Analysis Project.
    11. Hertel, Thomas W. & Tyner, Wallace E. & Birur, Dileep K., 2008. "Biofuels for all? Understanding the Global Impacts of Multinational Mandates," 2008 Annual Meeting, July 27-29, 2008, Orlando, Florida 6526, American Agricultural Economics Association (New Name 2008: Agricultural and Applied Economics Association).
    12. T. Chatzivasileiadis & F. Estrada & M. W. Hofkes & R. S. J. Tol, 2019. "Systematic Sensitivity Analysis of the Full Economic Impacts of Sea Level Rise," Computational Economics, Springer;Society for Computational Economics, vol. 53(3), pages 1183-1217, March.
    13. Hertel, Thomas & Hummels, David & Ivanic, Maros & Keeney, Roman, 2007. "How confident can we be of CGE-based assessments of Free Trade Agreements?," Economic Modelling, Elsevier, vol. 24(4), pages 611-635, July.
    14. B. Henderson & A. Golub & D. Pambudi & T. Hertel & C. Godde & M. Herrero & O. Cacho & P. Gerber, 2018. "The power and pain of market-based carbon policies: a global application to greenhouse gases from ruminant livestock production," Mitigation and Adaptation Strategies for Global Change, Springer, vol. 23(3), pages 349-369, March.
    15. Misak Avetisyan & Thomas Hertel & Gregory Sampson, 2014. "Is Local Food More Environmentally Friendly? The GHG Emissions Impacts of Consuming Imported versus Domestically Produced Food," Environmental & Resource Economics, Springer;European Association of Environmental and Resource Economists, vol. 58(3), pages 415-462, July.
    16. Hertel Thomas, 2011. "Comment on "The Distributional Impact of Climate Policy"," The B.E. Journal of Economic Analysis & Policy, De Gruyter, vol. 10(2), pages 1-6, April.
    17. Soo Yuen Chong & Jung Hur, 2007. "Overlapping Free Trade Agreements of Singapore-USA-Japan : A Computational Analysis," Trade Working Papers 21931, East Asian Bureau of Economic Research.
    18. Aaditya Mattoo & Devesh Roy & Arvind Subramanian, 2003. "The Africa Growth and Opportunity Act and its Rules of Origin: Generosity Undermined?," The World Economy, Wiley Blackwell, vol. 26(6), pages 829-851, June.
    19. Randhir, Timothy O. & Hertel, Thomas W., 2000. "Trade Liberalization as a Vehicle for Adapting to Global Warming," Agricultural and Resource Economics Review, Cambridge University Press, vol. 29(2), pages 159-172, October.
    20. Domingues, Edson P. & Haddad, Eduardo A. & Hewings, Geoffrey, 2008. "Sensitivity analysis in applied general equilibrium models: An empirical assessment for MERCOSUR free trade areas agreements," The Quarterly Review of Economics and Finance, Elsevier, vol. 48(2), pages 287-306, May.

    Corrections

    All material on this site has been provided by the respective publishers and authors. You can help correct errors and omissions. When requesting a correction, please mention this item's handle: RePEc:ags:pugtwp:331348. See general information about how to correct material in RePEc.

    If you have authored this item and are not yet registered with RePEc, we encourage you to do it here. This allows to link your profile to this item. It also allows you to accept potential citations to this item that we are uncertain about.

    If CitEc recognized a bibliographic reference but did not link an item in RePEc to it, you can help with this form .

    If you know of missing items citing this one, you can help us creating those links by adding the relevant references in the same way as above, for each refering item. If you are a registered author of this item, you may also want to check the "citations" tab in your RePEc Author Service profile, as there may be some citations waiting for confirmation.

    For technical questions regarding this item, or to correct its authors, title, abstract, bibliographic or download information, contact: AgEcon Search (email available below). General contact details of provider: https://edirc.repec.org/data/gtpurus.html .

    Please note that corrections may take a couple of weeks to filter through the various RePEc services.

    IDEAS is a RePEc service. RePEc uses bibliographic data supplied by the respective publishers.