gcc compatibility

Place here all posts related to implementation and source codes. This forum is rather technical and reserved for programmers.
Post Reply
valerio
Posts: 10
Joined: Mon Jan 14, 2008 1:56 pm

gcc compatibility

Post by valerio »

Hi Marc,
just an idea: the header qtbwave.h can be modified the following way, to get compatibility with gcc using pure C calls.

Additionally: do you also have a C wrapper for ellipticity calculation?
I'm asking only because I don't want to reinvent the wheel ( :D ), otherwise I'll try to add it my self (hope I'll be able!)
Ciao and thanks.

-------------------------------------------------------------
# ifndef QTBWAVE_H
# define QTBWAVE_H

#ifdef __cplusplus
extern "C" {
#endif

void dispersion_curve_init_();
void dispersion_curve_rayleigh_( int * nLayers, double * h, double * vp, double * vs, double * rho,
int * nSamples, double * omega,
int * nModes, double * slowness );
void dispersion_curve_love_( int * nLayers, double * h, double * vp, double * vs, double * rho,
int * nSamples, double * omega,
int * nModes, double * slowness );

#ifdef __cplusplus
}
#endif

# endif // QTBWAVE_H
valerio
Posts: 10
Joined: Mon Jan 14, 2008 1:56 pm

Post by valerio »

I propose the following modification for qtbwave.cpp and qtbwave.h, to include ellipticity calculation (and peak may be, see attachment).
Regarding the calculation of ellipticity peaks, I notice that with some complex models and setting the precision (dispersion.setPrecision( 1e-15 );) the program crash. Is that because the function is experimental or I'm doing something wrong? :-)

Ciao and thanks
Attachments
qtbwave.c
(4.77 KiB) Downloaded 1266 times
qtbwave.h
(907 Bytes) Downloaded 1301 times
Post Reply