Index: XIOS/dev/dev_trunk_graph/arch/arch-GCC_LINUX.fcm
===================================================================
--- XIOS/dev/dev_trunk_graph/arch/arch-GCC_LINUX.fcm	(revision 2019)
+++ XIOS/dev/dev_trunk_graph/arch/arch-GCC_LINUX.fcm	(revision 2020)
@@ -7,5 +7,5 @@
 %LINKER         mpif90  
 
-%BASE_CFLAGS    -w -std=c++11
+%BASE_CFLAGS    -w -std=c++11 -D__XIOS_EXCEPTION
 %PROD_CFLAGS    -O3 -DBOOST_DISABLE_ASSERTS
 %DEV_CFLAGS     -g -O2 
Index: XIOS/dev/dev_trunk_graph/arch/arch-X64_ADA.fcm
===================================================================
--- XIOS/dev/dev_trunk_graph/arch/arch-X64_ADA.fcm	(revision 2019)
+++ XIOS/dev/dev_trunk_graph/arch/arch-X64_ADA.fcm	(revision 2020)
@@ -7,5 +7,5 @@
 %LINKER         mpiifort  -nofor-main
 
-%BASE_CFLAGS    -std=c++11 -diag-disable 1125 -diag-disable 279
+%BASE_CFLAGS    -std=c++11 -diag-disable 1125 -diag-disable 279 -D__XIOS_EXCEPTION
 %PROD_CFLAGS    -O3 -D BOOST_DISABLE_ASSERTS
 %DEV_CFLAGS     -g -traceback
Index: XIOS/dev/dev_trunk_graph/arch/arch-X64_IRENE.env
===================================================================
--- XIOS/dev/dev_trunk_graph/arch/arch-X64_IRENE.env	(revision 2019)
+++ XIOS/dev/dev_trunk_graph/arch/arch-X64_IRENE.env	(revision 2020)
@@ -1,8 +1,19 @@
-module unload netcdf-c netcdf-fortran hdf5 flavor perl hdf5 boost blitz mpi gnu
+#module unload netcdf-c netcdf-fortran hdf5 flavor perl hdf5 boost blitz mpi gnu
+#module load flavor/hdf5/parallel
+#module load netcdf-fortran/4.4.4
+#module load hdf5/1.8.20
+#module load gnu
+#module load boost
+#module load blitz
+#module load feature/bridge/heterogenous_mpmd
+
+module purge
+module load flavor/buildcompiler/intel/20
+module load mpi/openmpi/4.0.2
+
 module load flavor/hdf5/parallel
 module load netcdf-fortran/4.4.4
 module load hdf5/1.8.20
 module load gnu
-module load boost
-module load blitz
-module load feature/bridge/heterogenous_mpmd
+
+module load totalview
Index: XIOS/dev/dev_trunk_graph/arch/arch-X64_IRENE.fcm
===================================================================
--- XIOS/dev/dev_trunk_graph/arch/arch-X64_IRENE.fcm	(revision 2019)
+++ XIOS/dev/dev_trunk_graph/arch/arch-X64_IRENE.fcm	(revision 2020)
@@ -7,9 +7,9 @@
 %LINKER         mpif90  -nofor-main
 
-%BASE_CFLAGS    -std=c++11 -diag-disable 1125 -diag-disable 279
+%BASE_CFLAGS    -std=c++11 -diag-disable 1125 -diag-disable 279 -D__XIOS_EXCEPTION
 %PROD_CFLAGS    -O3 -D BOOST_DISABLE_ASSERTS
 #%DEV_CFLAGS     -g -traceback
 %DEV_CFLAGS     -g 
-%DEBUG_CFLAGS   -DBZ_DEBUG -g -traceback -fno-inline -D__XIOS_EXCEPTION
+%DEBUG_CFLAGS   -DBZ_DEBUG -g -traceback -fno-inline
 
 %BASE_FFLAGS    -D__NONE__ 
Index: XIOS/dev/dev_trunk_graph/arch/arch-ifort_CICLAD.path
===================================================================
--- XIOS/dev/dev_trunk_graph/arch/arch-ifort_CICLAD.path	(revision 2019)
+++ XIOS/dev/dev_trunk_graph/arch/arch-ifort_CICLAD.path	(revision 2020)
@@ -2,4 +2,7 @@
 NETCDF_LIBDIR="-L/opt/netcdf42/ifort/lib"
 NETCDF_LIB="-lnetcdf"
+MPI_INCDIR=""
+MPI_LIBDIR=""
+MPI_LIB=""
 HDF5_INCDIR=""
 HDF5_LIBDIR=""
Index: XIOS/dev/dev_trunk_graph/arch/arch-ifort_LSCE.fcm
===================================================================
--- XIOS/dev/dev_trunk_graph/arch/arch-ifort_LSCE.fcm	(revision 2019)
+++ XIOS/dev/dev_trunk_graph/arch/arch-ifort_LSCE.fcm	(revision 2020)
@@ -5,6 +5,6 @@
 %BASE_CFLAGS
 %PROD_CFLAGS    -O3 -D BOOST_DISABLE_ASSERTS
-%DEV_CFLAGS     -g -traceback
-%DEBUG_CFLAGS   -DBZ_DEBUG -g -traceback -fno-inline
+%DEV_CFLAGS     -g
+%DEBUG_CFLAGS   -DBZ_DEBUG -g -fno-inline
 
 %BASE_FFLAGS    -D__NONE__
Index: XIOS/dev/dev_trunk_graph/bld.cfg
===================================================================
--- XIOS/dev/dev_trunk_graph/bld.cfg	(revision 2019)
+++ XIOS/dev/dev_trunk_graph/bld.cfg	(revision 2020)
@@ -22,20 +22,25 @@
 # each source subfolder should be declared individually
 search_src           false
-src::xios                               $PWD/src
-src::xios::config                       $PWD/src/config
-src::xios::date                         $PWD/src/date
-src::xios::filter                       $PWD/src/filter
-src::xios::functor                      $PWD/src/functor
-src::xios::interface::c                 $PWD/src/interface/c
-src::xios::interface::c_attr            $PWD/src/interface/c_attr
-src::xios::interface::fortran           $PWD/src/interface/fortran
-src::xios::interface::fortran_attr      $PWD/src/interface/fortran_attr
-src::xios::io                           $PWD/src/io
-src::xios::node                         $PWD/src/node
-src::xios::parse_expr                   $PWD/src/parse_expr
-src::xios::test                         $PWD/src/test
-src::xios::transformation               $PWD/src/transformation
-src::xios::transformation::Functions    $PWD/src/transformation/Functions
-src::xios::type                         $PWD/src/type
+src::xios                                    $PWD/src
+src::xios::config                            $PWD/src/config
+src::xios::date                              $PWD/src/date
+src::xios::filter                            $PWD/src/filter
+src::xios::functor                           $PWD/src/functor
+src::xios::interface::c                      $PWD/src/interface/c
+src::xios::interface::c_attr                 $PWD/src/interface/c_attr
+src::xios::interface::fortran                $PWD/src/interface/fortran
+src::xios::interface::fortran_attr           $PWD/src/interface/fortran_attr
+src::xios::io                                $PWD/src/io
+src::xios::node                              $PWD/src/node
+src::xios::parse_expr                        $PWD/src/parse_expr
+src::xios::test                              $PWD/src/test
+src::xios::transformation                    $PWD/src/transformation
+src::xios::transformation::Functions         $PWD/src/transformation/Functions
+src::xios::transformation::axis_algorithm    $PWD/src/transformation/axis_algorithm
+src::xios::transformation::domain_algorithm  $PWD/src/transformation/domain_algorithm
+src::xios::transformation::scalar_algorithm  $PWD/src/transformation/scalar_algorithm
+src::xios::type                              $PWD/src/type
+src::xios::manager                           $PWD/src/manager
+src::xios::distribution                      $PWD/src/distribution
 
 src::netcdf $PWD/extern/netcdf4
@@ -50,7 +55,7 @@
 #bld::target test_xios2_cmip6.exe
 #bld::target test_new_features.exe test_unstruct_complete.exe 
-bld::target test_remap.exe
-bld::target test_complete.exe
-bld::target test_client.exe
+#bld::target test_remap.exe
+#bld::target test_complete.exe
+#bld::target test_client.exe
 #bld::target test_unstruct_complete.exe
 #bld::target test_unstructured.exe
Index: XIOS/dev/dev_trunk_graph/doc/XIOS_reference_guide.lyx
===================================================================
--- XIOS/dev/dev_trunk_graph/doc/XIOS_reference_guide.lyx	(revision 2019)
+++ XIOS/dev/dev_trunk_graph/doc/XIOS_reference_guide.lyx	(revision 2020)
@@ -10,5 +10,5 @@
 \maintain_unincluded_children false
 \language english
-\language_package default
+\language_package auto
 \inputencoding auto
 \fontencoding global
@@ -99,5 +99,5 @@
 
 \begin_layout Plain Layout
-enumeration { Gregorian, Julian, D360, AllLeap, NoLeap, user_defined }
+enumeration {Gregorian, Julian, D360, AllLeap, NoLeap, user_defined}
 \end_layout
 
@@ -272,6 +272,6 @@
 
 \begin_layout Standard
-Define the time origin of the time axis.
- It will appear as metadata attached to the time axis in the output file.
+Define the time origin of a time axis.
+ It will appear as metadata attached to the time axis in an output file.
  This attribute is optional, the default value is 
 \begin_inset Flex Emph
@@ -441,5 +441,5 @@
 
 \begin_layout Standard
-Define the duration of a day, in seconds, when using a custom calendar.
+Define the duration of a day in seconds when using a custom calendar.
  This attribute is mandatory if the calendar 
 \series bold
@@ -677,5 +677,5 @@
 \series default
  attribute is used, otherwise it must not be defined.
- The default behaviour is not to have any leap year.
+ The default behavior is not to have any leap year.
  If defined, this attribute must comply with the following constraint: 
 \begin_inset Formula $1\leq leap\_year\_month\leq size(month\_lengths)$
@@ -758,5 +758,5 @@
 \series default
  attribute is used, otherwise it must not be defined.
- The default behaviour is not to have any leap year, i.e.
+ The default behavior is not to have any leap year, i.e.
  the default value is 
 \begin_inset Formula $\mathbf{0}$
@@ -886,9 +886,405 @@
 
 \begin_layout Section
+Scalar attribute reference
+\end_layout
+
+\begin_layout Subsection*
+name (optional): 
+\begin_inset Flex Emph
+status collapsed
+
+\begin_layout Plain Layout
+string
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+Fortran: 
+\end_layout
+
+\begin_layout LyX-Code
+CHARACTER(LEN=*) :: name
+\end_layout
+
+\begin_layout Standard
+Defines the name of a scalar as it will appear in a file.
+ If not defined, the name will be generated automatically based on the id.
+ If multiple scalars are defined in the same file, each scalar must have
+ a unique name.
+ 
+\end_layout
+
+\begin_layout Subsection*
+standard_name (optional): 
+\begin_inset Flex Emph
+status collapsed
+
+\begin_layout Plain Layout
+string
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+Fortran: 
+\end_layout
+
+\begin_layout LyX-Code
+CHARACTER(LEN=*) :: standard_name
+\end_layout
+
+\begin_layout Standard
+Defines the standard name of a scalar as it will appear in the scalar's
+ metadata in an output file.
+ 
+\end_layout
+
+\begin_layout Subsection*
+long_name (optional): 
+\begin_inset Flex Emph
+status collapsed
+
+\begin_layout Plain Layout
+string
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+Fortran: 
+\end_layout
+
+\begin_layout LyX-Code
+CHARACTER(LEN=*) :: long_name
+\end_layout
+
+\begin_layout Standard
+Defines the long name of a scalar as it will appear in the scalar's metadata
+ in an output file.
+ 
+\end_layout
+
+\begin_layout Subsection*
+unit (optional): 
+\begin_inset Flex Emph
+status collapsed
+
+\begin_layout Plain Layout
+string
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+Fortran: 
+\end_layout
+
+\begin_layout LyX-Code
+CHARACTER(LEN=*) :: unit
+\end_layout
+
+\begin_layout Standard
+Defines the scalar unit as it will appear in the scalar's metadata in an
+ output file.
+\end_layout
+
+\begin_layout Subsection*
+value (optional): 
+\begin_inset Flex Emph
+status collapsed
+
+\begin_layout Plain Layout
+double
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+Fortran:
+\end_layout
+
+\begin_layout LyX-Code
+DOUBLE PRECISION :: value
+\end_layout
+
+\begin_layout Standard
+Defines the value of a scalar.
+ If both, the label and the value, are set then only the label will be written
+ into a file.
+\end_layout
+
+\begin_layout Subsection*
+bounds (optional): 
+\begin_inset Flex Emph
+status collapsed
+
+\begin_layout Plain Layout
+1D-array of double
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+Fortran:
+\end_layout
+
+\begin_layout LyX-Code
+DOUBLE PRECISION :: bounds(:)
+\end_layout
+
+\begin_layout Standard
+Defines (two) scalar boundaries.
+ The array size must should be equal to 2.
+\end_layout
+
+\begin_layout Subsection*
+bounds_name (optional): 
+\begin_inset Flex Emph
+status collapsed
+
+\begin_layout Plain Layout
+string
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+Fortran: 
+\end_layout
+
+\begin_layout LyX-Code
+CHARACTER(LEN=*) :: bounds_name
+\end_layout
+
+\begin_layout Standard
+Defines the name of scalar bounds as it will appear in a file.
+ If not defined, the name will be generated automatically based on the scalar
+ id.
+\end_layout
+
+\begin_layout Subsection*
+prec (optional): 
+\emph on
+integer
+\end_layout
+
+\begin_layout Standard
+Fortran:
+\end_layout
+
+\begin_layout LyX-Code
+INTEGER :: prec
+\end_layout
+
+\begin_layout Standard
+Defines the precision in bytes of scalar value and boundaries as it will
+ be written into an output file.
+ Available values are: 2 (integer), 4 (float single precision) and 8 (float
+ double precision).
+ The default value is 8.
+\end_layout
+
+\begin_layout Subsection*
+label (optional): 
+\begin_inset Flex Emph
+status collapsed
+
+\begin_layout Plain Layout
+string
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+Fortran: 
+\end_layout
+
+\begin_layout LyX-Code
+CHARACTER(LEN=*) :: label
+\end_layout
+
+\begin_layout Standard
+Defines the label of a scalar.
+ If both, the label and the value, are set then only the label will be output
+ into a file.
+\end_layout
+
+\begin_layout Subsection*
+scalar_ref (optional): string
+\end_layout
+
+\begin_layout Standard
+Fortran:
+\end_layout
+
+\begin_layout LyX-Code
+CHARACTER(LEN=*) :: scalar_ref
+\end_layout
+
+\begin_layout Standard
+Defines the reference to a scalar.
+ All attributes will be inherited from the referenced scalar via the classical
+ inheritance mechanism.
+ The value assigned to the referenced scalar will be transmitted to the
+ current scalar.
+\end_layout
+
+\begin_layout Subsection*
+positive (optional): 
+\begin_inset Flex Emph
+status collapsed
+
+\begin_layout Plain Layout
+enumeration {up, down}
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+Fortran:
+\end_layout
+
+\begin_layout LyX-Code
+CHARACTER(LEN=*) :: positive
+\end_layout
+
+\begin_layout Standard
+Defines the positive direction for fields representing height or depth.
+\end_layout
+
+\begin_layout Subsection*
+axis_type (optional): 
+\begin_inset Flex Emph
+status collapsed
+
+\begin_layout Plain Layout
+enumeration {X, Y, Z, T}
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+Fortran:
+\end_layout
+
+\begin_layout LyX-Code
+CHARACTER(LEN=*) :: axis_type
+\end_layout
+
+\begin_layout Standard
+Defines the type of a (scalar) axis.
+ The values correspond to the following axis types:
+\end_layout
+
+\begin_layout Itemize
+
+\series bold
+\shape italic
+X:
+\series default
+\shape default
+ longitude
+\end_layout
+
+\begin_layout Itemize
+
+\series bold
+\shape italic
+\emph on
+Y
+\emph default
+:
+\series default
+\shape default
+ latitude
+\end_layout
+
+\begin_layout Itemize
+
+\series bold
+\shape italic
+\emph on
+Z
+\emph default
+:
+\series default
+\shape default
+ vertical axis
+\end_layout
+
+\begin_layout Itemize
+
+\series bold
+\shape italic
+T: 
+\series default
+\shape default
+time axis.
+\end_layout
+
+\begin_layout Subsection*
+comment: 
+\begin_inset Flex Emph
+status collapsed
+
+\begin_layout Plain Layout
+string
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+Fortran: 
+\end_layout
+
+\begin_layout LyX-Code
+CHARACTER(LEN=*) :: comment
+\end_layout
+
+\begin_layout Standard
+Allows a user to set a comment.
+ 
+\end_layout
+
+\begin_layout Section
 Axis attribute reference
 \end_layout
 
 \begin_layout Subsection*
-name: 
+name (optional): 
 \begin_inset Flex Emph
 status collapsed
@@ -912,13 +1308,14 @@
 
 \begin_layout Standard
-Define the name of the vertical axis, as it will appear in a file.
- If not defined, a name is self generated from the id.
- If multiple vertical axis are defined in a same file, each name must be
- different.
+Defines the name of a vertical axis as it will appear in an output file.
+ If not defined, the name will be generated automatically based on the axis
+ id.
+ If multiple vertical axes are defined in the same file, each axis must
+ have a unique name.
  
 \end_layout
 
 \begin_layout Subsection*
-standard_name: 
+standard_name (optional): 
 \begin_inset Flex Emph
 status collapsed
@@ -942,11 +1339,11 @@
 
 \begin_layout Standard
-Define the standard name of the vertical axis, as it will appear in the
- metadata attached to the axis of the output file.
+Defines the standard name of a vertical axis as it will appear in the axis'
+ metadata in an output file.
  
 \end_layout
 
 \begin_layout Subsection*
-long_name: 
+long_name (optional): 
 \begin_inset Flex Emph
 status collapsed
@@ -970,11 +1367,11 @@
 
 \begin_layout Standard
-Define the long name of the vertical axis, as it will appear in the metadata
- attached to the axis of the output file.
+Defines the long name of a vertical axis as it will appear in the axis'
+ metadata in an output file.
  
 \end_layout
 
 \begin_layout Subsection*
-unit: 
+unit (optional): 
 \begin_inset Flex Emph
 status collapsed
@@ -998,14 +1395,167 @@
 
 \begin_layout Standard
-Define the unit of the axis as it will appear in the metadata attached to
- the axis in the output file.
-\end_layout
-
-\begin_layout Subsection*
-n_glo: 
+Defines the unit of an axis as it will appear in the axis' metadata in an
+ output file.
+\end_layout
+
+\begin_layout Subsection*
+dim_name (optional): 
 \begin_inset Flex Emph
 status collapsed
 
 \begin_layout Plain Layout
+string
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+Fortran: 
+\end_layout
+
+\begin_layout LyX-Code
+CHARACTER(LEN=*) :: dim_name
+\end_layout
+
+\begin_layout Standard
+Defines the name of axis dimension as it will appear in the file's metadata.
+\end_layout
+
+\begin_layout Subsection*
+formula (optional): 
+\begin_inset Flex Emph
+status collapsed
+
+\begin_layout Plain Layout
+string
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+Fortran: 
+\end_layout
+
+\begin_layout LyX-Code
+CHARACTER(LEN=*) :: formula
+\end_layout
+
+\begin_layout Standard
+Adds the formula attribute to a parametric vertical axis.
+\end_layout
+
+\begin_layout Subsection*
+formula_term (optional): 
+\begin_inset Flex Emph
+status collapsed
+
+\begin_layout Plain Layout
+string
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+Fortran: 
+\end_layout
+
+\begin_layout LyX-Code
+CHARACTER(LEN=*) :: formula_term
+\end_layout
+
+\begin_layout Standard
+Adds the formula terms attribute to a parametric vertical axis.
+\end_layout
+
+\begin_layout Subsection*
+formula_bounds (optional): 
+\begin_inset Flex Emph
+status collapsed
+
+\begin_layout Plain Layout
+string
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+Fortran: 
+\end_layout
+
+\begin_layout LyX-Code
+CHARACTER(LEN=*) :: formula_bounds
+\end_layout
+
+\begin_layout Standard
+Adds the formula attribute to the bounds of a parametric vertical axis.
+ The attribute is mandatory if the 
+\begin_inset Flex Strong
+status collapsed
+
+\begin_layout Plain Layout
+formula
+\end_layout
+
+\end_inset
+
+ attribute is defined for the axis.
+\end_layout
+
+\begin_layout Subsection*
+formula_term_bounds (optional): 
+\begin_inset Flex Emph
+status collapsed
+
+\begin_layout Plain Layout
+string
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+Fortran: 
+\end_layout
+
+\begin_layout LyX-Code
+CHARACTER(LEN=*) :: formula_term_bounds
+\end_layout
+
+\begin_layout Standard
+Adds the formula terms attribute to the bounds of a parametric vertical
+ axis.
+ The attribute is mandatory if the 
+\begin_inset Flex Strong
+status collapsed
+
+\begin_layout Plain Layout
+formula
+\end_layout
+
+\end_inset
+
+ attribute is defined for the axis.
+\end_layout
+
+\begin_layout Subsection*
+n_glo (mandatory): 
+\begin_inset Flex Emph
+status collapsed
+
+\begin_layout Plain Layout
 integer
 \end_layout
@@ -1025,10 +1575,9 @@
 
 \begin_layout Standard
-Define the global size of the axis.
- This attribute is mandatory.
-\end_layout
-
-\begin_layout Subsection*
-begin: 
+Defines the global size of an axis.
+\end_layout
+
+\begin_layout Subsection*
+begin (optional): 
 \begin_inset Flex Emph
 status collapsed
@@ -1052,7 +1601,6 @@
 
 \begin_layout Standard
-Define the the beginning index of the local domain.
- This attribute is optional.
- This must be an index between 0 and 
+Defines the beginning index of the local domain.
+ It can take value between 0 and 
 \begin_inset Flex Strong
 status collapsed
@@ -1069,5 +1617,5 @@
 
 \begin_layout Subsection*
-n: 
+n (optional): 
 \begin_inset Flex Emph
 status collapsed
@@ -1091,7 +1639,6 @@
 
 \begin_layout Standard
-Define the the local size of the axis.
- This attribute is optional.
- This must be an integer between 1 and 
+Defines the local size of an axis.
+ It can take value between 0 and 
 \begin_inset Flex Strong
 status collapsed
@@ -1115,9 +1662,21 @@
 
 .
- 
-\end_layout
-
-\begin_layout Subsection*
-value: 
+ Local axis decomposition can be declared either with attributes 
+\series bold
+\shape italic
+{n, begin}
+\series default
+\shape default
+ or with 
+\series bold
+\shape italic
+index
+\series default
+\shape default
+.
+\end_layout
+
+\begin_layout Subsection*
+index (optional): 
 \begin_inset Flex Emph
 status collapsed
@@ -1137,26 +1696,65 @@
 
 \begin_layout LyX-Code
+DOUBLE PRECISION :: index(:)
+\end_layout
+
+\begin_layout Standard
+Defines the global indexes of a local axis held by each process.
+ If the attribute is specified, its array size must be equal to 
+\begin_inset Flex Strong
+status collapsed
+
+\begin_layout Plain Layout
+n
+\end_layout
+
+\end_inset
+
+.
+ Local axis decomposition can be declared either with attributes 
+\series bold
+\shape italic
+{n, begin}
+\series default
+\shape default
+ or with 
+\series bold
+\shape italic
+index
+\series default
+\shape default
+.
+\end_layout
+
+\begin_layout Subsection*
+value (optional): 
+\begin_inset Flex Emph
+status collapsed
+
+\begin_layout Plain Layout
+1D-array of double
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+Fortran:
+\end_layout
+
+\begin_layout LyX-Code
 DOUBLE PRECISION :: value(:)
 \end_layout
 
 \begin_layout Standard
-Define the value of each level of a vertical axis.
- The size of the array must be equal to the 
-\begin_inset Flex Strong
-status collapsed
-
-\begin_layout Plain Layout
-size
-\end_layout
-
-\end_inset
-
- attribute.
- If not defined the default values are filled with values from 1 to 
-\begin_inset Flex Strong
-status collapsed
-
-\begin_layout Plain Layout
-size
+Defines the value of each level of a vertical axis.
+ The array size must be equal to the value of the attribute 
+\begin_inset Flex Strong
+status collapsed
+
+\begin_layout Plain Layout
+n
 \end_layout
 
@@ -1164,8 +1762,10 @@
 
 .
-\end_layout
-
-\begin_layout Subsection*
-bounds: 
+ If the label is provided then only the label will be written into a file
+ and not the axis value and the axis boundaries.
+\end_layout
+
+\begin_layout Subsection*
+bounds (optional): 
 \begin_inset Flex Emph
 status collapsed
@@ -1185,9 +1785,9 @@
 
 \begin_layout LyX-Code
-DOUBLE PRECISION :: value(:,:)
-\end_layout
-
-\begin_layout Standard
-Define the boundaries of each level of a the vertical axis.
+DOUBLE PRECISION :: bounds(:,:)
+\end_layout
+
+\begin_layout Standard
+Defines the boundaries of each level of a vertical axis.
  The dimensions of the array must be 
 \begin_inset Formula $2\times n$
@@ -1198,5 +1798,94 @@
 
 \begin_layout Subsection*
-data_begin:
+bounds_name (optional): 
+\begin_inset Flex Emph
+status collapsed
+
+\begin_layout Plain Layout
+string
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+Fortran: 
+\end_layout
+
+\begin_layout LyX-Code
+CHARACTER(LEN=*) :: bounds_name
+\end_layout
+
+\begin_layout Standard
+Defines the name of axis boundaries as it will appear in a file.
+ If not defined, the name will be generated automatically based on the axis
+ id.
+\end_layout
+
+\begin_layout Subsection*
+prec (optional): 
+\emph on
+integer
+\end_layout
+
+\begin_layout Standard
+Fortran:
+\end_layout
+
+\begin_layout LyX-Code
+INTEGER :: prec
+\end_layout
+
+\begin_layout Standard
+Defines the precision in bytes of axis value and boundaries as it will be
+ written into an output file.
+ Available values are: 2 (integer), 4 (float single precision) and 8 (float
+ double precision).
+ The default value is 8.
+\end_layout
+
+\begin_layout Subsection*
+label (optional): 
+\begin_inset Flex Emph
+status collapsed
+
+\begin_layout Plain Layout
+string
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+Fortran: 
+\end_layout
+
+\begin_layout LyX-Code
+CHARACTER, ALLOCATABLE :: label(:)
+\end_layout
+
+\begin_layout Standard
+Defines the label of an axis.
+ The size of the array must be equal to the value of the attribute 
+\begin_inset Flex Strong
+status collapsed
+
+\begin_layout Plain Layout
+n
+\end_layout
+
+\end_inset
+
+.
+ If the label is provided then only the label will be written into a file
+ and not the axis value and the axis boundaries.
+\end_layout
+
+\begin_layout Subsection*
+data_begin (optional):
 \emph on
  integer
@@ -1212,6 +1901,6 @@
 
 \begin_layout Standard
-Define the beginning index of the field data for the axis.
- This attribute is an offset regarding the local axis, so the value can
+Defines the beginning index of local field data owned by each process.
+ The attribute is an offset relative to the local axis, so the value can
  be negative.
  A negative value indicates that only some valid part of the data will extracted
@@ -1219,7 +1908,7 @@
  A positive value indicates that the local domain is greater than the data
  stored in memory.
- A 0-value means that the local domain matches the data in memory.
- This attribute is optional and the default value is 0.
- Otherwise 
+ The 0-value means that the local domain matches the data in memory.
+ The default value is 0.
+ The attributes 
 \begin_inset Flex Strong
 status collapsed
@@ -1245,5 +1934,5 @@
 
 \begin_layout Subsection*
-data_n: 
+data_n (optional): 
 \emph on
 integer
@@ -1259,6 +1948,7 @@
 
 \begin_layout Standard
-Define the size of the field data for the first axis.
- This attribute is optional and the default value is 
+Defines the size of local field data.
+ The attribute can take value starting from 0 (no data on a process).
+ The default value is 
 \begin_inset Flex Strong
 status collapsed
@@ -1271,5 +1961,5 @@
 
 .
- Otherwise 
+ The attributes 
 \begin_inset Flex Strong
 status collapsed
@@ -1295,5 +1985,5 @@
 
 \begin_layout Subsection*
-data_index: 
+data_index (optional): 
 \emph on
 integer
@@ -1309,10 +1999,53 @@
 
 \begin_layout Standard
-In case of a compressed vertical axis, this attribute define the number
- of points stored in memory on the local axis.
-\end_layout
-
-\begin_layout Subsection*
-mask: 
+In case of a compressed vertical axis, the attribute defines the position
+ of data points stored in the memory.
+ The array size has to be equal to 
+\begin_inset Flex Strong
+status collapsed
+
+\begin_layout Plain Layout
+data_n
+\end_layout
+
+\end_inset
+
+.
+ For example, for a local axis of size 
+\begin_inset Flex Strong
+status collapsed
+
+\begin_layout Plain Layout
+n=3
+\end_layout
+
+\end_inset
+
+ and local data size of 
+\begin_inset Flex Strong
+status collapsed
+
+\begin_layout Plain Layout
+data_n=5
+\end_layout
+
+\end_inset
+
+, if 
+\begin_inset Flex Strong
+status collapsed
+
+\begin_layout Plain Layout
+data_index=(/ -1, 2, 1, 0, -1 /)
+\end_layout
+
+\end_inset
+
+ then the first and the last data points are ghosts and only the three middle
+ values will be written in the reversed order.
+\end_layout
+
+\begin_layout Subsection*
+mask (optional): 
 \emph on
 1D-array of bool
@@ -1328,5 +2061,5 @@
 
 \begin_layout Standard
-Define the mask of the local axis.
+Defines the mask of the local axis.
  The masked value will be replaced by the value of the field attribute 
 \begin_inset Flex Strong
@@ -1339,9 +2072,9 @@
 \end_inset
 
- in the output file.
-\end_layout
-
-\begin_layout Subsection*
-n_distributed_partition: 
+ in an output file.
+\end_layout
+
+\begin_layout Subsection*
+n_distributed_partition (optional): 
 \emph on
 integer
@@ -1357,6 +2090,7 @@
 
 \begin_layout Standard
-Define the number of local axis in case axis is auto-generated.
- This attribute is optional and the default value is 
+Defines the number of local axes in case if the axis is generated automatically
+ by XIOS.
+ The default value is 
 \begin_inset Flex Strong
 status collapsed
@@ -1372,10 +2106,30 @@
 
 \begin_layout Subsection*
-positive: 
+axis_ref (optional): string
+\end_layout
+
+\begin_layout Standard
+Fortran:
+\end_layout
+
+\begin_layout LyX-Code
+CHARACTER(LEN=*) :: axis_ref
+\end_layout
+
+\begin_layout Standard
+Defines the reference of an axis.
+ All attributes will be inherited from the referenced axis with the classical
+ inheritance mechanism.
+ The value assigned to the referenced axis will be transmitted to the current
+ axis.
+\end_layout
+
+\begin_layout Subsection*
+positive (optional): 
 \begin_inset Flex Emph
 status collapsed
 
 \begin_layout Plain Layout
-enumeration { up, down }
+enumeration {up, down}
 \end_layout
 
@@ -1394,63 +2148,105 @@
 
 \begin_layout Standard
-Define the direction of vertical axis.
-\end_layout
-
-\begin_layout Subsection*
-axis_ref: string
-\end_layout
-
-\begin_layout Standard
-Fortran:
-\end_layout
-
-\begin_layout LyX-Code
-CHARACTER(LEN=*) :: axis_ref
-\end_layout
-
-\begin_layout Standard
-Define the reference of the axis.
- All attributes are inherited from the referenced axis with the classical
- inheritance mechanism.
- The value assigned to the referenced axis is transmitted to to current
- axis.
- This attribute is optional.
-\end_layout
-
-\begin_layout Subsection*
-index: 
+Defines the positive direction for fields representing height or depth.
+\end_layout
+
+\begin_layout Subsection*
+axis_type (optional): 
 \begin_inset Flex Emph
 status collapsed
 
 \begin_layout Plain Layout
-1D-array of double
-\end_layout
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Standard
-Fortran:
-\end_layout
-
-\begin_layout LyX-Code
-DOUBLE PRECISION :: index(:)
-\end_layout
-
-\begin_layout Standard
-Define the global index of axis which the local axis holds.
- This attribute is optional and the size of the array is equal to 
-\begin_inset Flex Strong
-status collapsed
-
-\begin_layout Plain Layout
-n
-\end_layout
-
-\end_inset
-
-.
+enumeration {X, Y, Z, T}
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+Fortran:
+\end_layout
+
+\begin_layout LyX-Code
+CHARACTER(LEN=*) :: axis_type
+\end_layout
+
+\begin_layout Standard
+Defines the type of an axis.
+ The values correspond to the following axis types:
+\end_layout
+
+\begin_layout Itemize
+
+\series bold
+\shape italic
+X:
+\series default
+\shape default
+ longitude
+\end_layout
+
+\begin_layout Itemize
+
+\series bold
+\shape italic
+\emph on
+Y
+\emph default
+:
+\series default
+\shape default
+ latitude
+\end_layout
+
+\begin_layout Itemize
+
+\series bold
+\shape italic
+\emph on
+Z
+\emph default
+:
+\series default
+\shape default
+ vertical axis
+\end_layout
+
+\begin_layout Itemize
+
+\series bold
+\shape italic
+T: 
+\series default
+\shape default
+time axis.
+\end_layout
+
+\begin_layout Subsection*
+comment (optional): 
+\begin_inset Flex Emph
+status collapsed
+
+\begin_layout Plain Layout
+string
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+Fortran: 
+\end_layout
+
+\begin_layout LyX-Code
+CHARACTER(LEN=*) :: comment
+\end_layout
+
+\begin_layout Standard
+Allows a user to set a comment.
+ 
 \end_layout
 
@@ -1460,5 +2256,5 @@
 
 \begin_layout Subsection*
-name: 
+name (optional): 
 \begin_inset Flex Emph
 status collapsed
@@ -1482,5 +2278,5 @@
 
 \begin_layout Standard
-Define the name of the horizontal domain.
+Defines the name of a horizontal domain.
  This attribute may be used in case of multiple domains defined in the same
  file.
@@ -1497,9 +2293,9 @@
  attribute will be suffixed to the longitude and latitude dimensions and
  axis name.
- Otherwise, a suffix will be self-generated.
-\end_layout
-
-\begin_layout Subsection*
-standard_name: 
+ If the domain name is not provided, it will be generated automatically.
+\end_layout
+
+\begin_layout Subsection*
+standard_name (optional): 
 \begin_inset Flex Emph
 status collapsed
@@ -1523,11 +2319,11 @@
 
 \begin_layout Standard
-Define the standard name of the domain, as it will appear in the metadata
- attached to the domain of the output file.
+Defines the standard name of a domain as it will appear in the domain's
+ metadata in an output file.
  
 \end_layout
 
 \begin_layout Subsection*
-long_name: 
+long_name (optional): 
 \begin_inset Flex Emph
 status collapsed
@@ -1551,16 +2347,16 @@
 
 \begin_layout Standard
-Define the long name of the domain, as it will appear in the metadata attached
- to the domain of the output file.
+Defines the long name of a domain as it will appear in the domain's metadata
+ in an output file.
  
 \end_layout
 
 \begin_layout Subsection*
-type: 
+type (mandatory): 
 \begin_inset Flex Emph
 status collapsed
 
 \begin_layout Plain Layout
-enumeration { rectilinear, curvilinear, unstructured }
+enumeration {rectilinear, curvilinear, unstructured, gaussian}
 \end_layout
 
@@ -1579,14 +2375,67 @@
 
 \begin_layout Standard
-Define the type of the grid.
- This attribute is mandatory.
-\end_layout
-
-\begin_layout Subsection*
-ni_glo: 
+Defines the type of a grid.
+\end_layout
+
+\begin_layout Subsection*
+dim_i_name (optional): 
 \begin_inset Flex Emph
 status collapsed
 
 \begin_layout Plain Layout
+string
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+Fortran: 
+\end_layout
+
+\begin_layout LyX-Code
+CHARACTER(LEN=*) :: dim_i_name
+\end_layout
+
+\begin_layout Standard
+Defines the name of the first domain dimension as it will appear in the
+ file's metadata.
+\end_layout
+
+\begin_layout Subsection*
+dim_j_name (optional): 
+\begin_inset Flex Emph
+status collapsed
+
+\begin_layout Plain Layout
+string
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+Fortran: 
+\end_layout
+
+\begin_layout LyX-Code
+CHARACTER(LEN=*) :: dim_j_name
+\end_layout
+
+\begin_layout Standard
+Defines the name of the second domain dimension as it will appear in file's
+ metadata.
+\end_layout
+
+\begin_layout Subsection*
+ni_glo (mandatory): 
+\begin_inset Flex Emph
+status collapsed
+
+\begin_layout Plain Layout
 integer
 \end_layout
@@ -1606,10 +2455,9 @@
 
 \begin_layout Standard
-Define the first dimension of the global domain.
- This attribute is mandatory.
-\end_layout
-
-\begin_layout Subsection*
-nj_glo: 
+Defines the size of the first dimension of the global domain.
+\end_layout
+
+\begin_layout Subsection*
+nj_glo (mandatory): 
 \begin_inset Flex Emph
 status collapsed
@@ -1633,10 +2481,9 @@
 
 \begin_layout Standard
-Define the second dimension of the global domain.
- This attribute is mandatory.
-\end_layout
-
-\begin_layout Subsection*
-ibegin: 
+Defines the size of the second dimension of the global domain.
+\end_layout
+
+\begin_layout Subsection*
+ibegin (optional): 
 \begin_inset Flex Emph
 status collapsed
@@ -1660,7 +2507,6 @@
 
 \begin_layout Standard
-Define the begining index of the first dimension of the local domain.
- This attribute is optional.
- This must be an integer between 
+Defines the beginning index of the first dimension of a local domain.
+ The attribute takes value between 
 \begin_inset Flex Strong
 status collapsed
@@ -1697,5 +2543,5 @@
 
 \begin_layout Subsection*
-ni: 
+ni (optional): 
 \begin_inset Flex Emph
 status collapsed
@@ -1719,7 +2565,6 @@
 
 \begin_layout Standard
-Define the first dimension of the local domain.
- This attribute is optional.
- This must be an integer between 
+Defines the size of the first dimension of a local domain.
+ The attribute takes value between 
 \begin_inset Flex Strong
 status collapsed
@@ -1756,5 +2601,5 @@
 
 \begin_layout Subsection*
-jbegin: 
+jbegin (optional): 
 \begin_inset Flex Emph
 status collapsed
@@ -1778,7 +2623,6 @@
 
 \begin_layout Standard
-Define the beginning index of the second dimension of the local domain.
- This attribute is optional.
- This must be an integer between 
+Defines the beginning index of the second dimension of a local domain.
+ The attribute takes value between 
 \begin_inset Flex Strong
 status collapsed
@@ -1815,5 +2659,5 @@
 
 \begin_layout Subsection*
-nj: 
+nj (optional): 
 \begin_inset Flex Emph
 status collapsed
@@ -1837,7 +2681,6 @@
 
 \begin_layout Standard
-Define the second dimension of the local domain.
- This attribute is optional.
- This must be an integer between 
+Defines the size of the second dimension of a local domain.
+ he attribute takes value between 
 \begin_inset Flex Strong
 status collapsed
@@ -1874,5 +2717,5 @@
 
 \begin_layout Subsection*
-lonvalue_1d: 
+lonvalue_1d (optional): 
 \emph on
 1D-array of double
@@ -1888,6 +2731,6 @@
 
 \begin_layout Standard
-Define the value of the longitude on the local domain.
- For a cartesian grid, the size of the array will be 
+Defines the longitude values of a local domain.
+ For a cartesian grid, the array size should be 
 \begin_inset Flex Strong
 status collapsed
@@ -1900,5 +2743,5 @@
 
 .
- For a curvilinear grid, the size of the array will be 
+ For a curvilinear grid, the array size should be 
 \begin_inset Flex Strong
 status collapsed
@@ -1915,9 +2758,8 @@
 
 .
- This attribute is optional.
-\end_layout
-
-\begin_layout Subsection*
-lonvalue_2d: 
+\end_layout
+
+\begin_layout Subsection*
+lonvalue_2d (optional): 
 \emph on
 2D-array of double
@@ -1933,6 +2775,6 @@
 
 \begin_layout Standard
-Define the value of the longitude on the local domain.
- For a cartesian and curvilinear grid, the size of the array will be 
+Defines the longitude values of a local domain.
+ For cartesian and curvilinear grids the array size should be 
 \begin_inset Flex Strong
 status collapsed
@@ -1949,10 +2791,11 @@
 
 .
- This attribute is mandatory.
  Only lonvalue_1d or lonvalue_2d can be defined.
-\end_layout
-
-\begin_layout Subsection*
-latvalue_1d: 
+ Also the layout of latitude and longitude should be in conformance with
+ each other: either 1D or 2D.
+\end_layout
+
+\begin_layout Subsection*
+latvalue_1d (optional): 
 \emph on
 1D-array of double
@@ -1968,5 +2811,5 @@
 
 \begin_layout Standard
-Define the value of the latitude on the local domain.
+Defines the latitude values of a local domain.
  For a cartesian grid, the size of the array will be nj.
  For a curvilinear grid, the size of the array will be 
@@ -1985,9 +2828,9 @@
 
 .
- This attribute is optional.
-\end_layout
-
-\begin_layout Subsection*
-latvalue_2d: 
+ 
+\end_layout
+
+\begin_layout Subsection*
+latvalue_2d (optional): 
 \emph on
 2D-array of double
@@ -2003,6 +2846,6 @@
 
 \begin_layout Standard
-Define the value of the latitude on the local domain.
- For a cartesian and a curvilinear grid, the size of the array will be 
+Defines the latitude values of a local domain.
+ For cartesian and curvilinear grids the array size should be 
 \begin_inset Flex Strong
 status collapsed
@@ -2019,10 +2862,63 @@
 
 .
- This attribute is mandatory.
  Only latvalue_1d or latvalue_2d can be defined.
-\end_layout
-
-\begin_layout Subsection*
-nvertex: 
+ Also the layout of latitude and longitude should be in conformance with
+ each other: either 1D or 2D.
+\end_layout
+
+\begin_layout Subsection*
+lon_name (optional): 
+\begin_inset Flex Emph
+status collapsed
+
+\begin_layout Plain Layout
+string
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+Fortran: 
+\end_layout
+
+\begin_layout LyX-Code
+CHARACTER(LEN=*) :: lon_name
+\end_layout
+
+\begin_layout Standard
+Defines the longitude name as it will appear in an output file.
+\end_layout
+
+\begin_layout Subsection*
+lat_name (optional): 
+\begin_inset Flex Emph
+status collapsed
+
+\begin_layout Plain Layout
+string
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+Fortran: 
+\end_layout
+
+\begin_layout LyX-Code
+CHARACTER(LEN=*) :: lat_name
+\end_layout
+
+\begin_layout Standard
+Defines the latitude name as it will appear in an output file.
+\end_layout
+
+\begin_layout Subsection*
+nvertex (optional): 
 \emph on
 integer
@@ -2038,11 +2934,11 @@
 
 \begin_layout Standard
-Define the the maximum number of vertices for a cell.
- This is useful to specify the boundaries of cells for an unstructured mesh.
- This attribute is optional.
-\end_layout
-
-\begin_layout Subsection*
-bounds_lon_1d: 
+Defines the maximum number of vertices for a grid.
+ The attribute is required for specifying the cell boundaries of unstructured
+ meshes.
+\end_layout
+
+\begin_layout Subsection*
+bounds_lon_1d (optional): 
 \emph on
 2D-array of double
@@ -2058,5 +2954,6 @@
 
 \begin_layout Standard
-Longitude value of the vertex of the cells.
+Defines the longitude values of domain vertexes.
+ The attribute 
 \begin_inset Flex Strong
 status collapsed
@@ -2068,10 +2965,14 @@
 \end_inset
 
- attribute must also be defined.
- This attribute is optional.
-\end_layout
-
-\begin_layout Subsection*
-bounds_lon_2d: 
+ must be also defined.
+ The array dimensions must be 
+\begin_inset Formula $\textbf{nvertex}\times\textbf{ni}$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Subsection*
+bounds_lon_2d (optional): 
 \emph on
 3D-array of double
@@ -2087,5 +2988,6 @@
 
 \begin_layout Standard
-Longitude value of the vertex of the cells.
+Defines the longitude values of domain vertexes.
+ The attribute 
 \begin_inset Flex Strong
 status collapsed
@@ -2097,12 +2999,16 @@
 \end_inset
 
- attribute must also be defined.
- This attribute is optional.
+ must be also defined.
  This attribute is useful when lonvalue_2d is defined.
- Only bounds_lon_1d or bounds_lon_2d can be defined.
-\end_layout
-
-\begin_layout Subsection*
-bounds_lat_1d: 
+ The array dimensions must be 
+\begin_inset Formula $\textbf{nvertex}\times\textbf{ni}\times\textbf{nj}$
+\end_inset
+
+.
+ Either bounds_lon_1d or bounds_lon_2d can be defined.
+\end_layout
+
+\begin_layout Subsection*
+bounds_lat_1d (optional): 
 \emph on
 2D-array of double
@@ -2118,5 +3024,6 @@
 
 \begin_layout Standard
-Latitude value of the vertex of the cells.
+Defines the latitude values of domain vertexes.
+ The attribute 
 \begin_inset Flex Strong
 status collapsed
@@ -2128,10 +3035,14 @@
 \end_inset
 
- attribute must also be defined.
- This attribute is optional.
-\end_layout
-
-\begin_layout Subsection*
-bounds_lat_2d: 
+ must be also defined.
+ The array dimensions must be 
+\begin_inset Formula $\textbf{nvertex}\times\textbf{ni}$
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Subsection*
+bounds_lat_2d (optional): 
 \emph on
 3D-array of double
@@ -2147,5 +3058,6 @@
 
 \begin_layout Standard
-Latitude value of the vertex of the cells.
+Defines the latitude values of domain vertexes.
+ The attribute 
 \begin_inset Flex Strong
 status collapsed
@@ -2157,12 +3069,70 @@
 \end_inset
 
- attribute must also be defined.
- This attribute is optional.
- This attribute is useful when latvalue_2d is defined.
- Only bounds_lat_1d or bounds_lat_2d can be defined.
-\end_layout
-
-\begin_layout Subsection*
-area: 
+ must be also defined.
+ The attribute is useful when lonvalue_2d is defined.
+ The array dimensions must be 
+\begin_inset Formula $\textbf{nvertex}\times\textbf{ni}\times\textbf{nj}$
+\end_inset
+
+.
+ Either bounds_lon_1d or bounds_lon_2d can be defined.
+\end_layout
+
+\begin_layout Subsection*
+bounds_lon_name (optional): 
+\begin_inset Flex Emph
+status collapsed
+
+\begin_layout Plain Layout
+string
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+Fortran: 
+\end_layout
+
+\begin_layout LyX-Code
+CHARACTER(LEN=*) :: lon_name
+\end_layout
+
+\begin_layout Standard
+Defines the longitude name of domain vertexes as it will appear in an output
+ file.
+\end_layout
+
+\begin_layout Subsection*
+bounds_lat_name (optional): 
+\begin_inset Flex Emph
+status collapsed
+
+\begin_layout Plain Layout
+string
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+Fortran: 
+\end_layout
+
+\begin_layout LyX-Code
+CHARACTER(LEN=*) :: lat_name
+\end_layout
+
+\begin_layout Standard
+Defines the latitude name of domain vertexes as it will appear in an output
+ file.
+\end_layout
+
+\begin_layout Subsection*
+area (optional): 
 \emph on
 2D-array of double
@@ -2178,5 +3148,5 @@
 
 \begin_layout Standard
-Area of the cells.
+The area of cells.
  The size of the array must be 
 \begin_inset Flex Strong
@@ -2194,9 +3164,8 @@
 
 .
- This attribute is optional.
-\end_layout
-
-\begin_layout Subsection*
-data_dim: 
+\end_layout
+
+\begin_layout Subsection*
+prec (optional): 
 \emph on
 integer
@@ -2208,20 +3177,31 @@
 
 \begin_layout LyX-Code
+INTEGER :: prec
+\end_layout
+
+\begin_layout Standard
+Defines the precision in bytes of domain attributes.
+ Available values are: 2 (integer), 4 (float single precision) and 8 (float
+ double precision).
+ The default value of 8.
+\end_layout
+
+\begin_layout Subsection*
+data_dim (optional): 
+\emph on
+integer
+\end_layout
+
+\begin_layout Standard
+Fortran:
+\end_layout
+
+\begin_layout LyX-Code
 INTEGER :: datadim
 \end_layout
 
 \begin_layout Standard
-Define how a field is stored on memory for the client code.
- 
-\begin_inset Flex Strong
-status collapsed
-
-\begin_layout Plain Layout
-datadim
-\end_layout
-
-\end_inset
-
- value can be 
+Defines how a field is stored on memory for the client code.
+ The value can be either 
 \begin_inset Flex Strong
 status collapsed
@@ -2244,5 +3224,5 @@
 
 .
- A value of 
+ The value of 
 \begin_inset Flex Strong
 status collapsed
@@ -2254,7 +3234,6 @@
 \end_inset
 
- indicates that the horizontal layer of the field is stored on a 1D array
- as a vector of points.
- A value of 
+ indicates that the horizontal layer of the field is stored as a 1D array.
+ The value of 
 \begin_inset Flex Strong
 status collapsed
@@ -2266,6 +3245,5 @@
 \end_inset
 
- indicates that the horizontal layer is stored in a 2D array.
- This attribute is optional.
+ indicates that the horizontal layer is stored as a 2D array.
  The default value is 
 \begin_inset Flex Strong
@@ -2282,5 +3260,5 @@
 
 \begin_layout Subsection*
-data_ibegin:
+data_ibegin (optional):
 \emph on
  integer
@@ -2296,7 +3274,7 @@
 
 \begin_layout Standard
-Define the beginning index of the field data for the first dimension.
- This attribute is an offset regarding the local domain, so the value can
- be negative.
+Defines the beginning index of field data for the first dimension.
+ This attribute is an offset relative to the local domain, so the value
+ can be negative.
  A negative value indicates that only some valid part of the data will extracted
 , for example in the case of a ghost cell.
@@ -2304,6 +3282,6 @@
  stored in memory.
  A 0-value means that the local domain matches the data in memory.
- This attribute is optional and the default value is 0.
- Otherwise 
+ The default value is 0.
+ The attributes 
 \begin_inset Flex Strong
 status collapsed
@@ -2329,5 +3307,5 @@
 
 \begin_layout Subsection*
-data_ni: 
+data_ni (optional): 
 \emph on
 integer
@@ -2343,6 +3321,6 @@
 
 \begin_layout Standard
-Define the size of the field data for the first dimension.
- This attribute is optional and the default value is 
+Defines the size of field data for the first dimension.
+ The default value is 
 \begin_inset Flex Strong
 status collapsed
@@ -2355,5 +3333,5 @@
 
 .
- Otherwise 
+ The attributes 
 \begin_inset Flex Strong
 status collapsed
@@ -2379,5 +3357,5 @@
 
 \begin_layout Subsection*
-data_jbegin: 
+data_jbegin (optional): 
 \emph on
 integer
@@ -2393,6 +3371,6 @@
 
 \begin_layout Standard
-Define the beginning index of the field data for the second dimension.
- This attribute is take account only if
+Defines the beginning index of field data for the second dimension.
+ The attribute is taken into account only if
 \begin_inset Flex Strong
 status collapsed
@@ -2405,5 +3383,5 @@
 
 .
- This attribute is an offset regarding the local domain, so the value can
+ The attribute is an offset relative to the local domain, so the value can
  be negative.
  A negative value indicate that only some valid part of the data will extracted,
@@ -2411,6 +3389,6 @@
  A positive value indicate that the local domain is greater than the data
  stored in memory.
- A 0-value means that the local domain match the data in memory.
- This attribute is optional and the default value is 
+ The 0-value means that the local domain matches the data in memory.
+ The default value is 
 \begin_inset Flex Strong
 status collapsed
@@ -2423,5 +3401,5 @@
 
 .
- Otherwise 
+ The attributes 
 \begin_inset Flex Strong
 status collapsed
@@ -2447,5 +3425,5 @@
 
 \begin_layout Subsection*
-data_nj: 
+data_nj (optional): 
 \emph on
 integer
@@ -2461,6 +3439,6 @@
 
 \begin_layout Standard
-Define the size of the field data for the second dimension.
- This attribute is taken account only if 
+Defines the size of field data for the second dimension.
+ The attribute is taken account only if 
 \begin_inset Flex Strong
 status collapsed
@@ -2473,5 +3451,5 @@
 
 .
- This attribute is optional and the default value is 
+ The default value is 
 \begin_inset Flex Strong
 status collapsed
@@ -2484,5 +3462,5 @@
 
 .
- Otherwise 
+ The attributes 
 \begin_inset Flex Strong
 status collapsed
@@ -2508,5 +3486,5 @@
 
 \begin_layout Subsection*
-data_i_index: 
+data_i_index (optional): 
 \emph on
 1D-array of integer
@@ -2522,12 +3500,12 @@
 
 \begin_layout Standard
-In case of a compressed horizontal domain, define the indexation the indexation
- of the data for the first dimension.
- The size of the array must be 
-\begin_inset Flex Strong
-status collapsed
-
-\begin_layout Plain Layout
-data_nindex
+In case of a compressed horizontal domain, define the data indexation for
+ the first dimension.
+ The array size must be 
+\begin_inset Flex Strong
+status collapsed
+
+\begin_layout Plain Layout
+data_n
 \end_layout
 
@@ -2535,9 +3513,8 @@
 
 .
- This attribute is optional.
-\end_layout
-
-\begin_layout Subsection*
-data_j_index: 
+\end_layout
+
+\begin_layout Subsection*
+data_j_index (optional): 
 \emph on
 1D-array of integer
@@ -2553,7 +3530,7 @@
 
 \begin_layout Standard
-In case of a compressed horizontal domain, define the indexation the indexation
- of the data for the second dimension.
- This is meaningful only if 
+In case of a compressed horizontal domain, defines the data indexation for
+ the second dimension.
+ The attribute is meaningful only if 
 \begin_inset Flex Strong
 status collapsed
@@ -2566,9 +3543,8 @@
 
 .
- This attribute is optional.
-\end_layout
-
-\begin_layout Subsection*
-mask_1d: 
+\end_layout
+
+\begin_layout Subsection*
+mask_1d (optional): 
 \emph on
 1D-array of bool
@@ -2584,7 +3560,5 @@
 
 \begin_layout Standard
-Define the 1-dimension mask of the local domain.
- The attribute is optional.
- By default, none value is masked.
+Defines the 1D mask of a local domain.
  The masked value will be replaced by the value of the field attribute 
 \begin_inset Flex Strong
@@ -2597,11 +3571,11 @@
 \end_inset
 
- in the output file.
+ in an output file.
  This value is useful in case a field is stored linearly in memory.
- This attribute is optional.
-\end_layout
-
-\begin_layout Subsection*
-mask_2d: 
+ By default none of the values are masked.
+\end_layout
+
+\begin_layout Subsection*
+mask_2d (optional): 
 \emph on
 2D-array of bool
@@ -2617,8 +3591,7 @@
 
 \begin_layout Standard
-Define the mask of the local domain.
- The attribute is optional.
- By default, none value is masked.
- The masked value will be replaced by the value of the field attribute 
+Defines the 2D mask of a local domain.
+ The masked values will be replaced by the value of the field attribute
+ 
 \begin_inset Flex Strong
 status collapsed
@@ -2630,10 +3603,11 @@
 \end_inset
 
- in the output file.
+ in an output file.
+ By default, none of the values are masked.
  Only mask_2d or mask_1d can be defined.
 \end_layout
 
 \begin_layout Subsection*
-domain_ref: string
+domain_ref (optional): string
 \end_layout
 
@@ -2647,14 +3621,13 @@
 
 \begin_layout Standard
-Define the reference of the domain.
+Defines the reference to a domain.
  All attributes are inherited from the referenced domain with the classic
  inheritance mechanism.
  The value assigned to the referenced domain is transmitted to to current
  domain.
- This attribute is optional.
-\end_layout
-
-\begin_layout Subsection*
-i_index: 
+\end_layout
+
+\begin_layout Subsection*
+i_index (optional): 
 \begin_inset Flex Emph
 status collapsed
@@ -2678,8 +3651,7 @@
 
 \begin_layout Standard
-Define the global index of the first dimension of domain which the local
- domain holds.
- This attribute is optional and by default, the size of the array is equal
- to 
+Defines the global index of the first dimension of a local domain held by
+ a process.
+ By default the size of the array is equal to 
 \begin_inset Flex Strong
 status collapsed
@@ -2695,5 +3667,5 @@
 
 \begin_layout Subsection*
-j_index: 
+j_index (optional): 
 \begin_inset Flex Emph
 status collapsed
@@ -2717,8 +3689,7 @@
 
 \begin_layout Standard
-Define the global index of the second dimension of domain which the local
- domain holds.
- This attribute is optional and by default, the size of the array is equal
- to 
+Defines the global index of the second dimension of a local domain held
+ by a process.
+ By default the size of the array is equal to 
 \begin_inset Flex Strong
 status collapsed
@@ -2731,4 +3702,30 @@
 
 .
+\end_layout
+
+\begin_layout Subsection*
+comment (optional): 
+\begin_inset Flex Emph
+status collapsed
+
+\begin_layout Plain Layout
+string
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+Fortran: 
+\end_layout
+
+\begin_layout LyX-Code
+CHARACTER(LEN=*) :: comment
+\end_layout
+
+\begin_layout Standard
+Allows a user to set a comment.
 \end_layout
 
@@ -2738,5 +3735,5 @@
 
 \begin_layout Subsection*
-name: string
+name (optional): string
 \end_layout
 
@@ -2750,11 +3747,9 @@
 
 \begin_layout Standard
-Define the name of the grid.
- This attribute is actually not used internally.
- Optional attribute.
-\end_layout
-
-\begin_layout Subsection*
-description: string
+Defines the name of a grid.
+\end_layout
+
+\begin_layout Subsection*
+description (optional): string
 \end_layout
 
@@ -2768,10 +3763,9 @@
 
 \begin_layout Standard
-Define the description of the grid.
- This attribute is optional.
-\end_layout
-
-\begin_layout Subsection*
-mask_1d: 
+Defines the descriptions of a grid.
+\end_layout
+
+\begin_layout Subsection*
+mask_1d (optional): 
 \emph on
 1D-array of bool
@@ -2787,6 +3781,6 @@
 
 \begin_layout Standard
-Define the mask of the local 1-dimension grid.
- Masked value will be replaced by the value of the field attribute 
+Defines the mask of a local 1D grid.
+ Masked values will be replaced by the value of the field attribute 
 \begin_inset Flex Strong
 status collapsed
@@ -2798,11 +3792,10 @@
 \end_inset
 
- in the output file.
- This attribute is optional.
- By default, none value is masked.
-\end_layout
-
-\begin_layout Subsection*
-mask_2d: 
+ in an output file.
+ By default none of the value are masked.
+\end_layout
+
+\begin_layout Subsection*
+mask_2d (optional): 
 \emph on
 2D-array of bool
@@ -2818,6 +3811,6 @@
 
 \begin_layout Standard
-Define the mask of the local 2-dimension grid.
- Masked value will be replaced by the value of the field attribute 
+Defines the mask of a local 2D grid.
+ Masked values will be replaced by the value of the field attribute 
 \begin_inset Flex Strong
 status collapsed
@@ -2829,11 +3822,10 @@
 \end_inset
 
- in the output file.
- This attribute is optional.
- By default, none value is masked.
-\end_layout
-
-\begin_layout Subsection*
-mask_3d: 
+ in an output file.
+ By default none of the value are masked.
+\end_layout
+
+\begin_layout Subsection*
+mask_3d (optional): 
 \emph on
 3D-array of bool
@@ -2849,6 +3841,6 @@
 
 \begin_layout Standard
-Define the mask of the local 3-dimension grid.
- Masked value will be replaced by the value of the field attribute 
+Define the mask of a local 3D grid.
+ Masked values will be replaced by the value of the field attribute 
 \begin_inset Flex Strong
 status collapsed
@@ -2860,8 +3852,152 @@
 \end_inset
 
- in the output file.
- This attribute is optional.
- By default, none value is masked.
- Only one mask can be defined.
+ in an output file.
+ By default none of the value are masked.
+\end_layout
+
+\begin_layout Subsection*
+mask_4d (optional): 
+\emph on
+4D-array of bool
+\end_layout
+
+\begin_layout Standard
+Fortran:
+\end_layout
+
+\begin_layout LyX-Code
+LOGICAL :: mask_4d(:,:,:)
+\end_layout
+
+\begin_layout Standard
+Define the mask of a local 4D grid.
+ Masked values will be replaced by the value of the field attribute 
+\begin_inset Flex Strong
+status collapsed
+
+\begin_layout Plain Layout
+default_value
+\end_layout
+
+\end_inset
+
+ in an output file.
+ By default none of the value are masked.
+\end_layout
+
+\begin_layout Subsection*
+mask_5d (optional): 
+\emph on
+5D-array of bool
+\end_layout
+
+\begin_layout Standard
+Fortran:
+\end_layout
+
+\begin_layout LyX-Code
+LOGICAL :: mask_5d(:,:,:)
+\end_layout
+
+\begin_layout Standard
+Define the mask of a local 5D grid.
+ Masked values will be replaced by the value of the field attribute 
+\begin_inset Flex Strong
+status collapsed
+
+\begin_layout Plain Layout
+default_value
+\end_layout
+
+\end_inset
+
+ in an output file.
+ By default none of the value are masked.
+\end_layout
+
+\begin_layout Subsection*
+mask_6d (optional): 
+\emph on
+6D-array of bool
+\end_layout
+
+\begin_layout Standard
+Fortran:
+\end_layout
+
+\begin_layout LyX-Code
+LOGICAL :: mask_6d(:,:,:)
+\end_layout
+
+\begin_layout Standard
+Define the mask of a local 6D grid.
+ Masked values will be replaced by the value of the field attribute 
+\begin_inset Flex Strong
+status collapsed
+
+\begin_layout Plain Layout
+default_value
+\end_layout
+
+\end_inset
+
+ in an output file.
+ By default none of the value are masked.
+\end_layout
+
+\begin_layout Subsection*
+mask_7d (optional): 
+\emph on
+7D-array of bool
+\end_layout
+
+\begin_layout Standard
+Fortran:
+\end_layout
+
+\begin_layout LyX-Code
+LOGICAL :: mask_7d(:,:,:)
+\end_layout
+
+\begin_layout Standard
+Define the mask of a local 7D grid.
+ Masked values will be replaced by the value of the field attribute 
+\begin_inset Flex Strong
+status collapsed
+
+\begin_layout Plain Layout
+default_value
+\end_layout
+
+\end_inset
+
+ in an output file.
+ By default none of the value are masked.
+\end_layout
+
+\begin_layout Subsection*
+comment (optional): 
+\begin_inset Flex Emph
+status collapsed
+
+\begin_layout Plain Layout
+string
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+Fortran: 
+\end_layout
+
+\begin_layout LyX-Code
+CHARACTER(LEN=*) :: comment
+\end_layout
+
+\begin_layout Standard
+Allows a user to set a comment.
 \end_layout
 
@@ -2871,5 +4007,5 @@
 
 \begin_layout Subsection*
-name: 
+name (optional): 
 \emph on
 string
@@ -2885,16 +4021,5 @@
 
 \begin_layout Standard
-Define the 
-\begin_inset Flex Strong
-status collapsed
-
-\begin_layout Plain Layout
-name
-\end_layout
-
-\end_inset
-
- of the field as it will appear in an output file.
- This attribute is optional.
+Defines the name of a field as it will appear in an output file.
  If not present, the identifier 
 \begin_inset Flex Strong
@@ -2911,5 +4036,5 @@
 
 \begin_layout Subsection*
-standard_name: 
+standard_name (optional): 
 \emph on
 string
@@ -2925,5 +4050,5 @@
 
 \begin_layout Standard
-Define the 
+Defines the 
 \begin_inset Flex Strong
 status collapsed
@@ -2936,9 +4061,8 @@
 
  attribute as it will appear in the metadata of an output file.
- This attribute is optional.
-\end_layout
-
-\begin_layout Subsection*
-long_name: 
+\end_layout
+
+\begin_layout Subsection*
+long_name (optional): 
 \emph on
 string
@@ -2954,20 +4078,9 @@
 
 \begin_layout Standard
-Define the 
-\begin_inset Flex Strong
-status collapsed
-
-\begin_layout Plain Layout
-long_name
-\end_layout
-
-\end_inset
-
- attribute as it will appear in the metadata of an output file.
- This attribute is optional.
-\end_layout
-
-\begin_layout Subsection*
-unit: 
+Defines the long name as it will appear in the metadata of an output file.
+\end_layout
+
+\begin_layout Subsection*
+expr (optional): 
 \emph on
 string
@@ -2979,26 +4092,53 @@
 
 \begin_layout LyX-Code
+CHARACTER(LEN=*) :: expr
+\end_layout
+
+\begin_layout Standard
+Defines the expression for arithmetic or time-integration operations performed
+ on a field.
+ For example if 
+\series bold
+expr=
+\begin_inset Quotes erd
+\end_inset
+
+sqrt(@temp2 - pow(@temp, 2))
+\begin_inset Quotes erd
+\end_inset
+
+
+\series default
+ then the variance will be calculated on the incoming flux of the field
+ 
+\series bold
+temp
+\series default
+ (given that field temp2 that holds the square of temp was correctly defined).
+ 
+\end_layout
+
+\begin_layout Subsection*
+unit (optional): 
+\emph on
+string
+\end_layout
+
+\begin_layout Standard
+Fortran: 
+\end_layout
+
+\begin_layout LyX-Code
 CHARACTER(LEN=*) :: unit
 \end_layout
 
 \begin_layout Standard
-Define the 
-\begin_inset Flex Strong
-status collapsed
-
-\begin_layout Plain Layout
-unit
-\end_layout
-
-\end_inset
-
- of the field.
- This attribute is optional.
-\end_layout
-
-\begin_layout Subsection*
-operation: enumeration
-\emph on
- { once, instant, average, maximum, minimum, accumulate }
+Defines the unit of a field.
+\end_layout
+
+\begin_layout Subsection*
+operation (mandatory): enumeration
+\emph on
+ {once, instant, average, maximum, minimum, accumulate}
 \end_layout
 
@@ -3012,10 +4152,9 @@
 
 \begin_layout Standard
-Define the temporal operation applied on the field.
- This attribute is optional, by default no operation is applied.
-\end_layout
-
-\begin_layout Subsection*
-freq_op: 
+Defines the temporal operation applied to a field.
+\end_layout
+
+\begin_layout Subsection*
+freq_op (optional): 
 \emph on
 duration
@@ -3031,6 +4170,6 @@
 
 \begin_layout Standard
-Define the frequency of the sampling for the temporal operation, so a field
- value will be used for temporal averaging every 
+Defines the sampling frequency of a temporal operation, so that field values
+ will be used for temporal sampling at frequency 
 \begin_inset Flex Strong
 status collapsed
@@ -3042,8 +4181,27 @@
 \end_inset
 
- time step.
- It is very useful for sub-processes called at different frequency in a
- model.
- This attribute is optional, the default value is 
+.
+ It is useful for sub-processes called at different frequency in a model.
+ The default value is equal to the file attribute 
+\begin_inset Flex Strong
+status collapsed
+
+\begin_layout Plain Layout
+output_freq
+\end_layout
+
+\end_inset
+
+ for 
+\begin_inset Flex Strong
+status collapsed
+
+\begin_layout Plain Layout
+instant
+\end_layout
+
+\end_inset
+
+ operations and 
 \begin_inset Flex Strong
 status collapsed
@@ -3055,9 +4213,9 @@
 \end_inset
 
-(1 time step).
-\end_layout
-
-\begin_layout Subsection*
-freq_offset: 
+ (1 time step) otherwise.
+\end_layout
+
+\begin_layout Subsection*
+freq_offset (optional): 
 \emph on
 duration
@@ -3073,5 +4231,5 @@
 
 \begin_layout Standard
-Define the offset when 
+Defines the offset when 
 \begin_inset Flex Strong
 status collapsed
@@ -3084,26 +4242,58 @@
 
  is defined.
- This attribute is optional, the default value is 
-\begin_inset Flex Strong
-status collapsed
-
-\begin_layout Plain Layout
-0ts
-\end_layout
-
-\end_inset
-
-(0 time step).
-\end_layout
-
-\begin_layout Standard
-\begin_inset Formula $0\leq freq\_offset<freq\_op$
-\end_inset
-
-
-\end_layout
-
-\begin_layout Subsection*
-level: 
+ Accepted values lie between 
+\series bold
+0
+\series default
+ and 
+\begin_inset Flex Strong
+status collapsed
+
+\begin_layout Plain Layout
+freq_op
+\end_layout
+
+\end_inset
+
+.
+ The default value is 
+\begin_inset Flex Strong
+status collapsed
+
+\begin_layout Plain Layout
+freq_op - 1ts
+\end_layout
+
+\end_inset
+
+ for fields in the 
+\begin_inset Flex Strong
+status collapsed
+
+\begin_layout Plain Layout
+write
+\end_layout
+
+\end_inset
+
+ mode and 
+\series bold
+0
+\series default
+ for fields in the 
+\begin_inset Flex Strong
+status collapsed
+
+\begin_layout Plain Layout
+read
+\end_layout
+
+\end_inset
+
+ mode.
+\end_layout
+
+\begin_layout Subsection*
+level (optional): 
 \emph on
 integer
@@ -3119,6 +4309,6 @@
 
 \begin_layout Standard
-Define the level of output of the field.
- A field will be output only if the file attribute
+Defines the output level of a field.
+ The field will be output only if the file attribute
 \begin_inset Flex Strong
 status collapsed
@@ -3135,5 +4325,5 @@
 
 .
- This attribute is optional, the default value is 
+ The default value is 
 \begin_inset Flex Strong
 status collapsed
@@ -3149,5 +4339,5 @@
 
 \begin_layout Subsection*
-prec: 
+prec (optional): 
 \emph on
 integer
@@ -3163,11 +4353,12 @@
 
 \begin_layout Standard
-Define the precision in byte of a field in an output file.
- Available value are: 2 (integer), 4 (float single precision) and 8 (float
+Defines the precision in bytes of a field in an output file.
+ Available values are: 2 (integer), 4 (float single precision) and 8 (float
  double precision).
-\end_layout
-
-\begin_layout Subsection*
-enabled: 
+ The default value of 8.
+\end_layout
+
+\begin_layout Subsection*
+enabled (optional): 
 \emph on
 bool
@@ -3183,6 +4374,6 @@
 
 \begin_layout Standard
-Define if a field must be output or not.
- This attribute is optional, the default value is 
+Defines if a field must be output or not.
+ The default value is 
 \begin_inset Flex Strong
 status collapsed
@@ -3198,5 +4389,5 @@
 
 \begin_layout Subsection*
-read_access: 
+check_if_active (optional): 
 \emph on
 bool
@@ -3208,10 +4399,32 @@
 
 \begin_layout LyX-Code
+LOGICAL :: check_if_active
+\end_layout
+
+\begin_layout Standard
+Sets a check if a field will be used at a given time step.
+ Activating the check may improve performance for fields which are not used
+ frequently, while it can detoriate performance for fields used at each
+ time step.
+ The default value is false.
+\end_layout
+
+\begin_layout Subsection*
+read_access (optional): 
+\emph on
+bool
+\end_layout
+
+\begin_layout Standard
+Fortran:
+\end_layout
+
+\begin_layout LyX-Code
 LOGICAL :: read_access
 \end_layout
 
 \begin_layout Standard
-Define whether a field can be read from the model or not.
- This attribute is optional, the default value is 
+Defines whether a field can be read from the model or not.
+ The default value is 
 \begin_inset Flex Strong
 status collapsed
@@ -3242,5 +4455,5 @@
 
 \begin_layout Subsection*
-field_ref: 
+field_ref (optional): 
 \emph on
 string
@@ -3256,14 +4469,13 @@
 
 \begin_layout Standard
-Define a field reference.
- All attributes are inherited from the referenced field after the classical
+Defines the field reference.
+ All attributes will be inherited from the referenced field via the classical
  inheritance mechanism.
- The value assigned to the referenced field is transmitted to to current
- field to perform temporal operation.
- This attribute is optional.
-\end_layout
-
-\begin_layout Subsection*
-grid_ref: 
+ The values assigned to the referenced field will be transmitted to the
+ current field to perform temporal operation.
+\end_layout
+
+\begin_layout Subsection*
+grid_ref (optional): 
 \emph on
 string
@@ -3279,11 +4491,50 @@
 
 \begin_layout Standard
-Define on which grid the current field is defined.
- This attribute is optional, if missing, domain_ref and axis_ref must be
- defining.
-\end_layout
-
-\begin_layout Subsection*
-domain_ref: 
+Defines the field grid.
+ Note that only either 
+\begin_inset Flex Strong
+status collapsed
+
+\begin_layout Plain Layout
+grid_ref
+\end_layout
+
+\end_inset
+
+ or a combination of 
+\begin_inset Flex Strong
+status collapsed
+
+\begin_layout Plain Layout
+domain_ref
+\end_layout
+
+\end_inset
+
+, 
+\begin_inset Flex Strong
+status collapsed
+
+\begin_layout Plain Layout
+scalar_ref
+\end_layout
+
+\end_inset
+
+ or 
+\begin_inset Flex Strong
+status collapsed
+
+\begin_layout Plain Layout
+axis_ref
+\end_layout
+
+\end_inset
+
+ can be specified.
+\end_layout
+
+\begin_layout Subsection*
+domain_ref (optional): 
 \emph on
 string
@@ -3299,6 +4550,6 @@
 
 \begin_layout Standard
-Define on which horizontal domain the current field is defined.
- This attribute is optional, but if this attribute is defined, 
+Defines the field domain.
+ If the attribute is defined, the attribute 
 \begin_inset Flex Strong
 status collapsed
@@ -3310,9 +4561,9 @@
 \end_inset
 
- must not be.
-\end_layout
-
-\begin_layout Subsection*
-axis_ref: 
+ must not be specified.
+\end_layout
+
+\begin_layout Subsection*
+axis_ref (optional): 
 \emph on
 string
@@ -3328,16 +4579,6 @@
 
 \begin_layout Standard
-Define on which vertical axis the current field is defined.
- This attribute is optional, but if this attribute is defined, 
-\begin_inset Flex Strong
-status collapsed
-
-\begin_layout Plain Layout
-domain_ref
-\end_layout
-
-\end_inset
-
- must be too and 
+Defines an axis for the current field.
+ If the attribute is defined, the attribute 
 \begin_inset Flex Strong
 status collapsed
@@ -3349,9 +4590,9 @@
 \end_inset
 
- must not.
-\end_layout
-
-\begin_layout Subsection*
-grid_path: 
+ must not be specified.
+\end_layout
+
+\begin_layout Subsection*
+scalar_ref (optional): 
 \emph on
 string
@@ -3363,14 +4604,42 @@
 
 \begin_layout LyX-Code
+CHARACTER(LEN=*) :: scalar_ref
+\end_layout
+
+\begin_layout Standard
+Defines a scalar domain for the current field.
+ If the attribute is defined, the attribute 
+\begin_inset Flex Strong
+status collapsed
+
+\begin_layout Plain Layout
+grid_ref
+\end_layout
+
+\end_inset
+
+ must not be specified.
+\end_layout
+
+\begin_layout Subsection*
+grid_path (optional): 
+\emph on
+string
+\end_layout
+
+\begin_layout Standard
+Fortran: 
+\end_layout
+
+\begin_layout LyX-Code
 CHARACTER(LEN=*) :: grid_path
 \end_layout
 
 \begin_layout Standard
-Define the way operations passing from a grid to others.
- This attribute is optional.
-\end_layout
-
-\begin_layout Subsection*
-default_value: 
+Defines the way operations pass from a grid to other grids.
+\end_layout
+
+\begin_layout Subsection*
+default_value (optional): 
 \emph on
 double
@@ -3386,13 +4655,11 @@
 
 \begin_layout Standard
-Define the value which should be used in place of the missing data of a
- field.
- This attribute is optional.
- If no value was defined, the missing data will be replaced by uninitialized
- values which can lead to undefined behaviors.
-\end_layout
-
-\begin_layout Subsection*
-valid_min: 
+Defines the value which will be used instead of missing field data.
+ If no value is provided, the missing data will be replaced by uninitialized
+ values what can lead to undefined behavior.
+\end_layout
+
+\begin_layout Subsection*
+valid_min (optional): 
 \emph on
 double
@@ -3418,9 +4685,9 @@
 \end_inset
 
- attribute value are set to missing value.
-\end_layout
-
-\begin_layout Subsection*
-valid_max: 
+ attribute value will be set to missing value.
+\end_layout
+
+\begin_layout Subsection*
+valid_max (optional): 
 \emph on
 double
@@ -3446,9 +4713,9 @@
 \end_inset
 
- attribute value are set to missing value.
-\end_layout
-
-\begin_layout Subsection*
-detect_missing_value: 
+ attribute value will be set to missing value.
+\end_layout
+
+\begin_layout Subsection*
+detect_missing_value (optional): 
 \emph on
 bool
@@ -3464,10 +4731,11 @@
 
 \begin_layout Standard
-When XIOS detect a default value in a field, it does not include the value
- in the statistic of the operation, like averaging, minimum, maximum...
-\end_layout
-
-\begin_layout Subsection*
-add_offset: 
+When XIOS detects a default value in a field, it does not take into account
+ the value during arithmetic operations such as averaging, minimum, maximum,
+ etc.
+\end_layout
+
+\begin_layout Subsection*
+add_offset (optional): 
 \emph on
 double
@@ -3483,5 +4751,5 @@
 
 \begin_layout Standard
-Set the 
+Sets the 
 \begin_inset Flex Strong
 status collapsed
@@ -3493,5 +4761,5 @@
 \end_inset
 
- metadata CF attribute in the output file.
+ metadata CF attribute in an output file.
  In output, the 
 \begin_inset Flex Strong
@@ -3504,5 +4772,5 @@
 \end_inset
 
- value is subtracted to the field values.
+ value will be subtracted from the field values.
 \end_layout
 
@@ -3522,5 +4790,5 @@
 
 \begin_layout Standard
-Set the 
+Sets the 
 \begin_inset Flex Strong
 status collapsed
@@ -3532,6 +4800,6 @@
 \end_inset
 
- metadata CF attribute in the output file.
- In output, the field values are divided by the 
+ metadata CF attribute in an output file.
+ In output, the field values will be divided by the 
 \begin_inset Flex Strong
 status collapsed
@@ -3547,5 +4815,5 @@
 
 \begin_layout Subsection*
-compression_level: 
+compression_level (optional): 
 \emph on
 integer
@@ -3561,11 +4829,9 @@
 
 \begin_layout Standard
-Define whether the field should be compressed using NetCDF-4 built-in compressio
-n.
+Defines whether a field should be compressed using NetCDF-4 built-in compression.
  The compression level must range from 0 to 9.
- An higher compression level means a better compression at the cost of using
+ A higher compression level means a better compression at the cost of using
  more processing power.
- This attribute is optional, the default value is inherited from the file
- attribute 
+ The default value is inherited from the file attribute 
 \series bold
 compression_level
@@ -3575,5 +4841,5 @@
 
 \begin_layout Subsection*
-indexed_output: 
+indexed_output (optional): 
 \emph on
 bool
@@ -3589,7 +4855,7 @@
 
 \begin_layout Standard
-Define whether the field data must be outputted as an indexed grid instead
- of a full grid whenever possible.
- This attribute is optional, the default value is 
+Defines whether field data must be output as an indexed grid instead of
+ a full grid whenever possible.
+ The default value is 
 \series bold
 \emph on
@@ -3601,5 +4867,5 @@
 
 \begin_layout Subsection*
-ts_enabled: 
+ts_enabled (optional): 
 \emph on
 bool
@@ -3615,6 +4881,6 @@
 
 \begin_layout Standard
-Define whether the field can be outputted as a timeserie if requested.
- This attribute is optional, the default value is 
+Defines whether a field can be output as a timeseries.
+ The default value is 
 \series bold
 \emph on
@@ -3626,5 +4892,5 @@
 
 \begin_layout Subsection*
-ts_split_freq: 
+ts_split_freq (optional): 
 \emph on
 duration
@@ -3640,8 +4906,7 @@
 
 \begin_layout Standard
-Define the splitting frequency that should be used for the timeserie if
+Defines the splitting frequency that should be used for a timeseries if
  it has been requested.
- This attribute is optional, by default this value is inherited from the
- file 
+ By default the attribute value is inherited from the file attribute 
 \series bold
 split_freq
@@ -3650,4 +4915,66 @@
 \end_layout
 
+\begin_layout Subsection*
+cell_methods (optional): 
+\emph on
+string
+\end_layout
+
+\begin_layout Standard
+Fortran: 
+\end_layout
+
+\begin_layout LyX-Code
+CHARACTER(LEN=*) :: cell_methods
+\end_layout
+
+\begin_layout Standard
+Defines the cell methods field attribute.
+\end_layout
+
+\begin_layout Subsection*
+cell_methods_mode (optional): enumeration
+\emph on
+ {overwrite, prefix, suffix, none}
+\end_layout
+
+\begin_layout Standard
+Fortran:
+\end_layout
+
+\begin_layout LyX-Code
+CHARACTER(LEN=*) :: cell_methods_mode
+\end_layout
+
+\begin_layout Standard
+Defines the cell methods mode of a field.
+\end_layout
+
+\begin_layout Subsection*
+comment (optional): 
+\begin_inset Flex Emph
+status collapsed
+
+\begin_layout Plain Layout
+string
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+Fortran: 
+\end_layout
+
+\begin_layout LyX-Code
+CHARACTER(LEN=*) :: comment
+\end_layout
+
+\begin_layout Standard
+Allows a user to set a comment.
+\end_layout
+
 \begin_layout Section
 Variable attribute reference
@@ -3655,5 +4982,5 @@
 
 \begin_layout Subsection*
-name: 
+name (optional): 
 \emph on
 string
@@ -3669,17 +4996,6 @@
 
 \begin_layout Standard
-Define the 
-\begin_inset Flex Strong
-status collapsed
-
-\begin_layout Plain Layout
-name
-\end_layout
-
-\end_inset
-
- of the variable as it will appear in an output file.
- This attribute is optional.
- If not present, the 
+Defines the name of a variable as it will appear in an output file.
+ If not present, the variable 
 \begin_inset Flex Strong
 status collapsed
@@ -3691,10 +5007,10 @@
 \end_inset
 
- will be used instead.
-\end_layout
-
-\begin_layout Subsection*
-type: enumeration { bool, int, int32, int16, int64, float, double, string
- }
+ will be used.
+\end_layout
+
+\begin_layout Subsection*
+type (mandatory): enumeration {bool, int, int32, int16, int64, float, double,
+ string}
 \end_layout
 
@@ -3708,15 +5024,5 @@
 
 \begin_layout Standard
-Define the 
-\begin_inset Flex Strong
-status collapsed
-
-\begin_layout Plain Layout
-type
-\end_layout
-
-\end_inset
-
- of the variable.
+Defines the type of a variable.
  Note that the 
 \series bold
@@ -3732,5 +5038,16 @@
 \emph default
 .
- This attribute is mandatory.
+\end_layout
+
+\begin_layout Subsection*
+ts_target (optional): enumeration {file, field, both, none}
+\end_layout
+
+\begin_layout Standard
+Fortran:
+\end_layout
+
+\begin_layout LyX-Code
+CHARACTER(LEN=*) :: ts_target
 \end_layout
 
@@ -3740,5 +5057,5 @@
 
 \begin_layout Subsection*
-name: 
+name (mandatory): 
 \emph on
 string
@@ -3754,10 +5071,9 @@
 
 \begin_layout Standard
-Define the name of the file.
- This attribute is mandatory.
-\end_layout
-
-\begin_layout Subsection*
-description: 
+Defines the name of a file.
+\end_layout
+
+\begin_layout Subsection*
+description (optional): 
 \emph on
 string
@@ -3773,10 +5089,9 @@
 
 \begin_layout Standard
-Define the description of the file.
- This attribute is optional.
-\end_layout
-
-\begin_layout Subsection*
-name_suffix: 
+Defines the description of a file.
+\end_layout
+
+\begin_layout Subsection*
+name_suffix (optional): 
 \emph on
 string
@@ -3792,10 +5107,9 @@
 
 \begin_layout Standard
-Define a suffix to add to the name of the file.
- This attribute is optional.
-\end_layout
-
-\begin_layout Subsection*
-min_digits: 
+Defines a suffix added to the file name.
+\end_layout
+
+\begin_layout Subsection*
+min_digits (optional): 
 \emph on
 integer
@@ -3811,7 +5125,11 @@
 
 \begin_layout Standard
-For multiple_file, define the minimum digits composing the suffix defining
- the rank of the server, which will be happened to the name of the file.
- This attribute is optional and the default value is 
+For the 
+\series bold
+multiple_file
+\series default
+ mode defines the minimum number of digits of the suffix describing the
+ server rank which will be appended to the file name.
+ The default value is 
 \begin_inset Flex Strong
 status collapsed
@@ -3823,9 +5141,54 @@
 \end_inset
 
+ (no server rank suffix is added).
+\end_layout
+
+\begin_layout Subsection*
+output_freq (mandatory): 
+\emph on
+duration
+\end_layout
+
+\begin_layout Standard
+Fortran:
+\end_layout
+
+\begin_layout LyX-Code
+TYPE(xios_duration) :: output_freq
+\end_layout
+
+\begin_layout Standard
+Defines the output frequency for the current file.
+\end_layout
+
+\begin_layout Subsection*
+output_level (optional): 
+\emph on
+integer
+\end_layout
+
+\begin_layout Standard
+Fortran:
+\end_layout
+
+\begin_layout LyX-Code
+INTEGER :: output_level
+\end_layout
+
+\begin_layout Standard
+Defines the output level for all fields of the current file.
+ The field is output only if the field attribute 
+\series bold
+level
+\series default
+ is less or equal to the file attribute 
+\series bold
+output_level
+\series default
 .
 \end_layout
 
 \begin_layout Subsection*
-output_freq: 
+sync_freq (optional): 
 \emph on
 duration
@@ -3837,37 +5200,15 @@
 
 \begin_layout LyX-Code
-TYPE(xios_duration) :: output_freq
-\end_layout
-
-\begin_layout Standard
-Define the output frequency for the current file.
- This attribute is mandatory.
-\end_layout
-
-\begin_layout Subsection*
-output_level: 
-\emph on
-integer
-\end_layout
-
-\begin_layout Standard
-Fortran:
-\end_layout
-
-\begin_layout LyX-Code
-INTEGER :: output_level
-\end_layout
-
-\begin_layout Standard
-Define an output level for the field defining inside the current file.
- Field is output only if the field attribute 
-\begin_inset Formula $level\leq output\_level$
-\end_inset
-
-.
-\end_layout
-
-\begin_layout Subsection*
-sync_freq: 
+TYPE(xios_duration) :: sync_freq
+\end_layout
+
+\begin_layout Standard
+Defines the frequency for flushing the current file onto a disk.
+ It may result in poor performances but data will be written even if a file
+ is not yet closed.
+\end_layout
+
+\begin_layout Subsection*
+split_freq (optional): 
 \emph on
 duration
@@ -3879,41 +5220,16 @@
 
 \begin_layout LyX-Code
-TYPE(xios_duration) :: sync_freq
-\end_layout
-
-\begin_layout Standard
-Define the frequency for flushing the current file onto disk.
- It may result bad performance but data are wrote even if the file will
- not be closed.
- This attribute is optional.
-\end_layout
-
-\begin_layout Subsection*
-split_freq: 
-\emph on
-duration
-\end_layout
-
-\begin_layout Standard
-Fortran:
-\end_layout
-
-\begin_layout LyX-Code
 TYPE(xios_duration) :: split_freq
 \end_layout
 
 \begin_layout Standard
-Define the time frequency for splitting the current file.
- In that case, the start and end dates are added to the file 
+Defines the frequency for splitting the current file.
+ The start and end dates will be added to the file name (see 
+\begin_inset Flex Emph
+status collapsed
+
+\begin_layout Plain Layout
+
 \series bold
-name
-\series default
- (see 
-\begin_inset Flex Emph
-status collapsed
-
-\begin_layout Plain Layout
-
-\series bold
 \emph on
 split_freq_format
@@ -3923,9 +5239,9 @@
 
  attribute).
- This attribute is optional, by default no splitting is done.
-\end_layout
-
-\begin_layout Subsection*
-split_freq_format: 
+ By default no splitting is done.
+\end_layout
+
+\begin_layout Subsection*
+split_freq_format (optional): 
 \emph on
 string
@@ -3941,6 +5257,6 @@
 
 \begin_layout Standard
-Define the format of the split date suffixed to the file.
- Can contain any character, 
+Defines the format of the split date suffixed to a file.
+ It can contain any character, 
 \emph on
 
@@ -4027,6 +5343,6 @@
 
  by the number of full days since the time origin.
- This attribute is optional and the default behavior is to create a suffix
- with the date until the smaller non zero unit.
+ The default behavior is to create a suffix with the date until the smaller
+ non zero unit.
  For example, in one day split frequency, the hour, minute and second will
  not appear in the suffix, only year, month and day.
@@ -4034,5 +5350,52 @@
 
 \begin_layout Subsection*
-enabled: 
+split_start_offset(optional): 
+\emph on
+duration
+\end_layout
+
+\begin_layout Standard
+Fortran:
+\end_layout
+
+\begin_layout LyX-Code
+TYPE(xios_duration) :: split_start_offset
+\end_layout
+
+\begin_layout Standard
+Defines the offset of file splitting.
+ 
+\end_layout
+
+\begin_layout Subsection*
+split_end_offset(optional): 
+\emph on
+duration
+\end_layout
+
+\begin_layout Standard
+Fortran:
+\end_layout
+
+\begin_layout LyX-Code
+TYPE(xios_duration) :: split_end_offset
+\end_layout
+
+\begin_layout Subsection*
+split_last_date (optional): 
+\emph on
+string
+\end_layout
+
+\begin_layout Standard
+Fortran:
+\end_layout
+
+\begin_layout LyX-Code
+CHARACTER(LEN=*) :: split_last_date
+\end_layout
+
+\begin_layout Subsection*
+enabled (optional): 
 \emph on
 bool
@@ -4048,6 +5411,6 @@
 
 \begin_layout Standard
-Define if a file must be written/read or not.
- This attribute is optional, the default value is 
+Defines if a file must be written/read or not.
+ The default value is 
 \begin_inset Flex Strong
 status collapsed
@@ -4063,7 +5426,7 @@
 
 \begin_layout Subsection*
-mode: 
-\emph on
-enumeration { read, write }
+mode (optional): 
+\emph on
+enumeration {read, write}
 \end_layout
 
@@ -4077,6 +5440,6 @@
 
 \begin_layout Standard
-Define whether the file will be read or written.
- This attribute is optional, the default value is 
+Defines whether a file will be read or written.
+ The default value is 
 \begin_inset Flex Strong
 status collapsed
@@ -4092,7 +5455,7 @@
 
 \begin_layout Subsection*
-type: 
-\emph on
-enumeration { one_file, multiple_file }
+type (mandatory): 
+\emph on
+enumeration {one_file, multiple_file}
 \end_layout
 
@@ -4106,5 +5469,5 @@
 
 \begin_layout Standard
-Define the type of the file: 
+Defines the type of a file: 
 \begin_inset Flex Strong
 status collapsed
@@ -4131,23 +5494,22 @@
 
 : one single global file is wrote using netcdf4 parallel access.
- This attribute is mandatory.
-\end_layout
-
-\begin_layout Subsection*
-format: 
-\emph on
-enumeration { netcdf4, netcdf4_classic }
-\end_layout
-
-\begin_layout Standard
-Fortran:
-\end_layout
-
-\begin_layout LyX-Code
-CHARACTER(LEN=*) :: type
-\end_layout
-
-\begin_layout Standard
-Define the format of the file: 
+\end_layout
+
+\begin_layout Subsection*
+format (optional): 
+\emph on
+enumeration {netcdf4, netcdf4_classic}
+\end_layout
+
+\begin_layout Standard
+Fortran:
+\end_layout
+
+\begin_layout LyX-Code
+CHARACTER(LEN=*) :: format
+\end_layout
+
+\begin_layout Standard
+Define the format of a file: 
 \begin_inset Flex Strong
 status collapsed
@@ -4178,5 +5540,5 @@
 
 : the classic NetCDF format will be used.
- The attribute is optional, the default value is 
+ The default value is 
 \series bold
 \emph on
@@ -4210,7 +5572,7 @@
 
 \begin_layout Subsection*
-par_access: 
-\emph on
-enumeration { collective, independent }
+par_access (optional): 
+\emph on
+enumeration {collective, independent}
 \end_layout
 
@@ -4224,6 +5586,6 @@
 
 \begin_layout Standard
-For parallel writing, define which type of MPI calls will be used.
- This attribute is optional, the default value is 
+For parallel writing, defines which type of MPI calls will be used.
+ The default value is 
 \begin_inset Flex Strong
 status collapsed
@@ -4241,5 +5603,5 @@
 
 \begin_layout Subsection*
-append: 
+read_metadata_par (optional): 
 \emph on
 bool
@@ -4251,11 +5613,72 @@
 
 \begin_layout LyX-Code
+LOGICAL :: read_metadata_par
+\end_layout
+
+\begin_layout Standard
+For files in the read mode, defines if parallel or serial I/O will be used
+ by model processes for reading file metadata.
+ The default value is false implying serial I/O for reading metadata.
+\end_layout
+
+\begin_layout Subsection*
+convention (optional): 
+\emph on
+enumeration {CF, UGRID}
+\end_layout
+
+\begin_layout Standard
+Fortran:
+\end_layout
+
+\begin_layout LyX-Code
+CHARACTER(LEN=*) :: convention
+\end_layout
+
+\begin_layout Standard
+Defines the file conventions.
+ By default the CF conventions are followed.
+\end_layout
+
+\begin_layout Subsection*
+convention_str (optional): 
+\emph on
+string
+\end_layout
+
+\begin_layout Standard
+Fortran:
+\end_layout
+
+\begin_layout LyX-Code
+CHARACTER(LEN=*) :: convention_str
+\end_layout
+
+\begin_layout Standard
+Defines the 
+\series bold
+Conventions 
+\series default
+attribute to be added to file global attributes.
+\end_layout
+
+\begin_layout Subsection*
+append (optional): 
+\emph on
+bool
+\end_layout
+
+\begin_layout Standard
+Fortran:
+\end_layout
+
+\begin_layout LyX-Code
 LOGICAL :: append
 \end_layout
 
 \begin_layout Standard
-Define whether the output data is to be appended at the end of the file
- if it already exists or if the existing file is to be overwritten.
- This attribute is optional, the default value is 
+Defines whether data is to be appended at the end of a file if it already
+ exists or if the existing file is to be overwritten.
+ The default value is 
 \begin_inset Flex Strong
 status collapsed
@@ -4273,5 +5696,5 @@
 
 \begin_layout Subsection*
-compression_level: 
+compression_level (optional): 
 \emph on
 integer
@@ -4287,10 +5710,10 @@
 
 \begin_layout Standard
-Define whether the fields should be compressed using NetCDF-4 built-in compressi
-on by default.
+Defines whether the fields should be compressed using NetCDF-4 built-in
+ compression by default.
  The compression level must range from 0 to 9.
- An higher compression level means a better compression at the cost of using
+ A higher compression level means a better compression at the cost of using
  more processing power.
- This attribute is optional, the default value is 
+ The default value is 
 \begin_inset Flex Strong
 status collapsed
@@ -4308,7 +5731,8 @@
 
 \begin_layout Subsection*
-time_counter: 
-\emph on
-enumeration { centered, instant, record, none }
+time_counter (optional): 
+\emph on
+enumeration {centered, instant, record, exclusive, centered_exclusive, instant_e
+xclusive, none}
 \end_layout
 
@@ -4322,5 +5746,5 @@
 
 \begin_layout Standard
-Define how the 
+Defines how the 
 \begin_inset Quotes eld
 \end_inset
@@ -4330,5 +5754,5 @@
 \end_inset
 
- variable will be outputted:
+ variable will be output:
 \end_layout
 
@@ -4340,5 +5764,6 @@
 \series default
 \emph default
-: use centered times
+: use centered times (default option for all field operations except for
+ instant)
 \end_layout
 
@@ -4350,5 +5775,9 @@
 \series default
 \emph default
-: use instant times
+: use instant times (default option for field operation 
+\series bold
+instant
+\series default
+)
 \end_layout
 
@@ -4366,4 +5795,37 @@
 
 \series bold
+\shape italic
+centered_exclusive: 
+\series default
+\shape default
+do not include centered times into an output file
+\end_layout
+
+\begin_layout Itemize
+
+\series bold
+\shape italic
+\emph on
+instant_
+\emph default
+exclusive: 
+\series default
+\shape default
+do not include instant times into an output file
+\end_layout
+
+\begin_layout Itemize
+
+\series bold
+\shape italic
+exclusive: 
+\series default
+\shape default
+include neither instant times nor centered times into an output file
+\end_layout
+
+\begin_layout Itemize
+
+\series bold
 \emph on
 none
@@ -4374,5 +5836,5 @@
 
 \begin_layout Standard
-This attribute is optional, the default value is 
+The default value is 
 \series bold
 \emph on
@@ -4384,5 +5846,5 @@
 
 \begin_layout Subsection*
-time_counter_name: 
+time_counter_name (optional): 
 \emph on
 string
@@ -4398,12 +5860,11 @@
 
 \begin_layout Standard
-Define the name of the time counter.
- This attribute is optional.
-\end_layout
-
-\begin_layout Subsection*
-timeseries: 
-\emph on
-enumeration { none, only, both, exclusive }
+Define the name of a time counter.
+\end_layout
+
+\begin_layout Subsection*
+timeseries (optional): 
+\emph on
+enumeration {none, only, both, exclusive}
 \end_layout
 
@@ -4417,5 +5878,5 @@
 
 \begin_layout Standard
-Define whether the timeseries must be outputted:
+Defines whether the timeseries must be output:
 \end_layout
 
@@ -4427,5 +5888,5 @@
 \series default
 \emph default
-: no timeseries are outputted, only the regular file
+: no timeseries is outputted, only the regular file
 \end_layout
 
@@ -4437,5 +5898,5 @@
 \series default
 \emph default
-: only the timeseries are outputted, the regular file is not created
+: only the timeseries is outputted, the regular file is not created
 \end_layout
 
@@ -4457,10 +5918,10 @@
 \series default
 \emph default
-: the timeseries are outputted and a regular file is created with only the
- fields which were not marked for output as a timeserie (if any).
-\end_layout
-
-\begin_layout Standard
-This attribute is optional, the default value is 
+: the timeseries is outputted and a regular file is created with only the
+ fields which were not marked for output as a timeseries (if any).
+\end_layout
+
+\begin_layout Standard
+The default value is 
 \series bold
 \emph on
@@ -4472,5 +5933,5 @@
 
 \begin_layout Subsection*
-ts_prefix: 
+ts_prefix (optional): 
 \emph on
 string
@@ -4486,14 +5947,24 @@
 
 \begin_layout Standard
-Define the prefix to use for the name of the timeseries files.
- This attribute is optional, by default the file 
-\series bold
-name
-\series default
- will be used.
-\end_layout
-
-\begin_layout Subsection*
-record_offset: 
+Defines the prefix to use for the name of the timeseries files.
+ By default the file name will be used.
+\end_layout
+
+\begin_layout Subsection*
+time_units (optional): 
+\emph on
+enumeration {seconds, days}
+\end_layout
+
+\begin_layout Standard
+Fortran:
+\end_layout
+
+\begin_layout LyX-Code
+CHARACTER(LEN=*) :: time_units
+\end_layout
+
+\begin_layout Subsection*
+record_offset (optional): 
 \emph on
 integer
@@ -4509,6 +5980,268 @@
 
 \begin_layout Standard
-Define offset of record from the beginning record.
- This attribute is optional, by default, its value is 0.
+Defines the offset of a record from the beginning record.
+ The default value is 0.
+\end_layout
+
+\begin_layout Subsection*
+cyclic (optional): 
+\emph on
+bool
+\end_layout
+
+\begin_layout Standard
+Fortran:
+\end_layout
+
+\begin_layout LyX-Code
+LOGICAL :: cyclic
+\end_layout
+
+\begin_layout Standard
+If the option is activated for fields to be read, then upon reaching the
+ last time record, reading will continue 
+\begin_inset Quotes eld
+\end_inset
+
+cycle
+\begin_inset Quotes erd
+\end_inset
+
+ at the first time record.
+ The default value is false.
+\end_layout
+
+\begin_layout Subsection*
+time_stamp_name (optional): 
+\begin_inset Flex Emph
+status collapsed
+
+\begin_layout Plain Layout
+string
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+Fortran: 
+\end_layout
+
+\begin_layout LyX-Code
+CHARACTER(LEN=*) :: time_stamp_name
+\end_layout
+
+\begin_layout Standard
+Defines the timestamp name of the date and time when the program was executed
+ which will be written into an output file.
+ The default value is 
+\begin_inset Quotes eld
+\end_inset
+
+timeStamp
+\begin_inset Quotes erd
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Subsection*
+time_stamp_format (optional): 
+\begin_inset Flex Emph
+status collapsed
+
+\begin_layout Plain Layout
+string
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+Fortran: 
+\end_layout
+
+\begin_layout LyX-Code
+CHARACTER(LEN=*) :: time_stamp_format
+\end_layout
+
+\begin_layout Standard
+Defines the timestamp format of the date and time when the program was executed
+ to be written into an output file.
+ It can contain any character.
+ 
+\emph on
+
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+%Y
+\end_layout
+
+\end_inset
+
+
+\emph default
+ will be replaced by the 4-digit year (4 digits), while 
+\emph on
+
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+%y
+\end_layout
+
+\end_inset
+
+
+\emph default
+ will be replaced by the 2-digit year.
+ 
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+%m
+\end_layout
+
+\end_inset
+
+ will be by the 2-digit month, while %b will be replaced by the 3-character
+ month.
+ 
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+%d
+\end_layout
+
+\end_inset
+
+ will be replaced by the day (2 char), 
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+%H
+\end_layout
+
+\end_inset
+
+ by the hour (2 char), 
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+%M
+\end_layout
+
+\end_inset
+
+ by the minute (2 char), 
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+%S
+\end_layout
+
+\end_inset
+
+ by the number of seconds, 
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+%D
+\end_layout
+
+\end_inset
+
+ by the date in the MM/DD/YY format.
+\end_layout
+
+\begin_layout Subsection*
+uuid_name (optional): 
+\begin_inset Flex Emph
+status collapsed
+
+\begin_layout Plain Layout
+string
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+Fortran: 
+\end_layout
+
+\begin_layout LyX-Code
+CHARACTER(LEN=*) :: uuid_name
+\end_layout
+
+\begin_layout Standard
+Defines the name of file's UUID.
+\end_layout
+
+\begin_layout Subsection*
+uuid_format (optional): 
+\begin_inset Flex Emph
+status collapsed
+
+\begin_layout Plain Layout
+string
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+Fortran: 
+\end_layout
+
+\begin_layout LyX-Code
+CHARACTER(LEN=*) :: uuid_format
+\end_layout
+
+\begin_layout Standard
+Defines the format of file's UUID.
+\end_layout
+
+\begin_layout Subsection*
+comment (optional): 
+\begin_inset Flex Emph
+status collapsed
+
+\begin_layout Plain Layout
+string
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+Fortran: 
+\end_layout
+
+\begin_layout LyX-Code
+CHARACTER(LEN=*) :: comment
+\end_layout
+
+\begin_layout Standard
+Allows a user to set a comment.
 \end_layout
 
@@ -4518,9 +6251,58 @@
 
 \begin_layout Subsection
+reduce_scalar_to_scalar
+\end_layout
+
+\begin_layout Subsection*
+operation (mandatory): 
+\emph on
+enumeration {min, max, sum, average}
+\end_layout
+
+\begin_layout Standard
+Fortran:
+\end_layout
+
+\begin_layout LyX-Code
+CHARACTER(LEN=*) :: operation
+\end_layout
+
+\begin_layout Standard
+Defines a reduction operation performed on a scalar across model processes.
+ (It is analogous to MPI_Allreduce.)
+\end_layout
+
+\begin_layout Subsection
+extract_axis_to_scalar
+\end_layout
+
+\begin_layout Subsection*
+position: 
+\emph on
+integer
+\end_layout
+
+\begin_layout Standard
+Fortran: 
+\end_layout
+
+\begin_layout LyX-Code
+INTEGER :: position
+\end_layout
+
+\begin_layout Standard
+Global index of a point on an axis to be extracted into a scalar.
+\end_layout
+
+\begin_layout Standard
+
+\end_layout
+
+\begin_layout Subsection
 interpolate_axis
 \end_layout
 
 \begin_layout Subsection*
-type: 
+type (optional): 
 \emph on
 string
@@ -4536,10 +6318,10 @@
 
 \begin_layout Standard
-Define the type of interpolation on an axis.
- This attribute is optional.
-\end_layout
-
-\begin_layout Subsection*
-order: 
+Defines the interpolation type on an axis.
+ For now only polynomial interpolation is available.
+\end_layout
+
+\begin_layout Subsection*
+order (optional): 
 \emph on
 integer
@@ -4555,11 +6337,70 @@
 
 \begin_layout Standard
-Define a order of interpolation.
- This attribute is optional.
+Defines the order of interpolation.
  The default value is 2.
 \end_layout
 
+\begin_layout Subsection*
+coordinate (optional): 
+\emph on
+string
+\end_layout
+
+\begin_layout Standard
+Fortran:
+\end_layout
+
+\begin_layout LyX-Code
+CHARACTER(LEN=*) :: coordinate
+\end_layout
+
+\begin_layout Standard
+Defines the coordinate associated with an axis on which interpolation will
+ be performed.
+\end_layout
+
 \begin_layout Subsection
-inverse_axis
+reduce_axis_to_axis
+\end_layout
+
+\begin_layout Subsection*
+operation (mandatory): 
+\emph on
+enumeration {min, max, sum, average}
+\end_layout
+
+\begin_layout Standard
+Fortran:
+\end_layout
+
+\begin_layout LyX-Code
+CHARACTER(LEN=*) :: operation
+\end_layout
+
+\begin_layout Standard
+Defines a reduction operation performed on an axis across model processes.
+ (It is analogous to MPI_Allreduce.)
+\end_layout
+
+\begin_layout Subsection
+reduce_axis_to_scalar
+\end_layout
+
+\begin_layout Standard
+Reduces data defined on an axis into a scalar value.
+\end_layout
+
+\begin_layout Subsection*
+operation (mandatory): 
+\emph on
+enumeration {min, max, sum, average}
+\end_layout
+
+\begin_layout Standard
+Fortran:
+\end_layout
+
+\begin_layout LyX-Code
+CHARACTER(LEN=*) :: operation
 \end_layout
 
@@ -4569,5 +6410,5 @@
 
 \begin_layout Subsection*
-begin: 
+begin (optional): 
 \begin_inset Flex Emph
 status collapsed
@@ -4591,7 +6432,6 @@
 
 \begin_layout Standard
-Define the begining index of the zoomed region on global axis.
- This attribute is optional.
- This must be an integer between 
+Defines the beginning index of a zoomed region on a global axis.
+ The attribute value should be an integer between 
 \begin_inset Flex Strong
 status collapsed
@@ -4609,63 +6449,4 @@
 \begin_layout Plain Layout
 ni_glo-1
-\end_layout
-
-\end_inset
-
- of associated axis.
- If not specified the default value is 
-\begin_inset Flex Strong
-status collapsed
-
-\begin_layout Plain Layout
-0
-\end_layout
-
-\end_inset
-
-.
-\end_layout
-
-\begin_layout Subsection*
-n: 
-\begin_inset Flex Emph
-status collapsed
-
-\begin_layout Plain Layout
-integer
-\end_layout
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Standard
-Fortran:
-\end_layout
-
-\begin_layout LyX-Code
-INTEGER :: n
-\end_layout
-
-\begin_layout Standard
-Define the size of zoomed region on global axis.
- This attribute is optional.
- This must be an integer between 
-\begin_inset Flex Strong
-status collapsed
-
-\begin_layout Plain Layout
-1
-\end_layout
-
-\end_inset
-
-and 
-\begin_inset Flex Strong
-status collapsed
-
-\begin_layout Plain Layout
-nj_glo
 \end_layout
 
@@ -4678,4 +6459,51 @@
 
 \begin_layout Plain Layout
+0
+\end_layout
+
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Subsection*
+n (optional): 
+\begin_inset Flex Emph
+status collapsed
+
+\begin_layout Plain Layout
+integer
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+Fortran:
+\end_layout
+
+\begin_layout LyX-Code
+INTEGER :: n
+\end_layout
+
+\begin_layout Standard
+Defines the size of a zoomed region on a global axis.
+ The attribute value should be an integer between 
+\begin_inset Flex Strong
+status collapsed
+
+\begin_layout Plain Layout
+1
+\end_layout
+
+\end_inset
+
+and 
+\begin_inset Flex Strong
+status collapsed
+
+\begin_layout Plain Layout
 nj_glo
 \end_layout
@@ -4684,4 +6512,130 @@
 
  of the associated axis.
+ If not specified the default value is 
+\begin_inset Flex Strong
+status collapsed
+
+\begin_layout Plain Layout
+nj_glo
+\end_layout
+
+\end_inset
+
+ of the associated axis.
+\end_layout
+
+\begin_layout Subsection
+compute_connectivity_domain
+\end_layout
+
+\begin_layout Subsection*
+n_neighbor: 
+\begin_inset Flex Emph
+status collapsed
+
+\begin_layout Plain Layout
+1D-array of integer
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+Fortran: 
+\end_layout
+
+\begin_layout LyX-Code
+INTEGER :: n_neighbor(:)
+\end_layout
+
+\begin_layout Subsection*
+local_neighbor: 
+\begin_inset Flex Emph
+status collapsed
+
+\begin_layout Plain Layout
+2D-array of integer
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+Fortran: 
+\end_layout
+
+\begin_layout LyX-Code
+INTEGER :: local_neighbor(:,:)
+\end_layout
+
+\begin_layout Subsection*
+n_neighbor_max: 
+\begin_inset Flex Emph
+status collapsed
+
+\begin_layout Plain Layout
+integer
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+Fortran:
+\end_layout
+
+\begin_layout LyX-Code
+INTEGER :: n_neighbor_max
+\end_layout
+
+\begin_layout Subsection
+extract_domain_to_axis
+\end_layout
+
+\begin_layout Subsection*
+position (optional): 
+\emph on
+integer
+\end_layout
+
+\begin_layout Standard
+Fortran: 
+\end_layout
+
+\begin_layout LyX-Code
+INTEGER :: position
+\end_layout
+
+\begin_layout Standard
+Defines the index on a domain starting which an axis will be extracted along
+ the direction specified with the 
+\series bold
+direction
+\series default
+ attribute.
+\end_layout
+
+\begin_layout Subsection*
+direction (mandatory): 
+\emph on
+enumeration {iDir, jDir}
+\end_layout
+
+\begin_layout Standard
+Fortran:
+\end_layout
+
+\begin_layout LyX-Code
+CHARACTER(LEN=*) :: direction
+\end_layout
+
+\begin_layout Standard
+Defines the domain dimension along which an axis will be extracted.
 \end_layout
 
@@ -4691,5 +6645,5 @@
 
 \begin_layout Subsection*
-file: 
+file (optional): 
 \emph on
 string
@@ -4705,18 +6659,286 @@
 
 \begin_layout Standard
-Define the file which contains the weight value to interpolate from domain
+Define a file which contains the weight values for interpolation from domain
  source to domain destination.
- This attribute is optional.
  If not specified, the internal interpolation module will be used.
 \end_layout
 
 \begin_layout Subsection*
+order (optional): 
+\emph on
+integer
+\end_layout
+
+\begin_layout Standard
+Fortran: 
+\end_layout
+
+\begin_layout LyX-Code
+INTEGER :: order
+\end_layout
+
+\begin_layout Standard
+Defines the order of interpolation.
+ This attribute is only for internal interpolation module.
+ The default value is 2.
+\end_layout
+
+\begin_layout Subsection
+reduce_domain_to_axis
+\end_layout
+
+\begin_layout Subsection*
+direction: 
+\emph on
+enumeration {iDir, jDir}
+\end_layout
+
+\begin_layout Standard
+Fortran:
+\end_layout
+
+\begin_layout LyX-Code
+CHARACTER(LEN=*) :: direction
+\end_layout
+
+\begin_layout Standard
+Defines the domain dimension along which a reduction of the domain into
+ an axis will be performed.
+\end_layout
+
+\begin_layout Subsection*
+operation (mandatory): 
+\emph on
+enumeration {min, max, sum, average}
+\end_layout
+
+\begin_layout Standard
+Fortran:
+\end_layout
+
+\begin_layout LyX-Code
+CHARACTER(LEN=*) :: operation
+\end_layout
+
+\begin_layout Subsection*
+local: 
+\emph on
+bool
+\end_layout
+
+\begin_layout Standard
+Fortran:
+\end_layout
+
+\begin_layout LyX-Code
+LOGICAL :: local
+\end_layout
+
+\begin_layout Standard
+Defines whether the reduction should be performed locally on data owned
+ by each process.
+\end_layout
+
+\begin_layout Subsection
+reduce_domain_to_scalar
+\end_layout
+
+\begin_layout Standard
+Reduces data defined on a domain into a scalar value.
+\end_layout
+
+\begin_layout Subsection*
+operation (mandatory): 
+\emph on
+enumeration {min, max, sum, average}
+\end_layout
+
+\begin_layout Standard
+Fortran:
+\end_layout
+
+\begin_layout LyX-Code
+CHARACTER(LEN=*) :: operation
+\end_layout
+
+\begin_layout Subsection*
+local: 
+\emph on
+bool
+\end_layout
+
+\begin_layout Standard
+Fortran:
+\end_layout
+
+\begin_layout LyX-Code
+LOGICAL :: local
+\end_layout
+
+\begin_layout Standard
+Defines whether the reduction should be performed locally on data owned
+ by each process.
+\end_layout
+
+\begin_layout Subsection
+reorder_domain
+\end_layout
+
+\begin_layout Subsection*
+invert_lat (optional): 
+\emph on
+bool
+\end_layout
+
+\begin_layout Standard
+Fortran:
+\end_layout
+
+\begin_layout LyX-Code
+LOGICAL :: invert_lat
+\end_layout
+
+\begin_layout Standard
+Defines whether the latitude should be inverted.
+ The default value is false.
+\end_layout
+
+\begin_layout Subsection*
+shift_lon_fraction (optional): 
+\begin_inset Flex Emph
+status collapsed
+
+\begin_layout Plain Layout
+double
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+Fortran: 
+\end_layout
+
+\begin_layout LyX-Code
+DOUBLE PRECISION :: shift_lon_fraction
+\end_layout
+
+\begin_layout Standard
+Defines the longitude offset.
+ The value of the parameter represents a fraction of 
+\series bold
+ni_glo
+\series default
+.
+\end_layout
+
+\begin_layout Subsection*
+min_lon (optional): 
+\begin_inset Flex Emph
+status collapsed
+
+\begin_layout Plain Layout
+double
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+Fortran: 
+\end_layout
+
+\begin_layout LyX-Code
+DOUBLE PRECISION :: min_lon
+\end_layout
+
+\begin_layout Standard
+If both, 
+\series bold
+min_lon
+\series default
+ and 
+\series bold
+max_lon
+\series default
+, are defined, a domain will be reordered with latitude values starting
+ from 
+\series bold
+min_lon
+\series default
+ and ending at 
+\series bold
+max_lon
+\series default
+.
+\end_layout
+
+\begin_layout Subsection*
+max_lon (optional): 
+\begin_inset Flex Emph
+status collapsed
+
+\begin_layout Plain Layout
+double
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+Fortran: 
+\end_layout
+
+\begin_layout LyX-Code
+DOUBLE PRECISION :: max_lon
+\end_layout
+
+\begin_layout Standard
+If both, 
+\series bold
+min_lon
+\series default
+ and 
+\series bold
+max_lon
+\series default
+, are defined, a domain will be reordered with latitude values starting
+ from 
+\series bold
+min_lon
+\series default
+ and ending at 
+\series bold
+max_lon
+\series default
+.
+\end_layout
+
+\begin_layout Subsection
+expand_domain
+\end_layout
+
+\begin_layout Subsection*
 order: 
-\emph on
+\begin_inset Flex Emph
+status collapsed
+
+\begin_layout Plain Layout
 integer
 \end_layout
 
-\begin_layout Standard
-Fortran: 
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+Fortran:
 \end_layout
 
@@ -4725,9 +6947,63 @@
 \end_layout
 
-\begin_layout Standard
-Define a order of interpolation.
- This attribute is only for internal interoplation module.
- This attribute is optional.
- The default value is 2.
+\begin_layout Subsection*
+type (optional): 
+\emph on
+enumeration {node, edge}
+\end_layout
+
+\begin_layout Standard
+Fortran:
+\end_layout
+
+\begin_layout LyX-Code
+CHARACTER(LEN=*) :: type
+\end_layout
+
+\begin_layout Standard
+Defines whether the node or edge connectivity should be calculated for the
+ expanded domain.
+\end_layout
+
+\begin_layout Subsection*
+i_periodic (optional): 
+\emph on
+bool
+\end_layout
+
+\begin_layout Standard
+Fortran:
+\end_layout
+
+\begin_layout LyX-Code
+LOGICAL :: i_periodic
+\end_layout
+
+\begin_layout Standard
+If the attribute value is true, values of fields defined on the expanded
+ domain will be duplicated from those of the original domain periodically
+ along the first dimension.
+ The default value is false (masked values on the expanded domain).
+\end_layout
+
+\begin_layout Subsection*
+j_periodic (optional): 
+\emph on
+bool
+\end_layout
+
+\begin_layout Standard
+Fortran:
+\end_layout
+
+\begin_layout LyX-Code
+LOGICAL :: j_periodic
+\end_layout
+
+\begin_layout Standard
+If the attribute value is true, values of fields defined on the expanded
+ domain will be duplicated from those of the original domain periodically
+ along the second dimension.
+ The default value is false (masked values on the expanded domain).
 \end_layout
 
@@ -4737,5 +7013,5 @@
 
 \begin_layout Subsection*
-ibegin: 
+ibegin (optional): 
 \begin_inset Flex Emph
 status collapsed
@@ -4759,7 +7035,6 @@
 
 \begin_layout Standard
-Define the begining index of the zoomed region on the first dimension of
- the global domain.
- This attribute is optional.
+Defines the beginning index of the zoomed region on the first dimension
+ of the global domain.
  This must be an integer between 
 \begin_inset Flex Strong
@@ -4794,8 +7069,10 @@
 
 .
-\end_layout
-
-\begin_layout Subsection*
-ni: 
+ Note that if one of the zoom attributes (ibegin, ni, jbegin or nj) is defined
+ then all the rest should be specified by a user as well.
+\end_layout
+
+\begin_layout Subsection*
+ni (optional): 
 \begin_inset Flex Emph
 status collapsed
@@ -4820,5 +7097,4 @@
 \begin_layout Standard
 Define the size of zoomed region on the first dimension of the global domain.
- This attribute is optional.
  This must be an integer between 
 \begin_inset Flex Strong
@@ -4853,8 +7129,10 @@
 
  of the dimension of domain.
-\end_layout
-
-\begin_layout Subsection*
-jbegin: 
+ Note that if one of the zoom attributes (ibegin, ni, jbegin or nj) is defined
+ then all the rest should be specified by a user as well.
+\end_layout
+
+\begin_layout Subsection*
+jbegin (optional): 
 \begin_inset Flex Emph
 status collapsed
@@ -4878,7 +7156,6 @@
 
 \begin_layout Standard
-Define the begining index of the zoomed region on the second dimension of
- the global domain.
- This attribute is optional.
+Define the beginning index of the zoomed region on the second dimension
+ of the global domain.
  This must be an integer between 
 \begin_inset Flex Strong
@@ -4913,8 +7190,10 @@
 
 .
-\end_layout
-
-\begin_layout Subsection*
-nj: 
+ Note that if one of the zoom attributes (ibegin, ni, jbegin or nj) is defined
+ then all the rest should be specified by a user as well.
+\end_layout
+
+\begin_layout Subsection*
+nj (optional): 
 \begin_inset Flex Emph
 status collapsed
@@ -4939,6 +7218,5 @@
 \begin_layout Standard
 Define the size of zoomed region on the second dimension of the global domain.
- This attribute is optional.
- This must be an integer between 
+ The attribute value should be an integer between 
 \begin_inset Flex Strong
 status collapsed
@@ -4972,4 +7250,6 @@
 
  of the dimension of domain.
+ Note that if one of the zoom attributes (ibegin, ni, jbegin or nj) is defined
+ then all the rest should be specified by a user as well.
 \end_layout
 
@@ -4978,6 +7258,294 @@
 \end_layout
 
-\begin_layout Standard
-
+\begin_layout Subsection*
+lon_start (optional): 
+\begin_inset Flex Emph
+status collapsed
+
+\begin_layout Plain Layout
+double
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+Fortran: 
+\end_layout
+
+\begin_layout LyX-Code
+DOUBLE PRECISION :: lon_start
+\end_layout
+
+\begin_layout Standard
+Along with 
+\series bold
+lon_end
+\series default
+, the attribute defines the longitude range of a generated domain.
+\end_layout
+
+\begin_layout Subsection*
+lon_end (optional): 
+\begin_inset Flex Emph
+status collapsed
+
+\begin_layout Plain Layout
+double
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+Fortran: 
+\end_layout
+
+\begin_layout LyX-Code
+DOUBLE PRECISION :: lon_end
+\end_layout
+
+\begin_layout Standard
+Along with 
+\series bold
+lon_start
+\series default
+, the attribute defines the longitude range of a generated domain.
+\end_layout
+
+\begin_layout Subsection*
+lat_start (optional): 
+\begin_inset Flex Emph
+status collapsed
+
+\begin_layout Plain Layout
+double
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+Fortran: 
+\end_layout
+
+\begin_layout LyX-Code
+DOUBLE PRECISION :: lat_start
+\end_layout
+
+\begin_layout Standard
+Along with 
+\series bold
+lat_end
+\series default
+, the attribute defines the latitude range of a generated domain.
+\end_layout
+
+\begin_layout Subsection*
+lat_end (optional): 
+\begin_inset Flex Emph
+status collapsed
+
+\begin_layout Plain Layout
+double
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+Fortran: 
+\end_layout
+
+\begin_layout LyX-Code
+DOUBLE PRECISION :: lat_end
+\end_layout
+
+\begin_layout Standard
+Along with 
+\series bold
+lat_start
+\series default
+, the attribute defines the latitude range of a generated domain.
+\end_layout
+
+\begin_layout Subsection*
+bounds_lon_start: 
+\begin_inset Flex Emph
+status collapsed
+
+\begin_layout Plain Layout
+double
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+Fortran: 
+\end_layout
+
+\begin_layout LyX-Code
+DOUBLE PRECISION :: bounds_lon_start
+\end_layout
+
+\begin_layout Standard
+Attributes 
+\series bold
+bounds_lon_start
+\series default
+ and 
+\series bold
+bounds_lon_start
+\series default
+ set the longitude range of a generated domain.
+ If both sets, 
+\series bold
+(lon_start, lon_end)
+\series default
+ and 
+\series bold
+(bounds_lon_start, bounds_lon_end)
+\series default
+, are specified then the bound attributes will be ignored.
+\end_layout
+
+\begin_layout Subsection*
+bounds_lon_end: 
+\begin_inset Flex Emph
+status collapsed
+
+\begin_layout Plain Layout
+double
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+Fortran: 
+\end_layout
+
+\begin_layout LyX-Code
+DOUBLE PRECISION :: bounds_lon_end
+\end_layout
+
+\begin_layout Standard
+Attributes 
+\series bold
+bounds_lon_start
+\series default
+ and 
+\series bold
+bounds_lon_start
+\series default
+ set the longitude range of a generated domain.
+ If both sets, 
+\series bold
+(lon_start, lon_end)
+\series default
+ and 
+\series bold
+(bounds_lon_start, bounds_lon_end)
+\series default
+, are specified then the bound attributes will be ignored.
+\end_layout
+
+\begin_layout Subsection*
+bounds_lat_start: 
+\begin_inset Flex Emph
+status collapsed
+
+\begin_layout Plain Layout
+double
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+Fortran: 
+\end_layout
+
+\begin_layout LyX-Code
+DOUBLE PRECISION :: bounds_lat_start
+\end_layout
+
+\begin_layout Standard
+Attributes 
+\series bold
+bounds_lat_start
+\series default
+ and 
+\series bold
+bounds_lat_start
+\series default
+ set the latitude range of a generated domain.
+ If both sets, 
+\series bold
+(lat_start, lat_end)
+\series default
+ and 
+\series bold
+(bounds_lat_start, bounds_lat_end)
+\series default
+, are specified then the bound attributes will be ignored.
+\end_layout
+
+\begin_layout Subsection*
+bounds_lat_end: 
+\begin_inset Flex Emph
+status collapsed
+
+\begin_layout Plain Layout
+double
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+Fortran: 
+\end_layout
+
+\begin_layout LyX-Code
+DOUBLE PRECISION :: bounds_lat_end
+\end_layout
+
+\begin_layout Standard
+Attributes 
+\series bold
+bounds_lat_start
+\series default
+ and 
+\series bold
+bounds_lat_start
+\series default
+ set the latitude range of a generated domain.
+ If both sets, 
+\series bold
+(lat_start, lat_end)
+\series default
+ and 
+\series bold
+(bounds_lat_start, bounds_lat_end)
+\series default
+, are specified then the bound attributes will be ignored.
 \end_layout
 
@@ -5521,9 +8089,9 @@
 
 \begin_layout Standard
-This set of subroutines enable the models to interact, complete or query
+This set of subroutines enables the models to interact, complete or query
  the XML tree data base.
  New elements or group of elements can be added as child in the tree, attributes
  of the elements can be set or query.
- The type of element actually available are: context, axis, domain, grid,
+ The type of elements currently available are: context, axis, domain, grid,
  field, variable and file.
  An element can be identified by a string or by an handle associated to
@@ -5702,5 +8270,5 @@
 
 \begin_layout Standard
-where element is one of the existing element or group of element.
+where element is one of the existing elements or group of elements.
 \end_layout
 
@@ -5740,7 +8308,7 @@
 
 \begin_layout Standard
-This subroutine return the handle of the specified element identified by
+This subroutine returns the handle of the specified element identified by
  its string.
- The element must be existing otherwise it raise an error.
+ The element must be existing otherwise an error is raised.
 \end_layout
 
@@ -5762,5 +8330,5 @@
 
 \begin_layout Standard
-where element is one of the existing element or group of element.
+where element is one of the existing elements or group of elements.
 \end_layout
 
@@ -5787,7 +8355,14 @@
 
 \begin_layout Standard
-This function return .TRUE.
- if the element defined by the string identifier id is existing in the data
- base, otherwise it return .FALSE.
+This function returns .TRUE.
+ if the element defined by the string identifier 
+\begin_inset Quotes eld
+\end_inset
+
+id
+\begin_inset Quotes erd
+\end_inset
+
+ exists in the data base, otherwise it returns .FALSE.
  .
 \end_layout
@@ -5818,5 +8393,5 @@
 
 \begin_layout Standard
-where element is one of the existing element or group of element.
+where element is one of the existing elements or element groups.
 \end_layout
 
@@ -5869,16 +8444,16 @@
 
 \begin_layout Standard
-This subroutine add a child to an existing parent element.
+This subroutine adds a child to an existing parent element.
  The identifier of the child, if existing, can be specified optionally.
- All group elements can contains child of the same kind, provided generic
+ All group elements can contain child of the same type, provided generic
  inheritance.
- Some elements can contains children of an other kind for a specific behaviour.
- File element may contains field_group, field, variable and variable_group
+ Some elements can contain children of another type for a specific behavior.
+ File element may contain field_group, field, variable and variable_group
  child elements.
- Field elements may contains variable_group of variable child element.
-\end_layout
-
-\begin_layout Subsection*
-Query if a value of an element attributes is defined (by handle)
+ Field elements may contain variable_group of variable child element.
+\end_layout
+
+\begin_layout Subsection*
+Query if the value of an element attribute is defined (by handle)
 \end_layout
 
@@ -5909,5 +8484,5 @@
 
 \begin_layout Standard
-where element is one of the existing element or group of element.
+where element is one of the existing elements or element groups.
  attribute_x is describing in the chapter dedicated to the attribute description.
 \end_layout
@@ -5948,5 +8523,5 @@
 
 \begin_layout Standard
-This subroutine my be used to query if one or more attributes of an element
+This subroutine can be used to query if one or more attributes of an element
  have a defined value.
  The list of attributes and their type are described in a specific chapter
@@ -5985,5 +8560,5 @@
 
 \begin_layout Standard
-where element is one of the existing element or group of element.
+where element is one of the existing elements or element groups.
  attribute_x is describing in the chapter dedicated to the attribute description.
 \end_layout
@@ -6024,5 +8599,5 @@
 
 \begin_layout Standard
-This subroutine my be used to query if one or more attributes of an element
+This subroutine can be used to query if one or more attributes of an element
  have a defined value.
  The list of available attributes and their type are described in a specific
@@ -6061,5 +8636,5 @@
 
 \begin_layout Standard
-where element is one of the existing element or group of element.
+where element is one of the existing elements or element groups.
  attribute_x and attribute_type_x are describing in the chapter dedicated
  to the attribute description.
@@ -6101,8 +8676,8 @@
 
 \begin_layout Standard
-This subroutine my be used to set one or more attribute to an element defined
- by its handle.
- The list of available attributes and their type are described in a specific
- chapter of the documentation.
+This subroutine can be used to set one or more attributes of an element
+ defined by its handle.
+ The list of available attributes and their types are described in corresponding
+ chapters of the documentation.
  
 \end_layout
@@ -6138,5 +8713,81 @@
 
 \begin_layout Standard
-where element is one of the existing element or group of element.
+where element is one of the existing elements or element groups.
+ The attributes attribute_x and attribute_type_x are described in corresponding
+ chapters.
+\end_layout
+
+\begin_layout Subsubsection*
+Arguments:
+\end_layout
+
+\begin_layout Itemize
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+id
+\end_layout
+
+\end_inset
+
+: string identifier.
+\end_layout
+
+\begin_layout Itemize
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+attr_x
+\end_layout
+
+\end_inset
+
+: value of the attribute to be set.
+\end_layout
+
+\begin_layout Subsubsection*
+Description:
+\end_layout
+
+\begin_layout Standard
+This subroutine can be used to set one or more attributes of an element
+ defined by its string id.
+ The list of available attributes and their type are described in corresponding
+ chapters of the documentation.
+\end_layout
+
+\begin_layout Subsection*
+Getting element attributes value (by handle)
+\end_layout
+
+\begin_layout Subsubsection*
+Synopsis:
+\end_layout
+
+\begin_layout LyX-Code
+SUBROUTINE xios_get_attr(handle, attr_1=attribute_1, attr_2=attribute_2,
+ ...)
+\end_layout
+
+\begin_layout LyX-Code
+TYPE(xios_element)         , INTENT(IN) :: handle
+\end_layout
+
+\begin_layout LyX-Code
+attribute_type_1, OPTIONAL  , INTENT(OUT) :: attr_1
+\end_layout
+
+\begin_layout LyX-Code
+attribute_type_2, OPTIONAL  , INTENT(OUT) :: attr_2
+\end_layout
+
+\begin_layout LyX-Code
+....
+\end_layout
+
+\begin_layout Standard
+where element is one of the existing elements or element groups.
  attribute_x and attribute_type_x are describing in the chapter dedicated
  to the attribute description.
@@ -6152,10 +8803,10 @@
 
 \begin_layout Plain Layout
-id
-\end_layout
-
-\end_inset
-
-: string identifier.
+handle
+\end_layout
+
+\end_inset
+
+: element handle.
 \end_layout
 
@@ -6170,5 +8821,5 @@
 \end_inset
 
-: value of the attribute to be set.
+: value of the attribute to be get.
 \end_layout
 
@@ -6178,81 +8829,5 @@
 
 \begin_layout Standard
-This subroutine my be used to set one or more attribute to an element defined
- by its string id.
- The list of available attributes and their type are described in a specific
- chapter of the documentation.
-\end_layout
-
-\begin_layout Subsection*
-Getting element attributes value (by handle)
-\end_layout
-
-\begin_layout Subsubsection*
-Synopsis:
-\end_layout
-
-\begin_layout LyX-Code
-SUBROUTINE xios_get_attr(handle, attr_1=attribute_1, attr_2=attribute_2,
- ...)
-\end_layout
-
-\begin_layout LyX-Code
-TYPE(xios_element)         , INTENT(IN) :: handle
-\end_layout
-
-\begin_layout LyX-Code
-attribute_type_1, OPTIONAL  , INTENT(OUT) :: attr_1
-\end_layout
-
-\begin_layout LyX-Code
-attribute_type_2, OPTIONAL  , INTENT(OUT) :: attr_2
-\end_layout
-
-\begin_layout LyX-Code
-....
-\end_layout
-
-\begin_layout Standard
-where element is one of the existing element or group of element.
- attribute_x and attribute_type_x are describing in the chapter dedicated
- to the attribute description.
-\end_layout
-
-\begin_layout Subsubsection*
-Arguments:
-\end_layout
-
-\begin_layout Itemize
-\begin_inset Flex Code
-status collapsed
-
-\begin_layout Plain Layout
-handle
-\end_layout
-
-\end_inset
-
-: element handle.
-\end_layout
-
-\begin_layout Itemize
-\begin_inset Flex Code
-status collapsed
-
-\begin_layout Plain Layout
-attr_x
-\end_layout
-
-\end_inset
-
-: value of the attribute to be get.
-\end_layout
-
-\begin_layout Subsubsection*
-Description:
-\end_layout
-
-\begin_layout Standard
-This subroutine my be used to get one or more attribute value of an element
+This subroutine can be used to get one or more attribute value of an element
  defined by its handle.
  All attributes in the arguments list must be defined.
@@ -6292,5 +8867,5 @@
 
 \begin_layout Standard
-where element is one of the existing element or group of element.
+where element is one of the existing elements or element groups.
  attribute_x is describing in the chapter dedicated to the attribute description.
 \end_layout
@@ -6331,5 +8906,5 @@
 
 \begin_layout Standard
-This subroutine my be used to get one or more attribute value of an element
+This subroutine can be used to get one or more attribute value of an element
  defined by its handle.
  All attributes in the arguments list must have a defined value.
@@ -6339,5 +8914,5 @@
 
 \begin_layout Section*
-Interface relative to context management
+Context management interface
 \end_layout
 
@@ -6397,5 +8972,5 @@
 
 \begin_layout Standard
-This subroutine initialize a context identified by 
+This subroutine initializes a context identified by 
 \begin_inset Flex Code
 status collapsed
@@ -6459,5 +9034,5 @@
 
 \begin_layout Standard
-This subroutine must be call to close a context, before the 
+This subroutine must be called to close a context before the 
 \begin_inset Flex Code
 status collapsed
@@ -6470,6 +9045,6 @@
 
  call.
- It waits until that all pending request sent to the servers will be processed
- and the opened files will be closed.
+ It waits until that all pending requests sent to the servers will be processed
+ and all opened files will be closed.
 \end_layout
 
@@ -6542,6 +9117,7 @@
 \begin_layout Standard
 These subroutines set the current active context.
- All xios calls after will refer to this active context.
- If only one context is defined, it is automatically set as the active context.
+ All following XIOS calls will refer to this active context.
+ If only one context is defined, it will be set automatically as the active
+ context.
  
 \end_layout
@@ -6572,5 +9148,5 @@
 
 \begin_layout Standard
-This subroutine must be call when all definitions of a context is finished
+This subroutine must be called when all definitions of a context are finished
  at the end of the initialization and before entering to the time loop.
  A lot of operations are performed internally (inheritance, grid definition,
@@ -6581,5 +9157,5 @@
 
 \begin_layout Section*
-Interface relative to calendar management
+Calendar management interface
 \end_layout
 
@@ -7418,5 +9994,5 @@
 
 \begin_layout Section*
-Interface relative to duration handling
+Duration handling interface
 \end_layout
 
@@ -7988,5 +10564,5 @@
 This function returns the number of seconds since the beginning of the day
  for the specified date, based on the calendar of the current context.
- It must not be used before the calendar was created.
+ It should not be used before the calendar was created.
 \end_layout
 
@@ -8030,6 +10606,6 @@
 \begin_layout Standard
 This function returns the fraction of day corresponding to the specified
- date, based on the calendar of the current context.
- It must not be used before the calendar was created.
+ date based on the calendar of the current context.
+ It should not be used before the calendar was created.
 \end_layout
 
Index: XIOS/dev/dev_trunk_graph/doc/XIOS_user_guide.lyx
===================================================================
--- XIOS/dev/dev_trunk_graph/doc/XIOS_user_guide.lyx	(revision 2019)
+++ XIOS/dev/dev_trunk_graph/doc/XIOS_user_guide.lyx	(revision 2020)
@@ -4051,5 +4051,5 @@
 \end_inset
 
-, field_A)
+, field_B)
 \end_layout
 
@@ -4057,4 +4057,166 @@
 
 .
+\end_layout
+
+\begin_layout Standard
+XIOS also provides the means to define an expression in a Fortran code via
+ the field attribute 
+\begin_inset Quotes eld
+\end_inset
+
+expr
+\begin_inset Quotes erd
+\end_inset
+
+.
+ The example above can rewritten as
+\begin_inset listings
+lstparams "language=XML,breaklines=true,tabsize=2,frame=tb,postbreak={\raisebox{0ex}[0ex][0ex]{\ensuremath{\rcurvearrowse\space}}}"
+inline false
+status open
+
+\begin_layout Plain Layout
+
+<?xml version="1.0"?>
+\end_layout
+
+\begin_layout Plain Layout
+
+<simulation>
+\end_layout
+
+\begin_layout Plain Layout
+
+	<context id="test">
+\end_layout
+
+\begin_layout Plain Layout
+
+		<calendar type="Gregorian" timestep="1h" />
+\end_layout
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\begin_layout Plain Layout
+
+		<grid_definition>
+\end_layout
+
+\begin_layout Plain Layout
+
+			<grid id="grid_A"><!-- Definition ommited --></grid>
+\end_layout
+
+\begin_layout Plain Layout
+
+		</grid_definition>
+\end_layout
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\begin_layout Plain Layout
+
+		<file_definition>
+\end_layout
+
+\begin_layout Plain Layout
+
+			<file name="output" output_freq="1d">
+\end_layout
+
+\begin_layout Plain Layout
+
+        		<field id="field_B" grid_ref="grid_A" operation="average">
+\end_layout
+
+\begin_layout Plain Layout
+
+        		<field id="field_C" field_ref="field_B">
+\end_layout
+
+\begin_layout Plain Layout
+
+			</file>
+\end_layout
+
+\begin_layout Plain Layout
+
+		</file_definition>
+\end_layout
+
+\begin_layout Plain Layout
+
+	</context>
+\end_layout
+
+\begin_layout Plain Layout
+
+</simulation>
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+while the two expressions can be specified with the following calls: 
+\begin_inset Flex Code
+status open
+
+\begin_layout Plain Layout
+xios_set_field_attr(
+\begin_inset Quotes eld
+\end_inset
+
+field_B
+\begin_inset Quotes erd
+\end_inset
+
+, expr=
+\begin_inset Quotes erd
+\end_inset
+
+@this + 273.15
+\begin_inset Quotes erd
+\end_inset
+
+
+\end_layout
+
+\end_inset
+
+ and 
+\begin_inset Flex Code
+status open
+
+\begin_layout Plain Layout
+xios_set_field_attr(
+\begin_inset Quotes eld
+\end_inset
+
+field_C
+\begin_inset Quotes erd
+\end_inset
+
+, expr=
+\begin_inset Quotes erd
+\end_inset
+
+log10(field_B)
+\begin_inset Quotes erd
+\end_inset
+
+
+\end_layout
+
+\end_inset
+
+.
+ 
 \end_layout
 
@@ -5006,5 +5168,5 @@
 \begin_layout Standard
 Some of XIOS behaviors can be configured using options.
- Those options must be expressed as variables in a specific context whose
+ Those options must be exprhessed as variables in a specific context whose
  
 \series bold
@@ -5100,36 +5262,14 @@
 
 \begin_layout Standard
-To improve I/O performance and to be able to use HDF5 compression with the
- 
-\series bold
-\emph on
-
-\begin_inset Quotes eld
-\end_inset
-
-multiple_file
-\begin_inset Quotes erd
-\end_inset
-
-
-\series default
-\emph default
- mode, it is possible to separate servers into two levels: intermediaries
- (level one) and writers (level two).
- A single MPI communicator will be created for the intermediaries, while
- multiple communicators will be created for the writers according to the
- number of 
-\begin_inset Quotes eld
-\end_inset
-
-pools
-\begin_inset Quotes erd
-\end_inset
-
- which can be set by a user.
+To improve I/O performance, it is possible to separate servers into two
+ levels: intermediaries (level one) and writers (level two).
  Level-one servers will receive data from clients and will redistribute
- it to be sent to pools of level-two servers whilst level-two servers will
- do the I/O (important: for now level-two servers only do writing data).
- Secondary servers can be launched by means of three parameters:
+ and send the data to subsets of level-two servers (called âpoolsâ), whilst
+ level-two servers will do the I/O.
+ Each file is written by only one pool.
+ If one process is assigned per pool (which is the default option), the
+ I/O is sequential and HDF5 compression can be used even in the âmultiple_fileâ
+ mode.
+ Level-two servers can be launched and controlled by means of three parameters:
 \end_layout
 
@@ -5283,10 +5423,4 @@
 
 \begin_layout Standard
-Note that with one server per pool, the I/O is actually sequential and thus
- the use of HDF5 compression is possible.
- 
-\end_layout
-
-\begin_layout Standard
 By default file distribution among server-two pools is optimized for bandwidth.
  An alternative way of distributing files is possible in order to minimize
@@ -5438,5 +5572,5 @@
 \begin_inset Formula 
 \[
-{\scriptstyle used\_size\;=\;\min\left(minimum\_buffer\_size,\; detected\_size\;\times\; buffer\_size\_factor\right)}
+{\scriptstyle used\_size\;=\;\min\left(minimum\_buffer\_size,\;detected\_size\;\times\;buffer\_size\_factor\right)}
 \]
 
Index: XIOS/dev/dev_trunk_graph/inputs/COMPLETE/context_atmosphere.xml
===================================================================
--- XIOS/dev/dev_trunk_graph/inputs/COMPLETE/context_atmosphere.xml	(revision 2019)
+++ XIOS/dev/dev_trunk_graph/inputs/COMPLETE/context_atmosphere.xml	(revision 2020)
@@ -10,8 +10,8 @@
   <file_definition type="multiple_file" par_access="collective" output_freq="6h" sync_freq="6h" output_level="10" enabled=".TRUE.">
     <file id="output_atmosphere" name="output_atmosphere">
-      <field field_ref="field_A_atm" build_workflow_graph=".TRUE." />
+      <field field_ref="field_A_atm" />
     </file>
     <file id="output_atmosphere_zoom" name="output_atmosphere_zoom">
-      <field field_ref="field_A_atm_zoom" name="field_A_atm_zoom"  build_workflow_graph=".TRUE."/>
+      <field field_ref="field_A_atm_zoom" name="field_A_atm_zoom" />
     </file>
   </file_definition>
Index: XIOS/dev/dev_trunk_graph/inputs/COMPLETE/context_surface.xml
===================================================================
--- XIOS/dev/dev_trunk_graph/inputs/COMPLETE/context_surface.xml	(revision 2019)
+++ XIOS/dev/dev_trunk_graph/inputs/COMPLETE/context_surface.xml	(revision 2020)
@@ -20,5 +20,5 @@
         <variable id="my_attribute5" type="double">100.201</variable>
       </field>
-      <field field_ref="field_A_srf_K" build_workflow_graph=".FALSE."/>
+      <field field_ref="field_A_srf_K" />
       <field field_ref="field_A_srf_K_2" name="field_A_srf_K_2" /> <!-- Should be identical to field_A_srf_K -->
       <field field_ref="field_A_srf_K" name="field_A_srf_K_3">field_A_srf_K</field> <!-- Should be identical to field_A_srf_K -->
@@ -28,9 +28,9 @@
       <field field_ref="field_A_srf" name="field_A_srf_max" operation="maximum" />
       <field field_ref="field_A_srf" name="field_A_srf_prec4" prec="8" />
-      <field field_ref="field_A_srf_max" name="field_A_srf_mean_max" build_workflow_graph=".FALSE." long_name="Average of hourly maximum over 6h" operation="average" freq_op="1h"> @field_A_srf_max </field>
+      <field field_ref="field_A_srf_max" name="field_A_srf_mean_max" long_name="Average of hourly maximum over 6h" operation="average" freq_op="1h"> @field_A_srf_max </field>
       <variable id="my_global_attribute" type="string">file_6h</variable>
     </file>
 
-    <file type="one_file" id="output_surface_1d" name="output_surface_1d" output_freq="1d" enabled="FALSE">
+    <file type="one_file" id="output_surface_1d" name="output_surface_1d" output_freq="1d" enabled="TRUE">
       <field field_ref="field_A_srf" indexed_output="TRUE">
         <variable id="my_attribute1" type="string">surf_att</variable>
@@ -43,5 +43,5 @@
       <field field_ref="field_A_srf" name="field_A_srf_max" operation="maximum" />
       <field field_ref="field_A_srf" name="field_A_srf_prec4" prec="8" />
-      <field field_ref="field_A_srf_max" name="field_A_srf_mean_max" build_workflow_graph=".TRUE." long_name="Average of hourly maximum over 1d" operation="average" freq_op="1h"> @field_A_srf_max </field>
+      <field field_ref="field_A_srf_max" name="field_A_srf_mean_max" long_name="Average of hourly maximum over 1d" operation="average" freq_op="1h"> @field_A_srf_max </field>
       <variable id="my_global_attribute" type="string" >file_1d</variable>
     </file>
Index: XIOS/dev/dev_trunk_graph/inputs/REMAP/iodef.xml
===================================================================
--- XIOS/dev/dev_trunk_graph/inputs/REMAP/iodef.xml	(revision 2019)
+++ XIOS/dev/dev_trunk_graph/inputs/REMAP/iodef.xml	(revision 2020)
@@ -34,9 +34,9 @@
       <file_group id="write_files" >
         <file id="output_2D" name="output_2D" >
-          <field field_ref="src_field_2D" name="field_src" build_workflow_graph=".TRUE." />
-          <field field_ref="src_field_2D" name="field_dst_regular_0"  domain_ref="dst_domain_regular_pole" default_value="10.e+5" build_workflow_graph=".TRUE."/>
-          <field field_ref="dst_field_2D" name="field_dst_regular_1" build_workflow_graph=".TRUE."/>
-          <field field_ref="dst_field_2D_regular_pole" name="field_dst_regular_2" build_workflow_graph=".TRUE."/>
-          <field field_ref="dst_field_2D_clone" name="field_dst_regular_3" build_workflow_graph=".TRUE."/>
+          <field field_ref="src_field_2D" name="field_src" />
+          <field field_ref="src_field_2D" name="field_dst_regular_0"  domain_ref="dst_domain_regular_pole" default_value="10.e+5"/>
+          <field field_ref="dst_field_2D" name="field_dst_regular_1" />
+          <field field_ref="dst_field_2D_regular_pole" name="field_dst_regular_2" />
+          <field field_ref="dst_field_2D_clone" name="field_dst_regular_3" />
         </file> 
        <file id="output_3D" name="output_3D" >
Index: XIOS/dev/dev_trunk_graph/inputs/iodef.xml
===================================================================
--- XIOS/dev/dev_trunk_graph/inputs/iodef.xml	(revision 2019)
+++ XIOS/dev/dev_trunk_graph/inputs/iodef.xml	(revision 2020)
@@ -18,5 +18,5 @@
       <file id="output" name="output" enabled=".TRUE.">
         <!-- <field field_ref="field_Domain" name="field_A" /> -->
-        <field field_ref="field_A" name="field_A" build_workflow_graph=".TRUE." /> 
+        <field field_ref="field_A" name="field_A" /> 
         <field field_ref="field_A_zoom" name="field_B" />
      </file>
Index: XIOS/dev/dev_trunk_graph/make_xios
===================================================================
--- XIOS/dev/dev_trunk_graph/make_xios	(revision 2019)
+++ XIOS/dev/dev_trunk_graph/make_xios	(revision 2020)
@@ -11,4 +11,5 @@
 use_extern_blitz="false"
 use_memtrack="false"
+use_tv="false"
 job="1"
 netcdf_lib="netcdf4_par"
@@ -34,9 +35,10 @@
 	    echo "       [--full] : to generate dependencies and recompile from scratch"
 	    echo "       [--use_oasis 'oasis3' 'oasis3_mct' : default oasis3_mct] : to use Oasis coupler"
-        echo "       [--build_path : absolute path to the build directory"
-        echo "       [--build_dir : name of the build directory"
-        echo "       [--build_suffixed : generate automatically suffixed name of the build directory (e.g. config_X64_CURIE_prod)"
-        echo "       [--use_extern_boost : to use external boost library"
-        echo "       [--use_extern_blitz : to use external blitz library"
+        echo "       [--build_path] : absolute path to the build directory"
+        echo "       [--build_dir ]: name of the build directory"
+        echo "       [--build_suffixed ]: generate automatically suffixed name of the build directory (e.g. config_X64_CURIE_prod)"
+        echo "       [--use_extern_boost] : to use external boost library"
+        echo "       [--use_extern_blitz] : to use external blitz library"
+        echo "       [--use_tv] : to use totalview data type display"
 	    echo "       [--doc] : to generate Doxygen documentation (not available yet)"
 	    echo "       [--job ntasks] : to use parallel compilation with ntasks"
@@ -59,4 +61,5 @@
          "--use_extern_boost")  use_extern_boost="true" ; shift  ;;
          "--use_extern_blitz")  use_extern_blitz="true" ; shift  ;;
+         "--use_tv")  use_tv="true" ; shift  ;;
          "--doc")   doc="true"          ; shift ;;
          "--job")   job=$2              ; shift ; shift ;;
@@ -233,4 +236,9 @@
 fi
 
+if [[ "$use_tv" == "true" ]]
+then
+   echo "src::tv_data_display $PWD/extern/tv_data_display" >> ${PWD}/bld_dir.cfg
+fi
+
 
 if [[ "$use_memtrack" == "true" ]]
Index: XIOS/dev/dev_trunk_graph/src/dht_auto_indexing.cpp
===================================================================
--- XIOS/dev/dev_trunk_graph/src/dht_auto_indexing.cpp	(revision 2019)
+++ 	(revision )
@@ -1,115 +1,0 @@
-/*!
-   \file dht_auto_indexing.cpp
-   \author Ha NGUYEN
-   \since 6 Jul 2016
-   \date 6 Jul 2016
-
-   \brief Auto assign global index across processes.
- */
-#include "dht_auto_indexing.hpp"
-
-namespace xios
-{
-
-  CDHTAutoIndexing::~CDHTAutoIndexing()
-  {
-  }
-
-  /*!
-    \param [in]
-    \param [in]
-  */
-
-  CDHTAutoIndexing::CDHTAutoIndexing(const CArray<size_t,1>& hashValue,
-                                     const MPI_Comm& clientIntraComm)
-    : CClientClientDHTTemplate<size_t>(clientIntraComm)
-  {
-
-    nbIndexOnProc_ = hashValue.size();
-    size_t nbIndexAccum;
-    MPI_Scan(&nbIndexOnProc_, &nbIndexAccum, 1, MPI_UNSIGNED_LONG, MPI_SUM, clientIntraComm);
-
-    // Broadcasting the total number of indexes
-    int rank, size;
-    MPI_Comm_rank(clientIntraComm, &rank);
-    MPI_Comm_size(clientIntraComm, &size);
-    if (rank == (size-1)) nbIndexesGlobal_ = nbIndexAccum;
-    MPI_Bcast(&nbIndexesGlobal_, 1, MPI_UNSIGNED_LONG, size-1, clientIntraComm);
-
-    CArray<size_t,1>::const_iterator itbIdx = hashValue.begin(), itIdx,
-                                     iteIdx = hashValue.end();
-
-    size_t idx = 0;
-    beginIndexOnProc_ = nbIndexAccum - nbIndexOnProc_;
-    globalIndex_.resize(nbIndexOnProc_);
-    for (itIdx = itbIdx; itIdx != iteIdx; ++itIdx)
-    {
-      globalIndex_[idx] = beginIndexOnProc_ + idx;
-      ++idx ;
-    }
-  }
-
-  /*!
-   * \fn void CDHTAutoIndexing::CDHTAutoIndexing(Index2VectorInfoTypeMap& hashInitMap, const MPI_Comm& clientIntraComm)
-   * Assigns a global index to unique input indexes.
-   * The returned map has unique indexes as a key and global indexes as a mapped value.
-   * \param [in] hashInitMap map<size_t, vector<size_t>> is a map of unique indexes.
-   * \param [in] clientIntraComm
-  */
-  CDHTAutoIndexing::CDHTAutoIndexing(Index2VectorInfoTypeMap& hashInitMap,
-                                     const MPI_Comm& clientIntraComm)
-    : CClientClientDHTTemplate<size_t>(clientIntraComm)
-  {
-
-    nbIndexOnProc_ = hashInitMap.size();
-    size_t nbIndexAccum;
-    MPI_Scan(&nbIndexOnProc_, &nbIndexAccum, 1, MPI_UNSIGNED_LONG, MPI_SUM, clientIntraComm);
-
-    int rank, size;
-    MPI_Comm_rank(clientIntraComm, &rank);
-    MPI_Comm_size(clientIntraComm, &size);
-    if (rank == (size-1)) nbIndexesGlobal_ = nbIndexAccum;
-    MPI_Bcast(&nbIndexesGlobal_, 1, MPI_UNSIGNED_LONG, size-1, clientIntraComm);
-
-    Index2VectorInfoTypeMap::iterator itbIdx = hashInitMap.begin(), itIdx,
-                                      iteIdx = hashInitMap.end();
-    size_t idx = 0;
-    beginIndexOnProc_ = nbIndexAccum - nbIndexOnProc_;
-    globalIndex_.resize(nbIndexOnProc_);
-    for (itIdx = itbIdx; itIdx != iteIdx; ++itIdx)
-    {
-//      (itIdx->second)[0] = beginIndexOnProc_ + idx;
-      (itIdx->second)[1] = beginIndexOnProc_ + idx;
-      globalIndex_[idx] = beginIndexOnProc_ + idx;
-      ++idx ;
-    }
-  }
-
-  /*!
-   * \fn size_t CDHTAutoIndexing::getNbIndexesGlobal() const
-   * Returns the total number of global indexes.
-  */
-  size_t CDHTAutoIndexing::getNbIndexesGlobal() const
-  {
-    return nbIndexesGlobal_;
-  }
-
-  /*!
-   * \fn size_t CDHTAutoIndexing::getIndexStart() const
-   * Returns the starting global index for a proc.
-  */
-  size_t CDHTAutoIndexing::getIndexStart() const
-  {
-    return beginIndexOnProc_;
-  }
-
-  /*!
-   * \fn size_t CDHTAutoIndexing::getIndexCount() const
-   * Returns the number of global indexes on a proc.
-  */
-  size_t CDHTAutoIndexing::getIndexCount() const
-  {
-    return nbIndexOnProc_;
-  }
-
-}
Index: XIOS/dev/dev_trunk_graph/src/dht_auto_indexing.hpp
===================================================================
--- XIOS/dev/dev_trunk_graph/src/dht_auto_indexing.hpp	(revision 2019)
+++ 	(revision )
@@ -1,47 +1,0 @@
-/*!
-   \file dht_auto_indexing.hpp
-   \author Ha NGUYEN
-   \since 6 Jul 2016
-   \date 6 Jul 2016
-
-   \brief Auto assign global index across processes.
- */
-
-#ifndef __XIOS_DHT_AUTO_INDEXING_HPP__
-#define __XIOS_DHT_AUTO_INDEXING_HPP__
-
-#include "client_client_dht_template.hpp"
-
-namespace xios
-{
-
-/*!
-  \class CDHTAutoIndexing
-  .
-*/
-class CDHTAutoIndexing: public CClientClientDHTTemplate<size_t>
-{
-  public:
-
-    CDHTAutoIndexing(const CArray<size_t,1>& hashValue,
-                     const MPI_Comm& clientIntraComm);
-
-    CDHTAutoIndexing(Index2VectorInfoTypeMap& hashInitMap,
-                     const MPI_Comm& clientIntraComm);
-
-    size_t getNbIndexesGlobal() const;
-    size_t getIndexStart() const;
-    size_t getIndexCount() const;
-
-    /** Default destructor */
-    virtual ~CDHTAutoIndexing();
-
-  protected:
-    std::vector<size_t> globalIndex_;
-    size_t nbIndexesGlobal_;
-    size_t nbIndexOnProc_ ;
-    size_t beginIndexOnProc_ ;
-};
-
-} // namespace xios
-#endif // __XIOS_DHT_AUTO_INDEXING_HPP__
Index: XIOS/dev/dev_trunk_graph/src/dht_data_types.hpp
===================================================================
--- XIOS/dev/dev_trunk_graph/src/dht_data_types.hpp	(revision 2019)
+++ 	(revision )
@@ -1,77 +1,0 @@
-/*!
-   \file dht_data_types.hpp
-   \author Ha NGUYEN
-   \since 17 Mars 2016
-   \date 17 Mars 2016
-
-   \brief Customized data type for dht
- */
-
-#ifndef __XIOS_DHT_DATATYPES_HPP__
-#define __XIOS_DHT_DATATYPES_HPP__
-
-#include "utils.hpp"
-
-namespace xios
-{
-typedef std::pair<int,int> PairIntInt;
-
-template<typename T>
-struct ProcessDHTElement
-{
-  typedef T Type;
-  static int typeSize()
-  {
-    return sizeof(Type);
-  }
-
-  static void packElement(const T& inputElement, unsigned char* packedElement, int& index)
-  {
-    if (NULL == packedElement) index += sizeof(Type);
-    else
-    {
-      *(T *)(&packedElement[index]) = inputElement;
-      index+=sizeof(Type);
-    }
-  }
-
-  static void unpackElement(T& outputElement, unsigned char* unpackedElement, int& index)
-  {
-    outputElement = *(Type*)(&unpackedElement[index]);
-    index+=sizeof(Type);
-  }
-};
-
-template<>
-struct ProcessDHTElement<PairIntInt>
-{
-  typedef PairIntInt Type;
-  static int typeSize()
-  {
-    return (2*sizeof(int));
-  }
-
-  static void packElement(const PairIntInt& inputElement, unsigned char* packedElement, int& index)
-  {
-    if (NULL == packedElement) index +=(2*sizeof(int));
-    else
-    {
-      *(int *)(&packedElement[index]) = inputElement.first;
-      index+=sizeof(int);
-      *(int *)(&packedElement[index]) = inputElement.second;
-      index+=sizeof(int);
-    }
-  }
-
-  static void unpackElement(PairIntInt& outputElement, unsigned char* unpackedElement, int& index)
-  {
-    outputElement.first=*(int *)(&unpackedElement[index]);
-    index+=sizeof(int);
-    outputElement.second=*(int *)(&unpackedElement[index]);
-    index+=sizeof(int);
-  }
-};
-
-}
-
-#endif // __XIOS_DHT_DATATYPES_HPP__
Index: XIOS/dev/dev_trunk_graph/src/distribution.cpp
===================================================================
--- XIOS/dev/dev_trunk_graph/src/distribution.cpp	(revision 2019)
+++ 	(revision )
@@ -1,38 +1,0 @@
-/*!
-   \file distribution.hpp
-   \author Ha NGUYEN
-   \since 13 Jan 2015
-   \date 09 Feb 2015
-
-   \brief Index distribution on server side.
- */
-#include "distribution.hpp"
-
-namespace xios {
-
-CDistribution::CDistribution(int rank, int dims, const CArray<size_t,1>& globalIndex)
-  : rank_(rank), dims_(dims), globalIndex_(globalIndex.shape())
-{
-  if (0 != globalIndex.numElements())
-    globalIndex_ = globalIndex;
-}
-
-const CArray<size_t,1>& CDistribution:: getGlobalIndex() const 
-{ 
-  return globalIndex_; 
-}
-
-CDistribution::~CDistribution()
-{ /* Nothing to do */ }
-
-int CDistribution::getDims() const
-{
-  return dims_;
-}
-
-int CDistribution::getRank() const
-{
-  return rank_;
-}
-
-} // namespace xios
Index: XIOS/dev/dev_trunk_graph/src/distribution.hpp
===================================================================
--- XIOS/dev/dev_trunk_graph/src/distribution.hpp	(revision 2019)
+++ 	(revision )
@@ -1,49 +1,0 @@
-/*!
-   \file distribution.hpp
-   \author Ha NGUYEN
-   \since 13 Jan 2015
-   \date 09 Feb 2015
-
-   \brief Index distribution on server side.
- */
-#ifndef __XIOS_DISTRIBUTION_HPP__
-#define __XIOS_DISTRIBUTION_HPP__
-
-#include "xios_spl.hpp"
-#include "array_new.hpp"
-#include <unordered_map>
-
-namespace xios {
-/*!
- \class CDistribution
- The parent class of CDistributionClient and CDistributionServer, which declares and defines
-some basic methods and properties for its children. This class allows its descendants to calculate
-distribution of index on client or server side.
-*/
-class CDistribution
-{
-  public:
-  typedef std::unordered_map<size_t,int> GlobalLocalMap;
-
-  public:
-    /** Default constructor */
-    CDistribution(int rank, int dims, const CArray<size_t,1>& globalIndex = CArray<size_t,1>());
-
-    /** Default destructor */
-    virtual ~CDistribution();
-
-    int getDims() const; //! Get dimension size
-    int getRank() const; //! Get rank of current process
-    const CArray<size_t,1>& getGlobalIndex() const;
-    
-  protected:
-    virtual void createGlobalIndex() {};
-
-  protected:
-    CArray<size_t,1> globalIndex_;
-    int dims_;
-    int rank_;
-};
-
-} // namespace xios
-#endif // __XIOS_DISTRIBUTION_HPP__
Index: XIOS/dev/dev_trunk_graph/src/distribution_client.cpp
===================================================================
--- XIOS/dev/dev_trunk_graph/src/distribution_client.cpp	(revision 2019)
+++ 	(revision )
@@ -1,609 +1,0 @@
-/*!
-   \file distribution_client.cpp
-   \author Ha NGUYEN
-   \since 13 Jan 2015
-   \date 09 Mars 2015
-
-   \brief Index distribution on client side.
- */
-#include "distribution_client.hpp"
-
-namespace xios {
-
-CDistributionClient::CDistributionClient(int rank, CGrid* grid)
-   : CDistribution(rank, 0)
-   , axisDomainOrder_()
-   , nLocal_(), nGlob_(), nBeginLocal_(), nBeginGlobal_()
-   , dataNIndex_(), dataDims_(), dataBegin_(), dataIndex_()
-   , gridMask_(), indexMap_()
-   , isDataDistributed_(true), axisNum_(0), domainNum_(0)
-   , localDataIndex_(), localMaskIndex_()
-   , globalLocalDataSendToServerMap_()
-   , infoIndex_(), isComputed_(false)
-   , elementLocalIndex_(), elementGlobalIndex_(), elementIndexData_()
-   , elementNLocal_(), elementNGlobal_()
-{
-  readDistributionInfo(grid);
-  createGlobalIndex();
-}
-
-CDistributionClient::~CDistributionClient()
-{ /* Nothing to do */ }
-
-void CDistributionClient::partialClear()
-{
-  GlobalLocalMap void1 ;
-  GlobalLocalMap void2 ;
-  std::vector<int> void3 ;
-  std::vector<bool> void4 ;
-
-  globalLocalDataSendToServerMap_.swap(void1) ;
-  globalDataIndex_.swap(void2) ;
-  localDataIndex_.swap(void3);
-  localMaskIndex_.swap(void4) ;
-}
-
-/*!
-  Read information of a grid to generate distribution.
-  Every grid is composed of several axis or/and domain(s). Their information are processed
-stored and used to calculate index distribution between client and server
-  \param [in] grid Grid to read
-*/
-void CDistributionClient::readDistributionInfo(CGrid* grid)
-{
-  std::vector<CDomain*> domList = grid->getDomains();
-  std::vector<CAxis*> axisList = grid->getAxis();
-  std::vector<CScalar*> scalarList = grid->getScalars();
-  CArray<int,1> axisDomainOrder = grid->axis_domain_order;
-
-  readDistributionInfo(domList, axisList, scalarList, axisDomainOrder);
-
-  // Then check mask of grid
-  int gridDim = domList.size() * 2 + axisList.size();
-  switch (gridDim) {
-    case 0:
-      gridMask_.resize(1);
-      gridMask_(0) = true;
-      break;
-    case 1:
-      if (!grid->mask_1d.isEmpty()) readGridMaskInfo(grid->mask_1d);
-      break;
-    case 2:
-      if (!grid->mask_2d.isEmpty()) readGridMaskInfo(grid->mask_2d);
-      break;
-    case 3:
-      if (!grid->mask_3d.isEmpty()) readGridMaskInfo(grid->mask_3d);
-      break;
-    case 4:
-      if (!grid->mask_4d.isEmpty()) readGridMaskInfo(grid->mask_4d);
-      break;
-    case 5:
-      if (!grid->mask_5d.isEmpty()) readGridMaskInfo(grid->mask_5d);
-      break;
-    case 6:
-      if (!grid->mask_6d.isEmpty()) readGridMaskInfo(grid->mask_6d);
-      break;
-    case 7:
-      if (!grid->mask_7d.isEmpty()) readGridMaskInfo(grid->mask_7d);
-      break;
-    default:
-      break;
-  }
-}
-
-/*!
-  Read information from domain(s) and axis to generate distribution.
-  All information related to domain, e.g ibegin, jbegin, ni, nj, ni_glo, nj_glo
-as well as related to axis, e.g dataNIndex, dataIndex will be stored to compute
-the distribution between clients and servers. Till now, every data structure of domain has been kept
-like before, e.g: data_n_index to make sure a compability, however, it should be changed?
-  \param [in] domList List of domains of grid
-  \param [in] axisList List of axis of grid
-  \param [in] scalarList List of scalar of grid
-  \param [in] axisDomainOrder order of axis and domain inside a grid. 2 if domain, 1 if axis and zero if scalar
-//  \param [in] gridMask Mask of grid, for now, keep it 3 dimension, but it needs changing
-*/
-void CDistributionClient::readDistributionInfo(const std::vector<CDomain*>& domList,
-                                               const std::vector<CAxis*>& axisList,
-                                               const std::vector<CScalar*>& scalarList,
-                                               const CArray<int,1>& axisDomainOrder)
-{
-  domainNum_ = domList.size();
-  axisNum_   = axisList.size();
-  numElement_ = axisDomainOrder.numElements(); // Number of element, e.x: Axis, Domain
-
-  axisDomainOrder_.resize(numElement_);
-  axisDomainOrder_ = axisDomainOrder;
-
-  // Because domain and axis can be in any order (axis1, domain1, axis2, axis3, )
-  // their position should be specified. In axisDomainOrder, domain == true, axis == false
-  int idx = 0;
-  indexMap_.resize(numElement_);
-  this->dims_ = numElement_;
-  for (int i = 0; i < numElement_; ++i)
-  {
-    indexMap_[i] = idx;
-    if (2 == axisDomainOrder(i))
-    {
-      ++(this->dims_);
-      idx += 2;
-    }
-    else ++idx;
-  }
-
-  // Size of each dimension (local and global)
-  nLocal_.resize(this->dims_);
-  nGlob_.resize(this->dims_);
-  nBeginLocal_.resize(this->dims_,0);
-  nBeginGlobal_.resize(this->dims_,0);
-
-  // Data_n_index of domain or axis (For now, axis uses its size as data_n_index
-  dataNIndex_.resize(numElement_);
-  dataDims_.resize(numElement_);
-  dataBegin_.resize(this->dims_);
-
-  // Data_*_index of each dimension
-  dataIndex_.resize(this->dims_);
-  infoIndex_.resize(this->dims_);
-
-  // A trick to determine position of each domain in domainList
-  int domIndex = 0, axisIndex = 0, scalarIndex = 0;
-  idx = 0;
-
-  elementLocalIndex_.resize(numElement_);
-  elementGlobalIndex_.resize(numElement_);
-  elementIndexData_.resize(numElement_);
-  elementNLocal_.resize(numElement_);
-  elementNGlobal_.resize(numElement_);
-  elementNLocal_[0] = 1;
-  elementNGlobal_[0] = 1;
-  size_t localSize = 1, globalSize = 1;
-
-  isDataDistributed_ = false;
-  // Update all the vectors above
-  for (idx = 0; idx < numElement_; ++idx)
-  {
-    int eleDim = axisDomainOrder(idx);
-    elementNLocal_[idx] = localSize;
-    elementNGlobal_[idx] = globalSize;
-
-    // If this is a domain
-    if (2 == eleDim)
-    {
-      // On the j axis
-      nLocal_.at(indexMap_[idx]+1) = domList[domIndex]->nj.getValue();
-      nGlob_.at(indexMap_[idx]+1)  = domList[domIndex]->nj_glo.getValue();
-      nBeginLocal_.at(indexMap_[idx]+1) = 0;
-      nBeginGlobal_.at(indexMap_[idx]+1) = domList[domIndex]->jbegin;
-
-      dataBegin_.at(indexMap_[idx]+1) = domList[domIndex]->data_jbegin.getValue();
-      dataIndex_.at(indexMap_[idx]+1).reference(domList[domIndex]->data_j_index);
-      infoIndex_.at(indexMap_[idx]+1).reference(domList[domIndex]->j_index);
-
-      // On the i axis
-      nLocal_.at(indexMap_[idx]) = domList[domIndex]->ni.getValue();
-      nGlob_.at(indexMap_[idx]) = domList[domIndex]->ni_glo.getValue();
-      nBeginLocal_.at(indexMap_[idx]) = 0;
-      nBeginGlobal_.at(indexMap_[idx]) = domList[domIndex]->ibegin;
-
-      dataBegin_.at(indexMap_[idx]) = domList[domIndex]->data_ibegin.getValue();
-      dataIndex_.at(indexMap_[idx]).reference(domList[domIndex]->data_i_index);
-      infoIndex_.at(indexMap_[idx]).reference(domList[domIndex]->i_index);
-
-      dataNIndex_.at(idx) = domList[domIndex]->data_i_index.numElements();
-      dataDims_.at(idx) = domList[domIndex]->data_dim.getValue();
-
-      isDataDistributed_ |= domList[domIndex]->isDistributed();
-
-      localSize *= nLocal_.at(indexMap_[idx]+1)* nLocal_.at(indexMap_[idx]);
-      globalSize *= nGlob_.at(indexMap_[idx]+1)* nGlob_.at(indexMap_[idx]);
-      ++domIndex;
-    }
-    else if (1 == eleDim)// So it's an axis
-    {
-      nLocal_.at(indexMap_[idx]) = axisList[axisIndex]->n.getValue();
-      nGlob_.at(indexMap_[idx]) = axisList[axisIndex]->n_glo.getValue();
-      nBeginLocal_.at(indexMap_[idx]) = 0;
-      nBeginGlobal_.at(indexMap_[idx]) = axisList[axisIndex]->begin.getValue();
-
-      dataBegin_.at(indexMap_[idx]) = axisList[axisIndex]->data_begin.getValue();
-      dataIndex_.at(indexMap_[idx]).reference(axisList[axisIndex]->data_index);
-      infoIndex_.at(indexMap_[idx]).reference(axisList[axisIndex]->index);
-      dataNIndex_.at(idx) = axisList[axisIndex]->data_index.numElements();
-      dataDims_.at(idx) = 1;
-
-      isDataDistributed_ |= axisList[axisIndex]->isDistributed();
-
-      localSize *= nLocal_.at(indexMap_[idx]);
-      globalSize *= nGlob_.at(indexMap_[idx]);
-
-      ++axisIndex;
-    }
-    else // scalar
-    {
-      nLocal_.at(indexMap_[idx]) = 1;
-      nGlob_.at(indexMap_[idx]) = 1;
-      nBeginLocal_.at(indexMap_[idx]) = 0;
-      nBeginGlobal_.at(indexMap_[idx]) = 1;
-
-      dataBegin_.at(indexMap_[idx]) = 0;
-      dataIndex_.at(indexMap_[idx]).resize(1); dataIndex_.at(indexMap_[idx])(0) = 0;
-      infoIndex_.at(indexMap_[idx]).resize(1); infoIndex_.at(indexMap_[idx])(0) = 0;
-      dataNIndex_.at(idx) = 1;
-      dataDims_.at(idx) = 1;
-
-      isDataDistributed_ |= false;
-
-      localSize *= nLocal_.at(indexMap_[idx]);
-      globalSize *= nGlob_.at(indexMap_[idx]);
-
-      ++scalarIndex;
-    }
-  }
-}
-
-/*!
-  Create local index of domain(s).
-  A domain can have data index which even contains the "ghost" points. Very often, these
-data surround the true data. In order to send correct data to server,
-a client need to know index of the true data.
-*/
-void CDistributionClient::createLocalDomainDataIndex()
-{
-  int idxDomain = 0;
-  for (int i = 0; i < axisDomainOrder_.numElements(); ++i)
-  {
-    if (2 == axisDomainOrder_(i))
-    {
-      elementIndexData_[i].resize(dataNIndex_[i]);
-      elementIndexData_[i] = false;
-      int iIdx, jIdx = 0, count = 0, localIndex;
-      for (int j = 0; j < dataNIndex_[i]; ++j)
-      {
-        iIdx = getDomainIndex((dataIndex_[indexMap_[i]])(j), (dataIndex_[indexMap_[i]+1])(j),
-                              dataBegin_[indexMap_[i]], dataBegin_[indexMap_[i]+1],
-                              dataDims_[i], nLocal_[indexMap_[i]], jIdx);
-
-        if ((iIdx >= nBeginLocal_[indexMap_[i]]) && (iIdx < nLocal_[indexMap_[i]]) &&
-           (jIdx >= nBeginLocal_[indexMap_[i]+1]) && (jIdx < nLocal_[indexMap_[i]+1]))
-        {
-          ++count;
-          elementIndexData_[i](j) = true;
-        }
-      }
-
-      elementLocalIndex_[i].resize(count);
-      elementGlobalIndex_[i].resize(count);
-      count = 0;
-      CArray<bool,1>& tmpIndexElementData = elementIndexData_[i];
-      CArray<int,1>& tmpLocalElementIndex = elementLocalIndex_[i];
-      CArray<size_t,1>& tmpGlobalElementIndex = elementGlobalIndex_[i];
-      for (int j = 0; j < dataNIndex_[i]; ++j)
-      {
-        if (tmpIndexElementData(j))
-        {
-          iIdx = getDomainIndex((dataIndex_[indexMap_[i]])(j), (dataIndex_[indexMap_[i]+1])(j),
-                                dataBegin_[indexMap_[i]], dataBegin_[indexMap_[i]+1],
-                                dataDims_[i], nLocal_[indexMap_[i]], jIdx);
-          localIndex = tmpLocalElementIndex(count) = iIdx + jIdx * nLocal_[indexMap_[i]];
-          tmpGlobalElementIndex(count) = (infoIndex_[indexMap_[i]])(localIndex) + ((infoIndex_[indexMap_[i]+1])(localIndex))*nGlob_[indexMap_[i]];
-          ++count;
-        }
-      }
-      ++idxDomain;
-    }
-  }
-}
-
-/*!
-  Create local index of axis.
-*/
-void CDistributionClient::createLocalAxisDataIndex()
-{
-  int idxAxis = 0;
-  for (int i = 0; i < axisDomainOrder_.numElements(); ++i)
-  {
-    if (1 == axisDomainOrder_(i))
-    {
-      elementIndexData_[i].resize(dataNIndex_[i]);
-      elementIndexData_[i] = false;
-      int iIdx = 0, count = 0;
-      for (int j = 0; j < dataNIndex_[i]; ++j)
-      {
-        iIdx = getAxisIndex((dataIndex_[indexMap_[i]])(j), dataBegin_[indexMap_[i]], nLocal_[indexMap_[i]]);
-        if ((iIdx >= nBeginLocal_[indexMap_[i]]) &&
-           (iIdx < nLocal_[indexMap_[i]]) )//&& (axisMasks_[idxAxis](iIdx)))
-        {
-          ++count;
-          elementIndexData_[i](j) = true;
-        }
-      }
-
-      elementLocalIndex_[i].resize(count);
-      elementGlobalIndex_[i].resize(count);
-      count = 0;
-      CArray<bool,1>& tmpIndexElementData = elementIndexData_[i];
-      CArray<int,1>& tmpLocalElementIndex = elementLocalIndex_[i];
-      CArray<size_t,1>& tmpGlobalElementIndex = elementGlobalIndex_[i];
-      for (int j = 0; j < dataNIndex_[i]; ++j)
-      {
-        if (tmpIndexElementData(j))
-        {
-          iIdx = tmpLocalElementIndex(count) = getAxisIndex((dataIndex_[indexMap_[i]])(j), dataBegin_[indexMap_[i]], nLocal_[indexMap_[i]]);
-          tmpGlobalElementIndex(count) = (infoIndex_[indexMap_[i]])(iIdx);
-          ++count;
-        }
-      }
-      ++idxAxis;
-    }
-  }
-}
-
-/*!
-  Create local index of scalar.
-*/
-void CDistributionClient::createLocalScalarDataIndex()
-{
-  int idxAxis = 0;
-  for (int i = 0; i < axisDomainOrder_.numElements(); ++i)
-  {
-    if (0 == axisDomainOrder_(i))
-    {
-      elementIndexData_[i].resize(dataNIndex_[i]);
-      elementIndexData_[i] = true;
-      int count = 1;
-
-      elementLocalIndex_[i].resize(count);
-      elementLocalIndex_[i] = 0;
-      elementGlobalIndex_[i].resize(count);
-      elementGlobalIndex_[i] = 0;
-    }
-  }
-}
-
-/*!
-   Create global index on client
-   In order to do the mapping between client-server, each client creates its own
-global index of sending data. This global index is then used to calculate to which server
-the client needs to send it data as well as which part of data belongs to the server.
-So as to make clients and server coherent in order of index, global index is calculated by
-take into account of C-convention, the rightmost dimension varies faster.
-*/
-void CDistributionClient::createGlobalIndexSendToServer()
-{
-  if (isComputed_) return;
-  isComputed_ = true;
-  createLocalDomainDataIndex();
-  createLocalAxisDataIndex();
-  createLocalScalarDataIndex();
-
-  int idxDomain = 0, idxAxis = 0;
-  std::vector<int> eachElementSize(numElement_);
-
-  // Precompute size of the loop
-  for (int i = 0; i < numElement_; ++i)
-  {
-    eachElementSize[i] = elementLocalIndex_[i].numElements();
-  }
-
-  //   Compute size of the global index on client
-  std::vector<StdSize> idxLoop(numElement_,0);
-  std::vector<StdSize> currentIndex(numElement_,0);
-  std::vector<StdSize> currentGlobalIndex(numElement_,0);
-  int innerLoopSize = eachElementSize[0];
-  size_t idx = 0, indexLocalDataOnClientCount = 0;
-  size_t ssize = 1;
-
-  for (int i = 0; i < numElement_; ++i) ssize *= eachElementSize[i];
-
-  localDataIndex_.resize(ssize);
-  if (!gridMask_.isEmpty()) localMaskIndex_.resize(ssize);
-  localMaskedDataIndex_.resize(ssize);
-  globalDataIndex_.rehash(std::ceil(ssize/globalDataIndex_.max_load_factor()));
-  globalLocalDataSendToServerMap_.rehash(std::ceil(ssize/globalLocalDataSendToServerMap_.max_load_factor()));
-
-
-  // We need to loop with data index
-  idxLoop.assign(numElement_,0);
-  idx = indexLocalDataOnClientCount = 0;
-  ssize = 1; for (int i = 0; i < numElement_; ++i) ssize *= dataNIndex_[i];
-  innerLoopSize = dataNIndex_[0];
-  int countLocalData = 0;
-  std::vector<int> correctIndexOfElement(numElement_,0);
-  bool isOuterIndexCorrect = true;
-  while (idx < ssize)
-  {
-    for (int i = 0; i < numElement_-1; ++i)
-    {
-      if (idxLoop[i] == dataNIndex_[i])
-      {
-        idxLoop[i] = 0;
-        correctIndexOfElement[i] = 0;
-        ++idxLoop[i+1];
-        if (isOuterIndexCorrect) ++correctIndexOfElement[i+1];
-      }
-    }
-
-    // Depending the inner-most element axis or domain,
-    // The outer loop index begins correspondingly at one (1) or zero (0)
-    bool isIndexElementDataCorrect = true;
-    for (int i = 1; i < numElement_; ++i)
-    {
-      if (elementIndexData_[i](idxLoop[i]))
-      {
-        currentIndex[i] = elementLocalIndex_[i](correctIndexOfElement[i]);
-        currentGlobalIndex[i] = elementGlobalIndex_[i](correctIndexOfElement[i]);
-        isIndexElementDataCorrect &= true;
-      }
-      else isIndexElementDataCorrect = false;
-    }
-
-    isOuterIndexCorrect = isIndexElementDataCorrect;
-
-    if (isOuterIndexCorrect)
-    {
-      // Inner most index
-      int correctIndexInnerElement = 0;
-      for (int i = 0; i < innerLoopSize; ++i)
-      {
-        bool isCurrentIndexDataCorrect = isOuterIndexCorrect;
-        if (elementIndexData_[0](i))
-        {
-          currentIndex[0] = elementLocalIndex_[0](correctIndexInnerElement);
-          currentGlobalIndex[0] = elementGlobalIndex_[0](correctIndexInnerElement);
-          isCurrentIndexDataCorrect &= true;
-          ++correctIndexInnerElement;
-        }
-        else isCurrentIndexDataCorrect = false;
-
-        if (isCurrentIndexDataCorrect)
-        {
-          bool maskTmp = true;
-          bool maskGridTmp = true;
-          size_t globalIndex = 0;
-          for (int k = 0; k < numElement_; ++k)
-          {
-            globalIndex += (currentGlobalIndex[k])*elementNGlobal_[k];
-          }
-          globalDataIndex_[globalIndex] = indexLocalDataOnClientCount;
-          localDataIndex_[indexLocalDataOnClientCount] = countLocalData;
-          globalLocalDataSendToServerMap_[globalIndex] = indexLocalDataOnClientCount;
-          localMaskedDataIndex_[indexLocalDataOnClientCount] = indexLocalDataOnClientCount;
-
-          // Grid mask: unmasked values will be replaces by NaN and then all values will be sent
-          if (!gridMask_.isEmpty())
-          {
-            int gridMaskIndex = 0;
-            for (int k = 0; k < this->numElement_; ++k)
-            {
-              gridMaskIndex += (currentIndex[k])*elementNLocal_[k];
-            }
-            maskGridTmp =  gridMask_(gridMaskIndex);
-            if (maskGridTmp)
-              localMaskIndex_[indexLocalDataOnClientCount] = true;
-            else
-              localMaskIndex_[indexLocalDataOnClientCount] = false;
-          }
-
-          ++indexLocalDataOnClientCount;
-
-        }
-        ++countLocalData;
-        correctIndexOfElement[0] = correctIndexInnerElement;;
-      }
-    }
-    else countLocalData+=innerLoopSize ;
-
-    idxLoop[0] += innerLoopSize;
-    idx += innerLoopSize;
-  }
-}
-
-void CDistributionClient::createGlobalIndex()
-{
-}
-
-/*!
-  Retrieve index i and index j of a domain from its data index
-  Data contains not only true data, which are sent to servers, but also ghost data, which
-very often play a role of border of each local data, so does data index. Because data of a domain
-can be one dimension, or two dimensions, there is a need to convert data index to domain index
-  \param [in] dataIIndex index of i data
-  \param [in] dataJIndex index of j data
-  \param [in] dataIBegin index begin of i data
-  \param [in] dataJBegin index begin of j data
-  \param [in] dataDim dimension of data (1 or 2)
-  \param [in] ni local size ni of domain
-  \param [out] j j index of domain
-  \return i index of domain
-*/
-int CDistributionClient::getDomainIndex(const int& dataIIndex, const int& dataJIndex,
-                                        const int& dataIBegin, const int& dataJBegin,
-                                        const int& dataDim, const int& ni, int& j)
-{
-  int i;
-  int tempI = dataIIndex + dataIBegin,
-      tempJ = (dataJIndex + dataJBegin);
-  if (ni == 0)
-  {
-    i = -1;
-    j = -1;
-    return i;
-  }
-  if ((tempI < 0) || (tempJ < 0))
-  {
-    i = -1;
-    j = -1;
-    return i;
-  }
-  else
-  {
-    i = (dataDim == 1) ? (tempI) % ni : (tempI) ;
-    j = (dataDim == 1) ? (tempI) / ni : (tempJ) ;
-  }
-  return i;
-}
-
-/*!
-  Retrieve index of an axis from its data index
-  \param [in] dataIndex index of data
-  \param [in] dataBegin index begin of data
-  \param [in] ni local size of axis
-  \return index of domain
-*/
-int CDistributionClient::getAxisIndex(const int& dataIndex, const int& dataBegin, const int& ni)
-{
-  if (ni == 0)
-  {
-    return -1;
-  }
-  int tempI = dataIndex;
-  if ((tempI < 0) || (tempI > ni))
-    return -1;
-  else
-    return tempI;
-}
-
-/*!
-  Return global local data mapping of client
-*/
-CDistributionClient::GlobalLocalDataMap& CDistributionClient::getGlobalLocalDataSendToServer()
-{
-  if (!isComputed_) createGlobalIndexSendToServer();
-  return globalLocalDataSendToServerMap_;
-}
-
-CDistributionClient::GlobalLocalDataMap& CDistributionClient::getGlobalDataIndexOnClient()
-{
-  if (!isComputed_) createGlobalIndexSendToServer();
-  return globalDataIndex_;
-}
-
-/*!
-  Return local data index of client
-*/
-const std::vector<int>& CDistributionClient::getLocalDataIndexOnClient()
-{
-  if (!isComputed_) createGlobalIndexSendToServer();
-  return localDataIndex_;
-}
-
-/*!
-  Return local mask index of client
-*/
-const std::vector<bool>& CDistributionClient::getLocalMaskIndexOnClient()
-{
-  if (!isComputed_) createGlobalIndexSendToServer();
-  return localMaskIndex_;
-}
-
-/*!
-  Return local mask index of client
-*/
-const std::vector<int>& CDistributionClient::getLocalMaskedDataIndexOnClient()
-{
-  if (!isComputed_) createGlobalIndexSendToServer();
-  return localMaskedDataIndex_;
-}
-
-} // namespace xios
Index: XIOS/dev/dev_trunk_graph/src/distribution_client.hpp
===================================================================
--- XIOS/dev/dev_trunk_graph/src/distribution_client.hpp	(revision 2019)
+++ 	(revision )
@@ -1,183 +1,0 @@
-/*!
-   \file distribution_client.hpp
-   \author Ha NGUYEN
-   \since 13 Jan 2015
-   \date 09 Mars 2015
-
-   \brief Index distribution on client side.
- */
-#ifndef __XIOS_DISTRIBUTIONCLIENT_HPP__
-#define __XIOS_DISTRIBUTIONCLIENT_HPP__
-
-#include <distribution.hpp>
-#include "axis.hpp"
-#include "domain.hpp"
-#include "grid.hpp"
-
-namespace xios {
-
-class CGrid;
-class CDomain;
-class CAxis;
-class CScalar;
-
-/*!
-  \class CDistributionClient
-  This class bases on the knowledge of distribution on client side (decided by users)
-to calculate the global index of its local data.
-*/
-class CDistributionClient : public CDistribution
-{
-public:
-  typedef CDistribution::GlobalLocalMap GlobalLocalDataMap;
-
-  public:
-    /** Default constructor */
-    CDistributionClient(int rank, CGrid* grid);
-
-    void createGlobalIndexSendToServer();
-
-    /** Default destructor */
-    virtual ~CDistributionClient();
-
-    virtual const std::vector<int>& getLocalDataIndexOnClient();
-    GlobalLocalDataMap& getGlobalLocalDataSendToServer();
-    GlobalLocalDataMap& getGlobalDataIndexOnClient();
-    const std::vector<bool>& getLocalMaskIndexOnClient();
-    const std::vector<int>& getLocalMaskedDataIndexOnClient();
-
-    std::vector<int> getNGlob() { return nGlob_; }
-    std::vector<int> getDataNIndex() { return dataNIndex_; }
-
-    bool isDataDistributed() { return isDataDistributed_; }
-
-    static int getDomainIndex(const int& dataIIndex, const int& dataJIndex,
-                                     const int& dataIBegin, const int& dataJBegin,
-                                     const int& dataDim, const int& ni, int& j);
-    static int getAxisIndex(const int& dataIndex, const int& dataBegin, const int& ni);
-
-    void partialClear(void) ;  //! clear heavy sized attibutes
-
-  protected:
-    void createGlobalIndex();
-    void readDistributionInfo(CGrid* grid);
-    void readDistributionInfo(const std::vector<CDomain*>& domList,
-                              const std::vector<CAxis*>& axisList,
-                              const std::vector<CScalar*>& scalarList,
-                              const CArray<int,1>& axisDomainOrder);
-  private:
-    //! Create local index of a domain
-    void createLocalDomainDataIndex();
-
-    //! Create local index of an axis
-    void createLocalAxisDataIndex();
-
-    //! Create local index of a scalar
-    void createLocalScalarDataIndex();
-
-    template<int N>
-    void readGridMaskInfo(const CArray<bool,N>& gridMask);
-
-  private:
-    //!< LocalData index on client
-    GlobalLocalDataMap globalLocalDataSendToServerMap_;
-    GlobalLocalDataMap globalDataIndex_;
-
-    /*! Array holding masked data indexes.
-     * It includes:
-     *  masking on data (data_i/j_index or data_ni/nj and data_ibegin)
-     *  masking on grid elements (domains, axes or scalars)
-     * It DOES NOT include grid mask.
-     * The array size defines the data size entering the workflow. It is used by source filter of client or server1.
-    */
-    std::vector<int> localDataIndex_;
-
-    /*! Array holding grid mask. If grid mask is not defined, its size is zero.
-     * It is used by source filter of client for replacing unmasked data by NaN.
-    */
-    std::vector<bool> localMaskIndex_;
-
-    std::vector<int> localMaskedDataIndex_;
-
-  private:
-    /*! Domains and axis are considered elements.
-     * A grid composed of 1 domain and 1 axis has 2 elements */
-    int numElement_;
-    CArray<int,1> axisDomainOrder_; //!< Order of axis and domain of a grid
-
-    std::vector<int> nLocal_; //!< Local size of each dimension (ni, nj, etc, ...)
-    std::vector<int> nGlob_; //!< Global size of each dimension (e.x: ni_glo, nj_glo, etc, ...)
-    std::vector<int> nBeginLocal_;//!< Begin index of each dimension (e.x: for domain, it's always 0, for axis, it's zoom_begin, ...)
-    std::vector<int> nBeginGlobal_; //!< Begin index of each dimension (e.x: ibegin, jbegin, ...)
-
-    // Data_n_index of domain or axis (For now, axis uses its size as data_n_index
-    std::vector<int> dataNIndex_; //!< Data_n_index in case of domain
-    std::vector<int> dataDims_; //!< Data_dim, domain can have data_dim == 1 or 2
-    std::vector<int> dataBegin_; //!< Data begin (data_ibegin, data_jbegin, etc)
-    std::vector<CArray<int,1> > dataIndex_; //!< Data index
-    std::vector<CArray<int,1> > infoIndex_; //!< i_index, j_index
-
-    std::vector<int> indexMap_; //!< Mapping element index to dimension index
-    std::vector<CArray<int,1> > elementLocalIndex_;  //!< Local index of each element
-    std::vector<CArray<size_t,1> > elementGlobalIndex_; //!< Global index of each element
-    std::vector<CArray<bool,1> > elementIndexData_; //!< // The correct index of a domain has true value, the ghost one has false value
-    std::vector<size_t> elementNLocal_;
-    std::vector<size_t> elementNGlobal_;
-
-    //!< (Only for grid with one axis or scalar)Flag to determine whether data is distributed or not
-    bool isDataDistributed_;
-    int axisNum_;
-    int domainNum_;
-    bool isComputed_;
-
-  private:
-    // Just suppose that grid mask has 3 dimension. Need change
-    CArray<bool,1> gridMask_; //!< Mask of grid
-
-  private:
-    CDistributionClient(const CDistributionClient& distClient); //! Not implement
-};
-
-/*!
-  A grid can have multiple dimension, so can its mask in the form of multi-dimension array.
-It's not a good idea to store all multi-dimension arrays corresponding to each mask.
-One of the ways is to convert this array into 1-dimension one and every process is taken place on it.
-  \param [in] multi-dimension array grid mask
-*/
-template<int N>
-void CDistributionClient::readGridMaskInfo(const CArray<bool,N>& gridMask)
-{
-  int dim = gridMask.dimensions();
-  std::vector<int> dimensionSizes(dim);
-  for (int i = 0; i < dim; ++i) dimensionSizes[i] = gridMask.extent(i);
-
-  std::vector<int> idxLoop(dim,0);
-  int ssize = gridMask.numElements(), idx = 0;
-  gridMask_.resize(ssize);
-  while (idx < ssize)
-  {
-    for (int i = 0; i < dim-1; ++i)
-    {
-      if (idxLoop[i] == dimensionSizes[i])
-      {
-        idxLoop[i] = 0;
-        ++idxLoop[i+1];
-      }
-    }
-
-    int maskIndex = idxLoop[0];
-    int mulDim = 1;
-    for (int k = 1; k < dim; ++k)
-    {
-      mulDim *= dimensionSizes[k-1];
-      maskIndex += idxLoop[k]*mulDim;
-    }
-    gridMask_(maskIndex) = *(gridMask.dataFirst()+maskIndex);
-
-    ++idxLoop[0];
-    ++idx;
-  }
-}
-
-} // namespace xios
-#endif // __XIOS_DISTRIBUTIONCLIENT_HPP__
Index: XIOS/dev/dev_trunk_graph/src/distribution_server.cpp
===================================================================
--- XIOS/dev/dev_trunk_graph/src/distribution_server.cpp	(revision 2019)
+++ 	(revision )
@@ -1,223 +1,0 @@
-/*!
-   \file distribution_server.cpp
-   \author Ha NGUYEN
-   \since 13 Jan 2015
-   \date 10 Sep 2016
-
-   \brief Index distribution on server side.
- */
-#include "distribution_server.hpp"
-#include "utils.hpp"
-
-namespace xios {
-
-CDistributionServer::CDistributionServer(int rank, const std::vector<int>& nBegin,
-                                         const std::vector<int>& nSize,
-                                         const std::vector<int>& nBeginGlobal,
-                                         const std::vector<int>& nGlobal)
-  : CDistribution(rank, nGlobal.size()), nGlobal_(nGlobal), nBeginGlobal_(nBeginGlobal),
-    nSize_(nSize), nBegin_(nBegin), globalLocalIndexMap_()
-{
-  createGlobalIndex();
-}
-
-CDistributionServer::CDistributionServer(int rank,
-                                        const std::vector<CArray<int,1> >& globalIndexElements,
-                                        const CArray<int,1>& elementOrder,
-                                        const std::vector<int>& nBegin,
-                                        const std::vector<int>& nSize,
-                                        const std::vector<int>& nBeginGlobal,
-                                        const std::vector<int>& nGlobal)
-  : CDistribution(rank, nGlobal.size()), nGlobal_(nGlobal), nBeginGlobal_(nBeginGlobal),
-    nSize_(nSize), nBegin_(nBegin), globalLocalIndexMap_()
-{
-  createGlobalIndex(globalIndexElements, elementOrder);
-}
-
-CDistributionServer::~CDistributionServer()
-{
-}
-
-/*!
-  Create global index on server side
-  Like the similar function on client side, this function serves on creating global index
-for data written by the server. The global index is used to calculating local index of data
-written on each server
-*/
-void CDistributionServer::createGlobalIndex()
-{
-  size_t idx = 0, ssize = 1;
-  for (int i = 0; i < nSize_.size(); ++i) ssize *= nSize_[i];
-
-  this->globalIndex_.resize(ssize);
-  std::vector<int> idxLoop(this->getDims(),0);
-  std::vector<int> currentIndex(this->getDims());
-  int innerLoopSize = nSize_[0];
-
-  globalLocalIndexMap_.rehash(std::ceil(ssize/globalLocalIndexMap_.max_load_factor()));
-  while (idx<ssize)
-  {
-    for (int i = 0; i < this->dims_-1; ++i)
-    {
-      if (idxLoop[i] == nSize_[i])
-      {
-        idxLoop[i] = 0;
-        ++idxLoop[i+1];
-      }
-    }
-
-    for (int i = 1; i < this->dims_; ++i)  currentIndex[i] = idxLoop[i] + nBegin_[i];
-
-    size_t mulDim, globalIndex;
-    for (int i = 0; i < innerLoopSize; ++i)
-    {
-      mulDim = 1;
-      globalIndex = i + nBegin_[0];
-
-      for (int k = 1; k < this->dims_; ++k)
-      {
-        mulDim *= nGlobal_[k-1];
-        globalIndex += (currentIndex[k])*mulDim;
-      }
-      globalLocalIndexMap_[globalIndex] = idx;
-      this->globalIndex_(idx) = globalIndex;
-
-      ++idx;
-    }
-    idxLoop[0] += innerLoopSize;
-  }
-}
-
-/*!
-  Create global index on server side
-  Like the similar function on client side, this function serves on creating global index
-for data written by the server. The global index is used to calculating local index of data
-written on each server
-  \param[in] globalIndexElement global index on server side of each element of grid (scalar, axis, domain)
-  \param[in] elementOrder the order of elements of grid (e.x: domain->axis or domain->scalar)
-*/
-void CDistributionServer::createGlobalIndex(const std::vector<CArray<int,1> >& globalIndexElements,
-                                            const CArray<int,1>& elementOrder)
-{
-  int numElement = elementOrder.numElements(), elementIdx = 0;  
-  std::vector<int> indexMap(numElement);
-  for (int i = 0; i < numElement; ++i)
-  {
-    indexMap[i] = elementIdx;
-    if (2 == elementOrder(i))
-    {      
-      elementIdx += 2;
-    }
-    else
-      ++elementIdx;
-  }
-
-  std::vector<size_t> elementGlobalSize(numElement);
-  size_t globalSize = 1;
-  for (int i = 0; i < numElement; ++i)
-  {
-    int elementType = elementOrder(i);
-    elementGlobalSize[i] = globalSize;
-    if (2 == elementType) // domain
-    {
-      globalSize *= nGlobal_[indexMap[i]+1] * nGlobal_[indexMap[i]];
-    }
-    else // axis or scalar
-    {
-      globalSize *= nGlobal_[indexMap[i]];
-    }
-  } 
-
-  size_t ssize = 1;
-  for (int i = 0; i < globalIndexElements.size(); ++i) ssize *= globalIndexElements[i].numElements();
-  this->globalIndex_.resize(ssize);
-  globalLocalIndexMap_.rehash(std::ceil(ssize/globalLocalIndexMap_.max_load_factor()));
-
-  std::vector<int> idxLoop(numElement,0);
-  std::vector<int> currentIndex(numElement);
-  int innerLoopSize = globalIndexElements[0].numElements();
-
-  size_t idx = 0;
-  while (idx<ssize)
-  {
-    for (int i = 0; i < numElement-1; ++i)
-    {
-      if (idxLoop[i] == globalIndexElements[i].numElements())
-      {
-        idxLoop[i] = 0;
-        ++idxLoop[i+1];
-      }
-    }
-
-    for (int i = 1; i < numElement; ++i)  currentIndex[i] = globalIndexElements[i](idxLoop[i]);
-
-    size_t mulDim, globalIndex;
-    for (int i = 0; i < innerLoopSize; ++i)
-    {      
-      globalIndex = 0;
-      currentIndex[0] = globalIndexElements[0](i);
-
-      for (int k = 0; k < numElement; ++k)
-      {     
-        globalIndex += (currentIndex[k])*elementGlobalSize[k];
-      }
-      globalLocalIndexMap_[globalIndex] = idx;
-      this->globalIndex_(idx) = globalIndex;
-      ++idx;
-    }
-    idxLoop[0] += innerLoopSize;
-  }
-}
-
-/*!
-  Compute local index for writing data on server
-  \param [in] globalIndex Global index received from client
-*/
-void CDistributionServer::computeLocalIndex(CArray<size_t,1>& globalIndex)
-{
-  size_t ssize = globalIndex.numElements();
-  size_t localIndexSize = std::min(globalIndex_.numElements(), ssize);
-  CArray<size_t,1> localIndex(localIndexSize);
-  GlobalLocalMap::const_iterator ite = globalLocalIndexMap_.end(), it;
-  int i = 0;
-  for (size_t idx = 0; idx < ssize; ++idx)
-  {
-    it = globalLocalIndexMap_.find(globalIndex(idx));
-    if (ite != it)
-    {
-      localIndex(i) = it->second;
-      ++i;
-    }
-  }
-
-  globalIndex.reference(localIndex);
-}
-
-/*!
-  Transforms local indexes owned by the server into global indexes
-  \param [in/out] indexes on input, local indexes of the server,
-                          on output, the corresponding global indexes
-*/
-void CDistributionServer::computeGlobalIndex(CArray<int,1>& indexes) const
-{
-  for (int i = 0; i < indexes.numElements(); ++i)
-  {
-    indexes(i) = globalIndex_(indexes(i));
-  }
-}
-
-/*!
-  Get the size of grid index in server (e.x: sizeGrid *= size of each dimensiion)
-*/
-int CDistributionServer::getGridSize() const
-{
-   return globalLocalIndexMap_.size();
-}
-
-void CDistributionServer::partialClear(void)
-{
-  GlobalLocalMap void1 ;
-  globalLocalIndexMap_.swap(void1) ;
-}
-  
-} // namespace xios
Index: XIOS/dev/dev_trunk_graph/src/distribution_server.hpp
===================================================================
--- XIOS/dev/dev_trunk_graph/src/distribution_server.hpp	(revision 2019)
+++ 	(revision )
@@ -1,68 +1,0 @@
-/*!
-   \file distribution_server.hpp
-   \author Ha NGUYEN
-   \since 13 Jan 2015
-   \date 04 Feb 2015
-
-   \brief Index distribution on server side.
- */
-
-#ifndef __XIOS_DISTRIBUTION_SERVER_HPP__
-#define __XIOS_DISTRIBUTION_SERVER_HPP__
-
-#include "distribution.hpp"
-
-namespace xios {
-
-/*!
-  \class CDistributionServer
-  The class, for now, plays a role of computing local index for writing data on server
-*/
-class CDistributionServer : public CDistribution
-{
-  public:
-    /** Default constructor */
-    CDistributionServer(int rank, int dims, const CArray<size_t,1>& globalIndex = CArray<size_t,1>());
-    CDistributionServer(int rank, const std::vector<int>& nBeginServer,
-                        const std::vector<int>& nSizeServer, const std::vector<int>& nGlobal);
-    CDistributionServer(int rank, const std::vector<int>& nBeginServer,
-                        const std::vector<int>& nSizeServer,
-                        const std::vector<int>& nBeginGlobal,
-                        const std::vector<int>& nGlobal);
-
-    CDistributionServer(int rank,
-                        const std::vector<CArray<int,1> >& globalIndexElements,
-                        const CArray<int,1>& elementOrder,
-                        const std::vector<int>& nBeginServer,
-                        const std::vector<int>& nSizeServer,
-                        const std::vector<int>& nBeginGlobal,
-                        const std::vector<int>& nGlobal);
-
-    /** Default destructor */
-    virtual ~CDistributionServer();
-
-    const GlobalLocalMap& getGlobalLocalIndex() const { return globalLocalIndexMap_; }    
-    int getGridSize() const;
-    
-    virtual void computeLocalIndex(CArray<size_t,1>& globalIndex);
-    virtual void computeGlobalIndex(CArray<int,1>& indexes) const;
-    virtual void partialClear(void); //! clear heavy sized attibutes
-
-  protected:
-    virtual void createGlobalIndex();
-    void createGlobalIndex(const std::vector<CArray<int,1> >& globalIndexElements,
-                           const CArray<int,1>& elementOrder);
-    
-  protected:
-    GlobalLocalMap globalLocalIndexMap_;
-
-  private:
-    std::vector<int> nGlobal_;
-    std::vector<int> nBeginGlobal_;
-    std::vector<int> nSize_;
-    std::vector<int> nBegin_;
-
-};
-
-} // namespace xios
-#endif // __XIOS_DISTRIBUTION_SERVER_HPP__
Index: XIOS/dev/dev_trunk_graph/src/filter/file_server_writer_filter.cpp
===================================================================
--- XIOS/dev/dev_trunk_graph/src/filter/file_server_writer_filter.cpp	(revision 2019)
+++ 	(revision )
@@ -1,30 +1,0 @@
-#include "file_server_writer_filter.hpp"
-#include "exception.hpp"
-#include "field.hpp"
-
-namespace xios
-{
-  CFileServerWriterFilter::CFileServerWriterFilter(CGarbageCollector& gc, CField* field)
-    : CInputPin(gc, 1)
-    , field(field)
-  {
-    if (!field)
-      ERROR("CFileServerWriterFilter::CFileServerWriterFilter(CField* field)",
-            "The field cannot be null.");
-  }
-
-  void CFileServerWriterFilter::onInputReady(std::vector<CDataPacketPtr> data)
-  {
-    field->writeUpdateData(data[0]->data);
-  }
-
-  bool CFileServerWriterFilter::mustAutoTrigger() const
-  {
-    return true;
-  }
-
-  bool CFileServerWriterFilter::isDataExpected(const CDate& date) const
-  {
-    return true;
-  }
-} // namespace xios
Index: XIOS/dev/dev_trunk_graph/src/filter/file_server_writer_filter.hpp
===================================================================
--- XIOS/dev/dev_trunk_graph/src/filter/file_server_writer_filter.hpp	(revision 2019)
+++ 	(revision )
@@ -1,53 +1,0 @@
-#ifndef __XIOS_CFileServerWriterFilter__
-#define __XIOS_CFileServerWriterFilter__
-
-#include "input_pin.hpp"
-
-namespace xios
-{
-  class CField;
-
-  /*!
-   * A terminal filter which writes the packets it receives in a file.
-   */
-  class CFileServerWriterFilter : public CInputPin
-  {
-    public:
-      /*!
-       * Constructs the filter (with one input slot) associated to the specified field
-       * and a garbage collector.
-       *
-       * \param gc the associated garbage collector
-       * \param field the associated field
-       */
-      CFileServerWriterFilter(CGarbageCollector& gc, CField* field);
-
-      /*!
-       * Tests if the filter must auto-trigger.
-       *
-       * \return true if the filter must auto-trigger
-       */
-      bool virtual mustAutoTrigger() const;
-
-      /*!
-       * Tests whether data is expected for the specified date.
-       *
-       * \param date the date associated to the data
-       */
-      bool virtual isDataExpected(const CDate& date) const;
-
-    protected:
-      /*!
-       * Callbacks a field to write a packet to a file.
-       *
-       * \param data a vector of packets corresponding to each slot
-       */
-      void virtual onInputReady(std::vector<CDataPacketPtr> data);
-
-    private:
-      CField* field; //<! The associated field
-      std::map<Time, CDataPacketPtr> packets; //<! The stored packets
-  }; // class CFileServerWriterFilter
-} // namespace xios
-
-#endif //__XIOS_CFileServerWriterFilter__
Index: XIOS/dev/dev_trunk_graph/src/filter/file_writer_filter.cpp
===================================================================
--- XIOS/dev/dev_trunk_graph/src/filter/file_writer_filter.cpp	(revision 2019)
+++ 	(revision )
@@ -1,84 +1,0 @@
-#include "file_writer_filter.hpp"
-#include "exception.hpp"
-#include "field.hpp"
-#include "utils.hpp"
-#include "workflow_graph.hpp"
-#include "graphviz.hpp"
-
-namespace xios
-{
-  CFileWriterFilter::CFileWriterFilter(CGarbageCollector& gc, CField* field)
-    : CInputPin(gc, 1)
-    , field(field)
-  {
-    if (!field)
-      ERROR("CFileWriterFilter::CFileWriterFilter(CField* field)",
-            "The field cannot be null.");
-  }
-
-  void CFileWriterFilter::buildGraph(std::vector<CDataPacketPtr> data)
-  {
-    bool building_graph = this->tag ? data[0]->timestamp >= this->start_graph && data[0]->timestamp <= this->end_graph: false;
-    
-    if(building_graph)
-    {
-      this->filterID = InvalidableObject::filterIdGenerator++;
-      int edgeID = InvalidableObject::edgeIdGenerator++;
-
-      CWorkflowGraph::allocNodeEdge();
-      StdString namestring = to_string(this->field->name);
-      namestring.erase(0, 6);
-      namestring.erase(namestring.length()-1, 1);
-
-      CWorkflowGraph::addNode(this->filterID, namestring + "\\n("+this->field->file->getId()+".nc)", 6, 0, 1, data[0]);
-
-      (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes = this->field->record4graphXiosAttributes();
-      (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes += "</br>file attributes : </br>" +this->field->file->record4graphXiosAttributes();
-      (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].clusterID =1;
-      (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].distance = data[0]->distance+1;
-
-      if(CXios::isClient && CWorkflowGraph::build_begin) 
-      {
-
-        CWorkflowGraph::addEdge(edgeID, this->filterID, data[0]);
-
-        (*CWorkflowGraph::mapFilters_ptr_with_info)[data[0]->src_filterID].filter_filled = 0 ;
-      }
-      else CWorkflowGraph::build_begin=true;
-    }
-  }
-
-  void CFileWriterFilter::onInputReady(std::vector<CDataPacketPtr> data)
-  {
-    buildGraph(data);
-    
-    const bool detectMissingValue = ( !field->default_value.isEmpty() &&
-                               ( (!field->detect_missing_value.isEmpty() || field->detect_missing_value == true)
-                                 || field->hasGridMask()) );
-
-    CArray<double, 1> dataArray = (detectMissingValue) ? data[0]->data.copy() : data[0]->data;
-
-    if (detectMissingValue)
-    {
-      const double missingValue = field->default_value;
-      const size_t nbData = dataArray.numElements();
-      for (size_t idx = 0; idx < nbData; ++idx)
-      {
-        if (NumTraits<double>::isNan(dataArray(idx)))
-          dataArray(idx) = missingValue;
-      }
-    }
-
-    field->sendUpdateData(dataArray);
-  }
-
-  bool CFileWriterFilter::mustAutoTrigger() const
-  {
-    return true;
-  }
-
-  bool CFileWriterFilter::isDataExpected(const CDate& date) const
-  {
-    return true;
-  }
-} // namespace xios
Index: XIOS/dev/dev_trunk_graph/src/filter/file_writer_filter.hpp
===================================================================
--- XIOS/dev/dev_trunk_graph/src/filter/file_writer_filter.hpp	(revision 2019)
+++ 	(revision )
@@ -1,65 +1,0 @@
-#ifndef __XIOS_CFileWriterFilter__
-#define __XIOS_CFileWriterFilter__
-
-#include "input_pin.hpp"
-#include "file.hpp"
-#include "duration.hpp"
-
-namespace xios
-{
-  class CField;
-
-  /*!
-   * A terminal filter which transmits the packets it receives to a field for writting in a file.
-   */
-  class CFileWriterFilter : public CInputPin
-  {
-    public:
-      int tag;
-      Time start_graph;
-      Time end_graph;
-      CField* field; //<! The associated field
-      int filterID;
-      int distance;
-
-      /*!
-       * Constructs the filter (with one input slot) associated to the specified field
-       * and a garbage collector.
-       *
-       * \param gc the associated garbage collector
-       * \param field the associated field
-       */
-      CFileWriterFilter(CGarbageCollector& gc, CField* field);
-
-      inline StdString GetName(void) {return "File writer filter";};
-
-
-      /*!
-       * Tests if the filter must auto-trigger.
-       *
-       * \return true if the filter must auto-trigger
-       */
-      bool virtual mustAutoTrigger() const;
-
-      /*!
-       * Tests whether data is expected for the specified date.
-       *
-       * \param date the date associated to the data
-       */
-      bool virtual isDataExpected(const CDate& date) const;
-
-    protected:
-      /*!
-       * Callbacks a field to write a packet to a file.
-       *
-       * \param data a vector of packets corresponding to each slot
-       */
-      void virtual onInputReady(std::vector<CDataPacketPtr> data);
-      void virtual buildGraph(std::vector<CDataPacketPtr> data);
-
-    private:
-      std::map<Time, CDataPacketPtr> packets; //<! The stored packets
-  }; // class CFileWriterFilter
-} // namespace xios
-
-#endif //__XIOS_CFileWriterFilter__
Index: XIOS/dev/dev_trunk_graph/src/filter/source_filter.cpp
===================================================================
--- XIOS/dev/dev_trunk_graph/src/filter/source_filter.cpp	(revision 2019)
+++ 	(revision )
@@ -1,150 +1,0 @@
-#include "source_filter.hpp"
-#include "grid.hpp"
-#include "exception.hpp"
-#include "calendar_util.hpp"
-#include <limits> 
-#include "workflow_graph.hpp"
-
-namespace xios
-{
-  CSourceFilter::CSourceFilter(CGarbageCollector& gc, CGrid* grid,
-                               bool compression /*= true*/, bool mask /*= false*/,
-                               const CDuration offset /*= NoneDu*/, bool manualTrigger /*= false*/,
-                               bool hasMissingValue /*= false*/,
-                               double defaultValue /*= 0.0*/)
-    : COutputPin(gc, manualTrigger)
-    , grid(grid)
-    , compression(compression)
-    , mask(mask)
-    , offset(offset)
-    , hasMissingValue(hasMissingValue), defaultValue(defaultValue)
-  {
-    if (!grid)
-      ERROR("CSourceFilter::CSourceFilter(CGrid* grid)",
-            "Impossible to construct a source filter without providing a grid.");
-  }
-
-  void CSourceFilter::buildGraph(CDataPacketPtr packet)
-  {
-    bool building_graph = this->tag ? packet->timestamp >= this->field->field_graph_start && packet->timestamp <= this->field->field_graph_end : false;
-    if(building_graph)
-    {
-      this->filterID = InvalidableObject::filterIdGenerator++;  
-      packet->src_filterID=this->filterID;
-      packet->field = this->field;
-      packet->distance = 1;
-      
-    
-      CWorkflowGraph::allocNodeEdge();
-
-      CWorkflowGraph::addNode(this->filterID, "Source Filter ", 1, 1, 0, packet);
-      (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes = this->field->record4graphXiosAttributes();
-      (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].field_id = this->field->getId();
-      (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].distance = 1;
-
-      CWorkflowGraph::build_begin = true;
-    }
-
-  }
-
-
-  template <int N>
-  void CSourceFilter::streamData(CDate date, const CArray<double, N>& data)
-  {
-    date = date + offset; // this is a temporary solution, it should be part of a proper temporal filter
-
-    CDataPacketPtr packet(new CDataPacket);
-    packet->date = date;
-    packet->timestamp = date;
-    packet->status = CDataPacket::NO_ERROR;
-
-    packet->data.resize(grid->storeIndex_client.numElements());    
-    
-    if (compression)
-    {
-      packet->data = defaultValue;
-      grid->uncompressField(data, packet->data);    
-    }
-    else
-    {
-      if (mask)
-        grid->maskField(data, packet->data);
-      else
-        grid->inputField(data, packet->data);
-    }
-    // Convert missing values to NaN
-    if (hasMissingValue)
-    {
-      const double nanValue = std::numeric_limits<double>::quiet_NaN();
-      const size_t nbData = packet->data.numElements();
-      for (size_t idx = 0; idx < nbData; ++idx)
-      {
-        if (defaultValue == packet->data(idx))
-          packet->data(idx) = nanValue;
-      }
-    }
-
-    if(CXios::isClient) buildGraph(packet);
-    
-
-
-    onOutputReady(packet);
-  }
-
-  template void CSourceFilter::streamData<1>(CDate date, const CArray<double, 1>& data);
-  template void CSourceFilter::streamData<2>(CDate date, const CArray<double, 2>& data);
-  template void CSourceFilter::streamData<3>(CDate date, const CArray<double, 3>& data);
-  template void CSourceFilter::streamData<4>(CDate date, const CArray<double, 4>& data);
-  template void CSourceFilter::streamData<5>(CDate date, const CArray<double, 5>& data);
-  template void CSourceFilter::streamData<6>(CDate date, const CArray<double, 6>& data);
-  template void CSourceFilter::streamData<7>(CDate date, const CArray<double, 7>& data);
-
-  void CSourceFilter::streamDataFromServer(CDate date, const std::map<int, CArray<double, 1> >& data)
-  {
-    date = date + offset; // this is a temporary solution, it should be part of a proper temporal filter
-
-    CDataPacketPtr packet(new CDataPacket);
-    packet->date = date;
-    packet->timestamp = date;
-    packet->status = CDataPacket::NO_ERROR;
-    
-    if (data.size() != grid->storeIndex_fromSrv.size())
-      ERROR("CSourceFilter::streamDataFromServer(CDate date, const std::map<int, CArray<double, 1> >& data)",
-            << "Incoherent data received from servers,"
-            << " expected " << grid->storeIndex_fromSrv.size() << " chunks but " << data.size() << " were given.");
-
-    packet->data.resize(grid->storeIndex_client.numElements());
-    std::map<int, CArray<double, 1> >::const_iterator it, itEnd = data.end();
-    for (it = data.begin(); it != itEnd; it++)
-    {      
-      CArray<int,1>& index = grid->storeIndex_fromSrv[it->first];
-      for (int n = 0; n < index.numElements(); n++)
-        packet->data(index(n)) = it->second(n);
-    }
-
-    // Convert missing values to NaN
-    if (hasMissingValue)
-    {
-      const double nanValue = std::numeric_limits<double>::quiet_NaN();
-      const size_t nbData = packet->data.numElements();
-      for (size_t idx = 0; idx < nbData; ++idx)
-      {
-        if (defaultValue == packet->data(idx))
-          packet->data(idx) = nanValue;
-      }
-    }
-
-    onOutputReady(packet);
-  }
-
-  void CSourceFilter::signalEndOfStream(CDate date)
-  {
-    date = date + offset; // this is a temporary solution, it should be part of a proper temporal filter
-
-    CDataPacketPtr packet(new CDataPacket);
-    packet->date = date;
-    packet->timestamp = date;
-    packet->status = CDataPacket::END_OF_STREAM;
-    onOutputReady(packet);
-  }
-} // namespace xios
Index: XIOS/dev/dev_trunk_graph/src/filter/source_filter.hpp
===================================================================
--- XIOS/dev/dev_trunk_graph/src/filter/source_filter.hpp	(revision 2019)
+++ 	(revision )
@@ -1,80 +1,0 @@
-#ifndef __XIOS_CSourceFilter__
-#define __XIOS_CSourceFilter__
-
-#include <map>
-
-#include "output_pin.hpp"
-
-namespace xios
-{
-  class CGrid;
-
-  /*!
-   * A source filter is the entry point of the data in the graph of filters.
-   */
-  class CSourceFilter : public COutputPin
-  {
-    public:
-      /*!
-       * Constructs a source filter accepting data attached to the specified grid.
-       *
-       * \param gc the garbage collector associated with this filter
-       * \param grid the grid to which the data is attached
-       * \param compression
-       * \param mask
-       * \param offset the offset applied to the timestamp of all packets
-       * \param manualTrigger whether the output should be triggered manually
-       * \param hasMissingValue whether data has missing value
-       * \param defaultValue missing value to detect
-       */
-      CSourceFilter(CGarbageCollector& gc, CGrid* grid,
-                    bool compression = true,
-                    bool mask = false,
-                    const CDuration offset = NoneDu, bool manualTrigger = false,
-                    bool hasMissingValue = false,
-                    double defaultValue = 0.0);
-
-      inline StdString GetName(void) {return StdString("Source filter");};
-
-      /*!
-       * Transforms the data received from the model into a packet and send it
-       * in the filter graph. The array containing the data can safely be reused
-       * immediately after this method returns.
-       *
-       * \param date the date associated to the data
-       * \param data an array containing the data
-       */
-      template <int N>
-      void streamData(CDate date, const CArray<double, N>& data);
-
-      void virtual buildGraph(CDataPacketPtr packet);
-
-      /*!
-       * Transforms the data received from the server into a packet and send it
-       * in the filter graph. The array containing the data can safely be reused
-       * immediately after this method returns.
-       *
-       * \param date the date associated to the data
-       * \param data an array containing the data
-       */
-      void streamDataFromServer(CDate date, const std::map<int, CArray<double, 1> >& data);
-
-      /*!
-       * Signals the filter graph that the end of stream was reached.
-       *
-       * \param date the date at which the end of stream occurred
-       */
-      void signalEndOfStream(CDate date);
-      int filterID;
-
-    private:
-      CGrid* grid;             //!< The grid attached to the data the filter can accept
-      const CDuration offset;  //!< The offset applied to the timestamp of all packets
-      const bool hasMissingValue;
-      const double defaultValue;
-      const bool compression ; //!< indicates if data need to be compressed : on client side : true, on server side : false
-      const bool mask ;        //!< indicates whether grid mask should be applied (true for clients, false for servers)
-  }; // class CSourceFilter
-} // namespace xios
-
-#endif //__XIOS_CSourceFilter__
Index: XIOS/dev/dev_trunk_graph/src/filter/spatial_transform_filter.cpp
===================================================================
--- XIOS/dev/dev_trunk_graph/src/filter/spatial_transform_filter.cpp	(revision 2019)
+++ 	(revision )
@@ -1,389 +1,0 @@
-#include "spatial_transform_filter.hpp"
-#include "grid_transformation.hpp"
-#include "context.hpp"
-#include "context_client.hpp"
-#include "timer.hpp"
-#include "workflow_graph.hpp"
-#include "file.hpp"
-
-namespace xios
-{
-  CSpatialTransformFilter::CSpatialTransformFilter(CGarbageCollector& gc, CSpatialTransformFilterEngine* engine, double outputValue, size_t inputSlotsCount)
-    : CFilter(gc, inputSlotsCount, engine), outputDefaultValue(outputValue)
-  { /* Nothing to do */ }
-
-  std::pair<std::shared_ptr<CSpatialTransformFilter>, std::shared_ptr<CSpatialTransformFilter> >
-  CSpatialTransformFilter::buildFilterGraph(CGarbageCollector& gc, CGrid* srcGrid, CGrid* destGrid, bool hasMissingValue, double missingValue)
-  {
-    if (!srcGrid || !destGrid)
-      ERROR("std::pair<std::shared_ptr<CSpatialTransformFilter>, std::shared_ptr<CSpatialTransformFilter> >"
-            "buildFilterGraph(CGarbageCollector& gc, CGrid* srcGrid, CGrid* destGrid)",
-            "Impossible to build the filter graph if either the source or the destination grid are null.");
-
-    std::shared_ptr<CSpatialTransformFilter> firstFilter, lastFilter;
-    // Note that this loop goes from the last transformation to the first transformation
-    do
-    {
-      CGridTransformation* gridTransformation = destGrid->getTransformations();
-      CSpatialTransformFilterEngine* engine = CSpatialTransformFilterEngine::get(destGrid->getTransformations());
-      const std::vector<StdString>& auxInputs = gridTransformation->getAuxInputs();
-      size_t inputCount = 1 + (auxInputs.empty() ? 0 : auxInputs.size());
-      double defaultValue  = (hasMissingValue) ? std::numeric_limits<double>::quiet_NaN() : 0.0;
-
-
-      const CGridTransformationSelector::ListAlgoType& algoList = gridTransformation->getAlgoList() ;
-      CGridTransformationSelector::ListAlgoType::const_iterator it  ;
-
-      bool isSpatialTemporal=false ;
-      for (it=algoList.begin();it!=algoList.end();++it)  if (it->second.first == TRANS_TEMPORAL_SPLITTING) isSpatialTemporal=true ;
-
-      std::shared_ptr<CSpatialTransformFilter> filter ;
-      if( isSpatialTemporal) filter = std::shared_ptr<CSpatialTransformFilter>(new CSpatialTemporalFilter(gc, engine, gridTransformation, defaultValue, inputCount));
-      else filter = std::shared_ptr<CSpatialTransformFilter>(new CSpatialTransformFilter(gc, engine, defaultValue, inputCount));
-
-      
-      if (!lastFilter)
-        lastFilter = filter;
-      else
-        filter->connectOutput(firstFilter, 0);
-
-      firstFilter = filter;
-      for (size_t idx = 0; idx < auxInputs.size(); ++idx)
-      {
-        CField* fieldAuxInput = CField::get(auxInputs[idx]);
-        fieldAuxInput->buildFilterGraph(gc, false);
-        fieldAuxInput->getInstantDataFilter()->connectOutput(firstFilter,idx+1);
-      }
-
-      destGrid = gridTransformation->getGridSource();
-    }
-    while (destGrid != srcGrid);
-
-    return std::make_pair(firstFilter, lastFilter);
-  }
-
-  void CSpatialTransformFilter::onInputReady(std::vector<CDataPacketPtr> data)
-  {
-    CSpatialTransformFilterEngine* spaceFilter = static_cast<CSpatialTransformFilterEngine*>(engine);
-    CDataPacketPtr outputPacket = spaceFilter->applyFilter(data, outputDefaultValue, this->tag, this->start_graph, this->end_graph, this->field);
-    if (outputPacket)
-      onOutputReady(outputPacket);
-  }
-
-  CSpatialTemporalFilter::CSpatialTemporalFilter(CGarbageCollector& gc, CSpatialTransformFilterEngine* engine, CGridTransformation* gridTransformation, double outputValue, size_t inputSlotsCount)
-    : CSpatialTransformFilter(gc, engine, outputValue, inputSlotsCount), record(0)
-  {
-      const CGridTransformationSelector::ListAlgoType& algoList = gridTransformation->getAlgoList() ;
-      CGridTransformationSelector::ListAlgoType::const_iterator it  ;
-
-      int pos ;
-      for (it=algoList.begin();it!=algoList.end();++it) 
-        if (it->second.first == TRANS_TEMPORAL_SPLITTING)
-        {
-          pos=it->first ;
-          if (pos < algoList.size()-1)
-            ERROR("SpatialTemporalFilter::CSpatialTemporalFilter(CGarbageCollector& gc, CSpatialTransformFilterEngine* engine, CGridTransformation* gridTransformation, double outputValue, size_t inputSlotsCount))",
-                  "temporal splitting operation must be the last of whole transformation on same grid") ;
-        }
-          
-      CGrid* grid=gridTransformation->getGridDestination() ;
-
-      CAxis* axis = grid->getAxis(gridTransformation->getElementPositionInGridDst2AxisPosition().find(pos)->second) ;
-
-      nrecords = axis->index.numElements() ;
-  }
-
-
-  void CSpatialTemporalFilter::onInputReady(std::vector<CDataPacketPtr> data)
-  {
-    CSpatialTransformFilterEngine* spaceFilter = static_cast<CSpatialTransformFilterEngine*>(engine);
-    CDataPacketPtr outputPacket = spaceFilter->applyFilter(data, outputDefaultValue, this->tag, this->start_graph, this->end_graph, this->field);
-
-    if (outputPacket)
-    {
-      size_t nelements=outputPacket->data.numElements() ;
-      if (!tmpData.numElements())
-      {
-        tmpData.resize(nelements);
-        tmpData=outputDefaultValue ;
-      }
-
-      nelements/=nrecords ;
-      size_t offset=nelements*record ;
-      for(size_t i=0;i<nelements;++i)  tmpData(i+offset) = outputPacket->data(i) ;
-    
-      record ++ ;
-      if (record==nrecords)
-      {
-        record=0 ;
-        CDataPacketPtr packet = CDataPacketPtr(new CDataPacket);
-        packet->date = data[0]->date;
-        packet->timestamp = data[0]->timestamp;
-        packet->status = data[0]->status;
-        packet->data.resize(tmpData.numElements());
-        packet->data = tmpData;
-        packet->field = this->field;
-        onOutputReady(packet);
-        tmpData.resize(0) ;
-      }
-    }
-  }
-
-
-  CSpatialTransformFilterEngine::CSpatialTransformFilterEngine(CGridTransformation* gridTransformation)
-    : gridTransformation(gridTransformation)
-  {
-    if (!gridTransformation)
-      ERROR("CSpatialTransformFilterEngine::CSpatialTransformFilterEngine(CGridTransformation* gridTransformation)",
-            "Impossible to construct a spatial transform filter engine without a valid grid transformation.");
-  }
-
-  std::map<CGridTransformation*, std::shared_ptr<CSpatialTransformFilterEngine> > CSpatialTransformFilterEngine::engines;
-
-  CSpatialTransformFilterEngine* CSpatialTransformFilterEngine::get(CGridTransformation* gridTransformation)
-  {
-    if (!gridTransformation)
-      ERROR("CSpatialTransformFilterEngine& CSpatialTransformFilterEngine::get(CGridTransformation* gridTransformation)",
-            "Impossible to get the requested engine, the grid transformation is invalid.");
-
-    std::map<CGridTransformation*, std::shared_ptr<CSpatialTransformFilterEngine> >::iterator it = engines.find(gridTransformation);
-    if (it == engines.end())
-    {
-      std::shared_ptr<CSpatialTransformFilterEngine> engine(new CSpatialTransformFilterEngine(gridTransformation));
-      it = engines.insert(std::make_pair(gridTransformation, engine)).first;
-    }
-
-    return it->second.get();
-  }
-
-  CDataPacketPtr CSpatialTransformFilterEngine::apply(std::vector<CDataPacketPtr> data)
-  {
-    /* Nothing to do */
-  }
-
-  bool CSpatialTransformFilterEngine::buildGraph(std::vector<CDataPacketPtr> data, int tag, Time start_graph, Time end_graph, CField *field)
-  {
-    bool building_graph = tag ? data[0]->timestamp >= start_graph && data[0]->timestamp <= end_graph : false;
-    if(building_graph)
-    {
-      this->filterID = InvalidableObject::filterIdGenerator++;
-      int edgeID = InvalidableObject::edgeIdGenerator++;    
-
-      CWorkflowGraph::allocNodeEdge();
-
-      CWorkflowGraph::addNode(this->filterID, "Spatial Transform Filter", 4, 1, 1, data[0]);
-      (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].distance = data[0]->distance+1;
-      (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes = field->record4graphXiosAttributes();
-      if(field->file) (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes += "</br>file attributes : </br>" +field->file->record4graphXiosAttributes();
-
-
-      if(CWorkflowGraph::build_begin)
-      {
-        CWorkflowGraph::addEdge(edgeID, this->filterID, data[0]);
-
-        (*CWorkflowGraph::mapFilters_ptr_with_info)[data[0]->src_filterID].filter_filled = 0;
-      }
-      else CWorkflowGraph::build_begin = true;
-    }
-
-    return building_graph;
-  }
-
-  CDataPacketPtr CSpatialTransformFilterEngine::applyFilter(std::vector<CDataPacketPtr> data, double defaultValue, int tag, Time start_graph, Time end_graph, CField *field)
-  {
-    
-    bool BG = buildGraph(data, tag, start_graph, end_graph, field);
-
-    CDataPacketPtr packet(new CDataPacket);
-    packet->date = data[0]->date;
-    packet->timestamp = data[0]->timestamp;
-    packet->status = data[0]->status;
-
-    if (packet->status == CDataPacket::NO_ERROR)
-    {
-      if (1 < data.size())  // Dynamical transformations
-      {
-        std::vector<CArray<double,1>* > dataAuxInputs(data.size()-1);
-        for (size_t idx = 0; idx < dataAuxInputs.size(); ++idx) dataAuxInputs[idx] = &(data[idx+1]->data);
-        gridTransformation->computeAll(dataAuxInputs, packet->timestamp);
-      }
-      packet->data.resize(gridTransformation->getGridDestination()->storeIndex_client.numElements());
-      if (0 != packet->data.numElements())
-        (packet->data)(0) = defaultValue;
-      if(BG) apply(data[0]->data, packet->data, this->filterID);
-      else apply(data[0]->data, packet->data);
-    }
-
-    if(BG) packet->src_filterID=this->filterID;
-    if(BG) packet->distance=data[0]->distance+1;
-    packet->field = field;
-
-    return packet;
-  }
-
-  void CSpatialTransformFilterEngine::apply(const CArray<double, 1>& dataSrc, CArray<double,1>& dataDest, int filterID)
-  {
-    CTimer::get("CSpatialTransformFilterEngine::apply").resume(); 
-    
-    CContextClient* client = CContext::getCurrent()->client;
-    int rank;
-    MPI_Comm_rank (client->intraComm, &rank);
-
-    // Get default value for output data
-    bool ignoreMissingValue = false; 
-    double defaultValue = std::numeric_limits<double>::quiet_NaN();
-    if (0 != dataDest.numElements()) ignoreMissingValue = NumTraits<double>::isNan(dataDest(0));
-
-    const std::list<CGridTransformation::SendingIndexGridSourceMap>& listLocalIndexSend = gridTransformation->getLocalIndexToSendFromGridSource();
-    const std::list<CGridTransformation::RecvIndexGridDestinationMap>& listLocalIndexToReceive = gridTransformation->getLocalIndexToReceiveOnGridDest();
-    const std::list<size_t>& listNbLocalIndexToReceive = gridTransformation->getNbLocalIndexToReceiveOnGridDest();
-    const std::vector<CGenericAlgorithmTransformation*>& listAlgos = gridTransformation->getAlgos();
-
-    CArray<double,1> dataCurrentDest(dataSrc.copy());
-
-    std::list<CGridTransformation::SendingIndexGridSourceMap>::const_iterator itListSend  = listLocalIndexSend.begin(),
-                                                                              iteListSend = listLocalIndexSend.end();
-    std::list<CGridTransformation::RecvIndexGridDestinationMap>::const_iterator itListRecv = listLocalIndexToReceive.begin();
-    std::list<size_t>::const_iterator itNbListRecv = listNbLocalIndexToReceive.begin();
-    std::vector<CGenericAlgorithmTransformation*>::const_iterator itAlgo = listAlgos.begin();
-
-    for (; itListSend != iteListSend; ++itListSend, ++itListRecv, ++itNbListRecv, ++itAlgo)
-    {
-      CArray<double,1> dataCurrentSrc(dataCurrentDest);
-      const CGridTransformation::SendingIndexGridSourceMap& localIndexToSend = *itListSend;
-
-      // Sending data from field sources to do transformations
-      std::map<int, CArray<int,1> >::const_iterator itbSend = localIndexToSend.begin(), itSend,
-                                                    iteSend = localIndexToSend.end();
-      int idxSendBuff = 0;
-      std::vector<double*> sendBuff(localIndexToSend.size());
-      double* sendBuffRank;
-      for (itSend = itbSend; itSend != iteSend; ++itSend, ++idxSendBuff)
-      {
-        int destRank = itSend->first;
-        if (0 != itSend->second.numElements())
-        {
-          if (rank != itSend->first)
-            sendBuff[idxSendBuff] = new double[itSend->second.numElements()];
-          else
-            sendBuffRank = new double[itSend->second.numElements()];
-        }
-      }
-
-      idxSendBuff = 0;
-      std::vector<MPI_Request> sendRecvRequest;
-      for (itSend = itbSend; itSend != iteSend; ++itSend, ++idxSendBuff)
-      {
-        int destRank = itSend->first;
-        const CArray<int,1>& localIndex_p = itSend->second;
-        int countSize = localIndex_p.numElements();
-        if (destRank != rank)
-        {
-          for (int idx = 0; idx < countSize; ++idx)
-          {
-            sendBuff[idxSendBuff][idx] = dataCurrentSrc(localIndex_p(idx));
-          }
-          sendRecvRequest.push_back(MPI_Request());
-          MPI_Isend(sendBuff[idxSendBuff], countSize, MPI_DOUBLE, destRank, 12, client->intraComm, &sendRecvRequest.back());
-        }
-        else
-        {
-          for (int idx = 0; idx < countSize; ++idx)
-          {
-            sendBuffRank[idx] = dataCurrentSrc(localIndex_p(idx));
-          }
-        }
-      }
-
-      // Receiving data on destination fields
-      const CGridTransformation::RecvIndexGridDestinationMap& localIndexToReceive = *itListRecv;
-      CGridTransformation::RecvIndexGridDestinationMap::const_iterator itbRecv = localIndexToReceive.begin(), itRecv,
-                                                                       iteRecv = localIndexToReceive.end();
-      int recvBuffSize = 0;
-      for (itRecv = itbRecv; itRecv != iteRecv; ++itRecv)
-      {
-        if (itRecv->first != rank )
-          recvBuffSize += itRecv->second.size();
-      }
-      //(recvBuffSize < itRecv->second.size()) ? itRecv->second.size() : recvBuffSize;
-      double* recvBuff;
-
-      if (0 != recvBuffSize) recvBuff = new double[recvBuffSize];
-      int currentBuff = 0;
-      for (itRecv = itbRecv; itRecv != iteRecv; ++itRecv)
-      {
-        int srcRank = itRecv->first;
-        if (srcRank != rank)
-        {
-          int countSize = itRecv->second.size();
-          sendRecvRequest.push_back(MPI_Request());
-          MPI_Irecv(recvBuff + currentBuff, countSize, MPI_DOUBLE, srcRank, 12, client->intraComm, &sendRecvRequest.back());
-          currentBuff += countSize;
-        }
-      }
-      std::vector<MPI_Status> status(sendRecvRequest.size());
-      MPI_Waitall(sendRecvRequest.size(), &sendRecvRequest[0], &status[0]);
-
-      dataCurrentDest.resize(*itNbListRecv);
-      dataCurrentDest = 0.0;
-
-      std::vector<bool> localInitFlag(dataCurrentDest.numElements(), true);
-      currentBuff = 0;
-      bool firstPass=true; 
-      for (itRecv = itbRecv; itRecv != iteRecv; ++itRecv)
-      {
-        const std::vector<std::pair<int,double> >& localIndex_p = itRecv->second;
-        int srcRank = itRecv->first;
-
-        if(filterID >=0) // building_graph
-        {
-           (*CWorkflowGraph::mapFilters_ptr_with_info)[filterID].filter_name = (*itAlgo)->getName();
-        } 
-        if (srcRank != rank)
-        {
-          int countSize = itRecv->second.size();
-          (*itAlgo)->apply(localIndex_p,
-                           recvBuff+currentBuff,
-                           dataCurrentDest,
-                           localInitFlag,
-                           ignoreMissingValue,firstPass);
-          currentBuff += countSize;
-        }
-        else
-        {
-          (*itAlgo)->apply(localIndex_p,
-                           sendBuffRank,
-                           dataCurrentDest,
-                           localInitFlag,
-                           ignoreMissingValue,firstPass);
-        }
-
-        firstPass=false ;
-      }
-
-      (*itAlgo)->updateData(dataCurrentDest);
-
-      idxSendBuff = 0;
-      for (itSend = itbSend; itSend != iteSend; ++itSend, ++idxSendBuff)
-      {
-        if (0 != itSend->second.numElements())
-        {
-          if (rank != itSend->first)
-            delete [] sendBuff[idxSendBuff];
-          else
-            delete [] sendBuffRank;
-        }
-      }
-      if (0 != recvBuffSize) delete [] recvBuff;
-    }
-    if (dataCurrentDest.numElements() != dataDest.numElements())
-    ERROR("CSpatialTransformFilterEngine::apply(const CArray<double, 1>& dataSrc, CArray<double,1>& dataDest)",
-          "Incoherent between the received size and expected size. " << std::endl 
-          << "Expected size: " << dataDest.numElements() << std::endl 
-          << "Received size: " << dataCurrentDest.numElements());
-
-    dataDest = dataCurrentDest;
-
-    CTimer::get("CSpatialTransformFilterEngine::apply").suspend() ;
-  }
-} // namespace xios
Index: XIOS/dev/dev_trunk_graph/src/filter/spatial_transform_filter.hpp
===================================================================
--- XIOS/dev/dev_trunk_graph/src/filter/spatial_transform_filter.hpp	(revision 2019)
+++ 	(revision )
@@ -1,158 +1,0 @@
-#ifndef __XIOS_CSpatialTransformFilter__
-#define __XIOS_CSpatialTransformFilter__
-
-#include "filter.hpp"
-#include "field.hpp"
-
-namespace xios
-{
-  class CGrid;
-  class CGridTransformation;
-  class CSpatialTransformFilterEngine;
-
-  class CField;
-
-  /*!
-   * A generic filter with multiple input slots wrapping any type of spatial transformations.
-   */
-  class CSpatialTransformFilter : public CFilter
-  {
-    public:
-      /*!
-       * Constructs a filter wrapping the specified spatial transformation.
-       *
-       * \param gc the associated garbage collector
-       * \param engine the engine defining the spatial transformation
-       * \param outputValue default value of output pin
-       * \param [in] inputSlotsCount number of input, by default there is only one for field src
-       */
-      CSpatialTransformFilter(CGarbageCollector& gc, CSpatialTransformFilterEngine* engine,
-                              double outputValue, size_t inputSlotsCount = 1);
-
-      inline StdString GetName(void) {return StdString("Spatial transform filter");};
-
-      /*!
-       * Builds the filter graph needed to transform the specified source grid into the specified destination grid.
-       *
-       * \param gc the associated garbage collector
-       * \param srcGrid the source grid
-       * \param destGrid the destination grid
-       * \param hasMissingValue whether field source has missing value
-       * \param defaultValue default value
-       * \return the first and the last filters of the filter graph
-       */
-      static std::pair<std::shared_ptr<CSpatialTransformFilter>, std::shared_ptr<CSpatialTransformFilter> >
-      buildFilterGraph(CGarbageCollector& gc, CGrid* srcGrid, CGrid* destGrid, bool hasMissingValue, double defaultValue);
-
-    protected:
-      /*!
-        Overriding this function to process transformations with auxillary inputs
-      */
-      void virtual onInputReady(std::vector<CDataPacketPtr> data);
-
-    protected:
-      //! Default value of output pin
-      double outputDefaultValue;
-  }; // class CSpatialTransformFilter
-
-
- /*!
-   * A specific spatial filter for the temporal_splitting transformation scalar -> axis. An incoming flux will be stored in an aditional dimension given by the destination axis.
-   * At each flux received, the storing index (record) is increased. When it reach the size of the axis (nrecords) a new flux is generated and the record is reset to 0
-   */
-
- class CSpatialTemporalFilter : public CSpatialTransformFilter
-  {
-    public:
-      /*!
-       * Constructs a filter wrapping the specified spatial transformation.
-       *
-       * \param gc the associated garbage collector
-       * \param engine the engine defining the spatial transformation
-       * \param [in] gridTransformation the associated transformations
-       * \param outputValue default value of output pin
-       * \param [in] inputSlotsCount number of input, by default there is only one for field src
-       */
-      CSpatialTemporalFilter(CGarbageCollector& gc, CSpatialTransformFilterEngine* engine, CGridTransformation* gridTransformation, double outputValue, size_t inputSlotsCount = 1);
-
-
-    protected:
-      /*!
-        Overriding this function to process transformations with auxillary inputs
-      */
-      void virtual onInputReady(std::vector<CDataPacketPtr> data);
-      //! Current record in the filter
-      int record ;
-      //! Maximum number of records
-      int nrecords;
-      //! Temporary storage for output flux
-      CArray<double, 1> tmpData; 
-
-
-  }; // class CSpatialTemporalFilter
-
-
-  /*!
-   * A generic filter engine wrapping a grid transformation.
-   */
-  class CSpatialTransformFilterEngine : public IFilterEngine
-  {
-    public:
-
-      int filterID;
-      int tag;
-      CField *field;
-      /*!
-       * Returns the engine wrapping the specified grid transformation.
-       * If the engine already exists it is reused, otherwise it is created.
-       *
-       * \param gridTransformation the grid transformation the engine will use
-       * \return the engine wrapping the specified grid transformation
-       */
-      static CSpatialTransformFilterEngine* get(CGridTransformation* gridTransformation);
-
-      /*!
-       * Applies the grid transformation to the input data and returns the result.
-       *
-       * \param data a vector of packets corresponding to each slot (one in this case)
-       * \param [in] defaultValue default value of output data
-       * \return the result of the grid transformation
-       */
-      CDataPacketPtr applyFilter(std::vector<CDataPacketPtr> data, double defaultValue = 0, int tag=0, Time start_graph=0, Time end_graph=-1, CField *field=0);
-      bool buildGraph(std::vector<CDataPacketPtr> data, int tag=0, Time start_graph=0, Time end_graph=-1, CField *field=0);
-
-       /*!
-       * Applies the grid transformation to the input data and returns the result.
-       *
-       * \param data a vector of packets corresponding to each slot (one in this case)
-       * \return the result of the grid transformation
-       */
-      CDataPacketPtr virtual apply(std::vector<CDataPacketPtr> data);
-
-
-
-    protected:
-      /*!
-       * Constructs a filter engine wrapping the specified grid transformation.
-       *
-       * \param gridTransformation the grid transformation the engine will use
-       */
-      CSpatialTransformFilterEngine(CGridTransformation* gridTransformation);
-
-      /*!
-       * Applies the grid transformation to the input data and returns the result.
-       * This helper function handles all the communications.
-       *
-       * \param dataSrc the source data
-       * \param dataDest the resulting transformed data
-       */
-      void apply(const CArray<double, 1>& dataSrc, CArray<double,1>& dataDest, int filterID=-1);
-
-      CGridTransformation* gridTransformation; //!< The grid transformation used by the engine
-
-      //! The allocated engines
-      static std::map<CGridTransformation*, std::shared_ptr<CSpatialTransformFilterEngine> > engines;
-  }; // class CSpatialTransformFilterEngine
-} // namespace xios
-
-#endif //__XIOS_CSpatialTransformFilter__
Index: XIOS/dev/dev_trunk_graph/src/filter/store_filter.cpp
===================================================================
--- XIOS/dev/dev_trunk_graph/src/filter/store_filter.cpp	(revision 2019)
+++ 	(revision )
@@ -1,157 +1,0 @@
-#include "store_filter.hpp"
-#include "context.hpp"
-#include "grid.hpp"
-#include "timer.hpp"
-#include "file.hpp"
-
-namespace xios
-{
-  CStoreFilter::CStoreFilter(CGarbageCollector& gc, CContext* context, CGrid* grid,
-                             bool detectMissingValues /*= false*/, double missingValue /*= 0.0*/)
-    : CInputPin(gc, 1)
-    , gc(gc)
-    , context(context)
-    , grid(grid)
-    , detectMissingValues(detectMissingValues)
-    , missingValue(missingValue)
-  {
-    if (!context)
-      ERROR("CStoreFilter::CStoreFilter(CContext* context, CGrid* grid)",
-            "Impossible to construct a store filter without providing a context.");
-    if (!grid)
-      ERROR("CStoreFilter::CStoreFilter(CContext* context, CGrid* grid)",
-            "Impossible to construct a store filter without providing a grid.");
-  }
-
-  CConstDataPacketPtr CStoreFilter::getPacket(Time timestamp)
-  {
-    CTimer timer("CStoreFilter::getPacket");
-    CConstDataPacketPtr packet;
-    const double timeout = CXios::recvFieldTimeout;
-
-    do
-    {
-      if (canBeTriggered())
-        trigger(timestamp);
-
-      timer.resume();
-
-      std::map<Time, CDataPacketPtr>::const_iterator it = packets.find(timestamp);
-      if (it != packets.end())
-        packet = it->second;
-      else // if the packet is not available yet, check if it can be received
-        context->checkBuffersAndListen();
-
-      timer.suspend();
-    } while (!packet && timer.getCumulatedTime() < timeout);
-
-    if (!packet)
-    {
-      std::map<Time, CDataPacketPtr>::const_iterator it ;
-      info(0)<<"Impossible to get the packet with timestamp = " << timestamp<<std::endl<<"Available timestamp are : "<<std::endl ;
-      for(it=packets.begin();it!=packets.end();++it) info(0)<<it->first<<"  ";
-      info(0)<<std::endl ;
-      ERROR("CConstDataPacketPtr CStoreFilter::getPacket(Time timestamp) const",
-            << "Impossible to get the packet with timestamp = " << timestamp);
-    }
-    return packet;
-  }
-
-  template <int N>
-  CDataPacket::StatusCode CStoreFilter::getData(Time timestamp, CArray<double, N>& data)
-  {
-    CConstDataPacketPtr packet = getPacket(timestamp);
-
-    if (packet->status == CDataPacket::NO_ERROR)
-      grid->outputField(packet->data, data);
-
-    return packet->status;
-  }
-
-  template CDataPacket::StatusCode CStoreFilter::getData<1>(Time timestamp, CArray<double, 1>& data);
-  template CDataPacket::StatusCode CStoreFilter::getData<2>(Time timestamp, CArray<double, 2>& data);
-  template CDataPacket::StatusCode CStoreFilter::getData<3>(Time timestamp, CArray<double, 3>& data);
-  template CDataPacket::StatusCode CStoreFilter::getData<4>(Time timestamp, CArray<double, 4>& data);
-  template CDataPacket::StatusCode CStoreFilter::getData<5>(Time timestamp, CArray<double, 5>& data);
-  template CDataPacket::StatusCode CStoreFilter::getData<6>(Time timestamp, CArray<double, 6>& data);
-  template CDataPacket::StatusCode CStoreFilter::getData<7>(Time timestamp, CArray<double, 7>& data);
-
-  void CStoreFilter::buildGraph(std::vector<CDataPacketPtr> data)
-  {
-    bool building_graph = this->tag ? data[0]->timestamp >= this->start_graph && data[0]->timestamp <= this->end_graph : false;
-
-    if(building_graph)
-    {
-      this->filterID = InvalidableObject::filterIdGenerator++;
-      int edgeID = InvalidableObject::edgeIdGenerator++;
-
-      CWorkflowGraph::allocNodeEdge();
- 
-      CWorkflowGraph::addNode(this->filterID, "Store Filter", 7, 0, 1, data[0]);
-      (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].distance = ++(data[0]->distance);
-      (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes = this->field->record4graphXiosAttributes();
-      if(this->field->file) (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes += "</br>file attributes : </br>" +this->field->file->record4graphXiosAttributes();
-
-      // if(CXios::isClient) std::cout<<"CStoreFilter::apply filter tag = "<<this->tag<<std::endl;
-
-      if(CXios::isClient && CWorkflowGraph::build_begin) 
-      {
-        CWorkflowGraph::addEdge(edgeID, this->filterID, data[0]);;
-        (*CWorkflowGraph::mapFilters_ptr_with_info)[data[0]->src_filterID].filter_filled = 0;
-      }
-      else CWorkflowGraph::build_begin = true;
-    }
-  }
-
-  void CStoreFilter::onInputReady(std::vector<CDataPacketPtr> data)
-  {
-    buildGraph(data);
-
-    CDataPacketPtr packet;
-    if (detectMissingValues)
-    {
-      const size_t nbData = data[0]->data.numElements();
-
-      packet = CDataPacketPtr(new CDataPacket);
-      packet->date = data[0]->date;
-      packet->timestamp = data[0]->timestamp;
-      packet->status = data[0]->status;
-      packet->data.resize(nbData);
-      packet->data = data[0]->data;
-
-      for (size_t idx = 0; idx < nbData; ++idx)
-      {
-        if (NumTraits<double>::isNan(packet->data(idx)))
-          packet->data(idx) = missingValue;
-      }
-
-    }
-
-    else
-    {
-      packet = data[0];
-    }
-
-    packets.insert(std::make_pair(packet->timestamp, packet));
-    // The packet is always destroyed by the garbage collector
-    // so we register but never unregister
-    gc.registerObject(this, packet->timestamp);
-
-  }
-
-  bool CStoreFilter::mustAutoTrigger() const
-  {
-    return false;
-  }
-
-  bool CStoreFilter::isDataExpected(const CDate& date) const
-  {
-    return true;
-  }
-
-  void CStoreFilter::invalidate(Time timestamp)
-  {
-    CInputPin::invalidate(timestamp);
-    packets.erase(packets.begin(), packets.lower_bound(timestamp));
-  }
-} // namespace xios
Index: XIOS/dev/dev_trunk_graph/src/filter/store_filter.hpp
===================================================================
--- XIOS/dev/dev_trunk_graph/src/filter/store_filter.hpp	(revision 2019)
+++ 	(revision )
@@ -1,105 +1,0 @@
-#ifndef __XIOS_CStoreFilter__
-#define __XIOS_CStoreFilter__
-
-#include "input_pin.hpp"
-#include "workflow_graph.hpp"
-
-
-namespace xios
-{
-  class CContext;
-  class CGrid;
-  class CField;
-
-  /*!
-   * A terminal filter which stores all the packets it receives.
-   */
-  class CStoreFilter : public CInputPin
-  {
-    public:
-      /*!
-       * Constructs the filter with one input slot and an associated
-       * garbage collector for the specified grid and context.
-       *
-       * \param gc the garbage collector associated with this input pin
-       * \param context the context to which the data belongs
-       * \param grid the grid to which the data is attached
-       * \param detectMissingValues whether missing values should be detected
-       * \param missingValue the value to use to replace missing values
-       */
-      CStoreFilter(CGarbageCollector& gc, CContext* context, CGrid* grid,
-                   bool detectMissingValues = false, double missingValue = 0.0);
-
-      /*!
-       * Accesses the filter storage and retuns the packet corresponding
-       * to the specified timestamp. If there is no packet available for
-       * the specified timestamp, the function waits until the data is
-       * received or a timeout occurs.
-       *
-       * \param timestamp the timestamp of the requested packet
-       * \return a pointer to a read-only packet
-       */
-      CConstDataPacketPtr getPacket(Time timestamp);
-
-      /*!
-       * Accesses the filter storage and retuns the data corresponding
-       * to the specified timestamp. If there is no data available for
-       * the specified timestamp, the function waits until the data is
-       * received or a timeout occurs.
-       *
-       * \param timestamp the timestamp of the requested data
-       * \param data the array where the data is to be copied
-       * \return the status code associated with the data
-       */
-      template <int N>
-      CDataPacket::StatusCode getData(Time timestamp, CArray<double, N>& data);
-
-      /*!
-       * Tests if the filter must auto-trigger.
-       *
-       * \return true if the filter must auto-trigger
-       */
-      bool virtual mustAutoTrigger() const;
-
-      /*!
-       * Tests whether data is expected for the specified date.
-       *
-       * \param date the date associated to the data
-       */
-      bool virtual isDataExpected(const CDate& date) const;
-
-      /*!
-       * Removes all pending packets which are older than the specified timestamp.
-       *
-       * \param timestamp the timestamp used for invalidation
-       */
-      void virtual invalidate(Time timestamp);
-
-      int filterID;
-      int tag;
-      Time start_graph;
-      Time end_graph;
-      CField *field;
-      int distance;
-
-
-    protected:
-      /*!
-       * Stores the packet for later access.
-       *
-       * \param data a vector of packets corresponding to each slot
-       */
-      void virtual onInputReady(std::vector<CDataPacketPtr> data);
-      void virtual buildGraph(std::vector<CDataPacketPtr> data);
-
-    private:
-      CGarbageCollector& gc; //!< The garbage collector associated to the filter
-      CContext* context; //!< The context to which the data belongs
-      CGrid* grid; //!< The grid attached to the data the filter can accept
-      const bool detectMissingValues; //!< Whether missing values should be detected
-      const double missingValue; //!< The value to use to replace missing values
-      std::map<Time, CDataPacketPtr> packets; //<! The stored packets
-  }; // class CStoreFilter
-} // namespace xios
-
-#endif //__XIOS_CStoreFilter__
Index: XIOS/dev/dev_trunk_graph/src/graphviz.cpp
===================================================================
--- XIOS/dev/dev_trunk_graph/src/graphviz.cpp	(revision 2019)
+++ 	(revision )
@@ -1,151 +1,0 @@
-#include "graphviz.hpp"
-#include "workflow_graph.hpp"
-
-namespace xios
-{
-
-  CGraphviz::CGraphviz()
-  { }
-
-  /*!
-   *
-   */
-  void CGraphviz::buildWorkflowGraphDot()
-  TRY
-  {
-    if (CWorkflowGraph::mapFieldToFilters_ptr_with_info !=0 && !CWorkflowGraph::mapFieldToFilters_ptr_with_info->empty())
-    {
-      CWorkflowGraph::buildStaticWorkflow();
-    
-      typedef boost::property<boost::edge_name_t, std::string> EdgeProperty;
-      typedef boost::adjacency_list<boost::vecS, boost::vecS, boost::directedS, boost::no_property, EdgeProperty> Graph;
-
-      // Input 1: nodes (=filters)
-      vector<StdString>& nodes = CWorkflowGraph::filters;
-      const int nbNodes = nodes.size();
-
-      // Input 2: edges (=fields)
-      vector<StdString>& edges = CWorkflowGraph::fields;
-
-      // Input 3: nodes to edges connectivity
-      vector<pair<int, int> >& nodesToEdges = CWorkflowGraph::fieldsToFilters;
-      const int nbEdges = nodesToEdges.size();
-
-      // Declare a graph object, adding the edges and edge properties
-      Graph g(nbNodes);
-      for (int j = 0; j < nbEdges; ++j)
-      {
-        graph_traits<Graph>::edge_descriptor e;
-        bool inserted;
-        boost::tie(e, inserted) = boost::add_edge(nodesToEdges[j].first, nodesToEdges[j].second, edges[j], g);
-      }
-
-      std::for_each(vertices(g).first, vertices(g).second, exercise_vertex<Graph>(g));
-
-      std::map<std::string,std::string> graph_attr, vertex_attr, edge_attr;
-      graph_attr["size"] = "5,5";
-      graph_attr["rankdir"] = "LR";
-      graph_attr["ratio"] = "fill";
-      vertex_attr["shape"] = "record";
-      vertex_attr["width"] = "2.2";
-      vertex_attr["fontsize"] = "16";
-
-      const std::string filename = "graph.dot";
-      std::ofstream file (filename.c_str());
-
-      boost::write_graphviz(file, g,
-          boost::make_label_writer(&nodes[0]),
-          boost::make_label_writer(get(edge_name, g)),
-          boost::make_graph_attributes_writer(graph_attr, vertex_attr, edge_attr));
-         
-    }
-  }
-  CATCH
-
-
-
-
-  void CGraphviz::buildWorkflowGraphVisjs_with_info()
-  TRY
-  {
-    if (CWorkflowGraph::mapFilters_ptr_with_info !=0 && !CWorkflowGraph::mapFilters_ptr_with_info->empty())
-    {
-      CWorkflowGraph::buildStaticWorkflow_with_info();
-
-      StdString color_table[7] = {"black", "red", "blue", "green", "purple", "yellow", "gray"};
-    
-      std::ofstream fs_json;
-      fs_json.open ("graph_data.json", std::fstream::out);
-
-      fs_json << "{\"nodes\":["<<std::endl<<"      ";
-      static bool firstnode=true;
-      static bool firstedge=true;
-    
-      for (auto it=CWorkflowGraph::mapFilters_ptr_with_info->begin(); it != CWorkflowGraph::mapFilters_ptr_with_info->end(); it++)
-      {
-        if(firstnode) 
-        {
-          fs_json << "{\"id\": "<<it->first +1<<", "<<std::endl;
-          firstnode = false;
-        }
-        else
-        {
-          fs_json << ",{\"id\": "<<it->first +1<<", "<<std::endl;
-        }
-        if(it->second.filter_class == 1) // source filter
-          fs_json << "       \"label\": \""<<it->second.filter_name<<"\\n("<<it->second.field_id<<")\", "<<std::endl;
-        else
-          fs_json << "       \"label\": \""<<it->second.filter_name<<"\", "<<std::endl;
-        fs_json << "       \"class\": "<<it->second.filter_class<<", "<<std::endl;
-        fs_json << "       \"filled\": "<<it->second.filter_filled<<", "<<std::endl;
-        fs_json << "       \"type\": \""<<it->second.transform_type<<"\", "<<std::endl;
-        fs_json << "       \"entry\": "<<it->second.expected_entry_nb<<", "<<std::endl;
-        fs_json << "       \"inputs\": "<<it->second.inputs_complete<<", "<<std::endl;
-        fs_json << "       \"tag\": "<<it->second.filter_tag<<", "<<std::endl;
-        fs_json << "       \"cid\": "<<it->second.clusterID<<", "<<std::endl;
-        fs_json << "       \"distance\": "<<it->second.distance<<", "<<std::endl;
-        fs_json << "       \"attributes\": \""<<it->second.attributes<<"\"}"<<std::endl<<"      ";
-      }
-      fs_json << "    ],"<<std::endl;
-
-
-      fs_json << " \"edges\" : ["<<std::endl<<"      ";
-
-      for (auto it=CWorkflowGraph::mapFieldToFilters_ptr_with_info->begin(); it != CWorkflowGraph::mapFieldToFilters_ptr_with_info->end(); it++)
-      {
-        if(firstedge)
-        {
-          fs_json << "{\"id\": "<<it->first +1<<", "<<std::endl;
-          firstedge = false;
-        }
-        else
-        {
-          fs_json << ",{\"id\": "<<it->first +1<<", "<<std::endl;
-        }
-        fs_json << "       \"from\": "<<it->second.from+1<<", "<<std::endl;
-        fs_json << "       \"to\": "<<it->second.to+1<<", "<<std::endl;
-        fs_json << "       \"label\": \""<<it->second.field_id<<"\\n"<<it->second.date<<"\", "<<std::endl;
-        // fs_json << "       \"title\": \""<<"Show more information about this field"<<"\", "<<std::endl;
-        // fs_json << "       \"fid\": \""<<it->second.field_id<<"\", "<<std::endl;
-        // fs_json << "       \"fname\": \""<<it->second.field_name<<"\", "<<std::endl;
-        // fs_json << "       \"gid\": \""<<it->second.grid_id<<"\", "<<std::endl;
-        fs_json << "       \"date\": \""<<it->second.date<<"\", "<<std::endl;
-        fs_json << "       \"attributes\": \"id = "<<it->second.field_id<<"</br>"<<it->second.attributes<<"\"}"<<std::endl<<"      ";
-
-      }
-      fs_json << "    ]}"<<std::endl;
-
-      fs_json.close();
-    }
-  }
-  CATCH
-
-
-
-  void CGraphviz::showStaticWorkflowGraph()
-  TRY
-  {
-    CWorkflowGraph::showStaticWorkflow();
-  }
-  CATCH
-}
Index: XIOS/dev/dev_trunk_graph/src/graphviz.hpp
===================================================================
--- XIOS/dev/dev_trunk_graph/src/graphviz.hpp	(revision 2019)
+++ 	(revision )
@@ -1,35 +1,0 @@
-#ifndef __GRAPHVIZ_HPP__
-#define __GRAPHVIZ_HPP__
-
-#include <algorithm>
-#include <boost/utility.hpp>
-#include <boost/graph/adjacency_list.hpp>
-#include <boost/graph/graphviz.hpp>
-
-namespace xios
-{
-
-  class CGraphviz
-  {
-
-    public:
-
-      CGraphviz();
-      static void buildWorkflowGraphDot();
-      static void buildWorkflowGraphVisjs_with_info();
-      static void showStaticWorkflowGraph();
-
-    private:
-      template <class Graph> struct exercise_vertex;
-
-  }; // class CGraphviz
-
-  template <class Graph> struct CGraphviz::exercise_vertex {
-    exercise_vertex(Graph& g_) : g(g_) { }
-    typedef typename boost::graph_traits<Graph>::vertex_descriptor Vertex;
-    void operator()(const Vertex& v) const { } Graph& g;
-  };
-
-} // namespace xios
-
-#endif
Index: XIOS/dev/dev_trunk_graph/src/node/transformation.hpp
===================================================================
--- XIOS/dev/dev_trunk_graph/src/node/transformation.hpp	(revision 2019)
+++ 	(revision )
@@ -1,80 +1,0 @@
-#ifndef __XIOS_CTransformation__
-#define __XIOS_CTransformation__
-
-#include "xios_spl.hpp"
-#include "xml_node.hpp"
-#include "transformation_enum.hpp"
-
-namespace xios {
-
-  ///--------------------------------------------------------------
-  /*!
-    \class CTransformation
-    This class describes inverse_axis in xml file.
-  */
-  template<typename T>
-  class CTransformation
-  {
-  public:
-    typedef typename std::list<std::pair<ETranformationType, CTransformation<T>* > > TransformationMapTypes;
-    typedef TransformationMapTypes TransMapTypes;
-
-    public :
-      /// Constructeurs ///
-      CTransformation(void) {}
-      virtual void checkValid(T* dest) {}
-
-      std::vector<StdString> checkAuxInputs() { return checkAuxInputs_(); }
-      static CTransformation<T>* createTransformation(ETranformationType transType, const StdString& id, xml::CXMLNode* node=0);
-
-      /// Destructeur ///
-      virtual ~CTransformation(void) {}
-
-    protected:
-      typedef CTransformation<T>* (*CreateTransformationCallBack)(const StdString&, xml::CXMLNode*);
-      typedef std::map<ETranformationType, CreateTransformationCallBack> CallBackMap;
-      static CallBackMap* transformationCreationCallBacks_;
-
-      static bool registerTransformation(ETranformationType transType, CreateTransformationCallBack createFn);
-      static bool unregisterTransformation(ETranformationType transType);
-
-    protected:
-      virtual std::vector<StdString> checkAuxInputs_() { return std::vector<StdString>(); }
-  }; // class CTransformation
-
-  template<typename T>
-  typename CTransformation<T>::CallBackMap* CTransformation<T>::transformationCreationCallBacks_ = 0; //CTransformation<T>::CallBackMap();
-
-  template<typename T>
-  CTransformation<T>* CTransformation<T>::createTransformation(ETranformationType transType, const StdString& id, xml::CXMLNode* node)
-  {
-    int transTypeInt = transType;
-    typename CallBackMap::const_iterator it = (*transformationCreationCallBacks_).find(transType);
-    if ((*transformationCreationCallBacks_).end() == it)
-    {
-       ERROR("CTransformation<T>::createTransformation(ETranformationType transType)",
-             << "Transformation type " << transType
-             << "doesn't exist. Please define.");
-    }
-    return (it->second)(id,node);
-  }
-
-  template<typename T>
-  bool CTransformation<T>::registerTransformation(ETranformationType transType, CreateTransformationCallBack createFn)
-  {
-    if (0 == transformationCreationCallBacks_)
-      transformationCreationCallBacks_ = new CallBackMap();
-
-    return (*transformationCreationCallBacks_).insert(make_pair(transType, createFn)).second;
-  }
-
-  template<typename T>
-  bool CTransformation<T>::unregisterTransformation(ETranformationType transType)
-  {
-    int transTypeInt = transType;
-    return (1 == (*transformationCreationCallBacks_).erase(transType));
-  }
-
-} // namespace xios
-
-#endif // __XIOS_CTransformation__
Index: XIOS/dev/dev_trunk_graph/src/node/transformation_enum.hpp
===================================================================
--- XIOS/dev/dev_trunk_graph/src/node/transformation_enum.hpp	(revision 2019)
+++ 	(revision )
@@ -1,33 +1,0 @@
-#ifndef __XIOS_TRANSFORMATION_ENUM__
-#define __XIOS_TRANSFORMATION_ENUM__
-
-namespace xios
-{
-      /// ////////////////////// DÃ©finitions ////////////////////// ///
-      typedef enum transformation_type
-      {
-        TRANS_ZOOM_AXIS = 0,
-        TRANS_INVERSE_AXIS = 1,
-        TRANS_INTERPOLATE_AXIS = 2,
-        TRANS_ZOOM_DOMAIN = 3,
-        TRANS_INTERPOLATE_DOMAIN = 4,
-        TRANS_GENERATE_RECTILINEAR_DOMAIN = 5,
-        TRANS_REDUCE_AXIS_TO_SCALAR = 6,
-        TRANS_REDUCE_DOMAIN_TO_AXIS = 7,
-        TRANS_EXTRACT_DOMAIN_TO_AXIS = 8,
-        TRANS_COMPUTE_CONNECTIVITY_DOMAIN = 9,
-        TRANS_EXPAND_DOMAIN = 10,
-        TRANS_EXTRACT_AXIS_TO_SCALAR = 11,
-        TRANS_REDUCE_DOMAIN_TO_SCALAR = 12,
-        TRANS_TEMPORAL_SPLITTING = 13,
-        TRANS_REDUCE_AXIS_TO_AXIS = 14,
-        TRANS_DUPLICATE_SCALAR_TO_AXIS = 15,
-        TRANS_REDUCE_SCALAR_TO_SCALAR = 16,
-        TRANS_REORDER_DOMAIN = 17,
-        TRANS_EXTRACT_DOMAIN = 18,
-        TRANS_EXTRACT_AXIS = 19
-      } ETranformationType;
-
-} // namespace xios
-
-#endif // __XIOS_TRANSFORMATION_ENUM__
Index: XIOS/dev/dev_trunk_graph/src/parse_expr/yacc_var.hpp
===================================================================
--- XIOS/dev/dev_trunk_graph/src/parse_expr/yacc_var.hpp	(revision 2019)
+++ 	(revision )
@@ -1,10 +1,0 @@
-#ifndef __YACC_VAR_HPP__
-#define __YACC_VAR_HPP__
-
-#include <string>
-namespace xios
-{
-  extern std::string *yacc_globalInputText_ptr;
-}
-
-#endif
Index: XIOS/dev/dev_trunk_graph/src/server_distribution_description.cpp
===================================================================
--- XIOS/dev/dev_trunk_graph/src/server_distribution_description.cpp	(revision 2019)
+++ 	(revision )
@@ -1,522 +1,0 @@
-/*!
-   \file server_distribution_description.hpp
-   \author Ha NGUYEN
-   \since 04 Jan 2015
-   \date 11 Jan 2016
-
-   \brief Description of index distribution on server(s).
- */
-
-#include "server_distribution_description.hpp"
-#include "exception.hpp"
-
-namespace xios
-{
-  /*!
-  \param [in] globalDimensionSize global dimension of grid
-  \param [in] nServer number of server
-  \param [in] serType type of server distribution. For now, we can distribute server by band or plan
-  */
-CServerDistributionDescription::CServerDistributionDescription(const std::vector<int>& globalDimensionSize,
-                                                               int nServer,
-                                                               ServerDistributionType serType)
-  : nGlobal_(globalDimensionSize), indexBegin_(), dimensionSizes_(), globalIndex_(),
-    vecGlobalIndex_(), serverType_(serType), nServer_(nServer), positionDimensionDistributed_(1)
-{
-}
-
-CServerDistributionDescription::~CServerDistributionDescription()
-{ /* Nothing to do */ }
-
-int CServerDistributionDescription::defaultDistributedDimension(int gridDimension,                                   
-                                                                ServerDistributionType serType)
-{  
-  switch (serType) 
-  {
-    case BAND_DISTRIBUTION:       
-       return ((1 == gridDimension) ? 0 : 1);
-      break;
-    default:
-      break;
-  } 
-}
-
-/*!
-  Compute pre-defined global index distribution of server(s).
-  \param [in] doComputeGlobalIndex flag to compute global index on each server. By default, false
-
-*/
-void CServerDistributionDescription::computeServerDistribution(bool doComputeGlobalIndex,
-                                                               int positionDimensionDistributed)
-{
-  switch (serverType_) {
-    case BAND_DISTRIBUTION:
-      computeBandDistribution(nServer_, positionDimensionDistributed);
-      break;
-    default:
-      break;
-  }
-
-  if (doComputeGlobalIndex)
-  {
-    vecGlobalIndex_.resize(nServer_);
-    int dim = nGlobal_.size();
-    std::vector<int> currentIndex(dim);
-
-    for (int idxServer = 0; idxServer < nServer_; ++idxServer)
-    {
-      size_t ssize = 1, idx = 0;
-      for (int j = 0; j < dim; ++j) ssize *= dimensionSizes_[idxServer][j];
-      vecGlobalIndex_[idxServer].resize(ssize);
-
-      std::vector<int> idxLoop(dim,0);
-
-      int innerLoopSize = dimensionSizes_[idxServer][0];
-
-      while (idx<ssize)
-      {
-        for (int idxDim = 0; idxDim < dim-1; ++idxDim)
-        {
-          if (idxLoop[idxDim] == dimensionSizes_[idxServer][idxDim])
-          {
-            idxLoop[idxDim] = 0;
-            ++idxLoop[idxDim+1];
-          }
-        }
-
-        for (int idxDim = 1; idxDim < dim; ++idxDim)  currentIndex[idxDim] = idxLoop[idxDim] + indexBegin_[idxServer][idxDim];
-
-        size_t mulDim, globalIndex;
-        for (int j = 0; j < innerLoopSize; ++j)
-        {
-          mulDim = 1;
-          globalIndex = j + indexBegin_[idxServer][0];
-
-          for (int k = 1; k < dim; ++k)
-          {
-            mulDim *= nGlobal_[k-1];
-            globalIndex += currentIndex[k] * mulDim;
-          }
-          vecGlobalIndex_[idxServer](idx) = globalIndex;
-          ++idx;
-        }
-        idxLoop[0] += innerLoopSize;
-      }
-    }
-  }
-}
-
-/*!
-  Compute global index assigned to a server with a range.E.g: if a grid has 100 points and
-  there are 2 servers, the first one takes index from 0 to 49, the second has index from 50 to 99
-  \param [in] indexBeginEnd begining and ending index of range
-  \param [in] positionDimensionDistributed dimension of server on which we make the cut.
-*/
-std::vector<int> CServerDistributionDescription::computeServerGlobalIndexInRange(const std::pair<size_t, size_t>& indexBeginEnd,
-                                                                     int positionDimensionDistributed)
-{
-  int nBand  = 0;
-  switch (serverType_)
-  {
-    case BAND_DISTRIBUTION:
-      nBand = computeBandDistribution(nServer_, positionDimensionDistributed);
-      break;
-    case ROOT_DISTRIBUTION:
-      nBand = computeRootDistribution(nServer_);
-    default:
-      break;
-  }
-
-  size_t indexBegin = indexBeginEnd.first;
-  size_t indexEnd   = indexBeginEnd.second;
-  if (indexBegin > indexEnd)
-     ERROR("CServerDistributionDescription::computeServerGlobalIndexInRange",
-           << "Index begin is larger than index end");
-
-  globalIndex_.rehash(std::ceil((indexEnd-indexBegin+1)/globalIndex_.max_load_factor()));
-
-  int dim = nGlobal_.size();
-  std::vector<int> currentIndex(dim);
-
-  for (int idxServer = 0; idxServer < nBand; ++idxServer)
-  {
-    size_t ssize = 1, idx = 0;
-    for (int j = 0; j < dim; ++j) ssize *= dimensionSizes_[idxServer][j];
-
-    std::vector<int> idxLoop(dim,0);
-    int innerLoopSize = dimensionSizes_[idxServer][0];
-
-    while (idx<ssize)
-    {
-      for (int idxDim = 0; idxDim < dim-1; ++idxDim)
-      {
-        if (idxLoop[idxDim] == dimensionSizes_[idxServer][idxDim])
-        {
-          idxLoop[idxDim] = 0;
-          ++idxLoop[idxDim+1];
-        }
-      }
-
-      for (int idxDim = 1; idxDim < dim; ++idxDim)  currentIndex[idxDim] = idxLoop[idxDim] + indexBegin_[idxServer][idxDim];
-
-      size_t mulDim, globalIndex;
-      for (int j = 0; j < innerLoopSize; ++j)
-      {
-        mulDim = 1;
-        globalIndex = j + indexBegin_[idxServer][0];
-
-        for (int k = 1; k < dim; ++k)
-        {
-          mulDim *= nGlobal_[k-1];
-          globalIndex += (currentIndex[k])*mulDim;
-        }
-        if ((indexBegin <= globalIndex) && (globalIndex <= indexEnd))
-          globalIndex_[globalIndex] = idxServer;
-        ++idx;
-      }
-      idxLoop[0] += innerLoopSize;
-    }
-  }
-
-    // List of servers without distribution (cause total number of server is greater than number of bands, for example)
-  std::vector<int> zeroIndexServer(nServer_-nBand); 
-  for (int idxServer = nBand; idxServer < nServer_; ++idxServer)
-    zeroIndexServer[idxServer-nBand] = idxServer;
-
-  return zeroIndexServer;
-}
-
-/*!
-  Compute the global index of grid elements (domain, axis) and their associated server rank.
-  Each client knows the general distribution of servers and from which they can compute the pieces of information to hold
-  \param [out] indexServerOnElement global index of each element as well as the corresponding server which contains these indices
-  \param [in] clientRank rank of client
-  \param [in] clientSize number of client
-  \param [in] axisDomainOrder the order of element in grid (2 for domain, 1 for axis, 0 for scalar)
-  \param [in] positionDimensionDistributed dimension of server on which we make the cut.
-*/
-std::vector<int> CServerDistributionDescription::computeServerGlobalByElement(std::vector<std::unordered_map<size_t,std::vector<int> > >& indexServerOnElement,
-                                                                              int clientRank,
-                                                                              int clientSize,
-                                                                              const CArray<int,1>& axisDomainOrder,
-                                                                              int positionDimensionDistributed)
-{
-  int nBand  = 0;
-  switch (serverType_) {
-    case BAND_DISTRIBUTION:
-      nBand = computeBandDistribution(nServer_, positionDimensionDistributed);
-      break;
-    default:
-      break;
-  }
-
-  int nbElement = axisDomainOrder.numElements();
-  indexServerOnElement.resize(nbElement);
-  int idx = 0;
-  std::vector<int> idxMap(nbElement);
-  for (int i = 0; i < nbElement; ++i)
-  {
-    idxMap[i] = idx;
-    if (2 == axisDomainOrder(i)) idx += 2;
-    else if (1 == axisDomainOrder(i)) idx += 1;
-    // nothing for scalar
-  }
-
-  for (int idxServer = 0; idxServer < nBand; ++idxServer)
-  {
-    std::vector<int> elementDimension(4);
-    for (int i = 0; i < nbElement; ++i)
-    {
-      int elementSize = 1;
-      if (2 == axisDomainOrder(i))
-      {
-        elementSize *= dimensionSizes_[idxServer][idxMap[i]] * dimensionSizes_[idxServer][idxMap[i]+1];
-        elementDimension[0] = indexBegin_[idxServer][idxMap[i]];
-        elementDimension[1] = indexBegin_[idxServer][idxMap[i]+1];
-        elementDimension[2] = dimensionSizes_[idxServer][idxMap[i]];
-        elementDimension[3] = dimensionSizes_[idxServer][idxMap[i]+1];
-      }
-
-      else if (1 == axisDomainOrder(i))
-      {
-        elementSize *= dimensionSizes_[idxServer][idxMap[i]];
-        elementDimension[0] = indexBegin_[idxServer][idxMap[i]];
-        elementDimension[1] = 0;
-        elementDimension[2] = dimensionSizes_[idxServer][idxMap[i]];
-        elementDimension[3] = 1;
-      }
-      else
-      {
-        elementSize *= dimensionSizes_[idxServer][idxMap[i]];
-        elementDimension[0] = 0;
-        elementDimension[1] = 0;
-        elementDimension[2] = 1;
-        elementDimension[3] = 1;
-      }
-
-      int rangeBegin, rangeSize;
-      computeRangeProcIndex(clientRank, clientSize, elementSize, rangeBegin, rangeSize);
-
-      size_t globalIndexElement;
-      idx = 0; int idxRange = 0;
-      for (int k = 0; k < elementDimension[3]; ++k)
-        for (int l = 0; l < elementDimension[2]; ++l)
-        {
-          globalIndexElement = (l+elementDimension[0]) + (k+elementDimension[1])*elementDimension[2];
-          if ((rangeBegin <= idx) && (idxRange < rangeSize))
-          {
-            indexServerOnElement[i][globalIndexElement].push_back(idxServer);
-            ++idxRange;
-          }
-          ++idx;
-        }
-    }
-  }
-
-  // List of servers without distribution (cause total number of server is greater than number of bands, for example)
-  std::vector<int> zeroIndexServer(nServer_-nBand); 
-  for (int idxServer = nBand; idxServer < nServer_; ++idxServer)
-    zeroIndexServer[idxServer-nBand] = idxServer;
-
-  return zeroIndexServer;
-}
-
-/*!
-  Compute a range of index on server which a client holds
-  For a range of index on a specific server, each client can hold a piece of the index range
-  If the range size is smaller than the number of client, there are some clients holding the same index
-  \param [in] clientRank rank of client
-  \param [in] clientSize number of client
-  \param [in] rangeProcSize index range size
-  \param [out] rangeBegin begin of range index a client holds
-  \param [out] rangeSize size of range index a client holds
-*/
-void CServerDistributionDescription::computeRangeProcIndex(int clientRank,
-                                                           int clientSize,
-                                                           int rangeProcSize,
-                                                           int& rangeBegin,
-                                                           int& rangeSize)
-{
-  if (rangeProcSize < clientSize)
-  {
-    int rangeIndex = 0;
-    for (int idx = 0; idx < clientSize; ++idx)
-    {
-      if (idx == clientRank)
-      {
-        rangeBegin = rangeIndex;
-        rangeSize = 1;
-      }
-      ++rangeIndex;
-      if (rangeIndex == rangeProcSize) rangeIndex = 0;
-    }
-    return;
-  }
-
-  int range, indexBegin = 0;
-  for (int i = 0; i < clientSize; ++i)
-  {
-    range = rangeProcSize / clientSize;
-    if (i < (rangeProcSize%clientSize)) ++range;
-    if (i == clientRank) break;
-    indexBegin += range;
-  }
-  rangeBegin = indexBegin;
-  rangeSize = range;
-}
-
-/*!
-  Compute global index of servers with band distribution
-  \param [in] nServer number of server
-*/
-int CServerDistributionDescription::computeBandDistribution(int nServer, int positionDimensionDistributed)
-{
-  int dim = nGlobal_.size();
-  positionDimensionDistributed_ = positionDimensionDistributed;
-  if (1 == dim) positionDimensionDistributed_ = 0;
-  if (positionDimensionDistributed_ > dim)
-    ERROR("CServerDistributionDescription::computeBandDistribution(int nServer, int positionDimensionDistributed)",
-          << "Position of distributed dimension is invalid" << std::endl
-          << "Position of distributed dimension is " << positionDimensionDistributed_
-          << "Dimension " << dim)
-
-  indexBegin_.resize(nServer);
-  dimensionSizes_.resize(nServer);
-
-  for (int i = 0; i< nServer; ++i)
-  {
-    indexBegin_[i].resize(dim);
-    dimensionSizes_[i].resize(dim);
-  }
-
-  int njRangeSize;
-  int nGlobTemp = 0;
-  std::vector<int> njRangeBegin(nServer,0);
-  std::vector<int> njRangeEnd(nServer,0);
-
-  int positionDistributed = (1<dim) ? positionDimensionDistributed_ : 0;
-  nGlobTemp = nGlobal_[positionDistributed];
-  int nbBand = std::min(nGlobTemp, nServer);
-
-  for (int i = 0; i < nbBand; ++i)
-  {
-    if (0 < i) njRangeBegin[i] = njRangeEnd[i-1];
-    njRangeSize = nGlobTemp / nbBand;
-    if (i < nGlobTemp%nbBand) ++njRangeSize;
-    njRangeEnd[i] = njRangeSize + njRangeBegin[i];
-  }
-  njRangeEnd[nbBand-1] = nGlobTemp;
-
-  for (int i = nbBand; i < nServer; ++i)
-  {
-    njRangeBegin[i] = njRangeEnd[i] = 0;
-  }
-
-  for (int i = 0; i < nServer; ++i)
-  {
-    for (int j = 0; j < dim; ++j)
-    {
-      if (positionDistributed != j)
-      {
-        if (1 == dim)
-        {
-          indexBegin_[i][j] = njRangeBegin[i];
-          dimensionSizes_[i][j] = njRangeEnd[i] - njRangeBegin[i];
-        }
-        else
-        {
-          indexBegin_[i][j] = 0;
-          dimensionSizes_[i][j] = nGlobal_[j];
-        }
-      }
-      else
-      {
-        indexBegin_[i][j] = njRangeBegin[i];
-        dimensionSizes_[i][j] = njRangeEnd[i] - njRangeBegin[i];
-      }
-    }
-  }
-
-  return nbBand;
-}
-
-
-/*!
-  Compute global index of servers with root distribution : only root server will received data
-  \param [in] nServer number of server
-*/
-int CServerDistributionDescription::computeRootDistribution(int nServer, int positionDimensionDistributed)
-{
-  int dim = nGlobal_.size();
-  positionDimensionDistributed_ = positionDimensionDistributed;
-  if (1 == dim) positionDimensionDistributed_ = 0;
-  if (positionDimensionDistributed_ > dim)
-    ERROR("CServerDistributionDescription::computeBandDistribution(int nServer, int positionDimensionDistributed)",
-          << "Position of distributed dimension is invalid" << std::endl
-          << "Position of distributed dimension is " << positionDimensionDistributed_
-          << "Dimension " << dim)
-
-  indexBegin_.resize(nServer);
-  dimensionSizes_.resize(nServer);
-
-  for (int i = 0; i< nServer; ++i)
-  {
-    indexBegin_[i].resize(dim);
-    dimensionSizes_[i].resize(dim);
-  }
-
-  int nGlobTemp = 0;
-
-  int positionDistributed = (1<dim) ? positionDimensionDistributed_ : 0;
-  nGlobTemp = nGlobal_[positionDistributed];
-  int nbBand = 1 ;
-
-
-  for (int i = 0; i < nServer; ++i)
-  {
-    for (int j = 0; j < dim; ++j)
-    {
-      if (positionDistributed != j) // bad coding, need to be rewrite
-      {
-        if (1 == dim)
-        {
-          if (i==0)
-          {
-            indexBegin_[i][j] = 0;
-            dimensionSizes_[i][j] = nGlobTemp;
-          }
-          else
-          {
-            indexBegin_[i][j] = nGlobTemp-1;
-            dimensionSizes_[i][j] = 0;
-          }
-        }
-        else
-        {
-          indexBegin_[i][j] = 0;
-          dimensionSizes_[i][j] = nGlobal_[j];
-        }
-      }
-      else
-      {
-        if (i==0)
-        {
-          indexBegin_[i][j] = 0;
-          dimensionSizes_[i][j] = nGlobTemp;
-        }
-        else
-        {
-          indexBegin_[i][j] = nGlobTemp-1;
-          dimensionSizes_[i][j] = 0;
-        }
-      }
-    }
-  }
-
-  return nbBand;
-}
-
-
-
-
-/*!
-  Get size of each dimension on distributed server
-  \return size of dimensions on server(s)
-*/
-std::vector<std::vector<int> > CServerDistributionDescription::getServerDimensionSizes() const
-{
-  return dimensionSizes_;
-}
-
-/*!
-  Get index begin of each dimension on distributed server
-  \return index begin of dimensions on server(s)
-*/
-std::vector<std::vector<int> > CServerDistributionDescription::getServerIndexBegin() const
-{
-  return indexBegin_;
-}
-
-/*!
-  Get global index on distributed server
-  \return global index on server(s)
-*/
-const std::vector<CArray<size_t,1> >& CServerDistributionDescription::getGlobalIndex() const
-{
-  return vecGlobalIndex_;
-}
-
-/*!
-  Get global index calculated by computeServerGlobalIndexInRange
-*/
-const std::unordered_map<size_t,int>& CServerDistributionDescription::getGlobalIndexRange() const
-{
-  return globalIndex_;
-}
-
-int CServerDistributionDescription::getDimensionDistributed()
-{
-  return ((1<nGlobal_.size()) ? positionDimensionDistributed_ : 0);
-}
-
-} // namespace xios
Index: XIOS/dev/dev_trunk_graph/src/server_distribution_description.hpp
===================================================================
--- XIOS/dev/dev_trunk_graph/src/server_distribution_description.hpp	(revision 2019)
+++ 	(revision )
@@ -1,88 +1,0 @@
-/*!
-   \file server_distribution_description.hpp
-   \author Ha NGUYEN
-   \since 04 Jan 2015
-   \date 11 Jan 2016
-
-   \brief Description of index distribution on server(s).
- */
-
-#ifndef __XIOS_SERVER_DISTRIBUTION_DESCRIPTION_HPP
-#define __XIOS_SERVER_DISTRIBUTION_DESCRIPTION_HPP
-
-#include "xios_spl.hpp"
-#include "array_new.hpp"
-#include <unordered_map>
-
-namespace xios
-{
-/*!
-   \class CServerDistributionDescription
-   This class contains information that describe distribution of servers.
-*/
-class CServerDistributionDescription
-{
-  public:
-    enum ServerDistributionType
-    {
-      BAND_DISTRIBUTION, PLAN_DISTRIBUTION, ROOT_DISTRIBUTION
-    };
-
-    /** Default constructor */
-    CServerDistributionDescription(const std::vector<int>& globalDimensionSize,
-                                   int nServer,
-                                   ServerDistributionType serType=BAND_DISTRIBUTION);
-
-    /** Default destructor */
-    virtual ~CServerDistributionDescription();
-
-    void computeServerDistribution(bool doComputeGlobalIndex = false, int positionDimensionDistributed = 1);
-    std::vector<int> computeServerGlobalIndexInRange(const std::pair<size_t, size_t>& indexBeginEnd, int positionDimensionDistributed = 1);
-    std::vector<int> computeServerGlobalByElement(std::vector<std::unordered_map<size_t,std::vector<int> > >& indexServerOnElement,
-                                                  int rank,
-                                                  int clientSize,
-                                                  const CArray<int,1>& axisDomainOrder,
-                                                  int positionDimensionDistributed = 1);
-
-    std::vector<std::vector<int> > getServerIndexBegin() const;
-    std::vector<std::vector<int> > getServerDimensionSizes() const;
-    const std::vector<CArray<size_t,1> >& getGlobalIndex() const;
-    const std::unordered_map<size_t,int>& getGlobalIndexRange() const;
-    int getDimensionDistributed();
-
-    static int defaultDistributedDimension(int gridDimension,                                   
-                                           ServerDistributionType serType=BAND_DISTRIBUTION);
-
-  protected:
-    int computeBandDistribution(int nServer, int positionDimensionDistributed = 1);
-    int computeRootDistribution(int nServer, int positionDimensionDistributed = 1);
-    void computePlanDistribution(int nServer);
-    void computeRangeProcIndex(int clientRank,
-                               int clientSize,
-                               int rangeProcSize,
-                               int& rangeBegin,
-                               int& rangeSize);
-
-  private:
-    std::vector<std::vector<int> > indexBegin_;     //!< Begin index of each dimension
-    std::vector<std::vector<int> > dimensionSizes_; //!< Size of each dimension
-    std::vector<int> nGlobal_; //!< Global size of each dimension
-
-    //!< General case, index describes distribution of each server (rarely use)
-    std::vector<CArray<size_t,1> > vecGlobalIndex_;
-
-    //!< In case we need only global index of one server with specific rank
-    std::unordered_map<size_t,int> globalIndex_;
-
-    //!< Type of distribution on server side
-    ServerDistributionType serverType_;
-
-    //!< Number of server
-    int nServer_;
-
-    //!< Position of dimension distributed on server side (by default, the second dimension)
-    int positionDimensionDistributed_;
-};
-
-} // namespace xios
-#endif // __XIOS_SERVER_DISTRIBUTION_DESCRIPTION_HPP
Index: XIOS/dev/dev_trunk_graph/src/transformation/axis_algorithm_duplicate_scalar.cpp
===================================================================
--- XIOS/dev/dev_trunk_graph/src/transformation/axis_algorithm_duplicate_scalar.cpp	(revision 2019)
+++ 	(revision )
@@ -1,77 +1,0 @@
-/*!
-   \file axis_algorithm_duplicate_scalar.cpp
-
-   \brief Algorithm to duplicate scalar into  axis 
- */
-#include "axis_algorithm_duplicate_scalar.hpp"
-#include "duplicate_scalar_to_axis.hpp"
-#include "axis.hpp"
-#include "scalar.hpp"
-#include "grid.hpp"
-#include "grid_transformation_factory_impl.hpp"
-
-namespace xios {
-CGenericAlgorithmTransformation* CAxisAlgorithmDuplicateScalar::create(CGrid* gridDst, CGrid* gridSrc,
-                                                                     CTransformation<CAxis>* transformation,
-                                                                     int elementPositionInGrid,
-                                                                     std::map<int, int>& elementPositionInGridSrc2ScalarPosition,
-                                                                     std::map<int, int>& elementPositionInGridSrc2AxisPosition,
-                                                                     std::map<int, int>& elementPositionInGridSrc2DomainPosition,
-                                                                     std::map<int, int>& elementPositionInGridDst2ScalarPosition,
-                                                                     std::map<int, int>& elementPositionInGridDst2AxisPosition,
-                                                                     std::map<int, int>& elementPositionInGridDst2DomainPosition)
-TRY
-{
-  std::vector<CAxis*> axisListDestP = gridDst->getAxis();
-  std::vector<CScalar*> scalarListSrcP = gridSrc->getScalars();
-
-  CDuplicateScalarToAxis* duplicateScalar = dynamic_cast<CDuplicateScalarToAxis*> (transformation);
-  int axisDstIndex = elementPositionInGridDst2AxisPosition[elementPositionInGrid];
-  int scalarSrcIndex = elementPositionInGridSrc2ScalarPosition[elementPositionInGrid];
-
-  return (new CAxisAlgorithmDuplicateScalar(axisListDestP[axisDstIndex], scalarListSrcP[scalarSrcIndex], duplicateScalar));
-}
-CATCH
-
-bool CAxisAlgorithmDuplicateScalar::registerTrans()
-TRY
-{
-  CGridTransformationFactory<CAxis>::registerTransformation(TRANS_DUPLICATE_SCALAR_TO_AXIS, create);
-}
-CATCH
-
-
-CAxisAlgorithmDuplicateScalar::CAxisAlgorithmDuplicateScalar(CAxis* axisDestination, CScalar* scalarSource, CDuplicateScalarToAxis* algo)
- : CAxisAlgorithmTransformation(axisDestination, scalarSource)
-{
-
-}
-
-
-CAxisAlgorithmDuplicateScalar::~CAxisAlgorithmDuplicateScalar()
-{
-}
-
-void CAxisAlgorithmDuplicateScalar::computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs)
-TRY
-{
-  this->transformationMapping_.resize(1);
-  this->transformationWeight_.resize(1);
-
-  TransformationIndexMap& transMap = this->transformationMapping_[0];
-  TransformationWeightMap& transWeight = this->transformationWeight_[0];
-
-  CArray<int,1>& axisDstIndex = axisDest_->index;
-
-  int nbAxisIdx = axisDstIndex.numElements();
-  for (int idxAxis = 0; idxAxis < nbAxisIdx; ++idxAxis)
-  {
-    int globalAxisIdx = axisDstIndex(idxAxis);
-    transMap[globalAxisIdx].resize(1);
-    transWeight[globalAxisIdx].resize(1);
-    transMap[globalAxisIdx][0] = 0 ;
-    transWeight[globalAxisIdx][0] = 1.0 ;
-  }
-}
-CATCH
-}
Index: XIOS/dev/dev_trunk_graph/src/transformation/axis_algorithm_duplicate_scalar.hpp
===================================================================
--- XIOS/dev/dev_trunk_graph/src/transformation/axis_algorithm_duplicate_scalar.hpp	(revision 2019)
+++ 	(revision )
@@ -1,53 +1,0 @@
-/*!
-   \file axis_algorithm_reduce_domain.hpp
-   \author Ha NGUYEN
-   \since 23 June 2016
-   \date 23 June 2016
-
-   \brief Algorithm for reduce an axis to a axis
- */
-#ifndef __XIOS_AXIS_ALGORITHM_DUPLICATE_SCALAR_HPP__
-#define __XIOS_AXIS_ALGORITHM_DUPLICATE_SCALAR_HPP__
-
-#include "axis_algorithm_transformation.hpp"
-#include "transformation.hpp"
-
-namespace xios {
-
-class CAxis;
-class CScalar;
-class CDuplicateScalarToAxis;
-
-
-/*!
-  \class CAxisAlgorithmDuplicateScalar
-  Duplicate scalar into axis destination
-*/
-class CAxisAlgorithmDuplicateScalar : public CAxisAlgorithmTransformation
-{
-public:
-  CAxisAlgorithmDuplicateScalar(CAxis* axisDestination, CScalar* scalarSource, CDuplicateScalarToAxis* algo);
-
-  virtual ~CAxisAlgorithmDuplicateScalar();
-
-  static bool registerTrans();
-
-  virtual StdString getName() {return "Axis Trans. Filter \\n Duplicate Scalar";}
-
-protected:
-  void computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs);
-
-private:
-  static CGenericAlgorithmTransformation* create(CGrid* gridDst, CGrid* gridSrc,
-                                                CTransformation<CAxis>* transformation,
-                                                int elementPositionInGrid,
-                                                std::map<int, int>& elementPositionInGridSrc2ScalarPosition,
-                                                std::map<int, int>& elementPositionInGridSrc2AxisPosition,
-                                                std::map<int, int>& elementPositionInGridSrc2DomainPosition,
-                                                std::map<int, int>& elementPositionInGridDst2ScalarPosition,
-                                                std::map<int, int>& elementPositionInGridDst2AxisPosition,
-                                                std::map<int, int>& elementPositionInGridDst2DomainPosition);
-};
-
-}
-#endif // __XIOS_AXIS_ALGORITHM_DUPLICATE_SCALAR_HPP__
Index: XIOS/dev/dev_trunk_graph/src/transformation/axis_algorithm_extract.cpp
===================================================================
--- XIOS/dev/dev_trunk_graph/src/transformation/axis_algorithm_extract.cpp	(revision 2019)
+++ 	(revision )
@@ -1,121 +1,0 @@
-/*!
-   \file axis_algorithm_extract.cpp
-   \brief Algorithm for extracting an axis.
- */
-#include "axis_algorithm_extract.hpp"
-#include "axis.hpp"
-#include "grid.hpp"
-#include "grid_transformation_factory_impl.hpp"
-#include "extract_axis.hpp"
-
-namespace xios {
-CGenericAlgorithmTransformation* CAxisAlgorithmExtract::create(CGrid* gridDst, CGrid* gridSrc,
-                                                           CTransformation<CAxis>* transformation,
-                                                           int elementPositionInGrid,
-                                                           std::map<int, int>& elementPositionInGridSrc2ScalarPosition,
-                                                           std::map<int, int>& elementPositionInGridSrc2AxisPosition,
-                                                           std::map<int, int>& elementPositionInGridSrc2DomainPosition,
-                                                           std::map<int, int>& elementPositionInGridDst2ScalarPosition,
-                                                           std::map<int, int>& elementPositionInGridDst2AxisPosition,
-                                                           std::map<int, int>& elementPositionInGridDst2DomainPosition)
-TRY
-{
-  std::vector<CAxis*> axisListDestP = gridDst->getAxis();
-  std::vector<CAxis*> axisListSrcP  = gridSrc->getAxis();
-
-  CExtractAxis* extractAxis = dynamic_cast<CExtractAxis*> (transformation);
-  int axisDstIndex = elementPositionInGridDst2AxisPosition[elementPositionInGrid];
-  int axisSrcIndex = elementPositionInGridSrc2AxisPosition[elementPositionInGrid];
-
-  return (new CAxisAlgorithmExtract(axisListDestP[axisDstIndex], axisListSrcP[axisSrcIndex], extractAxis));
-}
-CATCH
-
-bool CAxisAlgorithmExtract::registerTrans()
-TRY
-{
-  CGridTransformationFactory<CAxis>::registerTransformation(TRANS_EXTRACT_AXIS, create);
-}
-CATCH
-
-CAxisAlgorithmExtract::CAxisAlgorithmExtract(CAxis* axisDestination, CAxis* axisSource, CExtractAxis* extractAxis)
-: CAxisAlgorithmTransformation(axisDestination, axisSource)
-TRY
-{
-  extractAxis->checkValid(axisSource);
-  extractBegin_ = extractAxis->begin.getValue();
-  extractN_  = extractAxis->n.getValue();
-  extractEnd_   = extractBegin_ + extractN_ - 1;
-
-  if (extractN_ > axisSource->n_glo.getValue())
-  {
-    ERROR("CAxisAlgorithmExtract::CAxisAlgorithmExtract(CAxis* axisDestination, CAxis* axisSource, CExtractAxis* extractAxis)",
-           << "Extract size is greater than global size of source axis"
-           << "Global size of source axis " <<axisSource->getId() << " is " << axisSource->n_glo.getValue()  << std::endl
-           << "Extract size is " << extractN_ );
-  }
-
-  int idxSrc, nDest = 0, beginDestLoc, beginDestGlo = 0 ;
-  int indGloDest, indGloSrc, iSrc;
-  for (int i = 0; i < axisSrc_->n.getValue(); i++)
-  {
-    idxSrc = axisSrc_->index(i);
-    if ((idxSrc >= extractBegin_) && (idxSrc <= extractEnd_))
-    {
-      if (nDest == 0) beginDestLoc = i;
-      ++nDest;
-    }
-  }
-  beginDestGlo = beginDestLoc + axisSrc_->begin - extractBegin_;
-  axisDest_->n_glo.setValue(extractN_);
-  axisDest_->n.setValue(nDest);
-  axisDest_->begin.setValue(beginDestGlo);
-  axisDest_->index.resize(nDest);
-
-  axisDest_->data_n.setValue(nDest);
-  axisDest_->data_begin.setValue(0);
-  axisDest_->data_index.resize(nDest);
-
-  axisDest_->mask.resize(nDest);
-  if (axisSrc_->hasValue) axisDest_->value.resize(nDest);
-  if (axisSrc_->hasLabel) axisDest_->label.resize(nDest);
-  if (axisSrc_->hasBounds) axisDest_->bounds.resize(2,nDest);
-
-  this->transformationMapping_.resize(1);
-  this->transformationWeight_.resize(1);
-  TransformationIndexMap& transMap = this->transformationMapping_[0];
-  TransformationWeightMap& transWeight = this->transformationWeight_[0];
-
-  for (int iDest = 0; iDest < nDest; iDest++)
-  {
-    iSrc = iDest + beginDestLoc;
-    axisDest_->index(iDest) = iDest + beginDestGlo;
-    axisDest_->data_index(iDest) = axisSrc_->data_index(iSrc) - beginDestLoc;
-    axisDest_->mask(iDest) = axisSrc_->mask(iSrc);
-
-    if (axisSrc_->hasValue)
-      axisDest_->value(iDest) = axisSrc_->value(iSrc);
-    if (axisSrc_->hasLabel)
-      axisDest_->label(iDest) = axisSrc_->label(iSrc);
-    if (axisSrc_->hasBounds)
-    {
-      axisDest_->bounds(0,iDest) = axisSrc_->bounds(0,iSrc);
-      axisDest_->bounds(1,iDest) = axisSrc_->bounds(1,iSrc);
-    }
-    indGloDest = axisDest_->index(iDest);
-    indGloSrc = axisSrc_->index(iSrc);
-    transMap[indGloDest].push_back(indGloSrc);
-    transWeight[indGloDest].push_back(1.0);
-
-  }
-}
-CATCH
-
-/*!
-  Compute the index mapping between domain on grid source and one on grid destination
-*/
-void CAxisAlgorithmExtract::computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs)
-{
-}
-
-}
Index: XIOS/dev/dev_trunk_graph/src/transformation/axis_algorithm_extract.hpp
===================================================================
--- XIOS/dev/dev_trunk_graph/src/transformation/axis_algorithm_extract.hpp	(revision 2019)
+++ 	(revision )
@@ -1,63 +1,0 @@
-/*!
-   \file axis_algorithm_extract.hpp
-   \brief Algorithm for extracting an axis.
- */
-#ifndef __XIOS_AXIS_ALGORITHM_EXTRACT_HPP__
-#define __XIOS_AXIS_ALGORITHM_EXTRACT_HPP__
-
-#include "axis_algorithm_transformation.hpp"
-#include "transformation.hpp"
-
-namespace xios {
-class CAxis;
-class CExtractAxis;
-
-/*!
-  \class CAxisAlgorithmExtract
-  Implementing extract on axis
-  A extracted region can be considered as region that isn't masked.
-  Only this extracted region is extracted to write on Netcdf.
-*/
-class CAxisAlgorithmExtract : public CAxisAlgorithmTransformation
-{
-public:
-  CAxisAlgorithmExtract(CAxis* axisDestination, CAxis* axisSource, CExtractAxis* extractAxis);
-
-  virtual ~CAxisAlgorithmExtract() {}
-
-  static bool registerTrans();
-
-  virtual StdString getName() {return "Axis Trans. Filter \\n Extract";}
-
-protected:
-  void computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs);
-
-private:
-
-private:
-  //! Global extract begin on axis
-  StdSize extractBegin_;
-
-  //! Global extract end on axis
-  StdSize extractEnd_;
-
-  //! Global extract size on axis
-  StdSize extractN_;
-
-  std::vector<int> extractIndex_;
-
-private:
-
-  static CGenericAlgorithmTransformation* create(CGrid* gridDst, CGrid* gridSrc,
-                                                CTransformation<CAxis>* transformation,
-                                                int elementPositionInGrid,
-                                                std::map<int, int>& elementPositionInGridSrc2ScalarPosition,
-                                                std::map<int, int>& elementPositionInGridSrc2AxisPosition,
-                                                std::map<int, int>& elementPositionInGridSrc2DomainPosition,
-                                                std::map<int, int>& elementPositionInGridDst2ScalarPosition,
-                                                std::map<int, int>& elementPositionInGridDst2AxisPosition,
-                                                std::map<int, int>& elementPositionInGridDst2DomainPosition);
-};
-
-}
-#endif // __XIOS_AXIS_ALGORITHM_EXTRACT_HPP__
Index: XIOS/dev/dev_trunk_graph/src/transformation/axis_algorithm_extract_domain.cpp
===================================================================
--- XIOS/dev/dev_trunk_graph/src/transformation/axis_algorithm_extract_domain.cpp	(revision 2019)
+++ 	(revision )
@@ -1,131 +1,0 @@
-/*!
-   \file axis_algorithm_reduce_domain.cpp
-   \author Ha NGUYEN
-   \since 23 June 2016
-   \date 23 June 2016
-
-   \brief Algorithm for extract a domain to an axis
- */
-#include "axis_algorithm_extract_domain.hpp"
-#include "extract_domain_to_axis.hpp"
-#include "axis.hpp"
-#include "domain.hpp"
-#include "grid.hpp"
-#include "grid_transformation_factory_impl.hpp"
-#include "reduction.hpp"
-
-namespace xios {
-CGenericAlgorithmTransformation* CAxisAlgorithmExtractDomain::create(CGrid* gridDst, CGrid* gridSrc,
-                                                                     CTransformation<CAxis>* transformation,
-                                                                     int elementPositionInGrid,
-                                                                     std::map<int, int>& elementPositionInGridSrc2ScalarPosition,
-                                                                     std::map<int, int>& elementPositionInGridSrc2AxisPosition,
-                                                                     std::map<int, int>& elementPositionInGridSrc2DomainPosition,
-                                                                     std::map<int, int>& elementPositionInGridDst2ScalarPosition,
-                                                                     std::map<int, int>& elementPositionInGridDst2AxisPosition,
-                                                                     std::map<int, int>& elementPositionInGridDst2DomainPosition)
-TRY
-{
-  std::vector<CAxis*> axisListDestP = gridDst->getAxis();
-  std::vector<CDomain*> domainListSrcP = gridSrc->getDomains();
-
-  CExtractDomainToAxis* extractDomain = dynamic_cast<CExtractDomainToAxis*> (transformation);
-  int axisDstIndex = elementPositionInGridDst2AxisPosition[elementPositionInGrid];
-  int domainSrcIndex = elementPositionInGridSrc2DomainPosition[elementPositionInGrid];
-
-  return (new CAxisAlgorithmExtractDomain(axisListDestP[axisDstIndex], domainListSrcP[domainSrcIndex], extractDomain));
-}
-CATCH
-
-//bool CAxisAlgorithmExtractDomain::_dummyRegistered = CAxisAlgorithmExtractDomain::registerTrans();
-bool CAxisAlgorithmExtractDomain::registerTrans()
-TRY
-{
-  CGridTransformationFactory<CAxis>::registerTransformation(TRANS_EXTRACT_DOMAIN_TO_AXIS, create);
-}
-CATCH
-
-
-CAxisAlgorithmExtractDomain::CAxisAlgorithmExtractDomain(CAxis* axisDestination, CDomain* domainSource, CExtractDomainToAxis* algo)
- : CAxisAlgorithmTransformation(axisDestination, domainSource), pos_(-1), reduction_(0)
-TRY
-{
-  algo->checkValid(axisDestination, domainSource);
-  StdString op = "extract";
-
-  switch (algo->direction)
-  {
-    case CExtractDomainToAxis::direction_attr::jDir:
-      dir_ = jDir;
-      break;
-    case CExtractDomainToAxis::direction_attr::iDir:
-      dir_ = iDir;
-      break;
-    default:
-      break;
-  }
-
-  pos_ = algo->position;
-  reduction_ = CReductionAlgorithm::createOperation(CReductionAlgorithm::ReductionOperations[op]);
-}
-CATCH
-
-void CAxisAlgorithmExtractDomain::apply(const std::vector<std::pair<int,double> >& localIndex,
-                                        const double* dataInput,
-                                        CArray<double,1>& dataOut,
-                                        std::vector<bool>& flagInitial,                     
-                                        bool ignoreMissingValue, bool firstPass)
-TRY
-{
-  reduction_->apply(localIndex, dataInput, dataOut, flagInitial, ignoreMissingValue, firstPass);
-}
-CATCH
-
-CAxisAlgorithmExtractDomain::~CAxisAlgorithmExtractDomain()
-TRY
-{
-  if (0 != reduction_) delete reduction_;
-}
-CATCH
-
-void CAxisAlgorithmExtractDomain::computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs)
-TRY
-{
-  this->transformationMapping_.resize(1);
-  this->transformationWeight_.resize(1);
-
-  TransformationIndexMap& transMap = this->transformationMapping_[0];
-  TransformationWeightMap& transWeight = this->transformationWeight_[0];
-
-  CArray<int,1>& axisDstIndex = axisDest_->index;
-  int ni_glo = domainSrc_->ni_glo, nj_glo = domainSrc_->nj_glo;
-  if (jDir == dir_)
-  {
-    int nbAxisIdx = axisDstIndex.numElements();
-    for (int idxAxis = 0; idxAxis < nbAxisIdx; ++idxAxis)
-    {
-      int globalAxisIdx = axisDstIndex(idxAxis);
-      transMap[globalAxisIdx].resize(1);
-      transWeight[globalAxisIdx].resize(1);
-      transMap[globalAxisIdx][0] = globalAxisIdx * ni_glo + pos_;
-      transWeight[globalAxisIdx][0] = 1.0;
-
-    }
-  }
-  else if (iDir == dir_)
-  {
-    int nbAxisIdx = axisDstIndex.numElements();
-    for (int idxAxis = 0; idxAxis < nbAxisIdx; ++idxAxis)
-    {
-      int globalAxisIdx = axisDstIndex(idxAxis);
-      transMap[globalAxisIdx].resize(1);
-      transWeight[globalAxisIdx].resize(1);
-      transMap[globalAxisIdx][0] = globalAxisIdx + ni_glo * pos_;
-      transWeight[globalAxisIdx][0] = 1.0;
-    }
-  }
-  else
-  {}
-}
-CATCH
-}
Index: XIOS/dev/dev_trunk_graph/src/transformation/axis_algorithm_extract_domain.hpp
===================================================================
--- XIOS/dev/dev_trunk_graph/src/transformation/axis_algorithm_extract_domain.hpp	(revision 2019)
+++ 	(revision )
@@ -1,72 +1,0 @@
-/*!
-   \file axis_algorithm_reduce_domain.hpp
-   \author Ha NGUYEN
-   \since 23 June 2016
-   \date 23 June 2016
-
-   \brief Algorithm for reduce an axis to a axis
- */
-#ifndef __XIOS_AXIS_ALGORITHM_EXTRACT_DOMAIN_HPP__
-#define __XIOS_AXIS_ALGORITHM_EXTRACT_DOMAIN_HPP__
-
-#include "axis_algorithm_transformation.hpp"
-#include "transformation.hpp"
-
-namespace xios {
-
-class CAxis;
-class CDomain;
-class CExtractDomainToAxis;
-class CReductionAlgorithm;
-
-
-/*!
-  \class CAxisAlgorithmExtractDomain
-  Extract a domain to an axis
-*/
-class CAxisAlgorithmExtractDomain : public CAxisAlgorithmTransformation
-{
-public:
-  CAxisAlgorithmExtractDomain(CAxis* axisDestination, CDomain* domainSource, CExtractDomainToAxis* algo);
-
-  virtual void apply(const std::vector<std::pair<int,double> >& localIndex,
-                     const double* dataInput,
-                     CArray<double,1>& dataOut,
-                     std::vector<bool>& flagInitial,                     
-                     bool ignoreMissingValue, bool firstPass);
-
-  virtual ~CAxisAlgorithmExtractDomain();
-
-  static bool registerTrans();
-
-  virtual StdString getName() {return "Axis Trans. Filter \\n Extract Domain";}
-
-protected:
-  enum ExtractDirection {
-    undefined = 0,
-    iDir = 1,
-    jDir = 2
-  };
-
-  ExtractDirection dir_;
-  int pos_; //! Position to extract
-protected:
-  void computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs);
-
-protected:
-  CReductionAlgorithm* reduction_;
-
-private:
-  static CGenericAlgorithmTransformation* create(CGrid* gridDst, CGrid* gridSrc,
-                                                CTransformation<CAxis>* transformation,
-                                                int elementPositionInGrid,
-                                                std::map<int, int>& elementPositionInGridSrc2ScalarPosition,
-                                                std::map<int, int>& elementPositionInGridSrc2AxisPosition,
-                                                std::map<int, int>& elementPositionInGridSrc2DomainPosition,
-                                                std::map<int, int>& elementPositionInGridDst2ScalarPosition,
-                                                std::map<int, int>& elementPositionInGridDst2AxisPosition,
-                                                std::map<int, int>& elementPositionInGridDst2DomainPosition);
-};
-
-}
-#endif // __XIOS_AXIS_ALGORITHM_EXTRACT_DOMAIN_HPP__
Index: XIOS/dev/dev_trunk_graph/src/transformation/axis_algorithm_interpolate.cpp
===================================================================
--- XIOS/dev/dev_trunk_graph/src/transformation/axis_algorithm_interpolate.cpp	(revision 2019)
+++ 	(revision )
@@ -1,395 +1,0 @@
-/*!
-   \file axis_algorithm_interpolate.cpp
-   \author Ha NGUYEN
-   \since 23 June 2015
-   \date 02 Jul 2015
-
-   \brief Algorithm for interpolation on an axis.
- */
-#include "axis_algorithm_interpolate.hpp"
-#include "axis.hpp"
-#include "interpolate_axis.hpp"
-#include <algorithm>
-#include "context.hpp"
-#include "context_client.hpp"
-#include "utils.hpp"
-#include "grid.hpp"
-#include "grid_transformation_factory_impl.hpp"
-#include "distribution_client.hpp"
-#include "timer.hpp"
-
-namespace xios {
-CGenericAlgorithmTransformation* CAxisAlgorithmInterpolate::create(CGrid* gridDst, CGrid* gridSrc,
-                                                                   CTransformation<CAxis>* transformation,
-                                                                   int elementPositionInGrid,
-                                                                   std::map<int, int>& elementPositionInGridSrc2ScalarPosition,
-                                                                   std::map<int, int>& elementPositionInGridSrc2AxisPosition,
-                                                                   std::map<int, int>& elementPositionInGridSrc2DomainPosition,
-                                                                   std::map<int, int>& elementPositionInGridDst2ScalarPosition,
-                                                                   std::map<int, int>& elementPositionInGridDst2AxisPosition,
-                                                                   std::map<int, int>& elementPositionInGridDst2DomainPosition)
-TRY
-{
-  std::vector<CAxis*> axisListDestP = gridDst->getAxis();
-  std::vector<CAxis*> axisListSrcP  = gridSrc->getAxis();
-
-  CInterpolateAxis* interpolateAxis = dynamic_cast<CInterpolateAxis*> (transformation);
-  int axisDstIndex = elementPositionInGridDst2AxisPosition[elementPositionInGrid];
-  int axisSrcIndex = elementPositionInGridSrc2AxisPosition[elementPositionInGrid];
-
-  return (new CAxisAlgorithmInterpolate(axisListDestP[axisDstIndex], axisListSrcP[axisSrcIndex], interpolateAxis));
-}
-CATCH
-
-bool CAxisAlgorithmInterpolate::registerTrans()
-TRY
-{
-  CGridTransformationFactory<CAxis>::registerTransformation(TRANS_INTERPOLATE_AXIS, create);
-}
-CATCH
-
-CAxisAlgorithmInterpolate::CAxisAlgorithmInterpolate(CAxis* axisDestination, CAxis* axisSource, CInterpolateAxis* interpAxis)
-: CAxisAlgorithmTransformation(axisDestination, axisSource), coordinate_(), transPosition_()
-TRY
-{
-  interpAxis->checkValid(axisSource);
-  order_ = interpAxis->order.getValue();
-  if (!interpAxis->coordinate.isEmpty())
-  {
-    coordinate_ = interpAxis->coordinate.getValue();
-    this->idAuxInputs_.resize(1);
-    this->idAuxInputs_[0] = coordinate_;
-  }
-}
-CATCH
-
-/*!
-  Compute the index mapping between axis on grid source and one on grid destination
-*/
-void CAxisAlgorithmInterpolate::computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs)
-TRY
-{
-  CTimer::get("CAxisAlgorithmInterpolate::computeIndexSourceMapping_").resume() ;
-  CContext* context = CContext::getCurrent();
-  CContextClient* client=context->client;
-  int nbClient = client->clientSize;
-  CArray<bool,1>& axisMask = axisSrc_->mask;
-  int srcSize  = axisSrc_->n_glo.getValue();
-  std::vector<CArray<double,1> > vecAxisValue;
-
-  // Fill in axis value from coordinate
-  fillInAxisValue(vecAxisValue, dataAuxInputs);
-  std::vector<double> valueSrc(srcSize);
-  std::vector<double> recvBuff(srcSize);
-  std::vector<int> indexVec(srcSize);
-
-  for (int idx = 0; idx < vecAxisValue.size(); ++idx)
-  {
-    CArray<double,1>& axisValue = vecAxisValue[idx];
-    retrieveAllAxisValue(axisValue, axisMask, recvBuff, indexVec);
-    XIOSAlgorithms::sortWithIndex<double, CVectorStorage>(recvBuff, indexVec);
-    for (int i = 0; i < srcSize; ++i) valueSrc[i] = recvBuff[indexVec[i]];
-    computeInterpolantPoint(valueSrc, indexVec, idx);
-  }
-  CTimer::get("CAxisAlgorithmInterpolate::computeIndexSourceMapping_").suspend() ;
-}
-CATCH
-
-/*!
-  Compute the interpolant points
-  Assume that we have all value of axis source, with these values, need to calculate weight (coeff) of Lagrange polynomial
-  \param [in] axisValue all value of axis source
-  \param [in] tranPos position of axis on a domain
-*/
-void CAxisAlgorithmInterpolate::computeInterpolantPoint(const std::vector<double>& axisValue,
-                                                        const std::vector<int>& indexVec,
-                                                        int transPos)
-TRY
-{
-  std::vector<double>::const_iterator itb = axisValue.begin(), ite = axisValue.end();
-  std::vector<double>::const_iterator itLowerBound, itUpperBound, it, iteRange, itfirst, itsecond;
-  const double sfmax = NumTraits<double>::sfmax();
-  const double precision = NumTraits<double>::dummy_precision();
-
-  int ibegin = axisDest_->begin.getValue();
-  CArray<double,1>& axisDestValue = axisDest_->value;
-  int numValue = axisDestValue.numElements();
-  std::map<int, std::vector<std::pair<int,double> > > interpolatingIndexValues;
-
-  for (int idx = 0; idx < numValue; ++idx)
-  {
-    bool outOfRange = false;
-    double destValue = axisDestValue(idx);
-    if (destValue < *itb) outOfRange = true;
-
-    itLowerBound = std::lower_bound(itb, ite, destValue);
-    itUpperBound = std::upper_bound(itb, ite, destValue);
-    if ((ite != itUpperBound) && (sfmax == *itUpperBound)) itUpperBound = ite;
-
-    if ((ite == itLowerBound) || (ite == itUpperBound)) outOfRange = true;
-
-    // We don't do extrapolation FOR NOW, maybe in the future
-    if (!outOfRange)
-    {
-      if ((itLowerBound == itUpperBound) && (itb != itLowerBound)) --itLowerBound;
-      double distanceToLower = destValue - *itLowerBound;
-      double distanceToUpper = *itUpperBound - destValue;
-      int order = (order_ + 1) - 2;
-      bool down = (distanceToLower < distanceToUpper) ? true : false;
-      for (int k = 0; k < order; ++k)
-      {
-        if ((itb != itLowerBound) && down)
-        {
-          --itLowerBound;
-          distanceToLower = destValue - *itLowerBound;
-          down = (distanceToLower < distanceToUpper) ? true : false;
-          continue;
-        }
-        if ((ite != itUpperBound) && (sfmax != *itUpperBound))
-        {
-          ++itUpperBound;
-          distanceToUpper = *itUpperBound - destValue;
-          down = (distanceToLower < distanceToUpper) ? true : false;
-
-        }
-      }
-
-      iteRange = (ite == itUpperBound) ? itUpperBound : itUpperBound + 1;
-      itsecond = it = itLowerBound; ++itsecond;
-      while (it < iteRange)
-      {
-        while ( (itsecond < ite) && ((*itsecond -*it) < precision) )
-        { ++itsecond; ++it; }
-        int index = std::distance(itb, it);
-        interpolatingIndexValues[idx+ibegin].push_back(make_pair(indexVec[index],*it));
-        ++it; ++itsecond;
-      }
-
-    }
-  }
-  computeWeightedValueAndMapping(interpolatingIndexValues, transPos);
-}
-CATCH
-
-/*!
-  Compute weight (coeff) of Lagrange's polynomial
-  \param [in] interpolatingIndexValues the necessary axis value to calculate the coeffs
-*/
-void CAxisAlgorithmInterpolate::computeWeightedValueAndMapping(const std::map<int, std::vector<std::pair<int,double> > >& interpolatingIndexValues, int transPos)
-TRY
-{
-  TransformationIndexMap& transMap = this->transformationMapping_[transPos];
-  TransformationWeightMap& transWeight = this->transformationWeight_[transPos];
-  std::map<int, std::vector<std::pair<int,double> > >::const_iterator itb = interpolatingIndexValues.begin(), it,
-                                                                      ite = interpolatingIndexValues.end();
-  int ibegin = axisDest_->begin.getValue();
-  for (it = itb; it != ite; ++it)
-  {
-    int globalIndexDest = it->first;
-    double localValue = axisDest_->value(globalIndexDest - ibegin);
-    const std::vector<std::pair<int,double> >& interpVal = it->second;
-    int interpSize = interpVal.size();
-    transMap[globalIndexDest].resize(interpSize);
-    transWeight[globalIndexDest].resize(interpSize);
-    for (int idx = 0; idx < interpSize; ++idx)
-    {
-      int index = interpVal[idx].first;
-      double weight = 1.0;
-
-      for (int k = 0; k < interpSize; ++k)
-      {
-        if (k == idx) continue;
-        weight *= (localValue - interpVal[k].second);
-        weight /= (interpVal[idx].second - interpVal[k].second);
-      }
-      transMap[globalIndexDest][idx] = index;
-      transWeight[globalIndexDest][idx] = weight;
-      if (!transPosition_.empty())
-      {
-        (this->transformationPosition_[transPos])[globalIndexDest] = transPosition_[transPos];
-      }
-    }
-  }
-  if (!transPosition_.empty() && this->transformationPosition_[transPos].empty())
-    (this->transformationPosition_[transPos])[0] = transPosition_[transPos];
-
-}
-CATCH
-
-/*!
-  Each client retrieves all values of an axis
-  \param [in/out] recvBuff buffer for receiving values (already allocated)
-  \param [in/out] indexVec mapping between values and global index of axis
-*/
-void CAxisAlgorithmInterpolate::retrieveAllAxisValue(const CArray<double,1>& axisValue, const CArray<bool,1>& axisMask,
-                                                     std::vector<double>& recvBuff, std::vector<int>& indexVec)
-TRY
-{
-  CContext* context = CContext::getCurrent();
-  CContextClient* client=context->client;
-  int nbClient = client->clientSize;
-
-  int srcSize  = axisSrc_->n_glo.getValue();
-  int numValue = axisValue.numElements();
-
-  if (srcSize == numValue)  // Only one client or axis not distributed
-  {
-    for (int idx = 0; idx < srcSize; ++idx)
-    {
-      if (axisMask(idx))
-      {
-        recvBuff[idx] = axisValue(idx);
-        indexVec[idx] = idx;
-      }
-      else
-      {
-        recvBuff[idx] = NumTraits<double>::sfmax();
-        indexVec[idx] = -1;
-      }
-    }
-
-  }
-  else // Axis distributed
-  {
-    double* sendValueBuff = new double [numValue];
-    int* sendIndexBuff = new int [numValue];
-    int* recvIndexBuff = new int [srcSize];
-
-    int ibegin = axisSrc_->begin.getValue();
-    for (int idx = 0; idx < numValue; ++idx)
-    {
-      if (axisMask(idx))
-      {
-        sendValueBuff[idx] = axisValue(idx);
-        sendIndexBuff[idx] = idx + ibegin;
-      }
-      else
-      {
-        sendValueBuff[idx] = NumTraits<double>::sfmax();
-        sendIndexBuff[idx] = -1;
-      }
-    }
-
-    int* recvCount=new int[nbClient];
-    MPI_Allgather(&numValue,1,MPI_INT,recvCount,1,MPI_INT,client->intraComm);
-
-    int* displ=new int[nbClient];
-    displ[0]=0 ;
-    for(int n=1;n<nbClient;n++) displ[n]=displ[n-1]+recvCount[n-1];
-
-    // Each client have enough global info of axis
-    MPI_Allgatherv(sendIndexBuff,numValue,MPI_INT,recvIndexBuff,recvCount,displ,MPI_INT,client->intraComm);
-    MPI_Allgatherv(sendValueBuff,numValue,MPI_DOUBLE,&(recvBuff[0]),recvCount,displ,MPI_DOUBLE,client->intraComm);
-
-    for (int idx = 0; idx < srcSize; ++idx)
-    {
-      indexVec[idx] = recvIndexBuff[idx];
-    }
-
-    delete [] displ;
-    delete [] recvCount;
-    delete [] recvIndexBuff;
-    delete [] sendIndexBuff;
-    delete [] sendValueBuff;
-  }
-}
-CATCH
-
-/*!
-  Fill in axis value dynamically from a field whose grid is composed of a domain and an axis
-  \param [in/out] vecAxisValue vector axis value filled in from input field
-*/
-void CAxisAlgorithmInterpolate::fillInAxisValue(std::vector<CArray<double,1> >& vecAxisValue,
-                                                const std::vector<CArray<double,1>* >& dataAuxInputs)
-TRY
-{
-  if (coordinate_.empty())
-  {
-    vecAxisValue.resize(1);
-    vecAxisValue[0].resize(axisSrc_->value.numElements());
-    vecAxisValue[0] = axisSrc_->value;
-    this->transformationMapping_.resize(1);
-    this->transformationWeight_.resize(1);
-  }
-  else
-  {
-    CField* field = CField::get(coordinate_);
-    CGrid* grid = field->grid;
-
-    std::vector<CDomain*> domListP = grid->getDomains();
-    std::vector<CAxis*> axisListP = grid->getAxis();
-    if (domListP.empty() || axisListP.empty() || (1 < domListP.size()) || (1 < axisListP.size()))
-      ERROR("CAxisAlgorithmInterpolate::fillInAxisValue(std::vector<CArray<double,1> >& vecAxisValue)",
-             << "XIOS only supports dynamic interpolation with coordinate (field) associated with grid composed of a domain and an axis"
-             << "Coordinate (field) id = " <<field->getId() << std::endl
-             << "Associated grid id = " << grid->getId());
-
-    CDomain* dom = domListP[0];
-    size_t vecAxisValueSize = dom->i_index.numElements();
-    size_t vecAxisValueSizeWithMask = 0;
-    for (size_t idx = 0; idx < vecAxisValueSize; ++idx)
-    {
-      if (dom->domainMask(idx)) ++vecAxisValueSizeWithMask;
-    }
-
-    int niGlobDom = dom->ni_glo.getValue();
-    vecAxisValue.resize(vecAxisValueSizeWithMask);
-    if (transPosition_.empty())
-    {
-      size_t indexMask = 0;
-      transPosition_.resize(vecAxisValueSizeWithMask);
-      for (size_t idx = 0; idx < vecAxisValueSize; ++idx)
-      {
-        if (dom->domainMask(idx))
-        {
-          transPosition_[indexMask].resize(1);
-          transPosition_[indexMask][0] = (dom->i_index)(idx) + niGlobDom * (dom->j_index)(idx);
-          ++indexMask;
-        }
-
-      }
-    }
-    this->transformationMapping_.resize(vecAxisValueSizeWithMask);
-    this->transformationWeight_.resize(vecAxisValueSizeWithMask);
-    this->transformationPosition_.resize(vecAxisValueSizeWithMask);
-
-    const CDistributionClient::GlobalLocalDataMap& globalLocalIndexSendToServer = grid->getDistributionClient()->getGlobalLocalDataSendToServer();
-    CDistributionClient::GlobalLocalDataMap::const_iterator itIndex, iteIndex = globalLocalIndexSendToServer.end();
-    size_t axisSrcSize = axisSrc_->index.numElements();
-    std::vector<int> globalDimension = grid->getGlobalDimension();
-
-    size_t indexMask = 0;
-    for (size_t idx = 0; idx < vecAxisValueSize; ++idx)
-    {
-      if (dom->domainMask(idx))
-      {
-        size_t axisValueSize = 0;
-        for (size_t jdx = 0; jdx < axisSrcSize; ++jdx)
-        {
-          size_t globalIndex = ((dom->i_index)(idx) + (dom->j_index)(idx)*globalDimension[0]) + (axisSrc_->index)(jdx)*globalDimension[0]*globalDimension[1];
-          if (iteIndex != globalLocalIndexSendToServer.find(globalIndex))
-          {
-            ++axisValueSize;
-          }
-        }
-
-        vecAxisValue[indexMask].resize(axisValueSize);
-        axisValueSize = 0;
-        for (size_t jdx = 0; jdx < axisSrcSize; ++jdx)
-        {
-          size_t globalIndex = ((dom->i_index)(idx) + (dom->j_index)(idx)*globalDimension[0]) + (axisSrc_->index)(jdx)*globalDimension[0]*globalDimension[1];
-          itIndex = globalLocalIndexSendToServer.find(globalIndex);
-          if (iteIndex != itIndex)
-          {
-            vecAxisValue[indexMask](axisValueSize) = (*dataAuxInputs[0])(itIndex->second);
-            ++axisValueSize;
-          }
-        }
-        ++indexMask;
-      }
-    }
-  }
-}
-CATCH
-
-}
Index: XIOS/dev/dev_trunk_graph/src/transformation/axis_algorithm_interpolate.hpp
===================================================================
--- XIOS/dev/dev_trunk_graph/src/transformation/axis_algorithm_interpolate.hpp	(revision 2019)
+++ 	(revision )
@@ -1,68 +1,0 @@
-/*!
-   \file axis_algorithm_interpolate.hpp
-   \author Ha NGUYEN
-   \since 23 June 2015
-   \date 23 June 2015
-
-   \brief Algorithm for interpolation on an axis.
- */
-#ifndef __XIOS_AXIS_ALGORITHM_INTERPOLATE_HPP__
-#define __XIOS_AXIS_ALGORITHM_INTERPOLATE_HPP__
-
-#include "axis_algorithm_transformation.hpp"
-#include "transformation.hpp"
-
-namespace xios {
-
-class CAxis;
-class CGrid;
-class CInterpolateAxis;
-
-/*!
-  \class CAxisAlgorithmInterpolate
-  Implementing interpolation on axis
-  The values on axis source are assumed monotonic
-*/
-class CAxisAlgorithmInterpolate : public CAxisAlgorithmTransformation
-{
-public:
-  CAxisAlgorithmInterpolate(CAxis* axisDestination, CAxis* axisSource, CInterpolateAxis* interpAxis);
-
-  virtual ~CAxisAlgorithmInterpolate() {}
-
-  static bool registerTrans();
-
-  virtual StdString getName() {return "Axis Trans. Filter \\n Interpolation";}
-
-protected:
-  void computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs);
-
-private:
-  void retrieveAllAxisValue(const CArray<double,1>& axisValue, const CArray<bool,1>& axisMask,
-                            std::vector<double>& recvBuff, std::vector<int>& indexVec);
-  void computeInterpolantPoint(const std::vector<double>& recvBuff, const std::vector<int>&, int transPos = 0);
-  void computeWeightedValueAndMapping(const std::map<int, std::vector<std::pair<int,double> > >& interpolatingIndexValues, int transPos = 0);
-  void fillInAxisValue(std::vector<CArray<double,1> >& vecAxisValue,
-                       const std::vector<CArray<double,1>* >& dataAuxInputs);
-
-private:
-  // Interpolation order
-  int order_;
-  StdString coordinate_;
-  std::vector<std::vector<int> > transPosition_;
-
-private:
-  static CGenericAlgorithmTransformation* create(CGrid* gridDst, CGrid* gridSrc,
-                                                CTransformation<CAxis>* transformation,
-                                                int elementPositionInGrid,
-                                                std::map<int, int>& elementPositionInGridSrc2ScalarPosition,
-                                                std::map<int, int>& elementPositionInGridSrc2AxisPosition,
-                                                std::map<int, int>& elementPositionInGridSrc2DomainPosition,
-                                                std::map<int, int>& elementPositionInGridDst2ScalarPosition,
-                                                std::map<int, int>& elementPositionInGridDst2AxisPosition,
-                                                std::map<int, int>& elementPositionInGridDst2DomainPosition);
-};
-
-}
-
-#endif // __XIOS_AXIS_ALGORITHM_INTERPOLATE_HPP__
Index: XIOS/dev/dev_trunk_graph/src/transformation/axis_algorithm_inverse.cpp
===================================================================
--- XIOS/dev/dev_trunk_graph/src/transformation/axis_algorithm_inverse.cpp	(revision 2019)
+++ 	(revision )
@@ -1,294 +1,0 @@
-/*!
-   \file axis_algorithm_inverse.hpp
-   \author Ha NGUYEN
-   \since 14 May 2015
-   \date 29 June 2015
-
-   \brief Algorithm for inversing an axis..
- */
-#include "axis_algorithm_inverse.hpp"
-#include "context.hpp"
-#include "context_client.hpp"
-#include "axis.hpp"
-#include "grid.hpp"
-#include "grid_transformation_factory_impl.hpp"
-#include "inverse_axis.hpp"
-#include "client_client_dht_template.hpp"
-
-namespace xios {
-
-CGenericAlgorithmTransformation* CAxisAlgorithmInverse::create(CGrid* gridDst, CGrid* gridSrc,
-                                                               CTransformation<CAxis>* transformation,
-                                                               int elementPositionInGrid,
-                                                               std::map<int, int>& elementPositionInGridSrc2ScalarPosition,
-                                                               std::map<int, int>& elementPositionInGridSrc2AxisPosition,
-                                                               std::map<int, int>& elementPositionInGridSrc2DomainPosition,
-                                                               std::map<int, int>& elementPositionInGridDst2ScalarPosition,
-                                                               std::map<int, int>& elementPositionInGridDst2AxisPosition,
-                                                               std::map<int, int>& elementPositionInGridDst2DomainPosition)
-TRY
-{
-  std::vector<CAxis*> axisListDestP = gridDst->getAxis();
-  std::vector<CAxis*> axisListSrcP  = gridSrc->getAxis();
-
-  CInverseAxis* inverseAxis = dynamic_cast<CInverseAxis*> (transformation);
-  int axisDstIndex = elementPositionInGridDst2AxisPosition[elementPositionInGrid];
-  int axisSrcIndex = elementPositionInGridSrc2AxisPosition[elementPositionInGrid];
-
-  return (new CAxisAlgorithmInverse(axisListDestP[axisDstIndex], axisListSrcP[axisSrcIndex], inverseAxis));
-}
-CATCH
-
-bool CAxisAlgorithmInverse::registerTrans()
-TRY
-{
-  CGridTransformationFactory<CAxis>::registerTransformation(TRANS_INVERSE_AXIS, create);
-}
-CATCH
-
-CAxisAlgorithmInverse::CAxisAlgorithmInverse(CAxis* axisDestination, CAxis* axisSource, CInverseAxis* inverseAxis)
- : CAxisAlgorithmTransformation(axisDestination, axisSource)
-TRY
-{
-  if (axisDestination->n_glo.getValue() != axisSource->n_glo.getValue())
-  {
-    ERROR("CAxisAlgorithmInverse::CAxisAlgorithmInverse(CAxis* axisDestination, CAxis* axisSource)",
-           << "Two axis have different global size"
-           << "Size of axis source " <<axisSource->getId() << " is " << axisSource->n_glo.getValue()  << std::endl
-           << "Size of axis destination " <<axisDestination->getId() << " is " << axisDestination->n_glo.getValue());
-  }
-}
-CATCH
-
-void CAxisAlgorithmInverse::computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs)
-TRY
-{
-  this->transformationMapping_.resize(1);
-  this->transformationWeight_.resize(1);
-
-  TransformationIndexMap& transMap = this->transformationMapping_[0];
-  TransformationWeightMap& transWeight = this->transformationWeight_[0];
-
-  int globalIndexSize = axisDestGlobalIndex_.size();
-  for (int idx = 0; idx < globalIndexSize; ++idx)
-  {
-    transMap[axisDestGlobalIndex_[idx]].push_back(axisDestGlobalSize_-axisDestGlobalIndex_[idx]-1);
-    transWeight[axisDestGlobalIndex_[idx]].push_back(1.0);
-  }
-
-  int niSrc   = axisSrc_->n.getValue();
-  int sizeSrc = axisSrc_->n_glo.getValue();
-  if (niSrc != sizeSrc) updateAxisValue();
-  else
-  {
-    for (int idx = 0; idx < sizeSrc; ++idx)
-    {
-      axisDest_->value(idx) = axisSrc_->value(sizeSrc-idx-1);
-    }
-  }
-}
-CATCH
-
-/*!
-  Update value on axis after inversing
-  After an axis is inversed, not only the data on it must be inversed but also the value
-*/
-void CAxisAlgorithmInverse::updateAxisValue()
-TRY
-{
-  CContext* context = CContext::getCurrent();
-  CContextClient* client=context->client;
-  int clientRank = client->clientRank;
-  int nbClient = client->clientSize;
-
-  int niSrc     = axisSrc_->n.getValue();
-  int ibeginSrc = axisSrc_->begin.getValue();
-  int nSrc = axisSrc_->index.numElements();
-
-  CClientClientDHTInt::Index2VectorInfoTypeMap globalIndex2ProcRank;
-  for (int idx = 0; idx < nSrc; ++idx)
-  {
-    if ((axisSrc_->mask)(idx))
-    {
-      globalIndex2ProcRank[(axisSrc_->index)(idx)].resize(1);
-      globalIndex2ProcRank[(axisSrc_->index)(idx)][0] = clientRank;
-    }
-  }
-
-  typedef std::unordered_map<size_t, std::vector<double> > GlobalIndexMapFromSrcToDest;
-  GlobalIndexMapFromSrcToDest globalIndexMapFromSrcToDest;
-  TransformationIndexMap& transMap = this->transformationMapping_[0];
-  TransformationIndexMap::const_iterator itb = transMap.begin(), ite = transMap.end(), it;
-  CArray<size_t,1> globalSrcIndex(transMap.size());
-  int localIndex = 0;
-  for (it = itb; it != ite; ++it)
-  {
-    size_t srcIndex = it->second[0];
-    globalIndexMapFromSrcToDest[srcIndex].resize(1);
-    globalIndexMapFromSrcToDest[srcIndex][0] = it->first;
-    globalSrcIndex(localIndex) = srcIndex;
-    ++localIndex;
-  }
-
-  CClientClientDHTInt dhtIndexProcRank(globalIndex2ProcRank, client->intraComm);
-  dhtIndexProcRank.computeIndexInfoMapping(globalSrcIndex);
-  CClientClientDHTInt::Index2VectorInfoTypeMap& computedGlobalIndexOnProc = dhtIndexProcRank.getInfoIndexMap();
-  std::unordered_map<int, std::vector<size_t> > globalSrcIndexSendToProc;
-  for (int idx = 0; idx < localIndex; ++idx)
-  {
-    size_t tmpIndex = globalSrcIndex(idx);
-    if (1 == computedGlobalIndexOnProc.count(tmpIndex))
-    {
-      std::vector<int>& tmpVec = computedGlobalIndexOnProc[tmpIndex];
-      globalSrcIndexSendToProc[tmpVec[0]].push_back(tmpIndex);
-    }
-  }
-
-  std::unordered_map<int, std::vector<size_t> >::const_iterator itbIndex = globalSrcIndexSendToProc.begin(), itIndex,
-                                                                  iteIndex = globalSrcIndexSendToProc.end();
-  std::map<int,int> sendRankSizeMap,recvRankSizeMap;
-  int connectedClient = globalSrcIndexSendToProc.size();
-  int* recvCount=new int[nbClient];
-  int* displ=new int[nbClient];
-  int* sendRankBuff=new int[connectedClient];
-  int* sendSizeBuff=new int[connectedClient];
-  int n = 0;
-  for (itIndex = itbIndex; itIndex != iteIndex; ++itIndex, ++n)
-  {
-    sendRankBuff[n] = itIndex->first;
-    int sendSize = itIndex->second.size();
-    sendSizeBuff[n] = sendSize;
-    sendRankSizeMap[itIndex->first] = sendSize;
-  }
-  MPI_Allgather(&connectedClient,1,MPI_INT,recvCount,1,MPI_INT,client->intraComm);
-
-  displ[0]=0 ;
-  for(int n=1;n<nbClient;n++) displ[n]=displ[n-1]+recvCount[n-1];
-  int recvSize=displ[nbClient-1]+recvCount[nbClient-1];
-  int* recvRankBuff=new int[recvSize];
-  int* recvSizeBuff=new int[recvSize];
-  MPI_Allgatherv(sendRankBuff,connectedClient,MPI_INT,recvRankBuff,recvCount,displ,MPI_INT,client->intraComm);
-  MPI_Allgatherv(sendSizeBuff,connectedClient,MPI_INT,recvSizeBuff,recvCount,displ,MPI_INT,client->intraComm);
-  for (int i = 0; i < nbClient; ++i)
-  {
-    int currentPos = displ[i];
-    for (int j = 0; j < recvCount[i]; ++j)
-      if (recvRankBuff[currentPos+j] == clientRank)
-      {
-        recvRankSizeMap[i] = recvSizeBuff[currentPos+j];
-      }
-  }
-
-  // Sending global index of grid source to corresponding process as well as the corresponding mask
-  std::vector<MPI_Request> requests;
-  std::vector<MPI_Status> status;
-  std::unordered_map<int, unsigned long* > recvGlobalIndexSrc;
-  std::unordered_map<int, double* > sendValueToDest;
-  for (std::map<int,int>::const_iterator itRecv = recvRankSizeMap.begin(); itRecv != recvRankSizeMap.end(); ++itRecv)
-  {
-    int recvRank = itRecv->first;
-    int recvSize = itRecv->second;
-    recvGlobalIndexSrc[recvRank] = new unsigned long [recvSize];
-    sendValueToDest[recvRank] = new double [recvSize];
-
-    requests.push_back(MPI_Request());
-    MPI_Irecv(recvGlobalIndexSrc[recvRank], recvSize, MPI_UNSIGNED_LONG, recvRank, 46, client->intraComm, &requests.back());
-  }
-
-  std::unordered_map<int, unsigned long* > sendGlobalIndexSrc;
-  std::unordered_map<int, double* > recvValueFromSrc;
-  for (itIndex = itbIndex; itIndex != iteIndex; ++itIndex)
-  {
-    int sendRank = itIndex->first;
-    int sendSize = sendRankSizeMap[sendRank];
-    const std::vector<size_t>& sendIndexMap = itIndex->second;
-    std::vector<size_t>::const_iterator itbSend = sendIndexMap.begin(), iteSend = sendIndexMap.end(), itSend;
-    sendGlobalIndexSrc[sendRank] = new unsigned long [sendSize];
-    recvValueFromSrc[sendRank] = new double [sendSize];
-    int countIndex = 0;
-    for (itSend = itbSend; itSend != iteSend; ++itSend)
-    {
-      sendGlobalIndexSrc[sendRank][countIndex] = *itSend;
-      ++countIndex;
-    }
-
-    // Send global index source and mask
-    requests.push_back(MPI_Request());
-    MPI_Isend(sendGlobalIndexSrc[sendRank], sendSize, MPI_UNSIGNED_LONG, sendRank, 46, client->intraComm, &requests.back());
-  }
-
-  status.resize(requests.size());
-  MPI_Waitall(requests.size(), &requests[0], &status[0]);
-
-
-  std::vector<MPI_Request>().swap(requests);
-  std::vector<MPI_Status>().swap(status);
-
-  // Okie, on destination side, we will wait for information of masked index of source
-  for (std::map<int,int>::const_iterator itSend = sendRankSizeMap.begin(); itSend != sendRankSizeMap.end(); ++itSend)
-  {
-    int recvRank = itSend->first;
-    int recvSize = itSend->second;
-
-    requests.push_back(MPI_Request());
-    MPI_Irecv(recvValueFromSrc[recvRank], recvSize, MPI_DOUBLE, recvRank, 48, client->intraComm, &requests.back());
-  }
-
-  for (std::map<int,int>::const_iterator itRecv = recvRankSizeMap.begin(); itRecv != recvRankSizeMap.end(); ++itRecv)
-  {
-    int recvRank = itRecv->first;
-    int recvSize = itRecv->second;
-    double* sendValue = sendValueToDest[recvRank];
-    unsigned long* recvIndexSrc = recvGlobalIndexSrc[recvRank];
-    int realSendSize = 0;
-    for (int idx = 0; idx < recvSize; ++idx)
-    {
-      size_t globalIndex = *(recvIndexSrc+idx);
-      int localIndex = globalIndex - ibeginSrc;
-      *(sendValue + idx) = axisSrc_->value(localIndex);
-    }
-    // Okie, now inform the destination which source index are masked
-    requests.push_back(MPI_Request());
-    MPI_Isend(sendValueToDest[recvRank], recvSize, MPI_DOUBLE, recvRank, 48, client->intraComm, &requests.back());
-  }
-  status.resize(requests.size());
-  MPI_Waitall(requests.size(), &requests[0], &status[0]);
-
-
-  size_t nGloAxisDest = axisDest_->n_glo.getValue() - 1;
-  for (std::map<int,int>::const_iterator itSend = sendRankSizeMap.begin(); itSend != sendRankSizeMap.end(); ++itSend)
-  {
-    int recvRank = itSend->first;
-    int recvSize = itSend->second;
-
-    double* recvValue = recvValueFromSrc[recvRank];
-    unsigned long* recvIndex = sendGlobalIndexSrc[recvRank];
-    for (int idx = 0; idx < recvSize; ++idx)
-    {
-      size_t globalIndex = *(recvIndex+idx);
-      int localIndex = ((nGloAxisDest-globalIndex) - axisDest_->begin);
-      axisDest_->value(localIndex) = *(recvValue + idx);
-    }
-  }
-
-  delete [] recvCount;
-  delete [] displ;
-  delete [] sendRankBuff;
-  delete [] recvRankBuff;
-  delete [] sendSizeBuff;
-  delete [] recvSizeBuff;
-
-  std::unordered_map<int, double* >::const_iterator itChar;
-  for (itChar = sendValueToDest.begin(); itChar != sendValueToDest.end(); ++itChar)
-    delete [] itChar->second;
-  for (itChar = recvValueFromSrc.begin(); itChar != recvValueFromSrc.end(); ++itChar)
-    delete [] itChar->second;
-  std::unordered_map<int, unsigned long* >::const_iterator itLong;
-  for (itLong = sendGlobalIndexSrc.begin(); itLong != sendGlobalIndexSrc.end(); ++itLong)
-    delete [] itLong->second;
-  for (itLong = recvGlobalIndexSrc.begin(); itLong != recvGlobalIndexSrc.end(); ++itLong)
-    delete [] itLong->second;
-}
-CATCH
-
-}
Index: XIOS/dev/dev_trunk_graph/src/transformation/axis_algorithm_inverse.hpp
===================================================================
--- XIOS/dev/dev_trunk_graph/src/transformation/axis_algorithm_inverse.hpp	(revision 2019)
+++ 	(revision )
@@ -1,54 +1,0 @@
-/*!
-   \file axis_algorithm_inverse.hpp
-   \author Ha NGUYEN
-   \since 14 May 2015
-   \date 09 June 2015
-
-   \brief Algorithm for inversing an axis..
- */
-#ifndef __XIOS_AXIS_ALGORITHM_INVERSE_HPP__
-#define __XIOS_AXIS_ALGORITHM_INVERSE_HPP__
-
-#include "axis_algorithm_transformation.hpp"
-#include "transformation.hpp"
-
-namespace xios {
-
-class CAxis;
-class CInverseAxis;
-
-/*!
-  \class CAxisAlgorithmInverse
-  Inversing an axis
-*/
-class CAxisAlgorithmInverse : public CAxisAlgorithmTransformation
-{
-public:
-  CAxisAlgorithmInverse(CAxis* axisDestination, CAxis* axisSource, CInverseAxis* inverseAxis);
-
-  virtual ~CAxisAlgorithmInverse() {}
-
-  static bool registerTrans();
-
-  virtual StdString getName() {return "Axis Trans. Filter \\n Inverse";}
-
-protected:
-  void computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs);
-
-private:
-  void updateAxisValue();
-
-private:
-  static CGenericAlgorithmTransformation* create(CGrid* gridDst, CGrid* gridSrc,
-                                                CTransformation<CAxis>* transformation,
-                                                int elementPositionInGrid,
-                                                std::map<int, int>& elementPositionInGridSrc2ScalarPosition,
-                                                std::map<int, int>& elementPositionInGridSrc2AxisPosition,
-                                                std::map<int, int>& elementPositionInGridSrc2DomainPosition,
-                                                std::map<int, int>& elementPositionInGridDst2ScalarPosition,
-                                                std::map<int, int>& elementPositionInGridDst2AxisPosition,
-                                                std::map<int, int>& elementPositionInGridDst2DomainPosition);
-};
-
-}
-#endif // __XIOS_AXIS_ALGORITHM_INVERSE_HPP__
Index: XIOS/dev/dev_trunk_graph/src/transformation/axis_algorithm_reduce_axis.cpp
===================================================================
--- XIOS/dev/dev_trunk_graph/src/transformation/axis_algorithm_reduce_axis.cpp	(revision 2019)
+++ 	(revision )
@@ -1,126 +1,0 @@
-/*!
-   \file axis_algorithm_reduce_axis.cpp
-   \author Ha NGUYEN
-   \since 23 June 2016
-   \date 23 June 2016
-
-   \brief Algorithm for reduce a axis to an axis
- */
-#include "axis_algorithm_reduce_axis.hpp"
-#include "reduce_axis_to_axis.hpp"
-#include "axis.hpp"
-#include "grid.hpp"
-#include "grid_transformation_factory_impl.hpp"
-#include "reduction.hpp"
-
-namespace xios {
-CGenericAlgorithmTransformation* CAxisAlgorithmReduceAxis::create(CGrid* gridDst, CGrid* gridSrc,
-                                                                   CTransformation<CAxis>* transformation,
-                                                                   int elementPositionInGrid,
-                                                                   std::map<int, int>& elementPositionInGridSrc2ScalarPosition,
-                                                                   std::map<int, int>& elementPositionInGridSrc2AxisPosition,
-                                                                   std::map<int, int>& elementPositionInGridSrc2DomainPosition,
-                                                                   std::map<int, int>& elementPositionInGridDst2ScalarPosition,
-                                                                   std::map<int, int>& elementPositionInGridDst2AxisPosition,
-                                                                   std::map<int, int>& elementPositionInGridDst2DomainPosition)
-TRY
-{
-  std::vector<CAxis*> axisListDestP = gridDst->getAxis();
-  std::vector<CAxis*> axisListSrcP  = gridSrc->getAxis();
-
-  CReduceAxisToAxis* reduceAxis = dynamic_cast<CReduceAxisToAxis*> (transformation);
-  int axisDstIndex   = elementPositionInGridDst2AxisPosition[elementPositionInGrid];
-  int axisSrcIndex = elementPositionInGridSrc2AxisPosition[elementPositionInGrid];
-
-  return (new CAxisAlgorithmReduceAxis(axisListDestP[axisDstIndex], axisListSrcP[axisSrcIndex], reduceAxis));
-}
-CATCH
-
-bool CAxisAlgorithmReduceAxis::registerTrans()
-TRY
-{
-  CGridTransformationFactory<CAxis>::registerTransformation(TRANS_REDUCE_AXIS_TO_AXIS, create);
-}
-CATCH
-
-
-CAxisAlgorithmReduceAxis::CAxisAlgorithmReduceAxis(CAxis* axisDestination, CAxis* axisSource, CReduceAxisToAxis* algo)
- : CAxisAlgorithmTransformation(axisDestination, axisSource), reduction_(0)
-TRY
-{
-  eliminateRedondantSrc_= false ;
-  algo->checkValid(axisDestination, axisSource);
-  StdString op;
-  switch (algo->operation)
-  {
-    case CReduceAxisToAxis::operation_attr::sum:
-      op = "sum";
-      break;
-    case CReduceAxisToAxis::operation_attr::min:
-      op = "min";
-      break;
-    case CReduceAxisToAxis::operation_attr::max:
-      op = "max";
-      break;
-    case CReduceAxisToAxis::operation_attr::average:
-      op = "average";
-      break;
-    default:
-        ERROR("CAxisAlgorithmReduceAxis::CAxisAlgorithmReduceAxis(CAxis* axisDestination, CAxis* axisSource, CReduceAxisToAxis* algo)",
-         << "Operation is wrongly defined. Supported operations: sum, min, max, average." << std::endl
-         << "Axis source " <<axisSource->getId() << std::endl
-         << "Axis destination " << axisDestination->getId());
-
-  }
-
-  reduction_ = CReductionAlgorithm::createOperation(CReductionAlgorithm::ReductionOperations[op]);
-}
-CATCH
-
-void CAxisAlgorithmReduceAxis::apply(const std::vector<std::pair<int,double> >& localIndex,
-                                       const double* dataInput,
-                                       CArray<double,1>& dataOut,
-                                       std::vector<bool>& flagInitial,                     
-                                       bool ignoreMissingValue, bool firstPass)
-TRY
-{
-  reduction_->apply(localIndex, dataInput, dataOut, flagInitial, ignoreMissingValue, firstPass);
-}
-CATCH
-
-void CAxisAlgorithmReduceAxis::updateData(CArray<double,1>& dataOut)
-TRY
-{
-  reduction_->updateData(dataOut);
-}
-CATCH
-
-CAxisAlgorithmReduceAxis::~CAxisAlgorithmReduceAxis()
-TRY
-{
-  if (0 != reduction_) delete reduction_;
-}
-CATCH
-
-void CAxisAlgorithmReduceAxis::computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs)
-TRY
-{
-  this->transformationMapping_.resize(1);
-  this->transformationWeight_.resize(1);
-
-  TransformationIndexMap& transMap = this->transformationMapping_[0];
-  TransformationWeightMap& transWeight = this->transformationWeight_[0];
-  CArray<int,1>& axisDstIndex = axisDest_->index;
-  int nbAxisIdx = axisDstIndex.numElements();
-  for (int idxAxis = 0; idxAxis < nbAxisIdx; ++idxAxis)
-  {
-    int globalAxisIdx = axisDstIndex(idxAxis);
-    transMap[globalAxisIdx].resize(1);
-    transWeight[globalAxisIdx].resize(1);
-    transMap[globalAxisIdx][0]=globalAxisIdx ;      
-    transWeight[globalAxisIdx][0] = 1.0 ;      
-  }
-}
-CATCH
-
-}
Index: XIOS/dev/dev_trunk_graph/src/transformation/axis_algorithm_reduce_axis.hpp
===================================================================
--- XIOS/dev/dev_trunk_graph/src/transformation/axis_algorithm_reduce_axis.hpp	(revision 2019)
+++ 	(revision )
@@ -1,64 +1,0 @@
-/*!
-   \file axis_algorithm_reduce_axis.hpp
-   \author Ha NGUYEN
-   \since 23 June 2016
-   \date 23 June 2016
-
-   \brief Algorithm for reduce an axis to a axis
- */
-#ifndef __XIOS_AXIS_ALGORITHM_REDUCE_AXIS_HPP__
-#define __XIOS_AXIS_ALGORITHM_REDUCE_AXIS_HPP__
-
-#include "axis_algorithm_transformation.hpp"
-#include "transformation.hpp"
-
-namespace xios {
-
-class CAxis;
-class CReduceAxisToAxis;
-class CReductionAlgorithm;
-
-/*!
-  \class CAxisAlgorithmReduceAxis
-  Reduce a axis to an axis
-*/
-class CAxisAlgorithmReduceAxis : public CAxisAlgorithmTransformation
-{
-public:
-  CAxisAlgorithmReduceAxis(CAxis* axisDestination, CAxis* axisSource, CReduceAxisToAxis* algo);
-
-  virtual void apply(const std::vector<std::pair<int,double> >& localIndex,
-                     const double* dataInput,
-                     CArray<double,1>& dataOut,
-                     std::vector<bool>& flagInitial,                     
-                     bool ignoreMissingValue, bool firstPass);
-
-  virtual void updateData(CArray<double,1>& dataOut);
-  
-  virtual ~CAxisAlgorithmReduceAxis();
-
-  static bool registerTrans();
-
-  virtual StdString getName() {return "Axis Trans. Filter \\n Reduce Axis";}
-protected:
-  
-protected:
-  void computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs); 
-  
-protected:
-  CReductionAlgorithm* reduction_;
-
-private:
-  static CGenericAlgorithmTransformation* create(CGrid* gridDst, CGrid* gridSrc,
-                                                CTransformation<CAxis>* transformation,
-                                                int elementPositionInGrid,
-                                                std::map<int, int>& elementPositionInGridSrc2ScalarPosition,
-                                                std::map<int, int>& elementPositionInGridSrc2AxisPosition,
-                                                std::map<int, int>& elementPositionInGridSrc2DomainPosition,
-                                                std::map<int, int>& elementPositionInGridDst2ScalarPosition,
-                                                std::map<int, int>& elementPositionInGridDst2AxisPosition,
-                                                std::map<int, int>& elementPositionInGridDst2DomainPosition);
-};
-
-}
-#endif // __XIOS_AXIS_ALGORITHM_REDUCE_AXIS_HPP__
Index: XIOS/dev/dev_trunk_graph/src/transformation/axis_algorithm_reduce_domain.cpp
===================================================================
--- XIOS/dev/dev_trunk_graph/src/transformation/axis_algorithm_reduce_domain.cpp	(revision 2019)
+++ 	(revision )
@@ -1,191 +1,0 @@
-/*!
-   \file axis_algorithm_reduce_domain.cpp
-   \author Ha NGUYEN
-   \since 23 June 2016
-   \date 23 June 2016
-
-   \brief Algorithm for reduce a domain to an axis
- */
-#include "axis_algorithm_reduce_domain.hpp"
-#include "reduce_domain_to_axis.hpp"
-#include "axis.hpp"
-#include "domain.hpp"
-#include "grid.hpp"
-#include "grid_transformation_factory_impl.hpp"
-#include "reduction.hpp"
-
-namespace xios {
-CGenericAlgorithmTransformation* CAxisAlgorithmReduceDomain::create(CGrid* gridDst, CGrid* gridSrc,
-                                                                   CTransformation<CAxis>* transformation,
-                                                                   int elementPositionInGrid,
-                                                                   std::map<int, int>& elementPositionInGridSrc2ScalarPosition,
-                                                                   std::map<int, int>& elementPositionInGridSrc2AxisPosition,
-                                                                   std::map<int, int>& elementPositionInGridSrc2DomainPosition,
-                                                                   std::map<int, int>& elementPositionInGridDst2ScalarPosition,
-                                                                   std::map<int, int>& elementPositionInGridDst2AxisPosition,
-                                                                   std::map<int, int>& elementPositionInGridDst2DomainPosition)
-TRY
-{
-  std::vector<CAxis*> axisListDestP = gridDst->getAxis();
-  std::vector<CDomain*> domainListSrcP = gridSrc->getDomains();
-
-  CReduceDomainToAxis* reduceDomain = dynamic_cast<CReduceDomainToAxis*> (transformation);
-  int axisDstIndex   = elementPositionInGridDst2AxisPosition[elementPositionInGrid];
-  int domainSrcIndex = elementPositionInGridSrc2DomainPosition[elementPositionInGrid];
-
-  return (new CAxisAlgorithmReduceDomain(axisListDestP[axisDstIndex], domainListSrcP[domainSrcIndex], reduceDomain));
-}
-CATCH
-
-bool CAxisAlgorithmReduceDomain::registerTrans()
-TRY
-{
-  CGridTransformationFactory<CAxis>::registerTransformation(TRANS_REDUCE_DOMAIN_TO_AXIS, create);
-}
-CATCH
-
-
-CAxisAlgorithmReduceDomain::CAxisAlgorithmReduceDomain(CAxis* axisDestination, CDomain* domainSource, CReduceDomainToAxis* algo)
- : CAxisAlgorithmTransformation(axisDestination, domainSource), reduction_(0)
-TRY
-{
-  algo->checkValid(axisDestination, domainSource);
-  StdString op;
-  switch (algo->operation)
-  {
-    case CReduceDomainToAxis::operation_attr::sum:
-      op = "sum";
-      break;
-    case CReduceDomainToAxis::operation_attr::min:
-      op = "min";
-      break;
-    case CReduceDomainToAxis::operation_attr::max:
-      op = "max";
-      break;
-    case CReduceDomainToAxis::operation_attr::average:
-      op = "average";
-      break;
-    default:
-        ERROR("CAxisAlgorithmReduceDomain::CAxisAlgorithmReduceDomain(CAxis* axisDestination, CDomain* domainSource, CReduceDomainToAxis* algo)",
-         << "Operation is wrongly defined. Supported operations: sum, min, max, average." << std::endl
-         << "Domain source " <<domainSource->getId() << std::endl
-         << "Axis destination " << axisDestination->getId());
-
-  }
-
-  dir_ = (CReduceDomainToAxis::direction_attr::iDir == algo->direction)  ? iDir : jDir;
-  reduction_ = CReductionAlgorithm::createOperation(CReductionAlgorithm::ReductionOperations[op]);
-  local = algo->local ;
-}
-CATCH
-
-void CAxisAlgorithmReduceDomain::apply(const std::vector<std::pair<int,double> >& localIndex,
-                                       const double* dataInput,
-                                       CArray<double,1>& dataOut,
-                                       std::vector<bool>& flagInitial,                     
-                                       bool ignoreMissingValue, bool firstPass)
-TRY
-{
-  reduction_->apply(localIndex, dataInput, dataOut, flagInitial, ignoreMissingValue, firstPass);
-}
-CATCH
-
-void CAxisAlgorithmReduceDomain::updateData(CArray<double,1>& dataOut)
-TRY
-{
-  reduction_->updateData(dataOut);
-}
-CATCH
-
-CAxisAlgorithmReduceDomain::~CAxisAlgorithmReduceDomain()
-TRY
-{
-  if (0 != reduction_) delete reduction_;
-}
-CATCH
-
-void CAxisAlgorithmReduceDomain::computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs)
-TRY
-{
-  this->transformationMapping_.resize(1);
-  this->transformationWeight_.resize(1);
-
-  TransformationIndexMap& transMap = this->transformationMapping_[0];
-  TransformationWeightMap& transWeight = this->transformationWeight_[0];
-
-  CArray<int,1>& axisDstIndex = axisDest_->index;
-  int ni_glo = domainSrc_->ni_glo, nj_glo = domainSrc_->nj_glo;
-  if (iDir == dir_)
-  {
-    if (local)
-    {
-      const CArray<int, 1>& i_index = domainSrc_-> i_index.getValue() ;
-      const CArray<int, 1>& j_index = domainSrc_-> j_index.getValue() ;
-      const CArray<bool,1>& localMask = domainSrc_-> localMask ;
-      int nbDomainIdx = i_index.numElements();
-      
-      for (int idxDomain = 0; idxDomain < nbDomainIdx; ++idxDomain)
-      {
-        if (localMask(idxDomain))
-        { 
-          transMap[j_index(idxDomain)].push_back(j_index(idxDomain)* ni_glo + i_index(idxDomain));
-          transWeight[j_index(idxDomain)].push_back(1.0) ;
-        }
-      }
-    }
-    else
-    {
-      int nbAxisIdx = axisDstIndex.numElements();
-      for (int idxAxis = 0; idxAxis < nbAxisIdx; ++idxAxis)
-      {
-        int globalAxisIdx = axisDstIndex(idxAxis);
-        transMap[globalAxisIdx].resize(ni_glo);
-        transWeight[globalAxisIdx].resize(ni_glo);
-        for (int idx = 0; idx < ni_glo; ++idx)
-        {
-          transMap[globalAxisIdx][idx] = globalAxisIdx * ni_glo + idx;
-          transWeight[globalAxisIdx][idx] = 1.0;
-        }
-      }
-    }
-  }
-  else if (jDir == dir_)
-  {
-    int nbAxisIdx = axisDstIndex.numElements();
-    if (local)
-    {
-      const CArray<int, 1>& i_index = domainSrc_-> i_index.getValue() ;
-      const CArray<int, 1>& j_index = domainSrc_-> j_index.getValue() ;
-      const CArray<bool,1>& localMask = domainSrc_-> localMask ;
-      int nbDomainIdx = i_index.numElements();
-      
-      for (int idxDomain = 0; idxDomain < nbDomainIdx; ++idxDomain)
-      {
-        if (localMask(idxDomain))
-        { 
-          transMap[i_index(idxDomain)].push_back(j_index(idxDomain)* ni_glo + i_index(idxDomain));
-          transWeight[i_index(idxDomain)].push_back(1.0) ;
-        }
-      }
-    }
-    else
-    {
-      for (int idxAxis = 0; idxAxis < nbAxisIdx; ++idxAxis)
-      {
-        int globalAxisIdx = axisDstIndex(idxAxis);
-        transMap[globalAxisIdx].resize(nj_glo);
-        transWeight[globalAxisIdx].resize(nj_glo);
-        for (int idx = 0; idx < nj_glo; ++idx)
-        {
-          transMap[globalAxisIdx][idx] = globalAxisIdx + ni_glo*idx;
-          transWeight[globalAxisIdx][idx] = 1.0;
-        }
-      }
-    }
-  }
-  else
-  {}
-}
-CATCH
-
-}
Index: XIOS/dev/dev_trunk_graph/src/transformation/axis_algorithm_reduce_domain.hpp
===================================================================
--- XIOS/dev/dev_trunk_graph/src/transformation/axis_algorithm_reduce_domain.hpp	(revision 2019)
+++ 	(revision )
@@ -1,74 +1,0 @@
-/*!
-   \file axis_algorithm_reduce_domain.hpp
-   \author Ha NGUYEN
-   \since 23 June 2016
-   \date 23 June 2016
-
-   \brief Algorithm for reduce an axis to a axis
- */
-#ifndef __XIOS_AXIS_ALGORITHM_REDUCE_DOMAIN_HPP__
-#define __XIOS_AXIS_ALGORITHM_REDUCE_DOMAIN_HPP__
-
-#include "axis_algorithm_transformation.hpp"
-#include "transformation.hpp"
-
-namespace xios {
-
-class CAxis;
-class CDomain;
-class CReduceDomainToAxis;
-class CReductionAlgorithm;
-
-/*!
-  \class CAxisAlgorithmReduceDomain
-  Reduce a domain to an axis
-*/
-class CAxisAlgorithmReduceDomain : public CAxisAlgorithmTransformation
-{
-public:
-  CAxisAlgorithmReduceDomain(CAxis* axisDestination, CDomain* domainSource, CReduceDomainToAxis* algo);
-
-  virtual void apply(const std::vector<std::pair<int,double> >& localIndex,
-                     const double* dataInput,
-                     CArray<double,1>& dataOut,
-                     std::vector<bool>& flagInitial,                     
-                     bool ignoreMissingValue, bool firstPass);
-
-  virtual void updateData(CArray<double,1>& dataOut);
-  
-  virtual ~CAxisAlgorithmReduceDomain();
-
-  static bool registerTrans();
-
-  virtual StdString getName() {return "Axis Trans. Filter \\n Reduce Domain";}
-
-protected:
-  enum ReduceDirection {
-    undefined = 0,
-    iDir = 1,
-    jDir = 2
-  };
-  
-  ReduceDirection dir_;
-  bool local ;
-  
-protected:
-  void computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs); 
-  
-protected:
-  CReductionAlgorithm* reduction_;
-
-private:
-  static CGenericAlgorithmTransformation* create(CGrid* gridDst, CGrid* gridSrc,
-                                                CTransformation<CAxis>* transformation,
-                                                int elementPositionInGrid,
-                                                std::map<int, int>& elementPositionInGridSrc2ScalarPosition,
-                                                std::map<int, int>& elementPositionInGridSrc2AxisPosition,
-                                                std::map<int, int>& elementPositionInGridSrc2DomainPosition,
-                                                std::map<int, int>& elementPositionInGridDst2ScalarPosition,
-                                                std::map<int, int>& elementPositionInGridDst2AxisPosition,
-                                                std::map<int, int>& elementPositionInGridDst2DomainPosition);
-};
-
-}
-#endif // __XIOS_AXIS_ALGORITHM_REDUCE_DOMAIN_HPP__
Index: XIOS/dev/dev_trunk_graph/src/transformation/axis_algorithm_temporal_splitting.cpp
===================================================================
--- XIOS/dev/dev_trunk_graph/src/transformation/axis_algorithm_temporal_splitting.cpp	(revision 2019)
+++ 	(revision )
@@ -1,80 +1,0 @@
-/*!
-   \file axis_algorithm_temporal_splitting.cpp
-
-   \brief Algorithm to split scalar into  axis by temporal accumulation
- */
-#include "axis_algorithm_temporal_splitting.hpp"
-#include "temporal_splitting.hpp"
-#include "axis.hpp"
-#include "scalar.hpp"
-#include "grid.hpp"
-#include "grid_transformation_factory_impl.hpp"
-
-namespace xios {
-CGenericAlgorithmTransformation* CAxisAlgorithmTemporalSplitting::create(CGrid* gridDst, CGrid* gridSrc,
-                                                                     CTransformation<CAxis>* transformation,
-                                                                     int elementPositionInGrid,
-                                                                     std::map<int, int>& elementPositionInGridSrc2ScalarPosition,
-                                                                     std::map<int, int>& elementPositionInGridSrc2AxisPosition,
-                                                                     std::map<int, int>& elementPositionInGridSrc2DomainPosition,
-                                                                     std::map<int, int>& elementPositionInGridDst2ScalarPosition,
-                                                                     std::map<int, int>& elementPositionInGridDst2AxisPosition,
-                                                                     std::map<int, int>& elementPositionInGridDst2DomainPosition)
-TRY
-{
-  std::vector<CAxis*> axisListDestP = gridDst->getAxis();
-  std::vector<CScalar*> scalarListSrcP = gridSrc->getScalars();
-
-  CTemporalSplitting* temporalSplitting = dynamic_cast<CTemporalSplitting*> (transformation);
-  int axisDstIndex = elementPositionInGridDst2AxisPosition[elementPositionInGrid];
-  int scalarSrcIndex = elementPositionInGridSrc2ScalarPosition[elementPositionInGrid];
-
-  return (new CAxisAlgorithmTemporalSplitting(axisListDestP[axisDstIndex], scalarListSrcP[scalarSrcIndex], temporalSplitting));
-}
-CATCH
-
-bool CAxisAlgorithmTemporalSplitting::registerTrans()
-TRY
-{
-  CGridTransformationFactory<CAxis>::registerTransformation(TRANS_TEMPORAL_SPLITTING, create);
-}
-CATCH
-
-CAxisAlgorithmTemporalSplitting::CAxisAlgorithmTemporalSplitting(CAxis* axisDestination, CScalar* scalarSource, CTemporalSplitting* algo)
- : CAxisAlgorithmTransformation(axisDestination, scalarSource)
-{
-
-}
-
-
-CAxisAlgorithmTemporalSplitting::~CAxisAlgorithmTemporalSplitting()
-{
-}
-
-void CAxisAlgorithmTemporalSplitting::computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs)
-TRY
-{
-  this->transformationMapping_.resize(1);
-  this->transformationWeight_.resize(1);
-
-  TransformationIndexMap& transMap = this->transformationMapping_[0];
-  TransformationWeightMap& transWeight = this->transformationWeight_[0];
-
-  CArray<int,1>& axisDstIndex = axisDest_->index;
-
-  int nbAxisIdx = axisDstIndex.numElements();
-  for (int idxAxis = 0; idxAxis < nbAxisIdx; ++idxAxis)
-  {
-    int globalAxisIdx = axisDstIndex(idxAxis);
-    if (idxAxis==0)
-    {
-      transMap[globalAxisIdx].resize(1);
-      transWeight[globalAxisIdx].resize(1);
-      transMap[globalAxisIdx][0] = 0 ;
-      transWeight[globalAxisIdx][0] = 1.0 ;
-    }
-  }
-}
-CATCH
-
-}
Index: XIOS/dev/dev_trunk_graph/src/transformation/axis_algorithm_temporal_splitting.hpp
===================================================================
--- XIOS/dev/dev_trunk_graph/src/transformation/axis_algorithm_temporal_splitting.hpp	(revision 2019)
+++ 	(revision )
@@ -1,54 +1,0 @@
-/*!
-   \file axis_algorithm_reduce_domain.hpp
-   \author Ha NGUYEN
-   \since 23 June 2016
-   \date 23 June 2016
-
-   \brief Algorithm for reduce an axis to a axis
- */
-#ifndef __XIOS_AXIS_ALGORITHM_TEMPORAL_SPLITTING_HPP__
-#define __XIOS_AXIS_ALGORITHM_TEMPORAL_SPLITTING_HPP__
-
-#include "axis_algorithm_transformation.hpp"
-#include "transformation.hpp"
-
-namespace xios {
-
-class CAxis;
-class CScalar;
-class CTemporalSplitting;
-
-
-
-/*!
-  \class CAxisAlgorithmExtractDomain
-  Extract a domain to an axis
-*/
-class CAxisAlgorithmTemporalSplitting : public CAxisAlgorithmTransformation
-{
-public:
-  CAxisAlgorithmTemporalSplitting(CAxis* axisDestination, CScalar* scalarSource, CTemporalSplitting* algo);
-
-  virtual ~CAxisAlgorithmTemporalSplitting();
-
-  static bool registerTrans();
-
-  virtual StdString getName() {return "Axis Trans. Filter \\n Temporal Splitting";}
-
-protected:
-  void computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs);
-
-private:
-  static CGenericAlgorithmTransformation* create(CGrid* gridDst, CGrid* gridSrc,
-                                                CTransformation<CAxis>* transformation,
-                                                int elementPositionInGrid,
-                                                std::map<int, int>& elementPositionInGridSrc2ScalarPosition,
-                                                std::map<int, int>& elementPositionInGridSrc2AxisPosition,
-                                                std::map<int, int>& elementPositionInGridSrc2DomainPosition,
-                                                std::map<int, int>& elementPositionInGridDst2ScalarPosition,
-                                                std::map<int, int>& elementPositionInGridDst2AxisPosition,
-                                                std::map<int, int>& elementPositionInGridDst2DomainPosition);
-};
-
-}
-#endif // __XIOS_AXIS_ALGORITHM_TEMPORAL_SPLITTING_HPP__
Index: XIOS/dev/dev_trunk_graph/src/transformation/axis_algorithm_transformation.cpp
===================================================================
--- XIOS/dev/dev_trunk_graph/src/transformation/axis_algorithm_transformation.cpp	(revision 2019)
+++ 	(revision )
@@ -1,136 +1,0 @@
-/*!
-   \file axis_algorithm_transformation.hpp
-   \author Ha NGUYEN
-   \since 14 May 2015
-   \date 29 June 2015
-
-   \brief Interface for all axis transformation algorithms.
- */
-
-#include "axis_algorithm_transformation.hpp"
-#include "axis_algorithm_inverse.hpp"
-#include "axis_algorithm_zoom.hpp"
-#include "context.hpp"
-#include "context_client.hpp"
-#include "client_client_dht_template.hpp"
-#include "axis.hpp"
-
-namespace xios {
-
-CAxisAlgorithmTransformation::CAxisAlgorithmTransformation(CAxis* axisDestination, CAxis* axisSource)
- : CGenericAlgorithmTransformation(), axisDest_(axisDestination), axisSrc_(axisSource), domainSrc_(0),scalarSrc_(0)
-TRY
-{
-  axisDestGlobalSize_ = axisDestination->n_glo.getValue();
-  int niDest = axisDestination->n.getValue();
-  int ibeginDest = axisDestination->begin.getValue();
-
-  for (int idx = 0; idx < niDest; ++idx)
-    if ((axisDestination->mask)(idx)) axisDestGlobalIndex_.push_back(ibeginDest+idx);
-}
-CATCH
-
-CAxisAlgorithmTransformation::CAxisAlgorithmTransformation(CAxis* axisDestination, CDomain* domainSource)
- : CGenericAlgorithmTransformation(), axisDest_(axisDestination), axisSrc_(0), domainSrc_(domainSource),scalarSrc_(0)
-TRY
-{
-  axisDestGlobalSize_ = axisDestination->n_glo.getValue();
-  int niDest = axisDestination->n.getValue();
-  int ibeginDest = axisDestination->begin.getValue();
-
-  for (int idx = 0; idx < niDest; ++idx)
-    if ((axisDestination->mask)(idx)) axisDestGlobalIndex_.push_back(ibeginDest+idx);
-}
-CATCH
-
-CAxisAlgorithmTransformation::CAxisAlgorithmTransformation(CAxis* axisDestination, CScalar* scalarSource)
- : CGenericAlgorithmTransformation(), axisDest_(axisDestination), axisSrc_(0), domainSrc_(0), scalarSrc_(scalarSource)
-TRY
-{
-  axisDestGlobalSize_ = axisDestination->n_glo.getValue();
-  int niDest = axisDestination->n.getValue();
-  int ibeginDest = axisDestination->begin.getValue();
-
-  for (int idx = 0; idx < niDest; ++idx)
-    if ((axisDestination->mask)(idx)) axisDestGlobalIndex_.push_back(ibeginDest+idx);
-}
-CATCH
-
-CAxisAlgorithmTransformation::~CAxisAlgorithmTransformation()
-{
-}
-
-void CAxisAlgorithmTransformation::computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs)
-{
-}
-
-/*!
-  Compute global index of axis on different processes
-  \param [in] globalAxisIndex global index of axis source
-  \param [out] globalAxisIndexOnProc processes which contain the corresponding global index of axis source
-*/
-void CAxisAlgorithmTransformation::computeExchangeGlobalIndex(const CArray<size_t,1>& globalAxisIndex,
-                                                              int elementType,
-                                                              CClientClientDHTInt::Index2VectorInfoTypeMap& globalAxisIndexOnProc)
-TRY
-{
-  CContext* context = CContext::getCurrent();
-  CContextClient* client=context->client;
-  int clientRank = client->clientRank;
-  int clientSize = client->clientSize;
-
-  size_t globalIndex;
-  int nIndexSize = 0;
-  CArray<bool,1>* ptLocalMask ;
-  CArray<bool,1> scalarMask(1) ;
-  scalarMask=true ;
-  
-  if (2 == elementType) 
-  {
-    nIndexSize = domainSrc_->i_index.numElements();
-    ptLocalMask=&(domainSrc_->localMask) ;
-  }
-  else if (1 == elementType)
-  {
-     nIndexSize = axisSrc_->index.numElements();
-     ptLocalMask=&(axisSrc_->mask) ;
-  }
-  else
-  {
-     nIndexSize=1  ; //  scalar
-     ptLocalMask=&scalarMask ;
-  }
-  CArray<bool,1>& localMask=*ptLocalMask ;
-  
-  CClientClientDHTInt::Index2VectorInfoTypeMap globalIndex2ProcRank;
-  globalIndex2ProcRank.rehash(std::ceil(nIndexSize/globalIndex2ProcRank.max_load_factor()));
-  for (int idx = 0; idx < nIndexSize; ++idx)
-  {
-    if (localMask(idx))
-    {
-      if (2 == elementType) // domain
-      {
-       globalIndex = domainSrc_->i_index(idx) + domainSrc_->j_index(idx) * domainSrc_->ni_glo;
-      }
-      else if (1 == elementType) // axis
-      {
-        globalIndex = axisSrc_->index(idx);
-      }
-      else // scalar
-      {
-        globalIndex = 0;
-      }
-     
-      globalIndex2ProcRank[globalIndex].resize(1);
-      globalIndex2ProcRank[globalIndex][0] = clientRank;
-    }
-  }
-
-  CClientClientDHTInt dhtIndexProcRank(globalIndex2ProcRank, client->intraComm);
-  dhtIndexProcRank.computeIndexInfoMapping(globalAxisIndex);
-
-  globalAxisIndexOnProc = dhtIndexProcRank.getInfoIndexMap();
-}
-CATCH
-
-}
Index: XIOS/dev/dev_trunk_graph/src/transformation/axis_algorithm_transformation.hpp
===================================================================
--- XIOS/dev/dev_trunk_graph/src/transformation/axis_algorithm_transformation.hpp	(revision 2019)
+++ 	(revision )
@@ -1,64 +1,0 @@
-/*!
-   \file axis_algorithm_transformation.hpp
-   \author Ha NGUYEN
-   \since 14 May 2015
-   \date 29 June 2015
-
-   \brief Interface for all axis transformation algorithms.
- */
-#ifndef __XIOS_AXIS_ALGORITHM_TRANSFORMATION_HPP__
-#define __XIOS_AXIS_ALGORITHM_TRANSFORMATION_HPP__
-
-#include "generic_algorithm_transformation.hpp"
-#include "grid_transformation_factory_impl.hpp"
-
-namespace xios {
-
-class CAxis;
-class CDomain;
-class CScalar;
-/*!
-  \class CAxisAlgorithmTransformation
-  Algorithms for axis.
-*/
-class CAxisAlgorithmTransformation : public virtual CGenericAlgorithmTransformation
-{
-public:
-  CAxisAlgorithmTransformation(CAxis* axisDestination, CAxis* axisSource);
-  CAxisAlgorithmTransformation(CAxis* axisDestination, CDomain* domainSource);
-  CAxisAlgorithmTransformation(CAxis* axisDestination, CScalar* scalarSource);
-
-  virtual ~CAxisAlgorithmTransformation();
-
-  virtual StdString getName() {return "Axis Trans. Filter \\n Transformation";}
-
-protected:
-  void computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs);
-
-  virtual void computeExchangeGlobalIndex(const CArray<size_t,1>& globalAxisIndex,
-                                          int elementType,
-                                          CClientClientDHTInt::Index2VectorInfoTypeMap& globalDomainIndexOnProc);
-
-protected:
-  //! Global index of an axis on grid destination
-  std::vector<int> axisDestGlobalIndex_;
-
-  //! Size of
-  int axisDestGlobalSize_;
-
-    //! Axis on grid destination
-  CAxis* axisDest_;
-
-  //! Axis on grid source
-  CAxis* axisSrc_;
-
-  //! Domain on grid source
-  CDomain* domainSrc_;
-
-  //! Scalar on grid source
-
-  CScalar* scalarSrc_;
-};
-
-}
-#endif // __XIOS_AXIS_ALGORITHM_TRANSFORMATION_HPP__
Index: XIOS/dev/dev_trunk_graph/src/transformation/axis_algorithm_zoom.cpp
===================================================================
--- XIOS/dev/dev_trunk_graph/src/transformation/axis_algorithm_zoom.cpp	(revision 2019)
+++ 	(revision )
@@ -1,121 +1,0 @@
-/*!
-   \file axis_algorithm_zoom.cpp
-   \brief Algorithm for zooming an axis.
- */
-#include "axis_algorithm_zoom.hpp"
-#include "axis.hpp"
-#include "grid.hpp"
-#include "grid_transformation_factory_impl.hpp"
-#include "zoom_axis.hpp"
-
-namespace xios {
-CGenericAlgorithmTransformation* CAxisAlgorithmZoom::create(CGrid* gridDst, CGrid* gridSrc,
-                                                           CTransformation<CAxis>* transformation,
-                                                           int elementPositionInGrid,
-                                                           std::map<int, int>& elementPositionInGridSrc2ScalarPosition,
-                                                           std::map<int, int>& elementPositionInGridSrc2AxisPosition,
-                                                           std::map<int, int>& elementPositionInGridSrc2DomainPosition,
-                                                           std::map<int, int>& elementPositionInGridDst2ScalarPosition,
-                                                           std::map<int, int>& elementPositionInGridDst2AxisPosition,
-                                                           std::map<int, int>& elementPositionInGridDst2DomainPosition)
-TRY
-{
-  std::vector<CAxis*> axisListDestP = gridDst->getAxis();
-  std::vector<CAxis*> axisListSrcP  = gridSrc->getAxis();
-
-  CZoomAxis* zoomAxis = dynamic_cast<CZoomAxis*> (transformation);
-  int axisDstIndex = elementPositionInGridDst2AxisPosition[elementPositionInGrid];
-  int axisSrcIndex = elementPositionInGridSrc2AxisPosition[elementPositionInGrid];
-
-  return (new CAxisAlgorithmZoom(axisListDestP[axisDstIndex], axisListSrcP[axisSrcIndex], zoomAxis));
-}
-CATCH
-
-bool CAxisAlgorithmZoom::registerTrans()
-TRY
-{
-  CGridTransformationFactory<CAxis>::registerTransformation(TRANS_ZOOM_AXIS, create);
-}
-CATCH
-
-CAxisAlgorithmZoom::CAxisAlgorithmZoom(CAxis* axisDestination, CAxis* axisSource, CZoomAxis* zoomAxis)
-: CAxisAlgorithmTransformation(axisDestination, axisSource)
-TRY
-{
-  zoomAxis->checkValid(axisSource);
-  zoomBegin_ = zoomAxis->begin.getValue();
-  zoomN_  = zoomAxis->n.getValue();
-  zoomEnd_   = zoomBegin_ + zoomN_ - 1;
-
-  if (zoomN_ > axisSource->n_glo.getValue())
-  {
-    ERROR("CAxisAlgorithmZoom::CAxisAlgorithmZoom(CAxis* axisDestination, CAxis* axisSource, CZoomAxis* zoomAxis)",
-           << "Zoom size is greater than global size of source axis"
-           << "Global size of source axis " <<axisSource->getId() << " is " << axisSource->n_glo.getValue()  << std::endl
-           << "Zoom size is " << zoomN_ );
-  }
-
-  int idxSrc, nDest = 0, beginDestLoc, beginDestGlo = 0 ;
-  int indGloDest, indGloSrc, iSrc;
-  for (int i = 0; i < axisSrc_->n.getValue(); i++)
-  {
-    idxSrc = axisSrc_->index(i);
-    if ((idxSrc >= zoomBegin_) && (idxSrc <= zoomEnd_))
-    {
-      if (nDest == 0) beginDestLoc = i;
-      ++nDest;
-    }
-  }
-  beginDestGlo = beginDestLoc + axisSrc_->begin - zoomBegin_;
-  axisDest_->n_glo.setValue(zoomN_);
-  axisDest_->n.setValue(nDest);
-  axisDest_->begin.setValue(beginDestGlo);
-  axisDest_->index.resize(nDest);
-
-  axisDest_->data_n.setValue(nDest);
-  axisDest_->data_begin.setValue(0);
-  axisDest_->data_index.resize(nDest);
-
-  axisDest_->mask.resize(nDest);
-  if (axisSrc_->hasValue) axisDest_->value.resize(nDest);
-  if (axisSrc_->hasLabel) axisDest_->label.resize(nDest);
-  if (axisSrc_->hasBounds) axisDest_->bounds.resize(2,nDest);
-
-  this->transformationMapping_.resize(1);
-  this->transformationWeight_.resize(1);
-  TransformationIndexMap& transMap = this->transformationMapping_[0];
-  TransformationWeightMap& transWeight = this->transformationWeight_[0];
-
-  for (int iDest = 0; iDest < nDest; iDest++)
-  {
-    iSrc = iDest + beginDestLoc;
-    axisDest_->index(iDest) = iDest + beginDestGlo;
-    axisDest_->data_index(iDest) = axisSrc_->data_index(iSrc) - beginDestLoc;
-    axisDest_->mask(iDest) = axisSrc_->mask(iSrc);
-
-    if (axisSrc_->hasValue)
-      axisDest_->value(iDest) = axisSrc_->value(iSrc);
-    if (axisSrc_->hasLabel)
-      axisDest_->label(iDest) = axisSrc_->label(iSrc);
-    if (axisSrc_->hasBounds)
-    {
-      axisDest_->bounds(0,iDest) = axisSrc_->bounds(0,iSrc);
-      axisDest_->bounds(1,iDest) = axisSrc_->bounds(1,iSrc);
-    }
-    indGloDest = axisDest_->index(iDest);
-    indGloSrc = axisSrc_->index(iSrc);
-    transMap[indGloDest].push_back(indGloSrc);
-    transWeight[indGloDest].push_back(1.0);
-
-  }
-}
-CATCH
-
-/*!
-  Compute the index mapping between domain on grid source and one on grid destination
-*/
-void CAxisAlgorithmZoom::computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs)
-{
-}
-
-}
Index: XIOS/dev/dev_trunk_graph/src/transformation/axis_algorithm_zoom.hpp
===================================================================
--- XIOS/dev/dev_trunk_graph/src/transformation/axis_algorithm_zoom.hpp	(revision 2019)
+++ 	(revision )
@@ -1,63 +1,0 @@
-/*!
-   \file axis_algorithm_zoom.hpp
-   \brief Algorithm for zooming an axis.
- */
-#ifndef __XIOS_AXIS_ALGORITHM_ZOOM_HPP__
-#define __XIOS_AXIS_ALGORITHM_ZOOM_HPP__
-
-#include "axis_algorithm_transformation.hpp"
-#include "transformation.hpp"
-
-namespace xios {
-class CAxis;
-class CZoomAxis;
-
-/*!
-  \class CAxisAlgorithmZoom
-  Implementing zoom on axis
-  A zoomed region can be considered as region that isn't masked.
-  Only this zoomed region is zoomed to write on Netcdf.
-*/
-class CAxisAlgorithmZoom : public CAxisAlgorithmTransformation
-{
-public:
-  CAxisAlgorithmZoom(CAxis* axisDestination, CAxis* axisSource, CZoomAxis* zoomAxis);
-
-  virtual ~CAxisAlgorithmZoom() {}
-
-  static bool registerTrans();
-
-  virtual StdString getName() {return "Axis Trans. Filter \\n Zoom";}
-
-protected:
-  void computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs);
-
-private:
-
-private:
-  //! Global zoom begin on axis
-  StdSize zoomBegin_;
-
-  //! Global zoom end on axis
-  StdSize zoomEnd_;
-
-  //! Global zoom size on axis
-  StdSize zoomN_;
-
-  std::vector<int> zoomIndex_;
-
-private:
-
-  static CGenericAlgorithmTransformation* create(CGrid* gridDst, CGrid* gridSrc,
-                                                CTransformation<CAxis>* transformation,
-                                                int elementPositionInGrid,
-                                                std::map<int, int>& elementPositionInGridSrc2ScalarPosition,
-                                                std::map<int, int>& elementPositionInGridSrc2AxisPosition,
-                                                std::map<int, int>& elementPositionInGridSrc2DomainPosition,
-                                                std::map<int, int>& elementPositionInGridDst2ScalarPosition,
-                                                std::map<int, int>& elementPositionInGridDst2AxisPosition,
-                                                std::map<int, int>& elementPositionInGridDst2DomainPosition);
-};
-
-}
-#endif // __XIOS_AXIS_ALGORITHM_ZOOM_HPP__
Index: XIOS/dev/dev_trunk_graph/src/transformation/domain_algorithm_compute_connectivity.cpp
===================================================================
--- XIOS/dev/dev_trunk_graph/src/transformation/domain_algorithm_compute_connectivity.cpp	(revision 2019)
+++ 	(revision )
@@ -1,111 +1,0 @@
-/*!
-   \file domain_algorithm_compute_connectivity.cpp
-   \author Ha NGUYEN
-   \since 15 Jul 2016
-   \date 15 Jul 2016
-
-   \brief Algorithm for compute_connectivity on an domain.
- */
-#include "domain_algorithm_compute_connectivity.hpp"
-#include "compute_connectivity_domain.hpp"
-#include "mesh.hpp"
-#include "domain.hpp"
-#include "grid.hpp"
-#include "grid_transformation_factory_impl.hpp"
-
-namespace xios {
-CGenericAlgorithmTransformation* CDomainAlgorithmComputeConnectivity::create(CGrid* gridDst, CGrid* gridSrc,
-                                                                     CTransformation<CDomain>* transformation,
-                                                                     int elementPositionInGrid,
-                                                                     std::map<int, int>& elementPositionInGridSrc2ScalarPosition,
-                                                                     std::map<int, int>& elementPositionInGridSrc2AxisPosition,
-                                                                     std::map<int, int>& elementPositionInGridSrc2DomainPosition,
-                                                                     std::map<int, int>& elementPositionInGridDst2ScalarPosition,
-                                                                     std::map<int, int>& elementPositionInGridDst2AxisPosition,
-                                                                     std::map<int, int>& elementPositionInGridDst2DomainPosition)
-TRY
-{
-  std::vector<CDomain*> domainListDestP = gridDst->getDomains();
-  std::vector<CDomain*> domainListSrcP  = gridSrc->getDomains();
-
-  CComputeConnectivityDomain* compute_connectivityDomain = dynamic_cast<CComputeConnectivityDomain*> (transformation);
-  int domainDstIndex = elementPositionInGridDst2DomainPosition[elementPositionInGrid];
-  int domainSrcIndex = elementPositionInGridSrc2DomainPosition[elementPositionInGrid];
-
-  return (new CDomainAlgorithmComputeConnectivity(domainListDestP[domainDstIndex], domainListSrcP[domainSrcIndex], compute_connectivityDomain));
-}
-CATCH
-
-bool CDomainAlgorithmComputeConnectivity::registerTrans()
-TRY
-{
-  CGridTransformationFactory<CDomain>::registerTransformation(TRANS_COMPUTE_CONNECTIVITY_DOMAIN, create);
-}
-CATCH
-
-CDomainAlgorithmComputeConnectivity::CDomainAlgorithmComputeConnectivity(CDomain* domainDestination, CDomain* domainSource,
-                                                                         CComputeConnectivityDomain* compute_connectivityDomain)
-: CDomainAlgorithmTransformation(domainDestination, domainSource)
-TRY
-{
-  this->type_ = (ELEMENT_NO_MODIFICATION_WITHOUT_DATA);
-  compute_connectivityDomain->checkValid(domainDestination);
-  int& nbNeighborMax = compute_connectivityDomain->n_neighbor_max;
-  CArray<int,1>& nbNeighbor = compute_connectivityDomain->n_neighbor;
-  CArray<int,2>& localNeighbors = compute_connectivityDomain->local_neighbor;
-  int type = 1; // Edge type
-  switch (compute_connectivityDomain->type)
-  {
-    case CComputeConnectivityDomain::type_attr::node :
-      type = 0;
-      break;
-    case CComputeConnectivityDomain::type_attr::edge :
-      type = 1;
-      break;
-    default:
-      break;
-  }
-
-  computeLocalConnectivity(type, domainDestination, nbNeighborMax, nbNeighbor, localNeighbors);
-}
-CATCH
-
-/*!
- *  Compute local connectivity of a domain
- *  \param[in] type type of connectivity (node or edge)
- *  \param[in] domain domain on which we calculate local connectivity
- *  \param[in/out] nbConnectivityMax maximum number of neighbor a cell of domain has
- *  \param[in/out] nbConnectivity number of neighbor a cell has
- *  \param[in/out] localConnectivity localConnectivity local index of neighbor of a cell
- */
-void CDomainAlgorithmComputeConnectivity::computeLocalConnectivity(int type,
-                                                                  CDomain* domain,
-                                                                  int& nbConnectivityMax,
-                                                                  CArray<int,1>& nbConnectivity,
-                                                                  CArray<int,2>& localConnectivity)
-TRY
-{
-
-  CMesh mesh;
-
-  CArray<double,2>& bounds_lon = domain->bounds_lon_1d;
-  CArray<double,2>& bounds_lat = domain->bounds_lat_1d;
-  int ncell = bounds_lon.shape()[1];
-  CArray<int,1> localIndex(ncell);
-  for (int idx = 0; idx <ncell; ++idx) localIndex(idx) = idx;
-
-  mesh.getLocalNghbFaces(type, localIndex, bounds_lon, bounds_lat, localConnectivity, nbConnectivity);
-  nbConnectivityMax = 0;
-  for (int idx =0; idx < nbConnectivity.numElements(); ++idx)
-    if (nbConnectivityMax < nbConnectivity(idx)) nbConnectivityMax = nbConnectivity(idx);
-}
-CATCH
-
-/*!
-  Compute the index mapping between domain on grid source and one on grid destination
-*/
-void CDomainAlgorithmComputeConnectivity::computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs)
-{
-}
-
-}
Index: XIOS/dev/dev_trunk_graph/src/transformation/domain_algorithm_compute_connectivity.hpp
===================================================================
--- XIOS/dev/dev_trunk_graph/src/transformation/domain_algorithm_compute_connectivity.hpp	(revision 2019)
+++ 	(revision )
@@ -1,56 +1,0 @@
-/*!
-   \file domain_algorithm_compute_connectivity.hpp
-   \author Ha NGUYEN
-   \since 03 June 2015
-   \date 12 June 2015
-
-   \brief Algorithm for compute_connectivitying on an domain.
- */
-#ifndef __XIOS_DOMAIN_ALGORITHM_COMPUTE_CONNECTIVITY_HPP__
-#define __XIOS_DOMAIN_ALGORITHM_COMPUTE_CONNECTIVITY_HPP__
-
-#include "domain_algorithm_transformation.hpp"
-#include "transformation.hpp"
-
-namespace xios {
-class CDomain;
-class CComputeConnectivityDomain;
-
-/*!
-  \class CDomainAlgorithmComputeConnectivity
-*/
-class CDomainAlgorithmComputeConnectivity : public CDomainAlgorithmTransformation
-{
-public:
-  CDomainAlgorithmComputeConnectivity(CDomain* domainDestination, CDomain* domainSource, CComputeConnectivityDomain* compute_connectivityDomain);
-
-  virtual ~CDomainAlgorithmComputeConnectivity() {}
-
-  static bool registerTrans();
-
-  virtual StdString getName() {return "Domain Trans. Filter \\n Compute Connectivity";}
-
-protected:
-  void computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs);
-
-protected:
-  void computeLocalConnectivity(int type,
-                                CDomain* domain,
-                                int& nbConnectivityMax,
-                                CArray<int,1>& nbConnectivity,
-                                CArray<int,2>& localConnectivity);
-
-private:
-  static CGenericAlgorithmTransformation* create(CGrid* gridDst, CGrid* gridSrc,
-                                                CTransformation<CDomain>* transformation,
-                                                int elementPositionInGrid,
-                                                std::map<int, int>& elementPositionInGridSrc2ScalarPosition,
-                                                std::map<int, int>& elementPositionInGridSrc2AxisPosition,
-                                                std::map<int, int>& elementPositionInGridSrc2DomainPosition,
-                                                std::map<int, int>& elementPositionInGridDst2ScalarPosition,
-                                                std::map<int, int>& elementPositionInGridDst2AxisPosition,
-                                                std::map<int, int>& elementPositionInGridDst2DomainPosition);
-};
-
-}
-#endif // __XIOS_DOMAIN_ALGORITHM_COMPUTE_CONNECTIVITY_HPP__
Index: XIOS/dev/dev_trunk_graph/src/transformation/domain_algorithm_expand.cpp
===================================================================
--- XIOS/dev/dev_trunk_graph/src/transformation/domain_algorithm_expand.cpp	(revision 2019)
+++ 	(revision )
@@ -1,694 +1,0 @@
-/*!
-   \file domain_algorithm_expand.cpp
-   \author Ha NGUYEN
-   \since 08 Aug 2016
-   \date 19 Sep 2016
-
-   \brief Algorithm for expanding an domain.
- */
-#include "domain_algorithm_expand.hpp"
-#include "expand_domain.hpp"
-#include "mesh.hpp"
-#include "domain.hpp"
-#include "grid.hpp"
-#include "grid_transformation_factory_impl.hpp"
-#include "context.hpp"
-#include "context_client.hpp"
-
-namespace xios {
-CGenericAlgorithmTransformation* CDomainAlgorithmExpand::create(CGrid* gridDst, CGrid* gridSrc,
-                                                               CTransformation<CDomain>* transformation,
-                                                               int elementPositionInGrid,
-                                                               std::map<int, int>& elementPositionInGridSrc2ScalarPosition,
-                                                               std::map<int, int>& elementPositionInGridSrc2AxisPosition,
-                                                               std::map<int, int>& elementPositionInGridSrc2DomainPosition,
-                                                               std::map<int, int>& elementPositionInGridDst2ScalarPosition,
-                                                               std::map<int, int>& elementPositionInGridDst2AxisPosition,
-                                                               std::map<int, int>& elementPositionInGridDst2DomainPosition)
-TRY
-{
-  std::vector<CDomain*> domainListDestP = gridDst->getDomains();
-  std::vector<CDomain*> domainListSrcP  = gridSrc->getDomains();
-
-  CExpandDomain* expandDomain = dynamic_cast<CExpandDomain*> (transformation);
-  int domainDstIndex = elementPositionInGridDst2DomainPosition[elementPositionInGrid];
-  int domainSrcIndex = elementPositionInGridSrc2DomainPosition[elementPositionInGrid];
-
-  return (new CDomainAlgorithmExpand(domainListDestP[domainDstIndex], domainListSrcP[domainSrcIndex], expandDomain));
-}
-CATCH
-
-bool CDomainAlgorithmExpand::registerTrans()
-TRY
-{
-  CGridTransformationFactory<CDomain>::registerTransformation(TRANS_EXPAND_DOMAIN, create);
-}
-CATCH
-
-CDomainAlgorithmExpand::CDomainAlgorithmExpand(CDomain* domainDestination,
-                                               CDomain* domainSource,
-                                               CExpandDomain* expandDomain)
-: CDomainAlgorithmTransformation(domainDestination, domainSource),
-  isXPeriodic_(false), isYPeriodic_(false)
-TRY
-{
-  if (domainDestination == domainSource)
-  {
-    ERROR("CDomainAlgorithmExpand::CDomainAlgorithmExpand(CDomain* domainDestination,CDomain* domainSource, CExpandDomain* expandDomain)",
-           << "Domain source and domain destination are the same. Please make sure domain destination refers to domain source" << std::endl
-           << "Domain source " <<domainSource->getId() << std::endl
-           << "Domain destination " <<domainDestination->getId() << std::endl);
-  }
-
-  this->type_ = (ELEMENT_MODIFICATION_WITH_DATA);
-  // Make sure domain source have all valid attributes
-  // domainSource->checkAllAttributes();
-  expandDomain->checkValid(domainDestination);
-  if (!expandDomain->i_periodic.isEmpty()) isXPeriodic_ = expandDomain->i_periodic;
-  if (!expandDomain->j_periodic.isEmpty()) isYPeriodic_ = expandDomain->j_periodic;
-  
-  switch (expandDomain->type)
-  {
-    case CExpandDomain::type_attr::node :
-      expandDomainNodeConnectivity(domainDestination,
-                                   domainSource);
-      break;
-    case CExpandDomain::type_attr::edge :
-      expandDomainEdgeConnectivity(domainDestination,
-                                   domainSource);
-      break;
-    default:
-      break;
-  }
-}
-CATCH
-
-/*!
- *  Expand domain with edge-type neighbor
- *  \param[in/out] domainDestination domain destination and will be modified
- *  \param[in] domainSource domain source
- */
-void CDomainAlgorithmExpand::expandDomainEdgeConnectivity(CDomain* domainDestination,
-                                                          CDomain* domainSource)
-TRY
-{
-  CContext* context = CContext::getCurrent();
-  CContextClient* client=context->client;
-
-  int type = 1; // For edge
-  CMesh mesh;
-  CArray<double,2>& bounds_lon_src = domainSource->bounds_lon_1d;
-  CArray<double,2>& bounds_lat_src = domainSource->bounds_lat_1d;
-  CArray<int,2> neighborsSrc;
-  switch (domainSource->type) {
-   case CDomain::type_attr::unstructured:      
-      mesh.getGlobalNghbFaces(type, client->intraComm, domainSource->i_index, bounds_lon_src, bounds_lat_src, neighborsSrc);
-      updateUnstructuredDomainAttributes(domainDestination, domainSource, neighborsSrc);
-      break;
-   default:
-      updateRectilinearDomainAttributes(domainDestination, domainSource, neighborsSrc);
-      break;      
-  }  
-}
-CATCH
-
-/*!
- *  Expand domain with node-type neighbor
- *  \param[in/out] domainDestination domain destination and will be modified
- *  \param[in] domainSource domain source
- */
-void CDomainAlgorithmExpand::expandDomainNodeConnectivity(CDomain* domainDestination,
-                                                          CDomain* domainSource)
-TRY
-{
-  CContext* context = CContext::getCurrent();
-  CContextClient* client=context->client;
-
-  int type = 1; // For edge
-  CMesh mesh;
-  CArray<double,2>& bounds_lon_src = domainSource->bounds_lon_1d;
-  CArray<double,2>& bounds_lat_src = domainSource->bounds_lat_1d;
-  CArray<int,2> neighborsSrc;
-  switch (domainSource->type) {
-   case CDomain::type_attr::unstructured:      
-      mesh.getGlobalNghbFaces(type, client->intraComm, domainSource->i_index, bounds_lon_src, bounds_lat_src, neighborsSrc);
-      updateUnstructuredDomainAttributes(domainDestination, domainSource, neighborsSrc);
-      break;
-   default:
-      updateRectilinearDomainAttributes(domainDestination, domainSource, neighborsSrc);
-      break;      
-  }  
-}
-CATCH
-
-/*!
- *  Extend rectilinear or curvilinear domain destination and update its attributes
- *  Suppose that domain destination and domain source have the same values for all attributes (by inheritance)
- *  \param [in/out] domainDestination domain destination
- *  \param [in] domainSource domain source
- *  \param [in] neighborsDomainSrc neighbor of domain source. For now, we don't need it for rectilinear
- */
-void CDomainAlgorithmExpand::updateRectilinearDomainAttributes(CDomain* domainDestination,
-                                                               CDomain* domainSource,
-                                                               CArray<int,2>& neighborsDomainSrc)
-TRY
-{
-  int index, globalIndex, idx;
-  int iindexDst, jindexDst, globIndexDst;
-  int iindexSrc, jindexSrc, globIndexSrc;
-  CContext* context = CContext::getCurrent();
-  CContextClient* client=context->client;
-
-  // First of all, "copy" all attributes of domain source to domain destination
-  StdString domainDstRef = (!domainDestination->domain_ref.isEmpty()) ? domainDestination->domain_ref.getValue()
-                                                                      : "";
-  if (domainDstRef != domainSource->getId())
-  {
-    domainDestination->domain_ref.setValue(domainSource->getId());
-    domainDestination->solveRefInheritance(true);
-  }
-
-  if (domainDstRef.empty()) domainDestination->domain_ref.reset();
-  else domainDestination->domain_ref.setValue(domainDstRef);
-
-  
-  // Here are attributes of source need tranfering
-  int niGloSrc = domainSource->ni_glo;
-  int njGloSrc = domainSource->nj_glo;
-  int niSrc = domainSource->ni, ibegin = domainSource->ibegin;
-  int njSrc = domainSource->nj, jbegin = domainSource->jbegin;
-  int dataDimSrc = domainSource->data_dim;
-  CArray<bool,1>& mask_1d_src = domainSource->domainMask;
-  CArray<int,1>& i_index_src = domainSource->i_index;
-  CArray<int,1>& j_index_src = domainSource->j_index;
-  CArray<int,1>& data_i_index_src = domainSource->data_i_index;
-  CArray<int,1>& data_j_index_src = domainSource->data_j_index;
-  int data_i_begin_src = domainSource->data_ibegin;
-  int data_j_begin_src = domainSource->data_jbegin;
-  CArray<double,1>& lon_src = domainSource->lonvalue;
-  CArray<double,1>& lat_src = domainSource->latvalue;
-
-  // We need to generate boundary for longitude and latitude
-  if (domainSource->bounds_lon_1d.isEmpty() || domainSource->bounds_lat_1d.isEmpty())
-  {
-    CArray<double,1> lon = lon_src(Range(0,niSrc-1));
-    CArray<double,1> lat = lat_src(Range(0,lat_src.numElements()-niSrc,niSrc));
-    CArray<double,2>& bounds_lon_src = domainSource->bounds_lon_1d;
-    CArray<double,2>& bounds_lat_src = domainSource->bounds_lat_1d;
-    domainSource->fillInRectilinearBoundLonLat(lon_src, lat_src, bounds_lon_src, bounds_lat_src);
-  }
-
-
-  CArray<double,2>& bounds_lon_src = domainSource->bounds_lon_1d;
-  CArray<double,2>& bounds_lat_src = domainSource->bounds_lat_1d;
-
-  int nVertex       = bounds_lon_src.shape()[0];
-  int oldNbLocal = i_index_src.numElements();
-  // Calculate ni, nj by using i_index and j_index
-  int niSrcByIndex = max(i_index_src) - min(i_index_src) + 1;
-  int njSrcByIndex = max(j_index_src) - min(j_index_src) + 1;  
-  int dataIindexBoundSrc = (1 == dataDimSrc) ? (niSrcByIndex * njSrcByIndex) : niSrcByIndex;
-  int dataJindexBoundSrc = (1 == dataDimSrc) ? (niSrcByIndex * njSrcByIndex) : njSrcByIndex;
-
-  // Uncompress data_i_index, data_j_index
-  CArray<int,1> data_i_index_src_full(oldNbLocal);
-  CArray<int,1> data_j_index_src_full(oldNbLocal);
-  int nbUnMaskedPointOnLocalDomain = 0;
-  data_i_index_src_full = -1; // Suppose all values are masked
-  data_j_index_src_full = -1; // Suppose all values are masked
-  for (idx = 0; idx < data_i_index_src.numElements(); ++idx)
-  {
-    int dataIidx = data_i_index_src(idx) + data_i_begin_src;
-    int dataJidx = data_j_index_src(idx) + data_j_begin_src;
-    if ((0 <= dataIidx) && (dataIidx < dataIindexBoundSrc) &&
-        (0 <= dataJidx) && (dataJidx < dataJindexBoundSrc))
-    {
-      data_i_index_src_full(nbUnMaskedPointOnLocalDomain) = dataIidx;
-      data_j_index_src_full(nbUnMaskedPointOnLocalDomain) = dataJidx;
-      ++nbUnMaskedPointOnLocalDomain;
-    }
-  }
-
-  // Expand domain destination, not only local but also global
-  int niGloDst = niGloSrc + 2;
-  int njGloDst = njGloSrc + 2;
-  int niDst = niSrc + 2;
-  int njDst = njSrc + 2;
-  domainDestination->ni_glo.setValue(niGloDst);
-  domainDestination->nj_glo.setValue(njGloDst);
-  domainDestination->ni.setValue(niDst);
-  domainDestination->nj.setValue(njDst);
-
-  CArray<bool,1>& mask_1d_dst = domainDestination->domainMask;
-  CArray<int,1>& i_index_dst  = domainDestination->i_index;
-  CArray<int,1>& j_index_dst  = domainDestination->j_index;  
-  CArray<int,1>& data_i_index_dst  = domainDestination->data_i_index;
-  CArray<int,1>& data_j_index_dst  = domainDestination->data_j_index;
-  
-  // Make sure that we use only lonvalue_client, latvalue_client
-  if (!domainDestination->lonvalue_1d.isEmpty()) domainDestination->lonvalue_1d.reset();
-  if (!domainDestination->latvalue_1d.isEmpty()) domainDestination->latvalue_1d.reset();
-  if (!domainDestination->lonvalue_2d.isEmpty()) domainDestination->lonvalue_2d.reset();
-  if (!domainDestination->latvalue_2d.isEmpty()) domainDestination->latvalue_2d.reset();
-
-  // Recalculate i_index, j_index of extended domain
-  // Should be enough for common case, but if we have arbitrary distribution?
-  int newNbLocalDst = niDst * njDst;     
-
-  mask_1d_dst.resize(newNbLocalDst);
-  i_index_dst.resize(newNbLocalDst);
-  j_index_dst.resize(newNbLocalDst);
-  CArray<int,1> data_i_index_dst_full(newNbLocalDst);
-  CArray<int,1> data_j_index_dst_full(newNbLocalDst);
-
-  domainDestination->lonvalue.resizeAndPreserve(newNbLocalDst);
-  domainDestination->latvalue.resizeAndPreserve(newNbLocalDst);
-  domainDestination->bounds_lon_1d.resizeAndPreserve(nVertex, newNbLocalDst);
-  domainDestination->bounds_lat_1d.resizeAndPreserve(nVertex, newNbLocalDst);
-  CArray<double,1>& lon_dst   = domainDestination->lonvalue;
-  CArray<double,1>& lat_dst   = domainDestination->latvalue;
-  CArray<double,2>& bounds_lon_dst = domainDestination->bounds_lon_1d;
-  CArray<double,2>& bounds_lat_dst = domainDestination->bounds_lat_1d;
-
-  // Update i_index, j_index
-  for (int j = 0; j < njDst; ++j)
-    for (int i = 0; i < niDst; ++i)
-    {
-      idx = j * niDst + i; 
-      i_index_dst(idx) = i + ibegin;
-      j_index_dst(idx) = j + jbegin;
-    }
- 
-
-  // 1. Fill in array relating to global index (i_index, j_index, transmap, etc, ...)
-  // Global index mapping between destination and source
-  this->transformationMapping_.resize(1);
-  this->transformationWeight_.resize(1);
-  TransformationIndexMap& transMap = this->transformationMapping_[0];
-  TransformationWeightMap& transWeight = this->transformationWeight_[0];
-
-  transMap.rehash(std::ceil(newNbLocalDst/transMap.max_load_factor()));
-  transWeight.rehash(std::ceil(newNbLocalDst/transWeight.max_load_factor()));
-  
-  // Index mapping for local domain
-  // Mapping global index of expanded domain into original one 
-  // (Representing global index of expanded domain in form of global index of original one)
-  CArray<size_t,1> globalIndexSrcOnDstDomain(newNbLocalDst); 
-  for (idx = 0; idx < newNbLocalDst; ++idx)
-  {
-    iindexDst = i_index_dst(idx);
-    jindexDst = j_index_dst(idx);
-    globIndexDst = jindexDst * niGloDst + iindexDst;
-    globIndexSrc = (((jindexDst-1)+njGloSrc) % njGloSrc) * niGloSrc + (((iindexDst-1)+niGloSrc) % niGloSrc) ;
-    globalIndexSrcOnDstDomain(idx) = globIndexSrc;
-
-    transMap[globIndexDst].push_back(globIndexSrc);
-    transWeight[globIndexDst].push_back(1.0); 
-  }
-
-  // 2. Exchange local info among domains (lon,lat,bounds,mask,etc,...)
-  CClientClientDHTDouble::Index2VectorInfoTypeMap localData;
-  localData.rehash(std::ceil(oldNbLocal/localData.max_load_factor()));
-
-  // Information exchanged among domains (attention to their order), number in parentheses presents size of data
-  // lon(1) + lat(1) + bounds_lon(nVertex) + bounds_lat(nVertex) + mask(1) + data_i_index(1)
-  int dataPackageSize =  1 + 1 + // lon + lat
-                         nVertex + nVertex + //bounds_lon + bounds_lat
-                         1 + // mask_1d_dst;
-                         1 + 1; // data_i_index + data_j_index
-  // Initialize database
-  for (int idx = 0; idx < oldNbLocal; ++idx)
-  {
-    index = i_index_src(idx) + j_index_src(idx) * niGloSrc;
-    localData[index].resize(dataPackageSize);
-    std::vector<double>& data = localData[index];
-
-    //Pack data
-    int dataIdx = 0;
-    data[dataIdx] = lon_src(idx);++dataIdx;
-    data[dataIdx] = lat_src(idx);++dataIdx;
-    for (int i = 0; i < nVertex; ++i)
-    {
-      data[dataIdx] = bounds_lon_src(i,idx); ++dataIdx;
-    }
-    for (int i = 0; i < nVertex; ++i)
-    {
-      data[dataIdx] = bounds_lat_src(i,idx); ++dataIdx;
-    }
-    data[dataIdx] = mask_1d_src(idx) ? 1.0 : -1.0; ++dataIdx;
-    data[dataIdx] = data_i_index_src_full(idx);++dataIdx;
-    data[dataIdx] = data_j_index_src_full(idx);
-  }
-
-  CClientClientDHTDouble dhtData(localData,client->intraComm);
-  dhtData.computeIndexInfoMapping(globalIndexSrcOnDstDomain);
-  CClientClientDHTDouble::Index2VectorInfoTypeMap& neighborData = dhtData.getInfoIndexMap();
-  CClientClientDHTDouble::Index2VectorInfoTypeMap::iterator ite = neighborData.end(), it;
-
-  // Ok get all data for destination
-  // If domain is not periodic, then we mask all extended part.
-  int nbUnMaskedPointOnExtendedPart = 0, remainder = 0, dataIIndex, dataJIndex;
-  size_t nIdx;
-  double maskValue = 1.0;
-  for (index = 0; index < newNbLocalDst; ++index)
-  {
-     nIdx = globalIndexSrcOnDstDomain(index);
-     it = neighborData.find(nIdx);
-     if (ite != it)
-     {
-        std::vector<double>& data = it->second;
-        // Unpack data
-        int dataIdx = 0;
-        lon_dst(index) = data[dataIdx]; ++dataIdx;
-        lat_dst(index) = data[dataIdx]; ++dataIdx;
-        for (int i = 0; i < nVertex; ++i)
-        {
-          bounds_lon_dst(i,index) = data[dataIdx]; ++dataIdx;
-        }
-        for (int i = 0; i < nVertex; ++i)
-        {
-          bounds_lat_dst(i,index) = data[dataIdx]; ++dataIdx;
-        }
-        
-        // Check whether we have x periodic. If we don't, we should mask all point at 0 and niGloDst-1
-        maskValue = data[dataIdx];
-        if (!isXPeriodic_) 
-        {
-          remainder = i_index_dst(index) % (niGloDst-1);
-          if (0 == remainder) 
-          {
-            maskValue = -1.0;
-          }
-        }
-
-        if (!isYPeriodic_) 
-        {
-          remainder = j_index_dst(index) % (njGloDst-1);
-          if (0 == remainder) 
-          {
-            maskValue = -1.0;
-          }
-        }
-
-        mask_1d_dst(index) = (1.0 == maskValue) ? true : false; ++dataIdx;
-
-        dataIIndex = (int) data[dataIdx];
-        if (!isXPeriodic_) 
-        {
-          remainder = i_index_dst(index) % (niGloDst-1);
-          if (0 == remainder) 
-          {
-            dataIIndex = -1;
-          }
-        }
-        data_i_index_dst_full(index) = dataIIndex; ++dataIdx;
-        
-        dataJIndex = (int) data[dataIdx];
-        if (!isYPeriodic_) 
-        {
-          remainder = j_index_dst(index) % (njGloDst-1);
-          if (0 == remainder) 
-          {
-            dataJIndex = -1;
-          }
-        }        
-        data_j_index_dst_full(index) = dataJIndex;
-
-        if ((0 <= data_i_index_dst_full(index)) && (0 <= data_j_index_dst_full(index)))
-        {
-          ++nbUnMaskedPointOnExtendedPart;
-        }
-     }
-  }
-
-  
-  // Finally, update data_i_index, data_j_index
-  int dataDstDim = domainDestination->data_dim;
-  data_i_index_dst.resize(nbUnMaskedPointOnExtendedPart);
-  data_j_index_dst.resize(nbUnMaskedPointOnExtendedPart); 
-  int count = 0; 
-  for (idx = 0; idx < newNbLocalDst; ++idx)
-  {
-    dataIIndex = data_i_index_dst_full(idx);
-    dataJIndex = data_j_index_dst_full(idx);
-    if ((0 <= dataIIndex) && (0 <= dataJIndex))
-    {
-      data_i_index_dst(count) = (1 == dataDstDim) ? idx : i_index_dst(idx) - i_index_dst(0);
-      data_j_index_dst(count) = (1 == dataDstDim) ? 0   : j_index_dst(idx) - j_index_dst(0);
-      ++count;
-    }
-  }
-
-  // Update data_ni, data_nj
-  
-  domainDestination->data_ni.setValue((1==dataDstDim) ? niDst * njDst : niDst);
-  domainDestination->data_nj.setValue((1==dataDstDim) ? niDst * njDst : njDst);  
-  domainDestination->data_ibegin.setValue(0);
-  domainDestination->data_jbegin.setValue(0);
-
-  // Update longitude and latitude 
-  if (niSrc == domainSource->lonvalue_1d.numElements() && njSrc == domainSource->latvalue_1d.numElements()) // Ok, we have rectilinear here
-  {
-     domainDestination->lonvalue_1d.resize(niDst);
-     domainDestination->lonvalue_1d = lon_dst(Range(0,niDst-1));
-     domainDestination->latvalue_1d.resize(njDst);
-     domainDestination->latvalue_1d = lat_dst(Range(0,lat_dst.numElements()-niDst,niDst));
-  }
-  else // It should be curvilinear
-  {
-     domainDestination->lonvalue_1d.resize(lon_dst.numElements());
-     domainDestination->lonvalue_1d = lon_dst;
-     domainDestination->latvalue_1d.resize(lat_dst.numElements());
-     domainDestination->latvalue_1d = (lat_dst);
-  }
-   domainDestination->mask_1d.resize(domainDestination->domainMask.numElements()) ;
-   domainDestination->mask_1d=domainDestination->domainMask ;
-   domainDestination->computeLocalMask() ;
-}
-CATCH
-
-/*!
- *  Extend domain destination and update its attributes
- *  Suppose that domain destination and domain source have the same values for all attributes (by inheritance)
- *  \param [in/out] domainDestination domain destination
- *  \param [in] domainSource domain source
- *  \param [in] neighborsDomainSrc domain extended part
- */
-void CDomainAlgorithmExpand::updateUnstructuredDomainAttributes(CDomain* domainDestination,
-                                                                CDomain* domainSource,
-                                                                CArray<int,2>& neighborsDomainSrc)
-TRY
-{
-
-  CContext* context = CContext::getCurrent();
-  CContextClient* client=context->client;
-
-  // First of all, "copy" all attributes of domain source to domain destination
-  StdString domainDstRef = (!domainDestination->domain_ref.isEmpty()) ? domainDestination->domain_ref.getValue()
-                                                                      : "";
-  if (domainDstRef != domainSource->getId())
-  {
-    domainDestination->domain_ref.setValue(domainSource->getId());
-    domainDestination->solveRefInheritance(true);
-  }
-
-  if (domainDstRef.empty()) domainDestination->domain_ref.reset();
-  else domainDestination->domain_ref.setValue(domainDstRef);
-
-  // Now extend domain destination
-  int niGlob = domainSource->ni_glo;
-  CArray<bool,1>& mask_1d_src = domainSource->domainMask;
-  CArray<int,1>& i_index_src = domainSource->i_index;
-  CArray<double,1>& lon_src = domainSource->lonvalue_1d;
-  CArray<double,1>& lat_src = domainSource->latvalue_1d;
-  CArray<double,2>& bounds_lon_src = domainSource->bounds_lon_1d;
-  CArray<double,2>& bounds_lat_src = domainSource->bounds_lat_1d;
-  CArray<int,1>& data_i_index_src = domainSource->data_i_index;
-
-  int oldNbLocal = i_index_src.numElements(), index, globalIndex;
-  // Uncompress data_i_index
-  CArray<int,1> data_i_index_src_full(oldNbLocal);
-  int nbUnMaskedPointOnLocalDomain = 0;
-  data_i_index_src_full = -1; // Suppose all values are masked
-  for (int idx = 0; idx < data_i_index_src.numElements(); ++idx)
-  {
-    int dataIdx = data_i_index_src(idx);
-    if ((0 <= dataIdx) && (dataIdx < oldNbLocal))
-    {
-      data_i_index_src_full(nbUnMaskedPointOnLocalDomain) = dataIdx;
-      ++nbUnMaskedPointOnLocalDomain;
-    }
-  }
-
-  CArray<bool,1>& mask_1d_dst = domainDestination->domainMask;
-  CArray<int,1>& i_index_dst = domainDestination->i_index;
-  CArray<int,1>& j_index_dst = domainDestination->j_index;
-  CArray<double,1>& lon_dst = domainDestination->lonvalue_1d;
-  CArray<double,1>& lat_dst = domainDestination->latvalue_1d;
-  CArray<double,2>& bounds_lon_dst = domainDestination->bounds_lon_1d;
-  CArray<double,2>& bounds_lat_dst = domainDestination->bounds_lat_1d;
-  CArray<int,1>& data_i_index_dst = domainDestination->data_i_index;
-  CArray<int,1>& data_j_index_dst = domainDestination->data_j_index;
-
-  // Resize all array-like attributes of domain destination
-  int nbNeighbor    = neighborsDomainSrc.shape()[1];
-  int newNbLocalDst = nbNeighbor + oldNbLocal;
-  int nVertex       = bounds_lon_dst.shape()[0];
-
-  mask_1d_dst.resizeAndPreserve(newNbLocalDst);
-  i_index_dst.resizeAndPreserve(newNbLocalDst);
-  j_index_dst.resizeAndPreserve(newNbLocalDst);
-  lon_dst.resizeAndPreserve(newNbLocalDst);
-  lat_dst.resizeAndPreserve(newNbLocalDst);
-  bounds_lon_dst.resizeAndPreserve(nVertex, newNbLocalDst);
-  bounds_lat_dst.resizeAndPreserve(nVertex, newNbLocalDst);
-  CArray<int,1> data_i_index_dst_full(newNbLocalDst);
-  data_i_index_dst_full(Range(0,oldNbLocal-1)) = data_i_index_src_full;
-  data_i_index_dst_full(Range(oldNbLocal,newNbLocalDst-1)) = -1;
-
-  // 1. Fill in array relating to global index (i_index, j_index, transmap, etc, ...)
-  // Global index mapping between destination and source
-  this->transformationMapping_.resize(1);
-  this->transformationWeight_.resize(1);
-  TransformationIndexMap& transMap = this->transformationMapping_[0];
-  TransformationWeightMap& transWeight = this->transformationWeight_[0];
-
-  transMap.rehash(std::ceil(newNbLocalDst/transMap.max_load_factor()));
-  transWeight.rehash(std::ceil(newNbLocalDst/transWeight.max_load_factor()));
-  // First, index mapping for local domain
-  for (int idx = 0; idx < oldNbLocal; ++idx)
-  {
-    index = i_index_dst(idx);
-    transMap[index].push_back(index);
-    transWeight[index].push_back(1.0);
-  }
-  // Then, index mapping for extended part
-  for (int idx = 0; idx < nbNeighbor; ++idx)
-  {
-    index = idx + oldNbLocal;
-    globalIndex = neighborsDomainSrc(0,idx);
-    i_index_dst(index) = globalIndex;
-    j_index_dst(index) = 0;
-    transMap[globalIndex].push_back(globalIndex);
-    transWeight[globalIndex].push_back(1.0);
-  }
-
-  // 2. Exchange local info among domains (lon,lat,bounds,mask,etc,...)
-  CClientClientDHTDouble::Index2VectorInfoTypeMap localData;
-  localData.rehash(std::ceil(oldNbLocal/localData.max_load_factor()));
-  // Information exchanged among domains (attention to their order), number in parentheses presents size of data
-  // lon(1) + lat(1) + bounds_lon(nVertex) + bounds_lat(nVertex) + mask(1) + data_i_index(1)
-  int dataPackageSize =  1 + 1 + // lon + lat
-                         nVertex + nVertex + //bounds_lon + bounds_lat
-                         1 + // mask_1d_dst;
-                         1; // data_i_index
-  // Initialize database
-  for (int idx = 0; idx < oldNbLocal; ++idx)
-  {
-    index = i_index_src(idx);
-    localData[index].resize(dataPackageSize);
-    std::vector<double>& data = localData[index];
-
-    //Pack data
-    int dataIdx = 0;
-    data[dataIdx] = lon_src(idx);++dataIdx;
-    data[dataIdx] = lat_src(idx);++dataIdx;
-    for (int i = 0; i < nVertex; ++i)
-    {
-      data[dataIdx] = bounds_lon_src(i,idx); ++dataIdx;
-    }
-    for (int i = 0; i < nVertex; ++i)
-    {
-      data[dataIdx] = bounds_lat_src(i,idx); ++dataIdx;
-    }
-    data[dataIdx] = mask_1d_src(idx) ? 1.0 : -1.0; ++dataIdx;
-    data[dataIdx] = data_i_index_src_full(idx);
-  }
-
-  CClientClientDHTDouble dhtData(localData,client->intraComm);
-  CArray<size_t,1> neighborInd(nbNeighbor);
-  for (int idx = 0; idx < nbNeighbor; ++idx)
-    neighborInd(idx) = neighborsDomainSrc(0,idx);
-
-  // Compute local data on other domains
-  dhtData.computeIndexInfoMapping(neighborInd);
-  CClientClientDHTDouble::Index2VectorInfoTypeMap& neighborData = dhtData.getInfoIndexMap();
-  CClientClientDHTDouble::Index2VectorInfoTypeMap::iterator ite = neighborData.end(), it;
-  // Ok get neighbor data
-  size_t nIdx;
-  int nbUnMaskedPointOnExtendedPart = 0;
-  for (int idx = 0; idx < nbNeighbor; ++idx)
-  {
-    nIdx  = neighborInd(idx);
-    it = neighborData.find(nIdx);
-    if (ite != it)
-    {
-      index = idx + oldNbLocal;
-      std::vector<double>& data = it->second;
-      // Unpack data
-      int dataIdx = 0;
-      lon_dst(index) = data[dataIdx]; ++dataIdx;
-      lat_dst(index) = data[dataIdx]; ++dataIdx;
-      for (int i = 0; i < nVertex; ++i)
-      {
-        bounds_lon_dst(i,index) = data[dataIdx]; ++dataIdx;
-      }
-      for (int i = 0; i < nVertex; ++i)
-      {
-        bounds_lat_dst(i,index) = data[dataIdx]; ++dataIdx;
-      }
-      mask_1d_dst(index) = (1.0 == data[dataIdx]) ? true : false; ++dataIdx;
-      data_i_index_dst_full(index) = (int)(data[dataIdx]);
-      if (0 <= data_i_index_dst_full(index))
-      {
-        data_i_index_dst_full(index) = index;
-        ++nbUnMaskedPointOnExtendedPart;
-      }
-    }
-  }
-
-
-  // Finally, update data_i_index
-  int nbUnMaskedPointOnNewDstDomain = (nbUnMaskedPointOnExtendedPart + nbUnMaskedPointOnLocalDomain);
-  int count = 0, dataIdx;
-  for (int idx = 0; idx < newNbLocalDst; ++idx)
-  {
-    dataIdx = data_i_index_dst_full(idx);
-    if ((0 <= dataIdx))
-    {
-      ++count;
-    }
-  }
-
-  data_i_index_dst.resize(count);
-  data_j_index_dst.resize(count);
-  data_j_index_dst = 0;
-
-  count = 0;
-  for (int idx = 0; idx < newNbLocalDst; ++idx)
-  {
-    dataIdx = data_i_index_dst_full(idx);
-    if ((0 <= dataIdx))
-    {
-      data_i_index_dst(count) = dataIdx;
-      ++count;
-    }
-  }
-
-  // Update ni
-  domainDestination->ni.setValue(newNbLocalDst);
-  domainDestination->mask_1d.resize(domainDestination->domainMask.numElements()) ;
-  domainDestination->mask_1d=domainDestination->domainMask ;
-  domainDestination->computeLocalMask() ;
-}
-CATCH
-
-/*!
-  Compute the index mapping between domain on grid source and one on grid destination
-*/
-void CDomainAlgorithmExpand::computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs)
-{
-
-}
-
-}
Index: XIOS/dev/dev_trunk_graph/src/transformation/domain_algorithm_expand.hpp
===================================================================
--- XIOS/dev/dev_trunk_graph/src/transformation/domain_algorithm_expand.hpp	(revision 2019)
+++ 	(revision )
@@ -1,64 +1,0 @@
-/*!
-   \file domain_algorithm_expand.hpp
-   \author Ha NGUYEN
-   \since 08 Aug 2016
-   \date 08 Aug 2016
-
-   \brief Algorithm for expanding an domain.
- */
-#ifndef __XIOS_DOMAIN_ALGORITHM_EXPAND_HPP__
-#define __XIOS_DOMAIN_ALGORITHM_EXPAND_HPP__
-
-#include "domain_algorithm_transformation.hpp"
-#include "transformation.hpp"
-
-namespace xios {
-class CDomain;
-class CExpandDomain;
-
-/*!
-  \class CDomainAlgorithmExpand
-*/
-class CDomainAlgorithmExpand : public CDomainAlgorithmTransformation
-{
-public:
-  CDomainAlgorithmExpand(CDomain* domainDestination, CDomain* domainSource, CExpandDomain* expandDomain);
-
-  virtual ~CDomainAlgorithmExpand() {}
-
-  static bool registerTrans();
-
-  virtual StdString getName() {return "Domain Trans. Filter \\n Expand";}
-
-protected:
-  bool isXPeriodic_; // Flag to determine the periodicity of expansion (only for rectilinear)
-  bool isYPeriodic_; // Flag to determine the periodicity of expansion (only for rectilinear)
-
-protected:
-  void expandDomainEdgeConnectivity(CDomain* domainDestination, CDomain* domainSource);
-  void expandDomainNodeConnectivity(CDomain* domainDestination, CDomain* domainSource);
-  void updateRectilinearDomainAttributes(CDomain* domainDestination,
-                                         CDomain* domainSource,
-                                         CArray<int,2>& neighborsDomainSrc);
-
-  void updateUnstructuredDomainAttributes(CDomain* domainDestination,
-                                          CDomain* domainSource,
-                                          CArray<int,2>& neighborsDomainSrc);
-
-protected:
-  void computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs);
-
-private:
-  static CGenericAlgorithmTransformation* create(CGrid* gridDst, CGrid* gridSrc,
-                                                CTransformation<CDomain>* transformation,
-                                                int elementPositionInGrid,
-                                                std::map<int, int>& elementPositionInGridSrc2ScalarPosition,
-                                                std::map<int, int>& elementPositionInGridSrc2AxisPosition,
-                                                std::map<int, int>& elementPositionInGridSrc2DomainPosition,
-                                                std::map<int, int>& elementPositionInGridDst2ScalarPosition,
-                                                std::map<int, int>& elementPositionInGridDst2AxisPosition,
-                                                std::map<int, int>& elementPositionInGridDst2DomainPosition);
-};
-
-}
-#endif // __XIOS_DOMAIN_ALGORITHM_EXPAND_HPP__
Index: XIOS/dev/dev_trunk_graph/src/transformation/domain_algorithm_extract.cpp
===================================================================
--- XIOS/dev/dev_trunk_graph/src/transformation/domain_algorithm_extract.cpp	(revision 2019)
+++ 	(revision )
@@ -1,237 +1,0 @@
-#include "domain_algorithm_extract.hpp"
-#include "extract_domain.hpp"
-#include "domain.hpp"
-#include "grid.hpp"
-#include "grid_transformation_factory_impl.hpp"
-#include "attribute_template.hpp"
-
-namespace xios {
-CGenericAlgorithmTransformation* CDomainAlgorithmExtract::create(CGrid* gridDst, CGrid* gridSrc,
-                                                             CTransformation<CDomain>* transformation,
-                                                             int elementPositionInGrid,
-                                                             std::map<int, int>& elementPositionInGridSrc2ScalarPosition,
-                                                             std::map<int, int>& elementPositionInGridSrc2AxisPosition,
-                                                             std::map<int, int>& elementPositionInGridSrc2DomainPosition,
-                                                             std::map<int, int>& elementPositionInGridDst2ScalarPosition,
-                                                             std::map<int, int>& elementPositionInGridDst2AxisPosition,
-                                                             std::map<int, int>& elementPositionInGridDst2DomainPosition)
-TRY
-{
-  std::vector<CDomain*> domainListDestP = gridDst->getDomains();
-  std::vector<CDomain*> domainListSrcP  = gridSrc->getDomains();
-
-  CExtractDomain* extractDomain = dynamic_cast<CExtractDomain*> (transformation);
-  int domainDstIndex = elementPositionInGridDst2DomainPosition[elementPositionInGrid];
-  int domainSrcIndex = elementPositionInGridSrc2DomainPosition[elementPositionInGrid];
-
-  return (new CDomainAlgorithmExtract(domainListDestP[domainDstIndex], domainListSrcP[domainSrcIndex], extractDomain));
-}
-CATCH
-
-bool CDomainAlgorithmExtract::registerTrans()
-TRY
-{
-  CGridTransformationFactory<CDomain>::registerTransformation(TRANS_EXTRACT_DOMAIN, create);
-}
-CATCH
-
-CDomainAlgorithmExtract::CDomainAlgorithmExtract(CDomain* domainDestination, CDomain* domainSource, CExtractDomain* extractDomain)
-: CDomainAlgorithmTransformation(domainDestination, domainSource)
-TRY
-{
-  extractDomain->checkValid(domainSource);
-  extractIBegin_ = extractDomain->ibegin.getValue();
-  extractJBegin_ = extractDomain->jbegin.getValue();
-
-  extractNi_  = extractDomain->ni.getValue();
-  extractNj_  = extractDomain->nj.getValue();
-
-  extractIEnd_ = extractIBegin_ + extractNi_ - 1;
-  extractJEnd_ = extractJBegin_ + extractNj_ - 1;
-
-  if (extractNi_ > domainSource->ni_glo.getValue())
-  {
-    ERROR("CDomainAlgorithmExtract::CDomainAlgorithmExtract(CDomain* domainDestination, CDomain* domainSource, CExtractDomain* extractDomain)",
-           << "Extract size is greater than size of domain source"
-           << "Size ni_glo of domain source " <<domainSource->getId() << " is " << domainSource->ni_glo.getValue()  << std::endl
-           << "Extract size is " << extractNi_ );
-  }
-
-  if (extractNj_ > domainSource->nj_glo.getValue())
-  {
-    ERROR("CDomainAlgorithmExtract::CDomainAlgorithmExtract(CDomain* domainDestination, CDomain* domainSource, CExtractDomain* extractDomain)",
-           << "Extract size is greater than size of domain source"
-           << "Size nj_glo of domain source " <<domainSource->getId() << " is " << domainSource->nj_glo.getValue()  << std::endl
-           << "Extract size is " << extractNj_ );
-  }
-
-  // Calculate the size of local domain
-  int ind, indLocSrc, indLocDest, iIdxSrc, jIdxSrc, destIBegin = -1, destJBegin = -1, niDest = 0, njDest = 0, ibeginDest, jbeginDest ;
-  int indGloDest, indGloSrc, niGloSrc = domainSrc_->ni_glo, iSrc, jSrc;
-  for (int j = 0; j < domainSrc_->nj.getValue(); j++)
-  {
-    for (int i = 0; i < domainSrc_->ni.getValue(); i++)
-    {
-      ind = j*domainSrc_->ni + i;
-      iIdxSrc = domainSrc_->i_index(ind);
-      if ((iIdxSrc >= extractIBegin_) && (iIdxSrc <= extractIEnd_))
-      {
-        jIdxSrc = domainSrc_->j_index(ind);
-        if ((jIdxSrc >= extractJBegin_) && (jIdxSrc <= extractJEnd_))
-        {
-          if ((niDest == 0) && (njDest == 0))
-          {
-            destIBegin = i;
-            destJBegin = j;
-          }
-          if (i == destIBegin) ++njDest;
-        }
-        if (j == destJBegin) ++niDest;
-
-      }
-    }
-  }
-  ibeginDest = destIBegin + domainSrc_->ibegin - extractIBegin_;
-  jbeginDest = destJBegin + domainSrc_->jbegin - extractJBegin_;
-  domainDest_->ni_glo.setValue(extractNi_);
-  domainDest_->nj_glo.setValue(extractNj_);
-  domainDest_->ni.setValue(niDest);
-  domainDest_->nj.setValue(njDest);
-  domainDest_->ibegin.setValue(ibeginDest);
-  domainDest_->jbegin.setValue(jbeginDest);
-  domainDest_->i_index.resize(niDest*njDest);
-  domainDest_->j_index.resize(niDest*njDest);
-
-  domainDest_->data_ni.setValue(niDest);
-  domainDest_->data_nj.setValue(njDest);
-  domainDest_->data_ibegin.setValue(0);  // local position
-  domainDest_->data_jbegin.setValue(0);  // local position
-  domainDest_->data_i_index.resize(niDest*njDest); // local position
-  domainDest_->data_j_index.resize(niDest*njDest); // local position
-
-  domainDest_->domainMask.resize(niDest*njDest);
-
-  if (!domainSrc_->lonvalue_1d.isEmpty())
-  {
-    if (domainDest_->type == CDomain::type_attr::rectilinear)
-    {
-      domainDest_->lonvalue_1d.resize(niDest);
-      domainDest_->latvalue_1d.resize(njDest);
-    }
-    else if (domainDest_->type == CDomain::type_attr::unstructured)
-    {
-      domainDest_->lonvalue_1d.resize(niDest);
-      domainDest_->latvalue_1d.resize(niDest);
-    }
-  }
-  else if (!domainSrc_->lonvalue_2d.isEmpty())
-  {
-    domainDest_->lonvalue_2d.resize(niDest,njDest);
-    domainDest_->latvalue_2d.resize(niDest,njDest);
-  }
-
-  if (domainSrc_->hasBounds)
-  {
-    if (!domainSrc_->bounds_lon_2d.isEmpty())
-    {
-      domainDest_->bounds_lon_2d.resize(domainDest_->nvertex, niDest, njDest);
-      domainDest_->bounds_lon_2d.resize(domainDest_->nvertex, niDest, njDest);
-    }
-    else if (!domainSrc_->bounds_lon_1d.isEmpty())
-    {
-      domainDest_->bounds_lon_1d.resize(domainDest_->nvertex, niDest);
-      domainDest_->bounds_lon_1d.resize(domainDest_->nvertex, niDest);
-    }
-  }
-  if (domainSrc_->hasArea) domainDest_->area.resize(niDest,njDest);
-
-  this->transformationMapping_.resize(1);
-  this->transformationWeight_.resize(1);
-  TransformationIndexMap& transMap = this->transformationMapping_[0];
-  TransformationWeightMap& transWeight = this->transformationWeight_[0];
-
-  for (int iDest = 0; iDest < niDest; iDest++)
-  {
-    iSrc = iDest + destIBegin;
-    for (int jDest = 0; jDest < njDest; jDest++)
-    {
-      jSrc = jDest + destJBegin;
-      ind = jSrc * domainSrc_->ni + iSrc;
-      iIdxSrc = domainSrc_->i_index(ind);
-      jIdxSrc = domainSrc_->j_index(ind);
-      indLocDest = jDest*niDest + iDest;
-      indGloDest = (jDest + jbeginDest)*extractNi_ + (iDest + ibeginDest);
-      indLocSrc = (jDest+destJBegin)*domainSrc_->ni + (iDest+destIBegin);
-      indGloSrc = (jIdxSrc )* niGloSrc + iIdxSrc;
-      domainDest_->i_index(indLocDest) = iDest + ibeginDest;                                             // i_index contains global positions
-      domainDest_->j_index(indLocDest) = jDest + jbeginDest;                                             // i_index contains global positions
-      domainDest_->data_i_index(indLocDest) = (domainSrc_->data_dim == 1) ? indLocDest : iDest;          // data_i_index contains local positions
-      domainDest_->data_j_index(indLocDest) = (domainSrc_->data_dim == 1) ? 0 :jDest;                    // data_i_index contains local positions
-      domainDest_->domainMask(indLocDest) = domainSrc_->domainMask(indLocSrc);
-
-      if (domainSrc_->hasArea)
-        domainDest_->area(iDest,jDest) = domainSrc_->area(iSrc,jSrc);
-
-      if (domainSrc_->hasBounds)
-      {
-        if (!domainSrc_->bounds_lon_2d.isEmpty())
-        {
-          for (int n = 0; n < domainSrc_->nvertex; ++n)
-          {
-            domainDest_->bounds_lon_2d(n,iDest,jDest) = domainSrc_->bounds_lon_2d(n,iSrc,jSrc);
-            domainDest_->bounds_lat_2d(n,iDest,jDest) = domainSrc_->bounds_lat_2d(n,iSrc,jSrc);
-          }
-        }
-        else if (!domainSrc_->bounds_lon_1d.isEmpty())
-        {
-          for (int n = 0; n < domainSrc_->nvertex; ++n)
-          {
-            domainDest_->bounds_lon_1d(n,iDest) = domainSrc_->bounds_lon_1d(n,iSrc);
-            domainDest_->bounds_lat_1d(n,iDest) = domainSrc_->bounds_lat_1d(n,iSrc);
-          }
-        }
-      }
-
-      if (domainSrc_->hasLonLat)
-      {
-        if (domainDest_->type == CDomain::type_attr::rectilinear)
-        {
-          domainDest_->latvalue_1d(jDest) = domainSrc_->latvalue_1d(jSrc);
-        }
-        else if (domainDest_->type == CDomain::type_attr::curvilinear)
-        {
-          domainDest_->lonvalue_2d(iDest,jDest) = domainSrc_->lonvalue_2d(iSrc,jSrc);
-          domainDest_->latvalue_2d(iDest,jDest) = domainSrc_->latvalue_2d(iSrc,jSrc);
-        }
-      }
-
-      transMap[indGloDest].push_back(indGloSrc);
-      transWeight[indGloDest].push_back(1.0);
-
-    }
-    if (domainSrc_->hasLonLat)
-    {
-      if (domainDest_->type == CDomain::type_attr::unstructured)
-      {
-        domainDest_->lonvalue_1d(iDest) = domainSrc_->lonvalue_1d(iSrc);
-        domainDest_->latvalue_1d(iDest) = domainSrc_->latvalue_1d(iSrc);
-      }
-      else if (domainDest_->type == CDomain::type_attr::rectilinear)
-      {
-        domainDest_->lonvalue_1d(iDest) = domainSrc_->lonvalue_1d(iSrc);
-      }
-    }
-  }
-
-}
-CATCH
-
-/*!
-  Compute the index mapping between domain on grid source and one on grid destination
-*/
-void CDomainAlgorithmExtract::computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs)
-{
-}
-
-
-}
Index: XIOS/dev/dev_trunk_graph/src/transformation/domain_algorithm_extract.hpp
===================================================================
--- XIOS/dev/dev_trunk_graph/src/transformation/domain_algorithm_extract.hpp	(revision 2019)
+++ 	(revision )
@@ -1,61 +1,0 @@
-
-#ifndef __XIOS_DOMAIN_ALGORITHM_EXTRACT_HPP__
-#define __XIOS_DOMAIN_ALGORITHM_EXTRACT_HPP__
-
-#include "domain_algorithm_transformation.hpp"
-#include "transformation.hpp"
-
-namespace xios {
-
-class CDomain;
-class CExtractDomain;
-
-/*!
-  \class CDomainAlgorithmExtract
-  Implementing extract (alternative zoom) on domain
-*/
-class CDomainAlgorithmExtract : public CDomainAlgorithmTransformation
-{
-public:
-  CDomainAlgorithmExtract(CDomain* domainDestination, CDomain* domainSource, CExtractDomain* extractDomain);
-
-  virtual ~CDomainAlgorithmExtract() {}
-
-  static bool registerTrans();
-
-  virtual StdString getName() {return "Domain Trans. Filter \\n Extract";}
-protected:
-  void updateDomainAttributes();
-  void computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs);
-
-private:
-  void updateExtract();
-
-private:
-  //! Global extract begin on domain
-  int extractIBegin_;
-  int extractJBegin_;
-
-  //! Global extract end on domain
-  int extractIEnd_;
-  int extractJEnd_;
-
-  //! Global extract size on domain
-  int extractNi_;
-  int extractNj_;
-
-private:
-
-  static CGenericAlgorithmTransformation* create(CGrid* gridDst, CGrid* gridSrc,
-                                                CTransformation<CDomain>* transformation,
-                                                int elementPositionInGrid,
-                                                std::map<int, int>& elementPositionInGridSrc2ScalarPosition,
-                                                std::map<int, int>& elementPositionInGridSrc2AxisPosition,
-                                                std::map<int, int>& elementPositionInGridSrc2DomainPosition,
-                                                std::map<int, int>& elementPositionInGridDst2ScalarPosition,
-                                                std::map<int, int>& elementPositionInGridDst2AxisPosition,
-                                                std::map<int, int>& elementPositionInGridDst2DomainPosition);
-};
-
-}
-#endif // __XIOS_DOMAIN_ALGORITHM_EXTRACT_HPP__
Index: XIOS/dev/dev_trunk_graph/src/transformation/domain_algorithm_generate_rectilinear.cpp
===================================================================
--- XIOS/dev/dev_trunk_graph/src/transformation/domain_algorithm_generate_rectilinear.cpp	(revision 2019)
+++ 	(revision )
@@ -1,141 +1,0 @@
-/*!
-   \file domain_algorithm_generate_rectilinear.cpp
-   \author Ha NGUYEN
-   \since 31 Aug 2015
-   \date 31 Aug 2015
-
-   \brief Algorithm for automatic generation of rectilinear domain.
- */
-#include "domain_algorithm_generate_rectilinear.hpp"
-#include "grid.hpp"
-#include "domain.hpp"
-#include "context.hpp"
-#include "context_client.hpp"
-#include "generate_rectilinear_domain.hpp"
-
-namespace xios {
-
-CDomainAlgorithmGenerateRectilinear::CDomainAlgorithmGenerateRectilinear(CDomain* domainDestination, CDomain* domainSource,
-                                                                         CGrid* gridDest, CGrid* gridSource,
-                                                                         CGenerateRectilinearDomain* genRectDomain)
-: CDomainAlgorithmTransformation(domainDestination, domainSource), nbDomainDistributedPart_(0)
-TRY
-{
-  type_ = ELEMENT_GENERATION;
-  genRectDomain->checkValid(domainDestination);
-  if (0 != gridSource) computeDistributionGridSource(gridSource);
-  else
-  {
-    computeDistributionGridDestination(gridDest);
-  }
-  fillInAttributesDomainDestination();
-}
-CATCH
-
-/*!
-  Compute the index mapping between domain on grid source and one on grid destination
-*/
-void CDomainAlgorithmGenerateRectilinear::computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs)
-{
- /* Nothing to do */
-}
-
-/*!
-  Calculate the number of distributed parts on domain source
-*/
-void CDomainAlgorithmGenerateRectilinear::computeDistributionGridSource(CGrid* gridSrc)
-TRY
-{
-  CContext* context = CContext::getCurrent();
-  CContextClient* client = context->client;
-
-  std::vector<CDomain*> domListSrcP = gridSrc->getDomains();
-  std::vector<CAxis*> axisListSrcP = gridSrc->getAxis();
-
-  for (int i = 0; i < domListSrcP.size(); ++i) // support we have only domain, more than one, for now, dont know how to process
-  {
-    // First, find (roundly) distribution of associated axis (if any)
-    if (axisListSrcP.empty()) nbDomainDistributedPart_ = client->clientSize;
-    else
-    {
-      gridSrc->solveAxisRef(false);
-      int nbAxis = axisListSrcP.size();
-      std::vector<int> nbLocalAxis(nbAxis, 0);
-      for (int j = 0; j < nbAxis; ++j)
-      {
-        std::vector<int> globalAxisIndex(axisListSrcP[j]->n);
-        for (int idx = 0; idx < axisListSrcP[j]->n; ++idx)
-          globalAxisIndex[idx] = axisListSrcP[j]->begin + idx;
-        HashXIOS<int> hashFunc;
-        StdSize hashValue = hashFunc.hashVec(globalAxisIndex);
-        std::vector<StdSize> recvBuff(client->clientSize);
-        MPI_Gather(&hashValue, 1, MPI_UNSIGNED_LONG,
-                   &recvBuff[0], 1, MPI_UNSIGNED_LONG,
-                   0,
-                   client->intraComm);
-        if (0 == client->clientRank)
-        {
-          std::set<StdSize> setTmp;
-          for (int k = 0; k < recvBuff.size(); ++k)
-          {
-            if (setTmp.end() == setTmp.find(recvBuff[k]))
-            {
-              ++nbLocalAxis[j];
-              setTmp.insert(recvBuff[k]);
-            }
-          }
-        }
-
-        MPI_Bcast(&nbLocalAxis[0], nbAxis, MPI_INT,
-                  0, client->intraComm);
-      }
-
-      int nbAxisDistributedPart = 1;
-      for (int j = 0; j < nbAxis; ++j) nbAxisDistributedPart *= nbLocalAxis[j];
-      nbDomainDistributedPart_ = client->clientSize/nbAxisDistributedPart;
-    }
-  }
-}
-CATCH
-
-/*!
-  Compute the distribution of the domain destination by using available information provided by user such as n_distributed_partition of axis
-*/
-void CDomainAlgorithmGenerateRectilinear::computeDistributionGridDestination(CGrid* gridDest)
-TRY
-{
-  // For now, just suppose that the grid contains only one domain
-  std::vector<CAxis*> axisListDestP = gridDest->getAxis();
-  int nbPartition = 1, idx = 0;
-  for (int i = 0; i < gridDest->axis_domain_order.numElements(); ++i)
-  {
-    if (false == (gridDest->axis_domain_order)(i))
-    {
-      nbPartition *= (axisListDestP[idx]->n_distributed_partition.isEmpty()) ? 1: (axisListDestP[idx]->n_distributed_partition.getValue());
-      ++idx;
-    }
-  }
-
-  CContext* context = CContext::getCurrent();
-  CContextClient* client = context->client;
-  int modPart = (client->clientSize) % nbPartition;
-  if (0 != modPart)
-    ERROR("CDomainAlgorithmGenerateRectilinear::computeDistributionGridDestination(CGrid* gridDest)",
-       << "The grid " <<gridDest->getId() << " is not well-distributed. There is an incompatibility between distribution of axis and domain.");
-  nbDomainDistributedPart_ = client->clientSize/nbPartition;
-
-}
-CATCH
-
-/*!
-  Fill in all necessary attributes of domain destination and their values
-*/
-void CDomainAlgorithmGenerateRectilinear::fillInAttributesDomainDestination()
-TRY
-{
-  if (!domainDest_->distributionAttributesHaveValue())
-    domainDest_->redistribute(nbDomainDistributedPart_);
-  domainDest_->fillInLonLat();
-}
-CATCH
-}
Index: XIOS/dev/dev_trunk_graph/src/transformation/domain_algorithm_generate_rectilinear.hpp
===================================================================
--- XIOS/dev/dev_trunk_graph/src/transformation/domain_algorithm_generate_rectilinear.hpp	(revision 2019)
+++ 	(revision )
@@ -1,51 +1,0 @@
-/*!
-   \file domain_algorithm_generate_rectilinear.hpp
-   \author Ha NGUYEN
-   \since 31 Aug 2015
-   \date 01 Sep 2015
-
-   \brief Algorithm for automatic generation of rectilinear domain.
- */
-#ifndef __XIOS_DOMAIN_ALGORITHM_GENERATE_RECTILINEAR_HPP__
-#define __XIOS_DOMAIN_ALGORITHM_GENERATE_RECTILINEAR_HPP__
-
-#include "domain_algorithm_transformation.hpp"
-
-namespace xios {
-
-class CGrid;
-class CDomain;
-class CGenerateRectilinearDomain;
-
-/*!
-  \class CDomainAlgorithmGenerateRectilinear
-  Generate a rectilinear or CURVILINEAR domain and fill in necessary its attributes automatically
-  A new rectilinear (or CURVILINEAR) domain will also be distributed automatically among the processes.
-  The number of processes is deduced from the distribution of the grid source.
-*/
-class CDomainAlgorithmGenerateRectilinear : public CDomainAlgorithmTransformation
-{
-public:
-  CDomainAlgorithmGenerateRectilinear(CDomain* domainDestination, CDomain* domainSource,
-                                      CGrid* gridDest, CGrid* gridSource,
-                                      CGenerateRectilinearDomain* zoomDomain);
-
-  virtual ~CDomainAlgorithmGenerateRectilinear() {}
-
-  virtual StdString getName() {return "Domain Trans. Filter \\n Generate Rectilinear";}
-
-protected:
-  void computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs);
-
-private:
-  void computeDistributionGridSource(CGrid* gridSrc);
-  void computeDistributionGridDestination(CGrid* gridDest);
-  void fillInAttributesDomainDestination();
-
-private:
-  int nbDomainDistributedPart_; //! Number of local domain.
-
-};
-
-}
-#endif // __XIOS_DOMAIN_ALGORITHM_GENERATE_RECTILINEAR_HPP__
Index: XIOS/dev/dev_trunk_graph/src/transformation/domain_algorithm_interpolate.cpp
===================================================================
--- XIOS/dev/dev_trunk_graph/src/transformation/domain_algorithm_interpolate.cpp	(revision 2019)
+++ 	(revision )
@@ -1,1024 +1,0 @@
-/*!
-   \file domain_algorithm_interpolate_from_file.cpp
-   \author Ha NGUYEN
-   \since 09 Jul 2015
-   \date 15 Sep 2015
-
-   \brief Algorithm for interpolation on a domain.
- */
-#include "domain_algorithm_interpolate.hpp"
-#include <unordered_map>
-#include "context.hpp"
-#include "context_client.hpp"
-#include "distribution_client.hpp"
-#include "client_server_mapping_distributed.hpp"
-#include "netcdf.hpp"
-#include "mapper.hpp"
-#include "mpi_tag.hpp"
-#include "domain.hpp"
-#include "grid_transformation_factory_impl.hpp"
-#include "interpolate_domain.hpp"
-#include "grid.hpp"
-
-namespace xios {
-CGenericAlgorithmTransformation* CDomainAlgorithmInterpolate::create(CGrid* gridDst, CGrid* gridSrc,
-                                                                     CTransformation<CDomain>* transformation,
-                                                                     int elementPositionInGrid,
-                                                                     std::map<int, int>& elementPositionInGridSrc2ScalarPosition,
-                                                                     std::map<int, int>& elementPositionInGridSrc2AxisPosition,
-                                                                     std::map<int, int>& elementPositionInGridSrc2DomainPosition,
-                                                                     std::map<int, int>& elementPositionInGridDst2ScalarPosition,
-                                                                     std::map<int, int>& elementPositionInGridDst2AxisPosition,
-                                                                     std::map<int, int>& elementPositionInGridDst2DomainPosition)
-TRY
-{
-  std::vector<CDomain*> domainListDestP = gridDst->getDomains();
-  std::vector<CDomain*> domainListSrcP  = gridSrc->getDomains();
-
-  CInterpolateDomain* interpolateDomain = dynamic_cast<CInterpolateDomain*> (transformation);
-  int domainDstIndex = elementPositionInGridDst2DomainPosition[elementPositionInGrid];
-  int domainSrcIndex = elementPositionInGridSrc2DomainPosition[elementPositionInGrid];
-
-  return (new CDomainAlgorithmInterpolate(domainListDestP[domainDstIndex], domainListSrcP[domainSrcIndex], interpolateDomain));
-}
-CATCH
-
-bool CDomainAlgorithmInterpolate::registerTrans()
-TRY
-{
-  CGridTransformationFactory<CDomain>::registerTransformation(TRANS_INTERPOLATE_DOMAIN, create);
-}
-CATCH
-
-CDomainAlgorithmInterpolate::CDomainAlgorithmInterpolate(CDomain* domainDestination, CDomain* domainSource, CInterpolateDomain* interpDomain)
-: CDomainAlgorithmTransformation(domainDestination, domainSource), interpDomain_(interpDomain), writeToFile_(false), readFromFile_(false)
-TRY
-{
-  CContext* context = CContext::getCurrent();
-  interpDomain_->checkValid(domainSource);
-
-  detectMissingValue = interpDomain_->detect_missing_value ;
-  renormalize = interpDomain_->renormalize ;
-  quantity = interpDomain_->quantity ;
-
-  if (interpDomain_->read_write_convention == CInterpolateDomain::read_write_convention_attr::fortran) fortranConvention=true ;
-  else fortranConvention=false ;
-  
-  fileToReadWrite_ = "xios_interpolation_weights_";
-
-  if (interpDomain_->weight_filename.isEmpty())
-  {
-    fileToReadWrite_ += context->getId() + "_" + 
-                    domainSource->getDomainOutputName() + "_" + 
-                    domainDestination->getDomainOutputName() + ".nc";    
-  }
-  else 
-    fileToReadWrite_ = interpDomain_->weight_filename;
-
-  ifstream f(fileToReadWrite_.c_str());  
-  switch (interpDomain_->mode)
-  {
-    case CInterpolateDomain::mode_attr::read:
-      readFromFile_ = true;      
-      break;
-    case CInterpolateDomain::mode_attr::compute:
-      readFromFile_ = false;
-      break;
-    case CInterpolateDomain::mode_attr::read_or_compute:      
-      if (!f.good())
-        readFromFile_ = false;
-      else
-        readFromFile_ = true;
-      break;
-    default:
-      break;
-  } 
-
-  writeToFile_ = interpDomain_->write_weight;  
-    
-}
-CATCH
-
-/*!
-  Compute remap with integrated remap calculation module
-*/
-void CDomainAlgorithmInterpolate::computeRemap()
-TRY
-{
-  using namespace sphereRemap;
-
-  CContext* context = CContext::getCurrent();
-  CContextClient* client=context->client;
-  int clientRank = client->clientRank;
-  int i, j, k, idx;
-  std::vector<double> srcPole(3,0), dstPole(3,0);
-  int orderInterp = interpDomain_->order.getValue();
-
-
-  const double poleValue = 90.0;
-  const int constNVertex = 4; // Value by default number of vertex for rectangular domain
-  int nVertexSrc, nVertexDest;
-  nVertexSrc = nVertexDest = constNVertex;
-
-  // First of all, try to retrieve the boundary values of domain source and domain destination
-  int localDomainSrcSize = domainSrc_->i_index.numElements();
-  int niSrc = domainSrc_->ni.getValue(), njSrc = domainSrc_->nj.getValue();
-  bool hasBoundSrc = domainSrc_->hasBounds;
-  if (hasBoundSrc) nVertexSrc = domainSrc_->nvertex.getValue();
-  CArray<double,2> boundsLonSrc(nVertexSrc,localDomainSrcSize);
-  CArray<double,2> boundsLatSrc(nVertexSrc,localDomainSrcSize);
-
-  if (domainSrc_->hasPole) srcPole[2] = 1;
-  if (hasBoundSrc)  // Suppose that domain source is curvilinear or unstructured
-  {
-    if (!domainSrc_->bounds_lon_2d.isEmpty())
-    {
-      for (j = 0; j < njSrc; ++j)
-        for (i = 0; i < niSrc; ++i)
-        {
-          k=j*niSrc+i;
-          for(int n=0;n<nVertexSrc;++n)
-          {
-            boundsLonSrc(n,k) = domainSrc_->bounds_lon_2d(n,i,j);
-            boundsLatSrc(n,k) = domainSrc_->bounds_lat_2d(n,i,j);
-          }
-        }
-    }
-    else
-    {
-      boundsLonSrc = domainSrc_->bounds_lon_1d;
-      boundsLatSrc = domainSrc_->bounds_lat_1d;
-    }
-  }
-  else // if domain source is rectilinear, not do anything now
-  {
-    CArray<double,1> lon_g ;
-    CArray<double,1> lat_g ;
-
-    if (!domainSrc_->lonvalue_1d.isEmpty() && !domainSrc_->latvalue_1d.isEmpty())
-    {
-      domainSrc_->AllgatherRectilinearLonLat(domainSrc_->lonvalue_1d,domainSrc_->latvalue_1d, lon_g,lat_g) ;
-    }
-    else if (! domainSrc_->latvalue_rectilinear_read_from_file.isEmpty() && ! domainSrc_->lonvalue_rectilinear_read_from_file.isEmpty() )
-    {
-      lat_g=domainSrc_->latvalue_rectilinear_read_from_file ;
-      lon_g=domainSrc_->lonvalue_rectilinear_read_from_file ;
-    }
-    else if (!domainSrc_->lon_start.isEmpty() && !domainSrc_->lon_end.isEmpty() &&
-             !domainSrc_->lat_start.isEmpty() && !domainSrc_->lat_end.isEmpty())
-    {
-      double step=(domainSrc_->lon_end-domainSrc_->lon_start)/domainSrc_->ni_glo ;
-      for (int i=0; i<domainSrc_->ni_glo; ++i) lon_g(i)=domainSrc_->lon_start+i*step ;
-      step=(domainSrc_->lat_end-domainSrc_->lat_start)/domainSrc_->nj_glo ;
-      for (int i=0; i<domainSrc_->ni_glo; ++i) lat_g(i)=domainSrc_->lat_start+i*step ;
-    }
-    else ERROR("void CDomainAlgorithmInterpolate::computeRemap()",<<"Cannot compute bounds for rectilinear domain") ;
-
-    nVertexSrc = constNVertex;
-    domainSrc_->fillInRectilinearBoundLonLat(lon_g,lat_g, boundsLonSrc, boundsLatSrc);
-  }
-
-  std::map<int,std::vector<std::pair<int,double> > > interpMapValueNorthPole;
-  std::map<int,std::vector<std::pair<int,double> > > interpMapValueSouthPole;
-
-  int localDomainDestSize = domainDest_->i_index.numElements();
-  int niDest = domainDest_->ni.getValue(), njDest = domainDest_->nj.getValue();
-  bool hasBoundDest = domainDest_->hasBounds;
-  if (hasBoundDest) nVertexDest = domainDest_->nvertex.getValue();
-  CArray<double,2> boundsLonDest(nVertexDest,localDomainDestSize);
-  CArray<double,2> boundsLatDest(nVertexDest,localDomainDestSize);
-
-  if (domainDest_->hasPole) dstPole[2] = 1;
-  if (hasBoundDest)
-  {
-    if (!domainDest_->bounds_lon_2d.isEmpty())
-    {
-      for (j = 0; j < njDest; ++j)
-        for (i = 0; i < niDest; ++i)
-        {
-          k=j*niDest+i;
-          for(int n=0;n<nVertexDest;++n)
-          {
-            boundsLonDest(n,k) = domainDest_->bounds_lon_2d(n,i,j);
-            boundsLatDest(n,k) = domainDest_->bounds_lat_2d(n,i,j);
-          }
-        }
-    }
-    else
-    {
-      boundsLonDest = domainDest_->bounds_lon_1d;
-      boundsLatDest = domainDest_->bounds_lat_1d;
-    }
-  }
-  else
-  {
-    bool isNorthPole = false;
-    bool isSouthPole = false;
-
-    CArray<double,1> lon_g ;
-    CArray<double,1> lat_g ;
-
-    if (!domainDest_->lonvalue_1d.isEmpty() && !domainDest_->latvalue_1d.isEmpty())
-    {
-      domainDest_->AllgatherRectilinearLonLat(domainDest_->lonvalue_1d,domainDest_->latvalue_1d, lon_g,lat_g) ;
-    }
-    else if (! domainDest_->latvalue_rectilinear_read_from_file.isEmpty() && ! domainDest_->lonvalue_rectilinear_read_from_file.isEmpty() )
-    {
-      lat_g=domainDest_->latvalue_rectilinear_read_from_file ;
-      lon_g=domainDest_->lonvalue_rectilinear_read_from_file ;
-    }
-    else if (!domainDest_->lon_start.isEmpty() && !domainDest_->lon_end.isEmpty() &&
-             !domainDest_->lat_start.isEmpty() && !domainDest_->lat_end.isEmpty())
-    {
-      double step=(domainDest_->lon_end-domainDest_->lon_start)/domainDest_->ni_glo ;
-      for(int i=0; i<domainDest_->ni_glo; ++i) lon_g(i)=domainDest_->lon_start+i*step ;
-      step=(domainDest_->lat_end-domainDest_->lat_start)/domainDest_->nj_glo ;
-      for(int i=0; i<domainDest_->ni_glo; ++i) lat_g(i)=domainDest_->lat_start+i*step ;
-    }
-    else ERROR("void CDomainAlgorithmInterpolate::computeRemap()",<<"Cannot compute bounds for rectilinear domain") ;
-    
-    if (std::abs(poleValue - std::abs(lat_g(0))) < NumTraits<double>::epsilon()) isNorthPole = true;
-    if (std::abs(poleValue - std::abs(lat_g(domainDest_->nj_glo-1))) < NumTraits<double>::epsilon()) isSouthPole = true;
-
-
-
-
-    if (isNorthPole && (0 == domainDest_->jbegin.getValue()))
-    {
-      int ibegin = domainDest_->ibegin.getValue();
-      for (i = 0; i < niDest; ++i)
-      {
-        interpMapValueNorthPole[i+ibegin];
-      }
-    }
-
-    if (isSouthPole && (domainDest_->nj_glo.getValue() == (domainDest_->jbegin.getValue() + njDest)))
-    {
-      int ibegin = domainDest_->ibegin.getValue();
-      int njGlo = domainDest_->nj_glo.getValue();
-      int niGlo = domainDest_->ni_glo.getValue();
-      for (i = 0; i < niDest; ++i)
-      {
-        k = (njGlo - 1)*niGlo + i + ibegin;
-        interpMapValueSouthPole[k];
-      }
-    }
-
-    // Ok, fill in boundary values for rectangular domain
-    nVertexDest = constNVertex;
-    domainDest_->fillInRectilinearBoundLonLat(lon_g,lat_g, boundsLonDest, boundsLatDest);
-  }
-
-
-
-  // Ok, now use mapper to calculate
-  int nSrcLocal = domainSrc_->i_index.numElements();
-  int nDstLocal = domainDest_->i_index.numElements();
-  long int * globalSrc = new long int [nSrcLocal];
-  long int * globalDst = new long int [nDstLocal];
-
-  long int globalIndex;
-  int i_ind, j_ind;
-  for (int idx = 0; idx < nSrcLocal; ++idx)
-  {
-    i_ind=domainSrc_->i_index(idx) ;
-    j_ind=domainSrc_->j_index(idx) ;
-
-    globalIndex = i_ind + j_ind * domainSrc_->ni_glo;
-    globalSrc[idx] = globalIndex;
-  }
-
-  for (int idx = 0; idx < nDstLocal; ++idx)
-  {
-    i_ind=domainDest_->i_index(idx) ;
-    j_ind=domainDest_->j_index(idx) ;
-
-    globalIndex = i_ind + j_ind * domainDest_->ni_glo;
-    globalDst[idx] = globalIndex;
-  }
-
-
-  // Calculate weight index
-  Mapper mapper(client->intraComm);
-  mapper.setVerbosity(PROGRESS) ;
-
-     
-  // supress masked data for the source
-  int nSrcLocalUnmasked = 0 ;
-  for (int idx=0 ; idx < nSrcLocal; idx++) if (domainSrc_->localMask(idx)) ++nSrcLocalUnmasked ;
-
-
-  CArray<double,2> boundsLonSrcUnmasked(nVertexSrc,nSrcLocalUnmasked);
-  CArray<double,2> boundsLatSrcUnmasked(nVertexSrc,nSrcLocalUnmasked);
-  CArray<double,1> areaSrcUnmasked(nSrcLocalUnmasked);
-  
-  long int * globalSrcUnmasked = new long int [nSrcLocalUnmasked];
-
-  nSrcLocalUnmasked=0 ;
-  bool hasSrcArea=domainSrc_->hasArea && !domainSrc_->radius.isEmpty() && !interpDomain_->use_area.isEmpty() && interpDomain_->use_area==true  ;
-  double srcAreaFactor ;
-  if (hasSrcArea) srcAreaFactor=1./(domainSrc_->radius*domainSrc_->radius) ;
-  
-  for (int idx=0 ; idx < nSrcLocal; idx++)
-  {
-    if (domainSrc_->localMask(idx))
-    {
-      for(int n=0;n<nVertexSrc;++n)
-      {
-        boundsLonSrcUnmasked(n,nSrcLocalUnmasked) = boundsLonSrc(n,idx) ;
-        boundsLatSrcUnmasked(n,nSrcLocalUnmasked) = boundsLatSrc(n,idx) ;
-      }
-      if (hasSrcArea) areaSrcUnmasked(nSrcLocalUnmasked) = domainSrc_->areavalue(idx)*srcAreaFactor ;
-      globalSrcUnmasked[nSrcLocalUnmasked]=globalSrc[idx] ;
-      ++nSrcLocalUnmasked ;
-    }
-  }
- 
-
-  int nDstLocalUnmasked = 0 ;
-  for (int idx=0 ; idx < nDstLocal; idx++) if (domainDest_->localMask(idx)) ++nDstLocalUnmasked ;
-
-  CArray<double,2> boundsLonDestUnmasked(nVertexDest,nDstLocalUnmasked);
-  CArray<double,2> boundsLatDestUnmasked(nVertexDest,nDstLocalUnmasked);
-  CArray<double,1>   areaDstUnmasked(nDstLocalUnmasked);
-
-  long int * globalDstUnmasked = new long int [nDstLocalUnmasked];
-
-  nDstLocalUnmasked=0 ;
-  bool hasDstArea=domainDest_->hasArea && !domainDest_->radius.isEmpty() && !interpDomain_->use_area.isEmpty() && interpDomain_->use_area==true ;
-  double dstAreaFactor ;
-  if (hasDstArea) dstAreaFactor=1./(domainDest_->radius*domainDest_->radius) ;
-  for (int idx=0 ; idx < nDstLocal; idx++)
-  {
-    if (domainDest_->localMask(idx))
-    {
-      for(int n=0;n<nVertexDest;++n)
-      {
-        boundsLonDestUnmasked(n,nDstLocalUnmasked) = boundsLonDest(n,idx) ;
-        boundsLatDestUnmasked(n,nDstLocalUnmasked) = boundsLatDest(n,idx) ;
-      }
-      if (hasDstArea) areaDstUnmasked(nDstLocalUnmasked) = domainDest_->areavalue(idx)*dstAreaFactor ;
-      globalDstUnmasked[nDstLocalUnmasked]=globalDst[idx] ;
-      ++nDstLocalUnmasked ;
-    }
-  }
-
-  double* ptAreaSrcUnmasked = NULL ;
-  if (hasSrcArea) ptAreaSrcUnmasked=areaSrcUnmasked.dataFirst() ;
-
-  double* ptAreaDstUnmasked = NULL ;
-  if (hasDstArea) ptAreaDstUnmasked=areaDstUnmasked.dataFirst() ;
-
-  mapper.setSourceMesh(boundsLonSrcUnmasked.dataFirst(), boundsLatSrcUnmasked.dataFirst(), ptAreaSrcUnmasked, nVertexSrc, nSrcLocalUnmasked, &srcPole[0], globalSrcUnmasked);
-  mapper.setTargetMesh(boundsLonDestUnmasked.dataFirst(), boundsLatDestUnmasked.dataFirst(), ptAreaDstUnmasked, nVertexDest, nDstLocalUnmasked, &dstPole[0], globalDstUnmasked);
-
-  std::vector<double> timings = mapper.computeWeights(orderInterp,renormalize,quantity);
-
-  std::map<int,std::vector<std::pair<int,double> > > interpMapValue;
-  std::map<int,std::vector<std::pair<int,double> > >::const_iterator iteNorthPole = interpMapValueNorthPole.end(),
-                                                                     iteSouthPole = interpMapValueSouthPole.end();
-  for (int idx = 0;  idx < mapper.nWeights; ++idx)
-  {
-    interpMapValue[mapper.targetWeightId[idx]].push_back(make_pair(mapper.sourceWeightId[idx],mapper.remapMatrix[idx]));
-    if (iteNorthPole != interpMapValueNorthPole.find(mapper.targetWeightId[idx]))
-    {
-      interpMapValueNorthPole[mapper.targetWeightId[idx]].push_back(make_pair(mapper.sourceWeightId[idx],mapper.remapMatrix[idx]));
-    }
-
-    if (iteSouthPole != interpMapValueSouthPole.find(mapper.targetWeightId[idx]))
-    {
-      interpMapValueSouthPole[mapper.targetWeightId[idx]].push_back(make_pair(mapper.sourceWeightId[idx],mapper.remapMatrix[idx]));
-    }
-  }
-  int niGloDst = domainDest_->ni_glo.getValue();
-  processPole(interpMapValueNorthPole, niGloDst);
-  processPole(interpMapValueSouthPole, niGloDst);
-
-  if (!interpMapValueNorthPole.empty())
-  {
-     std::map<int,std::vector<std::pair<int,double> > >::iterator itNorthPole = interpMapValueNorthPole.begin();
-     for (; itNorthPole != iteNorthPole; ++itNorthPole)
-     {
-       if (!(itNorthPole->second.empty()))
-        itNorthPole->second.swap(interpMapValue[itNorthPole->first]);
-     }
-  }
-
-  if (!interpMapValueSouthPole.empty())
-  {
-     std::map<int,std::vector<std::pair<int,double> > >::iterator itSouthPole = interpMapValueSouthPole.begin();
-     for (; itSouthPole != iteSouthPole; ++itSouthPole)
-     {
-       if (!(itSouthPole->second.empty()))
-        itSouthPole->second.swap(interpMapValue[itSouthPole->first]);
-     }
-  }
-
-  if (writeToFile_ && !readFromFile_) writeRemapInfo(interpMapValue);
-//  exchangeRemapInfo(interpMapValue);
-  convertRemapInfo(interpMapValue) ;
-
-  delete [] globalSrc;
-  delete [] globalSrcUnmasked;
-  delete [] globalDst;
-  delete [] globalDstUnmasked;
-
-}
-CATCH
-
-void CDomainAlgorithmInterpolate::processPole(std::map<int,std::vector<std::pair<int,double> > >& interMapValuePole,
-                                              int nbGlobalPointOnPole)
-TRY
-{
-  CContext* context = CContext::getCurrent();
-  CContextClient* client=context->client;
-
-  MPI_Comm poleComme(MPI_COMM_NULL);
-  MPI_Comm_split(client->intraComm, interMapValuePole.empty() ? MPI_UNDEFINED : 1, 0, &poleComme);
-  if (MPI_COMM_NULL != poleComme)
-  {
-    int nbClientPole;
-    MPI_Comm_size(poleComme, &nbClientPole);
-
-    std::map<int,std::vector<std::pair<int,double> > >::iterator itePole = interMapValuePole.end(), itPole,
-                                                                 itbPole = interMapValuePole.begin();
-
-    int nbWeight = 0;
-    for (itPole = itbPole; itPole != itePole; ++itPole)
-       nbWeight += itPole->second.size();
-
-    std::vector<int> recvCount(nbClientPole,0);
-    std::vector<int> displ(nbClientPole,0);
-    MPI_Allgather(&nbWeight,1,MPI_INT,&recvCount[0],1,MPI_INT,poleComme) ;
-
-    displ[0]=0;
-    for(int n=1;n<nbClientPole;++n) displ[n]=displ[n-1]+recvCount[n-1] ;
-    int recvSize=displ[nbClientPole-1]+recvCount[nbClientPole-1] ;
-
-    std::vector<int> sendSourceIndexBuff(nbWeight);
-    std::vector<double> sendSourceWeightBuff(nbWeight);
-    int k = 0;
-    for (itPole = itbPole; itPole != itePole; ++itPole)
-    {
-      for (int idx = 0; idx < itPole->second.size(); ++idx)
-      {
-        sendSourceIndexBuff[k] = (itPole->second)[idx].first;
-        sendSourceWeightBuff[k] = (itPole->second)[idx].second;
-        ++k;
-      }
-    }
-
-    std::vector<int> recvSourceIndexBuff(recvSize);
-    std::vector<double> recvSourceWeightBuff(recvSize);
-
-    // Gather all index and weight for pole
-    MPI_Allgatherv(&sendSourceIndexBuff[0],nbWeight,MPI_INT,&recvSourceIndexBuff[0],&recvCount[0],&displ[0],MPI_INT,poleComme);
-    MPI_Allgatherv(&sendSourceWeightBuff[0],nbWeight,MPI_DOUBLE,&recvSourceWeightBuff[0],&recvCount[0],&displ[0],MPI_DOUBLE,poleComme);
-
-    std::map<int,double> recvTemp;
-    for (int idx = 0; idx < recvSize; ++idx)
-    {
-      if (recvTemp.end() != recvTemp.find(recvSourceIndexBuff[idx]))
-        recvTemp[recvSourceIndexBuff[idx]] += recvSourceWeightBuff[idx]/nbGlobalPointOnPole;
-      else
-        recvTemp[recvSourceIndexBuff[idx]] = recvSourceWeightBuff[idx]/nbGlobalPointOnPole;
-    }
-
-    std::map<int,double>::const_iterator itRecvTemp, itbRecvTemp = recvTemp.begin(), iteRecvTemp = recvTemp.end();
-
-    for (itPole = itbPole; itPole != itePole; ++itPole)
-    {
-      itPole->second.clear();
-      for (itRecvTemp = itbRecvTemp; itRecvTemp != iteRecvTemp; ++itRecvTemp)
-          itPole->second.push_back(make_pair(itRecvTemp->first, itRecvTemp->second));
-    }
-  }
-
-}
-CATCH
-
-/*!
-  Compute the index mapping between domain on grid source and one on grid destination
-*/
-void CDomainAlgorithmInterpolate::computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs)
-TRY
-{
-  if (readFromFile_)  
-    readRemapInfo();
-  else
-  {
-    computeRemap(); 
-  }
-}
-CATCH
-
-void CDomainAlgorithmInterpolate::writeRemapInfo(std::map<int,std::vector<std::pair<int,double> > >& interpMapValue)
-TRY
-{  
-  writeInterpolationInfo(fileToReadWrite_, interpMapValue);
-}
-CATCH
-
-void CDomainAlgorithmInterpolate::readRemapInfo()
-TRY
-{  
-  std::map<int,std::vector<std::pair<int,double> > > interpMapValue;
-  readInterpolationInfo(fileToReadWrite_, interpMapValue);
-
-  exchangeRemapInfo(interpMapValue);
-}
-CATCH
-
-void CDomainAlgorithmInterpolate::convertRemapInfo(std::map<int,std::vector<std::pair<int,double> > >& interpMapValue)
-TRY
-{
-  CContext* context = CContext::getCurrent();
-  CContextClient* client=context->client;
-  int clientRank = client->clientRank;
-
-  this->transformationMapping_.resize(1);
-  this->transformationWeight_.resize(1);
-
-  TransformationIndexMap& transMap = this->transformationMapping_[0];
-  TransformationWeightMap& transWeight = this->transformationWeight_[0];
-
-  std::map<int,std::vector<std::pair<int,double> > >::const_iterator itb = interpMapValue.begin(), it,
-                                                                     ite = interpMapValue.end();
-  
-  for (it = itb; it != ite; ++it)
-  {    
-    const std::vector<std::pair<int,double> >& tmp = it->second;
-    for (int i = 0; i < tmp.size(); ++i)
-    {
-      transMap[it->first].push_back(tmp[i].first);
-      transWeight[it->first].push_back(tmp[i].second);
-    }      
-  }      
-}
-CATCH
-
-/*!
-  Read remap information from file then distribute it among clients
-*/
-void CDomainAlgorithmInterpolate::exchangeRemapInfo(std::map<int,std::vector<std::pair<int,double> > >& interpMapValue)
-TRY
-{
-  CContext* context = CContext::getCurrent();
-  CContextClient* client=context->client;
-  int clientRank = client->clientRank;
-
-  this->transformationMapping_.resize(1);
-  this->transformationWeight_.resize(1);
-
-  TransformationIndexMap& transMap = this->transformationMapping_[0];
-  TransformationWeightMap& transWeight = this->transformationWeight_[0];
-
-  std::unordered_map<size_t,int> globalIndexOfDomainDest;
-  int ni = domainDest_->ni.getValue();
-  int nj = domainDest_->nj.getValue();
-  int ni_glo = domainDest_->ni_glo.getValue();
-  size_t globalIndex;
-  int nIndexSize = domainDest_->i_index.numElements(), i_ind, j_ind;
-  for (int idx = 0; idx < nIndexSize; ++idx)
-  {
-    i_ind=domainDest_->i_index(idx) ;
-    j_ind=domainDest_->j_index(idx) ;
-
-    globalIndex = i_ind + j_ind * ni_glo;
-    globalIndexOfDomainDest[globalIndex] = clientRank;
-  }
-
-  CClientServerMappingDistributed domainIndexClientClientMapping(globalIndexOfDomainDest,
-                                                                 client->intraComm,
-                                                                 true);
-  CArray<size_t,1> globalIndexInterp(interpMapValue.size());
-  std::map<int,std::vector<std::pair<int,double> > >::const_iterator itb = interpMapValue.begin(), it,
-                                                                     ite = interpMapValue.end();
-  size_t globalIndexCount = 0;
-  for (it = itb; it != ite; ++it)
-  {
-    globalIndexInterp(globalIndexCount) = it->first;
-    ++globalIndexCount;
-  }
-
-  domainIndexClientClientMapping.computeServerIndexMapping(globalIndexInterp, client->serverSize);
-  const CClientServerMapping::GlobalIndexMap& globalIndexInterpSendToClient = domainIndexClientClientMapping.getGlobalIndexOnServer();
-
-  //Inform each client number of index they will receive
-  int nbClient = client->clientSize;
-  int* sendBuff = new int[nbClient];
-  int* recvBuff = new int[nbClient];
-  for (int i = 0; i < nbClient; ++i)
-  {
-    sendBuff[i] = 0;
-    recvBuff[i] = 0;
-  }
-  int sendBuffSize = 0;
-  CClientServerMapping::GlobalIndexMap::const_iterator itbMap = globalIndexInterpSendToClient.begin(), itMap,
-                                                       iteMap = globalIndexInterpSendToClient.end();
-  for (itMap = itbMap; itMap != iteMap; ++itMap)
-  {
-    const std::vector<size_t>& tmp = itMap->second;
-    int sizeIndex = 0, mapSize = (itMap->second).size();
-    for (int idx = 0; idx < mapSize; ++idx)
-    {
-//      sizeIndex += interpMapValue.at((itMap->second)[idx]).size();
-      sizeIndex += (interpMapValue[(int)(itMap->second)[idx]]).size();
-    }
-    sendBuff[itMap->first] = sizeIndex;
-    sendBuffSize += sizeIndex;
-  }
-
-
-  MPI_Allreduce(sendBuff, recvBuff, nbClient, MPI_INT, MPI_SUM, client->intraComm);
-
-  int* sendIndexDestBuff = new int [sendBuffSize];
-  int* sendIndexSrcBuff  = new int [sendBuffSize];
-  double* sendWeightBuff = new double [sendBuffSize];
-
-  std::vector<MPI_Request> sendRequest;
-
-  int sendOffSet = 0, l = 0;
-  for (itMap = itbMap; itMap != iteMap; ++itMap)
-  {
-    const std::vector<size_t>& indexToSend = itMap->second;
-    int mapSize = indexToSend.size();
-    int k = 0;
-    for (int idx = 0; idx < mapSize; ++idx)
-    {
-      std::vector<std::pair<int,double> >& interpMap = interpMapValue[(int)indexToSend[idx]]; //interpMapValue.at(indexToSend[idx]);
-      for (int i = 0; i < interpMap.size(); ++i)
-      {
-        sendIndexDestBuff[l] = indexToSend[idx];
-        sendIndexSrcBuff[l]  = interpMap[i].first;
-        sendWeightBuff[l]    = interpMap[i].second;
-        ++k;
-        ++l;
-      }
-    }
-
-    sendRequest.push_back(MPI_Request());
-    MPI_Isend(sendIndexDestBuff + sendOffSet,
-             k,
-             MPI_INT,
-             itMap->first,
-             MPI_DOMAIN_INTERPOLATION_DEST_INDEX,
-             client->intraComm,
-             &sendRequest.back());
-    sendRequest.push_back(MPI_Request());
-    MPI_Isend(sendIndexSrcBuff + sendOffSet,
-             k,
-             MPI_INT,
-             itMap->first,
-             MPI_DOMAIN_INTERPOLATION_SRC_INDEX,
-             client->intraComm,
-             &sendRequest.back());
-    sendRequest.push_back(MPI_Request());
-    MPI_Isend(sendWeightBuff + sendOffSet,
-             k,
-             MPI_DOUBLE,
-             itMap->first,
-             MPI_DOMAIN_INTERPOLATION_WEIGHT,
-             client->intraComm,
-             &sendRequest.back());
-    sendOffSet += k;
-  }
-
-  int recvBuffSize = recvBuff[clientRank];
-  int* recvIndexDestBuff = new int [recvBuffSize];
-  int* recvIndexSrcBuff  = new int [recvBuffSize];
-  double* recvWeightBuff = new double [recvBuffSize];
-  int receivedSize = 0;
-  int clientSrcRank;
-  while (receivedSize < recvBuffSize)
-  {
-    MPI_Status recvStatus;
-    MPI_Recv((recvIndexDestBuff + receivedSize),
-             recvBuffSize,
-             MPI_INT,
-             MPI_ANY_SOURCE,
-             MPI_DOMAIN_INTERPOLATION_DEST_INDEX,
-             client->intraComm,
-             &recvStatus);
-
-    int countBuff = 0;
-    MPI_Get_count(&recvStatus, MPI_INT, &countBuff);
-    clientSrcRank = recvStatus.MPI_SOURCE;
-
-    MPI_Recv((recvIndexSrcBuff + receivedSize),
-             recvBuffSize,
-             MPI_INT,
-             clientSrcRank,
-             MPI_DOMAIN_INTERPOLATION_SRC_INDEX,
-             client->intraComm,
-             &recvStatus);
-
-    MPI_Recv((recvWeightBuff + receivedSize),
-             recvBuffSize,
-             MPI_DOUBLE,
-             clientSrcRank,
-             MPI_DOMAIN_INTERPOLATION_WEIGHT,
-             client->intraComm,
-             &recvStatus);
-
-    for (int idx = 0; idx < countBuff; ++idx)
-    {
-      transMap[*(recvIndexDestBuff + receivedSize + idx)].push_back(*(recvIndexSrcBuff + receivedSize + idx));
-      transWeight[*(recvIndexDestBuff + receivedSize + idx)].push_back(*(recvWeightBuff + receivedSize + idx));
-    }
-    receivedSize += countBuff;
-  }
-
-  std::vector<MPI_Status> requestStatus(sendRequest.size());
-  MPI_Waitall(sendRequest.size(), &sendRequest[0], MPI_STATUS_IGNORE);
-
-  delete [] sendIndexDestBuff;
-  delete [] sendIndexSrcBuff;
-  delete [] sendWeightBuff;
-  delete [] recvIndexDestBuff;
-  delete [] recvIndexSrcBuff;
-  delete [] recvWeightBuff;
-  delete [] sendBuff;
-  delete [] recvBuff;
-}
-CATCH
- 
-/*! Redefined some functions of CONetCDF4 to make use of them */
-CDomainAlgorithmInterpolate::WriteNetCdf::WriteNetCdf(const StdString& filename, const MPI_Comm comm)
-  : CNc4DataOutput(NULL, filename, false, false, true, comm, false, true) {}
-int CDomainAlgorithmInterpolate::WriteNetCdf::addDimensionWrite(const StdString& name, 
-                                                                const StdSize size)
-TRY
-{
-  return CONetCDF4::addDimension(name, size);  
-}
-CATCH
-
-int CDomainAlgorithmInterpolate::WriteNetCdf::addVariableWrite(const StdString& name, nc_type type,
-                                                               const std::vector<StdString>& dim)
-TRY
-{
-  return CONetCDF4::addVariable(name, type, dim);
-}
-CATCH
-
-void CDomainAlgorithmInterpolate::WriteNetCdf::endDefinition()
-TRY
-{
-  CONetCDF4::definition_end();
-}
-CATCH
-
-void CDomainAlgorithmInterpolate::WriteNetCdf::writeDataIndex(const CArray<int,1>& data, const StdString& name,
-                                                              bool collective, StdSize record,
-                                                              const std::vector<StdSize>* start,
-                                                              const std::vector<StdSize>* count)
-TRY
-{
-  CONetCDF4::writeData<int,1>(data, name, collective, record, start, count);
-}
-CATCH
-
-void CDomainAlgorithmInterpolate::WriteNetCdf::writeDataIndex(const CArray<double,1>& data, const StdString& name,
-                                                              bool collective, StdSize record,
-                                                              const std::vector<StdSize>* start,
-                                                              const std::vector<StdSize>* count)
-TRY
-{
-  CONetCDF4::writeData<double,1>(data, name, collective, record, start, count);
-}
-CATCH
-
-/*
-   Write interpolation weights into a file
-   \param [in] filename name of output file
-   \param interpMapValue mapping of global index of domain destination and domain source as well as the corresponding weight
-*/
-void CDomainAlgorithmInterpolate::writeInterpolationInfo(std::string& filename,
-                                                         std::map<int,std::vector<std::pair<int,double> > >& interpMapValue)
-TRY
-{
-  CContext* context = CContext::getCurrent();
-  CContextClient* client=context->client;
-
-  size_t n_src = domainSrc_->ni_glo * domainSrc_->nj_glo;
-  size_t n_dst = domainDest_->ni_glo * domainDest_->nj_glo;
-
-  long localNbWeight = 0;
-  long globalNbWeight;
-  long startIndex;
-  typedef std::map<int,std::vector<std::pair<int,double> > > IndexRemap;
-  IndexRemap::iterator itb = interpMapValue.begin(), it,
-                       ite = interpMapValue.end();
-  for (it = itb; it!=ite; ++it)
-  {
-    localNbWeight += (it->second).size();
-  }
-
-  CArray<int,1> src_idx(localNbWeight);
-  CArray<int,1> dst_idx(localNbWeight);
-  CArray<double,1> weights(localNbWeight);
-
-  int index = 0;
-  int indexOffset=0 ;
-  if (fortranConvention) indexOffset=1 ;
-  for (it = itb; it !=ite; ++it)
-  {
-    std::vector<std::pair<int,double> >& tmp = it->second;
-    for (int idx = 0; idx < tmp.size(); ++idx)
-    {
-      dst_idx(index) = it->first + indexOffset;
-      src_idx(index) = tmp[idx].first + indexOffset;
-      weights(index) = tmp[idx].second;
-      ++index;
-    }    
-  }
-
-  MPI_Allreduce(&localNbWeight, &globalNbWeight, 1, MPI_LONG, MPI_SUM, client->intraComm);
-  MPI_Scan(&localNbWeight, &startIndex, 1, MPI_LONG, MPI_SUM, client->intraComm);
-  
-  if (0 == globalNbWeight)
-  {
-    info << "There is no interpolation weights calculated between "
-         << "domain source: " << domainSrc_->getDomainOutputName()
-         << " and domain destination: " << domainDest_->getDomainOutputName()
-         << std::endl;
-    return;
-  }
-
-  std::vector<StdSize> start(1, startIndex - localNbWeight);
-  std::vector<StdSize> count(1, localNbWeight);
-  
-  WriteNetCdf netCdfWriter(filename, client->intraComm);  
-
-  // Define some dimensions
-  netCdfWriter.addDimensionWrite("n_src", n_src);
-  netCdfWriter.addDimensionWrite("n_dst", n_dst);
-  netCdfWriter.addDimensionWrite("n_weight", globalNbWeight);
-  
-  std::vector<StdString> dims(1,"n_weight");
-
-  // Add some variables
-  netCdfWriter.addVariableWrite("src_idx", NC_INT, dims);
-  netCdfWriter.addVariableWrite("dst_idx", NC_INT, dims);
-  netCdfWriter.addVariableWrite("weight", NC_DOUBLE, dims);
-
-  // End of definition
-  netCdfWriter.endDefinition();
-
-  // // Write variables
-  if (0 != localNbWeight)
-  {
-    netCdfWriter.writeDataIndex(src_idx, "src_idx", false, 0, &start, &count);
-    netCdfWriter.writeDataIndex(dst_idx, "dst_idx", false, 0, &start, &count);
-    netCdfWriter.writeDataIndex(weights, "weight", false, 0, &start, &count);
-  }
-
-  netCdfWriter.closeFile();
-}
-CATCH
-
-/*!
-  Read interpolation information from a file
-  \param [in] filename interpolation file
-  \param [in/out] interpMapValue Mapping between (global) index of domain on grid destination and
-         corresponding global index of domain and associated weight value on grid source
-*/
-void CDomainAlgorithmInterpolate::readInterpolationInfo(std::string& filename,
-                                                        std::map<int,std::vector<std::pair<int,double> > >& interpMapValue)
-TRY
-{
-  int ncid ;
-  int weightDimId ;
-  size_t nbWeightGlo ;
-
-
-  CContext* context = CContext::getCurrent();
-  CContextClient* client=context->client;
-  int clientRank = client->clientRank;
-  int clientSize = client->clientSize;
-
-
-  {
-    ifstream f(filename.c_str());
-    if (!f.good()) ERROR("void CDomainAlgorithmInterpolate::readInterpolationInfo",
-                      << "Attempt to read file weight :"  << filename << " which doesn't seem to exist." << std::endl
-                      << "Please check this file ");
-  }
-                  
-  nc_open(filename.c_str(),NC_NOWRITE, &ncid) ;
-  nc_inq_dimid(ncid,"n_weight",&weightDimId) ;
-  nc_inq_dimlen(ncid,weightDimId,&nbWeightGlo) ;
-
-  size_t nbWeight ;
-  size_t start ;
-  size_t div = nbWeightGlo/clientSize ;
-  size_t mod = nbWeightGlo%clientSize ;
-  if (clientRank < mod)
-  {
-    nbWeight=div+1 ;
-    start=clientRank*(div+1) ;
-  }
-  else
-  {
-    nbWeight=div ;
-    start= mod * (div+1) + (clientRank-mod) * div ;
-  }
-
-  double* weight=new double[nbWeight] ;
-  int weightId ;
-  nc_inq_varid (ncid, "weight", &weightId) ;
-  nc_get_vara_double(ncid, weightId, &start, &nbWeight, weight) ;
-
-  long* srcIndex=new long[nbWeight] ;
-  int srcIndexId ;
-  nc_inq_varid (ncid, "src_idx", &srcIndexId) ;
-  nc_get_vara_long(ncid, srcIndexId, &start, &nbWeight, srcIndex) ;
-
-  long* dstIndex=new long[nbWeight] ;
-  int dstIndexId ;
-  nc_inq_varid (ncid, "dst_idx", &dstIndexId) ;
-  nc_get_vara_long(ncid, dstIndexId, &start, &nbWeight, dstIndex) ;
-
-  int indexOffset=0 ;
-  if (fortranConvention) indexOffset=1 ;
-    for(size_t ind=0; ind<nbWeight;++ind)
-      interpMapValue[dstIndex[ind]-indexOffset].push_back(make_pair(srcIndex[ind]-indexOffset,weight[ind]));
- }
-CATCH
-
-void CDomainAlgorithmInterpolate::apply(const std::vector<std::pair<int,double> >& localIndex,
-                                            const double* dataInput,
-                                            CArray<double,1>& dataOut,
-                                            std::vector<bool>& flagInitial,
-                                            bool ignoreMissingValue, bool firstPass  )
-TRY
-{
-  int nbLocalIndex = localIndex.size();   
-  double defaultValue = std::numeric_limits<double>::quiet_NaN();
-   
-  if (detectMissingValue)
-  {
-     if (firstPass && renormalize)
-     {
-       renormalizationFactor.resize(dataOut.numElements()) ;
-       renormalizationFactor=1 ;
-     }
-
-    if (firstPass)
-    {
-      allMissing.resize(dataOut.numElements()) ;
-      allMissing=true ;
-    }
-
-    for (int idx = 0; idx < nbLocalIndex; ++idx)
-    {
-      if (NumTraits<double>::isNan(*(dataInput + idx)))
-      {
-        allMissing(localIndex[idx].first) = allMissing(localIndex[idx].first) && true;
-        if (renormalize) renormalizationFactor(localIndex[idx].first)-=localIndex[idx].second ;
-      }
-      else
-      {
-        dataOut(localIndex[idx].first) += *(dataInput + idx) * localIndex[idx].second;
-        allMissing(localIndex[idx].first) = allMissing(localIndex[idx].first) && false; // Reset flag to indicate not all data source are nan
-      }
-    }
-
-  }
-  else
-  {
-    for (int idx = 0; idx < nbLocalIndex; ++idx)
-    {
-      dataOut(localIndex[idx].first) += *(dataInput + idx) * localIndex[idx].second;
-    }
-  }
-}
-CATCH
-
-void CDomainAlgorithmInterpolate::updateData(CArray<double,1>& dataOut)
-TRY
-{
-  if (detectMissingValue)
-  {
-    double defaultValue = std::numeric_limits<double>::quiet_NaN();
-    size_t nbIndex=dataOut.numElements() ; 
-
-    if (allMissing.numElements()>0)
-    {
-      for (int idx = 0; idx < nbIndex; ++idx)
-      {
-        if (allMissing(idx)) dataOut(idx) = defaultValue; // If all data source are nan then data destination must be nan
-      }
-    }
-    
-    if (renormalize)
-    {
-      if (renormalizationFactor.numElements()>0) dataOut/=renormalizationFactor ; // In some case, process doesn't received any data for interpolation (mask)
-                                                                                 // so renormalizationFactor is not initialized
-    }
-  }
-}
-CATCH
-
-}
Index: XIOS/dev/dev_trunk_graph/src/transformation/domain_algorithm_interpolate.hpp
===================================================================
--- XIOS/dev/dev_trunk_graph/src/transformation/domain_algorithm_interpolate.hpp	(revision 2019)
+++ 	(revision )
@@ -1,105 +1,0 @@
-/*!
-   \file domain_algorithm_interpolate_from_file.hpp
-   \author Ha NGUYEN
-   \since 09 July 2015
-   \date 09 Sep 2015
-
-   \brief Algorithm for interpolation on a domain.
- */
-#ifndef __XIOS_DOMAIN_ALGORITHM_INTERPOLATE_HPP__
-#define __XIOS_DOMAIN_ALGORITHM_INTERPOLATE_HPP__
-
-#include "domain_algorithm_transformation.hpp"
-#include "transformation.hpp"
-#include "nc4_data_output.hpp"
-
-namespace xios {
-
-class CDomain;
-class CInterpolateDomain;
-
-
-/*!
-  \class CDomainAlgorithmInterpolate
-  Reading interpolation from file then apply on a domain
-*/
-class CDomainAlgorithmInterpolate : public CDomainAlgorithmTransformation
-{
-public:
-  CDomainAlgorithmInterpolate(CDomain* domainDestination, CDomain* domainSource, CInterpolateDomain* interpDomain);
-
-  virtual ~CDomainAlgorithmInterpolate() {}
-
-  virtual void apply(const std::vector<std::pair<int,double> >& localIndex,
-                     const double* dataInput,
-                     CArray<double,1>& dataOut,
-                     std::vector<bool>& flagInitial,                     
-                     bool ignoreMissingValue, bool firstPass);
-  virtual void updateData(CArray<double,1>& dataOut);
-
-  static bool registerTrans();
-
-  virtual StdString getName() {return "Domain Trans. Filter \\n Interpolation";}
-
-protected:
-  void computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs);
-
-private:
-  void readInterpolationInfo(std::string& filename, std::map<int,std::vector<std::pair<int,double> > >& interpMapValue);
-  void writeInterpolationInfo(std::string& filename, std::map<int,std::vector<std::pair<int,double> > >& interpMapValue);
-  void processPole(std::map<int,std::vector<std::pair<int,double> > >& interMapValuePole,
-                   int nbGlobalPointOnPole);
-  void computeRemap();
-  void readRemapInfo();
-  void writeRemapInfo(std::map<int,std::vector<std::pair<int,double> > >&);
-  void exchangeRemapInfo(std::map<int,std::vector<std::pair<int,double> > >& interpMapValue);
-  void convertRemapInfo(std::map<int,std::vector<std::pair<int,double> > >& interpMapValue);
-
-private:
-  CArray<double,1> renormalizationFactor ;
-  CArray<bool,1> allMissing ;
-  bool detectMissingValue ;
-  bool renormalize ;
-  bool quantity ;
-  
-  CInterpolateDomain* interpDomain_;
-  bool writeToFile_;
-  bool readFromFile_;
-  StdString fileToReadWrite_;
-  bool fortranConvention ;
-
-  // class WriteNetCdf;
-  class WriteNetCdf : public CNc4DataOutput
-  {
-  public:
-    WriteNetCdf(const StdString& filename, const MPI_Comm comm);
-    int addDimensionWrite(const StdString& name, const StdSize size = UNLIMITED_DIM);
-    int addVariableWrite(const StdString& name, nc_type type,
-                         const std::vector<StdString>& dim);
-    void endDefinition();
-    void writeDataIndex(const CArray<int,1>& data, const StdString& name,
-                        bool collective, StdSize record,
-                        const std::vector<StdSize>* start = NULL,
-                        const std::vector<StdSize>* count = NULL);
-    void writeDataIndex(const CArray<double,1>& data, const StdString& name,
-                        bool collective, StdSize record,
-                        const std::vector<StdSize>* start = NULL,
-                        const std::vector<StdSize>* count = NULL);
-  };
-
-
-private:
-
-  static CGenericAlgorithmTransformation* create(CGrid* gridDst, CGrid* gridSrc,
-                                                CTransformation<CDomain>* transformation,
-                                                int elementPositionInGrid,
-                                                std::map<int, int>& elementPositionInGridSrc2ScalarPosition,
-                                                std::map<int, int>& elementPositionInGridSrc2AxisPosition,
-                                                std::map<int, int>& elementPositionInGridSrc2DomainPosition,
-                                                std::map<int, int>& elementPositionInGridDst2ScalarPosition,
-                                                std::map<int, int>& elementPositionInGridDst2AxisPosition,
-                                                std::map<int, int>& elementPositionInGridDst2DomainPosition);
-};
-
-}
-#endif // __XIOS_DOMAIN_ALGORITHM_INTERPOLATE_HPP__
Index: XIOS/dev/dev_trunk_graph/src/transformation/domain_algorithm_reorder.cpp
===================================================================
--- XIOS/dev/dev_trunk_graph/src/transformation/domain_algorithm_reorder.cpp	(revision 2019)
+++ 	(revision )
@@ -1,134 +1,0 @@
-/*!
-   \file domain_algorithm_reorder.cpp
-   \brief Algorithm for reorder a domain.
- */
-#include "domain_algorithm_reorder.hpp"
-#include "reorder_domain.hpp"
-#include "domain.hpp"
-#include "grid.hpp"
-#include "grid_transformation_factory_impl.hpp"
-
-namespace xios {
-CGenericAlgorithmTransformation* CDomainAlgorithmReorder::create(CGrid* gridDst, CGrid* gridSrc,
-                                                             CTransformation<CDomain>* transformation,
-                                                             int elementPositionInGrid,
-                                                             std::map<int, int>& elementPositionInGridSrc2ScalarPosition,
-                                                             std::map<int, int>& elementPositionInGridSrc2AxisPosition,
-                                                             std::map<int, int>& elementPositionInGridSrc2DomainPosition,
-                                                             std::map<int, int>& elementPositionInGridDst2ScalarPosition,
-                                                             std::map<int, int>& elementPositionInGridDst2AxisPosition,
-                                                             std::map<int, int>& elementPositionInGridDst2DomainPosition)
-TRY
-{
-  std::vector<CDomain*> domainListDestP = gridDst->getDomains();
-  std::vector<CDomain*> domainListSrcP  = gridSrc->getDomains();
-
-  CReorderDomain* reorderDomain = dynamic_cast<CReorderDomain*> (transformation);
-  int domainDstIndex = elementPositionInGridDst2DomainPosition[elementPositionInGrid];
-  int domainSrcIndex = elementPositionInGridSrc2DomainPosition[elementPositionInGrid];
-
-  return (new CDomainAlgorithmReorder(domainListDestP[domainDstIndex], domainListSrcP[domainSrcIndex], reorderDomain));
-}
-CATCH
-
-bool CDomainAlgorithmReorder::registerTrans()
-TRY
-{
-  CGridTransformationFactory<CDomain>::registerTransformation(TRANS_REORDER_DOMAIN, create);
-}
-CATCH
-
-CDomainAlgorithmReorder::CDomainAlgorithmReorder(CDomain* domainDestination, CDomain* domainSource, CReorderDomain* reorderDomain)
-: CDomainAlgorithmTransformation(domainDestination, domainSource)
-TRY
-{
-  reorderDomain->checkValid(domainSource);
-  if (domainDestination->type !=  CDomain::type_attr::rectilinear)
-  {
-      ERROR("CDomainAlgorithmReorder::CDomainAlgorithmReorder(CDomain* domainDestination, CDomain* domainSource, CReorderDomain* reorderDomain)",
-           << "Domain destination is not rectilinear. This filter work only for rectilinear domain and destination domain with < id = "
-           <<domainDestination->getId() <<" > is of type "<<domainDestination->type<<std::endl);
-  }
-  
-  if (domainDestination == domainSource)
-  {
-    ERROR("CDomainAlgorithmReorder::CDomainAlgorithmReorder(CDomain* domainDestination, CDomain* domainSource, CReorderDomain* reorderDomain)",
-           << "Domain source and domain destination are the same. Please make sure domain destination refers to domain source" << std::endl
-           << "Domain source " <<domainSource->getId() << std::endl
-           << "Domain destination " <<domainDestination->getId() << std::endl);
-  }
-  this->type_ = (ELEMENT_MODIFICATION_WITHOUT_DATA);
-
-  if (!reorderDomain->invert_lat.isEmpty())
-  {
-    CArray<int,1>& j_index=domainDestination->j_index ;
-    int nglo = j_index.numElements() ;
-    int nj_glo =domainDestination->nj_glo ;
-    
-    for (size_t i = 0; i < nglo ; ++i)
-    {
-      j_index(i)=(nj_glo-1)-j_index(i) ;
-    }
-  }
-
-  if (!reorderDomain->shift_lon_fraction.isEmpty())
-  {
-    int ni_glo =domainDestination->ni_glo ;
-    int  offset = ni_glo*reorderDomain->shift_lon_fraction ;
-    CArray<int,1>& i_index=domainDestination->i_index ;
-    int nglo = i_index.numElements() ;
-    
-    for (size_t i = 0; i < nglo ; ++i)
-    {
-      i_index(i)=  (i_index(i)+offset+ni_glo)%ni_glo ;
-    }
-  }
-
-  if (!reorderDomain->min_lon.isEmpty() && !reorderDomain->max_lon.isEmpty())
-  {
-    double min_lon=reorderDomain->min_lon ;
-    double max_lon=reorderDomain->max_lon ;
-    double delta=max_lon-min_lon ;
-    
-    if (!domainDestination->lonvalue_1d.isEmpty() )
-    {
-      CArray<double,1>& lon=domainDestination->lonvalue_1d ;
-      for (int i=0;i<lon.numElements();++i)
-      {
-        while  (lon(i) > max_lon) lon(i)=lon(i)-delta ;
-        while  (lon(i) < min_lon) lon(i)=lon(i)+delta ;
-      }
-    }
-
-    if (!domainDestination->bounds_lon_1d.isEmpty() )
-    {
-      CArray<double,2>& bounds_lon=domainDestination->bounds_lon_1d ;
-      for (int i=0;i<bounds_lon.extent(0);++i)
-      {
-        while  (bounds_lon(0,i) > max_lon) bounds_lon(0,i)=bounds_lon(0,i)-delta ;
-        while  (bounds_lon(1,i) > max_lon) bounds_lon(1,i)=bounds_lon(1,i)-delta ;
-
-        while  (bounds_lon(0,i) < min_lon) bounds_lon(0,i)=bounds_lon(0,i)+delta ;
-        while  (bounds_lon(1,i) < min_lon) bounds_lon(1,i)=bounds_lon(1,i)+delta ;
-      }
-    }
-  }
-}
-CATCH
-
-/*!
-  Compute the index mapping between domain on grid source and one on grid destination
-*/
-void CDomainAlgorithmReorder::computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs)
-{
-/*
-  this->transformationMapping_.resize(1);
-  this->transformationWeight_.resize(1);
-
-  TransformationIndexMap& transMap = this->transformationMapping_[0];
-  TransformationWeightMap& transWeight = this->transformationWeight_[0];
-*/
-}
-
-
-}
Index: XIOS/dev/dev_trunk_graph/src/transformation/domain_algorithm_reorder.hpp
===================================================================
--- XIOS/dev/dev_trunk_graph/src/transformation/domain_algorithm_reorder.hpp	(revision 2019)
+++ 	(revision )
@@ -1,48 +1,0 @@
-/*!
-   \brief Algorithm for reordering domain.
- */
-#ifndef __XIOS_DOMAIN_ALGORITHM_REORDER_HPP__
-#define __XIOS_DOMAIN_ALGORITHM_REORDER_HPP__
-
-#include "domain_algorithm_transformation.hpp"
-#include "transformation.hpp"
-
-namespace xios {
-
-class CDomain;
-class CReorderDomain;
-
-/*!
-  \class CDomainAlgorithmReorder
-  Reordering data on domain
-*/
-class CDomainAlgorithmReorder : public CDomainAlgorithmTransformation
-{
-public:
-  CDomainAlgorithmReorder(CDomain* domainDestination, CDomain* domainSource, CReorderDomain* reorderDomain);
-
-  virtual ~CDomainAlgorithmReorder() {}
-
-  static bool registerTrans();
-
-  virtual StdString getName() {return "Domain Trans. Filter \\n Reorder";}
-
-protected:
-  void computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs);
-
-
-private:
-
-  static CGenericAlgorithmTransformation* create(CGrid* gridDst, CGrid* gridSrc,
-                                                CTransformation<CDomain>* transformation,
-                                                int elementPositionInGrid,
-                                                std::map<int, int>& elementPositionInGridSrc2ScalarPosition,
-                                                std::map<int, int>& elementPositionInGridSrc2AxisPosition,
-                                                std::map<int, int>& elementPositionInGridSrc2DomainPosition,
-                                                std::map<int, int>& elementPositionInGridDst2ScalarPosition,
-                                                std::map<int, int>& elementPositionInGridDst2AxisPosition,
-                                                std::map<int, int>& elementPositionInGridDst2DomainPosition);
-};
-
-}
-#endif // __XIOS_DOMAIN_ALGORITHM_REORDER_HPP__
Index: XIOS/dev/dev_trunk_graph/src/transformation/domain_algorithm_transformation.cpp
===================================================================
--- XIOS/dev/dev_trunk_graph/src/transformation/domain_algorithm_transformation.cpp	(revision 2019)
+++ 	(revision )
@@ -1,70 +1,0 @@
-/*!
-   \file domain_algorithm_transformation.hpp
-   \author Ha NGUYEN
-   \since 02 Jul 2015
-   \date 02 Jul 2015
-
-   \brief Interface for all domain transformation algorithms.
- */
-
-#include "domain_algorithm_transformation.hpp"
-#include "context.hpp"
-#include "context_client.hpp"
-#include "domain.hpp"
-
-namespace xios {
-
-CDomainAlgorithmTransformation::CDomainAlgorithmTransformation(CDomain* domainDestination, CDomain* domainSource)
- : CGenericAlgorithmTransformation(), domainDest_(domainDestination), domainSrc_(domainSource)
-{
-}
-
-CDomainAlgorithmTransformation::~CDomainAlgorithmTransformation()
-{
-}
-
-void CDomainAlgorithmTransformation::computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs)
-{
-}
-
-/*!
-  Compute global index of domain on different processes
-  \param [in] globalDomainIndex global index of domain source
-  \param [out] globalDomainIndexOnProc processes which contain the corresponding global index of domain source
-*/
-void CDomainAlgorithmTransformation::computeExchangeGlobalIndex(const CArray<size_t,1>& globalDomainIndex,
-                                                                int elementType,
-                                                                CClientClientDHTInt::Index2VectorInfoTypeMap& globalDomainIndexOnProc)
-TRY
-{
-  CContext* context = CContext::getCurrent();
-  CContextClient* client=context->client;
-  int clientRank = client->clientRank;
-  int clientSize = client->clientSize;
-
-  int niGlob = domainSrc_->ni_glo.getValue();
-  int njGlob = domainSrc_->nj_glo.getValue();
-  size_t globalIndex;
-  int nIndexSize = domainSrc_->i_index.numElements(), i_ind, j_ind;
-  CClientClientDHTInt::Index2VectorInfoTypeMap globalIndex2ProcRank;
-  globalIndex2ProcRank.rehash(std::ceil(nIndexSize/globalIndex2ProcRank.max_load_factor()));
-  CArray<bool,1>& localMask=domainSrc_->localMask ;
-  for (int idx = 0; idx < nIndexSize; ++idx)
-  {
-    if (localMask(idx))
-    {
-      i_ind=domainSrc_->i_index(idx) ;
-      j_ind=domainSrc_->j_index(idx) ;
-
-      globalIndex = i_ind + j_ind * niGlob;
-      globalIndex2ProcRank[globalIndex].push_back(clientRank);
-    }
-  }
-
-  CClientClientDHTInt dhtIndexProcRank(globalIndex2ProcRank, client->intraComm);
-  dhtIndexProcRank.computeIndexInfoMapping(globalDomainIndex);
-  globalDomainIndexOnProc = dhtIndexProcRank.getInfoIndexMap();
-}
-CATCH
-
-}
Index: XIOS/dev/dev_trunk_graph/src/transformation/domain_algorithm_transformation.hpp
===================================================================
--- XIOS/dev/dev_trunk_graph/src/transformation/domain_algorithm_transformation.hpp	(revision 2019)
+++ 	(revision )
@@ -1,47 +1,0 @@
-/*!
-   \file domain_algorithm_transformation.hpp
-   \author Ha NGUYEN
-   \since 02 Jul 2015
-   \date 02 Jul 2015
-
-   \brief Interface for all domain transformation algorithms.
- */
-#ifndef __XIOS_DOMAIN_ALGORITHM_TRANSFORMATION_HPP__
-#define __XIOS_DOMAIN_ALGORITHM_TRANSFORMATION_HPP__
-
-#include "generic_algorithm_transformation.hpp"
-#include "client_client_dht_template.hpp"
-
-namespace xios {
-
-class CDomain;
-/*!
-  \class CDomainAlgorithmTransformation
-  Algorithms for domain.
-*/
-class CDomainAlgorithmTransformation : public virtual CGenericAlgorithmTransformation
-{
-public:
-  CDomainAlgorithmTransformation(CDomain* domainDestination, CDomain* domainSource);
-
-  virtual ~CDomainAlgorithmTransformation();
-
-  virtual StdString getName() {return "Domain Trans. Filter \\n Transformation";}
-
-protected:
-  void computeIndexSourceMapping_(const std::vector<CArray<double,1>* >&);
-
-  virtual void computeExchangeGlobalIndex(const CArray<size_t,1>& globalDomainIndex,
-                                          int elementType,
-                                          CClientClientDHTInt::Index2VectorInfoTypeMap& globalDomainIndexOnProc);
-
-protected:
-    //! Domain on grid destination
-  CDomain* domainDest_;
-
-  //! Domain on grid source
-  CDomain* domainSrc_;
-};
-
-}
-#endif // __XIOS_DOMAIN_ALGORITHM_TRANSFORMATION_HPP__
Index: XIOS/dev/dev_trunk_graph/src/transformation/domain_algorithm_zoom.cpp
===================================================================
--- XIOS/dev/dev_trunk_graph/src/transformation/domain_algorithm_zoom.cpp	(revision 2019)
+++ 	(revision )
@@ -1,286 +1,0 @@
-#include "domain_algorithm_zoom.hpp"
-#include "zoom_domain.hpp"
-#include "domain.hpp"
-#include "grid.hpp"
-#include "grid_transformation_factory_impl.hpp"
-#include "attribute_template.hpp"
-
-namespace xios {
-CGenericAlgorithmTransformation* CDomainAlgorithmZoom::create(CGrid* gridDst, CGrid* gridSrc,
-                                                             CTransformation<CDomain>* transformation,
-                                                             int elementPositionInGrid,
-                                                             std::map<int, int>& elementPositionInGridSrc2ScalarPosition,
-                                                             std::map<int, int>& elementPositionInGridSrc2AxisPosition,
-                                                             std::map<int, int>& elementPositionInGridSrc2DomainPosition,
-                                                             std::map<int, int>& elementPositionInGridDst2ScalarPosition,
-                                                             std::map<int, int>& elementPositionInGridDst2AxisPosition,
-                                                             std::map<int, int>& elementPositionInGridDst2DomainPosition)
-TRY
-{
-  std::vector<CDomain*> domainListDestP = gridDst->getDomains();
-  std::vector<CDomain*> domainListSrcP  = gridSrc->getDomains();
-
-  CZoomDomain* zoomDomain = dynamic_cast<CZoomDomain*> (transformation);
-  int domainDstIndex = elementPositionInGridDst2DomainPosition[elementPositionInGrid];
-  int domainSrcIndex = elementPositionInGridSrc2DomainPosition[elementPositionInGrid];
-
-  return (new CDomainAlgorithmZoom(domainListDestP[domainDstIndex], domainListSrcP[domainSrcIndex], zoomDomain));
-}
-CATCH
-
-bool CDomainAlgorithmZoom::registerTrans()
-TRY
-{
-  CGridTransformationFactory<CDomain>::registerTransformation(TRANS_ZOOM_DOMAIN, create);
-}
-CATCH
-
-CDomainAlgorithmZoom::CDomainAlgorithmZoom(CDomain* domainDestination, CDomain* domainSource, CZoomDomain* zoomDomain)
-: CDomainAlgorithmTransformation(domainDestination, domainSource)
-TRY
-{
-  zoomDomain->checkValid(domainSource);
-  zoomIBegin_ = zoomDomain->ibegin.getValue();
-  zoomJBegin_ = zoomDomain->jbegin.getValue();
-
-  zoomNi_  = zoomDomain->ni.getValue();
-  zoomNj_  = zoomDomain->nj.getValue();
-
-  zoomIEnd_ = zoomIBegin_ + zoomNi_ - 1;
-  zoomJEnd_ = zoomJBegin_ + zoomNj_ - 1;
-
-  if (zoomNi_ > domainSource->ni_glo.getValue())
-  {
-    ERROR("CDomainAlgorithmZoom::CDomainAlgorithmZoom(CDomain* domainDestination, CDomain* domainSource, CZoomDomain* zoomDomain)",
-           << "Zoom size is greater than size of domain source"
-           << "Size ni_glo of domain source " <<domainSource->getId() << " is " << domainSource->ni_glo.getValue()  << std::endl
-           << "Zoom size is " << zoomNi_ );
-  }
-
-  if (zoomNj_ > domainSource->nj_glo.getValue())
-  {
-    ERROR("CDomainAlgorithmZoom::CDomainAlgorithmZoom(CDomain* domainDestination, CDomain* domainSource, CZoomDomain* zoomDomain)",
-           << "Zoom size is greater than size of domain source"
-           << "Size nj_glo of domain source " <<domainSource->getId() << " is " << domainSource->nj_glo.getValue()  << std::endl
-           << "Zoom size is " << zoomNj_ );
-  }
-
-  // Calculate the size of local domain
-  int ind, indLocSrc, indLocDest, iIdxSrc, jIdxSrc, destIBegin = -1, destJBegin = -1, niDest = 0, njDest = 0, ibeginDest, jbeginDest ;
-  int indGloDest, indGloSrc, niGloSrc = domainSrc_->ni_glo, iSrc, jSrc, nvertex = 0;
-  for (int j = 0; j < domainSrc_->nj.getValue(); j++)
-  {
-    for (int i = 0; i < domainSrc_->ni.getValue(); i++)
-    {
-      ind = j*domainSrc_->ni + i;
-      iIdxSrc = domainSrc_->i_index(ind);
-      if ((iIdxSrc >= zoomIBegin_) && (iIdxSrc <= zoomIEnd_))
-      {
-        jIdxSrc = domainSrc_->j_index(ind);
-        if ((jIdxSrc >= zoomJBegin_) && (jIdxSrc <= zoomJEnd_))
-        {
-          if ((niDest == 0) && (njDest == 0))
-          {
-            destIBegin = i;
-            destJBegin = j;
-          }
-          if (i == destIBegin) ++njDest;
-        }
-        if (j == destJBegin) ++niDest;
-
-      }
-    }
-  }
-  ibeginDest = destIBegin + domainSrc_->ibegin - zoomIBegin_;
-  jbeginDest = destJBegin + domainSrc_->jbegin - zoomJBegin_;
-  domainDest_->ni_glo.setValue(zoomNi_);
-  domainDest_->nj_glo.setValue(zoomNj_);
-  domainDest_->ni.setValue(niDest);
-  domainDest_->nj.setValue(njDest);
-  if ( (niDest==0) || (njDest==0))
-  {
-    domainDest_->ibegin.setValue(0);
-    domainDest_->jbegin.setValue(0);
-  }
-  else
-  {
-    domainDest_->ibegin.setValue(ibeginDest);
-    domainDest_->jbegin.setValue(jbeginDest);
-  }
-  domainDest_->i_index.resize(niDest*njDest);
-  domainDest_->j_index.resize(niDest*njDest);
-
-  domainDest_->data_ni.setValue(niDest);
-  domainDest_->data_nj.setValue(njDest);
-  domainDest_->data_ibegin.setValue(0);
-  domainDest_->data_jbegin.setValue(0);
-  domainDest_->data_i_index.resize(niDest*njDest);
-  domainDest_->data_j_index.resize(niDest*njDest);
-
-  domainDest_->domainMask.resize(niDest*njDest);
-
-  if (!domainSrc_->lonvalue_1d.isEmpty())
-  {
-    if (domainDest_->type == CDomain::type_attr::rectilinear)
-    {
-      domainDest_->lonvalue_1d.resize(niDest);
-      domainDest_->latvalue_1d.resize(njDest);
-    }
-    else if (domainDest_->type == CDomain::type_attr::unstructured)
-    {
-      domainDest_->lonvalue_1d.resize(niDest);
-      domainDest_->latvalue_1d.resize(niDest);
-    }
-    else if (domainDest_->type == CDomain::type_attr::curvilinear)
-    {
-      domainDest_->lonvalue_1d.resize(niDest*njDest);
-      domainDest_->latvalue_1d.resize(niDest*njDest);
-    }
-  }
-  else if (!domainSrc_->lonvalue_2d.isEmpty())
-  {
-    domainDest_->lonvalue_2d.resize(niDest,njDest);
-    domainDest_->latvalue_2d.resize(niDest,njDest);
-  }
-
-  if (domainSrc_->hasBounds)
-  {
-    nvertex = domainSrc_->nvertex;
-    domainDest_->nvertex.setValue(nvertex);
-    if (!domainSrc_->bounds_lon_1d.isEmpty())
-    {
-      if (domainDest_->type == CDomain::type_attr::rectilinear)
-      {
-        domainDest_->bounds_lon_1d.resize(nvertex, niDest);
-        domainDest_->bounds_lat_1d.resize(nvertex, njDest);
-      }
-      else if (domainDest_->type == CDomain::type_attr::unstructured)
-      {
-        domainDest_->bounds_lon_1d.resize(nvertex, niDest);
-        domainDest_->bounds_lat_1d.resize(nvertex, niDest);
-      }
-      else if (domainDest_->type == CDomain::type_attr::curvilinear)
-      {
-        domainDest_->bounds_lon_1d.resize(nvertex, niDest*njDest);
-        domainDest_->bounds_lat_1d.resize(nvertex, niDest*njDest);
-      }
-    }
-    else if (!domainSrc_->bounds_lon_2d.isEmpty())
-    {
-      domainDest_->bounds_lon_2d.resize(nvertex, niDest, njDest);
-      domainDest_->bounds_lat_2d.resize(nvertex, niDest, njDest);
-    }
-  }
-  if (domainSrc_->hasArea) domainDest_->area.resize(niDest,njDest);
-
-  this->transformationMapping_.resize(1);
-  this->transformationWeight_.resize(1);
-  TransformationIndexMap& transMap = this->transformationMapping_[0];
-  TransformationWeightMap& transWeight = this->transformationWeight_[0];
-
-  for (int iDest = 0; iDest < niDest; iDest++)
-  {
-    iSrc = iDest + destIBegin;
-    for (int jDest = 0; jDest < njDest; jDest++)
-    {
-      jSrc = jDest + destJBegin;
-      ind = jSrc * domainSrc_->ni + iSrc;
-      iIdxSrc = domainSrc_->i_index(ind);
-      jIdxSrc = domainSrc_->j_index(ind);
-      indLocDest = jDest*niDest + iDest;
-      indGloDest = (jDest + jbeginDest)*zoomNi_ + (iDest + ibeginDest);
-      indLocSrc = (jDest+destJBegin)*domainSrc_->ni + (iDest+destIBegin);
-      indGloSrc = (jIdxSrc )* niGloSrc + iIdxSrc;
-      domainDest_->i_index(indLocDest) = iDest + ibeginDest;                                             // i_index contains global positions
-      domainDest_->j_index(indLocDest) = jDest + jbeginDest;                                             // i_index contains global positions
-      domainDest_->data_i_index(indLocDest) = (domainSrc_->data_dim == 1) ? indLocDest : iDest;          // data_i_index contains local positions
-      domainDest_->data_j_index(indLocDest) = (domainSrc_->data_dim == 1) ? 0 :jDest;                    // data_i_index contains local positions
-      domainDest_->domainMask(indLocDest) = domainSrc_->domainMask(indLocSrc);
-
-      if (domainSrc_->hasArea)
-        domainDest_->area(iDest,jDest) = domainSrc_->area(iSrc,jSrc);
-
-      if (domainSrc_->hasLonLat)
-      {
-        if (!domainSrc_->latvalue_1d.isEmpty())
-        {
-          if (domainDest_->type == CDomain::type_attr::rectilinear)
-          {
-            domainDest_->latvalue_1d(jDest) = domainSrc_->latvalue_1d(jSrc);
-          }
-          else
-          {
-            domainDest_->lonvalue_1d(indLocDest) = domainSrc_->lonvalue_1d(ind);
-            domainDest_->latvalue_1d(indLocDest) = domainSrc_->latvalue_1d(ind);
-          }
-        }
-        else if (!domainSrc_->latvalue_2d.isEmpty())
-        {
-          domainDest_->lonvalue_2d(iDest,jDest) = domainSrc_->lonvalue_2d(iSrc,jSrc);
-          domainDest_->latvalue_2d(iDest,jDest) = domainSrc_->latvalue_2d(iSrc,jSrc);
-        }
-      }
-
-      if (domainSrc_->hasBounds)
-      {
-        if (!domainSrc_->bounds_lon_1d.isEmpty())
-        {
-          if (domainDest_->type == CDomain::type_attr::rectilinear)
-          {
-            for (int n = 0; n < nvertex; ++n)
-              domainDest_->bounds_lat_1d(n,jDest) = domainSrc_->bounds_lat_1d(n,jSrc);
-          }
-          else
-          {
-            for (int n = 0; n < nvertex; ++n)
-            {
-              domainDest_->bounds_lon_1d(n,indLocDest) = domainSrc_->bounds_lon_1d(n,ind);
-              domainDest_->bounds_lat_1d(n,indLocDest) = domainSrc_->bounds_lat_1d(n,ind);
-            }
-          }
-        }
-        else if (!domainSrc_->bounds_lon_2d.isEmpty())
-        {
-          for (int n = 0; n < nvertex; ++n)
-          {
-            domainDest_->bounds_lon_2d(n,iDest,jDest) = domainSrc_->bounds_lon_2d(n,iSrc,jSrc);
-            domainDest_->bounds_lat_2d(n,iDest,jDest) = domainSrc_->bounds_lat_2d(n,iSrc,jSrc);
-          }
-        }
-
-      }
-
-      transMap[indGloDest].push_back(indGloSrc);
-      transWeight[indGloDest].push_back(1.0);
-    }
-
-    if (domainSrc_->hasLonLat && !domainSrc_->latvalue_1d.isEmpty())
-    {
-      if (domainDest_->type == CDomain::type_attr::rectilinear)
-      {
-        domainDest_->lonvalue_1d(iDest) = domainSrc_->lonvalue_1d(iSrc);
-      }
-    }
-
-    if (domainSrc_->hasBounds && !domainSrc_->bounds_lon_1d.isEmpty())
-    {
-      if (domainDest_->type == CDomain::type_attr::rectilinear)
-      {
-        for (int n = 0; n < nvertex; ++n)
-          domainDest_->bounds_lon_1d(n,iDest) = domainSrc_->bounds_lon_1d(n,iSrc);
-      }
-    }
-  }
-  domainDest_->computeLocalMask();
-}
-CATCH
-
-/*!
-  Compute the index mapping between domain on grid source and one on grid destination
-*/
-void CDomainAlgorithmZoom::computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs)
-{
-}
-
-
-}
Index: XIOS/dev/dev_trunk_graph/src/transformation/domain_algorithm_zoom.hpp
===================================================================
--- XIOS/dev/dev_trunk_graph/src/transformation/domain_algorithm_zoom.hpp	(revision 2019)
+++ 	(revision )
@@ -1,61 +1,0 @@
-
-#ifndef __XIOS_DOMAIN_ALGORITHM_ZOOM_HPP__
-#define __XIOS_DOMAIN_ALGORITHM_ZOOM_HPP__
-
-#include "domain_algorithm_transformation.hpp"
-#include "transformation.hpp"
-
-namespace xios {
-
-class CDomain;
-class CZoomDomain;
-
-/*!
-  \class CDomainAlgorithmZoom
-  Implementing zoom (alternative zoom) on domain
-*/
-class CDomainAlgorithmZoom : public CDomainAlgorithmTransformation
-{
-public:
-  CDomainAlgorithmZoom(CDomain* domainDestination, CDomain* domainSource, CZoomDomain* zoomDomain);
-
-  virtual ~CDomainAlgorithmZoom() {}
-
-  static bool registerTrans();
-
-  virtual StdString getName() {return "Domain Trans. Filter \\n Zoom";}
-protected:
-  void updateDomainAttributes();
-  void computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs);
-
-private:
-  void updateZoom();
-
-private:
-  //! Global zoom begin on domain
-  int zoomIBegin_;
-  int zoomJBegin_;
-
-  //! Global zoom end on domain
-  int zoomIEnd_;
-  int zoomJEnd_;
-
-  //! Global zoom size on domain
-  int zoomNi_;
-  int zoomNj_;
-
-private:
-
-  static CGenericAlgorithmTransformation* create(CGrid* gridDst, CGrid* gridSrc,
-                                                CTransformation<CDomain>* transformation,
-                                                int elementPositionInGrid,
-                                                std::map<int, int>& elementPositionInGridSrc2ScalarPosition,
-                                                std::map<int, int>& elementPositionInGridSrc2AxisPosition,
-                                                std::map<int, int>& elementPositionInGridSrc2DomainPosition,
-                                                std::map<int, int>& elementPositionInGridDst2ScalarPosition,
-                                                std::map<int, int>& elementPositionInGridDst2AxisPosition,
-                                                std::map<int, int>& elementPositionInGridDst2DomainPosition);
-};
-
-}
-#endif // __XIOS_DOMAIN_ALGORITHM_ZOOM_HPP__
Index: XIOS/dev/dev_trunk_graph/src/transformation/grid_generate.cpp
===================================================================
--- XIOS/dev/dev_trunk_graph/src/transformation/grid_generate.cpp	(revision 2019)
+++ 	(revision )
@@ -1,121 +1,0 @@
-/*!
-   \file grid_generate.cpp
-   \author Ha NGUYEN
-   \since 28 Aug 2015
-   \date 23 June 2016
-
-   \brief A special transformation to generate a grid.
- */
-#include "grid_generate.hpp"
-#include "grid.hpp"
-#include "domain_algorithm_generate_rectilinear.hpp"
-#include "generate_rectilinear_domain.hpp"
-
-namespace xios {
-CGridGenerate::CGridGenerate(CGrid* destination, CGrid* source)
-  : CGridTransformationSelector(destination, source, special)
-{
-}
-
-CGridGenerate::~CGridGenerate()
-{
-}
-
-/*!
-  Select algorithm of an axis correspoding to its transformation type and its position in each element
-  \param [in] elementPositionInGrid position of element in grid. e.g: a grid has 1 domain and 1 axis, then position of domain is 1 (because it contains 2 basic elements)
-                                             and position of axis is 2
-  \param [in] transType transformation type, for now we have Zoom_axis, inverse_axis
-  \param [in] transformationOrder position of the transformation in an element (an element can have several transformation)
-*/
-void CGridGenerate::selectScalarAlgo(int elementPositionInGrid, ETranformationType transType, int transformationOrder)
-TRY
-{
-  CGenericAlgorithmTransformation* algo = 0;
-  algoTransformation_.push_back(algo);
-}
-CATCH
-
-/*!
-  Select algorithm of an axis correspoding to its transformation type and its position in each element
-  \param [in] elementPositionInGrid position of element in grid. e.g: a grid has 1 domain and 1 axis, then position of domain is 1 (because it contains 2 basic elements)
-                                             and position of axis is 2
-  \param [in] transType transformation type, for now we have Zoom_axis, inverse_axis
-  \param [in] transformationOrder position of the transformation in an element (an element can have several transformation)
-*/
-void CGridGenerate::selectAxisAlgo(int elementPositionInGrid, ETranformationType transType, int transformationOrder)
-TRY
-{
-  CGenericAlgorithmTransformation* algo = 0;
-  algoTransformation_.push_back(algo);
-}
-CATCH
-
-/*!
-  Select algorithm of a domain correspoding to its transformation type and its position in each element
-  \param [in] elementPositionInGrid position of element in grid. e.g: a grid has 1 domain and 1 axis, then position of domain is 1 (because it contains 2 basic elements)
-                                             and position of axis is 2
-  \param [in] transType transformation type, for now we have Zoom_axis, inverse_axis
-  \param [in] transformationOrder position of the transformation in an element (an element can have several transformation)
-*/
-void CGridGenerate::selectDomainAlgo(int elementPositionInGrid, ETranformationType transType, int transformationOrder)
-TRY
-{
-  std::vector<CDomain*> domainListDestP = gridDestination_->getDomains();
-  std::vector<CDomain*> domainListSrcP(domainListDestP.size());
-  if (0 != gridSource_) domainListSrcP = gridSource_->getDomains();
-
-  int domainIndex =  elementPositionInGridDst2DomainPosition_[elementPositionInGrid];
-  CDomain::TransMapTypes trans = domainListDestP[domainIndex]->getAllTransformations();
-  CDomain::TransMapTypes::const_iterator it = trans.begin();
-
-  for (int i = 0; i < transformationOrder; ++i, ++it) {}  // Find the correct transformation
-
-  CGenerateRectilinearDomain* genRectDomain = 0;
-  CGenericAlgorithmTransformation* algo = 0;
-  switch (transType)
-  {
-    case TRANS_GENERATE_RECTILINEAR_DOMAIN:
-      if (0 == transformationOrder)
-      {
-        genRectDomain = dynamic_cast<CGenerateRectilinearDomain*> (it->second);
-        algo = new CDomainAlgorithmGenerateRectilinear(domainListDestP[domainIndex], domainListSrcP[domainIndex],
-                                                       gridDestination_, gridSource_, genRectDomain);
-      }
-      else
-      {
-         ERROR("CGridGenerate::selectDomainAlgo(int elementPositionInGrid, ETranformationType transType, int transformationOrder)",
-           << "Generate rectilinear domain must be the first transformation");
-      }
-      break;
-    default:
-      break;
-  }
-  algoTransformation_.push_back(algo);
-}
-CATCH
-
-/*!
-
-*/
-void CGridGenerate::completeGrid()
-TRY
-{
-  ListAlgoType::const_iterator itb = listAlgos_.begin(),
-                               ite = listAlgos_.end(), it;
-  CGenericAlgorithmTransformation* algo = 0;
-
-  for (it = itb; it != ite; ++it)
-  {
-    int elementPositionInGrid = it->first;
-    ETranformationType transType = (it->second).first;
-    int transformationOrder = (it->second).second.first;
-    int algoType = (it->second).second.second;
-
-    // First of all, select an algorithm
-    selectAlgo(elementPositionInGrid, transType, transformationOrder, algoType);
-  }
-}
-CATCH
-
-}
Index: XIOS/dev/dev_trunk_graph/src/transformation/grid_generate.hpp
===================================================================
--- XIOS/dev/dev_trunk_graph/src/transformation/grid_generate.hpp	(revision 2019)
+++ 	(revision )
@@ -1,43 +1,0 @@
-/*!
-   \file grid_generate.hpp
-   \author Ha NGUYEN
-   \since 28 Aug 2015
-   \date 28 Aug 2015
-
-   \brief A special transformation to generate a grid.
- */
-#ifndef __XIOS_GRID_GENERATE_HPP__
-#define __XIOS_GRID_GENERATE_HPP__
-
-#include "xios_spl.hpp"
-#include "transformation_enum.hpp"
-#include "grid_transformation_selector.hpp"
-
-namespace xios {
-
-class CGrid;
-
-/*!
-  \class CGridGenerate
-  This class creates a grid from scratch, e.g: only global dimension of grid and its type are provided,
-then the generated grid plays the destination in a transformation. Not only some attributes of grid and its subcomponents are filled in
-automatically but it also have a distribution which might be different from one of grid source.
-This class only plays a role of interface between XIOS and specific algorithm of auto filling-in and auto distributing on sub-component
-*/
-class CGridGenerate : public CGridTransformationSelector
-{
-public:
-  /** Default constructor */
-  CGridGenerate(CGrid* destination, CGrid* source = 0);
-  ~CGridGenerate();
-
-  void completeGrid();
-
-protected:
-  virtual void selectScalarAlgo(int elementPositionInGrid, ETranformationType transType, int transformationOrder);
-  virtual void selectAxisAlgo(int elementPositionInGrid, ETranformationType transType, int transformationOrder);
-  virtual void selectDomainAlgo(int elementPositionInGrid, ETranformationType transType, int transformationOrder);
-};
-
-}
-#endif // __XIOS_GRID_GENERATE_HPP__
Index: XIOS/dev/dev_trunk_graph/src/transformation/grid_transformation.cpp
===================================================================
--- XIOS/dev/dev_trunk_graph/src/transformation/grid_transformation.cpp	(revision 2019)
+++ 	(revision )
@@ -1,732 +1,0 @@
-/*!
-   \file grid_transformation.cpp
-   \author Ha NGUYEN
-   \since 14 May 2015
-   \date 02 Jul 2015
-
-   \brief Interface for all transformations.
- */
-#include "grid_transformation.hpp"
-#include "grid_transformation_factory_impl.hpp"
-#include "algo_types.hpp"
-#include "context.hpp"
-#include "context_client.hpp"
-#include "distribution_client.hpp"
-#include "mpi_tag.hpp"
-#include "grid.hpp"
-#include <unordered_map>
-#include "timer.hpp"
-
-namespace xios {
-CGridTransformation::CGridTransformation(CGrid* destination, CGrid* source)
- : CGridTransformationSelector(destination, source),
-  tmpGridDestination_(destination), originalGridSource_(source),
-  tempGridSrcs_(), tempGridDests_(),
-  dynamicalTransformation_(false), timeStamp_()
-{
-}
-
-CGridTransformation::~CGridTransformation()
-{
-}
-
-/*!
-  Select algorithm of a scalar corresponding to its transformation type and its position in each element
-  \param [in] elementPositionInGrid position of element in grid. e.g: a grid has 1 domain and 1 axis, then position of domain is 0 and position of axis is 1
-  \param [in] transType transformation type, for now we have
-  \param [in] transformationOrder position of the transformation in an element (an element can have several transformation)
-*/
-void CGridTransformation::selectScalarAlgo(int elementPositionInGrid, ETranformationType transType, int transformationOrder)
-TRY
-{
-  std::vector<CScalar*> scaListDestP = gridDestination_->getScalars();
-  int scalarDstIndex =  elementPositionInGridDst2ScalarPosition_[elementPositionInGrid];
-  CScalar::TransMapTypes trans = scaListDestP[scalarDstIndex]->getAllTransformations();
-  CScalar::TransMapTypes::const_iterator it = trans.begin();
-
-  for (int i = 0; i < transformationOrder; ++i, ++it) {}  // Find the correct transformation
-  CGenericAlgorithmTransformation* algo = 0;
-  algo = CGridTransformationFactory<CScalar>::createTransformation(transType,
-                                                                  gridDestination_,
-                                                                  gridSource_,
-                                                                  it->second,
-                                                                  elementPositionInGrid,
-                                                                  elementPositionInGridSrc2ScalarPosition_,
-                                                                  elementPositionInGridSrc2AxisPosition_,
-                                                                  elementPositionInGridSrc2DomainPosition_,
-                                                                  elementPositionInGridDst2ScalarPosition_,
-                                                                  elementPositionInGridDst2AxisPosition_,
-                                                                  elementPositionInGridDst2DomainPosition_);
-  algoTransformation_.push_back(algo);
-}
-CATCH
-
-/*!
-  Select algorithm of an axis corresponding to its transformation type and its position in each element
-  \param [in] elementPositionInGrid position of element in grid. e.g: a grid has 1 domain and 1 axis, then position of domain is 0 and position of axis is 1
-  \param [in] transType transformation type, for now we have zoom_axis, inverse_axis, interpolate_axis
-  \param [in] transformationOrder position of the transformation in an element (an element can have several transformation)
-*/
-void CGridTransformation::selectAxisAlgo(int elementPositionInGrid, ETranformationType transType, int transformationOrder)
-TRY
-{
-  std::vector<CAxis*> axisListDestP = gridDestination_->getAxis();
-  int axisDstIndex =  elementPositionInGridDst2AxisPosition_[elementPositionInGrid];
-  CAxis::TransMapTypes trans = axisListDestP[axisDstIndex]->getAllTransformations();
-  CAxis::TransMapTypes::const_iterator it = trans.begin();
-  for (int i = 0; i < transformationOrder; ++i, ++it) {}  // Find the correct transformation
-
-  CGenericAlgorithmTransformation* algo = 0;
-  algo = CGridTransformationFactory<CAxis>::createTransformation(transType,
-                                                                 gridDestination_,
-                                                                 gridSource_,
-                                                                 it->second,
-                                                                 elementPositionInGrid,
-                                                                 elementPositionInGridSrc2ScalarPosition_,
-                                                                 elementPositionInGridSrc2AxisPosition_,
-                                                                 elementPositionInGridSrc2DomainPosition_,
-                                                                 elementPositionInGridDst2ScalarPosition_,
-                                                                 elementPositionInGridDst2AxisPosition_,
-                                                                 elementPositionInGridDst2DomainPosition_);
-  algoTransformation_.push_back(algo);
-}
-CATCH
-
-/*!
-  Select algorithm of a domain corresponding to its transformation type and its position in each element
-  \param [in] elementPositionInGrid position of element in grid. e.g: a grid has 1 domain and 1 axis, then position of domain is 0 and position of axis is 1
-  \param [in] transType transformation type, for now we have zoom_domain, interpolate_domain
-  \param [in] transformationOrder position of the transformation in an element (an element can have several transformation)
-*/
-void CGridTransformation::selectDomainAlgo(int elementPositionInGrid, ETranformationType transType, int transformationOrder)
-TRY
-{
-  std::vector<CDomain*> domainListDestP = gridDestination_->getDomains();
-  int domainIndex =  elementPositionInGridDst2DomainPosition_[elementPositionInGrid];
-  CDomain::TransMapTypes trans = domainListDestP[domainIndex]->getAllTransformations();
-  CDomain::TransMapTypes::const_iterator it = trans.begin();
-  for (int i = 0; i < transformationOrder; ++i, ++it) {}  // Find the correct transformation  
-
-  CGenericAlgorithmTransformation* algo = 0;
-  algo = CGridTransformationFactory<CDomain>::createTransformation(transType,
-                                                                   gridDestination_,
-                                                                   gridSource_,
-                                                                   it->second,
-                                                                   elementPositionInGrid,
-                                                                   elementPositionInGridSrc2ScalarPosition_,
-                                                                   elementPositionInGridSrc2AxisPosition_,
-                                                                   elementPositionInGridSrc2DomainPosition_,
-                                                                   elementPositionInGridDst2ScalarPosition_,
-                                                                   elementPositionInGridDst2AxisPosition_,
-                                                                   elementPositionInGridDst2DomainPosition_);
-  algoTransformation_.push_back(algo);
-}
-CATCH
-
-/*!
-  Find position of element in a grid as well as its type (domain, axis, scalar) and position in its own element list
-  \return element position: map<int,<int,int> > corresponds to <element position in grid, <element type, element position in element list> >
-*/
-std::map<int,std::pair<int,int> > CGridTransformation::getElementPosition(CGrid* grid)
-TRY
-{
-  std::vector<CScalar*> scalarListP = grid->getScalars(); 
-  std::vector<CAxis*> axisListP = grid->getAxis();
-  std::vector<CDomain*> domListP = grid->getDomains();  
-  CArray<int,1> axisDomainOrder = grid->axis_domain_order;
-  int scalarIndex = 0, axisIndex = 0, domainIndex = 0;
-  int nbElement = axisDomainOrder.numElements(), elementDim;
-  std::map<int,std::pair<int,int> > elementPosition;
-  for (int idx = 0; idx < nbElement; ++idx)
-  {
-    elementDim = axisDomainOrder(idx);
-    switch (elementDim)
-    {
-      case 2:
-        elementPosition[idx] = std::make_pair(elementDim, domainIndex);
-        ++domainIndex;
-        break;
-      case 1:
-        elementPosition[idx] = std::make_pair(elementDim, axisIndex);
-        ++axisIndex;
-        break;
-      case 0:
-        elementPosition[idx] = std::make_pair(elementDim, scalarIndex);
-        ++scalarIndex;
-        break;
-      default:
-        break;        
-    }
-  }
-
-  return elementPosition;  
-}
-CATCH
-
-/*!
-  If there are more than one transformation, a new temporary grid will be created and it will play the role of grid destination.
-This new created one keeps a pointer to the real transformed element of grid destination and generate new copies of other elements from grid source.
-  \param [in] elementPositionInGrid position of element in grid
-  \param [in] transType transformation type
-*/
-void CGridTransformation::setUpGridDestination(int elementPositionInGrid, ETranformationType transType)
-TRY
-{
-  if (isSpecialTransformation(transType)) return;
-
-  if (!tempGridDests_.empty() && (getNbAlgo() == tempGridDests_.size()))
-  {
-    tempGridDests_.resize(0);
-  }
-
-  if (1 == getNbAlgo()) 
-  {
-    tmpGridDestination_ = gridDestination_;
-    return;
-  }
-
-  std::vector<CScalar*> scalarListDestP = gridDestination_->getScalars();
-  std::vector<CScalar*> scalarListSrcP = gridSource_->getScalars(), scalarDst;
-
-  std::vector<CAxis*> axisListDestP = gridDestination_->getAxis();
-  std::vector<CAxis*> axisListSrcP = gridSource_->getAxis(), axisDst;
-
-  std::vector<CDomain*> domListDestP = gridDestination_->getDomains();
-  std::vector<CDomain*> domListSrcP = gridSource_->getDomains(), domainDst;
-
-  CArray<int,1> axisDomainOrderSrc = gridSource_->axis_domain_order;
-  CArray<int,1> axisDomainOrderDst = gridDestination_->axis_domain_order;
-
-  std::map<int,std::pair<int,int> > elementPositionSrc = getElementPosition(gridSource_);
-  std::map<int,std::pair<int,int> > elementPositionDst = getElementPosition(gridDestination_);
-
-  CArray<int,1> elementOrder(axisDomainOrderDst.numElements());
-  for (int idx = 0; idx < axisDomainOrderDst.numElements(); ++idx)
-  {
-    if (elementPositionInGrid == idx)
-    {
-      int dimElementDst = elementPositionDst[idx].first;
-      int elementIndex  = elementPositionDst[idx].second;
-      switch (dimElementDst) 
-      {
-        case 2:
-          domainDst.push_back(domListDestP[elementIndex]);
-          break;
-        case 1:
-          axisDst.push_back(axisListDestP[elementIndex]);
-          break;
-        case 0:
-          scalarDst.push_back(scalarListDestP[elementIndex]);
-          break;
-        default:
-          break;
-      }
-      elementOrder(idx) = dimElementDst;
-    }
-    else
-    {      
-      int dimElementSrc = elementPositionSrc[idx].first;
-      int elementIndex  = elementPositionSrc[idx].second;
-      switch (dimElementSrc)
-      {
-        case 2:
-          domainDst.push_back(domListSrcP[elementIndex]);
-          break;
-        case 1:
-          axisDst.push_back(axisListSrcP[elementIndex]);
-          break;
-        case 0:
-          scalarDst.push_back(scalarListSrcP[elementIndex]);
-          break;
-        default:
-          break;
-      }
-      elementOrder(idx) = dimElementSrc;
-    }
-  }
-
-  tmpGridDestination_ = CGrid::createGrid(domainDst, axisDst, scalarDst, elementOrder);  
-  tempGridDests_.push_back(tmpGridDestination_);
-}
-CATCH
-
-/*!
-  Assign the current grid destination to the grid source in the new transformation.
-The current grid destination plays the role of grid source in next transformation (if any).
-Only element on which the transformation is performed is modified
-  \param [in] elementPositionInGrid position of element in grid
-  \param [in] transType transformation type
-*/
-void CGridTransformation::setUpGridSource(int elementPositionInGrid)
-TRY
-{
-  if (!tempGridSrcs_.empty() && (getNbAlgo()-1) == tempGridSrcs_.size())
-  {
-    tempGridSrcs_.resize(0);
-  }
-
-  std::vector<CScalar*> scalarListDestP = tmpGridDestination_->getScalars();
-  std::vector<CScalar*> scalarListSrcP = gridSource_->getScalars(), scalarSrc;
-
-  std::vector<CAxis*> axisListDestP = tmpGridDestination_->getAxis();
-  std::vector<CAxis*> axisListSrcP = gridSource_->getAxis(), axisSrc;
-
-  std::vector<CDomain*> domListDestP = tmpGridDestination_->getDomains();
-  std::vector<CDomain*> domListSrcP = gridSource_->getDomains(), domainSrc;
-
-  CArray<int,1> axisDomainOrderSrc = gridSource_->axis_domain_order;
-  CArray<int,1> axisDomainOrderDst = tmpGridDestination_->axis_domain_order;
-
-  std::map<int,std::pair<int,int> > elementPositionSrc = getElementPosition(gridSource_);
-  std::map<int,std::pair<int,int> > elementPositionDst = getElementPosition(tmpGridDestination_);
-
-  for (int idx = 0; idx < axisDomainOrderDst.numElements(); ++idx)
-  {   
-    if (elementPositionInGrid == idx)
-    {
-      int dimElementDst = elementPositionDst[idx].first;
-      int elementIndex  = elementPositionDst[idx].second;
-      if (2 == dimElementDst)
-      {
-        CDomain* domain = CDomain::createDomain();
-        domain->domain_ref.setValue(domListDestP[elementIndex]->getId());
-        domain->solveRefInheritance(true);
-        domain->checkAttributesOnClient();
-        domainSrc.push_back(domain);
-      }
-      else if (1 == dimElementDst)
-      {
-        CAxis* axis = CAxis::createAxis();
-        axis->axis_ref.setValue(axisListDestP[elementIndex]->getId());
-        axis->solveRefInheritance(true);
-        axis->checkAttributesOnClient();
-        axisSrc.push_back(axis); 
-      }
-      else
-      {
-        CScalar* scalar = CScalar::createScalar();
-        scalar->scalar_ref.setValue(scalarListDestP[elementIndex]->getId());
-        scalar->solveRefInheritance(true);
-        scalar->checkAttributesOnClient();
-        scalarSrc.push_back(scalar);
-      }
-    }
-    else
-    {      
-      int dimElementDst = elementPositionDst[idx].first;
-      int elementIndex  = elementPositionDst[idx].second;
-      switch (dimElementDst)
-      {
-        case 2:
-          domainSrc.push_back(domListDestP[elementIndex]);
-          break;
-        case 1:
-          axisSrc.push_back(axisListDestP[elementIndex]);
-          break;
-        case 0:
-          scalarSrc.push_back(scalarListDestP[elementIndex]);
-          break;
-        default:
-          break;
-      }
-    }
-  }
-
-  gridSource_ = CGrid::createGrid(domainSrc, axisSrc, scalarSrc, tmpGridDestination_->axis_domain_order);  
-
-  tempGridSrcs_.push_back(gridSource_);
-}
-CATCH
-
-/*!
-  Perform all transformations
-  For each transformation, there are some things to do:
-  -) Chose the correct algorithm by transformation type and position of element
-  -) Calculate the mapping of global index between the current grid source and grid destination
-  -) Calculate the mapping of global index between current grid DESTINATION and grid SOURCE
-  -) Make current grid destination become grid source in the next transformation
-*/
-void CGridTransformation::computeAll(const std::vector<CArray<double,1>* >& dataAuxInputs, Time timeStamp)
-TRY
-{
-  if (nbNormalAlgos_ < 1) return;
-  if (!auxInputs_.empty() && !dynamicalTransformation_) { dynamicalTransformation_ = true; return; }
-  if (dynamicalTransformation_)
-  {
-    if (timeStamp_.insert(timeStamp).second)   //Reset map
-    {
-      std::list<SendingIndexGridSourceMap>().swap(localIndexToSendFromGridSource_);
-      std::list<RecvIndexGridDestinationMap>().swap(localIndexToReceiveOnGridDest_);
-      std::list<size_t>().swap(nbLocalIndexOnGridDest_);
-    }
-    else
-      return;
-  }
-
-  CContext* context = CContext::getCurrent();
-  CContextClient* client = context->client;
-
-  ListAlgoType::const_iterator itb = listAlgos_.begin(),
-                               ite = listAlgos_.end(), it;
-
-  CGenericAlgorithmTransformation* algo = 0;
-  int nbAgloTransformation = 0; // Only count for executed transformation. Generate domain is a special one, not executed in the list
-  for (it = itb; it != ite; ++it)
-  {
-    int elementPositionInGrid = it->first;
-    ETranformationType transType = (it->second).first;
-    int transformationOrder = (it->second).second.first;
-    int algoType = ((it->second).second.second); //algoTypes_[std::distance(itb, it)];
-    SourceDestinationIndexMap globaIndexWeightFromSrcToDst;
-    
-
-    // Create a temporary grid destination which contains transformed element of grid destination and
-    // non-transformed elements to grid source
-    setUpGridDestination(elementPositionInGrid, transType);
-
-    // First of all, select an algorithm
-    if (!dynamicalTransformation_ || (algoTransformation_.size() < listAlgos_.size()))
-    {
-      selectAlgo(elementPositionInGrid, transType, transformationOrder, algoType);
-      algo = algoTransformation_.back();
-    }
-    else
-      algo = algoTransformation_[std::distance(itb, it)];
-
-    if ((0 != algo) &&
-        ((CGenericAlgorithmTransformation::ELEMENT_NO_MODIFICATION_WITH_DATA == algo->type()) ||
-        (CGenericAlgorithmTransformation::ELEMENT_MODIFICATION_WITH_DATA == algo->type()))) // Only registered transformation can be executed
-    {
-      CTimer::get("computeIndexSourceMapping").resume() ;
-      algo->computeIndexSourceMapping(dataAuxInputs);
-      CTimer::get("computeIndexSourceMapping").suspend() ;
-      
-      // ComputeTransformation of global index of each element
-      int elementPosition = it->first;
-      bool nonDistributedActivated = CXios::getin<bool>("activate_non_distributed_transformation",false);
-      
-      if (nonDistributedActivated && !algo->isDistributedTransformation(elementPositionInGrid, gridSource_, tmpGridDestination_) )
-      {
-        vector<int> localSrc ;
-        vector<int> localDst ;
-        vector<double> weight ;
-        int nbLocalIndexOnGridDest;
-        CTimer::get("computeTransformationMappingNonDistributed").resume();  
-        algo->computeTransformationMappingNonDistributed(elementPosition, gridSource_, tmpGridDestination_, 
-                                                         localSrc, localDst, weight, nbLocalIndexOnGridDest) ;
-        CTimer::get("computeTransformationMappingNonDistributed").suspend();  
-
-        CTimer::get("computeTransformationMappingConvert").resume();  
-        nbLocalIndexOnGridDest_.push_back(nbLocalIndexOnGridDest) ;
-        int clientRank=client->clientRank ;
-        {
-          SendingIndexGridSourceMap tmp;
-          localIndexToSendFromGridSource_.push_back(tmp) ;
-          SendingIndexGridSourceMap& src=localIndexToSendFromGridSource_.back() ;
-          CArray<int,1> arrayTmp ;
-          src.insert( pair<int,CArray<int,1> >(clientRank,arrayTmp)) ;
-          CArray<int,1>& array=src[clientRank] ;
-          array.resize(localSrc.size()) ;
-          for(int i=0;i< localSrc.size();++i) array(i)=localSrc[i]  ;    
-        }
-        {
-          RecvIndexGridDestinationMap tmp;
-          localIndexToReceiveOnGridDest_.push_back(tmp) ;
-          RecvIndexGridDestinationMap& dst=localIndexToReceiveOnGridDest_.back() ;
-          vector<pair<int,double> > vectTmp ;
-          dst.insert( pair<int,vector<pair<int,double> >  >(clientRank,vectTmp)) ;
-          vector<pair<int,double> >& vect=dst[clientRank] ;
-          vect.resize(localDst.size()) ;
-          for(int i=0;i< localDst.size();++i) vect[i]=pair<int,double>(localDst[i],weight[i])  ;      
-        }
-        CTimer::get("computeTransformationMappingConvert").suspend();  
-      }
-      else
-      {
-        CTimer::get("computeGlobalSourceIndex").resume();           
-        algo->computeGlobalSourceIndex(elementPosition,
-                                       gridSource_,
-                                       tmpGridDestination_,
-                                       globaIndexWeightFromSrcToDst);
-                                     
-        CTimer::get("computeGlobalSourceIndex").suspend();           
-        CTimer::get("computeTransformationMapping").resume();     
-        // Compute transformation of global indexes among grids
-        computeTransformationMapping(globaIndexWeightFromSrcToDst);
-        CTimer::get("computeTransformationMapping").suspend(); 
-      } 
-      if (1 < nbNormalAlgos_)
-      {
-        // Now grid destination becomes grid source in a new transformation
-        if (nbAgloTransformation != (nbNormalAlgos_-1)) setUpGridSource(elementPositionInGrid);
-      }
-      ++nbAgloTransformation;
-    }
-  }
-}
-CATCH
-
-/*!
-  Compute exchange index between grid source and grid destination
-  \param [in] globalIndexWeightFromDestToSource global index mapping between grid destination and grid source
-*/
-void CGridTransformation::computeTransformationMapping(const SourceDestinationIndexMap& globaIndexWeightFromSrcToDst)
-TRY
-{
-  CContext* context = CContext::getCurrent();
-  CContextClient* client = context->client;
-  int nbClient = client->clientSize;
-  int clientRank = client->clientRank;
-
-  // Recalculate the distribution of grid destination
-  CDistributionClient distributionClientDest(client->clientRank, tmpGridDestination_);
-  CDistributionClient::GlobalLocalDataMap& globalLocalIndexGridDestSendToServer = distributionClientDest.getGlobalLocalDataSendToServer();
-
-  // Update number of local index on each transformation
-  size_t nbLocalIndex = globalLocalIndexGridDestSendToServer.size();
-  nbLocalIndexOnGridDest_.push_back(nbLocalIndex);
-//  localMaskOnGridDest_.push_back(std::vector<bool>());
-//  std::vector<bool>& tmpMask = localMaskOnGridDest_.back();
-//  tmpMask.resize(nbLocalIndex,false);
-
-  // Find out number of index sent from grid source and number of index received on grid destination
-  SourceDestinationIndexMap::const_iterator itbIndex = globaIndexWeightFromSrcToDst.begin(),
-                                            iteIndex = globaIndexWeightFromSrcToDst.end(), itIndex;
-  typedef std::unordered_map<size_t, std::vector<std::pair<size_t,double> > > SendIndexMap;
-  std::map<int,int> sendRankSizeMap,recvRankSizeMap;
-  int connectedClient = globaIndexWeightFromSrcToDst.size();
-  int* recvCount=new int[nbClient];
-  int* displ=new int[nbClient];
-  int* sendRankBuff=new int[connectedClient];
-  int* sendSizeBuff=new int[connectedClient];
-  int n = 0;
-  for (itIndex = itbIndex; itIndex != iteIndex; ++itIndex, ++n)
-  {
-    sendRankBuff[n] = itIndex->first;
-    const SendIndexMap& sendIndexMap = itIndex->second;
-    SendIndexMap::const_iterator itbSend = sendIndexMap.begin(), iteSend = sendIndexMap.end(), itSend;
-    int sendSize = 0;
-    for (itSend = itbSend; itSend != iteSend; ++itSend)
-    {
-      sendSize += itSend->second.size();
-    }
-    sendSizeBuff[n] = sendSize;
-    sendRankSizeMap[itIndex->first] = sendSize;
-  }
-  MPI_Allgather(&connectedClient,1,MPI_INT,recvCount,1,MPI_INT,client->intraComm);
-
-  displ[0]=0 ;
-  for(int n=1;n<nbClient;n++) displ[n]=displ[n-1]+recvCount[n-1];
-  int recvSize=displ[nbClient-1]+recvCount[nbClient-1];
-  int* recvRankBuff=new int[recvSize];
-  int* recvSizeBuff=new int[recvSize];
-  MPI_Allgatherv(sendRankBuff,connectedClient,MPI_INT,recvRankBuff,recvCount,displ,MPI_INT,client->intraComm);
-  MPI_Allgatherv(sendSizeBuff,connectedClient,MPI_INT,recvSizeBuff,recvCount,displ,MPI_INT,client->intraComm);
-  for (int i = 0; i < nbClient; ++i)
-  {
-    int currentPos = displ[i];
-    for (int j = 0; j < recvCount[i]; ++j)
-      if (recvRankBuff[currentPos+j] == clientRank)
-      {
-        recvRankSizeMap[i] = recvSizeBuff[currentPos+j];
-      }
-  }
-
-  // Sending global index of grid source to corresponding process as well as the corresponding mask
-  std::vector<MPI_Request> requests;
-  std::vector<MPI_Status> status;
-  std::unordered_map<int, unsigned char* > recvMaskDst;
-  std::unordered_map<int, unsigned long* > recvGlobalIndexSrc;
-  for (std::map<int,int>::const_iterator itRecv = recvRankSizeMap.begin(); itRecv != recvRankSizeMap.end(); ++itRecv)
-  {
-    int recvRank = itRecv->first;
-    int recvSize = itRecv->second;
-    recvMaskDst[recvRank] = new unsigned char [recvSize];
-    recvGlobalIndexSrc[recvRank] = new unsigned long [recvSize];
-
-    requests.push_back(MPI_Request());
-    MPI_Irecv(recvGlobalIndexSrc[recvRank], recvSize, MPI_UNSIGNED_LONG, recvRank, 46, client->intraComm, &requests.back());
-    requests.push_back(MPI_Request());
-    MPI_Irecv(recvMaskDst[recvRank], recvSize, MPI_UNSIGNED_CHAR, recvRank, 47, client->intraComm, &requests.back());
-  }
-
-  std::unordered_map<int, CArray<size_t,1> > globalIndexDst;
-  std::unordered_map<int, CArray<double,1> > weightDst;
-  std::unordered_map<int, unsigned char* > sendMaskDst;
-  std::unordered_map<int, unsigned long* > sendGlobalIndexSrc;
-  for (itIndex = itbIndex; itIndex != iteIndex; ++itIndex)
-  {
-    int sendRank = itIndex->first;
-    int sendSize = sendRankSizeMap[sendRank];
-    const SendIndexMap& sendIndexMap = itIndex->second;
-    SendIndexMap::const_iterator itbSend = sendIndexMap.begin(), iteSend = sendIndexMap.end(), itSend;
-    globalIndexDst[sendRank].resize(sendSize);
-    weightDst[sendRank].resize(sendSize);
-    sendMaskDst[sendRank] = new unsigned char [sendSize];
-    sendGlobalIndexSrc[sendRank] = new unsigned long [sendSize];
-    int countIndex = 0;
-    for (itSend = itbSend; itSend != iteSend; ++itSend)
-    {
-      const std::vector<std::pair<size_t,double> >& dstWeight = itSend->second;
-      for (int idx = 0; idx < dstWeight.size(); ++idx)
-      {
-        globalIndexDst[sendRank](countIndex) = dstWeight[idx].first;
-        weightDst[sendRank](countIndex) = dstWeight[idx].second;
-        if (0 < globalLocalIndexGridDestSendToServer.count(dstWeight[idx].first))
-          sendMaskDst[sendRank][countIndex] = 1;
-        else
-          sendMaskDst[sendRank][countIndex] = 0;
-        sendGlobalIndexSrc[sendRank][countIndex] = itSend->first;
-        ++countIndex;
-      }
-    }
-
-    // Send global index source and mask
-    requests.push_back(MPI_Request());
-    MPI_Isend(sendGlobalIndexSrc[sendRank], sendSize, MPI_UNSIGNED_LONG, sendRank, 46, client->intraComm, &requests.back());
-    requests.push_back(MPI_Request());
-    MPI_Isend(sendMaskDst[sendRank], sendSize, MPI_UNSIGNED_CHAR, sendRank, 47, client->intraComm, &requests.back());
-  }
-
-  status.resize(requests.size());
-  MPI_Waitall(requests.size(), &requests[0], &status[0]);
-
-  // Okie, now use the mask to identify which index source we need to send, then also signal the destination which masked index we will return
-  std::vector<MPI_Request>().swap(requests);
-  std::vector<MPI_Status>().swap(status);
-  // Okie, on destination side, we will wait for information of masked index of source
-  for (std::map<int,int>::const_iterator itSend = sendRankSizeMap.begin(); itSend != sendRankSizeMap.end(); ++itSend)
-  {
-    int recvRank = itSend->first;
-    int recvSize = itSend->second;
-
-    requests.push_back(MPI_Request());
-    MPI_Irecv(sendMaskDst[recvRank], recvSize, MPI_UNSIGNED_CHAR, recvRank, 48, client->intraComm, &requests.back());
-  }
-
-  // Ok, now we fill in local index of grid source (we even count for masked index)
-  CDistributionClient distributionClientSrc(client->clientRank, gridSource_);
-  CDistributionClient::GlobalLocalDataMap& globalLocalIndexGridSrcSendToServer = distributionClientSrc.getGlobalLocalDataSendToServer();
-  localIndexToSendFromGridSource_.push_back(SendingIndexGridSourceMap());
-  SendingIndexGridSourceMap& tmpSend = localIndexToSendFromGridSource_.back();
-  for (std::map<int,int>::const_iterator itRecv = recvRankSizeMap.begin(); itRecv != recvRankSizeMap.end(); ++itRecv)
-  {
-    int recvRank = itRecv->first;
-    int recvSize = itRecv->second;
-    unsigned char* recvMask = recvMaskDst[recvRank];
-    unsigned long* recvIndexSrc = recvGlobalIndexSrc[recvRank];
-    int realSendSize = 0;
-    for (int idx = 0; idx < recvSize; ++idx)
-    {
-      if (0 != (*(recvMask+idx))) // OKie, now we have a demand from non-masked index destination
-        if (0 < globalLocalIndexGridSrcSendToServer.count(*(recvIndexSrc+idx))) // check whether index source is masked
-         ++realSendSize;
-        else // inform the destination that this index is masked
-         *(recvMask+idx) = 0;
-    }
-
-    tmpSend[recvRank].resize(realSendSize);
-    realSendSize = 0;
-    for (int idx = 0; idx < recvSize; ++idx)
-    {
-      if (0 != (*(recvMask+idx))) // OKie, now we have a demand from non-masked index destination
-      {
-        tmpSend[recvRank](realSendSize) = globalLocalIndexGridSrcSendToServer[*(recvIndexSrc+idx)];
-         ++realSendSize;
-      }
-    }
-
-    // Okie, now inform the destination which source index are masked
-    requests.push_back(MPI_Request());
-    MPI_Isend(recvMaskDst[recvRank], recvSize, MPI_UNSIGNED_CHAR, recvRank, 48, client->intraComm, &requests.back());
-  }
-  status.resize(requests.size());
-  MPI_Waitall(requests.size(), &requests[0], &status[0]);
-
-  // Cool, now we can fill in local index of grid destination (counted for masked index)
-  localIndexToReceiveOnGridDest_.push_back(RecvIndexGridDestinationMap());
-  RecvIndexGridDestinationMap& recvTmp = localIndexToReceiveOnGridDest_.back();
-  for (std::map<int,int>::const_iterator itSend = sendRankSizeMap.begin(); itSend != sendRankSizeMap.end(); ++itSend)
-  {
-    int recvRank = itSend->first;
-    int recvSize = itSend->second;
-    unsigned char* recvMask = sendMaskDst[recvRank];
-
-    CArray<size_t,1>& recvIndexDst = globalIndexDst[recvRank];
-    CArray<double,1>& recvWeightDst = weightDst[recvRank];
-    int realRecvSize = 0;
-    for (int idx = 0; idx < recvSize; ++idx)
-    {
-      if (0 != *(recvMask+idx)) // OKie, now we have a non-masked index destination
-         ++realRecvSize;
-    }
-
-    int localIndexDst;
-    recvTmp[recvRank].resize(realRecvSize);
-    realRecvSize = 0;
-    for (int idx = 0; idx < recvSize; ++idx)
-    {
-      if (0 != *(recvMask+idx)) // OKie, now we have a demand from non-masked index destination
-      {
-        recvTmp[recvRank][realRecvSize].first = globalLocalIndexGridDestSendToServer[recvIndexDst(idx)];
-        recvTmp[recvRank][realRecvSize].second = recvWeightDst(idx);
-         ++realRecvSize;
-      }
-    }
-  }
-
-  delete [] recvCount;
-  delete [] displ;
-  delete [] sendRankBuff;
-  delete [] recvRankBuff;
-  delete [] sendSizeBuff;
-  delete [] recvSizeBuff;
-
-  std::unordered_map<int, unsigned char* >::const_iterator itChar;
-  for (itChar = sendMaskDst.begin(); itChar != sendMaskDst.end(); ++itChar)
-    delete [] itChar->second;
-  for (itChar = recvMaskDst.begin(); itChar != recvMaskDst.end(); ++itChar)
-    delete [] itChar->second;
-  std::unordered_map<int, unsigned long* >::const_iterator itLong;
-  for (itLong = sendGlobalIndexSrc.begin(); itLong != sendGlobalIndexSrc.end(); ++itLong)
-    delete [] itLong->second;
-  for (itLong = recvGlobalIndexSrc.begin(); itLong != recvGlobalIndexSrc.end(); ++itLong)
-    delete [] itLong->second;
-
-}
-CATCH
-
-/*!
-  Local index of data which need sending from the grid source
-  \return local index of data
-*/
-const std::list<CGridTransformation::SendingIndexGridSourceMap>& CGridTransformation::getLocalIndexToSendFromGridSource() const
-TRY
-{
-  return localIndexToSendFromGridSource_;
-}
-CATCH
-
-/*!
-  Local index of data which will be received on the grid destination
-  \return local index of data
-*/
-const std::list<CGridTransformation::RecvIndexGridDestinationMap>& CGridTransformation::getLocalIndexToReceiveOnGridDest() const
-TRY
-{
-  return localIndexToReceiveOnGridDest_;
-}
-CATCH
-
-/*!
- Number of index will be received on the grid destination
-  \return number of index of data
-*/
-const std::list<size_t>& CGridTransformation::getNbLocalIndexToReceiveOnGridDest() const
-TRY
-{
-  return nbLocalIndexOnGridDest_;
-}
-CATCH
-
-}
Index: XIOS/dev/dev_trunk_graph/src/transformation/grid_transformation.hpp
===================================================================
--- XIOS/dev/dev_trunk_graph/src/transformation/grid_transformation.hpp	(revision 2019)
+++ 	(revision )
@@ -1,91 +1,0 @@
-/*!
-   \file grid_transformation.hpp
-   \author Ha NGUYEN
-   \since 14 May 2015
-   \date 26 Aug 2015
-
-   \brief Interface for all transformations.
- */
-#ifndef __XIOS_GRID_TRANSFORMATION_HPP__
-#define __XIOS_GRID_TRANSFORMATION_HPP__
-
-#include <map>
-#include <vector>
-#include "generic_algorithm_transformation.hpp"
-#include "transformation_enum.hpp"
-#include "duration.hpp"
-#include "grid_transformation_selector.hpp"
-
-namespace xios {
-
-class CGrid;
-
-/*!
-  \class CGridTransformation
-  This class is an interface for all transformations to interact with the rest of XIOS.
-The class, firstly, tries to get all information relating to requested transformations by retrieving directly from grid.
-Secondly, with all these information, all necessary transformations will be created by generic class \class CGenericAlgorithmTransformation.
-Then this class accomplishes the transformations by exchanging information among clients (e.g: some index need retrieving index from other clients),
-For each transformation, a new temporary grid source is created.
-For a consequential transformations (e.g: inversing -> zoom -> inversing -> ...),
-the grid destination of current transformation will be grid source of the next transformation
-*/
-class CGridTransformation : public CGridTransformationSelector
-{
-public:
-  typedef std::map<int, CArray<int,1> > SendingIndexGridSourceMap;
-  typedef std::map<int,std::vector<std::pair<int,double> > > RecvIndexGridDestinationMap;
-  typedef CGenericAlgorithmTransformation::SourceDestinationIndexMap SourceDestinationIndexMap;
-  typedef CGenericAlgorithmTransformation::AlgoTransType AlgoTransType;
-
-public:
-  /** Default constructor */
-  CGridTransformation(CGrid* destination, CGrid* source);
-  ~CGridTransformation();
-
-  void computeAll(const std::vector<CArray<double,1>* >& dataAuxInput=std::vector<CArray<double,1>* >(), Time timeStamp = 0);
-
-  const std::list<SendingIndexGridSourceMap>& getLocalIndexToSendFromGridSource() const;
-  const std::list<RecvIndexGridDestinationMap>& getLocalIndexToReceiveOnGridDest() const;
-  const std::list<size_t>& getNbLocalIndexToReceiveOnGridDest() const;
-
-  CGrid* getGridSource() { return originalGridSource_; }
-  CGrid* getGridDestination() { return gridDestination_; }
-
-protected:
-  void computeTransformation();
-
-  virtual void selectScalarAlgo(int elementPositionInGrid, ETranformationType transType, int transformationOrder);
-  virtual void selectAxisAlgo(int elementPositionInGrid, ETranformationType transType, int transformationOrder);
-  virtual void selectDomainAlgo(int elementPositionInGrid, ETranformationType transType, int transformationOrder);
-
-  void setUpGridSource(int elementPositionInGrid);
-  void setUpGridDestination(int elementPositionInGrid, ETranformationType);
-  void computeTransformationMapping(const SourceDestinationIndexMap& globalIndexWeightFromSrcToDest);
-  std::map<int,std::pair<int,int> > getElementPosition(CGrid* grid);
-
-protected:
-  //! The grid source of the first transformation (original grid source)
-  CGrid* tmpGridDestination_;
-  CGrid* originalGridSource_;
-  std::vector<CGrid*> tempGridSrcs_, tempGridDests_;
-
-protected:
-  //! Mapping of (grid) global index representing transformation.
-  std::map<size_t, std::set<size_t> > globaIndexMapFromDestToSource_;
-
-  //! Local index of data to send from grid source
-  std::list<SendingIndexGridSourceMap> localIndexToSendFromGridSource_;
-
-  //! Local index of data to receive on grid destination
-  std::list<RecvIndexGridDestinationMap> localIndexToReceiveOnGridDest_;
-
-  //! Number of local index of data to receive on grid destination
-  std::list<size_t> nbLocalIndexOnGridDest_;
-
-  bool dynamicalTransformation_;
-  std::set<Time> timeStamp_; //! Time stamps for auxillary inputs
-};
-
-}
-#endif // __XIOS_GRID_TRANSFORMATION_HPP__
Index: XIOS/dev/dev_trunk_graph/src/transformation/grid_transformation_selector.cpp
===================================================================
--- XIOS/dev/dev_trunk_graph/src/transformation/grid_transformation_selector.cpp	(revision 2019)
+++ 	(revision )
@@ -1,375 +1,0 @@
-/*!
-   \file grid_transformation.cpp
-   \author Ha NGUYEN
-   \since 14 May 2015
-   \date 02 Jul 2015
-
-   \brief Interface for all transformations.
- */
-#include "grid_transformation_selector.hpp"
-#include "grid.hpp"
-#include "algo_types.hpp"
-
-namespace xios {
-
-/*!
-  Register transformation to the framework
-*/
-void CGridTransformationSelector::registerTransformations()
-{
-  //! Scalar
-  CScalarAlgorithmReduceAxis::registerTrans();
-  CScalarAlgorithmExtractAxis::registerTrans();
-  CScalarAlgorithmReduceDomain::registerTrans();
-  CScalarAlgorithmReduceScalar::registerTrans();
-
-  //! Axis
-  CAxisAlgorithmZoom::registerTrans();
-  CAxisAlgorithmExtractDomain::registerTrans();
-  CAxisAlgorithmInterpolate::registerTrans();
-  CAxisAlgorithmExtract::registerTrans();
-  CAxisAlgorithmInverse::registerTrans();
-  CAxisAlgorithmReduceDomain::registerTrans();
-  CAxisAlgorithmReduceAxis::registerTrans();
-  CAxisAlgorithmTemporalSplitting::registerTrans();
-  CAxisAlgorithmDuplicateScalar::registerTrans();
-
-  //! Domain
-  CDomainAlgorithmComputeConnectivity::registerTrans();
-  CDomainAlgorithmInterpolate::registerTrans();
-  CDomainAlgorithmZoom::registerTrans();
-  CDomainAlgorithmExpand::registerTrans();
-  CDomainAlgorithmReorder::registerTrans();
-  CDomainAlgorithmExtract::registerTrans();
-}
-
-CGridTransformationSelector::CGridTransformationSelector(CGrid* destination, CGrid* source, TransformationType type)
- : gridSource_(source), gridDestination_(destination), isSameGrid_(false),
-  listAlgos_(), algoTypes_(), nbNormalAlgos_(0), nbSpecialAlgos_(0), auxInputs_()
-TRY
-{
-  if (0 == source)
-  {  gridSource_ = gridDestination_; }
-  if (gridSource_ == gridDestination_) isSameGrid_ = true;
-
-  //Verify the compatibity between two grids
-  int numElement = gridDestination_->axis_domain_order.numElements();
-  if (numElement != gridSource_->axis_domain_order.numElements())
-    ERROR("CGridTransformationSelector::CGridTransformationSelector(CGrid* destination, CGrid* source)",
-       << "Two grids have different number of elements"
-       << "Number of elements of grid source " <<gridSource_->getId() << " is " << gridSource_->axis_domain_order.numElements()  << std::endl
-       << "Number of elements of grid destination " <<gridDestination_->getId() << " is " << numElement);
-  registerTransformations();
-  initializeTransformations(type);
-}
-CATCH
-
-/*!
-  Initialize the mapping between the first grid source and the original one
-  In a series of transformation, for each step, there is a need to "create" a new grid that plays a role of "temporary" source.
-Because at the end of the series, we need to know about the index mapping between the final grid destination and original grid source,
-for each transformation, we need to make sure that the current "temporary source" maps its global index correctly to the original one.
-*/
-void CGridTransformationSelector::initializeTransformations(TransformationType type)
-TRY
-{
-  // Initialize algorithms
-  initializeAlgorithms();
-  ListAlgoType::iterator itb = listAlgos_.begin(),
-                         ite = listAlgos_.end(), it;
-
-  for (it = itb; it != ite; ++it)
-  {
-    ETranformationType transType = (it->second).first;
-    if (!isSpecialTransformation(transType))
-    {
-      ++nbNormalAlgos_;
-      if (special == type)
-      {
-        it = listAlgos_.erase(it);
-        --it;
-      }
-    }
-    else
-    {
-      ++nbSpecialAlgos_;
-      if (normal == type)
-      {
-        it = listAlgos_.erase(it);
-        --it;
-      }
-    }
-
-  }
-}
-CATCH
-
-CGridTransformationSelector::~CGridTransformationSelector()
-TRY
-{
-  std::vector<CGenericAlgorithmTransformation*>::const_iterator itb = algoTransformation_.begin(), it,
-                                                                ite = algoTransformation_.end();
-  for (it = itb; it != ite; ++it) delete (*it);
-}
-CATCH
-
-/*!
-  Update position of elements in grid source and grid destination as well as their positions in element list
-*/
-void CGridTransformationSelector::updateElementPosition()
-TRY
-{
-  int idxScalar = 0, idxAxis = 0, idxDomain = 0;
-  CArray<int,1> axisDomainOrderDst = gridDestination_->axis_domain_order;
-  std::map<int, int>().swap(elementPositionInGridDst2DomainPosition_);
-  std::map<int, int>().swap(elementPositionInGridDst2AxisPosition_);
-  std::map<int, int>().swap(elementPositionInGridDst2ScalarPosition_);
-  for (int i = 0; i < axisDomainOrderDst.numElements(); ++i)
-  {
-    int dimElement = axisDomainOrderDst(i);
-    if (2 == dimElement)
-    {
-      elementPositionInGridDst2DomainPosition_[i] = idxDomain;
-      ++idxDomain;
-    }
-    else if (1 == dimElement)
-    {
-      elementPositionInGridDst2AxisPosition_[i] = idxAxis;
-      ++idxAxis;
-    }
-    else
-    {
-      elementPositionInGridDst2ScalarPosition_[i] = idxScalar;
-      ++idxScalar;
-    }
-  }
-
-  idxScalar = idxAxis = idxDomain = 0;
-  CArray<int,1> axisDomainOrderSrc = gridSource_->axis_domain_order;
-  std::map<int, int>().swap(elementPositionInGridSrc2DomainPosition_);
-  std::map<int, int>().swap(elementPositionInGridSrc2AxisPosition_);
-  std::map<int, int>().swap(elementPositionInGridSrc2ScalarPosition_);
-  for (int i = 0; i < axisDomainOrderSrc.numElements(); ++i)
-  {
-    int dimElement = axisDomainOrderSrc(i);
-    if (2 == dimElement)
-    {
-      elementPositionInGridSrc2DomainPosition_[i] = idxDomain;
-      ++idxDomain;
-    }
-    else if (1 == dimElement)
-    {
-      elementPositionInGridSrc2AxisPosition_[i] = idxAxis;
-      ++idxAxis;
-    }
-    else
-    {
-      elementPositionInGridSrc2ScalarPosition_[i] = idxScalar;
-      ++idxScalar;
-    }
-  }
-}
-CATCH
-
-/*!
-  Initialize the algorithms (transformations)
-*/
-void CGridTransformationSelector::initializeAlgorithms()
-TRY
-{
-  updateElementPosition();
-  CArray<int,1> axisDomainOrderDst = gridDestination_->axis_domain_order;
-  for (int i = 0; i < axisDomainOrderDst.numElements(); ++i)
-  {
-    int dimElement = axisDomainOrderDst(i);
-    if (2 == dimElement)
-    {
-      initializeDomainAlgorithms(i);
-    }
-    else if (1 == dimElement)
-    {
-      initializeAxisAlgorithms(i);
-    }
-    else
-    {
-      initializeScalarAlgorithms(i);
-    }
-  }
-}
-CATCH
-
-/*!
-  Initialize the algorithms corresponding to transformation info contained in each scalar.
-If an scalar has transformations, these transformations will be represented in form of vector of CTransformation pointers
-In general, each scalar can have several transformations performed on itself. However, should they be done seperately or combinely (of course in order)?
-For now, one approach is to do these combinely but maybe this needs changing.
-\param [in] axisPositionInGrid position of an axis in grid. (for example: a grid with one domain and one scalar, position of domain is 0, position of axis is 1)
-*/
-void CGridTransformationSelector::initializeScalarAlgorithms(int scalarPositionInGrid)
-TRY
-{
-  std::vector<CScalar*> scalarListDestP = gridDestination_->getScalars();
-  std::vector<CScalar*> scalarListSrcP = gridSource_->getScalars();
-  if (!scalarListDestP.empty())
-  {
-    int scalarDstPos = -1, scalarSrcPos = -1;
-    if (0 < elementPositionInGridDst2ScalarPosition_.count(scalarPositionInGrid))
-      scalarDstPos = elementPositionInGridDst2ScalarPosition_[scalarPositionInGrid];
-    if (0 < elementPositionInGridSrc2ScalarPosition_.count(scalarPositionInGrid))
-      scalarSrcPos = elementPositionInGridSrc2ScalarPosition_[scalarPositionInGrid];
-
-    // If source and destination grid share the same scalar
-    if ((-1 != scalarDstPos) && (-1 != scalarSrcPos)  && !isSameGrid_ &&
-        ((scalarListDestP[scalarDstPos] == scalarListSrcP[scalarSrcPos]) ||
-         (scalarListDestP[scalarDstPos]->isEqual(scalarListSrcP[scalarSrcPos])))) return;
-
-    if (scalarListDestP[scalarDstPos]->hasTransformation())
-    {
-      CScalar::TransMapTypes trans = scalarListDestP[scalarDstPos]->getAllTransformations();
-      CScalar::TransMapTypes::const_iterator itb = trans.begin(), it,
-                                           ite = trans.end();
-      int transformationOrder = 0;
-      for (it = itb; it != ite; ++it)
-      {
-        listAlgos_.push_back(std::make_pair(scalarPositionInGrid, std::make_pair(it->first, std::make_pair(transformationOrder,0))));        
-        ++transformationOrder;
-        std::vector<StdString> auxInput = (it->second)->checkAuxInputs();
-        for (int idx = 0; idx < auxInput.size(); ++idx) auxInputs_.push_back(auxInput[idx]);
-      }
-    }
-  }
-}
-CATCH
-
-/*!
-  Initialize the algorithms corresponding to transformation info contained in each axis.
-If an axis has transformations, these transformations will be represented in form of vector of CTransformation pointers
-In general, each axis can have several transformations performed on itself. However, should they be done seperately or combinely (of course in order)?
-For now, one approach is to do these combinely but maybe this needs changing.
-\param [in] axisPositionInGrid position of an axis in grid. (for example: a grid with one domain and one axis, position of domain is 1, position of axis is 2)
-*/
-void CGridTransformationSelector::initializeAxisAlgorithms(int axisPositionInGrid)
-TRY
-{
-  std::vector<CAxis*> axisListDestP = gridDestination_->getAxis();
-  std::vector<CAxis*> axisListSrcP = gridSource_->getAxis();
-  if (!axisListDestP.empty())
-  {
-    int axisDstPos = -1, axisSrcPos = -1;
-    if (0 < elementPositionInGridDst2AxisPosition_.count(axisPositionInGrid))
-      axisDstPos = elementPositionInGridDst2AxisPosition_[axisPositionInGrid];
-    if (0 < elementPositionInGridSrc2AxisPosition_.count(axisPositionInGrid))
-      axisSrcPos = elementPositionInGridSrc2AxisPosition_[axisPositionInGrid];
-
-    // If source and destination grid share the same axis
-    if ((-1 != axisDstPos) && (-1 != axisSrcPos) && !isSameGrid_ &&
-        ((axisListDestP[axisDstPos] == axisListSrcP[axisSrcPos]) ||
-         (axisListDestP[axisDstPos]->isEqual(axisListSrcP[axisSrcPos]))) ) return;
-
-    if (axisListDestP[axisDstPos]->hasTransformation())
-    {
-      CAxis::TransMapTypes trans = axisListDestP[axisDstPos]->getAllTransformations();
-      CAxis::TransMapTypes::const_iterator itb = trans.begin(), it,
-                                           ite = trans.end();
-      int transformationOrder = 0;
-      for (it = itb; it != ite; ++it)
-      {
-        listAlgos_.push_back(std::make_pair(axisPositionInGrid, std::make_pair(it->first, std::make_pair(transformationOrder,1))));        
-        ++transformationOrder;
-        std::vector<StdString> auxInput = (it->second)->checkAuxInputs();
-        for (int idx = 0; idx < auxInput.size(); ++idx) auxInputs_.push_back(auxInput[idx]);
-      }
-    }
-  }
-}
-CATCH
-
-/*!
-  Initialize the algorithms corresponding to transformation info contained in each domain.
-If a domain has transformations, they will be represented in form of vector of CTransformation pointers
-In general, each domain can have several transformations performed on itself.
-\param [in] domPositionInGrid position of a domain in grid. (for example: a grid with one domain and one axis, position of domain is 1, position of axis is 2)
-*/
-void CGridTransformationSelector::initializeDomainAlgorithms(int domPositionInGrid)
-TRY
-{
-  std::vector<CDomain*> domListDestP = gridDestination_->getDomains();
-  std::vector<CDomain*> domListSrcP = gridSource_->getDomains();
-  if (!domListDestP.empty())
-  {
-    int domDstPos = -1, domSrcPos = -1;
-    if (0 < elementPositionInGridDst2DomainPosition_.count(domPositionInGrid))
-      domDstPos = elementPositionInGridDst2DomainPosition_[domPositionInGrid];
-    if (0 < elementPositionInGridSrc2DomainPosition_.count(domPositionInGrid))
-      domSrcPos = elementPositionInGridSrc2DomainPosition_[domPositionInGrid];
-
-    // If source and destination grid share the same domain
-    if ((-1 != domDstPos) && (-1 != domSrcPos) && !isSameGrid_ &&
-        ((domListDestP[domDstPos] == domListSrcP[domSrcPos]) ||
-         (domListDestP[domDstPos]->isEqual(domListSrcP[domSrcPos])))) return;
-
-    if (domListDestP[domDstPos]->hasTransformation())
-    {
-      CDomain::TransMapTypes trans = domListDestP[domDstPos]->getAllTransformations();
-      CDomain::TransMapTypes::const_iterator itb = trans.begin(), it,
-                                             ite = trans.end();
-      int transformationOrder = 0;
-      for (it = itb; it != ite; ++it)
-      {
-        listAlgos_.push_back(std::make_pair(domPositionInGrid, std::make_pair(it->first, std::make_pair(transformationOrder,2))));        
-        ++transformationOrder;
-        std::vector<StdString> auxInput = (it->second)->checkAuxInputs();
-        for (int idx = 0; idx < auxInput.size(); ++idx) auxInputs_.push_back(auxInput[idx]);
-      }
-    }
-  }
-}
-CATCH
-
-/*!
-  Select algorithm correspoding to its transformation type and its position in each element
-  \param [in] elementPositionInGrid position of element in grid. e.g: a grid has 1 domain and 1 axis, then position of domain is 1 (because it contains 2 basic elements)
-                                             and position of axis is 2
-  \param [in] transType transformation type, for now we have Zoom_axis, inverse_axis
-  \param [in] transformationOrder position of the transformation in an element (an element can have several transformation)
-  \param [in] algoType flag to specify type of algorithm (2 for domain, 1 for axis and 0 for scalar) 
-*/
-void CGridTransformationSelector::selectAlgo(int elementPositionInGrid, ETranformationType transType, int transformationOrder, int algoType)
-TRY
-{
-  updateElementPosition();
-  switch (algoType)
-  {
-  case 0:
-    selectScalarAlgo(elementPositionInGrid, transType, transformationOrder);
-    break;
-  case 1:
-    selectAxisAlgo(elementPositionInGrid, transType, transformationOrder);
-    break;
-  case 2:
-    selectDomainAlgo(elementPositionInGrid, transType, transformationOrder);
-    break;
-  default:
-    break;
-  }
-}
-CATCH
-
-bool CGridTransformationSelector::isSpecialTransformation(ETranformationType transType)
-TRY
-{
-  bool res = false;
-  switch (transType)
-  {
-    case TRANS_GENERATE_RECTILINEAR_DOMAIN:
-     res = true;
-     break;
-    default:
-     break;
-  }
-
-  return res;
-}
-CATCH
-
-}
Index: XIOS/dev/dev_trunk_graph/src/transformation/grid_transformation_selector.hpp
===================================================================
--- XIOS/dev/dev_trunk_graph/src/transformation/grid_transformation_selector.hpp	(revision 2019)
+++ 	(revision )
@@ -1,112 +1,0 @@
-/*!
-   \file grid_transformation.hpp
-   \author Ha NGUYEN
-   \since 23 June 2016
-   \date 23 June 2016
-
-   \brief Helper class to select different transformations.
- */
-#ifndef __XIOS_GRID_TRANSFORMATION_SELECTOR_HPP__
-#define __XIOS_GRID_TRANSFORMATION_SELECTOR_HPP__
-
-#include <map>
-#include <vector>
-#include "generic_algorithm_transformation.hpp"
-#include "transformation_enum.hpp"
-#include "duration.hpp"
-
-namespace xios {
-
-class CGrid;
-
-/*!
-  \class CGridTransformationSelector
-  This class is a helper class to chose a algorithm (transformation) from the algorithm list of
-specific grid.
-*/
-class CGridTransformationSelector
-{
-public:
-  // Stupid C++98, should be replaced with tuple.
-  // List of algorithm to process. Order of element in this list
-  // <Position of element in grid, <transformationType, <transformation order, alogrithm type> > >
-  typedef std::list<std::pair<int,std::pair<ETranformationType,std::pair<int,int> > > > ListAlgoType;
-protected:
-  enum AlgoType {
-    scalarType = 0, axisType = 1, domainType = 2
-  };
-
-protected:
-  enum TransformationType {
-    special = 0, normal = 1
-  };
-
-public:
-  /** Default constructor */
-  CGridTransformationSelector(CGrid* destination, CGrid* source, TransformationType type = normal);
-  virtual ~CGridTransformationSelector();
-
-  ListAlgoType getAlgoList() const { return listAlgos_; }
-  int getNbAlgo() { return nbNormalAlgos_; }
-  const std::vector<StdString>& getAuxInputs() const { return auxInputs_; }
-  const std::vector<CGenericAlgorithmTransformation*>& getAlgos() const { return algoTransformation_; }
-  const std::map<int, int> getElementPositionInGridSrc2AxisPosition() const { return elementPositionInGridSrc2AxisPosition_ ;}
-  const std::map<int, int> getElementPositionInGridSrc2DomainPosition() const { return elementPositionInGridSrc2DomainPosition_ ;}
-  const std::map<int, int> getElementPositionInGridSrc2ScalarPosition() const { return elementPositionInGridSrc2ScalarPosition_ ;}
-  const std::map<int, int> getElementPositionInGridDst2AxisPosition() const { return elementPositionInGridDst2AxisPosition_ ;}
-  const std::map<int, int> getElementPositionInGridDst2DomainPosition() const { return elementPositionInGridDst2DomainPosition_ ;}
-  const std::map<int, int> getElementPositionInGridDst2ScalarPosition() const { return elementPositionInGridDst2ScalarPosition_ ;}
-
-
-protected:
-  void updateElementPosition();
-  void initializeAlgorithms();
-  void initializeDomainAlgorithms(int domPositionInGrid);
-  void initializeAxisAlgorithms(int axisPositionInGrid);
-  void initializeScalarAlgorithms(int scalarPositionInGrid);
-  void initializeTransformations(TransformationType type);
-  void selectAlgo(int elementPositionInGrid, ETranformationType transType, int transformationOrder, int algo);
-  bool isSpecialTransformation(ETranformationType transType);
-  void registerTransformations();
-
-protected:
-  virtual void selectScalarAlgo(int elementPositionInGrid, ETranformationType transType, int transformationOrder) = 0;
-  virtual void selectAxisAlgo(int elementPositionInGrid, ETranformationType transType, int transformationOrder) = 0;
-  virtual void selectDomainAlgo(int elementPositionInGrid, ETranformationType transType, int transformationOrder) = 0;
-
-protected:
-  //! Grid source on transformation
-  CGrid* gridSource_;
-
-  //! Grid destination on transformation
-  CGrid* gridDestination_;
-
-  //! Grid source and grid destination it's the same
-  bool isSameGrid_;
-
-protected:
-  //! List of algorithm types and their order
-  ListAlgoType listAlgos_;
-
-  //! Number of normal algorithm
-  int nbNormalAlgos_;
-
-  //! Number of special algorithms (such as generate_rectilinear_grid)
-  int nbSpecialAlgos_;
-
-  // true if domain algorithm and false if axis algorithm (can be replaced by tuple with listAlgos_
-  std::vector<AlgoType> algoTypes_;
-
-  // Mapping between position of an element in grid and its transformation (if any)
-  std::vector<CGenericAlgorithmTransformation*> algoTransformation_;
-
-  //! Position of scalar, axis and domain in grid
-  std::map<int, int> elementPositionInGridSrc2AxisPosition_, elementPositionInGridSrc2DomainPosition_, elementPositionInGridSrc2ScalarPosition_;
-  std::map<int, int> elementPositionInGridDst2AxisPosition_, elementPositionInGridDst2DomainPosition_, elementPositionInGridDst2ScalarPosition_;
-
-  std::vector<StdString> auxInputs_;
-  std::set<Time> timeStamp_; //! Time stamps for auxillary inputs
-};
-
-}
-#endif // __XIOS_GRID_TRANSFORMATION_SELECTOR_HPP__
Index: XIOS/dev/dev_trunk_graph/src/transformation/scalar_algorithm_extract_axis.cpp
===================================================================
--- XIOS/dev/dev_trunk_graph/src/transformation/scalar_algorithm_extract_axis.cpp	(revision 2019)
+++ 	(revision )
@@ -1,92 +1,0 @@
-/*!
-   \file scalar_algorithm_extract_scalar.cpp
-   \author Ha NGUYEN
-   \since 23 June 2016
-   \date 23 June 2016
-
-   \brief Algorithm for extract an axis to a scalar
- */
-#include "scalar_algorithm_extract_axis.hpp"
-#include "axis.hpp"
-#include "scalar.hpp"
-#include "extract_axis_to_scalar.hpp"
-#include "grid.hpp"
-#include "grid_transformation_factory_impl.hpp"
-
-#include "reduction.hpp"
-
-namespace xios {
-CGenericAlgorithmTransformation* CScalarAlgorithmExtractAxis::create(CGrid* gridDst, CGrid* gridSrc,
-                                                                     CTransformation<CScalar>* transformation,
-                                                                     int elementPositionInGrid,
-                                                                     std::map<int, int>& elementPositionInGridSrc2ScalarPosition,
-                                                                     std::map<int, int>& elementPositionInGridSrc2AxisPosition,
-                                                                     std::map<int, int>& elementPositionInGridSrc2DomainPosition,
-                                                                     std::map<int, int>& elementPositionInGridDst2ScalarPosition,
-                                                                     std::map<int, int>& elementPositionInGridDst2AxisPosition,
-                                                                     std::map<int, int>& elementPositionInGridDst2DomainPosition)
-TRY
-{
-  std::vector<CScalar*> scalarListDestP = gridDst->getScalars();
-  std::vector<CAxis*> axisListSrcP  = gridSrc->getAxis();
-
-  CExtractAxisToScalar* extractAxis = dynamic_cast<CExtractAxisToScalar*> (transformation);
-  int scalarDstIndex = elementPositionInGridDst2ScalarPosition[elementPositionInGrid];
-  int axisSrcIndex = elementPositionInGridSrc2AxisPosition[elementPositionInGrid];
-
-  return (new CScalarAlgorithmExtractAxis(scalarListDestP[scalarDstIndex], axisListSrcP[axisSrcIndex], extractAxis));
-}
-CATCH
-
-bool CScalarAlgorithmExtractAxis::registerTrans()
-TRY
-{
-  CGridTransformationFactory<CScalar>::registerTransformation(TRANS_EXTRACT_AXIS_TO_SCALAR, create);
-}
-CATCH
-
-CScalarAlgorithmExtractAxis::CScalarAlgorithmExtractAxis(CScalar* scalarDestination, CAxis* axisSource, CExtractAxisToScalar* algo)
- : CScalarAlgorithmTransformation(scalarDestination, axisSource),
-   reduction_(0)
-TRY
-{
-  algo->checkValid(scalarDestination, axisSource);
-  StdString op = "extract";
-  pos_ = algo->position;
-  reduction_ = CReductionAlgorithm::createOperation(CReductionAlgorithm::ReductionOperations[op]);
-}
-CATCH
-
-void CScalarAlgorithmExtractAxis::apply(const std::vector<std::pair<int,double> >& localIndex,
-                                         const double* dataInput,
-                                         CArray<double,1>& dataOut,
-                                         std::vector<bool>& flagInitial,                     
-                                         bool ignoreMissingValue, bool firstPass)
-TRY
-{
-  reduction_->apply(localIndex, dataInput, dataOut, flagInitial, ignoreMissingValue, firstPass);
-}
-CATCH
-
-CScalarAlgorithmExtractAxis::~CScalarAlgorithmExtractAxis()
-TRY
-{
-  if (0 != reduction_) delete reduction_;
-}
-CATCH
-
-void CScalarAlgorithmExtractAxis::computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs)
-TRY
-{
-  this->transformationMapping_.resize(1);
-  this->transformationWeight_.resize(1);
-
-  TransformationIndexMap& transMap = this->transformationMapping_[0];
-  TransformationWeightMap& transWeight = this->transformationWeight_[0];
-
-  transMap[0].push_back(pos_);
-  transWeight[0].push_back(1.0);
-}
-CATCH
-
-}
Index: XIOS/dev/dev_trunk_graph/src/transformation/scalar_algorithm_extract_axis.hpp
===================================================================
--- XIOS/dev/dev_trunk_graph/src/transformation/scalar_algorithm_extract_axis.hpp	(revision 2019)
+++ 	(revision )
@@ -1,65 +1,0 @@
-/*!
-   \file scalar_algorithm_extract_scalar.hpp
-   \author Ha NGUYEN
-   \since 23 June 2016
-   \date 23 June 2016
-
-   \brief Algorithm for extract an axis to a scalar
- */
-#ifndef __XIOS_SCALAR_ALGORITHM_EXTRACT_AXIS_HPP__
-#define __XIOS_SCALAR_ALGORITHM_EXTRACT_AXIS_HPP__
-
-#include "scalar_algorithm_transformation.hpp"
-#include "transformation.hpp"
-
-namespace xios {
-
-class CScalar;
-class CAxis;
-class CExtractAxisToScalar;
-class CReductionAlgorithm;
-
-/*!
-  \class CScalarAlgorithmExtractAxis
-  Extract a scalar from an axis
-*/
-class CScalarAlgorithmExtractAxis : public CScalarAlgorithmTransformation
-{
-public:
-  CScalarAlgorithmExtractAxis(CScalar* scalarDestination, CAxis* axisSource, CExtractAxisToScalar* algo);
-
-  virtual void apply(const std::vector<std::pair<int,double> >& localIndex,
-                     const double* dataInput,
-                     CArray<double,1>& dataOut,
-                     std::vector<bool>& flagInitial,                     
-                     bool ignoreMissingValue, bool firstPass);
-
-  virtual ~CScalarAlgorithmExtractAxis();
-
-  static bool registerTrans();
-
-  virtual StdString getName() {return "Scalar Trans. Filter \\n Extract Axis";}
-
-protected:
-  int pos_;
-
-protected:
-  void computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs);
-
-protected:
-  CReductionAlgorithm* reduction_;
-
-private:
-  static CGenericAlgorithmTransformation* create(CGrid* gridDst, CGrid* gridSrc,
-                                                CTransformation<CScalar>* transformation,
-                                                int elementPositionInGrid,
-                                                std::map<int, int>& elementPositionInGridSrc2ScalarPosition,
-                                                std::map<int, int>& elementPositionInGridSrc2AxisPosition,
-                                                std::map<int, int>& elementPositionInGridSrc2DomainPosition,
-                                                std::map<int, int>& elementPositionInGridDst2ScalarPosition,
-                                                std::map<int, int>& elementPositionInGridDst2AxisPosition,
-                                                std::map<int, int>& elementPositionInGridDst2DomainPosition);
-};
-
-}
-#endif // __XIOS_SCALAR_ALGORITHM_EXTRACT_AXIS_HPP__
Index: XIOS/dev/dev_trunk_graph/src/transformation/scalar_algorithm_reduce_axis.cpp
===================================================================
--- XIOS/dev/dev_trunk_graph/src/transformation/scalar_algorithm_reduce_axis.cpp	(revision 2019)
+++ 	(revision )
@@ -1,132 +1,0 @@
-/*!
-   \file scalar_algorithm_reduce_scalar.cpp
-   \author Ha NGUYEN
-   \since 23 June 2016
-   \date 23 June 2016
-
-   \brief Algorithm for reduce an axis to a scalar
- */
-#include "scalar_algorithm_reduce_axis.hpp"
-#include "axis.hpp"
-#include "scalar.hpp"
-#include "reduce_axis_to_scalar.hpp"
-#include "grid.hpp"
-#include "grid_transformation_factory_impl.hpp"
-
-#include "reduction.hpp"
-
-namespace xios {
-CGenericAlgorithmTransformation* CScalarAlgorithmReduceAxis::create(CGrid* gridDst, CGrid* gridSrc,
-                                                                     CTransformation<CScalar>* transformation,
-                                                                     int elementPositionInGrid,
-                                                                     std::map<int, int>& elementPositionInGridSrc2ScalarPosition,
-                                                                     std::map<int, int>& elementPositionInGridSrc2AxisPosition,
-                                                                     std::map<int, int>& elementPositionInGridSrc2DomainPosition,
-                                                                     std::map<int, int>& elementPositionInGridDst2ScalarPosition,
-                                                                     std::map<int, int>& elementPositionInGridDst2AxisPosition,
-                                                                     std::map<int, int>& elementPositionInGridDst2DomainPosition)
-TRY
-{
-  std::vector<CScalar*> scalarListDestP = gridDst->getScalars();
-  std::vector<CAxis*> axisListSrcP  = gridSrc->getAxis();
-
-  CReduceAxisToScalar* reduceAxis = dynamic_cast<CReduceAxisToScalar*> (transformation);
-  int scalarDstIndex = elementPositionInGridDst2ScalarPosition[elementPositionInGrid];
-  int axisSrcIndex = elementPositionInGridSrc2AxisPosition[elementPositionInGrid];
-
-  return (new CScalarAlgorithmReduceAxis(scalarListDestP[scalarDstIndex], axisListSrcP[axisSrcIndex], reduceAxis));
-}
-CATCH
-
-bool CScalarAlgorithmReduceAxis::registerTrans()
-TRY
-{
-  CGridTransformationFactory<CScalar>::registerTransformation(TRANS_REDUCE_AXIS_TO_SCALAR, create);
-}
-CATCH
-
-CScalarAlgorithmReduceAxis::CScalarAlgorithmReduceAxis(CScalar* scalarDestination, CAxis* axisSource, CReduceAxisToScalar* algo)
- : CScalarAlgorithmTransformation(scalarDestination, axisSource),
-   reduction_(0)
-TRY
-{
-  if (algo->operation.isEmpty())
-    ERROR("CScalarAlgorithmReduceAxis::CScalarAlgorithmReduceAxis(CAxis* axisDestination, CAxis* axisSource, CReduceAxisToScalar* algo)",
-           << "Operation must be defined."
-           << "Axis source " <<axisSource->getId() << std::endl
-           << "Scalar destination " << scalarDestination->getId());
-  StdString op;
-  switch (algo->operation)
-  {
-    case CReduceAxisToScalar::operation_attr::sum:
-      op = "sum";
-      break;
-    case CReduceAxisToScalar::operation_attr::min:
-      op = "min";
-      break;
-    case CReduceAxisToScalar::operation_attr::max:
-      op = "max";
-      break;
-    case CReduceAxisToScalar::operation_attr::average:
-      op = "average";
-      break;
-    default:
-        ERROR("CScalarAlgorithmReduceAxis::CScalarAlgorithmReduceAxis(CScalar* scalarDestination, CAxis* axisSource, CReduceAxisToScalar* algo)",
-         << "Operation is wrongly defined. Supported operations: sum, min, max, average." << std::endl
-         << "Domain source " <<axisSource->getId() << std::endl
-         << "Scalar destination " << scalarDestination->getId());
-
-  }
-  
-  if (CReductionAlgorithm::ReductionOperations.end() == CReductionAlgorithm::ReductionOperations.find(op))
-    ERROR("CScalarAlgorithmReduceAxis::CScalarAlgorithmReduceAxis(CAxis* axisDestination, CAxis* axisSource, CReduceAxisToScalar* algo)",
-       << "Operation '" << op << "' not found. Please make sure to use a supported one"
-       << "Axis source " <<axisSource->getId() << std::endl
-       << "Scalar destination " << scalarDestination->getId());
-
-  reduction_ = CReductionAlgorithm::createOperation(CReductionAlgorithm::ReductionOperations[op]);
-}
-CATCH
-
-void CScalarAlgorithmReduceAxis::apply(const std::vector<std::pair<int,double> >& localIndex, const double* dataInput, CArray<double,1>& dataOut,
-                                         std::vector<bool>& flagInitial, bool ignoreMissingValue, bool firstPass)
-TRY
-{
-  reduction_->apply(localIndex, dataInput, dataOut, flagInitial, ignoreMissingValue, firstPass);
-}
-CATCH
-
-void CScalarAlgorithmReduceAxis::updateData(CArray<double,1>& dataOut)
-TRY
-{
-  reduction_->updateData(dataOut);
-}
-CATCH
-
-CScalarAlgorithmReduceAxis::~CScalarAlgorithmReduceAxis()
-TRY
-{
-  if (0 != reduction_) delete reduction_;
-}
-CATCH
-
-void CScalarAlgorithmReduceAxis::computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs)
-TRY
-{
-  this->transformationMapping_.resize(1);
-  this->transformationWeight_.resize(1);
-
-  TransformationIndexMap& transMap = this->transformationMapping_[0];
-  TransformationWeightMap& transWeight = this->transformationWeight_[0];
-
-  int globalIndexSize = axisSrc_-> n_glo;
-
-  for (int idx = 0; idx < globalIndexSize; ++idx)
-  {
-    transMap[0].push_back(idx);
-    transWeight[0].push_back(1.0);
-  }
-}
-CATCH
-
-}
Index: XIOS/dev/dev_trunk_graph/src/transformation/scalar_algorithm_reduce_axis.hpp
===================================================================
--- XIOS/dev/dev_trunk_graph/src/transformation/scalar_algorithm_reduce_axis.hpp	(revision 2019)
+++ 	(revision )
@@ -1,65 +1,0 @@
-/*!
-   \file scalar_algorithm_reduce_scalar.hpp
-   \author Ha NGUYEN
-   \since 23 June 2016
-   \date 23 June 2016
-
-   \brief Algorithm for reduce an axis to a scalar
- */
-#ifndef __XIOS_SCALAR_ALGORITHM_REDUCE_AXIS_HPP__
-#define __XIOS_SCALAR_ALGORITHM_REDUCE_AXIS_HPP__
-
-#include "scalar_algorithm_transformation.hpp"
-#include "transformation.hpp"
-
-namespace xios {
-
-class CScalar;
-class CAxis;
-class CReduceAxisToScalar;
-class CReductionAlgorithm;
-
-/*!
-  \class CScalarAlgorithmReduceAxis
-  Reducing an axis to a scalar
-*/
-class CScalarAlgorithmReduceAxis : public CScalarAlgorithmTransformation
-{
-public:
-  CScalarAlgorithmReduceAxis(CScalar* scalarDestination, CAxis* axisSource, CReduceAxisToScalar* algo);
-
-  virtual void apply(const std::vector<std::pair<int,double> >& localIndex,
-                     const double* dataInput,
-                     CArray<double,1>& dataOut,
-                     std::vector<bool>& flagInitial,
-                     bool ignoreMissingValue, bool firstPass);
-
-  virtual void updateData(CArray<double,1>& dataOut);
-  
-  virtual ~CScalarAlgorithmReduceAxis();
-
-  static bool registerTrans();
-
-  virtual StdString getName() {return "Scalar Trans. Filter \\n Reduce Axis";}
-
-protected:
-  void computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs);
-
-protected:
-  CReductionAlgorithm* reduction_;
-
-private:
-
-  static CGenericAlgorithmTransformation* create(CGrid* gridDst, CGrid* gridSrc,
-                                                CTransformation<CScalar>* transformation,
-                                                int elementPositionInGrid,
-                                                std::map<int, int>& elementPositionInGridSrc2ScalarPosition,
-                                                std::map<int, int>& elementPositionInGridSrc2AxisPosition,
-                                                std::map<int, int>& elementPositionInGridSrc2DomainPosition,
-                                                std::map<int, int>& elementPositionInGridDst2ScalarPosition,
-                                                std::map<int, int>& elementPositionInGridDst2AxisPosition,
-                                                std::map<int, int>& elementPositionInGridDst2DomainPosition);
-};
-
-}
-#endif // __XIOS_SCALAR_ALGORITHM_REDUCE_AXIS_HPP__
Index: XIOS/dev/dev_trunk_graph/src/transformation/scalar_algorithm_reduce_domain.cpp
===================================================================
--- XIOS/dev/dev_trunk_graph/src/transformation/scalar_algorithm_reduce_domain.cpp	(revision 2019)
+++ 	(revision )
@@ -1,154 +1,0 @@
-/*!
-   \file scalar_algorithm_reduce_domain.cpp
-   \author Ha NGUYEN
-   \since 23 June 2016
-   \date 23 June 2016
-
-   \brief Algorithm for reduce a domain to a scalar
- */
-#include "scalar_algorithm_reduce_domain.hpp"
-#include "domain.hpp"
-#include "scalar.hpp"
-#include "reduce_domain_to_scalar.hpp"
-#include "grid.hpp"
-#include "grid_transformation_factory_impl.hpp"
-
-#include "reduction.hpp"
-
-namespace xios {
-CGenericAlgorithmTransformation* CScalarAlgorithmReduceDomain::create(CGrid* gridDst, CGrid* gridSrc,
-                                                                     CTransformation<CScalar>* transformation,
-                                                                     int elementPositionInGrid,
-                                                                     std::map<int, int>& elementPositionInGridSrc2ScalarPosition,
-                                                                     std::map<int, int>& elementPositionInGridSrc2AxisPosition,
-                                                                     std::map<int, int>& elementPositionInGridSrc2DomainPosition,
-                                                                     std::map<int, int>& elementPositionInGridDst2ScalarPosition,
-                                                                     std::map<int, int>& elementPositionInGridDst2AxisPosition,
-                                                                     std::map<int, int>& elementPositionInGridDst2DomainPosition)
-TRY
-{
-  std::vector<CScalar*> scalarListDestP = gridDst->getScalars();
-  std::vector<CDomain*> domainListSrcP  = gridSrc->getDomains();
-
-  CReduceDomainToScalar* reduceDomain = dynamic_cast<CReduceDomainToScalar*> (transformation);
-  int scalarDstIndex = elementPositionInGridDst2ScalarPosition[elementPositionInGrid];
-  int domainSrcIndex = elementPositionInGridSrc2DomainPosition[elementPositionInGrid];
-
-  return (new CScalarAlgorithmReduceDomain(scalarListDestP[scalarDstIndex], domainListSrcP[domainSrcIndex], reduceDomain));
-}
-CATCH
-
-bool CScalarAlgorithmReduceDomain::registerTrans()
-TRY
-{
-  CGridTransformationFactory<CScalar>::registerTransformation(TRANS_REDUCE_DOMAIN_TO_SCALAR, create);
-}
-CATCH
-
-CScalarAlgorithmReduceDomain::CScalarAlgorithmReduceDomain(CScalar* scalarDestination, CDomain* domainSource, CReduceDomainToScalar* algo)
- : CScalarAlgorithmTransformation(scalarDestination, domainSource),
-   reduction_(0)
-TRY
-{
-  algo->checkValid(scalarDestination, domainSource);
-  
-  StdString op;
-  switch (algo->operation)
-  {
-    case CReduceDomainToScalar::operation_attr::sum:
-      op = "sum";
-      break;
-    case CReduceDomainToScalar::operation_attr::min:
-      op = "min";
-      break;
-    case CReduceDomainToScalar::operation_attr::max:
-      op = "max";
-      break;
-    case CReduceDomainToScalar::operation_attr::average:
-      op = "average";
-      break;
-    default:
-        ERROR("CScalarAlgorithmReduceDomain::CScalarAlgorithmReduceDomain(CDomain* domainDestination, CDomain* domainSource, CReduceDomainToScalar* algo)",
-         << "Operation must be defined."
-         << "Domain source " <<domainSource->getId() << std::endl
-         << "Scalar destination " << scalarDestination->getId());
-
-  }
-  
-  if (CReductionAlgorithm::ReductionOperations.end() == CReductionAlgorithm::ReductionOperations.find(op))
-    ERROR("CScalarAlgorithmReduceDomain::CScalarAlgorithmReduceDomain(CDomain* domainDestination, CDomain* domainSource, CReduceDomainToScalar* algo)",
-       << "Operation '" << op << "' not found. Please make sure to use a supported one"
-       << "Domain source " <<domainSource->getId() << std::endl
-       << "Scalar destination " << scalarDestination->getId());
-
-  reduction_ = CReductionAlgorithm::createOperation(CReductionAlgorithm::ReductionOperations[op]);
-  local = algo->local ;
-}
-CATCH
-
-void CScalarAlgorithmReduceDomain::apply(const std::vector<std::pair<int,double> >& localIndex,
-                                         const double* dataInput,
-                                         CArray<double,1>& dataOut,
-                                         std::vector<bool>& flagInitial,                     
-                                         bool ignoreMissingValue, bool firstPass)
-TRY
-{
-  reduction_->apply(localIndex, dataInput, dataOut, flagInitial, ignoreMissingValue, firstPass);
-}
-CATCH
-
-void CScalarAlgorithmReduceDomain::updateData(CArray<double,1>& dataOut)
-TRY
-{
-  reduction_->updateData(dataOut);
-}
-CATCH
-
-CScalarAlgorithmReduceDomain::~CScalarAlgorithmReduceDomain()
-TRY
-{
-  if (0 != reduction_) delete reduction_;
-}
-CATCH
-
-void CScalarAlgorithmReduceDomain::computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs)
-TRY
-{
-  this->transformationMapping_.resize(1);
-  this->transformationWeight_.resize(1);
-
-  TransformationIndexMap& transMap = this->transformationMapping_[0];
-  TransformationWeightMap& transWeight = this->transformationWeight_[0];
-
-  int ni_glo = domainSrc_->ni_glo ;
-  int nj_glo = domainSrc_->nj_glo ;
-  int nbDomainIdx ;
-  
-  if (local)
-  {
-      const CArray<int, 1>& i_index = domainSrc_-> i_index.getValue() ;
-      const CArray<int, 1>& j_index = domainSrc_-> j_index.getValue() ;
-      const CArray<bool,1>& localMask = domainSrc_-> localMask ;
-      int nbDomainIdx = i_index.numElements();
-
-      for (int idxDomain = 0; idxDomain < nbDomainIdx; ++idxDomain)
-      {
-        if (localMask(idxDomain))
-        { 
-          transMap[0].push_back(j_index(idxDomain)* ni_glo + i_index(idxDomain));
-          transWeight[0].push_back(1.0) ;
-        }
-      }
-  }
-  else
-  {  
-    nbDomainIdx = ni_glo * nj_glo;
-    transMap[0].resize(nbDomainIdx);
-    transWeight[0].resize(nbDomainIdx, 1.0);
-    for (int idxDomain = 0; idxDomain < nbDomainIdx; ++idxDomain) transMap[0][idxDomain] = idxDomain;    
-  }
-  
-}
-CATCH
-
-}
Index: XIOS/dev/dev_trunk_graph/src/transformation/scalar_algorithm_reduce_domain.hpp
===================================================================
--- XIOS/dev/dev_trunk_graph/src/transformation/scalar_algorithm_reduce_domain.hpp	(revision 2019)
+++ 	(revision )
@@ -1,66 +1,0 @@
-/*!
-   \file scalar_algorithm_reduce_scalar.hpp
-   \author Ha NGUYEN
-   \since 13 Oct 2016
-   \date 13 Oct 2016
-
-   \brief Algorithm for reduce an DOMAIN to a scalar
- */
-#ifndef __XIOS_SCALAR_ALGORITHM_REDUCE_DOMAIN_HPP__
-#define __XIOS_SCALAR_ALGORITHM_REDUCE_DOMAIN_HPP__
-
-#include "scalar_algorithm_transformation.hpp"
-#include "transformation.hpp"
-
-namespace xios {
-
-class CScalar;
-class CDomain;
-class CReduceDomainToScalar;
-class CReductionAlgorithm;
-
-/*!
-  \class CScalarAlgorithmReduceDomain
-  Reducing an DOMAIN to a scalar
-*/
-class CScalarAlgorithmReduceDomain : public CScalarAlgorithmTransformation
-{
-public:
-  CScalarAlgorithmReduceDomain(CScalar* scalarDestination, CDomain* domainSource, CReduceDomainToScalar* algo);
-
-  virtual void apply(const std::vector<std::pair<int,double> >& localIndex,
-                     const double* dataInput,
-                     CArray<double,1>& dataOut,
-                     std::vector<bool>& flagInitial,                     
-                     bool ignoreMissingValue, bool firstPass);
-
-  virtual void updateData(CArray<double,1>& dataOut);
-  
-  virtual ~CScalarAlgorithmReduceDomain();
-
-  static bool registerTrans();
-
-  virtual StdString getName() {return "Scalar Trans. Filter \\n Reduce Domain";}
-
-protected:
-  bool local ;
-  void computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs);
-
-protected:
-  CReductionAlgorithm* reduction_;
-
-private:
-
-  static CGenericAlgorithmTransformation* create(CGrid* gridDst, CGrid* gridSrc,
-                                                CTransformation<CScalar>* transformation,
-                                                int elementPositionInGrid,
-                                                std::map<int, int>& elementPositionInGridSrc2ScalarPosition,
-                                                std::map<int, int>& elementPositionInGridSrc2DOMAINPosition,
-                                                std::map<int, int>& elementPositionInGridSrc2DomainPosition,
-                                                std::map<int, int>& elementPositionInGridDst2ScalarPosition,
-                                                std::map<int, int>& elementPositionInGridDst2DOMAINPosition,
-                                                std::map<int, int>& elementPositionInGridDst2DomainPosition);
-};
-
-}
-#endif // __XIOS_SCALAR_ALGORITHM_REDUCE_DOMAIN_HPP__
Index: XIOS/dev/dev_trunk_graph/src/transformation/scalar_algorithm_reduce_scalar.cpp
===================================================================
--- XIOS/dev/dev_trunk_graph/src/transformation/scalar_algorithm_reduce_scalar.cpp	(revision 2019)
+++ 	(revision )
@@ -1,125 +1,0 @@
-/*!
-   \file scalar_algorithm_reduce_scalar.cpp
- 
-   \brief Algorithm for reduce an scalar to a scalar
- */
-#include "scalar_algorithm_reduce_scalar.hpp"
-#include "scalar.hpp"
-#include "reduce_scalar_to_scalar.hpp"
-#include "grid.hpp"
-#include "grid_transformation_factory_impl.hpp"
-#include "reduction.hpp"
-
-
-namespace xios {
-CGenericAlgorithmTransformation* CScalarAlgorithmReduceScalar::create(CGrid* gridDst, CGrid* gridSrc,
-                                                                     CTransformation<CScalar>* transformation,
-                                                                     int elementPositionInGrid,
-                                                                     std::map<int, int>& elementPositionInGridSrc2ScalarPosition,
-                                                                     std::map<int, int>& elementPositionInGridSrc2AxisPosition,
-                                                                     std::map<int, int>& elementPositionInGridSrc2DomainPosition,
-                                                                     std::map<int, int>& elementPositionInGridDst2ScalarPosition,
-                                                                     std::map<int, int>& elementPositionInGridDst2AxisPosition,
-                                                                     std::map<int, int>& elementPositionInGridDst2DomainPosition)
-TRY
-{
-  std::vector<CScalar*> scalarListDestP = gridDst->getScalars();
-  std::vector<CScalar*> scalarListSrcP  = gridSrc->getScalars();
-
-  CReduceScalarToScalar* reduceScalar = dynamic_cast<CReduceScalarToScalar*> (transformation);
-  int scalarDstIndex = elementPositionInGridDst2ScalarPosition[elementPositionInGrid];
-  int scalarSrcIndex = elementPositionInGridSrc2AxisPosition[elementPositionInGrid];
-
-  return (new CScalarAlgorithmReduceScalar(scalarListDestP[scalarDstIndex], scalarListSrcP[scalarSrcIndex], reduceScalar));
-}
-CATCH
-
-bool CScalarAlgorithmReduceScalar::registerTrans()
-TRY
-{
-  CGridTransformationFactory<CScalar>::registerTransformation(TRANS_REDUCE_SCALAR_TO_SCALAR, create);
-}
-CATCH
-
-CScalarAlgorithmReduceScalar::CScalarAlgorithmReduceScalar(CScalar* scalarDestination, CScalar* scalarSource, CReduceScalarToScalar* algo)
- : CScalarAlgorithmTransformation(scalarDestination, scalarSource),
-   reduction_(0)
-TRY
-{
-  eliminateRedondantSrc_= false ;
-  if (algo->operation.isEmpty())
-    ERROR("CScalarAlgorithmReduceScalar::CScalarAlgorithmReduceScalar(CScalar* scalarDestination, CScalar* scalarSource, CReduceScalarToScalar* algo)",
-           << "Operation must be defined."
-           << "Scalar source " <<scalarSource->getId() << std::endl
-           << "Scalar destination " << scalarDestination->getId());
-  StdString op;
-  switch (algo->operation)
-  {
-    case CReduceScalarToScalar::operation_attr::sum:
-      op = "sum";
-      break;
-    case CReduceScalarToScalar::operation_attr::min:
-      op = "min";
-      break;
-    case CReduceScalarToScalar::operation_attr::max:
-      op = "max";
-      break;
-    case CReduceScalarToScalar::operation_attr::average:
-      op = "average";
-      break;
-    default:
-        ERROR("CScalarAlgorithmReduceScalar::CScalarAlgorithmReduceScalar(CScalar* scalarDestination, CScalar* scalarSource, CReduceScalarToScalar* algo)",
-         << "Operation is wrongly defined. Supported operations: sum, min, max, average." << std::endl
-         << "Scalar source " <<scalarSource->getId() << std::endl
-         << "Scalar destination " << scalarDestination->getId());
-
-  }
-  
-  if (CReductionAlgorithm::ReductionOperations.end() == CReductionAlgorithm::ReductionOperations.find(op))
-    ERROR("CScalarAlgorithmReduceScalar::CScalarAlgorithmReduceScalar(CScalar* scalarDestination, CScalar* scalarSource, CReduceScalarToScalar* algo)",
-       << "Operation '" << op << "' not found. Please make sure to use a supported one"
-       << "Scalar source " <<scalarSource->getId() << std::endl
-       << "Scalar destination " << scalarDestination->getId());
-
-  reduction_ = CReductionAlgorithm::createOperation(CReductionAlgorithm::ReductionOperations[op]);
-}
-CATCH
-
-void CScalarAlgorithmReduceScalar::apply(const std::vector<std::pair<int,double> >& localIndex, const double* dataInput, CArray<double,1>& dataOut,
-                                         std::vector<bool>& flagInitial, bool ignoreMissingValue, bool firstPass)
-TRY
-{
-  reduction_->apply(localIndex, dataInput, dataOut, flagInitial, ignoreMissingValue, firstPass);
-}
-CATCH
-
-void CScalarAlgorithmReduceScalar::updateData(CArray<double,1>& dataOut)
-TRY
-{
-  reduction_->updateData(dataOut);
-}
-CATCH
-
-CScalarAlgorithmReduceScalar::~CScalarAlgorithmReduceScalar()
-TRY
-{
-  if (0 != reduction_) delete reduction_;
-}
-CATCH
-
-void CScalarAlgorithmReduceScalar::computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs)
-TRY
-{
-  this->transformationMapping_.resize(1);
-  this->transformationWeight_.resize(1);
-
-  TransformationIndexMap& transMap = this->transformationMapping_[0];
-  TransformationWeightMap& transWeight = this->transformationWeight_[0];
-
-  transMap[0].push_back(0);
-  transWeight[0].push_back(1.0);
-
-}
-CATCH
-
-}
Index: XIOS/dev/dev_trunk_graph/src/transformation/scalar_algorithm_reduce_scalar.hpp
===================================================================
--- XIOS/dev/dev_trunk_graph/src/transformation/scalar_algorithm_reduce_scalar.hpp	(revision 2019)
+++ 	(revision )
@@ -1,60 +1,0 @@
-/*!
-   \file scalar_algorithm_reduce_scalar.hpp
-   \brief Algorithm for reduce an scalar to a scalar
- */
-#ifndef __XIOS_SCALAR_ALGORITHM_REDUCE_SCALAR_HPP__
-#define __XIOS_SCALAR_ALGORITHM_REDUCE_SCALAR_HPP__
-
-#include "scalar_algorithm_transformation.hpp"
-#include "transformation.hpp"
-
-namespace xios {
-
-class CScalar;
-class CReduceScalarToScalar;
-class CReductionAlgorithm;
-
-/*!
-  \class CScalarAlgorithmReduceScalar
-  Reducing an scalar to a scalar
-*/
-class CScalarAlgorithmReduceScalar : public CScalarAlgorithmTransformation
-{
-public:
-  CScalarAlgorithmReduceScalar(CScalar* scalarDestination, CScalar* scalarSource, CReduceScalarToScalar* algo);
-
-  virtual void apply(const std::vector<std::pair<int,double> >& localIndex,
-                     const double* dataInput,
-                     CArray<double,1>& dataOut,
-                     std::vector<bool>& flagInitial,
-                     bool ignoreMissingValue, bool firstPass);
-
-  virtual void updateData(CArray<double,1>& dataOut);
-  
-  virtual ~CScalarAlgorithmReduceScalar();
-
-  static bool registerTrans();
-
-  virtual StdString getName() {return "Scalar Trans. Filter \\n Reduce Scalar";}
-
-protected:
-  void computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs);
-
-protected:
-  CReductionAlgorithm* reduction_;
-
-private:
-
-  static CGenericAlgorithmTransformation* create(CGrid* gridDst, CGrid* gridSrc,
-                                                CTransformation<CScalar>* transformation,
-                                                int elementPositionInGrid,
-                                                std::map<int, int>& elementPositionInGridSrc2ScalarPosition,
-                                                std::map<int, int>& elementPositionInGridSrc2AxisPosition,
-                                                std::map<int, int>& elementPositionInGridSrc2DomainPosition,
-                                                std::map<int, int>& elementPositionInGridDst2ScalarPosition,
-                                                std::map<int, int>& elementPositionInGridDst2AxisPosition,
-                                                std::map<int, int>& elementPositionInGridDst2DomainPosition);
-};
-
-}
-#endif // __XIOS_SCALAR_ALGORITHM_REDUCE_SCALAR_HPP__
Index: XIOS/dev/dev_trunk_graph/src/transformation/scalar_algorithm_transformation.cpp
===================================================================
--- XIOS/dev/dev_trunk_graph/src/transformation/scalar_algorithm_transformation.cpp	(revision 2019)
+++ 	(revision )
@@ -1,125 +1,0 @@
-/*!
-   \file scalar_algorithm_transformation.hpp
-   \author Ha NGUYEN
-   \since 23 June 2016
-   \date 23 Oct 2016
-
-   \brief Interface for all scalar transformation algorithms.
- */
-
-#include "scalar_algorithm_transformation.hpp"
-#include "context.hpp"
-#include "context_client.hpp"
-#include "client_client_dht_template.hpp"
-#include "domain.hpp"
-#include "axis.hpp"
-#include "scalar.hpp"
-
-namespace xios {
-
-CScalarAlgorithmTransformation::CScalarAlgorithmTransformation(CScalar* scalarDestination, CScalar* scalarSource)
- : CGenericAlgorithmTransformation(),
-   scalarDest_(scalarDestination),
-   scalarSrc_(scalarSource), axisSrc_(0), domainSrc_(0)
-{
-}
-
-CScalarAlgorithmTransformation::CScalarAlgorithmTransformation(CScalar* scalarDestination, CAxis* axisSource)
- : CGenericAlgorithmTransformation(),
-   scalarDest_(scalarDestination),
-   scalarSrc_(0), axisSrc_(axisSource), domainSrc_(0)
-{
-}
-
-CScalarAlgorithmTransformation::CScalarAlgorithmTransformation(CScalar* scalarDestination, CDomain* domainSource)
- : CGenericAlgorithmTransformation(),
-   scalarDest_(scalarDestination),
-   scalarSrc_(0), axisSrc_(0), domainSrc_(domainSource)
-{
-}
-
-CScalarAlgorithmTransformation::~CScalarAlgorithmTransformation()
-{
-}
-
-void CScalarAlgorithmTransformation::computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs)
-{
-}
-
-/*!
-  Compute global index of element source on different processes on knowing the global index source of transformation
-
-  \param [in] globalIndexElementSource global index source of transformation (represented in the transformation mapping)
-  \param [in] elementSourceType type of element source
-  \param [out] globalIndexElementSourceOnProc processes which contain the corresponding global index of scalar source
-*/
-void CScalarAlgorithmTransformation::computeExchangeGlobalIndex(const CArray<size_t,1>& globalIndexElementSource,
-                                                                int elementSourceType,
-                                                                CClientClientDHTInt::Index2VectorInfoTypeMap& globalIndexElementSourceOnProc)
-TRY
-{
-  CContext* context = CContext::getCurrent();
-  CContextClient* client=context->client;
-  int clientRank = client->clientRank;
-  int clientSize = client->clientSize;
-
-  if (2 == elementSourceType) // Source is a domain
-  {
-    size_t globalIndex;
-    int nIndexSize = domainSrc_->i_index.numElements();
-    CArray<int,1>& iIndex = domainSrc_->i_index;
-    CArray<int,1>& jIndex = domainSrc_->j_index;
-    int niGlo = domainSrc_->ni_glo;
-    CArray<bool,1>& localMask = domainSrc_ -> localMask ;
-    CClientClientDHTInt::Index2VectorInfoTypeMap globalIndex2ProcRank;
-    globalIndex2ProcRank.rehash(std::ceil(nIndexSize/globalIndex2ProcRank.max_load_factor()));
-    for (int idx = 0; idx < nIndexSize; ++idx)
-    {
-      if (localMask(idx))
-      {
-        globalIndex = jIndex(idx) * niGlo + iIndex(idx);
-        globalIndex2ProcRank[globalIndex].resize(1);
-        globalIndex2ProcRank[globalIndex][0] = clientRank;
-      }
-    }
-
-    CClientClientDHTInt dhtIndexProcRank(globalIndex2ProcRank, client->intraComm);
-    dhtIndexProcRank.computeIndexInfoMapping(globalIndexElementSource);
-    globalIndexElementSourceOnProc = dhtIndexProcRank.getInfoIndexMap();
-  }
-  else if (1 == elementSourceType) // Source is an axis
-  {
-    size_t globalIndex;
-    int nIndexSize = axisSrc_->index.numElements();
-    CClientClientDHTInt::Index2VectorInfoTypeMap globalIndex2ProcRank;
-    globalIndex2ProcRank.rehash(std::ceil(nIndexSize/globalIndex2ProcRank.max_load_factor()));
-    CArray<bool,1>& localMask = axisSrc_ -> mask ;
-   
-    for (int idx = 0; idx < nIndexSize; ++idx)
-    {
-      if (localMask(idx))
-      {
-        globalIndex = axisSrc_->index(idx);
-        globalIndex2ProcRank[globalIndex].resize(1);
-        globalIndex2ProcRank[globalIndex][0] = clientRank;
-      }
-    }
-
-    CClientClientDHTInt dhtIndexProcRank(globalIndex2ProcRank, client->intraComm);
-    dhtIndexProcRank.computeIndexInfoMapping(globalIndexElementSource);
-    globalIndexElementSourceOnProc = dhtIndexProcRank.getInfoIndexMap();
-  }
-  else // scalar
-  {
-    size_t globalIndex = 0;    
-    CClientClientDHTInt::Index2VectorInfoTypeMap globalIndex2ProcRank;
-    globalIndex2ProcRank[globalIndex].resize(1);
-    globalIndex2ProcRank[globalIndex][0] = clientRank;
-
-    CClientClientDHTInt dhtIndexProcRank(globalIndex2ProcRank, client->intraComm);
-    dhtIndexProcRank.computeIndexInfoMapping(globalIndexElementSource);
-    globalIndexElementSourceOnProc = dhtIndexProcRank.getInfoIndexMap();
-  }
-}
-CATCH
-}
Index: XIOS/dev/dev_trunk_graph/src/transformation/scalar_algorithm_transformation.hpp
===================================================================
--- XIOS/dev/dev_trunk_graph/src/transformation/scalar_algorithm_transformation.hpp	(revision 2019)
+++ 	(revision )
@@ -1,61 +1,0 @@
-/*!
-   \file scalar_algorithm_transformation.hpp
-   \author Ha NGUYEN
-   \since 23 June 2016
-   \date 23 June 2016
-
-   \brief Interface for all scalar transformation algorithms.
- */
-#ifndef __XIOS_SCALAR_ALGORITHM_TRANSFORMATION_HPP__
-#define __XIOS_SCALAR_ALGORITHM_TRANSFORMATION_HPP__
-
-#include "generic_algorithm_transformation.hpp"
-
-namespace xios {
-
-class CScalar;
-class CAxis;
-class CDomain;
-
-/*!
-  \class CScalarAlgorithmTransformation
-  Algorithms for scalar.
-*/
-class CScalarAlgorithmTransformation : public virtual CGenericAlgorithmTransformation
-{
-public:
-  CScalarAlgorithmTransformation(CScalar* scalarDestination, CScalar* scalarSource);
-  CScalarAlgorithmTransformation(CScalar* scalarDestination, CAxis* axisSource);
-  CScalarAlgorithmTransformation(CScalar* scalarDestination, CDomain* domainSource);
-
-  virtual ~CScalarAlgorithmTransformation();
-
-  virtual StdString getName() {return "Scalar Trans. Filter \\n Transformation";}
-
-protected:
-  void computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs);
-
-  virtual void computeExchangeGlobalIndex(const CArray<size_t,1>& globalScalarIndex,
-                                          int elementType,
-                                          CClientClientDHTInt::Index2VectorInfoTypeMap& globalScalarIndexOnProc);
-
-protected:
-  //! Global index of an scalar on grid destination
-  std::vector<int> scalarDestGlobalIndex_;
-
-  //! Size of
-  int scalarDestGlobalSize_;
-
-    //! Scalar on grid destination
-  CScalar* scalarDest_;
-
-  //! Scalar on grid source
-  CScalar* scalarSrc_;
-  //! Axis source
-  CAxis* axisSrc_;
-  //! Domain source
-  CDomain* domainSrc_;
-};
-
-}
-#endif // __XIOS_SCALAR_ALGORITHM_TRANSFORMATION_HPP__
