/*----------------------------------------------------------------------------------------- * 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. */ #include "fd.h" void model_acoustic(float **rho, float **pi){ /*--------------------------------------------------------------------------*/ /* extern variables */ extern int NX, NY, NXG, NYG, POS[3], MYID; extern float DH, DT; extern char MFILE[STRING_SIZE]; extern char INV_MODELFILE[STRING_SIZE]; /* local variables */ float piv, vp, rhov; int i, j, ii, jj, l; char modfile[STRING_SIZE]; FILE *flfile; int nodes; char cline[256]; float *fldepth, *flrho, *flvp; /*read FL nodes from File*/ nodes=4; fldepth=vector(1,nodes); flrho=vector(1,nodes); flvp=vector(1,nodes); flfile=fopen("model_true/flnodes.toy_example_ac.start","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",&fldepth[l], &flrho[l], &flvp[l]); } else l=l-1; } if(MYID==0){ printf(" ------------------------------------------------------------------ \n\n"); printf(" Information of FL nodes: \n\n"); printf(" \t depth \t vp \n\n"); for (l=1;l<=nodes;l++){ printf(" \t %f \t %f\n\n",fldepth[l],flvp[l]); } printf(" ------------------------------------------------------------------ \n\n"); } /* loop over global grid */ for (i=1;i<=NXG;i++){ for (l=1;l