[cig-commits] r19843 - in seismo/3D/SPECFEM3D_GLOBE/trunk: doc/USER_MANUAL src/meshfem3D utils/Visualization/Paraview

danielpeter at geodynamics.org danielpeter at geodynamics.org
Wed Mar 21 18:03:41 PDT 2012


Author: danielpeter
Date: 2012-03-21 18:03:41 -0700 (Wed, 21 Mar 2012)
New Revision: 19843

Modified:
   seismo/3D/SPECFEM3D_GLOBE/trunk/doc/USER_MANUAL/manual_SPECFEM3D_GLOBE.pdf
   seismo/3D/SPECFEM3D_GLOBE/trunk/doc/USER_MANUAL/manual_SPECFEM3D_GLOBE.tex
   seismo/3D/SPECFEM3D_GLOBE/trunk/src/meshfem3D/model_gapp2.f90
   seismo/3D/SPECFEM3D_GLOBE/trunk/utils/Visualization/Paraview/paraviewpython-example.py
Log:
updates model_gapp2.f90 routines; updates small comments about adjoint simulations in the manual

Modified: seismo/3D/SPECFEM3D_GLOBE/trunk/doc/USER_MANUAL/manual_SPECFEM3D_GLOBE.pdf
===================================================================
(Binary files differ)

Modified: seismo/3D/SPECFEM3D_GLOBE/trunk/doc/USER_MANUAL/manual_SPECFEM3D_GLOBE.tex
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/trunk/doc/USER_MANUAL/manual_SPECFEM3D_GLOBE.tex	2012-03-21 22:49:45 UTC (rev 19842)
+++ seismo/3D/SPECFEM3D_GLOBE/trunk/doc/USER_MANUAL/manual_SPECFEM3D_GLOBE.tex	2012-03-22 01:03:41 UTC (rev 19843)
@@ -1622,7 +1622,9 @@
 of elements needs to be adjusted as well to maintain spectral elements
 that are as cube-like as possible. The code attempts to do this, but
 be sure to view the mesh with your favorite graphics package to make
-sure that the element are well behaved. Remember: a high-quality mesh is paramount for accurate simulations. In addition to a reorganization of the radial distribution of elements,
+sure that the element are well behaved. 
+Remember: a high-quality mesh is paramount for accurate simulations. 
+In addition to a reorganization of the radial distribution of elements,
 the time stepping and period range in which the attenuation is applied
 is automatically determined. The minimum and maximum periods for attenuation
 are:
@@ -1800,9 +1802,11 @@
 -F}), and run the solver.
 
 \begin{itemize}
-\item Notice that attenuation is not implemented yet for the computation
-of finite-frequency kernels; therefore set \texttt{ATTENUATION = .false.}
-in the \texttt{Par\_file}.
+\item Notice that attenuation is not fully implemented yet for the computation
+of finite-frequency kernels; if \texttt{ATTENUATION = .true.} is set
+in the \texttt{Par\_file}, only effects on phase shift are accounted for
+but not on amplitude of the signals. However, we suggest you use the same
+setting for \texttt{ATTENUATION} as for your forward simulations.
 \item We also suggest you modify the half duration of the \texttt{CMTSOLUTION}
 to be similar to the accuracy of the simulation (see Equation \ref{eq:shortest_period}
 or \ref{eq:shortest_period_regional}) to avoid too much high-frequency
@@ -1878,6 +1882,11 @@
 denotes the region these kernels are for, including mantle (\texttt{reg\_1}),
 outer core (\texttt{reg\_2}), and inner core (\texttt{reg\_3}). The
 output kernels are in the unit of $s/km^{3}$.
+\item Note that if you set the flag \texttt{APPROXIMATE\_HESS\_KL = .true.} in
+the \texttt{constants.h} file and recompile the solver, the adjoint simulation
+also saves files \texttt{proc??????\_reg\_1\_hess\_kernel.bin} which can
+be used as preconditioners in the crust-mantle region for iterative inverse
+optimization schemes.
 \end{itemize}
 \item \textbf{Run the boundary kernel simulation}
 

Modified: seismo/3D/SPECFEM3D_GLOBE/trunk/src/meshfem3D/model_gapp2.f90
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/trunk/src/meshfem3D/model_gapp2.f90	2012-03-21 22:49:45 UTC (rev 19842)
+++ seismo/3D/SPECFEM3D_GLOBE/trunk/src/meshfem3D/model_gapp2.f90	2012-03-22 01:03:41 UTC (rev 19843)
@@ -36,7 +36,7 @@
 
   module gapp2_mantle_model_constants
     ! data file resolution
