Giter Club home page Giter Club logo

turblib's Introduction

	Copyright 2011 Johns Hopkins University

	Licensed under the Apache License, Version 2.0 (the "License");
	you may not use this file except in compliance with the License.
	You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

	Unless required by applicable law or agreed to in writing, software
	distributed under the License is distributed on an "AS IS" BASIS,
	WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
	See the License for the specific language governing permissions and
	limitations under the License.


JHU Turbulence Database Cluster
C and Fortran Interface Library
http://turbulence.pha.jhu.edu/

**** About this package ****

This library provides a very simple wrapper around gSOAP for
calling the JHU Turbulence Database Cluster.

More information can be found at:
  http://turbulence.pha.jhu.edu/help/c-fortran/

'make' will build both the Fortran and C sample code.
Use 'make turbc' if you do not have a Fortran compiler
installed.  Note: On some platforms, you may need to use
'gmake' (GNU Make) instead.

**** Identification Token (required for large queries) ****

While our service is open to anyone, we would like to keep track
of who is using the service, and how.  To this end, we would
like each user or site to obtain an authorization token from us:
  http://turbulence.pha.jhu.edu/help/authtoken.html

If you are just experimenting, the default token included in
these test files should be valid.

**** Working with hdf5 cutout files ****

Cutouts of data from the dataset can be downloaded in hdf5 format by
visiting "http://turbulence.pha.jhu.edu/cutout.aspx". 

If you wish to work with hdf5 files downloaded from our cutout
utility you need an hdf5 installation. In order to use the
functions for computing interpolation, derivatives, etc. locally 
(rather than submitting queries to the Web server)
you need to build the code with the option "CUTOUT_SUPPORT=1", e.g.:

$ make turbc CUTOUT_SUPPORT=1

The Makefile looks for an hdf5 installation in the hdf5-1.8.9 directory 
in the user's local directory ("~/hdf5-1.8.9"). To specify a different 
installation directory change the H5DIR variable in the Makefile.

Cutout files are loaded with the turblibAddLocalSource() function, which
takes the filename as argument. Multiple files can be loaded (make a
call to turblibAddLocalSource() for each additional file). 

**** Platform-specific notes ****

___Mac OS X:___
This code has been tested under Mac OS X 10.4 (Tiger),
10.5 (Leopard), 10.6 (Snow Leopard) and 10.7 (Lion).

You will need the Apple Developer Tools (Xcode), which can be
found on your OS X install disk, or downloaded for free (with
registration) from http://developer.apple.com/ .

If you wish to use fortran, you will need to install gfortran.
We used both the precompiled version available from
http://hpc.sourceforge.net/ or the version bundled with the
R statistical package ( http://www.r-project.org/ ).

___Linux:___
Most gcc releases should work.  If you wish to use fortran you
will need to install gfortran, available as an optional package
with most Linux distributions.

___Other:___
Please let us know if any changes are needed for the code to
compile on other platforms or with different compilers.

**** Error Handling ****

By default, the turbulence library will print errors out to the
console and abort the program.  You can change this behavior by
calling turblibSetExitOnError(0) before making any calls to the
turbulence database.  You will then be responsible for checking
the return codes.

___C Example:___
turblibSetExitOnError(0);
...
if (getVelocity ( ... ) != SOAP_OK) {
  turblibPrintError();
  exit(1);
}

__Fortran Example:___
integer, parameter :: SOAP_OK = 0  ! From stdsoap2.h
integer rc
CALL turblibSetExitOnError(0)
...
rc = getVelocity( ... )
if (rc.ne.SOAP_OK) then
  CALL turblibPrintError()
  STOP
end if


**** Handling intermittent failures ****

We suggest writing long-running code to handle any intermittent network
or database failures which may occur.  The following sample code will
try each query up to 30 times, with a delay of 1 minute between each
attempt.

In addition, we suggest adding checkpoints to your code to allow
for the continuation after longer failures.

___C:___
int attempts = 0;
turblibSetExitOnError(0);
while (getVelocity ( ... ) != SOAP_OK) {
  if (attempts++ > 30) {
    printf("Fatal Error: too many failures\n");
    exit(1);
  } else {
    printf("Temporary Error: %s\n", turblibGetErrorString());
  }
  sleep(60);
}

___Fortran:___
integer attempts
attempts = 0
CALL turblibSetExitOnError(0)
do while (getVelocity( ... ).ne.0)
  attempts = attempts + 1
  if (attempts.ge.30) then
    write(*,*) 'Fatal error: too many failures'
    CALL turblibPrintError()
    STOP
  else
    write(*,*) 'Temporary Error (#', attempts, '):'
    CALL turblibPrintError()
    CALL sleep(1)
  end if
end do

$Id: README,v 1.10 2010-03-10 04:09:00 eric Exp $

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.