[cig-commits] r20724 - in seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER: EXAMPLES/global_s362ani_small/DATA EXAMPLES/regional_Greece_small/DATA UTILS/adjoint_sources/amplitude UTILS/adjoint_sources/traveltime setup src/auxiliaries src/create_header_file src/cuda src/meshfem3D src/shared src/specfem3D

danielpeter at geodynamics.org danielpeter at geodynamics.org
Tue Sep 18 08:11:23 PDT 2012


Author: danielpeter
Date: 2012-09-18 08:11:23 -0700 (Tue, 18 Sep 2012)
New Revision: 20724

Modified:
   seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/EXAMPLES/global_s362ani_small/DATA/Par_file
   seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/EXAMPLES/global_s362ani_small/DATA/STATIONS
   seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/EXAMPLES/regional_Greece_small/DATA/Par_file
   seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/EXAMPLES/regional_Greece_small/DATA/STATIONS
   seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/UTILS/adjoint_sources/amplitude/create_adjsrc_amplitude.f90
   seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/UTILS/adjoint_sources/traveltime/create_adjsrc_traveltime.f90
   seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/setup/constants.h.in
   seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/auxiliaries/combine_vol_data_vtk.f90
   seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/create_header_file/create_header_file.f90
   seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/cuda/compute_forces_crust_mantle_cuda.cu
   seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/cuda/compute_forces_inner_core_cuda.cu
   seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/cuda/mesh_constants_cuda.h
   seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/cuda/prepare_mesh_constants_cuda.cu
   seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/cuda/specfem3D_gpu_cuda_method_stubs.c
   seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/meshfem3D/create_chunk_buffers.f90
   seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/meshfem3D/create_regions_mesh.f90
   seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/meshfem3D/finalize_mesher.f90
   seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/meshfem3D/get_model.f90
   seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/meshfem3D/meshfem3D_models.f90
   seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/meshfem3D/model_atten3D_QRFSI12.f90
   seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/meshfem3D/model_s362ani.f90
   seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/meshfem3D/save_arrays_solver.f90
   seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/meshfem3D/setup_color_perm.f90
   seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/meshfem3D/setup_model.f90
   seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/shared/auto_ner.f90
   seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/shared/get_model_parameters.f90
   seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/shared/get_timestep_and_layers.f90
   seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/shared/save_header_file.f90
   seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/specfem3D/check_simulation_stability.f90
   seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/specfem3D/compute_element.F90
   seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/specfem3D/compute_forces_crust_mantle.f90
   seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/specfem3D/compute_forces_inner_core.f90
   seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/specfem3D/compute_forces_inner_core_Dev.F90
   seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/specfem3D/get_attenuation.f90
   seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/specfem3D/initialize_simulation.f90
   seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/specfem3D/locate_sources.f90
   seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/specfem3D/prepare_timerun.f90
Log:
bug fix in file unit id in combine_vol_data_vtk.f90; bug fix for default attenuation model in get_model_parameters.f90; renames USE_3D_ATTENUATION to USE_3D_ATTENUATION_ARRAYS and only uses ATTENUATION_3D flag to depict 3D attenuation models in mesher setup; adds stations to regional_Greece_small example and changes default model for faster meshing; slight change in duration and attenuation flags in global_s362ani_small example; increase NMAX trace length in UTILS/adjoint_sources/ examples

Modified: seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/EXAMPLES/global_s362ani_small/DATA/Par_file
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/EXAMPLES/global_s362ani_small/DATA/Par_file	2012-09-17 23:21:52 UTC (rev 20723)
+++ seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/EXAMPLES/global_s362ani_small/DATA/Par_file	2012-09-18 15:11:23 UTC (rev 20724)
@@ -41,13 +41,13 @@
 GRAVITY                         = .true.
 ROTATION                        = .true.
 ATTENUATION                     = .true.
-ATTENUATION_NEW                 = .false.
+ATTENUATION_NEW                 = .true.
 
 # absorbing boundary conditions for a regional simulation
 ABSORBING_CONDITIONS            = .false.
 
 # record length in minutes
-RECORD_LENGTH_IN_MINUTES        = 15.0d0
+RECORD_LENGTH_IN_MINUTES        = 50.0d0
 
 # save AVS or OpenDX movies
 MOVIE_SURFACE                   = .false.

Modified: seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/EXAMPLES/global_s362ani_small/DATA/STATIONS
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/EXAMPLES/global_s362ani_small/DATA/STATIONS	2012-09-17 23:21:52 UTC (rev 20723)
+++ seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/EXAMPLES/global_s362ani_small/DATA/STATIONS	2012-09-18 15:11:23 UTC (rev 20724)
@@ -4,3 +4,4 @@
 LIT        HT       40.10080    22.49000    480.0     0.0
 ZKR        GE       35.11470    26.21700    270.0     0.0
 S001       XS       37.28300    21.71800    156.0     0.0
+126A       TA       32.6462   -104.02      1032.0     0.0
\ No newline at end of file

Modified: seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/EXAMPLES/regional_Greece_small/DATA/Par_file
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/EXAMPLES/regional_Greece_small/DATA/Par_file	2012-09-17 23:21:52 UTC (rev 20723)
+++ seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/EXAMPLES/regional_Greece_small/DATA/Par_file	2012-09-18 15:11:23 UTC (rev 20724)
@@ -33,7 +33,7 @@
 # transversely_isotropic_prem_plus_3D_crust_2.0, 3D_anisotropic, 3D_attenuation,
 # s20rts, s362ani, s362iso, s362wmani, s362ani_prem, s362ani_3DQ, s362iso_3DQ,
 # s29ea, s29ea,sea99_jp3d1994,sea99,jp3d1994,heterogen
-MODEL                           = s362ani
+MODEL                           = 1D_transversely_isotropic_prem
 
 # parameters describing the Earth model
 OCEANS                          = .true.

Modified: seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/EXAMPLES/regional_Greece_small/DATA/STATIONS
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/EXAMPLES/regional_Greece_small/DATA/STATIONS	2012-09-17 23:21:52 UTC (rev 20723)
+++ seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/EXAMPLES/regional_Greece_small/DATA/STATIONS	2012-09-18 15:11:23 UTC (rev 20724)
@@ -1,6 +1,23 @@
+AAK        II       42.6390     74.4940    1645.0    30.0
+BORG       II       64.7474    -21.3268     110.0    95.0
+LVZ        II       67.8979     34.6514     630.0   200.0
+KIV        II       43.9562     42.6888    1210.0     0.0
+MBAR       II       -0.6019     30.7382    1390.0   100.0
+OBN        II       55.1146     36.5674     160.0    30.0
+UOSS       II       24.9453     56.2042     284.4     0.0
+ANTO       IU       39.8680     32.7934     895.0   195.0
 GRFO       IU       49.6909     11.2203     384.0   116.0
+KBS        IU       78.9154     11.9385      90.0     3.0
+KEV        IU       69.7565     27.0035      85.0    15.0
+KONO       IU       59.6491      9.5982     216.0   340.0
+MAKZ       IU       46.8080     81.9770     590.0    10.0
+TBT        IU       28.6794    -17.9145     180.0    40.0
 BEKI       YL       41.31500    34.26300   1415.0     0.0
 BGIO       SR       31.72200    35.08780    752.0   100.0
 LIT        HT       40.10080    22.49000    480.0     0.0
 ZKR        GE       35.11470    26.21700    270.0     0.0
 S001       XS       37.28300    21.71800    156.0     0.0
+ATD         G       11.5300     42.8470     610.0     0.0
+ECH         G       48.2160     7.1580      580.0     0.0
+EVO         G       38.5320    -8.0130        0.0     0.0
+TAM         G       22.7910     5.5270     1377.0     0.0
\ No newline at end of file

Modified: seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/UTILS/adjoint_sources/amplitude/create_adjsrc_amplitude.f90
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/UTILS/adjoint_sources/amplitude/create_adjsrc_amplitude.f90	2012-09-17 23:21:52 UTC (rev 20723)
+++ seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/UTILS/adjoint_sources/amplitude/create_adjsrc_amplitude.f90	2012-09-18 15:11:23 UTC (rev 20724)
@@ -13,10 +13,18 @@
   integer :: i, is, ie, nstep, j, itime ,ifile,ios, i1, i2, nstep_old
   character(len=256) :: arg(100), file(100)
   character(len=256) :: filename
-  integer,parameter :: NMAX = 30000
+  
   real*8, parameter :: EPS = 1.0d-17
   real*8, parameter :: PI = 3.1415926d0
-  real*8 :: ts, te, data(5,NMAX), out(NMAX), adj(NMAX), tw(NMAX), norm
+  real*8 :: ts, te, norm
+
+  ! seismogram arrays
+  integer,parameter :: NMAX = 90000
+  real*8 :: data(5,NMAX)
+  real*8 :: out(NMAX)
+  real*8 :: adj(NMAX)
+  real*8 :: tw(NMAX)
+  
   real*8 :: dt, t0, t0_old, dt_old, costh, sinth, th, baz
   logical :: lrot
 

Modified: seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/UTILS/adjoint_sources/traveltime/create_adjsrc_traveltime.f90
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/UTILS/adjoint_sources/traveltime/create_adjsrc_traveltime.f90	2012-09-17 23:21:52 UTC (rev 20723)
+++ seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/UTILS/adjoint_sources/traveltime/create_adjsrc_traveltime.f90	2012-09-18 15:11:23 UTC (rev 20724)
@@ -12,10 +12,18 @@
   integer :: i, is, ie, nstep, j, itime ,ifile,ios, i1, i2, nstep_old
   character(len=256) :: arg(100), file(100)
   character(len=256) :: filename
