[cig-commits] r21513 - seismo/3D/SPECFEM3D_GLOBE/branches/SUNFLOWER_ADIOS/src/specfem3D

lefebvre at geodynamics.org lefebvre at geodynamics.org
Tue Mar 12 13:39:32 PDT 2013


Author: lefebvre
Date: 2013-03-12 13:39:31 -0700 (Tue, 12 Mar 2013)
New Revision: 21513

Added:
   seismo/3D/SPECFEM3D_GLOBE/branches/SUNFLOWER_ADIOS/src/specfem3D/adios_helpers.f90
Modified:
   seismo/3D/SPECFEM3D_GLOBE/branches/SUNFLOWER_ADIOS/src/specfem3D/Makefile.in
   seismo/3D/SPECFEM3D_GLOBE/branches/SUNFLOWER_ADIOS/src/specfem3D/write_par_header_ADIOS.F90
Log:
Helpers for easier definitions of ADIOS variables moved on a separate file.
These helpers are called by write_par_header_ADIOS (need to be cleaned).
	new file:   src/specfem3D/adios_helpers.f90
	modified:   src/specfem3D/Makefile.in
	modified:   src/specfem3D/write_par_header_ADIOS.F90

Modified: seismo/3D/SPECFEM3D_GLOBE/branches/SUNFLOWER_ADIOS/src/specfem3D/Makefile.in
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/branches/SUNFLOWER_ADIOS/src/specfem3D/Makefile.in	2013-03-12 20:39:24 UTC (rev 21512)
+++ seismo/3D/SPECFEM3D_GLOBE/branches/SUNFLOWER_ADIOS/src/specfem3D/Makefile.in	2013-03-12 20:39:31 UTC (rev 21513)
@@ -251,6 +251,7 @@
 ADIOS_OBJECTS= \
 	$O/write_par_header_ADIOS.adios.o \
 	$O/adios_manager.adios.o
+	$O/adios_helpers.adios.o
 ADIOS_STUBS = \
 	$O/write_par_header_ADIOS.noadios.o
 

