Skip to main content
  • Home
  • Documentation
  • FAQ
  • Downloads
  • Support
  • Current Release Notes
  • Ferret Users Guide
    • Users Guide Index
    • Commands Reference
    • 1. Introduction
    • 2. Data Set Basics
    • 3. Variables & Expressions
    • 4. Grids & Regions
    • 5. Animations & Gif Images
    • 6. Customizing Plots
    • 7. Handling String Data Symbols
    • 8. Working with Special Data Sets
    • 9. Computing Environment
    • 10. Converting to NetCDF
    • 11. Writing External Functions
    • Glossary
    • Appendix A: Functions
    • Appendix B: PPLUS Guide
    • Appendix C: Ferret-Specific PPLUS Enhancements
  • Previous Release Notes
  • Tutorials and Demos
    • Ferret Tour
    • DSG files: Discrete Sampling Geometries Demo
    • Ferret sorting demo
    • Fast Fourier Transforms demo
    • Empirical Orthogonal Functions demo
    • Ferret objective analysis demo
    • Ferret Palette Demo
    • Map projections
    • Ferret polygon vector demo
    • Ferret Graticules demo
    • Ferret Polytube Demo
    • Ferret Polymark Demo
    • Ferret Constant-Array demo
    • Ferret land_detail demo
    • COADS Tour
    • Levitus Tour
    • Use OPeNDAP
    • Ferret binary read demo
  • PyFerret
    • PyFerret Downloads and Install ../../faq/ferret-faqs.html
    • What is PyFerret?
    • Why use PyFerret?
    • PyFerret for the Ferret user
    • PyFerret command syntax: quick-start notes
    • PyFerret for the Python user
    • Graphics in PyFerret ?
    • New Ferret functionality
    • PyFerret Python functions and constants
    • PyFerret Python objects and methods
    • Ferret external functions in Python
    • Ferret Fortran external functions
    • PyFerret metadata-and-data dictionaries
  • OPeNDAP
    • OPeNDAP usage in Ferret
    • Use OPeNDAP Demo
    • Test OPeNDAP

11.2 GETTING STARTED


Ferret Version 5.0 and later contains everything you need to run the external functions which are included with the distribution. The environment variable FER_EXTERNAL_FUNCTIONS is defined, listing the directory where the shared object files reside. To see a list of the included external functions and their arguments, type

> ferret
...
yes? SHOW FUNC/EXTERNAL
Externally defined functions available to Ferret:
ADD_9(A,B,C,D,E,F,G,H,I)
(demonstration function) adds 9 arguments
AVET(A)
(demonstration function) returns the time average
A: data to be time averaged
...


11.2.1 Getting example/development code

To write your own external functions, you will need to get source code and set up a directory in which to work. All of the source code you need to get started (Makefiles, common files, simple examples) can be obtained from the Ferret Home Page. Go to the External Functions page and follow the instructions there.

You will need to download a tar file to get started. When you untar this file you will find that the ef_utility/ directory contains the ferret_cmn subdirectory, containing common files that you need to compile external functions. The ef_utility/ directory must be in place before you can compile any of the other external function code. The examples/ directory contains source code and a Makefile. You will create further directories with your external functions source code and Makefiles patterned on what is in the examples directory.

Also on the External Functions web page are documents about how to use code written in Fortran 90 and on compiling code with an F95 compiler, contributed by Ferret users.