📄 ciasp.cpp
字号:
#include <stdafx.h>
#include <stdlib.h>#include <stdio.h>#include <string.h>#include "iasp.h"#ifdef HAVE_CONFIG_H#include <config.h>#endif
#ifdef __cplusplus
extern "C" {
#endif
// we select 'Upper Case*' in the option 'External Name' in fortran compiler option,
// so have to keep all name in upper case in c/c++ source codes!
// MODPATHNOEXT = "e:/iasp91/iasp91"
int MTPTT(float *delta,float *depth,int *max, float tt[MAXIASPPH], float dtdd[MAXIASPPH], float dtdh[MAXIASPPH],
char mphase[MAXIASPPH][IASPPHLENGTH]);
extern int SETMODPATH( const char * in );
#ifdef __cplusplus
}
#endif
float wtptt(float delta,float depth,struct ttime *tt){ int i, n=MAXIASPPH;
memset(tt->phase,' ',IASPPHLENGTH);
tt->delta=delta; tt->depth=depth;
for(i=0;i<n;i++) {
memset(tt->mphase[i],0,IASPPHLENGTH);
}
tt->N=MTPTT(&tt->delta, &tt->depth, &n, tt->mtt, tt->mdtdd,tt->mdtdh,
tt->mphase );
return tt->mtt[0];
}
// set the iasp91 model path, so the iasp91's function can locate the model.
int SetModPath( const char * in ) {
char MODPATHNOEXT[256];
const int mnlen = 256;
int i;
for (i = 0; i < mnlen && in[i]; i++)
MODPATHNOEXT[i] = in[i];
if (i == mnlen)
return -1;
for (/*nop*/; i < mnlen; i++)
MODPATHNOEXT[i] = ' ';
//setmodpath
SETMODPATH(MODPATHNOEXT);
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -