Commit 09394478 authored by Simone Butzer's avatar Simone Butzer

change phrases fdmpi to ifos

parent 7da2cebb
cd ../src
make clean
make fdmpi
make ifos3d
cd ../par
# $Id: fdmpi.inp,v 1.1.1.1 2009/12/09 14:29:22 sjetschny Exp $
#-----------------------------------------------------------------
# PARAMETER FILE FOR FDMPI
#-----------------------------------------------------------------
#
# Note that z denotes the vertical direction !
#
#-----------------------------------------------------------------------------------
#------------------------ MODELING PARAMETERS --------------------------------------
#-----------------------------------------------------------------------------------
#
#-------------- Domain Decomposition -----------------------------
number_of_processors_in_x-direction_(NPROCX) = 8
number_of_processors_in_y-direction_(NPROCY) = 8
number_of_processors_in_z-direction_(NPROCZ) = 8
#
#-------------------- 3-D Grid -----------------------------------
number_of_gridpoints_in_x-direction_(NX) = 160
number_of_gridpoints_in_y-direction_(NY) = 160
number_of_gridpoints_in_z-direction_(NZ) = 184
distance_between_gridpoints(in_m)_in_x-direction_(DX) = 0.8
distance_between_gridpoints(in_m)_in_y-direction_(DY) = 0.8
distance_between_gridpoints(in_m)_in_z-direction_(DZ) = 0.8
#
# Caution: first gridpoint is not at {0.0,0.0,0.0} but at {dx,dy,dz}!
#
#------------------- Order of FD Operator -----------------------
order_of_spatial_fd_operators_(FDORDER) = 4
# possible values are 2, 4, 6, 8, 10, 12
fd_coefficients_(Taylor=1;Holberg=2)_(FDCOEFF) = 2
#
#-------------------Time Stepping -------------------------------
time_of_wave_propagation_(in_sec)_(TIME) = 0.06
timestep_(in_seconds)_(DT) = 5.0e-5
#
#--------------------Source---------------------------------------
# Shape_of_source-signal:
(ricker=1;fumue=2;from_SIGNAL_FILE=3;SIN**3=4;deltapulse=5)_(QUELLART) = 4
point_source_(explosive=1;force_in_x=2;in_y=3;in_z=4;custom=5)_(QUELLTYP) = 4
# If QUELLTYP <5 the following two lines are ignored
force_angle_between_x_y_(in_degree)_(ALPHA) = 45.0
force_angle_between_x_z_(in_degree)_(BETA) = 45.0
# Plane wave (PW) excitation,if PLANE_WAVE_DEPTH>0, SRCREC is treated as 0
depth_of_PW_excitation_(no<=0)_(in_meter)_(PLANE_WAVE_DEPTH) = 0.0direct.com/
dip_of_PW_from_vertical_(in_degrees)_(PHI) =0.0
duration_of_source-signal_PW_(in_seconds)_(TS) = 0.0033
# External signal input instead of QUELLART
SIGNAL_FILE = ?
read_source_positions_from_SOURCE_FILE_(yes=1)_(SRCREC) = 1
SOURCE_FILE = ./sources/sources_toy.dat
run_multiple_shots_defined_in_SOURCE_FILE_(yes=1)_(RUN_MULTIPLE_SHOTS) = 1
#--------------------- Model (Input) -------------------------------------
read_model_from_MFILE(yes=1)(READMOD) = 0
MFILE = model/toy
#
#---------------------Q-approximation-----------------------------
Number_of_relaxation_mechanisms_(L) = 0
# (L=0: elastic, FWI only tested for L=0)
L_Relaxation_frequencies_(FL) = 1000.0
Tau_value_for_entire_model_(TAU) = 0.000001
#
#----------------------Free Surface-------------------------------
free_surface_(yes=1)(FREE_SURF) = 0
#
#--------------------Absorbing Boundary---------------------------
# exponential damping applied
type_of_boundary_condition_(ABS_TYPE)_(PML=1/ABS=2) = 1
width_of_absorbing_frame_(in_grid_points)_(No<=0)_(FW) = 10
percentage_of_amplitude_decay_at_outer_edge_(DAMPING) = 8.0
# parameter for PML:
Dominant_frequency_(in_Hz)_(FPML) = 200.0
P_wave_velocity_near_the_grid_boundary(in_m/s)_(VPPML) = 6200.0
# apply_periodic_boundary_condition_at_edges_(BOUNDARY):
(no=0)_(left/right/front/back=1) = 0
#
#----------------------Snapshots----------------------------------
# currently not in use!!
output_of_snapshots_(SNAP)(yes>0) = 0
# output of particle velocities: SNAP=1
# output of pressure field: SNAP=2
# output of curl and divergence energy: SNAP=3
# output of both particle velocities and energy : SNAP=4
first_snapshot_(in_sec)_(TSNAP1) = 0.01
last_snapshot_(in_sec)_(TSNAP2) = 0.24
increment_(in_sec)_(TSNAPINC) = 0.0075
# Note that z denotes the vertical direction !
increment_x-direction_(IDX) = 1
increment_y-direction_(IDY) = 1
increment_z-direction_(IDZ) = 1
data-format_(SNAP_FORMAT)(ASCII(2);BINARY(3)) = 4
basic_filename_(SNAP_FILE) = ./snap/back
#output will look like SNAP_FILE.bin.z.000
#if SNAP = 1,2 the following line is ignored
(SNAP_PLANE) = 1
#output of snapshots as energy wihout sign SNAP_PLANE=1
#energy with sign true for x-z-plane SNAP_PLANE=2
#energy with sign true for x-y-plane SNAP_PLANE=3
#energy with sign true for y-z-plane SNAP_PLANE=4
#
#----------------------Receiver-----------------------------------
output_of_seismograms_(SEISMO) = 1
# SEISMO=0: no seismograms
# SEISMO=1: particle-velocities
# SEISMO=2: pressure (hydrophones)
# SEISMO=3: curl and div
# SEISMO=4: everything
# Warning: "curl" is not really curl in 3D
read_receiver_positions_from_file_(yes=1)_(READREC) = 0
REC_FILE = ./receiver/receiver.dat
reference_point_for_receiver_coordinate_system_(REFREC) = 0.0 , 0.0 , 0.0
# if READREC=1 the following three lines are ignored
# Note that z denotes the vertical direction !
position_of_first_receiver_(in_m)_(XREC1,YREC1,ZREC1) = 90.0 , 90.0 , 90.0
position_of_last_receiver_(in_m)_(XREC2,YREC2,ZREC2) = 90.0 , 90.0 , 90.0
distance_between_two_adjacent_receivers_(in_gridpoints)_(NGEOPH) = 1
# (Caution: receivers outside the grid may cause surprising results!)
#
#-------------------- Receiver array -------------------------------
# parameters for horizontal plane of receivers
number_of_planes_(no<=0)_(REC_ARRAY) = 1
depth_of_first_(upper)_plane_(in_m)_(REC_ARRAY_DEPTH) = 24.0
vertical_distance_between_planes_(in_m)_(REC_ARRAY_DIST) = 30.0
distance_between_receivers_in_x-direction_(in_gridpoints)_(DRX) = 10
distance_between_receivers_in_y-direction_(in_gridpoints)_(DRY) = 10
#
#-------------------- Seismogram Output-----------------------------
samplingrate_and_timelag_(in_timesteps!)_(NDT,NDTSHIFT) = 1 , 0
# write every (ndt)th sample, leaving ndtshift samples at the beginning out
# default: ndt=1 and ndtshift=0. (ndt=0 is set to ndt=1, ndt<0 are set to -ndt.)
#
data-format_(SEIS_FORMAT[6]) = 1
# 0: SEG-Y (ASCII-text/native 4-byte-floats (IEEE on PC)/little endian on PC)
# 1: SU (native 4-byte-floats (IEEE on PC)/little endian on PC)
# 2: TEXTUAL (native ASCII)
# 3: BINARY (IEEE-4-byte-floats on PC/little endian on PC)
# 4: SEG-Y (ASCII-text/native 4-byte-floats (IEEE on PC)/little endian on PC)
# 5: SEG-Y (ASCII-text/IBM-4-byte-floats on PC/big endian on PC)
#
basic_filename_(SEIS_FILE) = ./su/cal_toy
#
#------------------------ Method --------------------------------
#
method_(METHOD) = 1
# 0: only forward simulation
# 1: conjugate_gradient_FWI
#
#-----------------------------------------------------------------------------------
#------------------------ INVERSION PARAMETERS --------------------------------------
#-----------------------------------------------------------------------------------
#
#-------------------------In- and Output Files--------------------------------------
gradient_filename_(GRAD_FILE) = ./grad/toy
model_output_filename_(MOD_OUT_FILE) = ./model/toy
observed_data_fileneame_(SEIS_OBS_FILE) = ./su_obs/obs_toy
external_or_internal_observed_data_(EXTOBS) = 0
inversion_parameter_file_(INV_FILE) = ./in_and_out/workflow_toy.dat
hessian_file_(HESS_FILE) = ./hess/toy
#
#-------------------------General---------------------------------------------------
minimum/maximum_iteration_number_(>0)_(ITMIN,ITMAX) = 1 , 80
filtering_(yes=1/no=0)_(FILT) = 1
maximum_number_frequencies_per_iteration_(NFMAX) = 5
number_of_timestep_per_period_used_for_inversion_(TAST) = 100
#
#------------------------Steplength estimation----------------------------------------
number_of_shots_used_for_steplength_estimation_(NSHOTS_STEP) = 4
initial_test_steplength_(TESTSTEP) = 0.02
#
#------------------------Gradient preconditioning-------------------------------------
Type_of_preconditioning_(DAMPTYPE) = 2
# 0: no damping
# 1: Gaussian taper around receivers
# 2: Gaussian taper around sources and receivers
# 3: Gaussian tapering of source and receiver planes
#
#------------------------Hessian ----------------------------------------
Apply_Hessian_(yes=1/no=0)_(HESS) = 0
Read_Hessian_from_file_(READ_HESS) = 0
Part_of_receivers_used_for_Hessian_(REC_HESS) = 1
#(Each REC_HESS Receiver is used to calculate the Hessian, not yet implemented)
Water_level_Hessian_for_vp/vs/rho_(WATER_HESS) = 0.0192, 0.0192, 1.0e-14
#
#------------------------L-BFGS ----------------------------------------
Apply_L_BFGS_(LBFGS) = 0
lamboot -v lamhosts
mpirun -np 8 nice -19 ../bin/fdmpi ./in_and_out/fdmpi_toy.inp | tee ./in_and_out/fdmpi.out
#lamboot -v lamhosts
mpirun -np 8 nice -19 ../bin/ifos3d ./in_and_out/ifos3d_toy.inp | tee ./in_and_out/ifos3D.out
#!/bin/bash -l
#SBATCH --nodes=16
#SBATCH --ntasks=512
#SBATCH --ntasks-per-node=32
#SBATCH --time=12:00:00
#SBATCH --output=mpi-out.%j
#SBATCH --error=mpi_err.%j
#SBATCH --partition=batch
srun ../bin/ifos3d ./in_and_out/ifos3d_toy.inp | tee ./in_and_out/ifos3d_toy.out
......@@ -160,8 +160,8 @@ snapmerge: $(SNAPMERGE_OBJ)
# part_model: $(PARTMODEL_OBJ)
# $(CC) $(LFLAGS) $(PARTMODEL_OBJ) -o ../bin/partmodel
fdmpi: $(FDMPI_OBJ)
$(CC) $(SFLAGS) $(FDMPI_OBJ) $(LFLAGS) -o ../bin/fdmpi
ifos3d: $(FDMPI_OBJ)
$(CC) $(SFLAGS) $(FDMPI_OBJ) $(LFLAGS) -o ../bin/ifos3d
clean:
......
# $Id: Makefile,v 1.1.1.1 2009/12/09 14:29:22 sjetschny Exp $
# Makefile for fdmpi
#--------------------------------------------------------
# edit here:
# source code for model generation (acoustic)
MODEL_SCR_A = hh_acoustic.c
# source code for model generation (elastic)
#MODEL_SCR = hh_bench2.c
#MODEL_SCR = hh_3DSchach.c
#MODEL_SCR = hh_FLnodes.c
#MODEL_SCR = hh_CPML.c
#MODEL_SCR = tuebbing.c
# reading input data from ASCII-file:
# MODEL_SCR = readmod.c
#MODEL_SCR = hh_toy.c
MODEL_SCR = hh_reflect.c
# Compiler (LAM: CC=hcc, CRAY T3E: CC=cc, SHARCNet: mpicc)
# ON Linux cluster running LAM
CC=hcc
LFLAGS=-lm -lmpi -lcseife
CFLAGS=-Wall -O4
SFLAGS=-L./../libcseife
IFLAGS=-I./../libcseife
#Hermit
#CC=cc
#LFLAGS=-lm -lcseife
#CFLAGS=-O3
#SFLAGS=-L./../libcseife
#IFLAGS=-I./../libcseife
#CFLAGS=-Wall -g -g3 -ggdb
# -O4
# On CRAY T3E
#CC=cc
# Juropa
#CC=mpicc
#LFLAGS=-lm
#CFLAGS=-Wall -O4 -ipo
# On HLRN system
#CC=mpcc
#LFLAGS=-lm
# ON Linux cluster ALTIX.RZ.UNI-KIEL:DE
#CC=icc
#CFLAGS=-mp -O3 -ip0q
#LFLAGS=-lmpi -lm
# ON Linux cluster ALTIX.HRZ.TU-FREIBERG.DE
#CC=icc
#CFLAGS=-mp -O3 -ip0
#LFLAGS=-lmpi -lm -i-static
# after this line, no further editing should be necessary
# --------------------------------------------------------
.c.o:
$(CC) -c $(CFLAGS) $< $(IFLAGS)
SEISMERGE_SCR = seismerge.c
SNAPMERGE_SCR = \
snapmerge.c \
merge.c \
read_par.c \
readdsk.c \
writedsk.c \
util.c
PARTMODEL_SCR = \
part_model.c \
read_par.c \
util.c
FDMPI_UTIL = \
absorb.c \
av_mat.c \
comm_ini.c \
info.c \
initproc.c \
initproc_block.c \
initsour.c \
merge.c \
mergemod.c \
note.c \
outseis.c \
output_source_signal.c \
PML_ini.c \
rd_sour.c \
read_checkpoint.c\
readdsk.c \
read_par.c \
exchange_par.c \
receiver.c \
save_checkpoint.c\
saveseis.c \
sources.c \
splitrec.c \
splitsrc.c \
timing.c \
util.c \
wavelet.c \
writedsk.c \
writemod.c \
writepar.c \
zero.c \
zero_fdmpi.c \
rwsegy.c \
FDMPI_SRC = \
fdmpi.c \
comm_ini_s.c \
checkfd_ssg.c \
CPML_coeff.c \
CPML_ini_elastic.c\
seismo_ssg.c \
matcopy.c \
surface_ssg.c \
surface_ssg_elastic.c\
update_s_ssg.c \
update_s_ssg_CPML.c \
update_s_ssg_elastic.c \
update_s_ssg_CPML_elastic.c \
update_v_ssg.c \
update_v_ssg_CPML.c \
snap_ssg.c \
exchange_v.c \
exchange_s.c \
psource.c \
readseis.c \
residual.c \
zero_wavefield.c \
gradients.c \
gradient_F.c \
conjugategrad.c \
hess_F.c \
readhess.c \
modelupdate.c \
zero_invers.c \
zero_grad.c \
precongrad.c \
hess_apply.c \
outgrad.c \
outmod.c \
steplength.c \
cpmodel.c \
readinv.c \
disc_fourier.c \
exchange_Fv.c \
model_gauss.c \
filt_seis.c \
model2_5D.c \
smooth.c \
lbfgs.c \
lbfgs_save.c \
constant_boundary.c \
$(MODEL_SCR) \
$(FDMPI_UTIL)
FDMPI_SRC_RSG = \
fdmpi_rsg.c \
checkfd_rsg.c \
seismo_rsg.c \
update_s_rsg.c \
matcopy.c \
update_v_rsg.c \
snap_rsg.c \
exchange_v_rsg.c \
exchange_s_rsg.c \
psource_rsg.c \
$(MODEL_SCR) \
$(FDMPI_UTIL)
FDMPI_ACOUSTIC_SRC = \
av_mat_acoustic.c \
fdmpi_acoustic.c \
checkfd_acoustic.c \
comm_ini_acoustic.c \
seismo_ssg_acoustic.c \
matcopy_acoustic.c \
surface_acoustic.c \
PML_ini_acoustic.c \
absorb_PML.c \
update_s_acoustic.c \
update_v_acoustic.c \
update_s_acoustic_PML.c \
update_v_acoustic_PML.c \
snap_ssg_acoustic.c \
exchange_v_acoustic.c \
exchange_s_acoustic.c \
psource_acoustic.c \
readmod_acoustic.c \
$(MODEL_SCR_A) \
$(FDMPI_UTIL)
FDMPI_OBJ = $(FDMPI_SRC:%.c=%.o)
FDMPI_OBJ_RSG = $(FDMPI_SRC_RSG:%.c=%.o)
FDMPI_ACOUSTIC_OBJ = $(FDMPI_ACOUSTIC_SRC:%.c=%.o)
SNAPMERGE_OBJ = $(SNAPMERGE_SCR:%.c=%.o)
PARTMODEL_OBJ = $(PARTMODEL_SCR:%.c=%.o)
SEISMERGE_OBJ = $(SEISMERGE_SCR:%.c=%.o)
seismerge: $(SEISMERGE_OBJ)
$(CC) $(LFLAGS) $(SEISMERGE_OBJ) -o ../bin/seismerge
snapmerge: $(SNAPMERGE_OBJ)
$(CC) $(LFLAGS) $(SNAPMERGE_OBJ) -o ../bin/snapmerge
part_model: $(PARTMODEL_OBJ)
$(CC) $(LFLAGS) $(PARTMODEL_OBJ) -o ../bin/partmodel
fdmpi: $(FDMPI_OBJ)
$(CC) $(SFLAGS) $(FDMPI_OBJ) $(LFLAGS) -o ../bin/fdmpi
fdmpi_acoustic: $(FDMPI_ACOUSTIC_OBJ)
$(CC) $(LFLAGS) $(FDMPI_ACOUSTIC_OBJ) -o ../bin/fdmpi_acoustic
clean:
find . -name "*.o" -exec rm {} \;
find . -name "*.bck" -exec rm {} \;
find . -name "core" -exec rm {} \;
......@@ -323,28 +323,28 @@ float *** ptaus, float *** ptaup, float *peta, float **srcpos, int nsrc, int **r
switch (SEISMO){
case 1: particle velocities only
sprintf(xfile,"%s.fdmpi.tmp",dirname(SEIS_FILE_VX));
sprintf(xfile,"%s.ifos.tmp",dirname(SEIS_FILE_VX));
if (access(xfile,W_OK|X_OK)==-1) err2(" PE %d cannot write seismograms to %s!",xfile);
sprintf(xfile,"%s.fdmpi.tmp",dirname(SEIS_FILE_VY));
sprintf(xfile,"%s.ifos.tmp",dirname(SEIS_FILE_VY));
if (access(xfile,W_OK|X_OK)==-1) err2(" PE %d cannot write seismograms to %s!",xfile);
sprintf(xfile,"%s.fdmpi.tmp",dirname(SEIS_FILE_VZ));
sprintf(xfile,"%s.ifos.tmp",dirname(SEIS_FILE_VZ));
if (access(xfile,W_OK|X_OK)==-1) err2(" PE %d cannot write seismograms to %s!",xfile);
break;
case 2 : pressure only
sprintf(xfile,"%s.fdmpi.tmp",dirname(SEIS_FILE_P));
sprintf(xfile,"%s.ifos.tmp",dirname(SEIS_FILE_P));
if (access(xfile,W_OK|X_OK)==-1) err2(" PE %d cannot write seismograms to %s!",xfile);
break;
case 4 :
sprintf(xfile,"%s.fdmpi.tmp",dirname(SEIS_FILE_VX));
sprintf(xfile,"%s.ifos.tmp",dirname(SEIS_FILE_VX));
if (access(xfile,W_OK|X_OK)==-1) err2(" PE %d cannot write seismograms to %s!",xfile);
sprintf(xfile,"%s.fdmpi.tmp",dirname(SEIS_FILE_VY));
sprintf(xfile,"%s.ifos.tmp",dirname(SEIS_FILE_VY));
if (access(xfile,W_OK|X_OK)==-1) err2(" PE %d cannot write seismograms to %s!",xfile);
sprintf(xfile,"%s.fdmpi.tmp",dirname(SEIS_FILE_VZ));
sprintf(xfile,"%s.ifos.tmp",dirname(SEIS_FILE_VZ));
if (access(xfile,W_OK|X_OK)==-1) err2(" PE %d cannot write seismograms to %s!",xfile);
case 3 : curl and div only
sprintf(xfile,"%s.fdmpi.tmp",dirname(SEIS_FILE_DIV));
sprintf(xfile,"%s.ifos.tmp",dirname(SEIS_FILE_DIV));
if (access(xfile,W_OK|X_OK)==-1) err2(" PE %d cannot write seismograms to %s!",xfile);
sprintf(xfile,"%s.fdmpi.tmp",dirname(SEIS_FILE_CURL));
sprintf(xfile,"%s.ifos.tmp",dirname(SEIS_FILE_CURL));
if (access(xfile,W_OK|X_OK)==-1) err2(" PE %d cannot write seismograms to %s!",xfile);
break;
}
......
This diff is collapsed.
/* $Id: fdmpi.c,v 1.1.1.1 2009/12/09 14:29:22 sjetschny Exp $ */
/*
This is program FDMPI. Viscoelastic Version.
Parallel 3-D Viscoelastic Finite Difference Seismic Modelling
T. Bohlen
PLEASE DO NOT DISTRIBUTE. PLEASE REFER OTHER PEOPLE TO THE AUTHOR.
Author
Prof. Dr. Thomas Bohlen, Karlsruhe Institute of Technology, Geophysical Institute,
Hertzstr. 16, 76227 Karlsruhe, Germany
Phone/Fax: +49 (0)721 608 4416
mailto:thomas.bohlen@kit.edu,
http://www.gpi.kit.edu
If you want to publish synthetic data calculated with this program please
give a reference to the following paper:
Bohlen, T., 2002, Parallel 3-D viscoelastic finite-recposdifference seismic modelling,
Computers @ Geopsciences, Vol. 28, No. 8, 887-889.*/
//
/*-----------------------------------------------------------------------------------------
* Copyright (C) 2016 For the list of authors, see file AUTHORS.
*
* This file is part of IFOS3D.
*
* IFOS3D 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.
*
* IFOS3D 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 IFOS. See file COPYING and/or <http://www.gnu.org/licenses/gpl-2.0.html>.
-----------------------------------------------------------------------------------------*/
/* ----------------------------------------------------------------------
* This is program IFOS3D.
* 3D elastic Inversion of Full Observed Seismograms
*
* ----------------------------------------------------------------------*/
#include "fd.h"
#include "globvar.h"
......@@ -109,20 +112,20 @@ int main(int argc, char **argv){
FDMPIVERS=33; /* 3D isotropic elastic */
/* PE 0 is reading the parameters from the input file fdmpi.inp */
/* PE 0 is reading the parameters from the input file ifos3d.inp */
if (MYID == 0){
if (argc>1) {
strncpy(FILEINP,argv[1],STRING_SIZE);
fprintf(stderr," Input parameter filename read from command line : %s. \n\n",FILEINP);
if (strlen(FILEINP)>STRING_SIZE-1) {
fprintf(stderr,"\n FDMPI cannot handel pathes with more than %d characters.\n",STRING_SIZE-1);
fprintf(stderr," Error: FDMPI could not read input parameter file name. -> Exit. \n\n");
fprintf(stderr,"\n IFOS cannot handel pathes with more than %d characters.\n",STRING_SIZE-1);
fprintf(stderr," Error: IFOS could not read input parameter file name. -> Exit. \n\n");
return -1;
}
}
else {
strcpy(FILEINP,"fdmpi.inp");
fprintf(stderr," Caution: input parameter filename set to default 'fdmpi.inp'. \n\n");
strcpy(FILEINP,"ifos3d.inp");
fprintf(stderr," Caution: input parameter filename set to default 'ifos3d.inp'. \n\n");
}
FP=fopen(FILEINP,"r");
read_par(FP);
......@@ -152,7 +155,7 @@ int main(int argc, char **argv){
fprintf(FP," This is the log-file generated by PE %d \n\n",MYID);
if (MYID==0){
FI=fopen("in_and_out/fdmpi_invers.out","w");
FI=fopen("in_and_out/ifos3D_invers.out","w");
setvbuf(FI, NULL, _IONBF, 0);
fprintf(FI,"------------------ Inversion Parameters ----------------- \n");
}
......@@ -566,7 +569,7 @@ MPI_Barrier(MPI_COMM_WORLD);
case 0:
fprintf(FP,"\n Reading source parameters specified in input file instead of source file. \n");break;
case 1:
fprintf(FP,"\n Reading source parameters from file: %s (FDMPI source format)\n",SOURCE_FILE);
fprintf(FP,"\n Reading source parameters from file: %s (IFOS source format)\n",SOURCE_FILE);
if ((fpsrc=fopen(SOURCE_FILE,"r"))==NULL) err(" Source file could not be opened !");
while(fgets(buffer, STRING_SIZE, fpsrc))
{
......
......@@ -63,11 +63,11 @@ int nsrc, int ns, int seis_form[6]){
infilename=(char *)FILEINP;
strncpy(kindofdata,"synthetic seismograms modeled by fdmpi",STRING_SIZE);
strncpy(kindofdata,"synthetic seismograms modeled by ifos",STRING_SIZE);
if (FDMPIVERS==33)
strncat(kindofdata," (3D isotropic elastic)",STRING_SIZE-sizeof("synthetic seismograms modeled by fdmpi"));
strncat(kindofdata," (3D isotropic elastic)",STRING_SIZE-sizeof("synthetic seismograms modeled by ifos"));
else if (FDMPIVERS==32)
strncat(kindofdata," (3D isotropic acoustic)",STRING_SIZE-sizeof("synthetic seismograms modeled by fdmpi"));
strncat(kindofdata," (3D isotropic acoustic)",STRING_SIZE-sizeof("synthetic seismograms modeled by ifos"));
kindofdata[STRING_SIZE-1]='\0';
......
......@@ -55,7 +55,7 @@ int read_par(FILE *fp_in){
int lineno=0, l, nvarin=0;
if (fp_in==NULL) err(" Could not open input parameter file (fdmpi.inp)! ");
if (fp_in==NULL) err(" Could not open input parameter file (ifos3d.inp)! ");
while (fgets(cline,255,fp_in)){ /* leaves via break */
/* If there are more than 255 characters in one line, this does not work. */
......
......@@ -145,17 +145,17 @@ float *** taus, float *** taup, float * eta){
/* each PE writes his model to disk */
/*sprintf(filename,"%s.FDMPI.pwavemod",MFILE);
/*sprintf(filename,"%s.IFOS.pwavemod",MFILE);
writemod(filename,pwavemod,3);
MPI_Barrier(MPI_COMM_WORLD);
if (MYID==0) mergemod(filename,3);
sprintf(filename,"%s.FDMPI.swavemod",MFILE);
sprintf(filename,"%s.IFOS.swavemod",MFILE);
writemod(filename,swavemod,3);
MPI_Barrier(MPI_COMM_WORLD);
if (MYID==0) mergemod(filename,3);
sprintf(filename,"%s.FDMPI.rho",MFILE);
sprintf(filename,"%s.IFOS.rho",MFILE);
writemod(filename,rho,3);
MPI_Barrier(MPI_COMM_WORLD);
if (MYID==0) mergemod(filename,3);*/
......
......@@ -212,11 +212,11 @@ int DDN_rtraceh(FILE * instream, int lbendian, int ieeeibm, int meterfeet, int s
/* 177-178 short gaps; */ n+=fread(&dummyshort,1,2,instream); /* gap size (total number of groups dropped) */
/* 179-180 short otrav; */ n+=fread(&dummyshort,1,2,instream); /* overtravel taper code: 1 = down (or behind), 2 = up (or ahead) */
if (susegy==1){
/* 181-184 int ???; */ n+=fread(&xcoo,1,4,instream); if (doswap) swap4(&xcoo); /* 1st horizontal coordinate for models (in FDMPI ususally X) */
/* 181-184 int ???; */ n+=fread(&xcoo,1,4,instream); if (doswap) swap4(&xcoo); /* 1st horizontal coordinate for models (in IFOS ususally X) */
/* X coordinate of ensemble (CDP) position of this trace (scalar in Trace
Header bytes 71-72 applies). The coordinate reference system should be
identified through an extended header Location Data stanza. */
/* 185-188 int ???; */ n+=fread(&ycoo,1,4,instream); if (doswap) swap4(&ycoo); /* 2nd horizontal coordinate for models (in FDMPI ususally Z) */
/* 185-188 int ???; */ n+=fread(&ycoo,1,4,instream); if (doswap) swap4(&ycoo); /* 2nd horizontal coordinate for models (in IFOS ususally Z) */
/* Y coordinate of ensemble (CDP) position of this trace (scalar in Trace
Header bytes 71-72 applies). The coordinate reference system should be
identified through an extended header Location Data stanza. */
......@@ -555,10 +555,10 @@ int DDN_wtraceh(FILE * outstream, int lbendian, int ieeeibm, int meterfeet, int
if (susegy==1) scalef=-myisign(scale)*(int)pow(10.0,abs(scale)); else scalef=-scale;
if (meterfeet==1){
gcoo[0]=(int)floor((recpos[1][tracl]*DX*scalefac)/0.3048+0.5);
gcoo[2]=(int)floor((recpos[2][tracl]*DY*scalefac)/0.3048+0.5); /* fdmpi swaps Y and Z */
gcoo[2]=(int)floor((recpos[2][tracl]*DY*scalefac)/0.3048+0.5); /* ifos swaps Y and Z */
gcoo[1]=(int)floor((recpos[3][tracl]*DZ*scalefac)/0.3048+0.5);
scoo[0]=(int)floor((xshot*scalefac)/0.3048+0.5);
scoo[2]=(int)floor((yshot*scalefac)/0.3048+0.5); /* fdmpi swaps Y and Z */
scoo[2]=(int)floor((yshot*scalefac)/0.3048+0.5); /* ifos swaps Y and Z */
scoo[1]=(int)floor((zshot*scalefac)/0.3048+0.5);
gwdep=(int)floor((sqrt(z*z+y*y)*scalefac)/0.3048+0.5); /* misused parameter for tunnel geometry */
if (nsrc==1) offset=(int)floor((sqrt(
......@@ -568,10 +568,10 @@ int DDN_wtraceh(FILE * outstream, int lbendian, int ieeeibm, int meterfeet, int
}
else {
gcoo[0]=(int)floor(recpos[1][tracl]*DX*scalefac+0.5);
gcoo[2]=(int)floor(recpos[2][tracl]*DY*scalefac+0.5); /* fdmpi swaps Y and Z */
gcoo[2]=(int)floor(recpos[2][tracl]*DY*scalefac+0.5); /* ifos swaps Y and Z */
gcoo[1]=(int)floor(recpos[3][tracl]*DZ*scalefac+0.5);
scoo[0]=(int)floor(xshot*scalefac+0.5);
scoo[2]=(int)floor(yshot*scalefac+0.5); /* fdmpi swaps Y and Z */
scoo[2]=(int)floor(yshot*scalefac+0.5); /* ifos swaps Y and Z */
scoo[1]=(int)floor(zshot*scalefac+0.5);
gwdep=(int)floor(sqrt(z*z+y*y)*scalefac+0.5); /* misused parameter for tunnel geometry */
if (nsrc==1) offset=(int)floor((sqrt(
......@@ -724,11 +724,11 @@ int DDN_wtraceh(FILE * outstream, int lbendian, int ieeeibm, int meterfeet, int
/* 177-178 short gaps; */ n+=fwrite(&snull,1,2,outstream); /* gap size (total number of groups dropped) */
/* 179-180 short otrav; */ n+=fwrite(&snull,1,2,outstream); /* overtravel taper code: 1 = down (or behind), 2 = up (or ahead) */
if (susegy==1){
ih=(int)floor(xcoo*scalefac+0.5); if (doswap) swap4(&ih); /* 1st horizontal coordinate for models (in FDMPI ususally X) */
ih=(int)floor(xcoo*scalefac+0.5); if (doswap) swap4(&ih); /* 1st horizontal coordinate for models (in IFOS ususally X) */
/* 181-184 int ???; */ n+=fwrite(&ih,1,4,outstream); /* X coordinate of ensemble (CDP) position of this trace (scalar in Trace
Header bytes 71-72 applies). The coordinate reference system should be
identified through an extended header Location Data stanza. */
ih=(int)floor(ycoo*scalefac+0.5); if (doswap) swap4(&ih); /* 2nd horizontal coordinate for models (in FDMPI ususally Z) */
ih=(int)floor(ycoo*scalefac+0.5); if (doswap) swap4(&ih); /* 2nd horizontal coordinate for models (in IFOS ususally Z) */
/* 185-188 int ???; */ n+=fwrite(&ih,1,4,outstream); /* Y coordinate of ensemble (CDP) position of this trace (scalar in Trace
Header bytes 71-72 applies). The coordinate reference system should be
identified through an extended header Location Data stanza. */
......@@ -1131,7 +1131,7 @@ int DDN_rsegytxth(FILE * instream, int * asciiebcdic, FILE * outstream){
}
int DDN_wsegytxth(FILE * outstream, int asciiebcdic, char * kindofdata, char * infilename, int ns, float dt, int ndt){
/* this subroutine wirtes an almost empty textual header - some entries starting with "FDMPI-" are non-standard */
/* this subroutine wirtes an almost empty textual header - some entries starting with "IFOS-" are non-standard */
char segyhbuf[3201];
int j;
if (curerr==NULL) curerr=FP;
......@@ -1160,13 +1160,13 @@ int DDN_wsegytxth(FILE * outstream, int asciiebcdic, char * kindofdata, char * i
sprintf(&segyhbuf[1520],"%-79.79s\n","C20 MAP PROJECTION ZONE ID COORDINATE UNITS ");
sprintf(&segyhbuf[1600],"%-79.79s\n","C21 PROCESSING: ");
sprintf(&segyhbuf[1680],"%-79.79s\n","C22 PROCESSING: ");
/* FDMPI-header */
sprintf(&segyhbuf[1760],"C23 FDMPI-DATA: %s",kindofdata); sprintf(&segyhbuf[1760],"%-79.79s\n",&segyhbuf[1760]);
sprintf(&segyhbuf[1840],"C24 FDMPI-INPUT: %s",infilename); sprintf(&segyhbuf[1840],"%-79.79s\n",&segyhbuf[1840]);
sprintf(&segyhbuf[1920],"C25 FDMPI-PAR: ns: %d, dt: %d * %e s",ns,ndt,dt); sprintf(&segyhbuf[1920],"%-79.79s\n",&segyhbuf[1920]);
sprintf(&segyhbuf[2000],"%-79.79s\n","C26 FDMPI-CONTACT: Thomas Bohlen <thomas.bohlen@geophysik.tu-freiberg.de> ");
sprintf(&segyhbuf[2080],"%-79.79s\n","C27 FDMPI-CONTACT: Daniel Koehn <daniel.koehn@geophysik.tu-freiberg.de> ");
sprintf(&segyhbuf[2160],"%-79.79s\n","C28 FDMPI-CONTACT: Denise De Nil <denise.denil@geophysik.tu-freiberg.de> ");
/* IFOS-header */
sprintf(&segyhbuf[1760],"C23 IFOS-DATA: %s",kindofdata); sprintf(&segyhbuf[1760],"%-79.79s\n",&segyhbuf[1760]);
sprintf(&segyhbuf[1840],"C24 IFOS-INPUT: %s",infilename); sprintf(&segyhbuf[1840],"%-79.79s\n",&segyhbuf[1840]);
sprintf(&segyhbuf[1920],"C25 IFOS-PAR: ns: %d, dt: %d * %e s",ns,ndt,dt); sprintf(&segyhbuf[1920],"%-79.79s\n",&segyhbuf[1920]);
sprintf(&segyhbuf[2000],"%-79.79s\n","C26 IFOS-CONTACT: Thomas Bohlen <thomas.bohlen@geophysik.tu-freiberg.de> ");
sprintf(&segyhbuf[2080],"%-79.79s\n","C27 IFOS-CONTACT: Daniel Koehn <daniel.koehn@geophysik.tu-freiberg.de> ");
sprintf(&segyhbuf[2160],"%-79.79s\n","C28 IFOS-CONTACT: Denise De Nil <denise.denil@geophysik.tu-freiberg.de> ");
/* completing SEGY-textual header with almost empty lines, rev.-tag and end-tag */
for (j=29; j<39;j++) sprintf(&segyhbuf[(j-1)*80],"C%2d%-76.76s\n",j," ");
sprintf(&segyhbuf[3040],"%-79.79s\n","C39 SEG Y REV1");
......@@ -1232,7 +1232,7 @@ int DDN_rsegybinh(FILE * instream, int * lbendian, int * ieeeibm, int * meterfee
n+=fread(&sintnull,1,2,instream); /* corellated data traces: 1=no, 2=yes */
n+=fread(&sintnull,1,2,instream); /* binary gain recovered: 1=yes, 2=no */
n+=fread(&sintnull,1,2,instream); /* amplitude recovery method: 1=none */
n+=fread(&smf,1,2,instream); /*2: feet, 1: meter (fdmpi assumes that SI units are used) */
n+=fread(&smf,1,2,instream); /*2: feet, 1: meter (ifos assumes that SI units are used) */
n+=fread(&sintnull,1,2,instream); /* impulse signal polarity pressure */
/* not defined: increase in pressure or downward movement gives positive number on tape */
/* 1 = increase in pressure or upward movement gives negative number on tape */
......@@ -1315,7 +1315,7 @@ int DDN_wsegybinh(FILE * outstream, int lbendian, int ieeeibm, int meterfeet, in
n+=fwrite(&sintnull,1,2,outstream); /* binary gain recovered: 1=yes, 2=no */
n+=fwrite(&sintnull,1,2,outstream); /* amplitude recovery method: 1=none */
if (meterfeet==1) h=2; /* feet */
else h=1; if (doswap) swap2(&h); /* meter (fdmpi assumes that SI units are used) */
else h=1; if (doswap) swap2(&h); /* meter (ifos assumes that SI units are used) */
n+=fwrite(&h,1,2,outstream);
n+=fwrite(&sintnull,1,2,outstream); /* impulse signal polarity pressure */
/* not defined: increase in pressure or downward movement gives positive number on tape */
......
......@@ -35,7 +35,7 @@ float ***sxx, float ***syy, float ***szz, float ***pi, float ***u){
extern float DX, DY, DZ;
ins=lsamp; /* changed from "ins=lsamp/NDT;" (neccessary after correction of the buggy ns in fdmpi.c) */
ins=lsamp; /* changed from "ins=lsamp/NDT;" (neccessary after correction of the buggy ns in ifos.c) */
dh24x=1.0/DX;
dh24y=1.0/DY;
dh24z=1.0/DZ;
......
......@@ -139,7 +139,7 @@ void pwsources(int *nsrc, float **srcpos){ /* plane wave excitation */
/*srcpos=fmatrix(1,6,1,*nsrc);*/
/*read from fdmpi.c */
/*read from ifos.c */
/*fprintf(FP," Number of source position