First, if you have not already done so, consult the docstring
in __init__.py, and in particular, look at src/README and
src/ConditionsOfUse.  (These file paths are all relative to
[repo_root]/src/pygamma_n.) The latter is the relevant license
information for the original code.  All modifications and
additions that I have made here are

Copyright 2010-2024, Eric Firing

and are released under the conditions of the MIT license:

http://www.opensource.org/licenses/mit-license.php


#------------------------------------------------------------------

The original procedure for developing the python wrapper is described
in the following:

Steps toward building the python interface to the gamma-n fortran
code.  We are starting in what will be the working directory, and
we have uncompressed gamma.tar.Z in its parent directory.  It is
obtained from

    ftp://ftp.marine.csiro.au/pub/jackett/gamma.tar.Z

###

tar -x -f ../gamma.tar \
             gamma/gamma.nc         \
             gamma/atg.f            \
             gamma/ConditionsOfUse  \
             gamma/depth-ns.f       \
             gamma/depth-scv.f      \
             gamma/derthe.f         \
             gamma/eos8d.f          \
             gamma/eosall.f         \
             gamma/e-solve.f        \
             gamma/example.f        \
             gamma/gamma-errors.f   \
             gamma/gamma-n.f        \
             gamma/gamma-qdr.f      \
             gamma/get-lunit.f      \
             gamma/goor.f           \
             gamma/goor-solve.f     \
             gamma/index.f          \
             gamma/neutral-surfaces.f  \
             gamma/ocean-test.f        \
             gamma/README              \
             gamma/read-nc.F           \
             gamma/scv-solve.f         \
             gamma/sig-vals.f          \
             gamma/stp-interp.f        \
             gamma/svan.f              \
             gamma/theta.f

mv gamma src
mkdir data
mv src/*.nc data

# Initialize the mercurial repository.
hg init

# add  .hgignore file

hg add
hg commit

# From this point on, changes are recorded as hg commits.

The initial changes to the fortran code are minimal: remove the
need for a preprocessing stage by making the gamma.nc file path
a function argument instead of a compiled-in constant determined
at compile time.

The _gamma.pyf file was initially generated by changing the extensions
to *.f90 to get around the non-f77-standard long lines, and then running:

f2py -h gamma-n.pyf --overwrite-signature\
          atg.f90 \
          depth-ns.f90 \
          depth-scv.f90 \
          derthe.f90 \
          eosall.f90 \
          eos8d.f90 \
          e-solve.f90 \
          gamma-errors.f90 \
          gamma-n.f90 \
          goor.f90 \
          gamma-qdr.f90 \
          get-lunit.f90 \
          goor-solve.f90 \
          index.f90 \
          neutral-surfaces.f90 \
          ocean-test.f90 \
          scv-solve.f90 \
          sig-vals.f90 \
          stp-interp.f90 \
          svan.f90 \
          theta.f90 \
          read-nc.F90 \
        only: gamma_n neutral_surfaces

This preliminary version was then edited to add module and
interface directives.

In the current version, the gamma-n.pyf file was regenerated using numpy 2.0
and after conversion of the only files actually needed for this, gamma-n.f90
and neutral-surfaces.f90 to Fortran-90.  Then f2py was run manually to generate
_gammamodule.c.

