Giter Site home page Giter Site logo

mocsy's Introduction

mocsy

Routines to model ocean carbonate system thermodynamics

Synopsis: mocsy is a Fortran 95 package designed to compute all carbonate system variables from total dissolved inorganic carbon (DIC) and total alkalinity, particularly from models. It updates previous OCMIP code, avoids 3 common model approximations, and offers the best-practice constants as well as more recent options. It agrees with CO2SYS within 0.005%.

The mocsy package is described by Orr and Epitalon (2015) and has been compared to other packages that compute marine carbonate chemistry (Orr et al., 2015). More recently, new routinnes were added to propagate uncertainties and compute sensitivities of derived variables to input variables (Orr et al., 2018)

Documentation and Examples

REFERENCES

Orr, J. C. and Epitalon, J.-M. (2015) Improved routines to model the ocean carbonate system: mocsy 2.0, Geosci. Model Dev., 8, 485-499, https://doi.org/10.5194/gmd-8-485-2015 .

Orr, J. C., J.-P. Gattuso, and J.-M. Epitalon (2015) Comparison of ten packages that compute ocean carbonate chemistry, Biogeosciences, 12, 1483โ€“1510, https://doi.org/10.5194/bg-12-1483-2015 .

Orr, J.C., J.-M. Epitalon, A. G. Dickson, and J.-P. Gattuso (2018) Routine uncertainty propagation for the marine carbon dioxide system, in prep. for Mar. Chem., in press, https://doi.org/10.1016/j.marchem.2018.10.006 .

mocsy's People

Contributors

jamesorr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

mocsy's Issues

Error on `make mocsy.so` on mac

Following http://ocmip5.ipsl.jussieu.fr/mocsy/pyth.html with gfortran and numpy installed, make mocsy.so breaks with the current Makefile.

The culprit is cp -f -s src/$(KIND_MAP) .f2py_f2cmap under the mocsy.so target. It seems like Mac doesn't have the -s flag. Removing that allows it to run just fine. Perhaps the symbolic linking isn't necessary?

Questions about mocsy use and packaging

xref: ioos/conda-recipes#563 (comment)

@jamesorr answer to some of the questions @emiliom and @ocefpaf raised while packaging mocsy.

  1. Yes, mocsy uses EOS-80 and not TEOS-10 because it was the former that was in vigor when the best practices were defined (Dickson et al., 2007). Furthermore, I would not change everything to TEOS10, not yet anyway, because many ocean carbon cycle models still use EOS80. A better option may be to provide functions to convert between TEOS-10 and EOS-80, but this may already be found elsewhere.

That is good to know. Thanks! In my simple mind I would just update everything.

  1. The large subsurface pCO2 differences you are seeing is not an error. See the documentation of the OPTGAS function in the fortran code. Results for pCO2 vary greatly as a function of that option, as detailed in the final publication describing mocsy v2.0 (Fig. 1, section 2.1.3):
    http://www.geosci-model-dev.net/8/485/2015/gmd-8-485-2015.html

In that regard I want to convert the webpage notebooks to unittests to lower the bar for future mocsy development. @jamesorr I will do that in a separate PR ASAP.

  1. The docstrings in mocsy are those extracted automatically by f2py from the original fortran code. Perhaps they can be improved with options to f2py; I'll need to check.

Don't worry to much about that. If we go start writing wrapping functions in Python we might want to avoid the automatic generated docstrings. (The main reason behind this would be to use sphinx to generate docs from the docstrings.)

Finally, note that 'mocsy' is first and foremost designed for ocean models making carbonate chemistry calculations ONLINE, i.e., during model runs (in Fortran). The OFFLINE calculations, which mocsy allows to be done conveniently in python are a big plus, but I would really like to avoid calling routines in python (e.g., from 'seawater') because that would break the compatibility between the Fortran and python use of mocsy.

That is fine. (Although I would like to see a comparison of what would break just for the sake if curiosity.)

With that being said we have a decision to make. I was lazy in the packaging PR #1 and I copied all l the Fortran code into a single file. Since the design is ONLINE computation that single file is probably not OK.

Solutions:

  1. We write a script that generates the single file from the original Fortran code.
  2. I do a better job wrapping all the individual files. (Following more closely what is already done with the Makefile.

(1) Is hackish, but easy. I am not sure if I can do (2), although that is probably the better way.

I will read more about packing Fortran modules in Python and come up with a better solution for this. Meanwhile let's avoid merging #1.

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.