Added: seismo/3D/SPECFEM3D_GLOBE/branches/SUNFLOWER_ADIOS/src/specfem3D/adios_helpers.f90
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/branches/SUNFLOWER_ADIOS/src/specfem3D/adios_helpers.f90	                        (rev 0)
+++ seismo/3D/SPECFEM3D_GLOBE/branches/SUNFLOWER_ADIOS/src/specfem3D/adios_helpers.f90	2013-03-12 20:39:31 UTC (rev 21513)
@@ -0,0 +1,186 @@
+!=====================================================================
+!
+!          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.
+!
+!=====================================================================
+
+
+!> \file adios_helpers.f90
+!! \brief Helpers to set up adios features.
+!! \author MPBL      
+
+
+!> 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 name The variable to be defined
+!! \param path The logical path structuring the data and containing
+!!             the variable 
+!! \param group_size_inc The inout adios group size to increment
+!!                       with the size of the variable
+subroutine define_adios_double_scalar (adios_group, name, path, group_size_inc)
+  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
+  ! Local Variables
+  integer(kind=8)                  :: varid ! dummy variable, adios use var name
+
+  ! adios: 6 == real(kind=8) 
+  call adios_define_var (adios_group, name, path, 6,  "", "", "", varid)
+  group_size_inc = group_size_inc + 8
+end subroutine define_adios_double_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 name The variable to be defined
+!! \param path The logical path structuring the data and containing
+!!             the variable 
+!! \param group_size_inc The inout adios group size to increment
+!!                       with the size of the variable
+subroutine define_adios_integer_scalar (adios_group, name, path, group_size_inc)
+  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
+  ! Local Variables
+  integer(kind=8)                  :: varid ! dummy variable, adios use var name
+
+  ! adios: 2 == integer(kind=4) 
+  call adios_define_var (adios_group, name, path, 2,  "", "", "", 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 name The variable to be defined
+!! \param path The logical path structuring the data and containing
+!!             the variable 
+!! \param group_size_inc The inout adios group size to increment
+!!                       with the size of the variable
+subroutine define_adios_byte_scalar (adios_group, name, path, group_size_inc)
+  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
+  ! 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, name, path, 0,  "", "", "", varid)
+  group_size_inc = group_size_inc + 1
+end subroutine define_adios_byte_scalar
+
+!> Define a local ADIOS array of integers and autoincrement the adios
+!! group size by (4 * number of elements).
+!! \param adios_group The adios group where the variables belongs
+!! \param name The variable to be defined
+!! \param path The logical path structuring the data and containing
+!!             the variable 
+!! \param dim The number of elements in the 1D array. Required to
+!!            correctly increment adios group size.
+!! \param dim_str The "stringified" version of dim. Needed by adios
+!!                to define variables
+!! \param group_size_inc The inout adios group size to increment
+!!                       with the size of the variable
+subroutine define_adios_integer_local_array1D (adios_group, name, path, dim, dim_str, group_size_inc)
+  use adios_write_mod
+  implicit none
+  ! Arguments
+  integer(kind=8),  intent(in)     :: adios_group
+  character(len=*), intent(in)     :: name, path, dim_str
+  integer(kind=8),  intent(inout)  :: group_size_inc
+  integer, intent(in)              :: dim
+  ! Local Variables
+  integer(kind=8)                  :: varid ! dummy variable, adios use var name
+
+  ! adios: 2 == integer 
+  call adios_define_var (adios_group, name, path, 2,  dim_str, "", "", varid)
+  group_size_inc = group_size_inc + 4*dim
+end subroutine define_adios_integer_local_array1D
+
+!> Define a local ADIOS array of doubles and autoincrement the adios
+!! group size by (8 * number of elements).
+!! \param adios_group The adios group where the variables belongs
+!! \param name The variable to be defined
+!! \param path The logical path structuring the data and containing
+!!             the variable 
+!! \param dim The number of elements in the 1D array. Required to
+!!            correctly increment adios group size.
+!! \param dim_str The "stringified" version of dim. Needed by adios
+!!                to define variables
+!! \param group_size_inc The inout adios group size to increment
+!!                       with the size of the variable
+subroutine define_adios_double_local_array1D (adios_group, name, path, dim, dim_str, group_size_inc)
+  use adios_write_mod
+  implicit none
+  ! Arguments
+  integer(kind=8),  intent(in)     :: adios_group
+  character(len=*), intent(in)     :: name, path, dim_str
+  integer(kind=8),  intent(inout)  :: group_size_inc
+  integer, intent(in)              :: dim
+  ! Local Variables
+  integer(kind=8)                  :: varid ! dummy variable, adios use var name
+
+  ! adios: 6 == real(kind=8) 
+  call adios_define_var (adios_group, name, path, 6, dim_str, "", "", varid)
+  group_size_inc = group_size_inc + 8*dim
+end subroutine define_adios_double_local_array1D
+
+!> Define a local ADIOS string and autoincrement the adios
+!! group size by (1 * string's length).
+!! \param adios_group The adios group where the variables belongs
+!! \param name The variable to be defined
+!! \param path The logical path structuring the data and containing
+!!             the variable 
+!! \param len The length of the string(number of character. in Fortran
+!!            it does not include a final '\0' -- null -- character)
+!! \param group_size_inc The inout adios group size to increment
+!!                       with the size of the variable
+!! \note Adios string are scalar values counting for (1) byte. It is
+!!       mandatory to increase the group size by the length of the
+!!       string in order not to overlap 'data regions'.
+subroutine define_adios_string (adios_group, name, path, length, group_size_inc)
+  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                          :: length
+  ! Local Variables
+  integer(kind=8)                  :: varid ! dummy variable, adios use var name
+  
+  ! adios: 9 == string 
+  call adios_define_var (adios_group, name, path, 9,  "", "", "", varid)
+  group_size_inc = group_size_inc + 1*length 
+end subroutine define_adios_string

Modified: seismo/3D/SPECFEM3D_GLOBE/branches/SUNFLOWER_ADIOS/src/specfem3D/write_par_header_ADIOS.F90
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/branches/SUNFLOWER_ADIOS/src/specfem3D/write_par_header_ADIOS.F90	2013-03-12 20:39:24 UTC (rev 21512)
+++ seismo/3D/SPECFEM3D_GLOBE/branches/SUNFLOWER_ADIOS/src/specfem3D/write_par_header_ADIOS.F90	2013-03-12 20:39:31 UTC (rev 21513)
@@ -432,89 +432,3 @@
 !end subroutine define_adios_header_par_file
 
 
-subroutine define_adios_double_scalar (adios_group, name, path, group_size_inc)
-  use adios_write_mod
-  implicit none
-  ! Arguments
-  integer(kind=8),  intent(in)   :: adios_group
-  character(len=*), intent(in)   :: name, path
-  integer(kind=8),  intent(out)  :: group_size_inc
-  ! Local Variables
-  integer(kind=8)                :: varid ! dummy variable, adios use var name
-
-  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
-
-subroutine define_adios_integer_scalar (adios_group, name, path, group_size_inc)
-  use adios_write_mod
-  implicit none
-  ! Arguments
-  integer(kind=8),  intent(in)   :: adios_group
-  character(len=*), intent(in)   :: name, path
-  integer(kind=8),  intent(out)  :: group_size_inc
-  ! Local Variables
-  integer(kind=8)                :: varid ! dummy variable, adios use var name
-
-  call adios_define_var (adios_group, trim(name), trim(path), 2,  "", "", "", varid)
-  group_size_inc = group_size_inc + 4
-end subroutine define_adios_integer_scalar
-
-subroutine define_adios_byte_scalar (adios_group, name, path, group_size_inc)
-  use adios_write_mod
-  implicit none
-  ! Arguments
-  integer(kind=8),  intent(in)   :: adios_group
-  character(len=*), intent(in)   :: name, path
-  integer(kind=8),  intent(out)  :: group_size_inc
-  ! Local Variables
-  integer(kind=8)                :: varid ! dummy variable, adios use var name
-
-  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
-
-subroutine define_adios_integer_local_array1D (adios_group, name, path, dim, dim_str, group_size_inc)
-  use adios_write_mod
-  implicit none
-  ! Arguments
-  integer(kind=8),  intent(in)   :: adios_group
-  character(len=*), intent(in)   :: name, path, dim_str
-  integer(kind=8),  intent(out)  :: group_size_inc
-  integer, intent(in)            :: dim
-  ! Local Variables
-  integer(kind=8)                :: varid ! dummy variable, adios use var name
-
-  call adios_define_var (adios_group, name, path, 2,  dim_str, "", "", varid)
-  group_size_inc = group_size_inc + 4*dim
-end subroutine define_adios_integer_local_array1D
-
-subroutine define_adios_double_local_array1D (adios_group, name, path, dim, dim_str, group_size_inc)
-  use adios_write_mod
-  implicit none
-  ! Arguments
-  integer(kind=8),  intent(in)   :: adios_group
-  character(len=*), intent(in)   :: name, path, dim_str
-  integer(kind=8),  intent(out)  :: group_size_inc
-  integer, intent(in)            :: dim
-  ! Local Variables
-  integer(kind=8)                :: varid ! dummy variable, adios use var name
-
-  call adios_define_var (adios_group, name, path, 6, dim_str, "", "", varid)
-  group_size_inc = group_size_inc + 8*dim
-end subroutine define_adios_double_local_array1D
-
-subroutine define_adios_string (adios_group, name, path, length, group_size_inc)
-  use adios_write_mod
-  implicit none
-  ! Arguments
-  integer(kind=8),  intent(in)   :: adios_group
-  character(len=*), intent(in)   :: name, path
-  integer(kind=8),  intent(out)  :: group_size_inc
-  integer                        :: length
-  ! Local Variables
-  integer(kind=8)                :: varid ! dummy variable, adios use var name
-
-  call adios_define_var (adios_group, name, path, 9,  "", "", "", varid)
-  group_size_inc = group_size_inc + 1*length 
-end subroutine define_adios_string



More information about the CIG-COMMITS mailing list