diff --git a/Makefile b/Makefile index 477383cbd3469f042c0b5789070170ad11182692..1351be294e29137f4d3ecbd503ac264307f3279f 100644 --- a/Makefile +++ b/Makefile @@ -10,8 +10,9 @@ all: mkdirs cd corrvir ; $(MAKE) install cd raytime ; $(MAKE) install cd MDD ; $(MAKE) install + cd zfp ; $(MAKE) + cd fdacrtmc ; $(MAKE) install -# cd fdelrtmc ; $(MAKE) install mkdirs: -mkdir -p lib @@ -22,13 +23,14 @@ clean: cd FFTlib ; $(MAKE) $@ cd fdelmodc ; $(MAKE) $@ cd fdelmodc3D ; $(MAKE) $@ - cd fdelrtmc ; $(MAKE) $@ cd utils ; $(MAKE) $@ cd marchenko ; $(MAKE) $@ cd marchenko3D ; $(MAKE) $@ cd corrvir ; $(MAKE) $@ cd raytime ; $(MAKE) $@ cd MDD ; $(MAKE) $@ + cd zfp ; $(MAKE) $@ + cd fdacrtmc ; $(MAKE) $@ realclean: cd FFTlib ; $(MAKE) $@ @@ -41,6 +43,8 @@ realclean: cd corrvir ; $(MAKE) $@ cd raytime ; $(MAKE) $@ cd MDD ; $(MAKE) $@ + cd zfp ; $(MAKE) $@ + cd fdacrtmc ; $(MAKE) $@ rm -f lib/* rm -f include/* rm -f bin/* diff --git a/README b/README index f7643f03892752fe21ca916c1498ea2cbcf9af2e..54dd9c38ccb2d75202b54329714629f8d67e4640 100644 --- a/README +++ b/README @@ -116,6 +116,14 @@ git clone https://github.com/JohnWStockwellJr/SeisUnix ==> Please make sure that SU is compiled without XDR (in $CWPROOT/Makefile.config make sure that XDRFLAG is NOT set). The SU output files of fdelmodc are all based on local IEEE data. +ZFP +--- +The fdacrtmc code makes use of ZFP compression to store the snaphots in CPU memory. This package is included in this repository for +your convenience. The latest package and detailed explanation can be found on: + +https://github.com/LLNL/zfp + + MISC ---- Other make commands which can be useful: diff --git a/fdacrtmc/Examples/Synform/PlaneWave.scr b/fdacrtmc/Examples/Synform/PlaneWave.scr index f3b60952ede59698b59c5f76d88f0b8a888b2204..df999d5cfd5baa93224c00554f2cc462632ca195 100755 --- a/fdacrtmc/Examples/Synform/PlaneWave.scr +++ b/fdacrtmc/Examples/Synform/PlaneWave.scr @@ -44,7 +44,7 @@ for i in {1..1601};do cat SrcWav_Ricker_40Hz_2s.su >> SrcArr.su; done sushw <SrcArr.su key=tracl,tracr,fldr,tracf,scalco,sx a=1,1,1,1,-10,-20000 b=1,1,0,1,0,25 >tmp.su; mv -f tmp.su SrcArr.su; # 1.3: Model Data -../../fdacrtmc/fdacrtmc '#The RTM engine'\ +../../fdacrtmc '#The RTM engine'\ file_cp=Synform_cp.su '#The input acoustic velocity model'\ file_src=SrcArr.su '#The input source array'\ file_rcv=RcvArr.su '#The output receiver data base filename'\ @@ -60,7 +60,7 @@ sushw <SrcArr.su key=tracl,tracr,fldr,tracf,scalco,sx a=1,1,1,1,-10,-20000 b=1,1 suwind <Synform_cp.su itmax=50 | sugain dt=1 scale=0.0 | sugain dt=1 bias=1900 >Direct_cp.su; # 2.2: Model Direct-Wave Data -../../fdacrtmc/fdacrtmc file_cp=Direct_cp.su file_src=SrcArr.su\ +../../fdacrtmc file_cp=Direct_cp.su file_src=SrcArr.su\ file_rcv=DirArr.su\ top=2 npml=50 rcv_top=1 rcv_p=1 rcv_write=1 mig_mode=0 verbose=2; @@ -79,7 +79,7 @@ rm -f Direct_cp.su Direct_ro.su RcvArr_rp.su DirArr_rp.su; # With compression this migration needs about 0.75 GiB of RAM at a tol. of 1e-6 # 0.47 GiB of RAM at a tol. of 1e-3 # 0.16 GiB of RAM at a prec. of 1e-3 -../../fdacrtmc/fdacrtmc file_cp=Synform_cp.su file_src=SrcArr.su\ +../../fdacrtmc file_cp=Synform_cp.su file_src=SrcArr.su\ file_rcv=RcvArr_ND.su '#We now use the direct-wave free reflection data'\ file_mig=Conventional.su '#Base filename for migrated image'\ top=2 npml=50\ @@ -90,13 +90,13 @@ rm -f Direct_cp.su Direct_ro.su RcvArr_rp.su DirArr_rp.su; verbose=2; # 3.2: Display Migrated Image -suximage <Conventional_mig.su title=Migrated_Image perc=98 & +suximage <Conventional_mig.su title=Migrated_Image clip=2e5 & # 3.3: Migrate Using The Hilbert Transform Imaging Condition -../../fdacrtmc/fdacrtmc file_cp=Synform_cp.su file_src=SrcArr.su file_rcv=RcvArr_ND.su\ +../../fdacrtmc file_cp=Synform_cp.su file_src=SrcArr.su file_rcv=RcvArr_ND.su\ file_mig=Hilbert.su '#Base filename for migrated image'\ top=2 npml=50 mig_mode=5 migdt=0.0025 migdx=5 migdz=5 compress=1 verbose=2; # 3.4: Display Migrated Image -suximage <Hilbert_mig.su title=Hilbert_Image & +suximage <Hilbert_mig.su title=Hilbert_Image clip=2e5 & exit; diff --git a/fdacrtmc/Make_include_Max b/fdacrtmc/Make_include_Max deleted file mode 100644 index a14dddce6f40bc6940c1abba0cf5bd79733f433d..0000000000000000000000000000000000000000 --- a/fdacrtmc/Make_include_Max +++ /dev/null @@ -1,144 +0,0 @@ -# Makefile for general rules - -# To Change the compile environment to your current system you should set: -# -1- ROOT variable to the directory where you found this file -# -2- if needed use a different compiler (CC) if gcc is not available -# -3- on Solaris system use RANLIB=ranlib which is defined below - -# the current directory (in vi ":r!pwd") -ROOT=/ribarsko/data/holicki/src/fdelrtmc - -######################################################################## -# C compiler; change this only if you are using a different C-compiler - -#GNU -CC = gcc -#CC=/opt/gcc-4.7.4/bin/gcc -#FC = gfortran -# Linux gcc version 4.x -#OPTC = -g -#OPTC = -O3 -ffast-math -#OPTC += -fopenmp - -#OPTF = -O3 -fno-trapping-math -ffast-math -msse3 -# for better performing code try: -#OPTC = -O3 -fno-trapping-math -ffast-math -funroll-all-loops -msse3 -fomit-frame-pointer -mfpmath=sse -ftree-vectorizer-verbose=1 -fopenmp -# Linux gcc version 3.x -#OPTC = -O3 -ffast-math -funroll-all-loops -mfpmath=sse -# Apple OSX gcc version 4.x (Snow Leopard) -#CC = gcc -OPTC = -O3 -ffast-math -funroll-all-loops -mssse3 -fomit-frame-pointer -mtune=nocona -mfpmath=sse -fdump-tree-vect -fopenmp -D WISDOMDIR="\"/tmp/fftw/\"" - -#for double precision use FFTlib and emmod -#OPTC += -DDOUBLE -#OPTF += -fdefault-double-8 -fdefault-real-8 - -#Cray -#CC=cc -#FC=ftn -#OPTC = -O2 -#OPTF = -O2 - -#Intel -#CC = icc -#FC = ifort - -# Linux -#OPTC = -D -O3 -no-prec-div -xCORE-AVX2 -qopenmp -Wall -#OPTC = -D -O3 -no-prec-div -xCORE-AVX2 -Wall -profile-loops=all -#OPTC = -D WISDOMDIR="\"/tmp/fftw/\"" -O3 -no-prec-div -xCORE-AVX2 -qopenmp -Wall -#OPTC = -D WISDOMDIR="\"/tmp/fftw/\"" -O3 -openmp -Wall -#OPTC = -O3 -no-prec-div -xHOST -qopenmp -Wall -#OPTC = -g -#OPTC = -g -D WISDOMDIR="\"/tmp/fftw/\"" -#OPTC = -g -D WISDOMDIR="\"/tmp/fftw/\"" -fopenmp -#OPTC = -g -qopenmp -mcmodel=large -D WISDOMDIR="\"/tmp/fftw/\"" -#OPTF = -O3 -no-prec-div -# Apple OSX intel 11.1.076 snow leopard 10.6.2 -#OPTC = -O3 -mssse3 -no-prec-div -vec-report2 -fno-builtin-__sprintf_chk - -#PGI -#CC = pgcc -#FC = pgf90 -#OPTC = -fast -Minfo=vect -Mvect=simd:256 -Msafeptr -#OPTC = -fast -Minfo=vect -Mvect=simd:256 -Msafeptr -Mprof=lines -#OPTF = -fast -#LDFLAGS = -fast -Minfo=vect -Mvect=simd:256 -Msafeptr - -#Pathscale -#CC = cc -#FC = ftn -#OPTC = -Ofast -OPT:Ofast -fno-math-errno -#OPTF = -Ofast -OPT:Ofast -fno-math-errno - -#Apple OSX clang/gcc (10.9) llvm -#CC = clang -#OPTC = -Ofast -#LDFLAGS = -Ofast - -#AMD Open64 -#CC = opencc -#FC = openf95 -#OPTC = -O3 -#OPTC += -openmp -#OPTF = -O3 -#LDFLAGS = -static -O3 -# -############################################################################# -# FOR FFT LIBRARIES -#AMD ACML 4.4.0 -#AMDROOT = /home/thorbcke/amdsdk/v1.0/acml/open64_64 -#OPTC += -DACML440 -I$(AMDROOT)/include -#LIBSM = -L$(AMDROOT)/lib -lacml -lfortran -lffio -lrt -lm - -############################################################################# -# Some convenient abbreviations - -B = $(ROOT)/bin -I = $(ROOT)/include -L = $(ROOT)/lib - -######################################################################## -# standard CFLAGS -CFLAGS = -I$I -I. -I/vardim/home/holicki/src/zfp-0.5.5/include - -############################################################################# -# the archiver -AR = ar - -############################################################################# -# ar FLAGS -ARFLAGS = rv - -############################################################################# -# ranlib definition -RANLIB = ar -s -# on Sun SOLARIS use: -#RANLIB = ranlib - - -.SUFFIXES : .o .c .cc .f .a .F90 -.c.o : - $(CC) -c $(CFLAGS) $(OPTC) $< -o $@ -.c.a : - $(CC) -c $(CFLAGS) $(OPTC) $< - $(AR) $(ARFLAGS) $@ $*.o - rm -f $*.o -.o.a : - $(AR) $(ARFLAGS) $@ $*.o - rm -f $*.o -.f.o : - $(FC) -c $(FFLAGS) $(OPTF) $< -.F90.o : - $(FC) -c $(FFLAGS) $(OPTF) $< -.f.a : - $(FC) -c $(FFLAGS) -I$I $< - $(AR) $(ARFLAGS) $@ $*.o - rm -f $*.o -.cc.a : - $(C++) -c $(C++FLAGS) -I$I $< - $(AR) $(ARFLAGS) $@ $*.o - rm -f $*.o -.cc.o : - $(C++) -c $(C++FLAGS) $< - diff --git a/fdacrtmc/Makefile b/fdacrtmc/Makefile index d4b6e06907e9b7391109127cf6bbae8a62e7314e..9f5b6f30c8de923f4aff7b8dc169ae768e88c080 100644 --- a/fdacrtmc/Makefile +++ b/fdacrtmc/Makefile @@ -4,13 +4,13 @@ include ../Make_include ######################################################################## # define general include and system library -CFLAGS += -I/vardim/home/holicki/src/zfp-0.5.5/include -#LIBS += -L$L $(LIBSM) -lm -lfftw3 -lfftw3_omp -I/ribarsko/data/holicki/fftw3/fftw-3.3.6-pl1/api -L/ribarsko/data/holicki/fftw3/fftw-3.3.6-pl1/api -I/vardim/home/holicki/src/zfp-0.5.5/include -L/vardim/home/holicki/src/zfp-0.5.5/lib -lzfp -LIBS += -L$L $(LIBSM) -L/vardim/home/holicki/src/zfp-0.5.5/lib -lzfp +CFLAGS += -I$(ROOT)/zfp/include +LIBS += -L$L $(LIBSM) -L$(ROOT)/zfp/lib -lzfp + #LIBS += -L$L -lgenfft $(LIBSM) -lm #LIBS += -L$L -lgenfft -lm -lc #OPTC = -g -Wall -fsignaling-nans -O0 -#OPTC = -g -O0 +#OPTC += -g #OPTC += -fopenmp -Waddress #OPTC := $(subst -O3 -ffast-math, -O1 -g ,$(OPTC)) #PGI options for compiler feedback diff --git a/fdacrtmc/fileOpen.c b/fdacrtmc/fileOpen.c deleted file mode 100644 index b0ff8066052b3c6952c00d963927e62e6b896fc4..0000000000000000000000000000000000000000 --- a/fdacrtmc/fileOpen.c +++ /dev/null @@ -1,48 +0,0 @@ -#define _FILE_OFFSET_BITS 64 -#define _LARGEFILE_SOURCE -#define _LARGEFILE64_SOURCE - -#include <assert.h> -#include <stdio.h> -#include <stdlib.h> -#include <errno.h> -#include <math.h> -#include <string.h> -#include "segy.h" - -/** -* File handling routines -* -* AUTHOR: -* Jan Thorbecke (janth@xs4all.nl) -* The Netherlands -**/ - -void name_ext(char *filename, char *extension); - -FILE *fileOpen(char *file, char *ext, int append) -{ - FILE *fp; - char filename[1024]; - - strcpy(filename, file); - name_ext(filename, ext); - if (append) fp = fopen(filename, "a"); - else fp = fopen(filename, "w"); - assert(fp != NULL); - - return fp; -} - -int traceWrite(segy *hdr, float *data, int n, FILE *fp) -{ - size_t nwrite; - - nwrite = fwrite( hdr, 1, TRCBYTES, fp); - assert(nwrite == TRCBYTES); - nwrite = fwrite( data, sizeof(float), n, fp); - assert(nwrite == n); - - return 0; -} - diff --git a/fdacrtmc/fileOpen.c b/fdacrtmc/fileOpen.c new file mode 120000 index 0000000000000000000000000000000000000000..665a0bd9fc9569d07ebe78b1f90ea53c1a923ccc --- /dev/null +++ b/fdacrtmc/fileOpen.c @@ -0,0 +1 @@ +../fdelmodc/fileOpen.c \ No newline at end of file diff --git a/fdacrtmc/wisdom.c b/fdacrtmc/wisdom.c index aac6d0eafa8b47fa64f7ce009850c717fab6b87b..c31d12418ab9511d37ba61d07210a44498a4762c 100644 --- a/fdacrtmc/wisdom.c +++ b/fdacrtmc/wisdom.c @@ -1066,7 +1066,7 @@ int Create1DWavenumberTransformPlans(fftPlansPar *fftPlans,size_t nx,size_t nz){ if(PlanFFT_1d_c2c(in,nz,&(fftPlans->fft_1d_c2c_z),&(fftPlans->ifft_1d_c2c_Kz)))verr("Could not load generated FFTw wisdom!"); } - free(in); + fftw_free(in); return(0); } diff --git a/marchenko/demo/README b/marchenko/demo/README index f5a7c129e2a168d2325d162c9f886a2cc27ae43b..5e24f94d6ebd9100284377e8e32cb96e99eba1b7 100644 --- a/marchenko/demo/README +++ b/marchenko/demo/README @@ -2,3 +2,6 @@ The scripts to reproduce the Figures in the manuscript can be found in the direc A more complicated model can be found in the directory twoD and will takes several hours to model the reflection data. +The directory invisible demonstrates the use of the program marchenko_primaries. + +The directory WS15 contains the files and README's used for the EAGE workshop in London 2019: "Reproducing Research with the Marchenko Method and Inversion with the SEISCOPE Toolbox"