[cig-commits] r19417 - in seismo/2D/SPECFEM2D/branches/new_branch_for_Xie_Zhinan/trunk: DATA EXAMPLES/attenuation setup src/meshfem2D src/specfem2D

xie.zhinan at geodynamics.org xie.zhinan at geodynamics.org
Mon Jan 23 11:05:32 PST 2012


Author: xie.zhinan
Date: 2012-01-23 11:05:31 -0800 (Mon, 23 Jan 2012)
New Revision: 19417

Modified:
   seismo/2D/SPECFEM2D/branches/new_branch_for_Xie_Zhinan/trunk/DATA/Par_file
   seismo/2D/SPECFEM2D/branches/new_branch_for_Xie_Zhinan/trunk/EXAMPLES/attenuation/Par_file_attenuation_2D
   seismo/2D/SPECFEM2D/branches/new_branch_for_Xie_Zhinan/trunk/EXAMPLES/attenuation/process.sh
   seismo/2D/SPECFEM2D/branches/new_branch_for_Xie_Zhinan/trunk/setup/constants.h.in
   seismo/2D/SPECFEM2D/branches/new_branch_for_Xie_Zhinan/trunk/src/meshfem2D/Makefile.in
   seismo/2D/SPECFEM2D/branches/new_branch_for_Xie_Zhinan/trunk/src/meshfem2D/meshfem2D.F90
   seismo/2D/SPECFEM2D/branches/new_branch_for_Xie_Zhinan/trunk/src/meshfem2D/read_parameter_file.F90
   seismo/2D/SPECFEM2D/branches/new_branch_for_Xie_Zhinan/trunk/src/meshfem2D/save_databases.f90
   seismo/2D/SPECFEM2D/branches/new_branch_for_Xie_Zhinan/trunk/src/specfem2D/read_databases.f90
   seismo/2D/SPECFEM2D/branches/new_branch_for_Xie_Zhinan/trunk/src/specfem2D/specfem2D.F90
Log:
Add reading LDDRK paramter when needed


Modified: seismo/2D/SPECFEM2D/branches/new_branch_for_Xie_Zhinan/trunk/DATA/Par_file
===================================================================
--- seismo/2D/SPECFEM2D/branches/new_branch_for_Xie_Zhinan/trunk/DATA/Par_file	2012-01-23 13:03:42 UTC (rev 19416)
+++ seismo/2D/SPECFEM2D/branches/new_branch_for_Xie_Zhinan/trunk/DATA/Par_file	2012-01-23 19:05:31 UTC (rev 19417)
@@ -26,6 +26,7 @@
 nt                              = 1600           # total number of time steps
 deltat                          = 1.d-3          # duration of a time step
 USER_T0                         = 0.0d0          # use this t0 as earliest starting time rather than the automatically calculated one
+time_stepping_scheme            = 1   # 1 = Newmark (2nd order),     2 = LDDRK4-6 (4th-order 6-stage low storage Runge-Kutta),     3 = classical 4th-order 4-stage Runge-Kutta
 
 # source parameters
 NSOURCES                        = 1              # number of sources [source info read in CMTSOLUTION file]

Modified: seismo/2D/SPECFEM2D/branches/new_branch_for_Xie_Zhinan/trunk/EXAMPLES/attenuation/Par_file_attenuation_2D
===================================================================
--- seismo/2D/SPECFEM2D/branches/new_branch_for_Xie_Zhinan/trunk/EXAMPLES/attenuation/Par_file_attenuation_2D	2012-01-23 13:03:42 UTC (rev 19416)
+++ seismo/2D/SPECFEM2D/branches/new_branch_for_Xie_Zhinan/trunk/EXAMPLES/attenuation/Par_file_attenuation_2D	2012-01-23 19:05:31 UTC (rev 19417)
@@ -26,7 +26,7 @@
 nt                              = 1500           # total number of time steps
 deltat                          = 7.5e-4         # duration of a time step
 USER_T0                         = 0.0d0          # use this t0 as earliest starting time rather than the automatically calculated one
