diff --git a/bbp/src/gp/StandRupFormat/.gitignore b/bbp/src/gp/StandRupFormat/.gitignore index dcdcd2c..8356807 100644 --- a/bbp/src/gp/StandRupFormat/.gitignore +++ b/bbp/src/gp/StandRupFormat/.gitignore @@ -3,4 +3,5 @@ fault_seg2gsf generic_slip2srf srf2moment srf2stoch -srf2xyz \ No newline at end of file +srf2xyz +srf2mrf \ No newline at end of file diff --git a/bbp/src/gp/StandRupFormat/function.h b/bbp/src/gp/StandRupFormat/function.h index a03a6ac..7df8dd4 100644 --- a/bbp/src/gp/StandRupFormat/function.h +++ b/bbp/src/gp/StandRupFormat/function.h @@ -38,6 +38,7 @@ void read_srf(struct standrupformat *,char *,int); void write_srf(struct standrupformat *,char *,int); void write_srf1(struct standrupformat *,char *,int); void write_srf2(struct standrupformat *,char *,int); +void write_srf3(struct standrupformat *,char *,int); void copy_hcmnt(struct standrupformat *srf2,struct standrupformat *srf1); void load_command_srf(struct standrupformat *,int,char **); void load_seed_srf(struct standrupformat *srf,int,int); @@ -64,3 +65,5 @@ void zapit(float *, int); void gcproj(float *,float *,float *,float *,float *,double *,double *,double *,double *,int); void gen_matrices(double *,double *,float *,float *,float *); void dump_sliprate(char *,struct standrupformat *,int,float *,float *,float *); + +void srf_to_mrf(struct standrupformat *,struct standrupformat *,struct velmodel *,int,int,int,char **); diff --git a/bbp/src/gp/StandRupFormat/makefile b/bbp/src/gp/StandRupFormat/makefile index 1cafba3..374c0a2 100644 --- a/bbp/src/gp/StandRupFormat/makefile +++ b/bbp/src/gp/StandRupFormat/makefile @@ -36,7 +36,7 @@ FFLAGS = ${UFLAGS} -ffixed-line-length-132 ##### make options -all: srf2stoch generic_slip2srf fault_seg2gsf srf2moment srf2xyz +all: srf2stoch generic_slip2srf fault_seg2gsf srf2moment srf2xyz srf2mrf test_header : test_header.c ${OBJS} ${GEOPROJ_OBJS} $(CC) $(CFLAGS) -o test_header test_header.c ${LDLIBS} ${GEOPROJ_OBJS} @@ -66,7 +66,11 @@ srf2xyz : srf2xyz.c ${OBJS} ${GEOPROJ_OBJS} ${CC} -o srf2xyz srf2xyz.c ${LDLIBS} ${INCPAR} ${GEOPROJ_OBJS} cp srf2xyz ../bin/ +srf2mrf : srf2mrf.c ${OBJS} ${GEOPROJ_OBJS} + ${CC} -o srf2mrf srf2mrf.c ${LDLIBS} ${INCPAR} ${GEOPROJ_OBJS} + cp srf2mrf ../bin/ + ${OBJS} : ${HEADS} clean : - rm -f *.o ${GENRAND_OBJS} ${BAILEY_OBJS} ${GEOPROJ_OBJS} *.o srf2xyz fault_seg2gsf srf2moment generic_slip2srf srf2stoch test_header + rm -f *.o ${GENRAND_OBJS} ${BAILEY_OBJS} ${GEOPROJ_OBJS} *.o srf2xyz fault_seg2gsf srf2moment generic_slip2srf srf2stoch test_header srf2mrf diff --git a/bbp/src/gp/StandRupFormat/srf2mrf.c b/bbp/src/gp/StandRupFormat/srf2mrf.c new file mode 100644 index 0000000..0161d03 --- /dev/null +++ b/bbp/src/gp/StandRupFormat/srf2mrf.c @@ -0,0 +1,38 @@ +#include "include.h" +#include "structure.h" +#include "function.h" +#include "defs.h" +#include "getpar.h" + +int main(int ac,char **av) +{ +char infile[1024], outfile[1024]; +struct standrupformat srf, mrf; +char velfile[1024]; +struct velmodel vmod; + +int inbin = 0; +int outbin = 0; + +int use_srf_lame = 0; +int print_command = 1; + +sprintf(infile,"stdin"); +sprintf(outfile,"stdout"); +sprintf(velfile,"NOT_PROVIDED"); + +setpar(ac,av); +getpar("infile","s",infile); +getpar("outfile","s",outfile); +getpar("velfile","s",velfile); +getpar("use_srf_lame","d",&use_srf_lame); +getpar("print_command","d",&print_command); +endpar(); + +read_Fvelmodel(velfile,&vmod); +read_srf(&srf,infile,inbin); + +srf_to_mrf(&srf,&mrf,&vmod,use_srf_lame,print_command,ac,av); + +write_srf(&mrf,outfile,outbin); +} diff --git a/bbp/src/gp/StandRupFormat/srf_subs.c b/bbp/src/gp/StandRupFormat/srf_subs.c index a654e1c..c705dc8 100644 --- a/bbp/src/gp/StandRupFormat/srf_subs.c +++ b/bbp/src/gp/StandRupFormat/srf_subs.c @@ -19,6 +19,8 @@ int fdr; int ip, np_seg, npread, np_tot; long foff; +int mrf_flag; + if(bflag) { if(strcmp(file,"stdin") == 0) @@ -89,6 +91,19 @@ else fgets(str,MAXLINE,fpr); sscanf(str,"%s",srf[0].version); + mrf_flag = 0; + sprintf(srf[0].src_format,"SLIP"); + if(atof(srf[0].version) >= 3.0) + { + ip = sscanf(str,"%*s %s",srf[0].src_format); + + if(ip != 1 || (strcmp(srf[0].src_format,"SLIP") != 0 && strcmp(srf[0].src_format,"MOMENT") != 0)) + sprintf(srf[0].src_format,"SLIP"); + + if(strcmp(srf[0].src_format,"MOMENT") == 0) + mrf_flag = 1; + } + /* reserve first 3 lines for writing out command that generated SRF */ srf[0].srf_hcmnt.nline = 3; srf[0].srf_hcmnt.cbuf = (char *)check_malloc((srf[0].srf_hcmnt.nline)*MAXLINE*sizeof(char)); @@ -219,10 +234,11 @@ else &(apval_ptr->tinit), &(apval_ptr->dt)); + apval_ptr->vp = -1; apval_ptr->vs = -1; apval_ptr->den = -1; } - else if(atof(srf->version) >= 2.0) + else if(atof(srf->version) < 3.0) { sscanf(str,"%f %f %f %f %f %f %f %f %f %f",&(apval_ptr->lon), &(apval_ptr->lat), @@ -234,50 +250,96 @@ else &(apval_ptr->dt), &(apval_ptr->vs), &(apval_ptr->den)); + apval_ptr->vp = -1; } + else if(atof(srf->version) >= 2.0) + { + sscanf(str,"%f %f %f %f %f %f %f %f %f %f %f",&(apval_ptr->lon), + &(apval_ptr->lat), + &(apval_ptr->dep), + &(apval_ptr->stk), + &(apval_ptr->dip), + &(apval_ptr->area), + &(apval_ptr->tinit), + &(apval_ptr->dt), + &(apval_ptr->vp), + &(apval_ptr->vs), + &(apval_ptr->den)); + } + + if(mrf_flag != 1) /* expecting slip */ + { + fgets(str,MAXLINE,fpr); + sscanf(str,"%f %f %d %f %d %f %d",&(apval_ptr->rake), + &(apval_ptr->slip1), + &(apval_ptr->nt1), + &(apval_ptr->slip2), + &(apval_ptr->nt2), + &(apval_ptr->slip3), + &(apval_ptr->nt3)); - fgets(str,MAXLINE,fpr); - sscanf(str,"%f %f %d %f %d %f %d",&(apval_ptr->rake), - &(apval_ptr->slip1), - &(apval_ptr->nt1), - &(apval_ptr->slip2), - &(apval_ptr->nt2), - &(apval_ptr->slip3), - &(apval_ptr->nt3)); + if(apval_ptr->nt1) + apval_ptr->stf1 = (float *)check_malloc((apval_ptr->nt1)*sizeof(float)); + else + apval_ptr->stf1 = NULL; - if(apval_ptr->nt1) - apval_ptr->stf1 = (float *)check_malloc((apval_ptr->nt1)*sizeof(float)); - else - apval_ptr->stf1 = NULL; + stf = apval_ptr->stf1; - stf = apval_ptr->stf1; + for(it=0;it<(apval_ptr->nt1);it++) + fscanf(fpr,"%f",&stf[it]); - for(it=0;it<(apval_ptr->nt1);it++) - fscanf(fpr,"%f",&stf[it]); + if(apval_ptr->nt2) + apval_ptr->stf2 = (float *)check_malloc((apval_ptr->nt2)*sizeof(float)); + else + apval_ptr->stf2 = NULL; - if(apval_ptr->nt2) - apval_ptr->stf2 = (float *)check_malloc((apval_ptr->nt2)*sizeof(float)); - else - apval_ptr->stf2 = NULL; + stf = apval_ptr->stf2; - stf = apval_ptr->stf2; + for(it=0;it<(apval_ptr->nt2);it++) + fscanf(fpr,"%f",&stf[it]); - for(it=0;it<(apval_ptr->nt2);it++) - fscanf(fpr,"%f",&stf[it]); + if(apval_ptr->nt3) + apval_ptr->stf3 = (float *)check_malloc((apval_ptr->nt3)*sizeof(float)); + else + apval_ptr->stf3 = NULL; - if(apval_ptr->nt3) - apval_ptr->stf3 = (float *)check_malloc((apval_ptr->nt3)*sizeof(float)); - else - apval_ptr->stf3 = NULL; + stf = apval_ptr->stf3; - stf = apval_ptr->stf3; + for(it=0;it<(apval_ptr->nt3);it++) + fscanf(fpr,"%f",&stf[it]); - for(it=0;it<(apval_ptr->nt3);it++) - fscanf(fpr,"%f",&stf[it]); + /* get rouge newline character */ + if((apval_ptr->nt1) || (apval_ptr->nt2) || (apval_ptr->nt3)) + fgets(str,MAXLINE,fpr); + } - /* get rouge newline character */ - if((apval_ptr->nt1) || (apval_ptr->nt2) || (apval_ptr->nt3)) + else if(mrf_flag == 1) /* expecting moment */ + { fgets(str,MAXLINE,fpr); + sscanf(str,"%lf %lf %lf %lf %lf %lf %d", + &(apval_ptr->mnn), + &(apval_ptr->mee), + &(apval_ptr->mdd), + &(apval_ptr->mne), + &(apval_ptr->mnd), + &(apval_ptr->med), + &(apval_ptr->ntmr)); + + if(apval_ptr->ntmr) + apval_ptr->mrf = (float *)check_malloc((apval_ptr->ntmr)*sizeof(float)); + else + apval_ptr->mrf = NULL; + + stf = apval_ptr->mrf; + + for(it=0;it<(apval_ptr->ntmr);it++) + fscanf(fpr,"%f",&stf[it]); + + /* get rouge newline character */ + if((apval_ptr->ntmr)) + fgets(str,MAXLINE,fpr); + } + } } @@ -317,8 +379,10 @@ void write_srf(struct standrupformat *srf,char *file,int bflag) { if(atof(srf->version) < 2.0) write_srf1(srf,file,bflag); -else if(atof(srf->version) >= 2.0) +else if(atof(srf->version) < 3.0) write_srf2(srf,file,bflag); +else if(atof(srf->version) >= 3.0) + write_srf3(srf,file,bflag); } void write_srf1(struct standrupformat *srf,char *file,int bflag) @@ -693,6 +757,245 @@ else } } +void write_srf3(struct standrupformat *srf,char *file,int bflag) +{ +FILE *fpw, *fopfile(); +struct srf_planerectangle *prect_ptr; +struct srf_prectsegments *prseg_ptr; +struct srf_allpoints *apnts_ptr; +struct srf_apointvalues *apval_ptr; + +float area; +float *stf; +int i, j, k, nt6, it, ig; + +char *sptr, pword[32]; +int fdw; + +int ip, nprite; + +int mrf_flag; + +prect_ptr = &(srf->srf_prect); +prseg_ptr = prect_ptr->prectseg; +apnts_ptr = &(srf->srf_apnts); +apval_ptr = apnts_ptr->apntvals; + +if(bflag) + { + if(strcmp(file,"stdout") == 0) + fdw = STDOUT_FILENO; + else + fdw = croptrfile(file); + + rite(fdw,srf->version,sizeof(srf->version)); + + if(strcmp(srf->type,"PLANE") == 0) + { + rite(fdw,srf->type,sizeof(srf->type)); + rite(fdw,&(prect_ptr->nseg),sizeof(prect_ptr->nseg)); + rite(fdw,prseg_ptr,(prect_ptr->nseg)*sizeof(struct srf_prectsegments)); + } + + sprintf(pword,"POINTS"); + rite(fdw,pword,sizeof(pword)); + rite(fdw,&(apnts_ptr->np),sizeof(apnts_ptr->np)); + for(i=0;inp;i++) + { + rite(fdw,&(apval_ptr[i].lon),sizeof(float)); + rite(fdw,&(apval_ptr[i].lat),sizeof(float)); + rite(fdw,&(apval_ptr[i].dep),sizeof(float)); + rite(fdw,&(apval_ptr[i].stk),sizeof(float)); + rite(fdw,&(apval_ptr[i].dip),sizeof(float)); + rite(fdw,&(apval_ptr[i].area),sizeof(float)); + rite(fdw,&(apval_ptr[i].tinit),sizeof(float)); + rite(fdw,&(apval_ptr[i].dt),sizeof(float)); + rite(fdw,&(apval_ptr[i].rake),sizeof(float)); + rite(fdw,&(apval_ptr[i].slip1),sizeof(float)); + rite(fdw,&(apval_ptr[i].nt1),sizeof(int)); + rite(fdw,&(apval_ptr[i].slip2),sizeof(float)); + rite(fdw,&(apval_ptr[i].nt2),sizeof(int)); + rite(fdw,&(apval_ptr[i].slip3),sizeof(float)); + rite(fdw,&(apval_ptr[i].nt3),sizeof(int)); + + rite(fdw,apval_ptr[i].stf1,(apval_ptr[i].nt1)*sizeof(float)); + rite(fdw,apval_ptr[i].stf2,(apval_ptr[i].nt2)*sizeof(float)); + rite(fdw,apval_ptr[i].stf3,(apval_ptr[i].nt3)*sizeof(float)); + } + close(fdw); + } +else + { + if(strcmp(file,"stdout") == 0) + fpw = stdout; + else + fpw = fopfile(file,"w"); + + fprintf(fpw,"%s %s\n",srf->version,srf->src_format); + + for(i=0;isrf_hcmnt.nline;i++) + { + sptr = (srf->srf_hcmnt.cbuf) + i*MAXLINE; + if(sptr[0] != '\0') + fprintf(fpw,"%s\n",sptr); + } + + if(strcmp(srf->type,"PLANE") == 0) + { + fprintf(fpw,"%s %d\n",srf->type,prect_ptr->nseg); + for(ig=0;ignseg;ig++) + { + fprintf(fpw,"%12.6f %11.6f %5d %5d %10.4f %10.4f\n",prseg_ptr[ig].elon, + prseg_ptr[ig].elat, + prseg_ptr[ig].nstk, + prseg_ptr[ig].ndip, + prseg_ptr[ig].flen, + prseg_ptr[ig].fwid); + fprintf(fpw,"%4.0f %4.0f %10.4f %10.4f %10.4f\n",prseg_ptr[ig].stk, + prseg_ptr[ig].dip, + prseg_ptr[ig].dtop, + prseg_ptr[ig].shyp, + prseg_ptr[ig].dhyp); + } + } + + mrf_flag = 0; + if(strcmp(srf->src_format,"MOMENT") == 0) + mrf_flag = 1; + + nprite = 0; + for(ig=0;ignseg;ig++) + { + fprintf(fpw,"POINTS %d\n",srf->np_seg[ig]); + for(ip=0;ipnp_seg[ig];ip++) + { + i = ip + nprite; + + fprintf(fpw,"%12.6f %11.6f %12.5e %4.0f %4.0f %12.5e %13.6e %12.5e %13.5e %13.5e %13.5e\n", + apval_ptr[i].lon, + apval_ptr[i].lat, + apval_ptr[i].dep, + apval_ptr[i].stk, + apval_ptr[i].dip, + apval_ptr[i].area, + apval_ptr[i].tinit, + apval_ptr[i].dt, + apval_ptr[i].vp, + apval_ptr[i].vs, + apval_ptr[i].den); + + if(mrf_flag != 1) /* expecting slip */ + { + fprintf(fpw,"%4.0f %10.4f %6d %10.4f %6d %10.4f %6d\n", + apval_ptr[i].rake, + apval_ptr[i].slip1, + apval_ptr[i].nt1, + apval_ptr[i].slip2, + apval_ptr[i].nt2, + apval_ptr[i].slip3, + apval_ptr[i].nt3); + + stf = apval_ptr[i].stf1; + nt6 = (apval_ptr[i].nt1)/6; + for(k=0;knp_seg[ig]; + } + + fclose(fpw); + } +} + void free_srf_stf(struct standrupformat *srf) { struct srf_allpoints *apnts_ptr; @@ -1648,3 +1951,215 @@ nb = sprintf(sptr1,"# ending_seed= %lld",ending_seed); sptr1 = sptr1 + MAXLINE; sprintf(sptr1,"#"); } + +void srf_to_mrf(struct standrupformat *srf,struct standrupformat *mrf,struct velmodel *vm,int use_srf_lame,int pflag,int ac,char **av) +{ +struct srf_prectsegments *prseg_in, *prseg_out; +struct srf_apointvalues *apval_in, *apval_out; +float *stfin, *stfout; +int i, j, k, it, ig; + +double s_mom, m_mom; + +float u1, u2, u3, sum; +double lam, l2m, mu; +double ux, uy, uz, vx, vy, vz; + +double arg; +double cosS, sinS; +double cosD, sinD; +double cosL, sinL; + +double rperd = 0.017453292519943; + +if(atof(srf[0].version) < 2.0) + { + fprintf(stderr,"srf version= %s < 2.0, exiting ... \n",srf[0].version); + exit(-1); + } + +s_mom = 0.0; +m_mom = 0.0; + +sprintf(mrf[0].version,"3.0"); +sprintf(mrf[0].src_format,"MOMENT"); + +copy_hcmnt(mrf,srf); + +if(pflag && atof(mrf[0].version) >= 2.0) + load_command_srf(mrf,ac,av); + +mrf[0].type[0] = '\0'; +if(strncmp(srf[0].type,"PLANE",5) == 0) + { + strcpy(mrf[0].type,srf[0].type); + + mrf[0].srf_prect.nseg = srf[0].srf_prect.nseg; + mrf[0].srf_prect.prectseg = (struct srf_prectsegments *)check_malloc(mrf[0].srf_prect.nseg*sizeof(struct srf_prectsegments)); + + prseg_in = srf[0].srf_prect.prectseg; + prseg_out = mrf[0].srf_prect.prectseg; + for(ig=0;ig apval_out[i].ntmr) + apval_out[i].ntmr = apval_in[i].nt2; + if(apval_in[i].nt3 > apval_out[i].ntmr) + apval_out[i].ntmr = apval_in[i].nt3; + + apval_out[i].mrf = (float *)check_realloc(apval_out[i].mrf,(apval_out[i].ntmr)*sizeof(float)); + stfout = apval_out[i].mrf; + + if(apval_in[i].nt1) + { + stfin = apval_in[i].stf1; + for(it=0;it<(apval_in[i].nt1);it++) + stfout[it] = stfin[it]*stfin[it]; + } + + if(apval_in[i].nt2) + { + stfin = apval_in[i].stf2; + for(it=0;it<(apval_in[i].nt2);it++) + stfout[it] = stfout[it] + stfin[it]*stfin[it]; + } + + if(apval_in[i].nt3) + { + stfin = apval_in[i].stf3; + for(it=0;it<(apval_in[i].nt3);it++) + stfout[it] = stfout[it] + stfin[it]*stfin[it]; + } + + sum = 0.0; + for(it=0;it<(apval_out[i].ntmr);it++) + { + stfout[it] = sqrt(stfout[it]); + sum = sum + (apval_out[i].dt)*stfout[it]; + } + + sum = 1.0/sum; + for(it=0;it<(apval_out[i].ntmr);it++) + stfout[it] = sum*stfout[it]; + + if(use_srf_lame != 0 && apval_out[i].vp > 0.0 && apval_out[i].vs > 0.0 && apval_out[i].den > 0.0) + { + l2m = apval_out[i].vp*apval_out[i].vp*apval_out[i].den; + mu = apval_out[i].vs*apval_out[i].vs*apval_out[i].den; + } + else + { + j = 0; + while(vm->dep[j] < apval_out[i].dep) + j++; + + l2m = 1.0e+10*vm->vp[j]*vm->vp[j]*vm->den[j]; + mu = 1.0e+10*vm->vs[j]*vm->vs[j]*vm->den[j]; + + if(apval_out[i].vp < 0.0) + apval_out[i].vp = 1.0e+05*vm->vp[j]; + + if(apval_out[i].vs < 0.0) + apval_out[i].vs = 1.0e+05*vm->vs[j]; + + if(apval_out[i].den < 0.0) + apval_out[i].den = vm->den[j]; + } + lam = l2m - 2.0*mu; + + u1 = apval_in[i].slip1; + u2 = apval_in[i].slip2; + u3 = apval_in[i].slip3; + + arg = apval_in[i].stk*rperd; + cosS = cos(arg); + sinS = sin(arg); + + arg = apval_in[i].dip*rperd; + cosD = cos(arg); + sinD = sin(arg); + + arg = apval_in[i].rake*rperd; + cosL = cos(arg); + sinL = sin(arg); + + vx = -sinD*sinS; + vy = sinD*cosS; + vz = -cosD; + + ux = -(u3*sinD - cosD*(u1*sinL + u2*cosL))*sinS + (u1*cosL - u2*sinL)*cosS; + uy = (u3*sinD - cosD*(u1*sinL + u2*cosL))*cosS + (u1*cosL - u2*sinL)*sinS; + uz = -u3*cosD - (u1*sinL + u2*cosL)*sinD; + +/* XXXXX +fprintf(stderr,"vx= %.5e vy= %.5e vz= %.5e\n",vx,vy,vz); +fprintf(stderr,"cosL= %.5e sinL= %.5e cosD= %.5e sinD= %.5e\n",cosL,sinL,cosD,sinD); +fprintf(stderr,"u1= %.5e u2= %.5e u3= %.5e\n",u1,u2,u3); +fprintf(stderr,"ux= %.5e uy= %.5e uz= %.5e\n",ux,uy,uz); +*/ + + apval_out[i].mnn = (l2m*vx*ux + lam*(vy*uy + vz*uz))*apval_out[i].area; + apval_out[i].mee = (l2m*vy*uy + lam*(vx*ux + vz*uz))*apval_out[i].area; + apval_out[i].mdd = (l2m*vz*uz + lam*(vx*ux + vy*uy))*apval_out[i].area; + + apval_out[i].mne = mu*(vx*uy + vy*ux)*apval_out[i].area; + apval_out[i].mnd = mu*(vx*uz + vz*ux)*apval_out[i].area; + apval_out[i].med = mu*(vy*uz + vz*uy)*apval_out[i].area; + + s_mom = s_mom + sqrt(u1*u1 + u2*u2 + u3*u3)*mu*apval_in[i].area; + m_mom = m_mom + sqrt(0.5*apval_out[i].mnn*apval_out[i].mnn + + 0.5*apval_out[i].mee*apval_out[i].mee + + 0.5*apval_out[i].mdd*apval_out[i].mdd + + apval_out[i].mne*apval_out[i].mne + + apval_out[i].mnd*apval_out[i].mnd + + apval_out[i].med*apval_out[i].med); + + } +fprintf(stderr,"slip moment= %.5e\n",s_mom); +fprintf(stderr,"MT moment= %.5e\n",m_mom); +} diff --git a/bbp/src/gp/StandRupFormat/structure.h b/bbp/src/gp/StandRupFormat/structure.h index d022a32..2e85ccb 100644 --- a/bbp/src/gp/StandRupFormat/structure.h +++ b/bbp/src/gp/StandRupFormat/structure.h @@ -83,7 +83,7 @@ struct srf_apointvalues20141109 float *stf3; }; -struct srf_apointvalues +struct srf_apointvalues20241010 { float lon; float lat; @@ -107,6 +107,39 @@ struct srf_apointvalues float *stf3; }; +struct srf_apointvalues + { + float lon; + float lat; + float dep; + float stk; + float dip; + float area; + float tinit; + float dt; + float vp; /* added for V3.0 */ + float vs; + float den; + float rake; + float slip1; + int nt1; + float slip2; + int nt2; + float slip3; + int nt3; + float *stf1; + float *stf2; + float *stf3; + double mnn; /* moment-rate stuff added for V3.0 */ + double mee; + double mdd; + double mne; + double mnd; + double med; + int ntmr; + float *mrf; + }; + struct srf_allpoints { int np; @@ -150,7 +183,7 @@ struct standrupformat20141109 struct srf_allpoints srf_apnts; }; -struct standrupformat +struct standrupformat20241010 { char version[32]; char type[32]; @@ -161,6 +194,18 @@ struct standrupformat struct srf_allpoints srf_apnts; }; +struct standrupformat + { + char version[32]; + char type[32]; + char src_format[64]; /* added for V3.0, options are "SLIP" or "MOMENT", default is "SLIP" */ + int nseg; + int *np_seg; + struct srf_headercomment srf_hcmnt; + struct srf_planerectangle srf_prect; + struct srf_allpoints srf_apnts; + }; + struct slippars20171024 { float lon; @@ -197,6 +242,8 @@ struct slippars float den; float rt_s; float rt_e; + float aseis; + float rvf; }; struct segpars