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. 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.
    2. 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.
    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. 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.
    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. 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.
    4. 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.
    5. 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.
    6. 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.
    7. 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.
    8. 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).
    9. 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.
    10. 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.
    11. 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.
    12. 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.
    13. 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.
    14. 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.
    15. Cristina Cattaneo, 2008. "The Determinants of Actual Migration and the Role of Wages and Unemployment in Albania: an Empirical Analysis," European Journal of Comparative Economics, Cattaneo University (LIUC), vol. 5(1), pages 3-32, June.
    16. Nelson B Villoria & Paul V Preckel, 2017. "Gaussian Quadratures vs. Monte Carlo Experiments for Systematic Sensitivity Analysis of Computable General Equilibrium Model Results," Economics Bulletin, AccessEcon, vol. 37(1), pages 480-487.
    17. Mario Holzner, 2004. "GSIM Measurement of the Costs of Protection in Southeast Europe," wiiw Balkan Observatory Working Papers 55, The Vienna Institute for International Economic Studies, wiiw.
    18. Meenu Tewari, 2005. "The Role of Price and Cost Competitiveness in Apparel Exports, Post-MFA: A Review," Indian Council for Research on International Economic Relations, New Delhi Working Papers 173, Indian Council for Research on International Economic Relations, New Delhi, India.
    19. International Monetary Fund, 2005. "Crouching Tiger, Hidden Dragon: What Are the Consequences of China’s WTO Entry for India’s Trade?," IMF Working Papers 2005/101, International Monetary Fund.
    20. Randhir, Timothy O. & Hertel, Thomas W., 2000. "Trade Liberalization As A Vehicle For Adapting To Global Warming," Agricultural and Resource Economics Review, Northeastern Agricultural and Resource Economics Association, vol. 29(2), pages 1-14, October.

    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.