-time_stepping_scheme            = 1              # 1 = Newmark (2nd order), 2 = LDDRK4-6 (4th-order 6-stage low storage Runge-Kutta), 3 = classical 4th-order 4-stage Runge-Kutta
+time_stepping_scheme            = 2              # 1 = Newmark (2nd order), 2 = LDDRK4-6 (4th-order 6-stage low storage Runge-Kutta), 3 = classical 4th-order 4-stage Runge-Kutta
 
 # source parameters
 NSOURCES                        = 1              # number of sources [source info read in CMTSOLUTION file]

Modified: seismo/2D/SPECFEM2D/branches/new_branch_for_Xie_Zhinan/trunk/EXAMPLES/attenuation/process.sh
===================================================================
--- seismo/2D/SPECFEM2D/branches/new_branch_for_Xie_Zhinan/trunk/EXAMPLES/attenuation/process.sh	2012-01-23 13:03:42 UTC (rev 19416)
+++ seismo/2D/SPECFEM2D/branches/new_branch_for_Xie_Zhinan/trunk/EXAMPLES/attenuation/process.sh	2012-01-23 19:05:31 UTC (rev 19417)
@@ -24,6 +24,7 @@
 cp ../Par_file_attenuation_2D Par_file
 cp ../interfaces_attenuation_analytic.dat .
 cp ../SOURCE_attenuation_2D SOURCE
+cp ../Par_LDDRK LDDRK
 cd ../
 
 # cleans output files

Modified: seismo/2D/SPECFEM2D/branches/new_branch_for_Xie_Zhinan/trunk/setup/constants.h.in
===================================================================
--- seismo/2D/SPECFEM2D/branches/new_branch_for_Xie_Zhinan/trunk/setup/constants.h.in	2012-01-23 13:03:42 UTC (rev 19416)
+++ seismo/2D/SPECFEM2D/branches/new_branch_for_Xie_Zhinan/trunk/setup/constants.h.in	2012-01-23 19:05:31 UTC (rev 19417)
@@ -173,3 +173,6 @@
 ! ignore variable name field (junk) at the beginning of each input line
   logical, parameter :: IGNORE_JUNK = .true., DONT_IGNORE_JUNK = .false.
 
+! file number for interface file
+  integer, parameter :: IIN_Par_LDDRK = 39
+  integer, parameter :: Stage = 6

Modified: seismo/2D/SPECFEM2D/branches/new_branch_for_Xie_Zhinan/trunk/src/meshfem2D/Makefile.in
===================================================================
--- seismo/2D/SPECFEM2D/branches/new_branch_for_Xie_Zhinan/trunk/src/meshfem2D/Makefile.in	2012-01-23 13:03:42 UTC (rev 19416)
+++ seismo/2D/SPECFEM2D/branches/new_branch_for_Xie_Zhinan/trunk/src/meshfem2D/Makefile.in	2012-01-23 19:05:31 UTC (rev 19417)
@@ -106,6 +106,7 @@
 	$O/read_parameter_file.o \
 	$O/read_regions.o \
 	$O/read_source_file.o \
+        $O/read_parameter_LDDRK.o \
 	$O/read_value_parameters.o \
 	$O/save_databases.o \
 	$O/save_gnuplot_file.o \
@@ -187,6 +188,9 @@
 $O/read_parameter_file.o: ${S}/read_parameter_file.F90 ${SETUP}/constants.h
 	${F90} $(FLAGS_CHECK) -c -o $O/read_parameter_file.o ${S}/read_parameter_file.F90
 
+$O/read_parameter_file.o: ${S}/read_parameter_LDDRK.F90 ${SETUP}/constants.h      
+	${F90} $(FLAGS_CHECK) -c -o $O/read_parameter_LDDRK.o ${S}/read_parameter_LDDRK.F90
+
 $O/read_regions.o: ${S}/read_regions.f90 ${SETUP}/constants.h
 	${F90} $(FLAGS_CHECK) -c -o $O/read_regions.o ${S}/read_regions.f90
 

