Skip to content

Commit f01dfd6

Browse files
committed
Added srf2moment code
1 parent bc300df commit f01dfd6

3 files changed

Lines changed: 42 additions & 2 deletions

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
# Binaries
22
srf_gethypo
3+
srf2moment

gmsvtoolkit/src/gp/StandRupFormat/makefile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,17 @@ CFLAGS = ${UFLAGS} ${LF_FLAGS} ${FFTW_INCFLAGS}
2424

2525
##### make options
2626

27-
all : srf_gethypo
27+
all : srf_gethypo srf2moment
2828

2929
srf_gethypo : srf_gethypo.c ${OBJS}
3030
${CC} ${CFLAGS} -o srf_gethypo srf_gethypo.c ${OBJS} ${LDLIBS} ${INCPAR}
3131
cp srf_gethypo ../bin/.
3232

33+
srf2moment : srf2moment.c ${OBJS}
34+
${CC} ${CFLAGS} -o srf2moment srf2moment.c ${OBJS} ${LDLIBS} ${INCPAR}
35+
cp srf2moment ../bin/
36+
3337
${OBJS} : ${HEADS}
3438

3539
clean :
36-
-rm -f *.o srf_gethypo
40+
-rm -f *.o srf_gethypo srf2moment
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#include "include.h"
2+
#include "structure.h"
3+
#include "function.h"
4+
#include "defs.h"
5+
#include "getpar.h"
6+
7+
int main(int ac,char **av)
8+
{
9+
char infile[256], velfile[256];
10+
11+
struct standrupformat srf;
12+
struct velmodel vmod;
13+
14+
int inbin = 0;
15+
int use_srf_mu = 0;
16+
int moment_rate = 0;
17+
18+
sprintf(infile,"stdin");
19+
sprintf(velfile,"NOT_PROVIDED");
20+
21+
setpar(ac,av);
22+
getpar("infile","s",infile);
23+
getpar("velfile","s",velfile);
24+
getpar("use_srf_mu","d",&use_srf_mu);
25+
getpar("moment_rate","d",&moment_rate);
26+
endpar();
27+
28+
read_Fvelmodel(velfile,&vmod);
29+
read_srf(&srf,infile,inbin);
30+
31+
if(moment_rate)
32+
get_moment_rate(&srf,&vmod,use_srf_mu);
33+
else
34+
get_moment(&srf,&vmod,use_srf_mu);
35+
}

0 commit comments

Comments
 (0)