[cig-commits] r22999 - in seismo/3D/SPECFEM3D_GLOBE/trunk: DATA EXAMPLES/benchmarks/attenuation_benchmark_GJI_2002_versus_normal_modes EXAMPLES/global_PREM_kernels/amplitude/DATA EXAMPLES/global_PREM_kernels/traveltime/DATA EXAMPLES/global_s362ani/DATA EXAMPLES/global_s362ani_shakemovie/DATA EXAMPLES/global_s362ani_small/DATA EXAMPLES/noise_examples/global_long EXAMPLES/noise_examples/global_short EXAMPLES/noise_examples/regional EXAMPLES/noise_examples/test_global EXAMPLES/noise_examples/test_regional EXAMPLES/regional_Greece_noise_small/DATA EXAMPLES/regional_Greece_small/DATA EXAMPLES/regional_MiddleEast/DATA EXAMPLES/small_benchmark_run_to_test_more_complex_Earth EXAMPLES/small_benchmark_run_to_test_very_simple_Earth src/shared src/specfem3D

lefebvre at geodynamics.org lefebvre at geodynamics.org
Tue Mar 4 09:22:01 PST 2014


Author: lefebvre
Date: 2014-03-04 09:22:01 -0800 (Tue, 04 Mar 2014)
New Revision: 22999

Added:
   seismo/3D/SPECFEM3D_GLOBE/trunk/src/shared/asdf_helpers.f90
   seismo/3D/SPECFEM3D_GLOBE/trunk/src/shared/asdf_helpers_definitions.f90
   seismo/3D/SPECFEM3D_GLOBE/trunk/src/shared/asdf_helpers_writers.f90
   seismo/3D/SPECFEM3D_GLOBE/trunk/src/specfem3D/asdf_data.f90
   seismo/3D/SPECFEM3D_GLOBE/trunk/src/specfem3D/write_output_ASDF.F90
Modified:
   seismo/3D/SPECFEM3D_GLOBE/trunk/DATA/Par_file
   seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/benchmarks/attenuation_benchmark_GJI_2002_versus_normal_modes/Par_file
   seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/global_PREM_kernels/amplitude/DATA/Par_file
   seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/global_PREM_kernels/traveltime/DATA/Par_file
   seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/global_s362ani/DATA/Par_file
   seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/global_s362ani_shakemovie/DATA/Par_file
   seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/global_s362ani_small/DATA/Par_file
   seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/global_long/Par_file_NOISE_1_attenuation
   seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/global_long/Par_file_NOISE_1_noattenuation
   seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/global_long/Par_file_NOISE_2_attenuation
   seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/global_long/Par_file_NOISE_2_noattenuation
   seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/global_long/Par_file_NOISE_3_noattenuation
   seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/global_short/Par_file_NOISE_1_attenuation
   seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/global_short/Par_file_NOISE_1_noattenuation
   seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/global_short/Par_file_NOISE_2_attenuation
   seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/global_short/Par_file_NOISE_2_noattenuation
   seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/global_short/Par_file_NOISE_3_noattenuation
   seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/regional/Par_file_NOISE_1_attenuation
   seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/regional/Par_file_NOISE_1_noattenuation
   seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/regional/Par_file_NOISE_2_attenuation
   seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/regional/Par_file_NOISE_2_noattenuation
   seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/regional/Par_file_NOISE_3_noattenuation
   seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/test_global/Par_file_NOISE_1_attenuation
   seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/test_global/Par_file_NOISE_1_noattenuation
   seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/test_global/Par_file_NOISE_2_attenuation
   seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/test_global/Par_file_NOISE_2_noattenuation
   seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/test_global/Par_file_NOISE_3_noattenuation
   seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/test_regional/Par_file_NOISE_1_attenuation
   seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/test_regional/Par_file_NOISE_1_noattenuation
   seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/test_regional/Par_file_NOISE_2_attenuation
   seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/test_regional/Par_file_NOISE_2_noattenuation
   seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/test_regional/Par_file_NOISE_3_noattenuation
   seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/regional_Greece_noise_small/DATA/Par_file
   seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/regional_Greece_small/DATA/Par_file
   seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/regional_MiddleEast/DATA/Par_file
   seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/small_benchmark_run_to_test_more_complex_Earth/Par_file
   seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/small_benchmark_run_to_test_very_simple_Earth/Par_file
   seismo/3D/SPECFEM3D_GLOBE/trunk/src/shared/adios_helpers.f90
   seismo/3D/SPECFEM3D_GLOBE/trunk/src/shared/adios_helpers_definitions.f90
   seismo/3D/SPECFEM3D_GLOBE/trunk/src/shared/adios_helpers_writers.f90
   seismo/3D/SPECFEM3D_GLOBE/trunk/src/shared/adios_method_stubs.c
   seismo/3D/SPECFEM3D_GLOBE/trunk/src/shared/broadcast_computed_parameters.f90
   seismo/3D/SPECFEM3D_GLOBE/trunk/src/shared/read_parameter_file.f90
   seismo/3D/SPECFEM3D_GLOBE/trunk/src/shared/shared_par.f90
   seismo/3D/SPECFEM3D_GLOBE/trunk/src/specfem3D/rules.mk
   seismo/3D/SPECFEM3D_GLOBE/trunk/src/specfem3D/write_seismograms.f90
Log:
James' ASDF format for seismograms

Modified: seismo/3D/SPECFEM3D_GLOBE/trunk/DATA/Par_file
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/trunk/DATA/Par_file	2014-02-17 15:57:43 UTC (rev 22998)
+++ seismo/3D/SPECFEM3D_GLOBE/trunk/DATA/Par_file	2014-03-04 17:22:01 UTC (rev 22999)
@@ -5,23 +5,23 @@
 SAVE_FORWARD                    = .false.  # save last frame of forward simulation or not
 
 # number of chunks (1,2,3 or 6)
-NCHUNKS                         = 6
+NCHUNKS                         = 1
 
 # angular width of the first chunk (not used if full sphere with six chunks)
-ANGULAR_WIDTH_XI_IN_DEGREES   = 90.d0      # angular size of a chunk
-ANGULAR_WIDTH_ETA_IN_DEGREES  = 90.d0
-CENTER_LATITUDE_IN_DEGREES    = 90.d0
-CENTER_LONGITUDE_IN_DEGREES   =  0.d0
-GAMMA_ROTATION_AZIMUTH        =  0.d0
+ANGULAR_WIDTH_XI_IN_DEGREES   = 20.d0      # angular size of a chunk
+ANGULAR_WIDTH_ETA_IN_DEGREES  = 20.d0
+CENTER_LATITUDE_IN_DEGREES    = 40.d0
+CENTER_LONGITUDE_IN_DEGREES   = 25.d0
+GAMMA_ROTATION_AZIMUTH        = 0.d0
 
 # number of elements at the surface along the two sides of the first chunk
 # (must be multiple of 16 and 8 * multiple of NPROC below)
-NEX_XI                          = 240
-NEX_ETA                         = 240
+NEX_XI                          = 64
+NEX_ETA                         = 64
 
 # number of MPI processors along the two sides of the first chunk
-NPROC_XI                        = 5
-NPROC_ETA                       = 5
+NPROC_XI                        = 2
+NPROC_ETA                       = 2
 
 # 1D models with real structure:
 # 1D_isotropic_prem, 1D_transversely_isotropic_prem, 1D_iasp91, 1D_1066a, 1D_ak135f_no_mud, 1D_ref, 1D_ref_iso, 1D_jp3d,1D_sea99
@@ -38,7 +38,7 @@
 #                          to take the 1D crustal model from the
 #                          associated reference model rather than the default 3D crustal model
 # e.g. s20rts_1Dcrust, s362ani_1Dcrust, etc.
-MODEL                           = s362ani
+MODEL                           = 1D_transversely_isotropic_prem
 
 # parameters describing the Earth model
 OCEANS                          = .true.
@@ -49,16 +49,16 @@
 ATTENUATION                     = .true.
 
 # absorbing boundary conditions for a regional simulation
-ABSORBING_CONDITIONS            = .false.
+ABSORBING_CONDITIONS            = .true.
 
 # record length in minutes
-RECORD_LENGTH_IN_MINUTES        = 15.0d0
+RECORD_LENGTH_IN_MINUTES        = 2.5d0
 
 # to undo attenuation for sensitivity kernel calculations or forward runs with SAVE_FORWARD
 # use one (and only one) of the two flags below. UNDO_ATTENUATION is much better (it is exact)
 # but requires a significant amount of disk space for temporary storage.
 ATTENUATION_1D_WITH_3D_STORAGE  = .true.
-PARTIAL_PHYS_DISPERSION_ONLY    = .false.
+PARTIAL_PHYS_DISPERSION_ONLY    = .true.
 UNDO_ATTENUATION                = .false.
 NT_DUMP_ATTENUATION             = 100   # how often we dump restart files to undo attenuation, only needed when using UNDO_ATTENUATION
 
@@ -88,10 +88,12 @@
 RATIO_BY_WHICH_TO_INCREASE_IT   = 1.5d0
 
 # save AVS or OpenDX movies
+#MOVIE_COARSE saves movie only at corners of elements (SURFACE OR VOLUME)
+#MOVIE_COARSE does not work with create_movie_AVS_DX
 MOVIE_SURFACE                   = .false.
 MOVIE_VOLUME                    = .false.
-MOVIE_COARSE                    = .false.
-NTSTEP_BETWEEN_FRAMES           = 100
+MOVIE_COARSE                    = .true.
+NTSTEP_BETWEEN_FRAMES           = 50
 HDUR_MOVIE                      = 0.d0
 
 # save movie in volume.  Will save element if center of element is in prescribed volume
@@ -111,20 +113,19 @@
 MOVIE_STOP                      = 40000
 
 # save mesh files to check the mesh
-SAVE_MESH_FILES                 = .false.
+SAVE_MESH_FILES                 = .true.
 
 # restart files (number of runs can be 1 or higher, choose 1 for no restart files)
 NUMBER_OF_RUNS                  = 1
 NUMBER_OF_THIS_RUN              = 1
 
 # path to store the local database files on each node
-# mesh files
 LOCAL_PATH                      = ./DATABASES_MPI
 # temporary wavefield/kernel/movie files
 LOCAL_TMP_PATH                  = ./DATABASES_MPI
 
 # interval at which we output time step info and max of norm of displacement
-NTSTEP_BETWEEN_OUTPUT_INFO      = 1000
+NTSTEP_BETWEEN_OUTPUT_INFO      = 500
 
 # interval in time steps for temporary writing of seismograms
 NTSTEP_BETWEEN_OUTPUT_SEISMOS   = 5000000
@@ -134,12 +135,13 @@
 OUTPUT_SEISMOS_ASCII_TEXT       = .true.
 OUTPUT_SEISMOS_SAC_ALPHANUM     = .false.
 OUTPUT_SEISMOS_SAC_BINARY       = .false.
+OUTPUT_SEISMOS_ASDF             = .false.
 
 # rotate seismograms to Radial-Transverse-Z or use default North-East-Z reference frame
 ROTATE_SEISMOGRAMS_RT           = .false.
 
 # decide if master process writes all the seismograms or if all processes do it in parallel
-WRITE_SEISMOGRAMS_BY_MASTER     = .true.
+WRITE_SEISMOGRAMS_BY_MASTER     = .false.
 
 # save all seismograms in one large combined file instead of one file per seismogram
 # to avoid overloading shared non-local file systems such as GPFS for instance
@@ -173,7 +175,7 @@
 APPROXIMATE_HESS_KL             = .false.
 
 # forces transverse isotropy for all mantle elements
-# (default is to use transverse isotropy only between MOHO and 220).
+# (default is to use transverse isotropy only between MOHO and 220)
 # means we allow radial anisotropy between the bottom of the crust to the bottom of the transition zone, i.e., 660~km depth.
 USE_FULL_TISO_MANTLE            = .false.
 

Modified: seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/benchmarks/attenuation_benchmark_GJI_2002_versus_normal_modes/Par_file
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/benchmarks/attenuation_benchmark_GJI_2002_versus_normal_modes/Par_file	2014-02-17 15:57:43 UTC (rev 22998)
+++ seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/benchmarks/attenuation_benchmark_GJI_2002_versus_normal_modes/Par_file	2014-03-04 17:22:01 UTC (rev 22999)
@@ -131,6 +131,7 @@
 OUTPUT_SEISMOS_ASCII_TEXT       = .true.
 OUTPUT_SEISMOS_SAC_ALPHANUM     = .false.
 OUTPUT_SEISMOS_SAC_BINARY       = .false.
+OUTPUT_SEISMOS_ASDF             = .false.
 
 # rotate seismograms to Radial-Transverse-Z or use default North-East-Z reference frame
 ROTATE_SEISMOGRAMS_RT           = .true.

Modified: seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/global_PREM_kernels/amplitude/DATA/Par_file
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/global_PREM_kernels/amplitude/DATA/Par_file	2014-02-17 15:57:43 UTC (rev 22998)
+++ seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/global_PREM_kernels/amplitude/DATA/Par_file	2014-03-04 17:22:01 UTC (rev 22999)
@@ -135,6 +135,7 @@
 OUTPUT_SEISMOS_ASCII_TEXT       = .true.
 OUTPUT_SEISMOS_SAC_ALPHANUM     = .false.
 OUTPUT_SEISMOS_SAC_BINARY       = .false.
+OUTPUT_SEISMOS_ASDF             = .false.
 
 # rotate seismograms to Radial-Transverse-Z or use default North-East-Z reference frame
 ROTATE_SEISMOGRAMS_RT           = .false.

Modified: seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/global_PREM_kernels/traveltime/DATA/Par_file
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/global_PREM_kernels/traveltime/DATA/Par_file	2014-02-17 15:57:43 UTC (rev 22998)
+++ seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/global_PREM_kernels/traveltime/DATA/Par_file	2014-03-04 17:22:01 UTC (rev 22999)
@@ -135,6 +135,7 @@
 OUTPUT_SEISMOS_ASCII_TEXT       = .true.
 OUTPUT_SEISMOS_SAC_ALPHANUM     = .false.
 OUTPUT_SEISMOS_SAC_BINARY       = .false.
+OUTPUT_SEISMOS_ASDF             = .false.
 
 # rotate seismograms to Radial-Transverse-Z or use default North-East-Z reference frame
 ROTATE_SEISMOGRAMS_RT           = .false.

Modified: seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/global_s362ani/DATA/Par_file
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/global_s362ani/DATA/Par_file	2014-02-17 15:57:43 UTC (rev 22998)
+++ seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/global_s362ani/DATA/Par_file	2014-03-04 17:22:01 UTC (rev 22999)
@@ -135,6 +135,7 @@
 OUTPUT_SEISMOS_ASCII_TEXT       = .true.
 OUTPUT_SEISMOS_SAC_ALPHANUM     = .false.
 OUTPUT_SEISMOS_SAC_BINARY       = .false.
+OUTPUT_SEISMOS_ASDF             = .false.
 
 # rotate seismograms to Radial-Transverse-Z or use default North-East-Z reference frame
 ROTATE_SEISMOGRAMS_RT           = .false.

Modified: seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/global_s362ani_shakemovie/DATA/Par_file
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/global_s362ani_shakemovie/DATA/Par_file	2014-02-17 15:57:43 UTC (rev 22998)
+++ seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/global_s362ani_shakemovie/DATA/Par_file	2014-03-04 17:22:01 UTC (rev 22999)
@@ -135,6 +135,7 @@
 OUTPUT_SEISMOS_ASCII_TEXT       = .false.
 OUTPUT_SEISMOS_SAC_ALPHANUM     = .false.
 OUTPUT_SEISMOS_SAC_BINARY       = .true.
+OUTPUT_SEISMOS_ASDF             = .false.
 
 # rotate seismograms to Radial-Transverse-Z or use default North-East-Z reference frame
 ROTATE_SEISMOGRAMS_RT           = .false.

Modified: seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/global_s362ani_small/DATA/Par_file
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/global_s362ani_small/DATA/Par_file	2014-02-17 15:57:43 UTC (rev 22998)
+++ seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/global_s362ani_small/DATA/Par_file	2014-03-04 17:22:01 UTC (rev 22999)
@@ -135,6 +135,7 @@
 OUTPUT_SEISMOS_ASCII_TEXT       = .true.
 OUTPUT_SEISMOS_SAC_ALPHANUM     = .false.
 OUTPUT_SEISMOS_SAC_BINARY       = .false.
+OUTPUT_SEISMOS_ASDF             = .false.
 
 # rotate seismograms to Radial-Transverse-Z or use default North-East-Z reference frame
 ROTATE_SEISMOGRAMS_RT           = .false.

Modified: seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/global_long/Par_file_NOISE_1_attenuation
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/global_long/Par_file_NOISE_1_attenuation	2014-02-17 15:57:43 UTC (rev 22998)
+++ seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/global_long/Par_file_NOISE_1_attenuation	2014-03-04 17:22:01 UTC (rev 22999)
@@ -135,6 +135,7 @@
 OUTPUT_SEISMOS_ASCII_TEXT       = .true.
 OUTPUT_SEISMOS_SAC_ALPHANUM     = .false.
 OUTPUT_SEISMOS_SAC_BINARY       = .false.
+OUTPUT_SEISMOS_ASDF             = .false.
 
 # rotate seismograms to Radial-Transverse-Z or use default North-East-Z reference frame
 ROTATE_SEISMOGRAMS_RT           = .false.

Modified: seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/global_long/Par_file_NOISE_1_noattenuation
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/global_long/Par_file_NOISE_1_noattenuation	2014-02-17 15:57:43 UTC (rev 22998)
+++ seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/global_long/Par_file_NOISE_1_noattenuation	2014-03-04 17:22:01 UTC (rev 22999)
@@ -135,6 +135,7 @@
 OUTPUT_SEISMOS_ASCII_TEXT       = .true.
 OUTPUT_SEISMOS_SAC_ALPHANUM     = .false.
 OUTPUT_SEISMOS_SAC_BINARY       = .false.
+OUTPUT_SEISMOS_ASDF             = .false.
 
 # rotate seismograms to Radial-Transverse-Z or use default North-East-Z reference frame
 ROTATE_SEISMOGRAMS_RT           = .false.

Modified: seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/global_long/Par_file_NOISE_2_attenuation
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/global_long/Par_file_NOISE_2_attenuation	2014-02-17 15:57:43 UTC (rev 22998)
+++ seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/global_long/Par_file_NOISE_2_attenuation	2014-03-04 17:22:01 UTC (rev 22999)
@@ -135,6 +135,7 @@
 OUTPUT_SEISMOS_ASCII_TEXT       = .true.
 OUTPUT_SEISMOS_SAC_ALPHANUM     = .false.
 OUTPUT_SEISMOS_SAC_BINARY       = .false.
+OUTPUT_SEISMOS_ASDF             = .false.
 
 # rotate seismograms to Radial-Transverse-Z or use default North-East-Z reference frame
 ROTATE_SEISMOGRAMS_RT           = .false.

Modified: seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/global_long/Par_file_NOISE_2_noattenuation
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/global_long/Par_file_NOISE_2_noattenuation	2014-02-17 15:57:43 UTC (rev 22998)
+++ seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/global_long/Par_file_NOISE_2_noattenuation	2014-03-04 17:22:01 UTC (rev 22999)
@@ -135,6 +135,7 @@
 OUTPUT_SEISMOS_ASCII_TEXT       = .true.
 OUTPUT_SEISMOS_SAC_ALPHANUM     = .false.
 OUTPUT_SEISMOS_SAC_BINARY       = .false.
+OUTPUT_SEISMOS_ASDF             = .false.
 
 # rotate seismograms to Radial-Transverse-Z or use default North-East-Z reference frame
 ROTATE_SEISMOGRAMS_RT           = .false.

Modified: seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/global_long/Par_file_NOISE_3_noattenuation
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/global_long/Par_file_NOISE_3_noattenuation	2014-02-17 15:57:43 UTC (rev 22998)
+++ seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/global_long/Par_file_NOISE_3_noattenuation	2014-03-04 17:22:01 UTC (rev 22999)
@@ -135,6 +135,7 @@
 OUTPUT_SEISMOS_ASCII_TEXT       = .true.
 OUTPUT_SEISMOS_SAC_ALPHANUM     = .false.
 OUTPUT_SEISMOS_SAC_BINARY       = .false.
+OUTPUT_SEISMOS_ASDF             = .false.
 
 # rotate seismograms to Radial-Transverse-Z or use default North-East-Z reference frame
 ROTATE_SEISMOGRAMS_RT           = .false.

Modified: seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/global_short/Par_file_NOISE_1_attenuation
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/global_short/Par_file_NOISE_1_attenuation	2014-02-17 15:57:43 UTC (rev 22998)
+++ seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/global_short/Par_file_NOISE_1_attenuation	2014-03-04 17:22:01 UTC (rev 22999)
@@ -135,6 +135,7 @@
 OUTPUT_SEISMOS_ASCII_TEXT       = .true.
 OUTPUT_SEISMOS_SAC_ALPHANUM     = .false.
 OUTPUT_SEISMOS_SAC_BINARY       = .false.
+OUTPUT_SEISMOS_ASDF             = .false.
 
 # rotate seismograms to Radial-Transverse-Z or use default North-East-Z reference frame
 ROTATE_SEISMOGRAMS_RT           = .false.

Modified: seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/global_short/Par_file_NOISE_1_noattenuation
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/global_short/Par_file_NOISE_1_noattenuation	2014-02-17 15:57:43 UTC (rev 22998)
+++ seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/global_short/Par_file_NOISE_1_noattenuation	2014-03-04 17:22:01 UTC (rev 22999)
@@ -135,6 +135,7 @@
 OUTPUT_SEISMOS_ASCII_TEXT       = .true.
 OUTPUT_SEISMOS_SAC_ALPHANUM     = .false.
 OUTPUT_SEISMOS_SAC_BINARY       = .false.
+OUTPUT_SEISMOS_ASDF             = .false.
 
 # rotate seismograms to Radial-Transverse-Z or use default North-East-Z reference frame
 ROTATE_SEISMOGRAMS_RT           = .false.

Modified: seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/global_short/Par_file_NOISE_2_attenuation
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/global_short/Par_file_NOISE_2_attenuation	2014-02-17 15:57:43 UTC (rev 22998)
+++ seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/global_short/Par_file_NOISE_2_attenuation	2014-03-04 17:22:01 UTC (rev 22999)
@@ -135,6 +135,7 @@
 OUTPUT_SEISMOS_ASCII_TEXT       = .true.
 OUTPUT_SEISMOS_SAC_ALPHANUM     = .false.
 OUTPUT_SEISMOS_SAC_BINARY       = .false.