Modified: seismo/2D/SPECFEM2D/branches/new_branch_for_Xie_Zhinan/trunk/src/meshfem2D/meshfem2D.F90
===================================================================
--- seismo/2D/SPECFEM2D/branches/new_branch_for_Xie_Zhinan/trunk/src/meshfem2D/meshfem2D.F90	2012-01-23 13:03:42 UTC (rev 19416)
+++ seismo/2D/SPECFEM2D/branches/new_branch_for_Xie_Zhinan/trunk/src/meshfem2D/meshfem2D.F90	2012-01-23 19:05:31 UTC (rev 19417)
@@ -329,6 +329,7 @@
   use parameter_file
   use source_file
   use interfaces_file
+  use parameter_LDDRK
   implicit none
 
   include "constants.h"
@@ -396,6 +397,10 @@
   ! reads in parameters in DATA/Par_file
   call read_parameter_file()
 
+  if(time_stepping_scheme .eq. 2) then !xiezhinan
+   call read_parameter_LDDRK() !xiezhinan
+  endif !xiezhinan
+
   ! reads in mesh elements
   if ( read_external_mesh ) then
      call read_external_mesh_file(mesh_file, num_start, ngnod)

Modified: seismo/2D/SPECFEM2D/branches/new_branch_for_Xie_Zhinan/trunk/src/meshfem2D/read_parameter_file.F90
===================================================================
--- seismo/2D/SPECFEM2D/branches/new_branch_for_Xie_Zhinan/trunk/src/meshfem2D/read_parameter_file.F90	2012-01-23 13:03:42 UTC (rev 19416)
+++ seismo/2D/SPECFEM2D/branches/new_branch_for_Xie_Zhinan/trunk/src/meshfem2D/read_parameter_file.F90	2012-01-23 19:05:31 UTC (rev 19417)
@@ -145,7 +145,7 @@
 ! value of time_stepping_scheme to decide which time scheme will be used              !xiezhinan
 ! # 1 = Newmark (2nd order), 2 = LDDRK4-6 (4th-order 6-stage low storage Runge-Kutta),!xiezhinan
 ! 3 = classical 4th-order 4-stage Runge-Kutta 					      !xiezhinan
-  integer :: time_stepping_scheme						      !xiezhinan
+  integer :: time_stepping_scheme
 
 !! DK DK for horizontal periodic conditions: detect common points between left and right edges
   logical :: ADD_PERIODIC_CONDITIONS
@@ -240,7 +240,7 @@
   if(err_occurred() /= 0) stop 'error reading parameter 17b in Par_file'
 
   call read_value_integer_p(time_stepping_scheme, 'solver.time_stepping_scheme')  !xiezhinan
-  if(err_occurred() /= 0) stop 'error reading parameter 17c in Par_file' !xiezhinan
+  if(err_occurred() /= 0) stop 'error reading parameter 17c in Par_file'          !xiezhinan
 
   ! read source infos
   call read_value_integer_p(NSOURCES, 'solver.NSOURCES')

Modified: seismo/2D/SPECFEM2D/branches/new_branch_for_Xie_Zhinan/trunk/src/meshfem2D/save_databases.f90
===================================================================
--- seismo/2D/SPECFEM2D/branches/new_branch_for_Xie_Zhinan/trunk/src/meshfem2D/save_databases.f90	2012-01-23 13:03:42 UTC (rev 19416)
+++ seismo/2D/SPECFEM2D/branches/new_branch_for_Xie_Zhinan/trunk/src/meshfem2D/save_databases.f90	2012-01-23 19:05:31 UTC (rev 19417)
@@ -53,6 +53,7 @@
   use part_unstruct
   use parameter_file
   use source_file
+  use parameter_lddrk  !xiezhinan
   implicit none
   include "constants.h"
 
@@ -66,7 +67,7 @@
   double precision, dimension(2,nnodes_tangential_curve) :: nodes_tangential_curve
 
   ! local parameters
-  integer :: iproc,i_source,i,ios
+  integer :: iproc,i_source,i,ios,i_stage
   integer :: npgeo
   integer :: my_ninterface
   integer :: nedges_coupled_loc
@@ -83,7 +84,7 @@
     open(unit=15,file=trim(prname),status='unknown',iostat=ios)
     if( ios /= 0 ) stop 'error saving databases'
 
