Index: /XIOS/trunk/Doxyfile
===================================================================
--- /XIOS/trunk/Doxyfile	(revision 1536)
+++ /XIOS/trunk/Doxyfile	(revision 1537)
@@ -1,16 +1,13 @@
-# Doxyfile 1.8.10
+# Doxyfile 1.7.4
 
 # This file describes the settings to be used by the documentation system
-# doxygen (www.doxygen.org) for a project.
+# doxygen (www.doxygen.org) for a project
 #
-# All text after a double hash (##) is considered a comment and is placed in
-# front of the TAG it is preceding.
-#
-# All text after a single hash (#) is considered a comment and will be ignored.
+# All text after a hash (#) is considered a comment and will be ignored
 # The format is:
-# TAG = value [value, ...]
-# For lists, items can also be appended using:
-# TAG += value [value, ...]
-# Values that contain spaces should be placed between quotes (\" \").
+#       TAG = value [value, ...]
+# For lists items can also be appended using:
+#       TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (" ")
 
 #---------------------------------------------------------------------------
@@ -18,104 +15,88 @@
 #---------------------------------------------------------------------------
 
-# This tag specifies the encoding used for all characters in the config file
-# that follow. The default is UTF-8 which is also the encoding used for all text
-# before the first occurrence of this tag. Doxygen uses libiconv (or the iconv
-# built into libc) for the transcoding. See http://www.gnu.org/software/libiconv
-# for the list of possible encodings.
-# The default value is: UTF-8.
+# This tag specifies the encoding used for all characters in the config file 
+# that follow. The default is UTF-8 which is also the encoding used for all 
+# text before the first occurrence of this tag. Doxygen uses libiconv (or the 
+# iconv built into libc) for the transcoding. See 
+# http://www.gnu.org/software/libiconv for the list of possible encodings.
 
 DOXYFILE_ENCODING      = UTF-8
 
-# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by
-# double-quotes, unless you are using Doxywizard) that should identify the
-# project for which the documentation is generated. This name is used in the
-# title of most generated pages and in a few other places.
-# The default value is: My Project.
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded 
+# by quotes) that should identify the project.
 
 PROJECT_NAME           = XIOS
 
-# The PROJECT_NUMBER tag can be used to enter a project or revision number. This
-# could be handy for archiving the generated documentation or if some version
-# control system is used.
+# The PROJECT_NUMBER tag can be used to enter a project or revision number. 
+# This could be handy for archiving the generated documentation or 
+# if some version control system is used.
 
 PROJECT_NUMBER         = 1.0
 
-# Using the PROJECT_BRIEF tag one can provide an optional one line description
-# for a project that appears at the top of each page and should give viewer a
-# quick idea about the purpose of the project. Keep the description short.
+# Using the PROJECT_BRIEF tag one can provide an optional one line description 
+# for a project that appears at the top of each page and should give viewer 
+# a quick idea about the purpose of the project. Keep the description short.
 
 PROJECT_BRIEF          = "Xml I/O Server"
 
-# With the PROJECT_LOGO tag one can specify a logo or an icon that is included
-# in the documentation. The maximum height of the logo should not exceed 55
-# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy
-# the logo to the output directory.
-
-PROJECT_LOGO           =
-
-# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path
-# into which the generated documentation will be written. If a relative path is
-# entered, it will be relative to the location where doxygen was started. If
-# left blank the current directory will be used.
+# With the PROJECT_LOGO tag one can specify an logo or icon that is 
+# included in the documentation. The maximum height of the logo should not 
+# exceed 55 pixels and the maximum width should not exceed 200 pixels. 
+# Doxygen will copy the logo to the output directory.
+
+PROJECT_LOGO           = 
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) 
+# base path where the generated documentation will be put. 
+# If a relative path is entered, it will be relative to the location 
+# where doxygen was started. If left blank the current directory will be used.
 
 OUTPUT_DIRECTORY       = ./doc
 
-# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub-
-# directories (in 2 levels) under the output directory of each output format and
-# will distribute the generated files over these directories. Enabling this
-# option can be useful when feeding doxygen a huge amount of source files, where
-# putting all generated files in the same directory would otherwise causes
-# performance problems for the file system.
-# The default value is: NO.
+# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 
+# 4096 sub-directories (in 2 levels) under the output directory of each output 
+# format and will distribute the generated files over these directories. 
+# Enabling this option can be useful when feeding doxygen a huge amount of 
+# source files, where putting all generated files in the same directory would 
+# otherwise cause performance problems for the file system.
 
 CREATE_SUBDIRS         = NO
 
-# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII
-# characters to appear in the names of generated files. If set to NO, non-ASCII
-# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode
-# U+3044.
-# The default value is: NO.
-
-ALLOW_UNICODE_NAMES    = NO
-
-# The OUTPUT_LANGUAGE tag is used to specify the language in which all
-# documentation generated by doxygen is written. Doxygen will use this
-# information to generate all constant output in the proper language.
-# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese,
-# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States),
-# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian,
-# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages),
-# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian,
-# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian,
-# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish,
-# Ukrainian and Vietnamese.
-# The default value is: English.
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all 
+# documentation generated by doxygen is written. Doxygen will use this 
+# information to generate all constant output in the proper language. 
+# The default language is English, other supported languages are: 
+# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, 
+# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, 
+# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English 
+# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, 
+# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak, 
+# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese.
 
 OUTPUT_LANGUAGE        = French
 
-# If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member
-# descriptions after the members that are listed in the file and class
-# documentation (similar to Javadoc). Set to NO to disable this.
-# The default value is: YES.
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will 
+# include brief member descriptions after the members that are listed in 
+# the file and class documentation (similar to JavaDoc). 
+# Set to NO to disable this.
 
 BRIEF_MEMBER_DESC      = YES
 
-# If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief
-# description of a member or function before the detailed description
-#
-# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend 
+# the brief description of a member or function before the detailed description. 
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the 
 # brief descriptions will be completely suppressed.
-# The default value is: YES.
 
 REPEAT_BRIEF           = YES
 
-# This tag implements a quasi-intelligent brief description abbreviator that is
-# used to form the text in various listings. Each string in this list, if found
-# as the leading text of the brief description, will be stripped from the text
-# and the result, after processing the whole list, is used as the annotated
-# text. Otherwise, the brief description is used as-is. If left blank, the
-# following values are used ($name is automatically replaced with the name of
-# the entity):The $name class, The $name widget, The $name file, is, provides,
-# specifies, contains, represents, a, an and the.
+# This tag implements a quasi-intelligent brief description abbreviator 
+# that is used to form the text in various listings. Each string 
+# in this list, if found as the leading text of the brief description, will be 
+# stripped from the text and the result after processing the whole list, is 
+# used as the annotated text. Otherwise, the brief description is used as-is. 
+# If left blank, the following values are used ("$name" is automatically 
+# replaced with the name of the entity): "The $name class" "The $name widget" 
+# "The $name file" "is" "provides" "specifies" "contains" 
+# "represents" "a" "an" "the"
 
 ABBREVIATE_BRIEF       = "The $name class" \
@@ -131,287 +112,211 @@
                          the
 
-# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
-# doxygen will generate a detailed section even if there is only a brief
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then 
+# Doxygen will generate a detailed section even if there is only a brief 
 # description.
-# The default value is: NO.
 
 ALWAYS_DETAILED_SEC    = NO
 
-# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
-# inherited members of a class in the documentation of that class as if those
-# members were ordinary class members. Constructors, destructors and assignment
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all 
+# inherited members of a class in the documentation of that class as if those 
+# members were ordinary class members. Constructors, destructors and assignment 
 # operators of the base classes will not be shown.
-# The default value is: NO.
 
 INLINE_INHERITED_MEMB  = NO
 
-# If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path
-# before files name in the file list and in the header files. If set to NO the
-# shortest path that makes the file name unique will be used
-# The default value is: YES.
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full 
+# path before files name in the file list and in the header files. If set 
+# to NO the shortest path that makes the file name unique will be used.
 
 FULL_PATH_NAMES        = YES
 
-# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path.
-# Stripping is only done if one of the specified strings matches the left-hand
-# part of the path. The tag can be used to show relative paths in the file list.
-# If left blank the directory from which doxygen is run is used as the path to
-# strip.
-#
-# Note that you can specify absolute paths here, but also relative paths, which
-# will be relative from the directory where doxygen is started.
-# This tag requires that the tag FULL_PATH_NAMES is set to YES.
-
-STRIP_FROM_PATH        =
-
-# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the
-# path mentioned in the documentation of a class, which tells the reader which
-# header file to include in order to use a class. If left blank only the name of
-# the header file containing the class definition is used. Otherwise one should
-# specify the list of include paths that are normally passed to the compiler
-# using the -I flag.
-
-STRIP_FROM_INC_PATH    =
-
-# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but
-# less readable) file names. This can be useful is your file systems doesn't
-# support long names like on DOS, Mac, or CD-ROM.
-# The default value is: NO.
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag 
+# can be used to strip a user-defined part of the path. Stripping is 
+# only done if one of the specified strings matches the left-hand part of 
+# the path. The tag can be used to show relative paths in the file list. 
+# If left blank the directory from which doxygen is run is used as the 
+# path to strip.
+
+STRIP_FROM_PATH        = 
+
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of 
+# the path mentioned in the documentation of a class, which tells 
+# the reader which header file to include in order to use a class. 
+# If left blank only the name of the header file containing the class 
+# definition is used. Otherwise one should specify the include paths that 
+# are normally passed to the compiler using the -I flag.
+
+STRIP_FROM_INC_PATH    = 
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter 
+# (but less readable) file names. This can be useful if your file system 
+# doesn't support long names like on DOS, Mac, or CD-ROM.
 
 SHORT_NAMES            = NO
 
-# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the
-# first line (until the first dot) of a Javadoc-style comment as the brief
-# description. If set to NO, the Javadoc-style will behave just like regular Qt-
-# style comments (thus requiring an explicit @brief command for a brief
-# description.)
-# The default value is: NO.
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen 
+# will interpret the first line (until the first dot) of a JavaDoc-style 
+# comment as the brief description. If set to NO, the JavaDoc 
+# comments will behave just like regular Qt-style comments 
+# (thus requiring an explicit @brief command for a brief description.)
 
 JAVADOC_AUTOBRIEF      = NO
 
-# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first
-# line (until the first dot) of a Qt-style comment as the brief description. If
-# set to NO, the Qt-style will behave just like regular Qt-style comments (thus
-# requiring an explicit \brief command for a brief description.)
-# The default value is: NO.
+# If the QT_AUTOBRIEF tag is set to YES then Doxygen will 
+# interpret the first line (until the first dot) of a Qt-style 
+# comment as the brief description. If set to NO, the comments 
+# will behave just like regular Qt-style comments (thus requiring 
+# an explicit \brief command for a brief description.)
 
 QT_AUTOBRIEF           = YES
 
-# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a
-# multi-line C++ special comment block (i.e. a block of //! or /// comments) as
-# a brief description. This used to be the default behavior. The new default is
-# to treat a multi-line C++ comment block as a detailed description. Set this
-# tag to YES if you prefer the old behavior instead.
-#
-# Note that setting this tag to YES also means that rational rose comments are
-# not recognized any more.
-# The default value is: NO.
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen 
+# treat a multi-line C++ special comment block (i.e. a block of //! or /// 
+# comments) as a brief description. This used to be the default behaviour. 
+# The new default is to treat a multi-line C++ comment block as a detailed 
+# description. Set this tag to YES if you prefer the old behaviour instead.
 
 MULTILINE_CPP_IS_BRIEF = NO
 
-# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the
-# documentation from any documented member that it re-implements.
-# The default value is: YES.
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented 
+# member inherits the documentation from any documented member that it 
+# re-implements.
 
 INHERIT_DOCS           = YES
 
-# If the SEPARATE_MEMBER_PAGES tag is set to YES then doxygen will produce a new
-# page for each member. If set to NO, the documentation of a member will be part
-# of the file/class/namespace that contains it.
-# The default value is: NO.
+# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce 
+# a new page for each member. If set to NO, the documentation of a member will 
+# be part of the file/class/namespace that contains it.
 
 SEPARATE_MEMBER_PAGES  = NO
 
-# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen
-# uses this value to replace tabs by spaces in code fragments.
-# Minimum value: 1, maximum value: 16, default value: 4.
+# The TAB_SIZE tag can be used to set the number of spaces in a tab. 
+# Doxygen uses this value to replace tabs by spaces in code fragments.
 
 TAB_SIZE               = 8
 
-# This tag can be used to specify a number of aliases that act as commands in
-# the documentation. An alias has the form:
-# name=value
-# For example adding
-# "sideeffect=@par Side Effects:\n"
-# will allow you to put the command \sideeffect (or @sideeffect) in the
-# documentation, which will result in a user-defined paragraph with heading
-# "Side Effects:". You can put \n's in the value part of an alias to insert
-# newlines.
-
-ALIASES                =
-
-# This tag can be used to specify a number of word-keyword mappings (TCL only).
-# A mapping has the form "name=value". For example adding "class=itcl::class"
-# will allow you to use the command class in the itcl::class meaning.
-
-TCL_SUBST              =
-
-# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources
-# only. Doxygen will then generate output that is more tailored for C. For
-# instance, some of the names that are used will be different. The list of all
-# members will be omitted, etc.
-# The default value is: NO.
+# This tag can be used to specify a number of aliases that acts 
+# as commands in the documentation. An alias has the form "name=value". 
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to 
+# put the command \sideeffect (or @sideeffect) in the documentation, which 
+# will result in a user-defined paragraph with heading "Side Effects:". 
+# You can put \n's in the value part of an alias to insert newlines.
+
+ALIASES                = 
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C 
+# sources only. Doxygen will then generate output that is more tailored for C. 
+# For instance, some of the names that are used will be different. The list 
+# of all members will be omitted, etc.
 
 OPTIMIZE_OUTPUT_FOR_C  = NO
 
-# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or
-# Python sources only. Doxygen will then generate output that is more tailored
-# for that language. For instance, namespaces will be presented as packages,
-# qualified scopes will look different, etc.
-# The default value is: NO.
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java 
+# sources only. Doxygen will then generate output that is more tailored for 
+# Java. For instance, namespaces will be presented as packages, qualified 
+# scopes will look different, etc.
 
 OPTIMIZE_OUTPUT_JAVA   = NO
 
-# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
-# sources. Doxygen will then generate output that is tailored for Fortran.
-# The default value is: NO.
+# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran 
+# sources only. Doxygen will then generate output that is more tailored for 
+# Fortran.
 
 OPTIMIZE_FOR_FORTRAN   = NO
 
-# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
-# sources. Doxygen will then generate output that is tailored for VHDL.
-# The default value is: NO.
+# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL 
+# sources. Doxygen will then generate output that is tailored for 
+# VHDL.
 
 OPTIMIZE_OUTPUT_VHDL   = NO
 
-# Doxygen selects the parser to use depending on the extension of the files it
-# parses. With this tag you can assign which parser to use for a given
-# extension. Doxygen has a built-in mapping, but you can override or extend it
-# using this tag. The format is ext=language, where ext is a file extension, and
-# language is one of the parsers supported by doxygen: IDL, Java, Javascript,
-# C#, C, C++, D, PHP, Objective-C, Python, Fortran (fixed format Fortran:
-# FortranFixed, free formatted Fortran: FortranFree, unknown formatted Fortran:
-# Fortran. In the later case the parser tries to guess whether the code is fixed
-# or free formatted code, this is the default for Fortran type files), VHDL. For
-# instance to make doxygen treat .inc files as Fortran files (default is PHP),
-# and .f files as C (default is Fortran), use: inc=Fortran f=C.
-#
-# Note: For files without extension you can use no_extension as a placeholder.
-#
-# Note that for custom extensions you also need to set FILE_PATTERNS otherwise
-# the files are not read by doxygen.
-
-EXTENSION_MAPPING      =
-
-# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments
-# according to the Markdown format, which allows for more readable
-# documentation. See http://daringfireball.net/projects/markdown/ for details.
-# The output of markdown processing is further processed by doxygen, so you can
-# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in
-# case of backward compatibilities issues.
-# The default value is: YES.
-
-MARKDOWN_SUPPORT       = YES
-
-# When enabled doxygen tries to link words that correspond to documented
-# classes, or namespaces to their corresponding documentation. Such a link can
-# be prevented in individual cases by putting a % sign in front of the word or
-# globally by setting AUTOLINK_SUPPORT to NO.
-# The default value is: YES.
-
-AUTOLINK_SUPPORT       = YES
-
-# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
-# to include (a tag file for) the STL sources as input, then you should set this
-# tag to YES in order to let doxygen match functions declarations and
-# definitions whose arguments contain STL classes (e.g. func(std::string);
-# versus func(std::string) {}). This also make the inheritance and collaboration
+# Doxygen selects the parser to use depending on the extension of the files it 
+# parses. With this tag you can assign which parser to use for a given extension. 
+# Doxygen has a built-in mapping, but you can override or extend it using this 
+# tag. The format is ext=language, where ext is a file extension, and language 
+# is one of the parsers supported by doxygen: IDL, Java, Javascript, CSharp, C, 
+# C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, C++. For instance to make 
+# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C 
+# (default is Fortran), use: inc=Fortran f=C. Note that for custom extensions 
+# you also need to set FILE_PATTERNS otherwise the files are not read by doxygen.
+
+EXTENSION_MAPPING      = 
+
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want 
+# to include (a tag file for) the STL sources as input, then you should 
+# set this tag to YES in order to let doxygen match functions declarations and 
+# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. 
+# func(std::string) {}). This also makes the inheritance and collaboration 
 # diagrams that involve STL classes more complete and accurate.
-# The default value is: NO.
 
 BUILTIN_STL_SUPPORT    = YES
 
-# If you use Microsoft's C++/CLI language, you should set this option to YES to
+# If you use Microsoft's C++/CLI language, you should set this option to YES to 
 # enable parsing support.
-# The default value is: NO.
 
 CPP_CLI_SUPPORT        = NO
 
-# Set the SIP_SUPPORT tag to YES if your project consists of sip (see:
-# http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen
-# will parse them like normal C++ but will assume all classes use public instead
-# of private inheritance when no explicit protection keyword is present.
-# The default value is: NO.
+# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. 
+# Doxygen will parse them like normal C++ but will assume all classes use public 
+# instead of private inheritance when no explicit protection keyword is present.
 
 SIP_SUPPORT            = NO
 
-# For Microsoft's IDL there are propget and propput attributes to indicate
-# getter and setter methods for a property. Setting this option to YES will make
-# doxygen to replace the get and set methods by a property in the documentation.
-# This will only work if the methods are indeed getting or setting a simple
-# type. If this is not the case, or you want to show the methods anyway, you
-# should set this option to NO.
-# The default value is: YES.
+# For Microsoft's IDL there are propget and propput attributes to indicate getter 
+# and setter methods for a property. Setting this option to YES (the default) 
+# will make doxygen replace the get and set methods by a property in the 
+# documentation. This will only work if the methods are indeed getting or 
+# setting a simple type. If this is not the case, or you want to show the 
+# methods anyway, you should set this option to NO.
 
 IDL_PROPERTY_SUPPORT   = YES
 
-# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
-# tag is set to YES then doxygen will reuse the documentation of the first
-# member in the group (if any) for the other members of the group. By default
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC 
+# tag is set to YES, then doxygen will reuse the documentation of the first 
+# member in the group (if any) for the other members of the group. By default 
 # all members of a group must be documented explicitly.
-# The default value is: NO.
 
 DISTRIBUTE_GROUP_DOC   = NO
 
-# If one adds a struct or class to a group and this option is enabled, then also
-# any nested class or struct is added to the same group. By default this option
-# is disabled and one has to add nested compounds explicitly via \ingroup.
-# The default value is: NO.
-
-GROUP_NESTED_COMPOUNDS = NO
-
-# Set the SUBGROUPING tag to YES to allow class member groups of the same type
-# (for instance a group of public functions) to be put as a subgroup of that
-# type (e.g. under the Public Functions section). Set it to NO to prevent
-# subgrouping. Alternatively, this can be done per class using the
-# \nosubgrouping command.
-# The default value is: YES.
+# Set the SUBGROUPING tag to YES (the default) to allow class member groups of 
+# the same type (for instance a group of public functions) to be put as a 
+# subgroup of that type (e.g. under the Public Functions section). Set it to 
+# NO to prevent subgrouping. Alternatively, this can be done per class using 
+# the \nosubgrouping command.
 
 SUBGROUPING            = YES
 
-# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions
-# are shown inside the group in which they are included (e.g. using \ingroup)
-# instead of on a separate page (for HTML and Man pages) or section (for LaTeX
-# and RTF).
-#
-# Note that this feature does not work in combination with
-# SEPARATE_MEMBER_PAGES.
-# The default value is: NO.
+# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and 
+# unions are shown inside the group in which they are included (e.g. using 
+# @ingroup) instead of on a separate page (for HTML and Man pages) or 
+# section (for LaTeX and RTF).
 
 INLINE_GROUPED_CLASSES = NO
 
-# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions
-# with only public data fields or simple typedef fields will be shown inline in
-# the documentation of the scope in which they are defined (i.e. file,
-# namespace, or group documentation), provided this scope is documented. If set
-# to NO, structs, classes, and unions are shown on a separate page (for HTML and
-# Man pages) or section (for LaTeX and RTF).
-# The default value is: NO.
-
-INLINE_SIMPLE_STRUCTS  = NO
-
-# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or
-# enum is documented as struct, union, or enum with the name of the typedef. So
-# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
-# with name TypeT. When disabled the typedef will appear as a member of a file,
-# namespace, or class. And the struct will be named TypeS. This can typically be
-# useful for C code in case the coding convention dictates that all compound
+# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum 
+# is documented as struct, union, or enum with the name of the typedef. So 
+# typedef struct TypeS {} TypeT, will appear in the documentation as a struct 
+# with name TypeT. When disabled the typedef will appear as a member of a file, 
+# namespace, or class. And the struct will be named TypeS. This can typically 
+# be useful for C code in case the coding convention dictates that all compound 
 # types are typedef'ed and only the typedef is referenced, never the tag name.
-# The default value is: NO.
 
 TYPEDEF_HIDES_STRUCT   = NO
 
-# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This
-# cache is used to resolve symbols given their name and scope. Since this can be
-# an expensive process and often the same symbol appears multiple times in the
-# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small
-# doxygen will become slower. If the cache is too large, memory is wasted. The
-# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range
-# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536
-# symbols. At the end of a run doxygen will report the cache usage and suggest
-# the optimal cache size from a speed point of view.
-# Minimum value: 0, maximum value: 9, default value: 0.
-
-LOOKUP_CACHE_SIZE      = 0
+# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to 
+# determine which symbols to keep in memory and which to flush to disk. 
+# When the cache is full, less often used symbols will be written to disk. 
+# For small to medium size projects (<1000 input files) the default value is 
+# probably good enough. For larger projects a too small cache size can cause 
+# doxygen to be busy swapping symbols to and from disk most of the time 
+# causing a significant performance penalty. 
+# If the system has enough physical memory increasing the cache will improve the 
+# performance by keeping more symbols in memory. Note that the value works on 
+# a logarithmic scale so increasing the size by one will roughly double the 
+# memory usage. The cache size is given by this formula: 
+# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, 
+# corresponding to a cache size of 2^16 = 65536 symbols
+
+SYMBOL_CACHE_SIZE      = 0
 
 #---------------------------------------------------------------------------
@@ -419,385 +324,317 @@
 #---------------------------------------------------------------------------
 
-# If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in
-# documentation are documented, even if no documentation was available. Private
-# class members and static file members will be hidden unless the
-# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES.
-# Note: This will also disable the warnings about undocumented members that are
-# normally produced when WARNINGS is set to YES.
-# The default value is: NO.
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in 
+# documentation are documented, even if no documentation was available. 
+# Private class members and static file members will be hidden unless 
+# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
 
 EXTRACT_ALL            = YES
 
-# If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will
-# be included in the documentation.
-# The default value is: NO.
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class 
+# will be included in the documentation.
 
 EXTRACT_PRIVATE        = YES
 
-# If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal
-# scope will be included in the documentation.
-# The default value is: NO.
-
-EXTRACT_PACKAGE        = NO
-
-# If the EXTRACT_STATIC tag is set to YES, all static members of a file will be
-# included in the documentation.
-# The default value is: NO.
+# If the EXTRACT_STATIC tag is set to YES all static members of a file 
+# will be included in the documentation.
 
 EXTRACT_STATIC         = YES
 
-# If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined
-# locally in source files will be included in the documentation. If set to NO,
-# only classes defined in header files are included. Does not have any effect
-# for Java sources.
-# The default value is: YES.
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) 
+# defined locally in source files will be included in the documentation. 
+# If set to NO only classes defined in header files are included.
 
 EXTRACT_LOCAL_CLASSES  = YES
 
-# This flag is only useful for Objective-C code. If set to YES, local methods,
-# which are defined in the implementation section but not in the interface are
-# included in the documentation. If set to NO, only methods in the interface are
-# included.
-# The default value is: NO.
+# This flag is only useful for Objective-C code. When set to YES local 
+# methods, which are defined in the implementation section but not in 
+# the interface are included in the documentation. 
+# If set to NO (the default) only methods in the interface are included.
 
 EXTRACT_LOCAL_METHODS  = YES
 
-# If this flag is set to YES, the members of anonymous namespaces will be
-# extracted and appear in the documentation as a namespace called
-# 'anonymous_namespace{file}', where file will be replaced with the base name of
-# the file that contains the anonymous namespace. By default anonymous namespace
-# are hidden.
-# The default value is: NO.
+# If this flag is set to YES, the members of anonymous namespaces will be 
+# extracted and appear in the documentation as a namespace called 
+# 'anonymous_namespace{file}', where file will be replaced with the base 
+# name of the file that contains the anonymous namespace. By default 
+# anonymous namespaces are hidden.
 
 EXTRACT_ANON_NSPACES   = NO
 
-# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all
-# undocumented members inside documented classes or files. If set to NO these
-# members will be included in the various overviews, but no documentation
-# section is generated. This option has no effect if EXTRACT_ALL is enabled.
-# The default value is: NO.
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all 
+# undocumented members of documented classes, files or namespaces. 
+# If set to NO (the default) these members will be included in the 
+# various overviews, but no documentation section is generated. 
+# This option has no effect if EXTRACT_ALL is enabled.
 
 HIDE_UNDOC_MEMBERS     = NO
 
-# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all
-# undocumented classes that are normally visible in the class hierarchy. If set
-# to NO, these classes will be included in the various overviews. This option
-# has no effect if EXTRACT_ALL is enabled.
-# The default value is: NO.
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all 
+# undocumented classes that are normally visible in the class hierarchy. 
+# If set to NO (the default) these classes will be included in the various 
+# overviews. This option has no effect if EXTRACT_ALL is enabled.
 
 HIDE_UNDOC_CLASSES     = NO
 
-# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend
-# (class|struct|union) declarations. If set to NO, these declarations will be
-# included in the documentation.
-# The default value is: NO.
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all 
+# friend (class|struct|union) declarations. 
+# If set to NO (the default) these declarations will be included in the 
+# documentation.
 
 HIDE_FRIEND_COMPOUNDS  = NO
 
-# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any
-# documentation blocks found inside the body of a function. If set to NO, these
-# blocks will be appended to the function's detailed documentation block.
-# The default value is: NO.
+# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any 
+# documentation blocks found inside the body of a function. 
+# If set to NO (the default) these blocks will be appended to the 
+# function's detailed documentation block.
 
 HIDE_IN_BODY_DOCS      = NO
 
-# The INTERNAL_DOCS tag determines if documentation that is typed after a
-# \internal command is included. If the tag is set to NO then the documentation
-# will be excluded. Set it to YES to include the internal documentation.
-# The default value is: NO.
+# The INTERNAL_DOCS tag determines if documentation 
+# that is typed after a \internal command is included. If the tag is set 
+# to NO (the default) then the documentation will be excluded. 
+# Set it to YES to include the internal documentation.
 
 INTERNAL_DOCS          = NO
 
-# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file
-# names in lower-case letters. If set to YES, upper-case letters are also
-# allowed. This is useful if you have classes or files whose names only differ
-# in case and if your file system supports case sensitive file names. Windows
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate 
+# file names in lower-case letters. If set to YES upper-case letters are also 
+# allowed. This is useful if you have classes or files whose names only differ 
+# in case and if your file system supports case sensitive file names. Windows 
 # and Mac users are advised to set this option to NO.
-# The default value is: system dependent.
 
 CASE_SENSE_NAMES       = NO
 
-# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with
-# their full class and namespace scopes in the documentation. If set to YES, the
-# scope will be hidden.
-# The default value is: NO.
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen 
+# will show members with their full class and namespace scopes in the 
+# documentation. If set to YES the scope will be hidden.
 
 HIDE_SCOPE_NAMES       = NO
 
-# If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will
-# append additional text to a page's title, such as Class Reference. If set to
-# YES the compound reference will be hidden.
-# The default value is: NO.
-
-HIDE_COMPOUND_REFERENCE= NO
-
-# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of
-# the files that are included by a file in the documentation of that file.
-# The default value is: YES.
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen 
+# will put a list of the files that are included by a file in the documentation 
+# of that file.
 
 SHOW_INCLUDE_FILES     = YES
 
-# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each
-# grouped member an include statement to the documentation, telling the reader
-# which file to include in order to use the member.
-# The default value is: NO.
-
-SHOW_GROUPED_MEMB_INC  = NO
-
-# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include
-# files with double quotes in the documentation rather than with sharp brackets.
-# The default value is: NO.
+# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen 
+# will list include files with double quotes in the documentation 
+# rather than with sharp brackets.
 
 FORCE_LOCAL_INCLUDES   = NO
 
-# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the
-# documentation for inline members.
-# The default value is: YES.
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] 
+# is inserted in the documentation for inline members.
 
 INLINE_INFO            = YES
 
-# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the
-# (detailed) documentation of file and class members alphabetically by member
-# name. If set to NO, the members will appear in declaration order.
-# The default value is: YES.
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen 
+# will sort the (detailed) documentation of file and class members 
+# alphabetically by member name. If set to NO the members will appear in 
+# declaration order.
 
 SORT_MEMBER_DOCS       = YES
 
-# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief
-# descriptions of file, namespace and class members alphabetically by member
-# name. If set to NO, the members will appear in declaration order. Note that
-# this will also influence the order of the classes in the class list.
-# The default value is: NO.
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the 
+# brief documentation of file, namespace and class members alphabetically 
+# by member name. If set to NO (the default) the members will appear in 
+# declaration order.
 
 SORT_BRIEF_DOCS        = NO
 
-# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the
-# (brief and detailed) documentation of class members so that constructors and
-# destructors are listed first. If set to NO the constructors will appear in the
-# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS.
-# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief
-# member documentation.
-# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting
-# detailed member documentation.
-# The default value is: NO.
+# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen 
+# will sort the (brief and detailed) documentation of class members so that 
+# constructors and destructors are listed first. If set to NO (the default) 
+# the constructors will appear in the respective orders defined by 
+# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. 
+# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO 
+# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO.
 
 SORT_MEMBERS_CTORS_1ST = NO
 
-# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy
-# of group names into alphabetical order. If set to NO the group names will
-# appear in their defined order.
-# The default value is: NO.
+# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the 
+# hierarchy of group names into alphabetical order. If set to NO (the default) 
+# the group names will appear in their defined order.
 
 SORT_GROUP_NAMES       = NO
 
-# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by
-# fully-qualified names, including namespaces. If set to NO, the class list will
-# be sorted only by class name, not including the namespace part.
-# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
-# Note: This option applies only to the class list, not to the alphabetical
-# list.
-# The default value is: NO.
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be 
+# sorted by fully-qualified names, including namespaces. If set to 
+# NO (the default), the class list will be sorted only by class name, 
+# not including the namespace part. 
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. 
+# Note: This option applies only to the class list, not to the 
+# alphabetical list.
 
 SORT_BY_SCOPE_NAME     = NO
 
-# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper
-# type resolution of all parameters of a function it will reject a match between
-# the prototype and the implementation of a member function even if there is
-# only one candidate or it is obvious which candidate to choose by doing a
-# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still
-# accept a match between prototype and implementation in such cases.
-# The default value is: NO.
+# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to 
+# do proper type resolution of all parameters of a function it will reject a 
+# match between the prototype and the implementation of a member function even 
+# if there is only one candidate or it is obvious which candidate to choose 
+# by doing a simple string match. By disabling STRICT_PROTO_MATCHING doxygen 
+# will still accept a match between prototype and implementation in such cases.
 
 STRICT_PROTO_MATCHING  = NO
 
-# The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo
-# list. This list is created by putting \todo commands in the documentation.
-# The default value is: YES.
+# The GENERATE_TODOLIST tag can be used to enable (YES) or 
+# disable (NO) the todo list. This list is created by putting \todo 
+# commands in the documentation.
 
 GENERATE_TODOLIST      = YES
 
-# The GENERATE_TESTLIST tag can be used to enable (YES) or disable (NO) the test
-# list. This list is created by putting \test commands in the documentation.
-# The default value is: YES.
+# The GENERATE_TESTLIST tag can be used to enable (YES) or 
+# disable (NO) the test list. This list is created by putting \test 
+# commands in the documentation.
 
 GENERATE_TESTLIST      = YES
 
-# The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug
-# list. This list is created by putting \bug commands in the documentation.
-# The default value is: YES.
+# The GENERATE_BUGLIST tag can be used to enable (YES) or 
+# disable (NO) the bug list. This list is created by putting \bug 
+# commands in the documentation.
 
 GENERATE_BUGLIST       = YES
 
-# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or disable (NO)
-# the deprecated list. This list is created by putting \deprecated commands in
-# the documentation.
-# The default value is: YES.
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or 
+# disable (NO) the deprecated list. This list is created by putting 
+# \deprecated commands in the documentation.
 
 GENERATE_DEPRECATEDLIST= YES
 
-# The ENABLED_SECTIONS tag can be used to enable conditional documentation
-# sections, marked by \if <section_label> ... \endif and \cond <section_label>
-# ... \endcond blocks.
-
-ENABLED_SECTIONS       =
-
-# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the
-# initial value of a variable or macro / define can have for it to appear in the
-# documentation. If the initializer consists of more lines than specified here
-# it will be hidden. Use a value of 0 to hide initializers completely. The
-# appearance of the value of individual variables and macros / defines can be
-# controlled using \showinitializer or \hideinitializer command in the
-# documentation regardless of this setting.
-# Minimum value: 0, maximum value: 10000, default value: 30.
+# The ENABLED_SECTIONS tag can be used to enable conditional 
+# documentation sections, marked by \if sectionname ... \endif.
+
+ENABLED_SECTIONS       = 
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines 
+# the initial value of a variable or macro consists of for it to appear in 
+# the documentation. If the initializer consists of more lines than specified 
+# here it will be hidden. Use a value of 0 to hide initializers completely. 
+# The appearance of the initializer of individual variables and macros in the 
+# documentation can be controlled using \showinitializer or \hideinitializer 
+# command in the documentation regardless of this setting.
 
 MAX_INITIALIZER_LINES  = 30
 
-# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at
-# the bottom of the documentation of classes and structs. If set to YES, the
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated 
+# at the bottom of the documentation of classes and structs. If set to YES the 
 # list will mention the files that were used to generate the documentation.
-# The default value is: YES.
 
 SHOW_USED_FILES        = YES
 
-# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This
-# will remove the Files entry from the Quick Index and from the Folder Tree View
-# (if specified).
-# The default value is: YES.
+# If the sources in your project are distributed over multiple directories 
+# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy 
+# in the documentation. The default is NO.
+
+SHOW_DIRECTORIES       = YES
+
+# Set the SHOW_FILES tag to NO to disable the generation of the Files page. 
+# This will remove the Files entry from the Quick Index and from the 
+# Folder Tree View (if specified). The default is YES.
 
 SHOW_FILES             = YES
 
-# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces
-# page. This will remove the Namespaces entry from the Quick Index and from the
-# Folder Tree View (if specified).
-# The default value is: YES.
+# Set the SHOW_NAMESPACES tag to NO to disable the generation of the 
+# Namespaces page.  This will remove the Namespaces entry from the Quick Index 
+# and from the Folder Tree View (if specified). The default is YES.
 
 SHOW_NAMESPACES        = YES
 
-# The FILE_VERSION_FILTER tag can be used to specify a program or script that
-# doxygen should invoke to get the current version for each file (typically from
-# the version control system). Doxygen will invoke the program by executing (via
-# popen()) the command command input-file, where command is the value of the
-# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided
-# by doxygen. Whatever the program writes to standard output is used as the file
-# version. For an example see the documentation.
-
-FILE_VERSION_FILTER    =
-
-# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed
-# by doxygen. The layout file controls the global structure of the generated
-# output files in an output format independent way. To create the layout file
-# that represents doxygen's defaults, run doxygen with the -l option. You can
-# optionally specify a file name after the option, if omitted DoxygenLayout.xml
-# will be used as the name of the layout file.
-#
-# Note that if you run doxygen from a directory containing a file called
-# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE
-# tag is left empty.
-
-LAYOUT_FILE            =
-
-# The CITE_BIB_FILES tag can be used to specify one or more bib files containing
-# the reference definitions. This must be a list of .bib files. The .bib
-# extension is automatically appended if omitted. This requires the bibtex tool
-# to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info.
-# For LaTeX the style of the bibliography can be controlled using
-# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the
-# search path. See also \cite for info how to create references.
-
-CITE_BIB_FILES         =
-
-#---------------------------------------------------------------------------
-# Configuration options related to warning and progress messages
-#---------------------------------------------------------------------------
-
-# The QUIET tag can be used to turn on/off the messages that are generated to
-# standard output by doxygen. If QUIET is set to YES this implies that the
-# messages are off.
-# The default value is: NO.
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that 
+# doxygen should invoke to get the current version for each file (typically from 
+# the version control system). Doxygen will invoke the program by executing (via 
+# popen()) the command <command> <input-file>, where <command> is the value of 
+# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file 
+# provided by doxygen. Whatever the program writes to standard output 
+# is used as the file version. See the manual for examples.
+
+FILE_VERSION_FILTER    = 
+
+# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed 
+# by doxygen. The layout file controls the global structure of the generated 
+# output files in an output format independent way. The create the layout file 
+# that represents doxygen's defaults, run doxygen with the -l option. 
+# You can optionally specify a file name after the option, if omitted 
+# DoxygenLayout.xml will be used as the name of the layout file.
+
+LAYOUT_FILE            = 
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated 
+# by doxygen. Possible values are YES and NO. If left blank NO is used.
 
 QUIET                  = NO
 
-# The WARNINGS tag can be used to turn on/off the warning messages that are
-# generated to standard error (stderr) by doxygen. If WARNINGS is set to YES
-# this implies that the warnings are on.
-#
-# Tip: Turn warnings on while writing the documentation.
-# The default value is: YES.
+# The WARNINGS tag can be used to turn on/off the warning messages that are 
+# generated by doxygen. Possible values are YES and NO. If left blank 
+# NO is used.
 
 WARNINGS               = YES
 
-# If the WARN_IF_UNDOCUMENTED tag is set to YES then doxygen will generate
-# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag
-# will automatically be disabled.
-# The default value is: YES.
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings 
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will 
+# automatically be disabled.
 
 WARN_IF_UNDOCUMENTED   = YES
 
-# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for
-# potential errors in the documentation, such as not documenting some parameters
-# in a documented function, or documenting parameters that don't exist or using
-# markup commands wrongly.
-# The default value is: YES.
+# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for 
+# potential errors in the documentation, such as not documenting some 
+# parameters in a documented function, or documenting parameters that 
+# don't exist or using markup commands wrongly.
 
 WARN_IF_DOC_ERROR      = YES
 
-# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that
-# are documented, but have no documentation for their parameters or return
-# value. If set to NO, doxygen will only warn about wrong or incomplete
-# parameter documentation, but not about the absence of documentation.
-# The default value is: NO.
+# The WARN_NO_PARAMDOC option can be enabled to get warnings for 
+# functions that are documented, but have no documentation for their parameters 
+# or return value. If set to NO (the default) doxygen will only warn about 
+# wrong or incomplete parameter documentation, but not about the absence of 
+# documentation.
 
 WARN_NO_PARAMDOC       = YES
 
-# The WARN_FORMAT tag determines the format of the warning messages that doxygen
-# can produce. The string should contain the $file, $line, and $text tags, which
-# will be replaced by the file and line number from which the warning originated
-# and the warning text. Optionally the format may contain $version, which will
-# be replaced by the version of the file (if it could be obtained via
-# FILE_VERSION_FILTER)
-# The default value is: $file:$line: $text.
+# The WARN_FORMAT tag determines the format of the warning messages that 
+# doxygen can produce. The string should contain the $file, $line, and $text 
+# tags, which will be replaced by the file and line number from which the 
+# warning originated and the warning text. Optionally the format may contain 
+# $version, which will be replaced by the version of the file (if it could 
+# be obtained via FILE_VERSION_FILTER)
 
 WARN_FORMAT            = "$file:$line: $text"
 
-# The WARN_LOGFILE tag can be used to specify a file to which warning and error
-# messages should be written. If left blank the output is written to standard
-# error (stderr).
-
-WARN_LOGFILE           =
-
-#---------------------------------------------------------------------------
-# Configuration options related to the input files
-#---------------------------------------------------------------------------
-
-# The INPUT tag is used to specify the files and/or directories that contain
-# documented source files. You may enter file names like myfile.cpp or
-# directories like /usr/src/myproject. Separate the files or directories with
-# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
-# Note: If this tag is empty the current directory is searched.
+# The WARN_LOGFILE tag can be used to specify a file to which warning 
+# and error messages should be written. If left blank the output is written 
+# to stderr.
+
+WARN_LOGFILE           = 
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag can be used to specify the files and/or directories that contain 
+# documented source files. You may enter file names like "myfile.cpp" or 
+# directories like "/usr/src/myproject". Separate the files or directories 
+# with spaces.
 
 INPUT                  = src
 
-# This tag can be used to specify the character encoding of the source files
-# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
-# libiconv (or the iconv built into libc) for the transcoding. See the libiconv
-# documentation (see: http://www.gnu.org/software/libiconv) for the list of
-# possible encodings.
-# The default value is: UTF-8.
+# This tag can be used to specify the character encoding of the source files 
+# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is 
+# also the default input encoding. Doxygen uses libiconv (or the iconv built 
+# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for 
+# the list of possible encodings.
 
 INPUT_ENCODING         = UTF-8
 
-# If the value of the INPUT tag contains directories, you can use the
-# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and
-# *.h) to filter out the source-files in the directories.
-#
-# Note that for custom extensions or not directly supported extensions you also
-# need to set EXTENSION_MAPPING for the extension otherwise the files are not
-# read by doxygen.
-#
-# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp,
-# *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h,
-# *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc,
-# *.m, *.markdown, *.md, *.mm, *.dox, *.py, *.f90, *.f, *.for, *.tcl, *.vhd,
-# *.vhdl, *.ucf, *.qsf, *.as and *.js.
+# If the value of the INPUT tag contains directories, you can use the 
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp 
+# and *.h) to filter out the source-files in the directories. If left 
+# blank the following patterns are tested: 
+# *.c *.cc *.cxx *.cpp *.c++ *.d *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh 
+# *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.dox *.py 
+# *.f90 *.f *.for *.vhd *.vhdl
 
 FILE_PATTERNS          = *.cpp \
@@ -805,1150 +642,771 @@
                          *.conf
 
-# The RECURSIVE tag can be used to specify whether or not subdirectories should
-# be searched for input files as well.
-# The default value is: NO.
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories 
+# should be searched for input files as well. Possible values are YES and NO. 
+# If left blank NO is used.
 
 RECURSIVE              = YES
 
-# The EXCLUDE tag can be used to specify files and/or directories that should be
-# excluded from the INPUT source files. This way you can easily exclude a
+# The EXCLUDE tag can be used to specify files and/or directories that should 
+# excluded from the INPUT source files. This way you can easily exclude a 
 # subdirectory from a directory tree whose root is specified with the INPUT tag.
-#
-# Note that relative paths are relative to the directory from which doxygen is
-# run.
-
-EXCLUDE                =
-
-# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
-# directories that are symbolic links (a Unix file system feature) are excluded
+
+EXCLUDE                = 
+
+# The EXCLUDE_SYMLINKS tag can be used select whether or not files or 
+# directories that are symbolic links (a Unix file system feature) are excluded 
 # from the input.
-# The default value is: NO.
 
 EXCLUDE_SYMLINKS       = NO
 
-# If the value of the INPUT tag contains directories, you can use the
-# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
-# certain files from those directories.
-#
-# Note that the wildcards are matched against the file with absolute path, so to
-# exclude all test directories for example use the pattern */test/*
-
-EXCLUDE_PATTERNS       =
-
-# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
-# (namespaces, classes, functions, etc.) that should be excluded from the
-# output. The symbol name can be a fully qualified name, a word, or if the
-# wildcard * is used, a substring. Examples: ANamespace, AClass,
+# If the value of the INPUT tag contains directories, you can use the 
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude 
+# certain files from those directories. Note that the wildcards are matched 
+# against the file with absolute path, so to exclude all test directories 
+# for example use the pattern */test/*
+
+EXCLUDE_PATTERNS       = 
+
+# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names 
+# (namespaces, classes, functions, etc.) that should be excluded from the 
+# output. The symbol name can be a fully qualified name, a word, or if the 
+# wildcard * is used, a substring. Examples: ANamespace, AClass, 
 # AClass::ANamespace, ANamespace::*Test
-#
-# Note that the wildcards are matched against the file with absolute path, so to
-# exclude all test directories use the pattern */test/*
-
-EXCLUDE_SYMBOLS        =
-
-# The EXAMPLE_PATH tag can be used to specify one or more files or directories
-# that contain example code fragments that are included (see the \include
-# command).
-
-EXAMPLE_PATH           =
-
-# If the value of the EXAMPLE_PATH tag contains directories, you can use the
-# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and
-# *.h) to filter out the source-files in the directories. If left blank all
-# files are included.
+
+EXCLUDE_SYMBOLS        = 
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or 
+# directories that contain example code fragments that are included (see 
+# the \include command).
+
+EXAMPLE_PATH           = 
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the 
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp 
+# and *.h) to filter out the source-files in the directories. If left 
+# blank all files are included.
 
 EXAMPLE_PATTERNS       = *
 
-# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
-# searched for input files to be used with the \include or \dontinclude commands
-# irrespective of the value of the RECURSIVE tag.
-# The default value is: NO.
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be 
+# searched for input files to be used with the \include or \dontinclude 
+# commands irrespective of the value of the RECURSIVE tag. 
+# Possible values are YES and NO. If left blank NO is used.
 
 EXAMPLE_RECURSIVE      = NO
 
-# The IMAGE_PATH tag can be used to specify one or more files or directories
-# that contain images that are to be included in the documentation (see the
-# \image command).
-
-IMAGE_PATH             =
-
-# The INPUT_FILTER tag can be used to specify a program that doxygen should
-# invoke to filter for each input file. Doxygen will invoke the filter program
-# by executing (via popen()) the command:
-#
-# <filter> <input-file>
-#
-# where <filter> is the value of the INPUT_FILTER tag, and <input-file> is the
-# name of an input file. Doxygen will then use the output that the filter
-# program writes to standard output. If FILTER_PATTERNS is specified, this tag
-# will be ignored.
-#
-# Note that the filter must not add or remove lines; it is applied before the
-# code is scanned, but not when the output code is generated. If lines are added
-# or removed, the anchors will not be placed correctly.
-
-INPUT_FILTER           =
-
-# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
-# basis. Doxygen will compare the file name with each pattern and apply the
-# filter if there is a match. The filters are a list of the form: pattern=filter
-# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how
-# filters are used. If the FILTER_PATTERNS tag is empty or if none of the
-# patterns match the file name, INPUT_FILTER is applied.
-
-FILTER_PATTERNS        =
-
-# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
-# INPUT_FILTER) will also be used to filter the input files that are used for
-# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES).
-# The default value is: NO.
+# The IMAGE_PATH tag can be used to specify one or more files or 
+# directories that contain image that are included in the documentation (see 
+# the \image command).
+
+IMAGE_PATH             = 
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should 
+# invoke to filter for each input file. Doxygen will invoke the filter program 
+# by executing (via popen()) the command <filter> <input-file>, where <filter> 
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an 
+# input file. Doxygen will then use the output that the filter program writes 
+# to standard output.  If FILTER_PATTERNS is specified, this tag will be 
+# ignored.
+
+INPUT_FILTER           = 
+
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern 
+# basis.  Doxygen will compare the file name with each pattern and apply the 
+# filter if there is a match.  The filters are a list of the form: 
+# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further 
+# info on how filters are used. If FILTER_PATTERNS is empty or if 
+# non of the patterns match the file name, INPUT_FILTER is applied.
+
+FILTER_PATTERNS        = 
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using 
+# INPUT_FILTER) will be used to filter the input files when producing source 
+# files to browse (i.e. when SOURCE_BROWSER is set to YES).
 
 FILTER_SOURCE_FILES    = NO
 
-# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file
-# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and
-# it is also possible to disable source filtering for a specific pattern using
-# *.ext= (so without naming a filter).
-# This tag requires that the tag FILTER_SOURCE_FILES is set to YES.
-
-FILTER_SOURCE_PATTERNS =
-
-# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that
-# is part of the input, its contents will be placed on the main page
-# (index.html). This can be useful if you have a project on for instance GitHub
-# and want to reuse the introduction page also for the doxygen output.
-
-USE_MDFILE_AS_MAINPAGE =
-
-#---------------------------------------------------------------------------
-# Configuration options related to source browsing
-#---------------------------------------------------------------------------
-
-# If the SOURCE_BROWSER tag is set to YES then a list of source files will be
-# generated. Documented entities will be cross-referenced with these sources.
-#
-# Note: To get rid of all source code in the generated output, make sure that
-# also VERBATIM_HEADERS is set to NO.
-# The default value is: NO.
+# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file 
+# pattern. A pattern will override the setting for FILTER_PATTERN (if any) 
+# and it is also possible to disable source filtering for a specific pattern 
+# using *.ext= (so without naming a filter). This option only has effect when 
+# FILTER_SOURCE_FILES is enabled.
+
+FILTER_SOURCE_PATTERNS = 
+
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will 
+# be generated. Documented entities will be cross-referenced with these sources. 
+# Note: To get rid of all source code in the generated output, make sure also 
+# VERBATIM_HEADERS is set to NO.
 
 SOURCE_BROWSER         = YES
 
-# Setting the INLINE_SOURCES tag to YES will include the body of functions,
-# classes and enums directly into the documentation.
-# The default value is: NO.
+# Setting the INLINE_SOURCES tag to YES will include the body 
+# of functions and classes directly in the documentation.
 
 INLINE_SOURCES         = NO
 
-# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any
-# special comment blocks from generated source code fragments. Normal C, C++ and
-# Fortran comments will always remain visible.
-# The default value is: YES.
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct 
+# doxygen to hide any special comment blocks from generated source code 
+# fragments. Normal C and C++ comments will always remain visible.
 
 STRIP_CODE_COMMENTS    = YES
 
-# If the REFERENCED_BY_RELATION tag is set to YES then for each documented
-# function all documented functions referencing it will be listed.
-# The default value is: NO.
+# If the REFERENCED_BY_RELATION tag is set to YES 
+# then for each documented function all documented 
+# functions referencing it will be listed.
 
 REFERENCED_BY_RELATION = YES
 
-# If the REFERENCES_RELATION tag is set to YES then for each documented function
-# all documented entities called/used by that function will be listed.
-# The default value is: NO.
+# If the REFERENCES_RELATION tag is set to YES 
+# then for each documented function all documented entities 
+# called/used by that function will be listed.
 
 REFERENCES_RELATION    = YES
 
-# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set
-# to YES then the hyperlinks from functions in REFERENCES_RELATION and
-# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will
-# link to the documentation.
-# The default value is: YES.
+# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) 
+# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from 
+# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will 
+# link to the source code.  Otherwise they will link to the documentation.
 
 REFERENCES_LINK_SOURCE = YES
 
-# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the
-# source code will show a tooltip with additional information such as prototype,
-# brief description and links to the definition and documentation. Since this
-# will make the HTML file larger and loading of large files a bit slower, you
-# can opt to disable this feature.
-# The default value is: YES.
-# This tag requires that the tag SOURCE_BROWSER is set to YES.
-
-SOURCE_TOOLTIPS        = YES
-
-# If the USE_HTAGS tag is set to YES then the references to source code will
-# point to the HTML generated by the htags(1) tool instead of doxygen built-in
-# source browser. The htags tool is part of GNU's global source tagging system
-# (see http://www.gnu.org/software/global/global.html). You will need version
-# 4.8.6 or higher.
-#
-# To use it do the following:
-# - Install the latest version of global
-# - Enable SOURCE_BROWSER and USE_HTAGS in the config file
-# - Make sure the INPUT points to the root of the source tree
-# - Run doxygen as normal
-#
-# Doxygen will invoke htags (and that will in turn invoke gtags), so these
-# tools must be available from the command line (i.e. in the search path).
-#
-# The result: instead of the source browser generated by doxygen, the links to
-# source code will now point to the output of htags.
-# The default value is: NO.
-# This tag requires that the tag SOURCE_BROWSER is set to YES.
+# If the USE_HTAGS tag is set to YES then the references to source code 
+# will point to the HTML generated by the htags(1) tool instead of doxygen 
+# built-in source browser. The htags tool is part of GNU's global source 
+# tagging system (see http://www.gnu.org/software/global/global.html). You 
+# will need version 4.8.6 or higher.
 
 USE_HTAGS              = NO
 
-# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a
-# verbatim copy of the header file for each class for which an include is
-# specified. Set to NO to disable this.
-# See also: Section \class.
-# The default value is: YES.
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen 
+# will generate a verbatim copy of the header file for each class for 
+# which an include is specified. Set to NO to disable this.
 
 VERBATIM_HEADERS       = YES
 
 #---------------------------------------------------------------------------
-# Configuration options related to the alphabetical class index
-#---------------------------------------------------------------------------
-
-# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all
-# compounds will be generated. Enable this if the project contains a lot of
-# classes, structs, unions or interfaces.
-# The default value is: YES.
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index 
+# of all compounds will be generated. Enable this if the project 
+# contains a lot of classes, structs, unions or interfaces.
 
 ALPHABETICAL_INDEX     = YES
 
-# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in
-# which the alphabetical index list will be split.
-# Minimum value: 1, maximum value: 20, default value: 5.
-# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then 
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns 
+# in which this list will be split (can be a number in the range [1..20])
 
 COLS_IN_ALPHA_INDEX    = 5
 
-# In case all classes in a project start with a common prefix, all classes will
-# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag
-# can be used to specify a prefix (or a list of prefixes) that should be ignored
-# while generating the index headers.
-# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.
-
-IGNORE_PREFIX          =
-
-#---------------------------------------------------------------------------
-# Configuration options related to the HTML output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output
-# The default value is: YES.
+# In case all classes in a project start with a common prefix, all 
+# classes will be put under the same header in the alphabetical index. 
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that 
+# should be ignored while generating the index headers.
+
+IGNORE_PREFIX          = 
+
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will 
+# generate HTML output.
 
 GENERATE_HTML          = YES
 
-# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a
-# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
-# it.
-# The default directory is: html.
-# This tag requires that the tag GENERATE_HTML is set to YES.
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `html' will be used as the default path.
 
 HTML_OUTPUT            = html
 
-# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each
-# generated HTML page (for example: .htm, .php, .asp).
-# The default value is: .html.
-# This tag requires that the tag GENERATE_HTML is set to YES.
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for 
+# each generated HTML page (for example: .htm,.php,.asp). If it is left blank 
+# doxygen will generate files with .html extension.
 
 HTML_FILE_EXTENSION    = .html
 
-# The HTML_HEADER tag can be used to specify a user-defined HTML header file for
-# each generated HTML page. If the tag is left blank doxygen will generate a
-# standard header.
-#
-# To get valid HTML the header file that includes any scripts and style sheets
-# that doxygen needs, which is dependent on the configuration options used (e.g.
-# the setting GENERATE_TREEVIEW). It is highly recommended to start with a
-# default header using
-# doxygen -w html new_header.html new_footer.html new_stylesheet.css
-# YourConfigFile
-# and then modify the file new_header.html. See also section "Doxygen usage"
-# for information on how to generate the default header that doxygen normally
-# uses.
-# Note: The header is subject to change so you typically have to regenerate the
-# default header when upgrading to a newer version of doxygen. For a description
-# of the possible markers and block names see the documentation.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_HEADER            =
-
-# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each
-# generated HTML page. If the tag is left blank doxygen will generate a standard
-# footer. See HTML_HEADER for more information on how to generate a default
-# footer and what special commands can be used inside the footer. See also
-# section "Doxygen usage" for information on how to generate the default footer
-# that doxygen normally uses.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_FOOTER            =
-
-# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style
-# sheet that is used by each HTML page. It can be used to fine-tune the look of
-# the HTML output. If left blank doxygen will generate a default style sheet.
-# See also section "Doxygen usage" for information on how to generate the style
-# sheet that doxygen normally uses.
-# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as
-# it is more robust and this tag (HTML_STYLESHEET) will in the future become
-# obsolete.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_STYLESHEET        =
-
-# The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined
-# cascading style sheets that are included after the standard style sheets
-# created by doxygen. Using this option one can overrule certain style aspects.
-# This is preferred over using HTML_STYLESHEET since it does not replace the
-# standard style sheet and is therefore more robust against future updates.
-# Doxygen will copy the style sheet files to the output directory.
-# Note: The order of the extra style sheet files is of importance (e.g. the last
-# style sheet in the list overrules the setting of the previous ones in the
-# list). For an example see the documentation.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_EXTRA_STYLESHEET  =
-
-# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or
-# other source files which should be copied to the HTML output directory. Note
-# that these files will be copied to the base HTML output directory. Use the
-# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these
-# files. In the HTML_STYLESHEET file, use the file name only. Also note that the
-# files will be copied as-is; there are no commands or markers available.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_EXTRA_FILES       =
-
-# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen
-# will adjust the colors in the style sheet and background images according to
-# this color. Hue is specified as an angle on a colorwheel, see
-# http://en.wikipedia.org/wiki/Hue for more information. For instance the value
-# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300
-# purple, and 360 is red again.
-# Minimum value: 0, maximum value: 359, default value: 220.
-# This tag requires that the tag GENERATE_HTML is set to YES.
+# The HTML_HEADER tag can be used to specify a personal HTML header for 
+# each generated HTML page. If it is left blank doxygen will generate a 
+# standard header. Note that when using a custom header you are responsible 
+# for the proper inclusion of any scripts and style sheets that doxygen 
+# needs, which is dependent on the configuration options used. 
+# It is adviced to generate a default header using "doxygen -w html 
+# header.html footer.html stylesheet.css YourConfigFile" and then modify 
+# that header. Note that the header is subject to change so you typically 
+# have to redo this when upgrading to a newer version of doxygen or when
+# changing the value of configuration settings such as GENERATE_TREEVIEW!
+
+HTML_HEADER            = 
+
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for 
+# each generated HTML page. If it is left blank doxygen will generate a 
+# standard footer.
+
+HTML_FOOTER            = 
+
+# If the HTML_TIMESTAMP tag is set to YES then the generated HTML
+# documentation will contain the timesstamp.
+
+HTML_TIMESTAMP         = YES
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading 
+# style sheet that is used by each HTML page. It can be used to 
+# fine-tune the look of the HTML output. If the tag is left blank doxygen 
+# will generate a default style sheet. Note that doxygen will try to copy 
+# the style sheet file to the HTML output directory, so don't put your own 
+# stylesheet in the HTML output directory as well, or it will be erased!
+
+HTML_STYLESHEET        = 
+
+# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or 
+# other source files which should be copied to the HTML output directory. Note 
+# that these files will be copied to the base HTML output directory. Use the 
+# $relpath$ marker in the HTML_HEADER and/or HTML_FOOTER files to load these 
+# files. In the HTML_STYLESHEET file, use the file name only. Also note that 
+# the files will be copied as-is; there are no commands or markers available.
+
+HTML_EXTRA_FILES       = 
+
+# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. 
+# Doxygen will adjust the colors in the stylesheet and background images 
+# according to this color. Hue is specified as an angle on a colorwheel, 
+# see http://en.wikipedia.org/wiki/Hue for more information. 
+# For instance the value 0 represents red, 60 is yellow, 120 is green, 
+# 180 is cyan, 240 is blue, 300 purple, and 360 is red again. 
+# The allowed range is 0 to 359.
 
 HTML_COLORSTYLE_HUE    = 224
 
-# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors
-# in the HTML output. For a value of 0 the output will use grayscales only. A
-# value of 255 will produce the most vivid colors.
-# Minimum value: 0, maximum value: 255, default value: 100.
-# This tag requires that the tag GENERATE_HTML is set to YES.
+# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of 
+# the colors in the HTML output. For a value of 0 the output will use 
+# grayscales only. A value of 255 will produce the most vivid colors.
 
 HTML_COLORSTYLE_SAT    = 63
 
-# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the
-# luminance component of the colors in the HTML output. Values below 100
-# gradually make the output lighter, whereas values above 100 make the output
-# darker. The value divided by 100 is the actual gamma applied, so 80 represents
-# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not
-# change the gamma.
-# Minimum value: 40, maximum value: 240, default value: 80.
-# This tag requires that the tag GENERATE_HTML is set to YES.
+# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to 
+# the luminance component of the colors in the HTML output. Values below 
+# 100 gradually make the output lighter, whereas values above 100 make 
+# the output darker. The value divided by 100 is the actual gamma applied, 
+# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2, 
+# and 100 does not change the gamma.
 
 HTML_COLORSTYLE_GAMMA  = 152
 
-# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
-# page will contain the date and time when the page was generated. Setting this
-# to YES can help to show when doxygen was last run and thus if the
-# documentation is up to date.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTML is set to YES.
+# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML 
+# page will contain the date and time when the page was generated. Setting 
+# this to NO can help when comparing the output of multiple runs.
 
 HTML_TIMESTAMP         = YES
 
-# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
-# documentation will contain sections that can be hidden and shown after the
-# page has loaded.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTML is set to YES.
+# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, 
+# files or namespaces will be aligned in HTML using tables. If set to 
+# NO a bullet list will be used.
+
+HTML_ALIGN_MEMBERS     = YES
+
+# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML 
+# documentation will contain sections that can be hidden and shown after the 
+# page has loaded. For this to work a browser that supports 
+# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox 
+# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
 
 HTML_DYNAMIC_SECTIONS  = YES
 
-# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries
-# shown in the various tree structured indices initially; the user can expand
-# and collapse entries dynamically later on. Doxygen will expand the tree to
-# such a level that at most the specified number of entries are visible (unless
-# a fully collapsed tree already exceeds this amount). So setting the number of
-# entries 1 will produce a full collapsed tree by default. 0 is a special value
-# representing an infinite number of entries and will result in a full expanded
-# tree by default.
-# Minimum value: 0, maximum value: 9999, default value: 100.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_INDEX_NUM_ENTRIES = 100
-
-# If the GENERATE_DOCSET tag is set to YES, additional index files will be
-# generated that can be used as input for Apple's Xcode 3 integrated development
-# environment (see: http://developer.apple.com/tools/xcode/), introduced with
-# OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a
-# Makefile in the HTML output directory. Running make will produce the docset in
-# that directory and running make install will install the docset in
-# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at
-# startup. See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html
+# If the GENERATE_DOCSET tag is set to YES, additional index files 
+# will be generated that can be used as input for Apple's Xcode 3 
+# integrated development environment, introduced with OSX 10.5 (Leopard). 
+# To create a documentation set, doxygen will generate a Makefile in the 
+# HTML output directory. Running make will produce the docset in that 
+# directory and running "make install" will install the docset in 
+# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find 
+# it at startup. 
+# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html 
 # for more information.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTML is set to YES.
 
 GENERATE_DOCSET        = NO
 
-# This tag determines the name of the docset feed. A documentation feed provides
-# an umbrella under which multiple documentation sets from a single provider
-# (such as a company or product suite) can be grouped.
-# The default value is: Doxygen generated docs.
-# This tag requires that the tag GENERATE_DOCSET is set to YES.
+# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the 
+# feed. A documentation feed provides an umbrella under which multiple 
+# documentation sets from a single provider (such as a company or product suite) 
+# can be grouped.
 
 DOCSET_FEEDNAME        = "Doxygen generated docs"
 
-# This tag specifies a string that should uniquely identify the documentation
-# set bundle. This should be a reverse domain-name style string, e.g.
-# com.mycompany.MyDocSet. Doxygen will append .docset to the name.
-# The default value is: org.doxygen.Project.
-# This tag requires that the tag GENERATE_DOCSET is set to YES.
+# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that 
+# should uniquely identify the documentation set bundle. This should be a 
+# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen 
+# will append .docset to the name.
 
 DOCSET_BUNDLE_ID       = org.doxygen.Project
 
-# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify
-# the documentation publisher. This should be a reverse domain-name style
+# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely identify 
+# the documentation publisher. This should be a reverse domain-name style 
 # string, e.g. com.mycompany.MyDocSet.documentation.
-# The default value is: org.doxygen.Publisher.
-# This tag requires that the tag GENERATE_DOCSET is set to YES.
 
 DOCSET_PUBLISHER_ID    = org.doxygen.Publisher
 
-# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher.
-# The default value is: Publisher.
-# This tag requires that the tag GENERATE_DOCSET is set to YES.
+# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher.
 
 DOCSET_PUBLISHER_NAME  = Publisher
 
-# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three
-# additional HTML index files: index.hhp, index.hhc, and index.hhk. The
-# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop
-# (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on
-# Windows.
-#
-# The HTML Help Workshop contains a compiler that can convert all HTML output
-# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML
-# files are now used as the Windows 98 help format, and will replace the old
-# Windows help format (.hlp) on all Windows platforms in the future. Compressed
-# HTML files also contain an index, a table of contents, and you can search for
-# words in the documentation. The HTML workshop also contains a viewer for
-# compressed HTML files.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTML is set to YES.
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files 
+# will be generated that can be used as input for tools like the 
+# Microsoft HTML help workshop to generate a compiled HTML help file (.chm) 
+# of the generated HTML documentation.
 
 GENERATE_HTMLHELP      = NO
 
-# The CHM_FILE tag can be used to specify the file name of the resulting .chm
-# file. You can add a path in front of the file if the result should not be
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can 
+# be used to specify the file name of the resulting .chm file. You 
+# can add a path in front of the file if the result should not be 
 # written to the html output directory.
-# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
-
-CHM_FILE               =
-
-# The HHC_LOCATION tag can be used to specify the location (absolute path
-# including file name) of the HTML help compiler (hhc.exe). If non-empty,
-# doxygen will try to run the HTML help compiler on the generated index.hhp.
-# The file has to be specified with full path.
-# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
-
-HHC_LOCATION           =
-
-# The GENERATE_CHI flag controls if a separate .chi index file is generated
-# (YES) or that it should be included in the master .chm file (NO).
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
+
+CHM_FILE               = 
+
+# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can 
+# be used to specify the location (absolute path including file name) of 
+# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run 
+# the HTML help compiler on the generated index.hhp.
+
+HHC_LOCATION           = 
+
+# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag 
+# controls if a separate .chi index file is generated (YES) or that 
+# it should be included in the master .chm file (NO).
 
 GENERATE_CHI           = NO
 
-# The CHM_INDEX_ENCODING is used to encode HtmlHelp index (hhk), content (hhc)
-# and project file content.
-# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
-
-CHM_INDEX_ENCODING     =
-
-# The BINARY_TOC flag controls whether a binary table of contents is generated
-# (YES) or a normal table of contents (NO) in the .chm file. Furthermore it
-# enables the Previous and Next buttons.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING 
+# is used to encode HtmlHelp index (hhk), content (hhc) and project file 
+# content.
+
+CHM_INDEX_ENCODING     = 
+
+# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag 
+# controls whether a binary table of contents is generated (YES) or a 
+# normal table of contents (NO) in the .chm file.
 
 BINARY_TOC             = NO
 
-# The TOC_EXPAND flag can be set to YES to add extra items for group members to
-# the table of contents of the HTML help documentation and to the tree view.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
+# The TOC_EXPAND flag can be set to YES to add extra items for group members 
+# to the contents of the HTML help documentation and to the tree view.
 
 TOC_EXPAND             = NO
 
-# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and
-# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that
-# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help
-# (.qch) of the generated HTML documentation.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTML is set to YES.
+# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and 
+# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated 
+# that can be used as input for Qt's qhelpgenerator to generate a 
+# Qt Compressed Help (.qch) of the generated HTML documentation.
 
 GENERATE_QHP           = NO
 
-# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify
-# the file name of the resulting .qch file. The path specified is relative to
-# the HTML output folder.
-# This tag requires that the tag GENERATE_QHP is set to YES.
-
-QCH_FILE               =
-
-# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help
-# Project output. For more information please see Qt Help Project / Namespace
-# (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace).
-# The default value is: org.doxygen.Project.
-# This tag requires that the tag GENERATE_QHP is set to YES.
+# If the QHG_LOCATION tag is specified, the QCH_FILE tag can 
+# be used to specify the file name of the resulting .qch file. 
+# The path specified is relative to the HTML output folder.
+
+QCH_FILE               = 
+
+# The QHP_NAMESPACE tag specifies the namespace to use when generating 
+# Qt Help Project output. For more information please see 
+# http://doc.trolltech.com/qthelpproject.html#namespace
 
 QHP_NAMESPACE          = org.doxygen.Project
 
-# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt
-# Help Project output. For more information please see Qt Help Project / Virtual
-# Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual-
-# folders).
-# The default value is: doc.
-# This tag requires that the tag GENERATE_QHP is set to YES.
+# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating 
+# Qt Help Project output. For more information please see 
+# http://doc.trolltech.com/qthelpproject.html#virtual-folders
 
 QHP_VIRTUAL_FOLDER     = doc
 
-# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom
-# filter to add. For more information please see Qt Help Project / Custom
-# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom-
-# filters).
-# This tag requires that the tag GENERATE_QHP is set to YES.
-
-QHP_CUST_FILTER_NAME   =
-
-# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the
-# custom filter to add. For more information please see Qt Help Project / Custom
-# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom-
-# filters).
-# This tag requires that the tag GENERATE_QHP is set to YES.
-
-QHP_CUST_FILTER_ATTRS  =
-
-# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this
-# project's filter section matches. Qt Help Project / Filter Attributes (see:
-# http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes).
-# This tag requires that the tag GENERATE_QHP is set to YES.
-
-QHP_SECT_FILTER_ATTRS  =
-
-# The QHG_LOCATION tag can be used to specify the location of Qt's
-# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the
-# generated .qhp file.
-# This tag requires that the tag GENERATE_QHP is set to YES.
-
-QHG_LOCATION           =
-
-# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be
-# generated, together with the HTML files, they form an Eclipse help plugin. To
-# install this plugin and make it available under the help contents menu in
-# Eclipse, the contents of the directory containing the HTML and XML files needs
-# to be copied into the plugins directory of eclipse. The name of the directory
-# within the plugins directory should be the same as the ECLIPSE_DOC_ID value.
-# After copying Eclipse needs to be restarted before the help appears.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTML is set to YES.
+# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to 
+# add. For more information please see 
+# http://doc.trolltech.com/qthelpproject.html#custom-filters
+
+QHP_CUST_FILTER_NAME   = 
+
+# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the 
+# custom filter to add. For more information please see 
+# <a href="http://doc.trolltech.com/qthelpproject.html#custom-filters"> 
+# Qt Help Project / Custom Filters</a>.
+
+QHP_CUST_FILTER_ATTRS  = 
+
+# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this 
+# project's 
+# filter section matches. 
+# <a href="http://doc.trolltech.com/qthelpproject.html#filter-attributes"> 
+# Qt Help Project / Filter Attributes</a>.
+
+QHP_SECT_FILTER_ATTRS  = 
+
+# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can 
+# be used to specify the location of Qt's qhelpgenerator. 
+# If non-empty doxygen will try to run qhelpgenerator on the generated 
+# .qhp file.
+
+QHG_LOCATION           = 
+
+# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files  
+# will be generated, which together with the HTML files, form an Eclipse help 
+# plugin. To install this plugin and make it available under the help contents 
+# menu in Eclipse, the contents of the directory containing the HTML and XML 
+# files needs to be copied into the plugins directory of eclipse. The name of 
+# the directory within the plugins directory should be the same as 
+# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before 
+# the help appears.
 
 GENERATE_ECLIPSEHELP   = NO
 
-# A unique identifier for the Eclipse help plugin. When installing the plugin
-# the directory name containing the HTML and XML files should also have this
-# name. Each documentation set should have its own identifier.
-# The default value is: org.doxygen.Project.
-# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES.
+# A unique identifier for the eclipse help plugin. When installing the plugin 
+# the directory name containing the HTML and XML files should also have 
+# this name.
 
 ECLIPSE_DOC_ID         = org.doxygen.Project
 
-# If you want full control over the layout of the generated HTML pages it might
-# be necessary to disable the index and replace it with your own. The
-# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top
-# of each HTML page. A value of NO enables the index and the value YES disables
-# it. Since the tabs in the index contain the same information as the navigation
-# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTML is set to YES.
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index at 
+# top of each HTML page. The value NO (the default) enables the index and 
+# the value YES disables it.
 
 DISABLE_INDEX          = NO
 
-# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
-# structure should be generated to display hierarchical information. If the tag
-# value is set to YES, a side panel will be generated containing a tree-like
-# index structure (just like the one that is generated for HTML Help). For this
-# to work a browser that supports JavaScript, DHTML, CSS and frames is required
-# (i.e. any modern browser). Windows users are probably better off using the
-# HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can
-# further fine-tune the look of the index. As an example, the default style
-# sheet generated by doxygen has an example that shows how to put an image at
-# the root of the tree instead of the PROJECT_NAME. Since the tree basically has
-# the same information as the tab index, you could consider setting
-# DISABLE_INDEX to YES when enabling this option.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTML is set to YES.
+# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values 
+# (range [0,1..20]) that doxygen will group on one line in the generated HTML 
+# documentation. Note that a value of 0 will completely suppress the enum 
+# values from appearing in the overview section.
+
+ENUM_VALUES_PER_LINE   = 4
+
+# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index 
+# structure should be generated to display hierarchical information. 
+# If the tag value is set to YES, a side panel will be generated 
+# containing a tree-like index structure (just like the one that 
+# is generated for HTML Help). For this to work a browser that supports 
+# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser). 
+# Windows users are probably better off using the HTML help feature.
 
 GENERATE_TREEVIEW      = YES
 
-# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that
-# doxygen will group on one line in the generated HTML documentation.
-#
-# Note that a value of 0 will completely suppress the enum values from appearing
-# in the overview section.
-# Minimum value: 0, maximum value: 20, default value: 4.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-ENUM_VALUES_PER_LINE   = 4
-
-# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used
-# to set the initial width (in pixels) of the frame in which the tree is shown.
-# Minimum value: 0, maximum value: 1500, default value: 250.
-# This tag requires that the tag GENERATE_HTML is set to YES.
+# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories, 
+# and Class Hierarchy pages using a tree view instead of an ordered list.
+
+USE_INLINE_TREES       = YES
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be 
+# used to set the initial width (in pixels) of the frame in which the tree 
+# is shown.
 
 TREEVIEW_WIDTH         = 250
 
-# If the EXT_LINKS_IN_WINDOW option is set to YES, doxygen will open links to
-# external symbols imported via tag files in a separate window.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTML is set to YES.
+# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open 
+# links to external symbols imported via tag files in a separate window.
 
 EXT_LINKS_IN_WINDOW    = NO
 
-# Use this tag to change the font size of LaTeX formulas included as images in
-# the HTML documentation. When you change the font size after a successful
-# doxygen run you need to manually remove any form_*.png images from the HTML
-# output directory to force them to be regenerated.
-# Minimum value: 8, maximum value: 50, default value: 10.
-# This tag requires that the tag GENERATE_HTML is set to YES.
+# Use this tag to change the font size of Latex formulas included 
+# as images in the HTML documentation. The default is 10. Note that 
+# when you change the font size after a successful doxygen run you need 
+# to manually remove any form_*.png images from the HTML output directory 
+# to force them to be regenerated.
 
 FORMULA_FONTSIZE       = 10
 
-# Use the FORMULA_TRANPARENT tag to determine whether or not the images
-# generated for formulas are transparent PNGs. Transparent PNGs are not
-# supported properly for IE 6.0, but are supported on all modern browsers.
-#
-# Note that when changing this option you need to delete any form_*.png files in
-# the HTML output directory before the changes have effect.
-# The default value is: YES.
-# This tag requires that the tag GENERATE_HTML is set to YES.
+# Use the FORMULA_TRANPARENT tag to determine whether or not the images 
+# generated for formulas are transparent PNGs. Transparent PNGs are 
+# not supported properly for IE 6.0, but are supported on all modern browsers. 
+# Note that when changing this option you need to delete any form_*.png files 
+# in the HTML output before the changes have effect.
 
 FORMULA_TRANSPARENT    = YES
 
-# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see
-# http://www.mathjax.org) which uses client side Javascript for the rendering
-# instead of using pre-rendered bitmaps. Use this if you do not have LaTeX
-# installed or if you want to formulas look prettier in the HTML output. When
-# enabled you may also need to install MathJax separately and configure the path
-# to it using the MATHJAX_RELPATH option.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTML is set to YES.
+# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax 
+# (see http://www.mathjax.org) which uses client side Javascript for the 
+# rendering instead of using prerendered bitmaps. Use this if you do not 
+# have LaTeX installed or if you want to formulas look prettier in the HTML 
+# output. When enabled you also need to install MathJax separately and 
+# configure the path to it using the MATHJAX_RELPATH option.
 
 USE_MATHJAX            = NO
 
-# When MathJax is enabled you can set the default output format to be used for
-# the MathJax output. See the MathJax site (see:
-# http://docs.mathjax.org/en/latest/output.html) for more details.
-# Possible values are: HTML-CSS (which is slower, but has the best
-# compatibility), NativeMML (i.e. MathML) and SVG.
-# The default value is: HTML-CSS.
-# This tag requires that the tag USE_MATHJAX is set to YES.
-
-MATHJAX_FORMAT         = HTML-CSS
-
-# When MathJax is enabled you need to specify the location relative to the HTML
-# output directory using the MATHJAX_RELPATH option. The destination directory
-# should contain the MathJax.js script. For instance, if the mathjax directory
-# is located at the same level as the HTML output directory, then
-# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax
-# Content Delivery Network so you can quickly see the result without installing
-# MathJax. However, it is strongly recommended to install a local copy of
-# MathJax from http://www.mathjax.org before deployment.
-# The default value is: http://cdn.mathjax.org/mathjax/latest.
-# This tag requires that the tag USE_MATHJAX is set to YES.
+# When MathJax is enabled you need to specify the location relative to the 
+# HTML output directory using the MATHJAX_RELPATH option. The destination 
+# directory should contain the MathJax.js script. For instance, if the mathjax 
+# directory is located at the same level as the HTML output directory, then 
+# MATHJAX_RELPATH should be ../mathjax. The default value points to the 
+# mathjax.org site, so you can quickly see the result without installing 
+# MathJax, but it is strongly recommended to install a local copy of MathJax 
+# before deployment.
 
 MATHJAX_RELPATH        = http://www.mathjax.org/mathjax
 
-# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax
-# extension names that should be enabled during MathJax rendering. For example
-# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols
-# This tag requires that the tag USE_MATHJAX is set to YES.
-
-MATHJAX_EXTENSIONS     =
-
-# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces
-# of code that will be used on startup of the MathJax code. See the MathJax site
-# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an
-# example see the documentation.
-# This tag requires that the tag USE_MATHJAX is set to YES.
-
-MATHJAX_CODEFILE       =
-
-# When the SEARCHENGINE tag is enabled doxygen will generate a search box for
-# the HTML output. The underlying search engine uses javascript and DHTML and
-# should work on any modern browser. Note that when using HTML help
-# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET)
-# there is already a search function so this one should typically be disabled.
-# For large projects the javascript based search engine can be slow, then
-# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to
-# search using the keyboard; to jump to the search box use <access key> + S
-# (what the <access key> is depends on the OS and browser, but it is typically
-# <CTRL>, <ALT>/<option>, or both). Inside the search box use the <cursor down
-# key> to jump into the search results window, the results can be navigated
-# using the <cursor keys>. Press <Enter> to select an item or <escape> to cancel
-# the search. The filter options can be selected when the cursor is inside the
-# search box by pressing <Shift>+<cursor down>. Also here use the <cursor keys>
-# to select a filter and <Enter> or <escape> to activate or cancel the filter
-# option.
-# The default value is: YES.
-# This tag requires that the tag GENERATE_HTML is set to YES.
+# When the SEARCHENGINE tag is enabled doxygen will generate a search box 
+# for the HTML output. The underlying search engine uses javascript 
+# and DHTML and should work on any modern browser. Note that when using 
+# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets 
+# (GENERATE_DOCSET) there is already a search function so this one should 
+# typically be disabled. For large projects the javascript based search engine 
+# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution.
 
 SEARCHENGINE           = YES
 
-# When the SERVER_BASED_SEARCH tag is enabled the search engine will be
-# implemented using a web server instead of a web client using Javascript. There
-# are two flavors of web server based searching depending on the EXTERNAL_SEARCH
-# setting. When disabled, doxygen will generate a PHP script for searching and
-# an index file used by the script. When EXTERNAL_SEARCH is enabled the indexing
-# and searching needs to be provided by external tools. See the section
-# "External Indexing and Searching" for details.
-# The default value is: NO.
-# This tag requires that the tag SEARCHENGINE is set to YES.
+# When the SERVER_BASED_SEARCH tag is enabled the search engine will be 
+# implemented using a PHP enabled web server instead of at the web client 
+# using Javascript. Doxygen will generate the search PHP script and index 
+# file to put on the web server. The advantage of the server 
+# based approach is that it scales better to large projects and allows 
+# full text search. The disadvantages are that it is more difficult to setup 
+# and does not have live searching capabilities.
 
 SERVER_BASED_SEARCH    = NO
 
-# When EXTERNAL_SEARCH tag is enabled doxygen will no longer generate the PHP
-# script for searching. Instead the search results are written to an XML file
-# which needs to be processed by an external indexer. Doxygen will invoke an
-# external search engine pointed to by the SEARCHENGINE_URL option to obtain the
-# search results.
-#
-# Doxygen ships with an example indexer (doxyindexer) and search engine
-# (doxysearch.cgi) which are based on the open source search engine library
-# Xapian (see: http://xapian.org/).
-#
-# See the section "External Indexing and Searching" for details.
-# The default value is: NO.
-# This tag requires that the tag SEARCHENGINE is set to YES.
-
-EXTERNAL_SEARCH        = NO
-
-# The SEARCHENGINE_URL should point to a search engine hosted by a web server
-# which will return the search results when EXTERNAL_SEARCH is enabled.
-#
-# Doxygen ships with an example indexer (doxyindexer) and search engine
-# (doxysearch.cgi) which are based on the open source search engine library
-# Xapian (see: http://xapian.org/). See the section "External Indexing and
-# Searching" for details.
-# This tag requires that the tag SEARCHENGINE is set to YES.
-
-SEARCHENGINE_URL       =
-
-# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the unindexed
-# search data is written to a file for indexing by an external tool. With the
-# SEARCHDATA_FILE tag the name of this file can be specified.
-# The default file is: searchdata.xml.
-# This tag requires that the tag SEARCHENGINE is set to YES.
-
-SEARCHDATA_FILE        = searchdata.xml
-
-# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the
-# EXTERNAL_SEARCH_ID tag can be used as an identifier for the project. This is
-# useful in combination with EXTRA_SEARCH_MAPPINGS to search through multiple
-# projects and redirect the results back to the right project.
-# This tag requires that the tag SEARCHENGINE is set to YES.
-
-EXTERNAL_SEARCH_ID     =
-
-# The EXTRA_SEARCH_MAPPINGS tag can be used to enable searching through doxygen
-# projects other than the one defined by this configuration file, but that are
-# all added to the same external search index. Each project needs to have a
-# unique id set via EXTERNAL_SEARCH_ID. The search mapping then maps the id of
-# to a relative location where the documentation can be found. The format is:
-# EXTRA_SEARCH_MAPPINGS = tagname1=loc1 tagname2=loc2 ...
-# This tag requires that the tag SEARCHENGINE is set to YES.
-
-EXTRA_SEARCH_MAPPINGS  =
-
-#---------------------------------------------------------------------------
-# Configuration options related to the LaTeX output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_LATEX tag is set to YES, doxygen will generate LaTeX output.
-# The default value is: YES.
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will 
+# generate Latex output.
 
 GENERATE_LATEX         = NO
 
-# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. If a
-# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
-# it.
-# The default directory is: latex.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `latex' will be used as the default path.
 
 LATEX_OUTPUT           = latex
 
-# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
-# invoked.
-#
-# Note that when enabling USE_PDFLATEX this option is only used for generating
-# bitmaps for formulas in the HTML output, but not in the Makefile that is
-# written to the output directory.
-# The default file is: latex.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be 
+# invoked. If left blank `latex' will be used as the default command name. 
+# Note that when enabling USE_PDFLATEX this option is only used for 
+# generating bitmaps for formulas in the HTML output, but not in the 
+# Makefile that is written to the output directory.
 
 LATEX_CMD_NAME         = latex
 
-# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to generate
-# index for LaTeX.
-# The default file is: makeindex.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to 
+# generate index for LaTeX. If left blank `makeindex' will be used as the 
+# default command name.
 
 MAKEINDEX_CMD_NAME     = makeindex
 
-# If the COMPACT_LATEX tag is set to YES, doxygen generates more compact LaTeX
-# documents. This may be useful for small projects and may help to save some
-# trees in general.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact 
+# LaTeX documents. This may be useful for small projects and may help to 
+# save some trees in general.
 
 COMPACT_LATEX          = NO
 
-# The PAPER_TYPE tag can be used to set the paper type that is used by the
-# printer.
-# Possible values are: a4 (210 x 297 mm), letter (8.5 x 11 inches), legal (8.5 x
-# 14 inches) and executive (7.25 x 10.5 inches).
-# The default value is: a4.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
+# The PAPER_TYPE tag can be used to set the paper type that is used 
+# by the printer. Possible values are: a4, letter, legal and 
+# executive. If left blank a4wide will be used.
 
 PAPER_TYPE             = a4
 
-# The EXTRA_PACKAGES tag can be used to specify one or more LaTeX package names
-# that should be included in the LaTeX output. The package can be specified just
-# by its name or with the correct syntax as to be used with the LaTeX
-# \usepackage command. To get the times font for instance you can specify :
-# EXTRA_PACKAGES=times or EXTRA_PACKAGES={times}
-# To use the option intlimits with the amsmath package you can specify:
-# EXTRA_PACKAGES=[intlimits]{amsmath}
-# If left blank no extra packages will be included.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-EXTRA_PACKAGES         =
-
-# The LATEX_HEADER tag can be used to specify a personal LaTeX header for the
-# generated LaTeX document. The header should contain everything until the first
-# chapter. If it is left blank doxygen will generate a standard header. See
-# section "Doxygen usage" for information on how to let doxygen write the
-# default header to a separate file.
-#
-# Note: Only use a user-defined header if you know what you are doing! The
-# following commands have a special meaning inside the header: $title,
-# $datetime, $date, $doxygenversion, $projectname, $projectnumber,
-# $projectbrief, $projectlogo. Doxygen will replace $title with the empty
-# string, for the replacement values of the other commands the user is referred
-# to HTML_HEADER.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-LATEX_HEADER           =
-
-# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for the
-# generated LaTeX document. The footer should contain everything after the last
-# chapter. If it is left blank doxygen will generate a standard footer. See
-# LATEX_HEADER for more information on how to generate a default footer and what
-# special commands can be used inside the footer.
-#
-# Note: Only use a user-defined footer if you know what you are doing!
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-LATEX_FOOTER           =
-
-# The LATEX_EXTRA_STYLESHEET tag can be used to specify additional user-defined
-# LaTeX style sheets that are included after the standard style sheets created
-# by doxygen. Using this option one can overrule certain style aspects. Doxygen
-# will copy the style sheet files to the output directory.
-# Note: The order of the extra style sheet files is of importance (e.g. the last
-# style sheet in the list overrules the setting of the previous ones in the
-# list).
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-LATEX_EXTRA_STYLESHEET =
-
-# The LATEX_EXTRA_FILES tag can be used to specify one or more extra images or
-# other source files which should be copied to the LATEX_OUTPUT output
-# directory. Note that the files will be copied as-is; there are no commands or
-# markers available.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-LATEX_EXTRA_FILES      =
-
-# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated is
-# prepared for conversion to PDF (using ps2pdf or pdflatex). The PDF file will
-# contain links (just like the HTML output) instead of page references. This
-# makes the output suitable for online browsing using a PDF viewer.
-# The default value is: YES.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX 
+# packages that should be included in the LaTeX output.
+
+EXTRA_PACKAGES         = 
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for 
+# the generated latex document. The header should contain everything until 
+# the first chapter. If it is left blank doxygen will generate a 
+# standard header. Notice: only use this tag if you know what you are doing!
+
+LATEX_HEADER           = 
+
+# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for 
+# the generated latex document. The footer should contain everything after 
+# the last chapter. If it is left blank doxygen will generate a 
+# standard footer. Notice: only use this tag if you know what you are doing!
+
+LATEX_FOOTER           = 
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated 
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will 
+# contain links (just like the HTML output) instead of page references 
+# This makes the output suitable for online browsing using a pdf viewer.
 
 PDF_HYPERLINKS         = YES
 
-# If the USE_PDFLATEX tag is set to YES, doxygen will use pdflatex to generate
-# the PDF file directly from the LaTeX files. Set this option to YES, to get a
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of 
+# plain latex in the generated Makefile. Set this option to YES to get a 
 # higher quality PDF documentation.
-# The default value is: YES.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
 
 USE_PDFLATEX           = YES
 
-# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \batchmode
-# command to the generated LaTeX files. This will instruct LaTeX to keep running
-# if errors occur, instead of asking the user for help. This option is also used
-# when generating formulas in HTML.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. 
+# command to the generated LaTeX files. This will instruct LaTeX to keep 
+# running if errors occur, instead of asking the user for help. 
+# This option is also used when generating formulas in HTML.
 
 LATEX_BATCHMODE        = NO
 
-# If the LATEX_HIDE_INDICES tag is set to YES then doxygen will not include the
-# index chapters (such as File Index, Compound Index, etc.) in the output.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
+# If LATEX_HIDE_INDICES is set to YES then doxygen will not 
+# include the index chapters (such as File Index, Compound Index, etc.) 
+# in the output.
 
 LATEX_HIDE_INDICES     = NO
 
-# If the LATEX_SOURCE_CODE tag is set to YES then doxygen will include source
-# code with syntax highlighting in the LaTeX output.
-#
-# Note that which sources are shown also depends on other settings such as
-# SOURCE_BROWSER.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
+# If LATEX_SOURCE_CODE is set to YES then doxygen will include 
+# source code with syntax highlighting in the LaTeX output. 
+# Note that which sources are shown also depends on other settings 
+# such as SOURCE_BROWSER.
 
 LATEX_SOURCE_CODE      = NO
 
-# The LATEX_BIB_STYLE tag can be used to specify the style to use for the
-# bibliography, e.g. plainnat, or ieeetr. See
-# http://en.wikipedia.org/wiki/BibTeX and \cite for more info.
-# The default value is: plain.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-LATEX_BIB_STYLE        = plain
-
-#---------------------------------------------------------------------------
-# Configuration options related to the RTF output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_RTF tag is set to YES, doxygen will generate RTF output. The
-# RTF output is optimized for Word 97 and may not look too pretty with other RTF
-# readers/editors.
-# The default value is: NO.
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output 
+# The RTF output is optimized for Word 97 and may not look very pretty with 
+# other RTF readers or editors.
 
 GENERATE_RTF           = NO
 
-# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. If a
-# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
-# it.
-# The default directory is: rtf.
-# This tag requires that the tag GENERATE_RTF is set to YES.
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `rtf' will be used as the default path.
 
 RTF_OUTPUT             = rtf
 
-# If the COMPACT_RTF tag is set to YES, doxygen generates more compact RTF
-# documents. This may be useful for small projects and may help to save some
-# trees in general.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_RTF is set to YES.
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact 
+# RTF documents. This may be useful for small projects and may help to 
+# save some trees in general.
 
 COMPACT_RTF            = NO
 
-# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated will
-# contain hyperlink fields. The RTF file will contain links (just like the HTML
-# output) instead of page references. This makes the output suitable for online
-# browsing using Word or some other Word compatible readers that support those
-# fields.
-#
-# Note: WordPad (write) and others do not support links.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_RTF is set to YES.
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated 
+# will contain hyperlink fields. The RTF file will 
+# contain links (just like the HTML output) instead of page references. 
+# This makes the output suitable for online browsing using WORD or other 
+# programs which support those fields. 
+# Note: wordpad (write) and others do not support links.
 
 RTF_HYPERLINKS         = NO
 
-# Load stylesheet definitions from file. Syntax is similar to doxygen's config
-# file, i.e. a series of assignments. You only have to provide replacements,
-# missing definitions are set to their default value.
-#
-# See also section "Doxygen usage" for information on how to generate the
-# default style sheet that doxygen normally uses.
-# This tag requires that the tag GENERATE_RTF is set to YES.
-
-RTF_STYLESHEET_FILE    =
-
-# Set optional variables used in the generation of an RTF document. Syntax is
-# similar to doxygen's config file. A template extensions file can be generated
-# using doxygen -e rtf extensionFile.
-# This tag requires that the tag GENERATE_RTF is set to YES.
-
-RTF_EXTENSIONS_FILE    =
-
-# If the RTF_SOURCE_CODE tag is set to YES then doxygen will include source code
-# with syntax highlighting in the RTF output.
-#
-# Note that which sources are shown also depends on other settings such as
-# SOURCE_BROWSER.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_RTF is set to YES.
-
-RTF_SOURCE_CODE        = NO
-
-#---------------------------------------------------------------------------
-# Configuration options related to the man page output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_MAN tag is set to YES, doxygen will generate man pages for
-# classes and files.
-# The default value is: NO.
+# Load stylesheet definitions from file. Syntax is similar to doxygen's 
+# config file, i.e. a series of assignments. You only have to provide 
+# replacements, missing definitions are set to their default value.
+
+RTF_STYLESHEET_FILE    = 
+
+# Set optional variables used in the generation of an rtf document. 
+# Syntax is similar to doxygen's config file.
+
+RTF_EXTENSIONS_FILE    = 
+
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will 
+# generate man pages
 
 GENERATE_MAN           = NO
 
-# The MAN_OUTPUT tag is used to specify where the man pages will be put. If a
-# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
-# it. A directory man3 will be created inside the directory specified by
-# MAN_OUTPUT.
-# The default directory is: man.
-# This tag requires that the tag GENERATE_MAN is set to YES.
+# The MAN_OUTPUT tag is used to specify where the man pages will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `man' will be used as the default path.
 
 MAN_OUTPUT             = man
 
-# The MAN_EXTENSION tag determines the extension that is added to the generated
-# man pages. In case the manual section does not start with a number, the number
-# 3 is prepended. The dot (.) at the beginning of the MAN_EXTENSION tag is
-# optional.
-# The default value is: .3.
-# This tag requires that the tag GENERATE_MAN is set to YES.
+# The MAN_EXTENSION tag determines the extension that is added to 
+# the generated man pages (default is the subroutine's section .3)
 
 MAN_EXTENSION          = .3
 
-# The MAN_SUBDIR tag determines the name of the directory created within
-# MAN_OUTPUT in which the man pages are placed. If defaults to man followed by
-# MAN_EXTENSION with the initial . removed.
-# This tag requires that the tag GENERATE_MAN is set to YES.
-
-MAN_SUBDIR             =
-
-# If the MAN_LINKS tag is set to YES and doxygen generates man output, then it
-# will generate one additional man file for each entity documented in the real
-# man page(s). These additional files only source the real man page, but without
-# them the man command would be unable to find the correct page.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_MAN is set to YES.
+# If the MAN_LINKS tag is set to YES and Doxygen generates man output, 
+# then it will generate one additional man file for each entity 
+# documented in the real man page(s). These additional files 
+# only source the real man page, but without them the man command 
+# would be unable to find the correct page. The default is NO.
 
 MAN_LINKS              = NO
 
 #---------------------------------------------------------------------------
-# Configuration options related to the XML output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_XML tag is set to YES, doxygen will generate an XML file that
-# captures the structure of the code including all documentation.
-# The default value is: NO.
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES Doxygen will 
+# generate an XML file that captures the structure of 
+# the code including all documentation.
 
 GENERATE_XML           = NO
 
-# The XML_OUTPUT tag is used to specify where the XML pages will be put. If a
-# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
-# it.
-# The default directory is: xml.
-# This tag requires that the tag GENERATE_XML is set to YES.
+# The XML_OUTPUT tag is used to specify where the XML pages will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `xml' will be used as the default path.
 
 XML_OUTPUT             = xml
 
-# If the XML_PROGRAMLISTING tag is set to YES, doxygen will dump the program
-# listings (including syntax highlighting and cross-referencing information) to
-# the XML output. Note that enabling this will significantly increase the size
-# of the XML output.
-# The default value is: YES.
-# This tag requires that the tag GENERATE_XML is set to YES.
+# The XML_SCHEMA tag can be used to specify an XML schema, 
+# which can be used by a validating XML parser to check the 
+# syntax of the XML files.
+
+XML_SCHEMA             = 
+
+# The XML_DTD tag can be used to specify an XML DTD, 
+# which can be used by a validating XML parser to check the 
+# syntax of the XML files.
+
+XML_DTD                = 
+
+# If the XML_PROGRAMLISTING tag is set to YES Doxygen will 
+# dump the program listings (including syntax highlighting 
+# and cross-referencing information) to the XML output. Note that 
+# enabling this will significantly increase the size of the XML output.
 
 XML_PROGRAMLISTING     = YES
 
 #---------------------------------------------------------------------------
-# Configuration options related to the DOCBOOK output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_DOCBOOK tag is set to YES, doxygen will generate Docbook files
-# that can be used to generate PDF.
-# The default value is: NO.
-
-GENERATE_DOCBOOK       = NO
-
-# The DOCBOOK_OUTPUT tag is used to specify where the Docbook pages will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be put in
-# front of it.
-# The default directory is: docbook.
-# This tag requires that the tag GENERATE_DOCBOOK is set to YES.
-
-DOCBOOK_OUTPUT         = docbook
-
-# If the DOCBOOK_PROGRAMLISTING tag is set to YES, doxygen will include the
-# program listings (including syntax highlighting and cross-referencing
-# information) to the DOCBOOK output. Note that enabling this will significantly
-# increase the size of the DOCBOOK output.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_DOCBOOK is set to YES.
-
-DOCBOOK_PROGRAMLISTING = NO
-
-#---------------------------------------------------------------------------
-# Configuration options for the AutoGen Definitions output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_AUTOGEN_DEF tag is set to YES, doxygen will generate an
-# AutoGen Definitions (see http://autogen.sf.net) file that captures the
-# structure of the code including all documentation. Note that this feature is
-# still experimental and incomplete at the moment.
-# The default value is: NO.
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will 
+# generate an AutoGen Definitions (see autogen.sf.net) file 
+# that captures the structure of the code including all 
+# documentation. Note that this feature is still experimental 
+# and incomplete at the moment.
 
 GENERATE_AUTOGEN_DEF   = NO
 
 #---------------------------------------------------------------------------
-# Configuration options related to the Perl module output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_PERLMOD tag is set to YES, doxygen will generate a Perl module
-# file that captures the structure of the code including all documentation.
-#
-# Note that this feature is still experimental and incomplete at the moment.
-# The default value is: NO.
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_PERLMOD tag is set to YES Doxygen will 
+# generate a Perl module file that captures the structure of 
+# the code including all documentation. Note that this 
+# feature is still experimental and incomplete at the 
+# moment.
 
 GENERATE_PERLMOD       = NO
 
-# If the PERLMOD_LATEX tag is set to YES, doxygen will generate the necessary
-# Makefile rules, Perl scripts and LaTeX code to be able to generate PDF and DVI
-# output from the Perl module output.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_PERLMOD is set to YES.
+# If the PERLMOD_LATEX tag is set to YES Doxygen will generate 
+# the necessary Makefile rules, Perl scripts and LaTeX code to be able 
+# to generate PDF and DVI output from the Perl module output.
 
 PERLMOD_LATEX          = NO
 
-# If the PERLMOD_PRETTY tag is set to YES, the Perl module output will be nicely
-# formatted so it can be parsed by a human reader. This is useful if you want to
-# understand what is going on. On the other hand, if this tag is set to NO, the
-# size of the Perl module output will be much smaller and Perl will parse it
-# just the same.
-# The default value is: YES.
-# This tag requires that the tag GENERATE_PERLMOD is set to YES.
+# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be 
+# nicely formatted so it can be parsed by a human reader.  This is useful 
+# if you want to understand what is going on.  On the other hand, if this 
+# tag is set to NO the size of the Perl module output will be much smaller 
+# and Perl will parse it just the same.
 
 PERLMOD_PRETTY         = YES
 
-# The names of the make variables in the generated doxyrules.make file are
-# prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. This is useful
-# so different doxyrules.make files included by the same Makefile don't
-# overwrite each other's variables.
-# This tag requires that the tag GENERATE_PERLMOD is set to YES.
-
-PERLMOD_MAKEVAR_PREFIX =
+# The names of the make variables in the generated doxyrules.make file 
+# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. 
+# This is useful so different doxyrules.make files included by the same 
+# Makefile don't overwrite each other's variables.
+
+PERLMOD_MAKEVAR_PREFIX = 
 
 #---------------------------------------------------------------------------
@@ -1956,127 +1414,106 @@
 #---------------------------------------------------------------------------
 
-# If the ENABLE_PREPROCESSING tag is set to YES, doxygen will evaluate all
-# C-preprocessor directives found in the sources and include files.
-# The default value is: YES.
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will 
+# evaluate all C-preprocessor directives found in the sources and include 
+# files.
 
 ENABLE_PREPROCESSING   = YES
 
-# If the MACRO_EXPANSION tag is set to YES, doxygen will expand all macro names
-# in the source code. If set to NO, only conditional compilation will be
-# performed. Macro expansion can be done in a controlled way by setting
-# EXPAND_ONLY_PREDEF to YES.
-# The default value is: NO.
-# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro 
+# names in the source code. If set to NO (the default) only conditional 
+# compilation will be performed. Macro expansion can be done in a controlled 
+# way by setting EXPAND_ONLY_PREDEF to YES.
 
 MACRO_EXPANSION        = YES
 
-# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES then
-# the macro expansion is limited to the macros specified with the PREDEFINED and
-# EXPAND_AS_DEFINED tags.
-# The default value is: NO.
-# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES 
+# then the macro expansion is limited to the macros specified with the 
+# PREDEFINED and EXPAND_AS_DEFINED tags.
 
 EXPAND_ONLY_PREDEF     = NO
 
-# If the SEARCH_INCLUDES tag is set to YES, the include files in the
-# INCLUDE_PATH will be searched if a #include is found.
-# The default value is: YES.
-# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files 
+# pointed to by INCLUDE_PATH will be searched when a #include is found.
 
 SEARCH_INCLUDES        = YES
 
-# The INCLUDE_PATH tag can be used to specify one or more directories that
-# contain include files that are not input files but should be processed by the
-# preprocessor.
-# This tag requires that the tag SEARCH_INCLUDES is set to YES.
-
-INCLUDE_PATH           =
-
-# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
-# patterns (like *.h and *.hpp) to filter out the header-files in the
-# directories. If left blank, the patterns specified with FILE_PATTERNS will be
-# used.
-# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
-
-INCLUDE_FILE_PATTERNS  =
-
-# The PREDEFINED tag can be used to specify one or more macro names that are
-# defined before the preprocessor is started (similar to the -D option of e.g.
-# gcc). The argument of the tag is a list of macros of the form: name or
-# name=definition (no spaces). If the definition and the "=" are omitted, "=1"
-# is assumed. To prevent a macro definition from being undefined via #undef or
-# recursively expanded use the := operator instead of the = operator.
-# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
-
-PREDEFINED             =
-
-# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
-# tag can be used to specify a list of macro names that should be expanded. The
-# macro definition that is found in the sources will be used. Use the PREDEFINED
-# tag if you want to use a different macro definition that overrules the
-# definition found in the source code.
-# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
-
-EXPAND_AS_DEFINED      =
-
-# If the SKIP_FUNCTION_MACROS tag is set to YES then doxygen's preprocessor will
-# remove all references to function-like macros that are alone on a line, have
-# an all uppercase name, and do not end with a semicolon. Such function macros
-# are typically used for boiler-plate code, and will confuse the parser if not
-# removed.
-# The default value is: YES.
-# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
+# The INCLUDE_PATH tag can be used to specify one or more directories that 
+# contain include files that are not input files but should be processed by 
+# the preprocessor.
+
+INCLUDE_PATH           = 
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard 
+# patterns (like *.h and *.hpp) to filter out the header-files in the 
+# directories. If left blank, the patterns specified with FILE_PATTERNS will 
+# be used.
+
+INCLUDE_FILE_PATTERNS  = 
+
+# The PREDEFINED tag can be used to specify one or more macro names that 
+# are defined before the preprocessor is started (similar to the -D option of 
+# gcc). The argument of the tag is a list of macros of the form: name 
+# or name=definition (no spaces). If the definition and the = are 
+# omitted =1 is assumed. To prevent a macro definition from being 
+# undefined via #undef or recursively expanded use the := operator 
+# instead of the = operator.
+
+PREDEFINED             = 
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then 
+# this tag can be used to specify a list of macro names that should be expanded. 
+# The macro definition that is found in the sources will be used. 
+# Use the PREDEFINED tag if you want to use a different macro definition that 
+# overrules the definition found in the source code.
+
+EXPAND_AS_DEFINED      = 
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then 
+# doxygen's preprocessor will remove all references to function-like macros 
+# that are alone on a line, have an all uppercase name, and do not end with a 
+# semicolon, because these will confuse the parser if not removed.
 
 SKIP_FUNCTION_MACROS   = YES
 
 #---------------------------------------------------------------------------
-# Configuration options related to external references
-#---------------------------------------------------------------------------
-
-# The TAGFILES tag can be used to specify one or more tag files. For each tag
-# file the location of the external documentation should be added. The format of
-# a tag file without this location is as follows:
-# TAGFILES = file1 file2 ...
-# Adding location for the tag files is done as follows:
-# TAGFILES = file1=loc1 "file2 = loc2" ...
-# where loc1 and loc2 can be relative or absolute paths or URLs. See the
-# section "Linking to external documentation" for more information about the use
-# of tag files.
-# Note: Each tag file must have a unique name (where the name does NOT include
-# the path). If a tag file is not located in the directory in which doxygen is
-# run, you must also specify the path to the tagfile here.
-
-TAGFILES               =
-
-# When a file name is specified after GENERATE_TAGFILE, doxygen will create a
-# tag file that is based on the input files it reads. See section "Linking to
-# external documentation" for more information about the usage of tag files.
-
-GENERATE_TAGFILE       =
-
-# If the ALLEXTERNALS tag is set to YES, all external class will be listed in
-# the class index. If set to NO, only the inherited external classes will be
-# listed.
-# The default value is: NO.
+# Configuration::additions related to external references
+#---------------------------------------------------------------------------
+
+# The TAGFILES option can be used to specify one or more tagfiles. 
+# Optionally an initial location of the external documentation 
+# can be added for each tagfile. The format of a tag file without 
+# this location is as follows: 
+#   TAGFILES = file1 file2 ... 
+# Adding location for the tag files is done as follows: 
+#   TAGFILES = file1=loc1 "file2 = loc2" ... 
+# where "loc1" and "loc2" can be relative or absolute paths or 
+# URLs. If a location is present for each tag, the installdox tool 
+# does not have to be run to correct the links. 
+# Note that each tag file must have a unique name 
+# (where the name does NOT include the path) 
+# If a tag file is not located in the directory in which doxygen 
+# is run, you must also specify the path to the tagfile here.
+
+TAGFILES               = 
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create 
+# a tag file that is based on the input files it reads.
+
+GENERATE_TAGFILE       = 
+
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed 
+# in the class index. If set to NO only the inherited external classes 
+# will be listed.
 
 ALLEXTERNALS           = NO
 
-# If the EXTERNAL_GROUPS tag is set to YES, all external groups will be listed
-# in the modules index. If set to NO, only the current project's groups will be
-# listed.
-# The default value is: YES.
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed 
+# in the modules index. If set to NO, only the current project's groups will 
+# be listed.
 
 EXTERNAL_GROUPS        = YES
 
-# If the EXTERNAL_PAGES tag is set to YES, all external pages will be listed in
-# the related pages index. If set to NO, only the current project's pages will
-# be listed.
-# The default value is: YES.
-
-EXTERNAL_PAGES         = YES
-
-# The PERL_PATH should be the absolute path and name of the perl script
-# interpreter (i.e. the result of 'which perl').
-# The default file (with absolute path) is: /usr/bin/perl.
+# The PERL_PATH should be the absolute path and name of the perl script 
+# interpreter (i.e. the result of `which perl').
 
 PERL_PATH              = /usr/bin/perl
@@ -2086,311 +1523,203 @@
 #---------------------------------------------------------------------------
 
-# If the CLASS_DIAGRAMS tag is set to YES, doxygen will generate a class diagram
-# (in HTML and LaTeX) for classes with base or super classes. Setting the tag to
-# NO turns the diagrams off. Note that this option also works with HAVE_DOT
-# disabled, but it is recommended to install and use dot, since it yields more
-# powerful graphs.
-# The default value is: YES.
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will 
+# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base 
+# or super classes. Setting the tag to NO turns the diagrams off. Note that 
+# this option also works with HAVE_DOT disabled, but it is recommended to 
+# install and use dot, since it yields more powerful graphs.
 
 CLASS_DIAGRAMS         = YES
 
-# You can define message sequence charts within doxygen comments using the \msc
-# command. Doxygen will then run the mscgen tool (see:
-# http://www.mcternan.me.uk/mscgen/)) to produce the chart and insert it in the
-# documentation. The MSCGEN_PATH tag allows you to specify the directory where
-# the mscgen tool resides. If left empty the tool is assumed to be found in the
+# You can define message sequence charts within doxygen comments using the \msc 
+# command. Doxygen will then run the mscgen tool (see 
+# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the 
+# documentation. The MSCGEN_PATH tag allows you to specify the directory where 
+# the mscgen tool resides. If left empty the tool is assumed to be found in the 
 # default search path.
 
-MSCGEN_PATH            =
-
-# You can include diagrams made with dia in doxygen documentation. Doxygen will
-# then run dia to produce the diagram and insert it in the documentation. The
-# DIA_PATH tag allows you to specify the directory where the dia binary resides.
-# If left empty dia is assumed to be found in the default search path.
-
-DIA_PATH               =
-
-# If set to YES the inheritance and collaboration graphs will hide inheritance
-# and usage relations if the target is undocumented or is not a class.
-# The default value is: YES.
+MSCGEN_PATH            = 
+
+# If set to YES, the inheritance and collaboration graphs will hide 
+# inheritance and usage relations if the target is undocumented 
+# or is not a class.
 
 HIDE_UNDOC_RELATIONS   = YES
 
-# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
-# available from the path. This tool is part of Graphviz (see:
-# http://www.graphviz.org/), a graph visualization toolkit from AT&T and Lucent
-# Bell Labs. The other options in this section have no effect if this option is
-# set to NO
-# The default value is: NO.
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is 
+# available from the path. This tool is part of Graphviz, a graph visualization 
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section 
+# have no effect if this option is set to NO (the default)
 
 HAVE_DOT               = YES
 
-# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is allowed
-# to run in parallel. When set to 0 doxygen will base this on the number of
-# processors available in the system. You can set it explicitly to a value
-# larger than 0 to get control over the balance between CPU load and processing
-# speed.
-# Minimum value: 0, maximum value: 32, default value: 0.
-# This tag requires that the tag HAVE_DOT is set to YES.
+# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is 
+# allowed to run in parallel. When set to 0 (the default) doxygen will 
+# base this on the number of processors available in the system. You can set it 
+# explicitly to a value larger than 0 to get control over the balance 
+# between CPU load and processing speed.
 
 DOT_NUM_THREADS        = 0
 
-# When you want a differently looking font in the dot files that doxygen
-# generates you can specify the font name using DOT_FONTNAME. You need to make
-# sure dot is able to find the font, which can be done by putting it in a
-# standard location or by setting the DOTFONTPATH environment variable or by
-# setting DOT_FONTPATH to the directory containing the font.
-# The default value is: Helvetica.
-# This tag requires that the tag HAVE_DOT is set to YES.
+# By default doxygen will write a font called Helvetica to the output 
+# directory and reference it in all dot files that doxygen generates. 
+# When you want a differently looking font you can specify the font name 
+# using DOT_FONTNAME. You need to make sure dot is able to find the font, 
+# which can be done by putting it in a standard location or by setting the 
+# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory 
+# containing the font.
 
 DOT_FONTNAME           = Helvetica
 
-# The DOT_FONTSIZE tag can be used to set the size (in points) of the font of
-# dot graphs.
-# Minimum value: 4, maximum value: 24, default value: 10.
-# This tag requires that the tag HAVE_DOT is set to YES.
+# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. 
+# The default size is 10pt.
 
 DOT_FONTSIZE           = 10
 
-# By default doxygen will tell dot to use the default font as specified with
-# DOT_FONTNAME. If you specify a different font using DOT_FONTNAME you can set
-# the path where dot can find it using this tag.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-DOT_FONTPATH           =
-
-# If the CLASS_GRAPH tag is set to YES then doxygen will generate a graph for
-# each documented class showing the direct and indirect inheritance relations.
-# Setting this tag to YES will force the CLASS_DIAGRAMS tag to NO.
-# The default value is: YES.
-# This tag requires that the tag HAVE_DOT is set to YES.
+# By default doxygen will tell dot to use the output directory to look for the 
+# FreeSans.ttf font (which doxygen will put there itself). If you specify a 
+# different font using DOT_FONTNAME you can set the path where dot 
+# can find it using this tag.
+
+DOT_FONTPATH           = 
+
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen 
+# will generate a graph for each documented class showing the direct and 
+# indirect inheritance relations. Setting this tag to YES will force the 
+# the CLASS_DIAGRAMS tag to NO.
 
 CLASS_GRAPH            = YES
 
-# If the COLLABORATION_GRAPH tag is set to YES then doxygen will generate a
-# graph for each documented class showing the direct and indirect implementation
-# dependencies (inheritance, containment, and class references variables) of the
-# class with other documented classes.
-# The default value is: YES.
-# This tag requires that the tag HAVE_DOT is set to YES.
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen 
+# will generate a graph for each documented class showing the direct and 
+# indirect implementation dependencies (inheritance, containment, and 
+# class references variables) of the class with other documented classes.
 
 COLLABORATION_GRAPH    = YES
 
-# If the GROUP_GRAPHS tag is set to YES then doxygen will generate a graph for
-# groups, showing the direct groups dependencies.
-# The default value is: YES.
-# This tag requires that the tag HAVE_DOT is set to YES.
+# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen 
+# will generate a graph for groups, showing the direct groups dependencies
 
 GROUP_GRAPHS           = YES
 
-# If the UML_LOOK tag is set to YES, doxygen will generate inheritance and
-# collaboration diagrams in a style similar to the OMG's Unified Modeling
+# If the UML_LOOK tag is set to YES doxygen will generate inheritance and 
+# collaboration diagrams in a style similar to the OMG's Unified Modeling 
 # Language.
-# The default value is: NO.
-# This tag requires that the tag HAVE_DOT is set to YES.
 
 UML_LOOK               = YES
 
-# If the UML_LOOK tag is enabled, the fields and methods are shown inside the
-# class node. If there are many fields or methods and many nodes the graph may
-# become too big to be useful. The UML_LIMIT_NUM_FIELDS threshold limits the
-# number of items for each type to make the size more manageable. Set this to 0
-# for no limit. Note that the threshold may be exceeded by 50% before the limit
-# is enforced. So when you set the threshold to 10, up to 15 fields may appear,
-# but if the number exceeds 15, the total amount of fields shown is limited to
-# 10.
-# Minimum value: 0, maximum value: 100, default value: 10.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-UML_LIMIT_NUM_FIELDS   = 10
-
-# If the TEMPLATE_RELATIONS tag is set to YES then the inheritance and
-# collaboration graphs will show the relations between templates and their
-# instances.
-# The default value is: NO.
-# This tag requires that the tag HAVE_DOT is set to YES.
+# If set to YES, the inheritance and collaboration graphs will show the 
+# relations between templates and their instances.
 
 TEMPLATE_RELATIONS     = YES
 
-# If the INCLUDE_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are set to
-# YES then doxygen will generate a graph for each documented file showing the
-# direct and indirect include dependencies of the file with other documented
-# files.
-# The default value is: YES.
-# This tag requires that the tag HAVE_DOT is set to YES.
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT 
+# tags are set to YES then doxygen will generate a graph for each documented 
+# file showing the direct and indirect include dependencies of the file with 
+# other documented files.
 
 INCLUDE_GRAPH          = YES
 
-# If the INCLUDED_BY_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are
-# set to YES then doxygen will generate a graph for each documented file showing
-# the direct and indirect include dependencies of the file with other documented
-# files.
-# The default value is: YES.
-# This tag requires that the tag HAVE_DOT is set to YES.
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and 
+# HAVE_DOT tags are set to YES then doxygen will generate a graph for each 
+# documented header file showing the documented files that directly or 
+# indirectly include this file.
 
 INCLUDED_BY_GRAPH      = YES
 
-# If the CALL_GRAPH tag is set to YES then doxygen will generate a call
-# dependency graph for every global function or class method.
-#
-# Note that enabling this option will significantly increase the time of a run.
-# So in most cases it will be better to enable call graphs for selected
-# functions only using the \callgraph command. Disabling a call graph can be
-# accomplished by means of the command \hidecallgraph.
-# The default value is: NO.
-# This tag requires that the tag HAVE_DOT is set to YES.
+# If the CALL_GRAPH and HAVE_DOT options are set to YES then 
+# doxygen will generate a call dependency graph for every global function 
+# or class method. Note that enabling this option will significantly increase 
+# the time of a run. So in most cases it will be better to enable call graphs 
+# for selected functions only using the \callgraph command.
 
 CALL_GRAPH             = YES
 
-# If the CALLER_GRAPH tag is set to YES then doxygen will generate a caller
-# dependency graph for every global function or class method.
-#
-# Note that enabling this option will significantly increase the time of a run.
-# So in most cases it will be better to enable caller graphs for selected
-# functions only using the \callergraph command. Disabling a caller graph can be
-# accomplished by means of the command \hidecallergraph.
-# The default value is: NO.
-# This tag requires that the tag HAVE_DOT is set to YES.
+# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then 
+# doxygen will generate a caller dependency graph for every global function 
+# or class method. Note that enabling this option will significantly increase 
+# the time of a run. So in most cases it will be better to enable caller 
+# graphs for selected functions only using the \callergraph command.
 
 CALLER_GRAPH           = YES
 
-# If the GRAPHICAL_HIERARCHY tag is set to YES then doxygen will graphical
-# hierarchy of all classes instead of a textual one.
-# The default value is: YES.
-# This tag requires that the tag HAVE_DOT is set to YES.
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen 
+# will generate a graphical hierarchy of all classes instead of a textual one.
 
 GRAPHICAL_HIERARCHY    = YES
 
-# If the DIRECTORY_GRAPH tag is set to YES then doxygen will show the
-# dependencies a directory has on other directories in a graphical way. The
-# dependency relations are determined by the #include relations between the
-# files in the directories.
-# The default value is: YES.
-# This tag requires that the tag HAVE_DOT is set to YES.
+# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES 
+# then doxygen will show the dependencies a directory has on other directories 
+# in a graphical way. The dependency relations are determined by the #include 
+# relations between the files in the directories.
 
 DIRECTORY_GRAPH        = YES
 
-# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
-# generated by dot. For an explanation of the image formats see the section
-# output formats in the documentation of the dot tool (Graphviz (see:
-# http://www.graphviz.org/)).
-# Note: If you choose svg you need to set HTML_FILE_EXTENSION to xhtml in order
-# to make the SVG files visible in IE 9+ (other browsers do not have this
-# requirement).
-# Possible values are: png, jpg, gif, svg, png:gd, png:gd:gd, png:cairo,
-# png:cairo:gd, png:cairo:cairo, png:cairo:gdiplus, png:gdiplus and
-# png:gdiplus:gdiplus.
-# The default value is: png.
-# This tag requires that the tag HAVE_DOT is set to YES.
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images 
+# generated by dot. Possible values are svg, png, jpg, or gif. 
+# If left blank png will be used.
 
 DOT_IMAGE_FORMAT       = png
 
-# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to
-# enable generation of interactive SVG images that allow zooming and panning.
-#
-# Note that this requires a modern browser other than Internet Explorer. Tested
-# and working are Firefox, Chrome, Safari, and Opera.
-# Note: For IE 9+ you need to set HTML_FILE_EXTENSION to xhtml in order to make
-# the SVG files visible. Older versions of IE do not have SVG support.
-# The default value is: NO.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-INTERACTIVE_SVG        = NO
-
-# The DOT_PATH tag can be used to specify the path where the dot tool can be
+# The tag DOT_PATH can be used to specify the path where the dot tool can be 
 # found. If left blank, it is assumed the dot tool can be found in the path.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-DOT_PATH               =
-
-# The DOTFILE_DIRS tag can be used to specify one or more directories that
-# contain dot files that are included in the documentation (see the \dotfile
-# command).
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-DOTFILE_DIRS           =
-
-# The MSCFILE_DIRS tag can be used to specify one or more directories that
-# contain msc files that are included in the documentation (see the \mscfile
-# command).
-
-MSCFILE_DIRS           =
-
-# The DIAFILE_DIRS tag can be used to specify one or more directories that
-# contain dia files that are included in the documentation (see the \diafile
-# command).
-
-DIAFILE_DIRS           =
-
-# When using plantuml, the PLANTUML_JAR_PATH tag should be used to specify the
-# path where java can find the plantuml.jar file. If left blank, it is assumed
-# PlantUML is not used or called during a preprocessing step. Doxygen will
-# generate a warning when it encounters a \startuml command in this case and
-# will not generate output for the diagram.
-
-PLANTUML_JAR_PATH      =
-
-# When using plantuml, the specified paths are searched for files specified by
-# the !include statement in a plantuml block.
-
-PLANTUML_INCLUDE_PATH  =
-
-# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of nodes
-# that will be shown in the graph. If the number of nodes in a graph becomes
-# larger than this value, doxygen will truncate the graph, which is visualized
-# by representing a node as a red box. Note that doxygen if the number of direct
-# children of the root node in a graph is already larger than
-# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note that
-# the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
-# Minimum value: 0, maximum value: 10000, default value: 50.
-# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_PATH               = 
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that 
+# contain dot files that are included in the documentation (see the 
+# \dotfile command).
+
+DOTFILE_DIRS           = 
+
+# The MSCFILE_DIRS tag can be used to specify one or more directories that 
+# contain msc files that are included in the documentation (see the 
+# \mscfile command).
+
+MSCFILE_DIRS           = 
+
+# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of 
+# nodes that will be shown in the graph. If the number of nodes in a graph 
+# becomes larger than this value, doxygen will truncate the graph, which is 
+# visualized by representing a node as a red box. Note that doxygen if the 
+# number of direct children of the root node in a graph is already larger than 
+# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note 
+# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
 
 DOT_GRAPH_MAX_NODES    = 50
 
-# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the graphs
-# generated by dot. A depth value of 3 means that only nodes reachable from the
-# root by following a path via at most 3 edges will be shown. Nodes that lay
-# further from the root node will be omitted. Note that setting this option to 1
-# or 2 may greatly reduce the computation time needed for large code bases. Also
-# note that the size of a graph can be further restricted by
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the 
+# graphs generated by dot. A depth value of 3 means that only nodes reachable 
+# from the root by following a path via at most 3 edges will be shown. Nodes 
+# that lay further from the root node will be omitted. Note that setting this 
+# option to 1 or 2 may greatly reduce the computation time needed for large 
+# code bases. Also note that the size of a graph can be further restricted by 
 # DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
-# Minimum value: 0, maximum value: 1000, default value: 0.
-# This tag requires that the tag HAVE_DOT is set to YES.
 
 MAX_DOT_GRAPH_DEPTH    = 0
 
-# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
-# background. This is disabled by default, because dot on Windows does not seem
-# to support this out of the box.
-#
-# Warning: Depending on the platform used, enabling this option may lead to
-# badly anti-aliased labels on the edges of a graph (i.e. they become hard to
-# read).
-# The default value is: NO.
-# This tag requires that the tag HAVE_DOT is set to YES.
+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent 
+# background. This is disabled by default, because dot on Windows does not 
+# seem to support this out of the box. Warning: Depending on the platform used, 
+# enabling this option may lead to badly anti-aliased labels on the edges of 
+# a graph (i.e. they become hard to read).
 
 DOT_TRANSPARENT        = NO
 
-# Set the DOT_MULTI_TARGETS tag to YES to allow dot to generate multiple output
-# files in one run (i.e. multiple -o and -T options on the command line). This
-# makes dot run faster, but since only newer versions of dot (>1.8.10) support
-# this, this feature is disabled by default.
-# The default value is: NO.
-# This tag requires that the tag HAVE_DOT is set to YES.
+# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output 
+# files in one run (i.e. multiple -o and -T options on the command line). This 
+# makes dot run faster, but since only newer versions of dot (>1.8.10) 
+# support this, this feature is disabled by default.
 
 DOT_MULTI_TARGETS      = NO
 
-# If the GENERATE_LEGEND tag is set to YES doxygen will generate a legend page
-# explaining the meaning of the various boxes and arrows in the dot generated
-# graphs.
-# The default value is: YES.
-# This tag requires that the tag HAVE_DOT is set to YES.
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will 
+# generate a legend page explaining the meaning of the various boxes and 
+# arrows in the dot generated graphs.
 
 GENERATE_LEGEND        = YES
 
-# If the DOT_CLEANUP tag is set to YES, doxygen will remove the intermediate dot
-# files that are used to generate the various graphs.
-# The default value is: YES.
-# This tag requires that the tag HAVE_DOT is set to YES.
+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will 
+# remove the intermediate dot files that are used to generate 
+# the various graphs.
 
 DOT_CLEANUP            = YES
Index: /XIOS/trunk/arch/arch-GCC_LINUX.env
===================================================================
--- /XIOS/trunk/arch/arch-GCC_LINUX.env	(revision 1536)
+++ /XIOS/trunk/arch/arch-GCC_LINUX.env	(revision 1537)
@@ -1,4 +1,4 @@
-export HDF5_INC_DIR=$HOME/hdf5/include
-export HDF5_LIB_DIR=$HOME/hdf5/lib
+export HDF5_INC_DIR=$HOME/hdf5/hdf5/include
+export HDF5_LIB_DIR=$HOME/hdf5/hdf5/lib
 
 export NETCDF_INC_DIR=$HOME/netcdf4/include
@@ -7,2 +7,4 @@
 export BOOST_INC_DIR=$HOME/boost
 export BOOST_LIB_DIR=$HOME/boost
+
+
Index: /XIOS/trunk/arch/arch-GCC_LINUX.fcm
===================================================================
--- /XIOS/trunk/arch/arch-GCC_LINUX.fcm	(revision 1536)
+++ /XIOS/trunk/arch/arch-GCC_LINUX.fcm	(revision 1537)
@@ -12,5 +12,5 @@
 %DEBUG_CFLAGS   -g 
 
-%BASE_FFLAGS    -D__NONE__ 
+%BASE_FFLAGS    -D__NONE__ -ffree-line-length-none 
 %PROD_FFLAGS    -O3
 %DEV_FFLAGS     -g -O2
Index: /XIOS/trunk/arch/arch-X64_ADA.env
===================================================================
--- /XIOS/trunk/arch/arch-X64_ADA.env	(revision 1536)
+++ /XIOS/trunk/arch/arch-X64_ADA.env	(revision 1537)
@@ -1,11 +1,4 @@
-module unload compilerwrappers
 module unload netcdf
 module unload hdf5
-
-module load netcdf/mpi/4.1.3
+#module load netcdf/mpi/4.1.3
 #module load hdf5/mpi/1.8.9
-
-export NETCDF_INC_DIR=/smplocal/pub/NetCDF/4.1.3/mpi/include
-export NETCDF_LIB_DIR=/smplocal/pub/NetCDF/4.1.3/mpi/lib
-export HDF5_INC_DIR=/smplocal/pub/HDF5/1.8.9/par/include
-export HDF5_LIB_DIR=/smplocal/pub/HDF5/1.8.9/par/lib
Index: /XIOS/trunk/arch/arch-X64_ADA.fcm
===================================================================
--- /XIOS/trunk/arch/arch-X64_ADA.fcm	(revision 1536)
+++ /XIOS/trunk/arch/arch-X64_ADA.fcm	(revision 1537)
@@ -10,13 +10,13 @@
 %PROD_CFLAGS    -O3 -D BOOST_DISABLE_ASSERTS
 %DEV_CFLAGS     -g -traceback
-%DEBUG_CFLAGS   -DBZ_DEBUG -g  -fno-inline
+%DEBUG_CFLAGS   -DBZ_DEBUG -g -traceback -fno-inline
 
 %BASE_FFLAGS    -D__NONE__ 
 %PROD_FFLAGS    -O3
 %DEV_FFLAGS     -g -O2 -traceback
-%DEBUG_FFLAGS   -g 
+%DEBUG_FFLAGS   -g -traceback
 
 %BASE_INC       -D__NONE__
-%BASE_LD        -lstdc++ 
+%BASE_LD        -lstdc++ -Wl,-rpath=/smplocal/pub/NetCDF/4.1.3/mpi/lib:/smplocal/pub/HDF5/1.8.9/par/lib
 
 %CPP            mpiicc -EP
Index: /XIOS/trunk/arch/arch-X64_ADA.path
===================================================================
--- /XIOS/trunk/arch/arch-X64_ADA.path	(revision 1536)
+++ /XIOS/trunk/arch/arch-X64_ADA.path	(revision 1537)
@@ -1,5 +1,5 @@
-NETCDF_INCDIR="-I $NETCDF_INC_DIR"
-#NETCDF_LIBDIR="-L $NETCDF_LIB_DIR"
-#NETCDF_LIB="-lnetcdff -lnetcdf"
+NETCDF_INCDIR="-I/smplocal/pub/NetCDF/4.1.3/mpi/include"
+NETCDF_LIBDIR="-L/smplocal/pub/NetCDF/4.1.3/mpi/lib"
+NETCDF_LIB="-lnetcdff -lnetcdf"
 
 MPI_INCDIR=""
@@ -7,7 +7,7 @@
 MPI_LIB=""
 
-#HDF5_INCDIR="-I $HDF5_INC_DIR"
-#HDF5_LIBDIR="-L $HDF5_LIB_DIR"
-#HDF5_LIB="-lhdf5_hl -lhdf5 -lhdf5 -lz"
+HDF5_INCDIR="-I/smplocal/pub/HDF5/1.8.9/par/include"
+HDF5_LIBDIR="-L/smplocal/pub/HDF5/1.8.9/par/lib"
+HDF5_LIB="-lhdf5_hl -lhdf5 -lhdf5 -lz"
 
 OASIS_INCDIR="-I$PWD/../../oasis3-mct/BLD/build/lib/psmile.MPI1"
Index: /XIOS/trunk/arch/arch-X64_CURIE.fcm
===================================================================
--- /XIOS/trunk/arch/arch-X64_CURIE.fcm	(revision 1536)
+++ /XIOS/trunk/arch/arch-X64_CURIE.fcm	(revision 1537)
@@ -10,11 +10,11 @@
 %PROD_CFLAGS    -O3 -D BOOST_DISABLE_ASSERTS
 #%DEV_CFLAGS     -g -traceback
-%DEV_CFLAGS     -g
+%DEV_CFLAGS     -g 
 %DEBUG_CFLAGS   -DBZ_DEBUG -g -traceback -fno-inline
 
 %BASE_FFLAGS    -D__NONE__ 
 %PROD_FFLAGS    -O3
-#%DEV_FFLAGS     -g -O2 -traceback
-%DEV_FFLAGS     -g -O2 
+#%DEV_FFLAGS     -g -traceback
+%DEV_FFLAGS     -g 
 %DEBUG_FFLAGS   -g -traceback
 
Index: /XIOS/trunk/arch/arch-ifort_CICLAD.path
===================================================================
--- /XIOS/trunk/arch/arch-ifort_CICLAD.path	(revision 1536)
+++ /XIOS/trunk/arch/arch-ifort_CICLAD.path	(revision 1537)
@@ -1,8 +1,5 @@
 NETCDF_INCDIR="-I /opt/netcdf42/ifort/include"
 NETCDF_LIBDIR="-L/opt/netcdf42/ifort/lib"
-NETCDF_LIB="-lnetcdf -lnetcdff"
-MPI_INCDIR=""
-MPI_LIBDIR=""
-MPI_LIB=""
+NETCDF_LIB="-lnetcdf"
 HDF5_INCDIR=""
 HDF5_LIBDIR=""
Index: /XIOS/trunk/arch/arch-ifort_LSCE.path
===================================================================
--- /XIOS/trunk/arch/arch-ifort_LSCE.path	(revision 1536)
+++ /XIOS/trunk/arch/arch-ifort_LSCE.path	(revision 1537)
@@ -2,7 +2,4 @@
 NETCDF_LIBDIR="-L/usr/local/install/netcdf-4.3.2p/lib"
 NETCDF_LIB="-lnetcdf -lnetcdff"
-MPI_INCDIR=""
-MPI_LIBDIR=""
-MPI_LIB=""
 HDF5_INCDIR="-I /usr/local/install/hdf5-1.8.9p/include"
 HDF5_LIBDIR="-L/usr/local/install/hdf5-1.8.9p/lib"
Index: /XIOS/trunk/bld.cfg
===================================================================
--- /XIOS/trunk/bld.cfg	(revision 1536)
+++ /XIOS/trunk/bld.cfg	(revision 1537)
@@ -8,6 +8,6 @@
 # ------------------------------------------------------------------------------
 
-inc arch.fcm
-inc config.fcm
+# Specifying the build directory and src::blitz if necessary.
+inc bld_dir.cfg
 
 %CFLAGS           %BASE_CFLAGS %COMPIL_CFLAGS
@@ -15,16 +15,28 @@
 %LD_FLAGS         %ARCH_LD %BASE_LD
 
-
-dest::root   $PWD
-
 bld::infile_ext::cpp   C::SOURCE
 bld::infile_ext::conf  CPP::INCLUDE
 bld::infile_ext::hpp   CPP::INCLUDE
 
+# IMPORTANT: as the build directory may not necessarily coincide with the source directory, 
+# 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
 
-search_src           true
-src::zzz .
-#src::date $PWD/extern/boost/src/date_time
-src::blitz $PWD/extern/blitz/src
 src::netcdf $PWD/extern/netcdf4
 src::remap $PWD/extern/remap/src
@@ -32,13 +44,14 @@
 bld::target libxios.a 
 #bld::target generate_fortran_interface.exe 
+#bld::target test_remap.exe
 bld::target xios_server.exe 
-bld::target test_remap.exe
 #bld::target test_regular.exe
-#bld::target test_expand_domain.exe
+#bld::target test_xios2_cmip6.exe
 #bld::target test_new_features.exe test_unstruct_complete.exe 
-bld::target test_client.exe 
-bld::target test_complete.exe test_xios2_cmip6.exe
-#bld::target test_connectivity_expand.exe
-#bld::target toy_cmip6.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
 bld::exe_dep
 
@@ -59,6 +72,6 @@
 # Pre-process code before analysing dependencies
 bld::pp    false          
-bld::pp::interface/fortran              true
-bld::pp::interface/fortran_attr         true
+bld::pp::xios::interface::fortran              true
+bld::pp::xios::interface::fortran_attr         true
 bld::excl_dep        use::mod_prism_get_comm
 bld::excl_dep        use::mod_prism_get_localcomm_proto
Index: /XIOS/trunk/doc/XIOS_reference_guide.lyx
===================================================================
--- /XIOS/trunk/doc/XIOS_reference_guide.lyx	(revision 1536)
+++ /XIOS/trunk/doc/XIOS_reference_guide.lyx	(revision 1537)
@@ -1,8 +1,6 @@
-#LyX 2.2 created this file. For more info see http://www.lyx.org/
-\lyxformat 508
+#LyX 2.1 created this file. For more info see http://www.lyx.org/
+\lyxformat 474
 \begin_document
 \begin_header
-\save_transient_properties true
-\origin unavailable
 \textclass book
 \use_default_options true
@@ -15,14 +13,14 @@
 \inputencoding auto
 \fontencoding global
-\font_roman "default" "default"
-\font_sans "default" "default"
-\font_typewriter "default" "default"
-\font_math "auto" "auto"
+\font_roman default
+\font_sans default
+\font_typewriter default
+\font_math auto
 \font_default_family default
 \use_non_tex_fonts false
 \font_sc false
 \font_osf false
-\font_sf_scale 100 100
-\font_tt_scale 100 100
+\font_sf_scale 100
+\font_tt_scale 100
 \graphics default
 \default_output_format default
@@ -83,13 +81,4 @@
 \end_layout
 
-\begin_layout Standard
-\begin_inset CommandInset toc
-LatexCommand tableofcontents
-
-\end_inset
-
-
-\end_layout
-
 \begin_layout Chapter
 Attribute reference
@@ -284,5 +273,5 @@
 \begin_layout Standard
 Define the time origin of the time axis.
- It will appear as meta-data attached to the time axis in the output file.
+ It will appear as metadata attached to the time axis in the output file.
  This attribute is optional, the default value is 
 \begin_inset Flex Emph
@@ -897,188 +886,4 @@
 
 \begin_layout Section
-Scalar attribute reference
-\end_layout
-
-\begin_layout Subsection*
-name: 
-\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
-Define the name of the scalar, as it will appear in a file.
- If not defined, a name is self generated from the id.
- If multiple scalars are defined in a same file, each name must be different.
- 
-\end_layout
-
-\begin_layout Subsection*
-standard_name: 
-\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
-Define the standard name of the scalar, as it will appear in the meta-data
- attached to the scalar of the output file.
- 
-\end_layout
-
-\begin_layout Subsection*
-long_name: 
-\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
-Define the long name of the scalar, as it will appear in the meta-data attached
- to the scalar of the output file.
- 
-\end_layout
-
-\begin_layout Subsection*
-unit: 
-\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
-Define the unit of the scalar as it will appear in the meta-data attached
- to the scalar in the output file.
-\end_layout
-
-\begin_layout Subsection*
-value: 
-\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
-Define the value of a scalar.
- 
-\end_layout
-
-\begin_layout Subsection*
-scalar_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 scalar.
- All attributes are inherited from the referenced scalar with the classical
- inheritance mechanism.
- The value assigned to the referenced axis is transmitted to to current
- scalar.
- This attribute is optional.
-\end_layout
-
-\begin_layout Subsection*
-prec: 
-\emph on
-integer
-\end_layout
-
-\begin_layout Standard
-Fortran:
-\end_layout
-
-\begin_layout LyX-Code
-INTEGER :: prec
-\end_layout
-
-\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
- double precision).
-\end_layout
-
-\begin_layout Section
 Axis attribute reference
 \end_layout
@@ -1138,5 +943,5 @@
 \begin_layout Standard
 Define the standard name of the vertical axis, as it will appear in the
- meta-data attached to the axis of the output file.
+ metadata attached to the axis of the output file.
  
 \end_layout
@@ -1165,5 +970,5 @@
 
 \begin_layout Standard
-Define the long name of the vertical axis, as it will appear in the meta-data
+Define the long name of the vertical axis, as it will appear in the metadata
  attached to the axis of the output file.
  
@@ -1193,6 +998,6 @@
 
 \begin_layout Standard
-Define the unit of the axis as it will appear in the meta-data attached
- to the axis in the output file.
+Define the unit of the axis as it will appear in the metadata attached to
+ the axis in the output file.
 \end_layout
 
@@ -1718,5 +1523,5 @@
 
 \begin_layout Standard
-Define the standard name of the domain, as it will appear in the meta-data
+Define the standard name of the domain, as it will appear in the metadata
  attached to the domain of the output file.
  
@@ -1746,5 +1551,5 @@
 
 \begin_layout Standard
-Define the long name of the domain, as it will appear in the meta-data attached
+Define the long name of the domain, as it will appear in the metadata attached
  to the domain of the output file.
  
@@ -1855,5 +1660,5 @@
 
 \begin_layout Standard
-Define the beginning index of the first dimension of the local domain.
+Define the begining index of the first dimension of the local domain.
  This attribute is optional.
  This must be an integer between 
@@ -2084,5 +1889,5 @@
 \begin_layout Standard
 Define the value of the longitude on the local domain.
- For a Cartesian grid, the size of the array will be 
+ For a cartesian grid, the size of the array will be 
 \begin_inset Flex Strong
 status collapsed
@@ -2129,5 +1934,5 @@
 \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 
+ For a cartesian and curvilinear grid, the size of the array will be 
 \begin_inset Flex Strong
 status collapsed
@@ -2164,5 +1969,5 @@
 \begin_layout Standard
 Define the value of the latitude on the local domain.
- For a Cartesian grid, the size of the array will be nj.
+ For a cartesian grid, the size of the array will be nj.
  For a curvilinear grid, the size of the array will be 
 \begin_inset Flex Strong
@@ -2199,5 +2004,5 @@
 \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 
+ For a cartesian and a curvilinear grid, the size of the array will be 
 \begin_inset Flex Strong
 status collapsed
@@ -3130,5 +2935,5 @@
 \end_inset
 
- attribute as it will appear in the meta-data of an output file.
+ attribute as it will appear in the metadata of an output file.
  This attribute is optional.
 \end_layout
@@ -3159,5 +2964,5 @@
 \end_inset
 
- attribute as it will appear in the meta-data of an output file.
+ attribute as it will appear in the metadata of an output file.
  This attribute is optional.
 \end_layout
@@ -3437,36 +3242,4 @@
 
 \begin_layout Subsection*
-check_if_active: 
-\emph on
-bool
-\end_layout
-
-\begin_layout Standard
-Fortran:
-\end_layout
-
-\begin_layout LyX-Code
-LOGICAL :: check_if_active
-\end_layout
-
-\begin_layout Standard
-Define whether XIOS will automatically check if the field is active at current
- timestep when sending data from the model.
- Enabling this behavior can sometimes improve the performances by avoiding
- unneeded data processing.
- This attribute is optional, the default value is 
-\begin_inset Flex Strong
-status collapsed
-
-\begin_layout Plain Layout
-false
-\end_layout
-
-\end_inset
-
-.
-\end_layout
-
-\begin_layout Subsection*
 field_ref: 
 \emph on
@@ -3687,5 +3460,5 @@
 
 \begin_layout LyX-Code
-LOGICAL:: detect_missing_value
+LOGICAL: detect_missing_value
 \end_layout
 
@@ -3706,5 +3479,5 @@
 
 \begin_layout LyX-Code
-DOUBLE PRECISION :: add_offset
+DOUBLE PRECISION: add_offset
 \end_layout
 
@@ -3720,5 +3493,5 @@
 \end_inset
 
- meta-data CF attribute in the output file.
+ metadata CF attribute in the output file.
  In output, the 
 \begin_inset Flex Strong
@@ -3745,5 +3518,5 @@
 
 \begin_layout LyX-Code
-DOUBLE PRECISION :: scale_factor
+DOUBLE PRECISION: scale_factor
 \end_layout
 
@@ -3759,5 +3532,5 @@
 \end_inset
 
- meta-data CF attribute in the output file.
+ metadata CF attribute in the output file.
  In output, the field values are divided by the 
 \begin_inset Flex Strong
@@ -4432,6 +4205,6 @@
 \series default
 \emph default
- only if the NetCDF4 library was compiled with Parallel NetCDF support (âenable-
-pnetcdf).
+ only if the NetCDF4 library was compiled with Parallel NetCDF support (--enable
+-pnetcdf).
 \end_layout
 
@@ -4740,11 +4513,470 @@
 \end_layout
 
-\begin_layout Standard
-\begin_inset CommandInset include
-LatexCommand include
-filename "inputs/reference/Transformations.lyx"
-
-\end_inset
-
+\begin_layout Section
+Transformation attribute reference
+\end_layout
+
+\begin_layout Subsection
+interpolate_axis
+\end_layout
+
+\begin_layout Subsection*
+type: 
+\emph on
+string
+\end_layout
+
+\begin_layout Standard
+Fortran:
+\end_layout
+
+\begin_layout LyX-Code
+CHARACTER(LEN=*) :: type
+\end_layout
+
+\begin_layout Standard
+Define the type of interpolation on an axis.
+ This attribute is optional.
+\end_layout
+
+\begin_layout Subsection*
+order: 
+\emph on
+integer
+\end_layout
+
+\begin_layout Standard
+Fortran: 
+\end_layout
+
+\begin_layout LyX-Code
+INTEGER :: order
+\end_layout
+
+\begin_layout Standard
+Define a order of interpolation.
+ This attribute is optional.
+ The default value is 2.
+\end_layout
+
+\begin_layout Subsection
+inverse_axis
+\end_layout
+
+\begin_layout Subsection
+zoom_axis
+\end_layout
+
+\begin_layout Subsection*
+begin: 
+\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 :: begin
+\end_layout
+
+\begin_layout Standard
+Define the begining index of the 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
+0
+\end_layout
+
+\end_inset
+
+ and 
+\begin_inset Flex Strong
+status collapsed
+
+\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
+
+\end_inset
+
+ 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
+interpolate_domain
+\end_layout
+
+\begin_layout Subsection*
+file: 
+\emph on
+string
+\end_layout
+
+\begin_layout Standard
+Fortran:
+\end_layout
+
+\begin_layout LyX-Code
+CHARACTER(LEN=*) :: type
+\end_layout
+
+\begin_layout Standard
+Define the file which contains the weight value to interpolate 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: 
+\emph on
+integer
+\end_layout
+
+\begin_layout Standard
+Fortran: 
+\end_layout
+
+\begin_layout LyX-Code
+INTEGER :: order
+\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.
+\end_layout
+
+\begin_layout Subsection
+zoom_domain
+\end_layout
+
+\begin_layout Subsection*
+ibegin: 
+\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 :: ibegin
+\end_layout
+
+\begin_layout Standard
+Define the begining index of the zoomed region on the first dimension of
+ the global domain.
+ This attribute is optional.
+ This must be an integer between 
+\begin_inset Flex Strong
+status collapsed
+
+\begin_layout Plain Layout
+0
+\end_layout
+
+\end_inset
+
+ and 
+\begin_inset Flex Strong
+status collapsed
+
+\begin_layout Plain Layout
+ni_glo-1
+\end_layout
+
+\end_inset
+
+ of the associated dimension of domain.
+ 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*
+ni: 
+\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 :: ni
+\end_layout
+
+\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
+status collapsed
+
+\begin_layout Plain Layout
+1
+\end_layout
+
+\end_inset
+
+and 
+\begin_inset Flex Strong
+status collapsed
+
+\begin_layout Plain Layout
+ni_glo
+\end_layout
+
+\end_inset
+
+ of the associated dimension of domain.
+ If not specified the default value is 
+\begin_inset Flex Strong
+status collapsed
+
+\begin_layout Plain Layout
+ni_glo
+\end_layout
+
+\end_inset
+
+ of the dimension of domain.
+\end_layout
+
+\begin_layout Subsection*
+jbegin: 
+\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 :: jbegin
+\end_layout
+
+\begin_layout Standard
+Define the begining index of the zoomed region on the second dimension of
+ the global domain.
+ This attribute is optional.
+ This must be an integer between 
+\begin_inset Flex Strong
+status collapsed
+
+\begin_layout Plain Layout
+0
+\end_layout
+
+\end_inset
+
+ and 
+\begin_inset Flex Strong
+status collapsed
+
+\begin_layout Plain Layout
+nj_glo-1
+\end_layout
+
+\end_inset
+
+ of the associated dimension of domain.
+ 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*
+nj: 
+\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 :: nj
+\end_layout
+
+\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 
+\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
+
+\end_inset
+
+ of the associated dimension of domain.
+ 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 dimension of domain.
+\end_layout
+
+\begin_layout Subsection
+generate_rectilinear_domain
+\end_layout
+
+\begin_layout Standard
 
 \end_layout
@@ -4895,8 +5127,4 @@
 \begin_layout Itemize
 If OASIS coupler is not used (using_oasis=false)
-\begin_inset Separator latexpar
-\end_inset
-
-
 \end_layout
 
@@ -5037,8 +5265,4 @@
 
 )
-\begin_inset Separator latexpar
-\end_inset
-
-
 \end_layout
 
@@ -5056,8 +5280,4 @@
 
 ) 
-\begin_inset Separator latexpar
-\end_inset
-
-
 \end_layout
 
@@ -5170,8 +5390,4 @@
 
 )
-\begin_inset Separator latexpar
-\end_inset
-
-
 \end_layout
 
@@ -7305,9 +7521,9 @@
 
 \begin_layout Subsection*
-Arithmetic operations on duration
-\end_layout
-
-\begin_layout Standard
-The following arithmetic operations on duration are available:
+Arithmetic operations on durations
+\end_layout
+
+\begin_layout Standard
+The following arithmetic operations on durations are available:
 \end_layout
 
@@ -7379,9 +7595,9 @@
 
 \begin_layout Subsection*
-Comparison operations on duration
-\end_layout
-
-\begin_layout Standard
-The following comparison operations on duration are available:
+Comparison operations on durations
+\end_layout
+
+\begin_layout Standard
+The following comparison operations on durations are available:
 \end_layout
 
Index: /XIOS/trunk/doc/XIOS_user_guide.lyx
===================================================================
--- /XIOS/trunk/doc/XIOS_user_guide.lyx	(revision 1536)
+++ /XIOS/trunk/doc/XIOS_user_guide.lyx	(revision 1537)
@@ -1,8 +1,6 @@
-#LyX 2.2 created this file. For more info see http://www.lyx.org/
-\lyxformat 508
+#LyX 2.1 created this file. For more info see http://www.lyx.org/
+\lyxformat 474
 \begin_document
 \begin_header
-\save_transient_properties true
-\origin unavailable
 \textclass book
 \begin_preamble
@@ -18,14 +16,14 @@
 \inputencoding auto
 \fontencoding global
-\font_roman "default" "default"
-\font_sans "default" "default"
-\font_typewriter "default" "default"
-\font_math "auto" "auto"
+\font_roman default
+\font_sans default
+\font_typewriter default
+\font_math auto
 \font_default_family default
 \use_non_tex_fonts false
 \font_sc false
 \font_osf false
-\font_sf_scale 100 100
-\font_tt_scale 100 100
+\font_sf_scale 100
+\font_tt_scale 100
 \graphics default
 \default_output_format default
@@ -82,11 +80,6 @@
 \end_layout
 
-\begin_layout Standard
-\begin_inset CommandInset toc
-LatexCommand tableofcontents
-
-\end_inset
-
-
+\begin_layout Author
+Draft
 \end_layout
 
@@ -188,5 +181,5 @@
 \begin_layout Plain Layout
 
-! Context initialization omitted, see the corresponding section of this
+! Context initialization ommited, see the corresponding section of this
  user manual and of the reference manual
 \end_layout
@@ -293,5 +286,5 @@
 \begin_layout Plain Layout
 
-! Context initialization omitted, see the corresponding section of this
+! Context initialization ommited, see the corresponding section of this
  user manual and of the reference manual
 \end_layout
@@ -476,5 +469,5 @@
 \begin_layout Plain Layout
 
-! Context initialization omitted, see the corresponding section of this
+! Context initialization ommited, see the corresponding section of this
  user manual and of the reference manual
 \end_layout
@@ -524,5 +517,5 @@
 \begin_layout Plain Layout
 
-! Context initialization omitted, see the corresponding section of this
+! Context initialization ommited, see the corresponding section of this
  user manual and of the reference manual
 \end_layout
@@ -788,5 +781,5 @@
 \begin_layout Plain Layout
 
-! Context initialization omitted, see the corresponding section of this
+! Context initialization ommited, see the corresponding section of this
  user manual and of the reference manual
 \end_layout
@@ -1199,8 +1192,4 @@
 \begin_layout Itemize
 converting dates to
-\begin_inset Separator latexpar
-\end_inset
-
-
 \end_layout
 
@@ -1330,5 +1319,5 @@
 \begin_layout Plain Layout
 
-        		<!-- Content of the file omitted for now -->
+        		<!-- Content of the file ommited for now -->
 \end_layout
 
@@ -1428,5 +1417,5 @@
 \begin_layout Plain Layout
 
-! Context and calendar initializations omitted, see the corresponding section
+! Context and calendar initializations ommited, see the corresponding section
  of this user manual and of the reference manual
 \end_layout
@@ -1778,5 +1767,5 @@
 
 \begin_layout Plain Layout
--\SpecialChar nobreakdash
+-\SpecialChar \nobreakdash-
 -enable-netcdf4
 \end_layout
@@ -1821,5 +1810,5 @@
 
 \begin_layout Plain Layout
--\SpecialChar nobreakdash
+-\SpecialChar \nobreakdash-
 -enable-parallel
 \end_layout
@@ -1864,5 +1853,5 @@
 
 \begin_layout Plain Layout
--\SpecialChar nobreakdash
+-\SpecialChar \nobreakdash-
 -enable-pnetcdf
 \end_layout
@@ -1871,4 +1860,197 @@
 
  and that the Parallel NetCDF library has been properly linked.
+\end_layout
+
+\begin_layout Section
+UGRID
+\end_layout
+
+\begin_layout Standard
+In addition to the CF conventions, it is also possible to output data using
+ 
+\begin_inset CommandInset href
+LatexCommand href
+name "UGRID"
+target "https://ugrid-conventions.github.io/ugrid-conventions/"
+
+\end_inset
+
+ metadata conventions developed for unstructured meshes.
+ It allows users to store the topology of an underlying unstructured mesh.
+ Currently XIOS supports 2D unstructured meshes of any shape (triangular,
+ quadrilateral, etc) and their mixture.
+ 
+\end_layout
+
+\begin_layout Standard
+A 2D mesh can be described by a set of nodes, edges and/or faces.
+ XIOS allows one to define data on any of these three types of elements.
+ XIOS will generate a full list of connectivity attributes proposed by the
+ UGRID conventions.
+ For example in case of a mesh comprised of faces the following connectivity
+ parameters will be the calculated:
+\end_layout
+
+\begin_layout Standard
+
+\family typewriter
+edge_node_connectivity
+\end_layout
+
+\begin_layout Standard
+
+\family typewriter
+face_node_connectivity 
+\end_layout
+
+\begin_layout Standard
+
+\family typewriter
+edge_nodes_connectivity 
+\end_layout
+
+\begin_layout Standard
+
+\family typewriter
+face_nodes_connectivity
+\end_layout
+
+\begin_layout Standard
+
+\family typewriter
+face_edges_connectivity
+\end_layout
+
+\begin_layout Standard
+
+\family typewriter
+edge_face_connectivity
+\end_layout
+
+\begin_layout Standard
+
+\family typewriter
+face_face_connectivity
+\end_layout
+
+\begin_layout Standard
+In order to select UGRID output format, one has to set file attribute 
+\series bold
+convention
+\series default
+ to 
+\series bold
+\shape italic
+"UGRID"
+\series default
+\shape default
+ (its default value is 
+\series bold
+\shape italic
+
+\begin_inset Quotes eld
+\end_inset
+
+CF
+\begin_inset Quotes erd
+\end_inset
+
+
+\series default
+\shape default
+).
+ Domain attribute 
+\series bold
+nvertex
+\series default
+ is mandatory for UGRID.
+ It servers for identifying one of three types of mesh elements on which
+ data can be defined: nodes (nvertex=1), edges (nvertex=2), and faces (nvertex
+\begin_inset Formula $\geq$
+\end_inset
+
+3).
+ In order to write fields on the same mesh but on its different elements,
+ one has to assign the same domain name to each of the domains.
+ Example given below illustrates this point for three fields defined on
+ the same mesh but on its different elements: nodes, edges, and faces.
+\end_layout
+
+\begin_layout Standard
+\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
+
+<file_definition> 
+\end_layout
+
+\begin_layout Plain Layout
+
+	<file id="output_UGRID" convention="UGRID"> 
+\end_layout
+
+\begin_layout Plain Layout
+
+		<field id="varOnNodes" ...
+ domain_ref="node"/> 
+\end_layout
+
+\begin_layout Plain Layout
+
+		<field id="varOnEdges" ...
+ domain_ref="edge"/>
+\end_layout
+
+\begin_layout Plain Layout
+
+		<field id="varOnFaces" ...
+ domain_ref="face"/> 
+\end_layout
+
+\begin_layout Plain Layout
+
+	</file>
+\end_layout
+
+\begin_layout Plain Layout
+
+</file_definition> 
+\end_layout
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\begin_layout Plain Layout
+
+<domain_definition> 
+\end_layout
+
+\begin_layout Plain Layout
+
+	<domain id="node" name="mesh2D" nvertex="1"/>
+\end_layout
+
+\begin_layout Plain Layout
+
+	<domain id="edge" name="mesh2D" nvertex="2"/> 
+\end_layout
+
+\begin_layout Plain Layout
+
+	<domain id="face" name="mesh2D" nvertex="4"/> 
+\end_layout
+
+\begin_layout Plain Layout
+
+</domain_definition> 
+\end_layout
+
+\end_inset
+
+
 \end_layout
 
@@ -1953,5 +2135,5 @@
 \begin_layout Plain Layout
 
-        		<!-- Content of the file omitted for now -->
+        		<!-- Content of the file ommited for now -->
 \end_layout
 
@@ -2195,5 +2377,5 @@
 \begin_layout Plain Layout
 
-			<grid id="grid_A"><!-- Definition omitted --></grid>
+			<grid id="grid_A"><!-- Definition ommited --></grid>
 \end_layout
 
@@ -2457,5 +2639,5 @@
 \begin_layout Plain Layout
 
-! Context, calendar and grid initializations omitted, see the corresponding
+! Context, calendar and grid initializations ommited, see the corresponding
  section of this user manual and of the reference manual
 \end_layout
@@ -2736,5 +2918,5 @@
 \begin_layout Plain Layout
 
-			<grid id="grid_A"><!-- Definition omitted --></grid>
+			<grid id="grid_A"><!-- Definition ommited --></grid>
 \end_layout
 
@@ -3199,5 +3381,5 @@
 \begin_layout Plain Layout
 
-			<grid id="grid_A"><!-- Definition omitted --></grid>
+			<grid id="grid_A"><!-- Definition ommited --></grid>
 \end_layout
 
@@ -3309,5 +3491,5 @@
 \begin_layout Plain Layout
 
-			<grid id="grid_A"><!-- Definition omitted --></grid>
+			<grid id="grid_A"><!-- Definition ommited --></grid>
 \end_layout
 
@@ -3460,5 +3642,5 @@
 \begin_layout Plain Layout
 
-			<grid id="grid_A"><!-- Definition omitted --></grid>
+			<grid id="grid_A"><!-- Definition ommited --></grid>
 \end_layout
 
@@ -3609,5 +3791,5 @@
 \begin_layout Plain Layout
 
-			<grid id="grid_A"><!-- Definition omitted --></grid>
+			<grid id="grid_A"><!-- Definition ommited --></grid>
 \end_layout
 
@@ -3801,5 +3983,5 @@
 \begin_layout Plain Layout
 
-			<grid id="grid_A"><!-- Definition omitted --></grid>
+			<grid id="grid_A"><!-- Definition ommited --></grid>
 \end_layout
 
@@ -3942,5 +4124,5 @@
 \begin_layout Plain Layout
 
-			<grid id="grid_A"><!-- Definition omitted --></grid>
+			<grid id="grid_A"><!-- Definition ommited --></grid>
 \end_layout
 
@@ -4082,5 +4264,5 @@
 \begin_layout Plain Layout
 
-			<grid id="grid_A"><!-- Definition omitted --></grid>
+			<grid id="grid_A"><!-- Definition ommited --></grid>
 \end_layout
 
@@ -4278,5 +4460,5 @@
 \begin_layout Plain Layout
 
-			<grid id="grid_A"><!-- Definition omitted --></grid>
+			<grid id="grid_A"><!-- Definition ommited --></grid>
 \end_layout
 
@@ -4457,5 +4639,5 @@
 \begin_layout Plain Layout
 
-			<grid id="grid_A"><!-- Definition omitted --></grid>
+			<grid id="grid_A"><!-- Definition ommited --></grid>
 \end_layout
 
@@ -4564,470 +4746,4 @@
 , the requested data will never be available and a deadlock could occur.
  In practice, XIOS will detect the problem and throw an error.
-\end_layout
-
-\begin_layout Section
-How to check whether a field is active or not
-\end_layout
-
-\begin_layout Standard
-Since XIOS allows modifying the output and input files at runtime, it is
- sometimes useful to be able to dynamically query whether a field is active
- or not from the model (for example to avoid computing a field that would
- not be used anyway for the current run).
-\begin_inset Newline newline
-\end_inset
-
-
-\begin_inset Newline newline
-\end_inset
-
-This can be done using the 
-\begin_inset Flex Code
-status open
-
-\begin_layout Plain Layout
-xios_field_is_active
-\end_layout
-
-\end_inset
-
- function.
- The following code sample shows how this function could be used in a model:
-\end_layout
-
-\begin_layout Standard
-\begin_inset listings
-lstparams "language=Fortran,breaklines=true,tabsize=2,frame=tb,postbreak={\raisebox{0ex}[0ex][0ex]{\ensuremath{\rcurvearrowse\space}}}"
-inline false
-status open
-
-\begin_layout Plain Layout
-
-IF (xios_field_is_active("field_A")) THEN
-\end_layout
-
-\begin_layout Plain Layout
-
-	! Computation of field_A
-\end_layout
-
-\begin_layout Plain Layout
-
-	! ...
-\end_layout
-
-\begin_layout Plain Layout
-
-\end_layout
-
-\begin_layout Plain Layout
-
-	CALL xios_send_field("field_A", field_A)
-\end_layout
-
-\begin_layout Plain Layout
-
-ENDIF
-\end_layout
-
-\end_inset
-
-Note that this function takes into account the possible data dependencies
- that can exist between fields.
- That is, a field will be considered active if it used to compute another
- active field even if it is not directly used in any files.
-\begin_inset Newline newline
-\end_inset
-
-
-\begin_inset Newline newline
-\end_inset
-
-The 
-\begin_inset Flex Code
-status open
-
-\begin_layout Plain Layout
-xios_field_is_active
-\end_layout
-
-\end_inset
-
- function accepts an optional boolean argument 
-\begin_inset Flex Code
-status open
-
-\begin_layout Plain Layout
-at_current_timestep
-\end_layout
-
-\end_inset
-
- which defaults to 
-\series bold
-false
-\series default
- if omitted.
- Setting it to 
-\series bold
-true
-\series default
- allows checking if an input field is active at the current timestep, taking
- into account the data sampling and temporal operations.
-\begin_inset Newline newline
-\end_inset
-
-
-\begin_inset Newline newline
-\end_inset
-
-Considering the following configuration file:
-\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 omitted --></grid>
-\end_layout
-
-\begin_layout Plain Layout
-
-		</grid_definition>
-\end_layout
-
-\begin_layout Plain Layout
-
-\end_layout
-
-\begin_layout Plain Layout
-
-		<field_definition>
-\end_layout
-
-\begin_layout Plain Layout
-
-        	<field id="field_A" grid_ref="grid_A" operation="instant" />
-\end_layout
-
-\begin_layout Plain Layout
-
-        	<field id="field_B" grid_ref="grid_A" operation="instant" />
-\end_layout
-
-\begin_layout Plain Layout
-
-        	<field id="field_C" grid_ref="grid_A" operation="instant">field_A
- + field_B</field>
-\end_layout
-
-\begin_layout Plain Layout
-
-		</field_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="10ts">
-\end_layout
-
-\begin_layout Plain Layout
-
-        		<field field_ref="field_C" />
-\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
-
-With this configuration file, calling 
-\begin_inset Flex Code
-status open
-
-\begin_layout Plain Layout
-xios_field_is_active(
-\begin_inset Quotes eld
-\end_inset
-
-field_A
-\begin_inset Quotes erd
-\end_inset
-
-)
-\end_layout
-
-\end_inset
-
- or
-\begin_inset Newline newline
-\end_inset
-
-
-\begin_inset Flex Code
-status open
-
-\begin_layout Plain Layout
-xios_field_is_active(
-\begin_inset Quotes eld
-\end_inset
-
-field_B
-\begin_inset Quotes erd
-\end_inset
-
-)
-\end_layout
-
-\end_inset
-
- always returns 
-\series bold
-true
-\series default
- because 
-\begin_inset Quotes eld
-\end_inset
-
-field_A
-\begin_inset Quotes erd
-\end_inset
-
- and 
-\begin_inset Quotes eld
-\end_inset
-
-field_B
-\begin_inset Quotes erd
-\end_inset
-
- are needed to compute 
-\begin_inset Quotes eld
-\end_inset
-
-field_C
-\begin_inset Quotes erd
-\end_inset
-
- which is outputted.
- Since 
-\begin_inset Quotes eld
-\end_inset
-
-field_C
-\begin_inset Quotes erd
-\end_inset
-
- is outputted every 10 timesteps, setting the 
-\begin_inset Flex Code
-status open
-
-\begin_layout Plain Layout
-at_current_timestep
-\end_layout
-
-\end_inset
-
- argument to 
-\series bold
-true
-\series default
- would make a difference.
- Calling 
-\begin_inset Flex Code
-status open
-
-\begin_layout Plain Layout
-xios_field_is_active(
-\begin_inset Quotes eld
-\end_inset
-
-field_A
-\begin_inset Quotes erd
-\end_inset
-
-, .true.)
-\end_layout
-
-\end_inset
-
- would return 
-\series bold
-true
-\series default
- only every 10 timesteps as there is no need to provide 
-\begin_inset Quotes eld
-\end_inset
-
-field_A
-\begin_inset Quotes erd
-\end_inset
-
- (respectively 
-\begin_inset Quotes eld
-\end_inset
-
-field_B
-\begin_inset Quotes erd
-\end_inset
-
-) at timesteps for which 
-\begin_inset Quotes eld
-\end_inset
-
-field_C
-\begin_inset Quotes erd
-\end_inset
-
- is not written to file.
-\begin_inset Newline newline
-\end_inset
-
-
-\begin_inset Newline newline
-\end_inset
-
-Additionally, it possible to set the field attribute 
-\series bold
-check_if_active
-\series default
- to 
-\begin_inset Quotes eld
-\end_inset
-
-
-\series bold
-\emph on
-true
-\series default
-\emph default
-
-\begin_inset Quotes erd
-\end_inset
-
- so that XIOS internally check if a field is active before sending any data.
- For example, defining the following field:
-\end_layout
-
-\begin_layout Standard
-\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
-
-<field_definition>
-\end_layout
-
-\begin_layout Plain Layout
-
-	<field id="field_A" grid_ref="grid_A" operation="instant" check_if_active
-\series bold
-="true"
-\series default
- />
-\end_layout
-
-\begin_layout Plain Layout
-
-</field_definition>
-\end_layout
-
-\end_inset
-
-has the same effect as if all calls to 
-\begin_inset Flex Code
-status open
-
-\begin_layout Plain Layout
-xios_send_field("field_A", field_A)
-\end_layout
-
-\end_inset
-
- were replaced by:
-\end_layout
-
-\begin_layout Standard
-\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
-
-IF (xios_field_is_active("field_A"), .true.) THEN
-\end_layout
-
-\begin_layout Plain Layout
-
-	CALL xios_send_field("field_A", field_A)
-\end_layout
-
-\begin_layout Plain Layout
-
-ENDIF
-\end_layout
-
-\end_inset
-
-
 \end_layout
 
@@ -5051,6 +4767,14 @@
  Since it depends directly on HDF5, this feature works only when the NetCDF-4
  format is used.
- Unfortunately, HDF5 does not support compression (yet) for parallel output
- so you have to use only one server or to engage the 
+ Since HDF5 does not (yet) support compression for parallel output, one
+ has to use two server-level functionality (see Sec.
+ 
+\begin_inset CommandInset ref
+LatexCommand ref
+reference "sec:Launching-secondary-server"
+
+\end_inset
+
+) or to engage the 
 \series bold
 \emph on
@@ -5127,5 +4851,5 @@
 \begin_layout Plain Layout
 
-			<grid id="grid_A"><!-- Definition omitted --></grid>
+			<grid id="grid_A"><!-- Definition ommited --></grid>
 \end_layout
 
@@ -5276,26 +5000,6 @@
 \end_layout
 
-\begin_layout Standard
-\begin_inset CommandInset include
-LatexCommand include
-filename "inputs/user/Scalar.lyx"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Standard
-\begin_inset CommandInset include
-LatexCommand include
-filename "inputs/user/Transformations.lyx"
-
-\end_inset
-
-
-\end_layout
-
 \begin_layout Chapter
-XIOS options
+XIOS parameterization
 \end_layout
 
@@ -5342,5 +5046,5 @@
 \begin_layout Plain Layout
 
-	<!-- Actual context(s) used by the simulation omitted -->
+	<!-- Actual context(s) used by the simulation ommited -->
 \end_layout
 
@@ -5382,4 +5086,237 @@
 
 
+\end_layout
+
+\begin_layout Section
+Launching secondary server
+\begin_inset CommandInset label
+LatexCommand label
+name "sec:Launching-secondary-server"
+
+\end_inset
+
+
+\end_layout
+
+\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.
+ 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:
+\end_layout
+
+\begin_layout Itemize
+
+\series bold
+using_server2
+\series default
+ (type: 
+\series bold
+bool
+\series default
+) activates the secondary server
+\end_layout
+
+\begin_layout Itemize
+
+\series bold
+ratio_server2
+\series default
+ (type: 
+\series bold
+int
+\series default
+) defines the percentage of servers that will be dedicated to level two.
+ The parameter can take value from 0 to 100 with the default value of 50%.
+ In case if the requested number of level-two servers is not valid (for
+ example, zero or equal to the total number of servers), XIOS will run in
+ its classical server mode with one server level.
+\end_layout
+
+\begin_layout Itemize
+
+\series bold
+number_pools_server2 
+\series default
+(type: 
+\series bold
+int
+\series default
+) sets the number of server-two pools (i.e.
+ MPI communicators on level two).
+ By default the number of pools is equal to the number of level-two servers,
+ thus permitting one process per communicator.
+\end_layout
+
+\begin_layout Standard
+Shown in Fig.
+ 
+\begin_inset CommandInset ref
+LatexCommand ref
+reference "Fig:server2"
+
+\end_inset
+
+ is the two-level server structure for the following definitions:
+\end_layout
+
+\begin_layout Standard
+\begin_inset listings
+lstparams "breaklines=true,frame=tb,language=XML,postbreak={\raisebox{0ex}[0ex][0ex]{\ensuremath{\rcurvearrowse\space}}},tabsize=2"
+inline false
+status open
+
+\begin_layout Plain Layout
+
+<context id="xios">     
+\end_layout
+
+\begin_layout Plain Layout
+
+...
+       
+\end_layout
+
+\begin_layout Plain Layout
+
+	<variable id="using_server2" type="bool">true</variable>
+\end_layout
+
+\begin_layout Plain Layout
+
+	<variable id="ratio_server2" type="int">75</variable>         
+\end_layout
+
+\begin_layout Plain Layout
+
+	<variable id="number_pools_server2" type="int">3</variable>         
+\end_layout
+
+\begin_layout Plain Layout
+
+...
+\end_layout
+
+\begin_layout Plain Layout
+
+</context> 
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Float figure
+placement H
+wide false
+sideways false
+status open
+
+\begin_layout Plain Layout
+\begin_inset Graphics
+	filename inputs/images/Server2.pdf
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Plain Layout
+\begin_inset Caption Standard
+
+\begin_layout Plain Layout
+Two levels of servers for the total number of servers of 8 and ratio_server2=75%.
+ The number of level-two servers is 
+\begin_inset Formula $8\times\text{ratio\_server2}=6$
+\end_inset
+
+ and, thus, the remaining 2 servers are of level one.
+ 
+\end_layout
+
+\end_inset
+
+
+\begin_inset CommandInset label
+LatexCommand label
+name "Fig:server2"
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\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
+ memory consumption by level-two servers.
+ For this, two additional parameters should be specified:
+\end_layout
+
+\begin_layout Itemize
+
+\series bold
+server2_dist_file_memory
+\series default
+ (type: 
+\series bold
+bool
+\series default
+) activates memory optimization.
+\end_layout
+
+\begin_layout Itemize
+
+\series bold
+server2_dist_file_memory_ratio
+\series default
+ (type: 
+\series bold
+double
+\series default
+) (optional) takes value from 0 (memory optimization) to 1 (bandwidth optimizati
+on).
+ The default value is 0.5.
 \end_layout
 
@@ -5465,5 +5402,5 @@
  mode, XIOS will ensure that all active fields can be buffered without having
  to flush the buffers.
- This mode is used by default since it allows more asynchronous and thus
+ This mode is used by default since it allows more asynchronism and thus
  better performance at the cost of being quite memory hungry.
 \end_layout
@@ -5501,5 +5438,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/trunk/doc/inputs/user/Axis.lyx
===================================================================
--- /XIOS/trunk/doc/inputs/user/Axis.lyx	(revision 1536)
+++ /XIOS/trunk/doc/inputs/user/Axis.lyx	(revision 1537)
@@ -1,8 +1,6 @@
-#LyX 2.2 created this file. For more info see http://www.lyx.org/
-\lyxformat 508
+#LyX 2.1 created this file. For more info see http://www.lyx.org/
+\lyxformat 474
 \begin_document
 \begin_header
-\save_transient_properties true
-\origin unavailable
 \textclass book
 \use_default_options true
@@ -13,14 +11,14 @@
 \inputencoding auto
 \fontencoding global
-\font_roman "default" "default"
-\font_sans "default" "default"
-\font_typewriter "default" "default"
-\font_math "auto" "auto"
+\font_roman default
+\font_sans default
+\font_typewriter default
+\font_math auto
 \font_default_family default
 \use_non_tex_fonts false
 \font_sc false
 \font_osf false
-\font_sf_scale 100 100
-\font_tt_scale 100 100
+\font_sf_scale 100
+\font_tt_scale 100
 \graphics default
 \default_output_format default
@@ -211,5 +209,5 @@
  The axis with implicit id can only be used inside the scope where it is
  defined, it can not be referenced, nor be processed.
- It is useless to define an axis without id inside axis_definition.
+ It is rare to define an axis without id inside axis_definition.
  
 \end_layout
@@ -269,14 +267,183 @@
 
 \begin_layout Standard
-Like domain, transformation which can be defined inside an axis.
+Like domain, there are several transformation which can be defined with
+ configuration file.
  All transformations on an axis have form *_axis.
- See Chapter 
-\begin_inset CommandInset ref
-LatexCommand ref
-reference "chap:Transformation"
-
-\end_inset
-
- for more details.
+ 
+\end_layout
+
+\begin_layout Standard
+Till now, XIOS supports the following transformation on axis:
+\end_layout
+
+\begin_layout Itemize
+zoom_axis: Like zoom functionality in XIOS 1.0, the destination grid is the
+ zoomed region of the source grid.
+\end_layout
+
+\begin_layout Itemize
+interpolation_axis: Implement interpolation from an axis to one another.
+ For now, only polynominal interpolation is available.
+\end_layout
+
+\begin_layout Itemize
+inverse_axis: Inverse an axis
+\end_layout
+
+\begin_layout Standard
+It is not difficult to define a transformation: Include type of transformation
+ inside axis definition, as the following
+\end_layout
+
+\begin_layout Standard
+\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
+
+<axis_definition>
+\end_layout
+
+\begin_layout Plain Layout
+
+  <axis id="axis_A" />
+\end_layout
+
+\begin_layout Plain Layout
+
+  <axis id="axis_A_zoom" axis_ref="axis_A"> 
+\end_layout
+
+\begin_layout Plain Layout
+
+   <zoom_axis zoom_begin="1" zoom_n="3"/>
+\end_layout
+
+\begin_layout Plain Layout
+
+  </axis>
+\end_layout
+
+\begin_layout Plain Layout
+
+</axis_definition>
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+The concrete example is translated as: the axis named axis_A_zoom is transformed
+ from axis name axis_A with a zoom activity.
+ The detailed attributes of zoom_axis can be found in reference document,
+ but simply it contains the begining and size of zoomed region.
+\end_layout
+
+\begin_layout Standard
+One remark is the transformed axis SHOULD have an id, in this case, it's
+ axis_A_zoom.
+ As mentioned before, a no-id axis or any no-id component of XIOS can only
+ be used inside its definition scope.
+\end_layout
+
+\begin_layout Standard
+To make use of transformation, the grid must contain axis which references
+ to transformed ones.
+ 
+\end_layout
+
+\begin_layout Standard
+\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
+
+<grid id="grid_A">          
+\end_layout
+
+\begin_layout Plain Layout
+
+  <axis axis_ref="axis_A" />
+\end_layout
+
+\begin_layout Plain Layout
+
+</grid>
+\end_layout
+
+\begin_layout Plain Layout
+
+<grid id="grid_A_zoom">          
+\end_layout
+
+\begin_layout Plain Layout
+
+  <axis axis_ref="axis_A_zoom" />
+\end_layout
+
+\begin_layout Plain Layout
+
+</grid>
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+On defining this way, we tell XIOS to establish a connection between two
+ grids by a transformation (zoom) with: grid source - grid_A, grid destination
+ - grid_A_zoom.
+\end_layout
+
+\begin_layout Standard
+As mentioned in Grid Chapter, in order to use transformed grid, just reference
+ to it in field_definition
+\end_layout
+
+\begin_layout Standard
+\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
+
+<field_definition level="1" enabled=".TRUE." default_value="9.96921e+36">
+\end_layout
+
+\begin_layout Plain Layout
+
+  <field id="field_A"  operation="average" freq_op="3600s" grid_ref="grid_A"
+ />
+\end_layout
+
+\begin_layout Plain Layout
+
+  <field id="field_A_zoom"  operation="average" freq_op="3600s" grid_ref="grid_A
+_zoom" />
+\end_layout
+
+\begin_layout Plain Layout
+
+ </field_definition>
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+Although xml is helpful to define several configurations, it can not be
+ used to customize attributes of axis.
+ So it's the turn of Fortran interface.
 \end_layout
 
@@ -286,5 +453,5 @@
 
 \begin_layout Standard
-Although axis is not as complex as domain, there are some mandatory attributes
+Although axis is not as complexe as domain, there are some mandatory attributes
  to define.
  Different from precedent version, XIOS 2.0 supports distribution of data
@@ -403,5 +570,5 @@
 
 \begin_layout Standard
-Specify the beginning and size of data on the local axis:
+Specify the begining and size of data on the local axis:
 \end_layout
 
@@ -423,5 +590,5 @@
 
 \begin_layout Standard
-Although the valid data must be inside a local axis, it is not necessary
+Although the valid data must be inside a local axis, it is not neccessary
  for data to have same size.
  In fact, data can have larger size than local axis.
@@ -456,5 +623,5 @@
 
 \begin_layout Standard
-Local data can be defined with:
+Loal data can be defined with:
 \end_layout
 
Index: /XIOS/trunk/doc/inputs/user/Domain.lyx
===================================================================
--- /XIOS/trunk/doc/inputs/user/Domain.lyx	(revision 1536)
+++ /XIOS/trunk/doc/inputs/user/Domain.lyx	(revision 1537)
@@ -1,8 +1,6 @@
-#LyX 2.2 created this file. For more info see http://www.lyx.org/
-\lyxformat 508
+#LyX 2.1 created this file. For more info see http://www.lyx.org/
+\lyxformat 474
 \begin_document
 \begin_header
-\save_transient_properties true
-\origin unavailable
 \textclass book
 \use_default_options true
@@ -13,14 +11,14 @@
 \inputencoding auto
 \fontencoding global
-\font_roman "default" "default"
-\font_sans "default" "default"
-\font_typewriter "default" "default"
-\font_math "auto" "auto"
+\font_roman default
+\font_sans default
+\font_typewriter default
+\font_math auto
 \font_default_family default
 \use_non_tex_fonts false
 \font_sc false
 \font_osf false
-\font_sf_scale 100 100
-\font_tt_scale 100 100
+\font_sf_scale 100
+\font_tt_scale 100
 \graphics default
 \default_output_format default
@@ -145,5 +143,6 @@
 \color inherit
  among this kind of components.
- Domains defined by a same Id always represent only one domain.
+ It is not allowed to have two domains with a same id, but it is permitted
+ a domain and a grid, for example, to share a same one.
 \end_layout
 
@@ -182,7 +181,5 @@
 \begin_layout Standard
 Very often, after a domain is defined, it may be referenced many times.
- To make a reference to a domain, we use 
-\shape italic
-domain_ref
+ To make a reference to a domain, we use domain_ref
 \end_layout
 
@@ -219,7 +216,7 @@
  The domain with implicit id can only be used inside the scope where it
  is defined, it can not be referenced, nor be processed.
- It is useless to define a domain without id inside domain_definition.
- Meanwhile, the domain_ref is utilized widely outside the scope of domain_defini
-tion.
+ It is rare to define a domain without id inside domain_definition.
+ However, the domain_ref is utilized widely outside the scope of domain_definiti
+on.
 \end_layout
 
@@ -233,5 +230,5 @@
 \series default
 \color inherit
-However, it is the only region where we can define a new domain outside
+Moreover it is the only region where we can define a new domain outside
  domain_definition.
 \end_layout
@@ -289,15 +286,201 @@
 
 \begin_layout Standard
-One of a new concept which differentiates XIOS 2.0 from its precedent is
- (spatial) transformation, which can be defined inside a domain.
- All transformations on a domain have form *_domain.
- See Chapter 
-\begin_inset CommandInset ref
-LatexCommand ref
-reference "chap:Transformation"
-
-\end_inset
-
- for more details.
+One of a new concept which differenciates XIOS 2.0 from its precedent is
+ transformation.
+ In a simple case, zoom feature is now considered to be a transformation.
+ It can be more complicated for other geometric transformation such as inversion
+ or interpolation.
+ All transformation are taken place on grid level.
+ It means that it is neccessary to define a grid source and a grid destination
+ as well as a transformation or list of transformation which we'd like to
+ have.
+ In order to transform a grid to one another, we need to specify a transformatio
+n on its sub-component: domain or axis.
+\end_layout
+
+\begin_layout Standard
+Because transformation on a domain is different from one on an axis, we
+ differenciate two categories of transformation: transformation_domain and
+ transformation_axis.
+\end_layout
+
+\begin_layout Standard
+Till now, XIOS supports the following transformation on domain:
+\end_layout
+
+\begin_layout Itemize
+zoom_domain: Like zoom functionality in XIOS 1.0, the destination grid is
+ the zoomed region of the source grid.
+\end_layout
+
+\begin_layout Itemize
+interpolation_domain: Implement interpolation from a domain to one another,
+ for now XIOS can only do interpolation by reading calculated weight values
+ from a file or calculate the weights on the fly.
+\end_layout
+
+\begin_layout Itemize
+generate_rectilinear_domain: auto generating, distributing a rectilinear
+ domain then filling all mandatory attributes.
+\end_layout
+
+\begin_layout Standard
+It is not difficult to define a transformation: Include type of transformation
+ inside domain definition, as the following
+\end_layout
+
+\begin_layout Standard
+\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
+
+<domain_definition>
+\end_layout
+
+\begin_layout Plain Layout
+
+  <domain id="domain_A" />
+\end_layout
+
+\begin_layout Plain Layout
+
+  <domain id="domain_A_zoom" domain_ref="domain_A"> 
+\end_layout
+
+\begin_layout Plain Layout
+
+   <zoom_domain zoom_ibegin="1" zoom_ni="3" zoom_jbegin="0" zoom_nj="2"/>
+\end_layout
+
+\begin_layout Plain Layout
+
+  </domain>
+\end_layout
+
+\begin_layout Plain Layout
+
+</domain_definition>
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+The concrete example above tells many things: a domain named domain_A_zoom
+ is transformed from domain name domain_A with a zoom activity.
+ The domain_A_zoom is the zoomed region of domain_A.
+ The detailed attributes of zoom_domain can be found in reference document,
+ but simply it contains the begining and size of zoomed region.
+\end_layout
+
+\begin_layout Standard
+One remark is the transformed domain SHOULD have an id, in this case, it's
+ domain_A_zoom.
+ As mentioned before, a no-id domain or any no-id component of XIOS can
+ only be used inside its definition scope.
+ It exists but is useless.
+ So care about that.
+\end_layout
+
+\begin_layout Standard
+To make use of transformation, the grid must contain domains which reference
+ to transformed ones.
+ 
+\end_layout
+
+\begin_layout Standard
+\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
+
+<grid id="grid_A">          
+\end_layout
+
+\begin_layout Plain Layout
+
+   <domain domain_ref="domain_A" />
+\end_layout
+
+\begin_layout Plain Layout
+
+ </grid>
+\end_layout
+
+\begin_layout Plain Layout
+
+<grid id="grid_A_zoom">          
+\end_layout
+
+\begin_layout Plain Layout
+
+   <domain domain_ref="domain_A_zoom" />
+\end_layout
+
+\begin_layout Plain Layout
+
+ </grid>
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+On defining this way, we tell XIOS to establish a connection between two
+ grids by a transformation (zoom) with: grid source - grid_A, grid destination
+ - grid_A_zoom.
+\end_layout
+
+\begin_layout Standard
+As mentioned in Grid Chapter, in order to use transformed grid, just reference
+ to it in field_definition
+\end_layout
+
+\begin_layout Standard
+\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
+
+<field_definition level="1" enabled=".TRUE." default_value="9.96921e+36">
+\end_layout
+
+\begin_layout Plain Layout
+
+  <field id="field_A"  operation="average" freq_op="3600s" grid_ref="grid_A"
+ />
+\end_layout
+
+\begin_layout Plain Layout
+
+  <field id="field_A_zoom"  operation="average" freq_op="3600s" grid_ref="grid_A
+_zoom" />
+\end_layout
+
+\begin_layout Plain Layout
+
+ </field_definition>
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+Although xml is helpful to define several configurations, it is not convenient
+ to customize attributes of domain.
+ So it's the turn of Fortran interface.
 \end_layout
 
@@ -343,5 +526,5 @@
 rectilinear: a simple 2-dimensional Cartesian coordinates with two perpendicular
  axes.
- Latitude represents the y-axis while longitude represents the x-axe.
+ Latitude represents the y-axe while longitude represents the x-axe.
 \end_layout
 
@@ -354,6 +537,6 @@
 
 \begin_layout Itemize
-unstructured: not any of two above, the latitude and longitude, as curvilinear,
- are represented with the help of boundaries.
+unstructured: not any of two above, the latitutude and longitude, as curvilinear
+, are reprensented with the help of boundaries.
  
 \end_layout
@@ -381,5 +564,5 @@
 
 \begin_layout Standard
-Although there are different domain types, they share the similar patterns
+Althoug there are different domain types, they share the similar patterns
  to settle local data on a client process: There are some essential attributes
  to define.
@@ -395,5 +578,5 @@
 It is not uncommon that a global domain is broken into several pieces, each
  of which is distributed to one process.
- Following, we consider a simple case: a domain of rectilinear type with
+ Following we consider a simple case: a domain of rectilinear type with
  global size 9 x 9 and its data is distributed evenly among 9 client processes,
  each of which has 3x3.
@@ -451,4 +634,9 @@
 
 \begin_layout Itemize
+ni_glo, nj_glo: global size of x-axis and y-axis correspondingly.
+ 
+\end_layout
+
+\begin_layout Itemize
 ibegin, jbegin: global position on x-axis and y-axis where a local domain
  begin
@@ -459,9 +647,4 @@
 \end_layout
 
-\begin_layout Itemize
-ni_glo, nj_glo: global size of x-axis and y-axis correspondingly.
- 
-\end_layout
-
 \begin_layout Standard
 Or tell XIOS exactly the global position of each point in the local domain,
@@ -534,10 +717,10 @@
 
 \begin_layout Standard
-Specify the beginning and size of data on the local domain:
+Specify the begining and size of data on the local domain:
 \end_layout
 
 \begin_layout Itemize
 data_ibegin, data_jbegin: the local position of data on x-axis and y-axis
- where data begins inside the local domain
+ where data begins
 \end_layout
 
@@ -589,5 +772,5 @@
 
 \begin_layout Standard
-In order to be processed correctly, data must be specified with the beginning
+In order to be processed correctly, data must be specified with the begining
  and size of its block .
  For two-dimensional data, it can be done with data_ibegin, data_ni for
@@ -595,5 +778,5 @@
  In case of one-dimensional data, it is only necessary to determine data_ibegin
  and data_ni.
- Although the valid data must be inside a local domain, it is not necessary
+ Although the valid data must be inside a local domain, it is not neccessary
  for data to have same size as local domain.
  In fact, data can have larger size than domain on each dimension, this
@@ -674,5 +857,5 @@
 
 \begin_layout Standard
-With the second way, data can be represented with:
+With the secon way, data can be represented with:
 \end_layout
 
@@ -708,5 +891,5 @@
 \begin_layout Standard
 As mentioned, data on a domain are two-dimensional but in some cases, there
- is a need to write data continuously, there comes one-dimensional data.
+ is a need to write data continously, there comes one-dimensional data.
  With the precedent example, we can define one dimensional data with:
 \end_layout
@@ -738,7 +921,7 @@
 \begin_layout Standard
 Above are the mandatory attributes to define local domain.
- There are some auxiliary attributes which make data meaningful, especially
+ There are some auxilliary attributes which make data meaningful, especially
  for meteorological one.
- The next section discuses these attributes.
+ The next section disscuses these attributes.
 \end_layout
 
@@ -748,5 +931,5 @@
 
 \begin_layout Standard
-Different from the previous version, in XIOS 2.0, longitude and latitude
+Different from the previous version, in XIOS 2.0, lonngitude and latitude
  are optional.
  Moreover, to be coherent to the data_dim concept, there are more ways to
@@ -842,6 +1025,6 @@
 \begin_layout Standard
 For unstructured mesh, a cell can have different number of vertices than
- rectilinear, in this case, longitude and latitude value of the vertex of
- cell are specified with bounds_lon_1d and bounds_lat_1d.
+ rectinlinear, in this case, longitude and latitude value of the vertex
+ of cell are specified with bounds_lon_1d and bounds_lat_1d.
 \end_layout
 
@@ -855,5 +1038,5 @@
 \begin_layout Standard
 One thing to remind, only *_1d or *_2d attributes are used, if *_1d and
- *_2d of a same attribute are provides, there will be run-time error.
+ *_2d of a same attribute are provides, there will be runtime error.
 \end_layout
 
Index: /XIOS/trunk/doc/inputs/user/Grid.lyx
===================================================================
--- /XIOS/trunk/doc/inputs/user/Grid.lyx	(revision 1536)
+++ /XIOS/trunk/doc/inputs/user/Grid.lyx	(revision 1537)
@@ -1,8 +1,6 @@
-#LyX 2.2 created this file. For more info see http://www.lyx.org/
-\lyxformat 508
+#LyX 2.1 created this file. For more info see http://www.lyx.org/
+\lyxformat 474
 \begin_document
 \begin_header
-\save_transient_properties true
-\origin unavailable
 \textclass book
 \use_default_options true
@@ -13,14 +11,14 @@
 \inputencoding auto
 \fontencoding global
-\font_roman "default" "default"
-\font_sans "default" "default"
-\font_typewriter "default" "default"
-\font_math "auto" "auto"
+\font_roman default
+\font_sans default
+\font_typewriter default
+\font_math auto
 \font_default_family default
 \use_non_tex_fonts false
 \font_sc false
 \font_osf false
-\font_sf_scale 100 100
-\font_tt_scale 100 100
+\font_sf_scale 100
+\font_tt_scale 100
 \graphics default
 \default_output_format default
@@ -238,5 +236,7 @@
 \color inherit
  among this kind of components.
- If several grids use same Id, they all represent only one grid.
+ It is not allowed to have two grids with a same id, but it is permitted
+ a grid and, for example, a domain to share a same one.
+ 
 \end_layout
 
@@ -415,5 +415,5 @@
  is often used as time step axis.
  In order to write only time step to netCDF, XIOS provides a special way
- to do: scalar grid - a grid composed of a scalar
+ to do: empty grid - a grid without any domain or axis.
 \end_layout
 
@@ -426,10 +426,5 @@
 \begin_layout Plain Layout
 
-<grid id="grid_TimeStep"> 
-\end_layout
-
-\begin_layout Plain Layout
-
-  <scalar id="scalar" />
+ <grid id="grid_TimeStep"> 
 \end_layout
 
Index: OS/trunk/doc/inputs/user/Scalar.lyx
===================================================================
--- /XIOS/trunk/doc/inputs/user/Scalar.lyx	(revision 1536)
+++ 	(revision )
@@ -1,271 +1,0 @@
-#LyX 2.2 created this file. For more info see http://www.lyx.org/
-\lyxformat 508
-\begin_document
-\begin_header
-\save_transient_properties true
-\origin unavailable
-\textclass book
-\use_default_options true
-\master ../../XIOS_user_guide.lyx
-\maintain_unincluded_children false
-\language english
-\language_package default
-\inputencoding auto
-\fontencoding global
-\font_roman "default" "default"
-\font_sans "default" "default"
-\font_typewriter "default" "default"
-\font_math "auto" "auto"
-\font_default_family default
-\use_non_tex_fonts false
-\font_sc false
-\font_osf false
-\font_sf_scale 100 100
-\font_tt_scale 100 100
-\graphics default
-\default_output_format default
-\output_sync 0
-\bibtex_command default
-\index_command default
-\float_placement !tph
-\paperfontsize default
-\spacing single
-\use_hyperref false
-\papersize a4paper
-\use_geometry false
-\use_package amsmath 1
-\use_package amssymb 1
-\use_package cancel 1
-\use_package esint 1
-\use_package mathdots 1
-\use_package mathtools 1
-\use_package mhchem 1
-\use_package stackrel 1
-\use_package stmaryrd 1
-\use_package undertilde 1
-\cite_engine basic
-\cite_engine_type default
-\biblio_style plain
-\use_bibtopic false
-\use_indices false
-\paperorientation portrait
-\suppress_date false
-\justification true
-\use_refstyle 1
-\index Index
-\shortcut idx
-\color #008000
-\end_index
-\secnumdepth 3
-\tocdepth 3
-\paragraph_separation indent
-\paragraph_indentation default
-\quotes_language english
-\papercolumns 1
-\papersides 1
-\paperpagestyle default
-\tracking_changes false
-\output_changes false
-\html_math_output 0
-\html_css_as_file 0
-\html_be_strict false
-\end_header
-
-\begin_body
-
-\begin_layout Chapter
-Scalar
-\end_layout
-
-\begin_layout Standard
-Scalar, as its name, representing zero-dimension data, is a new element
- in XIOS 2.0
-\end_layout
-
-\begin_layout Section
-Working with configuration file
-\end_layout
-
-\begin_layout Standard
-Scalar can be easily defined in the configuration file and in most case,
- that should be enough.
-\end_layout
-
-\begin_layout Standard
-Scalar is defined inside its definition part with the tag 
-\series bold
-\color black
-scalar_definition
-\series default
-\color inherit
-.
- 
-\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
-
-<scalar_definition>
-\end_layout
-
-\begin_layout Plain Layout
-
-  <scalar id="scalar_A" />
-\end_layout
-
-\begin_layout Plain Layout
-
-  <axis scalar_ref="scalar_A" />
-\end_layout
-
-\begin_layout Plain Layout
-
-</scalar_definition>
-\end_layout
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Standard
-The first one is to specify explicitly identification of a scalar with an
- id.
- 
-\end_layout
-
-\begin_layout Standard
-\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
-
-<scalar_definition>
-\end_layout
-
-\begin_layout Plain Layout
-
-  <scalar id="scalar_A" />  
-\end_layout
-
-\begin_layout Plain Layout
-
-</scalar_definition>
-\end_layout
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Standard
-In this way, with the id, the scalar can be processed, e.x modified its attribute
-s, with Fortran interface; besides, it is only possible to reference to
- a scalar whose id is explicitly defined.
-\end_layout
-
-\begin_layout Standard
-To make a reference to a scalar, we use 
-\shape italic
-scalar_ref
-\end_layout
-
-\begin_layout Standard
-\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
-
-<scalar_definition>
-\end_layout
-
-\begin_layout Plain Layout
-
-  <scalar scalar_ref="scalar_A" />
-\end_layout
-
-\begin_layout Plain Layout
-
-</scalar_definition>
-\end_layout
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Standard
-A scalar defined by scalar_ref will inherit all attributes of the referenced
- one, except its id attribute.
- If there is no id specified, an implicit one is assigned to this new scalar.
- The scalar with implicit id can only be used inside the scope where it
- is defined, it can not be referenced, nor be processed.
- It is useless to define an scalar without id inside scalar_definition.
- 
-\end_layout
-
-\begin_layout Standard
-To define a new scalar inside a grid, we use the tag 
-\series bold
-\color black
-scalar.
-\end_layout
-
-\begin_layout Standard
-\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
-
-<grid id="grid_A">          
-\end_layout
-
-\begin_layout Plain Layout
-
-   <scalar scalar_ref="scalar_A" />
-\end_layout
-
-\begin_layout Plain Layout
-
-</grid>
-\end_layout
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Standard
-The xml lines above can be translated as: the grid_A composed of an scalar_A
- that is defined somewhere else before.
- More precisely, the grid grid_A is constituted of an 
-\begin_inset Quotes eld
-\end_inset
-
-unknown id
-\begin_inset Quotes erd
-\end_inset
-
- scalar which has inherited all attributes (and their values) from scalar_A
- (name, ...
- etc).
-\end_layout
-
-\begin_layout Section
-Working with FORTRAN code
-\end_layout
-
-\begin_layout Standard
-All attributes of scalar can be found in Reference Guide.
-\end_layout
-
-\end_body
-\end_document
Index: OS/trunk/doc/inputs/user/Transformations.lyx
===================================================================
--- /XIOS/trunk/doc/inputs/user/Transformations.lyx	(revision 1536)
+++ 	(revision )
@@ -1,646 +1,0 @@
-#LyX 2.2 created this file. For more info see http://www.lyx.org/
-\lyxformat 508
-\begin_document
-\begin_header
-\save_transient_properties true
-\origin unavailable
-\textclass book
-\use_default_options true
-\master ../../XIOS_user_guide.lyx
-\maintain_unincluded_children false
-\language english
-\language_package default
-\inputencoding auto
-\fontencoding global
-\font_roman "default" "default"
-\font_sans "default" "default"
-\font_typewriter "default" "default"
-\font_math "auto" "auto"
-\font_default_family default
-\use_non_tex_fonts false
-\font_sc false
-\font_osf false
-\font_sf_scale 100 100
-\font_tt_scale 100 100
-\graphics default
-\default_output_format default
-\output_sync 0
-\bibtex_command default
-\index_command default
-\float_placement !tph
-\paperfontsize default
-\spacing single
-\use_hyperref false
-\papersize a4paper
-\use_geometry false
-\use_package amsmath 1
-\use_package amssymb 1
-\use_package cancel 1
-\use_package esint 1
-\use_package mathdots 1
-\use_package mathtools 1
-\use_package mhchem 1
-\use_package stackrel 1
-\use_package stmaryrd 1
-\use_package undertilde 1
-\cite_engine basic
-\cite_engine_type default
-\biblio_style plain
-\use_bibtopic false
-\use_indices false
-\paperorientation portrait
-\suppress_date false
-\justification true
-\use_refstyle 1
-\index Index
-\shortcut idx
-\color #008000
-\end_index
-\secnumdepth 3
-\tocdepth 3
-\paragraph_separation indent
-\paragraph_indentation default
-\quotes_language english
-\papercolumns 1
-\papersides 1
-\paperpagestyle default
-\tracking_changes false
-\output_changes false
-\html_math_output 0
-\html_css_as_file 0
-\html_be_strict false
-\end_header
-
-\begin_body
-
-\begin_layout Chapter
-Transformation
-\end_layout
-
-\begin_layout Standard
-\begin_inset CommandInset label
-LatexCommand label
-name "chap:Transformation"
-
-\end_inset
-
-One of a new concept which differentiates XIOS 2.0 from its precedent is
- (spatial) transformation.
- In a simple case, zoom is considered to be a transformation.
- It can be more complicated geometric transformation such as inversion or
- interpolation.
- All transformations are taken place on grid level: it is necessary to define
- a grid source as well as a grid destination, and on this last one we define
- the transformations.
- 
-\end_layout
-
-\begin_layout Section
-Define transformation
-\end_layout
-
-\begin_layout Standard
-Certainly, the first thing to do is define transformations if we would like
- to use them.
-\end_layout
-
-\begin_layout Standard
-It is not difficult to define a transformation: include a transformation
- inside grid element (domain, axis, scalar) definition, as the following
-\end_layout
-
-\begin_layout Standard
-\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
-
-<domain_definition>  
-\end_layout
-
-\begin_layout Plain Layout
-
-  <domain id="domain_A_interpolated"> 
-\end_layout
-
-\begin_layout Plain Layout
-
-   <interpolated_domain/>
-\end_layout
-
-\begin_layout Plain Layout
-
-  </domain>
-\end_layout
-
-\begin_layout Plain Layout
-
-</domain_definition>
-\end_layout
-
-\begin_layout Plain Layout
-
-<grid id="grid_A_interpolated">
-\end_layout
-
-\begin_layout Plain Layout
-
-  <domain domain_ref="domain_A_interpolated"/>
-\end_layout
-
-\begin_layout Plain Layout
-
-</grid>
-\end_layout
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Standard
-or simply, as below
-\end_layout
-
-\begin_layout Standard
-\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
-
-<grid id="grid_A_interpolated">          
-\end_layout
-
-\begin_layout Plain Layout
-
-   <domain id="domain_A_interpolated" >
-\end_layout
-
-\begin_layout Plain Layout
-
-    <interpolated_domain/>
-\end_layout
-
-\begin_layout Plain Layout
-
-   </domain>
-\end_layout
-
-\begin_layout Plain Layout
-
- </grid>
-\end_layout
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Standard
-These concrete examples say out a thing: a grid named grid_A_interpolated
- 
-\series bold
-CAN BE
-\series default
- transformed with an interpolation on its domain.
-\end_layout
-
-\begin_layout Standard
-One obvious question: From which grid is the grid grid_A_interpolated interpolat
-ed? XIOS provides a flexible way to specify the grid source on the fly.
-\end_layout
-
-\begin_layout Section
-Activate transformation
-\end_layout
-
-\begin_layout Standard
-For taking effect, a transformation must be activated even though it is
- already defined.
-\end_layout
-
-\begin_layout Standard
-This activation can be done easily by establishing relation between the
- field source, which is on the grid source, and the field destination, which
- is on the grid destination (the grid will be transformed).
-\end_layout
-
-\begin_layout Standard
-Let grid_A is a grid source and it's defined as following
-\end_layout
-
-\begin_layout Standard
-\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
-
-<grid id="grid_A">          
-\end_layout
-
-\begin_layout Plain Layout
-
-   <domain id="domain_A" />
-\end_layout
-
-\begin_layout Plain Layout
-
- </grid>
-\end_layout
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Standard
-Let field_A is a field on the grid_A
-\end_layout
-
-\begin_layout Standard
-\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
-
-<field id="field_A" operation="average" freq_op="3600s" grid_ref="grid_A"
- />
-\end_layout
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Standard
-and field_A_interpolated on the grid_A_interpolated
-\end_layout
-
-\begin_layout Standard
-\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
-
-<field id="field_A_interpolated" operation="average" freq_op="3600s" grid_ref="g
-rid_A_interpolated" />
-\end_layout
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Standard
-The transformation between two grids is activated by making a relation between
- the two fields on these grids with 
-\series bold
-\shape italic
-field_ref
-\series default
-\shape default
- 
-\end_layout
-
-\begin_layout Standard
-\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
-
-<field id="field_A_interpolated" operation="average" freq_op="3600s" grid_ref="g
-rid_A_interpolated" field_ref="field_A" />
-\end_layout
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Section
-Working with FORTRAN
-\end_layout
-
-\begin_layout Standard
-Like other objects in XIOS, a transformation can be identified with an id
- which allows users to process its attributes via FORTRAN interface.
-\end_layout
-
-\begin_layout Standard
-\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
-
-<grid id="grid_A_interpolated">          
-\end_layout
-
-\begin_layout Plain Layout
-
-   <domain id="domain_A_intepolated" >
-\end_layout
-
-\begin_layout Plain Layout
-
-    <interpolated_domain id="interp_domain" />
-\end_layout
-
-\begin_layout Plain Layout
-
-   </domain>
-\end_layout
-
-\begin_layout Plain Layout
-
- </grid>
-\end_layout
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Standard
-All transformation and their attributes can be found in Reference Guide.
-\end_layout
-
-\begin_layout Section
-Examples
-\end_layout
-
-\begin_layout Standard
-Example of some common transformations in XIOS.
-\end_layout
-
-\begin_layout Subsection
-Zoom
-\end_layout
-
-\begin_layout Standard
-Zoom is available for domain and axis
-\end_layout
-
-\begin_layout Standard
-Define a grid source
-\end_layout
-
-\begin_layout Standard
-\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
-
-<grid id="grid_A">          
-\end_layout
-
-\begin_layout Plain Layout
-
-   <domain id="domain_A" />
-\end_layout
-
-\begin_layout Plain Layout
-
-   <axis id="axis_A" />
-\end_layout
-
-\begin_layout Plain Layout
-
- </grid>
-\end_layout
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Standard
-Define a grid destination
-\end_layout
-
-\begin_layout Standard
-\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
-
-<grid id="grid_A_zoom">          
-\end_layout
-
-\begin_layout Plain Layout
-
-   <domain id="domain_A_zoom" domain_ref="domain_A" >
-\end_layout
-
-\begin_layout Plain Layout
-
-    <zoom_domain ibegin="0" ni="10" jbegin="0" nj="10" />
-\end_layout
-
-\begin_layout Plain Layout
-
-   </domain>
-\end_layout
-
-\begin_layout Plain Layout
-
-   <axis id="axis_A_zoom" axis_ref="axis_A">
-\end_layout
-
-\begin_layout Plain Layout
-
-    <zoom_axis begin="0" n="10"/>
-\end_layout
-
-\begin_layout Plain Layout
-
-   </axis>
-\end_layout
-
-\begin_layout Plain Layout
-
- </grid>
-\end_layout
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Standard
-Activate zoom
-\end_layout
-
-\begin_layout Standard
-\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
-
-<field id="field_A" operation="average" freq_op="3600s" grid_ref="grid_A"
- />
-\end_layout
-
-\begin_layout Plain Layout
-
-<field id="field_A_zoom" grid_ref="grid_A_zoom" field_ref="field_A" />
-\end_layout
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Standard
-Transformation are done with the order of their definition.
- In the above example, the domain is zoomed first then the zoom on axis
- is applied.
-\end_layout
-
-\begin_layout Subsection
-Interpolation
-\end_layout
-
-\begin_layout Standard
-Interpolation is available for domain and axis
-\end_layout
-
-\begin_layout Standard
-Define a grid source
-\end_layout
-
-\begin_layout Standard
-\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
-
-<grid id="grid_A">          
-\end_layout
-
-\begin_layout Plain Layout
-
-   <domain id="domain_A" />
-\end_layout
-
-\begin_layout Plain Layout
-
-   <axis id="axis_A" />
-\end_layout
-
-\begin_layout Plain Layout
-
- </grid>
-\end_layout
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Standard
-Define a grid destination
-\end_layout
-
-\begin_layout Standard
-\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
-
-<grid id="grid_A_interpolated">          
-\end_layout
-
-\begin_layout Plain Layout
-
-   <domain id="domain_A_interpolated" >
-\end_layout
-
-\begin_layout Plain Layout
-
-    <interpolate_domain/>
-\end_layout
-
-\begin_layout Plain Layout
-
-    <zoom_domain ibegin="0" ni="10" jbegin="0" nj="10" />
-\end_layout
-
-\begin_layout Plain Layout
-
-   </domain>
-\end_layout
-
-\begin_layout Plain Layout
-
-   <axis id="axis_A" />
-\end_layout
-
-\begin_layout Plain Layout
-
- </grid>
-\end_layout
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Standard
-Activate transformations
-\end_layout
-
-\begin_layout Standard
-\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
-
-<field id="field_A" operation="average" freq_op="3600s" grid_ref="grid_A"
- />
-\end_layout
-
-\begin_layout Plain Layout
-
-<field id="field_A_interpolated" grid_ref="grid_A_interpolated" field_ref="field
-_A" />
-\end_layout
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Standard
-Sequence of transformation can be defined in a grid.
- In the above example, the domain_A is interpolated into domain_A_interpolated
- on which a zoom is then applied.
-\end_layout
-
-\end_body
-\end_document
Index: /XIOS/trunk/inputs/COMPLETE/context_atmosphere.xml
===================================================================
--- /XIOS/trunk/inputs/COMPLETE/context_atmosphere.xml	(revision 1536)
+++ /XIOS/trunk/inputs/COMPLETE/context_atmosphere.xml	(revision 1537)
@@ -19,6 +19,6 @@
   <axis_definition>
     <axis id="axis_atm"/>
-    <axis id="axis_atm_zoom" axis_ref="axis_atm">      
-      <zoom_axis id="axis_atm_zoom" index="(0,2)[3 0 1]"/>
+    <axis id="axis_atm_zoom" axis_ref="axis_atm">
+      <zoom_axis id="axis_atm_zoom" n="4"/>
     </axis>
   </axis_definition>
Index: /XIOS/trunk/inputs/COMPLETE/context_surface.xml
===================================================================
--- /XIOS/trunk/inputs/COMPLETE/context_surface.xml	(revision 1536)
+++ /XIOS/trunk/inputs/COMPLETE/context_surface.xml	(revision 1537)
@@ -32,6 +32,6 @@
     </file>
 
-    <file type="one_file" id="output_surface_1d" name="output_surface_1d" output_freq="1d">
-      <field field_ref="field_A_srf">
+    <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>
         <variable id="my_attribute2" type="int">10</variable>
Index: /XIOS/trunk/inputs/COMPLETE/iodef.xml
===================================================================
--- /XIOS/trunk/inputs/COMPLETE/iodef.xml	(revision 1536)
+++ /XIOS/trunk/inputs/COMPLETE/iodef.xml	(revision 1537)
@@ -8,4 +8,9 @@
   <context id="xios">
       <variable_definition>
+        <variable_group id="server">
+            <variable id="using_server2" type="bool">true</variable>
+            <variable id="ratio_server2" type="int">50</variable>
+        </variable_group>
+
         <variable_group id="buffer">
             <variable id="optimal_buffer_size" type="string">memory</variable>
Index: /XIOS/trunk/inputs/REMAP/iodef.xml
===================================================================
--- /XIOS/trunk/inputs/REMAP/iodef.xml	(revision 1536)
+++ /XIOS/trunk/inputs/REMAP/iodef.xml	(revision 1537)
@@ -5,26 +5,24 @@
    <calendar type="Gregorian" start_date="2012-03-01 15:00:00" time_origin="2012-02-28 15:00:00 + 1d" />
    <field_definition level="1" >
-    <field_group id="fields_src" operation="instant" detect_missing_value=".false.">
-       <field id="src_field_2D" domain_ref="src_domain" />
-       <field id="src_field_2D_clone" domain_ref="src_domain_clone" />
-       <field id="src_field_3D" domain_ref="src_domain" axis_ref="src_axis"  />
-       <field id="src_field_3D_clone" grid_ref="src_grid_3D"   />       
-       <field id="src_field_3D_pression" grid_ref="src_grid_3D"  />
-       <field id="src_field_4D" grid_ref="src_grid_4D"  />       
+    <field_group id="fields_src" operation="instant">
+       <field id="src_field_2D" domain_ref="src_domain"/>
+       <field id="src_field_2D_clone" domain_ref="src_domain_clone"/>
+       <field id="src_field_3D" domain_ref="src_domain" axis_ref="src_axis"/>       
+       <field id="src_field_3D_pression" grid_ref="src_grid_3D"/>
+       <field id="src_field_4D" grid_ref="grid_4D"/>       
     </field_group>
     <field_group  id="fields_dst">
       <field id="dst_field_2D" field_ref="src_field_2D" domain_ref="dst_domain"/>
       <field id="dst_field_2D_regular_pole" field_ref="src_field_2D" domain_ref="dst_domain_regular_pole"/>
-      <field id="dst_field_2D_clone" field_ref="src_field_2D_clone" domain_ref="dst_domain_regular_pole"  expr="@this" operation="average" />
-      <field id="dst_field_2D_extract" field_ref="src_field_3D_clone" grid_ref="dst_grid_2D_extract"/>
       <field id="dst_field_3D" field_ref="src_field_3D" grid_ref="dst_grid_3D"/>
       <field id="dst_field_3D_interp" field_ref="src_field_3D" axis_ref="dst_axis"/>       
-      <field id="dst_field_4D_extract" field_ref="src_field_4D" grid_ref="dst_grid_4D_extract"/> 
+      <field id="dst_field_4D_extract" field_ref="src_field_4D" grid_ref="grid_4D_extract"/>      
+      <field id="dst_field_2D_clone" field_ref="src_field_2D_clone" domain_ref="dst_domain"/>
     </field_group>
-    <field_group id="read_fields" operation="instant">
-      <field id="tmp_field_0" domain_ref="src_domain_regular_read"/>      
+    <field_group id="read_fields" operation="instant" enabled="FALSE">
+      <field id="tmp_field_0" domain_ref="src_domain_regular_read" enabled="true"/>
+      <field id="tmp_field_clone" field_ref="tmp_field_0"/>
       <field id="tmp_field_1" grid_ref="src_grid_curvilinear_read" />
       <field id="tmp_field_2" grid_ref="src_grid_unstructured_read" />
-      <field id="tmp_field_clone" field_ref="tmp_field_0"/>
       <field id="dst_field_regular" field_ref="tmp_field_2" grid_ref="dst_grid_regular"/>      
       <field id="dst_field_regular_pole_0" field_ref="tmp_field_0" domain_ref="dst_domain_regular_pole"/>
@@ -37,12 +35,10 @@
         <file id="output_2D" name="output_2D" >
           <field field_ref="src_field_2D" name="field_src" />
-          <field field_ref="src_field_2D_clone" name="field_src_clone" default_value="100000" />
-          <field field_ref="src_field_2D" name="field_dst_regular_0"  domain_ref="dst_domain_regular_pole" />
+          <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" detect_missing_value=".false." default_value="100000" />
-          <field field_ref="dst_field_2D_extract" name="field_dst_regular_4" />
+          <field field_ref="dst_field_2D_clone" name="field_dst_regular_3" />
         </file> 
-       <file id="output_3D" name="output_3D" enabled=".TRUE." >
+       <file id="output_3D" name="output_3D" >
           <field field_ref="src_field_3D" name="field_src" />
           <field field_ref="src_field_3D_pression" name="field" />
@@ -50,5 +46,5 @@
           <field field_ref="dst_field_3D_interp" name="field_dst_interp_domain_axis" domain_ref="dst_domain_regular_pole"/>  
        </file>
-       <file id="output_4D" name="output_4D" enabled=".TRUE.">
+       <file id="output_4D" name="output_4D" >
           <field field_ref="src_field_4D" name="field_4D" />
           <field field_ref="dst_field_4D_extract" name="field_4D_extract" />
@@ -59,14 +55,13 @@
           <field id="src_field_regular" name="field" grid_ref="src_grid_regular_read" operation="instant"/>
        </file>
-       <file id="output_src_curvilinear" name="output_src_curvilinear" mode="read" >
+<!--        <file id="output_src_curvilinear" name="output_src_curvilinear" mode="read" >
           <field id="src_field_curvilinear" name="field_A" grid_ref="src_grid_curvilinear_read" operation="instant"/>
        </file>
        <file id="output_src_unstructured" name="output_src_unstructured" mode="read" >
           <field id="src_field_unstructured" name="field" grid_ref="src_grid_unstructured_read" operation="instant"/>
-       </file>
+       </file> -->
       </file_group>
-     <file_group id="read_then_write_files" enabled=".TRUE.">
-       <file id="output_regular_pole" name="output_dst_regular" >
-          <field field_ref="tmp_field_0" name="field_regular_0" />
+     <file_group id="read_then_write_files" enabled=".FALSE.">
+<!--        <file id="output_regular_pole" name="output_dst_regular" >
           <field field_ref="dst_field_regular" name="field_regular" />
           <field field_ref="dst_field_regular_pole_0" name="field_regular_pole_0" />
@@ -78,17 +73,7 @@
        <file id="output_dst_unstructured" name="output_dst_unstructured" >
           <field field_ref="tmp_field_2" operation="instant"/>
-       </file>
+       </file> -->
      </file_group>
    </file_definition>
-
-   <scalar_definition>
-    <scalar_group id="scalar_src">
-    </scalar_group>
-    <scalar_group id="scalar_dst">
-     <scalar id="scalar_extract">
-       <reduce_axis operation="sum"/>
-     </scalar>
-    </scalar_group>
-   </scalar_definition>
 
    <axis_definition>
@@ -96,5 +81,5 @@
       <axis id="src_axis" positive="down" />
       <axis id="nq" positive="down" />
-      <axis id="src_axis_curvilinear_read" positive="down" />
+      <axis id="src_axis_curvilinear_read" />
     </axis_group>
     <axis_group id="axis_dst">
@@ -115,5 +100,4 @@
       </domain>
       <domain id="src_domain_unstructured_read" type="unstructured">
-        <generate_rectilinear_domain/>
       </domain>
     </domain_group>
@@ -125,10 +109,10 @@
     <domain_group id="domain_dst">
      <domain id="dst_domain">
-       <interpolate_domain write_weight="false" />
+       <interpolate_domain/>
      </domain>
      <domain id="dst_domain_regular_pole" ni_glo="90" nj_glo="45" type="rectilinear">
        <generate_rectilinear_domain id="domain_regular_pole"/>
-       <interpolate_domain write_weight="false" order="1" renormalize="true"/>       
-       <!-- <zoom_domain ibegin="0" ni="45" jbegin="0" nj="45" /> -->
+       <interpolate_domain/>       
+       <zoom_domain ibegin="0" ni="45" jbegin="0" nj="45" />
      </domain>
      <domain id="dst_domain_regular" ni_glo="90" nj_glo="45" type="rectilinear">
@@ -158,5 +142,5 @@
         <axis axis_ref="src_axis"/>
       </grid>
-      <grid id="src_grid_4D">
+      <grid id="grid_4D">
         <domain domain_ref="src_domain"/>
         <axis axis_ref="src_axis"/>
@@ -169,21 +153,13 @@
         <domain domain_ref="dst_domain_regular"/>
       </grid>
-      <grid id="dst_grid_2D_extract">
-        <domain domain_ref="dst_domain_regular"/>
-        <scalar >          
-          <reduce_axis operation="min"/>
-          <!-- <extract_axis position="2"/> -->
-        </scalar>
-      </grid>
       <grid id="dst_grid_3D">
         <domain domain_ref="src_domain"/>
         <axis axis_ref="dst_axis"/>
       </grid>
-      <grid id="dst_grid_4D_extract">
+      <grid id="grid_4D_extract">
         <domain domain_ref="dst_domain_regular_pole"/>      
         <axis axis_ref="src_axis"/>        
         <scalar >
-          <!-- <extract_axis position="1"/> -->
-          <reduce_axis operation="sum"/>
+          <extract_axis position="1"/>
         </scalar>      
       </grid>
@@ -194,4 +170,9 @@
   <context id="xios">
       <variable_definition>
+         <variable_group id="server">
+            <variable id="using_server2" type="bool">true</variable>
+            <variable id="ratio_server2" type="int">50</variable>
+         </variable_group>
+
         <variable_group id="buffer">
             <variable id="optimal_buffer_size" type="string">performance</variable>
Index: /XIOS/trunk/inputs/Second_server/context_atmosphere.xml
===================================================================
--- /XIOS/trunk/inputs/Second_server/context_atmosphere.xml	(revision 1537)
+++ /XIOS/trunk/inputs/Second_server/context_atmosphere.xml	(revision 1537)
@@ -0,0 +1,32 @@
+<!-- Context atm -->
+
+<context id="atmosphere">
+
+  <field_definition freq_op="1ts" enabled=".TRUE." operation="instant" domain_ref="atm_face" >
+   <field id="atm_temp1" name="atm_temp1" long_name="Surface Temperature" unit="K" />
+   <field id="atm_temp2" name="atm_temp2" long_name="Surface Temperature" unit="K" /> 
+  </field_definition>
+
+  <file_definition type="one_file" output_freq="3600s" par_access="collective" enabled=".TRUE.">
+   <file id="atm_output9" name="atm_output9" compression_level="9" >
+    <!--  <field field_ref="atm_temp1" />-->
+      <field field_ref="atm_temp2"/>
+    </file> 
+<!--    <file id="atm_output2" name="atm_output2" timeseries="both" ts_prefix="TS" >
+      <field field_ref="atm_temp2" ts_enabled=".TRUE." ts_split_freq="2h"/>
+    </file> -->
+<!--    <file id="atm_output0" name="atm_output0" >
+      <field field_ref="atm_temp1" />
+      <field field_ref="atm_temp2"/>
+    </file> 
+   <file id="atm_output2" name="atm_output2" compression_level="2" >
+      <field field_ref="atm_temp1" />
+      <field field_ref="atm_temp2"/>
+    </file> 
+-->
+ </file_definition>
+
+  <domain_definition>
+   <domain id="atm_face" name="mesh" nvertex="4"/>  
+</domain_definition>
+ </context>
Index: /XIOS/trunk/inputs/Second_server/context_surface.xml
===================================================================
--- /XIOS/trunk/inputs/Second_server/context_surface.xml	(revision 1537)
+++ /XIOS/trunk/inputs/Second_server/context_surface.xml	(revision 1537)
@@ -0,0 +1,18 @@
+<!-- Context surface -->
+
+<context id="atmosphere">
+
+  <field_definition freq_op="1ts" enabled=".TRUE." operation="instant" >
+   <field id="srf_temp" name="srf_temp" long_name="Surface Temperature" unit="K" domain_ref="domain_srf" />
+  </field_definition>
+
+  <file_definition type="one_file" output_freq="1h" par_access="collective" enabled=".TRUE.">
+    <file id="srf_output" name="srf_output" >
+      <field field_ref="srf_temp" />
+    </file> 
+  </file_definition>
+
+  <domain_definition>
+   <domain id="domain_srf" name="mesh" nvertex="4"/>  
+  </domain_definition>
+ </context>
Index: /XIOS/trunk/inputs/Second_server/iodef.xml
===================================================================
--- /XIOS/trunk/inputs/Second_server/iodef.xml	(revision 1537)
+++ /XIOS/trunk/inputs/Second_server/iodef.xml	(revision 1537)
@@ -0,0 +1,27 @@
+<?xml version="1.0"?>
+<simulation>
+
+  <context id="atmosphere" src="./context_atmosphere.xml"/> 
+  <context id="surface" src="./context_surface.xml"/>  
+
+  <context id="xios">
+      <variable_definition>
+
+         <variable_group id="server">
+            <variable id="using_server2" type="bool">true</variable>
+            <variable id="ratio_server2" type="int">50</variable>
+         </variable_group>
+
+        <variable_group id="buffer">
+            <variable id="optimal_buffer_size" type="string">performance</variable>
+            <variable id="buffer_size_factor" type="double">1.0</variable>
+         </variable_group>
+
+        <variable_group id="parameters" >
+          <variable id="info_level" type="int">100</variable>
+          <variable id="print_file" type="bool">true</variable>
+        </variable_group>
+      </variable_definition>
+  </context>
+
+</simulation>
Index: /XIOS/trunk/inputs/iodef.xml
===================================================================
--- /XIOS/trunk/inputs/iodef.xml	(revision 1536)
+++ /XIOS/trunk/inputs/iodef.xml	(revision 1537)
@@ -6,21 +6,40 @@
 
 
-   <field_definition level="1" enabled=".FALSE.">
+   <field_definition level="1" enabled=".TRUE.">
      <field id="field_A"  operation="average" freq_op="3600s" grid_ref="grid_A"/>
+     <field id="field_Axis"  operation="average" freq_op="3600s" axis_ref="axis_A"/>
+     <field id="field_Domain"  operation="average" freq_op="3600s" domain_ref="domain_A"/>
      <field id="field_A_zoom"  operation="average" freq_op="3600s" field_ref="field_A" grid_ref="grid_A_zoom"/>
+     <field id="field_Scalar"  operation="average" freq_op="3600s" grid_ref="grid_Scalar"/>
    </field_definition>
 
 
-   <file_definition type="multiple_file" par_access="collective" output_freq="6h" output_level="10" enabled=".TRUE.">
-     <file id="output" name="output">
-        <field field_ref="field_A_zoom" name="field_A" />
+   <file_definition type="one_file" par_access="collective" output_freq="1h" output_level="10" enabled=".FALSE.">
+      <file id="output" name="output" enabled=".TRUE.">
+        <!-- <field field_ref="field_Domain" name="field_A" /> -->
+        <field field_ref="field_A" name="field_A" /> 
+        <field field_ref="field_A_zoom" name="field_B" />
      </file>
+     <file id="output1" name="output1" enabled=".TRUE.">
+        <!-- <field field_ref="field_Domain" name="field_A" /> -->
+        <field field_ref="field_A" name="field_A" />        
+     </file> 
+     <file id="output2" name="output2" enabled=".TRUE.">
+        <!-- <field field_ref="field_Domain" name="field_A" /> -->
+        <field field_ref="field_Scalar" name="field_A" />        
+     </file>
+ <!--     <file id="output_s" name="output_s" mode="read" >
+       <field id="field" name="field_A" grid_ref="grid_Scalar" operation="instant" />
+     </file> -->
    </file_definition>
 
+  <scalar_defintion>
+    <scalar id="scalar_A"/>
+  </scalar_defintion>
 
    <axis_definition>
      <axis id="axis_A"/>
      <axis id="axis_A_zoom" axis_ref="axis_A">
-       <zoom_axis begin="1" n="2" />
+       <zoom_axis index="(0,1)[0 2]" />
      </axis>
    </axis_definition>
@@ -28,4 +47,5 @@
    <domain_definition>
      <domain id="domain_A" />
+
    </domain_definition>
 
@@ -39,21 +59,20 @@
        <axis axis_ref="axis_A_zoom" />
      </grid>
+     <grid id="grid_Scalar">
+      <scalar id="scalar_A"/>
+     </grid>
    </grid_definition>
-  </context>
-
-  <context id="toto" >
-  </context>
-
-  <context id="titi">
-  </context>
-
-  <context id="tata">
   </context>
 
   <context id="xios">
       <variable_definition>
+         <variable_group id="server">
+            <variable id="using_server2" type="bool">true</variable>
+            <variable id="ratio_server2" type="int">50</variable>
+         </variable_group>
+
         <variable_group id="buffer">
             <variable id="optimal_buffer_size" type="string">performance</variable>
-            <variable id="buffer_size_factor" type="double">1.0</variable>
+            <variable id="buffer_size_factor" type="double">10.0</variable>
          </variable_group>
 
Index: /XIOS/trunk/inputs/test_diurnal_cycle/iodef.xml
===================================================================
--- /XIOS/trunk/inputs/test_diurnal_cycle/iodef.xml	(revision 1537)
+++ /XIOS/trunk/inputs/test_diurnal_cycle/iodef.xml	(revision 1537)
@@ -0,0 +1,64 @@
+<?xml version="1.0"?>
+<simulation>
+
+ <context id="test">
+   <calendar type="Gregorian" start_date="2012-03-01 15:00:00" time_origin="2012-02-28 15:00:00 + 1d" />
+
+
+   <field_definition level="1" enabled=".TRUE." default_value="1e20">
+     <field id="field_A"  operation="instant" freq_op="3600s" grid_ref="grid_A"/>
+   </field_definition>
+
+
+   <file_definition type="one_file" par_access="collective" output_freq="4h" output_level="10" enabled=".FALSE.">
+      <file id="output" name="output" enabled=".TRUE.">
+        <field field_ref="field_A" name="field_B" default_value="1e20" grid_ref="grid_B" /> 
+        <field field_ref="field_A" name="field_A" default_value="1e20"  /> 
+     </file>
+   </file_definition>
+
+  <axis_definition>
+     <axis id="axis_A" />
+     <axis id="pressure" n_glo="10" value="(0,9)[9 8 7 6 5 4 3 2 1 0]" />
+  </axis_definition>    
+  
+   <grid_definition>
+     <grid id="grid_A">
+       <axis axis_ref="axis_A" />
+       <axis axis_ref="pressure" />
+       <scalar />
+     </grid>
+
+     <grid id="grid_B">
+       <axis axis_ref="axis_A" />
+       <axis axis_ref="pressure" />
+       <axis id="axis_B" n_glo="4" value="(0,3)[6 12 18 24]" >
+         <temporal_splitting />
+       </axis>
+     </grid>
+
+   </grid_definition>
+  </context>
+
+  <context id="xios">
+      <variable_definition>
+         <variable_group id="server">
+            <variable id="using_server2" type="bool">false</variable>
+            <variable id="ratio_server2" type="int">50</variable>
+         </variable_group>
+
+        <variable_group id="buffer">
+            <variable id="optimal_buffer_size" type="string">performance</variable>
+            <variable id="buffer_size_factor" type="double">10.0</variable>
+         </variable_group>
+
+        <variable_group id="parameters" >
+          <variable id="using_server" type="bool">false</variable>
+          <variable id="info_level" type="int">50</variable>
+          <variable id="print_file" type="bool">true</variable>
+        </variable_group>
+      </variable_definition>
+  </context>
+
+</simulation>
+
Index: /XIOS/trunk/make_xios
===================================================================
--- /XIOS/trunk/make_xios	(revision 1536)
+++ /XIOS/trunk/make_xios	(revision 1537)
@@ -5,4 +5,7 @@
 use_oasis="false"
 oasis="oasis3_mct"
+build_path="./"
+build_dir="./"
+build_suffixed="false"
 use_extern_boost="false"
 use_extern_blitz="false"
@@ -11,6 +14,6 @@
 netcdf_lib="netcdf4_par"
 compil_mode="prod"
-arch_path="arch"
-arch_default_path="arch"
+arch_path=$PWD/"arch"
+arch_default_path=$PWD/"arch"
 arch_defined="FALSE"
 arch_path_defined="FALSE"
@@ -30,5 +33,8 @@
 	    echo "       [--avail] : to know available target architectures "
 	    echo "       [--full] : to generate dependencies and recompile from scratch"
-	    echo "       [--use_oasis 'oasis3' 'oasis3_mct' : default oasis3_mct] : to use Oasis coupler"i
+	    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"
@@ -48,4 +54,7 @@
          "--full")  compil_full="true"  ; shift ;;
          "--use_oasis")  use_oasis="true" oasis=$2 ; shift ; shift  ;;
+         "--build_path")  build_path=$2     ; shift ; shift ;;
+         "--build_dir")  build_dir=$2     ; shift ; shift ;;
+         "--build_suffixed")  build_suffixed="true" ; shift  ;;
          "--use_extern_boost")  use_extern_boost="true" ; shift  ;;
          "--use_extern_blitz")  use_extern_blitz="true" ; shift  ;;
@@ -73,4 +82,25 @@
 fi
 
+# Definition of the root directory of the build
+
+if [[ "$build_path" == "./" ]]; then
+  install_dir=$PWD
+else
+  install_dir=${build_path}
+fi
+
+if [[ "$build_suffixed" == "true" ]]; then
+    install_dir="${install_dir}/config_${arch}_${compil_mode}"
+else
+    install_dir="${install_dir}/${build_dir}"
+fi
+
+mkdir -p $install_dir
+
+rm -f ${PWD}/bld_dir.cfg
+echo "inc    ${install_dir}/arch.fcm" >> ${PWD}/bld_dir.cfg 
+echo "inc    ${install_dir}/config.fcm" >> ${PWD}/bld_dir.cfg
+echo "dir::root  ${install_dir}"   >> ${PWD}/bld_dir.cfg
+
 # VÃ©rification de la prÃ©sence d'un identifiant d'architecture.
 
@@ -87,35 +117,35 @@
 if [[ "$arch_defined" == "TRUE" ]]
 then
-  rm -f arch.path
-  rm -f arch.fcm
-  rm -f arch.env
+  rm -f ${install_dir}/arch.path
+  rm -f ${install_dir}/arch.fcm
+  rm -f ${install_dir}/arch.env
 
   if test -f $arch_path/arch-${arch}.path
   then
-    ln -s $arch_path/arch-${arch}.path arch.path
+    ln -s $arch_path/arch-${arch}.path ${install_dir}/arch.path
   elif test -f $arch_default_path/arch-${arch}.path
   then
-    ln -s $arch_default_path/arch-${arch}.path arch.path
+    ln -s $arch_default_path/arch-${arch}.path ${install_dir}/arch.path
   fi
         
   if test -f $arch_path/arch-${arch}.fcm
   then
-    ln -s $arch_path/arch-${arch}.fcm arch.fcm
+    ln -s $arch_path/arch-${arch}.fcm ${install_dir}/arch.fcm
   elif test -f $arch_default_path/arch-${arch}.fcm
   then
-    ln -s $arch_default_path/arch-${arch}.fcm arch.fcm
+    ln -s $arch_default_path/arch-${arch}.fcm ${install_dir}/arch.fcm
   fi
 
   if test -f $arch_path/arch-${arch}.env
   then
-    ln -s $arch_path/arch-${arch}.env arch.env
+    ln -s $arch_path/arch-${arch}.env ${install_dir}/arch.env
   elif test -f $arch_default_path/arch-${arch}.env
   then
-    ln -s $arch_default_path/arch-${arch}.env arch.env
+    ln -s $arch_default_path/arch-${arch}.env ${install_dir}/arch.env
   else
-    ln -s .void_file arch.env
+    ln -s .void_file ${install_dir}/arch.env
   fi
-  source arch.env
-  source arch.path
+  source ${install_dir}/arch.env
+  source ${install_dir}/arch.path
 else
       echo "Please choose a target achitecture --> list all available architecture using make_xios --avail!"
@@ -197,4 +227,5 @@
    ln -s $PWD/.void_dir $PWD/extern/blitz
 else
+   echo "src::blitz $PWD/extern/blitz/src" >> ${PWD}/bld_dir.cfg
    export BLITZ_INCDIR="-I${PWD}/extern/blitz"
    export BLITZ_LIBDIR=""
@@ -225,12 +256,12 @@
 XIOS_LIB="$XIOS_LIB $NETCDF_LIBDIR $HDF5_LIBDIR $MPI_LIBDIR $NETCDF_LIB $HDF5_LIB $MPI_LIB"
 
-rm -f config.fcm
-echo "%COMPIL_CFLAGS $COMPIL_CFLAGS" >> config.fcm
-echo "%COMPIL_FFLAGS $COMPIL_FFLAGS" >> config.fcm
-echo "%CPP_KEY       $XIOS_CPPKEY"   >> config.fcm
-
-echo "%CBASE_INC     $XIOS_CINCDIR" >> config.fcm     
-echo "%FBASE_INC     $XIOS_FINCDIR" >> config.fcm
-echo "%ARCH_LD       $XIOS_LIB"     >> config.fcm 
+rm -f ${install_dir}/config.fcm
+echo "%COMPIL_CFLAGS $COMPIL_CFLAGS" >> ${install_dir}/config.fcm
+echo "%COMPIL_FFLAGS $COMPIL_FFLAGS" >> ${install_dir}/config.fcm
+echo "%CPP_KEY       $XIOS_CPPKEY"   >> ${install_dir}/config.fcm
+
+echo "%CBASE_INC     $XIOS_CINCDIR" >> ${install_dir}/config.fcm     
+echo "%FBASE_INC     $XIOS_FINCDIR" >> ${install_dir}/config.fcm
+echo "%ARCH_LD       $XIOS_LIB"     >> ${install_dir}/config.fcm 
 
 echo "=> Using "$compil_mode" mode for compiling under architecture \""$arch"\" !"
Index: /XIOS/trunk/src/array_new.hpp
===================================================================
--- /XIOS/trunk/src/array_new.hpp	(revision 1536)
+++ /XIOS/trunk/src/array_new.hpp	(revision 1537)
@@ -307,4 +307,5 @@
         size_t nbArr  = array.numElements();
         if (nbThis != nbArr) return false;
+        if (nbThis==0 && nbArr==0) return true;
         typename Array<T_numtype,N_rank>::const_iterator itx=array.begin(), itxe=array.end(), ity=this->begin() ;
         for(;itx!=itxe;++itx,++ity) if (*itx!=*ity) return false ;
@@ -554,5 +555,5 @@
         TinyVector<int,N_rank> vect;
         size_t ne;
-        
+
         ret =  buffer.get(numDim);
         ret &= buffer.get(vect.data(), N_rank);
Index: /XIOS/trunk/src/attribute.hpp
===================================================================
--- /XIOS/trunk/src/attribute.hpp	(revision 1536)
+++ /XIOS/trunk/src/attribute.hpp	(revision 1537)
@@ -45,4 +45,7 @@
             //! Returns true if and only if the attribute should be publicly exposed in the API
             virtual bool isPublic() const { return true; }
+            
+            //! Return true if the attribute should be sent to other clients or servers
+            virtual bool doSend() const { return true; }
 
             /*
Index: /XIOS/trunk/src/attribute_array.hpp
===================================================================
--- /XIOS/trunk/src/attribute_array.hpp	(revision 1536)
+++ /XIOS/trunk/src/attribute_array.hpp	(revision 1537)
@@ -43,6 +43,5 @@
             CArray<T_numtype, N_rank> getInheritedValue(void) const ;
             bool hasInheritedValue(void) const;
-            
-            bool isEqual(const CAttributeArray& attr);
+                        
             bool isEqual(const CAttribute& attr);
 
@@ -67,4 +66,5 @@
 
          private :
+          bool isEqual_(const CAttributeArray& attr);
           CArray<T_numtype, N_rank> inheritedValue ;
           StdString _toString(void) const;
Index: /XIOS/trunk/src/attribute_array_impl.hpp
===================================================================
--- /XIOS/trunk/src/attribute_array_impl.hpp	(revision 1536)
+++ /XIOS/trunk/src/attribute_array_impl.hpp	(revision 1537)
@@ -104,13 +104,19 @@
 
     template <typename T_numtype, int N_rank>
-    bool CAttributeArray<T_numtype,N_rank>::isEqual(const CAttributeArray& attr)
+    bool CAttributeArray<T_numtype,N_rank>::isEqual(const CAttribute& attr)
     {
-      return ((dynamic_cast<CArray<T_numtype,N_rank>& >(*this)) == (dynamic_cast<const CArray<T_numtype,N_rank>& >(attr)));      
+      const CAttributeArray<T_numtype,N_rank>& tmp = dynamic_cast<const CAttributeArray<T_numtype,N_rank>& >(attr);
+      return this->isEqual_(tmp);      
     }
 
     template <typename T_numtype, int N_rank>
-    bool CAttributeArray<T_numtype,N_rank>::isEqual(const CAttribute& attr)
+    bool CAttributeArray<T_numtype,N_rank>::isEqual_(const CAttributeArray& attr)
     {
-      return ((*this) == (dynamic_cast<const CAttributeArray<T_numtype,N_rank>& >(attr)));      
+      if ((!this->hasInheritedValue() && !attr.hasInheritedValue()))
+          return true;
+      if (this->hasInheritedValue() && attr.hasInheritedValue())
+          return (this->getInheritedValue() == attr.getInheritedValue());
+      else 
+        return false;      
     }
 
Index: /XIOS/trunk/src/attribute_enum.hpp
===================================================================
--- /XIOS/trunk/src/attribute_enum.hpp	(revision 1536)
+++ /XIOS/trunk/src/attribute_enum.hpp	(revision 1537)
@@ -49,7 +49,6 @@
             T_enum getInheritedValue(void)  const;
             string getInheritedStringValue(void) const;
-            bool hasInheritedValue(void) const;          
-          
-            bool isEqual(const CAttributeEnum& attr );
+            bool hasInheritedValue(void) const;                    
+            
             bool isEqual(const CAttribute& attr );
 
@@ -77,4 +76,5 @@
 
          private :
+          bool isEqual_(const CAttributeEnum& attr );
           StdString _toString(void) const;
           void _fromString(const StdString & str);
Index: /XIOS/trunk/src/attribute_enum_impl.hpp
===================================================================
--- /XIOS/trunk/src/attribute_enum_impl.hpp	(revision 1536)
+++ /XIOS/trunk/src/attribute_enum_impl.hpp	(revision 1537)
@@ -114,11 +114,17 @@
   bool CAttributeEnum<T>::isEqual(const CAttribute& attr)
   {
-    return (this->isEqual(dynamic_cast<const CAttributeEnum<T>& >(attr)));
-  }
-
-  template <class T>
-  bool CAttributeEnum<T>::isEqual(const CAttributeEnum& attr)
-  {
-    return ((dynamic_cast<const CEnum<T>& >(*this)) == (dynamic_cast<const CEnum<T>& >(attr)));
+    const CAttributeEnum<T>& tmp = dynamic_cast<const CAttributeEnum<T>& >(attr);
+    return this->isEqual_(tmp);
+  }
+
+  template <class T>
+  bool CAttributeEnum<T>::isEqual_(const CAttributeEnum& attr)
+  {
+    if ((!this->hasInheritedValue() && !attr.hasInheritedValue()))
+        return true;
+    if (this->hasInheritedValue() && attr.hasInheritedValue())
+        return (this->getInheritedValue() == attr.getInheritedValue());
+    else 
+      return false;    
   }
 
Index: /XIOS/trunk/src/attribute_map.cpp
===================================================================
--- /XIOS/trunk/src/attribute_map.cpp	(revision 1536)
+++ /XIOS/trunk/src/attribute_map.cpp	(revision 1537)
@@ -278,5 +278,4 @@
       }
  */
-
       
       void CAttributeMap::generateCInterface(ostream& oss, const string& className)
Index: /XIOS/trunk/src/buffer_client.cpp
===================================================================
--- /XIOS/trunk/src/buffer_client.cpp	(revision 1536)
+++ /XIOS/trunk/src/buffer_client.cpp	(revision 1537)
@@ -37,13 +37,13 @@
   }
 
-  int CClientBuffer::remain(void)
+  StdSize CClientBuffer::remain(void)
   {
     return bufferSize - count;
   }
 
-  bool CClientBuffer::isBufferFree(int size)
+  bool CClientBuffer::isBufferFree(StdSize size)
   {
     if (size > bufferSize)
-      ERROR("bool CClientBuffer::isBufferFree(int size)",
+      ERROR("bool CClientBuffer::isBufferFree(StdSize size)",
             << "The requested size (" << size << " bytes) is too big to fit the buffer (" << bufferSize << " bytes), please increase the client buffer size." << endl);
 
@@ -64,5 +64,5 @@
 
 
-  CBufferOut* CClientBuffer::getBuffer(int size)
+  CBufferOut* CClientBuffer::getBuffer(StdSize size)
   {
     if (size <= remain())
@@ -75,5 +75,5 @@
     else
     {
-      ERROR("CBufferOut* CClientBuffer::getBuffer(int size)",
+      ERROR("CBufferOut* CClientBuffer::getBuffer(StdSize size)",
             << "Not enough space in buffer, this should not have happened...");
       return NULL;
Index: /XIOS/trunk/src/buffer_client.hpp
===================================================================
--- /XIOS/trunk/src/buffer_client.hpp	(revision 1536)
+++ /XIOS/trunk/src/buffer_client.hpp	(revision 1537)
@@ -17,9 +17,9 @@
       ~CClientBuffer();
 
-      bool isBufferFree(int size);
-      CBufferOut* getBuffer(int size);
+      bool isBufferFree(StdSize size);
+      CBufferOut* getBuffer(StdSize size);
       bool checkBuffer(void);
       bool hasPendingRequest(void);
-      int remain(void);
+      StdSize remain(void);
 
     private:
@@ -27,10 +27,13 @@
 
       int current;
-      int count;
-      int bufferedEvents;
-      int maxEventSize;
-      const int maxBufferedEvents;
-      const int bufferSize;
-      const int estimatedMaxEventSize;
+
+      StdSize count;
+      StdSize bufferedEvents;
+      StdSize maxEventSize;
+      const StdSize maxBufferedEvents;
+      const StdSize bufferSize;
+      const StdSize estimatedMaxEventSize;
+
+
       const int serverRank;
       bool pending;
Index: /XIOS/trunk/src/calendar_util.cpp
===================================================================
--- /XIOS/trunk/src/calendar_util.cpp	(revision 1536)
+++ /XIOS/trunk/src/calendar_util.cpp	(revision 1537)
@@ -130,7 +130,6 @@
     {
       // TODO :: VÃ©rifier que les deux dates (dt0 et dt1) ont une rÃ©fÃ©rence vers le mÃªme calendrier.
-      CDuration dur =
-      { dt0.getYear() - dt1.getYear(), dt0.getMonth()  - dt1.getMonth() , dt0.getDay()   - dt1.getDay(),
-        dt0.getHour() - dt1.getHour(), dt0.getMinute() - dt1.getMinute(), dt0.getSecond() - dt1.getSecond() };
+      CDuration dur( dt0.getYear() - dt1.getYear(), dt0.getMonth()  - dt1.getMonth() , dt0.getDay()   - dt1.getDay(),
+      dt0.getHour() - dt1.getHour(), dt0.getMinute() - dt1.getMinute(), dt0.getSecond() - dt1.getSecond() );
       return (dur.resolve(dt0.getRelCalendar()));
     }
Index: /XIOS/trunk/src/client.cpp
===================================================================
--- /XIOS/trunk/src/client.cpp	(revision 1536)
+++ /XIOS/trunk/src/client.cpp	(revision 1537)
@@ -20,9 +20,20 @@
     int CClient::serverLeader ;
     bool CClient::is_MPI_Initialized ;
-    int CClient::rank = INVALID_RANK;
+    int CClient::rank_ = INVALID_RANK;
     StdOFStream CClient::m_infoStream;
     StdOFStream CClient::m_errorStream;
 
-    void CClient::initialize(const string& codeId,MPI_Comm& localComm,MPI_Comm& returnComm)
+    MPI_Comm& CClient::getInterComm(void)   { return (interComm); }
+
+///---------------------------------------------------------------
+/*!
+ * \fn void CClient::initialize(const string& codeId, MPI_Comm& localComm, MPI_Comm& returnComm)
+ * Function creates intraComm (CClient::intraComm) for client group with id=codeId and interComm (CClient::interComm) between client and server groups.
+ * \param [in] codeId identity of context.
+ * \param [in/out] localComm local communicator.
+ * \param [in/out] returnComm (intra)communicator of client group.
+ */
+
+    void CClient::initialize(const string& codeId, MPI_Comm& localComm, MPI_Comm& returnComm)
     {
       int initialized ;
@@ -30,9 +41,10 @@
       if (initialized) is_MPI_Initialized=true ;
       else is_MPI_Initialized=false ;
+      int rank ;
 
 // don't use OASIS
       if (!CXios::usingOasis)
       {
-// localComm doesn't given
+// localComm isn't given
         if (localComm == MPI_COMM_NULL)
         {
@@ -54,5 +66,5 @@
 
           MPI_Comm_size(CXios::globalComm,&size) ;
-          MPI_Comm_rank(CXios::globalComm,&rank);
+          MPI_Comm_rank(CXios::globalComm,&rank_);
 
           hashAll=new unsigned long[size] ;
@@ -84,7 +96,6 @@
           }
 
-          myColor=colors[hashClient] ;
-
-          MPI_Comm_split(CXios::globalComm,myColor,rank,&intraComm) ;
+          myColor=colors[hashClient];
+          MPI_Comm_split(CXios::globalComm,myColor,rank_,&intraComm) ;
 
           if (CXios::usingServer)
@@ -92,11 +103,11 @@
             int clientLeader=leaders[hashClient] ;
             serverLeader=leaders[hashServer] ;
-
             int intraCommSize, intraCommRank ;
             MPI_Comm_size(intraComm,&intraCommSize) ;
             MPI_Comm_rank(intraComm,&intraCommRank) ;
-            info(50)<<"intercommCreate::client "<<rank<<" intraCommSize : "<<intraCommSize
-                 <<" intraCommRank :"<<intraCommRank<<"  clientLeader "<< serverLeader<<endl ;
-            MPI_Intercomm_create(intraComm,0,CXios::globalComm,serverLeader,0,&interComm) ;
+            info(50)<<"intercommCreate::client "<<rank_<<" intraCommSize : "<<intraCommSize
+                   <<" intraCommRank :"<<intraCommRank<<"  clientLeader "<< serverLeader<<endl ;
+             MPI_Intercomm_create(intraComm, 0, CXios::globalComm, serverLeader, 0, &interComm) ;
+             //rank_ = intraCommRank;
           }
           else
@@ -123,5 +134,5 @@
       else
       {
-        // localComm doesn't given
+        // localComm isn't given
         if (localComm == MPI_COMM_NULL)
         {
@@ -137,10 +148,9 @@
         {
           MPI_Status status ;
-          MPI_Comm_rank(intraComm,&rank) ;
+          MPI_Comm_rank(intraComm,&rank_) ;
 
           oasis_get_intercomm(interComm,CXios::xiosCodeId) ;
-          if (rank==0) MPI_Recv(&serverLeader,1, MPI_INT, 0, 0, interComm, &status) ;
+          if (rank_==0) MPI_Recv(&serverLeader,1, MPI_INT, 0, 0, interComm, &status) ;
           MPI_Bcast(&serverLeader,1,MPI_INT,0,intraComm) ;
-
         }
         else MPI_Comm_dup(intraComm,&interComm) ;
@@ -150,6 +160,13 @@
     }
 
-
-    void CClient::registerContext(const string& id,MPI_Comm contextComm)
+///---------------------------------------------------------------
+/*!
+ * \fn void CClient::registerContext(const string& id, MPI_Comm contextComm)
+ * \brief Sends a request to create a context to server. Creates client/server contexts.
+ * \param [in] id id of context.
+ * \param [in] contextComm.
+ * Function is only called by client.
+ */
+    void CClient::registerContext(const string& id, MPI_Comm contextComm)
     {
       CContext::setCurrent(id) ;
@@ -158,5 +175,23 @@
       idServer += "_server";
 
-      if (!CXios::isServer)
+      if (CXios::isServer && !context->hasServer)
+      // Attached mode
+      {
+        MPI_Comm contextInterComm ;
+        MPI_Comm_dup(contextComm,&contextInterComm) ;
+        CContext* contextServer = CContext::create(idServer);
+
+        // Firstly, initialize context on client side
+        context->initClient(contextComm,contextInterComm, contextServer);
+
+        // Secondly, initialize context on server side
+        contextServer->initServer(contextComm,contextInterComm, context);
+
+        // Finally, we should return current context to context client
+        CContext::setCurrent(id);
+
+        contextInterComms.push_back(contextInterComm);
+      }
+      else
       {
         int size,rank,globalRank ;
@@ -170,5 +205,4 @@
         if (rank!=0) globalRank=0 ;
 
-
         CMessage msg ;
         msg<<idServer<<size<<globalRank ;
@@ -181,9 +215,7 @@
 
         MPI_Send((void*)buff,buffer.count(),MPI_CHAR,serverLeader,1,CXios::globalComm) ;
-        delete [] buff ;
 
         MPI_Intercomm_create(contextComm,0,CXios::globalComm,serverLeader,10+globalRank,&contextInterComm) ;
         info(10)<<"Register new Context : "<<id<<endl ;
-
         MPI_Comm inter ;
         MPI_Intercomm_merge(contextInterComm,0,&inter) ;
@@ -194,21 +226,6 @@
         contextInterComms.push_back(contextInterComm);
         MPI_Comm_free(&inter);
-      }
-      else
-      {
-        MPI_Comm contextInterComm ;
-        MPI_Comm_dup(contextComm,&contextInterComm) ;
-        CContext* contextServer = CContext::create(idServer);
-
-        // Firstly, initialize context on client side
-        context->initClient(contextComm,contextInterComm, contextServer);
-
-        // Secondly, initialize context on server side
-        contextServer->initServer(contextComm,contextInterComm, context);
-
-        // Finally, we should return current context to context client
-        CContext::setCurrent(id);
-
-        contextInterComms.push_back(contextInterComm);
+        delete [] buff ;
+
       }
     }
@@ -256,7 +273,10 @@
    }
 
+    /*!
+    * Return global rank without oasis and current rank in model intraComm in case of oasis
+    */
    int CClient::getRank()
    {
-     return rank;
+     return rank_;
    }
 
@@ -274,4 +294,5 @@
       int numDigit = 0;
       int size = 0;
+      int rank;
       MPI_Comm_size(CXios::globalComm, &size);
       while (size)
@@ -281,5 +302,13 @@
       }
 
-      fileNameClient << fileName << "_" << std::setfill('0') << std::setw(numDigit) << getRank() << ext;
+      if (CXios::usingOasis)
+      {
+        MPI_Comm_rank(CXios::globalComm,&rank);
+        fileNameClient << fileName << "_" << std::setfill('0') << std::setw(numDigit) << rank << ext;
+      }
+      else
+        fileNameClient << fileName << "_" << std::setfill('0') << std::setw(numDigit) << getRank() << ext;
+
+
       fb->open(fileNameClient.str().c_str(), std::ios::out);
       if (!fb->is_open())
Index: /XIOS/trunk/src/client.hpp
===================================================================
--- /XIOS/trunk/src/client.hpp	(revision 1536)
+++ /XIOS/trunk/src/client.hpp	(revision 1537)
@@ -20,5 +20,7 @@
         static bool is_MPI_Initialized ;
 
-        //! Get rank of the current process
+        static MPI_Comm& getInterComm();
+
+        //! Get global rank without oasis and current rank in model intraComm in case of oasis
         static int getRank();
 
@@ -38,5 +40,5 @@
 
       protected:
-        static int rank;
+        static int rank_;                 //!< Rank in model intraComm
         static StdOFStream m_infoStream;
         static StdOFStream m_errorStream;
Index: /XIOS/trunk/src/client_server_mapping.cpp
===================================================================
--- /XIOS/trunk/src/client_server_mapping.cpp	(revision 1536)
+++ /XIOS/trunk/src/client_server_mapping.cpp	(revision 1537)
@@ -97,3 +97,8 @@
 }
 
+CClientServerMapping::GlobalIndexMap& CClientServerMapping::getGlobalIndexOnServer()
+{
+  return indexGlobalOnServer_;
+}
+
 } //namespace xios
Index: /XIOS/trunk/src/client_server_mapping.hpp
===================================================================
--- /XIOS/trunk/src/client_server_mapping.hpp	(revision 1536)
+++ /XIOS/trunk/src/client_server_mapping.hpp	(revision 1537)
@@ -34,5 +34,5 @@
 
     // Only need global index on client to calculate mapping (supposed client has info of distribution)
-    virtual void computeServerIndexMapping(const CArray<size_t,1>& globalIndexOnClient) = 0;
+    virtual void computeServerIndexMapping(const CArray<size_t,1>& globalIndexOnClient, int nbServer) = 0;
 
     static std::map<int,int> computeConnectedClients(int nbServer, int nbClient,
@@ -41,4 +41,6 @@
 
     const GlobalIndexMap& getGlobalIndexOnServer() const;
+
+    GlobalIndexMap& getGlobalIndexOnServer();
 
   protected:
Index: /XIOS/trunk/src/client_server_mapping_distributed.cpp
===================================================================
--- /XIOS/trunk/src/client_server_mapping_distributed.cpp	(revision 1536)
+++ /XIOS/trunk/src/client_server_mapping_distributed.cpp	(revision 1537)
@@ -35,10 +35,8 @@
    Compute mapping global index of server which client sends to.
    \param [in] globalIndexOnClient global index client has
+   \param [in] nbServer size of server's intracomm
 */
-void CClientServerMappingDistributed::computeServerIndexMapping(const CArray<size_t,1>& globalIndexOnClient)
+void CClientServerMappingDistributed::computeServerIndexMapping(const CArray<size_t,1>& globalIndexOnClient, int nbServer)
 {
-  CContext* context=CContext::getCurrent() ;
-  CContextClient* client=context->client ;
-  int nbServer=client->serverSize;
 
   ccDHT_->computeIndexInfoMapping(globalIndexOnClient);
Index: /XIOS/trunk/src/client_server_mapping_distributed.hpp
===================================================================
--- /XIOS/trunk/src/client_server_mapping_distributed.hpp	(revision 1536)
+++ /XIOS/trunk/src/client_server_mapping_distributed.hpp	(revision 1537)
@@ -38,5 +38,5 @@
                                     bool isDataDistributed = true);
 
-    virtual void computeServerIndexMapping(const CArray<size_t,1>& globalIndexOnClientSendToServer);
+    virtual void computeServerIndexMapping(const CArray<size_t,1>& globalIndexOnClientSendToServer, int nbServer);
 
     /** Default destructor */
Index: /XIOS/trunk/src/config/axis_attribute.conf
===================================================================
--- /XIOS/trunk/src/config/axis_attribute.conf	(revision 1536)
+++ /XIOS/trunk/src/config/axis_attribute.conf	(revision 1537)
@@ -3,8 +3,18 @@
 DECLARE_ATTRIBUTE(StdString, long_name)
 
+DECLARE_ATTRIBUTE(StdString, comment)
+
 DECLARE_ATTRIBUTE(StdString, unit)
+DECLARE_ATTRIBUTE(StdString, formula)
+DECLARE_ATTRIBUTE(StdString, formula_term)
+DECLARE_ATTRIBUTE(StdString, formula_bounds)
+DECLARE_ATTRIBUTE(StdString, formula_term_bounds)
+DECLARE_ATTRIBUTE(StdString, bounds_name)
 
 DECLARE_ATTRIBUTE(int,       n_glo)
 DECLARE_ENUM2(positive, up, down)
+DECLARE_ENUM4(axis_type, X, Y, Z, T)
+
+DECLARE_ATTRIBUTE(StdString, dim_name)
 
 /* GLOBAL */
Index: /XIOS/trunk/src/config/axis_attribute_private.conf
===================================================================
--- /XIOS/trunk/src/config/axis_attribute_private.conf	(revision 1536)
+++ /XIOS/trunk/src/config/axis_attribute_private.conf	(revision 1537)
@@ -2,2 +2,7 @@
 DECLARE_ATTRIBUTE_PRIVATE(int, global_zoom_n)
 DECLARE_ARRAY_PRIVATE(int,  1, global_zoom_index)
+
+/* LOCAL DATA*/
+DECLARE_ARRAY_PRIVATE(int    ,   1 , zoom_index)
+DECLARE_ATTRIBUTE_PRIVATE(int, zoom_begin)
+DECLARE_ATTRIBUTE_PRIVATE(int, zoom_n)
Index: /XIOS/trunk/src/config/calendar_wrapper_attribute.conf
===================================================================
--- /XIOS/trunk/src/config/calendar_wrapper_attribute.conf	(revision 1536)
+++ /XIOS/trunk/src/config/calendar_wrapper_attribute.conf	(revision 1537)
@@ -1,2 +1,3 @@
+DECLARE_ATTRIBUTE(StdString, comment)
 DECLARE_ENUM6(type, D360, AllLeap, NoLeap, Julian, Gregorian, user_defined)
 DECLARE_ATTRIBUTE(CDuration, timestep)
Index: /XIOS/trunk/src/config/domain_attribute.conf
===================================================================
--- /XIOS/trunk/src/config/domain_attribute.conf	(revision 1536)
+++ /XIOS/trunk/src/config/domain_attribute.conf	(revision 1537)
@@ -3,4 +3,12 @@
 DECLARE_ATTRIBUTE(StdString       , standard_name)
 DECLARE_ATTRIBUTE(StdString       , long_name)
+DECLARE_ATTRIBUTE(StdString       , lon_name)
+DECLARE_ATTRIBUTE(StdString       , lat_name)
+DECLARE_ATTRIBUTE(StdString       , bounds_lon_name)
+DECLARE_ATTRIBUTE(StdString       , bounds_lat_name)
+DECLARE_ATTRIBUTE(StdString       , dim_i_name)
+DECLARE_ATTRIBUTE(StdString       , dim_j_name)
+
+DECLARE_ATTRIBUTE(StdString, comment)
 
 /* GLOBAL */
@@ -9,18 +17,18 @@
 
 /* LOCAL */
-DECLARE_ATTRIBUTE(int             , ibegin)
-DECLARE_ATTRIBUTE(int             , ni)
+DECLARE_ATTRIBUTE(int             , ibegin, false)
+DECLARE_ATTRIBUTE(int             , ni, false)
 
 /* LOCAL */
-DECLARE_ATTRIBUTE(int             , jbegin)
-DECLARE_ATTRIBUTE(int             , nj)
+DECLARE_ATTRIBUTE(int             , jbegin, false)
+DECLARE_ATTRIBUTE(int             , nj, false)
 
 
-DECLARE_ARRAY(int,1             , i_index)
-DECLARE_ARRAY(int,1             , j_index)
+DECLARE_ARRAY(int,1             , i_index, false)
+DECLARE_ARRAY(int,1             , j_index, false)
 
 /* LOCAL */
-DECLARE_ARRAY(bool, 1 , mask_1d)
-DECLARE_ARRAY(bool, 2 , mask_2d)
+DECLARE_ARRAY(bool, 1 , mask_1d, false)
+DECLARE_ARRAY(bool, 2 , mask_2d, false)
 
 /* GLOBAL */
@@ -28,24 +36,24 @@
 
 /* LOCAL */
-DECLARE_ATTRIBUTE(int             , data_ni)
-DECLARE_ATTRIBUTE(int             , data_nj)
-DECLARE_ATTRIBUTE(int             , data_ibegin)
-DECLARE_ATTRIBUTE(int             , data_jbegin)
+DECLARE_ATTRIBUTE(int             , data_ni, false)
+DECLARE_ATTRIBUTE(int             , data_nj, false)
+DECLARE_ATTRIBUTE(int             , data_ibegin, false)
+DECLARE_ATTRIBUTE(int             , data_jbegin, false)
 
 /* LOCAL */
-DECLARE_ARRAY(int, 1 , data_i_index)
-DECLARE_ARRAY(int, 1,  data_j_index)
+DECLARE_ARRAY(int, 1 , data_i_index, false)
+DECLARE_ARRAY(int, 1,  data_j_index, false)
 
 /* LOCAL */
-DECLARE_ARRAY(double, 1, lonvalue_1d)
-DECLARE_ARRAY(double, 1, latvalue_1d)
-DECLARE_ARRAY(double, 2, lonvalue_2d)
-DECLARE_ARRAY(double, 2, latvalue_2d)
+DECLARE_ARRAY(double, 1, lonvalue_1d, false)
+DECLARE_ARRAY(double, 1, latvalue_1d, false)
+DECLARE_ARRAY(double, 2, lonvalue_2d, false)
+DECLARE_ARRAY(double, 2, latvalue_2d, false)
 
 DECLARE_ATTRIBUTE(int, nvertex)
-DECLARE_ARRAY(double, 2, bounds_lon_1d)
-DECLARE_ARRAY(double, 2, bounds_lat_1d)
-DECLARE_ARRAY(double, 3, bounds_lon_2d)
-DECLARE_ARRAY(double, 3, bounds_lat_2d)
+DECLARE_ARRAY(double, 2, bounds_lon_1d, false)
+DECLARE_ARRAY(double, 2, bounds_lat_1d, false)
+DECLARE_ARRAY(double, 3, bounds_lon_2d, false)
+DECLARE_ARRAY(double, 3, bounds_lat_2d, false)
 
 DECLARE_ARRAY(double, 2, area)
Index: /XIOS/trunk/src/config/domain_attribute_private.conf
===================================================================
--- /XIOS/trunk/src/config/domain_attribute_private.conf	(revision 1536)
+++ /XIOS/trunk/src/config/domain_attribute_private.conf	(revision 1537)
@@ -10,9 +10,9 @@
 DECLARE_ATTRIBUTE_PRIVATE(double,  bounds_lat_end)
 
-// Array contain whole value (non distributed) of longitude and latitude of rectilinear read from a file
+//  Array contain whole value (non distributed) of longitude and latitude read from a file
 DECLARE_ARRAY_PRIVATE(double, 1, lonvalue_rectilinear_read_from_file)
 DECLARE_ARRAY_PRIVATE(double, 1, latvalue_rectilinear_read_from_file)
 
-// Array contain whole value (non distributed) of longitude and latitude of curvilinear read from a file
+// Array containing longitude and latitude of LOCAL curvilinear domain to be read from a file
 DECLARE_ARRAY_PRIVATE(double, 2, lonvalue_curvilinear_read_from_file)
 DECLARE_ARRAY_PRIVATE(double, 2, latvalue_curvilinear_read_from_file)
@@ -20,5 +20,5 @@
 DECLARE_ARRAY_PRIVATE(double, 3, bounds_latvalue_curvilinear_read_from_file)
 
-// Array contain whole value (non distributed) of longitude and latitude of unstructured read from a file
+// Array containing longitude and latitude of LOCAL unstructured domain to be read from a file
 DECLARE_ARRAY_PRIVATE(double, 1, lonvalue_unstructured_read_from_file)
 DECLARE_ARRAY_PRIVATE(double, 1, latvalue_unstructured_read_from_file)
@@ -30,2 +30,12 @@
 DECLARE_ATTRIBUTE_PRIVATE(int,  global_zoom_jbegin)
 DECLARE_ATTRIBUTE_PRIVATE(int,  global_zoom_nj)
+
+// Local zoom information
+DECLARE_ATTRIBUTE_PRIVATE(int,  zoom_ibegin)
+DECLARE_ATTRIBUTE_PRIVATE(int,  zoom_ni)
+DECLARE_ATTRIBUTE_PRIVATE(int,  zoom_jbegin)
+DECLARE_ATTRIBUTE_PRIVATE(int,  zoom_nj)
+
+
+DECLARE_ARRAY_PRIVATE(int    ,   1 , zoom_i_index, false)
+DECLARE_ARRAY_PRIVATE(int    ,   1 , zoom_j_index, false)
Index: /XIOS/trunk/src/config/field_attribute.conf
===================================================================
--- /XIOS/trunk/src/config/field_attribute.conf	(revision 1536)
+++ /XIOS/trunk/src/config/field_attribute.conf	(revision 1537)
@@ -2,4 +2,6 @@
 DECLARE_ATTRIBUTE(StdString, standard_name)
 DECLARE_ATTRIBUTE(StdString, long_name)
+
+DECLARE_ATTRIBUTE(StdString, comment)
 
 DECLARE_ATTRIBUTE(StdString, unit)
@@ -18,7 +20,7 @@
 DECLARE_ATTRIBUTE(bool,      check_if_active)
 
-DECLARE_ATTRIBUTE(StdString, domain_ref)
-DECLARE_ATTRIBUTE(StdString, axis_ref)
-DECLARE_ATTRIBUTE(StdString, scalar_ref)
+DECLARE_ATTRIBUTE(StdString, domain_ref, false)
+DECLARE_ATTRIBUTE(StdString, axis_ref, false)
+DECLARE_ATTRIBUTE(StdString, scalar_ref, false)
 DECLARE_ATTRIBUTE(StdString, grid_ref)
 DECLARE_ATTRIBUTE(StdString, field_ref)
Index: /XIOS/trunk/src/config/file_attribute.conf
===================================================================
--- /XIOS/trunk/src/config/file_attribute.conf	(revision 1536)
+++ /XIOS/trunk/src/config/file_attribute.conf	(revision 1537)
@@ -1,4 +1,6 @@
 DECLARE_ATTRIBUTE(StdString, name)
 DECLARE_ATTRIBUTE(StdString, description)
+
+DECLARE_ATTRIBUTE(StdString, comment)
 
 DECLARE_ATTRIBUTE(StdString, name_suffix)
@@ -21,9 +23,10 @@
 DECLARE_ATTRIBUTE(bool,      append)
 DECLARE_ENUM2(mode,          read, write)
+DECLARE_ATTRIBUTE(bool,      read_metadata_par)
 DECLARE_ENUM7(time_counter,  centered, instant, record, exclusive, centered_exclusive, instant_exclusive, none)
 DECLARE_ATTRIBUTE(StdString, time_counter_name)
 DECLARE_ENUM2(time_units, seconds, days)
 DECLARE_ATTRIBUTE(int,       record_offset)
-DECLARE_ATTRIBUTE(bool,       cyclic)
+DECLARE_ATTRIBUTE(bool,      cyclic)
 
 DECLARE_ATTRIBUTE(int,       compression_level)
Index: /XIOS/trunk/src/config/grid_attribute.conf
===================================================================
--- /XIOS/trunk/src/config/grid_attribute.conf	(revision 1536)
+++ /XIOS/trunk/src/config/grid_attribute.conf	(revision 1537)
@@ -2,12 +2,16 @@
 DECLARE_ATTRIBUTE(StdString, description)
 
-DECLARE_ARRAY(bool, 1, mask_1d)
-DECLARE_ARRAY(bool, 2, mask_2d)
-DECLARE_ARRAY(bool, 3, mask_3d)
-DECLARE_ARRAY(bool, 4, mask_4d)
-DECLARE_ARRAY(bool, 5, mask_5d)
-DECLARE_ARRAY(bool, 6, mask_6d)
-DECLARE_ARRAY(bool, 7, mask_7d)
+DECLARE_ATTRIBUTE(StdString, comment)
 
+DECLARE_ARRAY(bool, 1, mask_1d, false)
+DECLARE_ARRAY(bool, 2, mask_2d, false)
+DECLARE_ARRAY(bool, 3, mask_3d, false)
+DECLARE_ARRAY(bool, 4, mask_4d, false)
+DECLARE_ARRAY(bool, 5, mask_5d, false)
+DECLARE_ARRAY(bool, 6, mask_6d, false)
+DECLARE_ARRAY(bool, 7, mask_7d, false)
+
+// Meaningless, only server for coherent purpose (for scalar grid)
+DECLARE_ARRAY(bool, 1, mask_0d, false)
 
 // An array contains order of axis and domains composing of the grid
Index: /XIOS/trunk/src/config/interpolate_domain_attribute.conf
===================================================================
--- /XIOS/trunk/src/config/interpolate_domain_attribute.conf	(revision 1536)
+++ /XIOS/trunk/src/config/interpolate_domain_attribute.conf	(revision 1537)
@@ -3,4 +3,5 @@
 DECLARE_ATTRIBUTE(bool, renormalize)
 DECLARE_ATTRIBUTE(bool, quantity)
+DECLARE_ATTRIBUTE(bool, detect_missing_value)
 
 /* Write interpolation weights into file */
@@ -8,2 +9,3 @@
 DECLARE_ATTRIBUTE(StdString, weight_filename)
 DECLARE_ATTRIBUTE(bool, write_weight)
+DECLARE_ENUM2(read_write_convention, c, fortran)
Index: /XIOS/trunk/src/config/node_type.conf
===================================================================
--- /XIOS/trunk/src/config/node_type.conf	(revision 1536)
+++ /XIOS/trunk/src/config/node_type.conf	(revision 1537)
@@ -67,4 +67,8 @@
 #endif //__XIOS_CReduceDomainToAxis__
 
+#ifdef __XIOS_CReduceAxisToAxis__
+   DECLARE_NODE(ReduceAxisToAxis, reduce_axis_to_axis)
+#endif //__XIOS_CReduceAxisToAxis__
+
 #ifdef __XIOS_CExtractDomainToAxis__
    DECLARE_NODE(ExtractDomainToAxis, extract_domain)
@@ -87,4 +91,20 @@
 #endif //__XIOS_CReduceDomainToScalar__
 
+#ifdef __XIOS_CTemporalSplitting__
+   DECLARE_NODE(TemporalSplitting, temporal_splitting)
+#endif //__XIOS_CTemporalSplitting__
+
+#ifdef __XIOS_CDuplicateScalarToAxis__
+   DECLARE_NODE(DuplicateScalarToAxis, duplicate_scalar_to_axis)
+#endif //__XIOS_CDuplicateScalarToAxis__
+
+#ifdef __XIOS_CReduceScalarToScalar__
+   DECLARE_NODE(ReduceScalarToScalar, reduce_scalar_to_scalar)
+#endif //__XIOS_CReduceScalarToScalar_
+
+#ifdef __XIOS_CReorderDomain__
+   DECLARE_NODE(ReorderDomain, reorder_domain)
+#endif //__XIOS_CReduceScalarToScalar_
+
 #ifdef __XIOS_CContext__
    DECLARE_NODE_PAR(Context, context)
Index: /XIOS/trunk/src/config/reduce_axis_to_axis_attribute.conf
===================================================================
--- /XIOS/trunk/src/config/reduce_axis_to_axis_attribute.conf	(revision 1537)
+++ /XIOS/trunk/src/config/reduce_axis_to_axis_attribute.conf	(revision 1537)
@@ -0,0 +1,1 @@
+DECLARE_ENUM4(operation, min, max, sum, average)
Index: /XIOS/trunk/src/config/reduce_domain_to_axis_attribute.conf
===================================================================
--- /XIOS/trunk/src/config/reduce_domain_to_axis_attribute.conf	(revision 1536)
+++ /XIOS/trunk/src/config/reduce_domain_to_axis_attribute.conf	(revision 1537)
@@ -3,2 +3,3 @@
 /* Direction to apply operation (i, j) */
 DECLARE_ENUM2(direction,  iDir, jDir)
+DECLARE_ATTRIBUTE(bool, local)
Index: /XIOS/trunk/src/config/reduce_domain_to_scalar_attribute.conf
===================================================================
--- /XIOS/trunk/src/config/reduce_domain_to_scalar_attribute.conf	(revision 1536)
+++ /XIOS/trunk/src/config/reduce_domain_to_scalar_attribute.conf	(revision 1537)
@@ -1,1 +1,2 @@
 DECLARE_ENUM4(operation, min, max, sum, average)
+DECLARE_ATTRIBUTE(bool, local)
Index: /XIOS/trunk/src/config/reduce_scalar_to_scalar_attribute.conf
===================================================================
--- /XIOS/trunk/src/config/reduce_scalar_to_scalar_attribute.conf	(revision 1537)
+++ /XIOS/trunk/src/config/reduce_scalar_to_scalar_attribute.conf	(revision 1537)
@@ -0,0 +1,2 @@
+DECLARE_ENUM4(operation, min, max, sum, average)
+
Index: /XIOS/trunk/src/config/reorder_domain_attribute.conf
===================================================================
--- /XIOS/trunk/src/config/reorder_domain_attribute.conf	(revision 1537)
+++ /XIOS/trunk/src/config/reorder_domain_attribute.conf	(revision 1537)
@@ -0,0 +1,4 @@
+DECLARE_ATTRIBUTE(bool, invert_lat)
+DECLARE_ATTRIBUTE(double, shift_lon_fraction)
+DECLARE_ATTRIBUTE(double, min_lon)
+DECLARE_ATTRIBUTE(double, max_lon)
Index: /XIOS/trunk/src/config/scalar_attribute.conf
===================================================================
--- /XIOS/trunk/src/config/scalar_attribute.conf	(revision 1536)
+++ /XIOS/trunk/src/config/scalar_attribute.conf	(revision 1537)
@@ -2,4 +2,6 @@
 DECLARE_ATTRIBUTE(StdString, standard_name)
 DECLARE_ATTRIBUTE(StdString, long_name)
+
+DECLARE_ATTRIBUTE(StdString, comment)
 
 DECLARE_ATTRIBUTE(StdString, unit)
@@ -7,5 +9,11 @@
 /* LOCAL and GLOBAL*/
 DECLARE_ATTRIBUTE(double, value)
+DECLARE_ATTRIBUTE(StdString, bounds_name)
+DECLARE_ARRAY(double, 1 , bounds)
 
 DECLARE_ATTRIBUTE(StdString, scalar_ref)
 DECLARE_ATTRIBUTE(int, prec)
+
+DECLARE_ENUM4(axis_type, X, Y, Z, T)
+DECLARE_ENUM2(positive, up, down)
+DECLARE_ATTRIBUTE(StdString, label)
Index: /XIOS/trunk/src/context_client.cpp
===================================================================
--- /XIOS/trunk/src/context_client.cpp	(revision 1536)
+++ /XIOS/trunk/src/context_client.cpp	(revision 1537)
@@ -11,4 +11,5 @@
 #include "timer.hpp"
 #include "cxios.hpp"
+#include "server.hpp"
 
 namespace xios
@@ -18,5 +19,5 @@
     \param [in] intraComm_ communicator of group client
     \param [in] interComm_ communicator of group server
-    \cxtSer [in] cxtSer Pointer to context of server side. (It is only used on case of attached mode)
+    \cxtSer [in] cxtSer Pointer to context of server side. (It is only used in case of attached mode).
     */
     CContextClient::CContextClient(CContext* parent, MPI_Comm intraComm_, MPI_Comm interComm_, CContext* cxtSer)
@@ -34,4 +35,15 @@
       else  MPI_Comm_size(interComm, &serverSize);
 
+      computeLeader(clientRank, clientSize, serverSize, ranksServerLeader, ranksServerNotLeader);
+
+      timeLine = 0;
+    }
+
+    void CContextClient::computeLeader(int clientRank, int clientSize, int serverSize,
+                                       std::list<int>& rankRecvLeader,
+                                       std::list<int>& rankRecvNotLeader)
+    {
+      if ((0 == clientSize) || (0 == serverSize)) return;
+
       if (clientSize < serverSize)
       {
@@ -49,7 +61,7 @@
 
         for (int i = 0; i < serverByClient; i++)
-          ranksServerLeader.push_back(rankStart + i);
-
-        ranksServerNotLeader.resize(0);
+          rankRecvLeader.push_back(rankStart + i);
+
+        rankRecvNotLeader.resize(0);
       }
       else
@@ -61,7 +73,7 @@
         {
           if (clientRank % (clientByServer + 1) == 0)
-            ranksServerLeader.push_back(clientRank / (clientByServer + 1));
+            rankRecvLeader.push_back(clientRank / (clientByServer + 1));
           else
-            ranksServerNotLeader.push_back(clientRank / (clientByServer + 1));
+            rankRecvNotLeader.push_back(clientRank / (clientByServer + 1));
         }
         else
@@ -69,11 +81,9 @@
           int rank = clientRank - (clientByServer + 1) * remain;
           if (rank % clientByServer == 0)
-            ranksServerLeader.push_back(remain + rank / clientByServer);
+            rankRecvLeader.push_back(remain + rank / clientByServer);
           else
-            ranksServerNotLeader.push_back(remain + rank / clientByServer);
-        }        
-      }
-
-      timeLine = 0;
+            rankRecvNotLeader.push_back(remain + rank / clientByServer);
+        }
+      }
     }
 
@@ -86,11 +96,28 @@
       list<int> ranks = event.getRanks();
 
+      if (CXios::checkEventSync)
+      {
+        int typeId, classId, typeId_in, classId_in, timeLine_out;
+        typeId_in=event.getTypeId() ;
+        classId_in=event.getClassId() ;
+//        MPI_Allreduce(&timeLine,&timeLine_out, 1, MPI_UINT64_T, MPI_SUM, intraComm) ; // MPI_UINT64_T standardized by MPI 3
+        MPI_Allreduce(&timeLine,&timeLine_out, 1, MPI_LONG_LONG_INT, MPI_SUM, intraComm) ; 
+        MPI_Allreduce(&typeId_in,&typeId, 1, MPI_INT, MPI_SUM, intraComm) ;
+        MPI_Allreduce(&classId_in,&classId, 1, MPI_INT, MPI_SUM, intraComm) ;
+        if (typeId/clientSize!=event.getTypeId() || classId/clientSize!=event.getClassId() || timeLine_out/clientSize!=timeLine)
+        {
+           ERROR("void CContextClient::sendEvent(CEventClient& event)",
+               << "Event are not coherent between client.");
+        }
+      }
+
       if (!event.isEmpty())
       {
         list<int> sizes = event.getSizes();
 
-        // We force the getBuffers call to be non-blocking on the servers
+        // We force the getBuffers call to be non-blocking on classical servers
         list<CBufferOut*> buffList;
-        bool couldBuffer = getBuffers(ranks, sizes, buffList, !CXios::isClient);
+        bool couldBuffer = getBuffers(ranks, sizes, buffList, (!CXios::isClient && (CServer::serverLevel == 0) ));
+//        bool couldBuffer = getBuffers(ranks, sizes, buffList, CXios::isServer );
 
         if (couldBuffer)
@@ -113,5 +140,5 @@
           for (list<int>::const_iterator it = sizes.begin(); it != sizes.end(); it++)
             tmpBufferedEvent.buffers.push_back(new CBufferOut(*it));
-
+          info(100)<<"DEBUG : temporaly event created : timeline "<<timeLine<<endl ;
           event.send(timeLine, tmpBufferedEvent.sizes, tmpBufferedEvent.buffers);
         }
@@ -140,4 +167,5 @@
             (*itBuffer)->put((char*)(*it)->start(), (*it)->count());
 
+          info(100)<<"DEBUG : temporaly event sent "<<endl ;
           checkBuffers(tmpBufferedEvent.ranks);
 
@@ -181,5 +209,6 @@
      * \return whether the already allocated buffers could be used
     */
-    bool CContextClient::getBuffers(const list<int>& serverList, const list<int>& sizeList, list<CBufferOut*>& retBuffers, bool nonBlocking /*= false*/)
+    bool CContextClient::getBuffers(const list<int>& serverList, const list<int>& sizeList, list<CBufferOut*>& retBuffers,
+                                    bool nonBlocking /*= false*/)
     {
       list<int>::const_iterator itServer, itSize;
@@ -210,7 +239,21 @@
         {
           checkBuffers();
-          context->server->listen();
+          if (CServer::serverLevel == 0)
+            context->server->listen();
+
+          else if (CServer::serverLevel == 1)
+          {
+            context->server->listen();
+            for (int i = 0; i < context->serverPrimServer.size(); ++i)
+              context->serverPrimServer[i]->listen();
+            CServer::contextEventLoop(false) ; // avoid dead-lock at finalize...
+          }
+
+          else if (CServer::serverLevel == 2)
+            context->server->listen();
+
         }
       } while (!areBuffersFree && !nonBlocking);
+
       CTimer::get("Blocking time").suspend();
 
@@ -251,13 +294,18 @@
       map<int,CClientBuffer*>::iterator itBuff;
       bool pending = false;
-      for (itBuff = buffers.begin(); itBuff != buffers.end(); itBuff++) pending |= itBuff->second->checkBuffer();
+      for (itBuff = buffers.begin(); itBuff != buffers.end(); itBuff++)
+        pending |= itBuff->second->checkBuffer();
       return pending;
    }
 
    //! Release all buffers
-   void CContextClient::releaseBuffers(void)
+   void CContextClient::releaseBuffers()
    {
       map<int,CClientBuffer*>::iterator itBuff;
-      for (itBuff = buffers.begin(); itBuff != buffers.end(); itBuff++) delete itBuff->second;
+      for (itBuff = buffers.begin(); itBuff != buffers.end(); itBuff++)
+      {
+          delete itBuff->second;
+      }
+      buffers.clear();
    }
 
@@ -355,54 +403,72 @@
 
    /*!
-   Finalize context client and do some reports
-   */
-   void CContextClient::finalize(void)
-   {
-     map<int,CClientBuffer*>::iterator itBuff;
-     bool stop = false;
-
-     CTimer::get("Blocking time").resume();
-     while (hasTemporarilyBufferedEvent())
-     {
-       checkBuffers();
-       sendTemporarilyBufferedEvent();
-     }
-     CTimer::get("Blocking time").suspend();
-
-     CEventClient event(CContext::GetType(), CContext::EVENT_ID_CONTEXT_FINALIZE);
-     if (isServerLeader())
-     {
-       CMessage msg;
-       const std::list<int>& ranks = getRanksServerLeader();
-       for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
-         event.push(*itRank, 1, msg);
-       sendEvent(event);
-     }
-     else sendEvent(event);
-
-     CTimer::get("Blocking time").resume();
-     while (!stop)
-     {
-       checkBuffers();
-       if (hasTemporarilyBufferedEvent())
-         sendTemporarilyBufferedEvent();
-
-       stop = true;
-       for (itBuff = buffers.begin(); itBuff != buffers.end(); itBuff++) stop &= !itBuff->second->hasPendingRequest();
-     }
-     CTimer::get("Blocking time").suspend();
-
-     std::map<int,StdSize>::const_iterator itbMap = mapBufferSize_.begin(),
-                                           iteMap = mapBufferSize_.end(), itMap;
-     StdSize totalBuf = 0;
-     for (itMap = itbMap; itMap != iteMap; ++itMap)
-     {
-       report(10) << " Memory report : Context <" << context->getId() << "> : client side : memory used for buffer of each connection to server" << endl
-                  << "  +) To server with rank " << itMap->first << " : " << itMap->second << " bytes " << endl;
-       totalBuf += itMap->second;
-     }
-     report(0) << " Memory report : Context <" << context->getId() << "> : client side : total memory used for buffer " << totalBuf << " bytes" << endl;
-
-     releaseBuffers();
-   }
+   * Finalize context client and do some reports. Function is non-blocking.
+   */
+  void CContextClient::finalize(void)
+  {
+    map<int,CClientBuffer*>::iterator itBuff;
+    bool stop = false;
+
+    CTimer::get("Blocking time").resume();
+    while (hasTemporarilyBufferedEvent())
+    {
+      checkBuffers();
+      sendTemporarilyBufferedEvent();
+    }
+    CTimer::get("Blocking time").suspend();
+
+    CEventClient event(CContext::GetType(), CContext::EVENT_ID_CONTEXT_FINALIZE);
+    if (isServerLeader())
+    {
+      CMessage msg;
+      const std::list<int>& ranks = getRanksServerLeader();
+      for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
+      {
+        info(100)<<"DEBUG : Sent context Finalize event to rank "<<*itRank<<endl ;
+        event.push(*itRank, 1, msg);
+      }
+      sendEvent(event);
+    }
+    else sendEvent(event);
+
+    CTimer::get("Blocking time").resume();
+//    while (!stop)
+    {
+      checkBuffers();
+      if (hasTemporarilyBufferedEvent())
+        sendTemporarilyBufferedEvent();
+
+      stop = true;
+//      for (itBuff = buffers.begin(); itBuff != buffers.end(); itBuff++) stop &= !itBuff->second->hasPendingRequest();
+    }
+    CTimer::get("Blocking time").suspend();
+
+    std::map<int,StdSize>::const_iterator itbMap = mapBufferSize_.begin(),
+                                          iteMap = mapBufferSize_.end(), itMap;
+
+    StdSize totalBuf = 0;
+    for (itMap = itbMap; itMap != iteMap; ++itMap)
+    {
+      report(10) << " Memory report : Context <" << context->getId() << "> : client side : memory used for buffer of each connection to server" << endl
+                 << "  +) To server with rank " << itMap->first << " : " << itMap->second << " bytes " << endl;
+      totalBuf += itMap->second;
+    }
+    report(0) << " Memory report : Context <" << context->getId() << "> : client side : total memory used for buffer " << totalBuf << " bytes" << endl;
+
+    //releaseBuffers(); // moved to CContext::finalize()
+  }
+
+
+  /*!
+  */
+  bool CContextClient::havePendingRequests(void)
+  {
+    bool pending = false;
+    map<int,CClientBuffer*>::iterator itBuff;
+    for (itBuff = buffers.begin(); itBuff != buffers.end(); itBuff++)
+      pending |= itBuff->second->hasPendingRequest();
+    return pending;
+  }
+
+
 }
Index: /XIOS/trunk/src/context_client.hpp
===================================================================
--- /XIOS/trunk/src/context_client.hpp	(revision 1536)
+++ /XIOS/trunk/src/context_client.hpp	(revision 1537)
@@ -40,4 +40,5 @@
       bool checkBuffers(void);
       void releaseBuffers(void);
+      bool havePendingRequests(void);
 
       bool isServerLeader(void) const;
@@ -47,9 +48,12 @@
 
       bool isAttachedModeEnabled() const;
-
       bool hasTemporarilyBufferedEvent() const { return !tmpBufferedEvent.isEmpty(); };
 
+      static void computeLeader(int clientRank, int clientSize, int serverSize,
+                                std::list<int>& rankRecvLeader,
+                                std::list<int>& rankRecvNotLeader);
+
       // Close and finalize context client
-      void closeContext(void);
+//      void closeContext(void);  Never been implemented.
       void finalize(void);
 
@@ -106,10 +110,4 @@
       std::list<int> ranksServerNotLeader;
 
-    public: // Some function should be removed in the future
-      //    void registerEvent(CEventClient& event);
-//    list<CBufferOut*> newEvent(CEventClient& event,list<int>& sizes);
-//    bool locked;
-//    set<int> connectedServer;
-
   };
 }
Index: /XIOS/trunk/src/context_server.cpp
===================================================================
--- /XIOS/trunk/src/context_server.cpp	(revision 1536)
+++ /XIOS/trunk/src/context_server.cpp	(revision 1537)
@@ -29,4 +29,5 @@
     MPI_Comm_size(intraComm,&intraCommSize);
     MPI_Comm_rank(intraComm,&intraCommRank);
+
     interComm=interComm_;
     int flag;
@@ -34,12 +35,15 @@
     if (flag) MPI_Comm_remote_size(interComm,&commSize);
     else  MPI_Comm_size(interComm,&commSize);
+
     currentTimeLine=0;
     scheduled=false;
     finished=false;
-
     boost::hash<string> hashString;
-    hashId=hashString(context->getId());
-
-  }
+    if (CServer::serverLevel == 1)
+      hashId=hashString(context->getId() + boost::lexical_cast<string>(context->clientPrimServer.size()));
+    else
+      hashId=hashString(context->getId());
+  }
+
   void CContextServer::setPendingEvent(void)
   {
@@ -128,9 +132,10 @@
          bufferRequest[rank]=addr;
          return true;
-      }
+       }
       else
         return false;
     }
   }
+
 
   void CContextServer::checkPendingRequest(void)
@@ -174,4 +179,5 @@
     map<size_t,CEventServer*>::iterator it;
 
+    CTimer::get("Process request").resume();
     while(count>0)
     {
@@ -187,5 +193,5 @@
       count=buffer.remain();
     }
-
+    CTimer::get("Process request").suspend();
   }
 
@@ -233,5 +239,4 @@
   }
 
-
   void CContextServer::dispatchEvent(CEventServer& event)
   {
@@ -241,21 +246,23 @@
     int rank;
     list<CEventServer::SSubEvent>::iterator it;
-    CContext::setCurrent(context->getId());
+    StdString ctxId = context->getId();
+    CContext::setCurrent(ctxId);
+    StdSize totalBuf = 0;
 
     if (event.classId==CContext::GetType() && event.type==CContext::EVENT_ID_CONTEXT_FINALIZE)
     {
       finished=true;
-      info(20)<<"Server Side context <"<<context->getId()<<"> finalized"<<endl;
+      info(20)<<" CContextServer: Receive context <"<<context->getId()<<"> finalize."<<endl;
+      context->finalize();
       std::map<int, StdSize>::const_iterator itbMap = mapBufferSize_.begin(),
-                                             iteMap = mapBufferSize_.end(), itMap;
-      StdSize totalBuf = 0;
+                           iteMap = mapBufferSize_.end(), itMap;
       for (itMap = itbMap; itMap != iteMap; ++itMap)
       {
-        report(10)<< " Memory report : Context <"<<context->getId()<<"> : server side : memory used for buffer of each connection to client" << endl
-                  << "  +) With client of rank " << itMap->first << " : " << itMap->second << " bytes " << endl;
+        rank = itMap->first;
+        report(10)<< " Memory report : Context <"<<ctxId<<"> : server side : memory used for buffer of each connection to client" << endl
+            << "  +) With client of rank " << rank << " : " << itMap->second << " bytes " << endl;
         totalBuf += itMap->second;
       }
-      context->finalize();
-      report(0)<< " Memory report : Context <"<<context->getId()<<"> : server side : total memory used for buffer "<<totalBuf<<" bytes"<<endl;
+      report(0)<< " Memory report : Context <"<<ctxId<<"> : server side : total memory used for buffer "<<totalBuf<<" bytes"<<endl;
     }
     else if (event.classId==CContext::GetType()) CContext::dispatchEvent(event);
Index: /XIOS/trunk/src/context_server.hpp
===================================================================
--- /XIOS/trunk/src/context_server.hpp	(revision 1536)
+++ /XIOS/trunk/src/context_server.hpp	(revision 1537)
@@ -17,12 +17,12 @@
     bool eventLoop(bool enableEventsProcessing = true);
     void listen(void) ;
-    bool listenPendingRequest(MPI_Status& status);
+    bool listenPendingRequest(MPI_Status& status) ;
     void checkPendingRequest(void) ;
     void processRequest(int rank, char* buff,int count) ;
     void processEvents(void) ;
+    bool hasFinished(void);
     void dispatchEvent(CEventServer& event) ;
     void setPendingEvent(void) ;
     bool hasPendingEvent(void) ;
-    bool hasFinished(void);
 
     MPI_Comm intraComm ;
@@ -45,4 +45,5 @@
     bool scheduled  ;    /*!< event of current timeline is alreading scheduled ? */
     size_t hashId ;
+
     ~CContextServer() ;
 
Index: /XIOS/trunk/src/cxios.cpp
===================================================================
--- /XIOS/trunk/src/cxios.cpp	(revision 1536)
+++ /XIOS/trunk/src/cxios.cpp	(revision 1537)
@@ -18,4 +18,6 @@
   string CXios::clientFile="./xios_client";
   string CXios::serverFile="./xios_server";
+  string CXios::serverPrmFile="./xios_server1";
+  string CXios::serverSndFile="./xios_server2";
 
   bool CXios::isClient ;
@@ -24,12 +26,17 @@
   bool CXios::usingOasis ;
   bool CXios::usingServer = false;
+  bool CXios::usingServer2 = false;
+  int CXios::ratioServer2 = 50;
+  int CXios::nbPoolsServer2 = 1;
   double CXios::bufferSizeFactor = 1.0;
   const double CXios::defaultBufferSizeFactor = 1.0;
   StdSize CXios::minBufferSize = 1024 * sizeof(double);
+  StdSize CXios::maxBufferSize = std::numeric_limits<int>::max() ;
   bool CXios::printLogs2Files;
   bool CXios::isOptPerformance = true;
   CRegistry* CXios::globalRegistry = 0;
-  double CXios::recvFieldTimeout = 10.0;
-
+  double CXios::recvFieldTimeout = 300.0;
+  bool CXios::checkEventSync=false ;
+ 
   //! Parse configuration file and create some objects from it
   void CXios::initialize()
@@ -48,4 +55,7 @@
     usingOasis=getin<bool>("using_oasis",false) ;
     usingServer=getin<bool>("using_server",false) ;
+    usingServer2=getin<bool>("using_server2",false) ;
+    ratioServer2=getin<int>("ratio_server2",50);
+    nbPoolsServer2=getin<int>("number_pools_server2",0);
     info.setLevel(getin<int>("info_level",0)) ;
     report.setLevel(getin<int>("info_level",50));
@@ -64,7 +74,10 @@
     bufferSizeFactor = getin<double>("buffer_size_factor", defaultBufferSizeFactor);
     minBufferSize = getin<int>("min_buffer_size", 1024 * sizeof(double));
-    recvFieldTimeout = getin<double>("recv_field_timeout", 10.0);
+    maxBufferSize = getin<int>("max_buffer_size", std::numeric_limits<int>::max());
+    recvFieldTimeout = getin<double>("recv_field_timeout", recvFieldTimeout);
     if (recvFieldTimeout < 0.0)
       ERROR("CXios::parseXiosConfig()", "recv_field_timeout cannot be negative.");
+
+    checkEventSync = getin<bool>("check_event_sync", checkEventSync);
 
     globalComm=MPI_COMM_WORLD ;
@@ -148,10 +161,23 @@
     // Initialize all aspects MPI
     CServer::initialize();
-    if (CServer::getRank()==0) globalRegistry = new CRegistry(CServer::intraComm) ;
+    if (CServer::getRank()==0 && CServer::serverLevel != 1) globalRegistry = new CRegistry(CServer::intraComm) ;
     
     if (printLogs2Files)
     {
-      CServer::openInfoStream(serverFile);
-      CServer::openErrorStream(serverFile);
+      if (CServer::serverLevel == 0)
+      {
+        CServer::openInfoStream(serverFile);
+        CServer::openErrorStream(serverFile);
+      }
+      else if (CServer::serverLevel == 1)
+      {
+        CServer::openInfoStream(serverPrmFile);
+        CServer::openErrorStream(serverPrmFile);
+      }
+      else
+      {
+        CServer::openInfoStream(serverSndFile);
+        CServer::openErrorStream(serverSndFile);
+      }
     }
     else
@@ -165,10 +191,72 @@
 
     // Finalize
-     if (CServer::getRank()==0)
-     {
-       info(80)<<"Write data base Registry"<<endl<<globalRegistry->toString()<<endl ;
-       globalRegistry->toFile("xios_registry.bin") ;
-       delete globalRegistry ;
-     }
+    if (CServer::serverLevel == 0)
+    {
+      if (CServer::getRank()==0)
+      {
+        info(80)<<"Write data base Registry"<<endl<<globalRegistry->toString()<<endl ;
+        globalRegistry->toFile("xios_registry.bin") ;
+        delete globalRegistry ;
+      }
+    }
+    else
+    {
+      // If using two server levels:
+      // (1) merge registries on each pool
+      // (2) send merged registries to the first pool
+      // (3) merge received registries on the first pool
+      if (CServer::serverLevel == 2)
+      {
+        vector<int>& secondaryServerGlobalRanks = CServer::getSecondaryServerGlobalRanks();
+        int firstPoolGlobalRank = secondaryServerGlobalRanks[0];
+        int rankGlobal;
+        MPI_Comm_rank(globalComm, &rankGlobal);
+
+        // Merge registries defined on each pools
+        CRegistry globalRegistrySndServers (CServer::intraComm);
+
+        // All pools (except the first): send globalRegistry to the first pool
+        for (int i=1; i<secondaryServerGlobalRanks.size(); i++)
+        {
+          if (rankGlobal == secondaryServerGlobalRanks[i])
+          {
+            globalRegistrySndServers.mergeRegistry(*globalRegistry) ;
+            int registrySize = globalRegistrySndServers.size();
+            MPI_Send(&registrySize,1,MPI_LONG,firstPoolGlobalRank,15,CXios::globalComm) ;
+            CBufferOut buffer(registrySize) ;
+            globalRegistrySndServers.toBuffer(buffer) ;
+            MPI_Send(buffer.start(),registrySize,MPI_CHAR,firstPoolGlobalRank,15,CXios::globalComm) ;
+          }
+        }
+
+        // First pool: receive globalRegistry of all secondary server pools, merge and write the resultant registry
+        if (rankGlobal == firstPoolGlobalRank)
+        {
+          MPI_Status status;
+          char* recvBuff;
+
+          globalRegistrySndServers.mergeRegistry(*globalRegistry) ;
+
+          for (int i=1; i< secondaryServerGlobalRanks.size(); i++)
+          {
+            int rank = secondaryServerGlobalRanks[i];
+            int registrySize = 0;
+            MPI_Recv(&registrySize, 1, MPI_LONG, rank, 15, CXios::globalComm, &status);
+            recvBuff = new char[registrySize];
+            MPI_Recv(recvBuff, registrySize, MPI_CHAR, rank, 15, CXios::globalComm, &status);
+            CBufferIn buffer(recvBuff, registrySize) ;
+            CRegistry recvRegistry;
+            recvRegistry.fromBuffer(buffer) ;
+            globalRegistrySndServers.mergeRegistry(recvRegistry) ;
+            delete[] recvBuff;
+          }
+
+          info(80)<<"Write data base Registry"<<endl<<globalRegistrySndServers.toString()<<endl ;
+          globalRegistrySndServers.toFile("xios_registry.bin") ;
+
+        }
+      }
+      delete globalRegistry;
+    }
     CServer::finalize();
 
Index: /XIOS/trunk/src/cxios.hpp
===================================================================
--- /XIOS/trunk/src/cxios.hpp	(revision 1536)
+++ /XIOS/trunk/src/cxios.hpp	(revision 1537)
@@ -29,6 +29,8 @@
      static string rootFile ; //!< Configuration filename
      static string xiosCodeId ; //!< Identity for XIOS
-     static string clientFile; //!< Filename template for client
-     static string serverFile; //!< Filename template for server
+     static string clientFile;        //!< Filename template for client
+     static string serverFile;        //!< Filename template for server
+     static string serverPrmFile;  //!< Filename template for primary server in case of two server levels
+     static string serverSndFile;  //!< Filename template for secondary server in case of two server levels
 
      static bool isClient ; //!< Check if xios is client
@@ -38,12 +40,17 @@
 
      static bool printLogs2Files; //!< Printing out logs into files
-     static bool usingOasis ; //!< Using Oasis
-     static bool usingServer ; //!< Using server (server mode)
+     static bool usingOasis ;     //!< Using Oasis
+     static bool usingServer ;    //!< Using server (server mode)
+     static bool usingServer2 ;   //!< Using secondary server (server mode). IMPORTANT: Use this variable ONLY in CServer::initialize().
+     static int ratioServer2 ;    //!< Percentage of server processors dedicated to secondary server
+     static int nbPoolsServer2 ;  //!< Number of pools created on the secondary server
      static double bufferSizeFactor; //!< Factor used to tune the buffer size
      static const double defaultBufferSizeFactor; //!< Default factor value
      static StdSize minBufferSize; //!< Minimum buffer size
+     static StdSize maxBufferSize; //!< Maximum buffer size
      static bool isOptPerformance; //!< Check if buffer size is for performance (as large as possible)
      static CRegistry* globalRegistry ; //!< global registry which is wrote by the root process of the servers
      static double recvFieldTimeout; //!< Time to wait for data before issuing an error when receiving a field
+     static bool checkEventSync; //!< For debuuging, check if event are coherent and synchrone on client side
 
     public:
Index: /XIOS/trunk/src/date.cpp
===================================================================
--- /XIOS/trunk/src/date.cpp	(revision 1536)
+++ /XIOS/trunk/src/date.cpp	(revision 1537)
@@ -243,5 +243,4 @@
         if (this->month == nbMonthsPerYear + 1) { year++; this->month = 1; }
         if (this->month == 0)  { year--; this->month = nbMonthsPerYear; }
-
       }
 
Index: /XIOS/trunk/src/declare_attribute.hpp
===================================================================
--- /XIOS/trunk/src/declare_attribute.hpp	(revision 1536)
+++ /XIOS/trunk/src/declare_attribute.hpp	(revision 1537)
@@ -3,9 +3,9 @@
 
 /// ///////////////////////////// Macros ///////////////////////////// ///
-#define DECLARE_ATTRIBUTE(type, name)                             \
+#define DECLARE_ATTRIBUTE(type, name, ...)                        \
    class name##_attr : public CAttributeTemplate<type>            \
    {                                                              \
       public :                                                    \
-         name##_attr(void)                                          \
+         name##_attr(void)                                        \
             : CAttributeTemplate<type>                            \
             (#name, *CAttributeMap::Current)                      \
@@ -13,13 +13,15 @@
          type operator=(const type & value)                       \
          { return (CAttributeTemplate<type>::operator=(value)); } \
-         virtual ~name##_attr(void)                                 \
+         virtual bool doSend() const { return helper(__VA_ARGS__); }   \
+         bool helper(bool returnTrue=true) const { return returnTrue; }   \
+         virtual ~name##_attr(void)                               \
          { /* Ne rien faire de plus */ }                          \
    } name;
 
-#define DECLARE_ATTRIBUTE_PRIVATE(type, name)                    \
-   class name##_attr : public CAttributeTemplate<type>           \
+#define DECLARE_ATTRIBUTE_PRIVATE(type, name, ...)                \
+   class name##_attr : public CAttributeTemplate<type>            \
    {                                                              \
       public :                                                    \
-         name##_attr(void)                                          \
+         name##_attr(void)                                        \
             : CAttributeTemplate<type>                            \
             (#name, *CAttributeMap::Current)                      \
@@ -29,9 +31,11 @@
          virtual bool isPublic() const                            \
          { return false; }                                        \
+         virtual bool doSend() const { return helper(__VA_ARGS__); }   \
+         bool helper(bool returnTrue=true) const { return returnTrue; }   \
          virtual ~name##_attr(void)                               \
          { /* Ne rien faire de plus */ }                          \
    } name;
 
-#define DECLARE_ARRAY(T_num, T_rank, name)                        \
+#define DECLARE_ARRAY(T_num, T_rank, name, ...)                   \
    class name##_attr : public CAttributeArray<T_num, T_rank>      \
    {                                                              \
@@ -39,8 +43,10 @@
          using CAttributeArray<T_num, T_rank>::operator = ;       \
          name##_attr(void) : CAttributeArray<T_num, T_rank> (#name, *CAttributeMap::Current) {} \
+         virtual bool doSend() const { return helper(__VA_ARGS__); }   \
+         bool helper(bool returnTrue=true) const { return returnTrue; }   \
          virtual ~name##_attr(void) {}                            \
    } name;
 
-#define DECLARE_ARRAY_PRIVATE(T_num, T_rank, name)                        \
+#define DECLARE_ARRAY_PRIVATE(T_num, T_rank, name, ...)           \
    class name##_attr : public CAttributeArray<T_num, T_rank>      \
    {                                                              \
@@ -50,13 +56,17 @@
          virtual bool isPublic() const                            \
          { return false; }                                        \
+         virtual bool doSend() const { return helper(__VA_ARGS__); }   \
+         bool helper(bool returnTrue=true) const { return returnTrue; }   \
          virtual ~name##_attr(void) {}                            \
    } name;
 
-#define DECLARE_CLASS_ENUM(name)                                   \
-   class name##_attr : public CAttributeEnum<Enum_##name>          \
+#define DECLARE_CLASS_ENUM(name, ...)                             \
+   class name##_attr : public CAttributeEnum<Enum_##name>         \
    {                                                              \
       public :                                                    \
          name##_attr(void) : CAttributeEnum<Enum_##name>(#name, *CAttributeMap::Current) { } \
-         virtual ~name##_attr(void) {}                           \
+         virtual bool doSend() const { return helper(__VA_ARGS__); }   \
+         bool helper(bool returnTrue=true) const { return returnTrue; }   \
+         virtual ~name##_attr(void) {}                            \
    } name;
 
@@ -71,9 +81,9 @@
    DECLARE_CLASS_ENUM(name)
 
-#define DECLARE_ENUM3(name,arg1,arg2,arg3)                             \
+#define DECLARE_ENUM3(name,arg1,arg2,arg3)                        \
    class Enum_##name                                              \
    {                                                              \
      public:                                                      \
-     enum t_enum { arg1=0, arg2, arg3} ;                                \
+     enum t_enum { arg1=0, arg2, arg3} ;                          \
      const char** getStr(void) const { static const char * enumStr[] = { #arg1, #arg2, #arg3 } ; return enumStr ; }   \
      int getSize(void) const { return 3 ; }                       \
@@ -81,9 +91,9 @@
    DECLARE_CLASS_ENUM(name)
 
-#define DECLARE_ENUM4(name,arg1,arg2,arg3,arg4)                             \
+#define DECLARE_ENUM4(name,arg1,arg2,arg3,arg4)                   \
    class Enum_##name                                              \
    {                                                              \
      public:                                                      \
-     enum t_enum { arg1=0, arg2, arg3,arg4} ;                                \
+     enum t_enum { arg1=0, arg2, arg3,arg4} ;                     \
      const char** getStr(void) const { static const char * enumStr[] = { #arg1, #arg2, #arg3,#arg4 } ; return enumStr ; }   \
      int getSize(void) const { return 4 ; }                       \
@@ -91,9 +101,9 @@
    DECLARE_CLASS_ENUM(name)
 
-#define DECLARE_ENUM5(name,arg1,arg2,arg3,arg4,arg5)                             \
+#define DECLARE_ENUM5(name,arg1,arg2,arg3,arg4,arg5)              \
    class Enum_##name                                              \
    {                                                              \
      public:                                                      \
-     enum t_enum { arg1=0, arg2, arg3,arg4,arg5} ;                                \
+     enum t_enum { arg1=0, arg2, arg3,arg4,arg5} ;                \
      const char** getStr(void) const { static const char * enumStr[] = { #arg1, #arg2, #arg3,#arg4,#arg5 } ; return enumStr ; }   \
      int getSize(void) const { return 5 ; }                       \
@@ -101,9 +111,9 @@
    DECLARE_CLASS_ENUM(name)
 
-#define DECLARE_ENUM6(name,arg1,arg2,arg3,arg4,arg5,arg6)                             \
+#define DECLARE_ENUM6(name,arg1,arg2,arg3,arg4,arg5,arg6)         \
    class Enum_##name                                              \
    {                                                              \
      public:                                                      \
-     enum t_enum { arg1=0, arg2, arg3,arg4,arg5,arg6} ;                                \
+     enum t_enum { arg1=0, arg2, arg3,arg4,arg5,arg6} ;           \
      const char** getStr(void) const { static const char * enumStr[] = { #arg1, #arg2, #arg3,#arg4,#arg5,#arg6 } ; return enumStr ; }   \
      int getSize(void) const { return 6 ; }                       \
@@ -111,9 +121,9 @@
    DECLARE_CLASS_ENUM(name)
 
-#define DECLARE_ENUM7(name,arg1,arg2,arg3,arg4,arg5,arg6,arg7)                             \
+#define DECLARE_ENUM7(name,arg1,arg2,arg3,arg4,arg5,arg6,arg7)    \
    class Enum_##name                                              \
    {                                                              \
      public:                                                      \
-     enum t_enum { arg1=0, arg2, arg3,arg4,arg5,arg6,arg7} ;                                \
+     enum t_enum { arg1=0, arg2, arg3,arg4,arg5,arg6,arg7} ;      \
      const char** getStr(void) const { static const char * enumStr[] = { #arg1, #arg2, #arg3,#arg4,#arg5,#arg6,#arg7 } ; return enumStr ; }   \
      int getSize(void) const { return 7 ; }                       \
@@ -125,5 +135,5 @@
    {                                                              \
      public:                                                      \
-     enum t_enum { arg1=0, arg2, arg3,arg4,arg5,arg6,arg7,arg8} ;                                \
+     enum t_enum { arg1=0, arg2, arg3,arg4,arg5,arg6,arg7,arg8} ; \
      const char** getStr(void) const { static const char * enumStr[] = { #arg1, #arg2, #arg3,#arg4,#arg5,#arg6,#arg7,#arg8 } ; return enumStr ; }   \
      int getSize(void) const { return 8 ; }                       \
Index: /XIOS/trunk/src/declare_ref_func.hpp
===================================================================
--- /XIOS/trunk/src/declare_ref_func.hpp	(revision 1536)
+++ /XIOS/trunk/src/declare_ref_func.hpp	(revision 1537)
@@ -51,5 +51,5 @@
     SuperClassAttribute::setAttributes(refer_ptr, apply);              \
   }                                                                    \
-  if (this->hasAttribute("name") && this->name.isEmpty()) \
+  if (this->hasAttribute("name") && this->name.isEmpty())              \
     this->name.setValue(this->get##type##OutputName());                \
 }                                                                      \
@@ -71,5 +71,6 @@
 bool C##type::hasDirect##type##Reference(void) const                   \
 {                                                                      \
-  return !this->name_##_ref.isEmpty();                                 \
+  return (!this->name_##_ref.isEmpty() &&                              \
+          C##type::has(this->name_##_ref));                            \
 }                                                                      \
                                                                        \
@@ -89,13 +90,12 @@
 }                                                                      \
                                                                        \
-const StdString C##type::get##type##OutputName(void) const            \
+const StdString C##type::get##type##OutputName(void) const             \
 {                                                                      \
-  if (!this->name.isEmpty())                                           \
-    return this->name;                                                 \
-  else if (hasDirect##type##Reference())                               \
+  if (!this->name.isEmpty())  return this->name;                       \
+  else if (this->hasAutoGeneratedId() && hasDirect##type##Reference()) \
   {                                                                    \
     const C##type* refer_ptr = this, *tmp_ptr;                         \
     StdString nameRef = this->name_##_ref;                             \
-    std::set<const C##type*> tmpRefObjects;                                  \
+    std::set<const C##type*> tmpRefObjects;                            \
     while (refer_ptr->hasAutoGeneratedId() &&                          \
           (C##type::has(nameRef)))                                     \
Index: /XIOS/trunk/src/distribute_file_server2.cpp
===================================================================
--- /XIOS/trunk/src/distribute_file_server2.cpp	(revision 1537)
+++ /XIOS/trunk/src/distribute_file_server2.cpp	(revision 1537)
@@ -0,0 +1,218 @@
+#include "distribute_file_server2.hpp"
+#include <fstream>
+#include <vector>
+#include <string>
+#include <map>
+#include <iostream>
+#include <cstdlib>
+#include <cmath>
+
+namespace xios
+{
+
+
+using namespace std ;
+
+
+void distributeFileOverServer2(int nbServers, int nGrids, SDistGrid* grids, int nFiles, SDistFile* files)
+{
+
+  double maxBandwith=0 ;
+  for(int i=0; i<nFiles; i++) if (maxBandwith<files[i].bandwith_) maxBandwith=files[i].bandwith_ ;
+  double maxMemory=0 ;
+  for(int i=0; i<nGrids; i++) if (maxMemory<grids[i].size_) maxMemory=grids[i].size_ ;
+  double T0=maxBandwith+maxMemory ;
+  
+  // initialise
+  vector<SDistServer> servers(nbServers) ;
+  for(int i=0;i<nbServers;++i) servers[i].initialize(i,nGrids, grids, nFiles,files) ;
+  
+  double p ;
+  double Em, energy, newEnergy;
+  double T, deltaE ;
+  vector<int> listFile(nFiles);
+    
+  for(int i=0; i<nFiles; ++i) servers[i%nbServers].addFile(i) ;
+
+// compute energy
+  energy=0;
+  for(int i=0;i<nbServers;++i) if (energy<servers[i].energy_) energy=servers[i].energy_ ;
+
+  int nf1,nf2,si,sj ;
+
+//  T=energy ;
+  T=T0 ;
+  int itMax=10*nFiles*nFiles ;
+
+  srand(314159) ;
+  for(int it=0;it<itMax;++it)
+  { 
+     T=T/(1+10./itMax) ;
+  // metropolis step i->j
+
+    nf1=rand()%nFiles ;
+    si=files[nf1].assignedServer_ ;
+    sj=rand()%nbServers ;
+
+    servers[si].removeFile(nf1) ;
+    servers[sj].addFile(nf1) ;
+
+    newEnergy=0;
+    for(int i=0;i<nbServers;++i) if (newEnergy<servers[i].energy_) newEnergy=servers[i].energy_ ;
+    deltaE=newEnergy-energy ;
+    
+    if (deltaE>0) 
+    {
+      p=rand()*1./RAND_MAX ;
+      if ( p > exp(-deltaE/T)) // don't accept configuration
+      {
+        servers[sj].removeFile(nf1) ;
+        servers[si].addFile(nf1) ;
+      }
+      else energy=newEnergy ;
+    }
+    else energy=newEnergy ;
+
+// metropolis step i<->j
+
+    nf1=rand()%nFiles ;
+    nf2=rand()%nFiles ;
+
+    si=files[nf1].assignedServer_ ;
+    sj=files[nf2].assignedServer_ ;
+    
+    servers[si].removeFile(nf1) ;
+    servers[sj].removeFile(nf2) ;
+    servers[si].addFile(nf2) ;
+    servers[sj].addFile(nf1) ;
+
+    newEnergy=0;
+    for(int i=0;i<nbServers;++i) if (newEnergy<servers[i].energy_) newEnergy=servers[i].energy_  ;
+    deltaE=newEnergy-energy ;
+    
+    if (deltaE>0) 
+    {
+      p=rand()*1./RAND_MAX ;
+      if ( p > exp(-deltaE/T)) // don't accept configuration
+      {
+
+        servers[si].removeFile(nf2) ;
+        servers[sj].removeFile(nf1) ;
+        servers[si].addFile(nf1) ;
+        servers[sj].addFile(nf2) ;
+      }
+      else energy=newEnergy ;
+    }
+    else energy=newEnergy ;
+
+// metropolis switch grid
+    if (it%10==0)
+    {
+      int sum=0 ;
+      while(sum==0)
+      {
+        si=rand()%nbServers ;
+        for(int i=0;i<nGrids;++i) sum+=servers[si].assignedGrid_[i] ;
+      }    
+      sj=rand()%nbServers ;
+      int numGrid=rand()%nGrids ;
+      while (servers[si].assignedGrid_[numGrid]==0) numGrid=rand()%nGrids ;  
+      
+      int nListFile=0 ;
+      for(int i=0;i<nFiles; i++)
+      {
+        if (files[i].assignedServer_==si)
+        {
+          for (int j=0;j<files[i].nbGrids_;++j)
+          {
+            if (files[i].assignedGrid_[j]==numGrid)
+            {
+              servers[si].removeFile(i) ;
+              servers[sj].addFile(i) ;
+              listFile[nListFile]=i ;
+              nListFile++ ;
+              break ;
+            }
+          }
+        }
+      }
+
+      newEnergy=0;
+      for(int i=0;i<nbServers;++i) if (newEnergy<servers[i].energy_) newEnergy=servers[i].energy_ ;
+      deltaE=newEnergy-energy ;
+    
+      if (deltaE>0) 
+      {
+        p=rand()*1./RAND_MAX ;
+        if ( p > exp(-deltaE/T)) // don't accept configuration
+        {
+
+          for(int i=0;i<nListFile;++i)
+          {
+            servers[sj].removeFile(listFile[i]) ;
+            servers[si].addFile(listFile[i]) ;
+          }
+        }
+        else energy=newEnergy ;
+      }
+      else energy=newEnergy ;
+    }  
+    
+    if (it%1000==0) cout<<"T "<<T<<"  ;  energy "<<energy<<endl ;
+  }
+}
+
+
+void SDistServer::initialize(int num, int nMaxGrid, SDistGrid* grids, int nMaxFile, SDistFile* files)
+{
+  
+   num_=num ;
+   nMaxGrid_=nMaxGrid;
+   grids_=grids ;
+   nMaxFile=nMaxFile;
+   files_=files ; 
+   energy_=0. ;
+   bandwith_=0.;
+   assignedGrid_=new int[nMaxGrid] ;
+   for(int i=0;i<nMaxGrid;++i) assignedGrid_[i]=0 ;
+}
+
+void SDistServer::finalize()
+{
+  delete [] assignedGrid_ ;
+}
+
+
+
+double SDistServer::addFile(int numFile)
+{
+  int numGrid ;
+  bandwith_+=files_[numFile].bandwith_ ;
+  files_[numFile].assignedServer_=num_ ;
+  
+  for(int i=0;i<files_[numFile].nbGrids_;i++)
+  {
+    numGrid=files_[numFile].assignedGrid_[i] ;
+    if (assignedGrid_[numGrid]==0) memory_+=grids_[numGrid].size_ ;
+    assignedGrid_[numGrid]++ ;
+  }
+  energy_=bandwith_+memory_ ; 
+  return energy_ ;
+}
+
+
+double SDistServer::removeFile(int numFile)
+{
+  int numGrid ;
+  bandwith_-=files_[numFile].bandwith_ ;
+  for(int i=0;i<files_[numFile].nbGrids_;i++)
+  {
+    numGrid=files_[numFile].assignedGrid_[i] ;
+    if (assignedGrid_[numGrid]==1) memory_-=grids_[numGrid].size_ ;
+    assignedGrid_[numGrid]-- ;
+  }
+  energy_=bandwith_+memory_ ; 
+  return energy_ ;
+}
+
+}
Index: /XIOS/trunk/src/distribute_file_server2.hpp
===================================================================
--- /XIOS/trunk/src/distribute_file_server2.hpp	(revision 1537)
+++ /XIOS/trunk/src/distribute_file_server2.hpp	(revision 1537)
@@ -0,0 +1,53 @@
+#ifndef __XIOS_DISTRIBUTE_FILE_SERVER2_HPP__
+#define __XIOS_DISTRIBUTE_FILE_SERVER2_HPP__
+
+#include <cstddef>
+#include <string>
+
+namespace xios
+{
+
+
+struct SDistServer ;
+struct SDistFiles ;
+struct SDistGrid ;
+
+struct SDistFile
+{
+  SDistServer* servers_ ;
+  std::string id_;
+  
+  double bandwith_ ;
+  int nbGrids_ ;
+  int* assignedGrid_ ;
+  int assignedServer_ ;
+
+} ;
+ 
+struct SDistServer
+{
+  SDistFile* files_ ;
+  SDistGrid* grids_ ;
+  
+  double energy_ ;
+  double bandwith_ ;
+  double memory_ ;
+  int  nMaxGrid_ ;
+  int* assignedGrid_ ;
+  int num_ ;
+  
+  void initialize(int num, int nMaxGrid, SDistGrid* grids, int nMaxFile, SDistFile* files) ;
+  void finalize(void) ;
+  
+  double addFile(int numFile) ;
+  double removeFile(int numFile) ;
+} ;  
+  
+struct SDistGrid
+{
+  double size_ ;
+} ;
+
+void distributeFileOverServer2(int nbServers, int nGrids, SDistGrid* grids, int nFiles, SDistFile* files);
+}
+#endif
Index: /XIOS/trunk/src/distribution.cpp
===================================================================
--- /XIOS/trunk/src/distribution.cpp	(revision 1536)
+++ /XIOS/trunk/src/distribution.cpp	(revision 1537)
@@ -18,4 +18,9 @@
 }
 
+const CArray<size_t,1>& CDistribution:: getGlobalIndex() const 
+{ 
+  return globalIndex_; 
+}
+
 CDistribution::~CDistribution()
 { /* Nothing to do */ }
Index: /XIOS/trunk/src/distribution.hpp
===================================================================
--- /XIOS/trunk/src/distribution.hpp	(revision 1536)
+++ /XIOS/trunk/src/distribution.hpp	(revision 1537)
@@ -35,5 +35,6 @@
     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() {};
Index: /XIOS/trunk/src/distribution_client.cpp
===================================================================
--- /XIOS/trunk/src/distribution_client.cpp	(revision 1536)
+++ /XIOS/trunk/src/distribution_client.cpp	(revision 1537)
@@ -10,19 +10,4 @@
 
 namespace xios {
-
-CDistributionClient::CDistributionClient(int rank, int dims, const CArray<size_t,1>& globalIndex)
-   : CDistribution(rank, dims, globalIndex)
-   , axisDomainOrder_()
-   , nLocal_(), nGlob_(), nBeginLocal_(), nBeginGlobal_(),nZoomBegin_(), nZoomEnd_()
-   , dataNIndex_(), dataDims_(), dataBegin_(), dataIndex_(), domainMasks_(), axisMasks_()
-   , gridMask_(), indexMap_()
-   , isDataDistributed_(true), axisNum_(0), domainNum_(0)
-   , localDataIndex_(), localMaskIndex_()
-   , globalLocalDataSendToServerMap_()
-   , infoIndex_(), isComputed_(false)
-   , elementLocalIndex_(), elementGlobalIndex_(), elementIndexData_()
-   , elementZoomMask_(), elementNLocal_(), elementNGlobal_()
-{
-}
 
 CDistributionClient::CDistributionClient(int rank, CGrid* grid)
@@ -46,4 +31,17 @@
 { /* Nothing to do */ }
 
+void CDistributionClient::partialClear()
+{
+  GlobalLocalMap void1 ;
+  GlobalLocalMap void2 ;
+  std::vector<int> void3 ;
+  std::vector<int> void4 ;
+
+  globalLocalDataSendToServerMap_.swap(void1) ;
+  globalDataIndex_.swap(void2) ;
+  localDataIndex_.swap(void3);
+  localMaskIndex_.swap(void4) ;
+}
+
 /*!
   Read information of a grid to generate distribution.
@@ -123,6 +121,6 @@
   for (int i = 0; i < domainNum_;++i)
   {
-    domainMasks_[i].resize(domList[i]->mask_1d.numElements());
-    domainMasks_[i] = domList[i]->mask_1d;
+    domainMasks_[i].resize(domList[i]->domainMask.numElements());
+    domainMasks_[i] = domList[i]->domainMask;
   }
 
@@ -197,6 +195,6 @@
       nBeginLocal_.at(indexMap_[idx]+1) = 0;
       nBeginGlobal_.at(indexMap_[idx]+1) = domList[domIndex]->jbegin;
-      nZoomBegin_.at((indexMap_[idx]+1)) = domList[domIndex]->global_zoom_jbegin;
-      nZoomEnd_.at((indexMap_[idx]+1))   = domList[domIndex]->global_zoom_jbegin + domList[domIndex]->global_zoom_nj-1;
+      nZoomBegin_.at((indexMap_[idx]+1)) = 0; //domList[domIndex]->global_zoom_jbegin;
+      nZoomEnd_.at((indexMap_[idx]+1))   = domList[domIndex]->nj_glo.getValue()- 1; //domList[domIndex]->global_zoom_jbegin + domList[domIndex]->global_zoom_nj-1;
 
       dataBegin_.at(indexMap_[idx]+1) = domList[domIndex]->data_jbegin.getValue();
@@ -209,6 +207,6 @@
       nBeginLocal_.at(indexMap_[idx]) = 0;
       nBeginGlobal_.at(indexMap_[idx]) = domList[domIndex]->ibegin;
-      nZoomBegin_.at((indexMap_[idx])) = domList[domIndex]->global_zoom_ibegin;
-      nZoomEnd_.at((indexMap_[idx]))   = domList[domIndex]->global_zoom_ibegin + domList[domIndex]->global_zoom_ni-1;
+      nZoomBegin_.at((indexMap_[idx])) = 0; // domList[domIndex]->global_zoom_ibegin;
+      nZoomEnd_.at((indexMap_[idx]))   = domList[domIndex]->ni_glo.getValue() -1; //domList[domIndex]->global_zoom_ibegin + domList[domIndex]->global_zoom_ni-1;
 
       dataBegin_.at(indexMap_[idx]) = domList[domIndex]->data_ibegin.getValue();
@@ -231,6 +229,6 @@
       nBeginLocal_.at(indexMap_[idx]) = 0;
       nBeginGlobal_.at(indexMap_[idx]) = axisList[axisIndex]->begin.getValue();
-      nZoomBegin_.at((indexMap_[idx])) = axisList[axisIndex]->global_zoom_begin;
-      nZoomEnd_.at((indexMap_[idx])) = axisList[axisIndex]->global_zoom_begin + axisList[axisIndex]->global_zoom_n-1;
+      nZoomBegin_.at((indexMap_[idx])) = 0; //axisList[axisIndex]->global_zoom_begin;
+      nZoomEnd_.at((indexMap_[idx])) = axisList[axisIndex]->n_glo.getValue() - 1; //axisList[axisIndex]->global_zoom_begin + axisList[axisIndex]->global_zoom_n-1;
 
       dataBegin_.at(indexMap_[idx]) = axisList[axisIndex]->data_begin.getValue();
@@ -493,4 +491,6 @@
   localDataIndex_.resize(indexLocalDataOnClientCount);
   localMaskIndex_.resize(indexSend2ServerCount);
+  localMaskedDataIndex_.resize(indexSend2ServerCount);
+  globalDataIndex_.rehash(std::ceil(indexLocalDataOnClientCount/globalDataIndex_.max_load_factor())); //globalLocalDataSendToServerMap_.reserve(indexSend2ServerCount);
   globalLocalDataSendToServerMap_.rehash(std::ceil(indexSend2ServerCount/globalLocalDataSendToServerMap_.max_load_factor())); //globalLocalDataSendToServerMap_.reserve(indexSend2ServerCount);
 
@@ -558,4 +558,10 @@
           if (gridMask_(gridMaskIndex))
           {
+            size_t globalIndex = 0;
+            for (int k = 0; k < numElement_; ++k)
+            {
+              globalIndex += (currentGlobalIndex[k])*elementNGlobal_[k];
+            }
+            globalDataIndex_[globalIndex] = indexLocalDataOnClientCount;
             localDataIndex_[indexLocalDataOnClientCount] = countLocalData;
             bool isIndexOnServer = true;
@@ -567,11 +573,7 @@
             if (isIndexOnServer)
             {
-              size_t globalIndex = 0;
-              for (int k = 0; k < numElement_; ++k)
-              {
-                globalIndex += (currentGlobalIndex[k])*elementNGlobal_[k];
-              }
               globalLocalDataSendToServerMap_[globalIndex] = indexLocalDataOnClientCount;
               localMaskIndex_[indexSend2ServerCount] = gridMaskIndex;
+              localMaskedDataIndex_[indexSend2ServerCount] = indexLocalDataOnClientCount;
               ++indexSend2ServerCount;
             }
@@ -642,4 +644,10 @@
 }
 
+CDistributionClient::GlobalLocalDataMap& CDistributionClient::getGlobalDataIndexOnClient()
+{
+  if (!isComputed_) createGlobalIndexSendToServer();
+  return globalDataIndex_;
+}
+
 /*!
   Return local data index of client
@@ -660,3 +668,12 @@
 }
 
+/*!
+  Return local mask index of client
+*/
+const std::vector<int>& CDistributionClient::getLocalMaskedDataIndexOnClient()
+{
+  if (!isComputed_) createGlobalIndexSendToServer();
+  return localMaskedDataIndex_;
+}
+
 } // namespace xios
Index: /XIOS/trunk/src/distribution_client.hpp
===================================================================
--- /XIOS/trunk/src/distribution_client.hpp	(revision 1536)
+++ /XIOS/trunk/src/distribution_client.hpp	(revision 1537)
@@ -33,6 +33,5 @@
 
   public:
-    /** Default constructor */
-    CDistributionClient(int rank, int dims, const CArray<size_t,1>& globalIndex = CArray<size_t,1>());
+    /** Default constructor */        
     CDistributionClient(int rank, CGrid* grid);
 
@@ -44,5 +43,7 @@
     virtual const std::vector<int>& getLocalDataIndexOnClient();
     GlobalLocalDataMap& getGlobalLocalDataSendToServer();
+    GlobalLocalDataMap& getGlobalDataIndexOnClient();
     const std::vector<int>& getLocalMaskIndexOnClient();
+    const std::vector<int>& getLocalMaskedDataIndexOnClient();
 
     std::vector<int> getNGlob() { return nGlob_; }
@@ -55,4 +56,6 @@
                                      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:
@@ -79,6 +82,8 @@
     //!< LocalData index on client
     GlobalLocalDataMap globalLocalDataSendToServerMap_;
+    GlobalLocalDataMap globalDataIndex_;
     std::vector<int> localDataIndex_;
     std::vector<int> localMaskIndex_;
+    std::vector<int> localMaskedDataIndex_;
 
   private:
Index: /XIOS/trunk/src/distribution_server.cpp
===================================================================
--- /XIOS/trunk/src/distribution_server.cpp	(revision 1536)
+++ /XIOS/trunk/src/distribution_server.cpp	(revision 1537)
@@ -11,16 +11,4 @@
 
 namespace xios {
-
-CDistributionServer::CDistributionServer(int rank, int dims, const CArray<size_t,1>& globalIndex)
-  : CDistribution(rank, dims, globalIndex), nGlobal_(), nZoomSize_(), nZoomBegin_(), globalLocalIndexMap_()
-{
-}
-
-CDistributionServer::CDistributionServer(int rank, const std::vector<int>& nZoomBegin,
-                                         const std::vector<int>& nZoomSize, const std::vector<int>& nGlobal)
-  : CDistribution(rank, nGlobal.size()), nGlobal_(nGlobal), nZoomSize_(nZoomSize), nZoomBegin_(nZoomBegin), globalLocalIndexMap_()
-{
-  createGlobalIndex();
-}
 
 CDistributionServer::CDistributionServer(int rank, const std::vector<int>& nZoomBegin,
@@ -37,10 +25,10 @@
                                         const std::vector<CArray<int,1> >& globalIndexElements,
                                         const CArray<int,1>& elementOrder,
-                                        const std::vector<int>& nZoomBeginServer,
-                                        const std::vector<int>& nZoomSizeServer,
+                                        const std::vector<int>& nZoomBegin,
+                                        const std::vector<int>& nZoomSize,
                                         const std::vector<int>& nZoomBeginGlobal,
                                         const std::vector<int>& nGlobal)
   : CDistribution(rank, nGlobal.size()), nGlobal_(nGlobal), nZoomBeginGlobal_(nZoomBeginGlobal),
-    nZoomSize_(nZoomSizeServer), nZoomBegin_(nZoomBeginServer), globalLocalIndexMap_()
+    nZoomSize_(nZoomSize), nZoomBegin_(nZoomBegin), globalLocalIndexMap_()
 {
   createGlobalIndex(globalIndexElements, elementOrder);
@@ -184,36 +172,21 @@
 /*!
   Compute local index for writing data on server
-  \param [in] globalIndex global index received from client
-  \return local index of written data
-*/
-CArray<size_t,1> CDistributionServer::computeLocalIndex(const CArray<size_t,1>& globalIndex)
-{
-  int ssize = globalIndex.numElements();
-  CArray<size_t,1> localIndex(ssize);
+  \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;
-  for (int idx = 0; idx < ssize; ++idx)
+  int i = 0;
+  for (size_t idx = 0; idx < ssize; ++idx)
   {
     it = globalLocalIndexMap_.find(globalIndex(idx));
     if (ite != it)
-      localIndex(idx) = it->second;
-  }
-
-  return localIndex;
-}
-
-/*!
-  Compute local index for writing data on server
-  \param [in] globalIndex Global index received from client
-*/
-void CDistributionServer::computeLocalIndex(CArray<size_t,1>& globalIndex)
-{
-  int ssize = globalIndex.numElements();
-  CArray<size_t,1> localIndex(ssize);
-  GlobalLocalMap::const_iterator ite = globalLocalIndexMap_.end(), it;
-  for (int idx = 0; idx < ssize; ++idx)
-  {
-    it = globalLocalIndexMap_.find(globalIndex(idx));
-    if (ite != it)
-      localIndex(idx) = it->second;
+    {
+      localIndex(i) = it->second;
+      ++i;
+    }
   }
 
@@ -234,4 +207,11 @@
 }
 
+/*!
+  Get the size of grid index in server (e.x: sizeGrid *= size of each dimensiion)
+*/
+int CDistributionServer::getGridSize() const
+{
+   return globalLocalIndexMap_.size();
+}
 
 const std::vector<int>& CDistributionServer::getZoomBeginGlobal() const
@@ -249,3 +229,10 @@
   return nZoomSize_;
 }
+
+void CDistributionServer::partialClear(void)
+{
+  GlobalLocalMap void1 ;
+  globalLocalIndexMap_.swap(void1) ;
+}
+  
 } // namespace xios
Index: /XIOS/trunk/src/distribution_server.hpp
===================================================================
--- /XIOS/trunk/src/distribution_server.hpp	(revision 1536)
+++ /XIOS/trunk/src/distribution_server.hpp	(revision 1537)
@@ -45,8 +45,10 @@
     const std::vector<int>& getZoomBeginServer() const;
     const std::vector<int>& getZoomSizeServer() const;
-
-    virtual CArray<size_t,1> computeLocalIndex(const CArray<size_t,1>& globalIndex);
+    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:
@@ -54,5 +56,5 @@
     void createGlobalIndex(const std::vector<CArray<int,1> >& globalIndexElements,
                            const CArray<int,1>& elementOrder);
-
+    
   protected:
     GlobalLocalMap globalLocalIndexMap_;
Index: /XIOS/trunk/src/duration.cpp
===================================================================
--- /XIOS/trunk/src/duration.cpp	(revision 1536)
+++ /XIOS/trunk/src/duration.cpp	(revision 1537)
@@ -7,13 +7,21 @@
 {
       /// ////////////////////// DÃ©finitions ////////////////////// ///
-      const CDuration Year     = { 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 },
-                      Month    = { 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0 },
-                      Week     = { 0.0, 0.0, 7.0, 0.0, 0.0, 0.0, 0.0 },
-                      Day      = { 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0 },
-                      Hour     = { 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0 },
-                      Minute   = { 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0 },
-                      Second   = { 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0 },
-                      TimeStep = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0 },
-                      NoneDu   = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 };
+
+      const CDuration Year     ( 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 );
+      const CDuration Month    ( 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0 );
+      const CDuration Week     ( 0.0, 0.0, 7.0, 0.0, 0.0, 0.0, 0.0 );
+      const CDuration Day      ( 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0 );
+      const CDuration Hour     ( 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0 );
+      const CDuration Minute   ( 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0 );
+      const CDuration Second   ( 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0 );
+      const CDuration TimeStep ( 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0 );
+      const CDuration NoneDu   ( 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 );
+
+      ///---------------------------------------------------------------
+
+      CDuration::CDuration(double y, double m, double d, double h, double min, double s, double ts) :
+      year(y), month(m), day(d), hour(h), minute(min), second(s), timestep(ts)
+      {
+      }
 
       ///---------------------------------------------------------------
Index: /XIOS/trunk/src/duration.hpp
===================================================================
--- /XIOS/trunk/src/duration.hpp	(revision 1536)
+++ /XIOS/trunk/src/duration.hpp	(revision 1537)
@@ -20,4 +20,6 @@
 
          public:
+            CDuration(double year=0.0, double month=0.0, double day=0.0, double hour=0.0, double minute=0.0, double second=0.0, double timestep=0.0);
+
             /// OpÃ©rateurs ///
             CDuration& operator=(const CDuration& duration);
Index: /XIOS/trunk/src/event_client.cpp
===================================================================
--- /XIOS/trunk/src/event_client.cpp	(revision 1536)
+++ /XIOS/trunk/src/event_client.cpp	(revision 1537)
@@ -5,4 +5,5 @@
 #include "type.hpp"
 #include "mpi.hpp"
+#include "cxios.hpp"
 
 namespace xios
@@ -49,4 +50,5 @@
      std::list<CMessage*>::iterator itMsg = messages.begin();
 
+     if (CXios::checkEventSync) info(100)<<"Send event "<<timeLine<<" classId : "<<classId<<"  typeId : "<<typeId<<endl ;
      for (; itBuff != buffers.end(); ++itBuff, ++itSizes, ++itSenders, ++itMsg)
      {
Index: /XIOS/trunk/src/event_client.hpp
===================================================================
--- /XIOS/trunk/src/event_client.hpp	(revision 1536)
+++ /XIOS/trunk/src/event_client.hpp	(revision 1537)
@@ -21,5 +21,7 @@
       std::list<int> getRanks(void);
       std::list<int> getSizes(void);
-
+      int getClassId(void) { return classId; }
+      int getTypeId(void) { return typeId; }
+      
     private:
       int classId;
Index: /XIOS/trunk/src/event_scheduler.cpp
===================================================================
--- /XIOS/trunk/src/event_scheduler.cpp	(revision 1536)
+++ /XIOS/trunk/src/event_scheduler.cpp	(revision 1537)
@@ -2,4 +2,5 @@
 #include "xios_spl.hpp"
 #include "mpi.hpp"
+#include "tracer.hpp"
 
 namespace xios
@@ -80,4 +81,5 @@
   {
        
+    traceOff() ;
     SPendingRequest* sentRequest=new SPendingRequest ;
     sentRequest->buffer[0]=timeLine ;
@@ -87,4 +89,5 @@
     pendingSentParentRequest.push(sentRequest) ;
     MPI_Isend(sentRequest->buffer,3, MPI_UNSIGNED_LONG, parent[lev], 0, communicator, &sentRequest->request) ;
+    traceOn() ;
   } 
 
@@ -102,10 +105,10 @@
   void CEventScheduler::checkEvent(void)
   {
+    traceOff() ;
     checkChildRequest() ;
     checkParentRequest() ;
-    
-  }
-  
-  
+    traceOn() ;
+    
+  }
   
   void CEventScheduler::checkParentRequest(void)
Index: /XIOS/trunk/src/filter/file_server_writer_filter.cpp
===================================================================
--- /XIOS/trunk/src/filter/file_server_writer_filter.cpp	(revision 1537)
+++ /XIOS/trunk/src/filter/file_server_writer_filter.cpp	(revision 1537)
@@ -0,0 +1,30 @@
+#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/trunk/src/filter/file_server_writer_filter.hpp
===================================================================
--- /XIOS/trunk/src/filter/file_server_writer_filter.hpp	(revision 1537)
+++ /XIOS/trunk/src/filter/file_server_writer_filter.hpp	(revision 1537)
@@ -0,0 +1,53 @@
+#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/trunk/src/filter/source_filter.cpp
===================================================================
--- /XIOS/trunk/src/filter/source_filter.cpp	(revision 1536)
+++ /XIOS/trunk/src/filter/source_filter.cpp	(revision 1537)
@@ -7,5 +7,5 @@
 namespace xios
 {
-  CSourceFilter::CSourceFilter(CGarbageCollector& gc, CGrid* grid,
+  CSourceFilter::CSourceFilter(CGarbageCollector& gc, CGrid* grid, bool compression, 
                                const CDuration offset /*= NoneDu*/, bool manualTrigger /*= false*/,
                                bool hasMissingValue /*= false*/,
@@ -13,4 +13,5 @@
     : COutputPin(gc, manualTrigger)
     , grid(grid)
+    , compression(compression)
     , offset(offset)
     , hasMissingValue(hasMissingValue), defaultValue(defaultValue)
@@ -31,7 +32,24 @@
     packet->status = CDataPacket::NO_ERROR;
 
-    packet->data.resize(grid->storeIndex_client.numElements());
-    grid->inputField(data, packet->data);
+    packet->data.resize(grid->storeIndex_client.numElements());    
+    
+    if (compression)
+    {
+      packet->data = defaultValue;
+      grid->uncompressField(data, packet->data);    
+    }
+    else
+      grid->inputField(data, packet->data);
 
+    
+    
+    // if (compression) grid->inputField(data, packet->data) ;
+    // else
+    // {
+    //   // just make a flat copy
+    //   CArray<double, N> data_tmp(data.copy()) ; // supress const attribute
+    //   CArray<double,1> dataTmp2(data_tmp.dataFirst(),shape(data.numElements()),neverDeleteData) ;
+    //   packet->data = dataTmp2 ;
+    // }
     // Convert missing values to NaN
     if (hasMissingValue)
@@ -65,6 +83,5 @@
     packet->timestamp = date;
     packet->status = CDataPacket::NO_ERROR;
-
-    // if (data.size() != grid->storeIndex_toSrv.size())
+    
     if (data.size() != grid->storeIndex_fromSrv.size())
       ERROR("CSourceFilter::streamDataFromServer(CDate date, const std::map<int, CArray<double, 1> >& data)",
@@ -75,6 +92,5 @@
     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_toSrv[it->first];
+    {      
       CArray<int,1>& index = grid->storeIndex_fromSrv[it->first];
       for (int n = 0; n < index.numElements(); n++)
Index: /XIOS/trunk/src/filter/source_filter.hpp
===================================================================
--- /XIOS/trunk/src/filter/source_filter.hpp	(revision 1536)
+++ /XIOS/trunk/src/filter/source_filter.hpp	(revision 1537)
@@ -27,4 +27,5 @@
        */
       CSourceFilter(CGarbageCollector& gc, CGrid* grid,
+                    bool compression=true,
                     const CDuration offset = NoneDu, bool manualTrigger = false,
                     bool hasMissingValue = false,
@@ -64,4 +65,5 @@
       const bool hasMissingValue;
       const double defaultValue;
+      const bool compression ; //!< indicate if the data need to be compressed : on client size : true, on server side : false
   }; // class CSourceFilter
 } // namespace xios
Index: /XIOS/trunk/src/filter/spatial_transform_filter.cpp
===================================================================
--- /XIOS/trunk/src/filter/spatial_transform_filter.cpp	(revision 1536)
+++ /XIOS/trunk/src/filter/spatial_transform_filter.cpp	(revision 1537)
@@ -3,4 +3,5 @@
 #include "context.hpp"
 #include "context_client.hpp"
+#include "timer.hpp"
 
 namespace xios
@@ -27,6 +28,17 @@
       size_t inputCount = 1 + (auxInputs.empty() ? 0 : auxInputs.size());
       double defaultValue  = (hasMissingValue) ? std::numeric_limits<double>::quiet_NaN() : 0.0;
-      boost::shared_ptr<CSpatialTransformFilter> filter(new CSpatialTransformFilter(gc, engine, defaultValue, inputCount));
-
+
+
+      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 ;
+
+      boost::shared_ptr<CSpatialTransformFilter> filter ;
+      if( isSpatialTemporal) filter = boost::shared_ptr<CSpatialTransformFilter>(new CSpatialTemporalFilter(gc, engine, gridTransformation, defaultValue, inputCount));
+      else filter = boost::shared_ptr<CSpatialTransformFilter>(new CSpatialTransformFilter(gc, engine, defaultValue, inputCount));
+
+      
       if (!lastFilter)
         lastFilter = filter;
@@ -57,4 +69,67 @@
   }
 
+
+
+
+
+  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);
+
+    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;
+        onOutputReady(packet);
+        tmpData.resize(0) ;
+      }
+    }
+  }
+
+
   CSpatialTransformFilterEngine::CSpatialTransformFilterEngine(CGridTransformation* gridTransformation)
     : gridTransformation(gridTransformation)
@@ -114,4 +189,6 @@
   void CSpatialTransformFilterEngine::apply(const CArray<double, 1>& dataSrc, CArray<double,1>& dataDest)
   {
+    CTimer::get("CSpatialTransformFilterEngine::apply").resume(); 
+    
     CContextClient* client = CContext::getCurrent()->client;
 
@@ -228,4 +305,6 @@
 
     dataDest = dataCurrentDest;
+
+    CTimer::get("CSpatialTransformFilterEngine::apply").suspend() ;
   }
 } // namespace xios
Index: /XIOS/trunk/src/filter/spatial_transform_filter.hpp
===================================================================
--- /XIOS/trunk/src/filter/spatial_transform_filter.hpp	(revision 1536)
+++ /XIOS/trunk/src/filter/spatial_transform_filter.hpp	(revision 1537)
@@ -49,4 +49,41 @@
       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
+
 
   /*!
Index: /XIOS/trunk/src/filter/temporal_filter.cpp
===================================================================
--- /XIOS/trunk/src/filter/temporal_filter.cpp	(revision 1536)
+++ /XIOS/trunk/src/filter/temporal_filter.cpp	(revision 1537)
@@ -5,11 +5,11 @@
 namespace xios
 {
-  static func::CFunctor* createFunctor(const std::string& opId, bool ignoreMissingValue, double missingValue, CArray<double, 1>& tmpData);
+  static func::CFunctor* createFunctor(const std::string& opId, bool ignoreMissingValue, CArray<double, 1>& tmpData);
 
   CTemporalFilter::CTemporalFilter(CGarbageCollector& gc, const std::string& opId,
                                    const CDate& initDate, const CDuration samplingFreq, const CDuration samplingOffset, const CDuration opFreq,
-                                   bool ignoreMissingValue /*= false*/, double missingValue /*= 0.0*/)
+                                   bool ignoreMissingValue /*= false*/)
     : CFilter(gc, 1, this)
-    , functor(createFunctor(opId, ignoreMissingValue, missingValue, tmpData))
+    , functor(createFunctor(opId, ignoreMissingValue, tmpData))
     , isOnceOperation(functor->timeType() == func::CFunctor::once)
     , isInstantOperation(functor->timeType() == func::CFunctor::instant)
@@ -17,6 +17,14 @@
     , samplingOffset(samplingOffset)
     , opFreq(opFreq)
-    , nextSamplingDate(initDate + this->samplingOffset + initDate.getRelCalendar().getTimeStep())
-    , nextOperationDate(initDate + this->samplingOffset + opFreq)
+    , offsetMonth(0, this->samplingOffset.month, 0, 0, 0, 0, 0)
+    , offsetAllButMonth(this->samplingOffset.year, 0 , this->samplingOffset.day,
+                        this->samplingOffset.hour, this->samplingOffset.minute,
+                        this->samplingOffset.second, this->samplingOffset.timestep)
+    , initDate(initDate)
+//    , nextSamplingDate(initDate + (this->samplingOffset + initDate.getRelCalendar().getTimeStep()))
+    , nextSamplingDate(initDate + offsetMonth + ( offsetAllButMonth + initDate.getRelCalendar().getTimeStep()))
+    , nbOperationDates(1)
+    , nbSamplingDates(0)
+//    , nextOperationDate(initDate + opFreq + this->samplingOffset)
     , isFirstOperation(true)
   {
@@ -35,5 +43,6 @@
       {
         usePacket = (data[0]->date >= nextSamplingDate);
-        outputResult = (data[0]->date + samplingFreq > nextOperationDate);
+//        outputResult = (data[0]->date + samplingFreq > nextOperationDate);
+        outputResult = (data[0]->date  > initDate + nbOperationDates*opFreq - samplingFreq + offsetMonth + offsetAllButMonth);
         copyLess = (isInstantOperation && usePacket && outputResult);
       }
@@ -41,4 +50,5 @@
       if (usePacket)
       {
+        nbSamplingDates ++;
         if (!copyLess)
         {
@@ -49,9 +59,10 @@
         }
 
-        nextSamplingDate = nextSamplingDate + samplingFreq;
+        nextSamplingDate = ((initDate + offsetMonth) + nbSamplingDates * samplingFreq) + offsetAllButMonth + initDate.getRelCalendar().getTimeStep();
       }
 
       if (outputResult)
       {
+        nbOperationDates ++;
         if (!copyLess)
         {
@@ -69,5 +80,5 @@
 
         isFirstOperation = false;
-        nextOperationDate = nextOperationDate + samplingFreq + opFreq - samplingFreq;
+//        nextOperationDate = initDate + samplingFreq + nbOperationDates*opFreq - samplingFreq + offsetMonth + offsetAllButMonth;
       }
     }
@@ -83,12 +94,13 @@
   bool CTemporalFilter::isDataExpected(const CDate& date) const
   {
-    return isOnceOperation ? isFirstOperation : (date >= nextSamplingDate || date + samplingFreq > nextOperationDate);
+//    return isOnceOperation ? isFirstOperation : (date >= nextSamplingDate || date + samplingFreq > nextOperationDate);
+    return isOnceOperation ? isFirstOperation : (date >= nextSamplingDate || date > initDate + nbOperationDates*opFreq - samplingFreq + offsetMonth + offsetAllButMonth);
   }
 
-  static func::CFunctor* createFunctor(const std::string& opId, bool ignoreMissingValue, double missingValue, CArray<double, 1>& tmpData)
+  static func::CFunctor* createFunctor(const std::string& opId, bool ignoreMissingValue, CArray<double, 1>& tmpData)
   {
     func::CFunctor* functor = NULL;
 
-    double defaultValue = ignoreMissingValue ? std::numeric_limits<double>::quiet_NaN() : missingValue;
+    double defaultValue = std::numeric_limits<double>::quiet_NaN();
 
 #define DECLARE_FUNCTOR(MType, mtype) \
Index: /XIOS/trunk/src/filter/temporal_filter.hpp
===================================================================
--- /XIOS/trunk/src/filter/temporal_filter.hpp	(revision 1536)
+++ /XIOS/trunk/src/filter/temporal_filter.hpp	(revision 1537)
@@ -26,9 +26,8 @@
        * \param ignoreMissingValue true if and only if the missing value must be ignored
                                    when doing the operation
-       * \param missingValue the missing value
        */
       CTemporalFilter(CGarbageCollector& gc, const std::string& opId,
                       const CDate& initDate, const CDuration samplingFreq, const CDuration samplingOffset, const CDuration opFreq,
-                      bool ignoreMissingValue = false, double missingValue = 0.0);
+                      bool ignoreMissingValue = false);
 
       /*!
@@ -63,6 +62,11 @@
       const CDuration samplingOffset; //!< The sampling offset, i.e. the offset after which the input data will be used
       const CDuration opFreq; //!< The operation frequency, i.e. the frequency at which the output data will be computed
+      const CDuration offsetMonth; //!< The month duration of samplingOffset
+      CDuration offsetAllButMonth; //!< All but the month duration of samplingOffset
+      const CDate initDate;
       CDate nextSamplingDate; //!< The date of the next sampling
-      CDate nextOperationDate; //!< The date of the next operation
+      int nbOperationDates; //!< The number of times an operation is performed
+      int nbSamplingDates;
+//      CDate nextOperationDate; //!< The date of the next operation
       bool isFirstOperation; //!< True before the first operation was been computed
   }; // class CTemporalFilter
Index: /XIOS/trunk/src/generate_fortran_interface.cpp
===================================================================
--- /XIOS/trunk/src/generate_fortran_interface.cpp	(revision 1536)
+++ /XIOS/trunk/src/generate_fortran_interface.cpp	(revision 1537)
@@ -35,4 +35,5 @@
   CComputeConnectivityDomain compConDomain;
   CExpandDomain expandDomain;
+  CReorderDomain reorderDomain;
 
   CInterpolateAxis interpolateAxis;
@@ -40,10 +41,14 @@
   CInverseAxis inverseAxis;
   CReduceDomainToAxis reduceDomainToAxis;
+  CReduceAxisToAxis reduceAxisToAxis;
   CExtractDomainToAxis extractDomainToAxis;
+  CTemporalSplitting temporalSplitting;
 
   CReduceAxisToScalar reduceAxisToScalar;
   CExtractAxisToScalar extractAxisToScalar;
   CReduceDomainToScalar reduceDomainToScalar;
-
+  CDuplicateScalarToAxis duplicateScalarToAxis;
+  CReduceScalarToScalar reduceScalarToScalar;
+  
   ostringstream oss;
   ofstream file;
@@ -297,4 +302,17 @@
   file.open((path+"iexpand_domain_attr.F90").c_str());
   expandDomain.generateFortranInterface(file);
+  file.close();
+
+  file.open((path+"reorder_domain_interface_attr.F90").c_str());
+  reorderDomain.generateFortran2003Interface(file);
+  file.close();
+
+  file.open((path+"icreorder_domain_attr.cpp").c_str());
+  reorderDomain.generateCInterface(file);
+  file.close();
+
+  file.open((path+"ireorder_domain_attr.F90").c_str());
+  reorderDomain.generateFortranInterface(file);
+
   file.close();
   
@@ -341,5 +359,5 @@
   reduceDomainToAxis.generateFortran2003Interface(file);
   file.close();
-
+ 
   file.open((path+"icreduce_domain_to_axis_attr.cpp").c_str());
   reduceDomainToAxis.generateCInterface(file);
@@ -348,4 +366,16 @@
   file.open((path+"ireduce_domain_to_axis_attr.F90").c_str());
   reduceDomainToAxis.generateFortranInterface(file);
+  file.close();
+
+  file.open((path+"reduce_axis_to_axis_interface_attr.F90").c_str());
+  reduceAxisToAxis.generateFortran2003Interface(file);
+  file.close();
+ 
+  file.open((path+"icreduce_axis_to_axis_attr.cpp").c_str());
+  reduceAxisToAxis.generateCInterface(file);
+  file.close();
+
+  file.open((path+"ireduce_axis_to_axis_attr.F90").c_str());
+  reduceAxisToAxis.generateFortranInterface(file);
   file.close();
   
@@ -363,4 +393,28 @@
 
 
+  file.open((path+"temporal_splitting_interface_attr.F90").c_str());
+  temporalSplitting.generateFortran2003Interface(file);
+  file.close();
+
+  file.open((path+"ictemporal_splitting_attr.cpp").c_str());
+  temporalSplitting.generateCInterface(file);
+  file.close();
+
+  file.open((path+"itemporal_splitting_attr.F90").c_str());
+  temporalSplitting.generateFortranInterface(file);
+  file.close();
+
+
+  file.open((path+"duplicate_scalar_to_axis_interface_attr.F90").c_str());
+  duplicateScalarToAxis.generateFortran2003Interface(file);
+  file.close();
+  
+  file.open((path+"icduplicate_scalar_to_axis_attr.cpp").c_str());
+  duplicateScalarToAxis.generateCInterface(file);
+  file.close();
+  
+  file.open((path+"iduplicate_scalar_to_axis_attr.F90").c_str());
+  duplicateScalarToAxis.generateFortranInterface(file);
+  file.close();
   /*!
     Scalar transformations
@@ -390,4 +444,5 @@
   file.close();
 
+
   file.open((path+"reduce_domain_to_scalar_interface_attr.F90").c_str());
   reduceDomainToScalar.generateFortran2003Interface(file);
@@ -402,4 +457,21 @@
   file.close();
 
+
+  file.open((path+"reduce_scalar_to_scalar_interface_attr.F90").c_str());
+  reduceScalarToScalar.generateFortran2003Interface(file);
+  file.close();
+
+  file.open((path+"icreduce_scalar_to_scalar_attr.cpp").c_str());
+  reduceScalarToScalar.generateCInterface(file);
+  file.close();
+
+  file.open((path+"ireduce_scalar_to_scalar_attr.F90").c_str());
+  reduceScalarToScalar.generateFortranInterface(file);
+  file.close();
+
+
+
+
+
   file.open((path+"context_interface_attr.F90").c_str());
   context->generateFortran2003Interface(file);
Index: /XIOS/trunk/src/group_factory_decl.cpp
===================================================================
--- /XIOS/trunk/src/group_factory_decl.cpp	(revision 1536)
+++ /XIOS/trunk/src/group_factory_decl.cpp	(revision 1537)
@@ -34,4 +34,5 @@
   macro(CReduceAxisToScalarGroup)
   macro(CReduceDomainToAxisGroup)
+  macro(CReduceAxisToAxisGroup)
   macro(CExtractDomainToAxisGroup)
   macro(CComputeConnectivityDomainGroup)
@@ -39,3 +40,7 @@
   macro(CExtractAxisToScalarGroup)
   macro(CReduceDomainToScalarGroup)
+  macro(CTemporalSplittingGroup)
+  macro(CDuplicateScalarToAxisGroup)
+  macro(CReduceScalarToScalarGroup)
+  macro(CReorderDomainGroup)
 }
Index: /XIOS/trunk/src/group_template.hpp
===================================================================
--- /XIOS/trunk/src/group_template.hpp	(revision 1536)
+++ /XIOS/trunk/src/group_template.hpp	(revision 1537)
@@ -6,4 +6,5 @@
 #include "event_server.hpp"
 #include "object_template.hpp"
+#include "context_client.hpp"
 
 namespace xios
@@ -72,4 +73,5 @@
          static bool dispatchEvent(CEventServer& event) ;
          void sendCreateChild(const string& id="") ;
+         void sendCreateChild(const string& id, CContextClient* client) ;
          void sendCreateChildGroup(const string& id="") ;
          static void recvCreateChild(CEventServer& event) ;
Index: /XIOS/trunk/src/group_template_decl.cpp
===================================================================
--- /XIOS/trunk/src/group_template_decl.cpp	(revision 1536)
+++ /XIOS/trunk/src/group_template_decl.cpp	(revision 1537)
@@ -23,4 +23,5 @@
   macro(ReduceAxisToScalar)
   macro(ReduceDomainToAxis)
+  macro(ReduceAxisToAxis)
   macro(ExtractDomainToAxis)
   macro(ComputeConnectivityDomain)
@@ -28,4 +29,8 @@
   macro(ExtractAxisToScalar)
   macro(ReduceDomainToScalar)
+  macro(TemporalSplitting)
+  macro(DuplicateScalarToAxis)
+  macro(ReduceScalarToScalar)
+  macro(ReorderDomain)
 
 }
Index: /XIOS/trunk/src/group_template_impl.hpp
===================================================================
--- /XIOS/trunk/src/group_template_impl.hpp	(revision 1536)
+++ /XIOS/trunk/src/group_template_impl.hpp	(revision 1537)
@@ -373,48 +373,78 @@
    void CGroupTemplate<U, V, W>::sendCreateChild(const string& id)
    {
+    CContext* context=CContext::getCurrent() ;  
+
+    if (context->hasClient)
+    // if (!context->hasServer )
+    {
+      // Use correct context client to send message
+//      CContextClient* contextClientTmp = (0 != context->clientPrimServer) ? context->clientPrimServer : context->client;
+      int nbSrvPools = (context->hasServer) ? context->clientPrimServer.size() : 1;
+      for (int i = 0; i < nbSrvPools; ++i)
+      {
+         CContextClient* contextClientTmp = (context->hasServer) ? context->clientPrimServer[i] : context->client;
+
+         CEventClient event(this->getType(),EVENT_ID_CREATE_CHILD) ;
+         if (contextClientTmp->isServerLeader())
+         {
+           CMessage msg ;
+           msg<<this->getId() ;
+           msg<<id ;
+           const std::list<int>& ranks = contextClientTmp->getRanksServerLeader();
+           for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
+             event.push(*itRank,1,msg) ;
+           contextClientTmp->sendEvent(event) ;
+         }
+         else contextClientTmp->sendEvent(event) ;
+      }
+    }
+      
+   }
+
+   template <class U, class V, class W>
+   void CGroupTemplate<U, V, W>::sendCreateChild(const string& id, CContextClient* client)
+   {
+
+    CEventClient event(this->getType(),EVENT_ID_CREATE_CHILD) ;
+    if (client->isServerLeader())
+    {
+      CMessage msg ;
+      msg<<this->getId() ;
+      msg<<id ;
+      const std::list<int>& ranks = client->getRanksServerLeader();
+      for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
+       event.push(*itRank,1,msg) ;
+      client->sendEvent(event) ;
+    }
+    else client->sendEvent(event) ;
+   }
+
+
+   template <class U, class V, class W>
+   void CGroupTemplate<U, V, W>::sendCreateChildGroup(const string& id)
+   {
     CContext* context=CContext::getCurrent() ;
-    
-    if (! context->hasServer )
+    if (context->hasClient)
     {
-       CContextClient* client=context->client ;
-
-       CEventClient event(this->getType(),EVENT_ID_CREATE_CHILD) ;   
-       if (client->isServerLeader())
-       {
-         CMessage msg ;
-         msg<<this->getId() ;
-         msg<<id ;
-         const std::list<int>& ranks = client->getRanksServerLeader();
-         for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
-           event.push(*itRank,1,msg) ;
-         client->sendEvent(event) ;
-       }
-       else client->sendEvent(event) ;
+      // Use correct context client to send message
+      // int nbSrvPools = (context->hasServer) ? context->clientPrimServer.size() : 1;
+      int nbSrvPools = (context->hasServer) ? (context->hasClient ? context->clientPrimServer.size() : 1) : 1;
+      for (int i = 0; i < nbSrvPools; ++i)
+      {
+        CContextClient* contextClientTmp = (context->hasServer) ? context->clientPrimServer[i] : context->client;
+        CEventClient event(this->getType(),EVENT_ID_CREATE_CHILD_GROUP) ;
+        if (contextClientTmp->isServerLeader())
+        {
+          CMessage msg ;
+          msg<<this->getId() ;
+          msg<<id ;
+          const std::list<int>& ranks = contextClientTmp->getRanksServerLeader();
+          for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
+            event.push(*itRank,1,msg) ;
+          contextClientTmp->sendEvent(event) ;
+        }
+        else contextClientTmp->sendEvent(event) ;
+      }
     }
-      
-   }
-   
-   template <class U, class V, class W>
-   void CGroupTemplate<U, V, W>::sendCreateChildGroup(const string& id)
-   {
-    CContext* context=CContext::getCurrent() ;
-    if (! context->hasServer )
-    {
-       CContextClient* client=context->client ;
-
-       CEventClient event(this->getType(),EVENT_ID_CREATE_CHILD_GROUP) ;   
-       if (client->isServerLeader())
-       {
-         CMessage msg ;
-         msg<<this->getId() ;
-         msg<<id ;
-         const std::list<int>& ranks = client->getRanksServerLeader();
-         for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
-           event.push(*itRank,1,msg) ;
-         client->sendEvent(event) ;
-       }
-       else client->sendEvent(event) ;
-    }
-      
    }
    
@@ -422,5 +452,4 @@
    void CGroupTemplate<U, V, W>::recvCreateChild(CEventServer& event)
    {
-      
       CBufferIn* buffer=event.subEvents.begin()->buffer;
       string id;
Index: /XIOS/trunk/src/interface/c/icdate.cpp
===================================================================
--- /XIOS/trunk/src/interface/c/icdate.cpp	(revision 1536)
+++ /XIOS/trunk/src/interface/c/icdate.cpp	(revision 1537)
@@ -70,7 +70,5 @@
                                    date_c.year, date_c.month, date_c.day,
                                    date_c.hour, date_c.minute, date_c.second);
-    xios::CDuration dur = { dur_c.year, dur_c.month, dur_c.day,
-                            dur_c.hour, dur_c.minute, dur_c.second,
-                            dur_c.timestep };
+    xios::CDuration dur( dur_c.year, dur_c.month, dur_c.day, dur_c.hour, dur_c.minute, dur_c.second, dur_c.timestep );
     xios::CDate res = date + dur;
     return { res.getYear(), res.getMonth(), res.getDay(), res.getHour(), res.getMinute(), res.getSecond() };
@@ -82,7 +80,6 @@
                                    date_c.year, date_c.month, date_c.day,
                                    date_c.hour, date_c.minute, date_c.second);
-    xios::CDuration dur = { dur_c.year, dur_c.month, dur_c.day,
-                            dur_c.hour, dur_c.minute, dur_c.second,
-                            dur_c.timestep };
+    xios::CDuration dur( dur_c.year, dur_c.month, dur_c.day, dur_c.hour, dur_c.minute, dur_c.second, dur_c.timestep );
+
     xios::CDate res = date - dur;
     return { res.getYear(), res.getMonth(), res.getDay(), res.getHour(), res.getMinute(), res.getSecond() };
Index: /XIOS/trunk/src/interface/c/icduplicate_scalar_to_axis.cpp
===================================================================
--- /XIOS/trunk/src/interface/c/icduplicate_scalar_to_axis.cpp	(revision 1537)
+++ /XIOS/trunk/src/interface/c/icduplicate_scalar_to_axis.cpp	(revision 1537)
@@ -0,0 +1,47 @@
+/* ************************************************************************** *
+ *      Copyright Â© IPSL/LSCE, xios, Avril 2010 - Octobre 2011         *
+ * ************************************************************************** */
+
+#include <boost/multi_array.hpp>
+#include <boost/shared_ptr.hpp>
+
+#include "xios.hpp"
+
+#include "object_template.hpp"
+#include "group_template.hpp"
+#include "attribute_template.hpp"
+
+#include "icutil.hpp"
+#include "timer.hpp"
+#include "duplicate_scalar_to_axis.hpp"
+
+extern "C"
+{
+// /////////////////////////////// DÃ©finitions ////////////////////////////// //
+
+   // ----------------------- RedÃ©finition de types ----------------------------
+
+   typedef xios::CDuplicateScalarToAxis      * XDuplicateScalarToAxisPtr;
+   
+   // ------------------------ CrÃ©ation des handle -----------------------------
+   void cxios_duplicate_scalar_to_axis_handle_create(XDuplicateScalarToAxisPtr * _ret, const char * _id, int _id_len)
+   {
+      std::string id;
+      if (!cstr2string(_id, _id_len, id)) return;
+      CTimer::get("XIOS").resume() ;
+      *_ret = xios::CDuplicateScalarToAxis::get(id);
+      CTimer::get("XIOS").suspend() ;
+   }
+
+   // -------------------- VÃ©rification des identifiants -----------------------
+   void cxios_duplicate_scalar_to_axis_valid_id(bool * _ret, const char * _id, int _id_len)
+   {
+      std::string id;
+      if (!cstr2string(_id, _id_len, id)) return;
+
+      CTimer::get("XIOS").resume() ;
+      *_ret = xios::CDuplicateScalarToAxis::has(id);
+      CTimer::get("XIOS").suspend() ;
+   }
+
+} // extern "C"
Index: /XIOS/trunk/src/interface/c/icduration.cpp
===================================================================
--- /XIOS/trunk/src/interface/c/icduration.cpp	(revision 1536)
+++ /XIOS/trunk/src/interface/c/icduration.cpp	(revision 1537)
@@ -7,7 +7,5 @@
   void cxios_duration_convert_to_string(cxios_duration dur_c, char* str, int str_size)
   {
-    xios::CDuration dur = { dur_c.year, dur_c.month, dur_c.day,
-                            dur_c.hour, dur_c.minute, dur_c.second,
-                            dur_c.timestep };
+    xios::CDuration dur( dur_c.year, dur_c.month, dur_c.day, dur_c.hour, dur_c.minute, dur_c.second, dur_c.timestep );
 
     if (!string_copy(dur.toString(), str, str_size))
@@ -28,10 +26,7 @@
   cxios_duration cxios_duration_add(cxios_duration dur1_c, cxios_duration dur2_c)
   {
-    xios::CDuration dur1 = { dur1_c.year, dur1_c.month, dur1_c.day,
-                             dur1_c.hour, dur1_c.minute, dur1_c.second,
-                             dur1_c.timestep };
-    xios::CDuration dur2 = { dur2_c.year, dur2_c.month, dur2_c.day,
-                             dur2_c.hour, dur2_c.minute, dur2_c.second,
-                             dur2_c.timestep };
+    xios::CDuration dur1( dur1_c.year, dur1_c.month, dur1_c.day, dur1_c.hour, dur1_c.minute, dur1_c.second, dur1_c.timestep );
+    xios::CDuration dur2( dur2_c.year, dur2_c.month, dur2_c.day, dur2_c.hour, dur2_c.minute, dur2_c.second, dur2_c.timestep );
+
     xios::CDuration res = dur1 + dur2;
     return { res.year, res.month, res.day, res.hour, res.minute, res.second, res.timestep };
@@ -40,10 +35,7 @@
   cxios_duration cxios_duration_sub(cxios_duration dur1_c, cxios_duration dur2_c)
   {
-    xios::CDuration dur1 = { dur1_c.year, dur1_c.month, dur1_c.day,
-                             dur1_c.hour, dur1_c.minute, dur1_c.second,
-                             dur1_c.timestep };
-    xios::CDuration dur2 = { dur2_c.year, dur2_c.month, dur2_c.day,
-                             dur2_c.hour, dur2_c.minute, dur2_c.second,
-                             dur2_c.timestep };
+    xios::CDuration dur1( dur1_c.year, dur1_c.month, dur1_c.day, dur1_c.hour, dur1_c.minute, dur1_c.second, dur1_c.timestep );
+    xios::CDuration dur2( dur2_c.year, dur2_c.month, dur2_c.day, dur2_c.hour, dur2_c.minute, dur2_c.second, dur2_c.timestep );
+
     xios::CDuration res = dur1 - dur2;
     return { res.year, res.month, res.day, res.hour, res.minute, res.second, res.timestep };
@@ -52,7 +44,5 @@
   cxios_duration cxios_duration_mult(double val, cxios_duration dur_c)
   {
-    xios::CDuration dur = { dur_c.year, dur_c.month, dur_c.day,
-                            dur_c.hour, dur_c.minute, dur_c.second,
-                            dur_c.timestep };
+    xios::CDuration dur( dur_c.year, dur_c.month, dur_c.day, dur_c.hour, dur_c.minute, dur_c.second, dur_c.timestep );
     xios::CDuration res = val * dur;
     return { res.year, res.month, res.day, res.hour, res.minute, res.second, res.timestep };
@@ -61,7 +51,5 @@
   cxios_duration cxios_duration_neg(cxios_duration dur_c)
   {
-    xios::CDuration dur = { dur_c.year, dur_c.month, dur_c.day,
-                            dur_c.hour, dur_c.minute, dur_c.second,
-                            dur_c.timestep };
+    xios::CDuration dur( dur_c.year, dur_c.month, dur_c.day, dur_c.hour, dur_c.minute, dur_c.second, dur_c.timestep );
     xios::CDuration res = -dur;
     return { res.year, res.month, res.day, res.hour, res.minute, res.second, res.timestep };
@@ -70,10 +58,6 @@
   bool cxios_duration_eq(cxios_duration dur1_c, cxios_duration dur2_c)
   {
-    xios::CDuration dur1 = { dur1_c.year, dur1_c.month, dur1_c.day,
-                             dur1_c.hour, dur1_c.minute, dur1_c.second,
-                             dur1_c.timestep };
-    xios::CDuration dur2 = { dur2_c.year, dur2_c.month, dur2_c.day,
-                             dur2_c.hour, dur2_c.minute, dur2_c.second,
-                             dur2_c.timestep };
+    xios::CDuration dur1( dur1_c.year, dur1_c.month, dur1_c.day, dur1_c.hour, dur1_c.minute, dur1_c.second, dur1_c.timestep );
+    xios::CDuration dur2( dur2_c.year, dur2_c.month, dur2_c.day, dur2_c.hour, dur2_c.minute, dur2_c.second, dur2_c.timestep );
     return (dur1 == dur2);
   }
@@ -81,10 +65,6 @@
   bool cxios_duration_neq(cxios_duration dur1_c, cxios_duration dur2_c)
   {
-    xios::CDuration dur1 = { dur1_c.year, dur1_c.month, dur1_c.day,
-                             dur1_c.hour, dur1_c.minute, dur1_c.second,
-                             dur1_c.timestep };
-    xios::CDuration dur2 = { dur2_c.year, dur2_c.month, dur2_c.day,
-                             dur2_c.hour, dur2_c.minute, dur2_c.second,
-                             dur2_c.timestep };
+    xios::CDuration dur1( dur1_c.year, dur1_c.month, dur1_c.day, dur1_c.hour, dur1_c.minute, dur1_c.second, dur1_c.timestep );
+    xios::CDuration dur2( dur2_c.year, dur2_c.month, dur2_c.day, dur2_c.hour, dur2_c.minute, dur2_c.second, dur2_c.timestep );
     return (dur1 != dur2);
   }
Index: /XIOS/trunk/src/interface/c/icreduce_axis_to_axis.cpp
===================================================================
--- /XIOS/trunk/src/interface/c/icreduce_axis_to_axis.cpp	(revision 1537)
+++ /XIOS/trunk/src/interface/c/icreduce_axis_to_axis.cpp	(revision 1537)
@@ -0,0 +1,47 @@
+/* ************************************************************************** *
+ *      Copyright Â© IPSL/LSCE, xios, Avril 2010 - Octobre 2011         *
+ * ************************************************************************** */
+
+#include <boost/multi_array.hpp>
+#include <boost/shared_ptr.hpp>
+
+#include "xios.hpp"
+
+#include "object_template.hpp"
+#include "group_template.hpp"
+#include "attribute_template.hpp"
+
+#include "icutil.hpp"
+#include "timer.hpp"
+#include "reduce_axis_to_axis.hpp"
+
+extern "C"
+{
+// /////////////////////////////// DÃ©finitions ////////////////////////////// //
+
+   // ----------------------- RedÃ©finition de types ----------------------------
+
+   typedef xios::CReduceAxisToAxis      * XReduceAxisToAxisPtr;
+   
+   // ------------------------ CrÃ©ation des handle -----------------------------
+   void cxios_reduce_axis_to_axis_handle_create(XReduceAxisToAxisPtr * _ret, const char * _id, int _id_len)
+   {
+      std::string id;
+      if (!cstr2string(_id, _id_len, id)) return;
+      CTimer::get("XIOS").resume() ;
+      *_ret = xios::CReduceAxisToAxis::get(id);
+      CTimer::get("XIOS").suspend() ;
+   }
+
+   // -------------------- VÃ©rification des identifiants -----------------------
+   void cxios_reduce_axis_to_axis_valid_id(bool * _ret, const char * _id, int _id_len)
+   {
+      std::string id;
+      if (!cstr2string(_id, _id_len, id)) return;
+
+      CTimer::get("XIOS").resume() ;
+      *_ret = xios::CReduceAxisToAxis::has(id);
+      CTimer::get("XIOS").suspend() ;
+   }
+
+} // extern "C"
Index: /XIOS/trunk/src/interface/c/icreduce_scalar_to_scalar.cpp
===================================================================
--- /XIOS/trunk/src/interface/c/icreduce_scalar_to_scalar.cpp	(revision 1537)
+++ /XIOS/trunk/src/interface/c/icreduce_scalar_to_scalar.cpp	(revision 1537)
@@ -0,0 +1,47 @@
+/* ************************************************************************** *
+ *      Copyright Â© IPSL/LSCE, xios, Avril 2010 - Octobre 2011         *
+ * ************************************************************************** */
+
+#include <boost/multi_array.hpp>
+#include <boost/shared_ptr.hpp>
+
+#include "xios.hpp"
+
+#include "object_template.hpp"
+#include "group_template.hpp"
+#include "attribute_template.hpp"
+
+#include "icutil.hpp"
+#include "timer.hpp"
+#include "reduce_scalar_to_scalar.hpp"
+
+extern "C"
+{
+// /////////////////////////////// DÃ©finitions ////////////////////////////// //
+
+   // ----------------------- RedÃ©finition de types ----------------------------
+
+   typedef xios::CReduceScalarToScalar      * XReduceScalarToScalarPtr;
+   
+   // ------------------------ CrÃ©ation des handle -----------------------------
+   void cxios_reduce_scalar_to_scalar_handle_create(XReduceScalarToScalarPtr * _ret, const char * _id, int _id_len)
+   {
+      std::string id;
+      if (!cstr2string(_id, _id_len, id)) return;
+      CTimer::get("XIOS").resume() ;
+      *_ret = xios::CReduceScalarToScalar::get(id);
+      CTimer::get("XIOS").suspend() ;
+   }
+
+   // -------------------- VÃ©rification des identifiants -----------------------
+   void cxios_reduce_scalar_to_scalar_valid_id(bool * _ret, const char * _id, int _id_len)
+   {
+      std::string id;
+      if (!cstr2string(_id, _id_len, id)) return;
+
+      CTimer::get("XIOS").resume() ;
+      *_ret = xios::CReduceScalarToScalar::has(id);
+      CTimer::get("XIOS").suspend() ;
+   }
+
+} // extern "C"
Index: /XIOS/trunk/src/interface/c/icreorder_domain.cpp
===================================================================
--- /XIOS/trunk/src/interface/c/icreorder_domain.cpp	(revision 1537)
+++ /XIOS/trunk/src/interface/c/icreorder_domain.cpp	(revision 1537)
@@ -0,0 +1,46 @@
+/* ************************************************************************** *
+ *      Copyright Â© IPSL/LSCE, xios, Avril 2010 - Octobre 2011         *
+ * ************************************************************************** */
+
+#include <boost/multi_array.hpp>
+#include <boost/shared_ptr.hpp>
+
+#include "xios.hpp"
+
+#include "object_template.hpp"
+#include "group_template.hpp"
+#include "attribute_template.hpp"
+
+#include "icutil.hpp"
+#include "timer.hpp"
+#include "reorder_domain.hpp"
+
+extern "C"
+{
+// /////////////////////////////// DÃ©finitions ////////////////////////////// //
+
+   // ----------------------- RedÃ©finition de types ----------------------------
+
+   typedef xios::CReorderDomain * XReorderDomainPtr;
+
+   // ------------------------ CrÃ©ation des handle -----------------------------
+   void cxios_reorder_domain_handle_create(XReorderDomainPtr * _ret, const char * _id, int _id_len)
+   {
+      std::string id;
+      if (!cstr2string(_id, _id_len, id)) return;
+      CTimer::get("XIOS").resume() ;
+      *_ret = xios::CReorderDomain::get(id);
+      CTimer::get("XIOS").suspend() ;
+   }
+
+   // -------------------- VÃ©rification des identifiants -----------------------
+   void cxios_reorder_domain_valid_id(bool * _ret, const char * _id, int _id_len)
+   {
+      std::string id;
+      if (!cstr2string(_id, _id_len, id)) return;
+
+      CTimer::get("XIOS").resume() ;
+      *_ret = xios::CReorderDomain::has(id);
+      CTimer::get("XIOS").suspend() ;
+   }
+} // extern "C"
Index: /XIOS/trunk/src/interface/c/ictemporal_splitting.cpp
===================================================================
--- /XIOS/trunk/src/interface/c/ictemporal_splitting.cpp	(revision 1537)
+++ /XIOS/trunk/src/interface/c/ictemporal_splitting.cpp	(revision 1537)
@@ -0,0 +1,47 @@
+/* ************************************************************************** *
+ *      Copyright Â© IPSL/LSCE, xios, Avril 2010 - Octobre 2011         *
+ * ************************************************************************** */
+
+#include <boost/multi_array.hpp>
+#include <boost/shared_ptr.hpp>
+
+#include "xios.hpp"
+
+#include "object_template.hpp"
+#include "group_template.hpp"
+#include "attribute_template.hpp"
+
+#include "icutil.hpp"
+#include "timer.hpp"
+#include "temporal_splitting.hpp"
+
+extern "C"
+{
+// /////////////////////////////// DÃ©finitions ////////////////////////////// //
+
+   // ----------------------- RedÃ©finition de types ----------------------------
+
+   typedef xios::CTemporalSplitting      * XTemporalSplittingPtr;
+   
+   // ------------------------ CrÃ©ation des handle -----------------------------
+   void cxios_temporal_splitting_handle_create(XTemporalSplittingPtr * _ret, const char * _id, int _id_len)
+   {
+      std::string id;
+      if (!cstr2string(_id, _id_len, id)) return;
+      CTimer::get("XIOS").resume() ;
+      *_ret = xios::CTemporalSplitting::get(id);
+      CTimer::get("XIOS").suspend() ;
+   }
+
+   // -------------------- VÃ©rification des identifiants -----------------------
+   void cxios_temporal_splitting_valid_id(bool * _ret, const char * _id, int _id_len)
+   {
+      std::string id;
+      if (!cstr2string(_id, _id_len, id)) return;
+
+      CTimer::get("XIOS").resume() ;
+      *_ret = xios::CTemporalSplitting::has(id);
+      CTimer::get("XIOS").suspend() ;
+   }
+
+} // extern "C"
Index: /XIOS/trunk/src/interface/c_attr/icaxis_attr.cpp
===================================================================
--- /XIOS/trunk/src/interface/c_attr/icaxis_attr.cpp	(revision 1536)
+++ /XIOS/trunk/src/interface/c_attr/icaxis_attr.cpp	(revision 1537)
@@ -44,4 +44,30 @@
 
 
+  void cxios_set_axis_axis_type(axis_Ptr axis_hdl, const char * axis_type, int axis_type_size)
+  {
+    std::string axis_type_str;
+    if (!cstr2string(axis_type, axis_type_size, axis_type_str)) return;
+    CTimer::get("XIOS").resume();
+    axis_hdl->axis_type.fromString(axis_type_str);
+    CTimer::get("XIOS").suspend();
+  }
+
+  void cxios_get_axis_axis_type(axis_Ptr axis_hdl, char * axis_type, int axis_type_size)
+  {
+    CTimer::get("XIOS").resume();
+    if (!string_copy(axis_hdl->axis_type.getInheritedStringValue(), axis_type, axis_type_size))
+      ERROR("void cxios_get_axis_axis_type(axis_Ptr axis_hdl, char * axis_type, int axis_type_size)", << "Input string is too short");
+    CTimer::get("XIOS").suspend();
+  }
+
+  bool cxios_is_defined_axis_axis_type(axis_Ptr axis_hdl)
+  {
+     CTimer::get("XIOS").resume();
+     bool isDefined = axis_hdl->axis_type.hasInheritedValue();
+     CTimer::get("XIOS").suspend();
+     return isDefined;
+  }
+
+
   void cxios_set_axis_begin(axis_Ptr axis_hdl, int begin)
   {
@@ -92,4 +118,56 @@
 
 
+  void cxios_set_axis_bounds_name(axis_Ptr axis_hdl, const char * bounds_name, int bounds_name_size)
+  {
+    std::string bounds_name_str;
+    if (!cstr2string(bounds_name, bounds_name_size, bounds_name_str)) return;
+    CTimer::get("XIOS").resume();
+    axis_hdl->bounds_name.setValue(bounds_name_str);
+    CTimer::get("XIOS").suspend();
+  }
+
+  void cxios_get_axis_bounds_name(axis_Ptr axis_hdl, char * bounds_name, int bounds_name_size)
+  {
+    CTimer::get("XIOS").resume();
+    if (!string_copy(axis_hdl->bounds_name.getInheritedValue(), bounds_name, bounds_name_size))
+      ERROR("void cxios_get_axis_bounds_name(axis_Ptr axis_hdl, char * bounds_name, int bounds_name_size)", << "Input string is too short");
+    CTimer::get("XIOS").suspend();
+  }
+
+  bool cxios_is_defined_axis_bounds_name(axis_Ptr axis_hdl)
+  {
+     CTimer::get("XIOS").resume();
+     bool isDefined = axis_hdl->bounds_name.hasInheritedValue();
+     CTimer::get("XIOS").suspend();
+     return isDefined;
+  }
+
+
+  void cxios_set_axis_comment(axis_Ptr axis_hdl, const char * comment, int comment_size)
+  {
+    std::string comment_str;
+    if (!cstr2string(comment, comment_size, comment_str)) return;
+    CTimer::get("XIOS").resume();
+    axis_hdl->comment.setValue(comment_str);
+    CTimer::get("XIOS").suspend();
+  }
+
+  void cxios_get_axis_comment(axis_Ptr axis_hdl, char * comment, int comment_size)
+  {
+    CTimer::get("XIOS").resume();
+    if (!string_copy(axis_hdl->comment.getInheritedValue(), comment, comment_size))
+      ERROR("void cxios_get_axis_comment(axis_Ptr axis_hdl, char * comment, int comment_size)", << "Input string is too short");
+    CTimer::get("XIOS").suspend();
+  }
+
+  bool cxios_is_defined_axis_comment(axis_Ptr axis_hdl)
+  {
+     CTimer::get("XIOS").resume();
+     bool isDefined = axis_hdl->comment.hasInheritedValue();
+     CTimer::get("XIOS").suspend();
+     return isDefined;
+  }
+
+
   void cxios_set_axis_data_begin(axis_Ptr axis_hdl, int data_begin)
   {
@@ -158,4 +236,134 @@
      CTimer::get("XIOS").resume();
      bool isDefined = axis_hdl->data_n.hasInheritedValue();
+     CTimer::get("XIOS").suspend();
+     return isDefined;
+  }
+
+
+  void cxios_set_axis_dim_name(axis_Ptr axis_hdl, const char * dim_name, int dim_name_size)
+  {
+    std::string dim_name_str;
+    if (!cstr2string(dim_name, dim_name_size, dim_name_str)) return;
+    CTimer::get("XIOS").resume();
+    axis_hdl->dim_name.setValue(dim_name_str);
+    CTimer::get("XIOS").suspend();
+  }
+
+  void cxios_get_axis_dim_name(axis_Ptr axis_hdl, char * dim_name, int dim_name_size)
+  {
+    CTimer::get("XIOS").resume();
+    if (!string_copy(axis_hdl->dim_name.getInheritedValue(), dim_name, dim_name_size))
+      ERROR("void cxios_get_axis_dim_name(axis_Ptr axis_hdl, char * dim_name, int dim_name_size)", << "Input string is too short");
+    CTimer::get("XIOS").suspend();
+  }
+
+  bool cxios_is_defined_axis_dim_name(axis_Ptr axis_hdl)
+  {
+     CTimer::get("XIOS").resume();
+     bool isDefined = axis_hdl->dim_name.hasInheritedValue();
+     CTimer::get("XIOS").suspend();
+     return isDefined;
+  }
+
+
+  void cxios_set_axis_formula(axis_Ptr axis_hdl, const char * formula, int formula_size)
+  {
+    std::string formula_str;
+    if (!cstr2string(formula, formula_size, formula_str)) return;
+    CTimer::get("XIOS").resume();
+    axis_hdl->formula.setValue(formula_str);
+    CTimer::get("XIOS").suspend();
+  }
+
+  void cxios_get_axis_formula(axis_Ptr axis_hdl, char * formula, int formula_size)
+  {
+    CTimer::get("XIOS").resume();
+    if (!string_copy(axis_hdl->formula.getInheritedValue(), formula, formula_size))
+      ERROR("void cxios_get_axis_formula(axis_Ptr axis_hdl, char * formula, int formula_size)", << "Input string is too short");
+    CTimer::get("XIOS").suspend();
+  }
+
+  bool cxios_is_defined_axis_formula(axis_Ptr axis_hdl)
+  {
+     CTimer::get("XIOS").resume();
+     bool isDefined = axis_hdl->formula.hasInheritedValue();
+     CTimer::get("XIOS").suspend();
+     return isDefined;
+  }
+
+
+  void cxios_set_axis_formula_bounds(axis_Ptr axis_hdl, const char * formula_bounds, int formula_bounds_size)
+  {
+    std::string formula_bounds_str;
+    if (!cstr2string(formula_bounds, formula_bounds_size, formula_bounds_str)) return;
+    CTimer::get("XIOS").resume();
+    axis_hdl->formula_bounds.setValue(formula_bounds_str);
+    CTimer::get("XIOS").suspend();
+  }
+
+  void cxios_get_axis_formula_bounds(axis_Ptr axis_hdl, char * formula_bounds, int formula_bounds_size)
+  {
+    CTimer::get("XIOS").resume();
+    if (!string_copy(axis_hdl->formula_bounds.getInheritedValue(), formula_bounds, formula_bounds_size))
+      ERROR("void cxios_get_axis_formula_bounds(axis_Ptr axis_hdl, char * formula_bounds, int formula_bounds_size)", << "Input string is too short");
+    CTimer::get("XIOS").suspend();
+  }
+
+  bool cxios_is_defined_axis_formula_bounds(axis_Ptr axis_hdl)
+  {
+     CTimer::get("XIOS").resume();
+     bool isDefined = axis_hdl->formula_bounds.hasInheritedValue();
+     CTimer::get("XIOS").suspend();
+     return isDefined;
+  }
+
+
+  void cxios_set_axis_formula_term(axis_Ptr axis_hdl, const char * formula_term, int formula_term_size)
+  {
+    std::string formula_term_str;
+    if (!cstr2string(formula_term, formula_term_size, formula_term_str)) return;
+    CTimer::get("XIOS").resume();
+    axis_hdl->formula_term.setValue(formula_term_str);
+    CTimer::get("XIOS").suspend();
+  }
+
+  void cxios_get_axis_formula_term(axis_Ptr axis_hdl, char * formula_term, int formula_term_size)
+  {
+    CTimer::get("XIOS").resume();
+    if (!string_copy(axis_hdl->formula_term.getInheritedValue(), formula_term, formula_term_size))
+      ERROR("void cxios_get_axis_formula_term(axis_Ptr axis_hdl, char * formula_term, int formula_term_size)", << "Input string is too short");
+    CTimer::get("XIOS").suspend();
+  }
+
+  bool cxios_is_defined_axis_formula_term(axis_Ptr axis_hdl)
+  {
+     CTimer::get("XIOS").resume();
+     bool isDefined = axis_hdl->formula_term.hasInheritedValue();
+     CTimer::get("XIOS").suspend();
+     return isDefined;
+  }
+
+
+  void cxios_set_axis_formula_term_bounds(axis_Ptr axis_hdl, const char * formula_term_bounds, int formula_term_bounds_size)
+  {
+    std::string formula_term_bounds_str;
+    if (!cstr2string(formula_term_bounds, formula_term_bounds_size, formula_term_bounds_str)) return;
+    CTimer::get("XIOS").resume();
+    axis_hdl->formula_term_bounds.setValue(formula_term_bounds_str);
+    CTimer::get("XIOS").suspend();
+  }
+
+  void cxios_get_axis_formula_term_bounds(axis_Ptr axis_hdl, char * formula_term_bounds, int formula_term_bounds_size)
+  {
+    CTimer::get("XIOS").resume();
+    if (!string_copy(axis_hdl->formula_term_bounds.getInheritedValue(), formula_term_bounds, formula_term_bounds_size))
+      ERROR("void cxios_get_axis_formula_term_bounds(axis_Ptr axis_hdl, char * formula_term_bounds, int formula_term_bounds_size)", << "Input string is too short");
+    CTimer::get("XIOS").suspend();
+  }
+
+  bool cxios_is_defined_axis_formula_term_bounds(axis_Ptr axis_hdl)
+  {
+     CTimer::get("XIOS").resume();
+     bool isDefined = axis_hdl->formula_term_bounds.hasInheritedValue();
      CTimer::get("XIOS").suspend();
      return isDefined;
Index: /XIOS/trunk/src/interface/c_attr/icaxisgroup_attr.cpp
===================================================================
--- /XIOS/trunk/src/interface/c_attr/icaxisgroup_attr.cpp	(revision 1536)
+++ /XIOS/trunk/src/interface/c_attr/icaxisgroup_attr.cpp	(revision 1537)
@@ -44,4 +44,30 @@
 
 
+  void cxios_set_axisgroup_axis_type(axisgroup_Ptr axisgroup_hdl, const char * axis_type, int axis_type_size)
+  {
+    std::string axis_type_str;
+    if (!cstr2string(axis_type, axis_type_size, axis_type_str)) return;
+    CTimer::get("XIOS").resume();
+    axisgroup_hdl->axis_type.fromString(axis_type_str);
+    CTimer::get("XIOS").suspend();
+  }
+
+  void cxios_get_axisgroup_axis_type(axisgroup_Ptr axisgroup_hdl, char * axis_type, int axis_type_size)
+  {
+    CTimer::get("XIOS").resume();
+    if (!string_copy(axisgroup_hdl->axis_type.getInheritedStringValue(), axis_type, axis_type_size))
+      ERROR("void cxios_get_axisgroup_axis_type(axisgroup_Ptr axisgroup_hdl, char * axis_type, int axis_type_size)", << "Input string is too short");
+    CTimer::get("XIOS").suspend();
+  }
+
+  bool cxios_is_defined_axisgroup_axis_type(axisgroup_Ptr axisgroup_hdl)
+  {
+     CTimer::get("XIOS").resume();
+     bool isDefined = axisgroup_hdl->axis_type.hasInheritedValue();
+     CTimer::get("XIOS").suspend();
+     return isDefined;
+  }
+
+
   void cxios_set_axisgroup_begin(axisgroup_Ptr axisgroup_hdl, int begin)
   {
@@ -92,4 +118,56 @@
 
 
+  void cxios_set_axisgroup_bounds_name(axisgroup_Ptr axisgroup_hdl, const char * bounds_name, int bounds_name_size)
+  {
+    std::string bounds_name_str;
+    if (!cstr2string(bounds_name, bounds_name_size, bounds_name_str)) return;
+    CTimer::get("XIOS").resume();
+    axisgroup_hdl->bounds_name.setValue(bounds_name_str);
+    CTimer::get("XIOS").suspend();
+  }
+
+  void cxios_get_axisgroup_bounds_name(axisgroup_Ptr axisgroup_hdl, char * bounds_name, int bounds_name_size)
+  {
+    CTimer::get("XIOS").resume();
+    if (!string_copy(axisgroup_hdl->bounds_name.getInheritedValue(), bounds_name, bounds_name_size))
+      ERROR("void cxios_get_axisgroup_bounds_name(axisgroup_Ptr axisgroup_hdl, char * bounds_name, int bounds_name_size)", << "Input string is too short");
+    CTimer::get("XIOS").suspend();
+  }
+
+  bool cxios_is_defined_axisgroup_bounds_name(axisgroup_Ptr axisgroup_hdl)
+  {
+     CTimer::get("XIOS").resume();
+     bool isDefined = axisgroup_hdl->bounds_name.hasInheritedValue();
+     CTimer::get("XIOS").suspend();
+     return isDefined;
+  }
+
+
+  void cxios_set_axisgroup_comment(axisgroup_Ptr axisgroup_hdl, const char * comment, int comment_size)
+  {
+    std::string comment_str;
+    if (!cstr2string(comment, comment_size, comment_str)) return;
+    CTimer::get("XIOS").resume();
+    axisgroup_hdl->comment.setValue(comment_str);
+    CTimer::get("XIOS").suspend();
+  }
+
+  void cxios_get_axisgroup_comment(axisgroup_Ptr axisgroup_hdl, char * comment, int comment_size)
+  {
+    CTimer::get("XIOS").resume();
+    if (!string_copy(axisgroup_hdl->comment.getInheritedValue(), comment, comment_size))
+      ERROR("void cxios_get_axisgroup_comment(axisgroup_Ptr axisgroup_hdl, char * comment, int comment_size)", << "Input string is too short");
+    CTimer::get("XIOS").suspend();
+  }
+
+  bool cxios_is_defined_axisgroup_comment(axisgroup_Ptr axisgroup_hdl)
+  {
+     CTimer::get("XIOS").resume();
+     bool isDefined = axisgroup_hdl->comment.hasInheritedValue();
+     CTimer::get("XIOS").suspend();
+     return isDefined;
+  }
+
+
   void cxios_set_axisgroup_data_begin(axisgroup_Ptr axisgroup_hdl, int data_begin)
   {
@@ -158,4 +236,134 @@
      CTimer::get("XIOS").resume();
      bool isDefined = axisgroup_hdl->data_n.hasInheritedValue();
+     CTimer::get("XIOS").suspend();
+     return isDefined;
+  }
+
+
+  void cxios_set_axisgroup_dim_name(axisgroup_Ptr axisgroup_hdl, const char * dim_name, int dim_name_size)
+  {
+    std::string dim_name_str;
+    if (!cstr2string(dim_name, dim_name_size, dim_name_str)) return;
+    CTimer::get("XIOS").resume();
+    axisgroup_hdl->dim_name.setValue(dim_name_str);
+    CTimer::get("XIOS").suspend();
+  }
+
+  void cxios_get_axisgroup_dim_name(axisgroup_Ptr axisgroup_hdl, char * dim_name, int dim_name_size)
+  {
+    CTimer::get("XIOS").resume();
+    if (!string_copy(axisgroup_hdl->dim_name.getInheritedValue(), dim_name, dim_name_size))
+      ERROR("void cxios_get_axisgroup_dim_name(axisgroup_Ptr axisgroup_hdl, char * dim_name, int dim_name_size)", << "Input string is too short");
+    CTimer::get("XIOS").suspend();
+  }
+
+  bool cxios_is_defined_axisgroup_dim_name(axisgroup_Ptr axisgroup_hdl)
+  {
+     CTimer::get("XIOS").resume();
+     bool isDefined = axisgroup_hdl->dim_name.hasInheritedValue();
+     CTimer::get("XIOS").suspend();
+     return isDefined;
+  }
+
+
+  void cxios_set_axisgroup_formula(axisgroup_Ptr axisgroup_hdl, const char * formula, int formula_size)
+  {
+    std::string formula_str;
+    if (!cstr2string(formula, formula_size, formula_str)) return;
+    CTimer::get("XIOS").resume();
+    axisgroup_hdl->formula.setValue(formula_str);
+    CTimer::get("XIOS").suspend();
+  }
+
+  void cxios_get_axisgroup_formula(axisgroup_Ptr axisgroup_hdl, char * formula, int formula_size)
+  {
+    CTimer::get("XIOS").resume();
+    if (!string_copy(axisgroup_hdl->formula.getInheritedValue(), formula, formula_size))
+      ERROR("void cxios_get_axisgroup_formula(axisgroup_Ptr axisgroup_hdl, char * formula, int formula_size)", << "Input string is too short");
+    CTimer::get("XIOS").suspend();
+  }
+
+  bool cxios_is_defined_axisgroup_formula(axisgroup_Ptr axisgroup_hdl)
+  {
+     CTimer::get("XIOS").resume();
+     bool isDefined = axisgroup_hdl->formula.hasInheritedValue();
+     CTimer::get("XIOS").suspend();
+     return isDefined;
+  }
+
+
+  void cxios_set_axisgroup_formula_bounds(axisgroup_Ptr axisgroup_hdl, const char * formula_bounds, int formula_bounds_size)
+  {
+    std::string formula_bounds_str;
+    if (!cstr2string(formula_bounds, formula_bounds_size, formula_bounds_str)) return;
+    CTimer::get("XIOS").resume();
+    axisgroup_hdl->formula_bounds.setValue(formula_bounds_str);
+    CTimer::get("XIOS").suspend();
+  }
+
+  void cxios_get_axisgroup_formula_bounds(axisgroup_Ptr axisgroup_hdl, char * formula_bounds, int formula_bounds_size)
+  {
+    CTimer::get("XIOS").resume();
+    if (!string_copy(axisgroup_hdl->formula_bounds.getInheritedValue(), formula_bounds, formula_bounds_size))
+      ERROR("void cxios_get_axisgroup_formula_bounds(axisgroup_Ptr axisgroup_hdl, char * formula_bounds, int formula_bounds_size)", << "Input string is too short");
+    CTimer::get("XIOS").suspend();
+  }
+
+  bool cxios_is_defined_axisgroup_formula_bounds(axisgroup_Ptr axisgroup_hdl)
+  {
+     CTimer::get("XIOS").resume();
+     bool isDefined = axisgroup_hdl->formula_bounds.hasInheritedValue();
+     CTimer::get("XIOS").suspend();
+     return isDefined;
+  }
+
+
+  void cxios_set_axisgroup_formula_term(axisgroup_Ptr axisgroup_hdl, const char * formula_term, int formula_term_size)
+  {
+    std::string formula_term_str;
+    if (!cstr2string(formula_term, formula_term_size, formula_term_str)) return;
+    CTimer::get("XIOS").resume();
+    axisgroup_hdl->formula_term.setValue(formula_term_str);
+    CTimer::get("XIOS").suspend();
+  }
+
+  void cxios_get_axisgroup_formula_term(axisgroup_Ptr axisgroup_hdl, char * formula_term, int formula_term_size)
+  {
+    CTimer::get("XIOS").resume();
+    if (!string_copy(axisgroup_hdl->formula_term.getInheritedValue(), formula_term, formula_term_size))
+      ERROR("void cxios_get_axisgroup_formula_term(axisgroup_Ptr axisgroup_hdl, char * formula_term, int formula_term_size)", << "Input string is too short");
+    CTimer::get("XIOS").suspend();
+  }
+
+  bool cxios_is_defined_axisgroup_formula_term(axisgroup_Ptr axisgroup_hdl)
+  {
+     CTimer::get("XIOS").resume();
+     bool isDefined = axisgroup_hdl->formula_term.hasInheritedValue();
+     CTimer::get("XIOS").suspend();
+     return isDefined;
+  }
+
+
+  void cxios_set_axisgroup_formula_term_bounds(axisgroup_Ptr axisgroup_hdl, const char * formula_term_bounds, int formula_term_bounds_size)
+  {
+    std::string formula_term_bounds_str;
+    if (!cstr2string(formula_term_bounds, formula_term_bounds_size, formula_term_bounds_str)) return;
+    CTimer::get("XIOS").resume();
+    axisgroup_hdl->formula_term_bounds.setValue(formula_term_bounds_str);
+    CTimer::get("XIOS").suspend();
+  }
+
+  void cxios_get_axisgroup_formula_term_bounds(axisgroup_Ptr axisgroup_hdl, char * formula_term_bounds, int formula_term_bounds_size)
+  {
+    CTimer::get("XIOS").resume();
+    if (!string_copy(axisgroup_hdl->formula_term_bounds.getInheritedValue(), formula_term_bounds, formula_term_bounds_size))
+      ERROR("void cxios_get_axisgroup_formula_term_bounds(axisgroup_Ptr axisgroup_hdl, char * formula_term_bounds, int formula_term_bounds_size)", << "Input string is too short");
+    CTimer::get("XIOS").suspend();
+  }
+
+  bool cxios_is_defined_axisgroup_formula_term_bounds(axisgroup_Ptr axisgroup_hdl)
+  {
+     CTimer::get("XIOS").resume();
+     bool isDefined = axisgroup_hdl->formula_term_bounds.hasInheritedValue();
      CTimer::get("XIOS").suspend();
      return isDefined;
Index: /XIOS/trunk/src/interface/c_attr/iccalendar_wrapper_attr.cpp
===================================================================
--- /XIOS/trunk/src/interface/c_attr/iccalendar_wrapper_attr.cpp	(revision 1536)
+++ /XIOS/trunk/src/interface/c_attr/iccalendar_wrapper_attr.cpp	(revision 1537)
@@ -18,4 +18,30 @@
   typedef xios::CCalendarWrapper* calendar_wrapper_Ptr;
 
+  void cxios_set_calendar_wrapper_comment(calendar_wrapper_Ptr calendar_wrapper_hdl, const char * comment, int comment_size)
+  {
+    std::string comment_str;
+    if (!cstr2string(comment, comment_size, comment_str)) return;
+    CTimer::get("XIOS").resume();
+    calendar_wrapper_hdl->comment.setValue(comment_str);
+    CTimer::get("XIOS").suspend();
+  }
+
+  void cxios_get_calendar_wrapper_comment(calendar_wrapper_Ptr calendar_wrapper_hdl, char * comment, int comment_size)
+  {
+    CTimer::get("XIOS").resume();
+    if (!string_copy(calendar_wrapper_hdl->comment.getInheritedValue(), comment, comment_size))
+      ERROR("void cxios_get_calendar_wrapper_comment(calendar_wrapper_Ptr calendar_wrapper_hdl, char * comment, int comment_size)", << "Input string is too short");
+    CTimer::get("XIOS").suspend();
+  }
+
+  bool cxios_is_defined_calendar_wrapper_comment(calendar_wrapper_Ptr calendar_wrapper_hdl)
+  {
+     CTimer::get("XIOS").resume();
+     bool isDefined = calendar_wrapper_hdl->comment.hasInheritedValue();
+     CTimer::get("XIOS").suspend();
+     return isDefined;
+  }
+
+
   void cxios_set_calendar_wrapper_day_length(calendar_wrapper_Ptr calendar_wrapper_hdl, int day_length)
   {
Index: /XIOS/trunk/src/interface/c_attr/icdomain_attr.cpp
===================================================================
--- /XIOS/trunk/src/interface/c_attr/icdomain_attr.cpp	(revision 1536)
+++ /XIOS/trunk/src/interface/c_attr/icdomain_attr.cpp	(revision 1537)
@@ -93,4 +93,30 @@
 
 
+  void cxios_set_domain_bounds_lat_name(domain_Ptr domain_hdl, const char * bounds_lat_name, int bounds_lat_name_size)
+  {
+    std::string bounds_lat_name_str;
+    if (!cstr2string(bounds_lat_name, bounds_lat_name_size, bounds_lat_name_str)) return;
+    CTimer::get("XIOS").resume();
+    domain_hdl->bounds_lat_name.setValue(bounds_lat_name_str);
+    CTimer::get("XIOS").suspend();
+  }
+
+  void cxios_get_domain_bounds_lat_name(domain_Ptr domain_hdl, char * bounds_lat_name, int bounds_lat_name_size)
+  {
+    CTimer::get("XIOS").resume();
+    if (!string_copy(domain_hdl->bounds_lat_name.getInheritedValue(), bounds_lat_name, bounds_lat_name_size))
+      ERROR("void cxios_get_domain_bounds_lat_name(domain_Ptr domain_hdl, char * bounds_lat_name, int bounds_lat_name_size)", << "Input string is too short");
+    CTimer::get("XIOS").suspend();
+  }
+
+  bool cxios_is_defined_domain_bounds_lat_name(domain_Ptr domain_hdl)
+  {
+     CTimer::get("XIOS").resume();
+     bool isDefined = domain_hdl->bounds_lat_name.hasInheritedValue();
+     CTimer::get("XIOS").suspend();
+     return isDefined;
+  }
+
+
   void cxios_set_domain_bounds_lon_1d(domain_Ptr domain_hdl, double* bounds_lon_1d, int* extent)
   {
@@ -143,4 +169,56 @@
 
 
+  void cxios_set_domain_bounds_lon_name(domain_Ptr domain_hdl, const char * bounds_lon_name, int bounds_lon_name_size)
+  {
+    std::string bounds_lon_name_str;
+    if (!cstr2string(bounds_lon_name, bounds_lon_name_size, bounds_lon_name_str)) return;
+    CTimer::get("XIOS").resume();
+    domain_hdl->bounds_lon_name.setValue(bounds_lon_name_str);
+    CTimer::get("XIOS").suspend();
+  }
+
+  void cxios_get_domain_bounds_lon_name(domain_Ptr domain_hdl, char * bounds_lon_name, int bounds_lon_name_size)
+  {
+    CTimer::get("XIOS").resume();
+    if (!string_copy(domain_hdl->bounds_lon_name.getInheritedValue(), bounds_lon_name, bounds_lon_name_size))
+      ERROR("void cxios_get_domain_bounds_lon_name(domain_Ptr domain_hdl, char * bounds_lon_name, int bounds_lon_name_size)", << "Input string is too short");
+    CTimer::get("XIOS").suspend();
+  }
+
+  bool cxios_is_defined_domain_bounds_lon_name(domain_Ptr domain_hdl)
+  {
+     CTimer::get("XIOS").resume();
+     bool isDefined = domain_hdl->bounds_lon_name.hasInheritedValue();
+     CTimer::get("XIOS").suspend();
+     return isDefined;
+  }
+
+
+  void cxios_set_domain_comment(domain_Ptr domain_hdl, const char * comment, int comment_size)
+  {
+    std::string comment_str;
+    if (!cstr2string(comment, comment_size, comment_str)) return;
+    CTimer::get("XIOS").resume();
+    domain_hdl->comment.setValue(comment_str);
+    CTimer::get("XIOS").suspend();
+  }
+
+  void cxios_get_domain_comment(domain_Ptr domain_hdl, char * comment, int comment_size)
+  {
+    CTimer::get("XIOS").resume();
+    if (!string_copy(domain_hdl->comment.getInheritedValue(), comment, comment_size))
+      ERROR("void cxios_get_domain_comment(domain_Ptr domain_hdl, char * comment, int comment_size)", << "Input string is too short");
+    CTimer::get("XIOS").suspend();
+  }
+
+  bool cxios_is_defined_domain_comment(domain_Ptr domain_hdl)
+  {
+     CTimer::get("XIOS").resume();
+     bool isDefined = domain_hdl->comment.hasInheritedValue();
+     CTimer::get("XIOS").suspend();
+     return isDefined;
+  }
+
+
   void cxios_set_domain_data_dim(domain_Ptr domain_hdl, int data_dim)
   {
@@ -308,4 +386,56 @@
 
 
+  void cxios_set_domain_dim_i_name(domain_Ptr domain_hdl, const char * dim_i_name, int dim_i_name_size)
+  {
+    std::string dim_i_name_str;
+    if (!cstr2string(dim_i_name, dim_i_name_size, dim_i_name_str)) return;
+    CTimer::get("XIOS").resume();
+    domain_hdl->dim_i_name.setValue(dim_i_name_str);
+    CTimer::get("XIOS").suspend();
+  }
+
+  void cxios_get_domain_dim_i_name(domain_Ptr domain_hdl, char * dim_i_name, int dim_i_name_size)
+  {
+    CTimer::get("XIOS").resume();
+    if (!string_copy(domain_hdl->dim_i_name.getInheritedValue(), dim_i_name, dim_i_name_size))
+      ERROR("void cxios_get_domain_dim_i_name(domain_Ptr domain_hdl, char * dim_i_name, int dim_i_name_size)", << "Input string is too short");
+    CTimer::get("XIOS").suspend();
+  }
+
+  bool cxios_is_defined_domain_dim_i_name(domain_Ptr domain_hdl)
+  {
+     CTimer::get("XIOS").resume();
+     bool isDefined = domain_hdl->dim_i_name.hasInheritedValue();
+     CTimer::get("XIOS").suspend();
+     return isDefined;
+  }
+
+
+  void cxios_set_domain_dim_j_name(domain_Ptr domain_hdl, const char * dim_j_name, int dim_j_name_size)
+  {
+    std::string dim_j_name_str;
+    if (!cstr2string(dim_j_name, dim_j_name_size, dim_j_name_str)) return;
+    CTimer::get("XIOS").resume();
+    domain_hdl->dim_j_name.setValue(dim_j_name_str);
+    CTimer::get("XIOS").suspend();
+  }
+
+  void cxios_get_domain_dim_j_name(domain_Ptr domain_hdl, char * dim_j_name, int dim_j_name_size)
+  {
+    CTimer::get("XIOS").resume();
+    if (!string_copy(domain_hdl->dim_j_name.getInheritedValue(), dim_j_name, dim_j_name_size))
+      ERROR("void cxios_get_domain_dim_j_name(domain_Ptr domain_hdl, char * dim_j_name, int dim_j_name_size)", << "Input string is too short");
+    CTimer::get("XIOS").suspend();
+  }
+
+  bool cxios_is_defined_domain_dim_j_name(domain_Ptr domain_hdl)
+  {
+     CTimer::get("XIOS").resume();
+     bool isDefined = domain_hdl->dim_j_name.hasInheritedValue();
+     CTimer::get("XIOS").suspend();
+     return isDefined;
+  }
+
+
   void cxios_set_domain_domain_ref(domain_Ptr domain_hdl, const char * domain_ref, int domain_ref_size)
   {
@@ -430,4 +560,30 @@
 
 
+  void cxios_set_domain_lat_name(domain_Ptr domain_hdl, const char * lat_name, int lat_name_size)
+  {
+    std::string lat_name_str;
+    if (!cstr2string(lat_name, lat_name_size, lat_name_str)) return;
+    CTimer::get("XIOS").resume();
+    domain_hdl->lat_name.setValue(lat_name_str);
+    CTimer::get("XIOS").suspend();
+  }
+
+  void cxios_get_domain_lat_name(domain_Ptr domain_hdl, char * lat_name, int lat_name_size)
+  {
+    CTimer::get("XIOS").resume();
+    if (!string_copy(domain_hdl->lat_name.getInheritedValue(), lat_name, lat_name_size))
+      ERROR("void cxios_get_domain_lat_name(domain_Ptr domain_hdl, char * lat_name, int lat_name_size)", << "Input string is too short");
+    CTimer::get("XIOS").suspend();
+  }
+
+  bool cxios_is_defined_domain_lat_name(domain_Ptr domain_hdl)
+  {
+     CTimer::get("XIOS").resume();
+     bool isDefined = domain_hdl->lat_name.hasInheritedValue();
+     CTimer::get("XIOS").suspend();
+     return isDefined;
+  }
+
+
   void cxios_set_domain_latvalue_1d(domain_Ptr domain_hdl, double* latvalue_1d, int* extent)
   {
@@ -480,4 +636,30 @@
 
 
+  void cxios_set_domain_lon_name(domain_Ptr domain_hdl, const char * lon_name, int lon_name_size)
+  {
+    std::string lon_name_str;
+    if (!cstr2string(lon_name, lon_name_size, lon_name_str)) return;
+    CTimer::get("XIOS").resume();
+    domain_hdl->lon_name.setValue(lon_name_str);
+    CTimer::get("XIOS").suspend();
+  }
+
+  void cxios_get_domain_lon_name(domain_Ptr domain_hdl, char * lon_name, int lon_name_size)
+  {
+    CTimer::get("XIOS").resume();
+    if (!string_copy(domain_hdl->lon_name.getInheritedValue(), lon_name, lon_name_size))
+      ERROR("void cxios_get_domain_lon_name(domain_Ptr domain_hdl, char * lon_name, int lon_name_size)", << "Input string is too short");
+    CTimer::get("XIOS").suspend();
+  }
+
+  bool cxios_is_defined_domain_lon_name(domain_Ptr domain_hdl)
+  {
+     CTimer::get("XIOS").resume();
+     bool isDefined = domain_hdl->lon_name.hasInheritedValue();
+     CTimer::get("XIOS").suspend();
+     return isDefined;
+  }
+
+
   void cxios_set_domain_long_name(domain_Ptr domain_hdl, const char * long_name, int long_name_size)
   {
Index: /XIOS/trunk/src/interface/c_attr/icdomaingroup_attr.cpp
===================================================================
--- /XIOS/trunk/src/interface/c_attr/icdomaingroup_attr.cpp	(revision 1536)
+++ /XIOS/trunk/src/interface/c_attr/icdomaingroup_attr.cpp	(revision 1537)
@@ -93,4 +93,30 @@
 
 
+  void cxios_set_domaingroup_bounds_lat_name(domaingroup_Ptr domaingroup_hdl, const char * bounds_lat_name, int bounds_lat_name_size)
+  {
+    std::string bounds_lat_name_str;
+    if (!cstr2string(bounds_lat_name, bounds_lat_name_size, bounds_lat_name_str)) return;
+    CTimer::get("XIOS").resume();
+    domaingroup_hdl->bounds_lat_name.setValue(bounds_lat_name_str);
+    CTimer::get("XIOS").suspend();
+  }
+
+  void cxios_get_domaingroup_bounds_lat_name(domaingroup_Ptr domaingroup_hdl, char * bounds_lat_name, int bounds_lat_name_size)
+  {
+    CTimer::get("XIOS").resume();
+    if (!string_copy(domaingroup_hdl->bounds_lat_name.getInheritedValue(), bounds_lat_name, bounds_lat_name_size))
+      ERROR("void cxios_get_domaingroup_bounds_lat_name(domaingroup_Ptr domaingroup_hdl, char * bounds_lat_name, int bounds_lat_name_size)", << "Input string is too short");
+    CTimer::get("XIOS").suspend();
+  }
+
+  bool cxios_is_defined_domaingroup_bounds_lat_name(domaingroup_Ptr domaingroup_hdl)
+  {
+     CTimer::get("XIOS").resume();
+     bool isDefined = domaingroup_hdl->bounds_lat_name.hasInheritedValue();
+     CTimer::get("XIOS").suspend();
+     return isDefined;
+  }
+
+
   void cxios_set_domaingroup_bounds_lon_1d(domaingroup_Ptr domaingroup_hdl, double* bounds_lon_1d, int* extent)
   {
@@ -143,4 +169,56 @@
 
 
+  void cxios_set_domaingroup_bounds_lon_name(domaingroup_Ptr domaingroup_hdl, const char * bounds_lon_name, int bounds_lon_name_size)
+  {
+    std::string bounds_lon_name_str;
+    if (!cstr2string(bounds_lon_name, bounds_lon_name_size, bounds_lon_name_str)) return;
+    CTimer::get("XIOS").resume();
+    domaingroup_hdl->bounds_lon_name.setValue(bounds_lon_name_str);
+    CTimer::get("XIOS").suspend();
+  }
+
+  void cxios_get_domaingroup_bounds_lon_name(domaingroup_Ptr domaingroup_hdl, char * bounds_lon_name, int bounds_lon_name_size)
+  {
+    CTimer::get("XIOS").resume();
+    if (!string_copy(domaingroup_hdl->bounds_lon_name.getInheritedValue(), bounds_lon_name, bounds_lon_name_size))
+      ERROR("void cxios_get_domaingroup_bounds_lon_name(domaingroup_Ptr domaingroup_hdl, char * bounds_lon_name, int bounds_lon_name_size)", << "Input string is too short");
+    CTimer::get("XIOS").suspend();
+  }
+
+  bool cxios_is_defined_domaingroup_bounds_lon_name(domaingroup_Ptr domaingroup_hdl)
+  {
+     CTimer::get("XIOS").resume();
+     bool isDefined = domaingroup_hdl->bounds_lon_name.hasInheritedValue();
+     CTimer::get("XIOS").suspend();
+     return isDefined;
+  }
+
+
+  void cxios_set_domaingroup_comment(domaingroup_Ptr domaingroup_hdl, const char * comment, int comment_size)
+  {
+    std::string comment_str;
+    if (!cstr2string(comment, comment_size, comment_str)) return;
+    CTimer::get("XIOS").resume();
+    domaingroup_hdl->comment.setValue(comment_str);
+    CTimer::get("XIOS").suspend();
+  }
+
+  void cxios_get_domaingroup_comment(domaingroup_Ptr domaingroup_hdl, char * comment, int comment_size)
+  {
+    CTimer::get("XIOS").resume();
+    if (!string_copy(domaingroup_hdl->comment.getInheritedValue(), comment, comment_size))
+      ERROR("void cxios_get_domaingroup_comment(domaingroup_Ptr domaingroup_hdl, char * comment, int comment_size)", << "Input string is too short");
+    CTimer::get("XIOS").suspend();
+  }
+
+  bool cxios_is_defined_domaingroup_comment(domaingroup_Ptr domaingroup_hdl)
+  {
+     CTimer::get("XIOS").resume();
+     bool isDefined = domaingroup_hdl->comment.hasInheritedValue();
+     CTimer::get("XIOS").suspend();
+     return isDefined;
+  }
+
+
   void cxios_set_domaingroup_data_dim(domaingroup_Ptr domaingroup_hdl, int data_dim)
   {
@@ -308,4 +386,56 @@
 
 
+  void cxios_set_domaingroup_dim_i_name(domaingroup_Ptr domaingroup_hdl, const char * dim_i_name, int dim_i_name_size)
+  {
+    std::string dim_i_name_str;
+    if (!cstr2string(dim_i_name, dim_i_name_size, dim_i_name_str)) return;
+    CTimer::get("XIOS").resume();
+    domaingroup_hdl->dim_i_name.setValue(dim_i_name_str);
+    CTimer::get("XIOS").suspend();
+  }
+
+  void cxios_get_domaingroup_dim_i_name(domaingroup_Ptr domaingroup_hdl, char * dim_i_name, int dim_i_name_size)
+  {
+    CTimer::get("XIOS").resume();
+    if (!string_copy(domaingroup_hdl->dim_i_name.getInheritedValue(), dim_i_name, dim_i_name_size))
+      ERROR("void cxios_get_domaingroup_dim_i_name(domaingroup_Ptr domaingroup_hdl, char * dim_i_name, int dim_i_name_size)", << "Input string is too short");
+    CTimer::get("XIOS").suspend();
+  }
+
+  bool cxios_is_defined_domaingroup_dim_i_name(domaingroup_Ptr domaingroup_hdl)
+  {
+     CTimer::get("XIOS").resume();
+     bool isDefined = domaingroup_hdl->dim_i_name.hasInheritedValue();
+     CTimer::get("XIOS").suspend();
+     return isDefined;
+  }
+
+
+  void cxios_set_domaingroup_dim_j_name(domaingroup_Ptr domaingroup_hdl, const char * dim_j_name, int dim_j_name_size)
+  {
+    std::string dim_j_name_str;
+    if (!cstr2string(dim_j_name, dim_j_name_size, dim_j_name_str)) return;
+    CTimer::get("XIOS").resume();
+    domaingroup_hdl->dim_j_name.setValue(dim_j_name_str);
+    CTimer::get("XIOS").suspend();
+  }
+
+  void cxios_get_domaingroup_dim_j_name(domaingroup_Ptr domaingroup_hdl, char * dim_j_name, int dim_j_name_size)
+  {
+    CTimer::get("XIOS").resume();
+    if (!string_copy(domaingroup_hdl->dim_j_name.getInheritedValue(), dim_j_name, dim_j_name_size))
+      ERROR("void cxios_get_domaingroup_dim_j_name(domaingroup_Ptr domaingroup_hdl, char * dim_j_name, int dim_j_name_size)", << "Input string is too short");
+    CTimer::get("XIOS").suspend();
+  }
+
+  bool cxios_is_defined_domaingroup_dim_j_name(domaingroup_Ptr domaingroup_hdl)
+  {
+     CTimer::get("XIOS").resume();
+     bool isDefined = domaingroup_hdl->dim_j_name.hasInheritedValue();
+     CTimer::get("XIOS").suspend();
+     return isDefined;
+  }
+
+
   void cxios_set_domaingroup_domain_ref(domaingroup_Ptr domaingroup_hdl, const char * domain_ref, int domain_ref_size)
   {
@@ -456,4 +586,30 @@
 
 
+  void cxios_set_domaingroup_lat_name(domaingroup_Ptr domaingroup_hdl, const char * lat_name, int lat_name_size)
+  {
+    std::string lat_name_str;
+    if (!cstr2string(lat_name, lat_name_size, lat_name_str)) return;
+    CTimer::get("XIOS").resume();
+    domaingroup_hdl->lat_name.setValue(lat_name_str);
+    CTimer::get("XIOS").suspend();
+  }
+
+  void cxios_get_domaingroup_lat_name(domaingroup_Ptr domaingroup_hdl, char * lat_name, int lat_name_size)
+  {
+    CTimer::get("XIOS").resume();
+    if (!string_copy(domaingroup_hdl->lat_name.getInheritedValue(), lat_name, lat_name_size))
+      ERROR("void cxios_get_domaingroup_lat_name(domaingroup_Ptr domaingroup_hdl, char * lat_name, int lat_name_size)", << "Input string is too short");
+    CTimer::get("XIOS").suspend();
+  }
+
+  bool cxios_is_defined_domaingroup_lat_name(domaingroup_Ptr domaingroup_hdl)
+  {
+     CTimer::get("XIOS").resume();
+     bool isDefined = domaingroup_hdl->lat_name.hasInheritedValue();
+     CTimer::get("XIOS").suspend();
+     return isDefined;
+  }
+
+
   void cxios_set_domaingroup_latvalue_1d(domaingroup_Ptr domaingroup_hdl, double* latvalue_1d, int* extent)
   {
@@ -506,4 +662,30 @@
 
 
+  void cxios_set_domaingroup_lon_name(domaingroup_Ptr domaingroup_hdl, const char * lon_name, int lon_name_size)
+  {
+    std::string lon_name_str;
+    if (!cstr2string(lon_name, lon_name_size, lon_name_str)) return;
+    CTimer::get("XIOS").resume();
+    domaingroup_hdl->lon_name.setValue(lon_name_str);
+    CTimer::get("XIOS").suspend();
+  }
+
+  void cxios_get_domaingroup_lon_name(domaingroup_Ptr domaingroup_hdl, char * lon_name, int lon_name_size)
+  {
+    CTimer::get("XIOS").resume();
+    if (!string_copy(domaingroup_hdl->lon_name.getInheritedValue(), lon_name, lon_name_size))
+      ERROR("void cxios_get_domaingroup_lon_name(domaingroup_Ptr domaingroup_hdl, char * lon_name, int lon_name_size)", << "Input string is too short");
+    CTimer::get("XIOS").suspend();
+  }
+
+  bool cxios_is_defined_domaingroup_lon_name(domaingroup_Ptr domaingroup_hdl)
+  {
+     CTimer::get("XIOS").resume();
+     bool isDefined = domaingroup_hdl->lon_name.hasInheritedValue();
+     CTimer::get("XIOS").suspend();
+     return isDefined;
+  }
+
+
   void cxios_set_domaingroup_long_name(domaingroup_Ptr domaingroup_hdl, const char * long_name, int long_name_size)
   {
Index: /XIOS/trunk/src/interface/c_attr/icduplicate_scalar_to_axis_attr.cpp
===================================================================
--- /XIOS/trunk/src/interface/c_attr/icduplicate_scalar_to_axis_attr.cpp	(revision 1537)
+++ /XIOS/trunk/src/interface/c_attr/icduplicate_scalar_to_axis_attr.cpp	(revision 1537)
@@ -0,0 +1,18 @@
+/* ************************************************************************** *
+ *               Interface auto generated - do not modify                     *
+ * ************************************************************************** */
+
+#include <boost/multi_array.hpp>
+#include <boost/shared_ptr.hpp>
+#include "xios.hpp"
+#include "attribute_template.hpp"
+#include "object_template.hpp"
+#include "group_template.hpp"
+#include "icutil.hpp"
+#include "icdate.hpp"
+#include "timer.hpp"
+#include "node_type.hpp"
+
+extern "C"
+{
+  typedef xios::CDuplicateScalarToAxis* duplicate_scalar_to_axis_Ptr;}
Index: /XIOS/trunk/src/interface/c_attr/icfield_attr.cpp
===================================================================
--- /XIOS/trunk/src/interface/c_attr/icfield_attr.cpp	(revision 1536)
+++ /XIOS/trunk/src/interface/c_attr/icfield_attr.cpp	(revision 1537)
@@ -142,4 +142,30 @@
 
 
+  void cxios_set_field_comment(field_Ptr field_hdl, const char * comment, int comment_size)
+  {
+    std::string comment_str;
+    if (!cstr2string(comment, comment_size, comment_str)) return;
+    CTimer::get("XIOS").resume();
+    field_hdl->comment.setValue(comment_str);
+    CTimer::get("XIOS").suspend();
+  }
+
+  void cxios_get_field_comment(field_Ptr field_hdl, char * comment, int comment_size)
+  {
+    CTimer::get("XIOS").resume();
+    if (!string_copy(field_hdl->comment.getInheritedValue(), comment, comment_size))
+      ERROR("void cxios_get_field_comment(field_Ptr field_hdl, char * comment, int comment_size)", << "Input string is too short");
+    CTimer::get("XIOS").suspend();
+  }
+
+  bool cxios_is_defined_field_comment(field_Ptr field_hdl)
+  {
+     CTimer::get("XIOS").resume();
+     bool isDefined = field_hdl->comment.hasInheritedValue();
+     CTimer::get("XIOS").suspend();
+     return isDefined;
+  }
+
+
   void cxios_set_field_compression_level(field_Ptr field_hdl, int compression_level)
   {
Index: /XIOS/trunk/src/interface/c_attr/icfieldgroup_attr.cpp
===================================================================
--- /XIOS/trunk/src/interface/c_attr/icfieldgroup_attr.cpp	(revision 1536)
+++ /XIOS/trunk/src/interface/c_attr/icfieldgroup_attr.cpp	(revision 1537)
@@ -142,4 +142,30 @@
 
 
+  void cxios_set_fieldgroup_comment(fieldgroup_Ptr fieldgroup_hdl, const char * comment, int comment_size)
+  {
+    std::string comment_str;
+    if (!cstr2string(comment, comment_size, comment_str)) return;
+    CTimer::get("XIOS").resume();
+    fieldgroup_hdl->comment.setValue(comment_str);
+    CTimer::get("XIOS").suspend();
+  }
+
+  void cxios_get_fieldgroup_comment(fieldgroup_Ptr fieldgroup_hdl, char * comment, int comment_size)
+  {
+    CTimer::get("XIOS").resume();
+    if (!string_copy(fieldgroup_hdl->comment.getInheritedValue(), comment, comment_size))
+      ERROR("void cxios_get_fieldgroup_comment(fieldgroup_Ptr fieldgroup_hdl, char * comment, int comment_size)", << "Input string is too short");
+    CTimer::get("XIOS").suspend();
+  }
+
+  bool cxios_is_defined_fieldgroup_comment(fieldgroup_Ptr fieldgroup_hdl)
+  {
+     CTimer::get("XIOS").resume();
+     bool isDefined = fieldgroup_hdl->comment.hasInheritedValue();
+     CTimer::get("XIOS").suspend();
+     return isDefined;
+  }
+
+
   void cxios_set_fieldgroup_compression_level(fieldgroup_Ptr fieldgroup_hdl, int compression_level)
   {
Index: /XIOS/trunk/src/interface/c_attr/icfile_attr.cpp
===================================================================
--- /XIOS/trunk/src/interface/c_attr/icfile_attr.cpp	(revision 1536)
+++ /XIOS/trunk/src/interface/c_attr/icfile_attr.cpp	(revision 1537)
@@ -41,4 +41,30 @@
 
 
+  void cxios_set_file_comment(file_Ptr file_hdl, const char * comment, int comment_size)
+  {
+    std::string comment_str;
+    if (!cstr2string(comment, comment_size, comment_str)) return;
+    CTimer::get("XIOS").resume();
+    file_hdl->comment.setValue(comment_str);
+    CTimer::get("XIOS").suspend();
+  }
+
+  void cxios_get_file_comment(file_Ptr file_hdl, char * comment, int comment_size)
+  {
+    CTimer::get("XIOS").resume();
+    if (!string_copy(file_hdl->comment.getInheritedValue(), comment, comment_size))
+      ERROR("void cxios_get_file_comment(file_Ptr file_hdl, char * comment, int comment_size)", << "Input string is too short");
+    CTimer::get("XIOS").suspend();
+  }
+
+  bool cxios_is_defined_file_comment(file_Ptr file_hdl)
+  {
+     CTimer::get("XIOS").resume();
+     bool isDefined = file_hdl->comment.hasInheritedValue();
+     CTimer::get("XIOS").suspend();
+     return isDefined;
+  }
+
+
   void cxios_set_file_compression_level(file_Ptr file_hdl, int compression_level)
   {
@@ -402,4 +428,27 @@
 
 
+  void cxios_set_file_read_metadata_par(file_Ptr file_hdl, bool read_metadata_par)
+  {
+    CTimer::get("XIOS").resume();
+    file_hdl->read_metadata_par.setValue(read_metadata_par);
+    CTimer::get("XIOS").suspend();
+  }
+
+  void cxios_get_file_read_metadata_par(file_Ptr file_hdl, bool* read_metadata_par)
+  {
+    CTimer::get("XIOS").resume();
+    *read_metadata_par = file_hdl->read_metadata_par.getInheritedValue();
+    CTimer::get("XIOS").suspend();
+  }
+
+  bool cxios_is_defined_file_read_metadata_par(file_Ptr file_hdl)
+  {
+     CTimer::get("XIOS").resume();
+     bool isDefined = file_hdl->read_metadata_par.hasInheritedValue();
+     CTimer::get("XIOS").suspend();
+     return isDefined;
+  }
+
+
   void cxios_set_file_record_offset(file_Ptr file_hdl, int record_offset)
   {
@@ -420,4 +469,42 @@
      CTimer::get("XIOS").resume();
      bool isDefined = file_hdl->record_offset.hasInheritedValue();
+     CTimer::get("XIOS").suspend();
+     return isDefined;
+  }
+
+
+  void cxios_set_file_split_end_offset(file_Ptr file_hdl, cxios_duration split_end_offset_c)
+  {
+    CTimer::get("XIOS").resume();
+    file_hdl->split_end_offset.allocate();
+    CDuration& split_end_offset = file_hdl->split_end_offset.get();
+    split_end_offset.year = split_end_offset_c.year;
+    split_end_offset.month = split_end_offset_c.month;
+    split_end_offset.day = split_end_offset_c.day;
+    split_end_offset.hour = split_end_offset_c.hour;
+    split_end_offset.minute = split_end_offset_c.minute;
+    split_end_offset.second = split_end_offset_c.second;
+    split_end_offset.timestep = split_end_offset_c.timestep;
+    CTimer::get("XIOS").suspend();
+  }
+
+  void cxios_get_file_split_end_offset(file_Ptr file_hdl, cxios_duration* split_end_offset_c)
+  {
+    CTimer::get("XIOS").resume();
+    CDuration split_end_offset = file_hdl->split_end_offset.getInheritedValue();
+    split_end_offset_c->year = split_end_offset.year;
+    split_end_offset_c->month = split_end_offset.month;
+    split_end_offset_c->day = split_end_offset.day;
+    split_end_offset_c->hour = split_end_offset.hour;
+    split_end_offset_c->minute = split_end_offset.minute;
+    split_end_offset_c->second = split_end_offset.second;
+    split_end_offset_c->timestep = split_end_offset.timestep;
+    CTimer::get("XIOS").suspend();
+  }
+
+  bool cxios_is_defined_file_split_end_offset(file_Ptr file_hdl)
+  {
+     CTimer::get("XIOS").resume();
+     bool isDefined = file_hdl->split_end_offset.hasInheritedValue();
      CTimer::get("XIOS").suspend();
      return isDefined;
@@ -489,4 +576,68 @@
 
 
+  void cxios_set_file_split_last_date(file_Ptr file_hdl, const char * split_last_date, int split_last_date_size)
+  {
+    std::string split_last_date_str;
+    if (!cstr2string(split_last_date, split_last_date_size, split_last_date_str)) return;
+    CTimer::get("XIOS").resume();
+    file_hdl->split_last_date.setValue(split_last_date_str);
+    CTimer::get("XIOS").suspend();
+  }
+
+  void cxios_get_file_split_last_date(file_Ptr file_hdl, char * split_last_date, int split_last_date_size)
+  {
+    CTimer::get("XIOS").resume();
+    if (!string_copy(file_hdl->split_last_date.getInheritedValue(), split_last_date, split_last_date_size))
+      ERROR("void cxios_get_file_split_last_date(file_Ptr file_hdl, char * split_last_date, int split_last_date_size)", << "Input string is too short");
+    CTimer::get("XIOS").suspend();
+  }
+
+  bool cxios_is_defined_file_split_last_date(file_Ptr file_hdl)
+  {
+     CTimer::get("XIOS").resume();
+     bool isDefined = file_hdl->split_last_date.hasInheritedValue();
+     CTimer::get("XIOS").suspend();
+     return isDefined;
+  }
+
+
+  void cxios_set_file_split_start_offset(file_Ptr file_hdl, cxios_duration split_start_offset_c)
+  {
+    CTimer::get("XIOS").resume();
+    file_hdl->split_start_offset.allocate();
+    CDuration& split_start_offset = file_hdl->split_start_offset.get();
+    split_start_offset.year = split_start_offset_c.year;
+    split_start_offset.month = split_start_offset_c.month;
+    split_start_offset.day = split_start_offset_c.day;
+    split_start_offset.hour = split_start_offset_c.hour;
+    split_start_offset.minute = split_start_offset_c.minute;
+    split_start_offset.second = split_start_offset_c.second;
+    split_start_offset.timestep = split_start_offset_c.timestep;
+    CTimer::get("XIOS").suspend();
+  }
+
+  void cxios_get_file_split_start_offset(file_Ptr file_hdl, cxios_duration* split_start_offset_c)
+  {
+    CTimer::get("XIOS").resume();
+    CDuration split_start_offset = file_hdl->split_start_offset.getInheritedValue();
+    split_start_offset_c->year = split_start_offset.year;
+    split_start_offset_c->month = split_start_offset.month;
+    split_start_offset_c->day = split_start_offset.day;
+    split_start_offset_c->hour = split_start_offset.hour;
+    split_start_offset_c->minute = split_start_offset.minute;
+    split_start_offset_c->second = split_start_offset.second;
+    split_start_offset_c->timestep = split_start_offset.timestep;
+    CTimer::get("XIOS").suspend();
+  }
+
+  bool cxios_is_defined_file_split_start_offset(file_Ptr file_hdl)
+  {
+     CTimer::get("XIOS").resume();
+     bool isDefined = file_hdl->split_start_offset.hasInheritedValue();
+     CTimer::get("XIOS").suspend();
+     return isDefined;
+  }
+
+
   void cxios_set_file_sync_freq(file_Ptr file_hdl, cxios_duration sync_freq_c)
   {
Index: /XIOS/trunk/src/interface/c_attr/icfilegroup_attr.cpp
===================================================================
--- /XIOS/trunk/src/interface/c_attr/icfilegroup_attr.cpp	(revision 1536)
+++ /XIOS/trunk/src/interface/c_attr/icfilegroup_attr.cpp	(revision 1537)
@@ -41,4 +41,30 @@
 
 
+  void cxios_set_filegroup_comment(filegroup_Ptr filegroup_hdl, const char * comment, int comment_size)
+  {
+    std::string comment_str;
+    if (!cstr2string(comment, comment_size, comment_str)) return;
+    CTimer::get("XIOS").resume();
+    filegroup_hdl->comment.setValue(comment_str);
+    CTimer::get("XIOS").suspend();
+  }
+
+  void cxios_get_filegroup_comment(filegroup_Ptr filegroup_hdl, char * comment, int comment_size)
+  {
+    CTimer::get("XIOS").resume();
+    if (!string_copy(filegroup_hdl->comment.getInheritedValue(), comment, comment_size))
+      ERROR("void cxios_get_filegroup_comment(filegroup_Ptr filegroup_hdl, char * comment, int comment_size)", << "Input string is too short");
+    CTimer::get("XIOS").suspend();
+  }
+
+  bool cxios_is_defined_filegroup_comment(filegroup_Ptr filegroup_hdl)
+  {
+     CTimer::get("XIOS").resume();
+     bool isDefined = filegroup_hdl->comment.hasInheritedValue();
+     CTimer::get("XIOS").suspend();
+     return isDefined;
+  }
+
+
   void cxios_set_filegroup_compression_level(filegroup_Ptr filegroup_hdl, int compression_level)
   {
@@ -428,4 +454,27 @@
 
 
+  void cxios_set_filegroup_read_metadata_par(filegroup_Ptr filegroup_hdl, bool read_metadata_par)
+  {
+    CTimer::get("XIOS").resume();
+    filegroup_hdl->read_metadata_par.setValue(read_metadata_par);
+    CTimer::get("XIOS").suspend();
+  }
+
+  void cxios_get_filegroup_read_metadata_par(filegroup_Ptr filegroup_hdl, bool* read_metadata_par)
+  {
+    CTimer::get("XIOS").resume();
+    *read_metadata_par = filegroup_hdl->read_metadata_par.getInheritedValue();
+    CTimer::get("XIOS").suspend();
+  }
+
+  bool cxios_is_defined_filegroup_read_metadata_par(filegroup_Ptr filegroup_hdl)
+  {
+     CTimer::get("XIOS").resume();
+     bool isDefined = filegroup_hdl->read_metadata_par.hasInheritedValue();
+     CTimer::get("XIOS").suspend();
+     return isDefined;
+  }
+
+
   void cxios_set_filegroup_record_offset(filegroup_Ptr filegroup_hdl, int record_offset)
   {
@@ -446,4 +495,42 @@
      CTimer::get("XIOS").resume();
      bool isDefined = filegroup_hdl->record_offset.hasInheritedValue();
+     CTimer::get("XIOS").suspend();
+     return isDefined;
+  }
+
+
+  void cxios_set_filegroup_split_end_offset(filegroup_Ptr filegroup_hdl, cxios_duration split_end_offset_c)
+  {
+    CTimer::get("XIOS").resume();
+    filegroup_hdl->split_end_offset.allocate();
+    CDuration& split_end_offset = filegroup_hdl->split_end_offset.get();
+    split_end_offset.year = split_end_offset_c.year;
+    split_end_offset.month = split_end_offset_c.month;
+    split_end_offset.day = split_end_offset_c.day;
+    split_end_offset.hour = split_end_offset_c.hour;
+    split_end_offset.minute = split_end_offset_c.minute;
+    split_end_offset.second = split_end_offset_c.second;
+    split_end_offset.timestep = split_end_offset_c.timestep;
+    CTimer::get("XIOS").suspend();
+  }
+
+  void cxios_get_filegroup_split_end_offset(filegroup_Ptr filegroup_hdl, cxios_duration* split_end_offset_c)
+  {
+    CTimer::get("XIOS").resume();
+    CDuration split_end_offset = filegroup_hdl->split_end_offset.getInheritedValue();
+    split_end_offset_c->year = split_end_offset.year;
+    split_end_offset_c->month = split_end_offset.month;
+    split_end_offset_c->day = split_end_offset.day;
+    split_end_offset_c->hour = split_end_offset.hour;
+    split_end_offset_c->minute = split_end_offset.minute;
+    split_end_offset_c->second = split_end_offset.second;
+    split_end_offset_c->timestep = split_end_offset.timestep;
+    CTimer::get("XIOS").suspend();
+  }
+
+  bool cxios_is_defined_filegroup_split_end_offset(filegroup_Ptr filegroup_hdl)
+  {
+     CTimer::get("XIOS").resume();
+     bool isDefined = filegroup_hdl->split_end_offset.hasInheritedValue();
      CTimer::get("XIOS").suspend();
      return isDefined;
@@ -515,4 +602,68 @@
 
 
+  void cxios_set_filegroup_split_last_date(filegroup_Ptr filegroup_hdl, const char * split_last_date, int split_last_date_size)
+  {
+    std::string split_last_date_str;
+    if (!cstr2string(split_last_date, split_last_date_size, split_last_date_str)) return;
+    CTimer::get("XIOS").resume();
+    filegroup_hdl->split_last_date.setValue(split_last_date_str);
+    CTimer::get("XIOS").suspend();
+  }
+
+  void cxios_get_filegroup_split_last_date(filegroup_Ptr filegroup_hdl, char * split_last_date, int split_last_date_size)
+  {
+    CTimer::get("XIOS").resume();
+    if (!string_copy(filegroup_hdl->split_last_date.getInheritedValue(), split_last_date, split_last_date_size))
+      ERROR("void cxios_get_filegroup_split_last_date(filegroup_Ptr filegroup_hdl, char * split_last_date, int split_last_date_size)", << "Input string is too short");
+    CTimer::get("XIOS").suspend();
+  }
+
+  bool cxios_is_defined_filegroup_split_last_date(filegroup_Ptr filegroup_hdl)
+  {
+     CTimer::get("XIOS").resume();
+     bool isDefined = filegroup_hdl->split_last_date.hasInheritedValue();
+     CTimer::get("XIOS").suspend();
+     return isDefined;
+  }
+
+
+  void cxios_set_filegroup_split_start_offset(filegroup_Ptr filegroup_hdl, cxios_duration split_start_offset_c)
+  {
+    CTimer::get("XIOS").resume();
+    filegroup_hdl->split_start_offset.allocate();
+    CDuration& split_start_offset = filegroup_hdl->split_start_offset.get();
+    split_start_offset.year = split_start_offset_c.year;
+    split_start_offset.month = split_start_offset_c.month;
+    split_start_offset.day = split_start_offset_c.day;
+    split_start_offset.hour = split_start_offset_c.hour;
+    split_start_offset.minute = split_start_offset_c.minute;
+    split_start_offset.second = split_start_offset_c.second;
+    split_start_offset.timestep = split_start_offset_c.timestep;
+    CTimer::get("XIOS").suspend();
+  }
+
+  void cxios_get_filegroup_split_start_offset(filegroup_Ptr filegroup_hdl, cxios_duration* split_start_offset_c)
+  {
+    CTimer::get("XIOS").resume();
+    CDuration split_start_offset = filegroup_hdl->split_start_offset.getInheritedValue();
+    split_start_offset_c->year = split_start_offset.year;
+    split_start_offset_c->month = split_start_offset.month;
+    split_start_offset_c->day = split_start_offset.day;
+    split_start_offset_c->hour = split_start_offset.hour;
+    split_start_offset_c->minute = split_start_offset.minute;
+    split_start_offset_c->second = split_start_offset.second;
+    split_start_offset_c->timestep = split_start_offset.timestep;
+    CTimer::get("XIOS").suspend();
+  }
+
+  bool cxios_is_defined_filegroup_split_start_offset(filegroup_Ptr filegroup_hdl)
+  {
+     CTimer::get("XIOS").resume();
+     bool isDefined = filegroup_hdl->split_start_offset.hasInheritedValue();
+     CTimer::get("XIOS").suspend();
+     return isDefined;
+  }
+
+
   void cxios_set_filegroup_sync_freq(filegroup_Ptr filegroup_hdl, cxios_duration sync_freq_c)
   {
Index: /XIOS/trunk/src/interface/c_attr/icgrid_attr.cpp
===================================================================
--- /XIOS/trunk/src/interface/c_attr/icgrid_attr.cpp	(revision 1536)
+++ /XIOS/trunk/src/interface/c_attr/icgrid_attr.cpp	(revision 1537)
@@ -18,4 +18,30 @@
   typedef xios::CGrid* grid_Ptr;
 
+  void cxios_set_grid_comment(grid_Ptr grid_hdl, const char * comment, int comment_size)
+  {
+    std::string comment_str;
+    if (!cstr2string(comment, comment_size, comment_str)) return;
+    CTimer::get("XIOS").resume();
+    grid_hdl->comment.setValue(comment_str);
+    CTimer::get("XIOS").suspend();
+  }
+
+  void cxios_get_grid_comment(grid_Ptr grid_hdl, char * comment, int comment_size)
+  {
+    CTimer::get("XIOS").resume();
+    if (!string_copy(grid_hdl->comment.getInheritedValue(), comment, comment_size))
+      ERROR("void cxios_get_grid_comment(grid_Ptr grid_hdl, char * comment, int comment_size)", << "Input string is too short");
+    CTimer::get("XIOS").suspend();
+  }
+
+  bool cxios_is_defined_grid_comment(grid_Ptr grid_hdl)
+  {
+     CTimer::get("XIOS").resume();
+     bool isDefined = grid_hdl->comment.hasInheritedValue();
+     CTimer::get("XIOS").suspend();
+     return isDefined;
+  }
+
+
   void cxios_set_grid_description(grid_Ptr grid_hdl, const char * description, int description_size)
   {
@@ -44,4 +70,29 @@
 
 
+  void cxios_set_grid_mask_0d(grid_Ptr grid_hdl, bool* mask_0d, int* extent)
+  {
+    CTimer::get("XIOS").resume();
+    CArray<bool,1> tmp(mask_0d, shape(extent[0]), neverDeleteData);
+    grid_hdl->mask_0d.reference(tmp.copy());
+     CTimer::get("XIOS").suspend();
+  }
+
+  void cxios_get_grid_mask_0d(grid_Ptr grid_hdl, bool* mask_0d, int* extent)
+  {
+    CTimer::get("XIOS").resume();
+    CArray<bool,1> tmp(mask_0d, shape(extent[0]), neverDeleteData);
+    tmp=grid_hdl->mask_0d.getInheritedValue();
+     CTimer::get("XIOS").suspend();
+  }
+
+  bool cxios_is_defined_grid_mask_0d(grid_Ptr grid_hdl)
+  {
+     CTimer::get("XIOS").resume();
+     bool isDefined = grid_hdl->mask_0d.hasInheritedValue();
+     CTimer::get("XIOS").suspend();
+     return isDefined;
+  }
+
+
   void cxios_set_grid_mask_1d(grid_Ptr grid_hdl, bool* mask_1d, int* extent)
   {
Index: /XIOS/trunk/src/interface/c_attr/icgridgroup_attr.cpp
===================================================================
--- /XIOS/trunk/src/interface/c_attr/icgridgroup_attr.cpp	(revision 1536)
+++ /XIOS/trunk/src/interface/c_attr/icgridgroup_attr.cpp	(revision 1537)
@@ -18,4 +18,30 @@
   typedef xios::CGridGroup* gridgroup_Ptr;
 
+  void cxios_set_gridgroup_comment(gridgroup_Ptr gridgroup_hdl, const char * comment, int comment_size)
+  {
+    std::string comment_str;
+    if (!cstr2string(comment, comment_size, comment_str)) return;
+    CTimer::get("XIOS").resume();
+    gridgroup_hdl->comment.setValue(comment_str);
+    CTimer::get("XIOS").suspend();
+  }
+
+  void cxios_get_gridgroup_comment(gridgroup_Ptr gridgroup_hdl, char * comment, int comment_size)
+  {
+    CTimer::get("XIOS").resume();
+    if (!string_copy(gridgroup_hdl->comment.getInheritedValue(), comment, comment_size))
+      ERROR("void cxios_get_gridgroup_comment(gridgroup_Ptr gridgroup_hdl, char * comment, int comment_size)", << "Input string is too short");
+    CTimer::get("XIOS").suspend();
+  }
+
+  bool cxios_is_defined_gridgroup_comment(gridgroup_Ptr gridgroup_hdl)
+  {
+     CTimer::get("XIOS").resume();
+     bool isDefined = gridgroup_hdl->comment.hasInheritedValue();
+     CTimer::get("XIOS").suspend();
+     return isDefined;
+  }
+
+
   void cxios_set_gridgroup_description(gridgroup_Ptr gridgroup_hdl, const char * description, int description_size)
   {
@@ -70,4 +96,29 @@
 
 
+  void cxios_set_gridgroup_mask_0d(gridgroup_Ptr gridgroup_hdl, bool* mask_0d, int* extent)
+  {
+    CTimer::get("XIOS").resume();
+    CArray<bool,1> tmp(mask_0d, shape(extent[0]), neverDeleteData);
+    gridgroup_hdl->mask_0d.reference(tmp.copy());
+     CTimer::get("XIOS").suspend();
+  }
+
+  void cxios_get_gridgroup_mask_0d(gridgroup_Ptr gridgroup_hdl, bool* mask_0d, int* extent)
+  {
+    CTimer::get("XIOS").resume();
+    CArray<bool,1> tmp(mask_0d, shape(extent[0]), neverDeleteData);
+    tmp=gridgroup_hdl->mask_0d.getInheritedValue();
+     CTimer::get("XIOS").suspend();
+  }
+
+  bool cxios_is_defined_gridgroup_mask_0d(gridgroup_Ptr gridgroup_hdl)
+  {
+     CTimer::get("XIOS").resume();
+     bool isDefined = gridgroup_hdl->mask_0d.hasInheritedValue();
+     CTimer::get("XIOS").suspend();
+     return isDefined;
+  }
+
+
   void cxios_set_gridgroup_mask_1d(gridgroup_Ptr gridgroup_hdl, bool* mask_1d, int* extent)
   {
Index: /XIOS/trunk/src/interface/c_attr/icinterpolate_domain_attr.cpp
===================================================================
--- /XIOS/trunk/src/interface/c_attr/icinterpolate_domain_attr.cpp	(revision 1536)
+++ /XIOS/trunk/src/interface/c_attr/icinterpolate_domain_attr.cpp	(revision 1537)
@@ -18,4 +18,27 @@
   typedef xios::CInterpolateDomain* interpolate_domain_Ptr;
 
+  void cxios_set_interpolate_domain_detect_missing_value(interpolate_domain_Ptr interpolate_domain_hdl, bool detect_missing_value)
+  {
+    CTimer::get("XIOS").resume();
+    interpolate_domain_hdl->detect_missing_value.setValue(detect_missing_value);
+    CTimer::get("XIOS").suspend();
+  }
+
+  void cxios_get_interpolate_domain_detect_missing_value(interpolate_domain_Ptr interpolate_domain_hdl, bool* detect_missing_value)
+  {
+    CTimer::get("XIOS").resume();
+    *detect_missing_value = interpolate_domain_hdl->detect_missing_value.getInheritedValue();
+    CTimer::get("XIOS").suspend();
+  }
+
+  bool cxios_is_defined_interpolate_domain_detect_missing_value(interpolate_domain_Ptr interpolate_domain_hdl)
+  {
+     CTimer::get("XIOS").resume();
+     bool isDefined = interpolate_domain_hdl->detect_missing_value.hasInheritedValue();
+     CTimer::get("XIOS").suspend();
+     return isDefined;
+  }
+
+
   void cxios_set_interpolate_domain_mode(interpolate_domain_Ptr interpolate_domain_hdl, const char * mode, int mode_size)
   {
@@ -90,4 +113,30 @@
 
 
+  void cxios_set_interpolate_domain_read_write_convention(interpolate_domain_Ptr interpolate_domain_hdl, const char * read_write_convention, int read_write_convention_size)
+  {
+    std::string read_write_convention_str;
+    if (!cstr2string(read_write_convention, read_write_convention_size, read_write_convention_str)) return;
+    CTimer::get("XIOS").resume();
+    interpolate_domain_hdl->read_write_convention.fromString(read_write_convention_str);
+    CTimer::get("XIOS").suspend();
+  }
+
+  void cxios_get_interpolate_domain_read_write_convention(interpolate_domain_Ptr interpolate_domain_hdl, char * read_write_convention, int read_write_convention_size)
+  {
+    CTimer::get("XIOS").resume();
+    if (!string_copy(interpolate_domain_hdl->read_write_convention.getInheritedStringValue(), read_write_convention, read_write_convention_size))
+      ERROR("void cxios_get_interpolate_domain_read_write_convention(interpolate_domain_Ptr interpolate_domain_hdl, char * read_write_convention, int read_write_convention_size)", << "Input string is too short");
+    CTimer::get("XIOS").suspend();
+  }
+
+  bool cxios_is_defined_interpolate_domain_read_write_convention(interpolate_domain_Ptr interpolate_domain_hdl)
+  {
+     CTimer::get("XIOS").resume();
+     bool isDefined = interpolate_domain_hdl->read_write_convention.hasInheritedValue();
+     CTimer::get("XIOS").suspend();
+     return isDefined;
+  }
+
+
   void cxios_set_interpolate_domain_renormalize(interpolate_domain_Ptr interpolate_domain_hdl, bool renormalize)
   {
Index: /XIOS/trunk/src/interface/c_attr/icreduce_axis_to_axis_attr.cpp
===================================================================
--- /XIOS/trunk/src/interface/c_attr/icreduce_axis_to_axis_attr.cpp	(revision 1537)
+++ /XIOS/trunk/src/interface/c_attr/icreduce_axis_to_axis_attr.cpp	(revision 1537)
@@ -0,0 +1,44 @@
+/* ************************************************************************** *
+ *               Interface auto generated - do not modify                     *
+ * ************************************************************************** */
+
+#include <boost/multi_array.hpp>
+#include <boost/shared_ptr.hpp>
+#include "xios.hpp"
+#include "attribute_template.hpp"
+#include "object_template.hpp"
+#include "group_template.hpp"
+#include "icutil.hpp"
+#include "icdate.hpp"
+#include "timer.hpp"
+#include "node_type.hpp"
+
+extern "C"
+{
+  typedef xios::CReduceAxisToAxis* reduce_axis_to_axis_Ptr;
+
+  void cxios_set_reduce_axis_to_axis_operation(reduce_axis_to_axis_Ptr reduce_axis_to_axis_hdl, const char * operation, int operation_size)
+  {
+    std::string operation_str;
+    if (!cstr2string(operation, operation_size, operation_str)) return;
+    CTimer::get("XIOS").resume();
+    reduce_axis_to_axis_hdl->operation.fromString(operation_str);
+    CTimer::get("XIOS").suspend();
+  }
+
+  void cxios_get_reduce_axis_to_axis_operation(reduce_axis_to_axis_Ptr reduce_axis_to_axis_hdl, char * operation, int operation_size)
+  {
+    CTimer::get("XIOS").resume();
+    if (!string_copy(reduce_axis_to_axis_hdl->operation.getInheritedStringValue(), operation, operation_size))
+      ERROR("void cxios_get_reduce_axis_to_axis_operation(reduce_axis_to_axis_Ptr reduce_axis_to_axis_hdl, char * operation, int operation_size)", << "Input string is too short");
+    CTimer::get("XIOS").suspend();
+  }
+
+  bool cxios_is_defined_reduce_axis_to_axis_operation(reduce_axis_to_axis_Ptr reduce_axis_to_axis_hdl)
+  {
+     CTimer::get("XIOS").resume();
+     bool isDefined = reduce_axis_to_axis_hdl->operation.hasInheritedValue();
+     CTimer::get("XIOS").suspend();
+     return isDefined;
+  }
+}
Index: /XIOS/trunk/src/interface/c_attr/icreduce_domain_to_axis_attr.cpp
===================================================================
--- /XIOS/trunk/src/interface/c_attr/icreduce_domain_to_axis_attr.cpp	(revision 1536)
+++ /XIOS/trunk/src/interface/c_attr/icreduce_domain_to_axis_attr.cpp	(revision 1537)
@@ -44,4 +44,27 @@
 
 
+  void cxios_set_reduce_domain_to_axis_local(reduce_domain_to_axis_Ptr reduce_domain_to_axis_hdl, bool local)
+  {
+    CTimer::get("XIOS").resume();
+    reduce_domain_to_axis_hdl->local.setValue(local);
+    CTimer::get("XIOS").suspend();
+  }
+
+  void cxios_get_reduce_domain_to_axis_local(reduce_domain_to_axis_Ptr reduce_domain_to_axis_hdl, bool* local)
+  {
+    CTimer::get("XIOS").resume();
+    *local = reduce_domain_to_axis_hdl->local.getInheritedValue();
+    CTimer::get("XIOS").suspend();
+  }
+
+  bool cxios_is_defined_reduce_domain_to_axis_local(reduce_domain_to_axis_Ptr reduce_domain_to_axis_hdl)
+  {
+     CTimer::get("XIOS").resume();
+     bool isDefined = reduce_domain_to_axis_hdl->local.hasInheritedValue();
+     CTimer::get("XIOS").suspend();
+     return isDefined;
+  }
+
+
   void cxios_set_reduce_domain_to_axis_operation(reduce_domain_to_axis_Ptr reduce_domain_to_axis_hdl, const char * operation, int operation_size)
   {
Index: /XIOS/trunk/src/interface/c_attr/icreduce_domain_to_scalar_attr.cpp
===================================================================
--- /XIOS/trunk/src/interface/c_attr/icreduce_domain_to_scalar_attr.cpp	(revision 1536)
+++ /XIOS/trunk/src/interface/c_attr/icreduce_domain_to_scalar_attr.cpp	(revision 1537)
@@ -17,4 +17,27 @@
 {
   typedef xios::CReduceDomainToScalar* reduce_domain_to_scalar_Ptr;
+
+  void cxios_set_reduce_domain_to_scalar_local(reduce_domain_to_scalar_Ptr reduce_domain_to_scalar_hdl, bool local)
+  {
+    CTimer::get("XIOS").resume();
+    reduce_domain_to_scalar_hdl->local.setValue(local);
+    CTimer::get("XIOS").suspend();
+  }
+
+  void cxios_get_reduce_domain_to_scalar_local(reduce_domain_to_scalar_Ptr reduce_domain_to_scalar_hdl, bool* local)
+  {
+    CTimer::get("XIOS").resume();
+    *local = reduce_domain_to_scalar_hdl->local.getInheritedValue();
+    CTimer::get("XIOS").suspend();
+  }
+
+  bool cxios_is_defined_reduce_domain_to_scalar_local(reduce_domain_to_scalar_Ptr reduce_domain_to_scalar_hdl)
+  {
+     CTimer::get("XIOS").resume();
+     bool isDefined = reduce_domain_to_scalar_hdl->local.hasInheritedValue();
+     CTimer::get("XIOS").suspend();
+     return isDefined;
+  }
+
 
   void cxios_set_reduce_domain_to_scalar_operation(reduce_domain_to_scalar_Ptr reduce_domain_to_scalar_hdl, const char * operation, int operation_size)
Index: /XIOS/trunk/src/interface/c_attr/icreduce_scalar_to_scalar_attr.cpp
===================================================================
--- /XIOS/trunk/src/interface/c_attr/icreduce_scalar_to_scalar_attr.cpp	(revision 1537)
+++ /XIOS/trunk/src/interface/c_attr/icreduce_scalar_to_scalar_attr.cpp	(revision 1537)
@@ -0,0 +1,44 @@
+/* ************************************************************************** *
+ *               Interface auto generated - do not modify                     *
+ * ************************************************************************** */
+
+#include <boost/multi_array.hpp>
+#include <boost/shared_ptr.hpp>
+#include "xios.hpp"
+#include "attribute_template.hpp"
+#include "object_template.hpp"
+#include "group_template.hpp"
+#include "icutil.hpp"
+#include "icdate.hpp"
+#include "timer.hpp"
+#include "node_type.hpp"
+
+extern "C"
+{
+  typedef xios::CReduceScalarToScalar* reduce_scalar_to_scalar_Ptr;
+
+  void cxios_set_reduce_scalar_to_scalar_operation(reduce_scalar_to_scalar_Ptr reduce_scalar_to_scalar_hdl, const char * operation, int operation_size)
+  {
+    std::string operation_str;
+    if (!cstr2string(operation, operation_size, operation_str)) return;
+    CTimer::get("XIOS").resume();
+    reduce_scalar_to_scalar_hdl->operation.fromString(operation_str);
+    CTimer::get("XIOS").suspend();
+  }
+
+  void cxios_get_reduce_scalar_to_scalar_operation(reduce_scalar_to_scalar_Ptr reduce_scalar_to_scalar_hdl, char * operation, int operation_size)
+  {
+    CTimer::get("XIOS").resume();
+    if (!string_copy(reduce_scalar_to_scalar_hdl->operation.getInheritedStringValue(), operation, operation_size))
+      ERROR("void cxios_get_reduce_scalar_to_scalar_operation(reduce_scalar_to_scalar_Ptr reduce_scalar_to_scalar_hdl, char * operation, int operation_size)", << "Input string is too short");
+    CTimer::get("XIOS").suspend();
+  }
+
+  bool cxios_is_defined_reduce_scalar_to_scalar_operation(reduce_scalar_to_scalar_Ptr reduce_scalar_to_scalar_hdl)
+  {
+     CTimer::get("XIOS").resume();
+     bool isDefined = reduce_scalar_to_scalar_hdl->operation.hasInheritedValue();
+     CTimer::get("XIOS").suspend();
+     return isDefined;
+  }
+}
Index: /XIOS/trunk/src/interface/c_attr/icreorder_domain_attr.cpp
===================================================================
--- /XIOS/trunk/src/interface/c_attr/icreorder_domain_attr.cpp	(revision 1537)
+++ /XIOS/trunk/src/interface/c_attr/icreorder_domain_attr.cpp	(revision 1537)
@@ -0,0 +1,110 @@
+/* ************************************************************************** *
+ *               Interface auto generated - do not modify                     *
+ * ************************************************************************** */
+
+#include <boost/multi_array.hpp>
+#include <boost/shared_ptr.hpp>
+#include "xios.hpp"
+#include "attribute_template.hpp"
+#include "object_template.hpp"
+#include "group_template.hpp"
+#include "icutil.hpp"
+#include "icdate.hpp"
+#include "timer.hpp"
+#include "node_type.hpp"
+
+extern "C"
+{
+  typedef xios::CReorderDomain* reorder_domain_Ptr;
+
+  void cxios_set_reorder_domain_invert_lat(reorder_domain_Ptr reorder_domain_hdl, bool invert_lat)
+  {
+    CTimer::get("XIOS").resume();
+    reorder_domain_hdl->invert_lat.setValue(invert_lat);
+    CTimer::get("XIOS").suspend();
+  }
+
+  void cxios_get_reorder_domain_invert_lat(reorder_domain_Ptr reorder_domain_hdl, bool* invert_lat)
+  {
+    CTimer::get("XIOS").resume();
+    *invert_lat = reorder_domain_hdl->invert_lat.getInheritedValue();
+    CTimer::get("XIOS").suspend();
+  }
+
+  bool cxios_is_defined_reorder_domain_invert_lat(reorder_domain_Ptr reorder_domain_hdl)
+  {
+     CTimer::get("XIOS").resume();
+     bool isDefined = reorder_domain_hdl->invert_lat.hasInheritedValue();
+     CTimer::get("XIOS").suspend();
+     return isDefined;
+  }
+
+
+  void cxios_set_reorder_domain_max_lon(reorder_domain_Ptr reorder_domain_hdl, double max_lon)
+  {
+    CTimer::get("XIOS").resume();
+    reorder_domain_hdl->max_lon.setValue(max_lon);
+    CTimer::get("XIOS").suspend();
+  }
+
+  void cxios_get_reorder_domain_max_lon(reorder_domain_Ptr reorder_domain_hdl, double* max_lon)
+  {
+    CTimer::get("XIOS").resume();
+    *max_lon = reorder_domain_hdl->max_lon.getInheritedValue();
+    CTimer::get("XIOS").suspend();
+  }
+
+  bool cxios_is_defined_reorder_domain_max_lon(reorder_domain_Ptr reorder_domain_hdl)
+  {
+     CTimer::get("XIOS").resume();
+     bool isDefined = reorder_domain_hdl->max_lon.hasInheritedValue();
+     CTimer::get("XIOS").suspend();
+     return isDefined;
+  }
+
+
+  void cxios_set_reorder_domain_min_lon(reorder_domain_Ptr reorder_domain_hdl, double min_lon)
+  {
+    CTimer::get("XIOS").resume();
+    reorder_domain_hdl->min_lon.setValue(min_lon);
+    CTimer::get("XIOS").suspend();
+  }
+
+  void cxios_get_reorder_domain_min_lon(reorder_domain_Ptr reorder_domain_hdl, double* min_lon)
+  {
+    CTimer::get("XIOS").resume();
+    *min_lon = reorder_domain_hdl->min_lon.getInheritedValue();
+    CTimer::get("XIOS").suspend();
+  }
+
+  bool cxios_is_defined_reorder_domain_min_lon(reorder_domain_Ptr reorder_domain_hdl)
+  {
+     CTimer::get("XIOS").resume();
+     bool isDefined = reorder_domain_hdl->min_lon.hasInheritedValue();
+     CTimer::get("XIOS").suspend();
+     return isDefined;
+  }
+
+
+  void cxios_set_reorder_domain_shift_lon_fraction(reorder_domain_Ptr reorder_domain_hdl, double shift_lon_fraction)
+  {
+    CTimer::get("XIOS").resume();
+    reorder_domain_hdl->shift_lon_fraction.setValue(shift_lon_fraction);
+    CTimer::get("XIOS").suspend();
+  }
+
+  void cxios_get_reorder_domain_shift_lon_fraction(reorder_domain_Ptr reorder_domain_hdl, double* shift_lon_fraction)
+  {
+    CTimer::get("XIOS").resume();
+    *shift_lon_fraction = reorder_domain_hdl->shift_lon_fraction.getInheritedValue();
+    CTimer::get("XIOS").suspend();
+  }
+
+  bool cxios_is_defined_reorder_domain_shift_lon_fraction(reorder_domain_Ptr reorder_domain_hdl)
+  {
+     CTimer::get("XIOS").resume();
+     bool isDefined = reorder_domain_hdl->shift_lon_fraction.hasInheritedValue();
+     CTimer::get("XIOS").suspend();
+     return isDefined;
+  }
+}
Index: /XIOS/trunk/src/interface/c_attr/icscalar_attr.cpp
===================================================================
--- /XIOS/trunk/src/interface/c_attr/icscalar_attr.cpp	(revision 1536)
+++ /XIOS/trunk/src/interface/c_attr/icscalar_attr.cpp	(revision 1537)
@@ -18,4 +18,133 @@
   typedef xios::CScalar* scalar_Ptr;
 
+  void cxios_set_scalar_axis_type(scalar_Ptr scalar_hdl, const char * axis_type, int axis_type_size)
+  {
+    std::string axis_type_str;
+    if (!cstr2string(axis_type, axis_type_size, axis_type_str)) return;
+    CTimer::get("XIOS").resume();
+    scalar_hdl->axis_type.fromString(axis_type_str);
+    CTimer::get("XIOS").suspend();
+  }
+
+  void cxios_get_scalar_axis_type(scalar_Ptr scalar_hdl, char * axis_type, int axis_type_size)
+  {
+    CTimer::get("XIOS").resume();
+    if (!string_copy(scalar_hdl->axis_type.getInheritedStringValue(), axis_type, axis_type_size))
+      ERROR("void cxios_get_scalar_axis_type(scalar_Ptr scalar_hdl, char * axis_type, int axis_type_size)", << "Input string is too short");
+    CTimer::get("XIOS").suspend();
+  }
+
+  bool cxios_is_defined_scalar_axis_type(scalar_Ptr scalar_hdl)
+  {
+     CTimer::get("XIOS").resume();
+     bool isDefined = scalar_hdl->axis_type.hasInheritedValue();
+     CTimer::get("XIOS").suspend();
+     return isDefined;
+  }
+
+
+  void cxios_set_scalar_bounds(scalar_Ptr scalar_hdl, double* bounds, int* extent)
+  {
+    CTimer::get("XIOS").resume();
+    CArray<double,1> tmp(bounds, shape(extent[0]), neverDeleteData);
+    scalar_hdl->bounds.reference(tmp.copy());
+     CTimer::get("XIOS").suspend();
+  }
+
+  void cxios_get_scalar_bounds(scalar_Ptr scalar_hdl, double* bounds, int* extent)
+  {
+    CTimer::get("XIOS").resume();
+    CArray<double,1> tmp(bounds, shape(extent[0]), neverDeleteData);
+    tmp=scalar_hdl->bounds.getInheritedValue();
+     CTimer::get("XIOS").suspend();
+  }
+
+  bool cxios_is_defined_scalar_bounds(scalar_Ptr scalar_hdl)
+  {
+     CTimer::get("XIOS").resume();
+     bool isDefined = scalar_hdl->bounds.hasInheritedValue();
+     CTimer::get("XIOS").suspend();
+     return isDefined;
+  }
+
+
+  void cxios_set_scalar_bounds_name(scalar_Ptr scalar_hdl, const char * bounds_name, int bounds_name_size)
+  {
+    std::string bounds_name_str;
+    if (!cstr2string(bounds_name, bounds_name_size, bounds_name_str)) return;
+    CTimer::get("XIOS").resume();
+    scalar_hdl->bounds_name.setValue(bounds_name_str);
+    CTimer::get("XIOS").suspend();
+  }
+
+  void cxios_get_scalar_bounds_name(scalar_Ptr scalar_hdl, char * bounds_name, int bounds_name_size)
+  {
+    CTimer::get("XIOS").resume();
+    if (!string_copy(scalar_hdl->bounds_name.getInheritedValue(), bounds_name, bounds_name_size))
+      ERROR("void cxios_get_scalar_bounds_name(scalar_Ptr scalar_hdl, char * bounds_name, int bounds_name_size)", << "Input string is too short");
+    CTimer::get("XIOS").suspend();
+  }
+
+  bool cxios_is_defined_scalar_bounds_name(scalar_Ptr scalar_hdl)
+  {
+     CTimer::get("XIOS").resume();
+     bool isDefined = scalar_hdl->bounds_name.hasInheritedValue();
+     CTimer::get("XIOS").suspend();
+     return isDefined;
+  }
+
+
+  void cxios_set_scalar_comment(scalar_Ptr scalar_hdl, const char * comment, int comment_size)
+  {
+    std::string comment_str;
+    if (!cstr2string(comment, comment_size, comment_str)) return;
+    CTimer::get("XIOS").resume();
+    scalar_hdl->comment.setValue(comment_str);
+    CTimer::get("XIOS").suspend();
+  }
+
+  void cxios_get_scalar_comment(scalar_Ptr scalar_hdl, char * comment, int comment_size)
+  {
+    CTimer::get("XIOS").resume();
+    if (!string_copy(scalar_hdl->comment.getInheritedValue(), comment, comment_size))
+      ERROR("void cxios_get_scalar_comment(scalar_Ptr scalar_hdl, char * comment, int comment_size)", << "Input string is too short");
+    CTimer::get("XIOS").suspend();
+  }
+
+  bool cxios_is_defined_scalar_comment(scalar_Ptr scalar_hdl)
+  {
+     CTimer::get("XIOS").resume();
+     bool isDefined = scalar_hdl->comment.hasInheritedValue();
+     CTimer::get("XIOS").suspend();
+     return isDefined;
+  }
+
+
+  void cxios_set_scalar_label(scalar_Ptr scalar_hdl, const char * label, int label_size)
+  {
+    std::string label_str;
+    if (!cstr2string(label, label_size, label_str)) return;
+    CTimer::get("XIOS").resume();
+    scalar_hdl->label.setValue(label_str);
+    CTimer::get("XIOS").suspend();
+  }
+
+  void cxios_get_scalar_label(scalar_Ptr scalar_hdl, char * label, int label_size)
+  {
+    CTimer::get("XIOS").resume();
+    if (!string_copy(scalar_hdl->label.getInheritedValue(), label, label_size))
+      ERROR("void cxios_get_scalar_label(scalar_Ptr scalar_hdl, char * label, int label_size)", << "Input string is too short");
+    CTimer::get("XIOS").suspend();
+  }
+
+  bool cxios_is_defined_scalar_label(scalar_Ptr scalar_hdl)
+  {
+     CTimer::get("XIOS").resume();
+     bool isDefined = scalar_hdl->label.hasInheritedValue();
+     CTimer::get("XIOS").suspend();
+     return isDefined;
+  }
+
+
   void cxios_set_scalar_long_name(scalar_Ptr scalar_hdl, const char * long_name, int long_name_size)
   {
@@ -70,4 +199,30 @@
 
 
+  void cxios_set_scalar_positive(scalar_Ptr scalar_hdl, const char * positive, int positive_size)
+  {
+    std::string positive_str;
+    if (!cstr2string(positive, positive_size, positive_str)) return;
+    CTimer::get("XIOS").resume();
+    scalar_hdl->positive.fromString(positive_str);
+    CTimer::get("XIOS").suspend();
+  }
+
+  void cxios_get_scalar_positive(scalar_Ptr scalar_hdl, char * positive, int positive_size)
+  {
+    CTimer::get("XIOS").resume();
+    if (!string_copy(scalar_hdl->positive.getInheritedStringValue(), positive, positive_size))
+      ERROR("void cxios_get_scalar_positive(scalar_Ptr scalar_hdl, char * positive, int positive_size)", << "Input string is too short");
+    CTimer::get("XIOS").suspend();
+  }
+
+  bool cxios_is_defined_scalar_positive(scalar_Ptr scalar_hdl)
+  {
+     CTimer::get("XIOS").resume();
+     bool isDefined = scalar_hdl->positive.hasInheritedValue();
+     CTimer::get("XIOS").suspend();
+     return isDefined;
+  }
+
+
   void cxios_set_scalar_prec(scalar_Ptr scalar_hdl, int prec)
   {
Index: /XIOS/trunk/src/interface/c_attr/icscalargroup_attr.cpp
===================================================================
--- /XIOS/trunk/src/interface/c_attr/icscalargroup_attr.cpp	(revision 1536)
+++ /XIOS/trunk/src/interface/c_attr/icscalargroup_attr.cpp	(revision 1537)
@@ -18,4 +18,107 @@
   typedef xios::CScalarGroup* scalargroup_Ptr;
 
+  void cxios_set_scalargroup_axis_type(scalargroup_Ptr scalargroup_hdl, const char * axis_type, int axis_type_size)
+  {
+    std::string axis_type_str;
+    if (!cstr2string(axis_type, axis_type_size, axis_type_str)) return;
+    CTimer::get("XIOS").resume();
+    scalargroup_hdl->axis_type.fromString(axis_type_str);
+    CTimer::get("XIOS").suspend();
+  }
+
+  void cxios_get_scalargroup_axis_type(scalargroup_Ptr scalargroup_hdl, char * axis_type, int axis_type_size)
+  {
+    CTimer::get("XIOS").resume();
+    if (!string_copy(scalargroup_hdl->axis_type.getInheritedStringValue(), axis_type, axis_type_size))
+      ERROR("void cxios_get_scalargroup_axis_type(scalargroup_Ptr scalargroup_hdl, char * axis_type, int axis_type_size)", << "Input string is too short");
+    CTimer::get("XIOS").suspend();
+  }
+
+  bool cxios_is_defined_scalargroup_axis_type(scalargroup_Ptr scalargroup_hdl)
+  {
+     CTimer::get("XIOS").resume();
+     bool isDefined = scalargroup_hdl->axis_type.hasInheritedValue();
+     CTimer::get("XIOS").suspend();
+     return isDefined;
+  }
+
+
+  void cxios_set_scalargroup_bounds(scalargroup_Ptr scalargroup_hdl, double* bounds, int* extent)
+  {
+    CTimer::get("XIOS").resume();
+    CArray<double,1> tmp(bounds, shape(extent[0]), neverDeleteData);
+    scalargroup_hdl->bounds.reference(tmp.copy());
+     CTimer::get("XIOS").suspend();
+  }
+
+  void cxios_get_scalargroup_bounds(scalargroup_Ptr scalargroup_hdl, double* bounds, int* extent)
+  {
+    CTimer::get("XIOS").resume();
+    CArray<double,1> tmp(bounds, shape(extent[0]), neverDeleteData);
+    tmp=scalargroup_hdl->bounds.getInheritedValue();
+     CTimer::get("XIOS").suspend();
+  }
+
+  bool cxios_is_defined_scalargroup_bounds(scalargroup_Ptr scalargroup_hdl)
+  {
+     CTimer::get("XIOS").resume();
+     bool isDefined = scalargroup_hdl->bounds.hasInheritedValue();
+     CTimer::get("XIOS").suspend();
+     return isDefined;
+  }
+
+
+  void cxios_set_scalargroup_bounds_name(scalargroup_Ptr scalargroup_hdl, const char * bounds_name, int bounds_name_size)
+  {
+    std::string bounds_name_str;
+    if (!cstr2string(bounds_name, bounds_name_size, bounds_name_str)) return;
+    CTimer::get("XIOS").resume();
+    scalargroup_hdl->bounds_name.setValue(bounds_name_str);
+    CTimer::get("XIOS").suspend();
+  }
+
+  void cxios_get_scalargroup_bounds_name(scalargroup_Ptr scalargroup_hdl, char * bounds_name, int bounds_name_size)
+  {
+    CTimer::get("XIOS").resume();
+    if (!string_copy(scalargroup_hdl->bounds_name.getInheritedValue(), bounds_name, bounds_name_size))
+      ERROR("void cxios_get_scalargroup_bounds_name(scalargroup_Ptr scalargroup_hdl, char * bounds_name, int bounds_name_size)", << "Input string is too short");
+    CTimer::get("XIOS").suspend();
+  }
+
+  bool cxios_is_defined_scalargroup_bounds_name(scalargroup_Ptr scalargroup_hdl)
+  {
+     CTimer::get("XIOS").resume();
+     bool isDefined = scalargroup_hdl->bounds_name.hasInheritedValue();
+     CTimer::get("XIOS").suspend();
+     return isDefined;
+  }
+
+
+  void cxios_set_scalargroup_comment(scalargroup_Ptr scalargroup_hdl, const char * comment, int comment_size)
+  {
+    std::string comment_str;
+    if (!cstr2string(comment, comment_size, comment_str)) return;
+    CTimer::get("XIOS").resume();
+    scalargroup_hdl->comment.setValue(comment_str);
+    CTimer::get("XIOS").suspend();
+  }
+
+  void cxios_get_scalargroup_comment(scalargroup_Ptr scalargroup_hdl, char * comment, int comment_size)
+  {
+    CTimer::get("XIOS").resume();
+    if (!string_copy(scalargroup_hdl->comment.getInheritedValue(), comment, comment_size))
+      ERROR("void cxios_get_scalargroup_comment(scalargroup_Ptr scalargroup_hdl, char * comment, int comment_size)", << "Input string is too short");
+    CTimer::get("XIOS").suspend();
+  }
+
+  bool cxios_is_defined_scalargroup_comment(scalargroup_Ptr scalargroup_hdl)
+  {
+     CTimer::get("XIOS").resume();
+     bool isDefined = scalargroup_hdl->comment.hasInheritedValue();
+     CTimer::get("XIOS").suspend();
+     return isDefined;
+  }
+
+
   void cxios_set_scalargroup_group_ref(scalargroup_Ptr scalargroup_hdl, const char * group_ref, int group_ref_size)
   {
@@ -44,4 +147,30 @@
 
 
+  void cxios_set_scalargroup_label(scalargroup_Ptr scalargroup_hdl, const char * label, int label_size)
+  {
+    std::string label_str;
+    if (!cstr2string(label, label_size, label_str)) return;
+    CTimer::get("XIOS").resume();
+    scalargroup_hdl->label.setValue(label_str);
+    CTimer::get("XIOS").suspend();
+  }
+
+  void cxios_get_scalargroup_label(scalargroup_Ptr scalargroup_hdl, char * label, int label_size)
+  {
+    CTimer::get("XIOS").resume();
+    if (!string_copy(scalargroup_hdl->label.getInheritedValue(), label, label_size))
+      ERROR("void cxios_get_scalargroup_label(scalargroup_Ptr scalargroup_hdl, char * label, int label_size)", << "Input string is too short");
+    CTimer::get("XIOS").suspend();
+  }
+
+  bool cxios_is_defined_scalargroup_label(scalargroup_Ptr scalargroup_hdl)
+  {
+     CTimer::get("XIOS").resume();
+     bool isDefined = scalargroup_hdl->label.hasInheritedValue();
+     CTimer::get("XIOS").suspend();
+     return isDefined;
+  }
+
+
   void cxios_set_scalargroup_long_name(scalargroup_Ptr scalargroup_hdl, const char * long_name, int long_name_size)
   {
@@ -96,4 +225,30 @@
 
 
+  void cxios_set_scalargroup_positive(scalargroup_Ptr scalargroup_hdl, const char * positive, int positive_size)
+  {
+    std::string positive_str;
+    if (!cstr2string(positive, positive_size, positive_str)) return;
+    CTimer::get("XIOS").resume();
+    scalargroup_hdl->positive.fromString(positive_str);
+    CTimer::get("XIOS").suspend();
+  }
+
+  void cxios_get_scalargroup_positive(scalargroup_Ptr scalargroup_hdl, char * positive, int positive_size)
+  {
+    CTimer::get("XIOS").resume();
+    if (!string_copy(scalargroup_hdl->positive.getInheritedStringValue(), positive, positive_size))
+      ERROR("void cxios_get_scalargroup_positive(scalargroup_Ptr scalargroup_hdl, char * positive, int positive_size)", << "Input string is too short");
+    CTimer::get("XIOS").suspend();
+  }
+
+  bool cxios_is_defined_scalargroup_positive(scalargroup_Ptr scalargroup_hdl)
+  {
+     CTimer::get("XIOS").resume();
+     bool isDefined = scalargroup_hdl->positive.hasInheritedValue();
+     CTimer::get("XIOS").suspend();
+     return isDefined;
+  }
+
+
   void cxios_set_scalargroup_prec(scalargroup_Ptr scalargroup_hdl, int prec)
   {
Index: /XIOS/trunk/src/interface/c_attr/ictemporal_splitting_attr.cpp
===================================================================
--- /XIOS/trunk/src/interface/c_attr/ictemporal_splitting_attr.cpp	(revision 1537)
+++ /XIOS/trunk/src/interface/c_attr/ictemporal_splitting_attr.cpp	(revision 1537)
@@ -0,0 +1,18 @@
+/* ************************************************************************** *
+ *               Interface auto generated - do not modify                     *
+ * ************************************************************************** */
+
+#include <boost/multi_array.hpp>
+#include <boost/shared_ptr.hpp>
+#include "xios.hpp"
+#include "attribute_template.hpp"
+#include "object_template.hpp"
+#include "group_template.hpp"
+#include "icutil.hpp"
+#include "icdate.hpp"
+#include "timer.hpp"
+#include "node_type.hpp"
+
+extern "C"
+{
+  typedef xios::CTemporalSplitting* temporal_splitting_Ptr;}
Index: /XIOS/trunk/src/interface/fortran/duplicate_scalar_to_axis_interface.f90
===================================================================
--- /XIOS/trunk/src/interface/fortran/duplicate_scalar_to_axis_interface.f90	(revision 1537)
+++ /XIOS/trunk/src/interface/fortran/duplicate_scalar_to_axis_interface.f90	(revision 1537)
@@ -0,0 +1,22 @@
+MODULE DUPLICATE_SCALAR_TO_AXIS_INTERFACE
+   USE, INTRINSIC :: ISO_C_BINDING
+
+   INTERFACE ! Ne pas appeler directement/Interface FORTRAN 2003 <-> C99
+
+      SUBROUTINE cxios_duplicate_scalar_to_axis_handle_create(ret, idt, idt_size) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER  (kind = C_INTPTR_T)               :: ret
+         CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: idt
+         INTEGER  (kind = C_INT)     , VALUE        :: idt_size
+      END SUBROUTINE cxios_duplicate_scalar_to_axis_handle_create
+
+      SUBROUTINE cxios_duplicate_scalar_to_axis_valid_id(ret, idt, idt_size) BIND(C)
+         USE ISO_C_BINDING
+         LOGICAL  (kind = C_BOOL)                   :: ret
+         CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: idt
+         INTEGER  (kind = C_INT)     , VALUE        :: idt_size
+      END SUBROUTINE cxios_duplicate_scalar_to_axis_valid_id
+
+   END INTERFACE
+
+END MODULE DUPLICATE_SCALAR_TO_AXIS_INTERFACE
Index: /XIOS/trunk/src/interface/fortran/iduplicate_scalar_to_axis_interface.F90
===================================================================
--- /XIOS/trunk/src/interface/fortran/iduplicate_scalar_to_axis_interface.F90	(revision 1537)
+++ /XIOS/trunk/src/interface/fortran/iduplicate_scalar_to_axis_interface.F90	(revision 1537)
@@ -0,0 +1,30 @@
+#include "xios_fortran_prefix.hpp"
+
+MODULE IDUPLICATE_SCALAR_TO_AXIS
+   USE, INTRINSIC :: ISO_C_BINDING
+   USE DUPLICATE_SCALAR_TO_AXIS_INTERFACE
+
+   TYPE txios(duplicate_scalar_to_axis)
+      INTEGER(kind = C_INTPTR_T) :: daddr
+   END TYPE txios(duplicate_scalar_to_axis)
+
+   CONTAINS ! Fonctions disponibles pour les utilisateurs.
+
+   SUBROUTINE xios(get_duplicate_scalar_to_axis_handle)(idt,ret)
+      IMPLICIT NONE
+      CHARACTER(len = *), INTENT(IN) :: idt
+      TYPE(txios(duplicate_scalar_to_axis)) , INTENT(OUT):: ret
+      CALL cxios_duplicate_scalar_to_axis_handle_create(ret%daddr, idt, len(idt))
+   END SUBROUTINE xios(get_duplicate_scalar_to_axis_handle)
+
+   LOGICAL FUNCTION xios(is_valid_duplicate_scalar_to_axis)(idt)
+      IMPLICIT NONE
+      CHARACTER(len  = *)    , INTENT(IN) :: idt
+      LOGICAL  (kind = 1)                 :: val
+
+      CALL cxios_duplicate_scalar_to_axis_valid_id(val, idt, len(idt))
+      xios(is_valid_duplicate_scalar_to_axis) = val
+
+   END FUNCTION  xios(is_valid_duplicate_scalar_to_axis)
+
+END MODULE IDUPLICATE_SCALAR_TO_AXIS
Index: /XIOS/trunk/src/interface/fortran/ireduce_axis_to_axis.F90
===================================================================
--- /XIOS/trunk/src/interface/fortran/ireduce_axis_to_axis.F90	(revision 1537)
+++ /XIOS/trunk/src/interface/fortran/ireduce_axis_to_axis.F90	(revision 1537)
@@ -0,0 +1,30 @@
+#include "xios_fortran_prefix.hpp"
+
+MODULE IREDUCE_AXIS_TO_AXIS
+   USE, INTRINSIC :: ISO_C_BINDING
+   USE REDUCE_AXIS_TO_AXIS_INTERFACE
+
+   TYPE txios(reduce_axis_to_axis)
+      INTEGER(kind = C_INTPTR_T) :: daddr
+   END TYPE txios(reduce_axis_to_axis)
+
+   CONTAINS ! Fonctions disponibles pour les utilisateurs.
+
+   SUBROUTINE xios(get_reduce_axis_to_axis_handle)(idt,ret)
+      IMPLICIT NONE
+      CHARACTER(len = *), INTENT(IN) :: idt
+      TYPE(txios(reduce_axis_to_axis)) , INTENT(OUT):: ret
+      CALL cxios_reduce_axis_to_axis_handle_create(ret%daddr, idt, len(idt))
+   END SUBROUTINE xios(get_reduce_axis_to_axis_handle)
+
+   LOGICAL FUNCTION xios(is_valid_reduce_axis_to_axis)(idt)
+      IMPLICIT NONE
+      CHARACTER(len  = *)    , INTENT(IN) :: idt
+      LOGICAL  (kind = 1)                 :: val
+
+      CALL cxios_reduce_axis_to_axis_valid_id(val, idt, len(idt))
+      xios(is_valid_reduce_axis_to_axis) = val
+
+   END FUNCTION  xios(is_valid_reduce_axis_to_axis)
+
+END MODULE IREDUCE_AXIS_TO_AXIS
Index: /XIOS/trunk/src/interface/fortran/ireduce_scalar_to_scalar.F90
===================================================================
--- /XIOS/trunk/src/interface/fortran/ireduce_scalar_to_scalar.F90	(revision 1537)
+++ /XIOS/trunk/src/interface/fortran/ireduce_scalar_to_scalar.F90	(revision 1537)
@@ -0,0 +1,30 @@
+#include "xios_fortran_prefix.hpp"
+
+MODULE IREDUCE_SCALAR_TO_SCALAR
+   USE, INTRINSIC :: ISO_C_BINDING
+   USE REDUCE_SCALAR_TO_SCALAR_INTERFACE
+
+   TYPE txios(reduce_scalar_to_scalar)
+      INTEGER(kind = C_INTPTR_T) :: daddr
+   END TYPE txios(reduce_scalar_to_scalar)
+
+   CONTAINS ! Fonctions disponibles pour les utilisateurs.
+
+   SUBROUTINE xios(get_reduce_scalar_to_scalar_handle)(idt,ret)
+      IMPLICIT NONE
+      CHARACTER(len = *), INTENT(IN) :: idt
+      TYPE(txios(reduce_scalar_to_scalar)) , INTENT(OUT):: ret
+      CALL cxios_reduce_scalar_to_scalar_handle_create(ret%daddr, idt, len(idt))
+   END SUBROUTINE xios(get_reduce_scalar_to_scalar_handle)
+
+   LOGICAL FUNCTION xios(is_valid_reduce_scalar_to_scalar)(idt)
+      IMPLICIT NONE
+      CHARACTER(len  = *)    , INTENT(IN) :: idt
+      LOGICAL  (kind = 1)                 :: val
+
+      CALL cxios_reduce_scalar_to_scalar_valid_id(val, idt, len(idt))
+      xios(is_valid_reduce_scalar_to_scalar) = val
+
+   END FUNCTION  xios(is_valid_reduce_scalar_to_scalar)
+
+END MODULE IREDUCE_SCALAR_TO_SCALAR
Index: /XIOS/trunk/src/interface/fortran/ireorder_domain.F90
===================================================================
--- /XIOS/trunk/src/interface/fortran/ireorder_domain.F90	(revision 1537)
+++ /XIOS/trunk/src/interface/fortran/ireorder_domain.F90	(revision 1537)
@@ -0,0 +1,30 @@
+#include "xios_fortran_prefix.hpp"
+
+MODULE IREORDER_DOMAIN
+   USE, INTRINSIC :: ISO_C_BINDING
+   USE REORDER_DOMAIN_INTERFACE
+
+   TYPE txios(reorder_domain)
+      INTEGER(kind = C_INTPTR_T) :: daddr
+   END TYPE txios(reorder_domain)
+
+   CONTAINS ! Fonctions disponibles pour les utilisateurs.
+
+   SUBROUTINE xios(get_reorder_domain_handle)(idt,ret)
+      IMPLICIT NONE
+      CHARACTER(len = *), INTENT(IN) :: idt
+      TYPE(txios(reorder_domain)) , INTENT(OUT):: ret
+      CALL cxios_reorder_domain_handle_create(ret%daddr, idt, len(idt))
+   END SUBROUTINE xios(get_reorder_domain_handle)
+
+   LOGICAL FUNCTION xios(is_valid_reorder_domain)(idt)
+      IMPLICIT NONE
+      CHARACTER(len  = *)    , INTENT(IN) :: idt
+      LOGICAL  (kind = 1)                 :: val
+
+      CALL cxios_reorder_domain_valid_id(val, idt, len(idt))
+      xios(is_valid_reorder_domain) = val
+
+   END FUNCTION  xios(is_valid_reorder_domain)
+
+END MODULE IREORDER_DOMAIN
Index: /XIOS/trunk/src/interface/fortran/itemporal_splitting.F90
===================================================================
--- /XIOS/trunk/src/interface/fortran/itemporal_splitting.F90	(revision 1537)
+++ /XIOS/trunk/src/interface/fortran/itemporal_splitting.F90	(revision 1537)
@@ -0,0 +1,30 @@
+#include "xios_fortran_prefix.hpp"
+
+MODULE ITEMPORAL_SPLITTING
+   USE, INTRINSIC :: ISO_C_BINDING
+   USE TEMPORAL_SPLITTING_INTERFACE
+
+   TYPE txios(temporal_splitting)
+      INTEGER(kind = C_INTPTR_T) :: daddr
+   END TYPE txios(temporal_splitting)
+
+   CONTAINS ! Fonctions disponibles pour les utilisateurs.
+
+   SUBROUTINE xios(get_temporal_splitting_handle)(idt,ret)
+      IMPLICIT NONE
+      CHARACTER(len = *), INTENT(IN) :: idt
+      TYPE(txios(temporal_splitting)) , INTENT(OUT):: ret
+      CALL cxios_temporal_splitting_handle_create(ret%daddr, idt, len(idt))
+   END SUBROUTINE xios(get_temporal_splitting_handle)
+
+   LOGICAL FUNCTION xios(is_valid_temporal_splitting)(idt)
+      IMPLICIT NONE
+      CHARACTER(len  = *)    , INTENT(IN) :: idt
+      LOGICAL  (kind = 1)                 :: val
+
+      CALL cxios_temporal_splitting_valid_id(val, idt, len(idt))
+      xios(is_valid_temporal_splitting) = val
+
+   END FUNCTION  xios(is_valid_temporal_splitting)
+
+END MODULE ITEMPORAL_SPLITTING
Index: /XIOS/trunk/src/interface/fortran/reduce_axis_to_axis_interface.f90
===================================================================
--- /XIOS/trunk/src/interface/fortran/reduce_axis_to_axis_interface.f90	(revision 1537)
+++ /XIOS/trunk/src/interface/fortran/reduce_axis_to_axis_interface.f90	(revision 1537)
@@ -0,0 +1,22 @@
+MODULE REDUCE_AXIS_TO_AXIS_INTERFACE
+   USE, INTRINSIC :: ISO_C_BINDING
+
+   INTERFACE ! Ne pas appeler directement/Interface FORTRAN 2003 <-> C99
+
+      SUBROUTINE cxios_reduce_axis_to_axis_handle_create(ret, idt, idt_size) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER  (kind = C_INTPTR_T)               :: ret
+         CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: idt
+         INTEGER  (kind = C_INT)     , VALUE        :: idt_size
+      END SUBROUTINE cxios_reduce_axis_to_axis_handle_create
+
+      SUBROUTINE cxios_reduce_axis_to_axis_valid_id(ret, idt, idt_size) BIND(C)
+         USE ISO_C_BINDING
+         LOGICAL  (kind = C_BOOL)                   :: ret
+         CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: idt
+         INTEGER  (kind = C_INT)     , VALUE        :: idt_size
+      END SUBROUTINE cxios_reduce_axis_to_axis_valid_id
+
+   END INTERFACE
+
+END MODULE REDUCE_AXIS_TO_AXIS_INTERFACE
Index: /XIOS/trunk/src/interface/fortran/reduce_scalar_to_scalar_interface.f90
===================================================================
--- /XIOS/trunk/src/interface/fortran/reduce_scalar_to_scalar_interface.f90	(revision 1537)
+++ /XIOS/trunk/src/interface/fortran/reduce_scalar_to_scalar_interface.f90	(revision 1537)
@@ -0,0 +1,22 @@
+MODULE REDUCE_SCALAR_TO_SCALAR_INTERFACE
+   USE, INTRINSIC :: ISO_C_BINDING
+
+   INTERFACE ! Ne pas appeler directement/Interface FORTRAN 2003 <-> C99
+
+      SUBROUTINE cxios_reduce_scalar_to_scalar_handle_create(ret, idt, idt_size) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER  (kind = C_INTPTR_T)               :: ret
+         CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: idt
+         INTEGER  (kind = C_INT)     , VALUE        :: idt_size
+      END SUBROUTINE cxios_reduce_scalar_to_scalar_handle_create
+
+      SUBROUTINE cxios_reduce_scalar_to_scalar_valid_id(ret, idt, idt_size) BIND(C)
+         USE ISO_C_BINDING
+         LOGICAL  (kind = C_BOOL)                   :: ret
+         CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: idt
+         INTEGER  (kind = C_INT)     , VALUE        :: idt_size
+      END SUBROUTINE cxios_reduce_scalar_to_scalar_valid_id
+
+   END INTERFACE
+
+END MODULE REDUCE_SCALAR_TO_SCALAR_INTERFACE
Index: /XIOS/trunk/src/interface/fortran/reorder_domain_interface.f90
===================================================================
--- /XIOS/trunk/src/interface/fortran/reorder_domain_interface.f90	(revision 1537)
+++ /XIOS/trunk/src/interface/fortran/reorder_domain_interface.f90	(revision 1537)
@@ -0,0 +1,22 @@
+MODULE REORDER_DOMAIN_INTERFACE
+   USE, INTRINSIC :: ISO_C_BINDING
+
+   INTERFACE ! Ne pas appeler directement/Interface FORTRAN 2003 <-> C99
+
+      SUBROUTINE cxios_reorder_domain_handle_create(ret, idt, idt_size) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER  (kind = C_INTPTR_T)               :: ret
+         CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: idt
+         INTEGER  (kind = C_INT)     , VALUE        :: idt_size
+      END SUBROUTINE cxios_reorder_domain_handle_create
+
+      SUBROUTINE cxios_reorder_domain_valid_id(ret, idt, idt_size) BIND(C)
+         USE ISO_C_BINDING
+         LOGICAL  (kind = C_BOOL)                   :: ret
+         CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: idt
+         INTEGER  (kind = C_INT)     , VALUE        :: idt_size
+      END SUBROUTINE cxios_reorder_domain_valid_id
+
+   END INTERFACE
+
+END MODULE REORDER_DOMAIN_INTERFACE
Index: /XIOS/trunk/src/interface/fortran/temporal_splitting_interface.f90
===================================================================
--- /XIOS/trunk/src/interface/fortran/temporal_splitting_interface.f90	(revision 1537)
+++ /XIOS/trunk/src/interface/fortran/temporal_splitting_interface.f90	(revision 1537)
@@ -0,0 +1,22 @@
+MODULE TEMPORAL_SPLITTING_INTERFACE
+   USE, INTRINSIC :: ISO_C_BINDING
+
+   INTERFACE ! Ne pas appeler directement/Interface FORTRAN 2003 <-> C99
+
+      SUBROUTINE cxios_temporal_splitting_handle_create(ret, idt, idt_size) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER  (kind = C_INTPTR_T)               :: ret
+         CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: idt
+         INTEGER  (kind = C_INT)     , VALUE        :: idt_size
+      END SUBROUTINE cxios_temporal_splitting_handle_create
+
+      SUBROUTINE cxios_temporal_splitting_valid_id(ret, idt, idt_size) BIND(C)
+         USE ISO_C_BINDING
+         LOGICAL  (kind = C_BOOL)                   :: ret
+         CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: idt
+         INTEGER  (kind = C_INT)     , VALUE        :: idt_size
+      END SUBROUTINE cxios_temporal_splitting_valid_id
+
+   END INTERFACE
+
+END MODULE TEMPORAL_SPLITTING_INTERFACE
Index: /XIOS/trunk/src/interface/fortran_attr/axis_interface_attr.F90
===================================================================
--- /XIOS/trunk/src/interface/fortran_attr/axis_interface_attr.F90	(revision 1536)
+++ /XIOS/trunk/src/interface/fortran_attr/axis_interface_attr.F90	(revision 1537)
@@ -31,4 +31,25 @@
 
 
+    SUBROUTINE cxios_set_axis_axis_type(axis_hdl, axis_type, axis_type_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: axis_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: axis_type
+      INTEGER  (kind = C_INT)     , VALUE        :: axis_type_size
+    END SUBROUTINE cxios_set_axis_axis_type
+
+    SUBROUTINE cxios_get_axis_axis_type(axis_hdl, axis_type, axis_type_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: axis_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: axis_type
+      INTEGER  (kind = C_INT)     , VALUE        :: axis_type_size
+    END SUBROUTINE cxios_get_axis_axis_type
+
+    FUNCTION cxios_is_defined_axis_axis_type(axis_hdl) BIND(C)
+      USE ISO_C_BINDING
+      LOGICAL(kind=C_BOOL) :: cxios_is_defined_axis_axis_type
+      INTEGER (kind = C_INTPTR_T), VALUE :: axis_hdl
+    END FUNCTION cxios_is_defined_axis_axis_type
+
+
     SUBROUTINE cxios_set_axis_begin(axis_hdl, begin) BIND(C)
       USE ISO_C_BINDING
@@ -71,4 +92,46 @@
 
 
+    SUBROUTINE cxios_set_axis_bounds_name(axis_hdl, bounds_name, bounds_name_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: axis_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: bounds_name
+      INTEGER  (kind = C_INT)     , VALUE        :: bounds_name_size
+    END SUBROUTINE cxios_set_axis_bounds_name
+
+    SUBROUTINE cxios_get_axis_bounds_name(axis_hdl, bounds_name, bounds_name_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: axis_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: bounds_name
+      INTEGER  (kind = C_INT)     , VALUE        :: bounds_name_size
+    END SUBROUTINE cxios_get_axis_bounds_name
+
+    FUNCTION cxios_is_defined_axis_bounds_name(axis_hdl) BIND(C)
+      USE ISO_C_BINDING
+      LOGICAL(kind=C_BOOL) :: cxios_is_defined_axis_bounds_name
+      INTEGER (kind = C_INTPTR_T), VALUE :: axis_hdl
+    END FUNCTION cxios_is_defined_axis_bounds_name
+
+
+    SUBROUTINE cxios_set_axis_comment(axis_hdl, comment, comment_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: axis_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: comment
+      INTEGER  (kind = C_INT)     , VALUE        :: comment_size
+    END SUBROUTINE cxios_set_axis_comment
+
+    SUBROUTINE cxios_get_axis_comment(axis_hdl, comment, comment_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: axis_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: comment
+      INTEGER  (kind = C_INT)     , VALUE        :: comment_size
+    END SUBROUTINE cxios_get_axis_comment
+
+    FUNCTION cxios_is_defined_axis_comment(axis_hdl) BIND(C)
+      USE ISO_C_BINDING
+      LOGICAL(kind=C_BOOL) :: cxios_is_defined_axis_comment
+      INTEGER (kind = C_INTPTR_T), VALUE :: axis_hdl
+    END FUNCTION cxios_is_defined_axis_comment
+
+
     SUBROUTINE cxios_set_axis_data_begin(axis_hdl, data_begin) BIND(C)
       USE ISO_C_BINDING
@@ -128,4 +191,109 @@
       INTEGER (kind = C_INTPTR_T), VALUE :: axis_hdl
     END FUNCTION cxios_is_defined_axis_data_n
+
+
+    SUBROUTINE cxios_set_axis_dim_name(axis_hdl, dim_name, dim_name_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: axis_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: dim_name
+      INTEGER  (kind = C_INT)     , VALUE        :: dim_name_size
+    END SUBROUTINE cxios_set_axis_dim_name
+
+    SUBROUTINE cxios_get_axis_dim_name(axis_hdl, dim_name, dim_name_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: axis_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: dim_name
+      INTEGER  (kind = C_INT)     , VALUE        :: dim_name_size
+    END SUBROUTINE cxios_get_axis_dim_name
+
+    FUNCTION cxios_is_defined_axis_dim_name(axis_hdl) BIND(C)
+      USE ISO_C_BINDING
+      LOGICAL(kind=C_BOOL) :: cxios_is_defined_axis_dim_name
+      INTEGER (kind = C_INTPTR_T), VALUE :: axis_hdl
+    END FUNCTION cxios_is_defined_axis_dim_name
+
+
+    SUBROUTINE cxios_set_axis_formula(axis_hdl, formula, formula_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: axis_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: formula
+      INTEGER  (kind = C_INT)     , VALUE        :: formula_size
+    END SUBROUTINE cxios_set_axis_formula
+
+    SUBROUTINE cxios_get_axis_formula(axis_hdl, formula, formula_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: axis_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: formula
+      INTEGER  (kind = C_INT)     , VALUE        :: formula_size
+    END SUBROUTINE cxios_get_axis_formula
+
+    FUNCTION cxios_is_defined_axis_formula(axis_hdl) BIND(C)
+      USE ISO_C_BINDING
+      LOGICAL(kind=C_BOOL) :: cxios_is_defined_axis_formula
+      INTEGER (kind = C_INTPTR_T), VALUE :: axis_hdl
+    END FUNCTION cxios_is_defined_axis_formula
+
+
+    SUBROUTINE cxios_set_axis_formula_bounds(axis_hdl, formula_bounds, formula_bounds_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: axis_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: formula_bounds
+      INTEGER  (kind = C_INT)     , VALUE        :: formula_bounds_size
+    END SUBROUTINE cxios_set_axis_formula_bounds
+
+    SUBROUTINE cxios_get_axis_formula_bounds(axis_hdl, formula_bounds, formula_bounds_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: axis_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: formula_bounds
+      INTEGER  (kind = C_INT)     , VALUE        :: formula_bounds_size
+    END SUBROUTINE cxios_get_axis_formula_bounds
+
+    FUNCTION cxios_is_defined_axis_formula_bounds(axis_hdl) BIND(C)
+      USE ISO_C_BINDING
+      LOGICAL(kind=C_BOOL) :: cxios_is_defined_axis_formula_bounds
+      INTEGER (kind = C_INTPTR_T), VALUE :: axis_hdl
+    END FUNCTION cxios_is_defined_axis_formula_bounds
+
+
+    SUBROUTINE cxios_set_axis_formula_term(axis_hdl, formula_term, formula_term_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: axis_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: formula_term
+      INTEGER  (kind = C_INT)     , VALUE        :: formula_term_size
+    END SUBROUTINE cxios_set_axis_formula_term
+
+    SUBROUTINE cxios_get_axis_formula_term(axis_hdl, formula_term, formula_term_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: axis_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: formula_term
+      INTEGER  (kind = C_INT)     , VALUE        :: formula_term_size
+    END SUBROUTINE cxios_get_axis_formula_term
+
+    FUNCTION cxios_is_defined_axis_formula_term(axis_hdl) BIND(C)
+      USE ISO_C_BINDING
+      LOGICAL(kind=C_BOOL) :: cxios_is_defined_axis_formula_term
+      INTEGER (kind = C_INTPTR_T), VALUE :: axis_hdl
+    END FUNCTION cxios_is_defined_axis_formula_term
+
+
+    SUBROUTINE cxios_set_axis_formula_term_bounds(axis_hdl, formula_term_bounds, formula_term_bounds_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: axis_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: formula_term_bounds
+      INTEGER  (kind = C_INT)     , VALUE        :: formula_term_bounds_size
+    END SUBROUTINE cxios_set_axis_formula_term_bounds
+
+    SUBROUTINE cxios_get_axis_formula_term_bounds(axis_hdl, formula_term_bounds, formula_term_bounds_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: axis_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: formula_term_bounds
+      INTEGER  (kind = C_INT)     , VALUE        :: formula_term_bounds_size
+    END SUBROUTINE cxios_get_axis_formula_term_bounds
+
+    FUNCTION cxios_is_defined_axis_formula_term_bounds(axis_hdl) BIND(C)
+      USE ISO_C_BINDING
+      LOGICAL(kind=C_BOOL) :: cxios_is_defined_axis_formula_term_bounds
+      INTEGER (kind = C_INTPTR_T), VALUE :: axis_hdl
+    END FUNCTION cxios_is_defined_axis_formula_term_bounds
 
 
Index: /XIOS/trunk/src/interface/fortran_attr/axisgroup_interface_attr.F90
===================================================================
--- /XIOS/trunk/src/interface/fortran_attr/axisgroup_interface_attr.F90	(revision 1536)
+++ /XIOS/trunk/src/interface/fortran_attr/axisgroup_interface_attr.F90	(revision 1537)
@@ -31,4 +31,25 @@
 
 
+    SUBROUTINE cxios_set_axisgroup_axis_type(axisgroup_hdl, axis_type, axis_type_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: axisgroup_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: axis_type
+      INTEGER  (kind = C_INT)     , VALUE        :: axis_type_size
+    END SUBROUTINE cxios_set_axisgroup_axis_type
+
+    SUBROUTINE cxios_get_axisgroup_axis_type(axisgroup_hdl, axis_type, axis_type_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: axisgroup_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: axis_type
+      INTEGER  (kind = C_INT)     , VALUE        :: axis_type_size
+    END SUBROUTINE cxios_get_axisgroup_axis_type
+
+    FUNCTION cxios_is_defined_axisgroup_axis_type(axisgroup_hdl) BIND(C)
+      USE ISO_C_BINDING
+      LOGICAL(kind=C_BOOL) :: cxios_is_defined_axisgroup_axis_type
+      INTEGER (kind = C_INTPTR_T), VALUE :: axisgroup_hdl
+    END FUNCTION cxios_is_defined_axisgroup_axis_type
+
+
     SUBROUTINE cxios_set_axisgroup_begin(axisgroup_hdl, begin) BIND(C)
       USE ISO_C_BINDING
@@ -71,4 +92,46 @@
 
 
+    SUBROUTINE cxios_set_axisgroup_bounds_name(axisgroup_hdl, bounds_name, bounds_name_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: axisgroup_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: bounds_name
+      INTEGER  (kind = C_INT)     , VALUE        :: bounds_name_size
+    END SUBROUTINE cxios_set_axisgroup_bounds_name
+
+    SUBROUTINE cxios_get_axisgroup_bounds_name(axisgroup_hdl, bounds_name, bounds_name_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: axisgroup_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: bounds_name
+      INTEGER  (kind = C_INT)     , VALUE        :: bounds_name_size
+    END SUBROUTINE cxios_get_axisgroup_bounds_name
+
+    FUNCTION cxios_is_defined_axisgroup_bounds_name(axisgroup_hdl) BIND(C)
+      USE ISO_C_BINDING
+      LOGICAL(kind=C_BOOL) :: cxios_is_defined_axisgroup_bounds_name
+      INTEGER (kind = C_INTPTR_T), VALUE :: axisgroup_hdl
+    END FUNCTION cxios_is_defined_axisgroup_bounds_name
+
+
+    SUBROUTINE cxios_set_axisgroup_comment(axisgroup_hdl, comment, comment_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: axisgroup_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: comment
+      INTEGER  (kind = C_INT)     , VALUE        :: comment_size
+    END SUBROUTINE cxios_set_axisgroup_comment
+
+    SUBROUTINE cxios_get_axisgroup_comment(axisgroup_hdl, comment, comment_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: axisgroup_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: comment
+      INTEGER  (kind = C_INT)     , VALUE        :: comment_size
+    END SUBROUTINE cxios_get_axisgroup_comment
+
+    FUNCTION cxios_is_defined_axisgroup_comment(axisgroup_hdl) BIND(C)
+      USE ISO_C_BINDING
+      LOGICAL(kind=C_BOOL) :: cxios_is_defined_axisgroup_comment
+      INTEGER (kind = C_INTPTR_T), VALUE :: axisgroup_hdl
+    END FUNCTION cxios_is_defined_axisgroup_comment
+
+
     SUBROUTINE cxios_set_axisgroup_data_begin(axisgroup_hdl, data_begin) BIND(C)
       USE ISO_C_BINDING
@@ -128,4 +191,109 @@
       INTEGER (kind = C_INTPTR_T), VALUE :: axisgroup_hdl
     END FUNCTION cxios_is_defined_axisgroup_data_n
+
+
+    SUBROUTINE cxios_set_axisgroup_dim_name(axisgroup_hdl, dim_name, dim_name_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: axisgroup_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: dim_name
+      INTEGER  (kind = C_INT)     , VALUE        :: dim_name_size
+    END SUBROUTINE cxios_set_axisgroup_dim_name
+
+    SUBROUTINE cxios_get_axisgroup_dim_name(axisgroup_hdl, dim_name, dim_name_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: axisgroup_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: dim_name
+      INTEGER  (kind = C_INT)     , VALUE        :: dim_name_size
+    END SUBROUTINE cxios_get_axisgroup_dim_name
+
+    FUNCTION cxios_is_defined_axisgroup_dim_name(axisgroup_hdl) BIND(C)
+      USE ISO_C_BINDING
+      LOGICAL(kind=C_BOOL) :: cxios_is_defined_axisgroup_dim_name
+      INTEGER (kind = C_INTPTR_T), VALUE :: axisgroup_hdl
+    END FUNCTION cxios_is_defined_axisgroup_dim_name
+
+
+    SUBROUTINE cxios_set_axisgroup_formula(axisgroup_hdl, formula, formula_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: axisgroup_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: formula
+      INTEGER  (kind = C_INT)     , VALUE        :: formula_size
+    END SUBROUTINE cxios_set_axisgroup_formula
+
+    SUBROUTINE cxios_get_axisgroup_formula(axisgroup_hdl, formula, formula_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: axisgroup_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: formula
+      INTEGER  (kind = C_INT)     , VALUE        :: formula_size
+    END SUBROUTINE cxios_get_axisgroup_formula
+
+    FUNCTION cxios_is_defined_axisgroup_formula(axisgroup_hdl) BIND(C)
+      USE ISO_C_BINDING
+      LOGICAL(kind=C_BOOL) :: cxios_is_defined_axisgroup_formula
+      INTEGER (kind = C_INTPTR_T), VALUE :: axisgroup_hdl
+    END FUNCTION cxios_is_defined_axisgroup_formula
+
+
+    SUBROUTINE cxios_set_axisgroup_formula_bounds(axisgroup_hdl, formula_bounds, formula_bounds_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: axisgroup_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: formula_bounds
+      INTEGER  (kind = C_INT)     , VALUE        :: formula_bounds_size
+    END SUBROUTINE cxios_set_axisgroup_formula_bounds
+
+    SUBROUTINE cxios_get_axisgroup_formula_bounds(axisgroup_hdl, formula_bounds, formula_bounds_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: axisgroup_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: formula_bounds
+      INTEGER  (kind = C_INT)     , VALUE        :: formula_bounds_size
+    END SUBROUTINE cxios_get_axisgroup_formula_bounds
+
+    FUNCTION cxios_is_defined_axisgroup_formula_bounds(axisgroup_hdl) BIND(C)
+      USE ISO_C_BINDING
+      LOGICAL(kind=C_BOOL) :: cxios_is_defined_axisgroup_formula_bounds
+      INTEGER (kind = C_INTPTR_T), VALUE :: axisgroup_hdl
+    END FUNCTION cxios_is_defined_axisgroup_formula_bounds
+
+
+    SUBROUTINE cxios_set_axisgroup_formula_term(axisgroup_hdl, formula_term, formula_term_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: axisgroup_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: formula_term
+      INTEGER  (kind = C_INT)     , VALUE        :: formula_term_size
+    END SUBROUTINE cxios_set_axisgroup_formula_term
+
+    SUBROUTINE cxios_get_axisgroup_formula_term(axisgroup_hdl, formula_term, formula_term_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: axisgroup_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: formula_term
+      INTEGER  (kind = C_INT)     , VALUE        :: formula_term_size
+    END SUBROUTINE cxios_get_axisgroup_formula_term
+
+    FUNCTION cxios_is_defined_axisgroup_formula_term(axisgroup_hdl) BIND(C)
+      USE ISO_C_BINDING
+      LOGICAL(kind=C_BOOL) :: cxios_is_defined_axisgroup_formula_term
+      INTEGER (kind = C_INTPTR_T), VALUE :: axisgroup_hdl
+    END FUNCTION cxios_is_defined_axisgroup_formula_term
+
+
+    SUBROUTINE cxios_set_axisgroup_formula_term_bounds(axisgroup_hdl, formula_term_bounds, formula_term_bounds_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: axisgroup_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: formula_term_bounds
+      INTEGER  (kind = C_INT)     , VALUE        :: formula_term_bounds_size
+    END SUBROUTINE cxios_set_axisgroup_formula_term_bounds
+
+    SUBROUTINE cxios_get_axisgroup_formula_term_bounds(axisgroup_hdl, formula_term_bounds, formula_term_bounds_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: axisgroup_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: formula_term_bounds
+      INTEGER  (kind = C_INT)     , VALUE        :: formula_term_bounds_size
+    END SUBROUTINE cxios_get_axisgroup_formula_term_bounds
+
+    FUNCTION cxios_is_defined_axisgroup_formula_term_bounds(axisgroup_hdl) BIND(C)
+      USE ISO_C_BINDING
+      LOGICAL(kind=C_BOOL) :: cxios_is_defined_axisgroup_formula_term_bounds
+      INTEGER (kind = C_INTPTR_T), VALUE :: axisgroup_hdl
+    END FUNCTION cxios_is_defined_axisgroup_formula_term_bounds
 
 
Index: /XIOS/trunk/src/interface/fortran_attr/calendar_wrapper_interface_attr.F90
===================================================================
--- /XIOS/trunk/src/interface/fortran_attr/calendar_wrapper_interface_attr.F90	(revision 1536)
+++ /XIOS/trunk/src/interface/fortran_attr/calendar_wrapper_interface_attr.F90	(revision 1537)
@@ -10,4 +10,25 @@
     ! Do not call directly / interface FORTRAN 2003 <-> C99
 
+    SUBROUTINE cxios_set_calendar_wrapper_comment(calendar_wrapper_hdl, comment, comment_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: calendar_wrapper_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: comment
+      INTEGER  (kind = C_INT)     , VALUE        :: comment_size
+    END SUBROUTINE cxios_set_calendar_wrapper_comment
+
+    SUBROUTINE cxios_get_calendar_wrapper_comment(calendar_wrapper_hdl, comment, comment_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: calendar_wrapper_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: comment
+      INTEGER  (kind = C_INT)     , VALUE        :: comment_size
+    END SUBROUTINE cxios_get_calendar_wrapper_comment
+
+    FUNCTION cxios_is_defined_calendar_wrapper_comment(calendar_wrapper_hdl) BIND(C)
+      USE ISO_C_BINDING
+      LOGICAL(kind=C_BOOL) :: cxios_is_defined_calendar_wrapper_comment
+      INTEGER (kind = C_INTPTR_T), VALUE :: calendar_wrapper_hdl
+    END FUNCTION cxios_is_defined_calendar_wrapper_comment
+
+
     SUBROUTINE cxios_set_calendar_wrapper_day_length(calendar_wrapper_hdl, day_length) BIND(C)
       USE ISO_C_BINDING
Index: /XIOS/trunk/src/interface/fortran_attr/domain_interface_attr.F90
===================================================================
--- /XIOS/trunk/src/interface/fortran_attr/domain_interface_attr.F90	(revision 1536)
+++ /XIOS/trunk/src/interface/fortran_attr/domain_interface_attr.F90	(revision 1537)
@@ -73,4 +73,25 @@
 
 
+    SUBROUTINE cxios_set_domain_bounds_lat_name(domain_hdl, bounds_lat_name, bounds_lat_name_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: domain_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: bounds_lat_name
+      INTEGER  (kind = C_INT)     , VALUE        :: bounds_lat_name_size
+    END SUBROUTINE cxios_set_domain_bounds_lat_name
+
+    SUBROUTINE cxios_get_domain_bounds_lat_name(domain_hdl, bounds_lat_name, bounds_lat_name_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: domain_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: bounds_lat_name
+      INTEGER  (kind = C_INT)     , VALUE        :: bounds_lat_name_size
+    END SUBROUTINE cxios_get_domain_bounds_lat_name
+
+    FUNCTION cxios_is_defined_domain_bounds_lat_name(domain_hdl) BIND(C)
+      USE ISO_C_BINDING
+      LOGICAL(kind=C_BOOL) :: cxios_is_defined_domain_bounds_lat_name
+      INTEGER (kind = C_INTPTR_T), VALUE :: domain_hdl
+    END FUNCTION cxios_is_defined_domain_bounds_lat_name
+
+
     SUBROUTINE cxios_set_domain_bounds_lon_1d(domain_hdl, bounds_lon_1d, extent) BIND(C)
       USE ISO_C_BINDING
@@ -113,4 +134,46 @@
       INTEGER (kind = C_INTPTR_T), VALUE :: domain_hdl
     END FUNCTION cxios_is_defined_domain_bounds_lon_2d
+
+
+    SUBROUTINE cxios_set_domain_bounds_lon_name(domain_hdl, bounds_lon_name, bounds_lon_name_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: domain_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: bounds_lon_name
+      INTEGER  (kind = C_INT)     , VALUE        :: bounds_lon_name_size
+    END SUBROUTINE cxios_set_domain_bounds_lon_name
+
+    SUBROUTINE cxios_get_domain_bounds_lon_name(domain_hdl, bounds_lon_name, bounds_lon_name_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: domain_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: bounds_lon_name
+      INTEGER  (kind = C_INT)     , VALUE        :: bounds_lon_name_size
+    END SUBROUTINE cxios_get_domain_bounds_lon_name
+
+    FUNCTION cxios_is_defined_domain_bounds_lon_name(domain_hdl) BIND(C)
+      USE ISO_C_BINDING
+      LOGICAL(kind=C_BOOL) :: cxios_is_defined_domain_bounds_lon_name
+      INTEGER (kind = C_INTPTR_T), VALUE :: domain_hdl
+    END FUNCTION cxios_is_defined_domain_bounds_lon_name
+
+
+    SUBROUTINE cxios_set_domain_comment(domain_hdl, comment, comment_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: domain_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: comment
+      INTEGER  (kind = C_INT)     , VALUE        :: comment_size
+    END SUBROUTINE cxios_set_domain_comment
+
+    SUBROUTINE cxios_get_domain_comment(domain_hdl, comment, comment_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: domain_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: comment
+      INTEGER  (kind = C_INT)     , VALUE        :: comment_size
+    END SUBROUTINE cxios_get_domain_comment
+
+    FUNCTION cxios_is_defined_domain_comment(domain_hdl) BIND(C)
+      USE ISO_C_BINDING
+      LOGICAL(kind=C_BOOL) :: cxios_is_defined_domain_comment
+      INTEGER (kind = C_INTPTR_T), VALUE :: domain_hdl
+    END FUNCTION cxios_is_defined_domain_comment
 
 
@@ -250,4 +313,46 @@
       INTEGER (kind = C_INTPTR_T), VALUE :: domain_hdl
     END FUNCTION cxios_is_defined_domain_data_nj
+
+
+    SUBROUTINE cxios_set_domain_dim_i_name(domain_hdl, dim_i_name, dim_i_name_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: domain_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: dim_i_name
+      INTEGER  (kind = C_INT)     , VALUE        :: dim_i_name_size
+    END SUBROUTINE cxios_set_domain_dim_i_name
+
+    SUBROUTINE cxios_get_domain_dim_i_name(domain_hdl, dim_i_name, dim_i_name_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: domain_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: dim_i_name
+      INTEGER  (kind = C_INT)     , VALUE        :: dim_i_name_size
+    END SUBROUTINE cxios_get_domain_dim_i_name
+
+    FUNCTION cxios_is_defined_domain_dim_i_name(domain_hdl) BIND(C)
+      USE ISO_C_BINDING
+      LOGICAL(kind=C_BOOL) :: cxios_is_defined_domain_dim_i_name
+      INTEGER (kind = C_INTPTR_T), VALUE :: domain_hdl
+    END FUNCTION cxios_is_defined_domain_dim_i_name
+
+
+    SUBROUTINE cxios_set_domain_dim_j_name(domain_hdl, dim_j_name, dim_j_name_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: domain_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: dim_j_name
+      INTEGER  (kind = C_INT)     , VALUE        :: dim_j_name_size
+    END SUBROUTINE cxios_set_domain_dim_j_name
+
+    SUBROUTINE cxios_get_domain_dim_j_name(domain_hdl, dim_j_name, dim_j_name_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: domain_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: dim_j_name
+      INTEGER  (kind = C_INT)     , VALUE        :: dim_j_name_size
+    END SUBROUTINE cxios_get_domain_dim_j_name
+
+    FUNCTION cxios_is_defined_domain_dim_j_name(domain_hdl) BIND(C)
+      USE ISO_C_BINDING
+      LOGICAL(kind=C_BOOL) :: cxios_is_defined_domain_dim_j_name
+      INTEGER (kind = C_INTPTR_T), VALUE :: domain_hdl
+    END FUNCTION cxios_is_defined_domain_dim_j_name
 
 
@@ -353,4 +458,25 @@
 
 
+    SUBROUTINE cxios_set_domain_lat_name(domain_hdl, lat_name, lat_name_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: domain_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: lat_name
+      INTEGER  (kind = C_INT)     , VALUE        :: lat_name_size
+    END SUBROUTINE cxios_set_domain_lat_name
+
+    SUBROUTINE cxios_get_domain_lat_name(domain_hdl, lat_name, lat_name_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: domain_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: lat_name
+      INTEGER  (kind = C_INT)     , VALUE        :: lat_name_size
+    END SUBROUTINE cxios_get_domain_lat_name
+
+    FUNCTION cxios_is_defined_domain_lat_name(domain_hdl) BIND(C)
+      USE ISO_C_BINDING
+      LOGICAL(kind=C_BOOL) :: cxios_is_defined_domain_lat_name
+      INTEGER (kind = C_INTPTR_T), VALUE :: domain_hdl
+    END FUNCTION cxios_is_defined_domain_lat_name
+
+
     SUBROUTINE cxios_set_domain_latvalue_1d(domain_hdl, latvalue_1d, extent) BIND(C)
       USE ISO_C_BINDING
@@ -393,4 +519,25 @@
       INTEGER (kind = C_INTPTR_T), VALUE :: domain_hdl
     END FUNCTION cxios_is_defined_domain_latvalue_2d
+
+
+    SUBROUTINE cxios_set_domain_lon_name(domain_hdl, lon_name, lon_name_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: domain_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: lon_name
+      INTEGER  (kind = C_INT)     , VALUE        :: lon_name_size
+    END SUBROUTINE cxios_set_domain_lon_name
+
+    SUBROUTINE cxios_get_domain_lon_name(domain_hdl, lon_name, lon_name_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: domain_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: lon_name
+      INTEGER  (kind = C_INT)     , VALUE        :: lon_name_size
+    END SUBROUTINE cxios_get_domain_lon_name
+
+    FUNCTION cxios_is_defined_domain_lon_name(domain_hdl) BIND(C)
+      USE ISO_C_BINDING
+      LOGICAL(kind=C_BOOL) :: cxios_is_defined_domain_lon_name
+      INTEGER (kind = C_INTPTR_T), VALUE :: domain_hdl
+    END FUNCTION cxios_is_defined_domain_lon_name
 
 
Index: /XIOS/trunk/src/interface/fortran_attr/domaingroup_interface_attr.F90
===================================================================
--- /XIOS/trunk/src/interface/fortran_attr/domaingroup_interface_attr.F90	(revision 1536)
+++ /XIOS/trunk/src/interface/fortran_attr/domaingroup_interface_attr.F90	(revision 1537)
@@ -73,4 +73,25 @@
 
 
+    SUBROUTINE cxios_set_domaingroup_bounds_lat_name(domaingroup_hdl, bounds_lat_name, bounds_lat_name_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: domaingroup_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: bounds_lat_name
+      INTEGER  (kind = C_INT)     , VALUE        :: bounds_lat_name_size
+    END SUBROUTINE cxios_set_domaingroup_bounds_lat_name
+
+    SUBROUTINE cxios_get_domaingroup_bounds_lat_name(domaingroup_hdl, bounds_lat_name, bounds_lat_name_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: domaingroup_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: bounds_lat_name
+      INTEGER  (kind = C_INT)     , VALUE        :: bounds_lat_name_size
+    END SUBROUTINE cxios_get_domaingroup_bounds_lat_name
+
+    FUNCTION cxios_is_defined_domaingroup_bounds_lat_name(domaingroup_hdl) BIND(C)
+      USE ISO_C_BINDING
+      LOGICAL(kind=C_BOOL) :: cxios_is_defined_domaingroup_bounds_lat_name
+      INTEGER (kind = C_INTPTR_T), VALUE :: domaingroup_hdl
+    END FUNCTION cxios_is_defined_domaingroup_bounds_lat_name
+
+
     SUBROUTINE cxios_set_domaingroup_bounds_lon_1d(domaingroup_hdl, bounds_lon_1d, extent) BIND(C)
       USE ISO_C_BINDING
@@ -113,4 +134,46 @@
       INTEGER (kind = C_INTPTR_T), VALUE :: domaingroup_hdl
     END FUNCTION cxios_is_defined_domaingroup_bounds_lon_2d
+
+
+    SUBROUTINE cxios_set_domaingroup_bounds_lon_name(domaingroup_hdl, bounds_lon_name, bounds_lon_name_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: domaingroup_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: bounds_lon_name
+      INTEGER  (kind = C_INT)     , VALUE        :: bounds_lon_name_size
+    END SUBROUTINE cxios_set_domaingroup_bounds_lon_name
+
+    SUBROUTINE cxios_get_domaingroup_bounds_lon_name(domaingroup_hdl, bounds_lon_name, bounds_lon_name_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: domaingroup_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: bounds_lon_name
+      INTEGER  (kind = C_INT)     , VALUE        :: bounds_lon_name_size
+    END SUBROUTINE cxios_get_domaingroup_bounds_lon_name
+
+    FUNCTION cxios_is_defined_domaingroup_bounds_lon_name(domaingroup_hdl) BIND(C)
+      USE ISO_C_BINDING
+      LOGICAL(kind=C_BOOL) :: cxios_is_defined_domaingroup_bounds_lon_name
+      INTEGER (kind = C_INTPTR_T), VALUE :: domaingroup_hdl
+    END FUNCTION cxios_is_defined_domaingroup_bounds_lon_name
+
+
+    SUBROUTINE cxios_set_domaingroup_comment(domaingroup_hdl, comment, comment_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: domaingroup_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: comment
+      INTEGER  (kind = C_INT)     , VALUE        :: comment_size
+    END SUBROUTINE cxios_set_domaingroup_comment
+
+    SUBROUTINE cxios_get_domaingroup_comment(domaingroup_hdl, comment, comment_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: domaingroup_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: comment
+      INTEGER  (kind = C_INT)     , VALUE        :: comment_size
+    END SUBROUTINE cxios_get_domaingroup_comment
+
+    FUNCTION cxios_is_defined_domaingroup_comment(domaingroup_hdl) BIND(C)
+      USE ISO_C_BINDING
+      LOGICAL(kind=C_BOOL) :: cxios_is_defined_domaingroup_comment
+      INTEGER (kind = C_INTPTR_T), VALUE :: domaingroup_hdl
+    END FUNCTION cxios_is_defined_domaingroup_comment
 
 
@@ -250,4 +313,46 @@
       INTEGER (kind = C_INTPTR_T), VALUE :: domaingroup_hdl
     END FUNCTION cxios_is_defined_domaingroup_data_nj
+
+
+    SUBROUTINE cxios_set_domaingroup_dim_i_name(domaingroup_hdl, dim_i_name, dim_i_name_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: domaingroup_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: dim_i_name
+      INTEGER  (kind = C_INT)     , VALUE        :: dim_i_name_size
+    END SUBROUTINE cxios_set_domaingroup_dim_i_name
+
+    SUBROUTINE cxios_get_domaingroup_dim_i_name(domaingroup_hdl, dim_i_name, dim_i_name_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: domaingroup_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: dim_i_name
+      INTEGER  (kind = C_INT)     , VALUE        :: dim_i_name_size
+    END SUBROUTINE cxios_get_domaingroup_dim_i_name
+
+    FUNCTION cxios_is_defined_domaingroup_dim_i_name(domaingroup_hdl) BIND(C)
+      USE ISO_C_BINDING
+      LOGICAL(kind=C_BOOL) :: cxios_is_defined_domaingroup_dim_i_name
+      INTEGER (kind = C_INTPTR_T), VALUE :: domaingroup_hdl
+    END FUNCTION cxios_is_defined_domaingroup_dim_i_name
+
+
+    SUBROUTINE cxios_set_domaingroup_dim_j_name(domaingroup_hdl, dim_j_name, dim_j_name_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: domaingroup_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: dim_j_name
+      INTEGER  (kind = C_INT)     , VALUE        :: dim_j_name_size
+    END SUBROUTINE cxios_set_domaingroup_dim_j_name
+
+    SUBROUTINE cxios_get_domaingroup_dim_j_name(domaingroup_hdl, dim_j_name, dim_j_name_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: domaingroup_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: dim_j_name
+      INTEGER  (kind = C_INT)     , VALUE        :: dim_j_name_size
+    END SUBROUTINE cxios_get_domaingroup_dim_j_name
+
+    FUNCTION cxios_is_defined_domaingroup_dim_j_name(domaingroup_hdl) BIND(C)
+      USE ISO_C_BINDING
+      LOGICAL(kind=C_BOOL) :: cxios_is_defined_domaingroup_dim_j_name
+      INTEGER (kind = C_INTPTR_T), VALUE :: domaingroup_hdl
+    END FUNCTION cxios_is_defined_domaingroup_dim_j_name
 
 
@@ -374,4 +479,25 @@
 
 
+    SUBROUTINE cxios_set_domaingroup_lat_name(domaingroup_hdl, lat_name, lat_name_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: domaingroup_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: lat_name
+      INTEGER  (kind = C_INT)     , VALUE        :: lat_name_size
+    END SUBROUTINE cxios_set_domaingroup_lat_name
+
+    SUBROUTINE cxios_get_domaingroup_lat_name(domaingroup_hdl, lat_name, lat_name_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: domaingroup_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: lat_name
+      INTEGER  (kind = C_INT)     , VALUE        :: lat_name_size
+    END SUBROUTINE cxios_get_domaingroup_lat_name
+
+    FUNCTION cxios_is_defined_domaingroup_lat_name(domaingroup_hdl) BIND(C)
+      USE ISO_C_BINDING
+      LOGICAL(kind=C_BOOL) :: cxios_is_defined_domaingroup_lat_name
+      INTEGER (kind = C_INTPTR_T), VALUE :: domaingroup_hdl
+    END FUNCTION cxios_is_defined_domaingroup_lat_name
+
+
     SUBROUTINE cxios_set_domaingroup_latvalue_1d(domaingroup_hdl, latvalue_1d, extent) BIND(C)
       USE ISO_C_BINDING
@@ -414,4 +540,25 @@
       INTEGER (kind = C_INTPTR_T), VALUE :: domaingroup_hdl
     END FUNCTION cxios_is_defined_domaingroup_latvalue_2d
+
+
+    SUBROUTINE cxios_set_domaingroup_lon_name(domaingroup_hdl, lon_name, lon_name_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: domaingroup_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: lon_name
+      INTEGER  (kind = C_INT)     , VALUE        :: lon_name_size
+    END SUBROUTINE cxios_set_domaingroup_lon_name
+
+    SUBROUTINE cxios_get_domaingroup_lon_name(domaingroup_hdl, lon_name, lon_name_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: domaingroup_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: lon_name
+      INTEGER  (kind = C_INT)     , VALUE        :: lon_name_size
+    END SUBROUTINE cxios_get_domaingroup_lon_name
+
+    FUNCTION cxios_is_defined_domaingroup_lon_name(domaingroup_hdl) BIND(C)
+      USE ISO_C_BINDING
+      LOGICAL(kind=C_BOOL) :: cxios_is_defined_domaingroup_lon_name
+      INTEGER (kind = C_INTPTR_T), VALUE :: domaingroup_hdl
+    END FUNCTION cxios_is_defined_domaingroup_lon_name
 
 
Index: /XIOS/trunk/src/interface/fortran_attr/duplicate_scalar_to_axis_interface_attr.F90
===================================================================
--- /XIOS/trunk/src/interface/fortran_attr/duplicate_scalar_to_axis_interface_attr.F90	(revision 1537)
+++ /XIOS/trunk/src/interface/fortran_attr/duplicate_scalar_to_axis_interface_attr.F90	(revision 1537)
@@ -0,0 +1,13 @@
+! * ************************************************************************** *
+! *               Interface auto generated - do not modify                     *
+! * ************************************************************************** *
+#include "../fortran/xios_fortran_prefix.hpp"
+
+MODULE duplicate_scalar_to_axis_interface_attr
+  USE, INTRINSIC :: ISO_C_BINDING
+
+  INTERFACE
+    ! Do not call directly / interface FORTRAN 2003 <-> C99
+  END INTERFACE
+
+END MODULE duplicate_scalar_to_axis_interface_attr
Index: /XIOS/trunk/src/interface/fortran_attr/field_interface_attr.F90
===================================================================
--- /XIOS/trunk/src/interface/fortran_attr/field_interface_attr.F90	(revision 1536)
+++ /XIOS/trunk/src/interface/fortran_attr/field_interface_attr.F90	(revision 1537)
@@ -111,4 +111,25 @@
 
 
+    SUBROUTINE cxios_set_field_comment(field_hdl, comment, comment_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: field_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: comment
+      INTEGER  (kind = C_INT)     , VALUE        :: comment_size
+    END SUBROUTINE cxios_set_field_comment
+
+    SUBROUTINE cxios_get_field_comment(field_hdl, comment, comment_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: field_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: comment
+      INTEGER  (kind = C_INT)     , VALUE        :: comment_size
+    END SUBROUTINE cxios_get_field_comment
+
+    FUNCTION cxios_is_defined_field_comment(field_hdl) BIND(C)
+      USE ISO_C_BINDING
+      LOGICAL(kind=C_BOOL) :: cxios_is_defined_field_comment
+      INTEGER (kind = C_INTPTR_T), VALUE :: field_hdl
+    END FUNCTION cxios_is_defined_field_comment
+
+
     SUBROUTINE cxios_set_field_compression_level(field_hdl, compression_level) BIND(C)
       USE ISO_C_BINDING
Index: /XIOS/trunk/src/interface/fortran_attr/fieldgroup_interface_attr.F90
===================================================================
--- /XIOS/trunk/src/interface/fortran_attr/fieldgroup_interface_attr.F90	(revision 1536)
+++ /XIOS/trunk/src/interface/fortran_attr/fieldgroup_interface_attr.F90	(revision 1537)
@@ -111,4 +111,25 @@
 
 
+    SUBROUTINE cxios_set_fieldgroup_comment(fieldgroup_hdl, comment, comment_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: fieldgroup_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: comment
+      INTEGER  (kind = C_INT)     , VALUE        :: comment_size
+    END SUBROUTINE cxios_set_fieldgroup_comment
+
+    SUBROUTINE cxios_get_fieldgroup_comment(fieldgroup_hdl, comment, comment_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: fieldgroup_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: comment
+      INTEGER  (kind = C_INT)     , VALUE        :: comment_size
+    END SUBROUTINE cxios_get_fieldgroup_comment
+
+    FUNCTION cxios_is_defined_fieldgroup_comment(fieldgroup_hdl) BIND(C)
+      USE ISO_C_BINDING
+      LOGICAL(kind=C_BOOL) :: cxios_is_defined_fieldgroup_comment
+      INTEGER (kind = C_INTPTR_T), VALUE :: fieldgroup_hdl
+    END FUNCTION cxios_is_defined_fieldgroup_comment
+
+
     SUBROUTINE cxios_set_fieldgroup_compression_level(fieldgroup_hdl, compression_level) BIND(C)
       USE ISO_C_BINDING
Index: /XIOS/trunk/src/interface/fortran_attr/file_interface_attr.F90
===================================================================
--- /XIOS/trunk/src/interface/fortran_attr/file_interface_attr.F90	(revision 1536)
+++ /XIOS/trunk/src/interface/fortran_attr/file_interface_attr.F90	(revision 1537)
@@ -29,4 +29,25 @@
 
 
+    SUBROUTINE cxios_set_file_comment(file_hdl, comment, comment_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: file_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: comment
+      INTEGER  (kind = C_INT)     , VALUE        :: comment_size
+    END SUBROUTINE cxios_set_file_comment
+
+    SUBROUTINE cxios_get_file_comment(file_hdl, comment, comment_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: file_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: comment
+      INTEGER  (kind = C_INT)     , VALUE        :: comment_size
+    END SUBROUTINE cxios_get_file_comment
+
+    FUNCTION cxios_is_defined_file_comment(file_hdl) BIND(C)
+      USE ISO_C_BINDING
+      LOGICAL(kind=C_BOOL) :: cxios_is_defined_file_comment
+      INTEGER (kind = C_INTPTR_T), VALUE :: file_hdl
+    END FUNCTION cxios_is_defined_file_comment
+
+
     SUBROUTINE cxios_set_file_compression_level(file_hdl, compression_level) BIND(C)
       USE ISO_C_BINDING
@@ -313,4 +334,23 @@
 
 
+    SUBROUTINE cxios_set_file_read_metadata_par(file_hdl, read_metadata_par) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: file_hdl
+      LOGICAL (KIND=C_BOOL)      , VALUE :: read_metadata_par
+    END SUBROUTINE cxios_set_file_read_metadata_par
+
+    SUBROUTINE cxios_get_file_read_metadata_par(file_hdl, read_metadata_par) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: file_hdl
+      LOGICAL (KIND=C_BOOL)             :: read_metadata_par
+    END SUBROUTINE cxios_get_file_read_metadata_par
+
+    FUNCTION cxios_is_defined_file_read_metadata_par(file_hdl) BIND(C)
+      USE ISO_C_BINDING
+      LOGICAL(kind=C_BOOL) :: cxios_is_defined_file_read_metadata_par
+      INTEGER (kind = C_INTPTR_T), VALUE :: file_hdl
+    END FUNCTION cxios_is_defined_file_read_metadata_par
+
+
     SUBROUTINE cxios_set_file_record_offset(file_hdl, record_offset) BIND(C)
       USE ISO_C_BINDING
@@ -330,4 +370,25 @@
       INTEGER (kind = C_INTPTR_T), VALUE :: file_hdl
     END FUNCTION cxios_is_defined_file_record_offset
+
+
+    SUBROUTINE cxios_set_file_split_end_offset(file_hdl, split_end_offset) BIND(C)
+      USE ISO_C_BINDING
+      USE IDURATION
+      INTEGER (kind = C_INTPTR_T), VALUE :: file_hdl
+      TYPE(txios(duration)), VALUE :: split_end_offset
+    END SUBROUTINE cxios_set_file_split_end_offset
+
+    SUBROUTINE cxios_get_file_split_end_offset(file_hdl, split_end_offset) BIND(C)
+      USE ISO_C_BINDING
+      USE IDURATION
+      INTEGER (kind = C_INTPTR_T), VALUE :: file_hdl
+      TYPE(txios(duration)) :: split_end_offset
+    END SUBROUTINE cxios_get_file_split_end_offset
+
+    FUNCTION cxios_is_defined_file_split_end_offset(file_hdl) BIND(C)
+      USE ISO_C_BINDING
+      LOGICAL(kind=C_BOOL) :: cxios_is_defined_file_split_end_offset
+      INTEGER (kind = C_INTPTR_T), VALUE :: file_hdl
+    END FUNCTION cxios_is_defined_file_split_end_offset
 
 
@@ -374,4 +435,46 @@
 
 
+    SUBROUTINE cxios_set_file_split_last_date(file_hdl, split_last_date, split_last_date_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: file_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: split_last_date
+      INTEGER  (kind = C_INT)     , VALUE        :: split_last_date_size
+    END SUBROUTINE cxios_set_file_split_last_date
+
+    SUBROUTINE cxios_get_file_split_last_date(file_hdl, split_last_date, split_last_date_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: file_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: split_last_date
+      INTEGER  (kind = C_INT)     , VALUE        :: split_last_date_size
+    END SUBROUTINE cxios_get_file_split_last_date
+
+    FUNCTION cxios_is_defined_file_split_last_date(file_hdl) BIND(C)
+      USE ISO_C_BINDING
+      LOGICAL(kind=C_BOOL) :: cxios_is_defined_file_split_last_date
+      INTEGER (kind = C_INTPTR_T), VALUE :: file_hdl
+    END FUNCTION cxios_is_defined_file_split_last_date
+
+
+    SUBROUTINE cxios_set_file_split_start_offset(file_hdl, split_start_offset) BIND(C)
+      USE ISO_C_BINDING
+      USE IDURATION
+      INTEGER (kind = C_INTPTR_T), VALUE :: file_hdl
+      TYPE(txios(duration)), VALUE :: split_start_offset
+    END SUBROUTINE cxios_set_file_split_start_offset
+
+    SUBROUTINE cxios_get_file_split_start_offset(file_hdl, split_start_offset) BIND(C)
+      USE ISO_C_BINDING
+      USE IDURATION
+      INTEGER (kind = C_INTPTR_T), VALUE :: file_hdl
+      TYPE(txios(duration)) :: split_start_offset
+    END SUBROUTINE cxios_get_file_split_start_offset
+
+    FUNCTION cxios_is_defined_file_split_start_offset(file_hdl) BIND(C)
+      USE ISO_C_BINDING
+      LOGICAL(kind=C_BOOL) :: cxios_is_defined_file_split_start_offset
+      INTEGER (kind = C_INTPTR_T), VALUE :: file_hdl
+    END FUNCTION cxios_is_defined_file_split_start_offset
+
+
     SUBROUTINE cxios_set_file_sync_freq(file_hdl, sync_freq) BIND(C)
       USE ISO_C_BINDING
Index: /XIOS/trunk/src/interface/fortran_attr/filegroup_interface_attr.F90
===================================================================
--- /XIOS/trunk/src/interface/fortran_attr/filegroup_interface_attr.F90	(revision 1536)
+++ /XIOS/trunk/src/interface/fortran_attr/filegroup_interface_attr.F90	(revision 1537)
@@ -29,4 +29,25 @@
 
 
+    SUBROUTINE cxios_set_filegroup_comment(filegroup_hdl, comment, comment_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: filegroup_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: comment
+      INTEGER  (kind = C_INT)     , VALUE        :: comment_size
+    END SUBROUTINE cxios_set_filegroup_comment
+
+    SUBROUTINE cxios_get_filegroup_comment(filegroup_hdl, comment, comment_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: filegroup_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: comment
+      INTEGER  (kind = C_INT)     , VALUE        :: comment_size
+    END SUBROUTINE cxios_get_filegroup_comment
+
+    FUNCTION cxios_is_defined_filegroup_comment(filegroup_hdl) BIND(C)
+      USE ISO_C_BINDING
+      LOGICAL(kind=C_BOOL) :: cxios_is_defined_filegroup_comment
+      INTEGER (kind = C_INTPTR_T), VALUE :: filegroup_hdl
+    END FUNCTION cxios_is_defined_filegroup_comment
+
+
     SUBROUTINE cxios_set_filegroup_compression_level(filegroup_hdl, compression_level) BIND(C)
       USE ISO_C_BINDING
@@ -334,4 +355,23 @@
 
 
+    SUBROUTINE cxios_set_filegroup_read_metadata_par(filegroup_hdl, read_metadata_par) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: filegroup_hdl
+      LOGICAL (KIND=C_BOOL)      , VALUE :: read_metadata_par
+    END SUBROUTINE cxios_set_filegroup_read_metadata_par
+
+    SUBROUTINE cxios_get_filegroup_read_metadata_par(filegroup_hdl, read_metadata_par) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: filegroup_hdl
+      LOGICAL (KIND=C_BOOL)             :: read_metadata_par
+    END SUBROUTINE cxios_get_filegroup_read_metadata_par
+
+    FUNCTION cxios_is_defined_filegroup_read_metadata_par(filegroup_hdl) BIND(C)
+      USE ISO_C_BINDING
+      LOGICAL(kind=C_BOOL) :: cxios_is_defined_filegroup_read_metadata_par
+      INTEGER (kind = C_INTPTR_T), VALUE :: filegroup_hdl
+    END FUNCTION cxios_is_defined_filegroup_read_metadata_par
+
+
     SUBROUTINE cxios_set_filegroup_record_offset(filegroup_hdl, record_offset) BIND(C)
       USE ISO_C_BINDING
@@ -351,4 +391,25 @@
       INTEGER (kind = C_INTPTR_T), VALUE :: filegroup_hdl
     END FUNCTION cxios_is_defined_filegroup_record_offset
+
+
+    SUBROUTINE cxios_set_filegroup_split_end_offset(filegroup_hdl, split_end_offset) BIND(C)
+      USE ISO_C_BINDING
+      USE IDURATION
+      INTEGER (kind = C_INTPTR_T), VALUE :: filegroup_hdl
+      TYPE(txios(duration)), VALUE :: split_end_offset
+    END SUBROUTINE cxios_set_filegroup_split_end_offset
+
+    SUBROUTINE cxios_get_filegroup_split_end_offset(filegroup_hdl, split_end_offset) BIND(C)
+      USE ISO_C_BINDING
+      USE IDURATION
+      INTEGER (kind = C_INTPTR_T), VALUE :: filegroup_hdl
+      TYPE(txios(duration)) :: split_end_offset
+    END SUBROUTINE cxios_get_filegroup_split_end_offset
+
+    FUNCTION cxios_is_defined_filegroup_split_end_offset(filegroup_hdl) BIND(C)
+      USE ISO_C_BINDING
+      LOGICAL(kind=C_BOOL) :: cxios_is_defined_filegroup_split_end_offset
+      INTEGER (kind = C_INTPTR_T), VALUE :: filegroup_hdl
+    END FUNCTION cxios_is_defined_filegroup_split_end_offset
 
 
@@ -395,4 +456,46 @@
 
 
+    SUBROUTINE cxios_set_filegroup_split_last_date(filegroup_hdl, split_last_date, split_last_date_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: filegroup_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: split_last_date
+      INTEGER  (kind = C_INT)     , VALUE        :: split_last_date_size
+    END SUBROUTINE cxios_set_filegroup_split_last_date
+
+    SUBROUTINE cxios_get_filegroup_split_last_date(filegroup_hdl, split_last_date, split_last_date_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: filegroup_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: split_last_date
+      INTEGER  (kind = C_INT)     , VALUE        :: split_last_date_size
+    END SUBROUTINE cxios_get_filegroup_split_last_date
+
+    FUNCTION cxios_is_defined_filegroup_split_last_date(filegroup_hdl) BIND(C)
+      USE ISO_C_BINDING
+      LOGICAL(kind=C_BOOL) :: cxios_is_defined_filegroup_split_last_date
+      INTEGER (kind = C_INTPTR_T), VALUE :: filegroup_hdl
+    END FUNCTION cxios_is_defined_filegroup_split_last_date
+
+
+    SUBROUTINE cxios_set_filegroup_split_start_offset(filegroup_hdl, split_start_offset) BIND(C)
+      USE ISO_C_BINDING
+      USE IDURATION
+      INTEGER (kind = C_INTPTR_T), VALUE :: filegroup_hdl
+      TYPE(txios(duration)), VALUE :: split_start_offset
+    END SUBROUTINE cxios_set_filegroup_split_start_offset
+
+    SUBROUTINE cxios_get_filegroup_split_start_offset(filegroup_hdl, split_start_offset) BIND(C)
+      USE ISO_C_BINDING
+      USE IDURATION
+      INTEGER (kind = C_INTPTR_T), VALUE :: filegroup_hdl
+      TYPE(txios(duration)) :: split_start_offset
+    END SUBROUTINE cxios_get_filegroup_split_start_offset
+
+    FUNCTION cxios_is_defined_filegroup_split_start_offset(filegroup_hdl) BIND(C)
+      USE ISO_C_BINDING
+      LOGICAL(kind=C_BOOL) :: cxios_is_defined_filegroup_split_start_offset
+      INTEGER (kind = C_INTPTR_T), VALUE :: filegroup_hdl
+    END FUNCTION cxios_is_defined_filegroup_split_start_offset
+
+
     SUBROUTINE cxios_set_filegroup_sync_freq(filegroup_hdl, sync_freq) BIND(C)
       USE ISO_C_BINDING
Index: /XIOS/trunk/src/interface/fortran_attr/grid_interface_attr.F90
===================================================================
--- /XIOS/trunk/src/interface/fortran_attr/grid_interface_attr.F90	(revision 1536)
+++ /XIOS/trunk/src/interface/fortran_attr/grid_interface_attr.F90	(revision 1537)
@@ -10,4 +10,25 @@
     ! Do not call directly / interface FORTRAN 2003 <-> C99
 
+    SUBROUTINE cxios_set_grid_comment(grid_hdl, comment, comment_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: grid_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: comment
+      INTEGER  (kind = C_INT)     , VALUE        :: comment_size
+    END SUBROUTINE cxios_set_grid_comment
+
+    SUBROUTINE cxios_get_grid_comment(grid_hdl, comment, comment_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: grid_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: comment
+      INTEGER  (kind = C_INT)     , VALUE        :: comment_size
+    END SUBROUTINE cxios_get_grid_comment
+
+    FUNCTION cxios_is_defined_grid_comment(grid_hdl) BIND(C)
+      USE ISO_C_BINDING
+      LOGICAL(kind=C_BOOL) :: cxios_is_defined_grid_comment
+      INTEGER (kind = C_INTPTR_T), VALUE :: grid_hdl
+    END FUNCTION cxios_is_defined_grid_comment
+
+
     SUBROUTINE cxios_set_grid_description(grid_hdl, description, description_size) BIND(C)
       USE ISO_C_BINDING
@@ -31,4 +52,25 @@
 
 
+    SUBROUTINE cxios_set_grid_mask_0d(grid_hdl, mask_0d, extent) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE       :: grid_hdl
+      LOGICAL (KIND=C_BOOL)     , DIMENSION(*) :: mask_0d
+      INTEGER (kind = C_INT), DIMENSION(*)     :: extent
+    END SUBROUTINE cxios_set_grid_mask_0d
+
+    SUBROUTINE cxios_get_grid_mask_0d(grid_hdl, mask_0d, extent) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE       :: grid_hdl
+      LOGICAL (KIND=C_BOOL)     , DIMENSION(*) :: mask_0d
+      INTEGER (kind = C_INT), DIMENSION(*)     :: extent
+    END SUBROUTINE cxios_get_grid_mask_0d
+
+    FUNCTION cxios_is_defined_grid_mask_0d(grid_hdl) BIND(C)
+      USE ISO_C_BINDING
+      LOGICAL(kind=C_BOOL) :: cxios_is_defined_grid_mask_0d
+      INTEGER (kind = C_INTPTR_T), VALUE :: grid_hdl
+    END FUNCTION cxios_is_defined_grid_mask_0d
+
+
     SUBROUTINE cxios_set_grid_mask_1d(grid_hdl, mask_1d, extent) BIND(C)
       USE ISO_C_BINDING
Index: /XIOS/trunk/src/interface/fortran_attr/gridgroup_interface_attr.F90
===================================================================
--- /XIOS/trunk/src/interface/fortran_attr/gridgroup_interface_attr.F90	(revision 1536)
+++ /XIOS/trunk/src/interface/fortran_attr/gridgroup_interface_attr.F90	(revision 1537)
@@ -10,4 +10,25 @@
     ! Do not call directly / interface FORTRAN 2003 <-> C99
 
+    SUBROUTINE cxios_set_gridgroup_comment(gridgroup_hdl, comment, comment_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: gridgroup_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: comment
+      INTEGER  (kind = C_INT)     , VALUE        :: comment_size
+    END SUBROUTINE cxios_set_gridgroup_comment
+
+    SUBROUTINE cxios_get_gridgroup_comment(gridgroup_hdl, comment, comment_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: gridgroup_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: comment
+      INTEGER  (kind = C_INT)     , VALUE        :: comment_size
+    END SUBROUTINE cxios_get_gridgroup_comment
+
+    FUNCTION cxios_is_defined_gridgroup_comment(gridgroup_hdl) BIND(C)
+      USE ISO_C_BINDING
+      LOGICAL(kind=C_BOOL) :: cxios_is_defined_gridgroup_comment
+      INTEGER (kind = C_INTPTR_T), VALUE :: gridgroup_hdl
+    END FUNCTION cxios_is_defined_gridgroup_comment
+
+
     SUBROUTINE cxios_set_gridgroup_description(gridgroup_hdl, description, description_size) BIND(C)
       USE ISO_C_BINDING
@@ -52,4 +73,25 @@
 
 
+    SUBROUTINE cxios_set_gridgroup_mask_0d(gridgroup_hdl, mask_0d, extent) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE       :: gridgroup_hdl
+      LOGICAL (KIND=C_BOOL)     , DIMENSION(*) :: mask_0d
+      INTEGER (kind = C_INT), DIMENSION(*)     :: extent
+    END SUBROUTINE cxios_set_gridgroup_mask_0d
+
+    SUBROUTINE cxios_get_gridgroup_mask_0d(gridgroup_hdl, mask_0d, extent) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE       :: gridgroup_hdl
+      LOGICAL (KIND=C_BOOL)     , DIMENSION(*) :: mask_0d
+      INTEGER (kind = C_INT), DIMENSION(*)     :: extent
+    END SUBROUTINE cxios_get_gridgroup_mask_0d
+
+    FUNCTION cxios_is_defined_gridgroup_mask_0d(gridgroup_hdl) BIND(C)
+      USE ISO_C_BINDING
+      LOGICAL(kind=C_BOOL) :: cxios_is_defined_gridgroup_mask_0d
+      INTEGER (kind = C_INTPTR_T), VALUE :: gridgroup_hdl
+    END FUNCTION cxios_is_defined_gridgroup_mask_0d
+
+
     SUBROUTINE cxios_set_gridgroup_mask_1d(gridgroup_hdl, mask_1d, extent) BIND(C)
       USE ISO_C_BINDING
Index: /XIOS/trunk/src/interface/fortran_attr/iaxis_attr.F90
===================================================================
--- /XIOS/trunk/src/interface/fortran_attr/iaxis_attr.F90	(revision 1536)
+++ /XIOS/trunk/src/interface/fortran_attr/iaxis_attr.F90	(revision 1537)
@@ -12,7 +12,8 @@
 
   SUBROUTINE xios(set_axis_attr)  &
-    ( axis_id, axis_ref, begin, bounds, data_begin, data_index, data_n, index, label, long_name  &
-    , mask, n, n_distributed_partition, n_glo, name, positive, prec, standard_name, unit, value  &
-     )
+    ( axis_id, axis_ref, axis_type, begin, bounds, bounds_name, comment, data_begin, data_index  &
+    , data_n, dim_name, formula, formula_bounds, formula_term, formula_term_bounds, index, label  &
+    , long_name, mask, n, n_distributed_partition, n_glo, name, positive, prec, standard_name, unit  &
+    , value )
 
     IMPLICIT NONE
@@ -20,9 +21,17 @@
       CHARACTER(LEN=*), INTENT(IN) ::axis_id
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: axis_ref
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: axis_type
       INTEGER  , OPTIONAL, INTENT(IN) :: begin
       REAL (KIND=8) , OPTIONAL, INTENT(IN) :: bounds(:,:)
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: bounds_name
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: comment
       INTEGER  , OPTIONAL, INTENT(IN) :: data_begin
       INTEGER  , OPTIONAL, INTENT(IN) :: data_index(:)
       INTEGER  , OPTIONAL, INTENT(IN) :: data_n
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: dim_name
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: formula
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: formula_bounds
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: formula_term
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: formula_term_bounds
       INTEGER  , OPTIONAL, INTENT(IN) :: index(:)
       CHARACTER(len=*) , OPTIONAL, INTENT(IN) :: label(:)
@@ -43,23 +52,33 @@
       (axis_id,axis_hdl)
       CALL xios(set_axis_attr_hdl_)   &
-      ( axis_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, index, label, long_name  &
-      , mask, n, n_distributed_partition, n_glo, name, positive, prec, standard_name, unit, value  &
-       )
+      ( axis_hdl, axis_ref, axis_type, begin, bounds, bounds_name, comment, data_begin, data_index  &
+      , data_n, dim_name, formula, formula_bounds, formula_term, formula_term_bounds, index, label  &
+      , long_name, mask, n, n_distributed_partition, n_glo, name, positive, prec, standard_name, unit  &
+      , value )
 
   END SUBROUTINE xios(set_axis_attr)
 
   SUBROUTINE xios(set_axis_attr_hdl)  &
-    ( axis_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, index, label, long_name  &
-    , mask, n, n_distributed_partition, n_glo, name, positive, prec, standard_name, unit, value  &
-     )
+    ( axis_hdl, axis_ref, axis_type, begin, bounds, bounds_name, comment, data_begin, data_index  &
+    , data_n, dim_name, formula, formula_bounds, formula_term, formula_term_bounds, index, label  &
+    , long_name, mask, n, n_distributed_partition, n_glo, name, positive, prec, standard_name, unit  &
+    , value )
 
     IMPLICIT NONE
       TYPE(txios(axis)) , INTENT(IN) :: axis_hdl
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: axis_ref
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: axis_type
       INTEGER  , OPTIONAL, INTENT(IN) :: begin
       REAL (KIND=8) , OPTIONAL, INTENT(IN) :: bounds(:,:)
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: bounds_name
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: comment
       INTEGER  , OPTIONAL, INTENT(IN) :: data_begin
       INTEGER  , OPTIONAL, INTENT(IN) :: data_index(:)
       INTEGER  , OPTIONAL, INTENT(IN) :: data_n
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: dim_name
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: formula
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: formula_bounds
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: formula_term
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: formula_term_bounds
       INTEGER  , OPTIONAL, INTENT(IN) :: index(:)
       CHARACTER(len=*) , OPTIONAL, INTENT(IN) :: label(:)
@@ -78,23 +97,33 @@
 
       CALL xios(set_axis_attr_hdl_)  &
-      ( axis_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, index, label, long_name  &
-      , mask, n, n_distributed_partition, n_glo, name, positive, prec, standard_name, unit, value  &
-       )
+      ( axis_hdl, axis_ref, axis_type, begin, bounds, bounds_name, comment, data_begin, data_index  &
+      , data_n, dim_name, formula, formula_bounds, formula_term, formula_term_bounds, index, label  &
+      , long_name, mask, n, n_distributed_partition, n_glo, name, positive, prec, standard_name, unit  &
+      , value )
 
   END SUBROUTINE xios(set_axis_attr_hdl)
 
   SUBROUTINE xios(set_axis_attr_hdl_)   &
-    ( axis_hdl, axis_ref_, begin_, bounds_, data_begin_, data_index_, data_n_, index_, label_, long_name_  &
-    , mask_, n_, n_distributed_partition_, n_glo_, name_, positive_, prec_, standard_name_, unit_  &
-    , value_ )
+    ( axis_hdl, axis_ref_, axis_type_, begin_, bounds_, bounds_name_, comment_, data_begin_, data_index_  &
+    , data_n_, dim_name_, formula_, formula_bounds_, formula_term_, formula_term_bounds_, index_  &
+    , label_, long_name_, mask_, n_, n_distributed_partition_, n_glo_, name_, positive_, prec_, standard_name_  &
+    , unit_, value_ )
 
     IMPLICIT NONE
       TYPE(txios(axis)) , INTENT(IN) :: axis_hdl
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: axis_ref_
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: axis_type_
       INTEGER  , OPTIONAL, INTENT(IN) :: begin_
       REAL (KIND=8) , OPTIONAL, INTENT(IN) :: bounds_(:,:)
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: bounds_name_
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: comment_
       INTEGER  , OPTIONAL, INTENT(IN) :: data_begin_
       INTEGER  , OPTIONAL, INTENT(IN) :: data_index_(:)
       INTEGER  , OPTIONAL, INTENT(IN) :: data_n_
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: dim_name_
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: formula_
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: formula_bounds_
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: formula_term_
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: formula_term_bounds_
       INTEGER  , OPTIONAL, INTENT(IN) :: index_(:)
       CHARACTER(len=*) , OPTIONAL, INTENT(IN) :: label_(:)
@@ -117,4 +146,9 @@
       ENDIF
 
+      IF (PRESENT(axis_type_)) THEN
+        CALL cxios_set_axis_axis_type &
+      (axis_hdl%daddr, axis_type_, len(axis_type_))
+      ENDIF
+
       IF (PRESENT(begin_)) THEN
         CALL cxios_set_axis_begin &
@@ -127,4 +161,14 @@
       ENDIF
 
+      IF (PRESENT(bounds_name_)) THEN
+        CALL cxios_set_axis_bounds_name &
+      (axis_hdl%daddr, bounds_name_, len(bounds_name_))
+      ENDIF
+
+      IF (PRESENT(comment_)) THEN
+        CALL cxios_set_axis_comment &
+      (axis_hdl%daddr, comment_, len(comment_))
+      ENDIF
+
       IF (PRESENT(data_begin_)) THEN
         CALL cxios_set_axis_data_begin &
@@ -140,4 +184,29 @@
         CALL cxios_set_axis_data_n &
       (axis_hdl%daddr, data_n_)
+      ENDIF
+
+      IF (PRESENT(dim_name_)) THEN
+        CALL cxios_set_axis_dim_name &
+      (axis_hdl%daddr, dim_name_, len(dim_name_))
+      ENDIF
+
+      IF (PRESENT(formula_)) THEN
+        CALL cxios_set_axis_formula &
+      (axis_hdl%daddr, formula_, len(formula_))
+      ENDIF
+
+      IF (PRESENT(formula_bounds_)) THEN
+        CALL cxios_set_axis_formula_bounds &
+      (axis_hdl%daddr, formula_bounds_, len(formula_bounds_))
+      ENDIF
+
+      IF (PRESENT(formula_term_)) THEN
+        CALL cxios_set_axis_formula_term &
+      (axis_hdl%daddr, formula_term_, len(formula_term_))
+      ENDIF
+
+      IF (PRESENT(formula_term_bounds_)) THEN
+        CALL cxios_set_axis_formula_term_bounds &
+      (axis_hdl%daddr, formula_term_bounds_, len(formula_term_bounds_))
       ENDIF
 
@@ -212,7 +281,8 @@
 
   SUBROUTINE xios(get_axis_attr)  &
-    ( axis_id, axis_ref, begin, bounds, data_begin, data_index, data_n, index, label, long_name  &
-    , mask, n, n_distributed_partition, n_glo, name, positive, prec, standard_name, unit, value  &
-     )
+    ( axis_id, axis_ref, axis_type, begin, bounds, bounds_name, comment, data_begin, data_index  &
+    , data_n, dim_name, formula, formula_bounds, formula_term, formula_term_bounds, index, label  &
+    , long_name, mask, n, n_distributed_partition, n_glo, name, positive, prec, standard_name, unit  &
+    , value )
 
     IMPLICIT NONE
@@ -220,9 +290,17 @@
       CHARACTER(LEN=*), INTENT(IN) ::axis_id
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: axis_ref
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: axis_type
       INTEGER  , OPTIONAL, INTENT(OUT) :: begin
       REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: bounds(:,:)
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: bounds_name
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: comment
       INTEGER  , OPTIONAL, INTENT(OUT) :: data_begin
       INTEGER  , OPTIONAL, INTENT(OUT) :: data_index(:)
       INTEGER  , OPTIONAL, INTENT(OUT) :: data_n
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: dim_name
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: formula
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: formula_bounds
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: formula_term
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: formula_term_bounds
       INTEGER  , OPTIONAL, INTENT(OUT) :: index(:)
       CHARACTER(len=*) , OPTIONAL, INTENT(OUT) :: label(:)
@@ -243,23 +321,33 @@
       (axis_id,axis_hdl)
       CALL xios(get_axis_attr_hdl_)   &
-      ( axis_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, index, label, long_name  &
-      , mask, n, n_distributed_partition, n_glo, name, positive, prec, standard_name, unit, value  &
-       )
+      ( axis_hdl, axis_ref, axis_type, begin, bounds, bounds_name, comment, data_begin, data_index  &
+      , data_n, dim_name, formula, formula_bounds, formula_term, formula_term_bounds, index, label  &
+      , long_name, mask, n, n_distributed_partition, n_glo, name, positive, prec, standard_name, unit  &
+      , value )
 
   END SUBROUTINE xios(get_axis_attr)
 
   SUBROUTINE xios(get_axis_attr_hdl)  &
-    ( axis_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, index, label, long_name  &
-    , mask, n, n_distributed_partition, n_glo, name, positive, prec, standard_name, unit, value  &
-     )
+    ( axis_hdl, axis_ref, axis_type, begin, bounds, bounds_name, comment, data_begin, data_index  &
+    , data_n, dim_name, formula, formula_bounds, formula_term, formula_term_bounds, index, label  &
+    , long_name, mask, n, n_distributed_partition, n_glo, name, positive, prec, standard_name, unit  &
+    , value )
 
     IMPLICIT NONE
       TYPE(txios(axis)) , INTENT(IN) :: axis_hdl
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: axis_ref
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: axis_type
       INTEGER  , OPTIONAL, INTENT(OUT) :: begin
       REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: bounds(:,:)
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: bounds_name
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: comment
       INTEGER  , OPTIONAL, INTENT(OUT) :: data_begin
       INTEGER  , OPTIONAL, INTENT(OUT) :: data_index(:)
       INTEGER  , OPTIONAL, INTENT(OUT) :: data_n
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: dim_name
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: formula
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: formula_bounds
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: formula_term
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: formula_term_bounds
       INTEGER  , OPTIONAL, INTENT(OUT) :: index(:)
       CHARACTER(len=*) , OPTIONAL, INTENT(OUT) :: label(:)
@@ -278,23 +366,33 @@
 
       CALL xios(get_axis_attr_hdl_)  &
-      ( axis_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, index, label, long_name  &
-      , mask, n, n_distributed_partition, n_glo, name, positive, prec, standard_name, unit, value  &
-       )
+      ( axis_hdl, axis_ref, axis_type, begin, bounds, bounds_name, comment, data_begin, data_index  &
+      , data_n, dim_name, formula, formula_bounds, formula_term, formula_term_bounds, index, label  &
+      , long_name, mask, n, n_distributed_partition, n_glo, name, positive, prec, standard_name, unit  &
+      , value )
 
   END SUBROUTINE xios(get_axis_attr_hdl)
 
   SUBROUTINE xios(get_axis_attr_hdl_)   &
-    ( axis_hdl, axis_ref_, begin_, bounds_, data_begin_, data_index_, data_n_, index_, label_, long_name_  &
-    , mask_, n_, n_distributed_partition_, n_glo_, name_, positive_, prec_, standard_name_, unit_  &
-    , value_ )
+    ( axis_hdl, axis_ref_, axis_type_, begin_, bounds_, bounds_name_, comment_, data_begin_, data_index_  &
+    , data_n_, dim_name_, formula_, formula_bounds_, formula_term_, formula_term_bounds_, index_  &
+    , label_, long_name_, mask_, n_, n_distributed_partition_, n_glo_, name_, positive_, prec_, standard_name_  &
+    , unit_, value_ )
 
     IMPLICIT NONE
       TYPE(txios(axis)) , INTENT(IN) :: axis_hdl
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: axis_ref_
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: axis_type_
       INTEGER  , OPTIONAL, INTENT(OUT) :: begin_
       REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: bounds_(:,:)
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: bounds_name_
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: comment_
       INTEGER  , OPTIONAL, INTENT(OUT) :: data_begin_
       INTEGER  , OPTIONAL, INTENT(OUT) :: data_index_(:)
       INTEGER  , OPTIONAL, INTENT(OUT) :: data_n_
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: dim_name_
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: formula_
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: formula_bounds_
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: formula_term_
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: formula_term_bounds_
       INTEGER  , OPTIONAL, INTENT(OUT) :: index_(:)
       CHARACTER(len=*) , OPTIONAL, INTENT(OUT) :: label_(:)
@@ -317,4 +415,9 @@
       ENDIF
 
+      IF (PRESENT(axis_type_)) THEN
+        CALL cxios_get_axis_axis_type &
+      (axis_hdl%daddr, axis_type_, len(axis_type_))
+      ENDIF
+
       IF (PRESENT(begin_)) THEN
         CALL cxios_get_axis_begin &
@@ -327,4 +430,14 @@
       ENDIF
 
+      IF (PRESENT(bounds_name_)) THEN
+        CALL cxios_get_axis_bounds_name &
+      (axis_hdl%daddr, bounds_name_, len(bounds_name_))
+      ENDIF
+
+      IF (PRESENT(comment_)) THEN
+        CALL cxios_get_axis_comment &
+      (axis_hdl%daddr, comment_, len(comment_))
+      ENDIF
+
       IF (PRESENT(data_begin_)) THEN
         CALL cxios_get_axis_data_begin &
@@ -340,4 +453,29 @@
         CALL cxios_get_axis_data_n &
       (axis_hdl%daddr, data_n_)
+      ENDIF
+
+      IF (PRESENT(dim_name_)) THEN
+        CALL cxios_get_axis_dim_name &
+      (axis_hdl%daddr, dim_name_, len(dim_name_))
+      ENDIF
+
+      IF (PRESENT(formula_)) THEN
+        CALL cxios_get_axis_formula &
+      (axis_hdl%daddr, formula_, len(formula_))
+      ENDIF
+
+      IF (PRESENT(formula_bounds_)) THEN
+        CALL cxios_get_axis_formula_bounds &
+      (axis_hdl%daddr, formula_bounds_, len(formula_bounds_))
+      ENDIF
+
+      IF (PRESENT(formula_term_)) THEN
+        CALL cxios_get_axis_formula_term &
+      (axis_hdl%daddr, formula_term_, len(formula_term_))
+      ENDIF
+
+      IF (PRESENT(formula_term_bounds_)) THEN
+        CALL cxios_get_axis_formula_term_bounds &
+      (axis_hdl%daddr, formula_term_bounds_, len(formula_term_bounds_))
       ENDIF
 
@@ -412,7 +550,8 @@
 
   SUBROUTINE xios(is_defined_axis_attr)  &
-    ( axis_id, axis_ref, begin, bounds, data_begin, data_index, data_n, index, label, long_name  &
-    , mask, n, n_distributed_partition, n_glo, name, positive, prec, standard_name, unit, value  &
-     )
+    ( axis_id, axis_ref, axis_type, begin, bounds, bounds_name, comment, data_begin, data_index  &
+    , data_n, dim_name, formula, formula_bounds, formula_term, formula_term_bounds, index, label  &
+    , long_name, mask, n, n_distributed_partition, n_glo, name, positive, prec, standard_name, unit  &
+    , value )
 
     IMPLICIT NONE
@@ -421,8 +560,14 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: axis_ref
       LOGICAL(KIND=C_BOOL) :: axis_ref_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: axis_type
+      LOGICAL(KIND=C_BOOL) :: axis_type_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: begin
       LOGICAL(KIND=C_BOOL) :: begin_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: bounds
       LOGICAL(KIND=C_BOOL) :: bounds_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: bounds_name
+      LOGICAL(KIND=C_BOOL) :: bounds_name_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: comment
+      LOGICAL(KIND=C_BOOL) :: comment_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: data_begin
       LOGICAL(KIND=C_BOOL) :: data_begin_tmp
@@ -431,4 +576,14 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: data_n
       LOGICAL(KIND=C_BOOL) :: data_n_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: dim_name
+      LOGICAL(KIND=C_BOOL) :: dim_name_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: formula
+      LOGICAL(KIND=C_BOOL) :: formula_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: formula_bounds
+      LOGICAL(KIND=C_BOOL) :: formula_bounds_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: formula_term
+      LOGICAL(KIND=C_BOOL) :: formula_term_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: formula_term_bounds
+      LOGICAL(KIND=C_BOOL) :: formula_term_bounds_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: index
       LOGICAL(KIND=C_BOOL) :: index_tmp
@@ -461,14 +616,16 @@
       (axis_id,axis_hdl)
       CALL xios(is_defined_axis_attr_hdl_)   &
-      ( axis_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, index, label, long_name  &
-      , mask, n, n_distributed_partition, n_glo, name, positive, prec, standard_name, unit, value  &
-       )
+      ( axis_hdl, axis_ref, axis_type, begin, bounds, bounds_name, comment, data_begin, data_index  &
+      , data_n, dim_name, formula, formula_bounds, formula_term, formula_term_bounds, index, label  &
+      , long_name, mask, n, n_distributed_partition, n_glo, name, positive, prec, standard_name, unit  &
+      , value )
 
   END SUBROUTINE xios(is_defined_axis_attr)
 
   SUBROUTINE xios(is_defined_axis_attr_hdl)  &
-    ( axis_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, index, label, long_name  &
-    , mask, n, n_distributed_partition, n_glo, name, positive, prec, standard_name, unit, value  &
-     )
+    ( axis_hdl, axis_ref, axis_type, begin, bounds, bounds_name, comment, data_begin, data_index  &
+    , data_n, dim_name, formula, formula_bounds, formula_term, formula_term_bounds, index, label  &
+    , long_name, mask, n, n_distributed_partition, n_glo, name, positive, prec, standard_name, unit  &
+    , value )
 
     IMPLICIT NONE
@@ -476,8 +633,14 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: axis_ref
       LOGICAL(KIND=C_BOOL) :: axis_ref_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: axis_type
+      LOGICAL(KIND=C_BOOL) :: axis_type_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: begin
       LOGICAL(KIND=C_BOOL) :: begin_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: bounds
       LOGICAL(KIND=C_BOOL) :: bounds_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: bounds_name
+      LOGICAL(KIND=C_BOOL) :: bounds_name_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: comment
+      LOGICAL(KIND=C_BOOL) :: comment_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: data_begin
       LOGICAL(KIND=C_BOOL) :: data_begin_tmp
@@ -486,4 +649,14 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: data_n
       LOGICAL(KIND=C_BOOL) :: data_n_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: dim_name
+      LOGICAL(KIND=C_BOOL) :: dim_name_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: formula
+      LOGICAL(KIND=C_BOOL) :: formula_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: formula_bounds
+      LOGICAL(KIND=C_BOOL) :: formula_bounds_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: formula_term
+      LOGICAL(KIND=C_BOOL) :: formula_term_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: formula_term_bounds
+      LOGICAL(KIND=C_BOOL) :: formula_term_bounds_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: index
       LOGICAL(KIND=C_BOOL) :: index_tmp
@@ -514,14 +687,16 @@
 
       CALL xios(is_defined_axis_attr_hdl_)  &
-      ( axis_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, index, label, long_name  &
-      , mask, n, n_distributed_partition, n_glo, name, positive, prec, standard_name, unit, value  &
-       )
+      ( axis_hdl, axis_ref, axis_type, begin, bounds, bounds_name, comment, data_begin, data_index  &
+      , data_n, dim_name, formula, formula_bounds, formula_term, formula_term_bounds, index, label  &
+      , long_name, mask, n, n_distributed_partition, n_glo, name, positive, prec, standard_name, unit  &
+      , value )
 
   END SUBROUTINE xios(is_defined_axis_attr_hdl)
 
   SUBROUTINE xios(is_defined_axis_attr_hdl_)   &
-    ( axis_hdl, axis_ref_, begin_, bounds_, data_begin_, data_index_, data_n_, index_, label_, long_name_  &
-    , mask_, n_, n_distributed_partition_, n_glo_, name_, positive_, prec_, standard_name_, unit_  &
-    , value_ )
+    ( axis_hdl, axis_ref_, axis_type_, begin_, bounds_, bounds_name_, comment_, data_begin_, data_index_  &
+    , data_n_, dim_name_, formula_, formula_bounds_, formula_term_, formula_term_bounds_, index_  &
+    , label_, long_name_, mask_, n_, n_distributed_partition_, n_glo_, name_, positive_, prec_, standard_name_  &
+    , unit_, value_ )
 
     IMPLICIT NONE
@@ -529,8 +704,14 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: axis_ref_
       LOGICAL(KIND=C_BOOL) :: axis_ref__tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: axis_type_
+      LOGICAL(KIND=C_BOOL) :: axis_type__tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: begin_
       LOGICAL(KIND=C_BOOL) :: begin__tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: bounds_
       LOGICAL(KIND=C_BOOL) :: bounds__tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: bounds_name_
+      LOGICAL(KIND=C_BOOL) :: bounds_name__tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: comment_
+      LOGICAL(KIND=C_BOOL) :: comment__tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: data_begin_
       LOGICAL(KIND=C_BOOL) :: data_begin__tmp
@@ -539,4 +720,14 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: data_n_
       LOGICAL(KIND=C_BOOL) :: data_n__tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: dim_name_
+      LOGICAL(KIND=C_BOOL) :: dim_name__tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: formula_
+      LOGICAL(KIND=C_BOOL) :: formula__tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: formula_bounds_
+      LOGICAL(KIND=C_BOOL) :: formula_bounds__tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: formula_term_
+      LOGICAL(KIND=C_BOOL) :: formula_term__tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: formula_term_bounds_
+      LOGICAL(KIND=C_BOOL) :: formula_term_bounds__tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: index_
       LOGICAL(KIND=C_BOOL) :: index__tmp
@@ -572,4 +763,10 @@
       ENDIF
 
+      IF (PRESENT(axis_type_)) THEN
+        axis_type__tmp = cxios_is_defined_axis_axis_type &
+      (axis_hdl%daddr)
+        axis_type_ = axis_type__tmp
+      ENDIF
+
       IF (PRESENT(begin_)) THEN
         begin__tmp = cxios_is_defined_axis_begin &
@@ -584,4 +781,16 @@
       ENDIF
 
+      IF (PRESENT(bounds_name_)) THEN
+        bounds_name__tmp = cxios_is_defined_axis_bounds_name &
+      (axis_hdl%daddr)
+        bounds_name_ = bounds_name__tmp
+      ENDIF
+
+      IF (PRESENT(comment_)) THEN
+        comment__tmp = cxios_is_defined_axis_comment &
+      (axis_hdl%daddr)
+        comment_ = comment__tmp
+      ENDIF
+
       IF (PRESENT(data_begin_)) THEN
         data_begin__tmp = cxios_is_defined_axis_data_begin &
@@ -602,4 +811,34 @@
       ENDIF
 
+      IF (PRESENT(dim_name_)) THEN
+        dim_name__tmp = cxios_is_defined_axis_dim_name &
+      (axis_hdl%daddr)
+        dim_name_ = dim_name__tmp
+      ENDIF
+
+      IF (PRESENT(formula_)) THEN
+        formula__tmp = cxios_is_defined_axis_formula &
+      (axis_hdl%daddr)
+        formula_ = formula__tmp
+      ENDIF
+
+      IF (PRESENT(formula_bounds_)) THEN
+        formula_bounds__tmp = cxios_is_defined_axis_formula_bounds &
+      (axis_hdl%daddr)
+        formula_bounds_ = formula_bounds__tmp
+      ENDIF
+
+      IF (PRESENT(formula_term_)) THEN
+        formula_term__tmp = cxios_is_defined_axis_formula_term &
+      (axis_hdl%daddr)
+        formula_term_ = formula_term__tmp
+      ENDIF
+
+      IF (PRESENT(formula_term_bounds_)) THEN
+        formula_term_bounds__tmp = cxios_is_defined_axis_formula_term_bounds &
+      (axis_hdl%daddr)
+        formula_term_bounds_ = formula_term_bounds__tmp
+      ENDIF
+
       IF (PRESENT(index_)) THEN
         index__tmp = cxios_is_defined_axis_index &
Index: /XIOS/trunk/src/interface/fortran_attr/iaxisgroup_attr.F90
===================================================================
--- /XIOS/trunk/src/interface/fortran_attr/iaxisgroup_attr.F90	(revision 1536)
+++ /XIOS/trunk/src/interface/fortran_attr/iaxisgroup_attr.F90	(revision 1537)
@@ -12,7 +12,8 @@
 
   SUBROUTINE xios(set_axisgroup_attr)  &
-    ( axisgroup_id, axis_ref, begin, bounds, data_begin, data_index, data_n, group_ref, index, label  &
-    , long_name, mask, n, n_distributed_partition, n_glo, name, positive, prec, standard_name, unit  &
-    , value )
+    ( axisgroup_id, axis_ref, axis_type, begin, bounds, bounds_name, comment, data_begin, data_index  &
+    , data_n, dim_name, formula, formula_bounds, formula_term, formula_term_bounds, group_ref, index  &
+    , label, long_name, mask, n, n_distributed_partition, n_glo, name, positive, prec, standard_name  &
+    , unit, value )
 
     IMPLICIT NONE
@@ -20,9 +21,17 @@
       CHARACTER(LEN=*), INTENT(IN) ::axisgroup_id
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: axis_ref
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: axis_type
       INTEGER  , OPTIONAL, INTENT(IN) :: begin
       REAL (KIND=8) , OPTIONAL, INTENT(IN) :: bounds(:,:)
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: bounds_name
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: comment
       INTEGER  , OPTIONAL, INTENT(IN) :: data_begin
       INTEGER  , OPTIONAL, INTENT(IN) :: data_index(:)
       INTEGER  , OPTIONAL, INTENT(IN) :: data_n
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: dim_name
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: formula
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: formula_bounds
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: formula_term
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: formula_term_bounds
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: group_ref
       INTEGER  , OPTIONAL, INTENT(IN) :: index(:)
@@ -44,23 +53,33 @@
       (axisgroup_id,axisgroup_hdl)
       CALL xios(set_axisgroup_attr_hdl_)   &
-      ( axisgroup_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, group_ref, index, label  &
-      , long_name, mask, n, n_distributed_partition, n_glo, name, positive, prec, standard_name, unit  &
-      , value )
+      ( axisgroup_hdl, axis_ref, axis_type, begin, bounds, bounds_name, comment, data_begin, data_index  &
+      , data_n, dim_name, formula, formula_bounds, formula_term, formula_term_bounds, group_ref, index  &
+      , label, long_name, mask, n, n_distributed_partition, n_glo, name, positive, prec, standard_name  &
+      , unit, value )
 
   END SUBROUTINE xios(set_axisgroup_attr)
 
   SUBROUTINE xios(set_axisgroup_attr_hdl)  &
-    ( axisgroup_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, group_ref, index, label  &
-    , long_name, mask, n, n_distributed_partition, n_glo, name, positive, prec, standard_name, unit  &
-    , value )
+    ( axisgroup_hdl, axis_ref, axis_type, begin, bounds, bounds_name, comment, data_begin, data_index  &
+    , data_n, dim_name, formula, formula_bounds, formula_term, formula_term_bounds, group_ref, index  &
+    , label, long_name, mask, n, n_distributed_partition, n_glo, name, positive, prec, standard_name  &
+    , unit, value )
 
     IMPLICIT NONE
       TYPE(txios(axisgroup)) , INTENT(IN) :: axisgroup_hdl
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: axis_ref
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: axis_type
       INTEGER  , OPTIONAL, INTENT(IN) :: begin
       REAL (KIND=8) , OPTIONAL, INTENT(IN) :: bounds(:,:)
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: bounds_name
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: comment
       INTEGER  , OPTIONAL, INTENT(IN) :: data_begin
       INTEGER  , OPTIONAL, INTENT(IN) :: data_index(:)
       INTEGER  , OPTIONAL, INTENT(IN) :: data_n
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: dim_name
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: formula
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: formula_bounds
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: formula_term
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: formula_term_bounds
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: group_ref
       INTEGER  , OPTIONAL, INTENT(IN) :: index(:)
@@ -80,23 +99,33 @@
 
       CALL xios(set_axisgroup_attr_hdl_)  &
-      ( axisgroup_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, group_ref, index, label  &
-      , long_name, mask, n, n_distributed_partition, n_glo, name, positive, prec, standard_name, unit  &
-      , value )
+      ( axisgroup_hdl, axis_ref, axis_type, begin, bounds, bounds_name, comment, data_begin, data_index  &
+      , data_n, dim_name, formula, formula_bounds, formula_term, formula_term_bounds, group_ref, index  &
+      , label, long_name, mask, n, n_distributed_partition, n_glo, name, positive, prec, standard_name  &
+      , unit, value )
 
   END SUBROUTINE xios(set_axisgroup_attr_hdl)
 
   SUBROUTINE xios(set_axisgroup_attr_hdl_)   &
-    ( axisgroup_hdl, axis_ref_, begin_, bounds_, data_begin_, data_index_, data_n_, group_ref_, index_  &
-    , label_, long_name_, mask_, n_, n_distributed_partition_, n_glo_, name_, positive_, prec_, standard_name_  &
-    , unit_, value_ )
+    ( axisgroup_hdl, axis_ref_, axis_type_, begin_, bounds_, bounds_name_, comment_, data_begin_  &
+    , data_index_, data_n_, dim_name_, formula_, formula_bounds_, formula_term_, formula_term_bounds_  &
+    , group_ref_, index_, label_, long_name_, mask_, n_, n_distributed_partition_, n_glo_, name_  &
+    , positive_, prec_, standard_name_, unit_, value_ )
 
     IMPLICIT NONE
       TYPE(txios(axisgroup)) , INTENT(IN) :: axisgroup_hdl
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: axis_ref_
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: axis_type_
       INTEGER  , OPTIONAL, INTENT(IN) :: begin_
       REAL (KIND=8) , OPTIONAL, INTENT(IN) :: bounds_(:,:)
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: bounds_name_
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: comment_
       INTEGER  , OPTIONAL, INTENT(IN) :: data_begin_
       INTEGER  , OPTIONAL, INTENT(IN) :: data_index_(:)
       INTEGER  , OPTIONAL, INTENT(IN) :: data_n_
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: dim_name_
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: formula_
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: formula_bounds_
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: formula_term_
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: formula_term_bounds_
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: group_ref_
       INTEGER  , OPTIONAL, INTENT(IN) :: index_(:)
@@ -120,4 +149,9 @@
       ENDIF
 
+      IF (PRESENT(axis_type_)) THEN
+        CALL cxios_set_axisgroup_axis_type &
+      (axisgroup_hdl%daddr, axis_type_, len(axis_type_))
+      ENDIF
+
       IF (PRESENT(begin_)) THEN
         CALL cxios_set_axisgroup_begin &
@@ -130,4 +164,14 @@
       ENDIF
 
+      IF (PRESENT(bounds_name_)) THEN
+        CALL cxios_set_axisgroup_bounds_name &
+      (axisgroup_hdl%daddr, bounds_name_, len(bounds_name_))
+      ENDIF
+
+      IF (PRESENT(comment_)) THEN
+        CALL cxios_set_axisgroup_comment &
+      (axisgroup_hdl%daddr, comment_, len(comment_))
+      ENDIF
+
       IF (PRESENT(data_begin_)) THEN
         CALL cxios_set_axisgroup_data_begin &
@@ -143,4 +187,29 @@
         CALL cxios_set_axisgroup_data_n &
       (axisgroup_hdl%daddr, data_n_)
+      ENDIF
+
+      IF (PRESENT(dim_name_)) THEN
+        CALL cxios_set_axisgroup_dim_name &
+      (axisgroup_hdl%daddr, dim_name_, len(dim_name_))
+      ENDIF
+
+      IF (PRESENT(formula_)) THEN
+        CALL cxios_set_axisgroup_formula &
+      (axisgroup_hdl%daddr, formula_, len(formula_))
+      ENDIF
+
+      IF (PRESENT(formula_bounds_)) THEN
+        CALL cxios_set_axisgroup_formula_bounds &
+      (axisgroup_hdl%daddr, formula_bounds_, len(formula_bounds_))
+      ENDIF
+
+      IF (PRESENT(formula_term_)) THEN
+        CALL cxios_set_axisgroup_formula_term &
+      (axisgroup_hdl%daddr, formula_term_, len(formula_term_))
+      ENDIF
+
+      IF (PRESENT(formula_term_bounds_)) THEN
+        CALL cxios_set_axisgroup_formula_term_bounds &
+      (axisgroup_hdl%daddr, formula_term_bounds_, len(formula_term_bounds_))
       ENDIF
 
@@ -220,7 +289,8 @@
 
   SUBROUTINE xios(get_axisgroup_attr)  &
-    ( axisgroup_id, axis_ref, begin, bounds, data_begin, data_index, data_n, group_ref, index, label  &
-    , long_name, mask, n, n_distributed_partition, n_glo, name, positive, prec, standard_name, unit  &
-    , value )
+    ( axisgroup_id, axis_ref, axis_type, begin, bounds, bounds_name, comment, data_begin, data_index  &
+    , data_n, dim_name, formula, formula_bounds, formula_term, formula_term_bounds, group_ref, index  &
+    , label, long_name, mask, n, n_distributed_partition, n_glo, name, positive, prec, standard_name  &
+    , unit, value )
 
     IMPLICIT NONE
@@ -228,9 +298,17 @@
       CHARACTER(LEN=*), INTENT(IN) ::axisgroup_id
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: axis_ref
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: axis_type
       INTEGER  , OPTIONAL, INTENT(OUT) :: begin
       REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: bounds(:,:)
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: bounds_name
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: comment
       INTEGER  , OPTIONAL, INTENT(OUT) :: data_begin
       INTEGER  , OPTIONAL, INTENT(OUT) :: data_index(:)
       INTEGER  , OPTIONAL, INTENT(OUT) :: data_n
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: dim_name
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: formula
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: formula_bounds
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: formula_term
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: formula_term_bounds
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: group_ref
       INTEGER  , OPTIONAL, INTENT(OUT) :: index(:)
@@ -252,23 +330,33 @@
       (axisgroup_id,axisgroup_hdl)
       CALL xios(get_axisgroup_attr_hdl_)   &
-      ( axisgroup_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, group_ref, index, label  &
-      , long_name, mask, n, n_distributed_partition, n_glo, name, positive, prec, standard_name, unit  &
-      , value )
+      ( axisgroup_hdl, axis_ref, axis_type, begin, bounds, bounds_name, comment, data_begin, data_index  &
+      , data_n, dim_name, formula, formula_bounds, formula_term, formula_term_bounds, group_ref, index  &
+      , label, long_name, mask, n, n_distributed_partition, n_glo, name, positive, prec, standard_name  &
+      , unit, value )
 
   END SUBROUTINE xios(get_axisgroup_attr)
 
   SUBROUTINE xios(get_axisgroup_attr_hdl)  &
-    ( axisgroup_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, group_ref, index, label  &
-    , long_name, mask, n, n_distributed_partition, n_glo, name, positive, prec, standard_name, unit  &
-    , value )
+    ( axisgroup_hdl, axis_ref, axis_type, begin, bounds, bounds_name, comment, data_begin, data_index  &
+    , data_n, dim_name, formula, formula_bounds, formula_term, formula_term_bounds, group_ref, index  &
+    , label, long_name, mask, n, n_distributed_partition, n_glo, name, positive, prec, standard_name  &
+    , unit, value )
 
     IMPLICIT NONE
       TYPE(txios(axisgroup)) , INTENT(IN) :: axisgroup_hdl
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: axis_ref
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: axis_type
       INTEGER  , OPTIONAL, INTENT(OUT) :: begin
       REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: bounds(:,:)
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: bounds_name
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: comment
       INTEGER  , OPTIONAL, INTENT(OUT) :: data_begin
       INTEGER  , OPTIONAL, INTENT(OUT) :: data_index(:)
       INTEGER  , OPTIONAL, INTENT(OUT) :: data_n
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: dim_name
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: formula
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: formula_bounds
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: formula_term
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: formula_term_bounds
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: group_ref
       INTEGER  , OPTIONAL, INTENT(OUT) :: index(:)
@@ -288,23 +376,33 @@
 
       CALL xios(get_axisgroup_attr_hdl_)  &
-      ( axisgroup_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, group_ref, index, label  &
-      , long_name, mask, n, n_distributed_partition, n_glo, name, positive, prec, standard_name, unit  &
-      , value )
+      ( axisgroup_hdl, axis_ref, axis_type, begin, bounds, bounds_name, comment, data_begin, data_index  &
+      , data_n, dim_name, formula, formula_bounds, formula_term, formula_term_bounds, group_ref, index  &
+      , label, long_name, mask, n, n_distributed_partition, n_glo, name, positive, prec, standard_name  &
+      , unit, value )
 
   END SUBROUTINE xios(get_axisgroup_attr_hdl)
 
   SUBROUTINE xios(get_axisgroup_attr_hdl_)   &
-    ( axisgroup_hdl, axis_ref_, begin_, bounds_, data_begin_, data_index_, data_n_, group_ref_, index_  &
-    , label_, long_name_, mask_, n_, n_distributed_partition_, n_glo_, name_, positive_, prec_, standard_name_  &
-    , unit_, value_ )
+    ( axisgroup_hdl, axis_ref_, axis_type_, begin_, bounds_, bounds_name_, comment_, data_begin_  &
+    , data_index_, data_n_, dim_name_, formula_, formula_bounds_, formula_term_, formula_term_bounds_  &
+    , group_ref_, index_, label_, long_name_, mask_, n_, n_distributed_partition_, n_glo_, name_  &
+    , positive_, prec_, standard_name_, unit_, value_ )
 
     IMPLICIT NONE
       TYPE(txios(axisgroup)) , INTENT(IN) :: axisgroup_hdl
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: axis_ref_
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: axis_type_
       INTEGER  , OPTIONAL, INTENT(OUT) :: begin_
       REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: bounds_(:,:)
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: bounds_name_
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: comment_
       INTEGER  , OPTIONAL, INTENT(OUT) :: data_begin_
       INTEGER  , OPTIONAL, INTENT(OUT) :: data_index_(:)
       INTEGER  , OPTIONAL, INTENT(OUT) :: data_n_
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: dim_name_
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: formula_
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: formula_bounds_
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: formula_term_
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: formula_term_bounds_
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: group_ref_
       INTEGER  , OPTIONAL, INTENT(OUT) :: index_(:)
@@ -328,4 +426,9 @@
       ENDIF
 
+      IF (PRESENT(axis_type_)) THEN
+        CALL cxios_get_axisgroup_axis_type &
+      (axisgroup_hdl%daddr, axis_type_, len(axis_type_))
+      ENDIF
+
       IF (PRESENT(begin_)) THEN
         CALL cxios_get_axisgroup_begin &
@@ -338,4 +441,14 @@
       ENDIF
 
+      IF (PRESENT(bounds_name_)) THEN
+        CALL cxios_get_axisgroup_bounds_name &
+      (axisgroup_hdl%daddr, bounds_name_, len(bounds_name_))
+      ENDIF
+
+      IF (PRESENT(comment_)) THEN
+        CALL cxios_get_axisgroup_comment &
+      (axisgroup_hdl%daddr, comment_, len(comment_))
+      ENDIF
+
       IF (PRESENT(data_begin_)) THEN
         CALL cxios_get_axisgroup_data_begin &
@@ -351,4 +464,29 @@
         CALL cxios_get_axisgroup_data_n &
       (axisgroup_hdl%daddr, data_n_)
+      ENDIF
+
+      IF (PRESENT(dim_name_)) THEN
+        CALL cxios_get_axisgroup_dim_name &
+      (axisgroup_hdl%daddr, dim_name_, len(dim_name_))
+      ENDIF
+
+      IF (PRESENT(formula_)) THEN
+        CALL cxios_get_axisgroup_formula &
+      (axisgroup_hdl%daddr, formula_, len(formula_))
+      ENDIF
+
+      IF (PRESENT(formula_bounds_)) THEN
+        CALL cxios_get_axisgroup_formula_bounds &
+      (axisgroup_hdl%daddr, formula_bounds_, len(formula_bounds_))
+      ENDIF
+
+      IF (PRESENT(formula_term_)) THEN
+        CALL cxios_get_axisgroup_formula_term &
+      (axisgroup_hdl%daddr, formula_term_, len(formula_term_))
+      ENDIF
+
+      IF (PRESENT(formula_term_bounds_)) THEN
+        CALL cxios_get_axisgroup_formula_term_bounds &
+      (axisgroup_hdl%daddr, formula_term_bounds_, len(formula_term_bounds_))
       ENDIF
 
@@ -428,7 +566,8 @@
 
   SUBROUTINE xios(is_defined_axisgroup_attr)  &
-    ( axisgroup_id, axis_ref, begin, bounds, data_begin, data_index, data_n, group_ref, index, label  &
-    , long_name, mask, n, n_distributed_partition, n_glo, name, positive, prec, standard_name, unit  &
-    , value )
+    ( axisgroup_id, axis_ref, axis_type, begin, bounds, bounds_name, comment, data_begin, data_index  &
+    , data_n, dim_name, formula, formula_bounds, formula_term, formula_term_bounds, group_ref, index  &
+    , label, long_name, mask, n, n_distributed_partition, n_glo, name, positive, prec, standard_name  &
+    , unit, value )
 
     IMPLICIT NONE
@@ -437,8 +576,14 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: axis_ref
       LOGICAL(KIND=C_BOOL) :: axis_ref_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: axis_type
+      LOGICAL(KIND=C_BOOL) :: axis_type_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: begin
       LOGICAL(KIND=C_BOOL) :: begin_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: bounds
       LOGICAL(KIND=C_BOOL) :: bounds_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: bounds_name
+      LOGICAL(KIND=C_BOOL) :: bounds_name_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: comment
+      LOGICAL(KIND=C_BOOL) :: comment_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: data_begin
       LOGICAL(KIND=C_BOOL) :: data_begin_tmp
@@ -447,4 +592,14 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: data_n
       LOGICAL(KIND=C_BOOL) :: data_n_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: dim_name
+      LOGICAL(KIND=C_BOOL) :: dim_name_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: formula
+      LOGICAL(KIND=C_BOOL) :: formula_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: formula_bounds
+      LOGICAL(KIND=C_BOOL) :: formula_bounds_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: formula_term
+      LOGICAL(KIND=C_BOOL) :: formula_term_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: formula_term_bounds
+      LOGICAL(KIND=C_BOOL) :: formula_term_bounds_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: group_ref
       LOGICAL(KIND=C_BOOL) :: group_ref_tmp
@@ -479,14 +634,16 @@
       (axisgroup_id,axisgroup_hdl)
       CALL xios(is_defined_axisgroup_attr_hdl_)   &
-      ( axisgroup_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, group_ref, index, label  &
-      , long_name, mask, n, n_distributed_partition, n_glo, name, positive, prec, standard_name, unit  &
-      , value )
+      ( axisgroup_hdl, axis_ref, axis_type, begin, bounds, bounds_name, comment, data_begin, data_index  &
+      , data_n, dim_name, formula, formula_bounds, formula_term, formula_term_bounds, group_ref, index  &
+      , label, long_name, mask, n, n_distributed_partition, n_glo, name, positive, prec, standard_name  &
+      , unit, value )
 
   END SUBROUTINE xios(is_defined_axisgroup_attr)
 
   SUBROUTINE xios(is_defined_axisgroup_attr_hdl)  &
-    ( axisgroup_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, group_ref, index, label  &
-    , long_name, mask, n, n_distributed_partition, n_glo, name, positive, prec, standard_name, unit  &
-    , value )
+    ( axisgroup_hdl, axis_ref, axis_type, begin, bounds, bounds_name, comment, data_begin, data_index  &
+    , data_n, dim_name, formula, formula_bounds, formula_term, formula_term_bounds, group_ref, index  &
+    , label, long_name, mask, n, n_distributed_partition, n_glo, name, positive, prec, standard_name  &
+    , unit, value )
 
     IMPLICIT NONE
@@ -494,8 +651,14 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: axis_ref
       LOGICAL(KIND=C_BOOL) :: axis_ref_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: axis_type
+      LOGICAL(KIND=C_BOOL) :: axis_type_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: begin
       LOGICAL(KIND=C_BOOL) :: begin_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: bounds
       LOGICAL(KIND=C_BOOL) :: bounds_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: bounds_name
+      LOGICAL(KIND=C_BOOL) :: bounds_name_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: comment
+      LOGICAL(KIND=C_BOOL) :: comment_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: data_begin
       LOGICAL(KIND=C_BOOL) :: data_begin_tmp
@@ -504,4 +667,14 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: data_n
       LOGICAL(KIND=C_BOOL) :: data_n_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: dim_name
+      LOGICAL(KIND=C_BOOL) :: dim_name_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: formula
+      LOGICAL(KIND=C_BOOL) :: formula_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: formula_bounds
+      LOGICAL(KIND=C_BOOL) :: formula_bounds_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: formula_term
+      LOGICAL(KIND=C_BOOL) :: formula_term_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: formula_term_bounds
+      LOGICAL(KIND=C_BOOL) :: formula_term_bounds_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: group_ref
       LOGICAL(KIND=C_BOOL) :: group_ref_tmp
@@ -534,14 +707,16 @@
 
       CALL xios(is_defined_axisgroup_attr_hdl_)  &
-      ( axisgroup_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, group_ref, index, label  &
-      , long_name, mask, n, n_distributed_partition, n_glo, name, positive, prec, standard_name, unit  &
-      , value )
+      ( axisgroup_hdl, axis_ref, axis_type, begin, bounds, bounds_name, comment, data_begin, data_index  &
+      , data_n, dim_name, formula, formula_bounds, formula_term, formula_term_bounds, group_ref, index  &
+      , label, long_name, mask, n, n_distributed_partition, n_glo, name, positive, prec, standard_name  &
+      , unit, value )
 
   END SUBROUTINE xios(is_defined_axisgroup_attr_hdl)
 
   SUBROUTINE xios(is_defined_axisgroup_attr_hdl_)   &
-    ( axisgroup_hdl, axis_ref_, begin_, bounds_, data_begin_, data_index_, data_n_, group_ref_, index_  &
-    , label_, long_name_, mask_, n_, n_distributed_partition_, n_glo_, name_, positive_, prec_, standard_name_  &
-    , unit_, value_ )
+    ( axisgroup_hdl, axis_ref_, axis_type_, begin_, bounds_, bounds_name_, comment_, data_begin_  &
+    , data_index_, data_n_, dim_name_, formula_, formula_bounds_, formula_term_, formula_term_bounds_  &
+    , group_ref_, index_, label_, long_name_, mask_, n_, n_distributed_partition_, n_glo_, name_  &
+    , positive_, prec_, standard_name_, unit_, value_ )
 
     IMPLICIT NONE
@@ -549,8 +724,14 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: axis_ref_
       LOGICAL(KIND=C_BOOL) :: axis_ref__tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: axis_type_
+      LOGICAL(KIND=C_BOOL) :: axis_type__tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: begin_
       LOGICAL(KIND=C_BOOL) :: begin__tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: bounds_
       LOGICAL(KIND=C_BOOL) :: bounds__tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: bounds_name_
+      LOGICAL(KIND=C_BOOL) :: bounds_name__tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: comment_
+      LOGICAL(KIND=C_BOOL) :: comment__tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: data_begin_
       LOGICAL(KIND=C_BOOL) :: data_begin__tmp
@@ -559,4 +740,14 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: data_n_
       LOGICAL(KIND=C_BOOL) :: data_n__tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: dim_name_
+      LOGICAL(KIND=C_BOOL) :: dim_name__tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: formula_
+      LOGICAL(KIND=C_BOOL) :: formula__tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: formula_bounds_
+      LOGICAL(KIND=C_BOOL) :: formula_bounds__tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: formula_term_
+      LOGICAL(KIND=C_BOOL) :: formula_term__tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: formula_term_bounds_
+      LOGICAL(KIND=C_BOOL) :: formula_term_bounds__tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: group_ref_
       LOGICAL(KIND=C_BOOL) :: group_ref__tmp
@@ -594,4 +785,10 @@
       ENDIF
 
+      IF (PRESENT(axis_type_)) THEN
+        axis_type__tmp = cxios_is_defined_axisgroup_axis_type &
+      (axisgroup_hdl%daddr)
+        axis_type_ = axis_type__tmp
+      ENDIF
+
       IF (PRESENT(begin_)) THEN
         begin__tmp = cxios_is_defined_axisgroup_begin &
@@ -606,4 +803,16 @@
       ENDIF
 
+      IF (PRESENT(bounds_name_)) THEN
+        bounds_name__tmp = cxios_is_defined_axisgroup_bounds_name &
+      (axisgroup_hdl%daddr)
+        bounds_name_ = bounds_name__tmp
+      ENDIF
+
+      IF (PRESENT(comment_)) THEN
+        comment__tmp = cxios_is_defined_axisgroup_comment &
+      (axisgroup_hdl%daddr)
+        comment_ = comment__tmp
+      ENDIF
+
       IF (PRESENT(data_begin_)) THEN
         data_begin__tmp = cxios_is_defined_axisgroup_data_begin &
@@ -624,4 +833,34 @@
       ENDIF
 
+      IF (PRESENT(dim_name_)) THEN
+        dim_name__tmp = cxios_is_defined_axisgroup_dim_name &
+      (axisgroup_hdl%daddr)
+        dim_name_ = dim_name__tmp
+      ENDIF
+
+      IF (PRESENT(formula_)) THEN
+        formula__tmp = cxios_is_defined_axisgroup_formula &
+      (axisgroup_hdl%daddr)
+        formula_ = formula__tmp
+      ENDIF
+
+      IF (PRESENT(formula_bounds_)) THEN
+        formula_bounds__tmp = cxios_is_defined_axisgroup_formula_bounds &
+      (axisgroup_hdl%daddr)
+        formula_bounds_ = formula_bounds__tmp
+      ENDIF
+
+      IF (PRESENT(formula_term_)) THEN
+        formula_term__tmp = cxios_is_defined_axisgroup_formula_term &
+      (axisgroup_hdl%daddr)
+        formula_term_ = formula_term__tmp
+      ENDIF
+
+      IF (PRESENT(formula_term_bounds_)) THEN
+        formula_term_bounds__tmp = cxios_is_defined_axisgroup_formula_term_bounds &
+      (axisgroup_hdl%daddr)
+        formula_term_bounds_ = formula_term_bounds__tmp
+      ENDIF
+
       IF (PRESENT(group_ref_)) THEN
         group_ref__tmp = cxios_is_defined_axisgroup_group_ref &
Index: /XIOS/trunk/src/interface/fortran_attr/icalendar_wrapper_attr.F90
===================================================================
--- /XIOS/trunk/src/interface/fortran_attr/icalendar_wrapper_attr.F90	(revision 1536)
+++ /XIOS/trunk/src/interface/fortran_attr/icalendar_wrapper_attr.F90	(revision 1537)
@@ -12,5 +12,5 @@
 
   SUBROUTINE xios(set_calendar_wrapper_attr)  &
-    ( calendar_wrapper_id, day_length, leap_year_drift, leap_year_drift_offset, leap_year_month  &
+    ( calendar_wrapper_id, comment, day_length, leap_year_drift, leap_year_drift_offset, leap_year_month  &
     , month_lengths, start_date, time_origin, timestep, type, year_length )
 
@@ -18,4 +18,5 @@
       TYPE(txios(calendar_wrapper))  :: calendar_wrapper_hdl
       CHARACTER(LEN=*), INTENT(IN) ::calendar_wrapper_id
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: comment
       INTEGER  , OPTIONAL, INTENT(IN) :: day_length
       REAL (KIND=8) , OPTIONAL, INTENT(IN) :: leap_year_drift
@@ -32,5 +33,5 @@
       (calendar_wrapper_id,calendar_wrapper_hdl)
       CALL xios(set_calendar_wrapper_attr_hdl_)   &
-      ( calendar_wrapper_hdl, day_length, leap_year_drift, leap_year_drift_offset, leap_year_month  &
+      ( calendar_wrapper_hdl, comment, day_length, leap_year_drift, leap_year_drift_offset, leap_year_month  &
       , month_lengths, start_date, time_origin, timestep, type, year_length )
 
@@ -38,9 +39,10 @@
 
   SUBROUTINE xios(set_calendar_wrapper_attr_hdl)  &
-    ( calendar_wrapper_hdl, day_length, leap_year_drift, leap_year_drift_offset, leap_year_month  &
-    , month_lengths, start_date, time_origin, timestep, type, year_length )
-
-    IMPLICIT NONE
-      TYPE(txios(calendar_wrapper)) , INTENT(IN) :: calendar_wrapper_hdl
+    ( calendar_wrapper_hdl, comment, day_length, leap_year_drift, leap_year_drift_offset, leap_year_month  &
+    , month_lengths, start_date, time_origin, timestep, type, year_length )
+
+    IMPLICIT NONE
+      TYPE(txios(calendar_wrapper)) , INTENT(IN) :: calendar_wrapper_hdl
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: comment
       INTEGER  , OPTIONAL, INTENT(IN) :: day_length
       REAL (KIND=8) , OPTIONAL, INTENT(IN) :: leap_year_drift
@@ -55,5 +57,5 @@
 
       CALL xios(set_calendar_wrapper_attr_hdl_)  &
-      ( calendar_wrapper_hdl, day_length, leap_year_drift, leap_year_drift_offset, leap_year_month  &
+      ( calendar_wrapper_hdl, comment, day_length, leap_year_drift, leap_year_drift_offset, leap_year_month  &
       , month_lengths, start_date, time_origin, timestep, type, year_length )
 
@@ -61,9 +63,10 @@
 
   SUBROUTINE xios(set_calendar_wrapper_attr_hdl_)   &
-    ( calendar_wrapper_hdl, day_length_, leap_year_drift_, leap_year_drift_offset_, leap_year_month_  &
+    ( calendar_wrapper_hdl, comment_, day_length_, leap_year_drift_, leap_year_drift_offset_, leap_year_month_  &
     , month_lengths_, start_date_, time_origin_, timestep_, type_, year_length_ )
 
     IMPLICIT NONE
       TYPE(txios(calendar_wrapper)) , INTENT(IN) :: calendar_wrapper_hdl
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: comment_
       INTEGER  , OPTIONAL, INTENT(IN) :: day_length_
       REAL (KIND=8) , OPTIONAL, INTENT(IN) :: leap_year_drift_
@@ -77,4 +80,9 @@
       INTEGER  , OPTIONAL, INTENT(IN) :: year_length_
 
+      IF (PRESENT(comment_)) THEN
+        CALL cxios_set_calendar_wrapper_comment &
+      (calendar_wrapper_hdl%daddr, comment_, len(comment_))
+      ENDIF
+
       IF (PRESENT(day_length_)) THEN
         CALL cxios_set_calendar_wrapper_day_length &
@@ -130,5 +138,5 @@
 
   SUBROUTINE xios(get_calendar_wrapper_attr)  &
-    ( calendar_wrapper_id, day_length, leap_year_drift, leap_year_drift_offset, leap_year_month  &
+    ( calendar_wrapper_id, comment, day_length, leap_year_drift, leap_year_drift_offset, leap_year_month  &
     , month_lengths, start_date, time_origin, timestep, type, year_length )
 
@@ -136,4 +144,5 @@
       TYPE(txios(calendar_wrapper))  :: calendar_wrapper_hdl
       CHARACTER(LEN=*), INTENT(IN) ::calendar_wrapper_id
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: comment
       INTEGER  , OPTIONAL, INTENT(OUT) :: day_length
       REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: leap_year_drift
@@ -150,5 +159,5 @@
       (calendar_wrapper_id,calendar_wrapper_hdl)
       CALL xios(get_calendar_wrapper_attr_hdl_)   &
-      ( calendar_wrapper_hdl, day_length, leap_year_drift, leap_year_drift_offset, leap_year_month  &
+      ( calendar_wrapper_hdl, comment, day_length, leap_year_drift, leap_year_drift_offset, leap_year_month  &
       , month_lengths, start_date, time_origin, timestep, type, year_length )
 
@@ -156,9 +165,10 @@
 
   SUBROUTINE xios(get_calendar_wrapper_attr_hdl)  &
-    ( calendar_wrapper_hdl, day_length, leap_year_drift, leap_year_drift_offset, leap_year_month  &
-    , month_lengths, start_date, time_origin, timestep, type, year_length )
-
-    IMPLICIT NONE
-      TYPE(txios(calendar_wrapper)) , INTENT(IN) :: calendar_wrapper_hdl
+    ( calendar_wrapper_hdl, comment, day_length, leap_year_drift, leap_year_drift_offset, leap_year_month  &
+    , month_lengths, start_date, time_origin, timestep, type, year_length )
+
+    IMPLICIT NONE
+      TYPE(txios(calendar_wrapper)) , INTENT(IN) :: calendar_wrapper_hdl
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: comment
       INTEGER  , OPTIONAL, INTENT(OUT) :: day_length
       REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: leap_year_drift
@@ -173,5 +183,5 @@
 
       CALL xios(get_calendar_wrapper_attr_hdl_)  &
-      ( calendar_wrapper_hdl, day_length, leap_year_drift, leap_year_drift_offset, leap_year_month  &
+      ( calendar_wrapper_hdl, comment, day_length, leap_year_drift, leap_year_drift_offset, leap_year_month  &
       , month_lengths, start_date, time_origin, timestep, type, year_length )
 
@@ -179,9 +189,10 @@
 
   SUBROUTINE xios(get_calendar_wrapper_attr_hdl_)   &
-    ( calendar_wrapper_hdl, day_length_, leap_year_drift_, leap_year_drift_offset_, leap_year_month_  &
+    ( calendar_wrapper_hdl, comment_, day_length_, leap_year_drift_, leap_year_drift_offset_, leap_year_month_  &
     , month_lengths_, start_date_, time_origin_, timestep_, type_, year_length_ )
 
     IMPLICIT NONE
       TYPE(txios(calendar_wrapper)) , INTENT(IN) :: calendar_wrapper_hdl
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: comment_
       INTEGER  , OPTIONAL, INTENT(OUT) :: day_length_
       REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: leap_year_drift_
@@ -195,4 +206,9 @@
       INTEGER  , OPTIONAL, INTENT(OUT) :: year_length_
 
+      IF (PRESENT(comment_)) THEN
+        CALL cxios_get_calendar_wrapper_comment &
+      (calendar_wrapper_hdl%daddr, comment_, len(comment_))
+      ENDIF
+
       IF (PRESENT(day_length_)) THEN
         CALL cxios_get_calendar_wrapper_day_length &
@@ -248,5 +264,5 @@
 
   SUBROUTINE xios(is_defined_calendar_wrapper_attr)  &
-    ( calendar_wrapper_id, day_length, leap_year_drift, leap_year_drift_offset, leap_year_month  &
+    ( calendar_wrapper_id, comment, day_length, leap_year_drift, leap_year_drift_offset, leap_year_month  &
     , month_lengths, start_date, time_origin, timestep, type, year_length )
 
@@ -254,4 +270,6 @@
       TYPE(txios(calendar_wrapper))  :: calendar_wrapper_hdl
       CHARACTER(LEN=*), INTENT(IN) ::calendar_wrapper_id
+      LOGICAL, OPTIONAL, INTENT(OUT) :: comment
+      LOGICAL(KIND=C_BOOL) :: comment_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: day_length
       LOGICAL(KIND=C_BOOL) :: day_length_tmp
@@ -278,5 +296,5 @@
       (calendar_wrapper_id,calendar_wrapper_hdl)
       CALL xios(is_defined_calendar_wrapper_attr_hdl_)   &
-      ( calendar_wrapper_hdl, day_length, leap_year_drift, leap_year_drift_offset, leap_year_month  &
+      ( calendar_wrapper_hdl, comment, day_length, leap_year_drift, leap_year_drift_offset, leap_year_month  &
       , month_lengths, start_date, time_origin, timestep, type, year_length )
 
@@ -284,9 +302,11 @@
 
   SUBROUTINE xios(is_defined_calendar_wrapper_attr_hdl)  &
-    ( calendar_wrapper_hdl, day_length, leap_year_drift, leap_year_drift_offset, leap_year_month  &
-    , month_lengths, start_date, time_origin, timestep, type, year_length )
-
-    IMPLICIT NONE
-      TYPE(txios(calendar_wrapper)) , INTENT(IN) :: calendar_wrapper_hdl
+    ( calendar_wrapper_hdl, comment, day_length, leap_year_drift, leap_year_drift_offset, leap_year_month  &
+    , month_lengths, start_date, time_origin, timestep, type, year_length )
+
+    IMPLICIT NONE
+      TYPE(txios(calendar_wrapper)) , INTENT(IN) :: calendar_wrapper_hdl
+      LOGICAL, OPTIONAL, INTENT(OUT) :: comment
+      LOGICAL(KIND=C_BOOL) :: comment_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: day_length
       LOGICAL(KIND=C_BOOL) :: day_length_tmp
@@ -311,5 +331,5 @@
 
       CALL xios(is_defined_calendar_wrapper_attr_hdl_)  &
-      ( calendar_wrapper_hdl, day_length, leap_year_drift, leap_year_drift_offset, leap_year_month  &
+      ( calendar_wrapper_hdl, comment, day_length, leap_year_drift, leap_year_drift_offset, leap_year_month  &
       , month_lengths, start_date, time_origin, timestep, type, year_length )
 
@@ -317,9 +337,11 @@
 
   SUBROUTINE xios(is_defined_calendar_wrapper_attr_hdl_)   &
-    ( calendar_wrapper_hdl, day_length_, leap_year_drift_, leap_year_drift_offset_, leap_year_month_  &
+    ( calendar_wrapper_hdl, comment_, day_length_, leap_year_drift_, leap_year_drift_offset_, leap_year_month_  &
     , month_lengths_, start_date_, time_origin_, timestep_, type_, year_length_ )
 
     IMPLICIT NONE
       TYPE(txios(calendar_wrapper)) , INTENT(IN) :: calendar_wrapper_hdl
+      LOGICAL, OPTIONAL, INTENT(OUT) :: comment_
+      LOGICAL(KIND=C_BOOL) :: comment__tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: day_length_
       LOGICAL(KIND=C_BOOL) :: day_length__tmp
@@ -343,4 +365,10 @@
       LOGICAL(KIND=C_BOOL) :: year_length__tmp
 
+      IF (PRESENT(comment_)) THEN
+        comment__tmp = cxios_is_defined_calendar_wrapper_comment &
+      (calendar_wrapper_hdl%daddr)
+        comment_ = comment__tmp
+      ENDIF
+
       IF (PRESENT(day_length_)) THEN
         day_length__tmp = cxios_is_defined_calendar_wrapper_day_length &
Index: /XIOS/trunk/src/interface/fortran_attr/idomain_attr.F90
===================================================================
--- /XIOS/trunk/src/interface/fortran_attr/idomain_attr.F90	(revision 1536)
+++ /XIOS/trunk/src/interface/fortran_attr/idomain_attr.F90	(revision 1537)
@@ -12,8 +12,9 @@
 
   SUBROUTINE xios(set_domain_attr)  &
-    ( domain_id, area, bounds_lat_1d, bounds_lat_2d, bounds_lon_1d, bounds_lon_2d, data_dim, data_i_index  &
-    , data_ibegin, data_j_index, data_jbegin, data_ni, data_nj, domain_ref, i_index, ibegin, j_index  &
-    , jbegin, latvalue_1d, latvalue_2d, long_name, lonvalue_1d, lonvalue_2d, mask_1d, mask_2d, name  &
-    , ni, ni_glo, nj, nj_glo, nvertex, prec, standard_name, type )
+    ( domain_id, area, bounds_lat_1d, bounds_lat_2d, bounds_lat_name, bounds_lon_1d, bounds_lon_2d  &
+    , bounds_lon_name, comment, data_dim, data_i_index, data_ibegin, data_j_index, data_jbegin, data_ni  &
+    , data_nj, dim_i_name, dim_j_name, domain_ref, i_index, ibegin, j_index, jbegin, lat_name, latvalue_1d  &
+    , latvalue_2d, lon_name, long_name, lonvalue_1d, lonvalue_2d, mask_1d, mask_2d, name, ni, ni_glo  &
+    , nj, nj_glo, nvertex, prec, standard_name, type )
 
     IMPLICIT NONE
@@ -23,6 +24,9 @@
       REAL (KIND=8) , OPTIONAL, INTENT(IN) :: bounds_lat_1d(:,:)
       REAL (KIND=8) , OPTIONAL, INTENT(IN) :: bounds_lat_2d(:,:,:)
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: bounds_lat_name
       REAL (KIND=8) , OPTIONAL, INTENT(IN) :: bounds_lon_1d(:,:)
       REAL (KIND=8) , OPTIONAL, INTENT(IN) :: bounds_lon_2d(:,:,:)
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: bounds_lon_name
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: comment
       INTEGER  , OPTIONAL, INTENT(IN) :: data_dim
       INTEGER  , OPTIONAL, INTENT(IN) :: data_i_index(:)
@@ -32,4 +36,6 @@
       INTEGER  , OPTIONAL, INTENT(IN) :: data_ni
       INTEGER  , OPTIONAL, INTENT(IN) :: data_nj
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: dim_i_name
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: dim_j_name
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: domain_ref
       INTEGER  , OPTIONAL, INTENT(IN) :: i_index(:)
@@ -37,6 +43,8 @@
       INTEGER  , OPTIONAL, INTENT(IN) :: j_index(:)
       INTEGER  , OPTIONAL, INTENT(IN) :: jbegin
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: lat_name
       REAL (KIND=8) , OPTIONAL, INTENT(IN) :: latvalue_1d(:)
       REAL (KIND=8) , OPTIONAL, INTENT(IN) :: latvalue_2d(:,:)
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: lon_name
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: long_name
       REAL (KIND=8) , OPTIONAL, INTENT(IN) :: lonvalue_1d(:)
@@ -59,16 +67,18 @@
       (domain_id,domain_hdl)
       CALL xios(set_domain_attr_hdl_)   &
-      ( domain_hdl, area, bounds_lat_1d, bounds_lat_2d, bounds_lon_1d, bounds_lon_2d, data_dim, data_i_index  &
-      , data_ibegin, data_j_index, data_jbegin, data_ni, data_nj, domain_ref, i_index, ibegin, j_index  &
-      , jbegin, latvalue_1d, latvalue_2d, long_name, lonvalue_1d, lonvalue_2d, mask_1d, mask_2d, name  &
-      , ni, ni_glo, nj, nj_glo, nvertex, prec, standard_name, type )
+      ( domain_hdl, area, bounds_lat_1d, bounds_lat_2d, bounds_lat_name, bounds_lon_1d, bounds_lon_2d  &
+      , bounds_lon_name, comment, data_dim, data_i_index, data_ibegin, data_j_index, data_jbegin, data_ni  &
+      , data_nj, dim_i_name, dim_j_name, domain_ref, i_index, ibegin, j_index, jbegin, lat_name, latvalue_1d  &
+      , latvalue_2d, lon_name, long_name, lonvalue_1d, lonvalue_2d, mask_1d, mask_2d, name, ni, ni_glo  &
+      , nj, nj_glo, nvertex, prec, standard_name, type )
 
   END SUBROUTINE xios(set_domain_attr)
 
   SUBROUTINE xios(set_domain_attr_hdl)  &
-    ( domain_hdl, area, bounds_lat_1d, bounds_lat_2d, bounds_lon_1d, bounds_lon_2d, data_dim, data_i_index  &
-    , data_ibegin, data_j_index, data_jbegin, data_ni, data_nj, domain_ref, i_index, ibegin, j_index  &
-    , jbegin, latvalue_1d, latvalue_2d, long_name, lonvalue_1d, lonvalue_2d, mask_1d, mask_2d, name  &
-    , ni, ni_glo, nj, nj_glo, nvertex, prec, standard_name, type )
+    ( domain_hdl, area, bounds_lat_1d, bounds_lat_2d, bounds_lat_name, bounds_lon_1d, bounds_lon_2d  &
+    , bounds_lon_name, comment, data_dim, data_i_index, data_ibegin, data_j_index, data_jbegin, data_ni  &
+    , data_nj, dim_i_name, dim_j_name, domain_ref, i_index, ibegin, j_index, jbegin, lat_name, latvalue_1d  &
+    , latvalue_2d, lon_name, long_name, lonvalue_1d, lonvalue_2d, mask_1d, mask_2d, name, ni, ni_glo  &
+    , nj, nj_glo, nvertex, prec, standard_name, type )
 
     IMPLICIT NONE
@@ -77,6 +87,9 @@
       REAL (KIND=8) , OPTIONAL, INTENT(IN) :: bounds_lat_1d(:,:)
       REAL (KIND=8) , OPTIONAL, INTENT(IN) :: bounds_lat_2d(:,:,:)
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: bounds_lat_name
       REAL (KIND=8) , OPTIONAL, INTENT(IN) :: bounds_lon_1d(:,:)
       REAL (KIND=8) , OPTIONAL, INTENT(IN) :: bounds_lon_2d(:,:,:)
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: bounds_lon_name
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: comment
       INTEGER  , OPTIONAL, INTENT(IN) :: data_dim
       INTEGER  , OPTIONAL, INTENT(IN) :: data_i_index(:)
@@ -86,4 +99,6 @@
       INTEGER  , OPTIONAL, INTENT(IN) :: data_ni
       INTEGER  , OPTIONAL, INTENT(IN) :: data_nj
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: dim_i_name
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: dim_j_name
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: domain_ref
       INTEGER  , OPTIONAL, INTENT(IN) :: i_index(:)
@@ -91,6 +106,8 @@
       INTEGER  , OPTIONAL, INTENT(IN) :: j_index(:)
       INTEGER  , OPTIONAL, INTENT(IN) :: jbegin
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: lat_name
       REAL (KIND=8) , OPTIONAL, INTENT(IN) :: latvalue_1d(:)
       REAL (KIND=8) , OPTIONAL, INTENT(IN) :: latvalue_2d(:,:)
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: lon_name
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: long_name
       REAL (KIND=8) , OPTIONAL, INTENT(IN) :: lonvalue_1d(:)
@@ -111,17 +128,18 @@
 
       CALL xios(set_domain_attr_hdl_)  &
-      ( domain_hdl, area, bounds_lat_1d, bounds_lat_2d, bounds_lon_1d, bounds_lon_2d, data_dim, data_i_index  &
-      , data_ibegin, data_j_index, data_jbegin, data_ni, data_nj, domain_ref, i_index, ibegin, j_index  &
-      , jbegin, latvalue_1d, latvalue_2d, long_name, lonvalue_1d, lonvalue_2d, mask_1d, mask_2d, name  &
-      , ni, ni_glo, nj, nj_glo, nvertex, prec, standard_name, type )
+      ( domain_hdl, area, bounds_lat_1d, bounds_lat_2d, bounds_lat_name, bounds_lon_1d, bounds_lon_2d  &
+      , bounds_lon_name, comment, data_dim, data_i_index, data_ibegin, data_j_index, data_jbegin, data_ni  &
+      , data_nj, dim_i_name, dim_j_name, domain_ref, i_index, ibegin, j_index, jbegin, lat_name, latvalue_1d  &
+      , latvalue_2d, lon_name, long_name, lonvalue_1d, lonvalue_2d, mask_1d, mask_2d, name, ni, ni_glo  &
+      , nj, nj_glo, nvertex, prec, standard_name, type )
 
   END SUBROUTINE xios(set_domain_attr_hdl)
 
   SUBROUTINE xios(set_domain_attr_hdl_)   &
-    ( domain_hdl, area_, bounds_lat_1d_, bounds_lat_2d_, bounds_lon_1d_, bounds_lon_2d_, data_dim_  &
-    , data_i_index_, data_ibegin_, data_j_index_, data_jbegin_, data_ni_, data_nj_, domain_ref_  &
-    , i_index_, ibegin_, j_index_, jbegin_, latvalue_1d_, latvalue_2d_, long_name_, lonvalue_1d_  &
-    , lonvalue_2d_, mask_1d_, mask_2d_, name_, ni_, ni_glo_, nj_, nj_glo_, nvertex_, prec_, standard_name_  &
-    , type_ )
+    ( domain_hdl, area_, bounds_lat_1d_, bounds_lat_2d_, bounds_lat_name_, bounds_lon_1d_, bounds_lon_2d_  &
+    , bounds_lon_name_, comment_, data_dim_, data_i_index_, data_ibegin_, data_j_index_, data_jbegin_  &
+    , data_ni_, data_nj_, dim_i_name_, dim_j_name_, domain_ref_, i_index_, ibegin_, j_index_, jbegin_  &
+    , lat_name_, latvalue_1d_, latvalue_2d_, lon_name_, long_name_, lonvalue_1d_, lonvalue_2d_, mask_1d_  &
+    , mask_2d_, name_, ni_, ni_glo_, nj_, nj_glo_, nvertex_, prec_, standard_name_, type_ )
 
     IMPLICIT NONE
@@ -130,6 +148,9 @@
       REAL (KIND=8) , OPTIONAL, INTENT(IN) :: bounds_lat_1d_(:,:)
       REAL (KIND=8) , OPTIONAL, INTENT(IN) :: bounds_lat_2d_(:,:,:)
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: bounds_lat_name_
       REAL (KIND=8) , OPTIONAL, INTENT(IN) :: bounds_lon_1d_(:,:)
       REAL (KIND=8) , OPTIONAL, INTENT(IN) :: bounds_lon_2d_(:,:,:)
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: bounds_lon_name_
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: comment_
       INTEGER  , OPTIONAL, INTENT(IN) :: data_dim_
       INTEGER  , OPTIONAL, INTENT(IN) :: data_i_index_(:)
@@ -139,4 +160,6 @@
       INTEGER  , OPTIONAL, INTENT(IN) :: data_ni_
       INTEGER  , OPTIONAL, INTENT(IN) :: data_nj_
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: dim_i_name_
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: dim_j_name_
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: domain_ref_
       INTEGER  , OPTIONAL, INTENT(IN) :: i_index_(:)
@@ -144,6 +167,8 @@
       INTEGER  , OPTIONAL, INTENT(IN) :: j_index_(:)
       INTEGER  , OPTIONAL, INTENT(IN) :: jbegin_
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: lat_name_
       REAL (KIND=8) , OPTIONAL, INTENT(IN) :: latvalue_1d_(:)
       REAL (KIND=8) , OPTIONAL, INTENT(IN) :: latvalue_2d_(:,:)
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: lon_name_
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: long_name_
       REAL (KIND=8) , OPTIONAL, INTENT(IN) :: lonvalue_1d_(:)
@@ -178,4 +203,9 @@
       ENDIF
 
+      IF (PRESENT(bounds_lat_name_)) THEN
+        CALL cxios_set_domain_bounds_lat_name &
+      (domain_hdl%daddr, bounds_lat_name_, len(bounds_lat_name_))
+      ENDIF
+
       IF (PRESENT(bounds_lon_1d_)) THEN
         CALL cxios_set_domain_bounds_lon_1d &
@@ -188,4 +218,14 @@
       ENDIF
 
+      IF (PRESENT(bounds_lon_name_)) THEN
+        CALL cxios_set_domain_bounds_lon_name &
+      (domain_hdl%daddr, bounds_lon_name_, len(bounds_lon_name_))
+      ENDIF
+
+      IF (PRESENT(comment_)) THEN
+        CALL cxios_set_domain_comment &
+      (domain_hdl%daddr, comment_, len(comment_))
+      ENDIF
+
       IF (PRESENT(data_dim_)) THEN
         CALL cxios_set_domain_data_dim &
@@ -223,4 +263,14 @@
       ENDIF
 
+      IF (PRESENT(dim_i_name_)) THEN
+        CALL cxios_set_domain_dim_i_name &
+      (domain_hdl%daddr, dim_i_name_, len(dim_i_name_))
+      ENDIF
+
+      IF (PRESENT(dim_j_name_)) THEN
+        CALL cxios_set_domain_dim_j_name &
+      (domain_hdl%daddr, dim_j_name_, len(dim_j_name_))
+      ENDIF
+
       IF (PRESENT(domain_ref_)) THEN
         CALL cxios_set_domain_domain_ref &
@@ -248,4 +298,9 @@
       ENDIF
 
+      IF (PRESENT(lat_name_)) THEN
+        CALL cxios_set_domain_lat_name &
+      (domain_hdl%daddr, lat_name_, len(lat_name_))
+      ENDIF
+
       IF (PRESENT(latvalue_1d_)) THEN
         CALL cxios_set_domain_latvalue_1d &
@@ -256,4 +311,9 @@
         CALL cxios_set_domain_latvalue_2d &
       (domain_hdl%daddr, latvalue_2d_, SHAPE(latvalue_2d_))
+      ENDIF
+
+      IF (PRESENT(lon_name_)) THEN
+        CALL cxios_set_domain_lon_name &
+      (domain_hdl%daddr, lon_name_, len(lon_name_))
       ENDIF
 
@@ -335,8 +395,9 @@
 
   SUBROUTINE xios(get_domain_attr)  &
-    ( domain_id, area, bounds_lat_1d, bounds_lat_2d, bounds_lon_1d, bounds_lon_2d, data_dim, data_i_index  &
-    , data_ibegin, data_j_index, data_jbegin, data_ni, data_nj, domain_ref, i_index, ibegin, j_index  &
-    , jbegin, latvalue_1d, latvalue_2d, long_name, lonvalue_1d, lonvalue_2d, mask_1d, mask_2d, name  &
-    , ni, ni_glo, nj, nj_glo, nvertex, prec, standard_name, type )
+    ( domain_id, area, bounds_lat_1d, bounds_lat_2d, bounds_lat_name, bounds_lon_1d, bounds_lon_2d  &
+    , bounds_lon_name, comment, data_dim, data_i_index, data_ibegin, data_j_index, data_jbegin, data_ni  &
+    , data_nj, dim_i_name, dim_j_name, domain_ref, i_index, ibegin, j_index, jbegin, lat_name, latvalue_1d  &
+    , latvalue_2d, lon_name, long_name, lonvalue_1d, lonvalue_2d, mask_1d, mask_2d, name, ni, ni_glo  &
+    , nj, nj_glo, nvertex, prec, standard_name, type )
 
     IMPLICIT NONE
@@ -346,6 +407,9 @@
       REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: bounds_lat_1d(:,:)
       REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: bounds_lat_2d(:,:,:)
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: bounds_lat_name
       REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: bounds_lon_1d(:,:)
       REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: bounds_lon_2d(:,:,:)
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: bounds_lon_name
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: comment
       INTEGER  , OPTIONAL, INTENT(OUT) :: data_dim
       INTEGER  , OPTIONAL, INTENT(OUT) :: data_i_index(:)
@@ -355,4 +419,6 @@
       INTEGER  , OPTIONAL, INTENT(OUT) :: data_ni
       INTEGER  , OPTIONAL, INTENT(OUT) :: data_nj
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: dim_i_name
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: dim_j_name
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: domain_ref
       INTEGER  , OPTIONAL, INTENT(OUT) :: i_index(:)
@@ -360,6 +426,8 @@
       INTEGER  , OPTIONAL, INTENT(OUT) :: j_index(:)
       INTEGER  , OPTIONAL, INTENT(OUT) :: jbegin
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: lat_name
       REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: latvalue_1d(:)
       REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: latvalue_2d(:,:)
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: lon_name
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: long_name
       REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: lonvalue_1d(:)
@@ -382,16 +450,18 @@
       (domain_id,domain_hdl)
       CALL xios(get_domain_attr_hdl_)   &
-      ( domain_hdl, area, bounds_lat_1d, bounds_lat_2d, bounds_lon_1d, bounds_lon_2d, data_dim, data_i_index  &
-      , data_ibegin, data_j_index, data_jbegin, data_ni, data_nj, domain_ref, i_index, ibegin, j_index  &
-      , jbegin, latvalue_1d, latvalue_2d, long_name, lonvalue_1d, lonvalue_2d, mask_1d, mask_2d, name  &
-      , ni, ni_glo, nj, nj_glo, nvertex, prec, standard_name, type )
+      ( domain_hdl, area, bounds_lat_1d, bounds_lat_2d, bounds_lat_name, bounds_lon_1d, bounds_lon_2d  &
+      , bounds_lon_name, comment, data_dim, data_i_index, data_ibegin, data_j_index, data_jbegin, data_ni  &
+      , data_nj, dim_i_name, dim_j_name, domain_ref, i_index, ibegin, j_index, jbegin, lat_name, latvalue_1d  &
+      , latvalue_2d, lon_name, long_name, lonvalue_1d, lonvalue_2d, mask_1d, mask_2d, name, ni, ni_glo  &
+      , nj, nj_glo, nvertex, prec, standard_name, type )
 
   END SUBROUTINE xios(get_domain_attr)
 
   SUBROUTINE xios(get_domain_attr_hdl)  &
-    ( domain_hdl, area, bounds_lat_1d, bounds_lat_2d, bounds_lon_1d, bounds_lon_2d, data_dim, data_i_index  &
-    , data_ibegin, data_j_index, data_jbegin, data_ni, data_nj, domain_ref, i_index, ibegin, j_index  &
-    , jbegin, latvalue_1d, latvalue_2d, long_name, lonvalue_1d, lonvalue_2d, mask_1d, mask_2d, name  &
-    , ni, ni_glo, nj, nj_glo, nvertex, prec, standard_name, type )
+    ( domain_hdl, area, bounds_lat_1d, bounds_lat_2d, bounds_lat_name, bounds_lon_1d, bounds_lon_2d  &
+    , bounds_lon_name, comment, data_dim, data_i_index, data_ibegin, data_j_index, data_jbegin, data_ni  &
+    , data_nj, dim_i_name, dim_j_name, domain_ref, i_index, ibegin, j_index, jbegin, lat_name, latvalue_1d  &
+    , latvalue_2d, lon_name, long_name, lonvalue_1d, lonvalue_2d, mask_1d, mask_2d, name, ni, ni_glo  &
+    , nj, nj_glo, nvertex, prec, standard_name, type )
 
     IMPLICIT NONE
@@ -400,6 +470,9 @@
       REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: bounds_lat_1d(:,:)
       REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: bounds_lat_2d(:,:,:)
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: bounds_lat_name
       REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: bounds_lon_1d(:,:)
       REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: bounds_lon_2d(:,:,:)
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: bounds_lon_name
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: comment
       INTEGER  , OPTIONAL, INTENT(OUT) :: data_dim
       INTEGER  , OPTIONAL, INTENT(OUT) :: data_i_index(:)
@@ -409,4 +482,6 @@
       INTEGER  , OPTIONAL, INTENT(OUT) :: data_ni
       INTEGER  , OPTIONAL, INTENT(OUT) :: data_nj
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: dim_i_name
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: dim_j_name
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: domain_ref
       INTEGER  , OPTIONAL, INTENT(OUT) :: i_index(:)
@@ -414,6 +489,8 @@
       INTEGER  , OPTIONAL, INTENT(OUT) :: j_index(:)
       INTEGER  , OPTIONAL, INTENT(OUT) :: jbegin
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: lat_name
       REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: latvalue_1d(:)
       REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: latvalue_2d(:,:)
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: lon_name
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: long_name
       REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: lonvalue_1d(:)
@@ -434,17 +511,18 @@
 
       CALL xios(get_domain_attr_hdl_)  &
-      ( domain_hdl, area, bounds_lat_1d, bounds_lat_2d, bounds_lon_1d, bounds_lon_2d, data_dim, data_i_index  &
-      , data_ibegin, data_j_index, data_jbegin, data_ni, data_nj, domain_ref, i_index, ibegin, j_index  &
-      , jbegin, latvalue_1d, latvalue_2d, long_name, lonvalue_1d, lonvalue_2d, mask_1d, mask_2d, name  &
-      , ni, ni_glo, nj, nj_glo, nvertex, prec, standard_name, type )
+      ( domain_hdl, area, bounds_lat_1d, bounds_lat_2d, bounds_lat_name, bounds_lon_1d, bounds_lon_2d  &
+      , bounds_lon_name, comment, data_dim, data_i_index, data_ibegin, data_j_index, data_jbegin, data_ni  &
+      , data_nj, dim_i_name, dim_j_name, domain_ref, i_index, ibegin, j_index, jbegin, lat_name, latvalue_1d  &
+      , latvalue_2d, lon_name, long_name, lonvalue_1d, lonvalue_2d, mask_1d, mask_2d, name, ni, ni_glo  &
+      , nj, nj_glo, nvertex, prec, standard_name, type )
 
   END SUBROUTINE xios(get_domain_attr_hdl)
 
   SUBROUTINE xios(get_domain_attr_hdl_)   &
-    ( domain_hdl, area_, bounds_lat_1d_, bounds_lat_2d_, bounds_lon_1d_, bounds_lon_2d_, data_dim_  &
-    , data_i_index_, data_ibegin_, data_j_index_, data_jbegin_, data_ni_, data_nj_, domain_ref_  &
-    , i_index_, ibegin_, j_index_, jbegin_, latvalue_1d_, latvalue_2d_, long_name_, lonvalue_1d_  &
-    , lonvalue_2d_, mask_1d_, mask_2d_, name_, ni_, ni_glo_, nj_, nj_glo_, nvertex_, prec_, standard_name_  &
-    , type_ )
+    ( domain_hdl, area_, bounds_lat_1d_, bounds_lat_2d_, bounds_lat_name_, bounds_lon_1d_, bounds_lon_2d_  &
+    , bounds_lon_name_, comment_, data_dim_, data_i_index_, data_ibegin_, data_j_index_, data_jbegin_  &
+    , data_ni_, data_nj_, dim_i_name_, dim_j_name_, domain_ref_, i_index_, ibegin_, j_index_, jbegin_  &
+    , lat_name_, latvalue_1d_, latvalue_2d_, lon_name_, long_name_, lonvalue_1d_, lonvalue_2d_, mask_1d_  &
+    , mask_2d_, name_, ni_, ni_glo_, nj_, nj_glo_, nvertex_, prec_, standard_name_, type_ )
 
     IMPLICIT NONE
@@ -453,6 +531,9 @@
       REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: bounds_lat_1d_(:,:)
       REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: bounds_lat_2d_(:,:,:)
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: bounds_lat_name_
       REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: bounds_lon_1d_(:,:)
       REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: bounds_lon_2d_(:,:,:)
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: bounds_lon_name_
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: comment_
       INTEGER  , OPTIONAL, INTENT(OUT) :: data_dim_
       INTEGER  , OPTIONAL, INTENT(OUT) :: data_i_index_(:)
@@ -462,4 +543,6 @@
       INTEGER  , OPTIONAL, INTENT(OUT) :: data_ni_
       INTEGER  , OPTIONAL, INTENT(OUT) :: data_nj_
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: dim_i_name_
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: dim_j_name_
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: domain_ref_
       INTEGER  , OPTIONAL, INTENT(OUT) :: i_index_(:)
@@ -467,6 +550,8 @@
       INTEGER  , OPTIONAL, INTENT(OUT) :: j_index_(:)
       INTEGER  , OPTIONAL, INTENT(OUT) :: jbegin_
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: lat_name_
       REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: latvalue_1d_(:)
       REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: latvalue_2d_(:,:)
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: lon_name_
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: long_name_
       REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: lonvalue_1d_(:)
@@ -501,4 +586,9 @@
       ENDIF
 
+      IF (PRESENT(bounds_lat_name_)) THEN
+        CALL cxios_get_domain_bounds_lat_name &
+      (domain_hdl%daddr, bounds_lat_name_, len(bounds_lat_name_))
+      ENDIF
+
       IF (PRESENT(bounds_lon_1d_)) THEN
         CALL cxios_get_domain_bounds_lon_1d &
@@ -511,4 +601,14 @@
       ENDIF
 
+      IF (PRESENT(bounds_lon_name_)) THEN
+        CALL cxios_get_domain_bounds_lon_name &
+      (domain_hdl%daddr, bounds_lon_name_, len(bounds_lon_name_))
+      ENDIF
+
+      IF (PRESENT(comment_)) THEN
+        CALL cxios_get_domain_comment &
+      (domain_hdl%daddr, comment_, len(comment_))
+      ENDIF
+
       IF (PRESENT(data_dim_)) THEN
         CALL cxios_get_domain_data_dim &
@@ -546,4 +646,14 @@
       ENDIF
 
+      IF (PRESENT(dim_i_name_)) THEN
+        CALL cxios_get_domain_dim_i_name &
+      (domain_hdl%daddr, dim_i_name_, len(dim_i_name_))
+      ENDIF
+
+      IF (PRESENT(dim_j_name_)) THEN
+        CALL cxios_get_domain_dim_j_name &
+      (domain_hdl%daddr, dim_j_name_, len(dim_j_name_))
+      ENDIF
+
       IF (PRESENT(domain_ref_)) THEN
         CALL cxios_get_domain_domain_ref &
@@ -571,4 +681,9 @@
       ENDIF
 
+      IF (PRESENT(lat_name_)) THEN
+        CALL cxios_get_domain_lat_name &
+      (domain_hdl%daddr, lat_name_, len(lat_name_))
+      ENDIF
+
       IF (PRESENT(latvalue_1d_)) THEN
         CALL cxios_get_domain_latvalue_1d &
@@ -579,4 +694,9 @@
         CALL cxios_get_domain_latvalue_2d &
       (domain_hdl%daddr, latvalue_2d_, SHAPE(latvalue_2d_))
+      ENDIF
+
+      IF (PRESENT(lon_name_)) THEN
+        CALL cxios_get_domain_lon_name &
+      (domain_hdl%daddr, lon_name_, len(lon_name_))
       ENDIF
 
@@ -658,8 +778,9 @@
 
   SUBROUTINE xios(is_defined_domain_attr)  &
-    ( domain_id, area, bounds_lat_1d, bounds_lat_2d, bounds_lon_1d, bounds_lon_2d, data_dim, data_i_index  &
-    , data_ibegin, data_j_index, data_jbegin, data_ni, data_nj, domain_ref, i_index, ibegin, j_index  &
-    , jbegin, latvalue_1d, latvalue_2d, long_name, lonvalue_1d, lonvalue_2d, mask_1d, mask_2d, name  &
-    , ni, ni_glo, nj, nj_glo, nvertex, prec, standard_name, type )
+    ( domain_id, area, bounds_lat_1d, bounds_lat_2d, bounds_lat_name, bounds_lon_1d, bounds_lon_2d  &
+    , bounds_lon_name, comment, data_dim, data_i_index, data_ibegin, data_j_index, data_jbegin, data_ni  &
+    , data_nj, dim_i_name, dim_j_name, domain_ref, i_index, ibegin, j_index, jbegin, lat_name, latvalue_1d  &
+    , latvalue_2d, lon_name, long_name, lonvalue_1d, lonvalue_2d, mask_1d, mask_2d, name, ni, ni_glo  &
+    , nj, nj_glo, nvertex, prec, standard_name, type )
 
     IMPLICIT NONE
@@ -672,8 +793,14 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: bounds_lat_2d
       LOGICAL(KIND=C_BOOL) :: bounds_lat_2d_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: bounds_lat_name
+      LOGICAL(KIND=C_BOOL) :: bounds_lat_name_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: bounds_lon_1d
       LOGICAL(KIND=C_BOOL) :: bounds_lon_1d_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: bounds_lon_2d
       LOGICAL(KIND=C_BOOL) :: bounds_lon_2d_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: bounds_lon_name
+      LOGICAL(KIND=C_BOOL) :: bounds_lon_name_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: comment
+      LOGICAL(KIND=C_BOOL) :: comment_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: data_dim
       LOGICAL(KIND=C_BOOL) :: data_dim_tmp
@@ -690,4 +817,8 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: data_nj
       LOGICAL(KIND=C_BOOL) :: data_nj_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: dim_i_name
+      LOGICAL(KIND=C_BOOL) :: dim_i_name_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: dim_j_name
+      LOGICAL(KIND=C_BOOL) :: dim_j_name_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: domain_ref
       LOGICAL(KIND=C_BOOL) :: domain_ref_tmp
@@ -700,8 +831,12 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: jbegin
       LOGICAL(KIND=C_BOOL) :: jbegin_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: lat_name
+      LOGICAL(KIND=C_BOOL) :: lat_name_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: latvalue_1d
       LOGICAL(KIND=C_BOOL) :: latvalue_1d_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: latvalue_2d
       LOGICAL(KIND=C_BOOL) :: latvalue_2d_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: lon_name
+      LOGICAL(KIND=C_BOOL) :: lon_name_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: long_name
       LOGICAL(KIND=C_BOOL) :: long_name_tmp
@@ -736,16 +871,18 @@
       (domain_id,domain_hdl)
       CALL xios(is_defined_domain_attr_hdl_)   &
-      ( domain_hdl, area, bounds_lat_1d, bounds_lat_2d, bounds_lon_1d, bounds_lon_2d, data_dim, data_i_index  &
-      , data_ibegin, data_j_index, data_jbegin, data_ni, data_nj, domain_ref, i_index, ibegin, j_index  &
-      , jbegin, latvalue_1d, latvalue_2d, long_name, lonvalue_1d, lonvalue_2d, mask_1d, mask_2d, name  &
-      , ni, ni_glo, nj, nj_glo, nvertex, prec, standard_name, type )
+      ( domain_hdl, area, bounds_lat_1d, bounds_lat_2d, bounds_lat_name, bounds_lon_1d, bounds_lon_2d  &
+      , bounds_lon_name, comment, data_dim, data_i_index, data_ibegin, data_j_index, data_jbegin, data_ni  &
+      , data_nj, dim_i_name, dim_j_name, domain_ref, i_index, ibegin, j_index, jbegin, lat_name, latvalue_1d  &
+      , latvalue_2d, lon_name, long_name, lonvalue_1d, lonvalue_2d, mask_1d, mask_2d, name, ni, ni_glo  &
+      , nj, nj_glo, nvertex, prec, standard_name, type )
 
   END SUBROUTINE xios(is_defined_domain_attr)
 
   SUBROUTINE xios(is_defined_domain_attr_hdl)  &
-    ( domain_hdl, area, bounds_lat_1d, bounds_lat_2d, bounds_lon_1d, bounds_lon_2d, data_dim, data_i_index  &
-    , data_ibegin, data_j_index, data_jbegin, data_ni, data_nj, domain_ref, i_index, ibegin, j_index  &
-    , jbegin, latvalue_1d, latvalue_2d, long_name, lonvalue_1d, lonvalue_2d, mask_1d, mask_2d, name  &
-    , ni, ni_glo, nj, nj_glo, nvertex, prec, standard_name, type )
+    ( domain_hdl, area, bounds_lat_1d, bounds_lat_2d, bounds_lat_name, bounds_lon_1d, bounds_lon_2d  &
+    , bounds_lon_name, comment, data_dim, data_i_index, data_ibegin, data_j_index, data_jbegin, data_ni  &
+    , data_nj, dim_i_name, dim_j_name, domain_ref, i_index, ibegin, j_index, jbegin, lat_name, latvalue_1d  &
+    , latvalue_2d, lon_name, long_name, lonvalue_1d, lonvalue_2d, mask_1d, mask_2d, name, ni, ni_glo  &
+    , nj, nj_glo, nvertex, prec, standard_name, type )
 
     IMPLICIT NONE
@@ -757,8 +894,14 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: bounds_lat_2d
       LOGICAL(KIND=C_BOOL) :: bounds_lat_2d_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: bounds_lat_name
+      LOGICAL(KIND=C_BOOL) :: bounds_lat_name_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: bounds_lon_1d
       LOGICAL(KIND=C_BOOL) :: bounds_lon_1d_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: bounds_lon_2d
       LOGICAL(KIND=C_BOOL) :: bounds_lon_2d_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: bounds_lon_name
+      LOGICAL(KIND=C_BOOL) :: bounds_lon_name_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: comment
+      LOGICAL(KIND=C_BOOL) :: comment_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: data_dim
       LOGICAL(KIND=C_BOOL) :: data_dim_tmp
@@ -775,4 +918,8 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: data_nj
       LOGICAL(KIND=C_BOOL) :: data_nj_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: dim_i_name
+      LOGICAL(KIND=C_BOOL) :: dim_i_name_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: dim_j_name
+      LOGICAL(KIND=C_BOOL) :: dim_j_name_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: domain_ref
       LOGICAL(KIND=C_BOOL) :: domain_ref_tmp
@@ -785,8 +932,12 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: jbegin
       LOGICAL(KIND=C_BOOL) :: jbegin_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: lat_name
+      LOGICAL(KIND=C_BOOL) :: lat_name_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: latvalue_1d
       LOGICAL(KIND=C_BOOL) :: latvalue_1d_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: latvalue_2d
       LOGICAL(KIND=C_BOOL) :: latvalue_2d_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: lon_name
+      LOGICAL(KIND=C_BOOL) :: lon_name_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: long_name
       LOGICAL(KIND=C_BOOL) :: long_name_tmp
@@ -819,17 +970,18 @@
 
       CALL xios(is_defined_domain_attr_hdl_)  &
-      ( domain_hdl, area, bounds_lat_1d, bounds_lat_2d, bounds_lon_1d, bounds_lon_2d, data_dim, data_i_index  &
-      , data_ibegin, data_j_index, data_jbegin, data_ni, data_nj, domain_ref, i_index, ibegin, j_index  &
-      , jbegin, latvalue_1d, latvalue_2d, long_name, lonvalue_1d, lonvalue_2d, mask_1d, mask_2d, name  &
-      , ni, ni_glo, nj, nj_glo, nvertex, prec, standard_name, type )
+      ( domain_hdl, area, bounds_lat_1d, bounds_lat_2d, bounds_lat_name, bounds_lon_1d, bounds_lon_2d  &
+      , bounds_lon_name, comment, data_dim, data_i_index, data_ibegin, data_j_index, data_jbegin, data_ni  &
+      , data_nj, dim_i_name, dim_j_name, domain_ref, i_index, ibegin, j_index, jbegin, lat_name, latvalue_1d  &
+      , latvalue_2d, lon_name, long_name, lonvalue_1d, lonvalue_2d, mask_1d, mask_2d, name, ni, ni_glo  &
+      , nj, nj_glo, nvertex, prec, standard_name, type )
 
   END SUBROUTINE xios(is_defined_domain_attr_hdl)
 
   SUBROUTINE xios(is_defined_domain_attr_hdl_)   &
-    ( domain_hdl, area_, bounds_lat_1d_, bounds_lat_2d_, bounds_lon_1d_, bounds_lon_2d_, data_dim_  &
-    , data_i_index_, data_ibegin_, data_j_index_, data_jbegin_, data_ni_, data_nj_, domain_ref_  &
-    , i_index_, ibegin_, j_index_, jbegin_, latvalue_1d_, latvalue_2d_, long_name_, lonvalue_1d_  &
-    , lonvalue_2d_, mask_1d_, mask_2d_, name_, ni_, ni_glo_, nj_, nj_glo_, nvertex_, prec_, standard_name_  &
-    , type_ )
+    ( domain_hdl, area_, bounds_lat_1d_, bounds_lat_2d_, bounds_lat_name_, bounds_lon_1d_, bounds_lon_2d_  &
+    , bounds_lon_name_, comment_, data_dim_, data_i_index_, data_ibegin_, data_j_index_, data_jbegin_  &
+    , data_ni_, data_nj_, dim_i_name_, dim_j_name_, domain_ref_, i_index_, ibegin_, j_index_, jbegin_  &
+    , lat_name_, latvalue_1d_, latvalue_2d_, lon_name_, long_name_, lonvalue_1d_, lonvalue_2d_, mask_1d_  &
+    , mask_2d_, name_, ni_, ni_glo_, nj_, nj_glo_, nvertex_, prec_, standard_name_, type_ )
 
     IMPLICIT NONE
@@ -841,8 +993,14 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: bounds_lat_2d_
       LOGICAL(KIND=C_BOOL) :: bounds_lat_2d__tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: bounds_lat_name_
+      LOGICAL(KIND=C_BOOL) :: bounds_lat_name__tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: bounds_lon_1d_
       LOGICAL(KIND=C_BOOL) :: bounds_lon_1d__tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: bounds_lon_2d_
       LOGICAL(KIND=C_BOOL) :: bounds_lon_2d__tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: bounds_lon_name_
+      LOGICAL(KIND=C_BOOL) :: bounds_lon_name__tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: comment_
+      LOGICAL(KIND=C_BOOL) :: comment__tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: data_dim_
       LOGICAL(KIND=C_BOOL) :: data_dim__tmp
@@ -859,4 +1017,8 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: data_nj_
       LOGICAL(KIND=C_BOOL) :: data_nj__tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: dim_i_name_
+      LOGICAL(KIND=C_BOOL) :: dim_i_name__tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: dim_j_name_
+      LOGICAL(KIND=C_BOOL) :: dim_j_name__tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: domain_ref_
       LOGICAL(KIND=C_BOOL) :: domain_ref__tmp
@@ -869,8 +1031,12 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: jbegin_
       LOGICAL(KIND=C_BOOL) :: jbegin__tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: lat_name_
+      LOGICAL(KIND=C_BOOL) :: lat_name__tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: latvalue_1d_
       LOGICAL(KIND=C_BOOL) :: latvalue_1d__tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: latvalue_2d_
       LOGICAL(KIND=C_BOOL) :: latvalue_2d__tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: lon_name_
+      LOGICAL(KIND=C_BOOL) :: lon_name__tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: long_name_
       LOGICAL(KIND=C_BOOL) :: long_name__tmp
@@ -920,4 +1086,10 @@
       ENDIF
 
+      IF (PRESENT(bounds_lat_name_)) THEN
+        bounds_lat_name__tmp = cxios_is_defined_domain_bounds_lat_name &
+      (domain_hdl%daddr)
+        bounds_lat_name_ = bounds_lat_name__tmp
+      ENDIF
+
       IF (PRESENT(bounds_lon_1d_)) THEN
         bounds_lon_1d__tmp = cxios_is_defined_domain_bounds_lon_1d &
@@ -932,4 +1104,16 @@
       ENDIF
 
+      IF (PRESENT(bounds_lon_name_)) THEN
+        bounds_lon_name__tmp = cxios_is_defined_domain_bounds_lon_name &
+      (domain_hdl%daddr)
+        bounds_lon_name_ = bounds_lon_name__tmp
+      ENDIF
+
+      IF (PRESENT(comment_)) THEN
+        comment__tmp = cxios_is_defined_domain_comment &
+      (domain_hdl%daddr)
+        comment_ = comment__tmp
+      ENDIF
+
       IF (PRESENT(data_dim_)) THEN
         data_dim__tmp = cxios_is_defined_domain_data_dim &
@@ -974,4 +1158,16 @@
       ENDIF
 
+      IF (PRESENT(dim_i_name_)) THEN
+        dim_i_name__tmp = cxios_is_defined_domain_dim_i_name &
+      (domain_hdl%daddr)
+        dim_i_name_ = dim_i_name__tmp
+      ENDIF
+
+      IF (PRESENT(dim_j_name_)) THEN
+        dim_j_name__tmp = cxios_is_defined_domain_dim_j_name &
+      (domain_hdl%daddr)
+        dim_j_name_ = dim_j_name__tmp
+      ENDIF
+
       IF (PRESENT(domain_ref_)) THEN
         domain_ref__tmp = cxios_is_defined_domain_domain_ref &
@@ -1004,4 +1200,10 @@
       ENDIF
 
+      IF (PRESENT(lat_name_)) THEN
+        lat_name__tmp = cxios_is_defined_domain_lat_name &
+      (domain_hdl%daddr)
+        lat_name_ = lat_name__tmp
+      ENDIF
+
       IF (PRESENT(latvalue_1d_)) THEN
         latvalue_1d__tmp = cxios_is_defined_domain_latvalue_1d &
@@ -1016,4 +1218,10 @@
       ENDIF
 
+      IF (PRESENT(lon_name_)) THEN
+        lon_name__tmp = cxios_is_defined_domain_lon_name &
+      (domain_hdl%daddr)
+        lon_name_ = lon_name__tmp
+      ENDIF
+
       IF (PRESENT(long_name_)) THEN
         long_name__tmp = cxios_is_defined_domain_long_name &
Index: /XIOS/trunk/src/interface/fortran_attr/idomaingroup_attr.F90
===================================================================
--- /XIOS/trunk/src/interface/fortran_attr/idomaingroup_attr.F90	(revision 1536)
+++ /XIOS/trunk/src/interface/fortran_attr/idomaingroup_attr.F90	(revision 1537)
@@ -12,8 +12,9 @@
 
   SUBROUTINE xios(set_domaingroup_attr)  &
-    ( domaingroup_id, area, bounds_lat_1d, bounds_lat_2d, bounds_lon_1d, bounds_lon_2d, data_dim  &
-    , data_i_index, data_ibegin, data_j_index, data_jbegin, data_ni, data_nj, domain_ref, group_ref  &
-    , i_index, ibegin, j_index, jbegin, latvalue_1d, latvalue_2d, long_name, lonvalue_1d, lonvalue_2d  &
-    , mask_1d, mask_2d, name, ni, ni_glo, nj, nj_glo, nvertex, prec, standard_name, type )
+    ( domaingroup_id, area, bounds_lat_1d, bounds_lat_2d, bounds_lat_name, bounds_lon_1d, bounds_lon_2d  &
+    , bounds_lon_name, comment, data_dim, data_i_index, data_ibegin, data_j_index, data_jbegin, data_ni  &
+    , data_nj, dim_i_name, dim_j_name, domain_ref, group_ref, i_index, ibegin, j_index, jbegin, lat_name  &
+    , latvalue_1d, latvalue_2d, lon_name, long_name, lonvalue_1d, lonvalue_2d, mask_1d, mask_2d  &
+    , name, ni, ni_glo, nj, nj_glo, nvertex, prec, standard_name, type )
 
     IMPLICIT NONE
@@ -23,6 +24,9 @@
       REAL (KIND=8) , OPTIONAL, INTENT(IN) :: bounds_lat_1d(:,:)
       REAL (KIND=8) , OPTIONAL, INTENT(IN) :: bounds_lat_2d(:,:,:)
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: bounds_lat_name
       REAL (KIND=8) , OPTIONAL, INTENT(IN) :: bounds_lon_1d(:,:)
       REAL (KIND=8) , OPTIONAL, INTENT(IN) :: bounds_lon_2d(:,:,:)
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: bounds_lon_name
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: comment
       INTEGER  , OPTIONAL, INTENT(IN) :: data_dim
       INTEGER  , OPTIONAL, INTENT(IN) :: data_i_index(:)
@@ -32,4 +36,6 @@
       INTEGER  , OPTIONAL, INTENT(IN) :: data_ni
       INTEGER  , OPTIONAL, INTENT(IN) :: data_nj
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: dim_i_name
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: dim_j_name
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: domain_ref
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: group_ref
@@ -38,6 +44,8 @@
       INTEGER  , OPTIONAL, INTENT(IN) :: j_index(:)
       INTEGER  , OPTIONAL, INTENT(IN) :: jbegin
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: lat_name
       REAL (KIND=8) , OPTIONAL, INTENT(IN) :: latvalue_1d(:)
       REAL (KIND=8) , OPTIONAL, INTENT(IN) :: latvalue_2d(:,:)
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: lon_name
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: long_name
       REAL (KIND=8) , OPTIONAL, INTENT(IN) :: lonvalue_1d(:)
@@ -60,16 +68,18 @@
       (domaingroup_id,domaingroup_hdl)
       CALL xios(set_domaingroup_attr_hdl_)   &
-      ( domaingroup_hdl, area, bounds_lat_1d, bounds_lat_2d, bounds_lon_1d, bounds_lon_2d, data_dim  &
-      , data_i_index, data_ibegin, data_j_index, data_jbegin, data_ni, data_nj, domain_ref, group_ref  &
-      , i_index, ibegin, j_index, jbegin, latvalue_1d, latvalue_2d, long_name, lonvalue_1d, lonvalue_2d  &
-      , mask_1d, mask_2d, name, ni, ni_glo, nj, nj_glo, nvertex, prec, standard_name, type )
+      ( domaingroup_hdl, area, bounds_lat_1d, bounds_lat_2d, bounds_lat_name, bounds_lon_1d, bounds_lon_2d  &
+      , bounds_lon_name, comment, data_dim, data_i_index, data_ibegin, data_j_index, data_jbegin, data_ni  &
+      , data_nj, dim_i_name, dim_j_name, domain_ref, group_ref, i_index, ibegin, j_index, jbegin, lat_name  &
+      , latvalue_1d, latvalue_2d, lon_name, long_name, lonvalue_1d, lonvalue_2d, mask_1d, mask_2d  &
+      , name, ni, ni_glo, nj, nj_glo, nvertex, prec, standard_name, type )
 
   END SUBROUTINE xios(set_domaingroup_attr)
 
   SUBROUTINE xios(set_domaingroup_attr_hdl)  &
-    ( domaingroup_hdl, area, bounds_lat_1d, bounds_lat_2d, bounds_lon_1d, bounds_lon_2d, data_dim  &
-    , data_i_index, data_ibegin, data_j_index, data_jbegin, data_ni, data_nj, domain_ref, group_ref  &
-    , i_index, ibegin, j_index, jbegin, latvalue_1d, latvalue_2d, long_name, lonvalue_1d, lonvalue_2d  &
-    , mask_1d, mask_2d, name, ni, ni_glo, nj, nj_glo, nvertex, prec, standard_name, type )
+    ( domaingroup_hdl, area, bounds_lat_1d, bounds_lat_2d, bounds_lat_name, bounds_lon_1d, bounds_lon_2d  &
+    , bounds_lon_name, comment, data_dim, data_i_index, data_ibegin, data_j_index, data_jbegin, data_ni  &
+    , data_nj, dim_i_name, dim_j_name, domain_ref, group_ref, i_index, ibegin, j_index, jbegin, lat_name  &
+    , latvalue_1d, latvalue_2d, lon_name, long_name, lonvalue_1d, lonvalue_2d, mask_1d, mask_2d  &
+    , name, ni, ni_glo, nj, nj_glo, nvertex, prec, standard_name, type )
 
     IMPLICIT NONE
@@ -78,6 +88,9 @@
       REAL (KIND=8) , OPTIONAL, INTENT(IN) :: bounds_lat_1d(:,:)
       REAL (KIND=8) , OPTIONAL, INTENT(IN) :: bounds_lat_2d(:,:,:)
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: bounds_lat_name
       REAL (KIND=8) , OPTIONAL, INTENT(IN) :: bounds_lon_1d(:,:)
       REAL (KIND=8) , OPTIONAL, INTENT(IN) :: bounds_lon_2d(:,:,:)
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: bounds_lon_name
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: comment
       INTEGER  , OPTIONAL, INTENT(IN) :: data_dim
       INTEGER  , OPTIONAL, INTENT(IN) :: data_i_index(:)
@@ -87,4 +100,6 @@
       INTEGER  , OPTIONAL, INTENT(IN) :: data_ni
       INTEGER  , OPTIONAL, INTENT(IN) :: data_nj
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: dim_i_name
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: dim_j_name
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: domain_ref
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: group_ref
@@ -93,6 +108,8 @@
       INTEGER  , OPTIONAL, INTENT(IN) :: j_index(:)
       INTEGER  , OPTIONAL, INTENT(IN) :: jbegin
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: lat_name
       REAL (KIND=8) , OPTIONAL, INTENT(IN) :: latvalue_1d(:)
       REAL (KIND=8) , OPTIONAL, INTENT(IN) :: latvalue_2d(:,:)
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: lon_name
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: long_name
       REAL (KIND=8) , OPTIONAL, INTENT(IN) :: lonvalue_1d(:)
@@ -113,17 +130,19 @@
 
       CALL xios(set_domaingroup_attr_hdl_)  &
-      ( domaingroup_hdl, area, bounds_lat_1d, bounds_lat_2d, bounds_lon_1d, bounds_lon_2d, data_dim  &
-      , data_i_index, data_ibegin, data_j_index, data_jbegin, data_ni, data_nj, domain_ref, group_ref  &
-      , i_index, ibegin, j_index, jbegin, latvalue_1d, latvalue_2d, long_name, lonvalue_1d, lonvalue_2d  &
-      , mask_1d, mask_2d, name, ni, ni_glo, nj, nj_glo, nvertex, prec, standard_name, type )
+      ( domaingroup_hdl, area, bounds_lat_1d, bounds_lat_2d, bounds_lat_name, bounds_lon_1d, bounds_lon_2d  &
+      , bounds_lon_name, comment, data_dim, data_i_index, data_ibegin, data_j_index, data_jbegin, data_ni  &
+      , data_nj, dim_i_name, dim_j_name, domain_ref, group_ref, i_index, ibegin, j_index, jbegin, lat_name  &
+      , latvalue_1d, latvalue_2d, lon_name, long_name, lonvalue_1d, lonvalue_2d, mask_1d, mask_2d  &
+      , name, ni, ni_glo, nj, nj_glo, nvertex, prec, standard_name, type )
 
   END SUBROUTINE xios(set_domaingroup_attr_hdl)
 
   SUBROUTINE xios(set_domaingroup_attr_hdl_)   &
-    ( domaingroup_hdl, area_, bounds_lat_1d_, bounds_lat_2d_, bounds_lon_1d_, bounds_lon_2d_, data_dim_  &
-    , data_i_index_, data_ibegin_, data_j_index_, data_jbegin_, data_ni_, data_nj_, domain_ref_  &
-    , group_ref_, i_index_, ibegin_, j_index_, jbegin_, latvalue_1d_, latvalue_2d_, long_name_, lonvalue_1d_  &
-    , lonvalue_2d_, mask_1d_, mask_2d_, name_, ni_, ni_glo_, nj_, nj_glo_, nvertex_, prec_, standard_name_  &
-    , type_ )
+    ( domaingroup_hdl, area_, bounds_lat_1d_, bounds_lat_2d_, bounds_lat_name_, bounds_lon_1d_, bounds_lon_2d_  &
+    , bounds_lon_name_, comment_, data_dim_, data_i_index_, data_ibegin_, data_j_index_, data_jbegin_  &
+    , data_ni_, data_nj_, dim_i_name_, dim_j_name_, domain_ref_, group_ref_, i_index_, ibegin_, j_index_  &
+    , jbegin_, lat_name_, latvalue_1d_, latvalue_2d_, lon_name_, long_name_, lonvalue_1d_, lonvalue_2d_  &
+    , mask_1d_, mask_2d_, name_, ni_, ni_glo_, nj_, nj_glo_, nvertex_, prec_, standard_name_, type_  &
+     )
 
     IMPLICIT NONE
@@ -132,6 +151,9 @@
       REAL (KIND=8) , OPTIONAL, INTENT(IN) :: bounds_lat_1d_(:,:)
       REAL (KIND=8) , OPTIONAL, INTENT(IN) :: bounds_lat_2d_(:,:,:)
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: bounds_lat_name_
       REAL (KIND=8) , OPTIONAL, INTENT(IN) :: bounds_lon_1d_(:,:)
       REAL (KIND=8) , OPTIONAL, INTENT(IN) :: bounds_lon_2d_(:,:,:)
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: bounds_lon_name_
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: comment_
       INTEGER  , OPTIONAL, INTENT(IN) :: data_dim_
       INTEGER  , OPTIONAL, INTENT(IN) :: data_i_index_(:)
@@ -141,4 +163,6 @@
       INTEGER  , OPTIONAL, INTENT(IN) :: data_ni_
       INTEGER  , OPTIONAL, INTENT(IN) :: data_nj_
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: dim_i_name_
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: dim_j_name_
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: domain_ref_
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: group_ref_
@@ -147,6 +171,8 @@
       INTEGER  , OPTIONAL, INTENT(IN) :: j_index_(:)
       INTEGER  , OPTIONAL, INTENT(IN) :: jbegin_
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: lat_name_
       REAL (KIND=8) , OPTIONAL, INTENT(IN) :: latvalue_1d_(:)
       REAL (KIND=8) , OPTIONAL, INTENT(IN) :: latvalue_2d_(:,:)
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: lon_name_
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: long_name_
       REAL (KIND=8) , OPTIONAL, INTENT(IN) :: lonvalue_1d_(:)
@@ -181,4 +207,9 @@
       ENDIF
 
+      IF (PRESENT(bounds_lat_name_)) THEN
+        CALL cxios_set_domaingroup_bounds_lat_name &
+      (domaingroup_hdl%daddr, bounds_lat_name_, len(bounds_lat_name_))
+      ENDIF
+
       IF (PRESENT(bounds_lon_1d_)) THEN
         CALL cxios_set_domaingroup_bounds_lon_1d &
@@ -191,4 +222,14 @@
       ENDIF
 
+      IF (PRESENT(bounds_lon_name_)) THEN
+        CALL cxios_set_domaingroup_bounds_lon_name &
+      (domaingroup_hdl%daddr, bounds_lon_name_, len(bounds_lon_name_))
+      ENDIF
+
+      IF (PRESENT(comment_)) THEN
+        CALL cxios_set_domaingroup_comment &
+      (domaingroup_hdl%daddr, comment_, len(comment_))
+      ENDIF
+
       IF (PRESENT(data_dim_)) THEN
         CALL cxios_set_domaingroup_data_dim &
@@ -226,4 +267,14 @@
       ENDIF
 
+      IF (PRESENT(dim_i_name_)) THEN
+        CALL cxios_set_domaingroup_dim_i_name &
+      (domaingroup_hdl%daddr, dim_i_name_, len(dim_i_name_))
+      ENDIF
+
+      IF (PRESENT(dim_j_name_)) THEN
+        CALL cxios_set_domaingroup_dim_j_name &
+      (domaingroup_hdl%daddr, dim_j_name_, len(dim_j_name_))
+      ENDIF
+
       IF (PRESENT(domain_ref_)) THEN
         CALL cxios_set_domaingroup_domain_ref &
@@ -256,4 +307,9 @@
       ENDIF
 
+      IF (PRESENT(lat_name_)) THEN
+        CALL cxios_set_domaingroup_lat_name &
+      (domaingroup_hdl%daddr, lat_name_, len(lat_name_))
+      ENDIF
+
       IF (PRESENT(latvalue_1d_)) THEN
         CALL cxios_set_domaingroup_latvalue_1d &
@@ -264,4 +320,9 @@
         CALL cxios_set_domaingroup_latvalue_2d &
       (domaingroup_hdl%daddr, latvalue_2d_, SHAPE(latvalue_2d_))
+      ENDIF
+
+      IF (PRESENT(lon_name_)) THEN
+        CALL cxios_set_domaingroup_lon_name &
+      (domaingroup_hdl%daddr, lon_name_, len(lon_name_))
       ENDIF
 
@@ -343,8 +404,9 @@
 
   SUBROUTINE xios(get_domaingroup_attr)  &
-    ( domaingroup_id, area, bounds_lat_1d, bounds_lat_2d, bounds_lon_1d, bounds_lon_2d, data_dim  &
-    , data_i_index, data_ibegin, data_j_index, data_jbegin, data_ni, data_nj, domain_ref, group_ref  &
-    , i_index, ibegin, j_index, jbegin, latvalue_1d, latvalue_2d, long_name, lonvalue_1d, lonvalue_2d  &
-    , mask_1d, mask_2d, name, ni, ni_glo, nj, nj_glo, nvertex, prec, standard_name, type )
+    ( domaingroup_id, area, bounds_lat_1d, bounds_lat_2d, bounds_lat_name, bounds_lon_1d, bounds_lon_2d  &
+    , bounds_lon_name, comment, data_dim, data_i_index, data_ibegin, data_j_index, data_jbegin, data_ni  &
+    , data_nj, dim_i_name, dim_j_name, domain_ref, group_ref, i_index, ibegin, j_index, jbegin, lat_name  &
+    , latvalue_1d, latvalue_2d, lon_name, long_name, lonvalue_1d, lonvalue_2d, mask_1d, mask_2d  &
+    , name, ni, ni_glo, nj, nj_glo, nvertex, prec, standard_name, type )
 
     IMPLICIT NONE
@@ -354,6 +416,9 @@
       REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: bounds_lat_1d(:,:)
       REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: bounds_lat_2d(:,:,:)
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: bounds_lat_name
       REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: bounds_lon_1d(:,:)
       REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: bounds_lon_2d(:,:,:)
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: bounds_lon_name
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: comment
       INTEGER  , OPTIONAL, INTENT(OUT) :: data_dim
       INTEGER  , OPTIONAL, INTENT(OUT) :: data_i_index(:)
@@ -363,4 +428,6 @@
       INTEGER  , OPTIONAL, INTENT(OUT) :: data_ni
       INTEGER  , OPTIONAL, INTENT(OUT) :: data_nj
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: dim_i_name
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: dim_j_name
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: domain_ref
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: group_ref
@@ -369,6 +436,8 @@
       INTEGER  , OPTIONAL, INTENT(OUT) :: j_index(:)
       INTEGER  , OPTIONAL, INTENT(OUT) :: jbegin
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: lat_name
       REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: latvalue_1d(:)
       REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: latvalue_2d(:,:)
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: lon_name
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: long_name
       REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: lonvalue_1d(:)
@@ -391,16 +460,18 @@
       (domaingroup_id,domaingroup_hdl)
       CALL xios(get_domaingroup_attr_hdl_)   &
-      ( domaingroup_hdl, area, bounds_lat_1d, bounds_lat_2d, bounds_lon_1d, bounds_lon_2d, data_dim  &
-      , data_i_index, data_ibegin, data_j_index, data_jbegin, data_ni, data_nj, domain_ref, group_ref  &
-      , i_index, ibegin, j_index, jbegin, latvalue_1d, latvalue_2d, long_name, lonvalue_1d, lonvalue_2d  &
-      , mask_1d, mask_2d, name, ni, ni_glo, nj, nj_glo, nvertex, prec, standard_name, type )
+      ( domaingroup_hdl, area, bounds_lat_1d, bounds_lat_2d, bounds_lat_name, bounds_lon_1d, bounds_lon_2d  &
+      , bounds_lon_name, comment, data_dim, data_i_index, data_ibegin, data_j_index, data_jbegin, data_ni  &
+      , data_nj, dim_i_name, dim_j_name, domain_ref, group_ref, i_index, ibegin, j_index, jbegin, lat_name  &
+      , latvalue_1d, latvalue_2d, lon_name, long_name, lonvalue_1d, lonvalue_2d, mask_1d, mask_2d  &
+      , name, ni, ni_glo, nj, nj_glo, nvertex, prec, standard_name, type )
 
   END SUBROUTINE xios(get_domaingroup_attr)
 
   SUBROUTINE xios(get_domaingroup_attr_hdl)  &
-    ( domaingroup_hdl, area, bounds_lat_1d, bounds_lat_2d, bounds_lon_1d, bounds_lon_2d, data_dim  &
-    , data_i_index, data_ibegin, data_j_index, data_jbegin, data_ni, data_nj, domain_ref, group_ref  &
-    , i_index, ibegin, j_index, jbegin, latvalue_1d, latvalue_2d, long_name, lonvalue_1d, lonvalue_2d  &
-    , mask_1d, mask_2d, name, ni, ni_glo, nj, nj_glo, nvertex, prec, standard_name, type )
+    ( domaingroup_hdl, area, bounds_lat_1d, bounds_lat_2d, bounds_lat_name, bounds_lon_1d, bounds_lon_2d  &
+    , bounds_lon_name, comment, data_dim, data_i_index, data_ibegin, data_j_index, data_jbegin, data_ni  &
+    , data_nj, dim_i_name, dim_j_name, domain_ref, group_ref, i_index, ibegin, j_index, jbegin, lat_name  &
+    , latvalue_1d, latvalue_2d, lon_name, long_name, lonvalue_1d, lonvalue_2d, mask_1d, mask_2d  &
+    , name, ni, ni_glo, nj, nj_glo, nvertex, prec, standard_name, type )
 
     IMPLICIT NONE
@@ -409,6 +480,9 @@
       REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: bounds_lat_1d(:,:)
       REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: bounds_lat_2d(:,:,:)
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: bounds_lat_name
       REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: bounds_lon_1d(:,:)
       REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: bounds_lon_2d(:,:,:)
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: bounds_lon_name
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: comment
       INTEGER  , OPTIONAL, INTENT(OUT) :: data_dim
       INTEGER  , OPTIONAL, INTENT(OUT) :: data_i_index(:)
@@ -418,4 +492,6 @@
       INTEGER  , OPTIONAL, INTENT(OUT) :: data_ni
       INTEGER  , OPTIONAL, INTENT(OUT) :: data_nj
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: dim_i_name
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: dim_j_name
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: domain_ref
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: group_ref
@@ -424,6 +500,8 @@
       INTEGER  , OPTIONAL, INTENT(OUT) :: j_index(:)
       INTEGER  , OPTIONAL, INTENT(OUT) :: jbegin
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: lat_name
       REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: latvalue_1d(:)
       REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: latvalue_2d(:,:)
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: lon_name
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: long_name
       REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: lonvalue_1d(:)
@@ -444,17 +522,19 @@
 
       CALL xios(get_domaingroup_attr_hdl_)  &
-      ( domaingroup_hdl, area, bounds_lat_1d, bounds_lat_2d, bounds_lon_1d, bounds_lon_2d, data_dim  &
-      , data_i_index, data_ibegin, data_j_index, data_jbegin, data_ni, data_nj, domain_ref, group_ref  &
-      , i_index, ibegin, j_index, jbegin, latvalue_1d, latvalue_2d, long_name, lonvalue_1d, lonvalue_2d  &
-      , mask_1d, mask_2d, name, ni, ni_glo, nj, nj_glo, nvertex, prec, standard_name, type )
+      ( domaingroup_hdl, area, bounds_lat_1d, bounds_lat_2d, bounds_lat_name, bounds_lon_1d, bounds_lon_2d  &
+      , bounds_lon_name, comment, data_dim, data_i_index, data_ibegin, data_j_index, data_jbegin, data_ni  &
+      , data_nj, dim_i_name, dim_j_name, domain_ref, group_ref, i_index, ibegin, j_index, jbegin, lat_name  &
+      , latvalue_1d, latvalue_2d, lon_name, long_name, lonvalue_1d, lonvalue_2d, mask_1d, mask_2d  &
+      , name, ni, ni_glo, nj, nj_glo, nvertex, prec, standard_name, type )
 
   END SUBROUTINE xios(get_domaingroup_attr_hdl)
 
   SUBROUTINE xios(get_domaingroup_attr_hdl_)   &
-    ( domaingroup_hdl, area_, bounds_lat_1d_, bounds_lat_2d_, bounds_lon_1d_, bounds_lon_2d_, data_dim_  &
-    , data_i_index_, data_ibegin_, data_j_index_, data_jbegin_, data_ni_, data_nj_, domain_ref_  &
-    , group_ref_, i_index_, ibegin_, j_index_, jbegin_, latvalue_1d_, latvalue_2d_, long_name_, lonvalue_1d_  &
-    , lonvalue_2d_, mask_1d_, mask_2d_, name_, ni_, ni_glo_, nj_, nj_glo_, nvertex_, prec_, standard_name_  &
-    , type_ )
+    ( domaingroup_hdl, area_, bounds_lat_1d_, bounds_lat_2d_, bounds_lat_name_, bounds_lon_1d_, bounds_lon_2d_  &
+    , bounds_lon_name_, comment_, data_dim_, data_i_index_, data_ibegin_, data_j_index_, data_jbegin_  &
+    , data_ni_, data_nj_, dim_i_name_, dim_j_name_, domain_ref_, group_ref_, i_index_, ibegin_, j_index_  &
+    , jbegin_, lat_name_, latvalue_1d_, latvalue_2d_, lon_name_, long_name_, lonvalue_1d_, lonvalue_2d_  &
+    , mask_1d_, mask_2d_, name_, ni_, ni_glo_, nj_, nj_glo_, nvertex_, prec_, standard_name_, type_  &
+     )
 
     IMPLICIT NONE
@@ -463,6 +543,9 @@
       REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: bounds_lat_1d_(:,:)
       REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: bounds_lat_2d_(:,:,:)
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: bounds_lat_name_
       REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: bounds_lon_1d_(:,:)
       REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: bounds_lon_2d_(:,:,:)
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: bounds_lon_name_
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: comment_
       INTEGER  , OPTIONAL, INTENT(OUT) :: data_dim_
       INTEGER  , OPTIONAL, INTENT(OUT) :: data_i_index_(:)
@@ -472,4 +555,6 @@
       INTEGER  , OPTIONAL, INTENT(OUT) :: data_ni_
       INTEGER  , OPTIONAL, INTENT(OUT) :: data_nj_
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: dim_i_name_
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: dim_j_name_
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: domain_ref_
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: group_ref_
@@ -478,6 +563,8 @@
       INTEGER  , OPTIONAL, INTENT(OUT) :: j_index_(:)
       INTEGER  , OPTIONAL, INTENT(OUT) :: jbegin_
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: lat_name_
       REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: latvalue_1d_(:)
       REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: latvalue_2d_(:,:)
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: lon_name_
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: long_name_
       REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: lonvalue_1d_(:)
@@ -512,4 +599,9 @@
       ENDIF
 
+      IF (PRESENT(bounds_lat_name_)) THEN
+        CALL cxios_get_domaingroup_bounds_lat_name &
+      (domaingroup_hdl%daddr, bounds_lat_name_, len(bounds_lat_name_))
+      ENDIF
+
       IF (PRESENT(bounds_lon_1d_)) THEN
         CALL cxios_get_domaingroup_bounds_lon_1d &
@@ -522,4 +614,14 @@
       ENDIF
 
+      IF (PRESENT(bounds_lon_name_)) THEN
+        CALL cxios_get_domaingroup_bounds_lon_name &
+      (domaingroup_hdl%daddr, bounds_lon_name_, len(bounds_lon_name_))
+      ENDIF
+
+      IF (PRESENT(comment_)) THEN
+        CALL cxios_get_domaingroup_comment &
+      (domaingroup_hdl%daddr, comment_, len(comment_))
+      ENDIF
+
       IF (PRESENT(data_dim_)) THEN
         CALL cxios_get_domaingroup_data_dim &
@@ -557,4 +659,14 @@
       ENDIF
 
+      IF (PRESENT(dim_i_name_)) THEN
+        CALL cxios_get_domaingroup_dim_i_name &
+      (domaingroup_hdl%daddr, dim_i_name_, len(dim_i_name_))
+      ENDIF
+
+      IF (PRESENT(dim_j_name_)) THEN
+        CALL cxios_get_domaingroup_dim_j_name &
+      (domaingroup_hdl%daddr, dim_j_name_, len(dim_j_name_))
+      ENDIF
+
       IF (PRESENT(domain_ref_)) THEN
         CALL cxios_get_domaingroup_domain_ref &
@@ -587,4 +699,9 @@
       ENDIF
 
+      IF (PRESENT(lat_name_)) THEN
+        CALL cxios_get_domaingroup_lat_name &
+      (domaingroup_hdl%daddr, lat_name_, len(lat_name_))
+      ENDIF
+
       IF (PRESENT(latvalue_1d_)) THEN
         CALL cxios_get_domaingroup_latvalue_1d &
@@ -595,4 +712,9 @@
         CALL cxios_get_domaingroup_latvalue_2d &
       (domaingroup_hdl%daddr, latvalue_2d_, SHAPE(latvalue_2d_))
+      ENDIF
+
+      IF (PRESENT(lon_name_)) THEN
+        CALL cxios_get_domaingroup_lon_name &
+      (domaingroup_hdl%daddr, lon_name_, len(lon_name_))
       ENDIF
 
@@ -674,8 +796,9 @@
 
   SUBROUTINE xios(is_defined_domaingroup_attr)  &
-    ( domaingroup_id, area, bounds_lat_1d, bounds_lat_2d, bounds_lon_1d, bounds_lon_2d, data_dim  &
-    , data_i_index, data_ibegin, data_j_index, data_jbegin, data_ni, data_nj, domain_ref, group_ref  &
-    , i_index, ibegin, j_index, jbegin, latvalue_1d, latvalue_2d, long_name, lonvalue_1d, lonvalue_2d  &
-    , mask_1d, mask_2d, name, ni, ni_glo, nj, nj_glo, nvertex, prec, standard_name, type )
+    ( domaingroup_id, area, bounds_lat_1d, bounds_lat_2d, bounds_lat_name, bounds_lon_1d, bounds_lon_2d  &
+    , bounds_lon_name, comment, data_dim, data_i_index, data_ibegin, data_j_index, data_jbegin, data_ni  &
+    , data_nj, dim_i_name, dim_j_name, domain_ref, group_ref, i_index, ibegin, j_index, jbegin, lat_name  &
+    , latvalue_1d, latvalue_2d, lon_name, long_name, lonvalue_1d, lonvalue_2d, mask_1d, mask_2d  &
+    , name, ni, ni_glo, nj, nj_glo, nvertex, prec, standard_name, type )
 
     IMPLICIT NONE
@@ -688,8 +811,14 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: bounds_lat_2d
       LOGICAL(KIND=C_BOOL) :: bounds_lat_2d_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: bounds_lat_name
+      LOGICAL(KIND=C_BOOL) :: bounds_lat_name_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: bounds_lon_1d
       LOGICAL(KIND=C_BOOL) :: bounds_lon_1d_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: bounds_lon_2d
       LOGICAL(KIND=C_BOOL) :: bounds_lon_2d_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: bounds_lon_name
+      LOGICAL(KIND=C_BOOL) :: bounds_lon_name_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: comment
+      LOGICAL(KIND=C_BOOL) :: comment_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: data_dim
       LOGICAL(KIND=C_BOOL) :: data_dim_tmp
@@ -706,4 +835,8 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: data_nj
       LOGICAL(KIND=C_BOOL) :: data_nj_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: dim_i_name
+      LOGICAL(KIND=C_BOOL) :: dim_i_name_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: dim_j_name
+      LOGICAL(KIND=C_BOOL) :: dim_j_name_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: domain_ref
       LOGICAL(KIND=C_BOOL) :: domain_ref_tmp
@@ -718,8 +851,12 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: jbegin
       LOGICAL(KIND=C_BOOL) :: jbegin_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: lat_name
+      LOGICAL(KIND=C_BOOL) :: lat_name_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: latvalue_1d
       LOGICAL(KIND=C_BOOL) :: latvalue_1d_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: latvalue_2d
       LOGICAL(KIND=C_BOOL) :: latvalue_2d_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: lon_name
+      LOGICAL(KIND=C_BOOL) :: lon_name_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: long_name
       LOGICAL(KIND=C_BOOL) :: long_name_tmp
@@ -754,16 +891,18 @@
       (domaingroup_id,domaingroup_hdl)
       CALL xios(is_defined_domaingroup_attr_hdl_)   &
-      ( domaingroup_hdl, area, bounds_lat_1d, bounds_lat_2d, bounds_lon_1d, bounds_lon_2d, data_dim  &
-      , data_i_index, data_ibegin, data_j_index, data_jbegin, data_ni, data_nj, domain_ref, group_ref  &
-      , i_index, ibegin, j_index, jbegin, latvalue_1d, latvalue_2d, long_name, lonvalue_1d, lonvalue_2d  &
-      , mask_1d, mask_2d, name, ni, ni_glo, nj, nj_glo, nvertex, prec, standard_name, type )
+      ( domaingroup_hdl, area, bounds_lat_1d, bounds_lat_2d, bounds_lat_name, bounds_lon_1d, bounds_lon_2d  &
+      , bounds_lon_name, comment, data_dim, data_i_index, data_ibegin, data_j_index, data_jbegin, data_ni  &
+      , data_nj, dim_i_name, dim_j_name, domain_ref, group_ref, i_index, ibegin, j_index, jbegin, lat_name  &
+      , latvalue_1d, latvalue_2d, lon_name, long_name, lonvalue_1d, lonvalue_2d, mask_1d, mask_2d  &
+      , name, ni, ni_glo, nj, nj_glo, nvertex, prec, standard_name, type )
 
   END SUBROUTINE xios(is_defined_domaingroup_attr)
 
   SUBROUTINE xios(is_defined_domaingroup_attr_hdl)  &
-    ( domaingroup_hdl, area, bounds_lat_1d, bounds_lat_2d, bounds_lon_1d, bounds_lon_2d, data_dim  &
-    , data_i_index, data_ibegin, data_j_index, data_jbegin, data_ni, data_nj, domain_ref, group_ref  &
-    , i_index, ibegin, j_index, jbegin, latvalue_1d, latvalue_2d, long_name, lonvalue_1d, lonvalue_2d  &
-    , mask_1d, mask_2d, name, ni, ni_glo, nj, nj_glo, nvertex, prec, standard_name, type )
+    ( domaingroup_hdl, area, bounds_lat_1d, bounds_lat_2d, bounds_lat_name, bounds_lon_1d, bounds_lon_2d  &
+    , bounds_lon_name, comment, data_dim, data_i_index, data_ibegin, data_j_index, data_jbegin, data_ni  &
+    , data_nj, dim_i_name, dim_j_name, domain_ref, group_ref, i_index, ibegin, j_index, jbegin, lat_name  &
+    , latvalue_1d, latvalue_2d, lon_name, long_name, lonvalue_1d, lonvalue_2d, mask_1d, mask_2d  &
+    , name, ni, ni_glo, nj, nj_glo, nvertex, prec, standard_name, type )
 
     IMPLICIT NONE
@@ -775,8 +914,14 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: bounds_lat_2d
       LOGICAL(KIND=C_BOOL) :: bounds_lat_2d_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: bounds_lat_name
+      LOGICAL(KIND=C_BOOL) :: bounds_lat_name_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: bounds_lon_1d
       LOGICAL(KIND=C_BOOL) :: bounds_lon_1d_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: bounds_lon_2d
       LOGICAL(KIND=C_BOOL) :: bounds_lon_2d_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: bounds_lon_name
+      LOGICAL(KIND=C_BOOL) :: bounds_lon_name_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: comment
+      LOGICAL(KIND=C_BOOL) :: comment_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: data_dim
       LOGICAL(KIND=C_BOOL) :: data_dim_tmp
@@ -793,4 +938,8 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: data_nj
       LOGICAL(KIND=C_BOOL) :: data_nj_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: dim_i_name
+      LOGICAL(KIND=C_BOOL) :: dim_i_name_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: dim_j_name
+      LOGICAL(KIND=C_BOOL) :: dim_j_name_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: domain_ref
       LOGICAL(KIND=C_BOOL) :: domain_ref_tmp
@@ -805,8 +954,12 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: jbegin
       LOGICAL(KIND=C_BOOL) :: jbegin_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: lat_name
+      LOGICAL(KIND=C_BOOL) :: lat_name_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: latvalue_1d
       LOGICAL(KIND=C_BOOL) :: latvalue_1d_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: latvalue_2d
       LOGICAL(KIND=C_BOOL) :: latvalue_2d_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: lon_name
+      LOGICAL(KIND=C_BOOL) :: lon_name_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: long_name
       LOGICAL(KIND=C_BOOL) :: long_name_tmp
@@ -839,17 +992,19 @@
 
       CALL xios(is_defined_domaingroup_attr_hdl_)  &
-      ( domaingroup_hdl, area, bounds_lat_1d, bounds_lat_2d, bounds_lon_1d, bounds_lon_2d, data_dim  &
-      , data_i_index, data_ibegin, data_j_index, data_jbegin, data_ni, data_nj, domain_ref, group_ref  &
-      , i_index, ibegin, j_index, jbegin, latvalue_1d, latvalue_2d, long_name, lonvalue_1d, lonvalue_2d  &
-      , mask_1d, mask_2d, name, ni, ni_glo, nj, nj_glo, nvertex, prec, standard_name, type )
+      ( domaingroup_hdl, area, bounds_lat_1d, bounds_lat_2d, bounds_lat_name, bounds_lon_1d, bounds_lon_2d  &
+      , bounds_lon_name, comment, data_dim, data_i_index, data_ibegin, data_j_index, data_jbegin, data_ni  &
+      , data_nj, dim_i_name, dim_j_name, domain_ref, group_ref, i_index, ibegin, j_index, jbegin, lat_name  &
+      , latvalue_1d, latvalue_2d, lon_name, long_name, lonvalue_1d, lonvalue_2d, mask_1d, mask_2d  &
+      , name, ni, ni_glo, nj, nj_glo, nvertex, prec, standard_name, type )
 
   END SUBROUTINE xios(is_defined_domaingroup_attr_hdl)
 
   SUBROUTINE xios(is_defined_domaingroup_attr_hdl_)   &
-    ( domaingroup_hdl, area_, bounds_lat_1d_, bounds_lat_2d_, bounds_lon_1d_, bounds_lon_2d_, data_dim_  &
-    , data_i_index_, data_ibegin_, data_j_index_, data_jbegin_, data_ni_, data_nj_, domain_ref_  &
-    , group_ref_, i_index_, ibegin_, j_index_, jbegin_, latvalue_1d_, latvalue_2d_, long_name_, lonvalue_1d_  &
-    , lonvalue_2d_, mask_1d_, mask_2d_, name_, ni_, ni_glo_, nj_, nj_glo_, nvertex_, prec_, standard_name_  &
-    , type_ )
+    ( domaingroup_hdl, area_, bounds_lat_1d_, bounds_lat_2d_, bounds_lat_name_, bounds_lon_1d_, bounds_lon_2d_  &
+    , bounds_lon_name_, comment_, data_dim_, data_i_index_, data_ibegin_, data_j_index_, data_jbegin_  &
+    , data_ni_, data_nj_, dim_i_name_, dim_j_name_, domain_ref_, group_ref_, i_index_, ibegin_, j_index_  &
+    , jbegin_, lat_name_, latvalue_1d_, latvalue_2d_, lon_name_, long_name_, lonvalue_1d_, lonvalue_2d_  &
+    , mask_1d_, mask_2d_, name_, ni_, ni_glo_, nj_, nj_glo_, nvertex_, prec_, standard_name_, type_  &
+     )
 
     IMPLICIT NONE
@@ -861,8 +1016,14 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: bounds_lat_2d_
       LOGICAL(KIND=C_BOOL) :: bounds_lat_2d__tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: bounds_lat_name_
+      LOGICAL(KIND=C_BOOL) :: bounds_lat_name__tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: bounds_lon_1d_
       LOGICAL(KIND=C_BOOL) :: bounds_lon_1d__tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: bounds_lon_2d_
       LOGICAL(KIND=C_BOOL) :: bounds_lon_2d__tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: bounds_lon_name_
+      LOGICAL(KIND=C_BOOL) :: bounds_lon_name__tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: comment_
+      LOGICAL(KIND=C_BOOL) :: comment__tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: data_dim_
       LOGICAL(KIND=C_BOOL) :: data_dim__tmp
@@ -879,4 +1040,8 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: data_nj_
       LOGICAL(KIND=C_BOOL) :: data_nj__tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: dim_i_name_
+      LOGICAL(KIND=C_BOOL) :: dim_i_name__tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: dim_j_name_
+      LOGICAL(KIND=C_BOOL) :: dim_j_name__tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: domain_ref_
       LOGICAL(KIND=C_BOOL) :: domain_ref__tmp
@@ -891,8 +1056,12 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: jbegin_
       LOGICAL(KIND=C_BOOL) :: jbegin__tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: lat_name_
+      LOGICAL(KIND=C_BOOL) :: lat_name__tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: latvalue_1d_
       LOGICAL(KIND=C_BOOL) :: latvalue_1d__tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: latvalue_2d_
       LOGICAL(KIND=C_BOOL) :: latvalue_2d__tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: lon_name_
+      LOGICAL(KIND=C_BOOL) :: lon_name__tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: long_name_
       LOGICAL(KIND=C_BOOL) :: long_name__tmp
@@ -942,4 +1111,10 @@
       ENDIF
 
+      IF (PRESENT(bounds_lat_name_)) THEN
+        bounds_lat_name__tmp = cxios_is_defined_domaingroup_bounds_lat_name &
+      (domaingroup_hdl%daddr)
+        bounds_lat_name_ = bounds_lat_name__tmp
+      ENDIF
+
       IF (PRESENT(bounds_lon_1d_)) THEN
         bounds_lon_1d__tmp = cxios_is_defined_domaingroup_bounds_lon_1d &
@@ -954,4 +1129,16 @@
       ENDIF
 
+      IF (PRESENT(bounds_lon_name_)) THEN
+        bounds_lon_name__tmp = cxios_is_defined_domaingroup_bounds_lon_name &
+      (domaingroup_hdl%daddr)
+        bounds_lon_name_ = bounds_lon_name__tmp
+      ENDIF
+
+      IF (PRESENT(comment_)) THEN
+        comment__tmp = cxios_is_defined_domaingroup_comment &
+      (domaingroup_hdl%daddr)
+        comment_ = comment__tmp
+      ENDIF
+
       IF (PRESENT(data_dim_)) THEN
         data_dim__tmp = cxios_is_defined_domaingroup_data_dim &
@@ -996,4 +1183,16 @@
       ENDIF
 
+      IF (PRESENT(dim_i_name_)) THEN
+        dim_i_name__tmp = cxios_is_defined_domaingroup_dim_i_name &
+      (domaingroup_hdl%daddr)
+        dim_i_name_ = dim_i_name__tmp
+      ENDIF
+
+      IF (PRESENT(dim_j_name_)) THEN
+        dim_j_name__tmp = cxios_is_defined_domaingroup_dim_j_name &
+      (domaingroup_hdl%daddr)
+        dim_j_name_ = dim_j_name__tmp
+      ENDIF
+
       IF (PRESENT(domain_ref_)) THEN
         domain_ref__tmp = cxios_is_defined_domaingroup_domain_ref &
@@ -1032,4 +1231,10 @@
       ENDIF
 
+      IF (PRESENT(lat_name_)) THEN
+        lat_name__tmp = cxios_is_defined_domaingroup_lat_name &
+      (domaingroup_hdl%daddr)
+        lat_name_ = lat_name__tmp
+      ENDIF
+
       IF (PRESENT(latvalue_1d_)) THEN
         latvalue_1d__tmp = cxios_is_defined_domaingroup_latvalue_1d &
@@ -1044,4 +1249,10 @@
       ENDIF
 
+      IF (PRESENT(lon_name_)) THEN
+        lon_name__tmp = cxios_is_defined_domaingroup_lon_name &
+      (domaingroup_hdl%daddr)
+        lon_name_ = lon_name__tmp
+      ENDIF
+
       IF (PRESENT(long_name_)) THEN
         long_name__tmp = cxios_is_defined_domaingroup_long_name &
Index: /XIOS/trunk/src/interface/fortran_attr/iduplicate_scalar_to_axis_attr.F90
===================================================================
--- /XIOS/trunk/src/interface/fortran_attr/iduplicate_scalar_to_axis_attr.F90	(revision 1537)
+++ /XIOS/trunk/src/interface/fortran_attr/iduplicate_scalar_to_axis_attr.F90	(revision 1537)
@@ -0,0 +1,112 @@
+! * ************************************************************************** *
+! *               Interface auto generated - do not modify                     *
+! * ************************************************************************** *
+#include "xios_fortran_prefix.hpp"
+
+MODULE iduplicate_scalar_to_axis_attr
+  USE, INTRINSIC :: ISO_C_BINDING
+  USE iduplicate_scalar_to_axis
+  USE duplicate_scalar_to_axis_interface_attr
+
+CONTAINS
+
+  SUBROUTINE xios(set_duplicate_scalar_to_axis_attr)  &
+    ( duplicate_scalar_to_axis_id )
+
+    IMPLICIT NONE
+      TYPE(txios(duplicate_scalar_to_axis))  :: duplicate_scalar_to_axis_hdl
+      CHARACTER(LEN=*), INTENT(IN) ::duplicate_scalar_to_axis_id
+
+      CALL xios(get_duplicate_scalar_to_axis_handle) &
+      (duplicate_scalar_to_axis_id,duplicate_scalar_to_axis_hdl)
+      CALL xios(set_duplicate_scalar_to_axis_attr_hdl_)   &
+      ( duplicate_scalar_to_axis_hdl )
+
+  END SUBROUTINE xios(set_duplicate_scalar_to_axis_attr)
+
+  SUBROUTINE xios(set_duplicate_scalar_to_axis_attr_hdl)  &
+    ( duplicate_scalar_to_axis_hdl )
+
+    IMPLICIT NONE
+      TYPE(txios(duplicate_scalar_to_axis)) , INTENT(IN) :: duplicate_scalar_to_axis_hdl
+
+      CALL xios(set_duplicate_scalar_to_axis_attr_hdl_)  &
+      ( duplicate_scalar_to_axis_hdl )
+
+  END SUBROUTINE xios(set_duplicate_scalar_to_axis_attr_hdl)
+
+  SUBROUTINE xios(set_duplicate_scalar_to_axis_attr_hdl_)   &
+    ( duplicate_scalar_to_axis_hdl )
+
+    IMPLICIT NONE
+      TYPE(txios(duplicate_scalar_to_axis)) , INTENT(IN) :: duplicate_scalar_to_axis_hdl
+
+  END SUBROUTINE xios(set_duplicate_scalar_to_axis_attr_hdl_)
+
+  SUBROUTINE xios(get_duplicate_scalar_to_axis_attr)  &
+    ( duplicate_scalar_to_axis_id )
+
+    IMPLICIT NONE
+      TYPE(txios(duplicate_scalar_to_axis))  :: duplicate_scalar_to_axis_hdl
+      CHARACTER(LEN=*), INTENT(IN) ::duplicate_scalar_to_axis_id
+
+      CALL xios(get_duplicate_scalar_to_axis_handle) &
+      (duplicate_scalar_to_axis_id,duplicate_scalar_to_axis_hdl)
+      CALL xios(get_duplicate_scalar_to_axis_attr_hdl_)   &
+      ( duplicate_scalar_to_axis_hdl )
+
+  END SUBROUTINE xios(get_duplicate_scalar_to_axis_attr)
+
+  SUBROUTINE xios(get_duplicate_scalar_to_axis_attr_hdl)  &
+    ( duplicate_scalar_to_axis_hdl )
+
+    IMPLICIT NONE
+      TYPE(txios(duplicate_scalar_to_axis)) , INTENT(IN) :: duplicate_scalar_to_axis_hdl
+
+      CALL xios(get_duplicate_scalar_to_axis_attr_hdl_)  &
+      ( duplicate_scalar_to_axis_hdl )
+
+  END SUBROUTINE xios(get_duplicate_scalar_to_axis_attr_hdl)
+
+  SUBROUTINE xios(get_duplicate_scalar_to_axis_attr_hdl_)   &
+    ( duplicate_scalar_to_axis_hdl )
+
+    IMPLICIT NONE
+      TYPE(txios(duplicate_scalar_to_axis)) , INTENT(IN) :: duplicate_scalar_to_axis_hdl
+
+  END SUBROUTINE xios(get_duplicate_scalar_to_axis_attr_hdl_)
+
+  SUBROUTINE xios(is_defined_duplicate_scalar_to_axis_attr)  &
+    ( duplicate_scalar_to_axis_id )
+
+    IMPLICIT NONE
+      TYPE(txios(duplicate_scalar_to_axis))  :: duplicate_scalar_to_axis_hdl
+      CHARACTER(LEN=*), INTENT(IN) ::duplicate_scalar_to_axis_id
+
+      CALL xios(get_duplicate_scalar_to_axis_handle) &
+      (duplicate_scalar_to_axis_id,duplicate_scalar_to_axis_hdl)
+      CALL xios(is_defined_duplicate_scalar_to_axis_attr_hdl_)   &
+      ( duplicate_scalar_to_axis_hdl )
+
+  END SUBROUTINE xios(is_defined_duplicate_scalar_to_axis_attr)
+
+  SUBROUTINE xios(is_defined_duplicate_scalar_to_axis_attr_hdl)  &
+    ( duplicate_scalar_to_axis_hdl )
+
+    IMPLICIT NONE
+      TYPE(txios(duplicate_scalar_to_axis)) , INTENT(IN) :: duplicate_scalar_to_axis_hdl
+
+      CALL xios(is_defined_duplicate_scalar_to_axis_attr_hdl_)  &
+      ( duplicate_scalar_to_axis_hdl )
+
+  END SUBROUTINE xios(is_defined_duplicate_scalar_to_axis_attr_hdl)
+
+  SUBROUTINE xios(is_defined_duplicate_scalar_to_axis_attr_hdl_)   &
+    ( duplicate_scalar_to_axis_hdl )
+
+    IMPLICIT NONE
+      TYPE(txios(duplicate_scalar_to_axis)) , INTENT(IN) :: duplicate_scalar_to_axis_hdl
+
+  END SUBROUTINE xios(is_defined_duplicate_scalar_to_axis_attr_hdl_)
+
+END MODULE iduplicate_scalar_to_axis_attr
Index: /XIOS/trunk/src/interface/fortran_attr/ifield_attr.F90
===================================================================
--- /XIOS/trunk/src/interface/fortran_attr/ifield_attr.F90	(revision 1536)
+++ /XIOS/trunk/src/interface/fortran_attr/ifield_attr.F90	(revision 1537)
@@ -12,9 +12,9 @@
 
   SUBROUTINE xios(set_field_attr)  &
-    ( field_id, add_offset, axis_ref, cell_methods, cell_methods_mode, check_if_active, compression_level  &
-    , default_value, detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op  &
-    , grid_path, grid_ref, indexed_output, level, long_name, name, operation, prec, read_access  &
-    , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min  &
-     )
+    ( field_id, add_offset, axis_ref, cell_methods, cell_methods_mode, check_if_active, comment  &
+    , compression_level, default_value, detect_missing_value, domain_ref, enabled, expr, field_ref  &
+    , freq_offset, freq_op, grid_path, grid_ref, indexed_output, level, long_name, name, operation  &
+    , prec, read_access, scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit  &
+    , valid_max, valid_min )
 
     IMPLICIT NONE
@@ -27,4 +27,5 @@
       LOGICAL  , OPTIONAL, INTENT(IN) :: check_if_active
       LOGICAL (KIND=C_BOOL) :: check_if_active_tmp
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: comment
       INTEGER  , OPTIONAL, INTENT(IN) :: compression_level
       REAL (KIND=8) , OPTIONAL, INTENT(IN) :: default_value
@@ -62,18 +63,18 @@
       (field_id,field_hdl)
       CALL xios(set_field_attr_hdl_)   &
-      ( field_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, check_if_active, compression_level  &
-      , default_value, detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op  &
-      , grid_path, grid_ref, indexed_output, level, long_name, name, operation, prec, read_access  &
-      , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min  &
-       )
+      ( field_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, check_if_active, comment  &
+      , compression_level, default_value, detect_missing_value, domain_ref, enabled, expr, field_ref  &
+      , freq_offset, freq_op, grid_path, grid_ref, indexed_output, level, long_name, name, operation  &
+      , prec, read_access, scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit  &
+      , valid_max, valid_min )
 
   END SUBROUTINE xios(set_field_attr)
 
   SUBROUTINE xios(set_field_attr_hdl)  &
-    ( field_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, check_if_active, compression_level  &
-    , default_value, detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op  &
-    , grid_path, grid_ref, indexed_output, level, long_name, name, operation, prec, read_access  &
-    , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min  &
-     )
+    ( field_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, check_if_active, comment  &
+    , compression_level, default_value, detect_missing_value, domain_ref, enabled, expr, field_ref  &
+    , freq_offset, freq_op, grid_path, grid_ref, indexed_output, level, long_name, name, operation  &
+    , prec, read_access, scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit  &
+    , valid_max, valid_min )
 
     IMPLICIT NONE
@@ -85,4 +86,5 @@
       LOGICAL  , OPTIONAL, INTENT(IN) :: check_if_active
       LOGICAL (KIND=C_BOOL) :: check_if_active_tmp
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: comment
       INTEGER  , OPTIONAL, INTENT(IN) :: compression_level
       REAL (KIND=8) , OPTIONAL, INTENT(IN) :: default_value
@@ -118,18 +120,18 @@
 
       CALL xios(set_field_attr_hdl_)  &
-      ( field_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, check_if_active, compression_level  &
-      , default_value, detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op  &
-      , grid_path, grid_ref, indexed_output, level, long_name, name, operation, prec, read_access  &
-      , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min  &
-       )
+      ( field_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, check_if_active, comment  &
+      , compression_level, default_value, detect_missing_value, domain_ref, enabled, expr, field_ref  &
+      , freq_offset, freq_op, grid_path, grid_ref, indexed_output, level, long_name, name, operation  &
+      , prec, read_access, scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit  &
+      , valid_max, valid_min )
 
   END SUBROUTINE xios(set_field_attr_hdl)
 
   SUBROUTINE xios(set_field_attr_hdl_)   &
-    ( field_hdl, add_offset_, axis_ref_, cell_methods_, cell_methods_mode_, check_if_active_, compression_level_  &
-    , default_value_, detect_missing_value_, domain_ref_, enabled_, expr_, field_ref_, freq_offset_  &
-    , freq_op_, grid_path_, grid_ref_, indexed_output_, level_, long_name_, name_, operation_, prec_  &
-    , read_access_, scalar_ref_, scale_factor_, standard_name_, ts_enabled_, ts_split_freq_, unit_  &
-    , valid_max_, valid_min_ )
+    ( field_hdl, add_offset_, axis_ref_, cell_methods_, cell_methods_mode_, check_if_active_, comment_  &
+    , compression_level_, default_value_, detect_missing_value_, domain_ref_, enabled_, expr_, field_ref_  &
+    , freq_offset_, freq_op_, grid_path_, grid_ref_, indexed_output_, level_, long_name_, name_  &
+    , operation_, prec_, read_access_, scalar_ref_, scale_factor_, standard_name_, ts_enabled_, ts_split_freq_  &
+    , unit_, valid_max_, valid_min_ )
 
     IMPLICIT NONE
@@ -141,4 +143,5 @@
       LOGICAL  , OPTIONAL, INTENT(IN) :: check_if_active_
       LOGICAL (KIND=C_BOOL) :: check_if_active__tmp
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: comment_
       INTEGER  , OPTIONAL, INTENT(IN) :: compression_level_
       REAL (KIND=8) , OPTIONAL, INTENT(IN) :: default_value_
@@ -199,4 +202,9 @@
       ENDIF
 
+      IF (PRESENT(comment_)) THEN
+        CALL cxios_set_field_comment &
+      (field_hdl%daddr, comment_, len(comment_))
+      ENDIF
+
       IF (PRESENT(compression_level_)) THEN
         CALL cxios_set_field_compression_level &
@@ -337,9 +345,9 @@
 
   SUBROUTINE xios(get_field_attr)  &
-    ( field_id, add_offset, axis_ref, cell_methods, cell_methods_mode, check_if_active, compression_level  &
-    , default_value, detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op  &
-    , grid_path, grid_ref, indexed_output, level, long_name, name, operation, prec, read_access  &
-    , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min  &
-     )
+    ( field_id, add_offset, axis_ref, cell_methods, cell_methods_mode, check_if_active, comment  &
+    , compression_level, default_value, detect_missing_value, domain_ref, enabled, expr, field_ref  &
+    , freq_offset, freq_op, grid_path, grid_ref, indexed_output, level, long_name, name, operation  &
+    , prec, read_access, scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit  &
+    , valid_max, valid_min )
 
     IMPLICIT NONE
@@ -352,4 +360,5 @@
       LOGICAL  , OPTIONAL, INTENT(OUT) :: check_if_active
       LOGICAL (KIND=C_BOOL) :: check_if_active_tmp
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: comment
       INTEGER  , OPTIONAL, INTENT(OUT) :: compression_level
       REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: default_value
@@ -387,18 +396,18 @@
       (field_id,field_hdl)
       CALL xios(get_field_attr_hdl_)   &
-      ( field_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, check_if_active, compression_level  &
-      , default_value, detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op  &
-      , grid_path, grid_ref, indexed_output, level, long_name, name, operation, prec, read_access  &
-      , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min  &
-       )
+      ( field_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, check_if_active, comment  &
+      , compression_level, default_value, detect_missing_value, domain_ref, enabled, expr, field_ref  &
+      , freq_offset, freq_op, grid_path, grid_ref, indexed_output, level, long_name, name, operation  &
+      , prec, read_access, scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit  &
+      , valid_max, valid_min )
 
   END SUBROUTINE xios(get_field_attr)
 
   SUBROUTINE xios(get_field_attr_hdl)  &
-    ( field_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, check_if_active, compression_level  &
-    , default_value, detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op  &
-    , grid_path, grid_ref, indexed_output, level, long_name, name, operation, prec, read_access  &
-    , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min  &
-     )
+    ( field_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, check_if_active, comment  &
+    , compression_level, default_value, detect_missing_value, domain_ref, enabled, expr, field_ref  &
+    , freq_offset, freq_op, grid_path, grid_ref, indexed_output, level, long_name, name, operation  &
+    , prec, read_access, scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit  &
+    , valid_max, valid_min )
 
     IMPLICIT NONE
@@ -410,4 +419,5 @@
       LOGICAL  , OPTIONAL, INTENT(OUT) :: check_if_active
       LOGICAL (KIND=C_BOOL) :: check_if_active_tmp
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: comment
       INTEGER  , OPTIONAL, INTENT(OUT) :: compression_level
       REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: default_value
@@ -443,18 +453,18 @@
 
       CALL xios(get_field_attr_hdl_)  &
-      ( field_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, check_if_active, compression_level  &
-      , default_value, detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op  &
-      , grid_path, grid_ref, indexed_output, level, long_name, name, operation, prec, read_access  &
-      , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min  &
-       )
+      ( field_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, check_if_active, comment  &
+      , compression_level, default_value, detect_missing_value, domain_ref, enabled, expr, field_ref  &
+      , freq_offset, freq_op, grid_path, grid_ref, indexed_output, level, long_name, name, operation  &
+      , prec, read_access, scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit  &
+      , valid_max, valid_min )
 
   END SUBROUTINE xios(get_field_attr_hdl)
 
   SUBROUTINE xios(get_field_attr_hdl_)   &
-    ( field_hdl, add_offset_, axis_ref_, cell_methods_, cell_methods_mode_, check_if_active_, compression_level_  &
-    , default_value_, detect_missing_value_, domain_ref_, enabled_, expr_, field_ref_, freq_offset_  &
-    , freq_op_, grid_path_, grid_ref_, indexed_output_, level_, long_name_, name_, operation_, prec_  &
-    , read_access_, scalar_ref_, scale_factor_, standard_name_, ts_enabled_, ts_split_freq_, unit_  &
-    , valid_max_, valid_min_ )
+    ( field_hdl, add_offset_, axis_ref_, cell_methods_, cell_methods_mode_, check_if_active_, comment_  &
+    , compression_level_, default_value_, detect_missing_value_, domain_ref_, enabled_, expr_, field_ref_  &
+    , freq_offset_, freq_op_, grid_path_, grid_ref_, indexed_output_, level_, long_name_, name_  &
+    , operation_, prec_, read_access_, scalar_ref_, scale_factor_, standard_name_, ts_enabled_, ts_split_freq_  &
+    , unit_, valid_max_, valid_min_ )
 
     IMPLICIT NONE
@@ -466,4 +476,5 @@
       LOGICAL  , OPTIONAL, INTENT(OUT) :: check_if_active_
       LOGICAL (KIND=C_BOOL) :: check_if_active__tmp
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: comment_
       INTEGER  , OPTIONAL, INTENT(OUT) :: compression_level_
       REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: default_value_
@@ -524,4 +535,9 @@
       ENDIF
 
+      IF (PRESENT(comment_)) THEN
+        CALL cxios_get_field_comment &
+      (field_hdl%daddr, comment_, len(comment_))
+      ENDIF
+
       IF (PRESENT(compression_level_)) THEN
         CALL cxios_get_field_compression_level &
@@ -662,9 +678,9 @@
 
   SUBROUTINE xios(is_defined_field_attr)  &
-    ( field_id, add_offset, axis_ref, cell_methods, cell_methods_mode, check_if_active, compression_level  &
-    , default_value, detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op  &
-    , grid_path, grid_ref, indexed_output, level, long_name, name, operation, prec, read_access  &
-    , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min  &
-     )
+    ( field_id, add_offset, axis_ref, cell_methods, cell_methods_mode, check_if_active, comment  &
+    , compression_level, default_value, detect_missing_value, domain_ref, enabled, expr, field_ref  &
+    , freq_offset, freq_op, grid_path, grid_ref, indexed_output, level, long_name, name, operation  &
+    , prec, read_access, scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit  &
+    , valid_max, valid_min )
 
     IMPLICIT NONE
@@ -681,4 +697,6 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: check_if_active
       LOGICAL(KIND=C_BOOL) :: check_if_active_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: comment
+      LOGICAL(KIND=C_BOOL) :: comment_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: compression_level
       LOGICAL(KIND=C_BOOL) :: compression_level_tmp
@@ -737,18 +755,18 @@
       (field_id,field_hdl)
       CALL xios(is_defined_field_attr_hdl_)   &
-      ( field_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, check_if_active, compression_level  &
-      , default_value, detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op  &
-      , grid_path, grid_ref, indexed_output, level, long_name, name, operation, prec, read_access  &
-      , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min  &
-       )
+      ( field_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, check_if_active, comment  &
+      , compression_level, default_value, detect_missing_value, domain_ref, enabled, expr, field_ref  &
+      , freq_offset, freq_op, grid_path, grid_ref, indexed_output, level, long_name, name, operation  &
+      , prec, read_access, scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit  &
+      , valid_max, valid_min )
 
   END SUBROUTINE xios(is_defined_field_attr)
 
   SUBROUTINE xios(is_defined_field_attr_hdl)  &
-    ( field_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, check_if_active, compression_level  &
-    , default_value, detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op  &
-    , grid_path, grid_ref, indexed_output, level, long_name, name, operation, prec, read_access  &
-    , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min  &
-     )
+    ( field_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, check_if_active, comment  &
+    , compression_level, default_value, detect_missing_value, domain_ref, enabled, expr, field_ref  &
+    , freq_offset, freq_op, grid_path, grid_ref, indexed_output, level, long_name, name, operation  &
+    , prec, read_access, scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit  &
+    , valid_max, valid_min )
 
     IMPLICIT NONE
@@ -764,4 +782,6 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: check_if_active
       LOGICAL(KIND=C_BOOL) :: check_if_active_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: comment
+      LOGICAL(KIND=C_BOOL) :: comment_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: compression_level
       LOGICAL(KIND=C_BOOL) :: compression_level_tmp
@@ -818,18 +838,18 @@
 
       CALL xios(is_defined_field_attr_hdl_)  &
-      ( field_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, check_if_active, compression_level  &
-      , default_value, detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op  &
-      , grid_path, grid_ref, indexed_output, level, long_name, name, operation, prec, read_access  &
-      , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min  &
-       )
+      ( field_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, check_if_active, comment  &
+      , compression_level, default_value, detect_missing_value, domain_ref, enabled, expr, field_ref  &
+      , freq_offset, freq_op, grid_path, grid_ref, indexed_output, level, long_name, name, operation  &
+      , prec, read_access, scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit  &
+      , valid_max, valid_min )
 
   END SUBROUTINE xios(is_defined_field_attr_hdl)
 
   SUBROUTINE xios(is_defined_field_attr_hdl_)   &
-    ( field_hdl, add_offset_, axis_ref_, cell_methods_, cell_methods_mode_, check_if_active_, compression_level_  &
-    , default_value_, detect_missing_value_, domain_ref_, enabled_, expr_, field_ref_, freq_offset_  &
-    , freq_op_, grid_path_, grid_ref_, indexed_output_, level_, long_name_, name_, operation_, prec_  &
-    , read_access_, scalar_ref_, scale_factor_, standard_name_, ts_enabled_, ts_split_freq_, unit_  &
-    , valid_max_, valid_min_ )
+    ( field_hdl, add_offset_, axis_ref_, cell_methods_, cell_methods_mode_, check_if_active_, comment_  &
+    , compression_level_, default_value_, detect_missing_value_, domain_ref_, enabled_, expr_, field_ref_  &
+    , freq_offset_, freq_op_, grid_path_, grid_ref_, indexed_output_, level_, long_name_, name_  &
+    , operation_, prec_, read_access_, scalar_ref_, scale_factor_, standard_name_, ts_enabled_, ts_split_freq_  &
+    , unit_, valid_max_, valid_min_ )
 
     IMPLICIT NONE
@@ -845,4 +865,6 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: check_if_active_
       LOGICAL(KIND=C_BOOL) :: check_if_active__tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: comment_
+      LOGICAL(KIND=C_BOOL) :: comment__tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: compression_level_
       LOGICAL(KIND=C_BOOL) :: compression_level__tmp
@@ -928,4 +950,10 @@
       ENDIF
 
+      IF (PRESENT(comment_)) THEN
+        comment__tmp = cxios_is_defined_field_comment &
+      (field_hdl%daddr)
+        comment_ = comment__tmp
+      ENDIF
+
       IF (PRESENT(compression_level_)) THEN
         compression_level__tmp = cxios_is_defined_field_compression_level &
Index: /XIOS/trunk/src/interface/fortran_attr/ifieldgroup_attr.F90
===================================================================
--- /XIOS/trunk/src/interface/fortran_attr/ifieldgroup_attr.F90	(revision 1536)
+++ /XIOS/trunk/src/interface/fortran_attr/ifieldgroup_attr.F90	(revision 1537)
@@ -12,9 +12,9 @@
 
   SUBROUTINE xios(set_fieldgroup_attr)  &
-    ( fieldgroup_id, add_offset, axis_ref, cell_methods, cell_methods_mode, check_if_active, compression_level  &
-    , default_value, detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op  &
-    , grid_path, grid_ref, group_ref, indexed_output, level, long_name, name, operation, prec, read_access  &
-    , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min  &
-     )
+    ( fieldgroup_id, add_offset, axis_ref, cell_methods, cell_methods_mode, check_if_active, comment  &
+    , compression_level, default_value, detect_missing_value, domain_ref, enabled, expr, field_ref  &
+    , freq_offset, freq_op, grid_path, grid_ref, group_ref, indexed_output, level, long_name, name  &
+    , operation, prec, read_access, scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq  &
+    , unit, valid_max, valid_min )
 
     IMPLICIT NONE
@@ -27,4 +27,5 @@
       LOGICAL  , OPTIONAL, INTENT(IN) :: check_if_active
       LOGICAL (KIND=C_BOOL) :: check_if_active_tmp
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: comment
       INTEGER  , OPTIONAL, INTENT(IN) :: compression_level
       REAL (KIND=8) , OPTIONAL, INTENT(IN) :: default_value
@@ -63,18 +64,18 @@
       (fieldgroup_id,fieldgroup_hdl)
       CALL xios(set_fieldgroup_attr_hdl_)   &
-      ( fieldgroup_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, check_if_active, compression_level  &
-      , default_value, detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op  &
-      , grid_path, grid_ref, group_ref, indexed_output, level, long_name, name, operation, prec, read_access  &
-      , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min  &
-       )
+      ( fieldgroup_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, check_if_active, comment  &
+      , compression_level, default_value, detect_missing_value, domain_ref, enabled, expr, field_ref  &
+      , freq_offset, freq_op, grid_path, grid_ref, group_ref, indexed_output, level, long_name, name  &
+      , operation, prec, read_access, scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq  &
+      , unit, valid_max, valid_min )
 
   END SUBROUTINE xios(set_fieldgroup_attr)
 
   SUBROUTINE xios(set_fieldgroup_attr_hdl)  &
-    ( fieldgroup_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, check_if_active, compression_level  &
-    , default_value, detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op  &
-    , grid_path, grid_ref, group_ref, indexed_output, level, long_name, name, operation, prec, read_access  &
-    , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min  &
-     )
+    ( fieldgroup_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, check_if_active, comment  &
+    , compression_level, default_value, detect_missing_value, domain_ref, enabled, expr, field_ref  &
+    , freq_offset, freq_op, grid_path, grid_ref, group_ref, indexed_output, level, long_name, name  &
+    , operation, prec, read_access, scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq  &
+    , unit, valid_max, valid_min )
 
     IMPLICIT NONE
@@ -86,4 +87,5 @@
       LOGICAL  , OPTIONAL, INTENT(IN) :: check_if_active
       LOGICAL (KIND=C_BOOL) :: check_if_active_tmp
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: comment
       INTEGER  , OPTIONAL, INTENT(IN) :: compression_level
       REAL (KIND=8) , OPTIONAL, INTENT(IN) :: default_value
@@ -120,9 +122,9 @@
 
       CALL xios(set_fieldgroup_attr_hdl_)  &
-      ( fieldgroup_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, check_if_active, compression_level  &
-      , default_value, detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op  &
-      , grid_path, grid_ref, group_ref, indexed_output, level, long_name, name, operation, prec, read_access  &
-      , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min  &
-       )
+      ( fieldgroup_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, check_if_active, comment  &
+      , compression_level, default_value, detect_missing_value, domain_ref, enabled, expr, field_ref  &
+      , freq_offset, freq_op, grid_path, grid_ref, group_ref, indexed_output, level, long_name, name  &
+      , operation, prec, read_access, scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq  &
+      , unit, valid_max, valid_min )
 
   END SUBROUTINE xios(set_fieldgroup_attr_hdl)
@@ -130,8 +132,8 @@
   SUBROUTINE xios(set_fieldgroup_attr_hdl_)   &
     ( fieldgroup_hdl, add_offset_, axis_ref_, cell_methods_, cell_methods_mode_, check_if_active_  &
-    , compression_level_, default_value_, detect_missing_value_, domain_ref_, enabled_, expr_, field_ref_  &
-    , freq_offset_, freq_op_, grid_path_, grid_ref_, group_ref_, indexed_output_, level_, long_name_  &
-    , name_, operation_, prec_, read_access_, scalar_ref_, scale_factor_, standard_name_, ts_enabled_  &
-    , ts_split_freq_, unit_, valid_max_, valid_min_ )
+    , comment_, compression_level_, default_value_, detect_missing_value_, domain_ref_, enabled_  &
+    , expr_, field_ref_, freq_offset_, freq_op_, grid_path_, grid_ref_, group_ref_, indexed_output_  &
+    , level_, long_name_, name_, operation_, prec_, read_access_, scalar_ref_, scale_factor_, standard_name_  &
+    , ts_enabled_, ts_split_freq_, unit_, valid_max_, valid_min_ )
 
     IMPLICIT NONE
@@ -143,4 +145,5 @@
       LOGICAL  , OPTIONAL, INTENT(IN) :: check_if_active_
       LOGICAL (KIND=C_BOOL) :: check_if_active__tmp
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: comment_
       INTEGER  , OPTIONAL, INTENT(IN) :: compression_level_
       REAL (KIND=8) , OPTIONAL, INTENT(IN) :: default_value_
@@ -202,4 +205,9 @@
       ENDIF
 
+      IF (PRESENT(comment_)) THEN
+        CALL cxios_set_fieldgroup_comment &
+      (fieldgroup_hdl%daddr, comment_, len(comment_))
+      ENDIF
+
       IF (PRESENT(compression_level_)) THEN
         CALL cxios_set_fieldgroup_compression_level &
@@ -345,9 +353,9 @@
 
   SUBROUTINE xios(get_fieldgroup_attr)  &
-    ( fieldgroup_id, add_offset, axis_ref, cell_methods, cell_methods_mode, check_if_active, compression_level  &
-    , default_value, detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op  &
-    , grid_path, grid_ref, group_ref, indexed_output, level, long_name, name, operation, prec, read_access  &
-    , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min  &
-     )
+    ( fieldgroup_id, add_offset, axis_ref, cell_methods, cell_methods_mode, check_if_active, comment  &
+    , compression_level, default_value, detect_missing_value, domain_ref, enabled, expr, field_ref  &
+    , freq_offset, freq_op, grid_path, grid_ref, group_ref, indexed_output, level, long_name, name  &
+    , operation, prec, read_access, scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq  &
+    , unit, valid_max, valid_min )
 
     IMPLICIT NONE
@@ -360,4 +368,5 @@
       LOGICAL  , OPTIONAL, INTENT(OUT) :: check_if_active
       LOGICAL (KIND=C_BOOL) :: check_if_active_tmp
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: comment
       INTEGER  , OPTIONAL, INTENT(OUT) :: compression_level
       REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: default_value
@@ -396,18 +405,18 @@
       (fieldgroup_id,fieldgroup_hdl)
       CALL xios(get_fieldgroup_attr_hdl_)   &
-      ( fieldgroup_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, check_if_active, compression_level  &
-      , default_value, detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op  &
-      , grid_path, grid_ref, group_ref, indexed_output, level, long_name, name, operation, prec, read_access  &
-      , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min  &
-       )
+      ( fieldgroup_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, check_if_active, comment  &
+      , compression_level, default_value, detect_missing_value, domain_ref, enabled, expr, field_ref  &
+      , freq_offset, freq_op, grid_path, grid_ref, group_ref, indexed_output, level, long_name, name  &
+      , operation, prec, read_access, scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq  &
+      , unit, valid_max, valid_min )
 
   END SUBROUTINE xios(get_fieldgroup_attr)
 
   SUBROUTINE xios(get_fieldgroup_attr_hdl)  &
-    ( fieldgroup_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, check_if_active, compression_level  &
-    , default_value, detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op  &
-    , grid_path, grid_ref, group_ref, indexed_output, level, long_name, name, operation, prec, read_access  &
-    , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min  &
-     )
+    ( fieldgroup_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, check_if_active, comment  &
+    , compression_level, default_value, detect_missing_value, domain_ref, enabled, expr, field_ref  &
+    , freq_offset, freq_op, grid_path, grid_ref, group_ref, indexed_output, level, long_name, name  &
+    , operation, prec, read_access, scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq  &
+    , unit, valid_max, valid_min )
 
     IMPLICIT NONE
@@ -419,4 +428,5 @@
       LOGICAL  , OPTIONAL, INTENT(OUT) :: check_if_active
       LOGICAL (KIND=C_BOOL) :: check_if_active_tmp
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: comment
       INTEGER  , OPTIONAL, INTENT(OUT) :: compression_level
       REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: default_value
@@ -453,9 +463,9 @@
 
       CALL xios(get_fieldgroup_attr_hdl_)  &
-      ( fieldgroup_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, check_if_active, compression_level  &
-      , default_value, detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op  &
-      , grid_path, grid_ref, group_ref, indexed_output, level, long_name, name, operation, prec, read_access  &
-      , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min  &
-       )
+      ( fieldgroup_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, check_if_active, comment  &
+      , compression_level, default_value, detect_missing_value, domain_ref, enabled, expr, field_ref  &
+      , freq_offset, freq_op, grid_path, grid_ref, group_ref, indexed_output, level, long_name, name  &
+      , operation, prec, read_access, scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq  &
+      , unit, valid_max, valid_min )
 
   END SUBROUTINE xios(get_fieldgroup_attr_hdl)
@@ -463,8 +473,8 @@
   SUBROUTINE xios(get_fieldgroup_attr_hdl_)   &
     ( fieldgroup_hdl, add_offset_, axis_ref_, cell_methods_, cell_methods_mode_, check_if_active_  &
-    , compression_level_, default_value_, detect_missing_value_, domain_ref_, enabled_, expr_, field_ref_  &
-    , freq_offset_, freq_op_, grid_path_, grid_ref_, group_ref_, indexed_output_, level_, long_name_  &
-    , name_, operation_, prec_, read_access_, scalar_ref_, scale_factor_, standard_name_, ts_enabled_  &
-    , ts_split_freq_, unit_, valid_max_, valid_min_ )
+    , comment_, compression_level_, default_value_, detect_missing_value_, domain_ref_, enabled_  &
+    , expr_, field_ref_, freq_offset_, freq_op_, grid_path_, grid_ref_, group_ref_, indexed_output_  &
+    , level_, long_name_, name_, operation_, prec_, read_access_, scalar_ref_, scale_factor_, standard_name_  &
+    , ts_enabled_, ts_split_freq_, unit_, valid_max_, valid_min_ )
 
     IMPLICIT NONE
@@ -476,4 +486,5 @@
       LOGICAL  , OPTIONAL, INTENT(OUT) :: check_if_active_
       LOGICAL (KIND=C_BOOL) :: check_if_active__tmp
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: comment_
       INTEGER  , OPTIONAL, INTENT(OUT) :: compression_level_
       REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: default_value_
@@ -535,4 +546,9 @@
       ENDIF
 
+      IF (PRESENT(comment_)) THEN
+        CALL cxios_get_fieldgroup_comment &
+      (fieldgroup_hdl%daddr, comment_, len(comment_))
+      ENDIF
+
       IF (PRESENT(compression_level_)) THEN
         CALL cxios_get_fieldgroup_compression_level &
@@ -678,9 +694,9 @@
 
   SUBROUTINE xios(is_defined_fieldgroup_attr)  &
-    ( fieldgroup_id, add_offset, axis_ref, cell_methods, cell_methods_mode, check_if_active, compression_level  &
-    , default_value, detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op  &
-    , grid_path, grid_ref, group_ref, indexed_output, level, long_name, name, operation, prec, read_access  &
-    , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min  &
-     )
+    ( fieldgroup_id, add_offset, axis_ref, cell_methods, cell_methods_mode, check_if_active, comment  &
+    , compression_level, default_value, detect_missing_value, domain_ref, enabled, expr, field_ref  &
+    , freq_offset, freq_op, grid_path, grid_ref, group_ref, indexed_output, level, long_name, name  &
+    , operation, prec, read_access, scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq  &
+    , unit, valid_max, valid_min )
 
     IMPLICIT NONE
@@ -697,4 +713,6 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: check_if_active
       LOGICAL(KIND=C_BOOL) :: check_if_active_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: comment
+      LOGICAL(KIND=C_BOOL) :: comment_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: compression_level
       LOGICAL(KIND=C_BOOL) :: compression_level_tmp
@@ -755,18 +773,18 @@
       (fieldgroup_id,fieldgroup_hdl)
       CALL xios(is_defined_fieldgroup_attr_hdl_)   &
-      ( fieldgroup_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, check_if_active, compression_level  &
-      , default_value, detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op  &
-      , grid_path, grid_ref, group_ref, indexed_output, level, long_name, name, operation, prec, read_access  &
-      , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min  &
-       )
+      ( fieldgroup_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, check_if_active, comment  &
+      , compression_level, default_value, detect_missing_value, domain_ref, enabled, expr, field_ref  &
+      , freq_offset, freq_op, grid_path, grid_ref, group_ref, indexed_output, level, long_name, name  &
+      , operation, prec, read_access, scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq  &
+      , unit, valid_max, valid_min )
 
   END SUBROUTINE xios(is_defined_fieldgroup_attr)
 
   SUBROUTINE xios(is_defined_fieldgroup_attr_hdl)  &
-    ( fieldgroup_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, check_if_active, compression_level  &
-    , default_value, detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op  &
-    , grid_path, grid_ref, group_ref, indexed_output, level, long_name, name, operation, prec, read_access  &
-    , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min  &
-     )
+    ( fieldgroup_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, check_if_active, comment  &
+    , compression_level, default_value, detect_missing_value, domain_ref, enabled, expr, field_ref  &
+    , freq_offset, freq_op, grid_path, grid_ref, group_ref, indexed_output, level, long_name, name  &
+    , operation, prec, read_access, scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq  &
+    , unit, valid_max, valid_min )
 
     IMPLICIT NONE
@@ -782,4 +800,6 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: check_if_active
       LOGICAL(KIND=C_BOOL) :: check_if_active_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: comment
+      LOGICAL(KIND=C_BOOL) :: comment_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: compression_level
       LOGICAL(KIND=C_BOOL) :: compression_level_tmp
@@ -838,9 +858,9 @@
 
       CALL xios(is_defined_fieldgroup_attr_hdl_)  &
-      ( fieldgroup_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, check_if_active, compression_level  &
-      , default_value, detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op  &
-      , grid_path, grid_ref, group_ref, indexed_output, level, long_name, name, operation, prec, read_access  &
-      , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min  &
-       )
+      ( fieldgroup_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, check_if_active, comment  &
+      , compression_level, default_value, detect_missing_value, domain_ref, enabled, expr, field_ref  &
+      , freq_offset, freq_op, grid_path, grid_ref, group_ref, indexed_output, level, long_name, name  &
+      , operation, prec, read_access, scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq  &
+      , unit, valid_max, valid_min )
 
   END SUBROUTINE xios(is_defined_fieldgroup_attr_hdl)
@@ -848,8 +868,8 @@
   SUBROUTINE xios(is_defined_fieldgroup_attr_hdl_)   &
     ( fieldgroup_hdl, add_offset_, axis_ref_, cell_methods_, cell_methods_mode_, check_if_active_  &
-    , compression_level_, default_value_, detect_missing_value_, domain_ref_, enabled_, expr_, field_ref_  &
-    , freq_offset_, freq_op_, grid_path_, grid_ref_, group_ref_, indexed_output_, level_, long_name_  &
-    , name_, operation_, prec_, read_access_, scalar_ref_, scale_factor_, standard_name_, ts_enabled_  &
-    , ts_split_freq_, unit_, valid_max_, valid_min_ )
+    , comment_, compression_level_, default_value_, detect_missing_value_, domain_ref_, enabled_  &
+    , expr_, field_ref_, freq_offset_, freq_op_, grid_path_, grid_ref_, group_ref_, indexed_output_  &
+    , level_, long_name_, name_, operation_, prec_, read_access_, scalar_ref_, scale_factor_, standard_name_  &
+    , ts_enabled_, ts_split_freq_, unit_, valid_max_, valid_min_ )
 
     IMPLICIT NONE
@@ -865,4 +885,6 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: check_if_active_
       LOGICAL(KIND=C_BOOL) :: check_if_active__tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: comment_
+      LOGICAL(KIND=C_BOOL) :: comment__tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: compression_level_
       LOGICAL(KIND=C_BOOL) :: compression_level__tmp
@@ -950,4 +972,10 @@
       ENDIF
 
+      IF (PRESENT(comment_)) THEN
+        comment__tmp = cxios_is_defined_fieldgroup_comment &
+      (fieldgroup_hdl%daddr)
+        comment_ = comment__tmp
+      ENDIF
+
       IF (PRESENT(compression_level_)) THEN
         compression_level__tmp = cxios_is_defined_fieldgroup_compression_level &
Index: /XIOS/trunk/src/interface/fortran_attr/ifile_attr.F90
===================================================================
--- /XIOS/trunk/src/interface/fortran_attr/ifile_attr.F90	(revision 1536)
+++ /XIOS/trunk/src/interface/fortran_attr/ifile_attr.F90	(revision 1537)
@@ -12,8 +12,9 @@
 
   SUBROUTINE xios(set_file_attr)  &
-    ( file_id, append, compression_level, convention, convention_str, cyclic, description, enabled  &
-    , format, min_digits, mode, name, name_suffix, output_freq, output_level, par_access, record_offset  &
-    , split_freq, split_freq_format, sync_freq, time_counter, time_counter_name, time_stamp_format  &
-    , time_stamp_name, time_units, timeseries, ts_prefix, type, uuid_format, uuid_name )
+    ( file_id, append, comment, compression_level, convention, convention_str, cyclic, description  &
+    , enabled, format, min_digits, mode, name, name_suffix, output_freq, output_level, par_access  &
+    , read_metadata_par, record_offset, split_end_offset, split_freq, split_freq_format, split_last_date  &
+    , split_start_offset, sync_freq, time_counter, time_counter_name, time_stamp_format, time_stamp_name  &
+    , time_units, timeseries, ts_prefix, type, uuid_format, uuid_name )
 
     IMPLICIT NONE
@@ -22,4 +23,5 @@
       LOGICAL  , OPTIONAL, INTENT(IN) :: append
       LOGICAL (KIND=C_BOOL) :: append_tmp
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: comment
       INTEGER  , OPTIONAL, INTENT(IN) :: compression_level
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: convention
@@ -38,7 +40,12 @@
       INTEGER  , OPTIONAL, INTENT(IN) :: output_level
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: par_access
+      LOGICAL  , OPTIONAL, INTENT(IN) :: read_metadata_par
+      LOGICAL (KIND=C_BOOL) :: read_metadata_par_tmp
       INTEGER  , OPTIONAL, INTENT(IN) :: record_offset
+      TYPE(txios(duration))  , OPTIONAL, INTENT(IN) :: split_end_offset
       TYPE(txios(duration))  , OPTIONAL, INTENT(IN) :: split_freq
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: split_freq_format
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: split_last_date
+      TYPE(txios(duration))  , OPTIONAL, INTENT(IN) :: split_start_offset
       TYPE(txios(duration))  , OPTIONAL, INTENT(IN) :: sync_freq
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: time_counter
@@ -56,16 +63,18 @@
       (file_id,file_hdl)
       CALL xios(set_file_attr_hdl_)   &
-      ( file_hdl, append, compression_level, convention, convention_str, cyclic, description, enabled  &
-      , format, min_digits, mode, name, name_suffix, output_freq, output_level, par_access, record_offset  &
-      , split_freq, split_freq_format, sync_freq, time_counter, time_counter_name, time_stamp_format  &
-      , time_stamp_name, time_units, timeseries, ts_prefix, type, uuid_format, uuid_name )
+      ( file_hdl, append, comment, compression_level, convention, convention_str, cyclic, description  &
+      , enabled, format, min_digits, mode, name, name_suffix, output_freq, output_level, par_access  &
+      , read_metadata_par, record_offset, split_end_offset, split_freq, split_freq_format, split_last_date  &
+      , split_start_offset, sync_freq, time_counter, time_counter_name, time_stamp_format, time_stamp_name  &
+      , time_units, timeseries, ts_prefix, type, uuid_format, uuid_name )
 
   END SUBROUTINE xios(set_file_attr)
 
   SUBROUTINE xios(set_file_attr_hdl)  &
-    ( file_hdl, append, compression_level, convention, convention_str, cyclic, description, enabled  &
-    , format, min_digits, mode, name, name_suffix, output_freq, output_level, par_access, record_offset  &
-    , split_freq, split_freq_format, sync_freq, time_counter, time_counter_name, time_stamp_format  &
-    , time_stamp_name, time_units, timeseries, ts_prefix, type, uuid_format, uuid_name )
+    ( file_hdl, append, comment, compression_level, convention, convention_str, cyclic, description  &
+    , enabled, format, min_digits, mode, name, name_suffix, output_freq, output_level, par_access  &
+    , read_metadata_par, record_offset, split_end_offset, split_freq, split_freq_format, split_last_date  &
+    , split_start_offset, sync_freq, time_counter, time_counter_name, time_stamp_format, time_stamp_name  &
+    , time_units, timeseries, ts_prefix, type, uuid_format, uuid_name )
 
     IMPLICIT NONE
@@ -73,4 +82,5 @@
       LOGICAL  , OPTIONAL, INTENT(IN) :: append
       LOGICAL (KIND=C_BOOL) :: append_tmp
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: comment
       INTEGER  , OPTIONAL, INTENT(IN) :: compression_level
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: convention
@@ -89,7 +99,12 @@
       INTEGER  , OPTIONAL, INTENT(IN) :: output_level
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: par_access
+      LOGICAL  , OPTIONAL, INTENT(IN) :: read_metadata_par
+      LOGICAL (KIND=C_BOOL) :: read_metadata_par_tmp
       INTEGER  , OPTIONAL, INTENT(IN) :: record_offset
+      TYPE(txios(duration))  , OPTIONAL, INTENT(IN) :: split_end_offset
       TYPE(txios(duration))  , OPTIONAL, INTENT(IN) :: split_freq
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: split_freq_format
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: split_last_date
+      TYPE(txios(duration))  , OPTIONAL, INTENT(IN) :: split_start_offset
       TYPE(txios(duration))  , OPTIONAL, INTENT(IN) :: sync_freq
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: time_counter
@@ -105,17 +120,18 @@
 
       CALL xios(set_file_attr_hdl_)  &
-      ( file_hdl, append, compression_level, convention, convention_str, cyclic, description, enabled  &
-      , format, min_digits, mode, name, name_suffix, output_freq, output_level, par_access, record_offset  &
-      , split_freq, split_freq_format, sync_freq, time_counter, time_counter_name, time_stamp_format  &
-      , time_stamp_name, time_units, timeseries, ts_prefix, type, uuid_format, uuid_name )
+      ( file_hdl, append, comment, compression_level, convention, convention_str, cyclic, description  &
+      , enabled, format, min_digits, mode, name, name_suffix, output_freq, output_level, par_access  &
+      , read_metadata_par, record_offset, split_end_offset, split_freq, split_freq_format, split_last_date  &
+      , split_start_offset, sync_freq, time_counter, time_counter_name, time_stamp_format, time_stamp_name  &
+      , time_units, timeseries, ts_prefix, type, uuid_format, uuid_name )
 
   END SUBROUTINE xios(set_file_attr_hdl)
 
   SUBROUTINE xios(set_file_attr_hdl_)   &
-    ( file_hdl, append_, compression_level_, convention_, convention_str_, cyclic_, description_  &
+    ( file_hdl, append_, comment_, compression_level_, convention_, convention_str_, cyclic_, description_  &
     , enabled_, format_, min_digits_, mode_, name_, name_suffix_, output_freq_, output_level_, par_access_  &
-    , record_offset_, split_freq_, split_freq_format_, sync_freq_, time_counter_, time_counter_name_  &
-    , time_stamp_format_, time_stamp_name_, time_units_, timeseries_, ts_prefix_, type_, uuid_format_  &
-    , uuid_name_ )
+    , read_metadata_par_, record_offset_, split_end_offset_, split_freq_, split_freq_format_, split_last_date_  &
+    , split_start_offset_, sync_freq_, time_counter_, time_counter_name_, time_stamp_format_, time_stamp_name_  &
+    , time_units_, timeseries_, ts_prefix_, type_, uuid_format_, uuid_name_ )
 
     IMPLICIT NONE
@@ -123,4 +139,5 @@
       LOGICAL  , OPTIONAL, INTENT(IN) :: append_
       LOGICAL (KIND=C_BOOL) :: append__tmp
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: comment_
       INTEGER  , OPTIONAL, INTENT(IN) :: compression_level_
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: convention_
@@ -139,7 +156,12 @@
       INTEGER  , OPTIONAL, INTENT(IN) :: output_level_
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: par_access_
+      LOGICAL  , OPTIONAL, INTENT(IN) :: read_metadata_par_
+      LOGICAL (KIND=C_BOOL) :: read_metadata_par__tmp
       INTEGER  , OPTIONAL, INTENT(IN) :: record_offset_
+      TYPE(txios(duration))  , OPTIONAL, INTENT(IN) :: split_end_offset_
       TYPE(txios(duration))  , OPTIONAL, INTENT(IN) :: split_freq_
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: split_freq_format_
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: split_last_date_
+      TYPE(txios(duration))  , OPTIONAL, INTENT(IN) :: split_start_offset_
       TYPE(txios(duration))  , OPTIONAL, INTENT(IN) :: sync_freq_
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: time_counter_
@@ -160,4 +182,9 @@
       ENDIF
 
+      IF (PRESENT(comment_)) THEN
+        CALL cxios_set_file_comment &
+      (file_hdl%daddr, comment_, len(comment_))
+      ENDIF
+
       IF (PRESENT(compression_level_)) THEN
         CALL cxios_set_file_compression_level &
@@ -232,4 +259,10 @@
       ENDIF
 
+      IF (PRESENT(read_metadata_par_)) THEN
+        read_metadata_par__tmp = read_metadata_par_
+        CALL cxios_set_file_read_metadata_par &
+      (file_hdl%daddr, read_metadata_par__tmp)
+      ENDIF
+
       IF (PRESENT(record_offset_)) THEN
         CALL cxios_set_file_record_offset &
@@ -237,4 +270,9 @@
       ENDIF
 
+      IF (PRESENT(split_end_offset_)) THEN
+        CALL cxios_set_file_split_end_offset &
+      (file_hdl%daddr, split_end_offset_)
+      ENDIF
+
       IF (PRESENT(split_freq_)) THEN
         CALL cxios_set_file_split_freq &
@@ -247,4 +285,14 @@
       ENDIF
 
+      IF (PRESENT(split_last_date_)) THEN
+        CALL cxios_set_file_split_last_date &
+      (file_hdl%daddr, split_last_date_, len(split_last_date_))
+      ENDIF
+
+      IF (PRESENT(split_start_offset_)) THEN
+        CALL cxios_set_file_split_start_offset &
+      (file_hdl%daddr, split_start_offset_)
+      ENDIF
+
       IF (PRESENT(sync_freq_)) THEN
         CALL cxios_set_file_sync_freq &
@@ -305,8 +353,9 @@
 
   SUBROUTINE xios(get_file_attr)  &
-    ( file_id, append, compression_level, convention, convention_str, cyclic, description, enabled  &
-    , format, min_digits, mode, name, name_suffix, output_freq, output_level, par_access, record_offset  &
-    , split_freq, split_freq_format, sync_freq, time_counter, time_counter_name, time_stamp_format  &
-    , time_stamp_name, time_units, timeseries, ts_prefix, type, uuid_format, uuid_name )
+    ( file_id, append, comment, compression_level, convention, convention_str, cyclic, description  &
+    , enabled, format, min_digits, mode, name, name_suffix, output_freq, output_level, par_access  &
+    , read_metadata_par, record_offset, split_end_offset, split_freq, split_freq_format, split_last_date  &
+    , split_start_offset, sync_freq, time_counter, time_counter_name, time_stamp_format, time_stamp_name  &
+    , time_units, timeseries, ts_prefix, type, uuid_format, uuid_name )
 
     IMPLICIT NONE
@@ -315,4 +364,5 @@
       LOGICAL  , OPTIONAL, INTENT(OUT) :: append
       LOGICAL (KIND=C_BOOL) :: append_tmp
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: comment
       INTEGER  , OPTIONAL, INTENT(OUT) :: compression_level
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: convention
@@ -331,7 +381,12 @@
       INTEGER  , OPTIONAL, INTENT(OUT) :: output_level
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: par_access
+      LOGICAL  , OPTIONAL, INTENT(OUT) :: read_metadata_par
+      LOGICAL (KIND=C_BOOL) :: read_metadata_par_tmp
       INTEGER  , OPTIONAL, INTENT(OUT) :: record_offset
+      TYPE(txios(duration))  , OPTIONAL, INTENT(OUT) :: split_end_offset
       TYPE(txios(duration))  , OPTIONAL, INTENT(OUT) :: split_freq
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: split_freq_format
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: split_last_date
+      TYPE(txios(duration))  , OPTIONAL, INTENT(OUT) :: split_start_offset
       TYPE(txios(duration))  , OPTIONAL, INTENT(OUT) :: sync_freq
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: time_counter
@@ -349,16 +404,18 @@
       (file_id,file_hdl)
       CALL xios(get_file_attr_hdl_)   &
-      ( file_hdl, append, compression_level, convention, convention_str, cyclic, description, enabled  &
-      , format, min_digits, mode, name, name_suffix, output_freq, output_level, par_access, record_offset  &
-      , split_freq, split_freq_format, sync_freq, time_counter, time_counter_name, time_stamp_format  &
-      , time_stamp_name, time_units, timeseries, ts_prefix, type, uuid_format, uuid_name )
+      ( file_hdl, append, comment, compression_level, convention, convention_str, cyclic, description  &
+      , enabled, format, min_digits, mode, name, name_suffix, output_freq, output_level, par_access  &
+      , read_metadata_par, record_offset, split_end_offset, split_freq, split_freq_format, split_last_date  &
+      , split_start_offset, sync_freq, time_counter, time_counter_name, time_stamp_format, time_stamp_name  &
+      , time_units, timeseries, ts_prefix, type, uuid_format, uuid_name )
 
   END SUBROUTINE xios(get_file_attr)
 
   SUBROUTINE xios(get_file_attr_hdl)  &
-    ( file_hdl, append, compression_level, convention, convention_str, cyclic, description, enabled  &
-    , format, min_digits, mode, name, name_suffix, output_freq, output_level, par_access, record_offset  &
-    , split_freq, split_freq_format, sync_freq, time_counter, time_counter_name, time_stamp_format  &
-    , time_stamp_name, time_units, timeseries, ts_prefix, type, uuid_format, uuid_name )
+    ( file_hdl, append, comment, compression_level, convention, convention_str, cyclic, description  &
+    , enabled, format, min_digits, mode, name, name_suffix, output_freq, output_level, par_access  &
+    , read_metadata_par, record_offset, split_end_offset, split_freq, split_freq_format, split_last_date  &
+    , split_start_offset, sync_freq, time_counter, time_counter_name, time_stamp_format, time_stamp_name  &
+    , time_units, timeseries, ts_prefix, type, uuid_format, uuid_name )
 
     IMPLICIT NONE
@@ -366,4 +423,5 @@
       LOGICAL  , OPTIONAL, INTENT(OUT) :: append
       LOGICAL (KIND=C_BOOL) :: append_tmp
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: comment
       INTEGER  , OPTIONAL, INTENT(OUT) :: compression_level
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: convention
@@ -382,7 +440,12 @@
       INTEGER  , OPTIONAL, INTENT(OUT) :: output_level
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: par_access
+      LOGICAL  , OPTIONAL, INTENT(OUT) :: read_metadata_par
+      LOGICAL (KIND=C_BOOL) :: read_metadata_par_tmp
       INTEGER  , OPTIONAL, INTENT(OUT) :: record_offset
+      TYPE(txios(duration))  , OPTIONAL, INTENT(OUT) :: split_end_offset
       TYPE(txios(duration))  , OPTIONAL, INTENT(OUT) :: split_freq
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: split_freq_format
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: split_last_date
+      TYPE(txios(duration))  , OPTIONAL, INTENT(OUT) :: split_start_offset
       TYPE(txios(duration))  , OPTIONAL, INTENT(OUT) :: sync_freq
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: time_counter
@@ -398,17 +461,18 @@
 
       CALL xios(get_file_attr_hdl_)  &
-      ( file_hdl, append, compression_level, convention, convention_str, cyclic, description, enabled  &
-      , format, min_digits, mode, name, name_suffix, output_freq, output_level, par_access, record_offset  &
-      , split_freq, split_freq_format, sync_freq, time_counter, time_counter_name, time_stamp_format  &
-      , time_stamp_name, time_units, timeseries, ts_prefix, type, uuid_format, uuid_name )
+      ( file_hdl, append, comment, compression_level, convention, convention_str, cyclic, description  &
+      , enabled, format, min_digits, mode, name, name_suffix, output_freq, output_level, par_access  &
+      , read_metadata_par, record_offset, split_end_offset, split_freq, split_freq_format, split_last_date  &
+      , split_start_offset, sync_freq, time_counter, time_counter_name, time_stamp_format, time_stamp_name  &
+      , time_units, timeseries, ts_prefix, type, uuid_format, uuid_name )
 
   END SUBROUTINE xios(get_file_attr_hdl)
 
   SUBROUTINE xios(get_file_attr_hdl_)   &
-    ( file_hdl, append_, compression_level_, convention_, convention_str_, cyclic_, description_  &
+    ( file_hdl, append_, comment_, compression_level_, convention_, convention_str_, cyclic_, description_  &
     , enabled_, format_, min_digits_, mode_, name_, name_suffix_, output_freq_, output_level_, par_access_  &
-    , record_offset_, split_freq_, split_freq_format_, sync_freq_, time_counter_, time_counter_name_  &
-    , time_stamp_format_, time_stamp_name_, time_units_, timeseries_, ts_prefix_, type_, uuid_format_  &
-    , uuid_name_ )
+    , read_metadata_par_, record_offset_, split_end_offset_, split_freq_, split_freq_format_, split_last_date_  &
+    , split_start_offset_, sync_freq_, time_counter_, time_counter_name_, time_stamp_format_, time_stamp_name_  &
+    , time_units_, timeseries_, ts_prefix_, type_, uuid_format_, uuid_name_ )
 
     IMPLICIT NONE
@@ -416,4 +480,5 @@
       LOGICAL  , OPTIONAL, INTENT(OUT) :: append_
       LOGICAL (KIND=C_BOOL) :: append__tmp
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: comment_
       INTEGER  , OPTIONAL, INTENT(OUT) :: compression_level_
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: convention_
@@ -432,7 +497,12 @@
       INTEGER  , OPTIONAL, INTENT(OUT) :: output_level_
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: par_access_
+      LOGICAL  , OPTIONAL, INTENT(OUT) :: read_metadata_par_
+      LOGICAL (KIND=C_BOOL) :: read_metadata_par__tmp
       INTEGER  , OPTIONAL, INTENT(OUT) :: record_offset_
+      TYPE(txios(duration))  , OPTIONAL, INTENT(OUT) :: split_end_offset_
       TYPE(txios(duration))  , OPTIONAL, INTENT(OUT) :: split_freq_
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: split_freq_format_
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: split_last_date_
+      TYPE(txios(duration))  , OPTIONAL, INTENT(OUT) :: split_start_offset_
       TYPE(txios(duration))  , OPTIONAL, INTENT(OUT) :: sync_freq_
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: time_counter_
@@ -453,4 +523,9 @@
       ENDIF
 
+      IF (PRESENT(comment_)) THEN
+        CALL cxios_get_file_comment &
+      (file_hdl%daddr, comment_, len(comment_))
+      ENDIF
+
       IF (PRESENT(compression_level_)) THEN
         CALL cxios_get_file_compression_level &
@@ -525,4 +600,10 @@
       ENDIF
 
+      IF (PRESENT(read_metadata_par_)) THEN
+        CALL cxios_get_file_read_metadata_par &
+      (file_hdl%daddr, read_metadata_par__tmp)
+        read_metadata_par_ = read_metadata_par__tmp
+      ENDIF
+
       IF (PRESENT(record_offset_)) THEN
         CALL cxios_get_file_record_offset &
@@ -530,4 +611,9 @@
       ENDIF
 
+      IF (PRESENT(split_end_offset_)) THEN
+        CALL cxios_get_file_split_end_offset &
+      (file_hdl%daddr, split_end_offset_)
+      ENDIF
+
       IF (PRESENT(split_freq_)) THEN
         CALL cxios_get_file_split_freq &
@@ -540,4 +626,14 @@
       ENDIF
 
+      IF (PRESENT(split_last_date_)) THEN
+        CALL cxios_get_file_split_last_date &
+      (file_hdl%daddr, split_last_date_, len(split_last_date_))
+      ENDIF
+
+      IF (PRESENT(split_start_offset_)) THEN
+        CALL cxios_get_file_split_start_offset &
+      (file_hdl%daddr, split_start_offset_)
+      ENDIF
+
       IF (PRESENT(sync_freq_)) THEN
         CALL cxios_get_file_sync_freq &
@@ -598,8 +694,9 @@
 
   SUBROUTINE xios(is_defined_file_attr)  &
-    ( file_id, append, compression_level, convention, convention_str, cyclic, description, enabled  &
-    , format, min_digits, mode, name, name_suffix, output_freq, output_level, par_access, record_offset  &
-    , split_freq, split_freq_format, sync_freq, time_counter, time_counter_name, time_stamp_format  &
-    , time_stamp_name, time_units, timeseries, ts_prefix, type, uuid_format, uuid_name )
+    ( file_id, append, comment, compression_level, convention, convention_str, cyclic, description  &
+    , enabled, format, min_digits, mode, name, name_suffix, output_freq, output_level, par_access  &
+    , read_metadata_par, record_offset, split_end_offset, split_freq, split_freq_format, split_last_date  &
+    , split_start_offset, sync_freq, time_counter, time_counter_name, time_stamp_format, time_stamp_name  &
+    , time_units, timeseries, ts_prefix, type, uuid_format, uuid_name )
 
     IMPLICIT NONE
@@ -608,4 +705,6 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: append
       LOGICAL(KIND=C_BOOL) :: append_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: comment
+      LOGICAL(KIND=C_BOOL) :: comment_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: compression_level
       LOGICAL(KIND=C_BOOL) :: compression_level_tmp
@@ -636,10 +735,18 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: par_access
       LOGICAL(KIND=C_BOOL) :: par_access_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: read_metadata_par
+      LOGICAL(KIND=C_BOOL) :: read_metadata_par_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: record_offset
       LOGICAL(KIND=C_BOOL) :: record_offset_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: split_end_offset
+      LOGICAL(KIND=C_BOOL) :: split_end_offset_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: split_freq
       LOGICAL(KIND=C_BOOL) :: split_freq_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: split_freq_format
       LOGICAL(KIND=C_BOOL) :: split_freq_format_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: split_last_date
+      LOGICAL(KIND=C_BOOL) :: split_last_date_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: split_start_offset
+      LOGICAL(KIND=C_BOOL) :: split_start_offset_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: sync_freq
       LOGICAL(KIND=C_BOOL) :: sync_freq_tmp
@@ -668,16 +775,18 @@
       (file_id,file_hdl)
       CALL xios(is_defined_file_attr_hdl_)   &
-      ( file_hdl, append, compression_level, convention, convention_str, cyclic, description, enabled  &
-      , format, min_digits, mode, name, name_suffix, output_freq, output_level, par_access, record_offset  &
-      , split_freq, split_freq_format, sync_freq, time_counter, time_counter_name, time_stamp_format  &
-      , time_stamp_name, time_units, timeseries, ts_prefix, type, uuid_format, uuid_name )
+      ( file_hdl, append, comment, compression_level, convention, convention_str, cyclic, description  &
+      , enabled, format, min_digits, mode, name, name_suffix, output_freq, output_level, par_access  &
+      , read_metadata_par, record_offset, split_end_offset, split_freq, split_freq_format, split_last_date  &
+      , split_start_offset, sync_freq, time_counter, time_counter_name, time_stamp_format, time_stamp_name  &
+      , time_units, timeseries, ts_prefix, type, uuid_format, uuid_name )
 
   END SUBROUTINE xios(is_defined_file_attr)
 
   SUBROUTINE xios(is_defined_file_attr_hdl)  &
-    ( file_hdl, append, compression_level, convention, convention_str, cyclic, description, enabled  &
-    , format, min_digits, mode, name, name_suffix, output_freq, output_level, par_access, record_offset  &
-    , split_freq, split_freq_format, sync_freq, time_counter, time_counter_name, time_stamp_format  &
-    , time_stamp_name, time_units, timeseries, ts_prefix, type, uuid_format, uuid_name )
+    ( file_hdl, append, comment, compression_level, convention, convention_str, cyclic, description  &
+    , enabled, format, min_digits, mode, name, name_suffix, output_freq, output_level, par_access  &
+    , read_metadata_par, record_offset, split_end_offset, split_freq, split_freq_format, split_last_date  &
+    , split_start_offset, sync_freq, time_counter, time_counter_name, time_stamp_format, time_stamp_name  &
+    , time_units, timeseries, ts_prefix, type, uuid_format, uuid_name )
 
     IMPLICIT NONE
@@ -685,4 +794,6 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: append
       LOGICAL(KIND=C_BOOL) :: append_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: comment
+      LOGICAL(KIND=C_BOOL) :: comment_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: compression_level
       LOGICAL(KIND=C_BOOL) :: compression_level_tmp
@@ -713,10 +824,18 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: par_access
       LOGICAL(KIND=C_BOOL) :: par_access_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: read_metadata_par
+      LOGICAL(KIND=C_BOOL) :: read_metadata_par_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: record_offset
       LOGICAL(KIND=C_BOOL) :: record_offset_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: split_end_offset
+      LOGICAL(KIND=C_BOOL) :: split_end_offset_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: split_freq
       LOGICAL(KIND=C_BOOL) :: split_freq_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: split_freq_format
       LOGICAL(KIND=C_BOOL) :: split_freq_format_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: split_last_date
+      LOGICAL(KIND=C_BOOL) :: split_last_date_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: split_start_offset
+      LOGICAL(KIND=C_BOOL) :: split_start_offset_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: sync_freq
       LOGICAL(KIND=C_BOOL) :: sync_freq_tmp
@@ -743,17 +862,18 @@
 
       CALL xios(is_defined_file_attr_hdl_)  &
-      ( file_hdl, append, compression_level, convention, convention_str, cyclic, description, enabled  &
-      , format, min_digits, mode, name, name_suffix, output_freq, output_level, par_access, record_offset  &
-      , split_freq, split_freq_format, sync_freq, time_counter, time_counter_name, time_stamp_format  &
-      , time_stamp_name, time_units, timeseries, ts_prefix, type, uuid_format, uuid_name )
+      ( file_hdl, append, comment, compression_level, convention, convention_str, cyclic, description  &
+      , enabled, format, min_digits, mode, name, name_suffix, output_freq, output_level, par_access  &
+      , read_metadata_par, record_offset, split_end_offset, split_freq, split_freq_format, split_last_date  &
+      , split_start_offset, sync_freq, time_counter, time_counter_name, time_stamp_format, time_stamp_name  &
+      , time_units, timeseries, ts_prefix, type, uuid_format, uuid_name )
 
   END SUBROUTINE xios(is_defined_file_attr_hdl)
 
   SUBROUTINE xios(is_defined_file_attr_hdl_)   &
-    ( file_hdl, append_, compression_level_, convention_, convention_str_, cyclic_, description_  &
+    ( file_hdl, append_, comment_, compression_level_, convention_, convention_str_, cyclic_, description_  &
     , enabled_, format_, min_digits_, mode_, name_, name_suffix_, output_freq_, output_level_, par_access_  &
-    , record_offset_, split_freq_, split_freq_format_, sync_freq_, time_counter_, time_counter_name_  &
-    , time_stamp_format_, time_stamp_name_, time_units_, timeseries_, ts_prefix_, type_, uuid_format_  &
-    , uuid_name_ )
+    , read_metadata_par_, record_offset_, split_end_offset_, split_freq_, split_freq_format_, split_last_date_  &
+    , split_start_offset_, sync_freq_, time_counter_, time_counter_name_, time_stamp_format_, time_stamp_name_  &
+    , time_units_, timeseries_, ts_prefix_, type_, uuid_format_, uuid_name_ )
 
     IMPLICIT NONE
@@ -761,4 +881,6 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: append_
       LOGICAL(KIND=C_BOOL) :: append__tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: comment_
+      LOGICAL(KIND=C_BOOL) :: comment__tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: compression_level_
       LOGICAL(KIND=C_BOOL) :: compression_level__tmp
@@ -789,10 +911,18 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: par_access_
       LOGICAL(KIND=C_BOOL) :: par_access__tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: read_metadata_par_
+      LOGICAL(KIND=C_BOOL) :: read_metadata_par__tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: record_offset_
       LOGICAL(KIND=C_BOOL) :: record_offset__tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: split_end_offset_
+      LOGICAL(KIND=C_BOOL) :: split_end_offset__tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: split_freq_
       LOGICAL(KIND=C_BOOL) :: split_freq__tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: split_freq_format_
       LOGICAL(KIND=C_BOOL) :: split_freq_format__tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: split_last_date_
+      LOGICAL(KIND=C_BOOL) :: split_last_date__tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: split_start_offset_
+      LOGICAL(KIND=C_BOOL) :: split_start_offset__tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: sync_freq_
       LOGICAL(KIND=C_BOOL) :: sync_freq__tmp
@@ -824,4 +954,10 @@
       ENDIF
 
+      IF (PRESENT(comment_)) THEN
+        comment__tmp = cxios_is_defined_file_comment &
+      (file_hdl%daddr)
+        comment_ = comment__tmp
+      ENDIF
+
       IF (PRESENT(compression_level_)) THEN
         compression_level__tmp = cxios_is_defined_file_compression_level &
@@ -908,4 +1044,10 @@
       ENDIF
 
+      IF (PRESENT(read_metadata_par_)) THEN
+        read_metadata_par__tmp = cxios_is_defined_file_read_metadata_par &
+      (file_hdl%daddr)
+        read_metadata_par_ = read_metadata_par__tmp
+      ENDIF
+
       IF (PRESENT(record_offset_)) THEN
         record_offset__tmp = cxios_is_defined_file_record_offset &
@@ -914,4 +1056,10 @@
       ENDIF
 
+      IF (PRESENT(split_end_offset_)) THEN
+        split_end_offset__tmp = cxios_is_defined_file_split_end_offset &
+      (file_hdl%daddr)
+        split_end_offset_ = split_end_offset__tmp
+      ENDIF
+
       IF (PRESENT(split_freq_)) THEN
         split_freq__tmp = cxios_is_defined_file_split_freq &
@@ -926,4 +1074,16 @@
       ENDIF
 
+      IF (PRESENT(split_last_date_)) THEN
+        split_last_date__tmp = cxios_is_defined_file_split_last_date &
+      (file_hdl%daddr)
+        split_last_date_ = split_last_date__tmp
+      ENDIF
+
+      IF (PRESENT(split_start_offset_)) THEN
+        split_start_offset__tmp = cxios_is_defined_file_split_start_offset &
+      (file_hdl%daddr)
+        split_start_offset_ = split_start_offset__tmp
+      ENDIF
+
       IF (PRESENT(sync_freq_)) THEN
         sync_freq__tmp = cxios_is_defined_file_sync_freq &
Index: /XIOS/trunk/src/interface/fortran_attr/ifilegroup_attr.F90
===================================================================
--- /XIOS/trunk/src/interface/fortran_attr/ifilegroup_attr.F90	(revision 1536)
+++ /XIOS/trunk/src/interface/fortran_attr/ifilegroup_attr.F90	(revision 1537)
@@ -12,7 +12,8 @@
 
   SUBROUTINE xios(set_filegroup_attr)  &
-    ( filegroup_id, append, compression_level, convention, convention_str, cyclic, description, enabled  &
-    , format, group_ref, min_digits, mode, name, name_suffix, output_freq, output_level, par_access  &
-    , record_offset, split_freq, split_freq_format, sync_freq, time_counter, time_counter_name, time_stamp_format  &
+    ( filegroup_id, append, comment, compression_level, convention, convention_str, cyclic, description  &
+    , enabled, format, group_ref, min_digits, mode, name, name_suffix, output_freq, output_level  &
+    , par_access, read_metadata_par, record_offset, split_end_offset, split_freq, split_freq_format  &
+    , split_last_date, split_start_offset, sync_freq, time_counter, time_counter_name, time_stamp_format  &
     , time_stamp_name, time_units, timeseries, ts_prefix, type, uuid_format, uuid_name )
 
@@ -22,4 +23,5 @@
       LOGICAL  , OPTIONAL, INTENT(IN) :: append
       LOGICAL (KIND=C_BOOL) :: append_tmp
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: comment
       INTEGER  , OPTIONAL, INTENT(IN) :: compression_level
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: convention
@@ -39,7 +41,12 @@
       INTEGER  , OPTIONAL, INTENT(IN) :: output_level
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: par_access
+      LOGICAL  , OPTIONAL, INTENT(IN) :: read_metadata_par
+      LOGICAL (KIND=C_BOOL) :: read_metadata_par_tmp
       INTEGER  , OPTIONAL, INTENT(IN) :: record_offset
+      TYPE(txios(duration))  , OPTIONAL, INTENT(IN) :: split_end_offset
       TYPE(txios(duration))  , OPTIONAL, INTENT(IN) :: split_freq
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: split_freq_format
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: split_last_date
+      TYPE(txios(duration))  , OPTIONAL, INTENT(IN) :: split_start_offset
       TYPE(txios(duration))  , OPTIONAL, INTENT(IN) :: sync_freq
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: time_counter
@@ -57,18 +64,18 @@
       (filegroup_id,filegroup_hdl)
       CALL xios(set_filegroup_attr_hdl_)   &
-      ( filegroup_hdl, append, compression_level, convention, convention_str, cyclic, description  &
+      ( filegroup_hdl, append, comment, compression_level, convention, convention_str, cyclic, description  &
       , enabled, format, group_ref, min_digits, mode, name, name_suffix, output_freq, output_level  &
-      , par_access, record_offset, split_freq, split_freq_format, sync_freq, time_counter, time_counter_name  &
-      , time_stamp_format, time_stamp_name, time_units, timeseries, ts_prefix, type, uuid_format, uuid_name  &
-       )
+      , par_access, read_metadata_par, record_offset, split_end_offset, split_freq, split_freq_format  &
+      , split_last_date, split_start_offset, sync_freq, time_counter, time_counter_name, time_stamp_format  &
+      , time_stamp_name, time_units, timeseries, ts_prefix, type, uuid_format, uuid_name )
 
   END SUBROUTINE xios(set_filegroup_attr)
 
   SUBROUTINE xios(set_filegroup_attr_hdl)  &
-    ( filegroup_hdl, append, compression_level, convention, convention_str, cyclic, description  &
+    ( filegroup_hdl, append, comment, compression_level, convention, convention_str, cyclic, description  &
     , enabled, format, group_ref, min_digits, mode, name, name_suffix, output_freq, output_level  &
-    , par_access, record_offset, split_freq, split_freq_format, sync_freq, time_counter, time_counter_name  &
-    , time_stamp_format, time_stamp_name, time_units, timeseries, ts_prefix, type, uuid_format, uuid_name  &
-     )
+    , par_access, read_metadata_par, record_offset, split_end_offset, split_freq, split_freq_format  &
+    , split_last_date, split_start_offset, sync_freq, time_counter, time_counter_name, time_stamp_format  &
+    , time_stamp_name, time_units, timeseries, ts_prefix, type, uuid_format, uuid_name )
 
     IMPLICIT NONE
@@ -76,4 +83,5 @@
       LOGICAL  , OPTIONAL, INTENT(IN) :: append
       LOGICAL (KIND=C_BOOL) :: append_tmp
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: comment
       INTEGER  , OPTIONAL, INTENT(IN) :: compression_level
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: convention
@@ -93,7 +101,12 @@
       INTEGER  , OPTIONAL, INTENT(IN) :: output_level
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: par_access
+      LOGICAL  , OPTIONAL, INTENT(IN) :: read_metadata_par
+      LOGICAL (KIND=C_BOOL) :: read_metadata_par_tmp
       INTEGER  , OPTIONAL, INTENT(IN) :: record_offset
+      TYPE(txios(duration))  , OPTIONAL, INTENT(IN) :: split_end_offset
       TYPE(txios(duration))  , OPTIONAL, INTENT(IN) :: split_freq
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: split_freq_format
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: split_last_date
+      TYPE(txios(duration))  , OPTIONAL, INTENT(IN) :: split_start_offset
       TYPE(txios(duration))  , OPTIONAL, INTENT(IN) :: sync_freq
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: time_counter
@@ -109,16 +122,17 @@
 
       CALL xios(set_filegroup_attr_hdl_)  &
-      ( filegroup_hdl, append, compression_level, convention, convention_str, cyclic, description  &
+      ( filegroup_hdl, append, comment, compression_level, convention, convention_str, cyclic, description  &
       , enabled, format, group_ref, min_digits, mode, name, name_suffix, output_freq, output_level  &
-      , par_access, record_offset, split_freq, split_freq_format, sync_freq, time_counter, time_counter_name  &
-      , time_stamp_format, time_stamp_name, time_units, timeseries, ts_prefix, type, uuid_format, uuid_name  &
-       )
+      , par_access, read_metadata_par, record_offset, split_end_offset, split_freq, split_freq_format  &
+      , split_last_date, split_start_offset, sync_freq, time_counter, time_counter_name, time_stamp_format  &
+      , time_stamp_name, time_units, timeseries, ts_prefix, type, uuid_format, uuid_name )
 
   END SUBROUTINE xios(set_filegroup_attr_hdl)
 
   SUBROUTINE xios(set_filegroup_attr_hdl_)   &
-    ( filegroup_hdl, append_, compression_level_, convention_, convention_str_, cyclic_, description_  &
-    , enabled_, format_, group_ref_, min_digits_, mode_, name_, name_suffix_, output_freq_, output_level_  &
-    , par_access_, record_offset_, split_freq_, split_freq_format_, sync_freq_, time_counter_, time_counter_name_  &
+    ( filegroup_hdl, append_, comment_, compression_level_, convention_, convention_str_, cyclic_  &
+    , description_, enabled_, format_, group_ref_, min_digits_, mode_, name_, name_suffix_, output_freq_  &
+    , output_level_, par_access_, read_metadata_par_, record_offset_, split_end_offset_, split_freq_  &
+    , split_freq_format_, split_last_date_, split_start_offset_, sync_freq_, time_counter_, time_counter_name_  &
     , time_stamp_format_, time_stamp_name_, time_units_, timeseries_, ts_prefix_, type_, uuid_format_  &
     , uuid_name_ )
@@ -128,4 +142,5 @@
       LOGICAL  , OPTIONAL, INTENT(IN) :: append_
       LOGICAL (KIND=C_BOOL) :: append__tmp
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: comment_
       INTEGER  , OPTIONAL, INTENT(IN) :: compression_level_
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: convention_
@@ -145,7 +160,12 @@
       INTEGER  , OPTIONAL, INTENT(IN) :: output_level_
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: par_access_
+      LOGICAL  , OPTIONAL, INTENT(IN) :: read_metadata_par_
+      LOGICAL (KIND=C_BOOL) :: read_metadata_par__tmp
       INTEGER  , OPTIONAL, INTENT(IN) :: record_offset_
+      TYPE(txios(duration))  , OPTIONAL, INTENT(IN) :: split_end_offset_
       TYPE(txios(duration))  , OPTIONAL, INTENT(IN) :: split_freq_
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: split_freq_format_
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: split_last_date_
+      TYPE(txios(duration))  , OPTIONAL, INTENT(IN) :: split_start_offset_
       TYPE(txios(duration))  , OPTIONAL, INTENT(IN) :: sync_freq_
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: time_counter_
@@ -166,4 +186,9 @@
       ENDIF
 
+      IF (PRESENT(comment_)) THEN
+        CALL cxios_set_filegroup_comment &
+      (filegroup_hdl%daddr, comment_, len(comment_))
+      ENDIF
+
       IF (PRESENT(compression_level_)) THEN
         CALL cxios_set_filegroup_compression_level &
@@ -243,4 +268,10 @@
       ENDIF
 
+      IF (PRESENT(read_metadata_par_)) THEN
+        read_metadata_par__tmp = read_metadata_par_
+        CALL cxios_set_filegroup_read_metadata_par &
+      (filegroup_hdl%daddr, read_metadata_par__tmp)
+      ENDIF
+
       IF (PRESENT(record_offset_)) THEN
         CALL cxios_set_filegroup_record_offset &
@@ -248,4 +279,9 @@
       ENDIF
 
+      IF (PRESENT(split_end_offset_)) THEN
+        CALL cxios_set_filegroup_split_end_offset &
+      (filegroup_hdl%daddr, split_end_offset_)
+      ENDIF
+
       IF (PRESENT(split_freq_)) THEN
         CALL cxios_set_filegroup_split_freq &
@@ -258,4 +294,14 @@
       ENDIF
 
+      IF (PRESENT(split_last_date_)) THEN
+        CALL cxios_set_filegroup_split_last_date &
+      (filegroup_hdl%daddr, split_last_date_, len(split_last_date_))
+      ENDIF
+
+      IF (PRESENT(split_start_offset_)) THEN
+        CALL cxios_set_filegroup_split_start_offset &
+      (filegroup_hdl%daddr, split_start_offset_)
+      ENDIF
+
       IF (PRESENT(sync_freq_)) THEN
         CALL cxios_set_filegroup_sync_freq &
@@ -316,7 +362,8 @@
 
   SUBROUTINE xios(get_filegroup_attr)  &
-    ( filegroup_id, append, compression_level, convention, convention_str, cyclic, description, enabled  &
-    , format, group_ref, min_digits, mode, name, name_suffix, output_freq, output_level, par_access  &
-    , record_offset, split_freq, split_freq_format, sync_freq, time_counter, time_counter_name, time_stamp_format  &
+    ( filegroup_id, append, comment, compression_level, convention, convention_str, cyclic, description  &
+    , enabled, format, group_ref, min_digits, mode, name, name_suffix, output_freq, output_level  &
+    , par_access, read_metadata_par, record_offset, split_end_offset, split_freq, split_freq_format  &
+    , split_last_date, split_start_offset, sync_freq, time_counter, time_counter_name, time_stamp_format  &
     , time_stamp_name, time_units, timeseries, ts_prefix, type, uuid_format, uuid_name )
 
@@ -326,4 +373,5 @@
       LOGICAL  , OPTIONAL, INTENT(OUT) :: append
       LOGICAL (KIND=C_BOOL) :: append_tmp
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: comment
       INTEGER  , OPTIONAL, INTENT(OUT) :: compression_level
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: convention
@@ -343,7 +391,12 @@
       INTEGER  , OPTIONAL, INTENT(OUT) :: output_level
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: par_access
+      LOGICAL  , OPTIONAL, INTENT(OUT) :: read_metadata_par
+      LOGICAL (KIND=C_BOOL) :: read_metadata_par_tmp
       INTEGER  , OPTIONAL, INTENT(OUT) :: record_offset
+      TYPE(txios(duration))  , OPTIONAL, INTENT(OUT) :: split_end_offset
       TYPE(txios(duration))  , OPTIONAL, INTENT(OUT) :: split_freq
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: split_freq_format
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: split_last_date
+      TYPE(txios(duration))  , OPTIONAL, INTENT(OUT) :: split_start_offset
       TYPE(txios(duration))  , OPTIONAL, INTENT(OUT) :: sync_freq
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: time_counter
@@ -361,18 +414,18 @@
       (filegroup_id,filegroup_hdl)
       CALL xios(get_filegroup_attr_hdl_)   &
-      ( filegroup_hdl, append, compression_level, convention, convention_str, cyclic, description  &
+      ( filegroup_hdl, append, comment, compression_level, convention, convention_str, cyclic, description  &
       , enabled, format, group_ref, min_digits, mode, name, name_suffix, output_freq, output_level  &
-      , par_access, record_offset, split_freq, split_freq_format, sync_freq, time_counter, time_counter_name  &
-      , time_stamp_format, time_stamp_name, time_units, timeseries, ts_prefix, type, uuid_format, uuid_name  &
-       )
+      , par_access, read_metadata_par, record_offset, split_end_offset, split_freq, split_freq_format  &
+      , split_last_date, split_start_offset, sync_freq, time_counter, time_counter_name, time_stamp_format  &
+      , time_stamp_name, time_units, timeseries, ts_prefix, type, uuid_format, uuid_name )
 
   END SUBROUTINE xios(get_filegroup_attr)
 
   SUBROUTINE xios(get_filegroup_attr_hdl)  &
-    ( filegroup_hdl, append, compression_level, convention, convention_str, cyclic, description  &
+    ( filegroup_hdl, append, comment, compression_level, convention, convention_str, cyclic, description  &
     , enabled, format, group_ref, min_digits, mode, name, name_suffix, output_freq, output_level  &
-    , par_access, record_offset, split_freq, split_freq_format, sync_freq, time_counter, time_counter_name  &
-    , time_stamp_format, time_stamp_name, time_units, timeseries, ts_prefix, type, uuid_format, uuid_name  &
-     )
+    , par_access, read_metadata_par, record_offset, split_end_offset, split_freq, split_freq_format  &
+    , split_last_date, split_start_offset, sync_freq, time_counter, time_counter_name, time_stamp_format  &
+    , time_stamp_name, time_units, timeseries, ts_prefix, type, uuid_format, uuid_name )
 
     IMPLICIT NONE
@@ -380,4 +433,5 @@
       LOGICAL  , OPTIONAL, INTENT(OUT) :: append
       LOGICAL (KIND=C_BOOL) :: append_tmp
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: comment
       INTEGER  , OPTIONAL, INTENT(OUT) :: compression_level
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: convention
@@ -397,7 +451,12 @@
       INTEGER  , OPTIONAL, INTENT(OUT) :: output_level
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: par_access
+      LOGICAL  , OPTIONAL, INTENT(OUT) :: read_metadata_par
+      LOGICAL (KIND=C_BOOL) :: read_metadata_par_tmp
       INTEGER  , OPTIONAL, INTENT(OUT) :: record_offset
+      TYPE(txios(duration))  , OPTIONAL, INTENT(OUT) :: split_end_offset
       TYPE(txios(duration))  , OPTIONAL, INTENT(OUT) :: split_freq
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: split_freq_format
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: split_last_date
+      TYPE(txios(duration))  , OPTIONAL, INTENT(OUT) :: split_start_offset
       TYPE(txios(duration))  , OPTIONAL, INTENT(OUT) :: sync_freq
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: time_counter
@@ -413,16 +472,17 @@
 
       CALL xios(get_filegroup_attr_hdl_)  &
-      ( filegroup_hdl, append, compression_level, convention, convention_str, cyclic, description  &
+      ( filegroup_hdl, append, comment, compression_level, convention, convention_str, cyclic, description  &
       , enabled, format, group_ref, min_digits, mode, name, name_suffix, output_freq, output_level  &
-      , par_access, record_offset, split_freq, split_freq_format, sync_freq, time_counter, time_counter_name  &
-      , time_stamp_format, time_stamp_name, time_units, timeseries, ts_prefix, type, uuid_format, uuid_name  &
-       )
+      , par_access, read_metadata_par, record_offset, split_end_offset, split_freq, split_freq_format  &
+      , split_last_date, split_start_offset, sync_freq, time_counter, time_counter_name, time_stamp_format  &
+      , time_stamp_name, time_units, timeseries, ts_prefix, type, uuid_format, uuid_name )
 
   END SUBROUTINE xios(get_filegroup_attr_hdl)
 
   SUBROUTINE xios(get_filegroup_attr_hdl_)   &
-    ( filegroup_hdl, append_, compression_level_, convention_, convention_str_, cyclic_, description_  &
-    , enabled_, format_, group_ref_, min_digits_, mode_, name_, name_suffix_, output_freq_, output_level_  &
-    , par_access_, record_offset_, split_freq_, split_freq_format_, sync_freq_, time_counter_, time_counter_name_  &
+    ( filegroup_hdl, append_, comment_, compression_level_, convention_, convention_str_, cyclic_  &
+    , description_, enabled_, format_, group_ref_, min_digits_, mode_, name_, name_suffix_, output_freq_  &
+    , output_level_, par_access_, read_metadata_par_, record_offset_, split_end_offset_, split_freq_  &
+    , split_freq_format_, split_last_date_, split_start_offset_, sync_freq_, time_counter_, time_counter_name_  &
     , time_stamp_format_, time_stamp_name_, time_units_, timeseries_, ts_prefix_, type_, uuid_format_  &
     , uuid_name_ )
@@ -432,4 +492,5 @@
       LOGICAL  , OPTIONAL, INTENT(OUT) :: append_
       LOGICAL (KIND=C_BOOL) :: append__tmp
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: comment_
       INTEGER  , OPTIONAL, INTENT(OUT) :: compression_level_
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: convention_
@@ -449,7 +510,12 @@
       INTEGER  , OPTIONAL, INTENT(OUT) :: output_level_
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: par_access_
+      LOGICAL  , OPTIONAL, INTENT(OUT) :: read_metadata_par_
+      LOGICAL (KIND=C_BOOL) :: read_metadata_par__tmp
       INTEGER  , OPTIONAL, INTENT(OUT) :: record_offset_
+      TYPE(txios(duration))  , OPTIONAL, INTENT(OUT) :: split_end_offset_
       TYPE(txios(duration))  , OPTIONAL, INTENT(OUT) :: split_freq_
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: split_freq_format_
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: split_last_date_
+      TYPE(txios(duration))  , OPTIONAL, INTENT(OUT) :: split_start_offset_
       TYPE(txios(duration))  , OPTIONAL, INTENT(OUT) :: sync_freq_
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: time_counter_
@@ -470,4 +536,9 @@
       ENDIF
 
+      IF (PRESENT(comment_)) THEN
+        CALL cxios_get_filegroup_comment &
+      (filegroup_hdl%daddr, comment_, len(comment_))
+      ENDIF
+
       IF (PRESENT(compression_level_)) THEN
         CALL cxios_get_filegroup_compression_level &
@@ -547,4 +618,10 @@
       ENDIF
 
+      IF (PRESENT(read_metadata_par_)) THEN
+        CALL cxios_get_filegroup_read_metadata_par &
+      (filegroup_hdl%daddr, read_metadata_par__tmp)
+        read_metadata_par_ = read_metadata_par__tmp
+      ENDIF
+
       IF (PRESENT(record_offset_)) THEN
         CALL cxios_get_filegroup_record_offset &
@@ -552,4 +629,9 @@
       ENDIF
 
+      IF (PRESENT(split_end_offset_)) THEN
+        CALL cxios_get_filegroup_split_end_offset &
+      (filegroup_hdl%daddr, split_end_offset_)
+      ENDIF
+
       IF (PRESENT(split_freq_)) THEN
         CALL cxios_get_filegroup_split_freq &
@@ -562,4 +644,14 @@
       ENDIF
 
+      IF (PRESENT(split_last_date_)) THEN
+        CALL cxios_get_filegroup_split_last_date &
+      (filegroup_hdl%daddr, split_last_date_, len(split_last_date_))
+      ENDIF
+
+      IF (PRESENT(split_start_offset_)) THEN
+        CALL cxios_get_filegroup_split_start_offset &
+      (filegroup_hdl%daddr, split_start_offset_)
+      ENDIF
+
       IF (PRESENT(sync_freq_)) THEN
         CALL cxios_get_filegroup_sync_freq &
@@ -620,7 +712,8 @@
 
   SUBROUTINE xios(is_defined_filegroup_attr)  &
-    ( filegroup_id, append, compression_level, convention, convention_str, cyclic, description, enabled  &
-    , format, group_ref, min_digits, mode, name, name_suffix, output_freq, output_level, par_access  &
-    , record_offset, split_freq, split_freq_format, sync_freq, time_counter, time_counter_name, time_stamp_format  &
+    ( filegroup_id, append, comment, compression_level, convention, convention_str, cyclic, description  &
+    , enabled, format, group_ref, min_digits, mode, name, name_suffix, output_freq, output_level  &
+    , par_access, read_metadata_par, record_offset, split_end_offset, split_freq, split_freq_format  &
+    , split_last_date, split_start_offset, sync_freq, time_counter, time_counter_name, time_stamp_format  &
     , time_stamp_name, time_units, timeseries, ts_prefix, type, uuid_format, uuid_name )
 
@@ -630,4 +723,6 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: append
       LOGICAL(KIND=C_BOOL) :: append_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: comment
+      LOGICAL(KIND=C_BOOL) :: comment_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: compression_level
       LOGICAL(KIND=C_BOOL) :: compression_level_tmp
@@ -660,10 +755,18 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: par_access
       LOGICAL(KIND=C_BOOL) :: par_access_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: read_metadata_par
+      LOGICAL(KIND=C_BOOL) :: read_metadata_par_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: record_offset
       LOGICAL(KIND=C_BOOL) :: record_offset_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: split_end_offset
+      LOGICAL(KIND=C_BOOL) :: split_end_offset_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: split_freq
       LOGICAL(KIND=C_BOOL) :: split_freq_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: split_freq_format
       LOGICAL(KIND=C_BOOL) :: split_freq_format_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: split_last_date
+      LOGICAL(KIND=C_BOOL) :: split_last_date_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: split_start_offset
+      LOGICAL(KIND=C_BOOL) :: split_start_offset_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: sync_freq
       LOGICAL(KIND=C_BOOL) :: sync_freq_tmp
@@ -692,18 +795,18 @@
       (filegroup_id,filegroup_hdl)
       CALL xios(is_defined_filegroup_attr_hdl_)   &
-      ( filegroup_hdl, append, compression_level, convention, convention_str, cyclic, description  &
+      ( filegroup_hdl, append, comment, compression_level, convention, convention_str, cyclic, description  &
       , enabled, format, group_ref, min_digits, mode, name, name_suffix, output_freq, output_level  &
-      , par_access, record_offset, split_freq, split_freq_format, sync_freq, time_counter, time_counter_name  &
-      , time_stamp_format, time_stamp_name, time_units, timeseries, ts_prefix, type, uuid_format, uuid_name  &
-       )
+      , par_access, read_metadata_par, record_offset, split_end_offset, split_freq, split_freq_format  &
+      , split_last_date, split_start_offset, sync_freq, time_counter, time_counter_name, time_stamp_format  &
+      , time_stamp_name, time_units, timeseries, ts_prefix, type, uuid_format, uuid_name )
 
   END SUBROUTINE xios(is_defined_filegroup_attr)
 
   SUBROUTINE xios(is_defined_filegroup_attr_hdl)  &
-    ( filegroup_hdl, append, compression_level, convention, convention_str, cyclic, description  &
+    ( filegroup_hdl, append, comment, compression_level, convention, convention_str, cyclic, description  &
     , enabled, format, group_ref, min_digits, mode, name, name_suffix, output_freq, output_level  &
-    , par_access, record_offset, split_freq, split_freq_format, sync_freq, time_counter, time_counter_name  &
-    , time_stamp_format, time_stamp_name, time_units, timeseries, ts_prefix, type, uuid_format, uuid_name  &
-     )
+    , par_access, read_metadata_par, record_offset, split_end_offset, split_freq, split_freq_format  &
+    , split_last_date, split_start_offset, sync_freq, time_counter, time_counter_name, time_stamp_format  &
+    , time_stamp_name, time_units, timeseries, ts_prefix, type, uuid_format, uuid_name )
 
     IMPLICIT NONE
@@ -711,4 +814,6 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: append
       LOGICAL(KIND=C_BOOL) :: append_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: comment
+      LOGICAL(KIND=C_BOOL) :: comment_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: compression_level
       LOGICAL(KIND=C_BOOL) :: compression_level_tmp
@@ -741,10 +846,18 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: par_access
       LOGICAL(KIND=C_BOOL) :: par_access_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: read_metadata_par
+      LOGICAL(KIND=C_BOOL) :: read_metadata_par_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: record_offset
       LOGICAL(KIND=C_BOOL) :: record_offset_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: split_end_offset
+      LOGICAL(KIND=C_BOOL) :: split_end_offset_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: split_freq
       LOGICAL(KIND=C_BOOL) :: split_freq_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: split_freq_format
       LOGICAL(KIND=C_BOOL) :: split_freq_format_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: split_last_date
+      LOGICAL(KIND=C_BOOL) :: split_last_date_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: split_start_offset
+      LOGICAL(KIND=C_BOOL) :: split_start_offset_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: sync_freq
       LOGICAL(KIND=C_BOOL) :: sync_freq_tmp
@@ -771,16 +884,17 @@
 
       CALL xios(is_defined_filegroup_attr_hdl_)  &
-      ( filegroup_hdl, append, compression_level, convention, convention_str, cyclic, description  &
+      ( filegroup_hdl, append, comment, compression_level, convention, convention_str, cyclic, description  &
       , enabled, format, group_ref, min_digits, mode, name, name_suffix, output_freq, output_level  &
-      , par_access, record_offset, split_freq, split_freq_format, sync_freq, time_counter, time_counter_name  &
-      , time_stamp_format, time_stamp_name, time_units, timeseries, ts_prefix, type, uuid_format, uuid_name  &
-       )
+      , par_access, read_metadata_par, record_offset, split_end_offset, split_freq, split_freq_format  &
+      , split_last_date, split_start_offset, sync_freq, time_counter, time_counter_name, time_stamp_format  &
+      , time_stamp_name, time_units, timeseries, ts_prefix, type, uuid_format, uuid_name )
 
   END SUBROUTINE xios(is_defined_filegroup_attr_hdl)
 
   SUBROUTINE xios(is_defined_filegroup_attr_hdl_)   &
-    ( filegroup_hdl, append_, compression_level_, convention_, convention_str_, cyclic_, description_  &
-    , enabled_, format_, group_ref_, min_digits_, mode_, name_, name_suffix_, output_freq_, output_level_  &
-    , par_access_, record_offset_, split_freq_, split_freq_format_, sync_freq_, time_counter_, time_counter_name_  &
+    ( filegroup_hdl, append_, comment_, compression_level_, convention_, convention_str_, cyclic_  &
+    , description_, enabled_, format_, group_ref_, min_digits_, mode_, name_, name_suffix_, output_freq_  &
+    , output_level_, par_access_, read_metadata_par_, record_offset_, split_end_offset_, split_freq_  &
+    , split_freq_format_, split_last_date_, split_start_offset_, sync_freq_, time_counter_, time_counter_name_  &
     , time_stamp_format_, time_stamp_name_, time_units_, timeseries_, ts_prefix_, type_, uuid_format_  &
     , uuid_name_ )
@@ -790,4 +904,6 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: append_
       LOGICAL(KIND=C_BOOL) :: append__tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: comment_
+      LOGICAL(KIND=C_BOOL) :: comment__tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: compression_level_
       LOGICAL(KIND=C_BOOL) :: compression_level__tmp
@@ -820,10 +936,18 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: par_access_
       LOGICAL(KIND=C_BOOL) :: par_access__tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: read_metadata_par_
+      LOGICAL(KIND=C_BOOL) :: read_metadata_par__tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: record_offset_
       LOGICAL(KIND=C_BOOL) :: record_offset__tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: split_end_offset_
+      LOGICAL(KIND=C_BOOL) :: split_end_offset__tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: split_freq_
       LOGICAL(KIND=C_BOOL) :: split_freq__tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: split_freq_format_
       LOGICAL(KIND=C_BOOL) :: split_freq_format__tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: split_last_date_
+      LOGICAL(KIND=C_BOOL) :: split_last_date__tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: split_start_offset_
+      LOGICAL(KIND=C_BOOL) :: split_start_offset__tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: sync_freq_
       LOGICAL(KIND=C_BOOL) :: sync_freq__tmp
@@ -855,4 +979,10 @@
       ENDIF
 
+      IF (PRESENT(comment_)) THEN
+        comment__tmp = cxios_is_defined_filegroup_comment &
+      (filegroup_hdl%daddr)
+        comment_ = comment__tmp
+      ENDIF
+
       IF (PRESENT(compression_level_)) THEN
         compression_level__tmp = cxios_is_defined_filegroup_compression_level &
@@ -945,4 +1075,10 @@
       ENDIF
 
+      IF (PRESENT(read_metadata_par_)) THEN
+        read_metadata_par__tmp = cxios_is_defined_filegroup_read_metadata_par &
+      (filegroup_hdl%daddr)
+        read_metadata_par_ = read_metadata_par__tmp
+      ENDIF
+
       IF (PRESENT(record_offset_)) THEN
         record_offset__tmp = cxios_is_defined_filegroup_record_offset &
@@ -951,4 +1087,10 @@
       ENDIF
 
+      IF (PRESENT(split_end_offset_)) THEN
+        split_end_offset__tmp = cxios_is_defined_filegroup_split_end_offset &
+      (filegroup_hdl%daddr)
+        split_end_offset_ = split_end_offset__tmp
+      ENDIF
+
       IF (PRESENT(split_freq_)) THEN
         split_freq__tmp = cxios_is_defined_filegroup_split_freq &
@@ -963,4 +1105,16 @@
       ENDIF
 
+      IF (PRESENT(split_last_date_)) THEN
+        split_last_date__tmp = cxios_is_defined_filegroup_split_last_date &
+      (filegroup_hdl%daddr)
+        split_last_date_ = split_last_date__tmp
+      ENDIF
+
+      IF (PRESENT(split_start_offset_)) THEN
+        split_start_offset__tmp = cxios_is_defined_filegroup_split_start_offset &
+      (filegroup_hdl%daddr)
+        split_start_offset_ = split_start_offset__tmp
+      ENDIF
+
       IF (PRESENT(sync_freq_)) THEN
         sync_freq__tmp = cxios_is_defined_filegroup_sync_freq &
Index: /XIOS/trunk/src/interface/fortran_attr/igrid_attr.F90
===================================================================
--- /XIOS/trunk/src/interface/fortran_attr/igrid_attr.F90	(revision 1536)
+++ /XIOS/trunk/src/interface/fortran_attr/igrid_attr.F90	(revision 1537)
@@ -12,11 +12,14 @@
 
   SUBROUTINE xios(set_grid_attr)  &
-    ( grid_id, description, mask_1d, mask_2d, mask_3d, mask_4d, mask_5d, mask_6d, mask_7d, name  &
-     )
+    ( grid_id, comment, description, mask_0d, mask_1d, mask_2d, mask_3d, mask_4d, mask_5d, mask_6d  &
+    , mask_7d, name )
 
     IMPLICIT NONE
       TYPE(txios(grid))  :: grid_hdl
       CHARACTER(LEN=*), INTENT(IN) ::grid_id
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: comment
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: description
+      LOGICAL  , OPTIONAL, INTENT(IN) :: mask_0d(:)
+      LOGICAL (KIND=C_BOOL) , ALLOCATABLE :: mask_0d_tmp(:)
       LOGICAL  , OPTIONAL, INTENT(IN) :: mask_1d(:)
       LOGICAL (KIND=C_BOOL) , ALLOCATABLE :: mask_1d_tmp(:)
@@ -38,16 +41,19 @@
       (grid_id,grid_hdl)
       CALL xios(set_grid_attr_hdl_)   &
-      ( grid_hdl, description, mask_1d, mask_2d, mask_3d, mask_4d, mask_5d, mask_6d, mask_7d, name  &
-       )
+      ( grid_hdl, comment, description, mask_0d, mask_1d, mask_2d, mask_3d, mask_4d, mask_5d, mask_6d  &
+      , mask_7d, name )
 
   END SUBROUTINE xios(set_grid_attr)
 
   SUBROUTINE xios(set_grid_attr_hdl)  &
-    ( grid_hdl, description, mask_1d, mask_2d, mask_3d, mask_4d, mask_5d, mask_6d, mask_7d, name  &
-     )
+    ( grid_hdl, comment, description, mask_0d, mask_1d, mask_2d, mask_3d, mask_4d, mask_5d, mask_6d  &
+    , mask_7d, name )
 
     IMPLICIT NONE
       TYPE(txios(grid)) , INTENT(IN) :: grid_hdl
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: comment
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: description
+      LOGICAL  , OPTIONAL, INTENT(IN) :: mask_0d(:)
+      LOGICAL (KIND=C_BOOL) , ALLOCATABLE :: mask_0d_tmp(:)
       LOGICAL  , OPTIONAL, INTENT(IN) :: mask_1d(:)
       LOGICAL (KIND=C_BOOL) , ALLOCATABLE :: mask_1d_tmp(:)
@@ -67,16 +73,19 @@
 
       CALL xios(set_grid_attr_hdl_)  &
-      ( grid_hdl, description, mask_1d, mask_2d, mask_3d, mask_4d, mask_5d, mask_6d, mask_7d, name  &
-       )
+      ( grid_hdl, comment, description, mask_0d, mask_1d, mask_2d, mask_3d, mask_4d, mask_5d, mask_6d  &
+      , mask_7d, name )
 
   END SUBROUTINE xios(set_grid_attr_hdl)
 
   SUBROUTINE xios(set_grid_attr_hdl_)   &
-    ( grid_hdl, description_, mask_1d_, mask_2d_, mask_3d_, mask_4d_, mask_5d_, mask_6d_, mask_7d_  &
-    , name_ )
+    ( grid_hdl, comment_, description_, mask_0d_, mask_1d_, mask_2d_, mask_3d_, mask_4d_, mask_5d_  &
+    , mask_6d_, mask_7d_, name_ )
 
     IMPLICIT NONE
       TYPE(txios(grid)) , INTENT(IN) :: grid_hdl
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: comment_
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: description_
+      LOGICAL  , OPTIONAL, INTENT(IN) :: mask_0d_(:)
+      LOGICAL (KIND=C_BOOL) , ALLOCATABLE :: mask_0d__tmp(:)
       LOGICAL  , OPTIONAL, INTENT(IN) :: mask_1d_(:)
       LOGICAL (KIND=C_BOOL) , ALLOCATABLE :: mask_1d__tmp(:)
@@ -95,7 +104,19 @@
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: name_
 
+      IF (PRESENT(comment_)) THEN
+        CALL cxios_set_grid_comment &
+      (grid_hdl%daddr, comment_, len(comment_))
+      ENDIF
+
       IF (PRESENT(description_)) THEN
         CALL cxios_set_grid_description &
       (grid_hdl%daddr, description_, len(description_))
+      ENDIF
+
+      IF (PRESENT(mask_0d_)) THEN
+        ALLOCATE(mask_0d__tmp(SIZE(mask_0d_,1)))
+        mask_0d__tmp = mask_0d_
+        CALL cxios_set_grid_mask_0d &
+      (grid_hdl%daddr, mask_0d__tmp, SHAPE(mask_0d_))
       ENDIF
 
@@ -162,11 +183,14 @@
 
   SUBROUTINE xios(get_grid_attr)  &
-    ( grid_id, description, mask_1d, mask_2d, mask_3d, mask_4d, mask_5d, mask_6d, mask_7d, name  &
-     )
+    ( grid_id, comment, description, mask_0d, mask_1d, mask_2d, mask_3d, mask_4d, mask_5d, mask_6d  &
+    , mask_7d, name )
 
     IMPLICIT NONE
       TYPE(txios(grid))  :: grid_hdl
       CHARACTER(LEN=*), INTENT(IN) ::grid_id
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: comment
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: description
+      LOGICAL  , OPTIONAL, INTENT(OUT) :: mask_0d(:)
+      LOGICAL (KIND=C_BOOL) , ALLOCATABLE :: mask_0d_tmp(:)
       LOGICAL  , OPTIONAL, INTENT(OUT) :: mask_1d(:)
       LOGICAL (KIND=C_BOOL) , ALLOCATABLE :: mask_1d_tmp(:)
@@ -188,16 +212,19 @@
       (grid_id,grid_hdl)
       CALL xios(get_grid_attr_hdl_)   &
-      ( grid_hdl, description, mask_1d, mask_2d, mask_3d, mask_4d, mask_5d, mask_6d, mask_7d, name  &
-       )
+      ( grid_hdl, comment, description, mask_0d, mask_1d, mask_2d, mask_3d, mask_4d, mask_5d, mask_6d  &
+      , mask_7d, name )
 
   END SUBROUTINE xios(get_grid_attr)
 
   SUBROUTINE xios(get_grid_attr_hdl)  &
-    ( grid_hdl, description, mask_1d, mask_2d, mask_3d, mask_4d, mask_5d, mask_6d, mask_7d, name  &
-     )
+    ( grid_hdl, comment, description, mask_0d, mask_1d, mask_2d, mask_3d, mask_4d, mask_5d, mask_6d  &
+    , mask_7d, name )
 
     IMPLICIT NONE
       TYPE(txios(grid)) , INTENT(IN) :: grid_hdl
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: comment
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: description
+      LOGICAL  , OPTIONAL, INTENT(OUT) :: mask_0d(:)
+      LOGICAL (KIND=C_BOOL) , ALLOCATABLE :: mask_0d_tmp(:)
       LOGICAL  , OPTIONAL, INTENT(OUT) :: mask_1d(:)
       LOGICAL (KIND=C_BOOL) , ALLOCATABLE :: mask_1d_tmp(:)
@@ -217,16 +244,19 @@
 
       CALL xios(get_grid_attr_hdl_)  &
-      ( grid_hdl, description, mask_1d, mask_2d, mask_3d, mask_4d, mask_5d, mask_6d, mask_7d, name  &
-       )
+      ( grid_hdl, comment, description, mask_0d, mask_1d, mask_2d, mask_3d, mask_4d, mask_5d, mask_6d  &
+      , mask_7d, name )
 
   END SUBROUTINE xios(get_grid_attr_hdl)
 
   SUBROUTINE xios(get_grid_attr_hdl_)   &
-    ( grid_hdl, description_, mask_1d_, mask_2d_, mask_3d_, mask_4d_, mask_5d_, mask_6d_, mask_7d_  &
-    , name_ )
+    ( grid_hdl, comment_, description_, mask_0d_, mask_1d_, mask_2d_, mask_3d_, mask_4d_, mask_5d_  &
+    , mask_6d_, mask_7d_, name_ )
 
     IMPLICIT NONE
       TYPE(txios(grid)) , INTENT(IN) :: grid_hdl
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: comment_
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: description_
+      LOGICAL  , OPTIONAL, INTENT(OUT) :: mask_0d_(:)
+      LOGICAL (KIND=C_BOOL) , ALLOCATABLE :: mask_0d__tmp(:)
       LOGICAL  , OPTIONAL, INTENT(OUT) :: mask_1d_(:)
       LOGICAL (KIND=C_BOOL) , ALLOCATABLE :: mask_1d__tmp(:)
@@ -245,7 +275,19 @@
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: name_
 
+      IF (PRESENT(comment_)) THEN
+        CALL cxios_get_grid_comment &
+      (grid_hdl%daddr, comment_, len(comment_))
+      ENDIF
+
       IF (PRESENT(description_)) THEN
         CALL cxios_get_grid_description &
       (grid_hdl%daddr, description_, len(description_))
+      ENDIF
+
+      IF (PRESENT(mask_0d_)) THEN
+        ALLOCATE(mask_0d__tmp(SIZE(mask_0d_,1)))
+        CALL cxios_get_grid_mask_0d &
+      (grid_hdl%daddr, mask_0d__tmp, SHAPE(mask_0d_))
+        mask_0d_ = mask_0d__tmp
       ENDIF
 
@@ -312,12 +354,16 @@
 
   SUBROUTINE xios(is_defined_grid_attr)  &
-    ( grid_id, description, mask_1d, mask_2d, mask_3d, mask_4d, mask_5d, mask_6d, mask_7d, name  &
-     )
+    ( grid_id, comment, description, mask_0d, mask_1d, mask_2d, mask_3d, mask_4d, mask_5d, mask_6d  &
+    , mask_7d, name )
 
     IMPLICIT NONE
       TYPE(txios(grid))  :: grid_hdl
       CHARACTER(LEN=*), INTENT(IN) ::grid_id
+      LOGICAL, OPTIONAL, INTENT(OUT) :: comment
+      LOGICAL(KIND=C_BOOL) :: comment_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: description
       LOGICAL(KIND=C_BOOL) :: description_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: mask_0d
+      LOGICAL(KIND=C_BOOL) :: mask_0d_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: mask_1d
       LOGICAL(KIND=C_BOOL) :: mask_1d_tmp
@@ -340,17 +386,21 @@
       (grid_id,grid_hdl)
       CALL xios(is_defined_grid_attr_hdl_)   &
-      ( grid_hdl, description, mask_1d, mask_2d, mask_3d, mask_4d, mask_5d, mask_6d, mask_7d, name  &
-       )
+      ( grid_hdl, comment, description, mask_0d, mask_1d, mask_2d, mask_3d, mask_4d, mask_5d, mask_6d  &
+      , mask_7d, name )
 
   END SUBROUTINE xios(is_defined_grid_attr)
 
   SUBROUTINE xios(is_defined_grid_attr_hdl)  &
-    ( grid_hdl, description, mask_1d, mask_2d, mask_3d, mask_4d, mask_5d, mask_6d, mask_7d, name  &
-     )
+    ( grid_hdl, comment, description, mask_0d, mask_1d, mask_2d, mask_3d, mask_4d, mask_5d, mask_6d  &
+    , mask_7d, name )
 
     IMPLICIT NONE
       TYPE(txios(grid)) , INTENT(IN) :: grid_hdl
+      LOGICAL, OPTIONAL, INTENT(OUT) :: comment
+      LOGICAL(KIND=C_BOOL) :: comment_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: description
       LOGICAL(KIND=C_BOOL) :: description_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: mask_0d
+      LOGICAL(KIND=C_BOOL) :: mask_0d_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: mask_1d
       LOGICAL(KIND=C_BOOL) :: mask_1d_tmp
@@ -371,17 +421,21 @@
 
       CALL xios(is_defined_grid_attr_hdl_)  &
-      ( grid_hdl, description, mask_1d, mask_2d, mask_3d, mask_4d, mask_5d, mask_6d, mask_7d, name  &
-       )
+      ( grid_hdl, comment, description, mask_0d, mask_1d, mask_2d, mask_3d, mask_4d, mask_5d, mask_6d  &
+      , mask_7d, name )
 
   END SUBROUTINE xios(is_defined_grid_attr_hdl)
 
   SUBROUTINE xios(is_defined_grid_attr_hdl_)   &
-    ( grid_hdl, description_, mask_1d_, mask_2d_, mask_3d_, mask_4d_, mask_5d_, mask_6d_, mask_7d_  &
-    , name_ )
+    ( grid_hdl, comment_, description_, mask_0d_, mask_1d_, mask_2d_, mask_3d_, mask_4d_, mask_5d_  &
+    , mask_6d_, mask_7d_, name_ )
 
     IMPLICIT NONE
       TYPE(txios(grid)) , INTENT(IN) :: grid_hdl
+      LOGICAL, OPTIONAL, INTENT(OUT) :: comment_
+      LOGICAL(KIND=C_BOOL) :: comment__tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: description_
       LOGICAL(KIND=C_BOOL) :: description__tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: mask_0d_
+      LOGICAL(KIND=C_BOOL) :: mask_0d__tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: mask_1d_
       LOGICAL(KIND=C_BOOL) :: mask_1d__tmp
@@ -401,4 +455,10 @@
       LOGICAL(KIND=C_BOOL) :: name__tmp
 
+      IF (PRESENT(comment_)) THEN
+        comment__tmp = cxios_is_defined_grid_comment &
+      (grid_hdl%daddr)
+        comment_ = comment__tmp
+      ENDIF
+
       IF (PRESENT(description_)) THEN
         description__tmp = cxios_is_defined_grid_description &
@@ -407,4 +467,10 @@
       ENDIF
 
+      IF (PRESENT(mask_0d_)) THEN
+        mask_0d__tmp = cxios_is_defined_grid_mask_0d &
+      (grid_hdl%daddr)
+        mask_0d_ = mask_0d__tmp
+      ENDIF
+
       IF (PRESENT(mask_1d_)) THEN
         mask_1d__tmp = cxios_is_defined_grid_mask_1d &
Index: /XIOS/trunk/src/interface/fortran_attr/igridgroup_attr.F90
===================================================================
--- /XIOS/trunk/src/interface/fortran_attr/igridgroup_attr.F90	(revision 1536)
+++ /XIOS/trunk/src/interface/fortran_attr/igridgroup_attr.F90	(revision 1537)
@@ -12,12 +12,15 @@
 
   SUBROUTINE xios(set_gridgroup_attr)  &
-    ( gridgroup_id, description, group_ref, mask_1d, mask_2d, mask_3d, mask_4d, mask_5d, mask_6d  &
-    , mask_7d, name )
+    ( gridgroup_id, comment, description, group_ref, mask_0d, mask_1d, mask_2d, mask_3d, mask_4d  &
+    , mask_5d, mask_6d, mask_7d, name )
 
     IMPLICIT NONE
       TYPE(txios(gridgroup))  :: gridgroup_hdl
       CHARACTER(LEN=*), INTENT(IN) ::gridgroup_id
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: comment
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: description
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: group_ref
+      LOGICAL  , OPTIONAL, INTENT(IN) :: mask_0d(:)
+      LOGICAL (KIND=C_BOOL) , ALLOCATABLE :: mask_0d_tmp(:)
       LOGICAL  , OPTIONAL, INTENT(IN) :: mask_1d(:)
       LOGICAL (KIND=C_BOOL) , ALLOCATABLE :: mask_1d_tmp(:)
@@ -39,17 +42,20 @@
       (gridgroup_id,gridgroup_hdl)
       CALL xios(set_gridgroup_attr_hdl_)   &
-      ( gridgroup_hdl, description, group_ref, mask_1d, mask_2d, mask_3d, mask_4d, mask_5d, mask_6d  &
-      , mask_7d, name )
+      ( gridgroup_hdl, comment, description, group_ref, mask_0d, mask_1d, mask_2d, mask_3d, mask_4d  &
+      , mask_5d, mask_6d, mask_7d, name )
 
   END SUBROUTINE xios(set_gridgroup_attr)
 
   SUBROUTINE xios(set_gridgroup_attr_hdl)  &
-    ( gridgroup_hdl, description, group_ref, mask_1d, mask_2d, mask_3d, mask_4d, mask_5d, mask_6d  &
-    , mask_7d, name )
+    ( gridgroup_hdl, comment, description, group_ref, mask_0d, mask_1d, mask_2d, mask_3d, mask_4d  &
+    , mask_5d, mask_6d, mask_7d, name )
 
     IMPLICIT NONE
       TYPE(txios(gridgroup)) , INTENT(IN) :: gridgroup_hdl
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: comment
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: description
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: group_ref
+      LOGICAL  , OPTIONAL, INTENT(IN) :: mask_0d(:)
+      LOGICAL (KIND=C_BOOL) , ALLOCATABLE :: mask_0d_tmp(:)
       LOGICAL  , OPTIONAL, INTENT(IN) :: mask_1d(:)
       LOGICAL (KIND=C_BOOL) , ALLOCATABLE :: mask_1d_tmp(:)
@@ -69,17 +75,20 @@
 
       CALL xios(set_gridgroup_attr_hdl_)  &
-      ( gridgroup_hdl, description, group_ref, mask_1d, mask_2d, mask_3d, mask_4d, mask_5d, mask_6d  &
-      , mask_7d, name )
+      ( gridgroup_hdl, comment, description, group_ref, mask_0d, mask_1d, mask_2d, mask_3d, mask_4d  &
+      , mask_5d, mask_6d, mask_7d, name )
 
   END SUBROUTINE xios(set_gridgroup_attr_hdl)
 
   SUBROUTINE xios(set_gridgroup_attr_hdl_)   &
-    ( gridgroup_hdl, description_, group_ref_, mask_1d_, mask_2d_, mask_3d_, mask_4d_, mask_5d_  &
-    , mask_6d_, mask_7d_, name_ )
+    ( gridgroup_hdl, comment_, description_, group_ref_, mask_0d_, mask_1d_, mask_2d_, mask_3d_  &
+    , mask_4d_, mask_5d_, mask_6d_, mask_7d_, name_ )
 
     IMPLICIT NONE
       TYPE(txios(gridgroup)) , INTENT(IN) :: gridgroup_hdl
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: comment_
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: description_
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: group_ref_
+      LOGICAL  , OPTIONAL, INTENT(IN) :: mask_0d_(:)
+      LOGICAL (KIND=C_BOOL) , ALLOCATABLE :: mask_0d__tmp(:)
       LOGICAL  , OPTIONAL, INTENT(IN) :: mask_1d_(:)
       LOGICAL (KIND=C_BOOL) , ALLOCATABLE :: mask_1d__tmp(:)
@@ -98,4 +107,9 @@
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: name_
 
+      IF (PRESENT(comment_)) THEN
+        CALL cxios_set_gridgroup_comment &
+      (gridgroup_hdl%daddr, comment_, len(comment_))
+      ENDIF
+
       IF (PRESENT(description_)) THEN
         CALL cxios_set_gridgroup_description &
@@ -106,4 +120,11 @@
         CALL cxios_set_gridgroup_group_ref &
       (gridgroup_hdl%daddr, group_ref_, len(group_ref_))
+      ENDIF
+
+      IF (PRESENT(mask_0d_)) THEN
+        ALLOCATE(mask_0d__tmp(SIZE(mask_0d_,1)))
+        mask_0d__tmp = mask_0d_
+        CALL cxios_set_gridgroup_mask_0d &
+      (gridgroup_hdl%daddr, mask_0d__tmp, SHAPE(mask_0d_))
       ENDIF
 
@@ -170,12 +191,15 @@
 
   SUBROUTINE xios(get_gridgroup_attr)  &
-    ( gridgroup_id, description, group_ref, mask_1d, mask_2d, mask_3d, mask_4d, mask_5d, mask_6d  &
-    , mask_7d, name )
+    ( gridgroup_id, comment, description, group_ref, mask_0d, mask_1d, mask_2d, mask_3d, mask_4d  &
+    , mask_5d, mask_6d, mask_7d, name )
 
     IMPLICIT NONE
       TYPE(txios(gridgroup))  :: gridgroup_hdl
       CHARACTER(LEN=*), INTENT(IN) ::gridgroup_id
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: comment
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: description
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: group_ref
+      LOGICAL  , OPTIONAL, INTENT(OUT) :: mask_0d(:)
+      LOGICAL (KIND=C_BOOL) , ALLOCATABLE :: mask_0d_tmp(:)
       LOGICAL  , OPTIONAL, INTENT(OUT) :: mask_1d(:)
       LOGICAL (KIND=C_BOOL) , ALLOCATABLE :: mask_1d_tmp(:)
@@ -197,17 +221,20 @@
       (gridgroup_id,gridgroup_hdl)
       CALL xios(get_gridgroup_attr_hdl_)   &
-      ( gridgroup_hdl, description, group_ref, mask_1d, mask_2d, mask_3d, mask_4d, mask_5d, mask_6d  &
-      , mask_7d, name )
+      ( gridgroup_hdl, comment, description, group_ref, mask_0d, mask_1d, mask_2d, mask_3d, mask_4d  &
+      , mask_5d, mask_6d, mask_7d, name )
 
   END SUBROUTINE xios(get_gridgroup_attr)
 
   SUBROUTINE xios(get_gridgroup_attr_hdl)  &
-    ( gridgroup_hdl, description, group_ref, mask_1d, mask_2d, mask_3d, mask_4d, mask_5d, mask_6d  &
-    , mask_7d, name )
+    ( gridgroup_hdl, comment, description, group_ref, mask_0d, mask_1d, mask_2d, mask_3d, mask_4d  &
+    , mask_5d, mask_6d, mask_7d, name )
 
     IMPLICIT NONE
       TYPE(txios(gridgroup)) , INTENT(IN) :: gridgroup_hdl
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: comment
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: description
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: group_ref
+      LOGICAL  , OPTIONAL, INTENT(OUT) :: mask_0d(:)
+      LOGICAL (KIND=C_BOOL) , ALLOCATABLE :: mask_0d_tmp(:)
       LOGICAL  , OPTIONAL, INTENT(OUT) :: mask_1d(:)
       LOGICAL (KIND=C_BOOL) , ALLOCATABLE :: mask_1d_tmp(:)
@@ -227,17 +254,20 @@
 
       CALL xios(get_gridgroup_attr_hdl_)  &
-      ( gridgroup_hdl, description, group_ref, mask_1d, mask_2d, mask_3d, mask_4d, mask_5d, mask_6d  &
-      , mask_7d, name )
+      ( gridgroup_hdl, comment, description, group_ref, mask_0d, mask_1d, mask_2d, mask_3d, mask_4d  &
+      , mask_5d, mask_6d, mask_7d, name )
 
   END SUBROUTINE xios(get_gridgroup_attr_hdl)
 
   SUBROUTINE xios(get_gridgroup_attr_hdl_)   &
-    ( gridgroup_hdl, description_, group_ref_, mask_1d_, mask_2d_, mask_3d_, mask_4d_, mask_5d_  &
-    , mask_6d_, mask_7d_, name_ )
+    ( gridgroup_hdl, comment_, description_, group_ref_, mask_0d_, mask_1d_, mask_2d_, mask_3d_  &
+    , mask_4d_, mask_5d_, mask_6d_, mask_7d_, name_ )
 
     IMPLICIT NONE
       TYPE(txios(gridgroup)) , INTENT(IN) :: gridgroup_hdl
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: comment_
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: description_
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: group_ref_
+      LOGICAL  , OPTIONAL, INTENT(OUT) :: mask_0d_(:)
+      LOGICAL (KIND=C_BOOL) , ALLOCATABLE :: mask_0d__tmp(:)
       LOGICAL  , OPTIONAL, INTENT(OUT) :: mask_1d_(:)
       LOGICAL (KIND=C_BOOL) , ALLOCATABLE :: mask_1d__tmp(:)
@@ -256,4 +286,9 @@
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: name_
 
+      IF (PRESENT(comment_)) THEN
+        CALL cxios_get_gridgroup_comment &
+      (gridgroup_hdl%daddr, comment_, len(comment_))
+      ENDIF
+
       IF (PRESENT(description_)) THEN
         CALL cxios_get_gridgroup_description &
@@ -264,4 +299,11 @@
         CALL cxios_get_gridgroup_group_ref &
       (gridgroup_hdl%daddr, group_ref_, len(group_ref_))
+      ENDIF
+
+      IF (PRESENT(mask_0d_)) THEN
+        ALLOCATE(mask_0d__tmp(SIZE(mask_0d_,1)))
+        CALL cxios_get_gridgroup_mask_0d &
+      (gridgroup_hdl%daddr, mask_0d__tmp, SHAPE(mask_0d_))
+        mask_0d_ = mask_0d__tmp
       ENDIF
 
@@ -328,14 +370,18 @@
 
   SUBROUTINE xios(is_defined_gridgroup_attr)  &
-    ( gridgroup_id, description, group_ref, mask_1d, mask_2d, mask_3d, mask_4d, mask_5d, mask_6d  &
-    , mask_7d, name )
+    ( gridgroup_id, comment, description, group_ref, mask_0d, mask_1d, mask_2d, mask_3d, mask_4d  &
+    , mask_5d, mask_6d, mask_7d, name )
 
     IMPLICIT NONE
       TYPE(txios(gridgroup))  :: gridgroup_hdl
       CHARACTER(LEN=*), INTENT(IN) ::gridgroup_id
+      LOGICAL, OPTIONAL, INTENT(OUT) :: comment
+      LOGICAL(KIND=C_BOOL) :: comment_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: description
       LOGICAL(KIND=C_BOOL) :: description_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: group_ref
       LOGICAL(KIND=C_BOOL) :: group_ref_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: mask_0d
+      LOGICAL(KIND=C_BOOL) :: mask_0d_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: mask_1d
       LOGICAL(KIND=C_BOOL) :: mask_1d_tmp
@@ -358,19 +404,23 @@
       (gridgroup_id,gridgroup_hdl)
       CALL xios(is_defined_gridgroup_attr_hdl_)   &
-      ( gridgroup_hdl, description, group_ref, mask_1d, mask_2d, mask_3d, mask_4d, mask_5d, mask_6d  &
-      , mask_7d, name )
+      ( gridgroup_hdl, comment, description, group_ref, mask_0d, mask_1d, mask_2d, mask_3d, mask_4d  &
+      , mask_5d, mask_6d, mask_7d, name )
 
   END SUBROUTINE xios(is_defined_gridgroup_attr)
 
   SUBROUTINE xios(is_defined_gridgroup_attr_hdl)  &
-    ( gridgroup_hdl, description, group_ref, mask_1d, mask_2d, mask_3d, mask_4d, mask_5d, mask_6d  &
-    , mask_7d, name )
+    ( gridgroup_hdl, comment, description, group_ref, mask_0d, mask_1d, mask_2d, mask_3d, mask_4d  &
+    , mask_5d, mask_6d, mask_7d, name )
 
     IMPLICIT NONE
       TYPE(txios(gridgroup)) , INTENT(IN) :: gridgroup_hdl
+      LOGICAL, OPTIONAL, INTENT(OUT) :: comment
+      LOGICAL(KIND=C_BOOL) :: comment_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: description
       LOGICAL(KIND=C_BOOL) :: description_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: group_ref
       LOGICAL(KIND=C_BOOL) :: group_ref_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: mask_0d
+      LOGICAL(KIND=C_BOOL) :: mask_0d_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: mask_1d
       LOGICAL(KIND=C_BOOL) :: mask_1d_tmp
@@ -391,19 +441,23 @@
 
       CALL xios(is_defined_gridgroup_attr_hdl_)  &
-      ( gridgroup_hdl, description, group_ref, mask_1d, mask_2d, mask_3d, mask_4d, mask_5d, mask_6d  &
-      , mask_7d, name )
+      ( gridgroup_hdl, comment, description, group_ref, mask_0d, mask_1d, mask_2d, mask_3d, mask_4d  &
+      , mask_5d, mask_6d, mask_7d, name )
 
   END SUBROUTINE xios(is_defined_gridgroup_attr_hdl)
 
   SUBROUTINE xios(is_defined_gridgroup_attr_hdl_)   &
-    ( gridgroup_hdl, description_, group_ref_, mask_1d_, mask_2d_, mask_3d_, mask_4d_, mask_5d_  &
-    , mask_6d_, mask_7d_, name_ )
+    ( gridgroup_hdl, comment_, description_, group_ref_, mask_0d_, mask_1d_, mask_2d_, mask_3d_  &
+    , mask_4d_, mask_5d_, mask_6d_, mask_7d_, name_ )
 
     IMPLICIT NONE
       TYPE(txios(gridgroup)) , INTENT(IN) :: gridgroup_hdl
+      LOGICAL, OPTIONAL, INTENT(OUT) :: comment_
+      LOGICAL(KIND=C_BOOL) :: comment__tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: description_
       LOGICAL(KIND=C_BOOL) :: description__tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: group_ref_
       LOGICAL(KIND=C_BOOL) :: group_ref__tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: mask_0d_
+      LOGICAL(KIND=C_BOOL) :: mask_0d__tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: mask_1d_
       LOGICAL(KIND=C_BOOL) :: mask_1d__tmp
@@ -423,4 +477,10 @@
       LOGICAL(KIND=C_BOOL) :: name__tmp
 
+      IF (PRESENT(comment_)) THEN
+        comment__tmp = cxios_is_defined_gridgroup_comment &
+      (gridgroup_hdl%daddr)
+        comment_ = comment__tmp
+      ENDIF
+
       IF (PRESENT(description_)) THEN
         description__tmp = cxios_is_defined_gridgroup_description &
@@ -435,4 +495,10 @@
       ENDIF
 
+      IF (PRESENT(mask_0d_)) THEN
+        mask_0d__tmp = cxios_is_defined_gridgroup_mask_0d &
+      (gridgroup_hdl%daddr)
+        mask_0d_ = mask_0d__tmp
+      ENDIF
+
       IF (PRESENT(mask_1d_)) THEN
         mask_1d__tmp = cxios_is_defined_gridgroup_mask_1d &
Index: /XIOS/trunk/src/interface/fortran_attr/iinterpolate_domain_attr.F90
===================================================================
--- /XIOS/trunk/src/interface/fortran_attr/iinterpolate_domain_attr.F90	(revision 1536)
+++ /XIOS/trunk/src/interface/fortran_attr/iinterpolate_domain_attr.F90	(revision 1537)
@@ -12,13 +12,17 @@
 
   SUBROUTINE xios(set_interpolate_domain_attr)  &
-    ( interpolate_domain_id, mode, order, quantity, renormalize, weight_filename, write_weight )
+    ( interpolate_domain_id, detect_missing_value, mode, order, quantity, read_write_convention  &
+    , renormalize, weight_filename, write_weight )
 
     IMPLICIT NONE
       TYPE(txios(interpolate_domain))  :: interpolate_domain_hdl
       CHARACTER(LEN=*), INTENT(IN) ::interpolate_domain_id
+      LOGICAL  , OPTIONAL, INTENT(IN) :: detect_missing_value
+      LOGICAL (KIND=C_BOOL) :: detect_missing_value_tmp
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: mode
       INTEGER  , OPTIONAL, INTENT(IN) :: order
       LOGICAL  , OPTIONAL, INTENT(IN) :: quantity
       LOGICAL (KIND=C_BOOL) :: quantity_tmp
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: read_write_convention
       LOGICAL  , OPTIONAL, INTENT(IN) :: renormalize
       LOGICAL (KIND=C_BOOL) :: renormalize_tmp
@@ -30,19 +34,22 @@
       (interpolate_domain_id,interpolate_domain_hdl)
       CALL xios(set_interpolate_domain_attr_hdl_)   &
-      ( interpolate_domain_hdl, mode, order, quantity, renormalize, weight_filename, write_weight  &
-       )
+      ( interpolate_domain_hdl, detect_missing_value, mode, order, quantity, read_write_convention  &
+      , renormalize, weight_filename, write_weight )
 
   END SUBROUTINE xios(set_interpolate_domain_attr)
 
   SUBROUTINE xios(set_interpolate_domain_attr_hdl)  &
-    ( interpolate_domain_hdl, mode, order, quantity, renormalize, weight_filename, write_weight  &
-     )
-
-    IMPLICIT NONE
-      TYPE(txios(interpolate_domain)) , INTENT(IN) :: interpolate_domain_hdl
+    ( interpolate_domain_hdl, detect_missing_value, mode, order, quantity, read_write_convention  &
+    , renormalize, weight_filename, write_weight )
+
+    IMPLICIT NONE
+      TYPE(txios(interpolate_domain)) , INTENT(IN) :: interpolate_domain_hdl
+      LOGICAL  , OPTIONAL, INTENT(IN) :: detect_missing_value
+      LOGICAL (KIND=C_BOOL) :: detect_missing_value_tmp
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: mode
       INTEGER  , OPTIONAL, INTENT(IN) :: order
       LOGICAL  , OPTIONAL, INTENT(IN) :: quantity
       LOGICAL (KIND=C_BOOL) :: quantity_tmp
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: read_write_convention
       LOGICAL  , OPTIONAL, INTENT(IN) :: renormalize
       LOGICAL (KIND=C_BOOL) :: renormalize_tmp
@@ -52,19 +59,22 @@
 
       CALL xios(set_interpolate_domain_attr_hdl_)  &
-      ( interpolate_domain_hdl, mode, order, quantity, renormalize, weight_filename, write_weight  &
-       )
+      ( interpolate_domain_hdl, detect_missing_value, mode, order, quantity, read_write_convention  &
+      , renormalize, weight_filename, write_weight )
 
   END SUBROUTINE xios(set_interpolate_domain_attr_hdl)
 
   SUBROUTINE xios(set_interpolate_domain_attr_hdl_)   &
-    ( interpolate_domain_hdl, mode_, order_, quantity_, renormalize_, weight_filename_, write_weight_  &
-     )
-
-    IMPLICIT NONE
-      TYPE(txios(interpolate_domain)) , INTENT(IN) :: interpolate_domain_hdl
+    ( interpolate_domain_hdl, detect_missing_value_, mode_, order_, quantity_, read_write_convention_  &
+    , renormalize_, weight_filename_, write_weight_ )
+
+    IMPLICIT NONE
+      TYPE(txios(interpolate_domain)) , INTENT(IN) :: interpolate_domain_hdl
+      LOGICAL  , OPTIONAL, INTENT(IN) :: detect_missing_value_
+      LOGICAL (KIND=C_BOOL) :: detect_missing_value__tmp
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: mode_
       INTEGER  , OPTIONAL, INTENT(IN) :: order_
       LOGICAL  , OPTIONAL, INTENT(IN) :: quantity_
       LOGICAL (KIND=C_BOOL) :: quantity__tmp
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: read_write_convention_
       LOGICAL  , OPTIONAL, INTENT(IN) :: renormalize_
       LOGICAL (KIND=C_BOOL) :: renormalize__tmp
@@ -73,4 +83,10 @@
       LOGICAL (KIND=C_BOOL) :: write_weight__tmp
 
+      IF (PRESENT(detect_missing_value_)) THEN
+        detect_missing_value__tmp = detect_missing_value_
+        CALL cxios_set_interpolate_domain_detect_missing_value &
+      (interpolate_domain_hdl%daddr, detect_missing_value__tmp)
+      ENDIF
+
       IF (PRESENT(mode_)) THEN
         CALL cxios_set_interpolate_domain_mode &
@@ -89,4 +105,9 @@
       ENDIF
 
+      IF (PRESENT(read_write_convention_)) THEN
+        CALL cxios_set_interpolate_domain_read_write_convention &
+      (interpolate_domain_hdl%daddr, read_write_convention_, len(read_write_convention_))
+      ENDIF
+
       IF (PRESENT(renormalize_)) THEN
         renormalize__tmp = renormalize_
@@ -109,13 +130,17 @@
 
   SUBROUTINE xios(get_interpolate_domain_attr)  &
-    ( interpolate_domain_id, mode, order, quantity, renormalize, weight_filename, write_weight )
+    ( interpolate_domain_id, detect_missing_value, mode, order, quantity, read_write_convention  &
+    , renormalize, weight_filename, write_weight )
 
     IMPLICIT NONE
       TYPE(txios(interpolate_domain))  :: interpolate_domain_hdl
       CHARACTER(LEN=*), INTENT(IN) ::interpolate_domain_id
+      LOGICAL  , OPTIONAL, INTENT(OUT) :: detect_missing_value
+      LOGICAL (KIND=C_BOOL) :: detect_missing_value_tmp
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: mode
       INTEGER  , OPTIONAL, INTENT(OUT) :: order
       LOGICAL  , OPTIONAL, INTENT(OUT) :: quantity
       LOGICAL (KIND=C_BOOL) :: quantity_tmp
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: read_write_convention
       LOGICAL  , OPTIONAL, INTENT(OUT) :: renormalize
       LOGICAL (KIND=C_BOOL) :: renormalize_tmp
@@ -127,19 +152,22 @@
       (interpolate_domain_id,interpolate_domain_hdl)
       CALL xios(get_interpolate_domain_attr_hdl_)   &
-      ( interpolate_domain_hdl, mode, order, quantity, renormalize, weight_filename, write_weight  &
-       )
+      ( interpolate_domain_hdl, detect_missing_value, mode, order, quantity, read_write_convention  &
+      , renormalize, weight_filename, write_weight )
 
   END SUBROUTINE xios(get_interpolate_domain_attr)
 
   SUBROUTINE xios(get_interpolate_domain_attr_hdl)  &
-    ( interpolate_domain_hdl, mode, order, quantity, renormalize, weight_filename, write_weight  &
-     )
-
-    IMPLICIT NONE
-      TYPE(txios(interpolate_domain)) , INTENT(IN) :: interpolate_domain_hdl
+    ( interpolate_domain_hdl, detect_missing_value, mode, order, quantity, read_write_convention  &
+    , renormalize, weight_filename, write_weight )
+
+    IMPLICIT NONE
+      TYPE(txios(interpolate_domain)) , INTENT(IN) :: interpolate_domain_hdl
+      LOGICAL  , OPTIONAL, INTENT(OUT) :: detect_missing_value
+      LOGICAL (KIND=C_BOOL) :: detect_missing_value_tmp
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: mode
       INTEGER  , OPTIONAL, INTENT(OUT) :: order
       LOGICAL  , OPTIONAL, INTENT(OUT) :: quantity
       LOGICAL (KIND=C_BOOL) :: quantity_tmp
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: read_write_convention
       LOGICAL  , OPTIONAL, INTENT(OUT) :: renormalize
       LOGICAL (KIND=C_BOOL) :: renormalize_tmp
@@ -149,19 +177,22 @@
 
       CALL xios(get_interpolate_domain_attr_hdl_)  &
-      ( interpolate_domain_hdl, mode, order, quantity, renormalize, weight_filename, write_weight  &
-       )
+      ( interpolate_domain_hdl, detect_missing_value, mode, order, quantity, read_write_convention  &
+      , renormalize, weight_filename, write_weight )
 
   END SUBROUTINE xios(get_interpolate_domain_attr_hdl)
 
   SUBROUTINE xios(get_interpolate_domain_attr_hdl_)   &
-    ( interpolate_domain_hdl, mode_, order_, quantity_, renormalize_, weight_filename_, write_weight_  &
-     )
-
-    IMPLICIT NONE
-      TYPE(txios(interpolate_domain)) , INTENT(IN) :: interpolate_domain_hdl
+    ( interpolate_domain_hdl, detect_missing_value_, mode_, order_, quantity_, read_write_convention_  &
+    , renormalize_, weight_filename_, write_weight_ )
+
+    IMPLICIT NONE
+      TYPE(txios(interpolate_domain)) , INTENT(IN) :: interpolate_domain_hdl
+      LOGICAL  , OPTIONAL, INTENT(OUT) :: detect_missing_value_
+      LOGICAL (KIND=C_BOOL) :: detect_missing_value__tmp
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: mode_
       INTEGER  , OPTIONAL, INTENT(OUT) :: order_
       LOGICAL  , OPTIONAL, INTENT(OUT) :: quantity_
       LOGICAL (KIND=C_BOOL) :: quantity__tmp
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: read_write_convention_
       LOGICAL  , OPTIONAL, INTENT(OUT) :: renormalize_
       LOGICAL (KIND=C_BOOL) :: renormalize__tmp
@@ -170,4 +201,10 @@
       LOGICAL (KIND=C_BOOL) :: write_weight__tmp
 
+      IF (PRESENT(detect_missing_value_)) THEN
+        CALL cxios_get_interpolate_domain_detect_missing_value &
+      (interpolate_domain_hdl%daddr, detect_missing_value__tmp)
+        detect_missing_value_ = detect_missing_value__tmp
+      ENDIF
+
       IF (PRESENT(mode_)) THEN
         CALL cxios_get_interpolate_domain_mode &
@@ -186,4 +223,9 @@
       ENDIF
 
+      IF (PRESENT(read_write_convention_)) THEN
+        CALL cxios_get_interpolate_domain_read_write_convention &
+      (interpolate_domain_hdl%daddr, read_write_convention_, len(read_write_convention_))
+      ENDIF
+
       IF (PRESENT(renormalize_)) THEN
         CALL cxios_get_interpolate_domain_renormalize &
@@ -206,9 +248,12 @@
 
   SUBROUTINE xios(is_defined_interpolate_domain_attr)  &
-    ( interpolate_domain_id, mode, order, quantity, renormalize, weight_filename, write_weight )
+    ( interpolate_domain_id, detect_missing_value, mode, order, quantity, read_write_convention  &
+    , renormalize, weight_filename, write_weight )
 
     IMPLICIT NONE
       TYPE(txios(interpolate_domain))  :: interpolate_domain_hdl
       CHARACTER(LEN=*), INTENT(IN) ::interpolate_domain_id
+      LOGICAL, OPTIONAL, INTENT(OUT) :: detect_missing_value
+      LOGICAL(KIND=C_BOOL) :: detect_missing_value_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: mode
       LOGICAL(KIND=C_BOOL) :: mode_tmp
@@ -217,4 +262,6 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: quantity
       LOGICAL(KIND=C_BOOL) :: quantity_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: read_write_convention
+      LOGICAL(KIND=C_BOOL) :: read_write_convention_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: renormalize
       LOGICAL(KIND=C_BOOL) :: renormalize_tmp
@@ -227,15 +274,17 @@
       (interpolate_domain_id,interpolate_domain_hdl)
       CALL xios(is_defined_interpolate_domain_attr_hdl_)   &
-      ( interpolate_domain_hdl, mode, order, quantity, renormalize, weight_filename, write_weight  &
-       )
+      ( interpolate_domain_hdl, detect_missing_value, mode, order, quantity, read_write_convention  &
+      , renormalize, weight_filename, write_weight )
 
   END SUBROUTINE xios(is_defined_interpolate_domain_attr)
 
   SUBROUTINE xios(is_defined_interpolate_domain_attr_hdl)  &
-    ( interpolate_domain_hdl, mode, order, quantity, renormalize, weight_filename, write_weight  &
-     )
-
-    IMPLICIT NONE
-      TYPE(txios(interpolate_domain)) , INTENT(IN) :: interpolate_domain_hdl
+    ( interpolate_domain_hdl, detect_missing_value, mode, order, quantity, read_write_convention  &
+    , renormalize, weight_filename, write_weight )
+
+    IMPLICIT NONE
+      TYPE(txios(interpolate_domain)) , INTENT(IN) :: interpolate_domain_hdl
+      LOGICAL, OPTIONAL, INTENT(OUT) :: detect_missing_value
+      LOGICAL(KIND=C_BOOL) :: detect_missing_value_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: mode
       LOGICAL(KIND=C_BOOL) :: mode_tmp
@@ -244,4 +293,6 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: quantity
       LOGICAL(KIND=C_BOOL) :: quantity_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: read_write_convention
+      LOGICAL(KIND=C_BOOL) :: read_write_convention_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: renormalize
       LOGICAL(KIND=C_BOOL) :: renormalize_tmp
@@ -252,15 +303,17 @@
 
       CALL xios(is_defined_interpolate_domain_attr_hdl_)  &
-      ( interpolate_domain_hdl, mode, order, quantity, renormalize, weight_filename, write_weight  &
-       )
+      ( interpolate_domain_hdl, detect_missing_value, mode, order, quantity, read_write_convention  &
+      , renormalize, weight_filename, write_weight )
 
   END SUBROUTINE xios(is_defined_interpolate_domain_attr_hdl)
 
   SUBROUTINE xios(is_defined_interpolate_domain_attr_hdl_)   &
-    ( interpolate_domain_hdl, mode_, order_, quantity_, renormalize_, weight_filename_, write_weight_  &
-     )
-
-    IMPLICIT NONE
-      TYPE(txios(interpolate_domain)) , INTENT(IN) :: interpolate_domain_hdl
+    ( interpolate_domain_hdl, detect_missing_value_, mode_, order_, quantity_, read_write_convention_  &
+    , renormalize_, weight_filename_, write_weight_ )
+
+    IMPLICIT NONE
+      TYPE(txios(interpolate_domain)) , INTENT(IN) :: interpolate_domain_hdl
+      LOGICAL, OPTIONAL, INTENT(OUT) :: detect_missing_value_
+      LOGICAL(KIND=C_BOOL) :: detect_missing_value__tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: mode_
       LOGICAL(KIND=C_BOOL) :: mode__tmp
@@ -269,4 +322,6 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: quantity_
       LOGICAL(KIND=C_BOOL) :: quantity__tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: read_write_convention_
+      LOGICAL(KIND=C_BOOL) :: read_write_convention__tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: renormalize_
       LOGICAL(KIND=C_BOOL) :: renormalize__tmp
@@ -276,4 +331,10 @@
       LOGICAL(KIND=C_BOOL) :: write_weight__tmp
 
+      IF (PRESENT(detect_missing_value_)) THEN
+        detect_missing_value__tmp = cxios_is_defined_interpolate_domain_detect_missing_value &
+      (interpolate_domain_hdl%daddr)
+        detect_missing_value_ = detect_missing_value__tmp
+      ENDIF
+
       IF (PRESENT(mode_)) THEN
         mode__tmp = cxios_is_defined_interpolate_domain_mode &
@@ -294,4 +355,10 @@
       ENDIF
 
+      IF (PRESENT(read_write_convention_)) THEN
+        read_write_convention__tmp = cxios_is_defined_interpolate_domain_read_write_convention &
+      (interpolate_domain_hdl%daddr)
+        read_write_convention_ = read_write_convention__tmp
+      ENDIF
+
       IF (PRESENT(renormalize_)) THEN
         renormalize__tmp = cxios_is_defined_interpolate_domain_renormalize &
Index: /XIOS/trunk/src/interface/fortran_attr/interpolate_domain_interface_attr.F90
===================================================================
--- /XIOS/trunk/src/interface/fortran_attr/interpolate_domain_interface_attr.F90	(revision 1536)
+++ /XIOS/trunk/src/interface/fortran_attr/interpolate_domain_interface_attr.F90	(revision 1537)
@@ -9,4 +9,23 @@
   INTERFACE
     ! Do not call directly / interface FORTRAN 2003 <-> C99
+
+    SUBROUTINE cxios_set_interpolate_domain_detect_missing_value(interpolate_domain_hdl, detect_missing_value) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: interpolate_domain_hdl
+      LOGICAL (KIND=C_BOOL)      , VALUE :: detect_missing_value
+    END SUBROUTINE cxios_set_interpolate_domain_detect_missing_value
+
+    SUBROUTINE cxios_get_interpolate_domain_detect_missing_value(interpolate_domain_hdl, detect_missing_value) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: interpolate_domain_hdl
+      LOGICAL (KIND=C_BOOL)             :: detect_missing_value
+    END SUBROUTINE cxios_get_interpolate_domain_detect_missing_value
+
+    FUNCTION cxios_is_defined_interpolate_domain_detect_missing_value(interpolate_domain_hdl) BIND(C)
+      USE ISO_C_BINDING
+      LOGICAL(kind=C_BOOL) :: cxios_is_defined_interpolate_domain_detect_missing_value
+      INTEGER (kind = C_INTPTR_T), VALUE :: interpolate_domain_hdl
+    END FUNCTION cxios_is_defined_interpolate_domain_detect_missing_value
+
 
     SUBROUTINE cxios_set_interpolate_domain_mode(interpolate_domain_hdl, mode, mode_size) BIND(C)
@@ -67,4 +86,25 @@
       INTEGER (kind = C_INTPTR_T), VALUE :: interpolate_domain_hdl
     END FUNCTION cxios_is_defined_interpolate_domain_quantity
+
+
+    SUBROUTINE cxios_set_interpolate_domain_read_write_convention(interpolate_domain_hdl, read_write_convention, read_write_convention_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: interpolate_domain_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: read_write_convention
+      INTEGER  (kind = C_INT)     , VALUE        :: read_write_convention_size
+    END SUBROUTINE cxios_set_interpolate_domain_read_write_convention
+
+    SUBROUTINE cxios_get_interpolate_domain_read_write_convention(interpolate_domain_hdl, read_write_convention, read_write_convention_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: interpolate_domain_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: read_write_convention
+      INTEGER  (kind = C_INT)     , VALUE        :: read_write_convention_size
+    END SUBROUTINE cxios_get_interpolate_domain_read_write_convention
+
+    FUNCTION cxios_is_defined_interpolate_domain_read_write_convention(interpolate_domain_hdl) BIND(C)
+      USE ISO_C_BINDING
+      LOGICAL(kind=C_BOOL) :: cxios_is_defined_interpolate_domain_read_write_convention
+      INTEGER (kind = C_INTPTR_T), VALUE :: interpolate_domain_hdl
+    END FUNCTION cxios_is_defined_interpolate_domain_read_write_convention
 
 
Index: /XIOS/trunk/src/interface/fortran_attr/ireduce_axis_to_axis_attr.F90
===================================================================
--- /XIOS/trunk/src/interface/fortran_attr/ireduce_axis_to_axis_attr.F90	(revision 1537)
+++ /XIOS/trunk/src/interface/fortran_attr/ireduce_axis_to_axis_attr.F90	(revision 1537)
@@ -0,0 +1,140 @@
+! * ************************************************************************** *
+! *               Interface auto generated - do not modify                     *
+! * ************************************************************************** *
+#include "xios_fortran_prefix.hpp"
+
+MODULE ireduce_axis_to_axis_attr
+  USE, INTRINSIC :: ISO_C_BINDING
+  USE ireduce_axis_to_axis
+  USE reduce_axis_to_axis_interface_attr
+
+CONTAINS
+
+  SUBROUTINE xios(set_reduce_axis_to_axis_attr)  &
+    ( reduce_axis_to_axis_id, operation )
+
+    IMPLICIT NONE
+      TYPE(txios(reduce_axis_to_axis))  :: reduce_axis_to_axis_hdl
+      CHARACTER(LEN=*), INTENT(IN) ::reduce_axis_to_axis_id
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: operation
+
+      CALL xios(get_reduce_axis_to_axis_handle) &
+      (reduce_axis_to_axis_id,reduce_axis_to_axis_hdl)
+      CALL xios(set_reduce_axis_to_axis_attr_hdl_)   &
+      ( reduce_axis_to_axis_hdl, operation )
+
+  END SUBROUTINE xios(set_reduce_axis_to_axis_attr)
+
+  SUBROUTINE xios(set_reduce_axis_to_axis_attr_hdl)  &
+    ( reduce_axis_to_axis_hdl, operation )
+
+    IMPLICIT NONE
+      TYPE(txios(reduce_axis_to_axis)) , INTENT(IN) :: reduce_axis_to_axis_hdl
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: operation
+
+      CALL xios(set_reduce_axis_to_axis_attr_hdl_)  &
+      ( reduce_axis_to_axis_hdl, operation )
+
+  END SUBROUTINE xios(set_reduce_axis_to_axis_attr_hdl)
+
+  SUBROUTINE xios(set_reduce_axis_to_axis_attr_hdl_)   &
+    ( reduce_axis_to_axis_hdl, operation_ )
+
+    IMPLICIT NONE
+      TYPE(txios(reduce_axis_to_axis)) , INTENT(IN) :: reduce_axis_to_axis_hdl
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: operation_
+
+      IF (PRESENT(operation_)) THEN
+        CALL cxios_set_reduce_axis_to_axis_operation &
+      (reduce_axis_to_axis_hdl%daddr, operation_, len(operation_))
+      ENDIF
+
+  END SUBROUTINE xios(set_reduce_axis_to_axis_attr_hdl_)
+
+  SUBROUTINE xios(get_reduce_axis_to_axis_attr)  &
+    ( reduce_axis_to_axis_id, operation )
+
+    IMPLICIT NONE
+      TYPE(txios(reduce_axis_to_axis))  :: reduce_axis_to_axis_hdl
+      CHARACTER(LEN=*), INTENT(IN) ::reduce_axis_to_axis_id
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: operation
+
+      CALL xios(get_reduce_axis_to_axis_handle) &
+      (reduce_axis_to_axis_id,reduce_axis_to_axis_hdl)
+      CALL xios(get_reduce_axis_to_axis_attr_hdl_)   &
+      ( reduce_axis_to_axis_hdl, operation )
+
+  END SUBROUTINE xios(get_reduce_axis_to_axis_attr)
+
+  SUBROUTINE xios(get_reduce_axis_to_axis_attr_hdl)  &
+    ( reduce_axis_to_axis_hdl, operation )
+
+    IMPLICIT NONE
+      TYPE(txios(reduce_axis_to_axis)) , INTENT(IN) :: reduce_axis_to_axis_hdl
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: operation
+
+      CALL xios(get_reduce_axis_to_axis_attr_hdl_)  &
+      ( reduce_axis_to_axis_hdl, operation )
+
+  END SUBROUTINE xios(get_reduce_axis_to_axis_attr_hdl)
+
+  SUBROUTINE xios(get_reduce_axis_to_axis_attr_hdl_)   &
+    ( reduce_axis_to_axis_hdl, operation_ )
+
+    IMPLICIT NONE
+      TYPE(txios(reduce_axis_to_axis)) , INTENT(IN) :: reduce_axis_to_axis_hdl
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: operation_
+
+      IF (PRESENT(operation_)) THEN
+        CALL cxios_get_reduce_axis_to_axis_operation &
+      (reduce_axis_to_axis_hdl%daddr, operation_, len(operation_))
+      ENDIF
+
+  END SUBROUTINE xios(get_reduce_axis_to_axis_attr_hdl_)
+
+  SUBROUTINE xios(is_defined_reduce_axis_to_axis_attr)  &
+    ( reduce_axis_to_axis_id, operation )
+
+    IMPLICIT NONE
+      TYPE(txios(reduce_axis_to_axis))  :: reduce_axis_to_axis_hdl
+      CHARACTER(LEN=*), INTENT(IN) ::reduce_axis_to_axis_id
+      LOGICAL, OPTIONAL, INTENT(OUT) :: operation
+      LOGICAL(KIND=C_BOOL) :: operation_tmp
+
+      CALL xios(get_reduce_axis_to_axis_handle) &
+      (reduce_axis_to_axis_id,reduce_axis_to_axis_hdl)
+      CALL xios(is_defined_reduce_axis_to_axis_attr_hdl_)   &
+      ( reduce_axis_to_axis_hdl, operation )
+
+  END SUBROUTINE xios(is_defined_reduce_axis_to_axis_attr)
+
+  SUBROUTINE xios(is_defined_reduce_axis_to_axis_attr_hdl)  &
+    ( reduce_axis_to_axis_hdl, operation )
+
+    IMPLICIT NONE
+      TYPE(txios(reduce_axis_to_axis)) , INTENT(IN) :: reduce_axis_to_axis_hdl
+      LOGICAL, OPTIONAL, INTENT(OUT) :: operation
+      LOGICAL(KIND=C_BOOL) :: operation_tmp
+
+      CALL xios(is_defined_reduce_axis_to_axis_attr_hdl_)  &
+      ( reduce_axis_to_axis_hdl, operation )
+
+  END SUBROUTINE xios(is_defined_reduce_axis_to_axis_attr_hdl)
+
+  SUBROUTINE xios(is_defined_reduce_axis_to_axis_attr_hdl_)   &
+    ( reduce_axis_to_axis_hdl, operation_ )
+
+    IMPLICIT NONE
+      TYPE(txios(reduce_axis_to_axis)) , INTENT(IN) :: reduce_axis_to_axis_hdl
+      LOGICAL, OPTIONAL, INTENT(OUT) :: operation_
+      LOGICAL(KIND=C_BOOL) :: operation__tmp
+
+      IF (PRESENT(operation_)) THEN
+        operation__tmp = cxios_is_defined_reduce_axis_to_axis_operation &
+      (reduce_axis_to_axis_hdl%daddr)
+        operation_ = operation__tmp
+      ENDIF
+
+  END SUBROUTINE xios(is_defined_reduce_axis_to_axis_attr_hdl_)
+
+END MODULE ireduce_axis_to_axis_attr
Index: /XIOS/trunk/src/interface/fortran_attr/ireduce_domain_to_axis_attr.F90
===================================================================
--- /XIOS/trunk/src/interface/fortran_attr/ireduce_domain_to_axis_attr.F90	(revision 1536)
+++ /XIOS/trunk/src/interface/fortran_attr/ireduce_domain_to_axis_attr.F90	(revision 1537)
@@ -12,5 +12,5 @@
 
   SUBROUTINE xios(set_reduce_domain_to_axis_attr)  &
-    ( reduce_domain_to_axis_id, direction, operation )
+    ( reduce_domain_to_axis_id, direction, local, operation )
 
     IMPLICIT NONE
@@ -18,4 +18,6 @@
       CHARACTER(LEN=*), INTENT(IN) ::reduce_domain_to_axis_id
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: direction
+      LOGICAL  , OPTIONAL, INTENT(IN) :: local
+      LOGICAL (KIND=C_BOOL) :: local_tmp
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: operation
 
@@ -23,27 +25,31 @@
       (reduce_domain_to_axis_id,reduce_domain_to_axis_hdl)
       CALL xios(set_reduce_domain_to_axis_attr_hdl_)   &
-      ( reduce_domain_to_axis_hdl, direction, operation )
+      ( reduce_domain_to_axis_hdl, direction, local, operation )
 
   END SUBROUTINE xios(set_reduce_domain_to_axis_attr)
 
   SUBROUTINE xios(set_reduce_domain_to_axis_attr_hdl)  &
-    ( reduce_domain_to_axis_hdl, direction, operation )
+    ( reduce_domain_to_axis_hdl, direction, local, operation )
 
     IMPLICIT NONE
       TYPE(txios(reduce_domain_to_axis)) , INTENT(IN) :: reduce_domain_to_axis_hdl
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: direction
+      LOGICAL  , OPTIONAL, INTENT(IN) :: local
+      LOGICAL (KIND=C_BOOL) :: local_tmp
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: operation
 
       CALL xios(set_reduce_domain_to_axis_attr_hdl_)  &
-      ( reduce_domain_to_axis_hdl, direction, operation )
+      ( reduce_domain_to_axis_hdl, direction, local, operation )
 
   END SUBROUTINE xios(set_reduce_domain_to_axis_attr_hdl)
 
   SUBROUTINE xios(set_reduce_domain_to_axis_attr_hdl_)   &
-    ( reduce_domain_to_axis_hdl, direction_, operation_ )
+    ( reduce_domain_to_axis_hdl, direction_, local_, operation_ )
 
     IMPLICIT NONE
       TYPE(txios(reduce_domain_to_axis)) , INTENT(IN) :: reduce_domain_to_axis_hdl
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: direction_
+      LOGICAL  , OPTIONAL, INTENT(IN) :: local_
+      LOGICAL (KIND=C_BOOL) :: local__tmp
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: operation_
 
@@ -53,4 +59,10 @@
       ENDIF
 
+      IF (PRESENT(local_)) THEN
+        local__tmp = local_
+        CALL cxios_set_reduce_domain_to_axis_local &
+      (reduce_domain_to_axis_hdl%daddr, local__tmp)
+      ENDIF
+
       IF (PRESENT(operation_)) THEN
         CALL cxios_set_reduce_domain_to_axis_operation &
@@ -61,5 +73,5 @@
 
   SUBROUTINE xios(get_reduce_domain_to_axis_attr)  &
-    ( reduce_domain_to_axis_id, direction, operation )
+    ( reduce_domain_to_axis_id, direction, local, operation )
 
     IMPLICIT NONE
@@ -67,4 +79,6 @@
       CHARACTER(LEN=*), INTENT(IN) ::reduce_domain_to_axis_id
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: direction
+      LOGICAL  , OPTIONAL, INTENT(OUT) :: local
+      LOGICAL (KIND=C_BOOL) :: local_tmp
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: operation
 
@@ -72,27 +86,31 @@
       (reduce_domain_to_axis_id,reduce_domain_to_axis_hdl)
       CALL xios(get_reduce_domain_to_axis_attr_hdl_)   &
-      ( reduce_domain_to_axis_hdl, direction, operation )
+      ( reduce_domain_to_axis_hdl, direction, local, operation )
 
   END SUBROUTINE xios(get_reduce_domain_to_axis_attr)
 
   SUBROUTINE xios(get_reduce_domain_to_axis_attr_hdl)  &
-    ( reduce_domain_to_axis_hdl, direction, operation )
+    ( reduce_domain_to_axis_hdl, direction, local, operation )
 
     IMPLICIT NONE
       TYPE(txios(reduce_domain_to_axis)) , INTENT(IN) :: reduce_domain_to_axis_hdl
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: direction
+      LOGICAL  , OPTIONAL, INTENT(OUT) :: local
+      LOGICAL (KIND=C_BOOL) :: local_tmp
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: operation
 
       CALL xios(get_reduce_domain_to_axis_attr_hdl_)  &
-      ( reduce_domain_to_axis_hdl, direction, operation )
+      ( reduce_domain_to_axis_hdl, direction, local, operation )
 
   END SUBROUTINE xios(get_reduce_domain_to_axis_attr_hdl)
 
   SUBROUTINE xios(get_reduce_domain_to_axis_attr_hdl_)   &
-    ( reduce_domain_to_axis_hdl, direction_, operation_ )
+    ( reduce_domain_to_axis_hdl, direction_, local_, operation_ )
 
     IMPLICIT NONE
       TYPE(txios(reduce_domain_to_axis)) , INTENT(IN) :: reduce_domain_to_axis_hdl
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: direction_
+      LOGICAL  , OPTIONAL, INTENT(OUT) :: local_
+      LOGICAL (KIND=C_BOOL) :: local__tmp
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: operation_
 
@@ -102,4 +120,10 @@
       ENDIF
 
+      IF (PRESENT(local_)) THEN
+        CALL cxios_get_reduce_domain_to_axis_local &
+      (reduce_domain_to_axis_hdl%daddr, local__tmp)
+        local_ = local__tmp
+      ENDIF
+
       IF (PRESENT(operation_)) THEN
         CALL cxios_get_reduce_domain_to_axis_operation &
@@ -110,5 +134,5 @@
 
   SUBROUTINE xios(is_defined_reduce_domain_to_axis_attr)  &
-    ( reduce_domain_to_axis_id, direction, operation )
+    ( reduce_domain_to_axis_id, direction, local, operation )
 
     IMPLICIT NONE
@@ -117,4 +141,6 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: direction
       LOGICAL(KIND=C_BOOL) :: direction_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: local
+      LOGICAL(KIND=C_BOOL) :: local_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: operation
       LOGICAL(KIND=C_BOOL) :: operation_tmp
@@ -123,10 +149,10 @@
       (reduce_domain_to_axis_id,reduce_domain_to_axis_hdl)
       CALL xios(is_defined_reduce_domain_to_axis_attr_hdl_)   &
-      ( reduce_domain_to_axis_hdl, direction, operation )
+      ( reduce_domain_to_axis_hdl, direction, local, operation )
 
   END SUBROUTINE xios(is_defined_reduce_domain_to_axis_attr)
 
   SUBROUTINE xios(is_defined_reduce_domain_to_axis_attr_hdl)  &
-    ( reduce_domain_to_axis_hdl, direction, operation )
+    ( reduce_domain_to_axis_hdl, direction, local, operation )
 
     IMPLICIT NONE
@@ -134,14 +160,16 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: direction
       LOGICAL(KIND=C_BOOL) :: direction_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: local
+      LOGICAL(KIND=C_BOOL) :: local_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: operation
       LOGICAL(KIND=C_BOOL) :: operation_tmp
 
       CALL xios(is_defined_reduce_domain_to_axis_attr_hdl_)  &
-      ( reduce_domain_to_axis_hdl, direction, operation )
+      ( reduce_domain_to_axis_hdl, direction, local, operation )
 
   END SUBROUTINE xios(is_defined_reduce_domain_to_axis_attr_hdl)
 
   SUBROUTINE xios(is_defined_reduce_domain_to_axis_attr_hdl_)   &
-    ( reduce_domain_to_axis_hdl, direction_, operation_ )
+    ( reduce_domain_to_axis_hdl, direction_, local_, operation_ )
 
     IMPLICIT NONE
@@ -149,4 +177,6 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: direction_
       LOGICAL(KIND=C_BOOL) :: direction__tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: local_
+      LOGICAL(KIND=C_BOOL) :: local__tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: operation_
       LOGICAL(KIND=C_BOOL) :: operation__tmp
@@ -158,4 +188,10 @@
       ENDIF
 
+      IF (PRESENT(local_)) THEN
+        local__tmp = cxios_is_defined_reduce_domain_to_axis_local &
+      (reduce_domain_to_axis_hdl%daddr)
+        local_ = local__tmp
+      ENDIF
+
       IF (PRESENT(operation_)) THEN
         operation__tmp = cxios_is_defined_reduce_domain_to_axis_operation &
Index: /XIOS/trunk/src/interface/fortran_attr/ireduce_domain_to_scalar_attr.F90
===================================================================
--- /XIOS/trunk/src/interface/fortran_attr/ireduce_domain_to_scalar_attr.F90	(revision 1536)
+++ /XIOS/trunk/src/interface/fortran_attr/ireduce_domain_to_scalar_attr.F90	(revision 1537)
@@ -12,9 +12,11 @@
 
   SUBROUTINE xios(set_reduce_domain_to_scalar_attr)  &
-    ( reduce_domain_to_scalar_id, operation )
+    ( reduce_domain_to_scalar_id, local, operation )
 
     IMPLICIT NONE
       TYPE(txios(reduce_domain_to_scalar))  :: reduce_domain_to_scalar_hdl
       CHARACTER(LEN=*), INTENT(IN) ::reduce_domain_to_scalar_id
+      LOGICAL  , OPTIONAL, INTENT(IN) :: local
+      LOGICAL (KIND=C_BOOL) :: local_tmp
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: operation
 
@@ -22,26 +24,36 @@
       (reduce_domain_to_scalar_id,reduce_domain_to_scalar_hdl)
       CALL xios(set_reduce_domain_to_scalar_attr_hdl_)   &
-      ( reduce_domain_to_scalar_hdl, operation )
+      ( reduce_domain_to_scalar_hdl, local, operation )
 
   END SUBROUTINE xios(set_reduce_domain_to_scalar_attr)
 
   SUBROUTINE xios(set_reduce_domain_to_scalar_attr_hdl)  &
-    ( reduce_domain_to_scalar_hdl, operation )
+    ( reduce_domain_to_scalar_hdl, local, operation )
 
     IMPLICIT NONE
       TYPE(txios(reduce_domain_to_scalar)) , INTENT(IN) :: reduce_domain_to_scalar_hdl
+      LOGICAL  , OPTIONAL, INTENT(IN) :: local
+      LOGICAL (KIND=C_BOOL) :: local_tmp
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: operation
 
       CALL xios(set_reduce_domain_to_scalar_attr_hdl_)  &
-      ( reduce_domain_to_scalar_hdl, operation )
+      ( reduce_domain_to_scalar_hdl, local, operation )
 
   END SUBROUTINE xios(set_reduce_domain_to_scalar_attr_hdl)
 
   SUBROUTINE xios(set_reduce_domain_to_scalar_attr_hdl_)   &
-    ( reduce_domain_to_scalar_hdl, operation_ )
+    ( reduce_domain_to_scalar_hdl, local_, operation_ )
 
     IMPLICIT NONE
       TYPE(txios(reduce_domain_to_scalar)) , INTENT(IN) :: reduce_domain_to_scalar_hdl
+      LOGICAL  , OPTIONAL, INTENT(IN) :: local_
+      LOGICAL (KIND=C_BOOL) :: local__tmp
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: operation_
+
+      IF (PRESENT(local_)) THEN
+        local__tmp = local_
+        CALL cxios_set_reduce_domain_to_scalar_local &
+      (reduce_domain_to_scalar_hdl%daddr, local__tmp)
+      ENDIF
 
       IF (PRESENT(operation_)) THEN
@@ -53,9 +65,11 @@
 
   SUBROUTINE xios(get_reduce_domain_to_scalar_attr)  &
-    ( reduce_domain_to_scalar_id, operation )
+    ( reduce_domain_to_scalar_id, local, operation )
 
     IMPLICIT NONE
       TYPE(txios(reduce_domain_to_scalar))  :: reduce_domain_to_scalar_hdl
       CHARACTER(LEN=*), INTENT(IN) ::reduce_domain_to_scalar_id
+      LOGICAL  , OPTIONAL, INTENT(OUT) :: local
+      LOGICAL (KIND=C_BOOL) :: local_tmp
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: operation
 
@@ -63,26 +77,36 @@
       (reduce_domain_to_scalar_id,reduce_domain_to_scalar_hdl)
       CALL xios(get_reduce_domain_to_scalar_attr_hdl_)   &
-      ( reduce_domain_to_scalar_hdl, operation )
+      ( reduce_domain_to_scalar_hdl, local, operation )
 
   END SUBROUTINE xios(get_reduce_domain_to_scalar_attr)
 
   SUBROUTINE xios(get_reduce_domain_to_scalar_attr_hdl)  &
-    ( reduce_domain_to_scalar_hdl, operation )
+    ( reduce_domain_to_scalar_hdl, local, operation )
 
     IMPLICIT NONE
       TYPE(txios(reduce_domain_to_scalar)) , INTENT(IN) :: reduce_domain_to_scalar_hdl
+      LOGICAL  , OPTIONAL, INTENT(OUT) :: local
+      LOGICAL (KIND=C_BOOL) :: local_tmp
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: operation
 
       CALL xios(get_reduce_domain_to_scalar_attr_hdl_)  &
-      ( reduce_domain_to_scalar_hdl, operation )
+      ( reduce_domain_to_scalar_hdl, local, operation )
 
   END SUBROUTINE xios(get_reduce_domain_to_scalar_attr_hdl)
 
   SUBROUTINE xios(get_reduce_domain_to_scalar_attr_hdl_)   &
-    ( reduce_domain_to_scalar_hdl, operation_ )
+    ( reduce_domain_to_scalar_hdl, local_, operation_ )
 
     IMPLICIT NONE
       TYPE(txios(reduce_domain_to_scalar)) , INTENT(IN) :: reduce_domain_to_scalar_hdl
+      LOGICAL  , OPTIONAL, INTENT(OUT) :: local_
+      LOGICAL (KIND=C_BOOL) :: local__tmp
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: operation_
+
+      IF (PRESENT(local_)) THEN
+        CALL cxios_get_reduce_domain_to_scalar_local &
+      (reduce_domain_to_scalar_hdl%daddr, local__tmp)
+        local_ = local__tmp
+      ENDIF
 
       IF (PRESENT(operation_)) THEN
@@ -94,9 +118,11 @@
 
   SUBROUTINE xios(is_defined_reduce_domain_to_scalar_attr)  &
-    ( reduce_domain_to_scalar_id, operation )
+    ( reduce_domain_to_scalar_id, local, operation )
 
     IMPLICIT NONE
       TYPE(txios(reduce_domain_to_scalar))  :: reduce_domain_to_scalar_hdl
       CHARACTER(LEN=*), INTENT(IN) ::reduce_domain_to_scalar_id
+      LOGICAL, OPTIONAL, INTENT(OUT) :: local
+      LOGICAL(KIND=C_BOOL) :: local_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: operation
       LOGICAL(KIND=C_BOOL) :: operation_tmp
@@ -105,28 +131,38 @@
       (reduce_domain_to_scalar_id,reduce_domain_to_scalar_hdl)
       CALL xios(is_defined_reduce_domain_to_scalar_attr_hdl_)   &
-      ( reduce_domain_to_scalar_hdl, operation )
+      ( reduce_domain_to_scalar_hdl, local, operation )
 
   END SUBROUTINE xios(is_defined_reduce_domain_to_scalar_attr)
 
   SUBROUTINE xios(is_defined_reduce_domain_to_scalar_attr_hdl)  &
-    ( reduce_domain_to_scalar_hdl, operation )
+    ( reduce_domain_to_scalar_hdl, local, operation )
 
     IMPLICIT NONE
       TYPE(txios(reduce_domain_to_scalar)) , INTENT(IN) :: reduce_domain_to_scalar_hdl
+      LOGICAL, OPTIONAL, INTENT(OUT) :: local
+      LOGICAL(KIND=C_BOOL) :: local_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: operation
       LOGICAL(KIND=C_BOOL) :: operation_tmp
 
       CALL xios(is_defined_reduce_domain_to_scalar_attr_hdl_)  &
-      ( reduce_domain_to_scalar_hdl, operation )
+      ( reduce_domain_to_scalar_hdl, local, operation )
 
   END SUBROUTINE xios(is_defined_reduce_domain_to_scalar_attr_hdl)
 
   SUBROUTINE xios(is_defined_reduce_domain_to_scalar_attr_hdl_)   &
-    ( reduce_domain_to_scalar_hdl, operation_ )
+    ( reduce_domain_to_scalar_hdl, local_, operation_ )
 
     IMPLICIT NONE
       TYPE(txios(reduce_domain_to_scalar)) , INTENT(IN) :: reduce_domain_to_scalar_hdl
+      LOGICAL, OPTIONAL, INTENT(OUT) :: local_
+      LOGICAL(KIND=C_BOOL) :: local__tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: operation_
       LOGICAL(KIND=C_BOOL) :: operation__tmp
+
+      IF (PRESENT(local_)) THEN
+        local__tmp = cxios_is_defined_reduce_domain_to_scalar_local &
+      (reduce_domain_to_scalar_hdl%daddr)
+        local_ = local__tmp
+      ENDIF
 
       IF (PRESENT(operation_)) THEN
Index: /XIOS/trunk/src/interface/fortran_attr/ireduce_scalar_to_scalar_attr.F90
===================================================================
--- /XIOS/trunk/src/interface/fortran_attr/ireduce_scalar_to_scalar_attr.F90	(revision 1537)
+++ /XIOS/trunk/src/interface/fortran_attr/ireduce_scalar_to_scalar_attr.F90	(revision 1537)
@@ -0,0 +1,140 @@
+! * ************************************************************************** *
+! *               Interface auto generated - do not modify                     *
+! * ************************************************************************** *
+#include "xios_fortran_prefix.hpp"
+
+MODULE ireduce_scalar_to_scalar_attr
+  USE, INTRINSIC :: ISO_C_BINDING
+  USE ireduce_scalar_to_scalar
+  USE reduce_scalar_to_scalar_interface_attr
+
+CONTAINS
+
+  SUBROUTINE xios(set_reduce_scalar_to_scalar_attr)  &
+    ( reduce_scalar_to_scalar_id, operation )
+
+    IMPLICIT NONE
+      TYPE(txios(reduce_scalar_to_scalar))  :: reduce_scalar_to_scalar_hdl
+      CHARACTER(LEN=*), INTENT(IN) ::reduce_scalar_to_scalar_id
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: operation
+
+      CALL xios(get_reduce_scalar_to_scalar_handle) &
+      (reduce_scalar_to_scalar_id,reduce_scalar_to_scalar_hdl)
+      CALL xios(set_reduce_scalar_to_scalar_attr_hdl_)   &
+      ( reduce_scalar_to_scalar_hdl, operation )
+
+  END SUBROUTINE xios(set_reduce_scalar_to_scalar_attr)
+
+  SUBROUTINE xios(set_reduce_scalar_to_scalar_attr_hdl)  &
+    ( reduce_scalar_to_scalar_hdl, operation )
+
+    IMPLICIT NONE
+      TYPE(txios(reduce_scalar_to_scalar)) , INTENT(IN) :: reduce_scalar_to_scalar_hdl
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: operation
+
+      CALL xios(set_reduce_scalar_to_scalar_attr_hdl_)  &
+      ( reduce_scalar_to_scalar_hdl, operation )
+
+  END SUBROUTINE xios(set_reduce_scalar_to_scalar_attr_hdl)
+
+  SUBROUTINE xios(set_reduce_scalar_to_scalar_attr_hdl_)   &
+    ( reduce_scalar_to_scalar_hdl, operation_ )
+
+    IMPLICIT NONE
+      TYPE(txios(reduce_scalar_to_scalar)) , INTENT(IN) :: reduce_scalar_to_scalar_hdl
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: operation_
+
+      IF (PRESENT(operation_)) THEN
+        CALL cxios_set_reduce_scalar_to_scalar_operation &
+      (reduce_scalar_to_scalar_hdl%daddr, operation_, len(operation_))
+      ENDIF
+
+  END SUBROUTINE xios(set_reduce_scalar_to_scalar_attr_hdl_)
+
+  SUBROUTINE xios(get_reduce_scalar_to_scalar_attr)  &
+    ( reduce_scalar_to_scalar_id, operation )
+
+    IMPLICIT NONE
+      TYPE(txios(reduce_scalar_to_scalar))  :: reduce_scalar_to_scalar_hdl
+      CHARACTER(LEN=*), INTENT(IN) ::reduce_scalar_to_scalar_id
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: operation
+
+      CALL xios(get_reduce_scalar_to_scalar_handle) &
+      (reduce_scalar_to_scalar_id,reduce_scalar_to_scalar_hdl)
+      CALL xios(get_reduce_scalar_to_scalar_attr_hdl_)   &
+      ( reduce_scalar_to_scalar_hdl, operation )
+
+  END SUBROUTINE xios(get_reduce_scalar_to_scalar_attr)
+
+  SUBROUTINE xios(get_reduce_scalar_to_scalar_attr_hdl)  &
+    ( reduce_scalar_to_scalar_hdl, operation )
+
+    IMPLICIT NONE
+      TYPE(txios(reduce_scalar_to_scalar)) , INTENT(IN) :: reduce_scalar_to_scalar_hdl
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: operation
+
+      CALL xios(get_reduce_scalar_to_scalar_attr_hdl_)  &
+      ( reduce_scalar_to_scalar_hdl, operation )
+
+  END SUBROUTINE xios(get_reduce_scalar_to_scalar_attr_hdl)
+
+  SUBROUTINE xios(get_reduce_scalar_to_scalar_attr_hdl_)   &
+    ( reduce_scalar_to_scalar_hdl, operation_ )
+
+    IMPLICIT NONE
+      TYPE(txios(reduce_scalar_to_scalar)) , INTENT(IN) :: reduce_scalar_to_scalar_hdl
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: operation_
+
+      IF (PRESENT(operation_)) THEN
+        CALL cxios_get_reduce_scalar_to_scalar_operation &
+      (reduce_scalar_to_scalar_hdl%daddr, operation_, len(operation_))
+      ENDIF
+
+  END SUBROUTINE xios(get_reduce_scalar_to_scalar_attr_hdl_)
+
+  SUBROUTINE xios(is_defined_reduce_scalar_to_scalar_attr)  &
+    ( reduce_scalar_to_scalar_id, operation )
+
+    IMPLICIT NONE
+      TYPE(txios(reduce_scalar_to_scalar))  :: reduce_scalar_to_scalar_hdl
+      CHARACTER(LEN=*), INTENT(IN) ::reduce_scalar_to_scalar_id
+      LOGICAL, OPTIONAL, INTENT(OUT) :: operation
+      LOGICAL(KIND=C_BOOL) :: operation_tmp
+
+      CALL xios(get_reduce_scalar_to_scalar_handle) &
+      (reduce_scalar_to_scalar_id,reduce_scalar_to_scalar_hdl)
+      CALL xios(is_defined_reduce_scalar_to_scalar_attr_hdl_)   &
+      ( reduce_scalar_to_scalar_hdl, operation )
+
+  END SUBROUTINE xios(is_defined_reduce_scalar_to_scalar_attr)
+
+  SUBROUTINE xios(is_defined_reduce_scalar_to_scalar_attr_hdl)  &
+    ( reduce_scalar_to_scalar_hdl, operation )
+
+    IMPLICIT NONE
+      TYPE(txios(reduce_scalar_to_scalar)) , INTENT(IN) :: reduce_scalar_to_scalar_hdl
+      LOGICAL, OPTIONAL, INTENT(OUT) :: operation
+      LOGICAL(KIND=C_BOOL) :: operation_tmp
+
+      CALL xios(is_defined_reduce_scalar_to_scalar_attr_hdl_)  &
+      ( reduce_scalar_to_scalar_hdl, operation )
+
+  END SUBROUTINE xios(is_defined_reduce_scalar_to_scalar_attr_hdl)
+
+  SUBROUTINE xios(is_defined_reduce_scalar_to_scalar_attr_hdl_)   &
+    ( reduce_scalar_to_scalar_hdl, operation_ )
+
+    IMPLICIT NONE
+      TYPE(txios(reduce_scalar_to_scalar)) , INTENT(IN) :: reduce_scalar_to_scalar_hdl
+      LOGICAL, OPTIONAL, INTENT(OUT) :: operation_
+      LOGICAL(KIND=C_BOOL) :: operation__tmp
+
+      IF (PRESENT(operation_)) THEN
+        operation__tmp = cxios_is_defined_reduce_scalar_to_scalar_operation &
+      (reduce_scalar_to_scalar_hdl%daddr)
+        operation_ = operation__tmp
+      ENDIF
+
+  END SUBROUTINE xios(is_defined_reduce_scalar_to_scalar_attr_hdl_)
+
+END MODULE ireduce_scalar_to_scalar_attr
Index: /XIOS/trunk/src/interface/fortran_attr/ireorder_domain_attr.F90
===================================================================
--- /XIOS/trunk/src/interface/fortran_attr/ireorder_domain_attr.F90	(revision 1537)
+++ /XIOS/trunk/src/interface/fortran_attr/ireorder_domain_attr.F90	(revision 1537)
@@ -0,0 +1,232 @@
+! * ************************************************************************** *
+! *               Interface auto generated - do not modify                     *
+! * ************************************************************************** *
+#include "xios_fortran_prefix.hpp"
+
+MODULE ireorder_domain_attr
+  USE, INTRINSIC :: ISO_C_BINDING
+  USE ireorder_domain
+  USE reorder_domain_interface_attr
+
+CONTAINS
+
+  SUBROUTINE xios(set_reorder_domain_attr)  &
+    ( reorder_domain_id, invert_lat, max_lon, min_lon, shift_lon_fraction )
+
+    IMPLICIT NONE
+      TYPE(txios(reorder_domain))  :: reorder_domain_hdl
+      CHARACTER(LEN=*), INTENT(IN) ::reorder_domain_id
+      LOGICAL  , OPTIONAL, INTENT(IN) :: invert_lat
+      LOGICAL (KIND=C_BOOL) :: invert_lat_tmp
+      REAL (KIND=8) , OPTIONAL, INTENT(IN) :: max_lon
+      REAL (KIND=8) , OPTIONAL, INTENT(IN) :: min_lon
+      REAL (KIND=8) , OPTIONAL, INTENT(IN) :: shift_lon_fraction
+
+      CALL xios(get_reorder_domain_handle) &
+      (reorder_domain_id,reorder_domain_hdl)
+      CALL xios(set_reorder_domain_attr_hdl_)   &
+      ( reorder_domain_hdl, invert_lat, max_lon, min_lon, shift_lon_fraction )
+
+  END SUBROUTINE xios(set_reorder_domain_attr)
+
+  SUBROUTINE xios(set_reorder_domain_attr_hdl)  &
+    ( reorder_domain_hdl, invert_lat, max_lon, min_lon, shift_lon_fraction )
+
+    IMPLICIT NONE
+      TYPE(txios(reorder_domain)) , INTENT(IN) :: reorder_domain_hdl
+      LOGICAL  , OPTIONAL, INTENT(IN) :: invert_lat
+      LOGICAL (KIND=C_BOOL) :: invert_lat_tmp
+      REAL (KIND=8) , OPTIONAL, INTENT(IN) :: max_lon
+      REAL (KIND=8) , OPTIONAL, INTENT(IN) :: min_lon
+      REAL (KIND=8) , OPTIONAL, INTENT(IN) :: shift_lon_fraction
+
+      CALL xios(set_reorder_domain_attr_hdl_)  &
+      ( reorder_domain_hdl, invert_lat, max_lon, min_lon, shift_lon_fraction )
+
+  END SUBROUTINE xios(set_reorder_domain_attr_hdl)
+
+  SUBROUTINE xios(set_reorder_domain_attr_hdl_)   &
+    ( reorder_domain_hdl, invert_lat_, max_lon_, min_lon_, shift_lon_fraction_ )
+
+    IMPLICIT NONE
+      TYPE(txios(reorder_domain)) , INTENT(IN) :: reorder_domain_hdl
+      LOGICAL  , OPTIONAL, INTENT(IN) :: invert_lat_
+      LOGICAL (KIND=C_BOOL) :: invert_lat__tmp
+      REAL (KIND=8) , OPTIONAL, INTENT(IN) :: max_lon_
+      REAL (KIND=8) , OPTIONAL, INTENT(IN) :: min_lon_
+      REAL (KIND=8) , OPTIONAL, INTENT(IN) :: shift_lon_fraction_
+
+      IF (PRESENT(invert_lat_)) THEN
+        invert_lat__tmp = invert_lat_
+        CALL cxios_set_reorder_domain_invert_lat &
+      (reorder_domain_hdl%daddr, invert_lat__tmp)
+      ENDIF
+
+      IF (PRESENT(max_lon_)) THEN
+        CALL cxios_set_reorder_domain_max_lon &
+      (reorder_domain_hdl%daddr, max_lon_)
+      ENDIF
+
+      IF (PRESENT(min_lon_)) THEN
+        CALL cxios_set_reorder_domain_min_lon &
+      (reorder_domain_hdl%daddr, min_lon_)
+      ENDIF
+
+      IF (PRESENT(shift_lon_fraction_)) THEN
+        CALL cxios_set_reorder_domain_shift_lon_fraction &
+      (reorder_domain_hdl%daddr, shift_lon_fraction_)
+      ENDIF
+
+  END SUBROUTINE xios(set_reorder_domain_attr_hdl_)
+
+  SUBROUTINE xios(get_reorder_domain_attr)  &
+    ( reorder_domain_id, invert_lat, max_lon, min_lon, shift_lon_fraction )
+
+    IMPLICIT NONE
+      TYPE(txios(reorder_domain))  :: reorder_domain_hdl
+      CHARACTER(LEN=*), INTENT(IN) ::reorder_domain_id
+      LOGICAL  , OPTIONAL, INTENT(OUT) :: invert_lat
+      LOGICAL (KIND=C_BOOL) :: invert_lat_tmp
+      REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: max_lon
+      REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: min_lon
+      REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: shift_lon_fraction
+
+      CALL xios(get_reorder_domain_handle) &
+      (reorder_domain_id,reorder_domain_hdl)
+      CALL xios(get_reorder_domain_attr_hdl_)   &
+      ( reorder_domain_hdl, invert_lat, max_lon, min_lon, shift_lon_fraction )
+
+  END SUBROUTINE xios(get_reorder_domain_attr)
+
+  SUBROUTINE xios(get_reorder_domain_attr_hdl)  &
+    ( reorder_domain_hdl, invert_lat, max_lon, min_lon, shift_lon_fraction )
+
+    IMPLICIT NONE
+      TYPE(txios(reorder_domain)) , INTENT(IN) :: reorder_domain_hdl
+      LOGICAL  , OPTIONAL, INTENT(OUT) :: invert_lat
+      LOGICAL (KIND=C_BOOL) :: invert_lat_tmp
+      REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: max_lon
+      REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: min_lon
+      REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: shift_lon_fraction
+
+      CALL xios(get_reorder_domain_attr_hdl_)  &
+      ( reorder_domain_hdl, invert_lat, max_lon, min_lon, shift_lon_fraction )
+
+  END SUBROUTINE xios(get_reorder_domain_attr_hdl)
+
+  SUBROUTINE xios(get_reorder_domain_attr_hdl_)   &
+    ( reorder_domain_hdl, invert_lat_, max_lon_, min_lon_, shift_lon_fraction_ )
+
+    IMPLICIT NONE
+      TYPE(txios(reorder_domain)) , INTENT(IN) :: reorder_domain_hdl
+      LOGICAL  , OPTIONAL, INTENT(OUT) :: invert_lat_
+      LOGICAL (KIND=C_BOOL) :: invert_lat__tmp
+      REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: max_lon_
+      REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: min_lon_
+      REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: shift_lon_fraction_
+
+      IF (PRESENT(invert_lat_)) THEN
+        CALL cxios_get_reorder_domain_invert_lat &
+      (reorder_domain_hdl%daddr, invert_lat__tmp)
+        invert_lat_ = invert_lat__tmp
+      ENDIF
+
+      IF (PRESENT(max_lon_)) THEN
+        CALL cxios_get_reorder_domain_max_lon &
+      (reorder_domain_hdl%daddr, max_lon_)
+      ENDIF
+
+      IF (PRESENT(min_lon_)) THEN
+        CALL cxios_get_reorder_domain_min_lon &
+      (reorder_domain_hdl%daddr, min_lon_)
+      ENDIF
+
+      IF (PRESENT(shift_lon_fraction_)) THEN
+        CALL cxios_get_reorder_domain_shift_lon_fraction &
+      (reorder_domain_hdl%daddr, shift_lon_fraction_)
+      ENDIF
+
+  END SUBROUTINE xios(get_reorder_domain_attr_hdl_)
+
+  SUBROUTINE xios(is_defined_reorder_domain_attr)  &
+    ( reorder_domain_id, invert_lat, max_lon, min_lon, shift_lon_fraction )
+
+    IMPLICIT NONE
+      TYPE(txios(reorder_domain))  :: reorder_domain_hdl
+      CHARACTER(LEN=*), INTENT(IN) ::reorder_domain_id
+      LOGICAL, OPTIONAL, INTENT(OUT) :: invert_lat
+      LOGICAL(KIND=C_BOOL) :: invert_lat_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: max_lon
+      LOGICAL(KIND=C_BOOL) :: max_lon_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: min_lon
+      LOGICAL(KIND=C_BOOL) :: min_lon_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: shift_lon_fraction
+      LOGICAL(KIND=C_BOOL) :: shift_lon_fraction_tmp
+
+      CALL xios(get_reorder_domain_handle) &
+      (reorder_domain_id,reorder_domain_hdl)
+      CALL xios(is_defined_reorder_domain_attr_hdl_)   &
+      ( reorder_domain_hdl, invert_lat, max_lon, min_lon, shift_lon_fraction )
+
+  END SUBROUTINE xios(is_defined_reorder_domain_attr)
+
+  SUBROUTINE xios(is_defined_reorder_domain_attr_hdl)  &
+    ( reorder_domain_hdl, invert_lat, max_lon, min_lon, shift_lon_fraction )
+
+    IMPLICIT NONE
+      TYPE(txios(reorder_domain)) , INTENT(IN) :: reorder_domain_hdl
+      LOGICAL, OPTIONAL, INTENT(OUT) :: invert_lat
+      LOGICAL(KIND=C_BOOL) :: invert_lat_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: max_lon
+      LOGICAL(KIND=C_BOOL) :: max_lon_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: min_lon
+      LOGICAL(KIND=C_BOOL) :: min_lon_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: shift_lon_fraction
+      LOGICAL(KIND=C_BOOL) :: shift_lon_fraction_tmp
+
+      CALL xios(is_defined_reorder_domain_attr_hdl_)  &
+      ( reorder_domain_hdl, invert_lat, max_lon, min_lon, shift_lon_fraction )
+
+  END SUBROUTINE xios(is_defined_reorder_domain_attr_hdl)
+
+  SUBROUTINE xios(is_defined_reorder_domain_attr_hdl_)   &
+    ( reorder_domain_hdl, invert_lat_, max_lon_, min_lon_, shift_lon_fraction_ )
+
+    IMPLICIT NONE
+      TYPE(txios(reorder_domain)) , INTENT(IN) :: reorder_domain_hdl
+      LOGICAL, OPTIONAL, INTENT(OUT) :: invert_lat_
+      LOGICAL(KIND=C_BOOL) :: invert_lat__tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: max_lon_
+      LOGICAL(KIND=C_BOOL) :: max_lon__tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: min_lon_
+      LOGICAL(KIND=C_BOOL) :: min_lon__tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: shift_lon_fraction_
+      LOGICAL(KIND=C_BOOL) :: shift_lon_fraction__tmp
+
+      IF (PRESENT(invert_lat_)) THEN
+        invert_lat__tmp = cxios_is_defined_reorder_domain_invert_lat &
+      (reorder_domain_hdl%daddr)
+        invert_lat_ = invert_lat__tmp
+      ENDIF
+
+      IF (PRESENT(max_lon_)) THEN
+        max_lon__tmp = cxios_is_defined_reorder_domain_max_lon &
+      (reorder_domain_hdl%daddr)
+        max_lon_ = max_lon__tmp
+      ENDIF
+
+      IF (PRESENT(min_lon_)) THEN
+        min_lon__tmp = cxios_is_defined_reorder_domain_min_lon &
+      (reorder_domain_hdl%daddr)
+        min_lon_ = min_lon__tmp
+      ENDIF
+
+      IF (PRESENT(shift_lon_fraction_)) THEN
+        shift_lon_fraction__tmp = cxios_is_defined_reorder_domain_shift_lon_fraction &
+      (reorder_domain_hdl%daddr)
+        shift_lon_fraction_ = shift_lon_fraction__tmp
+      ENDIF
+
+  END SUBROUTINE xios(is_defined_reorder_domain_attr_hdl_)
+
+END MODULE ireorder_domain_attr
Index: /XIOS/trunk/src/interface/fortran_attr/iscalar_attr.F90
===================================================================
--- /XIOS/trunk/src/interface/fortran_attr/iscalar_attr.F90	(revision 1536)
+++ /XIOS/trunk/src/interface/fortran_attr/iscalar_attr.F90	(revision 1537)
@@ -12,11 +12,18 @@
 
   SUBROUTINE xios(set_scalar_attr)  &
-    ( scalar_id, long_name, name, prec, scalar_ref, standard_name, unit, value )
+    ( scalar_id, axis_type, bounds, bounds_name, comment, label, long_name, name, positive, prec  &
+    , scalar_ref, standard_name, unit, value )
 
     IMPLICIT NONE
       TYPE(txios(scalar))  :: scalar_hdl
       CHARACTER(LEN=*), INTENT(IN) ::scalar_id
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: axis_type
+      REAL (KIND=8) , OPTIONAL, INTENT(IN) :: bounds(:)
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: bounds_name
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: comment
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: label
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: long_name
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: name
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: positive
       INTEGER  , OPTIONAL, INTENT(IN) :: prec
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: scalar_ref
@@ -28,15 +35,23 @@
       (scalar_id,scalar_hdl)
       CALL xios(set_scalar_attr_hdl_)   &
-      ( scalar_hdl, long_name, name, prec, scalar_ref, standard_name, unit, value )
+      ( scalar_hdl, axis_type, bounds, bounds_name, comment, label, long_name, name, positive, prec  &
+      , scalar_ref, standard_name, unit, value )
 
   END SUBROUTINE xios(set_scalar_attr)
 
   SUBROUTINE xios(set_scalar_attr_hdl)  &
-    ( scalar_hdl, long_name, name, prec, scalar_ref, standard_name, unit, value )
-
-    IMPLICIT NONE
-      TYPE(txios(scalar)) , INTENT(IN) :: scalar_hdl
+    ( scalar_hdl, axis_type, bounds, bounds_name, comment, label, long_name, name, positive, prec  &
+    , scalar_ref, standard_name, unit, value )
+
+    IMPLICIT NONE
+      TYPE(txios(scalar)) , INTENT(IN) :: scalar_hdl
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: axis_type
+      REAL (KIND=8) , OPTIONAL, INTENT(IN) :: bounds(:)
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: bounds_name
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: comment
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: label
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: long_name
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: name
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: positive
       INTEGER  , OPTIONAL, INTENT(IN) :: prec
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: scalar_ref
@@ -46,15 +61,23 @@
 
       CALL xios(set_scalar_attr_hdl_)  &
-      ( scalar_hdl, long_name, name, prec, scalar_ref, standard_name, unit, value )
+      ( scalar_hdl, axis_type, bounds, bounds_name, comment, label, long_name, name, positive, prec  &
+      , scalar_ref, standard_name, unit, value )
 
   END SUBROUTINE xios(set_scalar_attr_hdl)
 
   SUBROUTINE xios(set_scalar_attr_hdl_)   &
-    ( scalar_hdl, long_name_, name_, prec_, scalar_ref_, standard_name_, unit_, value_ )
-
-    IMPLICIT NONE
-      TYPE(txios(scalar)) , INTENT(IN) :: scalar_hdl
+    ( scalar_hdl, axis_type_, bounds_, bounds_name_, comment_, label_, long_name_, name_, positive_  &
+    , prec_, scalar_ref_, standard_name_, unit_, value_ )
+
+    IMPLICIT NONE
+      TYPE(txios(scalar)) , INTENT(IN) :: scalar_hdl
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: axis_type_
+      REAL (KIND=8) , OPTIONAL, INTENT(IN) :: bounds_(:)
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: bounds_name_
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: comment_
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: label_
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: long_name_
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: name_
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: positive_
       INTEGER  , OPTIONAL, INTENT(IN) :: prec_
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: scalar_ref_
@@ -63,4 +86,29 @@
       REAL (KIND=8) , OPTIONAL, INTENT(IN) :: value_
 
+      IF (PRESENT(axis_type_)) THEN
+        CALL cxios_set_scalar_axis_type &
+      (scalar_hdl%daddr, axis_type_, len(axis_type_))
+      ENDIF
+
+      IF (PRESENT(bounds_)) THEN
+        CALL cxios_set_scalar_bounds &
+      (scalar_hdl%daddr, bounds_, SHAPE(bounds_))
+      ENDIF
+
+      IF (PRESENT(bounds_name_)) THEN
+        CALL cxios_set_scalar_bounds_name &
+      (scalar_hdl%daddr, bounds_name_, len(bounds_name_))
+      ENDIF
+
+      IF (PRESENT(comment_)) THEN
+        CALL cxios_set_scalar_comment &
+      (scalar_hdl%daddr, comment_, len(comment_))
+      ENDIF
+
+      IF (PRESENT(label_)) THEN
+        CALL cxios_set_scalar_label &
+      (scalar_hdl%daddr, label_, len(label_))
+      ENDIF
+
       IF (PRESENT(long_name_)) THEN
         CALL cxios_set_scalar_long_name &
@@ -73,4 +121,9 @@
       ENDIF
 
+      IF (PRESENT(positive_)) THEN
+        CALL cxios_set_scalar_positive &
+      (scalar_hdl%daddr, positive_, len(positive_))
+      ENDIF
+
       IF (PRESENT(prec_)) THEN
         CALL cxios_set_scalar_prec &
@@ -101,11 +154,18 @@
 
   SUBROUTINE xios(get_scalar_attr)  &
-    ( scalar_id, long_name, name, prec, scalar_ref, standard_name, unit, value )
+    ( scalar_id, axis_type, bounds, bounds_name, comment, label, long_name, name, positive, prec  &
+    , scalar_ref, standard_name, unit, value )
 
     IMPLICIT NONE
       TYPE(txios(scalar))  :: scalar_hdl
       CHARACTER(LEN=*), INTENT(IN) ::scalar_id
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: axis_type
+      REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: bounds(:)
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: bounds_name
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: comment
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: label
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: long_name
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: name
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: positive
       INTEGER  , OPTIONAL, INTENT(OUT) :: prec
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: scalar_ref
@@ -117,15 +177,23 @@
       (scalar_id,scalar_hdl)
       CALL xios(get_scalar_attr_hdl_)   &
-      ( scalar_hdl, long_name, name, prec, scalar_ref, standard_name, unit, value )
+      ( scalar_hdl, axis_type, bounds, bounds_name, comment, label, long_name, name, positive, prec  &
+      , scalar_ref, standard_name, unit, value )
 
   END SUBROUTINE xios(get_scalar_attr)
 
   SUBROUTINE xios(get_scalar_attr_hdl)  &
-    ( scalar_hdl, long_name, name, prec, scalar_ref, standard_name, unit, value )
-
-    IMPLICIT NONE
-      TYPE(txios(scalar)) , INTENT(IN) :: scalar_hdl
+    ( scalar_hdl, axis_type, bounds, bounds_name, comment, label, long_name, name, positive, prec  &
+    , scalar_ref, standard_name, unit, value )
+
+    IMPLICIT NONE
+      TYPE(txios(scalar)) , INTENT(IN) :: scalar_hdl
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: axis_type
+      REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: bounds(:)
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: bounds_name
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: comment
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: label
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: long_name
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: name
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: positive
       INTEGER  , OPTIONAL, INTENT(OUT) :: prec
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: scalar_ref
@@ -135,15 +203,23 @@
 
       CALL xios(get_scalar_attr_hdl_)  &
-      ( scalar_hdl, long_name, name, prec, scalar_ref, standard_name, unit, value )
+      ( scalar_hdl, axis_type, bounds, bounds_name, comment, label, long_name, name, positive, prec  &
+      , scalar_ref, standard_name, unit, value )
 
   END SUBROUTINE xios(get_scalar_attr_hdl)
 
   SUBROUTINE xios(get_scalar_attr_hdl_)   &
-    ( scalar_hdl, long_name_, name_, prec_, scalar_ref_, standard_name_, unit_, value_ )
-
-    IMPLICIT NONE
-      TYPE(txios(scalar)) , INTENT(IN) :: scalar_hdl
+    ( scalar_hdl, axis_type_, bounds_, bounds_name_, comment_, label_, long_name_, name_, positive_  &
+    , prec_, scalar_ref_, standard_name_, unit_, value_ )
+
+    IMPLICIT NONE
+      TYPE(txios(scalar)) , INTENT(IN) :: scalar_hdl
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: axis_type_
+      REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: bounds_(:)
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: bounds_name_
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: comment_
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: label_
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: long_name_
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: name_
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: positive_
       INTEGER  , OPTIONAL, INTENT(OUT) :: prec_
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: scalar_ref_
@@ -152,4 +228,29 @@
       REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: value_
 
+      IF (PRESENT(axis_type_)) THEN
+        CALL cxios_get_scalar_axis_type &
+      (scalar_hdl%daddr, axis_type_, len(axis_type_))
+      ENDIF
+
+      IF (PRESENT(bounds_)) THEN
+        CALL cxios_get_scalar_bounds &
+      (scalar_hdl%daddr, bounds_, SHAPE(bounds_))
+      ENDIF
+
+      IF (PRESENT(bounds_name_)) THEN
+        CALL cxios_get_scalar_bounds_name &
+      (scalar_hdl%daddr, bounds_name_, len(bounds_name_))
+      ENDIF
+
+      IF (PRESENT(comment_)) THEN
+        CALL cxios_get_scalar_comment &
+      (scalar_hdl%daddr, comment_, len(comment_))
+      ENDIF
+
+      IF (PRESENT(label_)) THEN
+        CALL cxios_get_scalar_label &
+      (scalar_hdl%daddr, label_, len(label_))
+      ENDIF
+
       IF (PRESENT(long_name_)) THEN
         CALL cxios_get_scalar_long_name &
@@ -162,4 +263,9 @@
       ENDIF
 
+      IF (PRESENT(positive_)) THEN
+        CALL cxios_get_scalar_positive &
+      (scalar_hdl%daddr, positive_, len(positive_))
+      ENDIF
+
       IF (PRESENT(prec_)) THEN
         CALL cxios_get_scalar_prec &
@@ -190,13 +296,26 @@
 
   SUBROUTINE xios(is_defined_scalar_attr)  &
-    ( scalar_id, long_name, name, prec, scalar_ref, standard_name, unit, value )
+    ( scalar_id, axis_type, bounds, bounds_name, comment, label, long_name, name, positive, prec  &
+    , scalar_ref, standard_name, unit, value )
 
     IMPLICIT NONE
       TYPE(txios(scalar))  :: scalar_hdl
       CHARACTER(LEN=*), INTENT(IN) ::scalar_id
+      LOGICAL, OPTIONAL, INTENT(OUT) :: axis_type
+      LOGICAL(KIND=C_BOOL) :: axis_type_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: bounds
+      LOGICAL(KIND=C_BOOL) :: bounds_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: bounds_name
+      LOGICAL(KIND=C_BOOL) :: bounds_name_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: comment
+      LOGICAL(KIND=C_BOOL) :: comment_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: label
+      LOGICAL(KIND=C_BOOL) :: label_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: long_name
       LOGICAL(KIND=C_BOOL) :: long_name_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: name
       LOGICAL(KIND=C_BOOL) :: name_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: positive
+      LOGICAL(KIND=C_BOOL) :: positive_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: prec
       LOGICAL(KIND=C_BOOL) :: prec_tmp
@@ -213,17 +332,31 @@
       (scalar_id,scalar_hdl)
       CALL xios(is_defined_scalar_attr_hdl_)   &
-      ( scalar_hdl, long_name, name, prec, scalar_ref, standard_name, unit, value )
+      ( scalar_hdl, axis_type, bounds, bounds_name, comment, label, long_name, name, positive, prec  &
+      , scalar_ref, standard_name, unit, value )
 
   END SUBROUTINE xios(is_defined_scalar_attr)
 
   SUBROUTINE xios(is_defined_scalar_attr_hdl)  &
-    ( scalar_hdl, long_name, name, prec, scalar_ref, standard_name, unit, value )
-
-    IMPLICIT NONE
-      TYPE(txios(scalar)) , INTENT(IN) :: scalar_hdl
+    ( scalar_hdl, axis_type, bounds, bounds_name, comment, label, long_name, name, positive, prec  &
+    , scalar_ref, standard_name, unit, value )
+
+    IMPLICIT NONE
+      TYPE(txios(scalar)) , INTENT(IN) :: scalar_hdl
+      LOGICAL, OPTIONAL, INTENT(OUT) :: axis_type
+      LOGICAL(KIND=C_BOOL) :: axis_type_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: bounds
+      LOGICAL(KIND=C_BOOL) :: bounds_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: bounds_name
+      LOGICAL(KIND=C_BOOL) :: bounds_name_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: comment
+      LOGICAL(KIND=C_BOOL) :: comment_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: label
+      LOGICAL(KIND=C_BOOL) :: label_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: long_name
       LOGICAL(KIND=C_BOOL) :: long_name_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: name
       LOGICAL(KIND=C_BOOL) :: name_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: positive
+      LOGICAL(KIND=C_BOOL) :: positive_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: prec
       LOGICAL(KIND=C_BOOL) :: prec_tmp
@@ -238,17 +371,31 @@
 
       CALL xios(is_defined_scalar_attr_hdl_)  &
-      ( scalar_hdl, long_name, name, prec, scalar_ref, standard_name, unit, value )
+      ( scalar_hdl, axis_type, bounds, bounds_name, comment, label, long_name, name, positive, prec  &
+      , scalar_ref, standard_name, unit, value )
 
   END SUBROUTINE xios(is_defined_scalar_attr_hdl)
 
   SUBROUTINE xios(is_defined_scalar_attr_hdl_)   &
-    ( scalar_hdl, long_name_, name_, prec_, scalar_ref_, standard_name_, unit_, value_ )
-
-    IMPLICIT NONE
-      TYPE(txios(scalar)) , INTENT(IN) :: scalar_hdl
+    ( scalar_hdl, axis_type_, bounds_, bounds_name_, comment_, label_, long_name_, name_, positive_  &
+    , prec_, scalar_ref_, standard_name_, unit_, value_ )
+
+    IMPLICIT NONE
+      TYPE(txios(scalar)) , INTENT(IN) :: scalar_hdl
+      LOGICAL, OPTIONAL, INTENT(OUT) :: axis_type_
+      LOGICAL(KIND=C_BOOL) :: axis_type__tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: bounds_
+      LOGICAL(KIND=C_BOOL) :: bounds__tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: bounds_name_
+      LOGICAL(KIND=C_BOOL) :: bounds_name__tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: comment_
+      LOGICAL(KIND=C_BOOL) :: comment__tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: label_
+      LOGICAL(KIND=C_BOOL) :: label__tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: long_name_
       LOGICAL(KIND=C_BOOL) :: long_name__tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: name_
       LOGICAL(KIND=C_BOOL) :: name__tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: positive_
+      LOGICAL(KIND=C_BOOL) :: positive__tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: prec_
       LOGICAL(KIND=C_BOOL) :: prec__tmp
@@ -262,4 +409,34 @@
       LOGICAL(KIND=C_BOOL) :: value__tmp
 
+      IF (PRESENT(axis_type_)) THEN
+        axis_type__tmp = cxios_is_defined_scalar_axis_type &
+      (scalar_hdl%daddr)
+        axis_type_ = axis_type__tmp
+      ENDIF
+
+      IF (PRESENT(bounds_)) THEN
+        bounds__tmp = cxios_is_defined_scalar_bounds &
+      (scalar_hdl%daddr)
+        bounds_ = bounds__tmp
+      ENDIF
+
+      IF (PRESENT(bounds_name_)) THEN
+        bounds_name__tmp = cxios_is_defined_scalar_bounds_name &
+      (scalar_hdl%daddr)
+        bounds_name_ = bounds_name__tmp
+      ENDIF
+
+      IF (PRESENT(comment_)) THEN
+        comment__tmp = cxios_is_defined_scalar_comment &
+      (scalar_hdl%daddr)
+        comment_ = comment__tmp
+      ENDIF
+
+      IF (PRESENT(label_)) THEN
+        label__tmp = cxios_is_defined_scalar_label &
+      (scalar_hdl%daddr)
+        label_ = label__tmp
+      ENDIF
+
       IF (PRESENT(long_name_)) THEN
         long_name__tmp = cxios_is_defined_scalar_long_name &
@@ -274,4 +451,10 @@
       ENDIF
 
+      IF (PRESENT(positive_)) THEN
+        positive__tmp = cxios_is_defined_scalar_positive &
+      (scalar_hdl%daddr)
+        positive_ = positive__tmp
+      ENDIF
+
       IF (PRESENT(prec_)) THEN
         prec__tmp = cxios_is_defined_scalar_prec &
Index: /XIOS/trunk/src/interface/fortran_attr/iscalargroup_attr.F90
===================================================================
--- /XIOS/trunk/src/interface/fortran_attr/iscalargroup_attr.F90	(revision 1536)
+++ /XIOS/trunk/src/interface/fortran_attr/iscalargroup_attr.F90	(revision 1537)
@@ -12,12 +12,19 @@
 
   SUBROUTINE xios(set_scalargroup_attr)  &
-    ( scalargroup_id, group_ref, long_name, name, prec, scalar_ref, standard_name, unit, value )
+    ( scalargroup_id, axis_type, bounds, bounds_name, comment, group_ref, label, long_name, name  &
+    , positive, prec, scalar_ref, standard_name, unit, value )
 
     IMPLICIT NONE
       TYPE(txios(scalargroup))  :: scalargroup_hdl
       CHARACTER(LEN=*), INTENT(IN) ::scalargroup_id
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: axis_type
+      REAL (KIND=8) , OPTIONAL, INTENT(IN) :: bounds(:)
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: bounds_name
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: comment
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: group_ref
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: label
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: long_name
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: name
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: positive
       INTEGER  , OPTIONAL, INTENT(IN) :: prec
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: scalar_ref
@@ -29,18 +36,24 @@
       (scalargroup_id,scalargroup_hdl)
       CALL xios(set_scalargroup_attr_hdl_)   &
-      ( scalargroup_hdl, group_ref, long_name, name, prec, scalar_ref, standard_name, unit, value  &
-       )
+      ( scalargroup_hdl, axis_type, bounds, bounds_name, comment, group_ref, label, long_name, name  &
+      , positive, prec, scalar_ref, standard_name, unit, value )
 
   END SUBROUTINE xios(set_scalargroup_attr)
 
   SUBROUTINE xios(set_scalargroup_attr_hdl)  &
-    ( scalargroup_hdl, group_ref, long_name, name, prec, scalar_ref, standard_name, unit, value  &
-     )
+    ( scalargroup_hdl, axis_type, bounds, bounds_name, comment, group_ref, label, long_name, name  &
+    , positive, prec, scalar_ref, standard_name, unit, value )
 
     IMPLICIT NONE
       TYPE(txios(scalargroup)) , INTENT(IN) :: scalargroup_hdl
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: axis_type
+      REAL (KIND=8) , OPTIONAL, INTENT(IN) :: bounds(:)
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: bounds_name
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: comment
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: group_ref
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: label
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: long_name
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: name
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: positive
       INTEGER  , OPTIONAL, INTENT(IN) :: prec
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: scalar_ref
@@ -50,18 +63,24 @@
 
       CALL xios(set_scalargroup_attr_hdl_)  &
-      ( scalargroup_hdl, group_ref, long_name, name, prec, scalar_ref, standard_name, unit, value  &
-       )
+      ( scalargroup_hdl, axis_type, bounds, bounds_name, comment, group_ref, label, long_name, name  &
+      , positive, prec, scalar_ref, standard_name, unit, value )
 
   END SUBROUTINE xios(set_scalargroup_attr_hdl)
 
   SUBROUTINE xios(set_scalargroup_attr_hdl_)   &
-    ( scalargroup_hdl, group_ref_, long_name_, name_, prec_, scalar_ref_, standard_name_, unit_  &
-    , value_ )
+    ( scalargroup_hdl, axis_type_, bounds_, bounds_name_, comment_, group_ref_, label_, long_name_  &
+    , name_, positive_, prec_, scalar_ref_, standard_name_, unit_, value_ )
 
     IMPLICIT NONE
       TYPE(txios(scalargroup)) , INTENT(IN) :: scalargroup_hdl
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: axis_type_
+      REAL (KIND=8) , OPTIONAL, INTENT(IN) :: bounds_(:)
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: bounds_name_
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: comment_
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: group_ref_
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: label_
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: long_name_
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: name_
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: positive_
       INTEGER  , OPTIONAL, INTENT(IN) :: prec_
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: scalar_ref_
@@ -70,4 +89,24 @@
       REAL (KIND=8) , OPTIONAL, INTENT(IN) :: value_
 
+      IF (PRESENT(axis_type_)) THEN
+        CALL cxios_set_scalargroup_axis_type &
+      (scalargroup_hdl%daddr, axis_type_, len(axis_type_))
+      ENDIF
+
+      IF (PRESENT(bounds_)) THEN
+        CALL cxios_set_scalargroup_bounds &
+      (scalargroup_hdl%daddr, bounds_, SHAPE(bounds_))
+      ENDIF
+
+      IF (PRESENT(bounds_name_)) THEN
+        CALL cxios_set_scalargroup_bounds_name &
+      (scalargroup_hdl%daddr, bounds_name_, len(bounds_name_))
+      ENDIF
+
+      IF (PRESENT(comment_)) THEN
+        CALL cxios_set_scalargroup_comment &
+      (scalargroup_hdl%daddr, comment_, len(comment_))
+      ENDIF
+
       IF (PRESENT(group_ref_)) THEN
         CALL cxios_set_scalargroup_group_ref &
@@ -75,4 +114,9 @@
       ENDIF
 
+      IF (PRESENT(label_)) THEN
+        CALL cxios_set_scalargroup_label &
+      (scalargroup_hdl%daddr, label_, len(label_))
+      ENDIF
+
       IF (PRESENT(long_name_)) THEN
         CALL cxios_set_scalargroup_long_name &
@@ -85,4 +129,9 @@
       ENDIF
 
+      IF (PRESENT(positive_)) THEN
+        CALL cxios_set_scalargroup_positive &
+      (scalargroup_hdl%daddr, positive_, len(positive_))
+      ENDIF
+
       IF (PRESENT(prec_)) THEN
         CALL cxios_set_scalargroup_prec &
@@ -113,12 +162,19 @@
 
   SUBROUTINE xios(get_scalargroup_attr)  &
-    ( scalargroup_id, group_ref, long_name, name, prec, scalar_ref, standard_name, unit, value )
+    ( scalargroup_id, axis_type, bounds, bounds_name, comment, group_ref, label, long_name, name  &
+    , positive, prec, scalar_ref, standard_name, unit, value )
 
     IMPLICIT NONE
       TYPE(txios(scalargroup))  :: scalargroup_hdl
       CHARACTER(LEN=*), INTENT(IN) ::scalargroup_id
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: axis_type
+      REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: bounds(:)
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: bounds_name
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: comment
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: group_ref
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: label
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: long_name
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: name
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: positive
       INTEGER  , OPTIONAL, INTENT(OUT) :: prec
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: scalar_ref
@@ -130,18 +186,24 @@
       (scalargroup_id,scalargroup_hdl)
       CALL xios(get_scalargroup_attr_hdl_)   &
-      ( scalargroup_hdl, group_ref, long_name, name, prec, scalar_ref, standard_name, unit, value  &
-       )
+      ( scalargroup_hdl, axis_type, bounds, bounds_name, comment, group_ref, label, long_name, name  &
+      , positive, prec, scalar_ref, standard_name, unit, value )
 
   END SUBROUTINE xios(get_scalargroup_attr)
 
   SUBROUTINE xios(get_scalargroup_attr_hdl)  &
-    ( scalargroup_hdl, group_ref, long_name, name, prec, scalar_ref, standard_name, unit, value  &
-     )
+    ( scalargroup_hdl, axis_type, bounds, bounds_name, comment, group_ref, label, long_name, name  &
+    , positive, prec, scalar_ref, standard_name, unit, value )
 
     IMPLICIT NONE
       TYPE(txios(scalargroup)) , INTENT(IN) :: scalargroup_hdl
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: axis_type
+      REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: bounds(:)
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: bounds_name
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: comment
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: group_ref
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: label
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: long_name
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: name
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: positive
       INTEGER  , OPTIONAL, INTENT(OUT) :: prec
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: scalar_ref
@@ -151,18 +213,24 @@
 
       CALL xios(get_scalargroup_attr_hdl_)  &
-      ( scalargroup_hdl, group_ref, long_name, name, prec, scalar_ref, standard_name, unit, value  &
-       )
+      ( scalargroup_hdl, axis_type, bounds, bounds_name, comment, group_ref, label, long_name, name  &
+      , positive, prec, scalar_ref, standard_name, unit, value )
 
   END SUBROUTINE xios(get_scalargroup_attr_hdl)
 
   SUBROUTINE xios(get_scalargroup_attr_hdl_)   &
-    ( scalargroup_hdl, group_ref_, long_name_, name_, prec_, scalar_ref_, standard_name_, unit_  &
-    , value_ )
+    ( scalargroup_hdl, axis_type_, bounds_, bounds_name_, comment_, group_ref_, label_, long_name_  &
+    , name_, positive_, prec_, scalar_ref_, standard_name_, unit_, value_ )
 
     IMPLICIT NONE
       TYPE(txios(scalargroup)) , INTENT(IN) :: scalargroup_hdl
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: axis_type_
+      REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: bounds_(:)
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: bounds_name_
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: comment_
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: group_ref_
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: label_
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: long_name_
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: name_
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: positive_
       INTEGER  , OPTIONAL, INTENT(OUT) :: prec_
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: scalar_ref_
@@ -171,4 +239,24 @@
       REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: value_
 
+      IF (PRESENT(axis_type_)) THEN
+        CALL cxios_get_scalargroup_axis_type &
+      (scalargroup_hdl%daddr, axis_type_, len(axis_type_))
+      ENDIF
+
+      IF (PRESENT(bounds_)) THEN
+        CALL cxios_get_scalargroup_bounds &
+      (scalargroup_hdl%daddr, bounds_, SHAPE(bounds_))
+      ENDIF
+
+      IF (PRESENT(bounds_name_)) THEN
+        CALL cxios_get_scalargroup_bounds_name &
+      (scalargroup_hdl%daddr, bounds_name_, len(bounds_name_))
+      ENDIF
+
+      IF (PRESENT(comment_)) THEN
+        CALL cxios_get_scalargroup_comment &
+      (scalargroup_hdl%daddr, comment_, len(comment_))
+      ENDIF
+
       IF (PRESENT(group_ref_)) THEN
         CALL cxios_get_scalargroup_group_ref &
@@ -176,4 +264,9 @@
       ENDIF
 
+      IF (PRESENT(label_)) THEN
+        CALL cxios_get_scalargroup_label &
+      (scalargroup_hdl%daddr, label_, len(label_))
+      ENDIF
+
       IF (PRESENT(long_name_)) THEN
         CALL cxios_get_scalargroup_long_name &
@@ -186,4 +279,9 @@
       ENDIF
 
+      IF (PRESENT(positive_)) THEN
+        CALL cxios_get_scalargroup_positive &
+      (scalargroup_hdl%daddr, positive_, len(positive_))
+      ENDIF
+
       IF (PRESENT(prec_)) THEN
         CALL cxios_get_scalargroup_prec &
@@ -214,15 +312,28 @@
 
   SUBROUTINE xios(is_defined_scalargroup_attr)  &
-    ( scalargroup_id, group_ref, long_name, name, prec, scalar_ref, standard_name, unit, value )
+    ( scalargroup_id, axis_type, bounds, bounds_name, comment, group_ref, label, long_name, name  &
+    , positive, prec, scalar_ref, standard_name, unit, value )
 
     IMPLICIT NONE
       TYPE(txios(scalargroup))  :: scalargroup_hdl
       CHARACTER(LEN=*), INTENT(IN) ::scalargroup_id
+      LOGICAL, OPTIONAL, INTENT(OUT) :: axis_type
+      LOGICAL(KIND=C_BOOL) :: axis_type_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: bounds
+      LOGICAL(KIND=C_BOOL) :: bounds_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: bounds_name
+      LOGICAL(KIND=C_BOOL) :: bounds_name_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: comment
+      LOGICAL(KIND=C_BOOL) :: comment_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: group_ref
       LOGICAL(KIND=C_BOOL) :: group_ref_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: label
+      LOGICAL(KIND=C_BOOL) :: label_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: long_name
       LOGICAL(KIND=C_BOOL) :: long_name_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: name
       LOGICAL(KIND=C_BOOL) :: name_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: positive
+      LOGICAL(KIND=C_BOOL) :: positive_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: prec
       LOGICAL(KIND=C_BOOL) :: prec_tmp
@@ -239,21 +350,33 @@
       (scalargroup_id,scalargroup_hdl)
       CALL xios(is_defined_scalargroup_attr_hdl_)   &
-      ( scalargroup_hdl, group_ref, long_name, name, prec, scalar_ref, standard_name, unit, value  &
-       )
+      ( scalargroup_hdl, axis_type, bounds, bounds_name, comment, group_ref, label, long_name, name  &
+      , positive, prec, scalar_ref, standard_name, unit, value )
 
   END SUBROUTINE xios(is_defined_scalargroup_attr)
 
   SUBROUTINE xios(is_defined_scalargroup_attr_hdl)  &
-    ( scalargroup_hdl, group_ref, long_name, name, prec, scalar_ref, standard_name, unit, value  &
-     )
+    ( scalargroup_hdl, axis_type, bounds, bounds_name, comment, group_ref, label, long_name, name  &
+    , positive, prec, scalar_ref, standard_name, unit, value )
 
     IMPLICIT NONE
       TYPE(txios(scalargroup)) , INTENT(IN) :: scalargroup_hdl
+      LOGICAL, OPTIONAL, INTENT(OUT) :: axis_type
+      LOGICAL(KIND=C_BOOL) :: axis_type_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: bounds
+      LOGICAL(KIND=C_BOOL) :: bounds_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: bounds_name
+      LOGICAL(KIND=C_BOOL) :: bounds_name_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: comment
+      LOGICAL(KIND=C_BOOL) :: comment_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: group_ref
       LOGICAL(KIND=C_BOOL) :: group_ref_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: label
+      LOGICAL(KIND=C_BOOL) :: label_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: long_name
       LOGICAL(KIND=C_BOOL) :: long_name_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: name
       LOGICAL(KIND=C_BOOL) :: name_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: positive
+      LOGICAL(KIND=C_BOOL) :: positive_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: prec
       LOGICAL(KIND=C_BOOL) :: prec_tmp
@@ -268,21 +391,33 @@
 
       CALL xios(is_defined_scalargroup_attr_hdl_)  &
-      ( scalargroup_hdl, group_ref, long_name, name, prec, scalar_ref, standard_name, unit, value  &
-       )
+      ( scalargroup_hdl, axis_type, bounds, bounds_name, comment, group_ref, label, long_name, name  &
+      , positive, prec, scalar_ref, standard_name, unit, value )
 
   END SUBROUTINE xios(is_defined_scalargroup_attr_hdl)
 
   SUBROUTINE xios(is_defined_scalargroup_attr_hdl_)   &
-    ( scalargroup_hdl, group_ref_, long_name_, name_, prec_, scalar_ref_, standard_name_, unit_  &
-    , value_ )
+    ( scalargroup_hdl, axis_type_, bounds_, bounds_name_, comment_, group_ref_, label_, long_name_  &
+    , name_, positive_, prec_, scalar_ref_, standard_name_, unit_, value_ )
 
     IMPLICIT NONE
       TYPE(txios(scalargroup)) , INTENT(IN) :: scalargroup_hdl
+      LOGICAL, OPTIONAL, INTENT(OUT) :: axis_type_
+      LOGICAL(KIND=C_BOOL) :: axis_type__tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: bounds_
+      LOGICAL(KIND=C_BOOL) :: bounds__tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: bounds_name_
+      LOGICAL(KIND=C_BOOL) :: bounds_name__tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: comment_
+      LOGICAL(KIND=C_BOOL) :: comment__tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: group_ref_
       LOGICAL(KIND=C_BOOL) :: group_ref__tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: label_
+      LOGICAL(KIND=C_BOOL) :: label__tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: long_name_
       LOGICAL(KIND=C_BOOL) :: long_name__tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: name_
       LOGICAL(KIND=C_BOOL) :: name__tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: positive_
+      LOGICAL(KIND=C_BOOL) :: positive__tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: prec_
       LOGICAL(KIND=C_BOOL) :: prec__tmp
@@ -296,4 +431,28 @@
       LOGICAL(KIND=C_BOOL) :: value__tmp
 
+      IF (PRESENT(axis_type_)) THEN
+        axis_type__tmp = cxios_is_defined_scalargroup_axis_type &
+      (scalargroup_hdl%daddr)
+        axis_type_ = axis_type__tmp
+      ENDIF
+
+      IF (PRESENT(bounds_)) THEN
+        bounds__tmp = cxios_is_defined_scalargroup_bounds &
+      (scalargroup_hdl%daddr)
+        bounds_ = bounds__tmp
+      ENDIF
+
+      IF (PRESENT(bounds_name_)) THEN
+        bounds_name__tmp = cxios_is_defined_scalargroup_bounds_name &
+      (scalargroup_hdl%daddr)
+        bounds_name_ = bounds_name__tmp
+      ENDIF
+
+      IF (PRESENT(comment_)) THEN
+        comment__tmp = cxios_is_defined_scalargroup_comment &
+      (scalargroup_hdl%daddr)
+        comment_ = comment__tmp
+      ENDIF
+
       IF (PRESENT(group_ref_)) THEN
         group_ref__tmp = cxios_is_defined_scalargroup_group_ref &
@@ -302,4 +461,10 @@
       ENDIF
 
+      IF (PRESENT(label_)) THEN
+        label__tmp = cxios_is_defined_scalargroup_label &
+      (scalargroup_hdl%daddr)
+        label_ = label__tmp
+      ENDIF
+
       IF (PRESENT(long_name_)) THEN
         long_name__tmp = cxios_is_defined_scalargroup_long_name &
@@ -314,4 +479,10 @@
       ENDIF
 
+      IF (PRESENT(positive_)) THEN
+        positive__tmp = cxios_is_defined_scalargroup_positive &
+      (scalargroup_hdl%daddr)
+        positive_ = positive__tmp
+      ENDIF
+
       IF (PRESENT(prec_)) THEN
         prec__tmp = cxios_is_defined_scalargroup_prec &
Index: /XIOS/trunk/src/interface/fortran_attr/itemporal_splitting_attr.F90
===================================================================
--- /XIOS/trunk/src/interface/fortran_attr/itemporal_splitting_attr.F90	(revision 1537)
+++ /XIOS/trunk/src/interface/fortran_attr/itemporal_splitting_attr.F90	(revision 1537)
@@ -0,0 +1,112 @@
+! * ************************************************************************** *
+! *               Interface auto generated - do not modify                     *
+! * ************************************************************************** *
+#include "xios_fortran_prefix.hpp"
+
+MODULE itemporal_splitting_attr
+  USE, INTRINSIC :: ISO_C_BINDING
+  USE itemporal_splitting
+  USE temporal_splitting_interface_attr
+
+CONTAINS
+
+  SUBROUTINE xios(set_temporal_splitting_attr)  &
+    ( temporal_splitting_id )
+
+    IMPLICIT NONE
+      TYPE(txios(temporal_splitting))  :: temporal_splitting_hdl
+      CHARACTER(LEN=*), INTENT(IN) ::temporal_splitting_id
+
+      CALL xios(get_temporal_splitting_handle) &
+      (temporal_splitting_id,temporal_splitting_hdl)
+      CALL xios(set_temporal_splitting_attr_hdl_)   &
+      ( temporal_splitting_hdl )
+
+  END SUBROUTINE xios(set_temporal_splitting_attr)
+
+  SUBROUTINE xios(set_temporal_splitting_attr_hdl)  &
+    ( temporal_splitting_hdl )
+
+    IMPLICIT NONE
+      TYPE(txios(temporal_splitting)) , INTENT(IN) :: temporal_splitting_hdl
+
+      CALL xios(set_temporal_splitting_attr_hdl_)  &
+      ( temporal_splitting_hdl )
+
+  END SUBROUTINE xios(set_temporal_splitting_attr_hdl)
+
+  SUBROUTINE xios(set_temporal_splitting_attr_hdl_)   &
+    ( temporal_splitting_hdl )
+
+    IMPLICIT NONE
+      TYPE(txios(temporal_splitting)) , INTENT(IN) :: temporal_splitting_hdl
+
+  END SUBROUTINE xios(set_temporal_splitting_attr_hdl_)
+
+  SUBROUTINE xios(get_temporal_splitting_attr)  &
+    ( temporal_splitting_id )
+
+    IMPLICIT NONE
+      TYPE(txios(temporal_splitting))  :: temporal_splitting_hdl
+      CHARACTER(LEN=*), INTENT(IN) ::temporal_splitting_id
+
+      CALL xios(get_temporal_splitting_handle) &
+      (temporal_splitting_id,temporal_splitting_hdl)
+      CALL xios(get_temporal_splitting_attr_hdl_)   &
+      ( temporal_splitting_hdl )
+
+  END SUBROUTINE xios(get_temporal_splitting_attr)
+
+  SUBROUTINE xios(get_temporal_splitting_attr_hdl)  &
+    ( temporal_splitting_hdl )
+
+    IMPLICIT NONE
+      TYPE(txios(temporal_splitting)) , INTENT(IN) :: temporal_splitting_hdl
+
+      CALL xios(get_temporal_splitting_attr_hdl_)  &
+      ( temporal_splitting_hdl )
+
+  END SUBROUTINE xios(get_temporal_splitting_attr_hdl)
+
+  SUBROUTINE xios(get_temporal_splitting_attr_hdl_)   &
+    ( temporal_splitting_hdl )
+
+    IMPLICIT NONE
+      TYPE(txios(temporal_splitting)) , INTENT(IN) :: temporal_splitting_hdl
+
+  END SUBROUTINE xios(get_temporal_splitting_attr_hdl_)
+
+  SUBROUTINE xios(is_defined_temporal_splitting_attr)  &
+    ( temporal_splitting_id )
+
+    IMPLICIT NONE
+      TYPE(txios(temporal_splitting))  :: temporal_splitting_hdl
+      CHARACTER(LEN=*), INTENT(IN) ::temporal_splitting_id
+
+      CALL xios(get_temporal_splitting_handle) &
+      (temporal_splitting_id,temporal_splitting_hdl)
+      CALL xios(is_defined_temporal_splitting_attr_hdl_)   &
+      ( temporal_splitting_hdl )
+
+  END SUBROUTINE xios(is_defined_temporal_splitting_attr)
+
+  SUBROUTINE xios(is_defined_temporal_splitting_attr_hdl)  &
+    ( temporal_splitting_hdl )
+
+    IMPLICIT NONE
+      TYPE(txios(temporal_splitting)) , INTENT(IN) :: temporal_splitting_hdl
+
+      CALL xios(is_defined_temporal_splitting_attr_hdl_)  &
+      ( temporal_splitting_hdl )
+
+  END SUBROUTINE xios(is_defined_temporal_splitting_attr_hdl)
+
+  SUBROUTINE xios(is_defined_temporal_splitting_attr_hdl_)   &
+    ( temporal_splitting_hdl )
+
+    IMPLICIT NONE
+      TYPE(txios(temporal_splitting)) , INTENT(IN) :: temporal_splitting_hdl
+
+  END SUBROUTINE xios(is_defined_temporal_splitting_attr_hdl_)
+
+END MODULE itemporal_splitting_attr
Index: /XIOS/trunk/src/interface/fortran_attr/reduce_axis_to_axis_interface_attr.F90
===================================================================
--- /XIOS/trunk/src/interface/fortran_attr/reduce_axis_to_axis_interface_attr.F90	(revision 1537)
+++ /XIOS/trunk/src/interface/fortran_attr/reduce_axis_to_axis_interface_attr.F90	(revision 1537)
@@ -0,0 +1,34 @@
+! * ************************************************************************** *
+! *               Interface auto generated - do not modify                     *
+! * ************************************************************************** *
+#include "../fortran/xios_fortran_prefix.hpp"
+
+MODULE reduce_axis_to_axis_interface_attr
+  USE, INTRINSIC :: ISO_C_BINDING
+
+  INTERFACE
+    ! Do not call directly / interface FORTRAN 2003 <-> C99
+
+    SUBROUTINE cxios_set_reduce_axis_to_axis_operation(reduce_axis_to_axis_hdl, operation, operation_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: reduce_axis_to_axis_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: operation
+      INTEGER  (kind = C_INT)     , VALUE        :: operation_size
+    END SUBROUTINE cxios_set_reduce_axis_to_axis_operation
+
+    SUBROUTINE cxios_get_reduce_axis_to_axis_operation(reduce_axis_to_axis_hdl, operation, operation_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: reduce_axis_to_axis_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: operation
+      INTEGER  (kind = C_INT)     , VALUE        :: operation_size
+    END SUBROUTINE cxios_get_reduce_axis_to_axis_operation
+
+    FUNCTION cxios_is_defined_reduce_axis_to_axis_operation(reduce_axis_to_axis_hdl) BIND(C)
+      USE ISO_C_BINDING
+      LOGICAL(kind=C_BOOL) :: cxios_is_defined_reduce_axis_to_axis_operation
+      INTEGER (kind = C_INTPTR_T), VALUE :: reduce_axis_to_axis_hdl
+    END FUNCTION cxios_is_defined_reduce_axis_to_axis_operation
+
+  END INTERFACE
+
+END MODULE reduce_axis_to_axis_interface_attr
Index: /XIOS/trunk/src/interface/fortran_attr/reduce_domain_to_axis_interface_attr.F90
===================================================================
--- /XIOS/trunk/src/interface/fortran_attr/reduce_domain_to_axis_interface_attr.F90	(revision 1536)
+++ /XIOS/trunk/src/interface/fortran_attr/reduce_domain_to_axis_interface_attr.F90	(revision 1537)
@@ -31,4 +31,23 @@
 
 
+    SUBROUTINE cxios_set_reduce_domain_to_axis_local(reduce_domain_to_axis_hdl, local) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: reduce_domain_to_axis_hdl
+      LOGICAL (KIND=C_BOOL)      , VALUE :: local
+    END SUBROUTINE cxios_set_reduce_domain_to_axis_local
+
+    SUBROUTINE cxios_get_reduce_domain_to_axis_local(reduce_domain_to_axis_hdl, local) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: reduce_domain_to_axis_hdl
+      LOGICAL (KIND=C_BOOL)             :: local
+    END SUBROUTINE cxios_get_reduce_domain_to_axis_local
+
+    FUNCTION cxios_is_defined_reduce_domain_to_axis_local(reduce_domain_to_axis_hdl) BIND(C)
+      USE ISO_C_BINDING
+      LOGICAL(kind=C_BOOL) :: cxios_is_defined_reduce_domain_to_axis_local
+      INTEGER (kind = C_INTPTR_T), VALUE :: reduce_domain_to_axis_hdl
+    END FUNCTION cxios_is_defined_reduce_domain_to_axis_local
+
+
     SUBROUTINE cxios_set_reduce_domain_to_axis_operation(reduce_domain_to_axis_hdl, operation, operation_size) BIND(C)
       USE ISO_C_BINDING
Index: /XIOS/trunk/src/interface/fortran_attr/reduce_domain_to_scalar_interface_attr.F90
===================================================================
--- /XIOS/trunk/src/interface/fortran_attr/reduce_domain_to_scalar_interface_attr.F90	(revision 1536)
+++ /XIOS/trunk/src/interface/fortran_attr/reduce_domain_to_scalar_interface_attr.F90	(revision 1537)
@@ -9,4 +9,23 @@
   INTERFACE
     ! Do not call directly / interface FORTRAN 2003 <-> C99
+
+    SUBROUTINE cxios_set_reduce_domain_to_scalar_local(reduce_domain_to_scalar_hdl, local) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: reduce_domain_to_scalar_hdl
+      LOGICAL (KIND=C_BOOL)      , VALUE :: local
+    END SUBROUTINE cxios_set_reduce_domain_to_scalar_local
+
+    SUBROUTINE cxios_get_reduce_domain_to_scalar_local(reduce_domain_to_scalar_hdl, local) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: reduce_domain_to_scalar_hdl
+      LOGICAL (KIND=C_BOOL)             :: local
+    END SUBROUTINE cxios_get_reduce_domain_to_scalar_local
+
+    FUNCTION cxios_is_defined_reduce_domain_to_scalar_local(reduce_domain_to_scalar_hdl) BIND(C)
+      USE ISO_C_BINDING
+      LOGICAL(kind=C_BOOL) :: cxios_is_defined_reduce_domain_to_scalar_local
+      INTEGER (kind = C_INTPTR_T), VALUE :: reduce_domain_to_scalar_hdl
+    END FUNCTION cxios_is_defined_reduce_domain_to_scalar_local
+
 
     SUBROUTINE cxios_set_reduce_domain_to_scalar_operation(reduce_domain_to_scalar_hdl, operation, operation_size) BIND(C)
Index: /XIOS/trunk/src/interface/fortran_attr/reduce_scalar_to_scalar_interface_attr.F90
===================================================================
--- /XIOS/trunk/src/interface/fortran_attr/reduce_scalar_to_scalar_interface_attr.F90	(revision 1537)
+++ /XIOS/trunk/src/interface/fortran_attr/reduce_scalar_to_scalar_interface_attr.F90	(revision 1537)
@@ -0,0 +1,34 @@
+! * ************************************************************************** *
+! *               Interface auto generated - do not modify                     *
+! * ************************************************************************** *
+#include "../fortran/xios_fortran_prefix.hpp"
+
+MODULE reduce_scalar_to_scalar_interface_attr
+  USE, INTRINSIC :: ISO_C_BINDING
+
+  INTERFACE
+    ! Do not call directly / interface FORTRAN 2003 <-> C99
+
+    SUBROUTINE cxios_set_reduce_scalar_to_scalar_operation(reduce_scalar_to_scalar_hdl, operation, operation_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: reduce_scalar_to_scalar_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: operation
+      INTEGER  (kind = C_INT)     , VALUE        :: operation_size
+    END SUBROUTINE cxios_set_reduce_scalar_to_scalar_operation
+
+    SUBROUTINE cxios_get_reduce_scalar_to_scalar_operation(reduce_scalar_to_scalar_hdl, operation, operation_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: reduce_scalar_to_scalar_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: operation
+      INTEGER  (kind = C_INT)     , VALUE        :: operation_size
+    END SUBROUTINE cxios_get_reduce_scalar_to_scalar_operation
+
+    FUNCTION cxios_is_defined_reduce_scalar_to_scalar_operation(reduce_scalar_to_scalar_hdl) BIND(C)
+      USE ISO_C_BINDING
+      LOGICAL(kind=C_BOOL) :: cxios_is_defined_reduce_scalar_to_scalar_operation
+      INTEGER (kind = C_INTPTR_T), VALUE :: reduce_scalar_to_scalar_hdl
+    END FUNCTION cxios_is_defined_reduce_scalar_to_scalar_operation
+
+  END INTERFACE
+
+END MODULE reduce_scalar_to_scalar_interface_attr
Index: /XIOS/trunk/src/interface/fortran_attr/reorder_domain_interface_attr.F90
===================================================================
--- /XIOS/trunk/src/interface/fortran_attr/reorder_domain_interface_attr.F90	(revision 1537)
+++ /XIOS/trunk/src/interface/fortran_attr/reorder_domain_interface_attr.F90	(revision 1537)
@@ -0,0 +1,89 @@
+! * ************************************************************************** *
+! *               Interface auto generated - do not modify                     *
+! * ************************************************************************** *
+#include "../fortran/xios_fortran_prefix.hpp"
+
+MODULE reorder_domain_interface_attr
+  USE, INTRINSIC :: ISO_C_BINDING
+
+  INTERFACE
+    ! Do not call directly / interface FORTRAN 2003 <-> C99
+
+    SUBROUTINE cxios_set_reorder_domain_invert_lat(reorder_domain_hdl, invert_lat) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: reorder_domain_hdl
+      LOGICAL (KIND=C_BOOL)      , VALUE :: invert_lat
+    END SUBROUTINE cxios_set_reorder_domain_invert_lat
+
+    SUBROUTINE cxios_get_reorder_domain_invert_lat(reorder_domain_hdl, invert_lat) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: reorder_domain_hdl
+      LOGICAL (KIND=C_BOOL)             :: invert_lat
+    END SUBROUTINE cxios_get_reorder_domain_invert_lat
+
+    FUNCTION cxios_is_defined_reorder_domain_invert_lat(reorder_domain_hdl) BIND(C)
+      USE ISO_C_BINDING
+      LOGICAL(kind=C_BOOL) :: cxios_is_defined_reorder_domain_invert_lat
+      INTEGER (kind = C_INTPTR_T), VALUE :: reorder_domain_hdl
+    END FUNCTION cxios_is_defined_reorder_domain_invert_lat
+
+
+    SUBROUTINE cxios_set_reorder_domain_max_lon(reorder_domain_hdl, max_lon) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: reorder_domain_hdl
+      REAL (KIND=C_DOUBLE)      , VALUE :: max_lon
+    END SUBROUTINE cxios_set_reorder_domain_max_lon
+
+    SUBROUTINE cxios_get_reorder_domain_max_lon(reorder_domain_hdl, max_lon) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: reorder_domain_hdl
+      REAL (KIND=C_DOUBLE)             :: max_lon
+    END SUBROUTINE cxios_get_reorder_domain_max_lon
+
+    FUNCTION cxios_is_defined_reorder_domain_max_lon(reorder_domain_hdl) BIND(C)
+      USE ISO_C_BINDING
+      LOGICAL(kind=C_BOOL) :: cxios_is_defined_reorder_domain_max_lon
+      INTEGER (kind = C_INTPTR_T), VALUE :: reorder_domain_hdl
+    END FUNCTION cxios_is_defined_reorder_domain_max_lon
+
+
+    SUBROUTINE cxios_set_reorder_domain_min_lon(reorder_domain_hdl, min_lon) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: reorder_domain_hdl
+      REAL (KIND=C_DOUBLE)      , VALUE :: min_lon
+    END SUBROUTINE cxios_set_reorder_domain_min_lon
+
+    SUBROUTINE cxios_get_reorder_domain_min_lon(reorder_domain_hdl, min_lon) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: reorder_domain_hdl
+      REAL (KIND=C_DOUBLE)             :: min_lon
+    END SUBROUTINE cxios_get_reorder_domain_min_lon
+
+    FUNCTION cxios_is_defined_reorder_domain_min_lon(reorder_domain_hdl) BIND(C)
+      USE ISO_C_BINDING
+      LOGICAL(kind=C_BOOL) :: cxios_is_defined_reorder_domain_min_lon
+      INTEGER (kind = C_INTPTR_T), VALUE :: reorder_domain_hdl
+    END FUNCTION cxios_is_defined_reorder_domain_min_lon
+
+
+    SUBROUTINE cxios_set_reorder_domain_shift_lon_fraction(reorder_domain_hdl, shift_lon_fraction) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: reorder_domain_hdl
+      REAL (KIND=C_DOUBLE)      , VALUE :: shift_lon_fraction
+    END SUBROUTINE cxios_set_reorder_domain_shift_lon_fraction
+
+    SUBROUTINE cxios_get_reorder_domain_shift_lon_fraction(reorder_domain_hdl, shift_lon_fraction) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: reorder_domain_hdl
+      REAL (KIND=C_DOUBLE)             :: shift_lon_fraction
+    END SUBROUTINE cxios_get_reorder_domain_shift_lon_fraction
+
+    FUNCTION cxios_is_defined_reorder_domain_shift_lon_fraction(reorder_domain_hdl) BIND(C)
+      USE ISO_C_BINDING
+      LOGICAL(kind=C_BOOL) :: cxios_is_defined_reorder_domain_shift_lon_fraction
+      INTEGER (kind = C_INTPTR_T), VALUE :: reorder_domain_hdl
+    END FUNCTION cxios_is_defined_reorder_domain_shift_lon_fraction
+
+  END INTERFACE
+
+END MODULE reorder_domain_interface_attr
Index: /XIOS/trunk/src/interface/fortran_attr/scalar_interface_attr.F90
===================================================================
--- /XIOS/trunk/src/interface/fortran_attr/scalar_interface_attr.F90	(revision 1536)
+++ /XIOS/trunk/src/interface/fortran_attr/scalar_interface_attr.F90	(revision 1537)
@@ -10,4 +10,109 @@
     ! Do not call directly / interface FORTRAN 2003 <-> C99
 
+    SUBROUTINE cxios_set_scalar_axis_type(scalar_hdl, axis_type, axis_type_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: scalar_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: axis_type
+      INTEGER  (kind = C_INT)     , VALUE        :: axis_type_size
+    END SUBROUTINE cxios_set_scalar_axis_type
+
+    SUBROUTINE cxios_get_scalar_axis_type(scalar_hdl, axis_type, axis_type_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: scalar_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: axis_type
+      INTEGER  (kind = C_INT)     , VALUE        :: axis_type_size
+    END SUBROUTINE cxios_get_scalar_axis_type
+
+    FUNCTION cxios_is_defined_scalar_axis_type(scalar_hdl) BIND(C)
+      USE ISO_C_BINDING
+      LOGICAL(kind=C_BOOL) :: cxios_is_defined_scalar_axis_type
+      INTEGER (kind = C_INTPTR_T), VALUE :: scalar_hdl
+    END FUNCTION cxios_is_defined_scalar_axis_type
+
+
+    SUBROUTINE cxios_set_scalar_bounds(scalar_hdl, bounds, extent) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE       :: scalar_hdl
+      REAL (KIND=C_DOUBLE)     , DIMENSION(*) :: bounds
+      INTEGER (kind = C_INT), DIMENSION(*)     :: extent
+    END SUBROUTINE cxios_set_scalar_bounds
+
+    SUBROUTINE cxios_get_scalar_bounds(scalar_hdl, bounds, extent) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE       :: scalar_hdl
+      REAL (KIND=C_DOUBLE)     , DIMENSION(*) :: bounds
+      INTEGER (kind = C_INT), DIMENSION(*)     :: extent
+    END SUBROUTINE cxios_get_scalar_bounds
+
+    FUNCTION cxios_is_defined_scalar_bounds(scalar_hdl) BIND(C)
+      USE ISO_C_BINDING
+      LOGICAL(kind=C_BOOL) :: cxios_is_defined_scalar_bounds
+      INTEGER (kind = C_INTPTR_T), VALUE :: scalar_hdl
+    END FUNCTION cxios_is_defined_scalar_bounds
+
+
+    SUBROUTINE cxios_set_scalar_bounds_name(scalar_hdl, bounds_name, bounds_name_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: scalar_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: bounds_name
+      INTEGER  (kind = C_INT)     , VALUE        :: bounds_name_size
+    END SUBROUTINE cxios_set_scalar_bounds_name
+
+    SUBROUTINE cxios_get_scalar_bounds_name(scalar_hdl, bounds_name, bounds_name_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: scalar_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: bounds_name
+      INTEGER  (kind = C_INT)     , VALUE        :: bounds_name_size
+    END SUBROUTINE cxios_get_scalar_bounds_name
+
+    FUNCTION cxios_is_defined_scalar_bounds_name(scalar_hdl) BIND(C)
+      USE ISO_C_BINDING
+      LOGICAL(kind=C_BOOL) :: cxios_is_defined_scalar_bounds_name
+      INTEGER (kind = C_INTPTR_T), VALUE :: scalar_hdl
+    END FUNCTION cxios_is_defined_scalar_bounds_name
+
+
+    SUBROUTINE cxios_set_scalar_comment(scalar_hdl, comment, comment_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: scalar_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: comment
+      INTEGER  (kind = C_INT)     , VALUE        :: comment_size
+    END SUBROUTINE cxios_set_scalar_comment
+
+    SUBROUTINE cxios_get_scalar_comment(scalar_hdl, comment, comment_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: scalar_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: comment
+      INTEGER  (kind = C_INT)     , VALUE        :: comment_size
+    END SUBROUTINE cxios_get_scalar_comment
+
+    FUNCTION cxios_is_defined_scalar_comment(scalar_hdl) BIND(C)
+      USE ISO_C_BINDING
+      LOGICAL(kind=C_BOOL) :: cxios_is_defined_scalar_comment
+      INTEGER (kind = C_INTPTR_T), VALUE :: scalar_hdl
+    END FUNCTION cxios_is_defined_scalar_comment
+
+
+    SUBROUTINE cxios_set_scalar_label(scalar_hdl, label, label_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: scalar_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: label
+      INTEGER  (kind = C_INT)     , VALUE        :: label_size
+    END SUBROUTINE cxios_set_scalar_label
+
+    SUBROUTINE cxios_get_scalar_label(scalar_hdl, label, label_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: scalar_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: label
+      INTEGER  (kind = C_INT)     , VALUE        :: label_size
+    END SUBROUTINE cxios_get_scalar_label
+
+    FUNCTION cxios_is_defined_scalar_label(scalar_hdl) BIND(C)
+      USE ISO_C_BINDING
+      LOGICAL(kind=C_BOOL) :: cxios_is_defined_scalar_label
+      INTEGER (kind = C_INTPTR_T), VALUE :: scalar_hdl
+    END FUNCTION cxios_is_defined_scalar_label
+
+
     SUBROUTINE cxios_set_scalar_long_name(scalar_hdl, long_name, long_name_size) BIND(C)
       USE ISO_C_BINDING
@@ -52,4 +157,25 @@
 
 
+    SUBROUTINE cxios_set_scalar_positive(scalar_hdl, positive, positive_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: scalar_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: positive
+      INTEGER  (kind = C_INT)     , VALUE        :: positive_size
+    END SUBROUTINE cxios_set_scalar_positive
+
+    SUBROUTINE cxios_get_scalar_positive(scalar_hdl, positive, positive_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: scalar_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: positive
+      INTEGER  (kind = C_INT)     , VALUE        :: positive_size
+    END SUBROUTINE cxios_get_scalar_positive
+
+    FUNCTION cxios_is_defined_scalar_positive(scalar_hdl) BIND(C)
+      USE ISO_C_BINDING
+      LOGICAL(kind=C_BOOL) :: cxios_is_defined_scalar_positive
+      INTEGER (kind = C_INTPTR_T), VALUE :: scalar_hdl
+    END FUNCTION cxios_is_defined_scalar_positive
+
+
     SUBROUTINE cxios_set_scalar_prec(scalar_hdl, prec) BIND(C)
       USE ISO_C_BINDING
Index: /XIOS/trunk/src/interface/fortran_attr/scalargroup_interface_attr.F90
===================================================================
--- /XIOS/trunk/src/interface/fortran_attr/scalargroup_interface_attr.F90	(revision 1536)
+++ /XIOS/trunk/src/interface/fortran_attr/scalargroup_interface_attr.F90	(revision 1537)
@@ -10,4 +10,88 @@
     ! Do not call directly / interface FORTRAN 2003 <-> C99
 
+    SUBROUTINE cxios_set_scalargroup_axis_type(scalargroup_hdl, axis_type, axis_type_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: scalargroup_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: axis_type
+      INTEGER  (kind = C_INT)     , VALUE        :: axis_type_size
+    END SUBROUTINE cxios_set_scalargroup_axis_type
+
+    SUBROUTINE cxios_get_scalargroup_axis_type(scalargroup_hdl, axis_type, axis_type_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: scalargroup_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: axis_type
+      INTEGER  (kind = C_INT)     , VALUE        :: axis_type_size
+    END SUBROUTINE cxios_get_scalargroup_axis_type
+
+    FUNCTION cxios_is_defined_scalargroup_axis_type(scalargroup_hdl) BIND(C)
+      USE ISO_C_BINDING
+      LOGICAL(kind=C_BOOL) :: cxios_is_defined_scalargroup_axis_type
+      INTEGER (kind = C_INTPTR_T), VALUE :: scalargroup_hdl
+    END FUNCTION cxios_is_defined_scalargroup_axis_type
+
+
+    SUBROUTINE cxios_set_scalargroup_bounds(scalargroup_hdl, bounds, extent) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE       :: scalargroup_hdl
+      REAL (KIND=C_DOUBLE)     , DIMENSION(*) :: bounds
+      INTEGER (kind = C_INT), DIMENSION(*)     :: extent
+    END SUBROUTINE cxios_set_scalargroup_bounds
+
+    SUBROUTINE cxios_get_scalargroup_bounds(scalargroup_hdl, bounds, extent) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE       :: scalargroup_hdl
+      REAL (KIND=C_DOUBLE)     , DIMENSION(*) :: bounds
+      INTEGER (kind = C_INT), DIMENSION(*)     :: extent
+    END SUBROUTINE cxios_get_scalargroup_bounds
+
+    FUNCTION cxios_is_defined_scalargroup_bounds(scalargroup_hdl) BIND(C)
+      USE ISO_C_BINDING
+      LOGICAL(kind=C_BOOL) :: cxios_is_defined_scalargroup_bounds
+      INTEGER (kind = C_INTPTR_T), VALUE :: scalargroup_hdl
+    END FUNCTION cxios_is_defined_scalargroup_bounds
+
+
+    SUBROUTINE cxios_set_scalargroup_bounds_name(scalargroup_hdl, bounds_name, bounds_name_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: scalargroup_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: bounds_name
+      INTEGER  (kind = C_INT)     , VALUE        :: bounds_name_size
+    END SUBROUTINE cxios_set_scalargroup_bounds_name
+
+    SUBROUTINE cxios_get_scalargroup_bounds_name(scalargroup_hdl, bounds_name, bounds_name_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: scalargroup_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: bounds_name
+      INTEGER  (kind = C_INT)     , VALUE        :: bounds_name_size
+    END SUBROUTINE cxios_get_scalargroup_bounds_name
+
+    FUNCTION cxios_is_defined_scalargroup_bounds_name(scalargroup_hdl) BIND(C)
+      USE ISO_C_BINDING
+      LOGICAL(kind=C_BOOL) :: cxios_is_defined_scalargroup_bounds_name
+      INTEGER (kind = C_INTPTR_T), VALUE :: scalargroup_hdl
+    END FUNCTION cxios_is_defined_scalargroup_bounds_name
+
+
+    SUBROUTINE cxios_set_scalargroup_comment(scalargroup_hdl, comment, comment_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: scalargroup_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: comment
+      INTEGER  (kind = C_INT)     , VALUE        :: comment_size
+    END SUBROUTINE cxios_set_scalargroup_comment
+
+    SUBROUTINE cxios_get_scalargroup_comment(scalargroup_hdl, comment, comment_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: scalargroup_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: comment
+      INTEGER  (kind = C_INT)     , VALUE        :: comment_size
+    END SUBROUTINE cxios_get_scalargroup_comment
+
+    FUNCTION cxios_is_defined_scalargroup_comment(scalargroup_hdl) BIND(C)
+      USE ISO_C_BINDING
+      LOGICAL(kind=C_BOOL) :: cxios_is_defined_scalargroup_comment
+      INTEGER (kind = C_INTPTR_T), VALUE :: scalargroup_hdl
+    END FUNCTION cxios_is_defined_scalargroup_comment
+
+
     SUBROUTINE cxios_set_scalargroup_group_ref(scalargroup_hdl, group_ref, group_ref_size) BIND(C)
       USE ISO_C_BINDING
@@ -31,4 +115,25 @@
 
 
+    SUBROUTINE cxios_set_scalargroup_label(scalargroup_hdl, label, label_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: scalargroup_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: label
+      INTEGER  (kind = C_INT)     , VALUE        :: label_size
+    END SUBROUTINE cxios_set_scalargroup_label
+
+    SUBROUTINE cxios_get_scalargroup_label(scalargroup_hdl, label, label_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: scalargroup_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: label
+      INTEGER  (kind = C_INT)     , VALUE        :: label_size
+    END SUBROUTINE cxios_get_scalargroup_label
+
+    FUNCTION cxios_is_defined_scalargroup_label(scalargroup_hdl) BIND(C)
+      USE ISO_C_BINDING
+      LOGICAL(kind=C_BOOL) :: cxios_is_defined_scalargroup_label
+      INTEGER (kind = C_INTPTR_T), VALUE :: scalargroup_hdl
+    END FUNCTION cxios_is_defined_scalargroup_label
+
+
     SUBROUTINE cxios_set_scalargroup_long_name(scalargroup_hdl, long_name, long_name_size) BIND(C)
       USE ISO_C_BINDING
@@ -73,4 +178,25 @@
 
 
+    SUBROUTINE cxios_set_scalargroup_positive(scalargroup_hdl, positive, positive_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: scalargroup_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: positive
+      INTEGER  (kind = C_INT)     , VALUE        :: positive_size
+    END SUBROUTINE cxios_set_scalargroup_positive
+
+    SUBROUTINE cxios_get_scalargroup_positive(scalargroup_hdl, positive, positive_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: scalargroup_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: positive
+      INTEGER  (kind = C_INT)     , VALUE        :: positive_size
+    END SUBROUTINE cxios_get_scalargroup_positive
+
+    FUNCTION cxios_is_defined_scalargroup_positive(scalargroup_hdl) BIND(C)
+      USE ISO_C_BINDING
+      LOGICAL(kind=C_BOOL) :: cxios_is_defined_scalargroup_positive
+      INTEGER (kind = C_INTPTR_T), VALUE :: scalargroup_hdl
+    END FUNCTION cxios_is_defined_scalargroup_positive
+
+
     SUBROUTINE cxios_set_scalargroup_prec(scalargroup_hdl, prec) BIND(C)
       USE ISO_C_BINDING
Index: /XIOS/trunk/src/interface/fortran_attr/temporal_splitting_interface_attr.F90
===================================================================
--- /XIOS/trunk/src/interface/fortran_attr/temporal_splitting_interface_attr.F90	(revision 1537)
+++ /XIOS/trunk/src/interface/fortran_attr/temporal_splitting_interface_attr.F90	(revision 1537)
@@ -0,0 +1,13 @@
+! * ************************************************************************** *
+! *               Interface auto generated - do not modify                     *
+! * ************************************************************************** *
+#include "../fortran/xios_fortran_prefix.hpp"
+
+MODULE temporal_splitting_interface_attr
+  USE, INTRINSIC :: ISO_C_BINDING
+
+  INTERFACE
+    ! Do not call directly / interface FORTRAN 2003 <-> C99
+  END INTERFACE
+
+END MODULE temporal_splitting_interface_attr
Index: /XIOS/trunk/src/io/inetcdf4.cpp
===================================================================
--- /XIOS/trunk/src/io/inetcdf4.cpp	(revision 1536)
+++ /XIOS/trunk/src/io/inetcdf4.cpp	(revision 1537)
@@ -7,5 +7,6 @@
 namespace xios
 {
-  CINetCDF4::CINetCDF4(const StdString& filename, const MPI_Comm* comm /*= NULL*/, bool multifile /*= true*/, const StdString& timeCounterName /*= "time_counter"*/)
+  CINetCDF4::CINetCDF4(const StdString& filename, const MPI_Comm* comm /*= NULL*/, bool multifile /*= true*/,
+                       bool readMetaDataPar /*= false*/, const StdString& timeCounterName /*= "time_counter"*/)
   {
     // Don't use parallel mode if there is only one process
@@ -17,5 +18,5 @@
         comm = NULL;
     }
-    mpi = comm && !multifile;
+    mpi = comm && !multifile && readMetaDataPar;
 
     // The file format will be detected automatically by NetCDF, it is safe to always set NC_MPIIO
@@ -83,5 +84,5 @@
     std::pair<nc_type, StdSize> retvalue;
     int grpid = this->getGroup(path);
-    int varid = (var != NULL) ? this->getVariable(*var, path) : NC_GLOBAL;
+    int varid = (var != NULL && this->hasVariable(*var, path)) ? this->getVariable(*var, path) : NC_GLOBAL;
     CNetCdfInterface::inqAtt(grpid, varid, attname, retvalue.first, retvalue.second);
     return retvalue;
@@ -216,8 +217,8 @@
     int nbdim = 0, *dimid = NULL;
     int grpid = this->getGroup(path);
-    int varid = (var != NULL) ? this->getVariable(*var, path) : NC_GLOBAL;
+    int varid = (var != NULL && this->hasVariable(*var, path)) ? this->getVariable(*var, path) : NC_GLOBAL;
     std::list<StdString> retvalue;
 
-    if (var != NULL)
+    if (var != NULL && this->hasVariable(*var, path))
     {
       CNetCdfInterface::inqVarNDims(grpid, varid, nbdim);
@@ -247,8 +248,8 @@
     int nbdim = 0, *dimid = NULL;
     int grpid = this->getGroup(path);
-    int varid = (var != NULL) ? this->getVariable(*var, path) : NC_GLOBAL;
+    int varid = (var != NULL && this->hasVariable(*var, path)) ? this->getVariable(*var, path) : NC_GLOBAL;
     std::map<StdString, StdSize> retvalue;
 
-    if (var != NULL)
+    if (var != NULL && this->hasVariable(*var, path))
     {
       CNetCdfInterface::inqVarNDims(grpid, varid, nbdim);
@@ -282,7 +283,7 @@
     std::list<StdString> retvalue;
     int grpid = this->getGroup(path);
-    int varid = (var != NULL) ? this->getVariable(*var, path) : NC_GLOBAL;
-
-    if (var != NULL)
+    int varid = (var != NULL && this->hasVariable(*var, path)) ? this->getVariable(*var, path) : NC_GLOBAL;
+
+    if (var != NULL && this->hasVariable(*var, path))
       CNetCdfInterface::inqVarNAtts(grpid, varid, nbatt);
     else
@@ -376,5 +377,5 @@
   {
     int grpid = this->getGroup(path);
-    int varid = (var != NULL) ? this->getVariable(*var, path) : NC_GLOBAL;
+    int varid = (var != NULL && this->hasVariable(*var, path)) ? this->getVariable(*var, path) : NC_GLOBAL;
     std::pair<nc_type , StdSize> attinfos = this->getAttribute(name, var, path);
     std::vector<T> retvalue(attinfos.second);
@@ -494,19 +495,43 @@
   bool CINetCDF4::isRectilinear(const StdString& name, const CVarPath* const path)
   {
-    std::list<StdString> coords = this->getCoordinatesIdList(name, path);
-    std::list<StdString>::const_iterator it = coords.begin(), end = coords.end();
+    std::list<StdString> varCoords = this->getCoordinatesIdList(name, path);
+    std::list<StdString> varDims = this->getDimensionsList(&name, path);
+    std::list<StdString>::const_iterator it = varCoords.begin(), end = varCoords.end();
+    std::set<StdString> varDims1D;
+
+    // Firstly, loop over coordinate list
     for (; it != end; it++)
     {
       const StdString& coord = *it;
-      if (this->hasVariable(coord, path) && !this->isTemporal(coord, path))
-      {
-        std::map<StdString, StdSize> dimvar = this->getDimensions(&coord, path);
-        if ((dimvar.size() == 1) && (dimvar.find(coord) != dimvar.end()))
+      if (this->hasVariable(coord, path) && !this->isTemporal(coord, path) )
+      {
+        std::map<StdString, StdSize> coordDims = this->getDimensions(&coord, path);
+        for (std::map<StdString, StdSize>::const_iterator itTmp = coordDims.begin(); itTmp != coordDims.end(); itTmp++)
+        {
+          varDims.remove(itTmp->first);
+        }
+        if (this->isLonOrLat(coord, path) && coordDims.size() == 1)
+        {
+          varDims1D.insert(coordDims.begin()->first);
           continue;
-        else
-          return false;
-      }
-    }
-    return true;
+        }
+      }
+    }
+    // Secondly, loop over remaining dimensions
+    for (it= varDims.begin(); it != varDims.end(); it++)
+    {
+      const StdString& coord = *it;
+      std::map<StdString, StdSize> coordDims = this->getDimensions(&coord, path);
+      if (this->hasVariable(coord, path) && !this->isTemporal(coord, path) )
+      {
+        if (this->isLonOrLat(coord, path) && coordDims.size() == 1)
+        {
+          varDims1D.insert(coordDims.begin()->first);
+          continue;
+        }
+      }
+    }
+
+    return (varDims1D.size() == 2);
   }
 
@@ -523,5 +548,5 @@
     {
       const StdString& coord = *it;
-      if (this->hasVariable(coord, path) && !this->isTemporal(coord, path))
+      if (this->hasVariable(coord, path) && !this->isTemporal(coord, path) && this->isLonOrLat(coord, path))
       {
         std::map<StdString, StdSize> dimvar = this->getDimensions(&coord, path);
@@ -550,5 +575,5 @@
     {
       const StdString& coord = *it;
-      if (this->hasVariable(coord, path) && !this->isTemporal(coord, path))
+      if (this->hasVariable(coord, path) && !this->isTemporal(coord, path) && this->isLonOrLat(coord, path))
       {
         std::map<StdString, StdSize> dimvar = this->getDimensions(&coord, path);
@@ -780,3 +805,15 @@
       return *(++(++clist.rbegin()));
   }
+
+  bool CINetCDF4::isLonOrLat(const StdString& varname, const CVarPath* const path)
+  {
+    if (this->hasAttribute(CCFKeywords::XIOS_CF_units, &varname, path))
+    {
+      StdString unit = this->getAttributeValue(CCFKeywords::XIOS_CF_units, &varname, path);
+      return      (CCFConvention::XIOS_CF_Latitude_units.end() != CCFConvention::XIOS_CF_Latitude_units.find(unit)
+                || CCFConvention::XIOS_CF_Longitude_units.end() != CCFConvention::XIOS_CF_Longitude_units.find(unit));
+    }
+    else return false ;
+  }
+
 } // namespace xios
Index: /XIOS/trunk/src/io/inetcdf4.hpp
===================================================================
--- /XIOS/trunk/src/io/inetcdf4.hpp	(revision 1536)
+++ /XIOS/trunk/src/io/inetcdf4.hpp	(revision 1537)
@@ -23,5 +23,6 @@
       /// Constructors ///
       CINetCDF4(const StdString& filename, const MPI_Comm* comm = NULL, bool multifile = true,
-                const StdString& timeCounterName = "time_counter");
+                bool readMetaDataPar = false, const StdString& timeCounterName = "time_counter");
+
       CINetCDF4(const CINetCDF4& inetcdf4);       // Not implemented.
       CINetCDF4(const CINetCDF4* const inetcdf4); // Not implemented.
@@ -135,4 +136,6 @@
       bool isCellGrid(const StdString& name, const CVarPath* const path = NULL);
 
+      bool isLonOrLat(const StdString& varname, const CVarPath* const path = NULL);
+
     protected:
       /// Getters ///
Index: /XIOS/trunk/src/io/nc4_data_input.cpp
===================================================================
--- /XIOS/trunk/src/io/nc4_data_input.cpp	(revision 1536)
+++ /XIOS/trunk/src/io/nc4_data_input.cpp	(revision 1537)
@@ -10,7 +10,8 @@
 namespace xios
 {
-  CNc4DataInput::CNc4DataInput(const StdString& filename, MPI_Comm comm_file, bool multifile, bool isCollective /*= true*/, bool ugridConvention /*= false*/, const StdString& timeCounterName /*= "time_counter"*/)
+  CNc4DataInput::CNc4DataInput(const StdString& filename, MPI_Comm comm_file, bool multifile, bool isCollective /*= true*/,
+                               bool readMetaDataPar /*= false*/, bool ugridConvention /*= false*/, const StdString& timeCounterName /*= "time_counter"*/)
     : SuperClass()
-    , SuperClassWriter(filename, &comm_file, multifile, timeCounterName)
+    , SuperClassWriter(filename, &comm_file, multifile, readMetaDataPar, timeCounterName)
     , comm_file(comm_file)
     , filename(filename)
@@ -185,6 +186,31 @@
       listDimSize.push_front(*itMap);
 */
-    for (std::list<StdString>::const_iterator it = dimList.begin(); it != dimList.end(); ++it)
-      listDimSize.push_front(*dimSizeMap.find(*it));
+
+//    if (!SuperClassWriter::isRectilinear(fieldId))
+    if (true)
+    {
+      for (std::list<StdString>::const_iterator it = dimList.begin(); it != dimList.end(); ++it)
+        listDimSize.push_front(*dimSizeMap.find(*it));
+    }
+    else
+    {
+       std::list<StdString> coords = SuperClassWriter::getCoordinatesIdList(fieldId);
+       std::list<StdString>::const_iterator itCoord = coords.begin();
+       for (; itCoord != coords.end(); itCoord++)
+       {
+         const StdString& coord = *itCoord;
+         if (SuperClassWriter::hasVariable(coord) && !SuperClassWriter::isTemporal(coord))
+         {
+           std::map<StdString, StdSize> dimsTmp = SuperClassWriter::getDimensions(&coord);
+           StdString dimNameTmp = dimsTmp.begin()->first;
+           StdSize dimSizeTmp = dimsTmp.begin()->second;
+           listDimSize.push_front(make_pair(coord, dimSizeTmp));
+           dimSizeMap.erase(dimNameTmp);
+           dimList.remove(dimNameTmp);
+         }
+       }
+       for (std::list<StdString>::const_iterator it = dimList.begin(); it != dimList.end(); ++it)
+        listDimSize.push_front(*dimSizeMap.find(*it));
+    }
 
     // Now process domain and axis
@@ -265,5 +291,5 @@
     if ((CDomain::type_attr::rectilinear == domain->type))
     {
-      // Ok, try to read some f.. attributes such as longitude and latitude
+      // Ok, try to read some attributes such as longitude and latitude
       bool hasLat = SuperClassWriter::hasVariable(itMapNj->first);
       if (hasLat)
@@ -284,14 +310,35 @@
     else if ((CDomain::type_attr::curvilinear == domain->type))
     {
-      int ni = domain->ni;
-      int nj = domain->nj;
+      // Make sure that if there is no local domain defined on a process, the process still reads just one value.
+      int ni, nj, ibegin, jbegin;
+      if (domain->ni == 0)
+      {
+        ni = 1;
+        ibegin = 0;
+      }
+      else
+      {
+        ni = domain->ni;
+        ibegin = domain->ibegin;
+      }
+      if (domain->nj == 0)
+      {
+        nj = 1;
+        jbegin = 0;
+      }
+      else
+      {
+        nj = domain->nj;
+        jbegin = domain->jbegin;
+      }
+
       std::vector<StdSize> nBeginLatLon(2), nSizeLatLon(2);
-      nBeginLatLon[0] = 0; nBeginLatLon[1] = 0;
-      nSizeLatLon[0]  = domain->nj_glo.getValue(); nSizeLatLon[1] = domain->ni_glo.getValue();
+      nBeginLatLon[0] = jbegin; nBeginLatLon[1] = ibegin;
+      nSizeLatLon[0]  = nj; nSizeLatLon[1] = ni;
 
       StdString latName = this->getLatCoordName(fieldId);
       if (SuperClassWriter::hasVariable(latName))
       {
-        domain->latvalue_curvilinear_read_from_file.resize(domain->ni_glo,domain->nj_glo);
+        domain->latvalue_curvilinear_read_from_file.resize(ni, nj);
         readFieldVariableValue(domain->latvalue_curvilinear_read_from_file, latName, nBeginLatLon, nSizeLatLon);
       }
@@ -299,5 +346,5 @@
       if (SuperClassWriter::hasVariable(lonName))
       {
-        domain->lonvalue_curvilinear_read_from_file.resize(domain->ni_glo,domain->nj_glo);
+        domain->lonvalue_curvilinear_read_from_file.resize(ni, nj);
         readFieldVariableValue(domain->lonvalue_curvilinear_read_from_file, lonName, nBeginLatLon, nSizeLatLon);
       }
@@ -306,5 +353,5 @@
       StdString boundsLonName = this->getBoundsId(lonName);
 
-      int nbVertex = this->getNbVertex(fieldId);
+      int nbVertex = 4; //this->getNbVertex(fieldId);
       if (!domain->nvertex.isEmpty() && (domain->nvertex != nbVertex))
       {
@@ -321,11 +368,11 @@
 
       std::vector<StdSize> nBeginBndsLatLon(3), nSizeBndsLatLon(3);
-      nBeginBndsLatLon[0] = 0; nSizeBndsLatLon[0] = domain->nj_glo.getValue();
-      nBeginBndsLatLon[1] = 0; nSizeBndsLatLon[1] = domain->ni_glo.getValue();
+      nBeginBndsLatLon[0] = jbegin; nSizeBndsLatLon[0] = nj;
+      nBeginBndsLatLon[1] = ibegin; nSizeBndsLatLon[1] = ni;
       nBeginBndsLatLon[2] = 0; nSizeBndsLatLon[2] = nbVertex;
 
       if (SuperClassWriter::hasVariable(boundsLatName))
       {
-        domain->bounds_latvalue_curvilinear_read_from_file.resize(nbVertex,domain->ni_glo,domain->nj_glo);
+        domain->bounds_latvalue_curvilinear_read_from_file.resize(nbVertex, ni, nj);
         readFieldVariableValue(domain->bounds_latvalue_curvilinear_read_from_file, boundsLatName, nBeginBndsLatLon, nSizeBndsLatLon);
 
@@ -333,5 +380,5 @@
       if (SuperClassWriter::hasVariable(boundsLonName)) 
       {
-        domain->bounds_lonvalue_curvilinear_read_from_file.resize(nbVertex,domain->ni_glo,domain->nj_glo);
+        domain->bounds_lonvalue_curvilinear_read_from_file.resize(nbVertex, ni, nj);
         readFieldVariableValue(domain->bounds_lonvalue_curvilinear_read_from_file, boundsLonName, nBeginBndsLatLon, nSizeBndsLatLon);
       }      
@@ -339,12 +386,25 @@
     else if ((CDomain::type_attr::unstructured == domain->type))// || (this->isUnstructured(fieldId)))
     {
+      // Make sure that if there is no local domain defined on a process, the process still reads just one value.
+      int ni, ibegin;
+      if (domain->ni == 0)
+      {
+        ni = 1;
+        ibegin = 0;
+      }
+      else
+      {
+        ni = domain->ni;
+        ibegin = domain->ibegin;
+      }
+
       std::vector<StdSize> nBeginLatLon(1,0), nSizeLatLon(1,0);
-      nSizeLatLon[0]  = domain->ni_glo.getValue();
-      CArray<double,1> globalLonLat(domain->ni_glo.getValue());
+      nBeginLatLon[0] = ibegin;
+      nSizeLatLon[0]  = ni;
 
       StdString latName = this->getLatCoordName(fieldId);
       if (SuperClassWriter::hasVariable(latName))
       {
-        domain->latvalue_unstructured_read_from_file.resize(domain->ni_glo);
+        domain->latvalue_unstructured_read_from_file.resize(ni);
         readFieldVariableValue(domain->latvalue_unstructured_read_from_file, latName, nBeginLatLon, nSizeLatLon);  
       }
@@ -353,6 +413,5 @@
       if (SuperClassWriter::hasVariable(lonName)) //(0 != lonName.compare(""))
       {
-        // readFieldVariableValue(globalLonLat, lonName, nBeginLatLon, nSizeLatLon);
-        domain->lonvalue_unstructured_read_from_file.resize(domain->ni_glo);
+        domain->lonvalue_unstructured_read_from_file.resize(ni);
         readFieldVariableValue(domain->lonvalue_unstructured_read_from_file, lonName, nBeginLatLon, nSizeLatLon);
       }
@@ -383,5 +442,5 @@
 
       std::vector<StdSize> nBeginBndsLatLon(2), nSizeBndsLatLon(2);
-      nBeginBndsLatLon[0] = 0; nSizeBndsLatLon[0] = domain->ni_glo.getValue();
+      nBeginBndsLatLon[0] = ibegin; nSizeBndsLatLon[0] = ni;
       nBeginBndsLatLon[1] = 0; nSizeBndsLatLon[1] = nbVertex;
 
@@ -418,5 +477,6 @@
     itMapNj = itMapNi; ++itMapNj;
 
-    if (this->isRectilinear(fieldId) || this->isCurvilinear(fieldId))
+    if (CDomain::type_attr::rectilinear == domain->type || CDomain::type_attr::curvilinear == domain->type ||
+        this->isRectilinear(fieldId) || this->isCurvilinear(fieldId))
     {
       if (!domain->nj_glo.isEmpty() && (domain->nj_glo != itMapNj->second))
@@ -442,5 +502,5 @@
       domain->ni_glo.setValue(itMapNi->second);
     }
-    else if (this->isUnstructured(fieldId))
+    else if (CDomain::type_attr::unstructured == domain->type|| this->isUnstructured(fieldId))
     {
       domain->nj_glo.setValue(1);
@@ -500,12 +560,16 @@
 
     { // Read axis value
-      std::vector<StdSize> nBegin(1, 0), nSize(1, itMapN->second);
-      CArray<double,1> readAxisValue(itMapN->second);
-      readFieldVariableValue(readAxisValue, itMapN->first, nBegin, nSize, true);
-      int begin = 0, n = itMapN->second;
-      if (!axis->begin.isEmpty()) begin = axis->begin.getValue();
-      if (!axis->n.isEmpty()) n = axis->n.getValue();
-      axis->value.resize(n);
-      for (int i = 0; i < n; ++i) axis->value(i) = readAxisValue(begin + i);
+      bool hasValue = SuperClassWriter::hasVariable(itMapN->first);
+      if (hasValue)
+      {
+        std::vector<StdSize> nBegin(1, 0), nSize(1, itMapN->second);
+        CArray<double,1> readAxisValue(itMapN->second);
+        readFieldVariableValue(readAxisValue, itMapN->first, nBegin, nSize, true);
+        int begin = 0, n = itMapN->second;
+        if (!axis->begin.isEmpty()) begin = axis->begin.getValue();
+        if (!axis->n.isEmpty()) n = axis->n.getValue();
+        axis->value.resize(n);
+        for (int i = 0; i < n; ++i) axis->value(i) = readAxisValue(begin + i);
+      }
     }
   }
Index: /XIOS/trunk/src/io/nc4_data_input.hpp
===================================================================
--- /XIOS/trunk/src/io/nc4_data_input.hpp	(revision 1536)
+++ /XIOS/trunk/src/io/nc4_data_input.hpp	(revision 1537)
@@ -24,5 +24,5 @@
     /// Constructors ///
     CNc4DataInput(const StdString& filename, MPI_Comm comm_file, bool multifile, bool isCollective = true,
-                  bool ugridConvention = false, const StdString& timeCounterName = "time_counter");
+                  bool readMetaDataPar = false, bool ugridConvention = false, const StdString& timeCounterName = "time_counter");
     CNc4DataInput(const CNc4DataInput& dataInput);       // Not implemented.
     CNc4DataInput(const CNc4DataInput* const dataInput); // Not implemented.
Index: /XIOS/trunk/src/io/nc4_data_output.cpp
===================================================================
--- /XIOS/trunk/src/io/nc4_data_output.cpp	(revision 1536)
+++ /XIOS/trunk/src/io/nc4_data_output.cpp	(revision 1537)
@@ -1,5 +1,4 @@
 #include "nc4_data_output.hpp"
 
-#include <boost/lexical_cast.hpp>
 #include "attribute_template.hpp"
 #include "group_template.hpp"
@@ -24,4 +23,5 @@
       {
         SuperClass::type = MULTI_FILE;
+        compressionLevel= file->compression_level.isEmpty() ? 0 :file->compression_level ;
       }
 
@@ -37,4 +37,6 @@
       {
         SuperClass::type = (multifile) ? MULTI_FILE : ONE_FILE;
+        if (file==NULL) compressionLevel = 0 ;
+        else compressionLevel= file->compression_level.isEmpty() ? 0 :file->compression_level ;
       }
 
@@ -53,4 +55,9 @@
       void CNc4DataOutput::writeDomain_(CDomain* domain)
       {
+        StdString lonName,latName ;
+         
+        domain->computeWrittenIndex();
+        domain->computeWrittenCompressedIndex(comm_file);
+
         if (domain->type == CDomain::type_attr::unstructured)
         {
@@ -76,4 +83,6 @@
          if (isWrittenDomain(domid)) return ;
          else setWrittenDomain(domid);
+        
+         int nvertex = (domain->nvertex.isEmpty()) ? 0 : domain->nvertex;
 
 
@@ -89,10 +98,44 @@
          {
            case CDomain::type_attr::curvilinear :
-             dimXid     = StdString("x").append(appendDomid);
-             dimYid     = StdString("y").append(appendDomid);
+
+             if (domain->lon_name.isEmpty()) lonName = "nav_lon";
+             else lonName = domain->lon_name;
+
+             if (domain->lat_name.isEmpty()) latName = "nav_lat";
+             else latName = domain->lat_name;
+
+             if (domain->dim_i_name.isEmpty()) dimXid=StdString("x").append(appendDomid);
+             else dimXid=domain->dim_i_name.getValue() + appendDomid;
+
+             if (domain->dim_j_name.isEmpty()) dimYid=StdString("y").append(appendDomid);
+             else dimYid=domain->dim_j_name.getValue() + appendDomid;
+
              break ;
+
            case CDomain::type_attr::rectilinear :
-             dimXid     = StdString("lon").append(appendDomid);
-             dimYid     = StdString("lat").append(appendDomid);
+
+             if (domain->lon_name.isEmpty())
+             {
+               if (domain->dim_i_name.isEmpty())
+                   lonName = "lon";
+               else
+                 lonName = domain->dim_i_name.getValue();
+             }
+             else lonName = domain->lon_name;
+
+             if (domain->lat_name.isEmpty())
+             {
+               if (domain->dim_j_name.isEmpty())
+                 latName = "lat";
+               else
+                 latName = domain->dim_j_name.getValue();
+             }
+             else latName = domain->lat_name;
+             
+             if (domain->dim_i_name.isEmpty()) dimXid = lonName+appendDomid;
+             else dimXid = domain->dim_i_name.getValue()+appendDomid;
+
+             if (domain->dim_j_name.isEmpty()) dimYid = latName+appendDomid;
+             else dimYid = domain->dim_j_name.getValue()+appendDomid;
              break;
          }
@@ -111,4 +154,65 @@
 */
 
+         CArray<size_t, 1>& indexToWrite = domain->localIndexToWriteOnServer;
+         int nbWritten = indexToWrite.numElements();
+         CArray<double,1> writtenLat, writtenLon;
+         CArray<double,2> writtenBndsLat, writtenBndsLon;
+         CArray<double,1> writtenArea;
+
+         if (domain->hasLonLat)
+         {
+           writtenLat.resize(nbWritten);
+           writtenLon.resize(nbWritten);
+           for (int idx = 0; idx < nbWritten; ++idx)
+           {
+        	  if (idx < domain->latvalue.numElements())
+        	  {
+                writtenLat(idx) = domain->latvalue(indexToWrite(idx));
+                writtenLon(idx) = domain->lonvalue(indexToWrite(idx));
+        	  }
+        	  else
+        	  {
+                writtenLat(idx) = 0.;
+                writtenLon(idx) = 0.;
+        	  }
+           }
+         
+
+           if (domain->hasBounds)
+           {         
+             int nvertex = domain->nvertex, idx;
+             writtenBndsLat.resize(nvertex, nbWritten);
+             writtenBndsLon.resize(nvertex, nbWritten);
+             CArray<double,2>& boundslat = domain->bounds_latvalue;
+             CArray<double,2>& boundslon = domain->bounds_lonvalue;   
+             for (idx = 0; idx < nbWritten; ++idx)
+               for (int nv = 0; nv < nvertex; ++nv)
+               {
+            	 if (idx < boundslat.columns())
+            	 {
+                   writtenBndsLat(nv, idx) = boundslat(nv, int(indexToWrite(idx)));
+                   writtenBndsLon(nv, idx) = boundslon(nv, int(indexToWrite(idx)));
+            	 }
+            	 else
+            	 {
+                   writtenBndsLat(nv, idx) = 0.;
+                   writtenBndsLon(nv, idx) = 0.;
+            	 }
+               }
+           }
+         }
+
+         if (domain->hasArea)
+         {
+           writtenArea.resize(nbWritten);           
+           for (int idx = 0; idx < nbWritten; ++idx)
+           {
+        	  if (idx < domain->areavalue.numElements())
+                writtenArea(idx) = domain->areavalue(indexToWrite(idx));
+        	  else
+                writtenArea(idx) = 0.;
+           }
+         }
+
          try
          {
@@ -129,20 +233,21 @@
                    case CDomain::type_attr::curvilinear :
                      dim0.push_back(dimYid); dim0.push_back(dimXid);
-                     lonid = StdString("nav_lon").append(appendDomid);
-                     latid = StdString("nav_lat").append(appendDomid);
+                     lonid = lonName+appendDomid;
+                     latid = latName+appendDomid;
                      break ;
                    case CDomain::type_attr::rectilinear :
-                     lonid = StdString("lon").append(appendDomid);
-                     latid = StdString("lat").append(appendDomid);
+                     lonid = lonName+appendDomid;
+                     latid = latName+appendDomid;
                      dim0.push_back(dimYid);
                      dim1.push_back(dimXid);
                      break;
                  }
-
-                 bounds_lonid = StdString("bounds_lon").append(appendDomid);
-                 bounds_latid = StdString("bounds_lat").append(appendDomid);
-
-                 SuperClassWriter::addDimension(dimXid, domain->zoom_ni_srv);
-                 SuperClassWriter::addDimension(dimYid, domain->zoom_nj_srv);
+                 if (!domain->bounds_lon_name.isEmpty()) bounds_lonid = domain->bounds_lon_name;
+                 else bounds_lonid = "bounds_"+lonName+appendDomid;
+                 if (!domain->bounds_lat_name.isEmpty()) bounds_latid = domain->bounds_lat_name;
+                 else bounds_latid = "bounds_"+latName+appendDomid;
+
+                 SuperClassWriter::addDimension(dimXid, domain->zoom_ni);
+                 SuperClassWriter::addDimension(dimYid, domain->zoom_nj);
 
                  if (domain->hasBounds)
@@ -151,16 +256,16 @@
                  if (server->intraCommSize > 1)
                  {
-                   this->writeLocalAttributes(domain->zoom_ibegin_srv,
-                                              domain->zoom_ni_srv,
-                                              domain->zoom_jbegin_srv,
-                                              domain->zoom_nj_srv,
+                   this->writeLocalAttributes(domain->zoom_ibegin,
+                                              domain->zoom_ni,
+                                              domain->zoom_jbegin,
+                                              domain->zoom_nj,
                                               appendDomid);
 
                    if (singleDomain)
                     this->writeLocalAttributes_IOIPSL(dimXid, dimYid,
-                                                      domain->zoom_ibegin_srv,
-                                                      domain->zoom_ni_srv,
-                                                      domain->zoom_jbegin_srv,
-                                                      domain->zoom_nj_srv,
+                                                      domain->zoom_ibegin,
+                                                      domain->zoom_ni,
+                                                      domain->zoom_jbegin,
+                                                      domain->zoom_nj,
                                                       domain->ni_glo,domain->nj_glo,
                                                       server->intraCommRank,server->intraCommSize);
@@ -172,10 +277,10 @@
                    {
                      case CDomain::type_attr::curvilinear :
-                       SuperClassWriter::addVariable(latid, typePrec, dim0);
-                       SuperClassWriter::addVariable(lonid, typePrec, dim0);
+                       SuperClassWriter::addVariable(latid, typePrec, dim0, compressionLevel);
+                       SuperClassWriter::addVariable(lonid, typePrec, dim0, compressionLevel);
                        break ;
                       case CDomain::type_attr::rectilinear :
-                        SuperClassWriter::addVariable(latid, typePrec, dim0);
-                        SuperClassWriter::addVariable(lonid, typePrec, dim1);
+                        SuperClassWriter::addVariable(latid, typePrec, dim0, compressionLevel);
+                        SuperClassWriter::addVariable(lonid, typePrec, dim1, compressionLevel);
                         break ;
                    }
@@ -193,6 +298,6 @@
                      dim0.push_back(dimXid);
                      dim0.push_back(dimVertId);
-                     SuperClassWriter::addVariable(bounds_lonid, typePrec, dim0);
-                     SuperClassWriter::addVariable(bounds_latid, typePrec, dim0);
+                     SuperClassWriter::addVariable(bounds_lonid, typePrec, dim0, compressionLevel);
+                     SuperClassWriter::addVariable(bounds_latid, typePrec, dim0, compressionLevel);
                    }
                  }
@@ -219,5 +324,5 @@
                  if (domain->hasArea)
                  {
-                   SuperClassWriter::addVariable(areaId, typePrec, dim0);
+                   SuperClassWriter::addVariable(areaId, typePrec, dim0, compressionLevel);
                    SuperClassWriter::addAttribute("standard_name", StdString("cell_area"), &areaId);
                    SuperClassWriter::addAttribute("units", StdString("m2"), &areaId);
@@ -230,12 +335,12 @@
                    switch (domain->type)
                    {
-                     case CDomain::type_attr::curvilinear :
-                       SuperClassWriter::writeData(domain->latvalue_srv, latid, isCollective, 0);
-                       SuperClassWriter::writeData(domain->lonvalue_srv, lonid, isCollective, 0);
+                     case CDomain::type_attr::curvilinear :                       
+                       SuperClassWriter::writeData(writtenLat, latid, isCollective, 0);
+                       SuperClassWriter::writeData(writtenLon, lonid, isCollective, 0);
                        break;
                      case CDomain::type_attr::rectilinear :
-                       CArray<double,1> lat = domain->latvalue_srv(Range(fromStart,toEnd,domain->zoom_ni_srv)) ;
+                       CArray<double,1> lat = writtenLat(Range(fromStart,toEnd,domain->zoom_ni)) ;
                        SuperClassWriter::writeData(CArray<double,1>(lat.copy()), latid, isCollective, 0);
-                       CArray<double,1> lon=domain->lonvalue_srv(Range(0,domain->zoom_ni_srv-1)) ;
+                       CArray<double,1> lon = writtenLon(Range(0,domain->zoom_ni-1)) ;
                        SuperClassWriter::writeData(CArray<double,1>(lon.copy()), lonid, isCollective, 0);
                        break;
@@ -244,11 +349,13 @@
                    if (domain->hasBounds)
                    {
-                     SuperClassWriter::writeData(domain->bounds_lon_srv, bounds_lonid, isCollective, 0);
-                     SuperClassWriter::writeData(domain->bounds_lat_srv, bounds_latid, isCollective, 0);
+                     SuperClassWriter::writeData(writtenBndsLon, bounds_lonid, isCollective, 0);
+                     SuperClassWriter::writeData(writtenBndsLat, bounds_latid, isCollective, 0);
                    }
                  }
 
                  if (domain->hasArea)
-                   SuperClassWriter::writeData(domain->area_srv, areaId, isCollective, 0);
+                 {
+                   SuperClassWriter::writeData(writtenArea, areaId, isCollective, 0);                   
+                 }
 
                  SuperClassWriter::definition_start();
@@ -270,8 +377,8 @@
                      case CDomain::type_attr::curvilinear :
                        dim0.push_back(dimYid); dim0.push_back(dimXid);
-                       lonid = StdString("nav_lon").append(appendDomid);
-                       latid = StdString("nav_lat").append(appendDomid);
-                       SuperClassWriter::addVariable(latid, typePrec, dim0);
-                       SuperClassWriter::addVariable(lonid, typePrec, dim0);
+                       lonid = lonName+appendDomid;
+                       latid = latName+appendDomid;
+                       SuperClassWriter::addVariable(latid, typePrec, dim0, compressionLevel);
+                       SuperClassWriter::addVariable(lonid, typePrec, dim0, compressionLevel);
                        break;
 
@@ -279,13 +386,14 @@
                        dim0.push_back(dimYid);
                        dim1.push_back(dimXid);
-                       lonid = StdString("lon").append(appendDomid);
-                       latid = StdString("lat").append(appendDomid);
-                       SuperClassWriter::addVariable(latid, typePrec, dim0);
-                       SuperClassWriter::addVariable(lonid, typePrec, dim1);
+                       lonid = lonName+appendDomid;
+                       latid = latName+appendDomid;
+                       SuperClassWriter::addVariable(latid, typePrec, dim0, compressionLevel);
+                       SuperClassWriter::addVariable(lonid, typePrec, dim1, compressionLevel);
                        break;
                    }
-
-                   bounds_lonid = StdString("bounds_lon").append(appendDomid);
-                   bounds_latid = StdString("bounds_lat").append(appendDomid);
+                   if (!domain->bounds_lon_name.isEmpty()) bounds_lonid = domain->bounds_lon_name;
+                   else bounds_lonid = "bounds_"+lonName+appendDomid;
+                   if (!domain->bounds_lat_name.isEmpty()) bounds_latid = domain->bounds_lat_name;
+                   else bounds_latid = "bounds_"+latName+appendDomid;
 
                    this->writeAxisAttributes
@@ -303,6 +411,6 @@
                      dim0.push_back(dimXid);
                      dim0.push_back(dimVertId);
-                     SuperClassWriter::addVariable(bounds_lonid, typePrec, dim0);
-                     SuperClassWriter::addVariable(bounds_latid, typePrec, dim0);
+                     SuperClassWriter::addVariable(bounds_lonid, typePrec, dim0, compressionLevel);
+                     SuperClassWriter::addVariable(bounds_latid, typePrec, dim0, compressionLevel);
                    }
                  }
@@ -312,5 +420,5 @@
                    dim0.clear();
                    dim0.push_back(dimYid); dim0.push_back(dimXid);
-                   SuperClassWriter::addVariable(areaId, typePrec, dim0);
+                   SuperClassWriter::addVariable(areaId, typePrec, dim0, compressionLevel);
                    SuperClassWriter::addAttribute("standard_name", StdString("cell_area"), &areaId);
                    SuperClassWriter::addAttribute("units", StdString("m2"), &areaId);
@@ -333,13 +441,13 @@
                      else
                      {
-                       start[1]=domain->zoom_ibegin_srv-domain->global_zoom_ibegin;
-                       start[0]=domain->zoom_jbegin_srv-domain->global_zoom_jbegin;
-                       count[1]=domain->zoom_ni_srv ; count[0]=domain->zoom_nj_srv ;
+                       start[1]=domain->zoom_ibegin-domain->global_zoom_ibegin;
+                       start[0]=domain->zoom_jbegin-domain->global_zoom_jbegin;
+                       count[1]=domain->zoom_ni ; count[0]=domain->zoom_nj ;
                      }
 
                      if (domain->hasLonLat)
                      {
-                       SuperClassWriter::writeData(domain->latvalue_srv, latid, isCollective, 0,&start,&count);
-                       SuperClassWriter::writeData(domain->lonvalue_srv, lonid, isCollective, 0,&start,&count);
+                       SuperClassWriter::writeData(writtenLat, latid, isCollective, 0,&start,&count);
+                       SuperClassWriter::writeData(writtenLon, lonid, isCollective, 0,&start,&count);
                      }
                      break;
@@ -355,18 +463,17 @@
                          start[0]=0 ;
                          count[0]=0 ;
-                         SuperClassWriter::writeData(domain->latvalue_srv, latid, isCollective, 0,&start,&count);
-                         SuperClassWriter::writeData(domain->lonvalue_srv, lonid, isCollective, 0,&start,&count);
-
+                         SuperClassWriter::writeData(writtenLat, latid, isCollective, 0,&start,&count);
+                         SuperClassWriter::writeData(writtenLon, lonid, isCollective, 0,&start,&count);
                        }
                        else
-                       {
-                         start[0]=domain->zoom_jbegin_srv-domain->global_zoom_jbegin;
-                         count[0]=domain->zoom_nj_srv ;
-                         CArray<double,1> lat = domain->latvalue_srv(Range(fromStart,toEnd,domain->zoom_ni_srv)) ;
+                       { 
+                         start[0]=domain->zoom_jbegin-domain->global_zoom_jbegin;
+                         count[0]=domain->zoom_nj;                         
+                         CArray<double,1> lat = writtenLat(Range(fromStart,toEnd,domain->zoom_ni));
                          SuperClassWriter::writeData(CArray<double,1>(lat.copy()), latid, isCollective, 0,&start,&count);
 
-                         start[0]=domain->zoom_ibegin_srv-domain->global_zoom_ibegin;
-                         count[0]=domain->zoom_ni_srv ;
-                         CArray<double,1> lon=domain->lonvalue_srv(Range(0,domain->zoom_ni_srv-1)) ;
+                         start[0]=domain->zoom_ibegin-domain->global_zoom_ibegin;
+                         count[0]=domain->zoom_ni;                         
+                         CArray<double,1> lon = writtenLon(Range(0,domain->zoom_ni-1));
                          SuperClassWriter::writeData(CArray<double,1>(lon.copy()), lonid, isCollective, 0,&start,&count);
                        }
@@ -388,13 +495,13 @@
                    {
                      start[2] = 0;
-                     start[1] = domain->zoom_ibegin_srv - domain->global_zoom_ibegin;
-                     start[0] = domain->zoom_jbegin_srv - domain->global_zoom_jbegin;
+                     start[1] = domain->zoom_ibegin - domain->global_zoom_ibegin;
+                     start[0] = domain->zoom_jbegin - domain->global_zoom_jbegin;
                      count[2] = domain->nvertex;
-                     count[1] = domain->zoom_ni_srv;
-                     count[0] = domain->zoom_nj_srv;
+                     count[1] = domain->zoom_ni;
+                     count[0] = domain->zoom_nj;
                    }
-
-                 SuperClassWriter::writeData(domain->bounds_lon_srv, bounds_lonid, isCollective, 0, &start, &count);
-                 SuperClassWriter::writeData(domain->bounds_lat_srv, bounds_latid, isCollective, 0, &start, &count);
+                 
+                   SuperClassWriter::writeData(writtenBndsLon, bounds_lonid, isCollective, 0, &start, &count);
+                   SuperClassWriter::writeData(writtenBndsLat, bounds_latid, isCollective, 0, &start, &count);
                  }
 
@@ -411,11 +518,11 @@
                    else
                    {
-                     start[1] = domain->zoom_ibegin_srv - domain->global_zoom_ibegin;
-                     start[0] = domain->zoom_jbegin_srv - domain->global_zoom_jbegin;
-                     count[1] = domain->zoom_ni_srv;
-                     count[0] = domain->zoom_nj_srv;
+                     start[1] = domain->zoom_ibegin - domain->global_zoom_ibegin;
+                     start[0] = domain->zoom_jbegin - domain->global_zoom_jbegin;
+                     count[1] = domain->zoom_ni;
+                     count[0] = domain->zoom_nj;
                    }
-
-                   SuperClassWriter::writeData(domain->area_srv, areaId, isCollective, 0, &start, &count);
+                   
+                   SuperClassWriter::writeData(writtenArea, areaId, isCollective, 0, &start, &count);
                  }
 
@@ -450,4 +557,12 @@
 
       if (domain->IsWritten(this->filename)) return;
+
+      StdString domid = domain->getDomainOutputName();
+
+      // The first domain for the same mesh that will be written is that with the highest value of nvertex.
+      // Thus the entire mesh connectivity will be generated at once.
+      if (isWrittenDomain(domid)) return ;
+      else setWrittenDomain(domid);
+
       domain->checkAttributes();
       if (domain->isEmpty())
@@ -460,8 +575,7 @@
 
       std::vector<StdString> dim0;
-      StdString domid = domain->getDomainOutputName();
       StdString domainName = domain->name;
       domain->assignMesh(domainName, domain->nvertex);
-      domain->mesh->createMeshEpsilon(server->intraComm, domain->lonvalue_srv, domain->latvalue_srv, domain->bounds_lon_srv, domain->bounds_lat_srv);
+      domain->mesh->createMeshEpsilon(server->intraComm, domain->lonvalue, domain->latvalue, domain->bounds_lonvalue, domain->bounds_latvalue);
 
       StdString node_x = domainName + "_node_x";
@@ -486,13 +600,10 @@
 
       if (!SuperClassWriter::dimExist(dimTwo)) SuperClassWriter::addDimension(dimTwo, 2);
-      if (!isWrittenDomain(domid))
-      {
-        dim0.clear();
-        SuperClassWriter::addVariable(domainName, NC_INT, dim0);
-        SuperClassWriter::addAttribute("cf_role", StdString("mesh_topology"), &domainName);
-        SuperClassWriter::addAttribute("long_name", StdString("Topology data of 2D unstructured mesh"), &domainName);
-        SuperClassWriter::addAttribute("topology_dimension", 2, &domainName);
-        SuperClassWriter::addAttribute("node_coordinates", node_x + " " + node_y, &domainName);
-      }
+      dim0.clear();
+      SuperClassWriter::addVariable(domainName, NC_INT, dim0, compressionLevel);
+      SuperClassWriter::addAttribute("cf_role", StdString("mesh_topology"), &domainName);
+      SuperClassWriter::addAttribute("long_name", StdString("Topology data of 2D unstructured mesh"), &domainName);
+      SuperClassWriter::addAttribute("topology_dimension", 2, &domainName);
+      SuperClassWriter::addAttribute("node_coordinates", node_x + " " + node_y, &domainName);
 
       try
@@ -510,9 +621,9 @@
                 dim0.clear();
                 dim0.push_back(dimNode);
-                SuperClassWriter::addVariable(node_x, typePrec, dim0);
+                SuperClassWriter::addVariable(node_x, typePrec, dim0, compressionLevel);
                 SuperClassWriter::addAttribute("standard_name", StdString("longitude"), &node_x);
                 SuperClassWriter::addAttribute("long_name", StdString("Longitude of mesh nodes."), &node_x);
                 SuperClassWriter::addAttribute("units", StdString("degrees_east"), &node_x);
-                SuperClassWriter::addVariable(node_y, typePrec, dim0);
+                SuperClassWriter::addVariable(node_y, typePrec, dim0, compressionLevel);
                 SuperClassWriter::addAttribute("standard_name", StdString("latitude"), &node_y);
                 SuperClassWriter::addAttribute("long_name", StdString("Latitude of mesh nodes."), &node_y);
@@ -529,9 +640,9 @@
                 dim0.clear();
                 dim0.push_back(dimNode);
-                SuperClassWriter::addVariable(node_x, typePrec, dim0);
+                SuperClassWriter::addVariable(node_x, typePrec, dim0, compressionLevel);
                 SuperClassWriter::addAttribute("standard_name", StdString("longitude"), &node_x);
                 SuperClassWriter::addAttribute("long_name", StdString("Longitude of mesh nodes."), &node_x);
                 SuperClassWriter::addAttribute("units", StdString("degrees_east"), &node_x);
-                SuperClassWriter::addVariable(node_y, typePrec, dim0);
+                SuperClassWriter::addVariable(node_y, typePrec, dim0, compressionLevel);
                 SuperClassWriter::addAttribute("standard_name", StdString("latitude"), &node_y);
                 SuperClassWriter::addAttribute("long_name", StdString("Latitude of mesh nodes."), &node_y);
@@ -543,9 +654,9 @@
               dim0.clear();
               dim0.push_back(dimEdge);
-              SuperClassWriter::addVariable(edge_x, typePrec, dim0);
+              SuperClassWriter::addVariable(edge_x, typePrec, dim0, compressionLevel);
               SuperClassWriter::addAttribute("standard_name", StdString("longitude"), &edge_x);
               SuperClassWriter::addAttribute("long_name", StdString("Characteristic longitude of mesh edges."), &edge_x);
               SuperClassWriter::addAttribute("units", StdString("degrees_east"), &edge_x);
-              SuperClassWriter::addVariable(edge_y, typePrec, dim0);
+              SuperClassWriter::addVariable(edge_y, typePrec, dim0, compressionLevel);
               SuperClassWriter::addAttribute("standard_name", StdString("latitude"), &edge_y);
               SuperClassWriter::addAttribute("long_name", StdString("Characteristic latitude of mesh edges."), &edge_y);
@@ -554,5 +665,5 @@
               dim0.push_back(dimEdge);
               dim0.push_back(dimTwo);
-              SuperClassWriter::addVariable(edge_nodes, NC_INT, dim0);
+              SuperClassWriter::addVariable(edge_nodes, NC_INT, dim0, compressionLevel);
               SuperClassWriter::addAttribute("cf_role", StdString("edge_node_connectivity"), &edge_nodes);
               SuperClassWriter::addAttribute("long_name", StdString("Maps every edge/link to two nodes that it connects."), &edge_nodes);
@@ -569,9 +680,9 @@
                 dim0.clear();
                 dim0.push_back(dimNode);
-                SuperClassWriter::addVariable(node_x, typePrec, dim0);
+                SuperClassWriter::addVariable(node_x, typePrec, dim0, compressionLevel);
                 SuperClassWriter::addAttribute("standard_name", StdString("longitude"), &node_x);
                 SuperClassWriter::addAttribute("long_name", StdString("Longitude of mesh nodes."), &node_x);
                 SuperClassWriter::addAttribute("units", StdString("degrees_east"), &node_x);
-                SuperClassWriter::addVariable(node_y, typePrec, dim0);
+                SuperClassWriter::addVariable(node_y, typePrec, dim0, compressionLevel);
                 SuperClassWriter::addAttribute("standard_name", StdString("latitude"), &node_y);
                 SuperClassWriter::addAttribute("long_name", StdString("Latitude of mesh nodes."), &node_y);
@@ -585,9 +696,9 @@
                 dim0.clear();
                 dim0.push_back(dimEdge);
-                SuperClassWriter::addVariable(edge_x, typePrec, dim0);
+                SuperClassWriter::addVariable(edge_x, typePrec, dim0, compressionLevel);
                 SuperClassWriter::addAttribute("standard_name", StdString("longitude"), &edge_x);
                 SuperClassWriter::addAttribute("long_name", StdString("Characteristic longitude of mesh edges."), &edge_x);
                 SuperClassWriter::addAttribute("units", StdString("degrees_east"), &edge_x);
-                SuperClassWriter::addVariable(edge_y, typePrec, dim0);
+                SuperClassWriter::addVariable(edge_y, typePrec, dim0, compressionLevel);
                 SuperClassWriter::addAttribute("standard_name", StdString("latitude"), &edge_y);
                 SuperClassWriter::addAttribute("long_name", StdString("Characteristic latitude of mesh edges."), &edge_y);
@@ -596,5 +707,5 @@
                 dim0.push_back(dimEdge);
                 dim0.push_back(dimTwo);
-                SuperClassWriter::addVariable(edge_nodes, NC_INT, dim0);
+                SuperClassWriter::addVariable(edge_nodes, NC_INT, dim0, compressionLevel);
                 SuperClassWriter::addAttribute("cf_role", StdString("edge_node_connectivity"), &edge_nodes);
                 SuperClassWriter::addAttribute("long_name", StdString("Maps every edge/link to two nodes that it connects."), &edge_nodes);
@@ -607,9 +718,9 @@
               dim0.clear();
               dim0.push_back(dimFace);
-              SuperClassWriter::addVariable(face_x, typePrec, dim0);
+              SuperClassWriter::addVariable(face_x, typePrec, dim0, compressionLevel);
               SuperClassWriter::addAttribute("standard_name", StdString("longitude"), &face_x);
               SuperClassWriter::addAttribute("long_name", StdString("Characteristic longitude of mesh faces."), &face_x);
               SuperClassWriter::addAttribute("units", StdString("degrees_east"), &face_x);
-              SuperClassWriter::addVariable(face_y, typePrec, dim0);
+              SuperClassWriter::addVariable(face_y, typePrec, dim0, compressionLevel);
               SuperClassWriter::addAttribute("standard_name", StdString("latitude"), &face_y);
               SuperClassWriter::addAttribute("long_name", StdString("Characteristic latitude of mesh faces."), &face_y);
@@ -618,5 +729,5 @@
               dim0.push_back(dimFace);
               dim0.push_back(dimVertex);
-              SuperClassWriter::addVariable(face_nodes, NC_INT, dim0);
+              SuperClassWriter::addVariable(face_nodes, NC_INT, dim0, compressionLevel);
               SuperClassWriter::addAttribute("cf_role", StdString("face_node_connectivity"), &face_nodes);
               SuperClassWriter::addAttribute("long_name", StdString("Maps every face to its corner nodes."), &face_nodes);
@@ -625,5 +736,5 @@
               dim0.push_back(dimFace);
               dim0.push_back(dimVertex);
-              SuperClassWriter::addVariable(face_edges, NC_INT, dim0);
+              SuperClassWriter::addVariable(face_edges, NC_INT, dim0, compressionLevel);
               SuperClassWriter::addAttribute("cf_role", StdString("face_edge_connectivity"), &face_edges);
               SuperClassWriter::addAttribute("long_name", StdString("Maps every face to its edges."), &face_edges);
@@ -633,5 +744,5 @@
               dim0.push_back(dimEdge);
               dim0.push_back(dimTwo);
-              SuperClassWriter::addVariable(edge_faces, NC_INT, dim0);
+              SuperClassWriter::addVariable(edge_faces, NC_INT, dim0, compressionLevel);
               SuperClassWriter::addAttribute("cf_role", StdString("edge_face connectivity"), &edge_faces);
               SuperClassWriter::addAttribute("long_name", StdString("neighbor faces for edges"), &edge_faces);
@@ -642,5 +753,5 @@
               dim0.push_back(dimFace);
               dim0.push_back(dimVertex);
-              SuperClassWriter::addVariable(face_faces, NC_INT, dim0);
+              SuperClassWriter::addVariable(face_faces, NC_INT, dim0, compressionLevel);
               SuperClassWriter::addAttribute("cf_role", StdString("face_face connectivity"), &face_faces);
               SuperClassWriter::addAttribute("long_name", StdString("Indicates which other faces neighbor each face"), &face_faces);
@@ -666,155 +777,103 @@
             std::vector<StdSize> countFaceConctv(2) ;
 
-            if (!isWrittenDomain(domid))
+            if (domain->nvertex == 1)
             {
-              if (domain->nvertex == 1)
-              {
-                if (domain->isEmpty())
-                 {
-                   startNodes[0]=0 ;
-                   countNodes[0]=0 ;
-                 }
-                 else
-                 {
-                   startNodes[0] = domain->zoom_ibegin_srv-domain->global_zoom_ibegin;
-                   countNodes[0] = domain->zoom_ni_srv ;
-                 }
-
-                SuperClassWriter::writeData(domain->mesh->node_lat, node_y, isCollective, 0, &startNodes, &countNodes);
-                SuperClassWriter::writeData(domain->mesh->node_lon, node_x, isCollective, 0, &startNodes, &countNodes);
-              }
-              else if (domain->nvertex == 2)
-              {
-                if (domain->isEmpty())
-                 {
-                  startEdges[0]=0 ;
-                  countEdges[0]=0 ;
-                  startNodes[0]=0 ;
-                  countNodes[0]=0 ;
-                  startEdgeNodes[0]=0;
-                  startEdgeNodes[1]=0;
-                  countEdgeNodes[0]=0;
-                  countEdgeNodes[1]=0;
-
-                 }
-                 else
-                 {
-                   startEdges[0] = domain->zoom_ibegin_srv-domain->global_zoom_ibegin;
-                   countEdges[0] = domain->zoom_ni_srv ;
-                   startNodes[0] = domain->mesh->node_start;
-                   countNodes[0] = domain->mesh->node_count;
-                   startEdgeNodes[0] = domain->zoom_ibegin_srv-domain->global_zoom_ibegin;
-                   startEdgeNodes[1] = 0;
-                   countEdgeNodes[0] = domain->zoom_ni_srv;
-                   countEdgeNodes[1]= 2;
-                 }
-                SuperClassWriter::writeData(domain->mesh->node_lat, node_y, isCollective, 0, &startNodes, &countNodes);
-                SuperClassWriter::writeData(domain->mesh->node_lon, node_x, isCollective, 0, &startNodes, &countNodes);
-                SuperClassWriter::writeData(domain->mesh->edge_lat, edge_y, isCollective, 0, &startEdges, &countEdges);
-                SuperClassWriter::writeData(domain->mesh->edge_lon, edge_x, isCollective, 0, &startEdges, &countEdges);
-                SuperClassWriter::writeData(domain->mesh->edge_nodes, edge_nodes, isCollective, 0, &startEdgeNodes, &countEdgeNodes);
-              }
-              else
-              {
-                if (domain->isEmpty())
-                 {
-                   startFaces[0] = 0 ;
-                   countFaces[0] = 0 ;
-                   startNodes[0] = 0;
-                   countNodes[0] = 0;
-                   startEdges[0] = 0;
-                   countEdges[0] = 0;
-                   startEdgeFaces[0] = 0;
-                   startEdgeFaces[1] = 0;
-                   countEdgeFaces[0] = 0;
-                   countEdgeFaces[1] = 0;
-                   startFaceConctv[0] = 0;
-                   startFaceConctv[1] = 0;
-                   countFaceConctv[0] = 0;
-                   countFaceConctv[1] = 0;
-                 }
-                 else
-                 {
-                   startFaces[0] = domain->zoom_ibegin_srv-domain->global_zoom_ibegin;
-                   countFaces[0] = domain->zoom_ni_srv ;
-                   startNodes[0] = domain->mesh->node_start;
-                   countNodes[0] = domain->mesh->node_count;
-                   startEdges[0] = domain->mesh->edge_start;
-                   countEdges[0] = domain->mesh->edge_count;
-                   startEdgeNodes[0] = domain->mesh->edge_start;
-                   startEdgeNodes[1] = 0;
-                   countEdgeNodes[0] = domain->mesh->edge_count;
-                   countEdgeNodes[1]= 2;
-                   startEdgeFaces[0] = domain->mesh->edge_start;
-                   startEdgeFaces[1]= 0;
-                   countEdgeFaces[0] = domain->mesh->edge_count;
-                   countEdgeFaces[1]= 2;
-                   startFaceConctv[0] = domain->zoom_ibegin_srv-domain->global_zoom_ibegin;
-                   startFaceConctv[1] = 0;
-                   countFaceConctv[0] = domain->zoom_ni_srv;
-                   countFaceConctv[1] = domain->nvertex;
-                 }
-                SuperClassWriter::writeData(domain->mesh->node_lat, node_y, isCollective, 0, &startNodes, &countNodes);
-                SuperClassWriter::writeData(domain->mesh->node_lon, node_x, isCollective, 0, &startNodes, &countNodes);
-                SuperClassWriter::writeData(domain->mesh->edge_lat, edge_y, isCollective, 0, &startEdges, &countEdges);
-                SuperClassWriter::writeData(domain->mesh->edge_lon, edge_x, isCollective, 0, &startEdges, &countEdges);
-                SuperClassWriter::writeData(domain->mesh->edge_nodes, edge_nodes, isCollective, 0, &startEdgeNodes, &countEdgeNodes);
-                SuperClassWriter::writeData(domain->mesh->face_lat, face_y, isCollective, 0, &startFaces, &countFaces);
-                SuperClassWriter::writeData(domain->mesh->face_lon, face_x, isCollective, 0, &startFaces, &countFaces);
-                SuperClassWriter::writeData(domain->mesh->face_nodes, face_nodes, isCollective, 0, &startFaceConctv, &countFaceConctv);
-                SuperClassWriter::writeData(domain->mesh->face_edges, face_edges, isCollective, 0, &startFaceConctv, &countFaceConctv);
-                SuperClassWriter::writeData(domain->mesh->edge_faces, edge_faces, isCollective, 0, &startEdgeFaces, &countEdgeFaces);
-                SuperClassWriter::writeData(domain->mesh->face_faces, face_faces, isCollective, 0, &startFaceConctv, &countFaceConctv);
-              }
-              setWrittenDomain(domid);
-            } // !isWrittenDomain
+              if (domain->isEmpty())
+               {
+                 startNodes[0]=0 ;
+                 countNodes[0]=0 ;
+               }
+               else
+               {
+                 startNodes[0] = domain->zoom_ibegin-domain->global_zoom_ibegin;
+                 countNodes[0] = domain->zoom_ni ;
+               }
+
+              SuperClassWriter::writeData(domain->mesh->node_lat, node_y, isCollective, 0, &startNodes, &countNodes);
+              SuperClassWriter::writeData(domain->mesh->node_lon, node_x, isCollective, 0, &startNodes, &countNodes);
+            }
+            else if (domain->nvertex == 2)
+            {
+              if (domain->isEmpty())
+               {
+                startEdges[0]=0 ;
+                countEdges[0]=0 ;
+                startNodes[0]=0 ;
+                countNodes[0]=0 ;
+                startEdgeNodes[0]=0;
+                startEdgeNodes[1]=0;
+                countEdgeNodes[0]=0;
+                countEdgeNodes[1]=0;
+
+               }
+               else
+               {
+                 startEdges[0] = domain->zoom_ibegin-domain->global_zoom_ibegin;
+                 countEdges[0] = domain->zoom_ni;
+                 startNodes[0] = domain->mesh->node_start;
+                 countNodes[0] = domain->mesh->node_count;
+                 startEdgeNodes[0] = domain->zoom_ibegin-domain->global_zoom_ibegin;
+                 startEdgeNodes[1] = 0;
+                 countEdgeNodes[0] = domain->zoom_ni;
+                 countEdgeNodes[1] = 2;
+               }
+              SuperClassWriter::writeData(domain->mesh->node_lat, node_y, isCollective, 0, &startNodes, &countNodes);
+              SuperClassWriter::writeData(domain->mesh->node_lon, node_x, isCollective, 0, &startNodes, &countNodes);
+              SuperClassWriter::writeData(domain->mesh->edge_lat, edge_y, isCollective, 0, &startEdges, &countEdges);
+              SuperClassWriter::writeData(domain->mesh->edge_lon, edge_x, isCollective, 0, &startEdges, &countEdges);
+              SuperClassWriter::writeData(domain->mesh->edge_nodes, edge_nodes, isCollective, 0, &startEdgeNodes, &countEdgeNodes);
+            }
             else
             {
-              if (domain->nvertex == 2)
-              {
-                startEdges[0] = domain->zoom_ibegin_srv-domain->global_zoom_ibegin;
-                countEdges[0] = domain->zoom_ni_srv ;
-                startEdgeNodes[0] = domain->zoom_ibegin_srv-domain->global_zoom_ibegin;
-                startEdgeNodes[1] = 0;
-                countEdgeNodes[0] = domain->zoom_ni_srv;
-                countEdgeNodes[1]= 2;
-                SuperClassWriter::writeData(domain->mesh->edge_lat, edge_y, isCollective, 0, &startEdges, &countEdges);
-                SuperClassWriter::writeData(domain->mesh->edge_lon, edge_x, isCollective, 0, &startEdges, &countEdges);
-                SuperClassWriter::writeData(domain->mesh->edge_nodes, edge_nodes, isCollective, 0, &startEdgeNodes, &countEdgeNodes);
-              }  
-              if (domain->nvertex > 2)
-              {
-
-                if (!domain->mesh->edgesAreWritten)
-                {
-                  startEdges[0] = domain->mesh->edge_start;
-                  countEdges[0] = domain->mesh->edge_count;
-                  startEdgeNodes[0] = domain->mesh->edge_start;
-                  startEdgeNodes[1] = 0;
-                  countEdgeNodes[0] = domain->mesh->edge_count;
-                  countEdgeNodes[1]= 2;
-                  SuperClassWriter::writeData(domain->mesh->edge_lat, edge_y, isCollective, 0, &startEdges, &countEdges);
-                  SuperClassWriter::writeData(domain->mesh->edge_lon, edge_x, isCollective, 0, &startEdges, &countEdges);
-                  SuperClassWriter::writeData(domain->mesh->edge_nodes, edge_nodes, isCollective, 0, &startEdgeNodes, &countEdgeNodes);
-                }
-                startFaces[0] = domain->zoom_ibegin_srv-domain->global_zoom_ibegin;
-                countFaces[0] = domain->zoom_ni_srv;
-                startEdgeFaces[0] = domain->mesh->edge_start;
-                startEdgeFaces[1]= 0;
-                countEdgeFaces[0] = domain->mesh->edge_count;
-                countEdgeFaces[1]= 2;
-                startFaceConctv[0] = domain->zoom_ibegin_srv-domain->global_zoom_ibegin;
-                startFaceConctv[1] = 0;
-                countFaceConctv[0] = domain->zoom_ni_srv;
-                countFaceConctv[1]= domain->nvertex;
-                SuperClassWriter::writeData(domain->mesh->face_lat, face_y, isCollective, 0, &startFaces, &countFaces);
-                SuperClassWriter::writeData(domain->mesh->face_lon, face_x, isCollective, 0, &startFaces, &countFaces);
-                SuperClassWriter::writeData(domain->mesh->face_nodes, face_nodes, isCollective, 0, &startFaceConctv, &countFaceConctv);
-                SuperClassWriter::writeData(domain->mesh->face_edges, face_edges, isCollective, 0, &startFaceConctv, &countFaceConctv);
-                SuperClassWriter::writeData(domain->mesh->edge_faces, edge_faces, isCollective, 0, &startEdgeFaces, &countEdgeFaces);
-                SuperClassWriter::writeData(domain->mesh->face_faces, face_faces, isCollective, 0, &startFaceConctv, &countFaceConctv);
-              }
-            }// isWrittenDomain
-
+              if (domain->isEmpty())
+               {
+                 startFaces[0] = 0 ;
+                 countFaces[0] = 0 ;
+                 startNodes[0] = 0;
+                 countNodes[0] = 0;
+                 startEdges[0] = 0;
+                 countEdges[0] = 0;
+                 startEdgeFaces[0] = 0;
+                 startEdgeFaces[1] = 0;
+                 countEdgeFaces[0] = 0;
+                 countEdgeFaces[1] = 0;
+                 startFaceConctv[0] = 0;
+                 startFaceConctv[1] = 0;
+                 countFaceConctv[0] = 0;
+                 countFaceConctv[1] = 0;
+               }
+               else
+               {
+                 startFaces[0] = domain->zoom_ibegin-domain->global_zoom_ibegin;
+                 countFaces[0] = domain->zoom_ni ;
+                 startNodes[0] = domain->mesh->node_start;
+                 countNodes[0] = domain->mesh->node_count;
+                 startEdges[0] = domain->mesh->edge_start;
+                 countEdges[0] = domain->mesh->edge_count;
+                 startEdgeNodes[0] = domain->mesh->edge_start;
+                 startEdgeNodes[1] = 0;
+                 countEdgeNodes[0] = domain->mesh->edge_count;
+                 countEdgeNodes[1]= 2;
+                 startEdgeFaces[0] = domain->mesh->edge_start;
+                 startEdgeFaces[1]= 0;
+                 countEdgeFaces[0] = domain->mesh->edge_count;
+                 countEdgeFaces[1]= 2;
+                 startFaceConctv[0] = domain->zoom_ibegin-domain->global_zoom_ibegin;
+                 startFaceConctv[1] = 0;
+                 countFaceConctv[0] = domain->zoom_ni;
+                 countFaceConctv[1] = domain->nvertex;
+               }
+              SuperClassWriter::writeData(domain->mesh->node_lat, node_y, isCollective, 0, &startNodes, &countNodes);
+              SuperClassWriter::writeData(domain->mesh->node_lon, node_x, isCollective, 0, &startNodes, &countNodes);
+              SuperClassWriter::writeData(domain->mesh->edge_lat, edge_y, isCollective, 0, &startEdges, &countEdges);
+              SuperClassWriter::writeData(domain->mesh->edge_lon, edge_x, isCollective, 0, &startEdges, &countEdges);
+              SuperClassWriter::writeData(domain->mesh->edge_nodes, edge_nodes, isCollective, 0, &startEdgeNodes, &countEdgeNodes);
+              SuperClassWriter::writeData(domain->mesh->face_lat, face_y, isCollective, 0, &startFaces, &countFaces);
+              SuperClassWriter::writeData(domain->mesh->face_lon, face_x, isCollective, 0, &startFaces, &countFaces);
+              SuperClassWriter::writeData(domain->mesh->face_nodes, face_nodes, isCollective, 0, &startFaceConctv, &countFaceConctv);
+              SuperClassWriter::writeData(domain->mesh->face_edges, face_edges, isCollective, 0, &startFaceConctv, &countFaceConctv);
+              SuperClassWriter::writeData(domain->mesh->edge_faces, edge_faces, isCollective, 0, &startEdgeFaces, &countEdgeFaces);
+              SuperClassWriter::writeData(domain->mesh->face_faces, face_faces, isCollective, 0, &startFaceConctv, &countFaceConctv);
+            }
             SuperClassWriter::definition_start();
 
@@ -867,5 +926,14 @@
          StdString appendDomid  = (singleDomain) ? "" : "_"+domid ;
 
-         StdString dimXid = StdString("cell").append(appendDomid);
+         StdString lonName,latName, cellName ;
+         if (domain->lon_name.isEmpty()) lonName = "lon";
+         else lonName = domain->lon_name;
+
+         if (domain->lat_name.isEmpty()) latName = "lat";
+         else latName = domain->lat_name;
+
+         if (!domain->dim_i_name.isEmpty()) cellName=domain->dim_i_name;
+         else cellName="cell";
+         StdString dimXid = cellName+appendDomid;
          StdString dimVertId = StdString("nvertex").append(appendDomid);
 
@@ -877,4 +945,68 @@
          else if (domain->prec==4)  typePrec =  NC_FLOAT ;
          else if (domain->prec==8)   typePrec =  NC_DOUBLE ;
+
+         int nvertex = (domain->nvertex.isEmpty()) ? 0 : domain->nvertex;
+
+         CArray<size_t, 1>& indexToWrite = domain->localIndexToWriteOnServer;
+         int nbWritten = indexToWrite.numElements();
+         CArray<double,1> writtenLat, writtenLon;
+         CArray<double,2> writtenBndsLat, writtenBndsLon;
+         CArray<double,1> writtenArea;
+
+         if (domain->hasLonLat)
+         {
+           writtenLat.resize(nbWritten);
+           writtenLon.resize(nbWritten);
+           for (int idx = 0; idx < nbWritten; ++idx)
+           {
+       	     if (idx < domain->latvalue.numElements())
+     	     {
+               writtenLat(idx) = domain->latvalue(indexToWrite(idx));
+               writtenLon(idx) = domain->lonvalue(indexToWrite(idx));
+     	     }
+     	     else
+     	     {
+               writtenLat(idx) = 0.;
+               writtenLon(idx) = 0.;
+     	     }
+           }
+         }
+         
+         if (domain->hasBounds)
+         {
+           int nvertex = domain->nvertex, idx;
+           writtenBndsLat.resize(nvertex, nbWritten);
+           writtenBndsLon.resize(nvertex, nbWritten);
+           CArray<double,2>& boundslat = domain->bounds_latvalue;
+           CArray<double,2>& boundslon = domain->bounds_lonvalue;
+           for (idx = 0; idx < nbWritten; ++idx)
+           {
+             for (int nv = 0; nv < nvertex; ++nv)
+             {
+               if (idx < boundslat.columns())
+               {
+                 writtenBndsLat(nv, idx) = boundslat(nv, int(indexToWrite(idx)));
+                 writtenBndsLon(nv, idx) = boundslon(nv, int(indexToWrite(idx)));
+               }
+               else
+               {
+                 writtenBndsLat(nv, idx) = 0.;
+                 writtenBndsLon(nv, idx) = 0.;
+                }
+             }
+           }
+         }
+
+         if (domain->hasArea)
+         {
+           writtenArea.resize(nbWritten);           
+           for (int idx = 0; idx < nbWritten; ++idx)
+           {
+        	  if (idx < domain->areavalue.numElements())
+                writtenArea(idx) = domain->areavalue(indexToWrite(idx));
+        	  else
+                writtenArea(idx) = 0.;
+           }
+         }
 
          try
@@ -885,14 +1017,17 @@
               {
                  dim0.push_back(dimXid);
-                 SuperClassWriter::addDimension(dimXid, domain->zoom_ni_srv);
-
-                 lonid = StdString("lon").append(appendDomid);
-                 latid = StdString("lat").append(appendDomid);
-                 bounds_lonid = StdString("bounds_lon").append(appendDomid);
-                 bounds_latid = StdString("bounds_lat").append(appendDomid);
+                 SuperClassWriter::addDimension(dimXid, domain->zoom_ni);
+
+                 lonid = lonName+appendDomid;
+                 latid = latName+appendDomid;
+                 if (!domain->bounds_lon_name.isEmpty()) bounds_lonid = domain->bounds_lon_name;
+                 else bounds_lonid = "bounds_"+lonName+appendDomid;
+                 if (!domain->bounds_lat_name.isEmpty()) bounds_latid = domain->bounds_lat_name;
+                 else bounds_latid = "bounds_"+latName+appendDomid;
+
                  if (domain->hasLonLat)
                  {
-                   SuperClassWriter::addVariable(latid, typePrec, dim0);
-                   SuperClassWriter::addVariable(lonid, typePrec, dim0);
+                   SuperClassWriter::addVariable(latid, typePrec, dim0, compressionLevel);
+                   SuperClassWriter::addVariable(lonid, typePrec, dim0, compressionLevel);
                    this->writeAxisAttributes(lonid, "", "longitude", "Longitude", "degrees_east", domid);
                    if (domain->hasBounds) SuperClassWriter::addAttribute("bounds",bounds_lonid, &lonid);
@@ -906,6 +1041,6 @@
                    dim0.push_back(dimXid);
                    dim0.push_back(dimVertId);
-                   SuperClassWriter::addVariable(bounds_lonid, typePrec, dim0);
-                   SuperClassWriter::addVariable(bounds_latid, typePrec, dim0);
+                   SuperClassWriter::addVariable(bounds_lonid, typePrec, dim0, compressionLevel);
+                   SuperClassWriter::addVariable(bounds_latid, typePrec, dim0, compressionLevel);
                  }
 
@@ -914,5 +1049,5 @@
                  if (domain->hasArea)
                  {
-                   SuperClassWriter::addVariable(areaId, typePrec, dim0);
+                   SuperClassWriter::addVariable(areaId, typePrec, dim0, compressionLevel);
                    SuperClassWriter::addAttribute("standard_name", StdString("cell_area"), &areaId);
                    SuperClassWriter::addAttribute("units", StdString("m2"), &areaId);
@@ -923,15 +1058,15 @@
                  if (domain->hasLonLat)
                  {
-                   SuperClassWriter::writeData(domain->latvalue_srv, latid, isCollective, 0);
-                   SuperClassWriter::writeData(domain->lonvalue_srv, lonid, isCollective, 0);
+                   SuperClassWriter::writeData(writtenLat, latid, isCollective, 0);
+                   SuperClassWriter::writeData(writtenLon, lonid, isCollective, 0);
                    if (domain->hasBounds)
                    {
-                     SuperClassWriter::writeData(domain->bounds_lon_srv, bounds_lonid, isCollective, 0);
-                     SuperClassWriter::writeData(domain->bounds_lat_srv, bounds_latid, isCollective, 0);
+                     SuperClassWriter::writeData(writtenBndsLon, bounds_lonid, isCollective, 0);
+                     SuperClassWriter::writeData(writtenBndsLat, bounds_latid, isCollective, 0);
                    }
                  }
 
                  if (domain->hasArea)
-                   SuperClassWriter::writeData(domain->area_srv, areaId, isCollective, 0);
+                   SuperClassWriter::writeData(writtenArea, areaId, isCollective, 0);
 
                  SuperClassWriter::definition_start();
@@ -941,14 +1076,17 @@
               case (ONE_FILE) :
               {
-                 lonid = StdString("lon").append(appendDomid);
-                 latid = StdString("lat").append(appendDomid);
-                 bounds_lonid = StdString("bounds_lon").append(appendDomid);
-                 bounds_latid = StdString("bounds_lat").append(appendDomid);
+                 lonid = lonName+appendDomid;
+                 latid = latName+appendDomid;
+                 if (!domain->bounds_lon_name.isEmpty()) bounds_lonid = domain->bounds_lon_name;
+                 else bounds_lonid = "bounds_"+lonName+appendDomid;
+                 if (!domain->bounds_lat_name.isEmpty()) bounds_latid = domain->bounds_lat_name;
+                 else bounds_latid = "bounds_"+latName+appendDomid;
+
                  dim0.push_back(dimXid);
                  SuperClassWriter::addDimension(dimXid, domain->ni_glo);
                  if (domain->hasLonLat)
                  {
-                   SuperClassWriter::addVariable(latid, typePrec, dim0);
-                   SuperClassWriter::addVariable(lonid, typePrec, dim0);
+                   SuperClassWriter::addVariable(latid, typePrec, dim0, compressionLevel);
+                   SuperClassWriter::addVariable(lonid, typePrec, dim0, compressionLevel);
 
                    this->writeAxisAttributes(lonid, "", "longitude", "Longitude", "degrees_east", domid);
@@ -956,5 +1094,5 @@
                    this->writeAxisAttributes(latid, "", "latitude", "Latitude", "degrees_north", domid);
                    if (domain->hasBounds) SuperClassWriter::addAttribute("bounds",bounds_latid, &latid);
-                   if (domain->hasBounds) SuperClassWriter::addDimension(dimVertId, domain->nvertex);
+                   if (domain->hasBounds) SuperClassWriter::addDimension(dimVertId, nvertex);
                  }
                  dim0.clear();
@@ -964,6 +1102,6 @@
                    dim0.push_back(dimXid);
                    dim0.push_back(dimVertId);
-                   SuperClassWriter::addVariable(bounds_lonid, typePrec, dim0);
-                   SuperClassWriter::addVariable(bounds_latid, typePrec, dim0);
+                   SuperClassWriter::addVariable(bounds_lonid, typePrec, dim0, compressionLevel);
+                   SuperClassWriter::addVariable(bounds_latid, typePrec, dim0, compressionLevel);
                  }
 
@@ -972,5 +1110,5 @@
                    dim0.clear();
                    dim0.push_back(dimXid);
-                   SuperClassWriter::addVariable(areaId, typePrec, dim0);
+                   SuperClassWriter::addVariable(areaId, typePrec, dim0, compressionLevel);
                    SuperClassWriter::addAttribute("standard_name", StdString("cell_area"), &areaId);
                    SuperClassWriter::addAttribute("units", StdString("m2"), &areaId);
@@ -986,5 +1124,5 @@
                    count[0]=0 ;
                    startBounds[1]=0 ;
-                   countBounds[1]=domain->nvertex ;
+                   countBounds[1]=nvertex ;
                    startBounds[0]=0 ;
                    countBounds[0]=0 ;
@@ -992,25 +1130,25 @@
                  else
                  {
-                   start[0]=domain->zoom_ibegin_srv-domain->global_zoom_ibegin;
-                   count[0]=domain->zoom_ni_srv ;
-                   startBounds[0]=domain->zoom_ibegin_srv-domain->global_zoom_ibegin;
+                   start[0]=domain->zoom_ibegin - domain->global_zoom_ibegin;
+                   count[0]=domain->zoom_ni;
+                   startBounds[0]=domain->zoom_ibegin-domain->global_zoom_ibegin;
                    startBounds[1]=0 ;
-                   countBounds[0]=domain->zoom_ni_srv ;
-                   countBounds[1]=domain->nvertex ;
+                   countBounds[0]=domain->zoom_ni;
+                   countBounds[1]=nvertex ;
                  }
 
                  if (domain->hasLonLat)
                  {
-                   SuperClassWriter::writeData(domain->latvalue_srv, latid, isCollective, 0,&start,&count);
-                   SuperClassWriter::writeData(domain->lonvalue_srv, lonid, isCollective, 0,&start,&count);
+                   SuperClassWriter::writeData(writtenLat, latid, isCollective, 0,&start,&count);
+                   SuperClassWriter::writeData(writtenLon, lonid, isCollective, 0,&start,&count);
                    if (domain->hasBounds)
                    {
-                     SuperClassWriter::writeData(domain->bounds_lon_srv, bounds_lonid, isCollective, 0,&startBounds,&countBounds);
-                     SuperClassWriter::writeData(domain->bounds_lat_srv, bounds_latid, isCollective, 0,&startBounds,&countBounds);
+                     SuperClassWriter::writeData(writtenBndsLon, bounds_lonid, isCollective, 0,&startBounds,&countBounds);
+                     SuperClassWriter::writeData(writtenBndsLat, bounds_latid, isCollective, 0,&startBounds,&countBounds);
                    }
                  }
 
                  if (domain->hasArea)
-                   SuperClassWriter::writeData(domain->area_srv, areaId, isCollective, 0, &start, &count);
+                   SuperClassWriter::writeData(writtenArea, areaId, isCollective, 0, &start, &count);
 
                  SuperClassWriter::definition_start();
@@ -1041,13 +1179,21 @@
         if (axis->IsWritten(this->filename)) return;
         axis->checkAttributes();
-        int zoom_size_srv  = axis->zoom_size_srv;
-        int zoom_begin_srv = axis->zoom_begin_srv;
-        int zoom_size  = (MULTI_FILE == SuperClass::type) ? zoom_size_srv
-                                                          : axis->global_zoom_size_srv;
-
-        if ((0 == zoom_size_srv) && (MULTI_FILE == SuperClass::type)) return;
+
+        axis->computeWrittenIndex();
+        axis->computeWrittenCompressedIndex(comm_file);
+       
+        int zoom_size  = (MULTI_FILE == SuperClass::type) ? axis->zoom_n.getValue()
+                                                          : axis->global_zoom_n.getValue();
+
+        int zoom_count = axis->zoom_n;                                                 
+        int zoom_begin = axis->zoom_begin;
+        // int zoom_begin = (MULTI_FILE == SuperClass::type) ? axis->global_zoom_begin 
+        //                                                   : axis->zoom_begin;
+
+        if ((0 == axis->zoom_n) && (MULTI_FILE == SuperClass::type)) return;
 
         std::vector<StdString> dims;
         StdString axisid = axis->getAxisOutputName();
+        StdString axisDim, axisBoundsId;
         if (isWrittenAxis(axisid)) return ;
         else setWrittenAxis(axisid);
@@ -1055,5 +1201,5 @@
         nc_type typePrec ;
         if (axis->prec.isEmpty()) typePrec =  NC_FLOAT ;
-        else if (axis->prec==4)  typePrec =  NC_FLOAT ;
+        else if (axis->prec==4)   typePrec =  NC_FLOAT ;
         else if (axis->prec==8)   typePrec =  NC_DOUBLE ;
          
@@ -1062,11 +1208,16 @@
         try
         {
-          SuperClassWriter::addDimension(axisid, zoom_size);
-          if (!axis->label.isEmpty()) SuperClassWriter::addDimension(strId, stringArrayLen);
-          if (axis->hasValue)
+          if (axis->dim_name.isEmpty()) axisDim = axisid;
+          else axisDim=axis->dim_name.getValue();
+          SuperClassWriter::addDimension(axisDim, zoom_size);
+          dims.push_back(axisDim);
+
+          if (!axis->label.isEmpty() && !SuperClassWriter::dimExist(strId)) SuperClassWriter::addDimension(strId, stringArrayLen);
+
+          if (axis->hasValue || !axis->label.isEmpty())
           {
-            dims.push_back(axisid);
             if (!axis->label.isEmpty()) dims.push_back(strId);
-            SuperClassWriter::addVariable(axisid, typePrec, dims);
+
+            SuperClassWriter::addVariable(axisid, typePrec, dims, compressionLevel);
 
             if (!axis->name.isEmpty())
@@ -1082,7 +1233,25 @@
               SuperClassWriter::addAttribute("units", axis->unit.getValue(), &axisid);
 
+            if (!axis->axis_type.isEmpty())
+            {
+              switch(axis->axis_type)
+              {
+              case CAxis::axis_type_attr::X :
+                SuperClassWriter::addAttribute("axis", string("X"), &axisid);
+                break;
+              case CAxis::axis_type_attr::Y :
+                SuperClassWriter::addAttribute("axis", string("Y"), &axisid);
+                break;
+              case CAxis::axis_type_attr::Z :
+                SuperClassWriter::addAttribute("axis", string("Z"), &axisid);
+                break;
+              case CAxis::axis_type_attr::T :
+                SuperClassWriter::addAttribute("axis", string("T"), &axisid);
+                break;
+              }
+            }
+
             if (!axis->positive.isEmpty())
             {
-              SuperClassWriter::addAttribute("axis", string("Z"), &axisid);
               SuperClassWriter::addAttribute("positive",
                                              (axis->positive == CAxis::positive_attr::up) ? string("up") : string("down"),
@@ -1090,57 +1259,144 @@
             }
 
-            StdString axisBoundsId = axisid + "_bounds";
-            if (!axis->bounds.isEmpty())
+            if (!axis->formula.isEmpty())
+              SuperClassWriter::addAttribute("formula", axis->formula.getValue(), &axisid);
+
+            if (!axis->formula_term.isEmpty())
+              SuperClassWriter::addAttribute("formula_term", axis->formula_term.getValue(), &axisid);
+              
+            axisBoundsId = (axis->bounds_name.isEmpty()) ? axisid + "_bounds" : axis->bounds_name;
+            if (!axis->bounds.isEmpty() && axis->label.isEmpty())
             {
               dims.push_back("axis_nbounds");
-              SuperClassWriter::addVariable(axisBoundsId, typePrec, dims);
+              SuperClassWriter::addVariable(axisBoundsId, typePrec, dims, compressionLevel);
               SuperClassWriter::addAttribute("bounds", axisBoundsId, &axisid);
+
+              if (!axis->standard_name.isEmpty())
+                SuperClassWriter::addAttribute("standard_name", axis->standard_name.getValue(), &axisBoundsId);
+
+              if (!axis->unit.isEmpty())
+                SuperClassWriter::addAttribute("units", axis->unit.getValue(), &axisBoundsId);
+
+              if (!axis->formula_bounds.isEmpty())
+                SuperClassWriter::addAttribute("formula", axis->formula_bounds.getValue(), &axisBoundsId);
+
+              if (!axis->formula_term_bounds.isEmpty())
+                SuperClassWriter::addAttribute("formula_term", axis->formula_term_bounds.getValue(), &axisBoundsId);
             }
-
-            SuperClassWriter::definition_end();
-
-            switch (SuperClass::type)
+          }
+
+          SuperClassWriter::definition_end();
+
+          CArray<size_t, 1>& indexToWrite = axis->localIndexToWriteOnServer;
+          int nbWritten = indexToWrite.numElements();
+          CArray<double,1> axis_value(indexToWrite.numElements());
+          if (!axis->value.isEmpty())
+          {
+            for (int i = 0; i < nbWritten; i++)
             {
-              case MULTI_FILE:
+              if (i < axis->value.numElements())
+                axis_value(i) = axis->value(indexToWrite(i));
+              else
+                axis_value(i) = 0.;
+            }
+          }
+          CArray<double,2> axis_bounds;
+          CArray<string,1> axis_label;
+          if (!axis->label.isEmpty())
+          {
+            axis_label.resize(indexToWrite.numElements());
+            for (int i = 0; i < nbWritten; i++)
+            {
+              if (i < axis->label.numElements())
+                axis_label(i) = axis->label(indexToWrite(i));
+              else
+                axis_label(i) = boost::lexical_cast<string>(0);  // Write 0 as a label
+            }
+          }
+
+          switch (SuperClass::type)
+          {
+            case MULTI_FILE:
+            {
+              if (axis->label.isEmpty())
               {
-                CArray<double,1> axis_value(zoom_size_srv);
-                for (int i = 0; i < zoom_size_srv; i++) axis_value(i) = axis->value_srv(i);
-                if (axis->label.isEmpty())  SuperClassWriter::writeData(axis_value, axisid, isCollective, 0);
-
-                if (!axis->bounds.isEmpty() && axis->label.isEmpty())
-                  SuperClassWriter::writeData(axis->bound_srv, axisBoundsId, isCollective, 0);
-
-                if (! axis->label.isEmpty())  SuperClassWriter::writeData(axis->label_srv, axisid, isCollective, 0);
- 
-                SuperClassWriter::definition_start();
-                break;
+                if (!axis->value.isEmpty())
+                  SuperClassWriter::writeData(axis_value, axisid, isCollective, 0);
+
+                if (!axis->bounds.isEmpty())
+                {
+                  axis_bounds.resize(2, indexToWrite.numElements());
+                  for (int i = 0; i < nbWritten; ++i)
+                  {
+                    if (i < axis->bounds.columns())
+                    {
+                      axis_bounds(0, i) = axis->bounds(0, int(indexToWrite(i)));
+                      axis_bounds(1, i) = axis->bounds(1, int(indexToWrite(i)));
+                    }
+                    else
+                    {
+                      axis_bounds(0, i) = 0.;
+                      axis_bounds(1, i) = 0.;
+
+                    }
+                  }
+                  SuperClassWriter::writeData(axis_bounds, axisBoundsId, isCollective, 0);
+                }
               }
-              case ONE_FILE:
+              else
+                SuperClassWriter::writeData(axis_label, axisid, isCollective, 0);
+
+              SuperClassWriter::definition_start();
+              break;
+            }
+            case ONE_FILE:
+            {
+              std::vector<StdSize> start(1), startBounds(2) ;
+              std::vector<StdSize> count(1), countBounds(2) ;
+              start[0] = startBounds[0] = zoom_begin - axis->global_zoom_begin;
+              count[0] = countBounds[0] = zoom_count; // zoom_size
+              startBounds[1] = 0;
+              countBounds[1] = 2;
+
+              if (axis->label.isEmpty())
               {
-                CArray<double,1> axis_value(zoom_size_srv);
-                axis_value = axis->value_srv;
-
-                std::vector<StdSize> start(1), startBounds(2) ;
-                std::vector<StdSize> count(1), countBounds(2) ;
-                start[0] = startBounds[0] = zoom_begin_srv-axis->global_zoom_begin_srv;
-                count[0] = countBounds[0] = zoom_size_srv;
-                startBounds[1] = 0;
-                countBounds[1] = 2;
-                if (axis->label.isEmpty()) SuperClassWriter::writeData(axis_value, axisid, isCollective, 0, &start, &count);
-
-                if (!axis->bounds.isEmpty()&& axis->label.isEmpty())
-                  SuperClassWriter::writeData(axis->bound_srv, axisBoundsId, isCollective, 0, &startBounds, &countBounds);
-
-                if (! axis->label.isEmpty())  SuperClassWriter::writeData(axis->label_srv, axisid, isCollective, 0);
-
-                SuperClassWriter::definition_start();
-
-                break;
+                if (!axis->value.isEmpty())
+                  SuperClassWriter::writeData(axis_value, axisid, isCollective, 0, &start, &count);
+
+                if (!axis->bounds.isEmpty())
+                {
+                  axis_bounds.resize(2, indexToWrite.numElements());
+                  for (int i = 0; i < nbWritten; ++i)
+                  {
+                    if (i < axis->bounds.columns())
+                    {
+                      axis_bounds(0, i) = axis->bounds(0, int(indexToWrite(i)));
+                      axis_bounds(1, i) = axis->bounds(1, int(indexToWrite(i)));
+                    }
+                    else
+                    {
+                      axis_bounds(0, i) = 0.;
+                      axis_bounds(1, i) = 0.;
+                    }
+                  }
+                  SuperClassWriter::writeData(axis_bounds, axisBoundsId, isCollective, 0, &startBounds, &countBounds);
+                }
               }
-              default :
-                ERROR("CNc4DataOutput::writeAxis_(CAxis* axis)",
-                      << "[ type = " << SuperClass::type << "]"
-                      << " not implemented yet !");
+              else
+              {
+                std::vector<StdSize> startLabel(2), countLabel(2);
+                startLabel[0] = start[0]; startLabel[1] = 0;
+                countLabel[0] = count[0]; countLabel[1] = stringArrayLen;
+                SuperClassWriter::writeData(axis_label, axisid, isCollective, 0, &startLabel, &countLabel);
+              }
+
+              SuperClassWriter::definition_start();
+
+              break;
             }
+            default :
+              ERROR("CNc4DataOutput::writeAxis_(CAxis* axis)",
+                    << "[ type = " << SuperClass::type << "]"
+                    << " not implemented yet !");
           }
         }
@@ -1165,4 +1421,5 @@
 
         StdString scalaId = scalar->getScalarOutputName();
+        StdString boundsId;
         if (isWrittenAxis(scalaId)) return ;
         else setWrittenAxis(scalaId);
@@ -1173,11 +1430,18 @@
         else if (scalar->prec==8)   typePrec =  NC_DOUBLE ;
 
-        
+        if (!scalar->label.isEmpty()) typePrec = NC_CHAR ;
+        string strId="str_len" ;
+
         try
         {
-          if (!scalar->value.isEmpty())
+          if (!scalar->label.isEmpty() && !SuperClassWriter::dimExist(strId)) SuperClassWriter::addDimension(strId, stringArrayLen);
+
+          if (!scalar->value.isEmpty() || !scalar->label.isEmpty())
           {
-//            dims.push_back(scalaId);
             std::vector<StdString> dims;
+            StdString scalarDim = scalaId;
+
+            if (!scalar->label.isEmpty()) dims.push_back(strId);
+
             SuperClassWriter::addVariable(scalaId, typePrec, dims);
 
@@ -1193,4 +1457,39 @@
             if (!scalar->unit.isEmpty())
               SuperClassWriter::addAttribute("units", scalar->unit.getValue(), &scalaId);
+
+            if (!scalar->axis_type.isEmpty())
+            {
+              switch(scalar->axis_type)
+              {
+              case CScalar::axis_type_attr::X :
+                SuperClassWriter::addAttribute("axis", string("X"), &scalaId);
+                break;
+              case CScalar::axis_type_attr::Y :
+                SuperClassWriter::addAttribute("axis", string("Y"), &scalaId);
+                break;
+              case CScalar::axis_type_attr::Z :
+                SuperClassWriter::addAttribute("axis", string("Z"), &scalaId);
+                break;
+              case CScalar::axis_type_attr::T :
+                SuperClassWriter::addAttribute("axis", string("T"), &scalaId);
+                break;
+              }
+            }
+
+            if (!scalar->positive.isEmpty())
+            {
+              SuperClassWriter::addAttribute("positive",
+                                             (scalar->positive == CScalar::positive_attr::up) ? string("up") : string("down"),
+                                             &scalaId);
+            }
+
+            if (!scalar->bounds.isEmpty() && scalar->label.isEmpty())
+            {
+              dims.clear();
+              dims.push_back("axis_nbounds");
+              boundsId = (scalar->bounds_name.isEmpty()) ? (scalaId + "_bounds") : scalar->bounds_name.getValue();
+              SuperClassWriter::addVariable(boundsId, typePrec, dims);
+              SuperClassWriter::addAttribute("bounds", boundsId, &scalaId);
+            }
 
             SuperClassWriter::definition_end();
@@ -1201,6 +1500,26 @@
               {
                 CArray<double,1> scalarValue(scalarSize);
-                scalarValue(0) = scalar->value;
-                SuperClassWriter::writeData(scalarValue, scalaId, isCollective, 0);
+                CArray<string,1> scalarLabel(scalarSize);
+                CArray<double,1> scalarBounds(scalarSize*2);
+
+                if (!scalar->value.isEmpty() && scalar->label.isEmpty())
+                {
+                  scalarValue(0) = scalar->value;
+                  SuperClassWriter::writeData(scalarValue, scalaId, isCollective, 0);
+                }
+
+                if (!scalar->bounds.isEmpty() && scalar->label.isEmpty())
+                {
+                  scalarBounds(0) = scalar->bounds(0);
+                  scalarBounds(1) = scalar->bounds(1);
+                  SuperClassWriter::writeData(scalarBounds, boundsId, isCollective, 0);
+                }
+
+                if (!scalar->label.isEmpty())
+                {
+                  scalarLabel(0) = scalar->label;
+                  SuperClassWriter::writeData(scalarLabel, scalaId, isCollective, 0);
+                }
+
                 SuperClassWriter::definition_start();
 
@@ -1210,5 +1529,6 @@
               {
                 CArray<double,1> scalarValue(scalarSize);
-                scalarValue(0) = scalar->value;
+                CArray<string,1> scalarLabel(scalarSize);
+                CArray<double,1> scalarBounds(scalarSize*2);
 
                 std::vector<StdSize> start(1);
@@ -1216,5 +1536,23 @@
                 start[0] = 0;
                 count[0] = 1;
-                SuperClassWriter::writeData(scalarValue, scalaId, isCollective, 0, &start, &count);
+                if (!scalar->value.isEmpty() && scalar->label.isEmpty())
+                {
+                  scalarValue(0) = scalar->value;
+                  SuperClassWriter::writeData(scalarValue, scalaId, isCollective, 0, &start, &count);
+                }
+                if (!scalar->bounds.isEmpty() && scalar->label.isEmpty())
+                {
+                  scalarBounds(0) = scalar->bounds(0);
+                  scalarBounds(1) = scalar->bounds(1);
+                  count[0] = 2;
+                  SuperClassWriter::writeData(scalarBounds, boundsId, isCollective, 0, &start, &count);
+                }
+                if (!scalar->label.isEmpty())
+                {
+                  scalarLabel(0) = scalar->label;
+                  count[0] = stringArrayLen;
+                  SuperClassWriter::writeData(scalarLabel, scalaId, isCollective, 0, &start, &count);
+                }
+
                 SuperClassWriter::definition_start();
 
@@ -1285,5 +1623,7 @@
                    break;
                  case CDomain::type_attr::unstructured:
-                   compress << "cell" << appendDomId;
+                   StdString cellName = (!domain->dim_i_name.isEmpty()) ? cellName=domain->dim_i_name : "cell";
+                   compress << cellName << appendDomId;
+//                   compress << "cell" << appendDomId;
                    break;
                }
@@ -1305,16 +1645,8 @@
              if (i != 0) compress << ' ';
            }
-           SuperClassWriter::addAttribute("compress", compress.str(), &varId);
-
-           grid->computeCompressedIndex();
+           SuperClassWriter::addAttribute("compress", compress.str(), &varId);         
 
            CArray<int, 1> indexes(grid->getNumberWrittenIndexes());
-           std::map<int, CArray<size_t, 1> >::const_iterator it;
-           for (it = grid->outIndexFromClient.begin(); it != grid->outIndexFromClient.end(); ++it)
-           {
-             const CArray<size_t, 1> compressedIndexes = grid->compressedOutIndexFromClient[it->first];
-             for (int i = 0; i < it->second.numElements(); i++)
-               indexes(compressedIndexes(i)) = it->second(i);
-           }
+           indexes = grid->localIndexToWriteOnServer;
 
            switch (SuperClass::type)
@@ -1373,13 +1705,13 @@
                }
 
-               const std::vector<int>& indexesToWrite = domain->getIndexesToWrite();
-               indexes.resize(indexesToWrite.size());
-               for (int n = 0; n < indexes.numElements(); ++n)
-                 indexes(n) = indexesToWrite[n];
+               // indexes.resize(domain->compressedIndexToWriteOnServer[comm_file].numElements());
+               // indexes = domain->compressedIndexToWriteOnServer[com_file];
+               indexes.resize(domain->getCompressedIndexToWriteOnServer(comm_file).numElements());
+               indexes = domain->getCompressedIndexToWriteOnServer(comm_file);
 
                isDistributed = domain->isDistributed();
-               nbIndexes = domain->getNumberWrittenIndexes();
-               totalNbIndexes = domain->getTotalNumberWrittenIndexes();
-               offset = domain->getOffsetWrittenIndexes();
+               nbIndexes = domain->getNumberWrittenIndexes(comm_file);
+               totalNbIndexes = domain->getTotalNumberWrittenIndexes(comm_file);
+               offset = domain->getOffsetWrittenIndexes(comm_file);
                firstGlobalIndex = domain->ibegin + domain->jbegin * domain->ni_glo;
 
@@ -1401,13 +1733,14 @@
                compress = axisId;
 
-               const std::vector<int>& indexesToWrite = axis->getIndexesToWrite();
-               indexes.resize(indexesToWrite.size());
-               for (int n = 0; n < indexes.numElements(); ++n)
-                 indexes(n) = indexesToWrite[n];
+               // indexes.resize(axis->compressedIndexToWriteOnServer.numElements());
+               // indexes = axis->compressedIndexToWriteOnServer;
+
+               indexes.resize(axis->getCompressedIndexToWriteOnServer(comm_file).numElements());
+               indexes = axis->getCompressedIndexToWriteOnServer(comm_file);
 
                isDistributed = axis->isDistributed();
-               nbIndexes = axis->getNumberWrittenIndexes();
-               totalNbIndexes = axis->getTotalNumberWrittenIndexes();
-               offset = axis->getOffsetWrittenIndexes();
+               nbIndexes = axis->getNumberWrittenIndexes(comm_file);
+               totalNbIndexes = axis->getTotalNumberWrittenIndexes(comm_file);
+               offset = axis->getOffsetWrittenIndexes(comm_file);
                firstGlobalIndex = axis->begin;
 
@@ -1449,8 +1782,5 @@
                }
              }
-           }
-
-           if (!dims.empty())
-             grid->computeCompressedIndex();
+            }
          }
 
@@ -1520,5 +1850,36 @@
             StdString domId = domain->getDomainOutputName();
             StdString appendDomId  = singleDomain ? "" : "_" + domId ;
-
+            StdString lonName,latName ;
+            StdString dimIname,dimJname ;
+
+            if (domain->lon_name.isEmpty())
+            { 
+              if (domain->type==CDomain::type_attr::curvilinear) lonName = "nav_lon";
+              else lonName = "lon";
+            }
+            else lonName = domain->lon_name;
+
+            if (domain->lat_name.isEmpty())
+            {
+              if (domain->type==CDomain::type_attr::curvilinear) latName = "nav_lat";
+              else latName = "lat";
+            }
+            else latName = domain->lat_name;
+
+            if (domain->dim_i_name.isEmpty())
+            {
+              if (domain->type==CDomain::type_attr::curvilinear) dimIname = "x";
+              else if (domain->type==CDomain::type_attr::unstructured) dimIname = "cell";
+              else dimIname = lonName;
+            }
+            else dimIname = domain->dim_i_name;
+
+            if (domain->dim_j_name.isEmpty())
+            {
+              if (domain->type==CDomain::type_attr::curvilinear) dimJname = "y";
+              else dimJname = latName;
+            }
+            else dimJname = domain->dim_j_name;
+        
             if (compressedOutput && domain->isCompressible() && domain->type != CDomain::type_attr::unstructured)
             {
@@ -1532,20 +1893,23 @@
                 if (!compressedOutput || !domain->isCompressible())
                 {
-                  dimXid     = StdString("x").append(appendDomId);
+                  dimXid=dimIname+appendDomId;
+                  dimYid=dimJname+appendDomId;
                   dimIdList.push_back(dimXid);
-                  dimYid     = StdString("y").append(appendDomId);
                   dimIdList.push_back(dimYid);
                 }
-                dimCoordList.push_back(StdString("nav_lon").append(appendDomId));
-                dimCoordList.push_back(StdString("nav_lat").append(appendDomId));
+                dimCoordList.push_back(lonName+appendDomId);
+                dimCoordList.push_back(latName+appendDomId);
               break ;
               case CDomain::type_attr::rectilinear:
                 if (!compressedOutput || !domain->isCompressible())
                 {
-                  dimXid     = StdString("lon").append(appendDomId);
+                  dimXid     = dimIname+appendDomId;
+                  dimYid     = dimJname+appendDomId;
                   dimIdList.push_back(dimXid);
-                  dimYid     = StdString("lat").append(appendDomId);
                   dimIdList.push_back(dimYid);
                 }
+                if (lonName != dimIname)  dimCoordList.push_back(lonName+appendDomId);
+                if (latName != dimJname)  dimCoordList.push_back(latName+appendDomId);
+
               break ;
               case CDomain::type_attr::unstructured:
@@ -1553,8 +1917,8 @@
                 if (SuperClassWriter::useCFConvention)
                 {
-                  dimXid     = StdString("cell").append(appendDomId);
+                  dimXid     = dimIname + appendDomId;
                   dimIdList.push_back(dimXid);
-                  dimCoordList.push_back(StdString("lon").append(appendDomId));
-                  dimCoordList.push_back(StdString("lat").append(appendDomId));
+                  dimCoordList.push_back(lonName+appendDomId);
+                  dimCoordList.push_back(latName+appendDomId);
                 }
                 else
@@ -1597,19 +1961,27 @@
             CAxis* axis = CAxis::get(axisList[idxAxis]);
             StdString axisId = axis->getAxisOutputName();
+            StdString axisDim;
+
+            if (axis->dim_name.isEmpty()) axisDim = axisId;
+            else axisDim=axis->dim_name.getValue();
 
             if (compressedOutput && axis->isCompressible())
             {
-              dimIdList.push_back(axisId + "_points");
+              dimIdList.push_back(axisDim + "_points");
               field->setUseCompressedOutput();
             }
             else
-              dimIdList.push_back(axisId);
-
-            dimCoordList.push_back(axisId);
+              dimIdList.push_back(axisDim);
+
+            if (axisDim != axisId) dimCoordList.push_back(axisId);
             ++idxAxis;
           }
-          else // scalar
+          else
           {
-             /* Do nothing here */
+            CScalar* scalar = CScalar::get(scalarList[idxScalar]);
+            StdString scalarId = scalar->getScalarOutputName();
+            if (!scalar->value.isEmpty() || !scalar->label.isEmpty())
+              dimCoordList.push_back(scalarId);
+            ++idxScalar;
           }
         }
@@ -1712,7 +2084,4 @@
           // write child variables as attributes
 
-
-           vector<CVariable*> listVars = field->getAllVariables() ;
-           for (vector<CVariable*>::iterator it = listVars.begin() ;it != listVars.end(); it++) writeAttribute_(*it, fieldid) ;
 
            bool alreadyAddCellMethod = false;
@@ -1776,10 +2145,19 @@
            if (!field->default_value.isEmpty())
            {
-              double default_value = field->default_value.getValue();
-              float fdefault_value = (float)default_value;
-              if (type == NC_DOUBLE)
-                 SuperClassWriter::setDefaultValue(fieldid, &default_value);
-              else
-                 SuperClassWriter::setDefaultValue(fieldid, &fdefault_value);
+             double default_value = field->default_value.getValue();
+             if (type == NC_DOUBLE)
+             {
+               SuperClassWriter::setDefaultValue(fieldid, &default_value);
+             }
+             else if (type == NC_SHORT)
+             {
+               short sdefault_value = (short)default_value;
+               SuperClassWriter::setDefaultValue(fieldid, &sdefault_value);
+             }
+             else
+             {
+               float fdefault_value = (float)default_value;
+               SuperClassWriter::setDefaultValue(fieldid, &fdefault_value);
+             }
            }
            else
@@ -1807,4 +2185,8 @@
 
            }
+
+           vector<CVariable*> listVars = field->getAllVariables() ;
+           for (vector<CVariable*>::iterator it = listVars.begin() ;it != listVars.end(); it++) writeAttribute_(*it, fieldid) ;
+
          }
          catch (CNetCdfException& e)
@@ -1840,8 +2222,8 @@
          try
          {
-           this->writeFileAttributes(filename, description,
-                                      conv_str,
-                                      StdString("An IPSL model"),
-                                      this->getTimeStamp());
+           if (!appendMode) this->writeFileAttributes(filename, description,
+                                                      conv_str,
+                                                      StdString("An IPSL model"),
+                                                      this->getTimeStamp());
 
            if (!appendMode)
@@ -1999,5 +2381,4 @@
           }
 
-          
         StdString fieldid = field->getFieldOutputName();
 
@@ -2041,5 +2422,4 @@
         if (wtime)
         {
-
           Time lastWrite = field->last_Write_srv;
           Time lastLastWrite = field->lastlast_Write_srv;
@@ -2184,6 +2564,6 @@
                         if (domain->isCompressible())
                         {
-                          start.push_back(domain->getOffsetWrittenIndexes());
-                          count.push_back(domain->getNumberWrittenIndexes());
+                          start.push_back(domain->getOffsetWrittenIndexes(comm_file));
+                          count.push_back(domain->getNumberWrittenIndexes(comm_file));
                           idx -= 2;
                         }
@@ -2208,6 +2588,6 @@
                         if (axis->isCompressible())
                         {
-                          start.push_back(axis->getOffsetWrittenIndexes());
-                          count.push_back(axis->getNumberWrittenIndexes());
+                          start.push_back(axis->getOffsetWrittenIndexes(comm_file));
+                          count.push_back(axis->getNumberWrittenIndexes(comm_file));
                         }
                         else
@@ -2225,5 +2605,4 @@
                 else
                 {
-
                   CArray<int,1> axisDomainOrder = grid->axis_domain_order;
                   std::vector<StdString> domainList = grid->getDomainList();
@@ -2231,5 +2610,5 @@
                   int numElement = axisDomainOrder.numElements();
                   int idxDomain = domainList.size() - 1, idxAxis = axisList.size() - 1;
-                  int idx = nZoomBeginGlobal.size() - 1;
+                  int idx = domainList.size() * 2 + axisList.size() - 1;// nZoomBeginGlobal.size() - 1;
 
                   start.reserve(nZoomBeginGlobal.size());
@@ -2243,10 +2622,11 @@
                       if ((domain->type) != CDomain::type_attr::unstructured)
                       {
-                        start.push_back(nZoomBeginServer[idx] - nZoomBeginGlobal[idx]);
-                        count.push_back(nZoomSizeServer[idx]);
+                        start.push_back(domain->zoom_jbegin - domain->global_zoom_jbegin);
+                        count.push_back(domain->zoom_nj);
                       }
                       --idx ;
-                      start.push_back(nZoomBeginServer[idx] - nZoomBeginGlobal[idx]);
-                      count.push_back(nZoomSizeServer[idx]);
+
+                        start.push_back(domain->zoom_ibegin - domain->global_zoom_ibegin);
+                        count.push_back(domain->zoom_ni);
                       --idx ;
                       --idxDomain;
@@ -2254,7 +2634,9 @@
                     else if (1 == axisDomainOrder(i))
                     {
-                      start.push_back(nZoomBeginServer[idx] - nZoomBeginGlobal[idx]);
-                      count.push_back(nZoomSizeServer[idx]);
+                        CAxis* axis = CAxis::get(axisList[idxAxis]);
+                        start.push_back(axis->zoom_begin - axis->global_zoom_begin);
+                        count.push_back(axis->zoom_n);
                       --idx;
+                      --idxAxis;
                     }
                     else
@@ -2779,10 +3161,10 @@
             {
               record = n + 1;
-             break;
+              break;
             }
           }
           it = timeToRecordCache.insert(std::make_pair(time, record)).first;
         }
-         return it->second;
+        return it->second;
       }
 
Index: /XIOS/trunk/src/io/nc4_data_output.hpp
===================================================================
--- /XIOS/trunk/src/io/nc4_data_output.hpp	(revision 1536)
+++ /XIOS/trunk/src/io/nc4_data_output.hpp	(revision 1537)
@@ -41,4 +41,5 @@
             bool singleDomain ;
             bool isCollective ;
+            int compressionLevel ;
                       
             CFile* file;
Index: /XIOS/trunk/src/io/netCdfInterface.cpp
===================================================================
--- /XIOS/trunk/src/io/netCdfInterface.cpp	(revision 1536)
+++ /XIOS/trunk/src/io/netCdfInterface.cpp	(revision 1537)
@@ -30,5 +30,5 @@
          << errormsg << std::endl
          << "Unable to create file, given its name: " << fileName
-         << "and its creation mode " << creationMode2String(cMode) << std::endl;
+         << " and its creation mode " << creationMode2String(cMode) << std::endl;
     StdString e = sstr.str();
     throw CNetCdfException(e);
@@ -748,5 +748,5 @@
   
   if (compressionLevel == 0) return NC_NOERR ;
-  int status = nc_def_var_deflate(ncid, varId, false, (compressionLevel > 0), compressionLevel);
+  int status = nc_def_var_deflate(ncid, varId, (compressionLevel > 0), (compressionLevel > 0), compressionLevel);
   if (NC_NOERR != status)
   {
Index: /XIOS/trunk/src/io/onetcdf4.cpp
===================================================================
--- /XIOS/trunk/src/io/onetcdf4.cpp	(revision 1536)
+++ /XIOS/trunk/src/io/onetcdf4.cpp	(revision 1537)
@@ -308,5 +308,5 @@
 
       int CONetCDF4::addVariable(const StdString& name, nc_type type,
-                                 const std::vector<StdString>& dim)
+                                 const std::vector<StdString>& dim, int compressionLevel)
       {
          int varid = 0;
@@ -350,4 +350,6 @@
          }
 
+         setCompressionLevel(name, compressionLevel) ;
+         
          return varid;
       }
Index: /XIOS/trunk/src/io/onetcdf4.hpp
===================================================================
--- /XIOS/trunk/src/io/onetcdf4.hpp	(revision 1536)
+++ /XIOS/trunk/src/io/onetcdf4.hpp	(revision 1537)
@@ -49,5 +49,5 @@
             int addDimension(const StdString& name, const StdSize size = UNLIMITED_DIM);
             int addVariable(const StdString& name, nc_type type,
-                            const std::vector<StdString>& dim);
+                            const std::vector<StdString>& dim, int compressionLevel=0);
 
       //----------------------------------------------------------------
Index: /XIOS/trunk/src/io/onetcdf4_decl.cpp
===================================================================
--- /XIOS/trunk/src/io/onetcdf4_decl.cpp	(revision 1536)
+++ /XIOS/trunk/src/io/onetcdf4_decl.cpp	(revision 1537)
@@ -17,4 +17,5 @@
  
   template void CONetCDF4::setDefaultValue<double>(const StdString & varname, const double* value) ;
+  template void CONetCDF4::setDefaultValue<short>(const StdString & varname, const short* value) ;
   template void CONetCDF4::setDefaultValue<float>(const StdString & varname, const float* value) ;
 }
Index: /XIOS/trunk/src/io/onetcdf4_impl.hpp
===================================================================
--- /XIOS/trunk/src/io/onetcdf4_impl.hpp	(revision 1536)
+++ /XIOS/trunk/src/io/onetcdf4_impl.hpp	(revision 1537)
@@ -60,24 +60,34 @@
     CTimer::get("CONetCDF4::writeData getWriteDataInfos").suspend();
  
+    int dimArrayLen;
+    for (int i=0; i<scount.size(); i++)
+      if (scount[i] == stringArrayLen)
+        dimArrayLen = i;
+
     if (data.numElements()*stringArrayLen != array_size)
     {
       ERROR("CONetCDF4::writeData(...)",
-      << "[ input array size = "  << data.numElements()
+      << "[ input array size = "  << data.numElements()*stringArrayLen
       << ", intern array size = " << array_size
       << " ] Invalid input data !" );
     }
-    char* ArrayStr ;
     char *PtrArrayStr ;
-    PtrArrayStr=ArrayStr=new char[data.numElements()*stringArrayLen] ;
+    PtrArrayStr=new char[stringArrayLen] ;
     Array<StdString,1>::const_iterator it, itb=data.begin(), ite=data.end() ;
-    for(it=itb;it!=ite;++it,PtrArrayStr+=stringArrayLen)
+    int lineNb = 0;
+    for(it=itb;it!=ite;++it)
     {
       it->copy(PtrArrayStr,it->size()) ;
       PtrArrayStr[it->size()]='\0' ;
+      sstart[0] = lineNb;
+      sstart[dimArrayLen] = 0;
+      scount[0] = 1;
+      scount[dimArrayLen] = it->size() + 1;
+      CTimer::get("CONetCDF4::writeData writeData_").resume();
+      this->writeData_(grpid, varid, sstart, scount, PtrArrayStr);
+      CTimer::get("CONetCDF4::writeData writeData_").suspend();
+      ++lineNb;
     }
-    CTimer::get("CONetCDF4::writeData writeData_").resume();
-    this->writeData_(grpid, varid, sstart, scount, ArrayStr);
-    CTimer::get("CONetCDF4::writeData writeData_").suspend();
-    delete [] ArrayStr ;
+    delete []  PtrArrayStr;
   }
 
Index: /XIOS/trunk/src/memtrack.cpp
===================================================================
--- /XIOS/trunk/src/memtrack.cpp	(revision 1536)
+++ /XIOS/trunk/src/memtrack.cpp	(revision 1537)
@@ -44,5 +44,4 @@
 #include <sstream>
 #include <string>
-
 #include <execinfo.h>
 
Index: /XIOS/trunk/src/node/axis.cpp
===================================================================
--- /XIOS/trunk/src/node/axis.cpp	(revision 1536)
+++ /XIOS/trunk/src/node/axis.cpp	(revision 1537)
@@ -10,7 +10,4 @@
 #include "context_server.hpp"
 #include "xios_spl.hpp"
-#include "inverse_axis.hpp"
-#include "zoom_axis.hpp"
-#include "interpolate_axis.hpp"
 #include "server_distribution_description.hpp"
 #include "client_server_mapping_distributed.hpp"
@@ -19,5 +16,5 @@
 namespace xios {
 
-   /// ////////////////////// DÃ©finitions ////////////////////// ///
+   /// ////////////////////// Definitions ////////////////////// ///
 
    CAxis::CAxis(void)
@@ -25,7 +22,9 @@
       , CAxisAttributes(), isChecked(false), relFiles(), areClientAttributesChecked_(false)
       , isClientAfterTransformationChecked(false)
-      , isDistributed_(false), hasBounds_(false), isCompressible_(false)
-      , numberWrittenIndexes_(0), totalNumberWrittenIndexes_(0), offsetWrittenIndexes_(0)
+      , hasBounds(false), isCompressible_(false)
+      , numberWrittenIndexes_(), totalNumberWrittenIndexes_(), offsetWrittenIndexes_()
       , transformationMap_(), hasValue(false), hasLabel(false)
+      , computedWrittenIndex_(false)
+	  , clients()
    {
    }
@@ -35,7 +34,9 @@
       , CAxisAttributes(), isChecked(false), relFiles(), areClientAttributesChecked_(false)
       , isClientAfterTransformationChecked(false)
-      , isDistributed_(false), hasBounds_(false), isCompressible_(false)
-      , numberWrittenIndexes_(0), totalNumberWrittenIndexes_(0), offsetWrittenIndexes_(0)
+      , hasBounds(false), isCompressible_(false)
+      , numberWrittenIndexes_(), totalNumberWrittenIndexes_(), offsetWrittenIndexes_()
       , transformationMap_(), hasValue(false), hasLabel(false)
+      , computedWrittenIndex_(false)
+	  , clients()
    {
    }
@@ -52,5 +53,9 @@
      m["inverse_axis"] = TRANS_INVERSE_AXIS;
      m["reduce_domain"] = TRANS_REDUCE_DOMAIN_TO_AXIS;
+     m["reduce_axis"] = TRANS_REDUCE_AXIS_TO_AXIS;
      m["extract_domain"] = TRANS_EXTRACT_DOMAIN_TO_AXIS;
+     m["temporal_splitting"] = TRANS_TEMPORAL_SPLITTING;
+     m["duplicate_scalar"] = TRANS_DUPLICATE_SCALAR_TO_AXIS;
+
    }
 
@@ -74,5 +79,10 @@
    bool CAxis::isDistributed(void) const
    {
-      return isDistributed_;
+      bool distributed = (!this->begin.isEmpty() && !this->n.isEmpty() && (this->begin + this->n < this->n_glo)) ||
+             (!this->n.isEmpty() && (this->n != this->n_glo));
+      // A same stupid condition to make sure that if there is only one client, axis
+      // should be considered to be distributed. This should be a temporary solution     
+      distributed |= (1 == CContext::getCurrent()->client->clientSize);
+      return distributed;
    }
 
@@ -99,16 +109,13 @@
    //----------------------------------------------------------------
 
-   const std::vector<int>& CAxis::getIndexesToWrite(void) const
-   {
-     return indexesToWrite;
-   }
-
    /*!
      Returns the number of indexes written by each server.
      \return the number of indexes written by each server
    */
-   int CAxis::getNumberWrittenIndexes() const
-   {
-     return numberWrittenIndexes_;
+   int CAxis::getNumberWrittenIndexes(MPI_Comm writtenCom)
+   {
+     int writtenSize;
+     MPI_Comm_size(writtenCom, &writtenSize);
+     return numberWrittenIndexes_[writtenSize];
    }
 
@@ -117,7 +124,9 @@
      \return the total number of indexes written by the servers
    */
-   int CAxis::getTotalNumberWrittenIndexes() const
-   {
-     return totalNumberWrittenIndexes_;
+   int CAxis::getTotalNumberWrittenIndexes(MPI_Comm writtenCom)
+   {
+     int writtenSize;
+     MPI_Comm_size(writtenCom, &writtenSize);
+     return totalNumberWrittenIndexes_[writtenSize];
    }
 
@@ -126,9 +135,17 @@
      \return the offset of indexes written by each server
    */
-   int CAxis::getOffsetWrittenIndexes() const
-   {
-     return offsetWrittenIndexes_;
-   }
-
+   int CAxis::getOffsetWrittenIndexes(MPI_Comm writtenCom)
+   {
+     int writtenSize;
+     MPI_Comm_size(writtenCom, &writtenSize);
+     return offsetWrittenIndexes_[writtenSize];
+   }
+
+   CArray<int, 1>& CAxis::getCompressedIndexToWriteOnServer(MPI_Comm writtenCom)
+   {
+     int writtenSize;
+     MPI_Comm_size(writtenCom, &writtenSize);
+     return compressedIndexToWriteOnServer[writtenSize];
+   }
    //----------------------------------------------------------------
 
@@ -138,11 +155,13 @@
     * \return A map associating the server rank with its minimum buffer size.
     */
-   std::map<int, StdSize> CAxis::getAttributesBufferSize()
-   {
-     CContextClient* client = CContext::getCurrent()->client;
-
-     std::map<int, StdSize> attributesSizes = getMinimumBufferSizeForAttributes();
-
-     bool isNonDistributed = (n == n_glo);
+   std::map<int, StdSize> CAxis::getAttributesBufferSize(CContextClient* client, const std::vector<int>& globalDim, int orderPositionInGrid,
+                                                         CServerDistributionDescription::ServerDistributionType distType)
+   {
+
+     std::map<int, StdSize> attributesSizes = getMinimumBufferSizeForAttributes(client);
+
+//     bool isNonDistributed = (n_glo == n);
+     bool isDistributed = (orderPositionInGrid == CServerDistributionDescription::defaultDistributedDimension(globalDim.size(), distType))
+    		                 || (index.numElements() != n_glo);
 
      if (client->isServerLeader())
@@ -151,6 +170,16 @@
        size_t size = 6 * sizeof(size_t);
        // size estimation for sendNonDistributedValue
-       if (isNonDistributed)
-         size = std::max(size, CArray<double,1>::size(n_glo) + (isCompressible_ ? CArray<int,1>::size(n_glo) : 0));
+       if (!isDistributed)
+       {
+//         size = std::max(size, CArray<double,1>::size(n_glo) + (isCompressible_ ? CArray<int,1>::size(n_glo) : 0));
+         size += CArray<int,1>::size(n_glo);
+         size += CArray<int,1>::size(n_glo);
+         size += CArray<bool,1>::size(n_glo);
+         size += CArray<double,1>::size(n_glo);
+         if (hasBounds)
+           size += CArray<double,2>::size(2*n_glo);
+         if (hasLabel)
+          size += CArray<StdString,1>::size(n_glo);
+       }
        size += CEventClient::headerSize + getId().size() + sizeof(size_t);
 
@@ -161,24 +190,30 @@
            attributesSizes[*itRank] = size;
        }
+       const std::list<int>& ranksNonLeaders = client->getRanksServerNotLeader();
+       for (std::list<int>::const_iterator itRank = ranksNonLeaders.begin(), itRankEnd = ranksNonLeaders.end(); itRank != itRankEnd; ++itRank)
+       {
+         if (size > attributesSizes[*itRank])
+           attributesSizes[*itRank] = size;
+       }
+
      }
 
-     if (!isNonDistributed)
+     if (isDistributed)
      {
        // size estimation for sendDistributedValue
-       std::map<int, std::vector<size_t> >::const_iterator it, ite = indSrv_.end();
-       for (it = indSrv_.begin(); it != ite; ++it)
+       boost::unordered_map<int, vector<size_t> >::const_iterator it, ite = indSrv_[client->serverSize].end();
+       for (it = indSrv_[client->serverSize].begin(); it != ite; ++it)
        {
-         size_t sizeIndexEvent = CArray<int,1>::size(it->second.size());
-         if (isCompressible_)
-           sizeIndexEvent += CArray<int,1>::size(indWrittenSrv_[it->first].size());
-
-         size_t sizeValEvent = CArray<double,1>::size(it->second.size());
-         if (hasBounds_)
-           sizeValEvent += CArray<double,2>::size(2 * it->second.size());
- 
+         size_t size = 6 * sizeof(size_t);
+         size += CArray<int,1>::size(it->second.size());
+         size += CArray<int,1>::size(it->second.size());
+         size += CArray<bool,1>::size(it->second.size());
+         size += CArray<double,1>::size(it->second.size());
+         if (hasBounds)
+           size += CArray<double,2>::size(2 * it->second.size());
          if (hasLabel)
-           sizeValEvent += CArray<StdString,1>::size(it->second.size());
-
-         size_t size = CEventClient::headerSize + getId().size() + sizeof(size_t) + std::max(sizeIndexEvent, sizeValEvent);
+           size += CArray<StdString,1>::size(it->second.size());
+
+         size += CEventClient::headerSize + getId().size() + sizeof(size_t);
          if (size > attributesSizes[it->first])
            attributesSizes[it->first] = size;
@@ -203,9 +238,8 @@
    }
 
-   void CAxis::fillInValues(const CArray<double,1>& values)
-   {
-     this->value = values;
-   }
-
+   /*!
+     Check common attributes of an axis.
+     This check should be done in the very beginning of work flow
+   */
    void CAxis::checkAttributes(void)
    {
@@ -250,28 +284,30 @@
       }
 
+      // Remove this check because it doen't make sense in case of a hole or overlapping axes
       if (!this->value.isEmpty())
       {
-        StdSize true_size = value.numElements();
-        if (this->n.getValue() != true_size)
-          ERROR("CAxis::checkAttributes(void)",
-                << "[ id = '" << getId() << "' , context = '" << CObjectFactory::GetCurrentContextId() << "' ] "
-                << "The axis is wrongly defined, attribute 'value' has a different size (" << true_size << ") than the one defined by the \'size\' attribute (" << n.getValue() << ").");
+//        StdSize true_size = value.numElements();
+//        if (this->n.getValue() != true_size)
+//          ERROR("CAxis::checkAttributes(void)",
+//                << "[ id = '" << getId() << "' , context = '" << CObjectFactory::GetCurrentContextId() << "' ] "
+//                << "The axis is wrongly defined, attribute 'value' has a different size (" << true_size << ") than the one defined by the \'size\' attribute (" << n.getValue() << ").");
         this->hasValue = true;
       }
 
-      this->checkData();
-      this->checkZoom();
-      this->checkMask();
       this->checkBounds();
-      this->checkLabel();
-
-      isDistributed_ = (!this->begin.isEmpty() && !this->n.isEmpty() && (this->begin + this->n < this->n_glo)) ||
-                       (!this->n.isEmpty() && (this->n != this->n_glo));
-
-      // A same stupid condition to make sure that if there is only one client, axis
-      // should be considered to be distributed. This should be a temporary solution     
-      isDistributed_ |= (1 == CContext::getCurrent()->client->clientSize);
-   }
-
+
+      CContext* context=CContext::getCurrent();
+      if (context->hasClient)
+      {
+        this->checkData();
+        this->checkZoom();
+        this->checkMask();
+        this->checkLabel();
+      }
+   }
+
+   /*!
+      Check the validity of data and fill in values if any.
+   */
    void CAxis::checkData()
    {
@@ -296,10 +332,28 @@
    }
 
+   /*!
+     Check validity of zoom info and fill in values if any.
+   */
    void CAxis::checkZoom(void)
    {
      if (global_zoom_begin.isEmpty()) global_zoom_begin.setValue(0);
      if (global_zoom_n.isEmpty()) global_zoom_n.setValue(n_glo.getValue());
-   }
-
+     if (zoom_index.isEmpty())
+     {
+       zoom_index.setValue(index.getValue());
+     }
+     if (zoom_n.isEmpty()) zoom_n.setValue(n);
+     if (zoom_begin.isEmpty()) zoom_begin.setValue(begin);
+   }
+
+    size_t CAxis::getGlobalWrittenSize(void)
+    {
+      if (zoomByIndex()) return  global_zoom_index.numElements();
+      else return global_zoom_n ;
+    }
+
+   /*!
+     Check validity of mask info and fill in values if any.
+   */
    void CAxis::checkMask()
    {
@@ -323,17 +377,20 @@
    }
 
-  void CAxis::checkBounds()
-  {
-    if (!bounds.isEmpty())
-    {
-      if (bounds.extent(0) != 2 || bounds.extent(1) != n)
-        ERROR("CAxis::checkAttributes(void)",
-              << "The bounds array of the axis [ id = '" << getId() << "' , context = '" << CObjectFactory::GetCurrentContextId() << "' ] must be of dimension 2 x axis size." << std::endl
-              << "Axis size is " << n.getValue() << "." << std::endl
-              << "Bounds size is "<< bounds.extent(0) << " x " << bounds.extent(1) << ".");
-      hasBounds_ = true;
-    }
-    else hasBounds_ = false;
-  }
+   /*!
+     Check validity of bounds info and fill in values if any.
+   */
+   void CAxis::checkBounds()
+   {
+     if (!bounds.isEmpty())
+     {
+       if (bounds.extent(0) != 2 || bounds.extent(1) != n)
+         ERROR("CAxis::checkAttributes(void)",
+               << "The bounds array of the axis [ id = '" << getId() << "' , context = '" << CObjectFactory::GetCurrentContextId() << "' ] must be of dimension 2 x axis size." << std::endl
+               << "Axis size is " << n.getValue() << "." << std::endl
+               << "Bounds size is "<< bounds.extent(0) << " x " << bounds.extent(1) << ".");
+       hasBounds = true;
+     }
+     else hasBounds = false;
+   }
 
   void CAxis::checkLabel()
@@ -350,4 +407,8 @@
     else hasLabel = false;
   }
+
+  /*!
+    Check whether we can do compressed output
+  */
   void CAxis::checkEligibilityForCompressedOutput()
   {
@@ -356,4 +417,8 @@
   }
 
+  /*
+    Check whether we do zooming by indexing
+    return true if do zooming by index
+  */
   bool CAxis::zoomByIndex()
   {
@@ -361,44 +426,51 @@
   }
 
+  /*!
+    Dispatch event from the lower communication layer then process event according to its type
+  */
   bool CAxis::dispatchEvent(CEventServer& event)
-   {
-      if (SuperClass::dispatchEvent(event)) return true;
-      else
-      {
-        switch(event.type)
-        {
-           case EVENT_ID_SERVER_ATTRIBUT :
-             recvServerAttribut(event);
-             return true;
-             break;
-           case EVENT_ID_INDEX:
-            recvIndex(event);
+  {
+     if (SuperClass::dispatchEvent(event)) return true;
+     else
+     {
+       switch(event.type)
+       {
+          case EVENT_ID_DISTRIBUTION_ATTRIBUTE :
+            recvDistributionAttribute(event);
             return true;
             break;
-          case EVENT_ID_DISTRIBUTED_VALUE:
-            recvDistributedValue(event);
-            return true;
-            break;
-          case EVENT_ID_NON_DISTRIBUTED_VALUE:
-            recvNonDistributedValue(event);
-            return true;
-            break;
-           default :
-             ERROR("bool CAxis::dispatchEvent(CEventServer& event)",
-                    << "Unknown Event");
-           return false;
-         }
-      }
-   }
-
+         case EVENT_ID_NON_DISTRIBUTED_ATTRIBUTES:
+           recvNonDistributedAttributes(event);
+           return true;
+           break;
+         case EVENT_ID_DISTRIBUTED_ATTRIBUTES:
+           recvDistributedAttributes(event);
+           return true;
+           break;
+          default :
+            ERROR("bool CAxis::dispatchEvent(CEventServer& event)",
+                   << "Unknown Event");
+          return false;
+        }
+     }
+  }
+
+   /*!
+     Check attributes on client side (This name is still adequate???)
+   */
    void CAxis::checkAttributesOnClient()
    {
      if (this->areClientAttributesChecked_) return;
 
-     this->checkAttributes();
+     CContext* context=CContext::getCurrent();
+     if (context->hasClient && !context->hasServer) this->checkAttributes();
 
      this->areClientAttributesChecked_ = true;
    }
 
+   /*
+     The (spatial) transformation sometimes can change attributes of an axis (e.g zoom can change mask or generate can change whole attributes)
+     Therefore, we should recheck them.
+   */
    void CAxis::checkAttributesOnClientAfterTransformation(const std::vector<int>& globalDim, int orderPositionInGrid,
                                                           CServerDistributionDescription::ServerDistributionType distType)
@@ -408,6 +480,8 @@
      if (this->isClientAfterTransformationChecked) return;
      if (context->hasClient)
-     {
-       if (n.getValue() != n_glo.getValue()) computeConnectedServer(globalDim, orderPositionInGrid, distType);
+     {        
+       if (orderPositionInGrid == CServerDistributionDescription::defaultDistributedDimension(globalDim.size(), distType))
+         computeConnectedClients(globalDim, orderPositionInGrid, distType);
+       else if (index.numElements() != n_glo) computeConnectedClients(globalDim, orderPositionInGrid,  CServerDistributionDescription::ROOT_DISTRIBUTION);
      }
 
@@ -415,5 +489,11 @@
    }
 
-   // Send all checked attributes to server
+   /*
+     Send all checked attributes to server? (We dont have notion of server any more so client==server)
+     \param [in] globalDim global dimension of grid containing this axis
+     \param [in] orderPositionInGrid the relative order of this axis in the grid (e.g grid composed of domain+axis -> orderPositionInGrid is 2)
+     \param [in] distType distribution type of the server. For now, we only have band distribution.
+
+   */
    void CAxis::sendCheckedAttributes(const std::vector<int>& globalDim, int orderPositionInGrid,
                                      CServerDistributionDescription::ServerDistributionType distType)
@@ -424,382 +504,546 @@
 
      if (this->isChecked) return;
-     if (context->hasClient)
+     if (context->hasClient) sendAttributes(globalDim, orderPositionInGrid, distType);    
+
+     this->isChecked = true;
+   }
+
+  /*!
+    Send attributes from one client to other clients
+    \param[in] globalDim global dimension of grid which contains this axis
+    \param[in] order
+  */
+  void CAxis::sendAttributes(const std::vector<int>& globalDim, int orderPositionInGrid,
+                             CServerDistributionDescription::ServerDistributionType distType)
+  {
+     sendDistributionAttribute(globalDim, orderPositionInGrid, distType);
+
+     // if (index.numElements() == n_glo.getValue())
+     if ((orderPositionInGrid == CServerDistributionDescription::defaultDistributedDimension(globalDim.size(), distType))
+         || (index.numElements() != n_glo))
      {
-       sendServerAttribut(globalDim, orderPositionInGrid, distType);
-       if (hasValue) sendValue();
+       sendDistributedAttributes();       
      }
-
-     this->isChecked = true;
-   }
-
-  void CAxis::sendValue()
-  {
-     if (n.getValue() == n_glo.getValue())
-       sendNonDistributedValue();
      else
-       sendDistributedValue();
-  }
-
-  void CAxis::computeConnectedServer(const std::vector<int>& globalDim, int orderPositionInGrid,
+     {
+       sendNonDistributedAttributes();    
+     }     
+  }
+
+  /*
+    Compute the connection between group of clients (or clients/servers).
+    (E.g: Suppose we have 2 group of clients in two model: A (client role) connect to B (server role),
+    this function calculate number of clients B connect to one client of A)
+     \param [in] globalDim global dimension of grid containing this axis
+     \param [in] orderPositionInGrid the relative order of this axis in the grid (e.g grid composed of domain+axis -> orderPositionInGrid is 2)
+     \param [in] distType distribution type of the server. For now, we only have band distribution.
+  */
+  void CAxis::computeConnectedClients(const std::vector<int>& globalDim, int orderPositionInGrid,
                                      CServerDistributionDescription::ServerDistributionType distType)
   {
     CContext* context = CContext::getCurrent();
-    CContextClient* client = context->client;
-    int nbServer = client->serverSize;
-    int range, clientSize = client->clientSize;
-    int rank = client->clientRank;
-
-    size_t ni = this->n.getValue();
-    size_t ibegin = this->begin.getValue();
-    size_t zoom_end = global_zoom_begin+global_zoom_n-1;
-    size_t nZoomCount = 0;
-    size_t nbIndex = index.numElements();
-
-    int end = (0 == n) ? begin : begin + n - 1;
-    int zoom_size = zoomByIndex() ? global_zoom_index.numElements() : global_zoom_n;
-    int minInd = min(index);
-    int maxInd = max(index);
-    for (size_t idx = 0; idx < zoom_size; ++idx)
-    {
-      size_t globalZoomIndex = zoomByIndex() ? global_zoom_index(idx) : global_zoom_begin + idx;
-      if (globalZoomIndex >= minInd && globalZoomIndex <= maxInd) ++nZoomCount;
-    }
-
-/*    for (size_t idx = 0; idx < nbIndex; ++idx)
-    {
-      size_t globalIndex = index(idx);
-      if (globalIndex >= global_zoom_begin && globalIndex <= zoom_end) ++nZoomCount;
-    }*/
+
+    int nbSrvPools = (context->hasServer) ? (context->hasClient ? context->clientPrimServer.size() : 1) : 1;
+
+    connectedServerRank_.clear();
+    nbSenders.clear();
+
+    for (int p = 0; p < nbSrvPools; ++p)
+    {
+      CContextClient* client = (0 != context->clientPrimServer.size()) ? context->clientPrimServer[p] : context->client;
+      int nbServer = client->serverSize;
+      int range, clientSize = client->clientSize;
+      int rank = client->clientRank;
+
+      if (connectedServerRank_.find(nbServer) == connectedServerRank_.end())
+      {
+        size_t ni = this->n.getValue();
+        size_t ibegin = this->begin.getValue();
+        size_t global_zoom_end = global_zoom_begin+global_zoom_n-1;
+        size_t nZoomCount = 0;
+        size_t nbIndex = index.numElements();
+
+        // First of all, we should compute the mapping of the global index and local index of the current client
+        if (globalLocalIndexMap_.empty())
+        {
+          for (size_t idx = 0; idx < nbIndex; ++idx)
+          {
+            globalLocalIndexMap_[index(idx)] = idx;
+          }
+        }
+
+        // Calculate the compressed index if any
+        std::set<int> writtenInd;
+        if (isCompressible_)
+        {
+          for (int idx = 0; idx < data_index.numElements(); ++idx)
+          {
+            int ind = CDistributionClient::getAxisIndex(data_index(idx), data_begin, ni);
+
+            if (ind >= 0 && ind < ni && mask(ind))
+            {
+              ind += ibegin;
+              if (ind >= global_zoom_begin && ind <= global_zoom_end)
+                writtenInd.insert(ind);
+            }
+          }
+        }
+
+        // Compute the global index of the current client (process) hold
+        std::vector<int> nGlobAxis(1);
+        nGlobAxis[0] = n_glo.getValue();
+
+        size_t globalSizeIndex = 1, indexBegin, indexEnd;
+        for (int i = 0; i < nGlobAxis.size(); ++i) globalSizeIndex *= nGlobAxis[i];
+        indexBegin = 0;
+        if (globalSizeIndex <= clientSize)
+        {
+          indexBegin = rank%globalSizeIndex;
+          indexEnd = indexBegin;
+        }
+        else
+        {
+          for (int i = 0; i < clientSize; ++i)
+          {
+            range = globalSizeIndex / clientSize;
+            if (i < (globalSizeIndex%clientSize)) ++range;
+            if (i == client->clientRank) break;
+            indexBegin += range;
+          }
+          indexEnd = indexBegin + range - 1;
+        }
+
+        CArray<size_t,1> globalIndex(index.numElements());
+        for (size_t idx = 0; idx < globalIndex.numElements(); ++idx)
+          globalIndex(idx) = index(idx);
+
+        // Describe the distribution of server side
+
+        CServerDistributionDescription serverDescription(nGlobAxis, nbServer, distType);
+      
+        std::vector<int> serverZeroIndex;
+        serverZeroIndex = serverDescription.computeServerGlobalIndexInRange(std::make_pair<size_t,size_t>(indexBegin, indexEnd), 0);      
+
+        std::list<int> serverZeroIndexLeader;
+        std::list<int> serverZeroIndexNotLeader; 
+        CContextClient::computeLeader(client->clientRank, client->clientSize, serverZeroIndex.size(), serverZeroIndexLeader, serverZeroIndexNotLeader);
+        for (std::list<int>::iterator it = serverZeroIndexLeader.begin(); it != serverZeroIndexLeader.end(); ++it)
+          *it = serverZeroIndex[*it];
+
+        // Find out the connection between client and server side
+        CClientServerMapping* clientServerMap = new CClientServerMappingDistributed(serverDescription.getGlobalIndexRange(), client->intraComm);
+        clientServerMap->computeServerIndexMapping(globalIndex, nbServer);
+        CClientServerMapping::GlobalIndexMap& globalIndexAxisOnServer = clientServerMap->getGlobalIndexOnServer();      
+
+        indSrv_[nbServer].swap(globalIndexAxisOnServer);
+
+        if (distType==CServerDistributionDescription::ROOT_DISTRIBUTION)
+        {
+          for(int i=1; i<nbServer; ++i) indSrv_[nbServer].insert(pair<int, vector<size_t> >(i,indSrv_[nbServer][0]) ) ;
+          serverZeroIndexLeader.clear() ;
+        }
+         
+        CClientServerMapping::GlobalIndexMap::const_iterator it  = indSrv_[nbServer].begin(),
+                                                             ite = indSrv_[nbServer].end();
+
+        for (it = indSrv_[nbServer].begin(); it != ite; ++it) connectedServerRank_[nbServer].push_back(it->first);
+
+        for (std::list<int>::const_iterator it = serverZeroIndexLeader.begin(); it != serverZeroIndexLeader.end(); ++it)
+          connectedServerRank_[nbServer].push_back(*it);
+
+         // Even if a client has no index, it must connect to at least one server and 
+         // send an "empty" data to this server
+         if (connectedServerRank_[nbServer].empty())
+          connectedServerRank_[nbServer].push_back(client->clientRank % client->serverSize);
+
+         nbSenders[nbServer] = CClientServerMapping::computeConnectedClients(client->serverSize, client->clientSize, client->intraComm, connectedServerRank_[nbServer]);
+
+        delete clientServerMap;
+      }
+    }
+  }
+
+  /*
+    Compute the index of data to write into file
+    (Different from the previous version, this version of XIOS allows data be written into file (classical role),
+    or transfered to another clients)
+  */
+  void CAxis::computeWrittenIndex()
+  {  
+    if (computedWrittenIndex_) return;
+    computedWrittenIndex_ = true;
+
+    CContext* context=CContext::getCurrent();      
+    CContextServer* server = context->server; 
+
+    // We describe the distribution of client (server) on which data are written
+    std::vector<int> nBegin(1), nSize(1), nBeginGlobal(1), nGlob(1);
+    nBegin[0]       = zoom_begin;
+    nSize[0]        = zoom_n;   
+    nBeginGlobal[0] = 0; 
+    nGlob[0]        = n_glo;
+    CDistributionServer srvDist(server->intraCommSize, nBegin, nSize, nBeginGlobal, nGlob); 
+    const CArray<size_t,1>& writtenGlobalIndex  = srvDist.getGlobalIndex();
+
+    // Because all written data are local on a client, 
+    // we need to compute the local index on the server from its corresponding global index
+    size_t nbWritten = 0, indGlo;      
+    boost::unordered_map<size_t,size_t>::const_iterator itb = globalLocalIndexMap_.begin(),
+                                                        ite = globalLocalIndexMap_.end(), it;          
+    CArray<size_t,1>::const_iterator itSrvb = writtenGlobalIndex.begin(),
+                                     itSrve = writtenGlobalIndex.end(), itSrv;  
+    if (!zoomByIndex())
+    {   
+      for (itSrv = itSrvb; itSrv != itSrve; ++itSrv)
+      {
+        indGlo = *itSrv;
+        if (ite != globalLocalIndexMap_.find(indGlo))
+        {          
+          ++nbWritten;
+        }                 
+      }
+
+      localIndexToWriteOnServer.resize(writtenGlobalIndex.numElements());
+//      localIndexToWriteOnServer.resize(nbWritten);
+
+      nbWritten = 0;
+      for (itSrv = itSrvb; itSrv != itSrve; ++itSrv)
+      {
+        indGlo = *itSrv;
+        if (ite != globalLocalIndexMap_.find(indGlo))
+        {
+          localIndexToWriteOnServer(nbWritten) = globalLocalIndexMap_[indGlo];
+          ++nbWritten;
+        }                 
+      }
+    }
+    else
+    {
+      nbWritten = 0;
+      boost::unordered_map<size_t,size_t>::const_iterator itb = globalLocalIndexMap_.begin(),
+                                                          ite = globalLocalIndexMap_.end(), it;
+      for (int i = 0; i < zoom_index.numElements(); ++i)
+      {
+         if (ite != globalLocalIndexMap_.find(zoom_index(i)))
+          ++nbWritten;
+      }
+
+      localIndexToWriteOnServer.resize(nbWritten);
+
+      nbWritten = 0;
+      for (int i = 0; i < zoom_index.numElements(); ++i)
+      {
+         if (ite != globalLocalIndexMap_.find(zoom_index(i)))
+         {
+           localIndexToWriteOnServer(nbWritten) = globalLocalIndexMap_[zoom_index(i)];
+           ++nbWritten;
+         }
+      }
+    }
+
+    // if (isCompressible())
+    // {
+    //   nbWritten = 0;
+    //   boost::unordered_map<size_t,size_t> localGlobalIndexMap;
+    //   for (itSrv = itSrvb; itSrv != itSrve; ++itSrv)
+    //   {
+    //     indGlo = *itSrv;
+    //     if (ite != globalLocalIndexMap_.find(indGlo))
+    //     {
+    //       localGlobalIndexMap[localIndexToWriteOnServer(nbWritten)] = indGlo;
+    //       ++nbWritten;
+    //     }                 
+    //   }
+
+    //   nbWritten = 0;
+    //   for (int idx = 0; idx < data_index.numElements(); ++idx)
+    //   {
+    //     if (localGlobalIndexMap.end() != localGlobalIndexMap.find(data_index(idx)))
+    //     {
+    //       ++nbWritten;
+    //     }
+    //   }
+
+    //   compressedIndexToWriteOnServer.resize(nbWritten);
+    //   nbWritten = 0;
+    //   for (int idx = 0; idx < data_index.numElements(); ++idx)
+    //   {
+    //     if (localGlobalIndexMap.end() != localGlobalIndexMap.find(data_index(idx)))
+    //     {
+    //       compressedIndexToWriteOnServer(nbWritten) = localGlobalIndexMap[data_index(idx)];
+    //       ++nbWritten;
+    //     }
+    //   }
+
+    //   numberWrittenIndexes_ = nbWritten;
+    //   if (isDistributed())
+    //   {
+             
+    //     MPI_Allreduce(&numberWrittenIndexes_, &totalNumberWrittenIndexes_, 1, MPI_INT, MPI_SUM, server->intraComm);
+    //     MPI_Scan(&numberWrittenIndexes_, &offsetWrittenIndexes_, 1, MPI_INT, MPI_SUM, server->intraComm);
+    //     offsetWrittenIndexes_ -= numberWrittenIndexes_;
+    //   }
+    //   else
+    //     totalNumberWrittenIndexes_ = numberWrittenIndexes_;
+    // }
+  }
+
+  void CAxis::computeWrittenCompressedIndex(MPI_Comm writtenComm)
+  {
+    int writtenCommSize;
+    MPI_Comm_size(writtenComm, &writtenCommSize);
+    if (compressedIndexToWriteOnServer.find(writtenCommSize) != compressedIndexToWriteOnServer.end())
+      return;
+
+    if (isCompressible())
+    {
+      size_t nbWritten = 0, indGlo;
+      CContext* context=CContext::getCurrent();      
+      CContextServer* server = context->server; 
+
+      // We describe the distribution of client (server) on which data are written
+      std::vector<int> nBegin(1), nSize(1), nBeginGlobal(1), nGlob(1);
+      nBegin[0]       = zoom_begin;
+      nSize[0]        = zoom_n;   
+      nBeginGlobal[0] = 0; 
+      nGlob[0]        = n_glo;
+      CDistributionServer srvDist(server->intraCommSize, nBegin, nSize, nBeginGlobal, nGlob); 
+      const CArray<size_t,1>& writtenGlobalIndex  = srvDist.getGlobalIndex();
+      boost::unordered_map<size_t,size_t>::const_iterator itb = globalLocalIndexMap_.begin(),
+                                                          ite = globalLocalIndexMap_.end(), it;   
+
+      CArray<size_t,1>::const_iterator itSrvb = writtenGlobalIndex.begin(),
+                                       itSrve = writtenGlobalIndex.end(), itSrv;
+      boost::unordered_map<size_t,size_t> localGlobalIndexMap;
+      for (itSrv = itSrvb; itSrv != itSrve; ++itSrv)
+      {
+        indGlo = *itSrv;
+        if (ite != globalLocalIndexMap_.find(indGlo))
+        {
+          localGlobalIndexMap[localIndexToWriteOnServer(nbWritten)] = indGlo;
+          ++nbWritten;
+        }                 
+      }
+
+      nbWritten = 0;
+      for (int idx = 0; idx < data_index.numElements(); ++idx)
+      {
+        if (localGlobalIndexMap.end() != localGlobalIndexMap.find(data_index(idx)))
+        {
+          ++nbWritten;
+        }
+      }
+
+      compressedIndexToWriteOnServer[writtenCommSize].resize(nbWritten);
+      nbWritten = 0;
+      for (int idx = 0; idx < data_index.numElements(); ++idx)
+      {
+        if (localGlobalIndexMap.end() != localGlobalIndexMap.find(data_index(idx)))
+        {
+          compressedIndexToWriteOnServer[writtenCommSize](nbWritten) = localGlobalIndexMap[data_index(idx)];
+          ++nbWritten;
+        }
+      }
+
+      numberWrittenIndexes_[writtenCommSize] = nbWritten;
+      if (isDistributed())
+      {
+             
+        MPI_Allreduce(&numberWrittenIndexes_[writtenCommSize], &totalNumberWrittenIndexes_[writtenCommSize], 1, MPI_INT, MPI_SUM, writtenComm);
+        MPI_Scan(&numberWrittenIndexes_[writtenCommSize], &offsetWrittenIndexes_[writtenCommSize], 1, MPI_INT, MPI_SUM, writtenComm);
+        offsetWrittenIndexes_[writtenCommSize] -= numberWrittenIndexes_[writtenCommSize];
+      }
+      else
+        totalNumberWrittenIndexes_[writtenCommSize] = numberWrittenIndexes_[writtenCommSize];
+    }
+  }
+
+  /*!
+    Send distribution information from a group of client (client role) to another group of client (server role)
+    The distribution of a group of client (server role) is imposed by the group of client (client role)
+    \param [in] globalDim global dimension of grid containing this axis
+    \param [in] orderPositionInGrid the relative order of this axis in the grid (e.g grid composed of domain+axis -> orderPositionInGrid is 2)
+    \param [in] distType distribution type of the server. For now, we only have band distribution.
+  */
+  void CAxis::sendDistributionAttribute(const std::vector<int>& globalDim, int orderPositionInGrid,
+                                        CServerDistributionDescription::ServerDistributionType distType)
+  {
+    std::list<CContextClient*>::iterator it;
+    for (it=clients.begin(); it!=clients.end(); ++it)
+    {
+      CContextClient* client = *it;
+      int nbServer = client->serverSize;
+
+      CServerDistributionDescription serverDescription(globalDim, nbServer);
+      serverDescription.computeServerDistribution();
+
+      std::vector<std::vector<int> > serverIndexBegin = serverDescription.getServerIndexBegin();
+      std::vector<std::vector<int> > serverDimensionSizes = serverDescription.getServerDimensionSizes();
+
+      CEventClient event(getType(),EVENT_ID_DISTRIBUTION_ATTRIBUTE);
+      if (client->isServerLeader())
+      {
+        std::list<CMessage> msgs;
+
+        const std::list<int>& ranks = client->getRanksServerLeader();
+        for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
+        {
+          // Use const int to ensure CMessage holds a copy of the value instead of just a reference
+          const int begin = serverIndexBegin[*itRank][orderPositionInGrid];
+          const int ni    = serverDimensionSizes[*itRank][orderPositionInGrid];
+          const int end   = begin + ni - 1;          
+
+          msgs.push_back(CMessage());
+          CMessage& msg = msgs.back();
+          msg << this->getId();
+          msg << ni << begin << end;          
+          msg << isCompressible_;                    
+
+          event.push(*itRank,1,msg);
+        }
+        client->sendEvent(event);
+      }
+      else client->sendEvent(event);
+    }
+  }
+
+  /*
+    Receive distribution attribute from another client
+    \param [in] event event containing data of these attributes
+  */
+  void CAxis::recvDistributionAttribute(CEventServer& event)
+  {
+    CBufferIn* buffer = event.subEvents.begin()->buffer;
+    string axisId;
+    *buffer >> axisId;
+    get(axisId)->recvDistributionAttribute(*buffer);
+  }
+
+  /*
+    Receive distribution attribute from another client
+    \param [in] buffer buffer containing data of these attributes
+  */
+  void CAxis::recvDistributionAttribute(CBufferIn& buffer)
+  {
+    int ni_srv, begin_srv, end_srv;
+    int global_zoom_end, zoom_end;
+    bool zoomIndex = zoomByIndex();
     
-    CArray<size_t,1> globalIndexAxis(nbIndex);
-    for (size_t idx = 0; idx < nbIndex; ++idx)
-    {      
-      globalIndexAxis(idx) = (size_t)index(idx);
-    }
-
-    std::vector<size_t> globalAxisZoom(nZoomCount);
-    nZoomCount = 0;
-    for (size_t idx = 0; idx < zoom_size; ++idx)
-    {
-      size_t globalZoomIndex = zoomByIndex() ? global_zoom_index(idx) : global_zoom_begin + idx;
-      if (globalZoomIndex >= minInd && globalZoomIndex <= maxInd)
-      {
-        globalAxisZoom[nZoomCount] = globalZoomIndex;
-        ++nZoomCount;
-      } 
-    }
-
-    std::set<int> writtenInd;
-    if (isCompressible_)
-    {
+    std::vector<int> zoom_index_tmp;
+    std::vector<int>::iterator itZoomBegin, itZoomEnd, itZoom;
+
+    buffer >> ni_srv >> begin_srv >> end_srv;    
+    buffer >> isCompressible_;            
+
+    // Set up new local size of axis on the receiving clients
+    n.setValue(ni_srv);
+    begin.setValue(begin_srv);
+
+    // If we have zoom by index then process it
+    if (zoomIndex)
+    {
+      zoom_index_tmp.resize(global_zoom_index.numElements());
+      std::copy(global_zoom_index.begin(), global_zoom_index.end(), zoom_index_tmp.begin());
+      std::sort(zoom_index_tmp.begin(), zoom_index_tmp.end());
+      itZoomBegin = std::lower_bound(zoom_index_tmp.begin(), zoom_index_tmp.end(), begin_srv);
+      itZoomEnd   = std::upper_bound(zoom_index_tmp.begin(), zoom_index_tmp.end(), end_srv);      
+      int sz = std::distance(itZoomBegin, itZoomEnd);
+      zoom_index.resize(sz);
+      itZoom = itZoomBegin;
+      for (int i = 0; i < sz; ++i, ++itZoom)
+      {
+        zoom_index(i) = *(itZoom);
+      }
+    }
+
+    global_zoom_begin = zoomIndex ? 0 : global_zoom_begin ;
+    global_zoom_n     = zoomIndex ? zoom_index_tmp.size() : global_zoom_n;
+    global_zoom_end   = global_zoom_begin + global_zoom_n - 1;
+
+    zoom_begin = zoomIndex ? std::distance(zoom_index_tmp.begin(), itZoomBegin)
+                           : global_zoom_begin > begin_srv ? global_zoom_begin : begin_srv ;
+    zoom_end   = zoomIndex ? std::distance(zoom_index_tmp.begin(), itZoomEnd) - 1 
+                           : global_zoom_end < end_srv ? global_zoom_end : end_srv ;
+    zoom_n     = zoom_end - zoom_begin + 1;
+
+    if (zoom_n<=0)
+    {
+      zoom_n = 0; zoom_begin=global_zoom_begin; //0; zoom_begin = 0; 
+    }
+
+    if (n_glo == n)
+    {
+      zoom_begin = zoomIndex ? std::distance(itZoomBegin, zoom_index_tmp.begin())
+                             : global_zoom_begin;      
+      zoom_n     = zoomIndex ? zoom_index_tmp.size() : global_zoom_n;
+    }
+  }
+
+  /*
+    Send attributes of axis from a group of client to other group of clients/servers 
+    on supposing that these attributes are not distributed among the sending group
+    In the future, if new attributes are added, they should also be processed in this function
+  */
+  void CAxis::sendNonDistributedAttributes()
+  {
+    std::list<CContextClient*>::iterator it;
+    for (it=clients.begin(); it!=clients.end(); ++it)
+	{
+	  CContextClient* client = *it;
+
+      CEventClient event(getType(), EVENT_ID_NON_DISTRIBUTED_ATTRIBUTES);
+      size_t nbIndex = index.numElements();
+      size_t nbDataIndex = 0;
+
       for (int idx = 0; idx < data_index.numElements(); ++idx)
       {
-        int ind = CDistributionClient::getAxisIndex(data_index(idx), data_begin, ni);
-
-        if (ind >= 0 && ind < ni && mask(ind))
-        {
-          ind += ibegin;
-          if (ind >= global_zoom_begin && ind <= zoom_end)
-            writtenInd.insert(ind);
-        }
-      }
-    }
-
-    CServerDistributionDescription serverDescriptionGlobal(globalDim, nbServer);
-    int distributedDimensionOnServer = serverDescriptionGlobal.getDimensionDistributed();
-    CClientServerMapping::GlobalIndexMap globalIndexAxisOnServer;
-    if (distributedDimensionOnServer == orderPositionInGrid) // So we have distributed axis on client side and also on server side*
-    {
-      std::vector<int> nGlobAxis(1);
-      nGlobAxis[0] = n_glo.getValue();
-
-      size_t globalSizeIndex = 1, indexBegin, indexEnd;
-      for (int i = 0; i < nGlobAxis.size(); ++i) globalSizeIndex *= nGlobAxis[i];
-      indexBegin = 0;
-      if (globalSizeIndex <= clientSize)
-      {
-        indexBegin = rank%globalSizeIndex;
-        indexEnd = indexBegin;
-      }
-      else
-      {
-        for (int i = 0; i < clientSize; ++i)
-        {
-          range = globalSizeIndex / clientSize;
-          if (i < (globalSizeIndex%clientSize)) ++range;
-          if (i == client->clientRank) break;
-          indexBegin += range;
-        }
-        indexEnd = indexBegin + range - 1;
-      }
-
-      CServerDistributionDescription serverDescription(nGlobAxis, nbServer);
-      serverDescription.computeServerGlobalIndexInRange(std::make_pair<size_t,size_t>(indexBegin, indexEnd));
-      CClientServerMapping* clientServerMap = new CClientServerMappingDistributed(serverDescription.getGlobalIndexRange(), client->intraComm);
-      clientServerMap->computeServerIndexMapping(globalIndexAxis);
-      globalIndexAxisOnServer = clientServerMap->getGlobalIndexOnServer();
-      delete clientServerMap;
-    }
-    else
-    {
-      std::vector<size_t> globalIndexServer(n_glo.getValue());
-      for (size_t idx = 0; idx < n_glo.getValue(); ++idx)
-      {
-        globalIndexServer[idx] = idx;
-      }
-
-      for (int idx = 0; idx < nbServer; ++idx)
-      {
-        globalIndexAxisOnServer[idx] = globalIndexServer;
-      }
-    }
-
-    CClientServerMapping::GlobalIndexMap::const_iterator it = globalIndexAxisOnServer.begin(),
-                                                         ite = globalIndexAxisOnServer.end();
-    std::vector<size_t>::const_iterator itbVec = (globalAxisZoom).begin(),
-                                        iteVec = (globalAxisZoom).end();
-    indSrv_.clear();
-    indWrittenSrv_.clear();
-    for (; it != ite; ++it)
-    {
-      int rank = it->first;
-      const std::vector<size_t>& globalIndexTmp = it->second;
-      int nb = globalIndexTmp.size();
-
-      for (int i = 0; i < nb; ++i)
-      {
-        if (std::binary_search(itbVec, iteVec, globalIndexTmp[i]))
-        {
-          indSrv_[rank].push_back(globalIndexTmp[i]);
-        }
-
-        if (writtenInd.count(globalIndexTmp[i]))
-        {
-          indWrittenSrv_[rank].push_back(globalIndexTmp[i]);
-        }
-      }
-    }
-
-    connectedServerRank_.clear();
-    for (it = globalIndexAxisOnServer.begin(); it != ite; ++it) {
-      connectedServerRank_.push_back(it->first);
-    }
-
-    if (!indSrv_.empty())
-    {
-      std::map<int, vector<size_t> >::const_iterator itIndSrv  = indSrv_.begin(),
-                                                     iteIndSrv = indSrv_.end();
-      connectedServerRank_.clear();
-      for (; itIndSrv != iteIndSrv; ++itIndSrv)
-        connectedServerRank_.push_back(itIndSrv->first);
-    }
-    nbConnectedClients_ = CClientServerMapping::computeConnectedClients(client->serverSize, client->clientSize, client->intraComm, connectedServerRank_);
-  }
-
-  void CAxis::sendNonDistributedValue()
-  {
-    CContext* context = CContext::getCurrent();
-    CContextClient* client = context->client;
-    CEventClient event(getType(), EVENT_ID_NON_DISTRIBUTED_VALUE);
-
-    int zoom_end = global_zoom_begin + global_zoom_n - 1;
-    int nb = 0;
-/*    for (size_t idx = 0; idx < n; ++idx)
-    {
-      size_t globalIndex = begin + idx;
-      if (globalIndex >= global_zoom_begin && globalIndex <= zoom_end) ++nb;
-    }*/
-
-    int end = (0 == n) ? begin : begin + n - 1;
-    int zoom_size = zoomByIndex() ? global_zoom_index.numElements() : global_zoom_n;
-    for (size_t idx = 0; idx < zoom_size; ++idx)
-    {
-      size_t globalZoomIndex = zoomByIndex() ? global_zoom_index(idx) : global_zoom_begin + idx;
-      if (globalZoomIndex >= begin && globalZoomIndex <= end) ++nb;
-    }
-
-    int nbWritten = 0;
-    if (isCompressible_)
-    {
+        int ind = data_index(idx);
+        if (ind >= 0 && ind < nbIndex) ++nbDataIndex;
+      }
+
+      CArray<int,1> dataIndex(nbDataIndex);
+      nbDataIndex = 0;
       for (int idx = 0; idx < data_index.numElements(); ++idx)
       {
-        int ind = CDistributionClient::getAxisIndex(data_index(idx), data_begin, n);
-
-        if (ind >= 0 && ind < n && mask(ind))
-        {
-          ind += begin;
-          if (ind >= global_zoom_begin && ind <= zoom_end)
-            ++nbWritten;
-        }
-      }
-    }
-
-    CArray<double,1> val(nb);
-    nb = 0;
-/*    for (size_t idx = 0; idx < n; ++idx)
-    {
-      size_t globalIndex = begin + idx;
-      if (globalIndex >= global_zoom_begin && globalIndex <= zoom_end)
-      {
-        val(nb) = value(idx);
-        ++nb;
-      }
-    }*/
-
-    for (size_t idx = 0; idx < zoom_size; ++idx)
-    {
-      size_t globalZoomIndex = zoomByIndex() ? global_zoom_index(idx) : global_zoom_begin + idx;
-      if (globalZoomIndex >= begin && globalZoomIndex <= end)
-      {
-        val(nb) = value(globalZoomIndex-begin);
-        ++nb;
-      }
-    }
-
-    CArray<int, 1> writtenInd(nbWritten);
-    nbWritten = 0;
-    if (isCompressible_)
-    {
-      for (int idx = 0; idx < data_index.numElements(); ++idx)
-      {
-        int ind = CDistributionClient::getAxisIndex(data_index(idx), data_begin, n);
-
-        if (ind >= 0 && ind < n && mask(ind))
-        {
-          ind += begin;
-          if (ind >= global_zoom_begin && ind <= zoom_end)
-          {
-            writtenInd(nbWritten) = ind;
-            ++nbWritten;
-          }
-        }
-      }
-    }
-
-    if (client->isServerLeader())
-    {
-      std::list<CMessage> msgs;
-
-      const std::list<int>& ranks = client->getRanksServerLeader();
-      for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
-      {
-        msgs.push_back(CMessage());
-        CMessage& msg = msgs.back();
-        msg << this->getId();
-        msg << val;
-        if (isCompressible_)
-          msg << writtenInd;
-        event.push(*itRank, 1, msg);
-      }
-      client->sendEvent(event);
-    }
-    else client->sendEvent(event);
-  }
-
-  void CAxis::sendDistributedValue(void)
-  {
-    int ns, n, i, j, ind, nv, idx;
-    CContext* context = CContext::getCurrent();
-    CContextClient* client=context->client;
-
-    // send value for each connected server
-    CEventClient eventIndex(getType(), EVENT_ID_INDEX);
-    CEventClient eventVal(getType(), EVENT_ID_DISTRIBUTED_VALUE);
-
-    list<CMessage> list_msgsIndex, list_msgsVal;
-    list<CArray<int,1> > list_indi;
-    list<CArray<int,1> > list_writtenInd;
-    list<CArray<double,1> > list_val;
-    list<CArray<double,2> > list_bounds;
-    list<CArray<StdString,1> > list_label;
-
-    std::map<int, std::vector<size_t> >::const_iterator it, iteMap;
-    iteMap = indSrv_.end();
-    for (int k = 0; k < connectedServerRank_.size(); ++k)
-    {
-      int nbData = 0;
-      int rank = connectedServerRank_[k];
-      it = indSrv_.find(rank);
-      if (iteMap != it)
-        nbData = it->second.size();
-
-      list_indi.push_back(CArray<int,1>(nbData));
-      list_val.push_back(CArray<double,1>(nbData));
-
-      if (hasBounds_)
-      {
-        list_bounds.push_back(CArray<double,2>(2,nbData));
-      }
-      
-      if (hasLabel)
-      {
-        list_label.push_back(CArray<StdString,1>(nbData));
-      }
-
-      CArray<int,1>& indi = list_indi.back();
-      CArray<double,1>& val = list_val.back();
-
-      for (n = 0; n < nbData; ++n)
-      {
-        idx = static_cast<int>(it->second[n]);
-        ind = idx - begin;
-
-        val(n) = value(ind);
-        indi(n) = idx;
-
-        if (hasBounds_)
-        {
-          CArray<double,2>& boundsVal = list_bounds.back();
-          boundsVal(0, n) = bounds(0,n);
-          boundsVal(1, n) = bounds(1,n);
-        }
-        
-        if (hasLabel)
-        {
-          CArray<StdString,1>& labelVal = list_label.back();
-          labelVal(n) = label(n);
-        }
-      }
-
-      list_msgsIndex.push_back(CMessage());
-      list_msgsIndex.back() << this->getId() << list_indi.back();
-
-      if (isCompressible_)
-      {
-        std::vector<int>& writtenIndSrc = indWrittenSrv_[rank];
-        list_writtenInd.push_back(CArray<int,1>(writtenIndSrc.size()));
-        CArray<int,1>& writtenInd = list_writtenInd.back();
-
-        for (n = 0; n < writtenInd.numElements(); ++n)
-          writtenInd(n) = writtenIndSrc[n];
-
-        list_msgsIndex.back() << writtenInd;
-      }
-
-      list_msgsVal.push_back(CMessage());
-      list_msgsVal.back() << this->getId() << list_val.back();
-
-      if (hasBounds_)
-      {
-        list_msgsVal.back() << list_bounds.back();
-      }
- 
-      if (hasLabel)
-      {
-        list_msgsVal.back() << list_label.back();
-      }
-
-      eventIndex.push(rank, nbConnectedClients_[rank], list_msgsIndex.back());
-      eventVal.push(rank, nbConnectedClients_[rank], list_msgsVal.back());
-    }
-
-    client->sendEvent(eventIndex);
-    client->sendEvent(eventVal);
-  }
-
-  void CAxis::recvIndex(CEventServer& event)
-  {
-    CAxis* axis;
-
+        int ind = data_index(idx);
+        if (ind >= 0 && ind < nbIndex)
+        {
+          dataIndex(nbDataIndex) = ind;
+          ++nbDataIndex;
+        }
+      }
+
+      if (client->isServerLeader())
+      {
+        std::list<CMessage> msgs;
+
+        const std::list<int>& ranks = client->getRanksServerLeader();
+        for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
+        {
+          msgs.push_back(CMessage());
+          CMessage& msg = msgs.back();
+          msg << this->getId();
+          msg << index.getValue() << dataIndex << mask.getValue();
+          msg << hasValue;
+          if (hasValue) msg << value.getValue();
+          msg << hasBounds;
+          if (hasBounds) msg << bounds.getValue();
+          msg << hasLabel;
+          if (hasLabel) msg << label.getValue();
+
+          event.push(*itRank, 1, msg);
+        }
+        client->sendEvent(event);
+      }
+      else client->sendEvent(event);
+    }
+  }
+
+  /*
+    Receive the non-distributed attributes from another group of clients
+    \param [in] event event containing data of these attributes
+  */
+  void CAxis::recvNonDistributedAttributes(CEventServer& event)
+  {
     list<CEventServer::SSubEvent>::iterator it;
     for (it = event.subEvents.begin(); it != event.subEvents.end(); ++it)
@@ -808,243 +1052,316 @@
       string axisId;
       *buffer >> axisId;
-      axis = get(axisId);
-      axis->recvIndex(it->rank, *buffer);
-    }
-
-    if (axis->isCompressible_)
-    {
-      std::sort(axis->indexesToWrite.begin(), axis->indexesToWrite.end());
-
-      CContextServer* server = CContext::getCurrent()->server;
-      axis->numberWrittenIndexes_ = axis->indexesToWrite.size();
-      MPI_Allreduce(&axis->numberWrittenIndexes_, &axis->totalNumberWrittenIndexes_, 1, MPI_INT, MPI_SUM, server->intraComm);
-      MPI_Scan(&axis->numberWrittenIndexes_, &axis->offsetWrittenIndexes_, 1, MPI_INT, MPI_SUM, server->intraComm);
-      axis->offsetWrittenIndexes_ -= axis->numberWrittenIndexes_;
-    }
-  }
-
-  void CAxis::recvIndex(int rank, CBufferIn& buffer)
-  {
-    buffer >> indiSrv_[rank];
-
-    if (isCompressible_)
-    {
-      CArray<int, 1> writtenIndexes;
-      buffer >> writtenIndexes;
-      indexesToWrite.reserve(indexesToWrite.size() + writtenIndexes.numElements());
-      for (int i = 0; i < writtenIndexes.numElements(); ++i)
-        indexesToWrite.push_back(writtenIndexes(i));
-    }
-  }
-
-  void CAxis::recvDistributedValue(CEventServer& event)
-  {
+      get(axisId)->recvNonDistributedAttributes(it->rank, *buffer);
+    }
+  }
+
+  /*
+    Receive the non-distributed attributes from another group of clients
+    \param [in] rank rank of the sender
+    \param [in] buffer buffer containing data sent from the sender
+  */
+  void CAxis::recvNonDistributedAttributes(int rank, CBufferIn& buffer)
+  { 
+    CArray<int,1> tmp_index, tmp_data_index, tmp_zoom_index;
+    CArray<bool,1> tmp_mask;
+    CArray<double,1> tmp_val;
+    CArray<double,2> tmp_bnds;
+    CArray<string,1> tmp_label;
+
+    buffer >> tmp_index;
+    index.reference(tmp_index);
+    buffer >> tmp_data_index;
+    data_index.reference(tmp_data_index);
+    buffer >> tmp_mask;
+    mask.reference(tmp_mask);
+
+    buffer >> hasValue;
+    if (hasValue)
+    {
+      buffer >> tmp_val;
+      value.reference(tmp_val);
+    }
+
+    buffer >> hasBounds;
+    if (hasBounds)
+    {
+      buffer >> tmp_bnds;
+      bounds.reference(tmp_bnds);
+    }
+
+    buffer >> hasLabel;
+    if (hasLabel)
+    {
+      buffer >> tmp_label;
+      label.reference(tmp_label);
+    }
+
+    // Some value should be reset here
+    data_begin.setValue(0);
+    globalLocalIndexMap_.rehash(std::ceil(index.numElements()/globalLocalIndexMap_.max_load_factor()));
+//    for (int idx = 0; idx < index.numElements(); ++idx) globalLocalIndexMap_[idx] = index(idx);
+    for (int idx = 0; idx < index.numElements(); ++idx) globalLocalIndexMap_[index(idx)] = idx;
+  }
+
+  /*
+    Send attributes of axis from a group of client to other group of clients/servers 
+    on supposing that these attributes are distributed among the clients of the sending group
+    In the future, if new attributes are added, they should also be processed in this function
+  */
+  void CAxis::sendDistributedAttributes(void)
+  {
+    int ns, n, i, j, ind, nv, idx;
+    std::list<CContextClient*>::iterator it;
+
+    for (it=clients.begin(); it!=clients.end(); ++it)
+    {
+      CContextClient* client = *it;
+      int nbServer = client->serverSize;
+
+      CEventClient eventData(getType(), EVENT_ID_DISTRIBUTED_ATTRIBUTES);
+
+      list<CMessage> listData;
+      list<CArray<int,1> > list_indi, list_dataInd, list_zoomInd;
+      list<CArray<bool,1> > list_mask;
+      list<CArray<double,1> > list_val;
+      list<CArray<double,2> > list_bounds;
+      list<CArray<string,1> > list_label;
+
+      int nbIndex = index.numElements();
+      CArray<int,1> dataIndex(nbIndex);
+      dataIndex = -1;
+      for (idx = 0; idx < data_index.numElements(); ++idx)
+      {
+        if (0 <= data_index(idx) && data_index(idx) < nbIndex)
+          dataIndex(idx) = 1;
+      }
+
+      boost::unordered_map<int, std::vector<size_t> >::const_iterator it, iteMap;
+      iteMap = indSrv_[nbServer].end();
+      for (int k = 0; k < connectedServerRank_[nbServer].size(); ++k)
+      {
+        int nbData = 0;
+        int rank = connectedServerRank_[nbServer][k];
+        it = indSrv_[nbServer].find(rank);
+        if (iteMap != it)
+          nbData = it->second.size();
+
+        list_indi.push_back(CArray<int,1>(nbData));
+        list_dataInd.push_back(CArray<int,1>(nbData));        
+        list_mask.push_back(CArray<bool,1>(nbData));
+
+        if (hasValue)
+          list_val.push_back(CArray<double,1>(nbData));
+
+        if (hasBounds)        
+          list_bounds.push_back(CArray<double,2>(2,nbData));
+
+        if (hasLabel)
+          list_label.push_back(CArray<string,1>(nbData));
+
+        CArray<int,1>& indi = list_indi.back();
+        CArray<int,1>& dataIndi = list_dataInd.back();        
+        CArray<bool,1>& maskIndi = list_mask.back();
+
+        for (n = 0; n < nbData; ++n)
+        {
+          idx = static_cast<int>(it->second[n]);
+          indi(n) = idx;
+
+          ind = globalLocalIndexMap_[idx];
+          dataIndi(n) = dataIndex(ind);
+          maskIndi(n) = mask(ind);
+
+          if (hasValue)
+          {
+            CArray<double,1>& val = list_val.back();
+            val(n) = value(ind);
+          }
+
+          if (hasBounds)
+          {
+            CArray<double,2>& boundsVal = list_bounds.back();
+            boundsVal(0, n) = bounds(0,ind);
+            boundsVal(1, n) = bounds(1,ind);
+          }
+
+          if (hasLabel)
+          {
+            CArray<string,1>& labelVal = list_label.back();
+            labelVal(n) = label(ind); 
+          }
+        }
+
+        listData.push_back(CMessage());
+        listData.back() << this->getId()
+                        << list_indi.back() << list_dataInd.back() << list_mask.back();
+
+        listData.back() << hasValue;
+        if (hasValue)
+          listData.back() << list_val.back();
+
+        listData.back() << hasBounds;
+        if (hasBounds)
+          listData.back() << list_bounds.back();
+
+        listData.back() << hasLabel;
+        if (hasLabel)
+          listData.back() << list_label.back();
+
+        eventData.push(rank, nbSenders[nbServer][rank], listData.back());
+      }
+
+      client->sendEvent(eventData);
+    }
+  }
+
+  /*
+    Receive the distributed attributes from another group of clients
+    \param [in] event event containing data of these attributes
+  */
+  void CAxis::recvDistributedAttributes(CEventServer& event)
+  {
+    string axisId;
+    vector<int> ranks;
+    vector<CBufferIn*> buffers;
+
     list<CEventServer::SSubEvent>::iterator it;
     for (it = event.subEvents.begin(); it != event.subEvents.end(); ++it)
     {
+      ranks.push_back(it->rank);
       CBufferIn* buffer = it->buffer;
-      string axisId;
       *buffer >> axisId;
-      get(axisId)->recvDistributedValue(it->rank, *buffer);
-    }
-  }
-
-  void CAxis::recvDistributedValue(int rank, CBufferIn& buffer)
-  {
-    CArray<int,1> &indi = indiSrv_[rank];
-    CArray<double,1> val;
-    CArray<double,2> boundsVal;
-    CArray<StdString,1> labelVal;
-
-    buffer >> val;
-    if (hasBounds_) buffer >> boundsVal;
-    if (hasLabel) buffer >> labelVal;
-
-    int i, j, ind_srv;
-    for (int ind = 0; ind < indi.numElements(); ++ind)
-    {
-      i = indi(ind);
-      ind_srv = i - zoom_begin_srv;
-      value_srv(ind_srv) = val(ind);
-      if (hasBounds_)
-      {
-        bound_srv(0,ind_srv) = boundsVal(0, ind);
-        bound_srv(1,ind_srv) = boundsVal(1, ind);
-      }
-
+      buffers.push_back(buffer);
+    }
+    get(axisId)->recvDistributedAttributes(ranks, buffers);
+  }
+
+  /*
+    Receive the non-distributed attributes from another group of clients
+    \param [in] ranks rank of the sender
+    \param [in] buffers buffer containing data sent from the sender
+  */
+  void CAxis::recvDistributedAttributes(vector<int>& ranks, vector<CBufferIn*> buffers)
+  {
+    int nbReceived = ranks.size(), idx, ind, gloInd, locInd;
+    vector<CArray<int,1> > vec_indi(nbReceived), vec_dataInd(nbReceived), vec_zoomInd(nbReceived);    
+    vector<CArray<bool,1> > vec_mask(nbReceived);
+    vector<CArray<double,1> > vec_val(nbReceived);
+    vector<CArray<double,2> > vec_bounds(nbReceived);
+    vector<CArray<string,1> > vec_label(nbReceived);
+    
+    for (idx = 0; idx < nbReceived; ++idx)
+    {      
+      CBufferIn& buffer = *buffers[idx];
+      buffer >> vec_indi[idx];
+      buffer >> vec_dataInd[idx];      
+      buffer >> vec_mask[idx];
+
+      buffer >> hasValue;
+      if (hasValue)
+        buffer >> vec_val[idx];
+
+      buffer >> hasBounds;
+      if (hasBounds)
+        buffer >> vec_bounds[idx];
+
+      buffer >> hasLabel;
       if (hasLabel)
-      {
-        label_srv(ind_srv) = labelVal( ind);
-      }
-
-    }
-  }
-
-   void CAxis::recvNonDistributedValue(CEventServer& event)
-  {
-    CAxis* axis;
-
-    list<CEventServer::SSubEvent>::iterator it;
-    for (it = event.subEvents.begin(); it != event.subEvents.end(); ++it)
-    {
-      CBufferIn* buffer = it->buffer;
-      string axisId;
-      *buffer >> axisId;
-      axis = get(axisId);
-      axis->recvNonDistributedValue(it->rank, *buffer);
-    }
-
-    if (axis->isCompressible_)
-    {
-      std::sort(axis->indexesToWrite.begin(), axis->indexesToWrite.end());
-
-      axis->numberWrittenIndexes_ = axis->totalNumberWrittenIndexes_ = axis->indexesToWrite.size();
-      axis->offsetWrittenIndexes_ = 0;
-    }
-  }
-
-  void CAxis::recvNonDistributedValue(int rank, CBufferIn& buffer)
-  {
-    CArray<double,1> val;
-    buffer >> val;
-
-    for (int ind = 0; ind < val.numElements(); ++ind)
-    {
-      value_srv(ind) = val(ind);
-      if (hasBounds_)
-      {
-        bound_srv(0,ind) = bounds(0,ind);
-        bound_srv(1,ind) = bounds(1,ind);
-      }
-      if (hasLabel)
-      {
-        label_srv(ind) = label(ind);
-      }
-    }
-
-    if (isCompressible_)
-    {
-      CArray<int, 1> writtenIndexes;
-      buffer >> writtenIndexes;
-      indexesToWrite.reserve(indexesToWrite.size() + writtenIndexes.numElements());
-      for (int i = 0; i < writtenIndexes.numElements(); ++i)
-        indexesToWrite.push_back(writtenIndexes(i));
-    }
-  }
-
-  void CAxis::sendServerAttribut(const std::vector<int>& globalDim, int orderPositionInGrid,
-                                 CServerDistributionDescription::ServerDistributionType distType)
-  {
-    CContext* context = CContext::getCurrent();
-    CContextClient* client = context->client;
-    int nbServer = client->serverSize;
-
-    CServerDistributionDescription serverDescription(globalDim, nbServer);
-    serverDescription.computeServerDistribution();
-
-    std::vector<std::vector<int> > serverIndexBegin = serverDescription.getServerIndexBegin();
-    std::vector<std::vector<int> > serverDimensionSizes = serverDescription.getServerDimensionSizes();
-
-    CEventClient event(getType(),EVENT_ID_SERVER_ATTRIBUT);
-    if (client->isServerLeader())
-    {
-      std::list<CMessage> msgs;
-
-      const std::list<int>& ranks = client->getRanksServerLeader();
-      for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
-      {
-        // Use const int to ensure CMessage holds a copy of the value instead of just a reference
-        const int begin = serverIndexBegin[*itRank][orderPositionInGrid];
-        const int ni    = serverDimensionSizes[*itRank][orderPositionInGrid];
-        const int end   = begin + ni - 1;
-        const bool zoomIndex = zoomByIndex();
-
-        msgs.push_back(CMessage());
-        CMessage& msg = msgs.back();
-        msg << this->getId();
-        msg << ni << begin << end;
-        msg << global_zoom_begin.getValue() << global_zoom_n.getValue();
-        msg << isCompressible_;        
-        msg << zoomIndex;
-        if (zoomIndex)
-          msg << global_zoom_index.getValue();
-
-        event.push(*itRank,1,msg);
-      }
-      client->sendEvent(event);
-    }
-    else client->sendEvent(event);
-  }
-
-  void CAxis::recvServerAttribut(CEventServer& event)
-  {
-    CBufferIn* buffer = event.subEvents.begin()->buffer;
-    string axisId;
-    *buffer >> axisId;
-    get(axisId)->recvServerAttribut(*buffer);
-  }
-
-  void CAxis::recvServerAttribut(CBufferIn& buffer)
-  {
-    int ni_srv, begin_srv, end_srv, global_zoom_begin_tmp, global_zoom_n_tmp;
-    bool zoomIndex;    
-    CArray<int,1> zoom_index_recv;
-    std::vector<int> zoom_index_tmp;
-    std::vector<int>::iterator itZoomBeginSrv, itZoomEndSrv, itZoomSrv;
-
-    buffer >> ni_srv >> begin_srv >> end_srv;
-    buffer >> global_zoom_begin_tmp >> global_zoom_n_tmp;
-    buffer >> isCompressible_;
-    buffer >> zoomIndex;
-    if (zoomIndex)
-    {
-      buffer >> zoom_index_recv;
-      global_zoom_index.reference(zoom_index_recv);
-      zoom_index_tmp.resize(global_zoom_index.numElements());
-      std::copy(global_zoom_index.begin(), global_zoom_index.end(), zoom_index_tmp.begin());
-      std::sort(zoom_index_tmp.begin(), zoom_index_tmp.end());
-      itZoomBeginSrv = std::lower_bound(zoom_index_tmp.begin(), zoom_index_tmp.end(), begin_srv);
-      itZoomEndSrv   = std::upper_bound(zoom_index_tmp.begin(), zoom_index_tmp.end(), end_srv);      
-      int sz = std::distance(itZoomBeginSrv, itZoomEndSrv);
-      zoom_index_srv.resize(sz);
-      itZoomSrv = itZoomBeginSrv;
-      for (int i = 0; i < sz; ++i, ++itZoomSrv)
-      {
-        zoom_index_srv(i) = *(itZoomSrv);
-      }
-    }
-
-    global_zoom_begin = global_zoom_begin_tmp;
-    global_zoom_n  = global_zoom_n_tmp;
-    int global_zoom_end = global_zoom_begin + global_zoom_n - 1;
-
-    zoom_begin_srv = zoomIndex ? std::distance(itZoomBeginSrv, zoom_index_tmp.begin())
-                                 : global_zoom_begin > begin_srv ? global_zoom_begin : begin_srv ;
-    zoom_end_srv   = zoomIndex ? std::distance(zoom_index_tmp.begin(), itZoomEndSrv) - 1 
-                                 : global_zoom_end < end_srv ? global_zoom_end : end_srv ;
-    zoom_size_srv  = zoom_end_srv - zoom_begin_srv + 1;
-     
-    global_zoom_begin_srv = zoomIndex ? 0 : global_zoom_begin ;
-    global_zoom_size_srv  = zoomIndex ? zoom_index_tmp.size() : global_zoom_n;
-
-    if (zoom_size_srv<=0)
-    {
-      zoom_begin_srv = 0; zoom_end_srv = 0; zoom_size_srv = 0;
-    }
-
-    if (n_glo == n)
-    {
-      zoom_begin_srv = zoomIndex ? std::distance(itZoomBeginSrv, zoom_index_tmp.begin())
-                                   : global_zoom_begin;      
-      zoom_size_srv  = zoomIndex ? zoom_index_tmp.size()
-                                   : global_zoom_n;
-    }
+        buffer >> vec_label[idx]; 
+    }
+
+    // Estimate size of index array
+    int nbIndexGlob = 0;
+    for (idx = 0; idx < nbReceived; ++idx)
+    {
+      nbIndexGlob += vec_indi[idx].numElements();
+    }
+
+    // Recompute global index
+    // Take account of the overlapped index 
+    index.resize(nbIndexGlob);
+    globalLocalIndexMap_.rehash(std::ceil(index.numElements()/globalLocalIndexMap_.max_load_factor()));
+    nbIndexGlob = 0;
+    for (idx = 0; idx < nbReceived; ++idx)
+    {
+      CArray<int,1>& tmp = vec_indi[idx];
+      for (ind = 0; ind < tmp.numElements(); ++ind)
+      {
+         gloInd = tmp(ind);
+         if (0 == globalLocalIndexMap_.count(gloInd))
+         {
+           index(nbIndexGlob) = gloInd % n_glo;           
+           globalLocalIndexMap_[gloInd] = nbIndexGlob;  
+           ++nbIndexGlob;
+         } 
+      } 
+    }
+
+    // Resize index to its real size
+    if (nbIndexGlob==0) index.resize(nbIndexGlob) ;
+    else index.resizeAndPreserve(nbIndexGlob);
+
+    int nbData = nbIndexGlob;
+    CArray<int,1> nonCompressedData(nbData);
+    nonCompressedData = -1;   
+    mask.resize(nbData);
     if (hasValue)
-    {
-      value_srv.resize(zoom_size_srv);
-      if (hasBounds_)  bound_srv.resize(2,zoom_size_srv);
-      if (hasLabel)  label_srv.resize(zoom_size_srv);
-    }
-  }
+      value.resize(nbData);
+    if (hasBounds)
+      bounds.resize(2,nbData);
+    if (hasLabel)
+      label.resize(nbData);
+
+    nbData = 0;
+    for (idx = 0; idx < nbReceived; ++idx)
+    {
+      CArray<int,1>& indi = vec_indi[idx];
+      CArray<int,1>& dataIndi = vec_dataInd[idx];
+      CArray<bool,1>& maskIndi = vec_mask[idx];
+      int nb = indi.numElements();
+      for (int n = 0; n < nb; ++n)
+      { 
+        locInd = globalLocalIndexMap_[size_t(indi(n))];
+
+        nonCompressedData(locInd) = (-1 == nonCompressedData(locInd)) ? dataIndi(n) : nonCompressedData(locInd);
+
+        if (!mask(locInd)) // Only rewrite mask if it's not true
+          mask(locInd) = maskIndi(n);
+        
+        if (hasValue)
+          value(locInd) = vec_val[idx](n);
+
+        if (hasBounds)
+        {
+          bounds(0,locInd) = vec_bounds[idx](0,n);
+          bounds(1,locInd) = vec_bounds[idx](1,n);
+        }
+
+        if (hasLabel)
+          label(locInd) = vec_label[idx](n);
+      }
+    }
+    
+    int nbCompressedData = 0; 
+    for (idx = 0; idx < nonCompressedData.numElements(); ++idx)
+    {
+      if (0 <= nonCompressedData(idx))
+        ++nbCompressedData;        
+    }
+
+    data_index.resize(nbCompressedData);
+    nbCompressedData = 0;
+    for (idx = 0; idx < nonCompressedData.numElements(); ++idx)
+    {
+      if (0 <= nonCompressedData(idx))
+      {
+        data_index(nbCompressedData) = idx % n;
+        ++nbCompressedData;        
+      }
+    }
+
+    data_begin.setValue(0);
+  }
+
 
   /*!
@@ -1080,4 +1397,9 @@
   }
 
+  /*
+    Add transformation into axis. This function only servers for Fortran interface
+    \param [in] transType transformation type
+    \param [in] id identifier of the transformation object
+  */
   CTransformation<CAxis>* CAxis::addTransformation(ETranformationType transType, const StdString& id)
   {
@@ -1086,4 +1408,7 @@
   }
 
+  /*
+    Check whether an axis has (spatial) transformation
+  */
   bool CAxis::hasTransformation()
   {
@@ -1091,4 +1416,8 @@
   }
 
+  /*
+    Set transformation
+    \param [in] axisTrans transformation to set
+  */
   void CAxis::setTransformations(const TransMapTypes& axisTrans)
   {
@@ -1096,4 +1425,8 @@
   }
 
+  /*
+    Return all transformation held by the axis
+    \return transformation the axis has
+  */
   CAxis::TransMapTypes CAxis::getAllTransformations(void)
   {
@@ -1101,4 +1434,8 @@
   }
 
+  /*
+    Duplicate transformation of another axis
+    \param [in] src axis whose transformations are copied
+  */
   void CAxis::duplicateTransformation(CAxis* src)
   {
@@ -1130,4 +1467,13 @@
   }
 
+  void CAxis::setContextClient(CContextClient* contextClient)
+  {
+    if (clientsSet.find(contextClient)==clientsSet.end())
+    {
+      clients.push_back(contextClient) ;
+      clientsSet.insert(contextClient);
+    }
+}
+
   void CAxis::parse(xml::CXMLNode & node)
   {
Index: /XIOS/trunk/src/node/axis.hpp
===================================================================
--- /XIOS/trunk/src/node/axis.hpp	(revision 1536)
+++ /XIOS/trunk/src/node/axis.hpp	(revision 1537)
@@ -38,18 +38,19 @@
       , public CAxisAttributes
    {
+               /// typedef ///
+         typedef CObjectTemplate<CAxis>   SuperClass;
+         typedef CAxisAttributes SuperClassAttribute;
+         
+      public:
          enum EEventId
          {
-           EVENT_ID_SERVER_ATTRIBUT,
-           EVENT_ID_INDEX,
+           EVENT_ID_DISTRIBUTION_ATTRIBUTE,           
            EVENT_ID_DISTRIBUTED_VALUE,
-           EVENT_ID_NON_DISTRIBUTED_VALUE
+           EVENT_ID_NON_DISTRIBUTED_VALUE,
+           EVENT_ID_NON_DISTRIBUTED_ATTRIBUTES,
+           EVENT_ID_DISTRIBUTED_ATTRIBUTES
          } ;
 
-         /// typedef ///
-         typedef CObjectTemplate<CAxis>   SuperClass;
-         typedef CAxisAttributes SuperClassAttribute;
-
-      public :
-
+      public:
          typedef CAxisAttributes RelAttributes;
          typedef CAxisGroup      RelGroup;
@@ -68,10 +69,11 @@
          const std::set<StdString> & getRelFiles(void) const;
 
-         const std::vector<int>& getIndexesToWrite(void) const;
-         int getNumberWrittenIndexes() const;
-         int getTotalNumberWrittenIndexes() const;
-         int getOffsetWrittenIndexes() const;
+         int getNumberWrittenIndexes(MPI_Comm writtenCom);
+         int getTotalNumberWrittenIndexes(MPI_Comm writtenCom);
+         int getOffsetWrittenIndexes(MPI_Comm writtenCom);
+         CArray<int, 1>& getCompressedIndexToWriteOnServer(MPI_Comm writtenCom);
 
-         std::map<int, StdSize> getAttributesBufferSize();
+         std::map<int, StdSize> getAttributesBufferSize(CContextClient* client, const std::vector<int>& globalDim, int orderPositionInGrid,
+                                                        CServerDistributionDescription::ServerDistributionType disType = CServerDistributionDescription::BAND_DISTRIBUTION);
 
          /// Test ///
@@ -93,4 +95,6 @@
          virtual void parse(xml::CXMLNode & node);
 
+         void setContextClient(CContextClient* contextClient);
+
          /// Accesseurs statiques ///
          static StdString GetName(void);
@@ -98,9 +102,6 @@
          static ENodeType GetType(void);
 
-         void sendServerAttribut(const std::vector<int>& globalDim, int orderPositionInGrid,
-                                 CServerDistributionDescription::ServerDistributionType distType);
-         static bool dispatchEvent(CEventServer& event);
-         static void recvServerAttribut(CEventServer& event);
-         void recvServerAttribut(CBufferIn& buffer) ;
+         static bool dispatchEvent(CEventServer& event);         
+         
          void checkAttributesOnClient();
          void checkAttributesOnClientAfterTransformation(const std::vector<int>& globalDim, int orderPositionInGrid,
@@ -110,22 +111,19 @@
 
          void checkEligibilityForCompressedOutput();
+         size_t getGlobalWrittenSize(void) ;
 
+         void computeWrittenIndex();
+         void computeWrittenCompressedIndex(MPI_Comm);
          bool hasTransformation();
          void solveInheritanceTransformation();
-         TransMapTypes getAllTransformations();
-         void fillInValues(const CArray<double,1>& values);
+         TransMapTypes getAllTransformations();         
          void duplicateTransformation(CAxis*);
          CTransformation<CAxis>* addTransformation(ETranformationType transType, const StdString& id="");
          bool isEqual(CAxis* axis);
+         bool zoomByIndex();
 
-      public:
-        int zoom_begin_srv, zoom_end_srv, zoom_size_srv;
-        int ni_srv, begin_srv, end_srv;
-        int global_zoom_begin_srv, global_zoom_end_srv, global_zoom_size_srv;
-        CArray<double,1> value_srv;
-        CArray<double,2> bound_srv;
-        CArray<StdString,1> label_srv;
-        CArray<int,1> zoom_index_srv;
-        bool hasValue;
+      public: 
+        bool hasValue;        
+        CArray<size_t,1> localIndexToWriteOnServer;        
 
       private:
@@ -134,39 +132,48 @@
          void checkZoom();
          void checkBounds();
-         void checkLabel();         
-         void sendValue();
-         void computeConnectedServer(const std::vector<int>& globalDim, int orderPositionInGrid,
+         void checkLabel();
+         void sendAttributes(const std::vector<int>& globalDim, int orderPositionInGrid,
+                             CServerDistributionDescription::ServerDistributionType distType);
+         void sendDistributionAttribute(const std::vector<int>& globalDim, int orderPositionInGrid,
+                                        CServerDistributionDescription::ServerDistributionType distType);
+         void computeConnectedClients(const std::vector<int>& globalDim, int orderPositionInGrid,
                                      CServerDistributionDescription::ServerDistributionType distType);
-         void sendDistributedValue();
-         void sendNonDistributedValue();
-         bool zoomByIndex();
 
-         static void recvIndex(CEventServer& event);
-         static void recvDistributedValue(CEventServer& event);
-         static void recvNonDistributedValue(CEventServer& event);
-         void recvIndex(int rank, CBufferIn& buffer);
-         void recvDistributedValue(int rank, CBufferIn& buffer);
-         void recvNonDistributedValue(int rank, CBufferIn& buffer);
+         void sendNonDistributedAttributes(void);
+         void sendDistributedAttributes(void);
+
+         static void recvNonDistributedAttributes(CEventServer& event);
+         static void recvDistributedAttributes(CEventServer& event);
+         static void recvDistributionAttribute(CEventServer& event);
+         void recvNonDistributedAttributes(int rank, CBufferIn& buffer);
+         void recvDistributedAttributes(vector<int>& rank, vector<CBufferIn*> buffers);
+         void recvDistributionAttribute(CBufferIn& buffer);
 
          void setTransformations(const TransMapTypes&);
 
       private:
+
+/** Clients that have to send a domain. There can be multiple clients in case of secondary server, otherwise only one client. */
+         std::list<CContextClient*> clients;
+         std::set<CContextClient*> clientsSet;
+
          bool isChecked;
          bool areClientAttributesChecked_;
          bool isClientAfterTransformationChecked;
          std::set<StdString> relFiles, relFilesCompressed;
-         TransMapTypes transformationMap_;
-         bool isDistributed_;
+         TransMapTypes transformationMap_;         
          //! True if and only if the data defined on the axis can be outputted in a compressed way
          bool isCompressible_;
-         std::map<int,int> nbConnectedClients_; // Mapping of number of communicating client to a server
-         std::map<int, vector<size_t> > indSrv_; // Global index of each client sent to server
-         std::map<int, vector<int> > indWrittenSrv_; // Global written index of each client sent to server
+         std::map<int, map<int,int> > nbSenders; // Mapping of number of communicating client to a server
+         std::map<int, boost::unordered_map<int, vector<size_t> > > indSrv_; // Global index of each client sent to server
+         // std::map<int, vector<int> > indWrittenSrv_; // Global written index of each client sent to server
+         boost::unordered_map<size_t,size_t> globalLocalIndexMap_;
          std::vector<int> indexesToWrite;
-         int numberWrittenIndexes_, totalNumberWrittenIndexes_, offsetWrittenIndexes_;
-         std::vector<int> connectedServerRank_;
-         std::map<int, CArray<int,1> > indiSrv_;
-         bool hasBounds_;
-         bool hasLabel;
+         std::map<int,int> numberWrittenIndexes_, totalNumberWrittenIndexes_, offsetWrittenIndexes_;
+         std::map<int, CArray<int, 1> > compressedIndexToWriteOnServer;
+         std::map<int, std::vector<int> > connectedServerRank_;
+         bool hasBounds;
+         bool hasLabel;         
+         bool computedWrittenIndex_;                  
 
        private:
Index: /XIOS/trunk/src/node/context.cpp
===================================================================
--- /XIOS/trunk/src/node/context.cpp	(revision 1536)
+++ /XIOS/trunk/src/node/context.cpp	(revision 1537)
@@ -16,5 +16,8 @@
 #include "timer.hpp"
 #include "memtrack.hpp"
-
+#include <limits>
+#include <fstream>
+#include "server.hpp"
+#include "distribute_file_server2.hpp"
 
 namespace xios {
@@ -26,12 +29,16 @@
    CContext::CContext(void)
       : CObjectTemplate<CContext>(), CContextAttributes()
-      , calendar(), hasClient(false), hasServer(false), isPostProcessed(false), finalized(false)
+      , calendar(), hasClient(false), hasServer(false)
+      , isPostProcessed(false), finalized(false)
       , idServer_(), client(0), server(0)
+      , allProcessed(false), countChildCtx_(0)
    { /* Ne rien faire de plus */ }
 
    CContext::CContext(const StdString & id)
       : CObjectTemplate<CContext>(id), CContextAttributes()
-      , calendar(), hasClient(false), hasServer(false), isPostProcessed(false), finalized(false)
+      , calendar(), hasClient(false), hasServer(false)
+      , isPostProcessed(false), finalized(false)
       , idServer_(), client(0), server(0)
+      , allProcessed(false), countChildCtx_(0)
    { /* Ne rien faire de plus */ }
 
@@ -40,4 +47,7 @@
      delete client;
      delete server;
+     for (std::vector<CContextClient*>::iterator it = clientPrimServer.begin(); it != clientPrimServer.end(); it++)  delete *it;
+     for (std::vector<CContextServer*>::iterator it = serverPrimServer.begin(); it != serverPrimServer.end(); it++)  delete *it;
+
    }
 
@@ -240,36 +250,67 @@
    void CContext::initClient(MPI_Comm intraComm, MPI_Comm interComm, CContext* cxtServer /*= 0*/)
    {
-     hasClient=true;
-     client = new CContextClient(this,intraComm, interComm, cxtServer);
-     registryIn=new CRegistry(intraComm);
-     registryIn->setPath(getId()) ;
-     if (client->clientRank==0) registryIn->fromFile("xios_registry.bin") ;
-     registryIn->bcastRegistry() ;
-
-     registryOut=new CRegistry(intraComm) ;
-     registryOut->setPath(getId()) ;
-
+
+     hasClient = true;
      MPI_Comm intraCommServer, interCommServer;
-     if (cxtServer) // Attached mode
-     {
-       intraCommServer = intraComm;
-       interCommServer = interComm;
+     
+
+     if (CServer::serverLevel != 1)
+      // initClient is called by client
+     {
+       client = new CContextClient(this, intraComm, interComm, cxtServer);
+       if (cxtServer) // Attached mode
+       {
+         intraCommServer = intraComm;
+         interCommServer = interComm;
+       }
+       else
+       {
+         MPI_Comm_dup(intraComm, &intraCommServer);
+         comms.push_back(intraCommServer);
+         MPI_Comm_dup(interComm, &interCommServer);
+         comms.push_back(interCommServer);
+       }
+/* for registry take the id of client context */
+/* for servers, supress the _server_ from id  */
+       string contextRegistryId=getId() ;
+       size_t pos=contextRegistryId.find("_server_") ;
+       if (pos!=std::string::npos)  contextRegistryId=contextRegistryId.substr(0,pos) ;
+
+       registryIn=new CRegistry(intraComm);
+       registryIn->setPath(contextRegistryId) ;
+       if (client->clientRank==0) registryIn->fromFile("xios_registry.bin") ;
+       registryIn->bcastRegistry() ;
+       registryOut=new CRegistry(intraComm) ;
+       
+       registryOut->setPath(contextRegistryId) ;
+
+       server = new CContextServer(this, intraCommServer, interCommServer);
      }
      else
-     {
+     // initClient is called by primary server
+     {
+       clientPrimServer.push_back(new CContextClient(this, intraComm, interComm));
        MPI_Comm_dup(intraComm, &intraCommServer);
        comms.push_back(intraCommServer);
        MPI_Comm_dup(interComm, &interCommServer);
        comms.push_back(interCommServer);
-     }
-     server = new CContextServer(this,intraCommServer,interCommServer);
-   }
-
-   void CContext::setClientServerBuffer()
-   {
-     // Estimated minimum event size for small events (10 is an arbitrary constant just for safety)
+       serverPrimServer.push_back(new CContextServer(this, intraCommServer, interCommServer));
+     }
+   }
+
+   /*!
+    Sets client buffers.
+    \param [in] contextClient
+    \param [in] bufferForWriting True if buffers are used for sending data for writing
+    This flag is only true for client and server-1 for communication with server-2
+  */
+   void CContext::setClientServerBuffer(CContextClient* contextClient, bool bufferForWriting)
+   {
+      // Estimated minimum event size for small events (10 is an arbitrary constant just for safety)
      const size_t minEventSize = CEventClient::headerSize + getIdServer().size() + 10 * sizeof(int);
-     // Ensure there is at least some room for 20 of such events in the buffers
-     size_t minBufferSize = std::max(CXios::minBufferSize, 20 * minEventSize);
+
+      // Ensure there is at least some room for 20 of such events in the buffers
+      size_t minBufferSize = std::max(CXios::minBufferSize, 20 * minEventSize);
+
 #define DECLARE_NODE(Name_, name_)    \
      if (minBufferSize < sizeof(C##Name_##Definition)) minBufferSize = sizeof(C##Name_##Definition);
@@ -281,6 +322,6 @@
      // Compute the buffer sizes needed to send the attributes and data corresponding to fields
      std::map<int, StdSize> maxEventSize;
-     std::map<int, StdSize> bufferSize = getAttributesBufferSize(maxEventSize);
-     std::map<int, StdSize> dataBufferSize = getDataBufferSize(maxEventSize);
+     std::map<int, StdSize> bufferSize = getAttributesBufferSize(maxEventSize, contextClient, bufferForWriting);
+     std::map<int, StdSize> dataBufferSize = getDataBufferSize(maxEventSize, contextClient, bufferForWriting);
 
      std::map<int, StdSize>::iterator it, ite = dataBufferSize.end();
@@ -288,5 +329,5 @@
        if (it->second > bufferSize[it->first]) bufferSize[it->first] = it->second;
 
-     // Apply the buffer size factor and check that we are above the minimum buffer size
+     // Apply the buffer size factor, check that we are above the minimum buffer size and below the maximum size
      ite = bufferSize.end();
      for (it = bufferSize.begin(); it != ite; ++it)
@@ -294,10 +335,11 @@
        it->second *= CXios::bufferSizeFactor;
        if (it->second < minBufferSize) it->second = minBufferSize;
+       if (it->second > CXios::maxBufferSize) it->second = CXios::maxBufferSize;
      }
 
      // Leaders will have to send some control events so ensure there is some room for those in the buffers
-     if (client->isServerLeader())
-     {
-       const std::list<int>& ranks = client->getRanksServerLeader();
+     if (contextClient->isServerLeader())
+     {
+       const std::list<int>& ranks = contextClient->getRanksServerLeader();
        for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
        {
@@ -309,6 +351,6 @@
        }
      }
-
-     client->setBufferSize(bufferSize, maxEventSize);
+     contextClient->setBufferSize(bufferSize, maxEventSize);
+
    }
 
@@ -319,16 +361,21 @@
    }
 
-   //! Initialize server
-   void CContext::initServer(MPI_Comm intraComm,MPI_Comm interComm, CContext* cxtClient /*= 0*/)
+   void CContext::initServer(MPI_Comm intraComm, MPI_Comm interComm, CContext* cxtClient /*= 0*/)
    {
      hasServer=true;
      server = new CContextServer(this,intraComm,interComm);
 
+/* for registry take the id of client context */
+/* for servers, supress the _server_ from id  */
+     string contextRegistryId=getId() ;
+     size_t pos=contextRegistryId.find("_server_") ;
+     if (pos!=std::string::npos)  contextRegistryId=contextRegistryId.substr(0,pos) ;
+       
      registryIn=new CRegistry(intraComm);
-     registryIn->setPath(getId()) ;
+     registryIn->setPath(contextRegistryId) ;
      if (server->intraCommRank==0) registryIn->fromFile("xios_registry.bin") ;
      registryIn->bcastRegistry() ;
      registryOut=new CRegistry(intraComm) ;
-     registryOut->setPath(getId()) ;
+     registryOut->setPath(contextRegistryId) ;
 
      MPI_Comm intraCommClient, interCommClient;
@@ -349,40 +396,254 @@
 
    //! Try to send the buffers and receive possible answers
-   bool CContext::checkBuffersAndListen(void)
-   {
-     client->checkBuffers();
-
-     bool hasTmpBufferedEvent = client->hasTemporarilyBufferedEvent();
-     if (hasTmpBufferedEvent)
-       hasTmpBufferedEvent = !client->sendTemporarilyBufferedEvent();
-
-     // Don't process events if there is a temporarily buffered event
-     return server->eventLoop(!hasTmpBufferedEvent);
-   }
+  bool CContext::checkBuffersAndListen(bool enableEventsProcessing /*= true*/)
+  {
+    bool clientReady, serverFinished;
+
+    // Only classical servers are non-blocking
+    if (CServer::serverLevel == 0)
+    {
+      client->checkBuffers();
+      bool hasTmpBufferedEvent = client->hasTemporarilyBufferedEvent();
+      if (hasTmpBufferedEvent)
+        hasTmpBufferedEvent = !client->sendTemporarilyBufferedEvent();
+      // Don't process events if there is a temporarily buffered event
+      return server->eventLoop(!hasTmpBufferedEvent || !enableEventsProcessing);
+    }
+    else if (CServer::serverLevel == 1)
+    {
+      if (!finalized)
+        client->checkBuffers();
+      bool serverFinished = true;
+      if (!finalized)
+        serverFinished = server->eventLoop(enableEventsProcessing);
+      bool serverPrimFinished = true;
+      for (int i = 0; i < clientPrimServer.size(); ++i)
+      {
+        if (!finalized)
+          clientPrimServer[i]->checkBuffers();
+        if (!finalized)
+          serverPrimFinished *= serverPrimServer[i]->eventLoop(enableEventsProcessing);
+      }
+      return ( serverFinished && serverPrimFinished);
+    }
+
+    else if (CServer::serverLevel == 2)
+    {
+      client->checkBuffers();
+      return server->eventLoop(enableEventsProcessing);
+    }
+  }
 
    //! Terminate a context
    void CContext::finalize(void)
    {
-      if (!finalized)
+      if (hasClient && !hasServer) // For now we only use server level 1 to read data
       {
-        finalized = true;
-        if (hasClient) sendRegistry() ;
-        client->finalize();
-        while (!server->hasFinished())
-        {
-          server->eventLoop();
-        }
-
-        if (hasServer)
-        {
-          closeAllFile();
-          registryOut->hierarchicalGatherRegistry() ;
-          if (server->intraCommRank==0) CXios::globalRegistry->mergeRegistry(*registryOut) ;
-        }
-
-        for (std::list<MPI_Comm>::iterator it = comms.begin(); it != comms.end(); ++it)
-          MPI_Comm_free(&(*it));
-        comms.clear();
+        doPreTimestepOperationsForEnabledReadModeFiles();
       }
+     // Send registry upon calling the function the first time
+     if (countChildCtx_ == 0)
+       if (hasClient) sendRegistry() ;
+
+     // Client:
+     // (1) blocking send context finalize to its server
+     // (2) blocking receive context finalize from its server
+     // (3) some memory deallocations
+     if (CXios::isClient)
+     {
+       // Make sure that client (model) enters the loop only once
+       if (countChildCtx_ < 1)
+       {
+         ++countChildCtx_;
+
+         client->finalize();
+         while (client->havePendingRequests())
+            client->checkBuffers();
+
+         while (!server->hasFinished())
+           server->eventLoop();
+
+         if (hasServer) // Mode attache
+         {
+           closeAllFile();
+           registryOut->hierarchicalGatherRegistry() ;
+           if (server->intraCommRank==0) CXios::globalRegistry->mergeRegistry(*registryOut) ;
+         }
+
+         //! Deallocate client buffers
+         client->releaseBuffers();
+
+         //! Free internally allocated communicators
+         for (std::list<MPI_Comm>::iterator it = comms.begin(); it != comms.end(); ++it)
+           MPI_Comm_free(&(*it));
+         comms.clear();
+
+         info(20)<<"CContext: Context <"<<getId()<<"> is finalized."<<endl;
+       }
+     }
+     else if (CXios::isServer)
+     {
+       // First context finalize message received from a model
+       // Send context finalize to its child contexts (if any)
+       if (countChildCtx_ == 0)
+         for (int i = 0; i < clientPrimServer.size(); ++i)
+           clientPrimServer[i]->finalize();
+
+       // (Last) context finalized message received
+       if (countChildCtx_ == clientPrimServer.size())
+       {
+         // Blocking send of context finalize message to its client (e.g. primary server or model)
+         info(100)<<"DEBUG: context "<<getId()<<" Send client finalize<<"<<endl ;
+         client->finalize();
+         bool bufferReleased;
+         do
+         {
+           client->checkBuffers();
+           bufferReleased = !client->havePendingRequests();
+         } while (!bufferReleased);
+         finalized = true;
+
+         closeAllFile(); // Just move to here to make sure that server-level 1 can close files
+         if (hasServer && !hasClient)
+         {           
+           registryOut->hierarchicalGatherRegistry() ;
+           if (server->intraCommRank==0) CXios::globalRegistry->mergeRegistry(*registryOut) ;
+         }
+
+         //! Deallocate client buffers
+         client->releaseBuffers();
+         for (int i = 0; i < clientPrimServer.size(); ++i)
+           clientPrimServer[i]->releaseBuffers();
+
+         //! Free internally allocated communicators
+         for (std::list<MPI_Comm>::iterator it = comms.begin(); it != comms.end(); ++it)
+           MPI_Comm_free(&(*it));
+         comms.clear();
+
+         info(20)<<"CContext: Context <"<<getId()<<"> is finalized."<<endl;
+       }
+
+       ++countChildCtx_;
+     }
+   }
+
+   //! Free internally allocated communicators
+   void CContext::freeComms(void)
+   {
+     for (std::list<MPI_Comm>::iterator it = comms.begin(); it != comms.end(); ++it)
+       MPI_Comm_free(&(*it));
+     comms.clear();
+   }
+
+   //! Deallocate buffers allocated by clientContexts
+   void CContext::releaseClientBuffers(void)
+   {
+     client->releaseBuffers();
+     for (int i = 0; i < clientPrimServer.size(); ++i)
+       clientPrimServer[i]->releaseBuffers();
+   }
+
+   void CContext::postProcessingGlobalAttributes()
+   {
+     if (allProcessed) return;  
+     
+     // After xml is parsed, there are some more works with post processing
+     postProcessing();
+
+     // Check grid and calculate its distribution
+     checkGridEnabledFields();
+ 
+     // Distribute files between secondary servers according to the data size
+     distributeFiles();
+
+     setClientServerBuffer(client, (hasClient && !hasServer));
+     for (int i = 0; i < clientPrimServer.size(); ++i)
+         setClientServerBuffer(clientPrimServer[i], true);
+
+     if (hasClient)
+     {
+      // Send all attributes of current context to server
+      this->sendAllAttributesToServer();
+
+      // Send all attributes of current calendar
+      CCalendarWrapper::get(CCalendarWrapper::GetDefName())->sendAllAttributesToServer();
+
+      // We have enough information to send to server
+      // First of all, send all enabled files
+      sendEnabledFiles(this->enabledWriteModeFiles);
+      // We only use server-level 1 (for now) to read data
+      if (!hasServer)
+        sendEnabledFiles(this->enabledReadModeFiles);
+
+      // Then, send all enabled fields      
+      sendEnabledFieldsInFiles(this->enabledWriteModeFiles);
+      if (!hasServer)
+        sendEnabledFieldsInFiles(this->enabledReadModeFiles);
+
+      // Then, check whether we have domain_ref, axis_ref or scalar_ref attached to the enabled fields
+      // If any, so send them to server
+       sendRefDomainsAxisScalars(this->enabledWriteModeFiles);
+      if (!hasServer)
+        sendRefDomainsAxisScalars(this->enabledReadModeFiles);        
+
+       // Check whether enabled fields have grid_ref, if any, send this info to server
+      sendRefGrid(this->enabledFiles);
+      // This code may be useful in the future when we want to seperate completely read and write
+      // sendRefGrid(this->enabledWriteModeFiles);
+      // if (!hasServer)
+      //   sendRefGrid(this->enabledReadModeFiles);
+      
+      // A grid of enabled fields composed of several components which must be checked then their
+      // checked attributes should be sent to server
+      sendGridComponentEnabledFieldsInFiles(this->enabledFiles); // This code can be seperated in two (one for reading, another for writing)
+
+       // We have a xml tree on the server side and now, it should be also processed
+      sendPostProcessing();
+       
+      // Finally, we send information of grid itself to server 
+      sendGridEnabledFieldsInFiles(this->enabledWriteModeFiles);       
+      if (!hasServer)
+        sendGridEnabledFieldsInFiles(this->enabledReadModeFiles);       
+     }
+     allProcessed = true;
+   }
+
+   void CContext::sendPostProcessingGlobalAttributes()
+   {
+      // Use correct context client to send message
+     // int nbSrvPools = (hasServer) ? clientPrimServer.size() : 1;
+    int nbSrvPools = (this->hasServer) ? (this->hasClient ? this->clientPrimServer.size() : 0) : 1;
+     for (int i = 0; i < nbSrvPools; ++i)
+     {
+       CContextClient* contextClientTmp = (0 != clientPrimServer.size()) ? clientPrimServer[i] : client;
+       CEventClient event(getType(),EVENT_ID_POST_PROCESS_GLOBAL_ATTRIBUTES);
+
+       if (contextClientTmp->isServerLeader())
+       {
+         CMessage msg;
+         if (hasServer)
+           msg<<this->getIdServer(i);
+         else
+           msg<<this->getIdServer();
+         const std::list<int>& ranks = contextClientTmp->getRanksServerLeader();
+         for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
+           event.push(*itRank,1,msg);
+         contextClientTmp->sendEvent(event);
+       }
+       else contextClientTmp->sendEvent(event);
+     }
+   }
+
+   void CContext::recvPostProcessingGlobalAttributes(CEventServer& event)
+   {
+      CBufferIn* buffer=event.subEvents.begin()->buffer;
+      string id;
+      *buffer>>id;
+      get(id)->recvPostProcessingGlobalAttributes(*buffer);
+   }
+
+   void CContext::recvPostProcessingGlobalAttributes(CBufferIn& buffer)
+   {      
+      postProcessingGlobalAttributes();
    }
 
@@ -398,72 +659,38 @@
    void CContext::closeDefinition(void)
    {
-     CTimer::get("Context : close definition").resume() ;
-     // There is nothing client need to send to server
-     if (hasClient)
-     {
-       // After xml is parsed, there are some more works with post processing
-       postProcessing();
-     }
-     setClientServerBuffer();
-
+    CTimer::get("Context : close definition").resume() ;
+    postProcessingGlobalAttributes();
+
+    if (hasClient) sendPostProcessingGlobalAttributes();
+
+    // There are some processings that should be done after all of above. For example: check mask or index
+    this->buildFilterGraphOfEnabledFields();
+    
      if (hasClient && !hasServer)
-     {
-      // Send all attributes of current context to server
-      this->sendAllAttributesToServer();
-
-      // Send all attributes of current calendar
-      CCalendarWrapper::get(CCalendarWrapper::GetDefName())->sendAllAttributesToServer();
-
-      // We have enough information to send to server
-      // First of all, send all enabled files
-       sendEnabledFiles();
-
-      // Then, send all enabled fields
-       sendEnabledFields();
-
-      // At last, we have all info of domain and axis, then send them
-       sendRefDomainsAxis();
-
-      // After that, send all grid (if any)
-       sendRefGrid();
-    }
-
-    // We have a xml tree on the server side and now, it should be also processed
-    if (hasClient && !hasServer) sendPostProcessing();
-
-    // There are some processings that should be done after all of above. For example: check mask or index
-    if (hasClient)
     {
-      this->buildFilterGraphOfEnabledFields();
       buildFilterGraphOfFieldsWithReadAccess();
-      this->solveAllRefOfEnabledFields(true);
       postProcessFilterGraph();
     }
-
-    // Now tell server that it can process all messages from client
-    if (hasClient && !hasServer) this->sendCloseDefinition();
+    
+    checkGridEnabledFields();   
+
+    if (hasClient) this->sendProcessingGridOfEnabledFields();
+    if (hasClient) this->sendCloseDefinition();
 
     // Nettoyage de l'arborescence
-    if (hasClient && !hasServer) CleanTree(); // Only on client side??
+    if (hasClient) CleanTree(); // Only on client side??
 
     if (hasClient)
     {
       sendCreateFileHeader();
-
-      startPrefetchingOfEnabledReadModeFiles();
+      if (!hasServer) startPrefetchingOfEnabledReadModeFiles();
     }
     CTimer::get("Context : close definition").suspend() ;
    }
 
-   void CContext::findAllEnabledFields(void)
-   {
-     for (unsigned int i = 0; i < this->enabledFiles.size(); i++)
-     (void)this->enabledFiles[i]->getEnabledFields();
-   }
-
-   void CContext::findAllEnabledFieldsInReadModeFiles(void)
-   {
-     for (unsigned int i = 0; i < this->enabledReadModeFiles.size(); ++i)
-     (void)this->enabledReadModeFiles[i]->getEnabledFields();
+   void CContext::findAllEnabledFieldsInFiles(const std::vector<CFile*>& activeFiles)
+   {
+     for (unsigned int i = 0; i < activeFiles.size(); i++)
+     (void)activeFiles[i]->getEnabledFields();
    }
 
@@ -474,4 +701,53 @@
    }
 
+   void CContext::sendGridComponentEnabledFieldsInFiles(const std::vector<CFile*>& activeFiles)
+   {
+     int size = activeFiles.size();
+     for (int i = 0; i < size; ++i)
+     {       
+       activeFiles[i]->sendGridComponentOfEnabledFields();
+     }
+   }
+
+   /*!
+      Send active (enabled) fields in file from a client to others
+      \param [in] activeFiles files contains enabled fields to send
+   */
+   void CContext::sendGridEnabledFieldsInFiles(const std::vector<CFile*>& activeFiles)
+   {
+     int size = activeFiles.size();
+     for (int i = 0; i < size; ++i)
+     {       
+       activeFiles[i]->sendGridOfEnabledFields();
+     }
+   }
+
+   void CContext::checkGridEnabledFields()
+   {
+     int size = enabledFiles.size();
+     for (int i = 0; i < size; ++i)
+     {
+       enabledFiles[i]->checkGridOfEnabledFields();       
+     }
+   }
+
+   /*!
+      Check grid of active (enabled) fields in file 
+      \param [in] activeFiles files contains enabled fields whose grid needs checking
+   */
+   void CContext::checkGridEnabledFieldsInFiles(const std::vector<CFile*>& activeFiles)
+   {
+     int size = activeFiles.size();
+     for (int i = 0; i < size; ++i)
+     {
+       activeFiles[i]->checkGridOfEnabledFields();       
+     }
+   }
+
+    /*!
+      Go up the hierachical tree via field_ref and do check of attributes of fields
+      This can be done in a client then all computed information will be sent from this client to others
+      \param [in] sendToServer Flag to indicate whether calculated information will be sent
+   */
    void CContext::solveOnlyRefOfEnabledFields(bool sendToServer)
    {
@@ -488,10 +764,16 @@
    }
 
-   void CContext::solveAllRefOfEnabledFields(bool sendToServer)
+    /*!
+      Go up the hierachical tree via field_ref and do check of attributes of fields.
+      The transformation can be done in this step.
+      All computed information will be sent from this client to others.
+      \param [in] sendToServer Flag to indicate whether calculated information will be sent
+   */
+   void CContext::solveAllRefOfEnabledFieldsAndTransform(bool sendToServer)
    {
      int size = this->enabledFiles.size();
      for (int i = 0; i < size; ++i)
      {
-       this->enabledFiles[i]->solveAllRefOfEnabledFields(sendToServer);
+       this->enabledFiles[i]->solveAllRefOfEnabledFieldsAndTransform(sendToServer);
      }
    }
@@ -579,6 +861,6 @@
       const vector<CGrid*> allGrids= CGrid::getAll();
 
-     //if (hasClient && !hasServer)
-      if (hasClient)
+      if (hasClient && !hasServer)
+      //if (hasClient)
       {
         for (unsigned int i = 0; i < allFiles.size(); i++)
@@ -626,5 +908,5 @@
                   << "Mandatory attribute output_freq must be defined for file \""<<allFiles[i]->getFileOutputName()
                   <<" \".")
-           }  
+           }
            if ( (initDate + allFiles[i]->output_freq.getValue()) < (initDate + this->getCalendar()->getTimeStep()))
            {
@@ -640,6 +922,209 @@
          DEBUG(<<"Aucun fichier ne va Ãªtre sorti dans le contexte nommÃ© \""
                << getId() << "\" !");
-   }
-
+
+   }
+
+   void CContext::distributeFiles(void)
+   {
+     bool distFileMemory=false ;
+     distFileMemory=CXios::getin<bool>("server2_dist_file_memory", distFileMemory);
+
+     if (distFileMemory) distributeFileOverMemoryBandwith() ;
+     else distributeFileOverBandwith() ;
+   }
+
+
+   void CContext::distributeFileOverBandwith(void)
+   {
+     double eps=std::numeric_limits<double>::epsilon()*10 ;
+     
+     // If primary server
+     if (hasServer && hasClient)
+     {
+       std::ofstream ofs(("distribute_file_"+getId()+".dat").c_str(), std::ofstream::out);
+       int nbPools = clientPrimServer.size();
+
+       // (1) Find all enabled files in write mode
+       // for (int i = 0; i < this->enabledFiles.size(); ++i)
+       // {
+       //   if (enabledFiles[i]->mode.isEmpty() || (!enabledFiles[i]->mode.isEmpty() && enabledFiles[i]->mode.getValue() == CFile::mode_attr::write ))
+       //    enabledWriteModeFiles.push_back(enabledFiles[i]);
+       // }
+
+       // (2) Estimate the data volume for each file
+       int size = this->enabledWriteModeFiles.size();
+       std::vector<std::pair<double, CFile*> > dataSizeMap;
+       double dataPerPool = 0;
+       int nfield=0 ;
+       ofs<<size<<endl ;
+       for (size_t i = 0; i < size; ++i)
+       {
+         CFile* file = this->enabledWriteModeFiles[i];
+         ofs<<file->getId()<<endl ;
+         StdSize dataSize=0;
+         std::vector<CField*> enabledFields = file->getEnabledFields();
+         size_t numEnabledFields = enabledFields.size();
+         ofs<<numEnabledFields<<endl ;
+         for (size_t j = 0; j < numEnabledFields; ++j)
+         {
+           dataSize += enabledFields[j]->getGlobalWrittenSize() ;
+           ofs<<enabledFields[j]->grid->getId()<<endl ;
+           ofs<<enabledFields[j]->getGlobalWrittenSize()<<endl ;
+         }
+         double outFreqSec = (Time)(calendar->getCurrentDate()+file->output_freq)-(Time)(calendar->getCurrentDate()) ;
+         double dataSizeSec= dataSize/ outFreqSec;
+         ofs<<dataSizeSec<<endl ;
+         nfield++ ;
+// add epsilon*nField to dataSizeSec in order to  preserve reproductive ordering when sorting
+         dataSizeMap.push_back(make_pair(dataSizeSec + dataSizeSec * eps * nfield , file));
+         dataPerPool += dataSizeSec;
+       }
+       dataPerPool /= nbPools;
+       std::sort(dataSizeMap.begin(), dataSizeMap.end());
+
+       // (3) Assign contextClient to each enabled file
+
+       std::multimap<double,int> poolDataSize ;
+// multimap is not garanty to preserve stable sorting in c++98 but it seems it does for c++11
+
+       int j;
+       double dataSize ;
+       for (j = 0 ; j < nbPools ; ++j) poolDataSize.insert(std::pair<double,int>(0.,j)) ;  
+              
+       for (int i = dataSizeMap.size()-1; i >= 0; --i)
+       {
+         dataSize=(*poolDataSize.begin()).first ;
+         j=(*poolDataSize.begin()).second ;
+         dataSizeMap[i].second->setContextClient(clientPrimServer[j]);
+         dataSize+=dataSizeMap[i].first;
+         poolDataSize.erase(poolDataSize.begin()) ;
+         poolDataSize.insert(std::pair<double,int>(dataSize,j)) ; 
+       }
+
+       for (std::multimap<double,int>:: iterator it=poolDataSize.begin() ; it!=poolDataSize.end(); ++it) info(30)<<"Load Balancing for servers (perfect=1) : "<<it->second<<" :  ratio "<<it->first*1./dataPerPool<<endl ;
+ 
+       for (int i = 0; i < this->enabledReadModeFiles.size(); ++i)
+       {
+         enabledReadModeFiles[i]->setContextClient(client);          
+       }
+     }
+     else
+     {
+       for (int i = 0; i < this->enabledFiles.size(); ++i)
+         enabledFiles[i]->setContextClient(client);
+     }
+   }
+
+   void CContext::distributeFileOverMemoryBandwith(void)
+   {
+     // If primary server
+     if (hasServer && hasClient)
+     {
+       int nbPools = clientPrimServer.size();
+       double ratio=0.5 ;
+       ratio=CXios::getin<double>("server2_dist_file_memory_ratio", ratio);
+
+       int nFiles = this->enabledWriteModeFiles.size();
+       vector<SDistFile> files(nFiles);
+       vector<SDistGrid> grids;
+       map<string,int> gridMap ;
+       string gridId; 
+       int gridIndex=0 ;
+
+       for (size_t i = 0; i < nFiles; ++i)
+       {
+         StdSize dataSize=0;
+         CFile* file = this->enabledWriteModeFiles[i];
+         std::vector<CField*> enabledFields = file->getEnabledFields();
+         size_t numEnabledFields = enabledFields.size();
+
+         files[i].id_=file->getId() ;
+         files[i].nbGrids_=numEnabledFields;
+         files[i].assignedGrid_ = new int[files[i].nbGrids_] ;
+         
+         for (size_t j = 0; j < numEnabledFields; ++j)
+         {
+           gridId=enabledFields[j]->grid->getId() ;
+           if (gridMap.find(gridId)==gridMap.end())
+           {
+              gridMap[gridId]=gridIndex  ;
+              SDistGrid newGrid; 
+              grids.push_back(newGrid) ;
+              gridIndex++ ;
+           }
+           files[i].assignedGrid_[j]=gridMap[gridId] ;
+           grids[files[i].assignedGrid_[j]].size_=enabledFields[j]->getGlobalWrittenSize() ;
+           dataSize += enabledFields[j]->getGlobalWrittenSize() ; // usefull
+         }
+         double outFreqSec = (Time)(calendar->getCurrentDate()+file->output_freq)-(Time)(calendar->getCurrentDate()) ;
+         files[i].bandwith_= dataSize/ outFreqSec ;
+       }
+
+       double bandwith=0 ;
+       double memory=0 ;
+   
+       for(int i=0; i<nFiles; i++)  bandwith+=files[i].bandwith_ ;
+       for(int i=0; i<nFiles; i++)  files[i].bandwith_ = files[i].bandwith_/bandwith * ratio ;
+
+       for(int i=0; i<grids.size(); i++)  memory+=grids[i].size_ ;
+       for(int i=0; i<grids.size(); i++)  grids[i].size_ = grids[i].size_ / memory * (1.0-ratio) ;
+       
+       distributeFileOverServer2(nbPools, grids.size(), &grids[0], nFiles, &files[0]) ;
+
+       vector<double> memorySize(nbPools,0.) ;
+       vector< set<int> > serverGrids(nbPools) ;
+       vector<double> bandwithSize(nbPools,0.) ;
+       
+       for (size_t i = 0; i < nFiles; ++i)
+       {
+         bandwithSize[files[i].assignedServer_] += files[i].bandwith_* bandwith /ratio ;
+         for(int j=0 ; j<files[i].nbGrids_;j++)
+         {
+           if (serverGrids[files[i].assignedServer_].find(files[i].assignedGrid_[j]) == serverGrids[files[i].assignedServer_].end())
+           {
+             memorySize[files[i].assignedServer_]+= grids[files[i].assignedGrid_[j]].size_ * memory / (1.0-ratio);
+             serverGrids[files[i].assignedServer_].insert(files[i].assignedGrid_[j]) ;
+           }
+         }
+         enabledWriteModeFiles[i]->setContextClient(clientPrimServer[files[i].assignedServer_]) ;
+         delete [] files[i].assignedGrid_ ;
+       }
+
+       for (int i = 0; i < nbPools; ++i) info(100)<<"Pool server level2 "<<i<<"   assigned file bandwith "<<bandwithSize[i]*86400.*4./1024/1024.<<" Mb / days"<<endl ;
+       for (int i = 0; i < nbPools; ++i) info(100)<<"Pool server level2 "<<i<<"   assigned grid memory "<<memorySize[i]*100/1024./1024.<<" Mb"<<endl ;
+
+
+       for (int i = 0; i < this->enabledReadModeFiles.size(); ++i)
+       {
+         enabledReadModeFiles[i]->setContextClient(client);          
+       }
+
+   }
+   else
+   {
+     for (int i = 0; i < this->enabledFiles.size(); ++i)
+        enabledFiles[i]->setContextClient(client);
+   }
+}
+
+
+
+   /*!
+      Find all files in write mode
+   */
+   void CContext::findEnabledWriteModeFiles(void)
+   {
+     int size = this->enabledFiles.size();
+     for (int i = 0; i < size; ++i)
+     {
+       if (enabledFiles[i]->mode.isEmpty() || 
+          (!enabledFiles[i]->mode.isEmpty() && enabledFiles[i]->mode.getValue() == CFile::mode_attr::write ))
+        enabledWriteModeFiles.push_back(enabledFiles[i]);
+     }
+   }
+
+   /*!
+      Find all files in read mode
+   */
    void CContext::findEnabledReadModeFiles(void)
    {
@@ -697,6 +1182,13 @@
              recvRegistry(event);
              return true;
-            break;
-
+             break;
+            case EVENT_ID_POST_PROCESS_GLOBAL_ATTRIBUTES:
+             recvPostProcessingGlobalAttributes(event);
+             return true;
+             break;
+            case EVENT_ID_PROCESS_GRID_ENABLED_FIELDS:
+             recvProcessingGridOfEnabledFields(event);
+             return true;
+             break;
            default :
              ERROR("bool CContext::dispatchEvent(CEventServer& event)",
@@ -710,15 +1202,24 @@
    void CContext::sendCloseDefinition(void)
    {
-     CEventClient event(getType(),EVENT_ID_CLOSE_DEFINITION);
-     if (client->isServerLeader())
-     {
-       CMessage msg;
-       msg<<this->getIdServer();
-       const std::list<int>& ranks = client->getRanksServerLeader();
-       for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
-         event.push(*itRank,1,msg);
-       client->sendEvent(event);
-     }
-     else client->sendEvent(event);
+     // Use correct context client to send message
+     int nbSrvPools = (this->hasServer) ? (this->hasClient ? this->clientPrimServer.size() : 0) : 1;
+     for (int i = 0; i < nbSrvPools; ++i)
+     {
+       CContextClient* contextClientTmp = (hasServer) ? clientPrimServer[i] : client;
+       CEventClient event(getType(),EVENT_ID_CLOSE_DEFINITION);
+       if (contextClientTmp->isServerLeader())
+       {
+         CMessage msg;
+         if (hasServer)
+           msg<<this->getIdServer(i);
+         else
+           msg<<this->getIdServer();
+         const std::list<int>& ranks = contextClientTmp->getRanksServerLeader();
+         for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
+           event.push(*itRank,1,msg);
+         contextClientTmp->sendEvent(event);
+       }
+       else contextClientTmp->sendEvent(event);
+     }
    }
 
@@ -726,5 +1227,4 @@
    void CContext::recvCloseDefinition(CEventServer& event)
    {
-
       CBufferIn* buffer=event.subEvents.begin()->buffer;
       string id;
@@ -736,17 +1236,24 @@
    void CContext::sendUpdateCalendar(int step)
    {
-     if (!hasServer)
-     {
+     // Use correct context client to send message
+    int nbSrvPools = (this->hasServer) ? (this->hasClient ? this->clientPrimServer.size() : 0) : 1;
+     for (int i = 0; i < nbSrvPools; ++i)
+     {
+       CContextClient* contextClientTmp = (hasServer) ? clientPrimServer[i] : client;
        CEventClient event(getType(),EVENT_ID_UPDATE_CALENDAR);
-       if (client->isServerLeader())
-       {
-         CMessage msg;
-         msg<<this->getIdServer()<<step;
-         const std::list<int>& ranks = client->getRanksServerLeader();
-         for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
-           event.push(*itRank,1,msg);
-         client->sendEvent(event);
-       }
-       else client->sendEvent(event);
+
+         if (contextClientTmp->isServerLeader())
+         {
+           CMessage msg;
+           if (hasServer)
+             msg<<this->getIdServer(i)<<step;
+           else
+             msg<<this->getIdServer()<<step;
+           const std::list<int>& ranks = contextClientTmp->getRanksServerLeader();
+           for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
+             event.push(*itRank,1,msg);
+           contextClientTmp->sendEvent(event);
+         }
+         else contextClientTmp->sendEvent(event);
      }
    }
@@ -767,4 +1274,8 @@
       buffer>>step;
       updateCalendar(step);
+      if (hasClient && hasServer)
+      {        
+        sendUpdateCalendar(step);
+      }
    }
 
@@ -772,15 +1283,26 @@
    void CContext::sendCreateFileHeader(void)
    {
-     CEventClient event(getType(),EVENT_ID_CREATE_FILE_HEADER);
-     if (client->isServerLeader())
-     {
-       CMessage msg;
-       msg<<this->getIdServer();
-       const std::list<int>& ranks = client->getRanksServerLeader();
-       for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
-         event.push(*itRank,1,msg) ;
-       client->sendEvent(event);
-     }
-     else client->sendEvent(event);
+     // Use correct context client to send message
+     // int nbSrvPools = (hasServer) ? clientPrimServer.size() : 1;
+     int nbSrvPools = (this->hasServer) ? (this->hasClient ? this->clientPrimServer.size() : 0) : 1;
+     for (int i = 0; i < nbSrvPools; ++i)
+     {
+       CContextClient* contextClientTmp = (hasServer) ? clientPrimServer[i] : client;
+       CEventClient event(getType(),EVENT_ID_CREATE_FILE_HEADER);
+
+       if (contextClientTmp->isServerLeader())
+       {
+         CMessage msg;
+         if (hasServer)
+           msg<<this->getIdServer(i);
+         else
+           msg<<this->getIdServer();
+         const std::list<int>& ranks = contextClientTmp->getRanksServerLeader();
+         for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
+           event.push(*itRank,1,msg) ;
+         contextClientTmp->sendEvent(event);
+       }
+       else contextClientTmp->sendEvent(event);
+     }
    }
 
@@ -797,5 +1319,40 @@
    void CContext::recvCreateFileHeader(CBufferIn& buffer)
    {
-      createFileHeader();
+      if (!hasClient && hasServer) 
+        createFileHeader();
+   }
+
+   //! Client side: Send a message to do some post processing on server
+   void CContext::sendProcessingGridOfEnabledFields()
+   {
+      // Use correct context client to send message
+     int nbSrvPools = (this->hasServer) ? (this->hasClient ? this->clientPrimServer.size() : 0) : 1;
+     for (int i = 0; i < nbSrvPools; ++i)
+     {
+       CContextClient* contextClientTmp = (0 != clientPrimServer.size()) ? clientPrimServer[i] : client;
+       CEventClient event(getType(),EVENT_ID_PROCESS_GRID_ENABLED_FIELDS);
+
+       if (contextClientTmp->isServerLeader())
+       {
+         CMessage msg;
+         if (hasServer)
+           msg<<this->getIdServer(i);
+         else
+           msg<<this->getIdServer();
+         const std::list<int>& ranks = contextClientTmp->getRanksServerLeader();
+         for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
+           event.push(*itRank,1,msg);
+         contextClientTmp->sendEvent(event);
+       }
+       else contextClientTmp->sendEvent(event);
+     }
+   }
+
+   //! Server side: Receive a message to do some post processing
+   void CContext::recvProcessingGridOfEnabledFields(CEventServer& event)
+   {
+      CBufferIn* buffer=event.subEvents.begin()->buffer;
+      string id;
+      *buffer>>id;      
    }
 
@@ -803,17 +1360,24 @@
    void CContext::sendPostProcessing()
    {
-     if (!hasServer)
-     {
+      // Use correct context client to send message
+     // int nbSrvPools = (hasServer) ? clientPrimServer.size() : 1;
+     int nbSrvPools = (this->hasServer) ? (this->hasClient ? this->clientPrimServer.size() : 0) : 1;
+     for (int i = 0; i < nbSrvPools; ++i)
+     {
+       CContextClient* contextClientTmp = (hasServer) ? clientPrimServer[i] : client;
        CEventClient event(getType(),EVENT_ID_POST_PROCESS);
-       if (client->isServerLeader())
+       if (contextClientTmp->isServerLeader())
        {
          CMessage msg;
-         msg<<this->getIdServer();
-         const std::list<int>& ranks = client->getRanksServerLeader();
+         if (hasServer)
+           msg<<this->getIdServer(i);
+         else
+           msg<<this->getIdServer();
+         const std::list<int>& ranks = contextClientTmp->getRanksServerLeader();
          for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
-           event.push(*itRank,1,msg);
-         client->sendEvent(event);
-       }
-       else client->sendEvent(event);
+         event.push(*itRank,1,msg);
+         contextClientTmp->sendEvent(event);
+       }
+       else contextClientTmp->sendEvent(event);
      }
    }
@@ -846,4 +1410,13 @@
    }
 
+   const StdString& CContext::getIdServer(const int i)
+   {
+     idServer_ = this->getId();
+     idServer_ += "_server_";
+     idServer_ += boost::lexical_cast<string>(i);
+     return idServer_;
+   }
+
+
    /*!
    \brief Do some simple post processings after parsing xml file
@@ -867,36 +1440,49 @@
       this->solveAllInheritance();
 
+//      ShowTree(info(10));
+
       // Check if some axis, domains or grids are eligible to for compressed indexed output.
       // Warning: This must be done after solving the inheritance and before the rest of post-processing
-      checkAxisDomainsGridsEligibilityForCompressedOutput();
+      checkAxisDomainsGridsEligibilityForCompressedOutput();      
 
       // Check if some automatic time series should be generated
-      // Warning: This must be done after solving the inheritance and before the rest of post-processing
-      prepareTimeseries();
+      // Warning: This must be done after solving the inheritance and before the rest of post-processing      
+
+      // The timeseries should only be prepared in client
+      if (hasClient && !hasServer) prepareTimeseries();
 
       //Initialisation du vecteur 'enabledFiles' contenant la liste des fichiers Ã  sortir.
-      this->findEnabledFiles();
-      this->findEnabledReadModeFiles();
-
-      // Find all enabled fields of each file
-      this->findAllEnabledFields();
-      this->findAllEnabledFieldsInReadModeFiles();
-
-     if (hasClient && !hasServer)
-     {
-      // Try to read attributes of fields in file then fill in corresponding grid (or domain, axis)
-      this->readAttributesOfEnabledFieldsInReadModeFiles();
-     }
+      findEnabledFiles();
+      findEnabledWriteModeFiles();
+      findEnabledReadModeFiles();
+
+      // For now, only read files with client and only one level server
+      // if (hasClient && !hasServer) findEnabledReadModeFiles();      
+
+      // Find all enabled fields of each file      
+      findAllEnabledFieldsInFiles(this->enabledWriteModeFiles);
+      findAllEnabledFieldsInFiles(this->enabledReadModeFiles);
+
+      // For now, only read files with client and only one level server
+      // if (hasClient && !hasServer) 
+      //   findAllEnabledFieldsInFiles(this->enabledReadModeFiles);      
+
+      if (hasClient && !hasServer)
+      {
+        initReadFiles();
+        // Try to read attributes of fields in file then fill in corresponding grid (or domain, axis)
+        this->readAttributesOfEnabledFieldsInReadModeFiles();
+      }
 
       // Only search and rebuild all reference objects of enable fields, don't transform
       this->solveOnlyRefOfEnabledFields(false);
 
-      // Search and rebuild all reference object of enabled fields
-      this->solveAllRefOfEnabledFields(false);
+      // Search and rebuild all reference object of enabled fields, and transform
+      this->solveAllRefOfEnabledFieldsAndTransform(false);
 
       // Find all fields with read access from the public API
-      findFieldsWithReadAccess();
+      if (hasClient && !hasServer) findFieldsWithReadAccess();
       // and solve the all reference for them
-      solveAllRefOfFieldsWithReadAccess();
+      if (hasClient && !hasServer) solveAllRefOfFieldsWithReadAccess();
 
       isPostProcessed = true;
@@ -905,66 +1491,70 @@
    /*!
     * Compute the required buffer size to send the attributes (mostly those grid related).
-    *
     * \param maxEventSize [in/out] the size of the bigger event for each connected server
+    * \param [in] contextClient
+    * \param [in] bufferForWriting True if buffers are used for sending data for writing
+      This flag is only true for client and server-1 for communication with server-2
     */
-   std::map<int, StdSize> CContext::getAttributesBufferSize(std::map<int, StdSize>& maxEventSize)
-   {
-     std::map<int, StdSize> attributesSize;
-
-     if (hasClient)
-     {
-       size_t numEnabledFiles = this->enabledFiles.size();
-       for (size_t i = 0; i < numEnabledFiles; ++i)
-       {
-         CFile* file = this->enabledFiles[i];
-
+   std::map<int, StdSize> CContext::getAttributesBufferSize(std::map<int, StdSize>& maxEventSize,
+                                                           CContextClient* contextClient, bool bufferForWriting /*= "false"*/)
+   {
+	 // As calendar attributes are sent even if there are no active files or fields, maps are initialized according the size of calendar attributes
+     std::map<int, StdSize> attributesSize = CCalendarWrapper::get(CCalendarWrapper::GetDefName())->getMinimumBufferSizeForAttributes(contextClient);
+     maxEventSize = CCalendarWrapper::get(CCalendarWrapper::GetDefName())->getMinimumBufferSizeForAttributes(contextClient);
+
+     std::vector<CFile*>& fileList = this->enabledFiles;
+     size_t numEnabledFiles = fileList.size();
+     for (size_t i = 0; i < numEnabledFiles; ++i)
+     {
+//         CFile* file = this->enabledWriteModeFiles[i];
+        CFile* file = fileList[i];
+        std::vector<CField*> enabledFields = file->getEnabledFields();
+        size_t numEnabledFields = enabledFields.size();
+        for (size_t j = 0; j < numEnabledFields; ++j)
+        {
+          const std::map<int, StdSize> mapSize = enabledFields[j]->getGridAttributesBufferSize(contextClient, bufferForWriting);
+          std::map<int, StdSize>::const_iterator it = mapSize.begin(), itE = mapSize.end();
+          for (; it != itE; ++it)
+          {
+		     // If attributesSize[it->first] does not exist, it will be zero-initialized
+		     // so we can use it safely without checking for its existence
+             if (attributesSize[it->first] < it->second)
+			   attributesSize[it->first] = it->second;
+
+		     if (maxEventSize[it->first] < it->second)
+			   maxEventSize[it->first] = it->second;
+          }
+        }
+     }
+     return attributesSize;
+   }
+
+   /*!
+    * Compute the required buffer size to send the fields data.
+    * \param maxEventSize [in/out] the size of the bigger event for each connected server
+    * \param [in] contextClient
+    * \param [in] bufferForWriting True if buffers are used for sending data for writing
+      This flag is only true for client and server-1 for communication with server-2
+    */
+   std::map<int, StdSize> CContext::getDataBufferSize(std::map<int, StdSize>& maxEventSize,
+                                                      CContextClient* contextClient, bool bufferForWriting /*= "false"*/)
+   {
+     std::map<int, StdSize> dataSize;
+
+     // Find all reference domain and axis of all active fields
+     std::vector<CFile*>& fileList = bufferForWriting ? this->enabledWriteModeFiles : this->enabledReadModeFiles;
+     size_t numEnabledFiles = fileList.size();
+     for (size_t i = 0; i < numEnabledFiles; ++i)
+     {
+//       CFile* file = this->enabledFiles[i];
+       CFile* file = fileList[i];
+       if (file->getContextClient() == contextClient)
+       {
          std::vector<CField*> enabledFields = file->getEnabledFields();
          size_t numEnabledFields = enabledFields.size();
          for (size_t j = 0; j < numEnabledFields; ++j)
          {
-           const std::map<int, StdSize> mapSize = enabledFields[j]->getGridAttributesBufferSize();
-           std::map<int, StdSize>::const_iterator it = mapSize.begin(), itE = mapSize.end();
-           for (; it != itE; ++it)
-           {
-             // If attributesSize[it->first] does not exist, it will be zero-initialized
-             // so we can use it safely without checking for its existance
-             if (attributesSize[it->first] < it->second)
-               attributesSize[it->first] = it->second;
-
-             if (maxEventSize[it->first] < it->second)
-               maxEventSize[it->first] = it->second;
-           }
-         }
-       }
-     }
-
-     return attributesSize;
-   }
-
-   /*!
-    * Compute the required buffer size to send the fields data.
-    *
-    * \param maxEventSize [in/out] the size of the bigger event for each connected server
-    */
-   std::map<int, StdSize> CContext::getDataBufferSize(std::map<int, StdSize>& maxEventSize)
-   {
-     CFile::mode_attr::t_enum mode = hasClient ? CFile::mode_attr::write : CFile::mode_attr::read;
-
-     std::map<int, StdSize> dataSize;
-
-     // Find all reference domain and axis of all active fields
-     size_t numEnabledFiles = this->enabledFiles.size();
-     for (size_t i = 0; i < numEnabledFiles; ++i)
-     {
-       CFile* file = this->enabledFiles[i];
-       CFile::mode_attr::t_enum fileMode = file->mode.isEmpty() ? CFile::mode_attr::write : file->mode.getValue();
-
-       if (fileMode == mode)
-       {
-         std::vector<CField*> enabledFields = file->getEnabledFields();
-         size_t numEnabledFields = enabledFields.size();
-         for (size_t j = 0; j < numEnabledFields; ++j)
-         {
-           const std::map<int, StdSize> mapSize = enabledFields[j]->getGridDataBufferSize();
+           // const std::vector<std::map<int, StdSize> > mapSize = enabledFields[j]->getGridDataBufferSize(contextClient);
+           const std::map<int, StdSize> mapSize = enabledFields[j]->getGridDataBufferSize(contextClient,bufferForWriting);
            std::map<int, StdSize>::const_iterator it = mapSize.begin(), itE = mapSize.end();
            for (; it != itE; ++it)
@@ -972,10 +1562,10 @@
              // If dataSize[it->first] does not exist, it will be zero-initialized
              // so we can use it safely without checking for its existance
-             if (CXios::isOptPerformance)
+        	 if (CXios::isOptPerformance)
                dataSize[it->first] += it->second;
              else if (dataSize[it->first] < it->second)
                dataSize[it->first] = it->second;
 
-             if (maxEventSize[it->first] < it->second)
+        	 if (maxEventSize[it->first] < it->second)
                maxEventSize[it->first] = it->second;
            }
@@ -983,12 +1573,11 @@
        }
      }
-
      return dataSize;
    }
 
    //! Client side: Send infomation of active files (files are enabled to write out)
-   void CContext::sendEnabledFiles()
-   {
-     int size = this->enabledFiles.size();
+   void CContext::sendEnabledFiles(const std::vector<CFile*>& activeFiles)
+   {
+     int size = activeFiles.size();
 
      // In a context, each type has a root definition, e.g: axis, domain, field.
@@ -1000,17 +1589,18 @@
      for (int i = 0; i < size; ++i)
      {
-       cfgrpPtr->sendCreateChild(this->enabledFiles[i]->getId());
-       this->enabledFiles[i]->sendAllAttributesToServer();
-       this->enabledFiles[i]->sendAddAllVariables();
+       CFile* f = activeFiles[i];
+       cfgrpPtr->sendCreateChild(f->getId(),f->getContextClient());
+       f->sendAllAttributesToServer(f->getContextClient());
+       f->sendAddAllVariables(f->getContextClient());
      }
    }
 
    //! Client side: Send information of active fields (ones are written onto files)
-   void CContext::sendEnabledFields()
-   {
-     int size = this->enabledFiles.size();
+   void CContext::sendEnabledFieldsInFiles(const std::vector<CFile*>& activeFiles)
+   {
+     int size = activeFiles.size();
      for (int i = 0; i < size; ++i)
      {
-       this->enabledFiles[i]->sendEnabledFields();
+       activeFiles[i]->sendEnabledFields(activeFiles[i]->getContextClient());
      }
    }
@@ -1135,8 +1725,8 @@
 
    //! Client side: Send information of reference grid of active fields
-   void CContext::sendRefGrid()
+   void CContext::sendRefGrid(const std::vector<CFile*>& activeFiles)
    {
      std::set<StdString> gridIds;
-     int sizeFile = this->enabledFiles.size();
+     int sizeFile = activeFiles.size();
      CFile* filePtr(NULL);
 
@@ -1144,5 +1734,5 @@
      for (int i = 0; i < sizeFile; ++i)
      {
-       filePtr = this->enabledFiles[i];
+       filePtr = activeFiles[i];
        std::vector<CField*> enabledFields = filePtr->getEnabledFields();
        int sizeField = enabledFields.size();
@@ -1168,15 +1758,14 @@
    }
 
-
-   //! Client side: Send information of reference domain and axis of active fields
-   void CContext::sendRefDomainsAxis()
+   //! Client side: Send information of reference domain, axis and scalar of active fields
+   void CContext::sendRefDomainsAxisScalars(const std::vector<CFile*>& activeFiles)
    {
      std::set<StdString> domainIds, axisIds, scalarIds;
 
      // Find all reference domain and axis of all active fields
-     int numEnabledFiles = this->enabledFiles.size();
+     int numEnabledFiles = activeFiles.size();
      for (int i = 0; i < numEnabledFiles; ++i)
      {
-       std::vector<CField*> enabledFields = this->enabledFiles[i]->getEnabledFields();
+       std::vector<CField*> enabledFields = activeFiles[i]->getEnabledFields();
        int numEnabledFields = enabledFields.size();
        for (int j = 0; j < numEnabledFields; ++j)
@@ -1237,5 +1826,5 @@
       if (prevStep < step)
       {
-        if (hasClient)
+        if (hasClient && !hasServer) // For now we only use server level 1 to read data
         {
           doPreTimestepOperationsForEnabledReadModeFiles();
@@ -1249,5 +1838,5 @@
   #endif
 
-        if (hasClient)
+        if (hasClient && !hasServer) // For now we only use server level 1 to read data
         {
           doPostTimestepOperationsForEnabledReadModeFiles();
@@ -1262,12 +1851,23 @@
    }
 
+   void CContext::initReadFiles(void)
+   {
+      vector<CFile*>::const_iterator it;
+
+      for (it=enabledReadModeFiles.begin(); it != enabledReadModeFiles.end(); it++)
+      {
+         (*it)->initRead();
+      }
+   }
+
    //! Server side: Create header of netcdf file
-   void CContext::createFileHeader(void )
+   void CContext::createFileHeader(void)
    {
       vector<CFile*>::const_iterator it;
 
       for (it=enabledFiles.begin(); it != enabledFiles.end(); it++)
+      // for (it=enabledWriteModeFiles.begin(); it != enabledWriteModeFiles.end(); it++)
       {
-         (*it)->initFile();
+         (*it)->initWrite();
       }
    }
@@ -1310,5 +1910,4 @@
     return (context);
   }
-
 
 
@@ -1336,17 +1935,35 @@
     registryOut->hierarchicalGatherRegistry() ;
 
-    CEventClient event(CContext::GetType(), CContext::EVENT_ID_SEND_REGISTRY);
-    if (client->isServerLeader())
+    // Use correct context client to send message
+    int nbSrvPools = (this->hasServer) ? (this->hasClient ? this->clientPrimServer.size() : 0) : 1;
+    for (int i = 0; i < nbSrvPools; ++i)
     {
-       CMessage msg ;
-       msg<<this->getIdServer();
-       if (client->clientRank==0) msg<<*registryOut ;
-       const std::list<int>& ranks = client->getRanksServerLeader();
-       for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
-         event.push(*itRank,1,msg);
-       client->sendEvent(event);
-     }
-     else client->sendEvent(event);
+      CContextClient* contextClientTmp = (hasServer) ? clientPrimServer[i] : client;
+      CEventClient event(CContext::GetType(), CContext::EVENT_ID_SEND_REGISTRY);
+        if (contextClientTmp->isServerLeader())
+        {
+           CMessage msg ;
+           if (hasServer)
+             msg<<this->getIdServer(i);
+           else
+             msg<<this->getIdServer();
+           if (contextClientTmp->clientRank==0) msg<<*registryOut ;
+           const std::list<int>& ranks = contextClientTmp->getRanksServerLeader();
+           for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
+             event.push(*itRank,1,msg);
+           contextClientTmp->sendEvent(event);
+         }
+         else contextClientTmp->sendEvent(event);
+    }
   }
 
+  /*!
+  * \fn bool CContext::isFinalized(void)
+  * Context is finalized if it received context post finalize event.
+  */
+  bool CContext::isFinalized(void)
+  {
+    return finalized;
+  }
+
 } // namespace xios
Index: /XIOS/trunk/src/node/context.hpp
===================================================================
--- /XIOS/trunk/src/node/context.hpp	(revision 1536)
+++ /XIOS/trunk/src/node/context.hpp	(revision 1537)
@@ -51,5 +51,7 @@
            EVENT_ID_CLOSE_DEFINITION,EVENT_ID_UPDATE_CALENDAR,
            EVENT_ID_CREATE_FILE_HEADER,EVENT_ID_CONTEXT_FINALIZE,
-           EVENT_ID_POST_PROCESS, EVENT_ID_SEND_REGISTRY
+           EVENT_ID_POST_PROCESS, EVENT_ID_SEND_REGISTRY,
+           EVENT_ID_POST_PROCESS_GLOBAL_ATTRIBUTES,
+           EVENT_ID_PROCESS_GRID_ENABLED_FIELDS
          };
 
@@ -88,29 +90,33 @@
       public :
          // Initialize server or client
+         void initClient(MPI_Comm intraComm, MPI_Comm interComm, CContext* cxtServer = 0);
          void initServer(MPI_Comm intraComm, MPI_Comm interComm, CContext* cxtClient = 0);
-         void initClient(MPI_Comm intraComm, MPI_Comm interComm, CContext* cxtServer = 0);
          bool isInitialized(void);
 
          // Put sever or client into loop state
-         bool checkBuffersAndListen(void);
+         bool checkBuffersAndListen(bool enableEventsProcessing=true);
 
          // Finalize a context
          void finalize(void);
+         bool isFinalized(void);
+
          void closeDefinition(void);
 
          // Some functions to process context
-         void findAllEnabledFields(void);
-         void findAllEnabledFieldsInReadModeFiles(void);
+         void findAllEnabledFieldsInFiles(const std::vector<CFile*>& activeFiles);
+         // void findAllEnabledFields(void);
+         // void findAllEnabledFieldsInReadModeFiles(void);
          void readAttributesOfEnabledFieldsInReadModeFiles();
          void solveAllInheritance(bool apply=true);
          void findEnabledFiles(void);
+         void findEnabledWriteModeFiles(void);
          void findEnabledReadModeFiles(void);
          void closeAllFile(void);
          void updateCalendar(int step);
-         void createFileHeader(void );
+         void createFileHeader(void);
+         void initReadFiles(void);
          void checkAxisDomainsGridsEligibilityForCompressedOutput();
          void prepareTimeseries(void);
-         void solveOnlyRefOfEnabledFields(bool sendToServer);
-         void solveAllRefOfEnabledFields(bool sendToServer);
+         void solveOnlyRefOfEnabledFields(bool sendToServer);         
          void buildFilterGraphOfEnabledFields();
          void postProcessFilterGraph();
@@ -122,8 +128,21 @@
          void buildFilterGraphOfFieldsWithReadAccess();
          void postProcessing();
-
-         std::map<int, StdSize> getAttributesBufferSize(std::map<int, StdSize>& maxEventSize);
-         std::map<int, StdSize> getDataBufferSize(std::map<int, StdSize>& maxEventSize);
-         void setClientServerBuffer();
+         void postProcessingGlobalAttributes();         
+
+         void solveAllRefOfEnabledFieldsAndTransform(bool sendToServer);
+         void checkGridEnabledFields();
+         void checkGridEnabledFieldsInFiles(const std::vector<CFile*>& activeFiles);
+         void sendGridEnabledFieldsInFiles(const std::vector<CFile*>& activeFiles);  
+         void sendGridComponentEnabledFieldsInFiles(const std::vector<CFile*>& activeFiles)       ;
+
+         std::map<int, StdSize> getAttributesBufferSize(std::map<int, StdSize>& maxEventSize, CContextClient* contextClient, bool bufferForWriting = false);
+         std::map<int, StdSize> getDataBufferSize(std::map<int, StdSize>& maxEventSize, CContextClient* contextClient, bool bufferForWriting = false);
+         void setClientServerBuffer(CContextClient* contextClient, bool bufferForWriting = false);
+
+         // Distribute files (in write mode) among secondary-server pools according to the estimated data flux
+         void distributeFiles(void);
+         void distributeFileOverBandwith() ;
+         void distributeFileOverMemoryBandwith() ;
+         
 
          // Send context close definition
@@ -132,11 +151,16 @@
          void sendUpdateCalendar(int step);
          void sendCreateFileHeader(void);
-         void sendEnabledFiles();
-         void sendEnabledFields();
-         void sendRefDomainsAxis();
-         void sendRefGrid();
+         void sendEnabledFiles(const std::vector<CFile*>& activeFiles);
+         void sendEnabledFieldsInFiles(const std::vector<CFile*>& activeFiles);
+         void sendRefDomainsAxisScalars(const std::vector<CFile*>& activeFiles);
+         void sendRefGrid(const std::vector<CFile*>& activeFiles);
          void sendPostProcessing();
-         void sendRegistry(void) ; //!< after be gathered to the root process of the context, merged registry is sent to the root process of the servers
+         void sendPostProcessingGlobalAttributes();
+         void sendProcessingGridOfEnabledFields();
+         //!< after be gathered to the root process of the context, merged registry is sent to the root process of the servers
+         void sendRegistry(void) ;
+
          const StdString& getIdServer();
+         const StdString& getIdServer(const int srvPoolNb);
 
          // Client side: Receive and process messages
@@ -150,6 +174,12 @@
          static void recvPostProcessing(CEventServer& event);
          void recvPostProcessing(CBufferIn& buffer);
+         static void recvProcessingGridOfEnabledFields(CEventServer& event);
+         static void recvPostProcessingGlobalAttributes(CEventServer& event);
+         void recvPostProcessingGlobalAttributes(CBufferIn& buffer);
          static void recvRegistry(CEventServer& event) ;
-         void recvRegistry(CBufferIn& buffer) ; //!< registry is received by the root process of the servers
+         void recvRegistry(CBufferIn& buffer) ; //!< registry is received by the servers
+
+         void freeComms(void);                  //!< Free internally allcoated communicators
+         void releaseClientBuffers(void);       //! Deallocate buffers allocated by clientContexts
 
          // dispatch event
@@ -194,4 +224,5 @@
          virtual bool hasChild(void) const;
 
+
       public :
          // Calendar of context
@@ -202,4 +233,6 @@
          // List of all enabled files in read mode (files on which fields are read)
          std::vector<CFile*> enabledReadModeFiles;
+         // List of all enabled files in write mode
+         std::vector<CFile*> enabledWriteModeFiles;
 
          // List of all enabled fields whose instant data is accessible from the public API
@@ -216,15 +249,17 @@
          bool hasServer;
 
-         // Concrete context server
-         CContextServer* server;
-
-         // Concrete contex client
-         CContextClient* client;
-         CRegistry* registryIn ;  //!< input registry which is read from file
-         CRegistry* registryOut ; //!< output registry which will be wrote on file at the finalize
+         CContextServer* server;    //!< Concrete context server
+         CContextClient* client;    //!< Concrete contex client
+         std::vector<CContextServer*> serverPrimServer;
+         std::vector<CContextClient*> clientPrimServer;
+
+         CRegistry* registryIn ;    //!< input registry which is read from file
+         CRegistry* registryOut ;   //!< output registry which will be written into file at the finalize
 
       private:
          bool isPostProcessed;
+         bool allProcessed;
          bool finalized;
+         int countChildCtx_;        //!< Counter of child contexts (for now it is the number of secondary server pools)
          StdString idServer_;
          CGarbageCollector garbageCollector;
Index: /XIOS/trunk/src/node/domain.cpp
===================================================================
--- /XIOS/trunk/src/node/domain.cpp	(revision 1536)
+++ /XIOS/trunk/src/node/domain.cpp	(revision 1537)
@@ -18,7 +18,4 @@
 #include "server_distribution_description.hpp"
 #include "client_server_mapping_distributed.hpp"
-#include "zoom_domain.hpp"
-#include "interpolate_domain.hpp"
-#include "generate_rectilinear_domain.hpp"
 
 #include <algorithm>
@@ -30,9 +27,11 @@
    CDomain::CDomain(void)
       : CObjectTemplate<CDomain>(), CDomainAttributes()
-      , isChecked(false), relFiles(), isClientChecked(false), nbConnectedClients_(), indSrv_(), connectedServerRank_()
-      , hasBounds(false), hasArea(false), isDistributed_(false), isCompressible_(false), isUnstructed_(false)
+      , isChecked(false), relFiles(), isClientChecked(false), nbSenders(), indSrv_(), connectedServerRank_()
+      , hasBounds(false), hasArea(false), isCompressible_(false), isUnstructed_(false)
       , isClientAfterTransformationChecked(false), hasLonLat(false)
-      , lonvalue_client(), latvalue_client(), bounds_lon_client(), bounds_lat_client()
-      , isRedistributed_(false), hasPole(false)
+      , isRedistributed_(false), hasPole(false), doZoomByIndex_(false)
+      , lonvalue(), latvalue(), bounds_lonvalue(), bounds_latvalue()
+      , globalLocalIndexMap_(), computedWrittenIndex_(false)
+	  , clients()
    {
    }
@@ -40,11 +39,13 @@
    CDomain::CDomain(const StdString & id)
       : CObjectTemplate<CDomain>(id), CDomainAttributes()
-      , isChecked(false), relFiles(), isClientChecked(false), nbConnectedClients_(), indSrv_(), connectedServerRank_()
-      , hasBounds(false), hasArea(false), isDistributed_(false), isCompressible_(false), isUnstructed_(false)
+      , isChecked(false), relFiles(), isClientChecked(false), nbSenders(), indSrv_(), connectedServerRank_() 
+      , hasBounds(false), hasArea(false), isCompressible_(false), isUnstructed_(false)
       , isClientAfterTransformationChecked(false), hasLonLat(false)
-      , lonvalue_client(), latvalue_client(), bounds_lon_client(), bounds_lat_client()
-      , isRedistributed_(false), hasPole(false)
-   {
-	 }
+      , isRedistributed_(false), hasPole(false), doZoomByIndex_(false)
+      , lonvalue(), latvalue(), bounds_lonvalue(), bounds_latvalue()
+      , globalLocalIndexMap_(), computedWrittenIndex_(false)
+	  , clients()
+   {
+    }
 
    CDomain::~CDomain(void)
@@ -75,4 +76,5 @@
      m["compute_connectivity_domain"] = TRANS_COMPUTE_CONNECTIVITY_DOMAIN;
      m["expand_domain"] = TRANS_EXPAND_DOMAIN;
+     m["reorder_domain"] = TRANS_REORDER_DOMAIN;
    }
 
@@ -82,9 +84,4 @@
    }
 
-
-   const std::vector<int>& CDomain::getIndexesToWrite(void) const
-   {
-     return indexesToWrite;
-   }
 
    /*!
@@ -92,7 +89,9 @@
      \return the number of indexes written by each server
    */
-   int CDomain::getNumberWrittenIndexes() const
-   {
-     return numberWrittenIndexes_;
+   int CDomain::getNumberWrittenIndexes(MPI_Comm writtenCom)
+   {
+     int writtenSize;
+     MPI_Comm_size(writtenCom, &writtenSize);
+     return numberWrittenIndexes_[writtenSize];
    }
 
@@ -101,7 +100,9 @@
      \return the total number of indexes written by the servers
    */
-   int CDomain::getTotalNumberWrittenIndexes() const
-   {
-     return totalNumberWrittenIndexes_;
+   int CDomain::getTotalNumberWrittenIndexes(MPI_Comm writtenCom)
+   {
+     int writtenSize;
+     MPI_Comm_size(writtenCom, &writtenSize);
+     return totalNumberWrittenIndexes_[writtenSize];
    }
 
@@ -110,7 +111,16 @@
      \return the offset of indexes written by each server
    */
-   int CDomain::getOffsetWrittenIndexes() const
-   {
-     return offsetWrittenIndexes_;
+   int CDomain::getOffsetWrittenIndexes(MPI_Comm writtenCom)
+   {
+     int writtenSize;
+     MPI_Comm_size(writtenCom, &writtenSize);
+     return offsetWrittenIndexes_[writtenSize];
+   }
+
+   CArray<int, 1>& CDomain::getCompressedIndexToWriteOnServer(MPI_Comm writtenCom)
+   {
+     int writtenSize;
+     MPI_Comm_size(writtenCom, &writtenSize);
+     return compressedIndexToWriteOnServer[writtenSize];
    }
 
@@ -122,13 +132,12 @@
     * \return A map associating the server rank with its minimum buffer size.
     */
-   std::map<int, StdSize> CDomain::getAttributesBufferSize()
-   {
-     CContextClient* client = CContext::getCurrent()->client;
-
-     std::map<int, StdSize> attributesSizes = getMinimumBufferSizeForAttributes();
+   std::map<int, StdSize> CDomain::getAttributesBufferSize(CContextClient* client, bool bufferForWriting /*= false*/)
+   {
+
+     std::map<int, StdSize> attributesSizes = getMinimumBufferSizeForAttributes(client);
 
      if (client->isServerLeader())
      {
-       // size estimation for sendServerAttribut
+       // size estimation for sendDistributionAttribut
        size_t size = 11 * sizeof(size_t);
 
@@ -141,20 +150,20 @@
      }
 
-     std::map<int, std::vector<size_t> >::const_iterator itIndexEnd = indSrv_.end();
-     std::map<int, std::vector<int> >::const_iterator itWrittenIndexEnd = indWrittenSrv_.end();
-     for (size_t k = 0; k < connectedServerRank_.size(); ++k)
-     {
-       int rank = connectedServerRank_[k];
-       std::map<int, std::vector<size_t> >::const_iterator it = indSrv_.find(rank);
+     boost::unordered_map<int, vector<size_t> >::const_iterator itIndexEnd = indSrv_[client->serverSize].end();
+     // std::map<int, std::vector<int> >::const_iterator itWrittenIndexEnd = indWrittenSrv_.end();
+     for (size_t k = 0; k < connectedServerRank_[client->serverSize].size(); ++k)
+     {
+       int rank = connectedServerRank_[client->serverSize][k];
+       boost::unordered_map<int, std::vector<size_t> >::const_iterator it = indSrv_[client->serverSize].find(rank);
        size_t idxCount = (it != itIndexEnd) ? it->second.size() : 0;
 
        // size estimation for sendIndex (and sendArea which is always smaller or equal)
        size_t sizeIndexEvent = 2 * sizeof(size_t) + 2 * CArray<int,1>::size(idxCount);
-       if (isCompressible_)
-       {
-         std::map<int, std::vector<int> >::const_iterator itWritten = indWrittenSrv_.find(rank);
-         size_t writtenIdxCount = (itWritten != itWrittenIndexEnd) ? itWritten->second.size() : 0;
-         sizeIndexEvent += CArray<int,1>::size(writtenIdxCount);
-       }
+       // if (isCompressible_)
+       // {
+       //   std::map<int, std::vector<int> >::const_iterator itWritten = indWrittenSrv_.find(rank);
+       //   size_t writtenIdxCount = (itWritten != itWrittenIndexEnd) ? itWritten->second.size() : 0;
+       //   sizeIndexEvent += CArray<int,1>::size(writtenIdxCount);
+       // }
 
        // size estimation for sendLonLat
@@ -175,6 +184,6 @@
    bool CDomain::isEmpty(void) const
    {
-      return ((this->zoom_ni_srv == 0) ||
-              (this->zoom_nj_srv == 0));
+      return ((this->zoom_i_index.isEmpty()) || (0 == this->zoom_i_index.numElements()));
+
    }
 
@@ -195,5 +204,9 @@
    bool CDomain::isDistributed(void) const
    {
-      return isDistributed_;
+      bool distributed =  !((!ni.isEmpty() && (ni == ni_glo) && !nj.isEmpty() && (nj == nj_glo)) ||
+              (!i_index.isEmpty() && i_index.numElements() == ni_glo*nj_glo));
+      distributed |= (1 == CContext::getCurrent()->client->clientSize);
+
+      return distributed;
    }
 
@@ -244,5 +257,5 @@
 
    /*!
-     Redistribute RECTILINEAR domain with a number of local domains.
+     Redistribute RECTILINEAR or CURVILINEAR domain with a number of local domains.
    All attributes ni,nj,ibegin,jbegin (if defined) will be rewritten
    The optional attributes lonvalue, latvalue will be added. Because this function only serves (for now)
@@ -256,5 +269,7 @@
      this->isRedistributed_ = true;
      CContext* context = CContext::getCurrent();
-     CContextClient* client = context->client;
+     // For now the assumption is that secondary server pools consist of the same number of procs.
+     // CHANGE the line below if the assumption changes.
+     CContextClient* client = (0 != context->clientPrimServer.size()) ? context->clientPrimServer[0] : context->client;
      int rankClient = client->clientRank;
      int rankOnDomain = rankClient%nbLocalDomain;
@@ -522,5 +537,5 @@
        for (int jdx = 0; jdx < nj; ++jdx)
         for (int idx = 0; idx < ni; ++idx)
-         lonvalue_2d(idx,jdx) = lonvalue_curvilinear_read_from_file(idx+ibegin, jdx+jbegin);
+         lonvalue_2d(idx,jdx) = lonvalue_curvilinear_read_from_file(idx, jdx);
 
        lonvalue_curvilinear_read_from_file.free();
@@ -532,5 +547,5 @@
        for (int jdx = 0; jdx < nj; ++jdx)
         for (int idx = 0; idx < ni; ++idx)
-         latvalue_2d(idx,jdx) = latvalue_curvilinear_read_from_file(idx+ibegin, jdx+jbegin);
+           latvalue_2d(idx,jdx) = latvalue_curvilinear_read_from_file(idx, jdx);
 
        latvalue_curvilinear_read_from_file.free();
@@ -543,5 +558,5 @@
         for (int idx = 0; idx < ni; ++idx)
           for (int ndx = 0; ndx < nvertex; ++ndx)
-         bounds_lon_2d(ndx,idx,jdx) = bounds_lonvalue_curvilinear_read_from_file(ndx,idx+ibegin, jdx+jbegin);
+            bounds_lon_2d(ndx,idx,jdx) = bounds_lonvalue_curvilinear_read_from_file(ndx,idx, jdx);
 
        bounds_lonvalue_curvilinear_read_from_file.free();
@@ -554,5 +569,5 @@
         for (int idx = 0; idx < ni; ++idx)
           for (int ndx = 0; ndx < nvertex; ++ndx)
-            bounds_lat_2d(ndx,idx,jdx) = bounds_latvalue_curvilinear_read_from_file(ndx,idx+ibegin, jdx+jbegin);
+            bounds_lat_2d(ndx,idx,jdx) = bounds_latvalue_curvilinear_read_from_file(ndx,idx, jdx);
 
        bounds_latvalue_curvilinear_read_from_file.free();
@@ -577,5 +592,5 @@
         lonvalue_1d.resize(ni);
         for (int idx = 0; idx < ni; ++idx)
-          lonvalue_1d(idx) = lonvalue_unstructured_read_from_file(i_index(idx));
+          lonvalue_1d(idx) = lonvalue_unstructured_read_from_file(idx);
 
         // We dont need these values anymore, so just delete them
@@ -587,5 +602,5 @@
         latvalue_1d.resize(ni);
         for (int idx = 0; idx < ni; ++idx)
-          latvalue_1d(idx) =  latvalue_unstructured_read_from_file(i_index(idx));
+          latvalue_1d(idx) =  latvalue_unstructured_read_from_file(idx);
 
         // We dont need these values anymore, so just delete them
@@ -599,8 +614,8 @@
         for (int idx = 0; idx < ni; ++idx)
           for (int jdx = 0; jdx < nbVertex; ++jdx)
-            bounds_lon_1d(jdx,idx) = bounds_lonvalue_unstructured_read_from_file(jdx, i_index(idx));
+            bounds_lon_1d(jdx,idx) = bounds_lonvalue_unstructured_read_from_file(jdx, idx);
 
         // We dont need these values anymore, so just delete them
-        lonvalue_unstructured_read_from_file.free();
+        bounds_lonvalue_unstructured_read_from_file.free();
      }
 
@@ -611,8 +626,8 @@
         for (int idx = 0; idx < ni; ++idx)
           for (int jdx = 0; jdx < nbVertex; ++jdx)
-            bounds_lat_1d(jdx,idx) = bounds_latvalue_unstructured_read_from_file(jdx, i_index(idx));
+            bounds_lat_1d(jdx,idx) = bounds_latvalue_unstructured_read_from_file(jdx, idx);
 
         // We dont need these values anymore, so just delete them
-        lonvalue_unstructured_read_from_file.free();
+        bounds_latvalue_unstructured_read_from_file.free();
      }
    }
@@ -623,26 +638,28 @@
    void CDomain::AllgatherRectilinearLonLat(CArray<double,1>& lon, CArray<double,1>& lat, CArray<double,1>& lon_g, CArray<double,1>& lat_g)
    {
-	  CContext* context = CContext::getCurrent();
-      CContextClient* client = context->client;
-	  lon_g.resize(ni_glo) ;
-	  lat_g.resize(nj_glo) ;
-
-
-	  int* ibegin_g = new int[client->clientSize] ;
-	  int* jbegin_g = new int[client->clientSize] ;
-	  int* ni_g = new int[client->clientSize] ;
-	  int* nj_g = new int[client->clientSize] ;
-	  int v ;
-	  v=ibegin ;
-	  MPI_Allgather(&v,1,MPI_INT,ibegin_g,1,MPI_INT,client->intraComm) ;
-	  v=jbegin ;
-	  MPI_Allgather(&v,1,MPI_INT,jbegin_g,1,MPI_INT,client->intraComm) ;
-	  v=ni ;
-	  MPI_Allgather(&v,1,MPI_INT,ni_g,1,MPI_INT,client->intraComm) ;
-	  v=nj ;
-	  MPI_Allgather(&v,1,MPI_INT,nj_g,1,MPI_INT,client->intraComm) ;
-
-	  MPI_Allgatherv(lon.dataFirst(),ni,MPI_DOUBLE,lon_g.dataFirst(),ni_g, ibegin_g,MPI_DOUBLE,client->intraComm) ;
-	  MPI_Allgatherv(lat.dataFirst(),nj,MPI_DOUBLE,lat_g.dataFirst(),nj_g, jbegin_g,MPI_DOUBLE,client->intraComm) ;
+     CContext* context = CContext::getCurrent();
+    // For now the assumption is that secondary server pools consist of the same number of procs.
+    // CHANGE the line below if the assumption changes.
+    CContextClient* client = (0 != context->clientPrimServer.size()) ? context->clientPrimServer[0] : context->client;
+     lon_g.resize(ni_glo) ;
+     lat_g.resize(nj_glo) ;
+
+
+     int* ibegin_g = new int[client->clientSize] ;
+     int* jbegin_g = new int[client->clientSize] ;
+     int* ni_g = new int[client->clientSize] ;
+     int* nj_g = new int[client->clientSize] ;
+     int v ;
+     v=ibegin ;
+     MPI_Allgather(&v,1,MPI_INT,ibegin_g,1,MPI_INT,client->intraComm) ;
+     v=jbegin ;
+     MPI_Allgather(&v,1,MPI_INT,jbegin_g,1,MPI_INT,client->intraComm) ;
+     v=ni ;
+     MPI_Allgather(&v,1,MPI_INT,ni_g,1,MPI_INT,client->intraComm) ;
+     v=nj ;
+     MPI_Allgather(&v,1,MPI_INT,nj_g,1,MPI_INT,client->intraComm) ;
+
+     MPI_Allgatherv(lon.dataFirst(),ni,MPI_DOUBLE,lon_g.dataFirst(),ni_g, ibegin_g,MPI_DOUBLE,client->intraComm) ;
+     MPI_Allgatherv(lat.dataFirst(),nj,MPI_DOUBLE,lat_g.dataFirst(),nj_g, jbegin_g,MPI_DOUBLE,client->intraComm) ;
 
       delete[] ibegin_g ;
@@ -754,4 +771,7 @@
    }
 
+   /*
+     General check of the domain to verify its mandatory attributes
+   */
    void CDomain::checkDomain(void)
    {
@@ -766,9 +786,9 @@
      if (type == type_attr::gaussian) 
      {
-  	   hasPole=true ;
-	     type.setValue(type_attr::unstructured) ;
-	   }
-	   else if (type == type_attr::rectilinear) hasPole=true ;
-	 
+        hasPole=true ;
+        type.setValue(type_attr::unstructured) ;
+      }
+      else if (type == type_attr::rectilinear) hasPole=true ;
+
      if (type == type_attr::unstructured)
      {
@@ -847,11 +867,4 @@
      
      checkZoom();
-     
-     isDistributed_ = !((!ni.isEmpty() && (ni == ni_glo) && !nj.isEmpty() && (nj == nj_glo)) ||
-                        (!i_index.isEmpty() && i_index.numElements() == ni_glo*nj_glo));
-
-     // A stupid condition to make sure that if there is only one client, domain
-     // should be considered to be distributed. This should be a temporary solution     
-     isDistributed_ |= (1 == CContext::getCurrent()->client->clientSize);
    }
 
@@ -868,6 +881,16 @@
      if (global_zoom_nj.isEmpty())
       global_zoom_nj.setValue(nj_glo);
-   }
-
+    if (zoom_i_index.isEmpty()) zoom_i_index.setValue(i_index.getValue());
+    if (zoom_j_index.isEmpty()) zoom_j_index.setValue(j_index.getValue());
+    if (zoom_ibegin.isEmpty()) zoom_ibegin.setValue(ibegin);
+    if (zoom_ni.isEmpty()) zoom_ni.setValue(ni);
+    if (zoom_jbegin.isEmpty()) zoom_jbegin.setValue(jbegin);
+    if (zoom_nj.isEmpty()) zoom_nj.setValue(nj);
+   }
+
+   size_t CDomain::getGlobalWrittenSize(void)
+   {
+      return global_zoom_ni*global_zoom_nj ;
+   }
    //----------------------------------------------------------------
 
@@ -1016,14 +1039,19 @@
       if (!mask_2d.isEmpty())
       {
-        mask_1d.resize(mask_2d.extent(0) * mask_2d.extent(1));
+        domainMask.resize(mask_2d.extent(0) * mask_2d.extent(1));
         for (int j = 0; j < nj; ++j)
-          for (int i = 0; i < ni; ++i) mask_1d(i+j*ni) = mask_2d(i,j);
-        mask_2d.reset();
+          for (int i = 0; i < ni; ++i) domainMask(i+j*ni) = mask_2d(i,j);
+//        mask_2d.reset();
       }
       else if (mask_1d.isEmpty())
       {
-        mask_1d.resize(i_index.numElements());
-        for (int i = 0; i < i_index.numElements(); ++i) mask_1d(i) = true;
-      }
+        domainMask.resize(i_index.numElements());
+        for (int i = 0; i < i_index.numElements(); ++i) domainMask(i) = true;
+      }
+      else
+      {
+      domainMask.resize(mask_1d.numElements());
+      domainMask=mask_1d ;
+     }
    }
 
@@ -1144,11 +1172,6 @@
    void CDomain::computeLocalMask(void)
    {
-     localMask.resize(ni*nj) ;
+     localMask.resize(i_index.numElements()) ;
      localMask=false ;
-     size_t zoom_ibegin=global_zoom_ibegin ;
-     size_t zoom_iend=global_zoom_ibegin+global_zoom_ni-1 ;
-     size_t zoom_jbegin=global_zoom_jbegin ;
-     size_t zoom_jend=global_zoom_jbegin+global_zoom_nj-1 ;
-
 
      size_t dn=data_i_index.numElements() ;
@@ -1162,25 +1185,21 @@
           i=data_i_index(k)+data_ibegin ;
           j=data_j_index(k)+data_jbegin ;
+          if (i>=0 && i<ni && j>=0 && j<nj)
+          {
+            ind=j*ni+i ;
+            localMask(ind)=domainMask(ind) ;
+          }
        }
        else
        {
-          i=(data_i_index(k)+data_ibegin)%ni ;
-          j=(data_i_index(k)+data_ibegin)/ni ;
+          i=data_i_index(k)+data_ibegin ;
+          if (i>=0 && i<i_index.numElements())
+          {
+            ind=i ;
+            localMask(ind)=domainMask(ind) ;
+          }
        }
-
-       if (i>=0 && i<ni && j>=0 && j<nj)
-         if (i+ibegin>=zoom_ibegin && i+ibegin<=zoom_iend && j+jbegin>=zoom_jbegin && j+jbegin<=zoom_jend)
-         {
-           ind=i+ni*j ;
-           localMask(ind)=mask_1d(ind) ;
-         }
-     }
-   }
-
-
-
-
-
-
+     }
+   }
 
    void CDomain::checkEligibilityForCompressedOutput(void)
@@ -1192,14 +1211,20 @@
    //----------------------------------------------------------------
 
+   /*
+     Fill in longitude and latitude value from clients (or models) into internal values lonvalue, latvalue which
+     will be used by XIOS.
+   */
    void CDomain::completeLonLatClient(void)
    {
-     if (!lonvalue_2d.isEmpty())
-     {
-       lonvalue_client.resize(ni * nj);
-       latvalue_client.resize(ni * nj);
+     bool lonlatValueExisted = (0 != lonvalue.numElements()) || (0 != latvalue.numElements());
+     checkBounds() ;
+     if (!lonvalue_2d.isEmpty() && !lonlatValueExisted)
+     {
+       lonvalue.resize(ni * nj);
+       latvalue.resize(ni * nj);
        if (hasBounds)
        {
-         bounds_lon_client.resize(nvertex, ni * nj);
-         bounds_lat_client.resize(nvertex, ni * nj);
+         bounds_lonvalue.resize(nvertex, ni * nj);
+         bounds_latvalue.resize(nvertex, ni * nj);
        }
 
@@ -1210,6 +1235,6 @@
            int k = j * ni + i;
 
-           lonvalue_client(k) = lonvalue_2d(i,j);
-           latvalue_client(k) = latvalue_2d(i,j);
+           lonvalue(k) = lonvalue_2d(i,j);
+           latvalue(k) = latvalue_2d(i,j);
 
            if (hasBounds)
@@ -1217,6 +1242,6 @@
              for (int n = 0; n < nvertex; ++n)
              {
-               bounds_lon_client(n,k) = bounds_lon_2d(n,i,j);
-               bounds_lat_client(n,k) = bounds_lat_2d(n,i,j);
+               bounds_lonvalue(n,k) = bounds_lon_2d(n,i,j);
+               bounds_latvalue(n,k) = bounds_lat_2d(n,i,j);
              }
            }
@@ -1224,5 +1249,5 @@
        }
      }
-     else if (!lonvalue_1d.isEmpty())
+     else if (!lonvalue_1d.isEmpty()  && !lonlatValueExisted)
      {
        if (type_attr::rectilinear == type)
@@ -1230,10 +1255,10 @@
          if (ni == lonvalue_1d.numElements() && nj == latvalue_1d.numElements())
          {
-           lonvalue_client.resize(ni * nj);
-           latvalue_client.resize(ni * nj);
+           lonvalue.resize(ni * nj);
+           latvalue.resize(ni * nj);
            if (hasBounds)
            {
-             bounds_lon_client.resize(nvertex, ni * nj);
-             bounds_lat_client.resize(nvertex, ni * nj);
+             bounds_lonvalue.resize(nvertex, ni * nj);
+             bounds_latvalue.resize(nvertex, ni * nj);
            }
 
@@ -1244,6 +1269,6 @@
                int k = j * ni + i;
 
-               lonvalue_client(k) = lonvalue_1d(i);
-               latvalue_client(k) = latvalue_1d(j);
+               lonvalue(k) = lonvalue_1d(i);
+               latvalue(k) = latvalue_1d(j);
 
                if (hasBounds)
@@ -1251,6 +1276,6 @@
                  for (int n = 0; n < nvertex; ++n)
                  {
-                   bounds_lon_client(n,k) = bounds_lon_1d(n,i);
-                   bounds_lat_client(n,k) = bounds_lat_1d(n,j);
+                   bounds_lonvalue(n,k) = bounds_lon_1d(n,i);
+                   bounds_latvalue(n,k) = bounds_lat_1d(n,j);
                  }
                }
@@ -1258,12 +1283,12 @@
            }
          }
-         else if (i_index.numElements() == lonvalue_1d.numElements() && j_index.numElements() == latvalue_1d.numElements())
+         else if (i_index.numElements() == lonvalue_1d.numElements() && j_index.numElements() == latvalue_1d.numElements()  && !lonlatValueExisted)
          {
-           lonvalue_client.reference(lonvalue_1d);
-           latvalue_client.reference(latvalue_1d);
+           lonvalue.reference(lonvalue_1d);
+           latvalue.reference(latvalue_1d);
             if (hasBounds)
            {
-             bounds_lon_client.reference(bounds_lon_1d);
-             bounds_lat_client.reference(bounds_lat_1d);
+             bounds_lonvalue.reference(bounds_lon_1d);
+             bounds_latvalue.reference(bounds_lat_1d);
            }
          }
@@ -1277,12 +1302,12 @@
                  << i_index.numElements() << " and "  << j_index.numElements() << ".");
        }
-       else if (type == type_attr::curvilinear || type == type_attr::unstructured)
+       else if (type == type_attr::curvilinear || type == type_attr::unstructured  && !lonlatValueExisted)
        {
-         lonvalue_client.reference(lonvalue_1d);
-         latvalue_client.reference(latvalue_1d);
+         lonvalue.reference(lonvalue_1d);
+         latvalue.reference(latvalue_1d);
          if (hasBounds)
          {
-           bounds_lon_client.reference(bounds_lon_1d);
-           bounds_lat_client.reference(bounds_lat_1d);
+           bounds_lonvalue.reference(bounds_lon_1d);
+           bounds_latvalue.reference(bounds_lat_1d);
          }
        }
@@ -1290,7 +1315,111 @@
    }
 
+   /*
+     Convert internal longitude latitude value used by XIOS to "lonvalue_*" which can be retrieved with Fortran interface
+   */
+   void CDomain::convertLonLatValue(void)
+   {
+     bool lonlatValueExisted = (0 != lonvalue.numElements()) || (0 != latvalue.numElements());
+     if (!lonvalue_2d.isEmpty() && lonlatValueExisted)
+     {
+       lonvalue_2d.resize(ni,nj);
+       latvalue_2d.resize(ni,nj);
+       if (hasBounds)
+       {
+         bounds_lon_2d.resize(nvertex, ni, nj);
+         bounds_lat_2d.resize(nvertex, ni, nj);
+       }
+
+       for (int j = 0; j < nj; ++j)
+       {
+         for (int i = 0; i < ni; ++i)
+         {
+           int k = j * ni + i;
+
+           lonvalue_2d(i,j) = lonvalue(k);
+           latvalue_2d(i,j) = latvalue(k);
+
+           if (hasBounds)
+           {
+             for (int n = 0; n < nvertex; ++n)
+             {
+               bounds_lon_2d(n,i,j) = bounds_lonvalue(n,k);
+               bounds_lat_2d(n,i,j) = bounds_latvalue(n,k);
+             }
+           }
+         }
+       }
+     }
+     else if (!lonvalue_1d.isEmpty()  && lonlatValueExisted)
+     {
+       if (type_attr::rectilinear == type)
+       {
+         if (ni == lonvalue_1d.numElements() && nj == latvalue_1d.numElements())
+         {
+           lonvalue.resize(ni * nj);
+           latvalue.resize(ni * nj);
+           if (hasBounds)
+           {
+             bounds_lonvalue.resize(nvertex, ni * nj);
+             bounds_latvalue.resize(nvertex, ni * nj);
+           }
+
+           for (int j = 0; j < nj; ++j)
+           {
+             for (int i = 0; i < ni; ++i)
+             {
+               int k = j * ni + i;
+
+               lonvalue(k) = lonvalue_1d(i);
+               latvalue(k) = latvalue_1d(j);
+
+               if (hasBounds)
+               {
+                 for (int n = 0; n < nvertex; ++n)
+                 {
+                   bounds_lonvalue(n,k) = bounds_lon_1d(n,i);
+                   bounds_latvalue(n,k) = bounds_lat_1d(n,j);
+                 }
+               }
+             }
+           }
+         }
+         else if (i_index.numElements() == lonvalue_1d.numElements() && j_index.numElements() == latvalue_1d.numElements()  && !lonlatValueExisted)
+         {
+           lonvalue.reference(lonvalue_1d);
+           latvalue.reference(latvalue_1d);
+            if (hasBounds)
+           {
+             bounds_lonvalue.reference(bounds_lon_1d);
+             bounds_latvalue.reference(bounds_lat_1d);
+           }
+         }
+         else
+           ERROR("CDomain::completeLonClient(void)",
+                 << "[ id = " << this->getId() << " , context = '" << CObjectFactory::GetCurrentContextId() << " ] "
+                 << "'lonvalue_1d' and 'latvalue_1d' does not have the same size as the local domain." << std::endl
+                 << "'lonvalue_1d' size is " << lonvalue_1d.numElements() 
+                 << " and 'latvalue_1d' size is " << latvalue_1d.numElements() << std::endl 
+                 << " They should be correspondingly " << ni.getValue() << " and "  << nj.getValue() << " or " << std::endl
+                 << i_index.numElements() << " and "  << j_index.numElements() << ".");
+       }
+       else if (type == type_attr::curvilinear || type == type_attr::unstructured  && !lonlatValueExisted)
+       {
+         lonvalue.reference(lonvalue_1d);
+         latvalue.reference(latvalue_1d);
+         if (hasBounds)
+         {
+           bounds_lonvalue.reference(bounds_lon_1d);
+           bounds_latvalue.reference(bounds_lat_1d);
+         }
+       }
+     }
+   }
+
+
    void CDomain::checkBounds(void)
    {
-     if (!nvertex.isEmpty() && nvertex > 0)
+     bool hasBoundValues = (0 != bounds_lonvalue.numElements()) || (0 != bounds_latvalue.numElements());
+     if (!nvertex.isEmpty() && nvertex > 0 && !hasBoundValues)
      {
        if (!bounds_lon_1d.isEmpty() && !bounds_lon_2d.isEmpty())
@@ -1369,12 +1498,14 @@
                << "Since 'bounds_lat_2d' is defined, 'latvalue_2d' must be defined too." << std::endl);
 
-       //hasBounds = true;
        // In case of reading UGRID bounds values are not required
        hasBounds = (!bounds_lat_1d.isEmpty() || !bounds_lat_2d.isEmpty() );
      }
+     else if (hasBoundValues)
+     {
+       hasBounds = true;       
+     }
      else
      {
        hasBounds = false;
-       nvertex = 0;
      }
    }
@@ -1382,6 +1513,7 @@
    void CDomain::checkArea(void)
    {
+     bool hasAreaValue = (!areavalue.isEmpty() && 0 != areavalue.numElements());
      hasArea = !area.isEmpty();
-     if (hasArea)
+     if (hasArea && !hasAreaValue)
      {
        if (area.extent(0) != ni || area.extent(1) != nj)
@@ -1393,4 +1525,16 @@
                << "Area size is " << area.extent(0) << " x " << area.extent(1) << ".");
        }
+       if (areavalue.isEmpty())
+       {
+          areavalue.resize(ni*nj);
+         for (int j = 0; j < nj; ++j)
+         {
+           for (int i = 0; i < ni; ++i)
+           {
+             int k = j * ni + i;
+             areavalue(k) = area(i,j);
+           }
+         }
+       }
      }
    }
@@ -1398,7 +1542,8 @@
    void CDomain::checkLonLat()
    {
-     hasLonLat = (!latvalue_1d.isEmpty() && !lonvalue_1d.isEmpty()) ||
-                 (!latvalue_2d.isEmpty() && !lonvalue_2d.isEmpty());
-     if (hasLonLat)
+     if (!hasLonLat) hasLonLat = (!latvalue_1d.isEmpty() && !lonvalue_1d.isEmpty()) ||
+                                 (!latvalue_2d.isEmpty() && !lonvalue_2d.isEmpty());
+     bool hasLonLatValue = (0 != lonvalue.numElements()) || (0 != latvalue.numElements());
+     if (hasLonLat && !hasLonLatValue)
      {
        if (!lonvalue_1d.isEmpty() && !lonvalue_2d.isEmpty())
@@ -1463,7 +1608,8 @@
      if (context->hasClient)
      {
-       this->checkMask();
-       if (hasLonLat || hasArea || isCompressible_) this->computeConnectedServer();
-       if (hasLonLat) this->completeLonLatClient();
+      this->computeConnectedClients();
+       if (hasLonLat)
+         if (!context->hasServer)
+           this->completeLonLatClient();
      }
 
@@ -1479,11 +1625,14 @@
      CContext* context=CContext::getCurrent();
 
-      this->checkDomain();
-      this->checkBounds();
-      this->checkArea();
-      this->checkLonLat();
-
-      if (context->hasClient)
-      { // CÃŽtÃ© client uniquement
+      if (context->hasClient && !context->hasServer)
+      {
+        this->checkDomain();
+        this->checkBounds();
+        this->checkArea();
+        this->checkLonLat();
+      }
+
+      if (context->hasClient && !context->hasServer)
+      { // Ct client uniquement
          this->checkMask();
          this->checkDomainData();
@@ -1492,5 +1641,5 @@
       }
       else
-      { // CÃŽtÃ© serveur uniquement
+      { // Ct serveur uniquement
       }
 
@@ -1508,6 +1657,5 @@
      if (context->hasClient)
      {
-       sendServerAttribut();
-       if (hasLonLat || hasArea || isCompressible_) sendLonLatArea();
+       sendAttributes();
      }
      this->isChecked = true;
@@ -1525,5 +1673,5 @@
 
       if (context->hasClient)
-      { // CÃŽtÃ© client uniquement
+      { // Ct client uniquement
          this->checkMask();
          this->checkDomainData();
@@ -1533,13 +1681,11 @@
       }
       else
-      { // CÃŽtÃ© serveur uniquement
+      { // Ct serveur uniquement
       }
 
       if (context->hasClient)
       {
-        this->computeConnectedServer();
+        this->computeConnectedClients();
         this->completeLonLatClient();
-        this->sendServerAttribut();
-        this->sendLonLatArea();
       }
 
@@ -1547,285 +1693,516 @@
    }
 
-  void CDomain::sendServerAttribut(void)
-  {
-    CContext* context = CContext::getCurrent();
-    CContextClient* client = context->client;
-    int nbServer = client->serverSize;
-
-    CServerDistributionDescription serverDescription(getNbGlob(), nbServer);
-    if (isUnstructed_) serverDescription.computeServerDistribution(false, 0);
-    else serverDescription.computeServerDistribution(false, 1);
-
-    std::vector<std::vector<int> > serverIndexBegin = serverDescription.getServerIndexBegin();
-    std::vector<std::vector<int> > serverDimensionSizes = serverDescription.getServerDimensionSizes();
-
-    CEventClient event(getType(),EVENT_ID_SERVER_ATTRIBUT);
-    if (client->isServerLeader())
+  /*!
+     Compute the connection of a client to other clients to determine which clients to send attributes to.
+     The sending clients are supposed to already know the distribution of receiving clients (In simple cases, it's band)
+     The connection among clients is calculated by using global index. 
+     A client connects to other clients which holds the same global index as it.     
+  */
+  void CDomain::computeConnectedClients()
+  {
+    CContext* context=CContext::getCurrent() ;
+    
+    // This line should be changed soon.
+    int nbSrvPools = (context->hasServer) ? (context->hasClient ? context->clientPrimServer.size() : 0) : 1;
+
+    nbSenders.clear();
+    connectedServerRank_.clear();
+
+    for (int p = 0; p < nbSrvPools; ++p)
     {
-      std::list<CMessage> msgs;
-
-      const std::list<int>& ranks = client->getRanksServerLeader();
-      for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
-      {
-        // Use const int to ensure CMessage holds a copy of the value instead of just a reference
-        const int ibegin_srv = serverIndexBegin[*itRank][0];
-        const int jbegin_srv = serverIndexBegin[*itRank][1];
-        const int ni_srv = serverDimensionSizes[*itRank][0];
-        const int nj_srv = serverDimensionSizes[*itRank][1];
-        const int iend_srv = ibegin_srv + ni_srv - 1;
-        const int jend_srv = jbegin_srv + nj_srv - 1;
-
-        msgs.push_back(CMessage());
-        CMessage& msg = msgs.back();
-        msg << this->getId() ;
-        msg << ni_srv << ibegin_srv << iend_srv << nj_srv << jbegin_srv << jend_srv;
-        msg << global_zoom_ni.getValue() << global_zoom_ibegin.getValue() << global_zoom_nj.getValue() << global_zoom_jbegin.getValue();
-        msg << isCompressible_;
-
-        event.push(*itRank,1,msg);
-      }
-      client->sendEvent(event);
-    }
-    else client->sendEvent(event);
-  }
-
-  std::vector<int> CDomain::getNbGlob()
-  {
-     std::vector<int> nbGlob(2);
-     nbGlob[0] = ni_glo.getValue();
-     nbGlob[1] = nj_glo.getValue();
-
-     return nbGlob;
-  }
-
-  void CDomain::computeConnectedServer(void)
-  {
-    CContext* context=CContext::getCurrent() ;
-    CContextClient* client=context->client ;
-    int nbServer=client->serverSize;
-    int rank = client->clientRank;
-    bool doComputeGlobalIndexServer = true;
-
-    int i,j,i_ind,j_ind, nbIndex;
-    int global_zoom_iend=global_zoom_ibegin+global_zoom_ni-1 ;
-    int global_zoom_jend=global_zoom_jbegin+global_zoom_nj-1 ;
-
-    // Precompute number of index
-    int globalIndexCountZoom = 0;
-    nbIndex = i_index.numElements();
-    for (i = 0; i < nbIndex; ++i)
+      CContextClient* client = (0 != context->clientPrimServer.size()) ? context->clientPrimServer[p] : context->client;
+      int nbServer = client->serverSize;
+      int nbClient = client->clientSize;
+      int rank     = client->clientRank;
+      bool doComputeGlobalIndexServer = true;
+
+      if (connectedServerRank_.find(nbServer) == connectedServerRank_.end())
+      {
+
+        if (indSrv_.find(nbServer) == indSrv_.end())
+        {
+          int i,j,i_ind,j_ind, nbIndex, nbIndexZoom;
+          int global_zoom_iend=global_zoom_ibegin+global_zoom_ni-1;
+          int global_zoom_jend=global_zoom_jbegin+global_zoom_nj-1;
+
+           // Precompute number of index
+           int globalIndexCountZoom = 0;
+           nbIndex = i_index.numElements();
+
+           if (doZoomByIndex_)
+           {
+             globalIndexCountZoom = zoom_i_index.numElements();
+           }
+           else
+           {
+             for (i = 0; i < nbIndex; ++i)
+             {
+               i_ind=i_index(i);
+               j_ind=j_index(i);
+
+               if (i_ind >= global_zoom_ibegin && i_ind <= global_zoom_iend && j_ind >= global_zoom_jbegin && j_ind <= global_zoom_jend)
+               {
+                  ++globalIndexCountZoom;
+               }
+             }
+           }
+
+           // Fill in index
+           CArray<size_t,1> globalIndexDomainZoom(globalIndexCountZoom);
+           CArray<size_t,1> localIndexDomainZoom(globalIndexCountZoom);
+           CArray<size_t,1> globalIndexDomain(nbIndex);
+           size_t globalIndex;
+           int globalIndexCount = 0;
+
+           for (i = 0; i < nbIndex; ++i)
+           {
+             i_ind=i_index(i);
+             j_ind=j_index(i);
+             globalIndex = i_ind + j_ind * ni_glo;
+             globalIndexDomain(i) = globalIndex;
+           }
+
+           if (globalLocalIndexMap_.empty())
+           {
+             for (i = 0; i < nbIndex; ++i)
+               globalLocalIndexMap_[globalIndexDomain(i)] = i;
+           }
+
+           globalIndexCountZoom = 0;
+           if (doZoomByIndex_)
+           {
+             int nbIndexZoom = zoom_i_index.numElements();
+
+             for (i = 0; i < nbIndexZoom; ++i)
+             {
+               i_ind=zoom_i_index(i);
+               j_ind=zoom_j_index(i);
+               globalIndex = i_ind + j_ind * ni_glo;
+               globalIndexDomainZoom(globalIndexCountZoom) = globalIndex;
+               ++globalIndexCountZoom;
+             }
+           }
+           else
+           {
+             int global_zoom_iend=global_zoom_ibegin+global_zoom_ni-1;
+             int global_zoom_jend=global_zoom_jbegin+global_zoom_nj-1;
+             for (i = 0; i < nbIndex; ++i)
+             {
+               i_ind=i_index(i);
+               j_ind=j_index(i);
+               globalIndex = i_ind + j_ind * ni_glo;
+               if (i_ind >= global_zoom_ibegin && i_ind <= global_zoom_iend && j_ind >= global_zoom_jbegin && j_ind <= global_zoom_jend)
+               {
+                  globalIndexDomainZoom(globalIndexCountZoom) = globalIndex;
+                  ++globalIndexCountZoom;
+               }
+             }
+
+             int iend = ibegin + ni -1;
+             int jend = jbegin + nj -1;
+             zoom_ibegin = global_zoom_ibegin > ibegin ? global_zoom_ibegin.getValue() : ibegin;
+             int zoom_iend  = global_zoom_iend < iend ? zoom_iend : iend ;
+             zoom_ni     = zoom_iend-zoom_ibegin+1 ;
+
+             zoom_jbegin = global_zoom_jbegin > jbegin ? global_zoom_jbegin.getValue() : jbegin ;
+             int zoom_jend   = global_zoom_jend < jend ? zoom_jend : jend;
+             zoom_nj     = zoom_jend-zoom_jbegin+1;
+           }
+
+           size_t globalSizeIndex = 1, indexBegin, indexEnd;
+           int range, clientSize = client->clientSize;
+           std::vector<int> nGlobDomain(2);
+           nGlobDomain[0] = this->ni_glo;
+           nGlobDomain[1] = this->nj_glo;
+           for (int i = 0; i < nGlobDomain.size(); ++i) globalSizeIndex *= nGlobDomain[i];
+           indexBegin = 0;
+           if (globalSizeIndex <= clientSize)
+           {
+             indexBegin = rank%globalSizeIndex;
+             indexEnd = indexBegin;
+           }
+           else
+           {
+             for (int i = 0; i < clientSize; ++i)
+             {
+               range = globalSizeIndex / clientSize;
+               if (i < (globalSizeIndex%clientSize)) ++range;
+               if (i == client->clientRank) break;
+               indexBegin += range;
+             }
+             indexEnd = indexBegin + range - 1;
+           }
+
+           // Even if servers have no index, they must received something from client
+           // We only use several client to send "empty" message to these servers
+           CServerDistributionDescription serverDescription(nGlobDomain, nbServer);
+           std::vector<int> serverZeroIndex;
+           if (isUnstructed_) serverZeroIndex = serverDescription.computeServerGlobalIndexInRange(std::make_pair<size_t,size_t>(indexBegin, indexEnd), 0);
+           else serverZeroIndex = serverDescription.computeServerGlobalIndexInRange(std::make_pair<size_t,size_t>(indexBegin, indexEnd), 1);
+
+           std::list<int> serverZeroIndexLeader;
+           std::list<int> serverZeroIndexNotLeader;
+           CContextClient::computeLeader(client->clientRank, client->clientSize, serverZeroIndex.size(), serverZeroIndexLeader, serverZeroIndexNotLeader);
+           for (std::list<int>::iterator it = serverZeroIndexLeader.begin(); it != serverZeroIndexLeader.end(); ++it)
+              *it = serverZeroIndex[*it];
+
+           CClientServerMapping* clientServerMap = new CClientServerMappingDistributed(serverDescription.getGlobalIndexRange(),
+                 client->intraComm);
+           clientServerMap->computeServerIndexMapping(globalIndexDomain, nbServer);
+           CClientServerMapping::GlobalIndexMap& globalIndexDomainOnServer = clientServerMap->getGlobalIndexOnServer();
+
+           CClientServerMapping::GlobalIndexMap::const_iterator it  = globalIndexDomainOnServer.begin(),
+                 ite = globalIndexDomainOnServer.end();
+           indSrv_[nbServer].swap(globalIndexDomainOnServer);
+           connectedServerRank_[nbServer].clear();
+           for (it = indSrv_[nbServer].begin(); it != ite; ++it)
+             connectedServerRank_[nbServer].push_back(it->first);
+
+           for (std::list<int>::const_iterator it = serverZeroIndexLeader.begin(); it != serverZeroIndexLeader.end(); ++it)
+              connectedServerRank_[nbServer].push_back(*it);
+
+           // Even if a client has no index, it must connect to at least one server and
+           // send an "empty" data to this server
+           if (connectedServerRank_[nbServer].empty())
+              connectedServerRank_[nbServer].push_back(client->clientRank % client->serverSize);
+
+           nbSenders[nbServer] = clientServerMap->computeConnectedClients(client->serverSize, client->clientSize, client->intraComm, connectedServerRank_[nbServer]);
+           delete clientServerMap;
+        }
+      }
+    }
+  }
+
+   /*!
+     Compute index to write data. We only write data on the zoomed region, therefore, there should
+     be a map between the complete grid and the reduced grid where we write data.
+     By using global index we can easily create this kind of mapping.
+   */
+   void CDomain::computeWrittenIndex()
+   {  
+      if (computedWrittenIndex_) return;
+      computedWrittenIndex_ = true;
+
+      CContext* context=CContext::getCurrent();      
+      CContextServer* server = context->server;  
+
+      std::vector<int> nBegin(2), nSize(2), nBeginGlobal(2), nGlob(2);
+      nBegin[0]       = zoom_ibegin;  nBegin[1] = zoom_jbegin;
+      nSize[0]        = zoom_ni;      nSize[1]  = zoom_nj;
+      nBeginGlobal[0] = 0; nBeginGlobal[1] = 0;
+      nGlob[0]        = ni_glo;   nGlob[1] = nj_glo;
+      CDistributionServer srvDist(server->intraCommSize, nBegin, nSize, nBeginGlobal, nGlob); 
+      const CArray<size_t,1>& writtenGlobalIndex  = srvDist.getGlobalIndex();
+
+      size_t nbWritten = 0, indGlo;      
+      boost::unordered_map<size_t,size_t>::const_iterator itb = globalLocalIndexMap_.begin(),
+                                                          ite = globalLocalIndexMap_.end(), it;          
+      CArray<size_t,1>::const_iterator itSrvb = writtenGlobalIndex.begin(),
+                                       itSrve = writtenGlobalIndex.end(), itSrv;
+
+//      for (itSrv = itSrvb; itSrv != itSrve; ++itSrv)
+//      {
+//        indGlo = *itSrv;
+//        if (ite != globalLocalIndexMap_.find(indGlo))
+//        {
+//          ++nbWritten;
+//        }
+//      }
+
+//      localIndexToWriteOnServer.resize(nbWritten);
+      localIndexToWriteOnServer.resize(writtenGlobalIndex.numElements());
+
+      nbWritten = 0;
+      for (itSrv = itSrvb; itSrv != itSrve; ++itSrv)
+      {
+        indGlo = *itSrv;
+        if (ite != globalLocalIndexMap_.find(indGlo))
+        {
+          localIndexToWriteOnServer(nbWritten) = globalLocalIndexMap_[indGlo];
+          ++nbWritten;
+        }
+        else
+        {
+          localIndexToWriteOnServer(nbWritten) = 0;
+          ++nbWritten;
+        }
+      }
+      
+      // if (isCompressible())
+      // {
+      //   nbWritten = 0;
+      //   boost::unordered_map<size_t,size_t> localGlobalIndexMap;
+      //   for (itSrv = itSrvb; itSrv != itSrve; ++itSrv)
+      //   {
+      //     indGlo = *itSrv;
+      //     if (ite != globalLocalIndexMap_.find(indGlo))
+      //     {
+      //       localGlobalIndexMap[localIndexToWriteOnServer(nbWritten)] = indGlo;
+      //       ++nbWritten;
+      //     }                 
+      //   }
+
+      //   nbWritten = 0;
+      //   for (int idx = 0; idx < data_i_index.numElements(); ++idx)
+      //   {
+      //     if (localGlobalIndexMap.end() != localGlobalIndexMap.find(data_i_index(idx)))
+      //     {
+      //       ++nbWritten;
+      //     }
+      //   }
+
+      //   compressedIndexToWriteOnServer.resize(nbWritten);
+      //   nbWritten = 0;
+      //   for (int idx = 0; idx < data_i_index.numElements(); ++idx)
+      //   {
+      //     if (localGlobalIndexMap.end() != localGlobalIndexMap.find(data_i_index(idx)))
+      //     {
+      //       compressedIndexToWriteOnServer(nbWritten) = localGlobalIndexMap[data_i_index(idx)];
+      //       ++nbWritten;
+      //     }
+      //   }
+
+      //   numberWrittenIndexes_ = nbWritten;
+      //   if (isDistributed())
+      //   {            
+      //     MPI_Allreduce(&numberWrittenIndexes_, &totalNumberWrittenIndexes_, 1, MPI_INT, MPI_SUM, server->intraComm);
+      //     MPI_Scan(&numberWrittenIndexes_, &offsetWrittenIndexes_, 1, MPI_INT, MPI_SUM, server->intraComm);
+      //     offsetWrittenIndexes_ -= numberWrittenIndexes_;
+      //   }
+      //   else
+      //     totalNumberWrittenIndexes_ = numberWrittenIndexes_;
+      // }      
+   }
+
+  void CDomain::computeWrittenCompressedIndex(MPI_Comm writtenComm)
+  {
+    int writtenCommSize;
+    MPI_Comm_size(writtenComm, &writtenCommSize);
+    if (compressedIndexToWriteOnServer.find(writtenCommSize) != compressedIndexToWriteOnServer.end())
+      return;
+
+    if (isCompressible())
     {
-      i_ind=i_index(i);
-      j_ind=j_index(i);
-
-      if (i_ind >= global_zoom_ibegin && i_ind <= global_zoom_iend && j_ind >= global_zoom_jbegin && j_ind <= global_zoom_jend)
-      {
-        ++globalIndexCountZoom;
-      }
-    }
-
-    int globalIndexWrittenCount = 0;
-    if (isCompressible_)
-    {
-      for (i = 0; i < data_i_index.numElements(); ++i)
-      {
-        i_ind = CDistributionClient::getDomainIndex(data_i_index(i), data_j_index(i),
-                                                    data_ibegin, data_jbegin, data_dim, ni,
-                                                    j_ind);
-        if (i_ind >= 0 && i_ind < ni && j_ind >= 0 && j_ind < nj && mask_1d(i_ind + j_ind * ni))
-        {
-          i_ind += ibegin;
-          j_ind += jbegin;
-          if (i_ind >= global_zoom_ibegin && i_ind <= global_zoom_iend && j_ind >= global_zoom_jbegin && j_ind <= global_zoom_jend)
-            ++globalIndexWrittenCount;
-        }
-      }
-    }
-
-    // Fill in index
-    CArray<size_t,1> globalIndexDomainZoom(globalIndexCountZoom);
-    CArray<size_t,1> localIndexDomainZoom(globalIndexCountZoom);
-    CArray<size_t,1> globalIndexDomain(nbIndex);
-    size_t globalIndex;
-    int globalIndexCount = 0;
-    globalIndexCountZoom = 0;
-
-    for (i = 0; i < nbIndex; ++i)
-    {
-      i_ind=i_index(i);
-      j_ind=j_index(i);
-      globalIndex = i_ind + j_ind * ni_glo;
-      globalIndexDomain(globalIndexCount) = globalIndex;
-      ++globalIndexCount;
-      if (i_ind >= global_zoom_ibegin && i_ind <= global_zoom_iend && j_ind >= global_zoom_jbegin && j_ind <= global_zoom_jend)
-      {
-        globalIndexDomainZoom(globalIndexCountZoom) = globalIndex;
-        localIndexDomainZoom(globalIndexCountZoom) = i;
-        ++globalIndexCountZoom;
-      }
-    }
-
-    CArray<int,1> globalIndexWrittenDomain(globalIndexWrittenCount);
-    if (isCompressible_)
-    {
-      globalIndexWrittenCount = 0;
-      for (i = 0; i < data_i_index.numElements(); ++i)
-      {
-        i_ind = CDistributionClient::getDomainIndex(data_i_index(i), data_j_index(i),
-                                                    data_ibegin, data_jbegin, data_dim, ni,
-                                                    j_ind);
-        if (i_ind >= 0 && i_ind < ni && j_ind >= 0 && j_ind < nj && mask_1d(i_ind + j_ind * ni))
-        {
-          i_ind += ibegin;
-          j_ind += jbegin;
-          if (i_ind >= global_zoom_ibegin && i_ind <= global_zoom_iend && j_ind >= global_zoom_jbegin && j_ind <= global_zoom_jend)
-          {
-            globalIndexWrittenDomain(globalIndexWrittenCount) = i_ind + j_ind * ni_glo;
-            ++globalIndexWrittenCount;
-          }
-        }
-      }
-    }
-
-    size_t globalSizeIndex = 1, indexBegin, indexEnd;
-    int range, clientSize = client->clientSize;
-    for (int i = 0; i < getNbGlob().size(); ++i) globalSizeIndex *= getNbGlob()[i];
-    indexBegin = 0;
-    if (globalSizeIndex <= clientSize)
-    {
-      indexBegin = rank%globalSizeIndex;
-      indexEnd = indexBegin;
-    }
-    else
-    {
-      for (int i = 0; i < clientSize; ++i)
-      {
-        range = globalSizeIndex / clientSize;
-        if (i < (globalSizeIndex%clientSize)) ++range;
-        if (i == client->clientRank) break;
-        indexBegin += range;
-      }
-      indexEnd = indexBegin + range - 1;
-    }
-
-    CServerDistributionDescription serverDescription(getNbGlob(), nbServer);
-    if (isUnstructed_) serverDescription.computeServerGlobalIndexInRange(std::make_pair<size_t,size_t>(indexBegin, indexEnd), 0);
-    else serverDescription.computeServerGlobalIndexInRange(std::make_pair<size_t,size_t>(indexBegin, indexEnd), 1);
-
-    CClientServerMapping* clientServerMap = new CClientServerMappingDistributed(serverDescription.getGlobalIndexRange(),
-                                                                                client->intraComm);
-    clientServerMap->computeServerIndexMapping(globalIndexDomain);
-    const CClientServerMapping::GlobalIndexMap& globalIndexDomainOnServer = clientServerMap->getGlobalIndexOnServer();
-
-    CClientServerMapping::GlobalIndexMap::const_iterator it  = globalIndexDomainOnServer.begin(),
-                                                         ite = globalIndexDomainOnServer.end();
-    typedef XIOSBinarySearchWithIndex<size_t> BinarySearch;
-    std::vector<int>::iterator itVec;
-
-    indSrv_.clear();
-    indWrittenSrv_.clear();
-    for (; it != ite; ++it)
-    {
-      int rank = it->first;
-      int indexSize = it->second.size();
-      std::vector<int> permutIndex(indexSize);
-      XIOSAlgorithms::fillInIndex(indexSize, permutIndex);
-      XIOSAlgorithms::sortWithIndex<size_t, CVectorStorage>(it->second, permutIndex);
-      BinarySearch binSearch(it->second);
-      int nb = globalIndexDomainZoom.numElements();
-      for (int i = 0; i < nb; ++i)
-      {
-        if (binSearch.search(permutIndex.begin(), permutIndex.end(), globalIndexDomainZoom(i), itVec))
-        {
-          indSrv_[rank].push_back(localIndexDomainZoom(i));
-        }
-      }
-      for (int i = 0; i < globalIndexWrittenDomain.numElements(); ++i)
-      {
-        if (binSearch.search(permutIndex.begin(), permutIndex.end(), globalIndexWrittenDomain(i), itVec))
-        {
-          indWrittenSrv_[rank].push_back(globalIndexWrittenDomain(i));
-        }
-      }
-    }
-
-    connectedServerRank_.clear();
-    for (it = globalIndexDomainOnServer.begin(); it != ite; ++it) {
-      connectedServerRank_.push_back(it->first);
-    }
-
-    nbConnectedClients_ = clientServerMap->computeConnectedClients(client->serverSize, client->clientSize, client->intraComm, connectedServerRank_);
-
-    delete clientServerMap;
-  }
-
-  const std::map<int, vector<size_t> >& CDomain::getIndexServer() const
-  {
-    return indSrv_;
+      size_t nbWritten = 0, indGlo;
+      CContext* context=CContext::getCurrent();      
+      CContextServer* server = context->server;  
+
+      std::vector<int> nBegin(2), nSize(2), nBeginGlobal(2), nGlob(2);
+      nBegin[0]       = zoom_ibegin;  nBegin[1] = zoom_jbegin;
+      nSize[0]        = zoom_ni;      nSize[1]  = zoom_nj;
+      nBeginGlobal[0] = 0; nBeginGlobal[1] = 0;
+      nGlob[0]        = ni_glo;   nGlob[1] = nj_glo;
+      CDistributionServer srvDist(server->intraCommSize, nBegin, nSize, nBeginGlobal, nGlob); 
+      const CArray<size_t,1>& writtenGlobalIndex  = srvDist.getGlobalIndex();
+
+      boost::unordered_map<size_t,size_t>::const_iterator itb = globalLocalIndexMap_.begin(),
+                                                          ite = globalLocalIndexMap_.end(), it;   
+      CArray<size_t,1>::const_iterator itSrvb = writtenGlobalIndex.begin(),
+                                       itSrve = writtenGlobalIndex.end(), itSrv;
+      boost::unordered_map<size_t,size_t> localGlobalIndexMap;
+      for (itSrv = itSrvb; itSrv != itSrve; ++itSrv)
+      {
+        indGlo = *itSrv;
+        if (ite != globalLocalIndexMap_.find(indGlo))
+        {
+          localGlobalIndexMap[localIndexToWriteOnServer(nbWritten)] = indGlo;
+          ++nbWritten;
+        }                 
+      }
+
+      nbWritten = 0;
+      for (int idx = 0; idx < data_i_index.numElements(); ++idx)
+      {
+        if (localGlobalIndexMap.end() != localGlobalIndexMap.find(data_i_index(idx)))
+        {
+          ++nbWritten;
+        }
+      }
+
+      compressedIndexToWriteOnServer[writtenCommSize].resize(nbWritten);
+      nbWritten = 0;
+      for (int idx = 0; idx < data_i_index.numElements(); ++idx)
+      {
+        if (localGlobalIndexMap.end() != localGlobalIndexMap.find(data_i_index(idx)))
+        {
+          compressedIndexToWriteOnServer[writtenCommSize](nbWritten) = localGlobalIndexMap[data_i_index(idx)];
+          ++nbWritten;
+        }
+      }
+
+      numberWrittenIndexes_[writtenCommSize] = nbWritten;
+      if (isDistributed())
+      {
+             
+        MPI_Allreduce(&numberWrittenIndexes_[writtenCommSize], &totalNumberWrittenIndexes_[writtenCommSize], 1, MPI_INT, MPI_SUM, writtenComm);
+        MPI_Scan(&numberWrittenIndexes_[writtenCommSize], &offsetWrittenIndexes_[writtenCommSize], 1, MPI_INT, MPI_SUM, writtenComm);
+        offsetWrittenIndexes_[writtenCommSize] -= numberWrittenIndexes_[writtenCommSize];
+      }
+      else
+        totalNumberWrittenIndexes_[writtenCommSize] = numberWrittenIndexes_[writtenCommSize];
+      }
   }
 
   /*!
-    Send index from client to server(s)
+    Send all attributes from client to connected clients
+    The attributes will be rebuilt on receiving side
+  */
+  void CDomain::sendAttributes()
+  {
+    sendDistributionAttributes();
+    sendIndex();       
+    sendMask();
+    sendLonLat();
+    sendArea();    
+    sendDataIndex();
+  }
+
+  /*!
+    Send global index and zoom index from client to connected client(s)
+    zoom index can be smaller than global index
   */
   void CDomain::sendIndex()
   {
     int ns, n, i, j, ind, nv, idx;
-    CContext* context = CContext::getCurrent();
-    CContextClient* client=context->client;
-
-    CEventClient eventIndex(getType(), EVENT_ID_INDEX);
-
-    list<CMessage> list_msgsIndex;
-    list<CArray<int,1> > list_indi, list_indj, list_writtenInd;
-
-    std::map<int, std::vector<size_t> >::const_iterator it, iteMap;
-    iteMap = indSrv_.end();
-    for (int k = 0; k < connectedServerRank_.size(); ++k)
+    std::list<CContextClient*>::iterator it;
+    for (it=clients.begin(); it!=clients.end(); ++it)
     {
-      int nbData = 0;
-      int rank = connectedServerRank_[k];
-      it = indSrv_.find(rank);
-      if (iteMap != it)
-        nbData = it->second.size();
-
-      list_indi.push_back(CArray<int,1>(nbData));
-      list_indj.push_back(CArray<int,1>(nbData));
-
-      CArray<int,1>& indi = list_indi.back();
-      CArray<int,1>& indj = list_indj.back();
-      const std::vector<size_t>& temp = it->second;
-      for (n = 0; n < nbData; ++n)
-      {
-        idx = static_cast<int>(it->second[n]);
-        indi(n) = i_index(idx);
-        indj(n) = j_index(idx);
-      }
-
-      list_msgsIndex.push_back(CMessage());
-
-      list_msgsIndex.back() << this->getId() << (int)type; // enum ne fonctionne pour les message => ToFix
-      list_msgsIndex.back() << isCurvilinear;
-      list_msgsIndex.back() << list_indi.back() << list_indj.back();
-
-      if (isCompressible_)
-      {
-        std::vector<int>& writtenIndSrc = indWrittenSrv_[rank];
-        list_writtenInd.push_back(CArray<int,1>(writtenIndSrc.size()));
-        CArray<int,1>& writtenInd = list_writtenInd.back();
-
-        for (n = 0; n < writtenInd.numElements(); ++n)
-          writtenInd(n) = writtenIndSrc[n];
-
-        list_msgsIndex.back() << writtenInd;
-      }
-
-      eventIndex.push(rank, nbConnectedClients_[rank], list_msgsIndex.back());
-    }
-
-    client->sendEvent(eventIndex);
+      CContextClient* client = *it;
+
+      int serverSize = client->serverSize;
+      CEventClient eventIndex(getType(), EVENT_ID_INDEX);
+
+      list<CMessage> list_msgsIndex;
+      list<CArray<int,1> > list_indZoom, list_writtenInd, list_indGlob;
+
+      boost::unordered_map<int, vector<size_t> >::const_iterator itIndex, iteIndex;
+      iteIndex = indSrv_[serverSize].end();
+      for (int k = 0; k < connectedServerRank_[serverSize].size(); ++k)
+      {
+        int nbIndGlob = 0;
+        int rank = connectedServerRank_[serverSize][k];
+        itIndex = indSrv_[serverSize].find(rank);
+        if (iteIndex != itIndex)
+          nbIndGlob = itIndex->second.size();
+
+        list_indGlob.push_back(CArray<int,1>(nbIndGlob));        
+
+        CArray<int,1>& indGlob = list_indGlob.back();
+        for (n = 0; n < nbIndGlob; ++n)
+        {
+          indGlob(n) = static_cast<int>(itIndex->second[n]);
+        }
+
+        list_msgsIndex.push_back(CMessage());
+        list_msgsIndex.back() << this->getId() << (int)type; // enum ne fonctionne pour les message => ToFix
+        list_msgsIndex.back() << isCurvilinear;
+        list_msgsIndex.back() << list_indGlob.back(); //list_indi.back() << list_indj.back();
+       
+        eventIndex.push(rank, nbSenders[serverSize][rank], list_msgsIndex.back());
+      }
+
+      client->sendEvent(eventIndex);
+    }
   }
 
   /*!
-    Send area from client to server(s)
+    Send distribution from client to other clients
+    Because a client in a level knows correctly the grid distribution of client on the next level
+    it calculates this distribution then sends it to the corresponding clients on the next level
+  */
+  void CDomain::sendDistributionAttributes(void)
+  {
+    std::list<CContextClient*>::iterator it;
+    for (it=clients.begin(); it!=clients.end(); ++it)
+    {
+      CContextClient* client = *it;
+      int nbServer = client->serverSize;
+      std::vector<int> nGlobDomain(2);
+      nGlobDomain[0] = this->ni_glo;
+      nGlobDomain[1] = this->nj_glo;
+
+      CServerDistributionDescription serverDescription(nGlobDomain, nbServer);
+      if (isUnstructed_) serverDescription.computeServerDistribution(false, 0);
+      else serverDescription.computeServerDistribution(false, 1);
+
+      std::vector<std::vector<int> > serverIndexBegin = serverDescription.getServerIndexBegin();
+      std::vector<std::vector<int> > serverDimensionSizes = serverDescription.getServerDimensionSizes();
+
+      CEventClient event(getType(),EVENT_ID_SERVER_ATTRIBUT);
+      if (client->isServerLeader())
+      {
+        std::list<CMessage> msgs;
+
+        const std::list<int>& ranks = client->getRanksServerLeader();
+        for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
+        {
+          // Use const int to ensure CMessage holds a copy of the value instead of just a reference
+          const int ibegin_srv = serverIndexBegin[*itRank][0];
+          const int jbegin_srv = serverIndexBegin[*itRank][1];
+          const int ni_srv = serverDimensionSizes[*itRank][0];
+          const int nj_srv = serverDimensionSizes[*itRank][1];
+
+          msgs.push_back(CMessage());
+          CMessage& msg = msgs.back();
+          msg << this->getId() ;
+          msg << isUnstructed_;
+          msg << ni_srv << ibegin_srv << nj_srv << jbegin_srv;
+          msg << global_zoom_ni.getValue() << global_zoom_ibegin.getValue() << global_zoom_nj.getValue() << global_zoom_jbegin.getValue();        
+          msg << isCompressible_;
+
+          event.push(*itRank,1,msg);
+        }
+        client->sendEvent(event);
+      }
+      else client->sendEvent(event);
+    }
+  }
+
+  /*!
+    Send mask index from client to connected(s) clients    
+  */
+  void CDomain::sendMask()
+  {
+    int ns, n, i, j, ind, nv, idx;
+    std::list<CContextClient*>::iterator it;
+    for (it=clients.begin(); it!=clients.end(); ++it)
+    {
+      CContextClient* client = *it;
+      int serverSize = client->serverSize;
+
+      // send area for each connected server
+      CEventClient eventMask(getType(), EVENT_ID_MASK);
+
+      list<CMessage> list_msgsMask;
+      list<CArray<bool,1> > list_mask;
+
+      boost::unordered_map<int, vector<size_t> >::const_iterator it, iteMap;
+      iteMap = indSrv_[serverSize].end();
+      for (int k = 0; k < connectedServerRank_[serverSize].size(); ++k)
+      {
+        int nbData = 0;
+        int rank = connectedServerRank_[serverSize][k];
+        it = indSrv_[serverSize].find(rank);
+        if (iteMap != it)
+          nbData = it->second.size();
+        list_mask.push_back(CArray<bool,1>(nbData));
+
+        const std::vector<size_t>& temp = it->second;
+        for (n = 0; n < nbData; ++n)
+        {
+          idx = static_cast<int>(it->second[n]);
+          list_mask.back()(n) = domainMask(globalLocalIndexMap_[idx]);
+        }
+
+        list_msgsMask.push_back(CMessage());
+        list_msgsMask.back() << this->getId() << list_mask.back();
+        eventMask.push(rank, nbSenders[serverSize][rank], list_msgsMask.back());
+      }
+      client->sendEvent(eventMask);
+    }
+  }
+
+  /*!
+    Send area from client to connected client(s)
   */
   void CDomain::sendArea()
@@ -1834,44 +2211,47 @@
 
     int ns, n, i, j, ind, nv, idx;
-    CContext* context = CContext::getCurrent();
-    CContextClient* client=context->client;
-
-    // send area for each connected server
-    CEventClient eventArea(getType(), EVENT_ID_AREA);
-
-    list<CMessage> list_msgsArea;
-    list<CArray<double,1> > list_area;
-
-    std::map<int, std::vector<size_t> >::const_iterator it, iteMap;
-    iteMap = indSrv_.end();
-    for (int k = 0; k < connectedServerRank_.size(); ++k)
+    std::list<CContextClient*>::iterator it;
+
+    for (it=clients.begin(); it!=clients.end(); ++it)
     {
-      int nbData = 0;
-      int rank = connectedServerRank_[k];
-      it = indSrv_.find(rank);
-      if (iteMap != it)
-        nbData = it->second.size();
-      list_area.push_back(CArray<double,1>(nbData));
-
-      const std::vector<size_t>& temp = it->second;
-      for (n = 0; n < nbData; ++n)
-      {
-        idx = static_cast<int>(it->second[n]);
-        i = i_index(idx);
-        j = j_index(idx);
-        if (hasArea)
-          list_area.back()(n) = area(i - ibegin, j - jbegin);
-      }
-
-      list_msgsArea.push_back(CMessage());
-      list_msgsArea.back() << this->getId() << list_area.back();
-      eventArea.push(rank, nbConnectedClients_[rank], list_msgsArea.back());
-    }
-    client->sendEvent(eventArea);
+      CContextClient* client = *it;
+      int serverSize = client->serverSize;
+
+      // send area for each connected server
+      CEventClient eventArea(getType(), EVENT_ID_AREA);
+
+      list<CMessage> list_msgsArea;
+      list<CArray<double,1> > list_area;
+
+      boost::unordered_map<int, vector<size_t> >::const_iterator it, iteMap;
+      iteMap = indSrv_[serverSize].end();
+      for (int k = 0; k < connectedServerRank_[serverSize].size(); ++k)
+      {
+        int nbData = 0;
+        int rank = connectedServerRank_[serverSize][k];
+        it = indSrv_[serverSize].find(rank);
+        if (iteMap != it)
+          nbData = it->second.size();
+        list_area.push_back(CArray<double,1>(nbData));
+
+        const std::vector<size_t>& temp = it->second;
+        for (n = 0; n < nbData; ++n)
+        {
+          idx = static_cast<int>(it->second[n]);
+          list_area.back()(n) = areavalue(globalLocalIndexMap_[idx]);
+        }
+
+        list_msgsArea.push_back(CMessage());
+        list_msgsArea.back() << this->getId() << hasArea;
+        list_msgsArea.back() << list_area.back();
+        eventArea.push(rank, nbSenders[serverSize][rank], list_msgsArea.back());
+      }
+      client->sendEvent(eventArea);
+    }
   }
 
   /*!
     Send longitude and latitude from client to servers
-    Each client send long and lat information to corresponding connected server(s).
+    Each client send long and lat information to corresponding connected clients(s).
     Because longitude and latitude are optional, this function only called if latitude and longitude exist
   */
@@ -1881,87 +2261,165 @@
 
     int ns, n, i, j, ind, nv, idx;
-    CContext* context = CContext::getCurrent();
-    CContextClient* client=context->client;
-
-    // send lon lat for each connected server
-    CEventClient eventLon(getType(), EVENT_ID_LON);
-    CEventClient eventLat(getType(), EVENT_ID_LAT);
-
-    list<CMessage> list_msgsLon, list_msgsLat;
-    list<CArray<double,1> > list_lon, list_lat;
-    list<CArray<double,2> > list_boundslon, list_boundslat;
-
-    std::map<int, std::vector<size_t> >::const_iterator it, iteMap;
-    iteMap = indSrv_.end();
-    for (int k = 0; k < connectedServerRank_.size(); ++k)
+    std::list<CContextClient*>::iterator it;
+    for (it=clients.begin(); it!=clients.end(); ++it)
     {
-      int nbData = 0;
-      int rank = connectedServerRank_[k];
-      it = indSrv_.find(rank);
-      if (iteMap != it)
-        nbData = it->second.size();
-
-      list_lon.push_back(CArray<double,1>(nbData));
-      list_lat.push_back(CArray<double,1>(nbData));
-
-      if (hasBounds)
-      {
-        list_boundslon.push_back(CArray<double,2>(nvertex, nbData));
-        list_boundslat.push_back(CArray<double,2>(nvertex, nbData));
-      }
-
-      CArray<double,1>& lon = list_lon.back();
-      CArray<double,1>& lat = list_lat.back();
-      const std::vector<size_t>& temp = it->second;
-      for (n = 0; n < nbData; ++n)
-      {
-        idx = static_cast<int>(it->second[n]);
-        lon(n) = lonvalue_client(idx);
-        lat(n) = latvalue_client(idx);
+      CContextClient* client = *it;
+      int serverSize = client->serverSize;
+
+      // send lon lat for each connected server
+      CEventClient eventLon(getType(), EVENT_ID_LON);
+      CEventClient eventLat(getType(), EVENT_ID_LAT);
+
+      list<CMessage> list_msgsLon, list_msgsLat;
+      list<CArray<double,1> > list_lon, list_lat;
+      list<CArray<double,2> > list_boundslon, list_boundslat;
+
+      boost::unordered_map<int, vector<size_t> >::const_iterator it, iteMap;
+      iteMap = indSrv_[serverSize].end();
+      for (int k = 0; k < connectedServerRank_[serverSize].size(); ++k)
+      {
+        int nbData = 0;
+        int rank = connectedServerRank_[serverSize][k];
+        it = indSrv_[serverSize].find(rank);
+        if (iteMap != it)
+          nbData = it->second.size();
+
+        list_lon.push_back(CArray<double,1>(nbData));
+        list_lat.push_back(CArray<double,1>(nbData));
 
         if (hasBounds)
         {
-          CArray<double,2>& boundslon = list_boundslon.back();
-          CArray<double,2>& boundslat = list_boundslat.back();
-
-          for (nv = 0; nv < nvertex; ++nv)
+          list_boundslon.push_back(CArray<double,2>(nvertex, nbData));
+          list_boundslat.push_back(CArray<double,2>(nvertex, nbData));
+        }
+
+        CArray<double,1>& lon = list_lon.back();
+        CArray<double,1>& lat = list_lat.back();
+        const std::vector<size_t>& temp = it->second;
+        for (n = 0; n < nbData; ++n)
+        {
+          idx = static_cast<int>(it->second[n]);
+          int localInd = globalLocalIndexMap_[idx];
+          lon(n) = lonvalue(localInd);
+          lat(n) = latvalue(localInd);
+
+          if (hasBounds)
           {
-            boundslon(nv, n) = bounds_lon_client(nv, idx);
-            boundslat(nv, n) = bounds_lat_client(nv, idx);
+            CArray<double,2>& boundslon = list_boundslon.back();
+            CArray<double,2>& boundslat = list_boundslat.back();
+
+            for (nv = 0; nv < nvertex; ++nv)
+            {
+              boundslon(nv, n) = bounds_lonvalue(nv, localInd);
+              boundslat(nv, n) = bounds_latvalue(nv, localInd);
+            }
           }
         }
-      }
-
-      list_msgsLon.push_back(CMessage());
-      list_msgsLat.push_back(CMessage());
-
-      list_msgsLon.back() << this->getId() << list_lon.back();
-      list_msgsLat.back() << this->getId() << list_lat.back();
-
-      if (hasBounds)
-      {
-        list_msgsLon.back() << list_boundslon.back();
-        list_msgsLat.back() << list_boundslat.back();
-      }
-
-      eventLon.push(rank, nbConnectedClients_[rank], list_msgsLon.back());
-      eventLat.push(rank, nbConnectedClients_[rank], list_msgsLat.back());
-    }
-
-    client->sendEvent(eventLon);
-    client->sendEvent(eventLat);
+
+        list_msgsLon.push_back(CMessage());
+        list_msgsLat.push_back(CMessage());
+
+        list_msgsLon.back() << this->getId() << hasLonLat;
+        if (hasLonLat) 
+          list_msgsLon.back() << list_lon.back();
+        list_msgsLon.back()  << hasBounds;
+        if (hasBounds)
+        {
+          list_msgsLon.back() << list_boundslon.back();
+        }
+
+        list_msgsLat.back() << this->getId() << hasLonLat;
+        if (hasLonLat)
+          list_msgsLat.back() << list_lat.back();
+        list_msgsLat.back() << hasBounds;
+        if (hasBounds)
+        {          
+          list_msgsLat.back() << list_boundslat.back();
+        }
+
+        eventLon.push(rank, nbSenders[serverSize][rank], list_msgsLon.back());
+        eventLat.push(rank, nbSenders[serverSize][rank], list_msgsLat.back());
+      }
+      client->sendEvent(eventLon);
+      client->sendEvent(eventLat);
+    }
   }
 
   /*!
-    Send some optional information to server(s)
-    In the future, this function can be extended with more optional information to send
+    Send data index to corresponding connected clients.
+    Data index can be compressed however, we always send decompressed data index
+    and they will be compressed on receiving.
+    The compressed index are represented with 1 and others are represented with -1
   */
-  void CDomain::sendLonLatArea(void)
-  {
-    sendIndex();
-    sendLonLat();
-    sendArea();
-  }
-
+  void CDomain::sendDataIndex()
+  {
+    int ns, n, i, j, ind, nv, idx;
+    std::list<CContextClient*>::iterator it;
+    for (it=clients.begin(); it!=clients.end(); ++it)
+    {
+      CContextClient* client = *it;
+
+      int serverSize = client->serverSize;
+
+      // send area for each connected server
+      CEventClient eventDataIndex(getType(), EVENT_ID_DATA_INDEX);
+
+      list<CMessage> list_msgsDataIndex;
+      list<CArray<int,1> > list_data_i_index, list_data_j_index;
+
+      int nbIndex = i_index.numElements();
+      int niByIndex = max(i_index) - min(i_index) + 1;
+      int njByIndex = max(j_index) - min(j_index) + 1; 
+      int dataIindexBound = (1 == data_dim) ? (niByIndex * njByIndex) : niByIndex;
+      int dataJindexBound = (1 == data_dim) ? (niByIndex * njByIndex) : njByIndex;
+
+      
+      CArray<int,1> dataIIndex(nbIndex), dataJIndex(nbIndex);
+      dataIIndex = -1; 
+      dataJIndex = -1;
+      ind = 0;
+
+      for (idx = 0; idx < data_i_index.numElements(); ++idx)
+      {
+        int dataIidx = data_i_index(idx) + data_ibegin;
+        int dataJidx = data_j_index(idx) + data_jbegin;
+        if ((0 <= dataIidx) && (dataIidx < dataIindexBound) &&
+            (0 <= dataJidx) && (dataJidx < dataJindexBound))
+        {
+          dataIIndex((1 == data_dim) ? dataIidx : dataJidx * ni + dataIidx) = 1; //i_index(dataIidx);//dataIidx;
+          dataJIndex((1 == data_dim) ? dataIidx : dataJidx * ni + dataIidx) = 1; //j_index(dataJidx);//          
+        }
+      }
+
+      boost::unordered_map<int, vector<size_t> >::const_iterator it, iteMap;
+      iteMap = indSrv_[serverSize].end();
+      for (int k = 0; k < connectedServerRank_[serverSize].size(); ++k)
+      {
+        int nbData = 0;
+        int rank = connectedServerRank_[serverSize][k];
+        it = indSrv_[serverSize].find(rank);
+        if (iteMap != it)
+          nbData = it->second.size();
+        list_data_i_index.push_back(CArray<int,1>(nbData));
+        list_data_j_index.push_back(CArray<int,1>(nbData));
+
+        const std::vector<size_t>& temp = it->second;
+        for (n = 0; n < nbData; ++n)
+        {
+          idx = static_cast<int>(it->second[n]);
+          i = globalLocalIndexMap_[idx];
+          list_data_i_index.back()(n) = dataIIndex(i);
+          list_data_j_index.back()(n) = dataJIndex(i);
+        }
+
+        list_msgsDataIndex.push_back(CMessage());
+        list_msgsDataIndex.back() << this->getId();
+        list_msgsDataIndex.back() << list_data_i_index.back() << list_data_j_index.back();
+        eventDataIndex.push(rank, nbSenders[serverSize][rank], list_msgsDataIndex.back());
+      }
+      client->sendEvent(eventDataIndex);
+    }
+  }
+  
   bool CDomain::dispatchEvent(CEventServer& event)
   {
@@ -1972,9 +2430,13 @@
       {
         case EVENT_ID_SERVER_ATTRIBUT:
-          recvServerAttribut(event);
+          recvDistributionAttributes(event);
           return true;
           break;
         case EVENT_ID_INDEX:
           recvIndex(event);
+          return true;
+          break;
+        case EVENT_ID_MASK:
+          recvMask(event);
           return true;
           break;
@@ -1990,4 +2452,8 @@
           recvArea(event);
           return true;
+          break;  
+        case EVENT_ID_DATA_INDEX:
+          recvDataIndex(event);
+          return true;
           break;
         default:
@@ -2000,13 +2466,103 @@
 
   /*!
+    Receive index event from clients(s)
+    \param[in] event event contain info about rank and associated index
+  */
+  void CDomain::recvIndex(CEventServer& event)
+  {
+    string domainId;
+    std::map<int, CBufferIn*> rankBuffers;
+
+    list<CEventServer::SSubEvent>::iterator it;
+    for (it = event.subEvents.begin(); it != event.subEvents.end(); ++it)
+    {      
+      CBufferIn* buffer = it->buffer;
+      *buffer >> domainId;
+      rankBuffers[it->rank] = buffer;        
+    }
+    get(domainId)->recvIndex(rankBuffers);
+  }
+
+  /*!
+    Receive index information from client(s). We use the global index for mapping index between
+    sending clients and receiving clients.
+    \param[in] rankBuffers rank of sending client and the corresponding receive buffer  
+  */
+  void CDomain::recvIndex(std::map<int, CBufferIn*>& rankBuffers)
+  {
+    int nbReceived = rankBuffers.size(), i, ind, index, type_int, iIndex, jIndex;
+    recvClientRanks_.resize(nbReceived);        
+
+    std::map<int, CBufferIn*>::iterator it = rankBuffers.begin(), ite = rankBuffers.end();
+    ind = 0;
+    for (ind = 0; it != ite; ++it, ++ind)
+    {       
+       recvClientRanks_[ind] = it->first;
+       CBufferIn& buffer = *(it->second);
+       buffer >> type_int >> isCurvilinear >> indGlob_[it->first]; 
+       type.setValue((type_attr::t_enum)type_int); // probleme des type enum avec les buffers : ToFix
+    }
+    int nbIndGlob = 0;
+    for (i = 0; i < nbReceived; ++i)
+    {
+      nbIndGlob += indGlob_[recvClientRanks_[i]].numElements();
+    }
+    
+    globalLocalIndexMap_.rehash(std::ceil(nbIndGlob/globalLocalIndexMap_.max_load_factor()));
+    i_index.resize(nbIndGlob);
+    j_index.resize(nbIndGlob);   
+    int nbIndexGlobMax = nbIndGlob, nbIndLoc;
+
+    nbIndGlob = 0;
+    for (i = 0; i < nbReceived; ++i)
+    {
+      CArray<int,1>& tmp = indGlob_[recvClientRanks_[i]];
+      for (ind = 0; ind < tmp.numElements(); ++ind)
+      {
+         index = tmp(ind);
+         if (0 == globalLocalIndexMap_.count(index))
+         {
+           iIndex = (index%ni_glo)-ibegin;
+           iIndex = (iIndex < 0) ? 0 : iIndex;
+           jIndex = (index/ni_glo)-jbegin;
+           jIndex = (jIndex < 0) ? 0 : jIndex;
+           nbIndLoc = iIndex + ni * jIndex;
+           if (nbIndLoc < nbIndexGlobMax)
+           {
+             i_index(nbIndLoc) = index % ni_glo;
+             j_index(nbIndLoc) = index / ni_glo;
+             globalLocalIndexMap_[index] = nbIndLoc;  
+             ++nbIndGlob;
+           }
+           // i_index(nbIndGlob) = index % ni_glo;
+           // j_index(nbIndGlob) = index / ni_glo;
+           // globalLocalIndexMap_[index] = nbIndGlob;  
+           // ++nbIndGlob;
+         } 
+      } 
+    } 
+
+    if (nbIndGlob==0)
+    {
+      i_index.resize(nbIndGlob);
+      j_index.resize(nbIndGlob);
+    }
+    else
+    {
+      i_index.resizeAndPreserve(nbIndGlob);
+      j_index.resizeAndPreserve(nbIndGlob);
+    }
+  }
+
+  /*!
     Receive attributes event from clients(s)
     \param[in] event event contain info about rank and associated attributes
   */
-  void CDomain::recvServerAttribut(CEventServer& event)
+  void CDomain::recvDistributionAttributes(CEventServer& event)
   {
     CBufferIn* buffer=event.subEvents.begin()->buffer;
     string domainId ;
     *buffer>>domainId ;
-    get(domainId)->recvServerAttribut(*buffer) ;
+    get(domainId)->recvDistributionAttributes(*buffer);
   }
 
@@ -2016,10 +2572,15 @@
     \param[in] buffer message containing attributes info
   */
-  void CDomain::recvServerAttribut(CBufferIn& buffer)
-  {
+  void CDomain::recvDistributionAttributes(CBufferIn& buffer)
+  {
+    int ni_tmp, ibegin_tmp, nj_tmp, jbegin_tmp;
     int global_zoom_ni_tmp, global_zoom_ibegin_tmp, global_zoom_nj_tmp, global_zoom_jbegin_tmp;
-    buffer >> ni_srv >> ibegin_srv >> iend_srv >> nj_srv >> jbegin_srv >> jend_srv
-           >> global_zoom_ni_tmp >> global_zoom_ibegin_tmp >> global_zoom_nj_tmp >> global_zoom_jbegin_tmp
+    buffer >> isUnstructed_ >> ni_tmp >> ibegin_tmp >> nj_tmp >> jbegin_tmp
+           >> global_zoom_ni_tmp >> global_zoom_ibegin_tmp >> global_zoom_nj_tmp >> global_zoom_jbegin_tmp           
            >> isCompressible_;
+    ni.setValue(ni_tmp);
+    ibegin.setValue(ibegin_tmp);
+    nj.setValue(nj_tmp);
+    jbegin.setValue(jbegin_tmp);
 
     global_zoom_ni.setValue(global_zoom_ni_tmp);
@@ -2028,36 +2589,21 @@
     global_zoom_jbegin.setValue(global_zoom_jbegin_tmp);
 
-    int zoom_iend = global_zoom_ibegin + global_zoom_ni - 1;
-    int zoom_jend = global_zoom_jbegin + global_zoom_nj - 1;
-
-    zoom_ibegin_srv = global_zoom_ibegin > ibegin_srv ? global_zoom_ibegin : ibegin_srv ;
-    zoom_iend_srv = zoom_iend < iend_srv ? zoom_iend : iend_srv ;
-    zoom_ni_srv=zoom_iend_srv-zoom_ibegin_srv+1 ;
-
-    zoom_jbegin_srv = global_zoom_jbegin > jbegin_srv ? global_zoom_jbegin : jbegin_srv ;
-    zoom_jend_srv = zoom_jend < jend_srv ? zoom_jend : jend_srv ;
-    zoom_nj_srv=zoom_jend_srv-zoom_jbegin_srv+1 ;
-
-    if (zoom_ni_srv<=0 || zoom_nj_srv<=0)
+    int iend = ibegin + ni  - 1;
+    int jend = jbegin + nj  - 1;
+    int zoom_iend_glob = global_zoom_ibegin + global_zoom_ni - 1;
+    int zoom_jend_glob = global_zoom_jbegin + global_zoom_nj - 1;
+
+    zoom_ibegin.setValue(global_zoom_ibegin > ibegin ? global_zoom_ibegin.getValue() : ibegin);
+    int zoom_iend = zoom_iend_glob < iend ? zoom_iend_glob : iend ;
+    zoom_ni.setValue(zoom_iend-zoom_ibegin+1);
+
+    zoom_jbegin.setValue(global_zoom_jbegin > jbegin ? global_zoom_jbegin.getValue() : jbegin);
+    int zoom_jend = zoom_jend_glob < jend ? zoom_jend_glob : jend ;
+    zoom_nj.setValue(zoom_jend-zoom_jbegin+1);
+
+    if (zoom_ni<=0 || zoom_nj<=0)
     {
-      zoom_ibegin_srv=0 ; zoom_iend_srv=0 ; zoom_ni_srv=0 ;
-      zoom_jbegin_srv=0 ; zoom_jend_srv=0 ; zoom_nj_srv=0 ;
-    }
-    lonvalue_srv.resize(zoom_ni_srv*zoom_nj_srv) ;
-    lonvalue_srv = 0. ;
-    latvalue_srv.resize(zoom_ni_srv*zoom_nj_srv) ;
-    latvalue_srv = 0. ;
-    if (hasBounds)
-    {
-      bounds_lon_srv.resize(nvertex,zoom_ni_srv*zoom_nj_srv) ;
-      bounds_lon_srv = 0. ;
-      bounds_lat_srv.resize(nvertex,zoom_ni_srv*zoom_nj_srv) ;
-      bounds_lat_srv = 0. ;
-    }
-
-    if (hasArea)
-    {
-      area_srv.resize(zoom_ni_srv * zoom_nj_srv);
-      area_srv = 0.;
+      zoom_ni=0 ; zoom_ibegin=global_zoom_ibegin ; //=0; zoom_iend=0 ; 
+      zoom_nj=0 ; zoom_jbegin=global_zoom_jbegin ; //=0; zoom_jend=0 ;
     }
 
@@ -2065,52 +2611,70 @@
 
   /*!
-    Receive index event from clients(s)
-    \param[in] event event contain info about rank and associated index
+    Receive area event from clients(s)
+    \param[in] event event contain info about rank and associated area
   */
-  void CDomain::recvIndex(CEventServer& event)
-  {
-    CDomain* domain;
+  void CDomain::recvMask(CEventServer& event)
+  {
+    string domainId;
+    std::map<int, CBufferIn*> rankBuffers;
 
     list<CEventServer::SSubEvent>::iterator it;
     for (it = event.subEvents.begin(); it != event.subEvents.end(); ++it)
+    {      
+      CBufferIn* buffer = it->buffer;
+      *buffer >> domainId;
+      rankBuffers[it->rank] = buffer;     
+    }
+    get(domainId)->recvMask(rankBuffers);
+  }
+
+
+  /*!
+    Receive mask information from client(s)
+    \param[in] rankBuffers rank of sending client and the corresponding receive buffer  
+  */
+  void CDomain::recvMask(std::map<int, CBufferIn*>& rankBuffers)
+  {
+    int nbReceived = rankBuffers.size(), i, ind, index, lInd;
+    if (nbReceived != recvClientRanks_.size())
+      ERROR("void CDomain::recvMask(std::map<int, CBufferIn*>& rankBuffers)",
+           << "The number of sending clients is not correct."
+           << "Expected number: " << recvClientRanks_.size() << " but received " << nbReceived);
+
+    vector<CArray<bool,1> > recvMaskValue(nbReceived);      
+    for (i = 0; i < recvClientRanks_.size(); ++i)
     {
-      CBufferIn* buffer = it->buffer;
-      string domainId;
-      *buffer >> domainId;
-      domain = get(domainId);
-      domain->recvIndex(it->rank, *buffer);
-    }
-
-    if (domain->isCompressible_)
+      int rank = recvClientRanks_[i];
+      CBufferIn& buffer = *(rankBuffers[rank]);      
+      buffer >> recvMaskValue[i];
+    }
+
+    int nbMaskInd = 0;
+    for (i = 0; i < nbReceived; ++i)
     {
-      std::sort(domain->indexesToWrite.begin(), domain->indexesToWrite.end());
-
-      CContextServer* server = CContext::getCurrent()->server;
-      domain->numberWrittenIndexes_ = domain->indexesToWrite.size();
-      MPI_Allreduce(&domain->numberWrittenIndexes_, &domain->totalNumberWrittenIndexes_, 1, MPI_INT, MPI_SUM, server->intraComm);
-      MPI_Scan(&domain->numberWrittenIndexes_, &domain->offsetWrittenIndexes_, 1, MPI_INT, MPI_SUM, server->intraComm);
-      domain->offsetWrittenIndexes_ -= domain->numberWrittenIndexes_;
-    }
-  }
-
-  /*!
-    Receive index information from client(s)
-    \param[in] rank rank of client source
-    \param[in] buffer message containing index info
-  */
-  void CDomain::recvIndex(int rank, CBufferIn& buffer)
-  {
-    int type_int;
-    buffer >> type_int >> isCurvilinear >> indiSrv[rank] >> indjSrv[rank];
-    type.setValue((type_attr::t_enum)type_int); // probleme des type enum avec les buffers : ToFix
-
-    if (isCompressible_)
+      nbMaskInd += recvMaskValue[i].numElements();
+    }
+  
+    if (nbMaskInd != globalLocalIndexMap_.size())
+      info (0) << "If domain " << this->getDomainOutputName() <<" does not have overlapped regions between processes "
+               << "something must be wrong with mask index "<< std::endl;
+
+    nbMaskInd = globalLocalIndexMap_.size();
+    mask_1d.resize(nbMaskInd);
+    domainMask.resize(nbMaskInd);
+    mask_1d = false;
+    
+    for (i = 0; i < nbReceived; ++i)
     {
-      CArray<int, 1> writtenIndexes;
-      buffer >> writtenIndexes;
-      indexesToWrite.reserve(indexesToWrite.size() + writtenIndexes.numElements());
-      for (int i = 0; i < writtenIndexes.numElements(); ++i)
-        indexesToWrite.push_back(writtenIndexes(i));
-    }
+      CArray<int,1>& tmpInd = indGlob_[recvClientRanks_[i]];
+      CArray<bool,1>& tmp = recvMaskValue[i];
+      for (ind = 0; ind < tmp.numElements(); ++ind)
+      {
+        lInd = globalLocalIndexMap_[size_t(tmpInd(ind))];
+        if (!mask_1d(lInd)) // Only rewrite mask_1d if it's not true
+          mask_1d(lInd) = tmp(ind);
+      }
+    }
+    domainMask=mask_1d ;
   }
 
@@ -2121,40 +2685,79 @@
   void CDomain::recvLon(CEventServer& event)
   {
+    string domainId;
+    std::map<int, CBufferIn*> rankBuffers;
+
     list<CEventServer::SSubEvent>::iterator it;
     for (it = event.subEvents.begin(); it != event.subEvents.end(); ++it)
-    {
+    {      
       CBufferIn* buffer = it->buffer;
-      string domainId;
       *buffer >> domainId;
-      get(domainId)->recvLon(it->rank, *buffer);
-    }
+      rankBuffers[it->rank] = buffer;        
+    }
+    get(domainId)->recvLon(rankBuffers);
   }
 
   /*!
     Receive longitude information from client(s)
-    \param[in] rank rank of client source
-    \param[in] buffer message containing longitude info
+    \param[in] rankBuffers rank of sending client and the corresponding receive buffer  
   */
-  void CDomain::recvLon(int rank, CBufferIn& buffer)
-  {
-    CArray<int,1> &indi = indiSrv[rank], &indj = indjSrv[rank];
-    CArray<double,1> lon;
-    CArray<double,2> boundslon;
-
-    buffer >> lon;
-
-    if (hasBounds) buffer >> boundslon;
-
-    int i, j, ind_srv;
-    for (int ind = 0; ind < indi.numElements(); ind++)
+  void CDomain::recvLon(std::map<int, CBufferIn*>& rankBuffers)
+  {
+    int nbReceived = rankBuffers.size(), i, ind, index, iindex, jindex, lInd;
+    if (nbReceived != recvClientRanks_.size())
+      ERROR("void CDomain::recvLon(std::map<int, CBufferIn*>& rankBuffers)",
+           << "The number of sending clients is not correct."
+           << "Expected number: " << recvClientRanks_.size() << " but received " << nbReceived);
+
+    vector<CArray<double,1> > recvLonValue(nbReceived);
+    vector<CArray<double,2> > recvBoundsLonValue(nbReceived);    
+    for (i = 0; i < recvClientRanks_.size(); ++i)
     {
-      i = indi(ind); j = indj(ind);
-      ind_srv = (i - zoom_ibegin_srv) + (j - zoom_jbegin_srv) * zoom_ni_srv;
-      lonvalue_srv(ind_srv) = lon(ind);
+      int rank = recvClientRanks_[i];
+      CBufferIn& buffer = *(rankBuffers[rank]);
+      buffer >> hasLonLat;
+      if (hasLonLat)
+        buffer >> recvLonValue[i];
+      buffer >> hasBounds;
       if (hasBounds)
-      {
-        for (int nv = 0; nv < nvertex; ++nv)
-          bounds_lon_srv(nv, ind_srv) = boundslon(nv, ind);
-      }
+        buffer >> recvBoundsLonValue[i];
+    }
+
+    if (hasLonLat)
+    {
+      int nbLonInd = 0;
+      for (i = 0; i < nbReceived; ++i)
+      {
+        nbLonInd += recvLonValue[i].numElements();
+      }
+    
+      if (nbLonInd != globalLocalIndexMap_.size())
+        info (0) << "If domain " << this->getDomainOutputName() <<" does not have overlapped regions between processes "
+                 << "something must be wrong with longitude index "<< std::endl;
+
+      nbLonInd = globalLocalIndexMap_.size();
+      lonvalue.resize(nbLonInd);
+      if (hasBounds)
+      {
+        bounds_lonvalue.resize(nvertex,nbLonInd);
+        bounds_lonvalue = 0.;
+      }
+
+      nbLonInd = 0;
+      for (i = 0; i < nbReceived; ++i)
+      {
+        CArray<int,1>& tmpInd = indGlob_[recvClientRanks_[i]];
+        CArray<double,1>& tmp = recvLonValue[i];
+        for (ind = 0; ind < tmp.numElements(); ++ind)
+        {
+          lInd = globalLocalIndexMap_[size_t(tmpInd(ind))];
+          lonvalue(lInd) = tmp(ind); 
+           if (hasBounds)
+           {          
+            for (int nv = 0; nv < nvertex; ++nv)
+              bounds_lonvalue(nv, lInd) = recvBoundsLonValue[i](nv, ind);
+           }                  
+        }
+      }       
     }
   }
@@ -2166,39 +2769,81 @@
   void CDomain::recvLat(CEventServer& event)
   {
+    string domainId;
+    std::map<int, CBufferIn*> rankBuffers;
+
     list<CEventServer::SSubEvent>::iterator it;
     for (it = event.subEvents.begin(); it != event.subEvents.end(); ++it)
-    {
+    {      
       CBufferIn* buffer = it->buffer;
-      string domainId;
       *buffer >> domainId;
-      get(domainId)->recvLat(it->rank, *buffer);
-    }
+      rankBuffers[it->rank] = buffer;    
+    }
+    get(domainId)->recvLat(rankBuffers);
   }
 
   /*!
     Receive latitude information from client(s)
-    \param[in] rank rank of client source
-    \param[in] buffer message containing latitude info
+    \param[in] rankBuffers rank of sending client and the corresponding receive buffer  
   */
-  void CDomain::recvLat(int rank, CBufferIn& buffer)
-  {
-    CArray<int,1> &indi = indiSrv[rank], &indj = indjSrv[rank];
-    CArray<double,1> lat;
-    CArray<double,2> boundslat;
-
-    buffer >> lat;
-    if (hasBounds) buffer >> boundslat;
-
-    int i, j, ind_srv;
-    for (int ind = 0; ind < indi.numElements(); ind++)
+  void CDomain::recvLat(std::map<int, CBufferIn*>& rankBuffers)
+  {
+    int nbReceived = rankBuffers.size(), i, ind, index, iindex, jindex, lInd;
+    if (nbReceived != recvClientRanks_.size())
+      ERROR("void CDomain::recvLat(std::map<int, CBufferIn*>& rankBuffers)",
+           << "The number of sending clients is not correct."
+           << "Expected number: " << recvClientRanks_.size() << " but received " << nbReceived);
+
+    vector<CArray<double,1> > recvLatValue(nbReceived);
+    vector<CArray<double,2> > recvBoundsLatValue(nbReceived);    
+    for (i = 0; i < recvClientRanks_.size(); ++i)
     {
-      i = indi(ind); j = indj(ind);
-      ind_srv = (i - zoom_ibegin_srv) + (j - zoom_jbegin_srv) * zoom_ni_srv;
-      latvalue_srv(ind_srv) = lat(ind);
+      int rank = recvClientRanks_[i];
+      CBufferIn& buffer = *(rankBuffers[rank]);
+      buffer >> hasLonLat;
+      if (hasLonLat)
+        buffer >> recvLatValue[i];
+      buffer >> hasBounds;
       if (hasBounds)
-      {
-        for (int nv = 0; nv < nvertex; nv++)
-          bounds_lat_srv(nv, ind_srv) = boundslat(nv, ind);
-      }
+        buffer >> recvBoundsLatValue[i];
+    }
+
+    if (hasLonLat)
+    {
+      int nbLatInd = 0;
+      for (i = 0; i < nbReceived; ++i)
+      {
+        nbLatInd += recvLatValue[i].numElements();
+      }
+    
+      if (nbLatInd != globalLocalIndexMap_.size())
+        info (0) << "If domain " << this->getDomainOutputName() <<" does not have overlapped regions between processes "
+                << "something must be wrong with latitude index "<< std::endl;
+
+      nbLatInd = globalLocalIndexMap_.size();
+      latvalue.resize(nbLatInd);
+      if (hasBounds)
+      {
+        bounds_latvalue.resize(nvertex,nbLatInd);
+        bounds_latvalue = 0. ;
+      }
+
+      nbLatInd = 0;
+      for (i = 0; i < nbReceived; ++i)
+      {
+        CArray<int,1>& tmpInd = indGlob_[recvClientRanks_[i]];
+        CArray<double,1>& tmp = recvLatValue[i];
+        for (ind = 0; ind < tmp.numElements(); ++ind)
+        {
+          lInd = globalLocalIndexMap_[size_t(tmpInd(ind))];
+          latvalue(lInd) = tmp(ind);    
+           if (hasBounds)
+           {
+            CArray<double,2>& boundslat = recvBoundsLatValue[i];
+            for (int nv = 0; nv < nvertex; ++nv)
+              bounds_latvalue(nv, lInd) = boundslat(nv, ind);
+           }   
+          ++nbLatInd;
+        }
+      }       
     }
   }
@@ -2210,32 +2855,65 @@
   void CDomain::recvArea(CEventServer& event)
   {
+    string domainId;
+    std::map<int, CBufferIn*> rankBuffers;
+
     list<CEventServer::SSubEvent>::iterator it;
     for (it = event.subEvents.begin(); it != event.subEvents.end(); ++it)
-    {
+    {      
       CBufferIn* buffer = it->buffer;
-      string domainId;
       *buffer >> domainId;
-      get(domainId)->recvArea(it->rank, *buffer);
-    }
+      rankBuffers[it->rank] = buffer;     
+    }
+    get(domainId)->recvArea(rankBuffers);
   }
 
   /*!
     Receive area information from client(s)
-    \param[in] rank rank of client source
-    \param[in] buffer message containing area info
+    \param[in] rankBuffers rank of sending client and the corresponding receive buffer     
   */
-  void CDomain::recvArea(int rank, CBufferIn& buffer)
-  {
-    CArray<int,1> &indi = indiSrv[rank], &indj = indjSrv[rank];
-    CArray<double,1> clientArea;
-
-    buffer >> clientArea;
-
-    int i, j, ind_srv;
-    for (int ind = 0; ind < indi.numElements(); ind++)
+  void CDomain::recvArea(std::map<int, CBufferIn*>& rankBuffers)
+  {
+    int nbReceived = rankBuffers.size(), i, ind, index, lInd;
+    if (nbReceived != recvClientRanks_.size())
+      ERROR("void CDomain::recvArea(std::map<int, CBufferIn*>& rankBuffers)",
+           << "The number of sending clients is not correct."
+           << "Expected number: " << recvClientRanks_.size() << " but received " << nbReceived);
+
+    vector<CArray<double,1> > recvAreaValue(nbReceived);      
+    for (i = 0; i < recvClientRanks_.size(); ++i)
     {
-      i = indi(ind); j = indj(ind);
-      ind_srv = (i - zoom_ibegin_srv) + (j - zoom_jbegin_srv) * zoom_ni_srv;
-      area_srv(ind_srv) = clientArea(ind);
+      int rank = recvClientRanks_[i];
+      CBufferIn& buffer = *(rankBuffers[rank]);      
+      buffer >> hasArea;
+      if (hasArea)
+        buffer >> recvAreaValue[i];
+    }
+
+    if (hasArea)
+    {
+      int nbAreaInd = 0;
+      for (i = 0; i < nbReceived; ++i)
+      {      
+        nbAreaInd += recvAreaValue[i].numElements();
+      }
+
+      if (nbAreaInd != globalLocalIndexMap_.size())
+        info (0) << "If domain " << this->getDomainOutputName() <<" does not have overlapped regions between processes "
+                 << "something must be wrong with area index "<< std::endl;
+
+      nbAreaInd = globalLocalIndexMap_.size();
+      areavalue.resize(nbAreaInd);
+      nbAreaInd = 0;      
+      for (i = 0; i < nbReceived; ++i)
+      {
+        CArray<int,1>& tmpInd = indGlob_[recvClientRanks_[i]];
+        CArray<double,1>& tmp = recvAreaValue[i];
+        for (ind = 0; ind < tmp.numElements(); ++ind)
+        {
+          lInd = globalLocalIndexMap_[size_t(tmpInd(ind))];
+          areavalue(lInd) = tmp(ind);          
+        }
+      }
+      
     }
   }
@@ -2272,4 +2950,105 @@
   }
 
+  /*!
+    Receive data index event from clients(s)
+    \param[in] event event contain info about rank and associated index
+  */
+  void CDomain::recvDataIndex(CEventServer& event)
+  {
+    string domainId;
+    std::map<int, CBufferIn*> rankBuffers;
+
+    list<CEventServer::SSubEvent>::iterator it;
+    for (it = event.subEvents.begin(); it != event.subEvents.end(); ++it)
+    {      
+      CBufferIn* buffer = it->buffer;
+      *buffer >> domainId;
+      rankBuffers[it->rank] = buffer;        
+    }
+    get(domainId)->recvDataIndex(rankBuffers);
+  }
+
+  /*!
+    Receive data index information from client(s)
+    A client receives data index from different clients to rebuild its own data index.
+    Because we use global index + mask info to calculate the sending data to client(s), 
+    this data index must be updated with mask info (maybe it will change in the future)
+    Because the data index is local, to rebuild data index of received client, we should use global index along with. 
+
+    \param[in] rankBuffers rank of sending client and the corresponding receive buffer     
+  */
+  void CDomain::recvDataIndex(std::map<int, CBufferIn*>& rankBuffers)
+  {
+    int nbReceived = rankBuffers.size(), i, ind, index, indexI, indexJ, type_int, lInd;    
+    if (nbReceived != recvClientRanks_.size())
+      ERROR("void CDomain::recvDataIndex(std::map<int, CBufferIn*>& rankBuffers)",
+           << "The number of sending clients is not correct."
+           << "Expected number: " << recvClientRanks_.size() << " but received " << nbReceived);
+
+    vector<CArray<int,1> > recvDataIIndex(nbReceived),recvDataJIndex(nbReceived);     
+    for (i = 0; i < recvClientRanks_.size(); ++i)
+    {
+      int rank = recvClientRanks_[i];
+      CBufferIn& buffer = *(rankBuffers[rank]);
+      buffer >> recvDataIIndex[i];
+      buffer >> recvDataJIndex[i];
+    }
+   
+    int nbIndex = i_index.numElements();
+    CArray<int,1> dataIIndex(nbIndex), dataJIndex(nbIndex);
+    dataIIndex = -1; dataJIndex = -1;
+     
+    nbIndex = 0;
+    for (i = 0; i < nbReceived; ++i)
+    {      
+      CArray<int,1>& tmpInd = indGlob_[recvClientRanks_[i]];
+      CArray<int,1>& tmpI = recvDataIIndex[i];    
+      CArray<int,1>& tmpJ = recvDataJIndex[i];     
+      if ((tmpI.numElements() != tmpInd.numElements()) || (tmpJ.numElements() != tmpInd.numElements()))
+          ERROR("void CDomain::recvDataIndex(std::map<int, CBufferIn*>& rankBuffers)",
+             << "The number of global received index is not coherent with the number of received data index."
+             << "Expected number of global index: " << tmpI.numElements() << " but received " << tmpInd.numElements());
+
+      for (ind = 0; ind < tmpI.numElements(); ++ind)
+      {
+         lInd = globalLocalIndexMap_[size_t(tmpInd(ind))];
+         dataIIndex(lInd) = (-1 == dataIIndex(lInd)) ? tmpI(ind) : dataIIndex(lInd); // Only fill in dataIndex if there is no data
+         dataJIndex(lInd) = (-1 == dataJIndex(lInd)) ? tmpJ(ind) : dataJIndex(lInd);  
+
+         if (!domainMask(lInd))   // Include mask info into data index on the RECEIVE getServerDimensionSizes    
+         {
+           dataIIndex(lInd) = dataJIndex(lInd) = -1;
+         }
+      } 
+    }
+
+    int nbCompressedData = 0;  
+    for (ind = 0; ind < dataIIndex.numElements(); ++ind)
+    {
+       indexI = dataIIndex(ind); indexJ = dataJIndex(ind);
+       if ((0 <= indexI) && (0 <= indexJ))
+         ++nbCompressedData;
+    }        
+  
+    data_i_index.resize(nbCompressedData);
+    data_j_index.resize(nbCompressedData);
+
+    nbCompressedData = 0;  
+    for (ind = 0; ind < dataIIndex.numElements(); ++ind)
+    {
+       indexI = dataIIndex(ind); indexJ = dataJIndex(ind);
+       if ((0 <= indexI) && (0 <= indexJ))
+       {
+          data_i_index(nbCompressedData) = (1 == data_dim) ? ind : ind % ni;
+          data_j_index(nbCompressedData) = (1 == data_dim) ? 0   : ind / ni;
+         ++nbCompressedData;
+       }
+    }
+
+    // Reset data_ibegin, data_jbegin
+    data_ibegin.setValue(0);
+    data_jbegin.setValue(0);
+  }
+
   CTransformation<CDomain>* CDomain::addTransformation(ETranformationType transType, const StdString& id)
   {
@@ -2334,4 +3113,13 @@
   }
 
+  void CDomain::setContextClient(CContextClient* contextClient)
+  {
+    if (clientsSet.find(contextClient)==clientsSet.end())
+    {
+      clients.push_back(contextClient) ;
+      clientsSet.insert(contextClient);
+    }
+  }
+
   /*!
     Parse children nodes of a domain in xml file.
Index: /XIOS/trunk/src/node/domain.hpp
===================================================================
--- /XIOS/trunk/src/node/domain.hpp	(revision 1536)
+++ /XIOS/trunk/src/node/domain.hpp	(revision 1537)
@@ -16,5 +16,5 @@
 #include "transformation.hpp"
 #include "transformation_enum.hpp"
-
+#include "server_distribution_description.hpp"
 #include "mesh.hpp"
 
@@ -42,13 +42,14 @@
       , public CDomainAttributes
    {
-
+     /// typedef ///
+     typedef CObjectTemplate<CDomain>   SuperClass;
+     typedef CDomainAttributes SuperClassAttribute;
+     public:
          enum EEventId
          {
-           EVENT_ID_SERVER_ATTRIBUT, EVENT_ID_INDEX, EVENT_ID_LON, EVENT_ID_LAT, EVENT_ID_AREA
+           EVENT_ID_INDEX, EVENT_ID_LON, EVENT_ID_LAT, 
+           EVENT_ID_AREA, EVENT_ID_MASK,
+           EVENT_ID_DATA_INDEX, EVENT_ID_SERVER_ATTRIBUT
          } ;
-
-         /// typedef ///
-         typedef CObjectTemplate<CDomain>   SuperClass;
-         typedef CDomainAttributes SuperClassAttribute;
 
       public:
@@ -71,10 +72,10 @@
          virtual void parse(xml::CXMLNode & node);
 
+         void setContextClient(CContextClient* contextClient);
+
          /// VÃ©rifications ///
          void checkAttributes(void);
-
          void checkAttributesOnClient();
          void checkAttributesOnClientAfterTransformation();
-
          void checkEligibilityForCompressedOutput(void);
 
@@ -92,47 +93,29 @@
          bool IsWritten(const StdString & filename) const;
          bool isWrittenCompressed(const StdString& filename) const;
-
-         const std::vector<int>& getIndexesToWrite(void) const;
-         int getNumberWrittenIndexes() const;
-         int getTotalNumberWrittenIndexes() const;
-         int getOffsetWrittenIndexes() const;
-
-         std::map<int, StdSize> getAttributesBufferSize();
+         
+         int getNumberWrittenIndexes(MPI_Comm writtenCom);
+         int getTotalNumberWrittenIndexes(MPI_Comm writtenCom);
+         int getOffsetWrittenIndexes(MPI_Comm writtenCom);
+         CArray<int,1>& getCompressedIndexToWriteOnServer(MPI_Comm writtenCom);
+
+         std::map<int, StdSize> getAttributesBufferSize(CContextClient* client, bool bufferForWriting = false);
 
          bool isEmpty(void) const;
          bool isDistributed(void) const;
-         bool isCompressible(void) const;
-         bool distributionAttributesHaveValue() const;
-
-         int ni_srv,ibegin_srv,iend_srv ;
-         int zoom_ni_srv,zoom_ibegin_srv,zoom_iend_srv ;
-
-         int nj_srv,jbegin_srv,jend_srv ;
-         int zoom_nj_srv,zoom_jbegin_srv,zoom_jend_srv ;
-
-         CArray<double, 1> lonvalue_srv, latvalue_srv ;
-         CArray<double, 2> bounds_lon_srv, bounds_lat_srv ;
-         CArray<double, 1> lonvalue_client, latvalue_client;
-         CArray<double, 2> bounds_lon_client, bounds_lat_client;
-         CArray<double, 1> area_srv;
-
-        vector<int> connectedServer ; // list of connected server
-        vector<int> nbSenders ; // for each communication with a server, number of communicating client
-        vector<int> nbDataSrv ; // size of data to send to each server
-        vector< vector<int> > i_indSrv ; // for each server, i global index to send
-        vector< vector<int> > j_indSrv ; // for each server, j global index to send
-
+         bool isCompressible(void) const; 
+ 
          std::vector<int> getNbGlob();
          bool isEqual(CDomain* domain);
+
+         static bool dispatchEvent(CEventServer& event);
+
       public:
          /// Mutateur ///
          void addRelFile(const StdString & filename);
-         void addRelFileCompressed(const StdString& filename);
-         void completeLonLatClient(void);
-         void sendServerAttribut(void) ;
-         void sendLonLatArea(void);
-         void computeConnectedServer(void) ;
-         void computeLocalMask(void) ;
-         
+         void addRelFileCompressed(const StdString& filename);            
+         
+         void computeWrittenIndex();
+         void computeWrittenCompressedIndex(MPI_Comm);
+
          void AllgatherRectilinearLonLat(CArray<double,1>& lon, CArray<double,1>& lat,
                                          CArray<double,1>& lon_g, CArray<double,1>& lat_g);
@@ -142,17 +125,7 @@
          
          void fillInLonLat();
-
-         static bool dispatchEvent(CEventServer& event);
-         static void recvServerAttribut(CEventServer& event);
-         static void recvIndex(CEventServer& event);
-         static void recvLon(CEventServer& event);
-         static void recvLat(CEventServer& event);
-         static void recvArea(CEventServer& event);
-         void recvServerAttribut(CBufferIn& buffer);
-         void recvIndex(int rank, CBufferIn& buffer);
-         void recvLon(int rank, CBufferIn& buffer);
-         void recvLat(int rank, CBufferIn& buffer);
-         void recvArea(int rank, CBufferIn& buffer);
-
+         bool distributionAttributesHaveValue() const;
+
+         size_t getGlobalWrittenSize() ;
          /// Destructeur ///
          virtual ~CDomain(void);
@@ -162,7 +135,15 @@
          static StdString GetDefName(void);
 
-         static ENodeType GetType(void);
-         const std::map<int, vector<size_t> >& getIndexServer() const;
-         CArray<bool, 1> localMask;
+         static ENodeType GetType(void);        
+
+      public:
+         CArray<double, 1> lonvalue, latvalue;
+         CArray<double, 2> bounds_lonvalue, bounds_latvalue;
+         CArray<double, 1> areavalue;
+
+         CArray<size_t,1> localIndexToWriteOnServer;         
+
+         CArray<bool, 1> domainMask; // mask_1d, mask_2d -> domainMask
+         CArray<bool, 1> localMask; // domainMask + indexing
          bool isCurvilinear ;
          bool hasBounds ;
@@ -171,4 +152,5 @@
          bool hasPole ;
 
+         void computeLocalMask(void) ;
       private:
          void checkDomain(void);
@@ -183,29 +165,63 @@
          void checkArea(void);
          void checkLonLat();
-         void checkZoom(void);    
-         
-         void setTransformations(const TransMapTypes&);
+         void checkZoom(void);
+
+         void setTransformations(const TransMapTypes&);         
          void computeNGlobDomain();
-
+         void sendAttributes();
          void sendIndex();
+         void sendDistributionAttributes();
+         void sendMask();
          void sendArea();
-         void sendLonLat();
-
+         void sendLonLat();         
+         void sendDataIndex();
+         void convertLonLatValue();
          void fillInRectilinearLonLat();
          void fillInCurvilinearLonLat();
          void fillInUnstructuredLonLat();
-       private:
-         bool isChecked;
+         
+         static void recvDistributionAttributes(CEventServer& event);
+         static void recvIndex(CEventServer& event);
+         static void recvIndexZoom(CEventServer& event);
+         static void recvMask(CEventServer& event);         
+         static void recvLon(CEventServer& event);
+         static void recvLat(CEventServer& event);
+         static void recvArea(CEventServer& event);
+         static void recvDataIndex(CEventServer& event);
+         void recvDistributionAttributes(CBufferIn& buffer);                  
+         void recvIndex(std::map<int, CBufferIn*>& rankBuffers);         
+         void recvMask(std::map<int, CBufferIn*>& rankBuffers);
+         void recvLon(std::map<int, CBufferIn*>& rankBuffers);
+         void recvLat(std::map<int, CBufferIn*>& rankBuffers);
+         void recvArea(std::map<int, CBufferIn*>& rankBuffers);         
+         void recvDataIndex(std::map<int, CBufferIn*>& rankBuffers);
+
+         void completeLonLatClient(void);  
+         void computeConnectedClients();    
+
+       private:         
+
+/** Clients that have to send a domain. There can be multiple clients in case of secondary server, otherwise only one client. */
+         std::list<CContextClient*> clients;
+         std::set<CContextClient*> clientsSet;
+
+         bool doZoomByIndex_;
+         bool isChecked, computedWrittenIndex_;
          std::set<StdString> relFiles, relFilesCompressed;
          bool isClientChecked; // Verify whether all attributes of domain on the client side are good
          bool isClientAfterTransformationChecked;
-         std::map<int, CArray<int,1> > indiSrv, indjSrv;
-         std::map<int,int> nbConnectedClients_; // Mapping of number of communicating client to a server
-         std::map<int, vector<size_t> > indSrv_; // Global index of each client sent to server
-         std::map<int, vector<int> > indWrittenSrv_; // Global written index of each client sent to server
+         std::map<int, CArray<int,1> > indGlob_;
+         std::map<int, map<int,int> > nbSenders; // Mapping of number of communicating client to a server
+
+/** Global index of each client sent to server: map<serverSize, map<serverRank, indexes>> */
+         std::map<int, boost::unordered_map<int, vector<size_t> > > indSrv_;
+         // std::map<CContextClient*, std::map<int, vector<int> > > indWrittenSrv_; // Global written index of each client sent to server
          std::vector<int> indexesToWrite;
-         int numberWrittenIndexes_, totalNumberWrittenIndexes_, offsetWrittenIndexes_;
-         std::vector<int> connectedServerRank_;
-         bool isDistributed_;
+         std::vector<int> recvClientRanks_;
+         std::map<int,int> numberWrittenIndexes_, totalNumberWrittenIndexes_, offsetWrittenIndexes_;
+         std::map<int, CArray<int, 1> > compressedIndexToWriteOnServer;     
+         std::map<int, std::map<int,size_t> > connectedDataSize_;
+         std::map<int, std::vector<int> > connectedServerRank_;
+
          //! True if and only if the data defined on the domain can be outputted in a compressed way
          bool isCompressible_;
@@ -213,4 +229,5 @@
          TransMapTypes transformationMap_;         
          bool isUnstructed_;
+         boost::unordered_map<size_t,size_t> globalLocalIndexMap_;
        
        private:
Index: /XIOS/trunk/src/node/duplicate_scalar_to_axis.cpp
===================================================================
--- /XIOS/trunk/src/node/duplicate_scalar_to_axis.cpp	(revision 1537)
+++ /XIOS/trunk/src/node/duplicate_scalar_to_axis.cpp	(revision 1537)
@@ -0,0 +1,46 @@
+#include "duplicate_scalar_to_axis.hpp"
+#include "type.hpp"
+#include "axis.hpp"
+#include "scalar.hpp"
+
+namespace xios {
+
+  /// ////////////////////// DÃ©finitions ////////////////////// ///
+
+  CDuplicateScalarToAxis::CDuplicateScalarToAxis(void)
+    : CObjectTemplate<CDuplicateScalarToAxis>(), CDuplicateScalarToAxisAttributes(), CTransformation<CAxis>()
+  { /* Ne rien faire de plus */ }
+
+  CDuplicateScalarToAxis::CDuplicateScalarToAxis(const StdString & id)
+    : CObjectTemplate<CDuplicateScalarToAxis>(id), CDuplicateScalarToAxisAttributes(), CTransformation<CAxis>()
+  { /* Ne rien faire de plus */ }
+
+  CDuplicateScalarToAxis::~CDuplicateScalarToAxis(void)
+  {}
+
+  CTransformation<CAxis>* CDuplicateScalarToAxis::create(const StdString& id, xml::CXMLNode* node)
+  {
+    CDuplicateScalarToAxis* duplicateScalar = CDuplicateScalarToAxisGroup::get("duplicate_scalar_to_axis_definition")->createChild(id);
+    if (node) duplicateScalar->parse(*node);
+    return static_cast<CTransformation<CAxis>*>(duplicateScalar);
+  }
+
+  bool CDuplicateScalarToAxis::registerTrans()
+  {
+    return registerTransformation(TRANS_DUPLICATE_SCALAR_TO_AXIS, CDuplicateScalarToAxis::create);
+  }
+
+  bool CDuplicateScalarToAxis::_dummyRegistered = CDuplicateScalarToAxis::registerTrans();
+
+  //----------------------------------------------------------------
+
+  StdString CDuplicateScalarToAxis::GetName(void)    { return StdString("duplicate_scalar_to_axis"); }
+  StdString CDuplicateScalarToAxis::GetDefName(void) { return StdString("duplicate_scalar_to_axis"); }
+  ENodeType CDuplicateScalarToAxis::GetType(void)    { return eDuplicateScalarToAxis; }
+
+  void CDuplicateScalarToAxis::checkValid(CAxis* axisDst, CScalar* scalarSrc)
+  {
+   
+  }
+
+}
Index: /XIOS/trunk/src/node/duplicate_scalar_to_axis.hpp
===================================================================
--- /XIOS/trunk/src/node/duplicate_scalar_to_axis.hpp	(revision 1537)
+++ /XIOS/trunk/src/node/duplicate_scalar_to_axis.hpp	(revision 1537)
@@ -0,0 +1,67 @@
+#ifndef __XIOS_CDuplicateScalarToAxis__
+#define __XIOS_CDuplicateScalarToAxis__
+
+/// xios headers ///
+#include "xios_spl.hpp"
+#include "attribute_enum.hpp"
+#include "attribute_enum_impl.hpp"
+#include "attribute_array.hpp"
+#include "declare_attribute.hpp"
+#include "object_template.hpp"
+#include "group_factory.hpp"
+#include "declare_group.hpp"
+#include "transformation.hpp"
+
+namespace xios {
+  /// ////////////////////// DÃ©clarations ////////////////////// ///
+  class CDuplicateScalarToAxisGroup;
+  class CDuplicateScalarToAxisAttributes;
+  class CDuplicateScalarToAxis;
+  class CAxis;
+  class CScalar;
+
+  ///--------------------------------------------------------------
+
+  // Declare/Define CFileAttribute
+  BEGIN_DECLARE_ATTRIBUTE_MAP(CDuplicateScalarToAxis)
+#include "duplicate_scalar_to_axis_attribute.conf"
+  END_DECLARE_ATTRIBUTE_MAP(CDuplicateScalarToAxis)
+
+  ///--------------------------------------------------------------
+  /*!
+    \class CDuplicateScalarToAxis
+    This class describes duplicate_scalar in xml file.
+  */
+  class CDuplicateScalarToAxis
+    : public CObjectTemplate<CDuplicateScalarToAxis>
+    , public CDuplicateScalarToAxisAttributes
+    , public CTransformation<CAxis>
+  {
+    public :
+      typedef CObjectTemplate<CDuplicateScalarToAxis> SuperClass;
+      typedef CDuplicateScalarToAxisAttributes SuperClassAttribute;
+
+    public :
+      /// Constructeurs ///
+      CDuplicateScalarToAxis(void);
+      explicit CDuplicateScalarToAxis(const StdString& id);
+
+      /// Destructeur ///
+      virtual ~CDuplicateScalarToAxis(void);
+
+      virtual void checkValid(CAxis* axisDst, CScalar* scalarSrc);
+
+      /// Accesseurs statiques ///
+      static StdString GetName(void);
+      static StdString GetDefName(void);
+      static ENodeType GetType(void);
+    private:
+      static bool registerTrans();
+      static CTransformation<CAxis>* create(const StdString& id, xml::CXMLNode* node);
+      static bool _dummyRegistered;
+  }; // class CReduceAxisToAxis
+
+  DECLARE_GROUP(CDuplicateScalarToAxis);
+} // namespace xios
+
+#endif // ___XIOS_CDuplicateScalarToAxis__
Index: /XIOS/trunk/src/node/field.cpp
===================================================================
--- /XIOS/trunk/src/node/field.cpp	(revision 1536)
+++ /XIOS/trunk/src/node/field.cpp	(revision 1537)
@@ -23,4 +23,5 @@
 #include "temporal_filter.hpp"
 #include "spatial_transform_filter.hpp"
+#include "file_server_writer_filter.hpp"
 
 namespace xios{
@@ -34,5 +35,7 @@
       , nstep(0), nstepMax(0)
       , hasOutputFile(false)
-      , domAxisScalarIds_(vector<StdString>(3,"")), areAllReferenceSolved(false), isReferenceSolved(false)
+      , domAxisScalarIds_(vector<StdString>(3,""))
+      , areAllReferenceSolved(false), isReferenceSolved(false), isReferenceSolvedAndTransformed(false)
+      , isGridChecked(false)
       , useCompressedOutput(false)
       , hasTimeInstant(false)
@@ -41,5 +44,5 @@
       , wasDataAlreadyReceivedFromServer(false)
       , mustAutoTrigger(false)
-      , isEOF(false)
+      , isEOF(false), nstepMaxRead(false)
    { setVirtualVariableGroup(CVariableGroup::create(getId() + "_virtual_variable_group")); }
 
@@ -50,5 +53,7 @@
       , nstep(0), nstepMax(0)
       , hasOutputFile(false)
-      , domAxisScalarIds_(vector<StdString>(3,"")), areAllReferenceSolved(false), isReferenceSolved(false)
+      , domAxisScalarIds_(vector<StdString>(3,""))
+      , areAllReferenceSolved(false), isReferenceSolved(false), isReferenceSolvedAndTransformed(false)
+      , isGridChecked(false)
       , useCompressedOutput(false)
       , hasTimeInstant(false)
@@ -57,5 +62,5 @@
       , wasDataAlreadyReceivedFromServer(false)
       , mustAutoTrigger(false)
-      , isEOF(false)
+      , isEOF(false), nstepMaxRead(false)
    { setVirtualVariableGroup(CVariableGroup::create(getId() + "_virtual_variable_group")); }
 
@@ -132,5 +137,6 @@
 
     CContext* context = CContext::getCurrent();
-    CContextClient* client = context->client;
+    CContextClient* client = (!context->hasServer) ? context->client : this->file->getContextClient();
+    int receiverSize = client->serverSize;
 
     CEventClient event(getType(), EVENT_ID_UPDATE_DATA);
@@ -140,9 +146,9 @@
     list<CArray<double,1> > list_data;
 
-    if (!grid->doGridHaveDataDistributed())
+    if (!grid->doGridHaveDataDistributed(client))
     {
        if (client->isServerLeader())
        {
-          for (it = grid->storeIndex_toSrv.begin(); it != grid->storeIndex_toSrv.end(); it++)
+          for (it = grid->storeIndex_toSrv[client].begin(); it != grid->storeIndex_toSrv[client].end(); it++)
           {
             int rank = it->first;
@@ -159,10 +165,10 @@
           }
           client->sendEvent(event);
-       } 
-       else client->sendEvent(event);
+        }
+      else client->sendEvent(event);
     }
     else
     {
-      for (it = grid->storeIndex_toSrv.begin(); it != grid->storeIndex_toSrv.end(); it++)
+      for (it = grid->storeIndex_toSrv[client].begin(); it != grid->storeIndex_toSrv[client].end(); it++)
       {
         int rank = it->first;
@@ -176,5 +182,5 @@
 
         list_msg.back() << getId() << data_tmp;
-        event.push(rank, grid->nbSenders[rank], list_msg.back());
+        event.push(rank, grid->nbSenders[receiverSize][rank], list_msg.back());
       }
       client->sendEvent(event);
@@ -186,6 +192,5 @@
   void CField::recvUpdateData(CEventServer& event)
   {
-    vector<int> ranks;
-    vector<CBufferIn*> buffers;
+    std::map<int,CBufferIn*> rankBuffers;
 
     list<CEventServer::SSubEvent>::iterator it;
@@ -197,36 +202,67 @@
       CBufferIn* buffer = it->buffer;
       *buffer >> fieldId;
-      ranks.push_back(rank);
-      buffers.push_back(buffer);
-    }
-    get(fieldId)->recvUpdateData(ranks,buffers);
+      rankBuffers[rank] = buffer;
+    }
+    get(fieldId)->recvUpdateData(rankBuffers);
     CTimer::get("Field : recv data").suspend();
   }
 
-  void  CField::recvUpdateData(vector<int>& ranks, vector<CBufferIn*>& buffers)
+  void  CField::recvUpdateData(std::map<int,CBufferIn*>& rankBuffers)
   {
-    if (data_srv.empty())
-    {
-      for (map<int, CArray<size_t, 1> >::iterator it = grid->outIndexFromClient.begin(); it != grid->outIndexFromClient.end(); ++it)
+    CContext* context = CContext::getCurrent();
+
+    size_t sizeData = 0;
+    if (0 == recvDataSrv.numElements())
+    {            
+      CArray<int,1>& storeClient = grid->storeIndex_client;
+
+      // Gather all data from different clients      
+      recvDataSrv.resize(storeClient.numElements());
+      recvFoperationSrv = boost::shared_ptr<func::CFunctor>(new func::CInstant(recvDataSrv));
+    }
+
+    CArray<double,1> recv_data_tmp(recvDataSrv.numElements());    
+    const CDate& currDate = context->getCalendar()->getCurrentDate();
+    CDuration offsetAllButMonth (freq_offset.getValue().year, 0 , freq_offset.getValue().day,
+                                   freq_offset.getValue().hour, freq_offset.getValue().minute,
+                                   freq_offset.getValue().second, freq_offset.getValue().timestep);
+    const CDate opeDate   = (last_operation_srv - offsetAllButMonth + context->getCalendar()->getTimeStep())
+                              + freq_op + freq_operation_srv - freq_op - context->getCalendar()->getTimeStep() + offsetAllButMonth;
+
+    if (opeDate <= currDate)
+    {
+      for (map<int, CArray<size_t, 1> >::iterator it = grid->outLocalIndexStoreOnClient.begin(); it != grid->outLocalIndexStoreOnClient.end(); ++it)
       {
-        int rank = it->first;
-        data_srv.insert(std::make_pair(rank, CArray<double,1>(it->second.numElements())));
-        foperation_srv.insert(pair<int,boost::shared_ptr<func::CFunctor> >(rank,boost::shared_ptr<func::CFunctor>(new func::CInstant(data_srv[rank]))));
+        CArray<double,1> tmp;
+        CArray<size_t,1>& indexTmp = it->second;
+        *(rankBuffers[it->first]) >> tmp;
+        for (int idx = 0; idx < indexTmp.numElements(); ++idx)
+        {
+          recv_data_tmp(indexTmp(idx)) = tmp(idx);
+        }      
       }
     }
 
+    this->setData(recv_data_tmp);
+    // delete incomming flux for server only
+    recvFoperationSrv.reset() ;
+    recvDataSrv.reset() ;
+  }
+
+  void CField::writeUpdateData(const CArray<double,1>& data)
+  {
     CContext* context = CContext::getCurrent();
+
     const CDate& currDate = context->getCalendar()->getCurrentDate();
-    const CDate opeDate      = (last_operation_srv + context->getCalendar()->getTimeStep()) +freq_op + freq_operation_srv - freq_op - context->getCalendar()->getTimeStep();
-    const CDate writeDate    = last_Write_srv     + freq_write_srv;
+    CDuration offsetAllButMonth (freq_offset.getValue().year, 0 , freq_offset.getValue().day,
+                                   freq_offset.getValue().hour, freq_offset.getValue().minute,
+                                   freq_offset.getValue().second, freq_offset.getValue().timestep);
+    const CDate opeDate   = (last_operation_srv - offsetAllButMonth + context->getCalendar()->getTimeStep())
+                              + freq_op + freq_operation_srv - freq_op - context->getCalendar()->getTimeStep() + offsetAllButMonth;
+    const CDate writeDate = last_Write_srv + freq_write_srv;
 
     if (opeDate <= currDate)
     {
-      for (int n = 0; n < ranks.size(); n++)
-      {
-        CArray<double,1> data_tmp;
-        *buffers[n] >> data_tmp;
-        (*foperation_srv[ranks[n]])(data_tmp);
-      }
+      (*recvFoperationSrv)(data);
       last_operation_srv = currDate;
     }
@@ -234,10 +270,7 @@
     if (writeDate < (currDate + freq_operation_srv))
     {
-      for (int n = 0; n < ranks.size(); n++)
-      {
-        this->foperation_srv[ranks[n]]->final();
-      }
-
+      recvFoperationSrv->final();
       last_Write_srv = writeDate;
+      grid->computeWrittenIndex();
       writeField();
       lastlast_Write_srv = last_Write_srv;
@@ -247,9 +280,9 @@
   void CField::writeField(void)
   {
-    if (!getRelFile()->allDomainEmpty)
+    if (!getRelFile()->isEmptyZone())
     {
       if (grid->doGridHaveDataToWrite() || getRelFile()->type == CFile::type_attr::one_file)
       {
-        getRelFile()->checkFile();
+        getRelFile()->checkWriteFile();
         this->incrementNStep();
         getRelFile()->getDataOutput()->writeFieldData(CField::get(this));
@@ -258,8 +291,18 @@
   }
 
+  /*
+    Send a request for reading data.
+    Client sends a request to server for demanding server to read data and send back to it.
+    For now, this function is called only by client
+    In the future, it can be called by level-1 servers
+    \param [in] tsDataRequested timestamp when the call is made
+  */
   bool CField::sendReadDataRequest(const CDate& tsDataRequested)
   {
     CContext* context = CContext::getCurrent();
-    CContextClient* client = context->client;
+    // CContextClient* client = context->client;
+
+    // This code is for future: If we want to read file with level-2 servers
+    CContextClient* client = (!context->hasServer) ? context->client : this->file->getContextClient();
 
     lastDataRequestedFromServer = tsDataRequested;
@@ -319,4 +362,10 @@
   }
 
+  /*!
+    Receive data request sent from client and process it
+    Every time server receives this request, it will try to read data and sent read data back to client
+    At the moment, this function is called by server level 1
+    In the future, this should (only) be done by the last level servers.
+  */
   void CField::recvReadDataRequest(void)
   {
@@ -327,14 +376,13 @@
     std::list<CMessage> msgs;
 
-    bool hasData = readField();
+    EReadField hasData = readField();
 
     map<int, CArray<double,1> >::iterator it;
-    if (!grid->doGridHaveDataDistributed())
+    if (!grid->doGridHaveDataDistributed(client))
     {
        if (client->isServerLeader())
        {
-          if (!data_srv.empty())
-          {
-            it = data_srv.begin();
+          if (0 != recvDataSrv.numElements())
+          {            
             const std::list<int>& ranks = client->getRanksServerLeader();
             for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
@@ -343,31 +391,25 @@
               CMessage& msg = msgs.back();
               msg << getId();
-              if (hasData)
-                msg << getNStep() - 1 << it->second;
-              else
-                msg << int(-1);
+              switch (hasData)
+              {
+                case RF_DATA:
+                  msg << getNStep() - 1 << recvDataSrv;
+                  break;
+                case RF_NODATA:
+                  msg << int(-2) << recvDataSrv;
+                  break;
+                case RF_EOF:                  
+                default:
+                  msg << int(-1);
+                  break;
+              }
+
               event.push(*itRank, 1, msg);
             }
           }
           client->sendEvent(event);
-       } 
-       else 
-       {
-          // if (!data_srv.empty())
-          // {
-          //   it = data_srv.begin();
-          //   const std::list<int>& ranks = client->getRanksServerNotLeader();
-          //   for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
-          //   {
-          //     msgs.push_back(CMessage());
-          //     CMessage& msg = msgs.back();
-          //     msg << getId();
-          //     if (hasData)
-          //       msg << getNStep() - 1 << it->second;
-          //     else
-          //       msg << int(-1);
-          //     event.push(*itRank, 1, msg);
-          //   }
-          // }
+       }
+       else
+       {
           client->sendEvent(event);
        }
@@ -375,14 +417,32 @@
     else
     {
-      for (it = data_srv.begin(); it != data_srv.end(); it++)
+      for (map<int, CArray<size_t, 1> >::iterator it = grid->outLocalIndexStoreOnClient.begin(); 
+                                                  it != grid->outLocalIndexStoreOnClient.end(); ++it)
       {
+        CArray<size_t,1>& indexTmp = it->second;
+        CArray<double,1> tmp(indexTmp.numElements());
+        for (int idx = 0; idx < indexTmp.numElements(); ++idx)
+        {
+          tmp(idx) = recvDataSrv(indexTmp(idx));
+        } 
+
         msgs.push_back(CMessage());
         CMessage& msg = msgs.back();
         msg << getId();
-        if (hasData)
-          msg << getNStep() - 1 << it->second;
-        else
-          msg << int(-1);
-        event.push(it->first, grid->nbSenders[it->first], msg);
+        switch (hasData)
+        {
+          case RF_DATA:
+            msg << getNStep() - 1 << tmp;
+            break;
+          case RF_NODATA:
+            msg << int(-2) << tmp;
+            break;
+          case RF_EOF:                  
+          default:
+            msg << int(-1);
+            break;
+        }
+
+        event.push(it->first, grid->nbReadSenders[client][it->first], msg);
       }
       client->sendEvent(event);
@@ -390,17 +450,28 @@
   }
 
-  bool CField::readField(void)
+  /*!
+    Read field from a file.
+    A field is read with the distribution of data on the server side
+    \return State of field can be read from a file
+  */
+  CField::EReadField CField::readField(void)
   {
-    if (!getRelFile()->allDomainEmpty)
-    {
-      if (grid->doGridHaveDataToWrite() || getRelFile()->type == CFile::type_attr::one_file)
+    CContext* context = CContext::getCurrent();
+    grid->computeWrittenIndex();
+    getRelFile()->initRead();
+    EReadField readState = RF_DATA;
+
+    if (!getRelFile()->isEmptyZone())
+    {      
+      if (grid->doGridHaveDataToWrite() || getRelFile()->type == CFile::type_attr::one_file)      
       {
-        if (data_srv.empty())
-        {
-          for (map<int, CArray<size_t, 1> >::iterator it = grid->outIndexFromClient.begin(); it != grid->outIndexFromClient.end(); ++it)
-            data_srv.insert(std::make_pair(it->first, CArray<double,1>(it->second.numElements())));
+        if (0 == recvDataSrv.numElements())
+        {            
+          CArray<int,1>& storeClient = grid->storeIndex_client;          
+          recvDataSrv.resize(storeClient.numElements());          
         }
-
-        getRelFile()->checkFile();
+        
+        getRelFile()->checkReadFile();
+
         if (!nstepMax)
         {
@@ -411,13 +482,37 @@
 
         if (getNStep() > nstepMax && (getRelFile()->cyclic.isEmpty() || !getRelFile()->cyclic) )
-          return false;
-
-        getRelFile()->getDataInput()->readFieldData(CField::get(this));
+          readState = RF_EOF;
+
+        if (RF_EOF != readState)
+          getRelFile()->getDataInput()->readFieldData(CField::get(this));
       }
     }
-
-    return true;
+    else
+    {
+      this->incrementNStep();
+      if (getNStep() > nstepMax && (getRelFile()->cyclic.isEmpty() || !getRelFile()->cyclic) )
+        readState = RF_EOF;
+      else
+        readState = RF_NODATA;
+
+      if (!nstepMaxRead) // This can be a bug if we try to read field from zero time record
+        readState = RF_NODATA;
+    }
+
+    if (!nstepMaxRead)
+    {
+       MPI_Allreduce(MPI_IN_PLACE, &nstepMax, 1, MPI_INT, MPI_MAX, context->server->intraComm);
+       nstepMaxRead = true;
+    }
+
+    return readState;
   }
 
+  /*
+    Receive read data from server.
+    At the moment, this function is called in the client side.
+    In the future, this function can be called hiearachically (server n-1, server n -2, ..., client)
+    \param event event containing read data
+  */
   void CField::recvReadDataReady(CEventServer& event)
   {
@@ -437,4 +532,9 @@
   }
 
+  /*!
+    Receive read data from server
+    \param [in] ranks Ranks of sending processes
+    \param [in] buffers buffers containing read data
+  */
   void CField::recvReadDataReady(vector<int> ranks, vector<CBufferIn*> buffers)
   {
@@ -572,4 +672,5 @@
    {
       this->nstepMax = 0;
+      nstepMaxRead = false;
    }
 
@@ -622,29 +723,4 @@
    //----------------------------------------------------------------
 
-   void CField::solveOnlyReferenceEnabledField(bool doSending2Server)
-   {
-     CContext* context = CContext::getCurrent();
-     if (!isReferenceSolved)
-     {
-        isReferenceSolved = true;
-
-        if (context->hasClient)
-        {
-          solveRefInheritance(true);
-          if (hasDirectFieldReference()) getDirectFieldReference()->solveOnlyReferenceEnabledField(false);
-        }
-        else if (context->hasServer)
-          solveServerOperation();
-
-        solveGridReference();
-
-       if (context->hasClient)
-       {
-         solveGenerateGrid();
-         buildGridTransformationGraph();
-       }
-     }
-   }
-
    /*!
      Build up graph of grids which plays role of destination and source in grid transformation
@@ -654,5 +730,5 @@
    {
      CContext* context = CContext::getCurrent();
-     if (context->hasClient)
+     if (context->hasClient && !context->hasServer)
      {
        if (grid && !grid->isTransformed() && hasDirectFieldReference() && grid != getDirectFieldReference()->grid)
@@ -669,5 +745,5 @@
    {
      CContext* context = CContext::getCurrent();
-     if (context->hasClient)
+     if (context->hasClient && !context->hasServer)
      {
        std::map<CGrid*,std::pair<bool,StdString> >& gridSrcMap = grid->getTransGridSource();
@@ -744,5 +820,95 @@
      }
    }
-
+   
+   /*!
+     Solve reference of all enabled fields even the source fields .
+     In this step, we do transformations.
+   */
+   void CField::solveAllEnabledFieldsAndTransform()
+   {
+     CContext* context = CContext::getCurrent();
+     bool hasClient = context->hasClient;
+     bool hasServer = context->hasServer;
+
+     if (!isReferenceSolvedAndTransformed)
+     {
+        isReferenceSolvedAndTransformed = true;
+
+        if (hasClient && !hasServer)
+        {
+          solveRefInheritance(true);
+          if (hasDirectFieldReference()) getDirectFieldReference()->solveAllEnabledFieldsAndTransform();
+        }
+
+        if (hasServer)
+          solveServerOperation();
+
+        solveGridReference();
+
+        if (hasClient && !hasServer)
+       {
+         solveGenerateGrid();
+         buildGridTransformationGraph();
+       }
+
+       solveGridDomainAxisRef(false);
+
+       if (hasClient && !hasServer)
+       {
+         solveTransformedGrid();
+       }
+
+       solveGridDomainAxisRef(false);
+     }
+   }
+
+   void CField::checkGridOfEnabledFields()
+   {
+     if (!isGridChecked)
+     {
+       isGridChecked = true;
+       solveCheckMaskIndex(false);
+     }
+   }
+
+   void CField::sendGridComponentOfEnabledFields()
+   {
+      solveGridDomainAxisRef(true);
+      // solveCheckMaskIndex(true);
+   }
+
+   void CField::sendGridOfEnabledFields()
+   {
+      // solveGridDomainAxisRef(true);
+      solveCheckMaskIndex(true);
+   }   
+
+   void CField::solveOnlyReferenceEnabledField(bool doSending2Server)
+   {
+     CContext* context = CContext::getCurrent();
+     if (!isReferenceSolved)
+     {
+        isReferenceSolved = true;
+
+        if (context->hasClient && !context->hasServer)
+        {
+          solveRefInheritance(true);
+          if (hasDirectFieldReference()) getDirectFieldReference()->solveOnlyReferenceEnabledField(false);
+        }
+
+        if (context->hasServer)
+          solveServerOperation();
+
+        solveGridReference();
+        grid->solveDomainAxisRefInheritance(true); // make it again to solve grid reading from file
+
+        if (context->hasClient && !context->hasServer)
+       {
+         solveGenerateGrid();
+         buildGridTransformationGraph();
+       }
+     }
+   }
+     
    void CField::solveAllReferenceEnabledField(bool doSending2Server)
    {
@@ -753,6 +919,6 @@
      {
         areAllReferenceSolved = true;
-
-        if (context->hasClient)
+       
+        if (context->hasClient && !context->hasServer)
         {
           solveRefInheritance(true);
@@ -767,5 +933,5 @@
      solveGridDomainAxisRef(doSending2Server);
 
-     if (context->hasClient)
+     if (context->hasClient && !context->hasServer)
      {
        solveTransformedGrid();
@@ -775,12 +941,17 @@
    }
 
-   std::map<int, StdSize> CField::getGridAttributesBufferSize()
-   {
-     return grid->getAttributesBufferSize();
-   }
-
-   std::map<int, StdSize> CField::getGridDataBufferSize()
-   {
-     return grid->getDataBufferSize(getId());
+   std::map<int, StdSize> CField::getGridAttributesBufferSize(CContextClient* client, bool bufferForWriting /*= "false"*/)
+   {
+     return grid->getAttributesBufferSize(client, bufferForWriting);
+   }
+
+   std::map<int, StdSize> CField::getGridDataBufferSize(CContextClient* client, bool bufferForWriting /*= "false"*/)
+   {
+     return grid->getDataBufferSize(client, getId(), bufferForWriting);
+   }
+
+   size_t CField::getGlobalWrittenSize()
+   {
+     return grid->getGlobalWrittenSize();
    }
 
@@ -842,67 +1013,106 @@
     */
    void CField::buildFilterGraph(CGarbageCollector& gc, bool enableOutput)
-   {
-     if (!areAllReferenceSolved) solveAllReferenceEnabledField(false);
+   {     
+    if (!isReferenceSolvedAndTransformed) solveAllEnabledFieldsAndTransform();
+    if (!isGridChecked) checkGridOfEnabledFields();
 
      const bool detectMissingValues = (!detect_missing_value.isEmpty() && !default_value.isEmpty() && detect_missing_value == true);
      const double defaultValue  = detectMissingValues ? default_value : (!default_value.isEmpty() ? default_value : 0.0);
 
-     // Start by building a filter which can provide the field's instant data
-     if (!instantDataFilter)
-     {
-       // Check if we have an expression to parse
-       if (hasExpression())
-       {
-         boost::scoped_ptr<IFilterExprNode> expr(parseExpr(getExpression() + '\0'));
-         boost::shared_ptr<COutputPin> filter = expr->reduce(gc, *this);
-
-         // Check if a spatial transformation is needed
-         if (!field_ref.isEmpty())
+     CContext* context = CContext::getCurrent();
+     bool hasWriterServer = context->hasServer && !context->hasClient;
+     bool hasIntermediateServer = context->hasServer && context->hasClient;
+
+     if (hasWriterServer)
+     {
+        if (!instantDataFilter)
+          instantDataFilter = clientSourceFilter = boost::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid,true));
+
+
+       // If the field data is to be read by the client or/and written to a file
+       if (enableOutput && !storeFilter && !fileWriterFilter)
+       {
+         if (file && (file->mode.isEmpty() || file->mode == CFile::mode_attr::write))
          {
-           CGrid* gridRef = CField::get(field_ref)->grid;
-
-           if (grid && grid != gridRef && grid->hasTransform())
+           fileServerWriterFilter = boost::shared_ptr<CFileServerWriterFilter>(new CFileServerWriterFilter(gc, this));
+           instantDataFilter->connectOutput(fileServerWriterFilter, 0);
+         }
+       }
+     }
+     else if (hasIntermediateServer)
+     {
+       if (!instantDataFilter)
+         instantDataFilter = clientSourceFilter = boost::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid, true));
+
+             // If the field data is to be read by the client or/and written to a file
+       if (enableOutput && !storeFilter && !fileWriterFilter)
+       {
+         if (file && (file->mode.isEmpty() || file->mode == CFile::mode_attr::write))
+         {
+           fileWriterFilter = boost::shared_ptr<CFileWriterFilter>(new CFileWriterFilter(gc, this));
+           instantDataFilter->connectOutput(fileWriterFilter, 0);
+         }
+       }
+     }
+     else
+     {
+       // Start by building a filter which can provide the field's instant data
+       if (!instantDataFilter)
+       {
+         // Check if we have an expression to parse
+         if (hasExpression())
+         {
+           boost::scoped_ptr<IFilterExprNode> expr(parseExpr(getExpression() + '\0'));
+           boost::shared_ptr<COutputPin> filter = expr->reduce(gc, *this);
+
+           // Check if a spatial transformation is needed
+           if (!field_ref.isEmpty())
            {
-             std::pair<boost::shared_ptr<CFilter>, boost::shared_ptr<CFilter> > filters = CSpatialTransformFilter::buildFilterGraph(gc, gridRef, grid, detectMissingValues, defaultValue);
-
-             filter->connectOutput(filters.first, 0);
-             filter = filters.second;
+             CGrid* gridRef = CField::get(field_ref)->grid;
+
+             if (grid && grid != gridRef && grid->hasTransform())
+             {
+                 std::pair<boost::shared_ptr<CFilter>, boost::shared_ptr<CFilter> > filters = CSpatialTransformFilter::buildFilterGraph(gc, gridRef, grid, detectMissingValues, defaultValue); 
+
+               filter->connectOutput(filters.first, 0);
+               filter = filters.second;
+             }
            }
+
+           instantDataFilter = filter;
          }
-
-         instantDataFilter = filter;
-       }
-       // Check if we have a reference on another field
-       else if (!field_ref.isEmpty())
-         instantDataFilter = getFieldReference(gc);
-       // Check if the data is to be read from a file
-       else if (file && !file->mode.isEmpty() && file->mode == CFile::mode_attr::read)
-       {
-         checkAttributes();
-         instantDataFilter = serverSourceFilter = boost::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid, freq_offset, true,
-                                                                                                     detectMissingValues, defaultValue));
-       }
-       else // The data might be passed from the model
-       {
-          if (check_if_active.isEmpty()) check_if_active = false;
-          instantDataFilter = clientSourceFilter = boost::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid, NoneDu, false,
-                                                                                                      detectMissingValues, defaultValue));
-       }
-     }
-
-     // If the field data is to be read by the client or/and written to a file
-     if (enableOutput && !storeFilter && !fileWriterFilter)
-     {
-       if (!read_access.isEmpty() && read_access)
-       {
-         storeFilter = boost::shared_ptr<CStoreFilter>(new CStoreFilter(gc, CContext::getCurrent(), grid,
-                                                                        detectMissingValues, defaultValue));
-         instantDataFilter->connectOutput(storeFilter, 0);
-       }
-
-       if (file && (file->mode.isEmpty() || file->mode == CFile::mode_attr::write))
-       {
-         fileWriterFilter = boost::shared_ptr<CFileWriterFilter>(new CFileWriterFilter(gc, this));
-         getTemporalDataFilter(gc, file->output_freq)->connectOutput(fileWriterFilter, 0);
+         // Check if we have a reference on another field
+         else if (!field_ref.isEmpty())
+           instantDataFilter = getFieldReference(gc);
+         // Check if the data is to be read from a file
+         else if (file && !file->mode.isEmpty() && file->mode == CFile::mode_attr::read)
+         {
+           checkTimeAttributes();
+           instantDataFilter = serverSourceFilter = boost::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid, true, freq_offset, true,
+                                                                                                       detectMissingValues, defaultValue));
+         }
+         else // The data might be passed from the model
+         {
+            if (check_if_active.isEmpty()) check_if_active = false; 
+            instantDataFilter = clientSourceFilter = boost::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid, false, NoneDu, false,
+                                                                                                        detectMissingValues, defaultValue));
+         }
+       }
+
+       // If the field data is to be read by the client or/and written to a file
+       if (enableOutput && !storeFilter && !fileWriterFilter)
+       {
+         if (!read_access.isEmpty() && read_access)
+         {
+           storeFilter = boost::shared_ptr<CStoreFilter>(new CStoreFilter(gc, CContext::getCurrent(), grid,
+                                                                          detectMissingValues, defaultValue));
+           instantDataFilter->connectOutput(storeFilter, 0);
+         }
+
+         if (file && (file->mode.isEmpty() || file->mode == CFile::mode_attr::write))
+         {
+           fileWriterFilter = boost::shared_ptr<CFileWriterFilter>(new CFileWriterFilter(gc, this));
+           getTemporalDataFilter(gc, file->output_freq)->connectOutput(fileWriterFilter, 0);
+         }
        }
      }
@@ -965,6 +1175,6 @@
          if (!serverSourceFilter)
          {
-           checkAttributes();
-           serverSourceFilter = boost::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid, freq_offset, true,
+           checkTimeAttributes();
+           serverSourceFilter = boost::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid, true, freq_offset, true,
                                                                                    detectMissingValues, defaultValue));
          }
@@ -975,5 +1185,5 @@
        {
          CField* fieldRef = CField::get(field_ref);
-         fieldRef->buildFilterGraph(gc, false); 
+         fieldRef->buildFilterGraph(gc, false);
          selfReferenceFilter = fieldRef->getInstantDataFilter();
        }
@@ -983,5 +1193,5 @@
          {
            if (check_if_active.isEmpty()) check_if_active = false;
-           clientSourceFilter = boost::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid, NoneDu, false,
+           clientSourceFilter = boost::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid, true, NoneDu, false,
                                                                                    detectMissingValues, defaultValue));
          }
@@ -1013,11 +1223,11 @@
                << "An operation must be defined for field \"" << getId() << "\".");
 
-       checkAttributes();
-
-       const bool detectMissingValues = (!detect_missing_value.isEmpty() && !default_value.isEmpty() && detect_missing_value == true);
+       checkTimeAttributes(&outFreq);
+
+       const bool detectMissingValues = (!detect_missing_value.isEmpty()  && detect_missing_value == true);
        boost::shared_ptr<CTemporalFilter> temporalFilter(new CTemporalFilter(gc, operation,
                                                                              CContext::getCurrent()->getCalendar()->getInitDate(),
-                                                                             freq_op, freq_offset, outFreq,
-                                                                             detectMissingValues, detectMissingValues ? default_value : 0.0));
+                                                                             freq_op, freq_offset, outFreq, detectMissingValues));
+
        instantDataFilter->connectOutput(temporalFilter, 0);
 
@@ -1051,11 +1261,11 @@
                << "An operation must be defined for field \"" << getId() << "\".");
 
-       checkAttributes();
-
-       const bool detectMissingValues = (!detect_missing_value.isEmpty() && !default_value.isEmpty() && detect_missing_value == true);
+       checkTimeAttributes(&outFreq);
+
+       const bool detectMissingValues = (!detect_missing_value.isEmpty() && detect_missing_value == true);
        boost::shared_ptr<CTemporalFilter> temporalFilter(new CTemporalFilter(gc, operation,
                                                                              CContext::getCurrent()->getCalendar()->getInitDate(),
-                                                                             freq_op, freq_offset, outFreq,
-                                                                             detectMissingValues, detectMissingValues ? default_value : 0.0));
+                                                                             freq_op, freq_offset, outFreq, detectMissingValues));
+
        selfReferenceFilter->connectOutput(temporalFilter, 0);
        return temporalFilter ;
@@ -1105,4 +1315,9 @@
         std::vector<CScalar*> vecScalar;
         std::vector<int> axisDomainOrderTmp;
+
+        std::vector<CDomain*> vecDomRef;
+        std::vector<CAxis*> vecAxisRef;
+        std::vector<CScalar*> vecScalarRef;
+
         
         if (!domain_ref.isEmpty())
@@ -1112,9 +1327,10 @@
           {
             vecDom.push_back(CDomain::get(domain_ref));
+            vecDomRef.push_back(CDomain::createDomain());
+            vecDomRef.back()->domain_ref=domain_ref;
             axisDomainOrderTmp.push_back(2);
           }
-          else
-            ERROR("CField::solveGridReference(void)",
-                  << "Invalid reference to domain '" << domain_ref.getValue() << "'.");
+          else  ERROR("CField::solveGridReference(void)",
+                      << "Invalid reference to domain '" << domain_ref.getValue() << "'.");
         }
 
@@ -1124,9 +1340,10 @@
           {
             vecAxis.push_back(CAxis::get(axis_ref));
+            vecAxisRef.push_back(CAxis::createAxis());
+            vecAxisRef.back()->axis_ref=axis_ref;
             axisDomainOrderTmp.push_back(1);
           }
-          else
-            ERROR("CField::solveGridReference(void)",
-                  << "Invalid reference to axis '" << axis_ref.getValue() << "'.");
+          else  ERROR("CField::solveGridReference(void)",
+                      << "Invalid reference to axis '" << axis_ref.getValue() << "'.");
         }
 
@@ -1136,9 +1353,10 @@
           {
             vecScalar.push_back(CScalar::get(scalar_ref));
+            vecScalarRef.push_back(CScalar::createScalar());
+            vecScalarRef.back()->scalar_ref=scalar_ref;
             axisDomainOrderTmp.push_back(0);
           }
-          else
-            ERROR("CField::solveGridReference(void)",
-                  << "Invalid reference to scalar '" << scalar_ref.getValue() << "'.");
+          else ERROR("CField::solveGridReference(void)",
+                     << "Invalid reference to scalar '" << scalar_ref.getValue() << "'.");
         }
         
@@ -1151,16 +1369,12 @@
         // Warning: the gridId shouldn't be set as the grid_ref since it could be inherited
         StdString gridId = CGrid::generateId(vecDom, vecAxis, vecScalar,axisDomainOrder);
-        if (CGrid::has(gridId))
-          this->grid = CGrid::get(gridId);
-        else
-          this->grid = CGrid::createGrid(gridId, vecDom, vecAxis, vecScalar,axisDomainOrder);
+        if (CGrid::has(gridId)) this->grid = CGrid::get(gridId);
+        else  this->grid = CGrid::createGrid(gridId, vecDomRef, vecAxisRef, vecScalarRef,axisDomainOrder);
       }
       else
       {
-        if (CGrid::has(grid_ref))
-          this->grid = CGrid::get(grid_ref);
-        else
-          ERROR("CField::solveGridReference(void)",
-                << "Invalid reference to grid '" << grid_ref.getValue() << "'.");
+        if (CGrid::has(grid_ref)) this->grid = CGrid::get(grid_ref);
+        else  ERROR("CField::solveGridReference(void)",
+                     << "Invalid reference to grid '" << grid_ref.getValue() << "'.");
       }
    }
@@ -1222,5 +1436,5 @@
      {
        // Temporarily deactivate the self-transformation of grid
-       grid->transformGrid(grid);
+       // grid->transformGrid(grid);
      }
    }
@@ -1269,95 +1483,59 @@
    void CField::scaleFactorAddOffset(double scaleFactor, double addOffset)
    {
-     map<int, CArray<double,1> >::iterator it;
-     for (it = data_srv.begin(); it != data_srv.end(); it++) it->second = (it->second - addOffset) / scaleFactor;
+     recvDataSrv = (recvDataSrv - addOffset) / scaleFactor;
    }
 
    void CField::invertScaleFactorAddOffset(double scaleFactor, double addOffset)
    {
-     map<int, CArray<double,1> >::iterator it;
-     for (it = data_srv.begin(); it != data_srv.end(); it++) it->second = it->second * scaleFactor + addOffset;
-   }
-
-   void CField::outputField(CArray<double,3>& fieldOut)
-   {
-      map<int, CArray<double,1> >::iterator it;
-      for (it = data_srv.begin(); it != data_srv.end(); it++)
+     recvDataSrv = recvDataSrv * scaleFactor + addOffset;
+   }
+
+   void CField::outputField(CArray<double,1>& fieldOut)
+   { 
+      CArray<size_t,1>& outIndexClient = grid->localIndexToWriteOnClient;
+      CArray<size_t,1>& outIndexServer = grid->localIndexToWriteOnServer;
+      for (size_t idx = 0; idx < outIndexServer.numElements(); ++idx)
       {
-        grid->outputField(it->first, it->second, fieldOut.dataFirst());
+        fieldOut(outIndexServer(idx)) = recvDataSrv(outIndexClient(idx));
       }
    }
 
-   void CField::outputField(CArray<double,2>& fieldOut)
-   {
-      map<int, CArray<double,1> >::iterator it;
-      for(it=data_srv.begin();it!=data_srv.end();it++)
+   void CField::inputField(CArray<double,1>& fieldIn)
+   {
+      CArray<size_t,1>& outIndexClient = grid->localIndexToWriteOnClient;
+      CArray<size_t,1>& outIndexServer = grid->localIndexToWriteOnServer;
+      for (size_t idx = 0; idx < outIndexServer.numElements(); ++idx)
       {
-         grid->outputField(it->first, it->second, fieldOut.dataFirst());
+        recvDataSrv(outIndexClient(idx)) = fieldIn(outIndexServer(idx));
       }
-   }
-
-   void CField::outputField(CArray<double,1>& fieldOut)
-   {
-      map<int, CArray<double,1> >::iterator it;
-
-      for (it = data_srv.begin(); it != data_srv.end(); it++)
+
+   }
+
+   void CField::outputCompressedField(CArray<double,1>& fieldOut)
+   {
+      CArray<size_t,1>& outIndexClient = grid->localIndexToWriteOnClient;
+      CArray<size_t,1>& outIndexServer = grid->localIndexToWriteOnServer;
+      for (size_t idx = 0; idx < outIndexServer.numElements(); ++idx)
       {
-         grid->outputField(it->first, it->second, fieldOut.dataFirst());
+        fieldOut((idx)) = recvDataSrv(outIndexClient(idx));
       }
    }
 
-   void CField::inputField(CArray<double,3>& fieldOut)
-   {
-      map<int, CArray<double,1> >::iterator it;
-      for (it = data_srv.begin(); it != data_srv.end(); it++)
+   ///-------------------------------------------------------------------
+
+   void CField::parse(xml::CXMLNode& node)
+   {
+      string newContent ;
+      SuperClass::parse(node);
+      if (node.goToChildElement())
       {
-        grid->inputField(it->first, fieldOut.dataFirst(), it->second);
+        do
+        {
+          if (node.getElementName() == "variable" || node.getElementName() == "variable_group") this->getVirtualVariableGroup()->parseChild(node);
+          else if (node.getElementName() == "expr") if (node.getContent(newContent)) content+=newContent ;
+        } while (node.goToNextElement());
+        node.goToParentElement();
       }
-   }
-
-   void CField::inputField(CArray<double,2>& fieldOut)
-   {
-      map<int, CArray<double,1> >::iterator it;
-      for(it = data_srv.begin(); it != data_srv.end(); it++)
-      {
-         grid->inputField(it->first, fieldOut.dataFirst(), it->second);
-      }
-   }
-
-   void CField::inputField(CArray<double,1>& fieldOut)
-   {
-      map<int, CArray<double,1> >::iterator it;
-      for (it = data_srv.begin(); it != data_srv.end(); it++)
-      {
-         grid->inputField(it->first, fieldOut.dataFirst(), it->second);
-      }
-   }
-
-   void CField::outputCompressedField(CArray<double,1>& fieldOut)
-   {
-      map<int, CArray<double,1> >::iterator it;
-
-      for (it = data_srv.begin(); it != data_srv.end(); it++)
-      {
-         grid->outputCompressedField(it->first, it->second, fieldOut.dataFirst());
-      }
-   }
-
-   ///-------------------------------------------------------------------
-
-   void CField::parse(xml::CXMLNode& node)
-   {
-      SuperClass::parse(node);
-      if (!node.getContent(this->content))
-      {
-        if (node.goToChildElement())
-        {
-          do
-          {
-            if (node.getElementName() == "variable" || node.getElementName() == "variable_group") this->getVirtualVariableGroup()->parseChild(node);
-          } while (node.goToNextElement());
-          node.goToParentElement();
-        }
-      }
+      if (node.getContent(newContent)) content=newContent ;
     }
 
@@ -1407,5 +1585,27 @@
    }
 
-   void CField::sendAddAllVariables()
+   void CField::setContextClient(CContextClient* contextClient)
+   {
+     CContext* context = CContext::getCurrent();
+     client = contextClient;
+     if (context->hasClient)
+     {
+       // A grid is sent by a client (both for read or write) or by primary server (write only)
+       if (context->hasServer)
+       {
+         if (file->mode.isEmpty() || (!file->mode.isEmpty() && file->mode == CFile::mode_attr::write))
+           grid->setContextClient(contextClient);
+       }
+       else
+           grid->setContextClient(contextClient);
+     }
+   }
+
+   CContextClient* CField::getContextClient()
+   {
+     return client;
+   }
+
+   void CField::sendAddAllVariables(CContextClient* client)
    {
      std::vector<CVariable*> allVar = getAllVariables();
@@ -1415,53 +1615,35 @@
      for (; it != itE; ++it)
      {
-       this->sendAddVariable((*it)->getId());
-       (*it)->sendAllAttributesToServer();
-       (*it)->sendValue();
-     }
-   }
-
-   void CField::sendAddVariable(const string& id)
-   {
-    CContext* context = CContext::getCurrent();
-
-    if (!context->hasServer)
-    {
-       CContextClient* client = context->client;
-
-       CEventClient event(this->getType(),EVENT_ID_ADD_VARIABLE);
-       if (client->isServerLeader())
-       {
-         CMessage msg;
-         msg << this->getId();
-         msg << id;
-         const std::list<int>& ranks = client->getRanksServerLeader();
-         for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
-           event.push(*itRank,1,msg);
-         client->sendEvent(event);
-       }
-       else client->sendEvent(event);
-    }
-   }
-
-   void CField::sendAddVariableGroup(const string& id)
-   {
-    CContext* context = CContext::getCurrent();
-    if (!context->hasServer)
-    {
-       CContextClient* client = context->client;
-
-       CEventClient event(this->getType(),EVENT_ID_ADD_VARIABLE_GROUP);
-       if (client->isServerLeader())
-       {
-         CMessage msg;
-         msg << this->getId();
-         msg << id;
-         const std::list<int>& ranks = client->getRanksServerLeader();
-         for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
-           event.push(*itRank,1,msg);
-         client->sendEvent(event);
-       }
-       else client->sendEvent(event);
-    }
+       this->sendAddVariable((*it)->getId(), client);
+       (*it)->sendAllAttributesToServer(client);
+       (*it)->sendValue(client);
+     }
+   }
+
+
+   /*!
+    * Send all Attributes to server. This method is overloaded, since only grid_ref attribute
+    * must be sent to server and not domain_ref/axis_ref/scalar_ref. 
+    */
+    
+   void CField::sendAllAttributesToServer(CContextClient* client)
+   {
+     if (grid_ref.isEmpty())
+     {
+       grid_ref=grid->getId() ;
+       SuperClass::sendAllAttributesToServer(client) ;
+       grid_ref.reset();
+     }
+     else SuperClass::sendAllAttributesToServer(client) ;
+   }
+    
+   void CField::sendAddVariable(const string& id, CContextClient* client)
+   {
+      sendAddItem(id, (int)EVENT_ID_ADD_VARIABLE, client);
+   }
+
+   void CField::sendAddVariableGroup(const string& id, CContextClient* client)
+   {
+      sendAddItem(id, (int)EVENT_ID_ADD_VARIABLE_GROUP, client);
    }
 
@@ -1501,9 +1683,10 @@
     * Check on freq_off and freq_op attributes.
     */
-   void CField::checkAttributes(void)
-   {
-     bool isFieldRead = file && !file->mode.isEmpty() && file->mode == CFile::mode_attr::read;
-     if (isFieldRead && operation.getValue() != "instant")
-       ERROR("void CField::checkAttributes(void)",
+   void CField::checkTimeAttributes(CDuration* freqOp)
+   {
+     bool isFieldRead  = file && !file->mode.isEmpty() && file->mode == CFile::mode_attr::read;
+     bool isFieldWrite = file && ( file->mode.isEmpty() ||  file->mode == CFile::mode_attr::write);
+     if (isFieldRead && !(operation.getValue() == "instant" || operation.getValue() == "once") )     
+       ERROR("void CField::checkTimeAttributes(void)",
              << "Unsupported operation for field '" << getFieldOutputName() << "'." << std::endl
              << "Currently only \"instant\" is supported for fields read from file.")
@@ -1512,5 +1695,8 @@
      {
        if (operation.getValue() == "instant")
-         freq_op.setValue(file->output_freq.getValue());
+       {
+         if (isFieldRead || isFieldWrite) freq_op.setValue(file->output_freq.getValue());
+         else freq_op=*freqOp ;
+       }
        else
          freq_op.setValue(TimeStep);
@@ -1540,4 +1726,5 @@
    }
 
+
    DEFINE_REF_FUNC(Field,field)
 } // namespace xios
Index: /XIOS/trunk/src/node/field.hpp
===================================================================
--- /XIOS/trunk/src/node/field.hpp	(revision 1536)
+++ /XIOS/trunk/src/node/field.hpp	(revision 1537)
@@ -16,4 +16,5 @@
 #include "transformation_enum.hpp"
 #include "variable.hpp"
+#include "context_client.hpp"
 
 
@@ -36,4 +37,5 @@
    class CStoreFilter;
    class CFileWriterFilter;
+   class CFileServerWriterFilter;
 
    ///--------------------------------------------------------------
@@ -56,4 +58,9 @@
          typedef CFieldAttributes SuperClassAttribute;
 
+         enum EReadField
+         {
+           RF_NODATA, RF_EOF, RF_DATA
+         };
+         
       public:
 
@@ -93,6 +100,10 @@
          void resetNStepMax();
 
-         std::map<int, StdSize> getGridAttributesBufferSize();
-         std::map<int, StdSize> getGridDataBufferSize();
+         std::map<int, StdSize> getGridAttributesBufferSize(CContextClient* client, bool bufferForWriting = false);
+         // Grid data buffer size for each connection of contextclient
+         std::map<int, StdSize> getGridDataBufferSize(CContextClient* client, bool bufferForWriting = false);
+
+         void setContextClient(CContextClient* newContextClient);
+         CContextClient* getContextClient();
 
        public:
@@ -120,5 +131,16 @@
          void solveGridDomainAxisBaseRef();
 
+         void solveAllEnabledFieldsAndTransform();
+         void checkGridOfEnabledFields();
+         void sendGridOfEnabledFields();
+         void sendGridComponentOfEnabledFields();
+
+         /// VÃ©rifications ///
+         void checkTimeAttributes(CDuration* freqOp=NULL);
+
          void buildFilterGraph(CGarbageCollector& gc, bool enableOutput);
+         size_t getGlobalWrittenSize(void) ;
+         
+         
          boost::shared_ptr<COutputPin> getFieldReference(CGarbageCollector& gc);
          boost::shared_ptr<COutputPin> getSelfReference(CGarbageCollector& gc);
@@ -139,7 +161,9 @@
         template <int N> void setData(const CArray<double, N>& _data);
         static bool dispatchEvent(CEventServer& event);
+        void sendAllAttributesToServer(CContextClient* client) ; 
         void sendUpdateData(const CArray<double,1>& data);
+        void sendUpdateData(const CArray<double,1>& data, CContextClient* client);
         static void recvUpdateData(CEventServer& event);
-        void recvUpdateData(vector<int>& ranks, vector<CBufferIn*>& buffers);
+        void recvUpdateData(std::map<int,CBufferIn*>& rankBuffers);
         void writeField(void);
         bool sendReadDataRequest(const CDate& tsDataRequested);
@@ -147,5 +171,5 @@
         static void recvReadDataRequest(CEventServer& event);
         void recvReadDataRequest(void);
-        bool readField(void);
+        EReadField readField(void);
         static void recvReadDataReady(CEventServer& event);
         void recvReadDataReady(vector<int> ranks, vector<CBufferIn*> buffers);
@@ -170,15 +194,13 @@
 
         CVariable* addVariable(const string& id = "");
-        CVariableGroup* addVariableGroup(const string& id = "");
-        void sendAddVariable(const string& id = "");
-        void sendAddVariableGroup(const string& id = "");
+        CVariableGroup* addVariableGroup(const string& id = "");        
+        void sendAddVariable(const string& id, CContextClient* client);
+        void sendAddVariableGroup(const string& id, CContextClient* client);
         static void recvAddVariable(CEventServer& event);
         void recvAddVariable(CBufferIn& buffer);
         static void recvAddVariableGroup(CEventServer& event);
-        void recvAddVariableGroup(CBufferIn& buffer);
-        void sendAddAllVariables();
-
-        /// VÃ©rifications ///
-        void checkAttributes(void);
+        void recvAddVariableGroup(CBufferIn& buffer);        
+        void sendAddAllVariables(CContextClient* client);
+        void writeUpdateData(const CArray<double,1>& data);
 
         const std::vector<StdString>& getRefDomainAxisIds();
@@ -206,17 +228,28 @@
          map<int,boost::shared_ptr<func::CFunctor> > foperation_srv;
 
-         map<int, CArray<double,1> > data_srv;
+         // map<int, CArray<double,1> > data_srv;
+         CArray<double,1> recvDataSrv;
+         
+         boost::shared_ptr<func::CFunctor> recvFoperationSrv;
          string content;
+
+         std::vector<StdString> domAxisScalarIds_;
+         bool useCompressedOutput;
+
+         // Two variables to identify the time_counter meta data written in file, which has no time_counter
+         bool hasTimeInstant;
+         bool hasTimeCentered;
+
+
+         DECLARE_REF_FUNC(Field,field)
+
+      private:
+         CContextClient* client;
 
          bool areAllReferenceSolved;
          bool isReferenceSolved;
-         std::vector<StdString> domAxisScalarIds_;
-         bool useCompressedOutput;
-
-         // Two variable to identify the time_counter meta data written in file, which has no time_counter
-         bool hasTimeInstant;
-         bool hasTimeCentered;
-
-         DECLARE_REF_FUNC(Field,field)
+         bool isReferenceSolvedAndTransformed;
+         bool isGridChecked;
+         bool nstepMaxRead;
 
       private:
@@ -238,4 +271,6 @@
          //! The terminal filter which writes the data to file
          boost::shared_ptr<CFileWriterFilter> fileWriterFilter;
+         //! The terminal filter which writes data to file
+         boost::shared_ptr<CFileServerWriterFilter> fileServerWriterFilter;
    }; // class CField
 
Index: /XIOS/trunk/src/node/field_impl.hpp
===================================================================
--- /XIOS/trunk/src/node/field_impl.hpp	(revision 1536)
+++ /XIOS/trunk/src/node/field_impl.hpp	(revision 1537)
@@ -20,5 +20,5 @@
     if (clientSourceFilter)
     {
-      if (!check_if_active || isActive(true))
+      if (check_if_active.isEmpty() || (!check_if_active.isEmpty() && (!check_if_active) || isActive(true)))
         clientSourceFilter->streamData(CContext::getCurrent()->getCalendar()->getCurrentDate(), _data);
     }
Index: /XIOS/trunk/src/node/file.cpp
===================================================================
--- /XIOS/trunk/src/node/file.cpp	(revision 1536)
+++ /XIOS/trunk/src/node/file.cpp	(revision 1537)
@@ -17,4 +17,5 @@
 #include "mpi.hpp"
 #include "timer.hpp"
+#include "server.hpp"
 
 namespace xios {
@@ -25,5 +26,5 @@
       : CObjectTemplate<CFile>(), CFileAttributes()
       , vFieldGroup(), data_out(), enabledFields(), fileComm(MPI_COMM_NULL)
-      , allDomainEmpty(false), isOpen(false)
+      , isOpen(false), read_client(0), checkRead(false), allZoneEmpty(false)
    {
      setVirtualFieldGroup(CFieldGroup::create(getId() + "_virtual_field_group"));
@@ -34,5 +35,5 @@
       : CObjectTemplate<CFile>(id), CFileAttributes()
       , vFieldGroup(), data_out(), enabledFields(), fileComm(MPI_COMM_NULL)
-      , allDomainEmpty(false), isOpen(false)
+      , isOpen(false), read_client(0), checkRead(false), allZoneEmpty(false)
     {
       setVirtualFieldGroup(CFieldGroup::create(getId() + "_virtual_field_group"));
@@ -207,5 +208,5 @@
 
    //! Initialize a file in order to write into it
-   void CFile::initFile(void)
+   void CFile::initWrite(void)
    {
       CContext* context = CContext::getCurrent();
@@ -217,5 +218,5 @@
       if (!split_freq.isEmpty())
       {
-        StdString keySuffix("CContext_"+CContext::getCurrent()->getId()+"::CFile_"+getFileOutputName()+"::") ; 
+        StdString keySuffix("CFile::"+getFileOutputName()+"::") ; 
         if (context->registryIn->foundKey(keySuffix+"splitStart") && context->registryIn->foundKey(keySuffix+"splitEnd"))
         {
@@ -228,7 +229,5 @@
         }
       }
-      isOpen = false;
-
-      allDomainEmpty = true;
+      isOpen = false;      
 
 //      if (!record_offset.isEmpty() && record_offset < 0)
@@ -237,22 +236,17 @@
       const int recordOffset = record_offset.isEmpty() ? 0 : record_offset;
 
-      // set<CAxis*> setAxis;
-      // set<CDomain*> setDomains;
       set<StdString> setAxis;
       set<StdString> setDomains;
-      
+
       std::vector<CField*>::iterator it, end = this->enabledFields.end();
       for (it = this->enabledFields.begin(); it != end; it++)
       {
-         CField* field = *it;
-         allDomainEmpty &= !field->grid->doGridHaveDataToWrite();
+         CField* field = *it;         
          std::vector<CAxis*> vecAxis = field->grid->getAxis();
          for (size_t i = 0; i < vecAxis.size(); ++i)
-            setAxis.insert(vecAxis[i]->getAxisOutputName());
-            // setAxis.insert(vecAxis[i]);
+           setAxis.insert(vecAxis[i]->getAxisOutputName());
          std::vector<CDomain*> vecDomains = field->grid->getDomains();
          for (size_t i = 0; i < vecDomains.size(); ++i)
-            setDomains.insert(vecDomains[i]->getDomainOutputName());
-            // setDomains.insert(vecDomains[i]);
+           setDomains.insert(vecDomains[i]->getDomainOutputName());
 
          field->resetNStep(recordOffset);
@@ -262,7 +256,5 @@
 
       // create sub communicator for file
-      int color = allDomainEmpty ? 0 : 1;
-      MPI_Comm_split(server->intraComm, color, server->intraCommRank, &fileComm);
-      if (allDomainEmpty) MPI_Comm_free(&fileComm);
+      createSubComFile();
 
       // if (time_counter.isEmpty()) time_counter.setValue(time_counter_attr::centered);
@@ -270,21 +262,90 @@
     }
 
-    //! Verify state of a file
-    void CFile::checkFile(void)
+    //! Initialize a file in order to write into it
+    void CFile::initRead(void)
     {
-      if (mode.isEmpty() || mode.getValue() == mode_attr::write)
-      {
-        CTimer::get("Files : create headers").resume();
-        if (!isOpen) createHeader();
-        CTimer::get("Files : create headers").suspend();
-        checkSync();
-      }
-      else
-      {
-        CTimer::get("Files : open headers").resume();
-        if (!isOpen) openInReadMode();
-        CTimer::get("Files : open headers").suspend();
-      }
-      checkSplit();
+      if (checkRead) return;
+      createSubComFile();
+      checkRead = true;
+    }
+
+    /*!
+      Create a sub communicator in which processes participate in reading/opening file
+    */
+    void CFile::createSubComFile()
+    {
+      CContext* context = CContext::getCurrent();
+      CContextServer* server = context->server;
+
+      // create sub communicator for file
+      allZoneEmpty = true;      
+      std::vector<CField*>::iterator it, end = this->enabledFields.end();
+      for (it = this->enabledFields.begin(); it != end; it++)
+      {
+         CField* field = *it;
+         bool nullGrid = (0 == field->grid);
+         allZoneEmpty &= nullGrid ? false : !field->grid->doGridHaveDataToWrite();
+      }
+
+      int color = allZoneEmpty ? 0 : 1;
+      MPI_Comm_split(server->intraComm, color, server->intraCommRank, &fileComm);
+      if (allZoneEmpty) MPI_Comm_free(&fileComm);
+    }
+
+    /*
+       Check condition to write into a file
+       For now, we only use the level-2 server to write files (if this mode is activated)
+       or classical server to do this job.
+    */
+    void CFile::checkWriteFile(void)
+    {
+      CContext* context = CContext::getCurrent();
+      // Done by classical server or secondary server
+      // This condition should be changed soon
+      if (CServer::serverLevel == 0 || CServer::serverLevel == 2)
+      {
+        if (mode.isEmpty() || mode.getValue() == mode_attr::write)
+        {
+          CTimer::get("Files : create headers").resume();
+          if (!isOpen) createHeader();
+          CTimer::get("Files : create headers").suspend();
+          checkSync();
+        }        
+        checkSplit(); // REally need this?
+      }
+    }
+
+    /*
+       Check condition to read from a file
+       For now, we only use the level-1 server to write files (if this mode is activated)
+       or classical server to do this job.
+       This function can be used by client for reading metadata
+    */
+    void CFile::checkReadFile(void)
+    {
+      CContext* context = CContext::getCurrent();
+      // Done by classical server or secondary server
+      // TODO: This condition should be changed soon. It only works with maximum number of level as 2
+      if (CServer::serverLevel == 0 || CServer::serverLevel == 1)
+      {
+        if (!mode.isEmpty() && mode.getValue() == mode_attr::read)
+        {
+          CTimer::get("Files : open headers").resume();
+          
+          if (!isOpen) openInReadMode();
+
+          CTimer::get("Files : open headers").suspend();
+        }
+        //checkSplit(); // Really need for reading?
+      }
+    }
+
+    /*!
+      Verify if a process participates in an opening-file communicator 
+      \return true if the process doesn't participate in opening file
+    */
+    bool CFile::isEmptyZone()
+    {
+      return allZoneEmpty;
     }
 
@@ -351,5 +412,5 @@
       CContextServer* server = context->server;
 
-      if (!allDomainEmpty)
+      if (!allZoneEmpty)
       {
          StdString filename = getFileOutputName();
@@ -380,5 +441,5 @@
          if (pos2!=std::string::npos)
          {
-           middlePart=filename.substr(pos1,pos2-pos1) ;           
+           middlePart=filename.substr(pos1,pos2-pos1) ;
            pos2+=strEndDate.size() ;
            lastPart=filename.substr(pos2,filename.size()-pos2) ;
@@ -418,9 +479,11 @@
            if (split_freq_format.isEmpty())
            {
-             if (split_freq.getValue().second != 0) splitFormat = "%y%mo%d%h%mi%s";
-             else if (split_freq.getValue().minute != 0) splitFormat = "%y%mo%d%h%mi";
-             else if (split_freq.getValue().hour != 0) splitFormat = "%y%mo%d%h";
-             else if (split_freq.getValue().day != 0) splitFormat = "%y%mo%d";
-             else if (split_freq.getValue().month != 0) splitFormat = "%y%mo";
+             CDuration splitFreq = split_freq.getValue();
+             splitFreq.solveTimeStep(*CContext::getCurrent()->getCalendar());
+             if (splitFreq.second != 0) splitFormat = "%y%mo%d%h%mi%s";
+             else if (splitFreq.minute != 0) splitFormat = "%y%mo%d%h%mi";
+             else if (splitFreq.hour != 0) splitFormat = "%y%mo%d%h";
+             else if (splitFreq.day != 0) splitFormat = "%y%mo%d";
+             else if (splitFreq.month != 0) splitFormat = "%y%mo";
              else splitFormat = "%y";
            }
@@ -433,5 +496,5 @@
            oss << lastPart ;
 
-           StdString keySuffix("CContext_"+CContext::getCurrent()->getId()+"::CFile_"+getFileOutputName()+"::") ; 
+           StdString keySuffix("CFile::"+getFileOutputName()+"::") ; 
            context->registryOut->setKey(keySuffix+"splitStart", lastSplit);
            context->registryOut->setKey(keySuffix+"splitEnd",   splitEnd);
@@ -488,4 +551,6 @@
         data_out->writeFile(CFile::get(this));
 
+        if (!useCFConvention) sortEnabledFieldsForUgrid();
+
         // Do not recreate the file structure if opening an existing file
         if (!data_out->IsInAppendMode())
@@ -533,10 +598,11 @@
   \brief Open an existing NetCDF file in read-only mode
   */
-  void CFile::openInReadMode(void)
+  void CFile::openInReadMode()
   {
     CContext* context = CContext::getCurrent();
     CContextServer* server = context->server;
-
-    if (!allDomainEmpty)
+    MPI_Comm readComm = this->fileComm;
+
+    if (!allZoneEmpty)
     {
       StdString filename = getFileOutputName();
@@ -549,9 +615,11 @@
         if (split_freq_format.isEmpty())
         {
-          if (split_freq.getValue().second != 0) splitFormat = "%y%mo%d%h%mi%s";
-          else if (split_freq.getValue().minute != 0) splitFormat = "%y%mo%d%h%mi";
-          else if (split_freq.getValue().hour != 0) splitFormat = "%y%mo%d%h";
-          else if (split_freq.getValue().day != 0) splitFormat = "%y%mo%d";
-          else if (split_freq.getValue().month != 0) splitFormat = "%y%mo";
+          CDuration splitFreq = split_freq.getValue();
+          splitFreq.solveTimeStep(*CContext::getCurrent()->getCalendar());
+          if (splitFreq.second != 0) splitFormat = "%y%mo%d%h%mi%s";
+          else if (splitFreq.minute != 0) splitFormat = "%y%mo%d%h%mi";
+          else if (splitFreq.hour != 0) splitFormat = "%y%mo%d%h";
+          else if (splitFreq.day != 0) splitFormat = "%y%mo%d";
+          else if (splitFreq.month != 0) splitFormat = "%y%mo";
           else splitFormat = "%y";
         }
@@ -577,6 +645,6 @@
       {
         int commSize, commRank;
-        MPI_Comm_size(fileComm, &commSize);
-        MPI_Comm_rank(fileComm, &commRank);
+        MPI_Comm_size(readComm, &commSize);
+        MPI_Comm_rank(readComm, &commRank);
 
         if (server->intraCommSize > 1)
@@ -595,9 +663,13 @@
 
       bool isCollective = par_access.isEmpty() || par_access == par_access_attr::collective;
+      bool readMetaDataPar = true;
+      if (!context->hasServer) readMetaDataPar = (read_metadata_par.isEmpty()) ? false : read_metadata_par;
 
       if (isOpen) data_out->closeFile();
       bool ugridConvention = !convention.isEmpty() ? (convention == convention_attr::UGRID) : false;
-      if (time_counter_name.isEmpty()) data_in = shared_ptr<CDataInput>(new CNc4DataInput(oss.str(), fileComm, multifile, isCollective, ugridConvention));
-      else data_in = shared_ptr<CDataInput>(new CNc4DataInput(oss.str(), fileComm, multifile, isCollective, ugridConvention, time_counter_name));
+      if (time_counter_name.isEmpty())
+        data_in = shared_ptr<CDataInput>(new CNc4DataInput(oss.str(), readComm, multifile, isCollective, readMetaDataPar, ugridConvention));
+      else
+        data_in = shared_ptr<CDataInput>(new CNc4DataInput(oss.str(), readComm, multifile, isCollective, readMetaDataPar, ugridConvention, time_counter_name));
       isOpen = true;
     }
@@ -607,5 +679,5 @@
    void CFile::close(void)
    {
-     if (!allDomainEmpty)
+     if (!allZoneEmpty)
        if (isOpen)
        {
@@ -614,4 +686,5 @@
          else
           this->data_in->closeFile();
+        isOpen = false;
        }
       if (fileComm != MPI_COMM_NULL) MPI_Comm_free(&fileComm);
@@ -624,12 +697,7 @@
 
      // Just check file and try to open it
-     CContext* context = CContext::getCurrent();
-     CContextClient* client=context->client;
-
-     // It would probably be better to call initFile() somehow
-     MPI_Comm_dup(client->intraComm, &fileComm);
      if (time_counter_name.isEmpty()) time_counter_name = "time_counter";
 
-     checkFile();
+     checkReadFile();
 
      for (int idx = 0; idx < enabledFields.size(); ++idx)
@@ -726,5 +794,85 @@
      {
        this->enabledFields[i]->solveOnlyReferenceEnabledField(sendToServer);
-//       this->enabledFields[i]->buildGridTransformationGraph();
+     }
+   }
+
+   void CFile::checkGridOfEnabledFields()
+   { 
+     int size = this->enabledFields.size();
+     for (int i = 0; i < size; ++i)
+     {
+       this->enabledFields[i]->checkGridOfEnabledFields();
+     }
+   }
+
+   void CFile::sendGridComponentOfEnabledFields()
+   { 
+     int size = this->enabledFields.size();
+     for (int i = 0; i < size; ++i)
+     {
+       this->enabledFields[i]->sendGridComponentOfEnabledFields();
+     }
+   }
+
+   /*!
+   \brief Sorting domains with the same name (= describing the same mesh) in the decreasing order of nvertex for UGRID files.
+   This insures that the domain with the highest nvertex is written first and thus all known mesh connectivity is generated at once by this domain.
+   */
+   void CFile::sortEnabledFieldsForUgrid()
+   {
+     int size = this->enabledFields.size();
+     std::vector<int> domainNvertices;
+     std::vector<StdString> domainNames;
+
+     for (int i = 0; i < size; ++i)
+     {
+       std::vector<CDomain*> domain = this->enabledFields[i]->getRelGrid()->getDomains();
+       if (domain.size() != 1)
+       {
+         ERROR("void CFile::sortEnabledFieldsForUgrid()",
+               "A domain, and only one, should be defined for grid "<< this->enabledFields[i]->getRelGrid()->getId() << ".");
+       }
+       StdString domainName = domain[0]->getDomainOutputName();
+       int nvertex;
+       if (domain[0]->nvertex.isEmpty())
+       {
+         ERROR("void CFile::sortEnabledFieldsForUgrid()",
+               "Attributes nvertex must be defined for domain "<< domain[0]->getDomainOutputName() << ".");
+       }
+       else
+         nvertex = domain[0]->nvertex;
+
+       for (int j = 0; j < i; ++j)
+       {
+         if (domainName == domainNames[j] && nvertex > domainNvertices[j])
+         {
+           CField* tmpSwap = this->enabledFields[j];
+           this->enabledFields[j] = this->enabledFields[i];
+           this->enabledFields[i] = tmpSwap;
+           domainNames.push_back(domainNames[j]);
+           domainNames[j] = domainName;
+           domainNvertices.push_back(domainNvertices[j]);
+           domainNvertices[j] = nvertex;
+         }
+         else
+         {
+           domainNames.push_back(domainName);
+           domainNvertices.push_back(nvertex);
+         }
+       }
+       if (i==0)
+       {
+         domainNames.push_back(domainName);
+         domainNvertices.push_back(nvertex);
+       }
+     }
+   }
+
+   void CFile::sendGridOfEnabledFields()
+   { 
+     int size = this->enabledFields.size();
+     for (int i = 0; i < size; ++i)
+     {
+       this->enabledFields[i]->sendGridOfEnabledFields();
      }
    }
@@ -747,10 +895,10 @@
    \param [in] sendToServer: Send all info to server (true) or only a part of it (false)
    */
-   void CFile::solveAllRefOfEnabledFields(bool sendToServer)
+   void CFile::solveAllRefOfEnabledFieldsAndTransform(bool sendToServer)
    {
      int size = this->enabledFields.size();
      for (int i = 0; i < size; ++i)
-     {
-       this->enabledFields[i]->solveAllReferenceEnabledField(sendToServer);
+     {       
+      this->enabledFields[i]->solveAllEnabledFieldsAndTransform();
      }
    }
@@ -891,30 +1039,36 @@
    }
 
+   void CFile::setContextClient(CContextClient* newContextClient)
+   {
+     client = newContextClient;
+     size_t size = this->enabledFields.size();
+     for (size_t i = 0; i < size; ++i)
+     {
+       this->enabledFields[i]->setContextClient(newContextClient);
+     }
+   }
+
+   CContextClient* CFile::getContextClient()
+   {
+     return client;
+   }
+
+   void CFile::setReadContextClient(CContextClient* readContextclient)
+   {
+     read_client = readContextclient;
+   }
+
+   CContextClient* CFile::getReadContextClient()
+   {
+     return read_client;
+   }
+
    /*!
    \brief Send a message to create a field on server side
    \param[in] id String identity of field that will be created on server
    */
-   void CFile::sendAddField(const string& id)
-   {
-    CContext* context = CContext::getCurrent();
-
-    if (! context->hasServer )
-    {
-       CContextClient* client = context->client;
-
-       CEventClient event(this->getType(),EVENT_ID_ADD_FIELD);
-       if (client->isServerLeader())
-       {
-         CMessage msg;
-         msg << this->getId();
-         msg << id;
-         const std::list<int>& ranks = client->getRanksServerLeader();
-         for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
-           event.push(*itRank,1,msg);
-         client->sendEvent(event);
-       }
-       else client->sendEvent(event);
-    }
-
+   void CFile::sendAddField(const string& id, CContextClient* client)
+   {
+      sendAddItem(id, EVENT_ID_ADD_FIELD, client);
    }
 
@@ -923,25 +1077,7 @@
    \param[in] id String identity of field group that will be created on server
    */
-   void CFile::sendAddFieldGroup(const string& id)
-   {
-    CContext* context = CContext::getCurrent();
-    if (! context->hasServer )
-    {
-       CContextClient* client = context->client;
-
-       CEventClient event(this->getType(),EVENT_ID_ADD_FIELD_GROUP);
-       if (client->isServerLeader())
-       {
-         CMessage msg;
-         msg << this->getId();
-         msg << id;
-         const std::list<int>& ranks = client->getRanksServerLeader();
-         for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
-           event.push(*itRank,1,msg);
-         client->sendEvent(event);
-       }
-       else client->sendEvent(event);
-    }
-
+   void CFile::sendAddFieldGroup(const string& id, CContextClient* client)
+   {
+      sendAddItem(id, (int)EVENT_ID_ADD_FIELD_GROUP, client);
    }
 
@@ -1000,5 +1136,5 @@
    is to duplicate this value on server, too.
    */
-   void CFile::sendAddAllVariables()
+   void CFile::sendAddAllVariables(CContextClient* client)
    {
      std::vector<CVariable*> allVar = getAllVariables();
@@ -1008,37 +1144,8 @@
      for (; it != itE; ++it)
      {
-       this->sendAddVariable((*it)->getId());
-       (*it)->sendAllAttributesToServer();
-       (*it)->sendValue();
-     }
-   }
-
-   /*!
-   \brief Send a message to create a variable on server side
-      A variable always belongs to a variable group
-   \param[in] id String identity of variable that will be created on server
-   */
-   void CFile::sendAddVariable(const string& id)
-   {
-    CContext* context = CContext::getCurrent();
-
-    if (! context->hasServer )
-    {
-       CContextClient* client = context->client;
-
-       CEventClient event(this->getType(),EVENT_ID_ADD_VARIABLE);
-       if (client->isServerLeader())
-       {
-         CMessage msg;
-         msg << this->getId();
-         msg << id;
-         const std::list<int>& ranks = client->getRanksServerLeader();
-         for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
-           event.push(*itRank,1,msg);
-         client->sendEvent(event);
-       }
-       else client->sendEvent(event);
-    }
-
+       this->sendAddVariable((*it)->getId(), client);
+       (*it)->sendAllAttributesToServer(client);
+       (*it)->sendValue(client);
+     }
    }
 
@@ -1046,26 +1153,19 @@
    \brief Send a message to create a variable group on server side
    \param[in] id String identity of variable group that will be created on server
-   */
-   void CFile::sendAddVariableGroup(const string& id)
-   {
-    CContext* context = CContext::getCurrent();
-    if (! context->hasServer )
-    {
-       CContextClient* client = context->client;
-
-       CEventClient event(this->getType(),EVENT_ID_ADD_VARIABLE_GROUP);
-       if (client->isServerLeader())
-       {
-         CMessage msg;
-         msg << this->getId();
-         msg << id;
-         const std::list<int>& ranks = client->getRanksServerLeader();
-         for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
-           event.push(*itRank,1,msg);
-         client->sendEvent(event);
-       }
-       else client->sendEvent(event);
-    }
-
+   \param [in] client client to which we will send this adding action
+   */
+   void CFile::sendAddVariableGroup(const string& id, CContextClient* client)
+   {
+      sendAddItem(id, (int)EVENT_ID_ADD_VARIABLE_GROUP, client);
+   }
+
+   /*
+     Send message to add a variable into a file within a certain client
+     \param [in] id String identity of a variable
+     \param [in] client client to which we will send this adding action
+   */
+   void CFile::sendAddVariable(const string& id, CContextClient* client)
+   {
+      sendAddItem(id, (int)EVENT_ID_ADD_VARIABLE, client);
    }
 
@@ -1125,5 +1225,5 @@
    Remark: This function must be called AFTER all active (enabled) files have been created on the server side
    */
-   void CFile::sendEnabledFields()
+   void CFile::sendEnabledFields(CContextClient* client)
    {
      size_t size = this->enabledFields.size();
@@ -1131,10 +1231,11 @@
      {
        CField* field = this->enabledFields[i];
-       this->sendAddField(field->getId());
-       field->checkAttributes();
-       field->sendAllAttributesToServer();
-       field->sendAddAllVariables();
-     }
-   }
+       this->sendAddField(field->getId(), client);
+       field->checkTimeAttributes();
+       field->sendAllAttributesToServer(client);
+       field->sendAddAllVariables(client);
+     }
+   }
+
 
    /*!
Index: /XIOS/trunk/src/node/file.hpp
===================================================================
--- /XIOS/trunk/src/node/file.hpp	(revision 1536)
+++ /XIOS/trunk/src/node/file.hpp	(revision 1537)
@@ -11,4 +11,5 @@
 #include "attribute_enum.hpp"
 #include "attribute_enum_impl.hpp"
+#include "context_client.hpp"
 #include "mpi.hpp"
 
@@ -86,6 +87,9 @@
          bool checkSplit(void);
          bool checkSync(void);
-         void checkFile(void);
-         void initFile(void);
+         void checkWriteFile(void);
+         void checkReadFile(void);
+         void initWrite(void);
+         void initRead(void);
+         bool isEmptyZone();
 
          /// Mutateurs ///
@@ -104,5 +108,5 @@
          void solveOnlyRefOfEnabledFields(bool sendToServer);
          void generateNewTransformationGridDest();
-         void solveAllRefOfEnabledFields(bool sendToServer);
+         
          void buildFilterGraphOfEnabledFields(CGarbageCollector& gc);
          void postProcessFilterGraph();
@@ -111,4 +115,11 @@
          void doPostTimestepOperationsForEnabledReadModeFields();
 
+         void solveAllRefOfEnabledFieldsAndTransform(bool sendToServer);
+         void checkGridOfEnabledFields();
+         void sendGridOfEnabledFields();
+         void sendGridComponentOfEnabledFields();
+
+         void sortEnabledFieldsForUgrid();
+
          // Add component into file
          CField* addField(const string& id = "");
@@ -116,13 +127,18 @@
          CVariable* addVariable(const string& id = "");
          CVariableGroup* addVariableGroup(const string& id = "");
-
-         // Send info to serever
-         void sendEnabledFields();
-         void sendAddField(const string& id = "");
-         void sendAddFieldGroup(const string& id = "");
-         void sendAddAllVariables();
-         void sendAddVariable(const string& id = "");
-         void sendAddVariableGroup(const string& id = "");
-
+         void setContextClient(CContextClient* newContextClient);
+         CContextClient* getContextClient();
+
+         void setReadContextClient(CContextClient* newContextClient);
+         CContextClient* getReadContextClient();
+
+         // Send info to server         
+         void sendEnabledFields(CContextClient* client);         
+         void sendAddField(const string& id, CContextClient* client);         
+         void sendAddFieldGroup(const string& id, CContextClient* client);                           
+         void sendAddVariable(const string& id, CContextClient* client);
+         void sendAddVariableGroup(const string& id, CContextClient* client);
+         void sendAddAllVariables(CContextClient* client);
+         
          // Receive info from client
          static void recvAddField(CEventServer& event);
@@ -156,10 +172,16 @@
          CDate lastSplit;
          int nbAxis, nbDomains;
-         bool isOpen;
-         bool allDomainEmpty;
+         bool isOpen;         
          MPI_Comm fileComm;
 
+      private:
+         void createSubComFile();
+         bool checkRead;
+         bool allZoneEmpty;
+         
       private :
          /// PropriÃ©tÃ©s privÃ©es ///
+         CContextClient* client;
+         CContextClient* read_client; // Context client for reading (channel between server 1 and client)
          CFieldGroup* vFieldGroup;
          CVariableGroup* vVariableGroup;
@@ -168,4 +190,5 @@
          std::vector<CField*> enabledFields;
 
+
       public:
         //         virtual void toBinary  (StdOStream& os) const;
Index: /XIOS/trunk/src/node/grid.cpp
===================================================================
--- /XIOS/trunk/src/node/grid.cpp	(revision 1536)
+++ /XIOS/trunk/src/node/grid.cpp	(revision 1537)
@@ -18,4 +18,5 @@
 #include "grid_transformation.hpp"
 #include "grid_generate.hpp"
+#include "server.hpp"
 
 namespace xios {
@@ -31,8 +32,11 @@
       , clientDistribution_(0), isIndexSent(false) , serverDistribution_(0), clientServerMap_(0)
       , writtenDataSize_(0), numberWrittenIndexes_(0), totalNumberWrittenIndexes_(0), offsetWrittenIndexes_(0)
-      , connectedDataSize_(), connectedServerRank_(), isDataDistributed_(true), isCompressible_(false)
+      , connectedDataSize_(), connectedServerRank_(), connectedServerRankRead_(), connectedDataSizeRead_()
+	  , isDataDistributed_(true), isCompressible_(false)
       , transformations_(0), isTransformed_(false)
       , axisPositionInGrid_(), hasDomainAxisBaseRef_(false)
       , gridSrc_(), hasTransform_(false), isGenerated_(false), order_(), globalIndexOnServer_()
+      , computedWrittenIndex_(false)
+      , clients()
    {
      setVirtualDomainGroup(CDomainGroup::create(getId() + "_virtual_domain_group"));
@@ -49,8 +53,11 @@
       , clientDistribution_(0), isIndexSent(false) , serverDistribution_(0), clientServerMap_(0)
       , writtenDataSize_(0), numberWrittenIndexes_(0), totalNumberWrittenIndexes_(0), offsetWrittenIndexes_(0)
-      , connectedDataSize_(), connectedServerRank_(), isDataDistributed_(true), isCompressible_(false)
+      , connectedDataSize_(), connectedServerRank_(), connectedServerRankRead_(), connectedDataSizeRead_()
+	  , isDataDistributed_(true), isCompressible_(false)
       , transformations_(0), isTransformed_(false)
       , axisPositionInGrid_(), hasDomainAxisBaseRef_(false)
       , gridSrc_(), hasTransform_(false), isGenerated_(false), order_(), globalIndexOnServer_()
+      , computedWrittenIndex_(false)
+      , clients()
    {
      setVirtualDomainGroup(CDomainGroup::create(getId() + "_virtual_domain_group"));
@@ -87,5 +94,5 @@
      {
        std::vector<int> dataNindex = clientDistribution_->getDataNIndex();
-       for (int i = 0; i < dataNindex.size(); ++i) retvalue *= dataNindex[i];
+       for (int i = 0; i < dataNindex.size(); ++i) retvalue *= dataNindex[i];       
      }
      return retvalue;
@@ -96,11 +103,12 @@
     *
     * \return A map associating the server rank with its minimum buffer size.
+    * TODO: Refactor code
     */
-   std::map<int, StdSize> CGrid::getAttributesBufferSize()
-   {
-     std::map<int, StdSize> attributesSizes = getMinimumBufferSizeForAttributes();
+   std::map<int, StdSize> CGrid::getAttributesBufferSize(CContextClient* client, bool bufferForWriting)
+   {
+     std::map<int, StdSize> attributesSizes = getMinimumBufferSizeForAttributes(client);
 
      // The grid indexes require a similar size as the actual data
-     std::map<int, StdSize> dataSizes = getDataBufferSize();
+     std::map<int, StdSize> dataSizes = getDataBufferSize(client, "", bufferForWriting);
      std::map<int, StdSize>::iterator it, itE = dataSizes.end();
      for (it = dataSizes.begin(); it != itE; ++it)
@@ -110,12 +118,13 @@
          attributesSizes[it->first] = it->second;
      }
-
+     
      // Account for the axis attributes
      std::vector<CAxis*> axisList = getAxis();
      for (size_t i = 0; i < axisList.size(); ++i)
      {
-       std::map<int, StdSize> axisAttBuffSize = axisList[i]->getAttributesBufferSize();
+       std::map<int, StdSize> axisAttBuffSize = axisList[i]->getAttributesBufferSize(client, getGlobalDimension(),axisPositionInGrid_[i]);
        for (it = axisAttBuffSize.begin(), itE = axisAttBuffSize.end(); it != itE; ++it)
        {
+         it->second += 2 * sizeof(bool);
          if (it->second > attributesSizes[it->first])
            attributesSizes[it->first] = it->second;
@@ -127,7 +136,8 @@
      for (size_t i = 0; i < domList.size(); ++i)
      {
-       std::map<int, StdSize> domAttBuffSize = domList[i]->getAttributesBufferSize();
+       std::map<int, StdSize> domAttBuffSize = domList[i]->getAttributesBufferSize(client);
        for (it = domAttBuffSize.begin(), itE = domAttBuffSize.end(); it != itE; ++it)
        {
+         it->second += 2 * sizeof(bool);
          if (it->second > attributesSizes[it->first])
            attributesSizes[it->first] = it->second;
@@ -136,24 +146,31 @@
 
      return attributesSizes;
-   }
+  }
 
    /*!
-    * Compute the minimum buffer size required to send the data to the server(s).
-    *
+    * Compute the minimum buffer size required to send the data.
+    * \param client contextClient used to determine the size of connected receivers
     * \param id the id used to tag the data
-    * \return A map associating the server rank with its minimum buffer size.
+    * \param bufferForWriting flag indicating if a buffer is used to send data for writing
+    * \return A map associating the sender rank with its minimum buffer size.
     */
-   std::map<int, StdSize> CGrid::getDataBufferSize(const std::string& id /*= ""*/)
-   {
-     std::map<int, StdSize> dataSizes;
+   std::map<int, StdSize> CGrid::getDataBufferSize(CContextClient* client, const std::string& id /*= ""*/, bool bufferForWriting /*= "false"*/)
+   {     
      // The record index is sometimes sent along with the data but we always
      // include it in the size calculation for the sake of simplicity
-     const size_t extraSize = CEventClient::headerSize + (id.empty() ? getId() : id).size() + 2 * sizeof(size_t);
-
-     std::map<int, size_t>::const_iterator itEnd = connectedDataSize_.end();
-     for (size_t k = 0; k < connectedServerRank_.size(); ++k)
+     const size_t extraSize = CEventClient::headerSize + (id.empty() ? getId() : id).size() 
+                                                       + 2 * sizeof(size_t) 
+                                                       + sizeof(size_t);
+
+     std::map<int, StdSize> dataSizes;
+     int receiverSize = client->serverSize;
+     std::map<int,size_t>& dataSizeMap = bufferForWriting ? connectedDataSize_[receiverSize]: connectedDataSizeRead_;
+     std::vector<int>& connectedServerRanks = bufferForWriting ? connectedServerRank_[receiverSize] : connectedServerRankRead_;
+
+     std::map<int, size_t>::const_iterator itEnd = dataSizeMap.end();
+     for (size_t k = 0; k < connectedServerRanks.size(); ++k)
      {
-       int rank = connectedServerRank_[k];
-       std::map<int, size_t>::const_iterator it = connectedDataSize_.find(rank);
+       int rank = connectedServerRanks[k];
+       std::map<int, size_t>::const_iterator it = dataSizeMap.find(rank);
        size_t count = (it != itEnd) ? it->second : 0;
 
@@ -164,4 +181,16 @@
    }
 
+   size_t CGrid::getGlobalWrittenSize(void)
+   {
+	 std::vector<CDomain*> domainP = this->getDomains();
+     std::vector<CAxis*> axisP = this->getAxis();
+     
+     size_t globalGridSize=1 ;
+     for (std::vector<CDomain*>::iterator it=domainP.begin(); it!=domainP.end();++it) globalGridSize*=(*it)->getGlobalWrittenSize() ;
+     for (std::vector<CAxis*>::iterator it=axisP.begin(); it!=axisP.end();++it) globalGridSize*=(*it)->getGlobalWrittenSize() ;
+     return globalGridSize ;
+   }
+   
+   
    void CGrid::checkAttributesAfterTransformation()
    {
@@ -225,5 +254,7 @@
 
    //---------------------------------------------------------------
-
+   /*
+     Find all reference of grid's components and inherite attributes if necessary
+   */
    void CGrid::solveDomainAxisRef(bool areAttributesChecked)
    {
@@ -236,4 +267,8 @@
    }
 
+   /*
+     Go up hierachy reference and fill in the base reference with attributes of the children
+     This function should be only used after reading component's attributes from file
+   */
    void CGrid::solveDomainAxisBaseRef()
    {
@@ -272,42 +307,40 @@
    {
      CContext* context = CContext::getCurrent();
-     CContextClient* client=context->client;
-
-     if (isScalarGrid())
-     {
-       if (context->hasClient)
-          if (this->isChecked && doSendingIndex && !isIndexSent) { sendIndexScalarGrid(); this->isIndexSent = true; }
-
-       if (this->isChecked) return;
-
-       if (context->hasClient)
-       {
-          this->computeIndexScalarGrid();
+     int nbSrvPools = (context->hasServer) ? (context->hasClient ? context->clientPrimServer.size() : 0) : 1;   
+     nbSrvPools = 1;  
+     for (int p = 0; p < nbSrvPools; ++p)
+     {    
+       if (context->hasClient && this->isChecked && doSendingIndex && !isIndexSent) 
+       { 
+         if (isScalarGrid())
+           sendIndexScalarGrid();
+         else
+           sendIndex();
+         this->isIndexSent = true; 
        }
 
-       if (!(this->hasTransform() && !this->isTransformed()))
-        this->isChecked = true;
-       return;
+       // Not sure about this
+       //if (!(this->hasTransform() && !this->isTransformed()))
+       // this->isChecked = true;
+       //return;
      }
-
-     if (context->hasClient)
-      if (this->isChecked && doSendingIndex && !isIndexSent) { sendIndex(); this->isIndexSent = true; }
-
+    
      if (this->isChecked) return;
-
-     if (context->hasClient)
-     {
-        this->checkAttributesAfterTransformation();
-        this->checkMask();
-        this->computeIndex();
-     }
-
-     if (!(this->hasTransform() && !this->isTransformed())) 
+     this->checkAttributesAfterTransformation();
+
+     // TODO: Transfer grid attributes
+     //if (!context->hasClient && context->hasServer) this->createMask();
+     this->computeIndex();
+
+     if (!(this->hasTransform() && !this->isTransformed()))
       this->isChecked = true;
 
      if (!(this->hasTransform() && (!this->isGenerated())))
-      this->isChecked = true; 
-   }
-
+      this->isChecked = true;
+   }
+
+   /*
+     Create mask of grid from mask of its components
+   */
    void CGrid::createMask(void)
    {
@@ -318,5 +351,5 @@
 
       std::vector<CArray<bool,1>* > domainMasks(domainP.size());
-      for (int i = 0; i < domainMasks.size(); ++i) domainMasks[i] = &(domainP[i]->mask_1d);
+      for (int i = 0; i < domainMasks.size(); ++i) domainMasks[i] = &(domainP[i]->domainMask);
       std::vector<CArray<bool,1>* > axisMasks(axisP.size());
       for (int i = 0; i < axisMasks.size(); ++i) axisMasks[i] = &(axisP[i]->mask);
@@ -349,4 +382,7 @@
    }
 
+   /*
+     Check validity of grid's mask by using the masks of its components
+   */
    void CGrid::checkMask(void)
    {
@@ -357,5 +393,5 @@
 
       std::vector<CArray<bool,1>* > domainMasks(domainP.size());
-      for (int i = 0; i < domainMasks.size(); ++i) domainMasks[i] = &(domainP[i]->mask_1d);
+      for (int i = 0; i < domainMasks.size(); ++i) domainMasks[i] = &(domainP[i]->domainMask);
       std::vector<CArray<bool,1>* > axisMasks(axisP.size());
       for (int i = 0; i < axisMasks.size(); ++i) axisMasks[i] = &(axisP[i]->mask);
@@ -388,5 +424,56 @@
    }
 
-   void CGrid::modifyMask(const CArray<int,1>& indexToModify)
+
+/*!
+  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
+*/
+
+  void CGrid::getLocalMask(CArray<bool,1>& localMask)
+  {
+      std::vector<CDomain*> domainP = this->getDomains();
+      std::vector<CAxis*> axisP = this->getAxis();
+      int dim = domainP.size() * 2 + axisP.size();
+
+      switch (dim)
+      {
+        case 0:
+          getLocalMask(mask_0d, localMask);
+          break;
+        case 1:
+          getLocalMask(mask_1d, localMask);
+          break;
+        case 2:
+          getLocalMask(mask_2d, localMask);
+          break;
+        case 3:
+          getLocalMask(mask_3d, localMask);
+          break;
+        case 4:
+          getLocalMask(mask_4d, localMask);
+          break;
+        case 5:
+          getLocalMask(mask_5d, localMask);
+          break;
+        case 6:
+          getLocalMask(mask_6d, localMask);
+          break;
+        case 7:
+          getLocalMask(mask_7d, localMask);
+          break;
+        default:
+          break;
+      }
+  }
+      
+   /*
+     Modify value of mask in a certain index
+     This function can be used to correct the mask of grid after being constructed with createMask
+     \param [in] indexToModify
+     \param [in] modifyValue
+   */
+   void CGrid::modifyMask(const CArray<int,1>& indexToModify, bool modifyValue)
    {
       using namespace std;
@@ -396,24 +483,68 @@
 
       switch (dim) {
+        case 0:
+          modifyGridMask(mask_0d, indexToModify, modifyValue);
+          break;
         case 1:
-          modifyGridMask(mask_1d, indexToModify);
+          modifyGridMask(mask_1d, indexToModify, modifyValue);
           break;
         case 2:
-          modifyGridMask(mask_2d, indexToModify);
+          modifyGridMask(mask_2d, indexToModify, modifyValue);
           break;
         case 3:
-          modifyGridMask(mask_3d, indexToModify);
+          modifyGridMask(mask_3d, indexToModify, modifyValue);
           break;
         case 4:
-          modifyGridMask(mask_1d, indexToModify);
+          modifyGridMask(mask_4d, indexToModify, modifyValue);
           break;
         case 5:
-          modifyGridMask(mask_2d, indexToModify);
+          modifyGridMask(mask_5d, indexToModify, modifyValue);
           break;
         case 6:
-          modifyGridMask(mask_3d, indexToModify);
+          modifyGridMask(mask_6d, indexToModify, modifyValue);
           break;
         case 7:
-          modifyGridMask(mask_3d, indexToModify);
+          modifyGridMask(mask_7d, indexToModify, modifyValue);
+          break;
+        default:
+          break;
+      }
+   }
+
+   /*
+     Change the mask size. This function is used on reconstructing mask in server side
+     \param [in] newDimensionSize
+     \param [in] newValue 
+   */
+   void CGrid::modifyMaskSize(const std::vector<int>& newDimensionSize, bool newValue)
+   {      
+      std::vector<CDomain*> domainP = this->getDomains();
+      std::vector<CAxis*> axisP = this->getAxis();            
+      int dim = domainP.size() * 2 + axisP.size();
+
+      switch (dim) {
+        case 0:
+          modifyGridMaskSize(mask_0d, newDimensionSize, newValue);
+          break;
+        case 1:
+          modifyGridMaskSize(mask_1d, newDimensionSize, newValue);
+          break;
+        case 2:
+          modifyGridMaskSize(mask_2d, newDimensionSize, newValue);
+          break;
+        case 3:
+          modifyGridMaskSize(mask_3d, newDimensionSize, newValue);
+          break;
+        case 4:
+          modifyGridMaskSize(mask_4d, newDimensionSize, newValue);
+          break;
+        case 5:
+          modifyGridMaskSize(mask_5d, newDimensionSize, newValue);
+          break;
+        case 6:
+          modifyGridMaskSize(mask_6d, newDimensionSize, newValue);
+          break;
+        case 7:
+          modifyGridMaskSize(mask_7d, newDimensionSize, newValue);
           break;
         default:
@@ -486,10 +617,231 @@
    }
 
-   std::vector<int> CGrid::getAxisPositionInGrid() const
-   {
-     return axisPositionInGrid_;
+   /*!
+      Compute the index to for write data into a file
+   */
+   void CGrid::computeWrittenIndex()
+   {      
+      if (computedWrittenIndex_) return;
+      computedWrittenIndex_ = true;
+
+      if (isScalarGrid())
+      {
+        size_t nbWritten = 1;
+        int writtenIndex = 0;
+
+        localIndexToWriteOnClient.resize(nbWritten);  
+        localIndexToWriteOnServer.resize(nbWritten);
+        localIndexToWriteOnServer(0) = writtenIndex;
+        localIndexToWriteOnClient(0) = writtenIndex;
+        
+        return;
+      }
+
+      size_t nbWritten = 0, indGlo;
+      CDistributionClient::GlobalLocalDataMap& globalDataIndex = clientDistribution_->getGlobalDataIndexOnClient();
+      CDistributionClient::GlobalLocalDataMap::const_iterator itb = globalDataIndex.begin(),
+                                                              ite = globalDataIndex.end(), it;    
+      const CDistributionServer::GlobalLocalMap& globalLocalIndex = serverDistribution_->getGlobalLocalIndex();                                                              
+      CDistributionServer::GlobalLocalMap::const_iterator itSrvb = globalLocalIndex.begin(),
+                                                          itSrve = globalLocalIndex.end(), itSrv;
+      for (it = itb; it != ite; ++it)
+      {
+        indGlo = it->first;
+        if (globalLocalIndex.end() != globalLocalIndex.find(indGlo)) ++nbWritten;                
+      }
+
+      localIndexToWriteOnClient.resize(nbWritten);  
+      localIndexToWriteOnServer.resize(nbWritten);
+      
+      {
+        numberWrittenIndexes_ = nbWritten;
+        if (isDataDistributed_)
+        {
+          CContextServer* server = CContext::getCurrent()->server;      
+          MPI_Allreduce(&numberWrittenIndexes_, &totalNumberWrittenIndexes_, 1, MPI_INT, MPI_SUM, server->intraComm);
+          MPI_Scan(&numberWrittenIndexes_, &offsetWrittenIndexes_, 1, MPI_INT, MPI_SUM, server->intraComm);
+          offsetWrittenIndexes_ -= numberWrittenIndexes_;
+        }
+        else
+          totalNumberWrittenIndexes_ = numberWrittenIndexes_;
+      }
+
+      nbWritten = 0; 
+      for (it = itb; it != ite; ++it)
+      {
+        indGlo = it->first;
+        itSrv = globalLocalIndex.find(indGlo);
+        if (itSrve != itSrv)
+        {
+          localIndexToWriteOnServer(nbWritten) = itSrv->second;
+          localIndexToWriteOnClient(nbWritten) = it->second;
+          ++nbWritten;                
+        } 
+      }
    }
 
    //---------------------------------------------------------------
+
+   /*
+     Compute the global index and its local index taking account mask and data index.
+     These global indexes will be used to compute the connection of this client (sender) to its servers (receivers)
+     (via function computeConnectedClient)
+     These global indexes also correspond to data sent to servers (if any)
+   */
+   void CGrid::computeClientIndex()
+   {
+     CContext* context = CContext::getCurrent();
+
+     CContextClient* client = context->client;  // Here it's not important which contextClient to recuperate
+     int rank = client->clientRank;
+
+     clientDistribution_ = new CDistributionClient(rank, this);
+     // Get local data index on client
+     storeIndex_client.resize(clientDistribution_->getLocalDataIndexOnClient().size());
+     int nbStoreIndex = storeIndex_client.numElements();
+     for (int idx = 0; idx < nbStoreIndex; ++idx) storeIndex_client(idx) = (clientDistribution_->getLocalDataIndexOnClient())[idx];
+
+     if (0 == serverDistribution_) isDataDistributed_= clientDistribution_->isDataDistributed();
+     else
+     {
+        // Mapping global index received from clients to the storeIndex_client
+        CDistributionClient::GlobalLocalDataMap& globalDataIndex = clientDistribution_->getGlobalDataIndexOnClient();
+        CDistributionClient::GlobalLocalDataMap::const_iterator itGloe = globalDataIndex.end();
+        map<int, CArray<size_t, 1> >::iterator itb = outGlobalIndexFromClient.begin(),
+                                               ite = outGlobalIndexFromClient.end(), it;
+
+        for (it = itb; it != ite; ++it)
+        {
+          int rank = it->first;
+          CArray<size_t,1>& globalIndex = outGlobalIndexFromClient[rank];
+          outLocalIndexStoreOnClient.insert(make_pair(rank, CArray<size_t,1>(globalIndex.numElements())));
+          CArray<size_t,1>& localIndex = outLocalIndexStoreOnClient[rank];
+          size_t nbIndex = 0;
+
+          // Keep this code for this moment but it should be removed (or moved to DEBUG) to improve performance
+          for (size_t idx = 0; idx < globalIndex.numElements(); ++idx)
+          {
+            if (itGloe != globalDataIndex.find(globalIndex(idx)))
+            {
+              ++nbIndex;
+            }
+          }
+
+          if (doGridHaveDataDistributed(client) && (nbIndex != localIndex.numElements()))
+               ERROR("void CGrid::computeClientIndex()",
+                  << "Number of local index on client is different from number of received global index"
+                  << "Rank of sent client " << rank <<"."
+                  << "Number of local index " << nbIndex << ". "
+                  << "Number of received global index " << localIndex.numElements() << ".");
+
+          nbIndex = 0;
+          for (size_t idx = 0; idx < globalIndex.numElements(); ++idx)
+          {
+            if (itGloe != globalDataIndex.find(globalIndex(idx)))
+            {
+              localIndex(idx) = globalDataIndex[globalIndex(idx)];
+            }
+          }
+        }
+      }
+   }
+
+   /*!
+     Compute connected receivers and indexes to be sent to these receivers.
+   */
+   void CGrid::computeConnectedClients()
+   {
+     CContext* context = CContext::getCurrent();
+     int nbSrvPools = (context->clientPrimServer.size() == 0) ? 1 : context->clientPrimServer.size();
+     connectedServerRank_.clear();
+     connectedDataSize_.clear();
+     globalIndexOnServer_.clear();
+     nbSenders.clear();
+
+     for (int p = 0; p < nbSrvPools; ++p)
+     {
+       CContextClient* client = (context->clientPrimServer.size() == 0) ? context->client : context->clientPrimServer[p];
+       int receiverSize = client->serverSize;
+//       connectedServerRank_[client].clear();
+
+       if (connectedServerRank_.find(receiverSize) == connectedServerRank_.end())
+       {
+        if (!doGridHaveDataDistributed(client))
+         {
+            if (client->isServerLeader())
+            {
+              size_t ssize = clientDistribution_->getLocalDataIndexOnClient().size();
+              const std::list<int>& ranks = client->getRanksServerLeader();
+              for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
+              {
+                connectedServerRank_[receiverSize].push_back(*itRank);
+                connectedDataSize_[receiverSize][*itRank] = ssize;
+              }
+            }
+            return;
+         }
+
+         // Compute mapping between client and server
+         std::vector<boost::unordered_map<size_t,std::vector<int> > > indexServerOnElement;
+         CServerDistributionDescription serverDistributionDescription(getGlobalDimension(), client->serverSize);
+         std::vector<int> serverZeroIndex = serverDistributionDescription.computeServerGlobalByElement(indexServerOnElement,
+                                                                                                    client->clientRank,
+                                                                                                    client->clientSize,
+                                                                                                    axis_domain_order,
+                                                                                                    getDistributedDimension());
+
+         // Even if servers have no index, they must received something from client
+         // We only use several client to send "empty" message to these servers
+         std::list<int> serverZeroIndexLeader;
+         std::list<int> serverZeroIndexNotLeader;
+         CContextClient::computeLeader(client->clientRank, client->clientSize, serverZeroIndex.size(), serverZeroIndexLeader, serverZeroIndexNotLeader);
+         for (std::list<int>::iterator it = serverZeroIndexLeader.begin(); it != serverZeroIndexLeader.end(); ++it)
+           *it = serverZeroIndex[*it];
+
+         if (globalIndexOnServer_.find(receiverSize) == globalIndexOnServer_.end())
+           computeIndexByElement(indexServerOnElement, client, globalIndexOnServer_[receiverSize]);
+
+         const CDistributionClient::GlobalLocalDataMap& globalLocalIndexSendToServer = clientDistribution_->getGlobalLocalDataSendToServer();
+         CDistributionClient::GlobalLocalDataMap::const_iterator iteGlobalLocalIndexMap = globalLocalIndexSendToServer.end(), itGlobalLocalIndexMap;
+         CClientServerMapping::GlobalIndexMap::const_iterator iteGlobalMap, itbGlobalMap, itGlobalMap;
+         itbGlobalMap = globalIndexOnServer_[receiverSize].begin();
+         iteGlobalMap = globalIndexOnServer_[receiverSize].end();
+
+         for (itGlobalMap  = itbGlobalMap; itGlobalMap != iteGlobalMap; ++itGlobalMap)
+         {
+           int serverRank = itGlobalMap->first;
+           int indexSize = itGlobalMap->second.size();
+           const std::vector<size_t>& indexVec = itGlobalMap->second;
+           for (int idx = 0; idx < indexSize; ++idx)
+           {
+              itGlobalLocalIndexMap = globalLocalIndexSendToServer.find(indexVec[idx]);
+              if (iteGlobalLocalIndexMap != itGlobalLocalIndexMap)
+              {
+                if (connectedDataSize_[receiverSize].end() == connectedDataSize_[receiverSize].find(serverRank))
+                  connectedDataSize_[receiverSize][serverRank] = 1;
+                else
+                  ++connectedDataSize_[receiverSize][serverRank];
+              }
+           }
+         }
+
+         // Connected servers which really have index
+         for (itGlobalMap = itbGlobalMap; itGlobalMap != iteGlobalMap; ++itGlobalMap) {
+           connectedServerRank_[receiverSize].push_back(itGlobalMap->first);
+         }
+
+         // Connected servers which have no index at all
+         for (std::list<int>::iterator it = serverZeroIndexLeader.begin(); it != serverZeroIndexLeader.end(); ++it)
+           connectedServerRank_[receiverSize].push_back(*it);
+
+         // Even if a client has no index, it must connect to at least one server and
+         // send an "empty" data to this server
+         if (connectedServerRank_[receiverSize].empty())
+          connectedServerRank_[receiverSize].push_back(client->clientRank % client->serverSize);
+
+         nbSenders[receiverSize] = clientServerMap_->computeConnectedClients(receiverSize, client->clientSize, client->intraComm, connectedServerRank_[receiverSize]);
+       }
+     }
+   }
 
    /*!
@@ -503,70 +855,27 @@
    {
      CContext* context = CContext::getCurrent();
-     CContextClient* client = context->client;
-
-     // First of all, compute distribution on client side
-     clientDistribution_ = new CDistributionClient(client->clientRank, this);
-     // Get local data index on client
-     storeIndex_client.resize(clientDistribution_->getLocalDataIndexOnClient().size());
-     int nbStoreIndex = storeIndex_client.numElements();
-     for (int idx = 0; idx < nbStoreIndex; ++idx) storeIndex_client(idx) = (clientDistribution_->getLocalDataIndexOnClient())[idx];
-     isDataDistributed_= clientDistribution_->isDataDistributed();
-
-     connectedServerRank_.clear();
-
-     if (!doGridHaveDataDistributed())
+     if (isScalarGrid())
      {
-        if (client->isServerLeader())
-        {
-          size_t ssize = clientDistribution_->getLocalDataIndexOnClient().size();
-          const std::list<int>& ranks = client->getRanksServerLeader();
-          for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
-          {
-            connectedServerRank_.push_back(*itRank);
-            connectedDataSize_[*itRank] = ssize;
-          }
-        }
-        return;
-     }
-
-     // Compute mapping between client and server
-     std::vector<boost::unordered_map<size_t,std::vector<int> > > indexServerOnElement;
-     CServerDistributionDescription serverDistributionDescription(getGlobalDimension(), client->serverSize);
-     serverDistributionDescription.computeServerGlobalByElement(indexServerOnElement,
-                                                                client->clientRank,
-                                                                client->clientSize,
-                                                                axis_domain_order,
-                                                                getDistributedDimension());
-     computeIndexByElement(indexServerOnElement, globalIndexOnServer_);
-
-     const CDistributionClient::GlobalLocalDataMap& globalLocalIndexSendToServer = clientDistribution_->getGlobalLocalDataSendToServer();
-     CDistributionClient::GlobalLocalDataMap::const_iterator iteGlobalLocalIndexMap = globalLocalIndexSendToServer.end(), itGlobalLocalIndexMap;
-     CClientServerMapping::GlobalIndexMap::const_iterator iteGlobalMap, itbGlobalMap, itGlobalMap;
-     itGlobalMap  = itbGlobalMap = globalIndexOnServer_.begin();
-     iteGlobalMap = globalIndexOnServer_.end();
-
-     for (; itGlobalMap != iteGlobalMap; ++itGlobalMap)
-     {
-       int serverRank = itGlobalMap->first;
-       int indexSize = itGlobalMap->second.size();
-       const std::vector<size_t>& indexVec = itGlobalMap->second;
-       for (int idx = 0; idx < indexSize; ++idx)
+       computeClientIndexScalarGrid();
+       if (context->hasClient)
        {
-          itGlobalLocalIndexMap = globalLocalIndexSendToServer.find(indexVec[idx]);
-          if (iteGlobalLocalIndexMap != itGlobalLocalIndexMap)
-          {
-             if (connectedDataSize_.end() == connectedDataSize_.find(serverRank))
-               connectedDataSize_[serverRank] = 1;
-             else
-               ++connectedDataSize_[serverRank];
-          }
+         computeConnectedClientsScalarGrid();
        }
      }
-
-     for (itGlobalMap = itbGlobalMap; itGlobalMap != iteGlobalMap; ++itGlobalMap) {
-       connectedServerRank_.push_back(itGlobalMap->first);
+     else
+     {
+       computeClientIndex();
+       if (context->hasClient)
+       {
+         computeConnectedClients();
+       }
      }
-
-     nbSenders = clientServerMap_->computeConnectedClients(client->serverSize, client->clientSize, client->intraComm, connectedServerRank_);
+     if (CServer::serverLevel==2)
+     {
+       computeWrittenIndex() ;
+       if (serverDistribution_!=0) serverDistribution_->partialClear() ;
+       if (clientDistribution_!=0) clientDistribution_->partialClear() ;
+       outGlobalIndexFromClient.clear() ;
+     }
    }
 
@@ -577,12 +886,13 @@
       on each element whose size is much smaller than one of whole grid.
       \param [in] indexServerOnElement global index of each element and the rank of server associated with these index
+      \param [in] client contextClient
       \param [out] globalIndexOnServer global index of grid and its corresponding rank of server.
    */
    void CGrid::computeIndexByElement(const std::vector<boost::unordered_map<size_t,std::vector<int> > >& indexServerOnElement,
+                                     const CContextClient* client,
                                      CClientServerMapping::GlobalIndexMap& globalIndexOnServer)
    {
-     CContext* context = CContext::getCurrent();
-     CContextClient* client = context->client;
      int serverSize = client->serverSize;
+
      std::vector<CDomain*> domList = getDomains();
      std::vector<CAxis*> axisList = getAxis();
@@ -667,6 +977,9 @@
        }
 
-       nbIndexOnServer = 0;
-       for (it = itb; it != ite; ++it)
+     nbIndexOnServer = 0;
+     for (size_t j = 0; j < globalIndexElementOnServerMap.size(); ++j)
+     {
+       it = globalIndexElementOnServerMap.find(globalIndexElementOnClient(j));
+       if (it != ite)
        {
          const std::vector<int>& tmp = it->second;
@@ -683,4 +996,5 @@
        }
      }
+   }
 
     // Determine server which contain global source index
@@ -931,4 +1245,5 @@
    }
 
+/*
    void CGrid::outputField(int rank, const CArray<double, 1>& stored, double* field)
    {
@@ -960,5 +1275,5 @@
      }
    }
-
+*/
    //----------------------------------------------------------------
 
@@ -978,223 +1293,281 @@
    }
 
-  void CGrid::computeIndexScalarGrid()
+   void CGrid::uncompressField_arr(const double* const data, CArray<double, 1>& out) const
+   {
+      const std::vector<int>& localMaskedDataIndex = clientDistribution_->getLocalMaskedDataIndexOnClient();
+      const int size = localMaskedDataIndex.size();
+      
+      for(int i = 0; i < size; ++i) out(localMaskedDataIndex[i]) = data[i];
+   }
+
+
+  void CGrid::computeClientIndexScalarGrid()
+  {
+    CContext* context = CContext::getCurrent();    
+//    int nbSrvPools = (context->hasServer) ? (context->hasClient ? context->clientPrimServer.size() : 1) : 1; // This should be changed soon
+//    for (int p = 0; p < nbSrvPools; ++p)
+    {
+//      CContextClient* client = (context->hasServer) ? (context->hasClient ? context->clientPrimServer[p] : context->client)
+//                                                    : context->client;
+      CContextClient* client = context->client;
+
+      int rank = client->clientRank;
+
+      clientDistribution_ = new CDistributionClient(rank, this);
+
+      storeIndex_client.resize(1);
+      storeIndex_client(0) = 0;      
+
+      if (0 != serverDistribution_)
+      {
+        map<int, CArray<size_t, 1> >::iterator itb = outGlobalIndexFromClient.begin(),
+                                               ite = outGlobalIndexFromClient.end(), it;
+        for (it = itb; it != ite; ++it)
+        {
+          int rank = it->first;
+          CArray<size_t,1>& globalIndex = outGlobalIndexFromClient[rank];
+          outLocalIndexStoreOnClient.insert(make_pair(rank, CArray<size_t,1>(globalIndex.numElements())));
+          CArray<size_t,1>& localIndex = outLocalIndexStoreOnClient[rank];
+          if (1 != globalIndex.numElements())
+            ERROR("void CGrid::computeClientIndexScalarGrid()",
+              << "Something wrong happened. "
+              << "Number of received global index on scalar grid should equal to 1" 
+              << "Number of received global index " << globalIndex.numElements() << ".");
+
+          localIndex(0) = globalIndex(0);
+        }
+      }
+    }
+  }
+
+  void CGrid::computeConnectedClientsScalarGrid()
+  {
+    CContext* context = CContext::getCurrent();    
+    int nbSrvPools = (context->clientPrimServer.size()==0) ? 1 : context->clientPrimServer.size();
+    connectedServerRank_.clear();
+    connectedDataSize_.clear();
+    nbSenders.clear();
+
+    for (int p = 0; p < nbSrvPools; ++p)
+    {
+      CContextClient* client = (context->clientPrimServer.size()==0) ? context->client : context->clientPrimServer[p];
+      int receiverSize = client->serverSize;
+
+//      connectedServerRank_[client].clear();
+
+      if (connectedServerRank_.find(receiverSize)==connectedServerRank_.end())
+      {
+        if (client->isServerLeader())
+        {
+          const std::list<int>& ranks = client->getRanksServerLeader();
+          for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
+          {
+            int rank = *itRank;
+            int nb = 1;
+            connectedServerRank_[receiverSize].push_back(rank);
+            connectedDataSize_[receiverSize][rank] = nb;
+            nbSenders[receiverSize][rank] = nb;
+          }
+        }
+        else
+        {
+          const std::list<int>& ranks = client->getRanksServerNotLeader();
+          for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
+          {
+            int rank = *itRank;
+            int nb = 1;
+            connectedServerRank_[receiverSize].push_back(rank);
+            connectedDataSize_[receiverSize][rank] = nb;
+            nbSenders[receiverSize][rank] = nb;
+          }
+        }
+      }
+      isDataDistributed_ = false;
+    }
+  }
+
+  void CGrid::sendIndexScalarGrid()
   {
     CContext* context = CContext::getCurrent();
-    CContextClient* client=context->client;
-
-    storeIndex_client.resize(1);
-    storeIndex_client(0) = 0;
-
-    connectedServerRank_.clear();
-
-    if (0 == client->clientRank)
-    {
-      for (int rank = 0; rank < client->serverSize; ++rank)
-      {
-        connectedServerRank_.push_back(rank);
-        connectedDataSize_[rank] = 1;
-        nbSenders[rank] = 1;
-      }
-    }
-    isDataDistributed_ = false;
-  }
-
-  void CGrid::computeCompressedIndex()
-  {
-    std::map<size_t, size_t> indexes;
-
-    {
-      std::map<int, CArray<size_t,1> >::const_iterator it = outIndexFromClient.begin();
-      std::map<int, CArray<size_t,1> >::const_iterator itEnd = outIndexFromClient.end();
-      for (; it != itEnd; ++it)
-      {
-        for (int i = 0; i < it->second.numElements(); ++i)
-          indexes.insert(std::make_pair(it->second(i), 0));
-
-        compressedOutIndexFromClient[it->first].resize(it->second.numElements());
-      }
-    }
-
-    {
-      std::map<size_t, size_t>::iterator it = indexes.begin();
-      std::map<size_t, size_t>::iterator itEnd = indexes.end();
-      for (size_t i = 0; it != itEnd; ++it, ++i)
-        it->second = i;
-    }
-
-    {
-      std::map<int, CArray<size_t,1> >::iterator it = compressedOutIndexFromClient.begin();
-      std::map<int, CArray<size_t,1> >::iterator itEnd = compressedOutIndexFromClient.end();
-      for (; it != itEnd; ++it)
-      {
-        const CArray<size_t,1>& outIndex = outIndexFromClient[it->first];
-        for (int i = 0; i < it->second.numElements(); ++i)
-          it->second(i) = indexes[outIndex(i)];
-      }
-    }
-  }
-
-  void CGrid::sendIndexScalarGrid()
-  {
-    CContext* context = CContext::getCurrent();
-    CContextClient* client = context->client;
-
-    CEventClient event(getType(), EVENT_ID_INDEX);
-    list<CMessage> listMsg;
-    list<CArray<size_t,1> > listOutIndex;
-
-    if (client->isServerLeader())
-    {
-      const std::list<int>& ranks = client->getRanksServerLeader();
-      for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
-      {
-        int rank = *itRank;
-        int nb = 1;
-        storeIndex_toSrv.insert(std::make_pair(rank, CArray<int,1>(nb)));        
-        listOutIndex.push_back(CArray<size_t,1>(nb));
-
-        CArray<int, 1>& outLocalIndexToServer = storeIndex_toSrv[rank];
-        CArray<size_t, 1>& outGlobalIndexOnServer = listOutIndex.back();
-
-        for (int k = 0; k < nb; ++k)
-        {
-          outGlobalIndexOnServer(k) = 0;
-          outLocalIndexToServer(k)  = 0;
-        }
-
-        storeIndex_fromSrv.insert(std::make_pair(rank, CArray<int,1>(outLocalIndexToServer)));
-        listMsg.push_back(CMessage());
-        listMsg.back() << getId( )<< isDataDistributed_ << isCompressible_ << listOutIndex.back();
-
-        event.push(rank, 1, listMsg.back());
-      }
-      client->sendEvent(event);
-    }
-    else
-    {
-      const std::list<int>& ranks = client->getRanksServerNotLeader();
-      for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
-      {
-        int rank = *itRank;
-        int nb = 1;        
-        storeIndex_fromSrv.insert(std::make_pair(rank, CArray<int,1>(nb)));
-        CArray<int, 1>& outLocalIndexToServer = storeIndex_fromSrv[rank];
-        for (int k = 0; k < nb; ++k)
-        {          
-          outLocalIndexToServer(k)  = 0;
-        }
-      }
-      client->sendEvent(event);
-    }
-  }
-
-  void CGrid::sendIndex(void)
-  {
-    CContext* context = CContext::getCurrent();
-    CContextClient* client = context->client;
-
-    CEventClient event(getType(), EVENT_ID_INDEX);
-    int rank;
-    list<CMessage> listMsg;
-    list<CArray<size_t,1> > listOutIndex;
-    const CDistributionClient::GlobalLocalDataMap& globalLocalIndexSendToServer = clientDistribution_->getGlobalLocalDataSendToServer();
-    CDistributionClient::GlobalLocalDataMap::const_iterator itIndex = globalLocalIndexSendToServer.begin(),
-                                                           iteIndex = globalLocalIndexSendToServer.end();
-
-    if (!doGridHaveDataDistributed())
-    {
+    storeIndex_toSrv.clear();
+    std::list<CContextClient*>::iterator it;
+
+    for (it=clients.begin(); it!=clients.end(); ++it)
+    {
+      CContextClient* client = *it;
+      int receiverSize = client->serverSize;
+
+      CEventClient event(getType(), EVENT_ID_INDEX);
+      list<CMessage> listMsg;
+      list<CArray<size_t,1> > listOutIndex;
+
       if (client->isServerLeader())
       {
-        int indexSize = globalLocalIndexSendToServer.size();
-        CArray<size_t,1> outGlobalIndexOnServer(indexSize);
-        CArray<int,1> outLocalIndexToServer(indexSize);
-        for (int idx = 0; itIndex != iteIndex; ++itIndex, ++idx)
-        {
-          outGlobalIndexOnServer(idx) = itIndex->first;
-          outLocalIndexToServer(idx) = itIndex->second;
-        }
-        
         const std::list<int>& ranks = client->getRanksServerLeader();
         for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
         {
-          storeIndex_toSrv.insert(std::make_pair(*itRank, CArray<int,1>(outLocalIndexToServer)));
-          storeIndex_fromSrv.insert(std::make_pair(*itRank, CArray<int,1>(outLocalIndexToServer)));
-          listOutIndex.push_back(CArray<size_t,1>(outGlobalIndexOnServer));
-
+          int rank = *itRank;
+          int nb = 1;
+          storeIndex_toSrv[client].insert(std::make_pair(rank, CArray<int,1>(nb)));
+          listOutIndex.push_back(CArray<size_t,1>(nb));
+
+          CArray<int, 1>& outLocalIndexToServer = storeIndex_toSrv[client][rank];
+          CArray<size_t, 1>& outGlobalIndexOnServer = listOutIndex.back();
+
+          for (int k = 0; k < nb; ++k)
+          {
+            outGlobalIndexOnServer(k) = 0;
+            outLocalIndexToServer(k)  = 0;
+          }
+
+          if (context->hasClient && !context->hasServer)
+            storeIndex_fromSrv.insert(std::make_pair(rank, CArray<int,1>(outLocalIndexToServer)));
+
+          listMsg.push_back(CMessage());
+          listMsg.back() << getId( )<< isDataDistributed_ << isCompressible_ << listOutIndex.back();
+
+          event.push(rank, 1, listMsg.back());
+        }
+        client->sendEvent(event);
+      }
+      else
+      {
+        const std::list<int>& ranks = client->getRanksServerNotLeader();
+        for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
+        {
+          int rank = *itRank;
+          int nb = 1;          
+          CArray<int, 1> outLocalIndexToServer(nb);
+          for (int k = 0; k < nb; ++k)
+          {
+            outLocalIndexToServer(k)  = 0;
+          }
+
+          if (context->hasClient && !context->hasServer)
+            storeIndex_fromSrv.insert(std::make_pair(rank, CArray<int,1>(outLocalIndexToServer)));
+        }
+        client->sendEvent(event);
+      }
+    }
+  }
+
+  void CGrid::sendIndex(void)
+  {
+    CContext* context = CContext::getCurrent();
+    storeIndex_toSrv.clear();
+    std::list<CContextClient*>::iterator it;
+
+    for (it=clients.begin(); it!=clients.end(); ++it)
+    {
+      CContextClient* client = *it;
+      int receiverSize = client->serverSize;
+
+      CEventClient event(getType(), EVENT_ID_INDEX);
+      int rank;
+      list<CMessage> listMsg;
+      list<CArray<size_t,1> > listOutIndex;
+      const CDistributionClient::GlobalLocalDataMap& globalLocalIndexSendToServer = clientDistribution_->getGlobalLocalDataSendToServer();
+      CDistributionClient::GlobalLocalDataMap::const_iterator itbIndex = globalLocalIndexSendToServer.begin(), itIndex,
+                                                              iteIndex = globalLocalIndexSendToServer.end();
+      itIndex = itbIndex;                                                              
+
+      if (!doGridHaveDataDistributed(client))
+      {
+        if (client->isServerLeader())
+        {
+          int indexSize = globalLocalIndexSendToServer.size();
+          CArray<size_t,1> outGlobalIndexOnServer(indexSize);
+          CArray<int,1> outLocalIndexToServer(indexSize);
+          for (int idx = 0; itIndex != iteIndex; ++itIndex, ++idx)
+          {
+            outGlobalIndexOnServer(idx) = itIndex->first;
+            outLocalIndexToServer(idx) = itIndex->second;
+          }
+
+          const std::list<int>& ranks = client->getRanksServerLeader();
+          for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
+          {
+            storeIndex_toSrv[client].insert(std::make_pair(*itRank, CArray<int,1>(outLocalIndexToServer)));
+            if (context->hasClient && !context->hasServer)
+              storeIndex_fromSrv.insert(std::make_pair(*itRank, CArray<int,1>(outLocalIndexToServer)));
+            
+            listOutIndex.push_back(CArray<size_t,1>(outGlobalIndexOnServer));
+
+            listMsg.push_back(CMessage());
+            listMsg.back() << getId() << isDataDistributed_ << isCompressible_ << listOutIndex.back();
+
+            event.push(*itRank, 1, listMsg.back());
+          }
+          client->sendEvent(event);
+        }
+        else
+        {
+           int indexSize = globalLocalIndexSendToServer.size();
+           CArray<int,1> outLocalIndexToServer(indexSize);
+           for (int idx = 0; itIndex != iteIndex; ++itIndex, ++idx)
+           {
+             outLocalIndexToServer(idx) = itIndex->second;
+           }
+
+           const std::list<int>& ranks = client->getRanksServerNotLeader();
+           for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
+           {
+             storeIndex_fromSrv.insert(std::make_pair(*itRank, CArray<int,1>(outLocalIndexToServer)));
+           }
+           client->sendEvent(event);
+         }
+      }
+      else
+      {
+        CClientServerMapping::GlobalIndexMap::const_iterator iteGlobalMap, itGlobalMap;
+        itGlobalMap = globalIndexOnServer_[receiverSize].begin();
+        iteGlobalMap = globalIndexOnServer_[receiverSize].end();
+
+        std::map<int,std::vector<int> >localIndexTmp;
+        std::map<int,std::vector<size_t> > globalIndexTmp;
+        for (; itGlobalMap != iteGlobalMap; ++itGlobalMap)
+        {
+          int serverRank = itGlobalMap->first;
+          int indexSize = itGlobalMap->second.size();
+          const std::vector<size_t>& indexVec = itGlobalMap->second;
+          for (int idx = 0; idx < indexSize; ++idx)
+          {
+            itIndex = globalLocalIndexSendToServer.find(indexVec[idx]);
+            if (iteIndex != itIndex)
+            {
+              globalIndexTmp[serverRank].push_back(itIndex->first);
+              localIndexTmp[serverRank].push_back(itIndex->second);
+            }
+          }
+        }
+
+        for (int ns = 0; ns < connectedServerRank_[receiverSize].size(); ++ns)
+        {
+          rank = connectedServerRank_[receiverSize][ns];
+          int nb = 0;
+          if (globalIndexTmp.end() != globalIndexTmp.find(rank))
+            nb = globalIndexTmp[rank].size();
+
+          storeIndex_toSrv[client].insert(make_pair(rank, CArray<int,1>(nb)));
+          listOutIndex.push_back(CArray<size_t,1>(nb));
+
+          CArray<int, 1>& outLocalIndexToServer = storeIndex_toSrv[client][rank];
+          CArray<size_t, 1>& outGlobalIndexOnServer = listOutIndex.back();
+
+          for (int k = 0; k < nb; ++k)
+          {
+            outGlobalIndexOnServer(k) = globalIndexTmp[rank].at(k);
+            outLocalIndexToServer(k)  = localIndexTmp[rank].at(k);
+          }
+
+          storeIndex_fromSrv.insert(make_pair(rank, CArray<int,1>(outLocalIndexToServer)));
           listMsg.push_back(CMessage());
           listMsg.back() << getId() << isDataDistributed_ << isCompressible_ << listOutIndex.back();
 
-          event.push(*itRank, 1, listMsg.back());
-        }
+          event.push(rank, nbSenders[receiverSize][rank], listMsg.back());
+        }
+
         client->sendEvent(event);
       }
-      else 
-      {
-        int indexSize = globalLocalIndexSendToServer.size();        
-        CArray<int,1> outLocalIndexToServer(indexSize);
-        for (int idx = 0; itIndex != iteIndex; ++itIndex, ++idx)
-        {          
-          outLocalIndexToServer(idx) = itIndex->second;
-        }
-        
-        const std::list<int>& ranks = client->getRanksServerNotLeader();
-        for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
-        {          
-          storeIndex_fromSrv.insert(std::make_pair(*itRank, CArray<int,1>(outLocalIndexToServer)));
-        }
-        client->sendEvent(event);
-      }
-    }
-    else
-    {
-      CClientServerMapping::GlobalIndexMap::const_iterator iteGlobalMap, itGlobalMap;
-      itGlobalMap = globalIndexOnServer_.begin();
-      iteGlobalMap = globalIndexOnServer_.end();
-
-      std::map<int,std::vector<int> >localIndexTmp;
-      std::map<int,std::vector<size_t> > globalIndexTmp;
-      for (; itGlobalMap != iteGlobalMap; ++itGlobalMap)
-      {
-        int serverRank = itGlobalMap->first;
-        int indexSize = itGlobalMap->second.size();
-        const std::vector<size_t>& indexVec = itGlobalMap->second;
-        for (int idx = 0; idx < indexSize; ++idx)
-        {
-          itIndex = globalLocalIndexSendToServer.find(indexVec[idx]);
-          if (iteIndex != itIndex)
-          {
-            globalIndexTmp[serverRank].push_back(itIndex->first);
-            localIndexTmp[serverRank].push_back(itIndex->second);
-          }
-        }
-      }
-
-      for (int ns = 0; ns < connectedServerRank_.size(); ++ns)
-      {
-        rank = connectedServerRank_[ns];
-        int nb = 0;
-        if (globalIndexTmp.end() != globalIndexTmp.find(rank))
-          nb = globalIndexTmp[rank].size();
-
-        storeIndex_toSrv.insert(make_pair(rank, CArray<int,1>(nb)));        
-        listOutIndex.push_back(CArray<size_t,1>(nb));
-
-        CArray<int, 1>& outLocalIndexToServer = storeIndex_toSrv[rank];
-        CArray<size_t, 1>& outGlobalIndexOnServer = listOutIndex.back();
-
-        for (int k = 0; k < nb; ++k)
-        {
-          outGlobalIndexOnServer(k) = globalIndexTmp[rank].at(k);
-          outLocalIndexToServer(k)  = localIndexTmp[rank].at(k);
-        }
-
-        storeIndex_fromSrv.insert(make_pair(rank, CArray<int,1>(outLocalIndexToServer)));
-        listMsg.push_back(CMessage());
-        listMsg.back() << getId() << isDataDistributed_ << isCompressible_ << listOutIndex.back();
-
-        event.push(rank, nbSenders[rank], listMsg.back());
-      }
-
-      client->sendEvent(event);
     }
   }
@@ -1220,133 +1593,213 @@
   {
     CContext* context = CContext::getCurrent();
-    CContextServer* server = context->server;
-    numberWrittenIndexes_ = totalNumberWrittenIndexes_ = offsetWrittenIndexes_ = 0;
-    connectedServerRank_ = ranks;
-
-    for (int n = 0; n < ranks.size(); n++)
-    {
-      int rank = ranks[n];
-      CBufferIn& buffer = *buffers[n];
-
-      buffer >> isDataDistributed_ >> isCompressible_;
-      size_t dataSize = 0;
-
-      if (0 == serverDistribution_)
-      {
-        int idx = 0, numElement = axis_domain_order.numElements();
-        int ssize = numElement;
-        std::vector<int> indexMap(numElement);
-        for (int i = 0; i < numElement; ++i)
-        {
-          indexMap[i] = idx;
-          if (2 == axis_domain_order(i))
+    connectedServerRankRead_ = ranks;
+
+    int nbSrvPools = (context->hasServer) ? (context->hasClient ? context->clientPrimServer.size() : 1) : 1;
+    nbSrvPools = 1;    
+    nbReadSenders.clear();
+    for (int p = 0; p < nbSrvPools; ++p)
+    {
+      CContextServer* server = (!context->hasClient) ? context->server : context->serverPrimServer[p];
+      CContextClient* client = context->client;   //(!context->hasClient) ? context->client : context->clientPrimServer[p];
+      
+      int idx = 0, numElement = axis_domain_order.numElements();
+      int ssize = numElement;
+      std::vector<int> indexMap(numElement);
+      for (int i = 0; i < numElement; ++i)
+      {
+        indexMap[i] = idx;
+        if (2 == axis_domain_order(i))
+        {
+          ++ssize;
+          idx += 2;
+        }
+        else
+          ++idx;
+      }
+
+      for (int n = 0; n < ranks.size(); n++)
+      {
+        int rank = ranks[n];
+        CBufferIn& buffer = *buffers[n];
+
+        buffer >> isDataDistributed_ >> isCompressible_;
+        size_t dataSize = 0;
+
+        if (0 == serverDistribution_)
+        {
+          int axisId = 0, domainId = 0, scalarId = 0, globalSize = 1;
+          std::vector<CDomain*> domainList = getDomains();
+          std::vector<CAxis*> axisList = getAxis();
+          std::vector<int> nZoomBegin(ssize), nZoomSize(ssize), nGlob(ssize), nZoomBeginGlobal(ssize), nGlobElement(numElement);
+          std::vector<CArray<int,1> > globalZoomIndex(numElement);
+          for (int i = 0; i < numElement; ++i)
           {
-            ++ssize;
-            idx += 2;
+            nGlobElement[i] = globalSize;
+            if (2 == axis_domain_order(i)) //domain
+            {
+              nZoomBegin[indexMap[i]] = domainList[domainId]->zoom_ibegin;
+              nZoomSize[indexMap[i]]  = domainList[domainId]->zoom_ni;
+              nZoomBeginGlobal[indexMap[i]] = domainList[domainId]->global_zoom_ibegin;              
+              nGlob[indexMap[i]] = domainList[domainId]->ni_glo;
+
+              nZoomBegin[indexMap[i] + 1] = domainList[domainId]->zoom_jbegin;
+              nZoomSize[indexMap[i] + 1] = domainList[domainId]->zoom_nj;
+              nZoomBeginGlobal[indexMap[i] + 1] = domainList[domainId]->global_zoom_jbegin;              
+              nGlob[indexMap[i] + 1] = domainList[domainId]->nj_glo;
+
+              {
+                int count = 0;
+                globalZoomIndex[i].resize(nZoomSize[indexMap[i]]*nZoomSize[indexMap[i]+1]);
+                for (int jdx = 0; jdx < nZoomSize[indexMap[i]+1]; ++jdx)
+                  for (int idx = 0; idx < nZoomSize[indexMap[i]]; ++idx)                
+                  {
+                    globalZoomIndex[i](count) = (nZoomBegin[indexMap[i]] + idx) + (nZoomBegin[indexMap[i]+1] + jdx) * nGlob[indexMap[i]];
+                    ++count;
+                  }
+              }
+
+              ++domainId;
+            }
+            else if (1 == axis_domain_order(i)) // axis
+            {
+              nZoomBegin[indexMap[i]] = axisList[axisId]->zoom_begin;
+              nZoomSize[indexMap[i]]  = axisList[axisId]->zoom_n;
+              nZoomBeginGlobal[indexMap[i]] = axisList[axisId]->global_zoom_begin;              
+              nGlob[indexMap[i]] = axisList[axisId]->n_glo;     
+              if (axisList[axisId]->zoomByIndex())
+              {
+                globalZoomIndex[i].reference(axisList[axisId]->zoom_index);                
+              }
+              else
+              {
+                globalZoomIndex[i].resize(nZoomSize[indexMap[i]]);
+                for (int idx = 0; idx < nZoomSize[indexMap[i]]; ++idx)
+                  globalZoomIndex[i](idx) = nZoomBegin[indexMap[i]] + idx;
+              }
+
+              ++axisId;
+            }
+            else // scalar
+            { 
+              nZoomBegin[indexMap[i]] = 0;
+              nZoomSize[indexMap[i]]  = 1;
+              nZoomBeginGlobal[indexMap[i]] = 0;              
+              nGlob[indexMap[i]] = 1;
+              globalZoomIndex[i].resize(1);
+              globalZoomIndex[i](0) = 0;
+              ++scalarId;
+            }
           }
-          else
-            ++idx;
-        }
-
-        int axisId = 0, domainId = 0, scalarId = 0;
+          dataSize = 1;
+
+          for (int i = 0; i < nZoomSize.size(); ++i)
+            dataSize *= nZoomSize[i];
+          serverDistribution_ = new CDistributionServer(server->intraCommRank, 
+                                                        globalZoomIndex, axis_domain_order,
+                                                        nZoomBegin, nZoomSize, nZoomBeginGlobal, nGlob);
+        }
+
+        CArray<size_t,1> outIndex;
+        buffer >> outIndex;
+        outGlobalIndexFromClient.insert(std::make_pair(rank, outIndex));
+        connectedDataSizeRead_[rank] = outIndex.numElements();
+
+        if (doGridHaveDataDistributed(client))
+        {}
+        else
+        {
+          // THE PROBLEM HERE IS THAT DATA CAN BE NONDISTRIBUTED ON CLIENT AND DISTRIBUTED ON SERVER
+          // BELOW IS THE TEMPORARY FIX only for a single type of element (domain, asix, scalar)
+          dataSize = serverDistribution_->getGridSize();
+        }
+        writtenDataSize_ += dataSize;
+      }
+
+
+      // Compute mask of the current grid
+      {
+        int axisId = 0, domainId = 0, scalarId = 0, globalSize = 1;
         std::vector<CDomain*> domainList = getDomains();
         std::vector<CAxis*> axisList = getAxis();
-        std::vector<int> nZoomBegin(ssize), nZoomSize(ssize), nGlob(ssize), nZoomBeginGlobal(ssize);
-        std::vector<CArray<int,1> > globalZoomIndex(numElement);
+        int dimSize = 2 * domainList.size() + axisList.size();
+        std::vector<int> nBegin(dimSize), nSize(dimSize), nGlob(dimSize), nBeginGlobal(dimSize);        
         for (int i = 0; i < numElement; ++i)
-        {
+        {          
           if (2 == axis_domain_order(i)) //domain
           {
-            nZoomBegin[indexMap[i]] = domainList[domainId]->zoom_ibegin_srv;
-            nZoomSize[indexMap[i]]  = domainList[domainId]->zoom_ni_srv;
-            nZoomBeginGlobal[indexMap[i]] = domainList[domainId]->global_zoom_ibegin;
+            nBegin[indexMap[i]] = domainList[domainId]->ibegin;
+            nSize[indexMap[i]]  = domainList[domainId]->ni;
+            nBeginGlobal[indexMap[i]] = 0;              
             nGlob[indexMap[i]] = domainList[domainId]->ni_glo;
 
-            nZoomBegin[indexMap[i] + 1] = domainList[domainId]->zoom_jbegin_srv;
-            nZoomSize[indexMap[i] + 1] = domainList[domainId]->zoom_nj_srv;
-            nZoomBeginGlobal[indexMap[i] + 1] = domainList[domainId]->global_zoom_jbegin;
+            nBegin[indexMap[i] + 1] = domainList[domainId]->jbegin;
+            nSize[indexMap[i] + 1] = domainList[domainId]->nj;
+            nBeginGlobal[indexMap[i] + 1] = 0;              
             nGlob[indexMap[i] + 1] = domainList[domainId]->nj_glo;
 
-            {
-              int count = 0;
-              globalZoomIndex[i].resize(nZoomSize[indexMap[i]]*nZoomSize[indexMap[i]+1]);
-              for (int jdx = 0; jdx < nZoomSize[indexMap[i]+1]; ++jdx)
-                for (int idx = 0; idx < nZoomSize[indexMap[i]]; ++idx)                
-                {
-                  globalZoomIndex[i](count) = (nZoomBegin[indexMap[i]] + idx) + (nZoomBegin[indexMap[i]+1] + jdx) * nGlob[indexMap[i]];
-                  ++count;
-                }
-            }
             ++domainId;
           }
           else if (1 == axis_domain_order(i)) // axis
           {
-            nZoomBegin[indexMap[i]] = axisList[axisId]->zoom_begin_srv;
-            nZoomSize[indexMap[i]]  = axisList[axisId]->zoom_size_srv;
-            nZoomBeginGlobal[indexMap[i]] = axisList[axisId]->global_zoom_begin_srv;
-            nGlob[indexMap[i]] = axisList[axisId]->n_glo;
-            if (!axisList[axisId]->global_zoom_index.isEmpty())
-            {
-              globalZoomIndex[i].reference(axisList[axisId]->zoom_index_srv);                
-            }
-            else
-            {
-              globalZoomIndex[i].resize(nZoomSize[indexMap[i]]);
-              for (int idx = 0; idx < nZoomSize[indexMap[i]]; ++idx)
-                globalZoomIndex[i](idx) = nZoomBegin[indexMap[i]] + idx;
-            }
-            
+            nBegin[indexMap[i]] = axisList[axisId]->begin;
+            nSize[indexMap[i]]  = axisList[axisId]->n;
+            nBeginGlobal[indexMap[i]] = 0;              
+            nGlob[indexMap[i]] = axisList[axisId]->n_glo;              
             ++axisId;
           }
           else // scalar
+          {  
+          }
+        }
+        
+        if (nSize.empty()) // Scalar grid
+        {
+          nBegin.push_back(0);
+          nSize.push_back(1);
+          nBeginGlobal.push_back(0);              
+          nGlob.push_back(1);  
+        }
+
+        modifyMaskSize(nSize, false);
+
+        // These below codes are reserved for future
+        CDistributionServer srvDist(server->intraCommRank, nBegin, nSize, nBeginGlobal, nGlob); 
+        map<int, CArray<size_t, 1> >::iterator itb = outGlobalIndexFromClient.begin(),
+                                               ite = outGlobalIndexFromClient.end(), it;  
+        const CDistributionServer::GlobalLocalMap&  globalLocalMask = srvDist.getGlobalLocalIndex();
+        CDistributionServer::GlobalLocalMap::const_iterator itSrv;
+        size_t nb = 0;
+        for (it = itb; it != ite; ++it)
+        {
+          CArray<size_t,1>& globalInd = it->second;
+          for (size_t idx = 0; idx < globalInd.numElements(); ++idx)
           {
-            nZoomBegin[indexMap[i]] = 0;
-            nZoomSize[indexMap[i]]  = 1;
-            nZoomBeginGlobal[indexMap[i]] = 0;
-            nGlob[indexMap[i]] = 1;
-            globalZoomIndex[i].resize(1);
-            globalZoomIndex[i](0) = 0;
-            ++scalarId;
+            if (globalLocalMask.end() != globalLocalMask.find(globalInd(idx))) ++nb;
           }
         }
-        dataSize = 1;
-        for (int i = 0; i < nZoomSize.size(); ++i)
-          dataSize *= nZoomSize[i];
-
-/*        serverDistribution_ = new CDistributionServer(server->intraCommRank, nZoomBegin, nZoomSize,
-                                                      nZoomBeginGlobal, nGlob);*/
-        serverDistribution_ = new CDistributionServer(server->intraCommRank, 
-                                                      globalZoomIndex, axis_domain_order,
-                                                      nZoomBegin, nZoomSize, nZoomBeginGlobal, nGlob);
-      }
-
-      CArray<size_t,1> outIndex;
-      buffer >> outIndex;
-      if (isDataDistributed_)
-        serverDistribution_->computeLocalIndex(outIndex);
-      else
-      {
-        dataSize = outIndex.numElements();
-        for (int i = 0; i < outIndex.numElements(); ++i) outIndex(i) = i;
-      }
-      writtenDataSize_ += dataSize;
-      
-      outIndexFromClient.insert(std::make_pair(rank, outIndex));
-      connectedDataSize_[rank] = outIndex.numElements();
-      numberWrittenIndexes_ += outIndex.numElements();
-    }
-
-    // if (isScalarGrid()) return;
-
-    if (isDataDistributed_)
-    {
-      MPI_Allreduce(&numberWrittenIndexes_, &totalNumberWrittenIndexes_, 1, MPI_INT, MPI_SUM, server->intraComm);
-      MPI_Scan(&numberWrittenIndexes_, &offsetWrittenIndexes_, 1, MPI_INT, MPI_SUM, server->intraComm);
-      offsetWrittenIndexes_ -= numberWrittenIndexes_;
-    }
-    else
-      totalNumberWrittenIndexes_ = numberWrittenIndexes_;
-
-    nbSenders = CClientServerMappingDistributed::computeConnectedClients(context->client->serverSize, context->client->clientSize, context->client->intraComm, ranks);
+        
+        CArray<int,1> indexToModify(nb);
+        nb = 0;    
+        for (it = itb; it != ite; ++it)
+        {
+          CArray<size_t,1>& globalInd = it->second;
+          for (size_t idx = 0; idx < globalInd.numElements(); ++idx)
+          {
+            itSrv = globalLocalMask.find(globalInd(idx));
+            if (globalLocalMask.end() != itSrv) 
+            {
+              indexToModify(nb) = itSrv->second;
+              ++nb;
+            }
+          }
+        }
+
+        modifyMask(indexToModify, true);
+      }
+
+      if (isScalarGrid()) return;
+
+      nbReadSenders[client] = CClientServerMappingDistributed::computeConnectedClients(context->client->serverSize, context->client->clientSize, context->client->intraComm, ranks);
+    }
   }
 
@@ -1366,5 +1819,6 @@
                                         const CArray<int,1>& axisDomainOrder)
   {
-    globalDim.resize(domains.size()*2+axis.size()+scalars.size());
+ //   globalDim.resize(domains.size()*2+axis.size()+scalars.size());
+    globalDim.resize(domains.size()*2+axis.size());
     int positionDimensionDistributed = 1;
     int idx = 0, idxDomain = 0, idxAxis = 0, idxScalar = 0;
@@ -1396,7 +1850,7 @@
       else
       {
-        globalDim[idx] = 1;
+//        globalDim[idx] = 1;
         ++idxScalar;
-        ++idx;
+//        ++idx;
       }
     }
@@ -1484,9 +1938,13 @@
   }
 
-  bool CGrid::doGridHaveDataDistributed()
+  bool CGrid::doGridHaveDataDistributed(CContextClient* client)
   {
     if (isScalarGrid()) return false;
+    else if (0 != client)
+    {
+      return  (isDataDistributed_ ||  (1 != client->clientSize) || (1 != client->serverSize));
+    }
     else
-      return isDataDistributed_;
+      return isDataDistributed_;    
   }
 
@@ -1583,23 +2041,5 @@
    void CGrid::sendAddDomain(const string& id)
    {
-    CContext* context=CContext::getCurrent();
-
-    if (! context->hasServer )
-    {
-       CContextClient* client=context->client;
-
-       CEventClient event(this->getType(),EVENT_ID_ADD_DOMAIN);
-       if (client->isServerLeader())
-       {
-         CMessage msg;
-         msg<<this->getId();
-         msg<<id;
-         const std::list<int>& ranks = client->getRanksServerLeader();
-         for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
-           event.push(*itRank,1,msg);
-         client->sendEvent(event);
-       }
-       else client->sendEvent(event);
-    }
+      sendAddItem(id, (int)EVENT_ID_ADD_DOMAIN);
    }
 
@@ -1610,23 +2050,5 @@
    void CGrid::sendAddAxis(const string& id)
    {
-    CContext* context=CContext::getCurrent();
-
-    if (! context->hasServer )
-    {
-       CContextClient* client=context->client;
-
-       CEventClient event(this->getType(),EVENT_ID_ADD_AXIS);
-       if (client->isServerLeader())
-       {
-         CMessage msg;
-         msg<<this->getId();
-         msg<<id;
-         const std::list<int>& ranks = client->getRanksServerLeader();
-         for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
-           event.push(*itRank,1,msg);
-         client->sendEvent(event);
-       }
-       else client->sendEvent(event);
-    }
+      sendAddItem(id, (int)EVENT_ID_ADD_AXIS);
    }
 
@@ -1637,23 +2059,5 @@
    void CGrid::sendAddScalar(const string& id)
    {
-    CContext* context=CContext::getCurrent();
-
-    if (! context->hasServer )
-    {
-       CContextClient* client=context->client;
-
-       CEventClient event(this->getType(),EVENT_ID_ADD_SCALAR);
-       if (client->isServerLeader())
-       {
-         CMessage msg;
-         msg<<this->getId();
-         msg<<id;
-         const std::list<int>& ranks = client->getRanksServerLeader();
-         for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
-           event.push(*itRank,1,msg);
-         client->sendEvent(event);
-       }
-       else client->sendEvent(event);
-    }
+      sendAddItem(id, (int)EVENT_ID_ADD_SCALAR);
    }
 
@@ -1746,5 +2150,5 @@
     {
       CDomain* pDom = CDomain::get(*it);
-      if (context->hasClient)
+      if (context->hasClient && !context->hasServer)      
       {
         pDom->solveRefInheritance(apply);
@@ -1758,5 +2162,5 @@
     {
       CAxis* pAxis = CAxis::get(*it);
-      if (context->hasClient)
+      if (context->hasClient && !context->hasServer)
       {
         pAxis->solveRefInheritance(apply);
@@ -1770,5 +2174,5 @@
     {
       CScalar* pScalar = CScalar::get(*it);
-      if (context->hasClient)
+      if (context->hasClient && !context->hasServer)
       {
         pScalar->solveRefInheritance(apply);
@@ -2145,4 +2549,17 @@
   }
 
+  void CGrid::setContextClient(CContextClient* contextClient)
+  {
+    if (clientsSet.find(contextClient)==clientsSet.end())
+    {
+      clients.push_back(contextClient) ;
+      clientsSet.insert(contextClient);
+    }
+    for (int i=0; i<this->getDomains().size(); i++)
+    	this->getDomains()[i]->setContextClient(contextClient);
+    for (int i=0; i<this->getAxis().size(); i++)
+    	this->getAxis()[i]->setContextClient(contextClient);
+  }
+
   /*!
     Parse a grid, for now, it contains only domain, axis and scalar
Index: /XIOS/trunk/src/node/grid.hpp
===================================================================
--- /XIOS/trunk/src/node/grid.hpp	(revision 1536)
+++ /XIOS/trunk/src/node/grid.hpp	(revision 1537)
@@ -19,5 +19,5 @@
 namespace xios {
 
-   /// ////////////////////// DÃ©clarations ////////////////////// ///
+   /// ////////////////////// Dï¿œï¿œclarations ////////////////////// ///
 
    class CGridGroup;
@@ -91,14 +91,11 @@
          StdSize  getDataSize(void) const;
 
-         /// EntrÃ©es-sorties de champs ///
+         /// Entrï¿œï¿œes-sorties de champs
          template <int n>
          void inputField(const CArray<double,n>& field, CArray<double,1>& stored) const;
          template <int n>
-         void outputField(const CArray<double,1>& stored, CArray<double,n>& field) const;
-
-         void outputField(int rank, const CArray<double,1>& stored, double* field);
-         void inputField(int rank, const double* const field, CArray<double,1>& stored);
-
-         void outputCompressedField(int rank, const CArray<double,1>& stored, double* field);
+         void outputField(const CArray<double,1>& stored, CArray<double,n>& field) const;  
+         template <int n>
+         void uncompressField(const CArray<double,n>& data, CArray<double,1>& outData) const; 
 
          virtual void parse(xml::CXMLNode& node);
@@ -129,15 +126,9 @@
          static CGrid* cloneGrid(const StdString& idNewGrid, CGrid* gridSrc);
 
-      public:
-
-         /// EntrÃ©es-sorties de champs (interne) ///
-         void storeField_arr(const double* const data, CArray<double,1>& stored) const;
-         void restoreField_arr(const CArray<double,1>& stored, double* const data) const;
-
-         /// Traitements protÃ©gÃ©s ///
+      public:            
          void computeIndexServer(void);
          void computeIndex(void);
          void computeIndexScalarGrid();
-         void computeCompressedIndex();
+         void computeWrittenIndex();
 
          void solveDomainRef(bool checkAtt);
@@ -171,8 +162,10 @@
          void sendIndexScalarGrid();
 
+         void setContextClient(CContextClient* contextClient);
+
          void computeDomConServer();
          std::map<int, int> getDomConServerSide();
-         std::map<int, StdSize> getAttributesBufferSize();
-         std::map<int, StdSize> getDataBufferSize(const std::string& id = "");
+         std::map<int, StdSize> getAttributesBufferSize(CContextClient* client, bool bufferForWriting = false);
+         std::map<int, StdSize> getDataBufferSize(CContextClient* client, const std::string& id = "", bool bufferForWriting = false);
          std::vector<StdString> getDomainList();
          std::vector<StdString> getAxisList();
@@ -186,9 +179,8 @@
          std::vector<int> getAxisOrder();
          std::vector<int> getGlobalDimension();
-         bool isScalarGrid() const;
-         std::vector<int> getAxisPositionInGrid() const;
+         bool isScalarGrid() const;         
 
          bool doGridHaveDataToWrite();
-         bool doGridHaveDataDistributed();
+         bool doGridHaveDataDistributed(CContextClient* client = 0);
          size_t getWrittenDataSize() const;
          int getNumberWrittenIndexes() const;
@@ -210,22 +202,58 @@
          std::map<CGrid*, std::pair<bool,StdString> >& getTransGridSource();
          bool hasTransform();
-
+         size_t getGlobalWrittenSize(void) ;
+         void getLocalMask(CArray<bool,1>& localMask) ;
+         template<int N>
+         void getLocalMask(const CArray<bool,N>& gridMask, CArray<bool,1>& localMask) ;
       public:
-
-         /// PropriÃ©tÃ©s privÃ©es ///
-         bool isChecked;
-         bool isDomainAxisChecked;
-         bool isIndexSent;
-
          CArray<int, 1> storeIndex_client;
 
-         map<int, CArray<int, 1> > storeIndex_toSrv;
-         map<int, CArray<int, 1> > storeIndex_fromSrv;
-         map<int,int> nbSenders;
-
-         map<int, CArray<size_t, 1> > outIndexFromClient, compressedOutIndexFromClient;
+/** Map containing indexes that will be sent in sendIndex(). */
+         std::map<CContextClient*, map<int, CArray<int, 1> > > storeIndex_toSrv;
+
+/** Map storing the number of senders. Key = size of receiver's intracomm */
+         std::map<int, std::map<int,int> > nbSenders;
+
+         std::map<CContextClient*, std::map<int,int> > nbReadSenders;
+
+         map<int, CArray<int, 1> > storeIndex_fromSrv; // Support, for now, reading with level-1 server
+
+         map<int, CArray<size_t, 1> > outIndexFromClient;  // Deprecated
+
+         map<int, CArray<size_t, 1> > compressedOutIndexFromClient;
+
+/** Map storing received indexes. Key = sender rank, value = index array. */
+         map<int, CArray<size_t, 1> > outGlobalIndexFromClient;
+
+// Manh Ha's comment: " A client receives global index from other clients (via recvIndex)
+// then does mapping these index into local index of STORE_CLIENTINDEX
+// In this way, store_clientIndex can be used as an input of a source filter
+// Maybe we need a flag to determine whether a client wants to write. TODO "
+
+/** Map storing received data. Key = sender rank, value = data array.
+ *  The map is created in CGrid::computeClientIndex and filled upon receiving data in CField::recvUpdateData() */
+         map<int, CArray<size_t, 1> > outLocalIndexStoreOnClient; 
+
+/** Indexes calculated based on server-like distribution.
+ *  They are used for writing/reading data and only calculated for server level that does the writing/reading.
+ *  Along with localIndexToWriteOnClient, these indexes are used to correctly place incoming data. */
+         CArray<size_t,1> localIndexToWriteOnServer;
+
+/** Indexes calculated based on client-like distribution.
+ *  They are used for writing/reading data and only calculated for server level that does the writing/reading.
+ *  Along with localIndexToWriteOnServer, these indexes are used to correctly place incoming data. */
+         CArray<size_t,1> localIndexToWriteOnClient;
+
+         CArray<size_t,1> indexFromClients;
+
          void checkMask(void);
          void createMask(void);
-         void modifyMask(const CArray<int,1>& indexToModify);
+         void modifyMask(const CArray<int,1>& indexToModify, bool valueToModify = false);
+         void modifyMaskSize(const std::vector<int>& newDimensionSize, bool newValue = false);
+
+         void computeGridGlobalDimension(const std::vector<CDomain*>& domains,
+                                         const std::vector<CAxis*>& axis,
+                                         const std::vector<CScalar*>& scalars,
+                                         const CArray<int,1>& axisDomainOrder);
 
       private:
@@ -237,5 +265,12 @@
                           bool createMask = false);
         template<int N>
-        void modifyGridMask(CArray<bool,N>& gridMask, const CArray<int,1>& indexToModify);
+        void modifyGridMask(CArray<bool,N>& gridMask, const CArray<int,1>& indexToModify, bool valueToModify);
+
+        template<int N>
+        void modifyGridMaskSize(CArray<bool,N>& gridMask, const std::vector<int>& eachDimSize, bool newValue);
+
+        void storeField_arr(const double* const data, CArray<double, 1>& stored) const;
+        void restoreField_arr(const CArray<double, 1>& stored, double* const data) const;
+        void uncompressField_arr(const double* const data, CArray<double, 1>& outData) const;
 
         void setVirtualDomainGroup(CDomainGroup* newVDomainGroup);
@@ -254,6 +289,6 @@
         void setTransformationAlgorithms();
         void computeIndexByElement(const std::vector<boost::unordered_map<size_t,std::vector<int> > >& indexServerOnElement,
+                                   const CContextClient* client,
                                    CClientServerMapping::GlobalIndexMap& globalIndexOnServer);
-
         int computeGridGlobalDimension(std::vector<int>& globalDim,
                                        const std::vector<CDomain*> domains,
@@ -261,7 +296,21 @@
                                        const std::vector<CScalar*> scalars,
                                        const CArray<int,1>& axisDomainOrder);
-
         int getDistributedDimension();
+
+        void computeClientIndex();
+        void computeConnectedClients();
+        void computeClientIndexScalarGrid(); 
+        void computeConnectedClientsScalarGrid(); 
+
       private:
+
+/** Clients that have to send a grid. There can be multiple clients in case of secondary server, otherwise only one client. */
+        std::list<CContextClient*> clients;
+        std::set<CContextClient*> clientsSet;
+
+        bool isChecked;
+        bool isDomainAxisChecked;
+        bool isIndexSent;
+
         CDomainGroup* vDomainGroup_;
         CAxisGroup* vAxisGroup_;
@@ -270,19 +319,35 @@
         bool isAxisListSet, isDomListSet, isScalarListSet;
 
+/** Client-like distribution calculated based on the knowledge of the entire grid */
         CDistributionClient* clientDistribution_;
+
+/** Server-like distribution calculated upon receiving indexes */
         CDistributionServer* serverDistribution_;
+
         CClientServerMapping* clientServerMap_;
         size_t writtenDataSize_;
         int numberWrittenIndexes_, totalNumberWrittenIndexes_, offsetWrittenIndexes_;
-        std::map<int,size_t> connectedDataSize_;
-        std::vector<int> connectedServerRank_;
-        bool isDataDistributed_;
-        
+
+/** Map storing local ranks of connected receivers. Key = size of receiver's intracomm.
+  * It is calculated in computeConnectedClients(). */
+        std::map<int, std::vector<int> > connectedServerRank_;
+
+/** Map storing the size of data to be send. Key = size of receiver's intracomm
+  * It is calculated in computeConnectedClients(). */
+        std::map<int, std::map<int,size_t> > connectedDataSize_;
+
+/** Ranks of connected receivers in case of reading. It is calculated in recvIndex(). */
+        std::vector<int> connectedServerRankRead_;
+
+/** Size of data to be send in case of reading. It is calculated in recvIndex(). */
+        std::map<int,size_t> connectedDataSizeRead_;
+
+        bool isDataDistributed_;        
          //! True if and only if the data defined on the grid can be outputted in a compressed way
         bool isCompressible_;
         std::set<std::string> relFilesCompressed;
 
-        bool isTransformed_;
-        bool isGenerated_;
+        bool isTransformed_, isGenerated_;
+        bool computedWrittenIndex_;
         std::vector<int> axisPositionInGrid_;
         CGridTransformation* transformations_;
@@ -290,7 +355,15 @@
         std::map<CGrid*, std::pair<bool,StdString> > gridSrc_;
         bool hasTransform_;
-        CClientServerMapping::GlobalIndexMap globalIndexOnServer_;
-            // List order of axis and domain in a grid, if there is a domain, it will take value 1 (true), axis 0 (false)
+
+/** Map storing global indexes of server-like (band-wise) distribution for sending to receivers.
+  * Key = size of receiver's intracomm.
+  */
+//        std::map<CContextClient*, CClientServerMapping::GlobalIndexMap> globalIndexOnServer_;
+        std::map<int, CClientServerMapping::GlobalIndexMap> globalIndexOnServer_;
+
+
+/** List order of axis and domain in a grid, if there is a domain, it will take value 1 (true), axis 0 (false) */
         std::vector<int> order_;
+
    }; // class CGrid
 
@@ -300,4 +373,5 @@
    void CGrid::inputField(const CArray<double,n>& field, CArray<double,1>& stored) const
    {
+//#ifdef __XIOS_DEBUG
       if (this->getDataSize() != field.numElements())
          ERROR("void CGrid::inputField(const  CArray<double,n>& field, CArray<double,1>& stored) const",
@@ -306,4 +380,5 @@
                 << "The data array does not have the right size! "
                 << "Grid = " << this->getId())
+//#endif
       this->storeField_arr(field.dataFirst(), stored);
    }
@@ -312,4 +387,5 @@
    void CGrid::outputField(const CArray<double,1>& stored, CArray<double,n>& field) const
    {
+//#ifdef __XIOS_DEBUG
       if (this->getDataSize() != field.numElements())
          ERROR("void CGrid::outputField(const CArray<double,1>& stored, CArray<double,n>& field) const",
@@ -318,5 +394,18 @@
                 << "The ouput array does not have the right size! "
                 << "Grid = " << this->getId())
+//#endif
       this->restoreField_arr(stored, field.dataFirst());
+   }
+
+   /*!
+     This function removes the effect of mask on received data on the server.
+     This function only serve for the checking purpose. TODO: Something must be done to seperate mask and data_index from each other in received data
+     \data data received data with masking effect on the server
+     \outData data without masking effect
+   */
+   template <int N>
+   void CGrid::uncompressField(const CArray<double,N>& data, CArray<double,1>& outData) const
+   {      
+     uncompressField_arr(data.dataFirst(), outData);
    }
 
@@ -332,4 +421,5 @@
      int dim = domainMasks.size() * 2 + axisMasks.size();
      std::vector<CDomain*> domainP = this->getDomains();
+     std::vector<CAxis*> axisP = this->getAxis();
 
      std::vector<int> idxLoop(dim,0), indexMap(numElement), eachDimSize(dim);
@@ -345,5 +435,6 @@
       }
       else if (1 == axisDomainOrder(i)) {
-        eachDimSize[indexMap[i]] = axisMasks[idxAxis]->numElements();
+//        eachDimSize[indexMap[i]] = axisMasks[idxAxis]->numElements();
+        eachDimSize[indexMap[i]] = axisP[idxAxis]->n;
         ++idx; ++idxAxis;
       }
@@ -388,10 +479,19 @@
         if (2 == axisDomainOrder(i))
         {
-          maskValue = maskValue && (*domainMasks[idxDomain])(idxLoop[indexMap[i]] + idxLoop[indexMap[i]+1] * eachDimSize[indexMap[i]]);
+          int idxTmp = idxLoop[indexMap[i]] + idxLoop[indexMap[i]+1] * eachDimSize[indexMap[i]];
+          if (idxTmp < (*domainMasks[idxDomain]).numElements())
+            maskValue = maskValue && (*domainMasks[idxDomain])(idxTmp);
+          else
+            maskValue = false;
           ++idxDomain;
         }
         else if (1 == axisDomainOrder(i))
         {
-          maskValue = maskValue && (*axisMasks[idxAxis])(idxLoop[indexMap[i]]);
+          int idxTmp = idxLoop[indexMap[i]];
+          if (idxTmp < (*axisMasks[idxAxis]).numElements())
+            maskValue = maskValue && (*axisMasks[idxAxis])(idxTmp);
+          else
+            maskValue = false;
+
           ++idxAxis;
         }
@@ -413,4 +513,24 @@
    }
 
+   template<int N>
+   void CGrid::modifyGridMaskSize(CArray<bool,N>& gridMask,
+                                  const std::vector<int>& eachDimSize,
+                                  bool newValue)
+   {
+      if (N != eachDimSize.size())
+      {
+        // ERROR("CGrid::modifyGridMaskSize(CArray<bool,N>& gridMask,
+        //                                  const std::vector<int>& eachDimSize,
+        //                                  bool newValue)",
+        //       << "Dimension size of the mask is different from input dimension size." << std::endl
+        //       << "Mask dimension is " << N << "." << std::endl
+        //       << "Input dimension is " << eachDimSize.size() << "." << std::endl
+        //       << "Grid = " << this->getId())
+      }
+      CArrayBoolTraits<CArray<bool,N> >::resizeArray(gridMask,eachDimSize);
+      gridMask = newValue;
+   }
+                                 
+
    /*!
      Modify the current mask of grid, the local index to be modified will take value false
@@ -419,7 +539,6 @@
    */
    template<int N>
-   void CGrid::modifyGridMask(CArray<bool,N>& gridMask, const CArray<int,1>& indexToModify)
-   {
-     bool valueToModify = false;
+   void CGrid::modifyGridMask(CArray<bool,N>& gridMask, const CArray<int,1>& indexToModify, bool valueToModify)
+   {     
      int num = indexToModify.numElements();
      for (int idx = 0; idx < num; ++idx)
@@ -430,4 +549,47 @@
    ///--------------------------------------------------------------
 
+
+/*!
+  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 CGrid::getLocalMask(const CArray<bool,N>& gridMask, CArray<bool,1>& localMask)
+{
+  if (gridMask.isEmpty()) return ;
+  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;
+  localMask.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;
+    }
+    localMask(maskIndex) = *(gridMask.dataFirst()+maskIndex);
+
+    ++idxLoop[0];
+    ++idx;
+  }
+}
+
    // Declare/Define CGridGroup and CGridDefinition
    DECLARE_GROUP(CGrid);
Index: /XIOS/trunk/src/node/interpolate_domain.cpp
===================================================================
--- /XIOS/trunk/src/node/interpolate_domain.cpp	(revision 1536)
+++ /XIOS/trunk/src/node/interpolate_domain.cpp	(revision 1537)
@@ -48,44 +48,20 @@
     }
 
+    bool detect_missing_value=false ;
+    if (!this->detect_missing_value.isEmpty()) detect_missing_value = this->detect_missing_value.getValue();
+    else this->detect_missing_value.setValue(detect_missing_value);
+
+    bool renormalize=false ;
+    if (!this->renormalize.isEmpty()) renormalize = this->renormalize.getValue();
+    else this->renormalize.setValue(renormalize);
+
+    bool quantity=false ;
+    if (!this->quantity.isEmpty()) quantity = this->quantity.getValue();
+    else this->quantity.setValue(quantity);
+
     if (this->mode.isEmpty()) this->mode.setValue(mode_attr::compute);
     if (this->write_weight.isEmpty()) this->write_weight.setValue(false);
 
-    StdString weightFile;
-    switch (this->mode)
-    {
-      case mode_attr::read:
-        if (this->weight_filename.isEmpty())
-        {
-          if (!this->write_weight)
-            ERROR("void CInterpolateDomain::checkValid(CDomain* domainSrc)",
-                 << "Read mode is activated but there is no file specified." << std::endl
-                 << "Please define a correct file containing interpolation weights with option 'file'. ");
-        }
-        else
-        {
-          weightFile = this->weight_filename;
-          ifstream f(weightFile.c_str());
-          if (!f.good())
-            ERROR("void CInterpolateDomain::checkValid(CDomain* domainSrc)",
-                  << "Read mode is activated but file "  << weightFile << " doesn't exist." << std::endl
-                  << "Please check this file ");
-        }
-        break;
-      case mode_attr::compute:
-        break;
-      case mode_attr::read_or_compute:
-        if (!this->weight_filename.isEmpty() && !this->write_weight)
-        {
-          weightFile = this->weight_filename;
-          ifstream f(weightFile.c_str());
-          if (!f.good())
-            ERROR("void CInterpolateDomain::checkValid(CDomain* domainSrc)",
-                  << "read_or_compute mode is activated but file "  << weightFile << " doesn't exist." << std::endl
-                  << "Please check this file ");
-        }
-        break;
-      default:
-        break;
-    }
+    if (this->read_write_convention.isEmpty()) this->read_write_convention.setValue(read_write_convention_attr::fortran);
 
   }
Index: /XIOS/trunk/src/node/node_enum.hpp
===================================================================
--- /XIOS/trunk/src/node/node_enum.hpp	(revision 1536)
+++ /XIOS/trunk/src/node/node_enum.hpp	(revision 1537)
@@ -29,11 +29,15 @@
          eReduceAxisToScalar,
          eReduceDomainToAxis,
+         eReduceAxisToAxis,
          eExtractDomainToAxis,
          eComputeConnectivityDomain,
          eExpandDomain,
          eExtractAxisToScalar,
-         eReduceDomainToScalar
-
-      } ENodeType;
+         eReduceDomainToScalar,
+         eTemporalSplitting,
+         eDuplicateScalarToAxis,
+         eReduceScalarToScalar,
+         eReorderDomain
+       } ENodeType;
 
 } // namespace xios
Index: /XIOS/trunk/src/node/node_type.hpp
===================================================================
--- /XIOS/trunk/src/node/node_type.hpp	(revision 1536)
+++ /XIOS/trunk/src/node/node_type.hpp	(revision 1537)
@@ -19,4 +19,5 @@
 #include "reduce_axis_to_scalar.hpp"
 #include "reduce_domain_to_axis.hpp"
+#include "reduce_axis_to_axis.hpp"
 #include "extract_domain_to_axis.hpp"
 #include "compute_connectivity_domain.hpp"
@@ -24,5 +25,8 @@
 #include "extract_axis_to_scalar.hpp"
 #include "reduce_domain_to_scalar.hpp"
-
+#include "temporal_splitting.hpp"
+#include "duplicate_scalar_to_axis.hpp"
+#include "reduce_scalar_to_scalar.hpp"
+#include "reorder_domain.hpp"
 
 
Index: /XIOS/trunk/src/node/reduce_axis_to_axis.cpp
===================================================================
--- /XIOS/trunk/src/node/reduce_axis_to_axis.cpp	(revision 1537)
+++ /XIOS/trunk/src/node/reduce_axis_to_axis.cpp	(revision 1537)
@@ -0,0 +1,58 @@
+#include "reduce_axis_to_axis.hpp"
+#include "type.hpp"
+#include "axis.hpp"
+
+namespace xios {
+
+  /// ////////////////////// DÃ©finitions ////////////////////// ///
+
+  CReduceAxisToAxis::CReduceAxisToAxis(void)
+    : CObjectTemplate<CReduceAxisToAxis>(), CReduceAxisToAxisAttributes(), CTransformation<CAxis>()
+  { /* Ne rien faire de plus */ }
+
+  CReduceAxisToAxis::CReduceAxisToAxis(const StdString & id)
+    : CObjectTemplate<CReduceAxisToAxis>(id), CReduceAxisToAxisAttributes(), CTransformation<CAxis>()
+  { /* Ne rien faire de plus */ }
+
+  CReduceAxisToAxis::~CReduceAxisToAxis(void)
+  {}
+
+  CTransformation<CAxis>* CReduceAxisToAxis::create(const StdString& id, xml::CXMLNode* node)
+  {
+    CReduceAxisToAxis* reduceAxis = CReduceAxisToAxisGroup::get("reduce_axis_to_axis_definition")->createChild(id);
+    if (node) reduceAxis->parse(*node);
+    return static_cast<CTransformation<CAxis>*>(reduceAxis);
+  }
+
+  bool CReduceAxisToAxis::registerTrans()
+  {
+    return registerTransformation(TRANS_REDUCE_AXIS_TO_AXIS, CReduceAxisToAxis::create);
+  }
+
+  bool CReduceAxisToAxis::_dummyRegistered = CReduceAxisToAxis::registerTrans();
+
+  //----------------------------------------------------------------
+
+  StdString CReduceAxisToAxis::GetName(void)    { return StdString("reduce_axis_to_axis"); }
+  StdString CReduceAxisToAxis::GetDefName(void) { return StdString("reduce_axis_to_axis"); }
+  ENodeType CReduceAxisToAxis::GetType(void)    { return eReduceAxisToAxis; }
+
+  void CReduceAxisToAxis::checkValid(CAxis* axisDst, CAxis* axisSrc)
+  {
+  
+    if (this->operation.isEmpty())
+      ERROR("CReduceAxisToAxis::checkValid(CAxis* axisDst, CAxis* axisSrc)",
+             << "An operation must be defined."
+             << "Axis source " <<axisSrc->getId() << std::endl
+             << "Axis destination " << axisDst->getId());
+
+
+    if (axisDst->n_glo != axisSrc->n_glo)
+       ERROR("CReduceAxisToAxis::checkValid(CAxis* axisDst, CAxis* axisSrc)",
+            << "both axis should have same n_glo"
+            << "Axis source " <<axisSrc->getId() << " has n_glo " << axisSrc->n_glo << std::endl
+            << "Axis destination " << axisDst->getId() << " has n_glo " << axisDst->n_glo);
+    
+  }
+
+}
Index: /XIOS/trunk/src/node/reduce_axis_to_axis.hpp
===================================================================
--- /XIOS/trunk/src/node/reduce_axis_to_axis.hpp	(revision 1537)
+++ /XIOS/trunk/src/node/reduce_axis_to_axis.hpp	(revision 1537)
@@ -0,0 +1,66 @@
+#ifndef __XIOS_CReduceAxisToAxis__
+#define __XIOS_CReduceAxisToAxis__
+
+/// xios headers ///
+#include "xios_spl.hpp"
+#include "attribute_enum.hpp"
+#include "attribute_enum_impl.hpp"
+#include "attribute_array.hpp"
+#include "declare_attribute.hpp"
+#include "object_template.hpp"
+#include "group_factory.hpp"
+#include "declare_group.hpp"
+#include "transformation.hpp"
+
+namespace xios {
+  /// ////////////////////// DÃ©clarations ////////////////////// ///
+  class CReduceAxisToAxisGroup;
+  class CReduceAxisToAxisAttributes;
+  class CReduceAxisToAxis;
+  class CAxis;
+
+  ///--------------------------------------------------------------
+
+  // Declare/Define CFileAttribute
+  BEGIN_DECLARE_ATTRIBUTE_MAP(CReduceAxisToAxis)
+#include "reduce_axis_to_axis_attribute.conf"
+  END_DECLARE_ATTRIBUTE_MAP(CReduceAxisToAxis)
+
+  ///--------------------------------------------------------------
+  /*!
+    \class CReduceAxisToAxis
+    This class describes reduce_domain in xml file.
+  */
+  class CReduceAxisToAxis
+    : public CObjectTemplate<CReduceAxisToAxis>
+    , public CReduceAxisToAxisAttributes
+    , public CTransformation<CAxis>
+  {
+    public :
+      typedef CObjectTemplate<CReduceAxisToAxis> SuperClass;
+      typedef CReduceAxisToAxisAttributes SuperClassAttribute;
+
+    public :
+      /// Constructeurs ///
+      CReduceAxisToAxis(void);
+      explicit CReduceAxisToAxis(const StdString& id);
+
+      /// Destructeur ///
+      virtual ~CReduceAxisToAxis(void);
+
+      virtual void checkValid(CAxis* axisDst, CAxis* axisSrc);
+
+      /// Accesseurs statiques ///
+      static StdString GetName(void);
+      static StdString GetDefName(void);
+      static ENodeType GetType(void);
+    private:
+      static bool registerTrans();
+      static CTransformation<CAxis>* create(const StdString& id, xml::CXMLNode* node);
+      static bool _dummyRegistered;
+  }; // class CReduceAxisToAxis
+
+  DECLARE_GROUP(CReduceAxisToAxis);
+} // namespace xios
+
+#endif // __XIOS_CReduceAxisToAxis__
Index: /XIOS/trunk/src/node/reduce_domain_to_axis.cpp
===================================================================
--- /XIOS/trunk/src/node/reduce_domain_to_axis.cpp	(revision 1536)
+++ /XIOS/trunk/src/node/reduce_domain_to_axis.cpp	(revision 1537)
@@ -62,12 +62,6 @@
              << "Domain source " <<domainSrc->getId() << std::endl
              << "Axis destination " << axisDst->getId());
+    if (this->local.isEmpty()) local=false ;
 
-    if (this->direction.isEmpty())
-      ERROR("CReduceDomainToAxis::checkValid(CAxis* axisDst, CDomain* domainSrc)",
-             << "A direction to apply the operation must be defined. It should be: 'iDir' or 'jDir'"
-             << "Domain source " <<domainSrc->getId() << std::endl
-             << "Axis destination " << axisDst->getId());
-
-    
     switch (direction)
     {
Index: /XIOS/trunk/src/node/reduce_domain_to_scalar.cpp
===================================================================
--- /XIOS/trunk/src/node/reduce_domain_to_scalar.cpp	(revision 1536)
+++ /XIOS/trunk/src/node/reduce_domain_to_scalar.cpp	(revision 1537)
@@ -39,4 +39,5 @@
   void CReduceDomainToScalar::checkValid(CScalar* scalarDst, CDomain* domainSrc)
   {
+    if (this->local.isEmpty()) local=false ;
   }
 
Index: /XIOS/trunk/src/node/reduce_scalar_to_scalar.cpp
===================================================================
--- /XIOS/trunk/src/node/reduce_scalar_to_scalar.cpp	(revision 1537)
+++ /XIOS/trunk/src/node/reduce_scalar_to_scalar.cpp	(revision 1537)
@@ -0,0 +1,43 @@
+#include "reduce_scalar_to_scalar.hpp"
+#include "type.hpp"
+
+namespace xios {
+
+  /// ////////////////////// DÃ©finitions ////////////////////// ///
+
+  CReduceScalarToScalar::CReduceScalarToScalar(void)
+    : CObjectTemplate<CReduceScalarToScalar>(), CReduceScalarToScalarAttributes(), CTransformation<CScalar>()
+  { /* Ne rien faire de plus */ }
+
+  CReduceScalarToScalar::CReduceScalarToScalar(const StdString & id)
+    : CObjectTemplate<CReduceScalarToScalar>(id), CReduceScalarToScalarAttributes(), CTransformation<CScalar>()
+  { /* Ne rien faire de plus */ }
+
+  CReduceScalarToScalar::~CReduceScalarToScalar(void)
+  {}
+
+  CTransformation<CScalar>* CReduceScalarToScalar::create(const StdString& id, xml::CXMLNode* node)
+  {
+    CReduceScalarToScalar* reduceScalar = CReduceScalarToScalarGroup::get("reduce_scalar_to_scalar_definition")->createChild(id);
+    if (node) reduceScalar->parse(*node);
+    return static_cast<CTransformation<CScalar>*>(reduceScalar);
+  }
+
+  bool CReduceScalarToScalar::registerTrans()
+  {
+    return registerTransformation(TRANS_REDUCE_SCALAR_TO_SCALAR, CReduceScalarToScalar::create);
+  }
+
+  bool CReduceScalarToScalar::_dummyRegistered = CReduceScalarToScalar::registerTrans();
+
+  //----------------------------------------------------------------
+
+  StdString CReduceScalarToScalar::GetName(void)    { return StdString("reduce_scalar_to_scalar"); }
+  StdString CReduceScalarToScalar::GetDefName(void) { return StdString("reduce_scalar_to_scalar"); }
+  ENodeType CReduceScalarToScalar::GetType(void)    { return eReduceScalarToScalar; }
+
+  void CReduceScalarToScalar::checkValid(CScalar* scalarDst)
+  {
+  }
+
+}
Index: /XIOS/trunk/src/node/reduce_scalar_to_scalar.hpp
===================================================================
--- /XIOS/trunk/src/node/reduce_scalar_to_scalar.hpp	(revision 1537)
+++ /XIOS/trunk/src/node/reduce_scalar_to_scalar.hpp	(revision 1537)
@@ -0,0 +1,66 @@
+#ifndef __XIOS_CReduceScalarToScalar__
+#define __XIOS_CReduceScalarToScalar__
+
+/// xios headers ///
+#include "xios_spl.hpp"
+#include "attribute_enum.hpp"
+#include "attribute_enum_impl.hpp"
+#include "attribute_array.hpp"
+#include "declare_attribute.hpp"
+#include "object_template.hpp"
+#include "group_factory.hpp"
+#include "declare_group.hpp"
+#include "transformation.hpp"
+
+namespace xios {
+  /// ////////////////////// DÃ©clarations ////////////////////// ///
+  class CReduceScalarToScalarGroup;
+  class CReduceScalarToScalarAttributes;
+  class CReduceScalarToScalar;
+  class CScalar;
+
+  ///--------------------------------------------------------------
+
+  // Declare/Define CFileAttribute
+  BEGIN_DECLARE_ATTRIBUTE_MAP(CReduceScalarToScalar)
+#include "reduce_scalar_to_scalar_attribute.conf"
+  END_DECLARE_ATTRIBUTE_MAP(CReduceScalarToScalar)
+
+  ///--------------------------------------------------------------
+  /*!
+    \class CReduceScalarToScalar
+    This class describes reduce_scalar in xml file.
+  */
+  class CReduceScalarToScalar
+    : public CObjectTemplate<CReduceScalarToScalar>
+    , public CReduceScalarToScalarAttributes
+    , public CTransformation<CScalar>
+  {
+    public :
+      typedef CObjectTemplate<CReduceScalarToScalar> SuperClass;
+      typedef CReduceScalarToScalarAttributes SuperClassAttribute;
+
+    public :
+      /// Constructeurs ///
+      CReduceScalarToScalar(void);
+      explicit CReduceScalarToScalar(const StdString& id);
+
+      /// Destructeur ///
+      virtual ~CReduceScalarToScalar(void);
+
+      virtual void checkValid(CScalar* scalarDst);
+
+      /// Accesseurs statiques ///
+      static StdString GetName(void);
+      static StdString GetDefName(void);
+      static ENodeType GetType(void);
+    private:
+      static bool registerTrans();
+      static CTransformation<CScalar>* create(const StdString& id, xml::CXMLNode* node);
+      static bool _dummyRegistered;
+  }; // class CReduceScalarToScalar
+
+  DECLARE_GROUP(CReduceScalarToScalar);
+} // namespace xios
+
+#endif // __XIOS_CReduceScalarToScalar__
Index: /XIOS/trunk/src/node/reorder_domain.cpp
===================================================================
--- /XIOS/trunk/src/node/reorder_domain.cpp	(revision 1537)
+++ /XIOS/trunk/src/node/reorder_domain.cpp	(revision 1537)
@@ -0,0 +1,43 @@
+#include "reorder_domain.hpp"
+#include "type.hpp"
+
+namespace xios {
+
+  /// ////////////////////// DÃ©finitions ////////////////////// ///
+
+  CReorderDomain::CReorderDomain(void)
+    : CObjectTemplate<CReorderDomain>(), CReorderDomainAttributes(), CTransformation<CDomain>()
+  { /* Ne rien faire de plus */ }
+
+  CReorderDomain::CReorderDomain(const StdString & id)
+    : CObjectTemplate<CReorderDomain>(id), CReorderDomainAttributes(), CTransformation<CDomain>()
+  { /* Ne rien faire de plus */ }
+
+  CReorderDomain::~CReorderDomain(void)
+  {}
+
+  CTransformation<CDomain>* CReorderDomain::create(const StdString& id, xml::CXMLNode* node)
+  {
+    CReorderDomain* reorderDomain = CReorderDomainGroup::get("reorder_domain_definition")->createChild(id);
+    if (node) reorderDomain->parse(*node);
+    return static_cast<CTransformation<CDomain>*>(reorderDomain);
+  }
+
+  bool CReorderDomain::_dummyRegistered = CReorderDomain::registerTrans();
+  bool CReorderDomain::registerTrans()
+  {
+    registerTransformation(TRANS_REORDER_DOMAIN, CReorderDomain::create);
+  }
+
+  //----------------------------------------------------------------
+
+  StdString CReorderDomain::GetName(void)    { return StdString("reorder_domain"); }
+  StdString CReorderDomain::GetDefName(void) { return StdString("reorder_domain"); }
+  ENodeType CReorderDomain::GetType(void)    { return eReorderDomain; }
+
+  void CReorderDomain::checkValid(CDomain* domainSrc)
+  {
+    
+  }
+
+}
Index: /XIOS/trunk/src/node/reorder_domain.hpp
===================================================================
--- /XIOS/trunk/src/node/reorder_domain.hpp	(revision 1537)
+++ /XIOS/trunk/src/node/reorder_domain.hpp	(revision 1537)
@@ -0,0 +1,67 @@
+#ifndef __XIOS_CReorderDomain__
+#define __XIOS_CReorderDomain__
+
+/// xios headers ///
+#include "xios_spl.hpp"
+#include "attribute_enum.hpp"
+#include "attribute_enum_impl.hpp"
+#include "attribute_array.hpp"
+#include "declare_attribute.hpp"
+#include "object_template.hpp"
+#include "group_factory.hpp"
+#include "declare_group.hpp"
+#include "transformation.hpp"
+#include "domain.hpp"
+
+namespace xios {
+  /// ////////////////////// DÃ©clarations ////////////////////// ///
+  class CReorderDomainGroup;
+  class CReorderDomainAttributes;
+  class CReorderDomain;
+  class CDomain;
+
+  ///--------------------------------------------------------------
+
+  // Declare/Define CReorderDomainAttribute
+  BEGIN_DECLARE_ATTRIBUTE_MAP(CReorderDomain)
+#include "reorder_domain_attribute.conf"
+  END_DECLARE_ATTRIBUTE_MAP(CReorderDomain)
+
+  ///--------------------------------------------------------------
+  /*!
+    \class CReorderDomain
+    This class describes reorder_domain in xml file.
+  */
+  class CReorderDomain
+    : public CObjectTemplate<CReorderDomain>
+    , public CReorderDomainAttributes
+    , public CTransformation<CDomain>
+  {
+    public :
+      typedef CObjectTemplate<CReorderDomain> SuperClass;
+      typedef CReorderDomainAttributes SuperClassAttribute;
+
+    public :
+      /// Constructeurs ///
+      CReorderDomain(void);
+      explicit CReorderDomain(const StdString& id);
+
+      /// Destructeur ///
+      virtual ~CReorderDomain(void);
+
+      virtual void checkValid(CDomain* domainSrc);
+
+      /// Accesseurs statiques ///
+      static StdString GetName(void);
+      static StdString GetDefName(void);
+      static ENodeType GetType(void);
+    private:
+      static bool registerTrans();
+      static CTransformation<CDomain>* create(const StdString& id, xml::CXMLNode* node);
+      static bool _dummyRegistered;
+  }; // class CReorderDomain
+
+  DECLARE_GROUP(CReorderDomain);
+} // namespace xios
+
+#endif // __XIOS_CReorderDomain__
Index: /XIOS/trunk/src/node/scalar.cpp
===================================================================
--- /XIOS/trunk/src/node/scalar.cpp	(revision 1536)
+++ /XIOS/trunk/src/node/scalar.cpp	(revision 1537)
@@ -34,4 +34,5 @@
      m["extract_axis"]  = TRANS_EXTRACT_AXIS_TO_SCALAR;
      m["reduce_domain"] = TRANS_REDUCE_DOMAIN_TO_SCALAR;
+     m["reduce_scalar"] = TRANS_REDUCE_SCALAR_TO_SCALAR;
    }
 
Index: /XIOS/trunk/src/node/scalar.hpp
===================================================================
--- /XIOS/trunk/src/node/scalar.hpp	(revision 1536)
+++ /XIOS/trunk/src/node/scalar.hpp	(revision 1537)
@@ -10,4 +10,5 @@
 #include "attribute_enum.hpp"
 #include "attribute_enum_impl.hpp"
+#include "attribute_array.hpp"
 #include "transformation.hpp"
 #include "transformation_enum.hpp"
@@ -82,5 +83,4 @@
            TransMapTypes transformationMap_;
 
-         private:           
             void setTransformations(const TransMapTypes&);
 
Index: /XIOS/trunk/src/node/temporal_splitting.cpp
===================================================================
--- /XIOS/trunk/src/node/temporal_splitting.cpp	(revision 1537)
+++ /XIOS/trunk/src/node/temporal_splitting.cpp	(revision 1537)
@@ -0,0 +1,47 @@
+#include "temporal_splitting.hpp"
+#include "type.hpp"
+#include "axis.hpp"
+#include "domain.hpp"
+#include "scalar.hpp"
+
+namespace xios {
+
+  /// ////////////////////// DÃ©finitions ////////////////////// ///
+
+  CTemporalSplitting::CTemporalSplitting(void)
+    : CObjectTemplate<CTemporalSplitting>(), CTemporalSplittingAttributes(), CTransformation<CAxis>()
+  { /* Ne rien faire de plus */ }
+
+  CTemporalSplitting::CTemporalSplitting(const StdString & id)
+    : CObjectTemplate<CTemporalSplitting>(id), CTemporalSplittingAttributes(), CTransformation<CAxis>()
+  { /* Ne rien faire de plus */ }
+
+  CTemporalSplitting::~CTemporalSplitting(void)
+  {}
+
+  CTransformation<CAxis>* CTemporalSplitting::create(const StdString& id, xml::CXMLNode* node)
+  {
+    CTemporalSplitting* temporalSplitting = CTemporalSplittingGroup::get("temporal_splitting_definition")->createChild(id);
+    if (node) temporalSplitting->parse(*node);
+    return static_cast<CTransformation<CAxis>*>(temporalSplitting);
+  }
+
+  bool CTemporalSplitting::registerTrans()
+  {
+    return registerTransformation(TRANS_TEMPORAL_SPLITTING, CTemporalSplitting::create);
+  }
+
+  bool CTemporalSplitting::_dummyRegistered = CTemporalSplitting::registerTrans();
+
+  //----------------------------------------------------------------
+
+  StdString CTemporalSplitting::GetName(void)    { return StdString("temporal_splitting"); }
+  StdString CTemporalSplitting::GetDefName(void) { return StdString("temporal_splitting"); }
+  ENodeType CTemporalSplitting::GetType(void)    { return eTemporalSplitting; }
+
+  void CTemporalSplitting::checkValid(CAxis* axisDst, CScalar* scalarSrc)
+  {
+
+  }
+
+}
Index: /XIOS/trunk/src/node/temporal_splitting.hpp
===================================================================
--- /XIOS/trunk/src/node/temporal_splitting.hpp	(revision 1537)
+++ /XIOS/trunk/src/node/temporal_splitting.hpp	(revision 1537)
@@ -0,0 +1,66 @@
+#ifndef __XIOS_CTemporalSplitting__
+#define __XIOS_CTemporalSplitting__
+
+/// xios headers ///
+#include "xios_spl.hpp"
+#include "attribute_enum.hpp"
+#include "attribute_enum_impl.hpp"
+#include "attribute_array.hpp"
+#include "declare_attribute.hpp"
+#include "object_template.hpp"
+#include "group_factory.hpp"
+#include "declare_group.hpp"
+#include "transformation.hpp"
+
+namespace xios {
+  /// ////////////////////// DÃ©clarations ////////////////////// ///
+  class CTemporalSplittingGroup;
+  class CTemporalSplittingAttributes;
+  class CTemporalSplitting;
+  class CAxis;
+  class CScalar;
+  ///--------------------------------------------------------------
+
+  // Declare/Define CFileAttribute
+  BEGIN_DECLARE_ATTRIBUTE_MAP(CTemporalSplitting)
+#include "temporal_splitting.conf"
+  END_DECLARE_ATTRIBUTE_MAP(CTemporalSplitting)
+
+  ///--------------------------------------------------------------
+  /*!
+    \class CExtractDomainToAxis
+    This class describes reduce_domain in xml file.
+  */
+  class CTemporalSplitting
+    : public CObjectTemplate<CTemporalSplitting>
+    , public CTemporalSplittingAttributes
+    , public CTransformation<CAxis>
+  {
+    public :
+      typedef CObjectTemplate<CTemporalSplitting> SuperClass;
+      typedef CTemporalSplittingAttributes SuperClassAttribute;
+
+    public :
+      /// Constructeurs ///
+      CTemporalSplitting(void);
+      explicit CTemporalSplitting(const StdString& id);
+
+      /// Destructeur ///
+      virtual ~CTemporalSplitting(void);
+
+      virtual void checkValid(CAxis* axisDst, CScalar* scalarSrc);
+
+      /// Accesseurs statiques ///
+      static StdString GetName(void);
+      static StdString GetDefName(void);
+      static ENodeType GetType(void);
+    private:
+      static bool registerTrans();
+      static CTransformation<CAxis>* create(const StdString& id, xml::CXMLNode* node);
+      static bool _dummyRegistered;
+  }; // class CTemporalSplitting
+
+  DECLARE_GROUP(CTemporalSplitting);
+} // namespace xios
+
+#endif // __XIOS_CTemporalSplitting__
Index: /XIOS/trunk/src/node/transformation_enum.hpp
===================================================================
--- /XIOS/trunk/src/node/transformation_enum.hpp	(revision 1536)
+++ /XIOS/trunk/src/node/transformation_enum.hpp	(revision 1537)
@@ -20,4 +20,9 @@
         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
       } ETranformationType;
 
Index: /XIOS/trunk/src/node/variable.cpp
===================================================================
--- /XIOS/trunk/src/node/variable.cpp	(revision 1536)
+++ /XIOS/trunk/src/node/variable.cpp	(revision 1537)
@@ -97,21 +97,46 @@
    {
      CContext* context=CContext::getCurrent() ;
-     if (!context->hasServer)
+
+     if (context->hasClient)
      {
-       CContextClient* client=context->client ;
-
-       CEventClient event(this->getType(),EVENT_ID_VARIABLE_VALUE) ;
-       if (client->isServerLeader())
+       // Use correct context client to send message
+       // int nbSrvPools = (context->hasServer) ? context->clientPrimServer.size() : 1;
+      int nbSrvPools = (context->hasServer) ? (context->hasClient ? context->clientPrimServer.size() : 0) : 1;
+       for (int i = 0; i < nbSrvPools; ++i)
        {
-         CMessage msg ;
-         msg<<this->getId() ;
-         msg<<content ;
-         const std::list<int>& ranks = client->getRanksServerLeader();
-         for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
-           event.push(*itRank,1,msg);
-         client->sendEvent(event) ;
-       }
-       else client->sendEvent(event) ;
-    }
+//       CContextClient* contextClientTmp = (0 != context->clientPrimServer) ? context->clientPrimServer
+         CContextClient* contextClientTmp = (context->hasServer) ? context->clientPrimServer[i]
+                                                                             : context->client;
+
+         CEventClient event(this->getType(),EVENT_ID_VARIABLE_VALUE) ;
+         if (contextClientTmp->isServerLeader())
+         {
+           CMessage msg ;
+           msg<<this->getId() ;
+           msg<<content ;
+           const std::list<int>& ranks = contextClientTmp->getRanksServerLeader();
+           for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
+             event.push(*itRank,1,msg);
+           contextClientTmp->sendEvent(event) ;
+         }
+         else contextClientTmp->sendEvent(event) ;
+      }
+     }
+   }
+
+   void CVariable::sendValue(CContextClient* client, bool clientPrim /*= false*/)
+   {
+     CEventClient event(this->getType(),EVENT_ID_VARIABLE_VALUE) ;
+     if (client->isServerLeader())
+     {
+       CMessage msg ;
+       msg<<this->getId() ;
+       msg<<content ;
+       const std::list<int>& ranks = client->getRanksServerLeader();
+       for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
+         event.push(*itRank,1,msg);
+       client->sendEvent(event) ;
+     }
+     else client->sendEvent(event) ;
    }
 
Index: /XIOS/trunk/src/node/variable.hpp
===================================================================
--- /XIOS/trunk/src/node/variable.hpp	(revision 1536)
+++ /XIOS/trunk/src/node/variable.hpp	(revision 1537)
@@ -32,12 +32,13 @@
          , public CVariableAttributes
       {
+                     /// typedef ///
+            typedef CObjectTemplate<CVariable>   SuperClass;
+            typedef CVariableAttributes SuperClassAttribute;
+            
+         public :
             enum EEventId
             {
              EVENT_ID_VARIABLE_VALUE
             };
-
-            /// typedef ///
-            typedef CObjectTemplate<CVariable>   SuperClass;
-            typedef CVariableAttributes SuperClassAttribute;
 
             friend class CVariableGroup;
@@ -79,4 +80,5 @@
             //! Sending a request to set up variable data
             void sendValue();
+            void sendValue(CContextClient* client, bool clientPrim = false);
 
             static void recvValue(CEventServer& event) ;
Index: /XIOS/trunk/src/object_factory_decl.cpp
===================================================================
--- /XIOS/trunk/src/object_factory_decl.cpp	(revision 1536)
+++ /XIOS/trunk/src/object_factory_decl.cpp	(revision 1537)
@@ -35,4 +35,5 @@
   macro(CReduceAxisToScalar)
   macro(CReduceDomainToAxis)
+  macro(CReduceAxisToAxis)
   macro(CExtractDomainToAxis)
   macro(CComputeConnectivityDomain)
@@ -40,5 +41,9 @@
   macro(CExtractAxisToScalar)
   macro(CReduceDomainToScalar)
-
+  macro(CTemporalSplitting)
+  macro(CDuplicateScalarToAxis)
+  macro(CReduceScalarToScalar)
+  macro(CReorderDomain)
+  
   macro(CFieldGroup)
   macro(CFileGroup)
@@ -57,4 +62,5 @@
   macro(CReduceAxisToScalarGroup)
   macro(CReduceDomainToAxisGroup)
+  macro(CReduceAxisToAxisGroup)
   macro(CExtractDomainToAxisGroup)
   macro(CComputeConnectivityDomainGroup)
@@ -62,3 +68,7 @@
   macro(CExtractAxisToScalarGroup)
   macro(CReduceDomainToScalarGroup)
+  macro(CTemporalSplittingGroup)
+  macro(CDuplicateScalarToAxisGroup)
+  macro(CReduceScalarToScalarGroup)
+  macro(CReorderDomainGroup)
 }
Index: /XIOS/trunk/src/object_template.hpp
===================================================================
--- /XIOS/trunk/src/object_template.hpp	(revision 1536)
+++ /XIOS/trunk/src/object_template.hpp	(revision 1537)
@@ -9,4 +9,5 @@
 #include "event_server.hpp"
 #include "attribute.hpp"
+#include "context_client.hpp"
 
 namespace xios
@@ -54,8 +55,13 @@
          /// Traitement statique ///
          static void ClearAllAttributes(void);
-         std::map<int, size_t> getMinimumBufferSizeForAttributes();
+         std::map<int, size_t> getMinimumBufferSizeForAttributes(CContextClient* client);
          void sendAttributToServer(const string& id);
+         void sendAttributToServer(const string& id, CContextClient* client);
          void sendAttributToServer(CAttribute& attr) ;
+         void sendAttributToServer(CAttribute& attr, CContextClient* client) ;
          void sendAllAttributesToServer();
+         void sendAllAttributesToServer(CContextClient* client);
+         void sendAddItem(const string& id, int itemType);
+         void sendAddItem(const string& id, int itemType, CContextClient* client);
          static void recvAttributFromClient(CEventServer& event) ;
          static bool dispatchEvent(CEventServer& event) ;
Index: /XIOS/trunk/src/object_template_decl.cpp
===================================================================
--- /XIOS/trunk/src/object_template_decl.cpp	(revision 1536)
+++ /XIOS/trunk/src/object_template_decl.cpp	(revision 1537)
@@ -22,4 +22,5 @@
   template class CObjectTemplate<CReduceAxisToScalar>;
   template class CObjectTemplate<CReduceDomainToAxis>;
+  template class CObjectTemplate<CReduceAxisToAxis>;
   template class CObjectTemplate<CExtractDomainToAxis>;
   template class CObjectTemplate<CComputeConnectivityDomain>;
@@ -27,5 +28,9 @@
   template class CObjectTemplate<CExtractAxisToScalar>;
   template class CObjectTemplate<CReduceDomainToScalar>;
-
+  template class CObjectTemplate<CTemporalSplitting>;
+  template class CObjectTemplate<CDuplicateScalarToAxis>;
+  template class CObjectTemplate<CReduceScalarToScalar>;
+  template class CObjectTemplate<CReorderDomain>;
+  
   template class CObjectTemplate<CContextGroup>;
   template class CObjectTemplate<CFieldGroup>;
@@ -44,4 +49,5 @@
   template class CObjectTemplate<CReduceAxisToScalarGroup>;
   template class CObjectTemplate<CReduceDomainToAxisGroup>;
+  template class CObjectTemplate<CReduceAxisToAxisGroup>;
   template class CObjectTemplate<CExtractDomainToAxisGroup>;
   template class CObjectTemplate<CComputeConnectivityDomainGroup>;
@@ -49,3 +55,7 @@
   template class CObjectTemplate<CExtractAxisToScalarGroup>;
   template class CObjectTemplate<CReduceDomainToScalarGroup>;
+  template class CObjectTemplate<CTemporalSplittingGroup>;
+  template class CObjectTemplate<CDuplicateScalarToAxisGroup>;
+  template class CObjectTemplate<CReduceScalarToScalarGroup>;
+  template class CObjectTemplate<CReorderDomainGroup>;
 }
Index: /XIOS/trunk/src/object_template_impl.hpp
===================================================================
--- /XIOS/trunk/src/object_template_impl.hpp	(revision 1536)
+++ /XIOS/trunk/src/object_template_impl.hpp	(revision 1537)
@@ -181,7 +181,6 @@
 
    template<typename T>
-   std::map<int, size_t> CObjectTemplate<T>::getMinimumBufferSizeForAttributes()
-   {
-     CContextClient* client = CContext::getCurrent()->client;
+   std::map<int, size_t> CObjectTemplate<T>::getMinimumBufferSizeForAttributes(CContextClient* client)
+   {
      std::map<int, size_t> minimumSizes;
 
@@ -211,7 +210,7 @@
        }
      }
-
      return minimumSizes;
    }
+
 
    template<typename T>
@@ -222,5 +221,16 @@
      for (; it != itE; ++it)
      {
-       if (!(it->second)->isEmpty()) sendAttributToServer(*(it->second));
+       if (it->second->doSend() && !(it->second)->isEmpty()) sendAttributToServer(*(it->second));
+     }
+   }
+
+   template<typename T>
+   void CObjectTemplate<T>::sendAllAttributesToServer(CContextClient* client)
+   {
+     CAttributeMap& attrMap = *this;
+     CAttributeMap::const_iterator it = attrMap.begin(), itE = attrMap.end();
+     for (; it != itE; ++it)
+     {
+       if (it->second->doSend() && !(it->second)->isEmpty()) sendAttributToServer(*(it->second), client);
      }
    }
@@ -234,29 +244,110 @@
    }
 
+   template <class T>
+   void CObjectTemplate<T>::sendAttributToServer(const string& id, CContextClient* client)
+   {
+      CAttributeMap & attrMap = *this;
+      CAttribute* attr=attrMap[id];
+      sendAttributToServer(*attr, client);
+   }
+
   template <class T>
   void CObjectTemplate<T>::sendAttributToServer(CAttribute& attr)
   {
+     // Use correct context client to send message
     CContext* context=CContext::getCurrent();
-
-    if (!context->hasServer)
+    if (context->hasClient)
     {
-       CContextClient* client=context->client;
-
-       CEventClient event(getType(),EVENT_ID_SEND_ATTRIBUTE);
-       if (client->isServerLeader())
-       {
-         CMessage msg;
-//       msg << this->getId();
-         msg << this->getIdServer();
-         msg << attr.getName();
-         msg << attr;
-         const std::list<int>& ranks = client->getRanksServerLeader();
-         for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
-           event.push(*itRank,1,msg);
-         client->sendEvent(event);
-       }
-       else client->sendEvent(event);
+      // int nbSrvPools = (context->hasServer) ? context->clientPrimServer.size() : 1;
+      int nbSrvPools = (context->hasServer) ? (context->hasClient ? context->clientPrimServer.size() : 0) : 1;
+      for (int i = 0; i < nbSrvPools; ++i)
+      {
+        CContextClient* contextClientTmp = (context->hasServer) ? context->clientPrimServer[i] : context->client;
+        CEventClient event(getType(),EVENT_ID_SEND_ATTRIBUTE);
+        if (contextClientTmp->isServerLeader())
+        {
+          CMessage msg;
+          msg<<this->getIdServer();
+          msg << attr.getName();
+          msg << attr;
+          const std::list<int>& ranks = contextClientTmp->getRanksServerLeader();
+          for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
+            event.push(*itRank,1,msg);
+          contextClientTmp->sendEvent(event);
+        }
+        else contextClientTmp->sendEvent(event);
+      }
     }
-
+  }
+
+  template <class T>
+  void CObjectTemplate<T>::sendAttributToServer(CAttribute& attr, CContextClient* client)
+  {
+    CEventClient event(getType(),EVENT_ID_SEND_ATTRIBUTE);
+    if (client->isServerLeader())
+    {
+      CMessage msg;
+      msg<<this->getIdServer();
+      msg << attr.getName();
+      msg << attr;
+      const std::list<int>& ranks = client->getRanksServerLeader();
+      for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
+        event.push(*itRank,1,msg);
+      client->sendEvent(event);
+    }
+    else client->sendEvent(event);
+  }
+
+  /*!
+    This generic funtion only provides instance for sending, for receving, each 
+    child class must define itself.
+    \param [in] id Id of added item
+    \param [in] itemType type of added item
+  */
+  template<class T>
+  void CObjectTemplate<T>::sendAddItem(const StdString& id, int itemType)
+  {
+    CContext* context = CContext::getCurrent();
+    typedef typename T::EEventId ItemType;
+    if (context->hasClient)
+    {
+      // Use correct context client to send message
+      // int nbSrvPools = (context->hasServer) ? context->clientPrimServer.size() : 1;
+      int nbSrvPools = (context->hasServer) ? (context->hasClient ? context->clientPrimServer.size() : 0) : 1;
+      for (int i = 0; i < nbSrvPools; ++i)
+      {
+         CContextClient* contextClientTmp = (context->hasServer) ? context->clientPrimServer[i] : context->client;
+         CEventClient event(this->getType(),ItemType(itemType));
+         if (contextClientTmp->isServerLeader())
+         {
+           CMessage msg;
+           msg << this->getId();
+           msg << id;
+           const std::list<int>& ranks = contextClientTmp->getRanksServerLeader();
+           for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
+             event.push(*itRank,1,msg);
+           contextClientTmp->sendEvent(event);
+         }
+         else contextClientTmp->sendEvent(event);
+      }
+    }
+  }
+
+  template<class T>
+  void CObjectTemplate<T>::sendAddItem(const StdString& id, int itemType, CContextClient* client)
+  {
+    typedef typename T::EEventId ItemType;
+     CEventClient event(this->getType(),ItemType(itemType));
+     if (client->isServerLeader())
+     {
+       CMessage msg;
+       msg << this->getId();
+       msg << id;
+       const std::list<int>& ranks = client->getRanksServerLeader();
+       for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
+         event.push(*itRank,1,msg);
+       client->sendEvent(event);
+     }
+     else client->sendEvent(event);
   }
 
Index: /XIOS/trunk/src/parse_expr/operator_expr.hpp
===================================================================
--- /XIOS/trunk/src/parse_expr/operator_expr.hpp	(revision 1536)
+++ /XIOS/trunk/src/parse_expr/operator_expr.hpp	(revision 1537)
@@ -7,4 +7,5 @@
 #include "exception.hpp"
 #include "array_new.hpp"
+#include "utils.hpp"
 
 using namespace std;
@@ -253,11 +254,30 @@
     static inline double div_ss(double x, double y)   { return x / y; }
     static inline double pow_ss(double x, double y)   { return std::pow(x,y); }
-    static inline double eq_ss(double x, double y)    { return x == y; }
+
+    static inline double eq_ss(double x, double y) // specific check for NaN
+    {
+       bool xNan=NumTraits<double>::isNan(x) ;
+       bool yNan=NumTraits<double>::isNan(y) ;
+       if (xNan && yNan) return true ;
+       else if (xNan) return false ;
+       else if (yNan) return false ;
+       else return x == y;
+    }
+    
     static inline double lt_ss(double x, double y)    { return x < y; }
     static inline double gt_ss(double x, double y)    { return x > y; }
     static inline double le_ss(double x, double y)    { return x <= y; }
     static inline double ge_ss(double x, double y)    { return x >= y; }
-    static inline double ne_ss(double x, double y)    { return x != y; }
-
+
+    static inline double ne_ss(double x, double y) // specific check for NaN
+    {
+       bool xNan=NumTraits<double>::isNan(x) ;
+       bool yNan=NumTraits<double>::isNan(y) ;
+       if (xNan && yNan) return false ;
+       else if (xNan) return true ;
+       else if (yNan) return true ;      
+       else return x != y;
+    }
+    
     static inline CArray<double,1> neg_f(const CArray<double,1>& x)   { return Array<double,1>(-x); }
     static inline CArray<double,1> cos_f(const CArray<double,1>& x)   { return Array<double,1>(cos(x)); }
@@ -286,10 +306,35 @@
     static inline CArray<double,1> div_fs(const CArray<double,1>& x, double y)   { return Array<double,1>(x / y); }
     static inline CArray<double,1> pow_fs(const CArray<double,1>& x, double y)   { return Array<double,1>(pow(x,y)); }
-    static inline CArray<double,1> eq_fs(const CArray<double,1>& x, double y)    { return Array<double,1>(x == y); }
+
+    static inline CArray<double,1> eq_fs(const CArray<double,1>& x, double y) // specific check for NaN
+    {
+      if (NumTraits<double>::isNan(y))
+      {
+        CArray<double,1> ret(x.numElements()) ;
+        Array<double,1>::const_iterator itx=x.begin(),itxe=x.end();
+        Array<double,1>::iterator itret=ret.begin() ;
+        for(;itx!=itxe;++itx,++itret) *itret=NumTraits<double>::isNan(*itx) ;
+        return ret ;
+      }
+      else return Array<double,1>(x == y); 
+    }
+    
     static inline CArray<double,1> lt_fs(const CArray<double,1>& x, double y)    { return Array<double,1>(x < y); }
     static inline CArray<double,1> gt_fs(const CArray<double,1>& x, double y)    { return Array<double,1>(x > y); }
     static inline CArray<double,1> le_fs(const CArray<double,1>& x, double y)    { return Array<double,1>(x <= y); }
     static inline CArray<double,1> ge_fs(const CArray<double,1>& x, double y)    { return Array<double,1>(x >= y); }
-    static inline CArray<double,1> ne_fs(const CArray<double,1>& x, double y)    { return Array<double,1>(x != y); }
+
+    static  inline CArray<double,1> ne_fs(const CArray<double,1>& x, double y) // specific check for NaN
+    {
+      if (NumTraits<double>::isNan(y))
+      {
+        CArray<double,1> ret(x.numElements()) ;
+        Array<double,1>::const_iterator itx=x.begin(),itxe=x.end();
+        Array<double,1>::iterator itret=ret.begin() ;
+        for(;itx!=itxe;++itx,++itret) *itret = !NumTraits<double>::isNan(*itx) ;
+        return ret ;
+      }
+      else return Array<double,1>(x != y); 
+    }
 
     static inline CArray<double,1> add_sf(double x, const CArray<double,1>& y)   { return Array<double,1>(x + y); }
@@ -297,12 +342,34 @@
     static inline CArray<double,1> mult_sf(double x, const CArray<double,1>& y)  { return Array<double,1>(x * y); }
     static inline CArray<double,1> div_sf(double x, const CArray<double,1>& y)   { return Array<double,1>(x / y); }
-    static inline CArray<double,1> eq_sf(double x, const CArray<double,1>& y)    { return Array<double,1>(x == y); }
+
+    static inline CArray<double,1> eq_sf(double x, const CArray<double,1>& y) // specific check for NaN
+    {
+      if (NumTraits<double>::isNan(x))
+      {
+        CArray<double,1> ret(y.numElements()) ;
+        Array<double,1>::const_iterator ity=y.begin(),itye=y.end();
+        Array<double,1>::iterator itret=ret.begin() ;
+        for(;ity!=itye;++ity,++itret) *itret=NumTraits<double>::isNan(*ity) ;
+        return ret ;
+      }
+      else return Array<double,1>(x == y); 
+    }
     static inline CArray<double,1> lt_sf(double x, const CArray<double,1>& y)    { return Array<double,1>(x < y); }
     static inline CArray<double,1> gt_sf(double x, const CArray<double,1>& y)    { return Array<double,1>(x > y); }
     static inline CArray<double,1> le_sf(double x, const CArray<double,1>& y)    { return Array<double,1>(x <= y); }
     static inline CArray<double,1> ge_sf(double x, const CArray<double,1>& y)    { return Array<double,1>(x >= y); }
-    static inline CArray<double,1> ne_sf(double x, const CArray<double,1>& y)    { return Array<double,1>(x != y); }
-
-
+
+    static inline CArray<double,1> ne_sf(double x, const CArray<double,1>& y) // specific check for NaN
+    {
+      if (NumTraits<double>::isNan(x))
+      {
+        CArray<double,1> ret(y.numElements()) ;
+        Array<double,1>::const_iterator ity=y.begin(),itye=y.end();
+        Array<double,1>::iterator itret=ret.begin() ;
+        for(;ity!=itye;++ity,++itret) *itret=!NumTraits<double>::isNan(*ity) ;
+        return ret ;
+      }
+      else return Array<double,1>(x != y);
+    }
     static inline double cond_sss(double x, double y, double z)   { return (x==0) ? z : y ; }
 
Index: /XIOS/trunk/src/server.cpp
===================================================================
--- /XIOS/trunk/src/server.cpp	(revision 1536)
+++ /XIOS/trunk/src/server.cpp	(revision 1537)
@@ -3,4 +3,5 @@
 #include "cxios.hpp"
 #include "server.hpp"
+#include "client.hpp"
 #include "type.hpp"
 #include "context.hpp"
@@ -17,15 +18,30 @@
 {
     MPI_Comm CServer::intraComm ;
-    list<MPI_Comm> CServer::interComm ;
+    std::list<MPI_Comm> CServer::interCommLeft ;
+    std::list<MPI_Comm> CServer::interCommRight ;
     std::list<MPI_Comm> CServer::contextInterComms;
-    bool CServer::isRoot ;
-    int CServer::rank = INVALID_RANK;
+    std::list<MPI_Comm> CServer::contextIntraComms;
+    int CServer::serverLevel = 0 ;
+    int CServer::nbContexts = 0;
+    bool CServer::isRoot = false ;
+    int CServer::rank_ = INVALID_RANK;
     StdOFStream CServer::m_infoStream;
     StdOFStream CServer::m_errorStream;
     map<string,CContext*> CServer::contextList ;
+    vector<int> CServer::sndServerGlobalRanks;
     bool CServer::finished=false ;
     bool CServer::is_MPI_Initialized ;
     CEventScheduler* CServer::eventScheduler = 0;
-   
+
+//---------------------------------------------------------------
+/*!
+ * \fn void CServer::initialize(void)
+ * Creates intraComm for each possible type of servers (classical, primary or secondary).
+ * Creates interComm and stores them into the following lists:
+ *   classical server -- interCommLeft
+ *   primary server -- interCommLeft and interCommRight
+ *   secondary server -- interCommLeft for each pool.
+ *   IMPORTANT: CXios::usingServer2 should NOT be used beyond this function. Use CServer::serverLevel instead.
+ */
     void CServer::initialize(void)
     {
@@ -34,4 +50,5 @@
       if (initialized) is_MPI_Initialized=true ;
       else is_MPI_Initialized=false ;
+      int rank ;
 
       // Not using OASIS
@@ -46,19 +63,19 @@
 
         boost::hash<string> hashString ;
-
-        unsigned long hashServer=hashString(CXios::xiosCodeId) ;
+        unsigned long hashServer = hashString(CXios::xiosCodeId);
+
         unsigned long* hashAll ;
-
-//        int rank ;
+        unsigned long* srvLevelAll ;
+
         int size ;
         int myColor ;
         int i,c ;
-        MPI_Comm newComm ;
-
-        MPI_Comm_size(CXios::globalComm,&size) ;
-        MPI_Comm_rank(CXios::globalComm,&rank);
+        MPI_Comm newComm;
+
+        MPI_Comm_size(CXios::globalComm, &size) ;
+        MPI_Comm_rank(CXios::globalComm, &rank_);
+
         hashAll=new unsigned long[size] ;
-
-        MPI_Allgather(&hashServer,1,MPI_LONG,hashAll,1,MPI_LONG,CXios::globalComm) ;
+        MPI_Allgather(&hashServer, 1, MPI_LONG, hashAll, 1, MPI_LONG, CXios::globalComm) ;
 
         map<unsigned long, int> colors ;
@@ -66,4 +83,6 @@
         map<unsigned long, int>::iterator it ;
 
+        // (1) Establish client leaders, distribute processes between two server levels
+        std::vector<int> srvRanks;
         for(i=0,c=0;i<size;i++)
         {
@@ -74,36 +93,160 @@
             c++ ;
           }
-        }
-
-        myColor=colors[hashServer] ;
-        MPI_Comm_split(MPI_COMM_WORLD,myColor,rank,&intraComm) ;
-
-        int serverLeader=leaders[hashServer] ;
-        int clientLeader;
-
-         serverLeader=leaders[hashServer] ;
-         for(it=leaders.begin();it!=leaders.end();it++)
-         {
-           if (it->first!=hashServer)
-           {
-             clientLeader=it->second ;
-             int intraCommSize, intraCommRank ;
-             MPI_Comm_size(intraComm,&intraCommSize) ;
-             MPI_Comm_rank(intraComm,&intraCommRank) ;
-             info(50)<<"intercommCreate::server "<<rank<<" intraCommSize : "<<intraCommSize
-                     <<" intraCommRank :"<<intraCommRank<<"  clientLeader "<< clientLeader<<endl ;
-
-             MPI_Intercomm_create(intraComm,0,CXios::globalComm,clientLeader,0,&newComm) ;
-             interComm.push_back(newComm) ;
-           }
-         }
-
-         delete [] hashAll ;
+          if (CXios::usingServer2)
+            if (hashAll[i] == hashServer)
+              srvRanks.push_back(i);
+        }
+
+        if (CXios::usingServer2)
+        {
+          int reqNbProc = srvRanks.size()*CXios::ratioServer2/100.;
+          if (reqNbProc<1 || reqNbProc==srvRanks.size())
+          {
+            error(0)<<"WARNING: void CServer::initialize(void)"<<endl
+                << "It is impossible to dedicate the requested number of processes = "<<reqNbProc
+                <<" to secondary server. XIOS will run in the classical server mode."<<endl;
+          }
+          else
+          {
+            if (CXios::nbPoolsServer2 == 0) CXios::nbPoolsServer2 = reqNbProc;
+            int firstSndSrvRank = srvRanks.size()*(100.-CXios::ratioServer2)/100. ;
+            int poolLeader = firstSndSrvRank;
+//*********** (1) Comment out the line below to set one process per pool
+            sndServerGlobalRanks.push_back(srvRanks[poolLeader]);
+            int nbPools = CXios::nbPoolsServer2;
+            if ( nbPools > reqNbProc || nbPools < 1)
+            {
+              error(0)<<"WARNING: void CServer::initialize(void)"<<endl
+                  << "It is impossible to allocate the requested number of pools = "<<nbPools
+                  <<" on the secondary server. It will be set so that there is one process per pool."<<endl;
+              nbPools = reqNbProc;
+            }
+            int remainder = ((int) (srvRanks.size()*CXios::ratioServer2/100.)) % nbPools;
+            int procsPerPool = ((int) (srvRanks.size()*CXios::ratioServer2/100.)) / nbPools;
+            for (i=0; i<srvRanks.size(); i++)
+            {
+              if (i >= firstSndSrvRank)
+              {
+                if (rank_ == srvRanks[i])
+                {
+                  serverLevel=2;
+                }
+                poolLeader += procsPerPool;
+                if (remainder != 0)
+                {
+                  ++poolLeader;
+                  --remainder;
+                }
+//*********** (2) Comment out the two lines below to set one process per pool
+                if (poolLeader < srvRanks.size())
+                  sndServerGlobalRanks.push_back(srvRanks[poolLeader]);
+//*********** (3) Uncomment the line below to set one process per pool
+//                sndServerGlobalRanks.push_back(srvRanks[i]);
+              }
+              else
+              {
+                if (rank_ == srvRanks[i]) serverLevel=1;
+              }
+            }
+            if (serverLevel==2)
+            {
+              info(50)<<"The number of secondary server pools is "<< sndServerGlobalRanks.size() <<endl ;
+              for (i=0; i<sndServerGlobalRanks.size(); i++)
+              {
+                if (rank_>= sndServerGlobalRanks[i])
+                {
+                  if ( i == sndServerGlobalRanks.size()-1)
+                  {
+                    myColor = colors.size() + sndServerGlobalRanks[i];
+                  }
+                  else if (rank_< sndServerGlobalRanks[i+1])
+                  {
+                    myColor = colors.size() + sndServerGlobalRanks[i];
+                    break;
+                  }
+                }
+              }
+            }
+          }
+        }
+
+        // (2) Create intraComm
+        if (serverLevel != 2) myColor=colors[hashServer];
+        MPI_Comm_split(CXios::globalComm, myColor, rank_, &intraComm) ;
+
+        // (3) Create interComm
+        if (serverLevel == 0)
+        {
+          int clientLeader;
+          for(it=leaders.begin();it!=leaders.end();it++)
+          {
+            if (it->first!=hashServer)
+            {
+              clientLeader=it->second ;
+              int intraCommSize, intraCommRank ;
+              MPI_Comm_size(intraComm,&intraCommSize) ;
+              MPI_Comm_rank(intraComm,&intraCommRank) ;
+              info(50)<<"intercommCreate::server (classical mode) "<<rank_<<" intraCommSize : "<<intraCommSize
+                       <<" intraCommRank :"<<intraCommRank<<"  clientLeader "<< clientLeader<<endl ;
+
+              MPI_Intercomm_create(intraComm, 0, CXios::globalComm, clientLeader, 0, &newComm) ;
+              interCommLeft.push_back(newComm) ;
+            }
+          }
+        }
+        else if (serverLevel == 1)
+        {
+          int clientLeader, srvSndLeader;
+          int srvPrmLeader ;
+
+          for (it=leaders.begin();it!=leaders.end();it++)
+          {
+            if (it->first != hashServer)
+            {
+              clientLeader=it->second ;
+              int intraCommSize, intraCommRank ;
+              MPI_Comm_size(intraComm, &intraCommSize) ;
+              MPI_Comm_rank(intraComm, &intraCommRank) ;
+              info(50)<<"intercommCreate::server (server level 1) "<<rank_<<" intraCommSize : "<<intraCommSize
+                       <<" intraCommRank :"<<intraCommRank<<"  clientLeader "<< clientLeader<<endl ;
+              MPI_Intercomm_create(intraComm, 0, CXios::globalComm, clientLeader, 0, &newComm) ;
+              interCommLeft.push_back(newComm) ;
+            }
+          }
+
+          for (int i = 0; i < sndServerGlobalRanks.size(); ++i)
+          {
+            int intraCommSize, intraCommRank ;
+            MPI_Comm_size(intraComm, &intraCommSize) ;
+            MPI_Comm_rank(intraComm, &intraCommRank) ;
+            info(50)<<"intercommCreate::client (server level 1) "<<rank_<<" intraCommSize : "<<intraCommSize
+                <<" intraCommRank :"<<intraCommRank<<"  clientLeader "<< sndServerGlobalRanks[i]<<endl ;
+            MPI_Intercomm_create(intraComm, 0, CXios::globalComm, sndServerGlobalRanks[i], 1, &newComm) ;
+            interCommRight.push_back(newComm) ;
+          }
+        }
+        else
+        {
+          int clientLeader;
+          clientLeader = leaders[hashString(CXios::xiosCodeId)];
+          int intraCommSize, intraCommRank ;
+          MPI_Comm_size(intraComm, &intraCommSize) ;
+          MPI_Comm_rank(intraComm, &intraCommRank) ;
+          info(50)<<"intercommCreate::server (server level 2) "<<rank_<<" intraCommSize : "<<intraCommSize
+                   <<" intraCommRank :"<<intraCommRank<<"  clientLeader "<< clientLeader<<endl ;
+
+          MPI_Intercomm_create(intraComm, 0, CXios::globalComm, clientLeader, 1, &newComm) ;
+          interCommLeft.push_back(newComm) ;
+        }
+
+        delete [] hashAll ;
+
       }
       // using OASIS
       else
       {
-//        int rank ,size;
         int size;
+        int myColor;
+        int* srvGlobalRanks;
         if (!is_MPI_Initialized) oasis_init(CXios::xiosCodeId);
 
@@ -111,10 +254,93 @@
         MPI_Comm localComm;
         oasis_get_localcomm(localComm);
-        MPI_Comm_dup(localComm, &intraComm);
-
-        MPI_Comm_rank(intraComm,&rank) ;
-        MPI_Comm_size(intraComm,&size) ;
+        MPI_Comm_rank(localComm,&rank_) ;
+
+//      (1) Create server intraComm
+        if (!CXios::usingServer2)
+        {
+          MPI_Comm_dup(localComm, &intraComm);
+        }
+        else
+        {
+          int globalRank;
+          MPI_Comm_size(localComm,&size) ;
+          MPI_Comm_rank(CXios::globalComm,&globalRank) ;
+          srvGlobalRanks = new int[size] ;
+          MPI_Allgather(&globalRank, 1, MPI_INT, srvGlobalRanks, 1, MPI_INT, localComm) ;
+
+          int reqNbProc = size*CXios::ratioServer2/100.;
+          if (reqNbProc < 1 || reqNbProc == size)
+          {
+            error(0)<<"WARNING: void CServer::initialize(void)"<<endl
+                << "It is impossible to dedicate the requested number of processes = "<<reqNbProc
+                <<" to secondary server. XIOS will run in the classical server mode."<<endl;
+            MPI_Comm_dup(localComm, &intraComm);
+          }
+          else
+          {
+            int firstSndSrvRank = size*(100.-CXios::ratioServer2)/100. ;
+            int poolLeader = firstSndSrvRank;
+//*********** (1) Comment out the line below to set one process per pool
+//            sndServerGlobalRanks.push_back(srvGlobalRanks[poolLeader]);
+            int nbPools = CXios::nbPoolsServer2;
+            if ( nbPools > reqNbProc || nbPools < 1)
+            {
+              error(0)<<"WARNING: void CServer::initialize(void)"<<endl
+                  << "It is impossible to allocate the requested number of pools = "<<nbPools
+                  <<" on the secondary server. It will be set so that there is one process per pool."<<endl;
+              nbPools = reqNbProc;
+            }
+            int remainder = ((int) (size*CXios::ratioServer2/100.)) % nbPools;
+            int procsPerPool = ((int) (size*CXios::ratioServer2/100.)) / nbPools;
+            for (int i=0; i<size; i++)
+            {
+              if (i >= firstSndSrvRank)
+              {
+                if (globalRank == srvGlobalRanks[i])
+                {
+                  serverLevel=2;
+                }
+                poolLeader += procsPerPool;
+                if (remainder != 0)
+                {
+                  ++poolLeader;
+                  --remainder;
+                }
+//*********** (2) Comment out the two lines below to set one process per pool
+//                if (poolLeader < size)
+//                  sndServerGlobalRanks.push_back(srvGlobalRanks[poolLeader]);
+//*********** (3) Uncomment the line below to set one process per pool
+                sndServerGlobalRanks.push_back(srvGlobalRanks[i]);
+              }
+              else
+              {
+                if (globalRank == srvGlobalRanks[i]) serverLevel=1;
+              }
+            }
+            if (serverLevel==2)
+            {
+              info(50)<<"The number of secondary server pools is "<< sndServerGlobalRanks.size() <<endl ;
+              for (int i=0; i<sndServerGlobalRanks.size(); i++)
+              {
+                if (globalRank>= sndServerGlobalRanks[i])
+                {
+                  if (i == sndServerGlobalRanks.size()-1)
+                  {
+                    myColor = sndServerGlobalRanks[i];
+                  }
+                  else if (globalRank< sndServerGlobalRanks[i+1])
+                  {
+                    myColor = sndServerGlobalRanks[i];
+                    break;
+                  }
+                }
+              }
+            }
+            if (serverLevel != 2) myColor=0;
+            MPI_Comm_split(localComm, myColor, rank_, &intraComm) ;
+          }
+        }
+
         string codesId=CXios::getin<string>("oasis_codes_id") ;
-
         vector<string> splitted ;
         boost::split( splitted, codesId, boost::is_any_of(","), boost::token_compress_on ) ;
@@ -125,16 +351,44 @@
         MPI_Comm_rank(CXios::globalComm,&globalRank);
 
+//      (2) Create interComms with models
         for(it=splitted.begin();it!=splitted.end();it++)
         {
           oasis_get_intercomm(newComm,*it) ;
-          if (rank==0) MPI_Send(&globalRank,1,MPI_INT,0,0,newComm) ;
-          MPI_Comm_remote_size(newComm,&size);
-          interComm.push_back(newComm) ;
-        }
-	      oasis_enddef() ;
+          if ( serverLevel == 0 || serverLevel == 1)
+          {
+            interCommLeft.push_back(newComm) ;
+            if (rank_==0) MPI_Send(&globalRank,1,MPI_INT,0,0,newComm) ;
+          }
+        }
+
+//      (3) Create interComms between primary and secondary servers
+        int intraCommSize, intraCommRank ;
+        MPI_Comm_size(intraComm,&intraCommSize) ;
+        MPI_Comm_rank(intraComm, &intraCommRank) ;
+
+        if (serverLevel == 1)
+        {
+          for (int i = 0; i < sndServerGlobalRanks.size(); ++i)
+          {
+            int srvSndLeader = sndServerGlobalRanks[i];
+            info(50)<<"intercommCreate::client (server level 1) "<<globalRank<<" intraCommSize : "<<intraCommSize
+                <<" intraCommRank :"<<intraCommRank<<"  clientLeader "<< srvSndLeader<<endl ;
+            MPI_Intercomm_create(intraComm, 0, CXios::globalComm, srvSndLeader, 0, &newComm) ;
+            interCommRight.push_back(newComm) ;
+          }
+        }
+        else if (serverLevel == 2)
+        {
+          info(50)<<"intercommCreate::server (server level 2)"<<globalRank<<" intraCommSize : "<<intraCommSize
+                   <<" intraCommRank :"<<intraCommRank<<"  clientLeader "<< srvGlobalRanks[0] <<endl ;
+          MPI_Intercomm_create(intraComm, 0, CXios::globalComm, srvGlobalRanks[0], 0, &newComm) ;
+          interCommLeft.push_back(newComm) ;
+        }
+        if (CXios::usingServer2) delete [] srvGlobalRanks ;
+        oasis_enddef() ;
       }
 
-//      int rank;
-      MPI_Comm_rank(intraComm,&rank) ;
+
+      MPI_Comm_rank(intraComm, &rank) ;
       if (rank==0) isRoot=true;
       else isRoot=false;
@@ -151,6 +405,17 @@
       for (std::list<MPI_Comm>::iterator it = contextInterComms.begin(); it != contextInterComms.end(); it++)
         MPI_Comm_free(&(*it));
-      for (std::list<MPI_Comm>::iterator it = interComm.begin(); it != interComm.end(); it++)
+
+      for (std::list<MPI_Comm>::iterator it = contextIntraComms.begin(); it != contextIntraComms.end(); it++)
         MPI_Comm_free(&(*it));
+
+//      for (std::list<MPI_Comm>::iterator it = interComm.begin(); it != interComm.end(); it++)
+//        MPI_Comm_free(&(*it));
+
+//        for (std::list<MPI_Comm>::iterator it = interCommLeft.begin(); it != interCommLeft.end(); it++)
+//          MPI_Comm_free(&(*it));
+
+        for (std::list<MPI_Comm>::iterator it = interCommRight.begin(); it != interCommRight.end(); it++)
+          MPI_Comm_free(&(*it));
+
       MPI_Comm_free(&intraComm);
 
@@ -176,4 +441,5 @@
          {
            listenContext();
+           listenRootContext();
            if (!finished) listenFinalize() ;
          }
@@ -193,9 +459,9 @@
      void CServer::listenFinalize(void)
      {
-        list<MPI_Comm>::iterator it;
+        list<MPI_Comm>::iterator it, itr;
         int msg ;
         int flag ;
 
-        for(it=interComm.begin();it!=interComm.end();it++)
+        for(it=interCommLeft.begin();it!=interCommLeft.end();it++)
         {
            MPI_Status status ;
@@ -207,11 +473,16 @@
               MPI_Recv(&msg,1,MPI_INT,0,0,*it,&status) ;
               info(20)<<" CServer : Receive client finalize"<<endl ;
+              // Sending server finalize message to secondary servers (if any)
+              for(itr=interCommRight.begin();itr!=interCommRight.end();itr++)
+              {
+                MPI_Send(&msg,1,MPI_INT,0,0,*itr) ;
+              }
               MPI_Comm_free(&(*it));
-              interComm.erase(it) ;
+              interCommLeft.erase(it) ;
               break ;
             }
          }
 
-         if (interComm.empty())
+         if (interCommLeft.empty())
          {
            int i,size ;
@@ -289,7 +560,6 @@
      void CServer::recvContextMessage(void* buff,int count)
      {
-       static map<string,contextMessage> recvContextId ;
+       static map<string,contextMessage> recvContextId;
        map<string,contextMessage>::iterator it ;
-
        CBufferIn buffer(buff,count) ;
        string id ;
@@ -314,13 +584,21 @@
          int size ;
          MPI_Comm_size(intraComm,&size) ;
-         MPI_Request* requests= new MPI_Request[size-1] ;
-         MPI_Status* status= new MPI_Status[size-1] ;
-
-         for(int i=1;i<size;i++)
-         {
-            MPI_Isend(buff,count,MPI_CHAR,i,2,intraComm,&requests[i-1]) ;
-         }
-         MPI_Waitall(size-1,requests,status) ;
-         registerContext(buff,count,it->second.leaderRank) ;
+//         MPI_Request* requests= new MPI_Request[size-1] ;
+//         MPI_Status* status= new MPI_Status[size-1] ;
+         MPI_Request* requests= new MPI_Request[size] ;
+         MPI_Status* status= new MPI_Status[size] ;
+
+         CMessage msg ;
+         msg<<id<<it->second.leaderRank;
+         int messageSize=msg.size() ;
+         void * sendBuff = new char[messageSize] ;
+         CBufferOut sendBuffer(sendBuff,messageSize) ;
+         sendBuffer<<msg ;
+
+         // Include root itself in order not to have a divergence
+         for(int i=0; i<size; i++)
+         {
+           MPI_Isend(sendBuff,sendBuffer.count(),MPI_CHAR,i,2,intraComm,&requests[i]) ;
+         }
 
          recvContextId.erase(it) ;
@@ -333,38 +611,52 @@
      void CServer::listenRootContext(void)
      {
-
        MPI_Status status ;
        int flag ;
-       static char* buffer ;
-       static MPI_Request request ;
-       static bool recept=false ;
+       static std::vector<void*> buffers;
+       static std::vector<MPI_Request> requests ;
+       static std::vector<int> counts ;
+       static std::vector<bool> isEventRegistered ;
+       static std::vector<bool> isEventQueued ;
+       MPI_Request request;
+
        int rank ;
-       int count ;
        const int root=0 ;
-
-       if (recept==false)
-       {
-         traceOff() ;
-         MPI_Iprobe(root,2,intraComm, &flag, &status) ;
-         traceOn() ;
-         if (flag==true)
-         {
-           MPI_Get_count(&status,MPI_CHAR,&count) ;
-           buffer=new char[count] ;
-           MPI_Irecv((void*)buffer,count,MPI_CHAR,root,2,intraComm,&request) ;
-           recept=true ;
-         }
-       }
-       else
-       {
-         MPI_Test(&request,&flag,&status) ;
-         if (flag==true)
-         {
-           MPI_Get_count(&status,MPI_CHAR,&count) ;
-           registerContext((void*)buffer,count) ;
-           delete [] buffer ;
-           recept=false ;
-         }
-       }
+       boost::hash<string> hashString;
+       size_t hashId = hashString("RegisterContext");
+
+       // (1) Receive context id from the root, save it into a buffer
+       traceOff() ;
+       MPI_Iprobe(root,2,intraComm, &flag, &status) ;
+       traceOn() ;
+       if (flag==true)
+       {
+         counts.push_back(0);
+         MPI_Get_count(&status,MPI_CHAR,&(counts.back())) ;
+         buffers.push_back(new char[counts.back()]) ;
+         requests.push_back(request);
+         MPI_Irecv((void*)(buffers.back()),counts.back(),MPI_CHAR,root,2,intraComm,&(requests.back())) ;
+         isEventRegistered.push_back(false);
+         isEventQueued.push_back(false);
+         nbContexts++;
+       }
+
+       for (int ctxNb = 0; ctxNb < nbContexts; ctxNb++ )
+       {
+         // (2) If context id is received, register an event
+         MPI_Test(&requests[ctxNb],&flag,&status) ;
+         if (flag==true && !isEventRegistered[ctxNb])
+         {
+           eventScheduler->registerEvent(ctxNb,hashId);
+           isEventRegistered[ctxNb] = true;
+         }
+         // (3) If event has been scheduled, call register context
+         if (eventScheduler->queryEvent(ctxNb,hashId) && !isEventQueued[ctxNb])
+         {
+           registerContext(buffers[ctxNb],counts[ctxNb]) ;
+           isEventQueued[ctxNb] = true;
+           delete [] buffers[ctxNb] ;
+         }
+       }
+
      }
 
@@ -373,5 +665,7 @@
        string contextId;
        CBufferIn buffer(buff, count);
-       buffer >> contextId;
+//       buffer >> contextId;
+       buffer >> contextId>>leaderRank;
+       CContext* context;
 
        info(20) << "CServer : Register new Context : " << contextId << endl;
@@ -381,39 +675,92 @@
                << "Context '" << contextId << "' has already been registred");
 
-       MPI_Comm contextIntercomm;
-       MPI_Intercomm_create(intraComm,0,CXios::globalComm,leaderRank,10+leaderRank,&contextIntercomm);
-
+       context=CContext::create(contextId);
+       contextList[contextId]=context;
+
+       // Primary or classical server: create communication channel with a client
+       // (1) create interComm (with a client)
+       // (2) initialize client and server (contextClient and contextServer)
        MPI_Comm inter;
-       MPI_Intercomm_merge(contextIntercomm,1,&inter);
-       MPI_Barrier(inter);
-
-       CContext* context=CContext::create(contextId);
-       contextList[contextId]=context;
-       context->initServer(intraComm,contextIntercomm);
-
-       contextInterComms.push_back(contextIntercomm);
-       MPI_Comm_free(&inter);
+       if (serverLevel < 2)
+       {
+         MPI_Comm contextInterComm;
+         MPI_Intercomm_create(intraComm, 0, CXios::globalComm, leaderRank, 10+leaderRank, &contextInterComm);
+         MPI_Intercomm_merge(contextInterComm,1,&inter);
+         MPI_Barrier(inter);
+         MPI_Comm_free(&inter);
+         context->initServer(intraComm,contextInterComm);
+         contextInterComms.push_back(contextInterComm);
+
+       }
+       // Secondary server: create communication channel with a primary server
+       // (1) duplicate interComm with a primary server
+       // (2) initialize client and server (contextClient and contextServer)
+       // Remark: in the case of the secondary server there is no need to create an interComm calling MPI_Intercomm_create,
+       //         because interComm of CContext is defined on the same processes as the interComm of CServer.
+       //         So just duplicate it.
+       else if (serverLevel == 2)
+       {
+         MPI_Comm_dup(interCommLeft.front(), &inter);
+         contextInterComms.push_back(inter);
+         context->initServer(intraComm, contextInterComms.back());
+       }
+
+       // Primary server:
+       // (1) send create context message to secondary servers
+       // (2) initialize communication channels with secondary servers (create contextClient and contextServer)
+       if (serverLevel == 1)
+       {
+         int i = 0, size;
+         MPI_Comm_size(intraComm, &size) ;
+         for (std::list<MPI_Comm>::iterator it = interCommRight.begin(); it != interCommRight.end(); it++, ++i)
+         {
+           StdString str = contextId +"_server_" + boost::lexical_cast<string>(i);
+           CMessage msg;
+           int messageSize;
+           msg<<str<<size<<rank_ ;
+           messageSize = msg.size() ;
+           buff = new char[messageSize] ;
+           CBufferOut buffer(buff,messageSize) ;
+           buffer<<msg ;
+           MPI_Send(buff, buffer.count(), MPI_CHAR, sndServerGlobalRanks[i], 1, CXios::globalComm) ;
+           MPI_Comm_dup(*it, &inter);
+           contextInterComms.push_back(inter);
+           MPI_Comm_dup(intraComm, &inter);
+           contextIntraComms.push_back(inter);
+           context->initClient(contextIntraComms.back(), contextInterComms.back()) ;
+           delete [] buff ;
+         }
+       }
      }
 
-     void CServer::contextEventLoop(void)
-     {
-       bool finished ;
+     void CServer::contextEventLoop(bool enableEventsProcessing /*= true*/)
+     {
+       bool isFinalized ;
        map<string,CContext*>::iterator it ;
+
        for(it=contextList.begin();it!=contextList.end();it++)
        {
-         finished=it->second->checkBuffersAndListen();
-         if (finished)
+         isFinalized=it->second->isFinalized();
+         if (isFinalized)
          {
            contextList.erase(it) ;
            break ;
          }
-       }
-
+         else
+           it->second->checkBuffersAndListen(enableEventsProcessing);
+       }
      }
 
-     //! Get rank of the current process
+     //! Get rank of the current process in the intraComm
      int CServer::getRank()
      {
+       int rank;
+       MPI_Comm_rank(intraComm,&rank);
        return rank;
+     }
+
+     vector<int>& CServer::getSecondaryServerGlobalRanks()
+     {
+       return sndServerGlobalRanks;
      }
 
@@ -431,4 +778,5 @@
       int numDigit = 0;
       int size = 0;
+      int id;
       MPI_Comm_size(CXios::globalComm, &size);
       while (size)
@@ -437,6 +785,7 @@
         ++numDigit;
       }
-
-      fileNameClient << fileName << "_" << std::setfill('0') << std::setw(numDigit) << getRank() << ext;
+      id = rank_; //getRank();
+
+      fileNameClient << fileName << "_" << std::setfill('0') << std::setw(numDigit) << id << ext;
       fb->open(fileNameClient.str().c_str(), std::ios::out);
       if (!fb->is_open())
Index: /XIOS/trunk/src/server.hpp
===================================================================
--- /XIOS/trunk/src/server.hpp	(revision 1536)
+++ /XIOS/trunk/src/server.hpp	(revision 1537)
@@ -16,5 +16,5 @@
         static void finalize(void);
         static void eventLoop(void);
-        static void contextEventLoop(void);
+        static void contextEventLoop(bool enableEventsProcessing=true);
         static void listenContext(void);
         static void listenFinalize(void);
@@ -25,8 +25,12 @@
 
         static MPI_Comm intraComm;
-        static list<MPI_Comm> interComm;
-        static std::list<MPI_Comm> contextInterComms;
+        static std::list<MPI_Comm> interCommLeft;           // interComm between server (primary, classical or secondary) and its client (client or primary server)
+        static std::list<MPI_Comm> interCommRight;          // interComm between primary server and secondary server (non-empty only for primary server pool)
+        static std::list<MPI_Comm> contextInterComms;  // list of context intercomms
+        static std::list<MPI_Comm> contextIntraComms;  // list of context intercomms (needed only in case of secondary servers)
         static CEventScheduler* eventScheduler;
-        
+
+        static int serverLevel ;
+
         struct contextMessage
         {
@@ -42,6 +46,9 @@
 
       public:
-        //! Get rank of the current process
+        //! Get rank of the current process in the intraComm
         static int getRank();
+
+        //!< Get global ranks of secondary server processes
+        static vector<int>& getSecondaryServerGlobalRanks();
 
         //! Open a file stream to write the info logs
@@ -60,5 +67,7 @@
 
       private:
-        static int rank;
+        static vector<int> sndServerGlobalRanks;  //!< Global ranks of pool leaders on the secondary server
+        static int rank_;                         //!< If (!oasis) global rank, else rank in the intraComm returned by oasis
+        static int nbContexts;                    //!< Number of contexts registered by server
         static StdOFStream m_infoStream;
         static StdOFStream m_errorStream;
Index: /XIOS/trunk/src/server_distribution_description.cpp
===================================================================
--- /XIOS/trunk/src/server_distribution_description.cpp	(revision 1536)
+++ /XIOS/trunk/src/server_distribution_description.cpp	(revision 1537)
@@ -29,4 +29,17 @@
 { /* 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).
@@ -100,11 +113,15 @@
   \param [in] positionDimensionDistributed dimension of server on which we make the cut.
 */
-void CServerDistributionDescription::computeServerGlobalIndexInRange(const std::pair<size_t, size_t>& indexBeginEnd,
+std::vector<int> CServerDistributionDescription::computeServerGlobalIndexInRange(const std::pair<size_t, size_t>& indexBeginEnd,
                                                                      int positionDimensionDistributed)
 {
-  switch (serverType_) {
+  int nBand  = 0;
+  switch (serverType_)
+  {
     case BAND_DISTRIBUTION:
-      computeBandDistribution(nServer_, positionDimensionDistributed);
-      break;
+      nBand = computeBandDistribution(nServer_, positionDimensionDistributed);
+      break;
+    case ROOT_DISTRIBUTION:
+      nBand = computeRootDistribution(nServer_);
     default:
       break;
@@ -122,5 +139,5 @@
   std::vector<int> currentIndex(dim);
 
-  for (int idxServer = 0; idxServer < nServer_; ++idxServer)
+  for (int idxServer = 0; idxServer < nBand; ++idxServer)
   {
     size_t ssize = 1, idx = 0;
@@ -161,4 +178,11 @@
     }
   }
+
+    // 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;
 }
 
@@ -172,13 +196,14 @@
   \param [in] positionDimensionDistributed dimension of server on which we make the cut.
 */
-void CServerDistributionDescription::computeServerGlobalByElement(std::vector<boost::unordered_map<size_t,std::vector<int> > >& indexServerOnElement,
-                                                                  int clientRank,
-                                                                  int clientSize,
-                                                                  const CArray<int,1>& axisDomainOrder,
-                                                                  int positionDimensionDistributed)
-{
+std::vector<int> CServerDistributionDescription::computeServerGlobalByElement(std::vector<boost::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:
-      computeBandDistribution(nServer_, positionDimensionDistributed);
+      nBand = computeBandDistribution(nServer_, positionDimensionDistributed);
       break;
     default:
@@ -194,8 +219,9 @@
     idxMap[i] = idx;
     if (2 == axisDomainOrder(i)) idx += 2;
-    else ++idx;
-  }
-
-  for (int idxServer = 0; idxServer < nServer_; ++idxServer)
+    else if (1 == axisDomainOrder(i)) idx += 1;
+    // nothing for scalar
+  }
+
+  for (int idxServer = 0; idxServer < nBand; ++idxServer)
   {
     std::vector<int> elementDimension(4);
@@ -247,4 +273,11 @@
     }
   }
+
+  // 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;
 }
 
@@ -297,5 +330,5 @@
   \param [in] nServer number of server
 */
-void CServerDistributionDescription::computeBandDistribution(int nServer, int positionDimensionDistributed)
+int CServerDistributionDescription::computeBandDistribution(int nServer, int positionDimensionDistributed)
 {
   int dim = nGlobal_.size();
@@ -324,13 +357,19 @@
   int positionDistributed = (1<dim) ? positionDimensionDistributed_ : 0;
   nGlobTemp = nGlobal_[positionDistributed];
-
-  for (int i = 0; i < nServer; ++i)
+  int nbBand = std::min(nGlobTemp, nServer);
+
+  for (int i = 0; i < nbBand; ++i)
   {
     if (0 < i) njRangeBegin[i] = njRangeEnd[i-1];
-    njRangeSize = nGlobTemp / nServer;
-    if (i < nGlobTemp%nServer) ++njRangeSize;
+    njRangeSize = nGlobTemp / nbBand;
+    if (i < nGlobTemp%nbBand) ++njRangeSize;
     njRangeEnd[i] = njRangeSize + njRangeBegin[i];
   }
-  njRangeEnd[nServer-1] = nGlobTemp;
+  njRangeEnd[nbBand-1] = nGlobTemp;
+
+  for (int i = nbBand; i < nServer; ++i)
+  {
+    njRangeBegin[i] = njRangeEnd[i] = 0;
+  }
 
   for (int i = 0; i < nServer; ++i)
@@ -358,5 +397,86 @@
     }
   }
-}
+
+  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;
+}
+
+
+
 
 /*!
Index: /XIOS/trunk/src/server_distribution_description.hpp
===================================================================
--- /XIOS/trunk/src/server_distribution_description.hpp	(revision 1536)
+++ /XIOS/trunk/src/server_distribution_description.hpp	(revision 1537)
@@ -26,5 +26,5 @@
     enum ServerDistributionType
     {
-      BAND_DISTRIBUTION, PLAN_DISTRIBUTION
+      BAND_DISTRIBUTION, PLAN_DISTRIBUTION, ROOT_DISTRIBUTION
     };
 
@@ -38,10 +38,10 @@
 
     void computeServerDistribution(bool doComputeGlobalIndex = false, int positionDimensionDistributed = 1);
-    void computeServerGlobalIndexInRange(const std::pair<size_t, size_t>& indexBeginEnd, int positionDimensionDistributed = 1);
-    void computeServerGlobalByElement(std::vector<boost::unordered_map<size_t,std::vector<int> > >& indexServerOnElement,
-                                      int rank,
-                                      int clientSize,
-                                      const CArray<int,1>& axisDomainOrder,
-                                      int positionDimensionDistributed = 1);
+    std::vector<int> computeServerGlobalIndexInRange(const std::pair<size_t, size_t>& indexBeginEnd, int positionDimensionDistributed = 1);
+    std::vector<int> computeServerGlobalByElement(std::vector<boost::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;
@@ -51,6 +51,10 @@
     int getDimensionDistributed();
 
+    static int defaultDistributedDimension(int gridDimension,                                   
+                                           ServerDistributionType serType=BAND_DISTRIBUTION);
+
   protected:
-    void computeBandDistribution(int nServer, int positionDimensionDistributed = 1);
+    int computeBandDistribution(int nServer, int positionDimensionDistributed = 1);
+    int computeRootDistribution(int nServer, int positionDimensionDistributed = 1);
     void computePlanDistribution(int nServer);
     void computeRangeProcIndex(int clientRank,
Index: /XIOS/trunk/src/test/test_client.f90
===================================================================
--- /XIOS/trunk/src/test/test_client.f90	(revision 1536)
+++ /XIOS/trunk/src/test/test_client.f90	(revision 1537)
@@ -20,5 +20,5 @@
   INTEGER,PARAMETER :: nj_glo=100
   INTEGER,PARAMETER :: llm=5
-  DOUBLE PRECISION  :: lval(llm)=1
+  DOUBLE PRECISION  :: lval(llm)=1, scalar = 5
   TYPE(xios_field) :: field_hdl
   TYPE(xios_fieldgroup) :: fieldgroup_hdl
@@ -28,5 +28,5 @@
   DOUBLE PRECISION,DIMENSION(ni_glo,nj_glo) :: lon_glo,lat_glo
   DOUBLE PRECISION :: field_A_glo(ni_glo,nj_glo,llm)
-  DOUBLE PRECISION,ALLOCATABLE :: lon(:,:),lat(:,:),field_A(:,:,:), lonvalue(:,:) ;
+  DOUBLE PRECISION,ALLOCATABLE :: lon(:,:),lat(:,:),field_A(:,:,:), lonvalue(:,:), axisValue(:), field_domain(:,:) ;
   INTEGER :: ni,ibegin,iend,nj,jbegin,jend
   INTEGER :: i,j,l,ts,n
@@ -50,5 +50,5 @@
       lat_glo(i,j)=1000+(i-1)+(j-1)*ni_glo
       DO l=1,llm
-        field_A_glo(i,j,l)=(i-1)+(j-1)*ni_glo+10000*l
+        field_A_glo(i,j,l)=(i-1)+(j-1)*ni_glo*100+10000*l
       ENDDO
     ENDDO
@@ -66,8 +66,10 @@
   iend=ibegin+ni-1 ; jend=jbegin+nj-1
 
-  ALLOCATE(lon(ni,nj),lat(ni,nj),field_A(0:ni+1,-1:nj+2,llm),lonvalue(ni,nj))
+  ALLOCATE(lon(ni,nj),lat(ni,nj),field_A(0:ni+1,-1:nj+2,llm),lonvalue(ni,nj), axisValue(nj_glo), field_domain(0:ni+1,-1:nj+2))
   lon(:,:)=lon_glo(ibegin+1:iend+1,jbegin+1:jend+1)
   lat(:,:)=lat_glo(ibegin+1:iend+1,jbegin+1:jend+1)
   field_A(1:ni,1:nj,:)=field_A_glo(ibegin+1:iend+1,jbegin+1:jend+1,:)
+  field_domain(1:ni,1:nj) = field_A_glo(ibegin+1:iend+1,jbegin+1:jend+1,1)
+  axisValue(1:nj_glo)=field_A_glo(1,1:nj_glo,1);
 
   CALL xios_context_initialize("test",comm)
@@ -78,4 +80,5 @@
   PRINT *, "calendar_type = ", calendar_type
 
+  ! CALL xios_set_axis_attr("axis_A",n_glo=nj_glo ,value=axisValue, n=nj, begin=jbegin) ;
   CALL xios_set_axis_attr("axis_A",n_glo=llm ,value=lval) ;
   CALL xios_set_domain_attr("domain_A",ni_glo=ni_glo, nj_glo=nj_glo, ibegin=ibegin, ni=ni,jbegin=jbegin,nj=nj,type='curvilinear')
@@ -84,11 +87,11 @@
   CALL xios_set_fieldgroup_attr("field_definition",enabled=.TRUE.)
 
-  CALL xios_get_handle("field_definition",fieldgroup_hdl)
-  CALL xios_add_child(fieldgroup_hdl,field_hdl,"field_B")
-  CALL xios_set_attr(field_hdl,field_ref="field_A",name="field_B")
+  !CALL xios_get_handle("field_definition",fieldgroup_hdl)
+  !CALL xios_add_child(fieldgroup_hdl,field_hdl,"field_B")
+  !CALL xios_set_attr(field_hdl,field_ref="field_A",name="field_B")
 
-  CALL xios_get_handle("output",file_hdl)
-  CALL xios_add_child(file_hdl,field_hdl)
-  CALL xios_set_attr(field_hdl,field_ref="field_A_zoom",name="field_C")
+  !CALL xios_get_handle("output",file_hdl)
+  !CALL xios_add_child(file_hdl,field_hdl)
+  !CALL xios_set_attr(field_hdl,field_ref="field_A_zoom",name="field_C")
 
   dtime%second = 3600
@@ -128,7 +131,12 @@
 
   PRINT*,"field field_A is active ? ",xios_field_is_active("field_A")
-  DO ts=1,24*10
+  ! CALL xios_recv_field("field", scalar)
+  DO ts=1,4
     CALL xios_update_calendar(ts)
     CALL xios_send_field("field_A",field_A)
+    CALL xios_send_field("field_Axis",axisValue)
+    ! CALL xios_send_field("field_Axis",lval)
+    CALL xios_send_field("field_Domain",field_domain)
+    CALL xios_send_field("field_Scalar",scalar)
     CALL wait_us(5000) ;
   ENDDO
Index: OS/trunk/src/test/test_connectivity_expand.f90
===================================================================
--- /XIOS/trunk/src/test/test_connectivity_expand.f90	(revision 1536)
+++ 	(revision )
@@ -1,114 +1,0 @@
-PROGRAM test_connectivity_expand
-
-  USE xios
-  USE mod_wait
-  IMPLICIT NONE
-  INCLUDE "mpif.h"
-  INTEGER :: rank
-  INTEGER :: size
-  INTEGER :: ierr
-
-  CHARACTER(len=*),PARAMETER :: id="client"
-  INTEGER :: comm
-  TYPE(xios_duration) :: dtime
-  CHARACTER(len=20) :: dtime_str
-  TYPE(xios_date) :: date
-  CHARACTER(len=20) :: date_str
-  CHARACTER(len=15) :: calendar_type
-  TYPE(xios_context) :: ctx_hdl
-  INTEGER,PARAMETER :: ni_glo=100
-  INTEGER,PARAMETER :: nj_glo=100
-  INTEGER,PARAMETER :: llm=5
-  DOUBLE PRECISION  :: lval(llm)=1
-  TYPE(xios_field) :: field_hdl
-  TYPE(xios_fieldgroup) :: fieldgroup_hdl
-  TYPE(xios_file) :: file_hdl
-  LOGICAL :: ok
-
-  DOUBLE PRECISION,DIMENSION(ni_glo,nj_glo) :: lon_glo,lat_glo
-  DOUBLE PRECISION :: field_A_glo(ni_glo,nj_glo,llm)
-  DOUBLE PRECISION,ALLOCATABLE :: lon(:,:),lat(:,:),field_A(:,:,:), lonvalue(:,:) ;
-  INTEGER :: ni,ibegin,iend,nj,jbegin,jend
-  INTEGER :: i,j,l,ts,n
-
-!!! MPI Initialization
-  CALL MPI_INIT(ierr)
-  CALL init_wait
-
-!!! XIOS Initialization (get the local communicator)
-  CALL xios_initialize(id,return_comm=comm)
-
-  CALL MPI_COMM_RANK(comm,rank,ierr)
-  CALL MPI_COMM_SIZE(comm,size,ierr)
-
-  DO j=1,nj_glo
-    DO i=1,ni_glo
-      lon_glo(i,j)=(i-1)+(j-1)*ni_glo
-      lat_glo(i,j)=1000+(i-1)+(j-1)*ni_glo
-      DO l=1,llm
-        field_A_glo(i,j,l)=(i-1)+(j-1)*ni_glo+10000*l
-      ENDDO
-    ENDDO
-  ENDDO
-  ni=ni_glo ; ibegin=0
-
-  jbegin=0
-  DO n=0,size-1
-    nj=nj_glo/size
-    IF (n<MOD(nj_glo,size)) nj=nj+1
-    IF (n==rank) exit
-    jbegin=jbegin+nj
-  ENDDO
-
-  iend=ibegin+ni-1 ; jend=jbegin+nj-1
-
-  ALLOCATE(lon(ni,nj),lat(ni,nj),field_A(0:ni+1,-1:nj+2,llm),lonvalue(ni,nj))
-  lon(:,:)=lon_glo(ibegin+1:iend+1,jbegin+1:jend+1)
-  lat(:,:)=lat_glo(ibegin+1:iend+1,jbegin+1:jend+1)
-  field_A(1:ni,1:nj,:)=field_A_glo(ibegin+1:iend+1,jbegin+1:jend+1,:)
-
-  CALL xios_context_initialize("test",comm)
-  CALL xios_get_handle("test",ctx_hdl)
-  CALL xios_set_current_context(ctx_hdl)
-
-  CALL xios_get_calendar_type(calendar_type)
-  PRINT *, "calendar_type = ", calendar_type
-
-  CALL xios_set_axis_attr("axis_A",n_glo=llm ,value=lval) ;
-  CALL xios_set_domain_attr("domain_A",ni_glo=ni_glo, nj_glo=nj_glo, ibegin=ibegin, ni=ni,jbegin=jbegin,nj=nj,type='curvilinear')
-  CALL xios_set_domain_attr("domain_A",data_dim=2, data_ibegin=-1, data_ni=ni+2, data_jbegin=-2, data_nj=nj+4)
-  CALL xios_set_domain_attr("domain_A",lonvalue_2D=lon,latvalue_2D=lat)
-  CALL xios_set_fieldgroup_attr("field_definition",enabled=.TRUE.)
-
-  dtime%second = 3600
-  CALL xios_set_timestep(dtime)
-
-  CALL xios_close_context_definition()
-
-  CALL xios_get_domain_attr("domain_A",ni=ni,ibegin=ibegin, nj=nj, jbegin=jbegin)
-  PRINT*, "domain_A attributes are ni = ",ni, ", ibegin = ", ibegin, ", nj= ", nj, ",jbegin = ", jbegin 
-  CALL xios_get_domain_attr("domain_B",ni=ni,ibegin=ibegin, nj=nj, jbegin=jbegin)
-  PRINT*, "domain_B attributes are ni = ",ni, ", ibegin = ", ibegin, ", nj= ", nj, ",jbegin = ", jbegin 
-  
-  DO ts=1,24
-    CALL xios_update_calendar(ts)
-    CALL xios_send_field("field_A",field_A)
-    CALL wait_us(5000) ;
-  ENDDO
-
-  CALL xios_context_finalize()
-
-  DEALLOCATE(lon, lat, field_A, lonvalue)
-
-  CALL MPI_COMM_FREE(comm, ierr)
-
-  CALL xios_finalize()
-
-  CALL MPI_FINALIZE(ierr)
-
-END PROGRAM test_connectivity_expand
-
-
-
-
-
Index: /XIOS/trunk/src/test/test_diurnal_cycle.f90
===================================================================
--- /XIOS/trunk/src/test/test_diurnal_cycle.f90	(revision 1537)
+++ /XIOS/trunk/src/test/test_diurnal_cycle.f90	(revision 1537)
@@ -0,0 +1,101 @@
+PROGRAM test_diurnal_cycle
+
+  USE xios
+  USE mod_wait
+  IMPLICIT NONE
+  INCLUDE "mpif.h"
+  INTEGER :: rank
+  INTEGER :: size
+  INTEGER :: ierr
+
+  CHARACTER(len=*),PARAMETER :: id="client"
+  INTEGER :: comm
+  TYPE(xios_duration) :: dtime
+  TYPE(xios_context) :: ctx_hdl
+  INTEGER,PARAMETER :: llm=10
+  DOUBLE PRECISION  :: value_glo(0:llm-1)
+  DOUBLE PRECISION,ALLOCATABLE :: axisValue(:)
+  DOUBLE PRECISION,ALLOCATABLE :: field_A(:,:)
+  INTEGER :: i,j,l,ts,nl,begin
+
+!!! MPI Initialization
+
+  CALL MPI_INIT(ierr)
+  CALL MPI_COMM_RANK(MPI_COMM_WORLD,rank,ierr)
+  
+  IF (rank>3) THEN 
+    CALL xios_init_server
+  ELSE
+  
+  CALL init_wait
+
+!!! XIOS Initialization (get the local communicator)
+
+  CALL xios_initialize(id,return_comm=comm)
+
+  CALL MPI_COMM_RANK(comm,rank,ierr)
+  CALL MPI_COMM_SIZE(comm,size,ierr)
+
+  CALL xios_context_initialize("test",comm)
+  CALL xios_get_handle("test",ctx_hdl)
+  CALL xios_set_current_context(ctx_hdl)
+
+  nl=llm/size
+  
+  IF (rank<MOD(llm,size)) THEN 
+    nl=nl+1
+    begin=rank*nl
+  ELSE
+    begin=(nl+1)*MOD(llm,size) + nl*(rank-MOD(llm,size))
+  ENDIF
+  DO i=0,llm-1
+    value_glo(i)=i
+  ENDDO
+
+
+  IF (rank==0) THEN
+    begin=0 ; nl=6
+  ELSE IF (rank==1) THEN
+    begin=0 ; nl=6
+  ELSE IF (rank==2) THEN
+    begin=0 ; nl=6
+  ELSE IF (rank==3) THEN
+    begin=6 ; nl=4
+  ENDIF
+
+  ALLOCATE(axisValue(0:nl-1))
+  ALLOCATE(field_A(0:nl-1,0:llm-1))
+  axisValue(:)=value_glo(begin:begin+nl-1)
+  DO i=0,llm-1
+    field_A(:,i)=10*i+value_glo(begin:begin+nl-1)
+  ENDDO
+  
+  CALL xios_set_axis_attr("axis_A",n_glo=llm , begin=begin, n=nl,value=axisValue) ;
+
+  dtime%second = 3600
+  CALL xios_set_timestep(dtime)
+  CALL xios_close_context_definition()
+ 
+  DO ts=1,8
+    CALL xios_update_calendar(ts)
+    CALL xios_send_field("field_A",field_A(:,:))
+    field_A=field_A+100
+    CALL wait_us(5000) ;
+  ENDDO
+
+  CALL xios_context_finalize()
+
+  CALL MPI_COMM_FREE(comm, ierr)
+
+  CALL xios_finalize()
+  
+  ENDIF
+  
+  CALL MPI_FINALIZE(ierr)
+
+END PROGRAM test_diurnal_cycle
+
+
+
+
+
Index: OS/trunk/src/test/test_expand_domain.f90
===================================================================
--- /XIOS/trunk/src/test/test_expand_domain.f90	(revision 1536)
+++ 	(revision )
@@ -1,173 +1,0 @@
-! This program is for testing expanding a domain
-! There are two parts:
-! +) Simulate data from model then do expand domain on these data
-! +) Read data from file then do expand domain on these data
-PROGRAM test_expand_domain
-
-  USE xios
-  USE mod_wait
-  IMPLICIT NONE
-  INCLUDE "mpif.h"
-  INTEGER :: rank
-  INTEGER :: size
-  INTEGER :: ierr
-
-  CHARACTER(len=*),PARAMETER :: id="client"
-  INTEGER :: comm
-  TYPE(xios_duration) :: dtime
-  CHARACTER(len=20) :: dtime_str
-  TYPE(xios_date) :: date
-  CHARACTER(len=20) :: date_str
-  CHARACTER(len=15) :: calendar_type
-  TYPE(xios_context) :: ctx_hdl
-  INTEGER,PARAMETER :: ni_glo=10
-  INTEGER,PARAMETER :: nj_glo=10
-  INTEGER,PARAMETER :: llm=5
-  DOUBLE PRECISION  :: lval(llm)=1
-  TYPE(xios_field) :: field_hdl
-  TYPE(xios_fieldgroup) :: fieldgroup_hdl
-  TYPE(xios_file) :: file_hdl
-  LOGICAL :: ok
-
-  DOUBLE PRECISION,DIMENSION(ni_glo,nj_glo) :: lon_glo,lat_glo
-  DOUBLE PRECISION :: field_A_glo(ni_glo,nj_glo,llm)
-  DOUBLE PRECISION,ALLOCATABLE :: lon(:,:),lat(:,:),field_A(:,:,:), lonvalue(:,:)
-  INTEGER, ALLOCATABLE :: data_i_index(:), data_j_index(:), i_index(:), j_index(:) ;
-  INTEGER :: ni,ibegin,iend,nj,jbegin,jend
-  INTEGER :: data_ni,data_ibegin,data_iend,data_nj,data_jbegin,data_jend, data_dim
-  INTEGER :: i,j,l,ts,n
-
-!!! MPI Initialization
-  CALL MPI_INIT(ierr)
-
-  CALL init_wait
-
-!!! XIOS Initialization (get the local communicator)
-  CALL xios_initialize(id,return_comm=comm)
-
-  CALL MPI_COMM_RANK(comm,rank,ierr)
-  CALL MPI_COMM_SIZE(comm,size,ierr)
-
-!!! Simulate some data from models
-  DO j=1,nj_glo
-    DO i=1,ni_glo
-      lon_glo(i,j)=(i-1)+(j-1)*ni_glo
-      lat_glo(i,j)=1000+(i-1)+(j-1)*ni_glo
-      DO l=1,llm
-        field_A_glo(i,j,l)=(i-1)+(j-1)*ni_glo+10000*l
-      ENDDO
-    ENDDO
-  ENDDO
-  ni=ni_glo ; ibegin=0
-
-  jbegin=0
-  DO n=0,size-1
-    nj=nj_glo/size
-    IF (n<MOD(nj_glo,size)) nj=nj+1
-    IF (n==rank) exit
-    jbegin=jbegin+nj
-  ENDDO
-  iend=ibegin+ni-1 ; jend=jbegin+nj-1
-
-  ALLOCATE(lon(ni,nj),lat(ni,nj),field_A(0:ni+1,-1:nj+2,llm),lonvalue(ni,nj))
-  lon(:,:)=lon_glo(ibegin+1:iend+1,jbegin+1:jend+1)
-  lat(:,:)=lat_glo(ibegin+1:iend+1,jbegin+1:jend+1)
-  field_A(1:ni,1:nj,:)=field_A_glo(ibegin+1:iend+1,jbegin+1:jend+1,:)
-
-  ! Expand domain on using data from model
-  CALL xios_context_initialize("write",comm)
-  CALL xios_get_handle("write",ctx_hdl)
-  CALL xios_set_current_context(ctx_hdl)
-
-  CALL xios_set_axis_attr("axis_A",n_glo=llm ,value=lval) ;
-  CALL xios_set_domain_attr("domain_A",ni_glo=ni_glo, nj_glo=nj_glo, ibegin=ibegin, ni=ni,jbegin=jbegin,nj=nj,type='curvilinear')
-  CALL xios_set_domain_attr("domain_A",data_dim=2, data_ibegin=-1, data_ni=ni+2, data_jbegin=-2, data_nj=nj+4)
-  CALL xios_set_domain_attr("domain_A",lonvalue_2D=lon,latvalue_2D=lat)
-  
-  dtime%second = 3600
-  CALL xios_set_timestep(dtime)
-  CALL xios_close_context_definition()
-
-  DO ts=1,24
-    CALL xios_update_calendar(ts)
-    CALL xios_send_field("field_A",field_A)
-    CALL wait_us(5000) ;
-  ENDDO
-
-  CALL xios_context_finalize()
-  DEALLOCATE(lon, lat, field_A)
-
-  ! Expand domain on using data read from a file
-  CALL xios_context_initialize("read",comm)
-  CALL xios_get_handle("read",ctx_hdl)
-  CALL xios_set_current_context(ctx_hdl)
-
-  CALL xios_set_axis_attr("axis_A",n_glo=llm ,value=lval)
-  CALL xios_set_domain_attr("domain_A",ni_glo=ni_glo, nj_glo=nj_glo, type='rectilinear')
- 
-  dtime%second = 3600
-  CALL xios_set_timestep(dtime)  
-  CALL xios_close_context_definition()
-
-  ! Read some attributes of source domain
-  CALL xios_get_domain_attr("domain_A", ni=ni, nj=nj)
-
-  ALLOCATE(field_A(ni,nj,llm))
-  ALLOCATE(data_i_index(ni*nj))
-  ALLOCATE(data_j_index(ni*nj))
-  ALLOCATE(i_index(ni*nj))
-  ALLOCATE(j_index(ni*nj))
-  CALL xios_get_domain_attr("domain_A", data_dim=data_dim, data_ni=data_ni, data_nj=data_nj, &
-                             data_ibegin=data_ibegin, data_jbegin=data_jbegin, data_i_index=data_i_index, &
-                             i_index=i_index, j_index=j_index, data_j_index=data_j_index)  
-  print *, "ni = ", ni
-  print *, "nj = ", nj
-  print *, "data_dim = ", data_dim
-  print *, "data_ni  = ", data_ni, " data_ibegin = ", data_ibegin
-  print *, "data_nj  = ", data_nj, " data_ibegin = ", data_jbegin
-  print *, "data_i_index = ", data_i_index
-  print *, "data_j_index = ", data_j_index
-  print *, "i_index = ", i_index
-  print *, "j_index = ", j_index
-
-  
-  DEALLOCATE(data_i_index)
-  DEALLOCATE(data_j_index)
-  DEALLOCATE(i_index)
-  DEALLOCATE(j_index)
-
-  ! Verify some attributes of expanded domain
-  CALL xios_get_domain_attr("domain_A_expand", ni=ni, nj=nj)
-  ALLOCATE(data_i_index(ni*nj))
-  ALLOCATE(data_j_index(ni*nj))
-  ALLOCATE(i_index(ni*nj))
-  ALLOCATE(j_index(ni*nj))
-  CALL xios_get_domain_attr("domain_A_expand", data_dim=data_dim, data_ni=data_ni, data_nj=data_nj, &
-                             data_ibegin=data_ibegin, data_jbegin=data_jbegin, data_i_index=data_i_index, &
-                             i_index=i_index, j_index=j_index, data_j_index=data_j_index)
-  print *, "ni_expand = ", ni
-  print *, "nj_expand = ", nj
-  print *, "data_dim_expand = ", data_dim
-  print *, "data_ni_expand = ", data_ni, " data_ibegin_expand = ", data_ibegin
-  print *, "data_nj_expand = ", data_nj, " data_ibegin_expand = ", data_jbegin
-  print *, "data_i_index_expand = ", data_i_index
-  print *, "data_j_index_expand = ", data_j_index
-  print *, "i_index = ", i_index
-  print *, "j_index = ", j_index
-
-  DO ts=1,24
-    CALL xios_recv_field("field_A",field_A)  
-    CALL xios_update_calendar(ts)
-    CALL wait_us(5000) ;
-    CALL xios_send_field("field_B",field_A)    
-  ENDDO
-  
-  CALL xios_context_finalize()  
-
-  CALL MPI_COMM_FREE(comm, ierr)
-
-  CALL xios_finalize()
-
-  CALL MPI_FINALIZE(ierr)
-
-END PROGRAM test_expand_domain
Index: /XIOS/trunk/src/test/test_regular.f90
===================================================================
--- /XIOS/trunk/src/test/test_regular.f90	(revision 1536)
+++ /XIOS/trunk/src/test/test_regular.f90	(revision 1537)
@@ -37,4 +37,6 @@
   DOUBLE PRECISION,ALLOCATABLE :: bounds_lat(:,:)
   DOUBLE PRECISION,ALLOCATABLE :: field_temp(:,:)
+  DOUBLE PRECISION,ALLOCATABLE :: field_temp1(:,:)
+  DOUBLE PRECISION,ALLOCATABLE :: field_temp2(:,:)
 
 !!! MPI Initialization
@@ -94,19 +96,19 @@
 
   CALL MPI_COMM_RANK(comm,rank,ierr)
-  CALL MPI_COMM_SIZE(comm,sizeComm,ierr)
-
-  IF (MOD(ncell, sizeComm) == 0) THEN
-    ni = ncell/sizeComm
+  CALL MPI_COMM_SIZE(comm,size,ierr)
+
+  IF (MOD(ncell, size) == 0) THEN
+    ni = ncell/size
     ibegin = rank*ni
   ELSE
-    IF (rank < MOD(ncell, sizeComm)) THEN
-      ni = ncell/sizeComm + 1
-      ibegin = rank*(ncell/sizeComm + 1)
+    IF (rank < MOD(ncell, size)) THEN
+      ni = ncell/size + 1
+      ibegin = rank*(ncell/size + 1)
     ELSE
-      ni = ncell/sizeComm
-      IF (rank == MOD(ncell, sizeComm)) THEN
-        ibegin = rank*(ncell/sizeComm + 1)
+      ni = ncell/size
+      IF (rank == MOD(ncell, size)) THEN
+        ibegin = rank*(ncell/size + 1)
       ELSE
-        ibegin = MOD(ncell,sizeComm)*(ncell/sizeComm + 1) + (rank-MOD(ncell,sizeComm))*ncell/sizeComm
+        ibegin = MOD(ncell,size)*(ncell/size + 1) + (rank-MOD(ncell,size))*ncell/size
       END IF
     END IF
@@ -118,9 +120,14 @@
   ALLOCATE(bounds_lat(4,ni))
   ALLOCATE(field_temp(ni,ntime)) 
-  lon = lon_glo(1+ibegin:ibegin+ni)
-  lat = lat_glo(1+ibegin:ibegin+ni)
-  bounds_lon(:,:) = bounds_lon_glo(:,1+ibegin:ibegin+ni)
-  bounds_lat(:,:) = bounds_lat_glo(:,1+ibegin:ibegin+ni)
+  ALLOCATE(field_temp1(ni,ntime))
+  ALLOCATE(field_temp2(ni,ntime))
+  lon = lon_glo(ibegin:1+ibegin+ni)
+  lat = lat_glo(ibegin:1+ibegin+ni)
+  bounds_lon(:,:) = bounds_lon_glo(:,ibegin:1+ibegin+ni)
+  bounds_lat(:,:) = bounds_lat_glo(:,ibegin:1+ibegin+ni)
+
   field_temp(:,:) = rank
+  field_temp1(:,:) = rank
+  field_temp2(:,:) = rank + 10
 
 
@@ -135,8 +142,11 @@
                             time_origin=xios_date(1999, 01, 01, 15, 00, 00))
 
-  CALL xios_set_domain_attr("face", ni_glo=ncell, ibegin=ibegin, ni=ni, type='unstructured')
-  CALL xios_set_domain_attr("face", lonvalue_1d=lon, latvalue_1d=lat)
-  CALL xios_set_domain_attr("face", bounds_lon_1d=bounds_lon, bounds_lat_1d=bounds_lat)
-
+  CALL xios_set_domain_attr("face1", ni_glo=ncell, ibegin=ibegin, ni=ni, type='unstructured')
+  CALL xios_set_domain_attr("face1", lonvalue_1d=lon, latvalue_1d=lat)
+  CALL xios_set_domain_attr("face1", bounds_lon_1d=bounds_lon, bounds_lat_1d=bounds_lat)
+
+  CALL xios_set_domain_attr("face2", ni_glo=ncell, ibegin=ibegin, ni=ni, type='unstructured')
+  CALL xios_set_domain_attr("face2", lonvalue_1d=lon, latvalue_1d=lat)
+  CALL xios_set_domain_attr("face2", bounds_lon_1d=bounds_lon, bounds_lat_1d=bounds_lat)
    
 !!! Definition du timestep
@@ -160,5 +170,6 @@
 
 !!! On donne la valeur du champ atm
-     CALL xios_send_field("temp",field_temp(:,1))
+     CALL xios_send_field("temp1",field_temp1(:,1))
+     CALL xios_send_field("temp2",field_temp2(:,1))
 
     ENDDO
@@ -178,4 +189,5 @@
     DEALLOCATE(bounds_lon, bounds_lat)
     DEALLOCATE(field_temp)
+    DEALLOCATE(field_temp1, field_temp2)
 
 !!! Fin de XIOS
Index: /XIOS/trunk/src/test/test_remap.f90
===================================================================
--- /XIOS/trunk/src/test/test_remap.f90	(revision 1536)
+++ /XIOS/trunk/src/test/test_remap.f90	(revision 1537)
@@ -16,9 +16,9 @@
   TYPE(xios_context) :: ctx_hdl
 
-  DOUBLE PRECISION,ALLOCATABLE :: src_lon(:), dst_lon(:), src_lon_tmp(:)
-  DOUBLE PRECISION,ALLOCATABLE :: src_lat(:), dst_lat(:), src_lat_tmp(:)
+  DOUBLE PRECISION,ALLOCATABLE :: src_lon(:), dst_lon(:)
+  DOUBLE PRECISION,ALLOCATABLE :: src_lat(:), dst_lat(:)
   DOUBLE PRECISION,ALLOCATABLE :: src_boundslon(:,:), dst_boundslon(:,:)
   DOUBLE PRECISION,ALLOCATABLE :: src_boundslat(:,:), dst_boundslat(:,:)
-  DOUBLE PRECISION,ALLOCATABLE :: src_field_2D(:), src_field_2D_clone(:)
+  DOUBLE PRECISION,ALLOCATABLE :: src_field_2D(:)
   DOUBLE PRECISION,ALLOCATABLE :: tmp_field_0(:), tmp_field_1(:), tmp_field_2(:)
   DOUBLE PRECISION,ALLOCATABLE :: src_field_3D(:,:), src_field_4D(:,:,:), lval(:), lval1(:), lval2(:), src_field_pression(:,:)
@@ -36,7 +36,6 @@
   INTEGER :: varid
   INTEGER :: ts
-  INTEGER :: i,j
+  INTEGER :: i
   INTEGER,PARAMETER :: llm=5, interpolatedLlm = 4, llm2 = 6
-  DOUBLE PRECISION, PARAMETER :: missing_value = 100000
 
   CALL MPI_INIT(ierr)
@@ -65,9 +64,9 @@
   ENDIF
 
-  ALLOCATE(src_lon(src_ni), src_lon_tmp(src_ni))
-  ALLOCATE(src_lat(src_ni), src_lat_tmp(src_ni))
+  ALLOCATE(src_lon(src_ni))
+  ALLOCATE(src_lat(src_ni))
   ALLOCATE(src_boundslon(src_nvertex,src_ni))
   ALLOCATE(src_boundslat(src_nvertex,src_ni))
-  ALLOCATE(src_field_2D(src_ni), src_field_2D_clone(src_ni))
+  ALLOCATE(src_field_2D(src_ni))
   ALLOCATE(src_field_3D(src_ni,llm))
   ALLOCATE(src_field_4D(src_ni,llm,llm2))
@@ -90,30 +89,19 @@
   DO i=1,src_ni
     src_field_3D(i,:) = src_field_2D(i)
-    IF ((0 < src_lat(i)) .AND. (src_lat(i) < 25.5) .AND. (30 < src_lon(i)) .AND. (src_lon(i) < 60)) THEN
+    IF (MOD(i,10)==0) THEN
       src_mask_2D(i)=.FALSE.
-      ! src_field_2D(i) = missing_value
     ELSE
-      src_mask_2D(i)=.TRUE.      
+      src_mask_2D(i)=.TRUE.
     ENDIF
-    src_lon_tmp(i) = src_lon(i) + 1000
-    src_lat_tmp(i) = src_lat(i) + 10000
-  ENDDO
-  src_field_2D_clone = src_field_2D
+  ENDDO
 
   DO i=1,llm
     lval(i) = i*100
     src_field_pression(:,i) = i * 100
-    IF (MOD(i,3)==0) THEN
-      ! src_field_pression(:,i) = missing_value
-      src_field_3D(:,i) = missing_value
-    ELSE
-      ! src_field_pression(:,i) = i * 100
-      src_field_3D(:,i) = src_field_3D(:,i) + i * 10 
-    ENDIF
-    ! src_field_3D(:,i) = src_field_3D(:,i) + i * 10    
+    src_field_3D(:,i) = src_field_3D(:,i) + i * 10    
   ENDDO
 
   DO i=1,llm2
-    src_field_4D(:,:,i) = src_field_3D(:,:) + i * 100
+    src_field_4D(:,:,i) = src_field_3D(:,:)
   ENDDO
 
@@ -174,9 +162,4 @@
                             bounds_lon_1D=dst_boundslon, bounds_lat_1D=dst_boundslat, nvertex=dst_nvertex)
 
-  CALL xios_set_domain_attr("src_domain_unstructured_read", ni_glo=src_ni_glo, ibegin=src_ibegin, ni=src_ni, type="unstructured")
-  CALL xios_set_domain_attr("src_domain_unstructured_read", lonvalue_1D=src_lon_tmp, latvalue_1D=src_lat_tmp, &
-                            bounds_lon_1D=src_boundslon, bounds_lat_1D=src_boundslat, nvertex=src_nvertex)
-
-
   dtime%second = 3600
   CALL xios_set_timestep(dtime)
@@ -186,34 +169,24 @@
   ALLOCATE(tmp_field_0(src_tmp_ni*src_tmp_nj))
 
-  CALL xios_get_axis_attr("src_axis_curvilinear_read", n=src_tmp_n)
-  CALL xios_get_domain_attr("src_domain_curvilinear_read", ni=src_tmp_ni, nj=src_tmp_nj)
-  ALLOCATE(tmp_field_1(src_tmp_ni*src_tmp_nj*src_tmp_n))
-
-  CALL xios_get_domain_attr("src_domain_unstructured_read", ni=src_tmp_ni, nj=src_tmp_nj)
-  ALLOCATE(tmp_field_2(src_tmp_ni*src_tmp_nj))
-  
-  CALL xios_recv_field("src_field_regular", tmp_field_0)
-  CALL xios_recv_field("src_field_curvilinear", tmp_field_1)
-  CALL xios_recv_field("src_field_unstructured", tmp_field_2)
-
-  DO ts=1,10
+  ! CALL xios_get_axis_attr("src_axis_curvilinear_read", n=src_tmp_n)
+  ! CALL xios_get_domain_attr("src_domain_curvilinear_read", ni=src_tmp_ni, nj=src_tmp_nj)
+  ! ALLOCATE(tmp_field_1(src_tmp_ni*src_tmp_nj*src_tmp_n))
+
+  ! CALL xios_get_domain_attr("src_domain_unstructured_read", ni=src_tmp_ni, nj=src_tmp_nj)
+  ! ALLOCATE(tmp_field_2(src_tmp_ni*src_tmp_nj))
+
+  DO ts=1,1
+    CALL xios_recv_field("src_field_regular", tmp_field_0)
+    ! CALL xios_recv_field("src_field_curvilinear", tmp_field_1)
+    ! CALL xios_recv_field("src_field_unstructured", tmp_field_2)
     CALL xios_update_calendar(ts)
     CALL xios_send_field("src_field_2D",src_field_2D)
-    
-    DO i=1,src_ni
-      src_field_2D_clone(i) = src_field_2D(i)
-      IF ((23.5 * ts < src_lat(i)) .AND. (src_lat(i) < 65.5 *ts) .AND. (0 < src_lon(i)) .AND. (src_lon(i) < 30*ts)) THEN      
-        src_field_2D_clone(i) = missing_value    
-      ENDIF
-    ENDDO
-
-    CALL xios_send_field("src_field_2D_clone",src_field_2D_clone)
+    CALL xios_send_field("src_field_2D_clone",src_field_2D)
     CALL xios_send_field("src_field_3D",src_field_3D)
-    CALL xios_send_field("src_field_3D_clone",src_field_3D)
-    CALL xios_send_field("src_field_4D",src_field_4D)
-    CALL xios_send_field("src_field_3D_pression",src_field_pression)
+    ! CALL xios_send_field("src_field_4D",src_field_4D)
+    ! CALL xios_send_field("src_field_3D_pression",src_field_pression)
     CALL xios_send_field("tmp_field_0",tmp_field_0)
-    CALL xios_send_field("tmp_field_1",tmp_field_1)
-    CALL xios_send_field("tmp_field_2",tmp_field_2)
+    ! CALL xios_send_field("tmp_field_1",tmp_field_1)
+    ! CALL xios_send_field("tmp_field_2",tmp_field_2)
     CALL wait_us(5000) ;
    ENDDO
@@ -223,5 +196,5 @@
   DEALLOCATE(src_lon, src_lat, src_boundslon,src_boundslat, src_field_2D)
   DEALLOCATE(dst_lon, dst_lat, dst_boundslon,dst_boundslat)
-  DEALLOCATE(tmp_field_0, tmp_field_1, tmp_field_2)
+  ! DEALLOCATE(tmp_field_0, tmp_field_1, tmp_field_2)
 
   CALL MPI_COMM_FREE(comm, ierr)
Index: /XIOS/trunk/src/test/test_second_server.f90
===================================================================
--- /XIOS/trunk/src/test/test_second_server.f90	(revision 1537)
+++ /XIOS/trunk/src/test/test_second_server.f90	(revision 1537)
@@ -0,0 +1,248 @@
+PROGRAM test_regular
+
+  USE xios
+  USE mod_wait
+  IMPLICIT NONE
+  INCLUDE "mpif.h"
+
+  INTEGER, PARAMETER :: ntime=1
+
+  CHARACTER(len=*),PARAMETER :: id="client"
+  TYPE(xios_duration)  :: dtime
+  TYPE(xios_context) :: ctx_hdl
+  TYPE(xios_field) :: field_hdl
+  TYPE(xios_fieldgroup) :: fieldgroup_hdl
+  TYPE(xios_file) :: file_hdl
+  LOGICAL :: ok
+  CHARACTER(len=256) :: crname
+  INTEGER :: ts, i
+  INTEGER :: comm  
+  INTEGER :: ierr
+  INTEGER :: size, rank
+
+  INTEGER :: nlon = 6 !20 
+  INTEGER :: nlat = 6 !16 
+  INTEGER :: ncell 
+  
+  INTEGER :: ilat, ilon, ind
+  DOUBLE PRECISION :: lon1, lon2, lat1, lat2
+  INTEGER :: ni, ibegin
+
+  DOUBLE PRECISION,ALLOCATABLE :: lon_glo(:)
+  DOUBLE PRECISION,ALLOCATABLE :: lat_glo(:)
+  DOUBLE PRECISION,ALLOCATABLE :: bounds_lon_glo(:,:)
+  DOUBLE PRECISION,ALLOCATABLE :: bounds_lat_glo(:,:)
+  DOUBLE PRECISION,ALLOCATABLE :: field_temp_glo(:,:)
+  DOUBLE PRECISION,ALLOCATABLE :: lon(:)
+  DOUBLE PRECISION,ALLOCATABLE :: lat(:)
+  DOUBLE PRECISION,ALLOCATABLE :: bounds_lon(:,:)
+  DOUBLE PRECISION,ALLOCATABLE :: bounds_lat(:,:)
+  DOUBLE PRECISION,ALLOCATABLE :: field_temp(:,:)
+  DOUBLE PRECISION,ALLOCATABLE :: field_temp1(:)
+  DOUBLE PRECISION,ALLOCATABLE :: field_temp2(:)
+  INTEGER,ALLOCATABLE  :: field_int(:)
+
+!!! MPI Initialization
+  CALL MPI_INIT(ierr)
+
+!!! XIOS Initialization (get the local communicator)
+  CALL xios_initialize(id,return_comm=comm)
+
+!!! Initialisation des coordonnÃ©es globales et locales pour la grille rÃ©guliÃšre
+
+! Regions around the poles are not included into the grid
+! The whole grid is rectangular (nvertex=4)
+
+  ncell = nlon * (nlat-1)
+  ALLOCATE(lon_glo(ncell))
+  ALLOCATE(lat_glo(ncell))
+  ALLOCATE(bounds_lon_glo(4,ncell))
+  ALLOCATE(bounds_lat_glo(4,ncell))
+  ALLOCATE(field_temp_glo(ncell,ntime))
+
+
+  ind = 0
+  DO ilat = 1, nlat-1
+   DO ilon = 1, nlon
+
+      ind=ind+1
+
+      lon1 = 360./DBLE(nlon) * DBLE(ilon-1)
+      lon2 = lon1 + 360./DBLE(nlon)
+
+      lat1 = (90. + 90./DBLE(nlat)) - 180./DBLE(nlat)*DBLE(ilat)
+      lat2 = lat1 - 180./DBLE(nlat)
+
+      lon_glo(ind) = (lon1+lon2)*0.5
+      lat_glo(ind) = (lat1+lat2)*0.5 
+
+      bounds_lon_glo(1,ind) = lon1
+      bounds_lon_glo(2,ind) = lon2
+      bounds_lon_glo(3,ind) = lon2
+      bounds_lon_glo(4,ind) = lon1
+
+      bounds_lat_glo(1,ind) = lat1
+      bounds_lat_glo(2,ind) = lat1
+      bounds_lat_glo(3,ind) = lat2      
+      bounds_lat_glo(4,ind) = lat2     
+
+      field_temp_glo(ind,1) = DBLE(ind)
+
+    ENDDO
+  ENDDO
+
+! Initialization of local variables
+
+  CALL MPI_COMM_RANK(comm,rank,ierr)
+  CALL MPI_COMM_SIZE(comm,size,ierr)
+
+  IF (MOD(ncell, size) == 0) THEN
+    ni = ncell/size
+    ibegin = rank*ni
+  ELSE
+    IF (rank < MOD(ncell, size)) THEN
+      ni = ncell/size + 1
+      ibegin = rank*(ncell/size + 1)
+    ELSE
+      ni = ncell/size
+      IF (rank == MOD(ncell, size)) THEN
+        ibegin = rank*(ncell/size + 1)
+      ELSE
+        ibegin = MOD(ncell,size)*(ncell/size + 1) + (rank-MOD(ncell,size))*ncell/size
+      END IF
+    END IF
+  END IF
+
+  ALLOCATE(lon(ni))
+  ALLOCATE(lat(ni))
+  ALLOCATE(bounds_lon(4,ni))
+  ALLOCATE(bounds_lat(4,ni))
+  ALLOCATE(field_temp(ni,ntime)) 
+  ALLOCATE(field_temp1(ni))
+  ALLOCATE(field_temp2(ni))
+  ALLOCATE(field_int(ni))
+  lon = lon_glo(1+ibegin:ibegin+ni)
+  lat = lat_glo(1+ibegin:ibegin+ni)
+  bounds_lon(:,:) = bounds_lon_glo(:,1+ibegin:ibegin+ni)
+  bounds_lat(:,:) = bounds_lat_glo(:,1+ibegin:ibegin+ni)
+
+  !field_temp(:) = rank
+  field_temp1(:) = rank + 10
+  field_temp2(:) = rank + 20
+ 
+ DO i = 1, ni
+  field_temp1 (i) = 100*rank + i
+  field_temp2 (i) = 0 !200*rank + i
+  !field_temp1 (i) = 10
+END DO
+
+!###########################################################################
+! Contexte ATM
+!###########################################################################
+
+  CALL xios_context_initialize("atmosphere",comm)
+  CALL xios_get_handle("atmosphere",ctx_hdl)
+  CALL xios_set_current_context(ctx_hdl)
+
+  CALL xios_define_calendar(type="Gregorian", &
+                            start_date=xios_date(2000, 01, 01, 00, 00, 00), &
+                            time_origin=xios_date(1999, 01, 01, 15, 00, 00))
+
+  CALL xios_set_domain_attr("atm_face", ni_glo=ncell, ibegin=ibegin, ni=ni, type='unstructured')
+  CALL xios_set_domain_attr("atm_face", lonvalue_1d=lon, latvalue_1d=lat)
+  CALL xios_set_domain_attr("atm_face", bounds_lon_1d=bounds_lon, bounds_lat_1d=bounds_lat)
+
+!!! Definition du timestep
+
+  dtime%second=3600
+  CALL xios_set_timestep(timestep=dtime)
+
+!!! Fin de la definition du contexte
+
+  CALL xios_close_context_definition()
+
+!###########################################################################
+! Contexte SRF
+!###########################################################################
+
+  CALL xios_context_initialize("surface",comm)
+  CALL xios_get_handle("surface",ctx_hdl)
+  CALL xios_set_current_context(ctx_hdl)
+
+  CALL xios_define_calendar(type="Gregorian", &
+                            start_date=xios_date(2000, 01, 01, 00, 00, 00), &
+                            time_origin=xios_date(1999, 01, 01, 15, 00, 00))
+
+  CALL xios_set_domain_attr("domain_srf", ni_glo=ncell, ibegin=ibegin, ni=ni, type='unstructured')
+  CALL xios_set_domain_attr("domain_srf", lonvalue_1d=lon, latvalue_1d=lat)
+  CALL xios_set_domain_attr("domain_srf", bounds_lon_1d=bounds_lon, bounds_lat_1d=bounds_lat)
+
+   
+!!! Definition du timestep
+
+  dtime%second=3600
+  CALL xios_set_timestep(timestep=dtime)
+
+!!! Fin de la definition du contexte
+
+  CALL xios_close_context_definition()
+
+
+!####################################################################################
+!!! Boucle temporelle
+!####################################################################################
+    
+    DO ts=1,ntime
+
+      CALL xios_get_handle("atmosphere",ctx_hdl)
+      CALL xios_set_current_context(ctx_hdl)
+
+!!! Mise a jour du pas de temps
+      CALL xios_update_calendar(ts)
+
+!!! On donne la valeur du champ atm
+     CALL xios_send_field("atm_temp1",field_temp1(:))
+     CALL xios_send_field("atm_temp2",field_temp2(:))
+
+     CALL xios_get_handle("surface",ctx_hdl)
+     CALL xios_set_current_context(ctx_hdl)
+
+!!! Mise a jour du pas de temps
+     CALL xios_update_calendar(ts)
+
+!!! On donne la valeur du champ srf
+     CALL xios_send_field("srf_temp",field_temp1(:))
+     CALL wait_us(5000) ;
+
+    ENDDO
+
+    CALL xios_context_finalize()
+
+    CALL xios_get_handle("atmosphere",ctx_hdl)
+    CALL xios_set_current_context(ctx_hdl)
+    CALL xios_context_finalize()
+
+    DEALLOCATE(lon_glo, lat_glo)
+    DEALLOCATE(bounds_lon_glo, bounds_lat_glo)
+    DEALLOCATE(field_temp_glo)
+    DEALLOCATE(lon, lat)
+    DEALLOCATE(bounds_lon, bounds_lat)
+    DEALLOCATE(field_temp)
+    DEALLOCATE(field_temp1, field_temp2)
+    DEALLOCATE(field_int)
+
+!!! Fin de XIOS
+
+    CALL MPI_COMM_FREE(comm, ierr)
+
+    CALL xios_finalize()
+
+    CALL MPI_FINALIZE(ierr)
+
+  END PROGRAM test_regular
+
+
+
+
+
+
Index: OS/trunk/src/test/toy_cmip6.f90
===================================================================
--- /XIOS/trunk/src/test/toy_cmip6.f90	(revision 1536)
+++ 	(revision )
@@ -1,343 +1,0 @@
-PROGRAM toy_cmip6 
-
-  USE xios
-  USE mod_wait
-  IMPLICIT NONE
-  INCLUDE "mpif.h"
-
-  INTEGER,PARAMETER :: il_unit=10
-  INTEGER :: comm, rank, size_loc, ierr
-  INTEGER :: ni,ibegin,iend,nj,jbegin,jend
-  INTEGER :: i,j,l,ts,n, nb_pt, il_run
-  DOUBLE PRECISION :: sypd, timestep_in_seconds, simulated_seconds_per_seconds, elapsed_per_timestep
-  CHARACTER(len=*),PARAMETER :: id="client"
-  CHARACTER(1000):: duration, timestep
-  INTEGER :: start_year,start_month,start_day
-  TYPE(xios_date) :: cdate, edate
-  TYPE(xios_duration)  :: dtime
-  TYPE(xios_context) :: ctx_hdl
-  REAL :: ilon,jlat
-  DOUBLE PRECISION,ALLOCATABLE :: lon_glo(:,:),lat_glo(:,:),lval(:)
-  DOUBLE PRECISION,ALLOCATABLE :: field_A_glo (:,:,:), pressure_glo (:,:,:), height_glo (:,:,:)
-  DOUBLE PRECISION,ALLOCATABLE :: bounds_lon_glo(:,:,:),bounds_lat_glo(:,:,:)
-  DOUBLE PRECISION,ALLOCATABLE :: pressure (:,:,:), height (:,:,:)
-  DOUBLE PRECISION,ALLOCATABLE :: lon(:,:),lat(:,:),lonvalue(:,:)
-  DOUBLE PRECISION,ALLOCATABLE :: bounds_lon(:,:,:),bounds_lat(:,:,:) 
-  DOUBLE PRECISION,ALLOCATABLE :: field_atm_2D(:,:),field_atm_3D(:,:,:),field_srf_2D(:),field_srf_3D(:,:)
-  DOUBLE PRECISION,ALLOCATABLE :: field_atm_2D_miss(:,:)
-  DOUBLE PRECISION,ALLOCATABLE :: field_oce_2D(:,:),field_oce_3D(:,:,:)
-  INTEGER, ALLOCATABLE :: kindex(:)
-
-  INTEGER :: ni_glo, nj_glo,llm
-
-  NAMELIST /param_toy/ ni_glo, nj_glo,llm,timestep,duration,sypd,start_year,start_month,start_day
-
-!!! MPI Initialization
-
-  CALL MPI_INIT(ierr)
-
-  CALL init_wait
-
-!!! Lecture des parametres du run
-
-  OPEN(unit=il_unit, file='param.def',status='old',iostat=ierr)
-  READ (il_unit, nml=param_toy)
-  !PRINT *, ni_glo, nj_glo,llm,duration
-
-!!! XIOS Initialization (get the local communicator)
-
-  CALL xios_initialize(id,return_comm=comm)
-
-  CALL MPI_COMM_RANK(comm,rank,ierr)
-  CALL MPI_COMM_SIZE(comm,size_loc,ierr)
-
-
-!!! Initialisation et allocation des coordonnÃ©es globales et locales pour la grille rÃ©guliÃšre
-
-  ALLOCATE (lon_glo(ni_glo,nj_glo),lat_glo(ni_glo,nj_glo))
-  ALLOCATE(bounds_lon_glo(4,ni_glo,nj_glo))
-  ALLOCATE(bounds_lat_glo(4,ni_glo,nj_glo))
-  ALLOCATE (field_A_glo(ni_glo,nj_glo,llm))
-  ALLOCATE (pressure_glo(ni_glo,nj_glo,llm))
-  ALLOCATE (height_glo(ni_glo,nj_glo,llm))
-  ALLOCATE (lval(llm))
-
-  DO j=1,nj_glo
-    DO i=1,ni_glo
-
-      ilon=i-0.5
-      jlat=j-0.5
-
-      lat_glo(i,j)= 90-(jlat*180./nj_glo)
-      lon_glo(i,j)= (ilon*360./ni_glo)
-      !print*, 'i/lon=',i,'lon=',lon_glo(i,j), 'j/lat=',j,'lat=',lat_glo(i,j)
-
-      bounds_lat_glo(1,i,j)= 90-((jlat-0.5)*180./nj_glo)
-      bounds_lon_glo(1,i,j)=((ilon-0.5)*360./ni_glo)
-
-      bounds_lat_glo(2,i,j)= 90-((jlat-0.5)*180./nj_glo)
-      bounds_lon_glo(2,i,j)=((ilon+0.5)*360./ni_glo)
-
-      bounds_lat_glo(3,i,j)= 90-((jlat+0.5)*180./nj_glo)
-      bounds_lon_glo(3,i,j)=((ilon+0.5)*360./ni_glo)
-
-      bounds_lat_glo(4,i,j)= 90-((jlat+0.5)*180./nj_glo)
-      bounds_lon_glo(4,i,j)=((ilon-0.5)*360./ni_glo)
-
-      WHERE (abs(bounds_lat_glo(:,i,j) - 90) < 0.000000001) bounds_lat_glo(:,i,j) = 90
-      WHERE (abs(bounds_lat_glo(:,i,j) + 90) < 0.000000001) bounds_lat_glo(:,i,j) = -90
-
-      DO l=1,llm
-         field_A_glo(i,j,l)=(i-1)+(j-1)*ni_glo+10000*l
-         ! pressure at half levels. First index value is high altitude, low pressure
-         pressure_glo(i,j,l)=((l-0.)/llm)*100000 + (jlat -nj_glo/2.)/nj_glo * 10000
-         height_glo(i,j,l)=(llm-l+0.5)/llm * 15000 + jlat * 100
-      ENDDO
-    ENDDO
-  ENDDO
-  ni=ni_glo ; ibegin=0
-
-  jbegin=0
-  DO n=0,size_loc-1
-    nj=nj_glo/size_loc
-    IF (n<MOD(nj_glo,size_loc)) nj=nj+1
-    IF (n==rank) exit
-    jbegin=jbegin+nj
-  ENDDO
-
-  iend=ibegin+ni-1 ; jend=jbegin+nj-1
-
-  ALLOCATE(lon(ni,nj),lat(ni,nj),lonvalue(ni,nj))
-  ALLOCATE(bounds_lon(4,ni,nj))
-  ALLOCATE(bounds_lat(4,ni,nj))
-  lon(:,:)=lon_glo(ibegin+1:iend+1,jbegin+1:jend+1)
-  lat(:,:)=lat_glo(ibegin+1:iend+1,jbegin+1:jend+1)
-  bounds_lon(:,:,:)=bounds_lon_glo(:,ibegin+1:iend+1,jbegin+1:jend+1)
-  bounds_lat(:,:,:)=bounds_lat_glo(:,ibegin+1:iend+1,jbegin+1:jend+1)
-
-
-  DO i=1,llm
-    lval(i)=i
- ENDDO
- 
-
-  
-!###########################################################################
-! Contexte ATM
-!###########################################################################
- ALLOCATE(field_atm_2D(0:ni+1,-1:nj+2),field_atm_3D(0:ni+1,-1:nj+2,llm))
- ALLOCATE(field_atm_2D_miss(0:ni+1,-1:nj+2))
- ALLOCATE(pressure(0:ni+1,-1:nj+2,llm))
- ALLOCATE(height(0:ni+1,-1:nj+2,llm))
-  field_atm_2D(1:ni,1:nj)=field_A_glo(ibegin+1:iend+1,jbegin+1:jend+1,1)
-  field_atm_2D_miss(1:ni,1:nj)=field_A_glo(ibegin+1:iend+1,jbegin+1:jend+1,1)
-  field_atm_3D(1:ni,1:nj,:)=field_A_glo(ibegin+1:iend+1,jbegin+1:jend+1,:)
-  pressure(1:ni,1:nj,:)=pressure_glo(ibegin+1:iend+1,jbegin+1:jend+1,:)
-  height(1:ni,1:nj,:)=height_glo(ibegin+1:iend+1,jbegin+1:jend+1,:)
-
-  CALL xios_context_initialize("arpsfx",comm)
-  CALL xios_define_calendar("Gregorian", &
-     start_date=xios_date(start_year,start_month,start_day,0,0,0), &
-     time_origin=xios_date(1850,1,1,0,0,0))
-
-  !write(0,*) 'atm context initialized' ; call flush(0)
-  CALL xios_get_handle("arpsfx",ctx_hdl)
-  CALL xios_set_current_context(ctx_hdl)
-
-  CALL xios_set_axis_attr("axis_atm",n_glo=llm ,value=lval) ;
-
-  CALL xios_set_domain_attr("domain_atm",ni_glo=ni_glo, nj_glo=nj_glo, ibegin=ibegin, &
-       ni=ni,jbegin=jbegin,nj=nj, type='rectilinear')
-  CALL xios_set_domain_attr("domain_atm",data_dim=2, data_ibegin=-1, &
-       data_ni=ni+2, data_jbegin=-2, data_nj=nj+4)
-  CALL xios_set_domain_attr("domain_atm",lonvalue_2D=lon,latvalue_2D=lat)
-  CALL xios_set_domain_attr("domain_atm", nvertex=4, bounds_lon_2d=bounds_lon, bounds_lat_2d=bounds_lat)
-  print *,'latmax/min=',minval(lat),maxval(lat)
-  print *,'latmax/min bounds=',minval(bounds_lat),maxval(bounds_lat)
-  print *,'lonmax/min=',minval(lon),maxval(lon)
-  print *,'lonmax/min bounds=',minval(bounds_lon),maxval(bounds_lon)
-
-
-!!! Definition du timestep
-
-  CALL xios_get_start_date(cdate)
-  edate=cdate+xios_duration_convert_from_string(duration)
-  dtime=xios_duration_convert_from_string(timestep)
-  CALL xios_set_timestep(timestep=dtime)
-
-!!! Fin de la definition du contexte
-
-  !CALL xios_close_context_definition()
-
-!!! Calcul de temps elaps par seconde pour respecter le SYPD (hyp : pas de dÃ©lai d'I/O)
-  
-  timestep_in_seconds=xios_date_convert_to_seconds(cdate+dtime) - xios_date_convert_to_seconds(cdate)
-  simulated_seconds_per_seconds=sypd * 365 
-  elapsed_per_timestep=timestep_in_seconds/simulated_seconds_per_seconds ! in seconds
-
-!###########################################################################
-! Contexte SRF
-!###########################################################################
-
-!!! Initialisation des coordonnÃ©es globales et locales pour la grille indexee (1 point sur 2)
-
-    nb_pt=ni*nj/2
-    ALLOCATE(kindex(nb_pt),field_srf_2D(nb_pt),field_srf_3D(nb_pt,llm))
-    DO i=1,nb_pt
-      kindex(i)=2*i-1
-    ENDDO
-    field_srf_2D(1:nb_pt)=RESHAPE(field_A_glo(ibegin+1:iend+1:2,jbegin+1:jend+1,1),(/ nb_pt /))
-    field_srf_3D(1:nb_pt,:)=RESHAPE(field_A_glo(ibegin+1:iend+1:2,jbegin+1:jend+1,:),(/ nb_pt,llm /))
-
-  !CALL xios_context_initialize("surface",comm)
-  !CALL xios_get_handle("surface",ctx_hdl)
-  !CALL xios_set_current_context(ctx_hdl)
-
-  CALL xios_set_axis_attr("axis_srf",n_glo=llm ,value=lval)
-  CALL xios_set_domain_attr("domain_srf",ni_glo=ni_glo, nj_glo=nj_glo, ibegin=ibegin, ni=ni,jbegin=jbegin,nj=nj, type='rectilinear')
-  CALL xios_set_domain_attr("domain_srf",data_dim=1, data_ibegin=0, data_ni=nb_pt)
-  CALL xios_set_domain_attr("domain_srf",data_i_index=kindex)
-  CALL xios_set_domain_attr("domain_srf",lonvalue_2D=lon,latvalue_2D=lat)
-  CALL xios_set_domain_attr("domain_srf", nvertex=4, bounds_lon_2d=bounds_lon, bounds_lat_2d=bounds_lat)
-
-!!! Definition du timestep
-
-  !dtime%second=timestep
-  !dtime=xios_duration_convert_from_string(timestep)
-  !CALL xios_set_timestep(timestep=dtime)
-
-!!! Fin de la definition du contexte SRF
-
-  CALL xios_close_context_definition()
-  !write(0,*) 'srf context def closed' ; call flush(0)
-
-!###########################################################################
-! Contexte OCE
-!###########################################################################
-  ALLOCATE(field_oce_2D(0:ni+1,-1:nj+2),field_oce_3D(0:ni+1,-1:nj+2,llm))
-  field_oce_2D(1:ni,1:nj)=field_A_glo(ibegin+1:iend+1,jbegin+1:jend+1,1)
-  field_oce_3D(1:ni,1:nj,:)=field_A_glo(ibegin+1:iend+1,jbegin+1:jend+1,:)
-
-  CALL xios_context_initialize("nemo",comm)
-  CALL xios_define_calendar("Gregorian", &
-     start_date=xios_date(start_year,start_month,start_day,0,0,0), &
-     time_origin=xios_date(1850,1,1,0,0,0))
-  CALL xios_get_handle("nemo",ctx_hdl)
-  CALL xios_set_current_context(ctx_hdl)
-
-  CALL xios_set_axis_attr("axis_oce",n_glo=llm ,value=lval) ;
-
-  CALL xios_set_domain_attr("domain_oce",ni_glo=ni_glo, nj_glo=nj_glo, ibegin=ibegin, ni=ni,jbegin=jbegin,nj=nj, type='curvilinear')
-  CALL xios_set_domain_attr("domain_oce",data_dim=2, data_ibegin=-1, data_ni=ni+2, data_jbegin=-2, data_nj=nj+4)
-  CALL xios_set_domain_attr("domain_oce",lonvalue_2D=lon,latvalue_2D=lat)
-
-
-!!! Definition du timestep
-
-  dtime=xios_duration_convert_from_string(timestep)
-  CALL xios_set_timestep(timestep=dtime)
-
-  CALL xios_close_context_definition()
-
-!####################################################################################
-!!! Boucle temporelle
-!####################################################################################
-  ts=1
-  cdate=cdate+dtime
-  DO while ( cdate <= edate )
-
-      CALL xios_get_handle("arpsfx",ctx_hdl)
-      CALL xios_set_current_context(ctx_hdl)
-
-!!! Mise a jour du pas de temps
-
-      CALL xios_update_calendar(ts)
-
-!!! On donne la valeur du champ atm
-
-      !print *,'sending field_atm_2d at timestep',ts
-      CALL xios_send_field("field_atm_scalar",field_atm_2D(1,1)+ts)
-      CALL xios_send_field("field_atm_1D",field_atm_3D(1,1,:)+ts)
-      CALL xios_send_field("field_atm_2D",field_atm_2D+ts)
-      CALL xios_send_field("field_atm_3D",field_atm_3D+ts)
-      CALL xios_send_field("pressure" ,pressure)
-      CALL xios_send_field("height"   ,height)
-      if (mod(ts,2)==0) then
-         CALL xios_send_field("field_sub",field_atm_2D+ts)
-      endif
-      !! On crÃ©e un champ avec des missings qui bougent
-      !! dans le temps : un bande verticale de 1 Ã  ni-3
-      field_atm_2D_miss(:,:)= field_atm_2D(:,:)+ts
-      field_atm_2D_miss(mod(ts,ni-3)+1,:)=1.e+20
-      CALL xios_send_field("field_miss",field_atm_2D_miss)
-      
-!!! On change de contexte
-
-      !CALL xios_get_handle("surface",ctx_hdl)
-      !CALL xios_set_current_context(ctx_hdl)
-
-!!! Mise a jour du pas de temps
-
-      !CALL xios_update_calendar(ts)
-
-!!! On donne la valeur du champ srf
-
-      CALL xios_send_field("field_srf_2D",field_srf_2D)
-      CALL xios_send_field("field_srf_3D",field_srf_3D)
-
-!!! On change de contexte
-
-      CALL xios_get_handle("nemo",ctx_hdl)
-      CALL xios_set_current_context(ctx_hdl)
-
-!!! Mise a jour du pas de temps
-
-      CALL xios_update_calendar(ts)
-
-!!! On donne la valeur du champ oce
-
-      CALL xios_send_field("field_oce_scalar",field_oce_2D(1,1)+ts)
-      CALL xios_send_field("field_oce_grid_2D",field_oce_2D)
-      CALL xios_send_field("field_oce_grid_3D",field_oce_3D)
-
-      CALL wait_us(int(elapsed_per_timestep*1.e6))   ! micro-secondes
-      cdate=cdate+dtime
-      ts=ts+1
-
-   ENDDO
-
-!####################################################################################
-!!! Finalisation
-!####################################################################################
-
-!!! Fin des contextes
-
-    CALL xios_context_finalize()
-    CALL xios_get_handle("arpsfx",ctx_hdl)
-    CALL xios_set_current_context(ctx_hdl)
-    CALL xios_context_finalize()
-    !CALL xios_get_handle("surface",ctx_hdl)
-    !CALL xios_set_current_context(ctx_hdl)
-    !CALL xios_context_finalize()
-
-    DEALLOCATE(lon, lat, lonvalue, field_atm_2D, field_atm_3D)
-    DEALLOCATE(pressure,height,pressure_glo,height_glo)
-    DEALLOCATE(kindex, field_srf_2D, field_srf_3D)
-    DEALLOCATE(field_oce_2D, field_oce_3D)
-    DEALLOCATE(lon_glo,lat_glo,field_A_glo,lval)
-
-!!! Fin de XIOS
-
-    CALL MPI_COMM_FREE(comm, ierr)
-      
-    CALL xios_finalize()
-
-  CALL MPI_FINALIZE(ierr)
-
-END PROGRAM toy_cmip6 
-
-
-
-
-
-
Index: /XIOS/trunk/src/transformation/algo_types.hpp
===================================================================
--- /XIOS/trunk/src/transformation/algo_types.hpp	(revision 1536)
+++ /XIOS/trunk/src/transformation/algo_types.hpp	(revision 1537)
@@ -18,6 +18,8 @@
 #include "axis_algorithm_interpolate.hpp"
 #include "axis_algorithm_reduce_domain.hpp"
+#include "axis_algorithm_reduce_axis.hpp"
 #include "axis_algorithm_transformation.hpp"
 #include "axis_algorithm_extract_domain.hpp"
+#include "axis_algorithm_temporal_splitting.hpp"
 
 #include "domain_algorithm_zoom.hpp"
@@ -25,4 +27,7 @@
 #include "domain_algorithm_compute_connectivity.hpp"
 #include "domain_algorithm_expand.hpp"
+#include "axis_algorithm_duplicate_scalar.hpp"
+#include "scalar_algorithm_reduce_scalar.hpp"
+#include "domain_algorithm_reorder.hpp"
 
 
Index: /XIOS/trunk/src/transformation/axis_algorithm_duplicate_scalar.cpp
===================================================================
--- /XIOS/trunk/src/transformation/axis_algorithm_duplicate_scalar.cpp	(revision 1537)
+++ /XIOS/trunk/src/transformation/axis_algorithm_duplicate_scalar.cpp	(revision 1537)
@@ -0,0 +1,72 @@
+/*!
+   \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)
+{
+  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));
+}
+
+bool CAxisAlgorithmDuplicateScalar::registerTrans()
+{
+  CGridTransformationFactory<CAxis>::registerTransformation(TRANS_DUPLICATE_SCALAR_TO_AXIS, create);
+}
+
+
+CAxisAlgorithmDuplicateScalar::CAxisAlgorithmDuplicateScalar(CAxis* axisDestination, CScalar* scalarSource, CDuplicateScalarToAxis* algo)
+ : CAxisAlgorithmTransformation(axisDestination, scalarSource)
+{
+
+}
+
+
+CAxisAlgorithmDuplicateScalar::~CAxisAlgorithmDuplicateScalar()
+{
+}
+
+void CAxisAlgorithmDuplicateScalar::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];
+
+  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 ;
+  }
+}
+
+}
Index: /XIOS/trunk/src/transformation/axis_algorithm_duplicate_scalar.hpp
===================================================================
--- /XIOS/trunk/src/transformation/axis_algorithm_duplicate_scalar.hpp	(revision 1537)
+++ /XIOS/trunk/src/transformation/axis_algorithm_duplicate_scalar.hpp	(revision 1537)
@@ -0,0 +1,51 @@
+/*!
+   \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();
+
+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/trunk/src/transformation/axis_algorithm_interpolate.cpp
===================================================================
--- /XIOS/trunk/src/transformation/axis_algorithm_interpolate.cpp	(revision 1536)
+++ /XIOS/trunk/src/transformation/axis_algorithm_interpolate.cpp	(revision 1537)
@@ -17,4 +17,5 @@
 #include "grid_transformation_factory_impl.hpp"
 #include "distribution_client.hpp"
+#include "timer.hpp"
 
 namespace xios {
@@ -63,4 +64,5 @@
 void CAxisAlgorithmInterpolate::computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs)
 {
+  CTimer::get("CAxisAlgorithmInterpolate::computeIndexSourceMapping_").resume() ;
   CContext* context = CContext::getCurrent();
   CContextClient* client=context->client;
@@ -84,4 +86,5 @@
     computeInterpolantPoint(valueSrc, indexVec, idx);
   }
+  CTimer::get("CAxisAlgorithmInterpolate::computeIndexSourceMapping_").suspend() ;
 }
 
@@ -148,5 +151,5 @@
       while (it < iteRange)
       {
-        while (itsecond < ite && ((*itsecond -*it) < precision))
+        while ( (itsecond < ite) && ((*itsecond -*it) < precision) )
         { ++itsecond; ++it; }
         int index = std::distance(itb, it);
@@ -313,5 +316,5 @@
     for (size_t idx = 0; idx < vecAxisValueSize; ++idx)
     {
-      if (dom->mask_1d(idx)) ++vecAxisValueSizeWithMask;
+      if (dom->domainMask(idx)) ++vecAxisValueSizeWithMask;
     }
 
@@ -324,5 +327,5 @@
       for (size_t idx = 0; idx < vecAxisValueSize; ++idx)
       {
-        if (dom->mask_1d(idx))
+        if (dom->domainMask(idx))
         {
           transPosition_[indexMask].resize(1);
@@ -345,5 +348,5 @@
     for (size_t idx = 0; idx < vecAxisValueSize; ++idx)
     {
-      if (dom->mask_1d(idx))
+      if (dom->domainMask(idx))
       {
         size_t axisValueSize = 0;
Index: /XIOS/trunk/src/transformation/axis_algorithm_reduce_axis.cpp
===================================================================
--- /XIOS/trunk/src/transformation/axis_algorithm_reduce_axis.cpp	(revision 1537)
+++ /XIOS/trunk/src/transformation/axis_algorithm_reduce_axis.cpp	(revision 1537)
@@ -0,0 +1,112 @@
+/*!
+   \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)
+{
+  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));
+}
+
+bool CAxisAlgorithmReduceAxis::registerTrans()
+{
+  CGridTransformationFactory<CAxis>::registerTransformation(TRANS_REDUCE_AXIS_TO_AXIS, create);
+}
+
+
+CAxisAlgorithmReduceAxis::CAxisAlgorithmReduceAxis(CAxis* axisDestination, CAxis* axisSource, CReduceAxisToAxis* algo)
+ : CAxisAlgorithmTransformation(axisDestination, axisSource), reduction_(0)
+{
+  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]);
+}
+
+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)
+{
+  reduction_->apply(localIndex, dataInput, dataOut, flagInitial, ignoreMissingValue, firstPass);
+}
+
+void CAxisAlgorithmReduceAxis::updateData(CArray<double,1>& dataOut)
+{
+  reduction_->updateData(dataOut);
+}
+
+CAxisAlgorithmReduceAxis::~CAxisAlgorithmReduceAxis()
+{
+  if (0 != reduction_) delete reduction_;
+}
+
+void CAxisAlgorithmReduceAxis::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];
+  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 ;      
+  }
+}
+
+}
Index: /XIOS/trunk/src/transformation/axis_algorithm_reduce_axis.hpp
===================================================================
--- /XIOS/trunk/src/transformation/axis_algorithm_reduce_axis.hpp	(revision 1537)
+++ /XIOS/trunk/src/transformation/axis_algorithm_reduce_axis.hpp	(revision 1537)
@@ -0,0 +1,62 @@
+/*!
+   \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();
+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/trunk/src/transformation/axis_algorithm_reduce_domain.cpp
===================================================================
--- /XIOS/trunk/src/transformation/axis_algorithm_reduce_domain.cpp	(revision 1536)
+++ /XIOS/trunk/src/transformation/axis_algorithm_reduce_domain.cpp	(revision 1537)
@@ -71,4 +71,5 @@
   dir_ = (CReduceDomainToAxis::direction_attr::iDir == algo->direction)  ? iDir : jDir;
   reduction_ = CReductionAlgorithm::createOperation(CReductionAlgorithm::ReductionOperations[op]);
+  local = algo->local ;
 }
 
@@ -104,14 +105,33 @@
   if (iDir == dir_)
   {
-    int nbAxisIdx = axisDstIndex.numElements();
-    for (int idxAxis = 0; idxAxis < nbAxisIdx; ++idxAxis)
+    if (local)
     {
-      int globalAxisIdx = axisDstIndex(idxAxis);
-      transMap[globalAxisIdx].resize(ni_glo);
-      transWeight[globalAxisIdx].resize(ni_glo);
-      for (int idx = 0; idx < ni_glo; ++idx)
+      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)
       {
-        transMap[globalAxisIdx][idx] = globalAxisIdx * ni_glo + idx;
-        transWeight[globalAxisIdx][idx] = 1.0;
+        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;
+        }
       }
     }
@@ -120,13 +140,32 @@
   {
     int nbAxisIdx = axisDstIndex.numElements();
-    for (int idxAxis = 0; idxAxis < nbAxisIdx; ++idxAxis)
+    if (local)
     {
-      int globalAxisIdx = axisDstIndex(idxAxis);
-      transMap[globalAxisIdx].resize(nj_glo);
-      transWeight[globalAxisIdx].resize(nj_glo);
-      for (int idx = 0; idx < nj_glo; ++idx)
+      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)
       {
-        transMap[globalAxisIdx][idx] = globalAxisIdx + ni_glo*idx;
-        transWeight[globalAxisIdx][idx] = 1.0;
+        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;
+        }
       }
     }
Index: /XIOS/trunk/src/transformation/axis_algorithm_reduce_domain.hpp
===================================================================
--- /XIOS/trunk/src/transformation/axis_algorithm_reduce_domain.hpp	(revision 1536)
+++ /XIOS/trunk/src/transformation/axis_algorithm_reduce_domain.hpp	(revision 1537)
@@ -46,6 +46,8 @@
     jDir = 2
   };
-
+  
   ReduceDirection dir_;
+  bool local ;
+  
 protected:
   void computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs); 
Index: /XIOS/trunk/src/transformation/axis_algorithm_temporal_splitting.cpp
===================================================================
--- /XIOS/trunk/src/transformation/axis_algorithm_temporal_splitting.cpp	(revision 1537)
+++ /XIOS/trunk/src/transformation/axis_algorithm_temporal_splitting.cpp	(revision 1537)
@@ -0,0 +1,75 @@
+/*!
+   \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)
+{
+  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));
+}
+
+bool CAxisAlgorithmTemporalSplitting::registerTrans()
+{
+  CGridTransformationFactory<CAxis>::registerTransformation(TRANS_TEMPORAL_SPLITTING, create);
+}
+
+
+CAxisAlgorithmTemporalSplitting::CAxisAlgorithmTemporalSplitting(CAxis* axisDestination, CScalar* scalarSource, CTemporalSplitting* algo)
+ : CAxisAlgorithmTransformation(axisDestination, scalarSource)
+{
+
+}
+
+
+CAxisAlgorithmTemporalSplitting::~CAxisAlgorithmTemporalSplitting()
+{
+}
+
+void CAxisAlgorithmTemporalSplitting::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];
+
+  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 ;
+    }
+  }
+}
+
+}
Index: /XIOS/trunk/src/transformation/axis_algorithm_temporal_splitting.hpp
===================================================================
--- /XIOS/trunk/src/transformation/axis_algorithm_temporal_splitting.hpp	(revision 1537)
+++ /XIOS/trunk/src/transformation/axis_algorithm_temporal_splitting.hpp	(revision 1537)
@@ -0,0 +1,52 @@
+/*!
+   \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();
+
+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/trunk/src/transformation/axis_algorithm_transformation.cpp
===================================================================
--- /XIOS/trunk/src/transformation/axis_algorithm_transformation.cpp	(revision 1536)
+++ /XIOS/trunk/src/transformation/axis_algorithm_transformation.cpp	(revision 1537)
@@ -19,5 +19,5 @@
 
 CAxisAlgorithmTransformation::CAxisAlgorithmTransformation(CAxis* axisDestination, CAxis* axisSource)
- : CGenericAlgorithmTransformation(), axisDest_(axisDestination), axisSrc_(axisSource), domainSrc_(0)
+ : CGenericAlgorithmTransformation(), axisDest_(axisDestination), axisSrc_(axisSource), domainSrc_(0),scalarSrc_(0)
 {
   axisDestGlobalSize_ = axisDestination->n_glo.getValue();
@@ -30,5 +30,5 @@
 
 CAxisAlgorithmTransformation::CAxisAlgorithmTransformation(CAxis* axisDestination, CDomain* domainSource)
- : CGenericAlgorithmTransformation(), axisDest_(axisDestination), axisSrc_(0), domainSrc_(domainSource)
+ : CGenericAlgorithmTransformation(), axisDest_(axisDestination), axisSrc_(0), domainSrc_(domainSource),scalarSrc_(0)
 {
   axisDestGlobalSize_ = axisDestination->n_glo.getValue();
@@ -40,4 +40,14 @@
 }
 
+CAxisAlgorithmTransformation::CAxisAlgorithmTransformation(CAxis* axisDestination, CScalar* scalarSource)
+ : CGenericAlgorithmTransformation(), axisDest_(axisDestination), axisSrc_(0), domainSrc_(0), scalarSrc_(scalarSource)
+{
+  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);
+}
 CAxisAlgorithmTransformation::~CAxisAlgorithmTransformation()
 {
@@ -64,21 +74,47 @@
   size_t globalIndex;
   int nIndexSize = 0;
-  if (2 == elementType) nIndexSize = domainSrc_->i_index.numElements();
-  else if (1 == elementType) nIndexSize = axisSrc_->index.numElements();
+  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 (2 == elementType)
+    if (localMask(idx))
     {
-      globalIndex = domainSrc_->i_index(idx) + domainSrc_->j_index(idx) * domainSrc_->ni_glo;
+      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;
     }
-    else if (1 == elementType)
-    {
-      globalIndex = axisSrc_->index(idx);
-    }
-
-    globalIndex2ProcRank[globalIndex].resize(1);
-    globalIndex2ProcRank[globalIndex][0] = clientRank;
   }
 
Index: /XIOS/trunk/src/transformation/axis_algorithm_transformation.hpp
===================================================================
--- /XIOS/trunk/src/transformation/axis_algorithm_transformation.hpp	(revision 1536)
+++ /XIOS/trunk/src/transformation/axis_algorithm_transformation.hpp	(revision 1537)
@@ -17,5 +17,5 @@
 class CAxis;
 class CDomain;
-
+class CScalar;
 /*!
   \class CAxisAlgorithmTransformation
@@ -27,4 +27,5 @@
   CAxisAlgorithmTransformation(CAxis* axisDestination, CAxis* axisSource);
   CAxisAlgorithmTransformation(CAxis* axisDestination, CDomain* domainSource);
+  CAxisAlgorithmTransformation(CAxis* axisDestination, CScalar* scalarSource);
 
   virtual ~CAxisAlgorithmTransformation();
@@ -52,4 +53,8 @@
   //! Domain on grid source
   CDomain* domainSrc_;
+
+  //! Scalar on grid source
+
+  CScalar* scalarSrc_;
 };
 
Index: /XIOS/trunk/src/transformation/axis_algorithm_zoom.cpp
===================================================================
--- /XIOS/trunk/src/transformation/axis_algorithm_zoom.cpp	(revision 1536)
+++ /XIOS/trunk/src/transformation/axis_algorithm_zoom.cpp	(revision 1537)
@@ -44,5 +44,5 @@
   zoomBegin_ = zoomAxis->begin.getValue();
   zoomSize_  = zoomAxis->n.getValue();
-  zoomEnd_   = zoomBegin_ + zoomSize_ - 1;  
+  zoomEnd_   = zoomBegin_ + zoomSize_ - 1;
 
   if (zoomSize_ > axisSource->n_glo.getValue())
@@ -63,4 +63,5 @@
     std::sort(zoomIndex_.begin(), zoomIndex_.end());
   }
+
 }
 
@@ -70,10 +71,7 @@
 void CAxisAlgorithmZoom::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];
-
+  // We use all index of source and destination to calculate the mapping index of zoom.
+  // The server who receives the "zoomed" fields will decide whether it will forward these fields or write "real zoomed" fields into file
+  // That means servers need to change to cover this problem.
   StdSize niSource = axisSrc_->n.getValue();
   StdSize ibeginSource = axisSrc_->begin.getValue();
@@ -84,4 +82,10 @@
   StdSize ni = iend + 1 - ibegin;
   if (iend < ibegin) ni = 0;
+
+  this->transformationMapping_.resize(1);
+  this->transformationWeight_.resize(1);
+
+  TransformationIndexMap& transMap = this->transformationMapping_[0];
+  TransformationWeightMap& transWeight = this->transformationWeight_[0];
 
   if (!zoomIndex_.empty())
@@ -106,5 +110,5 @@
 
   updateZoom();
-  updateAxisDestinationMask();
+  // updateAxisDestinationMask();
 }
 
@@ -128,18 +132,18 @@
 correct index be extracted
 */
-void CAxisAlgorithmZoom::updateAxisDestinationMask()
-{
-  StdSize niMask = axisDest_->mask.numElements();
-  StdSize iBeginMask = axisDest_->begin.getValue();
-  StdSize globalIndexMask = 0;
-  TransformationIndexMap& transMap = this->transformationMapping_[0];
-  TransformationIndexMap::const_iterator ite = (transMap).end();
-  for (StdSize idx = 0; idx < niMask; ++idx)
-  {
-    globalIndexMask = iBeginMask + idx;
-    if (transMap.find(globalIndexMask) == ite)
-      (axisDest_->mask)(idx) = false;
-  }
-}
+// void CAxisAlgorithmZoom::updateAxisDestinationMask()
+// {
+//   StdSize niMask = axisDest_->mask.numElements();
+//   StdSize iBeginMask = axisDest_->begin.getValue();
+//   StdSize globalIndexMask = 0;
+//   TransformationIndexMap& transMap = this->transformationMapping_[0];
+//   TransformationIndexMap::const_iterator ite = (transMap).end();
+//   for (StdSize idx = 0; idx < niMask; ++idx)
+//   {
+//     globalIndexMask = iBeginMask + idx;
+//     if (transMap.find(globalIndexMask) == ite)
+//       (axisDest_->mask)(idx) = false;
+//   }
+// }
 
 }
Index: /XIOS/trunk/src/transformation/axis_algorithm_zoom.hpp
===================================================================
--- /XIOS/trunk/src/transformation/axis_algorithm_zoom.hpp	(revision 1536)
+++ /XIOS/trunk/src/transformation/axis_algorithm_zoom.hpp	(revision 1537)
@@ -35,5 +35,5 @@
 
 private:
-  void updateAxisDestinationMask();
+  // void updateAxisDestinationMask();
   void updateZoom();
 
Index: /XIOS/trunk/src/transformation/domain_algorithm_expand.cpp
===================================================================
--- /XIOS/trunk/src/transformation/domain_algorithm_expand.cpp	(revision 1536)
+++ /XIOS/trunk/src/transformation/domain_algorithm_expand.cpp	(revision 1537)
@@ -161,4 +161,5 @@
   else domainDestination->domain_ref.setValue(domainDstRef);
 
+  
   // Here are attributes of source need tranfering
   int niGloSrc = domainSource->ni_glo;
@@ -167,5 +168,5 @@
   int njSrc = domainSource->nj, jbegin = domainSource->jbegin;
   int dataDimSrc = domainSource->data_dim;
-  CArray<bool,1>& mask_1d_src = domainSource->mask_1d;
+  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;
@@ -174,6 +175,6 @@
   int data_i_begin_src = domainSource->data_ibegin;
   int data_j_begin_src = domainSource->data_jbegin;
-  CArray<double,1>& lon_src = domainSource->lonvalue_client;
-  CArray<double,1>& lat_src = domainSource->latvalue_client;
+  CArray<double,1>& lon_src = domainSource->lonvalue;
+  CArray<double,1>& lat_src = domainSource->latvalue;
 
   // We need to generate boundary for longitude and latitude
@@ -230,5 +231,5 @@
   domainDestination->global_zoom_nj.setValue(domainSource->global_zoom_nj+2);
 
-  CArray<bool,1>& mask_1d_dst = domainDestination->mask_1d;
+  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;  
@@ -252,10 +253,10 @@
   CArray<int,1> data_j_index_dst_full(newNbLocalDst);
 
-  domainDestination->lonvalue_client.resizeAndPreserve(newNbLocalDst);  
-  domainDestination->latvalue_client.resizeAndPreserve(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_client;
-  CArray<double,1>& lat_dst   = domainDestination->latvalue_client;
+  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;
@@ -452,5 +453,7 @@
      domainDestination->latvalue_1d = (lat_dst);
   }
-
+   domainDestination->mask_1d.resize(domainDestination->domainMask.numElements()) ;
+   domainDestination->mask_1d=domainDestination->domainMask ;
+   domainDestination->computeLocalMask() ;
 }
 
@@ -484,5 +487,5 @@
   // Now extend domain destination
   int niGlob = domainSource->ni_glo;
-  CArray<bool,1>& mask_1d_src = domainSource->mask_1d;
+  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;
@@ -507,5 +510,5 @@
   }
 
-  CArray<bool,1>& mask_1d_dst = domainDestination->mask_1d;
+  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;
@@ -664,4 +667,7 @@
   // Update ni
   domainDestination->ni.setValue(newNbLocalDst);
+  domainDestination->mask_1d.resize(domainDestination->domainMask.numElements()) ;
+  domainDestination->mask_1d=domainDestination->domainMask ;
+  domainDestination->computeLocalMask() ;
 }
 
Index: /XIOS/trunk/src/transformation/domain_algorithm_generate_rectilinear.hpp
===================================================================
--- /XIOS/trunk/src/transformation/domain_algorithm_generate_rectilinear.hpp	(revision 1536)
+++ /XIOS/trunk/src/transformation/domain_algorithm_generate_rectilinear.hpp	(revision 1537)
@@ -20,6 +20,6 @@
 /*!
   \class CDomainAlgorithmGenerateRectilinear
-  Generate a rectilinear domain and fill in necessary its attributes automatically
-  A new rectilinear domain will also be distributed automatically among the processes.
+  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.
 */
Index: /XIOS/trunk/src/transformation/domain_algorithm_interpolate.cpp
===================================================================
--- /XIOS/trunk/src/transformation/domain_algorithm_interpolate.cpp	(revision 1536)
+++ /XIOS/trunk/src/transformation/domain_algorithm_interpolate.cpp	(revision 1537)
@@ -52,4 +52,12 @@
   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_";
 
@@ -99,12 +107,5 @@
   std::vector<double> srcPole(3,0), dstPole(3,0);
   int orderInterp = interpDomain_->order.getValue();
-  bool renormalize ;
-  bool quantity ;
-
-  if (interpDomain_->renormalize.isEmpty()) renormalize=true;
-  else renormalize = interpDomain_->renormalize;
-
-  if (interpDomain_->quantity.isEmpty()) quantity=false;
-  else quantity = interpDomain_->quantity;
+
 
   const double poleValue = 90.0;
@@ -453,5 +454,5 @@
         recvTemp[recvSourceIndexBuff[idx]] += recvSourceWeightBuff[idx]/nbGlobalPointOnPole;
       else
-        recvTemp[recvSourceIndexBuff[idx]] = 0.0;
+        recvTemp[recvSourceIndexBuff[idx]] = recvSourceWeightBuff[idx]/nbGlobalPointOnPole;
     }
 
@@ -473,5 +474,5 @@
 void CDomainAlgorithmInterpolate::computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs)
 {
-  if (readFromFile_ && !writeToFile_)  
+  if (readFromFile_)  
     readRemapInfo();
   else
@@ -563,5 +564,5 @@
   }
 
-  domainIndexClientClientMapping.computeServerIndexMapping(globalIndexInterp);
+  domainIndexClientClientMapping.computeServerIndexMapping(globalIndexInterp, client->serverSize);
   const CClientServerMapping::GlobalIndexMap& globalIndexInterpSendToClient = domainIndexClientClientMapping.getGlobalIndexOnServer();
 
@@ -770,4 +771,6 @@
 
   int index = 0;
+  int indexOffset=0 ;
+  if (fortranConvention) indexOffset=1 ;
   for (it = itb; it !=ite; ++it)
   {
@@ -775,6 +778,6 @@
     for (int idx = 0; idx < tmp.size(); ++idx)
     {
-      dst_idx(index) = it->first + 1;
-      src_idx(index) = tmp[idx].first + 1;
+      dst_idx(index) = it->first + indexOffset;
+      src_idx(index) = tmp[idx].first + indexOffset;
       weights(index) = tmp[idx].second;
       ++index;
@@ -838,4 +841,5 @@
   size_t nbWeightGlo ;
 
+
   CContext* context = CContext::getCurrent();
   CContextClient* client=context->client;
@@ -843,4 +847,12 @@
   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) ;
@@ -877,7 +889,76 @@
   nc_get_vara_long(ncid, dstIndexId, &start, &nbWeight, dstIndex) ;
 
-  for(size_t ind=0; ind<nbWeight;++ind)
-    interpMapValue[dstIndex[ind]-1].push_back(make_pair(srcIndex[ind]-1,weight[ind]));
-}
-
-}
+  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]));
+ }
+
+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  )
+{
+  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;
+    }
+  }
+}
+
+void CDomainAlgorithmInterpolate::updateData(CArray<double,1>& dataOut)
+{
+  if (detectMissingValue)
+  {
+    double defaultValue = std::numeric_limits<double>::quiet_NaN();
+    size_t nbIndex=dataOut.numElements() ; 
+
+    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
+    }
+  }
+}
+
+}
Index: /XIOS/trunk/src/transformation/domain_algorithm_interpolate.hpp
===================================================================
--- /XIOS/trunk/src/transformation/domain_algorithm_interpolate.hpp	(revision 1536)
+++ /XIOS/trunk/src/transformation/domain_algorithm_interpolate.hpp	(revision 1537)
@@ -31,4 +31,11 @@
   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();
 protected:
@@ -47,8 +54,15 @@
 
 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;
Index: /XIOS/trunk/src/transformation/domain_algorithm_reorder.cpp
===================================================================
--- /XIOS/trunk/src/transformation/domain_algorithm_reorder.cpp	(revision 1537)
+++ /XIOS/trunk/src/transformation/domain_algorithm_reorder.cpp	(revision 1537)
@@ -0,0 +1,130 @@
+/*!
+   \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)
+{
+  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));
+}
+
+bool CDomainAlgorithmReorder::registerTrans()
+{
+  CGridTransformationFactory<CDomain>::registerTransformation(TRANS_REORDER_DOMAIN, create);
+}
+
+CDomainAlgorithmReorder::CDomainAlgorithmReorder(CDomain* domainDestination, CDomain* domainSource, CReorderDomain* reorderDomain)
+: CDomainAlgorithmTransformation(domainDestination, domainSource)
+{
+  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 ;
+      }
+    }
+  }
+    
+  
+}
+
+/*!
+  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/trunk/src/transformation/domain_algorithm_reorder.hpp
===================================================================
--- /XIOS/trunk/src/transformation/domain_algorithm_reorder.hpp	(revision 1537)
+++ /XIOS/trunk/src/transformation/domain_algorithm_reorder.hpp	(revision 1537)
@@ -0,0 +1,46 @@
+/*!
+   \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();
+
+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/trunk/src/transformation/domain_algorithm_transformation.cpp
===================================================================
--- /XIOS/trunk/src/transformation/domain_algorithm_transformation.cpp	(revision 1536)
+++ /XIOS/trunk/src/transformation/domain_algorithm_transformation.cpp	(revision 1537)
@@ -48,11 +48,15 @@
   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)
   {
-    i_ind=domainSrc_->i_index(idx) ;
-    j_ind=domainSrc_->j_index(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);
+      globalIndex = i_ind + j_ind * niGlob;
+      globalIndex2ProcRank[globalIndex].push_back(clientRank);
+    }
   }
 
Index: /XIOS/trunk/src/transformation/domain_algorithm_zoom.cpp
===================================================================
--- /XIOS/trunk/src/transformation/domain_algorithm_zoom.cpp	(revision 1536)
+++ /XIOS/trunk/src/transformation/domain_algorithm_zoom.cpp	(revision 1537)
@@ -74,21 +74,4 @@
 void CDomainAlgorithmZoom::computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs)
 {
-  int niSource = domainSrc_->ni.getValue();
-  int ibeginSource = domainSrc_->ibegin.getValue();
-  int iendSource = ibeginSource + niSource - 1;
-
-  int ibegin = std::max(ibeginSource, zoomIBegin_);
-  int iend = std::min(iendSource, zoomIEnd_);
-  int ni = iend + 1 - ibegin;
-  if (iend < ibegin) ni = 0;
-
-  int njSource = domainSrc_->nj.getValue();
-  int jbeginSource = domainSrc_->jbegin.getValue();
-  int jendSource = jbeginSource + njSource - 1;
-
-  int jbegin = std::max(jbeginSource, zoomJBegin_);
-  int jend = std::min(jendSource, zoomJEnd_);
-  int nj = jend + 1 - jbegin;
-  if (jend < jbegin) nj = 0;
 
   int niGlob = domainSrc_->ni_glo.getValue();
@@ -102,16 +85,21 @@
 
   int domainGlobalIndex;
-  for (int j = 0; j < nj; ++j)
+  int iglob ;
+  int jglob ;
+  const CArray<int,1>& i_index = domainSrc_->i_index.getValue() ;
+  const CArray<int,1>& j_index = domainSrc_->j_index.getValue() ;
+
+  int nglo = i_index.numElements() ;
+  for (size_t i = 0; i < nglo ; ++i)
   {
-    for (int i = 0; i < ni; ++i)
+    iglob=i_index(i) ; jglob=j_index(i) ;
+    if (iglob>=zoomIBegin_ && iglob<=zoomIEnd_ && jglob>=zoomJBegin_ && jglob<=zoomJEnd_)
     {
-      domainGlobalIndex = (j+jbegin) * niGlob + (i+ibegin);
+      domainGlobalIndex = jglob*niGlob + iglob;
       transMap[domainGlobalIndex].push_back(domainGlobalIndex);
       transWeight[domainGlobalIndex].push_back(1.0);
     }
   }
-
   updateZoom();
-  updateDomainDestinationMask();
 }
 
@@ -132,25 +120,25 @@
 correct index be extracted
 */
-void CDomainAlgorithmZoom::updateDomainDestinationMask()
-{
-  int niMask     = domainDest_->ni.getValue();
-  int iBeginMask = domainDest_->ibegin.getValue();
-  int njMask     = domainDest_->nj.getValue();
-  int jBeginMask = domainDest_->jbegin.getValue();
-  int niGlob = domainDest_->ni_glo.getValue();
-  int globalIndexMask = 0;
+// void CDomainAlgorithmZoom::updateDomainDestinationMask()
+// {
+//   int niMask     = domainDest_->ni.getValue();
+//   int iBeginMask = domainDest_->ibegin.getValue();
+//   int njMask     = domainDest_->nj.getValue();
+//   int jBeginMask = domainDest_->jbegin.getValue();
+//   int niGlob = domainDest_->ni_glo.getValue();
+//   int globalIndexMask = 0;
 
-  TransformationIndexMap& transMap = this->transformationMapping_[0];
-  TransformationIndexMap::const_iterator ite = (transMap).end();
-  for (int j = 0; j < njMask; ++j)
-  {
-    for (int i = 0; i < niMask; ++i)
-    {
-      globalIndexMask = (j+jBeginMask) * niGlob + (i + iBeginMask);
-      if (transMap.find(globalIndexMask) == ite)
-        (domainDest_->mask_1d)(i+j*niMask) = false;
-    }
-  }
-}
+//   TransformationIndexMap& transMap = this->transformationMapping_[0];
+//   TransformationIndexMap::const_iterator ite = (transMap).end();
+//   for (int j = 0; j < njMask; ++j)
+//   {
+//     for (int i = 0; i < niMask; ++i)
+//     {
+//       globalIndexMask = (j+jBeginMask) * niGlob + (i + iBeginMask);
+//       if (transMap.find(globalIndexMask) == ite)
+//         (domainDest_->mask_1d)(i+j*niMask) = false;
+//     }
+//   }
+// }
 
 }
Index: /XIOS/trunk/src/transformation/domain_algorithm_zoom.hpp
===================================================================
--- /XIOS/trunk/src/transformation/domain_algorithm_zoom.hpp	(revision 1536)
+++ /XIOS/trunk/src/transformation/domain_algorithm_zoom.hpp	(revision 1537)
@@ -36,5 +36,5 @@
 
 private:
-  void updateDomainDestinationMask();
+  // void updateDomainDestinationMask();
   void updateZoom();
 
Index: /XIOS/trunk/src/transformation/generic_algorithm_transformation.cpp
===================================================================
--- /XIOS/trunk/src/transformation/generic_algorithm_transformation.cpp	(revision 1536)
+++ /XIOS/trunk/src/transformation/generic_algorithm_transformation.cpp	(revision 1537)
@@ -12,4 +12,6 @@
 #include "client_client_dht_template.hpp"
 #include "utils.hpp"
+#include "timer.hpp"
+#include "mpi.hpp"
 
 namespace xios {
@@ -17,5 +19,6 @@
 CGenericAlgorithmTransformation::CGenericAlgorithmTransformation()
  : transformationMapping_(), transformationWeight_(), transformationPosition_(),
-   idAuxInputs_(), type_(ELEMENT_NO_MODIFICATION_WITH_DATA)
+   idAuxInputs_(), type_(ELEMENT_NO_MODIFICATION_WITH_DATA), indexElementSrc_(),
+   computedProcSrcNonTransformedElement_(false), eliminateRedondantSrc_(true), isDistributedComputed_(false)
 {
 }
@@ -34,25 +37,19 @@
   int nbLocalIndex = localIndex.size();   
   double defaultValue = std::numeric_limits<double>::quiet_NaN();
+    
   if (ignoreMissingValue)
   {
+    if (firstPass) dataOut=defaultValue ;
+    
     for (int idx = 0; idx < nbLocalIndex; ++idx)
     {
-      if (NumTraits<double>::isNan(*(dataInput + idx)))
-      {
-        flagInitial[localIndex[idx].first] = false;
-      }
-      else
-      {
-        dataOut(localIndex[idx].first) += *(dataInput + idx) * localIndex[idx].second;
-        flagInitial[localIndex[idx].first] = true; // Reset flag to indicate not all data source are nan
-      }
-    }
-
-    // If all data source are nan then data destination must be nan
-    for (int idx = 0; idx < nbLocalIndex; ++idx)
-    {
-      if (!flagInitial[localIndex[idx].first])
-        dataOut(localIndex[idx].first) = defaultValue;
-    }
+      if (! NumTraits<double>::isNan(*(dataInput + idx)))
+      {
+        if (flagInitial[localIndex[idx].first]) dataOut(localIndex[idx].first) = *(dataInput + idx) * localIndex[idx].second;
+        else dataOut(localIndex[idx].first) += *(dataInput + idx) * localIndex[idx].second;
+        flagInitial[localIndex[idx].first] = false; // Reset flag to indicate not all data source are nan
+      }
+    }
+
   }
   else
@@ -112,4 +109,43 @@
 }
 
+bool CGenericAlgorithmTransformation::isDistributedTransformation(int elementPositionInGrid, CGrid* gridSrc, CGrid* gridDst)
+{
+
+  if (!isDistributedComputed_)
+  {
+    isDistributedComputed_=true ;
+    if (!eliminateRedondantSrc_) isDistributed_=true ;
+    else
+    {
+      CContext* context = CContext::getCurrent();
+      CContextClient* client = context->client;
+  
+      computePositionElements(gridSrc, gridDst);
+      std::vector<CScalar*> scalarListSrcP  = gridSrc->getScalars();
+      std::vector<CAxis*> axisListSrcP = gridSrc->getAxis();
+      std::vector<CDomain*> domainListSrcP = gridSrc->getDomains();
+      int distributed, distributed_glo ;
+  
+      CArray<int,1> axisDomainSrcOrder = gridSrc->axis_domain_order;
+      if (2 == axisDomainSrcOrder(elementPositionInGrid)) // It's domain
+      {
+        distributed=domainListSrcP[elementPositionInGridSrc2DomainPosition_[elementPositionInGrid]]->isDistributed() ;
+        MPI_Allreduce(&distributed,&distributed_glo, 1, MPI_INT, MPI_LOR, client->intraComm) ;
+    
+      }
+      else if (1 == axisDomainSrcOrder(elementPositionInGrid))//it's an axis
+      {
+        distributed=axisListSrcP[elementPositionInGridSrc2AxisPosition_[elementPositionInGrid]]->isDistributed() ;
+        MPI_Allreduce(&distributed,&distributed_glo, 1, MPI_INT, MPI_LOR, client->intraComm) ;
+      }
+      else //it's a scalar
+      {
+        distributed_glo=false ;
+      } 
+      isDistributed_=distributed_glo ;
+    }
+  }
+  return isDistributed_ ;
+}  
 /*!
   This function computes the global indexes of grid source, which the grid destination is in demand.
@@ -130,48 +166,5 @@
 
   typedef boost::unordered_map<int, std::vector<std::pair<int,double> > > SrcToDstMap;
-
-  size_t indexSrcSize = 0;
-  for (size_t idxTrans = 0; idxTrans < transformationMapping_.size(); ++idxTrans)
-  {
-    TransformationIndexMap::const_iterator itbTransMap = transformationMapping_[idxTrans].begin(), itTransMap,
-                                           iteTransMap = transformationMapping_[idxTrans].end();
-    TransformationWeightMap::const_iterator itbTransWeight = transformationWeight_[idxTrans].begin(), itTransWeight;
-
-    itTransWeight = itbTransWeight;
-    for (itTransMap = itbTransMap; itTransMap != iteTransMap; ++itTransMap, ++itTransWeight)
-    {
-       indexSrcSize += (itTransMap->second).size();
-    }
-  }
-
-  bool isTransPosEmpty = transformationPosition_.empty();
-  CArray<size_t,1> transPos;
-  if (!isTransPosEmpty) transPos.resize(transformationMapping_.size());
-  CArray<size_t,1> indexSrc(indexSrcSize);
-  indexSrcSize = 0;
-  for (size_t idxTrans = 0; idxTrans < transformationMapping_.size(); ++idxTrans)
-  {
-    TransformationIndexMap::const_iterator itbTransMap = transformationMapping_[idxTrans].begin(), itTransMap,
-                                           iteTransMap = transformationMapping_[idxTrans].end();
-    TransformationWeightMap::const_iterator itbTransWeight = transformationWeight_[idxTrans].begin(), itTransWeight;
-
-    // Build mapping between global source element index and global destination element index.
-    itTransWeight = itbTransWeight;
-    for (itTransMap = itbTransMap; itTransMap != iteTransMap; ++itTransMap, ++itTransWeight)
-    {
-      const std::vector<int>& srcIndex = itTransMap->second;
-      for (int idx = 0; idx < srcIndex.size(); ++idx)
-      {
-        indexSrc(indexSrcSize) = srcIndex[idx];
-        ++indexSrcSize;
-      }
-    }
-
-    if (!isTransPosEmpty)
-    {
-      TransformationPositionMap::const_iterator itPosMap = transformationPosition_[idxTrans].begin();
-      transPos(idxTrans) = itPosMap->second[0];
-    }
-  }
+  int idx;
 
   // compute position of elements on grids
@@ -184,54 +177,213 @@
   std::vector<CAxis*> axisListSrcP = gridSrc->getAxis();
   std::vector<CDomain*> domainListSrcP = gridSrc->getDomains();
-  CArray<int,1> axisDomainSrcOrder = gridSrc->axis_domain_order;
-
-  // Find out global index source of transformed element on corresponding process.
-  std::vector<boost::unordered_map<int,std::vector<size_t> > > globalElementIndexOnProc(axisDomainDstOrder.numElements());
-  CClientClientDHTInt::Index2VectorInfoTypeMap globalIndexOfTransformedElementOnProc;  
-  for (int idx = 0; idx < axisDomainDstOrder.numElements(); ++idx)
-  {
-    if (idx == elementPositionInGrid)
-      computeExchangeGlobalIndex(indexSrc, axisDomainSrcOrder(idx), globalIndexOfTransformedElementOnProc); //globalElementIndexOnProc[idx]);
-    if (2 == axisDomainDstOrder(idx)) // It's domain
-    {
-      if (idx != elementPositionInGrid)
-        computeExchangeDomainIndex(domainListDestP[elementPositionInGridDst2DomainPosition_[idx]],
-                                   domainListSrcP[elementPositionInGridSrc2DomainPosition_[idx]],
-                                   transPos,
-                                   globalElementIndexOnProc[idx]);      
-
-    }
-    else if (1 == axisDomainDstOrder(idx))//it's an axis
-    {
-      if (idx != elementPositionInGrid)
-        computeExchangeAxisIndex(axisListDestP[elementPositionInGridDst2AxisPosition_[idx]],
-                                 axisListSrcP[elementPositionInGridSrc2AxisPosition_[idx]],
-                                 transPos,
-                                 globalElementIndexOnProc[idx]);
-    }
-    else //it's a scalar
-    {
-      if (idx != elementPositionInGrid)
-        computeExchangeScalarIndex(scalarListDestP[elementPositionInGridDst2ScalarPosition_[idx]],
-                                   scalarListSrcP[elementPositionInGridSrc2ScalarPosition_[idx]],
-                                   transPos,
-                                   globalElementIndexOnProc[idx]);
-
-    }
-  }
-
-  if (!isTransPosEmpty)
-  {
-    for (int idx = 0; idx < globalElementIndexOnProc.size(); ++idx)
-    {
-      if (idx != elementPositionInGrid)
-      {
-        boost::unordered_map<int,std::vector<size_t> >::iterator itb = globalElementIndexOnProc[idx].begin(), it,
-                                                                 ite = globalElementIndexOnProc[idx].end();
-        for (it = itb; it != ite; ++it) it->second.resize(1);
-      }
-    }
-  }
-
+  CArray<int,1> axisDomainSrcOrder = gridSrc->axis_domain_order;  
+  
+  bool isTransPosEmpty = transformationPosition_.empty();
+  CArray<size_t,1> transPos;
+  if (!isTransPosEmpty) transPos.resize(transformationMapping_.size());
+  std::set<size_t> allIndexSrc; // All index of source, which can be scattered among processes, need for doing transformation 
+  
+  for (size_t idxTrans = 0; idxTrans < transformationMapping_.size(); ++idxTrans)
+  {
+    TransformationIndexMap::const_iterator itbTransMap = transformationMapping_[idxTrans].begin(), itTransMap,
+                                           iteTransMap = transformationMapping_[idxTrans].end();
+    TransformationWeightMap::const_iterator itbTransWeight = transformationWeight_[idxTrans].begin(), itTransWeight;
+
+    // Build mapping between global source element index and global destination element index.
+    itTransWeight = itbTransWeight;
+    for (itTransMap = itbTransMap; itTransMap != iteTransMap; ++itTransMap, ++itTransWeight)
+    {
+      const std::vector<int>& srcIndex = itTransMap->second;
+      for (idx = 0; idx < srcIndex.size(); ++idx)
+        allIndexSrc.insert(srcIndex[idx]);
+    }
+
+    if (!isTransPosEmpty)
+    {
+      TransformationPositionMap::const_iterator itPosMap = transformationPosition_[idxTrans].begin();
+      transPos(idxTrans) = itPosMap->second[0];
+    }
+  }
+
+  size_t indexSrcSize = 0;
+  CArray<size_t,1> indexSrc(allIndexSrc.size());
+  for (std::set<size_t>::iterator it = allIndexSrc.begin(); it != allIndexSrc.end(); ++it, ++indexSrcSize)
+    indexSrc(indexSrcSize) = *it;
+
+  // Flag to indicate whether we will recompute distribution of source global index  on processes
+  bool computeGlobalIndexOnProc = false; 
+  if (indexElementSrc_.size() != allIndexSrc.size())
+    computeGlobalIndexOnProc = true;  
+  else
+  {
+    for (std::set<size_t>::iterator it = allIndexSrc.begin(); it != allIndexSrc.end(); ++it)
+      if (0 == indexElementSrc_.count(*it))
+      {
+        computeGlobalIndexOnProc = true;
+        break;        
+      }
+  }
+
+  if (computeGlobalIndexOnProc)
+    indexElementSrc_.swap(allIndexSrc);
+      
+  int sendValue = (computeGlobalIndexOnProc) ? 1 : 0;
+  int recvValue = 0;
+  MPI_Allreduce(&sendValue, &recvValue, 1, MPI_INT, MPI_SUM, client->intraComm);
+  computeGlobalIndexOnProc = (0 < recvValue);
+
+//  CClientClientDHTInt::Index2VectorInfoTypeMap globalIndexOfTransformedElementOnProc;
+
+  if (computeGlobalIndexOnProc || !computedProcSrcNonTransformedElement_)
+  {    
+    {
+      CClientClientDHTInt::Index2VectorInfoTypeMap tmp ;
+      globalIndexOfTransformedElementOnProc_.swap(tmp) ;
+    }
+    // Find out global index source of transformed element on corresponding process.    
+    if (globalElementIndexOnProc_.empty())
+      globalElementIndexOnProc_.resize(axisDomainDstOrder.numElements());
+    
+    for (idx = 0; idx < axisDomainDstOrder.numElements(); ++idx)
+    {
+      
+      if (idx == elementPositionInGrid)
+        computeExchangeGlobalIndex(indexSrc, axisDomainSrcOrder(idx), globalIndexOfTransformedElementOnProc_); //globalElementIndexOnProc[idx]);
+      if (!computedProcSrcNonTransformedElement_)
+      {
+        if (2 == axisDomainDstOrder(idx)) // It's domain
+        {
+          if (idx != elementPositionInGrid)
+            computeExchangeDomainIndex(domainListDestP[elementPositionInGridDst2DomainPosition_[idx]],
+                                       domainListSrcP[elementPositionInGridSrc2DomainPosition_[idx]],
+                                       transPos,
+                                       globalElementIndexOnProc_[idx]);      
+
+        }
+        else if (1 == axisDomainDstOrder(idx))//it's an axis
+        {
+          if (idx != elementPositionInGrid)
+            computeExchangeAxisIndex(axisListDestP[elementPositionInGridDst2AxisPosition_[idx]],
+                                     axisListSrcP[elementPositionInGridSrc2AxisPosition_[idx]],
+                                     transPos,
+                                     globalElementIndexOnProc_[idx]);
+        }
+        else //it's a scalar
+        {
+          if (idx != elementPositionInGrid)
+            computeExchangeScalarIndex(scalarListDestP[elementPositionInGridDst2ScalarPosition_[idx]],
+                                       scalarListSrcP[elementPositionInGridSrc2ScalarPosition_[idx]],
+                                       transPos,
+                                       globalElementIndexOnProc_[idx]);
+
+        }
+      }
+    }
+
+    if (!isTransPosEmpty && !computedProcSrcNonTransformedElement_)
+    {
+      for (idx = 0; idx < globalElementIndexOnProc_.size(); ++idx)
+      {
+        if (idx != elementPositionInGrid)
+        {
+          boost::unordered_map<int,std::vector<size_t> >::iterator itb = globalElementIndexOnProc_[idx].begin(), it,
+                                                                   ite = globalElementIndexOnProc_[idx].end();
+          for (it = itb; it != ite; ++it) it->second.resize(1);
+        }
+      }
+    }
+
+/*      
+    if (!computedProcSrcNonTransformedElement_)
+    {
+      for (idx = 0; idx < globalElementIndexOnProc_.size(); ++idx)
+      {
+        if (idx != elementPositionInGrid)
+        {
+          boost::unordered_map<int,std::vector<size_t> >::iterator itb = globalElementIndexOnProc_[idx].begin(), it,
+                                                                   ite = globalElementIndexOnProc_[idx].end();
+          for (it = itb; it != ite; ++it) procOfNonTransformedElements_.insert(it->first);
+          if (procOfNonTransformedElements_.size() == nbClient)
+            break;
+        }
+      }
+    }
+   
+    // Processes contain the source index of transformed element
+    std::set<int> procOfTransformedElement; 
+    CClientClientDHTInt::Index2VectorInfoTypeMap::iterator itIdxb = globalIndexOfTransformedElementOnProc.begin(),
+                                                           itIdxe = globalIndexOfTransformedElementOnProc.end(), itIdx;
+    for (itIdx = itIdxb; itIdx != itIdxe; ++itIdx)
+    {
+      std::vector<int>& tmp = itIdx->second;
+      for (int i = 0; i < tmp.size(); ++i)
+        procOfTransformedElement.insert(tmp[i]);
+      if (tmp.size() == nbClient)
+        break;
+    }                                                           
+    
+    std::set<int>& commonProc = (procOfTransformedElement.size() < procOfNonTransformedElements_.size()) ? procOfTransformedElement 
+                              : (!procOfNonTransformedElements_.empty() ? procOfNonTransformedElements_ : procOfTransformedElement);
+    
+    std::vector<int> procContainSrcElementIdx(commonProc.size());
+    int count = 0;
+    for (std::set<int>::iterator it = commonProc.begin(); it != commonProc.end(); ++it)
+      procContainSrcElementIdx[count++] = *it;
+
+    procContainSrcElementIdx_.swap(procContainSrcElementIdx);    
+*/
+    
+    if (procElementList_.empty()) procElementList_.resize(axisDomainDstOrder.numElements()) ;
+    for (idx = 0; idx < axisDomainDstOrder.numElements(); ++idx)
+    {
+      std::set<int>& procList=procElementList_[idx] ;
+      std::set<int> commonTmp ;
+      if (idx == elementPositionInGrid)
+      {
+          set<int> tmpSet ; 
+          procList.swap(tmpSet) ;
+          CClientClientDHTInt::Index2VectorInfoTypeMap::iterator itIdxb = globalIndexOfTransformedElementOnProc_.begin(),
+                                                                 itIdxe = globalIndexOfTransformedElementOnProc_.end(), itIdx;
+          for (itIdx = itIdxb; itIdx != itIdxe; ++itIdx)
+          {
+             std::vector<int>& tmp = itIdx->second;
+             for (int i = 0; i < tmp.size(); ++i) procList.insert(tmp[i]);
+             if (tmp.size() == nbClient)
+             break;
+          }
+      }
+      else
+      {
+        if (!computedProcSrcNonTransformedElement_)
+        {
+          set<int> tmpSet ; 
+          procList.swap(tmpSet) ;
+          boost::unordered_map<int,std::vector<size_t> >::iterator itb = globalElementIndexOnProc_[idx].begin(), it,
+                                                                   ite = globalElementIndexOnProc_[idx].end();
+          for (it = itb; it != ite; ++it)
+          {
+            procList.insert(it->first);
+            if (procList.size() == nbClient)  break;
+          }
+        }
+      }
+
+      if (idx==0) commonProc_= procList ;
+      else
+      {
+        for (std::set<int>::iterator it = commonProc_.begin(); it != commonProc_.end(); ++it)
+          if (procList.count(*it)==1) commonTmp.insert(*it) ;
+        commonProc_.swap(commonTmp) ;
+      }
+    }
+    std::vector<int> procContainSrcElementIdx(commonProc_.size());
+    int count = 0;
+    for (std::set<int>::iterator it = commonProc_.begin(); it != commonProc_.end(); ++it) procContainSrcElementIdx[count++] = *it;
+    procContainSrcElementIdx_.swap(procContainSrcElementIdx);
+    
+        // For the first time, surely we calculate proc containing non transformed elements
+    if (!computedProcSrcNonTransformedElement_) computedProcSrcNonTransformedElement_ = true;
+  }
+  
   for (size_t idxTrans = 0; idxTrans < transformationMapping_.size(); ++idxTrans)
   {
@@ -243,6 +395,6 @@
 
     // Build mapping between global source element index and global destination element index.
-    boost::unordered_map<int,std::vector<size_t> >().swap(globalElementIndexOnProc[elementPositionInGrid]);
-    boost::unordered_map<int,int> tmpCounter;
+    boost::unordered_map<int,std::vector<size_t> >().swap(globalElementIndexOnProc_[elementPositionInGrid]);
+    std::set<int> tmpCounter;
     itTransWeight = itbTransWeight;
     for (itTransMap = itbTransMap; itTransMap != iteTransMap; ++itTransMap, ++itTransWeight)
@@ -250,63 +402,44 @@
       const std::vector<int>& srcIndex = itTransMap->second;
       const std::vector<double>& weight = itTransWeight->second;
-      for (int idx = 0; idx < srcIndex.size(); ++idx)
+      for (idx = 0; idx < srcIndex.size(); ++idx)
       {
         src2DstMap[srcIndex[idx]].push_back(make_pair(itTransMap->first, weight[idx]));
-        if (1 == globalIndexOfTransformedElementOnProc.count(srcIndex[idx]) && (0 == tmpCounter.count(srcIndex[idx])))
-        {
-          tmpCounter[srcIndex[idx]] = 1;
-          std::vector<int>& srcProc = globalIndexOfTransformedElementOnProc[srcIndex[idx]];
-          for (int j = 0; j < srcProc.size(); ++j)
-            globalElementIndexOnProc[elementPositionInGrid][srcProc[j]].push_back(srcIndex[idx]);
-        }
-      }
-    }
-
+        if (0 == tmpCounter.count(srcIndex[idx]))
+        {          
+          tmpCounter.insert(srcIndex[idx]);
+       
+          vector<int>& rankSrc = globalIndexOfTransformedElementOnProc_[srcIndex[idx]] ;
+          for (int n=0;n<rankSrc.size();++n)
+          {
+            if (commonProc_.count(rankSrc[n])==1) globalElementIndexOnProc_[elementPositionInGrid][rankSrc[n]].push_back(srcIndex[idx]);
+          }
+//          for (int j = 0; j < procContainSrcElementIdx_.size(); ++j)
+//            globalElementIndexOnProc_[elementPositionInGrid][procContainSrcElementIdx_[j]].push_back(srcIndex[idx]);
+        }
+      }
+    }
+  
     if (!isTransPosEmpty)
     {
-      for (int idx = 0; idx < globalElementIndexOnProc.size(); ++idx)
+      for (idx = 0; idx < globalElementIndexOnProc_.size(); ++idx)
       {
         if (idx != elementPositionInGrid)
         {
-          boost::unordered_map<int,std::vector<size_t> >::iterator itb = globalElementIndexOnProc[idx].begin(), it,
-                                                                   ite = globalElementIndexOnProc[idx].end();
+          boost::unordered_map<int,std::vector<size_t> >::iterator itb = globalElementIndexOnProc_[idx].begin(), it,
+                                                                   ite = globalElementIndexOnProc_[idx].end();
           for (it = itb; it != ite; ++it) it->second[0] = transPos(idxTrans);
         }
       }
-    }
-
-    std::vector<std::vector<bool> > elementOnProc(axisDomainDstOrder.numElements(), std::vector<bool>(nbClient, false));
-    boost::unordered_map<int,std::vector<size_t> >::const_iterator it, itb, ite;
-    for (int idx = 0; idx < globalElementIndexOnProc.size(); ++idx)
-    {
-      itb = globalElementIndexOnProc[idx].begin();
-      ite = globalElementIndexOnProc[idx].end();
-      for (it = itb; it != ite; ++it) elementOnProc[idx][it->first] = true;
-    }
-
-    // Determine procs which contain global source index
-    std::vector<bool> intersectedProc(nbClient, true);
-    for (int idx = 0; idx < axisDomainDstOrder.numElements(); ++idx)
-    {
-      std::transform(elementOnProc[idx].begin(), elementOnProc[idx].end(),
-                     intersectedProc.begin(), intersectedProc.begin(),
-                     std::logical_and<bool>());
-    }
-
-    std::vector<int> srcRank;
-    for (int idx = 0; idx < nbClient; ++idx)
-    {
-      if (intersectedProc[idx]) srcRank.push_back(idx);
     }
 
     // Ok, now compute global index of grid source and ones of grid destination
     computeGlobalGridIndexMapping(elementPositionInGrid,
-                                  srcRank,
+                                  procContainSrcElementIdx_, //srcRank,
                                   src2DstMap,
                                   gridSrc,
                                   gridDst,
-                                  globalElementIndexOnProc,
+                                  globalElementIndexOnProc_,
                                   globaIndexWeightFromSrcToDst);
-  }
+  }  
  }
 
@@ -316,8 +449,8 @@
   \param [in] srcRank rank of client from which we demand global index of element source
   \param [in] src2DstMap mapping of global index of element source and global index of element destination
-  \param[in] gridSrc Grid source
-  \param[in] gridDst Grid destination
-  \param[in] globalElementIndexOnProc Global index of element source on different client rank
-  \param[out] globaIndexWeightFromSrcToDst Mapping of global index of grid source and grid destination
+  \param [in] gridSrc Grid source
+  \param [in] gridDst Grid destination
+  \param [in] globalElementIndexOnProc Global index of element source on different client rank
+  \param [out] globaIndexWeightFromSrcToDst Mapping of global index of grid source and grid destination
 */
 void CGenericAlgorithmTransformation::computeGlobalGridIndexMapping(int elementPositionInGrid,
@@ -329,4 +462,10 @@
                                                                    SourceDestinationIndexMap& globaIndexWeightFromSrcToDst)
 {
+  SourceDestinationIndexMap globaIndexWeightFromSrcToDst_tmp ;
+  
+  CContext* context = CContext::getCurrent();
+  CContextClient* client=context->client;
+  int clientRank = client->clientRank;
+  
   std::vector<CDomain*> domainListSrcP = gridSrc->getDomains();
   std::vector<CAxis*> axisListSrcP = gridSrc->getAxis();
@@ -369,4 +508,6 @@
   size_t globalDstSize = 1;
   domainIndex = axisIndex = scalarIndex = 0;
+  set<size_t>  globalSrcStoreIndex ;
+  
   for (int idx = 0; idx < nbElement; ++idx)
   {
@@ -392,4 +533,7 @@
   }
 
+  std::map< std::pair<size_t,size_t>, int > rankMap ;
+  std::map< std::pair<size_t,size_t>, int >:: iterator rankMapIt ;
+  
   for (int i = 0; i < srcRank.size(); ++i)
   {
@@ -451,5 +595,9 @@
         for (int k = 0; k < globalElementDstIndexSize; ++k)
         {
-          globaIndexWeightFromSrcToDst[rankSrc][globalSrcIndex].push_back(make_pair(globalDstVecIndex[k],src2DstMap[currentIndexSrc[elementPositionInGrid]][k].second ));
+          
+          globaIndexWeightFromSrcToDst_tmp[rankSrc][globalSrcIndex].push_back(make_pair(globalDstVecIndex[k],src2DstMap[currentIndexSrc[elementPositionInGrid]][k].second ));
+          rankMapIt=rankMap.find(make_pair(globalSrcIndex,globalDstVecIndex[k])) ;
+          if (rankMapIt==rankMap.end()) rankMap[make_pair(globalSrcIndex,globalDstVecIndex[k])] = rankSrc ;
+          else if (rankSrc==clientRank) rankMapIt->second = rankSrc ;
         }
         ++idxLoop[0];
@@ -458,4 +606,39 @@
     }
   }
+
+  // eliminate redondant global src point owned by differrent processes.
+  // Avoid as possible to tranfer data from an other process if the src point is also owned by current process 
+      int rankSrc ;
+      size_t globalSrcIndex ;
+      size_t globalDstIndex ;
+      double weight ;
+ 
+      SourceDestinationIndexMap::iterator rankIt,rankIte ;
+      boost::unordered_map<size_t, std::vector<std::pair<size_t,double> > >::iterator globalSrcIndexIt, globalSrcIndexIte ;
+      std::vector<std::pair<size_t,double> >::iterator vectIt,vectIte ;
+   
+      rankIt=globaIndexWeightFromSrcToDst_tmp.begin() ; rankIte=globaIndexWeightFromSrcToDst_tmp.end() ;
+      for(;rankIt!=rankIte;++rankIt)
+      {
+        rankSrc = rankIt->first ;
+        globalSrcIndexIt = rankIt->second.begin() ; globalSrcIndexIte = rankIt->second.end() ;
+        for(;globalSrcIndexIt!=globalSrcIndexIte;++globalSrcIndexIt)
+        { 
+          globalSrcIndex = globalSrcIndexIt->first ;
+          vectIt = globalSrcIndexIt->second.begin() ; vectIte = globalSrcIndexIt->second.end() ;
+          for(vectIt; vectIt!=vectIte; vectIt++)
+          {
+            globalDstIndex = vectIt->first ;
+            weight = vectIt->second ;
+            if (eliminateRedondantSrc_)
+            {
+              if (rankMap[make_pair(globalSrcIndex,globalDstIndex)] == rankSrc)  
+                globaIndexWeightFromSrcToDst[rankSrc][globalSrcIndex].push_back(make_pair(globalDstIndex,weight)) ;
+            }
+            else globaIndexWeightFromSrcToDst[rankSrc][globalSrcIndex].push_back(make_pair(globalDstIndex,weight)) ;
+         }
+       }
+     }
+
 }
 
@@ -507,6 +690,9 @@
   for (int idx = 0; idx < nIndexSize; ++idx)
   {
-    globalIndex = axisSrc->index(idx);
-    globalIndex2ProcRank[globalIndex].push_back(clientRank);
+    if (axisSrc->mask(idx))
+    {
+      globalIndex = axisSrc->index(idx);
+      globalIndex2ProcRank[globalIndex].push_back(clientRank);
+    }
   }
 
@@ -574,4 +760,5 @@
   CClientClientDHTInt::Index2VectorInfoTypeMap globalIndex2ProcRank;
   globalIndex2ProcRank.rehash(std::ceil(nIndexSize/globalIndex2ProcRank.max_load_factor()));
+  
   if (destGlobalIndexPositionInGrid.isEmpty())
   {
@@ -581,7 +768,10 @@
       j_ind=domainSrc->j_index(idx) ;
 
-      globalIndex = i_ind + j_ind * niGlobSrc;
-      globalIndex2ProcRank[globalIndex].resize(1);
-      globalIndex2ProcRank[globalIndex][0] = clientRank;
+      if (domainSrc->localMask(idx))
+      {
+        globalIndex = i_ind + j_ind * niGlobSrc;
+        globalIndex2ProcRank[globalIndex].resize(1);
+        globalIndex2ProcRank[globalIndex][0] = clientRank;
+      }
     }
   }
@@ -590,5 +780,6 @@
     for (int idx = 0; idx < nIndexSize; ++idx)
     {
-      globalIndex2ProcRank[destGlobalIndexPositionInGrid(idx)].push_back(clientRank);
+//      if (domainSrc->localMask(idx)) -> not necessairy, mask seem to be included in  destGlobalIndexPositionInGrid(idx)    (ym)
+        globalIndex2ProcRank[destGlobalIndexPositionInGrid(idx)].push_back(clientRank);
     }
   }
@@ -647,4 +838,295 @@
   }
 }
+
+
+
+
+
+
+void CGenericAlgorithmTransformation::computeTransformationMappingNonDistributed(int elementPositionInGrid, CGrid* gridSrc, CGrid* gridDst,
+                                                                                 vector<int>& localSrc, vector<int>& localDst, vector<double>& weight, vector<bool>& localMaskOnGridDest)
+{
+
+  CContext* context = CContext::getCurrent();
+  CContextClient* client = context->client;
+  int nbClient = client->clientSize;
+
+  computePositionElements(gridDst, gridSrc);
+  std::vector<CScalar*> scalarListDstP = gridDst->getScalars();
+  std::vector<CAxis*> axisListDstP = gridDst->getAxis();
+  std::vector<CDomain*> domainListDstP = gridDst->getDomains();
+  CArray<int,1> axisDomainDstOrder = gridDst->axis_domain_order;
+  std::vector<CScalar*> scalarListSrcP  = gridSrc->getScalars();
+  std::vector<CAxis*> axisListSrcP = gridSrc->getAxis();
+  std::vector<CDomain*> domainListSrcP = gridSrc->getDomains();
+  CArray<int,1> axisDomainSrcOrder = gridSrc->axis_domain_order;  
+
+  int nElement=axisDomainSrcOrder.numElements() ;
+  int indSrc=1 ;
+  int indDst=1 ;
+  vector<int> nIndexSrc(nElement) ;
+  vector<int> nIndexDst(nElement) ;
+  vector< CArray<bool,1>* > maskSrc(nElement) ;
+  vector< CArray<bool,1>* > maskDst(nElement) ;
+    
+  int nlocalIndexSrc=1 ;
+  int nlocalIndexDest=1 ;
+  CArray<bool,1> maskScalar(1) ;
+  maskScalar  = true ;
+  
+  
+  for(int i=0 ; i<nElement; i++)
+  {
+    int dimElement = axisDomainSrcOrder(i);
+    if (2 == dimElement) //domain
+    {
+      CDomain* domain=domainListSrcP[elementPositionInGridSrc2DomainPosition_[i]] ;
+      nIndexSrc[i] = domain->i_index.numElements() ;
+      maskSrc[i]=&domain->localMask ;
+    }
+    else if (1 == dimElement) //axis
+    {
+      CAxis* axis=axisListSrcP[elementPositionInGridSrc2AxisPosition_[i]] ;
+      nIndexSrc[i] = axis->index.numElements() ;
+      maskSrc[i]=&axis->mask ;
+    }
+    else  //scalar
+    {
+      nIndexSrc[i]=1 ;
+      maskSrc[i]=&maskScalar ;
+    }
+    nlocalIndexSrc=nlocalIndexSrc*nIndexSrc[i] ;
+  }
+
+
+
+  int offset=1 ;
+  for(int i=0 ; i<nElement; i++)
+  {
+    int dimElement = axisDomainDstOrder(i);
+    if (2 == dimElement) //domain
+    {
+      CDomain* domain=domainListDstP[elementPositionInGridDst2DomainPosition_[i]] ;
+      int nIndex=domain->i_index.numElements() ;
+      CArray<bool,1>& localMask=domain->localMask ;
+      int nbInd=0 ;
+      for(int j=0;j<nIndex;j++) if (localMask(j)) nbInd++ ;
+      nIndexDst[i] = nbInd ;
+      maskDst[i]=&domain->localMask ;
+    }
+    else if (1 == dimElement) //axis
+    {
+      CAxis* axis = axisListDstP[elementPositionInGridDst2AxisPosition_[i]] ;
+      int nIndex=axis->index.numElements() ;
+      CArray<bool,1>& localMask=axis->mask ;
+      int nbInd=0 ;
+      for(int j=0;j<nIndex;j++) if (localMask(j)) nbInd++ ;
+      nIndexDst[i] = nbInd ;
+      maskDst[i]=&axis->mask ;
+    }
+    else  //scalar
+    {
+      nIndexDst[i]=1 ;
+      maskDst[i]=&maskScalar ;
+    }
+    if (i<elementPositionInGrid) offset=offset*nIndexDst[i] ;
+    nlocalIndexDest=nlocalIndexDest*nIndexDst[i] ;
+  }
+
+
+
+
+
+
+  vector<int> dstLocalInd ;
+  int dimElement = axisDomainDstOrder(elementPositionInGrid);
+  if (2 == dimElement) //domain
+  {
+    CDomain* domain = domainListDstP[elementPositionInGridDst2DomainPosition_[elementPositionInGrid]] ;
+    int ni_glo=domain->ni_glo ;
+    int nj_glo=domain->nj_glo ;
+    int nindex_glo=ni_glo*nj_glo ;
+    dstLocalInd.resize(nindex_glo,-1) ;
+    int nIndex=domain->i_index.numElements() ;
+    CArray<bool,1>& localMask=domain->localMask ;
+    int unmaskedInd=0 ;
+    int globIndex ;
+    for(int i=0;i<nIndex;i++)
+    {
+      if (localMask(i))
+      {
+        globIndex=domain->j_index(i)*ni_glo+domain->i_index(i) ;
+        dstLocalInd[globIndex]=unmaskedInd ;
+        unmaskedInd++ ;
+      }
+    }
+  }
+  else if (1 == dimElement) //axis
+  {
+    CAxis* axis = axisListDstP[elementPositionInGridDst2AxisPosition_[elementPositionInGrid]] ;
+    int nindex_glo=axis->n_glo ;
+    dstLocalInd.resize(nindex_glo,-1) ;
+    int nIndex=axis->index.numElements() ;
+    CArray<bool,1>& localMask=axis->mask ; // axis mask must include later data_index
+    int unmaskedInd=0 ;
+    for(int i=0;i<nIndex;i++)
+    {
+      if (localMask(i))
+      {
+        dstLocalInd[axis->index(i)]=unmaskedInd ;
+        unmaskedInd++ ;
+      }
+    }
+  }
+  else  //scalar
+  {
+    dstLocalInd.resize(1) ; 
+    dstLocalInd[0]=0 ; 
+  }
+
+// just get the local src mask
+  CArray<bool,1> localMaskOnSrcGrid;
+  gridSrc->getLocalMask(localMaskOnSrcGrid) ;
+// intermediate grid, mask is not initialized => set up mask to true
+  if (localMaskOnSrcGrid.isEmpty())
+  {
+    localMaskOnSrcGrid.resize(nlocalIndexSrc) ;
+    localMaskOnSrcGrid=true ;
+  }
+  
+
+  localMaskOnGridDest.resize(nlocalIndexDest,false) ;
+
+  vector<vector<vector<pair<int,double> > > > dstIndWeight(transformationMapping_.size()) ;
+   
+  for(int t=0;t<transformationMapping_.size();++t)
+  {
+    TransformationIndexMap::const_iterator   itTransMap = transformationMapping_[t].begin(),
+                                             iteTransMap = transformationMapping_[t].end();
+    TransformationWeightMap::const_iterator itTransWeight = transformationWeight_[t].begin();
+    dstIndWeight[t].resize(nIndexSrc[elementPositionInGrid]) ;
+    
+    for(;itTransMap!=iteTransMap;++itTransMap,++itTransWeight)
+    {
+      int dst=dstLocalInd[itTransMap->first] ;
+      if (dst!=-1)
+      {
+        const vector<int>& srcs=itTransMap->second;
+        const vector<double>& weights=itTransWeight->second;
+        for(int i=0;i<srcs.size() ;i++) dstIndWeight[t][srcs[i]].push_back(pair<int,double>(dst*offset+t,weights[i])) ;
+      }
+    }
+  }
+  int srcInd=0 ;  
+  int currentInd ;
+  int t=0 ;  
+  int srcIndCompressed=0 ;
+  
+  nonDistributedrecursiveFunct(nElement-1,true,elementPositionInGrid,maskSrc,maskDst, srcInd, srcIndCompressed, nIndexSrc, t, dstIndWeight,  
+                               currentInd,localSrc,localDst,weight, localMaskOnSrcGrid, localMaskOnGridDest );
+               
+}
+
+
+void CGenericAlgorithmTransformation::nonDistributedrecursiveFunct(int currentPos, bool masked, int elementPositionInGrid, vector< CArray<bool,1>* >& maskSrc, vector< CArray<bool,1>* >& maskDst, int& srcInd, int& srcIndCompressed, vector<int>& nIndexSrc, int& t, vector<vector<vector<pair<int,double> > > >& dstIndWeight, int currentInd,
+                    vector<int>& localSrc, vector<int>& localDst, vector<double>& weight,  CArray<bool,1>& localMaskOnGridSrc, vector<bool>& localMaskOnGridDest )
+{
+  int masked_ ;
+  if (currentPos!=elementPositionInGrid)
+  {
+    if (currentPos!=0)
+    {
+      CArray<bool,1>& mask = *maskSrc[currentPos] ;
+     
+      for(int i=0;i<nIndexSrc[currentPos];i++)
+      {
+        masked_=masked ;
+        if (!mask(i)) masked_=false ;
+        nonDistributedrecursiveFunct(currentPos-1, masked_, elementPositionInGrid, maskSrc, maskDst, srcInd, srcIndCompressed, nIndexSrc, t, dstIndWeight, currentInd, localSrc, localDst, weight, localMaskOnGridSrc, localMaskOnGridDest) ;
+      }
+    }
+    else
+    {
+      CArray<bool,1>& mask = *maskSrc[currentPos] ;
+      for(int i=0;i<nIndexSrc[currentPos];i++)
+      {
+        if (masked && mask(i))
+        {
+          if (dstIndWeight[t][currentInd].size()>0)
+          {
+            for(vector<pair<int,double> >::iterator it = dstIndWeight[t][currentInd].begin(); it!=dstIndWeight[t][currentInd].end(); ++it)
+            {
+              if (localMaskOnGridSrc(srcInd))
+              {
+                localSrc.push_back(srcIndCompressed) ;
+                localDst.push_back(it->first) ;
+                weight.push_back(it->second) ;
+                localMaskOnGridDest[it->first]=true ;
+              }
+              (it->first)++ ;
+            }
+          }
+          if (t < dstIndWeight.size()-1) t++ ;
+          if (localMaskOnGridSrc(srcInd)) srcIndCompressed ++ ;
+        }
+        srcInd++ ;
+      }
+    }
+  }
+  else
+  {
+ 
+    if (currentPos!=0)
+    {
+
+      CArray<bool,1>& mask = *maskSrc[currentPos] ;
+      for(int i=0;i<nIndexSrc[currentPos];i++)
+      {
+        t=0 ;
+        masked_=masked ;
+        if (!mask(i)) masked_=false ; 
+        nonDistributedrecursiveFunct(currentPos-1, masked_, elementPositionInGrid, maskSrc, maskDst, srcInd, srcIndCompressed, nIndexSrc, t, dstIndWeight , i,  localSrc, localDst, weight, localMaskOnGridSrc, localMaskOnGridDest) ;
+      }
+    }
+    else
+    {
+      for(int i=0;i<nIndexSrc[currentPos];i++)
+      {
+        if (masked)
+        {
+          t=0 ;        
+          if (dstIndWeight[t][i].size()>0)
+          {
+            for(vector<pair<int,double> >::iterator it = dstIndWeight[t][i].begin(); it!=dstIndWeight[t][i].end(); ++it)
+            {
+              if (localMaskOnGridSrc(srcInd))
+              {
+                localSrc.push_back(srcIndCompressed) ;
+                localDst.push_back(it->first) ;
+                weight.push_back(it->second) ;
+                localMaskOnGridDest[it->first]=true ;
+              }
+              (it->first)++ ;
+            }
+           }
+          if (t < dstIndWeight.size()-1) t++ ;
+          if (localMaskOnGridSrc(srcInd)) srcIndCompressed ++ ;
+        }
+        srcInd++ ;
+      }
+    }
+  }
+
+}
+
+
+
+
+
+
+
+
+
+
 
 /*!
Index: /XIOS/trunk/src/transformation/generic_algorithm_transformation.hpp
===================================================================
--- /XIOS/trunk/src/transformation/generic_algorithm_transformation.hpp	(revision 1536)
+++ /XIOS/trunk/src/transformation/generic_algorithm_transformation.hpp	(revision 1537)
@@ -52,4 +52,6 @@
   virtual ~CGenericAlgorithmTransformation() {}
 
+  bool isDistributedTransformation(int elementPositionInGrid, CGrid* gridSrc, CGrid* gridDst) ;
+
   void computeGlobalSourceIndex(int elementPositionInGrid,
                                CGrid* gridSrc,
@@ -85,4 +87,8 @@
   */
   void computeIndexSourceMapping(const std::vector<CArray<double,1>* >& dataAuxInputs = std::vector<CArray<double,1>* >());
+  void computeTransformationMappingNonDistributed(int elementPositionInGrid, CGrid* gridSrc, CGrid* gridDst,
+                                                  vector<int>& localSrc, vector<int>& localDst, vector<double>& weight, vector<bool>& localMaskOnGridDest);
+  void nonDistributedrecursiveFunct(int currentPos, bool masked, int elementPositionInGrid,  vector< CArray<bool,1>* >& maskSrc, vector< CArray<bool,1>* >& maskDst, int& srcInd, int& srcIndCompressed, vector<int>& nIndexSrc, int& t, vector<vector<vector<pair<int,double> > > >& dstIndWeight, int currentInd,
+                                     vector<int>& localSrc, vector<int>& localDst, vector<double>& weight, CArray<bool,1>& localMaskOnGridSrc, vector<bool>& localMaskOnGridDest) ;
 
 protected:
@@ -126,4 +132,9 @@
 
 protected:
+  //! indicate if the transformation is performed on a distributed element
+  bool isDistributed_ ;
+  //! indicate if the method  isDistributedTransformation has been called before
+  bool isDistributedComputed_ ;
+  
   //! Map between global index of destination element and source element
   std::vector<TransformationIndexMap> transformationMapping_;
@@ -138,6 +149,22 @@
   AlgoTransType type_;
 
+  std::set<StdSize> indexElementSrc_;
+
+  std::vector<boost::unordered_map<int,std::vector<size_t> > > globalElementIndexOnProc_;
+
+  std::vector<int> procContainSrcElementIdx_;  // List of processes containing source index of transformed elements
+//  std::set<int> procOfNonTransformedElements_; // Processes contain the source index of non-transformed elements
+  std::set<int> commonProc_;
+  std::vector< set<int> > procElementList_ ; // List of processes containing source index of elements
+
+  CClientClientDHTInt::Index2VectorInfoTypeMap globalIndexOfTransformedElementOnProc_;
+  
+  bool computedProcSrcNonTransformedElement_; // Flag to indicate whether we computed proc containing non transformed elements
+
   std::map<int, int> elementPositionInGridSrc2AxisPosition_, elementPositionInGridSrc2DomainPosition_, elementPositionInGridSrc2ScalarPosition_;
   std::map<int, int> elementPositionInGridDst2AxisPosition_, elementPositionInGridDst2DomainPosition_, elementPositionInGridDst2ScalarPosition_;
+
+  bool eliminateRedondantSrc_ ; // flag to indicate if the transformation must select only one global source point for all proc.
+                               // In this case it will choose preferentially the current process 
 };
 
Index: /XIOS/trunk/src/transformation/grid_transformation.cpp
===================================================================
--- /XIOS/trunk/src/transformation/grid_transformation.cpp	(revision 1536)
+++ /XIOS/trunk/src/transformation/grid_transformation.cpp	(revision 1537)
@@ -16,4 +16,5 @@
 #include "grid.hpp"
 #include <boost/unordered_map.hpp>
+#include "timer.hpp"
 
 namespace xios {
@@ -385,16 +386,62 @@
         (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;
-      algo->computeGlobalSourceIndex(elementPosition,
-                                     gridSource_,
-                                     tmpGridDestination_,
-                                     globaIndexWeightFromSrcToDst);
-
-      // Compute transformation of global indexes among grids
-      computeTransformationMapping(globaIndexWeightFromSrcToDst);
-
+      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 ;
+        localMaskOnGridDest_.push_back(vector<bool>()) ;
+        CTimer::get("computeTransformationMappingNonDistributed").resume();  
+        algo->computeTransformationMappingNonDistributed(elementPosition, gridSource_, tmpGridDestination_, 
+                                                         localSrc, localDst, weight, localMaskOnGridDest_.back()) ;
+        CTimer::get("computeTransformationMappingNonDistributed").suspend();  
+
+        CTimer::get("computeTransformationMappingConvert").resume();  
+        nbLocalIndexOnGridDest_.push_back(localMaskOnGridDest_.back().size()) ;
+        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_)
       {
Index: /XIOS/trunk/src/transformation/grid_transformation_selector.cpp
===================================================================
--- /XIOS/trunk/src/transformation/grid_transformation_selector.cpp	(revision 1536)
+++ /XIOS/trunk/src/transformation/grid_transformation_selector.cpp	(revision 1537)
@@ -22,4 +22,5 @@
   CScalarAlgorithmExtractAxis::registerTrans();
   CScalarAlgorithmReduceDomain::registerTrans();
+  CScalarAlgorithmReduceScalar::registerTrans();
 
   //! Axis
@@ -29,4 +30,7 @@
   CAxisAlgorithmInverse::registerTrans();
   CAxisAlgorithmReduceDomain::registerTrans();
+  CAxisAlgorithmReduceAxis::registerTrans();
+  CAxisAlgorithmTemporalSplitting::registerTrans();
+  CAxisAlgorithmDuplicateScalar::registerTrans();
 
   //! Domain
@@ -35,4 +39,5 @@
   CDomainAlgorithmZoom::registerTrans();
   CDomainAlgorithmExpand::registerTrans();
+  CDomainAlgorithmReorder::registerTrans();
 }
 
Index: /XIOS/trunk/src/transformation/grid_transformation_selector.hpp
===================================================================
--- /XIOS/trunk/src/transformation/grid_transformation_selector.hpp	(revision 1536)
+++ /XIOS/trunk/src/transformation/grid_transformation_selector.hpp	(revision 1537)
@@ -51,4 +51,11 @@
   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:
Index: /XIOS/trunk/src/transformation/scalar_algorithm_reduce_domain.cpp
===================================================================
--- /XIOS/trunk/src/transformation/scalar_algorithm_reduce_domain.cpp	(revision 1536)
+++ /XIOS/trunk/src/transformation/scalar_algorithm_reduce_domain.cpp	(revision 1537)
@@ -46,4 +46,6 @@
    reduction_(0)
 {
+  algo->checkValid(scalarDestination, domainSource);
+  
   StdString op;
   switch (algo->operation)
@@ -76,4 +78,5 @@
 
   reduction_ = CReductionAlgorithm::createOperation(CReductionAlgorithm::ReductionOperations[op]);
+  local = algo->local ;
 }
 
@@ -105,12 +108,32 @@
   TransformationWeightMap& transWeight = this->transformationWeight_[0];
 
-  int globalIndexSize = domainSrc_->ni_glo * domainSrc_->nj_glo;  
+  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();
 
-  transMap[0].resize(globalIndexSize);
-  transWeight[0].resize(globalIndexSize, 1.0);
-  for (int idx = 0; idx < globalIndexSize; ++idx)
-  {     
-    transMap[0][idx] = idx;    
+      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;    
+  }
+  
 }
 
Index: /XIOS/trunk/src/transformation/scalar_algorithm_reduce_domain.hpp
===================================================================
--- /XIOS/trunk/src/transformation/scalar_algorithm_reduce_domain.hpp	(revision 1536)
+++ /XIOS/trunk/src/transformation/scalar_algorithm_reduce_domain.hpp	(revision 1537)
@@ -41,4 +41,5 @@
   static bool registerTrans();
 protected:
+  bool local ;
   void computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs);
 
Index: /XIOS/trunk/src/transformation/scalar_algorithm_reduce_scalar.cpp
===================================================================
--- /XIOS/trunk/src/transformation/scalar_algorithm_reduce_scalar.cpp	(revision 1537)
+++ /XIOS/trunk/src/transformation/scalar_algorithm_reduce_scalar.cpp	(revision 1537)
@@ -0,0 +1,111 @@
+/*!
+   \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)
+{
+  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));
+}
+
+bool CScalarAlgorithmReduceScalar::registerTrans()
+{
+  CGridTransformationFactory<CScalar>::registerTransformation(TRANS_REDUCE_SCALAR_TO_SCALAR, create);
+}
+
+CScalarAlgorithmReduceScalar::CScalarAlgorithmReduceScalar(CScalar* scalarDestination, CScalar* scalarSource, CReduceScalarToScalar* algo)
+ : CScalarAlgorithmTransformation(scalarDestination, scalarSource),
+   reduction_(0)
+{
+  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]);
+}
+
+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)
+{
+  reduction_->apply(localIndex, dataInput, dataOut, flagInitial, ignoreMissingValue, firstPass);
+}
+
+void CScalarAlgorithmReduceScalar::updateData(CArray<double,1>& dataOut)
+{
+  reduction_->updateData(dataOut);
+}
+
+CScalarAlgorithmReduceScalar::~CScalarAlgorithmReduceScalar()
+{
+  if (0 != reduction_) delete reduction_;
+}
+
+void CScalarAlgorithmReduceScalar::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];
+
+  transMap[0].push_back(0);
+  transWeight[0].push_back(1.0);
+
+}
+
+}
Index: /XIOS/trunk/src/transformation/scalar_algorithm_reduce_scalar.hpp
===================================================================
--- /XIOS/trunk/src/transformation/scalar_algorithm_reduce_scalar.hpp	(revision 1537)
+++ /XIOS/trunk/src/transformation/scalar_algorithm_reduce_scalar.hpp	(revision 1537)
@@ -0,0 +1,57 @@
+/*!
+   \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();
+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/trunk/src/transformation/scalar_algorithm_transformation.cpp
===================================================================
--- /XIOS/trunk/src/transformation/scalar_algorithm_transformation.cpp	(revision 1536)
+++ /XIOS/trunk/src/transformation/scalar_algorithm_transformation.cpp	(revision 1537)
@@ -70,12 +70,15 @@
     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)
     {
-      globalIndex = jIndex(idx) * niGlo + iIndex(idx);
-      globalIndex2ProcRank[globalIndex].resize(1);
-      globalIndex2ProcRank[globalIndex][0] = clientRank;
+      if (localMask(idx))
+      {
+        globalIndex = jIndex(idx) * niGlo + iIndex(idx);
+        globalIndex2ProcRank[globalIndex].resize(1);
+        globalIndex2ProcRank[globalIndex][0] = clientRank;
+      }
     }
 
@@ -90,9 +93,14 @@
     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)
     {
-      globalIndex = axisSrc_->index(idx);
-      globalIndex2ProcRank[globalIndex].resize(1);
-      globalIndex2ProcRank[globalIndex][0] = clientRank;
+      if (localMask(idx))
+      {
+        globalIndex = axisSrc_->index(idx);
+        globalIndex2ProcRank[globalIndex].resize(1);
+        globalIndex2ProcRank[globalIndex][0] = clientRank;
+      }
     }
 
Index: /XIOS/trunk/src/type/type_decl.cpp
===================================================================
--- /XIOS/trunk/src/type/type_decl.cpp	(revision 1536)
+++ /XIOS/trunk/src/type/type_decl.cpp	(revision 1537)
@@ -3,5 +3,5 @@
 #include "type_ref_impl.hpp"
 #include "type_specialisation.hpp"
-#include <string> ;
+#include <string>
 #include "date.hpp"
 #include "xios_spl.hpp"
Index: /XIOS/trunk/src/type/type_util.hpp
===================================================================
--- /XIOS/trunk/src/type/type_util.hpp	(revision 1536)
+++ /XIOS/trunk/src/type/type_util.hpp	(revision 1537)
@@ -38,4 +38,6 @@
     class CReduceDomainToAxis;
     class CReduceDomainToAxisGroup;
+    class CReduceAxisToAxis;
+    class CReduceAxisToAxisGroup;
     class CExtractDomainToAxis;
     class CExtractDomainToAxisGroup;
@@ -48,5 +50,13 @@
     class CReduceDomainToScalar;
     class CReduceDomainToScalarGroup;
-
+    class CTemporalSplitting;
+    class CTemporalSplittingGroup;
+    class CDuplicateScalarToAxis;
+    class CDuplicateScalarToAxisGroup;
+    class CReduceScalarToScalar;
+    class CReduceScalarToScalarGroup;
+    class CReorderDomain;
+    class CReorderDomainGroup;
+     
   template <typename T> inline string getStrType(void);
 
@@ -102,4 +112,6 @@
   macro(CReduceDomainToAxis)
   macro(CReduceDomainToAxisGroup)
+  macro(CReduceAxisToAxis)
+  macro(CReduceAxisToAxisGroup)
   macro(CExtractDomainToAxis)
   macro(CExtractDomainToAxisGroup)
@@ -112,4 +124,12 @@
   macro(CReduceDomainToScalar)
   macro(CReduceDomainToScalarGroup)
+  macro(CTemporalSplitting)
+  macro(CTemporalSplittingGroup)
+  macro(CDuplicateScalarToAxis)
+  macro(CDuplicateScalarToAxisGroup)
+  macro(CReduceScalarToScalar)
+  macro(CReduceScalarToScalarGroup)
+  macro(CReorderDomain)
+  macro(CReorderDomainGroup)
   
 #undef macro
Index: /XIOS/trunk/src/xml_node.cpp
===================================================================
--- /XIOS/trunk/src/xml_node.cpp	(revision 1536)
+++ /XIOS/trunk/src/xml_node.cpp	(revision 1537)
@@ -1,3 +1,4 @@
 #include "xml_node.hpp"
+#include <boost/algorithm/string.hpp>
 
 namespace xios
@@ -26,5 +27,5 @@
          bool retvalue = false;
          for(rapidxml::xml_node<char> * nextElement = this->node->next_sibling();
-                                      ; nextElement = this->node->next_sibling())
+                                      ; nextElement = nextElement->next_sibling())
          {
             if (nextElement == NULL) break;
@@ -44,5 +45,5 @@
          if (nextElement != NULL)
          {
-            for(;;nextElement = this->node->next_sibling())
+            for(;;nextElement = nextElement->next_sibling())
             {
                if (nextElement == NULL) break;
@@ -67,5 +68,5 @@
          return (!retvalue);
       }
-
+/*
       bool CXMLNode::getContent(StdString & content)
       {
@@ -73,4 +74,21 @@
          content.assign(this->node->value(), this->node->value_size());
          return (true);
+      }
+*/
+      bool CXMLNode::getContent(StdString & content)
+      {
+         content="" ;
+         bool retvalue = false;
+         
+         rapidxml::xml_node<char> * nextElement = this->node->first_node();
+         while (nextElement != NULL)
+         {
+             if (nextElement->type() == rapidxml::node_data) content=content+std::string(nextElement->value(),nextElement->value_size());
+             nextElement = nextElement->next_sibling(); 
+         }
+         boost::algorithm::replace_all(content,"\n"," ") ;
+         boost::algorithm::trim(content) ;
+         if (content.size()==0) return false ;
+         else return true ;
       }
 
Index: /XIOS/trunk/src/xml_parser_decl.cpp
===================================================================
--- /XIOS/trunk/src/xml_parser_decl.cpp	(revision 1536)
+++ /XIOS/trunk/src/xml_parser_decl.cpp	(revision 1537)
@@ -28,4 +28,5 @@
     macro( ReduceAxisToScalar )
     macro( ReduceDomainToAxis )
+    macro( ReduceAxisToAxis )
     macro( ExtractDomainToAxis )
     macro( ComputeConnectivityDomain )
@@ -33,4 +34,8 @@
     macro( ExtractAxisToScalar )
     macro( ReduceDomainToScalar )
+    macro( TemporalSplitting )
+    macro( DuplicateScalarToAxis )
+    macro( ReduceScalarToScalar )
+    macro( ReorderDomain )
   }
 }