+OUTPUT_SEISMOS_ASDF             = .false.
 
 # rotate seismograms to Radial-Transverse-Z or use default North-East-Z reference frame
 ROTATE_SEISMOGRAMS_RT           = .false.

Modified: seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/global_short/Par_file_NOISE_2_noattenuation
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/global_short/Par_file_NOISE_2_noattenuation	2014-02-17 15:57:43 UTC (rev 22998)
+++ seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/global_short/Par_file_NOISE_2_noattenuation	2014-03-04 17:22:01 UTC (rev 22999)
@@ -135,6 +135,7 @@
 OUTPUT_SEISMOS_ASCII_TEXT       = .true.
 OUTPUT_SEISMOS_SAC_ALPHANUM     = .false.
 OUTPUT_SEISMOS_SAC_BINARY       = .false.
+OUTPUT_SEISMOS_ASDF             = .false.
 
 # rotate seismograms to Radial-Transverse-Z or use default North-East-Z reference frame
 ROTATE_SEISMOGRAMS_RT           = .false.

Modified: seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/global_short/Par_file_NOISE_3_noattenuation
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/global_short/Par_file_NOISE_3_noattenuation	2014-02-17 15:57:43 UTC (rev 22998)
+++ seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/global_short/Par_file_NOISE_3_noattenuation	2014-03-04 17:22:01 UTC (rev 22999)
@@ -135,6 +135,7 @@
 OUTPUT_SEISMOS_ASCII_TEXT       = .true.
 OUTPUT_SEISMOS_SAC_ALPHANUM     = .false.
 OUTPUT_SEISMOS_SAC_BINARY       = .false.
+OUTPUT_SEISMOS_ASDF             = .false.
 
 # rotate seismograms to Radial-Transverse-Z or use default North-East-Z reference frame
 ROTATE_SEISMOGRAMS_RT           = .false.

Modified: seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/regional/Par_file_NOISE_1_attenuation
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/regional/Par_file_NOISE_1_attenuation	2014-02-17 15:57:43 UTC (rev 22998)
+++ seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/regional/Par_file_NOISE_1_attenuation	2014-03-04 17:22:01 UTC (rev 22999)
@@ -135,6 +135,7 @@
 OUTPUT_SEISMOS_ASCII_TEXT       = .true.
 OUTPUT_SEISMOS_SAC_ALPHANUM     = .false.
 OUTPUT_SEISMOS_SAC_BINARY       = .false.
+OUTPUT_SEISMOS_ASDF             = .false.
 
 # rotate seismograms to Radial-Transverse-Z or use default North-East-Z reference frame
 ROTATE_SEISMOGRAMS_RT           = .false.

Modified: seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/regional/Par_file_NOISE_1_noattenuation
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/regional/Par_file_NOISE_1_noattenuation	2014-02-17 15:57:43 UTC (rev 22998)
+++ seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/regional/Par_file_NOISE_1_noattenuation	2014-03-04 17:22:01 UTC (rev 22999)
@@ -135,6 +135,7 @@
 OUTPUT_SEISMOS_ASCII_TEXT       = .true.
 OUTPUT_SEISMOS_SAC_ALPHANUM     = .false.
 OUTPUT_SEISMOS_SAC_BINARY       = .false.
+OUTPUT_SEISMOS_ASDF             = .false.
 
 # rotate seismograms to Radial-Transverse-Z or use default North-East-Z reference frame
 ROTATE_SEISMOGRAMS_RT           = .false.

Modified: seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/regional/Par_file_NOISE_2_attenuation
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/regional/Par_file_NOISE_2_attenuation	2014-02-17 15:57:43 UTC (rev 22998)
+++ seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/regional/Par_file_NOISE_2_attenuation	2014-03-04 17:22:01 UTC (rev 22999)
@@ -135,6 +135,7 @@
 OUTPUT_SEISMOS_ASCII_TEXT       = .true.
 OUTPUT_SEISMOS_SAC_ALPHANUM     = .false.
 OUTPUT_SEISMOS_SAC_BINARY       = .false.
+OUTPUT_SEISMOS_ASDF             = .false.
 
 # rotate seismograms to Radial-Transverse-Z or use default North-East-Z reference frame
 ROTATE_SEISMOGRAMS_RT           = .false.

Modified: seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/regional/Par_file_NOISE_2_noattenuation
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/regional/Par_file_NOISE_2_noattenuation	2014-02-17 15:57:43 UTC (rev 22998)
+++ seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/regional/Par_file_NOISE_2_noattenuation	2014-03-04 17:22:01 UTC (rev 22999)
@@ -135,6 +135,7 @@
 OUTPUT_SEISMOS_ASCII_TEXT       = .true.
 OUTPUT_SEISMOS_SAC_ALPHANUM     = .false.
 OUTPUT_SEISMOS_SAC_BINARY       = .false.
+OUTPUT_SEISMOS_ASDF             = .false.
 
 # rotate seismograms to Radial-Transverse-Z or use default North-East-Z reference frame
 ROTATE_SEISMOGRAMS_RT           = .false.

Modified: seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/regional/Par_file_NOISE_3_noattenuation
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/regional/Par_file_NOISE_3_noattenuation	2014-02-17 15:57:43 UTC (rev 22998)
+++ seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/regional/Par_file_NOISE_3_noattenuation	2014-03-04 17:22:01 UTC (rev 22999)
@@ -135,6 +135,7 @@
 OUTPUT_SEISMOS_ASCII_TEXT       = .true.
 OUTPUT_SEISMOS_SAC_ALPHANUM     = .false.
 OUTPUT_SEISMOS_SAC_BINARY       = .false.
+OUTPUT_SEISMOS_ASDF             = .false.
 
 # rotate seismograms to Radial-Transverse-Z or use default North-East-Z reference frame
 ROTATE_SEISMOGRAMS_RT           = .false.

Modified: seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/test_global/Par_file_NOISE_1_attenuation
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/test_global/Par_file_NOISE_1_attenuation	2014-02-17 15:57:43 UTC (rev 22998)
+++ seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/test_global/Par_file_NOISE_1_attenuation	2014-03-04 17:22:01 UTC (rev 22999)
@@ -109,6 +109,7 @@
 OUTPUT_SEISMOS_ASCII_TEXT       = .true.
 OUTPUT_SEISMOS_SAC_ALPHANUM     = .false.
 OUTPUT_SEISMOS_SAC_BINARY       = .false.
+OUTPUT_SEISMOS_ASDF             = .false.
 
 # rotate seismograms to Radial-Transverse-Z or use default North-East-Z reference frame
 ROTATE_SEISMOGRAMS_RT           = .false.

Modified: seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/test_global/Par_file_NOISE_1_noattenuation
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/test_global/Par_file_NOISE_1_noattenuation	2014-02-17 15:57:43 UTC (rev 22998)
+++ seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/test_global/Par_file_NOISE_1_noattenuation	2014-03-04 17:22:01 UTC (rev 22999)
@@ -109,6 +109,7 @@
 OUTPUT_SEISMOS_ASCII_TEXT       = .true.
 OUTPUT_SEISMOS_SAC_ALPHANUM     = .false.
 OUTPUT_SEISMOS_SAC_BINARY       = .false.
+OUTPUT_SEISMOS_ASDF             = .false.
 
 # rotate seismograms to Radial-Transverse-Z or use default North-East-Z reference frame
 ROTATE_SEISMOGRAMS_RT           = .false.

Modified: seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/test_global/Par_file_NOISE_2_attenuation
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/test_global/Par_file_NOISE_2_attenuation	2014-02-17 15:57:43 UTC (rev 22998)
+++ seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/test_global/Par_file_NOISE_2_attenuation	2014-03-04 17:22:01 UTC (rev 22999)
@@ -109,6 +109,7 @@
 OUTPUT_SEISMOS_ASCII_TEXT       = .true.
 OUTPUT_SEISMOS_SAC_ALPHANUM     = .false.
 OUTPUT_SEISMOS_SAC_BINARY       = .false.
+OUTPUT_SEISMOS_ASDF             = .false.
 
 # rotate seismograms to Radial-Transverse-Z or use default North-East-Z reference frame
 ROTATE_SEISMOGRAMS_RT           = .false.

Modified: seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/test_global/Par_file_NOISE_2_noattenuation
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/test_global/Par_file_NOISE_2_noattenuation	2014-02-17 15:57:43 UTC (rev 22998)
+++ seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/test_global/Par_file_NOISE_2_noattenuation	2014-03-04 17:22:01 UTC (rev 22999)
@@ -109,6 +109,7 @@
 OUTPUT_SEISMOS_ASCII_TEXT       = .true.
 OUTPUT_SEISMOS_SAC_ALPHANUM     = .false.
 OUTPUT_SEISMOS_SAC_BINARY       = .false.
+OUTPUT_SEISMOS_ASDF             = .false.
 
 # rotate seismograms to Radial-Transverse-Z or use default North-East-Z reference frame
 ROTATE_SEISMOGRAMS_RT           = .false.

Modified: seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/test_global/Par_file_NOISE_3_noattenuation
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/test_global/Par_file_NOISE_3_noattenuation	2014-02-17 15:57:43 UTC (rev 22998)
+++ seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/test_global/Par_file_NOISE_3_noattenuation	2014-03-04 17:22:01 UTC (rev 22999)
@@ -109,6 +109,7 @@
 OUTPUT_SEISMOS_ASCII_TEXT       = .true.
 OUTPUT_SEISMOS_SAC_ALPHANUM     = .false.
 OUTPUT_SEISMOS_SAC_BINARY       = .false.
+OUTPUT_SEISMOS_ASDF             = .false.
 
 # rotate seismograms to Radial-Transverse-Z or use default North-East-Z reference frame
 ROTATE_SEISMOGRAMS_RT           = .false.

Modified: seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/test_regional/Par_file_NOISE_1_attenuation
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/test_regional/Par_file_NOISE_1_attenuation	2014-02-17 15:57:43 UTC (rev 22998)
+++ seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/test_regional/Par_file_NOISE_1_attenuation	2014-03-04 17:22:01 UTC (rev 22999)
@@ -109,6 +109,7 @@
 OUTPUT_SEISMOS_ASCII_TEXT       = .true.
 OUTPUT_SEISMOS_SAC_ALPHANUM     = .false.
 OUTPUT_SEISMOS_SAC_BINARY       = .false.
+OUTPUT_SEISMOS_ASDF             = .false.
 
 # rotate seismograms to Radial-Transverse-Z or use default North-East-Z reference frame
 ROTATE_SEISMOGRAMS_RT           = .false.

Modified: seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/test_regional/Par_file_NOISE_1_noattenuation
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/test_regional/Par_file_NOISE_1_noattenuation	2014-02-17 15:57:43 UTC (rev 22998)
+++ seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/test_regional/Par_file_NOISE_1_noattenuation	2014-03-04 17:22:01 UTC (rev 22999)
@@ -109,6 +109,7 @@
 OUTPUT_SEISMOS_ASCII_TEXT       = .true.
 OUTPUT_SEISMOS_SAC_ALPHANUM     = .false.
 OUTPUT_SEISMOS_SAC_BINARY       = .false.
+OUTPUT_SEISMOS_ASDF             = .false.
 
 # rotate seismograms to Radial-Transverse-Z or use default North-East-Z reference frame
 ROTATE_SEISMOGRAMS_RT           = .false.

Modified: seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/test_regional/Par_file_NOISE_2_attenuation
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/test_regional/Par_file_NOISE_2_attenuation	2014-02-17 15:57:43 UTC (rev 22998)
+++ seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/test_regional/Par_file_NOISE_2_attenuation	2014-03-04 17:22:01 UTC (rev 22999)
@@ -109,6 +109,7 @@
 OUTPUT_SEISMOS_ASCII_TEXT       = .true.
 OUTPUT_SEISMOS_SAC_ALPHANUM     = .false.
 OUTPUT_SEISMOS_SAC_BINARY       = .false.
+OUTPUT_SEISMOS_ASDF             = .false.
 
 # rotate seismograms to Radial-Transverse-Z or use default North-East-Z reference frame
 ROTATE_SEISMOGRAMS_RT           = .false.

Modified: seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/test_regional/Par_file_NOISE_2_noattenuation
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/test_regional/Par_file_NOISE_2_noattenuation	2014-02-17 15:57:43 UTC (rev 22998)
+++ seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/test_regional/Par_file_NOISE_2_noattenuation	2014-03-04 17:22:01 UTC (rev 22999)
@@ -109,6 +109,7 @@
 OUTPUT_SEISMOS_ASCII_TEXT       = .true.
 OUTPUT_SEISMOS_SAC_ALPHANUM     = .false.
 OUTPUT_SEISMOS_SAC_BINARY       = .false.
+OUTPUT_SEISMOS_ASDF             = .false.
 
 # rotate seismograms to Radial-Transverse-Z or use default North-East-Z reference frame
 ROTATE_SEISMOGRAMS_RT           = .false.

Modified: seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/test_regional/Par_file_NOISE_3_noattenuation
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/test_regional/Par_file_NOISE_3_noattenuation	2014-02-17 15:57:43 UTC (rev 22998)
+++ seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/noise_examples/test_regional/Par_file_NOISE_3_noattenuation	2014-03-04 17:22:01 UTC (rev 22999)
@@ -109,6 +109,7 @@
 OUTPUT_SEISMOS_ASCII_TEXT       = .true.
 OUTPUT_SEISMOS_SAC_ALPHANUM     = .false.
 OUTPUT_SEISMOS_SAC_BINARY       = .false.
+OUTPUT_SEISMOS_ASDF             = .false.
 
 # rotate seismograms to Radial-Transverse-Z or use default North-East-Z reference frame
 ROTATE_SEISMOGRAMS_RT           = .false.

Modified: seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/regional_Greece_noise_small/DATA/Par_file
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/regional_Greece_noise_small/DATA/Par_file	2014-02-17 15:57:43 UTC (rev 22998)
+++ seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/regional_Greece_noise_small/DATA/Par_file	2014-03-04 17:22:01 UTC (rev 22999)
@@ -135,6 +135,7 @@
 OUTPUT_SEISMOS_ASCII_TEXT       = .true.
 OUTPUT_SEISMOS_SAC_ALPHANUM     = .false.
 OUTPUT_SEISMOS_SAC_BINARY       = .false.
+OUTPUT_SEISMOS_ASDF             = .false.
 
 # rotate seismograms to Radial-Transverse-Z or use default North-East-Z reference frame
 ROTATE_SEISMOGRAMS_RT           = .false.

Modified: seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/regional_Greece_small/DATA/Par_file
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/regional_Greece_small/DATA/Par_file	2014-02-17 15:57:43 UTC (rev 22998)
+++ seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/regional_Greece_small/DATA/Par_file	2014-03-04 17:22:01 UTC (rev 22999)
@@ -135,6 +135,7 @@
 OUTPUT_SEISMOS_ASCII_TEXT       = .true.
 OUTPUT_SEISMOS_SAC_ALPHANUM     = .false.
 OUTPUT_SEISMOS_SAC_BINARY       = .false.
+OUTPUT_SEISMOS_ASDF             = .false.
 
 # rotate seismograms to Radial-Transverse-Z or use default North-East-Z reference frame
 ROTATE_SEISMOGRAMS_RT           = .false.

Modified: seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/regional_MiddleEast/DATA/Par_file
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/regional_MiddleEast/DATA/Par_file	2014-02-17 15:57:43 UTC (rev 22998)
+++ seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/regional_MiddleEast/DATA/Par_file	2014-03-04 17:22:01 UTC (rev 22999)
@@ -135,6 +135,7 @@
 OUTPUT_SEISMOS_ASCII_TEXT       = .true.
 OUTPUT_SEISMOS_SAC_ALPHANUM     = .false.
 OUTPUT_SEISMOS_SAC_BINARY       = .false.
+OUTPUT_SEISMOS_ASDF             = .false.
 
 # rotate seismograms to Radial-Transverse-Z or use default North-East-Z reference frame
 ROTATE_SEISMOGRAMS_RT           = .false.

Modified: seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/small_benchmark_run_to_test_more_complex_Earth/Par_file
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/small_benchmark_run_to_test_more_complex_Earth/Par_file	2014-02-17 15:57:43 UTC (rev 22998)
+++ seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/small_benchmark_run_to_test_more_complex_Earth/Par_file	2014-03-04 17:22:01 UTC (rev 22999)
@@ -135,6 +135,7 @@
 OUTPUT_SEISMOS_ASCII_TEXT       = .true.
 OUTPUT_SEISMOS_SAC_ALPHANUM     = .false.
 OUTPUT_SEISMOS_SAC_BINARY       = .false.
+OUTPUT_SEISMOS_ASDF             = .false.
 
 # rotate seismograms to Radial-Transverse-Z or use default North-East-Z reference frame
 ROTATE_SEISMOGRAMS_RT           = .false.

Modified: seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/small_benchmark_run_to_test_very_simple_Earth/Par_file
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/small_benchmark_run_to_test_very_simple_Earth/Par_file	2014-02-17 15:57:43 UTC (rev 22998)
+++ seismo/3D/SPECFEM3D_GLOBE/trunk/EXAMPLES/small_benchmark_run_to_test_very_simple_Earth/Par_file	2014-03-04 17:22:01 UTC (rev 22999)
@@ -135,6 +135,7 @@
 OUTPUT_SEISMOS_ASCII_TEXT       = .true.
 OUTPUT_SEISMOS_SAC_ALPHANUM     = .false.
 OUTPUT_SEISMOS_SAC_BINARY       = .false.
+OUTPUT_SEISMOS_ASDF             = .false.
 
 # rotate seismograms to Radial-Transverse-Z or use default North-East-Z reference frame
 ROTATE_SEISMOGRAMS_RT           = .false.

Modified: seismo/3D/SPECFEM3D_GLOBE/trunk/src/shared/adios_helpers.f90
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/trunk/src/shared/adios_helpers.f90	2014-02-17 15:57:43 UTC (rev 22998)
+++ seismo/3D/SPECFEM3D_GLOBE/trunk/src/shared/adios_helpers.f90	2014-03-04 17:22:01 UTC (rev 22999)
@@ -53,6 +53,8 @@
   public :: define_adios_global_integer_1d_array
   public :: define_adios_global_long_1d_array
   public :: define_adios_global_logical_1d_array
+  public :: define_adios_global_string_1d_array
+  public :: define_adios_local_string_1d_array
   public :: define_adios_global_array1D
 
   ! from adios_helpers_writers_mod
@@ -61,6 +63,7 @@
   public :: write_adios_global_integer_1d_array
   public :: write_adios_global_long_1d_array
   public :: write_adios_global_logical_1d_array
+  public :: write_adios_global_string_1d_array
   public :: write_adios_global_1d_array
 contains
 

Modified: seismo/3D/SPECFEM3D_GLOBE/trunk/src/shared/adios_helpers_definitions.f90
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/trunk/src/shared/adios_helpers_definitions.f90	2014-02-17 15:57:43 UTC (rev 22998)
+++ seismo/3D/SPECFEM3D_GLOBE/trunk/src/shared/adios_helpers_definitions.f90	2014-03-04 17:22:01 UTC (rev 22999)
@@ -44,6 +44,8 @@
   public :: define_adios_global_integer_1d_array
   public :: define_adios_global_long_1d_array
   public :: define_adios_global_logical_1d_array
+  public :: define_adios_global_string_1d_array
+  public :: define_adios_local_string_1d_array
   public :: define_adios_global_array1D
 
   ! Generic interface to define scalar variables in ADIOS
@@ -94,6 +96,14 @@
     module procedure define_adios_global_1d_logical_5d
   end interface define_adios_global_logical_1d_array
 
+  interface define_adios_global_string_1d_array
+    module procedure define_adios_global_1d_string_1d
+  end interface define_adios_global_string_1d_array
+
+  interface define_adios_local_string_1d_array
+    module procedure define_adios_local_1d_string_1d
+  end interface define_adios_local_string_1d_array
+
   ! Cannot include an interface in another interface
   interface define_adios_global_array1D
     module procedure define_adios_global_1d_int_1d
@@ -125,6 +135,9 @@
     module procedure define_adios_global_1d_double_3d
     module procedure define_adios_global_1d_double_4d
     module procedure define_adios_global_1d_double_5d
+
+    module procedure define_adios_global_1d_string_1d
+
   end interface define_adios_global_array1D
 
 contains
@@ -1271,4 +1284,72 @@
 
 end subroutine define_adios_global_1d_logical_5d
 