-    write(15,*) '#'
+    write(15,*) IIN_Par_LDDRK, '#'
     write(15,*) '# Database for SPECFEM2D'
     write(15,*) '# Dimitri Komatitsch, (c) University of Pau, France'
     write(15,*) '#'
@@ -188,6 +189,25 @@
                   Mxx(i_source),Mzz(i_source),Mxz(i_source)
     enddo
 
+    if(time_stepping_scheme.eq.2)then
+
+    write(15,*) '# alpha_LDDRK'
+    do i_stage=1,Stage
+    write(15,*) alpha_LDDRK(i_stage)
+    enddo
+    
+    write(15,*) '# beta_LDDRK'
+    do i_stage=1,Stage
+    write(15,*) beta_LDDRK(i_stage)
+    enddo
+    
+    write(15,*) '# c_LDDRK'
+    do i_stage=1,Stage
+    write(15,*) c_LDDRK(i_stage)
+    enddo
+
+    endif
+
     write(15,*) 'attenuation'
     write(15,*) N_SLS, f0_attenuation
 

Modified: seismo/2D/SPECFEM2D/branches/new_branch_for_Xie_Zhinan/trunk/src/specfem2D/read_databases.f90
===================================================================
--- seismo/2D/SPECFEM2D/branches/new_branch_for_Xie_Zhinan/trunk/src/specfem2D/read_databases.f90	2012-01-23 13:03:42 UTC (rev 19416)
+++ seismo/2D/SPECFEM2D/branches/new_branch_for_Xie_Zhinan/trunk/src/specfem2D/read_databases.f90	2012-01-23 19:05:31 UTC (rev 19417)
@@ -112,7 +112,7 @@
 ! value of time_stepping_scheme to decide which time scheme will be used              !xiezhinan
 ! # 1 = Newmark (2nd order), 2 = LDDRK4-6 (4th-order 6-stage low storage Runge-Kutta),!xiezhinan
 ! 3 = classical 4th-order 4-stage Runge-Kutta 					      !xiezhinan
-  integer :: time_stepping_scheme						      !xiezhinan
+  integer :: time_stepping_scheme
 
 !! DK DK for horizontal periodic conditions: detect common points between left and right edges
   logical :: ADD_PERIODIC_CONDITIONS
@@ -364,6 +364,49 @@
 !-------------------------------------------------------------------------------------------------
 !
 
+!
+!-------------------------------------------------------------------------------------------------
+!
+
+  subroutine read_databases_LDDRK(alpha_LDDRK,beta_LDDRK,c_LDDRK)  !xiezhinan
+
+! reads LDDRK parameters
+
+  implicit none
+  include "constants.h"
+  double precision, dimension(Stage) :: alpha_LDDRK,beta_LDDRK,c_LDDRK
+
+  ! local parameters
+  integer :: i_Stage
+  character(len=80) :: datlin
+
+  ! initializes
+  alpha_LDDRK(:) = 0.d0
+  beta_LDDRK(:) = 0.d0
+  c_LDDRK(:) = 0.d0
+
+  ! reads in source info from Database file     
+    read(IIN,"(a80)") datlin
+    do i_stage=1,Stage
+    read(IIN,*) alpha_LDDRK(i_stage)
+    enddo
+    
+    read(IIN,"(a80)") datlin
+    do i_stage=1,Stage
+    read(IIN,*) beta_LDDRK(i_stage)
+    enddo
+    
+    read(IIN,"(a80)") datlin
+    do i_stage=1,Stage
+    read(IIN,*) c_LDDRK(i_stage)
+    enddo
+
+  end subroutine read_databases_LDDRK
+
+!
+!-------------------------------------------------------------------------------------------------
+!
+
   subroutine read_databases_atten(N_SLS,f0_attenuation)
 
 ! reads attenuation information

