/*----------------------------------------------------------------------------------------- * Copyright (C) 2005 * * This file is part of DENISE. * * DENISE is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2.0 of the License only. * * DENISE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with DENISE. See file COPYING and/or . -----------------------------------------------------------------------------------------*/ /* $Id: hh_el.c,v 2.3 2007/08/21 13:16:19 tbohlen Exp $*/ /* * Model defined by flnode file. In this version a constant Q-model with Q_p=Q_s is used. It * is defined via the relaxation frequencies and the TAU value given in the input file. The * shear wave velocity model is defined by the values in file 'flnodes.Rheinstetten.start' * whereas the P wave velocity model as well as the density are defined by the values in * FLnode file 'flnodes.Rheinstetten'. */ #include "fd.h" void model_elastic(float ** rho, float ** pi, float ** u){ /*--------------------------------------------------------------------------*/ /* extern variables */ extern int NX, NY, NXG, NYG, POS[3], MYID, L; extern float DH, DT, *FL, TAU; extern char MFILE[STRING_SIZE]; extern char INV_MODELFILE[STRING_SIZE]; /* local variables */ float muv, piv, vp, vs, rhov, ts, tp; int i, j, ii, jj, l; char modfile[STRING_SIZE]; FILE *flfile; int nodes; char cline[256]; float *fldepth, *flrho, *flvp, *flvs; /**************************************************/ /* creation of shear wave velocity and TAU models */ /**************************************************/ /*read FL nodes from File*/ nodes=3; fldepth=vector(1,nodes); flvs=vector(1,nodes); flrho=vector(1,nodes); flvp=vector(1,nodes); flfile=fopen("model_true/flnodes.toy_example.start","r"); if (flfile==NULL) declare_error(" FL-file could not be opened !"); for (l=1;l<=nodes;l++){ fgets(cline,255,flfile); if (cline[0]!='#'){ sscanf(cline,"%f%f%f%f",&fldepth[l], &flrho[l], &flvp[l], &flvs[l]); } else l=l-1; } if(MYID==0){ printf(" ------------------------------------------------------------------ \n\n"); printf(" Information of FL nodes: \n\n"); printf(" \t depth \t vs \n\n"); for (l=1;l<=nodes;l++){ printf(" \t %f \t %f\n\n",fldepth[l],flvs[l]); } printf(" ------------------------------------------------------------------ \n\n"); } /* loop over global grid */ for (i=1;i<=NXG;i++){ for (l=1;l