-  integer,parameter :: NMAX = 30000
+
   real*8, parameter :: EPS = 1.0d-17
   real*8, parameter :: PI = 3.1415926d0
-  real*8 :: ts, te, data(5,NMAX), out(NMAX), adj(NMAX), tw(NMAX), norm
+  real*8 :: ts, te, norm
+
+  ! seismogram arrays
+  integer,parameter :: NMAX = 90000
+  real*8 :: data(5,NMAX)
+  real*8 :: out(NMAX)
+  real*8 :: adj(NMAX)
+  real*8 :: tw(NMAX)
+
   real*8 :: dt, t0, t0_old, dt_old, costh, sinth, th, baz
   logical :: lrot
 

Modified: seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/setup/constants.h.in
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/setup/constants.h.in	2012-09-17 23:21:52 UTC (rev 20723)
+++ seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/setup/constants.h.in	2012-09-18 15:11:23 UTC (rev 20724)
@@ -274,7 +274,7 @@
 ! forces attenuation arrays to be fully 3D and defined on all GLL points
 ! (useful for more accurate attenuation profiles and adjoint inversions)
 ! (if set to .false., 3D attenuation is only used for models with 3D attenuation distributions)
-  logical, parameter :: USE_3D_ATTENUATION = .true.
+  logical, parameter :: USE_3D_ATTENUATION_ARRAYS = .true.
 
 
 !!-----------------------------------------------------------

Modified: seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/auxiliaries/combine_vol_data_vtk.f90
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/auxiliaries/combine_vol_data_vtk.f90	2012-09-17 23:21:52 UTC (rev 20723)
+++ seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/auxiliaries/combine_vol_data_vtk.f90	2012-09-18 15:11:23 UTC (rev 20724)
@@ -187,7 +187,7 @@
 
 
       dimension_file = trim(prname_topo) //'solver_data.bin'
-      open(unit = 28,file = trim(dimension_file),status='old',action='read', iostat = ios, form='unformatted')
+      open(unit = 27,file = trim(dimension_file),status='old',action='read', iostat = ios, form='unformatted')
       if (ios /= 0) then
        print*,'error ',ios
        print*,'file:',trim(dimension_file)

Modified: seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/create_header_file/create_header_file.f90
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/create_header_file/create_header_file.f90	2012-09-17 23:21:52 UTC (rev 20723)
+++ seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/create_header_file/create_header_file.f90	2012-09-18 15:11:23 UTC (rev 20724)
@@ -138,7 +138,8 @@
          OUTPUT_SEISMOS_ASCII_TEXT,OUTPUT_SEISMOS_SAC_ALPHANUM,OUTPUT_SEISMOS_SAC_BINARY, &
          ROTATE_SEISMOGRAMS_RT,ratio_divide_central_cube,HONOR_1D_SPHERICAL_MOHO,CUT_SUPERBRICK_XI,CUT_SUPERBRICK_ETA,&
          DIFF_NSPEC1D_RADIAL,DIFF_NSPEC2D_XI,DIFF_NSPEC2D_ETA,&
-         WRITE_SEISMOGRAMS_BY_MASTER,SAVE_ALL_SEISMOS_IN_ONE_FILE,USE_BINARY_FOR_LARGE_FILE,.false.,NOISE_TOMOGRAPHY)
+         WRITE_SEISMOGRAMS_BY_MASTER,SAVE_ALL_SEISMOS_IN_ONE_FILE, &
+         USE_BINARY_FOR_LARGE_FILE,.false.,NOISE_TOMOGRAPHY)
 
 
 ! count the total number of sources in the CMTSOLUTION file

Modified: seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/cuda/compute_forces_crust_mantle_cuda.cu
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/cuda/compute_forces_crust_mantle_cuda.cu	2012-09-17 23:21:52 UTC (rev 20723)
+++ seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/cuda/compute_forces_crust_mantle_cuda.cu	2012-09-18 15:11:23 UTC (rev 20724)
@@ -102,7 +102,7 @@
                                               realw epsilondev_xz_loc,realw epsilondev_yz_loc,
                                               realw* d_c44store,
                                               int ANISOTROPY,
