GithubHelp home page GithubHelp logo

turblib's Introduction

Turblib -- A JHU Turbulence Database Cluster C and Fortran Interface Library

See the end of the file for license conditions.

About this package

This library provides a C and Fortran Interface 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 DEMO_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.

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

License

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.

turblib's People

Contributors

zzwz02 avatar chichilalescu avatar kkanov avatar reggiethu2017 avatar mzwang2012 avatar

Stargazers

Lane Carasik avatar Jefferson Amstutz avatar Will Usher avatar Nicholas Geneva avatar  avatar  avatar

Watchers

Stephen Hamilton avatar James Cloos avatar Dmitry Mishin avatar  avatar Dmitry Medvedev avatar  avatar  avatar suzanne werner avatar  avatar  avatar  avatar  avatar Lukas Codispoti avatar

turblib's Issues

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.