/*----------------------------------------------------------------------------------------- * 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 . -----------------------------------------------------------------------------------------*/ /* * Model homogeneous half space * last update 11.04.02, T. Bohlen */ #include "fd.h" void model_elastic(float ** rho, float ** pi, float ** u){ /*--------------------------------------------------------------------------*/ /* extern variables */ extern int NX, NY, NXG, NYG, POS[3], L, MYID; extern char MFILE[STRING_SIZE]; extern char INV_MODELFILE[STRING_SIZE]; extern float DH; /* local variables */ float vp, vs, rhov, grad1, grad2, grad3, y, muv, piv; int i, j, ii, jj,l; char modfile[STRING_SIZE]; FILE *flfile; int nodes; char cline[256]; float *fldepth, *flrho, *flvp, *flvs; /*-----------------------------------------------------------------------*/ nodes=7; fldepth=vector(1,nodes); flrho=vector(1,nodes); flvp=vector(1,nodes); flvs=vector(1,nodes); /*read FL nodes from File*/ flfile=fopen("model_true/model4.fl.dat","r"); if (flfile==NULL) err(" 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 rho \t vp \t vs \n\n"); for (l=1;l<=nodes;l++){ printf(" \t %f \t %f \t %f \t %f \n\n",fldepth[l],flrho[l],flvp[l],flvs[l]); } printf(" ------------------------------------------------------------------ \n\n"); } /*-----------------------------------------------------------------------*/ /* loop over global grid */ for (i=1;i<=NXG;i++){ for (l=1;l