-                                              int ATTENUATION_3D) {
+                                              int USE_3D_ATTENUATION_ARRAYS) {
 
   realw fac;
   realw alphaval_loc,betaval_loc,gammaval_loc;
@@ -123,7 +123,7 @@
     //
     // either mustore(i,j,k,ispec) * factor_common(i_sls,i,j,k,ispec)
     // or       factor_common(i_sls,:,:,:,ispec) * c44store(:,:,:,ispec)
-    if( ATTENUATION_3D ){
+    if( USE_3D_ATTENUATION_ARRAYS ){
       // array dimension: factor_common(N_SLS,NGLLX,NGLLY,NGLLZ,NSPEC)
       factor_loc = fac * factor_common[i_sls + N_SLS*(tx + NGLL3*working_element)];
     }else{
@@ -717,7 +717,7 @@
                                           int ATTENUATION,
                                           int ATTENUATION_NEW,
                                           int USE_ATTENUATION_MIMIC,
-                                          int ATTENUATION_3D,
+                                          int USE_3D_ATTENUATION_ARRAYS,
                                           realw* one_minus_sum_beta,realw* factor_common,
                                           realw* R_xx, realw* R_yy, realw* R_xy, realw* R_xz, realw* R_yz,
                                           realw* alphaval,realw* betaval,realw* gammaval,
@@ -1154,7 +1154,7 @@
     // attenuation
     if(ATTENUATION){
       // use unrelaxed parameters if attenuation
-      if( ATTENUATION_3D ){
+      if( USE_3D_ATTENUATION_ARRAYS ){
         one_minus_sum_beta_use = one_minus_sum_beta[tx+working_element*NGLL3]; // (i,j,k,ispec)
       }else{
         one_minus_sum_beta_use = one_minus_sum_beta[working_element]; // (1,1,1,ispec)
@@ -1414,7 +1414,7 @@
                                     epsilondev_xz,epsilondev_yz,
                                     epsilondev_xx_loc,epsilondev_yy_loc,epsilondev_xy_loc,
                                     epsilondev_xz_loc,epsilondev_yz_loc,
-                                    d_c44store,ANISOTROPY,ATTENUATION_3D);
+                                    d_c44store,ANISOTROPY,USE_3D_ATTENUATION_ARRAYS);
     }
 
     // save deviatoric strain for Runge-Kutta scheme
@@ -1528,7 +1528,7 @@
                                                 mp->attenuation,
                                                 mp->attenuation_new,
                                                 mp->use_attenuation_mimic,
-                                                mp->attenuation_3D,
+                                                mp->use_3d_attenuation_arrays,
                                                 d_one_minus_sum_beta,d_factor_common,
                                                 d_R_xx,d_R_yy,d_R_xy,d_R_xz,d_R_yz,
                                                 mp->d_alphaval,mp->d_betaval,mp->d_gammaval,
@@ -1579,7 +1579,7 @@
                                                    mp->attenuation,
                                                    mp->attenuation_new,
                                                    mp->use_attenuation_mimic,
-                                                   mp->attenuation_3D,
+                                                   mp->use_3d_attenuation_arrays,
                                                    d_one_minus_sum_beta,d_factor_common,
                                                    d_b_R_xx,d_b_R_yy,d_b_R_xy,d_b_R_xz,d_b_R_yz,
                                                    mp->d_b_alphaval,mp->d_b_betaval,mp->d_b_gammaval,
@@ -1679,7 +1679,7 @@
       color_offset_nonpadded_att1 = (mp->nspec_outer_crust_mantle) * NGLL3 * N_SLS;
 
       // for factor_common array
-      if( mp->attenuation_3D ){
+      if( mp->use_3d_attenuation_arrays ){
         color_offset_nonpadded_att2 = (mp->nspec_outer_crust_mantle) * NGLL3;
         color_offset_nonpadded_att3 = (mp->nspec_outer_crust_mantle) * NGLL3 * N_SLS;
       }else{
@@ -1780,7 +1780,7 @@
       color_offset_nonpadded += nb_blocks_to_compute * NGLL3;
       color_offset_nonpadded_att1 += nb_blocks_to_compute * NGLL3 * N_SLS;
       // for factor_common array
-      if( mp->attenuation_3D ){
+      if( mp->use_3d_attenuation_arrays ){
         color_offset_nonpadded_att2 += nb_blocks_to_compute * NGLL3;
         color_offset_nonpadded_att3 += nb_blocks_to_compute * NGLL3 * N_SLS;
       }else{

Modified: seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/cuda/compute_forces_inner_core_cuda.cu
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/cuda/compute_forces_inner_core_cuda.cu	2012-09-17 23:21:52 UTC (rev 20723)
+++ seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/cuda/compute_forces_inner_core_cuda.cu	2012-09-18 15:11:23 UTC (rev 20724)
@@ -102,7 +102,7 @@
                                               realw* epsilondev_xz,realw* epsilondev_yz,
                                               realw epsilondev_xx_loc,realw epsilondev_yy_loc,realw epsilondev_xy_loc,
                                               realw epsilondev_xz_loc,realw epsilondev_yz_loc,
-                                              int ATTENUATION_3D
+                                              int USE_3D_ATTENUATION_ARRAYS
                                               ){
 
   int offset;
@@ -121,7 +121,7 @@
     // index for (i_sls,i,j,k,ispec)
     offset = i_sls + N_SLS*(tx + NGLL3*working_element);
 
-    if( ATTENUATION_3D ){
+    if( USE_3D_ATTENUATION_ARRAYS ){
       factor_loc = mul * factor_common[offset]; //mustore(i,j,k,ispec) * factor_common(i_sls,i,j,k,ispec)
     }else{
       factor_loc = mul * factor_common[i_sls + N_SLS*working_element]; //mustore(i,j,k,ispec) * factor_common(i_sls,1,1,1,ispec)
@@ -330,7 +330,7 @@
                                          int ATTENUATION,
                                          int ATTENUATION_NEW,
                                          int USE_ATTENUATION_MIMIC,
-                                         int ATTENUATION_3D,
+                                         int USE_3D_ATTENUATION_ARRAYS,
                                          realw* one_minus_sum_beta,realw* factor_common,
                                          realw* R_xx, realw* R_yy, realw* R_xy, realw* R_xz, realw* R_yz,
                                          realw* alphaval,realw* betaval,realw* gammaval,
@@ -762,7 +762,7 @@
     // attenuation
     if(ATTENUATION){
       // use unrelaxed parameters if attenuation
-      if( ATTENUATION_3D ){
+      if( USE_3D_ATTENUATION_ARRAYS ){
         mul_iso  = mul * one_minus_sum_beta[tx+working_element*NGLL3]; // (i,j,k,ispec)
         mul_aniso = mul *( one_minus_sum_beta[tx+working_element*NGLL3] - 1.0f );
       }else{
@@ -1052,7 +1052,7 @@
                                 R_xx,R_yy,R_xy,R_xz,R_yz,
                                 epsilondev_xx,epsilondev_yy,epsilondev_xy,epsilondev_xz,epsilondev_yz,
                                 epsilondev_xx_loc,epsilondev_yy_loc,epsilondev_xy_loc,epsilondev_xz_loc,epsilondev_yz_loc,
-                                ATTENUATION_3D);
+                                USE_3D_ATTENUATION_ARRAYS);
     }
 
     // save deviatoric strain for Runge-Kutta scheme
@@ -1161,7 +1161,7 @@
                                              mp->attenuation,
                                              mp->attenuation_new,
                                              mp->use_attenuation_mimic,
-                                             mp->attenuation_3D,
+                                             mp->use_3d_attenuation_arrays,
                                              d_one_minus_sum_beta,
                                              d_factor_common,
                                              d_R_xx,d_R_yy,d_R_xy,d_R_xz,d_R_yz,
@@ -1210,7 +1210,7 @@
                                                 mp->attenuation,
                                                 mp->attenuation_new,
                                                 mp->use_attenuation_mimic,
-                                                mp->attenuation_3D,
+                                                mp->use_3d_attenuation_arrays,
                                                 d_one_minus_sum_beta,
                                                 d_factor_common,
                                                 d_b_R_xx,d_b_R_yy,d_b_R_xy,d_b_R_xz,d_b_R_yz,
@@ -1307,7 +1307,7 @@
         color_offset_nonpadded = (mp->nspec_outer_inner_core) * NGLL3;
         color_offset_nonpadded_att1 = (mp->nspec_outer_inner_core) * NGLL3 * N_SLS;
         // for factor_common array
-        if( mp->attenuation_3D ){
+        if( mp->use_3d_attenuation_arrays ){
           color_offset_nonpadded_att2 = (mp->nspec_outer_inner_core) * NGLL3;
           color_offset_nonpadded_att3 = (mp->nspec_outer_inner_core) * NGLL3 * N_SLS;
         }else{
@@ -1348,7 +1348,7 @@
         color_offset_nonpadded = (mp->nspec_outer_inner_core) * NGLL3;
         color_offset_nonpadded_att1 = (mp->nspec_outer_inner_core) * NGLL3 * N_SLS;
         // for factor_common array
-        if( mp->attenuation_3D ){
+        if( mp->use_3d_attenuation_arrays ){
           color_offset_nonpadded_att2 = (mp->nspec_outer_inner_core) * NGLL3;
           color_offset_nonpadded_att3 = (mp->nspec_outer_inner_core) * NGLL3 * N_SLS;
         }else{
@@ -1434,7 +1434,7 @@
       color_offset_nonpadded += nb_blocks_to_compute * NGLL3;
       color_offset_nonpadded_att1 += nb_blocks_to_compute * NGLL3 * N_SLS;
       // for factor_common array
-      if( mp->attenuation_3D ){
+      if( mp->use_3d_attenuation_arrays ){
         color_offset_nonpadded_att2 += nb_blocks_to_compute * NGLL3;
         color_offset_nonpadded_att3 += nb_blocks_to_compute * NGLL3 * N_SLS;
       }else{

Modified: seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/cuda/mesh_constants_cuda.h
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/cuda/mesh_constants_cuda.h	2012-09-17 23:21:52 UTC (rev 20723)
+++ seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/cuda/mesh_constants_cuda.h	2012-09-18 15:11:23 UTC (rev 20724)
@@ -544,7 +544,7 @@
   int attenuation;
   int attenuation_new;
   int use_attenuation_mimic;
-  int attenuation_3D;
+  int use_3d_attenuation_arrays;
 
   int compute_and_store_strain;
   int anisotropic_3D_mantle;

Modified: seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/cuda/prepare_mesh_constants_cuda.cu
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/cuda/prepare_mesh_constants_cuda.cu	2012-09-17 23:21:52 UTC (rev 20723)
+++ seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/cuda/prepare_mesh_constants_cuda.cu	2012-09-18 15:11:23 UTC (rev 20724)
@@ -118,7 +118,7 @@
                                         int* ATTENUATION_f,
                                         int* ATTENUATION_NEW_f,
                                         int* USE_ATTENUATION_MIMIC_f,
-                                        int* ATTENUATION_3D_VAL_f,
+                                        int* USE_3D_ATTENUATION_ARRAYS_f,
                                         int* COMPUTE_AND_STORE_STRAIN_f,
                                         int* ANISOTROPIC_3D_MANTLE_f,
                                         int* ANISOTROPIC_INNER_CORE_f,
@@ -204,7 +204,7 @@
   mp->attenuation = *ATTENUATION_f;
   mp->attenuation_new = *ATTENUATION_NEW_f;
   mp->use_attenuation_mimic = *USE_ATTENUATION_MIMIC_f;
-  mp->attenuation_3D = *ATTENUATION_3D_VAL_f;
+  mp->use_3d_attenuation_arrays = *USE_3D_ATTENUATION_ARRAYS_f;
 
   mp->compute_and_store_strain = *COMPUTE_AND_STORE_STRAIN_f;
   mp->anisotropic_3D_mantle = *ANISOTROPIC_3D_MANTLE_f;
@@ -446,7 +446,7 @@
 
   // crust_mantle
   R_size1 = N_SLS*NGLL3*mp->NSPEC_CRUST_MANTLE;
-  if( mp->attenuation_3D ){
+  if( mp->use_3d_attenuation_arrays ){
     R_size2 = NGLL3*mp->NSPEC_CRUST_MANTLE;
     R_size3 = N_SLS*NGLL3*mp->NSPEC_CRUST_MANTLE;
   }else{
@@ -469,7 +469,7 @@
 
   // inner_core
   R_size1 = N_SLS*NGLL3*mp->NSPEC_INNER_CORE;
-  if( mp->attenuation_3D ){
+  if( mp->use_3d_attenuation_arrays ){
     R_size2 = NGLL3*mp->NSPEC_INNER_CORE;
     R_size3 = N_SLS*NGLL3*mp->NSPEC_INNER_CORE;
   }else{

Modified: seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/cuda/specfem3D_gpu_cuda_method_stubs.c
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/cuda/specfem3D_gpu_cuda_method_stubs.c	2012-09-17 23:21:52 UTC (rev 20723)
+++ seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/cuda/specfem3D_gpu_cuda_method_stubs.c	2012-09-18 15:11:23 UTC (rev 20724)
@@ -366,7 +366,7 @@
                                         int* ATTENUATION_f,
                                         int* ATTENUATION_NEW_f,
                                         int* USE_ATTENUATION_MIMIC_f,
-                                        int* ATTENUATION_3D_VAL_f,
+                                        int* USE_3D_ATTENUATION_ARRAYS_f,
                                         int* COMPUTE_AND_STORE_STRAIN_f,
                                         int* ANISOTROPIC_3D_MANTLE_f,
                                         int* ANISOTROPIC_INNER_CORE_f,

Modified: seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/meshfem3D/create_chunk_buffers.f90
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/meshfem3D/create_chunk_buffers.f90	2012-09-17 23:21:52 UTC (rev 20723)
+++ seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/meshfem3D/create_chunk_buffers.f90	2012-09-18 15:11:23 UTC (rev 20724)
@@ -480,22 +480,23 @@
 
         ! loop on sender/receiver (1=sender 2=receiver)
         do imode_comm=1,2
+          ! initializes
+          iproc = -1
+          iedge = -1
+
           ! selects mode
-          if(imode_comm == 1) then
+          select case(imode_comm)
+          case( 1 )
             iproc = iprocfrom_faces(imsg)
             iedge = iproc_edge_send
-
             write(filename_out,"('buffer_faces_chunks_sender_msg',i6.6,'.txt')") imsg
-
-          else if(imode_comm == 2) then
+          case( 2 )
             iproc = iprocto_faces(imsg)
             iedge = iproc_edge_receive
-
             write(filename_out,"('buffer_faces_chunks_receiver_msg',i6.6,'.txt')") imsg
-
-          else
+          case default
             call exit_MPI(myrank,'incorrect communication mode')
-          endif
+          end select
 
           ! only do this if current processor is the right one for MPI version
           if(iproc == myrank) then

Modified: seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/meshfem3D/create_regions_mesh.f90
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/meshfem3D/create_regions_mesh.f90	2012-09-17 23:21:52 UTC (rev 20723)
+++ seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/meshfem3D/create_regions_mesh.f90	2012-09-18 15:11:23 UTC (rev 20724)
@@ -436,15 +436,15 @@
                                 NSPEC2DMAX_XMIN_XMAX,NSPEC2DMAX_YMIN_YMAX, &
                                 NSPEC2D_BOTTOM,NSPEC2D_TOP)
 
+  use constants
+
   use meshfem3D_par,only: &
-    NGLLX,NGLLY,NGLLZ,NDIM, &
-    IREGION_CRUST_MANTLE,IREGION_OUTER_CORE,IREGION_INNER_CORE, &
     NCHUNKS,NUMCORNERS_SHARED,NUMFACES_SHARED, &
     NGLOB2DMAX_XMIN_XMAX,NGLOB2DMAX_YMIN_YMAX, &
     NGLOB1D_RADIAL,NGLOB1D_RADIAL_CORNER
 
   use meshfem3D_models_par,only: &
-    ATTENUATION,ATTENUATION_3D,ANISOTROPIC_INNER_CORE,ANISOTROPIC_3D_MANTLE, &
+    ATTENUATION,ANISOTROPIC_INNER_CORE,ANISOTROPIC_3D_MANTLE, &
     SAVE_BOUNDARY_MESH,AM_V
 
   use create_regions_mesh_par2
@@ -468,7 +468,10 @@
     tau_s(:)   = AM_V%Qtau_s(:)
     nspec_att = nspec
 
-    if (ATTENUATION_3D) then
+    ! note: to save memory, one can set USE_3D_ATTENUATION_ARRAYS to .false. which
+    !          will create attenuation arrays storing only 1 point per element
+    !          (otherwise, 3D attenuation arrays will be defined for all GLL points)
+    if( USE_3D_ATTENUATION_ARRAYS ) then
       ! attenuation arrays are fully 3D
       allocate(Qmu_store(NGLLX,NGLLY,NGLLZ,nspec_att), &
               tau_e_store(N_SLS,NGLLX,NGLLY,NGLLZ,nspec_att),stat=ier)

Modified: seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/meshfem3D/finalize_mesher.f90
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/meshfem3D/finalize_mesher.f90	2012-09-17 23:21:52 UTC (rev 20723)
+++ seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/meshfem3D/finalize_mesher.f90	2012-09-18 15:11:23 UTC (rev 20724)
@@ -158,6 +158,9 @@
     tCPU = wtime() - time_start
     write(IMAIN,*)
     write(IMAIN,*) 'Elapsed time for mesh generation and buffer creation in seconds = ',tCPU
+    write(IMAIN,"(' Elapsed time for mesh generation and buffer creation in hh:mm:ss = ',i4,' h ',i2.2,' m ',i2.2,' s')") &
+              int(tCPU/3600),int( (tCPU - int(tCPU/3600)*3600)/60 ),int(tCPU - int(tCPU/60) * 60)
+    write(IMAIN,*)
     write(IMAIN,*) 'End of mesh generation'
     write(IMAIN,*)
     ! close main output file

Modified: seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/meshfem3D/get_model.f90
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/meshfem3D/get_model.f90	2012-09-17 23:21:52 UTC (rev 20723)
+++ seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/meshfem3D/get_model.f90	2012-09-18 15:11:23 UTC (rev 20724)
@@ -311,7 +311,7 @@
         endif !CUSTOM_REAL
 
         if( ATTENUATION ) then
-          if( ATTENUATION_3D ) then
+          if( USE_3D_ATTENUATION_ARRAYS ) then
             tau_e_store(:,i,j,k,ispec) = tau_e(:)
             Qmu_store(i,j,k,ispec)     = Qmu
           else
@@ -327,11 +327,6 @@
     enddo
   enddo
 
-  !if (ATTENUATION .and. .not. ATTENUATION_3D) then
-  !   tau_e_store(:,1,1,1,ispec) = tau_e(:)
-  !   Qmu_store(1,1,1,ispec)     = Qmu
-  !endif
-
   end subroutine get_model
 
 

Modified: seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/meshfem3D/meshfem3D_models.f90
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/meshfem3D/meshfem3D_models.f90	2012-09-17 23:21:52 UTC (rev 20723)
+++ seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/meshfem3D/meshfem3D_models.f90	2012-09-18 15:11:23 UTC (rev 20724)
@@ -216,6 +216,7 @@
 
 
   end subroutine meshfem3D_crust_broadcast
+
 !
 !-------------------------------------------------------------------------------------------------
 !

Modified: seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/meshfem3D/model_atten3D_QRFSI12.f90
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/meshfem3D/model_atten3D_QRFSI12.f90	2012-09-17 23:21:52 UTC (rev 20723)
+++ seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/meshfem3D/model_atten3D_QRFSI12.f90	2012-09-18 15:11:23 UTC (rev 20724)
@@ -98,7 +98,13 @@
   call MPI_BCAST(QRFSI12_Q_refdepth, NDEPTHS_REFQ,MPI_DOUBLE_PRECISION, 0, MPI_COMM_WORLD, ier)
   call MPI_BCAST(QRFSI12_Q_refqmu,   NDEPTHS_REFQ,MPI_DOUBLE_PRECISION, 0, MPI_COMM_WORLD, ier)
 
-  if(myrank == 0) write(IMAIN,*) 'read 3D attenuation model'
+  ! user output
+  if(myrank == 0) then
+    write(IMAIN,*)
+    write(IMAIN,*) 'read 3D attenuation model'
+    write(IMAIN,*) '  model: QRFSI12'
+    write(IMAIN,*)
+  endif
 
   end subroutine
 

Modified: seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/meshfem3D/model_s362ani.f90
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/meshfem3D/model_s362ani.f90	2012-09-17 23:21:52 UTC (rev 20723)
+++ seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/meshfem3D/model_s362ani.f90	2012-09-18 15:11:23 UTC (rev 20724)
@@ -1758,7 +1758,7 @@
   subroutine ylm(XLAT,XLON,LMAX,Y,WK1,WK2,WK3)
 
   use model_s362ani_par,only : maxl
-  
+
   implicit none
 
   complex TEMP,FAC,DFAC

Modified: seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/meshfem3D/save_arrays_solver.f90
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/meshfem3D/save_arrays_solver.f90	2012-09-17 23:21:52 UTC (rev 20723)
+++ seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/meshfem3D/save_arrays_solver.f90	2012-09-18 15:11:23 UTC (rev 20724)
@@ -110,7 +110,7 @@
       enddo
     enddo
   enddo
-  write(27) tmp_array
+  write(27) tmp_array ! xstore
 
   !--- y coordinate
   tmp_array(:) = 0._CUSTOM_REAL
@@ -129,7 +129,7 @@
       enddo
     enddo
   enddo
-  write(27) tmp_array
+  write(27) tmp_array ! ystore
 
   !--- z coordinate
   tmp_array(:) = 0._CUSTOM_REAL
@@ -148,7 +148,7 @@
       enddo
     enddo
   enddo
-  write(27) tmp_array
+  write(27) tmp_array ! zstore
 
   deallocate(tmp_array)
 
@@ -332,7 +332,7 @@
   use constants
 
   use meshfem3D_models_par,only: &
-    TRANSVERSE_ISOTROPY,ATTENUATION,ATTENUATION_3D
+    TRANSVERSE_ISOTROPY,ATTENUATION
 
   use create_regions_mesh_par2,only: &
     rhostore,kappavstore,kappahstore,muvstore,muhstore,eta_anisostore, &
@@ -427,7 +427,7 @@
     ! saves Qmu_store to full custom_real array
     ! uses temporary array
     allocate(temp_store(NGLLX,NGLLY,NGLLZ,nspec))
-    if (ATTENUATION_3D) then
+    if (USE_3D_ATTENUATION_ARRAYS) then
       ! attenuation arrays are fully 3D
       if(CUSTOM_REAL == SIZE_REAL) then
         temp_store(:,:,:,:) = sngl(Qmu_store(:,:,:,:))

Modified: seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/meshfem3D/setup_color_perm.f90
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/meshfem3D/setup_color_perm.f90	2012-09-17 23:21:52 UTC (rev 20723)
+++ seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/meshfem3D/setup_color_perm.f90	2012-09-18 15:11:23 UTC (rev 20724)
@@ -596,14 +596,15 @@
                               num_phase_ispec_d,phase_ispec_inner_d, &
                               SAVE_MESH_FILES)
 
+  use constants
+
   use meshfem3D_models_par,only: &
     TRANSVERSE_ISOTROPY,HETEROGEN_3D_MANTLE,ANISOTROPIC_3D_MANTLE, &
-    ANISOTROPIC_INNER_CORE,ATTENUATION,ATTENUATION_3D,SAVE_BOUNDARY_MESH
+    ANISOTROPIC_INNER_CORE,ATTENUATION,SAVE_BOUNDARY_MESH
 
   use meshfem3D_par,only: &
     ABSORBING_CONDITIONS, &
-    CUSTOM_REAL,LOCAL_PATH,NGLLX,NGLLY,NGLLZ,N_SLS,IMAIN, &
-    IREGION_CRUST_MANTLE,IREGION_OUTER_CORE,IREGION_INNER_CORE, &
+    LOCAL_PATH, &
     NCHUNKS,NSPEC2D_TOP,NSPEC2D_BOTTOM, &
     xstore,ystore,zstore,idoubling
 
@@ -853,7 +854,7 @@
 
   ! attenuation arrays
   if (ATTENUATION) then
-    if (ATTENUATION_3D) then
+    if (USE_3D_ATTENUATION_ARRAYS) then
       allocate(temp_array_dble(NGLLX,NGLLY,NGLLZ,nspec))
       allocate(temp_array_dble_sls(N_SLS,NGLLX,NGLLY,NGLLZ,nspec))
       call permute_elements_dble(Qmu_store,temp_array_dble,perm,nspec)

Modified: seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/meshfem3D/setup_model.f90
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/meshfem3D/setup_model.f90	2012-09-17 23:21:52 UTC (rev 20723)
+++ seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/meshfem3D/setup_model.f90	2012-09-18 15:11:23 UTC (rev 20724)
@@ -136,7 +136,7 @@
   endif
   if(ATTENUATION) then
     write(IMAIN,*) '  incorporating attenuation using ',N_SLS,' standard linear solids'
-    if(ATTENUATION_3D) write(IMAIN,*)'  using 3D attenuation'
+    if(ATTENUATION_3D) write(IMAIN,*)'  using 3D attenuation model'
   else
     write(IMAIN,*) '  no attenuation'
   endif

Modified: seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/shared/auto_ner.f90
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/shared/auto_ner.f90	2012-09-17 23:21:52 UTC (rev 20723)
+++ seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/shared/auto_ner.f90	2012-09-18 15:11:23 UTC (rev 20724)
@@ -58,12 +58,15 @@
 
   integer NEX_MAX
   double precision DT, WIDTH
+
+  ! local parameters
   double precision RADIAL_LEN_RATIO_CENTRAL_CUBE
   double precision RADIUS_INNER_CORE
   double precision DOUBLING_INNER_CORE
   double precision P_VELOCITY_MAX     ! Located Near the inner Core Boundary
   double precision MAXIMUM_STABILITY_CONDITION
   double precision MIN_GLL_POINT_SPACING_5
+  double precision elem_size,min_grid_dx
 
   RADIAL_LEN_RATIO_CENTRAL_CUBE   =     0.40d0
   MAXIMUM_STABILITY_CONDITION     =     0.40d0
@@ -72,10 +75,20 @@
   P_VELOCITY_MAX                  = 11.02827d0
   MIN_GLL_POINT_SPACING_5         =   0.1730d0
 
-  DT = ( RADIAL_LEN_RATIO_CENTRAL_CUBE * ((WIDTH * DEGREES_TO_RADIANS ) * RADIUS_INNER_CORE) / &
-       ( dble(NEX_MAX) / DOUBLING_INNER_CORE ) / P_VELOCITY_MAX) * &
-       MIN_GLL_POINT_SPACING_5 * MAXIMUM_STABILITY_CONDITION
+  ! element at inner core
+  elem_size = RADIAL_LEN_RATIO_CENTRAL_CUBE * ((WIDTH * DEGREES_TO_RADIANS ) * RADIUS_INNER_CORE) / &
+                ( dble(NEX_MAX) / DOUBLING_INNER_CORE )
 
+  ! minimum grid point spacing
+  min_grid_dx = elem_size * MIN_GLL_POINT_SPACING_5
+
+  ! estimated time step
+  DT = min_grid_dx / P_VELOCITY_MAX * MAXIMUM_STABILITY_CONDITION
+
+  !DT = ( RADIAL_LEN_RATIO_CENTRAL_CUBE * ((WIDTH * DEGREES_TO_RADIANS ) * RADIUS_INNER_CORE) / &
+  !     ( dble(NEX_MAX) / DOUBLING_INNER_CORE ) / P_VELOCITY_MAX) * &
+  !     MIN_GLL_POINT_SPACING_5 * MAXIMUM_STABILITY_CONDITION
+
   end subroutine auto_time_stepping
 
 !

Modified: seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/shared/get_model_parameters.f90
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/shared/get_model_parameters.f90	2012-09-17 23:21:52 UTC (rev 20723)
+++ seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/shared/get_model_parameters.f90	2012-09-18 15:11:23 UTC (rev 20724)
@@ -166,15 +166,8 @@
   ! uses no anisotropic 3D model by default
   ANISOTROPIC_3D_MANTLE = .false.
 
-  ! attenuation
-  ! note: to save memory, one can set ATTENUATION_3D to .false. which
-  !          will create attenuation arrays storing only 1 point per element
-  !          (otherwise, 3D attenuation arrays will be defined for all GLL points)
-  if( USE_3D_ATTENUATION ) then
-    ATTENUATION_3D = .true.
-  else
-    ATTENUATION_3D = .false.
-  endif
+  ! uses 1D attenuation model by default
+  ATTENUATION_3D = .false.
 
   ! no crustal mesh stretching and 3D crust models by default
   CASE_3D = .false.
@@ -459,6 +452,10 @@
       REFERENCE_1D_MODEL == REFERENCE_MODEL_SEA1D) .and. TRANSVERSE_ISOTROPY) &
         stop 'models IASP91, AK135, 1066A, JP1D and SEA1D are currently isotropic'
 
+  ! checks that 3D attenuation models use 3D arrays
+  if( ATTENUATION_3D .and. ( .not. USE_3D_ATTENUATION_ARRAYS )) then
+    stop '3D attenuation models need 3D attenuation arrays'
+  endif
 
   end subroutine get_model_parameters_flags
 

Modified: seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/shared/get_timestep_and_layers.f90
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/shared/get_timestep_and_layers.f90	2012-09-17 23:21:52 UTC (rev 20723)
+++ seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/shared/get_timestep_and_layers.f90	2012-09-18 15:11:23 UTC (rev 20724)
@@ -328,17 +328,17 @@
      ANGULAR_WIDTH_ETA_IN_DEGREES < 90.0d0 .or. &
      NEX_MAX > 1248) then
 
-   call auto_ner(ANGULAR_WIDTH_XI_IN_DEGREES, NEX_MAX, &
+    call auto_ner(ANGULAR_WIDTH_XI_IN_DEGREES, NEX_MAX, &
                 NER_CRUST, NER_80_MOHO, NER_220_80, NER_400_220, NER_600_400, &
                 NER_670_600, NER_771_670, NER_TOPDDOUBLEPRIME_771, &
                 NER_CMB_TOPDDOUBLEPRIME, NER_OUTER_CORE, NER_TOP_CENTRAL_CUBE_ICB, &
                 R_CENTRAL_CUBE, CASE_3D, CRUSTAL, &
                 HONOR_1D_SPHERICAL_MOHO, REFERENCE_1D_MODEL)
 
-   call auto_attenuation_periods(ANGULAR_WIDTH_XI_IN_DEGREES, NEX_MAX, &
+    call auto_attenuation_periods(ANGULAR_WIDTH_XI_IN_DEGREES, NEX_MAX, &
                         MIN_ATTENUATION_PERIOD, MAX_ATTENUATION_PERIOD)
 
-   call auto_time_stepping(ANGULAR_WIDTH_XI_IN_DEGREES, NEX_MAX, DT)
+    call auto_time_stepping(ANGULAR_WIDTH_XI_IN_DEGREES, NEX_MAX, DT)
 
     !! DK DK suppressed because this routine should not write anything to the screen
     !    write(*,*)'##############################################################'

Modified: seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/shared/save_header_file.f90
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/shared/save_header_file.f90	2012-09-17 23:21:52 UTC (rev 20723)
+++ seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/shared/save_header_file.f90	2012-09-18 15:11:23 UTC (rev 20724)
@@ -409,7 +409,7 @@
   write(IOUT,*)
 
   if(ATTENUATION) then
-     if(ATTENUATION_3D) then
+     if(USE_3D_ATTENUATION_ARRAYS) then
         att1 = NGLLX
         att2 = NGLLY
         att3 = NGLLZ

Modified: seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/specfem3D/check_simulation_stability.f90
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/specfem3D/check_simulation_stability.f90	2012-09-17 23:21:52 UTC (rev 20723)
+++ seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/specfem3D/check_simulation_stability.f90	2012-09-18 15:11:23 UTC (rev 20724)
@@ -67,8 +67,6 @@
   real(kind=CUSTOM_REAL) Usolidnorm,Usolidnorm_all,Ufluidnorm,Ufluidnorm_all
   real(kind=CUSTOM_REAL) Strain_norm,Strain_norm_all,Strain2_norm,Strain2_norm_all
   real(kind=CUSTOM_REAL) b_Usolidnorm,b_Usolidnorm_all,b_Ufluidnorm,b_Ufluidnorm_all
-  ! names of the data files for all the processors in MPI
-  character(len=150) outputname
   ! timer MPI
   double precision :: tCPU,t_remain,t_total
   integer :: ihours,iminutes,iseconds,int_tCPU, &
@@ -299,89 +297,150 @@
     call flush_IMAIN()
 
     ! write time stamp file to give information about progression of simulation
-    write(outputname,"('/timestamp',i6.6)") it
+    call write_timestamp_file(it,NSTEP,DT,t0,SIMULATION_TYPE, &
+                              Usolidnorm_all,Ufluidnorm_all,b_Usolidnorm_all,b_Ufluidnorm_all, &
+                              tCPU,ihours,iminutes,iseconds, &
+                              t_remain,ihours_remain,iminutes_remain,iseconds_remain, &
+                              t_total,ihours_total,iminutes_total,iseconds_total, &
+                              day_of_week,mon,day,year,hr,minutes, &
+                              day_of_week_remote,mon_remote,day_remote,year_remote,hr_remote,minutes_remote, &
+                              OUTPUT_FILES)
 
-    open(unit=IOUT,file=trim(OUTPUT_FILES)//outputname,status='unknown',action='write')
+    ! check stability of the code, exit if unstable
+    ! negative values can occur with some compilers when the unstable value is greater
+    ! than the greatest possible floating-point number of the machine
+    if(Usolidnorm_all > STABILITY_THRESHOLD .or. Usolidnorm_all < 0) &
+      call exit_MPI(myrank,'forward simulation became unstable and blew up in the solid')
+    if(Ufluidnorm_all > STABILITY_THRESHOLD .or. Ufluidnorm_all < 0) &
+      call exit_MPI(myrank,'forward simulation became unstable and blew up in the fluid')
 
-    write(IOUT,*) 'Time step # ',it
-    write(IOUT,*) 'Time: ',sngl(((it-1)*DT-t0)/60.d0),' minutes'
-    write(IOUT,*)
-    write(IOUT,*) 'Max norm displacement vector U in solid in all slices (m) = ',Usolidnorm_all
-    write(IOUT,*) 'Max non-dimensional potential Ufluid in fluid in all slices = ',Ufluidnorm_all
-    write(IOUT,*)
-
-    if (SIMULATION_TYPE == 3) then
-      write(IOUT,*) 'Max norm displacement vector U in solid in all slices for back prop.(m) = ',b_Usolidnorm_all
-      write(IOUT,*) 'Max non-dimensional potential Ufluid in fluid in all slices for back prop.= ',b_Ufluidnorm_all
-      write(IOUT,*)
+    if(SIMULATION_TYPE == 3) then
+      if(b_Usolidnorm_all > STABILITY_THRESHOLD .or. b_Usolidnorm_all < 0) &
+        call exit_MPI(myrank,'backward simulation became unstable and blew up in the solid')
+      if(b_Ufluidnorm_all > STABILITY_THRESHOLD .or. b_Ufluidnorm_all < 0) &
+        call exit_MPI(myrank,'backward simulation became unstable and blew up in the fluid')
     endif
 
-    write(IOUT,*) 'Elapsed time in seconds = ',tCPU
-    write(IOUT,"(' Elapsed time in hh:mm:ss = ',i4,' h ',i2.2,' m ',i2.2,' s')") ihours,iminutes,iseconds
-    write(IOUT,*) 'Mean elapsed time per time step in seconds = ',tCPU/dble(it)
-    write(IOUT,*)
+  endif
 
-    write(IOUT,*) 'Time steps done = ',it,' out of ',NSTEP
-    write(IOUT,*) 'Time steps remaining = ',NSTEP - it
-    write(IOUT,*) 'Estimated remaining time in seconds = ',t_remain
-    write(IOUT,"(' Estimated remaining time in hh:mm:ss = ',i4,' h ',i2.2,' m ',i2.2,' s')") &
-             ihours_remain,iminutes_remain,iseconds_remain
-    write(IOUT,*)
+  end subroutine check_simulation_stability
 
-    write(IOUT,*) 'Estimated total run time in seconds = ',t_total
-    write(IOUT,"(' Estimated total run time in hh:mm:ss = ',i4,' h ',i2.2,' m ',i2.2,' s')") &
+!
+!------------------------------------------------------------------------------------------------------------------
+!
+
+  subroutine write_timestamp_file(it,NSTEP,DT,t0,SIMULATION_TYPE, &
+                              Usolidnorm_all,Ufluidnorm_all,b_Usolidnorm_all,b_Ufluidnorm_all, &
+                              tCPU,ihours,iminutes,iseconds, &
+                              t_remain,ihours_remain,iminutes_remain,iseconds_remain, &
+                              t_total,ihours_total,iminutes_total,iseconds_total, &
+                              day_of_week,mon,day,year,hr,minutes, &
+                              day_of_week_remote,mon_remote,day_remote,year_remote,hr_remote,minutes_remote, &
+                              OUTPUT_FILES)
+
+  use constants_solver
+
+  implicit none
+
+  ! time step
+  integer :: it,NSTEP
+  integer :: SIMULATION_TYPE
+
+  double precision :: DT,t0
+
+  ! maximum of the norm of the displacement and of the potential in the fluid
+  real(kind=CUSTOM_REAL) Usolidnorm_all,Ufluidnorm_all
+  real(kind=CUSTOM_REAL) b_Usolidnorm_all,b_Ufluidnorm_all
+
+  ! timer MPI
+  double precision :: tCPU,t_remain,t_total
+  integer :: ihours,iminutes,iseconds, &
+             ihours_remain,iminutes_remain,iseconds_remain, &
              ihours_total,iminutes_total,iseconds_total
-    write(IOUT,*) 'We have done ',sngl(100.d0*dble(it)/dble(NSTEP)),'% of that'
-    write(IOUT,*)
 
-    if(it < NSTEP) then
+  integer :: year,mon,day,hr,minutes,day_of_week, &
+             year_remote,mon_remote,day_remote,hr_remote,minutes_remote,day_of_week_remote
 
-      write(IOUT,"(' The run will finish approximately on (in local time): ',a3,' ',a3,' ',i2.2,', ',i4.4,' ',i2.2,':',i2.2)") &
-          weekday_name(day_of_week),month_name(mon),day,year,hr,minutes
+  character(len=150) :: OUTPUT_FILES
 
-      ! print date and time estimate of end of run in another country.
-      ! For instance: the code runs at Caltech in California but the person
-      ! running the code is connected remotely from France, which has 9 hours more
-      if(ADD_TIME_ESTIMATE_ELSEWHERE .and. HOURS_TIME_DIFFERENCE * 60 + MINUTES_TIME_DIFFERENCE /= 0) then
-        if(HOURS_TIME_DIFFERENCE * 60 + MINUTES_TIME_DIFFERENCE > 0) then
-          write(IOUT,*) 'Adding positive time difference of ',abs(HOURS_TIME_DIFFERENCE),' hours'
-        else
-          write(IOUT,*) 'Adding negative time difference of ',abs(HOURS_TIME_DIFFERENCE),' hours'
-        endif
-        write(IOUT,*) 'and ',abs(MINUTES_TIME_DIFFERENCE),' minutes to get estimate at a remote location'
-        write(IOUT, &
-            "(' The run will finish approximately on (in remote time): ',a3,' ',a3,' ',i2.2,', ',i4.4,' ',i2.2,':',i2.2)") &
-            weekday_name(day_of_week_remote),month_name(mon_remote), &
-            day_remote,year_remote,hr_remote,minutes_remote
-      endif
+  ! local parameters
+  ! names of the data files for all the processors in MPI
+  character(len=150) :: outputname
 
-      if(it < 100) then
-        write(IOUT,*)
-        write(IOUT,*) '************************************************************'
-        write(IOUT,*) '**** BEWARE: the above time estimates are not reliable'
-        write(IOUT,*) '**** because fewer than 100 iterations have been performed'
-        write(IOUT,*) '************************************************************'
-      endif
+  ! to determine date and time at which the run will finish
+  character(len=3), dimension(12) :: month_name
+  character(len=3), dimension(0:6) :: weekday_name
+  data month_name /'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'/
+  data weekday_name /'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'/
 
-    endif
 
-    close(IOUT)
+  ! write time stamp file to give information about progression of simulation
+  write(outputname,"('/timestamp',i6.6)") it
 
-    ! check stability of the code, exit if unstable
-    ! negative values can occur with some compilers when the unstable value is greater
-    ! than the greatest possible floating-point number of the machine
-    if(Usolidnorm_all > STABILITY_THRESHOLD .or. Usolidnorm_all < 0) &
-      call exit_MPI(myrank,'forward simulation became unstable and blew up in the solid')
-    if(Ufluidnorm_all > STABILITY_THRESHOLD .or. Ufluidnorm_all < 0) &
-      call exit_MPI(myrank,'forward simulation became unstable and blew up in the fluid')
+  open(unit=IOUT,file=trim(OUTPUT_FILES)//outputname,status='unknown',action='write')
 
-    if(SIMULATION_TYPE == 3) then
-      if(b_Usolidnorm_all > STABILITY_THRESHOLD .or. b_Usolidnorm_all < 0) &
-        call exit_MPI(myrank,'backward simulation became unstable and blew up in the solid')
-      if(b_Ufluidnorm_all > STABILITY_THRESHOLD .or. b_Ufluidnorm_all < 0) &
-        call exit_MPI(myrank,'backward simulation became unstable and blew up in the fluid')
+  write(IOUT,*) 'Time step # ',it
+  write(IOUT,*) 'Time: ',sngl(((it-1)*DT-t0)/60.d0),' minutes'
+  write(IOUT,*)
+  write(IOUT,*) 'Max norm displacement vector U in solid in all slices (m) = ',Usolidnorm_all
+  write(IOUT,*) 'Max non-dimensional potential Ufluid in fluid in all slices = ',Ufluidnorm_all
+  write(IOUT,*)
+
+  if (SIMULATION_TYPE == 3) then
+    write(IOUT,*) 'Max norm displacement vector U in solid in all slices for back prop.(m) = ',b_Usolidnorm_all
+    write(IOUT,*) 'Max non-dimensional potential Ufluid in fluid in all slices for back prop.= ',b_Ufluidnorm_all
+    write(IOUT,*)
+  endif
+
+  write(IOUT,*) 'Elapsed time in seconds = ',tCPU
+  write(IOUT,"(' Elapsed time in hh:mm:ss = ',i4,' h ',i2.2,' m ',i2.2,' s')") ihours,iminutes,iseconds
+  write(IOUT,*) 'Mean elapsed time per time step in seconds = ',tCPU/dble(it)
+  write(IOUT,*)
+
+  write(IOUT,*) 'Time steps done = ',it,' out of ',NSTEP
+  write(IOUT,*) 'Time steps remaining = ',NSTEP - it
+  write(IOUT,*) 'Estimated remaining time in seconds = ',t_remain
+  write(IOUT,"(' Estimated remaining time in hh:mm:ss = ',i4,' h ',i2.2,' m ',i2.2,' s')") &
+           ihours_remain,iminutes_remain,iseconds_remain
+  write(IOUT,*)
+
+  write(IOUT,*) 'Estimated total run time in seconds = ',t_total
+  write(IOUT,"(' Estimated total run time in hh:mm:ss = ',i4,' h ',i2.2,' m ',i2.2,' s')") &
+           ihours_total,iminutes_total,iseconds_total
+  write(IOUT,*) 'We have done ',sngl(100.d0*dble(it)/dble(NSTEP)),'% of that'
+  write(IOUT,*)
+
+  if(it < NSTEP) then
+
+    write(IOUT,"(' The run will finish approximately on (in local time): ',a3,' ',a3,' ',i2.2,', ',i4.4,' ',i2.2,':',i2.2)") &
+        weekday_name(day_of_week),month_name(mon),day,year,hr,minutes
+
+    ! print date and time estimate of end of run in another country.
+    ! For instance: the code runs at Caltech in California but the person
+    ! running the code is connected remotely from France, which has 9 hours more
+    if(ADD_TIME_ESTIMATE_ELSEWHERE .and. HOURS_TIME_DIFFERENCE * 60 + MINUTES_TIME_DIFFERENCE /= 0) then
+      if(HOURS_TIME_DIFFERENCE * 60 + MINUTES_TIME_DIFFERENCE > 0) then
+        write(IOUT,*) 'Adding positive time difference of ',abs(HOURS_TIME_DIFFERENCE),' hours'
+      else
+        write(IOUT,*) 'Adding negative time difference of ',abs(HOURS_TIME_DIFFERENCE),' hours'
+      endif
+      write(IOUT,*) 'and ',abs(MINUTES_TIME_DIFFERENCE),' minutes to get estimate at a remote location'
+      write(IOUT, &
+          "(' The run will finish approximately on (in remote time): ',a3,' ',a3,' ',i2.2,', ',i4.4,' ',i2.2,':',i2.2)") &
+          weekday_name(day_of_week_remote),month_name(mon_remote), &
+          day_remote,year_remote,hr_remote,minutes_remote
     endif
 
+    if(it < 100) then
+      write(IOUT,*)
+      write(IOUT,*) '************************************************************'
+      write(IOUT,*) '**** BEWARE: the above time estimates are not reliable'
+      write(IOUT,*) '**** because fewer than 100 iterations have been performed'
+      write(IOUT,*) '************************************************************'
+    endif
+
   endif
 
-  end subroutine check_simulation_stability
+  close(IOUT)
+
+  end subroutine write_timestamp_file

Modified: seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/specfem3D/compute_element.F90
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/specfem3D/compute_element.F90	2012-09-17 23:21:52 UTC (rev 20723)
+++ seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/specfem3D/compute_element.F90	2012-09-18 15:11:23 UTC (rev 20724)
@@ -234,7 +234,7 @@
 
        ! precompute terms for attenuation if needed
         if( ATTENUATION_VAL ) then
-          if( ATTENUATION_3D_VAL ) then
+          if( USE_3D_ATTENUATION_ARRAYS ) then
             one_minus_sum_beta_use = one_minus_sum_beta(i,j,k,ispec)
           else
             one_minus_sum_beta_use = one_minus_sum_beta(1,1,1,ispec)
@@ -635,7 +635,7 @@
 
         ! precompute terms for attenuation if needed
         if( ATTENUATION_VAL ) then
-          if( ATTENUATION_3D_VAL ) then
+          if( USE_3D_ATTENUATION_ARRAYS ) then
             one_minus_sum_beta_use = one_minus_sum_beta(i,j,k,ispec)
           else
             one_minus_sum_beta_use = one_minus_sum_beta(1,1,1,ispec)
@@ -1216,7 +1216,7 @@
 
         ! precompute terms for attenuation if needed
         if( ATTENUATION_VAL ) then
-          if( ATTENUATION_3D_VAL ) then
+          if( USE_3D_ATTENUATION_ARRAYS ) then
             one_minus_sum_beta_use = one_minus_sum_beta(i,j,k,ispec)
             minus_sum_beta =  one_minus_sum_beta_use - 1.0_CUSTOM_REAL
           else
@@ -1615,7 +1615,7 @@
     gammal = gammaval(i_SLS)
 
     ! reformatted R_memory to handle large factor_common and reduced [alpha,beta,gamma]val
-    if( ATTENUATION_3D_VAL ) then
+    if( USE_3D_ATTENUATION_ARRAYS ) then
       if(ANISOTROPIC_3D_MANTLE_VAL) then
         factor_common_c44_muv(:,:,:) = factor_common(i_SLS,:,:,:,ispec) * c44store(:,:,:,ispec)
       else
@@ -1660,7 +1660,7 @@
 ! way 1:
   do i_SLS = 1,N_SLS
     ! reformatted R_memory to handle large factor_common and reduced [alpha,beta,gamma]val
-    if( ATTENUATION_3D_VAL ) then
+    if( USE_3D_ATTENUATION_ARRAYS ) then
       if(ANISOTROPIC_3D_MANTLE_VAL) then
         factor_common_c44_muv(:,:,:) = factor_common(i_SLS,:,:,:,ispec) * c44store(:,:,:,ispec)
       else
@@ -1782,7 +1782,7 @@
     gammal = gammaval(i_SLS)
 
     ! reformatted R_memory to handle large factor_common and reduced [alpha,beta,gamma]val
-    if( ATTENUATION_3D_VAL ) then
+    if( USE_3D_ATTENUATION_ARRAYS ) then
       factor_common_use(:,:,:) = factor_common(i_SLS,:,:,:,ispec) * muvstore(:,:,:,ispec)
     else
       factor_common_use(:,:,:) = factor_common(i_SLS,1,1,1,ispec) * muvstore(:,:,:,ispec)
@@ -1817,7 +1817,7 @@
   do i_SLS = 1,N_SLS
 
     ! reformatted R_memory to handle large factor_common and reduced [alpha,beta,gamma]val
-    if( ATTENUATION_3D_VAL ) then
+    if( USE_3D_ATTENUATION_ARRAYS ) then
       factor_common_use(:,:,:) = factor_common(i_SLS,:,:,:,ispec) * muvstore(:,:,:,ispec)
     else
       factor_common_use(:,:,:) = factor_common(i_SLS,1,1,1,ispec) * muvstore(:,:,:,ispec)

Modified: seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/specfem3D/compute_forces_crust_mantle.f90
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/specfem3D/compute_forces_crust_mantle.f90	2012-09-17 23:21:52 UTC (rev 20723)
+++ seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/specfem3D/compute_forces_crust_mantle.f90	2012-09-18 15:11:23 UTC (rev 20724)
@@ -360,13 +360,13 @@
 
           ! precompute terms for attenuation if needed
           if( ATTENUATION_VAL ) then
-            if( ATTENUATION_3D_VAL ) then
+            if( USE_3D_ATTENUATION_ARRAYS ) then
               one_minus_sum_beta_use = one_minus_sum_beta(i,j,k,ispec)
             else
               one_minus_sum_beta_use = one_minus_sum_beta(1,1,1,ispec)
             endif
+            minus_sum_beta =  one_minus_sum_beta_use - 1.0_CUSTOM_REAL
           endif
-          minus_sum_beta =  one_minus_sum_beta_use - 1.0_CUSTOM_REAL
 
           !
           ! compute either isotropic or anisotropic elements
@@ -897,7 +897,7 @@
 ! IMPROVE we should probably use an average value instead
 
         ! reformatted R_memory to handle large factor_common and reduced [alpha,beta,gamma]val
-        if(ATTENUATION_3D_VAL) then
+        if(USE_3D_ATTENUATION_ARRAYS) then
           if(ANISOTROPIC_3D_MANTLE_VAL) then
             factor_common_c44_muv(:,:,:) = factor_common(i_SLS,:,:,:,ispec) * c44store(:,:,:,ispec)
           else

Modified: seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/specfem3D/compute_forces_inner_core.f90
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/specfem3D/compute_forces_inner_core.f90	2012-09-17 23:21:52 UTC (rev 20723)
+++ seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/specfem3D/compute_forces_inner_core.f90	2012-09-18 15:11:23 UTC (rev 20724)
@@ -344,7 +344,7 @@
 
           ! precompute terms for attenuation if needed
           if( ATTENUATION_VAL ) then
-            if( ATTENUATION_3D_VAL ) then
+            if( USE_3D_ATTENUATION_ARRAYS ) then
               minus_sum_beta =  one_minus_sum_beta(i,j,k,ispec) - 1.0_CUSTOM_REAL
             else
               minus_sum_beta =  one_minus_sum_beta(1,1,1,ispec) - 1.0_CUSTOM_REAL
@@ -401,7 +401,7 @@
 
             ! use unrelaxed parameters if attenuation
             if( ATTENUATION_VAL ) then
-              if( ATTENUATION_3D_VAL ) then
+              if( USE_3D_ATTENUATION_ARRAYS ) then
                 mul = mul * one_minus_sum_beta(i,j,k,ispec)
               else
                 mul = mul * one_minus_sum_beta(1,1,1,ispec)
@@ -654,7 +654,7 @@
       do i_SLS = 1,N_SLS
 
         ! reformatted R_memory to handle large factor_common and reduced [alpha,beta,gamma]val
-        if (ATTENUATION_3D_VAL) then
+        if (USE_3D_ATTENUATION_ARRAYS) then
           factor_common_use(:,:,:) = factor_common(i_SLS,:,:,:,ispec) * muvstore(:,:,:,ispec)
         else
           factor_common_use(:,:,:) = factor_common(i_SLS,1,1,1,ispec) * muvstore(:,:,:,ispec)

Modified: seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/specfem3D/compute_forces_inner_core_Dev.F90
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/specfem3D/compute_forces_inner_core_Dev.F90	2012-09-17 23:21:52 UTC (rev 20723)
+++ seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/specfem3D/compute_forces_inner_core_Dev.F90	2012-09-18 15:11:23 UTC (rev 20724)
@@ -614,7 +614,7 @@
             endif
 
             if( ATTENUATION_VAL ) then
-              if( ATTENUATION_3D_VAL ) then
+              if( USE_3D_ATTENUATION_ARRAYS ) then
                 minus_sum_beta =  one_minus_sum_beta(i,j,k,ispec) - 1.0_CUSTOM_REAL
               else
                 minus_sum_beta =  one_minus_sum_beta(1,1,1,ispec) - 1.0_CUSTOM_REAL
@@ -669,7 +669,7 @@
 
               ! use unrelaxed parameters if attenuation
               if( ATTENUATION_VAL ) then
-                if( ATTENUATION_3D_VAL ) then
+                if( USE_3D_ATTENUATION_ARRAYS ) then
                   mul = mul * one_minus_sum_beta(i,j,k,ispec)
                 else
                   mul = mul * one_minus_sum_beta(1,1,1,ispec)

Modified: seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/specfem3D/get_attenuation.f90
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/specfem3D/get_attenuation.f90	2012-09-17 23:21:52 UTC (rev 20723)
+++ seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/specfem3D/get_attenuation.f90	2012-09-18 15:11:23 UTC (rev 20724)
@@ -32,7 +32,7 @@
                                            scale_factor, tau_s, &
                                            vx, vy, vz, vnspec)
 
-  use specfem_par,only: ATTENUATION_VAL, ATTENUATION_3D_VAL
+  use specfem_par,only: ATTENUATION_VAL
 
   implicit none
 
@@ -74,7 +74,7 @@
   T_c_source               = 1000.0d0 / T_c_source
   T_c_source               = T_c_source / scale_t
 
-  if( ATTENUATION_3D_VAL ) then
+  if( USE_3D_ATTENUATION_ARRAYS ) then
     do ispec = 1, vnspec
       do k = 1, NGLLZ
         do j = 1, NGLLY

Modified: seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/specfem3D/initialize_simulation.f90
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/specfem3D/initialize_simulation.f90	2012-09-17 23:21:52 UTC (rev 20723)
+++ seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/specfem3D/initialize_simulation.f90	2012-09-18 15:11:23 UTC (rev 20724)
@@ -227,7 +227,7 @@
     endif
     if(ATTENUATION) then
       write(IMAIN,*) '  incorporating attenuation using ',N_SLS,' standard linear solids'
-      if(ATTENUATION_3D) write(IMAIN,*)'  using 3D attenuation'
+      if(ATTENUATION_3D) write(IMAIN,*)'  using 3D attenuation model'
     else
       write(IMAIN,*) '  no attenuation'
     endif

Modified: seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/specfem3D/locate_sources.f90
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/specfem3D/locate_sources.f90	2012-09-17 23:21:52 UTC (rev 20723)
+++ seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/specfem3D/locate_sources.f90	2012-09-18 15:11:23 UTC (rev 20724)
@@ -921,7 +921,8 @@
   !          (see setup_sources_receivers.f90)
   t0 = - 1.5d0*minval( tshift_cmt(:) - hdur(:) )
   if( USE_FORCE_POINT_SOURCE ) t0 = - 1.2d0 * minval(tshift_cmt(:) - 1.0d0/hdur(:))
-  t_cmt_used(:) = t_cmt_used(:)
+
+  t_cmt_used(:) = tshift_cmt(:)
   if( USER_T0 > 0.d0 ) then
     if( t0 <= USER_T0 + min_tshift_cmt_original ) then
       t_cmt_used(:) = tshift_cmt(:) + min_tshift_cmt_original

Modified: seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/specfem3D/prepare_timerun.f90
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/specfem3D/prepare_timerun.f90	2012-09-17 23:21:52 UTC (rev 20723)
+++ seismo/3D/SPECFEM3D_GLOBE/branches/SPECFEM3D_GLOBE_SUNFLOWER/src/specfem3D/prepare_timerun.f90	2012-09-18 15:11:23 UTC (rev 20724)
@@ -101,6 +101,22 @@
     write(IMAIN,*) 'total simulated time: ',sngl(((NSTEP-1)*DT-t0)/60.d0),' minutes'
     write(IMAIN,*) 'start time          :',sngl(-t0),' seconds'
     write(IMAIN,*)
+
+    ! daniel: total time estimation
+    !  average time per element per time step:
+    !     isotropic models              ~ dt = 3.1857107305545455e-05
+    !     transverse isotropic models   ~ dt = 3.7492335549202518e-05
+    !
+    !     regional transverse isotropic models ~ dt = 7.6099242919530619e-05 (intel xeon @ 2.27GHz)
+    !
+    !  total time per time step:
+    !     T_total = dt * total_number_of_elements
+    !
+    !     (total_number_of_elements are listed in values_from_mesher.h)
+    !
+    !  total time using nproc processes (slices) for NSTEP time steps:
+    !     T_simulation = T_total * NSTEP / nproc
+
   endif
 
   end subroutine prepare_timerun
@@ -159,9 +175,7 @@
     write(IMAIN,*)
     if(ATTENUATION_VAL) then
       write(IMAIN,*) 'incorporating attenuation using ',N_SLS,' standard linear solids'
-
-      if(ATTENUATION_3D_VAL) write(IMAIN,*) 'using 3D attenuation'
-
+      if(ATTENUATION_3D_VAL) write(IMAIN,*) 'using 3D attenuation model'
       if(USE_ATTENUATION_MIMIC ) write(IMAIN,*) 'mimicking effects on velocity only'
     else
       write(IMAIN,*) 'no attenuation'
@@ -785,7 +799,7 @@
     do k=1,NGLLZ
       do j=1,NGLLY
         do i=1,NGLLX
-          if( ATTENUATION_3D_VAL ) then
+          if( USE_3D_ATTENUATION_ARRAYS ) then
             scale_factor = factor_scale_crust_mantle(i,j,k,ispec)
           else
             scale_factor = factor_scale_crust_mantle(1,1,1,ispec)
@@ -836,7 +850,7 @@
     do k=1,NGLLZ
       do j=1,NGLLY
         do i=1,NGLLX
-          if( ATTENUATION_3D_VAL ) then
+          if( USE_3D_ATTENUATION_ARRAYS ) then
             scale_factor = factor_scale_inner_core(i,j,k,ispec)
           else
             scale_factor = factor_scale_inner_core(1,1,1,ispec)
@@ -1456,7 +1470,7 @@
                                   GRAVITY_VAL, &
                                   ROTATION_VAL, &
                                   ATTENUATION_VAL,ATTENUATION_NEW_VAL, &
-                                  USE_ATTENUATION_MIMIC,ATTENUATION_3D_VAL, &
+                                  USE_ATTENUATION_MIMIC,USE_3D_ATTENUATION_ARRAYS, &
                                   COMPUTE_AND_STORE_STRAIN, &
                                   ANISOTROPIC_3D_MANTLE_VAL,ANISOTROPIC_INNER_CORE_VAL, &
                                   SAVE_BOUNDARY_MESH, &



More information about the CIG-COMMITS mailing list