Skip to content
No description, website, or topics provided.
C C++ Fortran Other
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
DEMO_channelc
DEMO_channelc.c
DEMO_channelf
DEMO_channelf.f90
DEMO_getCutoutc
DEMO_getCutoutc.c
DEMO_getCutoutf
DEMO_getCutoutf.f90
DEMO_mhdc
DEMO_mhdc.c
DEMO_mhdf
DEMO_mhdf.f90
DEMO_mixingc
DEMO_mixingc.c
DEMO_mixingf
DEMO_mixingf.f90
DEMO_turbc
DEMO_turbc.c
DEMO_turbf
DEMO_turbf.f90
LICENSE-2.0.txt
Makefile
README.md
TurbulenceService.h
TurbulenceServiceSoap.nsmap
soapC.c
soapClient.c
soapH.h
soapStub.h
stdsoap2.c
stdsoap2.h
testall
turblib.c
turblib.h

README.md

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.

You can’t perform that action at this time.