Project

General

Profile

Calling CDO functions from inside FORTRAN

Added by Marston Ward about 9 years ago

Hi,

I would like to know if it is possible to call CDO specific functions from inside a fortran subroutine and have the data
be returned to the calling function? For example, can I link the CDO library to my fortran library and call remapcon?
If so, how could I go about doing this?

Appreciate any ideas/help rendered,
/M


Replies (3)

RE: Calling CDO functions from inside FORTRAN - Added by Ralf Mueller about 9 years ago

Hi Marston!

This is not possible because of several reasons

  • There is no CDO library, which has an api for calling operators
  • operators are C-functoin pointers, which would make them complex to use in fortran
  • operators do not work on something like a real field, but separately handled CDI streams - transforming fortran arrays into CDI Stream and vice versa would be necessary with the current implementation

IMO the current implemention of CDO is not suited for being used in a library-like way used fortran. I don't say, it not possible at the moment, I don't say it will never be possible, but it is simply not designed that way.

Currently the implementation is focused on

  • IO targets are files with support for many formats
  • operators should be combinable as much as possible
  • combined operator calls should run in parallel as much as possible

I think, it would be great to use CDO functionality from other languages, but I also guess that a design review would be necessary.

cheers
ralf

RE: Calling CDO functions from inside FORTRAN - Added by Jaison-Thomas Ambadan about 9 years ago

Hi Marston,

If you need only the remap functionality, you could try using the SCRIP package which is written in FORTRAN I guess: http://oceans11.lanl.gov/trac/SCRIP CDO remaps are based on SCRIP library.

Cheers,
J

RE: Calling CDO functions from inside FORTRAN - Added by Marston Ward about 9 years ago

Hi Ralf, J,

Thanks for the information guys. I understand the situation with CDO.

Yes, Ralf, it would be great to be able to use CDO as a library and use the functions from within other programs. Something to think about for the future, perhaps.

J, yes, I am looking at SCRIPS as well as EMOS. Just trying not to reinvent the wheel here.

Appreciate the info,

/M

    (1-3/3)