EconPapers    
Economics at your fingertips  
 

Using GEMPACK Subroutines in your Fortran Programs

Jill W. Harrison, Mark Horridge and Ken Pearson

No 331348, Conference papers from Purdue University, Center for Global Trade Analysis, Global Trade Analysis Project

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).

Keywords: Research Methods/ Statistical Methods; Research and Development/Tech Change/Emerging Technologies (search for similar items in EconPapers)
Pages: 29
Date: 2005
References: View references in EconPapers View complete reference list from CitEc
Citations:

Downloads: (external link)
https://ageconsearch.umn.edu/record/331348/files/1861.pdf (application/pdf)

Related works:
This item may be available elsewhere in EconPapers: Search for items with the same title.

Export reference: BibTeX RIS (EndNote, ProCite, RefMan) HTML/Text

Persistent link: https://EconPapers.repec.org/RePEc:ags:pugtwp:331348

Access Statistics for this paper

More papers in Conference papers from Purdue University, Center for Global Trade Analysis, Global Trade Analysis Project Contact information at EDIRC.
Bibliographic data for series maintained by AgEcon Search ().

 
Page updated 2025-03-22
Handle: RePEc:ags:pugtwp:331348