Modified: seismo/2D/SPECFEM2D/branches/new_branch_for_Xie_Zhinan/trunk/src/specfem2D/specfem2D.F90
===================================================================
--- seismo/2D/SPECFEM2D/branches/new_branch_for_Xie_Zhinan/trunk/src/specfem2D/specfem2D.F90	2012-01-23 13:03:42 UTC (rev 19416)
+++ seismo/2D/SPECFEM2D/branches/new_branch_for_Xie_Zhinan/trunk/src/specfem2D/specfem2D.F90	2012-01-23 19:05:31 UTC (rev 19417)
@@ -378,7 +378,7 @@
 ! value of time_stepping_scheme to decide which time scheme will be used              !xiezhinan
 ! # 1 = Newmark (2nd order), 2 = LDDRK4-6 (4th-order 6-stage low storage Runge-Kutta),!xiezhinan
 ! 3 = classical 4th-order 4-stage Runge-Kutta 					      !xiezhinan
-  integer :: time_stepping_scheme						      !xiezhinan
+  integer :: time_stepping_scheme
 
 ! receiver information
   integer :: nrec,ios
@@ -888,6 +888,12 @@
   ! latter usually much faster but prone to artefacts)
   logical :: save_everywhere = .false.
 
+! for LDDRK46
+  logical :: LDDRK
+  integer :: i_LDDRK
+  double precision :: time_LDDRK
+  double precision, dimension(6):: alpha_LDDRK,beta_LDDRK,c_LDDRK
+
 !***********************************************************************
 !
 !             i n i t i a l i z a t i o n    p h a s e
@@ -916,7 +922,7 @@
                   ATTENUATION_PORO_FLUID_PART,Q0,freq0,p_sv, &
                   NSTEP,deltat,NTSTEP_BETWEEN_OUTPUT_SEISMO,NSOURCES, &
                   factor_subsample_image,USE_SNAPSHOT_NUMBER_IN_FILENAME,DRAW_WATER_CONSTANT_BLUE_IN_JPG,US_LETTER, &
-                  POWER_DISPLAY_COLOR,PERFORM_CUTHILL_MCKEE,SU_FORMAT,USER_T0, time_stepping_scheme, &
+                  POWER_DISPLAY_COLOR,PERFORM_CUTHILL_MCKEE,SU_FORMAT,USER_T0, time_stepping_scheme, &  !xiezhinan
                   ADD_PERIODIC_CONDITIONS,PERIODIC_horiz_dist,PERIODIC_DETECT_TOL)
   if(nproc_read_from_database < 1) stop 'should have nproc_read_from_database >= 1'
   if(nproc /= nproc_read_from_database) stop 'must always have nproc == nproc_read_from_database'
@@ -948,10 +954,18 @@
                       ATTENUATION_PORO_FLUID_PART,Q0,freq0,p_sv, &
                       NSTEP,deltat,NTSTEP_BETWEEN_OUTPUT_SEISMO,NSOURCES, &
                       factor_subsample_image,USE_SNAPSHOT_NUMBER_IN_FILENAME,DRAW_WATER_CONSTANT_BLUE_IN_JPG,US_LETTER, &
-                      POWER_DISPLAY_COLOR,PERFORM_CUTHILL_MCKEE,SU_FORMAT,USER_T0, time_stepping_scheme, &
+                      POWER_DISPLAY_COLOR,PERFORM_CUTHILL_MCKEE,SU_FORMAT,USER_T0, time_stepping_scheme, &  !xiezhinan
                       ADD_PERIODIC_CONDITIONS,PERIODIC_horiz_dist,PERIODIC_DETECT_TOL)
 
   !
+  !--- LDDRK parameter information
+  !
+
+  !
+  !--- LDDRK parameter information
+  !
+
+  !
   !--- source information
   !
   if(ipass == 1) then
@@ -986,7 +1000,16 @@
                       x_source,z_source,Mxx,Mzz,Mxz,f0,tshift_src,factor,angleforce,aval, &
                       t0,initialfield,ipass,deltat,USER_T0)
 
+
   !
+  !----  read Par_LDDRK 
+  !
+  if(time_stepping_scheme == 2)then  !xiezhinan
+  call read_databases_LDDRK(alpha_LDDRK,beta_LDDRK,c_LDDRK)  !xiezhinan
+  endif  !xiezhinan
+  
+
+  !
   !----  read attenuation information
   !
   call read_databases_atten(N_SLS,f0_attenuation)



More information about the CIG-COMMITS mailing list