Coder Social home page Coder Social logo

pygamman's Introduction

The python package install does not seem to work. For the simple f2py wrapper see: https://github.com/guidov/pygamman_f2py

pygamman: Python interface to PreTEOS-10 neutral density fortran code

Jackett, David R., Trevor J. McDougall, 1997: A Neutral Density Variable for the World's Oceans. J. Phys. Oceanogr., 27, 237โ€“263. doi: 10.1175/1520-0485(1997)0272.0.CO;2

  • Author:
  • License: BSD 3-clause

See: http://www.teos-10.org/preteos10_software/neutral_density.html

About

Neutral Density surfaces are the most natural layer interfaces stratifying the deep ocean circulation. Neutral Density arises as the continuous analogue of discretely defined locally-referenced potential density surfaces, surfaces which have long been recognised as the most sophisticated for deep ocean density stratification. To account for the compressible nature of sea-water, neutral density is a function of both hydrography and geographical position, and as such is much simpler to use than the cumbersome potential density surface method currently in use.

The Neutral Density code comes as a package of FORTRAN routines which enable the user to fit neutral density surfaces to arbitrary hydrographic data. The FORTRAN implementation consists of a FORTRAN subroutine which labels a cast of hydrographic data with neutral density, and another subroutine which then finds the positions of specified neutral density surfaces within the water column. All code comes with documentation in the form of Readme files, as well as Makefiles and examples to provide check values for the user.

Installation (only tested on Ubuntu 14.04 with gcc 4.8.2 and numpy 1.9.0)

Requires f2py, gfortran (or other fortran compiler)

NOTE************ There is a problem with the order of the compilation of the fortran module and data files and the order of the python module installation.

With the current version of the code the install command has to be run twice (or build then install) for the data and wrapped library to be installed to python lib directory correctly


You can build the package locally using

[~]$ python setup.py build

or install the package to the standard Python path using:

[~]$ python setup.py install

Or, to install to another location, use

[~]$ python setup.py install --prefix=/path/to/location/

Then make sure your PYTHONPATH environment variable points to this location.

Trying it out

See examples and notebook directory

Known Problems and TODO:

  1. Geting this message on calculation of gamma_n on CTD WARNING 1 in goor-solve.f

Solution: ignore warning

  1. Getting error which kills the python interpreter (also in the ipython notebook) ERROR 1 in gamma-n.f : out of oceanographic range

Solution: Routine will not work for latitudes < 80S and > 64N

pygamman's People

Contributors

guidov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

pygamman's Issues

Problen in installation

Hi I'm having a problem with the installation
python setup.py install
Egg name: pygamman-0.1.egg-info
running install
running build
running build_py
Traceback (most recent call last):
File "setup.py", line 120, in
'Programming Language :: Python :: >2.6']
File "/usr/lib/python2.7/dist-packages/numpy/distutils/core.py", line 169, in setup
return old_setup(**new_attr)
File "/usr/lib/python2.7/distutils/core.py", line 151, in setup
dist.run_commands()
File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/usr/lib/python2.7/distutils/command/install.py", line 601, in run
self.run_command('build')
File "/usr/lib/python2.7/distutils/cmd.py", line 326, in run_command
self.distribution.run_command(command)
File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "setup.py", line 43, in run
build.run(self)
File "/usr/lib/python2.7/distutils/command/build.py", line 128, in run
self.run_command(cmd_name)
File "/usr/lib/python2.7/distutils/cmd.py", line 326, in run_command
self.distribution.run_command(command)
File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/usr/lib/python2.7/dist-packages/numpy/distutils/command/build_py.py", line 9, in run
build_src = self.get_finalized_command('build_src')
File "/usr/lib/python2.7/distutils/cmd.py", line 312, in get_finalized_command
cmd_obj.ensure_finalized()
File "/usr/lib/python2.7/distutils/cmd.py", line 109, in ensure_finalized
self.finalize_options()
File "/usr/lib/python2.7/dist-packages/numpy/distutils/command/build_src.py", line 128, in finalize_options
build_ext = self.get_finalized_command('build_ext')
File "/usr/lib/python2.7/distutils/cmd.py", line 312, in get_finalized_command
cmd_obj.ensure_finalized()
File "/usr/lib/python2.7/distutils/cmd.py", line 109, in ensure_finalized
self.finalize_options()
File "/usr/lib/python2.7/dist-packages/numpy/distutils/command/build_ext.py", line 75, in finalize_options
self.set_undefined_options('build', ('parallel', 'parallel'))
File "/usr/lib/python2.7/distutils/cmd.py", line 302, in set_undefined_options
getattr(src_cmd_obj, src_option))
File "/usr/lib/python2.7/distutils/cmd.py", line 105, in getattr
raise AttributeError, attr
AttributeError: parallel

gamma_n only works for single profiles?

Thanks for making this, it took me a little while but I got it installed in the end (after reading the other closed issues)! I get the following error when using arrays (section of profiles):

error: failed in converting 1st argument 's' of gamman.gamma_n to C/Fortran array

Presumably the function can only handle single profiles at a time?

bug in local installation

I am trying to run this code on a shared cluster (yellowstone), where I can't do a global installation. I did a local install instead using the user scheme:

$ python setup.py install --user

This went well, and I can import the module. However, when I try to actually run the example, I get an error:

$ python neutral_density_test.py 
0.000127370614791
24.0
[ 35.066  35.086  35.089  35.078  35.025  34.851  34.696  34.572  34.531
  34.509  34.496  34.452  34.458  34.456  34.488  34.536  34.579  34.612
  34.642  34.657  34.685  34.707  34.72   34.729]
[ 12.25   12.21   12.09   11.99   11.69   10.54    9.35    8.36    7.86
   7.43    6.87    6.04    5.5     4.9     4.04    3.29    2.78    2.45
   2.211   2.011   1.894   1.788   1.554   1.38 ]
[  1.00000000e+00   4.80000000e+01   9.70000000e+01   1.45000000e+02
   1.94000000e+02   2.91000000e+02   3.88000000e+02   4.85000000e+02
   5.81000000e+02   6.78000000e+02   7.75000000e+02   8.72000000e+02
   9.69000000e+02   1.06600000e+03   1.26000000e+03   1.45400000e+03
   1.64700000e+03   1.84100000e+03   2.02000000e+03   2.21600000e+03
   2.41300000e+03   2.61100000e+03   2.87800000e+03   3.00000000e+03]
187.317
-41.6667
24
At line 2374 of file pygamman/fortran/gamman.f (unit = 20, file = '')
Fortran runtime error: File '/glade/apps/opt/python/2.7.7/gnu-westmere/4.8.2/lib/python2.7/site-packages/pygamman/ocndata/llp.fdt' does not exist

It looks like it is not looking for the data file in the right place.

Any ideas on how to overcome this?

Install gamman on Mac os x

If I try running
python setup.py install
I get the error message:
.... /anaconda2/lib/python2.7/distutils/cmd.py", line 105, in getattr
raise AttributeError, attar
Is there a nice and clean way to get the pygamman running on Mac osx?
Thank you for your help,
Patricia

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.