[cig-commits] r18135 - in seismo/3D/SPECFEM3D_GLOBE/trunk: EXAMPLES/noise_examples EXAMPLES/noise_examples/global_long EXAMPLES/noise_examples/global_short EXAMPLES/noise_examples/regional src/shared src/specfem3D
yangl at geodynamics.org
yangl at geodynamics.org
Thu Mar 24 12:43:02 PDT 2011
Author: yangl
Date: 2011-03-24 12:43:00 -0700 (Thu, 24 Mar 2011)
New Revision: 18135
Modified:
seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/global_long/adj_traveltime_filter.f90
seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/global_short/adj_traveltime_filter.f90
seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/pre-processing
seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/regional/adj_traveltime_filter.f90
seismo/3D/SPECFEM3D_GLOBE/trunk/src/shared/write_c_binary.c
seismo/3D/SPECFEM3D_GLOBE/trunk/src/specfem3D/noise_tomography.f90
seismo/3D/SPECFEM3D_GLOBE/trunk/src/specfem3D/specfem3D.f90
Log:
change number of files defined in src/shared/write_c_binary.c (from 9 to 10), new index 9 corresponds to SURFACE_MOVIE used in NOISE_TOMOGRAPHY
Modified: seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/global_long/adj_traveltime_filter.f90
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/global_long/adj_traveltime_filter.f90 2011-03-24 19:42:51 UTC (rev 18134)
+++ seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/global_long/adj_traveltime_filter.f90 2011-03-24 19:43:00 UTC (rev 18135)
@@ -1,3 +1,7 @@
+!!!!! this subroutine is used for preparing adjoint sources in this example ONLY
+!!!!! generally, you should make your own measuremnts and calculate corresponding adjoint sources
+!!!!! FLEXWIN could be of help, or you can modify this code a little bit
+
program adj_traveltime
implicit none
@@ -177,27 +181,24 @@
write(1002,*) t(itime), adj(itime,irec)
end do
close(1002)
-! file_data = './yang_data/'//trim(station_name)//'.AA.PRE.semp_picked'
-! file_syn = './yang_syn/'//trim(station_name)//'.AA.PRE.semp_picked'
-! file_adj = './yang_data/'//trim(station_name)//'.AA.PRE.semp_adj'
-! file_adj_density = './yang_syn/'//trim(station_name)//'.AA.PRE.semp_adjden'
-! open(unit=1001,file=trim(file_data),status='unknown')
-! open(unit=1002,file=trim(file_syn),status='unknown')
-! open(unit=1003,file=trim(file_adj),status='unknown')
-! open(unit=1004,file=trim(file_adj_density),status='unknown')
-! do itime = 1,nstep
-! write(1001,*) t(itime), data_origin(itime,irec)
-! write(1002,*) t(itime), syn_origin(itime,irec)
-! write(1003,*) t(itime), adj(itime,irec)
-! write(1004,*) t(itime), adj_density(itime,irec)
-! end do
-! close(1001)
-! close(1002)
-! close(1003)
-! close(1004)
- enddo
+ file_adj_BHZ = './SEM/A7.II.MXE.adj'
+ open(unit=1002,file=trim(file_adj_BHZ),status='unknown')
+ do itime = 1,nstep
+ write(1002,*) t(itime), 0.0
+ end do
+ close(1002)
+ file_adj_BHZ = './SEM/A7.II.MXN.adj'
+ open(unit=1002,file=trim(file_adj_BHZ),status='unknown')
+ do itime = 1,nstep
+ write(1002,*) t(itime), 0.0
+ end do
+ close(1002)
+
+enddo
+
+
close(1111)
file_misfit = './OUTPUT_FILES/misfit_traveltime'
Modified: seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/global_short/adj_traveltime_filter.f90
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/global_short/adj_traveltime_filter.f90 2011-03-24 19:42:51 UTC (rev 18134)
+++ seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/global_short/adj_traveltime_filter.f90 2011-03-24 19:43:00 UTC (rev 18135)
@@ -1,3 +1,7 @@
+!!!!! this subroutine is used for preparing adjoint sources in this example ONLY
+!!!!! generally, you should make your own measuremnts and calculate corresponding adjoint sources
+!!!!! FLEXWIN could be of help, or you can modify this code a little bit
+
program adj_traveltime
implicit none
@@ -177,27 +181,24 @@
write(1002,*) t(itime), adj(itime,irec)
end do
close(1002)
-! file_data = './yang_data/'//trim(station_name)//'.AA.PRE.semp_picked'
-! file_syn = './yang_syn/'//trim(station_name)//'.AA.PRE.semp_picked'
-! file_adj = './yang_data/'//trim(station_name)//'.AA.PRE.semp_adj'
-! file_adj_density = './yang_syn/'//trim(station_name)//'.AA.PRE.semp_adjden'
-! open(unit=1001,file=trim(file_data),status='unknown')
-! open(unit=1002,file=trim(file_syn),status='unknown')
-! open(unit=1003,file=trim(file_adj),status='unknown')
-! open(unit=1004,file=trim(file_adj_density),status='unknown')
-! do itime = 1,nstep
-! write(1001,*) t(itime), data_origin(itime,irec)
-! write(1002,*) t(itime), syn_origin(itime,irec)
-! write(1003,*) t(itime), adj(itime,irec)
-! write(1004,*) t(itime), adj_density(itime,irec)
-! end do
-! close(1001)
-! close(1002)
-! close(1003)
-! close(1004)
- enddo
+ file_adj_BHZ = './SEM/A7.II.MXE.adj'
+ open(unit=1002,file=trim(file_adj_BHZ),status='unknown')
+ do itime = 1,nstep
+ write(1002,*) t(itime), 0.0
+ end do
+ close(1002)
+ file_adj_BHZ = './SEM/A7.II.MXN.adj'
+ open(unit=1002,file=trim(file_adj_BHZ),status='unknown')
+ do itime = 1,nstep
+ write(1002,*) t(itime), 0.0
+ end do
+ close(1002)
+
+enddo
+
+
close(1111)
file_misfit = './OUTPUT_FILES/misfit_traveltime'
Modified: seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/pre-processing
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/pre-processing 2011-03-24 19:42:51 UTC (rev 18134)
+++ seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/pre-processing 2011-03-24 19:43:00 UTC (rev 18135)
@@ -29,14 +29,14 @@
ifort -o NOISE_adj adj_traveltime_filter.f90
cp DATA/Par_file_NOISE_1_attenuation DATA/Par_file
-rm OUTPUT_FILES/*
+rm -rf OUTPUT_FILES/*
make xmeshfem3D
make xspecfem3D
mv bin/xmeshfem3D xmeshfem3D_attenuation
mv bin/xspecfem3D xspecfem3D_attenuation
cp DATA/Par_file_NOISE_1_noattenuation DATA/Par_file
-rm OUTPUT_FILES/*
+rm -rf OUTPUT_FILES/*
make xmeshfem3D
make xspecfem3D
mv bin/xmeshfem3D xmeshfem3D_noattenuation
Modified: seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/regional/adj_traveltime_filter.f90
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/regional/adj_traveltime_filter.f90 2011-03-24 19:42:51 UTC (rev 18134)
+++ seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/regional/adj_traveltime_filter.f90 2011-03-24 19:43:00 UTC (rev 18135)
@@ -1,3 +1,7 @@
+!!!!! this subroutine is used for preparing adjoint sources in this example ONLY
+!!!!! generally, you should make your own measuremnts and calculate corresponding adjoint sources
+!!!!! FLEXWIN could be of help, or you can modify this code a little bit
+
program adj_traveltime
implicit none
@@ -177,27 +181,24 @@
write(1002,*) t(itime), adj(itime,irec)
end do
close(1002)
-! file_data = './yang_data/'//trim(station_name)//'.AA.PRE.semp_picked'
-! file_syn = './yang_syn/'//trim(station_name)//'.AA.PRE.semp_picked'
-! file_adj = './yang_data/'//trim(station_name)//'.AA.PRE.semp_adj'
-! file_adj_density = './yang_syn/'//trim(station_name)//'.AA.PRE.semp_adjden'
-! open(unit=1001,file=trim(file_data),status='unknown')
-! open(unit=1002,file=trim(file_syn),status='unknown')
-! open(unit=1003,file=trim(file_adj),status='unknown')
-! open(unit=1004,file=trim(file_adj_density),status='unknown')
-! do itime = 1,nstep
-! write(1001,*) t(itime), data_origin(itime,irec)
-! write(1002,*) t(itime), syn_origin(itime,irec)
-! write(1003,*) t(itime), adj(itime,irec)
-! write(1004,*) t(itime), adj_density(itime,irec)
-! end do
-! close(1001)
-! close(1002)
-! close(1003)
-! close(1004)
- enddo
+ file_adj_BHZ = './SEM/A7.II.MXE.adj'
+ open(unit=1002,file=trim(file_adj_BHZ),status='unknown')
+ do itime = 1,nstep
+ write(1002,*) t(itime), 0.0
+ end do
+ close(1002)
+ file_adj_BHZ = './SEM/A7.II.MXN.adj'
+ open(unit=1002,file=trim(file_adj_BHZ),status='unknown')
+ do itime = 1,nstep
+ write(1002,*) t(itime), 0.0
+ end do
+ close(1002)
+
+enddo
+
+
close(1111)
file_misfit = './OUTPUT_FILES/misfit_traveltime'
Modified: seismo/3D/SPECFEM3D_GLOBE/trunk/src/shared/write_c_binary.c
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/trunk/src/shared/write_c_binary.c 2011-03-24 19:42:51 UTC (rev 18134)
+++ seismo/3D/SPECFEM3D_GLOBE/trunk/src/shared/write_c_binary.c 2011-03-24 19:43:00 UTC (rev 18135)
@@ -159,7 +159,8 @@
// absorbing files: instead of passing file descriptor, we use the array index
// first 0 - 3 indices for crust mantle files
// last 4 - 8 indices for outer core files
-#define ABS_FILEID 9
+// index 9 - for NOISE_TOMOGRAPHY (SURFACE_MOVIE)
+#define ABS_FILEID 10
// file points
static FILE * fp_abs[ABS_FILEID];
Modified: seismo/3D/SPECFEM3D_GLOBE/trunk/src/specfem3D/noise_tomography.f90
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/trunk/src/specfem3D/noise_tomography.f90 2011-03-24 19:42:51 UTC (rev 18134)
+++ seismo/3D/SPECFEM3D_GLOBE/trunk/src/specfem3D/noise_tomography.f90 2011-03-24 19:43:00 UTC (rev 18135)
@@ -277,12 +277,12 @@
endif
if (NOISE_TOMOGRAPHY/=0) then
- ! save/read the surface movie using the same c routine as we do for absorbing boundaries (file ID is 21)
+ ! save/read the surface movie using the same c routine as we do for absorbing boundaries (file ID is 9)
reclen=CUSTOM_REAL*NDIM*NGLLX*NGLLY*NSPEC_TOP
write(outputname,"('/proc',i6.6,'_surface_movie')") myrank
- if (NOISE_TOMOGRAPHY==1) call open_file_abs_w(21,trim(LOCAL_PATH)//outputname,len_trim(trim(LOCAL_PATH)//outputname),reclen)
- if (NOISE_TOMOGRAPHY==2) call open_file_abs_r(21,trim(LOCAL_PATH)//outputname,len_trim(trim(LOCAL_PATH)//outputname),reclen)
- if (NOISE_TOMOGRAPHY==3) call open_file_abs_r(21,trim(LOCAL_PATH)//outputname,len_trim(trim(LOCAL_PATH)//outputname),reclen)
+ if (NOISE_TOMOGRAPHY==1) call open_file_abs_w(9,trim(LOCAL_PATH)//outputname,len_trim(trim(LOCAL_PATH)//outputname),reclen)
+ if (NOISE_TOMOGRAPHY==2) call open_file_abs_r(9,trim(LOCAL_PATH)//outputname,len_trim(trim(LOCAL_PATH)//outputname),reclen)
+ if (NOISE_TOMOGRAPHY==3) call open_file_abs_r(9,trim(LOCAL_PATH)//outputname,len_trim(trim(LOCAL_PATH)//outputname),reclen)
endif
end subroutine check_parameters_noise
@@ -535,7 +535,7 @@
! also note that the surface movie does NOT have to be shared with other nodes/CPUs
! change LOCAL_PATH specified in "DATA/Par_file"
write(outputname,"('/proc',i6.6,'_surface_movie')") myrank
- call write_abs(21,SURFACE_MOVIE,CUSTOM_REAL*NDIM*NGLLX*NGLLY*nspec_top,it)
+ call write_abs(9,SURFACE_MOVIE,CUSTOM_REAL*NDIM*NGLLX*NGLLY*nspec_top,it)
deallocate(SURFACE_MOVIE)
end subroutine noise_save_surface_movie
@@ -645,7 +645,7 @@
allocate(SURFACE_MOVIE(NDIM,NGLLX,NGLLY,nspec_top))
! read surface movie
write(outputname,"('/proc',i6.6,'_surface_movie')") myrank
- call read_abs(21,SURFACE_MOVIE,CUSTOM_REAL*NDIM*NGLLX*NGLLY*nspec_top,it)
+ call read_abs(9,SURFACE_MOVIE,CUSTOM_REAL*NDIM*NGLLX*NGLLY*nspec_top,it)
! get coordinates of surface mesh and surface displacement
ipoin = 0
do ispec2D = 1, nspec_top ! NSPEC2D_TOP(IREGION_CRUST_MANTLE)
@@ -777,7 +777,7 @@
allocate(SURFACE_MOVIE(NDIM,NGLLX,NGLLY,nspec_top))
! read surface movie, needed for Sigma_kl_crust_mantle
write(outputname,"('/proc',i6.6,'_surface_movie')") myrank
- call read_abs(21,SURFACE_MOVIE,CUSTOM_REAL*NDIM*NGLLX*NGLLY*nspec_top,it)
+ call read_abs(9,SURFACE_MOVIE,CUSTOM_REAL*NDIM*NGLLX*NGLLY*nspec_top,it)
! noise source strength kernel
! to keep similar structure to other kernels, the source strength kernel is saved as a volumetric kernel
! but only updated at the surface, because the noise is generated there
Modified: seismo/3D/SPECFEM3D_GLOBE/trunk/src/specfem3D/specfem3D.f90
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/trunk/src/specfem3D/specfem3D.f90 2011-03-24 19:42:51 UTC (rev 18134)
+++ seismo/3D/SPECFEM3D_GLOBE/trunk/src/specfem3D/specfem3D.f90 2011-03-24 19:43:00 UTC (rev 18135)
@@ -4306,8 +4306,8 @@
endif
- ! save/read the surface movie using the same c routine as we do for absorbing boundaries (file ID is 21)
- if (NOISE_TOMOGRAPHY/=0) call close_file_abs(21)
+ ! save/read the surface movie using the same c routine as we do for absorbing boundaries (file ID is 9)
+ if (NOISE_TOMOGRAPHY/=0) call close_file_abs(9)
! synchronize all processes
More information about the CIG-COMMITS
mailing list