+!string added
+subroutine define_adios_global_1d_string_generic(adios_group, group_size_inc, &
+    array_name, local_dim)
+  use adios_write_mod
+  implicit none
+  ! Parameters
+  integer(kind=8), intent(in) :: adios_group
+  character(len=*), intent(in) :: array_name
+  integer, intent(in) :: local_dim
+  integer(kind=8), intent(inout) :: group_size_inc
+  ! Variables
+  integer(kind=8) :: var_id
+
+  ! Define the dimensions of the array. local_dim used as a dummy
+  ! variable to call the integer routine.
+  call define_adios_global_dims_1d(adios_group, group_size_inc, array_name, &
+      local_dim)
+
+  call adios_define_var(adios_group, "array", array_name, 9, &
+      trim(array_name) // "/local_dim", trim(array_name) // "/global_dim", &
+      trim(array_name) // "/offset", var_id)
+  group_size_inc = group_size_inc + local_dim*1
+end subroutine define_adios_global_1d_string_generic
+
+subroutine define_adios_global_1d_string_1d(adios_group, group_size_inc, &
+    local_dim, path, array_name, var)
+  use adios_write_mod
+  implicit none
+  ! Parameters
+  integer(kind=8), intent(in) :: adios_group
+  character(len=*), intent(in) :: path, array_name
+  integer, intent(in) :: local_dim
+  integer(kind=8), intent(inout) :: group_size_inc
+  character(len=*), intent(in) :: var
+  ! Local vars
+  character(len=256) :: full_name
+
+  full_name = trim(path) // trim(array_name)
+        print *,"full name", trim(full_name),"local_dim:",local_dim
+
+  call define_adios_global_1d_string_generic(adios_group, group_size_inc, &
+      full_name, local_dim)
+end subroutine define_adios_global_1d_string_1d
+
+subroutine  define_adios_local_1d_string_1d(adios_group, group_size_inc, &
+                local_dim, path, array_name, var)
+                
+  implicit none
+  ! Parameters
+  integer(kind=8), intent(in) :: adios_group
+  character(len=*), intent(in) :: path, array_name
+  integer, intent(in) :: local_dim
+  integer(kind=8), intent(inout) :: group_size_inc
+  character(len=*), intent(in) :: var
+  ! Local 
+  character(len=256) :: full_name
+  integer(kind=8) :: var_id
+
+  full_name = trim(path)//trim(array_name)
+
+  !print *,"in define local:"
+  !print *,"full_name:", trim(full_name)
+
+  call adios_define_var(adios_group, array_name, path, 9, "", "", "", var_id )
+  group_size_inc = group_size_inc + 1*local_dim
+
+end subroutine define_adios_local_1d_string_1d
+
 end module adios_helpers_definitions_mod

Modified: seismo/3D/SPECFEM3D_GLOBE/trunk/src/shared/adios_helpers_writers.f90
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/trunk/src/shared/adios_helpers_writers.f90	2014-02-17 15:57:43 UTC (rev 22998)
+++ seismo/3D/SPECFEM3D_GLOBE/trunk/src/shared/adios_helpers_writers.f90	2014-03-04 17:22:01 UTC (rev 22999)
@@ -46,6 +46,7 @@
   public :: write_adios_global_integer_1d_array
   public :: write_adios_global_long_1d_array
   public :: write_adios_global_logical_1d_array
+  public :: write_adios_global_string_1d_array
   public :: write_adios_global_1d_array
 
   interface write_adios_global_real_1d_array
@@ -88,6 +89,10 @@
     module procedure write_adios_global_1d_logical_5d
   end interface write_adios_global_logical_1d_array
 
+  interface write_adios_global_string_1d_array
+    module procedure write_adios_global_1d_string_1d
+  end interface write_adios_global_string_1d_array
+
   interface write_adios_global_1d_array
     module procedure write_adios_global_1d_integer_1d
     module procedure write_adios_global_1d_integer_2d
@@ -902,5 +907,46 @@
 
 end subroutine write_adios_global_1d_logical_5d
 
+!===============================================================================
+subroutine write_1D_string_array_adios_dims(adios_handle, myrank, &
+    local_dim, global_dim, offset, sizeprocs, path)
+  use adios_write_mod
 
+  implicit none
+
+  integer(kind=8), intent(in) :: adios_handle
+  integer, intent(in) :: sizeprocs, local_dim, myrank
+  integer, intent(in) :: global_dim, offset
+  character(len=*), intent(in) :: path
+
+  integer :: adios_err
+
+  call adios_write(adios_handle, trim(path)// "/local_dim", &
+                   local_dim, adios_err)
+  call adios_write(adios_handle, trim(path)// "/global_dim", &
+                   global_dim, adios_err)
+  call adios_write(adios_handle, trim(path)// "/offset", &
+                   offset, adios_err)
+end subroutine write_1D_string_array_adios_dims
+
+!===============================================================================
+!string subroutine added
+subroutine write_adios_global_1d_string_1d(adios_handle, myrank, sizeprocs, &
+    local_dim, global_dim, offset, array_name, array)
+  ! Parameters
+  integer(kind=8), intent(in) :: adios_handle
+  integer, intent(in) :: myrank, sizeprocs, local_dim
+  integer, intent(in) :: global_dim, offset
+  character(len=*) :: array_name
+  character(len=*), intent(in) :: array
+  ! Variables
+  integer :: adios_err
+
+        print *,"tag2:",trim(array_name)
+        print *,"tag2:",trim(array)
+  call write_1D_string_array_adios_dims(adios_handle, myrank, &
+      local_dim, global_dim, offset, sizeprocs, array_name)
+  call adios_write(adios_handle, trim(array_name)// "/array", array(1:local_dim), adios_err)
+end subroutine write_adios_global_1d_string_1d
+
 end module adios_helpers_writers_mod

Modified: seismo/3D/SPECFEM3D_GLOBE/trunk/src/shared/adios_method_stubs.c
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/trunk/src/shared/adios_method_stubs.c	2014-02-17 15:57:43 UTC (rev 22998)
+++ seismo/3D/SPECFEM3D_GLOBE/trunk/src/shared/adios_method_stubs.c	2014-03-04 17:22:01 UTC (rev 22999)
@@ -111,3 +111,18 @@
 
 void FC_FUNC_(write_kernels_hessian_adios,WRITE_KERNELS_HESSIAN_ADIOS)(){}
 
+// For xspecfem3d -- "ASDF" -- seismograms in ADIOS
+
+void FC_FUNC_(init_asdf_data, INIT_ASDF_DATA)(void* asdf_event,
+                                             int* total_seismos_local){}
+
+void FC_FUNC_(store_asdf_data, STORE_ASDF_DATA)
+    (void* my_asdf, realw* seismogram_tmp, int* irec_local, int *irec, 
+     char* chn, int* iorientation){}
+
+void FC_FUNC_(close_asdf_data, CLOSE_ASDF_DATA)(void *my_asdf, 
+                                                int *total_seismos_local){}
+
+void FC_FUNC_(write_asdf, WRITE_ASDF)(void* my_asdf){}
+
+

Copied: seismo/3D/SPECFEM3D_GLOBE/trunk/src/shared/asdf_helpers.f90 (from rev 22998, seismo/3D/SPECFEM3D_GLOBE/trunk/src/shared/adios_helpers.f90)
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/trunk/src/shared/asdf_helpers.f90	                        (rev 0)
+++ seismo/3D/SPECFEM3D_GLOBE/trunk/src/shared/asdf_helpers.f90	2014-03-04 17:22:01 UTC (rev 22999)
@@ -0,0 +1,84 @@
+!=====================================================================
+!
+!          S p e c f e m 3 D  G l o b e  V e r s i o n  5 . 1
+!          --------------------------------------------------
+!
+!          Main authors: Dimitri Komatitsch and Jeroen Tromp
+!                        Princeton University, USA
+!             and University of Pau / CNRS / INRIA, France
+! (c) Princeton University / California Institute of Technology and University of Pau / CNRS / INRIA
+!                            April 2011
+!
+! This program is free software; you can redistribute it and/or modify
+! it under the terms of the GNU General Public License as published by
+! the Free Software Foundation; either version 2 of the License, or
+! (at your option) any later version.
+!
+! This program is distributed in the hope that it will be useful,
+! but WITHOUT ANY WARRANTY; without even the implied warranty of
+! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+! GNU General Public License for more details.
+!
+! You should have received a copy of the GNU General Public License along
+! with this program; if not, write to the Free Software Foundation, Inc.,
+! 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+!
+!=====================================================================
+
+
+!===============================================================================
+!> Helpers to set up adios features.
+!! * Error checking
+!! * Scalar definition
+!! * Global arrays definition
+!!
+!! \author MPBL      
+!-------------------------------------------------------------------------------
+module asdf_helpers_mod
+  use asdf_helpers_definitions_mod
+  use asdf_helpers_writers_mod
+  implicit none
+
+  private
+
+  ! from this module. No 'imports'
+  public :: check_adios_err
+
+  ! from adios_helpers_definitions_mod
+  public :: define_adios_scalar
+  public :: define_adios_global_real_1d_array
+  public :: define_adios_global_double_1d_array
+  public :: define_adios_global_integer_1d_array
+  public :: define_adios_global_long_1d_array
+  public :: define_adios_global_logical_1d_array
+  public :: define_adios_global_string_1d_array
+  public :: define_adios_local_string_1d_array
+  public :: define_adios_global_array1D
+
+  ! from adios_helpers_writers_mod
+  public :: write_adios_global_real_1d_array
+  public :: write_adios_global_double_1d_array
+  public :: write_adios_global_integer_1d_array
+  public :: write_adios_global_long_1d_array
+  public :: write_adios_global_logical_1d_array
+  public :: write_adios_global_string_1d_array
+  public :: write_adios_global_1d_array
+contains
+
+!===============================================================================
+!> Get the ADIOS error message from an adios error number if there is an error.
+!! \param adios_err The error code considered.
+subroutine check_adios_err(myrank, adios_err)
+  use adios_read_mod
+  implicit none
+  integer, intent(in) :: myrank, adios_err
+  character(len=1024) :: msg
+
+  if (adios_err /= 0) then
+    call adios_errmsg(msg)
+    print *, "process: ", myrank, ", error: ", msg
+    stop
+  endif
+end subroutine check_adios_err
+
+end module asdf_helpers_mod

Copied: seismo/3D/SPECFEM3D_GLOBE/trunk/src/shared/asdf_helpers_definitions.f90 (from rev 22998, seismo/3D/SPECFEM3D_GLOBE/trunk/src/shared/adios_helpers_definitions.f90)
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/trunk/src/shared/asdf_helpers_definitions.f90	                        (rev 0)
+++ seismo/3D/SPECFEM3D_GLOBE/trunk/src/shared/asdf_helpers_definitions.f90	2014-03-04 17:22:01 UTC (rev 22999)
@@ -0,0 +1,1326 @@
+!=====================================================================
+!
+!          S p e c f e m 3 D  G l o b e  V e r s i o n  5 . 1
+!          --------------------------------------------------
+!
+!          Main authors: Dimitri Komatitsch and Jeroen Tromp
+!                        Princeton University, USA
+!             and University of Pau / CNRS / INRIA, France
+! (c) Princeton University / California Institute of Technology and University of Pau / CNRS / INRIA
+!                            April 2011
+!
+! This program is free software; you can redistribute it and/or modify
+! it under the terms of the GNU General Public License as published by
+! the Free Software Foundation; either version 2 of the License, or
+! (at your option) any later version.
+!
+! This program is distributed in the hope that it will be useful,
+! but WITHOUT ANY WARRANTY; without even the implied warranty of
+! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+! GNU General Public License for more details.
+!
+! You should have received a copy of the GNU General Public License along
+! with this program; if not, write to the Free Software Foundation, Inc.,
+! 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+!
+!=====================================================================
+
+
+!===============================================================================
+!> Helpers to set up adios features.
+!! * Scalar definition
+!! * Global arrays definition
+!!
+!! \author MPBL      
+!-------------------------------------------------------------------------------
+module asdf_helpers_definitions_mod
+  implicit none
+
+  private
+
+  public :: define_adios_scalar
+  public :: define_adios_global_real_1d_array
+  public :: define_adios_global_double_1d_array
+  public :: define_adios_global_integer_1d_array
+  public :: define_adios_global_long_1d_array
+  public :: define_adios_global_logical_1d_array
+  public :: define_adios_global_string_1d_array
+  public :: define_adios_local_string_1d_array
+  public :: define_adios_global_array1D
+
+  ! Generic interface to define scalar variables in ADIOS 
+  interface define_adios_scalar
+    module procedure define_adios_double_scalar
+    module procedure define_adios_float_scalar
+    module procedure define_adios_integer_scalar
+    module procedure define_adios_byte_scalar
+  end interface define_adios_scalar
+
+  interface define_adios_global_real_1d_array
+    module procedure define_adios_global_1d_real_1d
+  end interface define_adios_global_real_1d_array
+
+  interface define_adios_global_double_1d_array
+    module procedure define_adios_global_1d_double_1d
+  end interface define_adios_global_double_1d_array
+
+  interface define_adios_global_integer_1d_array
+    module procedure define_adios_global_1d_int_1d
+  end interface define_adios_global_integer_1d_array
+
+  interface define_adios_global_long_1d_array
+    module procedure define_adios_global_1d_long_1d
+  end interface define_adios_global_long_1d_array
+
+  interface define_adios_global_logical_1d_array
+    module procedure define_adios_global_1d_logical_1d
+  end interface define_adios_global_logical_1d_array
+
+  interface define_adios_global_string_1d_array
+    module procedure define_adios_global_1d_string_1d
+  end interface define_adios_global_string_1d_array
+
+	interface define_adios_local_string_1d_array
+		module procedure define_adios_local_1d_string_1d
+	end interface define_adios_local_string_1d_array
+
+  ! Cannot include an interface in another interface
+  interface define_adios_global_array1D
+    module procedure define_adios_global_1d_int_1d
+
+    module procedure define_adios_global_1d_long_1d
+
+    module procedure define_adios_global_1d_logical_1d
+
+    module procedure define_adios_global_1d_real_1d
+
+    module procedure define_adios_global_1d_double_1d
+
+    module procedure define_adios_global_1d_string_1d
+  end interface define_adios_global_array1D
+
+contains
+
+
+!===============================================================================
+!> Define an ADIOS scalar double precision variable and autoincrement 
+!! the adios group size by (8).
+!! \param adios_group The adios group where the variables belongs
+!! \param group_size_inc The inout adios group size to increment
+!!                       with the size of the variable
+!! \param path The logical path structuring the data and containing
+!!             the variable 
+!! \param name The variable name in the ADIOS file.
+!! \param var The variable to be defined. Used for type inference. Can be
+!!            ignored.
+!!
+!! \note 'name' and 'var' are written as successive arguments on purpose.
+!!       One should be able to define a macro such as:
+!!       #define STRINGIFY_VAR(x) #x, x
+!!       Calling define_adios_double_scalar with such a macro will be done as:
+!!       call define_adios_double_scalar(group, size, path, STRINGIFY_VAR(x))
+!!       as STRINGIFY_VAR(x) expand as:
+!!       "x", x
+!!       x being the variable name inside the code.
+subroutine define_adios_double_scalar (adios_group, group_size_inc,  &
+    path, name, var)
+  use adios_write_mod
+  implicit none
+  ! Arguments
+  integer(kind=8),  intent(in)    :: adios_group
+  integer(kind=8),  intent(inout) :: group_size_inc
+  character(len=*), intent(in)    :: name, path
+  real(kind=8),     intent(in)    :: var
+  ! Local Variables
+  integer(kind=8)                  :: varid ! dummy variable, adios use var name
+
+  ! adios: 6 == real(kind=8) 
+  call adios_define_var (adios_group, trim(name), trim(path), 6,  "", "", "", varid)
+  group_size_inc = group_size_inc + 8
+end subroutine define_adios_double_scalar
+
+
+!===============================================================================
+!> Define an ADIOS scalar single precision variable and autoincrement 
+!! the adios group size by (8).
+!! \param adios_group The adios group where the variables belongs
+!! \param group_size_inc The inout adios group size to increment
+!!                       with the size of the variable
+!! \param path The logical path structuring the data and containing
+!!             the variable 
+!! \param name The variable name in the ADIOS file.
+!! \param var The variable to be defined. Used for type inference. Can be
+!             ignored.
+!!
+!! \note See define_adios_double_scalar()
+subroutine define_adios_float_scalar(adios_group, group_size_inc,  &
+    path, name, var)
+  use adios_write_mod
+  implicit none
+  ! Arguments
+  integer(kind=8),  intent(in)    :: adios_group
+  integer(kind=8),  intent(inout) :: group_size_inc
+  character(len=*), intent(in)    :: name, path
+  real(kind=4),     intent(in)    :: var
+  ! Local Variables
+  integer(kind=8)                  :: varid ! dummy variable, adios use var name
+
+  ! adios: 6 == real(kind=8) 
+	!print *, len_trim(name)
+	!print *, trim(path)
+	!print *, len_trim(path)
+  call adios_define_var (adios_group, trim(name), trim(path), 5,  "", "", "", varid)
+  group_size_inc = group_size_inc + 4
+end subroutine define_adios_float_scalar
+
+
+!===============================================================================
+!> Define an ADIOS scalar integer variable and autoincrement the adios
+!! group size by (4).
+!! \param adios_group The adios group where the variables belongs
+!! \param group_size_inc The inout adios group size to increment
+!!                       with the size of the variable
+!! \param path The logical path structuring the data and containing
+!!             the variable 
+!! \param name The variable name in the ADIOS file.
+!! \param var The variable to be defined. Used for type inference. Can be
+!             ignored.
+!!
+!! \note See define_adios_double_scalar()
+subroutine define_adios_integer_scalar(adios_group, group_size_inc,  &
+    path, name, var)
+  use adios_write_mod
+  implicit none
+  ! Arguments
+  integer(kind=8),  intent(in)     :: adios_group
+  character(len=*), intent(in)     :: name, path
+  integer(kind=8),  intent(inout)  :: group_size_inc
+  integer(kind=4),     intent(in)  :: var
+  ! Local Variables
+  integer(kind=8)                  :: varid ! dummy variable, adios use var name
+  ! Local vars
+  !character(len=256) :: full_name
+
+  !full_name = trim(path) // trim(name)
+
+  ! adios: 2 ~ integer(kind=4) 
+  !write (*,'("--- adios_define_var scalar path=",a20," name=",a20)') path, name
+  call adios_define_var (adios_group, trim(name), trim(path), adios_integer,  &
+      "", "", "", varid)
+  group_size_inc = group_size_inc + 4
+end subroutine define_adios_integer_scalar
+
+!===============================================================================
+!> Define an ADIOS scalar byte variable and autoincrement the adios
+!! group size by (1).
+!! \param adios_group The adios group where the variables belongs
+!! \param group_size_inc The inout adios group size to increment
+!!                       with the size of the variable
+!! \param path The logical path structuring the data and containing
+!!             the variable 
+!! \param name The variable name in the ADIOS file.
+!! \param var The variable to be defined. Used for type inference. Can be
+!             ignored.
+!!
+!! \note See define_adios_double_scalar()
+subroutine define_adios_byte_scalar (adios_group, group_size_inc, &
+    name, path, var)
+  use adios_write_mod
+  implicit none
+  ! Arguments
+  integer(kind=8),  intent(in)     :: adios_group
+  character(len=*), intent(in)     :: name, path
+  integer(kind=8),  intent(inout)  :: group_size_inc
+  byte,     intent(in)             :: var
+  ! Local Variables
+  integer(kind=8)                  :: varid ! dummy variable, adios use var name
+
+  ! adios: 0 == byte == any_data_type(kind=1) 
+  call adios_define_var (adios_group, trim(name), trim(path), 0,  "", "", "", varid)
+  group_size_inc = group_size_inc + 1
+end subroutine define_adios_byte_scalar
+
+
+!===============================================================================
+!> Define the dimensions that will be written along a global array in ADIOS.
+!! \param adios_group The adios group where the variables belongs
+!! \param group_size_inc The inout adios group size to increment
+!!                       with the size of the variable
+!! \param array_name The variable to be defined. This is actually the path for
+!!                   ADIOS. The values are stored in array_name/array
+!! \param local_dim The local dimension of the array.
+subroutine define_adios_global_dims_1d(adios_group, group_size_inc, &
+    array_name, local_dim)
+  implicit none
+  ! Parameters
+  integer(kind=8), intent(in) :: adios_group
+  character(len=*), intent(in) :: array_name
+  integer, intent(in) :: local_dim
+  integer(kind=8), intent(inout) :: group_size_inc
+
+	!print *,"in define dims"
+	!print *,"array_name:", trim(array_name)
+
+  call define_adios_integer_scalar (adios_group, &
+      group_size_inc, trim(array_name), "local_dim", local_dim)
+  call define_adios_integer_scalar (adios_group, &
+      group_size_inc, trim(array_name), "global_dim", local_dim)
+  call define_adios_integer_scalar (adios_group, &
+      group_size_inc, trim(array_name), "offset", local_dim)
+end subroutine define_adios_global_dims_1d
+
+
+!===============================================================================
+!> Define a real global array in ADIOS regardless of the array shape
+!! \param adios_group The adios group where the variables belongs
+!! \param group_size_inc The inout adios group size to increment
+!!                       with the size of the variable
+!! \param array_name The variable to be defined. This is actually the path for
+!!                   ADIOS. The values are stored in array_name/array
+!! \param local_dim The local dimension of the array.
+subroutine define_adios_global_1d_real_generic(adios_group, group_size_inc, &
+    array_name, local_dim)
+  use adios_write_mod
+  implicit none
+  ! Parameters
+  integer(kind=8), intent(in) :: adios_group
+  character(len=*), intent(in) :: array_name
+  integer, intent(in) :: local_dim
+  integer(kind=8), intent(inout) :: group_size_inc
+  ! Variables
+  integer(kind=8) :: var_id
+  
+  ! Define the dimensions of the array. local_dim used as a dummy
+  ! variable to call the integer routine.
+  call define_adios_global_dims_1d(adios_group, group_size_inc, array_name, &
+      local_dim)
+
+  !write (*,'("--- adios_define_var 1d_real path=",a20,"/array")') trim(array_name)
+  call adios_define_var(adios_group, "array", trim(array_name), 5, &
+      trim(array_name) // "/local_dim", trim(array_name) // "/global_dim", &
+      trim(array_name) // "/offset", var_id)
+  group_size_inc = group_size_inc + local_dim*4
+end subroutine define_adios_global_1d_real_generic
+
+!===============================================================================
+!> Define a global ADIOS 1D real array and autoincrement the adios
+!! group size.
+!! \param adios_group The adios group where the variables belongs
+!! \param group_size_inc The inout adios group size to increment
+!!                       with the size of the variable
+!! \param local_dim The local dimension of the array.
+!! \param path The path where array name lie.
+!! \param array_name The variable to be defined. This is actually the path for
+!!                   ADIOS. The values are stored in array_name/array
+!! \param var The variabe to define. Used for type and shape inference.
+!! \note This function define local, global and offset sizes as well as the
+!!       array to store the values in.
+subroutine define_adios_global_1d_real_1d(adios_group, group_size_inc, &
+    local_dim, path, array_name, var)
+  use adios_write_mod
+  implicit none
+  ! Parameters
+  integer(kind=8), intent(in) :: adios_group
+  character(len=*), intent(in) :: path, array_name
+  integer, intent(in) :: local_dim
+  integer(kind=8), intent(inout) :: group_size_inc
+  real, dimension(:), intent(in) :: var
+  ! Local vars
+  character(len=256) :: full_name
+
+  full_name = trim(path) // trim(array_name)
+	!print *, "in define:", trim(full_name)
+ 
+  call define_adios_global_1d_real_generic(adios_group, group_size_inc, &
+      full_name, local_dim)
+end subroutine define_adios_global_1d_real_1d
+
+
+!===============================================================================
+!> Define a global ADIOS 1D real array and autoincrement the adios
+!! group size.
+!! \param adios_group The adios group where the variables belongs
+!! \param group_size_inc The inout adios group size to increment
+!!                       with the size of the variable
+!! \param local_dim The local dimension of the array.
+!! \param path The path where array name lie.
+!! \param array_name The variable to be defined. This is actually the path for
+!!                   ADIOS. The values are stored in array_name/array
+!! \param var The variabe to define. Used for type and shape inference.
+!! \note This function define local, global and offset sizes as well as the
+!!       array to store the values in.
+subroutine define_adios_global_1d_real_2d(adios_group, group_size_inc, &
+    local_dim, path, array_name, var)
+  use adios_write_mod
+  implicit none
+  ! Parameters
+  integer(kind=8), intent(in) :: adios_group
+  character(len=*), intent(in) :: path, array_name
+  integer, intent(in) :: local_dim
+  integer(kind=8), intent(inout) :: group_size_inc
+  real, dimension(:,:), intent(in) :: var
+  ! Local vars
+  character(len=256) :: full_name
+
+  full_name = trim(path) // trim(array_name)
+
+  call define_adios_global_1d_real_generic(adios_group, group_size_inc, &
+      full_name, local_dim)
+end subroutine define_adios_global_1d_real_2d
+
+
+!===============================================================================
+!> Define a global ADIOS 1D real array and autoincrement the adios
+!! group size.
+!! \param adios_group The adios group where the variables belongs
+!! \param group_size_inc The inout adios group size to increment
+!!                       with the size of the variable
+!! \param local_dim The local dimension of the array.
+!! \param path The path where array name lie.
+!! \param array_name The variable to be defined. This is actually the path for
+!!                   ADIOS. The values are stored in array_name/array
+!! \param var The variabe to define. Used for type and shape inference.
+!! \note This function define local, global and offset sizes as well as the
+!!       array to store the values in.
+subroutine define_adios_global_1d_real_3d(adios_group, group_size_inc, &
+    local_dim, path, array_name, var)
+  use adios_write_mod
+  implicit none
+  ! Parameters
+  integer(kind=8), intent(in) :: adios_group
+  character(len=*), intent(in) :: path, array_name
+  integer, intent(in) :: local_dim
+  integer(kind=8), intent(inout) :: group_size_inc
+  real, dimension(:,:,:), intent(in) :: var
+  ! Local vars
+  character(len=256) :: full_name
+
+  full_name = trim(path) // trim(array_name)
+
+  call define_adios_global_1d_real_generic(adios_group, group_size_inc, &
+      full_name, local_dim)
+end subroutine define_adios_global_1d_real_3d
+
+
+!===============================================================================
+!> Define a global ADIOS 1D real array and autoincrement the adios
+!! group size.
+!! \param adios_group The adios group where the variables belongs
+!! \param group_size_inc The inout adios group size to increment
+!!                       with the size of the variable
+!! \param local_dim The local dimension of the array.
+!! \param path The path where array name lie.
+!! \param array_name The variable to be defined. This is actually the path for
+!!                   ADIOS. The values are stored in array_name/array
+!! \param var The variabe to define. Used for type and shape inference.
+!! \note This function define local, global and offset sizes as well as the
+!!       array to store the values in.
+subroutine define_adios_global_1d_real_4d(adios_group, group_size_inc, &
+    local_dim, path, array_name, var)
+  use adios_write_mod
+  implicit none
+  ! Parameters
+  integer(kind=8), intent(in) :: adios_group
+  character(len=*), intent(in) :: path, array_name
+  integer, intent(in) :: local_dim
+  integer(kind=8), intent(inout) :: group_size_inc
+  real, dimension(:,:,:,:), intent(in) :: var
+  ! Local vars
+  character(len=256) :: full_name
+
+  full_name = trim(path) // trim(array_name)
+
+  call define_adios_global_1d_real_generic(adios_group, group_size_inc, &
+      full_name, local_dim)
+end subroutine define_adios_global_1d_real_4d
+
+
+!===============================================================================
+!> Define a global ADIOS 1D real array and autoincrement the adios
+!! group size.
+!! \param adios_group The adios group where the variables belongs
+!! \param group_size_inc The inout adios group size to increment
+!!                       with the size of the variable
+!! \param local_dim The local dimension of the array.
+!! \param path The path where array name lie.
+!! \param array_name The variable to be defined. This is actually the path for
+!!                   ADIOS. The values are stored in array_name/array
+!! \param var The variabe to define. Used for type and shape inference.
+!! \note This function define local, global and offset sizes as well as the
+!!       array to store the values in.
+subroutine define_adios_global_1d_real_5d(adios_group, group_size_inc, &
+    local_dim, path, array_name, var)
+  use adios_write_mod
+  implicit none
+  ! Parameters
+  integer(kind=8), intent(in) :: adios_group
+  character(len=*), intent(in) :: path, array_name
+  integer, intent(in) :: local_dim
+  integer(kind=8), intent(inout) :: group_size_inc
+  real, dimension(:,:,:,:,:), intent(in) :: var
+  ! Local vars
+  character(len=256) :: full_name
+
+  full_name = trim(path) // trim(array_name)
+
+  call define_adios_global_1d_real_generic(adios_group, group_size_inc, &
+      full_name, local_dim)
+end subroutine define_adios_global_1d_real_5d
+
+
+!===============================================================================
+!> Define a double global array in ADIOS regardless of the array shape
+!! \param adios_group The adios group where the variables belongs
+!! \param group_size_inc The inout adios group size to increment
+!!                       with the size of the variable
+!! \param array_name The variable to be defined. This is actually the path for
+!!                   ADIOS. The values are stored in array_name/array
+!! \param local_dim The local dimension of the array.
+subroutine define_adios_global_1d_double_generic(adios_group, group_size_inc, &
+    array_name, local_dim)
+  use adios_write_mod
+  implicit none
+  ! Parameters
+  integer(kind=8), intent(in) :: adios_group
+  character(len=*), intent(in) :: array_name
+  integer, intent(in) :: local_dim
+  integer(kind=8), intent(inout) :: group_size_inc
+  ! Variables
+  integer(kind=8) :: var_id
+  
+  ! Define the dimensions of the array. local_dim used as a dummy
+  ! variable to call the integer routine.
+  call define_adios_global_dims_1d(adios_group, group_size_inc, array_name, &
+      local_dim)
+
+  call adios_define_var(adios_group, "array", array_name, 6, &
+      trim(array_name) // "/local_dim", trim(array_name) // "/global_dim", &
+      trim(array_name) // "/offset", var_id)
+  group_size_inc = group_size_inc + local_dim*8
+end subroutine define_adios_global_1d_double_generic
+
+!===============================================================================
+!> Define a global ADIOS 1D double array and autoincrement the adios
+!! group size.
+!! \param adios_group The adios group where the variables belongs
+!! \param group_size_inc The inout adios group size to increment
+!!                       with the size of the variable
+!! \param local_dim The local dimension of the array.
+!! \param path The path where array name lie.
+!! \param array_name The variable to be defined. This is actually the path for
+!!                   ADIOS. The values are stored in array_name/array
+!! \param var The variabe to define. Used for type and shape inference.
+!! \note This function define local, global and offset sizes as well as the
+!!       array to store the values in.
+subroutine define_adios_global_1d_double_1d(adios_group, group_size_inc, &
+    local_dim, path, array_name, var)
+  use adios_write_mod
+  implicit none
+  ! Parameters
+  integer(kind=8), intent(in) :: adios_group
+  character(len=*), intent(in) :: path, array_name
+  integer, intent(in) :: local_dim
+  integer(kind=8), intent(inout) :: group_size_inc
+  real(kind=8), dimension(:), intent(in) :: var
+  ! Local vars
+  character(len=256) :: full_name
+
+  full_name = trim(path) // trim(array_name)
+ 
+  call define_adios_global_1d_double_generic(adios_group, group_size_inc, &
+      full_name, local_dim)
+end subroutine define_adios_global_1d_double_1d
+
+
+!===============================================================================
+!> Define a global ADIOS 1D double array and autoincrement the adios
+!! group size.
+!! \param adios_group The adios group where the variables belongs
+!! \param group_size_inc The inout adios group size to increment
+!!                       with the size of the variable
+!! \param local_dim The local dimension of the array.
+!! \param path The path where array name lie.
+!! \param array_name The variable to be defined. This is actually the path for
+!!                   ADIOS. The values are stored in array_name/array
+!! \param var The variabe to define. Used for type and shape inference.
+!! \note This function define local, global and offset sizes as well as the
+!!       array to store the values in.
+subroutine define_adios_global_1d_double_2d(adios_group, group_size_inc, &
+    local_dim, path, array_name, var)
+  use adios_write_mod
+  implicit none
+  ! Parameters
+  integer(kind=8), intent(in) :: adios_group
+  character(len=*), intent(in) :: path, array_name
+  integer, intent(in) :: local_dim
+  integer(kind=8), intent(inout) :: group_size_inc
+  real(kind=8), dimension(:,:), intent(in) :: var
+  ! Local vars
+  character(len=256) :: full_name
+
+  full_name = trim(path) // trim(array_name)
+
+  call define_adios_global_1d_double_generic(adios_group, group_size_inc, &
+      full_name, local_dim)
+end subroutine define_adios_global_1d_double_2d
+
+
+!===============================================================================
+!> Define a global ADIOS 1D double array and autoincrement the adios
+!! group size.
+!! \param adios_group The adios group where the variables belongs
+!! \param group_size_inc The inout adios group size to increment
+!!                       with the size of the variable
+!! \param local_dim The local dimension of the array.
+!! \param path The path where array name lie.
+!! \param array_name The variable to be defined. This is actually the path for
+!!                   ADIOS. The values are stored in array_name/array
+!! \param var The variabe to define. Used for type and shape inference.
+!! \note This function define local, global and offset sizes as well as the
+!!       array to store the values in.
+subroutine define_adios_global_1d_double_3d(adios_group, group_size_inc, &
+    local_dim, path, array_name, var)
+  use adios_write_mod
+  implicit none
+  ! Parameters
+  integer(kind=8), intent(in) :: adios_group
+  character(len=*), intent(in) :: path, array_name
+  integer, intent(in) :: local_dim
+  integer(kind=8), intent(inout) :: group_size_inc
+  real(kind=8), dimension(:,:,:), intent(in) :: var
+  ! Local vars
+  character(len=256) :: full_name
+
+  full_name = trim(path) // trim(array_name)
+
+  call define_adios_global_1d_double_generic(adios_group, group_size_inc, &
+      full_name, local_dim)
+end subroutine define_adios_global_1d_double_3d
+
+
+!===============================================================================
+!> Define a global ADIOS 1D double array and autoincrement the adios
+!! group size.
+!! \param adios_group The adios group where the variables belongs
+!! \param group_size_inc The inout adios group size to increment
+!!                       with the size of the variable
+!! \param local_dim The local dimension of the array.
+!! \param path The path where array name lie.
+!! \param array_name The variable to be defined. This is actually the path for
+!!                   ADIOS. The values are stored in array_name/array
+!! \param var The variabe to define. Used for type and shape inference.
+!! \note This function define local, global and offset sizes as well as the
+!!       array to store the values in.
+subroutine define_adios_global_1d_double_4d(adios_group, group_size_inc, &
+    local_dim, path, array_name, var)
+  use adios_write_mod
+  implicit none
+  ! Parameters
+  integer(kind=8), intent(in) :: adios_group
+  character(len=*), intent(in) :: path, array_name
+  integer, intent(in) :: local_dim
+  integer(kind=8), intent(inout) :: group_size_inc
+  real(kind=8), dimension(:,:,:,:), intent(in) :: var
+  ! Local vars
+  character(len=256) :: full_name
+
+  full_name = trim(path) // trim(array_name)
+
+  call define_adios_global_1d_double_generic(adios_group, group_size_inc, &
+      full_name, local_dim)
+end subroutine define_adios_global_1d_double_4d
+
+
+!===============================================================================
+!> Define a global ADIOS 1D double array and autoincrement the adios
+!! group size.
+!! \param adios_group The adios group where the variables belongs
+!! \param group_size_inc The inout adios group size to increment
+!!                       with the size of the variable
+!! \param local_dim The local dimension of the array.
+!! \param path The path where array name lie.
+!! \param array_name The variable to be defined. This is actually the path for
+!!                   ADIOS. The values are stored in array_name/array
+!! \param var The variabe to define. Used for type and shape inference.
+!! \note This function define local, global and offset sizes as well as the
+!!       array to store the values in.
+subroutine define_adios_global_1d_double_5d(adios_group, group_size_inc, &
+    local_dim, path, array_name, var)
+  use adios_write_mod
+  implicit none
+  ! Parameters
+  integer(kind=8), intent(in) :: adios_group
+  character(len=*), intent(in) :: path, array_name
+  integer, intent(in) :: local_dim
+  integer(kind=8), intent(inout) :: group_size_inc
+  real(kind=8), dimension(:,:,:,:,:), intent(in) :: var
+  ! Local vars
+  character(len=256) :: full_name
+
+  full_name = trim(path) // trim(array_name)
+
+  call define_adios_global_1d_double_generic(adios_group, group_size_inc, &
+      full_name, local_dim)
+end subroutine define_adios_global_1d_double_5d
+
+
+!===============================================================================
+!> Define a integer global array in ADIOS regardless of the array shape
+!! \param adios_group The adios group where the variables belongs
+!! \param group_size_inc The inout adios group size to increment
+!!                       with the size of the variable
+!! \param array_name The variable to be defined. This is actually the path for
+!!                   ADIOS. The values are stored in array_name/array
+!! \param local_dim The local dimension of the array.
+subroutine define_adios_global_1d_int_generic(adios_group, group_size_inc, &
+    array_name, local_dim)
+  use adios_write_mod
+  implicit none
+  ! Parameters
+  integer(kind=8), intent(in) :: adios_group
+  character(len=*), intent(in) :: array_name
+  integer, intent(in) :: local_dim
+  integer(kind=8), intent(inout) :: group_size_inc
+  ! Variables
+  integer(kind=8) :: var_id
+
+  ! Define the dimensions of the array. local_dim used as a dummy
+  ! variable to call the integer routine.
+  call define_adios_global_dims_1d(adios_group, group_size_inc, array_name, &
+      local_dim)
+
+  !write (*,'("--- adios_define_var 1d_int path=[",a,"] name=/array, path len=",i3)') trim(array_name)
+  call adios_define_var(adios_group, "array", array_name, 2, &
+      trim(array_name) // "/local_dim", trim(array_name) // "/global_dim", &
+      trim(array_name) // "/offset", var_id)
+  group_size_inc = group_size_inc + local_dim*4
+end subroutine define_adios_global_1d_int_generic
+
+!===============================================================================
+!> Define a global ADIOS 1D int array and autoincrement the adios
+!! group size.
+!! \param adios_group The adios group where the variables belongs
+!! \param group_size_inc The inout adios group size to increment
+!!                       with the size of the variable
+!! \param local_dim The local dimension of the array.
+!! \param path The path where array name lie.
+!! \param array_name The variable to be defined. This is actually the path for
+!!                   ADIOS. The values are stored in array_name/array
+!! \param var The variabe to define. Used for type and shape inference.
+!! \note This function define local, global and offset sizes as well as the
+!!       array to store the values in.
+subroutine define_adios_global_1d_int_1d(adios_group, group_size_inc, &
+    local_dim, path, array_name, var)
+  use adios_write_mod
+  implicit none
+  ! Parameters
+  integer(kind=8), intent(in) :: adios_group
+  character(len=*), intent(in) :: path, array_name
+  integer, intent(in) :: local_dim
+  integer(kind=8), intent(inout) :: group_size_inc
+  integer(kind=4), dimension(:), intent(in) :: var
+  ! Local vars
+  character(len=256) :: full_name
+
+  full_name = trim(path) // trim(array_name)
+ 
+  call define_adios_global_1d_int_generic(adios_group, group_size_inc, &
+      full_name, local_dim)
+end subroutine define_adios_global_1d_int_1d
+
+
+!===============================================================================
+!> Define a global ADIOS 1D int array and autoincrement the adios
+!! group size.
+!! \param adios_group The adios group where the variables belongs
+!! \param group_size_inc The inout adios group size to increment
+!!                       with the size of the variable
+!! \param local_dim The local dimension of the array.
+!! \param path The path where array name lie.
+!! \param array_name The variable to be defined. This is actually the path for
+!!                   ADIOS. The values are stored in array_name/array
+!! \param var The variabe to define. Used for type and shape inference.
+!! \note This function define local, global and offset sizes as well as the
+!!       array to store the values in.
+subroutine define_adios_global_1d_int_2d(adios_group, group_size_inc, &
+    local_dim, path, array_name, var)
+  use adios_write_mod
+  implicit none
+  ! Parameters
+  integer(kind=8), intent(in) :: adios_group
+  character(len=*), intent(in) :: path, array_name
+  integer, intent(in) :: local_dim
+  integer(kind=8), intent(inout) :: group_size_inc
+  integer(kind=4), dimension(:,:), intent(in) :: var
+  ! Local vars
+  character(len=256) :: full_name
+
+  full_name = trim(path) // trim(array_name)
+
+  call define_adios_global_1d_int_generic(adios_group, group_size_inc, &
+      full_name, local_dim)
+end subroutine define_adios_global_1d_int_2d
+
+
+!===============================================================================
+!> Define a global ADIOS 1D int array and autoincrement the adios
+!! group size.
+!! \param adios_group The adios group where the variables belongs
+!! \param group_size_inc The inout adios group size to increment
+!!                       with the size of the variable
+!! \param local_dim The local dimension of the array.
+!! \param path The path where array name lie.
+!! \param array_name The variable to be defined. This is actually the path for
+!!                   ADIOS. The values are stored in array_name/array
+!! \param var The variabe to define. Used for type and shape inference.
+!! \note This function define local, global and offset sizes as well as the
+!!       array to store the values in.
+subroutine define_adios_global_1d_int_3d(adios_group, group_size_inc, &
+    local_dim, path, array_name, var)
+  use adios_write_mod
+  implicit none
+  ! Parameters
+  integer(kind=8), intent(in) :: adios_group
+  character(len=*), intent(in) :: path, array_name
+  integer, intent(in) :: local_dim
+  integer(kind=8), intent(inout) :: group_size_inc
+  integer(kind=4), dimension(:,:,:), intent(in) :: var
+  ! Local vars
+  character(len=256) :: full_name
+
+  full_name = trim(path) // trim(array_name)
+
+  call define_adios_global_1d_int_generic(adios_group, group_size_inc, &
+      full_name, local_dim)
+end subroutine define_adios_global_1d_int_3d
+
+
+!===============================================================================
+!> Define a global ADIOS 1D int array and autoincrement the adios
+!! group size.
+!! \param adios_group The adios group where the variables belongs
+!! \param group_size_inc The inout adios group size to increment
+!!                       with the size of the variable
+!! \param local_dim The local dimension of the array.
+!! \param path The path where array name lie.
+!! \param array_name The variable to be defined. This is actually the path for
+!!                   ADIOS. The values are stored in array_name/array
+!! \param var The variabe to define. Used for type and shape inference.
+!! \note This function define local, global and offset sizes as well as the
+!!       array to store the values in.
+subroutine define_adios_global_1d_int_4d(adios_group, group_size_inc, &
+    local_dim, path, array_name, var)
+  use adios_write_mod
+  implicit none
+  ! Parameters
+  integer(kind=8), intent(in) :: adios_group
+  character(len=*), intent(in) :: path, array_name
+  integer, intent(in) :: local_dim
+  integer(kind=8), intent(inout) :: group_size_inc
+  integer(kind=4), dimension(:,:,:,:), intent(in) :: var
+  ! Local vars
+  character(len=256) :: full_name
+
+  full_name = trim(path) // trim(array_name)
+
+  call define_adios_global_1d_int_generic(adios_group, group_size_inc, &
+      full_name, local_dim)
+end subroutine define_adios_global_1d_int_4d
+
+
+!===============================================================================
+!> Define a global ADIOS 1D int array and autoincrement the adios
+!! group size.
+!! \param adios_group The adios group where the variables belongs
+!! \param group_size_inc The inout adios group size to increment
+!!                       with the size of the variable
+!! \param local_dim The local dimension of the array.
+!! \param path The path where array name lie.
+!! \param array_name The variable to be defined. This is actually the path for
+!!                   ADIOS. The values are stored in array_name/array
+!! \param var The variabe to define. Used for type and shape inference.
+!! \note This function define local, global and offset sizes as well as the
+!!       array to store the values in.
+subroutine define_adios_global_1d_int_5d(adios_group, group_size_inc, &
+    local_dim, path, array_name, var)
+  use adios_write_mod
+  implicit none
+  ! Parameters
+  integer(kind=8), intent(in) :: adios_group
+  character(len=*), intent(in) :: path, array_name
+  integer, intent(in) :: local_dim
+  integer(kind=8), intent(inout) :: group_size_inc
+  integer(kind=4), dimension(:,:,:,:,:), intent(in) :: var
+  ! Local vars
+  character(len=256) :: full_name
+
+  full_name = trim(path) // trim(array_name)
+
+  call define_adios_global_1d_int_generic(adios_group, group_size_inc, &
+      full_name, local_dim)
+end subroutine define_adios_global_1d_int_5d
+
+
+!===============================================================================
+!> Define a long integer global array in ADIOS regardless of the array shape
+!! \param adios_group The adios group where the variables belongs
+!! \param group_size_inc The inout adios group size to increment
+!!                       with the size of the variable
+!! \param array_name The variable to be defined. This is actually the path for
+!!                   ADIOS. The values are stored in array_name/array
+!! \param local_dim The local dimension of the array.
+subroutine define_adios_global_1d_long_generic(adios_group, group_size_inc, &
+    array_name, local_dim)
+  use adios_write_mod
+  implicit none
+  ! Parameters
+  integer(kind=8), intent(in) :: adios_group
+  character(len=*), intent(in) :: array_name
+  integer, intent(in) :: local_dim
+  integer(kind=8), intent(inout) :: group_size_inc
+  ! Variables
+  integer(kind=8) :: var_id
+  
+  ! Define the dimensions of the array. local_dim used as a dummy
+  ! variable to call the integer routine.
+  call define_adios_global_dims_1d(adios_group, group_size_inc, array_name, &
+      local_dim)
+
+  call adios_define_var(adios_group, "array", array_name, adios_long, &
+      trim(array_name) // "/local_dim", trim(array_name) // "/global_dim", &
+      trim(array_name) // "/offset", var_id)
+  group_size_inc = group_size_inc + local_dim*8
+end subroutine define_adios_global_1d_long_generic
+
+!===============================================================================
+!> Define a global ADIOS 1D long array and autoincrement the adios
+!! group size.
+!! \param adios_group The adios group where the variables belongs
+!! \param group_size_inc The inout adios group size to increment
+!!                       with the size of the variable
+!! \param local_dim The local dimension of the array.
+!! \param path The path where array name lie.
+!! \param array_name The variable to be defined. This is actually the path for
+!!                   ADIOS. The values are stored in array_name/array
+!! \param var The variabe to define. Used for type and shape inference.
+!! \note This function define local, global and offset sizes as well as the
+!!       array to store the values in.
+subroutine define_adios_global_1d_long_1d(adios_group, group_size_inc, &
+    local_dim, path, array_name, var)
+  use adios_write_mod
+  implicit none
+  ! Parameters
+  integer(kind=8), intent(in) :: adios_group
+  character(len=*), intent(in) :: path, array_name
+  integer, intent(in) :: local_dim
+  integer(kind=8), intent(inout) :: group_size_inc
+  integer(kind=8), dimension(:), intent(in) :: var
+  ! Local vars
+  character(len=256) :: full_name
+
+  full_name = trim(path) // trim(array_name)
+ 
+  call define_adios_global_1d_long_generic(adios_group, group_size_inc, &
+      full_name, local_dim)
+end subroutine define_adios_global_1d_long_1d
+
+
+!===============================================================================
+!> Define a global ADIOS 1D long array and autoincrement the adios
+!! group size.
+!! \param adios_group The adios group where the variables belongs
+!! \param group_size_inc The inout adios group size to increment
+!!                       with the size of the variable
+!! \param local_dim The local dimension of the array.
+!! \param path The path where array name lie.
+!! \param array_name The variable to be defined. This is actually the path for
+!!                   ADIOS. The values are stored in array_name/array
+!! \param var The variabe to define. Used for type and shape inference.
+!! \note This function define local, global and offset sizes as well as the
+!!       array to store the values in.
+subroutine define_adios_global_1d_long_2d(adios_group, group_size_inc, &
+    local_dim, path, array_name, var)
+  use adios_write_mod
+  implicit none
+  ! Parameters
+  integer(kind=8), intent(in) :: adios_group
+  character(len=*), intent(in) :: path, array_name
+  integer, intent(in) :: local_dim
+  integer(kind=8), intent(inout) :: group_size_inc
+  integer(kind=8), dimension(:,:), intent(in) :: var
+  ! Local vars
+  character(len=256) :: full_name
+
+  full_name = trim(path) // trim(array_name)
+
+  call define_adios_global_1d_long_generic(adios_group, group_size_inc, &
+      full_name, local_dim)
+end subroutine define_adios_global_1d_long_2d
+
+
+!===============================================================================
+!> Define a global ADIOS 1D int array and autoincrement the adios
+!! group size.
+!! \param adios_group The adios group where the variables belongs
+!! \param group_size_inc The inout adios group size to increment
+!!                       with the size of the variable
+!! \param local_dim The local dimension of the array.
+!! \param path The path where array name lie.
+!! \param array_name The variable to be defined. This is actually the path for
+!!                   ADIOS. The values are stored in array_name/array
+!! \param var The variabe to define. Used for type and shape inference.
+!! \note This function define local, global and offset sizes as well as the
+!!       array to store the values in.
+subroutine define_adios_global_1d_long_3d(adios_group, group_size_inc, &
+    local_dim, path, array_name, var)
+  use adios_write_mod
+  implicit none
+  ! Parameters
+  integer(kind=8), intent(in) :: adios_group
+  character(len=*), intent(in) :: path, array_name
+  integer, intent(in) :: local_dim
+  integer(kind=8), intent(inout) :: group_size_inc
+  integer(kind=8), dimension(:,:,:), intent(in) :: var
+  ! Local vars
+  character(len=256) :: full_name
+
+  full_name = trim(path) // trim(array_name)
+
+  call define_adios_global_1d_long_generic(adios_group, group_size_inc, &
+      full_name, local_dim)
+end subroutine define_adios_global_1d_long_3d
+
+
+!===============================================================================
+!> Define a global ADIOS 1D int array and autoincrement the adios
+!! group size.
+!! \param adios_group The adios group where the variables belongs
+!! \param group_size_inc The inout adios group size to increment
+!!                       with the size of the variable
+!! \param local_dim The local dimension of the array.
+!! \param path The path where array name lie.
+!! \param array_name The variable to be defined. This is actually the path for
+!!                   ADIOS. The values are stored in array_name/array
+!! \param var The variabe to define. Used for type and shape inference.
+!! \note This function define local, global and offset sizes as well as the
+!!       array to store the values in.
+subroutine define_adios_global_1d_long_4d(adios_group, group_size_inc, &
+    local_dim, path, array_name, var)
+  use adios_write_mod
+  implicit none
+  ! Parameters
+  integer(kind=8), intent(in) :: adios_group
+  character(len=*), intent(in) :: path, array_name
+  integer, intent(in) :: local_dim
+  integer(kind=8), intent(inout) :: group_size_inc
+  integer(kind=8), dimension(:,:,:,:), intent(in) :: var
+  ! Local vars
+  character(len=256) :: full_name
+
+  full_name = trim(path) // trim(array_name)
+
+  call define_adios_global_1d_long_generic(adios_group, group_size_inc, &
+      full_name, local_dim)
+end subroutine define_adios_global_1d_long_4d
+
+
+!===============================================================================
+!> Define a global ADIOS 1D long array and autoincrement the adios
+!! group size.
+!! \param adios_group The adios group where the variables belongs
+!! \param group_size_inc The inout adios group size to increment
+!!                       with the size of the variable
+!! \param local_dim The local dimension of the array.
+!! \param path The path where array name lie.
+!! \param array_name The variable to be defined. This is actually the path for
+!!                   ADIOS. The values are stored in array_name/array
+!! \param var The variabe to define. Used for type and shape inference.
+!! \note This function define local, global and offset sizes as well as the
+!!       array to store the values in.
+subroutine define_adios_global_1d_long_5d(adios_group, group_size_inc, &
+    local_dim, path, array_name, var)
+  use adios_write_mod
+  implicit none
+  ! Parameters
+  integer(kind=8), intent(in) :: adios_group
+  character(len=*), intent(in) :: path, array_name
+  integer, intent(in) :: local_dim
+  integer(kind=8), intent(inout) :: group_size_inc
+  integer(kind=8), dimension(:,:,:,:,:), intent(in) :: var
+  ! Local vars
+  character(len=256) :: full_name
+
+  full_name = trim(path) // trim(array_name)
+
+  call define_adios_global_1d_long_generic(adios_group, group_size_inc, &
+      full_name, local_dim)
+end subroutine define_adios_global_1d_long_5d
+
+!===============================================================================
+!> Define a logical global array in ADIOS regardless of the array shape
+!! \param adios_group The adios group where the variables belongs
+!! \param group_size_inc The inout adios group size to increment
+!!                       with the size of the variable
+!! \param array_name The variable to be defined. This is actually the path for
+!!                   ADIOS. The values are stored in array_name/array
+!! \param local_dim The local dimension of the array.
+subroutine define_adios_global_1d_logical_generic(adios_group, group_size_inc, &
+    array_name, local_dim)
+  use adios_write_mod
+  implicit none
+  ! Parameters
+  integer(kind=8), intent(in) :: adios_group
+  character(len=*), intent(in) :: array_name
+  integer, intent(in) :: local_dim
+  integer(kind=8), intent(inout) :: group_size_inc
+  ! Variables
+  integer(kind=8) :: var_id
+  
+  ! Define the dimensions of the array. local_dim used as a dummy
+  ! variable to call the integer routine.
+  call define_adios_global_dims_1d(adios_group, group_size_inc, array_name, &
+      local_dim)
+
+  ! The Fortran standard does not specify how variables of LOGICAL type are
+  ! represented, beyond requiring that LOGICAL variables of default kind 
+  ! have the same storage size as default INTEGER and REAL variables. 
+  ! Hence the 'adios_integer' (2) data type to store logical values
+  call adios_define_var(adios_group, "array", array_name, 2, &
+      trim(array_name) // "/local_dim", trim(array_name) // "/global_dim", &
+      trim(array_name) // "/offset", var_id)
+  group_size_inc = group_size_inc + local_dim*4
+end subroutine define_adios_global_1d_logical_generic
+
+!===============================================================================
+!> Define a global ADIOS 1D logical array and autoincrement the adios
+!! group size.
+!! \param adios_group The adios group where the variables belongs
+!! \param group_size_inc The inout adios group size to increment
+!!                       with the size of the variable
+!! \param local_dim The local dimension of the array.
+!! \param path The path where array name lie.
+!! \param array_name The variable to be defined. This is actually the path for
+!!                   ADIOS. The values are stored in array_name/array
+!! \param var The variabe to define. Used for type and shape inference.
+!! \note This function define local, global and offset sizes as well as the
+!!       array to store the values in.
+subroutine define_adios_global_1d_logical_1d(adios_group, group_size_inc, &
+    local_dim, path, array_name, var)
+  use adios_write_mod
+  implicit none
+  ! Parameters
+  integer(kind=8), intent(in) :: adios_group
+  character(len=*), intent(in) :: path, array_name
+  integer, intent(in) :: local_dim
+  integer(kind=8), intent(inout) :: group_size_inc
+  logical, dimension(:), intent(in) :: var
+  ! Local vars
+  character(len=256) :: full_name
+
+  full_name = trim(path) // trim(array_name)
+ 
+  call define_adios_global_1d_logical_generic(adios_group, group_size_inc, &
+      full_name, local_dim)
+end subroutine define_adios_global_1d_logical_1d
+
+
+!===============================================================================
+!> Define a global ADIOS 1D logical array and autoincrement the adios
+!! group size.
+!! \param adios_group The adios group where the variables belongs
+!! \param group_size_inc The inout adios group size to increment
+!!                       with the size of the variable
+!! \param local_dim The local dimension of the array.
+!! \param path The path where array name lie.
+!! \param array_name The variable to be defined. This is actually the path for
+!!                   ADIOS. The values are stored in array_name/array
+!! \param var The variabe to define. Used for type and shape inference.
+!! \note This function define local, global and offset sizes as well as the
+!!       array to store the values in.
+subroutine define_adios_global_1d_logical_2d(adios_group, group_size_inc, &
+    local_dim, path, array_name, var)
+  use adios_write_mod
+  implicit none
+  ! Parameters
+  integer(kind=8), intent(in) :: adios_group
+  character(len=*), intent(in) :: path, array_name
+  integer, intent(in) :: local_dim
+  integer(kind=8), intent(inout) :: group_size_inc
+  logical, dimension(:,:), intent(in) :: var
+  ! Local vars
+  character(len=256) :: full_name
+
+  full_name = trim(path) // trim(array_name)
+
+  call define_adios_global_1d_logical_generic(adios_group, group_size_inc, &
+      full_name, local_dim)
+end subroutine define_adios_global_1d_logical_2d
+
+
+!===============================================================================
+!> Define a global ADIOS 1D logical array and autoincrement the adios
+!! group size.
+!! \param adios_group The adios group where the variables belongs
+!! \param group_size_inc The inout adios group size to increment
+!!                       with the size of the variable
+!! \param local_dim The local dimension of the array.
+!! \param path The path where array name lie.
+!! \param array_name The variable to be defined. This is actually the path for
+!!                   ADIOS. The values are stored in array_name/array
+!! \param var The variabe to define. Used for type and shape inference.
+!! \note This function define local, global and offset sizes as well as the
+!!       array to store the values in.
+subroutine define_adios_global_1d_logical_3d(adios_group, group_size_inc, &
+    local_dim, path, array_name, var)
+  use adios_write_mod
+  implicit none
+  ! Parameters
+  integer(kind=8), intent(in) :: adios_group
+  character(len=*), intent(in) :: path, array_name
+  integer, intent(in) :: local_dim
+  integer(kind=8), intent(inout) :: group_size_inc
+  logical, dimension(:,:,:), intent(in) :: var
+  ! Local vars
+  character(len=256) :: full_name
+
+  full_name = trim(path) // trim(array_name)
+
+  call define_adios_global_1d_logical_generic(adios_group, group_size_inc, &
+      full_name, local_dim)
+end subroutine define_adios_global_1d_logical_3d
+
+
+!===============================================================================
+!> Define a global ADIOS 1D logical array and autoincrement the adios
+!! group size.
+!! \param adios_group The adios group where the variables belongs
+!! \param group_size_inc The inout adios group size to increment
+!!                       with the size of the variable
+!! \param local_dim The local dimension of the array.
+!! \param path The path where array name lie.
+!! \param array_name The variable to be defined. This is actually the path for
+!!                   ADIOS. The values are stored in array_name/array
+!! \param var The variabe to define. Used for type and shape inference.
+!! \note This function define local, global and offset sizes as well as the
+!!       array to store the values in.
+subroutine define_adios_global_1d_logical_4d(adios_group, group_size_inc, &
+    local_dim, path, array_name, var)
+  use adios_write_mod
+  implicit none
+  ! Parameters
+  integer(kind=8), intent(in) :: adios_group
+  character(len=*), intent(in) :: path, array_name
+  integer, intent(in) :: local_dim
+  integer(kind=8), intent(inout) :: group_size_inc
+  logical, dimension(:,:,:,:), intent(in) :: var
+  ! Local vars
+  character(len=256) :: full_name
+
+  full_name = trim(path) // trim(array_name)
+
+  call define_adios_global_1d_logical_generic(adios_group, group_size_inc, &
+      full_name, local_dim)
+end subroutine define_adios_global_1d_logical_4d
+
+
+!===============================================================================
+!> Define a global ADIOS 1D logical array and autoincrement the adios
+!! group size.
+!! \param adios_group The adios group where the variables belongs
+!! \param group_size_inc The inout adios group size to increment
+!!                       with the size of the variable
+!! \param local_dim The local dimension of the array.
+!! \param path The path where array name lie.
+!! \param array_name The variable to be defined. This is actually the path for
+!!                   ADIOS. The values are stored in array_name/array
+!! \param var The variabe to define. Used for type and shape inference.
+!! \note This function define local, global and offset sizes as well as the
+!!       array to store the values in.
+subroutine define_adios_global_1d_logical_5d(adios_group, group_size_inc, &
+    local_dim, path, array_name, var)
+  use adios_write_mod
+  implicit none
+  ! Parameters
+  integer(kind=8), intent(in) :: adios_group
+  character(len=*), intent(in) :: path, array_name
+  integer, intent(in) :: local_dim
+  integer(kind=8), intent(inout) :: group_size_inc
+  logical, dimension(:,:,:,:,:), intent(in) :: var
+  ! Local vars
+  character(len=256) :: full_name
+
+  full_name = trim(path) // trim(array_name)
+
+  call define_adios_global_1d_logical_generic(adios_group, group_size_inc, &
+      full_name, local_dim)
+end subroutine define_adios_global_1d_logical_5d
+
+!string added
+subroutine define_adios_global_1d_string_generic(adios_group, group_size_inc, &
+    array_name, local_dim)
+  use adios_write_mod
+  implicit none
+  ! Parameters
+  integer(kind=8), intent(in) :: adios_group
+  character(len=*), intent(in) :: array_name
+  integer, intent(in) :: local_dim
+  integer(kind=8), intent(inout) :: group_size_inc
+  ! Variables
+  integer(kind=8) :: var_id
+  
+  ! Define the dimensions of the array. local_dim used as a dummy
+  ! variable to call the integer routine.
+  call define_adios_global_dims_1d(adios_group, group_size_inc, array_name, &
+      local_dim)
+
+  call adios_define_var(adios_group, "array", array_name, 9, &
+      trim(array_name) // "/local_dim", trim(array_name) // "/global_dim", &
+      trim(array_name) // "/offset", var_id)
+  group_size_inc = group_size_inc + local_dim*1
+end subroutine define_adios_global_1d_string_generic
+
+subroutine define_adios_global_1d_string_1d(adios_group, group_size_inc, &
+    local_dim, path, array_name, var)
+  use adios_write_mod
+  implicit none
+  ! Parameters
+  integer(kind=8), intent(in) :: adios_group
+  character(len=*), intent(in) :: path, array_name
+  integer, intent(in) :: local_dim
+  integer(kind=8), intent(inout) :: group_size_inc
+  character(len=*), intent(in) :: var
+  ! Local vars
+  character(len=256) :: full_name
+
+  full_name = trim(path) // trim(array_name)
+	print *,"full name", trim(full_name),"local_dim:",local_dim
+ 
+  call define_adios_global_1d_string_generic(adios_group, group_size_inc, &
+      full_name, local_dim)
+end subroutine define_adios_global_1d_string_1d
+
+subroutine  define_adios_local_1d_string_1d(adios_group, group_size_inc, &
+		local_dim, path, array_name, var)
+		
+	implicit none
+	! Parameters
+  integer(kind=8), intent(in) :: adios_group
+  character(len=*), intent(in) :: path, array_name
+  integer, intent(in) :: local_dim
+  integer(kind=8), intent(inout) :: group_size_inc
+  character(len=*), intent(in) :: var
+	! Local 
+	character(len=256) :: full_name
+	integer(kind=8) :: var_id
+
+	full_name = trim(path)//trim(array_name)
+
+	!print *,"in define local:"
+	!print *,"full_name:", trim(full_name)
+
+	call adios_define_var(adios_group, array_name, path, 9, "", "", "", var_id )
+	group_size_inc = group_size_inc + 1*local_dim
+
+end subroutine define_adios_local_1d_string_1d
+
+end module asdf_helpers_definitions_mod

Added: seismo/3D/SPECFEM3D_GLOBE/trunk/src/shared/asdf_helpers_writers.f90
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/trunk/src/shared/asdf_helpers_writers.f90	                        (rev 0)
+++ seismo/3D/SPECFEM3D_GLOBE/trunk/src/shared/asdf_helpers_writers.f90	2014-03-04 17:22:01 UTC (rev 22999)
@@ -0,0 +1,279 @@
+!=====================================================================
+!
+!          S p e c f e m 3 D  G l o b e  V e r s i o n  5 . 1
+!          --------------------------------------------------
+!
+!          Main authors: Dimitri Komatitsch and Jeroen Tromp
+!                        Princeton University, USA
+!             and University of Pau / CNRS / INRIA, France
+! (c) Princeton University / California Institute of Technology and University of Pau / CNRS / INRIA
+!                            April 2011
+!
+! This program is free software; you can redistribute it and/or modify
+! it under the terms of the GNU General Public License as published by
+! the Free Software Foundation; either version 2 of the License, or
+! (at your option) any later version.
+!
+! This program is distributed in the hope that it will be useful,
+! but WITHOUT ANY WARRANTY; without even the implied warranty of
+! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+! GNU General Public License for more details.
+!
+! You should have received a copy of the GNU General Public License along
+! with this program; if not, write to the Free Software Foundation, Inc.,
+! 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+!
+!=====================================================================
+
+
+!===============================================================================
+!> Helpers to set up adios features.
+!! * Scalar definition
+!! * Global arrays definition
+!!
+!! \note We do not define function to write scalars variables into adios
+!!       since it is already a single function call.
+!!
+!! \author MPBL      
+!-------------------------------------------------------------------------------
+module asdf_helpers_writers_mod
+  implicit none
+
+  private
+
+  public :: write_adios_global_real_1d_array
+  public :: write_adios_global_double_1d_array
+  public :: write_adios_global_integer_1d_array
+  public :: write_adios_global_long_1d_array
+  public :: write_adios_global_logical_1d_array
+  public :: write_adios_global_string_1d_array
+  public :: write_adios_global_1d_array
+
+  interface write_adios_global_real_1d_array
+    module procedure write_adios_global_1d_real_1d
+  end interface write_adios_global_real_1d_array
+
+  interface write_adios_global_double_1d_array
+    module procedure write_adios_global_1d_double_1d
+  end interface write_adios_global_double_1d_array
+
+  interface write_adios_global_integer_1d_array
+    module procedure write_adios_global_1d_integer_1d
+  end interface write_adios_global_integer_1d_array
+
+  interface write_adios_global_long_1d_array
+    module procedure write_adios_global_1d_long_1d
+  end interface write_adios_global_long_1d_array
+
+  interface write_adios_global_logical_1d_array
+    module procedure write_adios_global_1d_logical_1d
+  end interface write_adios_global_logical_1d_array
+
+  interface write_adios_global_string_1d_array
+    module procedure write_adios_global_1d_string_1d
+  end interface write_adios_global_string_1d_array
+
+  interface write_adios_global_1d_array
+    module procedure write_adios_global_1d_integer_1d
+
+    module procedure write_adios_global_1d_long_1d
+
+    module procedure write_adios_global_1d_logical_1d
+
+    module procedure write_adios_global_1d_real_1d
+
+    module procedure write_adios_global_1d_double_1d
+  end interface write_adios_global_1d_array
+
+contains
+
+
+!===============================================================================
+subroutine write_1D_global_array_adios_dims(adios_handle, myrank, &
+    local_dim, global_dim, offset, sizeprocs, path)
+  use adios_write_mod
+
+  implicit none
+
+  integer(kind=8), intent(in) :: adios_handle
+  integer, intent(in) :: sizeprocs, local_dim, myrank
+  integer, intent(in) :: global_dim, offset
+  character(len=*), intent(in) :: path
+
+  integer :: adios_err
+
+  call adios_write(adios_handle, trim(path)// "/local_dim", &
+                   local_dim, adios_err)
+  call adios_write(adios_handle, trim(path)// "/global_dim", &
+                   global_dim, adios_err)
+  call adios_write(adios_handle, trim(path)// "/offset", &
+                   offset, adios_err)
+end subroutine write_1D_global_array_adios_dims
+
+
+!===============================================================================
+!> Schedule an ADIOS single precision global 1d array for write
+!! \param adios_handle The adios handle to the file to be written
+!! \param myrank The rank of the MPI process involved
+!! \param sizeprocs The number of MPI process in the communicator writing the
+!!                  variable
+!! \param local_dim The number of elements to be writen by each process. Might
+!!                  eventually be padded.
+!! \param path The logical path structuring the data and containing
+!!             the variable 
+!! \param array_name The array name in the ADIOS file.
+!! \param array The array to be written
+subroutine write_adios_global_1d_real_1d(adios_handle, myrank, sizeprocs, &
+    local_dim, global_dim, offset, array_name, array)
+  ! Parameters
+  integer(kind=8), intent(in) :: adios_handle
+  integer, intent(in) :: myrank, sizeprocs, local_dim
+  integer, intent(in) :: global_dim, offset
+  character(len=*) :: array_name
+  real, dimension(:), intent(in) :: array
+  ! Variables
+  integer :: adios_err
+
+  call write_1D_global_array_adios_dims(adios_handle, myrank, &
+      local_dim, global_dim, offset, sizeprocs, array_name)
+  call adios_write(adios_handle, trim(array_name)// "/array", array, adios_err)
+end subroutine write_adios_global_1d_real_1d
+
+
+!===============================================================================
+!> Schedule an ADIOS double precision global 1d array for write
+!! \param adios_handle The adios handle to the file to be written
+!! \param myrank The rank of the MPI process involved
+!! \param sizeprocs The number of MPI process in the communicator writing the
+!!                  variable
+!! \param local_dim The number of elements to be writen by each process. Might
+!!                  eventually be padded.
+!! \param path The logical path structuring the data and containing
+!!             the variable 
+!! \param array_name The array name in the ADIOS file.
+!! \param array The array to be written
+subroutine write_adios_global_1d_double_1d(adios_handle, myrank, sizeprocs, &
+    local_dim, global_dim, offset, array_name, array)
+  ! Parameters
+  integer(kind=8), intent(in) :: adios_handle
+  integer, intent(in) :: myrank, sizeprocs, local_dim
+  integer, intent(in) :: global_dim, offset
+  character(len=*) :: array_name
+  real(kind=8), dimension(:), intent(in) :: array
+  ! Variables
+  integer :: adios_err
+
+  call write_1D_global_array_adios_dims(adios_handle, myrank, &
+      local_dim, global_dim, offset, sizeprocs, array_name)
+  call adios_write(adios_handle, trim(array_name)// "/array", array, adios_err)
+end subroutine write_adios_global_1d_double_1d
+
+
+!===============================================================================
+!> Schedule an ADIOS integer global 1d array for write
+!! \param adios_handle The adios handle to the file to be written
+!! \param myrank The rank of the MPI process involved
+!! \param sizeprocs The number of MPI process in the communicator writing the
+!!                  variable
+!! \param local_dim The number of elements to be writen by each process. Might
+!!                  eventually be padded.
+!! \param path The logical path structuring the data and containing
+!!             the variable 
+!! \param array_name The array name in the ADIOS file.
+!! \param array The array to be written
+subroutine write_adios_global_1d_integer_1d(adios_handle, myrank, sizeprocs, &
+    local_dim, global_dim, offset, array_name, array)
+  ! Parameters
+  integer(kind=8), intent(in) :: adios_handle
+  integer, intent(in) :: myrank, sizeprocs, local_dim
+  integer, intent(in) :: global_dim, offset
+  character(len=*) :: array_name
+  integer(kind=4), dimension(:), intent(in) :: array
+  ! Variables
+  integer :: adios_err
+
+  call write_1D_global_array_adios_dims(adios_handle, myrank, &
+      local_dim, global_dim, offset, sizeprocs, array_name)
+  call adios_write(adios_handle, trim(array_name)// "/array", array, adios_err)
+end subroutine write_adios_global_1d_integer_1d
+
+
+!===============================================================================
+!> Schedule an ADIOS long global 1d array for write
+!! \param adios_handle The adios handle to the file to be written
+!! \param myrank The rank of the MPI process involved
+!! \param sizeprocs The number of MPI process in the communicator writing the
+!!                  variable
+!! \param local_dim The number of elements to be writen by each process. Might
+!!                  eventually be padded.
+!! \param path The logical path structuring the data and containing
+!!             the variable 
+!! \param array_name The array name in the ADIOS file.
+!! \param array The array to be written
+subroutine write_adios_global_1d_long_1d(adios_handle, myrank, sizeprocs, &
+    local_dim, global_dim, offset, array_name, array)
+  ! Parameters
+  integer(kind=8), intent(in) :: adios_handle
+  integer, intent(in) :: myrank, sizeprocs, local_dim
+  integer, intent(in) :: global_dim, offset
+  character(len=*) :: array_name
+  integer(kind=8), dimension(:), intent(in) :: array
+  ! Variables
+  integer :: adios_err
+
+  call write_1D_global_array_adios_dims(adios_handle, myrank, &
+      local_dim, global_dim, offset, sizeprocs, array_name)
+  call adios_write(adios_handle, trim(array_name)// "/array", array, adios_err)
+end subroutine write_adios_global_1d_long_1d
+
+
+!===============================================================================
+!> Schedule an ADIOS logical global 1d array for write
+!! \param adios_handle The adios handle to the file to be written
+!! \param myrank The rank of the MPI process involved
+!! \param sizeprocs The number of MPI process in the communicator writing the
+!!                  variable
+!! \param local_dim The number of elements to be writen by each process. Might
+!!                  eventually be padded.
+!! \param path The logical path structuring the data and containing
+!!             the variable 
+!! \param array_name The array name in the ADIOS file.
+!! \param array The array to be written
+subroutine write_adios_global_1d_logical_1d(adios_handle, myrank, sizeprocs, &
+    local_dim, global_dim, offset, array_name, array)
+  ! Parameters
+  integer(kind=8), intent(in) :: adios_handle
+  integer, intent(in) :: myrank, sizeprocs, local_dim
+  integer, intent(in) :: global_dim, offset
+  character(len=*) :: array_name
+  logical, dimension(:), intent(in) :: array
+  ! Variables
+  integer :: adios_err
+
+  call write_1D_global_array_adios_dims(adios_handle, myrank, &
+      local_dim, global_dim, offset, sizeprocs, array_name)
+  call adios_write(adios_handle, trim(array_name)// "/array", array, adios_err)
+end subroutine write_adios_global_1d_logical_1d
+
+
+!===============================================================================
+!string subroutine added
+subroutine write_adios_global_1d_string_1d(adios_handle, myrank, sizeprocs, &
+    local_dim, global_dim, offset, array_name, array)
+  ! Parameters
+  integer(kind=8), intent(in) :: adios_handle
+  integer, intent(in) :: myrank, sizeprocs, local_dim
+  integer, intent(in) :: global_dim, offset
+  character(len=*) :: array_name
+  character(len=*), intent(in) :: array
+  ! Variables
+  integer :: adios_err
+
+	print *,"tag2:",trim(array_name)
+	print *,"tag2:",trim(array)
+  call write_1D_global_array_adios_dims(adios_handle, myrank, &
+      local_dim, global_dim, offset, sizeprocs, array_name)
+  call adios_write(adios_handle, trim(array_name)// "/array", array(1:local_dim), adios_err)
+end subroutine write_adios_global_1d_string_1d
+
+end module asdf_helpers_writers_mod

Modified: seismo/3D/SPECFEM3D_GLOBE/trunk/src/shared/broadcast_computed_parameters.f90
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/trunk/src/shared/broadcast_computed_parameters.f90	2014-02-17 15:57:43 UTC (rev 22998)
+++ seismo/3D/SPECFEM3D_GLOBE/trunk/src/shared/broadcast_computed_parameters.f90	2014-03-04 17:22:01 UTC (rev 22999)
@@ -39,7 +39,7 @@
   integer, parameter :: nparam_i = 44
   integer, dimension(nparam_i) :: bcast_integer
 
-  integer, parameter :: nparam_l = 56
+  integer, parameter :: nparam_l = 57
   logical, dimension(nparam_l) :: bcast_logical
 
   integer, parameter :: nparam_dp = 32
@@ -87,6 +87,7 @@
             CUT_SUPERBRICK_XI,CUT_SUPERBRICK_ETA,SAVE_ALL_SEISMOS_IN_ONE_FILE, &
             HONOR_1D_SPHERICAL_MOHO,MOVIE_COARSE, &
             OUTPUT_SEISMOS_ASCII_TEXT,OUTPUT_SEISMOS_SAC_ALPHANUM,OUTPUT_SEISMOS_SAC_BINARY,&
+            OUTPUT_SEISMOS_ASDF, &
             ROTATE_SEISMOGRAMS_RT,WRITE_SEISMOGRAMS_BY_MASTER,USE_BINARY_FOR_LARGE_FILE, &
             SAVE_REGULAR_KL, &
             PARTIAL_PHYS_DISPERSION_ONLY,UNDO_ATTENUATION, &
@@ -235,30 +236,31 @@
     OUTPUT_SEISMOS_ASCII_TEXT= bcast_logical(30)
     OUTPUT_SEISMOS_SAC_ALPHANUM= bcast_logical(31)
     OUTPUT_SEISMOS_SAC_BINARY= bcast_logical(32)
-    ROTATE_SEISMOGRAMS_RT= bcast_logical(33)
-    WRITE_SEISMOGRAMS_BY_MASTER= bcast_logical(34)
-    USE_BINARY_FOR_LARGE_FILE= bcast_logical(35)
-    SAVE_REGULAR_KL = bcast_logical(36)
-    PARTIAL_PHYS_DISPERSION_ONLY = bcast_logical(37)
-    UNDO_ATTENUATION = bcast_logical(38)
-    USE_LDDRK = bcast_logical(39)
-    INCREASE_CFL_FOR_LDDRK = bcast_logical(40)
-    ANISOTROPIC_KL = bcast_logical(41)
-    SAVE_TRANSVERSE_KL_ONLY = bcast_logical(42)
-    APPROXIMATE_HESS_KL = bcast_logical(43)
-    USE_FULL_TISO_MANTLE = bcast_logical(44)
-    SAVE_SOURCE_MASK = bcast_logical(45)
-    EXACT_MASS_MATRIX_FOR_ROTATION = bcast_logical(46)
-    ATTENUATION_1D_WITH_3D_STORAGE = bcast_logical(47)
-    GPU_MODE = bcast_logical(48)
-    ADIOS_ENABLED = bcast_logical(49)
-    ADIOS_FOR_FORWARD_ARRAYS = bcast_logical(50)
-    ADIOS_FOR_MPI_ARRAYS = bcast_logical(51)
-    ADIOS_FOR_ARRAYS_SOLVER = bcast_logical(52)
-    ADIOS_FOR_SOLVER_MESHFILES = bcast_logical(53)
-    ADIOS_FOR_AVS_DX = bcast_logical(54)
-    ADIOS_FOR_KERNELS = bcast_logical(55)
-    ADIOS_FOR_MODELS = bcast_logical(56)
+    OUTPUT_SEISMOS_ASDF = bcast_logical(33)
+    ROTATE_SEISMOGRAMS_RT= bcast_logical(34)
+    WRITE_SEISMOGRAMS_BY_MASTER= bcast_logical(35)
+    USE_BINARY_FOR_LARGE_FILE= bcast_logical(36)
+    SAVE_REGULAR_KL = bcast_logical(37)
+    PARTIAL_PHYS_DISPERSION_ONLY = bcast_logical(38)
+    UNDO_ATTENUATION = bcast_logical(39)
+    USE_LDDRK = bcast_logical(40)
+    INCREASE_CFL_FOR_LDDRK = bcast_logical(41)
+    ANISOTROPIC_KL = bcast_logical(42)
+    SAVE_TRANSVERSE_KL_ONLY = bcast_logical(43)
+    APPROXIMATE_HESS_KL = bcast_logical(44)
+    USE_FULL_TISO_MANTLE = bcast_logical(45)
+    SAVE_SOURCE_MASK = bcast_logical(46)
+    EXACT_MASS_MATRIX_FOR_ROTATION = bcast_logical(47)
+    ATTENUATION_1D_WITH_3D_STORAGE = bcast_logical(48)
+    GPU_MODE = bcast_logical(49)
+    ADIOS_ENABLED = bcast_logical(50)
+    ADIOS_FOR_FORWARD_ARRAYS = bcast_logical(51)
+    ADIOS_FOR_MPI_ARRAYS = bcast_logical(52)
+    ADIOS_FOR_ARRAYS_SOLVER = bcast_logical(53)
+    ADIOS_FOR_SOLVER_MESHFILES = bcast_logical(54)
+    ADIOS_FOR_AVS_DX = bcast_logical(55)
+    ADIOS_FOR_KERNELS = bcast_logical(56)
+    ADIOS_FOR_MODELS = bcast_logical(57)
 
     ! double precisions
     DT = bcast_double_precision(1)

Modified: seismo/3D/SPECFEM3D_GLOBE/trunk/src/shared/read_parameter_file.f90
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/trunk/src/shared/read_parameter_file.f90	2014-02-17 15:57:43 UTC (rev 22998)
+++ seismo/3D/SPECFEM3D_GLOBE/trunk/src/shared/read_parameter_file.f90	2014-03-04 17:22:01 UTC (rev 22999)
@@ -196,6 +196,8 @@
   if (ierr /= 0) stop 'an error occurred while reading the parameter file: OUTPUT_SEISMOS_SAC_ALPHANUM'
   call read_value_logical(OUTPUT_SEISMOS_SAC_BINARY, 'solver.OUTPUT_SEISMOS_SAC_BINARY', ierr)
   if (ierr /= 0) stop 'an error occurred while reading the parameter file: OUTPUT_SEISMOS_SAC_BINARY'
+  call read_value_logical(OUTPUT_SEISMOS_ASDF, 'solver.OUTPUT_SEISMOS_ASDF', ierr)
+  if (ierr /= 0) stop 'an error occurred while reading the parameter file: OUTPUT_ASDF'
   call read_value_logical(ROTATE_SEISMOGRAMS_RT, 'solver.ROTATE_SEISMOGRAMS_RT', ierr)
   if (ierr /= 0) stop 'an error occurred while reading the parameter file: ROTATE_SEISMOGRAMS_RT'
   call read_value_logical(WRITE_SEISMOGRAMS_BY_MASTER, 'solver.WRITE_SEISMOGRAMS_BY_MASTER', ierr)

Modified: seismo/3D/SPECFEM3D_GLOBE/trunk/src/shared/shared_par.f90
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/trunk/src/shared/shared_par.f90	2014-02-17 15:57:43 UTC (rev 22998)
+++ seismo/3D/SPECFEM3D_GLOBE/trunk/src/shared/shared_par.f90	2014-03-04 17:22:01 UTC (rev 22999)
@@ -49,6 +49,7 @@
   double precision :: RECORD_LENGTH_IN_MINUTES
   logical :: RECEIVERS_CAN_BE_BURIED,PRINT_SOURCE_TIME_FUNCTION
   logical :: OUTPUT_SEISMOS_ASCII_TEXT,OUTPUT_SEISMOS_SAC_ALPHANUM,OUTPUT_SEISMOS_SAC_BINARY, &
+             OUTPUT_SEISMOS_ASDF,&
              ROTATE_SEISMOGRAMS_RT,WRITE_SEISMOGRAMS_BY_MASTER,&
              SAVE_ALL_SEISMOS_IN_ONE_FILE,USE_BINARY_FOR_LARGE_FILE
 

Added: seismo/3D/SPECFEM3D_GLOBE/trunk/src/specfem3D/asdf_data.f90
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/trunk/src/specfem3D/asdf_data.f90	                        (rev 0)
+++ seismo/3D/SPECFEM3D_GLOBE/trunk/src/specfem3D/asdf_data.f90	2014-03-04 17:22:01 UTC (rev 22999)
@@ -0,0 +1,44 @@
+module asdf_data
+
+  type asdf_record
+    real, allocatable :: record(:)
+  end type asdf_record
+
+  type asdf_event
+    !scalars
+    character(len=13)     :: event
+    real, allocatable     :: event_lat(:), event_lo(:), event_dpt(:)
+
+    !processing info
+    real              :: min_period, max_period
+
+    !size info
+    integer           :: nrecords
+    integer           :: nreceivers
+
+    !time info
+    integer, allocatable    :: gmt_year(:), gmt_day(:), gmt_hour(:)
+    integer, allocatable    :: gmt_min(:), gmt_sec(:), gmt_msec(:)
+
+    !seismic record info
+    integer, allocatable    :: npoints(:)
+    real, allocatable       :: receiver_lat(:), receiver_lo(:)
+    real, allocatable       :: receiver_el(:),  receiver_dpt(:)
+    real, allocatable       :: begin_value(:),  end_value(:)
+    real, allocatable       :: cmp_azimuth(:),  cmp_incident_ang(:)
+    real, allocatable       :: sample_rate(:),  scale_factor(:)
+
+    real, allocatable       :: ev_to_sta_AZ(:), sta_to_ev_AZ(:)
+    real, allocatable       :: great_circle_arc(:) 
+    real, allocatable       :: dist(:)
+    real, allocatable       :: P_pick(:), S_pick(:)
+
+    character(len=20),allocatable :: receiver_name_array(:), network_array(:)
+    character(len=20),allocatable :: component_array(:), receiver_id_array(:)
+
+    !seismograms
+    type (asdf_record), allocatable :: records(:)
+
+  end type asdf_event
+
+end module asdf_data

Modified: seismo/3D/SPECFEM3D_GLOBE/trunk/src/specfem3D/rules.mk
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/trunk/src/specfem3D/rules.mk	2014-02-17 15:57:43 UTC (rev 22998)
+++ seismo/3D/SPECFEM3D_GLOBE/trunk/src/specfem3D/rules.mk	2014-03-04 17:22:01 UTC (rev 22999)
@@ -51,6 +51,7 @@
 # solver objects with statically allocated arrays; dependent upon
 # values_from_mesher.h
 specfem3D_OBJECTS += \
+	$O/asdf_data.solverstatic_module.o \
 	$O/specfem3D_par.solverstatic_module.o \
 	$O/check_stability.solverstatic.o \
 	$O/compute_add_sources.solverstatic.o \
@@ -104,6 +105,7 @@
 	$(EMPTY_MACRO)
 
 specfem3D_MODULES = \
+	$(FC_MODDIR)/asdf_data.$(FC_MODEXT) \
 	$(FC_MODDIR)/constants_solver.$(FC_MODEXT) \
 	$(FC_MODDIR)/specfem_par.$(FC_MODEXT) \
 	$(FC_MODDIR)/specfem_par_crustmantle.$(FC_MODEXT) \
@@ -203,6 +205,7 @@
 	$O/save_forward_arrays_adios.solverstatic_adios.o \
 	$O/save_kernels_adios.solverstatic_adios.o \
 	$O/write_specfem_adios_header.solverstatic_adios.o \
+	$O/write_output_ASDF.solverstatic_adios.o \
 	$(EMPTY_MACRO)
 
 adios_specfem3D_SHARED_OBJECTS = \
@@ -210,6 +213,9 @@
 	$O/adios_helpers_writers.shared_adios_module.o \
 	$O/adios_helpers.shared_adios.o \
 	$O/adios_manager.shared_adios.o \
+	$O/asdf_helpers_definitions.shared_adios_module.o \
+	$O/asdf_helpers_writers.shared_adios_module.o \
+	$O/asdf_helpers.shared_adios.o \
 	$(EMPTY_MACRO)
 
 adios_specfem3D_STUBS = \
@@ -310,6 +316,9 @@
 $O/%.solverstatic_module.o: $S/%.F90 ${OUTPUT}/values_from_mesher.h $O/shared_par.shared_module.o
 	${FCCOMPILE_CHECK} ${FCFLAGS_f90} -c -o $@ $<
 
+$O/%.solverstatic_module.o: $S/%.f90 ${OUTPUT}/values_from_mesher.h $O/shared_par.shared_module.o
+	${FCCOMPILE_CHECK} ${FCFLAGS_f90} -c -o $@ $<
+
 $O/%.solverstatic.o: $S/%.f90 ${OUTPUT}/values_from_mesher.h $O/shared_par.shared_module.o $O/specfem3D_par.solverstatic_module.o
 	${FCCOMPILE_CHECK} ${FCFLAGS_f90} -c -o $@ $<
 

Added: seismo/3D/SPECFEM3D_GLOBE/trunk/src/specfem3D/write_output_ASDF.F90
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/trunk/src/specfem3D/write_output_ASDF.F90	                        (rev 0)
+++ seismo/3D/SPECFEM3D_GLOBE/trunk/src/specfem3D/write_output_ASDF.F90	2014-03-04 17:22:01 UTC (rev 22999)
@@ -0,0 +1,813 @@
+!--------------------------------------------------------------------------------------------------------
+!> \file write_output_ASDF.F90
+!! \brief Write subroutines for writing ASDF seismograms to file using the ADIOS library
+!! \author JAS and Wenjie Lei
+!--------------------------------------------------------------------------------------------------------
+
+#include "config.fh"
+
+!> Initializes the data structure for asdf
+!! \param my_asdf The asdf data structure
+!! \param total_seismos_local The number of records on the local processer
+subroutine init_asdf_data(my_asdf,total_seismos_local)
+
+  use asdf_data
+  use specfem_par, only : event_name_SAC,myrank
+  type(asdf_event) :: my_asdf
+  integer :: total_seismos_local
+
+  my_asdf%nrecords = total_seismos_local
+  my_asdf%event = trim(event_name_SAC)
+  allocate (my_asdf%npoints(my_asdf%nrecords))
+  allocate (my_asdf%gmt_year(my_asdf%nrecords))
+  allocate (my_asdf%gmt_hour(my_asdf%nrecords))
+  allocate (my_asdf%gmt_day(my_asdf%nrecords))
+  allocate (my_asdf%gmt_min(my_asdf%nrecords))
+  allocate (my_asdf%gmt_sec(my_asdf%nrecords))
+  allocate (my_asdf%gmt_msec(my_asdf%nrecords))
+  allocate (my_asdf%event_lat(my_asdf%nrecords))
+  allocate (my_asdf%event_lo(my_asdf%nrecords))
+  allocate (my_asdf%event_dpt(my_asdf%nrecords))
+  allocate (my_asdf%receiver_lat(my_asdf%nrecords))
+  allocate (my_asdf%receiver_lo(my_asdf%nrecords))
+  allocate (my_asdf%receiver_el(my_asdf%nrecords))
+  allocate (my_asdf%receiver_dpt(my_asdf%nrecords))
+  allocate (my_asdf%begin_value(my_asdf%nrecords))
+  allocate (my_asdf%end_value(my_asdf%nrecords))
+  allocate (my_asdf%cmp_azimuth(my_asdf%nrecords))
+  allocate (my_asdf%cmp_incident_ang(my_asdf%nrecords))
+  allocate (my_asdf%sample_rate(my_asdf%nrecords))
+  allocate (my_asdf%scale_factor(my_asdf%nrecords))
+  allocate (my_asdf%ev_to_sta_AZ(my_asdf%nrecords))
+  allocate (my_asdf%sta_to_ev_AZ(my_asdf%nrecords))
+  allocate (my_asdf%great_circle_arc(my_asdf%nrecords))
+  allocate (my_asdf%dist(my_asdf%nrecords))
+  allocate (my_asdf%P_pick(my_asdf%nrecords))
+  allocate (my_asdf%S_pick(my_asdf%nrecords))
+  allocate (my_asdf%records(my_asdf%nrecords))
+  allocate (my_asdf%receiver_name_array(my_asdf%nrecords))
+  allocate (my_asdf%network_array(my_asdf%nrecords))
+  allocate (my_asdf%component_array(my_asdf%nrecords))
+  allocate (my_asdf%receiver_id_array(my_asdf%nrecords))
+
+end subroutine init_asdf_data
+
+!> Stores the records into the asdf structure
+!! \param my_asdf The asdf data structure
+!! \param seismogram_tmp The current seismogram to store
+!! \param irec_local The local index of the receivers on the local processor
+!! \param irec The global index of the receiver
+!! \param chn The broadband channel simulated
+!! \param iorientation The recorded seismogram's orientation direction
+subroutine store_asdf_data(my_asdf,seismogram_tmp,irec_local,irec,chn,iorientation)
+
+  use asdf_data
+  use specfem_par,only: &
+          station_name,network_name,stlat,stlon,stele,stbur, &
+          DT,t0, &
+          seismo_offset,seismo_current,it_end, &
+          NTSTEP_BETWEEN_OUTPUT_SEISMOS, &
+          yr=>yr_SAC,jda=>jda_SAC,ho=>ho_SAC,mi=>mi_SAC,sec=>sec_SAC, &
+          tshift_cmt=>t_cmt_SAC,t_shift=>t_shift_SAC, &
+          elat=>elat_SAC,elon=>elon_SAC,depth=>depth_SAC, &
+          event_name=>event_name_SAC,cmt_lat=>cmt_lat_SAC,cmt_lon=>cmt_lon_SAC,&
+          cmt_depth=>cmt_depth_SAC,cmt_hdur=>cmt_hdur_SAC
+
+  implicit none
+  include "constants.h"
+  character(len=4) :: chn
+  integer :: i, irec_local, irec
+  integer :: length_station_name, length_network_name
+  double precision, allocatable :: trace(:)
+  real(kind=CUSTOM_REAL),dimension(5,NTSTEP_BETWEEN_OUTPUT_SEISMOS) :: seismogram_tmp
+  real :: B
+  integer iorientation
+  integer :: adios_err
+  type(asdf_event) :: my_asdf
+
+  i = (irec_local-1)*(3) + (iorientation)
+  my_asdf%npoints(i) = seismo_current
+  my_asdf%gmt_year(i) = yr
+  my_asdf%gmt_day(i) = jda
+  my_asdf%gmt_hour(i) = ho
+  my_asdf%gmt_min(i) = mi
+  my_asdf%gmt_sec(i) = sec
+  my_asdf%gmt_msec(i) = 0
+  my_asdf%event_lat(i) = cmt_lat
+  my_asdf%event_lo(i) = cmt_lon
+  my_asdf%event_dpt(i) = cmt_depth
+  my_asdf%receiver_lat(i) = stlat(irec_local)
+  my_asdf%receiver_lo(i) = stlon(irec_local)
+  my_asdf%receiver_el(i) = stele(irec_local)
+  my_asdf%receiver_dpt(i) = stbur(irec_local)
+  my_asdf%begin_value(i) = seismo_offset*DT-t0+tshift_cmt 
+  my_asdf%end_value(i) = -12345
+  my_asdf%cmp_azimuth(i) = 0.0
+  my_asdf%cmp_incident_ang(i) = 0.0
+  my_asdf%sample_rate(i) = DT
+  my_asdf%scale_factor(i) = -12345
+  my_asdf%ev_to_sta_AZ(i) = -12345
+  my_asdf%sta_to_ev_AZ(i) = -12345
+  my_asdf%great_circle_arc(i) = -12345
+  my_asdf%dist(i) = -12345
+  my_asdf%P_pick(i) = -12345
+  my_asdf%S_pick(i) = -12345
+  length_station_name = len_trim(station_name(irec))
+  length_network_name = len_trim(network_name(irec))
+  my_asdf%receiver_name_array(i) = station_name(irec)(1:length_station_name)
+  my_asdf%network_array(i) = network_name(irec)(1:length_network_name)
+  my_asdf%component_array(i) = chn
+  my_asdf%receiver_id_array(i) = ""
+  allocate (my_asdf%records(i)%record(seismo_current))
+  my_asdf%records(i)%record(1:seismo_current) = seismogram_tmp(iorientation, 1:seismo_current)
+
+end subroutine store_asdf_data
+
+!> Closes the asdf data structure by deallocating all arrays
+!! \param my_asdf The asdf data structure
+!! \param total_seismos_local The number of seismograms on the local processor
+subroutine close_asdf_data(my_asdf, total_seismos_local)
+
+  use asdf_data
+  type(asdf_event) :: my_asdf
+  integer :: i, total_seismos_local
+
+  deallocate (my_asdf%npoints)
+  deallocate (my_asdf%gmt_year)
+  deallocate (my_asdf%gmt_hour)
+  deallocate (my_asdf%gmt_day)
+  deallocate (my_asdf%gmt_min)
+  deallocate (my_asdf%gmt_sec)
+  deallocate (my_asdf%gmt_msec)
+  deallocate (my_asdf%event_lat)
+  deallocate (my_asdf%event_lo)
+  deallocate (my_asdf%event_dpt)
+  deallocate (my_asdf%receiver_lat)
+  deallocate (my_asdf%receiver_lo)
+  deallocate (my_asdf%receiver_el)
+  deallocate (my_asdf%receiver_dpt)
+  deallocate (my_asdf%begin_value)
+  deallocate (my_asdf%end_value)
+  deallocate (my_asdf%cmp_azimuth)
+  deallocate (my_asdf%cmp_incident_ang)
+  deallocate (my_asdf%sample_rate)
+  deallocate (my_asdf%scale_factor)
+  deallocate (my_asdf%ev_to_sta_AZ)
+  deallocate (my_asdf%sta_to_ev_AZ)
+  deallocate (my_asdf%great_circle_arc)
+  deallocate (my_asdf%dist)
+  deallocate (my_asdf%P_pick)
+  deallocate (my_asdf%S_pick)
+  do i = 1, total_seismos_local
+    deallocate(my_asdf%records(i)%record)
+  enddo 
+  deallocate (my_asdf%receiver_name_array)
+  deallocate (my_asdf%network_array)
+  deallocate (my_asdf%component_array)
+  deallocate (my_asdf%receiver_id_array)
+
+end subroutine close_asdf_data
+
+!> Writes the asdf data structure to the file
+!! \param my_asdf The asdf data structure
+subroutine write_asdf(my_asdf)
+
+  use asdf_data
+  use adios_write_mod
+  use specfem_par, only : event_name_SAC,myrank
+
+  implicit none
+  integer :: adios_err, comm, ierr, sizeprocs
+  integer(kind=8) :: adios_group
+  character(len=200) :: ASDF_FN
+  type(asdf_event) :: my_asdf
+
+  call world_duplicate(comm)
+  call world_size(sizeprocs)
+
+  ! declare new group that uses MPI
+  call adios_declare_group (adios_group, "EVENTS", "iter", 1, adios_err)
+  call adios_select_method (adios_group, "MPI", "", "", adios_err)
+  
+  ASDF_FN="OUTPUT_FILES/"//trim(event_name_SAC)//"_sem.bp"
+  call write_asdf_data (ASDF_FN, my_asdf, adios_group, myrank, sizeprocs, comm, ierr)
+
+end subroutine write_asdf
+
+!> Writes the asdf data structure to asdf_fn using parallel write
+!! \param asdf_fn The file name for asdf
+!! \param my_asdf The asdf data structure
+!! \param adios_group The adios group for the file
+!! \param rank The rank of the processor
+!! \param nproc The number of processors
+!! \param comm The communication group of processors
+!! \param ierr The error for adios subroutine calls
+subroutine write_asdf_data(asdf_fn, my_asdf, adios_group, rank, nproc, comm, ierr)
+
+  use asdf_data
+  use adios_write_mod
+
+  character(len=*) :: asdf_fn
+  type(asdf_event),intent(in) :: my_asdf
+  integer :: rank, nproc, comm, ierr
+
+  integer         :: adios_err
+  integer(kind=8) :: adios_groupsize, adios_totalsize, varid
+  integer(kind=8) :: adios_handle, adios_group
+
+  !calculate size
+  adios_groupsize = 0
+  call define_asdf_data (adios_group, adios_groupsize, my_asdf,&
+                                                rank, nproc, comm, ierr)
+  call adios_open (adios_handle, "EVENTS", asdf_fn, "w", comm, adios_err)
+  call adios_group_size (adios_handle, adios_groupsize, adios_totalsize, adios_err)
+
+  !call the write sub
+  call write_asdf_data_sub (my_asdf, adios_handle, adios_group,&
+                                adios_groupsize, rank, nproc, comm, ierr)
+
+  !adios close
+  call adios_close(adios_handle, adios_err)
+
+end subroutine write_asdf_data
+
+!> Defines the asdf structure using adios
+!! \param adios_group The adios group
+!! \param my_group_size The adios group size
+!! \param my_asdf The asdf data structure
+!! \param rank The rank of the processor
+!! \param nproc The number of processors
+!! \param comm The communication group of processors
+!! \param ierr The error for adios subroutine calls
+subroutine define_asdf_data (adios_group, my_group_size, my_asdf, &
+                                         rank, nproc, comm, ierr)
+
+  use adios_write_mod
+  use asdf_helpers_mod
+  use asdf_data
+  use specfem_par,only: nrec
+  implicit none
+
+  integer(kind=8), intent(in) :: adios_group
+  integer(kind=8) :: my_group_size
+  type(asdf_event) :: my_asdf
+  integer, intent(in) :: rank, nproc, comm
+  integer :: ierr
+
+  integer :: i, nerr, string_total_length
+  integer, parameter :: STRING_COMMON_LENGTH = 20
+  integer :: adios_err, stat
+
+  integer(kind=8) :: varid
+
+  integer :: nrecords
+
+  character(len=2)             :: data_type
+  character(len=32)            :: header, record
+  character(len=6)             :: npts_string
+  character(len=10)            :: i_string
+  character(len=200)           :: command, dummy, record_path
+
+  integer :: dum_int, int_array(10)
+  real    :: dum_real, real_array(10)
+  character(len=10) :: dum_string
+
+  integer :: nrecords_total, offset
+
+  !gather info. Here, we only need nrecords_total
+  nrecords=my_asdf%nrecords
+  call gather_offset_info(nrecords,nrecords_total,offset,rank,nproc,comm,ierr)
+
+  call define_adios_local_string_1d_array (adios_group, my_group_size, &
+                                         13,"", "event", dummy)
+  !nrecords info
+  call define_adios_scalar (adios_group, my_group_size, "", "nreceivers",&
+                        dum_int)
+  call define_adios_scalar (adios_group, my_group_size, "", "nrecords",&
+                        dum_int)
+  !frequency(period) info
+  call define_adios_scalar (adios_group, my_group_size, "", "min_period", &
+                        dum_real)
+  call define_adios_scalar (adios_group, my_group_size, "", "max_period", &
+                        dum_real)
+
+  !string info
+  call define_adios_scalar (adios_group, my_group_size, "", "receiver_name_len", &
+                        dum_int)
+  call define_adios_scalar (adios_group, my_group_size, "", "network_len", &
+                        dum_int)
+  call define_adios_scalar (adios_group, my_group_size, "", "receiver_id_len", &
+                        dum_int)
+  call define_adios_scalar (adios_group, my_group_size, "", "component_len", &
+                        dum_int)
+
+  call define_adios_global_integer_1d_array (adios_group, my_group_size,&
+                   nrecords, "", "npoints", int_array)
+  call define_adios_global_integer_1d_array (adios_group, my_group_size,&
+                   nrecords, "", "gmt_year", int_array)
+  call define_adios_global_integer_1d_array (adios_group, my_group_size,&
+                   nrecords, "", "gmt_day", int_array)
+  call define_adios_global_integer_1d_array (adios_group, my_group_size,&
+                   nrecords, "", "gmt_hour", int_array)
+  call define_adios_global_integer_1d_array (adios_group, my_group_size,&
+                   nrecords, "", "gmt_min", int_array)
+  call define_adios_global_integer_1d_array (adios_group, my_group_size,&
+                   nrecords, "", "gmt_sec", int_array)
+  call define_adios_global_integer_1d_array (adios_group, my_group_size,&
+                   nrecords, "", "gmt_msec", int_array)
+
+  string_total_length = STRING_COMMON_LENGTH * nrecords_total
+  call define_adios_local_string_1d_array (adios_group, my_group_size,&
+                    string_total_length, "", "receiver_name", dum_string)
+  call define_adios_local_string_1d_array (adios_group, my_group_size,&
+                    string_total_length, "", "network", dum_string)
+  call define_adios_local_string_1d_array (adios_group, my_group_size,&
+                    string_total_length, "", "component", dum_string)
+  call define_adios_local_string_1d_array (adios_group, my_group_size,&
+                    string_total_length, "", "receiver_id", dum_string)
+
+  call define_adios_global_real_1d_array (adios_group, my_group_size, &
+                   nrecords, "", "event_lat", real_array)
+  call define_adios_global_real_1d_array (adios_group, my_group_size, &
+                   nrecords, "", "event_lo", real_array)
+  call define_adios_global_real_1d_array (adios_group, my_group_size, &
+                   nrecords, "", "event_dpt", real_array)
+  call define_adios_global_real_1d_array (adios_group, my_group_size, &
+                   nrecords, "", "receiver_lat", real_array)
+  call define_adios_global_real_1d_array (adios_group, my_group_size, &
+                   nrecords, "", "receiver_lo", real_array)
+  call define_adios_global_real_1d_array (adios_group, my_group_size, &
+                   nrecords, "", "receiver_el", real_array)
+  call define_adios_global_real_1d_array (adios_group, my_group_size, &
+                   nrecords, "", "receiver_dpt", real_array)
+  call define_adios_global_real_1d_array (adios_group, my_group_size, &
+                   nrecords, "", "begin_value", real_array)
+  call define_adios_global_real_1d_array (adios_group, my_group_size, &
+                   nrecords, "", "end_value", real_array)
+  call define_adios_global_real_1d_array (adios_group, my_group_size, &
+                   nrecords, "", "cmp_azimuth", real_array)
+  call define_adios_global_real_1d_array (adios_group, my_group_size, &
+                   nrecords, "", "cmp_incident_ang", real_array)
+  call define_adios_global_real_1d_array (adios_group, my_group_size, &
+                   nrecords, "", "sample_rate", real_array)
+  call define_adios_global_real_1d_array (adios_group, my_group_size, &
+                   nrecords, "", "scale_factor", real_array)
+  call define_adios_global_real_1d_array (adios_group, my_group_size, &
+                   nrecords, "", "ev_to_sta_AZ", real_array)
+  call define_adios_global_real_1d_array (adios_group, my_group_size, &
+                   nrecords, "", "sta_to_ev_AZ", real_array)
+  call define_adios_global_real_1d_array (adios_group, my_group_size, &
+                   nrecords, "", "great_circle_arc", real_array)
+  call define_adios_global_real_1d_array (adios_group, my_group_size, &
+                   nrecords, "", "dist", real_array)
+  call define_adios_global_real_1d_array (adios_group, my_group_size, &
+                   nrecords, "", "P_pick", real_array)
+  call define_adios_global_real_1d_array (adios_group, my_group_size, &
+                   nrecords, "", "S_pick", real_array)
+
+  !DISPLACEMENT
+  do i = 1, nrecords
+    write(i_string, '(I10)' ) i+offset
+    record=trim(my_asdf%receiver_name_array(i))//"."//&
+           trim(my_asdf%network_array(i))//"."//&
+           trim(my_asdf%component_array(i))//"."//&
+           trim(my_asdf%receiver_id_array(i))
+    call define_adios_global_real_1d_array (adios_group, my_group_size,&
+         my_asdf%npoints(i), "", trim(record), real_array)
+  enddo
+
+  !define attribute
+  call adios_define_attribute ( adios_group , "nreceivers", "desc", &
+        adios_string, "Number of receivers ", "" , adios_err )
+  call adios_define_attribute ( adios_group , "nrecords", "desc", &
+        adios_string, "Number of records ", "" , adios_err )
+  call adios_define_attribute ( adios_group , "min_period", "desc", &
+        adios_string, "Low pass filter in Hz (0 if none applied)  ", "" , adios_err )
+  call adios_define_attribute ( adios_group , "max_period", "desc", &
+        adios_string, "High pass filter in Hz (0 if none applied)  ", "" , adios_err )
+  call adios_define_attribute ( adios_group , "event_lat", "desc", adios_string, &
+        "Event CMT latitude (degrees, north positive) ", "", adios_err )
+  call adios_define_attribute ( adios_group , "event_lo", "desc", adios_string, &
+        "Event CMT longitude (degrees, east positive) ", "", adios_err )
+  call adios_define_attribute ( adios_group , "event_dpt", "desc", adios_string, &
+        "Event CMT depth (km) ", "" , adios_err )
+  call adios_define_attribute ( adios_group , "event_dpt", "desc", adios_string, &
+        "Event CMT depth (km) ", "" , adios_err )
+  call adios_define_attribute ( adios_group , "component", "desc", adios_string, &
+        "Record component ", "" , adios_err)
+  call adios_define_attribute ( adios_group, "gmt_year", "desc", adios_string, &
+        "GMT year corresponding to reference (zero) time in file. ", "" , adios_err)
+  call adios_define_attribute ( adios_group, "gmt_day", "desc", adios_string, &
+        "GMT julian day corresponding to reference (zero) time in file. ", "" , adios_err)
+  call adios_define_attribute ( adios_group, "gmt_hour", "desc", adios_string, &
+        "GMT hour corresponding to reference (zero) time in file. ", "" , adios_err)
+  call adios_define_attribute ( adios_group, "gmt_min", "desc", adios_string, &
+        "GMT minute corresponding to reference (zero) time in file. ", "" , adios_err)
+  call adios_define_attribute ( adios_group, "gmt_sec", "desc", adios_string, &
+        "GMT second corresponding to reference (zero) time in file. ", "" , adios_err)
+  call adios_define_attribute ( adios_group, "gmt_msec", "desc", adios_string, &
+        "GMT millisecond corresponding to reference (zero) time in file. ", "" , adios_err)
+  call adios_define_attribute ( adios_group , "receiver_lat", "desc", adios_string, &
+        "Receiver latitude (degrees, north positive)  ", "" , adios_err )
+  call adios_define_attribute ( adios_group , "receiver_lo", "desc", adios_string, &
+        "Receiver longitude (degrees, east positive) ", "" , adios_err )
+  call adios_define_attribute ( adios_group , "receiver_dpt", "desc", adios_string, &
+        "Receiver depth below surface (meters) ", "" , adios_err )
+  call adios_define_attribute ( adios_group , "receiver_el", "desc", adios_string, &
+        "Receiver elevation (meters) ", "" , adios_err )
+  call adios_define_attribute ( adios_group , "begin_value", "desc", adios_string, &
+        "Beginning value of time array ", "" , adios_err )
+  call adios_define_attribute ( adios_group , "end_value", "desc", adios_string, &
+        "End value of time array ", "" , adios_err )
+  call adios_define_attribute ( adios_group , "cmp_azimuth", "desc", adios_string, &
+        "Component azimuth (degrees clockwise from north) ", "", adios_err )
+  call adios_define_attribute ( adios_group , "cmp_incident_ang", "desc", adios_string,&
+        "Component incident angle (degrees from vertical) ", "", adios_err )
+  call adios_define_attribute ( adios_group , "sample_rate", "desc", adios_string, &
+        "Sampling rate (s) ", "" , adios_err )
+  call adios_define_attribute ( adios_group , "scale_factor", "desc", adios_string, &
+        "Scale factor to convert the unit of synthetics from meters to nanometer ", &
+        "" , adios_err )
+  call adios_define_attribute ( adios_group , "ev_to_sta_AZ", "desc", adios_string, &
+        "Event to station azimuth (degrees) ", "" , adios_err )
+  call adios_define_attribute ( adios_group , "sta_to_ev_AZ", "desc", adios_string, &
+        "Station to event azimuth (backazimuth, degrees) ", "", adios_err )
+  call adios_define_attribute ( adios_group , "great_circle_dist", "desc", adios_string, &
+        "Great circle distance between event and station (degrees) ", "", adios_err )
+  call adios_define_attribute ( adios_group , "receiver_name", "desc", adios_string, &
+        "Receiver name ", "" , adios_err )
+  call adios_define_attribute( adios_group , "network", "desc", adios_string, &
+        "Receiver network name ", "" , adios_err )
+  call adios_define_attribute( adios_group , "receiver_id", "desc", adios_string, &
+        "Receiver number ", "" , adios_err )
+  call adios_define_attribute ( adios_group , "component", "desc", adios_string,&
+        "Receiver component name ", "" , adios_err )
+ 
+end subroutine define_asdf_data
+
+!> Writes the asdf data structure to the adios arrays
+!! \param my_asdf The asdf data structure
+!! \param adios_handle The asdf file name
+!! \param adios_group The adios group
+!! \param adios_groupsize The adios group size
+!! \param rank The rank of the processor
+!! \param nproc The number of processors
+!! \param comm The communication group of processors
+!! \param ierr The error for adios subroutine calls
+subroutine write_asdf_data_sub (my_asdf, adios_handle, my_adios_group,&
+                        adios_groupsize, rank, nproc, comm, ierr)
+
+  use adios_write_mod
+  use asdf_data
+  use asdf_helpers_writers_mod
+  use mpi
+
+  implicit none
+  integer                       :: adios_err, i
+  integer(kind=8),intent(in)    :: my_adios_group, adios_groupsize
+  integer(kind=8),intent(in)    :: adios_handle
+  integer,intent(in)            :: rank, nproc, comm, ierr
+  integer :: nrecords_total, offset, nreceivers
+  integer :: receiver_name_len, network_len, component_len, receiver_id_len
+  integer :: rn_len_total, nw_len_total, rid_len_total, comp_len_total
+  integer :: rn_offset, nw_offset, rid_offset, comp_offset
+  character(len=32)              :: loc_string
+
+  character(len=:), allocatable :: receiver_name, network, component, receiver_id
+  character(len=:), allocatable :: receiver_name_total, network_total, &
+                                  component_total, receiver_id_total
+
+  type(asdf_event) :: my_asdf
+
+  !gather array offset info
+  call gather_offset_info(my_asdf%nrecords,nrecords_total,offset,&
+                                        rank, nproc, comm, ierr)
+
+  !ensemble the string for receiver_name, network, componen and receiver_id
+  allocate(character(len=6*my_asdf%nrecords) :: receiver_name)
+  allocate(character(len=6*my_asdf%nrecords) :: network)
+  allocate(character(len=6*my_asdf%nrecords) :: component)
+  allocate(character(len=6*my_asdf%nrecords) :: receiver_id)
+  receiver_name=''
+  network=''
+  component=''
+  receiver_id=''
+
+  do i=1, my_asdf%nrecords
+    receiver_name=trim(receiver_name)//trim(my_asdf%receiver_name_array(i))//'.'
+    network=trim(network)//trim(my_asdf%network_array(i))//'.'
+    component=trim(component)//trim(my_asdf%component_array(i))//'.'
+    receiver_id=trim(receiver_id)//trim(my_asdf%receiver_id_array(i))//'.'
+  enddo
+  receiver_name_len = len_trim(receiver_name)
+  network_len = len_trim(network)
+  component_len = len_trim(component)
+  receiver_id_len = len_trim(receiver_id)
+
+  !get global dimensions for strings
+  call gather_string_total_length(receiver_name_len, rn_len_total,&
+                                          rank, nproc, comm, ierr)
+  call gather_string_total_length(network_len, nw_len_total,&
+                                          rank, nproc, comm, ierr)
+  call gather_string_total_length(receiver_id_len, rid_len_total,&
+                                          rank, nproc, comm, ierr)
+  call gather_string_total_length(component_len, comp_len_total,&
+                                          rank, nproc, comm, ierr)
+  allocate(character(len=rn_len_total) :: receiver_name_total)
+  allocate(character(len=nw_len_total) :: network_total)
+  allocate(character(len=rid_len_total) :: receiver_id_total)
+  allocate(character(len=comp_len_total) :: component_total)
+
+  !write all local strings into global string
+  call gather_string_offset_info(receiver_name_len, rn_len_total,rn_offset, &
+                                        receiver_name, receiver_name_total,&
+                                        rank, nproc, comm, ierr)
+  call gather_string_offset_info(network_len, nw_len_total, nw_offset, &
+                                        network, network_total,&
+                                        rank, nproc, comm, ierr)
+  call gather_string_offset_info(component_len, comp_len_total, comp_offset, &
+                                        component, component_total,&
+                                        rank, nproc, comm, ierr)
+  call gather_string_offset_info(receiver_id_len, rid_len_total,rid_offset, &
+                                        receiver_id, receiver_id_total,&
+                                        rank, nproc, comm, ierr)
+  !===========================
+  !write out the string info
+  if(rank.eq.0)then
+    call adios_write(adios_handle, "receiver_name", trim(receiver_name_total),adios_err)
+    call adios_write(adios_handle, "network", trim(network_total), adios_err)
+    call adios_write(adios_handle, "component", trim(component_total), adios_err)
+    call adios_write(adios_handle, "receiver_id", trim(receiver_id_total),adios_err)
+  endif
+    deallocate(receiver_name_total)
+    deallocate(network_total)
+    deallocate(receiver_id_total)
+    deallocate(component_total)
+
+  !===========================
+  ! write seismic records
+  do i = 1, my_asdf%nrecords
+    write( loc_string, '(I10)' ) i+offset
+    loc_string=trim(my_asdf%receiver_name_array(i))//"."//&
+               trim(my_asdf%network_array(i))//"."//&
+               trim(my_asdf%component_array(i))//"."//&
+               trim(my_asdf%receiver_id_array(i))
+     call write_adios_global_1d_array(adios_handle, rank, nproc, &
+                       my_asdf%npoints(i), my_asdf%npoints(i), 0, &
+                       loc_string, my_asdf%records(i)%record)
+  enddo
+
+  !===========================
+  !scalar
+  if(rank.eq.0)then
+    call adios_write(adios_handle, "nrecords", nrecords_total, adios_err)
+    call adios_write(adios_handle, "receiver_name_len", rn_len_total, adios_err)
+    call adios_write(adios_handle, "network_len", nw_len_total, adios_err)
+    call adios_write(adios_handle, "component_len", comp_len_total, adios_err)
+    call adios_write(adios_handle, "receiver_id_len", rid_len_total, adios_err)
+    call adios_write(adios_handle, "nreceivers", nreceivers, adios_err)
+    call adios_write(adios_handle, "min_period", 0, adios_err)
+    call adios_write(adios_handle, "max_period", 0, adios_err)
+    call adios_write(adios_handle, "event", my_asdf%event, adios_err)
+  endif
+
+ !===========================
+  !write out the array
+  call write_adios_global_integer_1d_array(adios_handle, rank, nproc, my_asdf%nrecords,&
+        nrecords_total, offset, "npoints", my_asdf%npoints)
+  call write_adios_global_integer_1d_array(adios_handle, rank, nproc, my_asdf%nrecords,&
+        nrecords_total, offset, "gmt_year", my_asdf%gmt_year)
+  call write_adios_global_integer_1d_array(adios_handle, rank, nproc, my_asdf%nrecords,&
+        nrecords_total, offset, "gmt_day", my_asdf%gmt_day)
+  call write_adios_global_integer_1d_array(adios_handle, rank, nproc, my_asdf%nrecords,&
+        nrecords_total, offset, "gmt_hour", my_asdf%gmt_hour)
+  call write_adios_global_integer_1d_array(adios_handle, rank, nproc, my_asdf%nrecords,&
+        nrecords_total, offset, "gmt_min", my_asdf%gmt_min)
+  call write_adios_global_integer_1d_array(adios_handle, rank, nproc, my_asdf%nrecords,&
+        nrecords_total, offset, "gmt_sec", my_asdf%gmt_sec)
+  call write_adios_global_integer_1d_array(adios_handle, rank, nproc, my_asdf%nrecords,&
+        nrecords_total, offset, "gmt_msec", my_asdf%gmt_msec)
+  call write_adios_global_real_1d_array(adios_handle, rank, nproc, my_asdf%nrecords,&
+        nrecords_total, offset, "event_lat", my_asdf%event_lat)
+  call write_adios_global_real_1d_array(adios_handle, rank, nproc, my_asdf%nrecords,&
+        nrecords_total, offset, "event_lo", my_asdf%event_lo)
+  call write_adios_global_real_1d_array(adios_handle, rank, nproc, my_asdf%nrecords,&
+        nrecords_total, offset, "event_dpt", my_asdf%event_dpt)
+  call write_adios_global_real_1d_array(adios_handle, rank, nproc, my_asdf%nrecords,&
+        nrecords_total, offset, "receiver_lat", my_asdf%receiver_lat)
+  call write_adios_global_real_1d_array(adios_handle, rank, nproc, my_asdf%nrecords,&
+        nrecords_total, offset, "receiver_lo", my_asdf%receiver_lo)
+  call write_adios_global_real_1d_array(adios_handle, rank, nproc, my_asdf%nrecords,&
+        nrecords_total, offset, "receiver_el", my_asdf%receiver_el)
+  call write_adios_global_real_1d_array(adios_handle, rank, nproc, my_asdf%nrecords,&
+        nrecords_total, offset, "receiver_dpt", my_asdf%receiver_dpt)
+  call write_adios_global_real_1d_array(adios_handle, rank, nproc, my_asdf%nrecords,&
+        nrecords_total, offset, "begin_value", my_asdf%begin_value)
+  call write_adios_global_real_1d_array(adios_handle, rank, nproc, my_asdf%nrecords,&
+        nrecords_total, offset, "end_value", my_asdf%end_value)
+  call write_adios_global_real_1d_array(adios_handle, rank, nproc, my_asdf%nrecords,&
+        nrecords_total, offset, "cmp_azimuth", my_asdf%cmp_azimuth)
+  call write_adios_global_real_1d_array(adios_handle, rank, nproc, my_asdf%nrecords,&
+        nrecords_total, offset, "cmp_incident_ang", my_asdf%cmp_incident_ang)
+  call write_adios_global_real_1d_array(adios_handle, rank, nproc, my_asdf%nrecords,&
+        nrecords_total, offset, "sample_rate", my_asdf%sample_rate)
+  call write_adios_global_real_1d_array(adios_handle, rank, nproc, my_asdf%nrecords,&
+        nrecords_total, offset, "scale_factor", my_asdf%scale_factor)
+  call write_adios_global_real_1d_array(adios_handle, rank, nproc, my_asdf%nrecords,&
+        nrecords_total, offset, "ev_to_sta_AZ", my_asdf%ev_to_sta_AZ)
+  call write_adios_global_real_1d_array(adios_handle, rank, nproc, my_asdf%nrecords,&
+        nrecords_total, offset, "sta_to_ev_AZ", my_asdf%sta_to_ev_AZ)
+  call write_adios_global_real_1d_array(adios_handle, rank, nproc, my_asdf%nrecords,&
+        nrecords_total, offset, "great_circle_arc", my_asdf%great_circle_arc)
+  call write_adios_global_real_1d_array(adios_handle, rank, nproc, my_asdf%nrecords,&
+        nrecords_total, offset, "dist", my_asdf%dist)
+  call write_adios_global_real_1d_array(adios_handle, rank, nproc, my_asdf%nrecords,&
+        nrecords_total, offset, "P_pick", my_asdf%P_pick)
+  call write_adios_global_real_1d_array(adios_handle, rank, nproc, my_asdf%nrecords,&
+        nrecords_total, offset, "S_pick", my_asdf%S_pick)
+
+  deallocate(receiver_name)
+  deallocate(network)
+  deallocate(receiver_id)
+  deallocate(component)
+end subroutine write_asdf_data_sub
+
+!> Gets offset values for arrays
+!! \param local_dim The local dimension on the processor
+!! \param global_dim The global dimension of the array
+!! \param The offset for the processor
+!! \param rank The rank of the processor
+!! \param nproc The number of processors
+!! \param comm The communication group of processors
+!! \param ierr The error for adios subroutine calls
+subroutine gather_offset_info(local_dim, global_dim, offset,&
+                                                rank, nproc, comm, ierr)
+
+  use mpi
+  implicit none
+
+  integer :: local_dim, global_dim, offset
+  integer :: rank, nproc, comm, ierr
+
+  integer, allocatable :: local_dim_all_proc(:)
+  integer, allocatable :: offset_all_proc(:)
+  integer :: i
+
+  allocate(local_dim_all_proc(nproc))
+  allocate(offset_all_proc(nproc))
+        
+  call synchronize_all()
+  call MPI_Gather(local_dim, 1, MPI_INTEGER, local_dim_all_proc, 1, &
+                                        MPI_INTEGER, 0, comm, ierr)
+
+  if(rank.eq.0)then
+    offset_all_proc(1)=0
+    do i=2, nproc
+      offset_all_proc(i)=sum(local_dim_all_proc(1:(i-1)))
+    enddo
+    global_dim=sum(local_dim_all_proc(1:nproc))
+  endif
+
+  call MPI_Scatter(offset_all_proc, 1, MPI_INTEGER, offset, &
+                              1, MPI_INTEGER, 0, comm, ierr)
+  call MPI_Bcast(global_dim, 1, MPI_INTEGER, 0, comm, ierr)
+
+  deallocate(local_dim_all_proc)
+  deallocate(offset_all_proc)
+
+end subroutine gather_offset_info
+
+!> Gets total length of strings from each processor
+!! \param local_dim The local dimension on the processor
+!! \param global_dim The global dimension of the array
+!! \param rank The rank of the processor
+!! \param nproc The number of processors
+!! \param comm The communication group of processors
+!! \param ierr The error for adios subroutine calls
+subroutine gather_string_total_length(local_dim, global_dim,&
+                                          rank, nproc, comm, ierr)
+
+  use mpi
+  implicit none
+
+  integer :: local_dim, global_dim
+  integer :: rank, nproc, comm, ierr
+
+  integer, allocatable :: local_dim_all_proc(:)
+  integer :: i, tag, mpi_status(MPI_STATUS_SIZE)
+
+  if(rank.eq.0)then
+    allocate(local_dim_all_proc(nproc))
+  endif
+
+  call synchronize_all()
+  call MPI_Gather(local_dim, 1, MPI_INTEGER, local_dim_all_proc, 1, &
+                                        MPI_INTEGER, 0, comm, ierr)
+  call synchronize_all()
+  if(rank.eq.0)then
+    global_dim=sum(local_dim_all_proc(1:nproc))
+    deallocate(local_dim_all_proc)
+  endif
+
+end subroutine gather_string_total_length
+
+!> Gets offset values for strings
+!! \param local_dim The local dimension on the processor
+!! \param global_dim The global dimension of the array
+!! \param offset The offset for the string
+!! \param string_piece The local string
+!! \param string_total The combined string from all processors
+!! \param rank The rank of the processor
+!! \param nproc The number of processors
+!! \param comm The communication group of processors
+!! \param ierr The error
+subroutine gather_string_offset_info(local_dim, global_dim, offset,&
+                                         string_piece, string_total,&
+                                                rank, nproc, comm, ierr)
+
+  use mpi
+  implicit none
+
+  integer :: local_dim, global_dim, offset
+  character(len=*) :: string_piece, string_total
+  character(len=10000) :: buffer_string
+  integer :: rank, nproc, comm, ierr
+
+  integer, allocatable :: local_dim_all_proc(:)
+  integer, allocatable :: offset_all_proc(:)
+  integer :: i, tag, mpi_status(MPI_STATUS_SIZE)
+
+  if(rank.eq.0)then
+    allocate(local_dim_all_proc(nproc))
+    allocate(offset_all_proc(nproc))
+  endif
+
+  call synchronize_all()
+  call MPI_Gather(local_dim, 1, MPI_INTEGER, local_dim_all_proc, 1, &
+                                        MPI_INTEGER, 0, comm, ierr)
+
+  call synchronize_all()
+  if(rank.eq.0)then
+    offset_all_proc(1)=0
+    do i=2, nproc
+      offset_all_proc(i)=sum(local_dim_all_proc(1:(i-1)))
+    enddo
+    !print *, "offset_all_proc:", offset_all_proc(:)
+    string_total=''
+    buffer_string=''
+    string_total=trim(string_total)//trim(string_piece(1:local_dim))
+  endif
+        
+  !print *,"TAG1"
+  !if(rank.eq.0) then
+  !  print *,"global_dim",global_dim
+  !endif
+
+  call synchronize_all()
+  if(rank.eq.0)then
+    offset_all_proc(1)=0
+    do i=2, nproc
+      offset_all_proc(i)=sum(local_dim_all_proc(1:(i-1)))
+    enddo
+    !print *, "offset_all_proc:", offset_all_proc(:)
+    string_total=''
+    buffer_string=''
+    string_total=trim(string_total)//trim(string_piece(1:local_dim))
+  endif
+        
+  !print *,"TAG1"
+  !if(rank.eq.0) then
+  !print *,"global_dim",global_dim
+  !endif
+
+  !call synchronize_all()
+  if(rank.eq.0)then
+    do i=1,nproc-1
+      !print *, "buffer_before:",trim(buffer_string)
+      !print *, "local_dim_all_proc:",local_dim_all_proc(i+1)
+      call MPI_Recv(buffer_string, local_dim_all_proc(i+1),MPI_CHARACTER,&
+                                                        i, 1, comm, mpi_status,ierr)
+      !print *,"buffer_string:", trim(buffer_string)
+      string_total=trim(string_total)//buffer_string(1:local_dim_all_proc(i+1))
+    enddo
+  else
+   !print *, "local_dim:", local_dim
+   !print *,"string_piece:", trim(string_piece)
+   call MPI_Send(string_piece, local_dim, MPI_CHARACTER,&
+                                                        0, 1, comm, ierr)
+  endif
+  !print *,"TAG", rank
+
+  call synchronize_all()
+  call MPI_Scatter(offset_all_proc, 1, MPI_INTEGER, offset, &
+                                       1, MPI_INTEGER, 0, comm, ierr)
+  call MPI_Bcast(global_dim, 1, MPI_INTEGER, 0, comm, ierr)
+
+  !print *,"rank, local dim, global_dim,offset:", rank, local_dim, &
+  !                                               global_dim, offset
+  if (rank.eq.0) then
+    deallocate(local_dim_all_proc)
+    deallocate(offset_all_proc)
+  endif
+
+end subroutine gather_string_offset_info

Modified: seismo/3D/SPECFEM3D_GLOBE/trunk/src/specfem3D/write_seismograms.f90
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/trunk/src/specfem3D/write_seismograms.f90	2014-02-17 15:57:43 UTC (rev 22998)
+++ seismo/3D/SPECFEM3D_GLOBE/trunk/src/specfem3D/write_seismograms.f90	2014-03-04 17:22:01 UTC (rev 22999)
@@ -119,6 +119,7 @@
 ! write seismograms to files
   subroutine write_seismograms_to_file()
 
+  use asdf_data
   use constants_solver
   use specfem_par,only: &
           NPROCTOT_VAL,myrank,nrec,nrec_local, &
@@ -126,6 +127,7 @@
           islice_selected_rec, &
           seismo_offset,seismo_current, &
           OUTPUT_SEISMOS_ASCII_TEXT, &
+          OUTPUT_SEISMOS_ASDF, DT, &
           NTSTEP_BETWEEN_OUTPUT_SEISMOS, &
           SAVE_ALL_SEISMOS_IN_ONE_FILE,USE_BINARY_FOR_LARGE_FILE, &
           OUTPUT_FILES, &
@@ -137,13 +139,17 @@
   double precision :: write_time_begin,write_time
   real(kind=CUSTOM_REAL), dimension(:,:), allocatable :: one_seismogram
 
-  integer :: iproc,sender,irec_local,irec,ier,receiver
-  integer :: nrec_local_received
-  integer :: total_seismos,total_seismos_local
-  integer,dimension(:),allocatable:: islice_num_rec_local
+  integer :: iproc,sender,irec_local,iorientation,irec,ier,receiver
+  integer :: nrec_local_received, sizeprocs, offset
+  integer :: total_seismos,total_seismos_local,total_seismos_global
+  integer,dimension(:),allocatable:: islice_num_rec_local,nrecords_all
   character(len=256) :: sisname
+  character(len=4) :: chn
+  character(len=2) :: bic
   ! timing
   double precision, external :: wtime
+  ! todo: only needed for asdf output but I am passing this around
+  type(asdf_event) :: my_asdf
 
   ! allocates single station seismogram
   allocate(one_seismogram(NDIM,NTSTEP_BETWEEN_OUTPUT_SEISMOS),stat=ier)
@@ -179,8 +185,18 @@
       endif
     endif
 
+   ! todo: this initializes the asdf data structure by allocating arrays
+   if (OUTPUT_SEISMOS_ASDF) then
+      total_seismos_local = 0
+      do irec_local = 1, nrec_local
+        do iorientation = 1, 3
+          total_seismos_local=total_seismos_local+1
+        enddo
+      enddo
+      call init_asdf_data(my_asdf,total_seismos_local)
+    endif
+
     total_seismos_local = 0
-
     ! loop on all the local receivers
     do irec_local = 1,nrec_local
 
@@ -192,10 +208,18 @@
       one_seismogram = seismograms(:,irec_local,:)
 
       ! write this seismogram
-      call write_one_seismogram(one_seismogram,irec)
-
+      ! todo: my_asdf data structure is passed here which is a bit ugly
+      call write_one_seismogram(one_seismogram,irec,irec_local,my_asdf)
     enddo
 
+    ! this is wheere the asdf data structure is written to the file and
+    ! everything is deallocated
+    if (OUTPUT_SEISMOS_ASDF) then
+      call synchronize_all()
+      call write_asdf(my_asdf)
+      call close_asdf_data(my_asdf, total_seismos_local)
+    endif
+
     ! create one large file instead of one small file per station to avoid file system overload
     if(OUTPUT_SEISMOS_ASCII_TEXT .and. SAVE_ALL_SEISMOS_IN_ONE_FILE) close(IOUT)
 
@@ -342,15 +366,16 @@
 !-------------------------------------------------------------------------------------------------
 !
 
-  subroutine write_one_seismogram(one_seismogram,irec)
+  subroutine write_one_seismogram(one_seismogram,irec,irec_local,my_asdf)
 
+  use asdf_data
   use constants_solver
   use specfem_par,only: &
           myrank, &
           station_name,network_name,stlat,stlon, &
           DT, &
           seismo_current, &
-          OUTPUT_SEISMOS_ASCII_TEXT,OUTPUT_SEISMOS_SAC_ALPHANUM, &
+          OUTPUT_SEISMOS_ASCII_TEXT,OUTPUT_SEISMOS_SAC_ALPHANUM,OUTPUT_SEISMOS_ASDF,&
           OUTPUT_SEISMOS_SAC_BINARY,ROTATE_SEISMOGRAMS_RT,NTSTEP_BETWEEN_OUTPUT_SEISMOS
 
   use specfem_par,only: &
@@ -358,7 +383,7 @@
 
   implicit none
 
-  integer :: irec
+  integer :: irec,irec_local
   real(kind=CUSTOM_REAL), dimension(NDIM,NTSTEP_BETWEEN_OUTPUT_SEISMOS) :: one_seismogram
 
   ! local parameters
@@ -366,7 +391,7 @@
   integer :: iorientation,length_station_name,length_network_name
 
   character(len=4) :: chn
-  character(len=256) :: sisname,sisname_big_file
+  character(len=256) :: sisname,sisname2,sisname_big_file
   character(len=2) :: bic
 
   ! variables used for calculation of backazimuth and
@@ -376,6 +401,7 @@
   double precision :: phi
   real(kind=CUSTOM_REAL) :: cphi,sphi
   integer :: isample
+  type(asdf_event) :: my_asdf
 
   ! initializes
   seismogram_tmp(:,:) = 0.0_CUSTOM_REAL
@@ -481,6 +507,10 @@
     if(OUTPUT_SEISMOS_ASCII_TEXT) &
       call write_output_ASCII(seismogram_tmp,iorientation,sisname,sisname_big_file)
 
+    ! ASDF output format
+    if(OUTPUT_SEISMOS_ASDF) &
+      call store_asdf_data(my_asdf,seismogram_tmp,irec_local,irec,chn,iorientation)
+
   enddo ! do iorientation
 
   end subroutine write_one_seismogram



More information about the CIG-COMMITS mailing list