-    integer, parameter :: ma=228,mo=576,mr=32,mr1=64
+    integer, parameter :: ma=288,mo=576,mr=32,mr1=64
     integer no,na,nnr,nr1
     real dela,delo
     ! allocatable model arrays
@@ -95,7 +95,7 @@
 
   implicit none
   include "constants.h"
-  integer i,ir,ia,io
+  integer i,ir,ia,io,ier
   character(len=150) GAPP2
 
 !...........................................input data
@@ -104,21 +104,65 @@
   call get_value_string(GAPP2, 'model.GAPP2', 'DATA/3dvpGAP_P2')
 
   ! reads in GAP-P2 model from Obayashi
-  open(unit=10,file=GAPP2,status='old',action='read')
+  open(unit=10,file=GAPP2,status='old',action='read',iostat=ier)
+  if( ier /= 0 ) call exit_MPI(0,'error opening file for GAPP2 model')
 
-  read(10,'(3i4,2f10.6)') no,na,nnr,dela,delo
-  read(10,'(34f8.2)') (dep(i),i=0,nnr)
+  read(10,*) no,na,nnr,dela,delo
+
+  ! user output
+  write(IMAIN,*)
+  write(IMAIN,*) "model GAPP2: "
+  write(IMAIN,*) "  dimensions no = ",no
+  write(IMAIN,*) "             na,nnr = ",na,nnr
+  write(IMAIN,*) "             dela,delon = ",dela,delo
+
+  ! checks bounds
+  if( nnr /= mr .or. no /= mo .or. na /= ma ) then
+    print*,'error GAPP2 model bounds: '
+    print*,'  file dimensions: nnr,no,na = ',nnr,no,na
+    print*,'  module dimensions: mr,mo,ma = ',mr,mo,ma
+    close(10)
+    call exit_MPI(0,'please check GAPP2 model dimensions, and update model_gapp2.f90')
+  endif
+
+  read(10,*) (dep(i),i=0,nnr)
   read(10,*) nr1
-  read(10,'(67f8.2)') (dep1(i),i=0,nr1)
-  read(10,'(67f8.3)') (vp1(i),i=0,nr1)
+
+  ! checks bounds
+  write(IMAIN,*) "             nr1 = ",nr1
+  if( nr1 /= mr1 ) then
+    print*,'error GAPP2 model bounds: '
+    print*,'  file dimensions: nr1 = ',nr1
+    print*,'  module dimensions: mr1 = ',mr1
+    close(10)
+    call exit_MPI(0,'please check GAPP2 model dimensions, and update model_gapp2.f90')
+  endif
+
+  read(10,*) (dep1(i),i=0,nr1)
+  read(10,*) (vp1(i),i=0,nr1)
+
+  ! reads vp
   do ir=1,nnr
     do ia=1,na
-      read(10,'(256f7.3)') (vp3(ia,io,ir),io=1,no)
+      ! reads file 2 lines for all no values
+      read(10,'(288f7.3)') (vp3(ia,io,ir),io=1,no)
+
+      !read(10,*,iostat=ier) (vp3(ia,io,ir),io=1,no/2)
+      !read(10,*,iostat=ier) (vp3(ia,io,ir),io=no/2,no)
+
+      if( ier /= 0 ) then
+        print*,'error GAPP2 read: ia,ir = ',ia,ir
+        call exit_MPI(0,'error GAPP2 read')
+      endif
     enddo
   enddo
-  write(6,*) vp3(1,1,1),vp3(na,no,nnr)
   close(10)
 
+  ! user output
+  write(IMAIN,*) '  check vp3: ',vp3(1,1,1),vp3(na,no,nnr)
+  write(IMAIN,*) '  check vp3: min/max = ',minval(vp3),maxval(vp3)
+  write(IMAIN,*)
+
   end subroutine read_mantle_gapmodel
 
 !

Modified: seismo/3D/SPECFEM3D_GLOBE/trunk/utils/Visualization/Paraview/paraviewpython-example.py
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/trunk/utils/Visualization/Paraview/paraviewpython-example.py	2012-03-21 22:49:45 UTC (rev 19842)
+++ seismo/3D/SPECFEM3D_GLOBE/trunk/utils/Visualization/Paraview/paraviewpython-example.py	2012-03-22 01:03:41 UTC (rev 19843)
@@ -10,6 +10,9 @@
 if len(sys.argv) == 3:
   filename = str(sys.argv[1])  
   icounter = str(sys.argv[2])
+else:
+  print "usage: ./paraviewpython-example.py state-file counter[e.g.=0]"
+  sys.exit()
   
 outfile = "paraview_movie."
 print "file root: ",outfile



More information about the CIG-COMMITS mailing list